tianzhi0549 / CTPN

Detecting Text in Natural Image with Connectionist Text Proposal Network (ECCV'16)
http://textdet.com
Other
1.28k stars 539 forks source link

Bounding Boxes Coordinates #70

Open abdelDebug opened 7 years ago

abdelDebug commented 7 years ago

Could you please tell me how can I determine the bounding boxes coordinates ??

idefix92 commented 7 years ago

@abdelDebug could you figure out already?

abdelDebug commented 7 years ago

@idefix92 Not Yet !

idefix92 commented 7 years ago

@abdelDebug I figured out:

I modified the draw boxes to print them by:

def draw_boxes(im, bboxes, is_display=True, color=None, caption="Image", wait=True): """ boxes: bounding boxes """ im=im.copy()
bbox_list = [] for box in bboxes:
if color==None: if len(box)==5 or len(box)==9: c=tuple(cm.jet([box[-1]])[0, 2::-1]*255) else: c=tuple(np.random.randint(0, 256, 3)) else: c=color first_point = tuple(box[:2]) second_point = tuple(box[2:4])

    cv2.rectangle(im, first_point, second_point, c)
    bbox_list.append((first_point, second_point))

if is_display:
    cv2.imshow(caption, im)
    if wait:
        cv2.waitKey(0)
return im, bbox_list
idefix92 commented 7 years ago

@abdelDebug they are stored in the text_proposal_connector:

text_lines[index, 0]=x0 text_lines[index, 1]=min(lt_y, rt_y) text_lines[index, 2]=x1 text_lines[index, 3]=max(lb_y, rb_y) text_lines[index, 4]=score

abdelDebug commented 6 years ago

@idefix92 Could you give me please the whole python script. Thank you in advance