Page 1 of 1

Overcoming camera movement

Posted: 2018-02-19T20:13:58+00:00
by blinkybagger
I had been playing around with detecting differences between collections of images via Fred's (-m g) script.

When I had the script detect significant differences between frames in a sequence of film, after cropping, I found one of a few scenarios had occurred.
  • Changes in position of subject
  • Changes in ambient light (familiar to those using motion intensified video techniques)
  • Changes in camera position due to windage

I had some success via modulate to change the brightness which detected nicely.

Considering movement due to windage, when I took the outputs of Canny edge detection, I thought I'd try updating the geometry inside a loop to determine if I moved the 2nd frame a pixel in one of the cardinal directions and re-evaluate to see if the new position was more similar, or less similar.

However I found that my attempts to update the geometry using the offsets were not making any difference to the image. (using something along the lines of convert img.png -geometry 400x400+$offset+0 offset_image.png). I wonder if I update the crop frame being the preceding step, rather than attempting to modify the outputs afterwards via geometry might be another way around the problem. Why might I not be seeing any difference as output from- geometry?


Re: Overcoming camera movement

Posted: 2018-02-19T20:23:01+00:00
by fmw42
-geometry is a setting not an operator. It needs to be used by some operator such as -composite. If you just want to shift pixels by integers, see -roll. If you want fractional adjustments, see distort SRT.

Re: Overcoming camera movement

Posted: 2018-02-19T22:07:34+00:00
by blinkybagger
Thanks Fred!

I've been having a look at relationships between collections of images, trying to find ways to traverse collections of images in ways that produces outputs that aren't painful, or boring to look at....getting the pace and relationship between images in the (subjective) optimal zone.

Putting the outputs after -roll back into makes me wonder about the assessment of how busy an image is. The Similarity Metric after a relatively small offset is low, then the image is busy, indicating not so many contiguous blocks of color....but this is likely to have technical name and is perhaps addressed by the outputs of the likes of "identify -verbose".

Re: Overcoming camera movement

Posted: 2018-02-19T23:54:56+00:00
by fmw42
Is there a question?

Re: Overcoming camera movement

Posted: 2018-02-20T00:03:09+00:00
by fmw42
In IM 7, compare now has structural similarity index metric.

2017-08-27 7.0.6-10 Cristy <quetzlzacatenango@image...>
Support -metric ssim, structual similarity index.