Skip to content

fourierDescriptor(): Assertion failed fourier_descriptors.cpp, line 214 #87

@reinvantveer

Description

@reinvantveer

Expected behaviour

Return some sequence of fourier descriptors from input values, hopefully from a rank 2 numpy array. Many thanks for any pointers, help greatly appreciated!

Actual behaviour

It throws {error}/io/opencv_contrib/modules/ximgproc/src/fourier_descriptors.cpp:214: error: (-215) _src.empty() || (_src.channels() == 2 && (_src.depth() == 4 || _src.depth() == 5 || _src.depth() == 6)) in function fourierDescriptor

It's unclear how to use this function, I can't find documentation on its intended use. I suspect it has something to do with _src.channels() and _src.depth() but how to leverage these...?

Steps to reproduce

On ubuntu 16.04:
pip3 install opencv-contrib-python
opencv-contrib-python in ./venv/lib/python3.5/site-packages (3.4.0.12)

from cv2.ximgproc import fourierDescriptor

  • Feeding some dummy values:
    fourierDescriptor([12, 11])
    {TypeError}src is not a numpy array, neither a scalar
    Fair enough...

  • Feeding a scalar:
    fourierDescriptor(12)
    {error}/io/opencv_contrib/modules/ximgproc/src/fourier_descriptors.cpp:214: error: (-215) _src.empty() || (_src.channels() == 2 && (_src.depth() == 4 || _src.depth() == 5 || _src.depth() == 6)) in function fourierDescriptor

  • Feeding a rank 1 numpy array:
    fourierDescriptor(np.array([12]))
    {error}/io/opencv_contrib/modules/ximgproc/src/fourier_descriptors.cpp:214: error: (-215) _src.empty() || (_src.channels() == 2 && (_src.depth() == 4 || _src.depth() == 5 || _src.depth() == 6)) in function fourierDescriptor

  • Feeding a rank 2 numpy array:
    fourierDescriptor(np.array([[12, 11], [10, 9]]))
    {error}/io/opencv_contrib/modules/ximgproc/src/fourier_descriptors.cpp:214: error: (-215) _src.empty() || (_src.channels() == 2 && (_src.depth() == 4 || _src.depth() == 5 || _src.depth() == 6)) in function fourierDescriptor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions