Shop OBEX P1 Docs P2 Docs Learn Events
3d camera with 2-bit preview — Parallax Forums

3d camera with 2-bit preview

RaymanRayman Posts: 14,162
edited 2007-11-20 01:57 in Propeller 1
I'm not sure I'd recommend these C328 cameras to anyone, except that I haven't seen anything easier to use...

Anyway, I got two hooked up and taking 3D pictures.· Have them mounted in a little test rig at the nominal 2.5" seperation...

I can see the 2-bit preview either by showing one side in red, the other in blue and then crossing my eyes while wearing red/blue 3d glasses (hurts my brain) or by showing them side by side in gray and using this little optical thing I have for looking at 3d photos...

Here's the code and a sample 3D picture and a screenshot:
1280 x 480 - 82K
1920 x 1080 - 768K
1920 x 1080 - 890K

Comments

  • rjo_rjo_ Posts: 1,825
    edited 2007-11-19 14:46
    Rayman,

    I've been on the road again. Yesterday was Old Navy day at our house.

    Your alignment is really phenomenal... your setup is perfectly level and the sensors have a vertical offset equivalent to about 4 1/2 pixels! So, we are probably looking at a less than 50micron error... no doubt in the cameras and not in your rig[noparse]:)[/noparse]

    Nice, well matched spherical lens, too. Frankly this is some of the nicest raw data I've seen... and I'm pretty old. NASA massages its data to get to this level of perfection. Are you sure you aren't cheating?

    I would like to see if the 2 bit preview is adequate for analysis... could you post the actual images?

    The other issue is the compression... JPEG introduces aliasing artifacts and color changes that degrade my final analysis... any way to get just the raw data out?

    I looked at the specs and seems like it is possible... but it is all very "spec" like and I can't actually tell.

    Where have you been? We've been waiting for something like this for quite a while.

    Interested in selling a package with the cameras installed into your rig? (I can't do this stuff without hurting myself[noparse]:)[/noparse]

    Absolutely fabulous.

    Rich
  • rjo_rjo_ Posts: 1,825
    edited 2007-11-19 15:00
    OOPS

    I almost forgot... there is a 1.3 megapixel camera already integrated into Altera's FPGA starter kit. http://www.altera.com/products/devkits/altera/kit-cyc2-2C20N.html

    I know nothing about FPGA's except some of what they can do...and C is a bit of a liability for me. It looks like this is set up to do stereo cameras, except that your mechanical elements are probably better. I would be very interested in using a Prop as a controller for this[noparse]:)[/noparse] With a little work it looks like one of our experts could also use the board as a memory controller for a Prop farm.

    Rich
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-11-19 15:11
    Rayman,
    If you have photoshop and don't mind processing these on your pc, here's the steps for a red/blue macro:

    open file one.jpg
    convert mode to grayscale mode
    adjust gamma to 1.2 (optional item)
    select all
    copy
    close, saving: no
    open file two.jpg
    convert mode to grayscale mode
    convert mode to rgb color mode
    select channel green
    select channel blue with extend (you have picked green and blue together.)
    paste (one.jpg replaces green & blue parts of two.jpg)
    select channel rgb
    adjust gamma to .76
    flip (optional right to left flip command pair, for using with control z to check whether the picture looks better backwards)
    flip
    smart blur (optional, some pictures look better ie smoother with this)
    close (leaves changed two.jpg on workspace, doesn't save it)

    This will work with any pair of images you have. TV, DVD, and regular digital cam pix...
  • rjo_rjo_ Posts: 1,825
    edited 2007-11-19 15:24
    Or you can get ImageJ ... which is public domain (from Wayne Rasband at NIH) and do it with a single click.

    http://rsb.info.nih.gov/ij/index.html
  • RaymanRayman Posts: 14,162
    edited 2007-11-19 16:44
    The alignment actually is a bit of an issue... These boards don't have any mounting holes, so I was using some rubber o-rings to hold them in place. But, even with both boards perfectly level, one of the images was rotated. Apparently, the sensor chip isn't always perfectly aligned with the circuit board... It was like 1 degree off or so, which doesn't sound like much, but it really made it painful to view. The preview image above was taken before I fixed that problem. But, the preview is such low resolution that maybe it doesn't matter too much.

    I'm contemplating a PrintScreen function that would save the display to a bmp file on the SD card...

    I believe you can get raw data from these cameras, but I'm not going to because I want to transmit the photos via 4800 baud RF link. It's already very slow getting the JPG data, and don't want to slow it down any more...

    I don't really use red/blue glasses because I have better stuff... But, I'll take a look at public domain code. And, with that photoshop info, maybe I can write my own code
    to do it. I guess red/blue glasses are more accessible to more people...

    I think this camera is way overpriced... There are plenty of dirt cheap NTSC cameras of equal quality... All we need for the prop is a good frame grabber...
  • PerryPerry Posts: 253
    edited 2007-11-19 17:50
    Great Work Rayman

    I think I have solved the synchronization problem on my "Stupid Video Capture", it did not work well with white backgrounds before, now I can watch hockey games, a real problem for a Canadian, EH! ( update coming soon).

    Since the display only shows every other line, I don't think it would be very difficult to interleave two NTSC video cameras and maybe get 3D in nearly real time

    Perry
  • rjo_rjo_ Posts: 1,825
    edited 2007-11-20 01:27
    Rayman and Perry,

    Price is always in the eye of the beholder. I'm beholding some beautacious pictures here[noparse]:)[/noparse]

    Alignment is always an issue, but with the right jig, it can be done automatically. And if you want to do it interactively... then put the images in an ImageJ stack and just enter some trial rotations. Once you find your rotation, you can either fix it or create a look up table to correct for the rotatation and just keep the lookup table on an EEPROM.

    The preview resolution is more than adequate for lots of stuff. And it is raw data... which is very nice. The sweet spot of the human eye only has about 1000 x 1000 resolution... and we can get by with a lot less.

    Seems to me that you could just interleave the images in software... or if memory is a problem, you could sync two props and then just switch between the two on a line by line basis? Then you just need to send your sync signal out to your LCD glasses to switch between left and right views (field 1 and field 2)?

    OR Head mounted Stereo uOLED's... that's the ticket[noparse]:)[/noparse] You'd be surprised how good the preview would look in full color and in stereo.

    Speed is an issue... whatever you guys can get in real time would be fine... even a couple of lines from each camera. Useful for all kinds of stuff... nice for keeping your gyros working right... distinguishing between tilt and jar... to improve and simplify the integration of all kinds of sensors.

    Size is the other issue... I want to put 3D vision into a prosthetic hand, which would allow the hand tell to distinguish between a can of Coke, a door knob and then either pick it up or turn it... all through visual feedback.

    Thanks guys.

    Rich
  • Rory StormRory Storm Banned Posts: 16
    edited 2007-11-20 01:38
    Rayman probably knows all about anaglyphs, the red-blue 3d pictures.· You can find more information at http://www.opentutorial.com/Make_3d_images
Sign In or Register to comment.