WO2023130966A1 - Image processing method, image processing apparatus, electronic device and storage medium - Google Patents

Image processing method, image processing apparatus, electronic device and storage medium Download PDF

Info

Publication number
WO2023130966A1
WO2023130966A1 PCT/CN2022/140852 CN2022140852W WO2023130966A1 WO 2023130966 A1 WO2023130966 A1 WO 2023130966A1 CN 2022140852 W CN2022140852 W CN 2022140852W WO 2023130966 A1 WO2023130966 A1 WO 2023130966A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
training
processing
lines
original
Prior art date
Application number
PCT/CN2022/140852
Other languages
French (fr)
Chinese (zh)
Inventor
徐青松
李青
Original Assignee
杭州睿胜软件有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 杭州睿胜软件有限公司 filed Critical 杭州睿胜软件有限公司
Publication of WO2023130966A1 publication Critical patent/WO2023130966A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4046Scaling of whole images or parts thereof, e.g. expanding or contracting using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • Embodiments of the present disclosure relate to an image processing method, an image processing apparatus, electronic equipment, and a non-transitory computer-readable storage medium.
  • At least one embodiment of the present disclosure provides an image processing method, including: acquiring an original image; processing the original image to obtain a pre-processed image, wherein the pre-processed image includes at least two first lines, the At least two first lines are arranged side by side in sequence along the same direction; the preprocessed image is processed through a distortion processing model to obtain an intermediate image, wherein the intermediate image includes at least two second lines, and the at least two The second lines are arranged side by side in sequence along the same direction, and the at least two second lines correspond to the at least two first lines one by one; based on the mapping relationship between the preprocessed image and the intermediate image, for all The original image is remapped to obtain the output image.
  • the mapping relationship between the preprocessed image and the intermediate image includes the mapping between the at least two first lines and the at least two second lines relationship and a mapping relationship between the area between the at least two first lines in the preprocessed image and the area between the at least two second lines in the intermediate image.
  • the original image is remapped to obtain an output image, including: based on The mapping relationship between the pre-processing image and the intermediate image is to determine the pre-processing mapping information corresponding to the pre-processing image through an interpolation method, wherein the pre-processing mapping information is used to indicate that in the pre-processing image Mapping parameters of at least some of the pixels; based on the pre-processing mapping information, determine the mapping information corresponding to the area corresponding to the original image in the pre-processing image; perform mapping information on the area corresponding to the original image Scaling processing to determine mapping information corresponding to the original image; remapping the original image based on the mapping information corresponding to the original image to obtain the output image.
  • At least some of the pixels in the pre-processed image include pixels in the region between the at least two first lines in the pre-processed image and Pixels on the at least two first lines.
  • processing the original image to obtain a pre-processed image includes: performing binarization processing on the original image to obtain an input image; Perform scaling processing on the input image to obtain a zoomed image; perform filling processing on the zoomed image to obtain a filled image; perform region division on the filled image to obtain the preprocessed image .
  • the scaled image includes a first scaled image side and a second scaled image side opposite to each other
  • the pre-processed image includes a first pre-scaled image side opposite to each other.
  • a processed image side and a second pre-processed image side the first pre-processed image side corresponds to the first scaled image side
  • the second pre-processed image side corresponds to the second scaled image side
  • the side of the side of the second scaled image away from the side of the first scaled image is filled with the second filling area to obtain the filled image, wherein the two opposite sides of the first filling area are the first The side of the scaled image and the side of the first pre-processed image, and the two sides opposite to each other of the second filled area
  • the size of the first filled area is the same as that of the second filled area.
  • processing the original image to obtain a pre-processed image includes: performing binarization processing on the original image to obtain an input image; performing filling processing on the input image to obtain a filled image; performing scaling processing on the filled image to obtain a scaled image; performing region division on the scaled image to obtain the preprocessed image .
  • the at least two first lines are at least two bisector lines that bisect the preprocessed image along the same direction.
  • the warping processing model is a model based on a neural network.
  • image content in the original image is distorted.
  • the image processing method provided by at least one embodiment of the present disclosure further includes: training the warp processing model, wherein training the warp processing model includes: generating a training image, wherein the training image includes at least two training lines, The at least two training lines are arranged side by side in sequence along the same direction; based on the training image, a target image corresponding to the training image is generated, wherein the target image includes at least two target training lines, and the at least two The target training lines are arranged side by side in sequence along the same direction, and the at least two target training lines correspond to the at least two training lines; based on the training image and the target image, the distortion processing model to be trained Perform training to obtain the trained warp processing model.
  • training the warp processing model includes: generating a training image, wherein the training image includes at least two training lines, The at least two training lines are arranged side by side in sequence along the same direction; based on the training image, a target image corresponding to the training image is generated, wherein the target image includes at least two target training lines,
  • the warping model to be trained is trained to obtain the trained warping model, It includes: processing the training image through the warp processing model to be trained to obtain an output training image, wherein the output training image includes at least two output lines, and the at least two output lines are sequentially along the same direction Arranged side by side, and the at least two output lines correspond to the at least two training lines; based on the output training image and the target image, adjust the parameters of the warping model to be trained; When the loss function corresponding to the warping model to be trained meets the predetermined condition, obtain the trained warping model, and when the loss function corresponding to the warping model to be trained does not meet the predetermined condition, continue to input the The training image and the target image are used to repeatedly perform the above training process.
  • generating the training image includes: generating an input training image; performing scaling processing on the input training image to obtain a scaled input training image;
  • the scaled input training image is filled to obtain a filled input training image;
  • the filled input training image is distorted to obtain a distorted input training image;
  • the distorted input training image is performing region division to obtain the training image including the at least two training lines.
  • generating a target image corresponding to the training image based on the training image includes: based on the distortion parameter corresponding to the distortion processing, performing the training image Perform reverse warping to obtain the target image.
  • generating an input training image includes: acquiring an original training image; performing binarization on the original training image to obtain the input training image.
  • the at least two training lines are at least two bisector lines that bisect the training image along the same direction.
  • At least one embodiment of the present disclosure also provides an image processing device, including: an image acquisition module configured to acquire an original image; a first processing module configured to process the original image to obtain a pre-processed image, wherein , the pre-processed image includes at least two first lines, and the at least two first lines are arranged side by side in sequence along the same direction; the second processing module is configured to process the pre-processed image through a distortion processing model , to obtain an intermediate image, wherein the intermediate image includes at least two second lines, the at least two second lines are arranged side by side in sequence along the same direction, and the at least two second lines and the at least two first One-to-one correspondence between lines; the mapping module is configured to remap the original image based on the mapping relationship between the preprocessed image and the intermediate image to obtain an output image.
  • an image acquisition module configured to acquire an original image
  • a first processing module configured to process the original image to obtain a pre-processed image, wherein , the pre-processed image includes at
  • At least one embodiment of the present disclosure further provides an electronic device, including: a memory storing computer-executable instructions in a non-transitory manner; a processor configured to run the computer-executable instructions, wherein the computer-executable instructions are The processor implements the image processing method according to any embodiment of the present disclosure when running.
  • At least one embodiment of the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer-executable instructions, and when executed by a processor, the computer-executable instructions can The image processing method according to any one of the embodiments of the present disclosure is implemented.
  • Fig. 1 is a schematic flowchart of an image processing method provided by at least one embodiment of the present disclosure
  • Fig. 2 is a schematic diagram of an original image provided by at least one embodiment of the present disclosure
  • Fig. 3 is a schematic diagram of a preprocessed image provided by at least one embodiment of the present disclosure
  • Fig. 4A is a schematic diagram of a scaled image provided by at least one embodiment of the present disclosure.
  • Fig. 4B is a schematic diagram of a filled image provided by at least one embodiment of the present disclosure.
  • Fig. 5 is a schematic diagram of an intermediate image provided by at least one embodiment of the present disclosure.
  • Fig. 6 is a schematic diagram of an output image provided by at least one embodiment of the present disclosure.
  • FIG. 7 is a flowchart of a model training method provided by at least one embodiment of the present disclosure.
  • Fig. 8A is a schematic diagram of an original training image provided by at least one embodiment of the present disclosure.
  • Fig. 8B is a schematic diagram of a filled training image provided by at least one embodiment of the present disclosure.
  • Fig. 8C is a schematic diagram of a warped training image provided by at least one embodiment of the present disclosure.
  • Fig. 8D is a schematic diagram of a training image provided by at least one embodiment of the present disclosure.
  • Fig. 8E is a schematic diagram of a target image provided by at least one embodiment of the present disclosure.
  • Fig. 9 is a schematic block diagram of an image processing device provided by at least one embodiment of the present disclosure.
  • Fig. 10 is a schematic block diagram of an electronic device provided by at least one embodiment of the present disclosure.
  • Fig. 11 is a schematic diagram of a non-transitory computer-readable storage medium provided by at least one embodiment of the present disclosure
  • Fig. 12 is a schematic diagram of a hardware environment provided by at least one embodiment of the present disclosure.
  • neural network models can be used to identify electronic images to obtain information recorded in electronic images.
  • the electronic image can be taken or scanned by the user.
  • the process of obtaining the electronic image due to the shooting angle and other reasons, it is unavoidable that the content in the electronic image will be distorted or deformed, so that the neural network model can be recognized. The result is not accurate.
  • At least one embodiment of the present disclosure provides an image processing method.
  • the image processing method includes: acquiring an original image; processing the original image to obtain a preprocessed image, wherein the preprocessed image includes at least two first lines, and the at least two first lines are arranged side by side in sequence along the same direction;
  • the warping processing model processes the preprocessed image to obtain an intermediate image, wherein the intermediate image includes at least two second lines, the at least two second lines are arranged side by side in sequence along the same direction, and the at least two second lines are connected with the at least two second lines One-to-one correspondence; based on the mapping relationship between the preprocessed image and the intermediate image, the original image is remapped to obtain the output image.
  • the pre-processed image is processed by using the warping processing model, and then according to the mapping relationship between the input and output of the warping processing model, that is, the mapping between the pre-processing image and the intermediate image Relationship, remap the original image to obtain the output image, so as to realize the correction of the original image, effectively solve the problem of image distortion, improve the accuracy of the recognition result based on the output image, improve the efficiency of image recognition, and enhance the image
  • the readability of the image improves the user's experience of viewing the output image.
  • At least one embodiment of the present disclosure also provides an image processing device, an electronic device, and a non-transitory computer-readable storage medium.
  • the image processing method provided by the embodiment of the present disclosure can be applied to the image processing device provided by the embodiment of the present disclosure, and the image processing device can be configured on an electronic device.
  • the electronic device may be a personal computer, a mobile terminal, etc.
  • the mobile terminal may be a hardware device with various operating systems, such as a mobile phone and a tablet computer. That is to say, the execution subject of the image processing method may be a personal computer, a mobile terminal, and the like.
  • Fig. 1 is a schematic flowchart of an image processing method provided by at least one embodiment of the present disclosure
  • Fig. 2 is a schematic diagram of an original image provided by at least one embodiment of the present disclosure.
  • the image processing method provided by the embodiment of the present disclosure includes the following steps S10 to S13.
  • step S10 an original image is acquired.
  • the original image is an image obtained by photographing or scanning an object
  • the object includes at least one of various characters, various symbols and various graphics
  • the characters may include Chinese (for example, Chinese characters or pinyin), English , Japanese, French, Korean, Latin, numbers, etc.
  • Symbols can include mathematical symbols and punctuation marks, etc.
  • Mathematical symbols include plus sign, minus sign, greater than sign, less than sign, percent sign, etc.
  • Punctuation marks can include periods, commas , question marks, etc.
  • graphics can include straight lines, curves, circles, rectangles, heart shapes, various pictures, etc., as shown in Figure 2, the original image 100 can include Chinese characters, numbers, graphics of houses (for example, Xiaohongjia, schools, etc.), graphics of characters, etc.
  • the original image can be various types of images, such as business cards, test papers, exercise sets, contracts, invoices, etc., so that the original images can be images of shopping lists, images of restaurant receipts, images of test papers, and exercise sets. images of contracts, images of contracts, etc. For example, characters, symbols and graphics can be obtained by handwriting, printing or machine.
  • the image content in the original image is distorted, that is, the object in the original image is deformed, the object in the original image is inconsistent with the actual shape of the object, for example, the object in the object Characters located on the same line produce skew, distortion, distortion, etc.
  • warping may include one or more of translation, rotation, scaling, affine transformation, perspective transformation, cylindrical transformation, and the like. For example, as shown in FIG.
  • the original image 100 may be an image obtained by photographing a page of a problem set (for example, a math problem set, etc.), and the text in the original image 100 is distorted, for example, In this page of the exercise set, the lines connecting the centers of the texts in "Integer Tens Plus One-Digit and Corresponding Subtraction" are on the same straight line. However, in the original image 100, "Integer Tens Plus One-digit number and corresponding subtraction” is distorted, and the connecting lines of the centers of each text in "Integer tens plus one-digit number and corresponding subtraction" are not on the same straight line, but on a curve (irregular or regular curve )superior.
  • a problem set for example, a math problem set, etc.
  • the shape of the original image may be various suitable shapes such as a rectangle.
  • the shape and size of the original image can be set by the user according to the actual situation, which is not limited by the embodiments of the present disclosure.
  • the original image may be an image captured by an image acquisition device (for example, a digital camera or a camera on a mobile phone, etc.), and the original image may be a grayscale image, a black and white image, or a color image.
  • the original image refers to a form that presents an object in a visual manner, such as a picture of the object.
  • the original image may also be obtained by means of scanning or the like.
  • the original image may be an image directly captured by the image acquiring device, or may be an image obtained after preprocessing the captured image.
  • the image processing method may also include preprocessing the images directly collected by the image acquisition device operation.
  • the preprocessing may include, for example, cropping, gamma (Gamma) correction, or noise reduction filtering on the image directly captured by the image acquisition device. Preprocessing can eliminate irrelevant information or noise information in the original image, so as to facilitate the subsequent processing of the original image.
  • Fig. 3 is a schematic diagram of a pre-processed image provided by at least one embodiment of the present disclosure.
  • the preprocessed image shown in FIG. 3 is an image obtained by processing the original image shown in FIG. 2 .
  • step S11 the original image is processed to obtain a preprocessed image.
  • step S11 includes: performing binarization processing on the original image to obtain an input image; performing scaling processing on the input image to obtain a zoomed image; performing padding processing on the zoomed image to obtain A filled image is obtained; the filled image is divided into regions to obtain a preprocessed image.
  • step S11 includes: performing grayscale processing on the original image to obtain an input image; performing scaling processing on the input image to obtain a zoomed image; performing filling processing on the zoomed image, To obtain a filled image; perform region division on the filled image to obtain a preprocessed image.
  • Binarization or grayscale processing is used to remove the interfering pixels in the original image, and only keep the content that needs to be processed, such as characters, graphics or images.
  • the method of binarization processing may include threshold method, bimodal method, P parameter method, big law method (OTSU method), maximum entropy method, iterative method and the like.
  • methods of grayscale processing include component method, maximum value method, average value method, and weighted average method.
  • binarization/grayscale processing can be adjusted arbitrarily, and is not limited to the above description. For example, scaling processing can be performed first, then filling processing, and finally Binarization/grayscale processing.
  • the dimensions of the input image and the original image can be the same.
  • the size of the padded image is larger than the size of the scaled image, and the size of the padded image is equal to the size of the preprocessed image.
  • the size of the scaled image is smaller than the size of the input image
  • the scaling process is an expansion process
  • the size of the scaled image is larger than the size of the input image.
  • binarization/grayscale processing can reduce the amount of data processing, thereby improving the processing speed of image processing; scaling processing can unify the size of the image to facilitate model processing; filling processing can prevent distortion after operation
  • the content corresponding to the object in the pre-processed image exceeds the screen area of the pre-processed image, so as to avoid loss of image content and ensure the integrity of the image content.
  • binarization/grayscale processing may not be performed, thereby reducing the processing flow.
  • the preprocessed image shown in FIG. 3 is the image after grayscale processing.
  • the preprocessed image 200 includes a first preprocessed image edge PB1, a second preprocessed image edge PB2, a third preprocessed image edge PB3 and a fourth preprocessed image edge PB4, the first preprocessed image edge PB1
  • the side PB2 and the second pre-processing image are two sides facing each other, and the side PB3 of the third pre-processing image and the side PB4 of the fourth pre-processing image are two sides facing each other.
  • the pre-processed image 200 can be a rectangle.
  • the first pre-processed image side PB1 and the second pre-processed image side PB2 are parallel to each other and parallel to the X1 direction; the third pre-processed image side PB3 and the fourth pre-processed image The sides PB4 are parallel to each other and to the Y1 direction; the first pre-processing image side PB1 and the third pre-processing image side PB3 are perpendicular to each other.
  • the X1 direction is the width direction of the pre-processed image 200
  • the Y1 direction is the height direction of the pre-processed image 200 .
  • the pre-processed image includes at least two first lines, the at least two first lines are arranged side by side in sequence along the same direction, and the at least two first lines are located between the side of the first pre-processed image and the side of the second pre-processed image of the pre-processed image.
  • the sides are arranged along a direction from the side of the first pre-processed image to the side of the second pre-processed image.
  • the preprocessed image 200 may include at least two first lines L1, and the at least two first lines L1 are along the same direction (for example, Y1 direction, that is, the height of the preprocessed image 200 direction) are arranged side by side. At least two first lines L1 are parallel to each other and parallel to the X1 direction. At least two first lines L1 are located between the first pre-processed image side PB1 and the second pre-processed image side PB2.
  • the arrangement of the at least two first lines L1 is not limited to the one shown in FIG. direction, at this time, at least two first lines L1 are parallel to the Y1 direction, and are located between the third pre-processing image side PB3 and the fourth pre-processing image side PB4.
  • At least two first lines L1 are at least two bisector lines that equally divide the preprocessed image 200 along the same direction (for example, Y1 direction), that is to say , the distance h3 between any two adjacent first lines L1 is a fixed value.
  • the number of at least two first lines L1 can be set according to actual conditions.
  • the number of at least two first lines L1 can be 23.
  • the image 200 is equally divided into 24 parts along the edge PB3 of the third pre-processed image, so as to obtain 23 first lines L1.
  • the distance h3 between any two adjacent first lines L1 is 32 pixels.
  • the number of first lines L1 can be less or more, for example, the number of first lines L1 can be within the numerical range of 12-48, for example, 12 or 48, the more the number of first lines L1 , the final output image is more accurate, but the amount of data processing is more.
  • the first line L1 is represented by a thicker line.
  • the width of the first line L1 can be set according to actual conditions, for example, it can be 1-2 pixels.
  • Fig. 4A is a schematic diagram of a scaled image provided by at least one embodiment of the present disclosure
  • Fig. 4B is a schematic diagram of a filled image provided by at least one embodiment of the present disclosure.
  • the filled image shown in FIG. 4B is obtained by filling the zoomed image shown in FIG. 4A .
  • the scaled image 300 includes a first scaled image side CB1 and a second scaled image side CB2 opposite to each other.
  • the first preprocessed image side corresponds to the first scaled image side CB1
  • the second preprocessed image side corresponds to the second scaled image side CB2, that is, in the preprocessed image
  • the first preprocessed image side corresponds to the first scaled image side
  • the image side CB1 is located on the same side, such as the upper side shown in FIG. 4A
  • the second preprocessed image side and the second scaled image side CB2 are located on the same side, such as the lower side shown in FIG. 4A .
  • filling the scaled image to obtain the filled image includes: filling the first filling area on the side of the first scaled image away from the side of the second scaled image and filling the area on the side of the second scaled image The side away from the side of the first scaled image is filled with the second filled area to obtain a filled image.
  • the filled image includes a scaled image, a first filled area and a second filled area.
  • the preprocessed image includes the filled image and at least one first line.
  • the two opposite sides of the first filled area are the first scaled image side and the first pre-processed image side
  • the two opposite sides of the second filled area are the second scaled image side and the second scaled image side.
  • the first padded region 310 is padded (e.g., spliced) to the side of the first scaled image side CB1 of the scaled image 300 away from the second scaled image side CB2,
  • the second filling area 320 fills (eg, stitches) to a side of the second scaled image side CB2 of the scaled image 300 away from the first scaled image side CB1 .
  • the filled image 2000 includes a complete area composed of the scaled image 300 , the first filled area 310 and the second filled area 320 .
  • the filled image 2000 includes a first filled image side FB1 and a second filled image side FB2 opposite to each other.
  • the first filling image edge FB1 is the first preprocessing image edge
  • the second filling image edge FB2 is the second preprocessing image edge.
  • the scaled image 300 further includes a third scaled image side CB3 and a fourth scaled image side CB4 opposite to each other.
  • the zoomed image 300 may be a rectangle.
  • the first zoomed image side CB1 and the second zoomed image side CB2 are parallel to each other and parallel to the X2 direction;
  • the third zoomed image side CB3 and the fourth zoomed image side CB4 are parallel to each other parallel to the Y2 direction;
  • the first zoomed image side CB1 and the third zoomed image side CB3 are perpendicular to each other.
  • the X2 direction is the width direction of the zoomed image 300
  • the Y2 direction is the height direction of the zoomed image 300 .
  • the first filling area 310 may be a rectangle, and the second filling area 320 may also be a rectangle.
  • the length of the side parallel to the Y2 direction of the first padding area 310 can be h1
  • the length of the side parallel to the Y2 direction of the second padding area 320 can be h2
  • the first scaled image side The length of CB1 is w1
  • the length of the side parallel to the X2 direction of the first filling region 310 is w1
  • the length of the side parallel to the X2 direction of the second filling region 320 is w1.
  • the size of the first filling area 310 is the same as the size of the second filling area 320 , at this time, h1 is equal to h2 .
  • h1 may be 64 pixels.
  • the size of the image 300 after zooming may be 576 (pixels)*640 (pixels)
  • the size of the filled image 2000 may be 576 (pixels). *768 (pixels).
  • the pixel value of each pixel in the first filling area 310 and the second filling area 320 can be set according to actual conditions, for example, both are 0, which is not limited in the present disclosure.
  • the scaling process may be performed first, and then the filling process may be performed.
  • the present disclosure is not limited thereto.
  • the filling process may be performed first, and then the scaling process may be performed.
  • the specific filling parameters corresponding to the filling process can be set according to the actual situation, which is not limited in the present disclosure.
  • the filled image may be divided into regions along the height direction of the filled image by using at least two first lines to obtain a preprocessed image.
  • step S11 includes: performing binarization processing on the original image to obtain an input image; performing filling processing on the input image to obtain a filled image; performing scaling processing on the filled image, to obtain a zoomed image; the zoomed image is divided into regions to obtain a preprocessed image; or, step S11 includes: grayscale processing is performed on the original image to obtain an input image; filling processing is performed on the input image to obtain The filled image is obtained; the filled image is scaled to obtain a scaled image; the scaled image is divided into regions to obtain a preprocessed image.
  • the padding process can be determined according to the distortion direction of the image content in the original image, for example, if the image content in the original image is distorted in the length direction, then in the padding process, in the two sides of the length direction of the image Fill a padding area on each side of the image; if the image content in the original image is distorted in the width direction, in the padding process, fill a padding area on each of the two sides of the width direction of the image; if the original image is The content of the image is distorted in both the length direction and the width direction, then in the padding process, a padding area is filled on each of the two sides in the length direction of the image, and at the same time, a padding area is filled on each of the two sides in the width direction of the image The sides are also filled with a padding area.
  • Fig. 5 is a schematic diagram of an intermediate image provided by at least one embodiment of the present disclosure.
  • the intermediate image 400 shown in FIG. 5 is an image obtained after processing the pre-processed image shown in FIG. 3 through a warping processing model.
  • step S12 the preprocessed image is processed by the warping processing model to obtain an intermediate image.
  • the warp processing model may be implemented using machine learning technology (eg, deep learning technology).
  • the warp processing model may be a model based on a neural network.
  • the distortion processing model can use the pix2pixHD (pixel to pixel HD) model, which uses a multi-level generator (coarse-to-fine generator) and a multi-scale discriminator (multi-scale discriminator) to distort the preprocessed image Processing to generate an intermediate image after warping.
  • the generator of the pix2pixHD model includes a global generator network (global generator network) and a local enhancer network (local enhancer network).
  • the global generator network part adopts the U-Net structure, and the features output by the global generator network part are extracted from the local enhancement network part.
  • the feature fusion of the local enhancement network is used as the input information of the local enhancement network part, and the warped intermediate image is output by the local enhancement network part.
  • the warp processing model can also use other models, such as U-Net model, etc., which is not limited in the present disclosure. The training process for the warping processing model is described later and will not be repeated here.
  • the intermediate image includes at least two second lines, the at least two second lines are arranged side by side in sequence along the same direction, and the at least two second lines are in one-to-one correspondence with the at least two first lines.
  • the intermediate image 400 includes at least two second lines L2, and at least two second lines L2 are arranged side by side in sequence along the same direction (for example, the Y3 direction, that is, the height direction of the intermediate image 400).
  • the extending direction of the at least two second lines L2 is the X3 direction.
  • the at least two second lines L2 shown in FIG. 5 correspond one-to-one to the at least two first lines L1 shown in FIG. 3 .
  • the second line L2 is a twisted line of the first line L1. As shown in FIG. 5 , each second line L2 is a regular or irregular curve, and the shapes of each second line L2 are different. It should be noted that one or several second lines L2 may also be straight lines, and the present disclosure does not specifically limit the shape and other properties of the second lines L2.
  • the X1 direction, the X2 direction and the X3 direction are parallel to each other, and the Y1 direction, the Y2 direction and the Y3 direction are also parallel to each other.
  • the X1 direction, the X2 direction and the X3 direction are all width directions of the image, for example, the width direction of the image is parallel to the horizontal direction.
  • the Y1 direction, the Y2 direction and the Y3 direction are all height directions of the image, for example, the height direction of the image is parallel to the vertical direction.
  • Fig. 6 is a schematic diagram of an output image provided by at least some embodiments of the present disclosure.
  • the output image shown in FIG. 6 is an image obtained by processing the original image shown in FIG. 2 through the image processing method provided by the embodiment of the present disclosure.
  • step S13 based on the mapping relationship between the preprocessed image and the intermediate image, the original image is remapped to obtain an output image.
  • the mapping relationship between the preprocessing image and the intermediate image includes the mapping relationship between at least two first lines and at least two second lines and the area between the at least two first lines in the preprocessing image and the intermediate image The mapping relationship between regions between at least two second lines in .
  • the region between at least two first lines in the preprocessed image and at least two regions in the intermediate image need to be determined according to the mapping relationship between at least two first lines and at least two second lines.
  • the mapping relationship between the regions between the second lines need to be determined according to the mapping relationship between at least two first lines and at least two second lines.
  • step S13 may include: determining mapping information corresponding to the original image based on the mapping relationship between the preprocessed image and the intermediate image; remapping the original image based on the mapping information corresponding to the original image, to get the output image.
  • determining the mapping information corresponding to the original image includes: based on the mapping relationship between the preprocessed image and the intermediate image, determining the processing the preprocessing mapping information corresponding to the image; determining the mapping information corresponding to the area corresponding to the original image in the preprocessing image based on the preprocessing mapping information; performing scaling processing on the mapping information of the area corresponding to the original image to determine the The mapping information corresponding to the image.
  • the preprocessing mapping information is used to indicate mapping parameters of at least some pixels in the preprocessing image.
  • At least some of the pixels in the pre-processed image include pixels in a region between at least two first lines and pixels on at least two first lines in the pre-processed image.
  • the preprocessed image 200 includes an area A1 and an area A2.
  • the area A1 and the area A2 are not located between the two first lines L1.
  • At least some pixels in the preprocessed image 200 include the pixels in the preprocessed image. All the pixels except area A1 and area A2.
  • preprocessing mapping information may also indicate mapping parameters of all pixels in the preprocessing image, which is not limited in the present disclosure.
  • the original image is remapped according to the mapping relationship between the input and output of the distortion processing model (that is, based on the mapping relationship between the preprocessed image and the intermediate image), so as to realize the correction of the original image after distortion , to obtain the output image, effectively solve the problem of image distortion, improve the accuracy of the recognition result based on the output image, improve the efficiency of image recognition, enhance the readability of the image, and improve the user's experience of viewing the output image.
  • the area between any two adjacent second lines in the intermediate image may correspond to the area between corresponding two adjacent first lines in the preprocessed image, and each second line in the intermediate image may correspond to the preprocessed image.
  • the corresponding first line in the image is processed, so that pre-processing mapping information corresponding to the pre-processing image can be determined through an interpolation method based on the mapping relationship between the pre-processing image and the intermediate image.
  • the area between any two adjacent first lines L1 (for example, the first line L11 and the first line L12 ) in the preprocessed image 200 is the same as the area between the two adjacent lines in the intermediate image 400 .
  • the areas between the two second lines L2 (for example, the second line L21 and the second line L22) respectively corresponding to the first line L1 are mapped correspondingly to each other, that is to say, the first line L11 and the first line L12 in the preprocessed image 200
  • the area in between needs to be mapped to the area between the second line L21 and the second line L22 in the intermediate image 400 .
  • the first line L1 in the preprocessed image 200 and the second line L2 corresponding to the first line L1 in the intermediate image 400 are also mapped correspondingly to each other, for example, the first line L11 and the first line L12 in the preprocessed image 200 need to be mapped are the second line L21 and the second line L22 in the intermediate image 400 .
  • interpolation methods may include methods such as nearest neighbor interpolation, bilinear interpolation, bicubic spline interpolation, bicubic interpolation, and Lanczos interpolation (lanczos), and the disclosure does not limit the interpolation methods.
  • the mapping information corresponding to the original image may include mapping parameters corresponding to all pixels in the original image, that is, the number of mapping parameters in the mapping information corresponding to the original image may be the same as the number of all pixels in the original image.
  • the mapping parameter corresponding to a pixel may represent the coordinate value of the position to which the pixel is mapped; or, may also represent an offset between the coordinate value of the pixel and the coordinate value of the position to which the pixel is mapped.
  • the coordinate value of the pixel can represent the coordinate value in the coordinate system corresponding to the original image
  • the coordinate origin of the coordinate system corresponding to the original image is a certain pixel point of the original image (for example, the center of the original image corresponds to pixel or the pixel in the upper left corner of the original image)
  • the two coordinate axes of the coordinate system corresponding to the original image are the width and height of the original image respectively.
  • the coordinate value of the position to which the pixel is mapped can represent the coordinate value in the coordinate system corresponding to the output image, and the coordinate origin of the coordinate system corresponding to the output image corresponds to the coordinate origin of the coordinate system corresponding to the original image in the output image
  • the two coordinate axes of the coordinate system corresponding to the output image are the width and height of the output image respectively.
  • mapping parameters corresponding to each pixel in the original image can be determined, so that the mapping information corresponding to the original image can be obtained.
  • the mapping information corresponding to the original image Based on the mapping information corresponding to the original image, the mapped position of each pixel after correcting the image distortion can be determined, thereby realizing the mapping process.
  • remapping the original image based on the mapping information corresponding to the original image to obtain an output image may include: calling a remapping function (ie, a remap function) in opencv based on the mapping information corresponding to the original image Remap the original image to get the output image.
  • a remapping function ie, a remap function
  • the lines connecting the centers of the characters in "Ten plus one digit and the corresponding subtraction" are on the same straight line, so that the text can be straightened, thereby effectively correcting the original image
  • the distorted state solves the problem of image distortion and deformation, improves the accuracy of recognition results based on the output image, improves the efficiency of image recognition, enhances the readability of the image, and improves the user's experience of viewing the output image.
  • the image processing method further includes: training a warping processing model.
  • At least one embodiment of the present disclosure further provides a model training method for realizing the above operation of training a warping processing model.
  • Fig. 7 is a flowchart of a model training method provided by at least one embodiment of the present disclosure.
  • the model training method may include training a warping processing model.
  • training the warping processing model includes the following steps S20-S22.
  • Step S20 Generate training images.
  • the training image includes at least two training lines, and the at least two training lines are arranged side by side sequentially along the same direction.
  • Step S21 Based on the training image, generate a target image corresponding to the training image.
  • the target image includes at least two target training lines, the at least two target training lines are arranged side by side in sequence along the same direction, and the at least two target training lines are in one-to-one correspondence with the at least two training lines.
  • Step S22 Based on the training image and the target image, train the warping model to be trained to obtain a trained warping model.
  • step S20 may include: generating an input training image; performing scaling processing on the input training image to obtain a scaled input training image; performing padding processing on the scaled input training image to obtain a filled the input training image; distorting the filled input training image to obtain a distorted input training image; performing region division on the distorted input training image to obtain a training image including at least two training lines.
  • step S20 may include: generating an input training image; filling the input training image to obtain a filled input training image; performing scaling processing on the filled input training image to obtain a scaled The input training image after the warping process is performed on the scaled input training image to obtain a warped input training image; the warped input training image is divided into regions to obtain a training image including at least two training lines.
  • step S20 the order of the filling process and the scaling process can be set according to actual conditions, which is not limited in the present disclosure.
  • the scaling process is performed first and then the filling process is performed as an example for illustration.
  • step S20 generating the input training image may include: acquiring an original training image; performing binarization or grayscale processing on the original training image to obtain the input training image. Perform binarization or grayscale processing on the original training image, so that the interference (noise) in the original training image can be removed, and the amount of data processing in the subsequent training process can also be reduced.
  • the binarization or grayscale processing is not a necessary step, and the original training image can also be directly filled, scaled and divided to obtain the training image.
  • Fig. 8A is a schematic diagram of an original training image provided by at least one embodiment of the present disclosure.
  • the original training image may be an image that has not been distorted. As shown in FIG. 8A , in the original training image 810, all texts are not distorted.
  • Fig. 8B is a schematic diagram of a filled training image provided by at least one embodiment of the present disclosure.
  • the filled training image shown in FIG. 8B may be an image after scaling and filling processing are performed on the original training image shown in FIG. 8A .
  • the input training image can be scaled and filled to a fixed size, and the uniform size of the image can facilitate the processing of the image by the warping model to be trained.
  • the input training image may first be scaled to obtain a scaled training image 830, the size of the scaled training image 830 may be 576*640 (pixels), and after scaling
  • the training image 830 includes the image side CTB1 and the image side CTB2 opposite to each other, a training filling area 831 is filled on the side of the image side CTB1 of the zoomed training image 830 away from the image side CTB2, and the zoomed training image 830
  • the side of the image side CTB2 far away from the image side CTB1 fills a training padding area 832, thereby obtaining the training image 820 after filling
  • the training image 820 after filling can include the training padding area 831
  • the training image 830 after scaling and training Fill area 832 constitutes the area.
  • the padding process can prevent the contents from exceeding the screen after the distortion operation.
  • the size of the training padding area 831 and the size of the training padding area 832 can be the same, and the size of the training padding area 831 can be 576*64 (pixels), so that the training image after padding
  • the size of the 820 can be 576*768 (pixels).
  • Fig. 8C is a schematic diagram of a warped training image provided by at least one embodiment of the present disclosure.
  • the warped training image shown in Fig. 8C may be an image after warping the filled training image shown in Fig. 8B .
  • opencv can be used to implement warping processing. For example, first, a set of offsets is randomly generated, and then Gaussian filtering is performed on the offsets to make the offsets smooth and continuous , use the offset after Gaussian filtering to generate a warped parameter matrix (for example, map), and call the remap function in opencv to remap the filled image to achieve warping processing, thereby obtaining a warped training image.
  • a warped parameter matrix for example, map
  • Fig. 8D is a schematic diagram of a training image provided by at least one embodiment of the present disclosure.
  • the training image 850 shown in FIG. 8D may be an image after processing the warped image 840 shown in FIG. 8C .
  • the training image 850 may include at least two training lines TL1, and the at least two training lines TL1 are along the same direction as the training image 850 (for example, the height direction Y4 of the training image 850). ) at least two bisectors for bisecting.
  • the training lines TL1 may be parallel to each other and extend along the width direction X4 of the training image 850 .
  • the warped image 840 can be equally divided, and an equal line can be drawn to obtain a training image 850 .
  • the warped image 840 may be equally divided along its height direction.
  • the quantity of at least two training lines TL1 can be set according to actual conditions, as shown in Figure 8D, the quantity of at least two training lines TL1 can be 23, however, the quantity of at least two training lines TL1 can be less or more, for example , 12 to 48, etc., the more the number of at least two training lines TL1 is, the more accurate the warping processing model obtained after training is, but the amount of data processing is more.
  • Fig. 8E is a schematic diagram of a target image provided by at least one embodiment of the present disclosure.
  • the target image 860 shown in FIG. 8E may be an image obtained by reverse warping the training image 850 shown in FIG. 8D .
  • step S21 includes: performing reverse warping processing on the training image based on the warping parameters corresponding to the warping process to obtain the target image.
  • the target image 860 includes at least two target training lines TL2, at least two target training lines TL2 are arranged in sequence along the height direction of the target image 860, and at least two target training lines TL2 extend along the width direction of the target image 860 .
  • the at least two target training lines TL2 in the target image 860 are in one-to-one correspondence with the at least two training lines TL1 in the training image 850 shown in FIG. To distort the resulting lines.
  • step S21 may include: processing the training image through the warping model to be trained to obtain an output training image; based on the output training image and the target image, adjusting the parameters of the warping model to be trained ; When the loss function corresponding to the distortion processing model to be trained meets the predetermined condition, the trained distortion processing model is obtained, and when the loss function corresponding to the distortion processing model to be trained does not meet the predetermined condition, continue to input the training image and the target image to Repeat the above training process.
  • the output training image includes at least two output lines, the at least two output lines are arranged side by side in sequence along the same direction, and the at least two output lines correspond to the at least two training lines one by one, and the at least two output lines can be
  • the warp processing model processes the lines after at least two training lines.
  • step S21 the warping processing model to be trained processes the image content and the training line in the training image as a whole to obtain an output training image.
  • adjusting the parameters of the warping model to be trained may include: based on the output training image and the target image, calculating the loss function corresponding to the warping model to be trained The loss value of the warping model; and adjust the parameters of the warping model to be trained based on the loss value.
  • the predetermined condition corresponds to the minimization of a loss function corresponding to the warping model to be trained when a certain number of training images are input.
  • the predetermined condition is that the number of training times or training cycles corresponding to the warping model to be trained reaches a predetermined number, and the predetermined number may be millions, as long as the number of training images used for training is large enough.
  • FIG. 9 is a schematic block diagram of an image processing device provided by at least one embodiment of the present disclosure.
  • an image processing apparatus 900 may include an image acquisition module 901 , a first processing module 902 , a second processing module 903 and a mapping module 904 .
  • the image acquisition module 901 is configured to acquire original images.
  • the image acquisition module 901 is used to implement step S10 shown in FIG. 1 .
  • step S10 shown in FIG. 1 in the embodiment of the above-mentioned image processing method, repeat The place will not be repeated.
  • the image acquisition module 901 may include a camera, such as a camera of a smart phone, a camera of a tablet computer, a camera of a personal computer, a lens of a digital camera, or even a web camera.
  • a camera such as a camera of a smart phone, a camera of a tablet computer, a camera of a personal computer, a lens of a digital camera, or even a web camera.
  • the first processing module 902 is configured to process the original image to obtain a pre-processed image.
  • the preprocessed image includes at least two first lines, and the at least two first lines are sequentially arranged side by side along the same direction.
  • the first processing module 902 is used to realize the step S11 shown in FIG. 1 .
  • the specific description of the functions realized by the first processing module 902 please refer to the relevant description of the step S11 shown in FIG. 1 in the embodiment of the above-mentioned image processing method , the repetitions will not be repeated.
  • the second processing module 903 is configured to process the pre-processed image by warping the processing model to obtain an intermediate image.
  • the intermediate image includes at least two second lines, the at least two second lines are arranged side by side in sequence along the same direction, and the at least two second lines are in one-to-one correspondence with the at least two first lines.
  • the second processing module 903 is used to realize the step S12 shown in FIG. 1 .
  • the functions realized by the second processing module 903 please refer to the relevant description of the step S12 shown in FIG. 1 in the embodiment of the above-mentioned image processing method , the repetitions will not be repeated.
  • the mapping module 904 is configured to remap the original image based on the mapping relationship between the preprocessed image and the intermediate image to obtain an output image.
  • the mapping module 904 is used to implement step S13 shown in FIG. 1.
  • step S13 shown in FIG. 1 For specific descriptions of the functions implemented by the mapping module 904, please refer to the relevant description of step S13 shown in FIG. 1 in the above-mentioned embodiment of the image processing method. No longer.
  • data communication may be performed among the image acquisition module 901 , the first processing module 902 , the second processing module 903 and the mapping module 904 .
  • the image processing device 900 may further include a model training module.
  • the model training module is configured to train the warp processing model.
  • the model training module may include an image generation submodule and a training submodule.
  • the image generating submodule is configured to: generate training images; and generate target images corresponding to the training images based on the training images.
  • the training image includes at least two training lines, the at least two training lines are arranged side by side in sequence along the same direction
  • the target image includes at least two target training lines, the at least two target training lines are arranged side by side in sequence along the same direction
  • at least The two target training lines are in one-to-one correspondence with at least two training lines.
  • the image generation sub-module is used to realize step S20 and step S21 shown in FIG. 7 .
  • step S20 and step S20 shown in FIG. 7 for specific descriptions about the functions realized by the image generation sub-module, reference can be made to step S20 and step S20 shown in FIG. 7 in the embodiment of the above-mentioned image processing method. The related description of S21 will not be repeated here.
  • the training submodule is configured to train the warping model to be trained based on the training image and the target image, so as to obtain a trained warping model.
  • the training sub-module is used to realize the step S22 shown in FIG. 7.
  • the training sub-module please refer to the relevant description of the step S22 shown in FIG. 7 in the embodiment of the above-mentioned image processing method. No longer.
  • the training submodule is configured to process the training image through the warping processing model to be trained to obtain an output training image; based on the output training image and the target image, adjust the parameters of the warping processing model to be trained; When the loss function corresponding to the warping model to be trained satisfies a predetermined condition, a trained warping model is obtained.
  • the image generation submodule is further configured to continue to generate at least one training image and a target image corresponding to the at least one training image when the loss function corresponding to the warping model to be trained does not meet the predetermined condition. At least one training image and its corresponding target image are used to repeatedly execute the above training process.
  • the image acquisition module 901, the first processing module 902, the second processing module 903, the mapping module 904 and/or the model training module include codes and programs stored in memory; the processor can execute the codes and programs to achieve the above Some or all of the functions of the image acquisition module 901, the first processing module 902, the second processing module 903, the mapping module 904 and/or the model training module described above.
  • the image acquisition module 901, the first processing module 902, the second processing module 903, the mapping module 904 and/or the model training module may be dedicated hardware devices, which are used to implement the above-mentioned image acquisition module 901, the first processing module 902, some or all functions of the second processing module 903, the mapping module 904 and/or the model training module.
  • the image acquisition module 901 , the first processing module 902 , the second processing module 903 , the mapping module 904 and/or the model training module may be a circuit board or a combination of multiple circuit boards for realizing the functions described above.
  • the circuit board or a combination of multiple circuit boards may include: (1) one or more processors; (2) one or more non-transitory memories connected to the processors; and (3) Processor-executable firmware stored in memory.
  • the image processing apparatus can achieve technical effects similar to those of the aforementioned image processing method, which will not be repeated here.
  • FIG. 10 is a schematic block diagram of the electronic device provided by at least one embodiment of the present disclosure.
  • an electronic device 1000 may include a processor 1001 and a memory 1002 .
  • the memory 1002 non-transitory stores computer-executable instructions; the processor 1001 is configured to execute the computer-executable instructions.
  • the image processing method according to any embodiment of the present disclosure can be realized.
  • the electronic device 1000 may further include a communication interface 1003 and a communication bus 1004 .
  • the processor 1001, the memory 1002 and the communication interface 1003 communicate with each other through the communication bus 1004, and the components such as the processor 1001, the memory 1002 and the communication interface 1003 can also communicate through a network connection.
  • the present disclosure does not limit the type and function of the network here.
  • communication bus 1004 may be a Peripheral Component Interconnect Standard (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like.
  • PCI Peripheral Component Interconnect Standard
  • EISA Extended Industry Standard Architecture
  • the communication bus 1004 can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
  • the communication interface 1003 is used to implement communication between the electronic device 1000 and other devices.
  • the processor 1001 and the memory 1002 may be set at the server (or cloud), or at the client (for example, a mobile device such as a mobile phone).
  • the processor 1001 may control other components in the electronic device 1000 to perform desired functions.
  • the processor 1001 can be a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable Logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • the central processing unit (CPU) may be an X86 or ARM architecture or the like.
  • the GPU can be integrated directly on the motherboard alone, or built into the north bridge chip of the motherboard.
  • a GPU can also be built into a central processing unit (CPU).
  • memory 1002 may include any combination of one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory.
  • the volatile memory may include random access memory (RAM) and/or cache memory (cache), etc., for example.
  • Non-volatile memory may include, for example, read only memory (ROM), hard disks, erasable programmable read only memory (EPROM), compact disc read only memory (CD-ROM), USB memory, flash memory, and the like.
  • ROM read only memory
  • EPROM erasable programmable read only memory
  • CD-ROM compact disc read only memory
  • USB memory flash memory, and the like.
  • One or more computer-executable instructions can be stored on the computer-readable storage medium, and the processor 1001 can run the computer-executable instructions to implement various functions of the electronic device 1000 .
  • Various application programs and various data can also be stored in the memory 1002 .
  • the electronic device 1000 can achieve technical effects similar to those of the foregoing image processing method, and repeated descriptions will not be repeated here.
  • Fig. 11 is a schematic diagram of a non-transitory computer-readable storage medium provided by at least one embodiment of the present disclosure.
  • one or more computer-executable instructions 1101 may be non-transitory stored on a non-transitory computer-readable storage medium 1100 .
  • one or more steps in the image processing method according to any embodiment of the present disclosure may be executed when the computer-executable instructions 1101 are executed by the processor.
  • the non-transitory computer-readable storage medium 1100 may be applied in the above-mentioned electronic device 1000 , for example, it may include the memory 1002 in the electronic device 1000 .
  • non-transitory computer-readable storage medium 1100 For example, for the description of the non-transitory computer-readable storage medium 1100, reference may be made to the description of the memory 1002 in the embodiment of the electronic device 1000, and repeated descriptions will not be repeated.
  • Fig. 12 is a schematic diagram of a hardware environment provided by at least one embodiment of the present disclosure.
  • the electronic device provided by the present disclosure can be applied in the Internet system.
  • the functions of the image processing apparatus and/or electronic equipment involved in the present disclosure can be realized by using the computer system provided in FIG. 12 .
  • Such computer systems can include personal computers, laptops, tablets, mobile phones, personal digital assistants, smart glasses, smart watches, smart rings, smart helmets, and any smart portable or wearable devices.
  • the specific system in this embodiment illustrates a hardware platform including a user interface using functional block diagrams.
  • Such computer equipment may be a general purpose computer equipment or a special purpose computer equipment. Both computer devices can be used to realize the image processing device and/or electronic device in this embodiment.
  • the computer system may include any components that implement the presently described information needed to achieve image processing.
  • a computer system can be realized by a computer device through its hardware devices, software programs, firmware, and combinations thereof.
  • the relevant computer functions for realizing the information required for image processing described in this embodiment can be implemented by a group of similar platforms in a distributed manner, Distribute the processing load of a computer system.
  • the computer system can include a communication port 250, which is connected to a network for data communication ("from/to network" in Figure 12), for example, the computer system can send and receive data through the communication port 250 Information and data, that is, the communication port 250 can realize wireless or wired communication between the computer system and other electronic devices to exchange data.
  • the computer system may also include a processor group 220 (ie, the processor described above) for executing program instructions.
  • the processor group 220 may consist of at least one processor (eg, CPU).
  • the computer system may include an internal communication bus 210 .
  • a computer system may include different forms of program storage units and data storage units (i.e., memory or storage media described above), such as hard disk 270, read-only memory (ROM) 230, random access memory (RAM) 240, which can be used to store Various data files used by the computer for processing and/or communicating, and possibly program instructions executed by the processor group 220 .
  • the computer system may also include an input/output 260 for enabling input/output data flow between the computer system and other components (eg, user interface 280, etc.).
  • input devices including, for example, touch screens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.
  • output devices including, for example, magnetic tapes, hard disks, etc.
  • communication interfaces including, for example, Ethernet, Wi-Fi, Wi-Fi, Wi-Fi, Wi-Fi, Wi-Fi, Wi-Fi, Wi-Fi, Wi-Fi, Wi-Fi, Wi-Fi, Wi-Fi, etc.
  • output devices including, for example, touch screens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.
  • storage devices including, for example, magnetic tapes, hard disks, etc.
  • communication interfaces including, for example, magnetic tapes, hard disks, etc.
  • FIG. 12 shows a computer system with various devices, it should be understood that the computer system is not required to have all of the devices shown and, instead, the computer system may have more or fewer devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Image Processing (AREA)

Abstract

An image processing method, an image processing apparatus, an electronic device, and a non-transitory computer-readable storage medium. The image processing method comprises: acquiring an original image; processing the original image to obtain a preprocessed image, the preprocessed image comprising at least two first lines, and the at least two first lines being sequentially arranged in parallel along the same direction; processing the preprocessed image by means of a distortion processing model to obtain an intermediate image, the intermediate image comprises at least two second lines, the at least two second lines being sequentially arranged in parallel along the same direction, and the at least two second lines corresponding one-to-one with the at least two first lines; and re-mapping the original image on the basis of a mapping relationship between the preprocessed image and the intermediate image, to obtain an output image.

Description

图像处理方法、图像处理装置、电子设备、存储介质Image processing method, image processing device, electronic device, storage medium 技术领域technical field
本公开的实施例涉及一种图像处理方法、图像处理装置、电子设备和非瞬时性计算机可读存储介质。Embodiments of the present disclosure relate to an image processing method, an image processing apparatus, electronic equipment, and a non-transitory computer-readable storage medium.
背景技术Background technique
随着数字化技术的发展,可以对物体进行扫描或拍摄以转换为电子图像,电子图像易于存储和在互联网中传输。此外,可以利用图像识别技术等对电子图像进行识别,以获取电子图像中记载的信息。然而,在对物体进行扫描或拍摄以得到电子图像的过程中,无法避免得到的电子图像中的内容会出现倾斜、扭曲或变形等情况,这种倾斜、扭曲或变形则会对电子图像的分析等处理产生不利的影响,例如,使得识别得到的结果不准确等,而且也影响用户的查阅体验。With the development of digital technology, objects can be scanned or photographed to be converted into electronic images, which are easy to store and transmit on the Internet. In addition, electronic images may be identified using image recognition technology to obtain information recorded in the electronic images. However, in the process of scanning or photographing an object to obtain an electronic image, it is unavoidable that the content in the obtained electronic image will be tilted, distorted or deformed, which will affect the analysis of the electronic image. Such processing has adverse effects, for example, making the recognition results inaccurate, etc., and also affects the user's viewing experience.
发明内容Contents of the invention
本公开至少一个实施例提供一种图像处理方法,包括:获取原始图像;对所述原始图像进行处理,以得到预处理图像,其中,所述预处理图像包括至少两条第一线,所述至少两条第一线沿同一方向依次并列排布;通过扭曲处理模型对所述预处理图像进行处理,以得到中间图像,其中,所述中间图像包括至少两条第二线,所述至少两条第二线沿同一方向依次并列排布,且所述至少两条第二线与所述至少两条第一线一一对应;基于所述预处理图像和所述中间图像之间的映射关系,对所述原始图像进行重映射,以得到输出图像。At least one embodiment of the present disclosure provides an image processing method, including: acquiring an original image; processing the original image to obtain a pre-processed image, wherein the pre-processed image includes at least two first lines, the At least two first lines are arranged side by side in sequence along the same direction; the preprocessed image is processed through a distortion processing model to obtain an intermediate image, wherein the intermediate image includes at least two second lines, and the at least two The second lines are arranged side by side in sequence along the same direction, and the at least two second lines correspond to the at least two first lines one by one; based on the mapping relationship between the preprocessed image and the intermediate image, for all The original image is remapped to obtain the output image.
例如,在本公开至少一个实施例提供的图像处理方法中,预处理图像和所述中间图像之间的映射关系包括所述至少两条第一线和所述至少两条第二线之间的映射关系和所述预处理图像中的所述至少两条第一线之间的区域和所述中间图像中的所述至少两条第二线之间的区域之间的映射关系。For example, in the image processing method provided in at least one embodiment of the present disclosure, the mapping relationship between the preprocessed image and the intermediate image includes the mapping between the at least two first lines and the at least two second lines relationship and a mapping relationship between the area between the at least two first lines in the preprocessed image and the area between the at least two second lines in the intermediate image.
例如,在本公开至少一个实施例提供的图像处理方法中,基于所述预处 理图像和所述中间图像之间的映射关系,对所述原始图像进行重映射,以得到输出图像,包括:基于所述预处理图像和所述中间图像之间的映射关系,通过插值方法确定与所述预处理图像对应的预处理映射信息,其中,所述预处理映射信息用于指示所述预处理图像中的至少部分像素的映射参数;基于所述预处理映射信息,确定所述预处理图像中的与所述原始图像对应的区域对应的映射信息;对与所述原始图像对应的区域的映射信息进行缩放处理,以确定与所述原始图像对应的映射信息;基于与所述原始图像对应的映射信息对所述原始图像进行重映射,以得到所述输出图像。For example, in the image processing method provided in at least one embodiment of the present disclosure, based on the mapping relationship between the preprocessed image and the intermediate image, the original image is remapped to obtain an output image, including: based on The mapping relationship between the pre-processing image and the intermediate image is to determine the pre-processing mapping information corresponding to the pre-processing image through an interpolation method, wherein the pre-processing mapping information is used to indicate that in the pre-processing image Mapping parameters of at least some of the pixels; based on the pre-processing mapping information, determine the mapping information corresponding to the area corresponding to the original image in the pre-processing image; perform mapping information on the area corresponding to the original image Scaling processing to determine mapping information corresponding to the original image; remapping the original image based on the mapping information corresponding to the original image to obtain the output image.
例如,在本公开至少一个实施例提供的图像处理方法中,所述预处理图像中的至少部分像素包括所述预处理图像中的所述至少两条第一线之间的区域中的像素和所述至少两条第一线上的像素。For example, in the image processing method provided in at least one embodiment of the present disclosure, at least some of the pixels in the pre-processed image include pixels in the region between the at least two first lines in the pre-processed image and Pixels on the at least two first lines.
例如,在本公开至少一个实施例提供的图像处理方法中,对所述原始图像进行处理,以得到预处理图像,包括:对所述原始图像进行二值化处理,以得到输入图像;对所述输入图像进行缩放处理,以得到缩放后的图像;对所述缩放后的图像进行填充处理,以得到填充后的图像;对所述填充后的图像进行区域划分,以得到所述预处理图像。For example, in the image processing method provided in at least one embodiment of the present disclosure, processing the original image to obtain a pre-processed image includes: performing binarization processing on the original image to obtain an input image; Perform scaling processing on the input image to obtain a zoomed image; perform filling processing on the zoomed image to obtain a filled image; perform region division on the filled image to obtain the preprocessed image .
例如,在本公开至少一个实施例提供的图像处理方法中,所述缩放后的图像包括彼此相对的第一缩放图像边和第二缩放图像边,所述预处理图像包括彼此相对的第一预处理图像边和第二预处理图像边,所述第一预处理图像边与所述第一缩放图像边对应,所述第二预处理图像边与所述第二缩放图像边对应,所述至少两条第一线在所述第一预处理图像边和所述第二预处理图像边之间沿着从所述第一预处理图像边到所述第二预处理图像边的方向排列,对所述缩放后的图像进行填充处理,以得到所述填充后的图像,包括:在所述第一缩放像边远离所述第二缩放图像边的一侧填补第一填充区域并在所述第二缩放图像边远离所述第一缩放图像边的一侧填补第二填充区域,以得到所述填充后的图像,其中,所述第一填充区域的彼此相对的两条边为所述第一缩放图像边和所述第一预处理图像边,所述第二填充区域的彼此相对的两条边为所述第二缩放图像边和所述第二预处理图像边。For example, in the image processing method provided in at least one embodiment of the present disclosure, the scaled image includes a first scaled image side and a second scaled image side opposite to each other, and the pre-processed image includes a first pre-scaled image side opposite to each other. A processed image side and a second pre-processed image side, the first pre-processed image side corresponds to the first scaled image side, the second pre-processed image side corresponds to the second scaled image side, and the at least Two first lines are arranged between the first pre-processed image side and the second pre-processed image side along the direction from the first pre-processed image side to the second pre-processed image side, for Filling the zoomed image to obtain the filled image includes: filling a first padding area on the side of the first zoomed image away from the side of the second zoomed image and filling the first padding area on the side of the second zoomed image The side of the side of the second scaled image away from the side of the first scaled image is filled with the second filling area to obtain the filled image, wherein the two opposite sides of the first filling area are the first The side of the scaled image and the side of the first pre-processed image, and the two sides opposite to each other of the second filled area are the side of the second scaled image and the side of the second pre-processed image.
例如,在本公开至少一个实施例提供的图像处理方法中,所述第一填充区域的尺寸和所述第二填充区域的尺寸相同。For example, in the image processing method provided in at least one embodiment of the present disclosure, the size of the first filled area is the same as that of the second filled area.
例如,在本公开至少一个实施例提供的图像处理方法中,对所述原始图像进行处理,以得到预处理图像,包括:对所述原始图像进行二值化处理,以得到输入图像;对所述输入图像进行填充处理,以得到填充后的图像;对所述填充后的图像进行缩放处理,以得到缩放后的图像;对所述缩放后的图像进行区域划分,以得到所述预处理图像。For example, in the image processing method provided in at least one embodiment of the present disclosure, processing the original image to obtain a pre-processed image includes: performing binarization processing on the original image to obtain an input image; performing filling processing on the input image to obtain a filled image; performing scaling processing on the filled image to obtain a scaled image; performing region division on the scaled image to obtain the preprocessed image .
例如,在本公开至少一个实施例提供的图像处理方法中,所述至少两条第一线为对所述预处理图像沿同一方向进行等分的至少两条等分线。For example, in the image processing method provided in at least one embodiment of the present disclosure, the at least two first lines are at least two bisector lines that bisect the preprocessed image along the same direction.
例如,在本公开至少一个实施例提供的图像处理方法中,所述扭曲处理模型为基于神经网络的模型。For example, in the image processing method provided in at least one embodiment of the present disclosure, the warping processing model is a model based on a neural network.
例如,在本公开至少一个实施例提供的图像处理方法中,所述原始图像中的图像内容被扭曲。For example, in the image processing method provided by at least one embodiment of the present disclosure, image content in the original image is distorted.
例如,本公开至少一个实施例提供的图像处理方法还包括:训练所述扭曲处理模型,其中,训练所述扭曲处理模型包括:生成训练图像,其中,所述训练图像包括至少两条训练线,所述至少两条训练线沿同一方向依次并列排布;基于所述训练图像,生成与所述训练图像对应的目标图像,其中,所述目标图像包括至少两条目标训练线,所述至少两条目标训练线沿同一方向依次并列排布,且所述至少两条目标训练线与所述至少两条训练线一一对应;基于所述训练图像和所述目标图像,对待训练的扭曲处理模型进行训练,以获得训练好的所述扭曲处理模型。For example, the image processing method provided by at least one embodiment of the present disclosure further includes: training the warp processing model, wherein training the warp processing model includes: generating a training image, wherein the training image includes at least two training lines, The at least two training lines are arranged side by side in sequence along the same direction; based on the training image, a target image corresponding to the training image is generated, wherein the target image includes at least two target training lines, and the at least two The target training lines are arranged side by side in sequence along the same direction, and the at least two target training lines correspond to the at least two training lines; based on the training image and the target image, the distortion processing model to be trained Perform training to obtain the trained warp processing model.
例如,在本公开至少一个实施例提供的图像处理方法中,基于所述训练图像和所述目标图像,对所述待训练的扭曲处理模型进行训练,以获得训练好的所述扭曲处理模型,包括:通过所述待训练的扭曲处理模型对所述训练图像进行处理,以得到输出训练图像,其中,所述输出训练图像包括至少两条输出线,所述至少两条输出线沿同一方向依次并列排布,且所述至少两条输出线与所述至少两条训练线一一对应;基于所述输出训练图像和所述目标图像,对所述待训练的扭曲处理模型的参数进行调整;在所述待训练的扭曲 处理模型对应的损失函数满足预定条件时,获得训练好的所述扭曲处理模型,在所述待训练的扭曲处理模型对应的损失函数不满足预定条件时,继续输入所述训练图像和所述目标图像以重复执行上述训练过程。For example, in the image processing method provided in at least one embodiment of the present disclosure, based on the training image and the target image, the warping model to be trained is trained to obtain the trained warping model, It includes: processing the training image through the warp processing model to be trained to obtain an output training image, wherein the output training image includes at least two output lines, and the at least two output lines are sequentially along the same direction Arranged side by side, and the at least two output lines correspond to the at least two training lines; based on the output training image and the target image, adjust the parameters of the warping model to be trained; When the loss function corresponding to the warping model to be trained meets the predetermined condition, obtain the trained warping model, and when the loss function corresponding to the warping model to be trained does not meet the predetermined condition, continue to input the The training image and the target image are used to repeatedly perform the above training process.
例如,在本公开至少一个实施例提供的图像处理方法中,生成所述训练图像包括:生成输入训练图像;对所述输入训练图像进行缩放处理,以得到缩放后的输入训练图像;对所述缩放后的输入训练图像进行填充处理,以得到填充后的输入训练图像;对所述填充后的输入训练图像进行扭曲处理,以得到扭曲后的输入训练图像;对所述扭曲后的输入训练图像进行区域划分,以得到包括所述至少两条训练线的所述训练图像。For example, in the image processing method provided in at least one embodiment of the present disclosure, generating the training image includes: generating an input training image; performing scaling processing on the input training image to obtain a scaled input training image; The scaled input training image is filled to obtain a filled input training image; the filled input training image is distorted to obtain a distorted input training image; the distorted input training image is performing region division to obtain the training image including the at least two training lines.
例如,在本公开至少一个实施例提供的图像处理方法中,基于所述训练图像,生成与所述训练图像对应的目标图像,包括:基于所述扭曲处理对应的扭曲参数,对所述训练图像进行反向扭曲处理,以得到所述目标图像。For example, in the image processing method provided in at least one embodiment of the present disclosure, generating a target image corresponding to the training image based on the training image includes: based on the distortion parameter corresponding to the distortion processing, performing the training image Perform reverse warping to obtain the target image.
例如,在本公开至少一个实施例提供的图像处理方法中,生成输入训练图像,包括:获取原始训练图像;对所述原始训练图像进行二值化处理,以得到所述输入训练图像。For example, in the image processing method provided in at least one embodiment of the present disclosure, generating an input training image includes: acquiring an original training image; performing binarization on the original training image to obtain the input training image.
例如,在本公开至少一个实施例提供的图像处理方法中,所述至少两条训练线为对所述训练图像沿同一方向进行等分的至少两条等分线。For example, in the image processing method provided in at least one embodiment of the present disclosure, the at least two training lines are at least two bisector lines that bisect the training image along the same direction.
本公开至少一个实施例还提供一种图像处理装置,包括:图像采集模块,被配置为获取原始图像;第一处理模块,被配置为对所述原始图像进行处理,以得到预处理图像,其中,所述预处理图像包括至少两条第一线,所述至少两条第一线沿同一方向依次并列排布;第二处理模块,被配置为通过扭曲处理模型对所述预处理图像进行处理,以得到中间图像,其中,所述中间图像包括至少两条第二线,所述至少两条第二线沿同一方向依次并列排布,且所述至少两条第二线与所述至少两条第一线一一对应;映射模块,被配置为基于所述预处理图像和所述中间图像之间的映射关系,对所述原始图像进行重映射,以得到输出图像。At least one embodiment of the present disclosure also provides an image processing device, including: an image acquisition module configured to acquire an original image; a first processing module configured to process the original image to obtain a pre-processed image, wherein , the pre-processed image includes at least two first lines, and the at least two first lines are arranged side by side in sequence along the same direction; the second processing module is configured to process the pre-processed image through a distortion processing model , to obtain an intermediate image, wherein the intermediate image includes at least two second lines, the at least two second lines are arranged side by side in sequence along the same direction, and the at least two second lines and the at least two first One-to-one correspondence between lines; the mapping module is configured to remap the original image based on the mapping relationship between the preprocessed image and the intermediate image to obtain an output image.
本公开至少一个实施例还提供一种电子设备,包括:存储器,非瞬时性地存储有计算机可执行指令;处理器,配置为运行所述计算机可执行指令, 其中,所述计算机可执行指令被所述处理器运行时实现根据本公开的任一实施例所述的图像处理方法。At least one embodiment of the present disclosure further provides an electronic device, including: a memory storing computer-executable instructions in a non-transitory manner; a processor configured to run the computer-executable instructions, wherein the computer-executable instructions are The processor implements the image processing method according to any embodiment of the present disclosure when running.
本公开至少一个实施例还提供一种非瞬时性计算机可读存储介质,其中,所述非瞬时性计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令被处理器执行时可以实现根据本公开的任一实施例所述的图像处理方法。At least one embodiment of the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer-executable instructions, and when executed by a processor, the computer-executable instructions can The image processing method according to any one of the embodiments of the present disclosure is implemented.
附图说明Description of drawings
为了更清楚地说明本公开实施例的技术方案,下面将对实施例的附图作简单地介绍,显而易见地,下面描述中的附图仅仅涉及本公开的一些实施例,而非对本公开的限制。In order to illustrate the technical solutions of the embodiments of the present disclosure more clearly, the accompanying drawings of the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description only relate to some embodiments of the present disclosure, rather than limiting the present disclosure .
图1为本公开至少一个实施例提供的一种图像处理方法的示意性流程图;Fig. 1 is a schematic flowchart of an image processing method provided by at least one embodiment of the present disclosure;
图2为本公开至少一个实施例提供的一种原始图像的示意图;Fig. 2 is a schematic diagram of an original image provided by at least one embodiment of the present disclosure;
图3为本公开至少一个实施例提供的一种预处理图像的示意图;Fig. 3 is a schematic diagram of a preprocessed image provided by at least one embodiment of the present disclosure;
图4A为本公开至少一个实施例提供的一种缩放后的图像的示意图;Fig. 4A is a schematic diagram of a scaled image provided by at least one embodiment of the present disclosure;
图4B为本公开至少一个实施例提供的一种填充后的图像的示意图;Fig. 4B is a schematic diagram of a filled image provided by at least one embodiment of the present disclosure;
图5为本公开至少一个实施例提供的一种中间图像的示意图;Fig. 5 is a schematic diagram of an intermediate image provided by at least one embodiment of the present disclosure;
图6为本公开至少一个实施例提供的一种输出图像的示意图;Fig. 6 is a schematic diagram of an output image provided by at least one embodiment of the present disclosure;
图7为本公开至少一个实施例提供的一种模型训练方法的流程图;FIG. 7 is a flowchart of a model training method provided by at least one embodiment of the present disclosure;
图8A为本公开至少一个实施例提供的一种原始训练图像的示意图;Fig. 8A is a schematic diagram of an original training image provided by at least one embodiment of the present disclosure;
图8B为本公开至少一个实施例提供的一种填充后的训练图像的示意图;Fig. 8B is a schematic diagram of a filled training image provided by at least one embodiment of the present disclosure;
图8C为本公开至少一个实施例提供的一种扭曲后的训练图像的示意图;Fig. 8C is a schematic diagram of a warped training image provided by at least one embodiment of the present disclosure;
图8D为本公开至少一个实施例提供的一种训练图像的示意图;Fig. 8D is a schematic diagram of a training image provided by at least one embodiment of the present disclosure;
图8E为本公开至少一个实施例提供的一种目标图像的示意图;Fig. 8E is a schematic diagram of a target image provided by at least one embodiment of the present disclosure;
图9为本公开至少一个实施例提供的一种图像处理装置的示意性框图;Fig. 9 is a schematic block diagram of an image processing device provided by at least one embodiment of the present disclosure;
图10为本公开至少一个实施例提供的一种电子设备的示意性框图;Fig. 10 is a schematic block diagram of an electronic device provided by at least one embodiment of the present disclosure;
图11为本公开至少一个实施例提供的一种非瞬时性计算机可读存储介质的示意图;Fig. 11 is a schematic diagram of a non-transitory computer-readable storage medium provided by at least one embodiment of the present disclosure;
图12为本公开至少一个实施例提供的一种硬件环境的示意图。Fig. 12 is a schematic diagram of a hardware environment provided by at least one embodiment of the present disclosure.
具体实施方式Detailed ways
为了使得本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例的附图,对本公开实施例的技术方案进行清楚、完整地描述。显然,所描述的实施例是本公开的一部分实施例,而不是全部的实施例。基于所描述的本公开的实施例,本领域普通技术人员在无需创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings of the embodiments of the present disclosure. Apparently, the described embodiments are some of the embodiments of the present disclosure, not all of them. Based on the described embodiments of the present disclosure, all other embodiments obtained by persons of ordinary skill in the art without creative effort fall within the protection scope of the present disclosure.
除非另外定义,本公开使用的技术术语或者科学术语应当为本公开所属领域内具有一般技能的人士所理解的通常意义。本公开中使用的“第一”、“第二”以及类似的词语并不表示任何顺序、数量或者重要性,而只是用来区分不同的组成部分。“包括”或者“包含”等类似的词语意指出现该词前面的元件或者物件涵盖出现在该词后面列举的元件或者物件及其等同,而不排除其他元件或者物件。“连接”或者“相连”等类似的词语并非限定于物理的或者机械的连接,而是可以包括电性的连接,不管是直接的还是间接的。“上”、“下”、“左”、“右”等仅用于表示相对位置关系,当被描述对象的绝对位置改变后,则该相对位置关系也可能相应地改变。Unless otherwise defined, the technical terms or scientific terms used in the present disclosure shall have the usual meanings understood by those skilled in the art to which the present disclosure belongs. "First", "second" and similar words used in the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Comprising" or "comprising" and similar words mean that the elements or items appearing before the word include the elements or items listed after the word and their equivalents, without excluding other elements or items. Words such as "connected" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "Down", "Left", "Right" and so on are only used to indicate the relative positional relationship. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
为了保持本公开实施例的以下说明清楚且简明,本公开省略了部分已知功能和已知部件的详细说明。In order to keep the following description of the embodiments of the present disclosure clear and concise, the present disclosure omits detailed descriptions of some known functions and known components.
目前,可以利用神经网络模型对电子图像进行识别以获取电子图像中记载的信息。电子图像可以为用户进行拍摄或扫描得到的图像,在获取电子图像的过程中,由于拍摄的角度等原因,无法避免电子图像中的内容会出现扭曲或变形等情况,从而使得神经网络模型识别得到的结果不准确。Currently, neural network models can be used to identify electronic images to obtain information recorded in electronic images. The electronic image can be taken or scanned by the user. In the process of obtaining the electronic image, due to the shooting angle and other reasons, it is unavoidable that the content in the electronic image will be distorted or deformed, so that the neural network model can be recognized. The result is not accurate.
本公开至少一个实施例提供一种图像处理方法。该图像处理方法包括:获取原始图像;对原始图像进行处理,以得到预处理图像,其中,预处理图像包括至少两条第一线,至少两条第一线沿同一方向依次并列排布;通过扭曲处理模型对预处理图像进行处理,以得到中间图像,其中,中间图像包括至少两条第二线,至少两条第二线沿同一方向依次并列排布,且至少两条第 二线与至少两条第一线一一对应;基于预处理图像和中间图像之间的映射关系,对原始图像进行重映射,以得到输出图像。At least one embodiment of the present disclosure provides an image processing method. The image processing method includes: acquiring an original image; processing the original image to obtain a preprocessed image, wherein the preprocessed image includes at least two first lines, and the at least two first lines are arranged side by side in sequence along the same direction; The warping processing model processes the preprocessed image to obtain an intermediate image, wherein the intermediate image includes at least two second lines, the at least two second lines are arranged side by side in sequence along the same direction, and the at least two second lines are connected with the at least two second lines One-to-one correspondence; based on the mapping relationship between the preprocessed image and the intermediate image, the original image is remapped to obtain the output image.
在本公开实施例提供的图像处理方法中,首先利用扭曲处理模型对预处理图像进行处理,然后根据扭曲处理模型的输入和输出之间的映射关系,即预处理图像和中间图像之间的映射关系,对原始图像进行重映射以得到输出图像,从而实现对原始图像的校正,有效地解决图像扭曲变形的问题,提高基于输出图像得到的识别结果的准确率,提高图像识别的效率,增强图像的可读性,提升用户的查阅该输出图像的体验。In the image processing method provided by the embodiment of the present disclosure, firstly, the pre-processed image is processed by using the warping processing model, and then according to the mapping relationship between the input and output of the warping processing model, that is, the mapping between the pre-processing image and the intermediate image Relationship, remap the original image to obtain the output image, so as to realize the correction of the original image, effectively solve the problem of image distortion, improve the accuracy of the recognition result based on the output image, improve the efficiency of image recognition, and enhance the image The readability of the image improves the user's experience of viewing the output image.
本公开至少一个实施例还提供一种图像处理装置、电子设备和非瞬时性计算机可读存储介质。At least one embodiment of the present disclosure also provides an image processing device, an electronic device, and a non-transitory computer-readable storage medium.
本公开实施例提供的图像处理方法可应用于本公开实施例提供的图像处理装置,该图像处理装置可被配置于电子设备上。该电子设备可以是个人计算机、移动终端等,该移动终端可以是手机、平板电脑等具有各种操作系统的硬件设备。也就是说,图像处理方法的执行主体可以为个人计算机、移动终端等。The image processing method provided by the embodiment of the present disclosure can be applied to the image processing device provided by the embodiment of the present disclosure, and the image processing device can be configured on an electronic device. The electronic device may be a personal computer, a mobile terminal, etc., and the mobile terminal may be a hardware device with various operating systems, such as a mobile phone and a tablet computer. That is to say, the execution subject of the image processing method may be a personal computer, a mobile terminal, and the like.
下面结合附图对本公开的实施例进行详细说明,但是本公开并不限于这些具体的实施例。Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings, but the present disclosure is not limited to these specific embodiments.
图1为本公开至少一个实施例提供的一种图像处理方法的示意性流程图,图2为本公开至少一个实施例提供的一种原始图像的示意图。Fig. 1 is a schematic flowchart of an image processing method provided by at least one embodiment of the present disclosure, and Fig. 2 is a schematic diagram of an original image provided by at least one embodiment of the present disclosure.
如图1所示,本公开的实施例提供的图像处理方法包括以下步骤S10至S13。As shown in FIG. 1 , the image processing method provided by the embodiment of the present disclosure includes the following steps S10 to S13.
首先,在步骤S10,获取原始图像。First, in step S10, an original image is acquired.
例如,原始图像为对某一对象进行拍照或扫描所得的图像,该对象包括各种字符、各种符号和各种图形中的至少一种,字符可以包括中文(例如,汉字或拼音)、英文、日文、法文、韩文、拉丁文、数字等,符号可以包括数学符号和标点符号等,数学符号包括加号、减号、大于符号、小于符号、百分号等,标点符号可以包括句号、逗号、问号等,图形可以包括直线、曲线、圆形、矩形、心形、各种图画等,如图2所示,原始图像100可以包括中文 字符、数字、房子的图形(例如,小红家、学校等)、人物的图形等。For example, the original image is an image obtained by photographing or scanning an object, the object includes at least one of various characters, various symbols and various graphics, and the characters may include Chinese (for example, Chinese characters or pinyin), English , Japanese, French, Korean, Latin, numbers, etc. Symbols can include mathematical symbols and punctuation marks, etc. Mathematical symbols include plus sign, minus sign, greater than sign, less than sign, percent sign, etc. Punctuation marks can include periods, commas , question marks, etc., graphics can include straight lines, curves, circles, rectangles, heart shapes, various pictures, etc., as shown in Figure 2, the original image 100 can include Chinese characters, numbers, graphics of houses (for example, Xiaohongjia, schools, etc.), graphics of characters, etc.
例如,原始图像可以为各种类型的图像,对象例如可以是名片、试卷、习题集、合同、发票等,从而原始图像可以为购物清单的图像、餐饮小票的图像、试卷的图像、习题集的图像、合同的图像等。例如,字符、符号和图形等可以由手写、印刷或机器得到。For example, the original image can be various types of images, such as business cards, test papers, exercise sets, contracts, invoices, etc., so that the original images can be images of shopping lists, images of restaurant receipts, images of test papers, and exercise sets. images of contracts, images of contracts, etc. For example, characters, symbols and graphics can be obtained by handwriting, printing or machine.
例如,在一些实施例中,原始图像中的图像内容被扭曲,也就是说,在原始图像中的对象产生变形,在该原始图像中的对象与该对象实际的形状不一致,例如,对象中的位于同一行字符产生倾斜、扭曲、畸变等情况。例如,扭曲可以包括平移、旋转、比例缩放、仿射变换、透视变换、柱状变换等中的一种或多种。例如,如图2所示,在一些实施例中,原始图像100可以为对习题集(例如,数学习题集等)的一页进行拍照所得的图像,原始图像100中的文字被扭曲,例如,在该习题集的该一页中,“整十数加一位数及相应的减法”中各个文字的中心的连线位于同一条直线,然而,在该原始图像100中,“整十数加一位数及相应的减法”被扭曲,“整十数加一位数及相应的减法”中各个文字的中心的连线不位于同一条直线,而是位于一条曲线(不规则或规则的曲线)上。For example, in some embodiments, the image content in the original image is distorted, that is, the object in the original image is deformed, the object in the original image is inconsistent with the actual shape of the object, for example, the object in the object Characters located on the same line produce skew, distortion, distortion, etc. For example, warping may include one or more of translation, rotation, scaling, affine transformation, perspective transformation, cylindrical transformation, and the like. For example, as shown in FIG. 2 , in some embodiments, the original image 100 may be an image obtained by photographing a page of a problem set (for example, a math problem set, etc.), and the text in the original image 100 is distorted, for example, In this page of the exercise set, the lines connecting the centers of the texts in "Integer Tens Plus One-Digit and Corresponding Subtraction" are on the same straight line. However, in the original image 100, "Integer Tens Plus One-digit number and corresponding subtraction" is distorted, and the connecting lines of the centers of each text in "Integer tens plus one-digit number and corresponding subtraction" are not on the same straight line, but on a curve (irregular or regular curve )superior.
例如,原始图像的形状可以为矩形等各种合适的形状。原始图像的形状和尺寸等可以由用户根据实际情况设定,本公开的实施例不作限制。For example, the shape of the original image may be various suitable shapes such as a rectangle. The shape and size of the original image can be set by the user according to the actual situation, which is not limited by the embodiments of the present disclosure.
例如,原始图像可以为通过图像获取装置(例如,数码相机或手机上的摄像头等)拍摄得到的图像,原始图像可以为灰度图像或黑白图像,也可以为彩色图像。需要说明的是,原始图像是指以可视化方式呈现对象的形式,例如对象的图片等。又例如,原始图像也可以通过扫描等方式得到。例如,原始图像可以为图像获取装置直接采集到的图像,也可以是对采集得到的图像进行预处理之后获得的图像。例如,为了避免图像获取装置直接采集到的图像的数据质量、数据不均衡等对后续处理的影响,在处理原始图像前,图像处理方法还可以包括对图像获取装置直接采集到的图像进行预处理的操作。预处理例如可以包括对图像获取装置直接采集到的图像进行剪裁、伽玛(Gamma)校正或降噪滤波等处理。预处理可以消除原始图像中的无关信息 或噪声信息,以便于更好地对原始图像进行后续处理。For example, the original image may be an image captured by an image acquisition device (for example, a digital camera or a camera on a mobile phone, etc.), and the original image may be a grayscale image, a black and white image, or a color image. It should be noted that the original image refers to a form that presents an object in a visual manner, such as a picture of the object. For another example, the original image may also be obtained by means of scanning or the like. For example, the original image may be an image directly captured by the image acquiring device, or may be an image obtained after preprocessing the captured image. For example, in order to avoid the impact of the data quality and data imbalance of the images directly collected by the image acquisition device on the subsequent processing, before processing the original image, the image processing method may also include preprocessing the images directly collected by the image acquisition device operation. The preprocessing may include, for example, cropping, gamma (Gamma) correction, or noise reduction filtering on the image directly captured by the image acquisition device. Preprocessing can eliminate irrelevant information or noise information in the original image, so as to facilitate the subsequent processing of the original image.
图3为本公开至少一个实施例提供的一种预处理图像的示意图。例如,图3所示的预处理图像为对图2所示的原始图像进行处理得到的图像。Fig. 3 is a schematic diagram of a pre-processed image provided by at least one embodiment of the present disclosure. For example, the preprocessed image shown in FIG. 3 is an image obtained by processing the original image shown in FIG. 2 .
如图1所示,在步骤S11:对原始图像进行处理,以得到预处理图像。As shown in FIG. 1 , in step S11 : the original image is processed to obtain a preprocessed image.
例如,在一些实施例中,步骤S11包括:对原始图像进行二值化处理,以得到输入图像;对输入图像进行缩放处理,以得到缩放后的图像;对缩放后的图像进行填充处理,以得到填充后的图像;对填充后的图像进行区域划分,以得到预处理图像。For example, in some embodiments, step S11 includes: performing binarization processing on the original image to obtain an input image; performing scaling processing on the input image to obtain a zoomed image; performing padding processing on the zoomed image to obtain A filled image is obtained; the filled image is divided into regions to obtain a preprocessed image.
例如,在另一些实施例中,步骤S11包括:对原始图像进行灰度化处理,以得到输入图像;对输入图像进行缩放处理,以得到缩放后的图像;对缩放后的图像进行填充处理,以得到填充后的图像;对填充后的图像进行区域划分,以得到预处理图像。For example, in some other embodiments, step S11 includes: performing grayscale processing on the original image to obtain an input image; performing scaling processing on the input image to obtain a zoomed image; performing filling processing on the zoomed image, To obtain a filled image; perform region division on the filled image to obtain a preprocessed image.
例如,对原始图像进行二值化处理或灰度化处理,均可以减少后续处理的数据处理量,提高处理速度。二值化处理或灰度化处理用于去除原始图像中的干扰像素,只保留需要处理的内容,例如,字符、图形或图像等。For example, performing binarization processing or grayscale processing on the original image can reduce the data processing amount of subsequent processing and improve processing speed. Binarization or grayscale processing is used to remove the interfering pixels in the original image, and only keep the content that needs to be processed, such as characters, graphics or images.
例如,二值化处理的方法可以包括阈值法、双峰法、P参数法、大律法(OTSU法)、最大熵值法、迭代法等。For example, the method of binarization processing may include threshold method, bimodal method, P parameter method, big law method (OTSU method), maximum entropy method, iterative method and the like.
例如,灰度化处理的方法包括分量法、最大值法、平均值法和加权平均法等。For example, methods of grayscale processing include component method, maximum value method, average value method, and weighted average method.
需要说明的是,二值化处理/灰度化处理、缩放处理和填充处理的顺序是可以任意调整的,不限于上面的描述,例如,也可以先进行缩放处理、再进行填充处理,最后进行二值化处理/灰度化处理。It should be noted that the order of binarization/grayscale processing, scaling processing and filling processing can be adjusted arbitrarily, and is not limited to the above description. For example, scaling processing can be performed first, then filling processing, and finally Binarization/grayscale processing.
例如,输入图像的尺寸和原始图像的尺寸可以相同。填充后的图像的尺寸大于缩放后的图像的尺寸,填充后的图像的尺寸和预处理图像的尺寸相等。例如,当缩放处理为缩小处理,则缩放后的图像的尺寸小于输入图像的尺寸,当缩放处理为扩大处理,则缩放后的图像的尺寸大于输入图像的尺寸。For example, the dimensions of the input image and the original image can be the same. The size of the padded image is larger than the size of the scaled image, and the size of the padded image is equal to the size of the preprocessed image. For example, when the scaling process is a reduction process, the size of the scaled image is smaller than the size of the input image, and when the scaling process is an expansion process, the size of the scaled image is larger than the size of the input image.
在本公开的实施例中,二值化处理/灰度化处理可以减少数据处理量,从而提高图像处理的处理速度;缩放处理可以统一图片尺寸以方便模型处理; 填充处理则可以防止扭曲操作后预处理图像中的对象对应的内容超出该预处理图像的画面区域,避免图像内容丢失,保证图像内容的完整性。In the embodiments of the present disclosure, binarization/grayscale processing can reduce the amount of data processing, thereby improving the processing speed of image processing; scaling processing can unify the size of the image to facilitate model processing; filling processing can prevent distortion after operation The content corresponding to the object in the pre-processed image exceeds the screen area of the pre-processed image, so as to avoid loss of image content and ensure the integrity of the image content.
需要说明的是,在本公开的实施例提供的图像处理方法中,也可以不进行二值化处理/灰度化处理,从而减少处理流程。It should be noted that, in the image processing method provided by the embodiments of the present disclosure, binarization/grayscale processing may not be performed, thereby reducing the processing flow.
图3所示的预处理图像为进行灰度化处理之后的图像。如图3所示,预处理图像200包括第一预处理图像边PB1、第二预处理图像边PB2、第三预处理图像边PB3和第四预处理图像边PB4,第一预处理图像边PB1和第二预处理图像边PB2为彼此相对的两条边,第三预处理图像边PB3和第四预处理图像边PB4为彼此相对的两条边。例如,预处理图像200可以为矩形,此时,第一预处理图像边PB1和第二预处理图像边PB2彼此平行,且平行于X1方向;第三预处理图像边PB3和第四预处理图像边PB4彼此平行,且平行于Y1方向;第一预处理图像边PB1和第三预处理图像边PB3彼此垂直。例如,X1方向为预处理图像200的宽度方向,Y1方向为预处理图像200的高度方向。The preprocessed image shown in FIG. 3 is the image after grayscale processing. As shown in Figure 3, the preprocessed image 200 includes a first preprocessed image edge PB1, a second preprocessed image edge PB2, a third preprocessed image edge PB3 and a fourth preprocessed image edge PB4, the first preprocessed image edge PB1 The side PB2 and the second pre-processing image are two sides facing each other, and the side PB3 of the third pre-processing image and the side PB4 of the fourth pre-processing image are two sides facing each other. For example, the pre-processed image 200 can be a rectangle. At this time, the first pre-processed image side PB1 and the second pre-processed image side PB2 are parallel to each other and parallel to the X1 direction; the third pre-processed image side PB3 and the fourth pre-processed image The sides PB4 are parallel to each other and to the Y1 direction; the first pre-processing image side PB1 and the third pre-processing image side PB3 are perpendicular to each other. For example, the X1 direction is the width direction of the pre-processed image 200 , and the Y1 direction is the height direction of the pre-processed image 200 .
例如,预处理图像包括至少两条第一线,至少两条第一线沿同一方向依次并列排布,至少两条第一线在预处理图像的第一预处理图像边和第二预处理图像边之间沿着从第一预处理图像边到第二预处理图像边的方向排列。For example, the pre-processed image includes at least two first lines, the at least two first lines are arranged side by side in sequence along the same direction, and the at least two first lines are located between the side of the first pre-processed image and the side of the second pre-processed image of the pre-processed image. The sides are arranged along a direction from the side of the first pre-processed image to the side of the second pre-processed image.
例如,在一些示例中,如图3所示,预处理图像200可以包括至少两条第一线L1,至少两条第一线L1沿同一方向(例如,Y1方向,即预处理图像200的高度方向)依次并列排布。至少两条第一线L1彼此平行,且平行于X1方向。至少两条第一线L1位于第一预处理图像边PB1和第二预处理图像边PB2之间。For example, in some examples, as shown in FIG. 3 , the preprocessed image 200 may include at least two first lines L1, and the at least two first lines L1 are along the same direction (for example, Y1 direction, that is, the height of the preprocessed image 200 direction) are arranged side by side. At least two first lines L1 are parallel to each other and parallel to the X1 direction. At least two first lines L1 are located between the first pre-processed image side PB1 and the second pre-processed image side PB2.
需要说明的是,在本公开的实施例中,至少两条第一线L1的排布方式不限于图3所示的方式,在一些实施例中,至少两条第一线L1也可以沿X1方向排列,此时,至少两条第一线L1平行于Y1方向,且位于第三预处理图像边PB3和第四预处理图像边PB4之间。It should be noted that, in the embodiments of the present disclosure, the arrangement of the at least two first lines L1 is not limited to the one shown in FIG. direction, at this time, at least two first lines L1 are parallel to the Y1 direction, and are located between the third pre-processing image side PB3 and the fourth pre-processing image side PB4.
例如,在一些实施例中,如图3所示,至少两条第一线L1为对预处理图像200沿同一方向(例如,Y1方向)进行等分的至少两条等分线,也就是说, 任意相邻的两条第一线L1之间的距离h3为固定值。For example, in some embodiments, as shown in FIG. 3 , at least two first lines L1 are at least two bisector lines that equally divide the preprocessed image 200 along the same direction (for example, Y1 direction), that is to say , the distance h3 between any two adjacent first lines L1 is a fixed value.
例如,至少两条第一线L1的数量可以根据实际情况设置,例如,在一些示例中,如图3所示,至少两条第一线L1的数量可以为23,此时,可以将预处理图像200沿第三预处理图像边PB3进行等分为24份,从而得到23条第一线L1。例如,若第三预处理图像边PB3的长度为768像素,则任意相邻的两条第一线L1之间的距离h3为32像素。For example, the number of at least two first lines L1 can be set according to actual conditions. For example, in some examples, as shown in FIG. 3 , the number of at least two first lines L1 can be 23. The image 200 is equally divided into 24 parts along the edge PB3 of the third pre-processed image, so as to obtain 23 first lines L1. For example, if the length of the side PB3 of the third pre-processed image is 768 pixels, the distance h3 between any two adjacent first lines L1 is 32 pixels.
需要说明的是,第一线L1的数量可以更少或者更多,例如,第一线L1的数量可以处于数值范围12~48之内,例如,12或48,第一线L1的数量越多,则最终得到输出图像越准确,但是数据处理量更多。It should be noted that the number of first lines L1 can be less or more, for example, the number of first lines L1 can be within the numerical range of 12-48, for example, 12 or 48, the more the number of first lines L1 , the final output image is more accurate, but the amount of data processing is more.
在图3中,为了清楚地示出第一线L1,第一线L1采用较粗的线表示,第一线L1的宽度可以根据实际情况设置,例如,可以为1~2个像素等。In FIG. 3 , in order to clearly show the first line L1 , the first line L1 is represented by a thicker line. The width of the first line L1 can be set according to actual conditions, for example, it can be 1-2 pixels.
图4A为本公开至少一个实施例提供的一种缩放后的图像的示意图;图4B为本公开至少一个实施例提供的一种填充后的图像的示意图。图4B所示的填充后的图像为对图4A所示的缩放后的图像进行填充处理得到的。Fig. 4A is a schematic diagram of a scaled image provided by at least one embodiment of the present disclosure; Fig. 4B is a schematic diagram of a filled image provided by at least one embodiment of the present disclosure. The filled image shown in FIG. 4B is obtained by filling the zoomed image shown in FIG. 4A .
例如,在一些实施例中,如图4A所示,缩放后的图像300包括彼此相对的第一缩放图像边CB1和第二缩放图像边CB2。第一预处理图像边与第一缩放图像边CB1对应,第二预处理图像边与第二缩放图像边CB2对应,也就是说,在预处理图像中,第一预处理图像边与第一缩放图像边CB1位于同一侧,例如图4A所示的上侧,第二预处理图像边与第二缩放图像边CB2位于同一侧,例如图4A所示的下侧。For example, in some embodiments, as shown in FIG. 4A , the scaled image 300 includes a first scaled image side CB1 and a second scaled image side CB2 opposite to each other. The first preprocessed image side corresponds to the first scaled image side CB1, and the second preprocessed image side corresponds to the second scaled image side CB2, that is, in the preprocessed image, the first preprocessed image side corresponds to the first scaled image side The image side CB1 is located on the same side, such as the upper side shown in FIG. 4A , and the second preprocessed image side and the second scaled image side CB2 are located on the same side, such as the lower side shown in FIG. 4A .
在步骤S11中,对缩放后的图像进行填充处理,以得到填充后的图像,包括:在第一缩放像边远离第二缩放图像边的一侧填补第一填充区域并在第二缩放图像边远离第一缩放图像边的一侧填补第二填充区域,以得到填充后的图像。In step S11, filling the scaled image to obtain the filled image includes: filling the first filling area on the side of the first scaled image away from the side of the second scaled image and filling the area on the side of the second scaled image The side away from the side of the first scaled image is filled with the second filled area to obtain a filled image.
例如,填充后的图像包括缩放后的图像、第一填充区域和第二填充区域。预处理图像包括填充后的图像和至少一条第一线。在预处理图像中,第一填充区域的彼此相对的两条边为第一缩放图像边和第一预处理图像边,第二填充区域的彼此相对的两条边为第二缩放图像边和第二预处理图像边。For example, the filled image includes a scaled image, a first filled area and a second filled area. The preprocessed image includes the filled image and at least one first line. In the pre-processed image, the two opposite sides of the first filled area are the first scaled image side and the first pre-processed image side, and the two opposite sides of the second filled area are the second scaled image side and the second scaled image side. 2. Preprocess image edges.
例如,如图4B所示,在一些实施例中,第一填充区域310填补(例如,拼接)到缩放后的图像300的第一缩放图像边CB1的远离第二缩放图像边CB2的一侧,第二填充区域320填补(例如,拼接)到缩放后的图像300的第二缩放图像边CB2的远离第一缩放图像边CB1的一侧。填充后的图像2000包括由缩放后的图像300、第一填充区域310和第二填充区域320构成的完整区域。For example, as shown in FIG. 4B , in some embodiments, the first padded region 310 is padded (e.g., spliced) to the side of the first scaled image side CB1 of the scaled image 300 away from the second scaled image side CB2, The second filling area 320 fills (eg, stitches) to a side of the second scaled image side CB2 of the scaled image 300 away from the first scaled image side CB1 . The filled image 2000 includes a complete area composed of the scaled image 300 , the first filled area 310 and the second filled area 320 .
例如,如图4B所示,填充后的图像2000包括彼此相对的第一填充图像边FB1和第二填充图像边FB2,在对填充后的图像2000进行区域划分,以得到预处理图像之后,该第一填充图像边FB1即为第一预处理图像边,该第二填充图像边FB2即为第二预处理图像边。For example, as shown in FIG. 4B, the filled image 2000 includes a first filled image side FB1 and a second filled image side FB2 opposite to each other. After the filled image 2000 is divided into regions to obtain a pre-processed image, the The first filling image edge FB1 is the first preprocessing image edge, and the second filling image edge FB2 is the second preprocessing image edge.
例如,如图4A所示,缩放后的图像300还包括彼此相对的第三缩放图像边CB3和第四缩放图像边CB4。例如,缩放后的图像300可以为矩形,此时,第一缩放图像边CB1和第二缩放图像边CB2彼此平行,且平行于X2方向;第三缩放图像边CB3和第四缩放图像边CB4彼此平行,且平行于Y2方向;第一缩放图像边CB1和第三缩放图像边CB3彼此垂直。例如,X2方向为缩放后的图像300的宽度方向,Y2方向为缩放后的图像300的高度方向。For example, as shown in FIG. 4A , the scaled image 300 further includes a third scaled image side CB3 and a fourth scaled image side CB4 opposite to each other. For example, the zoomed image 300 may be a rectangle. At this time, the first zoomed image side CB1 and the second zoomed image side CB2 are parallel to each other and parallel to the X2 direction; the third zoomed image side CB3 and the fourth zoomed image side CB4 are parallel to each other parallel to the Y2 direction; the first zoomed image side CB1 and the third zoomed image side CB3 are perpendicular to each other. For example, the X2 direction is the width direction of the zoomed image 300 , and the Y2 direction is the height direction of the zoomed image 300 .
例如,如图4B所示,第一填充区域310可以为矩形,第二填充区域320也可以为矩形。第一填充区域310的平行于Y2方向的边的长度可以为h1,第二填充区域320的平行于Y2方向的边的长度可以为h2,如图4A和图4B所示,第一缩放图像边CB1的长度为w1,则第一填充区域310的平行于X2方向的边的长度为w1,第二填充区域320的平行于X2方向的边的长度为w1。例如,第一填充区域310的尺寸和第二填充区域320的尺寸相同,此时,h1等于h2。For example, as shown in FIG. 4B , the first filling area 310 may be a rectangle, and the second filling area 320 may also be a rectangle. The length of the side parallel to the Y2 direction of the first padding area 310 can be h1, and the length of the side parallel to the Y2 direction of the second padding area 320 can be h2, as shown in FIGS. 4A and 4B, the first scaled image side The length of CB1 is w1, the length of the side parallel to the X2 direction of the first filling region 310 is w1, and the length of the side parallel to the X2 direction of the second filling region 320 is w1. For example, the size of the first filling area 310 is the same as the size of the second filling area 320 , at this time, h1 is equal to h2 .
例如,在一些实施例中,h1可以为64像素,例如,若缩放后的图像300的尺寸可以为576(像素)*640(像素),则填充后的图像2000的尺寸可以为576(像素)*768(像素)。For example, in some embodiments, h1 may be 64 pixels. For example, if the size of the image 300 after zooming may be 576 (pixels)*640 (pixels), then the size of the filled image 2000 may be 576 (pixels). *768 (pixels).
例如,第一填充区域310和第二填充区域320中的每个像素的像素值可以根据实际情况设置,例如,均为0,本公开对此不作限制。For example, the pixel value of each pixel in the first filling area 310 and the second filling area 320 can be set according to actual conditions, for example, both are 0, which is not limited in the present disclosure.
在本公开的一些实施例中,可以先进行缩放处理,再进行填充处理,然而,本公开不限于此,在另一些实施例中,也可以先进行填充处理,再进行缩放处理。填充处理对应的具体填充参数(即第一填充区域和第二填充区域的尺寸等)可以根据实际情况设置,本公开不作限制。In some embodiments of the present disclosure, the scaling process may be performed first, and then the filling process may be performed. However, the present disclosure is not limited thereto. In other embodiments, the filling process may be performed first, and then the scaling process may be performed. The specific filling parameters corresponding to the filling process (that is, the sizes of the first filling area and the second filling area, etc.) can be set according to the actual situation, which is not limited in the present disclosure.
例如,可以利用至少两条第一线沿填充后的图像的高度方向对填充后的图像进行区域划分,以得到预处理图像。For example, the filled image may be divided into regions along the height direction of the filled image by using at least two first lines to obtain a preprocessed image.
例如,在另一些实施例中,步骤S11包括:对原始图像进行二值化处理,以得到输入图像;对输入图像进行填充处理,以得到填充后的图像;对填充后的图像进行缩放处理,以得到缩放后的图像;对缩放后的图像进行区域划分,以得到预处理图像;或者,步骤S11包括:对原始图像进行灰度化处理,以得到输入图像;对输入图像进行填充处理,以得到填充后的图像;对填充后的图像进行缩放处理,以得到缩放后的图像;对缩放后的图像进行区域划分,以得到预处理图像。For example, in some other embodiments, step S11 includes: performing binarization processing on the original image to obtain an input image; performing filling processing on the input image to obtain a filled image; performing scaling processing on the filled image, to obtain a zoomed image; the zoomed image is divided into regions to obtain a preprocessed image; or, step S11 includes: grayscale processing is performed on the original image to obtain an input image; filling processing is performed on the input image to obtain The filled image is obtained; the filled image is scaled to obtain a scaled image; the scaled image is divided into regions to obtain a preprocessed image.
需要说明的是,填充处理可以根据原始图像中的图像内容的扭曲方向确定,例如,若原始图像中的图像内容在长度方向被扭曲,则在填充处理中,在图像的长度方向的两侧中的每一侧填补一个填充区域;若原始图像中的图像内容在宽度方向被扭曲,则在填充处理中,在图像的宽度方向的两侧中的每一侧填补一个填充区域;若原始图像中的图像内容在长度方向和宽度方向均被扭曲,则在填充处理中,在图像的长度方向的两侧中的每一侧填补一个填充区域,同时在图像的宽度方向的两侧中的每一侧也填补一个填充区域。It should be noted that the padding process can be determined according to the distortion direction of the image content in the original image, for example, if the image content in the original image is distorted in the length direction, then in the padding process, in the two sides of the length direction of the image Fill a padding area on each side of the image; if the image content in the original image is distorted in the width direction, in the padding process, fill a padding area on each of the two sides of the width direction of the image; if the original image is The content of the image is distorted in both the length direction and the width direction, then in the padding process, a padding area is filled on each of the two sides in the length direction of the image, and at the same time, a padding area is filled on each of the two sides in the width direction of the image The sides are also filled with a padding area.
图5为本公开至少一个实施例提供的一种中间图像的示意图。图5所示的中间图像400为通过扭曲处理模型对图3所示的预处理图像进行处理之后得到的图像。Fig. 5 is a schematic diagram of an intermediate image provided by at least one embodiment of the present disclosure. The intermediate image 400 shown in FIG. 5 is an image obtained after processing the pre-processed image shown in FIG. 3 through a warping processing model.
如图1所示,在步骤S12,通过扭曲处理模型对预处理图像进行处理,以得到中间图像。As shown in FIG. 1 , in step S12 , the preprocessed image is processed by the warping processing model to obtain an intermediate image.
例如,扭曲处理模型可以采用机器学习技术(例如,深度学习技术)实现,例如,在一些实施例中,扭曲处理模型可以为基于神经网络的模型。扭曲处理模型可以采用pix2pixHD(pixel to pixel HD)模型,该pix2pixHD模型 利用多级生成器(coarse-to-fine generator)以及多尺度的判别器(multi-scale discriminator)等方式对预处理图像进行扭曲处理,生成扭曲之后的中间图像。该pix2pixHD模型的生成器包括全局生成网络部分(global generator network)和局部增强网络部分(local enhancer network),全局生成网络部分采用U-Net结构,全局生成网络部分输出的特征与局部增强网络部分提取的特征融合,并作为局部增强网络部分的输入信息,由局部增强网络部分输出扭曲后的中间图像。例如,扭曲处理模型还可以使用其它模型,如U-Net模型等,本公开对此不作限制。针对扭曲处理模型的训练过程如后文所述,这里不再赘述。For example, the warp processing model may be implemented using machine learning technology (eg, deep learning technology). For example, in some embodiments, the warp processing model may be a model based on a neural network. The distortion processing model can use the pix2pixHD (pixel to pixel HD) model, which uses a multi-level generator (coarse-to-fine generator) and a multi-scale discriminator (multi-scale discriminator) to distort the preprocessed image Processing to generate an intermediate image after warping. The generator of the pix2pixHD model includes a global generator network (global generator network) and a local enhancer network (local enhancer network). The global generator network part adopts the U-Net structure, and the features output by the global generator network part are extracted from the local enhancement network part. The feature fusion of the local enhancement network is used as the input information of the local enhancement network part, and the warped intermediate image is output by the local enhancement network part. For example, the warp processing model can also use other models, such as U-Net model, etc., which is not limited in the present disclosure. The training process for the warping processing model is described later and will not be repeated here.
例如,中间图像包括至少两条第二线,至少两条第二线沿同一方向依次并列排布,且至少两条第二线与至少两条第一线一一对应。例如,在一些示例中,如图5所示,中间图像400包括至少两条第二线L2,至少两条第二线L2沿同一方向(例如,Y3方向,即中间图像400的高度方向)依次并列排布,至少两条第二线L2的延伸方向为X3方向。图5所示的至少两条第二线L2与图3所示的至少两条第一线L1一一对应。第二线L2为对第一线L1进行扭曲之后的线,如图5所示,每条第二线L2为规则或不规则的曲线,且各条第二线L2的形状不相同。需要说明的是,某一条或几条第二线L2也可以为直线,本公开对第二线L2的形状等性质不作具体限定。For example, the intermediate image includes at least two second lines, the at least two second lines are arranged side by side in sequence along the same direction, and the at least two second lines are in one-to-one correspondence with the at least two first lines. For example, in some examples, as shown in FIG. 5, the intermediate image 400 includes at least two second lines L2, and at least two second lines L2 are arranged side by side in sequence along the same direction (for example, the Y3 direction, that is, the height direction of the intermediate image 400). Cloth, the extending direction of the at least two second lines L2 is the X3 direction. The at least two second lines L2 shown in FIG. 5 correspond one-to-one to the at least two first lines L1 shown in FIG. 3 . The second line L2 is a twisted line of the first line L1. As shown in FIG. 5 , each second line L2 is a regular or irregular curve, and the shapes of each second line L2 are different. It should be noted that one or several second lines L2 may also be straight lines, and the present disclosure does not specifically limit the shape and other properties of the second lines L2.
需要说明的是,X1方向、X2方向和X3方向彼此平行,Y1方向、Y2方向和Y3方向也彼此平行。在一些实施例中,X1方向、X2方向和X3方向均为图像的宽度方向,例如,图像的宽度方向平行于水平方向。Y1方向、Y2方向和Y3方向均为图像的高度方向,例如,图像的高度方向平行于竖直方向。It should be noted that the X1 direction, the X2 direction and the X3 direction are parallel to each other, and the Y1 direction, the Y2 direction and the Y3 direction are also parallel to each other. In some embodiments, the X1 direction, the X2 direction and the X3 direction are all width directions of the image, for example, the width direction of the image is parallel to the horizontal direction. The Y1 direction, the Y2 direction and the Y3 direction are all height directions of the image, for example, the height direction of the image is parallel to the vertical direction.
图6为本公开至少一些实施例提供的一种输出图像的示意图。图6所示的输出图像为通过本公开的实施例提供的图像处理方法对图2所示的原始图像进行处理后得到的图像。Fig. 6 is a schematic diagram of an output image provided by at least some embodiments of the present disclosure. The output image shown in FIG. 6 is an image obtained by processing the original image shown in FIG. 2 through the image processing method provided by the embodiment of the present disclosure.
如图1所示,在步骤S13,基于预处理图像和中间图像之间的映射关系,对原始图像进行重映射,以得到输出图像。As shown in FIG. 1 , in step S13 , based on the mapping relationship between the preprocessed image and the intermediate image, the original image is remapped to obtain an output image.
例如,预处理图像和中间图像之间的映射关系包括至少两条第一线和至少两条第二线之间的映射关系和预处理图像中的至少两条第一线之间的区域 和中间图像中的至少两条第二线之间的区域之间的映射关系。For example, the mapping relationship between the preprocessing image and the intermediate image includes the mapping relationship between at least two first lines and at least two second lines and the area between the at least two first lines in the preprocessing image and the intermediate image The mapping relationship between regions between at least two second lines in .
另外,需要说明的是,需要根据至少两条第一线和至少两条第二线之间的映射关系来确定预处理图像中的至少两条第一线之间的区域和中间图像中的至少两条第二线之间的区域之间的映射关系。In addition, it should be noted that the region between at least two first lines in the preprocessed image and at least two regions in the intermediate image need to be determined according to the mapping relationship between at least two first lines and at least two second lines. The mapping relationship between the regions between the second lines.
例如,在一些实施例中,步骤S13可以包括:基于预处理图像和中间图像之间的映射关系,确定与原始图像对应的映射信息;基于与原始图像对应的映射信息对原始图像进行重映射,以得到输出图像。For example, in some embodiments, step S13 may include: determining mapping information corresponding to the original image based on the mapping relationship between the preprocessed image and the intermediate image; remapping the original image based on the mapping information corresponding to the original image, to get the output image.
例如,在步骤S13中,基于预处理图像和中间图像之间的映射关系,确定与原始图像对应的映射信息,包括:基于预处理图像和中间图像之间的映射关系,通过插值方法确定与预处理图像对应的预处理映射信息;基于预处理映射信息,确定预处理图像中的与原始图像对应的区域对应的映射信息;对与原始图像对应的区域的映射信息进行缩放处理,以确定与原始图像对应的映射信息。For example, in step S13, based on the mapping relationship between the preprocessed image and the intermediate image, determining the mapping information corresponding to the original image includes: based on the mapping relationship between the preprocessed image and the intermediate image, determining the processing the preprocessing mapping information corresponding to the image; determining the mapping information corresponding to the area corresponding to the original image in the preprocessing image based on the preprocessing mapping information; performing scaling processing on the mapping information of the area corresponding to the original image to determine the The mapping information corresponding to the image.
例如,预处理映射信息用于指示预处理图像中的至少部分像素的映射参数。预处理图像中的至少部分像素包括预处理图像中的至少两条第一线之间的区域中的像素和至少两条第一线上的像素。如图3所示,预处理图像200包括区域A1和区域A2,区域A1和区域A2并不是位于两条第一线L1之间的区域,预处理图像200中的至少部分像素包括预处理图像中的除了区域A1和区域A2之外的所有像素。For example, the preprocessing mapping information is used to indicate mapping parameters of at least some pixels in the preprocessing image. At least some of the pixels in the pre-processed image include pixels in a region between at least two first lines and pixels on at least two first lines in the pre-processed image. As shown in FIG. 3 , the preprocessed image 200 includes an area A1 and an area A2. The area A1 and the area A2 are not located between the two first lines L1. At least some pixels in the preprocessed image 200 include the pixels in the preprocessed image. All the pixels except area A1 and area A2.
需要说明的是,预处理映射信息也可以指示预处理图像中的所有像素的映射参数,本公开对此不作限定。It should be noted that the preprocessing mapping information may also indicate mapping parameters of all pixels in the preprocessing image, which is not limited in the present disclosure.
在本公开中,根据扭曲处理模型的输入和输出之间的映射关系(即基于预处理图像和中间图像之间的映射关系)对原始图像进行重映射,从而实现对扭曲之后的原始图像进行校正,以得到输出图像,有效地解决图像扭曲变形的问题,提高基于输出图像得到的识别结果的准确率,提高图像识别的效率,增强图像的可读性,提升用户的查阅该输出图像的体验。In this disclosure, the original image is remapped according to the mapping relationship between the input and output of the distortion processing model (that is, based on the mapping relationship between the preprocessed image and the intermediate image), so as to realize the correction of the original image after distortion , to obtain the output image, effectively solve the problem of image distortion, improve the accuracy of the recognition result based on the output image, improve the efficiency of image recognition, enhance the readability of the image, and improve the user's experience of viewing the output image.
例如,中间图像中的任意相邻两条第二线之间的区域可以对应到预处理图像中相应的两条相邻第一线之间的区域,中间图像中的每条第二线可以对 应到预处理图像中相应的第一线,从而可以基于预处理图像和中间图像之间的映射关系,通过插值方法确定与预处理图像对应的预处理映射信息。如图3和图5所示,预处理图像200中的任意相邻的两条第一线L1(例如,第一线L11和第一线L12)之间的区域与中间图像400中与两条第一线L1分别对应的两条第二线L2(例如,第二线L21和第二线L22)之间的区域彼此对应映射,也就是说,预处理图像200中的第一线L11和第一线L12之间的区域需要映射至中间图像400中的第二线L21和第二线L22之间的区域中。预处理图像200中的第一线L1和中间图像400中与该第一线L1对应的第二线L2也彼此对应映射,例如,预处理图像200中的第一线L11和第一线L12需要映射为中间图像400中的第二线L21和第二线L22。For example, the area between any two adjacent second lines in the intermediate image may correspond to the area between corresponding two adjacent first lines in the preprocessed image, and each second line in the intermediate image may correspond to the preprocessed image. The corresponding first line in the image is processed, so that pre-processing mapping information corresponding to the pre-processing image can be determined through an interpolation method based on the mapping relationship between the pre-processing image and the intermediate image. As shown in FIGS. 3 and 5 , the area between any two adjacent first lines L1 (for example, the first line L11 and the first line L12 ) in the preprocessed image 200 is the same as the area between the two adjacent lines in the intermediate image 400 . The areas between the two second lines L2 (for example, the second line L21 and the second line L22) respectively corresponding to the first line L1 are mapped correspondingly to each other, that is to say, the first line L11 and the first line L12 in the preprocessed image 200 The area in between needs to be mapped to the area between the second line L21 and the second line L22 in the intermediate image 400 . The first line L1 in the preprocessed image 200 and the second line L2 corresponding to the first line L1 in the intermediate image 400 are also mapped correspondingly to each other, for example, the first line L11 and the first line L12 in the preprocessed image 200 need to be mapped are the second line L21 and the second line L22 in the intermediate image 400 .
例如,插值方法可以包括最近邻插值、双线性插值、双三次样条插值、双立方插值、兰索斯插值(lanczos)等方法,本公开对插值方法不作限制。For example, interpolation methods may include methods such as nearest neighbor interpolation, bilinear interpolation, bicubic spline interpolation, bicubic interpolation, and Lanczos interpolation (lanczos), and the disclosure does not limit the interpolation methods.
例如,与原始图像对应的映射信息可以包括原始图像中的所有像素对应的映射参数,即与原始图像对应的映射信息中的映射参数的数量可以与原始图像中的所有像素的数量相同。例如,与像素对应的映射参数可以表示该像素被映射到的位置的坐标值;或者,也可以表示该像素的坐标值和该像素被映射到的位置的坐标值之间的偏移量。For example, the mapping information corresponding to the original image may include mapping parameters corresponding to all pixels in the original image, that is, the number of mapping parameters in the mapping information corresponding to the original image may be the same as the number of all pixels in the original image. For example, the mapping parameter corresponding to a pixel may represent the coordinate value of the position to which the pixel is mapped; or, may also represent an offset between the coordinate value of the pixel and the coordinate value of the position to which the pixel is mapped.
需要说明的是,该像素的坐标值可以表示在原始图像对应的坐标系中的坐标值,原始图像对应的坐标系的坐标原点为该原始图像的某个像素点(例如,原始图像的中心对应的像素点或原始图像的左上角的像素点),原始图像对应的坐标系的两个坐标轴分别为该原始图像的宽和高。该像素被映射到的位置的坐标值可以表示在输出图像对应的坐标系中的坐标值,输出图像对应的坐标系的坐标原点为该输出图像中与该原始图像对应的坐标系的坐标原点对应的像素点,输出图像对应的坐标系的两个坐标轴分别为该输出图像的宽和高。It should be noted that the coordinate value of the pixel can represent the coordinate value in the coordinate system corresponding to the original image, and the coordinate origin of the coordinate system corresponding to the original image is a certain pixel point of the original image (for example, the center of the original image corresponds to pixel or the pixel in the upper left corner of the original image), the two coordinate axes of the coordinate system corresponding to the original image are the width and height of the original image respectively. The coordinate value of the position to which the pixel is mapped can represent the coordinate value in the coordinate system corresponding to the output image, and the coordinate origin of the coordinate system corresponding to the output image corresponds to the coordinate origin of the coordinate system corresponding to the original image in the output image The two coordinate axes of the coordinate system corresponding to the output image are the width and height of the output image respectively.
例如,基于预处理图像和中间图像之间的映射关系作为参考基准,可以确定原始图像中的每个像素对应的映射参数,从而可以得到与原始图像对应的映射信息。基于与原始图像对应的映射信息可以确定校正图像扭曲之后每 个像素所映射的位置,从而实现映射处理。For example, based on the mapping relationship between the preprocessed image and the intermediate image as a reference, the mapping parameters corresponding to each pixel in the original image can be determined, so that the mapping information corresponding to the original image can be obtained. Based on the mapping information corresponding to the original image, the mapped position of each pixel after correcting the image distortion can be determined, thereby realizing the mapping process.
例如,在步骤S13中,基于与原始图像对应的映射信息对原始图像进行重映射,以得到输出图像,可以包括:调用opencv中的重映射函数(即remap函数)基于与原始图像对应的映射信息对原始图像进行重映射处理,以得到输出图像。如图6所示,在输出图像500中,“整十数加一位数及相应的减法”中各个文字的中心的连线位于同一条直线上,实现文本拉直,从而有效地校正原始图像的扭曲状态,解决图像扭曲变形的问题,提高基于输出图像得到的识别结果的准确率,提高图像识别的效率,增强图像的可读性,提升用户的查阅该输出图像的体验。For example, in step S13, remapping the original image based on the mapping information corresponding to the original image to obtain an output image may include: calling a remapping function (ie, a remap function) in opencv based on the mapping information corresponding to the original image Remap the original image to get the output image. As shown in FIG. 6 , in the output image 500, the lines connecting the centers of the characters in "Ten plus one digit and the corresponding subtraction" are on the same straight line, so that the text can be straightened, thereby effectively correcting the original image The distorted state solves the problem of image distortion and deformation, improves the accuracy of recognition results based on the output image, improves the efficiency of image recognition, enhances the readability of the image, and improves the user's experience of viewing the output image.
例如,在本公开的一些实施例中,图像处理方法还包括:训练扭曲处理模型。For example, in some embodiments of the present disclosure, the image processing method further includes: training a warping processing model.
本公开至少一个实施例还提供一种模型训练方法,以用于实现上述训练扭曲处理模型的操作。图7为本公开至少一个实施例提供的一种模型训练方法的流程图。At least one embodiment of the present disclosure further provides a model training method for realizing the above operation of training a warping processing model. Fig. 7 is a flowchart of a model training method provided by at least one embodiment of the present disclosure.
在一些实施例中,模型训练方法可以包括训练扭曲处理模型,例如,如图7所示,训练扭曲处理模型包括以下步骤S20~S22。In some embodiments, the model training method may include training a warping processing model. For example, as shown in FIG. 7 , training the warping processing model includes the following steps S20-S22.
步骤S20:生成训练图像。例如,训练图像包括至少两条训练线,至少两条训练线沿同一方向依次并列排布。Step S20: Generate training images. For example, the training image includes at least two training lines, and the at least two training lines are arranged side by side sequentially along the same direction.
步骤S21:基于训练图像,生成与训练图像对应的目标图像。例如,目标图像包括至少两条目标训练线,至少两条目标训练线沿同一方向依次并列排布,且至少两条目标训练线与至少两条训练线一一对应。Step S21: Based on the training image, generate a target image corresponding to the training image. For example, the target image includes at least two target training lines, the at least two target training lines are arranged side by side in sequence along the same direction, and the at least two target training lines are in one-to-one correspondence with the at least two training lines.
步骤S22:基于训练图像和目标图像,对待训练的扭曲处理模型进行训练,以获得训练好的扭曲处理模型。Step S22: Based on the training image and the target image, train the warping model to be trained to obtain a trained warping model.
例如,在一些实施例中,步骤S20可以包括:生成输入训练图像;对输入训练图像进行缩放处理,以得到缩放后的输入训练图像;对缩放后的输入训练图像进行填充处理,以得到填充后的输入训练图像;对填充后的输入训练图像进行扭曲处理,以得到扭曲后的输入训练图像;对扭曲后的输入训练图像进行区域划分,以得到包括至少两条训练线的训练图像。For example, in some embodiments, step S20 may include: generating an input training image; performing scaling processing on the input training image to obtain a scaled input training image; performing padding processing on the scaled input training image to obtain a filled the input training image; distorting the filled input training image to obtain a distorted input training image; performing region division on the distorted input training image to obtain a training image including at least two training lines.
例如,在另一些实施例中,步骤S20可以包括:生成输入训练图像;对输入训练图像进行填充处理,以得到填充后的输入训练图像;对填充后的输入训练图像进行缩放处理,以得到缩放后的输入训练图像;对缩放后的输入训练图像进行扭曲处理,以得到扭曲后的输入训练图像;对扭曲后的输入训练图像进行区域划分,以得到包括至少两条训练线的训练图像。For example, in some other embodiments, step S20 may include: generating an input training image; filling the input training image to obtain a filled input training image; performing scaling processing on the filled input training image to obtain a scaled The input training image after the warping process is performed on the scaled input training image to obtain a warped input training image; the warped input training image is divided into regions to obtain a training image including at least two training lines.
需要说明的是,在步骤S20中,填充处理和缩放处理的顺序可以根据实际情况设置,本公开对此不作限制。在本公开下面的描述中,以先进行缩放处理再进行填充处理为例进行说明。It should be noted that, in step S20, the order of the filling process and the scaling process can be set according to actual conditions, which is not limited in the present disclosure. In the following description of the present disclosure, the scaling process is performed first and then the filling process is performed as an example for illustration.
例如,在步骤S20中,生成输入训练图像可以包括:获取原始训练图像;对原始训练图像进行二值化处理或灰度化处理,以得到输入训练图像。对原始训练图像进行二值化处理或灰度化处理,这样可以去除原始训练图像中的干扰(噪声),还可以减少后续训练过程中的数据处理量。需要说明的是,二值化处理或灰度化处理不是必须的步骤,也可以直接对原始训练图像进行填充处理、缩放处理以及区域划分,从而得到训练图像。For example, in step S20, generating the input training image may include: acquiring an original training image; performing binarization or grayscale processing on the original training image to obtain the input training image. Perform binarization or grayscale processing on the original training image, so that the interference (noise) in the original training image can be removed, and the amount of data processing in the subsequent training process can also be reduced. It should be noted that the binarization or grayscale processing is not a necessary step, and the original training image can also be directly filled, scaled and divided to obtain the training image.
图8A为本公开至少一个实施例提供的一种原始训练图像的示意图。Fig. 8A is a schematic diagram of an original training image provided by at least one embodiment of the present disclosure.
例如,原始训练图像可以为没有被扭曲的图像,如图8A所示,在原始训练图像810中,所有的文本均没有被扭曲。For example, the original training image may be an image that has not been distorted. As shown in FIG. 8A , in the original training image 810, all texts are not distorted.
图8B为本公开至少一个实施例提供的一种填充后的训练图像的示意图。图8B所示的填充后的训练图像可以为对图8A所示的原始训练图像进行缩放处理和填充处理后的图像。Fig. 8B is a schematic diagram of a filled training image provided by at least one embodiment of the present disclosure. The filled training image shown in FIG. 8B may be an image after scaling and filling processing are performed on the original training image shown in FIG. 8A .
例如,可以将输入训练图像缩放和填补到固定尺寸,统一图像的尺寸可以方便待训练的扭曲处理模型对图像进行处理。例如,在一个实施例中,如图8B所示,可以先将输入训练图像进行缩放处理以得到缩放后的训练图像830,缩放后的训练图像830的尺寸可以576*640(像素),缩放后的训练图像830包括彼此相对的图像边CTB1和图像边CTB2,在缩放后的训练图像830的图像边CTB1的远离图像边CTB2的一侧填补一个训练填充区域831,并在缩放后的训练图像830的图像边CTB2的远离图像边CTB1的一侧填补一个训练填充区域832,从而得到填充后的训练图像820,填充后的训练图像820可 以包括由训练填充区域831、缩放后的训练图像830和训练填充区域832构成的区域。填充处理可以防止扭曲操作后内容超出画面,例如,训练填充区域831的尺寸和训练填充区域832的尺寸可以相同,训练填充区域831的尺寸可以为576*64(像素),从而填充后的训练图像820的尺寸可以为576*768(像素)。For example, the input training image can be scaled and filled to a fixed size, and the uniform size of the image can facilitate the processing of the image by the warping model to be trained. For example, in one embodiment, as shown in FIG. 8B , the input training image may first be scaled to obtain a scaled training image 830, the size of the scaled training image 830 may be 576*640 (pixels), and after scaling The training image 830 includes the image side CTB1 and the image side CTB2 opposite to each other, a training filling area 831 is filled on the side of the image side CTB1 of the zoomed training image 830 away from the image side CTB2, and the zoomed training image 830 The side of the image side CTB2 far away from the image side CTB1 fills a training padding area 832, thereby obtaining the training image 820 after filling, the training image 820 after filling can include the training padding area 831, the training image 830 after scaling and training Fill area 832 constitutes the area. The padding process can prevent the contents from exceeding the screen after the distortion operation. For example, the size of the training padding area 831 and the size of the training padding area 832 can be the same, and the size of the training padding area 831 can be 576*64 (pixels), so that the training image after padding The size of the 820 can be 576*768 (pixels).
需要说明的是,关于填充处理和缩放处理的详细说明可以参考上面图像处理方法的实施例中对于填充处理和缩放处理的说明,重复之处不再赘述。It should be noted that, for a detailed description of the filling process and the scaling process, reference may be made to the description of the filling process and the scaling process in the above embodiment of the image processing method, and repeated descriptions will not be repeated.
图8C为本公开至少一个实施例提供的一种扭曲后的训练图像的示意图,图8C所示的扭曲后的训练图像可以为对图8B所示的填充后的训练图像进行扭曲处理后的图像。Fig. 8C is a schematic diagram of a warped training image provided by at least one embodiment of the present disclosure. The warped training image shown in Fig. 8C may be an image after warping the filled training image shown in Fig. 8B .
例如,扭曲处理的方式不限,在一些实施例中,可采用opencv实现扭曲处理,例如,首先,随机生成一组偏移量,然后,再对偏移量进行高斯滤波使得偏移量平滑连续,利用高斯滤波之后的偏移量生成扭曲参数矩阵(例如,map),调用opencv中的remap函数对填充后的图像进行重映射以实现扭曲处理,从而得到扭曲后的训练图像。For example, the way of warping processing is not limited. In some embodiments, opencv can be used to implement warping processing. For example, first, a set of offsets is randomly generated, and then Gaussian filtering is performed on the offsets to make the offsets smooth and continuous , use the offset after Gaussian filtering to generate a warped parameter matrix (for example, map), and call the remap function in opencv to remap the filled image to achieve warping processing, thereby obtaining a warped training image.
图8D为本公开至少一个实施例提供的一种训练图像的示意图。图8D所示的训练图像850可以为对图8C所示的扭曲后的图像840进行处理后的图像。Fig. 8D is a schematic diagram of a training image provided by at least one embodiment of the present disclosure. The training image 850 shown in FIG. 8D may be an image after processing the warped image 840 shown in FIG. 8C .
例如,在一些实施例中,如图8D所示,训练图像850可以包括至少两条训练线TL1,至少两条训练线TL1为对训练图像850沿同一方向(例如,训练图像850的高度方向Y4)进行等分的至少两条等分线。如图8D所示,训练线TL1可以为彼此平行的线,且沿训练图像850的宽度方向X4延伸。例如,如图8C和图8D所示,可以对扭曲后的图像840进行等分,并绘制等分线,从而得到训练图像850。例如,可以将扭曲后的图像840沿其高度方向进行等分。至少两条训练线TL1的数量可以根据实际情况设置,如图8D所示,至少两条训练线TL1的数量可以为23,然而,至少两条训练线TL1的数量可以更少或者更多,例如,12~48等,至少两条训练线TL1的数量越多,训练得到的扭曲处理模型越准确,但是数据处理量更多。For example, in some embodiments, as shown in FIG. 8D , the training image 850 may include at least two training lines TL1, and the at least two training lines TL1 are along the same direction as the training image 850 (for example, the height direction Y4 of the training image 850). ) at least two bisectors for bisecting. As shown in FIG. 8D , the training lines TL1 may be parallel to each other and extend along the width direction X4 of the training image 850 . For example, as shown in FIG. 8C and FIG. 8D , the warped image 840 can be equally divided, and an equal line can be drawn to obtain a training image 850 . For example, the warped image 840 may be equally divided along its height direction. The quantity of at least two training lines TL1 can be set according to actual conditions, as shown in Figure 8D, the quantity of at least two training lines TL1 can be 23, however, the quantity of at least two training lines TL1 can be less or more, for example , 12 to 48, etc., the more the number of at least two training lines TL1 is, the more accurate the warping processing model obtained after training is, but the amount of data processing is more.
图8E为本公开至少一个实施例提供的一种目标图像的示意图。图8E所示的目标图像860可以为对图8D所示的训练图像850进行反向扭曲处理后的图像。Fig. 8E is a schematic diagram of a target image provided by at least one embodiment of the present disclosure. The target image 860 shown in FIG. 8E may be an image obtained by reverse warping the training image 850 shown in FIG. 8D .
例如,在一些实施例中,步骤S21包括:基于扭曲处理对应的扭曲参数,对训练图像进行反向扭曲处理,以得到目标图像。For example, in some embodiments, step S21 includes: performing reverse warping processing on the training image based on the warping parameters corresponding to the warping process to obtain the target image.
例如,反向扭曲处理的目的是将训练图像850中的除了训练线TL1之外的图像内容部分恢复为扭曲处理之前(即图8B所示的填充后的图像820)的状态。如图8E所示,目标图像860包括至少两条目标训练线TL2,至少两条目标训练线TL2沿目标图像860的高度方向依次排列,至少两条目标训练线TL2沿目标图像860的宽度方向延伸。目标图像860中的至少两条目标训练线TL2与图8D所示的训练图像850中的至少两条训练线TL1一一对应,至少两条目标训练线TL2为对至少两条训练线TL1进行反向扭曲处理得到的线。For example, the purpose of the reverse warping process is to restore the part of the image content in the training image 850 except the training line TL1 to the state before the warping process (ie, the padded image 820 shown in FIG. 8B ). As shown in Figure 8E, the target image 860 includes at least two target training lines TL2, at least two target training lines TL2 are arranged in sequence along the height direction of the target image 860, and at least two target training lines TL2 extend along the width direction of the target image 860 . The at least two target training lines TL2 in the target image 860 are in one-to-one correspondence with the at least two training lines TL1 in the training image 850 shown in FIG. To distort the resulting lines.
例如,在一些实施例中,步骤S21可以包括:通过待训练的扭曲处理模型对训练图像进行处理,以得到输出训练图像;基于输出训练图像和目标图像,对待训练的扭曲处理模型的参数进行调整;在待训练的扭曲处理模型对应的损失函数满足预定条件时,获得训练好的扭曲处理模型,在待训练的扭曲处理模型对应的损失函数不满足预定条件时,继续输入训练图像和目标图像以重复执行上述训练过程。For example, in some embodiments, step S21 may include: processing the training image through the warping model to be trained to obtain an output training image; based on the output training image and the target image, adjusting the parameters of the warping model to be trained ; When the loss function corresponding to the distortion processing model to be trained meets the predetermined condition, the trained distortion processing model is obtained, and when the loss function corresponding to the distortion processing model to be trained does not meet the predetermined condition, continue to input the training image and the target image to Repeat the above training process.
例如,输出训练图像包括至少两条输出线,至少两条输出线沿同一方向依次并列排布,且至少两条输出线与至少两条训练线一一对应,至少两条输出线可以为待训练的扭曲处理模型对至少两条训练线进行处理之后的线。For example, the output training image includes at least two output lines, the at least two output lines are arranged side by side in sequence along the same direction, and the at least two output lines correspond to the at least two training lines one by one, and the at least two output lines can be The warp processing model processes the lines after at least two training lines.
例如,在步骤S21中,待训练的扭曲处理模型将训练图像中的图像内容和训练线作为一个整体进行处理,以得到输出训练图像。For example, in step S21, the warping processing model to be trained processes the image content and the training line in the training image as a whole to obtain an output training image.
例如,在步骤S21中,基于输出训练图像和目标图像,对待训练的扭曲处理模型的参数进行调整可以包括:基于输出训练图像和目标图像,通过待训练的扭曲处理模型对应的损失函数计算待训练的扭曲处理模型的损失值;以及基于该损失值对待训练的扭曲处理模型的参数进行调整。For example, in step S21, based on the output training image and the target image, adjusting the parameters of the warping model to be trained may include: based on the output training image and the target image, calculating the loss function corresponding to the warping model to be trained The loss value of the warping model; and adjust the parameters of the warping model to be trained based on the loss value.
例如,在一个示例中,预定条件对应于在输入一定数量的训练图像下,该待训练的扭曲处理模型对应的损失函数的最小化。在另一个示例中,预定条件为待训练的扭曲处理模型对应的训练次数或训练周期达到预定数目,该预定数目可以为上百万,只要用于训练的训练图像的数量足够大。For example, in one example, the predetermined condition corresponds to the minimization of a loss function corresponding to the warping model to be trained when a certain number of training images are input. In another example, the predetermined condition is that the number of training times or training cycles corresponding to the warping model to be trained reaches a predetermined number, and the predetermined number may be millions, as long as the number of training images used for training is large enough.
需要说明的是,在重复执行训练过程的操作中,可以采用不同的训练图像及其对应的目标图像对待训练的扭曲处理模型进行训练;此外,也可以利用同一张训练图像及其对应的目标图像多次执行上述训练过程。It should be noted that in the operation of repeatedly executing the training process, different training images and their corresponding target images can be used to train the warping processing model to be trained; in addition, the same training image and its corresponding target image can also be used The above training process is performed multiple times.
本公开至少一个实施例还提供一种图像处理装置,图9为本公开至少一个实施例提供的一种图像处理装置的示意性框图。At least one embodiment of the present disclosure further provides an image processing device, and FIG. 9 is a schematic block diagram of an image processing device provided by at least one embodiment of the present disclosure.
例如,如图9所示,在一些实施例中,图像处理装置900可以包括图像采集模块901、第一处理模块902、第二处理模块903和映射模块904。For example, as shown in FIG. 9 , in some embodiments, an image processing apparatus 900 may include an image acquisition module 901 , a first processing module 902 , a second processing module 903 and a mapping module 904 .
图像采集模块901被配置为获取原始图像。图像采集模块901用于实现图1所示的步骤S10,关于图像采集模块901所实现的功能的具体说明可以参考上述图像处理方法的实施例中对于图1所示的步骤S10的相关描述,重复之处不再赘述。The image acquisition module 901 is configured to acquire original images. The image acquisition module 901 is used to implement step S10 shown in FIG. 1 . For specific descriptions of the functions implemented by the image acquisition module 901, reference may be made to the relevant description of step S10 shown in FIG. 1 in the embodiment of the above-mentioned image processing method, repeat The place will not be repeated.
例如,图像采集模块901可以包括摄像头,例如,智能手机的摄像头、平板电脑的摄像头、个人计算机的摄像头、数码照相机的镜头、或者甚至可以是网络摄像头。For example, the image acquisition module 901 may include a camera, such as a camera of a smart phone, a camera of a tablet computer, a camera of a personal computer, a lens of a digital camera, or even a web camera.
第一处理模块902被配置为对原始图像进行处理,以得到预处理图像。例如,预处理图像包括至少两条第一线,至少两条第一线沿同一方向依次并列排布。第一处理模块902用于实现图1所示的步骤S11,关于第一处理模块902所实现的功能的具体说明可以参考上述图像处理方法的实施例中对于图1所示的步骤S11的相关描述,重复之处不再赘述。The first processing module 902 is configured to process the original image to obtain a pre-processed image. For example, the preprocessed image includes at least two first lines, and the at least two first lines are sequentially arranged side by side along the same direction. The first processing module 902 is used to realize the step S11 shown in FIG. 1 . For the specific description of the functions realized by the first processing module 902, please refer to the relevant description of the step S11 shown in FIG. 1 in the embodiment of the above-mentioned image processing method , the repetitions will not be repeated.
第二处理模块903被配置为通过扭曲处理模型对预处理图像进行处理,以得到中间图像。例如,中间图像包括至少两条第二线,至少两条第二线沿同一方向依次并列排布,且至少两条第二线与至少两条第一线一一对应。第二处理模块903用于实现图1所示的步骤S12,关于第二处理模块903所实现的功能的具体说明可以参考上述图像处理方法的实施例中对于图1所示的步 骤S12的相关描述,重复之处不再赘述。The second processing module 903 is configured to process the pre-processed image by warping the processing model to obtain an intermediate image. For example, the intermediate image includes at least two second lines, the at least two second lines are arranged side by side in sequence along the same direction, and the at least two second lines are in one-to-one correspondence with the at least two first lines. The second processing module 903 is used to realize the step S12 shown in FIG. 1 . For the specific description of the functions realized by the second processing module 903, please refer to the relevant description of the step S12 shown in FIG. 1 in the embodiment of the above-mentioned image processing method , the repetitions will not be repeated.
映射模块904被配置为基于预处理图像和中间图像之间的映射关系,对原始图像进行重映射,以得到输出图像。映射模块904用于实现图1所示的步骤S13,关于映射模块904所实现的功能的具体说明可以参考上述图像处理方法的实施例中对于图1所示的步骤S13的相关描述,重复之处不再赘述。The mapping module 904 is configured to remap the original image based on the mapping relationship between the preprocessed image and the intermediate image to obtain an output image. The mapping module 904 is used to implement step S13 shown in FIG. 1. For specific descriptions of the functions implemented by the mapping module 904, please refer to the relevant description of step S13 shown in FIG. 1 in the above-mentioned embodiment of the image processing method. No longer.
例如,图像采集模块901、第一处理模块902、第二处理模块903和映射模块904之间可以进行数据通信。For example, data communication may be performed among the image acquisition module 901 , the first processing module 902 , the second processing module 903 and the mapping module 904 .
例如,在一些实施例中,图像处理装置900还可以包括模型训练模块。模型训练模块被配置为训练扭曲处理模型。For example, in some embodiments, the image processing device 900 may further include a model training module. The model training module is configured to train the warp processing model.
例如,在一些实施例中,模型训练模块可以包括图像生成子模块和训练子模块。For example, in some embodiments, the model training module may include an image generation submodule and a training submodule.
例如,图像生成子模块被配置为:生成训练图像;基于训练图像,生成与训练图像对应的目标图像。例如,训练图像包括至少两条训练线,至少两条训练线沿同一方向依次并列排布,目标图像包括至少两条目标训练线,至少两条目标训练线沿同一方向依次并列排布,且至少两条目标训练线与至少两条训练线一一对应。图像生成子模块用于实现图7所示的步骤S20和步骤S21,关于图像生成子模块所实现的功能的具体说明可以参考上述图像处理方法的实施例中对于图7所示的步骤S20和步骤S21的相关描述,重复之处不再赘述。For example, the image generating submodule is configured to: generate training images; and generate target images corresponding to the training images based on the training images. For example, the training image includes at least two training lines, the at least two training lines are arranged side by side in sequence along the same direction, the target image includes at least two target training lines, the at least two target training lines are arranged side by side in sequence along the same direction, and at least The two target training lines are in one-to-one correspondence with at least two training lines. The image generation sub-module is used to realize step S20 and step S21 shown in FIG. 7 . For specific descriptions about the functions realized by the image generation sub-module, reference can be made to step S20 and step S20 shown in FIG. 7 in the embodiment of the above-mentioned image processing method. The related description of S21 will not be repeated here.
例如,训练子模块被配置为基于训练图像和目标图像,对待训练的扭曲处理模型的进行训练,以获得训练好的扭曲处理模型。训练子模块用于实现图7所示的步骤S22,关于训练子模块所实现的功能的具体说明可以参考上述图像处理方法的实施例中对于图7所示的步骤S22的相关描述,重复之处不再赘述。For example, the training submodule is configured to train the warping model to be trained based on the training image and the target image, so as to obtain a trained warping model. The training sub-module is used to realize the step S22 shown in FIG. 7. For the specific description of the functions realized by the training sub-module, please refer to the relevant description of the step S22 shown in FIG. 7 in the embodiment of the above-mentioned image processing method. No longer.
在一些示例中,训练子模块被配置为通过待训练的扭曲处理模型对训练图像进行处理,以得到输出训练图像;基于输出训练图像和目标图像,对待训练的扭曲处理模型的参数进行调整;在待训练的扭曲处理模型对应的损失函数满足预定条件时,获得训练好的扭曲处理模型。例如,图像生成子模块 还被配置为在待训练的扭曲处理模型对应的损失函数不满足预定条件时,继续生成至少一个训练图像和与至少一个训练图像对应的目标图像。至少一个训练图像及其对应的目标图像用于重复执行上述训练过程。In some examples, the training submodule is configured to process the training image through the warping processing model to be trained to obtain an output training image; based on the output training image and the target image, adjust the parameters of the warping processing model to be trained; When the loss function corresponding to the warping model to be trained satisfies a predetermined condition, a trained warping model is obtained. For example, the image generation submodule is further configured to continue to generate at least one training image and a target image corresponding to the at least one training image when the loss function corresponding to the warping model to be trained does not meet the predetermined condition. At least one training image and its corresponding target image are used to repeatedly execute the above training process.
例如,图像采集模块901、第一处理模块902、第二处理模块903、映射模块904和/或模型训练模块包括存储在存储器中的代码和程序;处理器可以执行该代码和程序以实现如上所述的图像采集模块901、第一处理模块902、第二处理模块903、映射模块904和/或模型训练模块的一些功能或全部功能。例如,图像采集模块901、第一处理模块902、第二处理模块903、映射模块904和/或模型训练模块可以是专用硬件器件,用来实现如上所述的图像采集模块901、第一处理模块902、第二处理模块903、映射模块904和/或模型训练模块的一些或全部功能。例如,图像采集模块901、第一处理模块902、第二处理模块903、映射模块904和/或模型训练模块可以是一个电路板或多个电路板的组合,用于实现如上所述的功能。在本申请实施例中,该一个电路板或多个电路板的组合可以包括:(1)一个或多个处理器;(2)与处理器相连接的一个或多个非暂时的存储器;以及(3)处理器可执行的存储在存储器中的固件。For example, the image acquisition module 901, the first processing module 902, the second processing module 903, the mapping module 904 and/or the model training module include codes and programs stored in memory; the processor can execute the codes and programs to achieve the above Some or all of the functions of the image acquisition module 901, the first processing module 902, the second processing module 903, the mapping module 904 and/or the model training module described above. For example, the image acquisition module 901, the first processing module 902, the second processing module 903, the mapping module 904 and/or the model training module may be dedicated hardware devices, which are used to implement the above-mentioned image acquisition module 901, the first processing module 902, some or all functions of the second processing module 903, the mapping module 904 and/or the model training module. For example, the image acquisition module 901 , the first processing module 902 , the second processing module 903 , the mapping module 904 and/or the model training module may be a circuit board or a combination of multiple circuit boards for realizing the functions described above. In the embodiment of the present application, the circuit board or a combination of multiple circuit boards may include: (1) one or more processors; (2) one or more non-transitory memories connected to the processors; and (3) Processor-executable firmware stored in memory.
需要说明的是,图像处理装置可以实现与前述图像处理方法相似的技术效果,在此不再赘述。It should be noted that the image processing apparatus can achieve technical effects similar to those of the aforementioned image processing method, which will not be repeated here.
本公开至少一个实施例还提供一种电子设备,图10为本公开至少一个实施例提供的一种电子设备的示意性框图。At least one embodiment of the present disclosure further provides an electronic device, and FIG. 10 is a schematic block diagram of the electronic device provided by at least one embodiment of the present disclosure.
例如,如图10所示,电子设备1000可以包括处理器1001和存储器1002。存储器1002非瞬时性地存储有计算机可执行指令;处理器1001配置为运行计算机可执行指令。计算机可执行指令被处理器1001运行时可以实现根据本公开的任一实施例所述的图像处理方法。关于该图像处理方法的各个步骤的具体实现以及相关解释内容可以参见上述图像处理方法的实施例,在此不做赘述。For example, as shown in FIG. 10 , an electronic device 1000 may include a processor 1001 and a memory 1002 . The memory 1002 non-transitory stores computer-executable instructions; the processor 1001 is configured to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor 1001, the image processing method according to any embodiment of the present disclosure can be realized. For the specific implementation of each step of the image processing method and related explanations, reference may be made to the above-mentioned embodiment of the image processing method, which will not be repeated here.
例如,如图10所示,电子设备1000还可以包括通信接口1003和通信总线1004。处理器1001、存储器1002和通信接口1003通过通信总线1004实 现相互通信,处理器1001、存储器1002和通信接口1003等组件之间也可以通过网络连接进行通信。本公开对网络的类型和功能在此不作限制。For example, as shown in FIG. 10 , the electronic device 1000 may further include a communication interface 1003 and a communication bus 1004 . The processor 1001, the memory 1002 and the communication interface 1003 communicate with each other through the communication bus 1004, and the components such as the processor 1001, the memory 1002 and the communication interface 1003 can also communicate through a network connection. The present disclosure does not limit the type and function of the network here.
例如,处理器1001执行存储器1002上所存放的程序而实现的图像处理方法的其他实现方式,与前述图像处理方法实施例部分所提及的实现方式相同,这里也不再赘述。For example, other implementations of the image processing method realized by the processor 1001 executing the program stored in the memory 1002 are the same as the implementations mentioned in the foregoing image processing method embodiments, and will not be repeated here.
例如,通信总线1004可以是外设部件互连标准(PCI)总线或扩展工业标准结构(EISA)总线等。该通信总线1004可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。For example, communication bus 1004 may be a Peripheral Component Interconnect Standard (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus 1004 can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
例如,通信接口1003用于实现电子设备1000与其他设备之间的通信。For example, the communication interface 1003 is used to implement communication between the electronic device 1000 and other devices.
例如,处理器1001和存储器1002可以设置在服务器端(或云端),也可以设置在客户端(例如,手机等移动设备)。For example, the processor 1001 and the memory 1002 may be set at the server (or cloud), or at the client (for example, a mobile device such as a mobile phone).
例如,处理器1001可以控制电子设备1000中的其它组件以执行期望的功能。处理器1001可以是中央处理器(CPU)、网络处理器(NP)等;还可以是数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。中央处理器(CPU)可以为X86或ARM架构等。GPU可以单独地直接集成到主板上,或者内置于主板的北桥芯片中。GPU也可以内置于中央处理器(CPU)上。For example, the processor 1001 may control other components in the electronic device 1000 to perform desired functions. The processor 1001 can be a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable Logic devices, discrete gate or transistor logic devices, discrete hardware components. The central processing unit (CPU) may be an X86 or ARM architecture or the like. The GPU can be integrated directly on the motherboard alone, or built into the north bridge chip of the motherboard. A GPU can also be built into a central processing unit (CPU).
例如,存储器1002可以包括一个或多个计算机程序产品的任意组合,计算机程序产品可以包括各种形式的计算机可读存储介质,例如易失性存储器和/或非易失性存储器。易失性存储器例如可以包括随机存取存储器(RAM)和/或高速缓冲存储器(cache)等。非易失性存储器例如可以包括只读存储器(ROM)、硬盘、可擦除可编程只读存储器(EPROM)、便携式紧致盘只读存储器(CD-ROM)、USB存储器、闪存等。在所述计算机可读存储介质上可以存储一个或多个计算机可执行指令,处理器1001可以运行计算机可执行指令,以实现电子设备1000的各种功能。在存储器1002中还可以存储各种应用程序和各种数据等。For example, memory 1002 may include any combination of one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include random access memory (RAM) and/or cache memory (cache), etc., for example. Non-volatile memory may include, for example, read only memory (ROM), hard disks, erasable programmable read only memory (EPROM), compact disc read only memory (CD-ROM), USB memory, flash memory, and the like. One or more computer-executable instructions can be stored on the computer-readable storage medium, and the processor 1001 can run the computer-executable instructions to implement various functions of the electronic device 1000 . Various application programs and various data can also be stored in the memory 1002 .
需要说明的是,电子设备1000可以实现与前述图像处理方法相似的技术效果,重复之处不再赘述。It should be noted that the electronic device 1000 can achieve technical effects similar to those of the foregoing image processing method, and repeated descriptions will not be repeated here.
图11为本公开至少一个实施例提供的一种非瞬时性计算机可读存储介质的示意图。例如,如图11所示,在非瞬时性计算机可读存储介质1100上可以非暂时性地存储一个或多个计算机可执行指令1101。例如,当计算机可执行指令1101由处理器执行时可以执行根据本公开的任一实施例所述的图像处理方法中的一个或多个步骤。Fig. 11 is a schematic diagram of a non-transitory computer-readable storage medium provided by at least one embodiment of the present disclosure. For example, as shown in FIG. 11 , one or more computer-executable instructions 1101 may be non-transitory stored on a non-transitory computer-readable storage medium 1100 . For example, one or more steps in the image processing method according to any embodiment of the present disclosure may be executed when the computer-executable instructions 1101 are executed by the processor.
例如,该非瞬时性计算机可读存储介质1100可以应用于上述电子设备1000中,例如,其可以包括电子设备1000中的存储器1002。For example, the non-transitory computer-readable storage medium 1100 may be applied in the above-mentioned electronic device 1000 , for example, it may include the memory 1002 in the electronic device 1000 .
例如,关于非瞬时性计算机可读存储介质1100的说明可以参考电子设备1000的实施例中对于存储器1002的描述,重复之处不再赘述。For example, for the description of the non-transitory computer-readable storage medium 1100, reference may be made to the description of the memory 1002 in the embodiment of the electronic device 1000, and repeated descriptions will not be repeated.
图12为本公开至少一个实施例提供的一种硬件环境的示意图。本公开提供的电子设备可以应用在互联网系统。Fig. 12 is a schematic diagram of a hardware environment provided by at least one embodiment of the present disclosure. The electronic device provided by the present disclosure can be applied in the Internet system.
利用图12中提供的计算机系统可以实现本公开中涉及的图像处理装置和/或电子设备的功能。这类计算机系统可以包括个人电脑、笔记本电脑、平板电脑、手机、个人数码助理、智能眼镜、智能手表、智能指环、智能头盔及任何智能便携设备或可穿戴设备等。本实施例中的特定系统利用功能框图解释了一个包含用户界面的硬件平台。这种计算机设备可以是一个通用目的的计算机设备,或一个有特定目的的计算机设备。两种计算机设备都可以被用于实现本实施例中的图像处理装置和/或电子设备。计算机系统可以包括实施当前描述的实现图像处理所需要的信息的任何组件。例如,计算机系统能够被计算机设备通过其硬件设备、软件程序、固件以及它们的组合所实现。为了方便起见,图12中只绘制了一台计算机设备,但是本实施例所描述的实现图像处理所需要的信息的相关计算机功能是可以以分布的方式、由一组相似的平台所实施的,分散计算机系统的处理负荷。The functions of the image processing apparatus and/or electronic equipment involved in the present disclosure can be realized by using the computer system provided in FIG. 12 . Such computer systems can include personal computers, laptops, tablets, mobile phones, personal digital assistants, smart glasses, smart watches, smart rings, smart helmets, and any smart portable or wearable devices. The specific system in this embodiment illustrates a hardware platform including a user interface using functional block diagrams. Such computer equipment may be a general purpose computer equipment or a special purpose computer equipment. Both computer devices can be used to realize the image processing device and/or electronic device in this embodiment. The computer system may include any components that implement the presently described information needed to achieve image processing. For example, a computer system can be realized by a computer device through its hardware devices, software programs, firmware, and combinations thereof. For the sake of convenience, only one computer device is drawn in Fig. 12, but the relevant computer functions for realizing the information required for image processing described in this embodiment can be implemented by a group of similar platforms in a distributed manner, Distribute the processing load of a computer system.
如图12所示,计算机系统可以包括通信端口250,与之相连的是实现数据通信的网络(图12中的“来自/去往网络”),例如,计算机系统可以通过通信端口250发送和接收信息及数据,即通信端口250可以实现计算机系统与 其他电子设备进行无线或有线通信以交换数据。计算机系统还可以包括一个处理器组220(即上面描述的处理器),用于执行程序指令。处理器组220可以由至少一个处理器(例如,CPU)组成。计算机系统可以包括一个内部通信总线210。计算机系统可以包括不同形式的程序储存单元以及数据储存单元(即上面描述的存储器或存储介质),例如硬盘270、只读存储器(ROM)230、随机存取存储器(RAM)240,能够用于存储计算机处理和/或通信使用的各种数据文件,以及处理器组220所执行的可能的程序指令。计算机系统还可以包括一个输入/输出260,输入/输出260用于实现计算机系统与其他组件(例如,用户界面280等)之间的输入/输出数据流。As shown in Figure 12, the computer system can include a communication port 250, which is connected to a network for data communication ("from/to network" in Figure 12), for example, the computer system can send and receive data through the communication port 250 Information and data, that is, the communication port 250 can realize wireless or wired communication between the computer system and other electronic devices to exchange data. The computer system may also include a processor group 220 (ie, the processor described above) for executing program instructions. The processor group 220 may consist of at least one processor (eg, CPU). The computer system may include an internal communication bus 210 . A computer system may include different forms of program storage units and data storage units (i.e., memory or storage media described above), such as hard disk 270, read-only memory (ROM) 230, random access memory (RAM) 240, which can be used to store Various data files used by the computer for processing and/or communicating, and possibly program instructions executed by the processor group 220 . The computer system may also include an input/output 260 for enabling input/output data flow between the computer system and other components (eg, user interface 280, etc.).
通常,以下装置可以连接输入/输出260:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置;包括例如磁带、硬盘等的存储装置;以及通信接口。Typically, the following devices can be connected to input/output 260: input devices including, for example, touch screens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices; storage devices including, for example, magnetic tapes, hard disks, etc.; and communication interfaces.
虽然图12示出了具有各种装置的计算机系统,但应理解的是,并不要求计算机系统具备所有示出的装置,可以替代地,计算机系统可以具备更多或更少的装置。While FIG. 12 shows a computer system with various devices, it should be understood that the computer system is not required to have all of the devices shown and, instead, the computer system may have more or fewer devices.
对于本公开,还有以下几点需要说明:For this disclosure, the following points need to be explained:
(1)本公开实施例附图只涉及到与本公开实施例涉及到的结构,其他结构可参考通常设计。(1) The drawings of the embodiments of the present disclosure only relate to the structures involved in the embodiments of the present disclosure, and other structures may refer to general designs.
(2)为了清晰起见,在用于描述本发明的实施例的附图中,层或结构的厚度和尺寸被放大。可以理解,当诸如层、膜、区域或基板之类的元件被称作位于另一元件“上”或“下”时,该元件可以“直接”位于另一元件“上”或“下”,或者可以存在中间元件。(2) For clarity, in the drawings used to describe the embodiments of the present invention, the thickness and size of layers or structures are exaggerated. It will be understood that when an element such as a layer, film, region, or substrate is referred to as being "on" or "under" another element, it can be "directly on" or "under" the other element, Or intervening elements may be present.
(3)在不冲突的情况下,本公开的实施例及实施例中的特征可以相互组合以得到新的实施例。(3) In the case of no conflict, the embodiments of the present disclosure and the features in the embodiments can be combined with each other to obtain new embodiments.
虽然上文中已经用一般性说明及具体实施方式,对本公开作了详尽的描述,但在本公开实施例基础上,可以对之作一些修改或改进,这对本领域技术人员而言是显而易见的。因此,在不偏离本公开精神的基础上所做的这些修改或改进,均属于本公开要求保护的范围。Although the present disclosure has been described in detail with general descriptions and specific implementations above, it is obvious to those skilled in the art that some modifications or improvements can be made on the basis of the embodiments of the present disclosure. Therefore, the modifications or improvements made on the basis of not departing from the spirit of the present disclosure all belong to the protection scope of the present disclosure.

Claims (20)

  1. 一种图像处理方法,包括:An image processing method, comprising:
    获取原始图像;get the original image;
    对所述原始图像进行处理,以得到预处理图像,其中,所述预处理图像包括至少两条第一线,所述至少两条第一线沿同一方向依次并列排布;Processing the original image to obtain a pre-processed image, wherein the pre-processed image includes at least two first lines, and the at least two first lines are arranged side by side in sequence along the same direction;
    通过扭曲处理模型对所述预处理图像进行处理,以得到中间图像,其中,所述中间图像包括至少两条第二线,所述至少两条第二线沿同一方向依次并列排布,且所述至少两条第二线与所述至少两条第一线一一对应;The pre-processing image is processed by a distortion processing model to obtain an intermediate image, wherein the intermediate image includes at least two second lines, the at least two second lines are arranged side by side in sequence along the same direction, and the at least The two second lines correspond one-to-one to the at least two first lines;
    基于所述预处理图像和所述中间图像之间的映射关系,对所述原始图像进行重映射,以得到输出图像。Based on the mapping relationship between the preprocessed image and the intermediate image, the original image is remapped to obtain an output image.
  2. 根据权利要求1所述的图像处理方法,其中,所述预处理图像和所述中间图像之间的映射关系包括所述至少两条第一线和所述至少两条第二线之间的映射关系和所述预处理图像中的所述至少两条第一线之间的区域和所述中间图像中的所述至少两条第二线之间的区域之间的映射关系。The image processing method according to claim 1, wherein the mapping relationship between the preprocessed image and the intermediate image comprises a mapping relationship between the at least two first lines and the at least two second lines and a mapping relationship between the area between the at least two first lines in the preprocessed image and the area between the at least two second lines in the intermediate image.
  3. 根据权利要求1所述的图像处理方法,其中,基于所述预处理图像和所述中间图像之间的映射关系,对所述原始图像进行重映射,以得到输出图像,包括:The image processing method according to claim 1, wherein, based on the mapping relationship between the preprocessed image and the intermediate image, remapping the original image to obtain an output image comprises:
    基于所述预处理图像和所述中间图像之间的映射关系,通过插值方法确定与所述预处理图像对应的预处理映射信息,其中,所述预处理映射信息用于指示所述预处理图像中的至少部分像素的映射参数;Based on the mapping relationship between the pre-processing image and the intermediate image, determine pre-processing mapping information corresponding to the pre-processing image by an interpolation method, where the pre-processing mapping information is used to indicate the pre-processing image Mapping parameters for at least some of the pixels in ;
    基于所述预处理映射信息,确定所述预处理图像中的与所述原始图像对应的区域对应的映射信息;determining, based on the pre-processing mapping information, mapping information corresponding to a region corresponding to the original image in the pre-processing image;
    对与所述原始图像对应的区域的映射信息进行缩放处理,以确定与所述原始图像对应的映射信息;performing scaling processing on the mapping information of the area corresponding to the original image to determine the mapping information corresponding to the original image;
    基于与所述原始图像对应的映射信息对所述原始图像进行重映射,以得到所述输出图像。Remapping the original image based on the mapping information corresponding to the original image to obtain the output image.
  4. 根据权利要求3所述的图像处理方法,其中,所述预处理图像中的至 少部分像素包括所述预处理图像中的所述至少两条第一线之间的区域中的像素和所述至少两条第一线上的像素。The image processing method according to claim 3, wherein at least some of the pixels in the pre-processed image include pixels in the area between the at least two first lines in the pre-processed image and the at least Pixels on the two first lines.
  5. 根据权利要求1-4任一项所述的图像处理方法,其中,对所述原始图像进行处理,以得到预处理图像,包括:The image processing method according to any one of claims 1-4, wherein processing the original image to obtain a preprocessed image comprises:
    对所述原始图像进行二值化处理,以得到输入图像;performing binarization processing on the original image to obtain an input image;
    对所述输入图像进行缩放处理,以得到缩放后的图像;performing scaling processing on the input image to obtain a scaled image;
    对所述缩放后的图像进行填充处理,以得到填充后的图像;performing filling processing on the scaled image to obtain a filled image;
    对所述填充后的图像进行区域划分,以得到所述预处理图像。Perform region division on the filled image to obtain the preprocessed image.
  6. 根据权利要求5所述的图像处理方法,其中,所述缩放后的图像包括彼此相对的第一缩放图像边和第二缩放图像边,所述预处理图像包括彼此相对的第一预处理图像边和第二预处理图像边,所述第一预处理图像边与所述第一缩放图像边对应,所述第二预处理图像边与所述第二缩放图像边对应,所述至少两条第一线在所述第一预处理图像边和所述第二预处理图像边之间沿着从所述第一预处理图像边到所述第二预处理图像边的方向排列,The image processing method according to claim 5, wherein the scaled image comprises a first scaled image side and a second scaled image side opposite to each other, and the pre-processed image comprises a first pre-processed image side opposite to each other and the second pre-processing image side, the first pre-processing image side corresponds to the first zoomed image side, the second pre-processing image side corresponds to the second zoomed image side, and the at least two second a line is arranged between the first pre-processed image side and the second pre-processed image side along a direction from the first pre-processed image side to the second pre-processed image side,
    对所述缩放后的图像进行填充处理,以得到所述填充后的图像,包括:Filling the scaled image to obtain the filled image includes:
    在所述第一缩放像边远离所述第二缩放图像边的一侧填补第一填充区域并在所述第二缩放图像边远离所述第一缩放图像边的一侧填补第二填充区域,以得到所述填充后的图像,filling a first padding area on a side of the first zoomed image away from a side of the second zoomed image and filling a second padding area on a side of the second zoomed image away from a side of the first zoomed image, To get the padded image,
    其中,所述第一填充区域的彼此相对的两条边为所述第一缩放图像边和所述第一预处理图像边,所述第二填充区域的彼此相对的两条边为所述第二缩放图像边和所述第二预处理图像边。Wherein, the two opposite sides of the first filled area are the first scaled image side and the first pre-processed image side, and the two opposite sides of the second filled area are the first A second scaled image edge and said second preprocessed image edge.
  7. 根据权利要求6所述的图像处理方法,其中,所述第一填充区域的尺寸和所述第二填充区域的尺寸相同。The image processing method according to claim 6, wherein the size of the first filled area is the same as that of the second filled area.
  8. 根据权利要求1-4任一项所述的图像处理方法,其中,对所述原始图像进行处理,以得到预处理图像,包括:The image processing method according to any one of claims 1-4, wherein processing the original image to obtain a preprocessed image comprises:
    对所述原始图像进行二值化处理,以得到输入图像;performing binarization processing on the original image to obtain an input image;
    对所述输入图像进行填充处理,以得到填充后的图像;performing filling processing on the input image to obtain a filled image;
    对所述填充后的图像进行缩放处理,以得到缩放后的图像;Scaling the filled image to obtain a zoomed image;
    对所述缩放后的图像进行区域划分,以得到所述预处理图像。Perform region division on the scaled image to obtain the preprocessed image.
  9. 根据权利要求1-4任一项所述的图像处理方法,其中,所述至少两条第一线为对所述预处理图像沿同一方向进行等分的至少两条等分线。The image processing method according to any one of claims 1-4, wherein the at least two first lines are at least two bisector lines that equally divide the preprocessed image along the same direction.
  10. 根据权利要求1-4任一项所述的图像处理方法,其中,所述扭曲处理模型为基于神经网络的模型。The image processing method according to any one of claims 1-4, wherein the distortion processing model is a model based on a neural network.
  11. 根据权利要求1-4任一项所述的图像处理方法,其中,所述原始图像中的图像内容被扭曲。The image processing method according to any one of claims 1-4, wherein the image content in the original image is distorted.
  12. 根据权利要求1-4任一项所述的图像处理方法,还包括:训练所述扭曲处理模型,其中,训练所述扭曲处理模型包括:The image processing method according to any one of claims 1-4, further comprising: training the warping processing model, wherein training the warping processing model comprises:
    生成训练图像,其中,所述训练图像包括至少两条训练线,所述至少两条训练线沿同一方向依次并列排布;generating a training image, wherein the training image includes at least two training lines, and the at least two training lines are arranged side by side in sequence along the same direction;
    基于所述训练图像,生成与所述训练图像对应的目标图像,其中,所述目标图像包括至少两条目标训练线,所述至少两条目标训练线沿同一方向依次并列排布,且所述至少两条目标训练线与所述至少两条训练线一一对应;Based on the training image, generate a target image corresponding to the training image, wherein the target image includes at least two target training lines, the at least two target training lines are arranged side by side in sequence along the same direction, and the At least two target training lines correspond to the at least two training lines;
    基于所述训练图像和所述目标图像,对待训练的扭曲处理模型进行训练,以获得训练好的所述扭曲处理模型。Based on the training image and the target image, the warping model to be trained is trained to obtain the trained warping model.
  13. 根据权利要求12所述的图像处理方法,其中,基于所述训练图像和所述目标图像,对所述待训练的扭曲处理模型进行训练,以获得训练好的所述扭曲处理模型,包括:The image processing method according to claim 12, wherein, based on the training image and the target image, training the warping model to be trained to obtain the trained warping model comprises:
    通过所述待训练的扭曲处理模型对所述训练图像进行处理,以得到输出训练图像,其中,所述输出训练图像包括至少两条输出线,所述至少两条输出线沿同一方向依次并列排布,且所述至少两条输出线与所述至少两条训练线一一对应;The training image is processed by the warping processing model to be trained to obtain an output training image, wherein the output training image includes at least two output lines, and the at least two output lines are arranged side by side in sequence along the same direction Cloth, and the at least two output lines correspond to the at least two training lines one by one;
    基于所述输出训练图像和所述目标图像,对所述待训练的扭曲处理模型的参数进行调整;adjusting parameters of the warping model to be trained based on the output training image and the target image;
    在所述待训练的扭曲处理模型对应的损失函数满足预定条件时,获得训练好的所述扭曲处理模型,在所述待训练的扭曲处理模型对应的损失函数不满足预定条件时,继续输入所述训练图像和所述目标图像以重复执行上述训 练过程。When the loss function corresponding to the warping model to be trained meets the predetermined condition, obtain the trained warping model, and when the loss function corresponding to the warping model to be trained does not meet the predetermined condition, continue to input the The training image and the target image are used to repeatedly perform the above training process.
  14. 根据权利要求12所述的图像处理方法,其中,生成所述训练图像包括:The image processing method according to claim 12, wherein generating the training image comprises:
    生成输入训练图像;generate input training images;
    对所述输入训练图像进行缩放处理,以得到缩放后的输入训练图像;performing scaling processing on the input training image to obtain a scaled input training image;
    对所述缩放后的输入训练图像进行填充处理,以得到填充后的输入训练图像;Filling the scaled input training image to obtain the filled input training image;
    对所述填充后的输入训练图像进行扭曲处理,以得到扭曲后的输入训练图像;Distorting the filled input training image to obtain a distorted input training image;
    对所述扭曲后的输入训练图像进行区域划分,以得到包括所述至少两条训练线的所述训练图像。performing region division on the warped input training image to obtain the training image including the at least two training lines.
  15. 根据权利要求14所述的图像处理方法,其中,基于所述训练图像,生成与所述训练图像对应的目标图像,包括:基于所述扭曲处理对应的扭曲参数,对所述训练图像进行反向扭曲处理,以得到所述目标图像。The image processing method according to claim 14, wherein, based on the training image, generating a target image corresponding to the training image comprises: reversely performing the training image on the basis of the distortion parameter corresponding to the distortion processing Warp processing to get the target image.
  16. 根据权利要求14所述的图像处理方法,其中,生成输入训练图像,包括:The image processing method according to claim 14, wherein generating an input training image comprises:
    获取原始训练图像;Get the original training image;
    对所述原始训练图像进行二值化处理,以得到所述输入训练图像。Perform binarization processing on the original training image to obtain the input training image.
  17. 根据权利要求12所述的图像处理方法,其中,所述至少两条训练线为对所述训练图像沿同一方向进行等分的至少两条等分线。The image processing method according to claim 12, wherein the at least two training lines are at least two bisector lines that equally divide the training image along the same direction.
  18. 一种图像处理装置,包括:An image processing device, comprising:
    图像采集模块,被配置为获取原始图像;An image acquisition module configured to acquire an original image;
    第一处理模块,被配置为对所述原始图像进行处理,以得到预处理图像,其中,所述预处理图像包括至少两条第一线,所述至少两条第一线沿同一方向依次并列排布;The first processing module is configured to process the original image to obtain a pre-processed image, wherein the pre-processed image includes at least two first lines, and the at least two first lines are juxtaposed in sequence along the same direction arrangement;
    第二处理模块,被配置为通过扭曲处理模型对所述预处理图像进行处理,以得到中间图像,其中,所述中间图像包括至少两条第二线,所述至少两条第二线沿同一方向依次并列排布,且所述至少两条第二线与所述至少两条第 一线一一对应;The second processing module is configured to process the pre-processed image through a warping processing model to obtain an intermediate image, wherein the intermediate image includes at least two second lines, and the at least two second lines are sequentially along the same direction arranged side by side, and the at least two second lines correspond to the at least two first lines one by one;
    映射模块,被配置为基于所述预处理图像和所述中间图像之间的映射关系,对所述原始图像进行重映射,以得到输出图像。The mapping module is configured to remap the original image based on the mapping relationship between the preprocessed image and the intermediate image to obtain an output image.
  19. 一种电子设备,包括:An electronic device comprising:
    存储器,非瞬时性地存储有计算机可执行指令;memory non-transitoryly storing computer-executable instructions;
    处理器,配置为运行所述计算机可执行指令,a processor configured to execute said computer-executable instructions,
    其中,所述计算机可执行指令被所述处理器运行时实现根据权利要求1-17任一项所述的图像处理方法。Wherein, when the computer-executable instructions are executed by the processor, the image processing method according to any one of claims 1-17 is realized.
  20. 一种非瞬时性计算机可读存储介质,其中,所述非瞬时性计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现根据权利要求1-17中任一项所述的图像处理方法。A non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the computer-executable instructions according to any one of claims 1-17 are implemented. The image processing method described in one item.
PCT/CN2022/140852 2022-01-10 2022-12-22 Image processing method, image processing apparatus, electronic device and storage medium WO2023130966A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210022864.8 2022-01-10
CN202210022864.8A CN114387165A (en) 2022-01-10 2022-01-10 Image processing method, image processing apparatus, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
WO2023130966A1 true WO2023130966A1 (en) 2023-07-13

Family

ID=81198963

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/140852 WO2023130966A1 (en) 2022-01-10 2022-12-22 Image processing method, image processing apparatus, electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN114387165A (en)
WO (1) WO2023130966A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114387165A (en) * 2022-01-10 2022-04-22 杭州睿胜软件有限公司 Image processing method, image processing apparatus, electronic device, and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210073565A1 (en) * 2019-09-06 2021-03-11 Canon Kabushiki Kaisha Image processing apparatus, image processing method, and storage medium
CN112801088A (en) * 2020-12-31 2021-05-14 科大讯飞股份有限公司 Method and related device for correcting distorted text line image
CN113436222A (en) * 2021-05-31 2021-09-24 新东方教育科技集团有限公司 Image processing method, image processing apparatus, electronic device, and storage medium
CN113808033A (en) * 2021-08-06 2021-12-17 上海深杳智能科技有限公司 Image document correction method, system, terminal and medium
CN114387165A (en) * 2022-01-10 2022-04-22 杭州睿胜软件有限公司 Image processing method, image processing apparatus, electronic device, and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210073565A1 (en) * 2019-09-06 2021-03-11 Canon Kabushiki Kaisha Image processing apparatus, image processing method, and storage medium
CN112801088A (en) * 2020-12-31 2021-05-14 科大讯飞股份有限公司 Method and related device for correcting distorted text line image
CN113436222A (en) * 2021-05-31 2021-09-24 新东方教育科技集团有限公司 Image processing method, image processing apparatus, electronic device, and storage medium
CN113808033A (en) * 2021-08-06 2021-12-17 上海深杳智能科技有限公司 Image document correction method, system, terminal and medium
CN114387165A (en) * 2022-01-10 2022-04-22 杭州睿胜软件有限公司 Image processing method, image processing apparatus, electronic device, and storage medium

Also Published As

Publication number Publication date
CN114387165A (en) 2022-04-22

Similar Documents

Publication Publication Date Title
US11373275B2 (en) Method for generating high-resolution picture, computer device, and storage medium
WO2021233266A1 (en) Edge detection method and apparatus, and electronic device and storage medium
WO2022148192A1 (en) Image processing method, image processing apparatus, and non-transitory storage medium
CN109117846B (en) Image processing method and device, electronic equipment and computer readable medium
CN109871841B (en) Image processing method, device, terminal and storage medium
WO2023130966A1 (en) Image processing method, image processing apparatus, electronic device and storage medium
US9317909B2 (en) Image subsystem including image feature detection hardware component and image processing system including the same
WO2022213784A1 (en) Image processing method and apparatus, and electronic device and storage medium
CN113436222A (en) Image processing method, image processing apparatus, electronic device, and storage medium
WO2022002002A1 (en) Image processing method, image processing apparatus, electronic device, and storage medium
US11985287B2 (en) Image processing method, image processing device, electronic apparatus and storage medium
WO2024078233A1 (en) Text-containing image processing method and system, and storage medium
CN112907433B (en) Digital watermark embedding method, digital watermark extracting method, digital watermark embedding device, digital watermark extracting device, digital watermark embedding equipment and digital watermark extracting medium
CN112597940B (en) Certificate image recognition method and device and storage medium
CN108780572B (en) Image correction method and device
CN112927163A (en) Image data enhancement method and device, electronic equipment and storage medium
CN110852958B (en) Self-adaptive correction method and device based on object inclination angle
US11783458B2 (en) Image processing method, image processing device, electronic device and storage medium
JP4970385B2 (en) Two-dimensional code reader and program thereof
CN108875733B (en) Infrared small target rapid extraction system
US11610291B2 (en) Image processing method, image processing device, electronic device and storage medium
CN113920525A (en) Text correction method, device, equipment and storage medium
CN111428707A (en) Method and device for identifying pattern identification code, storage medium and electronic equipment
JP7478628B2 (en) Image processing device, control method, and control program
CN113869326A (en) SURF feature point extraction method, system, computer device and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22918409

Country of ref document: EP

Kind code of ref document: A1