【独家解密】开源Python智能相机的零门槛集成开发环境的OpenMVS的实现机制

1、开源相机简介        

        python目前人气最高,功能最全,使用最灵活的智能相机编程语言,但是对于需要快速部署的自动化应用来说,还是太复杂。笔者最近发现了一款几乎不用写代码的可能是使用最简单功能却强大的开源Python智能相机CA020-X64,它一款具有200万彩色分辨率4核A53处理器,支持Python和Opencv及深度学习推理的网口智能相机。 开源硬件链接为 https://item.taobao.com/item.htm?id=684106700771

        作为一款智能相机,她具有一键式的网络发现,远程修改IP,上传下载相机配置,预览图像,设置ROI设置,设置IO输入输出等工业相机必须具有功能。相机的所有图像采集、机器视觉处理和IO输出都是在python代码实现的,那她的这么多零门槛的功能都是怎么实现的呢?

2、智能相机的软件架构分析

CA020-X64智能相机的软件分上位机和下位机软件2大类。下位机软件运行在相机中,分成网络管理软件gvcpServer和图像处理软件corence_vision_streamer.py 两个部分。上位机软件OpenMVS提供可视化有好的界面供普通用户使用。

2.1 网络管理软件gvcpserver

其中网络管理软件gvcpserver是遵循标准的gige vision的gvcp协议,可以实现相机发现、强制IP需改,相机状态查询等功能,被各种工业相机软件如海康、大恒的视觉软件发现。除了基本功能外,gvcpserver软件为了更好的补充python语言,还是实现了相机参数和模板文件的上传和下载功能,相机参数的文件命名位camera0.xml/camera1.xml,保存在/home/目录下,方便python程序查询。网络管理软件gvcpserver开机后自动运行,可以和上位机openMVS配合,实现gige vision的大部分功能,非常方便普通用户快捷直观的配置智能相机。开源地址GitHub - BigSensor/GvcpServer: This project implements a network port industrial camera based on GVCP protocol and MJPEG steamer. The GVCP protocol in GigE Vision is used to discover the camera, modify the IP and remote control functions, and mjpeg-steamer is used to transmit image data. Combined with the OpenMVS software on the PC side, it can easily find the camera, manage the camera, obtain images, save pictures and other functions. The tested open source camera hardware link is https://item.taobao.com/item.htm?id=652142910541 ;This project implements a network port industrial camera based on GVCP protocol and MJPEG steamer. The GVCP protocol in GigE Vision is used to discover the camera, modify the IP and remote control functions, and mjpeg-steamer is used to transmit image data. Combined with the OpenMVS software on the PC side, it can easily find the camera, manage the camera, obtain images, save pictures and other functions. The tested open source camera hardware link is https://item.taobao.com/item.htm?id=652142910541 ; - GitHub - BigSensor/GvcpServer: This project implements a network port industrial camera based on GVCP protocol and MJPEG steamer. The GVCP protocol in GigE Vision is used to discover the camera, modify the IP and remote control functions, and mjpeg-steamer is used to transmit image data. Combined with the OpenMVS software on the PC side, it can easily find the camera, manage the camera, obtain images, save pictures and other functions. The tested open source camera hardware link is https://item.taobao.com/item.htm?id=652142910541 ;icon-default.png?t=N7T8https://github.com/BigSensor/GvcpServer

2.2 图像处理软件corence_vision_streamer.py

图像处理软件corence_vision_streamer.py是个纯python程序,由于相机系统内置opencv,Scikit-Image,Scipy,numpy等各种算法,所以corence_vision_streamer.py实现了相机的所有图像采集、机器视觉处理和IO输出等功能,同时corence_vision_streamer.py把视觉处理后的图像通过mjpg-streamer推流到http服务上,上位机可以通过浏览器和OpenMVS就可以预览智能相机里的图像。corence_vision_streamer.py位于相机里的/home/pi/下,用户可以自己自行修改算法,已经实现的算法有lab色块blob识别算法、二维码识别算法,深度学习yolo等算法,开源地址 GitHub - BigSensor/OpenMVS: 本软件实现了一种工业相机的PC管理控制与播放软件,实现了GVCP的Client端和mjpeg-steamer的客户端。使用GigeVision中的gvcp协议来实现对相机的发现,修改IP和远程控制功能,使用http协议来读取并解码mjpeg-steamer传输图像数据。可以方便的查找相机、管理相机、获取图像,保存图片等功能。已测试通过的开源硬件链接为 https://item.taobao.com/item.htm?id=652142910541 ; This software implements a PC management control and playback software for industrial cameras, and implements Client side of GVCP and client side of mjpeg-steamer. Use GVCP protocol in GigeVision to discover cameras, modify IP and remote control functions, and use HTTP protocol to read and decode mjpeg-steamer image data for transmission. It can easily find cameras, manage cameras, get images, save pictures and other functions.本软件实现了一种工业相机的PC管理控制与播放软件,实现了GVCP的Client端和mjpeg-steamer的客户端。使用GigeVision中的gvcp协议来实现对相机的发现,修改IP和远程控制功能,使用http协议来读取并解码mjpeg-steamer传输图像数据。可以方便的查找相机、管理相机、获取图像,保存图片等功能。已测试通过的开源硬件链接为 https://item.taobao.com/item.htm?id=652142910541 ; This software implements a PC management control and playback software for industrial cameras, and implements Client side of GVCP and client side of mjpeg-steamer. Use GVCP protocol in GigeVision to discover cameras, modify IP and remote control functions, and use HTTP protocol to read and decode mjpeg-steamer image data for transmission. It can easily find cameras, manage cameras, get images, save pictures and other functions. - GitHub - BigSensor/OpenMVS: 本软件实现了一种工业相机的PC管理控制与播放软件,实现了GVCP的Client端和mjpeg-steamer的客户端。使用GigeVision中的gvcp协议来实现对相机的发现,修改IP和远程控制功能,使用http协议来读取并解码mjpeg-steamer传输图像数据。可以方便的查找相机、管理相机、获取图像,保存图片等功能。已测试通过的开源硬件链接为 https://item.taobao.com/item.htm?id=652142910541 ; This software implements a PC management control and playback software for industrial cameras, and implements Client side of GVCP and client side of mjpeg-steamer. Use GVCP protocol in GigeVision to discover cameras, modify IP and remote control functions, and use HTTP protocol to read and decode mjpeg-steamer image data for transmission. It can easily find cameras, manage cameras, get images, save pictures and other functions.icon-default.png?t=N7T8https://github.com/BigSensor/OpenMVS

