修正亚像素调整中的一个错误

This commit is contained in:
jerryzeng 2025-08-24 20:47:33 +08:00
parent 18c5ec1c11
commit d80e48fb65
2 changed files with 2 additions and 2 deletions

View File

@ -504,7 +504,7 @@ int main()
sprintf_s(filename, "%slaser_rotate_enlarge_%03d_subpixData.txt", calibDataPath[grp], index);
saveSubpixData(filename, pts2d);
}
for (int i = 0, i_max = pts2d.size(); i < i_max; i++)
for (int i = 0, i_max = (int)pts2d.size(); i < i_max; i++)
{
cv::Point2f a_subPix = pts2d[i];
int row = (int)(a_subPix.y + 0.5);

View File

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