Summary of the invention
For this purpose, the present invention proposes a kind of audio-video recording method and device, in more accurate capture family life
Wonderful.
Concrete scheme is as follows:
Audio-video method for recording, comprising steps of
At least two picture frames are acquired, and acquire acoustic information;
Mobile detection region is arranged: by image frame division at several image blocks, each several image blocks are set as mobile detection area
Domain;
Detection cycle is recorded in setting at the beginning, is carried out mobile detection detection to the picture frame in the period, is counted and opening
Begin to record the mobile detection triggering times in detection cycle, the different zones number that mobile detection triggers, and obtains and starting to record
Sound average volume in acoustic information in detection cycle, if mobile detection triggering times are greater than mobile detection triggering times threshold
The different zones number that value, mobile detection trigger is greater than the different zones number threshold value of mobile detection triggering and sound average volume is greater than
Sound average volume threshold value then starts audio-video recording;
Setting one terminates to record detection cycle, carries out mobile detection detection to the picture frame in the period, counts and tying
Beam records mobile detection triggering times, the different zones number of mobile detection triggering and continuing for video record in detection cycle
Duration, and the sound average volume in the acoustic information that end records in detection cycle is obtained, if mobile detection triggering times
Less than the different zones number that the different zones number that mobile detection triggering times threshold value, mobile detection trigger is less than mobile detection triggering
Threshold value, sound average volume are less than sound average volume threshold value or the duration of video record is greater than duration threshold value, then terminate
Audio-video is recorded;
Storage is from recording audio/video is started to the successive image frame and acoustic information in the time of end-sound video record
Form audio-video.
Preferably, mobile detection region is set and mobile detection detection is carried out to picture frame and is comprised the concrete steps that:
Setting mobile detection region and mobile detection subregion: by each image block by M row is highly divided into, image is pressed
Width is divided into N column, and whole image is divided into M*N segmented areas, by M row a line or N column in one arrange whithin a period of time
It is set as mobile detection region, each segmented areas in mobile detection region is set as mobile detection subregion;
Formula detection is scanned to all mobile detection regions of image block, when setting the mobile detection in mobile detection region
Between cycle T and control the mobile detection time cycle and be maintained at time T, scan a column or a line one by one until in traversal image block
It is specific as follows to carry out mobile detection process for all mobile detection regions: in mobile detection period of time T, detecting mobile detection
Whether mobile detection subregion picture changes in region, if mobile detection subregion picture changes, sends out picture
The mobile detection subregion for changing is marked, and obtains the mobile detection subregion picture changed time;Statistics exists
In the complete image block circulation detecting period, the changed mobile detection subregion of picture and mobile detection subregion picture hair
The time for changing, the complete image block circulation detecting time is M*T or N*T, and records the complete image block circulation detecting period time
Number;
Output mobile detects subregion picture changed time, complete image block circulation detecting cycle times and picture
The changed mobile detection subregion in face.
Wherein, the picture frame of acquisition is handled as an image block, or acquisition picture frame be separated into it is more
A image block is respectively processed.
Wherein: whether mobile detection subregion picture is changed in detection mobile detection region comprises the concrete steps that:
Brightness value or rgb value that each mobile detection subregion in mobile detection region starts each pixel in detection are counted,
Count the brightness value or rgb value of each mobile detection subregion each pixel at the end of detection in mobile detection region;
It calculates each mobile detection subregion in mobile detection region and is detecting each pixel brightness value of beginning and mobile detection
The changing value of each mobile detection subregion each pixel brightness value at the end of detection in region, or calculate in mobile detection region
Each mobile detection subregion starts each pixel rgb value in detection and is detecting with mobile detection subregion each in mobile detection region
At the end of each pixel rgb value changing value;
If pixel brightness change value is greater than a threshold value or pixel rgb value changing value is greater than a threshold value, it is marked;
Count the quantity of labeled pixel;
If the quantity of labeled pixel is greater than a threshold value, then it is assumed that mobile detection subregion is drawn in mobile detection region
Face changes.
Video recording device, comprising:
Acquisition module is configured as at least two picture frames of acquisition, and acquires acoustic information;
Mobile detection setup module is configured as setting mobile detection region: by image frame division at several image blocks, respectively
Several image blocks are set as mobile detection region;
It records and starts unit, be configured as setting and record detection cycle at the beginning, the picture frame in the period is moved
Dynamic detecting detection, counts in the not same district for starting to record the mobile detection triggering times in detection cycle, mobile detection triggering
Domain number, and obtain and starting to record the sound average volume in the acoustic information in detection cycle, if mobile detection triggering times
Greater than the different zones number that the different zones number that mobile detection triggering times threshold value, mobile detection trigger is greater than mobile detection triggering
Threshold value and sound average volume are greater than sound average volume threshold value, then start audio-video recording;
End unit is recorded, being configured as setting one terminates to record detection cycle, moves to the picture frame in the period
Dynamic detecting detection, counts in the not same district for terminating to record the mobile detection triggering times in detection cycle, mobile detection triggering
The duration of domain number and video record, and obtain and be averaged sound terminating to record the sound in the acoustic information in detection cycle
Amount is moved if the different zones number that mobile detection triggering times are less than mobile detection triggering times threshold value, mobile detection triggers is less than
Different zones number threshold value, the sound average volume of dynamic detecting triggering be less than sound average volume threshold value or video record it is lasting when
Length is greater than duration threshold value, then end-sound video record;
Storage unit is configured as storing from recording audio/video is started to the sequential chart in the time of end-sound video record
As frame and acoustic information form audio-video.
Audio-video method for recording of the invention, the wonderful in acquisition family life that can be more accurate, automatic mistake
A large amount of boring slice of life are filtered, some life video segments walked about of such as only behaving of acquisition are avoided, compared to routine
24 hours modes recorded, the memory space needed for greatly saving.In a preferred embodiment of the invention, using dynamic mobile
The method setting mobile detection region of detection area simultaneously carries out mobile detection, to obtain more accurate detection area.
Specific embodiment
To further illustrate that each embodiment, the present invention are provided with attached drawing.These attached drawings are that the invention discloses one of content
Point, mainly to illustrate embodiment, and the associated description of specification can be cooperated to explain the operation principles of embodiment.Cooperation ginseng
These contents are examined, those of ordinary skill in the art will be understood that other possible embodiments and advantages of the present invention.Now tie
Closing the drawings and specific embodiments, the present invention is further described.
The method and step of the present embodiment is as follows: S1, acquisition include at least two picture frames of target object, and acquire sound
Information;
S2, setting mobile detection region: by image frame division at several image blocks, each several image blocks are set as mobile detection
Region;
As shown in Figure 1, image is arranged for one embodiment of the invention the schematic diagram in mobile detection region, wherein by picture
60 small detection zones are divided into, 12 parts of equal part, is divided into 5 points in horizontal direction on vertical direction.The sensitivity in each region,
It is all provided with and is set to 80%.The related technical personnel of this field can neatly divide picture area, be imitated with obtaining a preferably detecting
Fruit.
Detection cycle is recorded in S3, setting at the beginning, is carried out mobile detection detection to the picture frame in the period, is counted
Start to record the mobile detection triggering times in detection cycle, the different zones number that mobile detection triggers, and obtains and starting to record
Sound average volume in acoustic information in detection cycle processed, if mobile detection triggering times are greater than mobile detection triggering times
Threshold value, the different zones number of mobile detection triggering are big greater than the different zones number threshold value and sound average volume of mobile detection triggering
In sound average volume threshold value, then start audio-video recording;
S4, setting one terminate to record detection cycle, carry out mobile detection detection to the picture frame in the period, count
Terminate to record holding for the mobile detection triggering times in detection cycle, the different zones number of mobile detection triggering and video record
Continuous duration, and the sound average volume in the acoustic information that end records in detection cycle is obtained, if mobile detection triggering time
The different zones number that number is less than mobile detection triggering times threshold value, mobile detection triggers is less than the different zones of mobile detection triggering
Number threshold value, sound average volume are less than sound average volume threshold value or the duration of video record is greater than duration threshold value, then tie
Beam audio-video is recorded;
S5, the successive image frame and acoustic information stored in from beginning recorded video to the time of end video record are
Form audio-video.
As shown in Fig. 2, being the step flow chart of one embodiment of the invention step S3 to S5, starting the detection cycle ST that records a video
In, the different zones number SD and sound average volume SV of mobile detection triggering times SM, mobile detection triggering are obtained, then will
Its different zones number desired value triggered respectively with preset mobile detection triggering times desired value SM_DR, mobile detection
SD_DR and sound average volume desired value SV_DR compare, if meeting SM > SM_DR && SD > SD_DR && SV > SV_
DR then starts to record a video, and in the present embodiment, ST(starts detection cycle of recording a video): 3, SM_DR (expectation of incipient stage movement is detectd
Survey triggering times): the expectation mobile detection trigger area number of 3, SD_DR(incipient stages): 3
SV_DR (the expectation average volume of incipient stage): 1000.
In the detection cycle ET for terminating video recording, the not same district of mobile detection triggering times EM, mobile detection triggering are obtained
Domain number ED, sound average volume EV simultaneously count the period duration Ht that leaves it at that since video record, then by its point
The different zones number desired value ED_DR not triggered with preset mobile detection triggering times desired value EM_DR, mobile detection
And sound average volume desired value EV_DR compares, duration expectation video maximum duration Ht_DR compares, if meeting EM <
EM_DR | | ED < ED_DR | | EV < EV_DR | | Ht < Ht_DR then terminates to record a video.ET (terminates video recording in the present embodiment
Detection cycle): the expectation mobile detection triggering times of 5, EM_DR(ending phases): the expectation of 5, ED_DR(ending phases is mobile
Detect the number of regions of triggering): the average volume of 5, EV_DR(ending phases): when the longest of 65536, Ht_DR(video files
Between): 180 seconds.
During the S3-S5 of the present embodiment, the step of being additionally added photo candid photograph, when video starts to record, shooting
One photo, and Compress access, the video recording boil down to MP4 lattice to obtain other resources in addition to excellent screen, in the present embodiment
Formula, it is appreciated that in addition video can also be stored the video file of video clip boil down to other types format on demand
Segment is to be cached using TF card or local RAM, it is clear that other storage modes are also feasible.Finally, can be by recording
Video clip networking is uploaded to OSS platform and carries out unified storage management.
In another embodiment of the invention, with above-described embodiment the difference lies in that being set carrying out mobile detection region
In the detecting step for setting and carrying out mobile detection, use one is transformed upgrading on the basis of traditional mobile detection scheme
Time division scheme cannot achieve the excessive movement of arrangement due to being limited to software and hardware resources to solve traditional mobile detection scheme
Detect detection zone defect, be able to achieve by way of the time-division holding movable detection area of offer video pictures are done it is more smart
Thin mobile detection.
In the present embodiment, mobile detection region is set and carries out the specific steps of mobile detection detection to picture frame
It is: by each image block by M row is highly divided into, image setting mobile detection region and mobile detection subregion: is pressed into width
Be divided into N column, whole image is divided into M*N segmented areas, by M row a line or N column in one arrange and be arranged whithin a period of time
For mobile detection region, each segmented areas in mobile detection region is set as mobile detection subregion;
Formula detection is scanned to all mobile detection regions of image block, when setting the mobile detection in mobile detection region
Between cycle T and control the mobile detection time cycle and be maintained at time T, scan a column or a line one by one until in traversal image block
It is specific as follows to carry out mobile detection process for all mobile detection regions: in mobile detection period of time T, detecting mobile detection
Whether mobile detection subregion picture changes in region, if mobile detection subregion picture changes, sends out picture
The mobile detection subregion for changing is marked, and obtains the mobile detection subregion picture changed time;Statistics exists
In the complete image block circulation detecting period, the changed mobile detection subregion of picture and mobile detection subregion picture hair
The time for changing, the complete image block circulation detecting time is M*T or N*T, and records the complete image block circulation detecting period time
Number;
Output mobile detects subregion picture changed time, complete image block circulation detecting cycle times and picture
The changed mobile detection subregion in face.
In the present embodiment, the entire video frame image of acquisition is handled as an image block, and directly inputs
To mobile detection set parts, it is known that, under conditions of hardware environment can be supported enough, a picture point can also be passed through
The video image of acquisition is separated into multiple images block and is input to mobile detection set parts by block part to be respectively processed, with
Realize that more pictures carry out the effect of mobile detection parallel.
In addition, in the present embodiment, judging whether mobile detection subregion picture triggers the specific step of mobile detection event
It is rapid as follows:
1) brightness value that each mobile detection subregion in mobile detection region starts each pixel in detection is counted, statistics is moved
The brightness value of each mobile detection subregion each pixel at the end of detection in dynamic detection area;
2) each mobile detection subregion in mobile detection region is calculated to detect in each pixel brightness value of detection beginning with movement
Survey the changing value of each mobile detection subregion each pixel brightness value at the end of detection in region;If 3) pixel brightness change
Value is greater than a threshold value or pixel changing value is greater than a threshold value, then is marked;
4) quantity of labeled pixel is counted;
5) if the quantity of labeled pixel is greater than a threshold value, then it is assumed that mobile detection subregion in mobile detection region
Picture changes.
The related technical personnel of this field, which should be known that, carries out triggering mobile detection using pixel rgb value situation of change
The judgement of time be also it is feasible, rgb value operand compared to brightness value it is larger, therefore using brightness value calculate it is more succinct.
Based on above-mentioned audio-video method for recording, the present invention also proposes a kind of audio-video record device, comprising:
Acquisition unit is configured as at least two picture frames of acquisition, and acquires acoustic information;
Mobile detection setting unit is configured as setting mobile detection region: by image frame division at several image blocks, respectively
Several image blocks are set as mobile detection region;
It records and starts unit, be configured as setting and record detection cycle at the beginning, the picture frame in the period is moved
Dynamic detecting detection, counts in the not same district for starting to record the mobile detection triggering times in detection cycle, mobile detection triggering
Domain number, and obtain and starting to record the sound average volume in the acoustic information in detection cycle, if mobile detection triggering times
Greater than the different zones number that the different zones number that mobile detection triggering times threshold value, mobile detection trigger is greater than mobile detection triggering
Threshold value and sound average volume are greater than sound average volume threshold value, then start audio-video recording;
End unit is recorded, being configured as setting one terminates to record detection cycle, moves to the picture frame in the period
Dynamic detecting detection, counts in the not same district for terminating to record the mobile detection triggering times in detection cycle, mobile detection triggering
The duration of domain number and video record, and obtain and be averaged sound terminating to record the sound in the acoustic information in detection cycle
Amount is moved if the different zones number that mobile detection triggering times are less than mobile detection triggering times threshold value, mobile detection triggers is less than
Different zones number threshold value, the sound average volume of dynamic detecting triggering be less than sound average volume threshold value or video record it is lasting when
Length is greater than duration threshold value, then end-sound video record;
Storage unit is configured as storing from recorded video is started to the consecutive image in the time of end-sound video record
Frame and acoustic information form audio-video.
Audio-video method for recording of the invention can be more by analysis sound characteristic with the generation of mobile detection event
The accurate wonderful obtained in family life, automatic fitration fall a large amount of boring slice of life, it is some such as to avoid acquisition
It is empty greatly to save required storage compared to the mode of recording in conventional 24 hours for the life video segment walked about of only behaving
Between.
Although specifically showing and describing the present invention in conjunction with preferred embodiment, those skilled in the art should be bright
It is white, it is not departing from the spirit and scope of the present invention defined by the appended claims, it in the form and details can be right
The present invention makes a variety of changes, and is protection scope of the present invention.