CN105868697B - A kind of quick number of people detection method and device - Google Patents

A kind of quick number of people detection method and device Download PDF

Info

Publication number
CN105868697B
CN105868697B CN201610176753.7A CN201610176753A CN105868697B CN 105868697 B CN105868697 B CN 105868697B CN 201610176753 A CN201610176753 A CN 201610176753A CN 105868697 B CN105868697 B CN 105868697B
Authority
CN
China
Prior art keywords
image
people
radius
hough
img
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.)
Active
Application number
CN201610176753.7A
Other languages
Chinese (zh)
Other versions
CN105868697A (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.)
Beijing yunshang Zhiwei Technology Co.,Ltd.
Original Assignee
Beijing Zhi Xinyuandong Science And Technology Ltd
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 Beijing Zhi Xinyuandong Science And Technology Ltd filed Critical Beijing Zhi Xinyuandong Science And Technology Ltd
Priority to CN201610176753.7A priority Critical patent/CN105868697B/en
Publication of CN105868697A publication Critical patent/CN105868697A/en
Application granted granted Critical
Publication of CN105868697B publication Critical patent/CN105868697B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/48Extraction of image or video features by mapping characteristic values of the pattern into a parameter space, e.g. Hough transformation

Abstract

The present invention provides a kind of quick number of people detection methods, comprising: according to the least radius image and maximum radius image of calibration line segment calculating resolution image and the number of people;Calculate the edge point image and edge gradient vector-valued image of image;It is voted according to Hough, obtains hough space image;Extract number of people candidate point;Candidate number of people radius and confidence level are calculated, and obtains candidate's head region;Candidate's head region is screened;Remaining candidate's head region as number of people detection zone and is exported.The present invention realizes the quick detection of the number of people, can operate in pedestrian counting.

Description

A kind of quick number of people detection method and device
Technical field
The present invention relates to image procossings, video monitoring, the in particular to method and device of number of people detection.
Background technique
It, can be by the historical data of analysis pedestrian's flow, to the pedestrian stream at certain following moment using pedestrian counting technology Amount predicted, therefore pedestrian counting have in the scenes such as market, supermarket, park, public transport and subway it is a variety of different important Using.The basic technology of pedestrian counting is that the people of individual is identified in crowd, due to interpersonal phase in crowded environment Mutually block, accurately identify entire human body and become difficult, as long as but camera setting angle is suitable, blocked between the number of people it is less, because This number of people detection technique has great practical value in the research of pedestrian counting.
The Chinese invention patent application of Publication No. CN105321187A discloses a kind of based on the pedestrian of number of people detection Counting method, this method is trained in advance to obtain several number of people classifiers using SVM classifier, and utilizes the number of people classifier Movement pedestrian area is detected, number of people region is obtained, finally by Kalman arest neighbors matched jamming method to number of people region Central point tracked and counted.The Chinese invention patent application of Publication No. CN104299005A discloses a kind of number of people inspection Method and system are surveyed, this method uses the LBP feature based on direction gradient, so that the edge and profile information of the number of people can the sides of passing through It is characterized to gradient, and joined LBP feature on this basis to characterize the local grain information of the number of people, and then can will regard The number of people in frequency image detected.However above-mentioned number of people detection technique time-consuming is more.
In conclusion there is an urgent need to propose a kind of quick number of people detection method and device at present.
Summary of the invention
In view of this, it is a primary object of the present invention to realize quick number of people detection.
In order to achieve the above objectives, first aspect according to the invention provides a kind of quick number of people detection method, the party Method includes:
First step, the diametrical position of the number of people in image demarcate line segment, according to calibration line segment calculating resolution image, The least radius image and maximum radius image of the number of people are calculated according to image in different resolution, number of people radius, number of people radius tolerance;
Second step calculates the edge point image and edge gradient vector-valued image of image;
Third step is voted according to Hough, obtains hough space image;
Four steps extracts number of people candidate point;
5th step calculates candidate number of people radius and confidence level, and obtains candidate's head region;
6th step screens candidate's head region;And
7th step as number of people detection zone and exports remaining candidate's head region.
Wherein, according to calibration line segment calculating resolution image step in the first step specifically: according to calibration line segment Space coordinate is converted image coordinate by FDLS, i.e. acquisition image in different resolution IMG_RESO, the picture of image in different resolution IMG_RESO Element value is the resolution ratio of the pixel, and unit pixel/cm, pixel are pixel.
The most smaller part that the number of people is calculated according to image in different resolution, number of people radius, number of people radius tolerance in the first step Specific step is as follows for diameter image and maximum radius image: being calculated according to number of people radius HEAD and number of people radius tolerance HEAD_DEV The least radius HEAD* (1-HEAD_DEV) and maximum radius HEAD* (1+HEAD_DEV) of the number of people, then according to image in different resolution IMG_RESO obtains people according to the least radius HEAD* (1-HEAD_DEV) and maximum radius HEAD* (1+HEAD_DEV) of the number of people Head least radius image IMG_RADminWith maximum radius image IMG_RADmax, unit is pixel.
The second step fall into a trap nomogram picture edge point image and edge gradient vector-valued image specific step is as follows:
Edge detection process is carried out to image, obtains edge image and gradient vector image;
The difference image between adjacent two field pictures is calculated, prospect bianry image is obtained;
Using prospect bianry image as mask, the pixel of the non-prospect in edge image is reset, to obtain the side of image Edge point image IMG_EDGE resets the pixel of the non-prospect in gradient vector image, with obtain the edge gradient of image to Spirogram is as IMG_GRAD.
The third step further comprises:
It is complete zero that hough space image, " black region " Hough image and " white region " Hough image initial value, which is arranged,;
Hough ballot is carried out to edge point image;
The larger value is taken to handle " black region " Hough image and " white region " Hough image, to obtain hough space figure Picture.
The four steps further comprises:
Binary conversion treatment is carried out to hough space image IMG_HOUGH according to threshold value TH_HOUGH, obtains hough space Binary image IMG_HBIN;
Regional connectivity processing is carried out to the binary image IMG_HBIN of hough space, obtains regional ensemble HREGIONS= {HRGNk, k=1,2 ..., L }, wherein L is the number of connected region, HRGNkIndicate k-th of connected region;
Calculate each region HRGNkMass center HCPOSk, and as the number of people candidate point in the region, obtain the number of people Candidate point set HCANDS={ HCPOSk, k=1,2 ..., L }, wherein L is the number of connected region.
5th step further comprises:
Circumference is divided into 120 equal parts with 3 for interval, obtains the normal vector of each spaced points;
To each number of people candidate point HCPOSk, it is R in radiusklThe confidence level of circle be gradient vector and circle on circumference The normalization inner product of all normal vectors, is denoted as HCDNFkl
To range RADmin≤Rkl≤RADmaxThe circle of interior all radiuses calculates confidence level HCDNFkl, take confidence level maximum Radius RklIt is denoted as candidate number of people radius Rk, confidence level HCDNFk, with number of people candidate point HCPOSkCentered on the candidate number of people half Diameter RkInterior region is candidate's head region HCPOSk
6th step specifically: setting threshold value TH_HCONF filters out all confidence level HCDNFkLess than TH_ Candidate's head region HCPOS of HCONFk
6th step can further include: calculate the similitude GSIM in circumference with circumference exterior domain gray scalek, Threshold value TH_GSIM is set, all similitude GSIM are filtered outkCandidate's head region HCPOS greater than TH_GSIMk
Other side according to the invention, provides a kind of quick number of people detection device, which includes:
The least radius image and maximum radius image collection module of the number of people, the diametrical position for the number of people in image Line segment is demarcated, according to calibration line segment calculating resolution image, is calculated according to image in different resolution, number of people radius, number of people radius tolerance The least radius image and maximum radius image of the number of people;
The edge point image and edge gradient vector-valued image of image obtain module, for calculate image edge point image and Edge gradient vector-valued image;
Hough ballot obtains hough space image module, for obtaining hough space image;
Number of people candidate point extraction module, for extracting number of people candidate point;
Candidate's head region obtains module, for calculating candidate number of people radius and confidence level, and obtains candidate's head region;
Candidate's head region screening module, for being screened to candidate's head region;And
Number of people detection zone output module, for as number of people detection zone and exporting remaining candidate's head region.
Wherein, the number of people in the least radius image of the number of people and maximum radius image collection module in image is straight Path position demarcates line segment can be in same piece image positioned at the diametrical position calibration line segment of the number of people of different location, can also be right The diametrical position of the number of people in different images in video sequence demarcates line segment.
According to calibration line segment calculating resolution in the least radius image and maximum radius image collection module of the number of people Image step specifically: image coordinate is converted for space coordinate according to calibration line segment FDLS, i.e. acquisition image in different resolution IMG_ The pixel value of RESO, image in different resolution IMG_RESO are the resolution ratio of the pixel, and unit pixel/cm, pixel are Pixel.
In the least radius image and maximum radius image collection module of the number of people according to image in different resolution, the number of people half Specific step is as follows for the least radius image and maximum radius image that diameter, number of people radius tolerance calculate the number of people: according to the number of people half Diameter HEAD and number of people radius tolerance HEAD_DEV calculates the least radius HEAD* (1-HEAD_DEV) and maximum radius of the number of people HEAD* (1+HEAD_DEV), then according to the least radius HEAAD* (1-HEAD_ of the image in different resolution IMG_RESO foundation number of people DEV) and maximum radius HEAD* (1+HEAD_DEV) obtains number of people least radius image IMG_RADminWith maximum radius image IMG_RADmax, unit is pixel.
The edge point image and edge gradient vector-valued image of described image obtain module and fall into a trap the edge point image of nomogram picture Specific step is as follows with edge gradient vector-valued image:
Edge processing module obtains edge image and gradient vector image for carrying out edge detection process to image;
Prospect bianry image obtains module, for calculating the difference image between adjacent two field pictures, obtains prospect two-value Image;
Edge point image and edge gradient image obtain module, are used for using prospect bianry image as mask, by edge image In the pixel of non-prospect reset, will be before non-in gradient vector image to obtain the edge point image IMG_EDGE of image The pixel of scape is reset, to obtain the edge gradient vector-valued image IMG_GRAD of image.
The hough space image collection module further comprises:
Hough image initial module, for hough space image, " black region " Hough image and " white region " to be arranged suddenly Husband's image initial value is complete zero;
Hough vote module, for carrying out Hough ballot to edge point image;
Hough space image obtains, for taking at the larger value to " black region " Hough image and " white region " Hough image Reason, to obtain hough space image.
The number of people candidate point extraction module includes:
Binary processing module, for carrying out binaryzation to hough space image IMG_HOUGH according to threshold value TH_HOUGH Processing, obtains the binary image IMG_HBIN of hough space;
Connected region processing module carries out regional connectivity processing for the binary image IMG_HBIN to hough space, Obtain regional ensemble HREGIONS={ HRGNk, k=1,2 ..., L }, wherein L is the number of connected region, HRGNkIt indicates k-th Connected region;
Number of people candidate point set obtains module, for calculating each region HRGNkMass center HCPOSk, and as The number of people candidate point in the region obtains number of people candidate point set HCANDS={ HCPOSk, k=1,2 ..., L }, wherein L is connection The number in region.
Candidate's head region obtains module
Circumference normal vector obtains module, for circumference to be divided into 120 equal parts with 3 for interval, obtains each spaced points Normal vector;
Confidence calculations module, to each number of people candidate point HCPOSk, it is R in radiusklThe confidence level of circle be circumference On gradient vector and circumference normal vector normalization inner product, be denoted as HCDNFkl
Candidate's head region module is obtained according to confidence level, to range RADmin≤Rkl≤RADmaxThe circle of interior all radiuses Calculate confidence level HCDNFkl, take the maximum radius R of confidence levelklIt is denoted as candidate number of people radius Rk, confidence level HCDNFk, with people Head candidate point HCPOSkCentered on candidate number of people radius RkInterior region is candidate's head region HCPOSk
Candidate's head region screening module includes: that preliminary screening module is filtered out for threshold value TH_HCONF to be arranged All confidence level HCDNFkCandidate's head region HCPOS less than TH_HCONFk
Candidate's head region screening module can further include: postsearch screening module, for calculating in circumference With the similitude GSIM of circumference exterior domain gray scalek, threshold value TH_GSIM is set, all similitude GSIM are filtered outkGreater than TH_GSIM Candidate's head region HCPOSk
Compared with prior art, quick number of people detection method and device of the invention, the circle inspection based on Hough transformation It surveys, has the characteristics that fast and reliable, strong using simple and environmental suitability, can rapidly realize the counting of crowd.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes a part of the invention, but its Illustrate for explaining only the invention, not constituting improper limitations of the present invention.
Fig. 1 shows the flow chart of quick number of people detection method according to the invention.
Fig. 2 shows the flow charts of third step according to the invention.
Fig. 3 shows the frame diagram of quick number of people detection device according to the invention.
Fig. 4 shows the frame diagram that Hough ballot according to the invention obtains hough space image module.
Specific embodiment
To enable your auditor to further appreciate that structure of the invention, feature and other purposes, now in conjunction with appended preferable reality Applying example, detailed description are as follows, and illustrated preferred embodiment is only used to illustrate the technical scheme of the present invention, and the non-limiting present invention.
Fig. 1 shows the flow charts of quick detection number of people method according to the invention.As shown in Figure 1, according to the invention fast Fast number of people detection method includes:
The diametrical position of first step S1, the number of people in image demarcate line segment, according to calibration line segment calculating resolution figure Picture calculates the least radius image and maximum radius image of the number of people according to image in different resolution, number of people radius, number of people radius tolerance;
Second step S2 calculates the edge point image and edge gradient vector-valued image of image;
Third step S3, votes according to Hough, obtains hough space image;
Four steps S4 extracts number of people candidate point;
5th step S5 calculates candidate number of people radius and confidence level, and obtains candidate's head region;
6th step S6 screens candidate's head region;And
7th step S7 as number of people detection zone and exports remaining candidate's head region.
Wherein, the diametrical position calibration line segment of the number of people in the first step S1 in image can be in same piece image In be located at different location the number of people diametrical position demarcate line segment, can also be to the number of people in the different images in video sequence Diametrical position demarcates line segment.The calibration line segment FDLS={ fdli, i=1,2,3 ..., M }, M >=3.
According to calibration line segment calculating resolution image step in the first step S1 specifically: according to calibration line segment FDLS Image coordinate is converted by space coordinate, i.e. acquisition image in different resolution IMG_RESO, the pixel value of image in different resolution IMG_RESO The as resolution ratio of the pixel, unit pixel/cm, pixel are pixel.
The minimum that the number of people is calculated according to image in different resolution, number of people radius, number of people radius tolerance in the first step S1 Specific step is as follows for radius image and maximum radius image: being counted according to number of people radius HEAD and number of people radius tolerance HEAD_DEV The least radius HEAD* (1-HEAD_DEV) and maximum radius HEAD* (1+HEAD_DEV) for calculating the number of people, then according to resolution chart As IMG_RESO is obtained according to the least radius HEAD* (1-HEAD_DEV) and maximum radius HEAD* (1+HEAD_DEV) of the number of people Number of people least radius image IMG_RADminWith maximum radius image IMG_RADmax, unit is pixel.
The value range of the number of people radius HEAD is 9cm~11cm.Preferably, number of people radius HEAD is set as 10cm.
The value range of the number of people radius tolerance HEAD_DEV is 0.1~0.5.Preferably, number of people radius tolerance HEAD_ DEV is set as 0.3.
The second step S2 fall into a trap nomogram picture edge point image and edge gradient vector-valued image specific step is as follows:
Step S21 carries out edge detection process to image, obtains edge image and gradient vector image;
Step S22 calculates the difference image between adjacent two field pictures, obtains prospect bianry image;
Step S23 resets the pixel of the non-prospect in edge image using prospect bianry image as mask, to obtain The edge point image IMG_EDGE of image resets the pixel of the non-prospect in gradient vector image, to obtain the side of image Edge gradient vector image IMG_GRAD.
Wherein, edge detection process described in step S21 can pass through existing edge detection method, such as edge inspection Calculate submethod.Edge detection operator can be calculated for Roberts Cross operator, Prewitt operator, Sobel operator, Kirsch Son, compass operator, Marr-Hildreth, second dervative zero crossing, Canny operator, Laplacian operator in gradient direction Deng.Preferably, using Canny operator edge detection method.
Fig. 2 gives the flow chart of third step according to the invention.As shown in Fig. 2, third step according to the invention S3 further comprises:
Step S31, setting hough space image, " black region " Hough image and " white region " Hough image initial value are complete Zero;
Step S32 carries out Hough ballot to edge point image;
Step S33 takes the larger value to handle " black region " Hough image and " white region " Hough image, to obtain suddenly Husband's spatial image.
Wherein, specific step is as follows by step S32:
Step S321 calculates the gradient direction IMG_ of each pixel according to edge gradient vector-valued image IMG_GRAD GDIRjWith gradient amplitude IMG_GMAGj, j j-th of pixel of expression;
Step S322, from the least radius image IMG_RAD of the number of peopleminWith maximum radius image IMG_RADmax, it is somebody's turn to do The minimum number of people radius RAD of pixelminWith maximum number of people radius RADmax
Step S323, along the gradient direction IMG_GDIR of j-th of pixeljFrom distance RADminTo RADmaxBetween, by A pixel between above-mentioned carries out " black region " Hough image IMG_HOUGH_B ballot, if encountering gradient amplitude ratio IMG_GMAGjBig marginal point then stops voting;
Step S324, along the negative gradient direction-IMG_GDIR of j-th of pixeljFrom distance RADminTo RADmaxBetween, " black region " Hough image IMG_HOUGH_W ballot is carried out to the pixel between above-mentioned one by one, if encountering gradient amplitude ratio IMG_GMAGiBig marginal point then stops voting.
The step 33 specifically: to " black region " Hough image IMG_HOUGH_B and " white region " Hough image IMG_ HOUGH_W takes the larger value to handle, to obtain hough space image IMG_HOUGH=max (IMG_HOUGH_B, IMG_ HOUGH_W)。
The four steps S4 further comprises:
Step S41 carries out binary conversion treatment to hough space image IMG_HOUGH according to threshold value TH_HOUGH, obtains suddenly The binary image IMG_HBIN in husband space;
Step S42 carries out regional connectivity processing to the binary image IMG_HBIN of hough space, obtains regional ensemble HREGIONS={ HRGNk, k=1,2 ..., L }, wherein L is the number of connected region, HRGNkIndicate k-th of connected region;
Step S43 calculates each region HRGNkMass center HCPOSk, and as the number of people candidate point in the region, Obtain number of people candidate point set HCANDS={ HCPOSk, k=1,2 ..., L }, wherein L is the number of connected region.
Wherein, the value range of the threshold value TH_HOUGH in the step S41 is 20~30.Preferably, TH_HOUGH is set It is set to 25.
The 5th step S5 further comprises:
Circumference is divided into 120 equal parts with 3 for interval, obtains the normal vector of each spaced points by step S51;
Step S52, to each number of people candidate point HCPOSk, it is R in radiusklThe confidence level of circle be gradient on circumference The normalization inner product of vector and circumference normal vector, is denoted as HCDNFkl
Step S53, to range RADmin≤Rkl≤RADmaxThe circle of interior all radiuses calculates confidence level HCDNFkl, take and set The maximum radius R of reliabilityklIt is denoted as candidate number of people radius Rk, confidence level HCDNFk, with number of people candidate pointFor in Heart candidate's number of people radius RkInterior region is candidate's head region
The 6th step S6 specifically: setting threshold value TH_HCONF filters out all confidence level HCDNFkLess than TH_ Candidate's head region HCPOS of HCONFk.Wherein, the value range of TH_HCONF is 0.2~0.4.Preferably, TH_HCONF is set It is set to 0.3.
The 6th step S6 can further include: calculate the similitude in circumference with circumference exterior domain gray scale GSIMk, threshold value TH_GSIM is set, all similitude GSIM are filtered outkCandidate's head region HCPOS greater than TH_GSIMk
Wherein, the value range of TH_GSIM is 0.4~0.6.Preferably, TH_GSIM is set as 0.5.
Fig. 3 shows the frame diagram of quick number of people detection device according to the invention.As shown in figure 3, quickly number of people detection Device includes:
The least radius image and maximum radius image collection module 1 of the number of people, the diameter position for the number of people in image Calibration line segment is set, according to calibration line segment calculating resolution image, according to image in different resolution, number of people radius, number of people radius tolerance meter Calculate the least radius image and maximum radius image of the number of people;
The edge point image and edge gradient vector-valued image of image obtain module 2, for calculating the edge point image of image With edge gradient vector-valued image;
Hough ballot obtains hough space image module 3, for obtaining hough space image;
Number of people candidate point extraction module 4, for extracting number of people candidate point;
Candidate's head region obtains module 5, for calculating candidate number of people radius and confidence level, and obtains candidate's Head Section Domain;
Candidate's head region screening module 6, for being screened to candidate's head region;And
Number of people detection zone output module 7, for as number of people detection zone and exporting remaining candidate's head region.
Wherein, the number of people in the least radius image of the number of people and maximum radius image collection module 1 in image Diametrical position demarcate line segment can the diametrical position in same piece image positioned at the number of people of different location demarcate line segment, can also be with Line segment is demarcated to the diametrical position of the number of people in the different images in video sequence.The calibration line segment FDLS={ fdli, i= 1,2,3 ..., M }, M >=3.
According to calibration line segment calculating resolution in the least radius image and maximum radius image collection module 1 of the number of people Image step specifically: image coordinate is converted for space coordinate according to calibration line segment FDLS, i.e. acquisition image in different resolution IMG_ The pixel value of RESO, image in different resolution IMG_RESO are the resolution ratio of the pixel, and unit pixel/cm, pixel are Pixel.
In the least radius image and maximum radius image collection module 1 of the number of people according to image in different resolution, the number of people Specific step is as follows for the least radius image and maximum radius image that radius, number of people radius tolerance calculate the number of people: according to the number of people Radius HEAD and number of people radius tolerance HEAD_DEV calculates the least radius HEAD* (1-HEAD_DEV) and maximum radius of the number of people HEAD* (1+HEAD_DEV), then according to the least radius HEAD* (1-HEAD_ of the image in different resolution IMG_RESO foundation number of people DEV) and maximum radius HEAD* (1+HEAD_DEV) obtains number of people least radius image IMG_RADmmWith maximum radius image IMG_ RADmax, unit is pixel.
The value range of the number of people radius HEAD is 9cm~11cm.Preferably, number of people radius HEAD is set as 10cm.
The value range of the number of people radius tolerance HEAD_DEV is 0.1~0.5.Preferably, number of people radius tolerance HEAD_ DEV is set as 0.3.
The edge point image and edge gradient vector-valued image of described image obtain module 2 and fall into a trap the edge point image of nomogram picture Specific step is as follows with edge gradient vector-valued image:
Edge processing module 21 obtains edge image and gradient vector image for carrying out edge detection process to image;
Prospect bianry image obtains module 22, for calculating the difference image between adjacent two field pictures, obtains prospect two It is worth image;
Edge point image and edge gradient image obtain module 23, are used for using prospect bianry image as mask, by edge graph The pixel of non-prospect as in is reset, will be non-in gradient vector image to obtain the edge point image IMG_EDGE of image The pixel of prospect is reset, to obtain the edge gradient vector-valued image IMG_GRAD of image.
Wherein, edge detection process described in edge processing module 21 can pass through existing edge detection method, example Such as edge detection operator method.Edge detection operator can for Roberts Cross operator, Prewitt operator, Sobel operator, Kirsch operator, compass operator, Marr-Hildreth, the second dervative zero crossing in gradient direction, Canny operator, Laplacian operator etc..Preferably, using Canny operator edge detection method.
Fig. 4 shows the frame diagram that Hough ballot according to the invention obtains hough space image module 3.As shown in figure 4, Hough space image collection module 3 includes:
Hough image initial module 31, for hough space image, " black region " Hough image and " white region " to be arranged Hough image initial value is complete zero;
Hough vote module 32, for carrying out Hough ballot to edge point image;
Hough space image obtains 33, for taking the larger value to " black region " Hough image and " white region " Hough image Processing, to obtain hough space image.
Wherein, the Hough vote module 32 includes:
Gradient direction and magnitude computation module 321, for calculating each according to edge gradient vector-valued image IMG_GRAD The gradient direction IMG_GDIR of pixeljWith gradient amplitude IMG_GMAGj, j j-th of pixel of expression;
Minimum number of people radius and maximum number of people radius obtain module 322, for the least radius image IMG_ from the number of people RADminWith maximum radius image IMG_RADmax, obtain the minimum number of people radius RAD of the pixelminWith maximum number of people radius RADmax
" black region " Hough image vote module 323, for the gradient direction IMG_GDIR along j-th of pixeljFrom Distance RADminTo RADmaxBetween, " black region " Hough image IMG_HOUGH_B is carried out to the pixel between above-mentioned one by one and is thrown Ticket, if encountering gradient amplitude ratio IMG_GMAGjBig marginal point then stops voting;
" white region " Hough image vote module 324, for the negative gradient direction-IMG_GDIR along j-th of pixelj From distance RADminTo RADmaxBetween, " black region " Hough image IMG_HOUGH_W is carried out to the pixel between above-mentioned one by one Ballot, if encountering gradient amplitude ratio IMG_GMAGjBig marginal point then stops voting.
The hough space image obtains 33 and is specifically used for " black region " Hough image IMG_HOUGH_B and " white region " Hough image IMG_HOUGH_W takes the larger value to handle, to obtain hough space image IMG_HOUGH=max (IMG_ HOUGH_B, IMG_HOUGH_W).
The number of people candidate point extraction module 4 includes:
Binary processing module 4l, for carrying out two-value to hough space image IMG_HOUGH according to threshold value TH_HOUGH Change processing, obtains the binary image IMG_HBIN of hough space;
Connected region processing module 42 carries out at regional connectivity for the binary image IMG_HBIN to hough space Reason, obtains regional ensemble HREGIONS={ HRGNk, k=1,2 ..., L }, wherein L is the number of connected region, HRGNkIndicate the K connected region;
Number of people candidate point set obtains module 43, for calculating each region HRGNkMass center HCPOSk, and made For the number of people candidate point in the region, number of people candidate point set HCANDS={ HCPOS is obtainedk, k=1,2 ..., L }, wherein L is to connect The number in logical region.
Wherein, the value range of the threshold value TH_HOUGH in the binary processing module 41 is 20~30.Preferably, TH_HOUGH is set as 25.
Candidate's head region obtains module 5
Circumference normal vector obtains module 51, for circumference to be divided into 120 equal parts with 3 for interval, obtains each spaced points Normal vector;
Confidence calculations module 52, to each number of people candidate point HCPOSk, it is R in radiusklCircle confidence level be justify The normalization inner product of gradient vector and circumference normal vector on week, is denoted as HCDNFkl
Candidate's head region module 53 is obtained according to confidence level, to range RADmin≤Rkl≤RADmaxInterior all radiuses Circle calculates confidence level HCDNFkl, take the maximum radius R of confidence levelklIt is denoted as candidate number of people radius Rk, confidence level HCDNFk, with Number of people candidate point HCPOSkCentered on candidate number of people radius RkInterior region is candidate's head region HCPOSk
Candidate's head region screening module 6 further comprises: preliminary screening module 61, for threshold value TH_ to be arranged HCONF filters out all confidence level HCDNFkCandidate's head region HCPOS less than TH_HCONFk
Wherein, the value range of TH_HCONF is 0.2~0.4.Preferably, TH_HCONF is set as 0.3.
Candidate's head region screening module 6 can further include: postsearch screening module 62, for calculating circumference Interior and circumference exterior domain gray scale similitude GSIMk, threshold value TH_GSIM is set, all similitude GSIM are filtered outkGreater than TH_ Candidate's head region HCPOS of GSIMk
Wherein, the value range of TH_GSIM is 0.4~0.6.Preferably, TH_GSIM is set as 0.5.
Compared with prior art, quick number of people detection method and device of the invention, the circle inspection based on Hough transformation It surveys, has the characteristics that fast and reliable, strong using simple and environmental suitability, can rapidly realize the counting of crowd.
It is to be understood that foregoing invention content and specific embodiment are intended to prove technical solution provided by the present invention Practical application should not be construed as limiting the scope of the present invention.Those skilled in the art are in spirit and principles of the present invention It is interior, when can various modifications may be made, equivalent replacement or improve.Protection scope of the present invention is subject to the appended claims.

Claims (16)

1. a kind of quick number of people detection method, which is characterized in that this method comprises:
First step, the diametrical position of the number of people in image demarcate line segment, according to calibration line segment calculating resolution image, according to Image in different resolution, number of people radius, number of people radius tolerance calculate the least radius image and maximum radius image of the number of people;
Second step calculates the edge point image and edge gradient vector-valued image of image;
Third step is voted according to Hough, obtains hough space image;
Four steps extracts number of people candidate point;
5th step calculates candidate number of people radius and confidence level, and obtains candidate's head region;
6th step screens candidate's head region;And
7th step as number of people detection zone and exports remaining candidate's head region;
Wherein, the third step includes:
Step a, setting hough space image, " black region " Hough image and " white region " Hough image initial value are complete zero;
Step b carries out Hough ballot to edge point image;
Step c takes the larger value to handle " black region " Hough image and " white region " Hough image, to obtain hough space Image;
Further, the step b includes:
The gradient direction IMG_GDIR of each pixel is calculated according to edge gradient vector-valued image IMG_GRADjAnd gradient amplitude IMG_GMAGj, j j-th of pixel of expression;
From the least radius image IMG_RAD of the number of peopleminWith maximum radius image IMG_RADmax, obtain the most person of low position of the pixel Head radius RADminWith maximum number of people radius RADmax
Along the gradient direction IMG_GDIR of j-th of pixeljFrom distance RADminTo RADmaxBetween, one by one between above-mentioned Pixel carries out " black region " Hough image IMG_HOUGH_B ballot, if encountering gradient amplitude ratio IMG_GMAGjBig edge Point then stops voting;
Along the negative gradient direction-IMG_GDIR of j-th of pixeljFrom distance RADminTo RADmaxBetween, one by one between above-mentioned Pixel carry out " black region " Hough image IMG_HOUGH_W ballot, if encountering gradient amplitude ratio IMG_GMAGjBig side Edge point, then stop voting.
It is specific according to calibration line segment calculating resolution image step in the first step 2. the method as described in claim 1 Are as follows: image coordinate is converted for space coordinate according to calibration line segment FDLS, i.e. acquisition image in different resolution IMG_RESO, resolution chart As the pixel value of IMG_RESO is the resolution ratio of the pixel, unit pixel/cm, pixel are pixel;
In first step according to image in different resolution, number of people radius, number of people radius tolerance calculate the number of people least radius image and Specific step is as follows for maximum radius image: calculating the number of people most according to number of people radius HEAD and number of people radius tolerance HEAD_DEV Minor radius HEAD* (1-HEAD_DEV) and maximum radius HEAD* (1+HEAD_DEV), then according to image in different resolution IMG_RESO Least radius HEAD* (1-HEAD_DEV) and maximum radius HEAD* (1+HEAD_DEV) according to the number of people obtain the number of people most smaller part Diameter image IMG_RADminWith maximum radius image IMG_RADmax, unit is pixel;
Wherein, the value range of number of people radius HEAD is 9cm~11cm, and the value range of number of people radius tolerance HEAD_DEV is 0.1~0.5.
3. method according to claim 2, the calibration line segment FDLS={ fdli, i=1,2,3 ..., M }, M >=3.
4. the method as described in claim 1, the second step include:
Edge detection process is carried out to image, obtains edge image and gradient vector image;
The difference image between adjacent two field pictures is calculated, prospect bianry image is obtained;
Using prospect bianry image as mask, the pixel of the non-prospect in edge image is reset, to obtain the marginal point of image Image IMG_EDGE resets the pixel of the non-prospect in gradient vector image, to obtain the edge gradient vectogram of image As IMG_GRAD.
5. the method as described in claim 1, the four steps further comprises:
Binary conversion treatment is carried out to hough space image IMG_HOUGH according to threshold value TH_HOUGH, obtains the two-value of hough space Change image IMG_HBIN;
Regional connectivity processing is carried out to the binary image IMG_HBIN of hough space, obtains regional ensemble HREGIONS= {HRGNk, k=1,2 ..., L }, wherein L is the number of connected region, HRGNkIndicate k-th of connected region;
Calculate each region HRGNkMass center HCPOSk, and as the number of people candidate point in the region, it is candidate to obtain the number of people Point set HCANDS={ HCPOSk, k=1,2 ..., L }, wherein L is the number of connected region;
Wherein, the value range of TH_HOUGH is 20~30.
6. the method as described in claim 1, which is characterized in that the 5th step further comprises:
Circumference is divided into 120 equal parts with 3 for interval, obtains the normal vector of each spaced points;
To each number of people candidate point HCPOSk, it is R in radiusklThe confidence level of circle be gradient vector and three figure method on circumference The normalization inner product of vector, is denoted as HCDNFkl
To range RADmin≤Rkl≤RADmaxThe circle of interior all radiuses calculates confidence level HCDNFkl, take the maximum radius of confidence level RklIt is denoted as candidate number of people radius Rk, confidence level HCDNFk, with number of people candidate point HCPOSkCentered on candidate number of people radius RkIt is interior Region be candidate's head region HCPOSk
7. the method as described in claim 1, which is characterized in that the 6th step specifically: setting threshold value TH_HCONF, mistake Filter all confidence level HCDNFkCandidate's head region HCPOS less than TH_HCONFk
Wherein, the value range of TH_HCONF is 0.2~0.4.
8. the method for claim 7, which is characterized in that the 6th step further comprises: calculating in circumference and round The similitude GSIM of all exterior domain gray scalesk, threshold value TH_GSIM is set, all similitude GSIM are filtered outkTime greater than TH_GSIM Head region of choosing HCPOSk
Wherein, the value range of TH_GSIM is 0.4~0.6.
9. a kind of quick number of people detection device, which is characterized in that the device includes:
The least radius image and maximum radius image collection module of the number of people, the diametrical position for the number of people in image are demarcated Line segment calculates the number of people according to image in different resolution, number of people radius, number of people radius tolerance according to calibration line segment calculating resolution image Least radius image and maximum radius image;
The edge point image and edge gradient vector-valued image of image obtain module, for calculating the edge point image and edge of image Gradient vector image;
Hough ballot obtains hough space image module, for obtaining hough space image;
Number of people candidate point extraction module, for extracting number of people candidate point;
Candidate's head region obtains module, for calculating candidate number of people radius and confidence level, and obtains candidate's head region;
Candidate's head region screening module, for being screened to candidate's head region;And
Number of people detection zone output module, for as number of people detection zone and exporting remaining candidate's head region;
Wherein, the Hough ballot acquisition hough space image module includes:
The Hough image initial module, for hough space image, " black region " Hough image and " white region " to be arranged suddenly Husband's image initial value is complete zero;
Hough vote module, for carrying out Hough ballot to edge point image;
Hough space image obtains, for taking the larger value to handle " black region " Hough image and " white region " Hough image, To obtain hough space image;
Further, the Hough vote module includes:
Gradient direction and magnitude computation module, for calculating each pixel according to edge gradient vector-valued image IMG_GRAD Gradient direction IMG_GDIRjWith gradient amplitude IMG_GMAGj, j j-th of pixel of expression;
Minimum number of people radius and maximum number of people radius obtain module, for the least radius image IMG_RAD from the number of peopleminMost Large radius image IMG_RADmax, obtain the minimum number of people radius RAD of the pixelminWith maximum number of people radius RADmax
" black region " Hough image vote module, for the gradient direction IMG_GDIR along j-th of pixeljFrom distance RADmin To RADmaxBetween, " black region " Hough image IMG_HOUGH_B ballot is carried out to the pixel between above-mentioned one by one, if met To gradient amplitude ratio IMG_GMAGjBig marginal point then stops voting;
" white region " Hough image vote module, for the negative gradient direction-IMG_GDIR along j-th of pixeljFrom distance RADminTo RADmaxBetween, " black region " Hough image IMG_HOUGH_W ballot is carried out to the pixel between above-mentioned one by one, such as Fruit encounters gradient amplitude ratio IMG_GMAGjBig marginal point then stops voting.
10. device as claimed in claim 9, root in the least radius image and maximum radius image collection module of the number of people According to calibration line segment calculating resolution image step specifically: image coordinate is converted for space coordinate according to calibration line segment FDLS, Image in different resolution IMG_RESO is obtained, the pixel value of image in different resolution IMG_RESO is the resolution ratio of the pixel, unit It is pixel for pixel/cm, pixel;
In the least radius image and maximum radius image collection module of the number of people according to image in different resolution, number of people radius, Specific step is as follows for the least radius image and maximum radius image that number of people radius tolerance calculates the number of people: according to number of people radius HEAD and number of people radius tolerance HEAD_DEV calculates the least radius HEAD* (1-HEAD_DEV) and maximum radius HEAD* of the number of people (1+HEAD_DEV), then according to image in different resolution IMG_RESO according to the number of people least radius HEAD* (1-HEAD_DEV) and Maximum radius HEAD* (1+HEAD_DEV) obtains number of people least radius image IMG_RADminWith maximum radius image IMG_ RADmax, unit is pixel;
Wherein, the value range of number of people radius HEAD is 9cm~11cm, and the value range of number of people radius tolerance HEAD_DEV is 0.1~0.5.
11. device as claimed in claim 10, the calibration line segment FDLS={ fdli, i=1,2,3 ..., M }, M >=3.
12. device as claimed in claim 9, the edge point image and edge gradient vector-valued image of described image are obtained in module Specific step is as follows for the edge point image and edge gradient vector-valued image for calculating image:
Edge processing module obtains edge image and gradient vector image for carrying out edge detection process to image;Prospect two It is worth image collection module, for calculating the difference image between adjacent two field pictures, obtains prospect bianry image;
Edge point image and edge gradient image obtain module, are used for using prospect bianry image as mask, will be in edge image The pixel of non-prospect is reset, to obtain the edge point image IMG_EDGE of image, by the non-prospect in gradient vector image Pixel is reset, to obtain the edge gradient vector-valued image IMG_GRAD of image.
13. device as claimed in claim 9, the number of people candidate point extraction module includes: binary processing module, it to be used for root Binary conversion treatment is carried out to hough space image IMG_HOUGH according to threshold value TH_HOUGH, obtains the binary image of hough space IMG_HBIN;
Connected region processing module carries out regional connectivity processing for the binary image IMG_HBIN to hough space, obtains Regional ensemble HREGIONS={ HRGNk, k=1,2 ..., L }, wherein L is the number of connected region, HRGNkIndicate k-th of connection Region;
Number of people candidate point set obtains module, for calculating each region HRGNkMass center HCPOSk, and as the area The number of people candidate point in domain obtains number of people candidate point set HCANDS={ HCPOSk, k=1,2 ..., L }, wherein L is connected region Number;
Wherein, the value range of TH_HOUGH is 20~30.
14. device as claimed in claim 9, candidate's head region obtains module and includes:
Circumference normal vector obtains module, for circumference to be divided into 120 equal parts with 3 for interval, obtains the normal direction of each spaced points Amount;
Confidence calculations module, to each number of people candidate point HCPOSk, it is R in radiusklThe confidence level of circle be on circumference The normalization inner product of gradient vector and circumference normal vector, is denoted as HCDNFkl
Candidate's head region module is obtained according to confidence level, to range RADmin≤Rkl≤RADmaxThe circle of interior all radiuses calculates Confidence level HCDNFkl, take the maximum radius R of confidence levelklIt is denoted as candidate number of people radius Rk, confidence level HCDNFk, waited with the number of people Reconnaissance HCPOSkCentered on candidate number of people radius RkInterior region is candidate's head region HCPOSk
15. device as claimed in claim 9, candidate's head region screening module includes: preliminary screening module, for setting Threshold value TH_HCONF is set, all confidence level HCDNF are filtered outkCandidate's head region HCPOS less than TH_HCONFk
Wherein, the value range of TH_HCONF is 0.2~0.4.
16. device as claimed in claim 15, candidate's head region screening module further comprises: postsearch screening mould Block, for calculating in circumference and the similitude GSIM of circumference exterior domain gray scalek, threshold value TH_GSIM is set, is filtered out all similar Property GSIMkCandidate's head region HCPOS greater than TH_GSIMk
Wherein, the value range of TH_GSIM is 0.4~0.6.
CN201610176753.7A 2016-03-25 2016-03-25 A kind of quick number of people detection method and device Active CN105868697B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610176753.7A CN105868697B (en) 2016-03-25 2016-03-25 A kind of quick number of people detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610176753.7A CN105868697B (en) 2016-03-25 2016-03-25 A kind of quick number of people detection method and device

