09-07-2018 03:41 AM - edited 09-07-2018 03:42 AM
Hi!
I have two questions:
1) I have a number of images, and I want to create a 3D plot for each of the RGB Values for each image. The plot should contain: x-coordinate (x position of pixel), y-coordinate (y position of pixel) and R-value for example as z- coordinate. I get the R, G and B values of the image as 1D arrays. Each array starts at 0,0 position and as I can see on my displayed image, it goes forward on the x-axis (1,0; 2,0; ...n;0,.....). I cannot find out what comes after position (n;0). It's not (1,0) and not (n,1).
2) Is there an easy way to create a 2D Array for R, for G and for B values, where the position of the R value (for ex) in the array represents the pixel position on the image? the Option Color image to array (vision) gives the pixel values with the "correct" position but not the r, g and b values.
Thanks in advance for helping me!
Solved! Go to Solution.
09-07-2018 08:13 AM
Sarah,
Please help us by attaching actual LabVIEW code (a file ending in .vi). Pictures can't be manipulated, edited, executed, expanded, etc.
Bob Schor
09-10-2018 02:27 AM
Hi Bob, I've copied the relative part for my question in the attached vi. I hope u can help me in this (may be very simple) issue.
09-10-2018 04:04 AM
Hi Sarah,
Use IMAQ ExtractColorPlanes.VI to individually get the R,G,B components on the image. Then use IMAQ ImagetoArray.VI for each generated color components to be able to obtain its 2D U8 equivalent. Ive attached my sample VI. Hope it helps
09-10-2018 08:45 AM
@s.steen wrote:
Hi!
I have two questions:
1) I have a number of images, and I want to create a 3D plot for each of the RGB Values for each image. The plot should contain: x-coordinate (x position of pixel), y-coordinate (y position of pixel) and R-value for example as z- coordinate. I get the R, G and B values of the image as 1D arrays. Each array starts at 0,0 position and as I can see on my displayed image, it goes forward on the x-axis (1,0; 2,0; ...n;0,.....). I cannot find out what comes after position (n;0). It's not (1,0) and not (n,1).
2) Is there an easy way to create a 2D Array for R, for G and for B values, where the position of the R value (for ex) in the array represents the pixel position on the image? the Option Color image to array (vision) gives the pixel values with the "correct" position but not the r, g and b values.
Thanks in advance for helping me!
I suppose you are looking forward to do this:
https://forums.ni.com/t5/LabVIEW/image-to-RGB-color-separation/m-p/596148#M278340
09-11-2018 02:52 AM
@ clnglenn
oh yes.. sure 🙂 I could've used the IMAQ ImagetoArray (giving U8 equivalent values) for each of the r,g,and b values.. not only for grey scale images..
Thank you very much for your help!!!!
09-11-2018 02:56 AM
09-11-2018 04:24 AM
@s.steen wrote: I don't get the correct r,g,b values at the correct positions in the array using the information out of the "read jpeg"! I still don't understand it.
what have you tried, to substantiate your assumption?
e.g. "Read Jpeg" does output the correct HEX value for Pixel (5,10)