Method for counting number of people in designated area in classroom and method for counting number of people in classroom

By dividing and close-up shots of the large classroom area, combining the comparison of face feature data and deduplication of preset rules, the problems of insufficient clarity and overlapping occlusion in the large classroom are solved, and the effect of accurately counting the number of people in the classroom is achieved.

CN119888820APending Publication Date: 2025-04-25GUANGZHOU AVA ELECTRONICS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411978529.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

When using panoramic cameras to count students' attendance in large classrooms, the portrait clarity of the students in the back row is insufficient, resulting in low accuracy of the artificial intelligence algorithm, and the number of people in the back row is overlapping and obstructing, and some people cannot be photographed by the camera.

Method used

The classroom area is predivided into multiple sub-regions and each sub-region is photographed close-up to obtain the pictures to be analyzed. Then, each sub-region is compared with the facial feature data, and after deduplication, the actual number of people in each sub-region is calculated according to the preset rules, and they are added to obtain the total number of people in the classroom.

Benefits of technology

It improves portrait clarity, enhances the accuracy of artificial intelligence algorithms, reduces the number of repeated comparisons, saves computing power, and accurately counts the total number of people in the classroom.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119888820A_ABST
    Figure CN119888820A_ABST
Patent Text Reader

Abstract

The invention discloses a method for counting the number of people in a designated area in a classroom. The method for counting the number of people in the designated area in the classroom comprises the steps of obtaining the number of people in a to-be-analyzed picture of a current sub-area; obtaining feature data of all faces of the to-be-analyzed picture in the current sub-region, and feature data of all faces of the to-be-analyzed picture in the sub-region associated with the current sub-region; according to the feature data of all the faces of the to-be-analyzed picture in the current sub-region and the feature data of all the faces of the to-be-analyzed picture in the sub-region associated with the current sub-region, obtaining repeated figures; and on the basis of a preset rule, according to the repeated figures and the number of figures in the to-be-analyzed picture of the current sub-region, obtaining the actual number of figures in the current sub-region. According to the method, the problem of insufficient portrait definition is solved through close-up shooting, and when repeated close-up figures are removed, the searching and comparing times are reduced, and the computing power is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent image recognition, and more specifically, to a method for counting the number of people in a designated area in a classroom, a method, a device, a equipment and a storage medium for counting the number of people in a classroom. Background Art

[0002] With the continuous development of intelligent image recognition technology, the method of using image recognition technology to count the number of students in attendance has been widely used in college teaching scenarios. In higher education scenarios, when counting the number of students in attendance, the traditional solution is to use a panoramic camera (usually a wide-angle panoramic camera) to take a panoramic picture of the students, and use artificial intelligence algorithms such as head recognition and human shape recognition to automatically count the number of students in the area, thereby counting the number of students in attendance.

[0003] However, in many cases, large classrooms are used for teaching in colleges and universities. When the above method of counting student attendance is used in a large classroom, the following problems may occur:

[0004] 1. The classroom is large, and the portraits of students in the back row are not clear enough in the panoramic view, resulting in low accuracy of artificial intelligence algorithms such as head recognition or human shape recognition;

[0005] 2. The classroom space is large, and there is a lot of overlap and obstruction among the students in the back row, which results in some people not being captured by the panoramic camera. Summary of the invention

[0006] In order to overcome the above-mentioned defects of the existing method for counting student attendance, the present invention provides a method for counting the number of people in a designated area in a classroom, a method, device, equipment and storage medium for counting the number of people in a classroom. The technical solution adopted by the present invention is as follows.

[0007] In a first aspect, the present invention provides a method for counting the number of people in a designated area in a classroom, comprising:

[0008] Obtain the number of people in the image to be analyzed in the current sub-area, wherein the classroom area is pre-divided into several sub-areas, and each sub-area is photographed in close-up to obtain the image to be analyzed of each sub-area;

[0009] Acquire feature data of all faces in the picture to be analyzed in the current sub-region, and feature data of all faces in the picture to be analyzed in the sub-region associated with the current sub-region;

[0010] Obtaining repeated persons according to the feature data of all faces of the pictures to be analyzed in the current sub-region and the feature data of all faces of the pictures to be analyzed in the sub-region associated with the current sub-region;

[0011] Based on preset rules, the actual number of people in the current sub-area is obtained according to the repeated people and the number of people in the picture to be analyzed in the current sub-area, wherein the preset rules are used to determine whether the repeated people are included in the actual number of people in the current sub-area.

[0012] In one implementation, the sub-region associated with the current sub-region is a sub-region adjacent to the current sub-region.

[0013] In one embodiment, before obtaining repeated persons based on the feature data of all faces of the pictures to be analyzed in the current sub-region and the feature data of all faces of the pictures to be analyzed in the sub-region associated with the current sub-region, the method further includes:

[0014] Determine whether there is data of a person repeated between the picture to be analyzed in the current sub-region and the picture to be analyzed in the sub-region associated with the current sub-region in the database;

[0015] When the data of the repeated person exists in the database, the repeated person is obtained by using the data of the repeated person.

[0016] In a second aspect, the present invention provides a method for counting the number of people in a classroom, comprising:

[0017] By cruising, close-up photos are taken of each pre-divided sub-area of ​​the classroom area to obtain the pictures to be analyzed of each sub-area;

[0018] The actual number of people in each sub-area is obtained by using the method for counting the number of people in a designated area of ​​the classroom as described in any of the above embodiments;

[0019] Add up the actual number of people in each sub-area to get the total number of people in the classroom.

[0020] In one embodiment, it further includes:

[0021] In the process of obtaining the actual number of people in each sub-area by the method of counting the number of people in a designated area in the classroom as described in any of the previous embodiments, when the number of repeated people exceeds a first threshold, close-up photos are taken of each pre-divided sub-area of ​​the classroom area again by cruising to obtain pictures to be analyzed of each sub-area, and the actual number of people in each sub-area is obtained again by the method of counting the number of people in a designated area in the classroom as described in any of the previous embodiments.

[0022] In one embodiment, it further includes:

[0023] Calculate the sum of the numbers of repeated persons in the process of obtaining the actual number of persons in each sub-area by the method for counting the number of persons in a designated area of ​​a classroom as described in any of the above embodiments, and obtain the total number of repeated persons counted;

[0024] When the total number of repeated people counted exceeds the second threshold, close-up photos are taken of each pre-divided sub-area of ​​the classroom area again by cruising to obtain pictures to be analyzed in each sub-area, and the actual number of people in each sub-area is obtained again by the method of counting the number of people in a designated area in the classroom as described in any of the previous embodiments.

[0025] In a third aspect, the present invention provides a method for counting the number of people in a classroom, characterized by comprising:

[0026] Obtaining images to be analyzed of each sub-area of ​​the classroom area, wherein the classroom area is pre-divided into a number of sub-areas, and each sub-area is photographed in close-up to obtain images to be analyzed of each sub-area;

[0027] Counting the number of people in the to-be-analyzed pictures in each sub-region to obtain a preliminary count of the number of people, and calculating the preliminary count of the total number of people;

[0028] The number of repeated people in each sub-area is obtained by a preset method of counting the number of people in a designated area in the classroom;

[0029] The total number of people in the classroom is obtained by subtracting the number of repeated people in each sub-area from the total number of people counted initially;

[0030] The preset method for counting the number of people in a designated area in a classroom includes:

[0031] Acquire feature data of all faces in the picture to be analyzed in the current sub-region, and feature data of all faces in the picture to be analyzed in the sub-region associated with the current sub-region;

[0032] Obtaining repeated persons according to the feature data of all faces of the pictures to be analyzed in the current sub-region and the feature data of all faces of the pictures to be analyzed in the sub-region associated with the current sub-region;

[0033] Based on the preset rules, the number of repeated characters in the current sub-area is obtained.

[0034] In one embodiment, it further includes:

[0035] When the number of repeated persons in one of the sub-areas exceeds the first threshold, another group of images to be analyzed including all the sub-areas of the classroom area is obtained again, and the total number of persons in the classroom is counted again.

[0036] In one embodiment, it further includes:

[0037] Calculate the sum of the number of repeated characters in each sub-area to obtain the total number of repeated characters;

[0038] When the total number of repeated persons counted exceeds the second threshold, another group of images to be analyzed including all sub-areas of the classroom area is obtained again, and the total number of persons in the classroom is counted again.

[0039] In a fourth aspect, the present invention provides a device for counting the number of people in a designated area in a classroom, characterized in that it comprises:

[0040] An acquisition module is used to acquire the number of people in the picture to be analyzed in the current sub-region, acquire the feature data of all faces in the picture to be analyzed in the current sub-region, and acquire the feature data of all faces in the picture to be analyzed in the sub-region associated with the current sub-region, wherein the classroom area is pre-divided into several sub-regions, and each sub-region is photographed in close-up to obtain the picture to be analyzed of each sub-region;

[0041] A comparison module, used for obtaining repeated persons according to the feature data of all faces of the pictures to be analyzed in the current sub-region and the feature data of all faces of the pictures to be analyzed in the sub-regions associated with the current sub-region;

[0042] The analysis module is used to obtain the actual number of people in the current sub-area based on preset rules, according to the repeated people and the number of people in the picture to be analyzed in the current sub-area, wherein the preset rules are used to determine whether the repeated people are included in the actual number of people in the current sub-area.

[0043] In a fifth aspect, the present invention provides a device for counting the number of people in a classroom, characterized in that it comprises:

[0044] A shooting module is used to take close-up photos of each pre-divided sub-area of ​​the classroom area by cruising to obtain pictures to be analyzed of each sub-area;

[0045] An acquisition module, used to obtain the actual number of people in each sub-area through the aforementioned device for counting the number of people in a designated area in the classroom;

[0046] The calculation module is used to add up the actual number of people in each sub-area to obtain the total number of people in the classroom.

[0047] In a sixth aspect, the present invention provides a device for counting the number of people in a classroom, characterized in that it comprises:

