LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI IMAQ Create: wenn ich die Bordergröße ungleich 0 eingebe, ist Bild verzerrt

There is another minor issue with your code:  Your subtract function receives the values "Line Width (Pixels)" and "Number of pixels in y direction".  Instead, wire the "Number of pixels in x direction".

0 Kudos
Message 21 of 28
(1,286 Views)

@BeatricePötschick wrote:

Hello Andrey, I tried it like you. But now I don´t see a picture. But maybe the problem could be, that the size of the x-axis and the y-axis is different?


Hi, Beatrice,

 

The given snippets was shown just for demonstration - what's going wrong. Usually for such tasks you have to create simple wrapper (DLL written in C), which will make copy from camera to IMAQ Image with all necessary alignment.

If you have no experience with this, then you can use MoveBlock function, but you should call it in cycle line by line and perform copy:

 

10-01-2014 09-55-18 AlignCopy.png

 

In this example your cam deliver 8 bit image 320 x 240 (WxH). This image is not aligned, so each line is 320 bytes long. I used IMAQ image for simulation - just created it with border 0. Now you need to copy this into IMAQ Image. I created image with border 3, so LineWidth is 384 bytes. In the for cycle line by line copy performed and pointer incremented according to line width. This for loop is fully equivalent with C code shown below.

 

This snippet will work for every image size and every border value.

 

 

Take a note - I marked MoveBlock as Thread safe (otherwise this will called in UI thread). Unmap Pixel Pointer is not necessary (according my conversation with NI Engineer long time ago).

 

Hope it helps,

 

Andrey.

0 Kudos
Message 22 of 28
(1,276 Views)

@Andrey_Dmitriev wrote:

 Unmap Pixel Pointer is not necessary (according my conversation with NI Engineer long time ago).


Thanks Andrey.  I didn't know this.

0 Kudos
Message 23 of 28
(1,265 Views)

Hello everybody, Today I did the programming again. And this is the solution. But my programm is everytime breaking down.

 

0 Kudos
Message 24 of 28
(1,236 Views)

@BeatricePötschick wrote:

But my programm is everytime breaking down.


Could you explain in a few more words what happens?


@BeatricePötschick wrote:

And this is the solution.


Well, if is is breaking down, it is not the solution yet. 😉

0 Kudos
Message 25 of 28
(1,225 Views)

Hello Beatrice.

Your code doesn't configure the MoveBlock function properly.  My note in message 20 regarding the order of parameters wasn't that helpful, though. Again I would like to link to this thread and especially the note at the bottom in which nathand properly outlines a bug in that thread:

 

nathandBugInMoveBlockExample.png

 

I took your VI as a starter, removed the VIs that I do not have and configured the MoveBlock to run correctly.

Hope this helps.

 

 

0 Kudos
Message 26 of 28
(1,219 Views)

Hello everybody, now I choosed my old programm and modified it a little bit. It is easyer for me. Because I´m new by labview. But Thank you so much.

Now I have another question. I want to change some settings of my camera when I make the frames and the programm should not stop. I want to put it with a "CLF-Knoten" but I don´t know where?. I think it need to be in the while loop. But I don´t know how?

0 Kudos
Message 27 of 28
(1,204 Views)

If you just want to add one call to a function in a DLL to your while loop the job should be quite easy: Just add a call library function node, specify the DLL, the function and the parameters.  Finally you have to wire "your LabVIEW data" to the call library function node.  

LabVIEW comes with a set of examples. A basic example is the hostname.vi. Use the Example Finder and search for "DLL". You will find the hostname.vi in the list of examples.   Alternatively load it from the folder examples\dll\hostname\hostname.vi.

 

It you intend to call lots of functions from that DLL consider using the Import Shared Library Wizard (see Tools >> Import >> Shared Library ...").  Before starting with it, check the Supported Data Types for the Import Shared Library Wizard and make a good decision if it is worth the effort.

 

0 Kudos
Message 28 of 28
(1,193 Views)