A method and system for calculating classroom seating distribution by marking lines

Through semantic segmentation model and polygon approximation technology, combined with the principles of front and back boundary line matching and vanishing point, the classroom table and chair areas are divided and the seating rate of each area is calculated, which solves the problems of incomplete classroom areas and neglected seating rate calculation in the existing technology, and achieves a more accurate and comprehensive classroom seating distribution calculation.

CN119152356BActive Publication Date: 2025-03-11CHENGDOU HUAQIYUN TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411608297.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-03-11
Estimated Expiration
2044-11-12

AI Technical Summary

Technical Problem

The existing automated classroom area seating distribution calculation method requires that the classroom image can include a complete classroom area, and the divided table and chair areas cannot be well drawn with rectangles, and the seating rate calculation of other areas is ignored.

Method used

The visible areas of classroom tables and chairs are divided by the semantic segmentation model, and they are approximated into a polygon-based area. The principle of front and rear boundary line matching and vanishing point is used to generate segmentation lines, and the classroom tables and chairs are divided into several seating sub-regions, and the seating rate of each area is calculated.

Benefits of technology

It solves the problem of incomplete classroom area processing and rectangle drawing defects, can effectively calculate the seating rate of each classroom area, simplifies the division logic and is easy to expand.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119152356B_ABST
    Figure CN119152356B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for calculating classroom seating distribution by drawing lines, and relates to the field of image processing technology; the present invention solves the problem of processing incomplete classroom desk and chair areas by drawing lines on the front and rear boundary lines of the classroom desk and chair areas, and divides the classroom desk and chair areas by drawing lines based on the principle of vanishing points, thereby solving the problem of defects in the depiction of classroom desk and chair areas by rectangles and the problem of ignoring the calculation of seating rates in other areas by existing methods. Among them, dividing the classroom desk and chair areas by drawing lines simplifies the logic of division, is easy to understand, and can divide more areas according to needs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method and system for calculating classroom seating distribution by marking lines. Background Art

[0002] In university classrooms, the seating distribution in the classroom area can reflect the quality of the teacher's teaching and the enthusiasm of students to learn to a certain extent. Using image processing methods, we can automatically calculate the seating distribution in the classroom area, which can greatly save manpower and make it easier for us to understand the learning situation in the classroom.

[0003] The existing automated classroom area seating distribution calculation method is divided into three steps: classroom area division, head detection and seating distribution calculation; for example, the application with application number 202210055888.3 calculates the minimum enclosing rectangle of the classroom desk and chair area and processes the minimum enclosing rectangle to divide the front row area of ​​the classroom, and finally calculates the front row seating rate through the front row area of ​​the classroom demarcated by the processed rectangle; however, this method still has some problems.

[0004] First of all, this method requires that the classroom image can include the complete classroom area. When the image cannot fully display the classroom desk and chair area, there will be problems in drawing the minimum enclosing rectangle. However, the cameras installed in the classroom usually cannot fully capture the classroom area image, resulting in the failure of drawing the minimum enclosing rectangle.

[0005] In addition, in some viewing angles, especially the viewing angles where the first and last rows of the classroom desk and chair area have a large difference in angle, finding the minimum circumscribed rectangle of the classroom desk and chair area cannot well depict the situation of the classroom desk and chair area; and the front and rear boundaries of each area divided horizontally by the classroom desk and chair are usually not parallel, so only using rectangles cannot well draw the divided desk and chair area;

[0006] Finally, this method is limited to calculating the seating rate in the front row of the classroom, while ignoring the seating rate calculation in other areas.

[0007] Therefore, there is an urgent need for a method and system for calculating classroom seating distribution by marking lines to solve the problems existing in the current automated classroom area seating distribution calculation method. Summary of the invention

[0008] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a method and system for calculating the classroom seating distribution by drawing lines, mainly to solve the problem that the prior art requires the classroom image to include the complete classroom area, only using rectangles cannot well draw the divided desk and chair areas and ignores the seating rate calculation of other areas.

[0009] The purpose of the present invention is achieved through the following technical solutions:

[0010] In a first aspect, a method for calculating classroom seating distribution by drawing lines is provided, and the classroom seating distribution is calculated by the following steps:

[0011] Step 1: Divide the visible area of ​​classroom desks and chairs: Use the semantic segmentation model to divide the visible area of ​​classroom desks and chairs that is visible in the classroom monitoring image and not blocked by objects other than people, and approximate the visible area of ​​classroom desks and chairs into a polygon-based classroom desks and chairs area;

[0012] Step 2: Match the front and rear boundary lines of the classroom desk and chair area; Match the front and rear boundary lines of the classroom desk and chair area based on polygons, and find the edge lines connected in front of the first row of desks and behind the last row of seats in the classroom as the front boundary line and the rear boundary line respectively;

[0013] Step 3: Generate the partition lines of the classroom desk and chair area; based on the vanishing point principle, draw several partition lines in the middle area composed of the front boundary line and the rear boundary line, and divide the classroom desk and chair area into several seating sub-areas through the partition lines;

[0014] Step 4: Calculate the seating distribution in the classroom area; obtain the student seating positions through the classroom monitoring image, and calculate the seating sub-areas based on the dividing lines, and the seating rate of each seating sub-area is calculated separately.

[0015] As a further solution, in step 1, the visible area of ​​classroom desks and chairs is divided through the following sub-steps:

[0016] Step 11: Semantic segmentation model training: Collect historical data of classroom monitoring images, and mark the visible areas of classroom desks and chairs that are visible and not severely blocked in the classroom monitoring images. Use the marked classroom monitoring images to train the semantic segmentation model. The trained semantic segmentation model can draw the visible classroom area in the image.

[0017] Step 12: Extraction of visible area image: Use the semantic segmentation model trained in step 11 to process the classroom monitoring image to obtain a mask image of the visible area of ​​the classroom desks and chairs, wherein the mask image indicates whether the corresponding pixel position is the visible area of ​​the classroom desks and chairs through the mask value;

[0018] Step 13: Approximate the area of ​​classroom desks and chairs; select the area with the largest area from the mask image of the visible area of ​​classroom desks and chairs, perform convex hull operation and polygon approximation operation on the area with the largest area, and obtain the polygon-based classroom desks and chairs area and each corner point of the polygon.

[0019] As a further solution, in step 11, the semantic segmentation model training is performed through the following sub-steps:

[0020] Step 111: Acquiring training data: extracting a number of classroom monitoring images from the classroom monitoring video as training data;

[0021] Step 112: training data annotation; the annotation positions are the front edge of the first row of desks in the classroom, the back of the last row of seats, and the left and right edges of the desk and chair area in the classroom. A polygon is formed by approximate straight lines connected by the annotation positions to obtain a classroom desk and chair area based on a polygon; if there is a person image in the last row of seats, the part of the person image beyond the last row of seats is ignored;

[0022] Step 113: Semantic model training: Select and set the semantic segmentation model, use the pre-trained weights as the initial weights, and use the labeled data to train the semantic segmentation model.

[0023] As a further solution, in step 2, the front and rear boundary lines of the classroom desk and chair area are matched through the following sub-steps:

[0024] Step 21: front and rear boundary division: based on the polygonal contour edge positions of the classroom desk and chair area, the polygonal contour edges are divided into a front boundary set and a rear boundary set;

[0025] Step 22: Confirm the front and back boundaries; match the edges in the front boundary set and the back boundary set in pairs, calculate the score of each matching combination, and take the matching combination with the highest score as the front boundary line and the back boundary line of the classroom desk and chair area.

[0026] As a further solution, in step 21, the front and rear boundaries are divided by the following steps:

[0027] Step 211: Obtain the polygon-based classroom desk and chair area and each corner point of the polygon;

[0028] Step 212: Obtain all edges of the polygon-based classroom desk and chair area;

[0029] Step 213: filter out edge lines whose angles with the upper and lower horizontal dividing lines are greater than 45 degrees and edge lines whose lengths are less than one-fourth of the average length of all edge lines;

[0030] Step 214: By averaging the coordinates of each corner point, a point in the classroom desk and chair area is obtained, which is recorded as p center point;

[0031] Step 215: Traverse the filtered polygon edges. If If the point is below the edge, the edge is added to the back boundary set; If the point is above an edge, the edge is added to the front boundary set.

[0032] As a further solution, in step 22, the score of each matching combination is calculated by the following formula:

[0033]

[0034] in, express The score value of a set of edge combinations, For edge and sidelines The area of ​​the quadrilateral enclosed is For edge and sidelines The cosine of the acute angle formed, and are area weight and angle weight respectively, and are the score penalties for direction and angle respectively.

[0035] As a further solution, in step 3, whether the front boundary line and the back boundary line are parallel is used to determine whether there is a vanishing point; if they are parallel, there is no vanishing point, and a point is taken on the front boundary line. , from point Draw a perpendicular line to the rear boundary line, and take the intersection of the perpendicular line and the rear boundary line as point , at point and Point The connected line segments are taken according to the preset ratio. segmentation points, and draw lines parallel to the front boundary line from the segmentation points to obtain m segmentation lines.

[0036] As a further solution, in step 3, whether the front boundary line and the rear boundary line are parallel is used to determine whether there is a vanishing point; if they are not parallel, there is a vanishing point, which is the intersection of the front boundary line and the rear boundary line outside the visible area. ; Take a point on the front boundary line and the back boundary line respectively and Point , and the intersection point Form an isosceles triangle at point and Point The connected line segments are taken according to the preset ratio. split points, and from the intersection Draw m rays to each segmentation point to obtain m segmentation lines.

[0037] As a further solution, in step 4, the seating rate of each seating sub-area is calculated through the following sub-steps:

[0038] Step 41: Input the classroom image into the student head detection model, output the location information of the student head detection frame, and use and , where is the coordinate of the upper left corner of the detection box, is the coordinate of the lower right corner of the detection box;

[0039] Step 42: Using the left end point of the previous boundary line as the origin and the horizontal line as the x-axis, establish a two-dimensional rectangular coordinate system;

[0040] Step 43: Obtain a decision point; wherein,

[0041] If the right endpoint of the front boundary line is in the first quadrant of the two-dimensional rectangular coordinate system, the coordinates of the lower right corner of the detection box are taken As a decision point ;

[0042] If the right endpoint of the front boundary line is in the fourth quadrant of the two-dimensional rectangular coordinate system or on the x-axis, the coordinate of the lower left corner of the detection box is As a decision point ;

[0043] Step 44: Traverse the front boundary line and the dividing line from bottom to top, and record the line set as ;in, The front boundary line, For the dividing line;

[0044] Step 45: When the decision point Elements of online collections and When between The corresponding student seats are divided into seating sub-areas; if the decision point exist , the student seats are divided into area.

[0045] On the other hand, a system for calculating the distribution of seating in a classroom by marking lines uses a method for calculating the distribution of seating in a classroom by marking lines as described in any one of the above items.

[0046] Compared with the related art, the method and system for calculating classroom seating distribution by marking lines provided by the present invention have the following advantages:

[0047] The present invention solves the problem of handling incomplete classroom desk and chair areas by using the front and rear boundary lines of the classroom desk and chair area. Based on the principle of vanishing points, the classroom desk and chair area is divided by drawing lines, solving the problem of the defects of the rectangular depiction of the classroom desk and chair area and the problem of the existing method ignoring the calculation of the seating rate of other areas. Among them, dividing the classroom desk and chair area by drawing lines simplifies the logic of division, is easy to understand, and can divide more areas according to needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A schematic diagram of the steps of a method for calculating classroom seating distribution by marking provided by the present invention;

[0049] Figure 2 A schematic diagram of multiple manually annotated mask images provided by the present invention;

[0050] Figure 3 A schematic diagram of a mask image automatically generated by a model provided by the present invention;

[0051] Figure 4 A schematic diagram of a polygon-based classroom desk and chair area provided by the present invention;

[0052] Figure 5 A schematic diagram of the position of students' heads provided by the present invention. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0054] See also Figure 1 The present invention provides a method for calculating classroom seating distribution by marking lines, and the classroom seating distribution is calculated by the following steps:

[0055] Step 1: Divide the visible area of ​​classroom desks and chairs; divide the visible area of ​​classroom desks and chairs that is visible in the classroom surveillance image and not blocked by objects other than people through the semantic segmentation model, and approximate the visible area of ​​classroom desks and chairs into a polygon-based classroom desks and chairs area.

[0056] For step 1: Since classroom surveillance cameras are usually fixed, 3 to 5 images are extracted from each video as training data from several classroom surveillance videos. The annotation tool is used to mark the visible area of ​​the classroom tables and chairs in the image. The marked position is the approximate straight line connecting the front edge of the first row of desks, the back of the last row of seats, and the left and right edges of the classroom tables and chairs area. Finally, these straight lines can be connected into polygons.

[0057] In order to reduce the impact of people in the classroom desk and chair area on the segmentation model and enable the model to recognize the occlusion of the classroom area by objects other than people (such as a lecture table), for people sitting in the last row of the classroom desk and chair area, the part of the person beyond the last row of seats should be ignored during annotation. For occlusion of the classroom desk and chair area other than people, if the occlusion is large and cannot be ignored, the occluded part should not be marked. The final labeled mask image is as follows: Figure 2 shown.

[0058] Step 2: Match the front and rear boundary lines of the classroom desk and chair area; Match the front and rear boundary lines of the classroom desk and chair area based on polygons, and find the edge lines connected in front of the first row of desks and behind the last row of seats in the classroom as the front boundary line and the rear boundary line respectively;

[0059] For step 2: the semantic segmentation model uses the pre-trained weights of the existing semantic segmentation model as the initial weights and uses the labeled data to train the model; the classroom surveillance image is processed by the semantic segmentation model to obtain a mask image that divides the visible area of ​​the classroom desks and chairs, such as Figure 3 As shown, the white part is the visible area of ​​classroom tables and chairs, and the black part is other areas (it can also be flipped to show);

[0060] When approximating the classroom desk and chair area, the largest area is selected from the mask image of the visible area of ​​the classroom desk and chair as the classroom desk and chair area. The convex hull operation and polygon approximation operation are performed on this area. The obtained approximate polygon is as follows: Figure 4 As shown, the corner points of the approximate polygon of the classroom desk and chair area are finally obtained.

[0061] Step 3: Generate the partition lines of the classroom desk and chair area; based on the vanishing point principle, draw several partition lines in the middle area composed of the front boundary line and the rear boundary line, and divide the classroom desk and chair area into several seating sub-areas through the partition lines;

[0062] For step 3: For the front and rear boundaries of the classroom desk and chair area and any point in the classroom desk and chair area that does not fall on the polygon edge, the front and rear boundaries must be distributed on the "upper and lower sides" of the point in the classroom desk and chair area.

[0063] Therefore, for the approximate polygon of the classroom desk and chair area, the coordinates of its corner points are averaged to obtain a point in the classroom desk and chair area, recorded as pcenter Point, for all sides of the approximate polygon, if the edge is p center On the upper side of the point, the edge is divided into the back boundary edge set. p center If the edge is below the point, the edge is classified into the front boundary edge set.

[0064] Since the present invention only focuses on the straight lines corresponding to the first row of desks and the last row of seats in the classroom, the straight lines with an angle greater than 100° to the horizontal line will be filtered out during the division of the front and rear boundary edges. and the edges whose length is less than one-quarter of the average length of the polygon's edges;

