Skip to content

Crop Image of Bounding Boxes formed in Videos through Webcam #4721

@Pulkitg64

Description

@Pulkitg64

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions