applying kmeans for ROI in Image

3 次查看(过去 30 天)
FIR
FIR 2013-1-31
I have a image below
http://imgur.com/RsRHy2V
here i have detected surf features and have draw circle over it,now i want to apply k means for that surf features inside that blue circle,please assist
for whole image i used code
cform = makecform('srgb2lab');
lab_he = applycform(I,cform);
he=I;
ab = double(lab_he(:,:,2:3));
nrows = size(ab,1);
ncols = size(ab,2);
ab = reshape(ab,nrows*ncols,2);
nColors = 3;
% repeat the clustering 3 times to avoid local minima
[cluster_idx cluster_center] = kmeans(ab,nColors,'distance','sqEuclidean', ...
'Replicates',3);
but how to apply for surffeatures inside circle
  4 个评论
Lester Lim
Lester Lim 2013-1-31
编辑:Lester Lim 2013-1-31
use roipoly, after drawing the ROI, double click it to give mask...
FIR
FIR 2013-1-31
but rioploy gives a binary image , i need to apply k means surf features

请先登录,再进行评论。

回答(1 个)

Image Analyst
Image Analyst 2013-1-31
Get a mask for each circle (say by using code from the FAQ) and then get the pixel values inside by doing:
pixelValuesInsideCircle = grayImage(circleMask);

类别

Help CenterFile Exchange 中查找有关 Point Cloud Processing 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by