[0048] An acquisition module is used to acquire the images to be analyzed of each sub-area of ​​the classroom area, wherein the classroom area is pre-divided into a number of sub-areas, and each sub-area is photographed in close-up to obtain the images to be analyzed of each sub-area;

[0049] A statistical module is used to count the number of people in the pictures to be analyzed in each sub-area, obtain a preliminary number of people, and calculate a preliminary total number of people;

[0050] A screening module, used to obtain the number of repeated persons in each sub-area through a preset device for counting the number of persons in a designated area in the classroom;

[0051] A calculation module, used for obtaining the total number of people in the classroom by subtracting the number of repeated people in each sub-area from the total number of people counted initially;

[0052] The preset device for counting the number of people in a designated area in the classroom includes:

[0053] A receiving module, used to obtain feature data of all faces in the image to be analyzed in the current sub-region, and feature data of all faces in the image to be analyzed in the sub-region associated with the current sub-region;

[0054] A comparison module, used for obtaining repeated persons according to the feature data of all faces of the pictures to be analyzed in the current sub-region and the feature data of all faces of the pictures to be analyzed in the sub-regions associated with the current sub-region;

[0055] The analysis module is used to obtain the number of repeated characters in the current sub-area based on preset rules.

[0056] In a seventh aspect, the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-mentioned methods when executing the program.

[0057] In an eighth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, the method of any of the above-mentioned embodiments is implemented.

[0058] In the present invention, in the process of counting the number of people, close-up photos of students are taken by cruising to solve the problem of insufficient portrait clarity; when counting the number of people and removing duplicate people, association is performed between the sub-areas to reduce the number of times of searching for duplicate people and comparing, thereby saving computing power; on the one hand, only adjacent sub-areas that may have intersections are associated, and when comparing, there is no need to compare with sub-areas that may not have intersections, thereby reducing the number of comparisons; on the other hand, preset rules are matched with associated sub-areas to reduce the number of associated sub-areas, and reducing the associated sub-areas naturally reduces the number of comparisons. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 It is a schematic diagram of the overall process of the first embodiment of the present invention.

[0060] Figure 2 It is a schematic diagram of a sub-region layout method according to the first embodiment of the present invention.

[0061] Figure 3 It is a schematic diagram of a flow chart of an implementation method of the first embodiment of the present invention.

[0062] Figure 4 It is a schematic diagram of an overall flow chart of the second embodiment of the present invention.

[0063] Figure 5 It is a schematic diagram of a flow chart of an implementation method of the second embodiment of the present invention.

[0064] Figure 6 It is a schematic diagram of the overall structure of an implementation method of Example 2 of the present invention.

[0065] Figure 7 It is a partial structural diagram of an implementation method of the second embodiment of the present invention.

[0066] Figure 8 It is a schematic diagram of the overall structure of another implementation method of Example 2 of the present invention. DETAILED DESCRIPTION

[0067] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0068] It should be noted that the terms "first\second\..." involved in the embodiments of the present invention are only used to distinguish similar objects, and do not represent a specific order for the objects. It is understandable that the specific order or sequence of "first\second\..." can be interchanged where permitted. It should be understood that the objects distinguished by "first\second\..." can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein.

[0069] Embodiment 1

[0070] See also Figure 1 , Figure 1 1 is a flow chart of a method for counting the number of people in a classroom provided in the first embodiment of the present invention, the method comprising step S110, step S120 and step S130. It should be noted that step S110, step S120 and step S130 are only reference numerals for clarifying the embodiment and the appendix. Figure 1 The corresponding relationship does not limit the order of the steps in this embodiment.

[0071] Step S110, taking close-up photos of each pre-divided sub-area of ​​the classroom area by cruising, and obtaining a picture to be analyzed of each sub-area;

[0072] Step S120, obtaining the actual number of people in each sub-area by a preset method of counting the number of people in a designated area in the classroom;

[0073] Step S130, adding up the actual number of people in each sub-area to obtain the total number of people in the classroom.

[0074] like Figure 2 As shown, the classroom area is pre-divided into several sub-areas. Figure 2 In the figure, each dotted box represents a sub-region. Figure 2 The image of each sub-area is captured by close-up, and the image to be analyzed of each sub-area is obtained. Because the image of each sub-area is captured by close-up, the effective clarity of the portrait in the image of each sub-area is relatively high, which is conducive to improving the accuracy of the analysis process.

[0075] In step S120, the actual number of people in each sub-area is obtained by analyzing and counting the pictures in each sub-area. Specifically, the actual number of people in each sub-area is obtained by a preset method of counting the number of people in a designated area in the classroom, such as Figure 3 As shown, the preset method for counting the number of people in a designated area in a classroom includes: step S210, step S220, step S230 and step S240.

[0076] Step S210, obtaining the number of people in the picture to be analyzed in the current sub-area, wherein the classroom area is pre-divided into several sub-areas, and each sub-area is photographed in close-up to obtain the picture to be analyzed of each sub-area;

[0077] Step S220, acquiring feature data of all faces in the image to be analyzed in the current sub-region, and feature data of all faces in the image to be analyzed in the sub-region associated with the current sub-region;

