Target image acquisition method, device, medium and equipment

By using low-cost shooting equipment and image processing technology, combined with resolution conversion and image correction, the complexity of carrying and connecting high-precision equipment in banking operations has been solved, thereby improving the success rate of seal verification and business efficiency.

CN116437227BActive Publication Date: 2026-07-21PING AN BANK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PING AN BANK CO LTD
Filing Date
2023-03-28
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

In existing banking operations, high-precision imaging equipment is expensive, bulky, and inconvenient to carry, while seal verification equipment has complex connections, leading to extended business processes, frequent equipment failures, and disruptions to normal business operations.

Method used

By employing low-cost shooting equipment combined with image processing technology, and through resolution conversion algorithms and image enhancement and correction processing, we ensure that the handheld shooting equipment can capture images that meet the resolution requirements. We also use A4 paper as a reference to solve the problems of equipment height and level.

Benefits of technology

It enables the capture of images that meet resolution requirements under low-cost conditions, simplifies the device connection process, reduces the device failure rate, and improves business processing efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116437227B_ABST
    Figure CN116437227B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a target image acquisition method, device, medium and equipment, the method comprising: acquiring first size information of a target object to be photographed and second size information of a preset background picture; performing resolution conversion operation on the first size information and the second size information according to a resolution conversion rule to obtain a target picture resolution meeting a shooting requirement; photographing the target object to obtain a first image containing the target object and the preset background picture; performing preprocessing operation on the first image to obtain a second image; and adjusting the resolution of the second image to the target picture resolution to obtain a target image. Embodiments of the present application use a low-cost shooting device to replace a high-speed scanner to shoot pictures, and use image processing technology to replace the low-cost shooting device to compensate for the short board that the shooting accuracy is not as good as that of the high-speed scanner, and at the same time, through a preset resolution conversion algorithm, it can be solved that it is difficult for a handheld shooting device to shoot pictures meeting the resolution requirement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic communication technology, and more particularly to a data update technology field, especially to a method, apparatus, medium and device for acquiring target images. Background Technology

[0002] With the continuous development of technology, banking and financial services are constantly innovating. Coupled with the support of data-driven transformation, the improvement of user experience has received much attention in banking, because an ultimate user experience can bring value that exceeds user expectations.

[0003] Electronic seal verification is a process of comparing an original seal image captured electronically with an image of the seal on a business document. The system primarily uses image processing technology to simulate the manual verification of document authenticity at a counter. Integrating electronic seal verification functionality into a single system creates an electronic seal verification system. This system assists banks and other institutions in verifying the authenticity of seals on documents, accelerating transaction processing, and increasing the success rate of verification. Domestic banks widely use electronic seal verification in corporate banking transactions to verify whether the transaction reflects the company's true intent. Currently, the common problems and shortcomings encountered in corporate banking seal verification include the following:

[0004] 1. Corporate banking transactions require specialized verification equipment, which is generally expensive, bulky, and sophisticated. Equipment such as document scanners and high-speed scanners are inconvenient to carry when visiting corporate clients, and even slight deformation can lead to verification failure, making the transaction impossible and resulting in a poor customer experience.

[0005] 2. The seal verification device is a standalone device. In public account business, it needs to be connected and embedded into the business process via protocols such as Bluetooth or WIFI. This process requires complex configuration steps, resulting in a longer business process and increased business processing time.

[0006] 3. Aging equipment and high maintenance costs, along with frequent equipment failures, often disrupt normal business operations. Summary of the Invention

[0007] This application provides a target image acquisition method, apparatus, medium, and device. The target image acquisition method provided by this application uses a low-cost shooting device instead of a high-speed document scanner to capture images, and uses image processing technology to compensate for the shortcomings of low-cost shooting devices in terms of shooting accuracy compared to high-speed document scanners. At the same time, a preset resolution conversion algorithm can solve the problem that handheld shooting devices are difficult to capture images that meet resolution requirements.

[0008] This application provides a method for acquiring a target image, the method comprising:

[0009] Obtain the first size information of the target object to be photographed and the second size information of the preset background image;

[0010] The first size information and the second size information are converted according to a preset resolution conversion rule to obtain the target image resolution that meets the shooting requirements;

[0011] The target object is photographed to obtain a first image containing the target object and a preset background image;

[0012] The first image is preprocessed to obtain a second image with interference removed;

[0013] The resolution of the second image is adjusted to the resolution of the target image to obtain the target image.

[0014] In the target image acquisition method described in this application embodiment, the first size information includes the first actual length and the first actual width of the target object, the second size information includes the second actual length and the second actual width of the preset background image, and the resolution conversion rule includes:

[0015] a1 = L1 / L2 * a2

[0016] b1 = H1 / H2 * b2

[0017] Wherein, a1 represents the first expected length resolution of the preset background image; L1 represents the first actual length; L2 represents the second actual length; a2 represents the second expected length resolution of the target object; b1 represents the first expected width resolution of the preset target object; H1 represents the first actual width; H2 represents the second actual width; b2 represents the second expected width resolution of the target object.

[0018] In the target image acquisition method described in the embodiments of this application, the first image is not cropped by margins, and the margin of the preset background image in the first image does not exceed a preset threshold.

[0019] In the target image acquisition method described in the embodiments of this application, the preprocessing operation includes image enhancement processing and / or image correction processing.

[0020] In the target image acquisition method described in the embodiments of this application, the image enhancement processing includes one or more of grayscale processing and Gaussian filtering processing.

[0021] In the target image acquisition method described in the embodiments of this application, the image correction processing includes:

[0022] The Sobel operator is used to perform edge detection on the first image to obtain the edge points of the first image;

[0023] Perform a Hough transform on the edge points and find the rotation angle. Use the rotation angle to correct the horizontal tilt of the first image.

[0024] In the target image acquisition method described in the embodiments of this application, the horizontal tilt correction using the rotation angle includes:

[0025] Obtain the diagonal length of the first image, construct a square image with the diagonal as the side length as a temporary new image, obtain the coordinates of the upper left corner of the first image in the temporary new image, and copy the first image to the new temporary image;

[0026] Using the center point of the new temporary image as the rotation point, and combining OpenCV library functions and rotation angle, a two-dimensional rotation affine transformation matrix is ​​obtained, and an affine transformation is performed to complete the horizontal tilt correction of the first image.

[0027] Accordingly, another aspect of this application embodiment also provides a target image acquisition device, the target image acquisition device comprising:

[0028] The acquisition module is used to acquire the first size information of the target object to be photographed and the second size information of the preset background image;

[0029] The conversion module is used to perform a resolution conversion operation between the first size information and the second size information according to a preset resolution conversion rule to obtain the target image resolution that meets the shooting requirements.

[0030] The shooting module is used to capture the target object and obtain a first image containing the target object and a preset background image;

[0031] The processing module is used to preprocess the first image to obtain a second image with interference factors removed;

[0032] An adjustment module is used to adjust the resolution of the second image to the resolution of the target image to obtain the target image.

[0033] Accordingly, in another aspect, this application also provides a storage medium storing a plurality of instructions adapted for loading by a processor to execute the target image acquisition method described above.

[0034] Accordingly, another aspect of this application embodiment also provides a terminal device, including a processor and a memory, wherein the memory stores a plurality of instructions, and the processor loads the instructions to execute the target image acquisition method as described above.

[0035] This application provides a method, apparatus, medium, and device for acquiring a target image. The method involves acquiring first size information of a target object to be photographed and second size information of a preset background image; performing a resolution conversion operation on the first and second size information according to a preset resolution conversion rule to obtain a target image resolution that meets the shooting requirements; photographing the target object to obtain a first image containing the target object and the preset background image; preprocessing the first image to obtain a second image with interference removed; and adjusting the resolution of the second image to the target image resolution to obtain the target image. Using the target image acquisition method provided in this application, a low-cost shooting device is used instead of a high-speed document scanner for image capture, and image processing technology is used to compensate for the lower shooting accuracy of the low-cost shooting device compared to the high-speed document scanner. Simultaneously, the preset resolution conversion algorithm solves the problem of handheld shooting devices failing to capture images that meet resolution requirements. Attached Figure Description

[0036] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0037] Figure 1 This is a flowchart illustrating the target image acquisition method provided in an embodiment of this application.

[0038] Figure 2 This is a schematic diagram of the target image acquisition device provided in an embodiment of this application.

[0039] Figure 3 This is another schematic diagram of the target image acquisition device provided in the embodiments of this application.

[0040] Figure 4 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation

[0041] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the protection scope of this application.

[0042] It should be noted that the following is a brief introduction to the background of this solution:

[0043] This solution primarily addresses the technical challenge of addressing the issue that "currently, for business photography scenarios requiring high clarity, high-speed document scanners or other high-precision imaging equipment are often needed. However, these devices are typically expensive and inconvenient to carry. Furthermore, before use, they need to be connected and integrated into the business process via Bluetooth or Wi-Fi protocols, a complex configuration process that lengthens workflows and increases processing time." Understandably, with continuous technological advancements and constant innovation in banking and financial services, coupled with data-driven transformation, improving user experience is of paramount importance in banking, as an exceptional user experience can deliver value exceeding user expectations.

