Image shooting method and device

By dynamically configuring the scaling ratio and zoom display within the depth of field, the problem of users struggling to capture high-quality images is solved, and the sharpness is improved during target lens pose adjustment. It is suitable for scenarios such as anti-counterfeiting verification, industrial product defect detection, and artwork copyright registration.

CN118945468APending Publication Date: 2024-11-12ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410926107.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-11
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In existing technologies, users often struggle to capture high-quality images, especially when close-up shots of specific objects are required due to insufficient image clarity.

Method used

By acquiring the first zoom level within the depth of field of the target lens, the zoom level is dynamically configured and displayed at a zoom level after shooting to guide the user to adjust the lens pose and ensure image sharpness.

Benefits of technology

It improves image clarity, enabling users to capture clearer images within the depth of field, meeting the needs of technical scenarios such as anti-counterfeiting verification, industrial product defect detection, and artwork copyright registration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118945468A_ABST
    Figure CN118945468A_ABST
Patent Text Reader

Abstract

The invention discloses an image shooting method and device. The method is executed by terminal equipment configured with a target lens. The method comprises the following steps: acquiring a first scaling which is a first ratio of a first image size of an expected first object to a second image size, and the second image size is an image size of an image of the first object shot by using a target lens at a first shooting distance, the first shooting distance is within the depth-of-field range of the target lens; shooting the first object by using the target lens to obtain a shot image; and performing zoom display on the shot image based on the first zoom scale.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application with application number 202311016196.9 filed on August 11, 2023 and application name “Image capture method and device”. Technical Field

[0002] The embodiments of the present specification belong to the field of image processing technology, and more particularly, to an image capturing method and device. Background Art

[0003] In some technical scenarios, users are required to use the camera configured on their terminal devices to take pictures of selected objects to obtain corresponding images, so as to use the images to support the implementation of predetermined transactions. For example, in a technical scenario involving anti-counterfeiting and authenticity verification of products, users are required to take pictures of specific marks on the outer packaging of the products to be verified, and the server side recognizes and processes the images of the specific marks, thereby determining the authenticity of the corresponding products based on the images of the specific marks.

[0004] It is hoped that a new solution can be provided to help guide users to take high-quality images of selected objects. Summary of the invention

[0005] The object of the present invention is to provide an image capturing method and device.

[0006] In a first aspect, an image shooting method is provided, which is executed by a terminal device equipped with a target lens, and the method includes: obtaining a first zoom ratio, where the first zoom ratio is a first ratio of a first image size of a desired first object to a second image size, where the second image size is an image size of an image of the first object shot at a first shooting distance using the target lens, and the first shooting distance is within the depth of field of the target lens; shooting the first object using the target lens to obtain a shot image; and scaling and displaying the shot image based on the first zoom ratio.

[0007] In a second aspect, an image capturing apparatus is provided, which is deployed in a terminal device equipped with a target lens, and the apparatus includes: a ratio determination unit, configured to obtain a first zoom ratio, wherein the first zoom ratio is a first ratio of a first image size of a desired first object to a second image size, and the second image size is an image size of an image of the first object captured at a first shooting distance using the target lens, and the first shooting distance is within the depth of field of the target lens; an image acquisition unit, configured to capture the first object using the target lens to obtain a captured image; and a zoom display unit, configured to zoom and display the captured image based on the first zoom ratio.

[0008] In a third aspect, a computer-readable storage medium is provided, on which a computer program / instruction is stored. When the computer program / instruction is executed in a terminal device, the terminal device executes the method described in the first aspect.

[0009] In a fourth aspect, a terminal device is provided, including a target lens, a memory and a processor, wherein the memory stores executable code / instructions, and when the processor executes the executable code / instructions, the method described in the first aspect is implemented.

