mirror of
https://github.com/opencv/opencv.git
synced 2024-11-25 19:50:38 +08:00
Feature based stitching's wave correction bugfix.
When we have similar matrices in input, then algorithm returns matrices with NaN values.
This commit is contained in:
parent
281ce7a054
commit
8a1d3929cc
@ -616,7 +616,14 @@ void waveCorrect(vector<Mat> &rmats, WaveCorrectKind kind)
|
||||
for (size_t i = 0; i < rmats.size(); ++i)
|
||||
img_k += rmats[i].col(2);
|
||||
Mat rg0 = rg1.cross(img_k);
|
||||
rg0 /= norm(rg0);
|
||||
double rg0_norm = norm(rg0);
|
||||
|
||||
if( rg0_norm <= DBL_MIN )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
rg0 /= rg0_norm;
|
||||
|
||||
Mat rg2 = rg0.cross(rg1);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user