mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-22 01:11:40 +00:00
Revert "Merge branch 'speckle-rejection' into 'ui-integration'"
This reverts merge request !21
This commit is contained in:
@@ -24,7 +24,6 @@ public class CVProcess {
|
||||
private Mat binaryMat = new Mat();
|
||||
private List<MatOfPoint> filteredContours = new ArrayList<>();
|
||||
private Comparator<RotatedRect> sortByCentermostComparator = Comparator.comparingDouble(this::calcDistance);
|
||||
private List<MatOfPoint> speckleRejectedContours = new ArrayList<>();
|
||||
private Comparator<MatOfPoint> sortByMomentsX = Comparator.comparingDouble(this::calcMomentsX);
|
||||
private List<RotatedRect> finalCountours = new ArrayList<>();
|
||||
private MatOfPoint2f intersectMatA = new MatOfPoint2f();
|
||||
@@ -87,20 +86,6 @@ public class CVProcess {
|
||||
return filteredContours;
|
||||
}
|
||||
|
||||
List<MatOfPoint> rejectSpeckles(List<MatOfPoint> inputContours, Double minimumPercentOfAverage) {
|
||||
double averageArea = 0.0;
|
||||
for(MatOfPoint c : inputContours) {
|
||||
averageArea += Imgproc.contourArea(c);
|
||||
}
|
||||
averageArea /= inputContours.size();
|
||||
var minimumAllowableArea = minimumPercentOfAverage / 100.0 * averageArea;
|
||||
speckleRejectedContours.clear();
|
||||
for(MatOfPoint c : inputContours) {
|
||||
if(Imgproc.contourArea(c) >= minimumAllowableArea) speckleRejectedContours.add(c);
|
||||
}
|
||||
return speckleRejectedContours;
|
||||
}
|
||||
|
||||
private double calcDistance(RotatedRect rect) {
|
||||
return FastMath.sqrt(FastMath.pow(cameraValues.CenterX - rect.center.x, 2) + FastMath.pow(cameraValues.CenterY - rect.center.y, 2));
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.chameleonvision.vision.process;
|
||||
|
||||
import org.opencv.core.RotatedRect;
|
||||
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
public class PipelineResult {
|
||||
public boolean IsValid = false;
|
||||
public double CalibratedX = 0.0;
|
||||
|
||||
Reference in New Issue
Block a user