【翻译】动态图像监测开源代码 motion 学习-----Motion Guide - Basic Features(motion的基本特性)(一)...

本文主要是介绍【翻译】动态图像监测开源代码 motion 学习-----Motion Guide - Basic Features(motion的基本特性)(一)...,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!


【翻译】动态图像监测开源代码 motion 学习-----Motion Guide - Basic Features(motion的基本特性)(一)


说在前面:

我没有经历过专业的翻译培训,也没有丰富的翻译经验,之所以会对Motion这个开源项目的手册进行简单的意思解释,一是因为我要用Motion,二是我对它感兴趣,三是刚好再熟悉一下英语。只是作为以后应用的一个参考,肯定存在很多不足之处,因此,仅供参考!

原文链接  点击打开链接

Motion Guide - Basic Features(基本特性)

This topic consists of the following(子内容) subtopics:CaptureDeviceOptionsMotionDetectionSettings,ImageFileOutputTuningMotionMpegFilmsFFmpeg,SnapshotsWebCamTextFeatures,AdvancedFilenamesConversionSpecifiers,WebcamServerRemoteControlHttp,ExternalCommands.


Capture Device Options - The Basic Setup(基本设置)

Before you can start using motion you need to know some basics about your camera. Either you have a camera connected directly to your computer. In this case it is a video4linux type of camera. Or you connect to a network camera using a normal web URL.(让你在运行motion前先了解一下你的相机,是直接连在电脑上的相机还是网络相机,因为不同相机设置不一样)

video4linux (V4L) devices(V4L设备)

关于V4L的资料:Video4Linux或V4L是一个视频截取及设备输出API,以及Linux的驱动程序框架,支持很多USB摄像头、电视调谐卡以及其他设备。Video4Linux与Linux内核紧密集成,Video4Linux取名的灵感来自Video for Windows(有时候会缩写为“V4W”),但两者在技术上并没有任何关系)
You need to install your camera with the right driver. It is out of scope of this document to tell you how to do this and it depends on which type of camera.(意思是不会教你怎样给USB相机装驱动,你要自己想办法~)

Once installed the camera(s) will have the device names /dev/video0, /dev/video1, /dev/video2...

FreeBSD has a different naming of devices. When you build Motion for FreeBSD the default device name is /dev/bktr0. Under FreeBSD a TV card has a special device for controlling the tuner(调谐器) (e.g. /dev/tuner0). The option tunerdevice is only valid when Motion is built and running under FreeBSD. For Linux do not include this option in the config file (remove or comment out).

USB cameras take a lot of bandwidth. (USB相机消耗很多带宽)。A USB camera connected to a USB 1.1 port or hub consumes all the bandwidth. Even with a small framesize and low framerate you should not expect to have more than one camera per USB 1.1 controller. If you need more than 1 USB camera add extra USB PCI cards to your computer. There exists cards that have 4 inputs each with their own controller and with full bandwidth. Many 4-input cards only have 1 controller. USB cameras do not have the feature of selecting input channels. To disable the input selection the option input must be set to the value 8 for USB cameras.(主要将USB相机的限制)

Composite video cards (视频多路复用器)are normally made with a chip called BT878 (older cards have a BT848). They all use the Linux driver called 'bttv'.

There are cards with more then one video input but still only one BT878 chip. They have a video multiplexer(他们有一个视频多路复用器) which input is selected with the config option input. Input channel numbers start at 0 (which is why the value 8 and not 0 disables input selection). There are video capture cards available with 4 or 8 inputs but only one chip. They present themselves as one single video device and you select input using the 'input' option. If you define e.g. 4 thread config files with the same videodevice name but different input numbers Motion automatically goes into round robin mode. See the round robin section for more information. Many TV tuner cards have the input channels: TV Tuner = 0, Standard composite video = 1, S-VHS = 3. Other have TV=0, composite video 1= 1, composite video = 2, S-VHS = 3. For video capture cards input 1 is normally the composite video input.(主要讲视频卡,不太懂)

Some capture cards are specially made for surveillance with for example 4 inputs. Others have a TV tuner, a composite input (phono socket) and perhaps also a S-VHS input. For all these cards the inputs are numbered. The numbering varies from card to card so the easiest is to experiment for 5 minutes with a program that can show the videostream. Use a program such as Camstream or xawtv to experiment with the values.

If you use the TV tuner input you also need to set the frequency of the TV channel using the option frequency. Otherwise set 'frequency' to 0.

