资源简介
包含Markéta Dubská的两篇paper:《Real Projective Plane Mapping for Detection of Orthogonal Vanishing Points》《PClines – Line Detection Using Parallel Coordinates》以及matlab测试代码
代码片段和文件信息
function [Result] = diamond_vanish(InputImg Normalization SpaceSize PatchSize VanishNumber)
% Detection of vanishing point using diamond space.
%
% Results = DIAMOND_VANISH(InputImg Normalization SpaceSize PatchSize)
%
% Input:
% InputImg input image
% Normalization float number;
% normalization of the image (1 means normalization form -1 to 1)
% SpaceSize int number;
% resolution of the accumulation space (final space has dims SpaceSize x SpaceSize)
% PatchSize int row vector;
% radius of a patch from which edge pixels are extracted and use for ellipse fitting for detection of orientation of the edge point
%
% Output:
% Results structure with fields:
% Results.Space accumulated diamond space (further is used for orthogonalization)
% Results.PC_VanP positions of the maxima in R.Space
% Results.PC_VanP_Norm normalized position of the maxima (R.Space bounded from -1 to 1)
% Results.CC_VanP position of the vanishing point in the input image coordinates
%find edge points
EdgeImg = edge(rgb2gray(InputImg)‘canny‘);
%find lines
LinesData = mx_lines(int32(padarray(EdgeImg[PatchSize(end)PatchSize(end)])) int32(PatchSize));
LinesData(3:) = LinesData(3:)*Normalization;
SubPixelRadius = 2;
Threshold = 0.05;
Result = struct(‘Space‘ [] ‘PC_VanP‘[] ‘PC_VanP_Norm‘ [] ‘CC_VanP‘ []);
%diamond stuff
for V = 1:VanishNumber
%raster and find space
space = mx_raster_space(SpaceSize LinesData);
%figure
%imagesc(space);
Result.PC_VanP(V:) = find_maximum(space SubPixelRadius);
if(V == 1) Result.Space = space; end
%normalize result
Result.PC_VanP_Norm(V:) = normalize_PC_points(Result.PC_VanP(V:) SpaceSize);
%get lines close to VP
Distance = point_to_lines_dist(Result.PC_VanP_Norm(V:) LinesData(1:3:)‘);
%remove lines
LinesData(:(Distance < Threshold)‘) = [];
end
Result.CC_VanP = PC_point_to_CC(Normalization Result.PC_VanP_Norm size(InputImg));
end
function NormVP = normalize_PC_points(VanP SpaceSize)
NormVP = (2.*VanP -(SpaceSize + 1))./(SpaceSize - 1);
end
function D = point_to_lines_dist(Point Lines)
x = Point(1);
y = Point(2);
T = [0-11;1-10;0-10;...
0-11;110 ;0-10;...
011 ;1-10;0-10;...
011 ;110 ;0-10];
L = Lines*T‘;
P(:1) = (L(:1:3)*[xy1]‘)./sqrt(sum(L(:1:2).^22));
P(:2) = (L(:4:6)*[xy1]‘)./sqrt(sum(L(:4:5).^22));
P(:3) = (L(:7:9)*[xy1]‘)./sqrt(sum(L(:7:8).^22));
P(:4) = (L(:10:12)*[xy1]‘)./sqrt(sum(L(:10:11).^22));
D = min(abs(P)[]2);
end
function [VanPC] = find_maximum(Space R)
[r c] = find(max(Space(:)) == Space);
S = padarray(double(Space)[RR]);
O = S(r(1):r(1)+R*2 c(1):c(1)+
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-11-27 18:04 Markéta Dubská_VanishingPoints\
文件 182484 2016-10-24 16:06 Markéta Dubská_VanishingPoints\2011-CVPR-Dubska-PClines.pdf
文件 1904410 2016-10-23 16:00 Markéta Dubská_VanishingPoints\2013-BMVC-Dubska-VanishingPointsDetection.pdf
目录 0 2016-11-27 18:05 Markéta Dubská_VanishingPoints\code\
目录 0 2016-11-27 18:05 Markéta Dubská_VanishingPoints\code\2013-BMVC-Dubska-results\
文件 13732 2013-07-16 15:01 Markéta Dubská_VanishingPoints\code\2013-BMVC-Dubska-results\diamond_space_results.mat
文件 377 2013-07-17 10:58 Markéta Dubská_VanishingPoints\code\2013-BMVC-Dubska-results\readme.txt
目录 0 2016-11-27 18:05 Markéta Dubská_VanishingPoints\code\2013-BMVC-Dubska-source\
文件 3875 2013-07-18 13:34 Markéta Dubská_VanishingPoints\code\2013-BMVC-Dubska-source\diamond_vanish.m
文件 7723 2013-07-17 14:31 Markéta Dubská_VanishingPoints\code\2013-BMVC-Dubska-source\mx_lines.cpp
文件 4276 2013-07-11 15:09 Markéta Dubská_VanishingPoints\code\2013-BMVC-Dubska-source\mx_raster_space.cpp
文件 1992 2013-07-18 11:36 Markéta Dubská_VanishingPoints\code\2013-BMVC-Dubska-source\readme.txt
文件 4967 2013-07-18 13:34 Markéta Dubská_VanishingPoints\code\2013-BMVC-Dubska-source\run_on_dataset.m
- 上一篇:bbocomplex 生物地理学算法
- 下一篇:ICP_matlab
评论
共有 条评论