Permalink
Browse files

fix

  • Loading branch information...
iperov committed Feb 10, 2019
1 parent 0866b2c commit e5995630fc02a93d479b258b894f3b6075883e09
Showing with 7 additions and 7 deletions.
  1. +7 −7 mainscripts/Extractor.py
@@ -364,16 +364,16 @@ def onHostResult (self, host_dict, data, result):
view_rect = (np.array(self.rect) * self.view_scale).astype(np.int).tolist()
view_landmarks = (np.array(self.landmarks) * self.view_scale).astype(np.int).tolist()

if self.param_rect_size <= 40:
if self.param_rect_size <= 25:
scaled_rect_size = h // 3 if w > h else w // 3

p1 = (self.param_x - self.param_rect_size // 2, self.param_y - self.param_rect_size // 2)
p2 = (self.param_x + self.param_rect_size // 2, self.param_y - self.param_rect_size // 2)
p3 = (self.param_x - self.param_rect_size // 2, self.param_y + self.param_rect_size // 2)
p1 = (self.param_x - self.param_rect_size, self.param_y - self.param_rect_size)
p2 = (self.param_x + self.param_rect_size, self.param_y - self.param_rect_size)
p3 = (self.param_x - self.param_rect_size, self.param_y + self.param_rect_size)

np1 = (self.param_x - scaled_rect_size // 2, self.param_y - scaled_rect_size // 2)
np2 = (self.param_x + scaled_rect_size // 2, self.param_y - scaled_rect_size // 2)
np3 = (self.param_x - scaled_rect_size // 2, self.param_y + scaled_rect_size // 2)
np1 = (self.param_x - scaled_rect_size, self.param_y - scaled_rect_size)
np2 = (self.param_x + scaled_rect_size, self.param_y - scaled_rect_size)
np3 = (self.param_x - scaled_rect_size, self.param_y + scaled_rect_size)

mat = cv2.getAffineTransform( np.float32([p1,p2,p3])*self.view_scale, np.float32([np1,np2,np3])*self.view_scale )
image = cv2.warpAffine(image, mat,(w,h) )

0 comments on commit e599563

Please sign in to comment.