LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to locate certain pixels and picture them in RGB image

Take a look at the attached VI.  I showed 2 methods, because I am not sure I completely know what you are looking for.  The one case outputs 3 different colors based on the range.  I also showed a way to use in range and coerce to find out if the value is ~ equal to .5.  I suggest using that method rather than a true = because floating point equality is always a little funky.  You can define how narrow of a band you care about.
 
Let me know if that helps.  I also added a grayscale color table that I created using the "Create IntGraph Color Table.vi" example.  So you now have white to black rather then blue.
Message 11 of 16
(1,271 Views)

Thanks Evan. I tried your code and it works fine with me except that I can't get intensity bar to represent the value for each pixel. Looks like there is no way to completely solve my problem. 1 more question for your code: why your intensity graph has gray color but mine always has white-and-blue?

Thank you anyway, and thank everyone who kindly help me solve the problem.

0 Kudos
Message 12 of 16
(1,261 Views)

What exactly do you mean when you say that you can't get the intensity bar to represent the value for each pixel? To answer your question about the colors on your Intensity Graph, you can right click on the graph and select Advanced >> Ignore Color Array to make your data appear grey instead of blue and white.

I would also recommend that you click on Help >> Search the LabVIEW Help, then type in the keyword "intensity graph" to read more about changing your Intensity Graph colors in LabVIEW.

I hope this helps!

Casey Weltzin
Applications Engineer
National Instruments

Message 13 of 16
(1,242 Views)

Thanks, caseyw. I think it solves some of my problem. Sorry for my, again, poor explanation of the problem. According to all the suggestions, I can either give different color to each group of data, or, simply present the data to the intensity graph. You can see that the intensity has only 1 color. when I used MATLAB to present the data, I triplicated the 2-D intensity data such as 512x500 to 512x500x3. Then, I replaced 1 or 2 of 3 values in the pixel which has a certain value. then I showed the 3-D data as a RGB image, so that the intensity is still in the picture, and the certain range will has different color than gray. I want to repeat this work in LV, but I got into trouble for displaying such a 3-D data. Maybe it is just impossible in LV? Sigh....

Thank you all anyway. I really appreciate for all of your help.

0 Kudos
Message 14 of 16
(1,236 Views)

I think that what you are trying to do is definitely possible in LabVIEW. As you mentioned in your previous post, two ways to visualize your data (with different colors depending on data value) are by manually going through the data and assigning a color to each data point, or using an Intensity Graph.

Off hand, I think the Intensity Graph will probably be a lot less overall work. It sounds like you might need some additional help viewing the colors that you want on your Intensity Graph; I think my earlier suggestion to visit the LabVIEW help will get you going in the right direction.

On the right hand side of your Intensity Graph, you should see a color ramp (a vertical bar that changes in color from top to bottom). This color ramp represents the mapping of values into colors throughout your Intensity Graph. You can right click on the ramp and select "Add Marker" to create a deviding point where you would like values on one side to have one color, and values on the other side to have another color.

With your markers in place, you can right click on any particular marker and select "Marker Color" to change the color at that marker. By default, LabVIEW will interpolate all points in between two color markers. To turn off this feature and use only set colors, right click on your color ramp and uncheck "Interpolate Color."

I hope this helps!

Casey Weltzin
Applications Engineer
National Instruments

Message 15 of 16
(1,218 Views)
Thank you Caseyw.  I lost internet access for 1 week so I saw your reply just today. I am testing your suggestion and see if I can get a correct solution, Thank you again.
0 Kudos
Message 16 of 16
(1,191 Views)