You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use the Tracker classes from Python on Windows, and it seems that in Python the only way to access algorithm parameters is by writing/reading the Tracker object to/from a .yaml file. When I try Tracker.write(), I get a cv2.error. Here is my test case:
When I tried this (Python 3.7.6, OpenCV 4.2.0… with prepackaged binaries, or when rebuilt from source code), it failed on the tracker.write(fs) line with this message:
Traceback (most recent call last): File "<stdin>", line 1, in <module> cv2.error: OpenCV(4.2.0) C:\Users\dick\OpenCV\opencv-4.2.0\modules\core\src\matrix_wrap.cpp:112: error: (-213:The function/feature is not implemented) You should explicitly call mapHost/unmapHost methods for ogl::Buffer object in function 'cv::_InputArray::getMat_'
On a slightly different test, I got this error message:
Traceback (most recent call last): File "<stdin>", line 5, in <module> cv2.error: OpenCV(4.2.0) C:\Users\dick\OpenCV\opencv-4.2.0\modules\core\src\matrix_wrap.cpp:130: error: (-213:The function/feature is not implemented) Unknown/unsupported array type in function 'cv::_InputArray::getMat_'
I have a friend who is more C++/Linux/Visual Studio savvy than I am, and she confirmed for me that this tracker.write() works fine on Linux, writing a .yaml file, as does using tracker.read() to read it back as follows:
#Read in the settingsfs_settings=cv2.FileStorage(settings_file,cv2.FILE_STORAGE_READ)
tracker.read(fs_settings.root())
#Release filefs_settings.release()
When I try tracker.read() with a known-good .yaml file, Python crashes straight to the command prompt—no error message at all. I guess this is a closely related issue.
My friend's assessment was "As far as I can tell, in Windows the Mat object being created is the wrong datatype (whether is it has an extra dimension or wrong type (i.e. float vs int) or it's an empty null pointer).", and I've imposed on her time quite enough to this point. Could someone please look into the C++ code to see what's going wrong, and perhaps why it works on Linux but not Windows?
In looking around for similar issues, I thought that #2393 looked somewhat familiar, where the Mat class wasn't behaving as expected.
[Note: This is my first time opening an issue, I'm not fluent in C++ or using VS (I got a lot of help to do the recompiling!), and I'm still learning Python—I hope the OpenCV team will support Python end-users like me to access tracking algorithm parameters, even if they have no option but Windows. :-) Thank you.]
The text was updated successfully, but these errors were encountered:
Hey, I just solved this problem by downgrading to opencv-contrib-python version 3.3.0.9. Dropping link to my StackOverflow answer for further information. Overall, here is the log of versions that pass/fail with this bug:
System information (version)
Detailed description
I would like to use the Tracker classes from Python on Windows, and it seems that in Python the only way to access algorithm parameters is by writing/reading the Tracker object to/from a .yaml file. When I try
Tracker.write()
, I get a cv2.error. Here is my test case:Steps to reproduce
When I tried this (Python 3.7.6, OpenCV 4.2.0… with prepackaged binaries, or when rebuilt from source code), it failed on the
tracker.write(fs)
line with this message:Traceback (most recent call last): File "<stdin>", line 1, in <module> cv2.error: OpenCV(4.2.0) C:\Users\dick\OpenCV\opencv-4.2.0\modules\core\src\matrix_wrap.cpp:112: error: (-213:The function/feature is not implemented) You should explicitly call mapHost/unmapHost methods for ogl::Buffer object in function 'cv::_InputArray::getMat_'
On a slightly different test, I got this error message:
Traceback (most recent call last): File "<stdin>", line 5, in <module> cv2.error: OpenCV(4.2.0) C:\Users\dick\OpenCV\opencv-4.2.0\modules\core\src\matrix_wrap.cpp:130: error: (-213:The function/feature is not implemented) Unknown/unsupported array type in function 'cv::_InputArray::getMat_'
I have a friend who is more C++/Linux/Visual Studio savvy than I am, and she confirmed for me that this
tracker.write()
works fine on Linux, writing a.yaml
file, as does usingtracker.read()
to read it back as follows:When I try
tracker.read()
with a known-good.yaml
file, Python crashes straight to the command prompt—no error message at all. I guess this is a closely related issue.My friend's assessment was "As far as I can tell, in Windows the Mat object being created is the wrong datatype (whether is it has an extra dimension or wrong type (i.e. float vs int) or it's an empty null pointer).", and I've imposed on her time quite enough to this point. Could someone please look into the C++ code to see what's going wrong, and perhaps why it works on Linux but not Windows?
In looking around for similar issues, I thought that #2393 looked somewhat familiar, where the Mat class wasn't behaving as expected.
[Note: This is my first time opening an issue, I'm not fluent in C++ or using VS (I got a lot of help to do the recompiling!), and I'm still learning Python—I hope the OpenCV team will support Python end-users like me to access tracking algorithm parameters, even if they have no option but Windows. :-) Thank you.]
The text was updated successfully, but these errors were encountered: