Getting the coordinates of 1 bufferedimage inside another buffered image

hi, i'm kinda new to this.
is there a way to get the starting x and y coordinates of 1 bufferedimage inside another bufferedimage
let's say this is bufferedimage 1
http://img293.imageshack.us/i/oracle.png/
and this is bufferedimage2
http://img38.imageshack.us/i/buffered2.png/
i would like a method to return the x and y coordinates of image1 inside image2
is there anyway to approach this?
or was there a prewritten method?
thanks

bep -
The problem is that the two rectangles have points in common. When the CWIMAQVision.RegionsToMask is done, it sets any point that is in any region to a non-zero value, and all other points to 0. So, when the CWIMAQVision.Label is done, it sees one big rectangle of non-zero values, and labels that (and so the CWIMAQVision.Quantify sees the one rectangle as well).
The easiest way around this problem (if the rectangles must have points in common) is to only make one region active at a time, so CWIMAQVision.RegionsToMask will only use that region to create the mask image, and then call CWIMAQVision.Quantify twice. So, the code would look like this:
Set pMaskImage = New CWIMAQImage
pMaskImage.Type = cwimaqImageTypeU8
Me.CWIMAQViewer1.R
egions(1).Active = True
Me.CWIMAQViewer1.Regions(2).Active = False
Me.CWIMAQVision1.RegionsToMask pMaskImage, Me.CWIMAQViewer1.Regions
Me.CWIMAQVision1.Label pMaskImage, pMaskImage, avgPixelVal
Me.CWIMAQVision1.Quantify Me.CWIMAQViewer1.Image, globalReport, regionsReport, pMaskImage
dblROImean = regionsReport.Item(1).Mean
Me.CWIMAQViewer1.Regions(1).Active = False
Me.CWIMAQViewer1.Regions(2).Active = True
Me.CWIMAQVision1.RegionsToMask pMaskImage, Me.CWIMAQViewer1.Regions
Me.CWIMAQVision1.Label pMaskImage, pMaskImage, avgPixelVal
Me.CWIMAQVision1.Quantify Me.CWIMAQViewer1.Image, globalReport, regionsReport, pMaskImage
dblSurrROImean = regionsReport.Item(1).Mean
Let me know if this gives you problems.
Greg Stoll
IMAQ R & D
National Instruments
Greg Stoll
LabVIEW R&D