[0065] Match the edges in the front boundary edge set and the back boundary edge set in pairs, and calculate the score of each match. Finally, take the set of edges with the highest score as the front and back boundaries of the classroom desk and chair area. is a set of edges, where Taken from the previous boundary edge set, Taken from the back boundary edge set, the score calculation of this combination is as follows:

[0066]

[0067] in, express The score value of a set of edge combinations, For edge and edge The area of ​​the quadrilateral enclosed is For edge and edge The cosine of the acute angle formed, and are the weights corresponding to the above two values, and are the score penalties for direction and angle respectively, and the calculation rules are as follows:

[0068] For direction score penalty , considering that the front and rear boundary directions of the classroom desk and chair area should be roughly consistent, and when the polygonal approximation is made for the visible area of ​​the classroom, if the front boundary line or the rear boundary line is close to horizontal, the boundary line may lead to inconsistent directions due to errors, so for the combination ,in Taken from the previous boundary edge set, Taken from the back boundary edge set, the edges and edge The left endpoint is the origin, when the edge and edge The angle with the horizontal line is greater than If their right endpoints are not in the same quadrant, then is a constant with a value between 0 and 1, representing the combination Do direction score penalty, otherwise A value of 1 means no direction score penalty;

[0069] For angle score penalty , considering that the angle between the front boundary line and the horizontal line of the classroom desk and chair area should usually be larger than the angle between the rear boundary line and the horizontal line, when the front of the classroom desk and chair area is incomplete in the image, that is, when the front boundary line of the classroom desk and chair area coincides with the lower boundary line of the image, the angle between the front boundary line and the horizontal line of the classroom desk and chair area will be smaller than the angle between the rear boundary line and the horizontal line. ,in Taken from the previous boundary edge set, Taken from the back boundary edge set, if the edge The angle with the horizontal line is not 0 or 0 but the side The length of the front edge set is no more than three quarters of the longest edge length, and is less than the edge The angle with the horizontal line is is a constant with a value between 0 and 1, representing the combination Do angle score penalty, otherwise , which means no angle score penalty;

[0070] Finally, the combination with the highest score is selected as the front and back boundary lines of the classroom desk and chair area, and the left and right endpoints of the front and back boundary lines are output.

[0071] Step 4: Calculate the seating distribution in the classroom area; obtain the student seating positions through the classroom monitoring image, and calculate the seating sub-areas based on the dividing lines, and the seating rate of each seating sub-area is calculated separately.

[0072] For step 4: If the front and rear boundary lines are not parallel, find the expression of the front and rear boundary lines through the coordinates of their endpoints, and find their intersection through the expressions of the two straight lines. The coordinates of

[0073] If the front and rear boundary lines are not parallel, take a point on each of the front and rear boundary lines. and , and the intersection of the front and rear boundary lines forms an isosceles triangle at point and The connected line segments are taken according to a certain ratio points, and then from the intersection Towards and Taken between Draw m rays from each point to divide the classroom desk and chair area;

[0074] When the front and rear boundary lines are parallel, Take a little bit , from point Make Edge The perpendicular line of The intersection point is , then at point and The connected line segments are taken according to a certain ratio points and draw edges from these points Parallel lines are used to divide the classroom desk and chair areas.

[0075] by Figure 5 For example, get the point and Then, take two points on the corresponding line segment to divide the classroom desk and chair area into three areas: front, middle and back. The corresponding proportions of these three areas are .

[0076] The classroom area seating distribution calculation divides the students in the classroom into different areas based on the position information of the student head border and the classroom area dividing line, and calculates the seating rate of each area, including the following steps:

[0077] The student position is obtained by inputting the classroom image into the student head detection model, outputting the position information of the student head detection frame, and processing the position information of the head detection frame into , , , of the form, where is the coordinate of the upper left corner of the detection box, is the coordinate of the lower right corner of the detection box;

[0078] Seating distribution calculation, take the front boundary edge of the classroom desk and chair area ,by The left endpoint of is the origin, if The right endpoint of is in the first quadrant, then take the lower right corner of the head detection box As a judgment point, if If the right endpoint of is in the fourth quadrant or on the x-axis, then take the lower left corner of the head detection box As the decision point, the decision point is denoted as point , traverse the straight line and dividing line of the front boundary edge from bottom to top, and record the line set as ,in The front boundary line, For the The dividing line, when the point Online and When between The corresponding students are divided into area, if point exist , these points are divided into area.

[0079] The above embodiments only express preferred implementation modes, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention.

Claims

1. A method for calculating classroom seating distribution by marking lines, characterized in that: The classroom seating distribution is calculated by the following steps: Step 1: Divide the visible area of ​​classroom desks and chairs: Use the semantic segmentation model to divide the visible area of ​​classroom desks and chairs that is visible in the classroom monitoring image and not blocked by objects other than people, and approximate the visible area of ​​classroom desks and chairs into a polygon-based classroom desks and chairs area; Step 2: Match the front and rear boundary lines of the classroom desk and chair area; Match the front and rear boundary lines of the classroom desk and chair area based on polygons, and find the edge lines connected in front of the first row of desks and behind the last row of seats in the classroom as the front boundary line and the rear boundary line respectively; Step 3: Generate the partition lines of the classroom desk and chair area; based on the vanishing point principle, draw several partition lines in the middle area composed of the front boundary line and the rear boundary line, and divide the classroom desk and chair area into several seating sub-areas through the partition lines; Step 4: Calculate the seating distribution in the classroom area; obtain the student seating positions through the classroom monitoring image, and calculate the seating sub-areas based on the dividing line, and the seating rate of each seating sub-area respectively; In step 2, the front and rear boundary lines of the classroom desk and chair area are matched through the following sub-steps: Step 21: front and rear boundary division: based on the polygonal contour edge positions of the classroom desk and chair area, the polygonal contour edges are divided into a front boundary set and a rear boundary set; Step 22: confirm the front and back boundaries; match the edge lines in the front boundary set and the back boundary set in pairs, calculate the score of each matching combination, and take the matching combination with the highest score as the front boundary line and the back boundary line of the classroom desk and chair area; In step 21, the front and rear boundaries are divided by the following steps: Step 211: Obtain the polygon-based classroom desk and chair area and each corner point of the polygon; Step 212: Obtain all edges of the polygon-based classroom desk and chair area; Step 213: filter out edge lines whose angles with the upper and lower horizontal dividing lines are greater than 45 degrees and edge lines whose lengths are less than one-fourth of the average length of all edge lines; Step 214: By averaging the coordinates of each corner point, a point in the classroom desk and chair area is obtained, which is recorded as p center point; Step 215: Traverse the filtered polygon edges. If If the point is below the edge, the edge is added to the back boundary set; If the point is above the edge, the edge is added to the front boundary set; In step 22, the score of each matching combination is calculated using the following formula: in, express The score value of a set of edge combinations, For edge and sidelines The area of ​​the quadrilateral enclosed is For edge and sidelines The cosine of the acute angle formed, and are area weight and angle weight respectively, and are the score penalties for direction and angle respectively.

2. The method for calculating classroom seating distribution by marking lines according to claim 1, characterized in that: In step 1, the visible area of ​​classroom desks and chairs is divided through the following sub-steps: Step 11: Semantic segmentation model training: Collect historical data of classroom monitoring images, and mark the visible areas of classroom desks and chairs that are visible and not severely blocked in the classroom monitoring images. Use the marked classroom monitoring images to train the semantic segmentation model. The trained semantic segmentation model can draw the visible classroom area in the image. Step 12: Extraction of visible area image: Use the semantic segmentation model trained in step 11 to process the classroom monitoring image to obtain a mask image of the visible area of ​​the classroom desks and chairs, wherein the mask image indicates whether the corresponding pixel position is the visible area of ​​the classroom desks and chairs through the mask value; Step 13: Approximate the area of ​​classroom desks and chairs; select the area with the largest area from the mask image of the visible area of ​​classroom desks and chairs, perform convex hull operation and polygon approximation operation on the area with the largest area, and obtain the polygon-based classroom desks and chairs area and each corner point of the polygon.

