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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

jpg to 3D plot

I have a ~3Mpixel photo (jpg) that I want to reproduce in a three dimensional plot showing pixel coordinate (x and y axes) versus intensity (z axis) - the photo is basically a grey-black (has an intensity gradient) spot on a glass plate.  In some imaging software it is possible to convert the image to grayscale (which might not be necessary - the image is already quite 'black and white'), and manually extract the intensity of each pixel (a number from the colour map: 1-256 (or is it 255??)) by hovering the mouse pointer over a very much zoomed picture.  I have done this previously with lower resolution webcam images but I can't do it for 3Mpixels!!!  Can LabVIEW help? 
I've used the read jpg VI, and get my 3Mpixels of flattened data - but the numbers don't range from 1-256 as in the imaging software.  This is not surprising since I haven't specified a colour map - how can I do this (use the grayscale colour map from the imaging software)? 
It might also help to note that the area of the photo I'm interested in (the spot) is less than 1/4 of the total photo so I could probably cut out some of the blank space (if I knew how to use 'rect' - I don't have a clue what the description for this means "specifies the rectangle whose upper-left corner is at 0,0 and that is the exact size of the pixmap" (shown in the context help) - what is a pixmap?  where are top, bottom, left and right?  Surely a rectangle has top-left, top-right, bottom-left and bottom-right?
Excel (which I normally use) can't cope with a 3Mpixel plot so it would be nice if I could also PLOT the image in LabVIEW. 
Help!  I've attached the raw jpg image and the same converted to grayscale using PhotoImpact software.
Download All
0 Kudos
Message 1 of 5
(2,664 Views)
Hmm.  When I open the grayscale image from here it looks much more grainy/digitised than with the software on my PC...
0 Kudos
Message 2 of 5
(2,662 Views)
Here is a rough vi to get your image subset.
0 Kudos
Message 3 of 5
(2,648 Views)
Thanks, but I can't open it - I'm LabVIEW 6.02...
0 Kudos
Message 4 of 5
(2,632 Views)

Here is a screenshot of the block diagram.

0 Kudos
Message 5 of 5
(2,602 Views)