Closed maelvls closed 6 years ago
Here is the interesting snippet:
[ 87945, 0.04] CMD : mesure0 0.8 square 1332.03103464142 1376.70210556847 2301.67053302719 2346.34160395425
OpenCV(3.4.1) Error: Assertion failed ((flags & FIXED_TYPE) != 0) in type, file /tmp/opencv-20180307-60086-ryy1b3/opencv-3.4.1/modules/core/src/matrix_wrap.cpp, line 807
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: OpenCV(3.4.1) /tmp/opencv-20180307-60086-ryy1b3/opencv-3.4.1/modules/core/src/matrix_wrap.cpp:807: error: (-215) (flags & FIXED_TYPE) != 0 in function type
AMC-detect.cc, lines 1264-1291:
if(sscanf(commande, "mesure0 %lf %s %lf %lf %lf %lf",
&prop, shape_name,
&xmin, &xmax, &ymin, &ymax) == 6) {
/* "mesure0" and 6 arguments: proportion, shape, xmin, xmax, ymin, ymax
return: number of black pixels and total number of pixels */
transforme(&transfo, xmin, ymin, &box[0].x, &box[0].y);
transforme(&transfo, xmax, ymin, &box[1].x, &box[1].y);
transforme(&transfo, xmax, ymax, &box[2].x, &box[2].y);
transforme(&transfo, xmin, ymax, &box[3].x, &box[3].y);
if(strcmp(shape_name,"oval") == 0) {
shape_id = SHAPE_OVAL;
} else {
shape_id = SHAPE_SQUARE;
}
/* output transformed points */
for(i = 0; i < 4; i++) {
printf("TCORNER %.3f,%.3f\n", box[i].x, box[i].y);
}
mesure_case(src, illustr, illustr_mode,
student, page, question, answer,
prop, shape_id,
xmin, xmax, ymin, ymax, &transfo_back,
box, dst, zooms_dir, view);
student = -1;
}
The error seems to come before TCORNER
is displayed, so probably in transforme()
Narrowed it to cvSaveImage
!
Ok, I issued a bug ticket to the OpenCV project: https://github.com/opencv/opencv/issues/11076 Update: for short, they do not provide support for the C API for 5 years now. We should move away from the C API in AMC I guess
Bug fixed in PR 53 (bitbucket). We simply rewrote the C calls into C++ calls.
Homebrew updated OpenCV from 3.4.0 to 3.4.1 and it apparently broke something. You will get the following error in the terminal:
There is a similar issue in https://github.com/pjreddie/darknet/issues/518.
Workaround until this is fixed in Homebrew core and in OpenCV:
At this point, I see that I still have 3.4.1_1 so I can go ahead and use it instead of 3.4.1_2:
Now it should work
Note: the issue seems to be in
AMC-analyse.cc