Image Recognition Method, Apparatus, Device, and Medium

By grayscale and binary processing of the image data of the robot inspection in the computer room, combined with integral computing and local threshold technology, the problem of insufficient image clarity caused by lighting interference is solved, and the accuracy of image recognition and the success rate of device status recognition are improved.

CN114677649BActive Publication Date: 2025-07-25INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210462796.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-28
Publication Date
2025-07-25
Estimated Expiration
2042-04-28

AI Technical Summary

Technical Problem

The computer room inspection robot is affected by light interference during the image recognition process, resulting in insufficient image clarity and low recognition accuracy. Especially in complex lighting and noise situations, the existing algorithms have poor processing effects, which affects the accuracy and efficiency of equipment status recognition.

Method used

The image data is grayscaled, and the local threshold is determined through binarization technology and integral operation, image noise and lighting interference are reduced, and the image recognition model corresponding to the recognition type is used to output the recognition results.

Benefits of technology

It improves the accuracy and robustness of image recognition, effectively reduces the impact of noise and lighting interference, and improves the success rate of device status recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114677649B_ABST
    Figure CN114677649B_ABST
Patent Text Reader

Abstract

The present disclosure provides an image recognition method, which can be applied to the fields of finance and artificial intelligence technologies. The method includes: in response to an image recognition request, obtaining first grayscale image data and a recognition type of the image to be recognized carried in the image recognition request; performing binarization processing on the first grayscale image data to obtain second grayscale image data; determining target image data based on the initial image data and the second grayscale image data of the image to be recognized according to the recognition type; and inputting the target image data into an image recognition model corresponding to the recognition type to output a recognition result of the image to be recognized. In addition, the present disclosure also provides an image recognition device, equipment, medium and product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical fields of finance and artificial intelligence, and more particularly, to an image recognition method, apparatus, device, medium, and product. Background Art

[0002] Inspection devices such as inspection robots in computer rooms mainly obtain the current operating status, operating parameters, monitoring data, etc. of devices by taking images of the devices in the cabinet and performing image recognition on the color of the indicator lights representing the device status, the information in the device display screen, etc. in the images, so as to achieve the purpose of inspection.

[0003] However, during the process of image recognition, the interference of light has a great impact. For example, during the shooting process, due to factors such as insufficient focus or background light interference, the captured images may have phenomena such as local overexposure and insufficient clarity, reducing the accuracy of image recognition. Moreover, the inspection robot will take multiple images during a single inspection task, and the light interference conditions in each image are also different, and there are too many noise sounds in the captured images, reducing the accuracy of image recognition. Summary of the Invention

[0004] In view of this, the present disclosure provides an image recognition method, an image recognition apparatus, an electronic device, a readable storage medium, and a computer program product.

[0005] One aspect of the present disclosure provides an image recognition method, including: in response to an image recognition request, obtaining first grayscale image data and a recognition type of a to-be-recognized image carried in the image recognition request; performing binarization processing on the first grayscale image data to obtain second grayscale image data; determining target image data based on the initial image data of the to-be-recognized image and the second grayscale image data according to the recognition type; and inputting the target image data into an image recognition model corresponding to the recognition type, and outputting a recognition result of the to-be-recognized image.

[0006] According to an embodiment of the present disclosure, the recognition type includes character recognition and color recognition; the determining the target image data based on the initial image data of the to-be-recognized image and the second grayscale image data according to the recognition type includes: when the recognition type is character recognition, determining the target image data as the second grayscale image data; and when the recognition type is color recognition, processing the initial image data according to the grayscale values of the pixel points in the second grayscale image data to obtain the target image data.

[0007] According to an embodiment of the present disclosure, the gray value of a pixel point in the second gray image data is the first gray value or the second gray value; processing the initial image data according to the gray value of the pixel point in the second gray image data to obtain the target image data includes: placing the initial image data and the second gray image data into a preset reference system to determine the position information of each pixel point in the initial image data and each pixel point in the second gray image data in the preset reference system; determining a position information set according to the position information of all pixel points with the first gray value in the second gray image data; determining target pixel points from the initial image data according to the position information set; and modifying the values of all target pixel points in the initial image data to a preset value to obtain the target image data.

[0008] According to an embodiment of the present disclosure, performing binarization processing on the first gray image data to obtain the second gray image data includes: obtaining integral image data of the first gray image data through integral operation; successively for each first pixel point in the first gray image data, determining a local window corresponding to the first pixel point, where the local window further includes a plurality of second pixel points; determining a local threshold of the first pixel point based on the gray values of the plurality of second pixel points in the first gray image data and the integral values of the plurality of second pixel points in the integral image data; modifying the gray value of the first pixel point to the first gray value or the second gray value based on the comparison result of the local threshold of the first pixel point and the gray value of the first pixel point; and after completing the traversal of all first pixel points in the first gray image data, obtaining the second gray image data.

[0009] According to an embodiment of the present disclosure, modifying the gray value of the first pixel point to the first gray value or the second gray value based on the comparison result of the local threshold of the first pixel point and the gray value of the first pixel point includes: in the case where the local threshold of the first pixel point is greater than or equal to the gray value of the first pixel point, modifying the gray value of the first pixel point to the first gray value; and in the case where the local threshold of the first pixel point is less than the gray value of the first pixel point, modifying the gray value of the first pixel point to the second gray value.

[0010] According to an embodiment of the present disclosure, inputting the target image data into an image recognition model corresponding to the recognition type and outputting the recognition result of the image to be recognized includes: in the case where the recognition type is character recognition, inputting the target image data into a character recognition model and outputting the recognition result representing the character content in the image to be recognized; and in the case where the recognition type is color recognition, inputting the target image data into a color recognition model and outputting the recognition result representing the color of the image to be recognized.

