arm架构下编译opencv:
/home/zsd/workspace/opencv3.4.12/opencv-3.4.12/arm-gnueabihf.toolchain.cmake内容:
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_C_FLAGS_DEBUG "" CACHE STRING "Debug CFLAGS")
set(CMAKE_CXX_FLAGS_DEBUG "" CACHE STRING "Debug CXXFLAGS")
set(CMAKE_C_FLAGS_RELEASE " -DNDEBUG" CACHE STRING "Release CFLAGS")#不加入调试信息,进一步缩小体积
set(CMAKE_CXX_FLAGS_RELEASE " -DNDEBUG" CACHE STRING "Release CXXFLAGS")#不加入调试信息,进一步缩小体积
set(CMAKE_C_COMPILER "/home/zsd/workspace/rv1109_dual_sc530ai/project/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc")
set(CMAKE_CXX_COMPILER "/home/zsd/workspace/rv1109_dual_sc530ai/project/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
#set(CMAKE_C_FLAGS "-march=armv7-a -mfloat-abi=hard -mfpu=neon")
#set(CMAKE_CXX_FLAGS "-march=armv7-a -mfloat-abi=hard -mfpu=neon")
set(CMAKE_C_FLAGS "-march=armv7-a -mfloat-abi=hard -mfpu=neon -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -DUSE_UPDATEENGINE=ON -DSUCCESSFUL_BOOT=ON" CACHE STRING "ARM CFLAGS")#-Os减小目标文件体积
set(CMAKE_CXX_FLAGS "-march=armv7-a -mfloat-abi=hard -mfpu=neon -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -DUSE_UPDATEENGINE=ON -DSUCCESSFUL_BOOT=ON" CACHE STRING "ARM CXXFLAGS")#-Os减小目标文件体积
# cache flags
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "c++ flags")
/home/zsd/workspace/opencv3.4.12/opencv-3.4.12/build_arm/make.sh:(相比于教程新增-DOPENCV_ENABLE_NONFREE=ON同时参考buildroot中opencv3的编译选项进行裁剪)
cmake -DCMAKE_TOOLCHAIN_FILE=../arm-linux-gnueabihf.toolchain.cmake \
-DCMAKE_INSTALL_PREFIX=./install_arm \
-DCMAKE_BUILD_TYPE=RELEASE -DOPENCV_ENABLE_NONFREE=ON \
-DBUILD_LIST=calib3d,core,features2d,flann,imgcodecs,imgproc,xfeatures2d \
-DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-3.4.12/modules/xfeatures2d \
-DBUILD_CUDA_STUBS=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_JASPER=OFF -DBUILD_JPEG=OFF -DBUILD_OPENEXR=OFF -DBUILD_PACKAGE=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_PNG=OFF -DBUILD_SHARED_LIBS=ON -DBUILD_TBB=OFF -DBUILD_TESTS=OFF -DBUILD_TIFF=OFF -DBUILD_WITH_DEBUG_INFO=OFF -DBUILD_WITH_DYNAMIC_IPP=OFF -DBUILD_ZLIB=OFF -DBUILD_JAVA=OFF -DBUILD_WITH_STATIC_CRT=OFF -DBUILD_opencv_androidcamera=OFF -DBUILD_opencv_cudaarithm=OFF -DBUILD_opencv_cudabgsegm=OFF -DBUILD_opencv_cudacodec=OFF -DBUILD_opencv_cudafeatures2d=OFF -DBUILD_opencv_cudafilters=OFF -DBUILD_opencv_cudaimgproc=OFF -DBUILD_opencv_cudalegacy=OFF -DBUILD_opencv_cudaobjdetect=OFF -DBUILD_opencv_cudaoptflow=OFF -DBUILD_opencv_cudastereo=OFF -DBUILD_opencv_cudawarping=OFF -DBUILD_opencv_cudev=OFF -DBUILD_ANDROID_CAMERA_WRAPPER=OFF -DBUILD_ANDROID_EXAMPLES=OFF -DBUILD_ANDROID_SERVICE=OFF -DBUILD_FAT_JAVA_LIB=OFF -DBUILD_PROTOBUF=OFF \
-DCMAKE_COLOR_MAKEFILE=OFF -DCMAKE_SKIP_RPATH=OFF -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=OFF -DCMAKE_USE_RELATIVE_PATHS=OFF \
-DENABLE_NEON=ON -DENABLE_VFPV3=ON -DENABLE_VFPV4=ON -DENABLE_CCACHE=OFF -DENABLE_AVX=OFF -DENABLE_AVX2=OFF -DENABLE_COVERAGE=OFF -DENABLE_FAST_MATH=OFF -DENABLE_FMA3=OFF -DENABLE_IMPL_COLLECTION=OFF -DENABLE_INSTRUMENTATION=OFF -DENABLE_NOISY_WARNINGS=OFF -DENABLE_OMIT_FRAME_POINTER=OFF -DENABLE_POPCNT=OFF -DENABLE_PRECOMPILED_HEADERS=OFF -DENABLE_PROFILING=OFF -DENABLE_SOLUTION_FOLDERS=OFF -DENABLE_POWERPC=OFF \
-DWITH_1394=OFF -DWITH_CLP=OFF -DWITH_CSTRIPES=OFF -DWITH_CUBLAS=OFF -DWITH_CUDA=OFF -DWITH_CUFFT=OFF -DWITH_DIRECTX=OFF -DWITH_DSHOW=OFF -DWITH_EIGEN=OFF -DWITH_FFMPEG=OFF -DWITH_GDAL=OFF -DWITH_GDCM=OFF -DWITH_GIGEAPI=OFF -DWITH_GSTREAMER=OFF -DWITH_GSTREAMER_0_10=OFF -DWITH_INTELPERC=OFF -DWITH_IPP=OFF -DWITH_IPP_A=OFF -DWITH_JASPER=OFF -DWITH_JPEG=ON -DWITH_LAPACK=OFF -DWITH_MATLAB=OFF -DWITH_MSMF=OFF -DWITH_NVCUVID=OFF -DWITH_OPENCL=OFF -DWITH_OPENCLAMDBLAS=OFF -DWITH_OPENCLAMDFFT=OFF -DWITH_OPENCL_SVM=OFF -DWITH_OPENEXR=OFF -DWITH_OPENGL=OFF -DWITH_OPENMP=OFF -DWITH_OPENNI=OFF -DWITH_OPENNI2=OFF -DWITH_OPENVX=OFF -DWITH_PNG=OFF -DWITH_PTHREADS_PF=OFF -DWITH_PVAPI=OFF -DWITH_QT=OFF -DWITH_TBB=OFF -DWITH_TIFF=OFF -DWITH_VFW=OFF -DWITH_VTK=OFF -DWITH_WEBP=OFF -DWITH_WIN32UI=OFF -DWITH_XIMEA=OFF -DWITH_OPENJPEG=OFF -DWITH_ANDROID_CAMERA=OFF -DWITH_AVFOUNDATION=OFF -DWITH_CARBON=OFF -DWITH_QUICKTIME=OFF -DWITH_VIDEOINPUT=OFF -DWITH_GPHOTO2=OFF -DWITH_UNICAP=OFF -DWITH_VA=OFF -DWITH_VA_INTEL=OFF -DWITH_XINE=OFF -DWITH_GTK=OFF -DWITH_PROTOBUF=OFF -DWITH_V4L=OFF -DWITH_LIBV4L=OFF \
-DINSTALL_C_EXAMPLES=OFF -DINSTALL_TEST=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_CREATE_DISTRIB=OFF -DINSTALL_ANDROID_EXAMPLES=OFF -DINSTALL_TO_MANGLED_PATHS=OFF -DWITH_GTK_2_X=OFF \
-DOPENCV_WARNINGS_ARE_ERRORS=OFF -DDOWNLOAD_EXTERNAL_TEST_DATA=OFF -DOPENCV_ENABLE_PKG_CONFIG=OFF ..
若执行make.sh失败,则将build_arm文件夹删掉重新创建一个编译
将安装目录install_arm下的lib和include移植到opencv_test中
编译应用命令:
arm-linux-gnueabihf-g++ main.cpp Panorama.cpp cropper.cpp -o main -I./ -I./include/ -L./lib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_imgcodecs -lopencv_imgproc -lopencv_xfeatures2d
执行./main arg1 arg2 arg3即可生成结果result.jpg图片,arg1表示几张图片,arg2表示算法阈值,arg3表示摄像头是否是倒装拍照的,正向拍照图片顺序是从左到右,倒装拍照图片顺序是从右到左
------------------------------------------------------------------------------------
ubuntu下编译opencv:参考https://blog.csdn.net/lu_linux/article/details/131113812
/home/zsd/workspace/opencv3.4.12/opencv-3.4.12/linux-gnueabihf.toolchain.cmake内容:
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(CMAKE_C_FLAGS_DEBUG "" CACHE STRING "Debug CFLAGS")
set(CMAKE_CXX_FLAGS_DEBUG "" CACHE STRING "Debug CXXFLAGS")
set(CMAKE_C_FLAGS_RELEASE " -DNDEBUG" CACHE STRING "Release CFLAGS")#不加入调试信息,进一步缩小体积
set(CMAKE_CXX_FLAGS_RELEASE " -DNDEBUG" CACHE STRING "Release CXXFLAGS")#不加入调试信息,进一步缩小体积
set(CMAKE_C_COMPILER "/usr/bin/gcc")
set(CMAKE_CXX_COMPILER "/usr/bin/g++")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
#set(CMAKE_C_FLAGS "-march=native -pipe")
#set(CMAKE_CXX_FLAGS "-march=native -pipe")
set(CMAKE_C_FLAGS "-march=native -pipe -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -DUSE_UPDATEENGINE=ON -DSUCCESSFUL_BOOT=ON" CACHE STRING "x86 CFLAGS")#-Os减小目标文件体积
set(CMAKE_CXX_FLAGS "-march=native -pipe -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -DUSE_UPDATEENGINE=ON -DSUCCESSFUL_BOOT=ON" CACHE STRING "x86 CXXFLAGS")#-Os减小目标文件体积
# cache flags
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "c++ flags")
/home/zsd/workspace/opencv3.4.12/opencv-3.4.12/build_x86/make.sh内容:
cmake -DCMAKE_TOOLCHAIN_FILE=../linux-gnueabihf.toolchain.cmake \
-DCMAKE_INSTALL_PREFIX=./install_x86 \
-DCMAKE_BUILD_TYPE=RELEASE -DOPENCV_ENABLE_NONFREE=ON \
-DBUILD_LIST=calib3d,core,features2d,flann,imgcodecs,imgproc,xfeatures2d \
-DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-3.4.12/modules/xfeatures2d \
-DBUILD_CUDA_STUBS=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_JASPER=OFF -DBUILD_JPEG=OFF -DBUILD_OPENEXR=OFF -DBUILD_PACKAGE=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_PNG=OFF -DBUILD_SHARED_LIBS=ON -DBUILD_TBB=OFF -DBUILD_TESTS=OFF -DBUILD_TIFF=OFF -DBUILD_WITH_DEBUG_INFO=OFF -DBUILD_WITH_DYNAMIC_IPP=OFF -DBUIL
Sandy6Zhou
- 粉丝: 4430
- 资源: 25
最新资源
- 和平精英_Spark绘制_Spark和平.tipa
- VIENNA维也纳拓扑,三相整流仿真模型:采用电压电流双闭环控制,电压外环采用PI控制,电流内环采用bang bang滞环控制 整流电压稳定在600V 有相关参考资料
- Matlab实现GRU-Adaboost-ABKDE的集成门控循环单元自适应带宽核密度估计多变量回归区间预测(含完整的程序,GUI设计和代码详解)
- Matlab Simulink电气工程仿真分析,电力电子变技术中的光伏全桥逆变器、SVC无功补偿、不间断电源UPS、高压直流输电HVDC,矩阵多电平开关MMC,整流器、DCDC中的Buck-Boost
- Matlab实现EVO-CNN-GRU-Mutilhead-Attention能量谷优化算法优化卷积门控循环单元融合多头注意力机制多变量多步时间序列预测(含完整的程序,GUI设计和代码详解)
- Matlab实现SSA-BiLSTM-Attention麻雀算法优化双向长短期记忆神经网络融合注意力机制多变量回归预测(含完整的程序,GUI设计和代码详解)
- 光伏储能三相PQ恒功率并网控制仿真(附参考文献及文档) ①网侧:采用PQ恒功率控制,参考文献《-微电网及其逆变器控制技术的研究》 ②储能控制:直流母线电压外环,电池电流内环双闭环控制策略直流母线电压
- Matlab实现PSO-BiLSTM-Attention粒子群算法优化双向长短期记忆神经网络融合注意力机制多变量回归预测(含完整的程序,GUI设计和代码详解)
- Matlab实现CPO-BiTCN-BiGRU冠豪猪优化时间卷积神经网络双向门控循环单元多变量时间序列预测模型(含完整的程序,GUI设计和代码详解)
- Matlab实现GVSAO-CNN-BiGRU-Attention佳点集策略和周期振荡突变策略增强雪消融算法优化卷积双向门控循环单元融合多头注意力多变量时间序列预测模型(含完整的程序,GUI设计和代码
- Matlab实现GRU-MATT门控循环单元融合多头注意力多变量时间序列预测模型(含完整的程序,GUI设计和代码详解)
- Matlab实现GAF-PCNN-MATT格拉姆角场和双通道卷积网络融合多头注意力机制多特征分类预测(含完整的程序,GUI设计和代码详解)
- Matlab实现CWT-DSCNN-MSA基于时序特征、cwt小波时频图的双流卷积融合注意力机制的分类预测(含完整的程序,GUI设计和代码详解)
- Matlab实现KPCA-ISSA-LSSVM基于核主成分分析和改进的麻雀搜索算法优化最小二乘支持向量机故障诊断分类预测(含完整的程序,GUI设计和代码详解)
- Matlab实现BiLSTM-MATT双向长短期记忆神经网络融合多头注意力多变量时间序列预测模型(含完整的程序,GUI设计和代码详解)
- Matlab实现LSTM-Mutilhead-Attention长短期记忆神经网络融合多头注意力机制多变量时间序列预测模型(含完整的程序,GUI设计和代码详解)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