工具/软件:
我正在使用 tivxVpacMscPyramidNode 获取不同大小的图片,似乎我只能得到 0 级的图片,其他级别的图片是黑色的。 将 tivxVpacMscPyramidNode 的级别设置为 4。

只有标记的线路输出正常;
代码如下:
vx_status writePyramidOutput(char * file_name、vx_金字塔、vx_int32 金字塔级别)
{
VX_STATUS 状态;
文件*fp = fopen (file_name、“wb")“);
vx_image out_img;
out_img = vxGetPyramidLevel (PyramidLevel、Pyramid_Level);
vx_rectange_t RECT;
vx_imagepatch_addressing_t image_addr;
vx_map_id map_id;
void *data_ptr;
vx_uint32 img_width;
vx_uint32 img_height;
vx_uint32 num_bytes = 0;
vx_df_image df;
vxQueryImage (out_img、vx_image_width、&img_width、sizeof (vx_uint32));
vxQueryImage (out_img、vx_image_height、&img_height、sizeof (vx_uint32));
vxQueryImage (out_img、vx_image_format、&df、sizeof (vx_df_image));
printf(“image_width %d。\n“、img_width);
printf(“image_height %d.\n“、img_height);
printf(“image_format %d.\n“、df);
IF (df == Vx_DF_IMAGE_U8)
{
printf(“image is u8.\n“);
}
暴露
{
printf(“图像不是 u8.\n“);
}
RECT.START_x = 0;
RECT.START_y = 0;
RECT.END_x = IMG_WIDTH;
RECT.END_y = IMG_HEIGHT;
fprintf (FP、“p5\n%d %d\n255\n“、img_width、img_height);
状态= vxMapImagePatch (out_img、
矩形 (&R)
0、
&MAP_ID、
ℑ_addr、
&DATA_PTR、
Vx_READ_ONLY、
vx_memory_type_host、
Vx_NOGAP_X);
int j;
/*复制 Luma */
对于 (j = 0;j < img_height;j++)
{
num_bytes += fwrite (data_ptr、1、img_width、fp);
data_ptr += image_addr.strip_y;
}
if (num_bytes!=(img_width * img_height))
printf(“Luma bytes writed =%d、expected =%d\n“、num_bytes、img_width * img_height);
vxUnmapImagePatch (out_img、map_id);
vxReleaseImage (&OUT_img);
fclose (fp);
故障分析 (STATUS);
}


