我不知道如何做这部分最终做解码。导杆是长矩形,因此它们的条状形状可以使用形状五描述符,偏心率,长轴和短轴长度和面积来呈现。我们应该使用一个名为“solidity”的描述符,它是由凸包区域划分的区域,用于删除一些虚假匹配。不同形状描述符的正确阈值限制为表:
Eccentricity (E) E > 0.93
Area (A) A > 45
Minor axis length (Mi) 6 < Mi < 20
Major axis length (Ma) 30 < Ma < 90
Solidity (S) S > 0.19
Orienation difference (θ) 65 < |θ| < 120
Distance between centroids (D) 22 < D < 55
 它们的质心之间的距离必须足够接近,并且条的方向必须几乎垂直(几乎因为透视投影会导致失真)。找到真正的固定导杆对所需的距离和角度值限制也可以在表格中找到。固定条查找过程的示例最终结果可以在图中看到。 我应该使用bwconncomp和regionprops。
function fguide_bars=find_fguide_bars(im_pre,fguide_bars)
%FIND_FGUIDE_BARS Finds the potential pairs of fixed guide bars.
% FGUIDE_BARS=FIND_FGUIDE_BARS(IM_PRE,FGUIDE_BARS),
% where:
% -IM_PRE is preprocessed binary image, i.e. Canny edge filtered
% image which consists only of connected components that have exactly one
% hole.
% -FGUIDE_BARS is Mx2 matrix which contains M structs of fixed guide bar
% pairs. The structs contains following information of the bar pair
% candidates, 'MajorAxisLength', 'Centroid', 'Orientation', 'Extrema'
% (needed when detecting the corner points). The first column contains
% the (shorter) horizontal bars and the second (longer) vertical bars.
%% 1. Filter potential guide bar like objects from the preprocessed image
%% based on eccentricity, major/minor axis lengths, solidity and area
%% (again bwconncomp and regionprops might be useful).
[To complete]
%% 2. Iterate through all the bar like objects and find potential fixed
%% guide bar pairs based on distance between centroids and difference in
%% orientation. Store the candidates into fguide_bars matrix.
[To complete]
这应该是结果:
提前致谢!!