Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Remap a single point not working

Detailed description Tried remapping a single point but it does not work but remapping the whole image works fine. I know it is not probably a bug but I am helpless as all previous similar question on https://answers.opencv.org or other forums like SO are still unanswered.

The camMapX and The camMapY were calculated for image of size 1280x960, a point (615, 492) should certainly lie within the image boundaries, but calculated remapped point is way outside the image and it happens for any other point too. What am I missing?

Steps to reproduce

 // This works fine for the whole image Mat
 remap(camImage, camImage, camMapX, camMapY, cv::INTER_LINEAR);

 outputPoint.x = camMapX.at<int>(inputPoints[z].y, inputPoint.x);
 outputPoint.y = camMapY.at<int>(inputPoints[z].y, inputPoint.x);

__android_log_print(ANDROID_LOG_VERBOSE, APPNAME, "in: (%d, %d)  o: (%d, %d)",inputPoints.x, inputPoints.y, outputPoint.x, outputPoint.y);

// Sample output inputPoint: (615, 492) outputPoint: (32244308, 66192352)

Remap a single point not working

Detailed description Tried remapping a single point but it does not work but remapping the whole image works fine. I know it is not probably a bug but I am helpless as all previous similar question on https://answers.opencv.org or other forums like SO are still unanswered.

The camMapX and The camMapY were calculated for image of size 1280x960, a point (615, 492) should certainly lie within the image boundaries, but calculated remapped point is way outside the image and it happens for any other point too. What am I missing?

Steps to reproduce

 // This works fine for the whole image Mat
 remap(camImage, camImage, camMapX, camMapY, cv::INTER_LINEAR);

 outputPoint.x = camMapX.at<int>(inputPoints[z].y, inputPoint.x);
 outputPoint.y = camMapY.at<int>(inputPoints[z].y, inputPoint.x);

__android_log_print(ANDROID_LOG_VERBOSE, APPNAME, "in: (%d, %d)  o: (%d, %d)",inputPoints.x, inputPoints.y, outputPoint.x, outputPoint.y);

// Sample output inputPoint: (615, 492) outputPoint: (32244308, 66192352)

66192352)

Remap a single point not working

Detailed description Tried remapping a single point but it does not work but remapping the whole image works fine. I know it is not probably a bug but I am helpless as all previous similar question on https://answers.opencv.org or other forums like SO are still unanswered.

The camMapX and The camMapY were calculated for image of size 1280x960, a point (615, 492) should certainly lie within the image boundaries, but calculated remapped point is way outside the image and it happens for any other point too. What am I missing?

Steps to reproduce

 // This works fine for the whole image Mat
 remap(camImage, camImage, camMapX, camMapY, cv::INTER_LINEAR);

 outputPoint.x = camMapX.at<int>(inputPoints[z].y, inputPoint.x);
 outputPoint.y = camMapY.at<int>(inputPoints[z].y, inputPoint.x);

__android_log_print(ANDROID_LOG_VERBOSE, APPNAME, "in: (%d, %d)  o: (%d, %d)",inputPoints.x, inputPoints.y, outputPoint.x, outputPoint.y);
// Sample output inputPoint: (615, 492)  outputPoint: (32244308, 66192352)