We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I un-comment following lines: static int copied_frame_id = -1; static image copy_img; if (copied_frame_id != frame_id) { copied_frame_id = frame_id; if (copy_img.data) free_image(copy_img); copy_img = copy_image(im); } image cropped_im = crop_image(copy_img, left, top, right - left, bot - top); static int img_id = 0; img_id++; char image_name[1024]; int best_class_id = selected_detections[i].best_class; sprintf(image_name, "result_img/img_%d_%d_%d_%s.jpg", frame_id, img_id, best_class_id, names[best_class_id]); save_image(cropped_im, image_name); free_image(cropped_im);
I also added following lines image c1 = crop_image(im, left, top, right-left, bot-top); save_image(c1, "99");
But I am getting no image in result_img folder for my videos but getting images when I am testing on single images. Please help me
The text was updated successfully, but these errors were encountered:
I want to know the solution too
Sorry, something went wrong.
Hi, can you try following code in file src/image_opencv.cpp, show_img is Mat pointer. Just crop desired portion out of Mat.
// you should create directory: result_img static int copied_frame_id = -1; // 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); } 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); cv::Mat copy_image = (*show_img)(rect); cv::imwrite(image_name, copy_image); // cvSetImageROI(copy_img, rect); // cvSaveImage(image_name, copy_img, 0); // cvResetImageROI(copy_img);
pull request created for the same #8197
No branches or pull requests
I un-comment following lines:
static int copied_frame_id = -1;
static image copy_img;
if (copied_frame_id != frame_id) {
copied_frame_id = frame_id;
if (copy_img.data) free_image(copy_img);
copy_img = copy_image(im);
}
image cropped_im = crop_image(copy_img, left, top, right - left, bot - top);
static int img_id = 0;
img_id++;
char image_name[1024];
int best_class_id = selected_detections[i].best_class;
sprintf(image_name, "result_img/img_%d_%d_%d_%s.jpg", frame_id, img_id, best_class_id, names[best_class_id]);
save_image(cropped_im, image_name);
free_image(cropped_im);
I also added following lines
image c1 = crop_image(im, left, top, right-left, bot-top);
save_image(c1, "99");
But I am getting no image in result_img folder for my videos but getting images when I am testing on single images. Please help me
The text was updated successfully, but these errors were encountered: