Subimage search: overlay a thermal with a visible image
Posted: 2013-05-01T09:37:08-07:00
I use a thermal image camera that makes simultaneously a real and a thermal image
I get three images:
- real image (rgb 2048x1536)
- thermal image (grayscale 160x120 Pixel)
- a color lookup table
In the next step I want to overlay the pattern of the real image with the color information of the thermal image.
I know the fixed ratio between real and thermal image, but axis between real and thermal image a not parallel.
(camera has two sensors and optics, it’s not a SLR camera)
Depending on distance to object there is a offset from center between “geometry -2+7” (infinite) and „geometry -42+81” (near 20cm).
Both extreme points can be connected with a straight line.
Here is a sample:
the visible image (precise resized for overlay to 339x254px)
8 bit grayscale thermal image (sensor size is only 160x120px)
and the 256 color lookup table (ad libitum, this is iron)
With known offset I can simple overlay the images (here is geometry -7+12 ):
and I get this result (Overlay Image)
I tried to find the "geometry +x+y" with compare -subimage-search …
and tested variants of -metric and -dissimilarity-threshold
but with no success.
Is there a possibility to convert the real image and thermal image (i.e. edge detect), so that subimage-search can find a position?
Since the offset run along at a straight line, not all positions must be test trough subimage-search. I can also imagine to test all points at the straight line with a shell script. But I dont find a good compare/metric...
Thanks for help.
I get three images:
- real image (rgb 2048x1536)
- thermal image (grayscale 160x120 Pixel)
- a color lookup table
In the next step I want to overlay the pattern of the real image with the color information of the thermal image.
I know the fixed ratio between real and thermal image, but axis between real and thermal image a not parallel.
(camera has two sensors and optics, it’s not a SLR camera)
Depending on distance to object there is a offset from center between “geometry -2+7” (infinite) and „geometry -42+81” (near 20cm).
Both extreme points can be connected with a straight line.
Here is a sample:
the visible image (precise resized for overlay to 339x254px)
8 bit grayscale thermal image (sensor size is only 160x120px)
and the 256 color lookup table (ad libitum, this is iron)
With known offset I can simple overlay the images (here is geometry -7+12 ):
Code: Select all
convert real.jpg -shade 45x30 -auto-level \( thermal.png clut.png -clut \) -gravity Center -geometry -7+12 -compose Overlay -composite overlay.jpg
I tried to find the "geometry +x+y" with compare -subimage-search …
and tested variants of -metric and -dissimilarity-threshold
but with no success.
Code: Select all
compare: images too dissimilar
Since the offset run along at a straight line, not all positions must be test trough subimage-search. I can also imagine to test all points at the straight line with a shell script. But I dont find a good compare/metric...
Thanks for help.