Shop OBEX P1 Docs P2 Docs Learn Events
dump frame with cmucam — Parallax Forums

dump frame with cmucam

earl_24earl_24 Posts: 9
edited 2008-03-17 15:59 in Robotics
i'm trying to dump a frame using cmucam but the result is not what i was expecting.

this is the code:

SEROUT 7, 32, [noparse][[/noparse]"RM 3",CR]
PAUSE 100
PAUSE 100
DO
SEROUT 7, 32, [noparse][[/noparse]"DF",CR]
FOR i=1 TO 200
ERIN 9,32,[noparse][[/noparse]RBData]
DEBUG " ",DEC RBDATA,"(",DEC i,") "
SERIN 9,32,[noparse][[/noparse]RBData]
NEXT

this is what debug command return:

33(1) 48(2) 252(3) 20(4) 106(5) 90(6) 66(7) 5
4(8) 37(9) 54(10) 150(11) 130(12) 11(13) 224(14)
9(15) 252(16) 55(17) 113(18) 252(19) 138(20) 252(21
) 53(22) 120(23) 252(24) 42(25) 113(26) 10(27) 2
37(28) 99(29) 73(30) 119(31) 31(32) 217(33) 105(34)
73(35) 233(36) 49(37) 124(38) 252(39) 168(40) 25
2(41) 49(42) 124(43) 252(44) 64(45) 135(46) 50(47)
119(48) 252(49) 34(50) 63(51) 51(52) 117(53) 252(
54) 59(55) 141(56) 55(57) 112(58) 252(59) 56(60)
144(61) 57(62) 110(63) 252(64) 226(65) 147(66) 38(6
7) 217(68) 122(69) 163(70) 150(71) 36(72) 201(73)
130(74) 36(75) 130(76) 62(77) 112(78) 252(79) 169(
80) 252(81) 65(82) 114(83) 252(84) 38(85) 164(86)
65(87) 116(88) 252(89) 76(90) 154(91) 67(92) 120(9
3) 252(94) 48(95) 169(96) 65(97) 121(98) 252(99)
47(100) 252(101) 252(102) 174(103) 59(104) 16(105)
77(106) 84(107) 180(108) 61(109) 20(110) 51(111) 81(
112) 178(113) 169(114) 20(115) 143(116) 37(117) 252(
118) 40(119) 252(120) 59(121) 21(122) 157(123) 39(12
4) 252(125) 21(126) 153(127) 54(128) 154(129) 252(13
0) 226(131) 200(132) 66(133) 16(134) 182(135) 78(136
) 252(137) 58(138) 252(139) 2(140) 25(141) 139(142)
226(143) 5(144) 58(145) 16(146) 77(147) 4(148) 5
(149) 68(150) 252(151) 157(152) 67(153) 252(154) 21(
155) 142(156) 57(157) 18(158) 218(159) 146(160) 86(1
61) 241(162) 187(163) 86(164) 180(165) 252(166) 252(
167) 200(168) 65(169) 16(170) 154(171) 36(172) 252(1
73) 24(174) 91(175) 252(176) 41(177) 252(178) 19(179
) 201(180) 52(181) 17(182) 103(183) 44(184) 252(185)
42(186) 252(187) 2(188) 31(189) 54(190) 68(191)
192(192) 23(193) 20(194) 198(195) 218(196) 22(197)




the bytes sent by the camera are not starting with 1(new frame),2(new column). I do not understand why?? and why just 197 Bytes??

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-03-17 15:38
    You're probably missing a lot of the bytes. When the Stamp is executing other statements (other than the SERIN), it's not listening to the serial line and anything sent will be ignored. In addition, you've got a 32 as the Baud mode constant which specifies a Baud over 19.2KBaud. While some Stamps can send at 19.2KBaud, none of them can receive reliably beyond 9600 Baud and it's usually recommended to use 4800 Baud at most.
  • earl_24earl_24 Posts: 9
    edited 2008-03-17 15:51
    but the camera can work just with 9600,115k and 19.2k baud, at 9600 the result is the same. I miss something, is not clear to me what means raw mode?
  • Mike GreenMike Green Posts: 23,101
    edited 2008-03-17 15:59
    The only way you have any chance of using the camera directly with a Stamp reliably at 9600 Baud is by using the handshake lines (RTS / CTS). Read the Parallax Basic Stamp Manual chapter on the SERIN statement for details. You could also buy a 3rd party serial input buffer like those from Protean-Logic, but their buffer is too small to help much with an image dump.

    I don't know what raw mode is for the CMUcam, but it's probably the unprocessed data from the image sensor.

    Some of the Stamps, like the BS2p/pe/px, have what's called a scratchpad RAM which can help with larger input strings, but the largest RAM is about 120 bytes which is still not large enough to help out here.

    Post Edited (Mike Green) : 3/17/2008 4:04:27 PM GMT
Sign In or Register to comment.