彩色图像处理

熟悉一些彩色空间处理的基本操作:rgb图像和索引图像,彩色空间之间的转换,彩色变换和彩色空间滤波,包过彩色平滑和锐化,最后进行彩色边缘检测和rgb向量空间的图像分割。

1.从两个对称视角查看RGB彩色立方体
rgbcube(10,10,4);<span style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;">%10,10,4是默认的坐标</span>


axis on;grid on;
title('视角4');




figure,rgbcube(10,10,-4);
axis on;grid on;
title('视角-4');


%运行结果:
<img src="https://img-blog.csdn.net/20151023100121175?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /><img src="https://img-blog.csdn.net/20151023100125919?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
2.索引图像
>> imgRGB=imread('.\06\Fig0635(top_ left_flower).tif');
>> [X map]=rgb2ind(imgRGB,256);
>> imshow(X,map);
>> title('256');
运行结果如下:
<img src="https://img-blog.csdn.net/20151023100924192?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />




[Y,newmap]=imapprox(X,map,64);%64种颜色来近似一幅索引图像
figure,imshow(Y,newmap);
title('64');
%其运行结果如下:
<img src="https://img-blog.csdn.net/20151023102454450?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />


 RGB=imread('.\06\Fig0651(a)(flower_no_compression).tif');
>> imshow(RGB) 
<img src="https://img-blog.csdn.net/20151023105029777?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
>> [X1 map1]=rgb2ind(RGB,8,'nodither');
>> imshow(X1,map1);
<img src="https://img-blog.csdn.net/20151023104938973?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
<span style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;">>> [X2 map2]=rgb2ind(RGB,8,'dither');</span>
>> figure,imshow(X2,map2)
<img src="https://img-blog.csdn.net/20151023105110927?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
<span style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;">>> g=rgb2gray(RGB);</span>
<span style="font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;">>> g1=dither(g);
>> figure,imshow(g);figure,imshow(g1);</span>
<span style="font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;"><img src="https://img-blog.csdn.net/20151023105128270?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
</span>
<img src="https://img-blog.csdn.net/20151023105206734?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
3.彩色图像处理基础
包括颜色变换(彩色映射)、单独彩色平面的空间处理、颜色向量处理
4.彩色变换
问题:线性插值???样条插值???
<span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">%% spline函数的使用</span><br style="font-family: 'Courier New'; line-height: 18px;" /><span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">clc</span><br style="font-family: 'Courier New'; line-height: 18px;" /><span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">clear</span><br style="font-family: 'Courier New'; line-height: 18px;" /><span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">x=</span><span style="line-height: 18px; font-family: 'Courier New'; color: rgb(128, 0, 128);">0</span><span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">:</span><span style="line-height: 18px; font-family: 'Courier New'; color: rgb(128, 0, 128);">10</span><span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">;</span><br style="font-family: 'Courier New'; line-height: 18px;" /><span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">y=sin(x);</span><br style="font-family: 'Courier New'; line-height: 18px;" /><span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">subplot(</span><span style="line-height: 18px; font-family: 'Courier New'; color: rgb(128, 0, 128);">121</span><span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">),plot(x,y,</span><span style="line-height: 18px; font-family: 'Courier New'; color: rgb(128, 0, 0);">'</span><span style="line-height: 18px; font-family: 'Courier New'; color: rgb(128, 0, 0);">+</span><span style="line-height: 18px; font-family: 'Courier New'; color: rgb(128, 0, 0);">'</span><span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">,x,y,</span><span style="line-height: 18px; font-family: 'Courier New'; color: rgb(128, 0, 0);">'</span><span style="line-height: 18px; font-family: 'Courier New'; color: rgb(128, 0, 0);">r</span><span style="line-height: 18px; font-family: 'Courier New'; color: rgb(128, 0, 0);">'</span><span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">);%画xy图像,并标出x和y点</span><br style="font-family: 'Courier New'; line-height: 18px;" /><span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">xx=</span><span style="line-height: 18px; font-family: 'Courier New'; color: rgb(128, 0, 128);">0</span><span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">:.</span><span style="line-height: 18px; font-family: 'Courier New'; color: rgb(128, 0, 128);">25</span><span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">:</span><span style="line-height: 18px; font-family: 'Courier New'; color: rgb(128, 0, 128);">10</span><span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">;</span><br style="font-family: 'Courier New'; line-height: 18px;" /><span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">yy=spline(x,y,xx);</span><br style="font-family: 'Courier New'; line-height: 18px;" /><span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">subplot(</span><span style="line-height: 18px; font-family: 'Courier New'; color: rgb(128, 0, 128);">122</span><span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">),plot(x,y,</span><span style="line-height: 18px; font-family: 'Courier New'; color: rgb(128, 0, 0);">'</span><span style="line-height: 18px; font-family: 'Courier New'; color: rgb(128, 0, 0);">o</span><span style="line-height: 18px; font-family: 'Courier New'; color: rgb(128, 0, 0);">'</span><span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">,xx,yy,</span><span style="line-height: 18px; font-family: 'Courier New'; color: rgb(128, 0, 0);">'</span><span style="line-height: 18px; font-family: 'Courier New'; color: rgb(128, 0, 0);">b</span><span style="line-height: 18px; font-family: 'Courier New'; color: rgb(128, 0, 0);">'</span><span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">);%也是画xy图像,标出x和y点,但是这中间插值了隔.25的数,只是没被标出来(转)</span><br style="font-family: 'Courier New'; line-height: 18px;" /><span style="font-family: 'Courier New'; line-height: 18px; background-color: rgb(245, 245, 245);">%其运行结果如下:</span>
<img src="https://img-blog.csdn.net/20151023111941966?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />


>> f=imread('.\06\Fig0646(a)(lenna_original_RGB).tif');
>> g=ice('image',f);%'wait'.'off/on''space'.'hsi/cmy....'默认rgb
<img src="https://img-blog.csdn.net/20151023112707099?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值