CN113505671B - Machine vision-based carriage congestion degree determination method, system, device and medium - Google Patents

Machine vision-based carriage congestion degree determination method, system, device and medium Download PDF

Info

Publication number
CN113505671B
CN113505671B CN202110731689.5A CN202110731689A CN113505671B CN 113505671 B CN113505671 B CN 113505671B CN 202110731689 A CN202110731689 A CN 202110731689A CN 113505671 B CN113505671 B CN 113505671B
Authority
CN
China
Prior art keywords
image information
carriage
determining
contour
continuous
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
CN202110731689.5A
Other languages
Chinese (zh)
Other versions
CN113505671A (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.)
Guangdong Communications Polytechnic
Original Assignee
Guangdong Communications Polytechnic
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 Guangdong Communications Polytechnic filed Critical Guangdong Communications Polytechnic
Priority to CN202110731689.5A priority Critical patent/CN113505671B/en
Publication of CN113505671A publication Critical patent/CN113505671A/en
Application granted granted Critical
Publication of CN113505671B publication Critical patent/CN113505671B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a machine vision-based carriage congestion degree determination method, a machine vision-based carriage congestion degree determination system, a machine vision-based carriage congestion degree determination device and a machine vision-based carriage congestion degree determination medium, wherein the method comprises the following steps: acquiring first image information in a carriage; acquiring background image information in a carriage, acquiring foreground image information in the carriage according to the first image information and the background image information, and further performing image binarization processing, first-opening and second-closing operation and filtering processing on the foreground image information to acquire second image information; carrying out edge detection on the second image information to obtain a plurality of continuous contours, further carrying out random Hough transform on the continuous contours, and screening out the continuous contours which meet the preset threshold condition as head contours; the number of passengers in the carriage is determined according to the number of the head contours, and then the degree of congestion of the carriage is determined according to the number of the passengers and the area of the carriage. The invention improves the accuracy and efficiency of the detection of the carriage congestion degree, improves the space resource utilization rate of the subway carriage and the riding comfort of passengers, and can be widely applied to the technical field of image processing.

Description

