CN102024146A - Method for extracting foreground in piggery monitoring video - Google Patents

Method for extracting foreground in piggery monitoring video Download PDF

Info

Publication number
CN102024146A
CN102024146A CN 201010577516 CN201010577516A CN102024146A CN 102024146 A CN102024146 A CN 102024146A CN 201010577516 CN201010577516 CN 201010577516 CN 201010577516 A CN201010577516 A CN 201010577516A CN 102024146 A CN102024146 A CN 102024146A
Authority
CN
China
Prior art keywords
prospect
frame
background
foreground
difference
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN 201010577516
Other languages
Chinese (zh)
Other versions
CN102024146B (en
Inventor
朱伟兴
纪滨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu University
Original Assignee
Jiangsu University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu University filed Critical Jiangsu University
Priority to CN2010105775164A priority Critical patent/CN102024146B/en
Publication of CN102024146A publication Critical patent/CN102024146A/en
Application granted granted Critical
Publication of CN102024146B publication Critical patent/CN102024146B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a method for extracting foreground in piggery monitoring video. The method comprises the steps of firstly acquiring an initial background frame containing no foreground and a background frame sequence containing the foreground, then carrying out adjacent symmetric frame difference and background frame difference, carrying out foreground motion analysis according to the adjacent symmetric frame difference and the background frame difference, acquiring a status code, updating background and fusing the two frame differences by utilizing the status code so as to acquire a shade containing foreground, calculating background Euclidean distance of local texture operators and S (saturation) and H (hue) channel background frame difference of HSV (hue-saturation-value) colour space, combining shade discriminating conditions, and finally extracting a foreground frame according to result of pixel attribute values. The invention is applicable to piggery monitoring of large-scale piggery farms, has adaptability, robustness and higher foreground target segmentation accuracy and creates favorable conditions for subsequent work which is pig video intelligent analysis.

Description

Foreground extracting method in the pig house monitor video
Technical field
The present invention relates to a kind of video monitoring foreground target extracting method, relate in particular to the fixedly extracting method of monitoring camera-shooting video pig of pig house, specifically be applicable to pig farm intelligent video monitoring technical field, belong to the intelligent video target detection technique.
Background technology
It is with the background removal in each frame in the sequence of frames of video that the video monitoring foreground target extracts, the technology that detects foreground target and split.Foreground extracting method is divided into fixing by cam device and moves two big classes, divides rigid body and non-rigid body two big classes by the foreground target characteristic.Foreground extracting method belongs to the non-rigid body foreground extraction technology of fixing shooting in the pig house monitor video.
Doctor Zhang Min (referring to: open quick. based on the animal behavior of figure's identification automatically analysis and research with use [D]. Hangzhou Zhejiang University biomedical engineering and instrument institute 2005.) adopt the complete foreground target of coloured image threshold value outline acquisition, this method is simple, calculation cost is little, belong to classical background frame difference method, but it is static constant that this method requires background, and background heals the simple division effect better.And the pig house background of reality is difficult to satisfy this condition, because pig house generally is designed to the ventilation and penetrating light building, fine light is strong, and pig is moved indoor, shadow can occur; Gradual change also can take place in cloudy day light in time; When temporary blocking occurring suddenly, the window of projection sunlight can play the indoor illumination intensity sudden change.
People such as professor Xin (Shao B, Xin H. A real-time computer vision assessment and control of thermal comfort for group-housed pigs[J]. Computers and Electronics in Agriculture. 2008,62 (1): 15-21.) utilize on-the-spot dark-background in laboratory and the big characteristics of white pig contrast, the average that adopts continuous 3 frames is as processed frame, the utilization gray level threshold segmentation goes out preliminary prospect, carrying out morphology and area threshold again handles, obtain accurate prospect, this is owned by France in Flame Image Process dividing method acquisition foreground target, is suitable for and only limits to specific experiment condition.Particularly when prospect was moved, the mean value of continuous 3 frames caused the pseudo-impact point of prospect to increase.Directly adopting Flame Image Process to ignore the time domain specification of frame sequence, is not the common method of frame of video target detection.
General frame of video background removal approach commonly used (referring to: Herrero S, Besc ó s J. Background Subtraction Techniques:Systematic Evaluation and Comparative Analysis[C] //Proceedings of the 11th International Conference on Advanced Concepts for Intelligent Vision Systems.Springer-Verlag. 2009,5807/2009:33-42.) be divided into 3 classes, be basic model, as frame difference method, medium filtering; Parameter model is as single Gauss, mixed Gauss model; Nonparametric model is as histogram method, cuclear density method.And mixed Gauss model and nonparametric model calculated amount are big, the method complexity, and real-time is poor, thereby has limited its popularization in actual applications.And medium filtering and single Gauss model can produce smear when foreground target slowly moves; Adjacent frame difference method is calculated simple, but object content easily produces the cavity, and when pig plants oneself, can be made background by mistake; The background frame difference method must be set up the context update model, and above-mentioned 3 class algorithms all can't be eliminated the shadow of prospect.
Hu Yuanyuan (referring to: Hu Yuanyuan, Wang Rangding. based on the motion shadow removal algorithm [J] of local grain unchangeability. computer utility. 2008,28 (012): 3141-3143.) propose to describe the local grain structure and can distinguish foreground target and shadow well with the LBP operator that strengthens.Yet this method will be ineffective when background image and foreground object have similar texture information, and therefore, this has just limited the application of algorithm.
Summary of the invention
The objective of the invention is to overcome the deficiency of existing pig video foreground target extraction method, foreground extracting method in a kind of robustness is good, effective and real-time the is good pig house monitor video is proposed, can keep accurate frame of video prospect edge and eliminate common methods and easily cause prospect interior void, smear and shade and deposit cash resembling, and can suppress electronic noise and ground is water stain and the excreta vestige changes influence to prospect.
The technical solution used in the present invention is: in the pig house zone camera system and computer control system are set, there are adjacent symmetric frame difference processing block module, background frames difference processing frame module, motion analysis processing block module, prospect Fusion Module, context update module, shadow Detection module and foreground extracting module in computer control system inside.Obtain an initial background frame that does not contain prospect by camera system
Figure 2010105775164100002DEST_PATH_IMAGE001
With the background frames that contains prospect
Figure 173521DEST_PATH_IMAGE002
Sequence also keeps in computing machine.Adjacent symmetric frame difference processing block module input background frames
Figure 520189DEST_PATH_IMAGE002
Continuous 3 consecutive frames in the sequence are with present frame
Figure 2010105775164100002DEST_PATH_IMAGE003
With forward and backward frame
Figure 480186DEST_PATH_IMAGE004
,
Figure 2010105775164100002DEST_PATH_IMAGE005
Carry out difference respectively and differentiated two binary images carried out AND operation obtaining the adjacent symmetric frame difference Background frames difference processing frame module input present frame
Figure 440500DEST_PATH_IMAGE003
With the initial background frame
Figure 895752DEST_PATH_IMAGE001
, be output as the background frames difference of binaryzation , select the B passage of RGB color space to carry out the background frames difference
Figure 662152DEST_PATH_IMAGE007
Motion analysis processing block module input background frames difference With the adjacent symmetric frame difference
Figure 326668DEST_PATH_IMAGE006
Carry out motion state and differentiate, output present frame prospect state encoding ,
Figure 2010105775164100002DEST_PATH_IMAGE009
It is present frame
Figure 949728DEST_PATH_IMAGE003
Carry out the motion state of adjacent symmetric frame difference computing,
Figure 132579DEST_PATH_IMAGE010
Be present frame
Figure 351070DEST_PATH_IMAGE003
Frame carries out the scene state of background frames calculus of differences; The ratio that accounts for total image area when moving region area foreground moving less than 0.04~0.12 time is slow or static or do not have a prospect; When ratio that the prospect area accounts for total image area background illumination greater than 0.6~0.8 time takes place to become suddenly, do not have prospect in the scene less than 0.03~0.07 the time; The prospect state encoding of prospect proper motion
Figure 148125DEST_PATH_IMAGE008
Be 00, the slow prospect state encoding of motion of prospect
Figure 570010DEST_PATH_IMAGE008
Be 10, do not have the prospect state encoding of prospect Be 11, the prospect state encoding of background illumination sudden change
Figure 550922DEST_PATH_IMAGE008
Be 02.The prospect Fusion Module is with the background frames difference
Figure 328997DEST_PATH_IMAGE007
With the adjacent symmetric frame difference
Figure 487446DEST_PATH_IMAGE006
Carry out inclusive-OR operation, obtain containing the prospect binary map of shade through filtering, morphological operation and connection marking operation
Figure 2010105775164100002DEST_PATH_IMAGE011
Context update module input present frame prospect state encoding , the initial background frame
Figure 205183DEST_PATH_IMAGE001
, preceding symmetrical frame
Figure 344041DEST_PATH_IMAGE004
With its prospect binary map
Figure 474939DEST_PATH_IMAGE012
, present frame
Figure 52551DEST_PATH_IMAGE003
With its prospect binary map
Figure 850874DEST_PATH_IMAGE011
, output is background frames
Figure 160632DEST_PATH_IMAGE002
When the prospect state encoding
Figure 28094DEST_PATH_IMAGE008
Be to rebuild brand-new background frames at 11 o'clock
Figure 897480DEST_PATH_IMAGE002
When the prospect state encoding
Figure 737260DEST_PATH_IMAGE008
Be 00 or 10 o'clock, with present frame
Figure 280237DEST_PATH_IMAGE003
Remove the prospect binary map
Figure 651306DEST_PATH_IMAGE012
Back remaining area pixel replaces the initial background frame
Figure 305141DEST_PATH_IMAGE001
Respective pixel is by the prospect binary map
Figure 265007DEST_PATH_IMAGE011
The background area of blocking is the initial background frame The respective pixel value compensates the prospect binary map again
Figure 571672DEST_PATH_IMAGE011
Present frame
Figure 966881DEST_PATH_IMAGE003
Prospect edge pixel and corresponding preceding frame
Figure 594303DEST_PATH_IMAGE004
The average of margin of image element; When the prospect state encoding
Figure 479082DEST_PATH_IMAGE008
It is 02 o'clock, by preceding frame
Figure 746115DEST_PATH_IMAGE004
Remove the prospect binary map
Figure 755135DEST_PATH_IMAGE012
The present frame of back remaining area correspondence
Figure 486331DEST_PATH_IMAGE003
Pixel replaces the initial background frame
Figure 479694DEST_PATH_IMAGE001
Corresponding background pixel, the initial background frame
Figure 47073DEST_PATH_IMAGE004
Middle prospect binary map
Figure 111981DEST_PATH_IMAGE012
The background area of blocking is the initial background frame The respective pixel value compensates the prospect binary map again
Figure 612681DEST_PATH_IMAGE012
The preceding frame of prospect edge correspondence
Figure 916623DEST_PATH_IMAGE004
Pixel and corresponding present frame
Figure 270375DEST_PATH_IMAGE003
The average of margin of image element.The shadow Detection module will contain the prospect binary map of shade
Figure 648267DEST_PATH_IMAGE011
Corresponding present frame
Figure 311329DEST_PATH_IMAGE003
Pixel value is got RGBThe value of color model B passage adopts 8 neighborhood territory pixels to make up the local grain zone, calculates the local grain construction operator
Figure 2010105775164100002DEST_PATH_IMAGE013
And compare two construction operators
Figure 664687DEST_PATH_IMAGE013
The Euclidean distance of value, if less than 0.11, then this pixel is the direct-shadow image vegetarian refreshments, otherwise is the foreground pixel point; The prospect binary map that will contain the direct-shadow image vegetarian refreshments again
Figure 822129DEST_PATH_IMAGE011
Corresponding present frame
Figure 54528DEST_PATH_IMAGE003
Pixel value
Figure 888492DEST_PATH_IMAGE014
Shade is differentiated the saturation degree of prospect shadow region in the hsv color space The background area of not upgrading with correspondence Difference less than 0.22 and the colourity of shadow region
Figure 2010105775164100002DEST_PATH_IMAGE017
The background area of Geng Xining not Difference then is judged as the direct-shadow image vegetarian refreshments less than 0.08, otherwise is the foreground pixel point.Computing machine by foreground extracting module with present frame Middle pixel value
Figure 577520DEST_PATH_IMAGE014
Be that 0 zone is left present frame Original pixel value, rest of pixels is shown as black background, and the foreground extraction that then will not contain shade is come out.
The invention has the beneficial effects as follows:
1, the background frames difference with adjacent symmetric frame difference and adaptive background renewal merges, and by the shadow Detection algorithm, can not only accurately detect the sport foreground target area again, is applicable to that also slow the or static foreground target of motion detects.And shadow Detection algorithm simultaneous texture structure LTOperator and hsv color space shade double check strengthen the recognition capability to shade.
2, when carrying out the frame processing, all computing modules all are made of the calculated performance simple algorithm, and algorithm is carried out flow process and adopted potential concurrent structure, concurrent execution when being easy to algorithm and being transplanted on the multiprocessor hardware platform realizes that reliable real-time video two field picture handles.
3, the present invention is applicable to the pig house monitoring on scale pig farm, in pig house indoor no matter single goal or multiple goal, no matter background light is soft gradual change or strong sudden change, no matter pig is the station or crouches or stop-go, can both eliminate cavity, smear and shade, and can suppress electronic noise and ground is water stain and the excreta vestige changes influence to prospect, obtain accurate foreground target, have adaptivity, robustness and higher foreground target segmentation precision, for the analysis of follow-up work pig video intelligent creates favorable conditions.
Description of drawings
Below in conjunction with the drawings and specific embodiments the present invention is described in further detail;
Fig. 1 is a foreground extracting method FB(flow block) in the pig house monitor video of the present invention;
Fig. 2 is the process flow diagram of shadow Detection algorithm among Fig. 1.
Embodiment
The present invention is when implementing, in scale hoggery pigsties zone camera system and computer control system are installed, camera system is linked to each other with computer control system, and computer control system inside has adjacent symmetric frame difference processing block module, background frames difference processing frame module, motion analysis processing block module, prospect Fusion Module, context update module, shadow Detection module and foreground extracting module.The ground in scale hoggery pigsties zone is concrete floor, leaves the part excreta above, and whole video background light is brighter.Carry out adjacent symmetric frame difference and background frames difference with parallel algorithm, output variable according to adjacent symmetric frame difference and background frames difference, carry out the foreground moving analysis, obtain state encoding, being that controlled condition is parallel with the status code carries out that adaptive background upgrades and preceding two frame differences merge acquisition and comprise shade in interior prospect, the shadow Detection module is calculated local grain operator (Local Texture with parallel algorithm LT) Euclidean distance and expression form and aspect, saturation degree and brightness HSVColor space S, HPassage prospect frame is poor, and simultaneous shade criterion is last, according to result's sign of pixel property, eliminates shade, extracts the present frame that only contains prospect.Concrete steps are as follows, referring to Fig. 1:
1, obtains the initial background frame
Computing machine obtains a barnyard scape frame of video that does not have pig, i.e. an initial background frame that does not contain prospect by fixing shooting
Figure 763967DEST_PATH_IMAGE001
, and with this initial background frame
Figure 784007DEST_PATH_IMAGE001
Keep.Afterwards, have a pig slowly to come into this zone, stopping bows gnaws ground a little while, and of short duration defecation phenomenon is arranged, and leaves this zone then; In this time period of pig activity, obtain to contain the background frames of prospect by fixing camera system
Figure 897457DEST_PATH_IMAGE002
Sequence.Background frames pig In the sequence, a frame that does not contain pig is arranged, also this can not contained the frame of pig as the initial background frame
2, adjacent symmetric frame difference
Background frames pig
Figure 249438DEST_PATH_IMAGE002
In the sequence, computing machine is imported continuous 3 consecutive frames by adjacent symmetric frame difference processing block module
Figure 330526DEST_PATH_IMAGE004
,
Figure 556102DEST_PATH_IMAGE003
,
Figure 584101DEST_PATH_IMAGE005
, output is middle present frame
Figure 828000DEST_PATH_IMAGE003
The moving region of binaryzation.In continuous 3 two field pictures of frame sequence, in order to extract present frame
Figure 99232DEST_PATH_IMAGE003
The motion target edges, the present invention adopts the adjacent symmetric frame difference
Figure 733475DEST_PATH_IMAGE006
, promptly present frame and front and back adjacent symmetric frame carry out difference respectively, and differentiated two binary images are carried out AND operation, obtain the result and are present frame moving target edge, i.e. adjacent symmetric frame difference
Figure 361903DEST_PATH_IMAGE006
See formula (1).The adjacent symmetric frame difference
Figure 476620DEST_PATH_IMAGE006
Be promising 1 some region, belong to the foreground moving zone.The threshold value of binaryzation
Figure 2010105775164100002DEST_PATH_IMAGE019
Adopt maximum variance between clusters that Japanese Otsu proposes (referring to Otsu N. A threshold selecti on method from gray-level histograms[J]. IEEE Transactions on System Man and Cybernetics. 1979,9 (1): 62-69.), also need compensate a constant relevant with the camera system noise
Figure 165091DEST_PATH_IMAGE020
, generally between 0.06~0.3, value of the present invention is 0.1 to its value, filters noise between frames when guaranteeing not contain foreground target.This algorithm has strengthened the moving target margin signal, widens the difference of target and background residual noise, eliminates the background texture that moving target blocks or reappears.
Figure DEST_PATH_IMAGE021
?(1)
3, background frames difference
Background frames difference processing frame module in the computer system is input as present frame And initial background frame
Figure 344847DEST_PATH_IMAGE001
, be output as the background frames difference of binaryzation
Figure 563339DEST_PATH_IMAGE007
Background frames difference block of the present invention is in order to increase the internal signal of prospect.Color of prospect pig and texture and background difference are bigger, and segmentation effect is obvious.Select RGB(Red Green Blue, RGB) color space BPassage carries out present frame
Figure 360394DEST_PATH_IMAGE003
With the background frames difference
Figure 779349DEST_PATH_IMAGE007
, the background frames difference
Figure 562629DEST_PATH_IMAGE007
The threshold value of binaryzation
Figure 635627DEST_PATH_IMAGE019
Adopt maximum variance between clusters, also need compensate a constant relevant with the camera system noise
Figure 603583DEST_PATH_IMAGE022
, generally between 0.06~0.20, value of the present invention is 0.12 to its value, filters noise between frames when guaranteeing not contain foreground target, sees shown in the formula (2).If
Figure 512764DEST_PATH_IMAGE007
Being 1, then is foreground area, otherwise, be background.
Figure 2010105775164100002DEST_PATH_IMAGE023
(2)
4, motion analysis
Motion analysis processing block module in the computer system is input as the background frames difference
Figure 286685DEST_PATH_IMAGE007
With the adjacent symmetric frame difference
Figure 964922DEST_PATH_IMAGE006
, be output as present frame prospect state encoding
Figure 166097DEST_PATH_IMAGE008
, can carry out motion state differentiation and output present frame
Figure 553785DEST_PATH_IMAGE003
The processing controls condition.Because adjacent symmetric frame difference
Figure 69080DEST_PATH_IMAGE006
Can only obtain to comprise the moving region of shade, area when the moving region in interior prospect
Figure 851091DEST_PATH_IMAGE024
Account for total image area N( I) ratio
Figure 2010105775164100002DEST_PATH_IMAGE025
Less than certain less threshold value e 1 The time, it is relevant with the moving target number with frame per second, and generally 0.04~0.12, the present invention gets 0.07, thinks that then foreground moving is slow or static or does not have prospect.Because background frames difference
Figure 36216DEST_PATH_IMAGE007
Can obtain to comprise shade, when the prospect area in interior foreground area
Figure 106940DEST_PATH_IMAGE026
Account for total image area N( I) ratio
Figure 2010105775164100002DEST_PATH_IMAGE027
Greater than certain big threshold value e 2 The time, generally 0.6~0.8, the present invention gets 0.7, shows that this frame does not have foreground target or illumination to take place to change suddenly, only carries out the context update operation, enters next frame.
Figure 35713DEST_PATH_IMAGE027
Less than less threshold value e 3The time, it is relevant with the camera system noise, and generally 0.03~0.07, example of the present invention gets 0.03, then thinks not have prospect in the scene.By formula (3), (4), (5), (6), obtain present frame
Figure 688542DEST_PATH_IMAGE003
The prospect state encoding
Figure 169202DEST_PATH_IMAGE008
, can be by the corresponding follow-up controlled condition of table 1 output.
Figure 789539DEST_PATH_IMAGE009
Be present frame
Figure 191177DEST_PATH_IMAGE003
Carry out the motion state that the computing of adjacent symmetric frame difference can be represented, For
Figure 677971DEST_PATH_IMAGE003
Frame carries out the scene state that the background frames calculus of differences can be represented.Implement different period state encodings Be followed successively by 11,00,10,00,11.
Figure 728283DEST_PATH_IMAGE028
(3)
(4)
Figure 604972DEST_PATH_IMAGE030
(5)
(6)
Table State encoding S t S t 'And controlled condition output
Figure 569834DEST_PATH_IMAGE009
Figure 584713DEST_PATH_IMAGE010
Condition discrimination and present frame are handled
0 0 The prospect proper motion then carries out context update, and prospect merges, shadow removal
1 0 Prospect is slowly moved, and then carries out context update, and prospect merges, shadow removal
1 1 Do not have prospect, only carry out the context update operation, enter next frame
0 2 The context update operation is only carried out in the background illumination sudden change, enters next frame
5, prospect merges
Prospect Fusion Module in the computer system carries out the background frames difference With the adjacent symmetric frame difference Merge, promptly the two carries out the prospect binary map that inclusive-OR operation obtains containing shade
Figure 876652DEST_PATH_IMAGE011
, adjacent symmetric frame difference like this The foreground information of losing obtains fine compensation, the prospect binary map
Figure 199366DEST_PATH_IMAGE011
It is the coarse foreground area that contains shade.At last, through filtering elimination isolated point noise, morphological operation and be communicated with marking operation and thoroughly eliminate little cavity in the foreground area, excrement piece that small size threshold value elimination picture has just produced and urine patch obtain containing the accurate prospect binary map of shade
Figure 442259DEST_PATH_IMAGE011
Prospect fusion treatment frame module of the present invention is input as condition control signal, i.e. present frame
Figure 746202DEST_PATH_IMAGE034
The prospect state encoding
Figure 2010105775164100002DEST_PATH_IMAGE035
, binaryzation the background frames difference
Figure 834374DEST_PATH_IMAGE007
With the adjacent symmetric frame difference
Figure 540162DEST_PATH_IMAGE006
, be output as the prospect binary map that contains shade
Figure 875329DEST_PATH_IMAGE011
, wherein,
Figure 414370DEST_PATH_IMAGE035
Be 11 o'clock, expression does not have pig to have present frame
Figure 555501DEST_PATH_IMAGE003
Do not need to carry out prospect and merge, change next frame and handle; Be be expressed as in 10,00 o'clock pig slowly, proper motion, can not eliminate interior void behind the adjacent symmetric frame difference, and be difficult to find static foreground target, and the background frames difference can't obtain the accurate edge of moving target, solution is to adopt the background frames difference
Figure 53479DEST_PATH_IMAGE007
With the adjacent symmetric frame difference
Figure 638175DEST_PATH_IMAGE006
Merge, promptly the two carries out inclusive-OR operation and obtains coarse background frames difference
Figure 651130DEST_PATH_IMAGE007
With the adjacent symmetric frame difference
Figure 533636DEST_PATH_IMAGE006
The foreground information lost of adjacent symmetric frame difference obtains fine compensation like this, at last, through filtering elimination isolated point noise, morphological operation and connection marking operation are thoroughly eliminated the little cavity in the foreground area, excrement piece that small size threshold value elimination picture has just produced and urine patch obtain prospect binary map accurate, that contain shade
Figure 699169DEST_PATH_IMAGE011
6, context update
Because real background is not static, so must background upgrade, the context update module in the computer system of the present invention is safeguarded a background model by concurrent program all the time.The input of context update processing block module is a present frame
Figure 704034DEST_PATH_IMAGE034
The prospect state encoding
Figure 955018DEST_PATH_IMAGE035
, the initial background frame
Figure 437952DEST_PATH_IMAGE036
, preceding frame
Figure 738219DEST_PATH_IMAGE004
With its prospect binary map
Figure DEST_PATH_IMAGE037
, present frame
Figure 913986DEST_PATH_IMAGE003
With its prospect binary map
Figure 652266DEST_PATH_IMAGE011
, be output as background frames
Figure 876574DEST_PATH_IMAGE002
Initial background is the initial background frame that does not contain prospect in the video sequence leading portion The prospect state encoding Be 11 o'clock, expression does not detect prospect, by present frame
Figure 510314DEST_PATH_IMAGE003
All pixel replaces the whole pixels of background, is equivalent to rebuild brand-new background frames
Figure 600630DEST_PATH_IMAGE002
Figure 595262DEST_PATH_IMAGE035
Be 00 or 10 o'clock, expression detects prospect, then exists
Figure 847252DEST_PATH_IMAGE003
The remaining area pixel replaces the initial background frame after removing foreground area Respective pixel is by the prospect binary map
Figure 123305DEST_PATH_IMAGE011
The background area of blocking is the initial background frame
Figure 487290DEST_PATH_IMAGE036
The respective pixel value compensates the prospect binary map again
Figure 660914DEST_PATH_IMAGE011
Present frame
Figure 48033DEST_PATH_IMAGE003
Prospect edge pixel and corresponding preceding frame
Figure 480151DEST_PATH_IMAGE004
The average of margin of image element; If
Figure 183796DEST_PATH_IMAGE035
Be 02 o'clock, show to detect the background illumination sudden change, then by preceding frame Remove foreground area
Figure 652003DEST_PATH_IMAGE037
The present frame of back remaining area correspondence Pixel replaces former
Figure 711543DEST_PATH_IMAGE036
Corresponding background pixel, former
Figure 495478DEST_PATH_IMAGE004
Middle prospect
Figure 591610DEST_PATH_IMAGE037
The background area of blocking is
Figure 365531DEST_PATH_IMAGE036
Frame respective pixel value compensates prospect again
Figure 43768DEST_PATH_IMAGE037
Prospect edge correspondence
Figure 182626DEST_PATH_IMAGE004
Pixel and corresponding present frame
Figure 828371DEST_PATH_IMAGE003
The average of margin of image element.
7, shadow Detection:
Shadow Detection module in the computer system of the present invention contains two concurrent shadow Detection sub modular structures, and the purpose of using two submodules is for strengthening the robustness to the shadow Detection algorithm.
Table
Figure 891136DEST_PATH_IMAGE032
8-neighbour structure image block
g 4 g 3 g 2
g 5 g 0 g 1
g 6 g 7 g 8
The prospect binary map that will contain shade Corresponding present frame
Figure 248485DEST_PATH_IMAGE003
Pixel value is got RGB(Red Green Blue, RGB) value of color model B passage, adopt 8 neighborhood territory pixels with 1 pixel of central pixel point distance to make up local grain and described the zone, see Table 2, calculate the local grain construction operator of inner each pixel of foreground area
Figure 132258DEST_PATH_IMAGE013
(Local Texture LT), sees formula (7), here
Figure 247982DEST_PATH_IMAGE038
The gray-scale value of 8 points around represent pixel piece center pixel reaches,
Figure 897881DEST_PATH_IMAGE013
Operator is the one-dimensional vector of 9 elements, in the formula (10)
Figure DEST_PATH_IMAGE039
For comprising the prospect binary map of shade Total pixel number, TIt is the prospect binary map that comprises shade The average of all pixel gray-scale value partial error averages.The prospect binary map that comprises shade
Figure 403446DEST_PATH_IMAGE011
The zone is at present frame
Figure 160050DEST_PATH_IMAGE003
Pixel
Figure 624660DEST_PATH_IMAGE013
Operator is made as
Figure 669977DEST_PATH_IMAGE040
, comprise the prospect binary map of shade
Figure 127503DEST_PATH_IMAGE011
The background frames of background is not being upgraded in the zone
Figure 489345DEST_PATH_IMAGE036
The relevant position point
Figure 639704DEST_PATH_IMAGE013
Operator is made as
Figure DEST_PATH_IMAGE041
, by relatively these two
Figure 710997DEST_PATH_IMAGE013
If the Euclidean distance of value is less than threshold value
Figure 909897DEST_PATH_IMAGE042
, the present invention gets 0.11, and then this pixel is the direct-shadow image vegetarian refreshments, otherwise is the foreground pixel point, the foreground pixel property value
Figure DEST_PATH_IMAGE043
See formula (11).
Figure 188563DEST_PATH_IMAGE044
i=0,1,…, 8 (7)
In the formula:
Figure DEST_PATH_IMAGE045
, m is the average (8) of 3 * 3 block of pixels gray-scale values
Figure 509823DEST_PATH_IMAGE046
(9)
Figure DEST_PATH_IMAGE047
(10)
HSVColor model meets the visually-perceptible physiological property of people to color very much, can accurately reflect some half-tone informations and color information, for incandescent in the image and extremely dark object, also can reflect corresponding information well.The prospect binary map that therefore, will contain shade
Figure 876530DEST_PATH_IMAGE011
The present frame of corresponding former input
Figure 399916DEST_PATH_IMAGE003
Pixel value is differentiated shade in the hsv color space.The saturation degree of prospect shadow region
Figure 642809DEST_PATH_IMAGE015
The background area of not upgrading with correspondence
Figure DEST_PATH_IMAGE049
Difference less than threshold value
Figure 681172DEST_PATH_IMAGE050
, the present invention gets 0.22; Simultaneously, the colourity of shadow region
Figure 31995DEST_PATH_IMAGE017
The background area of Geng Xining not
Figure DEST_PATH_IMAGE051
Difference is less than threshold value
Figure 737783DEST_PATH_IMAGE052
, the present invention gets 0.08, then is judged as the direct-shadow image vegetarian refreshments, otherwise is the foreground pixel point.
Figure DEST_PATH_IMAGE053
(11)
For preventing when background image and foreground object have similar texture information
Figure 885998DEST_PATH_IMAGE013
Method will be ineffective, so the shadow Detection discriminant function needs the simultaneous criterion, sees shown in the formula (11), if comprise the foreground pixel property value of shade
Figure 677237DEST_PATH_IMAGE043
Value is 1, then is shade, otherwise is the foreground target zone, identifies accurate foreground target zone.
Shadow Detection processing block module of the present invention adopts parallel organization, specifically as shown in Figure 2, the shadow Detection frame of dotted line block diagram part representative graph 1, input is the initial background frame
Figure 756051DEST_PATH_IMAGE036
, contain the prospect binary map of shade
Figure 67078DEST_PATH_IMAGE011
, corresponding former input present frame
Figure 635463DEST_PATH_IMAGE003
, output is the foreground pixel property value
Figure 851680DEST_PATH_IMAGE043
8, foreground extraction
Foreground extracting module of the present invention is in order to extract accurate foreground target.With former input present frame
Figure 547235DEST_PATH_IMAGE003
Middle pixel value
Figure 962036DEST_PATH_IMAGE043
Be that 0 zone is left present frame
Figure 904584DEST_PATH_IMAGE003
Original pixel value, rest of pixels is shown as black background, i.e. present frame
Figure 158498DEST_PATH_IMAGE003
The rest of pixels value is made as 0, and the prospect that then will not contain shade accurately extracts, so that succeeding target is followed the tracks of, the carrying out smoothly of pattern-recognition work.

Claims (1)

1. foreground extracting method in the pig house monitor video, in the pig house zone camera system and computer control system are set, there are adjacent symmetric frame difference processing block module, background frames difference processing frame module, motion analysis processing block module, prospect Fusion Module, context update module, shadow Detection module and foreground extracting module in computer control system inside, it is characterized in that comprising following concrete steps:
1) obtains an initial background frame that does not contain prospect by camera system
Figure 2010105775164100001DEST_PATH_IMAGE002
With the background frames that contains prospect
Figure 2010105775164100001DEST_PATH_IMAGE004
Sequence also keeps in computing machine;
2) adjacent symmetric frame difference processing block module input background frames
Figure 647306DEST_PATH_IMAGE004
Continuous 3 consecutive frames in the sequence are with present frame With forward and backward frame ,
Figure 2010105775164100001DEST_PATH_IMAGE010
Carry out difference respectively and differentiated two binary images carried out AND operation obtaining the adjacent symmetric frame difference
Figure 2010105775164100001DEST_PATH_IMAGE012
3) background frames difference processing frame module input present frame With the initial background frame
Figure 656162DEST_PATH_IMAGE002
, be output as the background frames difference of binaryzation
Figure 2010105775164100001DEST_PATH_IMAGE014
, select the B passage of RGB color space to carry out the background frames difference
Figure 522005DEST_PATH_IMAGE014
4) motion analysis processing block module input background frames difference
Figure 683996DEST_PATH_IMAGE014
With the adjacent symmetric frame difference Carry out motion state and differentiate, output present frame prospect state encoding
Figure 2010105775164100001DEST_PATH_IMAGE016
,
Figure 2010105775164100001DEST_PATH_IMAGE018
It is present frame
Figure 170789DEST_PATH_IMAGE006
Carry out the motion state of adjacent symmetric frame difference computing, Be present frame
Figure 520999DEST_PATH_IMAGE006
Frame carries out the scene state of background frames calculus of differences; The ratio that accounts for total image area when moving region area foreground moving less than 0.04~0.12 time is slow or static or do not have a prospect; When ratio that the prospect area accounts for total image area background illumination greater than 0.6~0.8 time takes place to become suddenly, do not have prospect in the scene less than 0.03~0.07 the time; The prospect state encoding of prospect proper motion
Figure 221102DEST_PATH_IMAGE016
Be 00, the slow prospect state encoding of motion of prospect
Figure 340368DEST_PATH_IMAGE016
Be 10, do not have the prospect state encoding of prospect
Figure 733303DEST_PATH_IMAGE016
Be 11, the prospect state encoding of background illumination sudden change
Figure 567879DEST_PATH_IMAGE016
Be 02;
5) the prospect Fusion Module is with the background frames difference With the adjacent symmetric frame difference
Figure 45445DEST_PATH_IMAGE012
Carry out inclusive-OR operation, obtain containing the prospect binary map of shade through filtering, morphological operation and connection marking operation
Figure 2010105775164100001DEST_PATH_IMAGE022
6) context update module input present frame prospect state encoding
Figure 546965DEST_PATH_IMAGE016
, the initial background frame
Figure 871767DEST_PATH_IMAGE002
, preceding symmetrical frame
Figure 975989DEST_PATH_IMAGE008
With its prospect binary map
Figure 2010105775164100001DEST_PATH_IMAGE024
, present frame With its prospect binary map
Figure 804585DEST_PATH_IMAGE022
, output is background frames
Figure 413421DEST_PATH_IMAGE004
When the prospect state encoding
Figure 515807DEST_PATH_IMAGE016
Be to rebuild brand-new background frames at 11 o'clock
Figure 464172DEST_PATH_IMAGE004
When the prospect state encoding
Figure 432128DEST_PATH_IMAGE016
Be 00 or 10 o'clock, with present frame Remove the prospect binary map
Figure 911968DEST_PATH_IMAGE024
Back remaining area pixel replaces the initial background frame
Figure 980418DEST_PATH_IMAGE002
Respective pixel is by the prospect binary map
Figure 56958DEST_PATH_IMAGE022
The background area of blocking is the initial background frame
Figure 640386DEST_PATH_IMAGE002
The respective pixel value compensates the prospect binary map again
Figure 827785DEST_PATH_IMAGE022
Present frame
Figure 813059DEST_PATH_IMAGE006
Prospect edge pixel and corresponding preceding frame
Figure 60500DEST_PATH_IMAGE008
The average of margin of image element; When the prospect state encoding
Figure 68908DEST_PATH_IMAGE016
It is 02 o'clock, by preceding frame
Figure 122314DEST_PATH_IMAGE008
Remove the prospect binary map The present frame of back remaining area correspondence
Figure 377508DEST_PATH_IMAGE006
Pixel replaces the initial background frame
Figure 607632DEST_PATH_IMAGE002
Corresponding background pixel, the initial background frame
Figure 402412DEST_PATH_IMAGE008
Middle prospect binary map
Figure 96699DEST_PATH_IMAGE024
The background area of blocking is the initial background frame
Figure 685943DEST_PATH_IMAGE002
The respective pixel value compensates the prospect binary map again The preceding frame of prospect edge correspondence
Figure 64152DEST_PATH_IMAGE008
Pixel and corresponding present frame
Figure 550628DEST_PATH_IMAGE006
The average of margin of image element;
7) the shadow Detection module will contain the prospect binary map of shade
Figure 638670DEST_PATH_IMAGE022
Corresponding present frame
Figure 843386DEST_PATH_IMAGE006
Pixel value is got RGBThe value of color model B passage adopts 8 neighborhood territory pixels to make up the local grain zone, calculates the local grain construction operator
Figure 2010105775164100001DEST_PATH_IMAGE026
And compare two construction operators
Figure 655003DEST_PATH_IMAGE026
The Euclidean distance of value, if less than 0.11, then this pixel is the direct-shadow image vegetarian refreshments, otherwise is the foreground pixel point; The prospect binary map that will contain the direct-shadow image vegetarian refreshments again
Figure 323882DEST_PATH_IMAGE022
Corresponding present frame Pixel value Shade is differentiated the saturation degree of prospect shadow region in the hsv color space
Figure 2010105775164100001DEST_PATH_IMAGE030
The background area of not upgrading with correspondence
Figure 2010105775164100001DEST_PATH_IMAGE032
Difference less than 0.22 and the colourity of shadow region The background area of Geng Xining not
Figure 2010105775164100001DEST_PATH_IMAGE036
Difference then is judged as the direct-shadow image vegetarian refreshments less than 0.08, otherwise is the foreground pixel point;
8) computing machine by foreground extracting module with present frame
Figure 759991DEST_PATH_IMAGE006
Middle pixel value
Figure 700265DEST_PATH_IMAGE028
Be that 0 zone is left present frame
Figure 223650DEST_PATH_IMAGE006
Original pixel value, rest of pixels is shown as black background, and the foreground extraction that then will not contain shade is come out.
CN2010105775164A 2010-12-08 2010-12-08 Method for extracting foreground in piggery monitoring video Expired - Fee Related CN102024146B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010105775164A CN102024146B (en) 2010-12-08 2010-12-08 Method for extracting foreground in piggery monitoring video

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010105775164A CN102024146B (en) 2010-12-08 2010-12-08 Method for extracting foreground in piggery monitoring video

