如何通过sp_open_camera获取2048*1024的nv12数据

使用x3的sp_open_camera获取2048*1024的nv12的输入:

得到错误:

model_name: mobilenet_unet_1024x2048_nv12Input count: 1input[0]: tensorLayout: 2 tensorType: 1 validShape:(1, 3, 1024, 2048, ), alignedShape:(1, 3, 1024, 2048, )

Output count: 1Output[0]: tensorLayout: 0 tensorType: 13 validShape:(1, 256, 512, 19, ), alignedShape:(1, 256, 512, 19, )

2023/02/09 08:10:08.431 !WARN [x3_cam_init_param][0123]Invalid size:2048x1024

Setting VPS channel-1: src_w:2560, src_h:1440; dst_w:1920, dst_h:1080;

Setting VPS channel-2: src_w:2560, src_h:1440; dst_w:2560, dst_h:1440;

代码:

model_file = “/app/model/basic/mobilenet_unet_1024x2048_nv12.bin”;

std::shared_ptr buffer_unet(new char[FRAME_BUFFER_SIZE(2048, 1024)]);

bpu_module *bpu_obj = sp_init_bpu_module(model_file.c_str());

int h[2] = {1024, disp_h};

int w[2] = {2048, disp_w};

int enable_unet = 1;

auto camera = sp_init_vio_module();

auto display = sp_init_display_module();

int ret = sp_open_camera(camera, 0 ,2, &(w[0]),&(h[0]));

你好,目前不支持2048*1024分辨率的图像