cv2.estimateRigidTransform with fullAffine=False
up vote
1
down vote
favorite
According to documentation cv2.estimateRigidTransform
have parameter fullAffine
:
fullAffine – If true, the function finds an optimal affine
transformation with no additional restrictions (6 degrees of freedom).
Otherwise, the class of transformations to choose from is limited to
combinations of translation, rotation, and uniform scaling (5 degrees
of freedom).
I don't understand what is meant by 5 degrees of freedom, as I understand translation, rotation, and uniform scaling can be done with 4 variables (some more info here http://nghiaho.com/?p=2208)
- By
uniform scaling
they mean that x and y scale will be the same?
I have tried
print('cv2.__version__', cv2.__version__)
m = cv2.estimateRigidTransform(_prev_pts, _curr_pts, fullAffine=False)
print('m.shape', m.shape)
print('m',m)
Output:
cv2.__version__ 3.4.3
m.shape (2, 3)
m [[ 1.00165841e+00 -2.10742695e-04 4.28874117e+00]
[ 2.10742695e-04 1.00165841e+00 1.23242652e+00]]
Output looks like stated in documentation(4 unique values):
- Another question is how to decompose matrix
m
to rotation, scaling and translation matrices, i.e.m = R*T*S
?
python opencv computer-vision affinetransform
add a comment |
up vote
1
down vote
favorite
According to documentation cv2.estimateRigidTransform
have parameter fullAffine
:
fullAffine – If true, the function finds an optimal affine
transformation with no additional restrictions (6 degrees of freedom).
Otherwise, the class of transformations to choose from is limited to
combinations of translation, rotation, and uniform scaling (5 degrees
of freedom).
I don't understand what is meant by 5 degrees of freedom, as I understand translation, rotation, and uniform scaling can be done with 4 variables (some more info here http://nghiaho.com/?p=2208)
- By
uniform scaling
they mean that x and y scale will be the same?
I have tried
print('cv2.__version__', cv2.__version__)
m = cv2.estimateRigidTransform(_prev_pts, _curr_pts, fullAffine=False)
print('m.shape', m.shape)
print('m',m)
Output:
cv2.__version__ 3.4.3
m.shape (2, 3)
m [[ 1.00165841e+00 -2.10742695e-04 4.28874117e+00]
[ 2.10742695e-04 1.00165841e+00 1.23242652e+00]]
Output looks like stated in documentation(4 unique values):
- Another question is how to decompose matrix
m
to rotation, scaling and translation matrices, i.e.m = R*T*S
?
python opencv computer-vision affinetransform
I too think it should be only 4 dof. Decomposition dhould be: angle = asin(a12), scale=a11/cos(angle) and translation = (b1,b2) not sure whether angle is missing a factor -1 though...
– Micka
Nov 10 at 17:43
1
Actually in code there is4 degrees of freedom
github.com/opencv/opencv/blob/… github.com/opencv/opencv/blob/… , so this is a mistake in documentation.
– mrgloom
yesterday
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
According to documentation cv2.estimateRigidTransform
have parameter fullAffine
:
fullAffine – If true, the function finds an optimal affine
transformation with no additional restrictions (6 degrees of freedom).
Otherwise, the class of transformations to choose from is limited to
combinations of translation, rotation, and uniform scaling (5 degrees
of freedom).
I don't understand what is meant by 5 degrees of freedom, as I understand translation, rotation, and uniform scaling can be done with 4 variables (some more info here http://nghiaho.com/?p=2208)
- By
uniform scaling
they mean that x and y scale will be the same?
I have tried
print('cv2.__version__', cv2.__version__)
m = cv2.estimateRigidTransform(_prev_pts, _curr_pts, fullAffine=False)
print('m.shape', m.shape)
print('m',m)
Output:
cv2.__version__ 3.4.3
m.shape (2, 3)
m [[ 1.00165841e+00 -2.10742695e-04 4.28874117e+00]
[ 2.10742695e-04 1.00165841e+00 1.23242652e+00]]
Output looks like stated in documentation(4 unique values):
- Another question is how to decompose matrix
m
to rotation, scaling and translation matrices, i.e.m = R*T*S
?
python opencv computer-vision affinetransform
According to documentation cv2.estimateRigidTransform
have parameter fullAffine
:
fullAffine – If true, the function finds an optimal affine
transformation with no additional restrictions (6 degrees of freedom).
Otherwise, the class of transformations to choose from is limited to
combinations of translation, rotation, and uniform scaling (5 degrees
of freedom).
I don't understand what is meant by 5 degrees of freedom, as I understand translation, rotation, and uniform scaling can be done with 4 variables (some more info here http://nghiaho.com/?p=2208)
- By
uniform scaling
they mean that x and y scale will be the same?
I have tried
print('cv2.__version__', cv2.__version__)
m = cv2.estimateRigidTransform(_prev_pts, _curr_pts, fullAffine=False)
print('m.shape', m.shape)
print('m',m)
Output:
cv2.__version__ 3.4.3
m.shape (2, 3)
m [[ 1.00165841e+00 -2.10742695e-04 4.28874117e+00]
[ 2.10742695e-04 1.00165841e+00 1.23242652e+00]]
Output looks like stated in documentation(4 unique values):
- Another question is how to decompose matrix
m
to rotation, scaling and translation matrices, i.e.m = R*T*S
?
python opencv computer-vision affinetransform
python opencv computer-vision affinetransform
asked Nov 10 at 14:52
mrgloom
4,861954122
4,861954122
I too think it should be only 4 dof. Decomposition dhould be: angle = asin(a12), scale=a11/cos(angle) and translation = (b1,b2) not sure whether angle is missing a factor -1 though...
– Micka
Nov 10 at 17:43
1
Actually in code there is4 degrees of freedom
github.com/opencv/opencv/blob/… github.com/opencv/opencv/blob/… , so this is a mistake in documentation.
– mrgloom
yesterday
add a comment |
I too think it should be only 4 dof. Decomposition dhould be: angle = asin(a12), scale=a11/cos(angle) and translation = (b1,b2) not sure whether angle is missing a factor -1 though...
– Micka
Nov 10 at 17:43
1
Actually in code there is4 degrees of freedom
github.com/opencv/opencv/blob/… github.com/opencv/opencv/blob/… , so this is a mistake in documentation.
– mrgloom
yesterday
I too think it should be only 4 dof. Decomposition dhould be: angle = asin(a12), scale=a11/cos(angle) and translation = (b1,b2) not sure whether angle is missing a factor -1 though...
– Micka
Nov 10 at 17:43
I too think it should be only 4 dof. Decomposition dhould be: angle = asin(a12), scale=a11/cos(angle) and translation = (b1,b2) not sure whether angle is missing a factor -1 though...
– Micka
Nov 10 at 17:43
1
1
Actually in code there is
4 degrees of freedom
github.com/opencv/opencv/blob/… github.com/opencv/opencv/blob/… , so this is a mistake in documentation.– mrgloom
yesterday
Actually in code there is
4 degrees of freedom
github.com/opencv/opencv/blob/… github.com/opencv/opencv/blob/… , so this is a mistake in documentation.– mrgloom
yesterday
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53240123%2fcv2-estimaterigidtransform-with-fullaffine-false%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I too think it should be only 4 dof. Decomposition dhould be: angle = asin(a12), scale=a11/cos(angle) and translation = (b1,b2) not sure whether angle is missing a factor -1 though...
– Micka
Nov 10 at 17:43
1
Actually in code there is
4 degrees of freedom
github.com/opencv/opencv/blob/… github.com/opencv/opencv/blob/… , so this is a mistake in documentation.– mrgloom
yesterday