Image cutting method and system, electronic equipment and storage medium

By obtaining key facial feature points in the face recognition system, determining bounding boxes and cutting images, combining color space conversion and device direction information processing, the efficiency and accuracy of facial recognition in video stream data processing in the prior art are solved. The problem is to achieve more efficient and reliable facial recognition.

CN119444783APending Publication Date: 2025-02-14SUNSHINE LIFE INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411297828.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The existing facial recognition methods have a large amount of calculation and long processing time when processing video stream data, and are easily affected by factors such as video quality fluctuations, ambient lighting changes and character motion blur, resulting in a decrease in recognition accuracy and efficiency.

Method used

By obtaining the key facial feature points in the to-process image containing face information, the face bounding box is determined, and the image cutting ratio is determined based on the bounding box, the image is cut to obtain the cut image. This method combines color space conversion and device direction information to perform image processing to ensure that the face image is displayed in the correct direction.

Benefits of technology

The accuracy and efficiency of facial information recognition are optimized, and the timeliness, accuracy and reliability of face comparison in variable environments and equipment states are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444783A_ABST
    Figure CN119444783A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image recognition, in particular to an image cutting method and system, electronic equipment and a storage medium, and the method comprises the steps: obtaining face key feature points in a to-be-processed image containing face information, and determining a face bounding box according to the face key feature points; and determining an image cutting proportion according to the face bounding box, and cutting the to-be-processed image according to the image cutting proportion to obtain a cut image. According to the invention, the precision and efficiency of face information recognition are optimized. Meanwhile, in a changeable environment and equipment state, the timeliness, accuracy and reliability of face comparison can be improved through recognition of key feature points of the face.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the rapid development of face recognition technology, its application scenarios have been widely covered in many fields such as security monitoring, identity authentication, and human-computer interaction. However, existing face recognition methods have many problems when processing video stream data. Directly extracting face images from continuous video data for recognition not only requires large amounts of computation and long processing time, but is also easily affected by factors such as video quality fluctuations, changes in ambient lighting, and motion blur of characters, resulting in greatly reduced recognition accuracy and efficiency. At the same time, existing methods lack flexibility and adaptability when processing images containing face information, and are unable to efficiently cut, analyze, and recognize facial key point features in images containing face information, and dynamically adjust them according to the needs of actual application scenarios.

[0003] Therefore, it is urgent to provide a technical solution to solve the above problems. Summary of the invention

[0004] In order to solve the above technical problems, the present invention provides an image cutting method, system, electronic device and storage medium.

[0005] In a first aspect, the present invention provides an image cutting method, and the technical solution of the method is as follows:

[0006] Acquire key facial feature points in the image to be processed containing facial information, and determine a facial bounding box based on the key facial feature points;

[0007] An image cutting ratio is determined according to the face boundary frame, and the image to be processed is cut according to the image cutting ratio to obtain a cut image.

[0008] The beneficial effects of an image cutting method of the present invention are as follows:

[0009] The method of the present invention optimizes the accuracy and efficiency of face information recognition. At the same time, in changing environments and equipment conditions, it can improve the timeliness, accuracy and reliability of face comparison by identifying key facial feature points.

[0010] Based on the above solution, an image cutting method of the present invention can also be improved as follows.

[0011] In an optional manner, the image cutting method further includes:

[0012] Performing color space conversion processing on the original image containing face information to obtain a color converted image;

[0013] Image processing is performed according to the device direction information and in combination with the image display information of the color conversion image to obtain the image to be processed; wherein the image processing is: at least one of image rotation processing and image mirror processing.

[0014] In the above optional methods, the stability and readability of the original image under different lighting conditions can be enhanced through color space conversion processing. Rotating or mirroring the image in combination with the device orientation information can ensure that the face image can be displayed in the correct direction regardless of how the device is rotated or mirrored, thereby improving the accuracy and efficiency of subsequent face recognition.

[0015] In an optional manner, the facial key feature points include: eye feature points, nose feature points and mouth feature points; and the step of determining a face bounding box according to the facial key feature points includes:

[0016] The face bounding box is determined according to the eye feature points, the nose feature points and the mouth feature points.

[0017] In the above optional method, it is clearly pointed out that the key facial feature points include eye, nose and mouth feature points, which can more accurately locate the face bounding box, thereby improving the accuracy of face recognition and reducing the error of face bounding box positioning.

[0018] In an optional manner, the image cutting method further includes:

[0019] Comparing the target feature vector of the cut image with each preset feature vector of the preset face image in the preset face library, respectively, to obtain the similarity between the target feature vector and each preset feature vector;

[0020] According to the size of the highest similarity between the target feature vector and each preset feature vector, it is determined whether to return to execute the step of obtaining the facial key feature points in the image to be processed containing facial information, and determining the facial boundary box according to the facial key feature points.

[0021] In the above optional method, by comparing the target feature vector of the cut image with the feature vector in the preset face library, the accuracy of face recognition can be evaluated in real time, and whether to re-determine the face bounding box is determined based on the highest similarity. The above mechanism improves the reliability and accuracy of face recognition and solves the problem of recognition errors that may be caused when the facial features are not obvious or there is interference.

[0022] In an optional manner, the image cutting method further includes:

[0023] If the face bounding box is complete, the step of determining the image cutting ratio according to the face bounding box and cutting the image to be processed according to the image cutting ratio to obtain a cut image is performed.

[0024] In the above optional method, before image cutting, the integrity of the face bounding box is checked first, which can ensure that the cut image contains complete face information and avoid cutting failure or poor cut image quality due to incomplete face bounding box.

[0025] In an optional manner, the image cutting method further includes:

[0026] The cut image is packaged and compressed to obtain a target image.

[0027] In the above optional manner, encapsulating and compressing the cut image can reduce the size of the cut image file, facilitate storage and transmission, and maintain the image quality.

[0028] In a second aspect, the present invention provides an image cutting system, the technical solution of the system is as follows:

[0029] The image cutting system comprises: an acquisition module and a cutting module;

[0030] The acquisition module is used to: acquire key facial feature points in the image to be processed containing facial information, and determine a facial boundary frame based on the key facial feature points;

[0031] The cutting module is used to determine the image cutting ratio according to the face boundary box, and cut the image to be processed according to the image cutting ratio to obtain a cut image.

[0032] The beneficial effects of an image cutting system of the present invention are as follows:

[0033] The system of the present invention optimizes the accuracy and efficiency of face information recognition. At the same time, in changing environments and equipment conditions, it can improve the timeliness, accuracy and reliability of face comparison by identifying key facial feature points.

[0034] Based on the above solution, an image cutting system of the present invention can also be improved as follows.

[0035] In an optional manner, the image cutting system further includes: a processing module;

[0036] The processing module is used to: perform color space conversion processing on the original image containing face information to obtain a color converted image;

[0037] Image processing is performed according to the device direction information and in combination with the image display information of the color conversion image to obtain the image to be processed; wherein the image processing is: at least one of image rotation processing and image mirror processing.

[0038] In the above optional methods, the stability and readability of the original image under different lighting conditions can be enhanced through color space conversion processing. Rotating or mirroring the image in combination with the device orientation information can ensure that the face image can be displayed in the correct direction regardless of how the device is rotated or mirrored, thereby improving the accuracy and efficiency of subsequent face recognition.

[0039] In a third aspect, a technical solution of an electronic device of the present invention is as follows:

[0040] The invention comprises a memory, a processor and a program stored in the memory and running on the processor. When the processor executes the program, the steps of the image cutting method of the present invention are realized.

[0041] In a fourth aspect, the present invention provides a computer-readable storage medium having the following technical solution:

[0042] Instructions are stored in the computer-readable storage medium. When the computer-readable storage medium reads the instructions, the computer-readable storage medium executes the steps of the image cutting method of the present invention.

[0043] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings. In the accompanying drawings:

[0045] Figure 1 A schematic diagram of a flow chart of an embodiment of an image cutting method of the present invention;

[0046] Figure 2 A schematic diagram of the process of applying the graph cutting method to video content generation and evaluation;

[0047] Figure 3 A schematic diagram of the structure of an embodiment of an image cutting system of the present invention;

[0048] Figure 4 The figure is a schematic structural diagram of an embodiment of an electronic device of the present invention. DETAILED DESCRIPTION

[0049] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.

[0050] Figure 1 FIG. 2 is a flow chart showing an embodiment of an image cutting method provided by the present invention, wherein the method is executed by a controller. Figure 1 As shown, the following steps are included:

[0051] S1, obtain the key facial feature points in the image to be processed containing face information, and determine the face bounding box according to the key facial feature points. In S1:

[0052] 1) The image to be processed is an image containing facial information. The image to be processed may be obtained by, but is not limited to, real-time capture from a camera and reading from an image file. By extracting key facial feature points of facial information from the image to be processed, operations such as face recognition and image segmentation may be performed.

[0053] 2) Facial key feature points refer to the key points in the face image that are used to describe the shape and position of the face, such as eye feature points (corners of the eyes, center of the pupil, etc.), nose feature points (nose tip, nose wings, etc.) and mouth feature points (corners of the mouth, lip center, etc.). Facial key feature points are an important basis for determining the face bounding box. By accurately detecting facial key feature points, the accuracy and efficiency of subsequent processing steps can be improved.

[0054] 3) The face bounding box is a rectangular box around the face area, which is used to identify and locate the face part in the image to be processed. The face bounding box can help determine the image area that needs to be cut. Through the face bounding box, the non-face part of the image to be processed can be excluded, and the face area can be processed and analyzed exclusively.

[0055] Specifically, the controller obtains key facial feature points in the image to be processed that contains facial information, and determines a face boundary box based on the key facial feature points.

[0056] S2. Determine the image cutting ratio according to the face bounding box, and cut the image to be processed according to the image cutting ratio to obtain the cut image. In S2:

[0057] 1) Image cutting ratio refers to the ratio or size determined by the ratio between the face bounding box and the image to be processed. The image cutting ratio determines the size and shape of the cut image. A reasonable image cutting ratio can ensure that the cut image contains complete face information and meets the requirements of subsequent processing or display.

[0058] 2) The cut image refers to the image obtained by cutting the image to be processed according to the image cutting ratio. The cut image is the output of the image cutting method, and the cut image contains the processed face area. The cut image can be used in many scenarios such as face recognition, face comparison, image display, etc.

[0059] Specifically, the controller further determines the image cutting ratio according to the face boundary box, and cuts the image to be processed according to the image cutting ratio to obtain a cut image.

[0060] The technical solution of this embodiment optimizes the accuracy and efficiency of face information recognition. At the same time, in changing environments and equipment conditions, it can improve the timeliness, accuracy and reliability of face comparison by identifying key facial feature points.

[0061] In an optional manner, the image cutting method further includes:

[0062] Performing color space conversion processing on the original image containing face information to obtain a color converted image;

[0063] Image processing is performed according to the device direction information and in combination with the image display information of the color conversion image to obtain an image to be processed; wherein the image processing is: at least one of image rotation processing and image mirror processing.

[0064] It should be noted that the color space conversion process converts the image data into the YUV420sp format using different functions according to the color format of the input data (YUV422 or YUV420).

[0065] The device orientation information may be obtained by, but is not limited to, the device's built-in accelerometer sensor and the device's built-in gravity sensor. Image display information may include, but is not limited to, image orientation, image tilt angle, and whether it is a mirror image.

[0066] The device's camera will record the direction information when shooting in the EXIF ​​metadata of the original image. Common values ​​include but are not limited to: 1 (forward), 3 (180° rotation), 6 (90° rotation), 8 (270° rotation), etc. The rotation processing of the color conversion image depends on the physical orientation of the device and the direction information of the original image. When the direction of the color conversion image is inconsistent with the device orientation, the color conversion image needs to be rotated. By obtaining the EXIF ​​direction information of the original image, the EXIF ​​direction information can be used to correctly display and obtain the image to be processed.

[0067] In this embodiment, the implementation process of YUV422 conversion to YUV420sp is as follows:

[0068] ① Input YUV422 data, enhance the brightness information of Y, copy the YUV422 data to create a YUV420sp data storage unit.

[0069] ② Calculate the starting position and total length of the U and V channels.

