WO2022056872A1 - 一种铭牌图像的矫正方法、装置和计算机可读存储介质 - Google Patents

一种铭牌图像的矫正方法、装置和计算机可读存储介质 Download PDF

Info

Publication number
WO2022056872A1
WO2022056872A1 PCT/CN2020/116310 CN2020116310W WO2022056872A1 WO 2022056872 A1 WO2022056872 A1 WO 2022056872A1 CN 2020116310 W CN2020116310 W CN 2020116310W WO 2022056872 A1 WO2022056872 A1 WO 2022056872A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
nameplate
coordinates
channel
pixel
Prior art date
Application number
PCT/CN2020/116310
Other languages
English (en)
French (fr)
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 西门子股份公司
Priority to PCT/CN2020/116310 priority Critical patent/WO2022056872A1/zh
Priority to CN202080105177.1A priority patent/CN116194963A/zh
Publication of WO2022056872A1 publication Critical patent/WO2022056872A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/80Geometric correction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/146Aligning or centring of the image pick-up or image-field
    • G06V30/1475Inclination or skew detection or correction of characters or of image to be recognised
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/18Extraction of features or characteristics of the image
    • G06V30/1801Detecting partial patterns, e.g. edges or contours, or configurations, e.g. loops, corners, strokes or intersections
    • G06V30/18067Detecting partial patterns, e.g. edges or contours, or configurations, e.g. loops, corners, strokes or intersections by mapping characteristic values of the pattern into a parameter space, e.g. Hough transformation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • G06V30/41Analysis of document content
    • G06V30/413Classification of content, e.g. text, photographs or tables

Definitions

  • the present invention relates to the technical field of image processing, and in particular, to a method, device and computer-readable storage medium for correcting an image of a nameplate.
  • the nameplate also known as the sign, is mainly used to record the technical data of the equipment manufacturer and the rated working conditions for correct use without damaging the equipment.
  • the materials for making nameplates usually include metals and non-metals, among which metals include zinc alloy, copper, iron, aluminum or stainless steel, etc.; non-metals include plastic, acrylic organic board, PVC, PC or paper, etc.
  • a nameplate recording various attribute information of the electronic device is usually attached to the electronic device.
  • a transformer nameplate attached to a transformer usually records many electrical properties of the transformer.
  • the nameplate can be photographed to obtain an image of the nameplate, and then the content (eg, text) in the nameplate image can be automatically extracted using Optical Character Recognition (OCR) technology.
  • OCR Optical Character Recognition
  • the nameplate in the nameplate image has a corresponding inclination angle. At this time, it is difficult for the OCR technology to accurately extract the content of the nameplate.
  • the Hough transform is usually used to determine the rotation angle of the nameplate in the nameplate image, and then the nameplate is transformed to an appropriate position based on the rotation angle, so as to correct the nameplate image.
  • the Hough transform can only determine the direction of the straight line in the correction process, and the length information of the line segment is lost, so the image is easily distorted and the correction effect is not good.
  • Embodiments of the present invention provide a method, device, and computer-readable storage medium for correcting a nameplate image.
  • a method for correcting a nameplate image comprising:
  • a rectified image of the nameplate image is generated based on the perspective transformation transformation matrix.
  • the perspective transformation transformation matrix is determined based on the edge of the nameplate determined by edge detection, and the rectification image of the nameplate image is generated by using the perspective transformation transformation matrix, and the nameplate figure in the rectification image after the perspective transformation is unchanged.
  • the distortion defect of Hough transform can be improved, and the correction accuracy can be improved.
  • the method further comprises:
  • a noise reduction process is performed on the contrast-increased grayscale image.
  • the quality of the grayscale image can be improved, thereby improving the correction accuracy.
  • the generating the rectified image of the nameplate image based on the perspective transformation transformation matrix comprises:
  • Each pixel point is copied to the respective transformed coordinates to generate the rectified image.
  • the generating the rectified image of the nameplate image based on the perspective transformation transformation matrix comprises:
  • the rectified R channel, the rectified G channel, and the rectified B channel are combined into the rectified image.
  • the quadrilateral has the shortest perimeter among the set of quadrilaterals surrounding the edge.
  • the quadrilateral determined by the embodiment of the present invention has the smallest perimeter, so that the workload of coordinate transformation can be reduced.
  • a device for correcting a nameplate image comprising:
  • Grayscale conversion module for converting the nameplate image containing the nameplate into a grayscale image
  • an edge detection module for performing edge detection on the grayscale image to determine the edge of the nameplate
  • a matrix determination module for determining a perspective transformation transformation matrix based on the vertex coordinates of the quadrilateral surrounding the edge and the vertex coordinates of the rectified image of the nameplate image
  • a rectification module configured to generate a rectified image of the nameplate image based on the perspective transformation transformation matrix.
  • the perspective transformation transformation matrix is determined based on the edge of the nameplate determined by edge detection, and the rectification image of the nameplate image is generated by using the perspective transformation transformation matrix, and the nameplate figure in the rectification image after the perspective transformation is unchanged.
  • the distortion defect of Hough transform can be improved, and the correction accuracy can be improved.
  • the grayscale conversion module between the grayscale conversion module and the edge detection module, it further includes:
  • a preprocessing module configured to increase the contrast of the grayscale image; and perform noise reduction processing on the grayscale image after the contrast has been increased.
  • the quality of the grayscale image can be improved, thereby improving the correction accuracy.
  • a correction module is configured to determine the coordinates of each pixel in the quadrilateral; determine the coordinates of each pixel based on the product of the coordinates of each pixel and the perspective transformation matrix The transformed coordinates of ; each pixel is copied to its respective transformed coordinates to generate the rectified image.
  • a correction module is used to determine the coordinates of each pixel in the nameplate image; based on the product of the coordinates of each pixel and the perspective transformation matrix, determine the coordinate of each pixel.
  • the converted coordinates of the coordinates; the nameplate image is separated into R channel, G channel and B channel; it is determined that each pixel in the R channel is copied to the corrected R channel and G channel generated at the respective converted coordinates.
  • Each pixel point is copied to the corrected G channel generated at the respective transformed coordinates and each pixel point in the B channel is copied to the corrected B channel generated at the respective transformed coordinates; the corrected R channel, the corrected G channel Channels and the rectified B channel are combined into the rectified image.
  • the quadrilateral has the shortest perimeter among the set of quadrilaterals surrounding the edge.
  • the quadrilateral determined by the embodiment of the present invention has the smallest perimeter, so that the workload of coordinate transformation can be reduced.
  • a device for correcting a nameplate image comprising: a processor and a memory;
  • An application program executable by the processor is stored in the memory, so as to cause the processor to execute the method for correcting a nameplate image as described in any one of the above.
  • the embodiment of the present invention also proposes a correction device with a processor-processor architecture, the nameplate graphics in the corrected image after perspective transformation remain unchanged, the distortion defect of Hough transform is overcome, and the correction accuracy can be improved.
  • a computer-readable storage medium storing computer-readable instructions for performing the method of correcting a nameplate image as described in any one of the above.
  • the embodiment of the present invention also proposes a computer-readable storage medium containing computer-readable instructions, the nameplate graphics in the corrected image after perspective transformation remain unchanged, the distortion defect of Hough transform is overcome, and the correction accuracy can be improved.
  • FIG. 1 is a flowchart of a method for correcting a nameplate image according to an embodiment of the present invention.
  • FIG. 2 is a schematic diagram of a process of correcting a nameplate image according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of an image of a transformer nameplate before correction according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of an image of a nameplate of a transformer after correction according to an embodiment of the present invention.
  • FIG. 5 is a configuration diagram of a device for correcting a nameplate image according to an embodiment of the present invention.
  • FIG. 6 is a structural diagram of an apparatus for correcting a nameplate image with a memory-processor architecture according to an embodiment of the present invention.
  • the embodiment of the present invention proposes a correction technical solution for the nameplate image based on perspective transformation, which can improve the correction accuracy.
  • FIG. 1 is a flowchart of a method for correcting a nameplate image according to an embodiment of the present invention.
  • the method includes:
  • Step 101 Convert the nameplate image including the nameplate to a grayscale image (Gray Scale Image).
  • the nameplate image is a photographed image for the nameplate.
  • the nameplate records the equipment manufacturer and technical data under rated working conditions.
  • the nameplate can record: connection mode; phase information; rated voltage; rated power; frequency; dry-type or wet-type transformer; insulating medium; cooling method; normal operating temperature range; and other technical data.
  • the image of the nameplate may be an image captured at the equipment site, or an image of the nameplate obtained from a database (such as a local database or a cloud database located in the cloud) or a third-party storage medium.
  • Nameplate images are usually RGB color images. In an RGB color image, a color is a proportional mixture of the three primary colors red (R), green (G), and blue (B).
  • the nameplate image can be converted into a grayscale image by means of floating point method, integer method, shift method, average value method, green only method or Gamma correction algorithm.
  • Grayscale images represent each image point with a different saturation of black.
  • RGB red, green, blue
  • Gray R*0.3+G*0.59+B*0.11;
  • Step 102 Perform contour detection on the grayscale image to determine the edge of the nameplate.
  • edge detection is to identify points in an image with significant changes in brightness. Significant changes in image properties often reflect significant events and changes in properties.
  • edge detection By performing edge detection on the grayscale image, the edges of the nameplate contained in the grayscale image can be determined. Specifically, an edge refers to a set of pixels around which the grayscale of the pixels changes sharply. Edges exist between objects, backgrounds and regions, so edges are the basis for image segmentation. Since the edge is the sign of the position and is not sensitive to the change of gray level, the edge is also an important feature of image matching. After performing edge detection on a grayscale image, it is possible to return multiple sub-edges (for example, the edge of an area in a nameplate), and combine these sub-edges into an overall edge, which is the edge of the nameplate.
  • edge detection there are many methods for edge detection, which can be roughly divided into two categories: search-based and zero-crossing-based.
  • search-based edge detection method the edge strength is first calculated, which is usually represented by a first-order derivative, such as the gradient modulus; then, the local direction of the edge is estimated by calculation, usually the direction of the gradient is used, and this direction is used to find the local gradient modulus. maximum value.
  • zero-crossing-based method the zero-crossing point of the second derivative obtained from the image is found to locate the edge.
  • edge detection templates include Laplacian operator, Roberts operator, Sobel operator, log(Laplacian-Gauss) operator, Kirsch operator and Prewitt operator, and so on.
  • Step 103 Determine a perspective transformation transformation matrix based on the vertex coordinates of the quadrilateral surrounding the edge and the vertex coordinates of the corrected image of the nameplate image.
  • the quadrilaterals surrounding the edges are first built.
  • the quadrilateral has the shortest perimeter among all the quadrilateral sets surrounding the edge.
  • the perspective transformation transformation matrix is determined based on the vertex coordinates of the quadrilateral surrounding the edge and the vertex coordinates of the corrected image of the nameplate image.
  • Perspective transformation refers to the use of the condition that the perspective center, image point, and target point are collinear, and according to the law of perspective rotation, the shadow-bearing surface (perspective surface) is rotated around the trace (perspective axis) by a certain angle, destroying the original projection light. Harness, a transformation that still preserves the projected geometry on the shadow-bearing surface.
  • [x,y] is the two-dimensional coordinates of the pixel in the corrected image; [u,v,w] is the three-dimensional coordinate of the pixel before transformation, w is usually equal to 1; the three-dimensional coordinates of the pixel in the corrected image can be defined is [x,y,1].
  • the rectified image of the nameplate image is usually a rectangle.
  • the coordinates of the four vertices of the corrected image are known, such as (0,0,1), (0,h,1), (w,h,1) and (w,0,1), where w is the width of the corrected image, and h is the height of the corrected image.
  • 8 equations can be constructed according to formula (3), thereby calculating a 11 , Values of a 12 , a 13 , a 21 , a 22 , a 23 , a 31 , and a 32 .
  • the perspective transformation matrix can be uniquely determined where a 33 is 1.
  • Step 104 Generate a corrected image of the nameplate image based on the perspective transformation transformation matrix.
  • a rectified image of the nameplate image is generated based on the perspective transformation transformation matrix determined in step 103, so as to realize the rectification of the nameplate image.
  • generating the rectified image of the nameplate image based on the perspective transformation transformation matrix in step 104 includes: determining the coordinates (three-dimensional coordinates, where the w value is set to 1) of each pixel point in the quadrilateral; The product of the coordinates of each pixel point and the perspective transformation transformation matrix determines the transformed coordinates of the coordinates of each pixel point; and each pixel point is copied to the respective transformed coordinates to generate the rectified image.
  • the embodiment of the present invention by transforming the coordinates of each pixel in the quadrilateral surrounding the edge of the nameplate, a rectified image with grayscale corresponding to the quadrilateral can be generated. Therefore, the embodiment of the present invention also realizes a rectified image in the form of a grayscale image.
  • generating the corrected image of the nameplate image based on the perspective transformation transformation matrix in step 104 includes: determining the coordinates of each pixel in the nameplate image; based on the coordinates of each pixel and the perspective transformation The product of the transformation matrix determines the transformed coordinates of the coordinates of each pixel point; the nameplate image is separated into R channel, G channel and B channel; it is determined that each pixel point in the R channel is copied to the respective converted The corrected R channel and each pixel in the G channel generated at the coordinates are copied to the respective transformed coordinates. The corrected G channel and each pixel in the B channel are copied to the respective transformed coordinates. The generated corrected B channel; combining the rectified R channel, the rectified G channel and the rectified B channel into the rectified image.
  • the transformed coordinates of the coordinates of each pixel are determined.
  • the nameplate image is separated into R channel, G channel and B channel, and each pixel point in the R channel is copied to the respective transformed coordinates to generate a rectified R channel, and each pixel point in the G channel is copied to
  • the respective transformed coordinates are used to generate the corrected G channel, and each pixel in the B channel is copied to the respective transformed coordinates to generate the corrected B channel.
  • the rectified R channel, rectified G channel, and rectified B channel are combined into a rectified image. Among them, the pixels at the same position of the R channel, the G channel and the B channel respectively have the same converted coordinates.
  • the converted coordinates of the coordinates of each pixel point in the nameplate image A are determined.
  • the coordinates of the point 100 correspond to the transformed coordinates K100.
  • the nameplate image A is separated into three channels, which are the R channel of the nameplate image A, the G channel of the nameplate image A, and the B channel of the nameplate image A.
  • each pixel point in the R channel of the nameplate image A is copied to the respective transformed coordinates in the rectified R channel to generate the rectified R channel.
  • the pixel point 1 in the R channel of the nameplate image A is copied to the transformed coordinate K1 in the corrected R channel
  • the pixel point 2 in the R channel of the nameplate image A is copied to the transformation in the corrected R channel
  • the rear coordinate K2 copy the pixel point 3 in the R channel of the nameplate image A to the converted coordinate K3 in the corrected R channel
  • the converted coordinate K100 in thus forming the corrected R channel.
  • Each pixel point in the G channel of the nameplate image A is copied to the respective transformed coordinates in the rectified G channel to generate the rectified G channel.
  • the pixel point 1 in the G channel of the nameplate image A is copied to the transformed coordinate K1 in the corrected G channel
  • the pixel point 2 in the G channel of the nameplate image A is copied to the transformation in the corrected G channel
  • the rear coordinate K2 copy the pixel point 3 in the G channel of the nameplate image A to the converted coordinate K3 in the corrected G channel
  • the converted coordinate K100 in thus forming the corrected G channel.
  • Each pixel in the B channel of the nameplate image A is copied to the respective transformed coordinates in the rectified G channel to generate the rectified B channel.
  • the pixel point 1 in the B channel of the nameplate image A is copied to the converted coordinate K1 in the corrected B channel
  • the pixel point 2 in the B channel of the nameplate image A is copied to the corrected B channel.
  • copy the pixel point 3 in the B channel of the nameplate image A to the converted coordinate K3 in the corrected B channel ... Copy the pixel point 100 in the B channel of the nameplate image A to the corrected B channel
  • the converted coordinate K100 in thus forming the corrected B channel.
  • the rectified R channel, the rectified G channel and the rectified B channel are combined into the rectified image.
  • the embodiment of the present invention by transforming the coordinates of each pixel in the R channel, G channel and B channel of the nameplate image, a rectified image with RGB colors corresponding to the nameplate image can be generated. Therefore, the embodiment of the present invention also realizes a rectified image in the form of RGB colors.
  • the method further comprises: increasing the grayscale Contrast of the image; performs noise reduction on the contrast-enhanced grayscale image.
  • the image enhancement method based on histogram equalization can be used to increase the contrast of grayscale images.
  • FIG. 2 is a schematic diagram of a process of correcting a nameplate image according to an embodiment of the present invention.
  • the quadrilateral with the shortest perimeter is determined, which is assumed to be a quadrilateral JKMN (usually a trapezoid) .
  • the coordinates of the four vertices J, K, M, and N are determined.
  • the rectified image is a rectangle of a predetermined size. The coordinates of the four vertices A, B, C and D of the rectified image are determined.
  • the perspective transformation transformation matrix can be calculated. Then, using the perspective transformation transformation matrix, each pixel point in the quadrilateral JKMN can be transformed to the corresponding coordinates of the rectified image ABCD, so as to realize the rectification.
  • FIG. 3 is a schematic diagram of an image of a transformer nameplate before correction according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of an image of a nameplate of a transformer after correction according to an embodiment of the present invention.
  • the transformer nameplate in Fig. 3 is arranged on the transformer housing, and the transformer nameplate image has an oblique angle and contains the background environment of the housing.
  • the tilt angle of the transformer nameplate image in Figure 4 is corrected and does not contain the background environment, thus facilitating subsequent OCR operations.
  • the embodiment of the present invention is described above by taking the correction of the image of the transformer nameplate as an example. Those skilled in the art can realize that this description is only exemplary, and is not used to limit the protection scope of the embodiments of the present invention. In fact, the embodiments of the present invention can be applied to the rectification process for any type of nameplate images, especially for the rectification of nameplate images of electronic equipment, especially transformers.
  • an embodiment of the present invention also proposes a device for correcting an image of a nameplate.
  • FIG. 5 is a block diagram of a device for correcting a nameplate image according to an embodiment of the present invention.
  • the correction device 500 of the nameplate image includes:
  • the grayscale conversion module 501 is used to convert the nameplate image including the nameplate into a grayscale image
  • an edge detection module 503, configured to perform edge detection on the grayscale image to determine the edge of the nameplate
  • a matrix determination module 504 for determining a perspective transformation transformation matrix based on the vertex coordinates of the quadrilateral surrounding the edge and the vertex coordinates of the corrected image of the nameplate image;
  • a rectification module 505 configured to generate a rectified image of the nameplate image based on the perspective transformation transformation matrix.
  • the grayscale conversion module 501 between the grayscale conversion module 501 and the edge detection module 503, it further includes:
  • a preprocessing module 502, configured to increase the contrast of the grayscale image; perform noise reduction processing on the grayscale image after the contrast has been increased.
  • the correction module 505 is configured to determine the coordinates of each pixel point in the quadrilateral; based on the product of the coordinates of each pixel point and the perspective transformation transformation matrix, determine the coordinates of each pixel point The transformed coordinates of the coordinates; each pixel is copied to its respective transformed coordinates to generate the rectified image.
  • the correction module 505 is configured to determine the coordinates of each pixel in the nameplate image; and determine each pixel based on the product of the coordinates of each pixel and the perspective transformation matrix The converted coordinates of the coordinates of Copy each pixel point to the corrected G channel and the B channel generated at the respective transformed coordinates. Copy each pixel point to the corrected B channel generated at the respective transformed coordinates; copy the corrected R channel, the corrected The G channel and the rectified B channel are combined into the rectified image.
  • an embodiment of the present invention also proposes a device for correcting a nameplate image with a memory-processor architecture.
  • FIG. 6 is a block diagram of an apparatus for correcting a nameplate image with a memory-processor architecture according to an embodiment of the present invention.
  • the correction device 600 includes a processor 601, a memory 602, and a computer program stored in the memory 602 and executable on the processor 601.
  • the computer program is executed by the processor 601, the image of the nameplate as described in any of the above is realized. correction method.
  • the memory 602 can be specifically implemented as various storage media such as Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory (Flash memory), Programmable Program Read-Only Memory (PROM).
  • the processor 601 may be implemented to include one or more central processing units or one or more field programmable gate arrays, wherein the field programmable gate arrays integrate one or more central processing unit cores.
  • the central processing unit or the central processing unit core may be implemented as a CPU or an MCU or a DSP or the like.
  • the hardware modules in various embodiments may be implemented mechanically or electronically.
  • a hardware module may include specially designed permanent circuits or logic devices (eg, special purpose processors, such as FPGAs or ASICs) for performing specific operations.
  • Hardware modules may also include programmable logic devices or circuits (eg, including general-purpose processors or other programmable processors) temporarily configured by software for performing particular operations.
  • programmable logic devices or circuits eg, including general-purpose processors or other programmable processors
  • the present invention also provides a machine-readable storage medium storing instructions for causing a machine to perform a method as described herein.
  • a system or device equipped with a storage medium on which software program codes for realizing the functions of any one of the above-described embodiments are stored, and make the computer (or CPU or MPU of the system or device) ) to read and execute the program code stored in the storage medium.
  • a part or all of the actual operation can also be completed by an operating system or the like operating on the computer based on the instructions of the program code.
  • the program code read out from the storage medium can also be written into the memory provided in the expansion board inserted into the computer or into the memory provided in the expansion unit connected to the computer, and then the instructions based on the program code cause the device to be installed in the computer.
  • the CPU on the expansion board or the expansion unit or the like performs part and all of the actual operations, so as to realize the functions of any one of the above-mentioned embodiments.
  • Embodiments of storage media for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (eg, CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), Magnetic tapes, non-volatile memory cards and ROMs.
  • the program code may be downloaded from a server computer or cloud over a communications network.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Artificial Intelligence (AREA)
  • Image Processing (AREA)
  • Length Measuring Devices By Optical Means (AREA)
  • Image Analysis (AREA)

