LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Refining circular cropping an intensity graph

Solved!
Go to solution

I am trying to create a more efficient and programmer friendly way to circular crop an intensity graph. Currently I can crop the graph with a matlab script but am trying to improve the process. I would like to be able to tell where the image will be cropped before executing the command. My solution was to place an invisible plot with the same scale over the top of the graph that can draw a circle around the area to be cropped. As you can imagine lining these graphs up is annoying and doesn't lend itself to rearraging my vi. I am looking for a better way to draw a circle/tell where it will crop beforehand.

0 Kudos
Message 1 of 8
(3,752 Views)

What exactly do you mean by a circular crop? Could you clarify?

0 Kudos
Message 2 of 8
(3,706 Views)
Solution
Accepted by topic author Burwitz

Here is a relatively simple method using the PlotImage property and a cursor.

 

IntensityGraphFP.PNG

 

IntensityGraphSelection.png

Message 3 of 8
(3,701 Views)

Okay it hasn't been long since I started, can you teach me how I can find out what each component is from the snippet you uploaded?

 

0 Kudos
Message 4 of 8
(3,508 Views)

The Context Help window is the place to start. As you move the cursor over each node a brief description appears in the help window. For most things a link to Detailed Help is at the bottom of the window.

 

I highly recommend that you keep the Context Help window open at all times when you are programming.  If you have a small screen there may be times you need to hide it, but keeping it open more than closed should be your goal.

 

Lynn

Message 5 of 8
(3,483 Views)

Ah ok thank you so much

0 Kudos
Message 6 of 8
(3,480 Views)

Is it possible to use this to crop any image in a circular form?
if so then where do I connect the image source?

0 Kudos
Message 7 of 8
(3,478 Views)

If you image is grayscale, you can continue to use the intensity graph.  Read the image using one of the Read * file.vis in the Graphics Formats palette (or you can search the palettes or use Quick Drop to find the VIs fast).  Use Unflatten Pixmap.vi to convert the graphics cluster to a 2D array of intensities.  For grayscale, you usually will want to use the 8-bit output.  Wire this to the intensity graph.

 

Alternately, you can use a picture control instead of the intensity graph.  Use Draw Flattened Pixmap.vi to draw the image you read from file to an image control data type.  Then use the draw circle VI in the previous example to draw a circle on top of it.  Now write this to a picture control.  You will need to change the event structure to use the picture control instead of intensity graph, but the picture control has all the same hooks, so it should be relatively straightforward.  Let us know if you run into issues.

0 Kudos
Message 8 of 8
(3,460 Views)