Publications (2)

Publication Number Publication Date
CN105868697A CN105868697A (en) 2016-08-17
CN105868697B true CN105868697B (en) 2019-08-13

Family

ID=56625836

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610176753.7A Active CN105868697B (en) 2016-03-25 2016-03-25 A kind of quick number of people detection method and device

Country Status (1)

Country Link
CN (1) CN105868697B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106327519B (en) * 2016-08-19 2019-11-19 杭州智诺科技股份有限公司 Number of people detection method based on Hough transform
CN106778638B (en) * 2016-12-19 2019-12-13 江苏慧眼数据科技股份有限公司 Passenger flow statistical method based on head detection
CN109190690B (en) * 2018-08-17 2021-10-19 东北大学 Method for detecting and identifying cerebral microhemorrhage points based on SWI image of machine learning
CN109740486B (en) * 2018-12-27 2021-07-27 北京铁路信号有限公司 Method and system for identifying number of human beings contained in image
CN110232353B (en) * 2019-06-12 2023-06-06 成都世纪光合作用科技有限公司 Method and device for acquiring depth position of scene personnel

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102063613A (en) * 2010-12-28 2011-05-18 北京智安邦科技有限公司 People counting method and device based on head recognition
JP2011141622A (en) * 2010-01-05 2011-07-21 Canon Inc Detection apparatus and method
CN103198323A (en) * 2013-03-12 2013-07-10 无锡慧眼电子科技有限公司 Pedestrian detection method based on curve fitting

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4988786B2 (en) * 2009-04-09 2012-08-01 株式会社日本自動車部品総合研究所 Boundary line recognition device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011141622A (en) * 2010-01-05 2011-07-21 Canon Inc Detection apparatus and method
CN102063613A (en) * 2010-12-28 2011-05-18 北京智安邦科技有限公司 People counting method and device based on head recognition
CN103198323A (en) * 2013-03-12 2013-07-10 无锡慧眼电子科技有限公司 Pedestrian detection method based on curve fitting

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
应用于公交客流统计的机器视觉方法;于海滨等;《中国图象图形学报》;20080430;第716-722页

