Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating or using a User Defined CWIMAQBasicParticleReport.Surface value

Howdy,

OK. So, now I have an image and I threshold it and use the CWIMAQVision1.BasicParticle method to retrieve the particles found in the IMAGE.
I have also loaded a Perpective Grid for calibration so that I can find the sizes of the Particles found. Atleast I am hoping that I can find the size.
So. The CWIMAQVision.BasicParticle method will return to me a CWIMAQBasicParticleReport about my image. For each CWIMAQBasicParticleReportItem in the returned Report I can use the area property for the number of pixels in the Particle, but what I want is the .surface property in a User-Defined size that comes from my Calibration Grid. How do that?
I'll already know how to take any two points in Pixel Coords and pass then into CWIMAQVision.ConvertPixelToRealWorldCoordinates and then measure the distance returned. But using those functions for what I require, with my current understanding, needs me to use MachineVision.MeasureMaximumDistance to get the outside pixel locations. Plus I need to send regions and I'm just trying to measure the size of my particle.
So if this BasicParticleReport has this .Surface parameter that is supposed to be the area in user defined units, then is it what I am looking for? And how do I supply my user defined units and will that be based upon my calibration grid.

Thanks for your smarts!!!!
0 Kudos
Message 1 of 5
(6,315 Views)
Hi mastada,

I want to make sure I properly understand your question. Are you asking if the CWIMAQBasicParticleReportItem.Surface uses the result from your calibration? If not, please restate your question. I am seeing if I can find out more information about these two functions in the mean time.

Is my understanding correct?

Robert
0 Kudos
Message 2 of 5
(6,307 Views)
Yes. I am hoping that the .surface is the result of my calibration. My documentation states that it is the surface area of the particle in User-defined units. Right now my .surface returns the same as the .Area, which is total pixel count in the particle. I want to get ahold of that area in real units from my calibration. And the .surface looks like it should do it, when I figure out how to make it aware of the calibration. Thanks
0 Kudos
Message 3 of 5
(6,309 Views)
Hi mastada,

The IMAQVision.ParticleMeasurement method has an 'area' item that will, after a calibration, return a value in terms of the associated unit. In fact, I believe all of the ParticleMeasurement types return a calibrated result. You might give this function a try, I think it could be just what you need. As always, these functions are detailed in the VB function reference for Vision.

In fact, with Vision an example is shipped that utilizes this function. You can find it at:

..\Program Files\National Instruments\Vision\Examples\MSVB\2. Functions\Calibration\NonLinearCalibration.vbp

Good luck,

Robert Manion
Applications Engineering
National Instruments
0 Kudos
Message 4 of 5
(6,296 Views)
I am familiar with that Sample. And yes, now that I am looking at it again I see the code that should do what I want. The supplied samples from NI are very good, and there are so many that it becomes hard to recall which might have the best help hiding in it.

Thanks a bunch
0 Kudos
Message 5 of 5
(6,290 Views)