lytro相机拍摄技巧

Living in the boonies, I’m fortunate that for many food items I can just walk to the local farm. For most other things, though, my family shops online. This year our fairly long driveway really needed to be re-paved, which meant that for two months, no delivery or other heavy trucks could drive on it. We put a box for deliveries at the end of the driveway, but we can’t see it from our house, so both for convenience and safety we really wanted a camera on it.

生活在赏金中,我很幸运,对于很多食物,我都可以步行到当地的农场。 但是,对于大多数其他事情,我的家人在网上购物。 今年,我们确实需要重新铺设相当长的车道,这意味着两个月来,没有运输工具或其他重型卡车可以行驶。 我们在车道的尽头放了一个用于运输的盒子,但我们从家中看不到它,因此为了方便和安全起见,我们确实希望在其上安装一个摄像头。

(Image by author)
(作者提供的图片)

建立 (Setup)

I figured a good place to mount a camera was an existing utility pole by the driveway (inside the property), which is a bit less than 100m (328 ft) from the house and some 50m (164 ft) from the box; the question then was how to best bring power and connectivity to it. There are lots of ways one could do this, from batteries, solar cells and cell networks to radio links and cables. Wanting to keep costs down, I thought of the 10 or so year old “airport class” camera I had unused in my basement.

我认为安装摄像机的好地方是车道(物业内部)附近的一根电线杆,距离房屋不到100m(328英尺),离盒子不到50m(164 ft)。 然后的问题是如何最好地为其提供电源和连接性。 从电池,太阳能电池和电池网络到无线电链路和电缆,有许多方法可以做到这一点。 为了降低成本,我想到了我地下室未使用的10年前的“机场类”相机 。

(Image by author)
(作者提供的图片)

The pole was within PoE range, so to run it I just needed some direct burial cable. I could solve the delivery box notification problem with minimal cost, put the camera to use AND use some deep learning to get a modern detector… that was too good a project to pass up!

极点在PoE范围内,因此要运行它,我只需要一些直埋电缆即可。 我可以用最少的成本解决送货箱通知问题,使用相机并进行深度学习,以获得现代化的探测器……这真是个好项目,无法通过!

After most of a sweaty day climbing the pole, burying, routing, securing and crimping cables, I had the camera up and running. Following a path of least resistance, but also to see what I would learn, I decided to have the camera continuously record over the network onto a Linux system and to process it there using a YOLO v3/v4 object detector I wrote some time ago. I would have loved to run the inference right on the camera, but its CPU and storage are tiny and there’s no USB port for an accelerator.

经过一整天的汗水攀爬电线杆,埋没,布线,固定和压接电缆后,我才将相机启动并运行。 沿着一条阻力最小的途径,但也想了解我会学到的东西,我决定让摄像机通过网络连续记录到Linux系统上,并使用我前一段时间编写的YOLO v3 / v4对象检测器在那里进行处理。 我很想在相机上直接运行推理,但是它的CPU和存储空间很小,并且没有用于加速器的 USB端口。

记录与处理 (Recording and Processing)

While quite feature rich, the camera is old enough to make some things hard to use. It has a motion detection feature, for example, but requires Java applet support in the browser to easily configure… yeah, right. And it can record to network attached storage, but only using the SMBv1 protocol. Installing samba on my system was a matter of sudo apt install samba, but it took some more serious research to find the “incantation” needed in /etc/samba/smb.conf so it’d speak SMBv1:

相机虽然功能丰富,但已经足够老旧,难以使用。 例如,它具有运动检测功能,但需要浏览器中的Java applet支持才能轻松配置…… 是的,对 。 它可以记录到网络连接的存储,但只能使用SMBv1协议。 在我的系统上安装samba是sudo apt install samba ,但是花了一些更认真的研究才能在/etc/samba/smb.conf找到所需的“ 咒语 ”,所以它说的是SMBv1:

min protocol = NT1ntlm auth = ntlmv1-permitted

By recording to the Linux system, I got easy access to the data (no need to research its API for processing on the camera itself), the ability to re-process data at will as I tweaked my code and neural net, and longer term archival. I used OpenCV to read the files and to create small clips that I include in the notifications.

通过记录到Linux系统,我可以轻松访问数据(无需研究其API在相机本身上进行处理),可以在调整代码和神经网络时随意重新处理数据,并且可以长期使用档案。 我使用OpenCV读取文件并创建包含在通知中的小片段。

Running the detection off the files did introduce a bit of a delay, though: the recording is done in one-minute segments, and it isn’t processed until it is finished; add to that a few seconds for the script to notice that there is a new file, a few more for running inference on it, and a few more to send out any notifications. All in all, it could take about a minute and a half between the detected event and its notification. I thought that was good enough, but another option would have been to process the video using an RTSP stream, which both the camera and OpenCV support.

但是,对文件进行检测确实会带来一些延迟:录制是在1分钟的时间内完成的,直到完成后才进行处理; 再加上几秒钟,脚本便会注意到有一个新文件,还有更多文件可用于在其上进行推断,还有几秒钟可发出任何通知。 总而言之,检测到的事件与其通知之间可能要花费大约一分半钟。 我认为这已经足够好了,但是另一种选择是使用RTSP流来处理视频,而相机和OpenCV都支持RTSP流 。

不相关的检测 (Irrelevant Detections)

The camera’s view of the driveway entrance also includes some of the road, and you wouldn’t believe just how much goes by a quiet country road… until you get notified about each one. Not just cars and trucks, but also neighbors walking their dog at 5 am, a turkey family or (non skid steer) bobcat going by.

摄像机在车道入口处的视野还包括一些道路,您不会相信一条安静的乡间小路会走多少路……直到您被告知每条道路。 不仅是汽车和卡车,还有邻居在凌晨5点walking狗,火鸡家庭或(防滑cat)山猫经过。

Turkey Family; Bobcat (images by author)
土耳其家庭; 山猫(作者图片)

In my case, the border between “in” and “out” is a straight line, which makes the road simple to ignore:

在我的情况下,“ in”和“ out”之间的边界是一条直线,这使道路易于忽略:

(Image by author)
(作者提供的图片)

I also filter out all but a few detection classes: I used the original YOLOv3 weights trained using the COCO dataset, which includes classes such as “toothbrush”, “zebra” and “fire hydrant”. Realistically any such detections would be false positives.

我还过滤掉了除少数几个检测类之外的所有类:我使用了原始的YOLOv3权重,该权重是使用COCO数据集训练的,其中包括“牙刷”,“斑马”和“消火栓”等类。 实际上,任何此类检测都是误报。

Since the camera is PTZ, at the start I ambitiously thought I’d train a neural network to recognize where it was pointed and adjust the relevant detection area. I might still try that, but for now it was simpler to just not change the orientation.

由于摄像机是PTZ ,一开始我就雄心勃勃地以为我会训练一个神经网络来识别它指向的位置并调整相关的检测区域。 我可能仍会尝试,但是就目前而言,不更改方向更加简单。

通知事项 (Notifications)

For the notifications, given my previous work, it seemed easiest to email myself, with the credentials coming from a JSON file so that they’re not in the code.

对于通知,鉴于我以前的工作 ,用JSON文件提供凭据来使自己不在代码中似乎是最容易用电子邮件发送给自己的。

For each detection sequence, I include a small MP4 clip and a corresponding “representative” image in higher resolution. Usually the image is all I need, but the clip, which also plays on my phone, can be instrumental to understand what is going on, such as when someone decides to turn around at the entrance. I use the frame with the the largest area in bounding boxes for the “representative” image.

对于每个检测序列,我都包括一个小MP4剪辑和一个更高分辨率的对应“代表”图像。 通常,图像只是我所需要的,但是也可以在手机上播放的剪辑可以帮助您了解正在发生的事情,例如有人决定在入口处转身时。 我将边框中具有最大面积的框架用于“代表性”图像。

(Image by author)
(作者提供的图片)

性能 (Performance)

The camera is set to record 1080p video at 15 FPS. On my Linux system, using a tf.data pipeline and only using the CPU, I can process that at about 4 FPS, so I needed it to be faster. Significantly faster, in fact, so that it could catch up if interrupted. Some options were:

摄像机设置为以15 FPS录制1080p视频。 在我的Linux系统上,使用tf.data管道并且仅使用CPU,我可以大约4 FPS的速度处理它,因此我需要更快的速度。 实际上,速度显着提高,因此如果被中断,它可能会赶上。 一些选项是:

  • use the GPU, but I wanted it to remain free for other ML tasks. Besides, my GPU only gets me to about 15 FPS;使用GPU,但我希望它对其他ML任务保持免费。 此外,我的GPU只能使我达到约15 FPS;
  • use a smaller/faster network. There are so many options here… I tried yolov3-tiny but didn’t love the loss in accuracy. I tried OpenCV’s readNetFromDarknet, but it was actually a bit slower than my implementation. I have yet to try MobileNet SSD or something else from the TensorFlow object detection API;

    使用较小/较快的网络。 这里有很多选择……我尝试了yolov3-tiny但不喜欢准确性方面的损失。 我尝试了OpenCVreadNetFromDarkne t ,但是实际上比我的实现要慢一些。 我还没有尝试过MobileNet SSD或TensorFlow对象检测API中的其他工具 ;

  • use TensorFlow Lite or some other optimization for inference. I had trouble running the converted TF Lite model (it dumped core). I tried converting to CoreML (to run on a mac), but the conversion kept failing. Overall my script was working well enough at this point, so I didn’t put in the time to fully investigate;使用TensorFlow Lite或其他一些优化进行推理。 我在运行转换后的TF Lite模型(转储核心)时遇到了麻烦。 我尝试转换为CoreML(在Mac上运行),但转换失败。 总体而言,我的脚本在这一点上运行良好,因此我没有花时间进行全面调查。
  • push the data into the cloud and process it there, but I was trying to keep costs down, and didn’t like the loss in bandwidth. No, this was an edge ML project;

    将数据推送到云中并在那里进行处理,但是我试图降低成本,并且不喜欢带宽损失。 不,这是一个边缘ML项目;

  • reduce frame rate I’m recording at. I wanted a relatively high frame rate for archival (so I could, for example, zoom into license plates; often times a frame is blurry, but the next better), so it would have required generating a separate data stream for detections. I didn’t try because the next option gets me essentially the same:降低我正在记录的帧速率。 我希望档案具有较高的帧速率(例如,我可以放大车牌;通常情况下,帧模糊,但下一个更好),因此它需要生成单独的数据流以进行检测。 我没有尝试,因为下一个选项可以使我基本上保持相同:
  • skip frames while searching for detections. This relatively obvious option is what I primarily did: I actually only look at a frame every second or two. It’s not perfect, but it turns out it doesn’t miss much and at 15 FPS it gives me… drum roll… a 15x boost for each second I skip.搜索检测时跳过帧。 这个相对明显的选择是我主要要做的:实际上,我每隔一两秒钟只看一帧。 它不是完美的,但是事实证明它并不会错过太多,并且以15 FPS的速度给了我...鼓声...我跳过的每秒提高15倍。

All in all, on my 4.5 GHz Intel i9–10900X, 32GB RAM Linux system I can process a one-minute segment in just below 10s, or less if I let it use the GPU.

总而言之,在我的4.5 GHz Intel i9-10900X,32GB RAM Linux系统上,我可以在不到10s的时间内处理一分钟的片段,如果我使用GPU,则可以处理的时间更少。

I didn’t really evaluate this accuracy wise, but did run into some false positives… If I decide to run this system longer term, I will likely fine tune it to avoid these.

我并没有真正评估这种准确性,但是确实遇到了一些误报……如果我决定长期运行该系统,我可能会对其进行微调以避免这些情况。

Cone and culvert detected as “person” (images by author)
锥体和涵洞被检测为“人”(作者提供的图像)

未来的工作 (Future Work)

The driveway is drivable again and the deliveries box is gone… having said that, most of those things I mentioned not having done or completed could become projects. I might try running something on the camera itself or on a Raspberry Pi or Arduino. It would also be cool to use the camera’s PTZ to track detections.

车道又可行驶了,送货箱也消失了……说过,我提到的大多数未完成或尚未完成的事情都可能成为项目。 我可能会尝试在相机本身或Raspberry Pi或Arduino上运行某些内容。 使用摄像机的PTZ跟踪检测结果也很酷。

代码 (The Code)

It’s down below, but you can also check it out on GitHub.

它在下面,但您也可以在GitHub上查看 。

Use at your own risk! I normally develop code test driven, but I was experimenting a lot here and didn’t treat this project to TDD.

使用风险自负! 我通常以代码测试驱动开发,但是我在这里做了很多实验,并且没有将此项目视为TDD。

Enjoy!

请享用!

翻译自: https://towardsdatascience.com/teaching-new-tricks-to-an-old-camera-5ab37f4a4406

lytro相机拍摄技巧


http://www.taodudu.cc/news/show-3084839.html

相关文章:

  • Lytro In Matlab
  • Lytro Illum光场图像分解的白图像
  • 光场相机lytro的安装和使用
  • LFtoolBox0.4工具包解码Lytro光场图像及子孔径图像获取
  • 竞争性谈判和竞争性磋商的区别
  • 数字电路的竞争与冒险
  • 名词解释:竞争概念
  • 组合逻辑中的竞争与冒险
  • 视网膜竞争(双目竞争)现象
  • 行业竞争分析及发展动向
  • 数学建模:种群竞争模型
  • 竞争模型
  • 组合逻辑中的 竞争冒险问题
  • 关于电路的竞争与冒险问题详解
  • CTF条件竞争
  • 竞争-冒险
  • 文件上传之竞争条件
  • 操作系统 — 竞争条件
  • 条件竞争漏洞
  • 竞争冒险
  • 竞争与冒险
  • 【基础知识】~ 竞争/冒险
  • 我为什么不建议使用OpenDNS和Google Public DNS
  • 思科将以6.35亿美元收购网络安全公司OpenDNS
  • 使用DNSCrypt来加密您与OpenDNS之间的通信
  • 思科收购OpenDNS以提升Security Everywhere2015
  • opendns安全研究成果
  • OpenDNS(转)
  • Ubuntu 设置 OpenDNS
  • DNS的域名的解析解决办法(openDNS)