Machine vision-based carriage congestion degree determination method, system, device and medium
Technical Field
The invention relates to the technical field of image processing, in particular to a method, a system, a device and a medium for determining the degree of carriage congestion based on machine vision.
Background
The subway as an urban rail vehicle can achieve the effects of reducing urban traffic jam and traffic pollution, has the advantages of high running speed, accurate running time, short train interval, large passenger capacity and the like, and becomes a preferred travel tool for most citizens. However, because the subway lines of most cities do not completely cover all corners of the cities at present, the passenger flow of the subway lines is large in the rush hour in the morning and evening, and the interior of subway carriages and platforms can be crowded, so certain public safety hazards also exist. The subway train has the advantages that the number of the carriages of the subway train is large, the platform is long, the doors for passengers to get on and off the carriages are random, and the passengers can not estimate the specific number of the carriages in advance, so that the phenomena that parts of the carriages are crowded and the carriages have vacant positions can be caused frequently, the number of the carriages is uneven, the space resources of the carriages of the subway train can not be reasonably utilized, and the riding comfort of the passengers is influenced.
The method comprises the steps of acquiring image frame data through a camera arranged in a carriage, inputting the image frame data into a people number detection model, and obtaining the predicted number of people in the carriage area shot by each camera.
Disclosure of Invention
The present invention aims to solve at least to some extent one of the technical problems existing in the prior art.
Therefore, an object of an embodiment of the present invention is to provide a carriage congestion degree determining method based on machine vision, which overcomes the influence of a large number of people in a carriage and a blocking phenomenon on the detection of the number of passengers through the acquisition of a top view in the carriage and the detection of a head profile, and improves the accuracy of the detection of the number of passengers, thereby improving the accuracy of the detection of the carriage congestion degree, and improving the efficiency of the detection of the carriage congestion degree without training a model in advance, and being capable of reminding the passengers to reasonably select a waiting carriage, thereby improving the space resource utilization rate of a subway carriage and the riding comfort of the passengers.
Another object of the embodiments of the present invention is to provide a car congestion degree determination system based on machine vision.
In order to achieve the technical purpose, the technical scheme adopted by the embodiment of the invention comprises the following steps:
in a first aspect, an embodiment of the present invention provides a machine vision-based method for determining a degree of congestion of a car, including the following steps:
acquiring first image information in a compartment, wherein the first image information is a top view in the compartment;
obtaining background image information in a carriage, obtaining foreground image information in the carriage according to the first image information and the background image information, and further performing image binarization processing, first-opening and second-closing operation and filtering processing on the foreground image information to obtain second image information;
carrying out edge detection on the second image information to obtain a plurality of continuous contours, further carrying out random Hough transform on the continuous contours, and screening out continuous contours which meet preset threshold conditions as head contours;
and determining the number of passengers in the carriage according to the number of the head contours, and further determining the degree of congestion of the carriage according to the number of the passengers and the area of the carriage.
Further, in an embodiment of the present invention, the step of obtaining foreground image information in a vehicle compartment according to the first image information and the background image information specifically includes:
and carrying out differential processing on the first image information and the background image information to obtain foreground image information in the carriage.
Further, in an embodiment of the present invention, the step of performing image binarization processing on the foreground image information specifically includes:
acquiring a preset first gray threshold;
setting the gray value of the pixel point with the gray value of the pixel point greater than the first gray threshold value in the foreground image information as 0, and setting the gray value of the pixel point with the gray value of the pixel point less than or equal to the first gray threshold value in the foreground image information as 255.
Further, in an embodiment of the present invention, the step of performing edge detection on the second image information to obtain a plurality of continuous contours, further performing random hough transform on the continuous contours, and screening out continuous contours that meet a preset threshold condition as a head contour specifically includes:
performing edge detection on the second image information through a Canny operator to obtain third image information, and determining a continuous contour in the third image information;
traversing and searching the third image information, and when the continuous contour is searched, performing random Hough transform on the continuous contour, determining whether the continuous contour is a circular contour, and determining the radius of the circular contour;
and when the radius of the circular contour meets a preset threshold condition, determining that the circular contour is a head contour.
Further, in an embodiment of the present invention, the step of performing a stochastic hough transform on the continuous contour, determining whether the continuous contour is a circular contour, and determining a radius of the circular contour specifically includes:
acquiring boundary points on the continuous contour, and constructing a boundary point set according to the boundary points;
randomly selecting three boundary points from the boundary point set, and solving corresponding first circle characteristic parameters;
selecting a preset circle characteristic parameter with an error lower than a preset second error threshold value from a plurality of preset circle characteristic parameters as a candidate circle characteristic parameter, and adding 1 to the count value of the candidate circle characteristic parameter;
repeating the steps until a preset cycle number is reached or the count value of the candidate circle characteristic parameter is equal to a preset third count threshold value;
when the number of corresponding boundary points on the circle determined by the candidate circle characteristic parameters is greater than a preset fourth number threshold, determining that the continuous contour is a circular contour;
and determining the radius of the circular contour according to the candidate circle characteristic parameters.
Further, in an embodiment of the present invention, the step of determining the number of passengers in the car according to the number of the head contours, and further determining the degree of congestion of the car according to the number of passengers and the area of the car specifically includes:
determining the number of passengers in the compartment according to the number of the head profiles;
and acquiring the area of the carriage, and calculating the number of passengers in the unit area of the carriage so as to determine the degree of congestion of the carriage.
In a second aspect, an embodiment of the present invention provides a car congestion degree determining system based on machine vision, including:
the first image information acquisition module is used for acquiring first image information in a carriage, and the first image information is a top view in the carriage;
the second image information determining module is used for acquiring background image information in the carriage, obtaining foreground image information in the carriage according to the first image information and the background image information, and further performing image binarization processing, first-opening and second-closing operation and filtering processing on the foreground image information to obtain second image information;
the head contour determining module is used for carrying out edge detection on the second image information to obtain a plurality of continuous contours, further carrying out random Hough transform on the continuous contours, and screening out the continuous contours which meet the preset threshold condition as head contours;
and the carriage congestion degree determining module is used for determining the number of passengers in the carriage according to the number of the head outlines, and further determining the carriage congestion degree according to the number of the passengers and the carriage area.
Further, in one embodiment of the present invention, the head contour determining module includes:
the first determining unit is used for carrying out edge detection on the second image information through a Canny operator to obtain third image information and determining a continuous contour in the third image information;
a second determining unit, configured to perform traversal search on the third image information, perform random hough transform on the continuous contour when the continuous contour is searched, determine whether the continuous contour is a circular contour, and determine a radius of the circular contour;
and the third determining unit is used for determining that the circular contour is the head contour when the radius of the circular contour meets a preset second threshold condition.
In a third aspect, an embodiment of the present invention provides a device for determining a degree of congestion of a car based on machine vision, including:
at least one processor;
at least one memory for storing at least one program;
when executed by the at least one processor, the at least one program causes the at least one processor to implement a machine vision-based congestion degree determination method as described above.
In a fourth aspect, the present invention further provides a computer-readable storage medium, in which a processor-executable program is stored, and the processor-executable program, when executed by a processor, is configured to perform the above-mentioned method for determining the degree of congestion of a car based on machine vision.
Advantages and benefits of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention:
according to the embodiment of the invention, the first image information of the overlook in the carriage is obtained, the foreground image extraction, the image binarization processing, the first opening and then closing operation and the filtering processing are carried out on the first image information to obtain the second image information, then the edge detection is carried out on the second image information to obtain a plurality of continuous contours, the continuous contours which are compounded with the preset threshold value condition are screened out through the random Hough transform to be used as the head contours, the number of passengers in the carriage is determined according to the number of the head contours, and therefore the carriage congestion degree can be obtained through calculation. According to the embodiment of the invention, through the acquisition of the top view in the carriage and the detection of the head contour, the influence of more people in the carriage and the shielding phenomenon on the passenger number detection is overcome, and the accuracy of the passenger number detection is improved, so that the accuracy of the carriage congestion degree detection is improved, a model does not need to be trained in advance, the efficiency of the carriage congestion degree detection is improved, passengers can be reminded to reasonably select a carriage for waiting, and the space resource utilization rate of a subway carriage and the riding comfort of the passengers are improved.
Drawings
In order to more clearly illustrate the technical solution in the embodiment of the present invention, the following description is made on the drawings required to be used in the embodiment of the present invention, and it should be understood that the drawings in the following description are only for convenience and clarity of describing some embodiments in the technical solution of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart illustrating steps of a method for determining a degree of congestion of a car based on machine vision according to an embodiment of the present invention;
fig. 2 is a block diagram of a machine vision-based car congestion degree determination system according to an embodiment of the present invention;
fig. 3 is a block diagram of a machine vision-based congestion degree determination apparatus according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention. The step numbers in the following embodiments are provided only for convenience of illustration, the order between the steps is not limited at all, and the execution order of each step in the embodiments can be adapted according to the understanding of those skilled in the art.
In the description of the present invention, the meaning of a plurality is two or more, if there is a description to the first and the second for the purpose of distinguishing technical features, it is not understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features or implicitly indicating the precedence of the indicated technical features. Furthermore, unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art.
Referring to fig. 1, an embodiment of the present invention provides a method for determining a degree of congestion of a car based on machine vision, which specifically includes the following steps:
s101, acquiring first image information in the vehicle compartment, wherein the first image information is a top view in the vehicle compartment.
Specifically, the plan view inside the vehicle compartment can be acquired by installing an image acquisition device on the roof of the vehicle compartment. The image acquisition device can adopt a high-definition camera and also can adopt an infrared thermal imager, and because the thermal fields of all parts of a human body are different, the number of passengers in the subway carriage can be accurately identified through thermal imaging pictures acquired by the infrared thermal imager.
S102, obtaining background image information in the carriage, obtaining foreground image information in the carriage according to the first image information and the background image information, and further performing image binarization processing, first-opening and second-closing operation and filtering processing on the foreground image information to obtain second image information.
Specifically, the background image information may be obtained by shooting an empty car in advance, and due to the dynamic change of the background in the car, the background may also be estimated and restored by the interframe information of the video sequence, for example, median background modeling: taking a continuous N-frame image sequence, arranging gray values of pixel points at corresponding positions in the N-frame image sequence from small to large, and then taking an intermediate value as a gray value of a corresponding pixel point in a background image; modeling a mean value method background: the pixel average value is taken for a plurality of continuous frames, the advantage is that the speed is high, and the disadvantage is that the pixel average value is sensitive to the change of environmental illumination and the change of a plurality of dynamic backgrounds; kalman filter model: the algorithm considers the background as a steady system, considers the foreground image as noise, and predicts the slowly-changing background image by using the appetite recursive low-pass filtering based on the Kalman filtering theory, so that the background can be continuously updated by using the foreground image, and the stability of the background can be maintained to eliminate the interference of the noise.
As a further optional implementation manner, the step of obtaining foreground image information in the vehicle compartment according to the first image information and the background image information specifically includes:
and carrying out difference processing on the first image information and the background image information to obtain foreground image information in the carriage.
Specifically, the formula of the differential processing of the first image information and the background image information is as follows:
f(x,y)=|c(x,y)-b(x,y)|
wherein c (x, y) is the gray value of the pixel (x, y) in the first image information, b (x, y) is the gray value of the pixel (x, y) in the background image information, and f (x, y) is the gray value of the pixel (x, y) in the foreground image information.
Further as an optional implementation manner, the step of performing image binarization processing on the foreground image information specifically includes:
acquiring a preset first gray threshold;
setting the gray value of the pixel point with the gray value of the pixel point greater than the first gray threshold value in the foreground image information as 0, and setting the gray value of the pixel point with the gray value of the pixel point less than or equal to the first gray threshold value in the foreground image information as 255.
Specifically, the formula of the image binarization processing is as follows:
Figure BDA0003139418320000061
wherein f (x, y) is the gray value of the pixel point (x, y) in the foreground image information, f1(x, y) represents the gray value of the pixel point (x, y) after the image binarization processing, and T represents the first gray threshold value.
In the embodiment of the invention, the opening operation refers to that the image is corroded and then expanded, so that small objects can be eliminated, the shape boundary is smooth, the area of the object is not changed, small particle noise can be removed, and adhesion among the objects is broken; the closed operation means that the image is expanded and then corroded, and the closed operation can be used for filling small cavities in objects, connecting adjacent objects, connecting disconnected contour lines, smoothing the boundary of the objects and keeping the area unchanged. The contour can be obvious by carrying out the operation of opening first and closing second on the image information after the image binarization processing, and the subsequent contour detection is convenient.
S103, carrying out edge detection on the second image information to obtain a plurality of continuous contours, further carrying out random Hough transform on the continuous contours, and screening out the continuous contours which meet the preset threshold condition as head contours.
Specifically, the image edge is a portion where the brightness change in the local area of the image is significant, and for a gray image, that is, an area where the gray value has a significant change, the gray value changes sharply from a gray value in a small buffer area to another gray value with a larger gray value difference. The embodiment of the invention adopts the Canny operator to carry out edge detection, improves the sensitivity to the head edge of a human body and can inhibit noise. Step S103 specifically includes the following steps:
s1031, performing edge detection on the second image information through a Canny operator to obtain third image information, and determining a continuous contour in the third image information;
s1032, traversing and searching the third image information, and when a continuous contour is searched, performing random Hough transform on the continuous contour, determining whether the continuous contour is a circular contour, and determining the radius of the circular contour;
and S1033, when the radius of the circular contour meets a preset threshold condition, determining that the circular contour is a head contour.
Specifically, traversing search is carried out on third image information extracted by a Canny operator, the ith independent continuous contour in the image is searched from the top left corner of the image in the sequence from top to bottom and from left to right, RHT (random Hough transform) is carried out on the continuous contour, straight lines, excessively small circles and circles with too close distances are removed, a circular contour with the radius of 8.0cm-10cm is screened, and the circular contour under the composite condition is the head contour of the personnel in the carriage.
As a further optional implementation manner, the step S1032 of performing a stochastic hough transform on the continuous contour, determining whether the continuous contour is a circular contour, and determining a radius of the circular contour specifically includes:
s10321, obtaining boundary points on the continuous contour, and constructing a boundary point set according to the boundary points;
s10322, randomly selecting three boundary points from the boundary point set, and solving corresponding first circle characteristic parameters;
s10323, selecting a preset circle feature parameter having an error lower than a preset second error threshold from the plurality of preset circle feature parameters as a candidate circle feature parameter, and adding 1 to a count value of the candidate circle feature parameter;
s10324, repeating the steps until the preset cycle number or the count value of the candidate circle characteristic parameter is equal to a preset third count threshold value;
s10325, when the number of the corresponding boundary points on the circle determined by the candidate circle characteristic parameters is larger than a preset fourth number threshold, determining that the continuous contour is a circular contour;
and S10326, determining the radius of the circular contour according to the candidate circle characteristic parameters.
Specifically, the RHT transform is performed on the ith independent continuous contour, and the specific process is as follows:
(1) constructing a set D of boundary points of the ith continuous contouriInitializing a parameter unit value P as NULL, and setting the cycle number k as 0;
(2) from DiIn the random selection of three points d1、d2、d3
(3) Solving the circle characteristic parameter p through three points, if a solution exists, turning to (4), and if no solution exists, turning to (7);
(4) finding P in PcSatisfy | | p-pcIf | < delta, turning to (6) if found, otherwise turning to (5);
(5) inserting P into P, setting the corresponding count value as 1, and rotating (7);
(6) p is to becAdds 1 to the count value of (1), and if the count value is less than a specified threshold value N, the operation is carried out(7) Otherwise, turning to (8);
(7) k is k +1, if k > kmaxEnding, otherwise, turning to (2);
(8)pc(a, b, r) is a candidate circle characteristic parameter, if the parameter corresponds to the number M of contour points of the circle, which is more than MminAnd the radius r value is 8.0cm-10cm, turn (9);
(9)pc(a, b, r) are true circle parameters, which are marked and placed in the head contour group A [ n ]]。
Where δ represents the second error threshold, N represents the third count threshold, kmaxFor detecting the maximum number of cycles of sampling allowed during a circle, MminThe minimum number of boundary points required for the circle, namely the fourth number threshold, is generally set to be 2 pi R alpha, alpha is a fixed coefficient and ranges from 0 to 1, R represents the radius of the circle determined by the candidate circle characteristic parameter, and m is the number of boundary points of the continuous contour falling on the circle determined by the candidate circle characteristic parameter.
The embodiment of the invention carries out random Hough transform on the independent continuous contour after the edge processing of the image to detect the head contour, and the method has high identification efficiency, high speed and wide application range.
And S104, determining the number of passengers in the carriage according to the number of the head contours, and further determining the degree of congestion of the carriage according to the number of the passengers and the area of the carriage.
Specifically, the number of passengers and the degree of congestion of the carriage determined by the embodiment of the invention can be transmitted to the next station in real time and displayed at the elevator, the escalator and the shielding door, so that the passengers can be reminded to reasonably select the carriage. Step S104 specifically includes the following steps:
s1041, determining the number of passengers in the compartment according to the number of the head outlines;
s1042, obtaining the area of the carriage, and calculating the number of passengers in the unit area of the carriage so as to determine the degree of congestion of the carriage.
Specifically, the number of passengers in the carriage can be determined by the number of the head contours in the head contour group A [ n ], and the number of passengers in the unit carriage area, namely the carriage congestion degree, can be calculated by combining the carriage area acquired in advance.
It can be understood that corresponding guide information can be generated according to the obtained carriage crowding degree of each carriage, and the guide information is transmitted to each subway shielded door to be displayed, so that subway passengers can be reminded to reasonably select a waiting carriage, the subway carriage crowding degree is reduced, the space resource utilization rate of the subway carriage is improved, and the riding efficiency and riding comfort of the subway passengers are improved.
The method steps of the embodiments of the present invention are described above. The method and the device have the advantages that through the acquisition of the top view in the carriage and the detection of the head outline, the influence of more people in the carriage and the shielding phenomenon on the detection of the number of passengers is overcome, the accuracy of the detection of the number of the passengers is improved, the accuracy of the detection of the congestion degree of the carriage is improved, the model does not need to be trained in advance, the efficiency of the detection of the congestion degree of the carriage is improved, the passengers can be reminded to reasonably select the carriage for waiting, and the space resource utilization rate of the subway carriage and the riding comfort degree of the passengers are improved.
Referring to fig. 2, an embodiment of the present invention provides a machine vision-based car congestion degree determining system, including:
the first image information acquisition module is used for acquiring first image information in the carriage, and the first image information is a top view in the carriage;
the second image information determining module is used for acquiring background image information in the carriage, acquiring foreground image information in the carriage according to the first image information and the background image information, and further performing image binarization processing, first-opening and second-closing operation and filtering processing on the foreground image information to acquire second image information;
the head contour determining module is used for carrying out edge detection on the second image information to obtain a plurality of continuous contours, further carrying out random Hough transform on the continuous contours, and screening out the continuous contours which meet the preset threshold condition as head contours;
and the carriage congestion degree determining module is used for determining the number of passengers in the carriage according to the number of the head outlines, and further determining the carriage congestion degree according to the number of the passengers and the carriage area.
As a further optional embodiment, the head contour determination module comprises:
the first determining unit is used for carrying out edge detection on the second image information through a Canny operator to obtain third image information and determining a continuous contour in the third image information;
the second determining unit is used for performing traversal search on the third image information, performing random Hough transform on the continuous contour when the continuous contour is searched, determining whether the continuous contour is a circular contour or not, and determining the radius of the circular contour;
and the third determining unit is used for determining the circular contour as the head contour when the radius of the circular contour meets a preset second threshold condition.
The contents in the above method embodiments are all applicable to the present system embodiment, the functions specifically implemented by the present system embodiment are the same as those in the above method embodiment, and the beneficial effects achieved by the present system embodiment are also the same as those achieved by the above method embodiment.
Referring to fig. 3, an embodiment of the present invention provides a device for determining a degree of congestion of a car based on machine vision, including:
at least one processor;
at least one memory for storing at least one program;
when the at least one program is executed by the at least one processor, the at least one program causes the at least one processor to implement the method for determining congestion degree of a car based on machine vision.
The contents in the above method embodiments are all applicable to the present apparatus embodiment, the functions specifically implemented by the present apparatus embodiment are the same as those in the above method embodiments, and the advantageous effects achieved by the present apparatus embodiment are also the same as those achieved by the above method embodiments.
Embodiments of the present invention also provide a computer-readable storage medium, in which a program executable by a processor is stored, and the program executable by the processor is used for executing the above-mentioned car congestion degree determination method based on machine vision.
The computer-readable storage medium of the embodiment of the invention can execute the machine vision-based carriage congestion degree determination method provided by the embodiment of the method of the invention, can execute any combination of the implementation steps of the embodiment of the method, and has corresponding functions and beneficial effects of the method.
The embodiment of the invention also discloses a computer program product or a computer program, which comprises computer instructions, and the computer instructions are stored in a computer readable storage medium. The computer instructions may be read by a processor of a computer device from a computer-readable storage medium, and executed by the processor to cause the computer device to perform the method illustrated in fig. 1.
In alternative embodiments, the functions/acts noted in the block diagrams may occur out of the order noted in the operational illustrations. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality/acts involved. Furthermore, the embodiments presented and described in the flow charts of the present invention are provided by way of example in order to provide a more thorough understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and in which sub-operations described as part of larger operations are performed independently.
Furthermore, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the above-described functions and/or features may be integrated in a single physical device and/or software module, or one or more of the functions and/or features may be implemented in a separate physical device or software module. It will also be appreciated that a detailed discussion of the actual implementation of each module is not necessary for an understanding of the present invention. Rather, the actual implementation of the various functional modules in the apparatus disclosed herein will be understood within the ordinary skill of an engineer, given the nature, function, and internal relationship of the modules. Accordingly, those skilled in the art can, using ordinary skill, practice the invention as set forth in the claims without undue experimentation. It is also to be understood that the specific concepts disclosed are merely illustrative of and not intended to limit the scope of the invention, which is defined by the appended claims and their full scope of equivalents.
The above functions, if implemented in the form of software functional units and sold or used as a separate product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the above method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Further, the computer readable medium could even be paper or another suitable medium upon which the above described program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the foregoing description of the specification, reference to the description of "one embodiment/example," "another embodiment/example," or "certain embodiments/examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
While the preferred embodiments of the present invention have been illustrated and described, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (7)

1. A machine vision-based carriage congestion degree determination method is characterized by comprising the following steps:
acquiring first image information in a compartment, wherein the first image information is a top view in the compartment;
obtaining background image information in a carriage, obtaining foreground image information in the carriage according to the first image information and the background image information, and further performing image binarization processing, first-opening and second-closing operation and filtering processing on the foreground image information to obtain second image information;
carrying out edge detection on the second image information to obtain a plurality of continuous contours, further carrying out random Hough transform on the continuous contours, and screening out continuous contours which meet preset threshold conditions as head contours;
determining the number of passengers in the carriage according to the number of the head outlines, and further determining the degree of congestion of the carriage according to the number of the passengers and the area of the carriage;
the step of performing edge detection on the second image information to obtain a plurality of continuous contours, further performing random hough transform on the continuous contours, and screening out continuous contours which meet a preset threshold condition as head contours specifically includes:
performing edge detection on the second image information through a Canny operator to obtain third image information, and determining a continuous contour in the third image information;
traversing and searching the third image information, and when the continuous contour is searched, performing random Hough transform on the continuous contour, determining whether the continuous contour is a circular contour, and determining the radius of the circular contour;
when the radius of the circular contour meets a preset threshold condition, determining that the circular contour is a head contour;
the step of performing a stochastic hough transform on the continuous contour, determining whether the continuous contour is a circular contour, and determining a radius of the circular contour specifically includes:
acquiring boundary points on the continuous contour, and constructing a boundary point set according to the boundary points;
randomly selecting three boundary points from the boundary point set, and solving corresponding first circle characteristic parameters;
selecting a preset circle characteristic parameter with an error lower than a preset second error threshold value from a plurality of preset circle characteristic parameters as a candidate circle characteristic parameter, and adding 1 to the count value of the candidate circle characteristic parameter;
repeating the steps until a preset cycle number is reached or the count value of the candidate circle characteristic parameter is equal to a preset third count threshold value;
when the number of corresponding boundary points on the circle determined by the candidate circle characteristic parameters is greater than a preset fourth number threshold, determining that the continuous contour is a circular contour;
and determining the radius of the circular contour according to the candidate circle characteristic parameters.
2. The method for determining the degree of congestion of a car based on machine vision according to claim 1, wherein the step of obtaining foreground image information in the car based on the first image information and the background image information comprises:
and carrying out differential processing on the first image information and the background image information to obtain foreground image information in the carriage.
3. The method for determining the degree of congestion of a car based on machine vision according to claim 1, wherein the step of performing image binarization processing on the foreground image information specifically comprises:
acquiring a preset first gray threshold;
setting the gray value of the pixel point with the gray value of the pixel point greater than the first gray threshold value in the foreground image information as 0, and setting the gray value of the pixel point with the gray value of the pixel point less than or equal to the first gray threshold value in the foreground image information as 255.
4. The machine vision-based car congestion degree determination method according to any one of claims 1 to 3, wherein the step of determining the number of passengers in the car according to the number of the head contours and further determining the car congestion degree according to the number of passengers and the car area specifically comprises:
determining the number of passengers in the compartment according to the number of the head profiles;
and acquiring the area of the carriage, and calculating the number of passengers in the unit area of the carriage so as to determine the degree of congestion of the carriage.
5. A machine vision-based congestion degree determination system for a vehicle cabin, comprising:
the first image information acquisition module is used for acquiring first image information in a carriage, and the first image information is a top view in the carriage;
the second image information determining module is used for acquiring background image information in the carriage, obtaining foreground image information in the carriage according to the first image information and the background image information, and further performing image binarization processing, first-opening and second-closing operation and filtering processing on the foreground image information to obtain second image information;
the head contour determining module is used for carrying out edge detection on the second image information to obtain a plurality of continuous contours, further carrying out random Hough transform on the continuous contours, and screening out the continuous contours which meet the preset threshold condition as head contours;
the carriage congestion degree determining module is used for determining the number of passengers in the carriage according to the number of the head outlines, and further determining the carriage congestion degree according to the number of the passengers and the carriage area;
the head contour determination module comprises:
the first determining unit is used for carrying out edge detection on the second image information through a Canny operator to obtain third image information and determining a continuous contour in the third image information;
a second determining unit, configured to perform traversal search on the third image information, perform random hough transform on the continuous contour when the continuous contour is searched, determine whether the continuous contour is a circular contour, and determine a radius of the circular contour;
the third determining unit is used for determining the circular contour to be a head contour when the radius of the circular contour meets a preset second threshold condition;
the step of performing a stochastic hough transform on the continuous contour, determining whether the continuous contour is a circular contour, and determining a radius of the circular contour specifically includes:
acquiring boundary points on the continuous contour, and constructing a boundary point set according to the boundary points;
randomly selecting three boundary points from the boundary point set, and solving corresponding first circle characteristic parameters;
selecting a preset circle characteristic parameter with an error lower than a preset second error threshold value from a plurality of preset circle characteristic parameters as a candidate circle characteristic parameter, and adding 1 to the count value of the candidate circle characteristic parameter;
repeating the steps until a preset cycle number is reached or the count value of the candidate circle characteristic parameter is equal to a preset third count threshold value;
when the number of corresponding boundary points on the circle determined by the candidate circle characteristic parameters is greater than a preset fourth number threshold, determining that the continuous contour is a circular contour;
and determining the radius of the circular contour according to the candidate circle characteristic parameters.
6. A machine vision-based device for determining a degree of congestion in a vehicle cabin, comprising:
at least one processor;
at least one memory for storing at least one program;
when executed by the at least one processor, cause the at least one processor to implement a machine vision-based congestion degree determination method as claimed in any one of claims 1 to 4.
7. A computer readable storage medium in which a processor-executable program is stored, the processor-executable program when executed by a processor being configured to perform a machine vision based congestion degree determination method according to any one of claims 1 to 4.
CN202110731689.5A 2021-06-29 2021-06-29 Machine vision-based carriage congestion degree determination method, system, device and medium Active CN113505671B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110731689.5A CN113505671B (en) 2021-06-29 2021-06-29 Machine vision-based carriage congestion degree determination method, system, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110731689.5A CN113505671B (en) 2021-06-29 2021-06-29 Machine vision-based carriage congestion degree determination method, system, device and medium

