TX2+海康工业相机,MVS安装

TX2+海康工业相机

  • 安装MVS并且运行示例程序
    • 安装
    • 运行客户端
    • 例程

安装MVS并且运行示例程序

硬件:
NVIDIA Jetson TX2 + ubuntu 16.04
相机:海康机器人 MV-CE120-10GM

安装

[https://www.hikrobotics.com/cn/machinevision/service/download?module=0]
下载 机器视觉工业相机客户端MVS V2.1.0(Linux)
解压,选择aarch64,可以选择deb安装,也可以选择tar.gz文件安装,本次选择后者。

tar -xvf MVS-2.1.0_aarch64_20201228.tar.gz

会显示

MVS-2.1.0_aarch64_20201228/
MVS-2.1.0_aarch64_20201228/set_rp_filter.sh
MVS-2.1.0_aarch64_20201228/set_usb_priority.sh
MVS-2.1.0_aarch64_20201228/MVS.tar.gz
MVS-2.1.0_aarch64_20201228/set_env_path.sh
MVS-2.1.0_aarch64_20201228/README
MVS-2.1.0_aarch64_20201228/INSTALL
MVS-2.1.0_aarch64_20201228/set_usbfs_memory_size.sh
MVS-2.1.0_aarch64_20201228/set_socket_buffer_size.sh
MVS-2.1.0_aarch64_20201228/setup.sh
MVS-2.1.0_aarch64_20201228/set_sdk_version.sh

输入

cd MVS-2.1.0_aarch64_20201228
sudo bash setup.sh

显示

[sudo] password for nvidia: 

输入密码 nvidia
显示

Install MVS,Please wait...
cp: cannot stat '/opt/MVS/bin/fonts/*': No such file or directory
Set up the SDK environment...

Adding rules for vendor ID 2bdf.
The /etc/udev/rules.d/80-drivers-HikSDK-2bdf.rules rule has been created.

aarch64
/home/nvidia/.profile
/home/ubuntu/.profile
/home/nvidia/.bashrc
/home/ubuntu/.bashrc
create link to dynamic library
Install MVS complete!
Tips: You should be launch a new terminal or execute source command for the bash environment!

运行客户端

之后运行客户端
在computer下找到 /opt/MVS/bin并在此打开终端,输入
./MVS
即可打开MVS客户端,之后根据提示修改ip即可(Gige口相机)

例程

MVS安装自带一些例程,在/opt/MVS/Samples/aarch64下

要运行例程,首先需要查看LD_LIBRARY_PATH和MVCAM_COMMON_RUNENV是否生效
输入
echo $LD_LIBRARY_PATH
显示

/opt/MVS/lib/*******

输入
`echo $MVCAM_COMMON_RUNENV
显示

/opt/MVS/lib

若当前环境不存在以上两个变量或者变量不包含/opt/MVS/lib相关值时,需要在跳转到安装包所在路径,输入

source ./set_env_path.sh

运行示例程序还应该安装X11相关库
输入

sudo apt-get install libx11-dev

之后进入想要运行的子目录,例如Display

cd /opt/MVS/Samples/aarch64/Display
make
./Display

显示

Device Model Name: MV-CE120-10GM
CurrentIp: 169.254.10.1
UserDefinedName: 

Please Intput camera index: 

我只有一个相机,index是0,输入0,即可得到相机拍摄画面

你可能感兴趣的:(TX2,arm,计算机视觉)