我正在研究超像素以进行特征提取。我已经成功地将超像素功能应用于图像。
A = imread('kobi.png');
[L,N] = superpixels(A,5);
figure
BW = boundarymask(L);
figure;imshow(imoverlay(A,BW,'cyan'),'InitialMagnification',67)
现在我想从每个片段中提取纹理特征(即 Gabor 特征)。任何人请帮我解释如何在每个超像素上应用 Gabor 功能?
更新:
idx=label2idx(L);
meanColor = zeros(N,3);
[m,n] = size(L);
for i = 1:N
meanColor(i,1) = mean(A(idx{i}));
meanColor(i,2) = mean(A(idx{i}+m*n));
meanColor(i,3) = mean(A(idx{i}+2*m*n));
end
numColors = 6;
[pidx,cmap] = kmeans(meanColor,numColors,'replicates',2);
cmap = lab2rgb(cmap);
Lout = zeros(size(A,1),size(A,2));
for i = 1:N
Lout(idx{i}) = pidx(i);
end
imshow(label2rgb(Lout))