Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold856 committed Dec 13, 2024
1 parent 13fe67d commit b81107a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 1 addition & 10 deletions wpical/src/main/native/cpp/cameracalibration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,6 @@ int cameracalibration::calibrate(const std::string& input_video,
break;
}

// frame_count++;
// if (frame_count % 10 != 0)
// {
// continue;
// }

// Detect
cv::Mat frame_gray;
cv::cvtColor(frame, frame_gray, cv::COLOR_BGR2GRAY);
Expand Down Expand Up @@ -335,8 +329,6 @@ int cameracalibration::calibrate(const std::string& input_video,
cv::Mat frame;
video_capture.retrieve(frame);

cv::Mat debug_image = frame;

if (frame.empty()) {
break;
}
Expand All @@ -351,8 +343,6 @@ int cameracalibration::calibrate(const std::string& input_video,
frame_gray, boardSize, corners,
cv::CALIB_CB_ADAPTIVE_THRESH + cv::CALIB_CB_NORMALIZE_IMAGE);

cv::drawChessboardCorners(frame, boardSize, corners, found);

if (found) {
std::vector<mrcal_point3_t> current_points;
for (int i = 0; i < corners.size(); i++) {
Expand All @@ -366,6 +356,7 @@ int cameracalibration::calibrate(const std::string& input_video,
current_points.begin(), current_points.end());
}
if (show_debug_window) {
cv::drawChessboardCorners(frame, boardSize, corners, found);
cv::imshow("Checkerboard Detection", frame);
if (cv::waitKey(30) == 'q') {
break;
Expand Down
2 changes: 2 additions & 0 deletions wpical/src/main/native/cpp/fieldcalibration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ bool fieldcalibration::process_video_file(

int video_fps = video_input.get(cv::CAP_PROP_FPS);

std::cout << "Video FPS is " << video_fps << ", detection FPS is "
<< detection_fps << std::endl;
if (video_fps <= detection_fps) {
video_input.release();
if (show_debug_window) {
Expand Down

0 comments on commit b81107a

Please sign in to comment.