Also Published As

Publication number Publication date
CN105868697A (en) 2016-08-17

Similar Documents

Publication Publication Date Title
CN105868697B (en) A kind of quick number of people detection method and device
CN109819208B (en) Intensive population security monitoring management method based on artificial intelligence dynamic monitoring
CN108256459B (en) Security check door face recognition and face automatic library building algorithm based on multi-camera fusion
CN105518709B (en) The method, system and computer program product of face for identification
CN103984961B (en) A kind of image detecting method for being used to detect underbody foreign matter
US20140313345A1 (en) Flying object visual identification system
CN104166841B (en) The quick detection recognition methods of pedestrian or vehicle is specified in a kind of video surveillance network
JP6549797B2 (en) Method and system for identifying head of passerby
US9008365B2 (en) Systems and methods for pedestrian detection in images
CN102542289B (en) Pedestrian volume statistical method based on plurality of Gaussian counting models
CN108986064A (en) A kind of people flow rate statistical method, equipment and system
JP6397379B2 (en) CHANGE AREA DETECTION DEVICE, METHOD, AND PROGRAM
KR20200071799A (en) object recognition and counting method using deep learning artificial intelligence technology
KR101448391B1 (en) People counting system
Lei et al. End-to-end change detection using a symmetric fully convolutional network for landslide mapping
KR20160035121A (en) Method and Apparatus for Counting Entity by Using Location Information Extracted from Depth Image
KR101448392B1 (en) People counting method
CN107273799A (en) A kind of indoor orientation method and alignment system
CN106326851B (en) A kind of method of number of people detection
Ouma et al. Urban features recognition and extraction from very-high resolution multi-spectral satellite imagery: a micro–macro texture determination and integration framework
CN106056078A (en) Crowd density estimation method based on multi-feature regression ensemble learning
AU2020300066B2 (en) Systems and methods for determining actions performed by objects within images
CN105989615A (en) Pedestrian tracking method based on multi-feature fusion
CN109033999B (en) Subway charge platform based on face recognition
Gao Vehicle detection in wide-area aerial imagery: cross-association of detection schemes with post-processings

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220512

