I have been researching how to represent differences in pixel intensity as different colors, but I have been unable to find anyone who has done this. I would corrrelate the pixel intensity to thickness of a film of oil; the thicker the filem the more intense the pixels are. Ideally, I would take a grayscale image convert it into an array, so I have the pixel intensities. Then, I would make a range of intensity that each color corresponds to and convert back to an image, such as blue corresponds to pixels of intensity 0-3 and purple corresponds to pixels of intensity 4-5. I would display the image and visualy show the range of numbers I used for each color. I am unsure how to implement this. Can this be accomplished by a lookup table? I have attached my current VI. I failed to realize that converting an image to RGB doesnt mean you get colors on your previously gray image haha!
Solved! Go to Solution.
You can use elements from the Picture Function Palette, Picture to Pixmap VI returns a cluster which contains the RGB color array of the picture. Once you have this array you can map it using conditionals or case structures. Then use an intensity Graph or Chart to plot the new color array.
I am unsure what you are refering to when you say "you can map it using conditionals or case structures. Then use an intensity Graph or Chart to plot the new color array." I attempted to use case structures to replace the pixel intensities with color values. I have attached what I have done, which is not working. It also seems like a terrible way to do this, but I do not know another way. I have attached my VI. Any help is appreciated!
I need to be able to pass the edited array to the next case structure within the loops.
I have been working on my VI and cleaned up my case structures, but its is still not working. I am trying to replace pixel instensities with 32 bit color values in the array, but I just get back the same array. I have attached my current VI.
See this thread where we were talking about a related topic last week to generate the color ramp.
Then some creative use of "Threshold 1-d array followed by a interpolate array can give you an index into your color ramp.
I am not sure how the thread you pointed to will help me with the current issue I am having with only the pixels on the right side of the image being changed. Could you take a look at my most recent VI and let me know if you see an issue?