Sorry if the subject is a little vague. I attempted to search the forum for what I want to do, but came up empty, probably because I'm not sure of the best terminology to use. Here's my problem. I have a set of images taken from a security camera that overlooks a new construction site. The images have almost the same frame of reference, and the ones that are off by one axis I can correct with cropping. There are a number of images that are just slightly rotated (it's a security camera with PTZ controls, so it's not very rigid).
I want to create a time-lapse video of the images. I've proven I can do it with the convert tool, by cropping, morphing and then converting them to video with ffmpeg. What I'm wondering is if there's any way with the various tools that IM has to normalize all the images to a common frame of reference, such that the resulting video isn't jumping around. The morph reduces it a lot, but in an obsessive attempt to make it look as good as possible I figured I'd ask. In looking at all the examples and utilities available to IM, it seems like it might be possible, but I have no idea how to approach it.
Setting an image set to a common frame of reference
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Setting an image set to a common frame of reference
It is very hard to know what to recommend without examples. You might post links to some of the images and describe what is different.
Some commands that my help are:
-rotate
-deskew
-distort SRT
-distort Perspective
-distort Bilinear
see
http://www.imagemagick.org/script/comma ... ptions.php
http://www.imagemagick.org/Usage/
http://www.imagemagick.org/Usage/distorts/
Note that IM is a general purpose image processor and does not necessarily have unique tools for everyone's exact cases. But you can script them together in many ways that may hopefully do what you want.
Some commands that my help are:
-rotate
-deskew
-distort SRT
-distort Perspective
-distort Bilinear
see
http://www.imagemagick.org/script/comma ... ptions.php
http://www.imagemagick.org/Usage/
http://www.imagemagick.org/Usage/distorts/
Note that IM is a general purpose image processor and does not necessarily have unique tools for everyone's exact cases. But you can script them together in many ways that may hopefully do what you want.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Setting an image set to a common frame of reference
If the images are only off by a small amount you could try to find offsets by comparing the image to a reference frame.
However image comparing is generally a slow process, so if you have something very specific in the image (corner of some building) you can do a search for a small image containing that corner.
However as fred said without some examples it is hard to say exactly what can be done.
However image comparing is generally a slow process, so if you have something very specific in the image (corner of some building) you can do a search for a small image containing that corner.
However as fred said without some examples it is hard to say exactly what can be done.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Setting an image set to a common frame of reference
Thanks for the starting points. Unfortunately the images are from a security camera, so I can't really post any of them. This could be more work than it's worth. In looking closely at the images, there seems to be two positions and one of them is off by maybe just a few degrees. I looked into deskew, but that seems to be needing a background of some sort to base the conversion on, these are straight captures from a video camera, so there are no backgrounds.
I'll look into the rotate command, see if it's a simple percentage off.
I'll look into the rotate command, see if it's a simple percentage off.