Example Code

Performing IMAQ Functions on Image with Vision Info

Code and Documents

Attachment

Download All

Introduction

When performing IMAQ functions on a PNG file saved with vision information, the portion of the image stored in the header is not processed by the function.  In the example pictured below, the top image is loaded by the IMAQ Read Image and Vision Info function.  The smiley face is stored in the header and executing the IMAQ Shift function on the image results in the blank display in the bottom left.

Shift Image Front Panel.png

Steps to Complete

In order for the IMAQ functions to process all information, use the IMAQ Merge Overlay function as shown below.

Shift Image-snippet.png

Alex Person
NI-RIO Product Support Engineer
National Instruments

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

Comments
Anitha_Shanmuganathan
Member
Member
on

Since I am new to labview , I just wanted to know how do you set RGB in IMAQ?

A_Person
NI Employee (retired)
on

I'm not sure exactly what you mean by setting RGB in IMAQ. There are VIs in NI Vision such as IMAQ ReplaceColorPlane that allow you to set a new RGB plane but I'm not sure if that's what you're looking for. In order to get more people to see your question and help answer it, I would recommend posting your question in our discussion forums. You can find the NI Vision specific forum at http://forums.ni.com/t5/Machine-Vision/bd-p/200.

Alex Person
NI-RIO Product Support Engineer
National Instruments
P2345
Member
Member
on

why is the image getting croped when you shift it by greater number? Is there a way to retain the image but still introducing the shift??

Thanks

Blake-C
NI Employee (retired)
on

The image gets cropped because the image size is set upon acquisition of the image (according to the acquired image's size) and once those pixels are shifted out of range of the image they are lost. This occurs even when you shift by a small number, though it is not as evident. I do not know of a way to keep the shifted data using LabVIEW. The only way I can think of to retain all of the image is to increase the size of the image that you acquire with dummy image data that you can budget being lost before you acquire that image (this would not be done in LabVIEW).

Blake C.
Applications Engineer
National Instruments
www.ni.com/support
Contributors