# Patent

## Title
Video analysis using segmentation gain by area

## Abstract

Video segmentation methods and systems are described wherein scene images of subjects and background are captured by video and are automatically segmented according to subject content, as by system determination of the nature of subjects. Segmentation transformations of an original background and foreground images in the scenes are provided as a terrain map. Automatic segmentation threshold adaptation is based on measuring the segmentation noise while holding the number count of noise blobs constant, whereby to achieve noise-adaptive segmentation gain. Automatic threshold adaptation within multiple areas of the scene results in different possible thresholds in different areas based on the amount of segmentation noise in each area. Segmentation is improved accordingly.

## Background
CROSS-REFERENCE TO RELATED APPLICATION
This application is a continuation of application Ser. No. 11/088,308, filed Mar. 24, 2005, which is being issued as U.S. Pat. No. 7,218,756 on May 15, 2007, entitled VIDEO ANALYSIS USING SEGMENTATION GAIN BY AREA, which claims the priority of U.S. provisional patent application No. 60/555,817, filed Mar. 24, 2004, entitled IMPROVEMENT IN VIDEO ANALYSIS USING SEGMENTATION GAIN BY AREA, both incorporated herein by reference.


BACKGROUND OF THE INVENTION
1. Field of the Invention
The invention relates to video monitoring and interpretation, as by software-aided methodology, and more particularly, to a system and method for improving the utility of video images in systems handling video, such as for system-interpreted analysis of video images for security purposes, and for many other purposes.
2. Description of the Known Art
There has been developed a system in accordance with U.S. patent application Ser. No. 09/773,475, filed Feb. 1, 2001, entitled SYSTEM FOR AUTOMATED SCREENING OF SECURITY CAMERAS, which was issued as U.S. Pat. No. 6,940,998, on Sep. 6, 2005, and corresponding International Patent Application PCT/US01/03639, of the same title, filed Feb. 5, 2001, both assigned to the same entity as the owner of the present application, and both herein incorporated by reference. That system, also called a security system, may be identified by the trademark PERCEPTRAK (“Perceptrak” herein). In the Perceptrak security system, video data is picked up by any of many possible video cameras. It is processed by software control of the system before human intervention for an interpretation of types of, images and activities of persons and objects in the images. As the video may be taken by video cameras in any of many possible locations and under conditions subject to variation beyond the control of the system, the captured video can include useless information such as visible “noise” which, upon segmentation of images together with such noise, interferes with usable information or detracts from or degrades video data useful to the system. More specifically, the Perceptrak system provides automatically screening of closed circuit television (CCTV) cameras (“video cameras”) for large and small scale security systems, as used for example in parking garages. The Perceptrak system includes six primary software elements, each of which performs a unique function within the operation of such system to provide intelligent camera selection for operators, resulting in a marked decrease of operator fatigue in a CCTV system. Real-time video analysis of video data is performed, where a single pass of a video frame produces a terrain map, which contains elements that are termed image primitives, which are low level features of the video. Based on the primitives of the terrain map, the system is able to make decisions about which camera an operator should view based on the presence and activity of vehicles and pedestrians and furthermore, discriminates vehicle traffic from pedestrian traffic. The system is compatible with existing CCTV (closed circuit television) systems and is comprised of modular elements to facilitate integration and upgrades.
The Perceptrak system is capable of automatically carrying out decisions about which video camera should be watched, and which to ignore, based on video content of each such camera, as by use of video motion detectors, in combination with other features of the presently inventive electronic subsystem, constituting a processor-controlled selection and control system (“PCS system”), which serves as a key part of the overall security system, for controlling selection of the CCTV cameras. The PCS system is implemented to enable automatic decisions to be made about which camera view should be displayed on a display monitor of the CCTV system, and thus watched by supervisory personnel, and which video camera views are ignored, all based on processor-implemented interpretation of the content of the video available from each of at least a group of video cameras within the CCTV system.
Included in the PCS system are video analysis techniques which allow the system to make decisions about which camera an operator should view based on the presence and activity of vehicles and pedestrians. Events are associated with both vehicles and pedestrians and include, but are not limited to, a single pedestrian, multiple pedestrians, a fast pedestrian, a fallen pedestrian, a lurking pedestrian, an erratic pedestrian, converging pedestrians, a single vehicle, multiple vehicles, fast vehicles, and a vehicle that stops suddenly.
The video analysis techniques of the Perceptrak system can discriminate vehicular traffic from pedestrian traffic by maintaining an adaptive background and segmenting (separating from the background) moving targets. Vehicles are distinguished from pedestrians based on multiple factors, including the characteristic movement of pedestrians compared with vehicles, i.e. pedestrians move their arms and legs when moving and vehicles maintain the same shape when moving. Other factors include the aspect ratio and object smoothness. For example, pedestrians are taller than vehicles and vehicles are smoother than pedestrians.
The analysis is performed on the terrain map primitives, in accordance with the disclosure of said U.S. patent no., to which reference should be had. Generally, Terrain Map is generated from a single pass of a video frame, resulting in characteristic information regarding the content of the video. Terrain Map creates a file with characteristic information.
The informational content of the video generated by Terrain Map is the basis for video analysis techniques of the Perceptrak system and results in the generation of several parameters for further video analysis. These parameters include at least:
(1) Average Altitude; (2) Degree of Slope; (3) Direction of Slope; (4) Horizontal Smoothness; (5) Vertical Smoothness; (6) Jaggyness; (7) Color Degree; and (8) Color Direction.
The PCS system of the Perceptrak system disclosed in said U.S. Pat. No. 6,940,998, comprises a number of primary software-driven system components, as shown therein, including those termed:

    (1) Analysis Worker(s);
    (2) Video Supervisor(s);
    (3) Video Worker(s);
    (4) Node Manager(s);
    (5) PsAdministrator (formerly called Set Rules GUI (Graphical User Interface); and
    (6) Arbitrator.


In the Perceptrak system, as here described generally, video input from security cameras is first sent to a Video Worker, which captures frames of video (frame grabber) and has various properties, methods, and events that facilitate communication with the Video Supervisor. There is one Video Supervisor for each frame grabber. The Analysis Workers perform video analysis on the video frames captured by the Video Worker and subsequently report activity to the Video Supervisor. Similarly, the Analysis Workers have various properties, methods, and events that facilitate communication with the Video Supervisor. The Video Supervisor keeps track of when frames are available from the Video Worker and when the Analysis Worker is prepared for another frame, and directs data flow accordingly. The Video Supervisor then sends data to the Node Manager, which in turn concentrates the communications from multiple Video Supervisors to the Arbitrator, thereby managing and decreasing the overall data flow to the Arbitrator.
The general term “software” is herein used and intended simply for convenience to mean programs, program instructions, code or pseudo code, process or instruction sets, source code and/or object code processing hardware, firmware, drivers and/or utilities, and/or other digital processing devices and means, as well as software per se.
Adaptive Segmentation Gain
Area-specific adaptive segmentation threshold is employed in areas of video to be segmented, in accordance with the invention. It is herein preferred to use the alternative terminology “adaptive segmentation gain”. Such adaptive segmentation gain is used to advantage in the Perceptrak system (sometimes hereinafter simply referred to as “the system”, as described in said patent application), and said system is here representative of possible systems which could employ the present invention for the present or comparable purposes). There, as just one exemplary technique which can be used, a PID control loop can be used at each Analysis Worker, and such a “PI loop” attempts to maintain a fixed amount of segmentation noise. Heretofore, in the Perceptrak system segmentation noise was measured screen wide for each video frame. An average of many frames was used to make segmentation gain changes. In scenes where there is an excessive amount of motion in a part of the screen, the prior approach caused the overall segmentation gain to be reduced screen wide in order to maintain the fixed amount of total noise in the scene. Sometimes the noise was seen only in a small part of the scene that had continual noise.
A difficulty has been realized in that segmentation gain can be very low in “quiet” (relatively noise-free) areas of the scene, but noise elsewhere in the image may have the result that subjects (such as people) within the image field are only partially segmented.
For example, in a scene to be captured by video, a tree (or other vegetation) may exist. Light streams through or is reflected off the foliage of the tree or vegetation in an indefinite pattern, which may shift upon limb or leaf motion resulting from air movement. Such shifting or sporadic light produces small areas of relative difference in light intensity, recognizable as, or considered to be, small bits of noise, over a period of time. As a result, the moving limbs of vegetation are segmented because they are different from the background. In simplest terms, there may be segmented “blobs” which are segmented because they contain noise, which now show in the illustrations as, e.g., rectangles, in the segmented portions of image. White spots in such a representative rectangle example signify “noise blobs” resulting from the segmentation, and the term “noise blobs” is used to connote herein the segmented areas resulting from noise, and thus noise blobs are tangible image artifacts of noise captured by segmentation of subjects in scenes. For example, FIG. 3 shows noise blobs appearing as white spots.
According to an example mode of operation, an area of 5 pixels by 5 pixels may be used as the cut-off, or minimum size, of a blob to be segmented.
The noise blobs can be counted. The count usefully indicates the extent to which noise blobs are being segmented and the count used to control the threshold (“gain”) of segmentation.
Heretofore, to get useful data, given the noise within a video frame (where video is captured frame by frame), it has been a practice to measure noise over an average of many frames. In the Perceptrak system, for example, the average can then be used to make overall segmentation gain changes. In other words, segmentation intensity levels (gain) can be continuously controlled over a group of 100 (for example) frames at a time. A difficulty exists in that changes in gain are controlled not only in response to objects in the captured video, which objects it is desired that the system segment, but also in response to light “noise.” Such visual noise degrades segmented images.
The term “PID” has been used to refer to a protocol typically employed for control loops, being a proportional integral derivative control algorithm often used in industrial and process control, as in single loop controllers, distributed control systems (DCS) and programmable logic controllers (PLC's) or programmable logic devices (PLD's). A PID control algorithm may comprise three elements, where the acronym PID derives from these terms:
Proportional—also known as gain
Integral—also known as automatic reset or simply reset
Derivative—also known as rate or pre-act
Such PID algorithm control may be employed in the segmentation of images in video processing.
Segmentation gain is controllable according to visual “noise”, as the term is used herein to connote image-degrading light or light changes (such as that produced by light shining through or reflected by foliage such as that of trees) or, as stated otherwise, to connote image-degrading light or light changes or extraneous or spurious light sources which degrade the capability of the system of using video to “segment” people or other preferred subjects in the scene, that is to discriminate or separate such subjects in the scene. The noise thus interferes with getting segmented images of subject people within the scene. Activities of subject people in a captured video scene (e.g., as running, walking, loitering, aggregating in groups, or falling down) are desired to be monitored by the Perceptrak system for security purposes. So also, as a further example without limiting the possibilities of subjects which can be segmented for the present purposes, it may be desired that activities of moving vehicles be monitored.
Heretofore, approaches have been taken to determine motion of subjects within video fields, typically by pixel analysis. For example, it has been proposed to detect motion from differences between recent scenes using a so-called reference frame, or by background statistics, or by taking into consideration adjacent frames. In such technological approaches, only motion detection is typically possible. In such a prior technological approach, if a subject person stops moving in the scene of any motion detection, the person will no longer be segmented. The technique of object segmentation in accordance with the present application makes use of an adaptive background of some sort. With such an adaptive background, an object can remain motionless for an indefinite time and yet can be segmented.
Approaches of the prior art typically have made use of a fixed segmentation threshold for an entire scene. The above-identified Perceptrak system disclosed varying segmentation gain for an entire scene based on segmentation noise in the scene. This is referred to as adaptive segmentation gains when applied to an entire scene. It has been elsewhere proposed to adjust segmentation gain for different groups of pixels but such adjustment has heretofore been pixel-based and so also based upon intensity only.
Such problems and video analysis limitations are intended to be overcome by the presently inventive system approach and methodology.
SUMMARY OF THE INVENTION
Among the several objects, features and advantages of the invention may be noted the provision of a system and methodology for video analysis of video images, as in systems for handling video, and for use in system-interpreted analysis of video images; which improves segmentation of mixed objects in video fields; which allows accommodation for visual or light-induced noise entering a field; which allows multiple values of segmentation gain in different areas of the scene so as to improve acuity in certain areas; which selectively varies video gain within regions; which adjusts for such noise over a period; which varies gain within regions or portions according to more or less, so that regions having less noise will have higher gain; which divides a video scene into a grid of many regions, on an area basis, without regard to individual pixels; which allows for rapid and long-term calculation of PID determination by software-driven processor over each of many regions; which permits an independent gain setting for each of the many regions; which captures and tracks noise data in video of scenes, as to hold data about noise in grid portions, so that in effect to map such noise, and so that the system thus remembers where such noise is occurring; which brings about improved system visual acuity in video security systems, and in particular, in the Perceptrak system, such that the system is given capability to capture video data in scenes much more accurately and usefully; which greatly aids the capturing and analysis of video data to be software interpreted for security purposes according to objects or subjects in the video captured and according to respective activities of the objects or subjects, such as people in the scene and what they are doing, e.g., running, walking, aggregating, loitering, entering vehicles, and many other activities; which greatly improves discrimination of subjects as between different types of subjects, such as cars and people, and enhances their system-realized characterization such as by determining their directions of movement; which in general gives a video security and/or screening system the potentiality to “see better.”
Among still other objects, features and advantages are the provision of a system which does not require pixel comparison; which provides object detection with adaptive background rather than reference frames; which makes use of segmentation gain (threshold) varied over time in response to segmentation noise; and in which segmentation gain is varied by individual areas adaptively to compensate for varying conditions in a video scene over time.
Briefly, in a video system, such as the above-identified Perceptrak system, or another system employing video cameras, video data of scenes viewed by a video camera is analyzed for the purpose of interpretation of subjects within camera views by segmenting (separating) the subjects or objects from background of the scenes. Such analysis involves determining and controlling segmentation gain by areas of an image frame to obtain multiple values of segmentation gain in different areas of the scene. Areas found to have greater noise over a time interval are given lower gain. Areas of lesser noise are given higher gain. According to the inventive improvement, a video scene under analysis is divided into a grid having a predetermined number of areas. A single rate-of change is not determined over an entire video scene, but rather PID is calculated by software-driven processing over each of the of predetermined number of areas. The output of PID determination is changed over a preselected time interval within each of the multiple areas, dependent upon the visual noise of each area, to permit independent gain setting for each of the many areas, where the gain setting for each area is determined relative to a base segmentation gain, calculated as described herein.
In a first general aspect, the present application is related to video segmentation wherein scene images of subjects and background are captured by video and are automatically segmented according to subject content, as by system determination of the nature of subjects, but segmentation of the subjects can be compromised by visual noise. Segmentation transformations of an original background and foreground images in the scenes are provided as a terrain map, and the segmentation may also incorporate noise blobs in the image primitives. Automatic segmentation threshold adaptation is based on measuring the segmentation noise while holding the number of noise blobs constant, whereby to achieve noise-adaptive segmentation gain. Automatic threshold adaptation within multiple areas of the scene results in different thresholds in different areas based on the amount of segmentation noise in each area.
In a second general aspect, segmentation may be carried out by multiple passes. For example, a system can perform a two-pass segmentation procedure, wherein the second pass of segmentation is performed only within those parts of a target subject of interest segmented in the first pass, providing the advantageous effect of filling gaps in the target that may have been left in the first pass.
The result of the operation of these improvements is increased system visual acuity in areas of low noise, and hence the system is given capability to capture video data in scenes much more accurately and usefully, providing improvement when the video data is used in the Perceptrak system, where data is to be software-interpreted for security purposes according to what are subjects in the video captured and what are their activities, such as people in the scene and what they are doing, e.g., running, walking, aggregating, loitering, entering vehicles, and many other activities. So also, even subtle variations, such as limping or other non-typical gait, can be detected as will aid in identification of a human subject within protected premises. Discrimination between subjects, e.g., as between different types of subjects such as cars and people and their directions of movement, is enhanced.
Further embodiments, features, and advantages of the present invention, as well as the structure and operation of the various embodiments of the present invention, are described in detail below with reference to the accompanying drawings.



