Image processing method, device, equipment and storage medium

By determining the camera's shooting angle and performing rotation correction on the image during image processing, the problem of high complexity in multi-camera perspective analysis is solved, and efficient and accurate determination of user distribution is achieved.

CN120544109BActive Publication Date: 2025-09-30GUANGZHOU SIHAN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511037736.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-28
Publication Date
2025-09-30
Estimated Expiration
2045-07-28

AI Technical Summary

Technical Problem

In the prior art, analyzing user distribution based on multiple-view images captured by multiple cameras is highly complex, resulting in low efficiency in determining user distribution.

Method used

By acquiring a first image captured by a camera, determining a plurality of first coordinates, calculating the camera shooting angle based on these coordinates and performing rotation correction on the image, a second image is obtained, and then the user distribution information is analyzed.

Benefits of technology

It effectively eliminates regional positioning distortion caused by camera perspective deviation, ensures accurate correspondence between user distribution and actual spatial position, improves the efficiency and accuracy of scene image processing, and reduces the demand for computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120544109B_ABST
    Figure CN120544109B_ABST
Patent Text Reader

Abstract

The present application provides an image processing method, apparatus, device, and storage medium, relating to the field of computer technology. The method comprises: obtaining a first image of a scene captured by a camera, the first image including a plurality of users arranged in the scene; determining, based on the first image, a plurality of first coordinates, the plurality of first coordinates being used to indicate the positions of users at the boundaries of a row in the first image; determining, based on the plurality of first coordinates, a first angle captured by the camera, and rotating the first image according to the first angle to obtain a second image; and determining, based on the second image, distribution information of the plurality of users in the scene, thereby improving the efficiency of determining user distribution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an image processing method, apparatus, device, and storage medium. Background Art

[0002] In some information exchange scenarios, the distribution of users in the scenario can accurately reflect the effectiveness of information exchange. For example, the more students in the front row of a classroom, the better the class is, and the fewer students in the front row, the worse the class is.

[0003] Currently, cameras with multiple perspectives can be set in a scene, and electronic devices can analyze the distribution of users in the scene based on images from multiple perspectives captured by multiple cameras.

[0004] However, in the above method, the electronic device has a high complexity in analyzing images from multiple perspectives captured by multiple cameras, resulting in low efficiency in determining user distribution. Summary of the Invention

[0005] The present application provides an image processing method, apparatus, device, and storage medium to solve the problem of low efficiency in determining user distribution.

[0006] In a first aspect, the present application provides an image processing method, comprising: acquiring a first image of a scene captured by a camera, the first image including a plurality of users arranged in the scene;

[0007] determining, based on the first image, a plurality of first coordinates for indicating a position of the user in the first image at a boundary of a row;

[0008] Determine a first angle of camera shooting based on the multiple first coordinates, and rotate the first image according to the first angle to obtain a second image;

[0009] Based on the second image, distribution information of the plurality of users in the scene is determined.

[0010] In one possible implementation, determining a plurality of first coordinates based on the first image includes:

[0011] Identify users in the first image and obtain second coordinates of each user in the first image;

[0012] Based on the plurality of second coordinates, a plurality of first coordinates are determined.

[0013] In one possible implementation, determining a plurality of first coordinates based on a plurality of second coordinates includes:

[0014] Determine a third coordinate and a fourth coordinate among the plurality of second coordinates, wherein the abscissa of the third coordinate is the smallest and the abscissa of the fourth coordinate is the largest;

[0015] determining a second angle based on the third coordinate and the fourth coordinate, where the second angle is used to indicate a shooting angle of view of the first image;

[0016] Based on the second angle, the third coordinate, and the fourth coordinate, a plurality of first coordinates are determined.

[0017] In a possible implementation, determining a plurality of first coordinates based on the second angle, the third coordinate, and the fourth coordinate includes:

[0018] If the number of the third coordinate is 1 and the number of the fourth coordinate is 1, the third coordinate and the fourth coordinate are determined as the first coordinate;

[0019] If the number of the third coordinates is greater than 1 and the number of the fourth coordinates is greater than 1, the first coordinate is determined among the plurality of third coordinates and the plurality of fourth coordinates based on the second angle.

[0020] In a possible implementation, determining the first coordinate from a plurality of third coordinates and a plurality of fourth coordinates based on the second angle includes:

[0021] When the second angle is positive, among the multiple third coordinates, determine the third coordinate with the smallest vertical coordinate, among the multiple fourth coordinates, determine the fourth coordinate with the largest vertical coordinate, and combine the third coordinate and the fourth coordinate to determine the first coordinate;

[0022] When the second angle is negative, the third coordinate with the largest ordinate is determined among the multiple third coordinates, the fourth coordinate with the smallest ordinate is determined among the multiple fourth coordinates, and the third coordinate and the fourth coordinate are combined to determine the first coordinate.

[0023] In a possible implementation, determining a first angle for camera shooting based on a plurality of first coordinates includes:

[0024] Based on the plurality of first coordinates, determining a difference between the abscissas and the ordinates of the plurality of first coordinates;

[0025] Determine the slope of the line connecting the plurality of first coordinates by taking the ratio of the difference between the ordinates of the plurality of first coordinates and the difference between the abscissas of the plurality of first coordinates;

[0026] A first angle is determined based on a slope of a line connecting the plurality of first coordinates.

[0027] In one possible implementation, determining distribution information of multiple users in a scene based on the second image includes:

[0028] Based on the second image, determining a plurality of indexes;

[0029] Partitioning the second image in parallel to the horizontal axis according to the multiple indexes to obtain multiple sub-images;

[0030] Based on the users in the multiple sub-images, distribution information of the multiple users in the scene is determined.

[0031] In a second aspect, the present application provides an image processing device, comprising: an acquisition module, a first determination module, a processing module, and a second determination module, wherein:

[0032] The acquisition module is used to: acquire a first image of a scene captured by a camera, wherein the first image includes a plurality of users arranged in the scene;

[0033] The first determining module is configured to: determine a plurality of first coordinates based on the first image, the plurality of first coordinates being used to indicate a position of a user at a boundary of a row in the first image;

[0034] The processing module is used to: determine a first angle of camera shooting based on the multiple first coordinates, and rotate the first image according to the first angle to obtain a second image;

[0035] The second determining module is used to determine distribution information of multiple users in the scene based on the second image.

[0036] In a possible implementation, the first determining module is specifically configured to:

[0037] Identify users in the first image and obtain second coordinates of each user in the first image;