[0044] Electronic seal verification is a process of comparing an original seal image captured electronically with an image of the seal on a business document. The system primarily uses image processing technology to simulate the manual verification of document authenticity at a counter. Integrating electronic seal verification functionality into a single system creates an electronic seal verification system. This system assists banks and other institutions in verifying the authenticity of seals on documents, accelerating transaction processing, and increasing the success rate of verification. Domestic banks widely use electronic seal verification in corporate banking transactions to verify whether the transaction reflects the company's true intent. Currently, the common problems and shortcomings encountered in corporate banking seal verification include the following:

[0045] 1. Corporate banking transactions require specialized verification equipment, which is generally expensive, bulky, and sophisticated. Equipment such as document scanners and high-speed scanners are inconvenient to carry when visiting corporate clients, and even slight deformation can lead to verification failure, making the transaction impossible and resulting in a poor customer experience.

[0046] 2. The seal verification device is a standalone device. In public account business, it needs to be connected and embedded into the business process via protocols such as Bluetooth or WIFI. This process requires complex configuration steps, resulting in a longer business process and increased business processing time.

[0047] 3. Aging equipment and high maintenance costs, along with frequent equipment failures, often disrupt normal business operations.

[0048] To address the aforementioned technical problems, embodiments of this application provide a method for acquiring target images. This method utilizes a low-cost imaging device instead of a high-speed document scanner to capture images, and employs image processing techniques to compensate for the lower accuracy of the low-cost imaging device compared to the high-speed document scanner. Furthermore, a preset resolution conversion algorithm addresses the challenge of handheld imaging devices capturing images that meet resolution requirements.

[0049] Please seeFigure 1 , Figure 1 This is a flowchart illustrating the target image acquisition method provided in an embodiment of this application. The target image acquisition method is applied to a terminal device. Optionally, the terminal device is a terminal or a server. Optionally, the server is an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal is a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, smart voice interaction device, smart home appliance, or in-vehicle terminal, but is not limited to these.

[0050] In one embodiment, the method may include the following steps:

[0051] Step 101: Obtain the first size information of the target object to be photographed and the second size information of the preset background image.

[0052] To facilitate understanding of this solution, this article mainly uses photographing a seal as an example for explanation. Therefore, the target object to be photographed in this solution refers to the seal, and the preset background image refers to the background image of the seal, taking a blank A4 paper as an example.

[0053] It should be noted that the main technical problem this solution aims to solve is for business shooting scenarios with high clarity requirements, which require the use of document scanners or other high-precision shooting equipment. These shooting devices are usually expensive and inconvenient to carry. In addition, before use, the shooting device needs to be connected and embedded into the business process via protocols such as Bluetooth or WIFI. This process requires complex configuration steps, resulting in longer business processes and increased business processing time.

[0054] To address the aforementioned issues, considering the increasing computing power of mobile devices such as smartphones and tablets, and the millisecond-level image processing speed on these devices, in-depth research into document scanner electronic seal verification solutions revealed that the height and level of the scanner are precisely adjusted and fixed. Even slight distortions in height or level can lead to verification failure. The conclusion is that the resolution of the seal image captured at a certain height and horizontal direction is consistent. This is summarized as follows:

[0055] (1) The verification is not related to the DPI of the image (because the verification can also pass in scenarios such as 72dpi, 96dpi, 200dpi, 255dpi).

[0056] (2) In images of different sizes that have passed verification, their stamp resolution (200x200) is the same, and the calculated physical size is also the same. For example, stamp pixel value / dpi = physical size of the stamp (200 / 200 = 1 inch, dpi = 200).

[0057] Based on the above conclusions, as long as the resolution of the stamp in the photographed image matches the theoretical value, it is sufficient. However, the biggest challenge in the stamp verification process using mobile devices is that they are handheld, making it difficult to accurately guarantee the horizontal and vertical alignment during photography. Therefore, to overcome this problem, this solution introduces A4 paper as a reference object for stamp photography, i.e., a preset background image, and ensures the following two conditions are met during the photography process:

[0058] (1) The handheld mobile terminal and the A4 paper must be at a certain height to fix the stamp resolution.

[0059] (2) The handheld mobile terminal and the A4 paper must be kept horizontal, otherwise the stamp will be deformed, the resolution will be incorrect, and the stamp verification will fail.

[0060] Therefore, in this embodiment, it is necessary to first obtain the first size information of the target object to be photographed and the second size information of the preset background image. The first size information includes the first actual length and the first actual width of the target object, and the second size information includes the second actual length and the second actual width of the preset background image.

