mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-23 01:21:40 +00:00
fixed reversed box drawing in solvePNP
This commit is contained in:
@@ -34,7 +34,7 @@ public class DrawSolvePNPPipe implements Pipe<Pair<Mat, List<StandardCVPipeline.
|
||||
private void setBox(MatOfPoint3f mat) {
|
||||
boxCornerMat.release();
|
||||
var list = mat.toList();
|
||||
var auxList = list.stream().map(it -> new Point3(it.x, it.y, it.z - 6)).collect(Collectors.toList());
|
||||
var auxList = list.stream().map(it -> new Point3(it.x, it.y, it.z + 6)).collect(Collectors.toList());
|
||||
var finalList = new ArrayList<>(list);
|
||||
finalList.addAll(auxList);
|
||||
boxCornerMat.fromList(finalList);
|
||||
|
||||
@@ -170,10 +170,6 @@ public class SolvePNPPipe implements Pipe<Pair<List<StandardCVPipeline.TrackedTa
|
||||
// Ramer–Douglas–Peucker algorithm
|
||||
Imgproc.approxPolyDP(target.rawContour, polyOutput, 0.01 * peri, true);
|
||||
|
||||
// if(polyOutput.toList().size() != 8) {
|
||||
// return null;
|
||||
// }
|
||||
|
||||
var area = Imgproc.moments(polyOutput);
|
||||
|
||||
if (area.get_m00() < 200) {
|
||||
|
||||
Reference in New Issue
Block a user