How to fuse IR sensor Image with Visible Camera Image using MATLAB without Toolboxes?
3 views (last 30 days)
Show older comments
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;
- First Manipulate the visible image until it match the IR image (in size, filed of view and resolution)
- 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,[]);
0 Comments
Answers (1)
Image Analyst
on 10 Dec 2020
Edited: Image Analyst
on 10 Dec 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 Comments
See Also
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!