[0061] Step 102: Perform a resolution conversion operation between the first size information and the second size information according to a preset resolution conversion rule to obtain the target image resolution that meets the shooting requirements.

[0062] To address the two necessary conditions mentioned above, this solution resolves height differences by supplementing or cropping pixels, while image level inaccuracies can be corrected through image transformation. Further experimental testing revealed key data: a print can pass inspection as long as the A4 paper resolution is 1680*2376. The first and second size information are converted according to a preset resolution conversion rule to obtain the target image resolution that meets the shooting requirements.

[0063] Resolution conversion rules include:

[0064] a1 = L1 / L2 * a2

[0065] b1 = H1 / H2 * b2

[0066] Where a1 represents the first expected length resolution of the preset background image; L1 represents the first actual length; L2 represents the second actual length; a2 represents the second expected length resolution of the target object; b1 represents the first expected width resolution of the preset target object; H1 represents the first actual width; H2 represents the second actual width; and b2 represents the second expected width resolution of the target object.

[0067] Specifically, the known conditions are:

[0068] A4 paper dimensions: 297 x 210 mm

[0069] Seal size: 25x25 mm

[0070] 200x200 seal resolution

[0071] Calculation conclusion:

[0072] A4 paper width resolution a1=297 / 25*200=1680

[0073] A4 paper height resolution b1 = 210 / 25 * 200 = 2376

[0074] Step 103: Take a picture of the target object to obtain a first image containing the target object and a preset background image.

[0075] During the process of shooting the target object, it is necessary to ensure that the first image is not cropped by margins and that the margin of the preset background image in the first image does not exceed a preset threshold. Ideally, the preset threshold is 0, which means that the margin of the first image coincides with the boundary of the shooting area of ​​the shooting device.

[0076] Step 104: Perform preprocessing on the first image to obtain a second image with interference removed.

[0077] In this embodiment, since the solution uses a low-cost shooting device instead of a high-speed document scanner to take pictures, it will inevitably lead to the problem that the shooting accuracy is not as good as that of the high-speed document scanner. Therefore, by performing preprocessing operations on the first image to remove interference factors, the shortcomings of the low-cost shooting device can be made up for.

[0078] Preprocessing operations include image enhancement and / or image correction.

[0079] Image enhancement processing includes:

[0080] One or more of grayscale processing and Gaussian filtering processing.

[0081] Image correction processing includes:

[0082] The Sobel operator is used to perform edge detection on the first image to obtain the edge points of the first image;

[0083] Perform a Hough transform on the edge points and find the rotation angle. Use the rotation angle to correct the horizontal tilt of the first image.

[0084] The step of correcting the horizontal tilt of the first image using a rotation angle includes:

[0085] Obtain the diagonal length of the first image, construct a square image with the diagonal as the side length as a temporary new image, obtain the coordinates of the upper left corner of the first image in the temporary new image, and copy the first image to the new temporary image;

[0086] Using the center point of the new temporary image as the rotation point, and combining OpenCV library functions and rotation angle, a two-dimensional rotation affine transformation matrix is ​​obtained, and an affine transformation is performed to complete the horizontal tilt correction of the first image.

[0087] Step 105: Adjust the resolution of the second image to the resolution of the target image to obtain the target image.

[0088] By adjusting the resolution of the second image to the resolution of the target image, a target image that meets the resolution requirements and ensures clarity can be obtained.

[0089] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.

[0090] In practice, this application is not limited by the execution order of the described steps. Without causing conflicts, some steps may be performed in other orders or simultaneously.

[0091] As can be seen from the above, the target image acquisition method provided in this application embodiment obtains the first size information of the target object to be photographed and the second size information of the preset background image; performs a resolution conversion operation on the first size information and the second size information according to a preset resolution conversion rule to obtain a target image resolution that meets the shooting requirements; photographs the target object to obtain a first image containing the target object and the preset background image; preprocesses the first image to obtain a second image with interference removed; and adjusts the resolution of the second image to the target image resolution to obtain the target image. Using the target image acquisition method provided in this application embodiment, a low-cost shooting device is used instead of a high-speed document scanner to capture images, and image processing technology is used to compensate for the lower shooting accuracy of the low-cost shooting device compared to the high-speed document scanner. Simultaneously, the preset resolution conversion algorithm can solve the problem that handheld shooting devices are difficult to use to capture images that meet the resolution requirements.

[0092] This application also provides a target image acquisition device, which can be integrated into a terminal device.

[0093] Please see Figure 2 , Figure 2 This is a schematic diagram of the target image acquisition device provided in an embodiment of this application. The target image acquisition device 30 may include:

[0094] The acquisition module 31 is used to acquire the first size information of the target object to be photographed and the second size information of the preset background image;

