Page 1 of 1

Overcoming camera movement

Posted: 2018-02-19T13:13:58-07:00
by blinkybagger
I had been playing around with detecting differences between collections of images via Fred's similar.sh (-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
Image


I had some success via modulate to change the brightness which similar.sh 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?

Ideas?

Re: Overcoming camera movement

Posted: 2018-02-19T13:23:01-07: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-19T15:07:34-07: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 similar.sh 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-19T16:54:56-07:00
by fmw42
Is there a question?

Re: Overcoming camera movement

Posted: 2018-02-19T17:03:09-07: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.