Image region extraction result recognition method, device and computer-readable storage medium

By judging the pixel value ratio of edge images, the problem of image area extraction failure is solved, efficient and accurate image area recognition is achieved, and user experience and application stability is improved.

CN113191346BActive Publication Date: 2025-08-19NUBIA TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110560919.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-20
Publication Date
2025-08-19
Estimated Expiration
2041-05-20

AI Technical Summary

Technical Problem

In the prior art, the failure of image area extraction will affect the normal operation of related applications or cause troubles to users in function use, and there is a lack of effective detection solutions.

Method used

By acquiring the first edge image and the second edge image obtained after the original image and its corresponding mask image are extracted by edges, the ratio of pixel counts whose pixel values ​​meet the preset conditions is determined, and the success and failure of image area extraction are judged.

Benefits of technology

It realizes efficient and accurate recognition of image area extraction results, avoids the impact of image area extraction failure on application, and improves user experience and productivity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113191346B_ABST
    Figure CN113191346B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, and computer-readable storage medium for identifying image region extraction results. The method comprises: for each pixel of a second edge image, determining a first number of pixels whose pixel values are not less than a preset pixel value; and, for each pixel of the second edge image, determining a second number of pixels whose pixel values are equal to the preset pixel value; for each of the second number of pixels, determining each corresponding pixel in the first edge image, and determining a third number of paired pixels within the neighborhood corresponding to all of the corresponding pixels; and determining that the image region extraction is successful if the ratio of the third number to the first number is greater than a preset value. This method implements an efficient and accurate image region extraction result identification solution, avoiding the impact on the normal operation of related applications due to image region extraction failures, or preventing users from experiencing functional difficulties, thereby improving productivity and enhancing user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of mobile communications, and in particular to an image region extraction result recognition method, device and computer-readable storage medium. Background Art

[0002] With the continuous development of smart terminal devices, the demand for image recognition in various applications and users is increasing. In particular, extracting specific regions from images has become the foundation of many image recognition applications. However, when extracting specific regions through methods such as deep learning, image region extraction may fail. At the same time, such failures can affect the normal operation of related applications or cause problems for users. Currently, there is no effective method for detecting specific application solutions for image region extraction results. Summary of the Invention

[0003] In order to solve the above technical defects in the prior art, the present invention proposes a method for identifying image region extraction results, which includes:

[0004] A first edge image and a second edge image are obtained by respectively extracting edges from an original image and a corresponding mask image.

[0005] For each pixel of the second edge image, a first number of pixels having pixel values not less than a preset pixel value are determined. Meanwhile, for each pixel of the second edge image, a second number of pixels having pixel values equal to the preset pixel value are determined.

[0006] For each of the second number of pixels, each corresponding pixel in the first edge image is determined, and within the neighborhoods corresponding to all of the corresponding pixels, a third number of paired pixels having grayscale values equal to the preset pixel value are determined.

[0007] If the ratio of the third number to the first number is greater than a preset value, it is determined that the image area extraction is successful; if the ratio of the third number to the first number is less than the preset value, it is determined that the image area extraction fails.

[0008] Optionally, the step of obtaining a first edge image and a second edge image obtained by performing edge extraction on the original image and its corresponding mask image, respectively, includes:

[0009] The input original image is obtained.

[0010] An image region is extracted from the original image, and the mask image corresponding to the original image is obtained through deep learning, wherein the image region is a sky region.

[0011] Optionally, determining, for each pixel of the second edge image, a first number of pixels having pixel values not less than a preset pixel value, and simultaneously, determining, for each pixel of the second edge image, a second number of pixels having pixel values equal to the preset pixel value, includes:

[0012] Acquire a region feature of the image region.

[0013] The preset pixel value corresponding to the region feature is determined, wherein, when the image region is the sky region, the region feature is pure white, and the preset pixel value is 255.

[0014] Optionally, the determining, for each pixel of the second edge image, a first number of pixels having pixel values not less than a preset pixel value, and simultaneously, for each pixel of the second edge image, a second number of pixels having pixel values equal to the preset pixel value, further includes:

[0015] The pixel value of each pixel of the second edge image is compared with the preset pixel value.

[0016] A first number of pixels whose pixel values are not less than the preset pixel value is obtained.

[0017] Optionally, the determining, for each pixel of the second edge image, a first number of pixels having pixel values not less than a preset pixel value, and simultaneously, for each pixel of the second edge image, a second number of pixels having pixel values equal to the preset pixel value, further includes:

[0018] The pixel value of each pixel of the second edge image is compared with the preset pixel value.

[0019] A second number of pixels whose pixel values are equal to the preset pixel values are obtained.

[0020] Optionally, for each of the second number of pixels, determining each corresponding pixel in the first edge image, and determining a third number of paired pixels having grayscale values equal to the preset pixel value within neighborhoods corresponding to all of the corresponding pixels, includes:

[0021] A similar range corresponding to the regional features is preset.

[0022] The similar range is regarded as the neighborhood.

[0023] Optionally, for each of the second number of pixels, determining each corresponding pixel in the first edge image, and determining a third number of paired pixels having grayscale values equal to the preset pixel value within neighborhoods corresponding to all of the corresponding pixels, further includes:

[0024] A neighborhood corresponding to each of the corresponding pixels is determined, and a pixel value of each pixel in all the neighborhoods is compared with the preset pixel value.

[0025] A third number of pixels whose grayscale values are equal to the preset pixel values are obtained.

[0026] Optionally, if the ratio of the third number to the first number is greater than a preset value, determining that the image area extraction is successful; if the ratio of the third number to the first number is less than the preset value, determining that the image area extraction fails, includes:

[0027] The preset value corresponding to the regional feature and / or the preset recognition accuracy is determined.

[0028] If the ratio of the third number to the first number is greater than the preset value, it is determined that the image area extraction is successful or the recognition is successful; if the ratio of the third number to the first number is less than the preset value, it is determined that the image area extraction is failed or the recognition is failed.

[0029] The present invention also proposes an image region extraction result recognition device, which includes a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the computer program is executed by the processor, the steps of the image region extraction result recognition method as described in any one of the above items are implemented.

[0030] The present invention also proposes a computer-readable storage medium, which stores an image region extraction result recognition program. When the image region extraction result recognition program is executed by a processor, the steps of the image region extraction result recognition method as described in any one of the above items are implemented.

[0031] The image region extraction result identification method, device, and computer-readable storage medium of the present invention are implemented by obtaining a first edge image and a second edge image obtained by edge extraction of an original image and its corresponding mask image. Then, for each pixel in the second edge image, a first number of pixels whose pixel values are not less than a preset pixel value are determined. At the same time, for each pixel in the second edge image, a second number of pixels whose pixel values are equal to the preset pixel value are determined. For each of the second number of pixels, each corresponding pixel in the first edge image is determined, and within the neighborhood corresponding to all of the corresponding pixels, a third number of paired pixels whose grayscale values are equal to the preset pixel value are determined. Finally, if the ratio of the third number to the first number is greater than a preset value, the image region extraction is determined to be successful. If the ratio of the third number to the first number is less than the preset value, the image region extraction is determined to be unsuccessful. This achieves an efficient and accurate image region extraction result identification solution, avoiding the impact of image region extraction failure on the normal operation of related applications or the user's functional difficulties caused by the failure of image region extraction, thereby improving productivity and enhancing user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:

[0033] Figure 1 This is a hardware structure diagram of a mobile terminal according to the present invention;

[0034] Figure 2 This is a diagram of a communication network system architecture provided by an embodiment of the present invention;

[0035] Figure 3 is a flow chart of a first embodiment of the image region extraction result recognition method of the present invention;

[0036] Figure 4 is a flow chart of a second embodiment of the image region extraction result recognition method of the present invention;

[0037] Figure 5 is a flow chart of a third embodiment of the image region extraction result recognition method of the present invention;

[0038] Figure 6 is a flow chart of a fourth embodiment of the image region extraction result recognition method of the present invention;

[0039] Figure 7 is a flowchart of a fifth embodiment of the image region extraction result recognition method of the present invention;

[0040] Figure 8 is a flowchart of a sixth embodiment of the image region extraction result recognition method of the present invention;

[0041] Figure 9 is a flow chart of a seventh embodiment of the image region extraction result recognition method of the present invention;

[0042] Figure 10 is a flowchart of an eighth embodiment of the image region extraction result recognition method of the present invention;

[0043] Figure 11 The first original image of the first embodiment of the image region extraction result recognition method of the present invention;

[0044] Figure 12 is a first mask image of the first embodiment of the image region extraction result recognition method of the present invention;

[0045] Figure 13 The second original image of the first embodiment of the image region extraction result recognition method of the present invention;

[0046] Figure 14 is the second mask image of the first embodiment of the image region extraction result recognition method of the present invention;

[0047] Figure 15 is the second edge map of the sixth embodiment of the image region extraction result recognition method of the present invention;

[0048] Figure 16 is the first edge map of the sixth embodiment of the image region extraction result recognition method of the present invention;

[0049] Figure 17 1 is a schematic diagram of the edge of the first mask image in the eighth embodiment of the method for identifying image region extraction results of the present invention;

