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: 

Intensity line derived from intensity graph along any arbitrary line of any orientation selected by cursor

Greetings,
  The subject line says it all; I'd like to create a 1D profile of the Z values from an intensity graph along an arbitrary line of any orientation specified by the user via cursor. A search of this forum yielded IntensitySlice.vi which is similar to what I'd like to accomplish. Thank you in advanced for your assistance.
Regards,
Joshua
0 Kudos
Message 1 of 19
(6,656 Views)

I no longer have LabVIEW 7.0, but here's a quick draft to generate the profile between two cursor points, keeping the pixel pitch roughly constant.

Note that for arbitrary lines, the line will NOT fit exactly through grid points, so you would need to do interpolations.

(In a first approximation, you could simply use "index array" inside the FOR loop, but here I am using a bilinear interpolation (from this old thread, see also this related thread)

(For better visuals, you would also draw a line on the 2D graph using the "plot images" feature. I am not sure if it is available in 7.0).

Message Edited by altenbach on 10-16-2007 10:41 PM

Message 2 of 19
(6,652 Views)
altenbach,
  Thank you very much for your reply, it will be very useful. I forgot to mention that I use LabVIEW 8.5.
Best regards,
Joshua
0 Kudos
Message 3 of 19
(6,633 Views)
OK, heres a quck draft that draws a line between the two cursors.
0 Kudos
Message 4 of 19
(6,625 Views)

Altenbach,
  I just wanted to convey my (very) belated thanks to you for your extremely helpful reply to my query. The example VI you provided was instructive and had the bonus of demonstrating good coding technique.
Regards,
RobotBuilder

0 Kudos
Message 5 of 19
(6,505 Views)

Suppose that I have an image that I would like to draw an arbitrary line to obtain the intensity plot shown in the picture above, can I use this llb to get what I want? can someone help me with this please?

0 Kudos
Message 6 of 19
(5,666 Views)

Hey Mythras,

 

The code that was written above in this forum was from 2007, there is a good chance that it will not be compatible with your current version of LabVIEW. What version are you using and are you using any toolkits that would be potentially helpful in this application? (i.e. vision addons).

 

Thanks,

 

Doug B

Applications Engineer
National Instruments
0 Kudos
Message 7 of 19
(5,646 Views)

Good evening, I am currently using the 2011 version of labview and the code is still working. I want to replace the input with a greyscale image of my choice. May I know how I can do that?

0 Kudos
Message 8 of 19
(5,635 Views)

Hi Mythras,

 

Our Vision Development Module is set up to perform your desired operation so one option would be obtaining that.

 

If you want to do it without the Vision Development Module, you will at least need the IMAQ drivers to bring the image into LabVIEW. There is a free version available at ni.com/drivers. Once you have it in LabVIEW, you can change it into an array of pixels. The functions available to do this are demonstrated in this example: https://decibel.ni.com/content/docs/DOC-10421

 

Once you have a 2d array of the intensity of the picture you can display it using the intensity graph and otherwise manipulate it as shown in the IntensitySlicer example.

 

Hope that helps!

Message 9 of 19
(5,625 Views)

@Mythras wrote:

Good evening, I am currently using the 2011 version of labview and the code is still working. I want to replace the input with a greyscale image of my choice. May I know how I can do that?


There is no need for any vision module. Plain LabVIEW will do just fine! 😄

 

You can read the image using the appropriate read function from here, then convert it to a 2D array using unflatten pixmap and send it to the intensity graph. You need to adjust the color ramp of the z-axis according to the color ramp of the image.

 

Of cours if you have an image and not a 2D array, it makes no sense to us an intensity graph. Simply show your image on a picture indicator and add your line using picture functions directly.

 

See how far you get.

Message 10 of 19
(5,618 Views)