Ask Your Question

SHRT_MAX in cv2.remap()

asked 2018-11-21 15:18:23 -0600

markemus gravatar image

I'm trying to apply a map to a very large image (114688, 89600) and got the following exception:

cv2.error: OpenCV(3.4.3) /io/opencv/modules/core/src/parallel.cpp:240: error: (-2:Unspecified error) in function 'finalize'
> Exception in parallel_for() body: OpenCV(3.4.3) /io/opencv/modules/imgproc/src/imgwarp.cpp:1729: error: (-215:Assertion failed) dst.cols < SHRT_MAX && dst.rows < SHRT_MAX && src.cols < SHRT_MAX && src.rows < SHRT_MAX in function 'remap'

What's the maximum size allowed for remap()? I grepped the source code for SHRT_MAX but couldn't find the definition.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-11-21 17:38:06 -0600

berak gravatar image

updated 2018-11-24 01:16:03 -0600

SHRT_MAX == 32767

for an image that large, you will have to use float coords for the mapping.

(if the error comes from opencv's builtin warpXXX functions, -- bad luck then, you're stuck with that limit for the image size)

edit flag offensive delete link more


I checked my images,no image width or hight exceed 32767,so how to slove this problem

zxylucky gravatar imagezxylucky ( 2020-06-07 21:46:17 -0600 )edit

Question Tools

1 follower


Asked: 2018-11-21 15:18:23 -0600

Seen: 5,831 times

Last updated: Nov 24 '18