[0095] The conversion module 32 is used to perform a resolution conversion operation between the first size information and the second size information according to a preset resolution conversion rule to obtain the target image resolution that meets the shooting requirements.

[0096] The shooting module 33 is used to shoot the target object and obtain a first image containing the target object and a preset background image;

[0097] Processing module 34 is used to preprocess the first image to obtain a second image with interference factors removed;

[0098] The adjustment module 35 is used to adjust the resolution of the second image to the resolution of the target image to obtain the target image.

[0099] In some embodiments, the first size information includes the first actual length and first actual width of the target object, the second size information includes the second actual length and second actual width of the preset background image, and the resolution conversion rule includes:

[0100] a1 = L1 / L2 * a2

[0101] b1 = H1 / H2 * b2

[0102] Wherein, a1 represents the first expected length resolution of the preset background image; L1 represents the first actual length; L2 represents the second actual length; a2 represents the second expected length resolution of the target object; b1 represents the first expected width resolution of the preset target object; H1 represents the first actual width; H2 represents the second actual width; b2 represents the second expected width resolution of the target object.

[0103] In some embodiments, the first image is not cropped by margins, and the margin of the preset background image in the first image does not exceed a preset threshold.

[0104] In some embodiments, the preprocessing operation includes image enhancement and / or image correction.

[0105] In some embodiments, the image enhancement process includes one or more of grayscale processing and Gaussian filtering.

[0106] In some embodiments, the image correction process includes:

[0107] The Sobel operator is used to perform edge detection on the first image to obtain the edge points of the first image;

[0108] Perform a Hough transform on the edge points and find the rotation angle. Use the rotation angle to correct the horizontal tilt of the first image.

[0109] In some embodiments, the image correction process includes:

[0110] Obtain the diagonal length of the first image, construct a square image with the diagonal as the side length as a temporary new image, obtain the coordinates of the upper left corner of the first image in the temporary new image, and copy the first image to the new temporary image;

[0111] Using the center point of the new temporary image as the rotation point, and combining OpenCV library functions and rotation angle, a two-dimensional rotation affine transformation matrix is ​​obtained, and an affine transformation is performed to complete the horizontal tilt correction of the first image.

[0112] In practice, the above modules can be implemented as independent entities or combined in any way to be implemented as the same or several entities.

[0113] As can be seen from the above, the target image acquisition device 30 provided in this application embodiment includes an acquisition module 31 for acquiring first size information of the target object to be photographed and second size information of a preset background image; a conversion module 32 for performing a resolution conversion operation on the first size information and the second size information according to a preset resolution conversion rule to obtain a target image resolution that meets the shooting requirements; a shooting module 33 for shooting the target object to obtain a first image containing the target object and the preset background image; a processing module 34 for performing a preprocessing operation on the first image to obtain a second image with interference factors removed; and an adjustment module 35 for adjusting the resolution of the second image to the target image resolution to obtain a target image.

[0114] Please see Figure 3 , Figure 3This is another schematic diagram of the target image acquisition device provided in an embodiment of this application. The target image acquisition device 30 includes a memory 120, one or more processors 180, and one or more application programs, wherein the one or more application programs are stored in the memory 120 and configured to be executed by the processors 180; the processors 180 may include an acquisition module 31, a conversion module 32, an image capture module 33, a processing module 34, and an adjustment module 35. For example, the structure and connection relationship of the above components can be as follows:

[0115] Memory 120 can be used to store applications and data. The applications stored in memory 120 contain executable code. Applications can be composed of various functional modules. Processor 180 executes various functional applications and target image acquisition by running the applications stored in memory 120. Furthermore, memory 120 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, memory 120 may also include a memory controller to provide processor 180 with access to memory 120.

[0116] The processor 180 is the control center of the device, connecting various parts of the terminal through various interfaces and lines. It performs various functions and processes data by running or executing applications stored in the memory 120 and calling data stored in the memory 120, thereby providing overall monitoring of the device. Optionally, the processor 180 may include one or more processing cores; preferably, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications.

[0117] Specifically, in this embodiment, the processor 180 loads the executable code corresponding to the processes of one or more applications into the memory 120 according to the following instructions, and the processor 180 runs the applications stored in the memory 120 to achieve various functions:

[0118] The acquisition command is used to acquire the first size information of the target object to be photographed and the second size information of the preset background image;

[0119] The conversion instruction is used to perform a resolution conversion operation between the first size information and the second size information according to a preset resolution conversion rule to obtain a target image resolution that meets the shooting requirements.

[0120] A shooting command is used to capture a picture of the target object and obtain a first image containing the target object and a preset background image;