[0070] ③The loop starts from stride*height, and alternately stores the data of the V and U components into the remaining part of the nv21 array. During the storage process, the color information is rearranged and the offset of the U color and the V color is adjusted.

[0071] Among them, Y represents the array of brightness Y components; U represents the array of color U components; V represents the array of color V components; nv21 represents the target array, which is used to store the converted YUV420sp data; stride represents the step size of each row of data in the YUV422 image; height represents the image height.

[0072] According to the device orientation information, the image is processed in combination with the image display information of the color conversion image to obtain the image to be processed as follows:

[0073] If the device is a mobile phone:

[0074] According to the accelerometer sensor in the mobile phone, the acceleration values ​​of the mobile phone in the X, Y, and Z directions are measured.

[0075] When the Y-axis acceleration of the mobile phone is close to 9.8m / s 2 When the X-axis acceleration is close to 0, it is determined that the mobile phone is in portrait mode.

[0076] When the X-axis acceleration of the mobile phone is close to 9.8m / s 2 or -9.8m / s 2 When the Y-axis acceleration is close to 0, it is determined that the mobile phone is in landscape mode.

[0077] That is, according to the acceleration values ​​of the X and Y axes, determine whether the mobile phone is in portrait or landscape mode.

[0078] At the same time, when the original image is captured using the front camera of the mobile phone, the original image is mirrored (left and right are reversed). Therefore, it is necessary to mirror the color converted image obtained after the color space conversion (left and right flip processing) to restore the normal display effect. The mirror processing is implemented by using matrix transformation (Matrix) to swap the image left and right. If the direction of the current image is inconsistent with the direction of the device, it is necessary to use the postRotate method of Matrix to rotate the image to the correct angle.

[0079] Specifically, the controller further performs color space conversion processing on the original image containing facial information to obtain a color converted image; and performs image processing according to the device orientation information and in combination with image display information of the color converted image to obtain an image to be processed.

[0080] In an optional manner, the key facial feature points include: eye feature points, nose feature points and mouth feature points; and the step of determining the face bounding box according to the key facial feature points includes:

[0081] Determine the face bounding box based on the eye feature points, nose feature points and mouth feature points.

[0082] In this embodiment, the face detection SDK tool built into the mobile phone is used to locate the eye feature points (eye corners, pupil centers, etc.), nose feature points (nose tip, nose wings, etc.) and mouth feature points (mouth corners, lip centers, etc.) of the face area in the image to be processed, obtain the image information to be processed, and pass it to the SDK to start face detection. The detected face area is subjected to feature point recognition processing to obtain the coordinates of the key facial feature points, thereby determining the face boundary box.

[0083] Specifically, the controller further determines the face boundary box based on the eye feature points, the nose feature points and the mouth feature points.

[0084] In an optional manner, the image cutting method further includes:

[0085] Compare the target feature vector of the cut image with each preset feature vector of the preset face image in the preset face library to obtain the similarity between the target feature vector and each preset feature vector;

[0086] According to the size of the highest similarity between the target feature vector and each preset feature vector, it is determined whether to return to execute the step of obtaining the facial key feature points in the image to be processed containing facial information, and determining the facial bounding box according to the facial key feature points.

[0087] It should be noted that the steps of determining whether the current user's facial information is the pre-recorded user include:

[0088] The target feature vector of the cut image is compared with each preset feature vector of the preset face image in the preset face library to obtain the similarity between the target feature vector and each preset feature vector; according to the similarity result, the similarity is divided into different intervals to indicate the accuracy and credibility of the result. The specific judgment classification is as follows:

[0089] When the similarity value range is (90,100]: the images are highly similar, and the two images are judged to be extremely similar, indicating that they are likely to be of the same person.

[0090] When the similarity value range is (80,90]: the images have a high similarity, and the two images are judged to be very similar, indicating that there is a high possibility that they are of the same person.

[0091] When the similarity value range is (70,80]: the images have a medium similarity, and it is determined that the two images are somewhat similar, indicating that they may be the same person.

[0092] When the similarity value range is (60,70]: the similarity between the images is low, and the two images are judged to be of low similarity, indicating that they may not be of the same person.

[0093] When the similarity value range is (0,60]: the similarity between the images is extremely low, and the two images are judged to be dissimilar, indicating that they are not the same person.

[0094] Specifically, the controller further compares the target feature vector of the cut image with each preset feature vector of the preset face image in the preset face library to obtain the similarity between the target feature vector and each preset feature vector;

[0095] According to the size of the highest similarity between the target feature vector and each preset feature vector, it is determined whether to return to execute the step of obtaining the facial key feature points in the image to be processed containing facial information, and determining the facial bounding box according to the facial key feature points.

[0096] In an optional manner, the image cutting method further includes:

[0097] If the face bounding box is complete, the steps of determining the image cutting ratio according to the face bounding box and cutting the image to be processed according to the image cutting ratio are performed to obtain a cut image.

[0098] It should be noted that the image cutting ratio can also be divided into: 1 / 3 ratio and 2 / 3 ratio. When cutting the image to be processed, the image cutting ratio determines whether it is necessary to re-acquire the face bounding box based on the similarity and the current network speed, thereby determining whether to use the image cutting ratio of 1 / 3 ratio or 2 / 3 ratio for dynamic adjustment, or not to use the image cutting ratio.

[0099] The steps of determining whether it is necessary to re-acquire the face bounding box based on the similarity score and the current network speed, and thus re-determining the image cutting ratio using 1 / 3 ratio, 2 / 3 ratio, or original image ratio are as follows:

[0100] The similarity intervals are divided into: (90,100], (80,90], (70,80], (60,70], (0,60].

[0101] Image quality levels are divided into: high (80, 100], medium (60, 80], low (0, 60].

[0102] The image cutting ratio is divided into:

[0103] 1 / 3 height cutting: The width remains unchanged, and the height of the image after cutting is 1 / 3 of the original image.

[0104] 2 / 3 height cutting: The width remains unchanged, and the height of the image after cutting is 2 / 3 of the original image.

[0105] Original Image Ratio: Keep the original image size unchanged.

[0106] The network environment conditions are: the network speed is greater than or less than 100KB / s.

[0107] ① When the network speed is greater than 100KB / s:

[0108] When the score is (90,100]:

[0109] Initial settings: The original image quality is high quality, and the image cropping ratio is the original image ratio.

[0110] Dynamic adjustment: The controller reduces the original image quality to mid-range and the image cropping ratio is adjusted to 2 / 3 ratio.

[0111] When the score is (80,90], (70,80], (60,70]:

[0112] Initial settings: The original image quality is high quality, and the image cropping ratio is the original image ratio.

[0113] Dynamic adjustment: The controller reduces the original image quality to a low level and adjusts the image cropping ratio to 1 / 3.

[0114] When the score is (0,60]:

[0115] Does not meet face recognition standards.

[0116] Dynamic Adjustment: The controller increases the image quality to high and increases the image crop ratio to the original image ratio in an attempt to increase the similarity score.

[0117] ② When the network speed is less than 100KB / s:

[0118] When the score is (90,100], (80,90], (70,80]:

[0119] Initial settings: The original image quality is set to high quality, and the image cropping ratio is set to the original image ratio.

[0120] Dynamic adjustment: Based on the network speed limit, the controller reduces the original image quality to medium or low, and adjusts the image cutting ratio to 2 / 3 or 1 / 3 to optimize the transmission and processing speed.

[0121] When the score is between (60,70], (0,60]:

[0122] There is an identification problem.

[0123] Dynamic adjustment: The controller attempts to improve the original image quality and image cropping ratio (if network conditions permit), otherwise it maintains the current settings or makes appropriate adjustments, for example, adjusting the quality to mid-range and maintaining the image cropping ratio at 2 / 3.

[0124] Specifically, when the face bounding box is complete, the controller further executes the steps of determining the image cutting ratio according to the face bounding box, and cutting the image to be processed according to the image cutting ratio to obtain a cut image.

[0125] In an optional manner, the image cutting method further includes:

[0126] The cut image is encapsulated and compressed to obtain the target image.

[0127] It should be noted that after the graphic cutting, the image data of the cut image is encapsulated into YuvImage and then compressed into JPEG format to obtain the target image.

[0128] In this embodiment, the compression of the cut image adopts quality factor control, and the quality factor of JPEG is dynamically calculated to ensure that the visual quality of the cut image is maintained while minimizing the file size. The specific steps are as follows:

[0129] ① Input cutting image;

[0130] ②Specify the cut image format as JPEG and configure the quality factor parameters. The quality factor parameters are: (0,60] for low, (60,80] for medium, and (80,100] for high;

[0131] ③Output the compressed target image.

[0132] Specifically, the controller further encapsulates and compresses the cut image to obtain a target image.

[0133] like Figure 2As shown in the figure, first, after determining the camera function according to actual needs, the front camera and microphone are automatically enabled. The front camera is responsible for raw image acquisition, and uses a frequency of one frame per second to obtain image frames as raw images, thereby providing image analysis performance and reducing device energy consumption. At the same time, the microphone collects audio in real time, cuts the audio data into PCM data blocks of fixed size, and uploads it in real time for further processing and analysis. The above process ensures the synchronization and real-time nature of video and audio data, and is suitable for scenarios such as online teaching and real-time performance analysis.

[0134] Secondly, determine whether the recording is normal; if it is normal, perform the image cutting process and determine whether the graphic cutting process is normal; if the graphic cutting process is normal, generate a face image and output it.

[0135] If the recording is not normal or the image cutting process is not normal, restart the recording.

[0136] The output face image and voice recognition results can be used to automatically generate video content related to the course. The subtitles in the course video and the collected audio can also be compared through an intelligent matching algorithm to analyze the accuracy of audio and video synchronization and the completeness of the content. In addition, the teaching strategy can be dynamically adjusted according to the course content, such as strengthening the presentation of key paragraphs. The method of generating video content is to merge the collected video data and sound data using ffmpg technology to generate a complete video file.

[0137] Audio data is converted into text through artificial intelligence speech recognition technology and deep semantic analysis is performed. Deep semantic analysis not only recognizes words and phrases, but also understands the overall intent and emotional tendency of sentences, thereby providing data support for subsequent content comparison and teaching feedback. By deeply comparing the text content after audio recognition with the preset template subtitle content, the similarity of the text content is analyzed to evaluate the user's learning effect. The comparison results can be used to adjust teaching methods or provide personalized learning suggestions.

[0138] A detailed evaluation report is generated based on the score comparison results. The evaluation report includes key information such as the matching degree of voice and subtitles, the degree of learner participation, and the recommended learning path. The above process presents data in a visual way, allowing managers and learners to intuitively understand the learning effect, further optimize the learning plan, and provide more humane guidance for unfamiliar learners.

[0139] Figure 3 FIG. 2 is a schematic diagram showing a structure of an embodiment of an image cutting system 200 provided by the present invention. Figure 3 As shown, the system 200 includes: an acquisition module 210 and a cutting module 220.

[0140] The acquisition module 210 is used to: acquire key facial feature points in the image to be processed containing facial information, and determine a facial boundary frame based on the key facial feature points;

[0141] The cutting module 220 is used to determine the image cutting ratio according to the face boundary box, and cut the image to be processed according to the image cutting ratio to obtain a cut image.

[0142] In an optional manner, the image cutting system further includes: a processing module.

[0143] The processing module is used to: perform color space conversion processing on the original image containing face information to obtain a color converted image;

[0144] Image processing is performed according to the device direction information and in combination with the image display information of the color conversion image to obtain an image to be processed; wherein the image processing is: at least one of image rotation processing and image mirror processing.

[0145] The technical solution of this embodiment optimizes the accuracy and efficiency of face information recognition. At the same time, in changing environments and equipment conditions, it can improve the timeliness, accuracy and reliability of face comparison by identifying key facial feature points.

[0146] The above parameters and steps for each module to implement corresponding functions in the image cutting system 200 of this embodiment can refer to the parameters and steps in the above embodiment of the image cutting method, which will not be described in detail here.

