6

形状コンテキスト ヒストグラムを機能記述子として使用して、シルエット画像をエンコードしています。デバッグを支援するために、形状コンテキストの対数極ビンをシルエット画像 (エッジ画像から取得したサンプル ポイント) に重ねて表示したいと考えています。

ポイントの 1 つがどのように表示されるかの例を次に示します。オーバーレイされたシェイプ コンテキストの logpolar ビン

円 (放射状のビン) を表示する方法は知っていますが、角度のあるビン (線) を作成するのが困難です。

一連の角度が与えられた場合、サンプル画像に示されているような線分をどのように描くことができますか?

4

2 に答える 2

4

この機能を使用できます:

function scDrawPolar(samp,point,r_min,r_max,nbins_theta,nbins_r)
%SCDRAWPOLAR draw a polar on the center point
%   point           - the center point
%   r_min           - min radius
%   r_max           - max radius
%   nbins_theta     - theta divide
%   nbins_r         - r divide
%   fig_handle      - draw the diagram on which figure
gca;
hold on;

plot(samp(1,:)',samp(2,:)','r.');
plot(point(1),point(2),'ko');

r_bin_edges=logspace(log10(r_min),log10(r_max),nbins_r);

% draw circles
th = 0 : pi / 50 : 2 * pi;
xunit = cos(th);
yunit = sin(th);
for i=1:length(r_bin_edges)
    line(xunit * r_bin_edges(i) + point(1), ...
                    yunit * r_bin_edges(i) + point(2), ...
        'LineStyle', ':', 'Color', 'k', 'LineWidth', 1);
end

% draw spokes
th = (1:nbins_theta) * 2*pi / nbins_theta;
cs = [cos(th);zeros(1,size(th,2))];
sn = [sin(th);zeros(1,size(th,2))];
line(r_max*cs + point(1), r_max*sn + point(2),'LineStyle', ':', ...
    'Color', 'k', 'LineWidth', 1);

axis equal;
axis off;
hold off;
end

ここで結果を参照してください。

フィギュアのスクリーンショット

于 2011-05-04T02:01:32.467 に答える
3

これを行う:

>>図
>>軸
>>ちょっと待って
>> 半径 = 1;
>> シータ = 0:30:360;
>> 角度 = シータの場合
line([0 半径 * cosd(角度)], [0 半径 * sind(角度)]);
終わり

これを生成します:

ここに画像の説明を入力

于 2011-03-10T11:09:32.263 に答える