cv2.estimateRigidTransform with fullAffine=False
up vote
0
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
0
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
add a comment |
up vote
0
down vote
favorite
up vote
0
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,848954122
4,848954122
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
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
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
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
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
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
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
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
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