Home > Mobile >  How to find the content in an image where the x y screen coordinates position
How to find the content in an image where the x y screen coordinates position

Time:09-16

First the question a little bit more simple: such as a piece of figure 1. The PNG (assuming that it is a full-screen) first, I first take this picture on a piece of figure 2. The PNG, wanted to find the chang 2. PNG in 1. The screen on the PNG x y coordinate values, need two pictures of automatic comparison values, are there any articles or open source libraries can realize this, thank you for the great spirit guide


CodePudding user response:

Still want to method,,,,

CodePudding user response:

Can change the function, by clicking on the screen for current click on the location of the x, y coordinate values, if you can, in your Activity or fragments rewrite onTouchEvent method, custom listening is ok

CodePudding user response:

Image recognition is this?

CodePudding user response:

OpenCV,,,

CodePudding user response:

Try the gray matching or other match algorithm in image matching algorithm, can use opencv library

CodePudding user response:

reference lllx9464 reply: 3/f
image recognition is this?
is there is image recognition, and I don't know you worked on Total Control script this function is similar to an q

CodePudding user response:

refer to the second floor xj396282771 response:
can change the function, by clicking on the screen for current click on the location of the x, y coordinate values, if you can, in your Activity or fragments rewrite onTouchEvent method, custom listening to
the content you understand is wrong, I am to image matching,

CodePudding user response:

reference lllx9464 reply: 3/f
image recognition is this?
is there a specific point of the image recognition method

CodePudding user response:

Only know roughly the area, specific to a particular pixel, this is not possible, because of the approaches and the neighboring pixels may also be the same,

CodePudding user response:

references 9 f Prohackers response:
only know roughly the area, specific to a particular pixel, this is not possible, because of the approaches and the neighboring pixels may also be the same, the
70% just probably know, because I is a screenshot of the phone, so here is some, I actually find ordinate match as long as it is now, now I use the most stupid method is hard and pixels in a row, I don't know how to deal with optimization algorithm,

CodePudding user response:

Personally, I have an idea for reference only, the building Lord since already know the x coordinates, and (2) the PNG image width and height should also already know, so in 1. PNG coordinates x and x + width coordinates to draw 2 vertical lines, this article 2 vertical lines area must contain 2. PNG, and then you put 2. PNG all pixel points added together to get a value, and then use a loop statements in the bar area + 1 for each pixel according to the step length, calculation and png2 area of the pixel and the same and just value is consistent? I have no specializes in image processing, don't know this cycle can be done? If can be done, should be able to find a few small square area of the same value, then you put 2 such as quarter area pixel and calculation of the PNG for a value, using a recursive found in just a few small squares match are consistent, so used deduction, and then find a few, then you 1/8 of the original 2. The pixel and the PNG, that has been found original position of the small squares pictures, do not know can?

CodePudding user response:

11 references youyiyang response:
I have an idea for reference only, since already know the building Lord x coordinates, and (2) the PNG image width and height should also already know, so in 1. PNG coordinates x and x + width coordinates to draw 2 vertical lines, this article 2 vertical lines area must contain 2. PNG, and then you put 2. PNG all pixel points added together to get a value, and then use a loop statements in the bar area + 1 for each pixel according to the step length, calculation and png2 area of the pixel and the same and just value is consistent? I have no specializes in image processing, don't know this cycle can be done? If can be done, should be able to find a few small square area of the same value, then you put 2 such as quarter area pixel and calculation of the PNG for a value, using a recursive found in just a few small squares match are consistent, so used deduction, and then find a few, then you 1/8 of the original 2. The pixel and the PNG, that has been found original position of the small squares pictures, do not know can?
this method you go with me now to use the method of the same, but this method problem, is sometimes figure generated 1. PNG pixel will have certain differences, they only want to be similar to a judge, didn't find the specific,

CodePudding user response:

Refers to the 2. PNG and 1. PNG pixels have some differences?

CodePudding user response:

reference 13 floor youyiyang reply:
2 refers to PNG and 1. PNG pixels have some differences?
is a larger version figure generated by the phone, large contrast figure, because must find insets area within a larger version, there may be a few pixels have difference,

CodePudding user response:

Looking for a place in the picture a bit trouble,,,

CodePudding user response:

Analysis of the the is where there is a difference? Insets circumference of a circle range are some differences, for example, other areas have no pixel is missing?

CodePudding user response:

reference 16 floor youyiyang response:
can analyze is where there is a difference? Insets circumference of a circle range are some differences, for example, other areas have no pixel is missing?
no, I think may be a resolution of the problem, now the question is how to quickly find figure with matching position to get a similar result value, there must be some algorithm, I see the tc to provide this functionality generally find a chart on the computer 2 s can match, should have the public algorithm, are looking for,

CodePudding user response:

refer to 17th floor cqhydz response:
Quote: refer to the 16th floor youyiyang response:

Analysis of the the is where there is a difference? Insets circumference of a circle range are some differences, for example, other areas have no pixel is missing?
no, I think may be the resolution of the problem, now the question is how to quickly find figure with matching position to get a similar result value, there must be some algorithm, I see the tc to provide this functionality generally find a chart on the computer 2 s can match, should have the public algorithm, also in looking for

Pictures after clipping the default may use JPEG 85 quality of preservation, the will is the source of differences?

CodePudding user response:

Cv2 matchtemplate function image matching, the contrast of six kinds of methods are also given, and finally see max_loc or min_loc
Img=cv2. Imread (filename, cv2 IMREAD_GRAYSCALE)
The template=cv2. Imread (filename, cv2 IMREAD_GRAYSCALE)
H, w=template. Shape [: 2]
Cv_show (" img ", img)
Method=[" cv2 TM_SQDIFF ", "cv2. TM_CCORR", "cv2. TM_CCOEFF", "cv2. TM_SQDIFF_NORMED", "cv2. TM_CCORR_NORMED", "cv2. TM_CCOEFF_NORMED"]
For meth in method:
The car=img. Copy ()
# the car=img. Copy ()
Method=eval (meth)
Print (meth)
Res=cv2. MatchTemplate (img2, template, method)
Min_var max_val, min_loc, max_loc=cv2 minMaxLoc (res)
If method in [cv2 TM_SQDIFF, cv2 TM_SQDIFF_NORMED] :
Top_left=min_loc
The else:
Top_left=max_loc
Bottom_right=(top_left [0] + w, top_left [1] + h)
Ret=cv2. A rectangle (car, top_left bottom_right, (0, 255), 2)
PLT. Imshow (ret)
plt.show()
  • Related