Publications (2)

Publication Number Publication Date
CN113505671A CN113505671A (en) 2021-10-15
CN113505671B true CN113505671B (en) 2022-03-22

Family

ID=78011019

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110731689.5A Active CN113505671B (en) 2021-06-29 2021-06-29 Machine vision-based carriage congestion degree determination method, system, device and medium

Country Status (1)

Country Link
CN (1) CN113505671B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113807795A (en) * 2021-10-19 2021-12-17 上海擎朗智能科技有限公司 Method for identifying congestion in robot distribution scene, robot and distribution system
CN114559980B (en) * 2022-01-06 2024-01-12 承德石油高等专科学校 Train information identification method and train information identification system
CN115447924A (en) * 2022-09-05 2022-12-09 广东交通职业技术学院 Machine vision-based garbage classification and sorting method, system, device and medium
CN115588298B (en) * 2022-10-28 2023-12-29 广州地铁集团有限公司 Urban rail passenger flow broadcasting induction method based on machine vision

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101826228B (en) * 2010-05-14 2012-05-30 上海理工大学 Detection method of bus passenger moving objects based on background estimation
US9013264B2 (en) * 2011-03-12 2015-04-21 Perceptive Devices, Llc Multipurpose controller for electronic devices, facial expressions management and drowsiness detection
CN103077617B (en) * 2012-12-24 2015-11-04 南京航空航天大学 Based on crossing intelligent traffic light supervisory systems and the method for computer vision
CN108960133B (en) * 2018-07-02 2022-01-11 京东方科技集团股份有限公司 Passenger flow monitoring method, electronic device, system and storage medium

