linux RK3588平台使用GPU加速图像处理 - &#34

📅 2026-11-30 👤 拼多多助力营销技巧 📂 拼多多助力2027 👁️ 413 次阅读

RK3588平台gpu Mali-LODX r0p0,opengcv4.7.0使用gpu加速,

报错内容

OpenCL program build log: imgproc/color_hsv

Status -11: CL_BUILD_PROGRAM_FAILURE

-D depth=0 -D scn=3 -D PIX_PER_WI_Y=1 -D hrange=180 -D bidx=0 -D dcn=3

:167:9: error: expected member name or ';' after declaration specifiers

int32_t depth; /**< The image depth. */

~~~~~~~ ^

:1:15: note: expanded from here

#define depth 0

^

:167:8: error: expected ';' at end of declaration list

int32_t depth; /**< The image depth. */

^

error: Compiler frontend failed (error code 62)

OpenCL program build log: core/inrange

Status -11: CL_BUILD_PROGRAM_FAILURE

-D HAVE_SCALAR -D cn=3 -D srcT=uchar3 -D srcT1=uchar -D dstT=uchar -D kercn=3 -D depth=0 -D colsPerWI=1

:169:9: error: expected member name or ';' after declaration specifiers

int32_t depth; /**< The image depth. */

~~~~~~~ ^

:7:15: note: expanded from here

#define depth 0

^

:169:8: error: expected ';' at end of declaration list

int32_t depth; /**< The image depth. */

^

error: Compiler frontend failed (error code 62)

现象就是编译正常,运行也正常,但是运行使用gpu的相关使用的仍然是gpu可能还会爆出其他错误

,原因应该会死该参数重复命名了导致opencgl编译链接是出问题。

修改

opencv-4.7.0/modules/core/src/arithm.cpp

String opts = format("%s-D cn=%d -D srcT=%s -D srcT1=%s -D dstT=%s -D kercn=%d -D s_depth=%d%s -D colsPerWI=%d",

haveScalar ? "-D HAVE_SCALAR " : "", cn, ocl::typeToStr(CV_MAKE_TYPE(sdepth, kercn)),

ocl::typeToStr(sdepth), ocl::typeToStr(CV_8UC(colsPerWI)), kercn, sdepth, 拼多多帮助力入口

doubleSupport ? " -D DOUBLE_SUPPORT" : "", colsPerWI);

opencv-4.7.0/modules/imgproc/src/imgwarp.cpp

cv::String baseOptions = format("-D s_depth=%d -D scn=%d -D PIX_PER_WI_Y=%d ",

src.depth(), src.channels(), pxPerWIy);

然后重新编译即可 这俩文件文件中的depth,改为s_depth,随意该即可,就是为了该参数无用,从而使用默认参数即可 修改后无相关的报错

linux RK3588平台使用GPU加速图像处理

精彩链接

标签: 拼多多助力网站平台 赚钱项目 拼多多助力网 首码项目 手赚APP
拼多多助力营销技巧