From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-08-2014 09:16 AM
Ich möchte eine USB-Kamera mit einem LabView-Programm steuern. Dafür habe ich vom Hersteller ein Beispielprogramm erhalten. Jetzt bin ich dabei dieses Beispielprogramm nachzuvollziehen. Ich möchte es dann anschließend erweitern. In diesem Programm sind diverse SubVIs enthalten:
- IMAQ Create: An diesem SubVI sind außen folgende Anschlüsse: Bildname, Bildrahmen, Bildtyp
-> wenn ich bei dem Bildrahmen einen Wert größer als 0 eingebe, dann ist mein Ausgabebild verzerrt. Warum?
-> der Bildtyp gibt mir an wie mein Bild dargestellt wird? In welchem Format?
-> wenn ich das SubVI öffne, muss ich dort auch noch die gleichen Werte eingeben, die ich an den Anschlüssen draußen angegeben habe?
01-08-2014 09:44 AM
BeatricePötschick wrote:-> wenn ich bei dem Bildrahmen einen Wert größer als 0 eingebe, dann ist mein Ausgabebild verzerrt. Warum?
-> der Bildtyp gibt mir an wie mein Bild dargestellt wird? In welchem Format?
-> wenn ich das SubVI öffne, muss ich dort auch noch die gleichen Werte eingeben, die ich an den Anschlüssen draußen angegeben habe?
The three-frame sequence in the while loop seems unecessary. Execution order is fully determined by dataflow. What determines the loop rate?
01-08-2014 12:56 PM
BeatricePötschick wrote:
-> wenn ich bei dem Bildrahmen einen Wert größer als 0 eingebe, dann ist mein Ausgabebild verzerrt. Warum?
Hi, Beatrice,
You just forgot about alignment. The IMAQ Image stored in the memorty with alignment:
The alignment is 64 bytes (for latest Vision) So, if your image, for example 256x256 and the Borser is zero, then the image already aligned. I will copy gradirent array to with MemMove function:
As you can see Line Width is 256 pixels - same as image width.
With Border = 3 (which is default) situation quite different. Now image with border is not aligned (256+2*3 = 262 bytes), so for each line 58 additional bytes added - so each line aligned to 64 bytes. If you will just copy array in the same way as above, you will see such image:
For proper copy I will add padding to rthe each line:
Now the image is transferred correctly also with default border.
Refer to IMAQ GetImagePixelPtr Example
Hope it helps for understanding,
Andrey.
01-08-2014 01:43 PM
Nice work, Andrey.
The VI provided by Beatrice doesn't allow us to see if the terminals of the XC_GetFrame.vi allows to specify the border size of the IMAQ image. I would - like Beatrice did - stay with a border size of 0 for IMAQ images that will be passed to that XC_GetFrame.vi. If any image processing operations (done later) requires a border, "IMAQ ImageBorderSize VI" can do the job (although I do not remember to ever have used it ...).
01-08-2014 01:44 PM
Ups, wrong link to example.
This one is correct:
http://zone.ni.com/reference/en-XX/help/370281P-01/imaqvision/imaq_getimagepixelptr_example/
01-08-2014 01:53 PM
@BeatricePötschick wrote:
-> der Bildtyp gibt mir an wie mein Bild dargestellt wird? In welchem Format?
For help on Image Types take a look at the help of IMAQ Create VI and/or the NI Vision Concepts Help, that you should find on your disk in NI / Vision / Documentation / NI Vision / NIVisionConcepts.chm: The topic "Image Types" handles the representation of the different images types in memory.
01-08-2014 02:00 PM
@BeatricePötschick wrote:
-> wenn ich das SubVI öffne, muss ich dort auch noch die gleichen Werte eingeben, die ich an den Anschlüssen draußen angegeben habe?
No. The values on the wires make the dataflow in LabVIEW. (Opening a subVI and setting the values there in not a good practice.) You usually place subVIs on the block diagram and just wire from/to the terminals.
01-09-2014 04:03 AM
Hello altenbach, the loop rate is the number of the captured pictures minus 1.
01-09-2014 04:03 AM
Hello altenbach, the loop rate is the number of the captured pictures minus 1.
01-09-2014 04:09 AM
Hello everybody, I not really understand why I need to use the SubVI IMAQ GetImagePixelPtr VI?