Publications (2)

Publication Number Publication Date
CN102024146A true CN102024146A (en) 2011-04-20
CN102024146B CN102024146B (en) 2012-11-07

Family

ID=43865427

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010105775164A Expired - Fee Related CN102024146B (en) 2010-12-08 2010-12-08 Method for extracting foreground in piggery monitoring video

Country Status (1)

Country Link
CN (1) CN102024146B (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289819A (en) * 2011-07-27 2011-12-21 中国电子科技集团公司第二十八研究所 Method for detecting infrared motion target in real time for background adaptive estimation
CN103617632A (en) * 2013-11-19 2014-03-05 浙江工业大学 Moving target detection method with adjacent frame difference method and Gaussian mixture models combined
CN103957423A (en) * 2014-05-14 2014-07-30 杭州古北电子科技有限公司 Video compression and reconstruction method based on computer vision
CN104252709A (en) * 2014-07-14 2014-12-31 江苏大学 Multiple-target foreground detection method for look-down group-housed pigs in look-down state under complicated background
CN105913425A (en) * 2016-04-08 2016-08-31 江苏大学 Self-adaptive oval blocking and wavelet transformation-based multi-pig contour extraction method
CN107230188A (en) * 2017-04-19 2017-10-03 湖北工业大学 A kind of method of video motion shadow removing
CN108171740A (en) * 2018-01-30 2018-06-15 彭景新 A kind of method and apparatus based on image analysis vehicle pass-through
CN108833974A (en) * 2018-06-29 2018-11-16 北京奇虎科技有限公司 Identify the method, apparatus and electronic equipment of the translucent watermark in video
CN109068099A (en) * 2018-09-05 2018-12-21 济南大学 Virtual electronic fence monitoring method and system based on video monitoring
CN110235802A (en) * 2019-07-08 2019-09-17 北京派克盛宏电子科技有限公司 A kind of live pig amount of exercise statistical method
CN111208521A (en) * 2020-01-14 2020-05-29 武汉理工大学 Multi-beam forward-looking sonar underwater obstacle robust detection method
CN112184773A (en) * 2020-09-30 2021-01-05 华中科技大学 Helmet wearing detection method and system based on deep learning
CN114943833A (en) * 2022-03-28 2022-08-26 台州学院 Bubble identification image processing method for bubble flow in gas-liquid reactor
CN115471502A (en) * 2022-11-01 2022-12-13 山东土之素生物技术有限公司 Animal manure rapid detection method based on computer vision

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101763513A (en) * 2010-02-26 2010-06-30 成都三泰电子实业股份有限公司 Foreground extraction method for removing light effect
CN101854467A (en) * 2010-05-24 2010-10-06 北京航空航天大学 Method for adaptively detecting and eliminating shadow in video segmentation

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101763513A (en) * 2010-02-26 2010-06-30 成都三泰电子实业股份有限公司 Foreground extraction method for removing light effect
CN101854467A (en) * 2010-05-24 2010-10-06 北京航空航天大学 Method for adaptively detecting and eliminating shadow in video segmentation

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《ACIVS 2009》 20091231 Sonsoles Herrero,et al. "Background Subtraction Techniques: Systematic Evaluation and Comparative Analysis" 33-42 1 第5807卷, *
《computers and electronics in agriculture》 20081231 Bin Shao, Hongwei Xin "A real-time computer vision assessment and control of thermal comfort for group-housed pigs" 15-21 1 第62卷, 第1期 *

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289819B (en) * 2011-07-27 2013-05-08 中国电子科技集团公司第二十八研究所 Method for detecting infrared motion target in real time for background adaptive estimation
CN102289819A (en) * 2011-07-27 2011-12-21 中国电子科技集团公司第二十八研究所 Method for detecting infrared motion target in real time for background adaptive estimation
CN103617632B (en) * 2013-11-19 2017-06-13 浙江工业大学 A kind of moving target detecting method of combination neighbor frame difference method and mixed Gauss model
CN103617632A (en) * 2013-11-19 2014-03-05 浙江工业大学 Moving target detection method with adjacent frame difference method and Gaussian mixture models combined
CN103957423A (en) * 2014-05-14 2014-07-30 杭州古北电子科技有限公司 Video compression and reconstruction method based on computer vision
CN104252709B (en) * 2014-07-14 2017-02-22 江苏大学 Multiple-target foreground detection method for look-down group-housed pigs in look-down state under complicated background
CN104252709A (en) * 2014-07-14 2014-12-31 江苏大学 Multiple-target foreground detection method for look-down group-housed pigs in look-down state under complicated background
CN105913425A (en) * 2016-04-08 2016-08-31 江苏大学 Self-adaptive oval blocking and wavelet transformation-based multi-pig contour extraction method
CN105913425B (en) * 2016-04-08 2019-02-05 江苏大学 A kind of more pig contour extraction methods based on adaptive oval piecemeal and wavelet transformation
CN107230188B (en) * 2017-04-19 2019-12-24 湖北工业大学 Method for eliminating video motion shadow
CN107230188A (en) * 2017-04-19 2017-10-03 湖北工业大学 A kind of method of video motion shadow removing
CN108171740A (en) * 2018-01-30 2018-06-15 彭景新 A kind of method and apparatus based on image analysis vehicle pass-through
CN108171740B (en) * 2018-01-30 2020-11-20 彭景新 Method and equipment for analyzing vehicle passing based on image
CN108833974A (en) * 2018-06-29 2018-11-16 北京奇虎科技有限公司 Identify the method, apparatus and electronic equipment of the translucent watermark in video
CN108833974B (en) * 2018-06-29 2021-05-18 北京奇虎科技有限公司 Method and device for removing semitransparent watermark in video and electronic equipment
CN109068099A (en) * 2018-09-05 2018-12-21 济南大学 Virtual electronic fence monitoring method and system based on video monitoring
CN109068099B (en) * 2018-09-05 2020-12-01 济南大学 Virtual electronic fence monitoring method and system based on video monitoring
CN110235802A (en) * 2019-07-08 2019-09-17 北京派克盛宏电子科技有限公司 A kind of live pig amount of exercise statistical method
CN111208521A (en) * 2020-01-14 2020-05-29 武汉理工大学 Multi-beam forward-looking sonar underwater obstacle robust detection method
CN112184773A (en) * 2020-09-30 2021-01-05 华中科技大学 Helmet wearing detection method and system based on deep learning
CN114943833A (en) * 2022-03-28 2022-08-26 台州学院 Bubble identification image processing method for bubble flow in gas-liquid reactor
CN115471502A (en) * 2022-11-01 2022-12-13 山东土之素生物技术有限公司 Animal manure rapid detection method based on computer vision

Also Published As

Publication number Publication date
CN102024146B (en) 2012-11-07

Similar Documents

Publication Publication Date Title
CN102024146B (en) Method for extracting foreground in piggery monitoring video
Bai et al. Crop segmentation from images by morphology modeling in the CIE L* a* b* color space
CN101447082B (en) Detection method of moving target on a real-time basis
CN105740945B (en) A kind of people counting method based on video analysis
CN104992447B (en) A kind of image automatic testing method of sewage motion microorganism
CN109685045B (en) Moving target video tracking method and system
CN102184552A (en) Moving target detecting method based on differential fusion and image edge information
CN105513053B (en) One kind is used for background modeling method in video analysis
CN101299268A (en) Semantic object dividing method suitable for low depth image
CN102842037A (en) Method for removing vehicle shadow based on multi-feature fusion
CN102332167A (en) Target detection method for vehicles and pedestrians in intelligent traffic monitoring
CN102208099A (en) Illumination-change-resistant crop color image segmentation method
CN105046677A (en) Enhancement processing method and apparatus for traffic video image
Keller et al. Soybean leaf coverage estimation with machine learning and thresholding algorithms for field phenotyping
CN101860664A (en) Moving target detection method robust to illumination variation
CN104239886A (en) Image analysis based lawn and background boundary extraction method
Huerta et al. Exploiting multiple cues in motion segmentation based on background subtraction
Naufal et al. Preprocessed mask RCNN for parking space detection in smart parking systems
CN1266656C (en) Intelligent alarming treatment method of video frequency monitoring system
Khan et al. Comparitive study of tree counting algorithms in dense and sparse vegetative regions
Kang et al. A multiobjective piglet image segmentation method based on an improved noninteractive GrabCut algorithm
Koniar et al. Machine vision application in animal trajectory tracking
CN105139358A (en) Video raindrop removing method and system based on combination of morphology and fuzzy C clustering
Xiang et al. Research on target detection method based on HSV fusion Gaussian mixture model
Wu et al. Nighttime cattle detection based on YOLOv4

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20121107

Termination date: 20131208