[0010] In the technical solution provided by the embodiment of this specification, when it is necessary to use the target lens in the terminal device to shoot the first object, the first zoom ratio is dynamically configured based on the expected first image size of the first object and the second image size of the image of the first object shot by the target lens at the first shooting distance, wherein the first shooting distance is within the depth of field of the target lens; after shooting the first object by the target lens to obtain the corresponding shot image, the shot image is zoomed and displayed according to the dynamically configured first zoom ratio. In this way, it is more conducive to guiding the user to adjust the position of the target lens according to the image display effect of the first object, so that the target lens shoots the first object near the first shooting distance, and shoots a clearer and better image of the first object. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0012] Figure 1 A flowchart of an image capturing method provided in an embodiment of this specification;

[0013] Figure 2 A schematic diagram of a process of obtaining a first scaling ratio is provided as an example;

[0014] Figure 3 One of the schematic diagrams of the relationship between the field of view of the target lens and the captured image provided as an example;

[0015] Figure 4 The second schematic diagram of the relationship between the field of view of the target lens and the captured image is provided as an example;

[0016] Figure 5 A schematic diagram of a process of zooming and displaying a captured image is provided as an example;

[0017] Figure 6A schematic diagram showing the relationship between a captured image and a preview image provided as an example;

[0018] Figure 7 A schematic diagram showing the relationship between the preview image and the preview interface provided as an example;

[0019] Figure 8 A schematic diagram for exemplarily selecting an image for implementing a predetermined task and assisting in adjusting the target lens position;

[0020] Fig. 9 The figure is a schematic diagram of the structure of an image capturing device provided in an embodiment of the present specification. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.

[0022] The camera in the terminal device is usually equipped with one or more lenses (cameras) with fixed focal lengths. When a lens with a fixed focal length is used to shoot a selected object, the corresponding captured image includes the image of the selected object. The clarity / presentation effect of the image of the selected object in the captured image is determined by the frame ratio of the image of the selected object in the captured image, and the frame ratio is jointly determined by the minimum focusing distance and focal length of the lens.

[0023] When a certain lens is used to shoot a selected object, if the selected object is within the focus range / depth of field range of the lens, the selected object can be clearly presented in the corresponding captured image; if the selected object is outside the focus range of the lens, the image of the selected object will become blurred or blurred in the corresponding captured image, that is, the selected object cannot be clearly presented in the corresponding captured image. In other words, the aforementioned focus range refers to the depth of field (i.e., camera depth of field) corresponding to the lens used to shoot the selected object, wherein the camera depth of field includes the foreground depth of field and the background depth of field; the foreground depth of field corresponds to the closest focusing distance of the lens, and the background depth of field corresponds to the farthest focusing distance of the lens. Generally speaking, the farthest focusing distance of the lens is relatively large, so when a certain lens is used to shoot a selected object at a close distance, in the process of the lens approaching the selected object from a relatively far distance, the closer the shooting distance between the lens and the selected object is to the closest focusing distance of the lens, the better the presentation effect of the selected object in the captured image, until the shooting distance is less than the closest focusing distance of the lens, the selected object will no longer be clearly presented in the captured image.

[0024] In addition to the technical scenarios involving anti-counterfeiting and authentication of products in the aforementioned examples, other technical scenarios such as industrial product defect detection, commodity quality inspection, and artwork copyright registration may require users to adjust the posture of a target lens configured on their camera by adjusting the posture of the terminal device, so as to use the target lens to take close-up photos of relevant selected objects.

[0025] In the embodiments of the present specification, an image shooting method and device are provided. When it is necessary to shoot a first object (i.e., a selected object) using a target lens in a terminal device, a first zoom ratio (i.e., a digital zoom ratio) corresponding to the first object is dynamically configured based on the desired first image size of the first object and the second image size of the image of the first object shot by the target lens at a first shooting distance, wherein the first shooting distance is within the depth of field of the target lens; after shooting the first object through the target lens to obtain a corresponding shot image, the shot image is zoomed and displayed according to the dynamically configured first zoom ratio. In this way, it is more conducive to guiding the user to adjust the position of the target lens according to the image display effect of the first object, so that the target lens shoots the first object near the first shooting distance, thereby shooting a clearer image of the first object.

