如何在 Amazon Linux 上安装 OpenCV? [英] How to install OpenCV on Amazon Linux?

查看:30
本文介绍了如何在 Amazon Linux 上安装 OpenCV?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Amazon Linux 实例上安装 OpenCV 以与 Pastec 一起使用.这是我第一次使用亚马逊服务,我对linux的使用经验并不多......

I'm trying to install OpenCV for use with Pastec on an Amazon Linux instance. This is my first time using an Amazon service, and I don't have much experience using linux...

我将如何在 Amazon Linux 上安装 OpenCV 及其依赖项?

How would I install OpenCV and it's dependencies on Amazon Linux?

我尝试使用以下命令添加 EPEL 存储库:

I have tried adding the EPEL repository using this command:

$ sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

...虽然有效,但仍然无法安装 OpenCV...

... which works but it still won't install OpenCV...

$ sudo yum --enablerepo=epel install opencv-core
Loaded plugins: priorities, update-motd, upgrade-helper
948 packages excluded due to repository priority protections
Nothing to do

推荐答案

Amazon AMI 的默认 yum repo 似乎不包含 OpenCV 包.

It seems that default yum repo for Amazon AMI doesn't contain OpenCV packages.

您可以通过以下简单步骤自行从源代码编译:

You can compile it from sources by yourself with the following simple steps:

  • 安装必要的软件包:

sudo yum install git cmake gcc-c++

  • 从存储库克隆 OpenCV:

git clone https://github.com/Itseez/opencv.git

  • (可选)选择所需的版本:

git checkout <所需版本>

  • 编译和安装 - 创建要在其中构建的文件夹,在那里输入并键入:

cmake <源路径>制作须藤制作安装

这是基本步骤 - 在此之后,您将拥有带有一些默认模块的 OpenCV.您可以在实际构建之前阅读 cmake 输出并调整您的安装.可能您应该根据需要安装其他软件包(例如 libpnglibjpgpython 等).

It's basic steps - after this you will have OpenCV with some default modules. You can read cmake output and adjust your installation before actual build. Possibly you should install additional packages for your needs (like libpng, libjpg, python etc.).

这篇关于如何在 Amazon Linux 上安装 OpenCV?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