[0011] According to an embodiment of the present disclosure, the method further includes: performing smoothing filtering on the first grayscale image data to obtain third grayscale image data; and performing binarization on the third grayscale image data using the local threshold segmentation algorithm to obtain the second grayscale image data.

[0012] Another aspect of the present disclosure provides an image recognition device, including: an acquisition module configured to acquire the first grayscale image data and the recognition type of the image to be recognized carried in the image recognition request in response to the image recognition request; a first processing module configured to perform binarization on the first grayscale image data to obtain second grayscale image data; a determination module configured to determine target image data based on the initial image data of the image to be recognized and the second grayscale image data according to the recognition type; and an input module configured to input the target image data into an image recognition model corresponding to the recognition type and output the recognition result of the image to be recognized.

[0013] Another aspect of the present disclosure provides an electronic device, including: one or more processors; a memory configured to store one or more instructions, wherein when the one or more instructions are executed by the one or more processors, the one or more processors are caused to implement the method as described above.

[0014] Another aspect of the present disclosure provides a computer-readable storage medium having executable instructions stored thereon, where the executable instructions, when executed by a processor, cause the processor to implement the method as described above.

[0015] Another aspect of the present disclosure provides a computer program product, where the computer program product includes computer-executable instructions that are used to implement the method as described above when executed.

[0016] According to an embodiment of the present disclosure, by performing binarization processing on the first grayscale image data, various complex illumination and noise interference situations in the image data can be adaptively processed, at least partially solving the problem of insufficient image clarity caused by insufficient focusing and light background interference during the image shooting process, and effectively improving the accuracy and robustness of image recognition. In addition, by using the binarized second grayscale image data to re-determine the target image data according to the recognition type, the noise and interference in the image to be recognized can be effectively reduced, and the success rate of image recognition can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Through the following description of the embodiments of the present disclosure with reference to the drawings, the above and other objects, features, and advantages of the present disclosure will become clearer. In the drawings:

[0018] Figure 1 Schematically shows an exemplary system architecture to which the image recognition method and apparatus according to an embodiment of the present disclosure can be applied;

[0019] Figure 2 Schematically shows a flowchart of the image recognition method according to an embodiment of the present disclosure;

[0020] Figure 3 Schematically shows a flowchart of the binarization processing of the first grayscale image data according to an embodiment of the present disclosure;

[0021] Figure 4 Schematically shows a flowchart of the image recognition method according to another embodiment of the present disclosure;

[0022] Figure 5 Schematically shows a block diagram of the image recognition apparatus according to an embodiment of the present disclosure; and

[0023] Figure 6 Schematically shows a block diagram of an electronic device suitable for implementing the image recognition method according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0024] Hereinafter, embodiments of the present disclosure will be described with reference to the drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for the sake of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, obviously, one or more embodiments can be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily confusing the concepts of the present disclosure.

[0025] The terms used herein are for the purpose of describing particular embodiments only and are not intended to limit the disclosure. The terms "including", "comprising" and the like as used herein indicate the presence of the recited features, steps, operations and / or components, but do not preclude the presence or addition of one or more other features, steps, operations or components.

[0026] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those of ordinary skill in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0027] In cases where expressions such as "at least one of A, B, and C, etc." are used, generally it should be interpreted according to the meaning commonly understood by those of ordinary skill in the art (for example, "a system having at least one of A, B, and C" should include, but is not limited to, a system having only A, only B, only C, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.). In cases where expressions such as "at least one of A, B, or C, etc." are used, generally it should be interpreted according to the meaning commonly understood by those of ordinary skill in the art (for example, "a system having at least one of A, B, or C" should include, but is not limited to, a system having only A, only B, only C, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.).

[0028] Currently, inspection devices such as inspection robots in computer rooms mainly obtain the operating status, operating parameters, monitoring data, etc. of devices by taking images of the devices in the cabinet and performing image recognition on the colors of the status indicator lights and the information in the device displays in the captured images, so as to achieve the purpose of inspection. However, during the process of image recognition, the interference of light has a greater impact.

[0029] For example, in the computer rooms of current data centers, there are no lighting lamps in some cabinet channels. When the robot takes inspection photos, it needs to turn on the flash for supplementary lighting to clearly take pictures of the devices inside the cabinet. However, at this time, the metal grid of the cabinet door will reflect light, resulting in local overexposure of the captured pictures. For another example, the brightness of the data displays and status indicator lights of some devices is too high, which can also cause local overexposure of the inspection images taken by the robot, thus affecting the accuracy of image recognition.

[0030] Regarding the problem of light interference in captured images, image enhancement algorithms are often used in related technologies, specifically including histogram equalization method and its derivative improvement algorithms, etc. However, the noise reduction effect of these algorithms is poor, resulting in a low success rate of image recognition, and the time consumed for processing each image is relatively long. These algorithms have limitations in solving the problem of light interference in images. In addition, usually during the process of a robot performing an inspection task, the number of captured images in one inspection task can be as many as thousands, and the light interference situations in the captured device images vary greatly, and there are too many noise points in the images. The current algorithms cannot solve such problems, thus affecting the accuracy and efficiency of recognizing the status, parameters, etc. of device indicators.

[0031] In view of this, embodiments of the present disclosure provide an image recognition method, an image recognition device, an electronic device, a readable storage medium, and a computer program product. It can effectively reduce the noise and interference in the image to be recognized and improve the success rate of image recognition. The method includes: in response to an image recognition request, obtaining the first grayscale image data and recognition type of the image to be recognized carried in the image recognition request; performing binarization processing on the first grayscale image data to obtain second grayscale image data; determining target image data based on the initial image data and the second grayscale image data of the image to be recognized according to the recognition type; and inputting the target image data into an image recognition model corresponding to the recognition type to output the recognition result of the image to be recognized.

[0032] It should be noted that the image recognition method, device, equipment, medium, and product determined in the embodiments of the present disclosure can be used in the fields of finance and artificial intelligence technologies, and can also be used in any field other than the fields of finance and artificial intelligence technologies. The embodiments of the present disclosure do not limit the application fields of the image recognition method, device, equipment, medium, and product.

[0033] In the technical solution of the present disclosure, the processing of collection, storage, use, processing, transmission, provision, disclosure, and application of the user's personal information involved all comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good customs.

[0034] In the technical solution of the present disclosure, before obtaining or collecting the user's personal information, the authorization or consent of the user is obtained.

[0035] Figure 1 Schematically shows an exemplary system architecture to which the image recognition method and device according to embodiments of the present disclosure can be applied. It should be noted that Figure 1 The shown is only an example of the system architecture to which the embodiments of the present disclosure can be applied to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments, or scenarios.

[0036] As Figure 1 shown, the system architecture 100 according to this embodiment may include a robot 101, terminal devices 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the robot 101, the terminal devices 102, 103, and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0037] The robot 101 can interact with the terminal devices 102, 103 and the server 105 through the network 104. Users can use the terminal devices 102, 103 to interact with the robot 101 and the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the terminal devices 102, 103, such as robot management applications, computer room inspection systems and management software, operation management applications, office applications, shopping applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software, etc. (for example only).

[0038] The robot 101 can be set in a space that needs to be inspected, such as a computer room. The robot 101 can be a robot with information collection components such as a camera, a gas sensor, a sound sensor, etc., such as an inspection robot. The robot 101 can collect images of the equipment in the computer room to facilitate the server 105 to confirm the status of the equipment in the computer room. The terminal devices 102, 103 can be various electronic devices, including but not limited to smart phones, tablets, laptop computers, desktop computers, virtual reality devices, augmented reality devices, etc.

[0039] The server 105 can be a server that provides various services. For example, it can be a background management server, a database server, a server cluster, etc. It can analyze and process the received data, and feedback the processing results (such as equipment parameters in the computer room, equipment abnormal conditions, equipment identifiers, computer room status parameters, and related information, etc.) to the terminal devices.

[0040] It should be noted that the image recognition method provided by the embodiments of the present disclosure can generally be executed by the server 105. Correspondingly, the image recognition device provided by the embodiments of the present disclosure can generally be set in the server 105. The image recognition method provided by the embodiments of the present disclosure can also be executed by a server or a server cluster different from the server 105 and capable of communicating with the robot 101, the terminal devices 102, 103, and / or the server 105. Correspondingly, the image recognition device provided by the embodiments of the present disclosure can also be set in a server or a server cluster different from the server 105 and capable of communicating with the robot 101, the terminal devices 102, 103, and / or the server 105. Or, the image recognition method provided by the embodiments of the present disclosure can also be executed by the robot 101, the terminal devices 102, 103, or can also be executed by other devices different from the robot 101, the terminal devices 102, 103. Correspondingly, the image recognition device provided by the embodiments of the present disclosure can also be set in the robot 101, the terminal devices 102, 103, or set in other devices different from the robot 101, the terminal devices 102, 103.

[0041] For example, any one of the robot 101, the terminal devices 102, 103 can obtain the image to be recognized, or the image to be recognized is stored in the device itself, or the image to be recognized can also be stored on an external device and imported into any one of the robot 101, the terminal devices 102, 103. Any one of the robot 101, the terminal devices 102, 103 can locally execute the image recognition method provided by the embodiments of the present disclosure to process the image to be recognized, or any one of the robot 101, the terminal devices 102, 103 can also send it to other terminal devices, servers, or server clusters through the network 104, and the other terminal devices, servers, or server clusters that receive the image to be recognized execute the image recognition method provided by the embodiments of the present disclosure to process the image to be recognized.

[0042] It should be understood that Figure 1 the numbers of the terminal devices, the network, and the servers in

[0043] Figure 2 is merely illustrative. According to the implementation requirements, there can be any number of terminal devices, networks, and servers.

[0044] As Figure 2 shown, the method includes operations S201 to S204.

[0045] In operation S201, in response to the image recognition request, obtain the first grayscale image data and the recognition type of the image to be recognized carried in the image recognition request.

[0046] In operation S202, perform binarization processing on the first grayscale image data to obtain the second grayscale image data.

[0047] In operation S203, based on the recognition type, determine the target image data based on the initial image data and the second grayscale image data of the image to be recognized.

[0048] In operation S204, input the target image data into an image recognition model corresponding to the recognition type, and output the recognition result of the image to be recognized.

[0049] According to an embodiment of the present disclosure, the image recognition request may be a request to recognize an object in the image. The object to be recognized may be elements such as text, color, etc. in the image, or may also be a device in the image, an indicator light of the device, a display screen of the device, etc., which is not limited herein.

[0050] According to an embodiment of the present disclosure, the image to be recognized may be an image including the object to be recognized. The image to be recognized may be an image obtained by a patrol device such as a patrol robot photographing the devices in the cabinet, or may also be an image to be recognized that is pre-acquired and stored locally.

[0051] According to an embodiment of the present disclosure, the first grayscale image data may be image data obtained by mapping the image data of the image to be recognized into a grayscale space. That is, the first grayscale image data may be obtained by mapping the image data of each pixel point of the image to be recognized into a value between 0 and 255.

[0052] According to an embodiment of the present disclosure, the recognition type may be a type corresponding to the object to be recognized. For example, a text recognition type, a color recognition type, a shape recognition type, etc. Specifically, when the object to be recognized is the model of a device, the text information in the device display screen, etc., the recognition type may be a text recognition type; when the object to be recognized is the color of an indicator light, etc., the recognition type may be a color recognition type; when the object to be recognized is a device, an indicator light of the device, a display screen of the device, etc., the recognition type to be recognized may be a shape recognition type.

