Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I convert an IMAQ image buffer into an IMAQ Vision 'Image'?

Using NI IMAQ and IMAQ Vision with LabWindows/CVI 6.0...

I have some acquisition code that uses IMAQ img functions to set up a
triggered image acquisition and stores the image into an 1D unsigned char
array buffer.

I would now like to add code that uses the IMAQ Vision functions. The IMAQ
Vision function use an Image data type, which from what I can glean from the
..h files, is a structure.

Is it possible to convert the 1D unsigned char array image buffer to an
Image? How would I do this?

An inefficiant brute-force way would be to write the image to a BMP file
from IMAQ using imgSessionSaveBufferEx, then read the same file back in
using IMAQ Vision imaqReadVisionFile. I am hoping there is a more elegant

way to perform the conversion in memory without needing to write disk files.

Thank you,

-------------
Robert Rafuse
Etec, Inc.

tel: (978)531-5025
e-mail: brafuse@etec-inc.com
web: http://www.etec-inc.com
0 Kudos
Message 1 of 2
(3,253 Views)
Bob Rafuse wrote:
> Is it possible to convert the 1D unsigned char array image buffer to
> an Image? How would I do this?

Never mind. I found:

http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3F11556A4E034080020E74861&p_node=DZ52490&p_submitted=N&p_rank=&p_answer=&p_source=External

which indicates that the img functions actually return a 2D array, so I can
use imaqArraytoImage after all.

My bad.

---
Bob
0 Kudos
Message 2 of 2
(3,253 Views)