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