Java Image Search Algorithm

Source: Internet
Author: User

Java Image Search Algorithm
Previously, I wrote some game AIDS using the press-key genie. There is a function called FindPic in it. I will search for a given image on the screen and return the coordinates found. Now, Java Implements similar functions of this function. Algorithm Description: screen. Figure A is displayed. (the target image is figure B.) The pixels in Figure A are traversed. Based on the size of Figure B, the four angles in Figure B are mapped to the four vertices in Figure A. The obtained four vertices are compared with the values of the four angle pixels in Figure B. If four vertices are the same, perform Step 4. Otherwise, go back to step 2 and continue. For further comparison, compare all vertices in the ing range with all vertices in Figure B. If all the values are the same, the image is found. Otherwise, go back to step 2. Here, the comparison between pixels is compared by obtaining the RGB value of each pixel through the BufferedImage object. Convert BufferedImage to an int two-dimensional array as follows: copy code 1/*** obtain the image RGB Array Based on BufferedImage 3 * @ param bfImage 4 * @ return 5 */6 public static int [] [] getImageGRB (BufferedImage bfImage) {7 int width = bfImage. getWidth (); 8 int height = bfImage. getHeight (); 9 int [] [] result = new int [height] [width]; 10 for (int h = 0; h

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.