Abstract

一种铭牌图像的矫正方法(100)、装置(500)和计算机可读存储介质。该方法包括:将包含铭牌的铭牌图像转换为灰度图像(101);对所述灰度图像执行边缘检测以确定所述铭牌的边缘(102);基于包围所述边缘的四边形的顶点坐标和所述铭牌图像的矫正图像的顶点坐标确定透视变换转换矩阵(103);基于所述透视变换转换矩阵生成所述铭牌图像的矫正图像(104)。上述方法可以对包含铭牌的铭牌图像进行矫正,提高矫正准确度。

Description

一种铭牌图像的矫正方法、装置和计算机可读存储介质 技术领域
本发明涉及图像处理技术领域,特别是涉及一种铭牌图像的矫正方法、装置和计算机可读存储介质。
背景技术
铭牌(nameplate)又称标牌,主要用来记载设备生产厂家及额定工作情况下的技术数据,以供正确使用而不致损坏设备。制作铭牌的材料通常包括金属类和非金属类,其中金属类有锌合金、铜、铁、铝或不锈钢等;非金属类有塑料、亚克力有机板、PVC、PC或纸等。
电子设备上通常附着有记录电子设备的各种属性信息的铭牌。比如,附加到变压器上的变压器铭牌通常记录有变压器的诸多电属性。目前,可以拍摄铭牌以获取铭牌图像,然后利用光学字符识别(Optical Character Recognition,OCR)技术自动提取铭牌图像中的内容(比如,文字)。然而,当拍摄铭牌的角度发生倾斜时,铭牌图像中的铭牌相应具有倾斜角度,此时OCR技术难以准确提取铭牌内容。
目前,通常采用霍夫变换(Hough transform)确定铭牌图像中铭牌的旋转角度,再基于旋转角度将铭牌变换到合适的位置,从而矫正铭牌图像。然而,采用霍夫变换在矫正过程中只能确定直线方向,丢失了线段的长度信息,因此容易图像失真,矫正效果不佳。
发明内容
本发明实施方式提出一种铭牌图像的矫正方法、装置和计算机可读存储介质。
本发明实施方式的技术方案如下:
一种铭牌图像的矫正方法,该方法包括:
将包含铭牌的铭牌图像转换为灰度图像;
对所述灰度图像执行边缘检测以确定所述铭牌的边缘;
基于包围所述边缘的四边形的顶点坐标和所述铭牌图像的矫正图像的顶点坐标确定透视变换转换矩阵;
基于所述透视变换转换矩阵生成所述铭牌图像的矫正图像。
可见,在本发明实施方式中,基于边缘检测所确定的铭牌边缘确定透视变换转换矩阵,并利用透视变换转换矩阵生成铭牌图像的矫正图像,透视变换后的矫正图像中的铭牌图形不变,克服了霍夫变换的失真缺陷,可以提高矫正准确度。
在一个实施方式中,在将包含铭牌的铭牌图像转换为灰度图像与对所述灰度图像执行边缘检测以确定所述铭牌的边缘之间,该方法还包括:
增加所述灰度图像的对比度;
对所述增加对比度后的灰度图像执行降噪处理。
因此,在本发明实施方式中,通过增加灰度图像的对比度和降噪处理,可以提高灰度图像的质量,从而提高矫正准确度。
在一个实施方式中,所述基于透视变换转换矩阵生成所述铭牌图像的矫正图像包括:
确定所述四边形中的每个像素点的坐标;
基于每个像素点的坐标与所述透视变换转换矩阵的乘积,确定所述每个像素点的坐标的转换后坐标;
将每个像素点复制到各自的转换后坐标处以生成所述矫正图像。
可见,在本发明实施方式中,通过对包围铭牌边缘的四边形中的每个像素点的坐标转换,可以生成对应于该四边形的、具有灰度的矫正图像。
在一个实施方式中,所述基于透视变换转换矩阵生成所述铭牌图像的矫正图像包括:
确定所述铭牌图像中的每个像素点的坐标;
基于每个像素点的坐标与所述透视变换转换矩阵的乘积,确定所述每个像素点的坐标的转换后坐标;
将所述铭牌图像分离为R通道、G通道和B通道;
确定R通道中的每个像素点复制到各自的转换后坐标处所生成的矫正R通道、G通道中的每个像素点复制到各自的转换后坐标处所生成的矫正G通道和B通道中的每个像素点复制到各自的转换后坐标处所生成的矫正B通道;
将所述矫正R通道、所述矫正G通道以及所述矫正B通道合并为所述矫正图像。
可见,在本发明实施方式中,通过对铭牌图像的R通道、G通道和B通道中的每个像素点的坐标转换,可以生成对应于铭牌图像的、具有RGB色彩的矫正图像。
在一个实施方式中,在包围所述边缘的四边形集合中,所述四边形的周长最短。
因此,本发明实施方式确定的四边形具有最小周长,从而可以降低坐标转换的工作量。
一种铭牌图像的矫正装置,该装置包括:
灰度转换模块,用于将包含铭牌的铭牌图像转换为灰度图像;
边缘检测模块,用于对所述灰度图像执行边缘检测以确定所述铭牌的边缘;
矩阵确定模块,用于基于包围所述边缘的四边形的顶点坐标和所述铭牌图像的矫正图像的顶点坐标确定透视变换转换矩阵;
矫正模块,用于基于所述透视变换转换矩阵生成所述铭牌图像的矫正图像。
可见,在本发明实施方式中,基于边缘检测所确定的铭牌边缘确定透视变换转换矩阵,并利用透视变换转换矩阵生成铭牌图像的矫正图像,透视变换后的矫正图像中的铭牌图形不变,克服了霍夫变换的失真缺陷,可以提高矫正准确度。
在一个实施方式中,在灰度转换模块与边缘检测模块之间,还包括:
预处理模块,用于增加所述灰度图像的对比度;对所述增加对比度后的灰度图像执行降噪处理。
因此,在本发明实施方式中,通过增加灰度图像的对比度和降噪处理,可以提高灰度图像的质量,从而提高矫正准确度。
在一个实施方式中,矫正模块,用于确定所述四边形中的每个像素点的坐标;基于每个像素点的坐标与所述透视变换转换矩阵的乘积,确定所述每个像素点的坐标的转换后坐标;将每个像素点复制到各自的转换后坐标以生成所述矫正图像。
可见,在本发明实施方式中,通过对包围铭牌边缘的四边形中的每个像素点的坐标转换,可以生成对应于该四边形的、具有灰度的矫正图像。
在一个实施方式中,矫正模块,用于确定所述铭牌图像中的每个像素点的坐标;基于每个像素点的坐标与所述透视变换转换矩阵的乘积,确定所述每个像素点的坐标的转换后坐标;将所述铭牌图像分离为R通道、G通道和B通道;确定R通道中的每个像素点复制到各自的转换后坐标处所生成的矫正R通道、G通道中的每个像素点复制到各自的转换后坐标处所生成的矫正G通道和B通道中的每个像素点复制到各自的转换后坐标处所生成的矫正B通道;将所述矫正R通道、所述矫正G通道以及所述矫正B通道合并为所述矫正图像。
可见,在本发明实施方式中,通过对铭牌图像的R通道、G通道和B通道中的每个像素点的坐标转换,可以生成对应于铭牌图像的、具有RGB色彩的矫正图像。
在一个实施方式中,在包围所述边缘的四边形集合中,所述四边形的周长最短。
因此,本发明实施方式确定的四边形具有最小周长,从而可以降低坐标转换的工作量。
一种铭牌图像的矫正装置,包括:处理器和存储器;
其中所述存储器中存储有可被所述处理器执行的应用程序,用于使得所述处理器执行如上任一项所述的铭牌图像的矫正方法。
可见,本发明实施方式还提出了具有处理器-处理器架构的矫正装置,透视变换后的矫正图像中的铭牌图形不变,克服了霍夫变换的失真缺陷,可以提高矫正准确度。
一种计算机可读存储介质,其中存储有计算机可读指令,该计算机可读指令用于执行如上任一项所述的铭牌图像的矫正方法。
可见,本发明实施方式还提出了包含计算机可读指令的计算机可读存储介质,透视变换后的矫正图像中的铭牌图形不变,克服了霍夫变换的失真缺陷,可以提高矫正准确度。
附图说明
图1为本发明实施方式的铭牌图像的矫正方法的流程图。
图2为本发明实施方式的铭牌图像的矫正过程示意图。
图3为本发明实施方式矫正前的变压器铭牌图像的示意图。
图4为本发明实施方式矫正后的变压器铭牌图像的示意图。
图5为本发明实施方式的铭牌图像的矫正装置的结构图。
图6为本发明实施方式具有存储器-处理器架构的、铭牌图像的矫正装置的结构图。
其中,附图标记如下:
标号 含义
100 铭牌图像的矫正方法
101~104 步骤
20 铭牌的边缘
500 铭牌图像的矫正装置
501 灰度转换模块
502 预处理模块
503 边缘检测模块
504 矩阵确定模块
505 矫正模块
600 铭牌图像的矫正装置
601 处理器
602 存储器
具体实施方式
为了使本发明的技术方案及优点更加清楚明白,以下结合附图及实施方式,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施方式仅仅用以阐述性说明本发明,并不用于限定本发明的保护范围。
为了描述上的简洁和直观,下文通过描述若干代表性的实施方式来对本发明的方案进行阐述。实施方式中大量的细节仅用于帮助理解本发明的方案。但是很明显,本发明的技术方案实现时可以不局限于这些细节。为了避免不必要地模糊了本发明的方案,一些实施方式没有进行细致地描述,而是仅给出了框架。下文中,“包括”是指“包括但不限于”,“根据……”是指“至少根据……,但不限于仅根据……”。由于汉语的语言习惯,下文中没有特别指出一个成分的数量时,意味着该成分可以是一个也可以是多个,或可理解为至少一个。
考虑到霍夫变换纠正铭牌图像的缺陷,本发明实施方式提出一种基于透视变换的铭牌图像的矫正技术方案,可以提高矫正准确度。
图1为本发明实施方式的铭牌图像的矫正方法的流程图。
如图1所示,该方法包括:
步骤101:将包含铭牌的铭牌图像转换为灰度图像(Gray Scale Image)。
在这里,铭牌图像为针对铭牌的拍摄图像。铭牌中记载设备生产厂家及额定工作情况下的技术数据。比如,当铭牌具体为变压器铭牌时,铭牌中可以记录:联接方式;相位信息;额定电压;额定功率;频率;干式还是湿式变压器;绝缘介质;冷却方式;正常工作温度范围;等技术数据。
具体地,铭牌图像可以为在设备现场所拍摄的图像,或者从数据库(比如本地数据库或位于云端的云数据库)或第三方存储介质所获取的铭牌图像。铭牌图像通常为RGB彩色图像。在RGB彩色图像中,一种彩色由红色(R)、绿色(G)和蓝色(B)三原色按比例混合而成。
在这里,可以采用浮点法、整数法、移位法、平均值法、仅取绿色法或Gamma校正算法等方式,将铭牌图像转换为灰度图像。灰度图像是用不同饱和度的黑色来表示每个图像点。
假如RGB彩色图像中某点的颜色为RGB(R,G,B),可以通过下面的示范性方法,将其转换为灰度(Gray)。
(1)、浮点法:Gray=R*0.3+G*0.59+B*0.11;
(2)、整数法:Gray=(R*30+G*59+B*11)/100;
(3)、移位法:Gray=(R*77+G*151+B*28)>>8;
(4)、平均值法:Gray=(R+G+B)/3;
(5)仅取绿色法:Gray=G;
(6)、Gamma校正算法:
Figure PCTCN2020116310-appb-000001
以上示范性描述了将包含铭牌的铭牌图像转换为灰度图像的典型方法,本领域技术人员可以意识到,这种描述仅是示范性的,并不用于限定本发明实施方式的保护范围。
步骤102:对所述灰度图像执行边缘检测(contour detection)以确定所述铭牌的边缘。
边缘检测的目的是标识图像中亮度变化明显的点。图像属性中的显著变化通常反映了属性的重要事件和变化。通过对灰度图像执行边缘检测,可以确定包含在灰度图像中的铭牌的边缘。具体地,边缘是指其周围像素灰度急剧变化的那些象素的集合。边缘存在于目标、背景和区域之间,所以,边缘是图像分割所依赖的依据。由于边缘是位置的标志,对灰度的变化不敏感,因此边缘也是图像匹配的重要的特征。对灰度图像执行边缘检测后,可以返回多个子边缘(比如,铭牌中某个区域的边缘),将这些子边缘组合为一个整体边缘,即为铭牌的边缘。
目前,存在有许多用于边缘检测的方法,大致可分为两类:基于搜索和基于零交叉。在基于搜索的边缘检测方法中,首先计算边缘强度,通常用一阶导数表示,例如梯度模;然后,用计算估计边缘的局部方向,通常采用梯度的方向,并利用此方向找到局部梯度模的最大值。在基于零交叉的方法中,找到由图像 得到的二阶导数的零交叉点来定位边缘。通常用拉普拉斯算子或非线性微分方程的零交叉点。目前,常用的边缘检测模板有Laplacian算子、Roberts算子、Sobel算子、log(Laplacian-Gauss)算子、Kirsch算子和Prewitt算子,等等。
以上示范性描述了执行边缘检测的典型方法,本领域技术人员可以意识到,这种描述仅是示范性的,并不用于限定本发明实施方式的保护范围。
步骤103:基于包围所述边缘的四边形的顶点坐标和所述铭牌图像的矫正图像的顶点坐标确定透视变换转换矩阵。
在这里,首先建立包围所述边缘的四边形。优选地,在所有包围所述边缘的四边形集合中,该四边形的周长最短。
而且,基于包围边缘的四边形的顶点坐标和铭牌图像的矫正图像的顶点坐标确定透视变换转换矩阵。
首先对透视变换(Perspective Transformation)进行说明。
透视变换是指利用透视中心、像点、目标点三点共线的条件,按透视旋转定律使得承影面(透视面)绕迹线(透视轴)旋转某一角度,破坏原有的投影光线束,仍能保持承影面上投影几何图形不变的变换。
在透视变换中,具有如下公式:
Figure PCTCN2020116310-appb-000002
Figure PCTCN2020116310-appb-000003
其中:
[x,y]是像素点在矫正图像中的二维坐标;[u,v,w]是像素点在变换前的三维坐标,w通常等于1;像素点在矫正图像中的三维坐标可以定义为[x,y,1]。
Figure PCTCN2020116310-appb-000004
即为透视变换转换矩阵,其中a 33为1。
铭牌图像的矫正图像通常为长方形。而且,矫正图像的4个顶点坐标为已知,比如分别为(0,0,1)、(0,h,1)、(w,h,1)和(w,0,1),其中w为矫正图像的宽度,h为矫正图像的高度。
因此,基于包围边缘的四边形的四个顶点坐标(已知)和铭牌图像的矫正图像的4个顶点坐标(已知),根据公式(3)可以构建出8个方程,从而计算出a 11、a 12、a 13、a 21、a 22、a 23、a 31和a 32的值。当计算出a 11、 a 12、a 13、a 21、a 22、a 23、a 31和a 32的值后,可以唯一地确定出透视变换转换矩阵
Figure PCTCN2020116310-appb-000005
其中a 33为1。
步骤104:基于所述透视变换转换矩阵生成所述铭牌图像的矫正图像。
在这里,基于步骤103中确定的透视变换转换矩阵生成铭牌图像的矫正图像,从而实现针对铭牌图像的矫正。
在一个实施方式中,步骤104中基于透视变换转换矩阵生成所述铭牌图像的矫正图像包括:确定所述四边形中的每个像素点的坐标(三维坐标,其中w值设置为1);基于每个像素点的坐标与所述透视变换转换矩阵的乘积,确定所述每个像素点的坐标的转换后坐标;将每个像素点复制到各自的转换后坐标处以生成所述矫正图像。
可见,在本发明实施方式中,通过对包围铭牌边缘的四边形中的每个像素点的坐标转换,可以生成对应于该四边形的、具有灰度的矫正图像。因此,本发明实施方式还实现了一种灰度图形式的矫正图像。
在一个实施方式中,步骤104中基于透视变换转换矩阵生成所述铭牌图像的矫正图像包括:确定所述铭牌图像中的每个像素点的坐标;基于每个像素点的坐标与所述透视变换转换矩阵的乘积,确定所述每个像素点的坐标的转换后坐标;将所述铭牌图像分离为R通道、G通道和B通道;确定R通道中的每个像素点复制到各自的转换后坐标处所生成的矫正R通道、G通道中的每个像素点复制到各自的转换后坐标处所生成的矫正G通道和B通道中的每个像素点复制到各自的转换后坐标处所生成的矫正B通道;将所述矫正R通道、所述矫正G通道以及所述矫正B通道合并为所述矫正图像。
具体地,首先基于铭牌图像中的每个像素点的坐标与透视变换转换矩阵的乘积,确定每个像素点的坐标的转换后坐标。然后,将铭牌图像分离为R通道、G通道和B通道,并且将R通道中的每个像素点复制到各自的转换后坐标处以生成矫正R通道,将G通道中的每个像素点复制到各自的转换后坐标处以生成矫正G通道,将B通道中的每个像素点复制到各自的转换后坐标处以生成矫正B通道。接着,将矫正R通道、矫正G通道以及矫正B通道合并为矫正图像。其中,R通道、G通道和B通道的相同位置处的像素点,分别具有相同的转换后坐标。
举例,假定有彩色的铭牌图像A需要被矫正。首先,基于铭牌图像A中的每个像素点的坐标与透视变换转换矩阵的乘积,确定铭牌图像A中的每个像素点的坐标的转换后坐标。比如,铭牌图像A包含100个像素点,其中像素点1的坐标对应于转换后坐标K1、像素点2的坐标对应于转换后坐标K1、像素点3的坐标对应于转换后坐标K3……像素点100的坐标对应于转换后坐标K100。
然后,将铭牌图像A分离为三个通道,分别为铭牌图像A的R通道、铭牌图像A的G通道和铭牌图像A的B通道。
接着,将铭牌图像A的R通道中的每个像素点,复制到矫正的R通道中的各自的转换后坐标处以生成矫正的R通道。具体地,将铭牌图像A的R通道中的像素点1复制到矫正的R通道中的转换后坐标K1处,将铭牌图像A的R通道中的像素点2复制到矫正的R通道中的转换后坐标K2处,将铭牌图像A的R通道中的像素点3复制到矫正的R通道中的转换后坐标K3处……将铭牌图像A的R通道中的像素点100复制到矫正的R通道中的转换后坐标K100处,从而形成矫正的R通道。
将铭牌图像A的G通道中的每个像素点,复制到矫正的G通道中的各自的转换后坐标处以生成矫正的G通道。具体地,将铭牌图像A的G通道中的像素点1复制到矫正的G通道中的转换后坐标K1处,将铭牌图像A的G通道中的像素点2复制到矫正的G通道中的转换后坐标K2处,将铭牌图像A的G通道中的像素点3复制到矫正的G通道中的转换后坐标K3处……将铭牌图像A的G通道中的像素点100复制到矫正的G通道中的转换后坐标K100处,从而形成矫正的G通道。
将铭牌图像A的B通道中的每个像素点,复制到矫正的G通道中的各自的转换后坐标处以生成矫正的B通道。具体地,将铭牌图像A的B通道中的像素点1复制到矫正的B通道中的转换后坐标K1处,将铭牌图像A的B通道中的像素点2复制到矫正的B通道中的转换后坐标K2处,将铭牌图像A的B通道中的像素点3复制到矫正的B通道中的转换后坐标K3处……将铭牌图像A的B通道中的像素点100复制到矫正的B通道中的转换后坐标K100处,从而形成矫正的B通道。
最后,将所述矫正R通道、所述矫正G通道以及所述矫正B通道合并为所述矫正图像。
可见,在本发明实施方式中,通过对铭牌图像的R通道、G通道和B通道中的每个像素点的坐标转换,可以生成对应于铭牌图像的、具有RGB色彩的矫正图像。因此,本发明实施方式还实现了一种RGB色彩形式的矫正图像。
在一个实施方式中,在步骤101中将包含铭牌的铭牌图像转换为灰度图像与步骤102中对灰度图像执行边缘检测以确定所述铭牌的边缘之间,该方法还包括:增加灰度图像的对比度;对增加对比度后的灰度图像执行降噪处理。
具体地,可以采用基于直方图均衡化的图像增强方式增加灰度图像的对比度,其基本思想是对于图像中的灰度点做映射,使得整体图像的灰度大致符合均匀分布。
图2为本发明实施方式的铭牌图像的矫正过程示意图。
在铭牌20的轮廓20被确定后,在包围边缘20的四边形集合(该四边形集合包含所有包围边缘20的四边形)中,确定出周长最短的四边形,假定为四边形JKMN(通常为不规则四边形)。四边形JKMN被确定后,4个顶点J、K、M、N的坐标即确定。矫正图像为预定大小的长方形。矫正图像的四个顶点A、B、C和D的坐标是已确定的。因此,基于J、K、M、N的坐标与A、B、C和D的坐标之间的对应关系,可以计算出透视变换转换矩阵。然后,利用该透视变换转换矩阵,可以将四边形JKMN中的每个像素点转换到矫正图像ABCD的对应坐标处,从而实现矫正。
可将图1所示流程应用到多种应用环境中,比如针对变压器的铭牌图像的矫正过程中。
图3为本发明实施方式矫正前的变压器铭牌图像的示意图。图4为本发明实施方式矫正后的变压器铭牌图像的示意图。图3中的变压器铭牌布置在变压器壳体上,变压器铭牌图像具有倾斜角度且包含壳体的背景环境。图4中的变压器铭牌图像的倾斜角度得到矫正且不包含背景环境,因此便于后续的OCR操作。
以上以变压器铭牌图像的矫正为例,对本发明实施方式进行说明。本领域技术人员可以意识到,这种描述仅是示范性的,并不用于限定本发明实施方式的保护范围。实际上,本发明实施方式可以适用于针对任意类型的铭牌图像的矫正处理,尤其适用于针对电子设备的名牌图像的矫正,特别是变压器。
基于上述描述,本发明实施方式还提出了铭牌图像的矫正装置。
图5为本发明实施方式的铭牌图像的矫正装置的方框图。
如图5所示,铭牌图像的矫正装置500包括:
灰度转换模块501,用于将包含铭牌的铭牌图像转换为灰度图像;
边缘检测模块503,用于对所述灰度图像执行边缘检测以确定所述铭牌的边缘;
矩阵确定模块504,用于基于包围所述边缘的四边形的顶点坐标和所述铭牌图像的矫正图像的顶点坐标确定透视变换转换矩阵;
矫正模块505,用于基于所述透视变换转换矩阵生成所述铭牌图像的矫正图像。
在一个实施方式中,在灰度转换模块501与边缘检测模块503之间,还包括:
预处理模块502,用于增加所述灰度图像的对比度;对所述增加对比度后的灰度图像执行降噪处理。
在一个实施方式中,矫正模块505,用于确定所述四边形中的每个像素点的坐标;基于每个像素点的坐标与所述透视变换转换矩阵的乘积,确定所述每个像素点的坐标的转换后坐标;将每个像素点复制到各自的转换后坐标以生成所述矫正图像。
在一个实施方式中,矫正模块505,用于确定所述铭牌图像中的每个像素点的坐标;基于每个像素点的坐标与所述透视变换转换矩阵的乘积,确定所述每个像素点的坐标的转换后坐标;将所述铭牌图像分离为R通道、G通道和B通道;确定R通道中的每个像素点复制到各自的转换后坐标处所生成的矫正R通道、G通道中的每个像素点复制到各自的转换后坐标处所生成的矫正G通道和B通道中的每个像素点复制到各自的转换后坐标处所生成的矫正B通道;将所述矫正R通道、所述矫正G通道以及所述矫正B通道合并为所述矫正图像。
基于上述描述,本发明实施方式还提出有存储器-处理器架构的、铭牌图像的矫正装置。
图6为本发明实施方式具有存储器-处理器架构的、铭牌图像的矫正装置的方框图。
如图6所示,矫正装置600包括处理器601、存储器602及存储在存储器602上并可在处理器601上运行的计算机程序,计算机程序被处理器601执行时实现如上任一项的铭牌图像的矫正方法。
其中,存储器602具体可以实施为电可擦可编程只读存储器(EEPROM)、快闪存储器(Flash memory)、 可编程程序只读存储器(PROM)等多种存储介质。处理器601可以实施为包括一或多个中央处理器或一或多个现场可编程门阵列,其中现场可编程门阵列集成一或多个中央处理器核。具体地,中央处理器或中央处理器核可以实施为CPU或MCU或DSP等等。
需要说明的是,上述各流程和各结构图中不是所有的步骤和模块都是必须的,可以根据实际的需要忽略某些步骤或模块。各步骤的执行顺序不是固定的,可以根据需要进行调整。各模块的划分仅仅是为了便于描述采用的功能上的划分,实际实现时,一个模块可以分由多个模块实现,多个模块的功能也可以由同一个模块实现,这些模块可以位于同一个设备中,也可以位于不同的设备中。
各实施方式中的硬件模块可以以机械方式或电子方式实现。例如,一个硬件模块可以包括专门设计的永久性电路或逻辑器件(如专用处理器,如FPGA或ASIC)用于完成特定的操作。硬件模块也可以包括由软件临时配置的可编程逻辑器件或电路(如包括通用处理器或其它可编程处理器)用于执行特定操作。至于具体采用机械方式,或是采用专用的永久性电路,或是采用临时配置的电路(如由软件进行配置)来实现硬件模块,可以根据成本和时间上的考虑来决定。
本发明还提供了一种机器可读的存储介质,存储用于使一机器执行如本文所述方法的指令。具体地,可以提供配有存储介质的系统或者装置,在该存储介质上存储着实现上述实施例中任一实施方式的功能的软件程序代码,且使该系统或者装置的计算机(或CPU或MPU)读出并执行存储在存储介质中的程序代码。此外,还可以通过基于程序代码的指令使计算机上操作的操作系统等来完成部分或者全部的实际操作。还可以将从存储介质读出的程序代码写到插入计算机内的扩展板中所设置的存储器中或者写到与计算机相连接的扩展单元中设置的存储器中,随后基于程序代码的指令使安装在扩展板或者扩展单元上的CPU等来执行部分和全部实际操作,从而实现上述实施方式中任一实施方式的功能。用于提供程序代码的存储介质实施方式包括软盘、硬盘、磁光盘、光盘(如CD-ROM、CD-R、CD-RW、DVD-ROM、DVD-RAM、DVD-RW、DVD+RW)、磁带、非易失性存储卡和ROM。可选择地,可以由通信网络从服务器计算机或云上下载程序代码。
以上所述,仅为本发明的较佳实施方式而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (12)

  1. 一种铭牌图像的矫正方法(100),其特征在于,该方法(100)包括:
    将包含铭牌的铭牌图像转换为灰度图像(101);
    对所述灰度图像执行边缘检测以确定所述铭牌的边缘(102);
    基于包围所述边缘的四边形的顶点坐标和所述铭牌图像的矫正图像的顶点坐标确定透视变换转换矩阵(103);
    基于所述透视变换转换矩阵生成所述铭牌图像的矫正图像(104)。
  2. 根据权利要求1所述的铭牌图像的矫正方法(100),其特征在于,在将包含铭牌的铭牌图像转换为灰度图像(101)与对所述灰度图像执行边缘检测以确定所述铭牌的边缘(102)之间,该方法还包括:
    增加所述灰度图像的对比度;
    对所述增加对比度后的灰度图像执行降噪处理。
  3. 根据权利要求1所述的铭牌图像的矫正方法(100),其特征在于,所述基于透视变换转换矩阵生成所述铭牌图像的矫正图像(104)包括:
    确定所述四边形中的每个像素点的坐标;
    基于每个像素点的坐标与所述透视变换转换矩阵的乘积,确定所述每个像素点的坐标的转换后坐标;
    将每个像素点复制到各自的转换后坐标处以生成所述矫正图像。
  4. 根据权利要求1所述的铭牌图像的矫正方法(100),其特征在于,所述基于透视变换转换矩阵生成所述铭牌图像的矫正图像(104)包括:
    确定所述铭牌图像中的每个像素点的坐标;
    基于每个像素点的坐标与所述透视变换转换矩阵的乘积,确定所述每个像素点的坐标的转换后坐标;
    将所述铭牌图像分离为R通道、G通道和B通道;
    确定R通道中的每个像素点复制到各自的转换后坐标处所生成的矫正R通道、G通道中的每个像素点复制到各自的转换后坐标处所生成的矫正G通道和B通道中的每个像素点复制到各自的转换后坐标处所生成的矫正B通道;
    将所述矫正R通道、所述矫正G通道以及所述矫正B通道合并为所述矫正图像。
  5. 根据权利要求1-4中任一项所述的铭牌图像的矫正方法(100),其特征在于,
    在包围所述边缘的四边形集合中,所述四边形的周长最短。
  6. 一种铭牌图像的矫正装置(500),其特征在于,该装置(500)包括:
    灰度转换模块(501),用于将包含铭牌的铭牌图像转换为灰度图像;
    边缘检测模块(503),用于对所述灰度图像执行边缘检测以确定所述铭牌的边缘;
    矩阵确定模块(504),用于基于包围所述边缘的四边形的顶点坐标和所述铭牌图像的矫正图像的顶点坐标确定透视变换转换矩阵;
    矫正模块(505),用于基于所述透视变换转换矩阵生成所述铭牌图像的矫正图像。
  7. 根据权利要求6所述的铭牌图像的矫正装置(500),其特征在于,在灰度转换模块(501)与边缘检测模块(503)之间,还包括:
    预处理模块(502),用于增加所述灰度图像的对比度;对所述增加对比度后的灰度图像执行降噪处理。
  8. 根据权利要求6所述的铭牌图像的矫正装置(500),其特征在于,
    矫正模块(505),用于确定所述四边形中的每个像素点的坐标;基于每个像素点的坐标与所述透视变换转换矩阵的乘积,确定所述每个像素点的坐标的转换后坐标;将每个像素点复制到各自的转换后坐标以生成所述矫正图像。
  9. 根据权利要求6所述的铭牌图像的矫正装置(500),其特征在于,
    矫正模块(505),用于确定所述铭牌图像中的每个像素点的坐标;基于每个像素点的坐标与所述透视变换转换矩阵的乘积,确定所述每个像素点的坐标的转换后坐标;将所述铭牌图像分离为R通道、G通道和B通道;确定R通道中的每个像素点复制到各自的转换后坐标处所生成的矫正R通道、G通道中的每个像素点复制到各自的转换后坐标处所生成的矫正G通道和B通道中的每个像素点复制到各自的转换后坐标处所生成的矫正B通道;将所述矫正R通道、所述矫正G通道以及所述矫正B通道合并为所述矫正图像。
  10. 根据权利要求6-9中任一项所述的铭牌图像的矫正装置(500),其特征在于,在包围所述边缘的四边形集合中,所述四边形的周长最短。
  11. 一种铭牌图像的矫正装置(600),其特征在于,包括:处理器(601)和存储器(602);
    其中所述存储器(602)中存储有可被所述处理器(601)执行的应用程序,用于使得所述处理器(601)执行如权利要求1至5中任一项所述的铭牌图像的矫正方法(100)。
  12. 一种计算机可读存储介质,其特征在于,其中存储有计算机可读指令,该计算机可读指令用于执行如权利要求1至5中任一项所述的铭牌图像的矫正方法(100)。
