Ejemplo n.º 1
0
 def on_ctrl_clicked_match(self, aid1, aid2):
     """ HELPER:  Executed when a result ANNOTATION is control-clicked """
     fnum_ = df2.next_fnum()
     ishow_sver(self.ibs, aid1, aid2, fnum=fnum_)
     fig = df2.gcf()
     fig.canvas.draw()
     df2.bring_to_front(fig)
Ejemplo n.º 2
0
 def on_ctrl_clicked_match(self, aid1, aid2):
     """ HELPER:  Executed when a result ANNOTATION is control-clicked """
     fnum_ = df2.next_fnum()
     ishow_sver(self.ibs, aid1, aid2, fnum=fnum_)
     fig = df2.gcf()
     fig.canvas.draw()
     df2.bring_to_front(fig)
Ejemplo n.º 3
0
def iselect_bbox(ibs, gid, fnum=1,
                 figtitle='Image View - Select ANNOTATION (click two points)',
                 **kwargs):
    #from matplotlib.backend_bases import mplDeprecation
    print('[*interact] select_bbox(gid=%r, fnum=%r)' % (gid, fnum))
    print('[*interact] Define a Rectanglular ANNOTATION by clicking two points.')
    # Show the image
    fig = ih.begin_interaction('select_bbox', fnum)
    fig_presenter.bring_to_front(fig)
    viz.show_image(ibs, gid, **kwargs)
    try:
        viz.draw()
        fig = df2.gcf()
        pts = fig.ginput(2)
        print('[*guitools] ginput(2) = %r' % (pts,))
        [(x1, y1), (x2, y2)] = pts
        xm = min(x1, x2)
        xM = max(x1, x2)
        ym = min(y1, y2)
        yM = max(y1, y2)
        bbox = tuple(map(int, map(round, (xm, ym, xM - xm, yM - ym))))
        # Reconnect the old button press events
        print('[*interact] bbox = %r ' % (bbox,))
        return bbox
    except Exception as ex:
        print('<!!!>')
        print('[*interact] Caught: %s %s' % (type(ex), ex))
        print('[*interact] ANNOTATION selection Failed:')
        print('</!!!>')
        raise
Ejemplo n.º 4
0
def iselect_bbox(ibs, gid, fnum=1,
                 figtitle='Image View - Select ANNOTATION (click two points)',
                 **kwargs):
    #from matplotlib.backend_bases import mplDeprecation
    print('[*interact] select_bbox(gid=%r, fnum=%r)' % (gid, fnum))
    print('[*interact] Define a Rectanglular ANNOTATION by clicking two points.')
    # Show the image
    fig = ih.begin_interaction('select_bbox', fnum)
    fig_presenter.bring_to_front(fig)
    viz.show_image(ibs, gid, **kwargs)
    try:
        viz.draw()
        fig = df2.gcf()
        pts = fig.ginput(2)
        print('[*guitools] ginput(2) = %r' % (pts,))
        [(x1, y1), (x2, y2)] = pts
        xm = min(x1, x2)
        xM = max(x1, x2)
        ym = min(y1, y2)
        yM = max(y1, y2)
        bbox = tuple(map(int, map(round, (xm, ym, xM - xm, yM - ym))))
        # Reconnect the old button press events
        print('[*interact] bbox = %r ' % (bbox,))
        return bbox
    except Exception as ex:
        print('<!!!>')
        print('[*interact] Caught: %s %s' % (type(ex), ex))
        print('[*interact] ANNOTATION selection Failed:')
        print('</!!!>')
        raise
Ejemplo n.º 5
0
 def on_clicked_match(self, aid1, aid2):
     """ HELPER: Executed when a result ANNOTATION is clicked """
     fnum_ = df2.next_fnum()
     qres = self.qaid2_qres[aid1]
     qres.ishow_matches(self.ibs, aid2, fnum=fnum_)
     fig = df2.gcf()
     fig.canvas.draw()
     df2.bring_to_front(fig)
Ejemplo n.º 6
0
 def query_last_feature(self):
     ibs      = self.ibs
     qaid     = self.qaid
     viz.show_nearest_descriptors(ibs, qaid, self.last_fx, df2.next_fnum(),
                                  qreq_=self.qreq_, draw_chip=True)
     fig3 = df2.gcf()
     ih.connect_callback(fig3, 'button_press_event', self.on_click)
     viz.draw()
Ejemplo n.º 7
0
 def on_clicked_match(self, aid1, aid2):
     """ HELPER: Executed when a result ANNOTATION is clicked """
     fnum_ = df2.next_fnum()
     qres = self.qaid2_qres[aid1]
     qres.ishow_matches(self.ibs, aid2, fnum=fnum_)
     fig = df2.gcf()
     fig.canvas.draw()
     df2.bring_to_front(fig)
Ejemplo n.º 8
0
 def query_last_feature(self):
     ibs = self.ibs
     qaid = self.qaid
     viz.show_nearest_descriptors(ibs,
                                  qaid,
                                  self.last_fx,
                                  df2.next_fnum(),
                                  qreq_=self.qreq_,
                                  draw_chip=True)
     fig3 = df2.gcf()
     ih.connect_callback(fig3, 'button_press_event', self.on_click)
     viz.draw()
Ejemplo n.º 9
0
 def query_last_feature():
     viz.show_nearest_descriptors(ibs, qaid, last_state.last_fx, df2.next_fnum())
     fig3 = df2.gcf()
     ih.connect_callback(fig3, 'button_press_event', _click_matches_click)
     df2.update()