【问题标题】:Can I get a descriptor SURF of each point of image我可以得到每个图像点的描述符 SURF
【发布时间】:2016-07-11 08:20:45
【问题描述】:

如标题所示,我希望为每个图像点获取一个 Descriptor-SURF,我不想要点的兴趣,而是图像每个点上的 SURF 描述符。 SURF 描述符使用积分图像来计算描述符

% Create Integral Image
iimg=IntegralImage_IntegralImage(img);

然后是兴趣点的提取

FastHessianData.thresh = Options.tresh;
FastHessianData.octaves = Options.octaves;
FastHessianData.init_sample = Options.init_sample;
FastHessianData.img = iimg;
ipts = FastHessian_getIpoints(FastHessianData,Options.verbose)
% Describe the interest points
if(~isempty(ipts))
    ipts = SurfDescriptor_DecribeInterestPoints(ipts,Options.upright, Options.extended, iimg, Options.verbose);
end

获取点的函数

function ipts=FastHessian_getIpoints(FastHessianData,verbose)
% filter index map

filter_map = [0,1,2,3;
    1,3,4,5;
    3,5,6,7;
    5,7,8,9;
    7,9,10,11]+1;

np=0; ipts=struct;

% Build the response map
responseMap=FastHessian_buildResponseMap(FastHessianData);

% Find the maxima acrros scale and space
for o = 1:FastHessianData.octaves
    for i = 1:2
        b = responseMap{filter_map(o,i)};
        m = responseMap{filter_map(o,i+1)};
        t = responseMap{filter_map(o,i+2)};

        % loop over middle response layer at density of the most
        % sparse layer (always top), to find maxima across scale and space
        [c,r]=ndgrid(0:t.width-1,0:t.height-1);
        r=r(:); c=c(:);

        p=find(FastHessian_isExtremum(r, c, t, m, b,FastHessianData));
        for j=1:length(p);
            ind=p(j);
            [ipts,np]=FastHessian_interpolateExtremum(r(ind), c(ind), t, m, b, ipts,np);
        end
    end
end

% Show laplacian and response maps with found interest-points
if(verbose)
    % Show the response map
    if(verbose)
        fig_h=ceil(length(responseMap)/3);
        h=figure;  set(h,'name','Laplacian');
        for i=1:length(responseMap), 
            pic=reshape(responseMap{i}.laplacian,[responseMap{i}.width responseMap{i}.height]);
            subplot(3,fig_h,i); imshow(pic,[]); hold on;
        end
        h=figure; set(h,'name','Responses');
        h_res=zeros(1,length(responseMap));
        for i=1:length(responseMap), 
            pic=reshape(responseMap{i}.responses,[responseMap{i}.width responseMap{i}.height]);
            h_res(i)=subplot(3,fig_h,i); imshow(pic,[]); hold on;
        end
    end

    % Show the maximum points
    disp(['Number of interest points found ' num2str(np)]);
    scales=zeros(1,length(responseMap));
    scaley=zeros(1,length(responseMap));
    scalex=zeros(1,length(responseMap));
    for i=1:length(responseMap)
        scales(i)=responseMap{i}.filter*(2/15);
        scalex(i)=responseMap{i}.width/size(FastHessianData.img,2);
        scaley(i)=responseMap{i}.height/size(FastHessianData.img,1);
    end
    for i=1:np
        [t,ind]=min((scales-ipts(i).scale).^2);
        plot(h_res(ind),ipts(i).y*scaley(ind)+1,ipts(i).x*scalex(ind)+1,'o','color',rand(1,3));
    end
end

如何在不做这一步检测的情况下保留所有点,然后用SURF描述符描述所有这些点。

【问题讨论】:

  • 你能更好地描述所有代码是什么以及它与问题的相关性如何?
  • SURF 包含一个关键点检测器(它检索“有趣的”关键点)和一个描述符。如果要将描述符应用于所有点,只需输入一个包含所有点的向量到描述符。

标签: image matlab surf descriptor


【解决方案1】:

在您的代码中,您清楚地将检测器和描述符功能分开:

  • FastHessian_getIpoints 返回有趣的关键点列表
  • SurfDescriptor_DecribeInterestPoints 计算给定点的 SURF 描述符。

只需摆脱您的检测器并调用提供图像中所有点作为输入的描述符函数。

所以变量ipts 将包含所有点,而不仅仅是关键点检测器返回的点

【讨论】:

  • 感谢您提供这些宝贵的信息,确实正是我想要做的,但我有一个小问题,我如何影响所有指向描述符的点,现在我仍然没有这样做,我尝试ipts = FastHessianData.img; 而不是ipts = FastHessian_getIpoints(FastHessianData,Options.verbose) 但会出现错误:Error in SurfDescriptor_DecribeInterestPoints (line 17) if (isempty(fields(ipts))), return; end. tkanks 再次为您提供帮助
  • FastHessian_getIpoints 可能会以某种与您的直接分配不一致的格式返回分数。因此,某些字段将为空。我建议运行检测器,检查返回点的格式/结构,然后按照这种格式创建我们自己的点(图像中的所有点)。
  • 正是这样,兴趣点是一个结构体,当我们找到点的x和y时,点的比例和拉普拉斯。我将 1 用于比例和 laplacien,因为它是中性元素。但要恢复 x 和 y(空间像素位置),我还没有设法拥有它们。
  • 你知道我怎样才能得到它吗??
  • 不确定,但我可以看到,在 KeyPoint 检测器函数中,您计算​​了一个 responseMap,它可能将输出映射到空间坐标。您将不得不对代码进行逆向工程。但是由于 KeyPoint Descriptor 是与图像和点一起调用的,因此它必须是恢复空间信息的一种方式。
猜你喜欢
  • 2012-04-16
  • 2012-01-09
  • 2015-06-29
  • 2016-03-16
  • 2011-06-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多