Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Extract ROI and perform FFT

Hi!

thanks for your help. I managed to choose the ROI with the property node, extract it and Fourier transform it.

I'd like nevertheless to do some details... 

Can I choose a fixed ROI size, let's say 256x256 and 128x128??

Also I'd like to set into logaritmic scale the output of the FFT (z axis) and to show it in color. Is that possible?

Thanks for your help!

0 Kudos
Message 11 of 18
(3,199 Views)

Hello,

 

yes the ROI can be fixed of course. Please check the image below. Hope this helps you get started.

 

Example_VI.png

 

You ca use 3D surface plot instead of 3D surface graph, but the rendering time is down-right awful. At least on my computer.

 

Best regards,

K

 

P.S. If you are doing your processing in a loop, be sure to do some modifications (for example, if the ROI size is fixed, the for loops need to be executed only on fitrst iteration. I didn't try this, but it is possible that the x and y inputs in the 3D surface are not obligatory).


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 12 of 18
(3,059 Views)

THanks for your help.

This is really helpful. Actually I don't need a 3D representation, just a color surface one. Now I have the FFT in linear scale, but I'd like going to log scale to obtain a better representation. I'm trying with IMAQ MathLooup VI but it does the log transformation just of U8, I16, U16, SGL images. I managed to use the ComplexPlane to Image but it extracts just the real o imaginary parts, so I guess I'm losing information. How is it possible to just log transform the complete output of the FFT?
I send you a screenshot of my code. Thanks for your help.

Rafa

0 Kudos
Message 13 of 18
(3,046 Views)

Hello,

 

the "complex plane to image" also has an option to extract the magnitude!

You can also convert the image to array and calculate absolute distance to get the magnitude, but this would require conversion from image reference to array and back.

 

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 14 of 18
(2,987 Views)

Hi,

thanks. I have another question to progress with my project. Now I'm able to see the magnitude of the FFT. As I'm taking a 256x256 image, that's the size of the FFT display, but it's redundant because it's symmetric.

How can I manipulate the display in order to see just the relevant information, an image of 256x128??

Also I'd like to set a filter to control the maximum and minimum of the magnitude, how is that possible?


Thanks a lot for your help!

 

0 Kudos
Message 15 of 18
(2,979 Views)

I think that it would be helpful for you to look at this example: http://www.ni.com/example/30553/en/ . This VI will extract a portion of the previous image and make it into a new image.

 

Jeremy P.

Applications Engineer
National Instruments
0 Kudos
Message 16 of 18
(2,933 Views)

Hi,

I've read all the subject, and I have a question about FFT image via NI vision.

I've a programm in C#, which use NI vision, and a camera which are displaying an image on an IHM.

My IHM displays also an FFT image of an ROI in the image camera. But i have a problem with this FFT when I choose a "small" ROI. Indeed, the FFT image show a pixelized image like what we see in this image "bug FFT.png". But this problem appears not at all time.

I dont' know why this "small" ROI is a problem, is there someone who have an explanation? An idea?

0 Kudos
Message 17 of 18
(1,418 Views)

Hi lerv1,

 

This post is over 2 years old.  Please feel free to make a new post for your question.

 

You'll probably want to include more information, including the original image and the code that you are using to perform the FFT and send it an IHM.  I'm also not sure what an IHM is. 

 

Regards,

 

George B.

National Instruments

Applications Engineer

0 Kudos
Message 18 of 18
(1,387 Views)