loading
 
Pincushion/Barrel/Perspective Distortion Correction
hibou from France  [30 posts]
17 year
Roborealm's Transforms are very useful, but there are a couple that are apparently not possible - corrections for Barrel and Pincushion distortion: http://www.dpreview.com/learn/?/Glossary/Optical/Barrel_Distortion_01.htm

As well, a "Perspective" distortion would be useful. By this I mean that if you image a square at an angle, the distant side appears shorter. I would like to be able to correct for this so that the image appeared square even when the square object was viewed at a large angle eg 45 degrees.

For technical reasons I need to image close-up objects using inclined mirrors, and this results in these kinds of distortion, see: http://icsd.ill.fr/neutron/ I realise that complex transforms take time, but my frame-rate is only ~1/sec and even an approximate distortion correction would be useful.

Alan.
Picture Distortion
Anonymous
17 year
Alan,

Nice suggestions ... we'll look into adding that into RoboRealm shortly and get back to you when it is launched.

I assume a manual transform adjustment is sufficient for your needs at this point?

STeven.
Picture Distortion
hibou from France  [30 posts]
17 year
Yes a manual transform would be fine STeven. My camera is mounted in a box with fixed geometry, so once I adjust the correction I can just leave it like that.

There is no urgency here, but knowing that it is possible will already allow me to design a more compact box. That would be great.

Alan.
Perspective, Barrel, Pincushion corrections
hibou from France  [30 posts]
17 year
STeven, I've discovered that you have just implemented Perspective, Barrel and Pincushion corrections. Perspective correction works really well. I can close-image a square at 45 degrees and correct so that it really looks like a square. But maybe the initial box for the image could be centred and contain most of the image by default (it seems to be centred on a 320x240 image, and is by default off-centered for others - OK I see you can drag the centre). But it is a very useful correction.

But the Barrel/Pincushion correction crashed RoboRealm immediately after the dialogue box came up. Since I also had crashes with trying to display multiple cameras, I'm beginning to think that it must be my machine. I will try it on another machine tonight.

These look like really great new features. Thanks, Alan.
Barrel/Pincushion Bug
Anonymous
17 year
Alan,

There was a problem with Barrel Pincushion module. While optimizing the module in reducing memory requirements we introduced a bug. We have fixed that issue and have uploaded the new version. Please download and try again.

Thanks!
STeven.
Pincushion/Barrel/Perspective Distortion Correction
hibou from France  [30 posts]
17 year
Yep. It now works very well. Thanks STephen. I also have Mosaic working on my home machine, so maybe that was the same memory bug. Actually I only have one camera at home, but I can display an array of images of it. These images are joined at the edges; ideally I would like to be able to move them w.r.t. each other and average overlapping regions.
Great stuff ! Thanks again. Alan.
Anonymous 17 year
Great!

FYI, instead of using the Mosaic module you can use the Transform->Translate module with the "Change image size as needed" to expand the image to a larger image (say 640x240) with a black area to the right of left of the image. Then use the math module to add in the other picture. This results in a larger field of view image like the mosaic but can be better positioned. Perhaps the overlapping is better handled by one of the math functions too ....

STeven.
sc  [3 posts] 16 year
Hi, I have been experimenting with perspective correction as well, and have been wondering how you are doing it. I have been using the radial transform, followed by an affine transform. The affine transform works pretty well for transforming a keystone, or kite shaped image of a rectangular subject into a rectangular shape, but the proportions are not the same as the subject. You can then use the scale transform to stretch it into the right proportions, but subject matter within the boundaries of the rectangle are still warped.
Anonymous 16 year
sc,

Sounds like you might need a different type of transform. The affine transform is a linear one ... perhaps more of a perspective transform might work. Can you include the image or a similar sample on what you are working on? Then we can try a couple different modules to see what's going on and what you might need to rectify that image.

STeven.
sc  [3 posts] 16 year
STeven,

A perspective transform is probably what I am looking for. Does RR have one?

Attached is an image I am experimenting with . It still has some barrel distortion, but I figure that can be removed with a better radial transform estimate. What I would like to fix is the image compression as it moves away from the camera to produce a close to "normal" view of the scene.

sc
Anonymous 16 year
SC,

Yes, RR does have a perspective transform but it is not yet in general release. We tested it out on that image and it somewhat works. A better module for this particular image would be a rotation in the Z plane as apposed to a perspective transform which does a similar transform but ends up needing the affine transform to square up the image again.

This is a great image for us to test out a new grid alignment module that we've been thinking about. Give us a couple days to see what we can come up with to create an appropriate alignment procedure for this image. The trick is that it requires a radial transform but the image is not centered and thus the radial  transform is a little off center, then it requires a Z type rotation to space all the squares evenly. This is a little tricky to get right manually and would be much easier with an automated grid alignment procedure.

What kind of imaging device created this image?

STeven.
Anonymous 16 year
STeven,

The image was created with a Watchport/V which is a older version of the Watchport/V2 currently sold by Digi:

http://www.digi.com/products/videosensors/watchportcameras.jsp

The Watchport comes with interchangable glass lenses threaded M12x0.5 and supplied by Marshall Electronics. I used the V-4303-2.0FT which has a 73 degree diagonal FOV when used with a 1/4" sensor:

http://www.mars-cam.com/lenses/ccd_cmos/43fix.html

The camera is mounted to a fixture and is viewing the grid from about 35 degrees off normal.

Although the lens has a very fine thread I noticed it is still very loose in the female thread in the camera. I created a "cross-hair" with the line transform, and centered the image left to right on the sensor by aligning the vertical cross-hair with the grid. I am wondering if the loose fit of the lens in the camera is allowing the lenses centerline to be a few degrees off normal to the sensor, and if this could be causing problems for the radial transform.

If you are working on a Z type rotation you might want to take a look at "Geometric Computation for Machine Vision" by Kenichi Kanatani.

Thanks,

sc



Anonymous 16 year
sc,

With the new perspective module your image can be further corrected. Here is what we have so far.



Note that the upper squares now appear as equally sized squares.

See http://www.roborealm.com/help/Perspective.php for more information about this module.

STeven.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index