fixed reversed box drawing in solvePNP

This commit is contained in:
Matt
2020-02-21 16:55:34 -08:00
parent 3b77f15de2
commit 5ac9569082
3 changed files with 1 additions and 5 deletions

View File

@@ -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);

View File

@@ -170,10 +170,6 @@ public class SolvePNPPipe implements Pipe<Pair<List<StandardCVPipeline.TrackedTa
// RamerDouglasPeucker 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) {