New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am unable to run the command detail_ImageFeatures().descriptors in Python #16401
Comments
Please clarify what are you trying to do? What is expected result? |
I am not aiming to do something,but why is my code not working? I was just trying out these data members present in this documentation: https://docs.opencv.org/3.4/d4/db5/structcv_1_1detail_1_1ImageFeatures.html#details |
Hi, |
|
@czgdp1807 Not in the Python2 lib. In Python3, yes. You will see the key when you import cv2 in Python3 interpreter. For OP, it seems the underlying issue is that accessing the
I don't use Stitching module, and I don't use the Python API, but it seems to me I should get an empty numpy array or None type instead of segfault. I'm running a Ubuntu 18.04 on a VM with no GPU. Still, an unset UMat attribute should return None even if no reliance on OpenCL. I wonder if all UMat's members in structs accessed through Python3 api cause such segfaults. |
Any leads on this? I am trying to transfer information from features detected by SIFT into a detail_ImageFeatures object. |
I am also seeing a segfault when I try to access the descriptors. Are there any updates on this? |
related: #20979 hmm it generates code like this:
but i cant find |
This is a little hack to create an empty cv2.detail_ImageFeatures and access its descriptors image_features = cv2.detail.computeImageFeatures2(
cv2.SIFT_create(),
np.zeros_like((0, 0), dtype=np.uint8),
np.zeros_like((0, 0), dtype=np.uint8),
)
image_features.descriptors # of type cv2.UMat
# update descriptors:
# image_features.descriptors = cv2.UMat(some numpy array) After that, you can also update |
System Version(Information)
Detailed Description
I am unable to access a public data member of cv::detail::ImageFeatures::descriptors. When i run this command:
import cv2 obj_Umat=cv2.detail_ImageFeatures().descriptors
The command
cv2.detail_ImageFeatures().descriptors
returns a UMat object.My interpreter then gives me a response that :
The kernel appears to have died
The text was updated successfully, but these errors were encountered: