function [row,col] = WP_corner_in_data(planes)
%

K = 3;

row = 0;
col = 0;

num_planes = max(planes(:));
if num_planes<3
    return
end
count = zeros(num_planes,1);
[num_rows,num_cols] = size(planes);
for r = K+1:num_rows-K
    for c = K+1:num_cols-K
        W = planes(r-K:r+K,c-K:c+K);
        Wh = hist(W(:),num_planes);
        indexes = find(Wh>8);
        if length(indexes)>2
            row = r;
            col = c;
            return
        end
    end
end
%            C = combnk(indexes,3);
%            num_combs = length(C(:,1));
%            for comb = 1:num_combs
%                p1 = C(comb,1);
%                p2 = C(comb,2);
%                p3 = C(comb,3);
                