Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How the parameters like area are calculated by the particle analysis vi using the Calibrated image?

Dear all,
 
When we attach the calibration information to the image and do the particle analysis, it will give out all parameters in pixels & Real world. But how it is calculating the parameters like area in Real-World Coordinates.
 
For example, say i have lense distortion over the edges of my image. so if a particle of say 50 pixels in the center of my image will have less area in Real world than the particle of same 50 pixels around the corner of image. When we do the particle anlaysis, will it return different area for these 2 particles? Its look like not working for me. Anybody have any inputs or familiar about this?
 
Thanks,
logic
 
0 Kudos
Message 1 of 7
(3,940 Views)
Logic,

I think your assumptions about how Particle Analysis should work are correct. I suspect the problem may lie in the accuracy of the calibration information you are attaching to your image. A good way to diagnose your calibration is to correct the image using "IMAQ Correct Calibrated Image" and see if the resulting image looks like you would expect it to.

Could you post images of the calibration grid you used for training and the image you are trying to take measurements on? They would help me make a better assesment.

Hope that helps,
Kevin C.
National Instruments
Vision Algorithms
0 Kudos
Message 2 of 7
(3,930 Views)
Kevin,
 
I am sorry, you are correct. The reference point i have used was not correct. Its working now. But i have a different problem now. Actually my image is huge in size (8192 *22000). Since it is a line scan camera, i have lense distortion only along the X axis. But since the VIs used for calibration are demanding that the calibration image has to be of same size, i need to create a dummy image of same size and pass the points to the learning VIs. I am sure the results will be good now. But i have lot of memory issues like "Not enough memory to complete the operation" error. Also Attaching the calibration information to the actual image & Particle analysis VIs seems to be more time consuming now. I agree that it will be slow as the size increases. But is there a work around atleast incase of line scan cameras, so that we can manage with smaller image size. Is there anyway to speedup the process?
 
Also the attaching a calibration information to an image will be valid for ever? It seems to be gone after processing or coping.
 
Thanks,
logic
0 Kudos
Message 3 of 7
(3,902 Views)
Each 8192*22000 image is going to be about 172MB of actual memory, so I can easily imagine that you may have troubles running out of memory. I like the idea of having a special calibration for linescan cameras, but it is not currently supported. There are two workarounds I can think of.

1. Do all of your processing on uncorrected images. Once you have your measurements (in pixel coordinates), use "IMAQ Pixel to Real World" to turn your measurements into Real World coordinates. Note that this will only work for positional measurements, not area or length measurements.

2. Break your image into smaller, more manageable chunks. Of course, this introduces problems at the boundaries where you split the image, but these problems may be easier to overcome than the alternatives.

I know this isn't really offering a lot. If these suggestions don't help, maybe if you describe your application a bit more I can come up with some more suggestions.

Sincerely,
Kevin C.
National Instruments
NI Vision
0 Kudos
Message 4 of 7
(3,880 Views)

Hi Kevin,

As i said, my application image size is 8192*22000. Since it is a line scan camera, the lense distorition is along the X axis,  which is 8192 pixels. I have constrcted the reference points for calibration along this 8192 pixels and duplicated the same along the Y axis. In order to learn this calibration i need to give a input image of 8192*22000 dummy image, Which claims lot of memory. In the initial stage we had problems with image processing too. So we increased the RAM to 4GB and thats quite managable now.

So coming back to calibration, we have so many praticles spread over the image and we need use the particle anaysis VI get the resutls in pixles & real world. I am some how able to learn the calibration sometimes and it takes ever to attach that information to another image and particle analysis vi also sleeps for long time. I can imagine lot of memory issues when handling huge images, but we need to something about it. Especially for the line scan camera part.

One more point i struck with is using the paticle informations further. Let say i have found so many particles on the image, i found 4 particles are close by and i want consider that as a single particle and derive all the parameters which particle analysis vi gives out. I dont want to go back to image processing and dilate make it a single particle and come back to particle analysis vi. Is there anyway i can do that with numbers alone? i know i am asking for too much. but i want to know where anything hidden in the NI VISION, which i am not aware of.

Thanks,

logic

0 Kudos
Message 5 of 7
(3,864 Views)
I believe the best way to deal with extremely large images is to extract a portion of it at a time (say 8192*2200) and process it. I suspect that calibration in particular will run much faster on a moderately sized image. This means your dummy image would be smaller, and you would only need one of them. If losing particles at the seams is a concern, you could do overlapping extractions (from y = 0 to y = 2200, then from y = 1100 to y = 3300, then from y = 2200 to y = 4400, etc). Even with the overhead of the extra processing with this method, I think you may still see a net increase in speed.

As far as combining the measurements for multiple particles, the best I can offer is that you sum the particles' measurements yourself. Things like Area, Sum X, Sum XY, etc can simply be summed across particles. Most other measurements can be derived from those using the formulas described in chapter 10 of the concepts manual. What measurements are you taking?

Kevin C.
National Instruments
NI Vision
Message 6 of 7
(3,852 Views)
Hi Kevin,
 
You are very active. Thank you very much for the help.
 
Actually, if possible i am trying to get all the particle analysis parameters for each group. But i think it is very hard. If I can get Max Feret Diameter atleast, i will be set as of now. But say i have few particles, and if i want to find the Max Feret Diameter of all as a group, then it is not very easy. I guess i need to find the convex hull of the particles and then i should do the Particle analysis to get the Max Feret Diameter of that group, which i dont like, because it brings me back to the image processing.
 
If i can find the MFD only with the individual details of the particle, then that will be great.
 
Thanks,
logic
 
 
0 Kudos
Message 7 of 7
(3,845 Views)