Matlab program to remove constant back ground

2 visualizaciones (últimos 30 días)
Jlavanya 815
Jlavanya 815 el 1 de Sept. de 2015
Comentada: Image Analyst el 1 de Sept. de 2015
Ian new to matlab.I need to remove the background to the image.i used below code but i did not get result. function [im]=RemoveBackground(I,Ib) I=imread('C:/Users/user/11.jpg'); figure(1),imshow(I) Ib=imread('C:/Users/user/10.jpg'); figure(2),imshow(Ib) % Ib=background image % I=input image % im=background removed image I1=rgb2gray(I); Ib1=rgb2gray(Ib); Id=imsubtract(Ib1,I1); Id=Id; Id=bwareaopen(Id,500,8); Id=imfill(Id,'holes'); Id=uint8(Id); [r c]=size(Id); for i=1:r for j=1:c if Id(i,j)==255 Id(i,j)=1; end end end im(:,:,1)=I(:,:,1).*Id; im(:,:,2)=I(:,:,2).*Id; im(:,:,3)=I(:,:,3).*Id;
pls help to me sir

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by