          rotated_width = int(height*abs_sin + width*abs_cos)
          rotated_height = int(height*abs_cos + width*abs_sin)
          r_mat[0, 2] += rotated_width/2 - center[0]
          r_mat[1, 2] += rotated_height/2 - center[1]
  
          return r_mat
 
</s> remove def rotate_image_by_angle(image, angle,
                          rotated_width=None, rotated_height=None):
    """ Rotate an image by a given angle.
        From: https://stackoverflow.com/questions/22041699 """

    height, width = image.shape[:2]
    image_center = (width/2, height/2)
    rotation_matrix = cv2.getRotationMatrix2D(  # pylint: disable=no-member
        image_center, -1.*angle, 1.)
    if rotated_width is None or rotated_height is None:
        abs_cos = abs(rotation_matrix[0, 0])
        abs_sin = abs(rotation_matrix[0, 1])
        if rotated_width is None:
            rotated_width = int(height*abs_sin + width*abs_cos)
        if rotated_height is None:
            rotated_height = int(height*abs_cos + width*abs_sin)
    rotation_matrix[0, 2] += rotated_width/2 - image_center[0]
    rotation_matrix[1, 2] += rotated_height/2 - image_center[1]
    return (cv2.warpAffine(image,  # pylint: disable=no-member
                           rotation_matrix,
                           (rotated_width, rotated_height)),
            rotation_matrix)


 </s> add  </s> remove             mat[:,2] += padding
 </s> add             mat[:, 2] += padding
 </s> remove         return np.matmul(eye, pnt)[0:2]
 </s> add         retval = np.matmul(eye, pnt)[0:2]
        logger.trace("Transformed Points: %s", retval)
        return retval
        logger.trace("Returning rotation matrix: %s", r_mat)
          rotated_width = int(height*abs_sin + width*abs_cos)
          rotated_height = int(height*abs_cos + width*abs_sin)
          r_mat[0, 2] += rotated_width/2 - center[0]
          r_mat[1, 2] += rotated_height/2 - center[1]
        logger.trace("Returning rotation matrix: %s", r_mat)
          return r_mat
keep keep keep keep replace keep
 Logging (#541)

* Convert prints to logger. Further logging improvements. Tidy  up

* Fix system verbosity. Allow SystemExit

* Fix reload extract bug

* Child Traceback handling

* Safer shutdown procedure

* Add shutdown event to queue manager

* landmarks_as_xy > property. GUI notes + linting. Aligner bugfix

* fix FaceFilter. Enable nFilter when no Filter is supplied

* Fix blurry face filter

* Continue on IO error. Better error handling

* Explicitly print stack trace tocrash log

* Windows Multiprocessing bugfix

* Add git info and conda version to crash log

* Windows/Anaconda mp bugfix

* Logging fixes for training 
lib/alignments.py