Ejemplo n.º 1
0
    def _draw_targets(self, src, targets, dim):
        '''
            draw a crosshairs indicator
        '''

        wh = get_size(src)
        for ta in targets:
            pt = new_point(*ta.centroid)
            self._draw_indicator(src,
                                 pt,
                                 color=(0, 255, 0),
                                 size=10,
                                 shape='crosshairs')
            draw_circle(
                src,
                pt,
                radius=int(dim)
                #                         color=color,
                #                         thickness=1
            )
            #             im = zeros(wh)
            #             points = asarray(ta.poly_points)
            #
            #             rr, cc = polygon(*points.T)
            #             im[cc, rr] = 255
            #
            #             cx, cy = center_of_mass(im)
            #             pt = new_point(cy, cx)
            #             self._draw_indicator(pychron, pt,
            #                                  color=(0, 255, 255),
            #                                  size=10,
            #                                  shape='crosshairs')
            draw_polygons(src, [ta.poly_points])
Ejemplo n.º 2
0
    def _draw_targets(self, src, targets, dim):
        '''
            draw a crosshairs indicator
        '''

        wh = get_size(src)
        for ta in targets:
            pt = new_point(*ta.centroid)
            self._draw_indicator(src, pt,
                                 color=(0, 255, 0),
                                 size=10,
                                 shape='crosshairs')
            draw_circle(src, pt,
                        radius=int(dim)
#                         color=color,
#                         thickness=1
                        )
#             im = zeros(wh)
#             points = asarray(ta.poly_points)
#
#             rr, cc = polygon(*points.T)
#             im[cc, rr] = 255
#
#             cx, cy = center_of_mass(im)
#             pt = new_point(cy, cx)
#             self._draw_indicator(pychron, pt,
#                                  color=(0, 255, 255),
#                                  size=10,
#                                  shape='crosshairs')
            draw_polygons(src, [ta.poly_points])
Ejemplo n.º 3
0
    def _draw_targets(self, src, targets, dim):
        """
            draw a crosshairs indicator
        """

        for ta in targets:
            pt = new_point(*ta.centroid)
            self._draw_indicator(src, pt,
                                 color=(0, 255, 0),
                                 size=10,
                                 shape='crosshairs')
            # draw_circle(src, pt,
            #             color=(0,255,0),
            #             radius=int(dim))

            draw_polygons(src, [ta.poly_points], color=(255, 255, 255))
Ejemplo n.º 4
0
    def _draw_targets(self, src, targets):
        """
            draw a crosshairs indicator
        """
        if targets:
            for ta in targets:
                pt = new_point(*ta.centroid)
                self._draw_indicator(src,
                                     pt,
                                     color=(0, 255, 0),
                                     size=10,
                                     shape='crosshairs')
                # draw_circle(src, pt,
                #             color=(0,255,0),
                #             radius=int(dim))

                draw_polygons(src, [ta.poly_points], color=(255, 255, 255))