pull/4540/head
AlexeyAB 6 years ago
parent dbe34d7865
commit a616fcd28e
  1. 10
      src/data.c
  2. 3
      src/image_opencv.cpp

@ -380,7 +380,7 @@ int fill_truth_detection(const char *path, int num_boxes, float *truth, int clas
// if truth (box for object) is smaller than 1x1 pix
char buff[256];
if (id >= classes) {
printf("\n Wrong annotation: class_id = %d. But class_id should be [from 0 to %d] \n", id, (classes-1));
printf("\n Wrong annotation: class_id = %d. But class_id should be [from 0 to %d], file: %s \n", id, (classes-1), labelpath);
sprintf(buff, "echo %s \"Wrong annotation: class_id = %d. But class_id should be [from 0 to %d]\" >> bad_label.list", labelpath, id, (classes-1));
system(buff);
getchar();
@ -394,7 +394,7 @@ int fill_truth_detection(const char *path, int num_boxes, float *truth, int clas
continue;
}
if (x == 999999 || y == 999999) {
printf("\n Wrong annotation: x = 0, y = 0, < 0 or > 1 \n");
printf("\n Wrong annotation: x = 0, y = 0, < 0 or > 1, file: %s \n", labelpath);
sprintf(buff, "echo %s \"Wrong annotation: x = 0 or y = 0\" >> bad_label.list", labelpath);
system(buff);
++sub;
@ -402,7 +402,7 @@ int fill_truth_detection(const char *path, int num_boxes, float *truth, int clas
continue;
}
if (x <= 0 || x > 1 || y <= 0 || y > 1) {
printf("\n Wrong annotation: x = %f, y = %f \n", x, y);
printf("\n Wrong annotation: x = %f, y = %f, file: %s \n", x, y, labelpath);
sprintf(buff, "echo %s \"Wrong annotation: x = %f, y = %f\" >> bad_label.list", labelpath, x, y);
system(buff);
++sub;
@ -410,14 +410,14 @@ int fill_truth_detection(const char *path, int num_boxes, float *truth, int clas
continue;
}
if (w > 1) {
printf("\n Wrong annotation: w = %f \n", w);
printf("\n Wrong annotation: w = %f, file: %s \n", w, labelpath);
sprintf(buff, "echo %s \"Wrong annotation: w = %f\" >> bad_label.list", labelpath, w);
system(buff);
w = 1;
if (check_mistakes) getchar();
}
if (h > 1) {
printf("\n Wrong annotation: h = %f \n", h);
printf("\n Wrong annotation: h = %f, file: %s \n", h, labelpath);
sprintf(buff, "echo %s \"Wrong annotation: h = %f\" >> bad_label.list", labelpath, h);
system(buff);
h = 1;

@ -605,8 +605,9 @@ extern "C" void release_capture(cap_cv* cap)
// ----------------------------------------
extern "C" mat_cv* get_capture_frame_cv(cap_cv *cap) {
cv::Mat *mat = new cv::Mat();
cv::Mat *mat = NULL;
try {
mat = new cv::Mat();
if (cap) {
cv::VideoCapture &cpp_cap = *(cv::VideoCapture *)cap;
if (cpp_cap.isOpened())

Loading…
Cancel
Save