如何在matlab上删除图像的阴影? [英] How to remove shadow of image on matlab?

查看:1672
本文介绍了如何在matlab上删除图像的阴影?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如你在图像中看到的那样,我使用Otsu方法隔离对象,但是阴影会使结果变得无效。如何隔离没有阴影的物体?

As you can see in image, I isolate objects using Otsu method, but shadows make the result innacurate. How to isolate object without shadow?

推荐答案

I = imread('YgmAf.jpg');  % your original image
imagesc(I)

I=rgb2hsv(I);
I1=I(:,:,2);   % change to hsv and select the channel with most clear contrast between object and shadow

thresholded = I1 > 0.23; %% Threshold to isolate lungs
thresholded = bwareaopen(thresholded,100);  % remove too small pixels
I2=thresholded.*I1;
I3=edge(I2,'canny',graythresh(I2));  % ostu method
I3 = imfill(I3,'hole');
figure,imagesc(I3)  %object binary image

结果图片:

Result image:

这篇关于如何在matlab上删除图像的阴影?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