Small improvement for sample stereo_match.cpp (Patch #1936)


Added by Simone Gasparini almost 13 years ago. Updated about 12 years ago.


Status:Done Start date:2012-05-15
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:samples
Target version:2.4.3
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

I think it make sense that when scale != 1 we also multiply the calibration matrix by scale. In the code the images are resized according to scale but then the calibration matrix M1 and M2 are not transformed accordingly.
So in my version I just added the following

1if( scale != 1.f )
2{
3    M1 = scale * M1;
4    M2 = scale * M2;
5}

at around line 193 (anyway after the matrices are read from the calibration file).
With that I get smoother results that are more similar to the case scale = 1.0.
I don't know the details of the dense stereo matching algorithms but this make sense in theory: if u are using, eg, a downsample image then also the calibration matrix is affected.

Hope it helps.

Simone


Associated revisions

Revision a310e2f0
Added by Vadim Pisarevsky over 12 years ago

fixed the case of scale != 1 in stereo_match.cpp (patch #1936)

Revision a0c296fc
Added by Andrey Pavlenko over 11 years ago

Merge pull request #1936 from ElenaGvozdeva:ocl_flip

History

Updated by Simone Gasparini almost 13 years ago

Sorry for the horrible english, I was in a rush. The first line should read:"
I think it makes sense that when scale != 1 we also multiply the calibration matrices by scale.

s.

Updated by Andrey Kamaev almost 13 years ago

  • Target version deleted (2.4.1)
  • Description changed from I think it make sense that when scale != 1 to multiply the calibration matri... to I think it make sense that when @scale != 1@ we also multiply the calibratio... More

Updated by Vadim Pisarevsky over 12 years ago

  • Target version deleted ()

Updated by Vadim Pisarevsky over 12 years ago

thanks! your patch was applied in a310e2f0

  • Status changed from Open to Done
  • Assignee set to Vadim Pisarevsky

Updated by Andrey Kamaev about 12 years ago

  • Target version set to 2.4.3

Also available in: Atom PDF