[0078] Step S230, obtaining repeated persons according to the feature data of all faces of the pictures to be analyzed in the current sub-region and the feature data of all faces of the pictures to be analyzed in the sub-regions associated with the current sub-region;

[0079] Step S240, based on preset rules, the actual number of people in the current sub-area is obtained according to the repeated people and the number of people in the picture to be analyzed in the current sub-area, wherein the preset rules are used to determine whether the repeated people are included in the actual number of people in the current sub-area.

[0080] Since the pictures to be analyzed in each sub-area are obtained by cruising, it is inevitable that the same person will be repeatedly photographed in adjacent sub-areas during the shooting process, that is, the same person A is photographed in the pictures to be analyzed in sub-areas 1 and 2 at the same time. At this time, the statistical data will be distorted, and the number of people counted will be greater than the total number of people. Therefore, after obtaining the number of people in each sub-area, it is necessary to perform a deduplication operation to obtain the final actual number of people. The current deduplication operation almost always finds out the specific person by comparing each area two by two. However, the more times the comparison is made, the more resources are occupied. The preset method of counting the number of people in a specified area in the classroom is proposed for the above situation. It solves the technical problem of occupying a lot of resources by reducing the number of comparisons.

[0081] In step S210 of the method for counting the number of people in a designated area of ​​a classroom, the number of people in the image to be analyzed in the current sub-area is first obtained, and the number of people counted is obtained. Then in step S220, the feature data of all faces in the image to be analyzed in the current sub-area and the feature data of all faces in the image to be analyzed in the sub-area associated with the current sub-area are obtained. In this method, each sub-area is associated with its related sub-areas in advance. These related sub-areas are generally the sub-areas adjacent to it, for example, in Figure 2In the example, the sub-regions associated with sub-region 1 are regions 2, 4, and 5, the sub-regions associated with sub-region 2 are regions 3, 4, 5, and 6, and the sub-regions associated with sub-region 3 are regions 5 and 6. After obtaining the feature data of all faces in the current sub-region and the sub-regions associated with it, step S230 compares the feature data of these faces. When the similarity of the feature data of a face is greater than a certain threshold, it is determined to be the same person, and the same person is a repeated person.

[0082] After finding all the repeated characters, you will naturally know the number of repeated characters. At this time, you only need to judge whether these repeated characters are included in the actual number of characters in the current sub-area based on the preset rules. If they are not included in the actual number of characters in the current sub-area, subtract the number of repeated characters from the previously preliminary counted number of characters, which is the actual number of characters in the current sub-area.

[0083] The preset rules here are actually a negotiation mechanism. When duplicate characters appear, the parties negotiate with each other and only count these duplicate characters into one of the sub-areas, but not the other one.

[0084] In this method, the association between each sub-region is to reduce the number of comparisons in the process of step S230, thereby saving computing power. On the one hand, only adjacent sub-regions that may have intersections are associated, and there is no need to compare with sub-regions that are unlikely to have intersections during comparison, thereby reducing the number of comparisons; on the other hand, the preset rules are matched with the associated sub-regions, thereby reducing the associated sub-regions. Reducing the associated sub-regions naturally reduces the number of comparisons. For example, sub-region 1 is associated with sub-region 2, and sub-region 2 is not associated with sub-region 1. Then, in the preset rules, repeated characters are not counted in sub-region 1, and all are counted in sub-region 2. At this time, the work of deduplication of characters is completed, and no more comparison is required.

[0085] It should be pointed out here that the associated areas do not necessarily have to be adjacent sub-areas. As long as it is considered that the probability of duplicate characters occurring between two sub-areas is high, the two sub-areas can be associated.

[0086] It should also be pointed out here that the associated sub-region can be one or more. When there are multiple associated sub-regions, all associated sub-regions should be compared to obtain duplicate characters, and then based on preset rules, it is determined whether these duplicate characters are included in the current sub-region.

[0087] In one implementation, the sub-region associated with the current sub-region is a sub-region adjacent to the current sub-region.

[0088] This is what I said before. There is a greater chance of duplicate characters between adjacent sub-areas, so they should be associated first.

[0089] In one implementation, before step S230, the process includes: step S228 and step S229.

[0090] Step S228, determining whether there is data of duplicate characters between the picture to be analyzed in the current sub-region and the picture to be analyzed in the sub-region associated with the current sub-region in the database;

[0091] Step S229, when there is data of the repeated person in the database, the repeated person is obtained by using the data of the repeated person.

[0092] During the association process, it is possible that sub-area 1 is associated with sub-area 2 and area 2 is associated with sub-area 1. At this time, it is possible that the data has been compared once and there is duplicate character data. Therefore, this embodiment first determines whether this is the case. If so, the data is directly used without the need for another comparison, thereby saving computing power.

[0093] Back to the method of counting the number of people in the classroom, through step S120, the actual number of people in each sub-area is obtained. In the counting process of step S120, the attribution of repeated people is divided, so there are no repeated people in the number of people counted in each sub-area, and step S130 does not need to remove duplicate people. The total number of people in the classroom can be obtained by directly adding the actual number of people in each sub-area.

[0094] In one embodiment, the method for counting the number of people in a classroom further includes: step S140.

[0095] Step S140, when the number of repeated characters obtained in step S120 exceeds the first threshold, close-up shots are taken of each pre-divided sub-area of ​​the classroom area again by cruising to obtain pictures to be analyzed in each sub-area, and the actual number of characters in each sub-area is re-counted.

[0096] Step S230 in step S120 obtains the repeated characters in the two associated sub-areas. When it is found that there are many repeated characters in two areas, it may be a period that is not suitable for statistics, such as a break or a student discussion period. At this time, the patrol should be repeated to take close-up photos of each pre-divided sub-area of ​​the classroom area, and then step S120 should be re-implemented to obtain the actual number of characters in each sub-area.

[0097] In one embodiment, the method for counting the number of people in a classroom further includes: step S150 and step S160.

[0098] Step S150, calculating the sum of the numbers of repeated characters obtained in step S120 to obtain the total number of repeated characters;

[0099] Step S160, when the total number of repeated characters counted exceeds the second threshold, close-up shots are taken of each pre-divided sub-area of ​​the classroom area by cruising again to obtain pictures to be analyzed of each sub-area, and the actual number of characters in each sub-area is re-counted.

[0100] In some cases, although the number of repeated characters in the two associated sub-areas is below the first threshold, the sum of the number of repeated characters obtained in all steps S230 is higher than the second threshold. This may be due to periods that are not suitable for statistics, such as break time or student discussion time. In this case, the patrol should be repeated to take close-up photos of each pre-divided sub-area of ​​the classroom area, and then step S120 should be re-implemented to obtain the actual number of characters in each sub-area.

[0101] Embodiment 2

[0102] See also Figure 4 , Figure 4 This is a flow chart of another method for counting the number of people in a classroom provided in the second embodiment of the present invention, the method comprising step S310, step S320, step S330 and step S340. It should be noted that step S310, step S320, step S330 and step S340 are only reference numerals for clarifying the embodiment and the appendix. Figure 1 The corresponding relationship does not limit the order of the steps in this embodiment.

[0103] Step S310, obtaining the images to be analyzed of each sub-area of ​​the classroom area, wherein the classroom area is pre-divided into a number of sub-areas, and each sub-area is photographed in close-up to obtain the images to be analyzed of each sub-area;

[0104] Step S320, counting the number of people in the to-be-analyzed picture of each sub-region, obtaining a preliminary count of the number of people, and calculating the preliminary count of the total number of people;

[0105] Step S330, obtaining the number of repeated persons in each sub-area by a preset method of counting the number of persons in a designated area of ​​the classroom;

[0106] Step S340 , the total number of people in the classroom is obtained by subtracting the number of repeated people in each sub-area from the total number of people initially counted.

[0107] The idea of ​​the second embodiment is similar to that of the first embodiment, except that in the first embodiment, when counting the number of people in each sub-area, the number of repeated people is subtracted to obtain the actual number of people in the sub-area, while in the second embodiment, all the repeated numbers of people are reported and the last one is subtracted.

[0108] Among them, Figure 5 As shown, the process of the preset method of counting the number of people in a designated area in a classroom in step S330 includes: step S410, step S420 and step S430.

[0109] Step S410, acquiring feature data of all faces in the to-be-analyzed pictures of the current sub-region, and feature data of all faces in the to-be-analyzed pictures of the sub-regions associated with the current sub-region;

[0110] Step S420, obtaining repeated persons according to the feature data of all faces of the pictures to be analyzed in the current sub-region and the feature data of all faces of the pictures to be analyzed in the sub-regions associated with the current sub-region;

[0111] Step S430: based on a preset rule, obtain the number of repeated characters in the current sub-region.

[0112] The idea of ​​identifying repeated characters belonging to a certain sub-region is consistent with that in the embodiment, so it will not be described again.

[0113] In one embodiment, the method for counting the number of people in a classroom further includes: step S350.

[0114] Step S350, when the number of repeated people in one of the sub-areas exceeds the first threshold, another group of images to be analyzed including all the sub-areas of the classroom area is re-acquired, and the total number of people in the classroom is re-counted.

[0115] In one embodiment, the method for counting the number of people in a classroom further includes: step S360 and step S370.

[0116] Step S360, calculating the sum of the number of repeated characters in each sub-region to obtain the total number of repeated characters;

[0117] Step S360, when the total number of repeated characters counted exceeds the second threshold, another group of images to be analyzed including all sub-areas of the classroom area is re-acquired, and the total number of people in the classroom is re-counted.

[0118] The ideas of the above two implementation modes are consistent with those in the embodiment, and will not be repeated here.

[0119] In this method, in the process of counting the number of people, close-up photos of students are taken by cruising to solve the problem of insufficient portrait clarity; when counting the number of people and removing duplicate people, the sub-regions are associated with each other, which reduces the number of times of searching for duplicate people and comparing them, thereby saving computing power; on the one hand, only adjacent sub-regions that may have intersections are associated, and there is no need to compare with sub-regions that may not have intersections during comparison, thereby reducing the number of comparisons; on the other hand, the preset rules are coordinated with the associated sub-regions, thereby reducing the associated sub-regions, and reducing the associated sub-regions naturally reduces the number of comparisons.