Finally you need to set the TV norm. Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default is 0 (PAL). If your camera is a PAL black and white you may get a better result with norm=3 (PAL no colour).(这几段主要讲TV协调器,也不太懂)

If the netcam_url option is defined all the video4linux options are ignored so make sure the netcam_url option is commented out if you do not need it.(意思是如果选项netcam_url你用不着,那么就把它注释掉,否则所有的video4linux 选项在运行时都会被忽略 



+++++++video4linux (普通的视频设备)+++++++


These are the parameters used for video4linux devices(video4linux 设备用到的一些参数

因为参数很多,所以采取用谁看谁的针对性策略。具体参数可看各自的蓝色字体。

auto_brightness(自动亮度)

这个参数取默认值,如果运行后发现所用相机不支持自动亮度调节,再将其配置为on也不迟。

  • Type: Boolean
  • Range / Valid values: on, off
  • Default: off
  • Option Topic  (详细内容请点击蓝色字体)

brightness(亮度)

  • Type: Integer
  • Range / Valid values: 0 - 255
  • Default: 0 (disabled)
  • Option Topic (详细内容请点击蓝色字体)

contrast(对比值)

  • Type: Integer(这个地方原文是Boolean,明显是是错误的,应该为Integer
  • Range / Valid values: 0 - 255
  • Default: 0 (disabled)
  • Option Topic

framerate(帧率)

每秒钟从相机捕捉的帧的最大数量
To set intervals longer than one second use the 'minimum_gap' option instead.(设定值参考选项minimum_gap
  • Type: Integer
  • Range / Valid values: 2 - 100
  • Default: 100 (no limit)
  • Option Topic

frequency(频率)

这个选项就使用默认值,除非你有TV协调卡,并且你的TV协调卡支持这个特性。
  • Type: Boolean
  • Range / Valid values: 0 - 999999
  • Default: 0 (Not set)
  • Option Topic

height(图像的高度)

  • Type: Integer
  • Range / Valid values: Device Dependent
  • Default: 288
  • Option Topic
The height of each frame in pixels.(每帧的像素高度)

Your camera or capture/TV card will not support any picture size. You must know which frame size (width and height) the camera supports. If you do not know start with width 320 and height 240 which most cameras and capture cards supports.(说:你的相机设备不可能支持任何尺寸的图像,所以,你要搞清楚你的相机设备所支持的帧的尺寸,假如你不清楚这些,那么,就把高度和宽度设为大部分相机设备都支持240*320即可)

Motion requires that dimensions of camera image must have both height and width that are a multiple of 16. Thís is normally not a problem. All standard sizes like 640, 480, 352, 320, 288, 240, ...etc are multiples of 16.(这一段话也要注意,说:motion需要相机图像的高度和宽度均为16的倍数,这通常都不是问题。640, 480, 352, 320, 288, 240, ...这些标准的尺寸都是16的倍数。

hue(图像的色调)

  • Type: Integer
  • Range / Valid values: 0 - 255
  • Default: 0 (disabled)
  • Option Topic
The hue level for the video device.(视频设备的色调级别,其实就是色调的值)

Normally only relevant for NTSC cameras.(通常只跟NTSC 的cameras有关

input(输入通道)

  • Type: Integer
  • Range / Valid values: 0 - 7, 8 = disabled
  • Default: 8 (disabled)
  • Option Topic

Input channel to use expressed as an integer number starting from 0. Should normally be set to 1 for video/TV cards, and 8 for USB cameras.(video/TV cards设置为1,USB cameras设置为8

If you have a video capture card you can define the channel to tune to using this option. If you are using a USB device, network camera or a capture card without tuner you should set the value to the default 8.(如果你用的是video capture card,那么可以用这个选项定义一个通道;如果你用的是 USB device, network camera 或者a capture card without tune,那么就用默认值。

Many TV tuner cards have the input channels: TV Tuner = 0, Standard composite video = 1, S-VHS = 3. Other have TV=0, composite video 1= 1, composite video = 2, S-VHS = 3. It is recommended to set the parameter to 8 for USB cameras as your first try. For video capture cards input 1 is normally the composite video input.(这段话主要举一些通道设置的例子,不过通常情况下用8就行。)

minimum_frame_time(最小帧时间)

  • Type: Integer
  • Range / Valid values: 0 - 2147483647
  • Default: 0
  • Option Topic
ALERT! This feature is introduced in Motion 3.2.7

norm(规范,通常默认就行,只用于BTTV driver)

  • Type: Discrete Strings(离散字符)
  • Range / Valid values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour)
  • Default: 0 (PAL)
  • Option Topic
rotate(图像旋转)
  • Type: Discrete Strings
  • Range / Valid values: 0, 90, 180, 270
  • Default: 0 (not rotated)
  • Option Topic

Note that the CPU load increases when using this feature with a value other than 0. Also note that Motion automatically swaps width and height if you rotate 90 or 270 degrees, so you don't have to touch these options.(

意思是:请注意,这个选项没事的话不要动它。如果设置了这个选项将增加cpu的负载,而且motion会自动交换图像的高度和宽度。)

saturation(饱和度)

  • Type: Integer
  • Range / Valid values: 0 - 255
  • Default: 0 (disabled)
  • Option Topic

tunerdevice(调谐装置)

  • Type: String
  • Range / Valid values: Max 4095 characters
  • Default: /dev/tuner0
  • Option Topic
The tuner device used for controlling the tuner in a tuner card. This option is only used when Motion is compiled for FreeBSD.(这个选项只用在FreeBSD上)

Make sure to remove or comment out this option when running Motion under Linux.(如果是在Linux下运行motion,请确保删除或者注释掉这个选项)

v4l2_palette(调色板)

  • Type: Integer
  • Range / Valid values: 0 - 8
  • Default: 8
  • Option Topic

videodevice(视频设备名称)

  • Type: String
  • Range / Valid values: Max 4095 characters
  • Default: /dev/video0 (FreeBSD: /dev/bktr0)
  • Option Topic

The video device to be used for capturing. Default for Linux is /dev/video0. for FreeBSD the default is /dev/bktr0.

This is the video4linux device name. Ignore this for net cameras.

人家说的很清楚,Linux下默认值为/dev/video0,FreeBSD下默认值为/dev/bktr0,所以,不用管它。

width(图像宽度,参考图像高度height

  • Type: Integer
  • Range / Valid values: Device Dependent
  • Default: 352
  • Option Topic


++++++Network Cameras(网络摄像机)+++++++

Motion can connect to a network camera through a normal TCP socket. (Motion可以通过TCP连接到一个网络摄像机)。All you need to give it is the URL. (你要做的是给Motion一个链接)。The URL given must return either one single jpeg picture or an mjpeg stream. For the time being Motion cannot connect to a video stream such a mpeg, mpeg4, divx. The URL must return one single jpeg image or an mjpeg stream! You can connect through a proxy server.

When the netcam_url is defined all the video4linux options above are ignored!!(注意:一旦设置了选项netcam_url ,则选项video4linux 中所有的设置都将被忽略

Note that Motion requires that dimensions of camera image must have both height and width that are a multiple of 16. Thís is normally not a problem. All standard sizes like 640, 480, 352, 320, 288, 240, ...etc are multiples of 16. But if you intend to monitor a network camera which is saving jpeg images you may have to pay attention to the dimensions of the picture.(意思是:如果你用网络摄像机,那么你要特别注意图像尺寸的问题,因为motion要求高度和宽度为16的倍数)

netcam_http(用于保持网络socket)

  • Type: Discrete Strings
  • Range / Valid values: 1.0, keep_alive, 1.1
  • Default: 1.0
  • Option Topic

netcam_proxy(网络摄像机代理服务器)

  • Type: String
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Option Topic
URL to use for a netcam proxy server, if required. The syntax is http://myproxy:portnumber

Use this if you need to connect to a network camera through a proxy server.

Example of syntax: "http://myproxy.mydomain.com:1024

If the proxy port number is 80 you can ommit the port number. Then the syntax is use "http://myproxy.mydomain.com" .

Leave this option undefined if you do not use a proxy server(代理服务器).

主要意思:用的话就定义它,不用的话别管它。

netcam_tolerant_check(简单检查)

  • Type: Boolean
  • Range / Valid values: on, off
  • Default: off
  • Option Topic

netcam_url(链接地址)

  • Type: String
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Option Topic
Specify an url to a downloadable jpeg file or raw mjpeg stream to use as input device. Such as an AXIS 2100 network camera.

Example of URL: http://www.gate.com/pe1rxq/jeroen.jpg.(URL示例)

netcam_userpass(用户权限设置)

  • Type: String
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Option Topic

For network cameras protected by username and password, use this option for HTTP 1.1 Basic authentication. The string is specified as username:password. Do not specify this option for no authentication(认证).(意思是不要动它)

To use no authentication simply remove this option from the config file comment it out with "#" or ";" in front.(这里提供两种注释代码的方法,用“#”或者用分号“;”)


++++++Round Robin feature(Round Robin特性)++++++

这种特性也叫轮叫调度,是一种无状态调度。(仅供参考)

This feature is automatically activated where multiple threads are sharing the same video device (for example /dev/video0). (当多个线程共享同一个视频设备时,这个特性会被自动激活。)

ALERT! Round Robin is not relevant for Network cameras or standard USB web cameras. The Round Robin feature is used with video capture cards which have multiple inputs per video chip.(说:这种特性与Network cameras 或standard USB web cameras无关。这种特性用在视频采集卡中,并且一个视频芯片有多个输入。


These are the special Round Robin options

roundrobin_frames(指定转换输入通道前要采集的帧的数量)

  • Type: Integer
  • Range / Valid values: 1 - 2147483647
  • Default: 1
  • Option Topic

roundrobin_skip(指定转换输入通道后要跳过的帧的数量)

  • Type: Integer
  • Range / Valid values: 1 - 2147483647
  • Default: 1
  • Option Topic

switchfilter(转换干扰过滤)

  • Type: Boolean
  • Range / Valid values: on, off
  • Default: off
  • Option Topic
ALERT! This feature was seriously broken until Motion 3.2.4


++++++Motion Detection Settings(Motion检测控制设置)++++++

These are the options that controls the detection of motion. Further details follows after.

area_detect(在预定义区域检测运动焦点)

  • Type: String
  • Range / Valid values: 1 - 999999999
  • Default: Not defined
  • Option Topic
One or more areas can be specified with this option.(可以设置一个或多个区域)

Example: You want to monitor if the center of motion occurrs in the lower third of the image - that is area 7, 8 and 9. Simply set 'area_detect' to '789' and 'on_area_detect' will be executed as soon as the center of motion was detected in area 7, 8 or 9. If you want to monitor area 2, 3, 5 and 6, set '2356'.(教你定义的方法)

despeckle(去噪)

  • Type: String
  • Range / Valid values: EedDl
  • Default: Not defined
  • Option Topic
Wind blowing grass and trees around or poor light conditions can cause a lot of dots (or noise) to appear in the motion image (See the section on Tuning Motion). This feature removes (or enhances!) this noise and so improves the reliability of motion.(告诉你这个选项的用途)

gap(无运动检测时间间隔,这个选项比较重要)

  • Type: Integer
  • Range / Valid values: 0 - 2147483647
  • Default: 60
  • Option Topic
Gap is the seconds of no motion detection that triggers the end of an event. (一段时间没有检测到运动就引发一个结束的事件,这一段时间就是gap)An event is defined as a series of motion images taken within a short timeframe.

Any motion detected before the gap timer times out resets the gap timer so it starts counting over again.(在间隔结束之前,如果有检测到运动则重置间隔,即用一个新的间隔时间继续检测)

Detailed Description

The option 'gap' is important. It defines how long a period of no motion detected it takes before we say an event is over. An event is defined as a series of motion images taken within a short timeframe. E.g. a person walking through the room is an event that may have caused 10 single jpg images to be stored. Motion detected includes post_captured frames set by the 'post_capture' option. The 'gap' option defines how long a pause between detected motions that is needed to be defined as a new event. A good starting value is 60 seconds.(这段话说gap这个选项很重要,以及gap的具体含义)

Note that 'gap' and 'minimum_gap' have nothing to do with each other.(说:gap和minimum_gap毫无关系

lightswitch(忽略瞬间亮度发生大量变化的百分比值

  • Type: Integer
  • Range / Valid values: 0 - 100
  • Default: 0 (disabled)
  • Option Topic

mask_file(图像文件绝对路径)

  • Type: String
  • Range / Valid values: Max 4095 characters
  • Default: Not defined
  • Option Topic
PGM file to use as a sensitivity mask. This picture MUST have the same width and height as the frames being captured and be in binary format.(这个图像文件必须是pgm的二进制格式文件,并且它的高度和宽度必须和相机采集到的尺寸一致)

Full path of the PGM (portable gray map) mask file (binary format).(要使用文件的绝对路径)

If you have one or more areas of the camera image in which you do NOT want motion detected (e.g. a tree that moves in the wind or a corner of the picture where you can see cars/pedestrians passing by) you need a mask file. This file is a picture that you create in your favorite photo editing program. The areas that you want detected must be white. The error that you want ignored must be black. The pgm image must be the same size (number of pixels high and wide) as the pictures that are taken by the camera (video4linux device).(教你怎样设置你要用的pgm文件)

If you do not have a mask file disable this option by not having it in the config file or comment it out ("#"or ";" as first character in line). If you are using therotate option, note that the mask is applied after the rotation.(如果你不是用该选项,那么把它注释掉)

One easy method for generating the mask file is as follows.(教你一个制作mask file 的简单方法,往下读一下吧)

You can just take a motion captured picture, edit it with black and white for the mask and save it as a pgm file. If you cannot save in this format save as a grayscale jpg and then you can convert it to pgm format with

djpeg -grayscale -pnm [inputfile] > mask.pgm

(assuming you have djpeg installed - part of the jpeg lib package).

Note that the mask file option masks off the detection of motion. The entire picture is still shown on the picture. This means that you cannot use the feature to mask off an area that you do not want people to see.

max_mpeg_time(mpeg视频的最大长度

  • Type: Integer
  • Range / Valid values: 0 (infinite) - 2147483647
  • Default: 3600
  • Option Topic

The maximum length of an mpeg movie in seconds. Set this to zero for unlimited length.(一个mpeg视频的最大长度,以秒计。设为0表示不限制长度)

minimum_motion_frames(不知道该怎么翻译)

  • Type: Integer(原文又有错误,原文此处为Boolean)
  • Range / Valid values: 1 - 1000s
  • Default: 1
  • Option Topic
Picture frames must contain motion at least the specified number of frames in a row before they are detected as true motion. At the default of 1, all motion is detected. Valid range is 1 to thousands, but it is recommended to keep it within 1-5.(意思是这个选项的值要尽量的小)

The feature is used when you get many false detections when the camera changes light sensitivity or light changes.(这个特性用在对亮度变化敏感的相机或者亮度发生变化的场合,前提是这种场合出现很多检测错误,否则不用管它。)

Experiment for best setting. Even though Motion accepts large values you should set this to a relatively low number (below 10). For each step larger than 1 Motion reserves space in RAM for the picture frame buffer. If you have a large value Motion will miss many frames from the camera while it is processing the all the pictures in the buffer.(意思还是不要把它的只设置太大,否则会出问题)

noise_level(噪声阈值)

  • Type: Integer
  • Range / Valid values: 1 - 255
  • Default: 32
  • Option Topic
The noise level is used as a threshold for distinguishing between noise and motion.(作为区别是噪声还是motion的一个阈值)

This is different from the threshold parameter. This is changes at pixel level. The purpose is to eliminate the changes generated by electric noise in the camera. Especially in complete darkness you can see the noise as small grey dots that come randomly in the picture. This noise can create false motion detection. What this parameter means is that the intensity of a pixel must change more than +/- the noise threshold parameter to be counted.(说:这个值不同于threshold parameter。它是像素级的变化。目的是评估由相机产生的电信号干扰。特别是在全黑的环境下,你能够看到图像有一些随机的灰点。这可能产生错误的运动判断。这个参数是指一个像素密度变化必须多余+/-噪声的threshold parameter值。

noise_tune(噪音的自动调节)

其实就是noise_level的替代功能。

  • Type: Boolean
  • Range / Valid values: on, off
  • Default: on
  • Option Topic

Activates the automatic tuning of noise level.(激活后,自动调整noise_level的值

This feature makes Motion continuously adjust the noise threshold for distinguishing between noise and motion. The 'noise_level' setting is ignored when activating this feature. This is a new feature and new algorithm. It may give different results depending on camera and light conditions. Report your experience with it on the Motion mailing list. If it does not work well, deactivate the 'noise_tune' option and use the manual setting of 'noise_level' instead.(意思是:这是一种新特性和新算法,激活后,可以自动调整noise_level的值。另外,不同的相机和光线条件可能会有不同的结果。于是,欢迎您做实验然后给反馈以便改进。如果效果不好,请把它关了,然后手动设置noise_level的值。

output_all(移植输出图像)

  • Type: Boolean
  • Range / Valid values: on, off
  • Default: off
  • Option Topic

Picture are saved continuously as if motion was detected all the time.(打开该选项后,如果检测到一直有运动,则一直保存图像。)

This feature is not meant to be the normal mode of operation. Especially not if you have the output_normal or output_motion features enabled since it will keep on saving pictures on the disk and you will soon run out of disk space. So be careful with this command.(意思是,这个选项会耗尽硬盘存储,所以小心使用它,如果确实有需要的话。)

The idea of this feature is that you can turn the feature on and off for a short period of time to test or to generate continuous mpeg films when needed.(告诉你使用该选项的情况)

post_capture(检测到运动后采集帧的数量)

  • Type: Integer
  • Range / Valid values: 0 - 2147483647
  • Default: 0 (disabled)
  • Option Topic

Specifies the number of frames to be captured after motion has been detected(检测到运动后采集帧的数量)

The purpose of this is mainly to create smooth video clips each time motion is detected. Use it to you personal taste (and disk space)..(给你说使用目的)

This option is the preferred way to create continuous movies. Post_capture does not consume extra RAM and it does not create pauses in the movie even with large values.(意思是值没有限制)

If you only store mpegs movies and do not have output_normal on, then the recommended post_capture value is what is equivalent to 1-5 seconds of movie.(意思是最好值最好还是小一些~)

pre_capture(输出探测到运动前的帧的数量)

  • Type: Integer
  • Range / Valid values: 0 - 100s
  • Default: 0 (disabled)
  • Option Topic

写到这里说一下感受:虽然看motion有点意思,但是一直读英文还要去理解真的不是轻松的事,有种想吐的感觉!不多说了,继续吧!

Specifies the number of previous frames to be outputted at motion detection. Recommended range: 0 to 5, default=0. Do not use large values! Large values will cause Motion to skip video frames and cause unsmooth mpegs. To smooth mpegs use larger values of post_capture instead.(说:这个特性指明输出探测到运动前的帧的数量。推荐值:0~5,默认为0,即不使用此特性。不要使用较大的值!大值会造成Motion失真卡顿。可以使用比较大的post_capture 来得到流畅的mpegs 。

总之:此特性使得motion好像有预知的能力,其实motion总是缓存一段之前的内容,当探测到运动时,那么就把缓存中的内容加到探测到的运动视频中,这个特性的值就是让你选择motion预知能力的大小。但是值千万不要太大,绝对利大于弊,大值极有可能让你丢掉一些探测到运动后的重要的信息。按着推荐值选择吧!

smart_mask_speed(智能消除干扰运行的特性)

  • Type: Integer
  • Range / Valid values: 0 - 10
  • Default: 0 (disabled)
  • Option Topic

这个特性具有自学习的能力,很厉害,用来消除像风吹动树叶这种运动的干扰,建议值为5。

threshold(判断为运动的阈值)

  • Type: Integer
  • Range / Valid values: 1 - 2147483647
  • Default: 1500
  • Option Topic
The 'threshold' option is the most important detection setting. When motion runs it compares the current image frame with the previous and counts the number of changed pixels after having processed the image with noise filtering, masking, despeckle and labeling. If more pixels than defined by 'threshold' have changed we assume that we have detected motion. Set the threshold as low as possible so that you get the motion you want detected but large enough so that you do not get detections from noise and plants moving. Note that the larger your frames are, the more pixels you have. So for large picture frame sizes you need a higher threshold.(意思是这个选项在motion检测设置中是最重要的。motion用它来判断当前检测的环境是否有运动发生。如果你想探测到微小的运动,那么把它设置的小一些,如果想忽略一些干扰那么就设置的大一些(比如树叶的运动,树木位置的变化)。需要注意的是,这个值的大或者小不能一概而论,还要根据你的每个帧的尺寸的大小来决定。由此可见,这个值就是像素值。)

Practical values would be from a few hundred to 2000 indoors and 1000-10000 outdoors.(实际应用中,室内的话取值在几百到2000之间,室外的话取值在1000到10000之间。)

threshold_tune(阈值调节)

  • Type: Boolean
  • Range / Valid values: on, off
  • Default: off
  • Option Topic
This feature makes Motion continuously adjust the threshold for declaring motion.(这个特性使得threshold持续地调整

The threshold setting is ignored when activating this feature. It may give different results depending on your camera, light conditions, indoor/outdoor, the motion to be detected etc. If it does not work well, deactivate the 'threshold_tune' option and use the manual setting of threshold instead.(意思是,如果这个特性被设定了,那么motion将忽略threshold 选项,根据实际情况来决定threshold 值大小。如果你发现设定它之后,motion效果不理想,那么就关了他吧,自己手动设定一个threshold 值。

Image File Output(图像文件的输出)

The following options controls how Motion generates images when detection motion.

output_motion(输出运动图像,一般不用)

  • Type: Boolean
  • Range / Valid values: on, off
  • Default: off
  • Option Topic

output_normal(正常输出,默认就行)

  • Type: Discrete Strings
  • Range / Valid values: on, off, first, best, center (since 3.2.10)
  • Default: on
  • Option Topic

ppm

  • Type: Boolean
  • Range / Valid values: on, off
  • Default: off
  • Option Topic

ppm(输出ppm格式的图像)

  • Type: Boolean
  • Range / Valid values: on, off
  • Default: off
  • Option Topic
貌似ppm这种格式的图像包含的信息比jpg格式的要多,虽然输出这种格式使用较少的cpu,但占用大量的硬盘io,所以如果不是确实需要,不要设置它。当用网络相机时,一定把它关掉。

quality(图像质量,表示图像压缩的百分比)

  • Type: Integer
  • Range / Valid values: 1 - 100
  • Default: 75
  • Option Topic
The quality for the jpeg images in percent.

100 means hardly compressed. A small number means a much smaller file size but also a less nice quality image to look at. 50 is a good compromise for most.(100表示不压缩,一个小值就代表图像的质量稍次,占的存储空间也小。50是一个比好的值。)


++++++Tuning Motion(Motion的调整,这个功能很有意思)++++++

Motion 3.2 introduces a new feature Setup Mode.(是从3.2才引进的新特性----设置模式。)This is a great new feature with really make tuning all the settings of Motion much more easy and transparent.(这一强大的功能使得Motion所有的设置调整变得简单和透明。) In setup mode two things happen(在设置模式中会发生两件事,具体怎样只有试一下才会知道,动手吧!):
1、With 'motion -s' Motion runs in console mode instead of daemon. It outputs a lot of useful information for each frame from the camera. Each message is prefixed by [number] where number is the camera number (thread number).
2、When you look at the mjpeg webcam stream you see a black image with numbers. What you see is the number of changed pixels, number of labeled areas and noise setting. When something moves you see the pixels detected as Motion in black and white. The largest labelled area (assuming despeckle is enabled and with the 'l' at the end) is blue. It is only the blue areas which is counted as Motion. If smartmask is enabled you see this as red areas.

Here is a suggestion how to initially setup Motion.(下面教你怎样开始Motion的设置模式,可以试一下)

  • Disable despeckle (comment it out in motion.conf).
  • Disable smartmask
  • Enable both http control and webcam by setting port numbers. Example 8080 for control and 8081 for webcam.
  • Start Motion in setup mode
  • View the webcam stream. Either with Cambozola or with Firefox. http://localhost:8081/Firefox often needs to reload the page before it works. Bug in Firefox. Internet Explorer cannot show the stream unless you make a webpage on your Apache with Cambozola applet.
  • Open new browser window and connect to the http interface. http://localhost:8080/ . You can now control and change almost anything while Motion is running. You cannot resize the image. That was too hard to code. To disable a feature enter a space.
  • Start by experimenting with noise level. Do this both during daylight and during darkness. You will be surprised to see how much noise a camera makes during night. Try using the automatic noise feature. It should work for most.
  • Now try the despeckle feature. Enable it using the recommended default EedDl. If this is not enough experiment. Remember that the l must be the last letter. It is fun to play with.
  • Set the threshold to what you want to trigger Motion.

In normal mode you can use the same setting with two browser windows and experiment with settings of the camera if needed.

From the web interface you can ask Motion to write all your changes back to the config files (motion.conf and thread config files). It will even tidy them up for you so they look nice.

There are two sets of options to adjust.
  • The options that controls the camera device: See CaptureDeviceOptions
  • The options that controls the actual motion detection: MotionDetectionSettings


这一部分的内容有些多,看多了就会慎得慌,还是分成两部分吧!


转载于:https://www.cnblogs.com/gengzj/p/3827128.html

这篇关于【翻译】动态图像监测开源代码 motion 学习-----Motion Guide - Basic Features(motion的基本特性)(一)...的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/817147

相关文章

HarmonyOS学习(七)——UI(五)常用布局总结

自适应布局 1.1、线性布局(LinearLayout) 通过线性容器Row和Column实现线性布局。Column容器内的子组件按照垂直方向排列,Row组件中的子组件按照水平方向排列。 属性说明space通过space参数设置主轴上子组件的间距,达到各子组件在排列上的等间距效果alignItems设置子组件在交叉轴上的对齐方式,且在各类尺寸屏幕上表现一致,其中交叉轴为垂直时,取值为Vert

Ilya-AI分享的他在OpenAI学习到的15个提示工程技巧

Ilya(不是本人,claude AI)在社交媒体上分享了他在OpenAI学习到的15个Prompt撰写技巧。 以下是详细的内容: 提示精确化:在编写提示时,力求表达清晰准确。清楚地阐述任务需求和概念定义至关重要。例:不用"分析文本",而用"判断这段话的情感倾向:积极、消极还是中性"。 快速迭代:善于快速连续调整提示。熟练的提示工程师能够灵活地进行多轮优化。例:从"总结文章"到"用

基于人工智能的图像分类系统

目录 引言项目背景环境准备 硬件要求软件安装与配置系统设计 系统架构关键技术代码示例 数据预处理模型训练模型预测应用场景结论 1. 引言 图像分类是计算机视觉中的一个重要任务,目标是自动识别图像中的对象类别。通过卷积神经网络(CNN)等深度学习技术,我们可以构建高效的图像分类系统,广泛应用于自动驾驶、医疗影像诊断、监控分析等领域。本文将介绍如何构建一个基于人工智能的图像分类系统,包括环境

水位雨量在线监测系统概述及应用介绍

在当今社会,随着科技的飞速发展,各种智能监测系统已成为保障公共安全、促进资源管理和环境保护的重要工具。其中,水位雨量在线监测系统作为自然灾害预警、水资源管理及水利工程运行的关键技术,其重要性不言而喻。 一、水位雨量在线监测系统的基本原理 水位雨量在线监测系统主要由数据采集单元、数据传输网络、数据处理中心及用户终端四大部分构成,形成了一个完整的闭环系统。 数据采集单元:这是系统的“眼睛”,

【前端学习】AntV G6-08 深入图形与图形分组、自定义节点、节点动画(下)

【课程链接】 AntV G6:深入图形与图形分组、自定义节点、节点动画(下)_哔哩哔哩_bilibili 本章十吾老师讲解了一个复杂的自定义节点中,应该怎样去计算和绘制图形,如何给一个图形制作不间断的动画,以及在鼠标事件之后产生动画。(有点难,需要好好理解) <!DOCTYPE html><html><head><meta charset="UTF-8"><title>06

学习hash总结

2014/1/29/   最近刚开始学hash,名字很陌生,但是hash的思想却很熟悉,以前早就做过此类的题,但是不知道这就是hash思想而已,说白了hash就是一个映射,往往灵活利用数组的下标来实现算法,hash的作用:1、判重;2、统计次数;

第10章 中断和动态时钟显示

第10章 中断和动态时钟显示 从本章开始,按照书籍的划分,第10章开始就进入保护模式(Protected Mode)部分了,感觉从这里开始难度突然就增加了。 书中介绍了为什么有中断(Interrupt)的设计,中断的几种方式:外部硬件中断、内部中断和软中断。通过中断做了一个会走的时钟和屏幕上输入字符的程序。 我自己理解中断的一些作用: 为了更好的利用处理器的性能。协同快速和慢速设备一起工作

基本知识点

1、c++的输入加上ios::sync_with_stdio(false);  等价于 c的输入,读取速度会加快(但是在字符串的题里面和容易出现问题) 2、lower_bound()和upper_bound() iterator lower_bound( const key_type &key ): 返回一个迭代器,指向键值>= key的第一个元素。 iterator upper_bou

电力系统中的A类在线监测装置—APView400

随着电力系统的日益复杂和人们对电能质量要求的提高,电能质量在线监测装置在电力系统中得到广泛应用。目前,市场上的在线监测装置主要分为A类和B类两种类型,A类和B类在线监测装置主要区别在于应用场景、技术参数、通讯协议和扩展性。选择时应根据实际需求和应用场景综合考虑,并定期维护和校准。电能质量在线监测装置是用于实时监测电力系统中的电能质量参数的设备。 APView400电能质量A类在线监测装置以其多核

动态规划---打家劫舍

题目: 你是一个专业的小偷,计划偷窃沿街的房屋。每间房内都藏有一定的现金,影响你偷窃的唯一制约因素就是相邻的房屋装有相互连通的防盗系统,如果两间相邻的房屋在同一晚上被小偷闯入,系统会自动报警。 给定一个代表每个房屋存放金额的非负整数数组,计算你 不触动警报装置的情况下 ,一夜之内能够偷窃到的最高金额。 思路: 动态规划五部曲: 1.确定dp数组及含义 dp数组是一维数组,dp[i]代表