imtransform, tracking a projection destination of some pixel
3 ビュー (過去 30 日間)
古いコメントを表示
Hey Guys,
I am doing imtransform, yet it scale the output image automatically,
And I can not find the destination of a specific feature point.
Could you help me out?
Related codes for checking:
[ imgDouble{1}, ybound, xbound ] = imtransform( imgDouble{1}, tform );
Ap = tformfwd( tform, inlier_array );
Ap = mean(Ap);
ApCord = tformfwd( tform, [ [1, 1]; [height, 1]; [1, width]; [height, width] ] );
ApCord = [ min( ApCord ); max( ApCord ) ];
AppH = xbound(2) - xbound(1) + 1;
ApCordH = ApCord( 2, 1 ) - ApCord( 1, 1 ) + 1;
App(1) = ( Ap(1) - ApCord( 1, 1 ) + 1 ) * AppH / ApCordH + xbound(1) - 1;
AppW = ybound(2) - ybound(1) + 1;
ApCordW = ApCord( 2, 2 ) - ApCord( 1, 2 ) + 1;
App(2) = ( Ap(2) - ApCord( 1, 2 ) + 1 ) * AppW / ApCordW + ybound(1) - 1;
B_Location = mean( dest_array );
A_Location = App - [ xbound(1), ybound(1) ] + [1, 1];
offset_AB = A_Location - B_Location + [1, 1];
putative_off_B = offset_AB ;
2 件のコメント
Image Analyst
2013 年 3 月 27 日
You forgot to supply same data so we can help you out. I can't run this snippet of code to even see what's going on.
採用された回答
Alex Taylor
2013 年 3 月 27 日
I cannot tell from your code example what you are trying to accomplish. It's also not clear from your question how the Auto-Scale behavior of imtransform is related to the point mapping problem that you are interested in.
If you are using a version of MATLAB older than R2013a, you can use tformfwd and tforminv to map points by the forward and inverse geometric transformation.
If you are using R2013a and later, you can use the transformPointsForward and transformPointsInverse methods of the geometric transformation classes (e.g. affine2d, projective2d).
If you are using R2013a, you might consider looking at the new function imwarp. It does not use any scaling behavior when determining the output grid size and world limits.
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!