Ask Your Question
1

SHRT_MAX in cv2.remap()

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

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
1

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

berak gravatar image

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

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
Login/Signup to Answer

Question Tools

1 follower

Stats

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

Seen: 543 times

Last updated: Nov 24 '18