LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I take 4 separate regoins of an image and analyze them?

I am tryng to do an autofocus algorithm where I snap an image, and analyze the 4 corners for focus quality using the FFT function. 
 
I can't seem to figure out how to create 4 smaller separate images from my original image.  I just want to extract the four corners or somethign like that and have 4 small images to run through my FFT and compute a metric on the focus.  How can I do this?
 
Thanks.
Brad Remenak
Certified LabVIEW Architect
0 Kudos
Message 1 of 6
(3,712 Views)
Unflatten Pixmap will get you a 2D array of the pixels.  From there it is just a matter of array manipulation.



Getting to the "image data" datatype will depend on what format your image is in.  It can be done a variety of different ways (see the Picture Function palette).

Message Edited by jasonhill on 04-07-2006 02:52 PM

0 Kudos
Message 2 of 6
(3,709 Views)

I can't connect my image from an Aquire to the unflatten PixMap vi.

Here is what I am trying to do.  Hopefully this is enough of the block.  I pointed out the image data, and this is what I am trying to take the 4 corners of, and then this would go into 4 separate FFT functions to do my focusing.

 

Thanks,

 

Brad

 

 

 

Brad Remenak
Certified LabVIEW Architect
0 Kudos
Message 3 of 6
(3,694 Views)
Hi, remenakb.

What VIs are you using to acquire your image? If you aren't sure, you can find out by right-clicking on each and selecting Visible Items>>Label.

Thanks!
Sarah K.
Search PME
National Instruments
0 Kudos
Message 4 of 6
(3,684 Views)

I am using the IMAQ grab aquire.vi to get the image.  I can use the IMAQ snap.vi if that will work.  I setup the IMAQ session with these VIs

 

IMAQ init.vi

IMAQ create

IMAQ grab setup.vi

Brad Remenak
Certified LabVIEW Architect
0 Kudos
Message 5 of 6
(3,673 Views)
Hi remenakb -

You're using our NI-IMAQ driver to acquire images, and this installs the Image Display control into LabVIEW.  This control works with the Image datatype, while pixmaps cannot.

You can accomplish your task using image processing functions found in the Vision Development Module. The IMAQ Extract and IMAQ FFT functions will accomplish what you want to do.  (Don't forget to provide the proper destination buffers to each of these functions!)
David Staab, CLA
Staff Systems Engineer
National Instruments
0 Kudos
Message 6 of 6
(3,663 Views)