LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

splitting camera image into two pictures with different center

I am working on a project that uses a camera and shows the image on the front panel.  Both images are from the same camera, but I need to show different areas of the picture in each image. 

The problem is both images show the same area.  The windows work if I use the scroll bars attached to the images, but when I hide the scrollbars and use 'image center x and y position properties, I can't move the image.  I need to able to move the scroll bars with the program.

If someone can give me some advice how to get the scroll bars working, I would appreciate it.

 




metzler CLAD
0 Kudos
Message 1 of 10
(2,603 Views)

You can use IMAQ ImageToArray and ArrayToImage to crop the image. The ImageToArray has an optional rectangle where you specify what part of the image to extract.

0 Kudos
Message 2 of 10
(2,526 Views)

The problem of your VI is that you are setting image center every iteration.  When you slow down the loop, you will able to move the image. But will be moved back when you set the image center again in the next iteration.

 

You can use IMAQ Extract VIs to split the image.

image.png

 

George Zou
0 Kudos
Message 3 of 10
(2,520 Views)

Hi George,

 

I don't see those functions. Do you have the full Vision Development Module? I only have Vision Acquisition Software, so I wonder if that is the difference?

0 Kudos
Message 4 of 10
(2,502 Views)

Yes. I have Vision Development Module.

Retrieve pixels into LabVIEW works too, but it would be more efficient working with only the image ref.

 

George Zou
0 Kudos
Message 5 of 10
(2,497 Views)

Zou,

Thank you for the information.

I tried the IMAQdx Extract Image and it doesn't show images.  Can you tell me what I am doing wrong?  I also do not know where to put the information to focus the image.




metzler CLAD
Download All
0 Kudos
Message 6 of 10
(2,478 Views)

You used a wrong VI.

I'm talking about this VI:

C:\Program Files (x86)\National Instruments\LabVIEW 2017\vi.lib\vision\Image Manipulation.llb\IMAQ Extract 2

 

If you only have VAS (Vision Acquisition Software), then you should use the method Gregory suggested.

 

George Zou
0 Kudos
Message 7 of 10
(2,466 Views)

I wasn't able to get ArraytoImage and ImagetoArray to work properly, ended up using IMAQ ColorImageToArray to change to pixels, then back to image with IMAQ ArrayToColorImage. This isolates the image and allows the user to use the scrollbars without them automatically re-centering.  

I still can't figure out how to crop the image.  Can someone give me some advice on this.




metzler CLAD
0 Kudos
Message 8 of 10
(2,445 Views)

before you convert array to image, do array subset.

 

George Zou
0 Kudos
Message 9 of 10
(2,427 Views)

Use ImageToArray for a monochrome image and ColorImageToArray for a color image. Both of these accept an "optional rectangle" which is a 4 element array to say how much of the image you want. You can crop the image by wiring in the optional rectangle.

Message 10 of 10
(2,405 Views)