3. The method for calculating classroom seating distribution by marking lines according to claim 2, characterized in that: In step 11, the semantic segmentation model training is performed through the following sub-steps: Step 111: Acquiring training data: extracting a number of classroom monitoring images from the classroom monitoring video as training data; Step 112: training data annotation; the annotation positions are the front edge of the first row of desks in the classroom, the back of the last row of seats, and the left and right edges of the desk and chair area in the classroom. A polygon is formed by approximate straight lines connected by the annotation positions to obtain a classroom desk and chair area based on a polygon; if there is a person image in the last row of seats, the part of the person image beyond the last row of seats is ignored; Step 113: Semantic model training: Select and set the semantic segmentation model, use the pre-trained weights as the initial weights, and use the labeled data to train the semantic segmentation model.

4. The method for calculating classroom seating distribution by marking lines according to claim 1, characterized in that: In step 3, determine whether there is a vanishing point by whether the front boundary line and the back boundary line are parallel; if they are parallel, there is no vanishing point, and a point is taken on the front boundary line. , from point Draw a perpendicular line to the rear boundary line, and take the intersection of the perpendicular line and the rear boundary line as point , at point and Point The connected line segments are taken according to the preset ratio. segmentation points, and draw lines parallel to the front boundary line from the segmentation points to obtain m segmentation lines.

5. The method for calculating classroom seating distribution by marking lines according to claim 1, characterized in that: In step 3, whether there is a vanishing point is determined by whether the front boundary line and the rear boundary line are parallel; if they are not parallel, there is a vanishing point, which is the intersection of the front boundary line and the rear boundary line outside the visible area. ; Take a point on the front boundary line and the back boundary line respectively and Point , and the intersection point Form an isosceles triangle at point and Point The connected line segments are taken according to the preset ratio. split points, and from the intersection Draw m rays to each segmentation point to obtain m segmentation lines.

6. The method for calculating classroom seating distribution by marking lines according to claim 1, characterized in that: In step 4, the seating rate of each seating sub-area is calculated through the following sub-steps: Step 41: Input the classroom image into the student head detection model, output the location information of the student head detection frame, and use and , where is the coordinate of the upper left corner of the detection box, is the coordinate of the lower right corner of the detection box; Step 42: Using the left end point of the previous boundary line as the origin and the horizontal line as the x-axis, establish a two-dimensional rectangular coordinate system; Step 43: Obtain a decision point; wherein, If the right endpoint of the front boundary line is in the first quadrant of the two-dimensional rectangular coordinate system, the coordinates of the lower right corner of the detection box are taken As a decision point ; If the right endpoint of the front boundary line is in the fourth quadrant of the two-dimensional rectangular coordinate system or on the x-axis, the coordinate of the lower left corner of the detection box is As a decision point ; Step 44: Traverse the front boundary line and the dividing line from bottom to top, and record the line set as ;in, The front boundary line, For the dividing line; Step 45: When the decision point Elements of online collections and When The corresponding student seats are divided into seating sub-areas; if the decision point exist , the student seats are divided into area.

7. A classroom seating distribution calculation system by marking, characterized in that: A method for calculating classroom seating distribution by marking as described in any one of claims 1 to 6 is used.

Citation Information

Patent Citations

  • Classroom front-row seating rate automatic detection method and system based on image segmentation, and storage medium

    CN114445742A

  • Vehicle recognition apparatus and vehicle recognition method

    AU2019203180A1

  • Training method, computer readable medium and method and apparatus for detecting vanishing point

    CN111091038A