WO2021179485A1 - 图像矫正处理方法、装置、存储介质及计算机设备 - Google Patents
图像矫正处理方法、装置、存储介质及计算机设备 Download PDFInfo
- Publication number
- WO2021179485A1 WO2021179485A1 PCT/CN2020/099032 CN2020099032W WO2021179485A1 WO 2021179485 A1 WO2021179485 A1 WO 2021179485A1 CN 2020099032 W CN2020099032 W CN 2020099032W WO 2021179485 A1 WO2021179485 A1 WO 2021179485A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- redian
- point
- key object
- object information
- Prior art date
Links
- 238000003860 storage Methods 0.000 title claims abstract description 24
- 238000003672 processing method Methods 0.000 title claims abstract description 14
- 238000012545 processing Methods 0.000 claims abstract description 106
- 238000000034 method Methods 0.000 claims abstract description 69
- 238000001514 detection method Methods 0.000 claims abstract description 63
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 16
- 238000003702 image correction Methods 0.000 claims description 57
- 230000006870 function Effects 0.000 claims description 45
- 230000008569 process Effects 0.000 claims description 35
- 238000010606 normalization Methods 0.000 claims description 33
- 238000004364 calculation method Methods 0.000 claims description 27
- 230000009466 transformation Effects 0.000 claims description 20
- 238000004891 communication Methods 0.000 claims description 15
- 238000012549 training Methods 0.000 claims description 13
- 238000012937 correction Methods 0.000 claims description 11
- 238000013527 convolutional neural network Methods 0.000 claims description 8
- 239000011159 matrix material Substances 0.000 claims description 7
- 238000013145 classification model Methods 0.000 claims description 6
- 238000006243 chemical reaction Methods 0.000 claims description 4
- 238000004590 computer program Methods 0.000 claims description 3
- 238000005516 engineering process Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 3
- 238000013528 artificial neural network Methods 0.000 description 2
- 238000011176 pooling Methods 0.000 description 2
- 238000012805 post-processing Methods 0.000 description 2
- 230000001131 transforming effect Effects 0.000 description 2
- 230000004913 activation Effects 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005286 illumination Methods 0.000 description 1
- 238000010191 image analysis Methods 0.000 description 1
- 238000003709 image segmentation Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 210000002569 neuron Anatomy 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 238000000844 transformation Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/80—Geometric correction
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
Definitions
- This application relates to the field of image processing technology, and in particular to a method, device, storage medium and computer equipment for image correction processing.
- the Hough transform method of detecting straight lines is usually used to correct the inclination of the image.
- this method has poor robustness, a large amount of calculation, slow program execution, and often misdetects images with complex backgrounds.
- Many straight lines are generated, and a large number of post-processing methods are required to filter the image straight lines, which leads to low efficiency of image correction processing and extremely high false detection rate and missed detection rate.
- the present application provides an image correction processing method, device, storage medium, and computer equipment.
- the main purpose is to be able to detect and use the key objects of the image to correct the image, thereby avoiding the error caused by the use of the straight line detection algorithm. , To reduce subsequent processing work, thereby improving the efficiency of image correction processing, and reducing the false detection rate and missed detection rate of image correction processing.
- an image correction processing method including:
- an image correction processing device including:
- the classification unit is configured to obtain an image to be corrected, classify the image according to a preset angle type, and perform correction processing on the image according to the classified angle type;
- the detection unit is configured to detect key object information according to the corrected image
- the correction unit is used to perform image correction processing using the key object information.
- a storage medium stores at least one executable instruction, and the executable instruction causes a processor to perform operations corresponding to the above-mentioned image correction processing method, for example, The following steps:
- a computer device such as a terminal, including: a processor, a memory, a communication interface, and a communication bus.
- the processor, the memory, and the communication interface complete each other through the communication bus. Inter-communication;
- the memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform operations corresponding to the above-mentioned image correction processing method, for example, to implement the following steps:
- the present application avoids errors caused by the straight line detection algorithm, reduces subsequent processing work, thereby improves the efficiency of the image correction processing, and reduces the false detection rate and the missed detection rate of the image correction processing.
- FIG. 1 shows a flowchart of an image correction processing method provided by an embodiment of the present application
- FIG. 2 shows a schematic structural diagram of an image correction processing device provided by an embodiment of the present application
- FIG. 3 shows a schematic structural diagram of another image correction processing apparatus provided by an embodiment of the present application.
- Fig. 4 shows a schematic diagram of the physical structure of a computer device provided by an embodiment of the present application.
- the technical solution of this application can be applied to the field of artificial intelligence or big data technology, and the involved data can be stored in a database, or can be distributed storage through a blockchain, which is not limited by this application.
- the Hough transform method of detecting straight lines is usually used to correct the tilt of the image.
- this method has poor robustness, large amount of calculation, slow program execution, and often misdetects images with complex backgrounds.
- Many straight lines are generated, and a large number of post-processing methods are required to filter the image straight lines, which leads to low efficiency of image correction processing and extremely high false detection rate and missed detection rate.
- an embodiment of the present application provides an image correction processing method. As shown in FIG. 1, the method includes:
- the image to be corrected may include a medical invoice image, a stock image, etc. uploaded by the user.
- the preset angle type may be an image classification angle value preset according to the image to be corrected. Specifically, the acquired images to be corrected are classified according to preset angle types, and images of different angle types are rotated by corresponding angles, so that the images are rotated to a standard angle, for example, the standard angle may be 0° .
- the system will classify the angle type of the image to be corrected as 90° after calculation.
- the angle type image rotation method is to rotate the image by 90° to make the angle correct, but there is a deviation; and if the angle type is set to every 10° when setting the angle type, the above-mentioned image to be corrected can be classified It is 80°, and then just rotated to 0°, which is convenient for subsequent identification.
- the key object information may be information that needs to be recognized in the image, such as the taxpayer identification, the invoice identification, and the date of issuance in the invoice image.
- the specific process of detecting the key object information may include: a) zooming the image to be corrected, for example, the image may be uniformly zoomed to a size of 512*512 to obtain an image with a size of 256*256*3, in order to reduce Calculation amount, the image can be further scaled to a size of 32*32; b) Use a key object detection algorithm to identify key objects of the image, and the key object detection algorithm may specifically be a pre-trained key object detection model, etc. C) confirming the output result of the key object detection algorithm as the key object information of the image to be corrected.
- the image correction processing may specifically be perspective transformation of the image. Since the existing straight line detection algorithm can only solve the 2D plane horizontal viewing angle problem to a certain extent, it cannot solve the 3D viewing angle problem. Therefore, this application can obtain After the key objects of the image to be corrected, perspective transformation processing is performed to solve the 3D perspective of the image to be corrected.
- the specific process may include: calculating according to the acquired key object information and the preset correction processing function, the perspective transformation of the image can be realized, that is, the arbitrary rotation of the image, so as to correct the image, the preset correction processing function Specifically, it may be an OpenCV related function.
- the key object information is input and executed as a parameter of the OpenCV function, that is, the image can be rotated at any angle.
- This application provides an image correction processing method. Compared with the prior art method using Hough transform to detect straight lines and perform tilt correction on an image, this application obtains an image to be corrected and classifies the image according to a preset angle type. , And perform normalization processing on the image according to the classified angle type; detect key object information according to the corrected image; use the key object information to perform image correction processing. This avoids the error caused by the straight line detection algorithm, reduces the subsequent processing work, thereby improves the efficiency of the image correction processing, and reduces the false detection rate and the missed detection rate of the image correction processing.
- step 101 may specifically include: classifying the image according to a preset angle type and an image angle classifier.
- the image angle classifier may specifically be a DenseNet classification network
- the specific process of the classification may include: first building a DenseNet classification model, training the DenseNet classification model according to different angle images and class labels corresponding to different angle images, Until the DenseNet classification model's ability to classify images from different angles reaches the preset requirements, then the image to be corrected is input, and the image to be corrected is classified.
- the step 101 may specifically further include: correcting the image according to a preset function.
- the preset function may specifically be an OpenCV function.
- the specific process may include: loading the image; preprocessing the loaded image, such as white balance of the image, adjusting the contrast and brightness of the image, etc.; using functions to determine the edge of the image, and binarize the image.
- a binary image is obtained, that is, the gray value of the pixels on the image is set to 0 or 255, and the entire image presents an obvious black and white effect.
- the canny operator is used to detect all lines in the image; the orientation is determined according to the determined image edge Fixed point; take the determined position fixed point as input, and correct the image through the OpenCV function.
- the step 101 may specifically include: normalizing and standardizing the image after the normalization processing.
- the image normalization processing and standardization processing can perform a series of standard processing transformations on the image to transform it into a process of a fixed standard form. Convert the form of the image to a unified standard.
- the normalization can be calculated according to the following function:
- x i and y can respectively represent the pixel coordinate values before and after the normalization processing
- min(x) and max(x) can respectively represent the minimum and maximum values of the image pixels.
- the standardization can be calculated according to the following function:
- std can represent the standard deviation
- ⁇ can represent the mean value of the image
- x can represent the image matrix
- ⁇ can represent the standard deviation
- N can represent the number of image pixels to obtain a uniform pixel image.
- the step 102 may specifically include: performing scaling processing on the image according to a preset scaling standard; generating a true label map of the scaling image; According to the real label map and the optimized loss algorithm, the key object information is detected.
- the process of generating the true label map can be based on the following function:
- A can indicate whether the key object is occluded, if it is not occluded, it means 1, otherwise, it is -1.
- ⁇ can take a value of 1.5.
- the use of probability indicates that the value of the pixel closer to the real position is 1, and the position that deviates from the key object is 0.
- the Gaussian function just meets the probability of the pixel that is closer to the key object position, the closer to 1, and the farther away
- the pixel value of the key object is close to 0, and x and y respectively represent the position coordinates of the pixel point.
- the loss function can be calculated by optimization:
- x and y represent the pixel coordinate value of the corresponding point
- Can represent a label
- x and y respectively represent the position coordinates of the pixel
- the calculated result is a key object Loss
- calculate the average loss of 32 points Solve the loss and get the optimal result, which is the key object of the image.
- the step 102 may specifically further include: performing scaling processing on the image by using a convolutional neural network to obtain a scaled feature map.
- a convolutional neural network in order to facilitate the identification of key objects and align multiple images, the images to be corrected can be uniformly scaled to a size of 32*32.
- CNN Convolutional Neural Network
- Artificial neurons can respond to surrounding units and can perform large-scale operations.
- Image Processing The convolutional neural network includes a convolutional layer and a pooling layer.
- the convolution process can include: first convolve an input image with a trainable filter fx (the first stage is the input image, and the subsequent stage is the convolution feature map), and then add the bias bx to get the convolutional layer Cx.
- the sub-sampling process can specifically include: summing four pixels in each neighborhood into one pixel, weighting by a scalar Wx+1, adding a bias bx+1, and generating a feature map reduced by four times through the sigmoid activation function Sx+1.
- the step 103 may specifically include: performing perspective transformation on the image according to the key object information and a preset image correction processing function Processing to get the corrected image.
- the preset image correction processing function may be an OpenCV function.
- the OpenCV function to directly input and run the key object as a function parameter, the image can be rotated at any angle.
- the specific process may include: when the default rotation is 45 degrees, the expanded image is the largest, which is 2 times the root number Use the getRotationMatrix2D function to obtain the rotation matrix, and use the warpAffine function to rotate the matrix; find the largest rectangle including the image after the rotation; delete the extra black border.
- the calculation process of the rotation angle coordinates may include: if point O is the center of the circle, after point P is rotated by redian radians around point O, the calculation formula for transforming the coordinates of point P to point Q may be:
- P.x, Q.x, and Q.y represent the pixel coordinate values of point P and point Q, respectively, redian can be expressed as radians, and the conversion formula of radians and angles can be:
- redian is expressed as a radian
- pi is a constant ⁇
- angle is an angle value corresponding to the radian
- P.x, P.x, Q.x, Q.y, O.x, and O.y represent the pixel coordinate values of point P, point Q, and point O, respectively, and redian represents radians.
- a point can be selected as the center of the circle, and the key object can be used as a rotating object to correct the image.
- the method may further include: performing calculations based on the zoomed image and a pre-trained key object detection model to obtain key object information,
- the training sample data of the pre-trained key object detection model is obtained by extracting the detection object information of the image.
- extracting the detection object information of the image may include extracting pixel point information of the image and the like. Specifically, calculations can be performed based on the image and a pre-trained key object detection model, so as to output key object information.
- the method may further include: acquiring sample data information of the image, where the sample data information includes the detection object information of the image; The sample data information, the true label map, and the average loss of the key object are used to train the key object detection model.
- the training process of the key object detection model includes: forward propagation stage: a) Take a sample (X, Yp) from the sample set, and input X into the network; because this step is the training of the key point object detection model fan Therefore, the input in the sample set is all the detected objects in the picture, such as pixels, and the output is the determined key object, such as the pixel determined to be the key object. b) Calculate the corresponding actual output Op.
- Backward propagation stage a) Calculate the difference between the actual output Op and the corresponding ideal output Yp; b) Back-propagate the adjustment weight matrix according to the method of minimizing the error.
- This application provides an image correction processing method. Compared with the prior art method using Hough transform to detect straight lines and perform tilt correction on an image, this application obtains an image to be corrected and classifies the image according to a preset angle type. , And perform normalization processing on the image according to the classified angle type; detect key object information according to the corrected image; use the key object information to perform image correction processing. This avoids the error caused by the straight line detection algorithm, reduces the subsequent processing work, thereby improves the efficiency of the image correction processing, and reduces the false detection rate and the missed detection rate of the image correction processing.
- an embodiment of the present application provides an image correction processing device.
- the device includes: a classification unit 21, a detection unit 22, and a correction unit 23.
- the classification unit 21 may be used to obtain an image to be corrected, classify the image according to a preset angle type, and perform normalization processing on the image according to the classified angle type;
- the detection unit 22 may be used to detect key object information according to the corrected image
- the correction unit 23 may be used to perform image correction processing using the key object information.
- the classification unit 21 may include: a classification module 211, a normalization module 212, and a processing module 213, as shown in FIG. 3.
- the classification module 211 may be used to classify the image according to a preset angle type and an image angle classifier;
- the normalization module 212 may be used to perform normalization processing on the image according to a preset function
- the processing module 213 may be used to normalize and standardize the image after the normalization process.
- the detecting unit 22 may include: a scaling module 221, a generating module 222, and a detecting module 223.
- the zoom module 221 may be used to perform zoom processing on the image according to a preset zoom standard
- the generating module 222 may be used to generate the true label map of the zoomed image
- the detection module 223 may be used to detect key object information according to the real label map and an optimized loss algorithm.
- the scaling module 221 may be specifically used to perform scaling processing on the image by using a convolutional neural network to obtain a scaled feature map.
- correction unit 23 may include: a perspective transformation module 211.
- the perspective transformation module 231 may be used to perform perspective transformation processing on the image according to the key object information and a preset image correction processing function to obtain a corrected image.
- the device may also include:
- the calculation unit 24 may be configured to perform calculations based on the scaled image and a pre-trained key object detection model to obtain key object information.
- the training sample data of the pre-trained key object detection model is obtained by extracting the training sample data of the pre-trained key object detection model.
- the image's detection object information is obtained.
- the device may also include:
- the obtaining unit 25 may be used to obtain sample data information of the image, where the sample data information includes detection object information of the image;
- the training model 26 may be used to train the key object detection model according to the sample data information, the true label map, and the average loss of the key object.
- an embodiment of the present application also provides a storage medium.
- the storage medium may include a high-speed RAM memory, or may also include a non-volatile memory (non-volatile memory),
- at least one disk storage at least one executable instruction is stored in the storage medium, and the execution instruction causes the processor to perform the following steps: obtain an image to be corrected, classify the image according to a preset angle type, and perform the following steps: The classified angle type performs normalization processing on the image; detects key object information according to the corrected image; and uses the key object information to perform image correction processing.
- an embodiment of the present application also provides a computer device.
- the processor 31, the communication interface 32, and the memory 33 communicate with each other through the communication bus 34.
- the communication interface 34 is used to communicate with other devices, such as network elements such as user terminals or other servers.
- the processor 31 is configured to execute a program, and specifically can execute the relevant steps in the embodiment of the image correction processing method described above.
- the program may include program code, and the program code includes computer operation instructions.
- the processor 31 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
- ASIC Application Specific Integrated Circuit
- One or more processors included in a computer device such as a terminal may be the same type of processor, such as one or more CPUs, or different types of processors, such as one or more CPUs and one or more ASICs.
- the memory 33 is used to store programs.
- the memory 33 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), for example, at least one disk memory.
- the program can specifically be used to cause the processor 31 to perform the following operations: obtain an image to be corrected, classify the image according to a preset angle type, and perform normalization processing on the image according to the classified angle type; After the image, the key object information is detected; the key object information is used to perform image correction processing.
- This application provides an image correction processing device, storage medium, and computer equipment. Compared with the prior art method of detecting straight lines using Hough transform to correct the image, this application obtains the image to be corrected according to a preset angle type. The image is classified, and the image is corrected according to the classified angle type; the key object information is detected according to the corrected image; the key object information is used to perform image correction processing. This avoids the error caused by the straight line detection algorithm, reduces the subsequent processing work, thereby improves the efficiency of the image correction processing, and reduces the false detection rate and the missed detection rate of the image correction processing.
- the storage medium involved in this application may be a computer-readable storage medium, and the storage medium, such as a computer-readable storage medium, may be non-volatile or volatile.
- modules or units or components in the embodiments can be combined into one module or unit or component, and in addition, they can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and/or processes or units are mutually exclusive, any combination can be used to compare all the features disclosed in this specification (including the accompanying claims, abstract and drawings) and any method or methods disclosed in this manner or All the processes or units of the equipment are combined. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
- the various component embodiments of the present application may be implemented by hardware, or by software modules running on one or more processors, or by a combination of them.
- a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the embodiments of the present application.
- This application can also be implemented as a device or device program (for example, a computer program and a computer program product) for executing part or all of the methods described herein.
- Such a program for implementing the present application may be stored on a computer-readable medium, or may have the form of one or more signals.
- Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Bioinformatics & Computational Biology (AREA)
- General Engineering & Computer Science (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Image Analysis (AREA)
Abstract
一种图像矫正处理方法、装置、存储介质及计算机设备,涉及图像处理技术领域,主要目的在于能够检测和利用图像的关键对象对图像进行矫正处理,从而避免了直线检测算法带来的误差,减少后续的处理工作,进而提高图像矫正处理的效率,降低图像矫正处理的误检率和漏检率。所述方法包括:获取待矫正图像,根据预设的角度类型对所述图像进行分类,并按照分类后的角度类型对所述图像进行转正处理(101);根据所述转正后的图像,检测关键对象信息(102);利用所述关键对象信息,进行图像矫正处理(103)。适用于图像矫正处理。
Description
本申请要求于2020年3月11日提交中国专利局、申请号为202010164108.X,发明名称为“图像矫正处理方法、装置、存储介质及计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及图像处理技术领域,特别是涉及一种图像矫正处理的方法、装置、存储介质及计算机设备。
随着深度学习技术越来越成熟,图像分析与识别技术愈发受到关注,广泛应用于不同的领域。在上传图像时,由于拍照设备原因或人为因素,通过拍照方式获取到的图像通常会存在倾斜角度大,表面变形、分辨率过低、光照不均等情况,给后续图像分割、检测和识别带来极大困难。
发明人意识到,目前,通常使用Hough变换检测直线的方法,对图像进行倾斜矫正,然而,这种方法鲁棒性差,运算量大,程序执行慢,而且针对背景复杂的图像,往往会误检测出很多的直线,需要大量的后处理方法去筛选图像直线,导致图像矫正处理的效率低下,误检率和漏检率极高。
发明内容
有鉴于此,本申请提供一种图像矫正处理方法、装置、存储介质及计算机设备,主要目的在于能够检测和利用图像的关键对象对图像进行矫正处理,从而避免了使用直线检测算法带来的误差,减少后续的处理工作,进而提高图像矫正处理的效率,降低图像矫正处理的误检率和漏检率。
依据本申请一个方面,提供了一种图像矫正处理方法,包括:
获取待矫正图像,根据预设的角度类型对所述图像进行分类,并按照分类后的角度类型对所述图像进行转正处理;
根据所述转正后的图像,检测关键对象信息;
利用所述关键对象信息,进行图像矫正处理。
依据本申请另一个方面,提供了一种图像矫正处理装置,包括:
分类单元,用于获取待矫正图像,根据预设的角度类型对所述图像进行分类,并按照分类后的角度类型对所述图像进行转正处理;
检测单元,用于根据所述转正后的图像,检测关键对象信息;
矫正单元,用于利用所述关键对象信息,进行图像矫正处理。
根据本申请的又一方面,提供了一种存储介质,所述存储介质中存储有至少一可执行指令,所述可执行指令使处理器执行如上述图像矫正处理方法对应的操作,例如,实现以下步骤:
获取待矫正图像,根据预设的角度类型对所述图像进行分类,并按照分类后的角度类型对所述图像进行转正处理;
根据所述转正后的图像,检测关键对象信息;
利用所述关键对象信息,进行图像矫正处理。
根据本申请的再一方面,提供了一种计算机设备如终端,包括:处理器、存储器、通信接口和通信总线,所述处理器、所述存储器和所述通信接口通过所述通信总线完成相互间的通信;
所述存储器用于存放至少一可执行指令,所述可执行指令使所述处理器执行上述图像矫正处理方法对应的操作,例如,实现以下步骤:
获取待矫正图像,根据预设的角度类型对所述图像进行分类,并按照分类后的角度类 型对所述图像进行转正处理;
根据所述转正后的图像,检测关键对象信息;
利用所述关键对象信息,进行图像矫正处理。
本申请避免了直线检测算法带来的误差,减少后续的处理工作,进而提高图像矫正处理的效率,降低图像矫正处理的误检率和漏检率。
图1示出了本申请实施例提供的一种图像矫正处理方法流程图;
图2示出了本申请实施例提供的一种图像矫正处理装置的结构示意图;
图3示出了本申请实施例提供的另一种图像矫正处理装置结构示意图;
图4示出了本申请实施例提供的一种计算机设备的实体结构示意图。
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
本申请的技术方案可应用于人工智能或大数据技术领域,涉及的数据可存储于数据库中,或者可以通过区块链分布式存储,本申请不做限定。
如背景技术所述,目前,通常使用Hough变换检测直线的方法对图像进行倾斜矫正,然而,这种方法鲁棒性差,运算量大,程序执行慢,而且针对背景复杂的图像,往往会误检测出很多的直线,需要大量的后处理方法去筛选图像直线,导致图像矫正处理的效率低下,误检率和漏检率极高。
为了解决上述问题,本申请实施例提供了一种图像矫正处理方法,如图1所示,所述方法包括:
101、获取待矫正图像,根据预设的角度类型对所述图像进行分类,并按照分类后的角度类型对所述图像进行转正处理。
其中,所述待矫正图像可以包括用户上传的医疗***图像、证券图像等。所述预设的角度类型可以为根据待矫正图像预先设置的图像分类角度值。具体地,将获取到的待矫正图像按照预设的角度类型进行分类,并将不同角度类型的图像旋转对应的角度,以使得所述图像转至标准角度,如所述标准角度可以为0°。
需要说明的是,为了尽可能将待矫正图像旋转至标准角度,可以尽量多的设置角度类型,以提高图像转正的精度。例如,若设置角度类型为0°、90°、180°、270°,待矫正图像的倾斜角度为80°,则***经过计算后将待矫正图像的角度类型分类为90°,并根据90°角度类型图像的旋转方式,将所述图像旋转90°,使其角度转正,但存在偏差;而若在设置角度类型时将角度类型设置为每10°一类,则可以将上述待矫正图像分类为80°,进而刚好旋转至0°,方便后续的识别。
102、根据所述转正后的图像,检测关键对象信息。
其中,所述关键对象信息可以为所述图像中需要识别到的信息,如***图像中的纳税人标识、***标识、开票日期等。所述检测关键对象信息的具体过程可以包括:a)将待矫正图像进行缩放处理,如可以先将所述图像统一缩放至512*512大小,得到大小为256*256*3的图像,为了减少计算量,可以进一步将所述图像缩放至32*32大小;b)利用关键对象检测算法对所述图像进行关键对象的识别,所述关键对象检测算法具体可以为预先训练的关键对象检测模型等;c)将所述关键对象检测算法输出的结果确认为所述待矫正图像的关键对象信息。
103、利用所述关键对象信息,进行图像矫正处理。
其中,所述图像矫正处理具体可以为对图像进行透视变换,由于现有的直线检测算法只能在一定程度上解决2D平面水平视角问题,并不能解决3D视角问题,因此,本申请可以在获取待矫正图像的关键对象后,再进行透视变换处理,从而解决待矫正图像的3D视角问题。具体过程可以包括:根据获取的关键对象信息和预设的矫正处理函数进行计算,可以实现图像的透视变换,即图像的任意旋转,从而对所述图像进行矫正,所述预设的矫正处理函数具体可以为OpenCV相关函数,将所述关键对象信息作为所述OpenCV函数的参数输入并执行,即可以实现所述图像的任意角度旋转。
本申请提供一种图像矫正处理方法,与现有技术使用Hough变换检测直线的方法,对图像进行倾斜矫正相比,本申请通过获取待矫正图像,根据预设的角度类型对所述图像进行分类,并按照分类后的角度类型对所述图像进行转正处理;根据所述转正后的图像,检测关键对象信息;利用所述关键对象信息,进行图像矫正处理。从而避免了直线检测算法带来的误差,减少后续的处理工作,进而提高图像矫正处理的效率,降低图像矫正处理的误检率和漏检率。
进一步的,为了更好的说明上述图像矫正处理方法的过程,作为对上述实施例的细化和扩展,本申请实施例提供了几种可选实施例,但不限于此,具体如下所示:
在本申请的一个可选实施例,为了提高图像分类的效率,所述步骤101具体可以包括:根据预设的角度类型和图像角度分类器对所述图像进行分类。其中,所述图像角度分类器具体可以为DenseNet分类网络,所述分类的具体过程可以包括:首先搭建DenseNet分类模型,根据不同角度图像以及不同角度图像对应的类别标签,训练所述DenseNet分类模型,直至DenseNet分类模型对不同角度图像的分类能力达到预设要求,然后输入待矫正图像,对所述待矫正图像进行分类。
对于本申请实施例,为了将所述图像转至标准角度,所述步骤101具体还可以包括:根据预设的函数对所述图像进行转正处理。所述预设函数具体可以为OpenCV函数。具体过程可以包括:加载所述图像;对所加载的图像进行预处理,如对图像进行白平衡、对图像的对比度和亮度进行调节等;利用函数确定图像边缘,对图像进行二值化处理并得出二值图,即将图像上的像素点的灰度值设置为0或255,将整个图像呈现出明显的黑白效果,利用canny算子检测图像中所有线条;根据所确定的图像边缘确定方位定点;以所确定的方位定点作为输入,通过OpenCV函数对图像进行矫正。
对于本申请实施例,为了得到统一像素的图像,所述步骤101具体又可以包括:对所述转正处理后的图像进行归一化和标准化处理。其中,所述图像归一化处理和标准化处理可以对图像进行一系列标准的处理变换,使之变换为固定标准形式的过程。将图像的形式转换为统一标准。具体地,所述归一化可以根据以下函数进行计算:
其中:x
i,y分别可以表示归一化处理前后的像素坐标值,min(x),max(x)分别可以表示所述图像像素的最小值和最大值。所述标准化可以根据以下函数计算:
std可以表示标准差,μ可以表示图像的均值,x可以表示图像矩阵,σ可以表示标准方差,N可以表示图像像素数量,以得到统一像素的图像。
在本申请的另一个可选实施例,为了检测关键对象信息,所述步骤102具体可以包括:根据预设的缩放标准,对所述图像进行缩放处理;生成所述缩放图像的真实标签图;根据所述真实标签图,以及优化损失算法,检测关键对象信息。
其中,所述生成真实标签图的过程可以根据以下函数:
其中:A可以表示关键对象是否被遮挡,如果没有被遮挡表示1,反之为-1。σ可以取值1.5,使用概率表示越接近真实位置的像素点的值为1,偏离关键对象的位置用0,使用高斯函数恰好满足距离关键对象位置越近的像素点的概率越接近1,远离关键对象的像素值接近0,x,y分别表示所述像素点的位置坐标。
为了检测关键对象信息,在通过计算得到真实标签图后,可以通过优化计算损失函数:
其中:x和y表示对应点的像素坐标值,
可以表示标签,
表示实际预测结果,x,y分别表示所述像素点的位置坐标,得到的计算结果为一个关键对象
的损失,最后计算32个点的平均损失
求解损失,得到最优结果,即为所述图像的关键对象,需要说明的是,在实际的生产数据中,用户上传的图像,如***等,都是完整的,因此得到的关键对象都是没有被遮挡。
对于本申请实施例,为了对图像进行缩放处理,所述步骤102具体还可以包括:利用卷积神经网络对所述图像进行缩放处理,得到缩放后的特征映射图。其中,为了便于识别的关键对象,并使多张图像对齐,可以将待矫正图像统一缩放至32*32大小。具体地,可以利用神经网络中的添加卷积及池化操作,即卷积神经网络(Convolutional Neural Network,简称CNN),是一种前馈神经网络,人工神经元可以响应周围单元,可以进行大型图像处理。卷积神经网络包括卷积层和池化层,卷积过程可以包括:首先用一个可训练的滤波器fx卷积一个输入的图像(第一阶段是输入的图像,后面的阶段是卷积特征map),然后加偏置bx,得到卷积层Cx。子采样过程具体可以包括:将每邻域四个像素求和变为一个像素,通过标量Wx+1加权,再增加偏置bx+1,通过sigmoid激活函数,产生一个缩小四倍的特征映射图Sx+1。
在本申请的又一个可选实施例,为了解决所述图像的透视问题,所述步骤103具体可以包括:根据所述关键对象信息以及预设的图像矫正处理函数,对所述图像进行透视变换处理,得到矫正后的图像。其中,所述预设的图像矫正处理函数可以为OpenCV函数。具体地,利用所述OpenCV函数直接将关键对象作为函数参数进行输入运行,可以实现图片的任意角度旋转,具体过程可以包括:默认旋转45度时,所扩展的图像最大,即为根号2倍的长或宽的最大值,将图像填充到可能达到的最大;使用getRotationMatrix2D函数求取旋转矩阵,使用warpAffine函数旋转矩阵;求旋转之后包括图像的最大的矩形;删除多余的黑色边框。
对应的,旋转角度坐标的计算过程可以包括:如果O点为圆心,则点P绕点O旋转redian弧度之后,点P的坐标变换为点Q的计算公式可以为:
Q.x=P.x*cos(redian)-P.y*sin(redian)
Q.y=P.x*sin(redian)+P.y*cos(redian)
P.x、Q.x和Q.y分别表示P点和Q点的像素坐标值,redian可以表示为弧度,弧度与角度的变换公式可以为:
redian=pi*180/angle
其中:redian表示为弧度,pi表示π常量,angle表示所述弧度对应的角度值;
如果O点不是圆心,则点P绕点O旋转redian弧度之后,点P的坐标变换为Q的计算公式可以为如下所示:
Q.x=(P.x-O.x)*cos(redian)-(P.y-O.y)*sin(redian)+O.x
Q.y=(P.x-O.x)*sin(redian)+(P.y-O.y)*cos(redian)+O.y
其中:P.x、P.x、Q.x、Q.y、O.x和O.y分别表示P点、Q点和O点的像素坐标值,redian表示为弧度。
需要说明的是,本申请中可以选取一个点为圆心,将关键对象作为旋转的对象,对所述图像进行校正。
在本申请的再一个可选实施例,为了检测关键对象,所述方法还可以包括:根据所述缩放后的图像,以及预先训练的关键对象检测模型进行计算,以获得关键对象信息,所述预先训练的关键对象检测模型的训练样本数据是通过提取所述图像的检测对象信息得到的。
其中,所述提取所述图像的检测对象信息可以包括,提取所述图像的像素点信息等。具体地,可以根据所述图像和预先训练的关键对象检测模型进行计算,从而输出关键对象信息。
在本申请的一个可选实施例,为了训练关键对象检测模型,所述方法还可以包括:获取所述图像的样本数据信息,所述样本数据信息包括所述图像的检测对象信息;根据所述样本数据信息、真实标签图以及关键对象的平均损失,对所述关键对象检测模型进行训练。
其中,所述关键对象检测模型的训练过程包括:向前传播阶段:a)从样本集中取一个样本(X,Yp),将X输入网络;由于此步骤是对关键点对象检测模型fan的训练过程,因此,样本集中的输入是图片中所有的检测对象,如像素点,输出为被确定的关键对象,如被确定是关键对象的像素点,b)计算相应的实际输出Op。向后传播阶段:a)计算实际输出Op与相应的理想输出Yp的差;b)按极小化误差的方法反向传播调整权矩阵。
本申请提供一种图像矫正处理方法,与现有技术使用Hough变换检测直线的方法,对图像进行倾斜矫正相比,本申请通过获取待矫正图像,根据预设的角度类型对所述图像进行分类,并按照分类后的角度类型对所述图像进行转正处理;根据所述转正后的图像,检测关键对象信息;利用所述关键对象信息,进行图像矫正处理。从而避免了直线检测算法带来的误差,减少后续的处理工作,进而提高图像矫正处理的效率,降低图像矫正处理的误检率和漏检率。
进一步的,作为对上述图1所示方法的实现,本申请实施例提供了一种图像矫正处理装置,如图2所示,该装置包括:分类单元21、检测单元22、矫正单元23。
分类单元21,可以用于获取待矫正图像,根据预设的角度类型对所述图像进行分类,并按照分类后的角度类型对所述图像进行转正处理;
检测单元22,可以用于根据所述转正后的图像,检测关键对象信息;
矫正单元23,可以用于利用所述关键对象信息,进行图像矫正处理。
进一步地,所述分类单元21,可以包括:分类模块211、转正模块212和处理模块213,如图3所示。
所述分类模块211,可以用于根据预设的角度类型和图像角度分类器对所述图像进行分类;
所述转正模块212,可以用于根据预设的函数对所述图像进行转正处理;
所述处理模块213,可以用于对所述转正处理后的图像进行归一化和标准化处理。
进一步地,所述检测单元22,可以包括:缩放模块221、生成模块222和检测模块223。
所述缩放模221,可以用于根据预设的缩放标准,对所述图像进行缩放处理;
所述生成模块222,可以用于生成所述缩放图像的真实标签图;
所述检测模块223,可以用于根据所述真实标签图,以及优化损失算法,检测关键对象信息。
进一步地,所述缩放模块221,具体可以用于利用卷积神经网络对所述图像进行缩放处理,得到缩放后的特征映射图。
进一步地,所述矫正单元23,可以包括:透视变换模块211。
所述透视变换模块231,可以用于根据所述关键对象信息以及预设的图像矫正处理函数,对所述图像进行透视变换处理,得到矫正后的图像。
进一步地,所述装置还可以包括:
计算单元24,可以用于根据所述缩放后的图像,以及预先训练的关键对象检测模型进行计算,以获得关键对象信息,所述预先训练的关键对象检测模型的训练样本数据是通过提取所述图像的检测对象信息得到的。
进一步地,所述装置还可以包括:
获取单元25,可以用于获取所述图像的样本数据信息,所述样本数据信息包括所述图像的检测对象信息;
训练模型26,可以用于根据所述样本数据信息、真实标签图以及关键对象的平均损失,对所述关键对象检测模型进行训练。
基于上述如图1所示方法,相应的,本申请实施例还提供了一种存储介质,所述存储介质可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器,所述存储介质中存储有至少一可执行指令,所述执行指令使处理器执行以下步骤:获取待矫正图像,根据预设的角度类型对所述图像进行分类,并按照分类后的角度类型对所述图像进行转正处理;根据所述转正后的图像,检测关键对象信息;利用所述关键对象信息,进行图像矫正处理。
基于上述如图1所示方法和如图2所示装置的实施例,本申请实施例还提供了一种计算机设备,如图4所示,处理器(processor)31、通信接口(Communications Interface)32、存储器(memory)33、以及通信总线34。其中:处理器31、通信接口32、以及存储器33通过通信总线34完成相互间的通信。通信接口34,用于与其它设备比如用户端或其它服务器等的网元通信。处理器31,用于执行程序,具体可以执行上述图像矫正处理方法实施例中的相关步骤。具体地,程序可以包括程序代码,该程序代码包括计算机操作指令。处理器31可能是中央处理器CPU,或者是特定集成电路ASIC(Application Specific Integrated Circuit),或者是被配置成实施本申请实施例的一个或多个集成电路。
计算机设备如终端包括的一个或多个处理器,可以是同一类型的处理器,如一个或多个CPU;也可以是不同类型的处理器,如一个或多个CPU以及一个或多个ASIC。存储器33,用于存放程序。存储器33可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。程序具体可以用于使得处理器31执行以下操作:获取待矫正图像,根据预设的角度类型对所述图像进行分类,并按照分类后的角度类型对所述图像进行转正处理;根据所述转正后的图像,检测关键对象信息;利用所述关键对象信息,进行图像矫正处理。
本申请提供一种图像矫正处理装置、存储介质及计算机设备,与现有技术使用Hough变换检测直线的方法,对图像进行倾斜矫正相比,本申请通过获取待矫正图像,根据预设的角度类型对所述图像进行分类,并按照分类后的角度类型对所述图像进行转正处理;根据所述转正后的图像,检测关键对象信息;利用所述关键对象信息,进行图像矫正处理。 从而避免了直线检测算法带来的误差,减少后续的处理工作,进而提高图像矫正处理的效率,降低图像矫正处理的误检率和漏检率。
可选的,本申请涉及的存储介质可以是计算机可读存储介质,该存储介质如计算机可读存储介质可以是非易失性的,也可以是易失性的。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
可以理解的是,上述方法及装置中的相关特征可以相互参考。另外,上述实施例中的“第一”、“第二”等是用于区分各实施例,而并不代表各实施例的优劣。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的***,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在此提供的算法和显示不与任何特定计算机、虚拟***或者其它设备固有相关。各种通用***也可以与基于在此的示教一起使用。根据上面的描述,构造这类***所要求的结构是显而易见的。此外,本申请也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本申请的内容,并且上面对特定语言所做的描述是为了披露本申请的最佳实施方式。
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本申请的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本申请的示例性实施例的描述中,本申请的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本申请要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本申请的单独实施例。
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本申请的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。
本申请的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本申请实施例中的一些或者全部部件的一些或者全部功能。本申请还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本申请的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。
应该注意的是上述实施例对本申请进行说明而不是对本申请进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本申请可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
Claims (20)
- 一种图像矫正处理方法,其中,包括:获取待矫正图像,根据预设的角度类型对所述图像进行分类,并按照分类后的角度类型对所述图像进行转正处理;根据所述转正后的图像,检测关键对象信息;利用所述关键对象信息,进行图像矫正处理。
- 根据权利要求1的方法,其中,所述根据预设的角度类型对所述图像进行分类,包括:根据预设的角度类型,以DenseNet分类网络为图像角度分类器,搭建并训练DenseNet分类模型;所述按照分类后的角度类型对所述图像进行转正处理,包括:根据预设的函数对所述图像进行转正处理;对所述转正处理后的图像进行归一化和标准化处理;所述归一化处理根据以下函数计算:其中:x i,y分别表示归一化处理前后的像素坐标值,min(x),max(x)分别表示所述图像像素的最小值和最大值;所述标准化处理根据以下函数计算:其中:std表示标准差,μ表示图像的均值,x表示图像矩阵,σ表示标准方差,N表示图像像素数量。
- 根据权利要求2的方法,其中,所述根据预设的函数对所述图像进行转正处理,包括:根据OpenCV函数对所述图像进行转正处理。
- 根据权利要求4的方法,其中,所述根据预设的缩放标准,对所述图像进行缩放处 理,包括:利用卷积神经网络对所述图像进行缩放处理,得到缩放后的特征映射图。
- 根据权利要求1的方法,其中,所述利用所述关键对象信息,进行图像矫正处理,包括:根据所述关键对象信息以及预设的图像矫正处理函数,对所述图像进行透视变换处理,得到矫正后的图像;所述进行透视变换处理中旋转角度坐标的计算过程包括:O点为圆心,点P绕点O旋转redian弧度之后,点P的坐标变换为点Q的计算公式为:Q.x=P.x*cos(redian)-P.y*sin(redian);Q.y=P.x*sin(redian)+P.y*cos(redian);其中:P.x、Q.x和Q.y分别表示P点和Q点的像素坐标值,redian表示为弧度;弧度与角度的变换公式为:redian=pi*180/angle;其中:redian表示为弧度,pi表示π常量,angle表示所述弧度对应的角度值;若O点不是圆心,点P绕点O旋转redian弧度之后,点P的坐标变换为Q的计算公式为如下所示:Q.x=(P.x-O.x)*cos(redian)-(P.y-O.y)*sin(redian)+O.x;Q.y=(P.x-O.x)*sin(redian)+(P.y-O.y)*cos(redian)+O.y;其中:P.x、P.x、Q.x、Q.y、O.x和O.y分别表示P点、Q点和O点的像素坐标值,redian表示为弧度。
- 根据权利要求4的方法,其中,所述对所述图像进行缩放处理之后,所述方法还包括:获取所述图像的样本数据信息,所述样本数据信息包括所述图像的检测对象信息;根据所述样本数据信息、真实标签图以及关键对象的平均损失,对所述关键对象检测模型进行训练;根据所述缩放后的图像,以及预先训练的关键对象检测模型进行计算,以获得关键对象信息,所述预先训练的关键对象检测模型的训练样本数据是通过提取所述图像的检测对象信息得到的。
- 一种图像矫正处理装置,其中,包括:分类单元,用于获取待矫正图像,根据预设的角度类型对所述图像进行分类,并按照分类后的角度类型对所述图像进行转正处理;检测单元,用于根据所述转正后的图像,检测关键对象信息;矫正单元,用于利用所述关键对象信息,进行图像矫正处理。
- 一种存储介质,其上存储有计算机程序,所述存储介质中存储有至少一可执行指令,其中,所述执行指令使处理器执行以下步骤:获取待矫正图像,根据预设的角度类型对所述图像进行分类,并按照分类后的角度类型对所述图像进行转正处理;根据所述转正后的图像,检测关键对象信息;利用所述关键对象信息,进行图像矫正处理。
- 根据权利要求9所述的存储介质,其中,所述根据预设的角度类型对所述图像进行分类时,具体执行以下步骤:根据预设的角度类型,以DenseNet分类网络为图像角度分类器,搭建并训练DenseNet分类模型;所述按照分类后的角度类型对所述图像进行转正处理时,具体执行以下步骤:根据预设的函数对所述图像进行转正处理;对所述转正处理后的图像进行归一化和标准化处理;所述归一化处理根据以下函数计算:其中:x i,y分别表示归一化处理前后的像素坐标值,min(x),max(x)分别表示所述图像像素的最小值和最大值;所述标准化处理根据以下函数计算:其中:std表示标准差,μ表示图像的均值,x表示图像矩阵,σ表示标准方差,N表示图像像素数量。
- 根据权利要求11所述的存储介质,其中,所述根据预设的缩放标准,对所述图像进行缩放处理时,具体执行以下步骤:利用卷积神经网络对所述图像进行缩放处理,得到缩放后的特征映射图。
- 根据权利要求9所述的存储介质,其中,所述利用所述关键对象信息,进行图像矫正处理时,具体执行以下步骤:根据所述关键对象信息以及预设的图像矫正处理函数,对所述图像进行透视变换处理,得到矫正后的图像;所述进行透视变换处理中旋转角度坐标的计算过程包括:O点为圆心,点P绕点O旋转redian弧度之后,点P的坐标变换为点Q的计算公式为:Q.x=P.x*cos(redian)-P.y*sin(redian);Q.y=P.x*sin(redian)+P.y*cos(redian);其中:P.x、Q.x和Q.y分别表示P点和Q点的像素坐标值,redian表示为弧度;弧度与角度的变换公式为:redian=pi*180/angle;其中:redian表示为弧度,pi表示π常量,angle表示所述弧度对应的角度值;若O点不是圆心,点P绕点O旋转redian弧度之后,点P的坐标变换为Q的计算公式为如下所示:Q.x=(P.x-O.x)*cos(redian)-(P.y-O.y)*sin(redian)+O.x;Q.y=(P.x-O.x)*sin(redian)+(P.y-O.y)*cos(redian)+O.y;其中:P.x、P.x、Q.x、Q.y、O.x和O.y分别表示P点、Q点和O点的像素坐标值,redian表示为弧度。
- 根据权利要求11所述的存储介质,其中,所述执行指令还使处理器执行以下步骤:获取所述图像的样本数据信息,所述样本数据信息包括所述图像的检测对象信息;根据所述样本数据信息、真实标签图以及关键对象的平均损失,对所述关键对象检测模型进行训练;根据所述缩放后的图像,以及预先训练的关键对象检测模型进行计算,以获得关键对象信息,所述预先训练的关键对象检测模型的训练样本数据是通过提取所述图像的检测对象信息得到的。
- 一种计算机设备,包括处理器、存储器、通信接口和通信总线,其中,所述处理器、所述存储器和所述通信接口通过所述通信总线完成相互间的通信,所述存储器用于存放至少一可执行指令,所述可执行指令使所述处理器执行以下步骤:获取待矫正图像,根据预设的角度类型对所述图像进行分类,并按照分类后的角度类型对所述图像进行转正处理;根据所述转正后的图像,检测关键对象信息;利用所述关键对象信息,进行图像矫正处理。
- 根据权利要求15所述的计算机设备,其中,所述根据预设的角度类型对所述图像进行分类时,具体执行以下步骤:根据预设的角度类型,以DenseNet分类网络为图像角度分类器,搭建并训练DenseNet分类模型;所述按照分类后的角度类型对所述图像进行转正处理时,具体执行以下步骤:根据预设的函数对所述图像进行转正处理;对所述转正处理后的图像进行归一化和标准化处理;所述归一化处理根据以下函数计算:其中:x i,y分别表示归一化处理前后的像素坐标值,min(x),max(x)分别表示所述图像像素的最小值和最大值;所述标准化处理根据以下函数计算:其中:std表示标准差,μ表示图像的均值,x表示图像矩阵,σ表示标准方差,N表示图像像素数量。
- 根据权利要求17所述的计算机设备,其中,所述根据预设的缩放标准,对所述图像进行缩放处理时,具体执行以下步骤:利用卷积神经网络对所述图像进行缩放处理,得到缩放后的特征映射图。
- 根据权利要求9所述的计算机设备,其中,所述利用所述关键对象信息,进行图像矫正处理时,具体执行以下步骤:根据所述关键对象信息以及预设的图像矫正处理函数,对所述图像进行透视变换处理,得到矫正后的图像;所述进行透视变换处理中旋转角度坐标的计算过程包括:O点为圆心,点P绕点O旋转redian弧度之后,点P的坐标变换为点Q的计算公式为:Q.x=P.x*cos(redian)-P.y*sin(redian);Q.y=P.x*sin(redian)+P.y*cos(redian);其中:P.x、Q.x和Q.y分别表示P点和Q点的像素坐标值,redian表示为弧度;弧度与角度的变换公式为:redian=pi*180/angle;其中:redian表示为弧度,pi表示π常量,angle表示所述弧度对应的角度值;若O点不是圆心,点P绕点O旋转redian弧度之后,点P的坐标变换为Q的计算公式为如下所示:Q.x=(P.x-O.x)*cos(redian)-(P.y-O.y)*sin(redian)+O.x;Q.y=(P.x-O.x)*sin(redian)+(P.y-O.y)*cos(redian)+O.y;其中:P.x、P.x、Q.x、Q.y、O.x和O.y分别表示P点、Q点和O点的像素坐标值,redian表示为弧度。
- 根据权利要求17所述的计算机设备,其中,所述可执行指令还使所述处理器执行以下步骤:获取所述图像的样本数据信息,所述样本数据信息包括所述图像的检测对象信息;根据所述样本数据信息、真实标签图以及关键对象的平均损失,对所述关键对象检测模型进行训练;根据所述缩放后的图像,以及预先训练的关键对象检测模型进行计算,以获得关键对象信息,所述预先训练的关键对象检测模型的训练样本数据是通过提取所述图像的检测对象信息得到的。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010164108.XA CN111507908B (zh) | 2020-03-11 | 2020-03-11 | 图像矫正处理方法、装置、存储介质及计算机设备 |
CN202010164108.X | 2020-03-11 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021179485A1 true WO2021179485A1 (zh) | 2021-09-16 |
Family
ID=71871555
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/099032 WO2021179485A1 (zh) | 2020-03-11 | 2020-06-29 | 图像矫正处理方法、装置、存储介质及计算机设备 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111507908B (zh) |
WO (1) | WO2021179485A1 (zh) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114037992A (zh) * | 2021-10-28 | 2022-02-11 | 软通动力信息技术(集团)股份有限公司 | 仪表示数识别方法、装置、电子设备及存储介质 |
CN114648611A (zh) * | 2022-04-12 | 2022-06-21 | 清华大学 | 局域轨道函数的三维重构方法及装置 |
CN115115552A (zh) * | 2022-08-25 | 2022-09-27 | 腾讯科技(深圳)有限公司 | 图像矫正模型训练及图像矫正方法、装置和计算机设备 |
CN115578729A (zh) * | 2022-11-21 | 2023-01-06 | 国网浙江省电力有限公司信息通信分公司 | 数字员工ai智能流程编排方法 |
CN115619678A (zh) * | 2022-10-31 | 2023-01-17 | 锋睿领创(珠海)科技有限公司 | 一种图像变形的矫正方法、装置、计算机设备及存储介质 |
CN115984856A (zh) * | 2022-12-05 | 2023-04-18 | 百度(中国)有限公司 | 文档图像矫正模型的训练方法、文档图像的矫正方法 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140233800A1 (en) * | 2013-02-15 | 2014-08-21 | Samsung Electronics Co., Ltd. | Method of tracking object and electronic device supporting the same |
CN108764257A (zh) * | 2018-05-23 | 2018-11-06 | 郑州金惠计算机***工程有限公司 | 一种多视角的指针式仪表识别方法 |
CN109583445A (zh) * | 2018-11-26 | 2019-04-05 | 平安科技(深圳)有限公司 | 文字图像校正处理方法、装置、设备及存储介质 |
CN110188747A (zh) * | 2019-04-28 | 2019-08-30 | 广州华多网络科技有限公司 | 一种文本图像的倾斜校正方法、装置以及图像处理设备 |
CN110276755A (zh) * | 2019-06-25 | 2019-09-24 | 广东工业大学 | 一种肿瘤位置定位***及相关装置 |
CN110363116A (zh) * | 2019-06-28 | 2019-10-22 | 上海交通大学 | 基于gld-gan的不规则人脸矫正方法、***及介质 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10726560B2 (en) * | 2014-10-31 | 2020-07-28 | Fyusion, Inc. | Real-time mobile device capture and generation of art-styled AR/VR content |
CN107330439B (zh) * | 2017-07-14 | 2022-11-04 | 腾讯科技(深圳)有限公司 | 一种图像中物体姿态的确定方法、客户端及服务器 |
CN110460769B (zh) * | 2019-07-05 | 2021-08-17 | 浙江大华技术股份有限公司 | 图像矫正方法、装置、计算机设备和存储介质 |
CN110866871A (zh) * | 2019-11-15 | 2020-03-06 | 深圳市华云中盛科技股份有限公司 | 文本图像矫正方法、装置、计算机设备及存储介质 |
CN110866525A (zh) * | 2019-11-26 | 2020-03-06 | 深圳市信联征信有限公司 | 图像角度矫正方法、装置、计算机设备及存储介质 |
-
2020
- 2020-03-11 CN CN202010164108.XA patent/CN111507908B/zh active Active
- 2020-06-29 WO PCT/CN2020/099032 patent/WO2021179485A1/zh active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140233800A1 (en) * | 2013-02-15 | 2014-08-21 | Samsung Electronics Co., Ltd. | Method of tracking object and electronic device supporting the same |
CN108764257A (zh) * | 2018-05-23 | 2018-11-06 | 郑州金惠计算机***工程有限公司 | 一种多视角的指针式仪表识别方法 |
CN109583445A (zh) * | 2018-11-26 | 2019-04-05 | 平安科技(深圳)有限公司 | 文字图像校正处理方法、装置、设备及存储介质 |
CN110188747A (zh) * | 2019-04-28 | 2019-08-30 | 广州华多网络科技有限公司 | 一种文本图像的倾斜校正方法、装置以及图像处理设备 |
CN110276755A (zh) * | 2019-06-25 | 2019-09-24 | 广东工业大学 | 一种肿瘤位置定位***及相关装置 |
CN110363116A (zh) * | 2019-06-28 | 2019-10-22 | 上海交通大学 | 基于gld-gan的不规则人脸矫正方法、***及介质 |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114037992A (zh) * | 2021-10-28 | 2022-02-11 | 软通动力信息技术(集团)股份有限公司 | 仪表示数识别方法、装置、电子设备及存储介质 |
CN114648611A (zh) * | 2022-04-12 | 2022-06-21 | 清华大学 | 局域轨道函数的三维重构方法及装置 |
CN115115552A (zh) * | 2022-08-25 | 2022-09-27 | 腾讯科技(深圳)有限公司 | 图像矫正模型训练及图像矫正方法、装置和计算机设备 |
CN115115552B (zh) * | 2022-08-25 | 2022-11-18 | 腾讯科技(深圳)有限公司 | 图像矫正模型训练及图像矫正方法、装置和计算机设备 |
CN115619678A (zh) * | 2022-10-31 | 2023-01-17 | 锋睿领创(珠海)科技有限公司 | 一种图像变形的矫正方法、装置、计算机设备及存储介质 |
CN115619678B (zh) * | 2022-10-31 | 2024-04-19 | 锋睿领创(珠海)科技有限公司 | 一种图像变形的矫正方法、装置、计算机设备及存储介质 |
CN115578729A (zh) * | 2022-11-21 | 2023-01-06 | 国网浙江省电力有限公司信息通信分公司 | 数字员工ai智能流程编排方法 |
CN115578729B (zh) * | 2022-11-21 | 2023-03-21 | 国网浙江省电力有限公司信息通信分公司 | 数字员工ai智能流程编排方法 |
CN115984856A (zh) * | 2022-12-05 | 2023-04-18 | 百度(中国)有限公司 | 文档图像矫正模型的训练方法、文档图像的矫正方法 |
Also Published As
Publication number | Publication date |
---|---|
CN111507908A (zh) | 2020-08-07 |
CN111507908B (zh) | 2023-10-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021179485A1 (zh) | 图像矫正处理方法、装置、存储介质及计算机设备 | |
WO2018219054A1 (zh) | 一种车牌识别方法、装置及*** | |
CN108898086B (zh) | 视频图像处理方法及装置、计算机可读介质和电子设备 | |
KR102113911B1 (ko) | 생체 인식 인증을 위한 특징 추출 및 정합과 템플릿 갱신 | |
CN111144322A (zh) | 一种分拣方法、装置、设备和存储介质 | |
CN109886124B (zh) | 一种基于线束描述子图像匹配的无纹理金属零件抓取方法 | |
CN109919971B (zh) | 图像处理方法、装置、电子设备及计算机可读存储介质 | |
CN111862201A (zh) | 一种基于深度学习的空间非合作目标相对位姿估计方法 | |
WO2019171628A1 (en) | Image processing system and image processing method | |
CN110852311A (zh) | 一种三维人手关键点定位方法及装置 | |
CN112651380A (zh) | 人脸识别方法、人脸识别装置、终端设备及存储介质 | |
KR101034117B1 (ko) | 영상에서 관심 영역 지정 및 윤곽선 영상을 이용한 객체 인식 방법 및 장치 | |
CN112784712B (zh) | 一种基于实时监控的失踪儿童预警实现方法、装置 | |
CN112528866A (zh) | 跨模态人脸识别方法、装置、设备及存储介质 | |
CN109345460B (zh) | 用于矫正图像的方法和装置 | |
CN108229583B (zh) | 一种基于主方向差分特征的快速模板匹配的方法及装置 | |
CN112507897A (zh) | 跨模态人脸识别方法、装置、设备及存储介质 | |
CN114037992A (zh) | 仪表示数识别方法、装置、电子设备及存储介质 | |
CN113592923A (zh) | 一种基于深度局部特征匹配的批图像配准方法 | |
CN113743426A (zh) | 一种训练方法、装置、设备以及计算机可读存储介质 | |
CN110516731B (zh) | 一种基于深度学习的视觉里程计特征点检测方法及*** | |
WO2022063321A1 (zh) | 图像处理方法、装置、设备及存储介质 | |
CN108960246B (zh) | 一种用于图像识别的二值化处理装置及方法 | |
Cai et al. | Feature detection and matching with linear adjustment and adaptive thresholding | |
CN117557565A (zh) | 一种锂电池极片的检测方法及其装置 |
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: 20924728 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20924728 Country of ref document: EP Kind code of ref document: A1 |