CN114511694A - Image recognition method, image recognition device, electronic equipment and medium - Google Patents

Image recognition method, image recognition device, electronic equipment and medium Download PDF

Info

Publication number
CN114511694A
CN114511694A CN202210107793.1A CN202210107793A CN114511694A CN 114511694 A CN114511694 A CN 114511694A CN 202210107793 A CN202210107793 A CN 202210107793A CN 114511694 A CN114511694 A CN 114511694A
Authority
CN
China
Prior art keywords
detected
detection
area
image
box
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210107793.1A
Other languages
Chinese (zh)
Other versions
CN114511694B (en
Inventor
朱雄威
孙逸鹏
姚锟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210107793.1A priority Critical patent/CN114511694B/en
Publication of CN114511694A publication Critical patent/CN114511694A/en
Application granted granted Critical
Publication of CN114511694B publication Critical patent/CN114511694B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Image Analysis (AREA)
  • Character Discrimination (AREA)

Abstract

The present disclosure provides an image recognition method, an image recognition device, an electronic apparatus, and a medium, which relate to the technical field of artificial intelligence, in particular to the technical field of deep learning and computer vision, and can be applied to scenes such as optical character recognition. The implementation scheme is as follows: performing target detection on an image to be detected comprising an object to be detected, and acquiring a boundary detection frame and one or more area detection frames aiming at the object to be detected, wherein the boundary detection frame indicates the detected boundary of the object to be detected, and each area detection frame in the one or more area detection frames respectively surrounds a target area in the object to be detected; acquiring a minimum bounding box based on at least one region detection box in the one or more region detection boxes, wherein the minimum bounding box is a bounding box with the smallest area in a plurality of bounding boxes capable of bounding the at least one region detection box; determining the ratio of the area of the smallest enclosing frame to the area of the boundary detection frame; and in response to the ratio exceeding a threshold, determining that the object to be detected is incomplete.

Description

Image recognition method, image recognition device, electronic equipment and medium
Technical Field
The present disclosure relates to the field of artificial intelligence technologies, and in particular, to the field of deep learning and computer vision technologies, and may be applied to scenes such as Optical Character Recognition (OCR), and in particular, to an image Recognition method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
Background
Artificial intelligence is the subject of research that makes computers simulate some human mental processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), both at the hardware level and at the software level. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing, and the like; the artificial intelligence software technology mainly comprises a computer vision technology, a voice recognition technology, a natural language processing technology, machine learning/deep learning, a big data processing technology, a knowledge map technology and the like.
Image recognition is an image processing task in the field of artificial intelligence, refers to a technology for recognizing various targets and objects in different modes by processing, analyzing and understanding images by using a computer, and is a practical application of applying a deep learning algorithm.
The approaches described in this section are not necessarily approaches that have been previously conceived or pursued. Unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section. Similarly, unless otherwise indicated, the problems mentioned in this section should not be considered as having been acknowledged in any prior art.
Disclosure of Invention
The present disclosure provides an image recognition method, apparatus, electronic device, computer-readable storage medium, and computer program product.
According to an aspect of the present disclosure, there is provided an image recognition method. The method comprises the following steps: performing target detection on an image to be detected including an object to be detected, and acquiring a boundary detection frame and one or more area detection frames aiming at the object to be detected, wherein the boundary detection frame indicates the detected boundary of the object to be detected, and each area detection frame in the one or more area detection frames respectively surrounds a target area in the object to be detected; acquiring a minimum bounding box based on at least one region detection box in the one or more region detection boxes, wherein the minimum bounding box is a bounding box with the smallest area in a plurality of bounding boxes capable of bounding the at least one region detection box; determining the ratio of the area of the smallest enclosing frame to the area of the boundary detection frame; and determining that the object to be detected is incomplete in response to the ratio exceeding a threshold.
According to another aspect of the present disclosure, there is provided an image recognition apparatus. The device includes: the image detection device comprises a target detection unit, a detection unit and a detection unit, wherein the target detection unit is configured to perform target detection on an image to be detected comprising an object to be detected, acquire a boundary detection frame and one or more area detection frames aiming at the object to be detected, the boundary detection frame indicates the detected boundary of the object to be detected, and each area detection frame in the one or more area detection frames respectively surrounds a target area in the object to be detected; a minimum bounding box acquisition unit configured to acquire a minimum bounding box based on at least one of the one or more region detection boxes, the minimum bounding box being a bounding box having a smallest area among a plurality of bounding boxes capable of bounding the at least one region detection box; an area ratio determination unit configured to determine a ratio of an area of the smallest enclosure frame to an area of the boundary detection frame; and an integrity determination unit configured to determine that the object to be detected is incomplete in response to the ratio exceeding a threshold.
According to another aspect of the present disclosure, an electronic device is provided. The electronic device includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method according to the above.
According to another aspect of the present disclosure, there is also provided a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method according to the above.
According to another aspect of the present disclosure, there is also provided a computer program product comprising a computer program, wherein the computer program realizes the above-mentioned method when executed by a processor.
According to one or more embodiments of the present disclosure, whether an image to be recognized is complete can be efficiently and inexpensively determined.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments of the embodiments and, together with the description, serve to explain the exemplary implementations of the embodiments. The illustrated embodiments are for purposes of illustration only and do not limit the scope of the claims. Throughout the drawings, identical reference numbers designate similar, but not necessarily identical, elements.
FIG. 1 illustrates a schematic diagram of an exemplary system in which various methods described herein may be implemented, according to an embodiment of the present disclosure;
FIG. 2 shows a flow diagram of an image recognition method according to an embodiment of the present disclosure;
FIG. 3a illustrates a scene diagram in which an image recognition method according to an embodiment of the present disclosure may be implemented;
FIG. 3b illustrates a scene diagram in which an image recognition method according to an embodiment of the present disclosure may be implemented;
FIG. 4a illustrates a scene diagram in which an image recognition method according to an embodiment of the present disclosure may be implemented;
FIG. 4b illustrates a scene diagram in which an image recognition method according to an embodiment of the present disclosure may be implemented;
fig. 5 shows a block diagram of the structure of an image recognition apparatus according to an embodiment of the present disclosure;
fig. 6 shows a block diagram of the structure of an image recognition apparatus according to an embodiment of the present disclosure; and
FIG. 7 illustrates a block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, it will be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the present disclosure, unless otherwise specified, the use of the terms "first", "second", and the like to describe various elements is not intended to limit the positional relationship, the temporal relationship, or the importance relationship of the elements, and such terms are used only to distinguish one element from another. In some examples, a first element and a second element may refer to the same instance of the element, and in some cases, based on the context, they may also refer to different instances.
The terminology used in the description of the various described examples in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the elements may be one or more. Furthermore, the term "and/or" as used in this disclosure is intended to encompass any and all possible combinations of the listed items.
In the related art, when an image is recognized, for example, due to a shooting angle, illumination, and the like of the image, the image to be recognized may be incomplete, and in a subsequent recognition process of the incomplete image, a poor-quality, even wrong image recognition result may be obtained. For example, in some scenarios of Optical Character Recognition (OCR), structured recognition of a card-type image (e.g. a driver's license, a bank card, a form bill, etc.) is required, and if the card-type image to be recognized is incomplete (e.g. the card-type image is damaged, the card is not completely photographed when the card is photographed, etc.), an erroneous text recognition result may be caused, or text recognition may not be performed, which may affect user experience.
In the related technology, a neural network model specially used for judging the image integrity is trained, and the method adds an image integrity classification model on the basis of the original image recognition or text recognition neural network model, so that the efficiency is low, and the model training cost is increased.
Based on this, the present disclosure proposes an image recognition scheme. The minimum enclosing frame and the boundary detection frame in the image to be identified are obtained, and the ratio of the minimum enclosing frame to the boundary detection frame is compared with the threshold value, so that whether the image to be detected is complete or not is judged efficiently and at low cost.
Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
Fig. 1 illustrates a schematic diagram of an exemplary system 100 in which various methods and apparatus described herein may be implemented in accordance with embodiments of the present disclosure. Referring to fig. 1, the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. Client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.
In embodiments of the present disclosure, the server 120 may run one or more services or software applications that enable the image recognition method to be performed.
In some embodiments, the server 120 may also provide other services or software applications that may include non-virtual environments and virtual environments. In certain embodiments, these services may be provided as web-based services or cloud services, for example, provided to users of client devices 101, 102, 103, 104, 105, and/or 106 under a software as a service (SaaS) model.
In the configuration shown in fig. 1, server 120 may include one or more components that implement the functions performed by server 120. These components may include software components, hardware components, or a combination thereof, which may be executed by one or more processors. A user operating a client device 101, 102, 103, 104, 105, and/or 106 may, in turn, utilize one or more client applications to interact with the server 120 to take advantage of the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from system 100. Accordingly, fig. 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.
The user may use client devices 101, 102, 103, 104, 105, and/or 106 to obtain images to be detected and send the images to be detected to server 120. The client device may provide an interface that enables a user of the client device to interact with the client device. The client device may also output information to the user via the interface. Although fig. 1 depicts only six client devices, those skilled in the art will appreciate that any number of client devices may be supported by the present disclosure.
Client devices 101, 102, 103, 104, 105, and/or 106 may include various types of computer devices, such as portable handheld devices, general purpose computers (such as personal computers and laptops), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors or other sensing devices, and so forth. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux, or Linux-like operating systems (e.g., GOOGLE Chrome OS); or include various Mobile operating systems such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular telephones, smart phones, tablets, Personal Digital Assistants (PDAs), and the like. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. The gaming system may include a variety of handheld gaming devices, internet-enabled gaming devices, and the like. The client device is capable of executing a variety of different applications, such as various Internet-related applications, communication applications (e.g., email applications), Short Message Service (SMS) applications, and may use a variety of communication protocols.
Network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP/IP, SNA, IPX, etc. By way of example only, one or more networks 110 may be a Local Area Network (LAN), an ethernet-based network, a token ring, a Wide Area Network (WAN), the internet, a virtual network, a Virtual Private Network (VPN), an intranet, an extranet, a Public Switched Telephone Network (PSTN), an infrared network, a wireless network (e.g., bluetooth, WIFI), and/or any combination of these and/or other networks.
The server 120 may include one or more general purpose computers, special purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-end servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and/or combination. The server 120 may include one or more virtual machines running a virtual operating system, or other computing architecture involving virtualization (e.g., one or more flexible pools of logical storage that may be virtualized to maintain virtual storage for the server). In various embodiments, the server 120 may run one or more services or software applications that provide the functionality described below.
The computing units in server 120 may run one or more operating systems including any of the operating systems described above, as well as any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and/or middle tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, and the like.
In some implementations, the server 120 may include one or more applications, such as applications for services such as object detection and recognition, signal conversion, etc., based on data such as image, video, voice, text, digital signals, etc., to process task requests such as voice interactions, text classification, image recognition, or keypoint detection, etc., received from the client devices 101, 102, 103, 104, 105, and/or 106. The server can train the neural network model by using the training samples according to a specific deep learning task, can test each sub-network in the super-network module of the neural network model, and determines the structure and parameters of the neural network model for executing the deep learning task according to the test result of each sub-network. Various data can be used as training sample data of the deep learning task, such as image data, audio data, video data or text data. After the training of the neural network model is completed, the server 120 may also automatically search out an optimal model structure through a model search technique to perform a corresponding task.
In some embodiments, the server 120 may be a server of a distributed system, or a server incorporating a blockchain. The server 120 may also be a cloud server, or a smart cloud computing server or a smart cloud host with artificial intelligence technology. The cloud Server is a host product in a cloud computing service system, and is used for solving the defects of high management difficulty and weak service expansibility in the traditional physical host and Virtual Private Server (VPS) service.
The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The database 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The database 130 may be of different types. In certain embodiments, the database used by the server 120 may be, for example, a relational database. One or more of these databases may store, update, and retrieve data to and from the database in response to the command.
In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the application may be different types of databases, such as key-value stores, object stores, or regular stores supported by a file system.
The system 100 of fig. 1 may be configured and operated in various ways to enable application of the various methods and apparatus described in accordance with the present disclosure.
Fig. 2 shows a flow diagram of an image recognition method 200 according to an embodiment of the present disclosure.
As shown in fig. 2, the image recognition method 200 includes: step S210, performing target detection on an image to be detected including an object to be detected, and acquiring a boundary detection frame and one or more area detection frames aiming at the object to be detected, wherein the boundary detection frame indicates the detected boundary of the object to be detected, and each area detection frame in the one or more area detection frames respectively surrounds a target area in the object to be detected; step S220, acquiring a smallest surrounding frame based on at least one region detection frame in the one or more region detection frames, wherein the smallest surrounding frame is a surrounding frame with the smallest area in a plurality of surrounding frames which can surround the at least one region detection frame; step S230, determining the ratio of the area of the smallest enclosing frame to the area of the boundary detection frame; and step S240, responding to the ratio exceeding the threshold value, and determining that the object to be detected is incomplete.
By the method, the minimum bounding box and the boundary detection box in the image to be recognized are obtained, wherein the minimum bounding box is the box with the smallest area capable of bounding at least one region detection box, and the at least one region detection box bounds the target region. The threshold may be a fixed value, for example, the ratio of the area of the smallest bounding box to the area of the boundary detection box with the image intact. By comparing the ratio of the smallest surrounding frame to the boundary detection frame obtained by detection with the threshold, if the ratio exceeds the threshold, the area of the boundary detection frame obtained by detection is smaller than the area of the boundary detection frame under the condition that the image is complete, and therefore the image to be recognized can be determined to be incomplete. From this, can judge effectively whether waiting to examine the image complete, do not increase the cost when promoting recognition efficiency.
For images to be identified having different sizes and different target areas, a suitable threshold value may be selected. After a proper threshold value is selected, whether the images are complete or not can be judged rapidly in a large batch for a plurality of images to be identified with the same size and the same target area.
Illustratively, the border detection frame and the one or more region detection frames for the object to be detected may be obtained through a frame detection model based on, for example, an east (efficient and Accurate Scene text) algorithm.
According to some embodiments, in step S210, performing target detection on the image to be detected including the object to be detected, and acquiring the boundary detection frame and the one or more region detection frames for the object to be detected may include: and inputting the image to be detected into the text detection network model, and acquiring a boundary detection box and one or more area detection boxes output by the text detection network model. And each of the one or more region detection frames respectively surrounds a target text line in the object to be detected.
In the middle of OCR recognition of an image, for example, a text detection network model detects a target text line in the image, and can generate one or more region detection boxes surrounding the target text line. In addition, the text recognition network model can perform text recognition on the target text in the area detection box. The integrity of the image is judged by using the result output by the text detection network model (namely the intermediate result of the OCR recognition process, including the region detection frame), no additional cost is added in the existing OCR recognition process, a neural network model specially used for judging the integrity of the image does not need to be trained, and the overall efficiency of the OCR recognition process can be improved; this advantage is even more pronounced when OCR processing is performed on a large number of images.
Illustratively, the text detection network model may be a full volume network (FCN), a Region generation network (RPN), and the like. The text recognition network model may be a Recurrent Neural Networks (RNN). In using the text detection network model for detection, a boundary detection box and a region detection box may be obtained for determining the integrity of the image in the method 200.
Illustratively, the OCR recognition process may also employ an end-to-end recognition framework, i.e., integrating text detection and recognition functions using a Convolutional Recurrent Neural Network (CRNN), which may include Convolutional layers, cyclic layers, and transcription layers. From the intermediate results of the end-to-end recognition framework, the boundary detection box and the region detection box can also be obtained for judging the integrity of the image in the method 200.
According to some embodiments, the object to be detected may be the whole or part of the card, and the target area may be a user information text line in the card. For example, the card may be an identification card, driver's license, driving license, bank card, ticket with fixed format, and the like. Generally, the object to be detected of the card class has a fixed boundary size and a fixed format of text typesetting. The text line of the user information in the card can be a number, a name and the like in an identity card or a driving license. For an object to be detected in the card class, target areas (target text lines) of the object are usually preset areas, and under the condition that a card image is complete, the ratio between a minimum bounding box surrounding the areas and a boundary detection box of the card is usually fixed or only has slight deviation; however, in the case where the card image is incomplete, the ratio between the minimum bounding box enclosing these regions and the boundary detection box of the card may exceed the normal value. Therefore, the method 200 can be used to simply and efficiently determine whether the card is complete.
It should be noted that the card and the user information in the card in the present embodiment are from the public data set.
According to some embodiments, the minimum bounding box may surround each of the one or more region detection boxes. In some cases, there may be occlusion or reflection in a certain text line in the image to be recognized, and therefore, the corresponding region detection box may not be successfully recognized for the text line in which occlusion or reflection exists. Therefore, by surrounding each of the one or more region detection frames with the minimum bounding box, even if the corresponding region detection frame is not identified for a certain text line, the accuracy of the obtained minimum bounding box can be ensured to the greatest extent, so that whether the image is complete or not can be judged more accurately.
According to some embodiments, the one or more region detection boxes may be rectangular in shape, and the minimum bounding box may be a rectangular minimum bounding box. In general, the acquired detection frame for the target area (e.g., text line) is a rectangular frame. The area detection frame is surrounded by the rectangular minimum surrounding frame, so that the coordinates of the diagonal vertex of the area detection frame to be surrounded can be determined, the area of the rectangular minimum surrounding frame can be determined simply and quickly, and the efficiency is improved.
According to some embodiments, the method 200 may further comprise: and sending prompt information in response to the fact that the object to be detected is determined to be incomplete. When the fact that the object to be detected in the image is incomplete is determined, the user can be prompted to adjust the image to be detected by sending prompt information in time, for example, the image to be detected is shot again, so that the shot image comprises the complete object to be detected, and therefore the accuracy of the subsequent recognition result of the image content is ensured. For example, when the card in the image to be recognized is incomplete, the text content obtained by text recognition of the card may have a great difference from the real content, and the user is prompted to shoot the card again in time, so that the content of text recognition can be ensured to be more accurate.
Hereinafter, the image recognition method according to the embodiment of the present disclosure will be further described in conjunction with an OCR application scenario.
Fig. 3a and 3b illustrate scene diagrams in which an image recognition method according to an embodiment of the present disclosure may be implemented. Fig. 3a exemplarily shows an image including a complete card, and fig. 3b exemplarily shows an image including an incomplete card. The actual boundaries of the card are included in fig. 3a and 3 b. Information such as name, number, date, and the like (all shown in the form of "XX") is recorded in the card, and in the card image, the area in which this part of information is recorded is the target area.
First, target detection may be performed on an image to be detected including a card, and a boundary detection frame 310 and a plurality of region detection frames 320-1, 320-2, 320-3 for the card may be acquired. Therein, the boundary detection box 310 indicates the boundary 330 of the detected card. And wherein each of the plurality of region detection boxes 320-1, 320-2, 320-3 encompasses a respective target region in the card.
Further, the minimum bounding box 340 (the dashed box outside the region detection box 320-2 in the figure) may be obtained based on at least one region detection box 320-2 of the plurality of region detection boxes, wherein the minimum bounding box 340 is the bounding box with the smallest area among the plurality of bounding boxes capable of bounding the region detection box 320-2.
Further, the ratio of the area of the smallest bounding box 340 to the area of the boundary detection box 310 may be determined (e.g., 0.1 for the case shown in FIG. 3 a; 0.15 for the case shown in FIG. 3 b).
Further, the jam shown in fig. 3b may be determined to be incomplete in response to the determination in fig. 3b that the resulting ratio 0.15 exceeds a threshold (e.g., 0.11).
Fig. 4a and 4b illustrate scene diagrams in which an image recognition method according to an embodiment of the present disclosure may be implemented. Fig. 4a exemplarily shows an image including a complete card, and fig. 4b exemplarily shows an image including an incomplete card. Fig. 4a and 4b include the true boundaries of the card. Information such as name, number, date, and the like (all shown in the form of "XX") is recorded in the card, and in the card image, the area in which this part of information is recorded is the target area.
First, target detection may be performed on an image to be detected including a card, and a boundary detection frame 410 and a plurality of area detection frames 420-1, 420-3 for the card may be acquired. Therein, the boundary detection box 410 indicates the boundary 430 of the detected card. And wherein each of the plurality of region detection boxes 420-1, 420-3 respectively surrounds a target region in the card.
It is noted that in the examples shown in fig. 4a and 4b, for example, due to the card image being occluded (e.g., smeared), the target area corresponding to the "number" field in the card image is not identified with the corresponding area detection box; and only the target regions corresponding to the unoccluded "name" and "date" fields are identified as corresponding region detection boxes 420-1 and 420-3.
For this case, each of the plurality of region detection boxes (region detection boxes 420-1 and 420-3) is enclosed by the minimum enclosing box 440. Even if the corresponding area detection frame is not identified aiming at the text line of the number field, the accuracy of the obtained minimum bounding box can be ensured, so that whether the image is complete or not can be judged more accurately.
It is understood that there is a certain distance between the detection frame shown by the dotted line in fig. 3a, 3b, 4a, 4b and the card boundary shown by the solid line; and there is also a distance between the detection box shown by the dashed line and the smallest bounding box shown by the dashed line. This is intended only to clearly express the illustration that, in an actual scenario, the detection box shown in dashed lines and the ka-shou border shown in solid lines may at least partially overlap; and the detection box shown in dashed lines may also at least partially overlap with the smallest bounding box shown in dashed lines, depending on the applied box detection algorithm.
Fig. 5 shows a block diagram of an image recognition apparatus 500 according to an embodiment of the present disclosure.
As shown in fig. 5, the image recognition apparatus 500 includes: a target detection unit 510, where the target detection unit 510 is configured to perform target detection on an image to be detected including an object to be detected, and acquire a boundary detection frame and one or more region detection frames for the object to be detected, where the boundary detection frame indicates a detected boundary of the object to be detected, and each of the one or more region detection frames respectively surrounds a target region in the object to be detected; a minimum bounding box obtaining unit 520, where the minimum bounding box obtaining unit 520 is configured to obtain a minimum bounding box based on at least one region detection box of the one or more region detection boxes, where the minimum bounding box is a bounding box with a smallest area among a plurality of bounding boxes that can surround the at least one region detection box; an area ratio determination unit 530, the area ratio determination unit 530 configured to determine a ratio of an area of the smallest bounding box to an area of the boundary detection box; and an integrity determination unit 540, the integrity determination unit 540 being configured to determine that the object to be detected is incomplete in response to the ratio exceeding a threshold.
According to some embodiments, the object detection unit 510 may be further configured to: inputting an image to be detected into a text detection network model, and acquiring a boundary detection box and one or more area detection boxes output by the text detection network model; and wherein each of the one or more region detection boxes respectively encloses a target text line in the object to be detected.
According to some embodiments, the minimum bounding box may surround each of the one or more region detection boxes.
According to some embodiments, the one or more region detection boxes may be rectangular in shape, and the minimum bounding box may be a rectangular minimum bounding box.
Fig. 6 shows a block diagram of the structure of an image recognition apparatus 600 according to an embodiment of the present disclosure.
As shown in fig. 6, the image recognition apparatus 600 includes an object detection unit 610 to an integrity determination unit 640, and the object detection unit 610 to the integrity determination unit 640 are similar to the object detection unit 510 to the integrity determination unit 540 of the image recognition apparatus 500 described above with respect to fig. 5, and are not described again here. The image recognition apparatus 600 may further include a prompt unit 650, the prompt unit 650 being configured to issue a prompt message in response to determining that the object to be detected is incomplete.
According to some embodiments, the object to be detected may be the whole or part of a card, and the target area is a user information text line in the card.
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure and other processing of the personal information of the related user are all in accordance with the regulations of related laws and regulations and do not violate the good customs of the public order.
The present disclosure also provides an electronic device, comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform any one of the methods described above.
The present disclosure also provides a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform any one of the methods described above.
The present disclosure also provides a computer program product comprising a computer program, wherein the computer program realizes any of the methods described above when executed by a processor.
Referring to fig. 7, a block diagram of a structure of an electronic device 700, which may be a server or a client of the present disclosure, which is an example of a hardware device that may be applied to aspects of the present disclosure, will now be described. Electronic device is intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 7, the device 700 comprises a computing unit 701, which may perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM)702 or a computer program loaded from a storage unit 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Various components in the device 700 are connected to the I/O interface 705, including: an input unit 706, an output unit 707, a storage unit 708, and a communication unit 709. The input unit 706 may be any type of device capable of inputting information to the device 700, and the input unit 706 may receive input numeric or character information and generate key signal inputs related to user settings and/or function controls of the electronic device, and may include, but is not limited to, a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystickA microphone and/or a remote control. Output unit 707 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, a video/audio output terminal, a vibrator, and/or a printer. Storage unit 708 may include, but is not limited to, magnetic or optical disks. The communication unit 709 allows the device 700 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks, and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver, and/or a chipset, such as bluetoothTMDevices, 802.11 devices, WiFi devices, WiMax devices, cellular communication devices, and/or the like.
Computing unit 701 may be a variety of general purpose and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 701 performs the various methods and processes described above, such as the method 200. For example, in some embodiments, the method 200 may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 708. In some embodiments, part or all of a computer program may be loaded onto and/or installed onto device 700 via ROM 702 and/or communications unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the method 200 described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the method 200 by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user may provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be performed in parallel, sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
Although embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it is to be understood that the above-described methods, systems and apparatus are merely exemplary embodiments or examples and that the scope of the present invention is not limited by these embodiments or examples, but only by the claims as issued and their equivalents. Various elements in the embodiments or examples may be omitted or may be replaced with equivalents thereof. Further, the steps may be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples may be combined in various ways. It is important that as technology evolves, many of the elements described herein may be replaced with equivalent elements that appear after the present disclosure.

Claims (15)

1. An image recognition method, comprising:
performing target detection on an image to be detected including an object to be detected, and acquiring a boundary detection frame and one or more area detection frames for the object to be detected, wherein the boundary detection frame indicates the detected boundary of the object to be detected, and each area detection frame in the one or more area detection frames respectively surrounds a target area in the object to be detected;
acquiring a smallest bounding box based on at least one of the one or more region detection boxes, wherein the smallest bounding box is a bounding box with the smallest area in a plurality of bounding boxes capable of bounding the at least one region detection box;
determining the ratio of the area of the smallest enclosing frame to the area of the boundary detection frame; and
and determining that the object to be detected is incomplete in response to the ratio exceeding a threshold.
2. The method of claim 1, wherein performing target detection on an image to be detected including an object to be detected, and acquiring a boundary detection box and one or more region detection boxes for the object to be detected comprises:
inputting the image to be detected into a text detection network model, and acquiring a boundary detection box and one or more area detection boxes output by the text detection network model; and is
Each of the one or more region detection frames surrounds a target text line in the object to be detected.
3. The method of claim 1, wherein the smallest enclosure box surrounds each of the one or more area detection boxes.
4. The method of claim 1, wherein the one or more area detection boxes are rectangular in shape, and wherein the smallest bounding box is a rectangular smallest bounding box.
5. The method of any of claims 1 to 4, further comprising:
and sending prompt information in response to the fact that the object to be detected is determined to be incomplete.
6. The method according to any one of claims 1 to 4, wherein the object to be detected is the whole or part of a card, and wherein the target area is a line of user information text in the card.
7. An image recognition apparatus comprising:
a target detection unit configured to perform target detection on an image to be detected including an object to be detected, and acquire a boundary detection frame and one or more region detection frames for the object to be detected, wherein the boundary detection frame indicates a detected boundary of the object to be detected, and each of the one or more region detection frames respectively surrounds a target region in the object to be detected;
a minimum bounding box obtaining unit configured to obtain a minimum bounding box based on at least one of the one or more region detection boxes, wherein the minimum bounding box is a bounding box with a smallest area among a plurality of bounding boxes capable of bounding the at least one region detection box;
an area ratio determination unit configured to determine a ratio of an area of the smallest enclosure frame to an area of the boundary detection frame; and
an integrity determination unit configured to determine that the object to be detected is incomplete in response to the ratio exceeding a threshold.
8. The apparatus of claim 7, wherein the target detection unit is further configured to:
inputting the image to be detected into a text detection network model, and acquiring a boundary detection box and one or more area detection boxes output by the text detection network model; and is
Each of the one or more region detection frames surrounds a target text line in the object to be detected.
9. The apparatus of claim 7, wherein the smallest enclosure frame surrounds each of the one or more area detection frames.
10. The apparatus of claim 7, wherein the one or more region detection boxes are rectangular in shape, and wherein the smallest bounding box is a rectangular smallest bounding box.
11. The apparatus of any of claims 7 to 10, further comprising:
a prompt unit configured to issue prompt information in response to determining that the object to be detected is incomplete.
12. The apparatus according to any one of claims 7 to 10, wherein the object to be detected is the whole or part of a card, and wherein the target area is a line of user information text in the card.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
14. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-6.
15. A computer program product comprising a computer program, wherein the computer program realizes the method of any one of claims 1-6 when executed by a processor.
CN202210107793.1A 2022-01-28 2022-01-28 Image recognition method, device, electronic equipment and medium Active CN114511694B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210107793.1A CN114511694B (en) 2022-01-28 2022-01-28 Image recognition method, device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210107793.1A CN114511694B (en) 2022-01-28 2022-01-28 Image recognition method, device, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN114511694A true CN114511694A (en) 2022-05-17
CN114511694B CN114511694B (en) 2023-05-12

