Is there a way to extract the 4 corners points from all the points found with detectMinEigenFeatures?
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Arseni Ivanov
am 6 Mai 2021
Bearbeitet: Arseni Ivanov
am 7 Mai 2021
I am trying to make an Augmented Reality video feature using automatic detection after designating an area using 4 points with drawpolygon. I am getting a lot of matches, and I want to make a generic solution that can find the 4 corner points for the homography as marked in red below:![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/609635/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/609635/image.png)
I have tried using max- and min-points, but this does not work for all camera angles as different directions might render the upper right corner as the minX instead of the upper left corner and so on.
edit; In particular, this breaks when seeing the checkerboard "straight on" as for example both minX goes to the same value as maxY and can occupy neighbouring detections.
0 Kommentare
Akzeptierte Antwort
Matt J
am 6 Mai 2021
If you have a binary map of the chequerboard, you can use imerode to separate the black squares and then pgonCorners
to identify the corners of each.
3 Kommentare
Matt J
am 7 Mai 2021
Something in how you displayed the results, I'm guessing. In the code below, you can see that I'm getting a very decent corner detection with your image.
load Image
corners=pgonCorners(BW,4);
imshow(BW)
hold on
plot( corners(:,2),corners(:,1),'yo','MarkerFaceColor','r','MarkerSize',15);
hold off
Weitere Antworten (1)
Gatech AE
am 6 Mai 2021
I think an interesting way might be using the convex hull of your points. Running on the assumption that you have an Nx2 array of points,
x = Pts(:,1);
y = Pts(:,2);
k = convhull(x,y);
The variable k returns the indices of the points that form the perimeter sorted in counter-clockwise order. So for the corners,
corners = Pts(k,:);
1 Kommentar
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!