版本信息:Halcon18.11
文档位置:MVTec\HALCON-18.11-Progress\doc\pdf\extension_package_programmers_manual.pdf
Halcon提供了大量的算子用于图像处理,在此基础上我们可以编写新的算子以满足更多需求。(此工作存在一定的难度)
Halcon内部数据流
缓冲区包含输入数据和输出数据。控制参数直接存储在缓冲区中,图标参数(image、region和xld)存储在数据库中,并由一个图标对象键表示。通过使用这些键,可以在数据库过程的帮助下访问图标参数。
Halcon内部的内存管理
HALCON provides a sophisticated memory management not only to handle iconic objects, but also to allocate/deallocate arbitrary data. Please use the corresponding HALCON Extension Package Interface routines exclusively. Do not create/destroy memory blocks on the heap with the standard routines of the operating system (like malloc and free) since the HALCON routines provide a caching mechanism, garbage collection for temporary data, and debugging facilities.
We strongly recommend not to use global variables within HALCON operators. If they are not avoidable at least make them static within the file of usage. If even this is undesirable group them into structures to keep the number of global names small.
If you use static variables, be aware that they are shared between multiple threads. Please note, that HALCON uses multithreading to exploit multi-processor or multi-core hardware. This means, that multiple instances of your code will actually share all the static variables! Furthermore, be aware that large static arrays consume a lot of memory – keep in mind that HALCON is a very large system enfolding hundreds of operators.
底层堆栈最初被分配为大内存块。因此,内存不是碎片化的,并且内存分配对于后续调用是快速的。
自动垃圾回收在执行HALCON运算符后释放所有临时数据。如果在执行运算符的过程中发生错误,这一点尤其重要。