python - 找两张图的不同点,破解算法应该怎么写?
PHP中文网
PHP中文网 2017-04-17 13:41:39
0
7
503

找茬那种游戏,两张一样的图,其中一张多了些东西。
想做个检测工具,识别两张图的不同之处,有什么算法思路?

PHP中文网
PHP中文网

认证0级讲师

reply all(7)
伊谢尔伦

First align the vertices of the two images, and then do a diff on the pixels to get a new image containing the RGB difference. Normalize this new image, and then use the edge detection algorithm to outline the image outline in the new image. Finally, find the envelope of the outline. This envelope is to find the areas that need to be clicked.

洪涛

It’s simpler, cut the large image into a unit of 5 pixels, and then compare the binary value of each small image~

阿神

The easiest way.
Assuming that the two images have the same length and width, read the pixels directly from the upper left corner and store them into an RGB two-dimensional array. Compare the differences between the two arrays, the similarities are marked in white, and the opposite is marked in black. Generate a picture from this two-dimensional array, and the black parts are the parts with differences.

迷茫

It’s easy to find differences, just read the values ​​​​of the two pictures and then subtract them

刘奇

University graduate student did something similar. In fact, direct subtraction of two images will result in a lot of noise and requires some processing. There are many methods of noise reduction: blurring->binarization, leaving some color blocks, using the connected component marking algorithm to integrate these blocks, and then processing the bounding box, which can be output to other modules. .

Peter_Zhu

Difference the image according to the RGB brightness value, then convert the difference image into a grayscale image, and then use the erosion and expansion algorithm to amplify the different points. If you know OpenCV, you can do this with just a few functions.

巴扎黑

Experiment 4 of Yanyi’s digital image processing. . . Isn’t that the original poster!

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!