|
5#
楼主 |
发表于 2019-10-10 23:58:54
|
只看该作者
我是这样做的:
rockx_handle_t object_det_handle;
rockx_image_t input_image;
rockx_object_array_t object_array;
ret= rockx_create(&object_det_handle,ROCKX_MODULE_OBJECT_DETECTION,nullptr,0);
if(ret!=ROCKX_RET_SUCCESS){
return;
}
input_image.pixel_format=ROCKX_PIXEL_FORMAT_BGR888);
input_image.data=(uinit8_t)malloc(1920*1080*3);
while(true){
Mat frame;
capture >> frame;
input_image.width=frame.cols;
input_image.height=frame.rows;
memcopy(input_image.data,frame.data,frame.cols*frame.rows*3);
memset(&object_array,0,sizeof(rockx_object_array_t);
ret=rockx_object_detect(object_det_handle,&input_image,&object_array,nullptr);
if(ret!=ROCKX_RET_SUCCESS){
.....
}
}
free(input_image.data);
rockx_destroy(object_det_handle);
你认为以上代码有问题?
什么情况下,rockx_object_detect 会返回-1?
我有3个线程同时执行以上代码。 |
|