Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Efficient way to switch btw array and image structure?


I am writing software processing images grabed from IEEE 1394 cameras. The software is computing instensive and time critical.  I wanted to use the IMAQ Vision processing VIs, because they seems to run at quite fast speed, and it is convenient.  I also need to write some of my own code in C to do part of the processing, that means I need to tranfer the image into arrays by using the function imageToArray. But this transfromation is time consuming.  I know I can use the VI to capture raw image data from 1394 cameras, which is fast, but because I also want to use the IMAQ processinfg  VI, I need to convert the array data to Labview image structure that way. So, it seems I cannot get both the benifit.

Is there an efficient way to convert between image structure and  Array? Or is there a way to call some of the equvalent functions as the  IMAQ processing VIs by using the image array instead of IMAQ image structure?

By the way, I find the IMAQ Vision processing VIs run much faster than I wrote in C, excluding the converting time, even for a simple thresholding operation. Is there any idea how they did that?

Thanks

Mehmet


0 Kudos
Message 1 of 8
(4,687 Views)
The most efficient way to pass the image array information is to use the IMAQ Get Pixel Pointer VI, which "obtains a pointer on the pixels of an image. This VI also returns information on the organization of the image pixels in memory."  This way you will only have to pass a pointer to the pixel array to your external code, which is much faster, and will be able to bypass the process of converting the image to an array.

The actual algorithms we use for our image processing functions are NI confidential for obvious reasons, but helpful hints on how we do things can be found in the Vision Concepts Manual.  This manual is installed by default, and can be found on your system at the following location:

C:\Program Files\National Instruments\Vision\Documentation\Concepts_Manual.pdf

or in the Start Menu under National Instruments>>Vision

Hope this helps.
S. Arves S.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 8
(4,662 Views)
Mehmet,

If you look at the palette "Vision Utilities>>Image Management>>External Library Support" you will find functions that will help you to work directly with Vision images. What are you trying to do that isn't available in Vision? There may be an acceptable workaround without having to write your own code.

Hope that helps,
Kevin C.
National Instruments
NI Vision
0 Kudos
Message 3 of 8
(4,657 Views)
s_a_s, thanks for your information, it is quite helpful.

KevinC, I am trying to detect the angle an object turned, e.x.  
the human eye turning around the line of sight

There is no obvious points in the image for referece.
Any idea to do it with Labview VIs.

Thanks

0 Kudos
Message 4 of 8
(4,655 Views)
So will you be using images of the eye to make your measurements? Pattern matching may work, or perhaps some sort of line profile. Can you post any images?

Thanks,
Kevin C.
National Instruments
NI Vision
0 Kudos
Message 5 of 8
(4,643 Views)
Here is one exmple of the image.
Do you have any example of using the pattern matching or line matching?
 
Thanks
0 Kudos
Message 6 of 8
(4,620 Views)
A good example for Pattern Matching is:
C:\Program Files\National Instruments\LabVIEW 7.0\examples\Vision\2. Functions\Pattern Matching\Pattern Matching Example.llb

An example of the sort of line profile I'm thinking of is:
C:\Program Files\National Instruments\LabVIEW 7.0\examples\Vision\3. Applications\Rotating Part Example.llb

Even if these don't directly work for you, hopefully you'll get some ideas about how to solve you application using Vision. Writing your own algorithm should be a last resort, and probably unnecessary.

Kevin C.
National Instruments
NI Vision
0 Kudos
Message 7 of 8
(4,606 Views)

Merhaba Mehmet Bey,

National Instruments' in diğer ürünlerinin yanı sıra LabVIEW, NI-Imaq for IEEE1394 ve Vision Development module kullanarak endüstriyel projeler üretegelen biri olarak; uygulama geliştirme sürecinizde karşılaşabileceğiniz sorunlarda yardımım olabileceğini düşünüyorum. murat.akinci@yargem.com ya da www.yargem.com dan bize ulaşabilirsiniz.

 

0 Kudos
Message 8 of 8
(4,588 Views)