Card Recognition Method and Device
By contour recognition of the preview image of the card, determining whether it is a card, and obtaining the identification content of the card, the problems of waste of resources and inaccurate identification in the prior art are solved, and efficient and accurate card recognition is achieved.
Patent Information
- Application Number
- CN202011049710.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-29
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2040-12-04
AI Technical Summary
When processing a card, the prior art usually directly acquires an image including the card and then processes the image, which can easily lead to shooting when the target object is not a card, resulting in wasting resources, and it is difficult to accurately identify the card.
In response to the preview image of the target object, the preview image is processed using the contour recognition algorithm to obtain the outline of the target object, and then determine whether it is a card based on the outline of the target object. If it is determined to be a card, the target image including the card is obtained and the identification content of the card in the target image is obtained.
It realizes accurate identification and judgment of target objects in the preview image, avoids shooting of non-card target objects, saves resources, and improves the accuracy of card recognition.
Smart Images

Figure CN114359570B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of computer technology, and particularly to a method and device for card recognition. Background Art
[0002] In daily life, cards are used more and more frequently and come in a greater variety of types. When processing a card, usually an image including the card is directly acquired, and then the image is processed. Summary of the Invention
[0003] Embodiments of the present application provide a method and device for card recognition.
[0004] In a first aspect, embodiments of the present application provide a method for card recognition. The method includes: in response to acquiring a preview image of a target object, processing the preview image using a contour recognition algorithm to obtain the contour of the target object; based on the contour of the target object, determining whether the target object is a card; in response to determining that the target object is a card, acquiring a target image including the card, and acquiring the recognition content of the card in the target image.
[0005] In some embodiments, based on the contour of the target object, determining whether the target object is a card includes: based on the contour of the target object and a preset card contour recognition model, determining whether the target object is a card, where the preset card contour recognition model is a model obtained by training an initial neural network based on a card contour sample set.
[0006] In some embodiments, based on the contour of the target object, determining whether the target object is a card includes: acquiring a preset card contour table, where the preset card contour table includes the card contours of at least one type of card; based on the contour of the target object, searching in the preset card contour table to determine whether the target object is a card.
[0007] In some embodiments, processing the preview image using a contour recognition algorithm to obtain the contour of the target object includes: processing the preview image using a contour recognition algorithm to obtain the contour of the target object and the contour coordinates of the target object; and acquiring the recognition content of the card in the target image includes: based on the contour coordinates of the target object, acquiring a card image including the card content; sending the card image to a server so that the server recognizes the card content in the card image to obtain the recognition content; receiving the recognition content corresponding to the card content sent by the server.
[0008] In some embodiments, based on the contour coordinates of the target object, acquiring a card image including the card content includes: based on the contour coordinates of the target object, acquiring the card coordinates of the card in the target image; based on the card coordinates, cropping the target image to acquire a card image including the card content.
[0009] In some embodiments, the method further includes: receiving an audio-video link corresponding to the recognized content sent by the server, and playing the audio-video file corresponding to the audio-video link.
[0010] In some embodiments, the method further includes: in response to playing the audio-video file corresponding to the audio-video link, acquiring a user recording, and sending the user recording to the server, so that the server determines a score corresponding to the user recording according to the original sound of the audio-video file and the user recording; receiving and presenting the score corresponding to the user recording sent by the server.
[0011] In a second aspect, an embodiment of the present application provides a card recognition device, which includes: a processing unit configured to process a preview image of a target object using a contour recognition algorithm in response to collecting the preview image of the target object, to obtain the contour of the target object; a judgment unit configured to judge whether the target object is a card based on the contour of the target object; an acquisition unit configured to acquire a target image including the card and acquire the recognized content of the card in the target image in response to determining that the target object is a card.
[0012] In some embodiments, the judgment unit is further configured to: judge whether the target object is a card based on the contour of the target object and a preset card contour recognition model, where the preset card contour recognition model is a model obtained by training an initial neural network based on a card contour sample set.
[0013] In some embodiments, the judgment unit includes: a first acquisition module configured to acquire a preset card contour table, where the preset card contour table includes card contours of at least one type of card; a judgment module configured to search in the preset card contour table based on the contour of the target object to judge whether the target object is a card.
[0014] In some embodiments, the processing unit is further configured to: process the preview image using a contour recognition algorithm to obtain the contour of the target object and the contour coordinates of the target object; and the acquisition unit includes: a second acquisition module configured to acquire a card image including card content based on the contour coordinates of the target object; a sending module configured to send the card image to the server so that the server recognizes the card content in the card image to obtain the recognized content; a receiving module configured to receive the recognized content corresponding to the card content sent by the server.
[0015] In some embodiments, the second acquisition module is further configured to: acquire the card coordinates of the card in the target image based on the contour coordinates of the target object; and crop the target image based on the card coordinates to acquire a card image including card content.
[0016] In some embodiments, the receiving module is further configured to: receive the audio-video link corresponding to the recognized content sent by the server, and play the audio-video file corresponding to the audio-video link.
[0017] In some embodiments, the apparatus further includes: a recording unit configured to, in response to playing the audio-video file corresponding to the audio-video link, obtain the user's recording and send the user's recording to the server so that the server determines the score corresponding to the user's recording based on the original sound of the audio-video file and the user's recording; a presenting unit configured to receive and present the score corresponding to the user's recording sent by the server.
[0018] In a third aspect, an embodiment of the present application provides an electronic device, which includes: one or more processors; a storage device storing one or more programs thereon; when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method described in any implementation manner in the first aspect.
[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, and when the program is executed by a processor, the method described in any implementation manner in the first aspect is implemented.
[0020] The card recognition method and apparatus provided in the embodiments of the present application, by responding to the acquisition of the preview image of the target object, using the contour recognition algorithm to process the preview image to obtain the contour of the target object, then based on the contour of the target object, determining whether the target object is a card, and finally if it is determined that the target object is a card, obtaining the target image including the card and the recognition content of the card in the target image. Thus, the contour recognition using the preview image is realized, the situation of taking pictures when the target object is not a card can be avoided, the shooting resources can be saved, the target object in the preview image can be recognized and judged, if the target object is a card, the card image and the recognition content are obtained, the accuracy of determining whether the target object is a card is improved, and the accuracy of recognizing the card is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] By reading the detailed description of the non-limiting embodiments with reference to the following drawings, other features, objects, and advantages of the present application will become more apparent:
[0022] Figure 1 is an exemplary system architecture diagram to which an embodiment of the present application can be applied;
[0023] Figure 2 is a flowchart of an embodiment of the card recognition method according to the present application;
[0024] Figure 3It is a schematic diagram of an application scenario of the card recognition method according to the present application;
[0025] Figure 4 It is a flowchart for obtaining the recognition content of the card in the target image according to the present application;
[0026] Figure 5 It is a flowchart of another embodiment of the card recognition method according to the present application;
[0027] Figure 6 It is a schematic structural diagram of an embodiment of the card recognition device according to the present application;
[0028] Figure 7 It is a schematic structural diagram of an electronic device suitable for implementing the embodiments of the present application. Detailed implementation manners
[0029] The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present disclosure, rather than limiting the present disclosure. Additionally, it should be noted that for the sake of description, only parts related to the present disclosure are shown in the drawings.
[0030] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the drawings and embodiments.
[0031] Figure 1 An exemplary system architecture 100 to which the card recognition method or the card recognition device of the present application can be applied is shown.
[0032] As Figure 1 shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0033] The terminal devices 101, 102, 103 interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the terminal devices 101, 102, 103, such as camera applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, text editing applications, video live streaming applications, etc.
[0034] The terminal devices 101, 102, and 103 can be hardware or software. When the terminal devices 101, 102, and 103 are hardware, they can be various electronic devices with a display screen and supporting audio and video transmission, including but not limited to smartphones, tablet computers, laptop computers, desktop computers, and so on. When the terminal devices 101, 102, and 103 are software, they can be installed in the above-listed electronic devices. They can be implemented as multiple software or software modules (such as software or software modules for providing distributed services), or can be implemented as a single software or software module. No specific limitation is made here.
[0035] The terminal devices 101, 102, and 103 can be electronic devices with a camera function, which can collect a preview image of a target object, process the preview image through a contour recognition algorithm to obtain the contour of the target object, and then determine whether the target object is a card based on the contour of the target object. If it is determined that the target object is a card, a card image is taken. At this time, the taken card image has the same picture as the collected preview image but different resource sizes, and the card image is sent to the server 105 to obtain the recognition content of the card.
[0036] The server 105 can be a server that provides various services, such as a server that supports the various functions of the terminal devices 101, 102, and 103, a cloud server, etc. The server 105 can process the received data and feedback the processing result to the terminal devices 102 and 103.
[0037] The server 105 can be a background server that supports the shooting applications on the terminal devices 101, 102, and 103. The server 105 can perform OCR recognition on the received card image and send the recognition content of the card to the terminal devices 101, 102, and 103. The server 105 can also search according to the recognition content of the card, obtain the audio and video link corresponding to the recognition content of the card, and send the obtained audio and video link to the terminal devices 101, 102, and 103. The server 105 can also receive user recordings, then score the user recordings according to the content corresponding to the audio and video link and the user recordings, and send the score to the terminal devices 101, 102, and 103.
[0038] It should be noted that the server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster composed of multiple servers or as a single server. When the server is software, it can be implemented as multiple software or software modules (such as software or software modules for providing distributed services), or can be implemented as a single software or software module. No specific limitation is made here.
[0039] It should be noted that the card recognition method provided by the embodiments of the present application is generally executed by the terminal devices 101, 102, and 103. Correspondingly, the card recognition device is generally disposed in the terminal devices 101, 102, and 103. It should be understood that Figure 1 the numbers of the terminal devices, networks, and servers in
[0040] Continue to refer to Figure 2 which shows a flowchart 200 of an embodiment of the card recognition method according to the present application. The card recognition method includes the following steps:
[0041] Step 210, in response to collecting a preview image of a target object, use a contour recognition algorithm to process the preview image to obtain the contour of the target object.
[0042] In this embodiment, the execution subject of the card recognition method (such as Figure 1 the terminal devices 101, 102, and 103 shown) can collect the target object through a camera to obtain a preview image of the target object, and the preview image may include the target object and other contents. Then the above execution subject invokes the contour recognition algorithm to process the preview image and detect the contour of the target object in the preview image to obtain the contour of the target object.
[0043] Step 220, based on the contour of the target object, determine whether the target object is a card.
[0044] In this embodiment, after the above execution subject obtains the contour of the target object, it can judge the target object according to the contour to determine whether the target object is a card.
[0045] As an optional implementation manner, the above execution subject may determine whether the target object is a card based on the contour of the target object and a preset card contour recognition model.
[0046] Wherein, the preset card contour recognition model is used to determine whether the object corresponding to the current contour is a card, and the card contour recognition model is a model obtained by training an initial neural network based on a card contour sample set, and the card contour sample set includes a large number of sample cards and the contours corresponding to the sample cards.
[0047] Specifically, after the above execution subject obtains the contour of the target object, it inputs the contour into the card contour recognition model, and the card contour recognition model performs recognition processing on the contour to determine whether the target object corresponding to the contour is a card. For example, if the output of the card contour recognition model is empty, it is determined that the target object corresponding to the contour is not a card. If the output of the card contour recognition model is not empty, it is determined that the target object corresponding to the contour is a card.
[0048] In this implementation manner, by using the card contour recognition model, the obtained contour can be accurately and quickly recognized to determine whether the target object corresponding to the contour is a card, improving the accuracy of card identification.
[0049] As an alternative implementation manner, the above-mentioned execution entity can also determine whether the target object is a card based on the following steps: obtain a preset card contour table; search in the preset card contour table based on the contour of the target object to determine whether the target object is a card.
[0050] Specifically, after the above-mentioned execution entity obtains the contour of the target object, it performs contour comparison in the preset card contour table according to the contour. The preset card contour table includes the card contours of at least one type of card. The above-mentioned execution entity can determine whether there is a card contour in the preset card contour table that is the same as or has a high similarity to the contour by comparing the contour with each card contour in the preset card contour table. If there is a card contour in the preset card contour table that is the same as or has a high similarity to the contour, it is determined that the target object corresponding to the contour is a card. If there is no card contour in the preset card contour table that is the same as or has a high similarity to the contour, it is determined that the target object corresponding to the contour is not a card.
[0051] In this implementation manner, by searching in the card contour table according to the contour of the target object to determine whether there is the contour of the target object in the card contour table, it is realized to determine whether the target object corresponding to the contour is a card, simplifying the judgment steps and improving the efficiency of card identification.
[0052] Step 230, in response to determining that the target object is a card, obtain a target image including the card and obtain the recognition content of the card in the target image.
[0053] In this embodiment, after the above-mentioned execution entity determines that the target object is a card through the contour of the target object, it obtains the target image corresponding to the card through the camera. Among them, the target image has the same picture as the captured preview image, and the proportion of each content in the image is the same. And there is a certain proportional relationship between the target image and the captured preview image, but the sizes of the target image and the preview image are different, and the resource sizes occupied are different. The above-mentioned execution entity can recognize the card in the target image according to the target image to obtain the recognition content corresponding to the card; or, the above-mentioned execution entity can also send the target image to the server, and the server recognizes the target image to obtain the recognition content of the card, and the server sends the recognition content of the card to the above-mentioned execution entity.
[0054] Continue to refer to Figure 3 , Figure 3 is a schematic diagram of an application scenario of the card recognition method according to an embodiment of the present application. InFigure 3 In the application scenario, the terminal 301 captures a preview image of the target object 302 through the camera, processes the captured preview image locally using a contour recognition algorithm to obtain the contour of the target object 302. Then, based on the contour of the target object, the terminal 301 determines whether the target object 302 is a card. When it is determined that the target object 302 is a card, the terminal captures a target image including the card through the camera and sends the target image to the server 303. The server 303 recognizes the target image to obtain the recognition content "Happy New Year" of the card in the target image and sends the recognition content "Happy New Year" to the terminal 301. The terminal 301 can display the recognition content "Happy New Year" of the card in the obtained target image on the screen.
[0055] Currently, one of the existing technologies usually directly obtains a card image, recognizes the card image, and obtains the recognition content of the card, which is likely to cause problems such as the obtained image not necessarily being a card image or the obtained card image being inaccurate. However, the method provided in the above embodiment of the present application, by responding to the capture of the preview image of the target object, processes the preview image using a contour recognition algorithm to obtain the contour of the target object, and then based on the contour of the target object, determines whether the target object is a card. Finally, if it is determined that the target object is a card, a target image including the card is obtained, and the recognition content of the card in the target image is obtained. Thus, contour recognition is realized using the preview image, which can avoid the situation of taking pictures when the target object is not a card, can save shooting resources, can recognize and judge the target object in the preview image. If the target object is a card, the card image and the recognition content are obtained, improving the accuracy of determining whether the target object is a card and the accuracy of recognizing the card.
[0056] In some optional implementation manners of this embodiment, the above execution entity can also process the preview image using a contour recognition algorithm to obtain the contour of the target object and the contour coordinates of the target object. And, Figure 2 The step of obtaining the recognition content of the card in the target image shown in step 230 can be further executed according to Figure 4 the process 400 shown.
[0057] Specifically, Figure 4 the process shown includes:
[0058] Step 410, based on the contour coordinates of the target object, obtain a card image including the card content.
[0059] In this step, the above-mentioned execution entity can determine that the target object is a card. After obtaining the contour and contour coordinates of the target object in the preview image, the position of the card in the target image can be determined according to the contour coordinates. Then, the above-mentioned execution entity can determine the card content included in the card according to the position of the card in the target object, and can crop or extract the card image including the card content according to the card content.
[0060] As an optional implementation manner, the above-mentioned execution entity can obtain the card image including the card content based on the following steps:
[0061] First step, based on the contour coordinates of the target object, obtain the card coordinates of the card in the target image.
[0062] In this step, after the above-mentioned execution entity obtains the target image, it determines the proportional relationship between the target image and the preview image. Then, after the above-mentioned execution entity obtains the contour coordinates of the target image in the preview image, according to the proportional relationship between the target image and the preview image, it determines the coordinates corresponding to the contour coordinates in the target image, and uses this coordinate as the card coordinates of the card in the target image. For example, the above-mentioned execution entity can map the contour coordinates to the target image through a mapping relationship to obtain the card coordinates of the card in the target image.
[0063] Second step, based on the card coordinates, crop the target image to obtain the card image including the card content.
[0064] In this step, after the above-mentioned execution entity obtains the card coordinates of the card, it crops the target image according to the card coordinates, crops out the partial image including the card content, and then obtains the card image including the card content.
[0065] In this implementation manner, the card coordinates in the target image are determined through the contour coordinates in the preview image, so that the card coordinates in the target image correspond to the card content, ensuring the accuracy of the card coordinates, thereby improving the accuracy of the card image.
[0066] Step 420, send the card image to the server.
[0067] In this step, after the above-mentioned execution entity obtains the card image including the card content, it sends the card image to the server. After receiving the card image, the server recognizes the card content included in the card image. For example, it performs OCR recognition on the card content to obtain the recognition content, which can exist in the form of text, and sends the recognition content corresponding to the card content to the above-mentioned execution entity.
[0068] Step 430, receive the recognition content corresponding to the card content sent by the server.
[0069] In this step, after the above-mentioned execution entity sends the card image to the server, it receives the recognition content corresponding to the card content. The above-mentioned execution entity can display the corresponding text of the received recognition content to the user through the screen, so that the user can understand the card content of the card.
[0070] In this implementation, by obtaining the card image corresponding to the card content and the recognition content of the card image, without recognizing other parts, the accuracy of the card image is guaranteed, thereby improving the accuracy of card content recognition.
[0071] Further refer to Figure 5 , which shows the flowchart 500 of another embodiment of the card recognition method. The flowchart 500 of the card recognition method includes the following steps:
[0072] Step 510, in response to collecting the preview image of the target object, use the contour recognition algorithm to process the preview image to obtain the contour of the target object.
[0073] Step 520, based on the contour of the target object, determine whether the target object is a card.
[0074] Step 530, in response to determining that the target object is a card, obtain the target image including the card, and obtain the recognition content of the card in the target image.
[0075] The above-mentioned Step 510, Step 520, and Step 530 are respectively consistent with Step 210, Step 220, and Step 230 and their optional implementation manners in the foregoing embodiments. The descriptions of Step 210, Step 220, and Step 230 and their optional implementation manners above also apply to Step 510, Step 520, and Step 530, and will not be repeated here.
[0076] Step 540, receive the audio-video link corresponding to the recognition content sent by the server, and play the audio-video file corresponding to the audio-video link.
[0077] In this embodiment, after the server recognizes the card image to obtain the recognition content, it can search in the network according to the recognition content to find the network card corresponding to the recognition content. The network card can be an electronic card corresponding to the card in the card image, or other cards with the same card content. Further obtain the audio-video link corresponding to the network card, and the audio-video file corresponding to the audio-video link is corresponding to the recognition content of the card. Or, after the server recognizes the card image to obtain the recognition content, it can search in the network according to the recognition content to find the audio-video link corresponding to the recognition content, and the audio-video file corresponding to the audio-video link can be audio-video content including the recognition content.
[0078] The above-mentioned execution entity can receive the audio-video link corresponding to the recognition content sent by the server, obtain the audio-video file corresponding to the audio-video link, and play the audio-video file corresponding to the audio-video link for the user.
[0079] Step 550: In response to playing the audio-video file corresponding to the audio-video link, obtain the user's recording and send the user's recording to the server.
[0080] In this embodiment, after the above-mentioned execution entity plays the audio-video file corresponding to the audio-video link for the user, the user can perform voice shadowing according to the heard audio-video content. The above-mentioned execution entity can collect the user's recording through a sound collection device such as a microphone, and then send the user's recording to the server. After receiving the user's recording, the server analyzes the user's recording, compares the original sound of the audio-video file with the user's recording, and scores the user's recording.
[0081] Optionally, the above-mentioned execution entity plays a word in the audio-video file, and then the user can perform voice shadowing according to the heard word. The above-mentioned execution entity collects the single-word voice of the user's shadowing through a microphone and sends the single-word voice to the server. After receiving the single-word voice, the server compares the single-word voice with the original sound of the corresponding word in the audio-video file to determine whether there is a difference, and scores the received single-word voice according to the difference. For example, after comparing the single-word voice with the original sound of the corresponding word in the audio-video file and determining that there is no difference, it is determined that the score of the single-word voice is 10 points, and the score is sent to the above-mentioned execution entity.
[0082] Step 560: Receive and present the score corresponding to the user's recording sent by the server.
[0083] In this embodiment, after the above-mentioned execution entity receives the score corresponding to the user's recording sent by the server, it presents the score corresponding to the user's recording to the user through the screen.
[0084] From Figure 5 it can be seen that the process 500 of the card recognition method in this embodiment reflects that while obtaining the recognition content of the card content, the audio-video link corresponding to the card content can also be obtained, so that the card content can be played for the user, improving the diversity of card recognition, and the user can also perform shadowing and the user's recording can be scored, improving the interactivity of card recognition.
[0085] Further referring to Figure 6 , as an implementation of the methods shown in the above figures, the present application provides an embodiment of a card recognition device. This device embodiment corresponds to the method embodiment shown in Figure 2 or Figure 4 , and this device can be specifically applied to various electronic devices.
[0086] As Figure 6 shown, the card recognition device 600 provided in this embodiment includes a processing unit 610, a judgment unit 620, and an acquisition unit 630. Among them, the processing unit 610 is configured to process the preview image by using a contour recognition algorithm in response to the acquisition of the preview image of the target object, so as to obtain the contour of the target object; the judgment unit 620 is configured to judge whether the target object is a card based on the contour of the target object; the acquisition unit 630 is configured to acquire a target image including the card and acquire the recognition content of the card in the target image in response to determining that the target object is a card.
[0087] In this embodiment, in the card recognition device 600: the specific processing of the processing unit 610, the judgment unit 620, and the acquisition unit 630 and the technical effects brought by them can respectively refer to Figure 2 the relevant descriptions of steps 210, step 220, and step 230 in the corresponding embodiments, which will not be elaborated here.
[0088] In some alternative implementation manners of this embodiment, the above-mentioned judgment unit 620 is further configured to: judge whether the target object is a card based on the contour of the target object and a preset card contour recognition model, where the preset card contour recognition model is a model obtained by training an initial neural network based on a card contour sample set.
[0089] In some alternative implementation manners of this embodiment, the above-mentioned judgment unit 620 includes: a first acquisition module configured to acquire a preset card contour table, where the preset card contour table includes card contours of at least one type of card; a judgment module configured to search in the preset card contour table based on the contour of the target object to judge whether the target object is a card.
[0090] In some alternative implementation manners of this embodiment, the processing unit 610 is further configured to: process the preview image by using a contour recognition algorithm to obtain the contour of the target object and the contour coordinates of the target object; and the acquisition unit 630 includes: a second acquisition module configured to acquire a card image including card content based on the contour coordinates of the target object; a sending module configured to send the card image to a server so that the server recognizes the card content in the card image to obtain the recognition content; a receiving module configured to receive the recognition content corresponding to the card content sent by the server.
[0091] In some alternative implementation manners of this embodiment, the above-mentioned second acquisition module is further configured to: acquire the card coordinates of the card in the target image based on the contour coordinates of the target object; crop the target image based on the card coordinates to acquire a card image including card content.
[0092] In some alternative implementation manners of this embodiment, the receiving module is further configured to: receive the audio-video link corresponding to the recognition content sent by the server, and play the audio-video file corresponding to the audio-video link.
[0093] In some alternative implementation manners of this embodiment, the apparatus further includes: a recording unit configured to, in response to playing the audio-video file corresponding to the audio-video link, obtain the user's recording and send the user's recording to the server, so that the server determines the score corresponding to the user's recording according to the original sound of the audio-video file and the user's recording; a presenting unit configured to receive and present the score corresponding to the user's recording sent by the server.
[0094] In the apparatus provided in the foregoing embodiment of the present application, the processing unit 610, in response to collecting the preview image of the target object, processes the preview image by using the contour recognition algorithm to obtain the contour of the target object, and then the judging unit 620 judges whether the target object is a card based on the contour of the target object. Finally, if it is determined that the target object is a card, the obtaining unit 630 obtains the target image including the card and obtains the recognition content of the card in the target image. Thereby, the contour recognition is realized by using the preview image, the situation of taking pictures when the target object is not a card can be avoided, the shooting resources can be saved, the target object in the preview image can be recognized and judged, if the target object is a card, the card image and the recognition content are obtained, the accuracy of judging whether the target object is a card is improved, and the accuracy of recognizing the card is improved.
[0095] Next, refer to Figure 7 , which shows a schematic structural diagram of an electronic device (such as the terminal device in Figure 1 ) 700 suitable for implementing the embodiments of the present application. The terminal device in the embodiments of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, PADs (tablet computers), PMPs (portable multimedia players), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The terminal device shown is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present application.
[0096] As Figure 7As shown, the electronic device 700 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 701, which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0097] Generally, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 7 the electronic device 700 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. More or fewer devices may be implemented or had alternatively. Figure 7 Each block shown in may represent a device or, as needed, multiple devices.
[0098] Specifically, according to an embodiment of the present application, the process described above with reference to the flowchart may be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication device 709, or installed from the storage device 708, or installed from the ROM 702. When the computer program is executed by the processing device 701, the above functions defined in the method of the embodiment of the present application are executed.
[0099] It should be noted that the computer-readable medium of the embodiments of the present application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the embodiments of the present application, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the embodiments of the present application, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable signal medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0100] The above computer-readable medium can be included in the above terminal device; it can also exist independently and not be assembled into the terminal device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by the terminal device, the terminal device is caused to: in response to collecting a preview image of a target object, process the preview image using a contour recognition algorithm to obtain the contour of the target object; based on the contour of the target object, determine whether the target object is a card; in response to determining that the target object is a card, obtain a target image including the card, and obtain the recognition content of the card in the target image.
[0101] Computer program code for performing the operations of the embodiments of the present application can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language, Python, or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network including a local area network (LAN) or a wide area network (WAN), or, it can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).
[0102] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks can occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0103] The units involved in the embodiments described in the present application can be implemented in software or in hardware. The described units can also be provided in a processor. For example, it can be described as: a processor including a processing unit, a judgment unit, and an acquisition unit. Among them, the names of these units do not constitute a limitation to the unit itself in some cases. For example, the processing unit can also be described as "the unit that processes the preview image of the target object using a contour recognition algorithm to obtain the contour of the target object in response to the acquisition of the preview image of the target object".
[0104] The above description is only a preferred embodiment of the present application and an explanation of the technical principles applied. Those skilled in the art should understand that the scope of disclosure involved in the embodiments of the present application is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above inventive concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the embodiments of the present application.
Claims
1. A card recognition method, comprising: In response to collecting a preview image of a target object, use a contour recognition algorithm to process the preview image to obtain the contour and contour coordinates of the target object; Based on the contour of the target object, determine whether the target object is a card; In response to determining that the target object is a card, obtain a target image including the card, and obtain the recognition content of the card in the target image. The target image has the same picture as the collected preview image, the proportion of each content in the image is the same, and there is a proportional relationship between the target image and the collected preview image, so that the target image and the preview image are of different sizes; The obtaining the recognition content of the card in the target image includes: According to the proportional relationship between the target image and the preview image, map the contour coordinates to the target image to obtain the card coordinates of the card in the target image. Based on the card coordinates, crop the target image to obtain a card image including the card content; Send the card image to the server so that the server can recognize the card content in the card image to obtain the recognition content; Receive the recognition content corresponding to the card content sent by the server.
2. The method according to claim 1, wherein, The determining whether the target object is a card based on the contour of the target object includes: Based on the contour of the target object and a preset card contour recognition model, determine whether the target object is a card. The preset card contour recognition model is a model obtained by training an initial neural network based on a card contour sample set.
3. The method according to claim 1, wherein, The determining whether the target object is a card based on the contour of the target object includes: Obtain a preset card contour table, where the preset card contour table includes the card contours of at least one type of card; Based on the contour of the target object, search in the preset card contour table to determine whether the target object is a card.
4. The method according to claim 1, wherein, The method further includes: Receive the audio-video link corresponding to the recognition content sent by the server and play the audio-video file corresponding to the audio-video link.
5. The method according to claim 4, wherein, The method further includes: In response to playing the audio-video file corresponding to the audio-video link, obtain the user's recording and send the user's recording to the server so that the server can determine the score corresponding to the user's recording according to the original sound of the audio-video file and the user's recording; Receive and present the score corresponding to the user's recording sent by the server.
6. A card recognition device, comprising: A processing unit, configured to, in response to collecting a preview image of a target object, use a contour recognition algorithm to process the preview image to obtain the contour and contour coordinates of the target object; A judgment unit, configured to determine whether the target object is a card based on the contour of the target object; An obtaining unit, configured to, in response to determining that the target object is a card, obtain a target image including the card, and obtain the recognition content of the card in the target image. The target image has the same picture as the collected preview image, the proportion of each content in the image is the same, and there is a proportional relationship between the target image and the collected preview image, so that the target image and the preview image are of different sizes; The obtaining unit includes: A second obtaining module, configured to map the contour coordinates into the target image according to the proportional relationship between the target image and the preview image, obtain the card coordinates of the card in the target image, and crop the target image based on the card coordinates to obtain a card image including card content; A sending module, configured to send the card image to a server so that the server recognizes the card content in the card image to obtain recognition content; A receiving module, configured to receive the recognition content corresponding to the card content sent by the server.
7. The device according to claim 6, wherein, The judging unit is further configured to: Based on the contour of the target object and a preset card contour recognition model, judge whether the target object is a card, where the preset card contour recognition model is a model obtained by training an initial neural network based on a card contour sample set.
8. The device according to claim 6, wherein, The judging unit includes: A first obtaining module, configured to obtain a preset card contour table, where the preset card contour table includes card contours of at least one type of card; A judging module, configured to search in the preset card contour table based on the contour of the target object and judge whether the target object is a card.
9. The device according to claim 6, wherein, The receiving module is further configured to: Receive an audio-video link corresponding to the recognition content sent by the server and play the audio-video file corresponding to the audio-video link.
10. The apparatus according to claim 9, wherein, The device further includes: A recording unit, configured to obtain user recording in response to playing the audio-video file corresponding to the audio-video link and send the user recording to the server so that the server determines a score corresponding to the user recording according to the original sound of the audio-video file and the user recording; A presenting unit, configured to receive and present the score corresponding to the user recording sent by the server.
11. An electronic device, comprising: One or more processors; A storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-5.
12. A computer-readable medium having a computer program stored thereon, wherein, When the program is executed by the processor, it implements the method according to any one of claims 1-5.
Citation Information
Patent Citations
Card information identification method and device
CN106250894A
Shooting method, mobile terminal and computer readable storage medium
CN110177206A
Novel multifunctional intelligent urheen
CN111435590A