如何在 OpenCV 中删除 cvseq?
Bradski 指出,“当您想要删除序列时,可以使用 cvClearSeq(),这是一个清除序列中所有元素的例程。”
但是,此函数不会将内存存储中分配的块返回到存储或系统。
他说“如果您想出于其他目的检索该内存,则必须通过 cvClearMemStore() 清除内存存储”。
这个函数似乎不存在:
error C3861: 'cvClearMemStore': identifier not found
在本书的勘误表中,它指出:“'cvClearMemStore'应该是'cvClearMemStorage'”,但这个函数需要一个指向CvMemStorage的指针,而不是CvSeq。
error C2664: 'cvClearMemStorage' : cannot convert parameter 1 from 'CvSeq *' to 'CvMemStorage *'
有什么想法吗?
Bradski states that "When you want to delete a sequence, you can use cvClearSeq(), a routine that clears all elements of the sequence."
HOWEVER, this function does not return allocated blocks in the memory store to either the store or to the system.
He says that "If you want to retrieve that memory for some other purpose, you must clear the memory store via cvClearMemStore()".
This function does not appear to exist:
error C3861: 'cvClearMemStore': identifier not found
In the errata for the book, it states that: " 'cvClearMemStore' should be 'cvClearMemStorage' " but this function expects a pointer to CvMemStorage, not CvSeq.
error C2664: 'cvClearMemStorage' : cannot convert parameter 1 from 'CvSeq *' to 'CvMemStorage *'
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我确信他的意思是
cvClearMemStorage()
:从标题复制的文本: core/core_c.h
从错误中可以看出,您向此函数传递了错误的数据类型。 查看这些函数的文档以准确了解如何调用它们。
我将尝试用下面的代码进行说明:
有一些教程展示了cvSeq的用法。我发现这个非常有趣。帖子底部有一个源代码链接。
I'm convinced that he meant
cvClearMemStorage()
:Text copied from the header: core/core_c.h
As you can tell from the error, you are passing the wrong data type to this function. Check the docs of these functions to know exactly how to call them.
I'll try to illustrate with the code below:
There are a few tutorials out there that shows the use of cvSeq. I found this one quite interesting. There's a link to the source code at the bottom of the post.
看起来
CVMemStorage
结构被用作基本的低级结构来创建存储空间。关于 CvMemStorage 的描述如下:
您的 struct cvSeq 包含一个指向 CVMemStorage 的指针,以告诉它存储在哪里
因此,您需要调用
CvClearMemStorage
并将指向cvSeq
对象的CvMemStorage
的指针传递给它,这将清除您的存储空间CvSeq
对象。此页面上对此进行了很好的解释。
It looks like the
CVMemStorage
structure is used as a basic low-level structure to create space to store things.It says about CvMemStorage:
Your struct cvSeq contains a pointer to a
CVMemStorage
to tell it where it is stored.So you'd need to call
CvClearMemStorage
and pass the pointer to theCvMemStorage
of yourcvSeq
object to it, which will clear the storage for yourCvSeq
object.It is really nicely explained on this page.