Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about find_none_flectives_similarity #15

Open
lzg188 opened this issue Apr 17, 2018 · 1 comment
Open

about find_none_flectives_similarity #15

lzg188 opened this issue Apr 17, 2018 · 1 comment

Comments

@lzg188
Copy link

lzg188 commented Apr 17, 2018

thanks for your shared code, it is very good
but about this function named find_none_flectives_similarity i can not understand well.
like this code:
xy(Rect(1, 0, 1, xy.rows)).copyTo(A(Rect(0, xy.rows, 1, xy.rows)));//y
(xy(Rect(0, 0, 1, xy.rows))).copyTo(A(Rect(1, xy.rows, 1, xy.rows)));//-x
A(Rect(1, xy.rows, 1, xy.rows)) *= -1;
A(Rect(3, xy.rows, 1, xy.rows)).setTo(1.);
what are you going to do with adding the -x to matrix A, and why to inv the matrix trans_inv?
can you give me some explanation with that?
waiting for you replay!!!

@chinazy95
Copy link

  1. what are you going to do with adding the -x to matrix A
    You should learn the meaning of "find_none_flectives_similarity". It means only considerate about rotation, scale(same as x and y), and translation.
    % Try varying these 4 parameters.
    scale = 1.2; % scale factor
    angle = 40*pi/180; % rotation angle
    tx = 0; % x translation
    ty = 0; % y translation

sc = scalecos(angle);
ss = scale
sin(angle);

T = [ sc -ss 0;
ss sc 0;
tx ty 1];
so the transormed function worked:
X = ax+by+c
Y = -bx+ay+d

  1. why to inv the matrix trans_inv?
    trans = find_similarity(src, dst);
    trans1 =find_none_flectives_similarity(uv, xy); //uv is src,xy is dst
    cv::solve(A, b, x, cv::DECOMP_SVD); //A is dst, b is uv
    so the result is dst to src. We are figuring out the src to dst, so it should be inverted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants