Open Source Computer Vision Library https://opencv.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

27 lines
881 B

#include <unordered_map>
#include <string>
#include <bridge>
typedef std::unordered_map Map;
/*! @brief Hash from strings to OpenCV enums
*
* This is a translation map for strings to OpenCV constants (enums).
* When an int is requested from the bridge, and the the mxArray storage
* type is a string, this map is invoked. Thus functions can be called
* from Matlab as, e.g.
* cv.dft(x, xf, "DFT_FORWARD");
*
* Note that an alternative MAtlab class exists as well, so that functions
* can be called as, e.g.
* cv.dft(x, xf, cv.DFT_FORWARD);
*
* This string to int map tends to be faster than its Matlab companion,
* but there is no direct access to the value of the constants. It also
* enables different error reporting properties.
*/
Map<std::string, int> constants = {
{% for key, val in constants.items() %}
{ "{{key}}", {{val}} },
{% endfor %}
};