[0053] According to an embodiment of the present disclosure, the binarization processing may be implemented by methods such as an adaptive threshold method, a Niblack algorithm, a Sauvola algorithm, an Otsu method, a fixed threshold method, etc., which is not limited herein. For example, in the case of using the adaptive threshold method, the difference between the target area and the background area in the image to be recognized may be utilized to set the image to be recognized into two different levels respectively, and a suitable threshold may be selected to determine whether each pixel point is the target area or the background area, so as to obtain the binarized image.

[0054] According to an embodiment of the present disclosure, the initial image data may be the image data of the image to be recognized, or may be the image data obtained by mapping the image data of the image to be recognized into any color space other than the grayscale space. Accordingly, the image data obtained by mapping the image data of the image to be recognized into the grayscale space may be used as the first grayscale image data. Any color space other than the grayscale space may be, for example, an RGB (Red-Green-Blue) color space, an HSV (Hue-Saturation-Value) color space, an HIS (Hue-Saturation-Intensity) color space, etc. It should be noted that the image to be recognized corresponding to the first grayscale image data and the image to be recognized corresponding to the initial image data may be the same.

[0055] According to an embodiment of the present disclosure, data processing rules corresponding to the recognition type may be configured. Determining the target image data based on the initial image data and the second grayscale image data of the image to be recognized according to the recognition type may be understood as: processing the initial image data and the second grayscale image data according to the data processing rules corresponding to the recognition type, so as to obtain the target image data.

[0056] According to an embodiment of the present disclosure, the image recognition model may be a model corresponding to the recognition type. For example, when the recognition type is character recognition, the image recognition model may be a character recognition model; when the recognition type is color recognition, the image recognition model may be a color recognition model; when the recognition type is shape recognition, the image recognition model may be a shape recognition model, etc.

[0057] According to an embodiment of the present disclosure, by performing binarization processing on the first grayscale image data, various complex illumination and noise interference situations in the image data can be adaptively processed, at least partially solving the problem of insufficient image clarity caused by insufficient focusing and light background interference during the image shooting process, and effectively improving the accuracy and robustness of image recognition. In addition, by using the binarized second grayscale image data to re-determine the target image data according to the recognition type, the noise and interference in the image to be recognized can be effectively reduced, and the success rate of image recognition can be improved.

[0058] According to an embodiment of the present disclosure, the recognition type may include character recognition and color recognition.

[0059] According to an embodiment of the present disclosure, operation S203 may include the following operations:

[0060] In the case where the recognition type is character recognition, the target image data is determined to be the second grayscale image data. Further, in the case where the recognition type is color recognition, the initial image data is processed according to the grayscale values of the pixel points in the second grayscale image data to obtain the target image data.

[0061] According to an embodiment of the present disclosure, by re-determining the target image data using the binarized second grayscale image data according to the recognition type, the noise and interference in the image to be recognized can be effectively reduced, and the success rate of image recognition can be improved.

[0062] According to an embodiment of the present disclosure, the grayscale value of a pixel point in the second grayscale image data can be the first grayscale value or the second grayscale value.

[0063] According to an embodiment of the present disclosure, the second grayscale image data can be the binarized first grayscale image data. Based on the definition of binarization processing, the first grayscale value can be 0, and the second grayscale value can be 1 or 255.

[0064] According to an embodiment of the present disclosure, processing the initial image data according to the grayscale value of the pixel point in the second grayscale image data to obtain the target image data may include the following operations:

[0065] The initial image data and the second grayscale image data are placed in a preset reference system to determine the position information of each pixel point in the initial image data and each pixel point in the second grayscale image data in the preset reference system. According to the position information of all pixel points with the first grayscale value in the second grayscale image data, a position information set is determined. According to the position information set, target pixel points are determined from the initial image data. Further, the values of all target pixel points in the initial image data are modified to a preset value to obtain the target image data.

[0066] According to an embodiment of the present disclosure, the preset reference system can be a preset system selected as a standard for determining the position of each pixel point. The preset reference system can be a rectangular coordinate system, or can also be an Euler angle coordinate system, a polar coordinate system, etc. The position information can be the position of each pixel determined based on the preset reference system. For example, when a rectangular coordinate system is selected as the reference system, the position information of each pixel can include the values of the abscissa and the ordinate.

[0067] According to an embodiment of the present disclosure, the preset value can be any value from 0 to 255. For example, it can be set to 0, 255, etc. In some embodiments, the values of the pixel points near each target pixel point can also be determined to obtain a set of pixel point values, and the preset value can be set to a value different from all the values in the set of pixel point values.

[0068] Figure 3Schematically shown is a flowchart of binarizing first grayscale image data according to an embodiment of the present disclosure.

[0069] As Figure 3 shown, the method may include operations S301 to S305.

[0070] In operation S301, integral image data of the first grayscale image data is obtained through integral operation.

[0071] In operation S302, for each first pixel point in the first grayscale image data in sequence, a local window corresponding to the first pixel point is determined, where the local window further includes a plurality of second pixel points.

[0072] In operation S303, based on the grayscale values of the plurality of second pixel points in the first grayscale image data and the integral values of the plurality of second pixel points in the integral image data, a local threshold of the first pixel point is determined.

[0073] In operation S304, based on the comparison result of the local threshold of the first pixel point and the grayscale value of the first pixel point, the grayscale value of the first pixel point is modified to a first grayscale value or a second grayscale value.

[0074] In operation S305, after completing the traversal of all first pixel points in the first grayscale image data, second grayscale image data is obtained.

[0075] According to an embodiment of the present disclosure, the process of obtaining integral image data from the first grayscale image data through integral operation may be as shown in formulas (1) to (2).

[0076] s(x,y)=s(x,y - 1)+i(x,y) (1)

[0077] ii(x,y)=ii(x - 1,y)+s(x,y) (2)

[0078] Wherein, i(x,y) may represent the first grayscale image data, ii(x,y) may represent the integral image data of the first grayscale image, s(x,y) may represent the integral of a column, and s(x, - 1) = 0, ii(-1,y) = 0. Therefore, obtaining the integral image data only requires traversing the first grayscale image once, reducing the computational overhead.

[0079] According to an embodiment of the present disclosure, the first pixel point may be any pixel point in the first grayscale image data, and the second pixel points may be other pixel points except the first pixel point within the local window established with the first pixel point as the center.

[0080] According to an embodiment of the present disclosure, determining a local window corresponding to a first pixel point may be: centering on the first pixel point (x, y), determining a window of size w×w as the local window corresponding to the first pixel point.

[0081] According to an embodiment of the present disclosure, in the case of determining a local window corresponding to a first pixel point, the process of determining the local threshold of the first pixel point may include the following operations:

[0082] First, the sum of the local window may be determined according to the integral value of the second pixel point in the integral image. The calculation method of determining the sum iiw(x, y) of the local window may be as shown in formula (3):

[0083] iiw(x, y) = [ii(x + d - 1, y + d - 1) + ii(x - d, y - d)] -

[0084] [ii(x - d, y + d - 1) + ii(x + d - 1, y - d)] (3)

[0085] where d = w / 2 and w is an odd number.

[0086] Then, based on the sum of the local window, the local mean value may be determined. The calculation method of determining the local mean value m(x, y) may be as shown in formula (4):

[0087]

[0088] After that, the local threshold of the first pixel point may be determined according to the gray value of the second pixel point in the first gray image data and the local mean value. The calculation method of determining the local threshold of the first pixel point may be as shown in formula (5):

[0089]

[0090] where k may be a given parameter and can be continuously adjusted according to different images and segmentation effects.

[0091] According to an embodiment of the present disclosure, by performing binarization processing on the first gray image data to obtain the second gray image data, the local standard deviation factor in the traditional local threshold segmentation algorithm can be removed, and it is not necessary to calculate the neighborhood standard deviation of each pixel point. Moreover, the integral sum is used to calculate the local mean value, so that the time for calculating the threshold is reduced. And using the integral image does not depend on the size of the local window, and the time complexity remains basically unchanged, which can shorten the calculation time.

[0092] According to an embodiment of the present disclosure, modifying the gray value of the first pixel point to the first gray value or the second gray value based on the comparison result between the local threshold of the first pixel point and the gray value of the first pixel point may include: when the local threshold of the first pixel point is greater than or equal to the gray value of the first pixel point, modifying the gray value of the first pixel point to the first gray value; and when the local threshold of the first pixel point is less than the gray value of the first pixel point, modifying the gray value of the first pixel point to the second gray value.

[0093] According to an embodiment of the present disclosure, the local threshold of the first pixel point may be represented by T(x, y), and the gray value of the first pixel point may be represented by i(x, y). Specifically, it may be determined the magnitude relationship between T(x, y) and i(x, y). When the local threshold T(x, y) of the first pixel point is greater than or equal to the gray value i(x, y) of the first pixel point, modifying the gray value i(x, y) of the first pixel point to the first gray value may be modifying it to 0; when the local threshold T(x, y) of the first pixel point is less than the gray value i(x, y) of the first pixel point, modifying the gray value i(x, y) of the first pixel point to the second gray value may be modifying it to 1 or 255.

[0094] According to an embodiment of the present disclosure, inputting the target image data into an image recognition model corresponding to the recognition type and outputting the recognition result of the image to be recognized includes: when the recognition type is character recognition, inputting the target image data into the character recognition model and outputting the recognition result representing the character content in the image to be recognized; and when the recognition type is color recognition, inputting the target image data into the color recognition model and outputting the recognition result representing the color of the image to be recognized.

[0095] According to an embodiment of the present disclosure, after the binary segmentation of the first grayscale image data is completed, the target image data may be judged and recognized. If the recognition type is character recognition, the second grayscale image data obtained after binarization may be used as the target image data and input into the character recognition model to obtain the recognition result representing the character content in the image to be recognized. If the recognition type is color recognition, the initial image data is processed according to the gray values of the pixel points in the second grayscale image data obtained after binarization to obtain the target image data, and the target image data is input into the color recognition model to output the recognition result representing the color of the image to be recognized.

[0096] According to an embodiment of the present disclosure, if the recognition type is color recognition, the position information of the points with each pixel value of 1 in the second grayscale image data obtained after binarization may also be saved, and marks in the initial image may be determined according to these position information, so as to realize image recognition of the marked area in the initial image.

[0097] According to an embodiment of the present disclosure, by re-determining the target image data using the binarized second grayscale image data according to the recognition type, the noise and interference in the image to be recognized can be effectively reduced, and the success rate of image recognition can be improved.

[0098] Figure 4 The flowchart of an image recognition method according to another embodiment of the present disclosure is schematically shown.

[0099] As Figure 4 shown, the method includes operations S401 to S411.

[0100] In operation S401, in response to an image recognition request, the first grayscale image data of the image to be recognized and the recognition type carried in the image recognition request are obtained. In one embodiment, the specific description of operation S401 can refer to operation S201, which will not be elaborated here.

[0101] In operation S402, the first grayscale image data is subjected to a smoothing filtering process to obtain third grayscale image data.

