LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I enter data into an imaq image directly in C

I want to write data into an imaq image. The image is created in Labview 7.1, but I need to enter the data in C. Therefore I want to pass the pointer to the image pixels to a dll where I simply step through the image pixels, writing its value directly. However, I'm not sure how to go about this properly - I tried something similar to the example for GetImagePixelPntr, but I don't want to copy the data as this wastes time. Surely it must be possible to write the data into memory once (i.e. the memory where the image is stored).

A simple example would be great (e.g. write a blob into the image structure via passing the pointer to a C dll and using a for loop to write the image data).

I need to do this because I have a usb camera with C code which simply writes the camera pixels into memory by passing a pointer to the memory address to the C function. However, I want to make use of the IMAQ functions. I may also need to do some of my own pixel processing in C, and again I don't want to make copies of the data, but to manipulate it directly.

Thanks for any help
0 Kudos
Message 1 of 3
(2,668 Views)

Hi Wybird,

It may be useful for you to look at this link.  It provides a number of third party drives and some software to allow you to place the image direcly into LabVIEW where a lot of the image manipulation can be performed.

http://digital.ni.com/public.nsf/allkb/274A74A901399D0486256F32007295F9

It may also be helpful too take a look at , search through, the Machine vision forums.  There are a lot more detailed vision forum questions and answers that may help with your application.

Post back if you require any other onformation

 

AdamB

NIUK

Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 2 of 3
(2,658 Views)

Hello again,

Just revisited your problem and a colleague of mine has posted this link.  It may be very useful.

http://forums.ni.com/ni/board/message?board.id=170&message.id=150718

Regards

AdamB

NIUK

Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 3 of 3
(2,643 Views)