Segmentation Fault (Core Dumped) when trying to access cv2.detail_ImageFeatures().descriptors

Dear to whom it may concern,

I am currently trying to populate the class object of cv2.detail_ImageFeatures() and have been successful for all its attributes except for one, which is cv2.detail_ImageFeatures().descriptors. It throws a segmentation fault (core dumped) error in my python script.

Could anyone please help me with this?

Here are the attributes based from the documentation:

class detail_ImageFeatures(builtins.object)
     |  Methods defined here:
     |  __new__(*args, **kwargs) from builtins.type
     |      Create and return a new object.  See help(type) for accurate signature.
     |  __repr__(self, /)
     |      Return repr(self).
     |  getKeypoints(...)
     |      getKeypoints() -> retval
     |      .
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  descriptors
     |      descriptors
     |  img_idx
     |      img_idx
     |  img_size
     |      img_size

Thank you:)

can you show the code snippet you actually used ?


you should not “chain” it like this, rather use:

feats = cv2.detail_ImageFeatures()
descs = feats.descriptors

(the desriptors are a “shallow” copy, you need to keep the owning object alive)

1 Like

Hi berak,

Thank you for your reply!

Below is the code and output snippet:

With reference to the snippets above, I am not able to access the “descriptors” attribute of this particular class.

Thank you.

I am not able to embed more than one image, so here’s the error snippet.


Hi berak, do you have a solution to this?

please post TEXT, not images of it, thank you.
and sorry no, no solution yet :[

Do you think it is an error in the generator for bindings? I think someone had a similar problem with segmentation fault: (Writing Python bindings for C++ code that use OpenCV - Stack Overflow).