[0038] Based on the plurality of second coordinates, a plurality of first coordinates are determined.

[0039] In a possible implementation, the first determining module is specifically configured to:

[0040] Determine a third coordinate and a fourth coordinate among the plurality of second coordinates, wherein the abscissa of the third coordinate is the smallest and the abscissa of the fourth coordinate is the largest;

[0041] determining a second angle based on the third coordinate and the fourth coordinate, where the second angle is used to indicate a shooting angle of view of the first image;

[0042] Based on the second angle, the third coordinate, and the fourth coordinate, a plurality of first coordinates are determined.

[0043] In a possible implementation, the first determining module is specifically configured to:

[0044] If the number of the third coordinate is 1 and the number of the fourth coordinate is 1, the third coordinate and the fourth coordinate are determined as the first coordinate;

[0045] If the number of the third coordinates is greater than 1 and the number of the fourth coordinates is greater than 1, the first coordinate is determined among the plurality of third coordinates and the plurality of fourth coordinates based on the second angle.

[0046] In a possible implementation, the first determining module is specifically configured to:

[0047] When the second angle is positive, among the multiple third coordinates, determine the third coordinate with the smallest vertical coordinate, among the multiple fourth coordinates, determine the fourth coordinate with the largest vertical coordinate, and combine the third coordinate and the fourth coordinate to determine the first coordinate;

[0048] When the second angle is negative, the third coordinate with the largest ordinate is determined among the multiple third coordinates, the fourth coordinate with the smallest ordinate is determined among the multiple fourth coordinates, and the third coordinate and the fourth coordinate are combined to determine the first coordinate.

[0049] In a possible implementation, the processing module is specifically configured to:

[0050] Based on the plurality of first coordinates, determining a difference between the abscissas and the ordinates of the plurality of first coordinates;

[0051] Determine the slope of the line connecting the plurality of first coordinates by taking the ratio of the difference between the ordinates of the plurality of first coordinates and the difference between the abscissas of the plurality of first coordinates;

[0052] A first angle is determined based on a slope of a line connecting the plurality of first coordinates.

[0053] In a possible implementation, the second determining module is specifically configured to:

[0054] Based on the second image, determining a plurality of indexes;

[0055] Partitioning the second image in parallel to the horizontal axis according to the multiple indexes to obtain multiple sub-images;

[0056] Based on the users in the multiple sub-images, distribution information of the multiple users in the scene is determined.

[0057] In a third aspect, an embodiment of the present application provides an electronic device comprising: at least one processor and a memory; the memory stores computer-executable instructions; and at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the image processing method as described in the first aspect above and any item of the first aspect that may be involved.

[0058] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the image processing method as described in the first aspect and any item of the first aspect is implemented.

[0059] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the image processing method as described in the first aspect and any item of the first aspect.

[0060] The image processing method, apparatus, device and storage medium provided by the present application can determine multiple first coordinates based on multiple arranged users in the first image when it is necessary to evaluate the effect of scenes such as classroom teaching, and further determine the first angle of camera shooting based on the multiple first coordinates. After the first image is rotationally corrected based on the first angle, the distribution information of multiple users can be determined, thereby achieving effect evaluation in the scene. In the above method, the electronic device can accurately calculate the angle of camera shooting through the coordinates of users at the boundary of a row of scenes, and perform rotation correction on the first image. This process effectively eliminates the regional positioning distortion caused by the deviation of the camera shooting angle without manual intervention. In addition, the electronic device can ensure the accurate correspondence between the user distribution and the actual spatial position by performing partition analysis on the corrected image, thereby reducing the manual configuration link. The above method does not require a large amount of computing resources on the basis of ensuring the accuracy and efficiency of user distribution information, thereby improving the processing efficiency of scene images. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0062] Figure 1 A schematic diagram of the system architecture provided in an embodiment of the present application;

[0063] Figure 2 A flowchart of an image processing method provided in an embodiment of the present application;

[0064] Figure 3 A schematic diagram of a coordinate system of a first image provided in an embodiment of the present application;

[0065] Figure 4 A schematic diagram of a process for determining multiple first coordinates provided in an embodiment of the present application;

[0066] Figure 5 A schematic diagram of a first possible method for determining a first coordinate provided in an embodiment of the present application;

[0067] Figure 6 A schematic diagram of a second possible method for determining the first coordinate provided in an embodiment of the present application;

[0068] Figure 7 A schematic diagram of a third possible method for determining the first coordinate provided in an embodiment of the present application;

[0069] Figure 8 A schematic diagram of a fourth possible method for determining the first coordinate provided in an embodiment of the present application;

[0070] Figure 9 A schematic diagram of another image processing method provided in an embodiment of the present application;

[0071] Figure 10 A schematic diagram of the boundary of a second image provided in an embodiment of the present application;

[0072] Figure 11 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application;

[0073] Figure 12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0074] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION

[0075] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0076] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and corresponding operation entrances must be provided for users to choose to authorize or refuse.

[0077] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned. They should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0078] For ease of understanding, the following Figure 1, describes the application scenarios to which the embodiments of the present application are applicable.

[0079] Figure 1 This is a schematic diagram of the application scenario provided by the embodiment of this application. Figure 1 , including a camera device 101 and an electronic device 102.

[0080] The camera device 101 can be a camera, a monitoring device, or the like. The camera device 101 can capture a video or continuous image of the preset scene. For example, the camera device 101 can be a monitoring device in a classroom, and the electronic device 102 can be a terminal device or a server. The camera device 101 can send the captured continuous images or video to the electronic device 102, and the electronic device 102 can process the received continuous images or video.

[0081] Currently, cameras with multiple viewpoints can be set up in a scene, and electronic devices can analyze the distribution of users in the scene based on images captured by multiple cameras from multiple viewpoints. However, in the above method, the electronic device's analysis of images captured by multiple cameras from multiple viewpoints is complex, resulting in low efficiency in determining user distribution.

[0082] To address the above issues, in an embodiment of the present application, when determining user distribution information for a scenario such as classroom teaching (an example of an application scenario in the embodiment of the present application, not a limitation), a first image including multiple arranged users is obtained, and first coordinates indicating a boundary are determined based on the positions of the users in the first image. After calculating the camera shooting angle based on the first coordinates, the first image is rotationally corrected, and the user distribution information is analyzed based on the corrected image. In this process, the electronic device can perform rotation correction on the first image, which has angular deviations, by identifying the coordinates (first coordinates) of users at a row of boundaries in the scene. This process requires no human intervention and effectively eliminates regional positioning distortion caused by camera shooting angle deviations. Furthermore, based on the corrected first image, the electronic device can analyze users in various areas of the image, such as the front and back rows, to accurately determine the distribution information of multiple users in the scene, ensuring that the user distribution accurately corresponds to their actual spatial locations. While ensuring the accuracy and efficiency of user distribution information, this method does not require a large amount of computing resources, saving costs and improving the efficiency of scene image processing.

