-4

私は 3D マトリックスを持っています。いくつかの不連続性を取り除き、統計的特性を変更したいと考えています。つまり、グローバル統計プロパティを変更したくありません。

解決策はありますか?

4

2 に答える 2

2

自作のアルゴリズムを使用して、次の結果が得られました。 ここに画像の説明を入力

アイデアは次のとおりです。

  • 最初に、エッジ検出を使用して不連続性を検出し、両方の方向としきい値の結果を合計します。
  • これから 2 つの画像を作成します。1 つは各方向に線があります。
  • 1D ガウス フィルターを使用して、元の画像の 2 つのローパス バージョンを作成します。1 つは各方向にフィルター処理されます。
  • また、線を含む画像をローパス フィルター処理します。線は重みとして使用されます。
  • (low-pass_line_image) .*filtered_image + (1 - low-pass_line_image) .* original_image を計算して最終的な画像を作成します。これを双方向で実行します。

コードは次のとおりです。

    % Load and treat image
    im = imread('...');
    im = im2double(im);
    im = rgb2gray(im);

    % Compute edges of the image
    bw = edge(im);

    % We want to find the positions of the strong lines in the image :
    % Since they go through the whole image, we sum among x and y directions
    % and then threshold.
    xedges = sum(bw);
    xedges = xedges > 1/3*max(xedges(:));
    yedges = sum(bw,2);
    yedges = yedges > 1/3*max(yedges(:));

    % We create images of the same size that the original one and containing
    % the horizontal and vertical lines
    [xedges, yedges] = meshgrid(xedges, yedges);

    % We create a 1D gaussian filter
    gaussian = gausswin(12);
    gaussian = gaussian / sum(gaussian);

    % We filter the image among both directions
    imfy = imfilter(im, gaussian);
    imfx = imfilter(im, gaussian');

    % We also filter the images with the lines to get the weights
    xedges = im2double(xedges);
    xedges = imfilter(xedges, gaussian');
    xedges = xedges / max(xedges(:));
    yedges = im2double(yedges);
    yedges = imfilter(yedges, gaussian);
    yedges = yedges / max(yedges(:));

    % We use the filtered versions of the images with lines as weights between
    % the original image and the filtered images
    imfinal = xedges.*imfx + (1-xedges).*im;
    imfinal = yedges.*imfy + (1-yedges).*imfinal;
    imshow(imfinal);
于 2012-12-06T20:03:12.943 に答える
0

おそらく、Efros らによって提案されたテクスチャ合成アルゴリズムを使用できます。

http://graphics.cs.cmu.edu/people/efros/research/EfrosLeung.html

于 2012-12-06T18:44:10.257 に答える