[0026] Figure 1 This is a flow chart of an image capturing method provided in an embodiment of this specification. The method can be executed by a terminal device, which can be a portable mobile device such as a mobile phone, a tablet computer, a smart watch or smart glasses. The terminal device is configured with a camera, which can be configured with one or more lenses.

[0027] See also Figure 1As shown, the method may include but is not limited to the following steps S101 to S109.

[0028] Step S101, obtaining a first zoom ratio, wherein the first zoom ratio is a first ratio of a desired first image size of a first object to a second image size, the second image size being an image size of an image of the first object captured at a first shooting distance using a target lens, and the first shooting distance is within a depth of field range of the target lens.

[0029] The target lens is one of the lenses configured in the terminal device.

[0030] The execution of the method may rely on an application program in the terminal device that allows the use of the target lens, is provided by a corresponding service provider, and is expected to be used to implement certain predetermined transactions (hereinafter referred to as APP_A). When APP_A is initialized, it may first obtain the lens model of one or more lenses of the camera configured by the terminal device through a remote procedure call, a system call to the operating system of the terminal device, or other possible data query methods, and store them.

[0031] The first object to be photographed may be a selected object that needs to be photographed at close range in technical scenarios such as product anti-counterfeiting verification, industrial product defect detection, commodity quality inspection, and artwork copyright registration. Taking the technical scenario of product anti-counterfeiting verification as an example, the type of the first object to be photographed may include, but is not limited to, various possible signs such as a QR code, barcode, laser label, or product logo set on the product outer packaging.

[0032] The image size may be a pixel size or a physical size. Given that the outline of the first object to be photographed may generally be approximately square or rectangular in appearance, the image size of the image may be represented by the number of pixels or the physical length corresponding to the longer side or the shorter side of a certain image. For example, for an image whose number of pixels or the physical length of the longer side is l and whose number of pixels or the physical length of the shorter side is w, its image size may be represented by l or w.

[0033] See also Figure 2 As shown, in a possible implementation, the first scaling ratio k corresponding to the first object can be obtained by part or all of the following steps S1011 to S1017. 1 .

[0034] Step S1011, obtaining lens selection information and object selection information, wherein the lens selection information is used to indicate a target lens to be used, and the object selection information is used to indicate a first object to be photographed.

[0035] Exemplarily, APP_A can provide a corresponding graphical user interface to the user, and the user can provide lens selection information and object selection information to the terminal device through the graphical user interface; the object selection information may, for example, include but is not limited to the type to which the first object belongs, and the lens selection information may, for example, include but is not limited to one of the various lens models stored in APP_A.

[0036] Step S1013: acquiring a second ratio according to the lens selection information, where the second ratio is a ratio of an image size of an image of a second object captured by the target lens at a first shooting distance to a physical size of the second object.

[0037] The second object may be the same as or different from the first object.

[0038] The first shooting distance is not less than the closest focusing distance of the target lens, and not greater than the farthest focusing distance of the target lens. In the process of using the target lens to shoot the selected object at a close distance, the first shooting distance can usually be set to the closest focusing distance of the target lens, or to a preset value close to the closest focusing distance.

[0039] The target lens may be calibrated in advance to obtain the accuracy of photographing the first object / the second object at the first shooting distance using the target lens. The accuracy refers to the size of the physical area that can be represented by each pixel at the first shooting distance.

[0040] See also Figure 3 As shown, the physical length of the longer side of the second object is recorded as x h1 , the physical length of the shorter side is x w1 ; The physical length of the longer side of the field of view of the target lens at the first shooting distance is recorded as y h1 , the physical length of the shorter side is denoted as y w1 When the second object is photographed at the first shooting distance using the target lens, the number of pixels on the longer side of the corresponding image (hereinafter referred to as the focused image) is recorded as y h2 The number of pixels on the shorter side is y w2 ; The number of pixels of the longer side of the image / image area of ​​the second object in the focused image is recorded as x h2 The number of pixels on the shorter side is x w2 .

[0041] When the target lens is limited to shoot the second object at the first shooting distance, the closer the center of the second object is to the center of the field of view, the closer the center of the focused image is to the center of the image of the second object, and the better the imaging effect of the second object; in an ideal case, the center of the second object coincides with the center of the field of view, and the center of the focused image coincides with the center of the image of the second object, and the second object can obtain a better imaging effect. When the second object obtains a better imaging effect, y h1 With y h2 The ratio of is the accuracy of the target lens at the first shooting distance, and the second ratio P is the reciprocal of the accuracy, which is equal to y h2 With y h1 The ratio of h1 With y h2 The ratio is the same as y w1 With y w2 The ratio of x h1 With x h2 The ratio of x w1 With x w2 Therefore, when obtaining the second ratio P by performing experimental measurement or standard target calibration in advance, it is actually only necessary to obtain y h1 With y h2 ,y w1 With y w2 、x h1 With x h2 、x w1 With x w2 The second ratio P can be calculated using any of the four sets of data.

[0042] For example, Figure 2 In the process shown, APP_A can, for example, obtain the lens model of the target lens according to the lens selection information, and query the second ratio P stored in association with the lens model of the target lens locally or through a remote process call.

[0043] Step S1015: acquiring a physical size and a first image size of the first object according to the object selection information.

[0044] The desired first image size may be preset based on technical requirements. For example, the physical length of the longer side of the first object is denoted by x. h3 , the physical length of the shorter side is x w3 ; You can set the expected number of pixels on the longer side to x h4 , the number of pixels on the shorter side is x w4 ; where x h3 With x h4 The ratio is equal to x w3 With x w4 ratio.

[0045] Exemplarily, APP_A may obtain the type of the first object according to the object selection information, and then query the physical size and the first image size of the first object stored in association with the type of the first object locally or through a remote procedure call.

[0046] Step S1017: Calculate a first scaling ratio according to the second ratio, the physical size of the first object and the size of the first image.

[0047] The first scaling factor k 1 The value of can be, for example, x h4 / (x h3 *P) or x w4 / (x w3 *P). Figure 3 As well as the previous Figure 3 The corresponding text description can be understood that the second image size is equal to x h3 *P or x w3 *P.

[0048] In a possible implementation, at least one zoom ratio corresponding to at least one preset object of the target lens is pre-stored in the terminal device, and the at least one preset object includes the first object. Accordingly, after determining that the selected object to be photographed is the first object, the first zoom ratio k corresponding to the first object can be queried from the at least one zoom ratio. 1 .

[0049] In the various embodiments described above, the first object can be determined not only based on the object selection information provided by the user, but also after at least one captured image of the first object is captured by the target lens, the captured image can be recognized by a corresponding image recognition algorithm, thereby determining that the selected object to be photographed is the first object.

[0050] The first scaling ratio k described in the above various embodiments is obtained 1 The process is exemplary, and it is understandable that the first scaling ratio k can also be obtained by other methods. 1 For example, refer to Figure 3 As well as the previous Figure 3 The corresponding text description can be obtained through similar experimental measurement or standard target calibration to obtain the number of pixels x on the longer side of the first object when a relatively good imaging effect is obtained. h3 *P or the number of pixels on the shorter side x w3*P. For another example, APP_A can also determine the target lens to be used in a specific manner during initialization; when the type of the first object is a QR code, APP_A can also extract the code value of the first object to query the physical size of the first object in the corresponding storage location; and then, based on the lens model of the target lens and the physical size of the first object, the first scaling ratio k pre-calculated and stored in association with the lens model of the target lens and the physical size of the first object can be queried from the corresponding storage location. 1 .