[0147] like Figure 4 As shown, an electronic device 300 according to an embodiment of the present invention includes a processor 320, the processor 320 is coupled to a memory 310, and the memory 310 stores at least one computer program 330, and the at least one computer program 330 is loaded and executed by the processor 320, so that the electronic device 300 implements any of the above-mentioned image segmentation methods, specifically:

[0148] The electronic device 300 may have relatively large differences due to different configurations or performances, and may include one or more processors 320 (Central Processing Units, CPU) and one or more memories 310, wherein the one or more memories 310 store at least one computer program 330, and the at least one computer program 330 is loaded and executed by the one or more processors 320, so that the electronic device 300 implements any image cutting method provided in the above embodiments. Of course, the electronic device 300 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the electronic device 300 may also include other components for implementing device functions, which will not be described in detail here.

[0149] A computer-readable storage medium according to an embodiment of the present invention stores at least one computer program, and the at least one computer program is loaded and executed by a processor so that a computer implements any of the above-mentioned image cutting methods.

[0150] Optionally, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.

[0151] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs any of the above-mentioned image cutting methods.

[0152] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects and represent the definition of a specific order or sequence. The order of use of similar objects can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than the order shown or described.

[0153] Those skilled in the art know that the present invention can be implemented as a system, method or computer program product. Therefore, the present disclosure can be specifically implemented in the following forms, namely: it can be complete hardware, it can be complete software (including firmware, resident software, microcode, etc.), or it can be a combination of hardware and software, which is generally referred to as "circuit", "module" or "system" herein. In addition, in some embodiments, the present invention can also be implemented in the form of a computer program product in one or more computer-readable media, and the computer-readable medium contains computer-readable program code.

[0154] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.

[0155] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. An image cutting method, characterized in that: include: Acquire key facial feature points in the image to be processed containing facial information, and determine a facial bounding box based on the key facial feature points; An image cutting ratio is determined according to the face boundary frame, and the image to be processed is cut according to the image cutting ratio to obtain a cut image.

2. The image cutting method according to claim 1, characterized in that: Also includes: Performing color space conversion processing on the original image containing face information to obtain a color converted image; Image processing is performed according to the device direction information and in combination with the image display information of the color conversion image to obtain the image to be processed; wherein the image processing is: at least one of image rotation processing and image mirror processing.

3. The image cutting method according to claim 1, characterized in that: The facial key feature points include: eye feature points, nose feature points and mouth feature points; the step of determining the face boundary frame according to the facial key feature points includes: The face bounding box is determined according to the eye feature points, the nose feature points and the mouth feature points.

4. The image cutting method according to claim 1, characterized in that: Also includes: Comparing the target feature vector of the cut image with each preset feature vector of the preset face image in the preset face library, respectively, to obtain the similarity between the target feature vector and each preset feature vector; According to the size of the highest similarity between the target feature vector and each preset feature vector, it is determined whether to return to execute the step of obtaining the facial key feature points in the image to be processed containing facial information, and determining the facial boundary box according to the facial key feature points.

5. The image cutting method according to claim 1, characterized in that: Also includes: If the face bounding box is complete, the step of determining the image cutting ratio according to the face bounding box and cutting the image to be processed according to the image cutting ratio to obtain a cut image is performed.

6. The image cutting method according to claim 1, characterized in that: Also includes: The cut image is packaged and compressed to obtain a target image.

7. An image cutting system, characterized in that: include: Get modules and cut modules; The acquisition module is used to: acquire key facial feature points in the image to be processed containing facial information, and determine a facial boundary frame based on the key facial feature points; The cutting module is used to determine the image cutting ratio according to the face boundary box, and cut the image to be processed according to the image cutting ratio to obtain a cut image.

8. The image cutting system according to claim 7, characterized in that: Also includes: Processing module; The processing module is used to: perform color space conversion processing on the original image containing face information to obtain a color converted image; Image processing is performed according to the device direction information and in combination with the image display information of the color conversion image to obtain the image to be processed; wherein the image processing is: at least one of image rotation processing and image mirror processing.

9. An electronic device, characterized in that: The electronic device includes a processor, the processor is coupled to a memory, the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor so that the electronic device implements the image cutting method as described in any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by the processor, so that the computer-readable storage medium implements the image cutting method according to any one of claims 1 to 6.