My camera image has a weird curvature

OpenMV related project discussion.
jagh2609
Posts: 7
Joined: Mon Aug 07, 2017 12:25 pm

My camera image has a weird curvature

Postby jagh2609 » Mon Aug 07, 2017 12:43 pm

Hi, I recently bought an openMV 7 camera and i´m new in all this matter of python/micropython/machine_vision and i wonder why the image (Tablet) has that weird curvature like eyefish lens?
Image

Thanks in advance
Attachments
Captura_OpenMV.PNG
Captura_OpenMV.PNG (290.62 KiB) Viewed 1465 times
User avatar
kwagyeman
Posts: 2118
Joined: Sun May 24, 2015 2:10 pm

Re: My camera image has a weird curvature

Postby kwagyeman » Mon Aug 07, 2017 2:58 pm

Yeah, that's the effect of the lens since it's wide angle to see more. We chose the lens to have about 110 degree field of view. This is more than standard webcams of about 90.

There's a command called lens_cor() which can undo that curvature. For an example, see the examples/codes and try out the QR code example with lens correction.

Using lens correction slows things down though. Unless you need to fix the curvature try not too.
Nyamekye,
jagh2609
Posts: 7
Joined: Mon Aug 07, 2017 12:25 pm

Re: My camera image has a weird curvature

Postby jagh2609 » Fri Sep 01, 2017 1:50 pm

Hey man, i forgot to thank you for the very prompt response. It help me a lot.
jagh2609
Posts: 7
Joined: Mon Aug 07, 2017 12:25 pm

Re: My camera image has a weird curvature

Postby jagh2609 » Fri Sep 15, 2017 3:17 pm

Hi kwagyeman, i have another problem with the command called lens_cor() to fix the eyefish style. The comand works when the frame size is set to QVGA. But when I tryed to set the frame to VGA comes with memoryError: FB alloc collision.

There is a way the correct the lenses in VGA format?
Attachments
CapturaError.PNG
Here is the code
CapturaError.PNG (317.91 KiB) Viewed 1320 times
User avatar
kwagyeman
Posts: 2118
Joined: Sun May 24, 2015 2:10 pm

Re: My camera image has a weird curvature

Postby kwagyeman » Fri Sep 15, 2017 9:43 pm

We don't have enough RAM for doing lens correction on VGA images. Please reduce the resolution.

Lens correction requires us to allocate a temporary image. At VGA we can't do it any more.

What's your application?
Nyamekye,
jagh2609
Posts: 7
Joined: Mon Aug 07, 2017 12:25 pm

Re: My camera image has a weird curvature

Postby jagh2609 » Wed Sep 20, 2017 8:08 am

I want to integrate the camera to a system that tests devices through a robotic arm.
With the photo taken by the camera an OCR will verify that the steps have been done correctly, so I need good resolution and the text is completely horizontal to be recognized by the OCR.
User avatar
kwagyeman
Posts: 2118
Joined: Sun May 24, 2015 2:10 pm

Re: My camera image has a weird curvature

Postby kwagyeman » Wed Sep 20, 2017 11:35 am

Okay, you can use VGA then. But, turn on the set_windowing command. This will allow you to select a sub resolution of VGA. In particular, you can do 640x240 or something like that. This will give you the horizontal res you need.

For an example see the bar code detection script.
Nyamekye,

Return to “Project Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest