OpenCV: Connections with C++

| OpenCV 3.4.2 Open Source Computer Vision

Classes | Typedefs | Functions
Connections with C++
Core functionality » C structures and operations

## Classes
struct | CvType
| class for automatic module/RTTI data registration/unregistration More...
class | cv::Seq< _Tp >
class | cv::SeqIterator< _Tp >

## Typedefs
typedef Ptr< CvMemStorage > | cv::MemStorage

## Functions
| cv::Seq< _Tp >::Seq ()
| the default constructor More...
| cv::Seq< _Tp >::Seq (const CvSeq *seq)
| the constructor for wrapping CvSeq structure. The real element type in CvSeq should match _Tp. More...
| cv::Seq< _Tp >::Seq (MemStorage &storage, int headerSize=sizeof(CvSeq))
| creates the empty sequence that resides in the specified storage More...
| cv::SeqIterator< _Tp >::SeqIterator ()
| the default constructor More...
| cv::SeqIterator< _Tp >::SeqIterator (const Seq< _Tp > &seq, bool seekEnd=false)
| the constructor setting the iterator to the beginning or to the end of the sequence More...
_Tp & | cv::Seq< _Tp >::back ()
| returns reference to the last sequence element More...
const _Tp & | cv::Seq< _Tp >::back () const
| returns read-only reference to the last sequence element More...
SeqIterator< _Tp > | cv::Seq< _Tp >::begin () const
| returns iterator pointing to the beginning of the sequence More...
int | cv::Seq< _Tp >::channels () const
| returns the number of channels in each sequence element More...
void | cv::Seq< _Tp >::clear ()
| removes all the elements from the sequence More...
void | cv::clearSeq (CvSeq *seq)
void | cv::Seq< _Tp >::copyTo (std::vector< _Tp > &vec, const Range &range=Range::all()) const
| copies the whole sequence or the sequence slice to the specified vector More...
Mat | cv::cvarrToMat (const CvArr *arr, bool copyData=false, bool allowND=true, int coiMode=0, AutoBuffer< double > *buf=0)
| converts array (CvMat or IplImage) to cv::Mat More...
static Mat | cv::cvarrToMatND (const CvArr *arr, bool copyData=false, int coiMode=0)
int | cv::Seq< _Tp >::depth () const
| returns the depth of sequence elements (CV_8U ... CV_64F) More...
size_t | cv::Seq< _Tp >::elemSize () const
| returns the size of each sequence element More...
bool | cv::Seq< _Tp >::empty () const
| returns true iff the sequence contains no elements More...
SeqIterator< _Tp > | cv::Seq< _Tp >::end () const
| returns iterator pointing to the element following the last sequence element More...
void | cv::extractImageCOI (const CvArr *arr, OutputArray coiimg, int coi=-1)
| extracts Channel of Interest from CvMat or IplImage and makes cv::Mat out of it. More...
_Tp & | cv::Seq< _Tp >::front ()
| returns reference to the first sequence element More...
const _Tp & | cv::Seq< _Tp >::front () const
| returns read-only reference to the first sequence element More...
schar * | cv::getSeqElem (const CvSeq *seq, int index)
size_t | cv::Seq< _Tp >::index (const _Tp &elem) const
| returns index of the specified sequence element More...
void | cv::Seq< _Tp >::insert (int idx, const _Tp &elem)
| inserts the specified element to the specified position More...
void | cv::Seq< _Tp >::insert (int idx, const _Tp *elems, size_t count)
| inserts zero or more elements to the specified position More...
void | cv::insertImageCOI (InputArray coiimg, CvArr *arr, int coi=-1)
| inserts single-channel cv::Mat into a multi-channel CvMat or IplImage More...
| cv::Seq< _Tp >::operator std::vector< _Tp > () const
| returns the vector containing all the sequence elements More...
template<typename _Tp >
bool | cv::operator!= (const SeqIterator< _Tp > &a, const SeqIterator< _Tp > &b)
_Tp & | cv::SeqIterator< _Tp >::operator* ()
| returns reference to the current sequence element More...
const _Tp & | cv::SeqIterator< _Tp >::operator* () const
| returns read-only reference to the current sequence element More...
SeqIterator & | cv::SeqIterator< _Tp >::operator++ ()
| moves iterator to the next sequence element More...
SeqIterator | cv::SeqIterator< _Tp >::operator++ (int) const
| moves iterator to the next sequence element More...
SeqIterator & | cv::SeqIterator< _Tp >::operator+= (int)
| moves iterator forward by the specified offset (possibly negative) More...
template<typename _Tp >
ptrdiff_t | cv::operator- (const SeqIterator< _Tp > &a, const SeqIterator< _Tp > &b)
SeqIterator & | cv::SeqIterator< _Tp >::operator-- ()
| moves iterator to the previous sequence element More...
SeqIterator | cv::SeqIterator< _Tp >::operator-- (int) const
| moves iterator to the previous sequence element More...
SeqIterator & | cv::SeqIterator< _Tp >::operator-= (int)
| moves iterator backward by the specified offset (possibly negative) More...
template<typename _Tp >
bool | cv::operator== (const SeqIterator< _Tp > &a, const SeqIterator< _Tp > &b)
_Tp & | cv::Seq< _Tp >::operator[] (int idx)
| returns read-write reference to the specified element More...
const _Tp & | cv::Seq< _Tp >::operator[] (int idx) const
| returns read-only reference to the specified element More...
void | cv::Seq< _Tp >::pop_back ()
| removes the last element from the sequence More...
void | cv::Seq< _Tp >::pop_back (_Tp *elems, size_t count)
| removes zero or more elements from the end of the sequence More...
void | cv::Seq< _Tp >::pop_front ()
| removes the first element from the sequence More...
void | cv::Seq< _Tp >::pop_front (_Tp *elems, size_t count)
| removes zero or more elements from the beginning of the sequence More...
void | cv::Seq< _Tp >::push_back (const _Tp &elem)
| appends the specified element to the end of the sequence More...
void | cv::Seq< _Tp >::push_back (const _Tp *elems, size_t count)
| appends zero or more elements to the end of the sequence More...
void | cv::Seq< _Tp >::push_front (const _Tp &elem)
| appends the specified element to the front of the sequence More...
void | cv::Seq< _Tp >::push_front (const _Tp *elems, size_t count)
| appends zero or more elements to the front of the sequence More...
void | cv::Seq< _Tp >::remove (int idx)
| removes element at the specified position More...
void | cv::Seq< _Tp >::remove (const Range &r)
| removes the specified subsequence More...
void | cv::SeqIterator< _Tp >::seek (size_t pos)
| positions the iterator within the sequence More...
void | cv::seqInsertSlice (CvSeq *seq, int before_index, const CvArr *from_arr)
void | cv::seqPop (CvSeq *seq, void *element=0)
void | cv::seqPopFront (CvSeq *seq, void *element=0)
void | cv::seqPopMulti (CvSeq *seq, void *elements, int count, int in_front=0)
schar * | cv::seqPush (CvSeq *seq, const void *element=0)
schar * | cv::seqPushFront (CvSeq *seq, const void *element=0)
void | cv::seqRemove (CvSeq *seq, int index)
void | cv::seqRemoveSlice (CvSeq *seq, CvSlice slice)
size_t | cv::Seq< _Tp >::size () const
| returns the number of elements in the sequence More...
size_t | cv::SeqIterator< _Tp >::tell () const
| reports the current iterator position More...
int | cv::Seq< _Tp >::type () const
| returns the type of sequence elements (CV_8UC1 ... CV_64FC(CV_CN_MAX) ...) More...