PCT/CN2020/116310 2020-09-18 2020-09-18 一种铭牌图像的矫正方法、装置和计算机可读存储介质 WO2022056872A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2020/116310 WO2022056872A1 (zh) 2020-09-18 2020-09-18 一种铭牌图像的矫正方法、装置和计算机可读存储介质
CN202080105177.1A CN116194963A (zh) 2020-09-18 2020-09-18 一种铭牌图像的矫正方法、装置和计算机可读存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/116310 WO2022056872A1 (zh) 2020-09-18 2020-09-18 一种铭牌图像的矫正方法、装置和计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2022056872A1 true WO2022056872A1 (zh) 2022-03-24

Family

ID=80777407

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/116310 WO2022056872A1 (zh) 2020-09-18 2020-09-18 一种铭牌图像的矫正方法、装置和计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN116194963A (zh)
WO (1) WO2022056872A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5651075A (en) * 1993-12-01 1997-07-22 Hughes Missile Systems Company Automated license plate locator and reader including perspective distortion correction
CN106203433A (zh) * 2016-07-13 2016-12-07 西安电子科技大学 一种车辆监控图像中车牌位置自动提取并透视校正的方法
CN110414309A (zh) * 2019-05-27 2019-11-05 上海眼控科技股份有限公司 一种车辆铭牌的自动识别方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5651075A (en) * 1993-12-01 1997-07-22 Hughes Missile Systems Company Automated license plate locator and reader including perspective distortion correction
CN106203433A (zh) * 2016-07-13 2016-12-07 西安电子科技大学 一种车辆监控图像中车牌位置自动提取并透视校正的方法
CN110414309A (zh) * 2019-05-27 2019-11-05 上海眼控科技股份有限公司 一种车辆铭牌的自动识别方法

