Shop OBEX P1 Docs P2 Docs Learn Events
2-bit preview for serial camera — Parallax Forums

2-bit preview for serial camera

RaymanRayman Posts: 14,151
edited 2007-11-13 22:53 in Propeller 1
I'm having much better luck with the C328 camera that I did with the MCA25...

I wrote this little code that diplays a preview image from the camera onto the VGA screen in 2-bit grayscale mode.· It then snaps and saves a 640x480 jpg image when you click the mouse...

Thanks to Harrison for posting his C328 code...

I've put some notes on this here:
http://www.rayslogic.com/propeller/Programming/Cameras/cameras.htm

Here's sample photos (I think I need to tweak the focus a bit more...):

...just included the 2-bit bitmap placeholder file

Post Edited (Rayman) : 11/13/2007 11:42:52 AM GMT
1920 x 1080 - 677K
640 x 480 - 27K

Comments

  • rjo_rjo_ Posts: 1,825
    edited 2007-11-12 19:28
    Ray,

    Wow.

    The documentation for the c328RS on electronics123.com mentions down-sampling for VGA etc. ... does this mean that the raw data is available?

    Is this the camera you are using?

    By the way... the preview resolution turns out to be exactly the same resolution as 4DSystem's uOLED 160-GMD.


    Rich
  • RaymanRayman Posts: 14,151
    edited 2007-11-12 19:44
    There are 80x60 and 160x120 preview modes available in various depths. This is the raw data. I think you can get the raw data from snapshots too (instead of jpg), but haven't tried this...

    Here's the kind I bought:
    http://www.electronics123.com/s.nl/it.A/id.2527/.f?sc=8&category=241

    PS: Ask me why I got two [noparse]:)[/noparse]
  • rjo_rjo_ Posts: 1,825
    edited 2007-11-12 20:28
    Re: PS

    I love you... in a purely hetero sort of way[noparse]:)[/noparse]
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2007-11-12 22:02
    Someone here once said that the propeller was like buried gold just waiting for
    someone with some dynamite to show up and blast at the right places.

    Rayman's got a box of dynamite under his desk... [noparse]:)[/noparse]

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Buttons . . . check. Dials . . . check. Switches . . . check. Little colored lights . . . check.

    — Calvin, of 'Calvin and Hobbes.
  • Rob7Rob7 Posts: 275
    edited 2007-11-12 22:06
    This is very cool,

    I could be incorperated into a rover with pic capture and send to host computer.

    Rob7
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-11-12 22:12
    Rayman said...
    PS: Ask me why I got two [noparse]:)[/noparse]
    binocular robot vision of course
  • BaggersBaggers Posts: 3,019
    edited 2007-11-12 23:08
    looks excellent ray, might have to just get one of those cam's to try it with the propgfx [noparse]:)[/noparse]
  • rjo_rjo_ Posts: 1,825
    edited 2007-11-12 23:18
    now we're talking[noparse]:)[/noparse]
  • WhelzornWhelzorn Posts: 256
    edited 2007-11-13 00:08
    I love these little cameras. The only thing that bothers me is the 2 seconds you need to give it after syncing to allow it to adjust for the lighting. Also, I've been trying to send the pics back to my PC through an xbee link so that I can have roboRealm analyze them. The PC end isn't quite there yet software-wise, but everyhting else is done.
  • BaggersBaggers Posts: 3,019
    edited 2007-11-13 10:08
    will post pics when I get one [noparse]:D[/noparse]
  • JT CookJT Cook Posts: 487
    edited 2007-11-13 14:44
    How fast can you write pictures to cards? Like lets say you want to take a series of images, like a movie (of very low frame rate of course) how fast can you write a continual run of images to SD?
  • RaymanRayman Posts: 14,151
    edited 2007-11-13 16:26
    Good question.· I bet it could do once every two to three seconds at full resolution.· Maybe better with an assembly driver...

    The 640x480 jpg filesize is typically up to 20 kB.· With the fastest, 115200 baud connection, it takes at least a second for the data (without the packet overhead).

    The SD writing is very fast, I don't think it adds too much to the limit.

    I like Harrison's trick of just calling the file a ".mpg" and appending new images to the end to make a movie...
  • Harrison.Harrison. Posts: 484
    edited 2007-11-13 22:08
    I don't think the appending thing worked very well. What it did was create a mjpeg (motion jpeg) file that was fed into ffmpeg to create computer readable video files.

    I think on average I got about 2 - 5 seconds per picture when it was creating a new file per frame. That gives you 512 frames (fat16 limitation of 512 files in root directory).

    Post Edited (Harrison.) : 11/13/2007 10:13:53 PM GMT
  • BaggersBaggers Posts: 3,019
    edited 2007-11-13 22:53
    when saving the images, did you round the filesize off to 512 byte minimum? to keep the sector writing happy, and then just tag the next jpg file on the end of it to create a BIG file of jpg's
    then read them in on a PC? that way, you'd get more than your 512 frames [noparse]:)[/noparse]
    and hopefully more because it won't need to create a new file and after every frame and close and flush, it can just keep writing.
Sign In or Register to comment.