## Detailed Description

## Typedef Documentation

## ◆ MemStorage

typedef Ptr<CvMemStorage> cv::MemStorage

## Function Documentation

## ◆ Seq() [1/3]

template<typename _Tp >

cv::Seq< _Tp >::Seq | ( |  | ) |
| inline

the default constructor

## ◆ Seq() [2/3]

template<typename _Tp >

cv::Seq< _Tp >::Seq | ( | const CvSeq< _Tp > * | seq | ) |
| inline

the constructor for wrapping CvSeq structure. The real element type in CvSeq should match _Tp.

## ◆ Seq() [3/3]

template<typename _Tp >

cv::Seq< _Tp >::Seq | ( | MemStorage & | storage,
|  | int | headerSize = `sizeof(CvSeq< _Tp >)`
| ) |  |
| inline

creates the empty sequence that resides in the specified storage

## ◆ SeqIterator() [1/2]

template<typename _Tp >

cv::SeqIterator< _Tp >::SeqIterator | ( |  | ) |
| inline

the default constructor

## ◆ SeqIterator() [2/2]

template<typename _Tp >

cv::SeqIterator< _Tp >::SeqIterator | ( | const Seq< _Tp > & | seq,
|  | bool | seekEnd = `false`
| ) |  |
| inline

the constructor setting the iterator to the beginning or to the end of the sequence