[0120] Embodiment 3

[0121] Corresponding to the method of embodiment 1, as Figure 6 As shown, the present invention further provides a device 5 for visually counting the number of people in a designated area in a classroom, comprising: an acquisition module 510 , a comparison module 520 , and an analysis module 530 .

[0122] The acquisition module 510 is used to acquire the number of people in the picture to be analyzed in the current sub-region, acquire the feature data of all faces in the picture to be analyzed in the current sub-region, and acquire the feature data of all faces in the picture to be analyzed in the sub-region associated with the current sub-region, wherein the classroom area is pre-divided into a plurality of sub-regions, and each sub-region is photographed in close-up to obtain the picture to be analyzed in each sub-region;

[0123] A comparison module 520, configured to obtain repeated persons based on the feature data of all faces in the image to be analyzed in the current sub-region and the feature data of all faces in the image to be analyzed in the sub-region associated with the current sub-region;

[0124] The analysis module 530 is used to obtain the actual number of people in the current sub-area based on preset rules, according to the repeated people and the number of people in the picture to be analyzed in the current sub-area, wherein the preset rules are used to determine whether the repeated people are included in the actual number of people in the current sub-area.

[0125] In one implementation, the sub-region associated with the current sub-region is a sub-region adjacent to the current sub-region.

[0126] In one embodiment, before the comparison module performs the step of obtaining repeated characters based on the feature data of all faces of the pictures to be analyzed in the current sub-region and the feature data of all faces of the pictures to be analyzed in the sub-region associated with the current sub-region, the comparison module further includes the following steps:

[0127] Determine whether there is data of a person repeated between the picture to be analyzed in the current sub-region and the picture to be analyzed in the sub-region associated with the current sub-region in the database;

[0128] When the data of the repeated person exists in the database, the repeated person is obtained by using the data of the repeated person.

[0129] like Figure 7 As shown, the present invention further provides a device 6 for counting the number of people in a designated area in a classroom, comprising: a shooting module 610 , an acquisition module 620 , and a calculation module 630 .

[0130] The shooting module 610 is used to take close-up photos of each pre-divided sub-area of ​​the classroom area by cruising, so as to obtain the image to be analyzed of each sub-area;

[0131] An acquisition module 620 is used to obtain the actual number of people in each sub-area through the aforementioned device for counting the number of people in a designated area of ​​the classroom;

[0132] The calculation module 630 is used to add up the actual number of people in each sub-area to obtain the total number of people in the classroom.

[0133] In one embodiment, the calculation module is also used to, when the number of repeated people exceeds a first threshold in the process of obtaining the actual number of people in each sub-area through the device for counting the number of people in a designated area in the classroom as described above, re-cruise to take close-up photos of each pre-divided sub-area of ​​the classroom area to obtain pictures to be analyzed for each sub-area, and re-obtain the actual number of people in each sub-area through the device for counting the number of people in a designated area in the classroom as described above.

[0134] In one embodiment, the calculation module is also used to calculate the sum of the number of repeated people in the process of calculating the actual number of people in each sub-area obtained by the device for counting the number of people in the designated area of ​​the classroom as described above, and obtain the total number of repeated people counted; when the total number of repeated people counted exceeds a second threshold, close-up photos of each pre-divided sub-area of ​​the classroom area are taken again through cruising to obtain pictures to be analyzed of each sub-area, and the actual number of people in each sub-area is obtained again through the device for counting the number of people in the designated area of ​​the classroom as described above.

[0135] like Figure 8 As shown, the present invention further provides a device 7 for counting the number of people in a designated area in a classroom, comprising: an acquisition module 710, a counting module 720, a screening module 730 and a calculation module 740.

[0136] The acquisition module 710 is used to acquire the images to be analyzed of each sub-area of ​​the classroom area, wherein the classroom area is pre-divided into a plurality of sub-areas, and each sub-area is photographed in close-up to obtain the images to be analyzed of each sub-area;

[0137] A counting module 720 is used to count the number of people in the to-be-analyzed picture of each sub-region, obtain a preliminary count of the number of people, and calculate a preliminary count of the total number of people;

[0138] A screening module 730 is used to obtain the number of repeated persons in each sub-area through a preset device for counting the number of persons in a designated area of ​​the classroom;

[0139] A calculation module 740 is used to obtain the total number of people in the classroom by subtracting the number of repeated people in each sub-area from the total number of people counted initially;

[0140] The preset device for counting the number of people in a designated area in the classroom includes:

[0141] A receiving module, used to obtain feature data of all faces in the image to be analyzed in the current sub-region, and feature data of all faces in the image to be analyzed in the sub-region associated with the current sub-region;

[0142] A comparison module, used for obtaining repeated persons according to the feature data of all faces of the pictures to be analyzed in the current sub-region and the feature data of all faces of the pictures to be analyzed in the sub-regions associated with the current sub-region;

[0143] The analysis module is used to obtain the number of repeated characters in the current sub-area based on preset rules.

[0144] In one embodiment, the analysis mode is also used to re-acquire another set of images to be analyzed including all sub-areas of the classroom area and re-count the total number of people in the classroom when the number of repeated characters in one of the sub-areas exceeds a first threshold.

[0145] In one embodiment, the analysis method is also used to calculate the sum of the number of repeated characters in each sub-area to obtain the total number of repeated characters counted. When the total number of repeated characters counted exceeds a second threshold, another set of images to be analyzed containing all sub-areas of the classroom area is re-obtained, and the total number of people in the classroom is re-counted.

[0146] In the device, in the process of counting the number of people, close-up shots of students are taken by cruising to solve the problem of insufficient portrait clarity; when counting the number of people and removing duplicate people, associations are made between the sub-areas to reduce the number of times duplicate people are searched and compared, thereby saving computing power; on the one hand, only adjacent sub-areas that may have intersections are associated, and when comparing, there is no need to compare with sub-areas that are unlikely to have intersections, thereby reducing the number of comparisons; on the other hand, the preset rules are coordinated with the associated sub-areas, thereby reducing the number of associated sub-areas, and reducing the associated sub-areas naturally reduces the number of comparisons.

[0147] Embodiment 4

[0148] An embodiment of the present invention further provides a storage medium on which computer instructions are stored. When the instructions are executed by a processor, the method for counting the number of people in a classroom according to any of the above embodiments is implemented.

[0149] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, random access memories (RAM), read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.

[0150] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to execute all or part of the methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, RAM, ROM, magnetic disks or optical disks.

[0151] Corresponding to the above-mentioned computer storage medium, in one embodiment, a computer device is also provided, which includes a memory, an encoder, and a computer program stored in the memory and executable on the encoder, wherein when the encoder executes the program, any method for counting the number of people in a classroom as described in the above-mentioned embodiments is implemented.

[0152] The above-mentioned computer equipment, in the process of counting the number of people, takes close-up photos of students by means of cruising, thereby solving the problem of insufficient portrait clarity; when counting the number of people and removing duplicate people, the sub-regions are associated with each other, thereby reducing the number of times of searching for duplicate people and comparing them, thereby saving computing power; on the one hand, only adjacent sub-regions that are likely to have intersections are associated, and when comparing, there is no need to compare with sub-regions that are unlikely to have intersections, thereby reducing the number of comparisons; on the other hand, the preset rules are coordinated with the associated sub-regions, thereby reducing the number of associated sub-regions, and reducing the associated sub-regions naturally reduces the number of comparisons.

[0153] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0154] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.

Claims

1. A method for counting the number of people in a designated area in a classroom, characterized in that: include: Obtain the number of people in the image to be analyzed in the current sub-area, wherein the classroom area is pre-divided into several sub-areas, and each sub-area is photographed in close-up to obtain the image to be analyzed of each sub-area; Acquire feature data of all faces in the picture to be analyzed in the current sub-region, and feature data of all faces in the picture to be analyzed in the sub-region associated with the current sub-region; Obtaining repeated persons according to the feature data of all faces of the pictures to be analyzed in the current sub-region and the feature data of all faces of the pictures to be analyzed in the sub-region associated with the current sub-region; Based on preset rules, the actual number of people in the current sub-area is obtained according to the repeated people and the number of people in the picture to be analyzed in the current sub-area, wherein the preset rules are used to determine whether the repeated people are included in the actual number of people in the current sub-area.

2. The method for counting the number of people in a designated area in a classroom according to claim 1, characterized in that: The sub-region associated with the current sub-region is a sub-region adjacent to the current sub-region.

3. The method for counting the number of people in a designated area in a classroom according to claim 1, characterized in that: Before obtaining repeated persons according to the feature data of all faces of the pictures to be analyzed in the current sub-region and the feature data of all faces of the pictures to be analyzed in the sub-region associated with the current sub-region, the method further includes: Determine whether there is data of a person repeated between the picture to be analyzed in the current sub-region and the picture to be analyzed in the sub-region associated with the current sub-region in the database; When the data of the repeated person exists in the database, the repeated person is obtained by using the data of the repeated person.

4. A method for counting the number of people in a classroom, characterized in that: include: By cruising, close-up photos are taken of each pre-divided sub-area of ​​the classroom area to obtain the pictures to be analyzed of each sub-area; The actual number of people in each sub-area is obtained by using the method for counting the number of people in a designated area of ​​a classroom as described in any one of claims 1 to 3; Add up the actual number of people in each sub-area to get the total number of people in the classroom.

5. The method for counting the number of people in a classroom according to claim 4, characterized in that: Also includes: In the process of obtaining the actual number of people in each sub-area by the method for counting the number of people in a designated area in a classroom as described in any one of claims 1-3, when the number of repeated people exceeds a first threshold, close-up photos are taken of each pre-divided sub-area of ​​the classroom area again by cruising to obtain pictures to be analyzed of each sub-area, and the actual number of people in each sub-area is obtained again by the method for counting the number of people in a designated area in a classroom as described in any one of claims 1-3.

