opencv_contrib icon indicating copy to clipboard operation
opencv_contrib copied to clipboard

It seems that a wrong variant name used in img_hash/src/radial_variance_hash.cpp:afterHalfProjections().

Open EliteWeapon opened this issue 3 years ago • 0 comments

System information (version)
  • OpenCV => 4.5.5
  • Operating System / Platform => Windows 64 Bit
  • Compiler => Visual Studio 2015
Detailed description

In img_hash/src/radial_variance_hash.cpp:afterHalfProjections(), there are some codes as:

for(int x = 0; x < D; ++x) { float const y = alpha*(x-xOff); int const yd = static_cast(std::floor(y + roundingFactor(y))); if((yd + yOff >= 0)&&(yd + yOff < input.rows) && (x < input.cols)) { projDown[x] = input.at(yd+yOff, x); pplPtr[k] += 1; } if ((yOff - yd >= 0)&&(yOff - yd < input.cols)&& (2yOff - x >= 0)&&(2yOff- x < input.rows)&& (k != init)) { projUp[x] = input.at(-(x-yOff)+yOff, -yd+yOff); pplPtr[k-j] += 1; } }

The bold and italic variant "yOff" seems wrong? And should it be "xOff"?

Steps to reproduce
Issue submission checklist
  • [ ] I report the issue, it's not a question
  • [ ] I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • [x] I updated to the latest OpenCV version and the issue is still there
  • [ ] There is reproducer code and related data files: videos, images, onnx, etc

EliteWeapon avatar May 11 '22 11:05 EliteWeapon