[0051] Back to Figure 1 In step S103, the first object is photographed using the target lens to obtain a photographed image.

[0052] The field of view of the target lens varies at different shooting distances. Figure 4 As shown, when the first object is photographed by the target lens in step S103, the physical length of the longer side of the field of view is recorded as y h3 , the physical length of the shorter side is denoted as y w3 The number of pixels of the longer side of the image / image area of ​​the first object in the corresponding captured image is recorded as x h5 , the number of pixels on the shorter side is recorded as x w5 , the image size of the original captured image obtained by the target image remains unchanged.

[0053] In actual technical scenarios, not only a single image can be taken of the first object, but also multiple images of the first object can be taken continuously in the form of a video. For example, APP_A can call the camera of the terminal device to use the target lens to continuously take multiple images of the first object in the form of a video and return the corresponding images. It can be understood that the first object is photographed through step S103 to obtain any i-th image Q 1i , the subsequent step S205 can be executed.

[0054] Step S105: zooming and displaying the captured image based on a first zoom ratio.

[0055] For any i-th captured image Q 1i , see Figure 6 As shown, the following steps S1051 and S1053 can be used to implement the first scaling ratio k 1 For the i-th captured image Q 1i Zoom display.

[0056] Step S1051 , obtaining a preview image, wherein the image size of the preview image is the same as the image size of the captured image, and the preview image is obtained by scaling a first image area in the captured image according to a first scaling ratio.

[0057] That is, any i-th preview image Q 2i is based on the first scaling factor k 1 , for the i-th captured image Q 1i The first image area and the i-th captured image Q are obtained by digital zooming. 1i have the same center. Figure 6 As shown, the first scaling factor k 1 , from the captured image Q 1i Cut out and capture the image Q 1i The first image region has the same center, and then the first image region is enlarged k 1 times to get the preview image Q 2i Another example is that the captured image Q 1i Zoom in 1 times, and then magnified the captured image Q 1i In the figure, the cropped and enlarged captured image Q 1i Preview image Q with the same center 2i .

[0058] When shooting images Q 1i There is an image M of the first object in the first image region 1i In the case of 1i The number of pixels on the longer side is x h5 , the number of pixels on the shorter side is recorded as x w5 Then, take the image Q 1i Corresponding preview image Q 2i In the image M of the first object, there will be 2i , the image M 2i The number of pixels on the longer side of h6 , the number of pixels on the shorter side x w6 , satisfying x h6 =k 1 *x h5 、x w6 =k 1 *x w5 .

[0059] Step S1053, displaying the preview image through a preview interface, wherein the preview interface includes a first guide area marked with marking information, for displaying a second image area in the preview image after being scaled according to a second scaling ratio, wherein the image size of the second image area is the same as the first image size.

[0060] For any i-th preview image Q 2i The second image area in the preview image Q 2i With reference to the above, for the image of the first object in the ideal state, the number of pixels on the longer side is x. h4 , the number of pixels on the shorter side is x w4 Correspondingly, for the preview image Q 2i The second image area in the image has a longer side with a number of pixels x. h4 , the number of pixels on the shorter side is x w4 .

[0061] The number of pixels on the longer side of the first guide area is recorded as x h7 , the number of pixels on the shorter side is recorded as x w7 . Need to satisfy x h4 With x w4 The ratio is equal to x h7 With W y7 In a possible implementation manner, the size of the first guide area may be based on the screen size of the terminal device or based on other criteria. h4 With x w4 The ratio is equal to x h7 With w y7 The ratio is pre-set and satisfies x h7 With x h4 The ratio of x w7 With x w4 The ratio is less than 1; in this case, the second scaling factor k 2 The value is equal to x h7 With x h4 The ratio and x w7 With x w4 In one possible implementation, the second scaling ratio k 2 It can be a preset constant less than 1. The size of the first guide area is based on k 2 Configured.

