Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

how to do area ratio measurement?

Hi,

I came accross the problem of measuring area ration from an image. for one section with black and white, i can measure it using image to array and then count the pixels. but what if there are numerous black and white sections in one image. how to get the area ratios for each one (different size of black and white sections with irregular shapes.)?

I attached the image of only one black and white section here. 

Thank you.

0 Kudos
Message 1 of 12
(4,821 Views)

It seems that the image i attached could not be seen. so I attach the file again.

Thanks a lot.

0 Kudos
Message 2 of 12
(4,796 Views)

Hi lenienter,

 

LabVIEW has many examples shipped with it. You might want to take a look at those examples to learn the functionality. I found a good example to get you started.

C:\Program Files\National Instruments\LabVIEW 2009\examples\Vision\2. Functions\Binary Analysis\Particle Analysis Example 

you can access all those examples through the Example Finder as well. In LabVIEW if you got to Help>> Find Examples>> Toolkits and Modules>> Vision 

 

Hope this helps. Thanks and have a great day.

 

Esmail Hamdan | Applications Engineering | National Instruments 

0 Kudos
Message 3 of 12
(4,758 Views)
Since you have black and white patches you dont have to worry because thresholding the image will give you the required particles (either black or white) you can then apply particle analysis and find the area of the particles. You can do a seperate threshold for white and a seperate one for white and get the results.
0 Kudos
Message 4 of 12
(4,727 Views)

1. Threshold the image so the particles you are interested in are not zero.

2. Use IMAQ Label to give each particle a different number.  This will work for up to 255 particles.

3. Use IMAQ Quantify with the labeled image wired to both "Image" and "Image Mask" and look at the region reports.  Each report entry will give you useful statistics about one particle.

 

You can get a little fancier by wiring the original thresholded image to "Image" and the labeled image to "Image Mask", or even the original image (unthresholded) to "Image".  It all depends on what results you are trying to get.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 5 of 12
(4,712 Views)

Thank you very much for sharing this information.

I did the exactly same procedure as what you have said.

But the problem is the sequence of exporting data. that is, how can you make sure the black one and white one are from the same particle? if i only treat one particle, that is easy to do. but once i need to treat a lot of particles, the labelling won't work, if certain modification is not employed.

therefore, the question is: what is the appropriate modification for that?

0 Kudos
Message 6 of 12
(4,678 Views)

Thank you very much for your idea.

yes, this method works when only several particles are analysed. but if the particle number increases sharply, it is not easy to do.

 

0 Kudos
Message 7 of 12
(4,677 Views)

Hi,

Thanks a lot. I went through this for several times. i used the examples and searched the relevant information from the forum. but i still cannot get it.

maybe i missed some important parts.

 

0 Kudos
Message 8 of 12
(4,676 Views)

If you are looking for the black area inside the white area, this is the wrong tool.  You aren't really clear on what you are trying to do.

 

In that case, I would use particle analysis, which was suggested earlier.  You will probably need to invert your image so the particle is white and the hole is black.  If you use the detailed report, you will find out the area of the particle (white) and the area of all the holes (black).  You can get the ratio from these two numbers.

 

Is that what you are looking for?  The way your original posting read, I thought you wanted to compare the area outside the particle to the area inside the particle.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 9 of 12
(4,666 Views)

Hi, Thank you for your advice. Maybe i did not make it clear and used the ambigious figure. I attached another file for that, which i believe is appropriate for my question. I want to know the area ratios for each particle.

0 Kudos
Message 10 of 12
(4,517 Views)