Lens Distortion after camera Top calibration

114 views
Skip to first unread message

Christian Liebhart

unread,
Aug 24, 2022, 6:53:01 AM8/24/22
to OpenPnP
So after "Advanced camera top calibration" using Issues&Solutions the camera shows a distorted Picture as shown below. Is this gonna be a problem? 
When zooming in (see second attachement) , I get a clear and crisp picture of my PCB so it might work just fine right? 


Thanks for your answers and tips!
ChristianDisstorted Pic after Advanced Top Cam Calibration.jpgZoomed Disstorted Pic.jpg

tonyl...@gmail.com

unread,
Aug 24, 2022, 11:05:40 AM8/24/22
to OpenPnP
Hi Christian,

You should be able to do a lot better than that.  Please post a screen shot of the Advanced Calibration tab for that camera (especially the Diagnostics section) and also post your machine.xml file.

Tony

Christian Liebhart

unread,
Aug 25, 2022, 6:27:28 AM8/25/22
to OpenPnP
Hi Tony thanks a lot for the response. 
Here are screenshots and my XML. 
Christian



WhatsApp Image 2022-08-25 at 11.40.01.jpegWhatsApp Image 2022-08-25 at 11.40.22.jpeg
machine.xml

tonyl...@gmail.com

unread,
Aug 25, 2022, 10:26:08 AM8/25/22
to OpenPnP
The diagnostics show something went wrong especially in your Y direction.  The Residual Errors In Collection Order graph shows a large step in the Y errors at about point 190.  Note that the vertical scale is in micrometers and some of your errors are greater than 2000um (2mm) in magnitude!  This is also visible on the Residual Error X-Y Scatter Plot as a very elongated distribution in the Y direction.  The Residual Error Map shows that these large errors primarily occurred near the far left and right edges of the image.  There are at least a couple of possibilities: 1) The calibration fiducial is not being detected correctly when it appears in those far reaches of the image (possibly due to bad lighting), or 2) Something mechanical went wrong with your Y-axis during the calibration data collection (missed steps, belt/cog slippage, camera or lens is loose in its mount, etc.).  Have you tried more than once? What do the errors look like at the other calibration height (use the Selected CalZ For Plotting spinner to select which is plotted)? If you can't find anything mechanically wrong, you could also try cropping the width of your image down to say 1440 pixels (that would give you a 4:3 aspect ratio as opposed to your current 16:9) and repeating the calibration to see if that helps.  That would avoid collecting data at the far left and right edges of the camera image but of course that also means you lose some useable width of your images.

Tony

mark maker

unread,
Aug 25, 2022, 10:49:09 AM8/25/22
to ope...@googlegroups.com

Also check your camera settling.

If you used the brand new Issues & Solutions camera settling calibration, report back. It is well possible that my heuristics does not work with all machines.

You can go have a look into the camera settling during calibration. Make sure there is no circular mask active. It was one of the changes I made to disable the mask during calibration. Maybe that does not work?

AdvancedCameraSettleSmall

https://github.com/openpnp/openpnp/wiki/Camera-Settling

Details:

See points 10, 11.

https://github.com/openpnp/openpnp/pull/1462

See "Related Changes":

https://github.com/openpnp/openpnp/pull/1452

_Mark

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/e4a50199-973b-48f2-98d6-fe1fce0fff7cn%40googlegroups.com.

Christian Liebhart

unread,
Sep 5, 2022, 9:37:22 AM9/5/22
to OpenPnP
So I did some more hardware tuning on my machine. Especially giving the y-axis belts once more a closer look seemed to have improved the performance of the machine. 
The advanced camera calibration gives me residual errors <150um which is one heck of an improvement compared to my previous post. I hope these errors are insignificant enough for my machine to work properly, since the mean errors dont cancel each other out to zero (see pictures below).

Thanks for your help and insights.

Chris
Screenshot 2022-09-05 153311.jpg
Screenshot 2022-09-05 153104.jpg
Screenshot 2022-09-05 153131.jpg

mark maker

unread,
Sep 5, 2022, 11:17:33 AM9/5/22
to ope...@googlegroups.com

Hi Christian

you have not reported back about camera settling.

Looking at your camera image, you seem to have some reflections visible in what seems to be a half-way mirror. Some co-axial lighting setup?

I guess this part of the image is not really usable and you should crop it away.

@tony is the crop already applied when advanced calibration runs? I.e. will cropping actually help to exclude these parts from the walker?

_Mark

tonyl...@gmail.com

unread,
Sep 5, 2022, 12:25:30 PM9/5/22
to OpenPnP
@Mark - I suspect the artifact you're observing was more due to the bad calibration that was creating additional (rather than compensating for) lens distortion - if you look at his latest image, it doesn't show that.  But in any case, yes, the crop is applied when advanced calibration runs.  That is, no calibration data will be collected in the cropped portion of the image.  But, again, I don't see any need to crop in this particular case.

Tony

Christian Liebhart

unread,
Sep 6, 2022, 6:37:00 AM9/6/22
to OpenPnP
Hi Mark,
for camera settling I used the simple fixed time method with 250ms. I am about to experiment with more advanced camera settling methods today. 

As far as the reflection is concerned: This is just some tape I used to fixate my primary fiducial: I just posted this screenshot to give you an idea on how my camera sees the board. So the middle to right part of the picture is what I wanted to show here. 
You can see how my primary fiducial looks like on which the top-cam calibration is performed on the picture below. I didnt think of any problems the reflection of the tape could cause until you mentioned it. I thought the 2cmx2cm fiducial looks good and big enough so that the camera wont be disturbed by any reflections.. 

Maybe I could fixate the fidcual with a less shining sort of tape to improve the calibration process..
Chris

Screenshot 2022-09-06 123522.jpg
Reply all
Reply to author
Forward
0 new messages