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.

Example Code

Continuous Grab with FFT Mask

Code and Documents

Attachment

Description:

This example program demonstrates how to use IMAQ FFT, IMAQ Mask, and IMAQ Inverse FFT to perform a Mask FFT Filter. It grabs images from a camera and allows the user to chose an area of the FFT to block; it then displays the result on the front panel next to the original image. It may be used to block or eliminate certain features of an image.

All VIs are in LabVIEW 2012 with NI-IMAQ 4.7

Instructions:

1) Chose a camera

2) Select a filter type. Low Pass will block everything but the chosen region of the FFT; High pass will do the opposite.

3) Run the VI

4) Use the window that pops up in order to block portions of the FFT

5) Press the Change Mask button to chose another portion of the FFT to block

FFT_Front_Panel.png

Block Diagram:

1) Open a camera session and commence grabbing images

2) Take the FFT of the image after converting it to grayscale

3) Chose the ROI

4) Transpose the frequency components of a complex image

5) Completes the mask and inverses the FFT

FFT_Block_Diagram.png


National Instruments
Applications Engineer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors