修正subpix计算中0.5像素差

This commit is contained in:
jerryzeng 2025-08-18 10:19:31 +08:00
parent 34906beb35
commit 513e9d166f

View File

@ -435,6 +435,8 @@ void computePointSubpix(
); );
if ((subpix.x >= 0) && (subpix.y >= 0)) if ((subpix.x >= 0) && (subpix.y >= 0))
{ {
subpix.x += 0.5; //图像中的像素位置表示的是像素是左下角而此处像素坐标是指向像素中间位置所以有0.5像素差
subpix.x -= 0.5; //此处图像的Y坐标系方向与通常坐标系的方向相反
posSubpix.push_back(subpix); posSubpix.push_back(subpix);
doSubPix = -1; doSubPix = -1;
} }