mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-20 00:51:41 +00:00
Merge branch 'Java' of https://gitlab.com/chameleon-vision/Chameleon-Vision into Java
This commit is contained in:
@@ -11,6 +11,9 @@ public class MemoryManager {
|
||||
this.collectionThreshold = collectionThreshold;
|
||||
}
|
||||
|
||||
public void setCollectionThreshold(int collectionThreshold) {
|
||||
this.collectionThreshold = collectionThreshold;
|
||||
}
|
||||
|
||||
public static long getUsedMemory() {
|
||||
return Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
|
||||
|
||||
@@ -88,7 +88,7 @@ public class CameraProcess implements Runnable {
|
||||
|
||||
if (FilteredContours.size() > 0) {
|
||||
for (int i = 0; i < FilteredContours.size(); i++) {
|
||||
Imgproc.drawContours(outputMat, FilteredContours, i, contourColor, 3);
|
||||
Imgproc.drawContours(outputMat, FilteredContours, i, contourColor, 10);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,12 +52,12 @@ public class VisionProcess {
|
||||
}
|
||||
|
||||
private List<MatOfPoint> FilteredContours = new ArrayList<MatOfPoint>();
|
||||
List<MatOfPoint> FilterContours(List<MatOfPoint> InputContours, List<Integer> area, List<Integer> ratio, List<Integer> extent, String SortMode, String TargetIntersection, String TargetGrouping){
|
||||
List<MatOfPoint> FilterContours(List<MatOfPoint> InputContours, List<Integer> area, List<Integer> ratio, List<Integer> extent, String SortMode, String TargetIntersection, String TargetGrouping) {
|
||||
for (MatOfPoint Contour : InputContours){
|
||||
try{
|
||||
var contourArea = Imgproc.contourArea(Contour);
|
||||
double targetArea = (contourArea / CamVals.ImageArea) * 100;
|
||||
if (targetArea >= area.get(0) || targetArea <= area.get(1)){
|
||||
if (targetArea <= area.get(0) || targetArea >= area.get(1)){
|
||||
continue;
|
||||
}
|
||||
var rect = Imgproc.minAreaRect(new MatOfPoint2f(Contour.toArray()));
|
||||
|
||||
@@ -37,7 +37,13 @@ public class Server {
|
||||
// System.out.println(SettingsManager.getInstance().GetCurrentPipeline().);
|
||||
broadcastMessage(ctx, ctx.message());
|
||||
JSONObject jsonObject = new JSONObject(ctx.message());
|
||||
String key = jsonObject.keySet().toArray()[0].toString();
|
||||
String key = null;
|
||||
try {
|
||||
key = jsonObject.keySet().toArray()[0].toString();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
if (key == null) return;
|
||||
Object value = jsonObject.get(key);
|
||||
if (!setField(SettingsManager.getInstance().GetCurrentPipeline(), key, value)) {
|
||||
//If field not in pipeline
|
||||
|
||||
Reference in New Issue
Block a user