Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Vision Builder 3.6 Inspection Calibrate Image Doesn't Work

Solved!
Go to solution

I am using an NI 1722 Camera with the Vision Builder AI 3.6 Software to read a 2D data matrix code.

Unfortunatlly the camera cannot be mounted directly over the code, its at an angle of about 20°.

 

The "Read Data Matrix Code" step works fine, however we always fail the "Axial Nonuniformity" grading.

 

I would like to Calibrate the image to adjust for the perspective. To do this I find the 4 edges of my Matrix Code, then the 4 intersections of these edges (ie the corners)

I know that my matrix code is a 9x9mm square. So then I use the Calibrate Image step to adjust for this.

This works fine in the "Configuration Mode" when I run the individual State.

 

However when I run the Inspection, the Calibrate Image step always Fails and doesn't calibrate the image.

 

Please find attached the vbai file and example images.

 

 

Simon Holman
Software Engineer
Certified LabVIEW Developer
Certified TestStand Developer

measX GmbH & Co. KG.
http://www.measx.com
0 Kudos
Message 1 of 7
(4,889 Views)

Hi Simon,

 

I did a quick test with your Original Image and your vbai sequence here on my PC in VBAI 3.6.1.

I deleted the Update UI steps and used the standard UI instead.

I cannot see that inspection fails from the inspection interface.

In both, the configuration and the inspection interface, the behaviour is consistent.

 

So the differences are:

- I used the simulate acquisition step

- I deleted the update UI steps

- I used VBAI 3.6

 

Please test how it goes with your sample image and without update UI steps.

 

Best regards,

David

0 Kudos
Message 2 of 7
(4,866 Views)

Hi David,

 

Thanks, you are correct, I tested it again with just saved images and it works correctly.

However newly accquired images it doesn't work.

Is there a special format the acquired images must be in for the calibration to work?

 

Simon

Simon Holman
Software Engineer
Certified LabVIEW Developer
Certified TestStand Developer

measX GmbH & Co. KG.
http://www.measx.com
0 Kudos
Message 3 of 7
(4,843 Views)

Hi Simon,

 

images do not need to be in a specific format for the calibration to work.

What you can do is save a calibration information together with an image as meta information in a png file.

You have set the calibration step to relearn the calibration with each iteration so this is not relevant for you at this point.

Something I noticed from your screenshots was that in the image that fails to read the code (05 - Read Data Matrix Code (Inspection Execution).png), it looks like not all 4 points are found through the geometry steps? also the found edges are not all in red? and finally the ROI seems to be too large to fit into the image?

 

Could you check that no other steps before the calibration fail? You best use the standard configuration interface that shows the stauts for each step in your inspection. Let me know what you could see there.

 

Best regards,

David

0 Kudos
Message 4 of 7
(4,836 Views)
Solution
Accepted by topic author Simon_Holman

After trying lots of different things, I eventually upgraded to VB AI 2009 SP1

Again after lots of different configuration etc I finally solved the problem.

 

1) with VB AI 2009, if you apply calibtation to an Acquire Image step, it will always fail!

I'm not sure why this option is there (maybe it works with different cameras) 

 

2) You must use "Select Image" step between the Acquire Image step and the Calibrate Image step.

Calibrate Image does not seem to use the last Acquired Image in the State

Simon Holman
Software Engineer
Certified LabVIEW Developer
Certified TestStand Developer

measX GmbH & Co. KG.
http://www.measx.com
0 Kudos
Message 5 of 7
(4,779 Views)

Hi Simon,

 

I tried to reproduce the problem you're describing in Vision Builder AI 2009 SP1 with a Smart Camera, but everything works as I expect it to.

Would that be possible to give us directions to reproduce the issue.

In Vision Builder AI 2009, to avoid applying a calibration learned with a different camera to am image acquired with another camera, there is an option (which is disabled by default when you create the calibration), which allows you to have the calibration fail in that case. The option is labeled "Calibration fails if applied to an image acquired from a camera different than the one used to learn the calibration". That could be the problem.

 

Thanks,

 

Christophe

0 Kudos
Message 6 of 7
(4,749 Views)

Hi Christophe,

 

No that was not the problem, I already checked that.

I should clarify that it will only fail if "Correct Image" is checked AND the complete inspection is executed (not just the state)

 

I've included a Pass & Fail Inspection file to show what I mean.

I have also today tested this on a new NI 1722 camera, with the same problem.

Simon Holman
Software Engineer
Certified LabVIEW Developer
Certified TestStand Developer

measX GmbH & Co. KG.
http://www.measx.com
0 Kudos
Message 7 of 7
(4,720 Views)