射影変換に関する質問があります。画像内の線関数がわかっているax+by+c=0
とします。画像は射影歪みを通過し、歪みは射影変換行列 として表すことができます。
次に、射影変換の後、新しい歪んだ画像の線関数をどのように知ることができますか? ありがとう!
**編集** 提案に基づいて、答えを見つけました。ここでは、それを説明するために 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);
2行の元の画像:
射影歪みの後、線のある出力画像は次のようになります。