Region of Interest (ROI) on Intensity Graph

Hello,
I hope somebody can help me.  I have read the other posts available regarding choosing ROIs on intensity graphs but they don't really answer my question.
I am taking a series of still images.  Having stored the image as an array and displayed it on the intensity graph, I need some way of selecting a rectangular ROI (preferably with mouse) to define an array subset and performing max/min/mean/standard deviation measurements on this region.  I am aware that the array would need reshaping to work with the in built VI for mean and standard deviation but cannot seem to find a way to may the selection of the array subset in the first place.
I would be very grateful for any pointers
Sarah Bohndiek

Hi,
  since you're using an intensity graph, you could use an event structure to capture for the mouse down and mouse up events.
They both give you the coords of where the mouse was. The nex trick would be to convert that into array position co-ordinates, which requires knowing how the data is presented in the graph (actual graph area size, and the amount of data passed to it.) It's easy enough to get the size of the plot area, and you can get the position of the control itself, however calculating exactly where the plot area is inside of the control is not available.
If you plot area size is fixed, you could use a picture control, set to transparent over the top of the plot area. Then use the same trick for the event returning co-ordinates. If you change the values on the scale however, the actual plot area can change in size too (since the renumbering on an auto-scale can cause the scale on the axis to move if the text increases or decreases in length)
By far the easiest route would be to buy the vision development module and use the image control which has the built in ROI capabilities (and editing of the ROI).
Hope that helps
Sacha Emery
National Instruments (UK)
// it takes almost no time to rate an answer
Attachments:
roi on intensity (picture).vi ‏73 KB

