Open loslu opened 7 years ago
MapperGradShift
tries to estimate only translation. It can't handle rotation and scale transform.
Try MapperGradAffine
instead.
I've tried to reproduce the issue using samples/reg_shift.py
. This sample does the same as testShift()
.
Output is OK for the both images:
[[ 5.01191182]
[ 4.99011373]]
and
[[ 4.98007132]
[ 4.98344032]]
Probably you need to convert images into floating-point format before run mappers.
The MapperGradShift seems only to work for offsets up to 13 pixels. If the shift variable is set to 14,14 in testShift, output is --- Testing shift mapper --- [14; 14] [11.19182019401037; 13.36567527138815] When the offset is increased, results become even worse. Is this a known restriction of the method or a bug?
Could you help to answer this question?
System information
Detailed description
When I run the function "testShift" in "reg/test/test_reg.cpp", I got a very poor result and it does not pass the test. I have tried many different images but it just cannot get the expected result. I give some of the image which I used for this test.
Steps to reproduce
The function can be found in line 79~105 in "opencv_contrib/modules/reg/test/test_reg.cpp" `
`