切分Y值分量:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
A=imread('filename.tiff'); | %读取原图像 |
A=double(A)/255; | %把图像归一化 |
B=rgb2ycbcr(A); | %转换到YCbCr空间 |
[m,n]=size(C); |
|
C=B(:,:,1); | %把B值赋予C |
for i =1:m | %for循环,切分Y值 |
for j =1:n |
|
x=C(i,j); |
|
if (x<=0.3) |
|
C(i,j)=0; |
|
end |
|
if (x>0.7) |
|
C(i,j)=1; |
|
end |
|
end |
|
end | %把C值赋予B |
B(:,:,1)=C; |
|
imshow(B(:,:,1)); | %显示转换后的图像 |
title 'Y切分 | % 给图像命名 |
用户150295 2008-7-22 20:32
用户155935 2008-7-16 13:52