Similar Messages

  • PhotoShop Automation PlugIn: How do I get the coordinates of a polygonal selection?

    Hi.
    I try to get the coordinates out of a selection, but I can't find out how to do that.
    I tried to convert the selection into a path and get the coordinates from the path. That doesn't work either.
    Can somebody give me a list of parameters inside the action descriptor of keyPathContent in classPath? I assume that the point infos are located there...
    Thanx in advance,
    Christian

    found the answer myself. It might be helpfull to others.
    btn.addMouseListener(new MouseAdapter(){
    public void mouseClicked(MouseEvent e) {
    Rectangle ret = btn.getBounds();
    double y = ret.y + ret.getHeight();
    pop.show((Component) e.getSource(), ret.x, (int)y);
    }

  • How can I find the coordinates of individual controls inside a custom control?

    I have a custom control that contains 44 smaller custom controls.
    I can get the coordinates of the 44 embedded custom controls by getting the controls[] property of the main control, but I cannot find a way of getting the coordinates of the controls inside each of these smaller custom controls.
    Is there a way of getting at the coordinates of custom controls that are nested several layers deep?
    Erik.

    For future reference and for any LabVIEW users who have older versions here are the Front Panel displays before running the VI along with the Wiring Diagram with each of the four cases for handling the various types of ClassIDs that can contain child controls.  X1, X@, Y1, and Y2 are the coordinates of the top left and bottom right corners of each control.  These coordinates can then  be used to determine which control the mouse is pointing at.
    In my own project I did further evaluation to eliminate all parent controls (controls that contain other controls) and passed along only the controls that were end-nodes (controls that contain no other controls). Also, the control's refnum was stored for later use.
    The bottom picture shows the data gathered during the execution of this VI.
    Thanks again, Mike!

  • How we can get the values  from one screen to another screen?

    hi guru's.
         how we can get the values  from one screen to another screen?
              we get values where cusor is placed but in my requirement i want to get to field values from one screen to another screen.
    regards.
      satheesh.

    Just think of dynpros as windows into the global memory of your program... so if you want the value of a field on dynpro 1234 to appear on dynpro 2345, then just pop the value into a global variable (i.e. one defined in your top include), and you will be able to see it in your second dynpro (assuming you make the field formats etc the same on both screens!).

  • How to get the coordinate of a cell in the jtable?

    How to get the coordinate of a cell in the jtable?
    How to get the point of a cell in the jtable?
    Thanks for help!

    getCellRect(...);

  • I get the message "IPod is synced with another library"  I only have one Library acount.  Nothing I have purchsed shows up.

    When I open up my I Tunes account with my IPod plugged into the computer, I get the message"  IPod is synced with another library"  I only have one Library.  None of the music or Apps that I have purchased shows up.

    sorry...I am computer illiterate....not sure what you were asking!

  • I want to get the data of a table inside the Form but it is not passed

    I want to get the data of a table inside the Form but it is not passed to the form by tables parameters.
    How can I do this.
    Regards

    If there is a problem with defining it globaly, you can define a field symbol globably and point to it. For example.  It would probably be better to define your table globably.
    report zrich_0003 .
    field-symbols: <imarc> type marc_upl_tt.
    start-of-selection.
      perform get_data.
    *       FORM get_data                                                 *
    form get_data.
      data: imarc type table of marc with header line.
      select * from marc into table imarc up to 10 rows.
      assign imarc[] to <imarc>.
      perform write_data.
    endform.
    *       FORM write_data                                               *
    form write_data.
      data: xmarc type marc.
      loop at <imarc> into xmarc.
        write: / xmarc-matnr, xmarc-werks.
      endloop.
    endform.
    Regards,
    Rich Heilman

  • Getting the total number of pages inside a report

    Post Author: jportelas
    CA Forum: .NET
    Good afternoon:
    How can I get the total number of pages inside a reportdocument object???
    I'm currently using VS.NET 2005.
    Thanks for the help.

    There's no public API to get this info directly from RAS.
    Option is to either walk through pages in the CrystalReportViewer till you get to the end, or use the non-public not-for-public use API:
    int lastPageNumber = ((com.crystaldecisions.sdk.occa.report.application.AdvancedReportSource) reportClientDocument.getReportSource()).getLastPageNumber(new com.crystaldecisions.sdk.occa.report.reportsource.RequestContext());
    Sincerely,
    Ted Ueda

  • I'm unable to delete a div which is having contenteditable false and the contenteditable false div is inside another having cotenteditable div true, plz guide

    i'm unable to delete a div which is having contenteditable false and the contenteditable false div is inside another having cotenteditable div true, plz guide

    There are better answers to this in stackoverflow.com:
    *[http://stackoverflow.com/questions/16996060/how-to-change-div-contenteditable-from-true-to-false]

  • Getting the coordinates of an overlayed rectangle or point

    I have drawn a rectangle or point on an image using the Tools and I now want to get the coordinates of the rectangle or point I have just drawn. How do I do this?

    bep -
    To do this, use the Regions property on the CWIMAQViewer object, and assign it into a variable of the type of the ROI (in this case, a rectangle). Here's an example:
    Dim rect As CWIMAQRectangle
    Set rect = CWIMAQViewer1.Regions(1)
    The rect variable should now contain the dimensions of the rectangle drawn.
    Let me know if you have problems with this. Thanks!
    Greg Stoll
    IMAQ R & D
    National Instruments
    Greg Stoll
    LabVIEW R&D

  • Problem downloaden ebooks. i get the message: 'Elic already fullfilled by another user'  ( i had to authorize adobe digital editions on my comp to be able to share a certain book, but now doesnt download books anymore from shop) How can i solve this?

    Problem downloaden ebooks. i get the message: 'Elic already fullfilled by another user'  ( i had to authorize adobe digital editions on my comp to be able to share a certain book, but now doesnt download books anymore from shop) How can i solve this?

    You has a other Adobe ID in Adobe Digital Edition by the First open of the eBook....or you have open the eBook with empty authorization. When has used a other adobe id should change the adobe id, if not the eBook are looked with the empty authorization. In this case need a new Download of the eBook of his reseller.

  • Getting the index of a pixel in an indexed image

    Hi,
    Is it possible to get the index of a pixel in an indexed image? I mean, indexed images (GIF, indexed PNG) are like:
    INDEX R G B
    0 234 22 143
    1 9 123 213
    2 56 43 10
    etc.
    I'm wondering if it exists a GET method to retrieve this INDEX, as getRGB() retrieves the sRGB value of a pixel.
    Thanks in advance.

    Raster.getSample:
    import java.awt.image.*;
    import java.io.*;
    import java.net.*;
    import javax.imageio.*;
    public class IndexColorModelTest {
        public static void main(String[] args) throws IOException {
            URL url = new URL("http://forum.java.sun.com/images/reply.gif");
            BufferedImage bi = ImageIO.read(url);
            ColorModel cm = bi.getColorModel();
            if (!(cm instanceof IndexColorModel))
                throw new IOException("ColorModel is " + cm.getClass());
            WritableRaster r = bi.getRaster();
            for(int y=0, uby=r.getHeight(); y<uby; ++y) {
                for(int x=0, ubx=r.getWidth(); x<ubx; ++x) {
                    int sample = r.getSample(x, y, 0); //<<--------<<
                    //if (sample < 100)
                    //    System.out.print(" ");
                    if (sample < 10)
                        System.out.print(" ");
                    System.out.print(sample);
                System.out.println();
    }

  • When a pop up window comes up it is - search bookmarks and history window! I cannot log into my bank as login button should open new window to log in but I get the search page. I cannot see larger images as again I get the search bookmarks and history pa

    When a pop up window comes up it is - search bookmarks and history window! I cannot log into my bank as login button should open new window to log in but I get the search page. I cannot see larger images as again I get the search bookmarks and history page etc. Happens on all options that should open new page. I am so frustrated, this has been happening since Firefox updated itself 2 days ago to Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 ( .NET CLR 3.5.30729; .NET4.0C) was fine before that. using windows vista. Can you please advise what I should do? Also can you go back to previous version? Error console eg
    Warning: Error in parsing value for 'cursor'. Declaration dropped.
    Source File: https://ib.nab.com.au/nabib/styles/menu_nab.css?id=009
    Line: 116
    ib.nab.com.au : server does not support RFC 5746, see CVE-2009-3555 and Warning: Selector expected. Ruleset ignored due to bad selector.
    Source File: https://ib.nab.com.au/nabib/styles/nabstyle.css?id=014
    Line: 837
    == This happened ==
    Every time Firefox opened
    == 2 days ago after update.

    Do you have that problem when running in the Firefox SafeMode?
    [http://support.mozilla.com/en-US/kb/Safe+Mode]
    ''Don't select anything right now, just use "Continue in SafeMode."''
    If not, see this:
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

  • How to get the main funciton name when calling another function inside?

    for eg, one RFC named A,inside A,a funtion B is called.when the processing is at B now,how can i get the main RFC name(A)?
    any help will be much appricated.

    > just see SM50,there is a column called 'Report',it shows the program id the proess is now processing.but i don't know its main program or say it 'the process's first excuting program',how can i get it programmatically?
    I'm still not sure to understand. The program in SM50 is the current main program (not the first). It is stored in SY-REPID system variable. Or use this code:
    DATA lt_callstack_long TYPE abap_callstack.
    DATA ls_callstack_long TYPE LINE OF abap_callstack.
    CALL FUNCTION 'SYSTEM_CALLSTACK'
          IMPORTING
            callstack    = lt_callstack_long.
    READ TABLE lt_callstack_long INDEX 1 INTO ls_callstack_long.
    WRITE : / 'current main program is:', ls_callstack_long-mainprogram.
    If you want to know the frame program (the first called), use SY-CPROG, or use this code:
    DATA lt_callstack_long TYPE abap_callstack.
    DATA ls_callstack_long TYPE LINE OF abap_callstack.
    CALL FUNCTION 'SYSTEM_CALLSTACK'
          IMPORTING
            callstack    = lt_callstack_long.
    " read last line = first called program
    DESCRIBE TABLE lt_callstack_long. "to make sy-tfill = number of lines
    READ TABLE lt_callstack_long INDEX sy-tfill INTO ls_callstack_long.
    WRITE : / 'First main program is:', ls_callstack_long-mainprogram.

  • Retreiving the file names from directory inside another directory from application server

    Hi,
    I had a problem in retreiving the file names from a directory inside another directory.
    I tried using the FM's  SUBST_GET_FILE_LIST, RZL_READ_DIR_LOCAL and EPS_GET_DIRECTORY_LISTING
    But here I am getting only one directory details.
    Actually my file is located a directory inside one more directory and one more directory and inside the files are located.
    i.e total 3 directories inside the 3rd one my files are there.
    I need to read the latest file name in the directory.
    So that i can do some manipulation after getting the file name.
    Is there option like OPEN DATASET , READ DATASET and CLOSE DATASET?
    Can anyone please let me know How can i acheive this one.
    Regards
    Ram

    Hi Ram,
        Following thread can be helpful for you, were it shows in the tables structure rsfillst a field RSFILLST-TYPE whether its a directory or file..........
    http://scn.sap.com/thread/865272
    thanks and regards,
    narayan

Maybe you are looking for

  • How do I use the full range of Typekit fonts?

    I want to use a couple of Typekit fonts (Calluna and Minion) that are not part of the Web Font library. Is this now a feature in Muse CC or do I have to use a widget, such as this ... Using Full Typekit Fonts in Adobe Muse CC - Widget by MuseThemes.c

  • BAPI_PO_CHANGE document number leading zero problem

    Hi experts, The following code clears the "Delivery Complete" flag on a list of Purchase Orders uploaded from a CSV file. The PO number is 9 digits long, however, in EKPO table it is stored as 10 digits (prefixed with a zero). The BAPI does not recog

  • How do I know it is okay to disconnect my camera after downloading photos

    When I download photos from my SLR to my iMac using Aperture 3.1.3 is there anything I need to do to disconnect my camera after the download? Usually there is an okay to disconnect message or button to ejec. I do not see anything on Aperature that it

  • Grrrr... 2 months and camera shutter stuck

    The camera on my 4(and any app that might call the camera) is stuck showing the shutter. I have tried soft and hard resets, and totally resetting the phone and restoring from a backup. It's still stuck. Went to the Apple Store, got told that I needed

  • Ipad can't connect to itunes

    I have narrowed it down to a setting on the ipad.  Erasing the ipad restores my ability to sync to itunes.  Restoring my icloud backup breaks my ability to sync to itunes. Now I don't know what to do.  How can I restore my ability to sync with itunes