Image Alignment when images are of different perspectives

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
jefike
Posts: 1
Joined: 2016-06-21T09:11:21-07:00
Authentication code: 1151

Image Alignment when images are of different perspectives

Post by jefike »

Hello,

I currently have an array of four cameras in an apparatus that points all four cameras at an image projected via a lens onto a single plane. The goal is to get a higher framerate video by interleaving frames from all four cameras, which each being slightly out of sync with the other. Since these cameras are positioned at different angles from the plane, there is a perspective difference for each. I would like to know if there is a clever way to do the perspective corrections with image magick.

As examples here (dropbox link) are three images each from a different camera in the array:
https://www.dropbox.com/sh/5cw7veg6iyh0 ... Iftza?dl=0
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Image Alignment when images are of different perspectives

Post by snibgo »

Two of your images are smaller than the third.

Anyhow, the job is easy. Pick four features that you can see on each image, ideally near the corners. Choose one image as the master, and distort the others to match:

Code: Select all

convert in.ppm -distort Perspective "XX" out.png
... where XX is 16 numbers. See http://www.imagemagick.org/script/comma ... hp#distort
snibgo's IM pages: im.snibgo.com
Post Reply