03-16-2009 02:40 PM
Hello Cheggers
I am having a 2D array of complex numbers. I need to find the peak values from the complex numbers.The method i adopted for finding the peak values is: Take the average of all the complex numbers and subtract it from the 2D array. From the resulting values, positive values corresponds to peak points. Since they are complex numbers, i thought of taking the Magnitude and do the procedure mentioned above.
After finding the peak values from the magnitude, i need to convert it back to complex number. meaning i need to find to which complex value does these peak magnitude values correspond.
This was what i needed. Hope now u have a better idea...
03-16-2009 02:42 PM - edited 03-16-2009 02:45 PM
Nghtcrwlr wrote:so hw can i get the values only as 1D array?
Try this (LabVIEW 8.2):
(The FALSE case has the array wired across unchanged)
(If you are dealing with large arrays, things should be modified for memory performance. This is currently only a simple solution)
03-16-2009 04:56 PM
Hello Altenbach
Either way, your method and result is correct but am not getting my final result. Can you help me please with my algorithm.
I am having an image. I performed a Transformation to that image and plotted the magnitude of the final transformed complex array with an intensity graph. Till there am getting a correct result. I double checked the graph with theoretical one. Now I need to find the straight lines on this image. In theory it says highest values in Transform matrix correspond to locations of strong peaks which corresponds to location of straight lines in original image.
So i try to find the peak values in the Transformation matrix. As mentioned earlier transformation matrix is 2D array of complex numbers.The method i adopt for finding the peak values is: Take the average of all the complex numbers and subtract it from the 2D array. From the resulting values, positive values corresponds to peak points. Since they are complex numbers, i thought of taking the Magnitude and do the procedure mentioned above.
After finding the peak values from the magnitude, i need to convert it back to complex number. meaning i need to find to which complex value does these peak magnitude values correspond.
These complex numbers correspond to straight lines in original image.
Do you think anythin is wrong in my previous attempt to find those complex numbers.
Thankss
03-16-2009 05:58 PM
If the peaks are supposed to form a line on an intensity graph, you would need to get their xy coordinates (array indices) and do a linear regression.
Can you attach some real data, or at least show the intensity graph and the line you would like?
03-16-2009 06:16 PM
03-16-2009 07:01 PM
OK, you image looks quite wild, with several discontinuities. Why?
So if I understand this correctly, a peak in this transform should indicate "lines" in the original image, so I would guess that the xy position of the peak contains probably more information than the amplitude.
Can you point to a website describing the math behind all of this?
03-16-2009 07:05 PM
03-16-2009 07:12 PM - edited 03-16-2009 07:15 PM
well this is not exactly Hough transformation but somethin related to that. somethin like R adon transformation.
There are severla discontiniuties because there are many phase jumps...i think so..
"xy position of the peak contains probably more information than the amplitude." what does that mean? The Complex numbers which i mentioned is obtained through many processes. So if i do all that reverse processes only i ll get locations of straight lines in original image.I wll explain the whole stuff:
I have an image. I perform 2D FFT to that image. The output complex numbers are interpolated to get those complex numbers on a polar grid . Now I perform Inverse FFT to those complex numbers. The output complex array from this is the final Output.
This final output is what i mentioned earlier. From this Final Output complex numbers i need to find the peak points and do the reverse operations in their order...i.e AT first FFT and ther reverse of interpolation and finally inverse 2D FFT, so that i get locations on original image where straight lines occur.
Actually there are only articles which i got but no website siting this algorithm...
Any help wud be very appreciative...