[0083] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0084] Figure 2 This is a flow chart of an image processing method provided in an embodiment of the present application. Figure 2 As shown, the method may include the following steps:

[0085] S201: Acquire a first image of a scene captured by a camera.

[0086] The execution subject of the embodiments of the present application may be an electronic device, or an image processing device provided in the electronic device. The image processing device may be implemented by software, or by a combination of software and hardware. The electronic device may be a terminal device or a server.

[0087] A scenario is used to indicate the scenario in which user distribution information for each area needs to be determined, and the scenario includes multiple arranged users. For example, a scenario can refer to a classroom teaching scenario or a multi-person conference scenario. Users in a classroom teaching scenario can refer to students, while users in a multi-person conference scenario can refer to participants in the meeting.

[0088] The first image includes a plurality of users arranged in a scene.

[0089] The first image may refer to image information obtained by a camera in a scene such as classroom teaching. Specifically, multiple users in the first image may be distributed in an arrangement order. For example, the first image includes multiple rows and columns, where user A and user B are adjacent to each other on the left and right, and user C and user B are adjacent to each other in front and back.

[0090] In some embodiments, the camera is fixedly set at the top or side wall corner of the scene to cover the entire scene. For example, in a classroom teaching scene, the camera is fixedly set at the front corner of the classroom. In this way, during the shooting process, the shooting angle of the camera will change with the different deployment positions of the camera, thereby obtaining scene images of different angles, i.e., the first image.

[0091] In some embodiments, a camera may capture an image of a scene and send the image to a terminal device, which may determine the image as a first image. For example, a camera may capture multiple continuous videos of a scene and send the multiple continuous videos to an electronic device. The electronic device may extract each frame of the video based on the video captured by the camera and process any one of the frames. Alternatively, the camera may select a portion of the video from the multiple continuous videos and send the portion to the electronic device. The electronic device may extract multiple images based on the portion of the video for processing, thereby reducing transmission resources between the camera and the electronic device.

[0092] In some embodiments, after an electronic device receives multiple video clips, the electronic device may select a first image from the multiple frames. Optionally, the first image includes all users in the scene, and the clarity of the first image is greater than or equal to a preset clarity. For example, the camera may be a high-definition camera, and the limb occlusion ratio of the user in the first image is less than or equal to a preset occlusion ratio. This ensures high image quality for the first image, accurately captures user information in the first image, such as facial location, and thereby improves image processing efficiency.

[0093] S202: Determine a plurality of first coordinates based on the first image.

[0094] The plurality of first coordinates are used to indicate a position of a user at a boundary of a row in the first image.

[0095] In some embodiments, the first coordinate includes multiple front row seat points in the scene. For example, in a classroom teaching scene, the first image includes multiple students distributed in rows and columns of seats, where student A and student B are on both sides of the first row, and the coordinates of student A in the first image are (x1, y1), and the coordinates of student B in the first image are (x2, y2), then (x1, y1) and (x2, y2) are determined as the first coordinates.

[0096] Next, combine Figure 3 , the coordinate system of the first image is explained through a specific example.

[0097] Figure 3 For a schematic diagram of the coordinate system of the first image provided in the embodiment of the present application, see Figure 3 , including a coordinate system of the first image, a coordinate system is established with the upper left corner of the first image as the coordinate origin, wherein the horizontal axis (x-axis) extends horizontally to the right, and the vertical axis (y-axis) extends vertically downward, and multiple users are arranged and distributed in the coordinate system of the first image and drawn with solid circles.

[0098] The electronic device may determine the multiple first coordinates based on the following feasible implementation manner: identifying the users in the first image to obtain the second coordinates of each user in the first image; and determining the multiple first coordinates based on the multiple second coordinates.

[0099] The second coordinates may refer to a plurality of human coordinates identified from the first image by a human body detection algorithm.

[0100] In some embodiments, before the electronic device receives the first image, the electronic device can establish a preset data set and train a human body detection model based on the preset data set to obtain a trained human body detection model, wherein the preset data set includes coordinate images of multiple users arranged in each scene. In this way, the electronic device can use the trained human body detection model to perform human body recognition on multiple users in the first image, thereby improving the accuracy of human body recognition.

[0101] In some embodiments, after the electronic device obtains multiple second coordinates, the electronic device can determine multiple first coordinates based on the spatial distribution characteristics of the multiple second coordinates. For example, the electronic device can determine the coordinate positions that can indicate a row of boundaries based on the distribution pattern of the horizontal and vertical coordinate values ​​of the multiple second coordinates, such as the second coordinate with the smallest horizontal coordinate and the coordinate with the largest horizontal coordinate, and then determine multiple first coordinates.

[0102] Exemplarily, a coordinate system is established with a corner (e.g., the upper left corner) of a first image as the coordinate origin. The first image includes user A, user B, user C, and user D, wherein user A is at the leftmost position in the first row of the scene, with a second coordinate of (0, 200), user B is at the rightmost position in the first row of the scene, with a second coordinate of (300, 200), user C's second coordinate is (100, 50), and user D's second coordinate is (200, 150). Among them, the horizontal coordinate of user A is the smallest, the horizontal coordinate of user B is the largest, and user A and user B are located in the front row, meeting the requirement of a row boundary. The electronic device then determines the coordinates (0, 200) of user A and the coordinates (300, 200) of user B as multiple first coordinates.

[0103] S203: Determine a first angle of camera shooting based on the multiple first coordinates, and rotate the first image according to the first angle to obtain a second image.

[0104] The first angle is used to indicate the tilt degree of the first image, that is, the actual offset angle captured by the camera. For example, the first angle may be 30 degrees.

[0105] In some embodiments, after the electronic device determines multiple second coordinates in the first image, that is, two second coordinates of a row of boundaries, it can calculate the slope of the straight line obtained by connecting the second coordinates based on these second coordinates, and then determine the first angle.

[0106] Exemplarily, the plurality of second coordinates include (x1, y1) and (x2, y2), where (x1, y1) is the second coordinate of a row of users on the left side of the boundary, and (x2, y2) is the second coordinate of a row of users on the right side of the boundary. The slope k of the line connecting the two points can be determined as:

[0107]

[0108] In some embodiments, when the electronic device rotates the first image, the electronic device can rotate the first image based on the mapping relationship between the pixels in the first image and the image matrix, that is, rearrange the pixels in the image to obtain new pixels. Specifically, the electronic device obtains the pixels in the first image and performs a coordinate transformation on each pixel based on the first angle and the rotation matrix, maps each pixel in the image to a new position, and obtains the rotated first image, that is, the second image.

[0109] S204: Determine distribution information of multiple users in the scene based on the second image.

[0110] The distribution information may refer to the process conditions of each area in the scenario.

[0111] In some embodiments, the electronic device can determine the distribution of multiple users in different areas based on the second image through a preset partition threshold. The preset partition threshold refers to a pre-set division ratio of each area of ​​the image, that is, the preset partition threshold can include the front row area ratio, the middle row area ratio and the back row area ratio. For example, the front row area ratio is 30%, the middle row area ratio is 30%, and the back row area ratio is 40%.

[0112] In some embodiments, the distribution information may include arrangement information, behavior information, and regional participation (for example, front row area participation, etc.) of multiple users in the second image. For example, the distribution information may be the number of users in the scene, user locations, user head-up rates, and user interaction frequency.

[0113] For example, the distribution information may be as shown in Table 1:

[0114] Table 1

[0115]

[0116] In some embodiments, the electronic device can determine the effectiveness of the scenario based on the user's distribution information. Specifically, the electronic device can quantitatively evaluate the effect of each area (for example, a scoring system) and determine the effectiveness of the scenario based on the weight of each area. The electronic device can set different weights for each area. For example, the weight of the front area is 20%, the weight of the middle area is 30%, and the weight of the back area is 50%.

[0117] In some embodiments, the electronic device can determine the corresponding weight of each distribution information, and then determine the quantitative evaluation of each area. In addition, the electronic device can also determine the weight of each area based on the importance of each area, and then determine the overall effect evaluation of the scene.

[0118] For example, in a classroom teaching scenario, after the electronic device partitions the second image, images of the front row, middle row and back row are obtained, where the number of students in the front row is 5, the number of students in the middle row is 10, and the number of students in the back row is 15. The electronic device analyzes the images of each area in turn. The head-up rate of students in the front row is 85%, and the participation is 90%; the head-up rate of students in the middle row is 78%, and the participation is 85%; the head-up rate of students in the back row is 60%, and the participation is 60%. If the electronic device determines that the scores of each area are 73, 72 and 58 points respectively based on the number of users, user head-up rate and user participation in each area, where the weight of the front row is 20%, the weight of the middle row is 30%, and the weight of the back row is 50%, then the teaching quality evaluation in this scenario is 65 points.

[0119] In some embodiments, the electronic device can determine the effect of the scene based on the evaluation results. The effect of the scene can be excellent, good, or poor. For example, if the evaluation result of the scene is 80-100 points, the effect of the scene is excellent. If the evaluation result of the scene is 60-80 points, the effect of the scene is good. If the evaluation result of the scene is below 60 points, the effect of the scene is poor.

[0120] In an embodiment of the present application, when it is necessary to determine the distribution of users in a scene, a first image including multiple arranged users is obtained, and first coordinates indicating a boundary are determined based on the positions of the users in the first image. After calculating the camera shooting angle based on the first coordinates, the first image is rotationally corrected, and the user distribution information is analyzed based on the corrected image. In the above process, the electronic device can perform rotation correction on the first image with angular deviation by identifying the coordinates (first coordinates) of users at a row of boundaries in the scene. This process requires no human intervention and effectively eliminates regional positioning distortion caused by camera shooting angle deviation. In addition, the electronic device can analyze users in various areas of the image, such as the front row and the back row, based on the corrected first image, and thus accurately determine the distribution information of multiple users in the scene, ensuring that the user distribution accurately corresponds to the actual spatial location. While ensuring the accuracy and efficiency of user distribution information, the above method does not require a large amount of computing resources, saves costs, and improves the efficiency of scene image processing.

[0121] Based on any of the above embodiments, Figure 4 , the method for determining the target human body type ( Figure 2 S202 in the embodiment is described in detail.

[0122] Figure 4This is a schematic diagram of the process of determining multiple first coordinates provided in an embodiment of the present application. Figure 4 , the method may include:

[0123] S401: Identify users in a first image to obtain second coordinates of each user in the first image.

[0124] In some embodiments, the electronic device can input the first picture into a preset network model (human body detection model), which is used to detect all human bodies in the first image and output the identification position of each human body in the image (for example, a rectangular box), while outputting the coordinate information (second coordinates) and number of the human bodies.

[0125] In some embodiments, the coordinate information of the human body output by the human body detection model is Pn[x, y, w, h], where the range of n is [0, m], m is the number of all human bodies detected by the human body detection model in the first image, x is the horizontal coordinate of the human body in the first image coordinate system (for example, the upper left corner of the rectangular box), y is the vertical coordinate of the human body in the first image coordinate system, w is the width of the human body in the first image coordinate system, that is, the width of the rectangular box, and h is the height of the human body in the first image coordinate system, that is, the height of the rectangular box.

[0126] S402: Determine a third coordinate and a fourth coordinate among the plurality of second coordinates.

[0127] Among them, the abscissa of the third coordinate is the smallest, and the abscissa of the fourth coordinate is the largest.

[0128] The third coordinate may refer to the coordinate position on the left side of a row boundary in the first image. For example, in a classroom teaching scene, the third coordinate is used to indicate the position of the first student on the leftmost side of the first row.

[0129] The fourth coordinate may refer to a coordinate position on the right side of a row boundary in the first image. For example, in a classroom teaching scenario, the fourth coordinate is used to indicate the position of the first student on the far right of the first row.

[0130] In some embodiments, due to deviations in camera shooting angles, if multiple users are arranged according to their positions in the scene, there will be a third coordinate and a fourth coordinate in the first image; if multiple users are not arranged according to their positions in the scene, there may be multiple third coordinates and / or multiple fourth coordinates in the first image.

[0131] S403: Determine a second angle based on the third coordinate and the fourth coordinate.

[0132] The second angle is used to indicate the shooting angle of the first image.

[0133] In some embodiments, if the second angle is positive, it indicates that the shooting angle of the first image is offset to the left of the scene; if the second angle is negative, it indicates that the shooting angle of the first image is offset to the right of the scene.

[0134] In some embodiments, the electronic device can calculate the slope of the straight line connecting the third coordinate and the fourth coordinate based on the third coordinate and the fourth coordinate. After the electronic device determines the slope, the electronic device obtains the second angle corresponding to the slope through the inverse tangent function.

[0135] S404: If the number of the third coordinate is 1 and the number of the fourth coordinate is 1, determine the third coordinate and the fourth coordinate as the first coordinate.

[0136] In some embodiments, if the ordinate of the third coordinate is smaller than the ordinate of the fourth coordinate, the second angle is positive, and if the ordinate of the third coordinate is larger than the ordinate of the fourth coordinate, the second angle is negative.

[0137] In some embodiments, if the second angle is positive, it indicates that the first image is offset clockwise in the horizontal direction, the number of the third coordinate is 1, and the number of the fourth coordinate is 1, which indicates that multiple users in the first image are arranged and distributed according to preset positions, then the third coordinate and the fourth coordinate correspond to the leftmost and rightmost positions of the user arrangement, respectively, that is, the first coordinate.

[0138] In some embodiments, if the second angle is negative, it indicates that the first image is offset counterclockwise in the horizontal direction, the number of the third coordinate is 1, and the number of the fourth coordinate is 1, which indicates that multiple users in the first image are arranged and distributed according to preset positions, then the third coordinate and the fourth coordinate correspond to the leftmost and rightmost positions of the user arrangement, respectively, that is, the first coordinate.

[0139] Next, combine Figure 5 and Figure 6 , the method for determining the possible first coordinate is explained through specific examples.

[0140] Figure 5 A schematic diagram of a first possible method for determining a first coordinate provided in an embodiment of the present application, Figure 6 For a schematic diagram of a second possible method for determining the first coordinate provided in an embodiment of the present application, see Figure 5 and Figure 6 , Figure 5 The second angle in is positive, Figure 6The second angle in is negative. In this scene, there are multiple users arranged in each row. Among them, user A is located on the left side of the first row boundary with coordinates (x1, y1), and user B is located on the right side of the first row boundary with coordinates (x2, y2). In addition, the positions of other users in this scene are represented by solid circles. It can be obtained that the horizontal coordinate of user A's coordinate in the first image coordinate system is the smallest, that is, the third coordinate, and the horizontal coordinate of user B's coordinate in the first image coordinate system is the largest, that is, the fourth coordinate. Then the electronic device can determine (x1, y1) and (x2, y2) as the first coordinate.

[0141] S405 : If the number of the third coordinates is greater than 1 and the number of the fourth coordinates is greater than 1, determine a first coordinate from the plurality of third coordinates and the plurality of fourth coordinates based on the second angle.

[0142] The electronic device can determine the first coordinate based on the following feasible implementation method: when the second angle is positive, determine the third coordinate with the smallest vertical coordinate among multiple third coordinates, determine the fourth coordinate with the largest vertical coordinate among multiple fourth coordinates, and use the third coordinate and the fourth coordinate to determine the first coordinate; when the second angle is negative, determine the third coordinate with the largest vertical coordinate among multiple third coordinates, determine the fourth coordinate with the smallest vertical coordinate among multiple fourth coordinates, and use the third coordinate and the fourth coordinate to determine the first coordinate.

[0143] In some embodiments, when the electronic device determines the first coordinate, the electronic device may select a set of third coordinates and fourth coordinates from bottom to top based on multiple third coordinates and multiple fourth coordinates in the first image. For example, if there are multiple third coordinates and multiple fourth coordinates, the electronic device may select the lowest third coordinate and the lowest fourth coordinate to determine the second angle, and determine the shooting angle of the first image based on the second angle. The second angle may be the angle between the line connecting the third coordinate of the smallest surface and the lowest fourth coordinate and the horizontal line.

[0144] In some embodiments, when the second angle is positive, if the number of third coordinates is greater than 1 and the number of fourth coordinates is 1, then among the multiple third coordinates, the third coordinate with the smallest vertical coordinate is determined, and the third coordinate and the fourth coordinate are determined as the first coordinate.

[0145] For example, when the second angle is positive, if the number of third coordinates is 2, and the two third coordinates are (0, 200) and (0, 150), and the fourth coordinate is (300, 200), then (0, 150) is determined as the third coordinate, and (0, 150) and (300, 200) are determined as the first coordinates.

[0146] In some embodiments, when the second angle is positive, if the number of third coordinates is 1 and the number of fourth coordinates is greater than 1, the fourth coordinate with the largest vertical coordinate is determined among the plurality of fourth coordinates, and the third coordinate and the fourth coordinate are determined as the first coordinate.

[0147] For example, when the second angle is positive, the third coordinate is (0, 150). If the number of fourth coordinates is 2, and the two fourth coordinates are (300, 200) and (300, 180), respectively, (300, 200) is determined as the fourth coordinate, and (0, 150) and (300, 200) are determined as the first coordinates.

[0148] In some embodiments, when the second angle is positive, if the number of third coordinates is greater than 1 and the number of fourth coordinates is greater than 1, then among the multiple third coordinates, the third coordinate with the smallest vertical coordinate is determined, and among the multiple fourth coordinates, the third coordinate with the largest vertical coordinate is determined, and the third coordinate and the fourth coordinate are determined as the first coordinate.

[0149] Next, combine Figure 7 , through a specific example, the third possible method for determining the first coordinate is explained.

[0150] Figure 7 For a schematic diagram of a third possible method for determining the first coordinate provided in an embodiment of the present application, see Figure 7 , the second angle is positive, the coordinates of user A and user B are the third coordinates, which are (x1, y1) and (x1, y2) respectively, the coordinates of user C and user D are the fourth coordinates, which are (x2, y3) and (x2, y4) respectively, and the positions of other users are represented by solid circles, where y1 is less than y2 and y3 is greater than y4. The electronic device can determine the coordinates (x1, y1) of user A and the coordinates (x2, y3) of user C as the first coordinates.

[0151] In some embodiments, when the second angle is negative, if the number of third coordinates is greater than 1 and the number of fourth coordinates is 1, then among the multiple third coordinates, the third coordinate with the largest vertical coordinate is determined, and the third coordinate and the fourth coordinate are determined as the first coordinate.

[0152] For example, when the second angle is negative, if the number of third coordinates is 2, and the two third coordinates are (0, 200) and (0, 150), and the fourth coordinate is (300, 150), then (0, 200) is determined as the third coordinate, and (0, 200) and (300, 150) are determined as the first coordinates.

[0153] In some embodiments, when the second angle is negative, if the number of third coordinates is 1 and the number of fourth coordinates is greater than 1, then among the multiple fourth coordinates, the fourth coordinate with the smallest vertical coordinate is determined, and the third coordinate and the fourth coordinate are determined as the first coordinate.

[0154] For example, when the second angle is negative, the third coordinate is (0, 200). If the number of fourth coordinates is 2, and the two fourth coordinates are (300, 200) and (300, 150), respectively, (300, 150) is determined as the fourth coordinate, and (0, 150) and (300, 150) are determined as the first coordinates.

[0155] In some embodiments, when the second angle is negative, if the number of third coordinates is greater than 1 and the number of fourth coordinates is greater than 1, then among the multiple third coordinates, the third coordinate with the largest vertical coordinate is determined, and among the multiple fourth coordinates, the third coordinate with the smallest vertical coordinate is determined, and the third coordinate and the fourth coordinate are determined as the first coordinate.

[0156] Next, combine Figure 8 , through a specific example, the fourth possible method for determining the first coordinate is explained.

[0157] Figure 8 For a schematic diagram of a fourth possible method for determining the first coordinate provided in an embodiment of the present application, see Figure 8 , the second angle is negative, the coordinates of user A and user B are the third coordinates, which are (x1, y1) and (x1, y2) respectively, the coordinates of user C and user D are the fourth coordinates, which are (x2, y3) and (x2, y4) respectively, and the positions of other users are represented by solid circles, where y1 is greater than y2, and y3 is greater than y4. The electronic device can determine the coordinates (x1, y1) of user A and the coordinates (x2, y4) of user D as the first coordinates.

[0158] In an embodiment of the present application, by identifying the users in the first image and obtaining the second coordinates of each user in the image, the third coordinate and the fourth coordinate are determined in these second coordinates, and the first coordinate is determined based on the second angle. In the above method, the electronic device can effectively identify the boundary position of the user in the image by determining the horizontal coordinate range of the third coordinate and the fourth coordinate. Moreover, based on the second angle, the electronic device can judge the degree of inclination of the user position in the image and determine the first coordinate through different coordinate screening strategies. This process ensures the accuracy and stability of coordinate selection, can adapt to images with different inclination directions, avoids boundary misjudgment caused by image tilt, has wide applicability and flexibility, and not only improves the accuracy of the first coordinate, but also improves the overall performance of the system.

[0159] Based on any of the above embodiments, Figure 9 , the image processing method is explained in detail.

[0160] Figure 9 This is a schematic diagram of another image processing method provided in an embodiment of the present application. Figure 9 , the method may include:

[0161] S901: Acquire a first image of a scene captured by a camera.

[0162] The first image includes a plurality of users arranged in a scene.

[0163] It should be noted that the execution process of the above S901 can be referred to S201 and will not be repeated here.

[0164] S902: Identify users in the first image and obtain second coordinates of each user in the first image.

[0165] S903: Determine a third coordinate and a fourth coordinate among the multiple second coordinates.

[0166] Among them, the abscissa of the third coordinate is the smallest, and the abscissa of the fourth coordinate is the largest.

[0167] S904: Determine a second angle based on the third coordinate and the fourth coordinate.

[0168] The second angle is used to indicate the shooting angle of the first image.

[0169] S905: Determine a plurality of first coordinates based on the second angle, the third coordinate, and the fourth coordinate.

[0170] The electronic device can determine multiple first coordinates based on the following feasible implementation method: if the number of third coordinates is 1 and the number of fourth coordinates is 1, the third coordinates and the fourth coordinates are determined as the first coordinates; if the number of third coordinates is greater than 1 and the number of fourth coordinates is greater than 1, the first coordinate is determined from the multiple third coordinates and the multiple fourth coordinates based on the second angle.

[0171] It should be noted that the execution process of the above S902-S905 can be referred to S401-S405, and will not be repeated here.

[0172] S906 : Based on the multiple first coordinates, determine the difference between the abscissas and the ordinates of the multiple first coordinates.

[0173] In some embodiments, the number of the first coordinates is 2, namely (x1, y1) and (x2, y2), the difference of the horizontal coordinates thereof is x2-x1, and the difference of the vertical coordinates thereof is y2-y1.

[0174] S907 . Determine the slope of the line connecting the plurality of first coordinates by taking the ratio of the difference between the ordinates of the plurality of first coordinates to the difference between the abscissas of the plurality of first coordinates.

[0175] In some embodiments, the slope of the line connecting the plurality of first coordinates is:

[0176]

[0177] S908: Determine a first angle based on the slope of a line connecting the plurality of first coordinates.

[0178] In some embodiments, the electronic device may determine the first angle by using an inverse tangent function:

[0179]

[0180] S909: Rotate the first image according to the first angle to obtain a second image.

[0181] In some embodiments, an image is stored in the form of a matrix, and the image includes multiple pixels, that is, each pixel corresponds to an element in the matrix, such as a color. When the electronic device rotates the first image, the electronic device needs to perform a position transformation on each pixel (x, y) in the first image based on the first angle to obtain each pixel (x, y) in the second image:

[0182]

[0183]

[0184] In some embodiments, if the pixel point in the second image is a decimal, the electronic device can determine the pixel point through interpolation processing, for example, using a two-line interpolation method. Specifically, the electronic device performs a weighted average of the four pixel point values ​​around the pixel point to determine the integer value of the pixel point.

[0185] In some embodiments, the longitudinal boundary of the second image can be determined by multiple first coordinates, and the upper horizontal boundary of the second image is not parallel to the horizontal direction. The electronic device can obtain an optimized second image through image compensation. Specifically, the electronic device can expand the upper horizontal boundary of the second image and determine a blank area so that the upper horizontal boundary is parallel to the horizontal direction, and the expanded second image includes all users in the image before rotation. The blank area is used to indicate the area in the second image that exceeds the original horizontal boundary, and the electronic device can fill the blank area with color, for example, white, etc.

[0186] Next, combine Figure 10 , the boundary of the second image is explained through a specific example.

[0187] Figure 10 For a schematic diagram of the boundary of the second image provided in the embodiment of the present application, see Figure 10 , including the original horizontal boundary, the current horizontal boundary and the vertical boundary of the second image, wherein the area between the original upper horizontal boundary, the current upper horizontal boundary and the right vertical boundary is a blank area.

[0188] S910: Determine multiple indexes based on the second image.

[0189] The index may refer to an area identifier in the second image, that is, the electronic device may determine the position of each area of ​​the second image through the index.

[0190] In some embodiments, the electronic device can determine multiple indexes based on the matrix of the second image, that is, the arrangement order of the pixels, wherein the rows of the matrix correspond to the vertical axis direction of the second image, and the columns of the matrix correspond to the horizontal axis direction of the second image, that is, the electronic device can determine multiple indexes based on multiple preset partition thresholds. The preset partition thresholds are used to indicate the partition ratio of each area in the second image. For example, the preset partition thresholds are 30%, 40% and 30% respectively. The electronic device can determine the distribution of the pixels through the row and column distribution in the matrix, and then determine multiple indexes.

[0191] In some embodiments, the electronic device can select multiple indexes within the vertical coordinate range of the second image based on multiple preset partition thresholds. For example, if the preset partition thresholds are 50% and 50%, and the vertical coordinate range in the second image is [0, 200], then the indexes are 0, 100, and 200.

[0192] S911 . Partition the second image according to multiple indexes in parallel with the horizontal axis to obtain multiple sub-images.

[0193] The partitioning process may refer to dividing the second image into regions.

[0194] The sub-image is used to indicate an image of each region in the second image.

[0195] In some embodiments, the electronic device may divide the second image along a horizontal direction (perpendicular to the vertical axis) based on the multiple index positions to obtain multiple sub-images.

[0196] In some embodiments, the sub-image includes a front area image and a back area image. For example, if the preset partition thresholds are 20% and 80%, the front area image occupies 20% of the second image and the back area image occupies 80% of the second image.

[0197] In some embodiments, the sub-image includes a front row area image, a middle row area image, and a back row area image. For example, if the preset partition thresholds are 20%, 30%, and 50%, the front row area image occupies 20% of the second image, the middle row area image occupies 30% of the second image, and the back row area image occupies 50% of the second image.

[0198] S912: Determine distribution information of the multiple users in the scene based on the users in the multiple sub-images.

[0199] It should be noted that the execution process of the above S912 can be referred to S204 and will not be repeated here.

[0200] In an embodiment of the present application, a first image is captured by a camera, multiple first coordinates indicating a boundary are determined based on the first image, and a first angle of the first image is calculated using the multiple first coordinates. A second image is obtained by rotating the first image, and after performing image compensation processing on the second image, partition information for each region of the second image is determined based on multiple indexes. In this method, the electronic device dynamically calculates the rotation angle using the boundary coordinates (first coordinates), effectively eliminating regional positioning errors caused by tilted camera deployment. Furthermore, the electronic device ensures the integrity and usability of the corrected image through bilinear interpolation and boundary compensation. Furthermore, the electronic device implements a vertical partitioning strategy to accurately correspond user distribution data with actual spatial locations. In this case, the electronic device can accurately determine user distribution information in a scene without requiring a large amount of computing resources, significantly improving the accuracy and efficiency of image processing. Furthermore, the method can adapt to images with different tilts, enhancing the stability and reliability of image processing. While ensuring the accuracy and efficiency of user distribution information, it does not require a large amount of computing resources, significantly improving system processing efficiency and scene adaptability.

[0201] Figure 11 This is a structural diagram of an image processing device provided in an embodiment of the present application. Figure 11 The image processing device 10 includes: an acquisition module 11, a first determination module 12, a processing module 13 and a second determination module 14, wherein:

[0202] The acquisition module 11 is used to: acquire a first image of a scene captured by a camera, where the first image includes a plurality of users arranged in the scene;

[0203] The first determining module 12 is configured to: determine a plurality of first coordinates based on the first image, where the plurality of first coordinates are used to indicate a position of a user at a boundary of a row in the first image;

[0204] The processing module 13 is configured to: determine a first angle of camera shooting based on the plurality of first coordinates, and rotate the first image according to the first angle to obtain a second image;

[0205] The second determining module 14 is configured to determine distribution information of multiple users in the scene based on the second image.

[0206] An image processing device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0207] In a possible implementation, the first determining module 12 is specifically configured to:

[0208] Identify users in the first image and obtain second coordinates of each user in the first image;

[0209] Based on the plurality of second coordinates, a plurality of first coordinates are determined.

[0210] In a possible implementation, the first determining module 12 is specifically configured to:

[0211] Determine a third coordinate and a fourth coordinate among the plurality of second coordinates, wherein the abscissa of the third coordinate is the smallest and the abscissa of the fourth coordinate is the largest;

[0212] determining a second angle based on the third coordinate and the fourth coordinate, where the second angle is used to indicate a shooting angle of view of the first image;

[0213] Based on the second angle, the third coordinate, and the fourth coordinate, a plurality of first coordinates are determined.

[0214] In a possible implementation, the first determining module 12 is specifically configured to:

[0215] If the number of the third coordinate is 1 and the number of the fourth coordinate is 1, the third coordinate and the fourth coordinate are determined as the first coordinate;

[0216] If the number of the third coordinates is greater than 1 and the number of the fourth coordinates is greater than 1, the first coordinate is determined among the plurality of third coordinates and the plurality of fourth coordinates based on the second angle.

[0217] In a possible implementation, the first determining module 12 is specifically configured to:

[0218] When the second angle is positive, among the multiple third coordinates, determine the third coordinate with the smallest vertical coordinate, among the multiple fourth coordinates, determine the fourth coordinate with the largest vertical coordinate, and combine the third coordinate and the fourth coordinate to determine the first coordinate;

[0219] When the second angle is negative, the third coordinate with the largest ordinate is determined among the multiple third coordinates, the fourth coordinate with the smallest ordinate is determined among the multiple fourth coordinates, and the third coordinate and the fourth coordinate are combined to determine the first coordinate.

[0220] In a possible implementation, the processing module 13 is specifically configured to:

[0221] Based on the plurality of first coordinates, determining a difference between the abscissas and the ordinates of the plurality of first coordinates;

[0222] Determine the slope of the line connecting the plurality of first coordinates by taking the ratio of the difference between the ordinates of the plurality of first coordinates and the difference between the abscissas of the plurality of first coordinates;

[0223] A first angle is determined based on a slope of a line connecting the plurality of first coordinates.

[0224] In a possible implementation, the second determining module 14 is specifically configured to:

[0225] Based on the second image, determining a plurality of indexes;

[0226] Partitioning the second image in parallel to the horizontal axis according to the multiple indexes to obtain multiple sub-images;

[0227] Based on the users in the multiple sub-images, distribution information of the multiple users in the scene is determined.

[0228] An image processing device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0229] Figure 12 This is a schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 12 As shown, the electronic device 20 may include: a transceiver 21 , a processor 22 , and a memory 23 .

[0230] The processor 22 executes the computer-executable instructions stored in the memory, so that the processor 22 implements the solutions in the above-mentioned embodiments. The processor 22 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0231] The memory 23 is connected to the processor 22 via a system bus and communicates with the processor 22. The memory 23 is used to store computer program instructions.