[0050] Figure 18 2. This is a schematic diagram of the edge of the first original image in the eighth embodiment of the method for identifying image region extraction results of the present invention;

[0051] Figure 19 1 is a schematic diagram of the edge of the second mask image in the eighth embodiment of the method for identifying image region extraction results of the present invention;

[0052] Figure 20 This is a schematic diagram of the edge of the second original image in the eighth embodiment of the image region extraction result recognition method of the present invention. DETAILED DESCRIPTION

[0053] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0054] In the subsequent description, suffixes such as "module," "component," or "unit" used to represent elements are only used to facilitate the description of the present invention and have no specific meaning. Therefore, "module," "component," or "unit" can be used interchangeably.

[0055] The terminal can be implemented in various forms. For example, the terminal described in the present invention may include mobile terminals such as mobile phones, tablet computers, laptop computers, PDAs, portable media players (PMPs), navigation devices, wearable devices, smart bracelets, pedometers, etc., as well as fixed terminals such as digital TVs and desktop computers.

[0056] The following description will be made by taking a mobile terminal as an example. It will be understood by those skilled in the art that, in addition to components specifically used for mobile purposes, the configuration according to the embodiments of the present invention can also be applied to fixed type terminals.

[0057] See also Figure 1 , which is a schematic diagram of the hardware structure of a mobile terminal for implementing various embodiments of the present invention. The mobile terminal 100 may include: an RF (Radio Frequency) unit 101, a WiFi module 102, an audio output unit 103, an A / V (audio / video) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111. Those skilled in the art will understand that Figure 1 The structure of the mobile terminal shown in the figure does not constitute a limitation to the mobile terminal. The mobile terminal may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0058] The following combination Figure 1 A detailed introduction to the various components of the mobile terminal:

[0059] The RF unit 101 can be used to send and receive information or receive signals during calls. Specifically, it receives downlink information from the base station and transmits it to the processor 110 for processing. It also transmits uplink data to the base station. Typically, the RF unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, and more. Furthermore, the RF unit 101 can communicate with the network and other devices via wireless communication. The above-mentioned wireless communications may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA2000 (Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division Duplexing-Long Term Evolution) and TDD-LTE (Time Division Duplexing-Long Term Evolution), etc.

[0060] WiFi is a short-range wireless transmission technology. Mobile terminals can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 102. It provides users with wireless broadband Internet access. Figure 1 The WiFi module 102 is shown, but it is understandable that it is not an essential component of the mobile terminal and can be omitted as needed without changing the essence of the invention.

[0061] The audio output unit 103 can convert audio data received by the RF unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output it as sound when the mobile terminal 100 is in a call signal reception mode, a talk mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Furthermore, the audio output unit 103 can also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, or the like.

[0062] The A / V input unit 104 is used to receive audio or video signals. The A / V input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data of still images or videos captured by an image capture device (e.g., a camera) in video capture mode or image capture mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the GPU 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the RF unit 101 or the WiFi module 102. The microphone 1042 may receive sound (audio data) in operating modes such as a phone call mode, a recording mode, and a voice recognition mode, and may process such sound into audio data. In the phone call mode, the processed audio (voice) data may be converted into a format that can be transmitted to a mobile communication base station via the RF unit 101. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to eliminate (or suppress) noise or interference generated during the reception and transmission of audio signals.

[0063] The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 1061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 1061 and / or the backlight when the mobile terminal 100 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be described here.

[0064] The display unit 106 is used to display information input by the user or information provided to the user. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0065] The user input unit 107 can be used to receive input digital or character information, and generate key signal input related to user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also known as a touch screen, can collect user touch operations on or near it (such as operations performed by the user using a finger, stylus, or any other suitable object or accessory on or near the touch panel 1071) and drive the corresponding connection device according to a pre-set program. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction and detects the signal caused by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 110. It can also receive commands sent by the processor 110 and execute them. In addition, the touch panel 1071 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may further include other input devices 1072. Specifically, the other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, power keys, etc.), a trackball, a mouse, a joystick, etc., and are not specifically limited here.

[0066] Furthermore, the touch panel 1071 may cover the display panel 1061. When the touch panel 1071 detects a touch operation on or near it, it transmits the information to the processor 110 to determine the type of touch event. Subsequently, the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of touch event. Figure 1 In the embodiment, the touch panel 1071 and the display panel 1061 are two independent components to realize the input and output functions of the mobile terminal. However, in some embodiments, the touch panel 1071 and the display panel 1061 can be integrated to realize the input and output functions of the mobile terminal, which is not limited here.

[0067] The interface unit 108 serves as an interface through which at least one external device can be connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and an external device.

