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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ FFT of a color image

Solved!
Go to solution

 In LABVIEW 2011 Is there a way to do an IMAQ FFT on a color image? The only thing that seems to work is on gray scale images. When I try to use a color RGB(U32) image, the FFT vi errors out with "Invalid ImageType".

Any suggestions?

 Thanks in advance.

0 Kudos
Message 1 of 9
(3,931 Views)

Hi Randyman,

 

The IMAQ FFT VI is only intended to be used on monochrome images. Color images typically have 3 or 4 channels of information for each pixel, so the FFT of a color image would be somewhat inscrutable. What you can do is convert your image to monochrome or extract one of the color planes (IMAQ ExtractColorPlanes) and perform the FFT on that new image. What kinds of features are you interested in finding? Based on that, you could probably decide which color plane will be the most representative of that feature, and you can use that color plane for your FFT.


Regards,


Daniel H.

0 Kudos
Message 2 of 9
(3,906 Views)

 Thank you for the prompt reply Daniel.

 

 What we are attempting is a de-resolution of a hi resolution image to simulate what a 1-4 reduction in resolution using a fiber optic taper will look like to a customer without having to built a very expensive actual optical system. If it proves to be an acceptable resolution, then we can move forward. The point is we need a fiberoptic imaging system due to environmental issues prevernting having an actual camera up close to the work being inspected.

 So the idea is to convert the image to an FFT, remove any frequency component above the resolution we would see through the optical magnification, then recreate the image via a reverse FFT. Does that sound feasible or is there a simpler method of simulating a lowering of the resolution of an image? We can work on the gray scale image, as I believe this will prove acceptable for our demonstration. If color is required, we can talk about splitting up the color planes.

 Warm regards,

 

 Randy

0 Kudos
Message 3 of 9
(3,898 Views)

Hi Randy,

 

Thanks for the information. That's certainly an interesting application, and the FFT/IFFT would probably work. However, if all you're interested in is a lower resolution image, I would recommend that you use IMAQ Resample. This VI allows you to set the new x and y resolutions of the image, and it works with color images too. It is in the Image Manipulation palette in LabVIEW. 


Regards,


Daniel H.

0 Kudos
Message 4 of 9
(3,896 Views)

 Using the resample image is an interesting idea, but not what I need. It does reduce the image resolution, but not to the degree of acuaracy I need. The inertpolation methods I've tried don't look right.

 So that is why I wanted to manipulate the FFT image. If I can cut off any frequency above a certain threshold, then reconstruct the resulting FFT via an Inverse FFT, the results should look like the original image, albiet a bit blurred, depending on the cut-off.

 The resulting array from the FFT is a complex array, so do I need to relearn imaginary numbers... i=SQRT of -1 ugh.

 It would be useful if I could just do a multiplication of the array... hmm. What I need to do is multiply all pixels outside a circle around the center of the FFT by 0 and all others by 1.  I think I may be on to something.

  I'll keep plugging away, thanks for your suggestions. I may need help to do it in color though.

0 Kudos
Message 5 of 9
(3,893 Views)

Hi Randy,

 

You may also be able to use IMAQ LowPass to accomplish something similar. I would recommend taking a look at it. 

 

Regards,


Daniel H.

0 Kudos
Message 6 of 9
(3,874 Views)

 Working on the original image is not an option for this application. What I need to do is manipulate the pixels in the complex image created by the IMAQ FFT vi. 

 Any clues?

0 Kudos
Message 7 of 9
(3,866 Views)

Hi Randy,

 

Did your multiplication approach not pan out, or did you hit a wall when trying to break it into its pixel components? The IMAQ ComplexImageToArray function should allow you to take your FFT'd image and generate an array on which to perform your manipulation.

 

I noticed that you also spoke of cutting off a frequency above a certain threshold, so you might also want to look into IMAQ ComplexTruncate, which will allow you to specify a threshold percentage of frequencies to retain.

0 Kudos
Message 8 of 9
(3,847 Views)
Solution
Accepted by topic author Randyman

 We seemed to have hit upon the same solution at the same time Drew. 

 Thanks for your help!

We're done here 🙂

0 Kudos
Message 9 of 9
(3,818 Views)