Address after: 100176 room 619b, block a, building 1, courtyard 19, Ronghua Middle Road, Beijing Economic and Technological Development Zone, Daxing District, Beijing

Patentee after: Beijing yunshang Zhiwei Technology Co.,Ltd.

Address before: Room 1520-1522, block A, Century Century Center, No. 8, West Beichen Road, Chaoyang District, Beijing,, Beichen

Patentee before: Beijing ICETech Science & Technology Co.,Ltd.

TR01 Transfer of patent right
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20160817

Assignee: Zhongguancun Technology Leasing Co.,Ltd.

Assignor: Beijing yunshang Zhiwei Technology Co.,Ltd.

Contract record no.: X2022980007184

Denomination of invention: A rapid head detection method and device

Granted publication date: 20190813

License type: Exclusive License

Record date: 20220606

EE01 Entry into force of recordation of patent licensing contract
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A rapid head detection method and device

Effective date of registration: 20220608

Granted publication date: 20190813

Pledgee: Zhongguancun Technology Leasing Co.,Ltd.

Pledgor: Beijing yunshang Zhiwei Technology Co.,Ltd.

Registration number: Y2022980007352

PE01 Entry into force of the registration of the contract for pledge of patent right
EC01 Cancellation of recordation of patent licensing contract

Assignee: Zhongguancun Technology Leasing Co.,Ltd.

Assignor: Beijing yunshang Zhiwei Technology Co.,Ltd.

Contract record no.: X2022980007184

Date of cancellation: 20231128

EC01 Cancellation of recordation of patent licensing contract
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20231127

Granted publication date: 20190813

Pledgee: Zhongguancun Technology Leasing Co.,Ltd.

Pledgor: Beijing yunshang Zhiwei Technology Co.,Ltd.

Registration number: Y2022980007352

PC01 Cancellation of the registration of the contract for pledge of patent right