[0062] Reference Figure 7 As shown, for example, marking information may be set on at least three vertices of the first guide area to indicate the position of the first guide area. The embodiment of this specification does not limit the form or marking method of the marking information.

[0063] Reference Figure 7 As shown, the user can observe the first guide area and the preview image Q in the first guide area. 2i The image M of the first object inzi The matching degree, where for image M zi the smaller the average distance between the four vertices of the image M and the four vertices of the first guiding region, the higher the matching degree; for image M 2i the higher the matching degree, the more the number of pixels of the longer side of image M 2i tends to approach x h4 and the more the number of pixels of the shorter side of image M w4 tends to approach x w4 , which is more in line with the user's expectations; at the same time, it indicates that the captured image Q obtained by shooting the first object with the target lens 1i has an actual shooting distance that tends to approach the first shooting distance, and the first object is clearly displayed in both the captured image Q 1i and the preview image Q 2i . In terms of the size of the image of the first object, the image M 2i in the preview image Q 2i will be more in line with the user's expectations. Accordingly, the user can adjust the pose of the terminal device to adjust the matching degree between the first guiding region and the image of the first object observed by the user. During the pose adjustment process, the user will be guided to approach the shooting distance corresponding to the target lens to the first shooting distance, so as to capture a clearer image of the first object.

[0064] See Figure 7 As shown, the preview interface may further include a second guiding region. The first guiding region is located within the second guiding region. The second guiding region is used to display a third image region in the preview image after being scaled according to a second scaling ratio k 2 . The second image region is located within the third image region. In a more specific example, the remaining part of the third image region except the second image region may be in the shape of a "hui" character; the remaining part of the second guiding region except the first guiding region may be in the shape of a "hui" character. In an even more specific example, the third image region and the second image region have the same center; the second guiding region and the first guiding region have the same center; in this case, the number of pixels of the longer side of the third image region is x h4 +2*l x1 , the number of pixels of the shorter side of the third image region is x w4 +2*l x1 , the number of pixels of the longer side of the second guiding region is x h7 +2*l x2 , the number of pixels of the shorter side of the second guiding region is x w7 +2*l x2 , and it satisfies that the ratio of l x2 to l x1 is equal to the second scaling ratio k 2 , making it easier for the user to observe image M 2iThe degree of matching with the first boot area.

[0065] When the preview interface includes the first guide area but does not include the second guide area, the preview image Q 2i The rest of the image area except the second image area can be masked in various possible ways and not presented in the preview interface. When the preview interface includes the first guide area and the second guide area, the preview image Q 2i The rest of the image except the third image area can be masked in various possible ways and not presented in the preview interface. 2i The visual interference caused to the user by the part other than the second image area or the third image area can make it easier for the user to observe the matching degree between the image of the first object and the first guide area, and adjust the posture of the mobile phone accordingly.

[0066] Based on the above steps S1051 and S1053, the captured image is zoomed and displayed according to the first zoom ratio. Figure 8 As shown, the terminal device can also select an image for implementing a predetermined transaction and assist the user in adjusting the position and posture of the target lens through part or all of the following steps S107 to S1013.

[0067] Step S107: Detect a fourth image area corresponding to the first object in the preview image.

[0068] The fourth image region corresponding to the first object may be detected in the preview image by various image detection models including YOLO, for example, in the preview image Q 2i Detection image M 2i The corresponding approximately rectangular outline is used to obtain the fourth image area.

[0069] Step S109, determining whether the relationship between the fourth image area and the second image area meets a preset condition.

[0070] The preset condition is used to determine whether the fourth image area matches the second image area, and can be used to determine whether the fourth image area presents the first object clearly enough, including but not limited to determining whether the actual shooting distance corresponding to the captured image matches the first shooting distance, for example, whether the difference is within a certain range. Exemplarily, the longer side and the shorter side of the first object are equal, that is, the outline of the first object is square or approximately square, and the preset condition requires that the number of pixels on the shorter side of the fourth image area is not less than a1*x w4 , al is a preset constant less than l; if the number of pixels on the shortest side of the fourth image area is less than al*x w4, it means that the fourth image area does not match the second image area, that is, the relationship between the fourth image area and the second image area does not meet the preset condition. Obviously, the preset condition can also include other possible conditions, such as requiring that the number of pixels on the longest side of the second image area is not greater than a2*x w4 , a2 is a preset constant greater than 1.

[0071] If the relationship between the fourth image area and the second image area meets the corresponding preset condition, then the following step S111 may be performed; otherwise, the following step S113 may be performed.

[0072] Step S111: determining the preview image as an image for executing a predetermined transaction.

[0073] As mentioned above, the scheduled transaction may be, for example, anti-counterfeiting verification of products, defect detection of industrial products, and the like.

[0074] In some embodiments, if the relationship between the fourth image area and the second image area meets the corresponding preset conditions, the second image area or the third image area may also be determined as the image for performing the predetermined transaction.

[0075] Step S113, generating posture prompt information according to the relationship between the fourth image area and the second image area; wherein the posture prompt information is displayed in the preview interface to instruct the user to adjust the posture of the target lens.

[0076] For example, when the number of pixels on the longest side of the fourth image area is less than a first preset value, and the number of pixels on the shortest side of the fourth image area is less than a second preset value, the correspondingly generated posture prompt information can prompt the user to move the terminal device closer to the first object. For another example, when the center of the fourth image area is offset in a certain direction relative to the center of the preview image and the offset distance is too large, the correspondingly generated posture prompt information can prompt the user to move the terminal device in the corresponding direction.

[0077] Based on the same concept as the above method embodiment, this specification also provides an image shooting device 900, which is deployed in a terminal device equipped with a target lens. Fig. 9As shown, the device 900 includes: a ratio determination unit 901, configured to obtain a first zoom ratio, wherein the first zoom ratio is a first ratio of a first image size of a desired first object to a second image size, and the second image size is an image size of an image of the first object photographed at a first shooting distance using the target lens, and the first shooting distance is within the depth of field of the target lens; an image acquisition unit 903, configured to photograph the first object using the target lens to obtain a photographed image; and a zoom display unit 905, configured to zoom and display the photographed image based on the first zoom ratio.

[0078] A computer-readable storage medium is also provided in an embodiment of the present specification, on which a computer program / instruction is stored. When the computer program / instruction is executed in a terminal device, the terminal device is caused to execute an image capturing method provided in any of the aforementioned method embodiments.

[0079] The embodiments of the present specification also provide a terminal device, including a target lens, a memory and a processor, wherein the memory stores a computer program / instruction, and when the processor executes the computer program / instruction, an image capturing method provided in any of the aforementioned method embodiments is implemented.

[0080] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0081] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0082] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a server system. Of course, the present application does not exclude that with the development of computer technology in the future, the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0083] Although one or more embodiments of the present specification provide method operation steps as described in the embodiments or flow charts, more or less operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps, and does not represent the only execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or equipment including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such a process, method, product or equipment. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or equipment including the elements. For example, if the words first, second, etc. are used to represent the name, they do not represent any specific order.

[0084] For the convenience of description, the above devices are described in various modules according to their functions. Of course, when implementing one or more of the present specification, the functions of each module can be implemented in the same or more software and / or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0085] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0086] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0087] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0088] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0089] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0090] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, graphene storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0091] It should be understood by those skilled in the art that one or more embodiments of the present specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of the present specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0092] One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0093] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. In the description of this specification, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, in the absence of mutual contradiction, a person skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0094] The above description is only an example of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. For those skilled in the art, one or more embodiments of the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims.

Claims

