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.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Least (computationally) burdensome method of adding a filled rectangle to a thresholded IMAQ image

I regret bothering this forum with such a simple question. I am not very proficient in LabView, so every little design consideration takes a very long time for me to solve.

 

I am trying to add a filled black rectangle that covers the top quarter of a thresholded image.

 

The initial source are grayscale, 8bit images at ~30fps, that are thresholded into black/white. The resulting thresholded image serves as input for an old imaq vi called "IMAQ Basic Particle" (or in other versions of this routine, "IMAQ ComplexParticle"). I'd like to take this 640x480 pixel, 8bit black and white threshold, and just add a solid black rectangle to the top of it before it goes through IMAQ Basic Particle.

 

Browsing the forum (before posting!) gave me some ideas:

 

draw rect.vi -> picture to pixmap.vi -> unflatten pixmap.vi -> imaq array to image.vi -> then somehow merge this imaq image on top of the initial? (not sure yet which block to use here).

 

draw rect.vi ->...-> imaq overlay bitmap.vi.

 

or better yet:

imaq overlay rectangle.vi  -> imaq merge overlay.vi.

 

I've spent the most time with the last route, and have one final problem with it. imaq merge overlay.vi seems to output into 32bit rgb, which my particle analysis blocks do not like. The image fed into, and resulting from, the merge overlay.vi is a simple black and white picture so i assume some final conversion of the 32bit rgb image output from Merge Overlay.vi into 8bit will fix this last problem.

 

When searching this topic on the forum, I found a thread where someone claimed that merging images was slowing down their routine significantly. So i came to ask: is this a slow process? is there a better way to do this? The overall program is big, and the speed of operation is my principle concern.

 

 

NIForum01.PNG

 

0 Kudos
Message 1 of 2
(2,553 Views)

There's a function for that...

IMAQ Draw in the pixel manipulation palette.

Sans titre.png

Regards

NTA_LabView_certified_Developper.jpg
0 Kudos
Message 2 of 2
(2,548 Views)