|
|
|
@ -46,9 +46,11 @@ class DBPostProcess(object):
|
|
|
|
|
bitmap = _bitmap
|
|
|
|
|
height, width = bitmap.shape
|
|
|
|
|
|
|
|
|
|
# img, contours, _ = cv2.findContours((bitmap * 255).astype(np.uint8), cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)
|
|
|
|
|
contours, _ = cv2.findContours((bitmap * 255).astype(np.uint8),
|
|
|
|
|
cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)
|
|
|
|
|
outs = cv2.findContours((bitmap * 255).astype(np.uint8), cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)
|
|
|
|
|
if len(outs) == 3:
|
|
|
|
|
img, contours, _ = outs[0], outs[1], outs[2]
|
|
|
|
|
elif len(outs) == 2:
|
|
|
|
|
contours, _ = outs[0], outs[1]
|
|
|
|
|
|
|
|
|
|
num_contours = min(len(contours), self.max_candidates)
|
|
|
|
|
boxes = np.zeros((num_contours, 4, 2), dtype=np.int16)
|
|
|
|
|