OpenVX 编程:图导出导入与基本图像变换
1. OpenVX 图的导出与保存
在 OpenVX 中,当图导出成功时,我们可以将其保存到文件中。以下是导出图并保存到文件的代码示例:
if ( VX_SUCCESS == status) {
/* We have a valid export of length bytes at address blob. Do
something with it like writing it
to a file... */
if (argc == 2) {
const char * filename = argv[1];
FILE *fp = fopen(filename, "wb");
if (fp) {
if ((fwrite(blob, length, 1, fp) == 1) && (fclose(fp) == 0))
{
printf("Wrote the exported graph to file ’%s’, total %zu bytes\n", filename, length);
} else {
fclose(fp);
printf("Error writing to file ’%s’\n", filename);
}
} else {
printf("Could
超级会员免费看
订阅专栏 解锁全文
26

被折叠的 条评论
为什么被折叠?