Family

ID=81552169

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210107793.1A Active CN114511694B (en) 2022-01-28 2022-01-28 Image recognition method, device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN114511694B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106251338A (en) * 2016-07-20 2016-12-21 北京旷视科技有限公司 Target integrity detection method and device
CN107330433A (en) * 2017-05-17 2017-11-07 北京捷通华声科技股份有限公司 Image processing method and device
US20180005035A1 (en) * 2016-05-19 2018-01-04 Simbe Robotics, Inc. Method for automatically generating planograms of shelving structures within a store
CN108881775A (en) * 2018-05-30 2018-11-23 维沃移动通信有限公司 A kind of video communication method and mobile terminal
WO2019184604A1 (en) * 2018-03-27 2019-10-03 华为技术有限公司 Method and device for detecting target image
CN112489020A (en) * 2020-12-01 2021-03-12 济南博观智能科技有限公司 Image screening method and device, electronic equipment and storage medium
CN113256583A (en) * 2021-05-24 2021-08-13 北京百度网讯科技有限公司 Image quality detection method and apparatus, computer device, and medium
CN113313111A (en) * 2021-05-28 2021-08-27 北京百度网讯科技有限公司 Text recognition method, device, equipment and medium
CN113673500A (en) * 2021-08-20 2021-11-19 深圳前海微众银行股份有限公司 Certificate image recognition method and device, electronic equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180005035A1 (en) * 2016-05-19 2018-01-04 Simbe Robotics, Inc. Method for automatically generating planograms of shelving structures within a store
CN106251338A (en) * 2016-07-20 2016-12-21 北京旷视科技有限公司 Target integrity detection method and device
CN107330433A (en) * 2017-05-17 2017-11-07 北京捷通华声科技股份有限公司 Image processing method and device
WO2019184604A1 (en) * 2018-03-27 2019-10-03 华为技术有限公司 Method and device for detecting target image
CN108881775A (en) * 2018-05-30 2018-11-23 维沃移动通信有限公司 A kind of video communication method and mobile terminal
CN112489020A (en) * 2020-12-01 2021-03-12 济南博观智能科技有限公司 Image screening method and device, electronic equipment and storage medium
CN113256583A (en) * 2021-05-24 2021-08-13 北京百度网讯科技有限公司 Image quality detection method and apparatus, computer device, and medium
CN113313111A (en) * 2021-05-28 2021-08-27 北京百度网讯科技有限公司 Text recognition method, device, equipment and medium
CN113673500A (en) * 2021-08-20 2021-11-19 深圳前海微众银行股份有限公司 Certificate image recognition method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114511694B (en) 2023-05-12

Similar Documents

Publication Publication Date Title
CN113256583A (en) Image quality detection method and apparatus, computer device, and medium
EP3869404A2 (en) Vehicle loss assessment method executed by mobile terminal, device, mobile terminal and medium
CN115422389B (en) Method and device for processing text image and training method of neural network
CN114743196B (en) Text recognition method and device and neural network training method
CN114494935B (en) Video information processing method and device, electronic equipment and medium
CN114495103B (en) Text recognition method and device, electronic equipment and medium
CN114140852B (en) Image detection method and device
CN115511779A (en) Image detection method, device, electronic equipment and storage medium
CN114547252A (en) Text recognition method and device, electronic equipment and medium
US12079268B2 (en) Object recommendation
CN115797660A (en) Image detection method, image detection device, electronic equipment and storage medium
CN113596011B (en) Flow identification method and device, computing device and medium
CN114842476A (en) Watermark detection method and device and model training method and device
CN114511694B (en) Image recognition method, device, electronic equipment and medium
CN114429678A (en) Model training method and device, electronic device and medium
CN114494797A (en) Method and apparatus for training image detection model
CN114219046A (en) Model training method, matching method, device, system, electronic device and medium
CN114140547A (en) Image generation method and device
CN114677691B (en) Text recognition method, device, electronic equipment and storage medium
CN115512131B (en) Image detection method and training method of image detection model
CN116311271B (en) Text image processing method and device
CN114842297A (en) Image processing method, model training method, device, equipment and medium
CN114140851A (en) Image detection method and method for training image detection model
CN114758114A (en) Model updating method, image processing method, device, electronic device and medium
CN115100431A (en) Target detection method, neural network, and training method, device, and medium thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant