Initializes the process of sequential reading from a sequence.
C:void cvStartReadSeq(const CvSeq* seq, CvSeqReader* reader, int reverse=0 )
Parameters:
seq – Sequence
reader – Reader state; initialized by the function
reverse – Determines the direction of the sequence traversal. If reverse is 0, the reader is positioned at the first sequence element; otherwise it is positioned at the last element.
The function initializes the reader state. After that, all the sequence elements from the first one down to the last one can be read by subsequent calls of the macro CV_READ_SEQ_ELEM(read_elem,reader) in the case of forward reading and by using CV_REV_READ_SEQ_ELEM(read_elem,reader) in the case of reverse reading. Both macros put the sequence element to read_elem and move the reading pointer toward the next element. A circular structure of sequence blocks is used for the reading process, that is, after the last element has been read by the macro CV_READ_SEQ_ELEM , the first element is read when the macro is called again. The same applies to CV_REV_READ_SEQ_ELEM . There is no function to finish the reading process, since it neither changes the sequence nor creates any temporary buffers. The reader field ptrpoints to the current element of the sequence that is to be read next. The code below demonstrates how to use the sequence writer and reader.
对于cvStartReadSeq函数官方文档说明如下:Initializes the process of sequential reading from a sequence.C: void cvStartReadSeq(const CvSeq* seq, CvSeqReader* reader, int reverse=0 )Parameters: seq – Sequencereader – Reader state; initialized by the functionrevers