Skip to content

Commit 0b7503e

Browse files
committed
Update docs based on PR #99 changes
1 parent cea2b14 commit 0b7503e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,10 @@ rotate: x,y,theta -> (x*cos(theta)-x*sin(theta), y*cos(theta), x*sin(theta))
145145
```
146146

147147
#### Rotation applied on img2
148-
We consider the angle `theta` small enough to linearize `cos(theta)` to 1 and `sin(theta)` to `theta` .
148+
Let us consider a rotation by the angle `theta` from the image center.
149149

150-
x flow map ( `flow[:,:,0]` ) will get a shift proportional to distance from center horizontal axis `j-h/2`
151-
152-
y flow map ( `flow[:,:,1]` ) will get a shift proportional to distance from center vertical axis `i-w/2`
150+
We must tranform each flow vector based on the coordinates where it lands. On each coordinate `(i, j)`, we have:
153151
```
154-
\for_all i,j flow[i,j] += theta*(j-h/2), theta*(i-w/2)
152+
flow[i, j, 0] += (cos(theta) - 1) * (i - w/2 + flow[i, j, 0]) + sin(theta) * (j - h/2 + flow[flow[i, j, 1])
153+
flow[i, j, 1] += -sin(theta) * (i - w/2 + flow[i, j, 0]) + (cos(theta) - 1) * (j - h/2 + flow[flow[i, j, 1])
155154
```

flow_transforms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class RandomRotate(object):
167167
angle: max angle of the rotation
168168
interpolation order: Default: 2 (bilinear)
169169
reshape: Default: false. If set to true, image size will be set to keep every pixel in the image.
170-
diff_angle: Default: 0. Must stay less than 10 degrees, or linear approximation of flowmap will be off.
170+
diff_angle: Default: 0.
171171
"""
172172

173173
def __init__(self, angle, diff_angle=0, order=2, reshape=False):

0 commit comments

Comments
 (0)