pygoturn icon indicating copy to clipboard operation
pygoturn copied to clipboard

bounding box recenter and uncenter?

Open davinca opened this issue 5 years ago • 1 comments

    def uncenter(self, raw_image, search_location, edge_spacing_x, edge_spacing_y):
        self.x1 = max(0.0, self.x1 + search_location.x1 - edge_spacing_x)
        self.y1 = max(0.0, self.y1 + search_location.y1 - edge_spacing_y)
        self.x2 = min(raw_image.shape[1], self.x2 + search_location.x1 - edge_spacing_x)
        self.y2 = min(raw_image.shape[0], self.y2 + search_location.y1 - edge_spacing_y)

    def recenter(self, search_loc, edge_spacing_x, edge_spacing_y, bbox_gt_recentered):
        bbox_gt_recentered.x1 = self.x1 - search_loc.x1 + edge_spacing_x
        bbox_gt_recentered.y1 = self.y1 - search_loc.y1 + edge_spacing_y
        bbox_gt_recentered.x2 = self.x2 - search_loc.x1 + edge_spacing_x
        bbox_gt_recentered.y2 = self.y2 - search_loc.y1 + edge_spacing_y

as aforemention, I dont understand the meaning of recenter and uncenter operation?

davinca avatar Nov 30 '19 12:11 davinca

I guess that the output's coordinates is relative the top left of search region, so it should convert to correct one that relative the top left of the whole image

davinca avatar Nov 30 '19 13:11 davinca