你(们)好
我的`m。
我正在尝试对鱼眼 YUV420映像应用重映射应用程序。
我正在使用"$(EVE_SW_ROOT)/apps/remap_merge 中的 remapEvecute
我尝试执行以下步骤。
1.创建转换表
在 testvecs 控制器中、有一个名为 remapConverTableFishEye.cfg 的配置文件
我更改了配置文件。 Colorforamt 6表示 YUV420SP。 对吗?
在此步骤中、我获得了"map256x128_conv_sp.bin"
numTestCases = 1.
remapWidth0 = 256
remapHeight0=128
blockWidth0 = 128
blockHeight0=8
ColorFormat0 = 6
qShift0 = 2
函数 Name0 ="fisheye _getLeftBlockMap"
inputMapFileFormat0 = 0
inputMapFile0 ="../testvecs/input/fisheyeMap256x128.bin
outputMapFileFormat0 = 0
outputMapFile0 ="../testvecs/output/map256x128_conv_sp.bin
2.我实现了一些用于读写 YUV420映像的功能。
int32_t ReadFile_YUV420SP (const INT8_t *文件名、
uint8_t **图像,
uint16_t 高度、
uint16_t 宽度)
{
TI_FILE *fp;
内部 CHR;
int32_t STATUS= 0;
/
*如果给定了文件名,请打开输入映像文件进行读取。 如果没有
*提供了 filename、将 FP 设置为从标准输入中读取。
秘书长的报告 /
//printf ("\n\t 启动 ReadFilePGM ()例程。\n");fflush (stdout);
if ((fp = FOPEN ((const char*) infilename、"rb"))== NULL){
printf ("\n 在 ReadFile_YUV420SP ()中读取文件%s 时出错。"、infilename);fflush (stdout);
status=-1;
转到出口;
}
/
*分配存储器以存储映像,然后从文件中读取映像。
秘书长的报告 /
if (((* image)=(uint8_t *) malloc (width* height*3/2)= NULL){
printf ("\n ReadFile_YUV420SP ()中的内存分配失败。\n");fflush (stdout);
fclose (FP);
STATUS=1;
转到出口;
}
// printf ("\n\t\t\t 在 ReadFilePGM ()中找到%d 个字节。\n",width* height*(* bytesPerPixel);fflush (stdout);
//待办事项:检查字节序以查看我们是否需要稍后切换订单
//chr =(宽度*高度);
CHR = FREAD ((*图像)、1、宽度*高度*3/2、fp);//// CCS 文件加载:在第57行之前注释此块、并在此处设置断点。 将 size width*height 字节的数据上载到地址*image。
if (chr!=(width*height*3/2)){
printf ("\n 在 ReadFile_YUV420SP ()中读取图像数据时出错。");fflush (stdout);
fclose (FP);
free((*image));
status=-1;
转到出口;
}
fclose (FP);
// printf ("\n\tReadFilePGM()中的 Closed 文件。\n");fflush (stdout);
退出:
退货状态;
}
int32_t WriteFile_YUV420SP (const INT8_t *输出文件名、
const uint8_t *图像、
uint16_t n_rows、
uint16_t n_cols)
{
TI_FILE *fp;
uint32_t 大小;
int32_t STATUS= 0;
/
*如果给定了文件名,请打开输出映像文件进行写入。 如果没有
提供了* filename、将 FP 设置为写入标准输出。
秘书长的报告 /
if ((fp = FOPEN ((const char*) outfilename、"WB"))== NULL){
printf ("在 writeFileYUV420SP ()中写入文件%s 时出错。\n"、outfilename);fflush (stdout);
status=-1;
转到出口;
}
/
*将图像数据写入文件。
秘书长的报告 /
size = n_rows * n_cols;
fwrite((void*)image,1,size*3/2,fp);
fclose (FP);
退出:
退货状态;
}
我在下面添加了用于读取 YUV420SP 映像的代码。 在 remapExecute 函数后面、我还添加了写入函数。
否则、如果(gConfig_remapExecute[t].colorFormat== 6)
{
ReadFile_YUV420SP ((const INT8_t*)文件路径,
输入(&I)、
gConfig_remapExecute[t].inputHeight、
gConfig_remapExecute[t].inputWidth);
output=(uint8_t*) malloc (gConfig_remapExecute[t].remapWidth*gConfig_remapExecute[t].remapHeight*3/2);
}
status= remapExecute (&gConfig_remapExecute[t]、输入、输出);
3.执行重映射
我更改了名为 remapExecuteFishEye.cfg 的配置文件
在此步骤中,它在处理函数(status = handle->ivision->algProcess (IVISION_handle) handle、&inBuf、&outBuf、&inArgs、&outArgs)处停止;)
numTestCases = 1.
remapWidth0 = 256
remapHeight0=128
InputWidth0 = 256
InputHeight0 = 128
ColorFormat0 = 6
originalMapFile0 ="../testvecs/input/fisheyeMap256x128.bin
convertedbinMapFile0 ="../testvecs/output/map256x128_conv_sp.bin
inputFile0 ="../testvecs/input/img256x128_sp.yuv
outputFile0 ="../testvecs/output/fish_256x128_sp.yuv
这些处理是否正确?
请告诉我。 我想使用 EV_SW 库为 YUV420SP 操作重映射函数
此致、
明金。