Ubuntu16+PCL+OpenCV
2021/6/29 7:22:04
本文主要是介绍Ubuntu16+PCL+OpenCV,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
#! /bin/bash #logger输出函数 #参数表示:I:Info D:Debug W:Warn E:Error function Log() { unset OPTIND while getopts "I:D:W:E:" arg do case "${arg}" in I) echo -e "[\033[32m$(date +"%Y-%m-%d %T") Info\033[0m] ""\033[32m${OPTARG}\033[0m" ;; D) echo -e "[\033[34m$(date +"%Y-%m-%d %T") Warning\033[0m] ""\033[34m${OPTARG}\033[0m" ;; W) echo -e "[\033[33m$(date +"%Y-%m-%d %T") Warning\033[0m] ""\033[33m${OPTARG}\033[0m" ;; E) echo -e "[\033[31m$(date +"%Y-%m-%d %T") Error\033[0m] ""\033[31m${OPTARG}\033[0m" ;; ?) echo -e "[\033[31m$(date +"%Y-%m-%d %T") Error\033[0m] ""\033[31mLog参数输入错误!\033[0m" ;; esac done } function Judge_Order(){ local status=${?} test ${#} -ne 2 && \ Log -E "函数传入参数错误!" && return 80 #判断上一条命令的返回值是否为0,若为0则执行成功,若不为0则执行失败 if [ ${status} -eq 0 ];then Log -I "\"${1}\" 执行成功!" else Log -E "\"${1}\" 执行失败!" test ${2} -eq 0 && exit 127 fi echo } function Update_All() { sudo apt-get upgrade -y Judge_Order "sudo apt-get upgrade -y" 1 sudo apt-get update -y Judge_Order "sudo apt-get update -y" 1 sudo apt-get -f install -y Judge_Order "sudo apt-get -f install -y" 1 sudo apt-get autoremove -y Judge_Order "sudo apt-get autoremove -y" 1 } function Install_PCL(){ sudo apt-get install build-essential -y Judge_Order "sudo apt-get install build-essential -y" 1 sudo apt-get install libpcl-dev -y Judge_Order "sudo apt-get install libpcl-dev -y" 1 } function Install_OPENCV(){ filepath=${HOME}/Opencv.zip wget -O ${filepath} https://codeload.github.com/opencv/opencv/zip/3.4.14 if [ ! -f ${filepath} ];then Log -E "${filepath} 下载失败,任务无法继续执行!" && exit 127 fi unzip ${filepath} Judge_Order "unzip ${filepath}" 1 mkdir ${HOME}/opencv*/build cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local .. make -j8 sudo make install Judge_Order "sudo make install" 0 } function Main(){ Update_All Install_PCL Install_OPENCV } Main
这篇关于Ubuntu16+PCL+OpenCV的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-06-19EntBot.ai: AI Website Chatbot for Product Guides and Development Doc
- 2024-06-17zero-shot-learning-definition-examples-comparison
- 2024-06-06Package Easy(基于 NSIS 的打包exe安装包工具)使用方法-icode9专业技术文章分享
- 2024-06-06基于 casdoor 的 ELK 开源登录认证解决方案: elk-auth-casdoor-icode9专业技术文章分享
- 2024-05-29Elasticsearch慢查询日志配置
- 2024-05-29揭秘华为如此多成功项目的产品关键——Charter模板
- 2024-05-29海外IDC业务拓展的7大挑战
- 2024-05-29InLine Chat功能优化对标Github Copilot,CodeGeeX带来更高效、更直观的编程体验!
- 2024-05-29CodeGeeX 智能编程助手 6 项功能升级,在Visual Studio插件市场霸榜2周!
- 2024-05-29AutoMQ 生态集成 Apache Doris