airockchip / rknn-toolkit2

Other
1.03k stars 106 forks source link

可以提供opencv的C++,cv::mat格式的图像输入的示例代码? #37

Open sc779733661 opened 7 months ago

sc779733661 commented 7 months ago

使用2.0版本的rknn,关于图像输入,有没有opencv的C++版本?如下的yolov8_seg例子中的输入是一个自定义的结构体image_buffer_t ,可以提供cv::mat格式的图像输入的示例代码吗? image_buffer_t src_image; memset(&src_image, 0, sizeof(image_buffer_t)); ret = read_image(image_path, &src_image);

object_detect_result_list od_results;
ret = inference_yolov8_seg_model(&rknn_app_ctx, &src_image, &od_results);
TRYOKETHEPEN commented 6 months ago

https://github.com/airockchip/rknn-toolkit2/blob/77b71094e08391c543d9c65fea5f7cf98cc16eee/rknpu2/examples/rknn_yolov5_demo/src/main.cc#L242