This error occurs when trying to process an image in OpenCV where either the source or destination image dimensions exceed the maximum short integer value (SHRT_MAX, which is typically 32,767).
The problem is likely happening because:
1. The PDF being loaded contains an extremely large image
2. The image is being resized to dimensions that exceed 32,767 pixels in width or height
To fix this issue, you could:
1. Resize the image before processing it with cv::remap
2. Split the large image into smaller chunks for processing
3. Check if there are any settings in DocliningPDFLoader that can limit the maximum image size
4. Update your OpenCV code to handle the large image dimensions properly
If you're using a library like DocliningPDFLoader, you might need to check if there are configuration options to handle large images or set maximum dimensions for loaded images.