[0121] The processing instruction is used to preprocess the first image to obtain a second image with interference factors removed.

[0122] An adjustment command is used to adjust the resolution of the second image to the resolution of the target image, thereby obtaining the target image.

[0123] In some embodiments, the first size information includes the first actual length and first actual width of the target object, the second size information includes the second actual length and second actual width of the preset background image, and the resolution conversion rule includes:

[0124] a1 = L1 / L2 * a2

[0125] b1 = H1 / H2 * b2

[0126] Wherein, a1 represents the first expected length resolution of the preset background image; L1 represents the first actual length; L2 represents the second actual length; a2 represents the second expected length resolution of the target object; b1 represents the first expected width resolution of the preset target object; H1 represents the first actual width; H2 represents the second actual width; b2 represents the second expected width resolution of the target object.

[0127] In some embodiments, the first image is not cropped by margins, and the margin of the preset background image in the first image does not exceed a preset threshold.

[0128] In some embodiments, the preprocessing operation includes image enhancement and / or image correction.

[0129] In some embodiments, the image enhancement process includes one or more of grayscale processing and Gaussian filtering.

[0130] In some embodiments, the image correction process includes:

[0131] The Sobel operator is used to perform edge detection on the first image to obtain the edge points of the first image;

[0132] Perform a Hough transform on the edge points and find the rotation angle. Use the rotation angle to correct the horizontal tilt of the first image.

[0133] In some embodiments, the image correction process includes:

[0134] Obtain the diagonal length of the first image, construct a square image with the diagonal as the side length as a temporary new image, obtain the coordinates of the upper left corner of the first image in the temporary new image, and copy the first image to the new temporary image;

[0135] Using the center point of the new temporary image as the rotation point, and combining OpenCV library functions and rotation angle, a two-dimensional rotation affine transformation matrix is ​​obtained, and an affine transformation is performed to complete the horizontal tilt correction of the first image.

[0136] This application also provides a terminal device. The terminal device may be a server, smartphone, computer, tablet computer, or other similar device.

[0137] Please see Figure 4 , Figure 4 A schematic diagram of the structure of a terminal device provided in an embodiment of this application is shown. This terminal device can be used to implement the target image acquisition method provided in the above embodiments. The terminal device 1200 can be a smartphone or a tablet computer.

[0138] like Figure 4 As shown, the terminal device 1200 may include an RF (Radio Frequency) circuit 110, a memory 120 including one or more (only one is shown in the figure) computer-readable storage media, an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a transmission module 170, a processor 180 including one or more (only one is shown in the figure) processing cores, and a power supply 190, etc. Those skilled in the art will understand that... Figure 4 The structure of the terminal device 1200 shown does not constitute a limitation on the terminal device 1200, and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0139] RF circuit 110 is used to receive and transmit electromagnetic waves, realizing the mutual conversion between electromagnetic waves and electrical signals, thereby enabling communication with communication networks or other devices. RF circuit 110 may include various existing circuit elements used to perform these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, Subscriber Identity Module (SIM) cards, memory, etc. RF circuit 110 can communicate with various networks such as the Internet, corporate intranets, and wireless networks, or communicate with other devices via wireless networks.

[0140] The memory 120 can be used to store software programs and modules, such as the program instructions / modules corresponding to the target image acquisition method in the above embodiment. The processor 180 executes various functional applications and target image acquisition by running the software programs and modules stored in the memory 120. It can automatically select a vibration reminder mode to update data according to the current scene of the terminal device, which can ensure that the meeting and other scenarios are not disturbed, and that the user can sense incoming calls, thereby improving the intelligence of the terminal device. The memory 120 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 120 may further include memory remotely located relative to the processor 180. These remote memories can be connected to the terminal device 1200 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0141] Input unit 130 can be used to receive input numerical or character information, and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. Specifically, input unit 130 may include touch-sensitive surface 131 and other input devices 132. Touch-sensitive surface 131, also known as a touch display screen or touchpad, can collect user touch operations on or near it (such as user operations using fingers, styluses, or any suitable object or accessory on or near touch-sensitive surface 131), and drive corresponding connection devices according to a pre-set program. Optionally, touch-sensitive surface 131 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, sends it to processor 180, and can receive and execute commands from processor 180. In addition, the touch-sensitive surface 131 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. Besides the touch-sensitive surface 131, the input unit 130 may also include other input devices 132. Specifically, other input devices 132 may include, but are not limited to, one or more of the following: a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick.

[0142] Display unit 140 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of terminal device 1200. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Display unit 140 may include display panel 141, optionally configured as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, touch-sensitive surface 131 may cover display panel 141. When touch-sensitive surface 131 detects a touch operation on or near it, it transmits the information to processor 180 to determine the type of touch event. Subsequently, processor 180 provides corresponding visual output on display panel 141 according to the type of touch event. Although in Figure 4 In this embodiment, the touch-sensitive surface 131 and the display panel 141 are implemented as two separate components to realize input and output functions. However, in some embodiments, the touch-sensitive surface 131 and the display panel 141 can be integrated to realize input and output functions.

[0143] The terminal device 1200 may also include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 141 according to the ambient light level, and the proximity sensor can turn off the display panel 141 and / or backlight when the terminal device 1200 is moved to the ear. As a type of motion sensor, a gravity acceleration sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used for applications that recognize the phone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, tapping), etc. Other sensors that the terminal device 1200 may also be configured with, such as a gyroscope, barometer, hygrometer, thermometer, and infrared sensor, will not be described in detail here.

[0144] Audio circuitry 160, speaker 161, and microphone 162 provide an audio interface between the user and terminal device 1200. Audio circuitry 160 converts received audio data into electrical signals, which are then transmitted to speaker 161, where they are converted into sound signals for output. Conversely, microphone 162 converts collected sound signals into electrical signals, which are received by audio circuitry 160, converted back into audio data, and then processed by processor 180 before being transmitted via RF circuitry 110 to, for example, another terminal, or output to memory 120 for further processing. Audio circuitry 160 may also include an earphone jack to facilitate communication between peripheral headphones and terminal device 1200.

[0145] Terminal device 1200, through transmission module 170 (e.g., Wi-Fi module), can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 4 The transmission module 170 is shown, but it is understood that it is not a necessary component of the terminal device 1200 and can be omitted as needed without changing the nature of the invention.

[0146] The processor 180 is the control center of the terminal device 1200. It connects to various parts of the mobile phone via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 120, and by calling data stored in the memory 120, it performs various functions of the terminal device 1200 and processes data, thereby providing overall monitoring of the mobile phone. Optionally, the processor 180 may include one or more processing cores; in some embodiments, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into the processor 180.

[0147] The terminal device 1200 also includes a power supply 190 that supplies power to the various components. In some embodiments, the power supply can be logically connected to the processor 180 through a power management system, thereby enabling functions such as discharge management and power consumption management through the power management system. The power supply 190 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0148] Although not shown, the terminal device 1200 may also include a camera (such as a front-facing camera and a rear-facing camera), a Bluetooth module, etc., which will not be described in detail here. Specifically, in this embodiment, the display unit 140 of the terminal device 1200 is a touch screen display, and the terminal device 1200 also includes a memory 120 and one or more programs, one or more of which are stored in the memory 120 and configured to be executed by one or more processors 180. One or more programs contain instructions for performing the following operations:

[0149] The acquisition command is used to acquire the first size information of the target object to be photographed and the second size information of the preset background image;

[0150] The conversion instruction is used to perform a resolution conversion operation between the first size information and the second size information according to a preset resolution conversion rule to obtain a target image resolution that meets the shooting requirements.

[0151] A shooting command is used to capture a picture of the target object and obtain a first image containing the target object and a preset background image;

[0152] The processing instruction is used to preprocess the first image to obtain a second image with interference factors removed.

[0153] An adjustment command is used to adjust the resolution of the second image to the resolution of the target image, thereby obtaining the target image.

[0154] In some embodiments, the first size information includes the first actual length and first actual width of the target object, the second size information includes the second actual length and second actual width of the preset background image, and the resolution conversion rule includes:

[0155] a1 = L1 / L2 * a2

[0156] b1 = H1 / H2 * b2

[0157] Wherein, a1 represents the first expected length resolution of the preset background image; L1 represents the first actual length; L2 represents the second actual length; a2 represents the second expected length resolution of the target object; b1 represents the first expected width resolution of the preset target object; H1 represents the first actual width; H2 represents the second actual width; b2 represents the second expected width resolution of the target object.

[0158] In some embodiments, the first image is not cropped by margins, and the margin of the preset background image in the first image does not exceed a preset threshold.

[0159] In some embodiments, the preprocessing operation includes image enhancement and / or image correction.

[0160] In some embodiments, the image enhancement process includes one or more of grayscale processing and Gaussian filtering.

[0161] In some embodiments, the image correction process includes:

[0162] The Sobel operator is used to perform edge detection on the first image to obtain the edge points of the first image;

[0163] Perform a Hough transform on the edge points and find the rotation angle. Use the rotation angle to correct the horizontal tilt of the first image.

[0164] In some embodiments, the image correction process includes:

[0165] Obtain the diagonal length of the first image, construct a square image with the diagonal as the side length as a temporary new image, obtain the coordinates of the upper left corner of the first image in the temporary new image, and copy the first image to the new temporary image;

[0166] Using the center point of the new temporary image as the rotation point, and combining OpenCV library functions and rotation angle, a two-dimensional rotation affine transformation matrix is ​​obtained, and an affine transformation is performed to complete the horizontal tilt correction of the first image.

[0167] This application also provides a storage medium storing a computer program. When the computer program is run on a computer, the computer executes the target image acquisition method described in any of the above embodiments.

[0168] It should be noted that, for the target image acquisition method described in this application, those skilled in the art will understand that all or part of the process of the target image acquisition method described in the embodiments of this application can be implemented by a computer program controlling the relevant hardware. The computer program can be stored in a computer-readable storage medium, such as in the memory of a terminal device, and executed by at least one processor within the terminal device. During execution, it can include the process of the embodiments of the target image acquisition method described. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), etc.

[0169] For the target image acquisition device described in this application embodiment, its functional modules can be integrated into a single processing chip, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0170] The target image acquisition method, apparatus, medium, and device provided in the embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and its core ideas. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for acquiring a target image, characterized in that, include: Acquire first size information of the target object to be photographed and second size information of the preset background image. The first size information includes the first actual length and the first actual width of the target object, and the second size information includes the second actual length and the second actual width of the preset background image. The first size information and the second size information are converted according to a preset resolution conversion rule to obtain the target image resolution that meets the shooting requirements; The target object is photographed to obtain a first image containing the target object and a preset background image; The first image is preprocessed to obtain a second image with interference removed; The resolution of the second image is adjusted to the resolution of the target image to obtain the target image; The resolution conversion rules include: a1 = L2 / L1 * a2 b1 = H2 / H1 * b2 Wherein, a1 represents the first expected length resolution of the preset background image; L1 represents the first actual length; L2 represents the second actual length; a2 represents the second expected length resolution of the target object; b1 represents the first expected width resolution of the preset target object; H1 represents the first actual width; H2 represents the second actual width; b2 represents the second expected width resolution of the target object.

2. The target image acquisition method as described in claim 1, characterized in that, The first image is not cropped by margins, and the margin of the preset background image in the first image does not exceed a preset threshold.

3. The target image acquisition method as described in claim 1, characterized in that, The preprocessing operations include image enhancement and / or image correction.

4. The target image acquisition method as described in claim 3, characterized in that, The image enhancement process includes one or more of grayscale processing and Gaussian filtering.

5. The target image acquisition method as described in claim 3, characterized in that, The image correction process includes: The Sobel operator is used to perform edge detection on the first image to obtain the edge points of the first image; Perform a Hough transform on the edge points and find the rotation angle. Use the rotation angle to correct the horizontal tilt of the first image.

6. The target image acquisition method as described in claim 5, characterized in that, The step of correcting the horizontal tilt of the first image using the rotation angle includes: Obtain the diagonal length of the first image, construct a square image with the diagonal as the side length as a temporary new image, obtain the coordinates of the upper left corner of the first image in the temporary new image, and copy the first image to the new temporary image; Using the center point of the new temporary image as the rotation point, and combining OpenCV library functions and rotation angle, a two-dimensional rotation affine transformation matrix is ​​obtained, and an affine transformation is performed to complete the horizontal tilt correction of the first image.

7. A target image acquisition device, characterized in that, The target image acquisition device includes: The acquisition module is used to acquire first size information of the target object to be photographed and second size information of the preset background image. The first size information includes the first actual length and the first actual width of the target object, and the second size information includes the second actual length and the second actual width of the preset background image. The conversion module is used to perform a resolution conversion operation between the first size information and the second size information according to a preset resolution conversion rule to obtain the target image resolution that meets the shooting requirements. The shooting module is used to capture the target object and obtain a first image containing the target object and a preset background image; The processing module is used to preprocess the first image to obtain a second image with interference factors removed; An adjustment module is used to adjust the resolution of the second image to the resolution of the target image to obtain the target image; The resolution conversion rules include: a1 = L2 / L1 * a2 b1 = H2 / H1 * b2 Wherein, a1 represents the first expected length resolution of the preset background image; L1 represents the first actual length; L2 represents the second actual length; a2 represents the second expected length resolution of the target object; b1 represents the first expected width resolution of the preset target object; H1 represents the first actual width; H2 represents the second actual width; b2 represents the second expected width resolution of the target object.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the target image acquisition method according to any one of claims 1 to 6.

9. A terminal device, characterized in that, The method includes a processor and a memory, the memory storing multiple instructions, and the processor loading the instructions to execute the target image acquisition method according to any one of claims 1 to 6.