From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-27-2013 10:36 AM
Hi,
I need to point out all pixels that are peaks and valleys in my 2D array. I thought that I would point them out by building imaginary part of my array and changing corresponding values to 0 and 1 (valley, peak). My question is how to do it quickly and softly. I tried peak detector vi's but they all seem to work with 1D signal only (I cannot change my array to 1D, cause the only condition for peak is that the pixel must have higher value than all 8 closest pixels and 2D - 1D conversion will take it line by line).
Help 🙂
01-29-2013 03:09 AM
Hi,
I don't think there is an VI already implemented for that.
Can you give more specific information, how big is your array and which are your timming constrains? The first step would be to implement by yourself a very simple alghorithm as taking by the rows from that array and comparing the data to the neighbours (A[i][j] compared to A[i-1][j], A[i+1][j], A[i][j-1] ... and so on)
Can you post a text file with your values?
Best regards,
I.R.
02-06-2013 04:27 AM
Ok, I didn't describe the problem properly. My 2D array represents 3D surface topography.I need to calculate specific surface parameter. The array is 256x256 and values are generally somwhere between -50 and 50. Now I need to determine how many peaks/pits there are in each interval <-50;-49), <-49; -48), <-48; -47) and so on up to <49; 50). I tried to make double FOR loop so it would check each point separately, and then a while loop inside, but it went out of memory.
Vi attached. I replaced my array with one filled with random numbers but it didn't make any difference. What is wrong?
02-06-2013 05:00 AM
02-06-2013 07:06 AM
Histogram won't tell me about peaks and pits, only about amplitude distribution. I need something like... a histogram, that takes only peaks, and another that takes only pits. Maybe remove other points from the array somehow?
02-06-2013 07:13 AM
Hi Ofic,
Now I need to determine how many peaks/pits there are in each interval <-50;-49), <-49; -48), <-48; -47) and so on up to <49; 50).
Sounds like you need a histogram over your data with an interval width of 1. Easily to get with the histogram function as shown above...
02-08-2013 08:15 AM
Ok I get it. I will use histograms later.
First I need to get rid of all non-peak and non-pit points by replacing them with zeros. My vi. doesn't work and I'm not sure if I know why. I want to receive an array with zeros and (if the point is a peak) values of the points.
Vi. attached.
I thought that the problem is maybe that the program doesn't know next rows until it gets there, but I don't know how to avoid it.
02-08-2013 09:00 AM
Hi,
maybe this VI will help you.
Basically it searches in the 2D arrays for peaks, and returns back an array of cluster, each cluster contains two integer value (row and column number) where there was a peak detected.
Best regards,
I.R.
02-08-2013 10:52 AM
I need the value of the peak too.
02-09-2013 07:35 AM
well, you can parse one more time and extract the values, now that you know the coordinates, it is easy to read the peak values.
Best Regards,
I.R.