LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i fill a ROI with color and save it ?

i want to pull a ROI and fill it with colour
0 Kudos
Message 1 of 11
(5,333 Views)
I will have to guess that you are talking about IMAQ Vision. If so, convert the ROI to a mask using "IMAQ ROItoMask" in the Region of Interest palette. Now that you've got a mask, use "IMAQ FillImage" in the Pixel Manipulation palette to fill your ROI with the color of your choice. Remember to wire in your Mask. Finally, save your shiney new image with your choice of "IMAQ Write XXX File" functions in the Files sub-palette of the Vision Utilities palette.

If you get stuck or lost, call an Alliance Member like us. We do this every day.

Daniel L. Press
PrimeTest Corp.
www.primetest.com
Message 2 of 11
(5,338 Views)
In taking a look at a very old topic...

This doesn't prove helpful to me at all, perhaps it is needed to only have 1 ROI for selection and filling.



This image is a brush scratch and the ROIs need to be filled to bring the multiple scratches into one solid scratch.  Simply filling the ROIs with a 255 pixel count and redrawing the image is what needs to be done.  Each attempt of mine simply results in one of the ROI selections being displayed and/or filled with a 0/255 count.

The VI and file is attached for method of selecting those ROIs.




Message Edited by Steve.Briggs on 03-12-2008 02:21 PM
Download All
0 Kudos
Message 3 of 11
(5,076 Views)
It seems to me that the loop is always acting on the original image, thus in the end, you only get the modifications done on the last iteration of the loop based on the original image.  You may need to wire up a shift register so that each loop iteration acts on the image that is the result of the previous loop iteration.
0 Kudos
Message 4 of 11
(5,063 Views)
Thanks for the tip.  I found another way of doing it (slightly longer, more mundayne way) but by converting the image to array and then replacing the coordinates of the ROI with 255 count in the original array I get something like what I desired.
0 Kudos
Message 5 of 11
(5,061 Views)
IMAQ shift register trouble Smiley Indifferent

I've never used shift registers with IMAQ or vision before and methods I've gone about for using shift registers in numeric or string arrays are not working.

Like you said Ravens, I can get one of the loop's values to display in my image, depending on the count going in to the loop, but I can't get them all to appear using shift registers.

Following examples and other VIs for IMAQ and shift registers don't do anything different from what I've been attempting.
0 Kudos
Message 6 of 11
(5,046 Views)
0 Kudos
Message 7 of 11
(5,043 Views)

First, let me qualify myself.  I do not know IMAQ, though I've played just a little bit with picture functions.  I don't have IMAQ to be able to run anything.

Try putting the shift registers on your first, largest for loop.  That is the one it looks like you are cycling through all of your ROI's.

0 Kudos
Message 8 of 11
(5,040 Views)
Shift registers are the end of me...

Maybe it's thursday..maybe I'm tired..maybe it's the nice weather....but I'm missing the blatantly obvious.

Every shift register I try...albeit on the ROI wire, image wire, data for ROI wire; in the first loop, second loop, or third loop....each attempt results in the same exact thing.  The last joint ROI being filled, and the others not being visible in the final image.
0 Kudos
Message 9 of 11
(5,035 Views)
Solved...

The array to image had data in and out needed to be registered.  Index had to be changed.

Thanks for your help Ravens
0 Kudos
Message 10 of 11
(5,018 Views)