Also Published As

Publication number Publication date
CN116194963A (zh) 2023-05-30

Similar Documents

Publication Publication Date Title
US8494297B2 (en) Automatic detection and mapping of symmetries in an image
US8457403B2 (en) Method of detecting and correcting digital images of books in the book spine area
US8885972B2 (en) Straightening out distorted perspective on images
US20060262960A1 (en) Method and device for tracking objects in a sequence of images
US20080298718A1 (en) Image Stitching
JP5387193B2 (ja) 画像処理システム、画像処理装置およびプログラム
US20180253852A1 (en) Method and device for locating image edge in natural background
US9087272B2 (en) Optical match character classification
CN111680689A (zh) 一种基于深度学习的目标检测方法、系统及存储介质
EP2536123B1 (en) Image processing method and image processing apparatus
JP3814353B2 (ja) 画像分割方法および画像分割装置
JP6797046B2 (ja) 画像処理装置及び画像処理プログラム
CN109325487B (zh) 一种基于目标检测的全种类车牌识别方法
CN110956184A (zh) 一种基于hsi-lbp特征的抽象图方向确定方法
CN106611406B (zh) 图像校正方法和图像校正设备
WO2022056875A1 (zh) 一种铭牌图像的分割方法、装置和计算机可读存储介质
WO2022056872A1 (zh) 一种铭牌图像的矫正方法、装置和计算机可读存储介质
CN115063279B (zh) 一种文本水印图像的预处理方法和装置
Fursov et al. Correction of distortions in color images based on parametric identification
JP5618719B2 (ja) 画像処理装置、その方法およびプログラム
WO2022056873A1 (zh) 变压器属性信息的更新方法、装置和计算机可读存储介质
CN113065559B (zh) 图像比对方法、装置、电子设备及存储介质
Ernst et al. Check my chart: A robust color chart tracker for colorimetric camera calibration
WO2022056876A1 (zh) 一种电机铭牌的识别方法、装置和计算机可读存储介质
JP2008113145A (ja) 画像処理装置及び画像処理プログラム

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20953730

Country of ref document: EP

Kind code of ref document: A1