BRIEF DESCRIPTION OF THE DRAWINGS
The accompanying drawings, which are incorporated herein and form a part of the specification, illustrate the present invention and, together with the description, further serve to explain the principles of the invention and to enable a person skilled in the pertinent art to make and use the invention.
FIG. 1 is a video test frame in which there are segmented images of people, including a person at the bottom in the screen who is for test purposes a desired target.
FIG. 2 is a background frame that is compared to the test frame of FIG. 1.
FIG. 3 is the result of subtracting the test frame from the background frame and highlighting all pixels where the difference is more than a predetermined number of pixels.
FIG. 4 illustrates the effect of segmentation threshold at different predetermined segmentation intensity values.
FIG. 5 is a chart plotting the relationship between noise blobs and segmentation threshold intensity as derived from tests.
FIG. 6 is a terrain mapping comparison with a grouping of video targets which show an extent to which sensitivity of target segmentation is relative to segmentation threshold.
FIG. 7 is a video image field wherein targets are segmented, showing how excessive noise and false targets also are segmented, and improvement is gained by multiple-pass segmentation.
FIG. 8 is similarly a video image field grouped with a video segment in which a tree in the foreground of the image field is recognizable from bits of noise highlighted in the segment wherein white spots in the black rectangle represent noise blobs from segmentation.
FIG. 9 is a comparable video image field, grouped with a video segment, to show that noise is reduced by video segmentation by area in accordance with the invention.
FIG. 10 is a video scene in bright sunlit conditions, including windblown tree presence, illustrating the effect of segmentation gain by area by comparing the application of a constant gain threshold to the entire scene (upper right background) compared to a scene portion at the lower right in which the video of the scene has gain adapted by plural rows and columns.
FIG. 11 shows the gain adjustments as calculated for the scene of FIG. 10 in accordance with the invention, with graphic representation of the gain adjustment by. area.



Corresponding characters may indicate corresponding elements in views of the drawings. The present invention will be described with reference to the accompanying drawings.
DESCRIPTION OF PRACTICAL EMBODIMENTS
General Introduction
The present invention may be used in many possible systems and schemes for video handling and image segmentation. It can be used for improving the utility of video images in various kinds of systems handling video, such as for system-interpreted analysis of video images for security purposes, and for many other purposes. As one example, in the above-identified Perceptrak system, a video security system, video scenes can be captured and then segmented according to the presence of objects or subjects of interest, such as persons or vehicles. This takes place in the above-identified Perceptrak system, or another system employing video cameras.
In such systems video data of scenes viewed by a video camera are analyzed for the purpose of interpretation of the subjects within camera views. Analysis of subjects involves determining and controlling segmentation gain by areas of an image frame to obtain specific analysis information. The system allows multiple values of segmentation gain in different areas of the scene. Areas found to have more noise, over a predetermined period of time, will have lower gain; but areas with less noise will have higher gain. Where scenes have visually noisy sections (such as the frequent motion of vegetation) this change will result in lesser visual acuity in areas of high activity but advantageously results in higher visual acuity in “quiet” areas.
The inventive improvement divides the scene into a grid of a predetermined number of sections, such as 48 sections (areas), for example. Rather than determining a single rate-of-change over an entire video scene, the PID function is calculated by software-driven processor over each of the of many (e.g., 48) sections. The output of PID determination changes slowly (e.g., over 2 minutes) within each of the many areas dependent upon the noise of each section. This permits an independent gain setting for each of the many sections, where the gain setting for each section is determined relative to a base segmentation gain, which is calculated in the section entitled Calculation of Base Segmentation Gain.
The noise levels by area numbers are preferably checked for every background update, while it is found sufficient if backgrounds in a security scene processed by the Perceptrak system are checked substantially less frequently, such as preferably about every 20 seconds or so, but not preferably as frequently as every 10 seconds. Similarly, to check background noise level as infrequently as every 10 minutes is believed probably to be too slow. It is thought that if background updates are too far apart then adaptive background will no longer match live scene background, leading to or making excessive segmentation noise. By comparison, if updates are too frequent then segmentation noise is low, but processing cycles are wasted, and video recordation files (even those prepared by the previously disclosed system of objective selective recording) may become too large. Preferably, for present purposes, the Perceptrak system is configured to adapt the update period as a function of segmentation noise build up between updates. If there is no more segmentation noise at the end of the period than at the beginning, then we're updating too fast. As an example, if there is 20% more segmentation noise at the end of the update period than at its beginning, then the update period may be considered to be too long. Between 10% and 20% build up of segmentation noise between updates is a preferred range. That is, the update interval will be determined by maintaining segmentation noise build-up in the range from about 10% to about 20% between updates and preferably not more than 20%.
It is further suggested that there should not be more than a maximum of about 200 consecutive frames between updates, while generally about 100 frames may be preferred, although it will be recognized that the maximum is subject to instant revision according to prevent noise build-up from being too great.
Key Aspects
Images captured by video are segmented according to subject content, as by determining the nature of subjects, e.g., a person or persons or moving vehicle, involving interpretation of the subjects within camera views. Further principal aspects are software implemented in the present system invention, as according to the present description, to improve segmentation beyond background subtraction comprise:
1. Use of a multi-variable segmentation technique based on image primitives of a terrain map that are transformations of the original background and foreground images. (Referred to as “terrain map segmentation”.)
2. Automatic threshold adaptation based on measuring the segmentation noise and holding the number of noise blobs constant. (Referred to as “adaptive gain”.)
3. Two-pass segmentation where the second pass takes place only inside the outlines of targets segmented on the first pass, and using a lower threshold than the first pass. (Referred to as “gap filling”.)
4. Automatic threshold adaptation within multiple areas of the scene resulting in different thresholds in different areas based on the amount of segmentation noise in each area. (Referred to as “segmentation gain by area”.)
Description with Reference to Illustrations
Referring to the drawings, FIG. 1 shows a video test frame. The video in this frame is captured within a parking garage. The captured scene includes vehicles and segmented images of three people, including a person at the bottom in the screen who is for test purposes a desired target. The two persons, subjects for this purpose, closest to the camera are walking generally away from the camera. A third person is distant from the camera and is walking toward the camera.
In FIG. 2, by comparison, there is shown a background frame which is compared to the test frame of FIG. 1.
FIG. 3 shows the result of subtracting the test frame (FIG. 1) from the background frame (FIG. 2) and highlighting all pixels where the difference is more than six pixels. Contiguous segmented pixels are colored if the blob is more than five pixels high and wide. White blobs are considered noise blobs. Coloring may occur in practical use, but the present black-and-white drawings leave to the reader to infer coloring from the present description. Pixels representing the closest subject may have the color green, for example, and those representing the next closest subject purple, for example, while pixels of the subject person here shown farthest from the camera may be colored red, for example.
Segmentation of actual targets and noise is sensitive to the threshold. FIG. 4 illustrates the effect of the threshold at representative values 6, 12, and 16. At a threshold of 6 there is undesirable segmentation of shadows around the feet of the human subjects, and at a value of 16 the person at the bottom of the scene is segmented is several parts. As FIG. 4 shows, when the threshold what is considered for these purposes to be too high (16), the targets are not fully segmented and there are few noise blobs. Color shifts occur also. Thus, while not well visualized in the present black-and-white images, a true color segmentation will demonstrate that a threshold value of 16 causes the closest person segmentation to be a mix of three colors, so that full segmentation has not been achieved. When the threshold is set at what is too low for these purposes, at a value of 6, shadows at the feet of the people also are objectionably segmented. So also, at too low a threshold, many objectionable noise blobs appear in the segmentation, and show as “hash” or snow-like pixel regions near the segmented subjects.
An ideal segmentation threshold varies from scene to scene, and for any given camera, from minute to minute due to lighting changes.
The inventive system adapts to cameras, but also to changes in the scene, to maintain an ideal segmentation threshold. The system methodology of the invention treats the number of noise blobs as a meaningful measurement of the efficacy of the current segmentation threshold, and further, it adjusts the segmentation threshold to hold the number of noise blobs substantially constant.
FIG. 5 is a chart plotting the relationship between noise blobs and segmentation threshold intensity as derived from tests. The chart of FIG. 5 is derived from tests conducted in the preparation of this document and shows that there is a consistent and predictable relationship between segmentation threshold and the resulting number of noise blobs.
In FIG. 6 a terrain mapping comparison provides a grouping of video targets which show an extent to which sensitivity of target segmentation is relative to segmentation threshold. An upper set of three images is provided with background subtraction. A lower set of the same three images shows terrain map comparison. It will appear that a threshold of 6 is too low, causing excessive segmentation of shadow around the feet of the target, but a threshold of 16 is too high, as the head and part of one leg of the target fail to segment.
FIG. 7 is a video image field showing two pairs of panels wherein targets are segmented, showing how excessive noise and false targets also are segmented, and improvement is gained by multiple-pass segmentation, first with a threshold of 6 and then with a threshold of 12.
Even with the improved segmentation from Terrain Map comparison, no single threshold provides both full and complete segmentation of targets without excessive noise and false target segmentation that interferes with background maintenance. Any single threshold is either too low or too high.
As shown in FIG. 7, using a threshold of 6 (upper left) segments the lower subject target fully, but has excessive noise and false targets segmented. Using a threshold of 12 (upper right) provides a clean background but leaves gaps in the target. One aspect of this invention is the use of two-pass segmentation. The Target at the lower left of FIG. 7 has been segmented using a threshold of 12 with Terrain Map comparison. The target on the lower right of FIG. 7 is the result of a second pass confined to the area between the leftmost segmented pixels and the rightmost segmented pixels of the target using a threshold of one half (6) of the base threshold. The second pass fills in most of the gaps inside the target without affecting the noise in the background.
FIG. 8 is similarly a video image field grouped with a video segment in which a tree in the foreground of the image field is recognizable from bits of noise highlighted in the segment wherein white spots in the black rectangle represent noise blobs from segmentation.
FIG. 9 is a comparable video image field, grouped with a video segment, to show that noise is reduced by video segmentation by area in accordance with the invention.
FIG. 10 illustrates the effect of segmentation gain by area by comparing the application of a constant gain threshold to the entire scene as compared with gain adapted by 48 areas. The video scene is taken in bright sunlit conditions, including rows of windblown tree between which are visually-quiet parking lot areas. Applying a constant threshold to the entire scene (upper right background) causes excessive noise and segmentation of moving tree limbs or loss of segmentation of real targets in the parking aisles. In the scene portion example at the lower right the scene has the gain adapted by 8 rows and 6 columns. The gain around the trees is lowered to require a real target in those areas to cause segmentation, yet in the aisles the gain is high enough to fully segment targets.
FIG. 11 shows the gain adjustments as calculated in accordance with the invention for the scene of FIG. 10, with graphic representation of tabular values of the gain adjustment by area.
Terrain Map Segmentation
As will be evident from the above, FIGS. 3 through 6 illustrate the effect of the threshold on segmentation using background subtraction only, as compared with segmentation gain by area herein described. Terrain map segmentation will accordingly be considered.
The present adaptive segmentation method permits the use of multiple variables to perform segmentation. As examples of multiple variables and their use in a security system, reference may be had to above-identified U.S. Pat. No. 6,940,998, and corresponding International Patent Application PCT/US01/03639, filed Feb. 5, 2001.
To achieve multi-variable segmentation for the present purposes, all video-derived images are transformed to a set of primitives (a “terrain map”) and the segmentation performed based on the primitives. This approach uses, for example, up to eight elements of the terrain map while six would suffice for mono (i.e., gray scale video as 8 bits per pixel) to compare the map of an adaptive background to the current video frame. Each element of the terrain map is assigned a different weight (referred to as gain) in the comparison. Segmentation is based then on the comparison of all map elements with the result adjusted for the element individual weights.
For example, the elements and weights used for mono are:















