运行Re
tinaFace对应用例 retinaface_bmcv,编译生成 retinaface_bmcv.pcie,然后运行: ./retinaface_bmcv.pcie 0 ../../../data/images/face ../../../data/models/BM1684/retinaface_mobilenet0.25_fp32_1b.bmodel,程序出现segment fault,如附件现象所示。
于是,加入调测打印,发现调用imread接口读入jpg图像时,出现问题。
查找资料,发现 Mat imread(const String filename, int flags, int id ) 接口,是在特定卡上运行硬件加速功能进行改写后的接口,不是原生opencv接口。
查看当前opencv version以及安装sophon相关dev包如下:
linaro@BM1684-180:/data/young/sophonsdk/Release_230501-public/sophon-demo_20230605_085900/sophon-demo_ v0.1.6_f4d1abc_20230605/sample/RetinaFace/data/images/face$ opencv_version
4.1.0
dpkg -l | grep sophon
ii sophon-driver 0.4.8 arm64 libsophon buil t using CMake
ii sophon-libsophon 0.4.8 arm64 libsophon buil t using CMake
ii sophon-mw-soc-sophon-ffmpeg 0.6.3 arm64 Sophon multime dia library
ii sophon-mw-soc-sophon-ffmpeg-dev 0.6.3 arm64 Sophon multime dia library
ii sophon-mw-soc-sophon-opencv 0.6.3 arm64 Sophon multime dia library
ii sophon-mw-soc-sophon-opencv-dev 0.6.3 arm64 Sophon multime dia library
ii sophon-mw-sophon-ffmpeg 0.6.3 arm64 Sophon multime dia library
ii sophon-mw-sophon-opencv 0.6.3 arm64 Sophon multime dia library
ii sophon-soc-libsophon 0.4.8 arm64 libsophon buil t using CMake
ii sophon-soc-libsophon-dev 0.4.8 arm64 libsophon buil t using CMake
当前使用sdk版本为Release_230501-public,帮忙解答下为何改写opencv接口imread调用会出错?