This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] 使用 EV_SW 重新映射鱼眼 YUV420SP 图像

Guru**** 2605055 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/583073/remap-for-fisheye-yuv420sp-image-using-eve_sw

你(们)好

我的`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 操作重映射函数

此致、

明金。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好、Myungjin、

    我已将您的问题转交 EVE 库专家进行评论。

    此致、
    Yordan
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 、Myungjin、

    1. 我更改了配置文件。 Colorforamt 6表示 YUV420SP。 对吗?

      是的、没错。

    3."  在此步骤中,它在处理函数(status = handle->ivision->algProcess (IVISION_handle) handle、&inBuf、&outBuf、&inArgs、&outArgs)处停止;" 。 您是不是说在该函数调用中处理被挂起? 您是否看到显示了任何错误消息?

    此致、

    安州

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    你好,安州。

    "您的意思是在该函数调用中将处理挂起吗?"
    是的。 没有任何错误处理。
    在运行处理功能期间、我尝试挂起。
    然后我可以看到下面的按摩。

    ARP32_EVE_1:停止目标 CPU 时出现问题:(错误-2062 @ 0x0)无法停止器件。 重置设备、然后重试此操作。 如果错误仍然存在、请确认配置、对电路板进行下电上电和/或尝试更可靠的 JTAG 设置(例如、较低的 TCLK)。 (仿真包6.0.579.0)


    我有几个问题。
    在步骤1中、当我转换了表时、我使用了提供表的"fisheyeMap256x128.bin"。
    此表是否用于重新映射单通道图像?

    要转换 YUV420SP 表、我更改了转换配置文件中的"colorFormat0 = 6"。
    然后、我认为已创建 YUV420SP 的转换表。
    我想这是对的。

    如果您需要更多信息、请告诉我。

    此致、
    明金。
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好、Myungjin、

    Anshu 正在与此功能的开发人员合作、可能需要更多的时间进行响应。
    我们会随时为您提供最新信息。

    此致、
    Yordan
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    你好,明金

    apps\remap_merge\test\src\remapExecute.c 中的代码不完整、未实现它来处理 yuv420 SP 格式。 在函数 remapExecute()中,输入 UV 平面应已传递到输入 inputBlkBufDesc.bufPlanes[1].buf,输出 UV 平面应已传递到 outputBlkBufDesc.bufPlanes[1].buf。  

    我正在附加一个 zip 补丁、其中包含已更正的文件以及升级 remapExecute testBench 以支持 yuv420SP 的其他文件。

    e2e.ti.com/.../remapExecute_5F00_yuv420sp_5F00_fix.zip

    解压缩补丁后、请将这些文件移动到以下位置:

    • apps/remap_merge/test/src/remapExecute.c
    • apps/remap_merge/test/src/remapExecute.h
    • apps/remap_merge/test/src/remapExecute_tb.c
    • apps/remap_merge/test/testvecs/input/checkboard_color_256x128_yuv420sp.yuv
    • apps/remap_merge/test/testvecs/config/remapConvertTableFishEye.cfg
    • apps/remap_merge/test/testvecs/config/remapExecuteFishEye.cfg
    • common/ti_image_file_io.c
    • common/ti_image_file_io.h

    Vision SDK 的未来版本也将包含这些修复程序。

    此致、

    维克多