how to improve the accuracy of segmentation and why aren't we using the y component for segmentation here and how we get those values of 145 add 165 and 195!! please some help me soon...
이전 댓글 표시
clc;
clear all;
I=imread('1.jpg');
I=double(I);
[hue,s,v]=rgb2hsv(I);
Y = 0.257 * I(:,:,1) +0.504* I(:,:,2) + 0.098 * I(:,:,3) + 16 ;
cb = 0.148* I(:,:,1) - 0.291* I(:,:,2) + 0.439 * I(:,:,3) + 128;
cr = 0.439 * I(:,:,1) - 0.368 * I(:,:,2) -0.071 * I(:,:,3) + 128;
[w h]=size(I(:,:,1));
for i=1:w
for j=1:h
if 140<=cr(i,j) && cr(i,j)<=165 && 140<=cb(i,j) && cb(i,j)<=195 && 0.01<=hue(i,j) && hue(i,j)<=0.1
segment(i,j)=1;
else
segment(i,j)=0;
end
end
end
% imshow(segment);
im(:,:,1)=I(:,:,1).*segment;
im(:,:,2)=I(:,:,2).*segment;
im(:,:,3)=I(:,:,3).*segment;
figure,imshow(uint8(im));ti
댓글 수: 2
Nitin
2014년 2월 22일
It would help if you could upload a pic of the image you are trying to perform segmentation on.
kishan nagesh
2014년 2월 28일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Image Segmentation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