lytro相机拍摄技巧_向旧相机教授新技巧相关推荐

  1. 这台相机没镜头!美国教授新发明,一块玻璃可成像,拍照给计算机看

    郭一璞 发自 凹非寺  量子位 报道 | 公众号 QbitAI 在我们印象里,相机总是逃不开这玩意:  凸透镜成像原理. 从傻瓜照相机到手机摄像头,都拥有一个凸透镜作为镜头. 但是有人偏偏觉得,不 ...

  2. 4 相机切换_景明促销IIVlog小新机 索尼Vlog相机ZV1

    轻便Vlog相机新品ZV-1.为视频创作者和Vlog博主设计,ZV-1集灵活易用和不妥协的影像技术于一体,成为视频创作者进行不同题材创作的理想相机. 视频创作日趋大众化,Vlog视频记录和分享日渐普及 ...

  3. matlab矩阵半张量积,矩阵的半张量积_一个便捷的新工具.pdf

    您所在位置:网站首页 > 海量文档 &nbsp>&nbsp高等教育&nbsp>&nbsp微积分 矩阵的半张量积_一个便捷的新工具.pdf11页 本文档 ...

  4. 2.2.2 胸腰差和胸臀差的应用_米人NOONE_新浪博客

    2.2.2 胸腰差和胸臀差的应用_米人NOONE_新浪博客 2.2.2  胸腰差和胸臀差的应用_米人NOONE_新浪博客 腰差和胸臀差的应用 (2009-06-16 19:24:57) 转载▼ 标签: ...

  5. 华为p20Android怎么解开,【华为P20】解锁EMUI8.1系统下华为P20的各种玩法新技巧

    本帖最后由 哀暮殇 于 2018-5-5 20:30 编辑 提起华为P20系列,联想到的就是令人深刻的首创徕卡后置三摄以及其强大的拍照尤其是夜景,但是除了这些,华为P20系列还搭载了基于Android ...

  6. 新人百度百科怎么做_如何做新人百科技巧分享

    随着百科的发展,现在一共有五家百科词条,分别是 百度百科,搜狗百科,好搜百科,快懂百科,维基百科. 百科词条权重值高,呈现好,已成为了黄金社交名片. 现在各大 APP.品牌.企业.演员.艺术大师.医师 ...

  7. 写互联网文案的新技巧

    新媒体的崛起,互联网信息时代的到来,都为企业和品牌的推广文案创造了更多的可能.一本正经阐述产品功能的文案,早就已经被我们自动过滤掉了. 试问现在,在昏昏欲睡的公交车厢上,你是愿意看一篇中规中矩的广告文 ...

  8. 淘宝店铺托管拉新技巧有哪些?

    对于新店来说,没有流量及访客是一种常见的现象,但如果卖家不及时的进行拉新工作,那么店铺是无法获取更多资源的,今天小编就来详细为大家说一下店铺拉新技巧. 1.利用精准关键词拉新 淘宝卖家可以为店铺选择转 ...

  9. 计算机新安装系统后桌面上有什么图标,电脑重装系统后桌面文件如何恢复?新技巧分享...

    原标题:电脑重装系统后桌面文件如何恢复?新技巧分享 电脑重装系统后桌面文件如何恢复?当我们电脑重装系统之后,桌面上一般就只剩下一个"回收站"的图标,很多朋友不知道怎么找回这些丢失的 ...

最新文章

  1. 北京智能计算产业研究院落户顺义,中科睿芯联手计算所、顺义区打造“产业园2.0”...
  2. 3dmax批量导出fbx_推荐一款超实用的3DMAX插件——模法师
  3. cookie、 sessionStorage 、localStorage之间的区别和使用
  4. Java项目实例教程详细
  5. 怎么将excel数据导入到datagridview中
  6. 1000以内所有同构数java算法_使用c语言求1到1000同构数的代码
  7. UVA455 Periodic Strings
  8. mount: none already mounted or /cgroup busy
  9. Apache日志配置详解(rotatelogs LogFormat)
  10. hdu1533解题报告
  11. 由陌生到认识——微积分
  12. 励磁电感公式_永磁同步电机交直轴电感计算
  13. 入门OJ:photo
  14. 配合python的rich库实现高颜值LOL服务器状态查询
  15. 【通俗理解】股票、基金、证券、债券、信托、期货、国债、外汇
  16. 黑龙江伊春现受伤雄性东北虎 目前已被成功救治
  17. matlab练习程序(RGB2CMY、CMY2RGB)
  18. 计算机需要记笔记,如何优雅地用电脑记笔记
  19. 程序员这条路,选择深耕技术,还是全面学习比较好?
  20. c语言编译器error,KEIL C编译器常见警告与错误信息的解决办法

热门文章

  1. Kotlin系列——构造函数精讲
  2. uniApp wx-open-launch-app 微信浏览器内打开app及遇到的坑
  3. pdf转换成txt转换器在线转换
  4. conda 离线安装本地python包,channel为 unkown 或 <path/to/file> 的问题 (本人在安装 tensorflow2.2.0 时遇到)
  5. apollo planning module
  6. SQL语句数据库的创建、修改,分离,附加,备份,还原
  7. 卡梅隆对话刘慈欣:想看《三体》拍成电影
  8. 刘慈欣回应《三体》获奖nbsp;对…
  9. 1u服务器最多多少内存条,高密度节省空间 四款1U机架式服务器推荐
  10. 时钟数字 java_用java写一个数字时钟