Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Find Xmin,Max and Ymin,max ( Please Help!)

Hello Everyone,

 

Thanks for all help in past. I think, I tried to ask the same question week before but the way the question phrased, could miss-lead anyone however on this thread I will try to explain in detail what I am trying to achieve. 

 

On my main program, the last image has straigthen and threshold has applied onto it as well. On this image I want to perform the co-ordinate system on each cell of the solar module; like where is Xmin,Xmax and Ymin and Ymax of each cell, then shows Xmin,max and Ymin,max of the whole module.

However, image 3 is not even performing what I was accepting to get. If I delete the last bit of the program where the threshold has applied again then iamge 3 gives the perfect threshold outcome but I do not know why this is happening. 

 

My main question is; how to find Xmin,max and Ymin,max. Please help.

 

My all VIs can be found on this thread http://forums.ni.com/t5/Machine-Vision/Detect-the-rectangular/td-p/2370836

0 Kudos
Message 1 of 17
(5,218 Views)

Hello everyone, 

 

Please some one reply. I have updated my program, you have a look. I need to perform the co-ordinate system only but here I am struggling very badly. What I am trying to do is, to check each grid to see is there any white pixel if there is one found then check its neighbouring pixels and add them to and perform this first on individual cell then on the whole module. By doing this find the Xmin,Xmax and Ymin,Ymax. 

 Please someone help me. 

 

Many Thanks 

Lazer

0 Kudos
Message 2 of 17
(5,191 Views)

Why not just use Particle Analysis?  It will tell you all sorts of stuff about each white particle, including the boundaries you are looking for.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 3 of 17
(5,183 Views)

Hello Bruce,

 

Thanks for reply. I tried to use particle analysis but some how it is not working and so far unable to locate the error. Can you look at my new code. I think there is one sub VI is missing which is attached now. 

 

many Thanks 

Lazer

Download All
0 Kudos
Message 4 of 17
(5,181 Views)

Here are a few things:

 

For the Particle Analysis, you should right click on the Pixel Measurements terminal and create a constant, then define the properties you want to measure.  Much easier to understand than just numbers.

 

After Particle Analysis, it looks like you are changing the values it gives you.  Why?  You are destroying the results.  Just use the values it gives you to display the centroid.  An outer for loop will give you the results for each particle, and an inner for loop will give you each feature measured.  Don't transpose the array, either.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 5 of 17
(5,179 Views)

Hello Bruce,

 

Thanks for reply. I am extremely sorry, I didn't got your points. I can see where are the errors which you mentioned but didn't understand whar chances should I bring in. Can you please attached a screen shot. Thanks 

 

Many Thanks

lazer

0 Kudos
Message 6 of 17
(5,177 Views)

Just display the output of Particle Analysis as a 2-D array without any processing.  It will be an 2xN array, where there are N particles.  The numbers are your X centroid and Y centroid for each particle.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 7 of 17
(5,175 Views)

Hello Bruce,

 

Thanks for reply. Let me make a progress on advised way and will come back to forum shortly. 

 

Many Thanks

Lazer

0 Kudos
Message 8 of 17
(5,177 Views)

Hello, 

 

"IMAQParticle analysis" Vi takes ages to run through therefore I decided to program myself. I made the algorithem however there is a mistake. Program suppose to find the all cell pixels but it is covering 3/4 area of the cell. Can you please look at the code and guide me through please. 

 

Many Thanks

Lazer

0 Kudos
Message 9 of 17
(5,161 Views)

You must have done something wrong, because Particle Analysis is usually pretty quick.

 

What exactly are you trying to do, anyway?  Are you trying to find the limits of a box that would surround all your solar cells?  I would just use auto-threshold, then use particle analysis to get the bounding box for each particle.  The bounding boxes can be combined into a single box by using the max of the maxes and the min of the mins.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 10 of 17
(5,157 Views)