Trying to find chekerboard points, not returning any points with detectCheckerboardPoints

19 views (last 30 days)
Hi all
I have a fisheye lens system through which I'm taking images. The images are highly distorted, but there are also many of these images, and I wanted to find an automated way of consistently undistorting them. I printed out a checkerboard pattern, and took multiple images of this pattern, a representative image shown.
However, when I try to use the detectCheckerboardPoints, I get no points back. I know that this algo is sensitive to noise, which I definitely have in my images, but I can't do a whole lot better with my current system, so this is what I've got. I've tried playing with HighDistortion toggle, the MinCornerMetric, which I set as low as 0.0002 and as high as 0.5, and the PartialDetections toggle, to no joy. Can anyone suggest further steps, or alternative algorithms, or a better way of doing this? Otherwise, I'll have to parse through hundreds of images and manually label the points, and that is likely to take a while.
Some of the pre-processing steps I've tried:
  1. imbinarize
  2. imerode
  3. medfilt2
  4. Combination of the three above steps in varied order

Accepted Answer

Matt J
Matt J on 20 Oct 2023
Edited: Matt J on 20 Oct 2023
You can download pgonCorners,
However, it will only find the corners of one chequerboard square at a time, so you will have to extract separate images of each black square:
load chequerboard
BW=~imfill(BW,[1,1]);
BW=bwareaopen(BW,10);
BW=imclose(BW, ones(5));
BW=imerode(BW,ones(3));
rc=fliplr(vertcat(regionprops(BW,'Centroid').Centroid));
clear V
for i=height(rc):-1:1
onesquare=bwselect(BW,rc(i,1),rc(i,2));
% imdisp(onesquare)
V{i}=fliplr(pgonCorners(onesquare,4));
end
V=vertcat(V{:});
imshow(BW,[]);hold on
scatter(V(:,1),V(:,2),'r','filled','SizeData',15); hold off
  5 Comments
Alexander Dumont
Alexander Dumont on 20 Oct 2023
I think I'm at a point where I can figure out the rest. Thank you for all the help, it saved me days of hassle.

Sign in to comment.

More Answers (0)

Categories

Find more on Convert Image Type in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!