How to fuse IR sensor Image with Visible Camera Image using MATLAB without Toolboxes?

So we have 2 images, One is IR Sensor image and the other is visible camera image with differnt size. I am not allowed to use any of Matlab toolboxes for fusing images
So what I seek is the output image of same size , filed of view and resolution as of IR image but with some features such as edges etc. added from visible image.
These are steps;
  1. First Manipulate the visible image until it match the IR image (in size, filed of view and resolution)
  2. Then extract features from manipulated visible image and combine it with features of IR image to output one single image with featurs of visible image but size and resoultion of IR image.
In my code i am resizing visible image manualy using imrize becuase I checked IR image was of 240x320 of size so i resized Visible image to this size manually.
I am attaching my code that i have written I am not sure if its perfect or not. Also attaching .mat file containg both IR image and Visible image saved
clc;
clear all;
close all;
%Load images from .mat file
load('proj_IR.mat', 'IR')
load('proj_IR.mat', 'visible')
I1=IR
img= visible
%Resize visible image to size of IR image
I2 = imresize(img,[240 320]);
imshow(IR)
tic
N=3;
Med1= medfilt2(I1, [N N]);
M=35;
h=1/(M*M)*ones(M);
b1=imfilter(double(I1),double(h),'circular');
d1=double(I1)-b1;
S1=(b1-double(Med1)).^2;
Med2= medfilt2(I2, [N N]);
b2=imfilter(double(I2),double(h),'circular');
d2=double(I2)-b2;
S2=(b2-double(Med2)).^2;
w1=S1./(S1+S2);
w2=S2./(S1+S2);
F1=double(w1).*double(d1)+double(w2).*double(d2);
F2=0.5*b1+0.5*b2;
FF=double(F1)+F2;
toc
figure, imshow(I1, []);
figure, imshow(I2, []);
figure, imshow(S1, []);
figure, imshow(S2,[]);
figure, imshow(w1, []);
figure, imshow(w2, []);
figure, imshow(F1,[]);
figure, imshow(F2,[]);
figure, imshow(FF, []);
FF=uint8(FF);
figure,imshow(FF,[]);

Réponses (1)

Image Analyst
Image Analyst le 10 Déc 2020
Modifié(e) : Image Analyst le 10 Déc 2020
You didn't resize the image or register it. What I'd try first is threshold each image to try to find the circles in each image. Then knowing the centers and diameter, paste (see attached demos) the smaller IR image onto a black canvass that is the same size as the visible light image. Then add the two together or put each into one color channel with imfuse().

4 commentaires

Is it using toolboxes ?
Main aim is to do the job without toolboxes
I am also attaching the files for tips we got
Our main aim is to take some features of visible image and fuse it with IR image to get output image.
No. The method I'm thinking of involves only using < or > to do thresholding, then find() to find the circle coordinates, and mean() to find the center of the circle. Those don't require any toolboxes, just built-in functions.
mask = irImage < someValue;
[r, c] = find(mask);
xCenter = round(mean(c));
yCenter = round(mean(r));
xIRDiameter = max(c) - min(c);
yIRDiameter = max(r) - min(r);
row1 = round(xCenter - xIRDiameter/2);
col1 = round(xCenter - xIRDiameter/2);
row2 = row1 + yIRDiameter;
col2 = col1 + xIRDiameter;
subImage = irImage(row1:row2, col1:col2)
and so on for the visible light image. Then just paste the IR subimage onto a canvass of all zeros:
bigIR = zeros(size(visibleImage), 'uint8');
but you can't just paste it using the other coordinates, you have to adjust the coordinates to put the center where the center of the clock in the visible light image is. Plus you also have to resize it
subImage = imresize(subImage, [xVisibleDiameter, yVisibleDiameter]);
And when you paste that resized image you have to compute an upper left corner that is the same as the upper left corner for the clock block in the visible light image.
By the way you would not make measurements on an image that is a weighted sum of the IR and visible light image. It just doesn't make sense. I mean they don't even have the same units. The visible light image has units of gray levels while the IR image has units of temperature in degrees Celsius. What you could do is to use the visible light image to identify objects and produce a mask, then go to the IR image to measure the temperature within that mask.
Thanks for anwer.
But the main aim is to fuse the images overall but not related to find the center of circle and combining image.
We have to fuse IR image and Visible image.
We have to take size and resolution of IR image and some of the features of visible image to make new output image
Yep, my code should do that. Did you try it?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Display Image dans Centre d'aide et File Exchange

Produits

Version

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by