Electronic device for detecting coin properties and method for operating same

Through the image detection and automatic adjustment functions of electronic devices, combined with the front and back information of coin, the problems of inaccurate detection results and complex user operations in the prior art are solved, and more efficient and accurate coin attribute detection is achieved.

CN119006563APending Publication Date: 2024-11-22HANGZHOU RUISHENG SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310572580.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-19
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

When detecting the attributes of coin, it is difficult to combine the information on the front and the information on the back of the coin, resulting in the inaccurate detection results. The clarity of the picture and the size of the coin have an impact on the detection results. Users need to manually adjust the shooting conditions, which can easily lead to Shake or information is lost.

Method used

The video stream is obtained through the shooting device of the electronic device, the image detection process is performed, the position, size and stability of the coin are detected, the shooting conditions are automatically adjusted or the user is prompted to make adjustments, take pictures of the front and back sides of the coin, and perform attribute detection based on these pictures .

Benefits of technology

More precise coin attribute detection is achieved, reducing user operation uncertainty, improving the accuracy and user experience of detection results, and ensuring that the position and size of the coin in the picture frame meet the optimal shooting conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119006563A_ABST
    Figure CN119006563A_ABST
Patent Text Reader

Abstract

The invention relates to an operation method of electronic equipment for detecting coin attributes, and the method comprises the steps: obtaining a video stream through a shooting device of the electronic equipment, and displaying a shooting interface through a display device of the electronic equipment; performing an image detection process so that a coin detected in a picture frame of the video stream satisfies a condition of a photographed picture; once the coin detected in the picture frame meets the condition of the shot picture, automatically triggering the shooting device to shoot a first picture of the coin or prompting a user to shoot the first picture, and prompting the user to turn over the coin through a display device of the electronic equipment; executing the image detection process again; and once the coin detected in the picture frame meets the condition of the shot picture, automatically triggering the shooting device to shoot a second picture of the coin or prompting the user to shoot the second picture, and detecting the attribute of the coin based on the first picture and the second picture. The disclosure also relates to an electronic device for detecting coin attributes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to an operation method of an electronic device for detecting coin attributes and an electronic device for detecting coin attributes. Background Art

[0002] With the popularity of applications using artificial intelligence technology, more and more application requirements have emerged, such as detecting the properties of coins, such as the quality of the coins, by inputting coin images into applications installed in client devices. Summary of the invention

[0003] One of the purposes of the present disclosure is to provide a method for detecting coin attributes based on a neural network model and a method for training a neural network model.

[0004] According to a first aspect of the present disclosure, there is provided an operating method of an electronic device for detecting coin attributes, comprising: obtaining a video stream through a shooting device of the electronic device, and displaying a shooting interface through a display device of the electronic device; executing an image detection process so that a coin detected in a picture frame of the video stream satisfies a condition for a picture to be shot; once the coin detected in the picture frame satisfies the condition for a picture to be shot, the shooting device is automatically triggered to shoot a first picture of the coin or prompts a user to shoot a first picture, and in response to the first picture being shot, the user is prompted to turn the coin over through the display device of the electronic device; executing the image detection process again; once the coin detected in the picture frame satisfies the condition for a picture to be shot, the shooting device is automatically triggered to shoot a second picture of the coin or prompts the user to shoot a second picture; and in response to the second picture being shot, the attributes of the coin are detected based on the first picture and the second picture.

[0005] According to a second aspect of the present disclosure, there is provided an operation method of an electronic device for detecting coin attributes, comprising: obtaining a video stream through a shooting device of the electronic device, and displaying a shooting interface through a display device of the electronic device; executing an image detection process so that the coin detected in the picture frame of the video stream meets the conditions of the photographed picture, the image detection process comprising: detecting the position and size of the coin in the picture frame; in response to the size of the coin in the picture frame not being within a target size range, prompting a user through the display device to move the shooting device closer to or further away from the coin; in response to the position of the coin in the picture frame not being within a target position range, prompting a user through the display device to move the coin toward the target position range, and initializing a stability value to an initial stability value; in response to the focus of the shooting device not being within the boundary of the coin, focusing the shooting device on the center of the portion surrounded by the boundary of the coin; in response to the distance between the center of the portion surrounded by the boundary of the coin detected this time and the center of the portion surrounded by the boundary of the coin detected last time being not less than a center distance threshold, initializing the stability value to the initial stability value, returning to repeat the execution of the Image detection process; in response to the distance being less than the center distance threshold, increasing the stability value; in response to the stability value being not greater than the first stability threshold, returning to repeatedly execute the image detection process; in response to the stability value being greater than the first stability threshold, determining and adjusting the zoom factor and increasing the stability value; in response to the stability value being not greater than the second stability threshold which is greater than the first stability threshold, adjusting the focus to refocus on the center of the detected coin, returning to repeatedly execute the image detection process; in response to the stability value being greater than the second stability threshold, ending the image detection process; once the coin detected in the picture frame meets the conditions of the photographed picture, automatically triggering the shooting device to shoot the first picture of the coin or prompting the user to shoot the first picture, and in response to the first picture being shot, prompting the user to turn the coin over through the display device of the electronic device; executing the image detection process again; and once the coin detected in the picture frame meets the conditions of the photographed picture, automatically triggering the shooting device to shoot the second picture of the coin or prompting the user to shoot the second picture, and in response to the second picture being shot, detecting the properties of the coin based on the first picture and the second picture.

[0006] According to a third aspect of the present disclosure, there is provided an operating method of an electronic device for detecting coin properties, comprising: obtaining a video stream through a shooting device of the electronic device, displaying a shooting interface through a display device of the electronic device, and displaying the video stream in the shooting interface at a magnification corresponding to the shooting focal length of the shooting device; displaying a frame in the shooting interface to indicate the target position range of the coin in the picture frame of the video stream; aligning the focus of the shooting of the shooting device to the center of the frame; in response to receiving a specific operation via an operable area of ​​the electronic device, taking a first picture of the coin through the shooting device; prompting a user to turn the coin over through the display device, and in response to receiving a specific operation via the operable area, taking a second picture of the coin through the shooting device; and detecting the properties of the coin based on the first picture and the second picture.

[0007] According to a fourth aspect of the present disclosure, an electronic device for detecting coin attributes is provided, comprising: one or more processors; and one or more memories, wherein the one or more memories are configured to store a series of computer-executable instructions, wherein when the series of computer-executable instructions are executed by the one or more processors, the one or more processors perform the method as described above.

[0008] According to a fifth aspect of the present disclosure, a non-temporary computer-readable storage medium is provided, characterized in that a series of computer-executable instructions are stored on the non-temporary computer-readable storage medium, and when the series of computer-executable instructions are executed by one or more computing devices, the one or more computing devices perform the method as described above.

[0009] Other features and advantages of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0011] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:

[0012] Figure 1 The present invention is an exemplary flow chart of an operating method of an electronic device for detecting coin attributes according to an embodiment of the present disclosure.

[0013] Figure 2 The present invention is an exemplary flow chart of an image detection process in an operation method of an electronic device for detecting coin attributes according to an embodiment of the present disclosure.

[0014] FIG. 3A to FIG. 3C The present invention is an exemplary flow chart of an image detection process in an operation method of an electronic device for detecting coin attributes according to an embodiment of the present disclosure.

[0015] Figure 4 The present invention is an exemplary flow chart of an operating method of an electronic device for detecting coin attributes according to an embodiment of the present disclosure.

[0016] Figure 5A and Figure 5B It is a schematic diagram of a photographing interface in an operating method of an electronic device for detecting coin attributes according to an embodiment of the present disclosure.

[0017] Figure 6 The present invention is a schematic diagram of determining a zoom factor in an image detection process in an operation method of an electronic device for detecting coin attributes according to an embodiment of the present disclosure.

[0018] Figure 7 Schematic diagram of the front and back images of a coin in an embodiment of the present disclosure.

[0019] FIG. 8A to FIG. 8H It is a schematic diagram of a photographing interface in an operating method of an electronic device for detecting coin attributes according to an embodiment of the present disclosure.

[0020] Fig. 9 The present invention is a structural diagram of at least a portion of an electronic device for detecting coin attributes according to an embodiment of the present disclosure.

[0021] Fig.10 is an exemplary block diagram of a general hardware system that can be applied according to an embodiment of the present disclosure.

[0022] Note that in the embodiments described below, sometimes the same reference numerals are used in common between different drawings to represent the same parts or parts with the same functions, and their repeated descriptions are omitted. In some cases, similar numbers and letters are used to represent similar items, so once an item is defined in one drawing, it does not need to be further discussed in subsequent drawings. DETAILED DESCRIPTION

