How to compare pixel values of two different grayscale images...

I have two different grayscale images both of much different sizes. One is 46x20 pixels and the other is 2592x1944 pixels. I'm having trouble finding a way to "scan" the smaller image through the larger one so that comparisons between the pixel values can be made. Basically I'm trying to see if anything matches the smaller image in the big image semi-closely. I can access the pixel values of each image but I can't figure out an algorithm to perform the scan. Any help at all would be very much appreciated! Thanks.

Hi
recipe:
1.
Find all the values for all the pixels in the small image. Some might be similar. Put all those values that are useful into a List called comparisonList.
2.
For each scanline in the large image
For each pixel in the scanline
is this pixel the same value as a pixel in the comparisonList?
if so do something
is the scanline finished?
if not next pixel
loop to next scanline
where scanline is a horizontal line in the big picture.
my 2c
hope helps

Similar Messages

  • How to compare the contents of two different tables

    hello. can somebody give me an idean on how to compare the contents of two different tables in mysql?
    example, i have a table named Main List and a table named New List.
    The contents of the New List should be compared to the contents of the
    Main List, to check if they are equal. I don't have any idea how to manipulate
    this data. Hoping for your help. Thanks.

    it is better to comapre it using java.. try get the resultset first and store that in collections then comapre the two collections

  • How to compare the programs in two different systems

    Hi,
    I have two systems say A & B and i have the program say 'Z_TESTPROG'.
    How to compare the program in two different systems.
    Regards,
    Venkat

    Hi,
    Check the version in Utilities -> version -> version management in both servers is one option.
    Another one is using SE39 transaction.
    Regards
    Manasa

  • Comparing row values in two different tables

    Hello,
    Does anyone know if it is possible to compare (and possibly highlight - which I know can be done) row values in two different tables?
    I have a ZIP Code column in table A that I want to compare to a ZIP Code column in table B and highlight those ZIP Codes that are present in table B but not in table A etc. Is this possible?
    Thanks,
    Kenneth

    To be able to apply conditional formatting, I must edit the formulas this way.
    =IF(ISBLANK(B)," ",IF(ISERROR(VLOOKUP(B,Tableau 2 :: B,1,0))," ",VLOOKUP(B,Tableau 2 :: B,1,0)))
    =IF(ISBLANK(B)," ",IF(ISERROR(VLOOKUP(B,Tableau 1 :: B,1,0))," ",VLOOKUP(B,Tableau 1 :: B,1,0)))
    I replaces the four empty strings by strings containing one space character.
    In the field supposed to contain the text which is not contained I just entered a single space character.
    Yvan KOENIG (from FRANCE vendredi 12 septembre 2008 20:52:11)

  • Will a sequence return same value for two different sessions?

    Is there a possibility that a sequence will return same value to two different sessions when it is referred exactly at the same instance of time?

    @Justin... Thanks for your insight; indeed, we too feel this shouldn't ever happen and never heard of it either, but there it is. (No, we haven't logged a TAR yet -- whatever that is -- partly because it didn't occur to us and partly because we only recently came across the issue and sensibly want to do some testing before we cry foul.)
    However, the code is pretty straight-forward, much like this (inside a FOR EACH ROW trigger body):
    SELECT <seqname>.NEXTVAL INTO <keyvar> FROM DUAL;
    INSERT INTO <tblname> (<keyfield>, <... some other fields>)
    VALUES(<keyvar>, <... some other values> );
    (where <tblname> is NOT the table on which the trigger is fired). This is the only place where the sequence is ever accessed. The sequence state is way below its limits (either MAXVALUE or <keyfield>/<keyvar> datatype size).
    In this setup, end users sometimes got an out-of-the-blue SQL error to the effect that uniqueness constraint has been violated -- as I said, we used to have a unique index on <keyfield> -- which leads us to assume that the sequence generated a duplicate key (only way for the constraint to be violated, AFAIK). We released the constraint and indeed, using a simple SELECT <keyfield>, COUNT(*) FROM <tblname> GROUP BY <keyfield> HAVING COUNT(*)>1 got us some results.
    Unfortunately, the <tblname> table gets regularly purged by a consumer process so it's hard to trace; now we created a logger trigger, on <tblname> this time, which tracks cases of duplicate <keyfield> inserts... We'll see how it goes.
    @Laurent... winks at the CYCLE thing Our sequence is (needless to say) declared as NOCYCLE and the datatype is large enough to hold MAXVALUE.

  • Better approach for checking column values between two different rows

    My requirement is to find best Approach to find difference between column values of two different rows.Below I've mentioned two different
    approaches I'm thinking of,but I'd like to know is there any other better approach.
    version details
    SQL> SELECT *
      2  FROM V$VERSION;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0      Production
    TNS for Solaris: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - ProductionTable creation script
    CREATE TABLE R_DUMMY
       (CA_ID VARCHAR2(16) NOT NULL ENABLE,
         CA_VER_NUM NUMBER(4,2) NOT NULL ENABLE,
         BRWR_SHORT_NAME VARCHAR2(25 CHAR),
         sic_code     number,
         FAC_ID VARCHAR2(10) NOT NULL ENABLE
    / insert script
    insert into r_dummy (CA_ID, CA_VER_NUM, BRWR_SHORT_NAME, sic_code, FAC_ID)
    values ('CA2001/11/0002', 2.00, 'Nandu',1234, 'FA000008');
    insert into r_dummy (CA_ID, CA_VER_NUM, BRWR_SHORT_NAME, sic_code, FAC_ID)
    values ('CA2001/11/0002', 3.00, 'SHIJU',456, 'FA000008');Desired O/P :
    ca_id               fac_id          column_name          previous name          after_modification
    CA2001/11/0002          FA000008     BRWR_SHORT_NAME          Nandu               SHIJU
    CA2001/11/0002          FA000008     sic_code          1234               456My approach
    select      ca_id,fac_id,column_name,
         decode(column_name,'BRWR_SHORT_NAME',lg_brwr,lg_sic) previous_name ,
         decode(column_name,'BRWR_SHORT_NAME',ld_brwr,ld_sic) after_modification
    from
         select
                   case
                        when ld_brwr != lg_brwr then
                        'BRWR_SHORT_NAME'
                        when ld_brwr != lg_brwr then
                        'sic_code'
                   end
              ) column_name,ca_id,fac_id,lg_brwr,ld_brwr,ld_sic,lg_sic
         from     (
              select ca_id,fac_id,lag_brwr,ld_brwr,ld_sic,lag_sic
              from
                        Select      lead(brwr_short_name,1) over(partition by ca_id,fac_id) ld_brwr,
                             lag(brwr_short_name,1) over(partition by ca_id,fac_id) lg_brwr,
                             lead(sic_code,1) over(partition by ca_id,fac_id) ld_sic,
                             lag(sic_code,1) over(partition by ca_id,fac_id) lg_sic,
                             ca_id,fac_id
                        from r_dummy
              where (ld_brwr != lg_brwr or ld_sic != lg_sic)
    )2nd Approach :
    =============
    select      ca_id,fac_id,column_name,
         decode(column_name,'BRWR_SHORT_NAME',lg_brwr,lg_sic) previous_name ,
         decode(column_name,'BRWR_SHORT_NAME',ld_brwr,ld_sic) after_modification
    from
         select
                   case
                        when ld_brwr != lg_brwr then
                        'BRWR_SHORT_NAME'
                        when ld_brwr != lg_brwr then
                        'sic_code'
                   end
              ) column_name,ca_id,fac_id,lg_brwr,ld_brwr,ld_sic,lg_sic
         from     (
              select ca_id,fac_id,brwr_short_name,sic_code
              from
                        Select      ca_id,fac_id,brwr_short_name lg_brwr,sic_code lg_sic
                        from     r_dummy
                        where     ca_ver_num = '2.00'
                   )o,(
                        Select      ca_id,fac_id,brwr_short_name ld_brwr,sic_code ld_sic
                        from     r_dummy
                        where     ca_ver_num = '3.00'
                              )n
              where      0.ca_id = n.ca_id
                   and 0.fac_id = n.fac_id
                   and (ld_brwr != lg_brwr or ld_sic != lg_sic)
    )Hi Experts,
         I've provided sample data where I'm checking for just two columns viz brwr_short_name ,sic_code,but in real time
    I've to check for 8 more columns so please suggest me with a better approach.
    I appreciate your precious suggestions.

    Hi,
    Thanks for posting the CREATE TABLE and INSERT statements; that really helps!
    Here's one wa. Like your 2nd approach, this uses a self-join:
    WITH     got_r_num     AS
         SELECT  ca_id
         ,     ROW_NUMBER () OVER ( PARTITION BY  ca_id
                                   ,                    fac_id
                             ORDER BY        ca_ver_num
                                 )    AS r_num
         ,     brwr_short_name
         ,     TO_CHAR (sic_code)     AS sic_code
         ,     fac_id
    --     ,     ...     -- Other columns (using TO_CHAR if needed)
         FROM     r_dummy
    ,     unpivoted_data     AS
         SELECT     *
         FROM     got_r_num
         UNPIVOT     INCLUDE NULLS
              (    txt
              FOR  column_name IN ( brwr_short_name          AS 'BRWR_SHORT_NAME'
                            , sic_code               AS 'SIC_CODE'
    --                        , ...     -- Other columns
    SELECT       p.ca_id
    ,       p.fac_id
    ,       p.column_name
    ,       p.txt          AS previous_name
    ,       a.txt          AS after_modification
    FROM       unpivoted_data   p
    JOIN       unpivoted_data   a  ON  p.ca_id     = a.ca_id
                           AND p.fac_id     = a.fac_id
                         AND p.column_name     = a.column_name
                         AND p.r_num      = a.r_num - 1
                         AND p.txt || 'X' != a.txt || 'X'
    ORDER BY  a.r_num
    ;To include other columns, add them in the 2 places where I put the comment "Other columns".
    Ca_ver_num can have any values, not just 2.00 and 3.00.
    This will show cases where a value in one of the columns changed to NULL, or where NULL changed to a value.
    There ought to be a way to do this without a separate sub-query like got_r_num. According to the SQL Language manual, you can put expressions in the UPIVOT ... IN list, but when I tried
    ...     UNPIVOT     INCLUDE NULLS
              (    txt
              FOR  column_name IN ( brwr_short_name          AS 'BRWR_SHORT_NAME'
                                 , TO_CHAR (sic_code)     AS 'SIC_CODE'
              )I got the error "ORA_00917: missing comma" right after TO_CHAR. Perhaps someone else can show how to eliminate one of the sub-queries.

  • How can I send email using two different email address that both link back to my one exchange account on my Ipad mini

    How can I send email using two different email address that both link back to my one exchange account on my Ipad mini? 
    On my PC I simply have a master return email address and use a POP for the secondary address.  Both are through the one exchange account without a problem.  I need to be able to do the same on my Ipad.

    Ah, I should have made that clear.  My domain didn't come from google.  It was purchased at and is hosted at dreamhost, but I haven't used their email servers in years - I just route everything through gmail.  I actually have a bunch of domains (with websites).
    Gmail has an option that lets someone with custom domains send (and receive) email through gmail using the custom domain once Google confirms proper ownership of the domain (to prevent spammers and such).  Gmail has a setting for "send email as" which allows gmail to be sent using a custom domain as the sender.  I'm pretty sure Apple's old mobileme had this feature too, but I didn't use it.

  • How can I transfer songs from two different itunes?

    I want to transfer songs from my brother's itunes library to my shuffle, but when I plug it in his computer, a message saying that his library is not linked to my library (or something to that extent) and whether I would like to replace the songs. If I click yes, all my existing songs are replaced with HIS songs. If I click on NO, the Shuffle icon does not appear at all and I cannot transfer any of his songs to my shuffle. How can I transfer songs from two different computers into my shuffle without replacing any of my existing music?
    Shuffle   Windows XP  
      Windows XP  

    You'll have to setup your iPod to manual instead of automatic update (I'm not sure, though, if it works with the Shuffle as well).
    Alexander.

  • In BADi , How to pass the values between two Method

    Hi Experts,
    We have two methods in BADis. How to pass the value  between two Methods. Can you guys explain me out with one example...
    Thanks & Regards,
    Sivakumar S

    Hi Sivakumar!
    Create a function group.
    Define global data (there is a similiar menu point to jump to the top include).
    Create one or two function modules, with which you can read and write the global data.
    In your BADI methods you can access the global data with help of your function modules. It will stay in memory through the whole transaction.
    Regards,
    Christian

  • HT4061 How do I consolidate purchases from two different ids that are on the same bank account, and eliminate the extra id without losing any purchases?

    How do I consolidate purchases from two different ids that are on the same bank account, and eliminate the extra id without losing any purchases? I want my music to match on both ipad and computer.

    Purchases are forever tied to the AppleID they were bought with. There is currently no way to consolidate AppleIDs. Sorry.

  • How do I calculate days from two different dates?

    Hi all,
    How do I calculate days from two different dates?
    my requirement is to pass the number of days to target field from two dates.
    Current date :  14/04/2010
    Standard date: 01/01/1957 is the standard = day 0
    Is it possible in graphical mapping with out  udf?
    Plz help me on this I have donu2019t have much knowledge on JAVA.
    Thanks

    Hi Yadav,
    Probably this is not the correct forum for XI / PI .
    You can post the same to...
    Process Integration (PI) & SOA Middleware
    Hope this helps.
    Regards
    Raj

  • How do I calculate days from two different dates in XI/PI?

    Hi all,
    How do I calculate days from two different dates in XI/PI?
    my requirement is to pass the number of days to target field from two dates.
    Current date : 14/04/2010
    Standard date: 01/01/1957 is the standard = day 0
    Is it possible in graphical mapping with out udf?
    Plz help me on this I have donu2019t have much knowledge on JAVA.
    Thanks

    Hi Yadav,
    Probably this is not the correct forum for XI / PI .
    You can post the same to...
    Process Integration (PI) & SOA Middleware
    Hope this helps.
    Regards
    Raj

  • How can I use music from two different iTunes accounts?

    how can I use music from two different iTunes accounts?

    If you mean iTunes Store accounts, there's really nothing for you to do. Just add the tracks to the iTunes library and play them. Music purchased prior to late-2009 will been to be authorized, though. Pull down Store > Authorize... and type the credentials of the Apple ID used to buy the tracks.
    If you mean something else, please describe in more detail.

  • How to add integer value of two buttons?

    how to add integer value of two buttons (any button) in VI and display it in output text box? i have attached example program, but i know its wrong.. please help
    Solved!
    Go to Solution.
    Attachments:
    add.vi ‏8 KB

    thanks for reply. i am trying to assign an integer value to a button and the button should send the assigned integer value to TCP/IP write, only when the button is pressed. i am able to send data using string control (as shown in the attachment) but i want to replace it with several buttons. for example, if i enter 2 in string control, this data will be sent to a robot (robot has wifi card)  through tcp/ip protocol, it moves front. 3 will make it to move back, 8 is left, 6 is right. this numeric data is already burnt into blackfin processor of the robot. so just by entering numbers in labview can make my robot move in specified direction. can you please help me to create a button with value and convert it into string and send it to tcp/ip write. this should happen only when the button is pressed. because, if i enter numbers in string control, it dosent looks good..... if i have buttons... i think my VI will look good and hitech.
    Attachments:
    robo.vi ‏9 KB

  • How to compare the value of a specied attribute to a string

    I am looking for an example of how to compare the value of an attribute to a string. (I think)
    I have been trying to:
    if (attrs.get("title")== "Vampire") -- you already know this did not work.
    How can I check to see if the title="Vampire"?
    The code below will get me the title of admin (which should be Vampire)
    import javax.naming.Context;
    import javax.naming.directory.InitialDirContext;
    import javax.naming.directory.DirContext;
    import javax.naming.directory.Attributes;
    import javax.naming.NamingException;
    import java.util.Hashtable;
    class Giles {                  
    public static void main(String[] args) {
              Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
         "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL, "ldap://192.168.1.55:389/o=sunnydale");
         try {                                                                     
         DirContext ctx = new InitialDirContext(env);
         Attributes attrs = ctx.getAttributes("cn=admin");
         System.out.println("Title: " + attrs.get("title").get());
         ctx.close();
         } catch (NamingException e) {                                     
         System.err.println("Problem getting attribute: " + e);
    Thank you!!
    Steve

    I guess, you are looking for searching for attributes of an user object.
    Here is the sample code to list all the attributes of an 'user' objectclass.
    Tell me if it helps or not.
    import java.util.Hashtable;
    import javax.naming.ldap.*;
    import javax.naming.directory.*;
    import javax.naming.*;
    public class GetAttributes
         public static void main (String[] args)
              Hashtable env = new Hashtable();
              //Must use either the userPrincipalName or samAccountName,
              //Cannot use the distinguished name
              String adminName = "cn=abcd,cn=Users,dc=ssotest,dc=com";
              String adminPassword = "DEF1234";
              String ldapURL = "ldap://pni3w067:389";
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              env.put(Context.SECURITY_AUTHENTICATION,"simple");
              env.put(Context.SECURITY_PRINCIPAL,adminName);
              env.put(Context.SECURITY_CREDENTIALS,adminPassword);
              //connect to my domain controller
              env.put(Context.PROVIDER_URL,ldapURL);
              try {
                   // Create the initial directory context
                   DirContext ctx = new InitialLdapContext(env,null);
                   // Create the search controls
                   SearchControls searchCtls = new SearchControls();
                   //Specify the search scope
                   searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user))";
                   //Specify the Base for the search
                   //cn=policygroup,ou=policyusers,ou=ssoanay,;
                   //String searchBase = "ou=policyusers,ou=ssoanay,dc=ssotest,dc=com";
                   String searchBase = "cn=abcd,cn=users,dc=ssotest,dc=com";
                   //initialize counter to total the results
                   int totalResults = 0;
                   // Search for objects using the filter
                   NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
                   //Loop through the search results
                   while (answer.hasMoreElements()) {
                        SearchResult sr = (SearchResult)answer.next();
                        totalResults++;
                        System.out.println("\nName of Object : " + sr.getName());
                        // Print out some of the attributes, catch the exception if the attributes have no values
                        Attributes attrs = sr.getAttributes();
                        //System.out.println("6");
                        if (attrs != null) {
                             try {
                                  /*NamingEnumeration enum = attrs.getIDs();
                                  while(enum.hasMore()) {
                                       System.out.println("IDs:"+enum.next().toString());
                                  NamingEnumeration enum2 = attrs.getAll();
                                  while(enum2.hasMore()) {
                                       System.out.println("Attribute - "+enum2.next().toString());
                             catch (Exception e)     {
                                  System.out.println("Exception:" +e.getMessage());
                        else {
                             System.out.println("attribute is null");
                   System.out.println("Total results: " + totalResults);
                   ctx.close();
              catch (NamingException e) {
                        System.err.println("Problem searching directory: " + e);
         //return 0;
    }

Maybe you are looking for

  • Urgent : Regarding Purchase Requsition Report

    Hi, I am making  a report on Purchase Requisition in which i have to display that these are the persons who have released this requisition (i.e. If General Manager has  released that should be displayed,if Director had  released it should be displaye

  • Plants abroad - WIA billing document

    Hello, I have customized plants abroad as explain in note 506588, but when I try to bill the delivery document to obtain the WIA billing document, the system displays an error saying that the document is not relevant for billing. The billing relevanc

  • How to put defalut Element-value in DTD

    Hello , 2 things : 1. Is there any way to specify default value of an Element in DTD ? 2. in DTD , how to specify date-format for an Element or attribute which is meant for Date ? thanx in advance. regds, Rajesh

  • Raw files not supported

    I have a new Canon T2i and can't seem to get the raw files to open in Elements 8. I have downloaded the 5.6 camera raw update and the DNG converter and both say camera raw files not supported......now what?

  • IMessage order on MacBook Pro and problems with iPhone iMessage

    Hi, I use my iMessage on my MacBook Pro and on my iPhone. In iMessages on my Mac I have it set to use two addresses, my phone number and my icloud email. I have the same on my phone. When I receive a message it is ordered correctly on my phone with t