私は、翻訳と回転によって1つのイメージを他のイメージに変換することによって一致させる必要のある2つのイメージを持っています。これのために、私はこのような関数を持っています:fminuncの初期ステップを調整する方法は?
function [differences] = cost_function(transformation)
disp(transformation);
offset_x = transformation(1); % one of the images will be shifted by these many
offset_y = transformation(2); % pixels in either direction
angle = transformation(3); % and rotated by this much
% snip:
% * transform the second image
% * otsu treshold both
% * xor the results
% * count pixels that xored
次に私はその最小値を見つけようとします!
1.0e-007 *
0.1490 0 0
1.0e-007 *
0 0.1490 0
1.0e-007 *
0 0 0.1490
0 0 1
0.0000 0 1.0000
0 0.0000 1.0000
0 0 1.0000
0 0 0.3333
0.0000 0 0.3333
ソルバがで続行するのが最善の行を見つけるために、各次元でほんの少し微調整しようとしますが、明らかに画像をシフト:
best_transform = fminunc(@cost_function, [0 0 0]);
しかし、ソルバーログは非常に大きな問題を示しています0.1490ピクセルで実際にはあまり効果がありませんが、0.1490ラジアンでそれをシフトするのは当然です。しかし、実際には0.1490がどこから来たのか分かりません。
The documentationここではアドバイスをしていないようです。ソルバーの初期ステップをどのように増やすことができますか?