📜 ⬆️ ⬇️

Looking for differences in images

Hi, Habr!

Based on the article Writing a bot for the game “Find Difference”, an idea appeared to implement the search for third-party objects in a given image using computer vision algorithms.

Details - under the cut.
')

Description of the task.


The problem of identifying a third-party object arises in many situations - for example, in video recording tasks, when, for example, you need to turn on an alarm when an unauthorized person appears at night in a protected area.

At the same time, the main difficulty in signal processing is that the registration conditions can change - it depends on the time of day, the smoke in the room, the state of the recorder itself (for example, the lens is dusty). Therefore, it is necessary to use an algorithm that allows you to select a third-party object, regardless of the conditions in which the shooting is performed.

Information from morphological analysis


Without a mathematical introduction, of course, can not do!

Call the function
f(x):X → R 
image. In our problem, the f(x) value will correspond to the pixel brightness (ranging from 0 to 255).

Let L be the linear space of all images, F the class of all Borel functions that take numerical values, F f be a subclass of F : F f = {F ∈ F : F⊗f () ∈ L}.

And finally, we introduce the important concept of image shape : V f = {F⊗f: F ∈ F f } ⊂ L. Thus, the image shape is the maximum invariant of image transformations that it undergoes when changing the conditions of observation, changing shooting parameters. We will use the concept of form in image processing.

Algorithm


The main idea of ​​the algorithm is to single out a certain maximum image invariant, with which then we will compare the incoming images. The implementation of the algorithm is given in Python.
 from PIL import Image#    




Conclusion


Conclusion: the algorithm of morphological image analysis was implemented - the selection of a foreign object in the image under the changed registration conditions, as well as the implementation in Python .


References



Ps

Tell me how to type the formula? I want to see the beauty of Latex in the articles!

Source: https://habr.com/ru/post/163585/


All Articles