[英]How to find the maximum of opening in all orientations at a point in an image?
I need a bit of help. 我需要一点帮助。 I am trying to segment out sort of zig-zag patterns in an image.
我正在尝试将图像中的锯齿形图案进行细分。 I've an algorithm for this.
我有一个算法。 For that I'm opening the image with a line structuring element.
为此,我使用线结构元素打开图像。 I want to perform repeated opening of the image using the line strel at various angles and find maximum of them at each pixel.
我想使用各种角度的线条来重复打开图像,并在每个像素处找到它们的最大值。
Following is a code snippet: 以下是代码段:
while(i<360)
se=strel('line',17,i);
i=i+15;
img=imopen(img,se);
end;
Any help with the implementation will be appreciated. 实施方面的任何帮助将不胜感激。
From what I understand, you want to get maximum for each pixel from a stack of "opened" images? 据我了解,您想从一堆“打开的”图像中获得每个像素的最大值?
% I assume the img is a 2D image (e.g. gray-scale one)
stack = [];
while(i<360)
se=strel('line',17,i);
i=i+15;
stack(:,:, end+1) =imopen(img,se);
end;
The opened images will stack up in the stack matrix. 打开的图像将堆叠在堆叠矩阵中。 Then to find maximum at each pixel, you can just search for maximum in 3th dimension:
然后,要在每个像素处找到最大值,您可以在第三维中搜索最大值:
max_pixels = max(stack, 3);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.