## ◆ back() [1/2]

template<typename _Tp >

_Tp & cv::Seq< _Tp >::back | ( |  | ) |
| inline

returns reference to the last sequence element

## ◆ back() [2/2]

template<typename _Tp >

const _Tp & cv::Seq< _Tp >::back | ( |  | ) | const
| inline

returns read-only reference to the last sequence element

## ◆ begin()

template<typename _Tp >

SeqIterator< _Tp > cv::Seq< _Tp >::begin | ( |  | ) | const
| inline

returns iterator pointing to the beginning of the sequence

## ◆ channels()

template<typename _Tp >

int cv::Seq< _Tp >::channels | ( |  | ) | const
| inline

returns the number of channels in each sequence element

## ◆ clear()

template<typename _Tp >

void cv::Seq< _Tp >::clear | ( |  | ) |
| inline

removes all the elements from the sequence

## ◆ clearSeq()

void cv::clearSeq | ( | CvSeq * | seq | ) |

## ◆ copyTo()

template<typename _Tp >

void cv::Seq< _Tp >::copyTo | ( | std::vector< _Tp > & | vec,
|  | const Range & | range = `Range::all()`
| ) |  | const
| inline

copies the whole sequence or the sequence slice to the specified vector

## ◆ cvarrToMat()

Mat cv::cvarrToMat | ( | const CvArr * | arr,
|  | bool | copyData = `false`,
|  | bool | allowND = `true`,
|  | int | coiMode = `0`,
|  | AutoBuffer< double > * | buf = `0`
| ) |  |

converts array (CvMat or IplImage) to cv::Mat

## ◆ cvarrToMatND()

static Mat cv::cvarrToMatND | ( | const CvArr * | arr,
|  | bool | copyData = `false`,
|  | int | coiMode = `0`
| ) |  |
| inlinestatic

## ◆ depth()

template<typename _Tp >

int cv::Seq< _Tp >::depth | ( |  | ) | const
| inline

returns the depth of sequence elements (CV_8U ... CV_64F)

## ◆ elemSize()

template<typename _Tp >

size_t cv::Seq< _Tp >::elemSize | ( |  | ) | const
| inline

returns the size of each sequence element

## ◆ empty()

template<typename _Tp >

bool cv::Seq< _Tp >::empty | ( |  | ) | const
| inline

returns true iff the sequence contains no elements

## ◆ end()

template<typename _Tp >

SeqIterator< _Tp > cv::Seq< _Tp >::end | ( |  | ) | const
| inline

returns iterator pointing to the element following the last sequence element

## ◆ extractImageCOI()

void cv::extractImageCOI | ( | const CvArr * | arr,
|  | OutputArray | coiimg,
|  | int | coi = `-1`
| ) |  |

extracts Channel of Interest from CvMat or IplImage and makes cv::Mat out of it.

## ◆ front() [1/2]

template<typename _Tp >

_Tp & cv::Seq< _Tp >::front | ( |  | ) |
| inline

returns reference to the first sequence element

## ◆ front() [2/2]

template<typename _Tp >

const _Tp & cv::Seq< _Tp >::front | ( |  | ) | const
| inline

