How to find an error image?

I have a problem with image processing, but I do not know how to solve it.

I have 2 photos: - Pic 1: http://goo.gl/BBxVl - Fig. 2: http://goo.gl/X0VFW

Fig. 2 actually expresses pic 1, but it was covered by an object. I am writing a program using matlab code to determine this: if the image is complete (perfect), I will be "imshow". But if there are any errors with the image, the program will show a message board for the user.

Until now, I still cannot solve this because I do not know where to start; I also do not have a definition about the shape and color of the object that covers the image.

+4
source share
3 answers

My idea also starts with the absolute difference between the two images. The problem here is that you can get many regions that have not been changed at all, due to the compression and internal operation of some file formats (for example, jpg). For example, here are two sample images and a binary difference between them to highlight each changed point, although I only manually changed the visible rectangles. In the non-binary difference, you hardly notice all these points, but they are. The threshold solves the problem here, I played with a value of 20:

enter image description hereenter image description hereenter image description hereenter image description here

Now, to determine which of the images is “good,” I used the inpainting algorithm (you can find one such implementation at http://www.cc.gatech.edu/~sooraj/inpainting/ ). The reason for this is that the final colored image is more likely to resemble an image before it is painted over if it does not contain artificial patches. Thus, a “bad” image is one that makes a big difference after the inpainting process. To do this, you again calculate the absolute difference, now between the inverted image and the original for both cases. Then use some measure in areas with an absolute difference> 0. In this example, a fictitious sum of intensities in shades of gray gives 424454 for an image without rectangles and 758366 for another.

Here is a masked image for drawing, a “good” image in a picture, a “bad” image in a picture, and the corresponding absolute differences in shades of gray:

enter image description hereenter image description hereenter image description hereenter image description hereenter image description here

+2
source

So you don’t know which one is right, and you want to choose the right one? Or do you have an image of truth on earth with which you can compare the entrance? Because, if you know what the correct image looks like, you can just do a simple subtraction between the images and find the wrong one. Therefore, I do not think the question.

So, in case you have two images, and you have to determine which one is correct, do you know the type of error? Is there always a patch in the picture? Is it always a rectangle or can it also be mixed with a background image?

One idea would be to cut the image in parts and analyze the histogram for each of them, but it will work only if the original image is quite constant and the corrected object is very different from the background.

Perhaps you can do an edge detection in the image, and then try to detect straight lines (this could be a Hough line detection) so you can look for a rectangular shape. (If you have lines as a result, then the rectangle search algorithm does not depend on the shape and size of the rectangle. You only check the direction of the line)

If you can describe in more detail what the limitations of your error objects are, perhaps we can think of a better idea.

+1
source

If the images you posted are good examples of the problem, I would suggest the following algorithm:

  • align both images from each other
  • identify the area of ​​difference, this will give you the shape of an object that covers the “perfect” image.
  • Look at the edges of the distortion, which of the two images is better suited.
+1
source

All Articles