[0023] The present disclosure will be described below with reference to the accompanying drawings, wherein the accompanying drawings illustrate several embodiments of the present disclosure. However, it should be understood that the present disclosure can be presented in a variety of different ways and is not limited to the embodiments described below; in fact, the embodiments described below are intended to make the disclosure of the present disclosure more complete and fully illustrate the scope of protection of the present disclosure to those skilled in the art. It should also be understood that the embodiments of the present disclosure can be combined in various ways to provide more additional embodiments.

[0024] It should be understood that the terms in this disclosure are only used to describe specific embodiments and are not intended to limit the present disclosure. All terms (including technical terms and scientific terms) used in this disclosure have the meanings commonly understood by those skilled in the art unless otherwise defined. For the sake of simplicity and / or clarity, well-known functions or structures may not be described in detail.

[0025] In the present disclosure, the term "A or B" includes "A and B" and "A or B" rather than exclusively including only "A" or only "B", unless specifically stated otherwise.

[0026] In the present disclosure, references to "one embodiment" or "some embodiments" mean that features, structures, or characteristics described in conjunction with the embodiment are included in at least one embodiment, at least some embodiments, of the present disclosure. Therefore, the appearance of the phrases "in one embodiment" or "in some embodiments" in various places of the present disclosure does not necessarily refer to the same embodiment or embodiments. In addition, in one or more embodiments, features, structures, or characteristics may be combined in any suitable combination and / or sub-combination.

[0027] In this disclosure, the word "exemplary" means "used as an example, instance or illustration" rather than as a "model" to be exactly copied. Any implementation described as an example herein is not necessarily to be construed as preferred or advantageous over other implementations. Moreover, this disclosure is not limited by any expressed or implied theory given in the above technical field, background technology, summary of the invention or detailed description.

[0028] In addition, "first", "second" and the like terms may also be used in the present disclosure for reference purposes only, and thus are not intended to be limiting. For example, the words "first", "second" and other such numerical terms referring to structures or elements do not imply a sequence or order unless the context clearly indicates otherwise.

[0029] It should also be understood that when the term “include / comprises” is used in the present disclosure, it indicates the presence of the specified features, integers, steps, operations, units and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, units and / or components and / or their combinations.

[0030] In this disclosure, the terms "component" and "system" are intended to refer to a computer-related entity, or hardware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process, object, executable state, execution thread, and / or program running on a processor. By way of example, both an application running on a server and the server can be a component. One or more components can exist inside an executed process and / or thread, and a component can be located on a computer and / or distributed between two or more computers.

[0031] The inventors of the present application have found that when detecting the properties of a coin, it is necessary to combine the information on both the front and back of the coin to give a more accurate detection result. Therefore, it is proposed that after the user inputs the first coin picture, the user is prompted to turn the coin over and take another photo. In addition, the inventors of the present application have also found that factors such as the clarity of the picture used to detect the properties of the coin and the size of the coin in the picture are related to the detection results. For example, the clearer the coin in the picture, the more accurate the detection result tends to be. For another example, the larger the area occupied by the coin in the picture, the more details may be shown, and the more accurate the detection result tends to be; but if the area occupied by the coin in the picture is too large, it may cause part of the coin to exceed the picture, resulting in information loss and inaccurate detection results. Based on these considerations, the inventors of the present application provide an operating method of an electronic device for detecting the properties of a coin according to various embodiments of the present disclosure.

[0032] Figure 1 The following is an exemplary flow chart of an operation method 100 of an electronic device for detecting coin attributes according to an embodiment of the present disclosure. The electronic device may be a smart phone, a tablet computer, a personal computer, etc. The electronic device may complete the operation method 100 of the electronic device through an application installed thereon. The method 100 may include steps S110 to S160 as described below. It should be understood that in the embodiments, drawings and claims of the present disclosure, each step is described in a specific order. Then, for any two steps included in the method, if there is no front-to-back dependency between them, the order of the two steps may be swapped.

[0033] In step S110, a video stream is obtained through the shooting device of the electronic device, and a shooting interface is displayed through the display device of the electronic device. For example, in response to the application used to complete method 100 being started, the shooting device (such as a camera) of the electronic device is turned on to obtain a video stream, and a shooting interface is displayed on a display device (such as a display). The shooting interface can be the entire area of ​​the display page of the application, or it can be a partial area of ​​the display page of the application, which is used to display the video stream currently obtained by the shooting device. It should be understood that the video stream displayed in the shooting interface can be a coded / compressed video stream or an uncoded / compressed original video stream.

