diff --git a/__pycache__/detect.cpython-38.pyc b/__pycache__/detect.cpython-38.pyc index 46ef210..3370682 100644 Binary files a/__pycache__/detect.cpython-38.pyc and b/__pycache__/detect.cpython-38.pyc differ diff --git a/build/temp.linux-x86_64-3.8/detect.o b/build/temp.linux-x86_64-3.8/detect.o index 2e8b0a2..59f422d 100644 Binary files a/build/temp.linux-x86_64-3.8/detect.o and b/build/temp.linux-x86_64-3.8/detect.o differ diff --git a/detect.c b/detect.c index fd330e5..bc4984e 100644 --- a/detect.c +++ b/detect.c @@ -1624,6 +1624,7 @@ static PyObject *__pyx_pf_6detect_10near(CYTHON_UNUSED PyObject *__pyx_self, PyO static PyObject *__pyx_pf_6detect_12swap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_calibration_width, PyObject *__pyx_v_img_file, PyObject *__pyx_v_show, PyObject *__pyx_v_quick); /* proto */ static PyObject *__pyx_float_0_5; +static PyObject *__pyx_float_0_6; static PyObject *__pyx_float_0_9; static PyObject *__pyx_float_4_5; static PyObject *__pyx_float_0_01; @@ -1631,7 +1632,6 @@ static PyObject *__pyx_float_0_02; static PyObject *__pyx_float_0_03; static PyObject *__pyx_float_0_23; static PyObject *__pyx_float_0_38; -static PyObject *__pyx_float_0_55; static PyObject *__pyx_float_0_75; static PyObject *__pyx_float_0_1875; static PyObject *__pyx_float_0_3125; @@ -1645,12 +1645,14 @@ static PyObject *__pyx_int_10; static PyObject *__pyx_int_16; static PyObject *__pyx_int_20; static PyObject *__pyx_int_25; -static PyObject *__pyx_int_35; +static PyObject *__pyx_int_40; static PyObject *__pyx_int_47; static PyObject *__pyx_int_50; static PyObject *__pyx_int_70; static PyObject *__pyx_int_78; static PyObject *__pyx_int_100; +static PyObject *__pyx_int_127; +static PyObject *__pyx_int_220; static PyObject *__pyx_int_255; static PyObject *__pyx_int_1000; static PyObject *__pyx_int_neg_1; @@ -1661,21 +1663,22 @@ static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; -static PyObject *__pyx_tuple__10; -static PyObject *__pyx_tuple__12; -static PyObject *__pyx_tuple__14; -static PyObject *__pyx_tuple__16; -static PyObject *__pyx_tuple__18; -static PyObject *__pyx_tuple__20; -static PyObject *__pyx_tuple__22; -static PyObject *__pyx_codeobj__9; -static PyObject *__pyx_codeobj__11; -static PyObject *__pyx_codeobj__13; -static PyObject *__pyx_codeobj__15; -static PyObject *__pyx_codeobj__17; -static PyObject *__pyx_codeobj__19; -static PyObject *__pyx_codeobj__21; -static PyObject *__pyx_codeobj__23; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_codeobj__10; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; +static PyObject *__pyx_codeobj__16; +static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_codeobj__20; +static PyObject *__pyx_codeobj__22; +static PyObject *__pyx_codeobj__24; /* Late includes */ /* "detect.py":15 @@ -5260,7 +5263,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * cv2.drawContours(orig, [box.astype("int")], -1, (0, 255, 0), 2) * else: * circular = True # <<<<<<<<<<<<<< - * cv2.circle(orig, (int(x), int(y)), int(radius), (0, 255, 0), 2) + * cv2.circle(orig, (int(x), int(y)), int(radius), (0, 255, 0), 3) * mask = np.zeros(gray.shape, np.uint8) */ /*else*/ { @@ -5269,7 +5272,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P /* "detect.py":167 * else: * circular = True - * cv2.circle(orig, (int(x), int(y)), int(radius), (0, 255, 0), 2) # <<<<<<<<<<<<<< + * cv2.circle(orig, (int(x), int(y)), int(radius), (0, 255, 0), 3) # <<<<<<<<<<<<<< * mask = np.zeros(gray.shape, np.uint8) * cv2.drawContours(mask, [c], 0, 255, -1) */ @@ -5306,7 +5309,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_10)) { - PyObject *__pyx_temp[6] = {__pyx_t_11, __pyx_v_orig, __pyx_t_1, __pyx_t_6, __pyx_tuple__2, __pyx_int_2}; + PyObject *__pyx_temp[6] = {__pyx_t_11, __pyx_v_orig, __pyx_t_1, __pyx_t_6, __pyx_tuple__2, __pyx_int_3}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_4); @@ -5316,7 +5319,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) { - PyObject *__pyx_temp[6] = {__pyx_t_11, __pyx_v_orig, __pyx_t_1, __pyx_t_6, __pyx_tuple__2, __pyx_int_2}; + PyObject *__pyx_temp[6] = {__pyx_t_11, __pyx_v_orig, __pyx_t_1, __pyx_t_6, __pyx_tuple__2, __pyx_int_3}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_4); @@ -5340,9 +5343,9 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_INCREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); PyTuple_SET_ITEM(__pyx_t_3, 3+__pyx_t_9, __pyx_tuple__2); - __Pyx_INCREF(__pyx_int_2); - __Pyx_GIVEREF(__pyx_int_2); - PyTuple_SET_ITEM(__pyx_t_3, 4+__pyx_t_9, __pyx_int_2); + __Pyx_INCREF(__pyx_int_3); + __Pyx_GIVEREF(__pyx_int_3); + PyTuple_SET_ITEM(__pyx_t_3, 4+__pyx_t_9, __pyx_int_3); __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) @@ -5354,7 +5357,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P /* "detect.py":168 * circular = True - * cv2.circle(orig, (int(x), int(y)), int(radius), (0, 255, 0), 2) + * cv2.circle(orig, (int(x), int(y)), int(radius), (0, 255, 0), 3) * mask = np.zeros(gray.shape, np.uint8) # <<<<<<<<<<<<<< * cv2.drawContours(mask, [c], 0, 255, -1) * #pixelpoints = np.transpose(np.nonzero(mask)) @@ -5424,7 +5427,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __pyx_t_4 = 0; /* "detect.py":169 - * cv2.circle(orig, (int(x), int(y)), int(radius), (0, 255, 0), 2) + * cv2.circle(orig, (int(x), int(y)), int(radius), (0, 255, 0), 3) * mask = np.zeros(gray.shape, np.uint8) * cv2.drawContours(mask, [c], 0, 255, -1) # <<<<<<<<<<<<<< * #pixelpoints = np.transpose(np.nonzero(mask)) @@ -5866,7 +5869,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * #orig = image.copy() * num += 1 # <<<<<<<<<<<<<< * # if the contour is not sufficiently large, ignore it - * if cv2.contourArea(c) < 100: # or pixelsPerMetric is None: + * if cv2.contourArea(c) < 100 or pixelsPerMetric is None: */ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_num, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -5876,7 +5879,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P /* "detect.py":190 * num += 1 * # if the contour is not sufficiently large, ignore it - * if cv2.contourArea(c) < 100: # or pixelsPerMetric is None: # <<<<<<<<<<<<<< + * if cv2.contourArea(c) < 100 or pixelsPerMetric is None: # <<<<<<<<<<<<<< * continue * # compute the rotated bounding box of the contour */ @@ -5902,13 +5905,22 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_int_100, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_8) { + } else { + __pyx_t_2 = __pyx_t_8; + goto __pyx_L41_bool_binop_done; + } + __pyx_t_8 = (__pyx_v_pixelsPerMetric == Py_None); + __pyx_t_7 = (__pyx_t_8 != 0); + __pyx_t_2 = __pyx_t_7; + __pyx_L41_bool_binop_done:; if (__pyx_t_2) { /* "detect.py":191 * # if the contour is not sufficiently large, ignore it - * if cv2.contourArea(c) < 100: # or pixelsPerMetric is None: + * if cv2.contourArea(c) < 100 or pixelsPerMetric is None: * continue # <<<<<<<<<<<<<< * # compute the rotated bounding box of the contour * @@ -5918,7 +5930,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P /* "detect.py":190 * num += 1 * # if the contour is not sufficiently large, ignore it - * if cv2.contourArea(c) < 100: # or pixelsPerMetric is None: # <<<<<<<<<<<<<< + * if cv2.contourArea(c) < 100 or pixelsPerMetric is None: # <<<<<<<<<<<<<< * continue * # compute the rotated bounding box of the contour */ @@ -6113,20 +6125,20 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_GOTREF(__pyx_t_10); __pyx_t_14 = Py_TYPE(__pyx_t_10)->tp_iternext; for (index=0; index < 4; index++) { - PyObject* item = __pyx_t_14(__pyx_t_10); if (unlikely(!item)) goto __pyx_L41_unpacking_failed; + PyObject* item = __pyx_t_14(__pyx_t_10); if (unlikely(!item)) goto __pyx_L43_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_10), 4) < 0) __PYX_ERR(0, 211, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - goto __pyx_L42_unpacking_done; - __pyx_L41_unpacking_failed:; + goto __pyx_L44_unpacking_done; + __pyx_L43_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 211, __pyx_L1_error) - __pyx_L42_unpacking_done:; + __pyx_L44_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_tl, __pyx_t_11); __pyx_t_11 = 0; @@ -6222,20 +6234,20 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_14 = Py_TYPE(__pyx_t_1)->tp_iternext; - index = 0; __pyx_t_4 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_4)) goto __pyx_L43_unpacking_failed; + index = 0; __pyx_t_4 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_4)) goto __pyx_L45_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); - index = 1; __pyx_t_11 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_11)) goto __pyx_L43_unpacking_failed; + index = 1; __pyx_t_11 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_11)) goto __pyx_L45_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_1), 2) < 0) __PYX_ERR(0, 212, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L44_unpacking_done; - __pyx_L43_unpacking_failed:; + goto __pyx_L46_unpacking_done; + __pyx_L45_unpacking_failed:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 212, __pyx_L1_error) - __pyx_L44_unpacking_done:; + __pyx_L46_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_tltrX, __pyx_t_4); __pyx_t_4 = 0; @@ -6327,20 +6339,20 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_14 = Py_TYPE(__pyx_t_4)->tp_iternext; - index = 0; __pyx_t_11 = __pyx_t_14(__pyx_t_4); if (unlikely(!__pyx_t_11)) goto __pyx_L45_unpacking_failed; + index = 0; __pyx_t_11 = __pyx_t_14(__pyx_t_4); if (unlikely(!__pyx_t_11)) goto __pyx_L47_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); - index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L45_unpacking_failed; + index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L47_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_4), 2) < 0) __PYX_ERR(0, 213, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L46_unpacking_done; - __pyx_L45_unpacking_failed:; + goto __pyx_L48_unpacking_done; + __pyx_L47_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 213, __pyx_L1_error) - __pyx_L46_unpacking_done:; + __pyx_L48_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_blbrX, __pyx_t_11); __pyx_t_11 = 0; @@ -6432,20 +6444,20 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_14 = Py_TYPE(__pyx_t_11)->tp_iternext; - index = 0; __pyx_t_1 = __pyx_t_14(__pyx_t_11); if (unlikely(!__pyx_t_1)) goto __pyx_L47_unpacking_failed; + index = 0; __pyx_t_1 = __pyx_t_14(__pyx_t_11); if (unlikely(!__pyx_t_1)) goto __pyx_L49_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); - index = 1; __pyx_t_4 = __pyx_t_14(__pyx_t_11); if (unlikely(!__pyx_t_4)) goto __pyx_L47_unpacking_failed; + index = 1; __pyx_t_4 = __pyx_t_14(__pyx_t_11); if (unlikely(!__pyx_t_4)) goto __pyx_L49_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_11), 2) < 0) __PYX_ERR(0, 217, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - goto __pyx_L48_unpacking_done; - __pyx_L47_unpacking_failed:; + goto __pyx_L50_unpacking_done; + __pyx_L49_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 217, __pyx_L1_error) - __pyx_L48_unpacking_done:; + __pyx_L50_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_tlblX, __pyx_t_1); __pyx_t_1 = 0; @@ -6537,20 +6549,20 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_14 = Py_TYPE(__pyx_t_1)->tp_iternext; - index = 0; __pyx_t_4 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_4)) goto __pyx_L49_unpacking_failed; + index = 0; __pyx_t_4 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_4)) goto __pyx_L51_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); - index = 1; __pyx_t_11 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_11)) goto __pyx_L49_unpacking_failed; + index = 1; __pyx_t_11 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_11)) goto __pyx_L51_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_1), 2) < 0) __PYX_ERR(0, 218, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L50_unpacking_done; - __pyx_L49_unpacking_failed:; + goto __pyx_L52_unpacking_done; + __pyx_L51_unpacking_failed:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 218, __pyx_L1_error) - __pyx_L50_unpacking_done:; + __pyx_L52_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_trbrX, __pyx_t_4); __pyx_t_4 = 0; @@ -6825,16 +6837,16 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * (x, y), radius = cv2.minEnclosingCircle(c) */ __pyx_t_3 = PyObject_RichCompare(__pyx_v_num, __pyx_v_num, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!__pyx_t_8) { + if (!__pyx_t_7) { } else { - __pyx_t_2 = __pyx_t_8; - goto __pyx_L52_bool_binop_done; + __pyx_t_2 = __pyx_t_7; + goto __pyx_L54_bool_binop_done; } - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_show); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 235, __pyx_L1_error) - __pyx_t_2 = __pyx_t_8; - __pyx_L52_bool_binop_done:; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_show); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_2 = __pyx_t_7; + __pyx_L54_bool_binop_done:; if (__pyx_t_2) { /* "detect.py":236 @@ -6907,20 +6919,20 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_14 = Py_TYPE(__pyx_t_4)->tp_iternext; - index = 0; __pyx_t_1 = __pyx_t_14(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L54_unpacking_failed; + index = 0; __pyx_t_1 = __pyx_t_14(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L56_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); - index = 1; __pyx_t_11 = __pyx_t_14(__pyx_t_4); if (unlikely(!__pyx_t_11)) goto __pyx_L54_unpacking_failed; + index = 1; __pyx_t_11 = __pyx_t_14(__pyx_t_4); if (unlikely(!__pyx_t_11)) goto __pyx_L56_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_4), 2) < 0) __PYX_ERR(0, 237, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L55_unpacking_done; - __pyx_L54_unpacking_failed:; + goto __pyx_L57_unpacking_done; + __pyx_L56_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 237, __pyx_L1_error) - __pyx_L55_unpacking_done:; + __pyx_L57_unpacking_done:; } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; @@ -6953,20 +6965,20 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_14 = Py_TYPE(__pyx_t_10)->tp_iternext; - index = 0; __pyx_t_4 = __pyx_t_14(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L56_unpacking_failed; + index = 0; __pyx_t_4 = __pyx_t_14(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L58_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); - index = 1; __pyx_t_6 = __pyx_t_14(__pyx_t_10); if (unlikely(!__pyx_t_6)) goto __pyx_L56_unpacking_failed; + index = 1; __pyx_t_6 = __pyx_t_14(__pyx_t_10); if (unlikely(!__pyx_t_6)) goto __pyx_L58_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_10), 2) < 0) __PYX_ERR(0, 237, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - goto __pyx_L57_unpacking_done; - __pyx_L56_unpacking_failed:; + goto __pyx_L59_unpacking_done; + __pyx_L58_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 237, __pyx_L1_error) - __pyx_L57_unpacking_done:; + __pyx_L59_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4); __pyx_t_4 = 0; @@ -7096,14 +7108,14 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * rectangular = True * #cv2.drawContours(orig, [box.astype("int")], -1, (0, 255, 0), 2) */ - goto __pyx_L58; + goto __pyx_L60; } /* "detect.py":248 * #cv2.drawContours(orig, [box.astype("int")], -1, (0, 255, 0), 2) * else: * circular = True # <<<<<<<<<<<<<< - * cv2.circle(orig, (int(x), int(y)), int(radius), (0, 255, 0), 1) + * cv2.circle(orig, (int(x), int(y)), int(radius), (255, 0, 0), 2) * */ /*else*/ { @@ -7112,7 +7124,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P /* "detect.py":249 * else: * circular = True - * cv2.circle(orig, (int(x), int(y)), int(radius), (0, 255, 0), 1) # <<<<<<<<<<<<<< + * cv2.circle(orig, (int(x), int(y)), int(radius), (255, 0, 0), 2) # <<<<<<<<<<<<<< * * objtype = "Unknown" */ @@ -7149,7 +7161,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[6] = {__pyx_t_3, __pyx_v_orig, __pyx_t_4, __pyx_t_6, __pyx_tuple__2, __pyx_int_1}; + PyObject *__pyx_temp[6] = {__pyx_t_3, __pyx_v_orig, __pyx_t_4, __pyx_t_6, __pyx_tuple__4, __pyx_int_2}; __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_11); @@ -7159,7 +7171,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { - PyObject *__pyx_temp[6] = {__pyx_t_3, __pyx_v_orig, __pyx_t_4, __pyx_t_6, __pyx_tuple__2, __pyx_int_1}; + PyObject *__pyx_temp[6] = {__pyx_t_3, __pyx_v_orig, __pyx_t_4, __pyx_t_6, __pyx_tuple__4, __pyx_int_2}; __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_11); @@ -7180,12 +7192,12 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_6); - __Pyx_INCREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_9, __pyx_tuple__2); - __Pyx_INCREF(__pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - PyTuple_SET_ITEM(__pyx_t_10, 4+__pyx_t_9, __pyx_int_1); + __Pyx_INCREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_9, __pyx_tuple__4); + __Pyx_INCREF(__pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_10, 4+__pyx_t_9, __pyx_int_2); __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 249, __pyx_L1_error) @@ -7195,10 +7207,10 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - __pyx_L58:; + __pyx_L60:; /* "detect.py":251 - * cv2.circle(orig, (int(x), int(y)), int(radius), (0, 255, 0), 1) + * cv2.circle(orig, (int(x), int(y)), int(radius), (255, 0, 0), 2) * * objtype = "Unknown" # <<<<<<<<<<<<<< * itemw = larger(dimA, dimB) @@ -7420,18 +7432,18 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * objtype = "Penny" * iteml = 0 */ - __pyx_t_8 = (__pyx_v_circular != 0); - if (__pyx_t_8) { + __pyx_t_7 = (__pyx_v_circular != 0); + if (__pyx_t_7) { } else { - __pyx_t_2 = __pyx_t_8; - goto __pyx_L60_bool_binop_done; + __pyx_t_2 = __pyx_t_7; + goto __pyx_L62_bool_binop_done; } __pyx_t_11 = __Pyx_PyFloat_EqObjC(__pyx_v_itemwr, __pyx_float_0_75, 0.75, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_2 = __pyx_t_8; - __pyx_L60_bool_binop_done:; + __pyx_t_2 = __pyx_t_7; + __pyx_L62_bool_binop_done:; if (__pyx_t_2) { /* "detect.py":264 @@ -7461,7 +7473,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * objtype = "Penny" * iteml = 0 */ - goto __pyx_L59; + goto __pyx_L61; } /* "detect.py":267 @@ -7472,11 +7484,11 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * objtype = "Spacer" */ /*else*/ { - __pyx_t_8 = (__pyx_v_circular != 0); - if (__pyx_t_8) { + __pyx_t_7 = (__pyx_v_circular != 0); + if (__pyx_t_7) { } else { - __pyx_t_2 = __pyx_t_8; - goto __pyx_L63_bool_binop_done; + __pyx_t_2 = __pyx_t_7; + goto __pyx_L65_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_near); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -7535,10 +7547,10 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_2 = __pyx_t_8; - __pyx_L63_bool_binop_done:; + __pyx_t_2 = __pyx_t_7; + __pyx_L65_bool_binop_done:; if (__pyx_t_2) { /* "detect.py":269 @@ -7853,12 +7865,12 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { + if (__pyx_t_7) { } else { - __pyx_t_2 = __pyx_t_8; - goto __pyx_L66_bool_binop_done; + __pyx_t_2 = __pyx_t_7; + goto __pyx_L68_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_near); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); @@ -7914,12 +7926,12 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { + if (__pyx_t_7) { } else { - __pyx_t_2 = __pyx_t_8; - goto __pyx_L66_bool_binop_done; + __pyx_t_2 = __pyx_t_7; + goto __pyx_L68_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_near); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); @@ -7975,10 +7987,10 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __pyx_t_8; - __pyx_L66_bool_binop_done:; + __pyx_t_2 = __pyx_t_7; + __pyx_L68_bool_binop_done:; if (__pyx_t_2) { /* "detect.py":277 @@ -8016,11 +8028,11 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * objtype = "Washer" * epsilon = 3 # 0.02*cv2.arcLength(c,True) */ - __pyx_t_8 = (__pyx_v_circular != 0); - if (__pyx_t_8) { + __pyx_t_7 = (__pyx_v_circular != 0); + if (__pyx_t_7) { } else { - __pyx_t_2 = __pyx_t_8; - goto __pyx_L70_bool_binop_done; + __pyx_t_2 = __pyx_t_7; + goto __pyx_L72_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_near); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); @@ -8076,10 +8088,10 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __pyx_t_8; - __pyx_L70_bool_binop_done:; + __pyx_t_2 = __pyx_t_7; + __pyx_L72_bool_binop_done:; if (__pyx_t_2) { /* "detect.py":279 @@ -8321,7 +8333,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[6] = {__pyx_t_1, __pyx_v_orig, __pyx_v_hull2, __pyx_int_neg_1, __pyx_tuple__4, __pyx_int_3}; + PyObject *__pyx_temp[6] = {__pyx_t_1, __pyx_v_orig, __pyx_v_hull2, __pyx_int_neg_1, __pyx_tuple__5, __pyx_int_3}; __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_10); @@ -8329,7 +8341,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[6] = {__pyx_t_1, __pyx_v_orig, __pyx_v_hull2, __pyx_int_neg_1, __pyx_tuple__4, __pyx_int_3}; + PyObject *__pyx_temp[6] = {__pyx_t_1, __pyx_v_orig, __pyx_v_hull2, __pyx_int_neg_1, __pyx_tuple__5, __pyx_int_3}; __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_10); @@ -8350,9 +8362,9 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_9, __pyx_int_neg_1); - __Pyx_INCREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); - PyTuple_SET_ITEM(__pyx_t_4, 3+__pyx_t_9, __pyx_tuple__4); + __Pyx_INCREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + PyTuple_SET_ITEM(__pyx_t_4, 3+__pyx_t_9, __pyx_tuple__5); __Pyx_INCREF(__pyx_int_3); __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_4, 4+__pyx_t_9, __pyx_int_3); @@ -8389,7 +8401,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[6] = {__pyx_t_3, __pyx_v_orig, __pyx_v_approx, __pyx_int_neg_1, __pyx_tuple__5, __pyx_int_3}; + PyObject *__pyx_temp[6] = {__pyx_t_3, __pyx_v_orig, __pyx_v_approx, __pyx_int_neg_1, __pyx_tuple__4, __pyx_int_3}; __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_10); @@ -8397,7 +8409,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[6] = {__pyx_t_3, __pyx_v_orig, __pyx_v_approx, __pyx_int_neg_1, __pyx_tuple__5, __pyx_int_3}; + PyObject *__pyx_temp[6] = {__pyx_t_3, __pyx_v_orig, __pyx_v_approx, __pyx_int_neg_1, __pyx_tuple__4, __pyx_int_3}; __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_10); @@ -8418,9 +8430,9 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_9, __pyx_int_neg_1); - __Pyx_INCREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_9, __pyx_tuple__5); + __Pyx_INCREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_9, __pyx_tuple__4); __Pyx_INCREF(__pyx_int_3); __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_1, 4+__pyx_t_9, __pyx_int_3); @@ -8471,43 +8483,43 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * objtype = "Screw" * iteml = larger(dimA, dimB) */ - __pyx_t_8 = (__pyx_v_defects != Py_None); - __pyx_t_7 = (__pyx_t_8 != 0); - if (__pyx_t_7) { + __pyx_t_7 = (__pyx_v_defects != Py_None); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { } else { - __pyx_t_2 = __pyx_t_7; - goto __pyx_L73_bool_binop_done; + __pyx_t_2 = __pyx_t_8; + goto __pyx_L75_bool_binop_done; } __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_defects, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, __pyx_int_5, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__pyx_t_7) { + if (__pyx_t_8) { } else { - __pyx_t_2 = __pyx_t_7; - goto __pyx_L73_bool_binop_done; + __pyx_t_2 = __pyx_t_8; + goto __pyx_L75_bool_binop_done; } __pyx_t_10 = PyObject_RichCompare(__pyx_v_convexness, __pyx_float_0_9, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 293, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (!__pyx_t_7) { + if (!__pyx_t_8) { } else { - goto __pyx_L76_next_and; + goto __pyx_L78_next_and; } __pyx_t_10 = PyObject_RichCompare(__pyx_v_boxiness, __pyx_float_0_75, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 293, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__pyx_t_7) { + if (__pyx_t_8) { } else { - __pyx_t_2 = __pyx_t_7; - goto __pyx_L73_bool_binop_done; + __pyx_t_2 = __pyx_t_8; + goto __pyx_L75_bool_binop_done; } - __pyx_L76_next_and:; - __pyx_t_7 = (__pyx_v_rectangular != 0); - __pyx_t_2 = __pyx_t_7; - __pyx_L73_bool_binop_done:; + __pyx_L78_next_and:; + __pyx_t_8 = (__pyx_v_rectangular != 0); + __pyx_t_2 = __pyx_t_8; + __pyx_L75_bool_binop_done:; if (__pyx_t_2) { /* "detect.py":294 @@ -8617,7 +8629,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * objtype = "Screw" * iteml = larger(dimA, dimB) */ - goto __pyx_L72; + goto __pyx_L74; } /* "detect.py":300 @@ -8630,16 +8642,16 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P /*else*/ { __pyx_t_10 = __Pyx_PyFloat_EqObjC(__pyx_v_itemhr, __pyx_float_0_3125, 0.3125, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__pyx_t_7) { + if (__pyx_t_8) { } else { - __pyx_t_2 = __pyx_t_7; - goto __pyx_L79_bool_binop_done; + __pyx_t_2 = __pyx_t_8; + goto __pyx_L81_bool_binop_done; } - __pyx_t_7 = (__pyx_v_rectangular != 0); - __pyx_t_2 = __pyx_t_7; - __pyx_L79_bool_binop_done:; + __pyx_t_8 = (__pyx_v_rectangular != 0); + __pyx_t_2 = __pyx_t_8; + __pyx_L81_bool_binop_done:; if (__pyx_t_2) { /* "detect.py":301 @@ -8697,16 +8709,16 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P */ __pyx_t_10 = __Pyx_PyFloat_EqObjC(__pyx_v_itemhr, __pyx_float_0_1875, 0.1875, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__pyx_t_7) { + if (__pyx_t_8) { } else { - __pyx_t_2 = __pyx_t_7; - goto __pyx_L82_bool_binop_done; + __pyx_t_2 = __pyx_t_8; + goto __pyx_L84_bool_binop_done; } - __pyx_t_7 = (__pyx_v_rectangular != 0); - __pyx_t_2 = __pyx_t_7; - __pyx_L82_bool_binop_done:; + __pyx_t_8 = (__pyx_v_rectangular != 0); + __pyx_t_2 = __pyx_t_8; + __pyx_L84_bool_binop_done:; if (__pyx_t_2) { /* "detect.py":305 @@ -8749,9 +8761,9 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P */ } } - __pyx_L72:; + __pyx_L74:; } - __pyx_L59:; + __pyx_L61:; /* "detect.py":308 * iteml = (radius * 2 / pixelsPerMetric + itemw) / 2 @@ -8796,20 +8808,20 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_14 = Py_TYPE(__pyx_t_3)->tp_iternext; - index = 0; __pyx_t_1 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L84_unpacking_failed; + index = 0; __pyx_t_1 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L86_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); - index = 1; __pyx_t_4 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L84_unpacking_failed; + index = 1; __pyx_t_4 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L86_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_3), 2) < 0) __PYX_ERR(0, 308, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L85_unpacking_done; - __pyx_L84_unpacking_failed:; + goto __pyx_L87_unpacking_done; + __pyx_L86_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 308, __pyx_L1_error) - __pyx_L85_unpacking_done:; + __pyx_L87_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_rows, __pyx_t_1); __pyx_t_1 = 0; @@ -8933,20 +8945,20 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_14 = Py_TYPE(__pyx_t_6)->tp_iternext; for (index=0; index < 4; index++) { - PyObject* item = __pyx_t_14(__pyx_t_6); if (unlikely(!item)) goto __pyx_L86_unpacking_failed; + PyObject* item = __pyx_t_14(__pyx_t_6); if (unlikely(!item)) goto __pyx_L88_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_6), 4) < 0) __PYX_ERR(0, 309, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L87_unpacking_done; - __pyx_L86_unpacking_failed:; + goto __pyx_L89_unpacking_done; + __pyx_L88_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 309, __pyx_L1_error) - __pyx_L87_unpacking_done:; + __pyx_L89_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_vx, __pyx_t_1); __pyx_t_1 = 0; @@ -9335,7 +9347,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * swap(ypos, ypos2) * if rectangular: # <<<<<<<<<<<<<< * cv2.line(orig, (int(xpos), int(ypos)), - * (int(xpos2), int(ypos2)), (0, 255, 0), 1) + * (int(xpos2), int(ypos2)), (255, 127, 0), 2) */ __pyx_t_2 = (__pyx_v_rectangular != 0); if (__pyx_t_2) { @@ -9344,7 +9356,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * swap(ypos, ypos2) * if rectangular: * cv2.line(orig, (int(xpos), int(ypos)), # <<<<<<<<<<<<<< - * (int(xpos2), int(ypos2)), (0, 255, 0), 1) + * (int(xpos2), int(ypos2)), (255, 127, 0), 2) * # print(str(iteml)) */ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_cv2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 323, __pyx_L1_error) @@ -9368,7 +9380,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P /* "detect.py":324 * if rectangular: * cv2.line(orig, (int(xpos), int(ypos)), - * (int(xpos2), int(ypos2)), (0, 255, 0), 1) # <<<<<<<<<<<<<< + * (int(xpos2), int(ypos2)), (255, 127, 0), 2) # <<<<<<<<<<<<<< * # print(str(iteml)) * # draw the object sizes on the image */ @@ -9398,7 +9410,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[6] = {__pyx_t_10, __pyx_v_orig, __pyx_t_1, __pyx_t_6, __pyx_tuple__2, __pyx_int_1}; + PyObject *__pyx_temp[6] = {__pyx_t_10, __pyx_v_orig, __pyx_t_1, __pyx_t_6, __pyx_tuple__7, __pyx_int_2}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_3); @@ -9408,7 +9420,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[6] = {__pyx_t_10, __pyx_v_orig, __pyx_t_1, __pyx_t_6, __pyx_tuple__2, __pyx_int_1}; + PyObject *__pyx_temp[6] = {__pyx_t_10, __pyx_v_orig, __pyx_t_1, __pyx_t_6, __pyx_tuple__7, __pyx_int_2}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_3); @@ -9429,12 +9441,12 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_9, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_9, __pyx_t_6); - __Pyx_INCREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_9, __pyx_tuple__2); - __Pyx_INCREF(__pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_9, __pyx_int_1); + __Pyx_INCREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_9, __pyx_tuple__7); + __Pyx_INCREF(__pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_9, __pyx_int_2); __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) @@ -9449,7 +9461,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * swap(ypos, ypos2) * if rectangular: # <<<<<<<<<<<<<< * cv2.line(orig, (int(xpos), int(ypos)), - * (int(xpos2), int(ypos2)), (0, 255, 0), 1) + * (int(xpos2), int(ypos2)), (255, 127, 0), 2) */ } @@ -9460,14 +9472,14 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * # cv2.putText(orig, "{:.5f}in".format(itemhr), * # (int(trbrX + 20), int(trbrY)), cv2.FONT_HERSHEY_SIMPLEX, */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_show); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 327, __pyx_L1_error) - if (!__pyx_t_7) { + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_show); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 327, __pyx_L1_error) + if (!__pyx_t_8) { } else { - __pyx_t_2 = __pyx_t_7; - goto __pyx_L91_bool_binop_done; + __pyx_t_2 = __pyx_t_8; + goto __pyx_L93_bool_binop_done; } __pyx_t_2 = 1; - __pyx_L91_bool_binop_done:; + __pyx_L93_bool_binop_done:; if (__pyx_t_2) { /* "detect.py":331 @@ -9500,7 +9512,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * cv2.putText(orig, str(objtype), * (int(x - 25), int(y + radius + 20) # <<<<<<<<<<<<<< * ), cv2.FONT_HERSHEY_SIMPLEX, - * 0.55, (255, 255, 255), 2) + * 0.6, (50, 50, 220), 2) */ __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_v_x, __pyx_int_25, 25, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); @@ -9528,7 +9540,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * cv2.putText(orig, str(objtype), * (int(x - 25), int(y + radius + 20) * ), cv2.FONT_HERSHEY_SIMPLEX, # <<<<<<<<<<<<<< - * 0.55, (255, 255, 255), 2) + * 0.6, (50, 50, 220), 2) * else: */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_cv2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) @@ -9540,7 +9552,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P /* "detect.py":335 * (int(x - 25), int(y + radius + 20) * ), cv2.FONT_HERSHEY_SIMPLEX, - * 0.55, (255, 255, 255), 2) # <<<<<<<<<<<<<< + * 0.6, (50, 50, 220), 2) # <<<<<<<<<<<<<< * else: * cv2.putText(orig, str(objtype), */ @@ -9558,7 +9570,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_11)) { - PyObject *__pyx_temp[8] = {__pyx_t_6, __pyx_v_orig, __pyx_t_4, __pyx_t_10, __pyx_t_1, __pyx_float_0_55, __pyx_tuple__7, __pyx_int_2}; + PyObject *__pyx_temp[8] = {__pyx_t_6, __pyx_v_orig, __pyx_t_4, __pyx_t_10, __pyx_t_1, __pyx_float_0_6, __pyx_tuple__8, __pyx_int_2}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_9, 7+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); @@ -9569,7 +9581,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) { - PyObject *__pyx_temp[8] = {__pyx_t_6, __pyx_v_orig, __pyx_t_4, __pyx_t_10, __pyx_t_1, __pyx_float_0_55, __pyx_tuple__7, __pyx_int_2}; + PyObject *__pyx_temp[8] = {__pyx_t_6, __pyx_v_orig, __pyx_t_4, __pyx_t_10, __pyx_t_1, __pyx_float_0_6, __pyx_tuple__8, __pyx_int_2}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_9, 7+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); @@ -9593,12 +9605,12 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P PyTuple_SET_ITEM(__pyx_t_15, 2+__pyx_t_9, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_15, 3+__pyx_t_9, __pyx_t_1); - __Pyx_INCREF(__pyx_float_0_55); - __Pyx_GIVEREF(__pyx_float_0_55); - PyTuple_SET_ITEM(__pyx_t_15, 4+__pyx_t_9, __pyx_float_0_55); - __Pyx_INCREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - PyTuple_SET_ITEM(__pyx_t_15, 5+__pyx_t_9, __pyx_tuple__7); + __Pyx_INCREF(__pyx_float_0_6); + __Pyx_GIVEREF(__pyx_float_0_6); + PyTuple_SET_ITEM(__pyx_t_15, 4+__pyx_t_9, __pyx_float_0_6); + __Pyx_INCREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + PyTuple_SET_ITEM(__pyx_t_15, 5+__pyx_t_9, __pyx_tuple__8); __Pyx_INCREF(__pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); PyTuple_SET_ITEM(__pyx_t_15, 6+__pyx_t_9, __pyx_int_2); @@ -9619,11 +9631,11 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * cv2.putText(orig, str(objtype), * (int(x - 25), int(y + radius + 20) */ - goto __pyx_L93; + goto __pyx_L95; } /* "detect.py":337 - * 0.55, (255, 255, 255), 2) + * 0.6, (50, 50, 220), 2) * else: * cv2.putText(orig, str(objtype), # <<<<<<<<<<<<<< * (int(xpos2 + 10), int(ypos2 + 20) @@ -9643,7 +9655,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * cv2.putText(orig, str(objtype), * (int(xpos2 + 10), int(ypos2 + 20) # <<<<<<<<<<<<<< * ), cv2.FONT_HERSHEY_SIMPLEX, - * 0.55, (255, 255, 255), 2) + * 0.6, (50, 50, 220), 2) */ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_xpos2, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -9668,7 +9680,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * cv2.putText(orig, str(objtype), * (int(xpos2 + 10), int(ypos2 + 20) * ), cv2.FONT_HERSHEY_SIMPLEX, # <<<<<<<<<<<<<< - * 0.55, (255, 255, 255), 2) + * 0.6, (50, 50, 220), 2) * output = "" */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_cv2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 339, __pyx_L1_error) @@ -9680,7 +9692,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P /* "detect.py":340 * (int(xpos2 + 10), int(ypos2 + 20) * ), cv2.FONT_HERSHEY_SIMPLEX, - * 0.55, (255, 255, 255), 2) # <<<<<<<<<<<<<< + * 0.6, (50, 50, 220), 2) # <<<<<<<<<<<<<< * output = "" * objname = objtype; */ @@ -9698,7 +9710,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_15)) { - PyObject *__pyx_temp[8] = {__pyx_t_4, __pyx_v_orig, __pyx_t_11, __pyx_t_1, __pyx_t_10, __pyx_float_0_55, __pyx_tuple__7, __pyx_int_2}; + PyObject *__pyx_temp[8] = {__pyx_t_4, __pyx_v_orig, __pyx_t_11, __pyx_t_1, __pyx_t_10, __pyx_float_0_6, __pyx_tuple__8, __pyx_int_2}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_9, 7+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); @@ -9709,7 +9721,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) { - PyObject *__pyx_temp[8] = {__pyx_t_4, __pyx_v_orig, __pyx_t_11, __pyx_t_1, __pyx_t_10, __pyx_float_0_55, __pyx_tuple__7, __pyx_int_2}; + PyObject *__pyx_temp[8] = {__pyx_t_4, __pyx_v_orig, __pyx_t_11, __pyx_t_1, __pyx_t_10, __pyx_float_0_6, __pyx_tuple__8, __pyx_int_2}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_9, 7+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); @@ -9733,12 +9745,12 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_9, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_9, __pyx_t_10); - __Pyx_INCREF(__pyx_float_0_55); - __Pyx_GIVEREF(__pyx_float_0_55); - PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_9, __pyx_float_0_55); - __Pyx_INCREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - PyTuple_SET_ITEM(__pyx_t_6, 5+__pyx_t_9, __pyx_tuple__7); + __Pyx_INCREF(__pyx_float_0_6); + __Pyx_GIVEREF(__pyx_float_0_6); + PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_9, __pyx_float_0_6); + __Pyx_INCREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + PyTuple_SET_ITEM(__pyx_t_6, 5+__pyx_t_9, __pyx_tuple__8); __Pyx_INCREF(__pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); PyTuple_SET_ITEM(__pyx_t_6, 6+__pyx_t_9, __pyx_int_2); @@ -9752,11 +9764,11 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_L93:; + __pyx_L95:; /* "detect.py":341 * ), cv2.FONT_HERSHEY_SIMPLEX, - * 0.55, (255, 255, 255), 2) + * 0.6, (50, 50, 220), 2) * output = "" # <<<<<<<<<<<<<< * objname = objtype; * if objtype == "Unknown": @@ -9765,7 +9777,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_XDECREF_SET(__pyx_v_output, __pyx_kp_s__3); /* "detect.py":342 - * 0.55, (255, 255, 255), 2) + * 0.6, (50, 50, 220), 2) * output = "" * objname = objtype; # <<<<<<<<<<<<<< * if objtype == "Unknown": @@ -9848,15 +9860,15 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * output = str(iteml) + "in" * objname += str(iteml) */ - __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_objtype, __pyx_n_s_Screw, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 345, __pyx_L1_error) - if (!__pyx_t_7) { + __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_objtype, __pyx_n_s_Screw, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 345, __pyx_L1_error) + if (!__pyx_t_8) { } else { - __pyx_t_2 = __pyx_t_7; - goto __pyx_L96_bool_binop_done; + __pyx_t_2 = __pyx_t_8; + goto __pyx_L98_bool_binop_done; } - __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_objtype, __pyx_n_s_Standoff, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 345, __pyx_L1_error) - __pyx_t_2 = __pyx_t_7; - __pyx_L96_bool_binop_done:; + __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_objtype, __pyx_n_s_Standoff, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_2 = __pyx_t_8; + __pyx_L98_bool_binop_done:; if (__pyx_t_2) { /* "detect.py":346 @@ -9976,7 +9988,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * print(objname) * if circular: # <<<<<<<<<<<<<< * cv2.putText(orig, output, # print data - * (int(x - 25), int(y + radius + 35) + * (int(x - 25), int(y + radius + 40) */ __pyx_t_2 = (__pyx_v_circular != 0); if (__pyx_t_2) { @@ -9985,7 +9997,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * print(objname) * if circular: * cv2.putText(orig, output, # print data # <<<<<<<<<<<<<< - * (int(x - 25), int(y + radius + 35) + * (int(x - 25), int(y + radius + 40) * ), cv2.FONT_HERSHEY_SIMPLEX, */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_cv2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 353, __pyx_L1_error) @@ -9997,9 +10009,9 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P /* "detect.py":354 * if circular: * cv2.putText(orig, output, # print data - * (int(x - 25), int(y + radius + 35) # <<<<<<<<<<<<<< + * (int(x - 25), int(y + radius + 40) # <<<<<<<<<<<<<< * ), cv2.FONT_HERSHEY_SIMPLEX, - * 0.5, (255, 255, 255), 1) + * 0.5, (50, 50, 220), 1) */ __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_v_x, __pyx_int_25, 25, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); @@ -10008,7 +10020,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyNumber_Add(__pyx_v_y, __pyx_v_radius); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_35, 35, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_40, 40, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error) @@ -10025,9 +10037,9 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P /* "detect.py":355 * cv2.putText(orig, output, # print data - * (int(x - 25), int(y + radius + 35) + * (int(x - 25), int(y + radius + 40) * ), cv2.FONT_HERSHEY_SIMPLEX, # <<<<<<<<<<<<<< - * 0.5, (255, 255, 255), 1) + * 0.5, (50, 50, 220), 1) * else: */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_cv2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 355, __pyx_L1_error) @@ -10037,9 +10049,9 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "detect.py":356 - * (int(x - 25), int(y + radius + 35) + * (int(x - 25), int(y + radius + 40) * ), cv2.FONT_HERSHEY_SIMPLEX, - * 0.5, (255, 255, 255), 1) # <<<<<<<<<<<<<< + * 0.5, (50, 50, 220), 1) # <<<<<<<<<<<<<< * else: * cv2.putText(orig, output, # print data */ @@ -10057,7 +10069,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[8] = {__pyx_t_6, __pyx_v_orig, __pyx_v_output, __pyx_t_1, __pyx_t_10, __pyx_float_0_5, __pyx_tuple__7, __pyx_int_1}; + PyObject *__pyx_temp[8] = {__pyx_t_6, __pyx_v_orig, __pyx_v_output, __pyx_t_1, __pyx_t_10, __pyx_float_0_5, __pyx_tuple__8, __pyx_int_1}; __pyx_t_15 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 7+__pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_15); @@ -10067,7 +10079,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[8] = {__pyx_t_6, __pyx_v_orig, __pyx_v_output, __pyx_t_1, __pyx_t_10, __pyx_float_0_5, __pyx_tuple__7, __pyx_int_1}; + PyObject *__pyx_temp[8] = {__pyx_t_6, __pyx_v_orig, __pyx_v_output, __pyx_t_1, __pyx_t_10, __pyx_float_0_5, __pyx_tuple__8, __pyx_int_1}; __pyx_t_15 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 7+__pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_15); @@ -10094,9 +10106,9 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_INCREF(__pyx_float_0_5); __Pyx_GIVEREF(__pyx_float_0_5); PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_9, __pyx_float_0_5); - __Pyx_INCREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - PyTuple_SET_ITEM(__pyx_t_11, 5+__pyx_t_9, __pyx_tuple__7); + __Pyx_INCREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + PyTuple_SET_ITEM(__pyx_t_11, 5+__pyx_t_9, __pyx_tuple__8); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_11, 6+__pyx_t_9, __pyx_int_1); @@ -10114,16 +10126,16 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P * print(objname) * if circular: # <<<<<<<<<<<<<< * cv2.putText(orig, output, # print data - * (int(x - 25), int(y + radius + 35) + * (int(x - 25), int(y + radius + 40) */ - goto __pyx_L99; + goto __pyx_L101; } /* "detect.py":358 - * 0.5, (255, 255, 255), 1) + * 0.5, (50, 50, 220), 1) * else: * cv2.putText(orig, output, # print data # <<<<<<<<<<<<<< - * (int(xpos2 + 10), int(ypos2 + 35) + * (int(xpos2 + 10), int(ypos2 + 40) * ), cv2.FONT_HERSHEY_SIMPLEX, */ /*else*/ { @@ -10136,16 +10148,16 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P /* "detect.py":359 * else: * cv2.putText(orig, output, # print data - * (int(xpos2 + 10), int(ypos2 + 35) # <<<<<<<<<<<<<< + * (int(xpos2 + 10), int(ypos2 + 40) # <<<<<<<<<<<<<< * ), cv2.FONT_HERSHEY_SIMPLEX, - * 0.5, (255, 255, 255), 1) + * 0.5, (50, 50, 220), 1) */ __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_xpos2, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_ypos2, __pyx_int_35, 35, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_ypos2, __pyx_int_40, 40, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -10161,9 +10173,9 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P /* "detect.py":360 * cv2.putText(orig, output, # print data - * (int(xpos2 + 10), int(ypos2 + 35) + * (int(xpos2 + 10), int(ypos2 + 40) * ), cv2.FONT_HERSHEY_SIMPLEX, # <<<<<<<<<<<<<< - * 0.5, (255, 255, 255), 1) + * 0.5, (50, 50, 220), 1) * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_cv2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) @@ -10173,9 +10185,9 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "detect.py":361 - * (int(xpos2 + 10), int(ypos2 + 35) + * (int(xpos2 + 10), int(ypos2 + 40) * ), cv2.FONT_HERSHEY_SIMPLEX, - * 0.5, (255, 255, 255), 1) # <<<<<<<<<<<<<< + * 0.5, (50, 50, 220), 1) # <<<<<<<<<<<<<< * * # show the output image */ @@ -10193,7 +10205,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_11)) { - PyObject *__pyx_temp[8] = {__pyx_t_1, __pyx_v_orig, __pyx_v_output, __pyx_t_3, __pyx_t_10, __pyx_float_0_5, __pyx_tuple__7, __pyx_int_1}; + PyObject *__pyx_temp[8] = {__pyx_t_1, __pyx_v_orig, __pyx_v_output, __pyx_t_3, __pyx_t_10, __pyx_float_0_5, __pyx_tuple__8, __pyx_int_1}; __pyx_t_15 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_9, 7+__pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_15); @@ -10203,7 +10215,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) { - PyObject *__pyx_temp[8] = {__pyx_t_1, __pyx_v_orig, __pyx_v_output, __pyx_t_3, __pyx_t_10, __pyx_float_0_5, __pyx_tuple__7, __pyx_int_1}; + PyObject *__pyx_temp[8] = {__pyx_t_1, __pyx_v_orig, __pyx_v_output, __pyx_t_3, __pyx_t_10, __pyx_float_0_5, __pyx_tuple__8, __pyx_int_1}; __pyx_t_15 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_9, 7+__pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_15); @@ -10230,9 +10242,9 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_INCREF(__pyx_float_0_5); __Pyx_GIVEREF(__pyx_float_0_5); PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_9, __pyx_float_0_5); - __Pyx_INCREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - PyTuple_SET_ITEM(__pyx_t_6, 5+__pyx_t_9, __pyx_tuple__7); + __Pyx_INCREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + PyTuple_SET_ITEM(__pyx_t_6, 5+__pyx_t_9, __pyx_tuple__8); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_6, 6+__pyx_t_9, __pyx_int_1); @@ -10245,7 +10257,7 @@ static PyObject *__pyx_pf_6detect_14detect(CYTHON_UNUSED PyObject *__pyx_self, P __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } - __pyx_L99:; + __pyx_L101:; /* "detect.py":364 * @@ -10758,25 +10770,25 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "detect.py":287 - * defects = cv2.convexityDefects(c, hull) - * #print(str(defects.size) + " match") - * cv2.drawContours(orig, (hull2), -1, (0, 0, 255), 3) # <<<<<<<<<<<<<< - * cv2.drawContours(orig, (approx), -1, (255, 0, 0), 3) - * convexness = area_contour / cv2.contourArea(hull2) + /* "detect.py":249 + * else: + * circular = True + * cv2.circle(orig, (int(x), int(y)), int(radius), (255, 0, 0), 2) # <<<<<<<<<<<<<< + * + * objtype = "Unknown" */ - __pyx_tuple__4 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_255); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 287, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "detect.py":288 + /* "detect.py":287 + * defects = cv2.convexityDefects(c, hull) * #print(str(defects.size) + " match") - * cv2.drawContours(orig, (hull2), -1, (0, 0, 255), 3) - * cv2.drawContours(orig, (approx), -1, (255, 0, 0), 3) # <<<<<<<<<<<<<< + * cv2.drawContours(orig, (hull2), -1, (0, 0, 255), 3) # <<<<<<<<<<<<<< + * cv2.drawContours(orig, (approx), -1, (255, 0, 0), 3) * convexness = area_contour / cv2.contourArea(hull2) - * #print(str(convexness) + " % fill") */ - __pyx_tuple__5 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_255); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); @@ -10791,16 +10803,27 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_slice__6); __Pyx_GIVEREF(__pyx_slice__6); + /* "detect.py":324 + * if rectangular: + * cv2.line(orig, (int(xpos), int(ypos)), + * (int(xpos2), int(ypos2)), (255, 127, 0), 2) # <<<<<<<<<<<<<< + * # print(str(iteml)) + * # draw the object sizes on the image + */ + __pyx_tuple__7 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_127, __pyx_int_0); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + /* "detect.py":335 * (int(x - 25), int(y + radius + 20) * ), cv2.FONT_HERSHEY_SIMPLEX, - * 0.55, (255, 255, 255), 2) # <<<<<<<<<<<<<< + * 0.6, (50, 50, 220), 2) # <<<<<<<<<<<<<< * else: * cv2.putText(orig, str(objtype), */ - __pyx_tuple__7 = PyTuple_Pack(3, __pyx_int_255, __pyx_int_255, __pyx_int_255); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__8 = PyTuple_Pack(3, __pyx_int_50, __pyx_int_50, __pyx_int_220); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); /* "detect.py":15 * @@ -10809,10 +10832,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * return ((ptA[0] + ptB[0]) * 0.5, (ptA[1] + ptB[1]) * 0.5) * */ - __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_ptA, __pyx_n_s_ptB); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_detect_py, __pyx_n_s_midpoint, 15, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_ptA, __pyx_n_s_ptB); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_detect_py, __pyx_n_s_midpoint, 15, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 15, __pyx_L1_error) /* "detect.py":19 * @@ -10821,10 +10844,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * # Screw Sizing code * # subtract screw head size to find thread length */ - __pyx_tuple__10 = PyTuple_Pack(2, __pyx_n_s_iteml, __pyx_n_s_shead); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_detect_py, __pyx_n_s_sizeVexScrew, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 19, __pyx_L1_error) + __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_iteml, __pyx_n_s_shead); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_detect_py, __pyx_n_s_sizeVexScrew, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 19, __pyx_L1_error) /* "detect.py":31 * @@ -10833,10 +10856,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * # Standoff Sizing code * iteml *= 2 */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_iteml); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 31, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_detect_py, __pyx_n_s_sizeStandoff, 31, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_iteml); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_detect_py, __pyx_n_s_sizeStandoff, 31, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 31, __pyx_L1_error) /* "detect.py":39 * @@ -10845,10 +10868,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * if a >= b: * return a */ - __pyx_tuple__14 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_b); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_detect_py, __pyx_n_s_larger, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_b); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_detect_py, __pyx_n_s_larger, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 39, __pyx_L1_error) /* "detect.py":46 * @@ -10857,10 +10880,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * if a < b: * return a */ - __pyx_tuple__16 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_b); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); - __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_detect_py, __pyx_n_s_smaller, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_b); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_detect_py, __pyx_n_s_smaller, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 46, __pyx_L1_error) /* "detect.py":53 * @@ -10869,10 +10892,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * if abs(a-b) < close: * return True */ - __pyx_tuple__18 = PyTuple_Pack(3, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_close); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); - __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_detect_py, __pyx_n_s_near, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_tuple__19 = PyTuple_Pack(3, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_close); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_detect_py, __pyx_n_s_near, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 53, __pyx_L1_error) /* "detect.py":59 * @@ -10881,10 +10904,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * tmp = a * a = b */ - __pyx_tuple__20 = PyTuple_Pack(3, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_tmp); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_detect_py, __pyx_n_s_swap, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_tmp); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_detect_py, __pyx_n_s_swap, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 59, __pyx_L1_error) /* "detect.py":78 * args = vars(ap.parse_args()) @@ -10893,10 +10916,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * selected = 2 * #if type(args["number"]) == type(selected): */ - __pyx_tuple__22 = PyTuple_Pack(71, __pyx_n_s_calibration_width, __pyx_n_s_img_file, __pyx_n_s_show, __pyx_n_s_quick, __pyx_n_s_selected, __pyx_n_s_image, __pyx_n_s_gray, __pyx_n_s_edged, __pyx_n_s_cnts, __pyx_n_s_pixelsPerMetric, __pyx_n_s_num, __pyx_n_s_c, __pyx_n_s_orig, __pyx_n_s_box, __pyx_n_s_tl, __pyx_n_s_tr, __pyx_n_s_br, __pyx_n_s_bl, __pyx_n_s_tltrX, __pyx_n_s_tltrY, __pyx_n_s_blbrX, __pyx_n_s_blbrY, __pyx_n_s_tlblX, __pyx_n_s_tlblY, __pyx_n_s_trbrX, __pyx_n_s_trbrY, __pyx_n_s_dA, __pyx_n_s_dB, __pyx_n_s_area_box, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_radius, __pyx_n_s_area_contour, __pyx_n_s_area_circle, __pyx_n_s_boxiness, __pyx_n_s_circleness, __pyx_n_s_circular, __pyx_n_s_rectangular, __pyx_n_s_mask, __pyx_n_s_hsv, __pyx_n_s_mean_val, __pyx_n_s_objtype, __pyx_n_s_objname, __pyx_n_s_dimA, __pyx_n_s_dimB, __pyx_n_s_itemw, __pyx_n_s_itemwr, __pyx_n_s_itemh, __pyx_n_s_itemhr, __pyx_n_s_iteml, __pyx_n_s_epsilon, __pyx_n_s_approx, __pyx_n_s_hull, __pyx_n_s_hull2, __pyx_n_s_defects, __pyx_n_s_convexness, __pyx_n_s_rows, __pyx_n_s_cols, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_xx, __pyx_n_s_yy, __pyx_n_s_lefty, __pyx_n_s_righty, __pyx_n_s_slope, __pyx_n_s_angle, __pyx_n_s_xpos, __pyx_n_s_ypos, __pyx_n_s_xpos2, __pyx_n_s_ypos2, __pyx_n_s_output); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 78, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); - __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(4, 0, 71, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_detect_py, __pyx_n_s_detect, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_tuple__23 = PyTuple_Pack(71, __pyx_n_s_calibration_width, __pyx_n_s_img_file, __pyx_n_s_show, __pyx_n_s_quick, __pyx_n_s_selected, __pyx_n_s_image, __pyx_n_s_gray, __pyx_n_s_edged, __pyx_n_s_cnts, __pyx_n_s_pixelsPerMetric, __pyx_n_s_num, __pyx_n_s_c, __pyx_n_s_orig, __pyx_n_s_box, __pyx_n_s_tl, __pyx_n_s_tr, __pyx_n_s_br, __pyx_n_s_bl, __pyx_n_s_tltrX, __pyx_n_s_tltrY, __pyx_n_s_blbrX, __pyx_n_s_blbrY, __pyx_n_s_tlblX, __pyx_n_s_tlblY, __pyx_n_s_trbrX, __pyx_n_s_trbrY, __pyx_n_s_dA, __pyx_n_s_dB, __pyx_n_s_area_box, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_radius, __pyx_n_s_area_contour, __pyx_n_s_area_circle, __pyx_n_s_boxiness, __pyx_n_s_circleness, __pyx_n_s_circular, __pyx_n_s_rectangular, __pyx_n_s_mask, __pyx_n_s_hsv, __pyx_n_s_mean_val, __pyx_n_s_objtype, __pyx_n_s_objname, __pyx_n_s_dimA, __pyx_n_s_dimB, __pyx_n_s_itemw, __pyx_n_s_itemwr, __pyx_n_s_itemh, __pyx_n_s_itemhr, __pyx_n_s_iteml, __pyx_n_s_epsilon, __pyx_n_s_approx, __pyx_n_s_hull, __pyx_n_s_hull2, __pyx_n_s_defects, __pyx_n_s_convexness, __pyx_n_s_rows, __pyx_n_s_cols, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_xx, __pyx_n_s_yy, __pyx_n_s_lefty, __pyx_n_s_righty, __pyx_n_s_slope, __pyx_n_s_angle, __pyx_n_s_xpos, __pyx_n_s_ypos, __pyx_n_s_xpos2, __pyx_n_s_ypos2, __pyx_n_s_output); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(4, 0, 71, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_detect_py, __pyx_n_s_detect, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -10907,6 +10930,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_float_0_5 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_float_0_5)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_float_0_6 = PyFloat_FromDouble(0.6); if (unlikely(!__pyx_float_0_6)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_0_9 = PyFloat_FromDouble(0.9); if (unlikely(!__pyx_float_0_9)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_4_5 = PyFloat_FromDouble(4.5); if (unlikely(!__pyx_float_4_5)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_0_01 = PyFloat_FromDouble(0.01); if (unlikely(!__pyx_float_0_01)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -10914,7 +10938,6 @@ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { __pyx_float_0_03 = PyFloat_FromDouble(0.03); if (unlikely(!__pyx_float_0_03)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_0_23 = PyFloat_FromDouble(0.23); if (unlikely(!__pyx_float_0_23)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_0_38 = PyFloat_FromDouble(0.38); if (unlikely(!__pyx_float_0_38)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_float_0_55 = PyFloat_FromDouble(0.55); if (unlikely(!__pyx_float_0_55)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_0_75 = PyFloat_FromDouble(0.75); if (unlikely(!__pyx_float_0_75)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_0_1875 = PyFloat_FromDouble(0.1875); if (unlikely(!__pyx_float_0_1875)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_float_0_3125 = PyFloat_FromDouble(0.3125); if (unlikely(!__pyx_float_0_3125)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -10928,12 +10951,14 @@ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_25 = PyInt_FromLong(25); if (unlikely(!__pyx_int_25)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_35 = PyInt_FromLong(35); if (unlikely(!__pyx_int_35)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_40 = PyInt_FromLong(40); if (unlikely(!__pyx_int_40)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_47 = PyInt_FromLong(47); if (unlikely(!__pyx_int_47)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_70 = PyInt_FromLong(70); if (unlikely(!__pyx_int_70)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_78 = PyInt_FromLong(78); if (unlikely(!__pyx_int_78)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_127 = PyInt_FromLong(127); if (unlikely(!__pyx_int_127)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_220 = PyInt_FromLong(220); if (unlikely(!__pyx_int_220)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -11322,7 +11347,7 @@ if (!__Pyx_RefNanny) { * return ((ptA[0] + ptB[0]) * 0.5, (ptA[1] + ptB[1]) * 0.5) * */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6detect_1midpoint, 0, __pyx_n_s_midpoint, NULL, __pyx_n_s_detect, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6detect_1midpoint, 0, __pyx_n_s_midpoint, NULL, __pyx_n_s_detect, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_midpoint, __pyx_t_2) < 0) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11334,7 +11359,7 @@ if (!__Pyx_RefNanny) { * # Screw Sizing code * # subtract screw head size to find thread length */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6detect_3sizeVexScrew, 0, __pyx_n_s_sizeVexScrew, NULL, __pyx_n_s_detect, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6detect_3sizeVexScrew, 0, __pyx_n_s_sizeVexScrew, NULL, __pyx_n_s_detect, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sizeVexScrew, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11346,7 +11371,7 @@ if (!__Pyx_RefNanny) { * # Standoff Sizing code * iteml *= 2 */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6detect_5sizeStandoff, 0, __pyx_n_s_sizeStandoff, NULL, __pyx_n_s_detect, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6detect_5sizeStandoff, 0, __pyx_n_s_sizeStandoff, NULL, __pyx_n_s_detect, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sizeStandoff, __pyx_t_2) < 0) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11358,7 +11383,7 @@ if (!__Pyx_RefNanny) { * if a >= b: * return a */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6detect_7larger, 0, __pyx_n_s_larger, NULL, __pyx_n_s_detect, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6detect_7larger, 0, __pyx_n_s_larger, NULL, __pyx_n_s_detect, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_larger, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11370,7 +11395,7 @@ if (!__Pyx_RefNanny) { * if a < b: * return a */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6detect_9smaller, 0, __pyx_n_s_smaller, NULL, __pyx_n_s_detect, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6detect_9smaller, 0, __pyx_n_s_smaller, NULL, __pyx_n_s_detect, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_smaller, __pyx_t_2) < 0) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11382,7 +11407,7 @@ if (!__Pyx_RefNanny) { * if abs(a-b) < close: * return True */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6detect_11near, 0, __pyx_n_s_near, NULL, __pyx_n_s_detect, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6detect_11near, 0, __pyx_n_s_near, NULL, __pyx_n_s_detect, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_near, __pyx_t_2) < 0) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11394,7 +11419,7 @@ if (!__Pyx_RefNanny) { * tmp = a * a = b */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6detect_13swap, 0, __pyx_n_s_swap, NULL, __pyx_n_s_detect, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6detect_13swap, 0, __pyx_n_s_swap, NULL, __pyx_n_s_detect, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_swap, __pyx_t_2) < 0) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11406,7 +11431,7 @@ if (!__Pyx_RefNanny) { * selected = 2 * #if type(args["number"]) == type(selected): */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6detect_15detect, 0, __pyx_n_s_detect, NULL, __pyx_n_s_detect, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6detect_15detect, 0, __pyx_n_s_detect, NULL, __pyx_n_s_detect, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_detect, __pyx_t_2) < 0) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; diff --git a/detect.cpython-38-x86_64-linux-gnu.so b/detect.cpython-38-x86_64-linux-gnu.so index 9ce30c0..5e1161d 100755 Binary files a/detect.cpython-38-x86_64-linux-gnu.so and b/detect.cpython-38-x86_64-linux-gnu.so differ diff --git a/detect.py b/detect.py index 925198a..78aef57 100644 --- a/detect.py +++ b/detect.py @@ -332,12 +332,12 @@ def detect(calibration_width, img_file, show, quick): cv2.putText(orig, str(objtype), (int(x - 25), int(y + radius + 20) ), cv2.FONT_HERSHEY_SIMPLEX, - 0.55, (0, 0, 255), 2) + 0.6, (50, 50, 220), 2) else: cv2.putText(orig, str(objtype), (int(xpos2 + 10), int(ypos2 + 20) ), cv2.FONT_HERSHEY_SIMPLEX, - 0.55, (0, 0, 255), 2) + 0.6, (50, 50, 220), 2) output = "" objname = objtype; if objtype == "Unknown": @@ -351,14 +351,14 @@ def detect(calibration_width, img_file, show, quick): print(objname) if circular: cv2.putText(orig, output, # print data - (int(x - 25), int(y + radius + 35) + (int(x - 25), int(y + radius + 40) ), cv2.FONT_HERSHEY_SIMPLEX, - 0.5, (0, 0, 255), 1) + 0.5, (50, 50, 220), 1) else: cv2.putText(orig, output, # print data - (int(xpos2 + 10), int(ypos2 + 35) + (int(xpos2 + 10), int(ypos2 + 40) ), cv2.FONT_HERSHEY_SIMPLEX, - 0.5, (0, 0, 255), 1) + 0.5, (50, 50, 220), 1) # show the output image if show: diff --git a/run_detect.py b/run_detect.py index 72301a6..9f412d9 100644 --- a/run_detect.py +++ b/run_detect.py @@ -5,14 +5,13 @@ from imutils.video import FPS calibration_width = 0.75 image = "img7.jpg" images = ("img.jpg", "img2.jpg", "img3.jpg", "img4.jpg", "img5.jpg", "img6.jpg", "img7.jpg", "img8.jpg") -show = False -video = True +video = False def go(): - #for file in images: - detect.detect(calibration_width, "img7.jpg", show) + for file in images: + detect.detect(calibration_width, file, True, False) if not video: - elapsed_time = timeit.timeit(go, number=3)/3 + elapsed_time = timeit.timeit(go, number=1)/1 print(elapsed_time) else : #tcp capture = cv2.VideoCapture('udpsrc port=5001 ! gdpdepay ! rtph264depay ! avdec_h264 ! videoconvert ! videorate ! video/x-raw,framerate=5/1 ! appsink', cv2.CAP_GSTREAMER)