Page 1 of 1

change detection in two frames of a video

Posted: 2018-03-06T22:49:17-07:00
by IRDump
hello everyone,
we have two frames of a video which has been take from a target shoot paper. Our goal is to detect new bullet holes from these frames.
i have uploaded my samples and you can download it from here -> "http://s9.picofile.com/file/8321113492/ ... e.rar.html" or from https://ufile.io/yc4ri.
Any suggestion is very helpful and i'm waiting for your contribution.
best regards

Re: change detection in two frames of a video

Posted: 2018-03-07T01:17:28-07:00
by fmw42
If your two images are perfectly aligned, then see

https://www.imagemagick.org/Usage/compose/#difference
https://www.imagemagick.org/script/compare.php
https://www.imagemagick.org/Usage/compare/

For example, try

Code: Select all

convert "Video (7)19.jpg" "Video (7)20.jpg" -compose difference -composite -auto-level -negate -threshold 10% -negate result.png

Re: change detection in two frames of a video

Posted: 2018-03-07T05:09:13-07:00
by IRDump
dear "fmw42",
thank you very much for your valuable solution. Is there any way to calculate threshold value dynamically at run time? how can we distinguish real bullet holes from noises in very short processing time which exists between two frames?
best regards

Re: change detection in two frames of a video

Posted: 2018-03-07T10:20:59-07:00
by fmw42
Your images have such low resolution that the bullet holes are tiny. I would not know how to distinguish those from significant noise. If the bullet holes are large enough, you can use -connected-components to filter out all regions that are too small.

As to the threshold, I am not sure there is a good way to do that automatically. But perhaps you can find some value that reasonable in combination with -connected-components.

See http://magick.imagemagick.org/script/co ... onents.php