returns read-only reference to the first sequence element

## ◆ getSeqElem()

schar* cv::getSeqElem | ( | const CvSeq * | seq,
|  | int | index
| ) |  |

## ◆ index()

template<typename _Tp >

size_t cv::Seq< _Tp >::index | ( | const _Tp & | elem | ) | const
| inline

returns index of the specified sequence element

## ◆ insert() [1/2]

template<typename _Tp >

void cv::Seq< _Tp >::insert | ( | int | idx,
|  | const _Tp & | elem
| ) |  |
| inline

inserts the specified element to the specified position

## ◆ insert() [2/2]

template<typename _Tp >

void cv::Seq< _Tp >::insert | ( | int | idx,
|  | const _Tp * | elems,
|  | size_t | count
| ) |  |
| inline

inserts zero or more elements to the specified position

## ◆ insertImageCOI()

void cv::insertImageCOI | ( | InputArray | coiimg,
|  | CvArr * | arr,
|  | int | coi = `-1`
| ) |  |

inserts single-channel cv::Mat into a multi-channel CvMat or IplImage

## ◆ operator std::vector< _Tp >()

template<typename _Tp >

cv::Seq< _Tp >::operator std::vector< _Tp > | ( |  | ) | const
| inline

returns the vector containing all the sequence elements

## ◆ operator!=()

template<typename _Tp >

bool cv::operator!= | ( | const SeqIterator< _Tp > & | a,
|  | const SeqIterator< _Tp > & | b
| ) |  |
| inline

## ◆ operator*() [1/2]

template<typename _Tp >

_Tp & cv::SeqIterator< _Tp >::operator* | ( |  | ) |
| inline

returns reference to the current sequence element

## ◆ operator*() [2/2]

template<typename _Tp >

const _Tp & cv::SeqIterator< _Tp >::operator* | ( |  | ) | const
| inline

returns read-only reference to the current sequence element

## ◆ operator++() [1/2]

template<typename _Tp >

SeqIterator< _Tp > & cv::SeqIterator< _Tp >::operator++ | ( |  | ) |
| inline

moves iterator to the next sequence element

## ◆ operator++() [2/2]

template<typename _Tp >

SeqIterator< _Tp > cv::SeqIterator< _Tp >::operator++ | ( | int |  | ) | const
| inline

moves iterator to the next sequence element

## ◆ operator+=()

template<typename _Tp >

SeqIterator< _Tp > & cv::SeqIterator< _Tp >::operator+= | ( | int | delta | ) |
| inline

moves iterator forward by the specified offset (possibly negative)

## ◆ operator-()

template<typename _Tp >

ptrdiff_t cv::operator- | ( | const SeqIterator< _Tp > & | a,
|  | const SeqIterator< _Tp > & | b
| ) |  |
| inline

## ◆ operator--() [1/2]

template<typename _Tp >

SeqIterator< _Tp > & cv::SeqIterator< _Tp >::operator-- | ( |  | ) |
| inline

moves iterator to the previous sequence element

## ◆ operator--() [2/2]

template<typename _Tp >

SeqIterator< _Tp > cv::SeqIterator< _Tp >::operator-- | ( | int |  | ) | const
| inline

moves iterator to the previous sequence element

## ◆ operator-=()

template<typename _Tp >

SeqIterator< _Tp > & cv::SeqIterator< _Tp >::operator-= | ( | int | delta | ) |
| inline

moves iterator backward by the specified offset (possibly negative)

## ◆ operator==()

template<typename _Tp >

bool cv::operator== | ( | const SeqIterator< _Tp > & | a,
|  | const SeqIterator< _Tp > & | b
| ) |  |
| inline

## ◆ operator[]() [1/2]

template<typename _Tp >

_Tp & cv::Seq< _Tp >::operator[] | ( | int | idx | ) |
| inline

returns read-write reference to the specified element

## ◆ operator[]() [2/2]

template<typename _Tp >

const _Tp & cv::Seq< _Tp >::operator[] | ( | int | idx | ) | const
| inline