[0034] In step S120, an image detection process is performed so that the coin detected in the picture frame of the video stream meets the conditions for the picture to be taken. For example, the image detection process can detect the size, position, clarity, etc. of the coin in the picture frame, and whether the degree of shake, stability, light intensity, etc. of the captured picture meet the requirements, and if the requirements are not met, the electronic device is adjusted or the user is prompted to make manual adjustments so that the coin detected in the picture frame meets the conditions for the picture to be taken. It should be understood that the conditions for the picture to be taken here include conditions that are conducive to more accurate detection of the properties of the coin in the picture. In step 130, once the coin detected in the picture frame meets the conditions for the picture to be taken, the shooting device is automatically triggered to take the first picture of the coin or the user is prompted to take the first picture (for example, by displaying a text prompt on the interface, etc.), and in response to the first picture being taken, the user is prompted to turn the coin over through the display device of the electronic device, for example, by displaying a text prompt on the interface (for example, as Figure 8H In step 140, the image detection process is performed again. In step 150, once the coin detected in the picture frame meets the conditions of the photographed picture, the photographing device is automatically triggered to take a second picture of the coin or the user is prompted to take a second picture. In step 160, in response to the second picture being taken, the properties of the coin are detected based on the first picture and the second picture.

[0035] In this way, the method 100 can dynamically detect whether the coin in the picture frame meets the shooting conditions to be identified during the process of the user inputting the coin picture into the application, and automatically adjust the electronic device or prompt the user to make manual adjustments to ensure that the shooting conditions are more easily met; and once the coin is detected in the picture frame to meet the shooting conditions, the coin photo at this time can be immediately taken. In this way, on the one hand, the user does not need to perform a shooting operation (such as pressing a shooting button, etc.) to facilitate the user's operation, and on the other hand, it can avoid shaking or shifting of the electronic device when the user performs the shooting operation, which makes the captured picture not conducive to better coin detection. In addition, in some embodiments, the user can be prompted to take a photo when the coin is detected in the picture frame to meet the shooting conditions. In this way, the user can retain the freedom to take the coin picture by himself, and the user can take the coin picture that meets the requirements as much as possible.

[0036] In some embodiments, before step 140, it is also detected whether the coin has been turned over, and in response to the detection result that the coin has been turned over, step 140 is performed. In one example, a neural network model for identifying whether the coin has been turned over can be pre-trained based on artificial intelligence technology, and the model can identify whether the coin has been turned over based on the picture of the coin detected in the video frame. In another example, the front and back of the coin can be identified based on the image detection algorithm and the features of the front and back of the coin, so as to determine whether the coin in the video frame has been turned over. If the detection result is that the coin has not been turned over, the user is continued to be prompted to turn the coin over (for example, a different prompting means from the previous one, or an additional prompting means can be used). If the detection result is that the coin has been turned over, step 140 is performed and the image detection process is performed again.

[0037] In some embodiments, an operable area (e.g., to be used as a shooting button) can be provided by an electronic device during the execution of the image detection process of method 100, and in response to receiving a specific operation via the operable area, a picture is taken by a camera. The operable area can be, for example, a virtual button on the display page of the application, or a physical button arranged on the housing of the electronic device. During the execution of the image detection process, the user can perform a specific operation via the operable area at any time, such as pressing a shooting button, to take a picture of the current coin. It should be understood that other known photo triggering technologies, such as voice control, can also be used. At this time, the application may not provide an operable area, but in response to receiving a specific voice, take a picture by a camera. In some embodiments, an operable area may not be provided throughout the execution of the image detection process, for example, an operable area may be provided only when it is detected that the coin meets the shooting condition in the picture frame (or the operation of the operable area is unlocked), so that the user can take a coin picture that meets the requirements as much as possible.

[0038] Figure 2 The following is an exemplary flow chart of the image detection process 200 in the operation method 100 of the electronic device for detecting the properties of coins according to an embodiment of the present disclosure. The image detection process 200 may include steps S210 to S250 as described below. In step S210, the position and size of the coin in the picture frame are detected, and the boundary of the coin is indicated in the shooting interface during the image detection process. In step S220, in response to the position of the coin in the picture frame not being within the target position range, the user is prompted to move the coin to the target position range through the display device. In step S230, in response to the size of the coin in the picture frame not being within the target size range, the shooting device is physically zoomed to make the size of the coin in the picture frame closer to the target size range. In step S240, in response to the physical zoom failing to make the size of the coin in the picture frame within the target size range, the user is prompted to move the shooting device closer to or further away from the coin through the display device. In step S250, it is determined that the position of the coin in the picture frame is within the target position range and the size of the coin in the picture frame is within the target size range. In response to the position of the coin in the picture frame being within the target position range and the size of the coin in the picture frame being within the target size range, the image detection process is terminated, otherwise the process returns to step S210 to repeat the image detection process.

[0039] In some embodiments, in response to the camera of the electronic device being turned on, it is possible to periodically and continuously detect whether there is a coin in the picture frame of the video stream, and determine the size and position of the coin in the picture frame. The detection period can be formulated according to the frame rate of the video stream, such as performing a detection once every N frames; it can also be formulated according to time, such as performing a detection once every M milliseconds.

[0040] In some embodiments, the boundary of the coin can be indicated by displaying a frame that at least partially surrounds the coin in the shooting interface, wherein the frame includes all or one or more parts of any one of a circular frame, a square rectangular frame, and a rounded rectangular frame. Figure 5A and Figure 5Bis a schematic diagram of the shooting interface 10. As described above, the shooting interface 10 is a specific area in the display page of the application for displaying the video stream currently obtained by the shooting device. It should be understood that, although not shown, the currently shot video stream can be displayed in the area of ​​the shooting interface 10. A frame 20 can also be displayed in the shooting interface 10 to indicate the boundary of the coin in the video, for example, by superimposing a layer on the layer of the video stream. It should be understood that, although not shown, the area of ​​the frame 20 can include the coins detected in the current video stream. Since the frame 20 surrounds the coins detected in the picture frame, it can not only indicate the position of the coin in the picture frame, but also indicate the size of the coin in the picture frame. Since the frame 20 indicates the boundary of the coin in the picture frame, hereinafter, the frame 20 is also referred to as the boundary 20 of the coin. The frame 20 can be a frame with a full enclosing form, such as Figure 5A As shown, it can also be a frame with a partial enclosing form, such as Figure 5B It should be understood that, for exemplary purposes, the present disclosure lists some forms of the frame 20, but the present disclosure is not limited thereto, as long as the position and size of the detected coin can be indicated in the shooting interface 10. Since the coin can be observed by the user in the shooting interface 10, in some embodiments, the boundary of the coin may not be indicated in the shooting interface 10, for example, no frame 20 surrounding the detected coin may be displayed.

[0041] Figure 5A The shooting interface 10 of the embodiment also shows the target position range and target size range of the coin in the picture frame in area 30. In some embodiments, the boundary of area 30 can be displayed in the shooting interface 10 to indicate the target position range and target size range of the coin in the picture frame to the user. In this way, the user can adjust the size and position of the coin in the picture according to the indication, for example, by moving the shooting device of the electronic device forward, backward or left and right. In the case where both area 30 and frame 20 are displayed in the shooting interface 10, the user can more intuitively understand the current position / size and target position / size of the coin, which is more conducive to the user to adjust it by himself. In some embodiments, the boundary of area 30 may not be displayed in the shooting interface 10, that is, the target position range and target size range of the coin in the picture frame are not indicated to the user, but the position and size of the coin in the shooting interface fall into the target range through automatic adjustment of the electronic device (for example, through physical zoom) and output information to prompt the user to adjust the position of the electronic device (for example, prompting the user to place the coin in the center of the picture, or prompting the user to move the mobile phone forward / backward / left / right, etc.).

[0042] In some embodiments, whether the position of the coin in the picture frame is within the target position range can be determined by determining whether the distance between the boundary 20 of the coin and the boundary of the shooting interface 10 in the shooting interface 10 is less than a boundary distance threshold. Whether the distance is less than the threshold can be determined by calculating the screen ratio of the distance. For example, a first ratio H23L / H10 of the distance H23L between the left boundary of the coin and the left boundary of the shooting interface 10 and the horizontal dimension H10 of the shooting interface 10 may be calculated, a second ratio H23R / H10 of the distance H23R between the right boundary of the coin and the right boundary of the shooting interface 10 and the horizontal dimension H10 of the shooting interface 10 may be calculated, a third ratio V23U / V10 of the distance V23U between the upper boundary of the coin and the upper boundary of the shooting interface 10 and the vertical dimension V10 of the shooting interface 10 may be calculated, and a fourth ratio V23D / V10 of the distance V23D between the lower boundary of the coin and the lower boundary of the shooting interface 10 and the vertical dimension V10 of the shooting interface 10 may be calculated. Four ratio thresholds, such as the first ratio to the fourth ratio, for measuring the above-mentioned first ratio to the fourth ratio may be predetermined, so as to use the four ratio thresholds to determine whether the first ratio to the fourth ratio meet the conditions. For example, it can be determined whether the first ratio H23L / H10 is not greater than the first proportion, whether the second ratio H23R / H10 is not greater than the second proportion, whether the third ratio V23U / V10 is not greater than the third proportion, and whether the fourth ratio V23D / V10 is not greater than the fourth proportion. When the first to fourth ratios are all not greater than their respective proportion thresholds, it can be determined that the distance between the boundary 20 of the coin in the shooting interface 10 and the boundary of the shooting interface 10 is less than the boundary distance threshold, that is, it is considered that the position of the coin in the picture frame is within the target position range.

[0043] In some embodiments, whether the size of the coin in the picture frame is within the target size range can be determined by judging whether the screen ratio of the coin in the shooting interface 10 is within the target screen ratio range. Although it is called "screen" ratio, it should be understood that the screen ratio of the coin may not be the ratio of the entire display screen of the electronic device, for example, it may be the ratio of the coin in the shooting interface 10 to the shooting interface 10. For example, it can be determined whether the size of the coin in the picture frame is within the target size range by judging whether the ratio of the horizontal dimension H20 of the boundary 20 of the coin in the shooting interface 10 to the horizontal dimension H10 of the shooting interface 10 H20 / H10, the ratio of the vertical dimension V20 of the boundary 20 of the coin in the shooting interface 10 to the vertical dimension V10 of the shooting interface 10 V20 / V10, or the ratio of the area of ​​the portion surrounded by the boundary 20 of the coin in the shooting interface 10 (for example, H20×V20) to the area of ​​the shooting interface 10 (for example, H10×V10) (for example, H20×V20 / (H10×V10)) is within the target range.

[0044] When it is determined that the size of the coin in the picture frame is not within the target size range, the camera can be physically zoomed to make the size of the coin in the picture frame closer to the target size range. The magnification or reduction multiple (referred to as the zoom multiple) of the physical zoom is calculated based on the boundary 20 indicating the coin in the shooting interface 10, the target position range, and the target size range (indicated by the area 30). A specific example of the zoom multiple will be described below. If the size of the coin in the picture frame is not within the target size range after physical zooming, the user can be prompted by the display device to move the camera closer or further away from the coin. After receiving the prompt, the user may change the position of the camera. The application will repeatedly detect the position and size of the coin in the picture frame in the image detection process 200, and automatically take pictures if it meets the target range. If it does not meet the target range, it will return to repeat the image detection process 200 until the position and size of the coin in the picture frame meet the target range.

[0045] In some embodiments, when the camera is initially turned on to obtain a video stream, the application may set the camera to shoot at an initial focal length, and the initial focal length is greater than 1, that is, the video stream is shot in a magnified form. At the same time, the video stream is displayed in the shooting interface 10 at a magnification corresponding to the focal length of the camera. For example, when the focal length of the camera changes, it is displayed in the shooting interface 10 at a corresponding magnification.

[0046] In some embodiments, the image detection process 200 can also automatically focus. For example, in response to the detected change in the boundary of the coin, it is determined whether the focus of the camera is within the boundary of the coin; in response to the focus of the camera not being within the boundary of the coin, the camera is focused on the center of the portion surrounded by the boundary of the coin.

[0047] In some embodiments, the image detection process 200 also detects the clarity of the coin in the picture frame, performs light intensity detection on the coin in the picture frame, and detects the stability of the image, etc. For example, in some embodiments, the image detection process 200 may also include: in response to the position of the coin in the picture frame being within the target position range and the size of the coin in the picture frame being within the target size range, determining the clarity of the coin in the picture frame; in response to the position of the coin in the picture frame being within the target position range, the size of the coin in the picture frame being within the target size range and the clarity meeting the condition, ending the image detection process, otherwise repeating the image detection process. In some embodiments, the image detection process 200 may also include: before taking the first picture or the second picture of the coin, performing light intensity detection on the coin in the picture frame, and adjusting the exposure value according to the detected light intensity; in response to the light intensity of the coin in the picture frame meeting the condition, taking the first picture or the second picture of the coin by the shooting device. In some embodiments, the image detection process 200 may also include: in response to the detected boundary change of the coin, determining whether the distance between the center of the portion surrounded by the boundary of the coin detected this time and the center of the portion surrounded by the boundary of the coin detected last time is less than the center distance threshold; in response to the distance being not less than the center distance threshold, initializing the stability value to the initial stability value; and in response to the distance being less than the threshold, increasing the stability value; in response to the position of the coin in the picture frame being within the target position range, the size of the coin in the picture frame being within the target size range and the stability value being greater than the threshold, ending the image detection process, otherwise repeating the image detection process. Among them, whether the distance is less than the threshold can be determined by determining whether the ratio of the distance to the diagonal length of the shooting interface is less than the center distance threshold.

[0048] In some embodiments, the image detection process may include: detecting the position and size of the coin in the picture frame; in response to the size of the coin in the picture frame not being within the target size range, prompting the user through the display device to move the camera closer to or further away from the coin; in response to the position of the coin in the picture frame not being within the target position range, prompting the user through the display device to move the coin toward the target position range, and initializing the stability value to the initial stability value; in response to the focus of the camera not being within the boundary of the coin, focusing the camera on the center of the portion surrounded by the boundary of the coin; in response to the center of the portion surrounded by the boundary of the coin detected this time being different from the center of the portion surrounded by the boundary of the coin detected last time The distance between the centers of the parts surrounded by the boundary is not less than the center distance threshold, the stability value is initialized to the initial stability value, and the image detection process is repeated; in response to the distance being less than the center distance threshold, the stability value is incremented; in response to the stability value being not greater than the first stability threshold, the image detection process is repeated; in response to the stability value being greater than the first stability threshold, the zoom factor is determined and adjusted and the stability value is incremented; in response to the stability value being not greater than the second stability threshold which is greater than the first stability threshold, the focus is adjusted to refocus on the center of the detected coin, and the image detection process is repeated; in response to the stability value being greater than the second stability threshold, the image detection process is ended. FIG. 3A to FIG. 3C A specific example of the image detection process in these embodiments, namely the image detection process 300 , is described. FIG. 3A to FIG. 3C An exemplary flow chart of an image detection process 300 is shown. The flow chart is shown in three parts. The first part 300-P1 of the image detection process 300 is shown in FIG. Figure 3A As shown, the second part 300-P2 is as shown in Figure 3B As shown, the third part 300-P3 is as shown in Figure 3C shown.

[0049] like Figure 3A As shown, image detection is performed based on picture frames (also referred to as video frames) in a video stream obtained by a shooting device (such as a camera). First, the degree of shaking is detected, that is, whether the shooting device is stable. When the degree of shaking is, for example, less than or equal to 0.1, it can be judged to be stable, and the process of detecting the screen ratio of the coin in the picture frame can be entered, otherwise the video frame is reacquired. To detect the screen ratio, it is necessary to first detect the position and size of the coin in the picture frame, which can be done through a trained neural network model. For example, the position and size of the coin can be dynamically detected every 100 milliseconds or every 125 milliseconds, and a box indicating the detected coin can be used, for example Figure 5A The rounded rectangular frame 20 (hereinafter referred to as the coin frame) shown frames the coin.

[0050] The screen-to-body ratio can be, for example, the ratio of the width (lateral dimension) of the coin frame (e.g., the width and height can be equal) to the width of the shooting interface (e.g., the range of the entire viewfinder), or the ratio of the height (vertical dimension) of the coin frame to the height of the shooting interface. Since coins are usually round in practice, the coin frame is usually equal in width and height, and the shooting interface usually has different widths and heights according to the size of the display screen of the electronic device, so the screen-to-body ratio can be calculated based on the smaller of the width and height of the shooting interface. For example, if the lateral dimension of the shooting interface is smaller than the longitudinal dimension, the ratio of the width of the coin frame to the width of the shooting interface is used as the screen-to-body ratio. In addition, it can also be the ratio of the areas of the two. Preferably, a unified method is used to calculate the screen-to-body ratio during the execution of the entire image detection process 300. The target size range of the coin in the picture frame can be determined as a screen-to-body ratio between 0.22 and 0.7. Too small or too large is not conducive to the detection of coin attributes. Therefore, when the screen-to-body ratio is less than or equal to 0.22, a prompt is given to let the user move the camera closer to the coin, and when the screen-to-body ratio is greater than or equal to 0.7, a prompt is given to let the user move the camera further away from the coin. In both cases, the process returns to the beginning of the image detection process 300, that is, the image detection process 300 is repeated. If the screen-to-body ratio is between 0.22 and 0.7, the following process is continued.

[0051] like Figure 3B As shown, it is determined whether the position of the coin in the picture frame is within the target position range to prevent the coin from being too close to the boundary of the shooting interface. For example, it is determined whether the distance between the coin boundary in the picture frame and the boundary of the shooting interface is greater than the boundary distance threshold, such as determining whether the screen ratio of the distance is greater than 0.05. According to the above, the four boundaries of the coin, top, bottom, left, and right, are calculated. For example, the above reference Figure 5A The ratios V23U / V10, V23D / V10, H23L / H10 and H23R / H10 are used to determine whether the four ratios are all greater than the boundary distance threshold. You can also first determine the minimum value of the distances between the top, bottom, left and right boundaries of the coin and the corresponding boundaries of the shooting interface, for example Figure 5A In the example shown, the distance between the right boundary of the coin and the corresponding boundary of the shooting interface is the smallest, so it is only necessary to determine whether the ratio H23R / H10 of the distance between the right boundary of the coin and the right boundary of the shooting interface is greater than the boundary distance threshold. If the distance between the boundaries is not greater than the boundary distance threshold, the user is prompted to move the coin to the target position range through the display device, for example, prompting the user to move the coin to the middle, and the stability value is initialized to the initial stability value, such as 0. If the distance between the boundaries is greater than the boundary distance threshold, the following process is continued.

[0052] Determine whether the current focus of the camera (for example, the center of the focus frame after the last focus) is inside the frame of the currently detected coin area to determine whether refocusing is required. If the focus is not inside the coin frame, it means that it has moved a lot, and you need to refocus, for example, focus the camera on the center of the part surrounded by the boundary of the coin. At the same time, determine whether the ratio between the size of the line connecting the center points of the coin frame detected this time and the coin frame detected last time (that is, the coin frame detected twice in succession) (that is, the distance between the centers of the two coin frames) and the diagonal of the shooting interface is less than the center distance threshold, for example, whether it is less than 0.1. If it is greater than 0.1, it is considered that there is a lot of movement, and the stability value is set to the initial value 0 to return to the beginning of the image detection process 300; if it is less than 0.1, it is considered stable, and the stability value is increased by 1.

[0053] like Figure 3C As shown, it is determined whether the electronic device supports the clarity recognition function according to the system version. For example, if the version above ios14 supports it, then it is determined whether the clarity is up to standard. For example, it can be determined whether the clarity exceeds the set threshold, such as the clarity threshold of 0.98. If the clarity is not up to standard, it returns directly to the beginning of the image detection process 300. If the electronic device does not support the clarity recognition function, the stability value is determined. When the stability value is greater than or equal to 2, the next step is entered. If the stability value is less than 2, it returns to the beginning of the image detection process 300 to repeat the image detection process 300 until the accumulated stability value is greater than or equal to 2 to enter the subsequent process of determining and adjusting the zoom factor.

[0054] The zoom factor can be calculated based on the boundary of the coin indicated in the shooting interface, the target position range, and the target size range. For example, the optimal screen-to-body ratio can be preset. For example, the optimal screen-to-body ratio can be set to 0.5, that is, the optimal value of the ratio of the height of the coin frame to the height of the shooting interface (referred to as the optimal height screen-to-body ratio) is 0.5, and the optimal value of the ratio of the width of the coin frame to the width of the shooting interface (referred to as the optimal width screen-to-body ratio) is also 0.5. In some embodiments, the optimal width screen-to-body ratio and the optimal height screen-to-body ratio may not be equal. Then calculate the preliminary zoom factor based on the size of the coin in the picture frame. For example, the width zoom factor W = optimal width screen-to-body ratio / coin width screen-to-body ratio, the height zoom factor H = optimal height screen-to-body ratio / coin height screen-to-body ratio, and take the smaller value of W and H as the first zoom factor zoom1 = min(W, H). Among them, the coin width screen-to-body ratio is the ratio of the width of the coin frame to the width of the shooting interface (for example Figure 5A The coin height screen ratio is the ratio of the coin frame height to the shooting interface height (e.g. Figure 5A V20 / V10 in the .

[0055] Then calculate the second zoom factor zoom2 based on the coin boundary. Figure 6 , a specific example is used to describe the process of calculating the second zoom factor zoom2. Figure 6 , showing the coin boundaries (e.g. Figure 5A 20 in the box), the target position range boundary (e.g. Figure 5A ), and the left and right boundaries of the shooting interface (e.g. Figure 5A The x-axis represents the horizontal direction (width direction), the y-axis represents the vertical direction (height direction), and the coordinate value represents the screen ratio (i.e., the ratio of the point to the entire shooting interface). Therefore, the coordinate value of the left boundary of the shooting interface is 0, and the coordinate value of the right boundary is 1. Figure 6 The distance marked as 0.1 screen ratio value in the figure, hereinafter referred to as "self.BestDistance", is the distance between the boundary of the target position range and the corresponding boundary of the configuration interface (e.g. Figure 5A H1 and H2 in Figure 6 In the example shown, the self.BestDistance values ​​on the left and right sides are equal. It should be understood that in other examples, the self.BestDistance values ​​on the left and right sides may not be equal. Similarly, the self.BestDistance values ​​on the upper and lower sides may also be preset (e.g. Figure 5A V1 and V2 in ), the self.BestDistance on the upper and lower sides can be equal or different from each other, and the self.BestDistance on the upper and lower sides can be equal or different from the self.BestDistance on the left and right sides. For simplicity, Figure 6 Only the case where self.BestDistance on the left and right sides are equal is shown. self.BestDistance = 0.1 means that when the coin area is enlarged to the maximum, a distance of 0.1 screen ratio needs to be reserved on both sides.

[0056] Use dx and dy to represent the minimum available distance ratio between the current coin border and the border of the shooting interface (the calculation of dx and dy will be described in detail below), and calculate the horizontal zoom factor respectively. For simplicity, Figure 6 Only the calculation method of the horizontal magnification is shown. Based on this example, those skilled in the art can obtain the calculation method of the horizontal reduction ratio, the vertical magnification ratio, and the vertical reduction ratio. Figure 6In the example, the horizontal magnification factor = (2dx + coin width screen ratio) / coin width screen ratio. Similarly, the vertical magnification factor = (2dy + coin width screen ratio) / coin height screen ratio. Then the second zoom factor zoom2 is determined to be the smaller value of the horizontal magnification factor and the vertical magnification factor, that is, zoom2 = min (horizontal magnification factor, vertical magnification factor).

[0057] You can calculate dx and dy according to the formula dx = min (leftTop.x-self.BestDistance, 1-rightBottom.x-self.BestDistance) and dy = min (leftTop.y-self.BestDistance, 1-rightBottom.y-self.BestDistance). Where leftTop.x and leftTop.y are the horizontal and vertical coordinate values ​​of the upper left corner of the coin boundary, and rightBottom.x and rightBottom.y are the horizontal and vertical coordinate values ​​of the lower right corner of the coin boundary. For dx, calculate the maximum distance that the left and right sides of the coin can be expanded to, because the coin may be closer to the left or right side. The left side is calculated as leftTop.x-self.BestDistance, and the right side is 1-rightBottom.x-self.BestDistance. The calculated dx takes the smaller value of the two to ensure that it will not be enlarged beyond the optimal boundary. dy is calculated using the same principle.

[0058] Then the first zoom factor zoom1 calculated according to the size of the coin and the second zoom factor zoom2 calculated according to the position (boundary) of the coin are compared, and the smaller value is taken as the calculated zoom factor zoom. In some embodiments, when zoom<1.2 and zoom>0.7, the zoom value is set to 0, that is, no zoom processing is performed. Then the zoom processing is performed according to the calculation result of the zoom value.

[0059] In some embodiments, the entire shooting adjustment magnification can also be set to be limited between 1.6 and 3, that is, the default minimum magnification for shooting is 1.6 times (that is, when the shooting button is turned on to enter the shooting interface, it is already magnified 1.6 times by default). For example, if the zoom is set to 0 in the previous step, the magnification process is actually performed according to the default minimum magnification of 1.6, that is, the value of the basic magnification is calculated according to 1.6. If the zoom value calculated in the previous step is 2, the actual magnification is 1.6×2=3.2, which exceeds the set upper limit of the magnification of 3, so the magnification is limited to 3 for subsequent processing. In some embodiments, the lower limit of the magnification of 1.6 can be fixed (that is, when the zoom is less than 1, it is still magnified according to 1.6). In other embodiments, the limit on the lower limit of the magnification can also be lifted. For example, if the maximum screen-to-body ratio is 0.75, the process will start, 0.5 / 0.75=0.667, which means the viewfinder needs to be scaled down, 0.667×1.6=1.0672, which is basically scaled down to 1x, which is the minimum 1x focal length of the viewfinder. In addition, the magnification can be limited between 1 and 3, that is, the default is 1x focal length for normal shooting, and when the zoom is less than 1, it is still processed as 1x focal length, and when it exceeds the upper limit of zoom magnification, it is only processed according to the maximum value supported by the camera, such as 3x focal length.

[0060] Then, the process of judging whether the stability value is greater than or equal to 4 times is entered. If it is less than, the process 300 is returned to the beginning of the process, and the magnification of this time is calculated after a series of processes. For example, when the magnification calculated for the first time is 2, and the magnification calculated for the second focus is also 2, then the corresponding original magnification becomes 1.6×2=3.2 for the first time. The first time exceeds 3, and the second time is 3×2=6 times. At this time, the upper limit of 3 times is exceeded, and the actual magnification will be adjusted to the original 3. If the first time is 1 and the second time is 2, the first magnification is 1.6 times, and the second time is 2×1.6=3.2. At this time, the upper limit of 3 times is also exceeded, and the actual magnification will be adjusted to the original 3 times. When the stability value is greater than or equal to 4 times, the photo processing is performed (the magnification calculation and processing are required each time). Counting the 2 stability value determinations set previously, the entire process actually requires at least 8 times of stability. In some embodiments, light intensity detection is performed each time shooting, and the exposure EV value is automatically adjusted according to the light intensity. When the light intensity meets the shooting conditions, the coin is automatically photographed.

[0061] Figure 4The following is an exemplary flow chart of an operation method 400 of an electronic device for detecting coin attributes according to an embodiment of the present disclosure. In these embodiments, the operation method of an electronic device for detecting coin attributes includes: Step S410: obtaining a video stream through a shooting device of the electronic device (for example, the initial focal length can be set so that the displayed image in the shooting interface is magnified by 1.6 times by default), and displaying the shooting interface through the display device of the electronic device, and displaying the video stream in the shooting interface with a magnification corresponding to the shooting focal length of the shooting device; Step S420: displaying a frame in the shooting interface to indicate the target position range of the coin in the picture frame of the video stream, so that the user can try to include the coin in the frame by operating the electronic device; Step S430: placing the coin in the shooting interface; Step S440: displaying a frame in the shooting interface to indicate the target position range of the coin in the picture frame of the video stream, so that the user can try to include the coin in the frame by operating the electronic device; Step S450: placing the coin in the shooting interface; Step S460: displaying a frame in the shooting interface to indicate the target position range of the coin in the picture frame of the video stream; Step S470: displaying a frame in the shooting interface to indicate the target position range of the coin in the picture frame of the video stream; Step S480: displaying a frame in the shooting interface to indicate the target position range of the coin in the picture frame of the video stream, so that the user can try to include the coin in the frame by operating the electronic device; Step S490: placing the coin in the shooting interface; Step S411: displaying a frame in the shooting interface to indicate the target position range of the coin in the picture frame of the video stream; Step S491: displaying a frame in the shooting interface to indicate the target position range of the coin in the picture frame of the video stream; Step S492: displaying a frame in the shooting interface to indicate the target position range of the coin in the picture frame of the video stream The focus of the device photograph is aligned with the center of the frame. In the methods of these embodiments, the application can stabilize the focus at the center of the frame (for example, focusing on an object located at the center of the frame) without having to frequently detect the object and refocus; step S440: in response to receiving a specific operation via the operable area of ​​the electronic device, taking a first picture of the coin by the photographing device; step S450: prompting the user to turn the coin over by the display device, and in response to receiving a specific operation via the operable area, taking a second picture of the coin by the photographing device; and step S460: detecting the properties of the coin based on the first picture and the second picture.

[0062] It should be noted that the present disclosure does not limit the order in which the front and back sides of a coin are photographed. For example, the first picture may be a picture of the front side of the coin, and the second picture may be a picture of the back side of the coin; or the first picture may be a picture of the back side of the coin, and the second picture may be a picture of the front side of the coin. It should be noted that the "front side" or "back side" of a coin referred to herein does not distinguish between the actual front and back sides of the coin, but only refers to one side of the coin and the other side opposite to it (for the sake of simplicity in language). Figure 7 For example, the two images of coins shown in the figure are usually called the front side of the coin, and the side of the image on the left (the side with the person) is called the front side of the coin, and the side of the image on the right (the side with the building) is called the back side of the coin. Figure 7 The image on the left is called the front image of the coin, and the image on the right is called the back image of the coin; the image on the left can also be called the back image of the coin, and the image on the right is called the front image of the coin.

[0063] FIG. 8A to FIG. 8H The following is a schematic diagram of a shooting interface in an operation method of an electronic device for detecting coin attributes according to an embodiment of the present disclosure. The shooting interface is displayed by a display device of the electronic device and a video stream acquired by the shooting device is displayed in the shooting interface. As shown in the figure, a frame is displayed in the shooting interface to indicate the target position range of the coin in the picture frame of the video stream. The frame can be as follows: Fig.8DThe rectangular frame shown in the figure may also be a circular frame as shown in other figures. A cross mark may be used to indicate the position of the focus of the auto focus, for example Fig. 8A Or as shown in 8C, indicating that the position of the focus of the auto focus is at the center of the frame. The current magnification can also be displayed in the shooting interface, such as FIG. 8B to FIG. 8H The magnification indicator bar at the lower right corner of the shooting interface. When shooting starts, you can use text to remind the user to shoot the front side of the coin first and then the back side of the coin (or vice versa), or remind the user to shoot both sides of the coin, such as Fig. 8A and Figure 8C As shown; you can also use text to simply prompt the user to put the coin in the frame for focusing and shooting, such as Figure 8B When the coin in the video frame is unclear or too large / small, text may be displayed to prompt the user to perform corresponding operations, such as prompting the user to move the camera to focus (such as Fig. 8E ), or prompt the user to move closer to the camera (as shown Figure 8F When the position and size of the coin in the video frame meet the conditions for the photographed picture, the user can be prompted with text that the photo can be taken at this time, such as Figure 8G As shown. The user can take a picture of the coin by operating the shooting button area below the shooting interface (and / or pressing the physical shooting button of the electronic device). In some embodiments, the operation of the shooting button area and / or the operation of the physical shooting button can be unlocked only when the shooting conditions are met, that is, the shooting button area and / or the physical shooting button can be operated to take a picture only when the position and size of the coin in the video frame meet the conditions for the picture to be taken. After completing the picture shooting of the first side of the coin, the user can be prompted in the shooting interface to turn the coin over, such as Figure 8H shown.

[0064] Fig. 9 Schematically illustrates at least a portion of an electronic device 500 for detecting coin attributes according to an embodiment of the present disclosure. The electronic device 500 includes one or more processors 510, one or more memories 520, and other components (not shown) that are generally present in a computer or the like. Each of the one or more memories 520 can store content that can be accessed by the one or more processors 510, including instructions 521 that can be executed by the one or more processors 510, and data 522 that can be retrieved, manipulated, or stored by the one or more processors 510.

[0065] Instructions 521 may be any set of instructions to be executed directly by one or more processors 510, such as machine code, or any set of instructions to be executed indirectly, such as a script. The terms "instructions," "application," "process," "step," and "program" in this disclosure may be used interchangeably in this disclosure. Instructions 521 may be stored in an object code format for direct processing by one or more processors 510, or as a script or collection of independent source code modules in any other computer language, including those interpreted on demand or compiled in advance. Instructions 521 may include instructions that cause one or more processors 510, such as to act as the various neural networks in this disclosure. Other portions of this disclosure explain the functions, methods, and routines of instructions 521 in more detail.

[0066] The one or more memories 520 may be any temporary or non-temporary computer-readable storage medium capable of storing content accessible by the one or more processors 510, such as a hard drive, a memory card, a ROM, a RAM, a DVD, a CD, a USB memory, a writable memory, and a read-only memory, etc. One or more of the one or more memories 520 may include a distributed storage system, in which instructions 521 and / or data 522 may be stored on a plurality of different storage devices that may be physically located at the same or different geographical locations. One or more of the one or more memories 520 may be connected to the one or more first devices 510 via a network, and / or may be directly connected to or incorporated into any one of the one or more processors 510.

[0067] One or more processors 510 may retrieve, store, or modify data 522 in accordance with instructions 521. Although the subject matter described in the present disclosure is not limited to any particular data structure, data 522 may also be stored in a computer register (not shown), as a table or XML document with many different fields and records, stored in a relational database. Data 522 may be formatted in any computing device readable format, such as, but not limited to, binary values, ASCII, or Unicode. In addition, data 522 may include any information sufficient to identify the relevant information, such as a number, descriptive text, proprietary code, pointer, reference to data stored in other storage such as other network locations, or information used by a function to calculate the relevant data.

[0068] The one or more processors 510 may be any conventional processor, such as a commercially available central processing unit (CPU), a graphics processing unit (GPU), etc. Alternatively, the one or more processors 510 may also be a dedicated component, such as an application specific integrated circuit (ASIC) or other hardware-based processor. Although not required, the one or more processors 510 may include specialized hardware components to perform specific computing processes faster or more efficiently, such as image processing of picture frames of a video stream.

[0069] Although Fig. 9 Schematically, one or more processors 510 and one or more memories 520 are shown in the same box, but the electronic device 500 may actually include multiple processors or memories that may exist in the same physical housing or in different physical housings. For example, any of the one or more memories 520 may be a hard drive or other storage medium located in a respective housing. Therefore, references to processors, computers, computing devices, or memories should be understood to include references to a collection of processors, computers, computing devices, or memories that may or may not operate in parallel.

[0070] Fig.10 is an exemplary block diagram of a general hardware system 600 applicable according to an embodiment of the present disclosure. Fig.10 Describe system 600, which is an example of a hardware device that can be applied to various aspects of the present disclosure. Electronic device 500 may include all or part of system 600. System 600 may be any machine configured to perform processing and / or computing, and may be, but is not limited to, a workstation, a server, a desktop computer, a laptop computer, a tablet computer, a personal data assistant, a smart phone, a car computer, or any combination thereof.

[0071] The system 600 may include elements that may be connected to or communicate with the bus 602 via one or more interfaces. For example, the system 600 may include the bus 602, as well as one or more processors 604, one or more input devices 606, and one or more output devices 608. The one or more processors 604 may be any type of processor, and may include but is not limited to one or more general-purpose processors and / or one or more special-purpose processors (e.g., special processing chips). Each process, operation, and / or step in the method described above may be implemented by executing instructions by one or more processors 604.

[0072] Input device 606 may be any type of device that can input information to a computing device, including but not limited to a webcam, a mouse, a keyboard, a touch screen, a microphone, and / or a remote control. Output device 608 may be any type of device that can present information, including but not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer.

[0073] The system 600 may also include or be connected to a non-transitory storage device 610. The non-transitory storage device 610 may be any storage device that is non-transitory and can implement data storage, and may include but is not limited to a disk drive, an optical storage device, a solid-state memory, a floppy disk, a hard disk, a tape or any other magnetic medium, an optical disk or any other optical medium, a ROM (read-only memory), a RAM (random access memory), a cache memory, and / or any other memory chip / chipset, and / or any other medium from which a computer can read data, instructions, and / or code. The non-transitory storage device 610 may be detachable from the interface. The non-transitory storage device 610 may have data / instructions / code for implementing the above methods, operations, steps, and processes.

[0074] The system 600 may also include a communication device 612. The communication device 612 may be any type of device or system capable of communicating with an external device and / or with a network, and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication device, and / or a chipset, such as a Bluetooth device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication device, a satellite communication device, and / or the like.

[0075] The bus 602 may include, but is not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Enhanced ISA (EISA) bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus. In particular, for vehicle-mounted devices, the bus 602 may also include a Controller Area Network (CAN) bus or other architectures designed for use in vehicles.

[0076] The system 600 may also include a working memory 614 , which may be any type of working memory that may store instructions and / or data useful for the operation of the processor 604 , and may include, but is not limited to, random access memory and / or read-only storage devices.

[0077] Software elements may be located in the working memory 614, including but not limited to an operating system 616, one or more application programs 618, drivers, and / or other data and code. Instructions for performing the above methods, processes, operations, and steps may be included in one or more application programs 618. The executable code or source code of the instructions of the software elements may be stored in a non-transitory computer-readable storage medium, such as the storage device 610 described above, and may be read into the working memory 614 by compilation and / or installation. The executable code or source code of the instructions of the software elements may also be downloaded from a remote location.

[0078] It should also be understood that changes can be made according to specific requirements. For example, custom hardware can also be used, and / or specific elements can be implemented with hardware, software, firmware, middleware, microcode, hardware description language or any combination thereof. In addition, connections with other computing devices such as network input / output devices can be adopted. For example, some or all of the methods or devices according to the embodiments of the present disclosure can be implemented by using programming hardware (for example, including a field programmable gate array (FPGA) and / or a programmable logic array (PLA)) in assembly language or hardware programming language (such as VERILOG, VHDL, C++) according to the logic and algorithm of the present disclosure.

[0079] It should also be understood that the components of system 600 can be distributed over a network. For example, some processing can be performed using one processor, while other processing can be performed by another processor remote from the one processor. Other components of system 600 can also be similarly distributed. In this way, system 600 can be interpreted as a distributed computing system that performs processing at multiple locations.

[0080] In addition, the embodiments of the present disclosure may also include the following examples:

[0081] 1. A method for operating an electronic device for detecting coin attributes, comprising:

[0082] Obtaining a video stream through a shooting device of the electronic device, and displaying a shooting interface through a display device of the electronic device;

[0083] performing an image detection process so that the coins detected in the picture frames of the video stream meet the conditions of the captured picture;

[0084] Once the coin detected in the picture frame meets the conditions for being photographed, the photographing device is automatically triggered to photograph a first picture of the coin or prompt the user to photograph the first picture, and in response to the first picture being photographed, the display device of the electronic device prompts the user to turn the coin over;

[0085] Execute the image detection process again;

[0086] Once the coin detected in the picture frame meets the conditions for being photographed, automatically triggering the photographing device to take a second picture of the coin or prompting the user to take a second picture; and

[0087] In response to the second picture being taken, the properties of the coin are detected based on the first picture and the second picture.

[0088] 2. The method according to 1, wherein the image detection process comprises:

[0089] detecting the position and size of the coin in the picture frame and indicating the boundaries of the coin in the photographing interface during the image detection process;

[0090] In response to the position of the coin in the picture frame not being within the target position range, prompting the user to move the coin to the target position range through the display device;

[0091] In response to the size of the coin in the picture frame not being within the target size range, physically zooming the camera to make the size of the coin in the picture frame closer to the target size range;

[0092] In response to the physical zoom failing to make the size of the coin in the picture frame within the target size range, prompting the user through the display device to move the camera closer to or further away from the coin; and

[0093] In response to the position of the coin in the picture frame being within the target position range and the size of the coin in the picture frame being within the target size range, the image detection process is terminated, otherwise the image detection process is repeatedly executed.

[0094] 3. The method according to item 1, further comprising:

[0095] When the camera is initially turned on to obtain a video stream, the camera is set to shoot at an initial focal length, where the initial focal length is greater than 1; and

[0096] The video stream is displayed in the shooting interface at a magnification corresponding to the focal length of the shooting device.

[0097] 4. The method according to 2, wherein the boundary of the coin is indicated by displaying a frame that at least partially surrounds the coin in the shooting interface, and the frame includes all or one or more parts of any one of a circular frame, a square rectangular frame, and a rounded rectangular frame.

[0098] 5. The method according to 2, wherein whether the position of the coin in the picture frame is within the target position range is determined by judging whether the distance between the boundary of the coin in the shooting interface and the boundary of the shooting interface is less than a boundary distance threshold.

[0099] 6. The method according to 5, wherein the following process is performed to determine whether the distance between the boundary of the coin and the boundary of the shooting interface in the shooting interface is less than the boundary distance threshold:

[0100] Calculating a first ratio of a distance between a left edge of the coin and a left edge of the shooting interface to a lateral dimension of the shooting interface;

[0101] Calculating a second ratio of a distance between a right edge of the coin and a right edge of the shooting interface to a lateral dimension of the shooting interface;

[0102] calculating a third ratio of a distance from an upper boundary of the coin to an upper boundary of the shooting interface in the shooting interface to a longitudinal dimension of the shooting interface;

[0103] calculating a fourth ratio of a distance from a lower boundary of the coin to a lower boundary of the shooting interface to a longitudinal dimension of the shooting interface;

[0104] In response to the first ratio being not greater than the first proportion, the second ratio being not greater than the second proportion, the third ratio being not greater than the third proportion, and the fourth ratio being not greater than the fourth proportion, it is judged that the distance between the boundary of the coin in the shooting interface and the boundary of the shooting interface is less than the boundary distance threshold.

[0105] 7. The method according to 2, wherein whether the size of the coin in the picture frame is within the target size range is determined by judging whether the screen ratio calculated in the following manner is within the target screen ratio range:

[0106] The ratio of the lateral dimension of the border of the coin in the photographing interface to the lateral dimension of the photographing interface;

[0107] The ratio of the longitudinal dimension of the border of the coin in the photographing interface to the longitudinal dimension of the photographing interface; or

[0108] The ratio of the area of ​​the coin enclosed by the border in the shooting interface to the area of ​​the shooting interface.

[0109] 8. The method according to 2, wherein the magnification of the physical zoom or the reduction is calculated based on the boundary of the coin indicated in the shooting interface, the target position range and the target size range.

[0110] 9. The method according to 2, wherein the image detection process further comprises:

[0111] In response to the position of the coin in the picture frame being within the target position range and the size of the coin in the picture frame being within the target size range, determining a clarity of the coin in the picture frame;

[0112] In response to the position of the coin in the picture frame being within the target position range, the size of the coin in the picture frame being within the target size range and the clarity meeting the conditions, the image detection process is terminated, otherwise the image detection process is repeatedly executed.

[0113] 10. The method according to item 1, further comprising:

[0114] Before taking the first picture or the second picture of the coin, performing light intensity detection on the coin in the picture frame, and adjusting the exposure value according to the detected light intensity;

[0115] In response to the light intensity of the coin in the picture frame satisfying a condition, the first picture or the second picture of the coin is taken by the photographing device.

[0116] 11. The method according to item 1, wherein the user is prompted to turn the coin over by covering the shooting interface with a mask.

[0117] 12. The method according to 1 further comprises during the execution of the image detection process:

[0118] providing an operable area by the electronic device; and

[0119] In response to receiving a specific operation via the operable area, a picture is taken by the photographing device.

[0120] 13. The method according to 2, wherein the image detection process further comprises:

[0121] In response to the detected change in the boundary of the coin, determining whether the focus of the camera is within the boundary of the coin;

[0122] In response to the focus of the camera being not within the border of the coin, the camera is focused on the center of the portion surrounded by the border of the coin.

[0123] 14. The method according to 1, wherein the image detection process further comprises:

[0124] In response to the detected coin boundary change, determining whether the distance between the center of the portion surrounded by the boundary of the coin detected this time and the center of the portion surrounded by the boundary of the coin detected last time is less than a center distance threshold;

[0125] In response to the distance being not less than a center distance threshold, initializing the stable value to an initial stable value; and in response to the distance being less than a threshold, incrementing the stable value;

[0126] In response to the position of the coin in the picture frame being within the target position range, the size of the coin in the picture frame being within the target size range and the stable value being greater than a threshold, the image detection process is terminated, otherwise the image detection process is repeatedly executed.

[0127] 15. The method according to 14, wherein whether the distance is less than a threshold is determined by determining whether a ratio of the distance to a diagonal length of a shooting interface is less than a center distance threshold.

[0128] 16. A method for operating an electronic device for detecting a coin attribute, comprising:

[0129] Obtaining a video stream through a shooting device of the electronic device, and displaying a shooting interface through a display device of the electronic device;

[0130] An image detection process is performed so that the coins detected in the picture frame of the video stream meet the conditions of the captured picture, the image detection process comprising:

[0131] Detect the position and size of the coin in the image frame;

[0132] In response to the size of the coin in the picture frame not being within the target size range, prompting the user through the display device to move the camera closer to or further away from the coin;

[0133] In response to the position of the coin in the picture frame not being within the target position range, prompting the user to move the coin to the target position range through the display device, and initializing the stability value to an initial stability value;

[0134] In response to the focus of the camera not being within the border of the coin, focusing the camera on the center of the portion surrounded by the border of the coin;

[0135] In response to the distance between the center of the portion surrounded by the boundary of the coin detected this time and the center of the portion surrounded by the boundary of the coin detected last time being not less than the center distance threshold, the stability value is initialized to the initial stability value, and the image detection process is repeated; in response to the distance being less than the center distance threshold, the stability value is incremented;

[0136] In response to the stability value not being greater than the first stability threshold, returning to repeatedly execute the image detection process; in response to the stability value being greater than the first stability threshold, determining and adjusting the zoom factor and incrementing the stability value;

[0137] In response to the stability value being not greater than a second stability threshold value greater than the first stability threshold value, adjusting the focus to refocus on the center of the detected coin, and returning to repeatedly perform the image detection process; in response to the stability value being greater than the second stability threshold value, ending the image detection process;

[0138] Once the coin detected in the picture frame meets the conditions for being photographed, the photographing device is automatically triggered to photograph a first picture of the coin or prompt the user to photograph the first picture, and in response to the first picture being photographed, the display device of the electronic device prompts the user to turn the coin over;

[0139] executing the image detection process again; and

[0140] Once the coin detected in the picture frame meets the conditions for the picture to be taken, the shooting device is automatically triggered to take a second picture of the coin or prompt the user to take a second picture, and in response to the second picture being taken, the properties of the coin are detected based on the first picture and the second picture.

[0141] 17. A method for operating an electronic device for detecting a coin attribute, comprising:

[0142] Obtaining a video stream through a shooting device of the electronic device, and displaying a shooting interface through a display device of the electronic device, and displaying the video stream in the shooting interface at a magnification corresponding to the shooting focal length of the shooting device;

[0143] Displaying a box in the shooting interface to indicate the target position range of the coin in the picture frame of the video stream;

[0144] Aligning the focus of the image captured by the camera to the center of the frame;

[0145] In response to receiving a specific operation via the operable area of ​​the electronic device, taking a first picture of the coin by the photographing device;

[0146] prompting the user to turn over the coin through the display device, and in response to receiving a specific operation through the operable area, taking a second picture of the coin through the photographing device; and

[0147] The properties of the coin are detected based on the first image and the second image.

[0148] 18. An electronic device for detecting a coin attribute, comprising:

[0149] one or more processors; and

[0150] one or more memories configured to store a series of computer-executable instructions,

[0151] Wherein, when the series of computer-executable instructions are executed by the one or more processors, the one or more processors are caused to perform the method as described in any one of 1-17.

[0152] 19. A non-temporary computer-readable storage medium, characterized in that a series of computer-executable instructions are stored on the non-temporary computer-readable storage medium, and when the series of computer-executable instructions are executed by one or more computing devices, the one or more computing devices perform the method described in any one of 1-17.

[0153] Although various aspects of the present disclosure have been described so far with reference to the accompanying drawings, the above-described methods, systems, and devices are merely illustrative examples, and the scope of the present disclosure is not limited by these aspects, but only by the following aspects: the attached claims and their equivalents. Various elements may be omitted or replaced with equivalent elements. In addition, the steps may be performed in an order different from the order described in the present disclosure. In addition, various elements may be combined in various ways. It is also important to note that as technology develops, many of the elements described may be replaced by equivalent elements that appear after the present disclosure.

Claims

1. A method for operating an electronic device for detecting coin attributes, comprising: Obtaining a video stream through a shooting device of the electronic device, and displaying a shooting interface through a display device of the electronic device; performing an image detection process so that the coins detected in the picture frames of the video stream meet the conditions of the captured picture; Once the coin detected in the picture frame meets the conditions for being photographed, the photographing device is automatically triggered to photograph a first picture of the coin or prompt the user to photograph the first picture, and in response to the first picture being photographed, the display device of the electronic device prompts the user to turn the coin over; Execute the image detection process again; Once the coin detected in the picture frame meets the conditions for being photographed, the photographing device is automatically triggered to take a second picture of the coin or the user is prompted to take a second picture; as well as In response to the second picture being taken, the properties of the coin are detected based on the first picture and the second picture.

2. The method according to claim 1, wherein: The image detection process includes: detecting the position and size of the coin in the picture frame and indicating the boundaries of the coin in the photographing interface during the image detection process; In response to the position of the coin in the picture frame not being within the target position range, prompting the user to move the coin to the target position range through the display device; In response to the size of the coin in the picture frame not being within the target size range, physically zooming the camera to make the size of the coin in the picture frame closer to the target size range; In response to the physical zoom failing to make the size of the coin in the picture frame within the target size range, prompting the user through the display device to move the camera closer to or further away from the coin; and In response to the position of the coin in the picture frame being within the target position range and the size of the coin in the picture frame being within the target size range, the image detection process is terminated, otherwise the image detection process is repeatedly executed.

3. The method according to claim 1, further comprising: When the camera is initially turned on to obtain a video stream, the camera is set to shoot at an initial focal length, where the initial focal length is greater than 1; as well as The video stream is displayed in the shooting interface at a magnification corresponding to the focal length of the shooting device.

4. The method according to claim 2, wherein: The boundary of the coin is indicated by displaying a frame at least partially surrounding the coin in the photographing interface, wherein the frame includes all or one or more parts of any one of a circular frame, a square rectangular frame, and a rounded rectangular frame.

5. The method according to claim 2, wherein: Whether the position of the coin in the picture frame is within the target position range is determined by judging whether the distance between the boundary of the coin in the shooting interface and the boundary of the shooting interface is less than a boundary distance threshold.

6. The method according to claim 5, wherein: The following process is performed to determine whether the distance between the boundary of the coin and the boundary of the shooting interface is less than the boundary distance threshold: Calculating a first ratio of a distance between a left edge of the coin and a left edge of the shooting interface to a lateral dimension of the shooting interface; Calculating a second ratio of a distance between a right edge of the coin and a right edge of the shooting interface to a lateral dimension of the shooting interface; Calculating a third ratio of a distance from an upper boundary of the coin to an upper boundary of the shooting interface to a longitudinal dimension of the shooting interface; calculating a fourth ratio of a distance from a lower boundary of the coin to a lower boundary of the shooting interface to a longitudinal dimension of the shooting interface; In response to the first ratio being not greater than the first proportion, the second ratio being not greater than the second proportion, the third ratio being not greater than the third proportion, and the fourth ratio being not greater than the fourth proportion, it is judged that the distance between the boundary of the coin in the shooting interface and the boundary of the shooting interface is less than the boundary distance threshold.

7. The method according to claim 2, wherein: Whether the size of the coin in the picture frame is within the target size range is determined by judging whether the screen ratio calculated as follows is within the target screen ratio range: The ratio of the lateral dimension of the border of the coin in the photographing interface to the lateral dimension of the photographing interface; The ratio of the longitudinal dimension of the border of the coin in the photographing interface to the longitudinal dimension of the photographing interface; or The ratio of the area of ​​the coin enclosed by the border in the shooting interface to the area of ​​the shooting interface.

8. The method according to claim 2, wherein: The magnification or reduction factor of the physical zoom is calculated based on the boundary of the coin indicated in the shooting interface, the target position range, and the target size range.

9. The method according to claim 2, wherein: The image detection process also includes: In response to the position of the coin in the picture frame being within the target position range and the size of the coin in the picture frame being within the target size range, determining a clarity of the coin in the picture frame; In response to the position of the coin in the picture frame being within the target position range, the size of the coin in the picture frame being within the target size range and the clarity meeting the conditions, the image detection process is terminated, otherwise the image detection process is repeatedly executed.

10. The method according to claim 1, wherein: Also includes: Before taking the first picture or the second picture of the coin, performing light intensity detection on the coin in the picture frame, and adjusting the exposure value according to the detected light intensity; In response to the light intensity of the coin in the picture frame satisfying a condition, the first picture or the second picture of the coin is taken by the photographing device.