-
大小: 2.31M文件類型: .rar金幣: 1下載: 0 次發布日期: 2021-02-02
- 語言: Matlab
- 標簽: 實例分割??Lab分割??lab??segmentation??color??matlab??imageSegment??
資源簡介
matlab圖像分割實例,基于Lab空間的色彩分,割調用庫函數實現,帶注釋,簡單易懂;
代碼片段和文件信息
fabric?=?imread(‘fabric.png‘);%讀取圖像
figure;?subplot(121);?imshow(fabric)?%顯示
title(‘fabric‘);
load?regioncoordinates;%下載顏色區域坐標到工作空間
nColors?=?6;
sample_regions?=?false([size(fabric1)?size(fabric2)?nColors]);
for?count?=?1:nColors
??sample_regions(::count)?=?roipoly(fabric...
??region_coordinates(:1count)?...
??region_coordinates(:2count));%選擇每一小塊顏色的樣本區域
end
subplot(122)
imshow(sample_regions(::2));%顯示紅色區域的樣本
title(‘sample?region?for?red‘);
cform?=?makecform(‘srgb2lab‘);%rgb空間轉換成L*a*b*空間結構
lab_fabric?=?applycform(fabriccform);%rgb空間轉換成L*a*b*空間
a?=?lab_fabric(::2);?b?=?lab_fabric(::3);
color_markers?=?repmat(0?[nColors?2]);%初始化顏色均值
for?count?=?1:nColors
color_markers(count1)=?mean2(a(sample_regions(::count)));%a均值
color_markers(count2)=?mean2(b(sa
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2556??2009-03-09?09:06??基于Lab空間的色彩分割\ex_17_1.m
?????文件??????35582??2004-08-09?21:41??基于Lab空間的色彩分割\用到的圖像\bag.png
?????文件??????31028??2001-02-21?12:34??基于Lab空間的色彩分割\用到的圖像\cell.tif
?????文件?????626535??2003-05-03?13:53??基于Lab空間的色彩分割\用到的圖像\fabric.png
?????文件?????131633??2003-05-03?13:53??基于Lab空間的色彩分割\用到的圖像\hestain.png
?????文件????1835136??2000-12-04?13:58??基于Lab空間的色彩分割\用到的圖像\paris.lan
?????文件?????287677??2002-12-16?06:10??基于Lab空間的色彩分割\用到的圖像\peppers.png
????..A.SH.?????24064??2010-06-07?00:01??基于Lab空間的色彩分割\用到的圖像\Thumbs.db
?????文件?????208896??2007-08-20?12:34??基于Lab空間的色彩分割\用到的圖像\traffic.avi
?????目錄??????????0??2010-06-23?17:05??基于Lab空間的色彩分割\用到的圖像
?????目錄??????????0??2010-06-23?17:05??基于Lab空間的色彩分割
-----------?---------??----------?-----??----
??????????????3183107????????????????????11
評論
共有 條評論