LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pixel pointer

 

 

 

Hi all.

I Have image grayscale Image2.

And then I wanted to receive PixelPointer and then from PixelPointer receive Image3.

But the Image3 is empty.

Why?

Best regards

Iskander 

 

 

 

 

 

 test.gif  

 

 

0 Kudos
Message 1 of 17
(4,276 Views)

Using the TypeCast invalidates the internals of Image3. I can't take from your block diagram if Image3 was created correctly, but in any case I would recommend to use "IMAQ Copy" to copy Image2 to Image3.

Regards, Guenter

0 Kudos
Message 2 of 17
(4,262 Views)

Hello Iskander,

 

I believe the reason you do not see anything in Image3 is because you are trying to cast a pointer to a pixel of Image2 into an image.  This operation is probably resulting in a null value for the image pointer. The pixel pointer is primarily used in cases where you want to share the data with external code, and need to use a reference that is meaningful to that code.  As Guenter pointed out, if you are sharing image data within LabVIEW, IMAQ Copy is a good function to use.  Would that function work in your application?

Chris_G
Sr Test Engineer
Medtronic, Inc.
0 Kudos
Message 3 of 17
(4,232 Views)

Hi Guenter .

Thanks

My task is to pass the image through Pixel Pointer.

Regards

Iskander

0 Kudos
Message 4 of 17
(4,231 Views)

Hi Chris_G.

Thanks for answer

Regards

Iskander

 

0 Kudos
Message 5 of 17
(4,214 Views)

Hi Iskander,

I do not understand your demand to not use "IMAQ Copy". You could code your custom version of IMAQ Copy like this:

(1) Use "IMAQ GetImageSize" and "IMAQ SetImageSize" to have both images the same size.

(2) Map the Pixel Pointers for both Images.

(3) Call e.g. memcpy using a Call Library Function Node (with the appropriate number of bytes to copy).

(4) Unmap both Pixel Pointers.

I haven't tried it out (because I will continue to use IMAQ Copy in this case) but it should be close to a working solution.

Hope this helps, Guenter

0 Kudos
Message 6 of 17
(4,202 Views)

Hi Chris_G.

I want to receive the image from DLL (C++) into LabVIEW.

For the begining I  would like to do it in the LabVIEW, without DLL.

Regards

Iskander

0 Kudos
Message 7 of 17
(4,201 Views)
Hi Iskander,
your block diagram in the 1st post seems to be very close to the solution:
I expect your DLL call acquires the image and copies the data to the pixel pointer.
After you have unmapped the pixel pointer, you should be able to use the image in LabVIEW.
There should be no need use the Type Cast.
Guenter
0 Kudos
Message 8 of 17
(4,197 Views)

Hi all

Thanks very much for the help.

I did new VI and used Yours answers.

But when I was running VI , it was closed.

The error is in DLL.

When I disable the DLL, the VI is working.

The DLL I used from examples NI.

Where is my error.

Best regards

Iskander

 

 

 

ris1.png

0 Kudos
Message 9 of 17
(4,132 Views)

Hi Iskander,

 

It is pretty much impossible to tell where anerror is that is generated inside of a DLL.  Debugging a custom DLL falls more to the creator of the DLL.  It is impossible to tell what the erro could be by just looking at only the Call Library Function node.

Stephen Meserve
National Instruments
0 Kudos
Message 10 of 17
(4,116 Views)