6. The method for counting the number of people in a classroom according to claim 4, characterized in that: Also includes: In the process of calculating the actual number of people in each sub-area obtained by the method for counting the number of people in a designated area in a classroom as described in any one of claims 1 to 3, the sum of the number of repeated people is obtained to obtain the total number of repeated people counted; When the total number of repeated people counted exceeds the second threshold, close-up photos are taken of each pre-divided sub-area of ​​the classroom area again by cruising to obtain pictures to be analyzed of each sub-area, and the actual number of people in each sub-area is obtained again by the method for counting the number of people in a designated area in the classroom as described in any one of claims 1-3.

7. A method for counting the number of people in a classroom, characterized in that: include: Obtaining images to be analyzed of each sub-area of ​​the classroom area, wherein the classroom area is pre-divided into a number of sub-areas, and each sub-area is photographed in close-up to obtain images to be analyzed of each sub-area; Counting the number of people in the to-be-analyzed pictures in each sub-region to obtain a preliminary count of the number of people, and calculating the preliminary count of the total number of people; The number of repeated people in each sub-area is obtained by a preset method of counting the number of people in a designated area in the classroom; The total number of people in the classroom is obtained by subtracting the number of repeated people in each sub-area from the total number of people counted initially; The preset method for counting the number of people in a designated area in a classroom includes: Acquire feature data of all faces in the picture to be analyzed in the current sub-region, and feature data of all faces in the picture to be analyzed in the sub-region associated with the current sub-region; Obtaining repeated persons according to the feature data of all faces of the pictures to be analyzed in the current sub-region and the feature data of all faces of the pictures to be analyzed in the sub-region associated with the current sub-region; Based on the preset rules, the number of repeated characters in the current sub-area is obtained.

8. The method for counting the number of people in a classroom according to claim 7, characterized in that: Also includes: When the number of repeated persons in one of the sub-areas exceeds the first threshold, another set of images to be analyzed including all the sub-areas of the classroom area is obtained again, and the total number of persons in the classroom is counted again.

9. The method for counting the number of people in a classroom according to claim 7, characterized in that: Also includes: Calculate the sum of the number of repeated characters in each sub-area to obtain the total number of repeated characters; When the total number of repeated persons counted exceeds the second threshold, another group of images to be analyzed including all sub-areas of the classroom area is obtained again, and the total number of persons in the classroom is counted again.

10. A device for counting the number of people in a designated area in a classroom, characterized in that: include: An acquisition module is used to acquire the number of people in the picture to be analyzed in the current sub-region, acquire the feature data of all faces in the picture to be analyzed in the current sub-region, and acquire the feature data of all faces in the picture to be analyzed in the sub-region associated with the current sub-region, wherein the classroom area is pre-divided into several sub-regions, and each sub-region is photographed in close-up to obtain the picture to be analyzed in each sub-region; A comparison module, used for obtaining repeated persons according to the feature data of all faces of the pictures to be analyzed in the current sub-region and the feature data of all faces of the pictures to be analyzed in the sub-regions associated with the current sub-region; The analysis module is used to obtain the actual number of people in the current sub-area based on preset rules, according to the repeated people and the number of people in the picture to be analyzed in the current sub-area, wherein the preset rules are used to determine whether the repeated people are included in the actual number of people in the current sub-area.

11. A device for counting the number of people in a classroom, characterized in that: include: A shooting module is used to take close-up photos of each pre-divided sub-area of ​​the classroom area by cruising to obtain pictures to be analyzed of each sub-area; an acquisition module, configured to obtain the actual number of people in each sub-area through the device for counting the number of people in a designated area of ​​a classroom as claimed in claim 10; The calculation module is used to add up the actual number of people in each sub-area to obtain the total number of people in the classroom.

12. A device for counting the number of people in a classroom, characterized in that: include: An acquisition module is used to acquire the images to be analyzed of each sub-area of ​​the classroom area, wherein the classroom area is pre-divided into a number of sub-areas, and each sub-area is photographed in close-up to obtain the images to be analyzed of each sub-area; A statistical module is used to count the number of people in the pictures to be analyzed in each sub-area, obtain a preliminary number of people, and calculate a preliminary total number of people; A screening module, used to obtain the number of repeated persons in each sub-area through a preset device for counting the number of persons in a designated area in the classroom; A calculation module, used for obtaining the total number of people in the classroom by subtracting the number of repeated people in each sub-area from the total number of people counted initially; Wherein, the preset device for counting the number of people in a designated area in the classroom includes: A receiving module, used to obtain feature data of all faces in the image to be analyzed in the current sub-region, and feature data of all faces in the image to be analyzed in the sub-region associated with the current sub-region; A comparison module, used for obtaining repeated persons according to the feature data of all faces of the pictures to be analyzed in the current sub-region and the feature data of all faces of the pictures to be analyzed in the sub-regions associated with the current sub-region; The analysis module is used to obtain the number of repeated characters in the current sub-area based on preset rules.

13. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 9 is implemented.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.