[0068] Memory 109 can be used to store software programs and various data. Memory 109 may primarily include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function (such as a sound playback function or an image playback function); the data storage area may store data generated based on the use of the mobile phone (such as audio data, a phone book, etc.). Furthermore, memory 109 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0069] Processor 110 is the control center of the mobile terminal, connecting all components of the mobile terminal using various interfaces and circuits. By running or executing software programs and / or modules stored in memory 109 and accessing data stored in memory 109, it executes various functions of the mobile terminal and processes data, thereby providing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, processor 110 may integrate an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 110.

[0070] The mobile terminal 100 may also include a power supply 111 (such as a battery) for supplying power to various components. Preferably, the power supply 111 may be logically connected to the processor 110 through a power management system, thereby managing functions such as charging, discharging, and power consumption through the power management system.

[0071] although Figure 1 Not shown, the mobile terminal 100 may further include a Bluetooth module, etc., which will not be described in detail here.

[0072] To facilitate understanding of the embodiments of the present invention, the communication network system on which the mobile terminal of the present invention is based is described below.

[0073] See also Figure 2 , Figure 2 A communication network system architecture diagram is provided for an embodiment of the present invention. The communication network system is an LTE system of universal mobile communication technology. The LTE system includes a UE (User Equipment) 201, an Evolved UMTS Terrestrial Radio Access Network (E-UTRAN) 202, an Evolved Packet Core (EPC) 203, and an operator's IP service 204, which are sequentially connected in communication.

[0074] Specifically, UE201 may be the above-mentioned terminal 100, which will not be described in detail here.

[0075] E-UTRAN 202 includes eNodeB 2021 and other eNodeBs 2022 , etc. Among them, eNodeB 2021 can be connected to other eNodeBs 2022 via a backhaul (eg, an X2 interface), and eNodeB 2021 is connected to EPC 203 , and eNodeB 2021 can provide UE 201 with access to EPC 203 .

[0076] EPC 203 may include MME (Mobility Management Entity) 2031, HSS (Home Subscriber Server) 2032, other MMEs 2033, SGW (Serving Gate Way) 2034, PGW (PDN Gate Way) 2035, and PCRF (Policy and Charging Rules Function) 2036. MME 2031 is the control node that handles signaling between UE 201 and EPC 203, providing bearer and connection management. HSS 2032 provides registers for managing functions such as the Home Location Register (not shown) and stores user-specific information such as service features and data rates. All user data can be sent through SGW2034, PGW2035 can provide IP address allocation and other functions for UE 201, PCRF2036 is the policy and charging control policy decision point for service data flow and IP bearer resources, and it selects and provides available policy and charging control decisions for the policy and charging execution function unit (not shown in the figure).

[0077] The IP service 204 may include the Internet, an intranet, an IMS (IP Multimedia Subsystem), or other IP services.

[0078] Although the above description is based on the LTE system as an example, those skilled in the art should know that the present invention is not only applicable to the LTE system, but also to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems, and is not limited here.

[0079] Based on the above-mentioned mobile terminal hardware structure and communication network system, various embodiments of the method of the present invention are proposed.

[0080] Example 1

[0081] Figure 3 Flowchart of the first embodiment of the method for identifying image region extraction results of the present invention. A method for identifying image region extraction results, the method comprising:

[0082] S1. Obtain a first edge image and a second edge image obtained by performing edge extraction on an original image and its corresponding mask image.

[0083] S2. For each pixel of the second edge image, determine a first number of pixels whose pixel values are not less than a preset pixel value. At the same time, for each pixel of the second edge image, determine a second number of pixels whose pixel values are equal to the preset pixel value.

[0084] S3. For each of the second number of pixels, determine each corresponding pixel in the first edge image, and determine a third number of paired pixels whose grayscale values are equal to the preset pixel value within the neighborhoods corresponding to all of the corresponding pixels.

[0085] S4. If the ratio of the third number to the first number is greater than a preset value, it is determined that the image area extraction is successful; if the ratio of the third number to the first number is less than the preset value, it is determined that the image area extraction fails.

[0086] In this embodiment, reference Figure 11 The first original image shown, Figure 12 As shown in the first mask image, it can be seen that the first original image is an image of a white table, while the corresponding first mask image treats the white table as the sky area, resulting in image area recognition errors, which in turn affects the extraction results of the area by users or other programs.

[0087] In this embodiment, reference Figure 13 The second original image shown, Figure 14 As shown in the second mask image, it can be seen that the second original image contains the sky, while the corresponding first mask image identifies the sky as the sky area. Therefore, the image area is correctly identified and will not affect the extraction results of the user or other programs for this area.

