gpt4 book ai didi

matlab - 每个超像素上的 Gabor 滤波器

转载 作者:太空宇宙 更新时间:2023-11-03 20:32:21 25 4
gpt4 key购买 nike

我正在研究用于特征提取的超像素。我已经成功地将超像素功能应用于图像。

A = imread('kobi.png');
[L,N] = superpixels(A,5);
figure
BW = boundarymask(L);
figure;imshow(imoverlay(A,BW,'cyan'),'InitialMagnification',67)

enter image description here

现在我想从每个片段中提取纹理特征(即 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))

enter image description here如何为每个变量设置单独的变量

最佳答案

试试这个。我希望这将解决您提取每个像素的问题。我希望有人能解释一下 Gabor 的特征。

for i=1:size(Lout,1)
for j=1:size(Lout,2)
if (Lout (i,j) == 4)
Patch(i,j)=A(i,j);
end
end
end


mask = Patch > 0;
mask = bwareafilt(mask, 1);
% Invert mask and get bounding box.
props = regionprops(mask, 'BoundingBox');
% Crop image.
croppedImage = imcrop(Patch, props.BoundingBox);
figure;imshow(croppedImage)

关于matlab - 每个超像素上的 Gabor 滤波器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50264064/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com