Similar Messages

  • Programmatically disabling/enabling cursor in intensity graph

    Hello all,
    I am building a LV interface (LV2011) for a stepper XY stage.  The system "scans" a surface, displaying it on the graph.  I set up to cursors to zoom into a region of interest (ROI).  Pressing a button resizes the scales to the ROI (zooming in on the area).  Sections of code move the XY stage, and read a device.  When done I want to zoom into a ROI and use a THIRD cursor to manually move the XY stage.  I have this working with TWO graphs, based on the "region of interest.vi" I found in the dev zone.  
    What I would like to do is have a boolean toggle controlling ONE GRAPH between setting min/max (cursors 0 and 1) and manual stepper position (cursor 2).  If cursor 2 is visible I want cursors 0 & 1 not showing and visa versa. Can I do this?
    I attached the example - bascially what I did was add a cursor to the 2nd graph, grabbing the XY vales and sending to the stepper controllers. Works great!  I am trying to "combine the two" by resizing the orig graph with a button click (works fine) and then click another button to show the XY stage cursor (and hiding the min/max cursors) - thats the brick wall
    On a seond note - controlling a XY stage using the intensity graph's cursor is really nice; however it would be great if I can control the cursor similar to a slider's "coerce" - has anyone done this?  I assume I have to write a routine in the event that performs some modulo function. Just curious!
    Thanks,
    Steve
    Solved!
    Go to Solution.
    Attachments:
    roi.llb ‏40 KB

    Your exmaple works perfect. Howver I am having probs with Val(sngl) on the XY graph.  On the example you gave, lets say I move the cursor with the mouse - event fires, everyone is happy. If I move the cursor with CODE - nada.  I even read the "Value" of the graph and wrote it to "Val(sngl)" to try to fire the event.  How does one force a trigger on an XY chart when you move a cursor (say cursor idx2) using code?
    Better yet - why when I read the Val and write to Val(sngl) does the event not fire??? I have been searching for a basic XY table with sensor -type project but havent found one yet.  Everyting works great - draginng the cursor moves the XY stage. Now I need to do the auto-scan part  Use code to place the cursor - trigger the even that moves the stage.
    Thanks
    Steve
    Attachments:
    XY_Stage_Rev8.vi ‏53 KB

  • Cursor/Window for Zooming in Intensity Graph

    Does anybody know how to create a non-rectangular window (any shape
    connected by mouse clicks) for zooming (or for data retrieval) if a
    particular area in the graph is of interest in a intensity graph?
    Wouldn't it be really cool if we can select edges in a graph and
    retrieve the information (or data) from the graph?
    The other question of mine is: is there a way that when we're using
    intensity graphs, we can create the custom menu with right mouse button
    click, instead of the standard set of menu items? Any help is greatly
    appreciated. Thanks.
    Sent via Deja.com http://www.deja.com/
    Before you buy.

    [email protected] wrote:
    > Does anybody know how to create a non-rectangular window (any shape
    > connected by mouse clicks) for zooming (or for data retrieval) if a
    > particular area in the graph is of interest in a intensity graph?
    > Wouldn't it be really cool if we can select edges in a graph and
    > retrieve the information (or data) from the graph?
    In my pre-NI days, I had a lot of fun trying to coax image-manipulation and
    -analysis behavior out of LabVIEW intensity graphs. You can do a fair
    amount by making use of cursors and hotkeys and creating pseudo-overlays by
    setting image coordinates to certain colors to create visual cues in
    response to user inputs.
    That being said, I never considered trying to get complex ROI (region of
    interest) info from a user wi
    th an intensity graph, and I'll bet it's a
    pretty tough GUI trick unless you're using IMAQ Vision. If you find
    yourself trying to build features like this into your application, or doing
    a lot of image manipulation in general, you might save yourself time in the
    long run by getting the IMAQ Vision toolkit from NI.
    > The other question of mine is: is there a way that when we're using
    > intensity graphs, we can create the custom menu with right mouse button
    > click, instead of the standard set of menu items? Any help is greatly
    > appreciated. Thanks.
    I'm not aware of a way to suppress the built-in context-sensitive popup
    menus. Sorry!
    Regards,
    John Lum
    National Instruments

  • How to change z-value in a specific region in intensity graph

    Hi all!
    I have an intensity graph and I want to mark a specific region which is dark and then change the z-value(autoscale) so I can see what's in  this region, of course the rest of the intensity graph will be very bright but it's not a problem.  How do I do that?
    Thanks in advance
    Giang

    Easiest method is to change the z scale, unselect autocscale z and rescale the max and min z to the max and minimum region of interest.  This can be easily automated, by using the roi as a subset of the input array and then get max min of the subset and feed it to the z-scale property max min.
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • How to change z-value in specific region in intensity graph

    Hi!
    I have an intensity graph and I want to mark a specific region which is dark and then change the z-value(autoscale) so I can see what in  this region, of course the rest of the intensity graph will be very bright but it's not a problem.  How do I do that?
    Thanks in advance
    Giang

    Assuming you are using LabVIEW, you would be much better off posting to the LabVIEW board since your question has nothing to do with counter/timers.

  • OpenCv ,Hls ,Video Processing :How to use hls::Range() to set ROI(Region of Interest)?Help!!!

    Hi,
        I have one problem,I want to use hls::Range() to set ROI(Region of Interest),and  I could not how to use  it corretly.Anyone can help me ? And give me one example. 
    1.  Functions are defined as follows:
    hls::Range
    Synopsis
    template<int ROWS, int COLS, int SRC_T, int DST_T, typename P_T>
    void hls::Range (
    hls::Mat<ROWS, COLS, SRC_T>& src,
    hls::Mat<ROWS, COLS, DST_T>& dst,
    P_T start,
    P_T end);
    Parameter                                                  Description
    src                                                              Input single-channel image
    dst                                                              Output single-channel image
    start                                                            Left boundary value of the range
    end                                                             Right boundary value of the range
    Description
    • Sets all value in image src by the following rule and return the result as image dst.
    • Image data must be stored in src.
    • The image data of dst must be empty before invoking.
    • Invoking this function consumes the data in src and fills the image data of dst.
    • src and dst must have the same size and be single-channel images.
    OpenCV Reference
    • cvRange
    2.I use it  as follow,but it can not work corretly.
    #define MAX_WIDTH 640
    #define MAX_HEIGHT 480
    typedef hls::stream<ap_axiu<32,1,1,1> > AXI_STREAM;
    typedef hls::Scalar<3, unsigned char> RGB_PIXEL;
    typedef hls::Mat<MAX_HEIGHT, MAX_WIDTH, HLS_8UC3> RGB_IMAGE;
    #if 1
    void image_filter(AXI_STREAM& INPUT_STREAM, AXI_STREAM& OUTPUT_STREAM, int rows, int cols) {
    //Create AXI streaming interfaces for the core
    #pragma HLS INTERFACE axis port=INPUT_STREAM
    #pragma HLS INTERFACE axis port=OUTPUT_STREAM
    #pragma HLS RESOURCE core=AXI_SLAVE variable=rows metadata="-bus_bundle CONTROL_BUS"
    #pragma HLS RESOURCE core=AXI_SLAVE variable=cols metadata="-bus_bundle CONTROL_BUS"
    #pragma HLS RESOURCE core=AXI_SLAVE variable=return metadata="-bus_bundle CONTROL_BUS"
    #pragma HLS INTERFACE ap_stable port=rows
    #pragma HLS INTERFACE ap_stable port=cols
    RGB_IMAGE img_0(rows, cols);   
    hls::Mat<MAX_HEIGHT,MAX_WIDTH,HLS_8UC1> gray(rows,cols);
    hls::Mat<MAX_HEIGHT,MAX_WIDTH,HLS_8UC1> range_1(rows,cols);
    #pragma HLS dataflow
     hls::AXIvideo2Mat(INPUT_STREAM, img_0);
     hls::CvtColor<HLS_RGB2GRAY>(img_0,gray);;
    hls::Range(gray,range_1,50,600);       //     I use hls::Range() like it , is it  right?Help!!!
    hls::CvtColor<HLS_GRAY2RGB>(range_1,img_1);
    hls::Mat2AXIvideo(img_1, OUTPUT_STREAM);
    #endif

    Anyone could help me?

  • BCG Brightness Contrast Gamma - Looking for BCG function returning color table / lookup table coded in pure G and applicable to Intensity Graph or Picture Control

    Looking for BCG function returning color table / lookup table coded in
    pure G and applicable to 8-bit Intensity Graph or Picture Control. Do
    not want to use IMAQ Vision is this particular application.  Any
    help is appreciated.
    Sincerely,
    Don

    Take a look at this color model software I put together.  (Don't concern yourself much with the basic programming at this point.). The color component generator subVI is borrowed from a LabVIEW example.
    First look at test_color2.vi.  If you adjust the sliders of the various controls, you will see how it works.  You can see that for pure B&W images, brightness, contrast, and gamma (which I think I have coded correctly) are all fairly straightforward to modify.
    Now look at test_color3.vi.  Here we try to adjust BCG for color images using the color model shown here where current color component clusters are carried into the BCG event cases via shift registers.  You can see that once color is introduced into the image, it becomes difficult to mix the colorizing with the BCG model.  And this is pretty much where I am right now.
    Would be interested in comments / suggestions.
    Sincerely,
    Don
    Attachments:
    test_color2.llb ‏2251 KB

  • Locating the position of the brightest pixel in a region of interest

    I need to locate the x and y coordinates for the brightest pixel in a region of interest rectangle (user defined).  I see that there's a Light Meter that uses a rectangle, but I can't find a way to have it tell me the location of the brightest pixel (only the intensity)
    Any input would be appreciated.  I'm using v7.1. 
    Thanks

    I don't have time to try to come up with a solution that uses divide and find.  Divide in for sections, find the brightest one, then divide that one into four sections.  Keep going until you get your answer. 
    If you use IMAQ Light Meter (Line) you can find the pixel using the line profile.
    Matthew Fitzsimons
    Certified LabVIEW Architect
    LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison

  • Question about intensity graphs

    Hi all Labview gurus and lovers,
    I have a question to all of you. Last time I encountered with the interesting problem connecting to the building of the intensity graphs from the measurements. Suppose I have a matrix of numbers actually the voltages that I give to piezo motors. Afterwards I get some data from the measurement and I build some intensity graph from that data. And I want that every measurement will corresponding to voltage that I gave to the piezo motor. So I want to build the intensity graph as I dictate to the program to build it.
    Example: I want to scan area ,some square from x=0.5;y=0.5 to x=-0.5;y=-0.5. and I did some algoritm that builds me some matrix of numbers depending on resolution of the picture; for instance if the resolution is 256, so the number of x will be 256 just like y=256 kinda 256 lines. Afterwards I say to the intensity graph that Xmax is 0.5 and Xmin is -0.5 just like Ymax=0.5 and Ymin =-0.5; also I deliver to him x and y offset and multliplier. So when I see how it builds my gaph I dont see that it starts from the [0.5 0.5] point as I want it. So my question is: how can I be sure that it will start from the point I want it to start?  And how can I dictate to the graph to start to build the graph from the point I want? Because the problem happens when I want to zoom some area. When I zoom some area it gives me something different from what I expect to get.
    thank you.

    dimani4 wrote:
    ... also I deliver to him x and y offset and multliplier.
    What is your definition of deliver? I don't understand.
    All you need to set is the offset and multiplier to define the linear relation between array indices and axis values.
    In your particular case you would set x0=0.5 and dx= -1/256 or similar (might need a small tweak)
    In summary, x0,dx define the mapping of array indices to real values. These never change for a given set of data. Xmin,Xmax, etc define the visible area. These are modifiied during zooming and are purely cosmetic.
    dimani4 wrote:
    When I zoom some area it gives me something different from what I expect to get.
    You should learn how to ask efficiently. Attach a small example with some typical data in a diagram constant. Tell us what you get and tell us what you expect to get! In the above sentence "different" is not sufficient as a description, since both sides of the equation are undefined!
    LabVIEW Champion . Do more with less code and in less time .

  • How to read out the scale values of an intensity graph?

    My aim is to read OUT the scale ranges (Max and min values DISPLAYED) of an intensity graph.
    I want to do a scan of an area, display the result in the graph, graphically zoom in on something interesting and then use the zoom coordinates to define the area for the next scan.
    Is that possible, and how?
    If impossible, is there a work-around?
    Solved!
    Go to Solution.

    Use the "XScale.Range" and "YScale.Range" property nodes. 
    www.movimed.com - Custom Imaging Solutions
    Attachments:
    Scale Ranges.vi ‏13 KB

  • Intensity graph and its "interpolate color" option

    Dear Devs,
    using LV2013.02f, my intensity graph never redraws correctly (it remains black), after I uncheck and check the "interpolate color" option in the right-click menu for the z-axis. Is this reproducible for anybody, please?
    Note: There are more situations when the intensity graph remains black after changing some options, but I could not reproduce them systematically. Any ideas what to use instead of it to display 2D arrays of values?
    Cheers,

    Dear users,
    dear GerdW
    Related issue:
    Intensity graph displays a black z-axis color bar
    The issue(s) are connected to the positions of the markers on the color bar. I converted the VI to a 2010version (again, wrapped in a 7-Zip archive), I hope that helps for now.
    Now, when I multiply my 2D array with a suitable high- and at the same time low-enough value (multiplier=1E+34) -- 1E+33 is too low, 1E+35 is already too high; then the markers of the color bar are visible suddenly. The "interpolate color" and the blackness of the graph can be now manipulated and adjusted.
    So now, I have to remember that the default markers' positions are (0,50,100) and there is no way to change them before I extend the values of my array over this region suitably. Seriously, I went through all the right-click on the z-axis menu items and executed them one-by-one. None of those brought the z-axis color bar or the colors back into the graph again.
    Q: How should a novice know about it? Isn't there a "reset all markers, distribute them equally and show all values in the default spectrum color" button somewhere, and did I missed it?!
    Cheers,
    Attachments:
    2013-11-27 0946 buggy intensity graph.7z ‏133 KB

  • Image processing from .txt file onto an intensity graph

    I am doing a mini project in my class and I was wondering if anyone could help me. It about image processing but I am bit stuck.
    Heres the idea:
    "An image is really nothing more than a 2D array of data. The value of every element in the array corresponds to the brightness of the image at that point.
    In this project you will create a VI which loads a 2D array of data and then displays it on the screen using the Intensity Graph. Three example files (boats.txt, gordon.txt and parrot.txt) are available on the module webpage that you can use. However, you can also use any other black and white image you like, but will need to convert it to a “text image” first. To do this you can use some software called “ImageJ” which is available on the computers and is free to download.
    You can vary the brightness of an image by adding the same value to every element in the array.
    The contrast of an image is adjusted by multiplying every element in the array by the same value. Using numerical controls and simple array mathematics, you should adjust the brightness and contrast of your displayed image.
    Some other ideas that you could try with image manipulation are:
    o Invert an image (change black to white and white to black)"
    First I am having problems putting my picture onto the graph. It is in the write file but the colours are not correct and the image has rotated 90 degrees. I will upload my VI so far when I get back onto my computer.
    Would really appricate the help! Thank you for reading

    Hi charlthedancer,
    Here is an example to get you started.
    Kind regards,
    GajanS
    Attachments:
    Test.vi ‏14 KB

  • Change colors of individual pixels on intensity graph?

    I would like to be able to change the color of a set of individual pixels within an intensity graph, to blue for example, while leaving the color table otherwise as is, for example, gray scale.  The change to blue would be based on location, not on current gray value.  I think I can accomplish this using the mask fx with picture controls, and then convert to intensity graph.  Is there a more direct way?  A good example to demonstrate this capability would be just using a 'mouse down' event on an intensity graph to change the color at the mouse location.  Any thoughts are appreciated.
    Sincerely,
    Don

    Yes, seems to work fine .
    If you have LabVIEW 8.0, there is another possibility. There is a new property that allows drawing any pictures or picture elements on your graph area. Of course you could draw individual pixels, but nothing prevents you from e.g. drawing circles, squares, odd shaped areas, arrows or event text. ... Anything you could do with a plain picture indicator. One example that ships with LabVIEW 8.0 is Envelope.vi, see image.
    Message Edited by altenbach on 06-12-2006 07:31 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    envelope.png ‏32 KB

  • Most efficient way to extract the amplitude of a signal and display on an intensity graph

    Hi All,
    I am having difficulty to display the amplitude of an voltage signal (voltage picked up by NI DAQ card).
    what I am trying: Voltage signal (Dynamic data type)--> 2D array of dynamic data type (using 2 nested for loops) --> normal 2D array with scalar values --> intensity graph
    I have difficulty to convert the dynamic 2D array to scalar 2D arry.
    I only want to extract the amplitude of the imcoming signal.. any body can give some advice? thanks in advance..
    Charlie

    Hi Hillary,
    Thanks for your reply.
    Yes, I did tried to use Amplitude and Levels Express vi, it should be the one I am looking for, but I found it not work in my case, I need to put the value of amplitudes into a 2D array.
    If I use Amplitude and Levels Express vi, it will give me a 3D array, I have found the solution, just convert the dynamic data to single scalar. (see pic attached)
    Anybody can help me to solve the following 2 problems:
    1. The speed of this program is too low, i think ii due to the DAQ assistant in the 2 for loops (for creating 2D array), it should be able to re-write using DAQmx (as "centerbolt" told me), I am working on this now, if anybody can help, I will appreciate that.
    2. Is there any other way to creat the 2D array (for purpose of increasing speed also).
    Thanks,
    Charlie

  • Fade colors of intensity graph

    Hi everyone,
    I've made a program where I read an 2D-array and plot this array in a intensity graph.
    I was wondering if the colors in the graph can fade in each other, preferably in vertical position (columns). The idea is that the numeric data becomes visualized like a DNA profile.
    I've added a image of the plotted graph.
    Thanks.
    Solved!
    Go to Solution.
    Attachments:
    Intensity graph plot major.PNG ‏48 KB
    Intensity graph plot minor.PNG ‏35 KB

    Without manipulating the array, no it's not possible.  I made an idea on the Idea exchange to fix this, I recommend you vote for it.  Anti-Alias or Smooth Intensity Plot
    Like the idea says, see this post for workarounds.
    Tim Elsey
    LabVIEW 2010, 2012
    Certified LabVIEW Architect

Maybe you are looking for