Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes to crop detections in video #8197

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/image_opencv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -997,20 +997,22 @@ extern "C" void draw_detections_cv_v3(mat_cv* mat, detection *dets, int num, flo

// you should create directory: result_img
//static int copied_frame_id = -1;
//static IplImage* copy_img = NULL;
// //static IplImage* copy_img = NULL;
//if (copied_frame_id != frame_id) {
// copied_frame_id = frame_id;
// if(copy_img == NULL) copy_img = cvCreateImage(cvSize(show_img->width, show_img->height), show_img->depth, show_img->nChannels);
// cvCopy(show_img, copy_img, 0);
// // if(copy_img == NULL) copy_img = cvCreateImage(cvSize(show_img->width, show_img->height), show_img->depth, show_img->nChannels);
// // cvCopy(show_img, copy_img, 0);
//}
//static int img_id = 0;
//img_id++;
//char image_name[1024];
//sprintf(image_name, "result_img/img_%d_%d_%d_%s.jpg", frame_id, img_id, class_id, names[class_id]);
//CvRect rect = cvRect(pt1.x, pt1.y, pt2.x - pt1.x, pt2.y - pt1.y);
//cvSetImageROI(copy_img, rect);
//cvSaveImage(image_name, copy_img, 0);
//cvResetImageROI(copy_img);
//// cvSetImageROI(copy_img, rect);
//// cvSaveImage(image_name, copy_img, 0);
//// cvResetImageROI(copy_img);
//cv::Mat copy_image = (*show_img)(rect);
//cv::imwrite(image_name, copy_image);

cv::rectangle(*show_img, pt1, pt2, color, width, 8, 0);
if (ext_output)
Expand Down