From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ Read Meter indicates result incorrectly. Why?

Solved!
Go to solution

Hi,

 

I'm using the Meter example.VI to test the Machine Vision functions. I save this example as another name and change the instrument to my manometer.

 

I have marked the initial and final position of the manometer and executed the example. But, in some cases, the IMAQ Read Meter function indicates a different value from the position of the needle in the picture. Why this is happening?

 

I attached a picture which the red circle indicates the value calculated by the IMAQ Read Meter function. I saw this happens in the original Meter Example.VI too.

 

Thanks,

R. Feldmann

0 Kudos
Message 1 of 10
(4,024 Views)

Your manometer dial is very cluttered.  There are lots of other things inside the dial area.  When the function is searching for the needle, it is probably finding the other stuff instead.

 

For this dial, you would need to write a much more robust version of Read Meter for it to work properly.  I would probably search for the needle at several different radii and compare the locations.  Only the true needle will be in all the radii.

 

Another possibility is to subtract the background image.  Take pictures with the needle in two different places and use Min to combine the images and eliminate the needle.  You can then subtract this image from the live image, and the needle should be the only object visible.  It will disappear slightly when it passes over other white object, but you should still be able to find it.

 

Bruce

Bruce Ammons
Ammons Engineering
Message 2 of 10
(4,012 Views)

Hi Bruce,

 

What "Min" you suggest to use? I didn't understand this part of the text.

 

Thanks again,

R. Feldmann

0 Kudos
Message 3 of 10
(3,986 Views)

In Vision there is a pallete for comparing and operating on images.  Things such as Add, Subtract, etc.

 

There is one where you can compare two images pixel by pixel and keep the smaller value.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 10
(3,980 Views)

Hi,

 

Ok, Bruce. I found this VI and I'll try your solution.

 

Thanks again!

 

R. Feldmann

0 Kudos
Message 5 of 10
(3,965 Views)
Solution
Accepted by topic author Feldmann

Hi Bruce,

 

I try your solution....it is works! My example has improved but an error still remains. I believe this still happens because I need to improve the camera and the pictures, but I think that's ok!

 

Another thing: the IMAQ Get Meter.VI doesn't work with RGB images. This was cause error in my test too.

 

Thanks,

R. Feldmann

0 Kudos
Message 6 of 10
(3,960 Views)

Hi,

 

There are other methods to improve the quality and reliability of recognition?

Thanks a lot.

 

Max O. 

Engineer and software developer,

TeSLa.

0 Kudos
Message 7 of 10
(3,633 Views)

Hi,

 

Anybody there?

What algorithm of setting up a radii in your opinion better?

Or is there no difference?

Thanks!

 

Max O. 

Engineer and software developer,

TeSLa.

0 Kudos
Message 8 of 10
(3,628 Views)

I would use R2 in the second image.

 

You want to avoid the areas with printing, text, other marks, so R1 (and all the regions in the first image) are bad.

 

Larger areas give you more resolution, so R2 is better than R1.

 

Another option is to create a reference image and subtract it, which will only leave the needle.  Creating the reference image would require two images with the needle in different positions, then use IMAQ Max to combine them and eliminate the needle.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 9 of 10
(3,622 Views)
I can handle this,i have the solution,please contact me! 295010441@qq.com
0 Kudos
Message 10 of 10
(3,169 Views)