Closed eli-osherovich closed 3 years ago
Could we add a test to be sure that the matrix is rightly centered?
@Dref360 Do you mean a unit test or the way to know wether + or - is correct?
Here is a simple example:
img = np.expand_dims(np.array([[0, 1], [0, 0]]), -1)
tf.keras.preprocessing.image.apply_affine_transform(img, theta=90)
array([[[0],
[0]],
[[0],
[0]]])
Yes so that if we modify this portion of the code again, we won't merge the same bug.
Added a unit test.
P. S. There are two existing tests that seem to fail. These should be fixed in a separate PR.
Matrix center was set incorrectly (one off). To correct either call transform_matrix_offset_center() with h-1 ,w-1. Or fix the sign inside that function and continue using h and w (more intuitive).
Summary
Related Issues
PR Overview