Image classification method and device, electronic equipment and storage medium
Through target detection and semantic segmentation technology, feature information of film and television lenses is extracted and film and television lens types are automatically classified, which solves the problem of low image screening efficiency in the film and television industry and achieves efficient film and television lens type identification.
Patent Information
- Application Number
- CN202410892503.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-09-24
AI Technical Summary
Image screening in the film and television industry is difficult and inefficient. Existing technology relies on manual labor and cannot effectively identify film and television lens types.
By acquiring the target image, perform target detection and semantic segmentation, extract the regional feature information and posture feature information of the person, and combine the preset conditions of the film and television lens type to automatically classify the image into over-the-shoulder lens, Dutch angle lens and other types.
It realizes automatic identification of film and television lens types without human participation, improves image screening efficiency, can accurately identify film and television lens types, and meets the film and television industry's demand for high-quality data.
Smart Images

Figure CN118691902A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an image classification method, device, electronic device and storage medium. Background Art
[0002] The current field of generative artificial intelligence (AIGC) has a large demand for image data. Currently, image data acquisition and acceptance rely on manual work, which requires screening image quality factors such as image resolution and blur, and also requires attention to the image's composition language.
[0003] For the film and television industry, the composition of the image itself is more important, such as the image expression of professional film and television terms such as over-the-shoulder shot and Dutch angle shot. At present, there is no method for screening images specifically developed for the film and television industry on the market, and all rely on manual screening, which leads to the problem of difficult and inefficient image screening. Summary of the invention
[0004] The present application provides an image classification method, device, electronic device and storage medium to solve the problem of difficulty and low efficiency in image screening in the prior art.
[0005] In a first aspect, an embodiment of the present application provides an image classification method, comprising:
[0006] Get the target image;
[0007] Performing target detection on the persons in the target image to obtain detection information of each person, wherein the detection information includes regional feature information and person feature information of the person in the target image;
[0008] Based on the region feature information and the character feature information, the target category to which the target image belongs is determined, and the target category is used to indicate the film and television shot type of the target image.
[0009] Optionally, performing target detection on the persons in the target image to obtain detection information of each person includes:
[0010] Performing semantic segmentation on the target image to obtain sub-regions where each person in the target image is located;
[0011] Determining the area of the sub-region and the position of the sub-region in the target image;
[0012] Performing face recognition on the target image to obtain facial feature information of each person;
[0013] Recognizing the postures of the characters and determining posture feature information of each character;
[0014] The area and the position of the sub-region are determined as the region feature information, and the face feature information and the posture feature information are determined as the person feature information.
[0015] Optionally, determining the target category to which the target image belongs based on the region feature information and the person feature information includes:
[0016] Determining whether the posture of the person in the target image is a tilted posture based on the person feature information;
[0017] If so, determining the tilt angle of the person in the target image;
[0018] When the tilt angle is greater than a preset angle, it is determined that the target classification of the target image is a Dutch angle lens image.
[0019] Optionally, the character feature information includes posture feature information of different parts, and judging whether the posture of the character in the target image is a tilted posture based on the character feature information includes:
[0020] Determine a first reference point and a second reference point from the posture feature information of two different parts of the person, or determine a third reference point and a fourth reference point from the posture feature information of the same part of the person;
[0021] Determine whether the product of the vector where the first reference point and the second reference point are located or the vector where the third reference point and the fourth reference point are located and the horizontal direction vector of the target image is within a preset value range;
[0022] If not, it is determined that the posture of the person in the target image is a tilted posture.
[0023] Optionally, the character feature information includes face feature information and the posture feature information, and determining the target category to which the target image belongs based on the region feature information and the character feature information includes:
[0024] Determining whether the spatial distribution of the person in the target image meets a preset distribution condition based on the regional feature information;
[0025] If satisfied, determining whether the facial feature information in the target sub-region is less than a preset amount of information and whether the posture feature information indicates that the position of the person in the target image is above the shoulders;
[0026] If so, determine that the target classification of the target image is an over-the-shoulder shot image.
[0027] Optionally, the region feature information includes the position of the sub-region where the person is located in the target image and the area of the sub-region.
[0028] The preset distribution conditions include:
[0029] The target image includes at least two persons, and there is a target sub-region, and the ratio of the area of the target sub-region to the area of the target image is greater than a preset value; the target sub-region is a sub-region at the edge of the target image.
[0030] Optionally, the character feature information includes face feature information and the posture feature information, and determining the target category to which the target image belongs based on the region feature information and the character feature information includes:
[0031] Determine whether there is a sub-region at the edge of the target image in the target image based on the region feature information;
[0032] If the condition is satisfied, it is determined whether the ratio of the area of the region where the target face feature information is located in the target image to the area of the overlapping region of the sub-region at the edge is less than a preset ratio, and whether the posture feature information of the person in the target area indicates that the part of the person in the target image is the leg;
[0033] If so, determine that the target classification of the target image is a through-the-leg shot image.
[0034] Optionally, obtain the target image, including:
[0035] Acquire an initial image set, wherein the initial image set includes a plurality of initial images;
[0036] Acquire attribute information of each of the initial images, where the attribute information indicates the clarity of the initial image;
[0037] The initial images whose attribute information does not meet the preset clarity condition in the initial image set are filtered to obtain the target image.
[0038] In a second aspect, an embodiment of the present application provides an image classification device, including:
[0039] An acquisition module, used for acquiring a target image;
[0040] A detection module, used to perform target detection on the persons in the target image to obtain detection information of each person, wherein the detection information includes regional feature information and person feature information of the person in the target image;
[0041] The classification module is used to determine the target classification to which the target image belongs based on the regional feature information and the character feature information, and the target classification is used to indicate the film and television shot type of the target image.
[0042] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0043] The memory is used to store computer programs;
[0044] The processor is used to execute the program stored in the memory to implement the image classification method described in the first aspect.
[0045] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the image classification method described in the first aspect.
[0046] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application obtains a target image; performs target detection on the characters in the target image to obtain detection information of each character, the detection information includes the regional feature information and character feature information of the character in the target image; based on the regional feature information and character feature information, determines the target classification to which the target image belongs, and the target classification is used to indicate the film and television lens type of the target image. In this way, by extracting the regional feature information and character feature information in the target image, and then classifying the target image, determining the target classification of the film and television lens type to which the target image belongs, the purpose of automatically identifying the film and television lens type of the image is achieved without human participation, thereby improving the efficiency of image screening. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0049] Figure 1 This is an application scenario diagram of the image classification method provided in one embodiment of the present application;
[0050] Figure 2A flowchart of an image classification method provided in one embodiment of the present application;
[0051] Figure 3 A flowchart of an image classification method provided by another embodiment of the present application;
[0052] Figure 4 A structural diagram of an image classification device provided in one embodiment of the present application;
[0053] Figure 5 A structural diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0055] Before further describing the embodiments of the present invention in detail, the nouns and terms involved in the embodiments of the present invention are described. The nouns and terms involved in the embodiments of the present invention are subject to the following explanations.
[0056] The types of film and television shots can usually be divided into over-the-shoulder shots, single shots, double shots, over-the-back shots, over-the-leg shots, over-the-waist shots, over-the-hip shots, Dutch angle shots, etc. according to the shooting angle and composition of the image.
[0057] Over the shoulder shot: The camera shoots from behind a character's shoulder, usually used in dialogue scenes. Over the back shot: Similar to the over the shoulder shot, but with a lower angle and a larger shooting range, showing more of the back and the environment. Over the legs shot: The camera shoots from behind the character's legs, emphasizing the leg movements or postures. Over the waist shot: The camera shoots from behind the character's waist, usually used to show the character's upper body movements. Over the hip shot: The camera shoots from behind the character's hips, usually used to emphasize the movement or postures of the hips. Dutch angle shot: The camera shoots at an angle, creating a tilted feeling in the picture, used to create a tense, uneasy or strange effect.
[0058] These shot types help the photographer convey specific emotions and narrative effects through different perspectives and compositions.
[0059] According to an embodiment of the present application, a method for classifying an image is provided. Optionally, in the embodiment of the present application, the above-mentioned method for classifying an image can be applied to Figure 1In the hardware environment composed of the terminal 101 and the server 102 shown in FIG. Figure 1 As shown, the server 102 is connected to the terminal 101 via a network, and can be used to provide services (such as video services, application services, etc.) for the terminal or a client installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for the server 102. The above-mentioned network includes but is not limited to: a wide area network, a metropolitan area network or a local area network, and the terminal 101 is not limited to a PC, a mobile phone, a tablet computer, etc.
[0060] The image classification method of the embodiment of the present application may be executed by the server 102, or by the terminal 101, or by both the server 102 and the terminal 101. The terminal 101 may execute the image classification method of the embodiment of the present application, or the client installed thereon.
[0061] Taking the terminal executing the image classification method of the embodiment of the present application as an example, Figure 2 is a flow chart of an optional image classification method according to an embodiment of the present application, such as Figure 2 As shown, the process of the method may include the following steps:
[0062] Step 201: Acquire a target image.
[0063] In some embodiments, the target image refers to an image that needs to be classified, and may be one of a plurality of image sets.
[0064] To improve recognition accuracy, images can be screened before classification.
[0065] In an optional embodiment, acquiring a target image includes:
[0066] Acquire an initial image set, wherein the initial image set includes a plurality of initial images;
[0067] Acquire attribute information of each of the initial images, where the attribute information indicates the clarity of the initial image;
[0068] The initial images whose attribute information does not meet the preset clarity condition in the initial image set are filtered to obtain the target image.
[0069] In some embodiments, the attribute information may be, but is not limited to, image resolution information and image blur. The initial image may be processed using an opencv method to read the resolution information of the initial image, calculate the image resolution ratio, and filter out initial images with resolutions of 16:9, 4:3, and 9:16. At the same time, the Laplace method is used to calculate the blur of the image, and different thresholds are set for different batches of images to filter out clearer target images.
[0070] Step 202: Detect the persons in the target image to obtain detection information of each person, wherein the detection information includes regional feature information and person feature information of the person in the target image.
[0071] In some embodiments, the target image may be detected based on a target detection algorithm to obtain the region feature information and person feature information therein.
[0072] The target detection algorithm may be, but is not limited to, the yolov8 algorithm.
[0073] In an optional embodiment, performing target detection on the persons in the target image to obtain detection information of each person includes:
[0074] Performing semantic segmentation on the target image to obtain sub-regions where each person in the target image is located;
[0075] Determining the area of the sub-region and the position of the sub-region in the target image;
[0076] Performing face recognition on the target image to obtain facial feature information of each person;
[0077] Recognizing the postures of the characters and determining posture feature information of each character;
[0078] The area and the position of the sub-region are determined as the region feature information, and the face feature information and the posture feature information are determined as the person feature information.
[0079] In some embodiments, speech segmentation of a target image can be achieved using a target detection algorithm. The target detection algorithm can be used to identify people in the target image and determine the sub-region where each person is located. The facial features of the people in the target image can also be identified to determine facial feature information such as the eyes, nose, mouth, and facial contours. The posture of the person can also be identified to determine the key points of each body part of the person to obtain posture feature information.
[0080] Step 203: Determine the target category to which the target image belongs based on the region feature information and the character feature information, where the target category is used to indicate the type of film and television shot of the target image.
[0081] In some embodiments, the image content and composition of the target image are analyzed based on the region feature information and person feature information detected in the target image to determine the target category to which the target image belongs and the corresponding film and television shot type.
[0082] Among them, according to different types of film and television shots, the classification of images can include but is not limited to over-the-shoulder shots, single shots, double shots, over-the-back shots, over-the-leg shots, over-the-waist shots, over-the-hip shots, and Dutch angle shots.
[0083] In order to better classify images of different film and television lens types, corresponding classification logics can be configured according to classification categories. By executing the target image according to each classification logic, when the target image meets the classification conditions in the classification logic, the classification to which the target image belongs is selected, thereby determining the film and television lens type to which the target image belongs.
[0084] In an alternative embodiment,
[0085] The determining the target category to which the target image belongs based on the region feature information and the person feature information includes:
[0086] Determining whether the posture of the person in the target image is a tilted posture based on the person feature information;
[0087] If so, determining the tilt angle of the person in the target image;
[0088] When the tilt angle is greater than a preset angle, it is determined that the target classification of the target image is a Dutch angle lens image.
[0089] In some embodiments, when shooting with a Dutch angle lens, the camera is usually tilted, which will cause the person in the lens to appear tilted. Based on this, it is possible to determine whether the person is in a tilted posture based on the person feature information in the target image. If not, it means that it is not an image using a Dutch angle lens; if so, it means that it may be an image using a Dutch angle lens, and then further determine the tilt angle of the person in the target image. If the tilt angle is greater than a certain preset angle, the target image is considered to be an image using a Dutch angle lens.
[0090] It is understandable that the person in the target image may be a full-body image, an upper-body image, or an image above the shoulders.
[0091] Furthermore, determining whether the person in the target image is in a tilted posture can be achieved by:
[0092] The character feature information includes posture feature information of different parts, and judging whether the posture of the character in the target image is a tilted posture based on the character feature information includes:
[0093] Determine a first reference point and a second reference point from the posture feature information of two different parts of the person, or determine a third reference point and a fourth reference point from the posture feature information of the same part of the person;
[0094] Determine whether the product of the vector where the first reference point and the second reference point are located or the vector where the third reference point and the fourth reference point are located and the horizontal direction vector of the target image is within a preset value range;
[0095] If not, it is determined that the posture of the person in the target image is a tilted posture.
[0096] In some embodiments, after two vectors are dot-producted, if the two vectors are perpendicular, the dot-product result is 0. Since there is a certain error in the character feature information during the monitoring process, in order to avoid misjudgment, a certain preset value range can be set, and the vectors corresponding to the vector dot product results within the range are regarded as perpendicular. The preset value range can be set based on the actual situation, for example, it can be 0.1 to -0.1.
[0097] Among them, when the posture feature information of the waist and below of the person appears in the target image, the above-mentioned different parts can select the neck and buttocks, select the first reference point from the posture feature information of the neck, and select the second reference point from the posture feature information of the buttocks; when only the posture feature information of the part above the shoulders of the person appears in the target image, the above-mentioned same part can select two reference points from the facial feature information, for example, select two key points in the nose bridge area in the facial feature information as the third reference point and the fourth reference point.
[0098] Therefore, two reference points can be found from the posture feature information of the person, and the vector formed by the two reference points is dot-producted with the horizontal vector of the target image. By judging whether the result of the dot product is within a preset numerical range, it is determined whether the person is in a tilted posture.
[0099] The horizontal direction vector of the target image may be a unit vector parallel to the lower edge of the target image. The vector between the first reference point and the second reference point or the vector between the third reference point and the fourth reference point may be a vector directly formed by connecting the two reference points as a vector involved in the calculation, or the vector formed by connecting the two reference points may be converted into a reference vector in the same direction for calculation.
[0100] For example, if the target image contains posture feature information of the waist and below of a person, the posture feature information is used to perform Dutch angle lens judgment, and the key points of the neck and hips are connected into a straight line as a vector and normalized. The dot product is performed with the direction vector of the horizontal axis of the target image to determine whether the person is perpendicular to the picture.
[0101] If only the part above the shoulders of the person appears in the target image, the facial key points are used for calculation. Two key points of the bridge of the nose are randomly selected as a vector and normalized. The vectors are then compared with the horizontal and vertical direction vectors of the target image to determine whether the person is perpendicular to the screen.
[0102] The dot product result calculated according to the above method can be used to calculate the inclination angle between the character and the horizontal axis of the picture. If the inclination angle is greater than or equal to 5 degrees, it is determined to be a Dutch angle lens.
[0103] In an optional embodiment, the character feature information includes face feature information and the posture feature information, and determining the target category to which the target image belongs based on the region feature information and the character feature information includes:
[0104] Determining whether the spatial distribution of the person in the target image meets a preset distribution condition based on the regional feature information;
[0105] If satisfied, determining whether the facial feature information in the target sub-region is less than a preset amount of information and whether the posture feature information indicates that the position of the person in the target image is above the shoulders;
[0106] If so, determine that the target classification of the target image is an over-the-shoulder shot image.
[0107] In some embodiments, when shooting with an over-the-shoulder lens, the camera is usually placed from behind a person's shoulder, with the person as the foreground. This will cause the person in the lens to show the features of his shoulders, and at one end of the image. Based on this, the spatial distribution of the person in the target image can be determined first by the regional feature information in the target image, and the spatial distribution can be used to determine whether the preset distribution conditions are met. Usually, the over-the-shoulder lens is used in a dialogue scene. Therefore, in addition to the shoulder features of a person, there will also be facial feature information of other tasks in the target image. Therefore, whether the person in the target image is an over-the-shoulder lens is determined by the facial feature information and the posture feature information of the person.
[0108] The region feature information includes the position of the sub-region where the person is located in the target image and the area of the sub-region.
[0109] The preset distribution conditions include:
[0110] The target image includes at least two persons, and there is a target sub-region, and the ratio of the area of the target sub-region to the area of the target image is greater than a preset value; the target sub-region is a sub-region at the edge of the target image.
[0111] The number of people in the target image can be determined by the number of detected sub-regions, each of which is a sub-region of a person. If there are multiple sub-regions, it is considered that there are multiple people. Since an over-the-shoulder shot is usually taken from behind a person's shoulder with the person as the foreground, the area occupied by the person in the image is usually large. Therefore, when the area of the target sub-region exceeds a certain range, combined with the above judgment conditions, it can be determined that the target image is an over-the-shoulder shot image.
[0112] Exemplarily, a semantic segmentation map is used to calculate the sub-region where the semantics of the characters appear in the picture. Since over-the-shoulder shots only appear on the left and right sides of the picture, the two regions are identified. If the sub-region falls on the edges of the two sides of the picture, and there are one or more other human semantics in the target image, the next step of judgment is entered, otherwise the process ends. The facial feature information is compared with the target sub-region that appears on the edges of the two sides of the picture in the sub-region. If the majority (more than half) of the coordinates of the facial key points in the facial feature information fall in the target sub-region, the target image is not an over-the-shoulder shot. The posture feature information is used to determine whether the posture feature information of the area below the shoulder appears in the target sub-region. If so, it is determined that the target image is not an over-the-shoulder shot image.
[0113] After the above classification steps, it is calculated whether the area of the target sub-region exceeds one quarter of the total area of the picture. If it is greater than or equal to one quarter, it is determined that the target image is an over-the-shoulder shot image.
[0114] Furthermore, it can be further subdivided according to the different edges where it appears. The shoulder that appears on the left side of the picture is classified as an image shot over the right shoulder, and the shoulder that appears on the right side of the picture is classified as an image shot over the left shoulder.
[0115] In an optional embodiment, the character feature information includes face feature information and the posture feature information, and determining the target category to which the target image belongs based on the region feature information and the character feature information includes:
[0116] Determine whether there is a sub-region at the edge of the target image in the target image based on the region feature information;
[0117] If the condition is satisfied, it is determined whether the ratio of the area of the region where the target face feature information in the target image is located to the area of the overlapping region of the sub-region at the edge is greater than a preset ratio, and whether the posture feature information of the person in the target area indicates that the part of the person in the target image is the leg;
[0118] If so, determine that the target classification of the target image is a through-the-leg shot image.
[0119] In some embodiments, since the camera usually shoots from behind the legs of the person when shooting with a through-the-legs lens, emphasizing the leg movements or postures, only the leg features of the human body will appear in the sub-regions of the semantic segmentation of some characters. Based on this, the legs of the person are usually at the edge of the image. The regional feature information is used to determine whether there is a sub-region at the edge of the target image (i.e., the above-mentioned target sub-region). If not, the next image is judged. If it exists, it is considered that it may be a through-the-legs lens image, and further judgment is performed. The ratio of the area where the facial feature information is located to the area where the target sub-region overlaps is calculated, and the ratio is compared with a preset ratio (for example, one-third). If it is greater than the preset ratio, it means that the area where the facial feature information is located is part of the target sub-region, and the target image is not a through-the-legs lens image. Otherwise, it is considered to be a through-the-legs lens image.
[0120] The target facial feature information region may be the facial feature information region closest to the target sub-region.
[0121] Furthermore, the target sub-regions may be further subdivided according to the different edges where they appear. The image on the left side of the screen is the image of the right leg, and the image on the right side of the screen is the image of the left leg.
[0122] This application innovatively combines the picture rules of film and television terms with target detection technology to solve the current problem of difficulty in acquiring film and television term images. The target detection algorithm Yolov8 used can quickly screen film and television series in real time, which can greatly meet the current AIGC field's demand for data volume, and can provide high-quality clear data. The sample annotations generated according to the present invention can be very accurate. Even ChatGPT4 can hardly determine whether the image is a left shoulder shot or a right shoulder shot. The present invention can solve the vertical field segmentation problem that large models cannot solve.
[0123] In a specific embodiment, the image classification method of the present application is shown in Figure 3 , which may include the following steps:
[0124] The first stage: input the image to be classified, filter the images by resolution, retain the images with the specified resolution, calculate the blur of the image based on the Laplace operator, and select the target image with high clarity based on the blur.
[0125] The second stage: Detect the target image based on the target detection algorithm, and output the semantic segmentation map of the target image (i.e. the above-mentioned sub-region), face recognition key points (i.e. the above-mentioned face feature information) and human posture information (i.e. the above-mentioned posture feature information). By judging whether there is edge human semantics at the edge of the target image (i.e. the above-mentioned target sub-region), if there is, judge whether the face key points coincide with the target sub-region, if not, detect whether there is a new posture feature below the shoulder, if not, calculate the area ratio of the target sub-region at the edge to the target image, if it is greater than one-fourth, classify it as an over-the-shoulder shot image.
[0126] By calculating the direction vector of the human body and doing a dot product with the horizontal axis direction vector of the target image, based on the dot product result, it is determined whether the human body is perpendicular to the target image. If not, the inclination angle between the human body and the target image is calculated. If the inclination angle is greater than 5 degrees, it is classified as a Dutch angle lens image.
[0127] By judging whether the target sub-region and the key points of the face overlap, if not, it is judged whether the human body posture in the edge semantics only includes the leg posture. If so, it is classified as a leg shot.
[0128] The image classification method of the present application preprocesses the image in the first stage, calculates the edge features of the image using the Laplace operator, sets a threshold so that certain images cannot pass the clarity judgment, thereby obtaining an image with distinct features, and identifies the resolution of the image, screening out the required image samples to enter the second stage.
[0129] In the second stage, the object detection algorithm is used to classify the high-quality images obtained in the first stage. According to the image content and composition, they are divided into over-the-shoulder shot, single shot, double shot, over-the-back shot, over-the-leg shot, over-the-waist shot, over-the-hip shot, and Dutch angle shot.
[0130] Based on the same concept, an image classification device is provided in the embodiment of the present application. The specific implementation of the device can be found in the description of the method embodiment part, and the repeated parts will not be repeated. Figure 4 As shown, the device mainly includes:
[0131] An acquisition module 401 is used to acquire a target image;
[0132] A detection module 402 is used to perform target detection on the persons in the target image to obtain detection information of each person, wherein the detection information includes regional feature information and person feature information of the person in the target image;
[0133] The classification module 403 is used to determine the target classification to which the target image belongs based on the region feature information and the character feature information, and the target classification is used to indicate the film and television shot type of the target image.
[0134] Based on the same concept, an electronic device is also provided in the embodiment of the present application, such as Figure 5 As shown, the electronic device mainly includes: a processor 501, a memory 502 and a communication bus 503, wherein the processor 501 and the memory 502 communicate with each other through the communication bus 503. The memory 502 stores a program executable by the processor 501, and the processor 501 executes the program stored in the memory 502 to implement the following steps:
[0135] Get the target image;
[0136] Performing target detection on the persons in the target image to obtain detection information of each person, wherein the detection information includes regional feature information and person feature information of the person in the target image;
[0137] Based on the region feature information and the character feature information, the target category to which the target image belongs is determined, and the target category is used to indicate the film and television shot type of the target image.
[0138] The communication bus 503 mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 503 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0139] The memory 502 may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Alternatively, the memory may also be at least one storage device located away from the processor 501 .
[0140] The above-mentioned processor 501 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc., and 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 gates or transistor logic devices, discrete hardware components.
[0141] In another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed on a computer, the computer executes the image classification method described in the above embodiment.
[0142] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instruction can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instruction is transmitted from a website site, a computer, a server or a data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integration. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape, etc.), an optical medium (such as a DVD) or a semiconductor medium (such as a solid-state hard disk), etc.
[0143] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0144] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for classifying an image, characterized in that: include: Get the target image; Performing target detection on the persons in the target image to obtain detection information of each person, wherein the detection information includes regional feature information and person feature information of the person in the target image; Based on the region feature information and the character feature information, the target category to which the target image belongs is determined, and the target category is used to indicate the film and television shot type of the target image.
2. The image classification method according to claim 1, characterized in that: Performing target detection on the persons in the target image to obtain detection information of each person includes: Performing semantic segmentation on the target image to obtain sub-regions where each person in the target image is located; Determining the area of the sub-region and the position of the sub-region in the target image; Performing face recognition on the target image to obtain facial feature information of each person; Recognizing the postures of the characters and determining posture feature information of each character; The area and the position of the sub-region are determined as the region feature information, and the face feature information and the posture feature information are determined as the person feature information.
3. The image classification method according to claim 1 or 2, characterized in that: The determining the target category to which the target image belongs based on the region feature information and the person feature information includes: Determining whether the posture of the person in the target image is a tilted posture based on the person feature information; If so, determining the tilt angle of the person in the target image; When the tilt angle is greater than a preset angle, it is determined that the target classification of the target image is a Dutch angle lens image.
4. The image classification method according to claim 3, characterized in that: The character feature information includes posture feature information of different parts, and judging whether the posture of the character in the target image is a tilted posture based on the character feature information includes: Determine a first reference point and a second reference point from the posture feature information of two different parts of the person, or determine a third reference point and a fourth reference point from the posture feature information of the same part of the person; Determine whether the product of the vector where the first reference point and the second reference point are located or the vector where the third reference point and the fourth reference point are located and the horizontal direction vector of the target image is within a preset value range; If not, it is determined that the posture of the person in the target image is a tilted posture.
5. The image classification method according to claim 1 or 2, characterized in that: The character feature information includes face feature information and posture feature information. The determining the target category to which the target image belongs based on the region feature information and the character feature information includes: Determining whether the spatial distribution of the person in the target image meets a preset distribution condition based on the regional feature information; If satisfied, determining whether the facial feature information in the target sub-region is less than a preset amount of information and whether the posture feature information indicates that the position of the person in the target image is above the shoulders; If so, determine that the target classification of the target image is an over-the-shoulder shot image.
6. The image classification method according to claim 5, characterized in that: The region feature information includes the position of the sub-region where the person is located in the target image and the area of the sub-region, The preset distribution conditions include: The target image includes at least two persons, and there is a target sub-region, and the ratio of the area of the target sub-region to the area of the target image is greater than a preset value; the target sub-region is a sub-region at the edge of the target image.
7. The image classification method according to claim 1, characterized in that: The character feature information includes face feature information and posture feature information. The determining the target category to which the target image belongs based on the region feature information and the character feature information includes: Determine whether there is a sub-region at the edge of the target image in the target image based on the region feature information; If the conditions are met, determine whether the ratio of the area of the target face feature information in the target image to the area of the overlapping area of the sub-area at the edge is less than a preset ratio, and whether the posture feature information of the person in the sub-area at the edge indicates that the person in the target image is a leg; If so, determine that the target classification of the target image is a through-the-leg shot image.
8. The image classification method according to claim 1, characterized in that: Get the target image, including: Acquire an initial image set, wherein the initial image set includes a plurality of initial images; Acquire attribute information of each of the initial images, where the attribute information indicates the clarity of the initial image; The initial images whose attribute information does not meet the preset clarity condition in the initial image set are filtered to obtain the target image.
9. An image classification device, characterized in that: include: An acquisition module, used for acquiring a target image; A detection module, used to perform target detection on the persons in the target image to obtain detection information of each person, wherein the detection information includes regional feature information and person feature information of the person in the target image; The classification module is used to determine the target classification to which the target image belongs based on the regional feature information and the character feature information, and the target classification is used to indicate the film and television shot type of the target image.
10. An electronic device, characterized in that: include: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; The memory is used to store computer programs; The processor is used to execute the program stored in the memory to implement the image classification method described in any one of claims 1-8.
11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the image classification method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Head posture detection device and method
CN112307806A
Posture detection method and device, electronic equipment and storage medium
CN112613440A
Apparatus, method, and program for processing video voice
JP2010191544A
Visual language classification system
US20030002715A1
KR20230140756A
