int main(int argc, const char *argv[]) {
// Get the path to the image, if it was given
// if no arguments were given.
- string filename;
+ String filename;
if (argc > 1) {
- filename = string(argv[1]);
+ filename = String(argv[1]);
}
// The following lines show how to apply a colormap on a given image
// and show it with cv::imshow example with an image. An exception is
virtual void predict(InputArray src, int &label, double &confidence) const = 0;
// Serializes this object to a given filename.
- virtual void save(const string& filename) const;
+ virtual void save(const String& filename) const;
// Deserializes this object from a given filename.
- virtual void load(const string& filename);
+ virtual void load(const String& filename);
// Serializes this object to a given cv::FileStorage.
virtual void save(FileStorage& fs) const = 0;
* So called “virtual constructor”. That is, each Algorithm derivative is registered at program start and you can get the list of registered algorithms and create instance of a particular algorithm by its name (see :ocv:func:`Algorithm::create`). If you plan to add your own algorithms, it is good practice to add a unique prefix to your algorithms to distinguish them from other algorithms.
-* Setting/Retrieving algorithm parameters by name. If you used video capturing functionality from OpenCV highgui module, you are probably familar with :ocv:cfunc:`cvSetCaptureProperty`, :ocv:cfunc:`cvGetCaptureProperty`, :ocv:func:`VideoCapture::set` and :ocv:func:`VideoCapture::get`. :ocv:class:`Algorithm` provides similar method where instead of integer id's you specify the parameter names as text strings. See :ocv:func:`Algorithm::set` and :ocv:func:`Algorithm::get` for details.
+* Setting/Retrieving algorithm parameters by name. If you used video capturing functionality from OpenCV highgui module, you are probably familar with :ocv:cfunc:`cvSetCaptureProperty`, :ocv:cfunc:`cvGetCaptureProperty`, :ocv:func:`VideoCapture::set` and :ocv:func:`VideoCapture::get`. :ocv:class:`Algorithm` provides similar method where instead of integer id's you specify the parameter names as text Strings. See :ocv:func:`Algorithm::set` and :ocv:func:`Algorithm::get` for details.
* Reading and writing parameters from/to XML or YAML files. Every Algorithm derivative can store all its parameters and then read them back. There is no need to re-implement it each time.
Saves a :ocv:class:`FaceRecognizer` and its model state.
-.. ocv:function:: void FaceRecognizer::save(const string& filename) const
+.. ocv:function:: void FaceRecognizer::save(const String& filename) const
Saves this model to a given filename, either as XML or YAML.
Every :ocv:class:`FaceRecognizer` overwrites ``FaceRecognizer::save(FileStorage& fs)``
-to save the internal model state. ``FaceRecognizer::save(const string& filename)`` saves
+to save the internal model state. ``FaceRecognizer::save(const String& filename)`` saves
the state of a model to the given filename.
The suffix ``const`` means that prediction does not affect the internal model
Loads a :ocv:class:`FaceRecognizer` and its model state.
-.. ocv:function:: void FaceRecognizer::load( const string& filename )
+.. ocv:function:: void FaceRecognizer::load( const String& filename )
.. ocv:function:: void FaceRecognizer::load( const FileStorage& fs ) = 0
Loads a persisted model and state from a given XML or YAML file . Every
:ocv:class:`FaceRecognizer` has to overwrite ``FaceRecognizer::load(FileStorage& fs)``
to enable loading the model state. ``FaceRecognizer::load(FileStorage& fs)`` in
-turn gets called by ``FaceRecognizer::load(const string& filename)``, to ease
+turn gets called by ``FaceRecognizer::load(const String& filename)``, to ease
saving a model.
createEigenFaceRecognizer
--------------
Sets the algorithm parameter
-.. ocv:function:: void Algorithm::set(const string& name, int value)
-.. ocv:function:: void Algorithm::set(const string& name, double value)
-.. ocv:function:: void Algorithm::set(const string& name, bool value)
-.. ocv:function:: void Algorithm::set(const string& name, const string& value)
-.. ocv:function:: void Algorithm::set(const string& name, const Mat& value)
-.. ocv:function:: void Algorithm::set(const string& name, const vector<Mat>& value)
-.. ocv:function:: void Algorithm::set(const string& name, const Ptr<Algorithm>& value)
+.. ocv:function:: void Algorithm::set(const String& name, int value)
+.. ocv:function:: void Algorithm::set(const String& name, double value)
+.. ocv:function:: void Algorithm::set(const String& name, bool value)
+.. ocv:function:: void Algorithm::set(const String& name, const String& value)
+.. ocv:function:: void Algorithm::set(const String& name, const Mat& value)
+.. ocv:function:: void Algorithm::set(const String& name, const vector<Mat>& value)
+.. ocv:function:: void Algorithm::set(const String& name, const Ptr<Algorithm>& value)
:param name: The parameter name.
:param value: The parameter value.
-----------------
Creates algorithm instance by name
-.. ocv:function:: template<typename _Tp> Ptr<_Tp> Algorithm::create(const string& name)
+.. ocv:function:: template<typename _Tp> Ptr<_Tp> Algorithm::create(const String& name)
:param name: The algorithm name, one of the names returned by ``Algorithm::getList()``.
The CommandLineParser class is designed for command line arguments parsing
- .. ocv:function:: CommandLineParser::CommandLineParser( int argc, const char* const argv[], const string& keys )
+ .. ocv:function:: CommandLineParser::CommandLineParser( int argc, const char* const argv[], const String& keys )
:param argc:
:param argv:
.. ocv:function:: bool CommandLineParser::check()
- .. ocv:function:: void CommandLineParser::about( const string& message )
+ .. ocv:function:: void CommandLineParser::about( const String& message )
:param message:
---------------
Calculates the width and height of a text string.
-.. ocv:function:: Size getTextSize(const string& text, int fontFace, double fontScale, int thickness, int* baseLine)
+.. ocv:function:: Size getTextSize(const String& text, int fontFace, double fontScale, int thickness, int* baseLine)
.. ocv:pyfunction:: cv2.getTextSize(text, fontFace, fontScale, thickness) -> retval, baseLine
The function ``getTextSize`` calculates and returns the size of a box that contains the specified text.
That is, the following code renders some text, the tight box surrounding it, and the baseline: ::
- string text = "Funny text inside the box";
+ String text = "Funny text inside the box";
int fontFace = FONT_HERSHEY_SCRIPT_SIMPLEX;
double fontScale = 2;
int thickness = 3;
-----------
Draws a text string.
-.. ocv:function:: void putText( Mat& img, const string& text, Point org, int fontFace, double fontScale, Scalar color, int thickness=1, int lineType=8, bool bottomLeftOrigin=false )
+.. ocv:function:: void putText( Mat& img, const String& text, Point org, int fontFace, double fontScale, Scalar color, int thickness=1, int lineType=8, bool bottomLeftOrigin=false )
.. ocv:pyfunction:: cv2.putText(img, text, org, fontFace, fontScale, color[, thickness[, lineType[, bottomLeftOrigin]]]) -> None
public:
// various constructors and the copy operation
Exception() { code = 0; line = 0; }
- Exception(int _code, const string& _err,
- const string& _func, const string& _file, int _line);
+ Exception(int _code, const String& _err,
+ const String& _func, const String& _file, int _line);
Exception(const Exception& exc);
Exception& operator = (const Exception& exc);
// the error code
int code;
// the error text message
- string err;
+ String err;
// function name where the error happened
- string func;
+ String func;
// the source file name where the error happened
- string file;
+ String file;
// the source file line where the error happened
int line;
};
------
Returns a text string formatted using the ``printf``\ -like expression.
-.. ocv:function:: string format( const char* fmt, ... )
+.. ocv:function:: String format( const char* fmt, ... )
:param fmt: ``printf`` -compatible formatting specifiers.
.. ocv:function:: FileStorage::FileStorage()
-.. ocv:function:: FileStorage::FileStorage(const string& source, int flags, const string& encoding=string())
+.. ocv:function:: FileStorage::FileStorage(const String& source, int flags, const String& encoding=String())
:param source: Name of the file to open or the text string to read the data from. Extension of the file (``.xml`` or ``.yml``/``.yaml``) determines its format (XML or YAML respectively). Also you can append ``.gz`` to work with compressed files, for example ``myHugeMatrix.xml.gz``. If both ``FileStorage::WRITE`` and ``FileStorage::MEMORY`` flags are specified, ``source`` is used just to specify the output file format (e.g. ``mydata.xml``, ``.yml`` etc.).
-----------------
Opens a file.
-.. ocv:function:: bool FileStorage::open(const string& filename, int flags, const string& encoding=string())
+.. ocv:function:: bool FileStorage::open(const String& filename, int flags, const String& encoding=String())
See description of parameters in :ocv:func:`FileStorage::FileStorage`. The method calls :ocv:func:`FileStorage::release` before opening the file.
--------------------------------
Closes the file and releases all the memory buffers.
-.. ocv:function:: string FileStorage::releaseAndGetString()
+.. ocv:function:: String FileStorage::releaseAndGetString()
Call this method after all I/O operations with the storage are finished. If the storage was opened for writing data and ``FileStorage::WRITE`` was specified
-----------------------
Returns the specified element of the top-level mapping.
-.. ocv:function:: FileNode FileStorage::operator[](const string& nodename) const
+.. ocv:function:: FileNode FileStorage::operator[](const String& nodename) const
.. ocv:function:: FileNode FileStorage::operator[](const char* nodename) const
---------------------
Writes multiple numbers.
-.. ocv:function:: void FileStorage::writeRaw( const string& fmt, const uchar* vec, size_t len )
+.. ocv:function:: void FileStorage::writeRaw( const String& fmt, const uchar* vec, size_t len )
:param fmt: Specification of each array element that has the following format ``([count]{'u'|'c'|'w'|'s'|'i'|'f'|'d'})...`` where the characters correspond to fundamental C++ types:
---------------------
Writes the registered C structure (CvMat, CvMatND, CvSeq).
-.. ocv:function:: void FileStorage::writeObj( const string& name, const void* obj )
+.. ocv:function:: void FileStorage::writeObj( const String& name, const void* obj )
:param name: Name of the written object.
---------------------------------
Returns the normalized object name for the specified name of a file.
-.. ocv:function:: static string FileStorage::getDefaultObjectName(const string& filename)
+.. ocv:function:: static String FileStorage::getDefaultObjectName(const String& filename)
:param filename: Name of a file
--------------------
Returns element of a mapping node or a sequence node.
-.. ocv:function:: FileNode FileNode::operator[](const string& nodename) const
+.. ocv:function:: FileNode FileNode::operator[](const String& nodename) const
.. ocv:function:: FileNode FileNode::operator[](const char* nodename) const
--------------
Returns the node name.
-.. ocv:function:: string FileNode::name() const
+.. ocv:function:: String FileNode::name() const
:returns: The node name or an empty string if the node is nameless.
-----------------
Reads node elements to the buffer with the specified format.
-.. ocv:function:: void FileNode::readRaw( const string& fmt, uchar* vec, size_t len ) const
+.. ocv:function:: void FileNode::readRaw( const String& fmt, uchar* vec, size_t len ) const
:param fmt: Specification of each array element. It has the same format as in :ocv:func:`FileStorage::writeRaw`.
-------------------------
Reads node elements to the buffer with the specified format.
-.. ocv:function:: FileNodeIterator& FileNodeIterator::readRaw( const string& fmt, uchar* vec, size_t maxCount=(size_t)INT_MAX )
+.. ocv:function:: FileNodeIterator& FileNodeIterator::readRaw( const String& fmt, uchar* vec, size_t maxCount=(size_t)INT_MAX )
:param fmt: Specification of each array element. It has the same format as in :ocv:func:`FileStorage::writeRaw`.
virtual int descriptorSize() const = 0;
virtual int descriptorType() const = 0;
- static Ptr<DescriptorExtractor> create( const string& descriptorExtractorType );
+ static Ptr<DescriptorExtractor> create( const String& descriptorExtractorType );
protected:
...
-------------------------------
Creates a descriptor extractor by name.
-.. ocv:function:: Ptr<DescriptorExtractor> DescriptorExtractor::create( const string& descriptorExtractorType )
+.. ocv:function:: Ptr<DescriptorExtractor> DescriptorExtractor::create( const String& descriptorExtractorType )
:param descriptorExtractorType: Descriptor extractor type.
virtual Ptr<DescriptorMatcher> clone( bool emptyTrainData=false ) const = 0;
- static Ptr<DescriptorMatcher> create( const string& descriptorMatcherType );
+ static Ptr<DescriptorMatcher> create( const String& descriptorMatcherType );
protected:
vector<Mat> trainDescCollection;
-----------------------------
Creates a descriptor matcher of a given type with the default parameters (using default constructor).
-.. ocv:function:: Ptr<DescriptorMatcher> DescriptorMatcher::create( const string& descriptorMatcherType )
+.. ocv:function:: Ptr<DescriptorMatcher> DescriptorMatcher::create( const String& descriptorMatcherType )
:param descriptorMatcherType: Descriptor matcher type. Now the following matcher types are supported:
virtual void read(const FileNode&);
virtual void write(FileStorage&) const;
- static Ptr<FeatureDetector> create( const string& detectorType );
+ static Ptr<FeatureDetector> create( const String& detectorType );
protected:
...
-----------------------
Creates a feature detector by its name.
-.. ocv:function:: Ptr<FeatureDetector> FeatureDetector::create( const string& detectorType )
+.. ocv:function:: Ptr<FeatureDetector> FeatureDetector::create( const String& detectorType )
:param detectorType: Feature detector type.
virtual void tooMany(int max, int n_detected) = 0;
virtual bool good() const = 0;
virtual Ptr<AdjusterAdapter> clone() const = 0;
- static Ptr<AdjusterAdapter> create( const string& detectorType );
+ static Ptr<AdjusterAdapter> create( const String& detectorType );
};
-----------------------
Creates an adjuster adapter by name
-.. ocv:function:: Ptr<AdjusterAdapter> AdjusterAdapter::create( const string& detectorType )
+.. ocv:function:: Ptr<AdjusterAdapter> AdjusterAdapter::create( const String& detectorType )
Creates an adjuster adapter by name ``detectorType``. The detector name is the same as in :ocv:func:`FeatureDetector::create`, but now supports ``"FAST"``, ``"STAR"``, and ``"SURF"`` only.
DeviceInfo();
DeviceInfo(int device_id);
- string name() const;
+ String name() const;
int majorVersion() const;
int minorVersion() const;
---------------------
Returns the device name.
-.. ocv:function:: string gpu::DeviceInfo::name() const
+.. ocv:function:: String gpu::DeviceInfo::name() const
{
public:
CascadeClassifier_GPU();
- CascadeClassifier_GPU(const string& filename);
+ CascadeClassifier_GPU(const String& filename);
~CascadeClassifier_GPU();
bool empty() const;
- bool load(const string& filename);
+ bool load(const String& filename);
void release();
/* Returns number of detected objects */
-----------------------------------------------------
Loads the classifier from a file. Cascade type is detected automatically by constructor parameter.
-.. ocv:function:: gpu::CascadeClassifier_GPU::CascadeClassifier_GPU(const string& filename)
+.. ocv:function:: gpu::CascadeClassifier_GPU::CascadeClassifier_GPU(const String& filename)
:param filename: Name of the file from which the classifier is loaded. Only the old ``haar`` classifier (trained by the ``haar`` training application) and NVIDIA's ``nvbin`` are supported for HAAR and only new type of OpenCV XML cascade supported for LBP.
------------------------------------
Loads the classifier from a file. The previous content is destroyed.
-.. ocv:function:: bool gpu::CascadeClassifier_GPU::load(const string& filename)
+.. ocv:function:: bool gpu::CascadeClassifier_GPU::load(const String& filename)
:param filename: Name of the file from which the classifier is loaded. Only the old ``haar`` classifier (trained by the ``haar`` training application) and NVIDIA's ``nvbin`` are supported for HAAR and only new type of OpenCV XML cascade supported for LBP.
---------------------
Changes parameters of a window dynamically.
-.. ocv:function:: void setWindowProperty( const string& winname, int prop_id, double prop_value )
+.. ocv:function:: void setWindowProperty( const String& winname, int prop_id, double prop_value )
.. ocv:pyfunction:: cv2.setWindowProperty(winname, prop_id, prop_value) -> None
---------------------
Provides parameters of a window.
-.. ocv:function:: double getWindowProperty( const string& winname, int prop_id )
+.. ocv:function:: double getWindowProperty( const String& winname, int prop_id )
.. ocv:pyfunction:: cv2.getWindowProperty(winname, prop_id) -> retval
----------
Creates the font to draw a text on an image.
-.. ocv:function:: CvFont fontQt(const string& nameFont, int pointSize = -1, Scalar color = Scalar::all(0), int weight = CV_FONT_NORMAL, int style = CV_STYLE_NORMAL, int spacing = 0)
+.. ocv:function:: CvFont fontQt(const String& nameFont, int pointSize = -1, Scalar color = Scalar::all(0), int weight = CV_FONT_NORMAL, int style = CV_STYLE_NORMAL, int spacing = 0)
.. ocv:cfunction:: CvFont cvFontQt(const char* nameFont, int pointSize=-1, CvScalar color=cvScalarAll(0), int weight=CV_FONT_NORMAL, int style=CV_STYLE_NORMAL, int spacing=0)
-----------
Creates the font to draw a text on an image.
-.. ocv:function:: void addText( const Mat& img, const string& text, Point org, CvFont font )
+.. ocv:function:: void addText( const Mat& img, const String& text, Point org, CvFont font )
.. ocv:cfunction:: void cvAddText( const CvArr* img, const char* text, CvPoint org, CvFont * arg2 )
------------------
Displays a text on a window image as an overlay for a specified duration.
-.. ocv:function:: void displayOverlay( const string& winname, const string& text, int delayms=0 )
+.. ocv:function:: void displayOverlay( const String& winname, const String& text, int delayms=0 )
.. ocv:cfunction:: void cvDisplayOverlay(const char* name, const char* text, int delayms = 0)
--------------------
Displays a text on the window statusbar during the specified period of time.
-.. ocv:function:: void displayStatusBar( const string& winname, const string& text, int delayms=0 )
+.. ocv:function:: void displayStatusBar( const String& winname, const String& text, int delayms=0 )
.. ocv:cfunction:: void cvDisplayStatusBar(const char* name, const char* text, int delayms = 0)
------------------------
Sets a callback function to be called to draw on top of displayed image.
-.. ocv:function:: void setOpenGlDrawCallback( const string& winname, OpenGlDrawCallback onOpenGlDraw, void* userdata=0 )
+.. ocv:function:: void setOpenGlDrawCallback( const String& winname, OpenGlDrawCallback onOpenGlDraw, void* userdata=0 )
.. ocv:cfunction:: void cvSetOpenGlDrawCallback( const char* window_name, CvOpenGlDrawCallback callback, void* userdata=NULL )
------------------------
Saves parameters of the specified window.
-.. ocv:function:: void saveWindowParameters( const string& windowName )
+.. ocv:function:: void saveWindowParameters( const String& windowName )
.. ocv:cfunction:: void cvSaveWindowParameters(const char* name)
------------------------
Loads parameters of the specified window.
-.. ocv:function:: void loadWindowParameters( const string& windowName )
+.. ocv:function:: void loadWindowParameters( const String& windowName )
.. ocv:cfunction:: void cvLoadWindowParameters(const char* name)
----------------
Attaches a button to the control panel.
-.. ocv:function:: int createButton( const string& bar_name, ButtonCallback on_change, void* userdata=NULL, int type=CV_PUSH_BUTTON, bool initial_button_state=0 )
+.. ocv:function:: int createButton( const String& bar_name, ButtonCallback on_change, void* userdata=NULL, int type=CV_PUSH_BUTTON, bool initial_button_state=0 )
.. ocv:cfunction:: int cvCreateButton( const char* button_name=NULL, CvButtonCallback on_change=NULL, void* userdata=NULL, int button_type=CV_PUSH_BUTTON, int initial_button_state=0 )
--------
Encodes an image into a memory buffer.
-.. ocv:function:: bool imencode( const string& ext, InputArray img, vector<uchar>& buf, const vector<int>& params=vector<int>())
+.. ocv:function:: bool imencode( const String& ext, InputArray img, vector<uchar>& buf, const vector<int>& params=vector<int>())
.. ocv:cfunction:: CvMat* cvEncodeImage( const char* ext, const CvArr* image, const int* params=0 )
------
Loads an image from a file.
-.. ocv:function:: Mat imread( const string& filename, int flags=1 )
+.. ocv:function:: Mat imread( const String& filename, int flags=1 )
.. ocv:pyfunction:: cv2.imread(filename[, flags]) -> retval
-----------
Saves an image to a specified file.
-.. ocv:function:: bool imwrite( const string& filename, InputArray img, const vector<int>& params=vector<int>() )
+.. ocv:function:: bool imwrite( const String& filename, InputArray img, const vector<int>& params=vector<int>() )
.. ocv:pyfunction:: cv2.imwrite(filename, img[, params]) -> retval
.. ocv:function:: VideoCapture::VideoCapture()
-.. ocv:function:: VideoCapture::VideoCapture(const string& filename)
+.. ocv:function:: VideoCapture::VideoCapture(const String& filename)
.. ocv:function:: VideoCapture::VideoCapture(int device)
---------------------
Open video file or a capturing device for video capturing
-.. ocv:function:: bool VideoCapture::open(const string& filename)
+.. ocv:function:: bool VideoCapture::open(const String& filename)
.. ocv:function:: bool VideoCapture::open(int device)
.. ocv:pyfunction:: cv2.VideoCapture.open(filename) -> retval
.. ocv:function:: VideoWriter::VideoWriter()
-.. ocv:function:: VideoWriter::VideoWriter(const string& filename, int fourcc, double fps, Size frameSize, bool isColor=true)
+.. ocv:function:: VideoWriter::VideoWriter(const String& filename, int fourcc, double fps, Size frameSize, bool isColor=true)
.. ocv:pyfunction:: cv2.VideoWriter([filename, fourcc, fps, frameSize[, isColor]]) -> <VideoWriter object>
-----------------
Initializes or reinitializes video writer.
-.. ocv:function:: bool VideoWriter::open(const string& filename, int fourcc, double fps, Size frameSize, bool isColor=true)
+.. ocv:function:: bool VideoWriter::open(const String& filename, int fourcc, double fps, Size frameSize, bool isColor=true)
.. ocv:pyfunction:: cv2.VideoWriter.open(filename, fourcc, fps, frameSize[, isColor]) -> retval
------------------
Creates a trackbar and attaches it to the specified window.
-.. ocv:function:: int createTrackbar( const string& trackbarname, const string& winname, int* value, int count, TrackbarCallback onChange=0, void* userdata=0)
+.. ocv:function:: int createTrackbar( const String& trackbarname, const String& winname, int* value, int count, TrackbarCallback onChange=0, void* userdata=0)
.. ocv:cfunction:: int cvCreateTrackbar( const char* trackbar_name, const char* window_name, int* value, int count, CvTrackbarCallback on_change=NULL )
------------------
Returns the trackbar position.
-.. ocv:function:: int getTrackbarPos( const string& trackbarname, const string& winname )
+.. ocv:function:: int getTrackbarPos( const String& trackbarname, const String& winname )
.. ocv:pyfunction:: cv2.getTrackbarPos(trackbarname, winname) -> retval
----------
Displays an image in the specified window.
-.. ocv:function:: void imshow( const string& winname, InputArray mat )
+.. ocv:function:: void imshow( const String& winname, InputArray mat )
.. ocv:pyfunction:: cv2.imshow(winname, mat) -> None
---------------
Creates a window.
-.. ocv:function:: void namedWindow( const string& winname, int flags=WINDOW_AUTOSIZE )
+.. ocv:function:: void namedWindow( const String& winname, int flags=WINDOW_AUTOSIZE )
.. ocv:pyfunction:: cv2.namedWindow(winname[, flags]) -> None
-------------
Destroys a window.
-.. ocv:function:: void destroyWindow( const string& winname )
+.. ocv:function:: void destroyWindow( const String& winname )
.. ocv:pyfunction:: cv2.destroyWindow(winname) -> None
----------
Moves window to the specified position
-.. ocv:function:: void moveWindow( const string& winname, int x, int y )
+.. ocv:function:: void moveWindow( const String& winname, int x, int y )
.. ocv:pyfunction:: cv2.moveWindow(winname, x, y) -> None
------------
Resizes window to the specified size
-.. ocv:function:: void resizeWindow( const string& winname, int width, int height )
+.. ocv:function:: void resizeWindow( const String& winname, int width, int height )
.. ocv:pyfunction:: cv2.resizeWindow(winname, width, height) -> None
----------------
Sets mouse handler for the specified window
-.. ocv:function:: void setMouseCallback( const string& winname, MouseCallback onMouse, void* userdata=0 )
+.. ocv:function:: void setMouseCallback( const String& winname, MouseCallback onMouse, void* userdata=0 )
.. ocv:cfunction:: void cvSetMouseCallback( const char* window_name, CvMouseCallback on_mouse, void* param=NULL )
------------------
Sets the trackbar position.
-.. ocv:function:: void setTrackbarPos( const string& trackbarname, const string& winname, int pos )
+.. ocv:function:: void setTrackbarPos( const String& trackbarname, const String& winname, int pos )
.. ocv:pyfunction:: cv2.setTrackbarPos(trackbarname, winname, pos) -> None
class CalonderDescriptorExtractor : public DescriptorExtractor
{
public:
- CalonderDescriptorExtractor( const string& classifierFile );
+ CalonderDescriptorExtractor( const String& classifierFile );
virtual void read( const FileNode &fn );
virtual void write( FileStorage &fs ) const;
const char* pca_hr_config = 0, const char* pca_desc_config = 0, int pyr_levels = 1,
int pca_dim_high = 100, int pca_dim_low = 100);
- OneWayDescriptorBase(CvSize patch_size, int pose_count, const string &pca_filename, const string &train_path = string(), const string &images_list = string(),
+ OneWayDescriptorBase(CvSize patch_size, int pose_count, const String &pca_filename, const String &train_path = String(), const String &images_list = String(),
float _scale_min = 0.7f, float _scale_max=1.5f, float _scale_step=1.2f, int pyr_levels = 1,
int pca_dim_high = 100, int pca_dim_low = 100);
void ConvertDescriptorsArrayToTree(); // Converting pca_descriptors array to KD tree
// GetPCAFilename: get default PCA filename
- static string GetPCAFilename () { return "pca.yml"; }
+ static String GetPCAFilename () { return "pca.yml"; }
virtual bool empty() const { return m_train_feature_count <= 0 ? true : false; }
Params( int poseCount = POSE_COUNT,
Size patchSize = Size(PATCH_WIDTH, PATCH_HEIGHT),
- string pcaFilename = string(),
- string trainPath = string(), string trainImagesList = string(),
+ String pcaFilename = String(),
+ String trainPath = String(), String trainImagesList = String(),
float minScale = GET_MIN_SCALE(), float maxScale = GET_MAX_SCALE(),
float stepScale = GET_STEP_SCALE() );
int poseCount;
Size patchSize;
- string pcaFilename;
- string trainPath;
- string trainImagesList;
+ String pcaFilename;
+ String trainPath;
+ String trainImagesList;
float minScale, maxScale, stepScale;
};
int compressionMethod=FernClassifier::COMPRESSION_NONE,
const PatchGenerator& patchGenerator=PatchGenerator() );
- Params( const string& filename );
+ Params( const String& filename );
int nclasses;
int patchSize;
int compressionMethod;
PatchGenerator patchGenerator;
- string filename;
+ String filename;
};
FernDescriptorMatcher( const Params& params=Params() );
----------------------------------------
Loads a classifier from a file.
-.. ocv:function:: CascadeClassifier::CascadeClassifier(const string& filename)
+.. ocv:function:: CascadeClassifier::CascadeClassifier(const String& filename)
.. ocv:pyfunction:: cv2.CascadeClassifier([filename]) -> <CascadeClassifier object>
---------------------------
Loads a classifier from a file.
-.. ocv:function:: bool CascadeClassifier::load(const string& filename)
+.. ocv:function:: bool CascadeClassifier::load(const String& filename)
.. ocv:pyfunction:: cv2.CascadeClassifier.load(filename) -> retval
virtual bool train(const Dataset* dataset, const FeaturePool* pool, int weaks, int treeDepth) = 0;
virtual void setRejectThresholds(OutputArray thresholds) = 0;
virtual void write( cv::FileStorage &fs, const FeaturePool* pool, InputArray thresholds) const = 0;
- virtual void write( CvFileStorage* fs, string name) const = 0;
+ virtual void write( CvFileStorage* fs, String name) const = 0;
};
--------------------------
.. ocv:function:: void softcascade::Octave::train(cv::FileStorage &fs, const FeaturePool* pool, InputArray thresholds) const
-.. ocv:function:: void softcascade::Octave::train( CvFileStorage* fs, string name) const
+.. ocv:function:: void softcascade::Octave::train( CvFileStorage* fs, String name) const
:param fs an output file storage to store trained detector.