Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Image blob 's max/min pixel location.

Solved!
Go to solution
it could be any pixel inside particle In above I use a method to select on pixel inside particles no mater where is the point is just it should be inside the particle and it is better be not close to borders
0 Kudos
Message 11 of 23
(1,733 Views)

I was misreading the question. It read to me as  find the blob, find the x,y of the blob and find the min/max value. But I think you are looking for the x,y of the min/max pixel. Apologies - my mistake. Is there a chance that the question setter could paste a typical image?

 

 

0 Kudos
Message 12 of 23
(1,733 Views)

If you can find the perimeter coordinates of a particular blob you should be able to convert this to an ROI and then into a mask. Apply this mask to the raw image to determine the min / max values and x,y coordinate for all pixels corresponding to that blob. You would then need to repeat for all other blobs. 

 

Alternatively you might be able to create a dummy image from the thresholded blob image and label each pixel within a blob with the same blob number, (so you would end up with an image made up of regions of 0's, 1's, 2's etc). Pixels with a value of zero could be the background sub-threshold intensity, pixels with a value of 1 would correspond to blob 1 etc. You could use this image as a reference to go back and find the value and coordinates of  pixels of a certain blob number in the raw image. It should then be trivial then to find the max/min pixel value  from the raw image for a given blob. Then repeat for a different blob number. 

 

I'm sure there must be a simpler way but I can't think of one just yet.

 

 

0 Kudos
Message 13 of 23
(1,724 Views)

If you have the labelled image then you could start with all the pixels that have a label of 1. Convert the labelled image into a 2-D array and find all coordinate pairs where the pixel value = 1. Then look at the corresponding pixels on the raw image  to identify the coordinates of the one that has the minimum or maximum intensity. Repeat for the pixels with a value of 2 etc.

0 Kudos
Message 14 of 23
(1,718 Views)

Why try to do it the hard way when I already explained how to do it using IMAQ Label and IMAQ Quantify?  That does everything you are describing, but probably 100 times faster.  Between IMAQ Quantify and IMAQ Reports, you should have everything you need for every particle.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 15 of 23
(1,714 Views)

You're probably right Bruce. I just haven't used those functions before. I had a quick look last night and they look useful. Thanks

0 Kudos
Message 16 of 23
(1,708 Views)

This seems to work OK in that you get reports about each of the regions, but you don't get the x,y position of the max & min values in each region. However, it should be relatively easy to interrogate the original raw image to find this information from the data in the label image.

0 Kudos
Message 17 of 23
(1,703 Views)

Can I ask why you want to use image wand?

0 Kudos
Message 18 of 23
(1,701 Views)
Solution
Accepted by topic author tomsze

I have taken the NI example image label.vi  and modified it so that you can get the maximum intensity for each particle and the x,y coordinate at this position. The index of the 1-D arrays equates to the particle number.

0 Kudos
Message 19 of 23
(1,697 Views)

If I use a large image , the speed might become slow. I turned to use matlab script now which is faster. Anyway, thanks everybody.

0 Kudos
Message 20 of 23
(1,671 Views)