[0088] Optionally, in this embodiment, in order to avoid the above-mentioned image region recognition error, after obtaining the corresponding mask image, an extraction result recognition scheme is added to the original image and the mask image to determine whether the current image region extraction result is successful.

[0089] Optionally, in this embodiment, first, the original image A is input, and then the required image area is extracted to obtain a mask image mask corresponding to the original image A.

[0090] Optionally, in this embodiment, as described in the above example, after obtaining the mask image mask, edges are extracted from the original image A and the mask image mask respectively to obtain an edge image edge_A and an edge image edge_mask respectively.

[0091] Optionally, in this embodiment, when extracting edges from the original image A and the mask image mask respectively, the canny operator may be used to obtain the edges of the image.

[0092] Optionally, in this embodiment, as described in the above example, after obtaining the edge image edge_A and the edge image edge_mask respectively, for each pixel of the edge image edge_mask, a first number of pixels whose pixel values are not less than a preset pixel value are determined, and at the same time, for each pixel of the edge image edge_mask, a second number of pixels whose pixel values are equal to the preset pixel value are determined.

[0093] Optionally, in this embodiment, as described in the above example, for each of the second number of pixels, a corresponding pixel in the edge image edge_A is determined, and within the neighborhood corresponding to each of the corresponding pixels, a third number of paired pixels having a grayscale value equal to the preset pixel value is determined. That is, for each corresponding pixel in the edge image edge_A, within a certain range of the corresponding neighborhood, all pixels having a grayscale value equal to the preset pixel value are obtained one by one as the paired pixels of this embodiment, and the number of paired pixels is recorded as the third number.

[0094] Optionally, in this embodiment, as described in the above example, a preset value T is given in advance. If the ratio of the third number to the first number is greater than the preset value T, it is determined that the image area extraction is successful. If the ratio of the third number to the first number is less than the preset value T, it is determined that the image area extraction fails.

[0095] The beneficial effect of this embodiment is that, by obtaining the original image and its corresponding mask image and performing edge extraction respectively to obtain a first edge image and a second edge image; then, for each pixel of the second edge image, a first number of pixels whose pixel values are not less than a preset pixel value are determined, and at the same time, for each pixel of the second edge image, a second number of pixels whose pixel values are equal to the preset pixel value are determined; for each of the second number of pixels, each corresponding pixel in the first edge image is determined, and within the neighborhood corresponding to all of the corresponding pixels, a third number of paired pixels whose grayscale values are equal to the preset pixel value are determined; finally, if the ratio of the third number to the first number is greater than a preset value, it is determined that the image region extraction is successful; if the ratio of the third number to the first number is less than the preset value, it is determined that the image region extraction fails. An efficient and accurate image region extraction result identification scheme is implemented, which avoids affecting the normal operation of related applications due to image region extraction failure, or causing trouble for users in using functions, thereby improving productivity and enhancing user experience.

[0096] Example 2

[0097] Figure 4 This is a flow chart of a second embodiment of the method for identifying image region extraction results according to the present invention. Based on the above embodiment, the first edge image and the second edge image obtained by performing edge extraction on the original image and its corresponding mask image respectively include:

[0098] S11. Obtain the input original image.

[0099] S12. Extract an image area from the original image, and obtain the mask image corresponding to the original image through deep learning, wherein the image area is a sky area.

[0100] Optionally, in this embodiment, when the user extracts the image area of the selected image, the original image of this embodiment is input from the device's gallery or network terminal, and when the application performs a function based on image area extraction, the original image before image area extraction is obtained.

[0101] Optionally, in this embodiment, an image region is extracted from the original image, and the mask image corresponding to the original image is obtained through deep learning. Alternatively, the mask image corresponding to the original image can be obtained through other image processing methods. It is understood that when other applications perform functions based on image region extraction, they can directly access the mask image generated by the intermediate processing steps of other applications. In this embodiment, one application of the image region extraction results is to determine the sky region extraction results. In this case, the image region is the sky region.

[0102] The beneficial effect of this embodiment is that, by obtaining the input original image, extracting an image region from the original image, and obtaining the mask image corresponding to the original image through deep learning, wherein the image region is a sky region, an image data source is provided for implementing an efficient and accurate image region extraction result recognition solution, thereby avoiding the impact of image region extraction failures on the normal operation of related applications or the resulting functional difficulties for users, thereby improving productivity and enhancing user experience.

[0103] Example 3

[0104] Figure 5 This is a flowchart of a third embodiment of the image region extraction result recognition method of the present invention. Based on the above embodiment, for each pixel of the second edge image, determining a first number of pixels whose pixel values are not less than a preset pixel value, and at the same time, for each pixel of the second edge image, determining a second number of pixels whose pixel values are equal to the preset pixel value, includes:

[0105] S21. Obtaining regional features of the image region.

[0106] S22. Determine the preset pixel value corresponding to the region feature, wherein, when the image region is the sky region, the region feature is pure white, and the preset pixel value is 255.

[0107] Optionally, in this embodiment, a region feature of the image region is obtained. For example, when the image region is the sky, the region feature is a pure white color feature.

[0108] Optionally, in this embodiment, the preset pixel value corresponding to the regional feature is determined, wherein, when the image area is the sky area, the regional feature is pure white, and in the corresponding grayscale image, the preset pixel value is determined to be 255.

[0109] The beneficial effect of this embodiment is that, by obtaining the regional features of the image region and then determining the preset pixel value corresponding to the regional features, where, when the image region is the sky region and the regional features are pure white, the preset pixel value is 255, a method for setting preset pixel values is provided to achieve an efficient and accurate image region extraction result identification solution, thereby preventing the normal operation of related applications from being affected by image region extraction failures or causing functional difficulties for users, thereby improving productivity and enhancing user experience.

[0110] Example 4

[0111] Figure 6This is a flowchart of a fourth embodiment of the method for identifying image region extraction results according to the present invention. Based on the above embodiment, for each pixel of the second edge image, determining a first number of pixels whose pixel values are not less than a preset pixel value, and at the same time, for each pixel of the second edge image, determining a second number of pixels whose pixel values are equal to the preset pixel value, further comprising:

[0112] S23: Compare the pixel value of each pixel of the second edge image with the preset pixel value.

[0113] S24. Obtain a first number of pixels whose pixel values are not less than the preset pixel value.

[0114] Optionally, in this embodiment, as described in the above example, when identifying the sky area, the pixel value of each pixel of the edge image edge_mask is compared with the pixel value 255.

[0115] Optionally, in this embodiment, as described in the above example, among the pixels of the edge image edge_mask, pixels having pixel values not less than 255 are determined one by one, and their number is counted as the first number of this embodiment.

[0116] The beneficial effect of this embodiment is that by comparing the pixel value of each pixel of the second edge image with the preset pixel value and obtaining a first number of pixels whose pixel values are not less than the preset pixel value, a judgment data basis is provided for implementing an efficient and accurate image region extraction result identification solution, thereby avoiding image region extraction failures that affect the normal operation of related applications or cause functional difficulties for users, thereby improving productivity and enhancing user experience.

[0117] Example 5

[0118] Figure 7 This is a flowchart of a fifth embodiment of the method for identifying image region extraction results according to the present invention. Based on the above embodiment, for each pixel of the second edge image, determining a first number of pixels whose pixel values are not less than a preset pixel value, and simultaneously, for each pixel of the second edge image, determining a second number of pixels whose pixel values are equal to the preset pixel value, further comprising:

[0119] S25: Compare the pixel value of each pixel of the second edge image with the preset pixel value.

[0120] S26. Obtain a second number of pixels whose pixel values are equal to the preset pixel values.

[0121] Optionally, in this embodiment, as described in the above example, when identifying the sky area, the pixel value of each pixel of the edge image edge_mask is compared with the pixel value 255.

[0122] Optionally, in this embodiment, as described in the above example, in each pixel of the edge image edge_mask, pixels having a pixel value equal to 255 are determined one by one, and their number is counted as the second number of this embodiment.

[0123] This embodiment advantageously compares the pixel value of each pixel in the second edge image with the preset pixel value, and then obtains a second number of pixels whose pixel values are equal to the preset pixel value. This provides another data basis for determining an efficient and accurate image region extraction result identification solution, thereby preventing image region extraction failures from affecting the normal operation of related applications or causing user problems with functional usage, thereby improving productivity and enhancing user experience.

[0124] Example 6

[0125] Figure 8 This is a flowchart of a sixth embodiment of the image region extraction result recognition method of the present invention. Based on the above embodiment, for each of the second number of pixels, determining each corresponding pixel in the first edge image, and determining a third number of paired pixels whose grayscale values are equal to the preset pixel value within the neighborhoods corresponding to all of the corresponding pixels, includes:

[0126] S31. Preset a similarity range corresponding to the regional features.

[0127] S32. Use the similar range as the neighborhood.

[0128] Optionally, in this embodiment, refer to Figure 15 The second edge map shown, and the reference Figure 16 The first edge map shown in FIG. The first edge map canny_origin and the second edge map canny_mask both show a pixel A on a straight line. First, the grayscale value of pixel A in the first edge map canny_mask is determined to be no less than 255. Then, other pixels with grayscale values no less than 255 are searched within a neighborhood of the corresponding pixel A' in the second edge map canny_origin.

[0129] Optionally, in this embodiment, a similar range corresponding to the regional features of the image area to be extracted in the original image is preset, and the similar range is used as the neighborhood, that is, the circle range in the first edge map canny_origin.

[0130] Optionally, in this embodiment, a similarity range corresponding to the extraction result judgment accuracy is preset and used as the neighborhood, that is, the circle range in the first edge map canny_origin. If the judgment accuracy needs to be improved, the range of the neighborhood is narrowed.

[0131] The beneficial effect of this embodiment is that by presetting a similar range corresponding to the regional features and then using the similar range as the neighborhood, a neighborhood setting method is provided to achieve an efficient and accurate image region extraction result recognition solution, thereby avoiding the impact of image region extraction failures on the normal operation of related applications or causing functional difficulties for users, thereby improving productivity and enhancing user experience.

[0132] Example 7

[0133] Figure 9 This is a flowchart of a seventh embodiment of the method for identifying image region extraction results according to the present invention. Based on the above embodiment, for each of the second number of pixels, determining each corresponding pixel in the first edge image, and determining a third number of paired pixels whose grayscale values are equal to the preset pixel value within the neighborhoods corresponding to all of the corresponding pixels, further comprising:

[0134] S33: Determine the neighborhood corresponding to each corresponding pixel, and compare the pixel value of each pixel in all neighborhoods with the preset pixel value.

[0135] S34. Obtain a third number of pixels whose grayscale values are equal to the preset pixel value.

[0136] Optionally, in this embodiment, as described in the above example, when identifying the sky area, first, the corresponding pixel of each pixel of the edge image edge_mask in the edge image edge_A is determined.

[0137] Optionally, in this embodiment, as described in the above example, for the neighborhoods corresponding to the corresponding pixels, the pixel values of each pixel in all neighborhoods are compared with the pixel value of 255, and in each corresponding pixel of the edge image edge_A, the pixels whose pixel values are equal to the pixel value of 255 are determined one by one, and their number is counted as the third number of this embodiment.

[0138] The beneficial effect of this embodiment is that by determining the neighborhood corresponding to each of the corresponding pixels, comparing the pixel values of each pixel in all neighborhoods with the preset pixel value; then, obtaining the third quantity of all pixels whose gray values are equal to the preset pixel value. It provides another determination data basis for realizing an efficient and accurate image region extraction result recognition scheme, avoiding affecting the normal operation of related applications due to failed image region extraction, or causing troubles in function use to users, improving productivity, and enhancing the user experience.

[0139] Embodiment 8

[0140] Figure 10 It is a flowchart of the eighth embodiment of the image region extraction result recognition method of the present invention. Based on the above embodiment, if the ratio of the third quantity to the first quantity is greater than the preset value, it is determined that the image region extraction is successful; if the ratio of the third quantity to the first quantity is less than the preset value, it is determined that the image region extraction fails, and it includes:

[0141] S41. Determine the preset value corresponding to the region feature and / or the preset recognition accuracy.

[0142] S42. If the ratio of the third quantity to the first quantity is greater than the preset value, it is determined that the image region extraction is successful or the recognition is successful; if the ratio of the third quantity to the first quantity is less than the preset value, it is determined that the image region extraction fails or the recognition fails.

[0143] Optionally, in this embodiment, as described in the above example, the number of pixels with gray values not less than 255 in the second edge map canny_mask is used as the first quantity num0, and the number of pixels successfully paired in the second edge map canny_origin is used as the third quantity numl. At the same time, the preset value is set to T. [[ID=​​​​​​​​​​​​​​​​​​ Figure 20 where the corresponding num1 / num0 < T, and the detection result extracted from the sky area is failed.

[0146] The beneficial effect of this embodiment lies in that by determining the preset value corresponding to the region feature and / or the preset recognition accuracy; if the ratio of the third quantity to the first quantity is greater than the preset value, it is determined that the image region extraction is successful or the recognition is successful, and if the ratio of the third quantity to the first quantity is less than the preset value, it is determined that the image region extraction is failed or the recognition is failed. It provides a more logically optimized determination method for realizing an efficient and accurate image region extraction result recognition scheme, avoiding affecting the normal operation of related applications due to failed image region extraction or causing troubles to users in function usage, improving productivity and enhancing the user experience.

[0147] Embodiment Nine

[0148] Based on the above embodiments, the present invention further provides an image region extraction result recognition device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the image region extraction result recognition method described in any one of the above.

[0149] It should be noted that the above device embodiment and the method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment, and the technical features in the method embodiment are all correspondingly applicable in the device embodiment, so they will not be elaborated here.

[0150] Embodiment Ten

[0151] Based on the above embodiments, the present invention further provides a computer-readable storage medium, on which an image region extraction result recognition program is stored. When the image region extraction result recognition program is executed by a processor, it implements the steps of the image region extraction result recognition method described in any one of the above.

[0152] It should be noted that the above medium embodiment and the method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment, and the technical features in the method embodiment are all correspondingly applicable in the medium embodiment, so they will not be elaborated here.

[0153] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0154] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0155] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0156] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are protected by the present invention.