Also Published As

Publication number Publication date
CN113505671A (en) 2021-10-15

Similar Documents

Publication Publication Date Title
CN113505671B (en) Machine vision-based carriage congestion degree determination method, system, device and medium
CN107766821B (en) Method and system for detecting and tracking full-time vehicle in video based on Kalman filtering and deep learning
CN103985182B (en) A kind of bus passenger flow automatic counting method and automatic counter system
Rad et al. Real time classification and tracking of multiple vehicles in highways
US9449236B2 (en) Method for object size calibration to aid vehicle detection for video-based on-street parking technology
CN103207988B (en) A kind of image-recognizing method and device
KR101067437B1 (en) Lane detection method and Detecting system using the same
CN104077757B (en) Road background extraction and updating method with fusion of real-time traffic state information
CN112330593A (en) Building surface crack detection method based on deep learning network
CN112465706A (en) Automatic gate container residual inspection method
CN111709341B (en) Method and system for detecting operation state of passenger elevator car
CN111476804A (en) Method, device and equipment for efficiently segmenting carrier roller image and storage medium
CN111523385B (en) Stationary vehicle detection method and system based on frame difference method
CN115841633A (en) Power tower and power line associated correction power tower and power line detection method
CN110889347B (en) Density traffic flow counting method and system based on space-time counting characteristics
CN105095851A (en) Steel coil position identification method
JP2007164375A (en) Three-dimensional object detection device and method, computer readable medium and three-dimensional object management system
CN108154687A (en) A kind of night traffic flow detecting method, apparatus and system based on car light
CN107316313A (en) Scene Segmentation and equipment
CN109941856B (en) Elevator control method and device
Shaweddy et al. Vehicle counting framework for intelligent traffic monitoring system
CN111814559A (en) Parking state identification method and system
WO2024017413A2 (en) Method and apparatus for port entry/exit detection of vehicle, device, and storage medium
TWI828368B (en) Method and system for detecting aircraft behavior on the tarmac
CN112446293B (en) Video detection method for track pollution event of highway pavement

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant