Can we randomly access a point in开发者_如何学C a CvSeq object? We can traverse it, so I imagine it's possible in a simple manner. How is this accomplished?
I have found it. There is a method called cvGetSeqElem
, which takes in the sequence and the index. Thanks for the help though. This might just follow the linked list linearly, but it's simpler than manually coding the search.
Looking at the OpenCV API (http://opencv.willowgarage.com/documentation/dynamic_structures.html) it doesn't sound possible. Looks to be some form of linked list implementation, which means that the only way to access an element part way though is to follow the links.
cvSeq is a linked list - you have to follow the chain of links, you have no idea where the next entry is stored in memory.
精彩评论