[0232] The transceiver 21 may be used to obtain tasks to be executed and configuration information of the tasks to be executed.

[0233] The system bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. System buses can be divided into address buses, data buses, and control buses. For ease of illustration, the diagram uses only a single thick line, but this does not imply a single bus or type of bus. Transceivers enable communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries). Memory may include random access memory (RAM) and non-volatile memory.

[0234] The electronic device provided in the embodiment of the present application may be the terminal device of the above embodiment.

[0235] An embodiment of the present application also provides a chip for executing instructions, which is used to execute the technical solution of the image processing method in the above embodiment.

[0236] An embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the technical solution of the image processing method in the above embodiment.

[0237] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium, and when at least one processor executes the computer program, it can implement the technical solution of the image processing method in the above embodiment.

[0238] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules is only a logical function division. In actual implementation, there may be other division methods, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or module, which can be electrical, mechanical or other forms.

[0239] Modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, that is, they may be located in one place or distributed across multiple network elements. Some or all of these modules may be selected to implement the solution of this embodiment based on actual needs.

[0240] In addition, the functional modules in the various embodiments of the present application may be integrated into a single processing unit, or each module may exist physically separately, or two or more modules may be integrated into a single unit. The above-mentioned modules may be implemented in the form of hardware or hardware plus software functional units.

[0241] The integrated modules implemented in the form of software function modules can be stored in a computer-readable storage medium. The software function modules stored in a storage medium include a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute some of the steps of the methods of various embodiments of the present application.

[0242] It should be understood that the processor described above may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the present invention may be directly executed by a hardware processor or by a combination of hardware and software modules within the processor.

[0243] The memory may include a high-speed RAM memory, and may also include non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk.

[0244] A bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.

[0245] The storage medium may be implemented by any type of volatile or non-volatile memory device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0246] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic control unit or a main control device.

[0247] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0248] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. An image processing method, characterized in that: include: Acquire a first image of a scene captured by a camera, where the first image includes a plurality of users arranged in the scene; determining, based on the first image, a plurality of first coordinates for indicating positions of users at boundaries of a row in the first image; Determine a first angle of the camera shooting based on the multiple first coordinates, and rotate the first image according to the first angle to obtain a second image; determining distribution information of a plurality of users in the scene based on the second image; The determining the first angle of the camera shooting based on the multiple first coordinates includes: determining the difference between the horizontal coordinates and the vertical coordinates of the multiple first coordinates based on the multiple first coordinates; Determine the slope of the line connecting the plurality of first coordinates by taking the ratio of the difference between the ordinates of the plurality of first coordinates and the difference between the abscissas of the plurality of first coordinates; The first angle is determined based on a slope of a line connecting the plurality of first coordinates.

2. The method according to claim 1, characterized in that Determining a plurality of first coordinates based on the first image includes: Identifying users in the first image to obtain second coordinates of each user in the first image; Based on the plurality of second coordinates, the plurality of first coordinates are determined.

3. The method according to claim 2, characterized in that Determining the plurality of first coordinates based on the plurality of second coordinates includes: Determine a third coordinate and a fourth coordinate among the plurality of second coordinates, wherein the abscissa of the third coordinate is the smallest and the abscissa of the fourth coordinate is the largest; determining a second angle based on the third coordinate and the fourth coordinate, where the second angle is used to indicate a shooting angle of view of the first image; The plurality of first coordinates are determined based on the second angle, the third coordinate, and the fourth coordinate.

4. The method according to claim 3, characterized in that Determining the plurality of first coordinates based on the second angle, the third coordinate, and the fourth coordinate includes: If the number of the third coordinate is 1 and the number of the fourth coordinate is 1, the third coordinate and the fourth coordinate are determined as the first coordinate; If the number of the third coordinates is greater than 1 and the number of the fourth coordinates is greater than 1, the first coordinate is determined from among the plurality of third coordinates and the plurality of fourth coordinates based on the second angle.

5. The method according to claim 4, characterized in that Determining the first coordinate from a plurality of third coordinates and a plurality of fourth coordinates based on the second angle includes: When the second angle is positive, determining the third coordinate with the smallest vertical coordinate among the plurality of third coordinates, determining the fourth coordinate with the largest vertical coordinate among the plurality of fourth coordinates, and determining the first coordinate by combining the third coordinate and the fourth coordinate; When the second angle is negative, the third coordinate having the largest vertical coordinate is determined among the plurality of third coordinates, the fourth coordinate having the smallest vertical coordinate is determined among the plurality of fourth coordinates, and the first coordinate is determined by combining the third coordinate and the fourth coordinate.

6. The method according to claim 1, characterized in that Determining distribution information of the plurality of users in the scene based on the second image includes: determining a plurality of indexes based on the second image; According to the multiple indexes, the second image is partitioned parallel to the horizontal axis to obtain multiple sub-images; Based on the users in the multiple sub-images, distribution information of the multiple users in the scene is determined.

7. An image processing device, characterized in that include: an acquisition module, a first determination module, a processing module, and a second determination module, wherein: The acquisition module is used to: acquire a first image of a scene captured by a camera, wherein the first image includes a plurality of users arranged in the scene; The first determining module is configured to: determine a plurality of first coordinates based on the first image, wherein the plurality of first coordinates are used to indicate positions of users at boundaries of a row in the first image; The processing module is configured to: determine a first angle of the camera based on the multiple first coordinates, and rotate the first image according to the first angle to obtain a second image; The second determining module is configured to: determine distribution information of a plurality of users in the scene based on the second image; The determining the first angle of the camera shooting based on the multiple first coordinates includes: determining the difference between the horizontal coordinates and the vertical coordinates of the multiple first coordinates based on the multiple first coordinates; Determine the slope of the line connecting the plurality of first coordinates by taking the ratio of the difference between the ordinates of the plurality of first coordinates and the difference between the abscissas of the plurality of first coordinates; The first angle is determined based on a slope of a line connecting the plurality of first coordinates.

8. An electronic device, characterized in that: include: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.