ALTITUDE WEIGHT = 10



DEGREE OF SLOPE WEIGHT = 8



DIRECTION OF SLOPE WEIGHT = 1



HORIZ SMOOTHNESS WEIGHT = 6



VERT SMOOTHNESS WEIGHT = 6



JAGGYNESS WEIGHT = 3










As illustrated in the lower row of images of FIG. 6, segmentation by terrain map comparison is not as sensitive to changes in threshold as background subtraction. Also due to the use of other variables less shadow is segmented from the same scene with terrain map comparison.
EXAMPLE 1
It is found in practice that the segmentation gain loop has been very stable with a single setting for the entire video scene. By comparison, at attempt to set segmentation gain for every pixel would certainly be unstable. Therefore, to maintain stability, and yet have the benefit of segmentation gain by area as herein described, the number of settings could be purposely limited to a predetermined number of value (such as 4, for example for illustrative purposes only). Further, the minimum area of the screen to have an independent gain setting will be limited to 1/64th of the screen, as an example for illustrative purposes. FIG. 2 illustrates the effect of an eight by eight grid of a scene to be analyzed as according to the Perceptrak system. Calculations will be generic to allow tuning the grid resolution. As according to that disclosure, to enable generic calculations, the number of grids will be determined by global variables SegGridsHigh and SegGridsWide. For this example both SegGridsHigh and SegGridsWide is set to 8 for initial testing.
For calculation of base segmentation gain, both SigValueDif and SigFeatureDif are revised to use only the noise blobs in the segmentation grids that are entirely inside the active area of the mask. The SigBalDif values continue to be calculated by a PI algorithm based on the total noise blobs, but SegGrids outside of the active mask are not counted. The intent is to adjust segmentation up or down from the base value by grid to hold the total noise from segmentation constant.
To compensate for a smaller active mask area and keep the meaning of NoiseBlobs the same for all cameras, AverageNoise blobs will be adjusted upward by the number of inactive Segmentation Grids:

