LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Replace One Color With Another in Color Table

Solved!
Go to solution

Hello - I've written a simple VI that when one moves the cursor, it grabs the 'color' value at that location and allows one to replace it and all locations of similar color value with a replacement color.  I first normalize the image to between 0 and 255 to correspond with 256 values in an 8-bit image.   For a simple image, I have just a 2-color (binary) image composed of 0 and 255.

 

I move the cursor, which indexes the image and grabs the value corresponding to a gray value between 0 and 255.  I then use this as the index to the new color, and replace the color at that index with the replacement color.

 

When I move the cursor, it indicates to me whether I am on a '0' or '255' but the color replacement is not made properly (although the color ramp does seem to indicate it should be).

 

This would seem to be a simple task.  What am I doing improperly?

 

Thanks,

 

Don

0 Kudos
Message 1 of 16
(3,011 Views)

Your example is missing subVIs and won't open.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 16
(2,999 Views)

Hi Mark

 

 

I used LabVIEW 2009 64-bit to create the LLB which appears to have caused the problem with missing subVIs.  I redid the save with LabVIEW 2010 32-bit.   See if this works.

 

Don

0 Kudos
Message 3 of 16
(2,994 Views)

I don't have LV 2010 insatlled yet. We generally don't make the transition right away.

 

These are realtively small VIs so just attach them individually saved for 2009.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 16
(2,986 Views)

Here are the 3 subVIs (I guess the forum only allows 3 attachments).  Next message contains the top level VI to run....Don

0 Kudos
Message 5 of 16
(2,973 Views)

Here is the top-level VI.  Tell Doug Fox I said hello.

 

Thanks for looking.

 

Don

0 Kudos
Message 6 of 16
(2,972 Views)

Wait - these are still LabVIEW 2010.  Let me repost as LabVIEW 2009 in a bit.....Don

0 Kudos
Message 7 of 16
(2,962 Views)

This LLB should open in LabVIEW 2009....Don

0 Kudos
Message 8 of 16
(2,959 Views)

 


@DonRoth wrote:

Tell Doug Fox I said hello.

 


I don't really run into him. Most people like to stay clear of engineering. Smiley Very Happy

 



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 9 of 16
(2,946 Views)

Doug, even as a CFO, actually loves science and is a great DIYer.  He has read more Scientific America articles than I have and has carpenter ancestry.  Sorry folks to get off topic....Don

0 Kudos
Message 10 of 16
(2,938 Views)