3、上位机集成管理软件OpenMVS

OpenMVS是在windows下运行的智能相机集成管理软件,已经实现功能有一键式的网络发现,远程修改IP,上传下载相机配置,预览图像,设置ROI设置,设置IO输入输出等工业相机必须具有功能,开发者即将要实现功能还有模型匹配、深度学习设置、机器人定位等功能。

3.1 OpenMVS的搜索和图像预览功能

如果所示,点击左上角的搜索相机按钮,OpenMVS会向局域网中广播discovery命令,智能相机接收到命令后会向局域网发送自身的IP信息和状态信息,此命令可以跨网段搜索。收到智能相机的应答命令后,OpenMVS会在对应网卡下面显示相机的列表,点击列表中选择相机,可以在左下角看到相机的信息,点击右上角的连接相机按钮,然后点击播放按钮,就可以看到相机处理后的图像。

3.2 ROI设置和色块识别设置

以LAB色块识别(blob分析)为例:,智能相机内置了一个色块识别算法,点击添加ROI按钮,可以添加一个新ROI,再点击ROI按钮,可以编辑ROI大小和位置。可以先选一个小一点的ROI,可以查看右下角ROI范围内的颜色通道直方图,根据直方图,可以设置想识别的颜色更分量阈值范围。阈值设置完成后,再编辑ROI,把ROI设大一点作为色块的搜索范围。

ROI和搜索目标的色块阈值设置完成后,可以把参数下载到相机

openMVS就会把参数传给相机里的gvcpServer,gvcpServer会把相机参数保存到/home/camera.xml中,corence_vision_streamer.py读取xml的信息,然后就可以重新配置检测范围,然后把识别的结果输出到对应的gpio中。

3.3 OpenMVS的IP修改功能

当发现智能相机和上位机不在一个IP网段时,有时需要修改智能相机的IP,这个时候可以双击OpenMVS左边列表中的相机,再弹出来的界面中,可以修改IP,这个时用到了gvcp的forceip命令

GitHub - BigSensor/OpenMVS: 本软件实现了一种工业相机的PC管理控制与播放软件,实现了GVCP的Client端和mjpeg-steamer的客户端。使用GigeVision中的gvcp协议来实现对相机的发现,修改IP和远程控制功能,使用http协议来读取并解码mjpeg-steamer传输图像数据。可以方便的查找相机、管理相机、获取图像,保存图片等功能。已测试通过的开源硬件链接为 https://item.taobao.com/item.htm?id=652142910541 ; This software implements a PC management control and playback software for industrial cameras, and implements Client side of GVCP and client side of mjpeg-steamer. Use GVCP protocol in GigeVision to discover cameras, modify IP and remote control functions, and use HTTP protocol to read and decode mjpeg-steamer image data for transmission. It can easily find cameras, manage cameras, get images, save pictures and other functions.本软件实现了一种工业相机的PC管理控制与播放软件,实现了GVCP的Client端和mjpeg-steamer的客户端。使用GigeVision中的gvcp协议来实现对相机的发现,修改IP和远程控制功能,使用http协议来读取并解码mjpeg-steamer传输图像数据。可以方便的查找相机、管理相机、获取图像,保存图片等功能。已测试通过的开源硬件链接为 https://item.taobao.com/item.htm?id=652142910541 ; This software implements a PC management control and playback software for industrial cameras, and implements Client side of GVCP and client side of mjpeg-steamer. Use GVCP protocol in GigeVision to discover cameras, modify IP and remote control functions, and use HTTP protocol to read and decode mjpeg-steamer image data for transmission. It can easily find cameras, manage cameras, get images, save pictures and other functions. - GitHub - BigSensor/OpenMVS: 本软件实现了一种工业相机的PC管理控制与播放软件,实现了GVCP的Client端和mjpeg-steamer的客户端。使用GigeVision中的gvcp协议来实现对相机的发现,修改IP和远程控制功能,使用http协议来读取并解码mjpeg-steamer传输图像数据。可以方便的查找相机、管理相机、获取图像,保存图片等功能。已测试通过的开源硬件链接为 https://item.taobao.com/item.htm?id=652142910541 ; This software implements a PC management control and playback software for industrial cameras, and implements Client side of GVCP and client side of mjpeg-steamer. Use GVCP protocol in GigeVision to discover cameras, modify IP and remote control functions, and use HTTP protocol to read and decode mjpeg-steamer image data for transmission. It can easily find cameras, manage cameras, get images, save pictures and other functions.icon-default.png?t=N7T8https://github.com/BigSensor/OpenMVS

4 总结

本智能相机实现了一种上电就可以用的智能相机方案,较好的解决了python智能相机的易用性问题,大家有什么建议和想实现的功能,请在下面留言,我们可以建议开发者把更多更好的功能加上

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值