A
A
Alexander Alekseev2015-05-20 18:51:41
Video processing
Alexander Alekseev, 2015-05-20 18:51:41

How to automatically select an object in an image?

There is a video converted to a sequence of frames. On some frames there is only a background picture, on others with objects. Both are selected by the user. What algorithms exist for high-quality automatic selection of objects, taking into account the fact that shooting takes place not in a photo studio, but in real urban conditions? I mean, the wiggle of the foliage and the slight change in light due to partly cloudy conditions are natural attributes of such a shoot. That is, it would be desirable that selection of objects was carried out programmatically.
Here's what I got using the difference between frames:
7.jpg
But I'm not satisfied with the result due to numerous artifacts.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Daniil Bakalin, 2015-05-28
@Quiensabe

The simplest thing in this case is to use the same difference, but not for the image as a whole, but for individual channels. Including saturation and hue.
Having found a mask for each pair of channels, they can be combined and a more accurate mask can be obtained.
And in the case of the car, in the center of the car you have a big black spot, because the difference in the green channel is offset by the inverse difference in red and blue. In total, something turned out to be about 0.
If we sum up the difference modules for each channel, this problem would not exist.
If you want to go further - you need to split the images into levels of detail (see wavelet photo processing). Finding the masks for each level separately and combining them will probably significantly improve the result.

S
SeptiM, 2015-05-21
@SeptiM

In the general case, I can advise this method: opencv-python-tutroals.readthedocs.org/en/latest/p...
Although, in fact, a lot of interesting things can be done on the difference. You can lower the threshold, and remove all the small connectivity components. This can be done through morphological transformations or just run BFS in each component.

P
polar_winter, 2015-05-21
@polar_winter

Try Matlab (Image processing toolbox).

R
Roman Mirilaczvili, 2015-07-23
@2ord

If you remove small spots in your mask, and fill the spots inside the car object with the color of the mask to get a uniform color, you should get something like this:
27d1c0a8373745228c979fe2a8466b3d.png2c1a4ad560744e399e64cecbc8ff6f81.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question