function corners = WP_corner_in_data_WP(WP_set)
%

MAX_DIST = 0.2;

corners = [];

num_Wps = length(WP_set);

if num_Wps<3
    return
end

C = combnk([1:num_Wps],3);
num_combs = length(C(:,1));
for c = 1:num_combs
    params1 = WP_set(C(c,1)).info;
    params2 = WP_set(C(c,2)).info;
    params3 = WP_set(C(c,3)).info;
    pts1 = WP_find3pts(params1(1),params1(2),params1(3),params1(4));
    pts2 = WP_find3pts(params2(1),params2(2),params2(3),params2(4));
    pts3 = WP_find3pts(params3(1),params3(2),params3(3),params3(4));
    [li12,ls12] = cv_int_plane_plane(pts1,pts2,0.01);
    [li13,ls13] = cv_int_plane_plane(pts1,pts3,0.01);
    [li23,ls23] = cv_int_plane_plane(pts2,pts3,0.01);
    [pi12,ps12] = cv_int_line_line(li12,li13,0.01);
    [pi13,ps13] = cv_int_line_line(li12,li23,0.01);
    [pi23,ps23] = cv_int_line_line(li13,li23,0.01);
    if norm(pi12-pi13)<MAX_DIST&norm(pi13-pi23)<MAX_DIST
        corners = [corners;C(c,:),max(norm(pi12-pi13),norm(pi13-pi23)),...
            pi12];
    end
end
