Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Resample image AND overlay ?

Hi,

Is it possible, with IMAQ functions to resample an image AND the associated overlays ?

The only way I found is to "merge" the overlay with the image and then resample, but the thing is that I need to resample a 1000*1000 image to a 250*250 image so after the resample the overlay appears really ugly... I assume this is due to the fact that the overlay is made of thin lines...

Maybe there is a way to extract the overlay from the 1000*1000 image, the resize separately the overlay and the image and merge them after, no ?

Thanks for any help

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 1 of 10
(5,540 Views)

Hi TiTou, I'm having this same problem.  I've got a 1280x1024 image, and generally the Vision Window doesn't fit onto the screen with my LabVIEW application.  I want to do my analysis at full-resolution, but show the results in a resized (scaled down) window.  I also tried doing a Merge Overlay, and resizing the image, but my results are also poor.

 

What I'm attempting to do now is manually re-draw all the overlays on the resized image, but this is quite painful.  For example, I'm using the IMAQ Clamp Horizontal Max VI, including its overlay results features.  I still want to use IMAQ Clamp Horizontal Max on the full resolution image, but display the results on the resized image.  My best idea so far is to create a custom version of IMAQ Clamp Horizontal Max that passes the results out, and then rescale and overlay the results in another VI.  Is there an easier way to resize overlays?

 

Thanks,

Phil

 

0 Kudos
Message 2 of 10
(5,214 Views)

If this is just for display, consider setting the zoom factor for the display window instead of resampling the image.  Overlays probably look a little better that way.

 

Bruce

Bruce Ammons
Ammons Engineering
Message 3 of 10
(5,195 Views)

Hi Bruce, thanks for the reply.  I just tried setting the zoom factor using IMAQ WindZoom, instead of resizing the image using IMAQ Resample.  Now, all of my overlays made with IMAQ Overlay Line look fantastic. I'm having some issues with text crowding -- my text spacing is Ok at full resolution, but each line of text overlaps the next with Zoom=-2.  Have any ideas on that?

 

Also, the zoom levels are extremely coarse.  I'm using a 1280x1024 image, and my first option for a smaller image is to set Zoom=-2, which gives a 640x512 image.  Another zoom level inbetween would be ideal, say a 3/4 zoom, but it appears this is the only Vision-supported way to rescale the overlays -- is that your understanding as well?

 

-Phil

0 Kudos
Message 4 of 10
(5,181 Views)

Phil -

 

IMAQ WindZoom 2 supports zooming a window to a fractional zoom value (like 1.5), as does the Image Display Control.  I believe this will scale overlays as well.  As best I can tell this was added around Vision Development Module 8.0.

 

Greg Stoll

Vision R&D
National Instruments

Greg Stoll
LabVIEW R&D
Message 5 of 10
(5,178 Views)

Hi all,

 

The zoom doesn't really solve my use case or maybe it could but with more work 😮

 

I have 4 FireWire connected to the system and each one is performing a specific inspection and on the GUI I'd like the operator to be able to choose wchich image he wants to see : cam 1, cam2, cam3,  cam 4 or the 4 camera in one image display. So now what I dois that I display the overlay only when the image comes form1 cam, because when I make 1 big image composed ofthe 4 images and then resize it the overlays don't follo... I guess I'd have to get the overlay info and add X and Y offsets when i create the big image.

 

Anyone may have an idea to do this, please speak up 😮


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 6 of 10
(5,168 Views)

Greg -- that is exactly what I need!  It must have been added later than 8.0 though -- I'm using 8.0, and I don't see IMAQ WindZoom2 in the display.llb library.  (Screenshot attached)

 

-Phil

 

 

0 Kudos
Message 7 of 10
(5,156 Views)

Phil -

 

Whoops, you're right - it was added in Vision 8.2.  Sorry about that!

 

Greg Stoll

Vision R&D

National Instruments

Greg Stoll
LabVIEW R&D
0 Kudos
Message 8 of 10
(5,147 Views)

No problem Greg, thanks for checking the version.  I have access to Vision 8.5, so I'm upgrading to that now.  I'm going to try IMAQ WindZoom2, and see if it solves my problems. 

 

I'm really hoping that I can let the user resize the vision window, and use the Zoom VI instead of Resample to redraw the image, including the overlays. Fingers crossed ...

 

-Phil

0 Kudos
Message 9 of 10
(5,143 Views)

Hi all,

 

Ok, I actually upgraded to Vision 8.2.1 instead of 8.5.  Resizing the image using the version of IMAQ WindZoom from Vision 8.2.1 is working great!  Clearly, if you are using overlays, this is the way to resize an image for display. 

 

My implementation opens an IMAQ window, with resizing allowed ("can grow").  Then the size of the IMAQ window is compared to the real size of the IMAQ Image, and the ratio of difference is passed to IMAQ WindZoom as the Zoom parameter (single float).  This Just Works!  The only limitation, relative to using Resample, is that the Zoom'ed image must be the same shape as the original image, however some may consider this better since the image cannot be distorted.  Right now, I'm just using the X dimensions to compute the Zoom level.  Works pretty well if you resize by dragging a corner, but it's a little goofy if you attempt to resize by grabbing the top or bottom of the IMAQ window.

 

TiTou, I would highly recommend upgrading to Vision 8.2 and trying to resize your 4 windows using IMAQ WindZoom instead of IMAQ Resample.  In my opinion, this is how the WindZoom feature should have worked from the beginning...

 

Greg -- one small detail.  There is no IMAQ WindZoom2, but rather what's going on is that the version of IMAQ WindZoom in Vision 8.2 calls LV_WindZoom2 in NIVision.dll instead of LV_WindZoom.  From LabVIEW, you can no longer access the integer-based zooming that you get with the original LV_WindZoom.

 

Thanks everyone!

 

0 Kudos
Message 10 of 10
(5,133 Views)