mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-20 00:51:41 +00:00
Area slider adjustments, add NT for local testing
This commit is contained in:
@@ -4,6 +4,7 @@ import com.chameleonvision.settings.SettingsManager;
|
||||
import com.chameleonvision.vision.camera.CameraManager;
|
||||
import com.chameleonvision.vision.process.VisionProcess;
|
||||
import com.chameleonvision.web.Server;
|
||||
import edu.wpi.first.networktables.NetworkTableInstance;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
@@ -12,6 +13,8 @@ public class Main {
|
||||
for (var camSet : CameraManager.getAllCamerasByName().entrySet()) {
|
||||
new Thread(new VisionProcess(camSet.getValue())).start();
|
||||
}
|
||||
NetworkTableInstance.getDefault().startClient("localhost");
|
||||
|
||||
// NetworkTableInstance.getDefault().startClientTeam(SettingsManager.GeneralSettings.team_number);
|
||||
Server.main(8888);
|
||||
} else {
|
||||
|
||||
@@ -58,8 +58,8 @@ public class CVProcess {
|
||||
try {
|
||||
double contourArea = Imgproc.contourArea(Contour); //TODO change scaling
|
||||
double targetArea = (contourArea / CamVals.ImageArea) * 100;
|
||||
double minArea = Math.pow(area.get(0), 4);
|
||||
double maxArea = Math.pow(area.get(1), 4);
|
||||
double minArea = (double) area.get(0) / 100;
|
||||
double maxArea = (double) area.get(1) / 100;
|
||||
if (targetArea < minArea || targetArea > maxArea) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user