"_InputArray::isVector()" with Python data

asked 2020-05-07 04:11:45 -0500

ksenobojca gravatar image

(I believe it's a bug, but maybe I'm missing something)

I'm unable to use sparse-to-dense match interpolation from Python, because I see no way to create data that passes "_InputArray::isVector()" from Python.

Example code:

import cv2
import numpy as np
interpolator = cv2.ximgproc.createRICInterpolator()
# interpolator = cv2.ximgproc.createEdgeAwareInterpolator()

from_image = np.zeros((100, 100), np.uint8)
to_image = np.zeros((100, 100), np.uint8)
from_points = np.zeros((20, 2), np.float32)
to_points = np.zeros((20, 2), np.float32)
dense = interpolator.interpolate(from_image, from_points, to_image, to_points)

should not fail with:

cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv_contrib\modules\ximgproc\src\sparse_match_interpolators.cpp:1105:
    error: (-215:Assertion failed) !from_points.empty() && from_points.isVector()
    in function 'cv::ximgproc::RICInterpolatorImpl::interpolate
edit retag flag offensive close merge delete