Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Find out the peak position from graph

Hello All,,

 

Actually i want to run this algorithm real time,, to find out the peak position from graph ,, i need to generate the position automatically,,, firstly i try to use image processing by  apply threshold followed by edge detection and the find out the center of each  detected part. the drawpack of this procedure is that the obtained images are different and that lead to different threshold values,, so how can i directly find the position from the graph,,, here i attach the image and the graph of the image,,

thank you,,

Download All
0 Kudos
Message 1 of 14
(6,789 Views)

I suppose there are a handful of different ways to approach locating peaks in an image. What I would go ahead and try first is the H-dome transform, a pretty standard tool for discovering local minimas and maximas. There's a LabVIEW Vision example of it as well: LabVIEW\examples\Vision\2. Functions\Grayscale Processing\Gray Morphological Reconstruction H-Dome Example.vi

 

The H-dome transform itself ends with the second subtraction. From there you can take it to basic auto-threshold followed by particle center of mass locating. If all your images are the same style like the one you attached, this should work quite well. Give it a try.

 

h-dome.png

Message 2 of 14
(6,762 Views)

Thanks Vekkuli,,

i try this diagram, the result is black image,, may  be i have some mistake,,, so please can you attach the example because its not included in my sofware,,, iam using LV 2009,,

thanks again,,

0 Kudos
Message 3 of 14
(6,749 Views)

Put some probes along the way, where does it turn black? Note that the resulting image is binary, only values 0 and 1, make sure you have the image display palette chosen as "Binary".

0 Kudos
Message 4 of 14
(6,747 Views)

Don't worry about getting your hands on the example, I don't see why you would need it. The steps are essentially the same as in the diagram above. Did you find what the problem was with getting the black image?

0 Kudos
Message 5 of 14
(6,731 Views)

Vekkuli

,,

i try that block diagram,,, but the results also is changed continuouslly as i am changing  the raw image,, and to get the desired result i have to add another value,,, in this case my work will be meaning less,,, because i need the results as real time not by post processing,,, i think the better way is to find the contours of each peak from the 3d graph directly without using image processing,,,

Any way appreciate your support,,,

thank you,,

0 Kudos
Message 6 of 14
(6,723 Views)

Vekkuli,,,

this image is a result of a correlation process,,, i need to calculate the dx and dy from the centeral peak,, the contours of the central spot is easy ,,, but the problem is in the small spots a round the central spot (peak),,,

i think you can get some assumption from this explanation...

 

0 Kudos
Message 7 of 14
(6,720 Views)

Hello,

if you are using normalized cross correlation as a metric, the bright spots indicate the highest matches. So your highest match is the peak on your image. You are already converting the image to 2d array in order to display the 3d plot,right? If you are searching for the peak location,why don't you just find the maximum value (and locations) in 2d image array?
All your images should have such peaks if the templated object is present on the image.
Or am I misinterpreting your problem? Are the two small peaks symmetric?Why?

Best regards,
K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 8 of 14
(6,701 Views)

Hello Klemen: 

here i will explain in more details: the main objective of my work is to calculate velocity of small particle,, i perform my experiments by exposing the particle to 2 light pulses,, and i know the time between the two pulses,, so i need to know the distance to calculate the velocity,,, for that i apply correlation,,, the spot that appear in the correlation image is an indication of symmetry,,,so i should know the location of maximum intensity of each peak. The central peak (highest intensity) will be the reference (zero point) and the other peaks locations should be subtracted from the reference peak to determine the shift,,,

Here is the sequence of the process:

Acquiring raw image, correlation, position of central peak, shift calculation, velocity determination,,,,,

 

applying image processing is good idea in case of post processing condition,,, but in my case i need it real time, that mean if i need to apply image processing for calculation, i have to find out a universal criteria for threshold value that can be applied for all raw images,, from my experiments i didn't find specific criteria & i have to manually change the threshold value,,

 

If I choose the intensity (grey level) to be the criteria, then the small peaks (symmetry) will not take place,, because their intensity is very low compare to the central peak,,,

So the most reliable procedure is to directly find out the position of the two small peaks beside the central peak and save this values into an array and use it for calculation,,, I hope I am clearly explain my problem..

Thanks 

 

Download All
0 Kudos
Message 9 of 14
(6,691 Views)

Hello,

 

ah, I think I understand now. Sorry for the confusion, I thought only the main peak was relevant.

 

Since it's a correlation image, it should only deviate in pixel intensities between images. Is that so?

Using only one image, I really can't tell if this would work, but maybe you could try it (see the image below).

 

Example_VI.png

 

It uses a local threshold (with background correction) with kernel size that is the same as is the size of the entire image. The object bounding boxes and centers are then detected. If you need the maximum value of each peak, find a global maximum inside the corresponding bounding box.

 

Best regards,

K

 


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Message 10 of 14
(6,677 Views)