AverageNoiseBlobs=AverageNoiseBlobs*(Total SegGrids/ActiveSegGrids)

Reference may be had to other examples setting forth representative lines of code of Visual Basic useful in implementing the present methodology and system configuration.
EXAMPLE 2
This example illustrates the presently disclosed method of tracking noise by location. Reference again may be had to other examples setting forth representative lines of code of Visual Basic useful in implementing the present methodology and system configuration.
A new UDT (in the context of Visual Basic a “User Defined Type” is defined to hold data about noise in grids, (NoiseBySegGridType), with three longs (i.e., a 32 bit integer), thus:













InActiveMask
//set to 1 at start up if in the active area of the



mask


NoiseBlobThisPeriod
//Cum. NoiseBlobs since last



CalcSegmentationValues


NoiseBlobsLastPeriod
//NoiseBlobs used in last



CalcSegmentationValues









The NoiseBlobsLastPeriod element is reserved for the part of a PID loop. A new global UDT (NoiseBySegGrid) is allocated and used to accumulate the number of noise blobs for each map element. NoiseBySegGrid is allocated as SegGridsHigh*SegGridsWide. In the LabelBlobs function where Noise Blobs in incremented, the element of NoiseBySegGrid at the location of the noise blob will be incremented.
At the time of background maintenance after new segmentation gains are calculated, NoiseBlobsThisPeriod will be copied to the NoiseBlobsLastPeriod elements, and NoiseBlobsThisPeriod elements will be reset to all zeroes.
At the line with (*Noiseblobs)++, Variable ‘i’ is lower row of the blob and variable ‘j’ is leftmost column of the blob.
So add:















SegGridRow = i/SegGridsHigh;



SegGridCol = j/SegGridsWide;



SegOffset = (SegGridRow * SegGridsWide) + SegGridCol;



*(NoiseBySegGrid + SegOffset) → NoiseBlobsThisPeriod++;










This marks the NoiseBySegGrid.NoiseBlobsThisPeriod as having a noise blob for this frame.

Each element InActiveMask will be set to 1 during start up chores and every time the mask is updated if its four corner pixels are in the, active mask. This is not a comprehensive calculation but runs at fast speed.
EXAMPLE 3
The example typifies calculation of gain adjustment. Reference may be had again to other examples setting forth representative lines of code of Visual Basic useful in implementing the present methodology and system configuration.
Gain adjustment by area is based on a gain figure for DeltaSegmentation per DeltalNoise. The variable is named “DeltaSegGain” and the default value is to be set by test. A DeltaSegGain of 0.5 indicates an adjustment of one for each two noise blobs difference between the area under consideration and the screen average, where:

GainAdjustment=DeltaSegGain*(GridNoise−AverageScreenNoise)

and where:

a higher GainAdjustment means a lower gain for the Grid;

and where:

AverageScreenNoise is adjusted for comparison with GridNoise.

For an example with 64 grids, the total number of noise blobs in the 1/64th grid is to be compared to the total number of noise blobs in the scene divided by 64.
For each background maintenance operation, a PI loop of each Analysis Worker of the Perceptrak system adjusts the value of DeltaSegGain to drive the DeltalNoise across all areas to zero in this way:

    1. Sum the number of noise blobs from the 8×8 grid. Transfer values to the sum only where the InActiveMask element equals 1.
    2. Calculate the average noise for each grid element.
    3. Calculate the weighted noise blobs per area.
    4. Calculate the Gain Adjustment for each grid.
    5. Set the GainAdjust for each TerrainMap element of the background map.


For gain adjustment during segmentation, a new element, GainAdjust, can be added to the Terrain Map declaration. The GainAdjust element (of the background terrain map) will be filled out during each background maintenance operation and used to modify both SigValueDif and SigFeatureDif in the Compare TerrainMap XXX functions.
Those skilled in the art may of course recognize that the foregoing will require some changes to the compare terrain map functions since the segmentation gain has to be checked every map element, but with the expectation that calculation will run fast with the new gain adjustment in the same background map element to be compared.
EXAMPLE 4
The example sets forth sample code for the gain adjustment calculation. The following code fragment is derived from the software program used to develop the images of the Figures. The code is included here as an example of a software implementation of adaptive segmentation gain by area. The variable names are self-explanatory.












NormFullScreenAvgFactor = TotalSegGrids / SamplesForNoiseByGridInPeriod


GridsCounter = −1









For GridRowCounter = Lng0 To SegGridsHigh − 1



For GridColCounter = Lng0 To SegGridsWide − 1



GridsCounter = GridsCounter + 1



NormalizedGridNoise=



NormFullScreenAvgFactor*NoiseByGrid(GridsCounter).NoiseBlobsThisPeriod



ThisGridGain = DeltaSegGain * (NormalizedGridNoise − NoiseBlobsSetPoint)







′ frame and grid based









ThisGridGain = Max (ThisGridGain, LngMinus2)



ThisGridGain = Min(ThisGridGain, Lng2)



GainAdjustment(GridsCounter) =GainAdjustment(GridsCounter)+ ThisGridGain



MaxAdjustment = Lng40



MinAdjustment = LngMinus20



GainAdjustment(GridsCounter)=



Max(MinAdjustment, GainAdjustment(GridsCounter))



GainAdjustment(GridsCounter)=



Min(MaxAdjustment, GainAdjustment(GridsCounter))







Next GridColCounter


Next GridRowCounter









EXAMPLE 5
The example illustrates an example procedure by which segmentation gain is carried out by multiple passes, such as a two-pass segmentation procedure by which the second pass of segmentation is performed only within those parts of the target that already were segmented in the first pass. This provides the highly advantageous effect of filling gaps in the target that may have been left in the first pass. In this example, sample code is provided for a function Pass2Segmentation, being an example of preferred code with exception handling removed for clarity. The input TerrainMap is an array of structures with the results of the first pass segmentation. TargetROI defines the bounding rectangle that holds the input target TargetNumber. Each element of the Terrain map includes the absolute value of the difference between the background and test frame found in the first pass of segmentation. The second pass of segmentation will only be performed within the target parts segmented in a first pass.










Illustrative code:
















long WINAPI Pass2Segmentation(RECT TargetRO1,
// RECT structure with









bounding rectangle of the



target










 long TargetNumber,
// Number of the target to be









segmented on this pass










TerrainMap * MapWithTarget,
// The terrain map









with the target and



Intensity difference









long Pass2Threshold) // The threshold to use this









second pass







{








long TargetLeft,TargetRight,TargetTop, TargetBottom;
// The sides of the bounding









rectangle of the target








long RightMostSegmented, LeftMostSegmented;
//The right most and leftmost









segmented elements in each row








long TargetRow, TargetCol;
 // Row and column being worked on,









 relative to the terrain map.








long NumberOfElementsSegmented;
// return the number of map elements that are









 segmented on this pass









TargetLeft = TargetROI.left;



TargetRight = TargetROI.right;



TargetTop = TargetROI.top;



TargetBottom = TargetROI.bottom;










NumberOfElementsSegmented = 0;
// initial set, increment on each









segmented map element









for (TargetRow = TargetBottom; TargetRow =< TargetTop; ++TargetRow)










{
 // find the left most segmented element in









 this row









for (TargetCol = TargetLeft; TargetCol =< TargetRight; ++TargetCol)



{



if (MapWithTarget[TargetRow][TargetCol].TargetNumber = TargetNumber)









// then this is the left most element in this row









{










LeftMostSegmented = TargetCol;
// mark it down










break;
//stop looking in this row



}










}
// find the right most segmented element in this row









for(TargetCol = TargetRight; TargetCol => TargetLeft; −−TargetCol



{



if (MapWithTarget[TargetRow][TargetCoi].TargetNumber = TargetNumber)









// then this is the left most element in this row









{










RightMostSegmented = TargetCol;
// mark it down










break;
//stop looking in this row



}



}









for (TargetCol = LeftMostSegmented; TargetCol =< RightMostSegmented;



++TargetCol)



{









// use Pass2Threshoid within the bounds of the



target on this row









if((MapWithTarget[TargetRow][TargetCol].TargetNumber!=TargetNumber)









//this element has not been segmented









&&(ApWithTarget[TargetRow[TargetCol].AltDiff>=Pass2Threshold))









//and its more diff from background









{



MapWithTarget[TargetRow][TargetCol].TargetNumber=TargetNumber



}









//end of element was not segmented on the first pass



but it segmented here










}
//end of TargetCol=LeftMostSegmented to









RightMostSegmented










}
//end of for bottom row to top row










return(NumberOfElementsSegmented);
// this return value increases as









function fills more gaps in target.







}/*XXXXXXXXXXXX end of the Pass2Segmentation function


XXXXXXXXXXXXXXXXXXXXXXXXXXXX*/









The return value is the number of map elements that were segmented in the second pass.

As various modifications could be made in the systems and methods herein described and illustrated without departing from the scope of the invention, it is intended that all matter contained in the foregoing description or shown in the accompanying drawings shall be interpreted as illustrative rather than limiting. Thus, the breadth and scope of the present invention should not be limited by any of the above-described exemplary embodiments, but should be defined only in accordance with the following claims appended hereto and their equivalents.

## Claims

1. In a system for capturing video of scenes, a processor-controlled segmentation system for providing software-implemented segmentation of subjects of interest in the scenes based on processor-implemented interpretation of content in a captured video, the segmentation system comprising:
an analysis worker module that determines and controls segmentation gain by areas of an image frame to obtain multiple values of segmentation gain in different areas of a scene according to a respective visual noise level in said areas,
wherein scenes are divided into a predetermined number of areas, and wherein the analysis worker module calculates proportional integral derivative over each of the predetermined number of areas according to the visual noise level in each area, to permit independent gain setting for each of the areas, where the gain setting for each area is determined relative to a base segmentation gain.

2. The segmentation system of claim 1, wherein a segmentation threshold corresponding to a gain setting is automatically based on measurement of segmentation noise, wherein segmentation noise is determined by measuring a number of noise blobs for segmented subjects of interest, and the system maintains the number of noise blobs constant.

3. The segmentation system of claim 1, wherein the visual noise level in each of the areas is periodically checked at an interval for subject segmentation, and a background noise level is checked substantially less frequently.

4. The segmentation system of claim 3, wherein a rate of determination of visual noise level is updated at an update interval which is a function of segmentation noise build-up between updates.

5. In a system for capturing video of scenes, a processor-controlled segmentation system for providing software-implemented segmentation of subjects of interest in the scenes based on processor-implemented interpretation of the content of the captured video, the segmentation system comprising:
an analysis worker module that determines and controls segmentation gain by areas of an image frame to obtain multiple values of segmentation gain in different areas of a scene according to a respective visual noise level in the areas,
the analysis worker module further controlling video gain in respective ones of the areas wherein subjects in scenes are segmented according to a segmentation threshold based upon visual noise in segmentation of the subjects, the threshold being automatically based on measurement of the segmentation noise,
wherein the noise level in each of the areas is periodically checked at an interval for subject segmentation, and a background noise level is checked substantially less frequently, and
wherein a rate of determination of visual noise levels is updated at an update interval determined by maintaining segmentation noise build-up in the range from about 10% to about 20%, and preferably not more than 20%, between updates.

6. A system for automatic segmentation of subjects of interest in scenes captured by a video according to a nature of the subject, scenes having a background and subjects of interest appearing in the foreground, and segmentation transformation of the background and foreground images in scenes being provided as a terrain map, the system comprising:
an analysis worker module that employs automatic segmentation threshold adaptation based on measuring segmentation noise while holding a number count of noise blobs substantially constant, wherein segmentation noise is produced by noise blobs representing visual noise, thereby achieving adaptive segmentation gain,
the analysis worker module further using automatic threshold adaptation within multiple areas of a scene resulting in different possible thresholds in different areas based on the amount of segmentation noise in each area.

7. The system of claim 6, wherein the segmentation is carried out by a two-pass sequence wherein the second pass takes place only inside the outlines of a segmented subject of interest that is segmented on the first pass, and wherein the second pass uses a lower threshold than the first pass.

8. The system of claim 6, wherein the segmentation employs a multi-variable segmentation technique based on image primitives of a terrain map that are transformations of the original background and foreground images in scenes.

9. A software-driven video processing method of automatically segmenting subjects within a video scene, wherein the video scene for segmentation is divided into a predetermined number of areas, the method comprising:
determining and controlling segmentation gain by areas of an image frame to obtain possible multiple values of segmentation gain in each of the predetermined number of areas of the scene according to a visual noise level in the respective area,
wherein scene areas having a lesser visual noise level are given higher segmentation gain, and
wherein segmentation gain is determined by proportional integral derivative control algorithm to provide an automatic independent gain setting for each of the predetermined number of areas, where the gain setting for each segment is determined relative to a base segmentation gain, and wherein a single rate-of-change is not determined over an entire video scene.

10. A software-driven video processing method of automatically segmenting subjects within a video scene, wherein the video scene for segmentation is divided into a predetermined number of areas, the method comprising:
determining and controlling segmentation gain by areas of an image frame to obtain possible multiple values of segmentation gain in each of the predetermined number of areas of the scene according to a visual noise level in the respective area,
wherein image segmentation is carried out by a two-pass sequence where the second pass takes place only inside the outlines of a segmented subject of interest that is segmented on the first pass, and
wherein the second pass uses a lower threshold than the first pass.

11. A method for providing software-implemented segmentation of subjects of interest in captured video scenes, comprising:
dividing a scene into a plurality of areas;
applying an independent segmentation gain value to each of the plurality of areas, wherein for each area the applied segmentation gain value is calculated relative to a background gain value, based on the visual noise level in that area over a predetermined time interval;
periodically updating each respective independent segmentation gain value applied to each of the plurality of areas to adapt to a change in visual noise level in that area, and to a change in the background gain value.

12. The method of claim 11, wherein areas with lower visual noise level are provided with a higher segmentation gain than areas with higher visual noise level.

13. The method of claim 11, wherein segmentation gain values are calculated using a proportional integral derivative algorithm.

14. The method of claim 11, wherein a number of noise blobs representing visual noise is kept constant while calculating an applicable segmentation gain value for a particular area.

15. A method for video segmentation, comprising:
dividing a video scene, the divided video scene including a plurality of areas,
calculating a proportional integral derivative over each of the plurality of areas according to the noise in each area;
setting, for each of the plurality of areas, a segmentation gain relative to a base segmentation gain; and
segmenting each of the plurality of areas using the corresponding segmentation gain.

16. The method of claim 15, wherein the dividing includes dividing the video scene into a grid, the plurality of areas being defined by the grid.

17. The method of claim 15, wherein the setting includes setting the segmentation gain for each of the plurality of areas to yield a number of noise blobs that is the same for each of the plurality of areas.

18. The method of claim 15, further comprising:
updating a segmentation noise level at an update interval by periodically checking the number of noise blobs, and
periodically checking a background noise level, wherein the checking the background noise level is less frequent than the checking the number of noise blobs.

19. The method of claim 18, further comprising:
adjusting the update interval based on change in segmentation noise level between updates.

20. A method for video segmentation, comprising:
dividing a video scene, the divided video scene including a plurality of areas,
setting, for each of the plurality of areas, a segmentation gain based on measurement of segmentation noise in each of the plurality of areas;
segmenting each of the plurality of areas using the corresponding segmentation gain;
periodically updating the measurement of segmentation noise at a first time interval;
periodically measuring a background noise level at a second time interval, the second time interval being longer than the first time interval; and
adjusting the first time interval to maintain the change in segmentation noise between updates to an increase within a predetermined range.

21. The method of claim 20, wherein the predetermined range is between about 10% and about 20%.

22. The method of claim 20, wherein the dividing includes dividing the video scene into a grid, the plurality of areas being defined by the grid.

23. A method for video segmentation, comprising:
dividing a video scene, the divided video scene including a plurality of areas,
setting, for each of the plurality of areas, a segmentation gain based on measured segmentation noise while holding constant across the plurality of areas the number of noise blobs caused by visual noise in each of the plurality of areas, the segmentation gain for at least one of the plurality of areas being different than the segmentation gain for at least another one of the plurality of areas; and
segmenting each of the plurality of areas using the corresponding segmentation gain.

24. The method of claim 23,
wherein in the setting, the segmentation gain for each of the plurality of areas is a first segmentation gain,
wherein the segment is a first segmenting, and
further comprising:
setting, for each of the plurality of areas, a second segmentation gain lower than the first segmentation gain; and
segmenting a second time each of the plurality of areas using the corresponding second segmentation gain, the second segmenting taking place only inside the outlines of blobs segmented in the first segmenting.

25. The method of claim 23, wherein the segmenting includes employing a multi-variable segmentation technique based on image primitives that are transformations of the original background and foreground images in the video scene.

26. A method for video segmentation, comprising:
dividing a video scene, the divided video scene including a plurality of areas,
providing a desired number of noise blobs for each of the plurality of areas;
determining, using a proportional integral derivate control algorithm, a segmentation gain for each of the plurality of areas to produce the provided number of noise blobs; and
segmenting each of the plurality of areas using the corresponding segmentation gain.

27. The method of claim 26, wherein the segmentation gain for at least one of the plurality of areas is different than the segmentation gain for at least another one of the plurality of areas.

28. The method of claim 26, wherein the dividing includes dividing the video scene into a grid, the plurality of areas being defined by the grid.