returns read-only reference to the specified element

## ◆ pop_back() [1/2]

template<typename _Tp >

void cv::Seq< _Tp >::pop_back | ( |  | ) |
| inline

removes the last element from the sequence

## ◆ pop_back() [2/2]

template<typename _Tp >

void cv::Seq< _Tp >::pop_back | ( | _Tp * | elems,
|  | size_t | count
| ) |  |
| inline

removes zero or more elements from the end of the sequence

## ◆ pop_front() [1/2]

template<typename _Tp >

void cv::Seq< _Tp >::pop_front | ( |  | ) |
| inline

removes the first element from the sequence

## ◆ pop_front() [2/2]

template<typename _Tp >

void cv::Seq< _Tp >::pop_front | ( | _Tp * | elems,
|  | size_t | count
| ) |  |
| inline

removes zero or more elements from the beginning of the sequence

## ◆ push_back() [1/2]

template<typename _Tp >

void cv::Seq< _Tp >::push_back | ( | const _Tp & | elem | ) |
| inline

appends the specified element to the end of the sequence

## ◆ push_back() [2/2]

template<typename _Tp >

void cv::Seq< _Tp >::push_back | ( | const _Tp * | elems,
|  | size_t | count
| ) |  |
| inline

appends zero or more elements to the end of the sequence

## ◆ push_front() [1/2]

template<typename _Tp >

void cv::Seq< _Tp >::push_front | ( | const _Tp & | elem | ) |
| inline

appends the specified element to the front of the sequence

## ◆ push_front() [2/2]

template<typename _Tp >

void cv::Seq< _Tp >::push_front | ( | const _Tp * | elems,
|  | size_t | count
| ) |  |
| inline

appends zero or more elements to the front of the sequence

## ◆ remove() [1/2]

template<typename _Tp >

void cv::Seq< _Tp >::remove | ( | int | idx | ) |
| inline

removes element at the specified position

## ◆ remove() [2/2]

template<typename _Tp >

void cv::Seq< _Tp >::remove | ( | const Range & | r | ) |
| inline

removes the specified subsequence

## ◆ seek()

template<typename _Tp >

void cv::SeqIterator< _Tp >::seek | ( | size_t | pos | ) |
| inline

positions the iterator within the sequence

## ◆ seqInsertSlice()

void cv::seqInsertSlice | ( | CvSeq * | seq,
|  | int | before_index,
|  | const CvArr * | from_arr
| ) |  |

## ◆ seqPop()

void cv::seqPop | ( | CvSeq * | seq,
|  | void * | element = `0`
| ) |  |

## ◆ seqPopFront()

void cv::seqPopFront | ( | CvSeq * | seq,
|  | void * | element = `0`
| ) |  |

## ◆ seqPopMulti()

void cv::seqPopMulti | ( | CvSeq * | seq,
|  | void * | elements,
|  | int | count,
|  | int | in_front = `0`
| ) |  |

## ◆ seqPush()

schar* cv::seqPush | ( | CvSeq * | seq,
|  | const void * | element = `0`
| ) |  |

## ◆ seqPushFront()

schar* cv::seqPushFront | ( | CvSeq * | seq,
|  | const void * | element = `0`
| ) |  |

## ◆ seqRemove()

void cv::seqRemove | ( | CvSeq * | seq,
|  | int | index
| ) |  |

## ◆ seqRemoveSlice()

void cv::seqRemoveSlice | ( | CvSeq * | seq,
|  | CvSlice | slice
| ) |  |

## ◆ size()

template<typename _Tp >

size_t cv::Seq< _Tp >::size | ( |  | ) | const
| inline

returns the number of elements in the sequence

## ◆ tell()

template<typename _Tp >

size_t cv::SeqIterator< _Tp >::tell | ( |  | ) | const
| inline

reports the current iterator position

## ◆ type()

template<typename _Tp >

int cv::Seq< _Tp >::type | ( |  | ) | const
| inline

returns the type of sequence elements (CV_8UC1 ... CV_64FC(CV_CN_MAX) ...)