Save 2 Overlaying Pics - Matlab
I am using the following lines of code to detect edges in a pic and then
overlay the edgse detected on the original pic :
A = 'brad.jpg';
B = im2double(imread(A, 'jpg'));
r = 0*B;
r(:,:,1) = B(:,:,1);
g = 0*B;
g(:,:,2) = B(:,:,2);
b = 0*B;
b(:,:,3) = B(:,:,3);
L = medfilt2(r(:,:,1), [3,3]);
L2 = canny_edge(L);
M = medfilt2(g(:,:,2), [3,3]);
M2 = canny_edge(M);
N = medfilt2(b(:,:,3), [3,3]);
N2 = canny_edge(N);
recover = cat(3,L,M,N);
figure, imshow(recover);
black = cat(3, zeros(size(L)),zeros(size(L)), zeros(size(L)));
hold on;
h = imshow(black);
hold off;
set(h, 'AlphaData', L2);
As u can see in the last 4 lines of code, I am overlaying the image with
detected edges onto the original pic.
I want to save this new pic(the one with edges overlaying on the original
pic). Can someone tell me how to do this ?? The overlaying pic is only
shown to me. Can someone tell me the command to save this ?? Thanks and
Regards.
No comments:
Post a Comment