[0102] According to an embodiment of the present disclosure, the smoothing filtering process may also be a Gaussian smoothing filtering process, or a median smoothing filtering process, an SG smoothing filtering (Savitzky Golay Filter) process, an arithmetic mean filtering method, etc. For example, the first grayscale data can be smoothed by a large-size Gaussian filter kernel to obtain third grayscale image data.

[0103] In operation S403, the third grayscale image data is binarized to obtain second grayscale image data.

[0104] According to an embodiment of the present disclosure, the binarization process of the third grayscale image data obtained after smoothing filtering can refer to operation S202, which will not be elaborated again.

[0105] According to an embodiment of the present disclosure, by first performing a smoothing filtering process on the first grayscale graphic data, the noise or other factors in the image that interfere with image recognition can be reduced. Then, by binarizing the third grayscale image data after smoothing filtering, the various complex illumination and noise interference situations in the image data can be adaptively processed, at least partially solving the problem of insufficient image clarity caused by insufficient focusing and light background interference during the image shooting process, and effectively improving the accuracy and robustness of image recognition.

[0106] In operation S404, based on the comparison result of the local threshold of the first pixel point and the gray value of the first pixel point, the gray value of the first pixel point is modified to the first gray value or the second gray value. In one embodiment, the specific description of operation S404 can refer to operation S304, which will not be elaborated here.

[0107] In operation S405, when the local threshold of the first pixel point is greater than or equal to the gray value of the first pixel point, the gray value of the first pixel point is modified to the first gray value.

[0108] In operation S406, when the local threshold of the first pixel point is less than the gray value of the first pixel point, the gray value of the first pixel point is modified to the second gray value.

[0109] According to an embodiment of the present disclosure, the local threshold of the first pixel point can be represented by T(x, y), and the gray value of the first pixel point can be represented by i(x, y). Specifically, it can be determined whether T(x, y) is greater than or equal to i(x, y). When the local threshold T(x, y) of the first pixel point is greater than or equal to the gray value i(x, y) of the first pixel point, the gray value i(x, y) of the first pixel point is modified to the first gray value, which can be modified to 0; when the local threshold T(x, y) of the first pixel point is less than the gray value i(x, y) of the first pixel point, the gray value i(x, y) of the first pixel point is modified to the second gray value, which can be modified to 1 or 255.

[0110] In operation S407, it is judged whether the second gray image data has been completely segmented. If it is judged that the second gray image data has not been completely segmented, operation S403 is executed; if it is judged that the second gray image data has been completely segmented, subsequent operations are executed.

[0111] In operation S408, according to the recognition type, the target image data is determined based on the initial image data and the second gray image data of the image to be recognized. In one embodiment, the specific description of operation S408 can refer to operation S203, which will not be elaborated here.

[0112] In operation S409, when the recognition type is color recognition, the initial image data is processed according to the gray value of the pixel points in the second gray image data to obtain the target image data.

[0113] In operation S410, when the recognition type is character recognition, the target image data is determined to be the second gray image data.

[0114] According to an embodiment of the present disclosure, processing the initial image data according to the gray value of the pixel points in the second gray image data to obtain the target image data may include the following operations:

[0115] Place the initial image data and the second grayscale image data into a preset reference system to determine the position information of each pixel point in the initial image data and each pixel point in the second grayscale image data in the preset reference system. Determine a set of position information based on the position information of all pixel points with a first grayscale value in the second grayscale image data. Determine target pixel points from the initial image data according to the set of position information. And, modify the values of all target pixel points in the initial image data to a preset value to obtain target image data.

[0116] In operation S411, input the target image data into an image recognition model corresponding to the recognition type, and output the recognition result of the image to be recognized. In one embodiment, the specific description of operation S411 can refer to operation S204 and will not be elaborated here.

[0117] Figure 5 Schematically shows a block diagram of an image recognition device according to an embodiment of the present disclosure.

[0118] As Figure 5 shown, the image recognition device includes an acquisition module 510, a first processing module 520, a determination module 530, and an input module 540.

[0119] The acquisition module 510 is configured to acquire the first grayscale image data and the recognition type of the image to be recognized carried in the image recognition request in response to the image recognition request.

[0120] The first processing module 520 is configured to perform binarization processing on the first grayscale image data to obtain second grayscale image data.

[0121] The determination module 530 is configured to determine target image data based on the initial image data and the second grayscale image data of the image to be recognized according to the recognition type.

[0122] The input module 540 is configured to input the target image data into an image recognition model corresponding to the recognition type, and output the recognition result of the image to be recognized.

[0123] According to an embodiment of the present disclosure, by performing binarization processing on the first grayscale image data, various complex illumination and noise interference situations in the image data can be adaptively processed, and at least partially solve the problem of insufficient image clarity caused by insufficient focusing and light background interference during the image shooting process. By using the method of re-determining the target image data with the binarized second grayscale image data, the noise and interference in the image to be recognized can be reduced, and the success rate of image recognition can be improved.

[0124] According to an embodiment of the present disclosure, the determination module 530 may further include a first determination unit and a processing unit.

[0125] The determination unit is configured to determine that the target image data is the second grayscale image data when the recognition type is character recognition.

[0126] The processing unit is configured to process the initial image data according to the grayscale values of the pixel points in the second grayscale image data to obtain the target image data when the recognition type is color recognition.

[0127] According to an embodiment of the present disclosure, the processing unit further includes a first determination subunit, a second determination subunit, a third determination subunit, and a first modification subunit.

[0128] The first determination subunit is configured to place the initial image data and the second grayscale image data into a preset reference system to determine the position information of each pixel point in the initial image data and each pixel point in the second grayscale image data in the preset reference system.

[0129] The second determination subunit is configured to determine a position information set according to the position information of all pixel points with the first grayscale value in the second grayscale image data.

[0130] The third determination subunit is configured to determine target pixel points from the initial image data according to the position information set.

[0131] The modification subunit is configured to modify the values of all target pixel points in the initial image data to a preset value to obtain the target image data.

[0132] According to an embodiment of the present disclosure, the first processing module 520 further includes an operation unit, a second determination unit, a third determination unit, a modification unit, and a traversal unit.

[0133] The operation unit is configured to obtain integral image data of the first grayscale image data through integral operation.

[0134] The second determination unit is configured to sequentially determine a local window corresponding to each first pixel point in the first grayscale image data, where the local window further includes a plurality of second pixel points.

[0135] The third determination unit is configured to determine a local threshold of the first pixel point based on the grayscale values of the plurality of second pixel points in the first grayscale image data and the integral values of the plurality of second pixel points in the integral image data.

[0136] The modification unit is configured to modify the grayscale value of the first pixel point to the first grayscale value or the second grayscale value based on the comparison result of the local threshold of the first pixel point and the grayscale value of the first pixel point.

[0137] The traversal unit is used to obtain the second grayscale image data after completing the traversal of all the first pixel points in the first grayscale image data.

[0138] According to an embodiment of the present disclosure, the modification unit further includes a second modification subunit and a third modification subunit.

[0139] The second modification subunit is used to modify the grayscale value of the first pixel point to the first grayscale value when the local threshold of the first pixel point is greater than or equal to the grayscale value of the first pixel point.

[0140] The third modification subunit is used to modify the grayscale value of the first pixel point to the second grayscale value when the local threshold of the first pixel point is less than the grayscale value of the first pixel point.

[0141] According to an embodiment of the present disclosure, the input module 540 further includes a first input unit and a second input unit.

[0142] The first input unit is used to input the target image data into the character recognition model when the recognition type is character recognition, and output the recognition result representing the character content in the image to be recognized.

[0143] The second input unit is used to input the target image data into the color recognition model when the recognition type is color recognition, and output the recognition result representing the color of the image to be recognized.

[0144] According to an embodiment of the present disclosure, the image recognition device 500 further includes a second processing module and a third processing module.

[0145] The second processing module is used to perform smoothing filtering processing on the first grayscale image data to obtain a third grayscale image data.

[0146] The third processing module is used to perform binarization processing on the third grayscale image data using the local threshold segmentation algorithm to obtain the second grayscale image data.

[0147] Any plurality of modules, sub-modules, units, and sub-units according to embodiments of the present disclosure, or at least part of the functions of any of the above can be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to embodiments of the present disclosure can be split into multiple modules for implementation. Any one or more of the modules, sub-modules, units, and sub-units according to embodiments of the present disclosure can be at least partially implemented as a hardware circuit, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by any other reasonable way of integrating or packaging circuits, in hardware or firmware, or implemented in any one of the three implementation manners of software, hardware, and firmware, or in an appropriate combination of any several of them. Alternatively, one or more of the modules, sub-modules, units, and sub-units according to embodiments of the present disclosure can be at least partially implemented as a computer program module, and when the computer program module is run, it can execute the corresponding functions.

[0148] For example, any plurality of the acquisition module 510, the first processing module 520, the determination module 530, and the input module 540 can be combined and implemented in one module / unit / sub-unit, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to embodiments of the present disclosure, at least one of the acquisition module 510, the first processing module 520, the determination module 530, and the input module 540 can be at least partially implemented as a hardware circuit, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by any other reasonable way of integrating or packaging circuits, in hardware or firmware, or implemented in any one of the three implementation manners of software, hardware, and firmware, or in an appropriate combination of any several of them. Alternatively, at least one of the acquisition module 510, the first processing module 520, the determination module 530, and the input module 540 can be at least partially implemented as a computer program module, and when the computer program module is run, it can execute the corresponding functions.

[0149] It should be noted that the image recognition device part in the embodiments of the present disclosure corresponds to the image recognition method part in the embodiments of the present disclosure. For the description of the image recognition device part, please refer to the image recognition method part specifically, and details will not be repeated here.

[0150] Figure 6A block diagram of an electronic device suitable for an image recognition method according to an embodiment of the present disclosure is schematically shown. Figure 6 The electronic device shown is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.

[0151] As Figure 6 shown, the computer electronic device 600 according to an embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage section 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general microprocessor (such as a CPU), an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor (such as an application specific integrated circuit (ASIC)), and so on. The processor 601 may also include on-board memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0152] In the RAM 603, various programs and data required for the operation of the electronic device 600 are stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. The processor 601 performs various operations of the method flow according to an embodiment of the present disclosure by executing the program in the ROM 602 and / or the RAM 603. It should be noted that the program may also be stored in one or more memories other than the ROM 602 and the RAM 603. The processor 601 may also perform various operations of the method flow according to an embodiment of the present disclosure by executing the program stored in the one or more memories.

[0153] According to an embodiment of the present disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, and the input / output (I / O) interface 605 is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read from it can be installed into the storage section 608 as needed.

[0154] According to an embodiment of the present disclosure, the method flow according to the embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the above-described system, device, apparatus, module, unit, etc. can be implemented by computer program modules.

[0155] The present disclosure also provides a computer-readable storage medium, which can be included in the device / apparatus / system described in the above embodiment; or can exist alone without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0156] According to an embodiment of the present disclosure, the computer-readable storage medium can be a non-volatile computer-readable storage medium. For example, it can include but is not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, device, or device.

[0157] For example, according to an embodiment of the present disclosure, the computer-readable storage medium can include the above-described ROM 602 and / or RAM 603 and / or one or more memories other than ROM 602 and RAM 603.

[0158] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program includes program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the image recognition method provided by the embodiment of the present disclosure.

[0159] When the computer program is executed by the processor 601, the above functions defined in the system / apparatus of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the above-described system, apparatus, module, unit, etc. can be implemented by computer program modules.

[0160] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication section 609, and / or installed from the removable medium 611. The program code included in the computer program may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0161] According to embodiments of the present disclosure, the program code for executing the computer program provided by the embodiments of the present disclosure may be written in any combination of one or more programming languages. Specifically, these computing programs may be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include but are not limited to, for example, Java, C++, Python, the "C" language, or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., by connecting through the Internet using an Internet service provider).

[0162] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than that noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and combinations of blocks in the block diagram or flowchart, may be implemented by a dedicated hardware-based system that performs the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions. Those skilled in the art will appreciate that the features recited in the various embodiments and / or claims of the present disclosure may be combined and / or combined in various ways, even if such combinations or combinations are not explicitly recited in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features recited in the various embodiments and / or claims of the present disclosure may be combined and / or combined in various ways. All such combinations and / or combinations fall within the scope of the present disclosure.

[0163] The embodiments of the present disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments have been described separately above, this does not mean that the measures in the respective embodiments cannot be used advantageously in combination. The scope of the present disclosure is defined by the appended claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art can make various substitutions and modifications, and all such substitutions and modifications should fall within the scope of the present disclosure.

Claims

1. An image recognition method, comprising: In response to an image recognition request, obtaining first grayscale image data and a recognition type of a to-be-recognized image captured by an inspection device carried in the image recognition request; Performing binarization processing on the first grayscale image data to obtain second grayscale image data; Based on the recognition type, determining target image data based on initial image data of the to-be-recognized image and the second grayscale image data; And Inputting the target image data into an image recognition model corresponding to the recognition type, and outputting a recognition result of the to-be-recognized image; Wherein, the grayscale value of a pixel point in the second grayscale image data is a first grayscale value or a second grayscale value. When the recognition type is color recognition, the determining the target image data based on the initial image data of the to-be-recognized image and the second grayscale image data includes: placing the initial image data and the second grayscale image data into a preset reference system to determine position information of each pixel point in the initial image data and each pixel point in the second grayscale image data in the preset reference system; determining a position information set according to the position information of all pixel points with the grayscale value of the first grayscale value in the second grayscale image data; determining target pixel points from the initial image data according to the position information set; and modifying the values of all target pixel points in the initial image data to a preset value to obtain the target image data.

2. The method according to claim 1, wherein, The performing binarization processing on the first grayscale image data to obtain second grayscale image data includes: Obtaining integral image data of the first grayscale image data through integral operation; Successively for each first pixel point in the first grayscale image data, determining a local window corresponding to the first pixel point, where the local window further includes a plurality of second pixel points; Based on the grayscale values of the plurality of second pixel points in the first grayscale image data and the integral values of the plurality of second pixel points in the integral image data, determining a local threshold of the first pixel point; Based on a comparison result of the local threshold of the first pixel point and the grayscale value of the first pixel point, modifying the grayscale value of the first pixel point to the first grayscale value or the second grayscale value; and After completing the traversal of all first pixel points in the first grayscale image data, obtaining the second grayscale image data.

3. The method according to claim 2, wherein The based on a comparison result of the local threshold of the first pixel point and the grayscale value of the first pixel point, modifying the grayscale value of the first pixel point to the first grayscale value or the second grayscale value includes: When the local threshold of the first pixel point is greater than or equal to the grayscale value of the first pixel point, modifying the grayscale value of the first pixel point to the first grayscale value; and When the local threshold of the first pixel point is less than the grayscale value of the first pixel point, modifying the grayscale value of the first pixel point to the second grayscale value.

4. The method according to claim 1, wherein Inputting the target image data into an image recognition model corresponding to the recognition type, and outputting a recognition result of the image to be recognized, includes: In the case where the recognition type is color recognition, inputting the target image data into a color recognition model, and outputting the recognition result representing the color of the image to be recognized.

5. The method according to claim 1, further including: Performing smoothing filtering processing on the first grayscale image data to obtain third grayscale image data; And Performing binarization processing on the third grayscale image data to obtain the second grayscale image data.

6. An image recognition device, including: An acquisition module, configured to acquire first grayscale image data of an image to be recognized and a recognition type carried in the image recognition request in response to an image recognition request; A first processing module, configured to perform binarization processing on the first grayscale image data to obtain second grayscale image data; A determination module, configured to determine target image data based on the initial image data of the image to be recognized and the second grayscale image data according to the recognition type; And An input module, configured to input the target image data into an image recognition model corresponding to the recognition type, and output a recognition result of the image to be recognized; Wherein, the determination module includes a first determination subunit, a second determination subunit, a third determination subunit, and a first modification subunit. The grayscale value of a pixel point in the second grayscale image data is a first grayscale value or a second grayscale value. In the case where the recognition type is color recognition, the first determination subunit is configured to place the initial image data and the second grayscale image data into a preset reference system to determine the position information of each pixel point in the initial image data and each pixel point in the second grayscale image data in the preset reference system; the second determination subunit is configured to determine a position information set according to the position information of all pixel points with the grayscale value of the first grayscale value in the second grayscale image data; the third determination subunit is configured to determine target pixel points from the initial image data according to the position information set; and the first modification subunit is configured to modify the values of all target pixel points in the initial image data to a preset value to obtain the target image data.

7. An electronic device, including: One or more processors; A memory, configured to store one or more instructions, Wherein, when the one or more instructions are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, on which executable instructions are stored, and when the executable instructions are executed by a processor, the processor implements the method according to any one of claims 1 to 5.

9. A computer program product, the computer program product includes computer-executable instructions, and the computer-executable instructions are used to implement the method according to any one of claims 1 to 5 when being executed.

Citation Information

Patent Citations

  • Advertisement inspection method and device

    CN111383054A