我有一個與projective transform有關的問題。假設現在我們知道圖像中的線功能ax+by+c=0
,圖像將經過投影畸變,畸變可以表示爲一個射影變換矩陣:投影變換後的線條函數
然後porjective改造後,如何我可以知道新的失真圖像中的線功能嗎?謝謝!
**編輯** 根據這個建議,我找到了答案。在這裏,我張貼的MATLAB代碼來說明它:
close all;
% Step 1: show the images as well as lines on it
imshow(img);
line = hor_vt{1}.line(1).line; a = line(1); b=line(2); c=line(3);
[row,col] = size(img);
x_range = 1:col;
y_range = -(a*x_range+c)/b;
hold on; plot(x_range,y_range,'r*');
line = hor_vt{1}.line(2).line; a = line(1); b=line(2); c=line(3);
y_range = -(a*x_range+c)/b;
hold on; plot(x_range,y_range,'y*');
% Step 2: show the output distorted image that goes through projective
% distortion.
ma_imshow(output);
[row,col] = size(output);
x_range = 1:col;
line = hor_vt{1}.line(1).line;
line = reverse_tform.tdata.Tinv*line(:); % VERY IMPORT
a = line(1); b=line(2); c=line(3);
y_range = -(a*x_range+c)/b;
hold on; plot(x_range,y_range,'r*');
disp('angle');
disp(atan(-a/b)/pi*180);
line = hor_vt{1}.line(2).line;
line = reverse_tform.tdata.Tinv*line(:); % VERY IMPORT
a = line(1); b=line(2); c=line(3);
y_range = -(a*x_range+c)/b;
hold on; plot(x_range,y_range,'y*');
disp('angle');
disp(atan(-a/b)/pi*180);
兩條線中的原始影像上:
射影distoration後,與在其上線的輸出圖像變爲:
也許這裏最好問這裏http://math.stackexchange.com/ – iabdalkader