How to add two images

조회 수: 2 (최근 30일)
nkumar
nkumar 2013년 3월 18일
I want to add two images,such that the crack portion,is hided ,kindly help
clc
clear all
close all
gauss = fspecial ('gaussian' , [ 5 5 ] ) ; % Ga u s s i a n Blur F i l t e r
% I=double(imread('crack1.png'))./255 ;
I=imread('crack1.png');
I=rgb2gray(I);a=I;
I1= imfilter(I,gauss ) ;
s=strel('square',3);
h=imsubtract(imclose(a,s),a);
% IMG=double(imresize(h,[256 256]));
IMG=h;
imshow(h),figure,imshow(a)
level = graythresh(IMG);
BW = im2bw(IMG,level);
imshow(BW)
figure,imshow(BW)
SE = [strel('line' , 3 , 0)
strel('line',3,45)
strel('line',3,90)
strel('line',3,135)] ;
ERED = BW-imerode ( BW ,s ) ;
figure,imshow(ERED)
BW2 = bwareaopen(ERED,100);
figure,imshow(BW2)
bw2 = imcomplement(BW2);
image2 = int8(bw2).*200;
figure,imshow(image2)
image3=imcomplement(image2);
figure,imshow(image3)
B=imdilate(image3,SE);
figure,imshow(B)
I want to add B and original imaghe a,such that the crack portion is filled,plz help
  댓글 수: 1
nkumar
nkumar 2013년 3월 18일
my image is http://imgur.com/qNWwyWH,2bmFCxb,yes i want to add B and original image,when added the image clarity gets disturbed,i have uploaded image and output image also

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2013년 3월 18일
Where did you upload your images? So I can't see what you're seeing.
If you don't cast to double or 16 bit, your images will clip if their sum would be greater than 255. But I just see a bunch of morphology code, not code to add images.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by