Claims

1. A method for identifying image region extraction results, characterized in that: The method comprises: Obtaining a first edge image and a second edge image obtained by edge extraction of an original image and its corresponding mask image; For each pixel of the second edge image, determining a first number of pixels having pixel values not less than a predetermined pixel value, and simultaneously, for each pixel of the second edge image, determining a second number of pixels having pixel values equal to the predetermined pixel value; For each of the second number of pixels, determining each corresponding pixel in the first edge image, and determining a third number of paired pixels, all of which have grayscale values equal to the predetermined pixel value, within neighborhoods corresponding to all of the corresponding pixels; If the ratio of the third number to the first number is greater than a preset value, it is determined that the image area extraction is successful; if the ratio of the third number to the first number is less than the preset value, it is determined that the image area extraction fails.

2. The image region extraction result recognition method according to claim 1, characterized in that: The first edge image and the second edge image obtained by extracting the edge of the original image and its corresponding mask image respectively include: Obtaining the input original image; An image region is extracted from the original image, and the mask image corresponding to the original image is obtained through deep learning, wherein the image region is a sky region.

3. The image region extraction result recognition method according to claim 2, characterized in that: The step of determining, for each pixel of the second edge image, a first number of pixels having pixel values not less than a preset pixel value, and determining, for each pixel of the second edge image, a second number of pixels having pixel values equal to the preset pixel value, includes: Acquiring regional features of the image region; The preset pixel value corresponding to the region feature is determined, wherein, when the image region is the sky region, the region feature is pure white, and the preset pixel value is 255.

4. The image region extraction result recognition method according to claim 3, characterized in that: The step of determining, for each pixel of the second edge image, a first number of pixels having pixel values not less than a preset pixel value, and simultaneously, for each pixel of the second edge image, determining a second number of pixels having pixel values equal to the preset pixel value, further comprises: comparing a pixel value of each pixel of the second edge image with the preset pixel value; A first number of pixels whose pixel values are not less than the preset pixel value is obtained.

5. The image region extraction result recognition method according to claim 4, characterized in that: The step of determining, for each pixel of the second edge image, a first number of pixels having pixel values not less than a preset pixel value, and simultaneously, for each pixel of the second edge image, determining a second number of pixels having pixel values equal to the preset pixel value, further comprises: comparing a pixel value of each pixel of the second edge image with the preset pixel value; A second number of pixels whose pixel values are equal to the preset pixel values are obtained.

6. The image region extraction result recognition method according to claim 5, characterized in that: The step of determining, for each of the second number of pixels, each corresponding pixel in the first edge image, and determining, within respective neighborhoods corresponding to all of the corresponding pixels, a third number of paired pixels whose grayscale values are equal to the preset pixel value, includes: Presetting a similar range corresponding to the regional characteristics; The similar range is regarded as the neighborhood.

7. The image region extraction result recognition method according to claim 6, characterized in that: The method further includes: determining each corresponding pixel in the first edge image for each of the second number of pixels, and determining a third number of paired pixels whose grayscale values are equal to the preset pixel value within the neighborhoods corresponding to all of the corresponding pixels. Determine a neighborhood corresponding to each of the corresponding pixels, and compare the pixel value of each pixel in all the neighborhoods with the preset pixel value; A third number of pixels whose grayscale values are equal to the preset pixel values are obtained.

8. The image region extraction result recognition method according to claim 7, characterized in that: If the ratio of the third number to the first number is greater than a preset value, determining that the image area extraction is successful; if the ratio of the third number to the first number is less than the preset value, determining that the image area extraction fails, includes: Determining the preset value corresponding to the regional feature and / or the preset recognition accuracy; If the ratio of the third number to the first number is greater than the preset value, it is determined that the image area extraction is successful or the recognition is successful; if the ratio of the third number to the first number is less than the preset value, it is determined that the image area extraction is failed or the recognition is failed.

9. An image region extraction result recognition device, characterized in that: The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the image region extraction result recognition method according to any one of claims 1 to 8 are implemented.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores an image region extraction result recognition program, which, when executed by a processor, implements the steps of the image region extraction result recognition method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Image segmentation method and device

    CN109785345A

  • Image processing method and device, electronic equipment and computer readable storage medium

    CN111127307A