C language plug-in script practical project introduction

A simple algorithm to determine whether two images are similar

Each pixel of the two pictures is compared in turn. Of course, each pixel must be converted into an integer for comparison through argb in advance.

Set a threshold, if the difference between two pixels is less than this threshold, continue to cycle the next pixel, if the difference between two pixels is greater, diff_count++ Finally, as long as diff_count/count <0.2, we can judge that the two pictures are similar

 You can see the irrationality of the above code, as long as there is a pixel that is not the same, it is judged as unreasonable pictures that are not similar!

 

Video: C language practical tutorial series: Handwritten Lianliankan scripts, hands-on teaching_哔哩哔哩_bilibili

Thoughts after watching the video: Some image processing analysis and recognition libraries are very important for plug-in scripts, such as python's pyautogui library, which can click on the area on the screen that we gave python in advance to similar pictures, but when we do not prepare in advance If the picture is good, it will be difficult at this time, and we have to think of other solutions. And pyautogui has other disadvantages, such as: there may be bugs on the secondary screen that cannot recognize the pictures of the secondary screen, so at this time you have to choose other solutions.

The requirement of the above project is to click on two similar pictures on the screen. This requires turning many small areas into pictures at runtime and then identifying and comparing them. After judging the similarity, the two pictures are compared. click.

unfinished...

Guess you like

Origin blog.csdn.net/conquer_galaxy/article/details/130472193