Skip to content

Commit

Permalink
fixed wrong detection when calibrating, patch to fix crash when closi…
Browse files Browse the repository at this point in the history
…ng frame windows
  • Loading branch information
GoLez28 committed Nov 22, 2023
1 parent 56a5b3a commit 130a531
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions TrackingSmoothing/Aruco.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ public static void Update(int c) {
System.Diagnostics.Stopwatch arucoThreadIdleBenchmark = new System.Diagnostics.Stopwatch();
arucoThreadWorkBenchmark.Start();
if (Program.wantToCloseWindows) {
CvInvoke.DestroyAllWindows();
CvInvoke.DestroyWindow($"Image{c}");
System.Threading.Thread.Sleep(1000);
Program.wantToCloseWindows = false;
}
bool shouldShowFrame = Program.wantToShowFrame;
Expand Down Expand Up @@ -359,7 +360,7 @@ public static void Update(int c) {
VectorOfVectorOfPointF rejected = new VectorOfVectorOfPointF(); // rejected contours

bool halfFrame = useDynamicFraming && frameCount % 6 != 0;
halfFrame |= TrackerCalibrate.startCalibrating || CameraCalibrate.startCalibrating || RoomCalibrate.getRawTrackersStep > -1;
halfFrame &= !(TrackerCalibrate.startCalibrating || CameraCalibrate.startCalibrating || RoomCalibrate.getRawTrackersStep > -1);
halfFrame &= !Tag.cameras[c].inWaitMode;
if (!halfFrame) {
ArucoInvoke.DetectMarkers(frame, ArucoDict, corners, ids, ArucoParameters, rejected);
Expand Down

0 comments on commit 130a531

Please sign in to comment.