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.
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.
07-17-2017 03:21 PM
Hello,
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!
Thanks,
Ryan
Solved! Go to Solution.
07-17-2017 03:24 PM
I also attached the image I am using.
Thanks
07-18-2017 05:44 PM
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.
07-19-2017 10:47 AM
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!
07-19-2017 10:54 AM
I need to be able to pass the edited array to the next case structure within the loops.
07-19-2017 01:17 PM
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.
07-19-2017 01:48 PM
Found my previous issue, but now the pixels are only being edited on the righmost side of the image. I am not sure why. I ahve attached my VI and the image im editing.
07-19-2017 01:51 PM
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.
Have fun!
Ben
07-19-2017 02:06 PM
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?
Thanks
07-19-2017 02:31 PM
That thread would help with the mapping.
I do not have LV 2017 so post some images and maybe I can see something.
Ben