1. An image capturing method, which is executed by a terminal device configured with a target lens. The method includes: Obtaining a first zoom ratio, where the first zoom ratio is a first ratio of a first image size of a desired first object to a second image size, and the second image size is the image size of an image of the first object captured by the target lens at a first shooting distance within the depth of field of the target lens; Capturing the first object using the target lens to obtain a captured image; Zooming and displaying the captured image based on the first zoom ratio.

2. The method according to claim 1, wherein the first shooting distance includes the closest focusing distance of the target lens.

3. The method according to claim 1, wherein the zooming and displaying the captured image based on the first zoom ratio includes: Obtaining a preview image, where the image size of the preview image is the same as the image size of the captured image, and the preview image is obtained by zooming a first image area in the captured image according to the first zoom ratio; Displaying the preview image through a preview interface, where the preview interface includes a first guiding area marked with marking information for displaying a second image area after zooming the preview image according to a second zoom ratio, and the image size of the second image area is the same as the first image size.

4. The method according to claim 3, wherein the preview interface includes a second guiding area, the first guiding area is located in the second guiding area, and the second guiding area is used for displaying a third image area after zooming the preview image according to the second zoom ratio, and the second image area is located in the third image area.

5. The method according to claim 4, wherein the remaining part of the third image area except the second image area is in the shape of a "hui" character; the remaining part of the second guiding area except the first guiding area is in the shape of a "hui" character.

6. The method according to claim 5, wherein the third image area and the second image area have the same center; the second guiding area and the first guiding area have the same center.

7. The method according to claim 3, wherein the first image area and the captured image have the same center; the second image area and the preview image have the same center.

8. The method according to claim 3, the method further includes: Detecting a fourth image area corresponding to the first object in the preview image; Determining whether the relationship between the fourth image area and the second image area meets a preset condition; If not, generating pose prompt information according to the relationship between the fourth image area and the second image area; wherein the pose prompt information is displayed in the preview interface for instructing the user to adjust the pose of the target lens.

9. The method according to claim 8, further comprising: When the relationship between the fourth image area and the second image area meets the preset condition, determining the preview image as an image for performing a predetermined task.

10. The method according to claim 1, wherein obtaining the first scaling ratio comprises: Acquire lens selection information and object selection information, wherein the lens selection information is used to indicate the target lens, and the object selection information is used to indicate the first object; Acquire a second ratio according to the lens selection information, where the second ratio is a ratio of an image size of an image of a second object captured by the target lens at the first shooting distance to a physical size of the second object; as well as, Acquire a physical size of the first object and a size of the first image according to the object selection information; The first scaling ratio is calculated according to the second ratio, the physical size of the first object and the first image size.

11. The method according to claim 1, wherein the terminal device pre-stores at least one zoom ratio of the target lens corresponding to at least one preset object, and the at least one preset object includes the first object; in, The acquiring the first scaling ratio includes: querying a first scaling ratio corresponding to the first object from the at least one scaling ratio.

12. The method according to claim 1, wherein the type of the first object comprises a QR code, a bar code, a laser label or a product logo provided on an outer package of a product.

13. The method according to any one of claims 3-9, wherein the second scaling factor is a constant less than 1.

14. An image capturing device, deployed in a terminal device equipped with a target lens, comprising: a ratio determination unit configured to obtain a first scaling ratio, wherein the first scaling ratio is a first ratio of a desired first image size of a first object to a second image size, the second image size being an image size of an image of the first object captured by the target lens at a first shooting distance, the first shooting distance being within a depth of field range of the target lens; an image acquisition unit, configured to photograph the first object using the target lens to obtain a photographed image; The zoom display unit is configured to zoom and display the captured image based on the first zoom ratio.

15. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed in a terminal device, the terminal device executes the method according to any one of claims 1 to 13.

16. A terminal device, comprising a target lens, a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method according to any one of claims 1 to 13 is implemented.