WO2021128242A1 - Picture target point correction method, apparatus and device, and storage medium - Google Patents

Picture target point correction method, apparatus and device, and storage medium Download PDF

Info

Publication number
WO2021128242A1
WO2021128242A1 PCT/CN2019/129059 CN2019129059W WO2021128242A1 WO 2021128242 A1 WO2021128242 A1 WO 2021128242A1 CN 2019129059 W CN2019129059 W CN 2019129059W WO 2021128242 A1 WO2021128242 A1 WO 2021128242A1
Authority
WO
WIPO (PCT)
Prior art keywords
deviation
degree
target point
quadrilateral
target
Prior art date
Application number
PCT/CN2019/129059
Other languages
French (fr)
Chinese (zh)
Inventor
甄海华
Original Assignee
威创集团股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 威创集团股份有限公司 filed Critical 威创集团股份有限公司
Priority to CN201980003348.7A priority Critical patent/CN111108515B/en
Priority to PCT/CN2019/129059 priority patent/WO2021128242A1/en
Publication of WO2021128242A1 publication Critical patent/WO2021128242A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/24Aligning, centring, orientation detection or correction of the image
    • G06V10/243Aligning, centring, orientation detection or correction of the image by compensating for image skew or non-uniform image deformations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/255Detecting or recognising potential candidate objects based on visual cues, e.g. shapes

Definitions

  • This application relates to the field of image recognition technology, and in particular to a method, device and storage medium for correcting image target points.
  • the current image target search method has a certain error detection probability, that is to say, the detected target point is not the real target point, especially when the area where the target point is located is deformed, the error detection is more serious.
  • the three rectangles shown in Figure 5 the one on the left in the figure is a standard rectangular drawing, and there are 4 target points in the drawing. These target points are located at the four corners of the drawing. These 4 targets Points can form a standard rectangle.
  • the two rectangles on the left and right are all due to the shooting angle. For example, the angle between the plane of the shooting lens and the plane of the drawing is deviated.
  • the drawing in the photograph will be deformed, for example, it becomes trapezoidal or is Similar to the shape of a parallelogram, it is often difficult to locate the exact position of the target point after searching the target.
  • This application provides a method, device and storage medium for correcting image target points, which solves the problem of shooting angles in the prior art, such as the deviation of the angle between the plane of the shooting lens and the plane of the drawing.
  • the drawings in, such as trapezoid or parallelogram-like shapes, may be deformed. At this time, it is often difficult to locate the exact position of the target point after the target search.
  • the first aspect of this application provides a method for correcting image target points, including:
  • the method before calculating the first degree of deviation between the quadrilateral and the standard rectangle, the method further includes: judging whether any two target points overlap, and if so, returning an error result.
  • the first degree of deviation specifically includes:
  • the angle between the upper edge and the lower edge of the quadrilateral is calculated, and it is judged whether it meets the preset angle value.
  • the judging whether the first deviation degree meets a first deviation degree threshold specifically includes:
  • the first deviation degree meets a first deviation degree threshold.
  • the second degree of deviation specifically includes:
  • the error scores of the four target points are respectively calculated.
  • the target point when there is a second deviation degree of the target point that does not meet the second deviation degree threshold, it specifically includes:
  • the error scores of the four target points are sorted from large to small, and the target point corresponding to the largest error score is the wrong target point.
  • the acquiring a new target point near the target point specifically includes:
  • the two-dimensional coordinate value of the new target point is calculated.
  • the second aspect of the present application provides an image target point correction device, including:
  • the first degree of deviation judgment module is used to obtain four target points that can form a quadrilateral, calculate the first degree of deviation between the quadrilateral and the standard rectangle, and determine whether the first degree of deviation meets the first degree of deviation threshold, if not, Respectively calculating the second degree of deviation of the four target points relative to the standard rectangle;
  • the second degree of deviation judgment module is used to obtain a new target point near the target point when the second degree of deviation of the target point does not meet the second degree of deviation threshold, and repeat the calculation to obtain the new first degree of deviation And the new second degree of deviation.
  • a third aspect of the present application provides a picture target point correction device, the device including a processor and a memory;
  • the memory is used to store program code and transmit the program code to the processor
  • the processor is configured to execute the image target point correction method of the first aspect according to the instructions in the program code.
  • a fourth aspect of the present application provides a computer-readable storage medium, where the computer-readable storage medium is used to store program code, and the program code is used to execute the image target point correction method of the first aspect.
  • a method for correcting image target points including:
  • the method for correcting image target points provided in this application firstly judges the deviation degree of the quadrilateral formed by the four target points obtained from the standard rectangle through the first stage, and judges whether the obtained target points are wrong, and if they are wrong, make a specific judgment Among the four target points, the target point with the largest deviation is eliminated, and the prediction is performed again to obtain a new target point, and the procedure is repeated until the deviation degree of the first stage meets the preset, which reduces the error degree of the obtained target point.
  • This application solves the problem of shooting angle in the prior art, such as the angle of the plane of the shooting lens and the plane of the drawing, etc., the drawing in the photographed photo may be deformed, such as becoming trapezoidal or similar to parallel
  • the quadrilateral shape is a technical problem that it is often difficult to locate the exact position of the target point after the target search.
  • FIG. 1 is a schematic flowchart of an embodiment of a method for correcting image target points provided by this application;
  • FIG. 2 is a schematic flowchart of another embodiment of a method for correcting image target points provided by this application;
  • FIG. 3 is a logic diagram for generating an excitation voltage signal of an embodiment of a picture target point correction device provided by this application;
  • FIG. 4 is a schematic diagram of a quadrilateral of an embodiment of a method for correcting image target points provided by this application;
  • Figure 5 is a schematic diagram of the prior art in three cases.
  • the embodiments of the present application provide a method, device and storage medium for correcting image target points, which solves the problem of shooting angles in the prior art, such as the deviation of the angle between the plane of the shooting lens and the plane of the drawing, etc.
  • the drawings in the photos of may be deformed, such as becoming trapezoidal or similar to a parallelogram shape. At this time, it is often difficult to locate the exact position of the target point after the target search.
  • FIG. 1 is a schematic flowchart of an embodiment of a method for correcting image target points provided by this application
  • FIG. 4 is an example of a method for correcting image target points provided by this application. Schematic diagram of the quadrilateral of the embodiment
  • the embodiment of the present application provides a method for correcting image target points, including:
  • the method for correcting image targets provided in the embodiments of this application first determines whether the four target points obtained in the first stage are wrong and whether the errors can be corrected.
  • the judgment process is to calculate the quadrilateral formed by the target points relative to the standard The deviation of the rectangle, if the deviation is too large or exceeds the preset value, it can be considered that the error cannot be corrected, otherwise the subsequent correction steps can be carried out. If the deviation is small, it is considered that the target point found is accurate, and then the subsequent correction steps may not be performed.
  • the first degree of deviation between the quadrilateral and the standard rectangle it also includes: judging whether any two target points overlap, and if so, returning an error result.
  • FIG. 2 is a schematic diagram of another embodiment of the method for correcting image targets provided in this application.
  • the first degree of deviation specifically includes:
  • the angle between the upper and lower edges of the quadrilateral formed by the target point and the horizontal line is calculated. If the angle is greater than the preset value, an error will be returned directly and subsequent operations cannot be performed;
  • the preset value can be set manually
  • determining whether the first deviation degree meets the first deviation degree threshold specifically includes:
  • the first A degree of deviation satisfies the first degree of deviation threshold.
  • the second degree of deviation specifically includes:
  • the error scores of the four target points are calculated respectively.
  • W and H are the width and height of the photo
  • L 1 , L 2 , L 3 , and L 4 are the lengths of the four sides of the quadrilateral formed by the four target points.
  • the specific target search method can be the square difference matching method, the phase normalized square difference matching method, the correlation matching method, the normalized correlation matching method, the coefficient matching method, and the normalized correlation coefficient matching method.
  • E 1 P 11 +P 13 +P 21 +P 23 +P 31 ;
  • E 2 P 11 +P 14 +P 21 +P 24 +P 32 ;
  • E 3 P 12 +P 13 +P 22 +P 23 +P 33 ;
  • E 4 P 12 +P 14 +P 22 +P 24 +P 34 ;
  • the target point when there is a second deviation degree of the target point that does not meet the second deviation degree threshold, it specifically includes:
  • the error scores of the four target points are sorted from largest to smallest, and the target point corresponding to the largest error score is the wrong target point.
  • E 1 , E 2 , E 3 , and E 4 obtained in the above calculation steps are sorted from largest to smallest, and the target point corresponding to the maximum value is the error code punctuation, which is marked as I.
  • obtaining a new target point near the target point specifically includes:
  • the two-dimensional coordinate value of the new target point is calculated.
  • the coordinates of the four known target points are (x1, y1), (x2, y2), (x3, y3), (x4, y4), where x is the horizontal coordinate and y is the vertical coordinate.
  • the four inner corners of the quadrilateral are V1, V2, V3, and V4, which are the upper left corner, the upper right corner, the lower left corner, and the lower right corner.
  • the target search method After obtaining the predicted position of the wrong target point, the target search method needs to be used to find the target again in the local area of the predicted position, and the range of the local area is a square area with the predicted position as the midpoint. Get the new search position of the point, and form a new quad with the original three points, and then repeat the above judgment steps until it meets the judgment conditions of the deviation of the quadrilateral, it is considered that the final target point is found; if it exceeds If it still fails to meet the requirements after a certain number of corrections, it is deemed that the error cannot be corrected, and the search and correction are ended.
  • FIG. 3 is a schematic structural diagram of a picture target point correction device provided for this application.
  • This application also provides an image target point correction device, including:
  • the first degree of deviation judgment module 10 is used to obtain four target points that can form a quadrilateral, calculate the first degree of deviation between the quadrilateral and the standard rectangle, and determine whether the first degree of deviation meets the first degree of deviation threshold, and if not, calculate the four points respectively.
  • the second degree of deviation judgment module 20 is used to obtain a new target point near the target point when there is a second degree of deviation of the target point that does not meet the second degree of deviation threshold, and repeat the calculation to obtain a new first degree of deviation and The new second degree of deviation.
  • This application also provides a picture target point correction device, the device including a processor and a memory;
  • the memory is used to store the program code and transmit the program code to the processor
  • the processor is configured to execute the image target point correction method of the above embodiment according to the instructions in the program code.
  • the present application also provides a computer-readable storage medium, where the computer-readable storage medium is used to store program code, and the program code is used to execute the method for correcting image target points in the foregoing embodiment.
  • At least one (item) refers to one or more, and “multiple” refers to two or more.
  • “And/or” is used to describe the association relationship of associated objects, indicating that there can be three types of relationships, for example, “A and/or B” can mean: only A, only B, and both A and B , Where A and B can be singular or plural.
  • the character “/” generally indicates that the associated objects before and after are in an “or” relationship.
  • the following at least one item (a) or similar expressions refers to any combination of these items, including any combination of a single item (a) or a plurality of items (a).
  • At least one of a, b, or c can mean: a, b, c, "a and b", “a and c", “b and c", or "a and b and c" ", where a, b, and c can be single or multiple.
  • the disclosed system, device, and method can be implemented in other ways.
  • the device embodiments described above are merely illustrative, for example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (English full name: Read-Only Memory, English abbreviation: ROM), random access memory (English full name: RandomAccess Memory, English abbreviation: RAM), magnetic disk Or various media that can store program codes, such as an optical disc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

Disclosed are a picture target point correction method, apparatus and device, and a storage medium. The method comprises: acquiring four target points that may constitute a quadrangle; calculating a first deviation degree between the quadrangle and a standard rectangle; determining whether the first deviation degree satisfies a first deviation degree threshold value; if not, respectively calculating second deviation degrees of the four target points relative to the standard rectangle; and when the second deviation degree of a target point does not satisfy a second deviation degree threshold value, acquiring a new target point near the target point, and repeatedly carrying out calculation to obtain a new first deviation degree and a new second deviation degree. The present application solves the technical problem in the prior art of it often being difficult to locate the accurate position of a target point after target searching due to the fact that a drawing in a photographed photograph may be deformed, for example, the drawing is changed into a trapezoid or a shape similar to a parallelogram due to the problem of a photographic angle, such as angle deviation between the plane of a photographic lens and the plane of drawing.

Description

图片目标点纠正方法、装置设备及存储介质Image target point correction method, device equipment and storage medium 技术领域Technical field
本申请涉及图像识别技术领域,尤其涉及图片目标点纠正方法、装置设备及存储介质。This application relates to the field of image recognition technology, and in particular to a method, device and storage medium for correcting image target points.
背景技术Background technique
目前的图片目标查找方法存在有一定的错误检测概率,也就是说查找检测到的目标点并非真正的目标点,尤其当目标点所在区域发生变形时,错误检测更为严重。比如附图5所示的三个矩形,附图中的左一的矩形为标准的矩形图纸,图纸中有4个目标点,这些目标点分别位于图纸的四个角的位置,这4个目标点可以组成标准矩形。而左二、右一的两个矩形均为由于拍摄角度的问题,比如说拍摄镜头的平面与图纸平面的角度有偏差等,拍摄到的照片中的图纸会存在变形,例如变为梯形或者是类似于平行四边形的形状,这时候经过目标查找后往往难以定位到目标点的准确位置。The current image target search method has a certain error detection probability, that is to say, the detected target point is not the real target point, especially when the area where the target point is located is deformed, the error detection is more serious. For example, the three rectangles shown in Figure 5, the one on the left in the figure is a standard rectangular drawing, and there are 4 target points in the drawing. These target points are located at the four corners of the drawing. These 4 targets Points can form a standard rectangle. The two rectangles on the left and right are all due to the shooting angle. For example, the angle between the plane of the shooting lens and the plane of the drawing is deviated. The drawing in the photograph will be deformed, for example, it becomes trapezoidal or is Similar to the shape of a parallelogram, it is often difficult to locate the exact position of the target point after searching the target.
发明内容Summary of the invention
本申请提供了一种图片目标点纠正方法、装置设备及存储介质,解决了现有技术中的由于拍摄角度的问题,比如说拍摄镜头的平面与图纸平面的角度有偏差等,拍摄到的照片中的图纸会存在变形,例如变为梯形或者是类似于平行四边形的形状,这时候经过目标查找后往往难以定位到目标点的准确位置的技术问题。This application provides a method, device and storage medium for correcting image target points, which solves the problem of shooting angles in the prior art, such as the deviation of the angle between the plane of the shooting lens and the plane of the drawing. The drawings in, such as trapezoid or parallelogram-like shapes, may be deformed. At this time, it is often difficult to locate the exact position of the target point after the target search.
本申请第一方面提供了一种图片目标点纠正方法,包括:The first aspect of this application provides a method for correcting image target points, including:
获取能组成四边形的四个目标点,计算所述四边形与标准矩形的第一偏差度,判断所述第一偏差度是否满足第一偏差度阈值,若否,分别计算所述四个目标点相对于所述标准矩形的第二偏差度;Obtain four target points that can form a quadrilateral, calculate the first deviation of the quadrilateral and the standard rectangle, determine whether the first deviation meets the first deviation threshold, and if not, calculate the relative values of the four target points. The second degree of deviation from the standard rectangle;
当存在有目标点的第二偏差度不符合第二偏差度阈值时,在所述目标点附近获取新的目标点,并重复计算获得新的第一偏差度和新的第二偏差度。When there is a target point whose second degree of deviation does not meet the second degree of deviation threshold, a new target point is obtained near the target point, and the calculation is repeated to obtain a new first degree of deviation and a new second degree of deviation.
可选地,所述计算所述四边形与标准矩形的第一偏差度之前,还包括:判断是否有任意两个目标点重合,若是,返回错误结果。Optionally, before calculating the first degree of deviation between the quadrilateral and the standard rectangle, the method further includes: judging whether any two target points overlap, and if so, returning an error result.
可选地,所述第一偏差度具体包括:Optionally, the first degree of deviation specifically includes:
将所述四个目标点顺次连接形成所述四边形;Connecting the four target points sequentially to form the quadrilateral;
计算获得所述四边形的上下边的长度偏差和左右边的长度偏差,判断是否符合第一预设偏差值;Calculate and obtain the length deviation of the upper and lower sides and the length deviation of the left and right sides of the quadrilateral, and determine whether it meets the first preset deviation value;
计算获得所述四边形的左上角与右上角的上角偏差,判断是否符合第二预设偏差值;Calculating the upper left corner and the upper right corner of the quadrilateral to obtain the upper corner deviation, and judging whether it meets the second preset deviation value;
计算获得所述四边形的左下角与右下角的下角偏差,判断是否符合第三预设偏差值;Calculate and obtain the deviation of the lower left corner and the lower right corner of the quadrilateral, and determine whether it meets the third preset deviation value;
分别计算获得所述四边形的四个内角与九十度的四个内角偏差,判断是否符合第四预设偏差值;Calculate and obtain the deviations of the four internal angles of the quadrilateral from the four internal angles of ninety degrees respectively, and determine whether they meet the fourth preset deviation value;
计算获得所述四边形的左边、右边与垂直线的垂直偏差,判断是否符合第五预设偏差值;Calculate and obtain the vertical deviation between the left and right sides of the quadrilateral and the vertical line, and determine whether it meets the fifth preset deviation value;
计算获得所述四边形的上边与下边的夹角,判断是否符合预设夹角值。The angle between the upper edge and the lower edge of the quadrilateral is calculated, and it is judged whether it meets the preset angle value.
可选地,所述判断所述第一偏差度是否满足第一偏差度阈值具体包括:Optionally, the judging whether the first deviation degree meets a first deviation degree threshold specifically includes:
当且仅当所述第一预设偏差值、所述第二预设偏差值、所述第三预设偏差值、所述第四预设偏差值、所述第五预设偏差值以及所述预设夹角值均被满足时,所述第一偏差度满足第一偏差度阈值。If and only if the first preset deviation value, the second preset deviation value, the third preset deviation value, the fourth preset deviation value, the fifth preset deviation value and all When the preset included angle values are all satisfied, the first deviation degree meets a first deviation degree threshold.
可选地,所述第二偏差度具体包括:Optionally, the second degree of deviation specifically includes:
分别计算获得所述四边形的四条边与所述图片的四条边的四个边偏差参数;Respectively calculating and obtaining four side deviation parameters of the four sides of the quadrilateral and the four sides of the picture;
分别计算获得所述四边形的上边、下边与水平线的夹角,左边、右边与垂直线的夹角偏差值,得到四个角偏差值;Calculate and obtain the angle deviations between the upper and lower sides of the quadrilateral and the horizontal line, and the deviation values of the angles between the left and right sides and the vertical line to obtain the four corner deviation values;
计算获得所述四个目标点的四个匹配度分数,根据所述四个匹配度分数计算获得所述四个目标点的四个匹配度偏差值;Calculating and obtaining four matching degree scores of the four target points, and calculating and obtaining four matching degree deviation values of the four target points according to the four matching degree scores;
根据所述四个边偏差值、所述四个角偏差值以及所述四个匹配度偏差值,分别计算出所述四个目标点的错误分。According to the four edge deviation values, the four angle deviation values, and the four matching degree deviation values, the error scores of the four target points are respectively calculated.
可选地,所述当存在有目标点的第二偏差度不符合第二偏差度阈值时,具体包括:Optionally, when there is a second deviation degree of the target point that does not meet the second deviation degree threshold, it specifically includes:
将所述四个目标点的错误分进行从大到小的排序,最大的错误分对应的目标点即为错误目标点。The error scores of the four target points are sorted from large to small, and the target point corresponding to the largest error score is the wrong target point.
可选地,所述在所述目标点附近获取新的目标点,具体包括:Optionally, the acquiring a new target point near the target point specifically includes:
分别获取除错误目标点以外的三个目标点的三个二维坐标;Obtain the three two-dimensional coordinates of the three target points except the wrong target point respectively;
获取所述四边形的四个内角的四个角度值;Obtaining four angle values of the four inner corners of the quadrilateral;
根据所述三个二维坐标值和所述四个角度值,计算获得新的目标点的二维坐标值。According to the three two-dimensional coordinate values and the four angle values, the two-dimensional coordinate value of the new target point is calculated.
本申请第二方面提供了一种图片目标点纠正装置,包括:The second aspect of the present application provides an image target point correction device, including:
判断第一偏差度模块,用于获取能组成四边形的四个目标点,计算所述四边形与标准矩形的第一偏差度,判断所述第一偏差度是否满足第一偏差度阈值,若否,分别计算所述四个目标点相对于所述标准矩形的第二偏差度;The first degree of deviation judgment module is used to obtain four target points that can form a quadrilateral, calculate the first degree of deviation between the quadrilateral and the standard rectangle, and determine whether the first degree of deviation meets the first degree of deviation threshold, if not, Respectively calculating the second degree of deviation of the four target points relative to the standard rectangle;
判断第二偏差度模块,用于当存在有目标点的第二偏差度不符合第二偏差度阈值时,在所述目标点附近获取新的目标点,并重复计算获得新的第一偏差度和新的第二偏差度。The second degree of deviation judgment module is used to obtain a new target point near the target point when the second degree of deviation of the target point does not meet the second degree of deviation threshold, and repeat the calculation to obtain the new first degree of deviation And the new second degree of deviation.
本申请第三方面提供了一种图片目标点纠正设备,所述设备包括处理器以及存储器;A third aspect of the present application provides a picture target point correction device, the device including a processor and a memory;
所述存储器用于存储程序代码,并将所述程序代码传输给所述处理器;The memory is used to store program code and transmit the program code to the processor;
所述处理器用于根据所述程序代码中的指令执行第一方面的图片目标点纠正方法。The processor is configured to execute the image target point correction method of the first aspect according to the instructions in the program code.
本申请第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质用于存储程序代码,所述程序代码用于执行第一方面的图片目标点纠正方法。A fourth aspect of the present application provides a computer-readable storage medium, where the computer-readable storage medium is used to store program code, and the program code is used to execute the image target point correction method of the first aspect.
从以上技术方案可以看出,本申请实施例具有以下优点:It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
本申请中,提供了一种图片目标点纠正方法,包括:In this application, a method for correcting image target points is provided, including:
获取能组成四边形的四个目标点,计算所述四边形与标准矩形的第一偏差度,判断所述第一偏差度是否满足第一偏差度阈值,若否,分别计算所述四个目标点相对于所述标准矩形的第二偏差度;Obtain four target points that can form a quadrilateral, calculate the first deviation of the quadrilateral and the standard rectangle, determine whether the first deviation meets the first deviation threshold, and if not, calculate the relative values of the four target points. The second degree of deviation from the standard rectangle;
当存在有目标点的第二偏差度不符合第二偏差度阈值时,在所述目标点附近获取新的目标点,并重复计算获得新的第一偏差度和新的第二偏差度。When there is a target point whose second degree of deviation does not meet the second degree of deviation threshold, a new target point is obtained near the target point, and the calculation is repeated to obtain a new first degree of deviation and a new second degree of deviation.
本申请提供的图片目标点纠正方法,通过第一阶段先判断所获取到的四个目标点形成的四边形相对于标准矩形的偏差度判断获得的目标点是否有误,若是有误,则具体判断这四个目标点中,偏差最大的目标点,进行排除,并重新 进行预测获取新的目标点,如此重复,直至第一阶段的偏差度符合预设,减少了获得的目标点的误差度。本申请解决了现有技术中的由于拍摄角度的问题,比如说拍摄镜头的平面与图纸平面的角度有偏差等,拍摄到的照片中的图纸会存在变形,例如变为梯形或者是类似于平行四边形的形状,这时候经过目标查找后往往难以定位到目标点的准确位置的技术问题。The method for correcting image target points provided in this application firstly judges the deviation degree of the quadrilateral formed by the four target points obtained from the standard rectangle through the first stage, and judges whether the obtained target points are wrong, and if they are wrong, make a specific judgment Among the four target points, the target point with the largest deviation is eliminated, and the prediction is performed again to obtain a new target point, and the procedure is repeated until the deviation degree of the first stage meets the preset, which reduces the error degree of the obtained target point. This application solves the problem of shooting angle in the prior art, such as the angle of the plane of the shooting lens and the plane of the drawing, etc., the drawing in the photographed photo may be deformed, such as becoming trapezoidal or similar to parallel The quadrilateral shape is a technical problem that it is often difficult to locate the exact position of the target point after the target search.
附图说明Description of the drawings
图1为本申请提供的一种图片目标点纠正方法的一个实施例的流程示意图;FIG. 1 is a schematic flowchart of an embodiment of a method for correcting image target points provided by this application;
图2为本申请提供的一种图片目标点纠正方法的另一个实施例的流程示意图;2 is a schematic flowchart of another embodiment of a method for correcting image target points provided by this application;
图3为本申请提供的一种图片目标点纠正装置的一个实施例的励磁电压信号的产生逻辑图;FIG. 3 is a logic diagram for generating an excitation voltage signal of an embodiment of a picture target point correction device provided by this application;
图4为本申请提供的一种图片目标点纠正方法的一个实施例的四边形的示意图;4 is a schematic diagram of a quadrilateral of an embodiment of a method for correcting image target points provided by this application;
图5为现有技术的三种情况下的示意图。Figure 5 is a schematic diagram of the prior art in three cases.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to enable those skilled in the art to better understand the solution of the application, the technical solutions in the embodiments of the application will be clearly and completely described below in conjunction with the drawings in the embodiments of the application. Obviously, the described embodiments are only It is a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
本申请实施例提供了一种图片目标点纠正方法、装置设备及存储介质,解决了现有技术中的由于拍摄角度的问题,比如说拍摄镜头的平面与图纸平面的角度有偏差等,拍摄到的照片中的图纸会存在变形,例如变为梯形或者是类似于平行四边形的形状,这时候经过目标查找后往往难以定位到目标点的准确位置的技术问题。The embodiments of the present application provide a method, device and storage medium for correcting image target points, which solves the problem of shooting angles in the prior art, such as the deviation of the angle between the plane of the shooting lens and the plane of the drawing, etc. The drawings in the photos of, may be deformed, such as becoming trapezoidal or similar to a parallelogram shape. At this time, it is often difficult to locate the exact position of the target point after the target search.
为了便于理解,请参见图1和图4,图1为本申请提供的一种图片目标点纠正方法的一个实施例的流程示意图;图4为本申请提供的一种图片目标点纠 正方法的一个实施例的四边形的示意图;For ease of understanding, please refer to FIGS. 1 and 4. FIG. 1 is a schematic flowchart of an embodiment of a method for correcting image target points provided by this application; FIG. 4 is an example of a method for correcting image target points provided by this application. Schematic diagram of the quadrilateral of the embodiment;
本申请实施例提供了一种图片目标点纠正方法,包括:The embodiment of the present application provides a method for correcting image target points, including:
100,获取能组成四边形的四个目标点,计算四边形与标准矩形的第一偏差度,判断第一偏差度是否满足第一偏差度阈值,若否,分别计算四个目标点相对于标准矩形的第二偏差度;100. Obtain four target points that can form a quadrilateral, calculate the first deviation between the quadrilateral and the standard rectangle, and determine whether the first deviation meets the first deviation threshold, and if not, calculate the four target points relative to the standard rectangle. Second degree of deviation
200,当存在有目标点的第二偏差度不符合第二偏差度阈值时,在目标点附近获取新的目标点,并重复计算获得新的第一偏差度和新的第二偏差度。200. When there is a second deviation degree of the target point that does not meet the second deviation degree threshold, obtain a new target point near the target point, and repeat calculation to obtain a new first deviation degree and a new second deviation degree.
需要说明的是,本申请实施例提供的图片目标纠正方法,首先判断第一阶段获取到的四个目标点是否有错,以及错误是否能纠正,判断过程为计算目标点组成的四边形相对于标准矩形的偏差度,如果偏差太大,或者是超过预设,则可以认为该错误无法纠正,否则可以进行后续的纠正步骤。若是偏差较小,则认为查找到的目标点准确,那么,便可以不进行后续的纠正步骤。It should be noted that the method for correcting image targets provided in the embodiments of this application first determines whether the four target points obtained in the first stage are wrong and whether the errors can be corrected. The judgment process is to calculate the quadrilateral formed by the target points relative to the standard The deviation of the rectangle, if the deviation is too large or exceeds the preset value, it can be considered that the error cannot be corrected, otherwise the subsequent correction steps can be carried out. If the deviation is small, it is considered that the target point found is accurate, and then the subsequent correction steps may not be performed.
然后逐个比较四边形的四个角相对于标准矩形的偏差度,若是偏差度过大,或者是超过预设阈值时,则认为是该点出错,接着通过三个正确点的位置来计算错误点大概应该出现的位置。Then compare the deviations of the four corners of the quadrilateral with respect to the standard rectangle one by one. If the deviation is too large or exceeds the preset threshold, it is considered that the point is wrong, and then the position of the three correct points is used to calculate the approximate error point Where it should appear.
预测出错误点的位置后,在该位置附近重新做目标查找,得到该点的新的位置,与正确的三个点再次组成新的四边形,再重复以上的判断步骤,直到前面四边形的判断结果符合预设阈值。After predicting the position of the wrong point, do a new target search near the position to get the new position of the point, and the correct three points form a new quadrilateral again, and then repeat the above judgment steps until the judgment result of the previous quadrilateral Meet the preset threshold.
进一步地,计算四边形与标准矩形的第一偏差度之前,还包括:判断是否有任意两个目标点重合,若是,返回错误结果。Further, before calculating the first degree of deviation between the quadrilateral and the standard rectangle, it also includes: judging whether any two target points overlap, and if so, returning an error result.
需要说明的是,在进行四边形与标准矩形的偏差度计算时,需要先判断四个点中,是否存在有任意两个点重合,若是有重合点,直接返回错误结果。It should be noted that when calculating the deviation between the quadrilateral and the standard rectangle, it is necessary to first determine whether any two of the four points overlap. If there are overlap points, the error result will be returned directly.
为了便于理解,请参见图2,为本申请提供的图片目标纠正方法的另一个实施例的示意图;For ease of understanding, please refer to FIG. 2, which is a schematic diagram of another embodiment of the method for correcting image targets provided in this application;
进一步地,第一偏差度具体包括:Further, the first degree of deviation specifically includes:
110,将四个目标点顺次连接形成四边形;110. Connect the four target points in sequence to form a quadrilateral;
120,计算获得四边形的上下边的长度偏差和左右边的长度偏差,判断是否符合第一预设偏差值;120. Calculate and obtain the length deviation of the upper and lower sides and the length deviation of the left and right sides of the quadrilateral, and determine whether it meets the first preset deviation value;
130,计算获得四边形的左上角与右上角的上角偏差,判断是否符合第二预设偏差值;130. Calculate the upper left corner and the upper right corner of the quadrilateral to obtain the upper corner deviation, and determine whether it meets the second preset deviation value;
140,计算获得四边形的左下角与右下角的下角偏差,判断是否符合第三预设偏差值;140. Calculate and obtain the deviation of the lower left corner and the lower right corner of the quadrilateral, and determine whether it meets the third preset deviation value;
150,分别计算获得四边形的四个内角与九十度的四个内角偏差,判断是否符合第四预设偏差值;150. Calculate and obtain the deviations of the four internal angles of the quadrilateral from the four internal angles of ninety degrees, and determine whether they meet the fourth preset deviation value;
160,计算获得四边形的左边、右边与垂直线的垂直偏差,判断是否符合第五预设偏差值;160. Calculate and obtain the vertical deviation between the left and right sides of the quadrilateral and the vertical line, and determine whether it meets the fifth preset deviation value;
170,计算获得四边形的上边与下边的夹角,判断是否符合预设夹角偏差值。170. Calculate and obtain the included angle between the upper side and the lower side of the quadrilateral, and determine whether it meets the preset included angle deviation value.
需要说明的是,计算目标点组成的四边形的上边、下边与水平线的夹角,如果该夹角大于预设值,则直接返回错误,无法进行后续操作;It should be noted that the angle between the upper and lower edges of the quadrilateral formed by the target point and the horizontal line is calculated. If the angle is greater than the preset value, an error will be returned directly and subsequent operations cannot be performed;
计算四边形相对于标准矩形的偏差度,如果同时满足以下的条件,则认为目标查找正确,返回正确;若是不能同时满足,则进行后续的判断操作:Calculate the deviation of the quadrilateral relative to the standard rectangle. If the following conditions are met at the same time, the target search is considered correct and the return is correct; if it cannot be met at the same time, the subsequent judgment operation is performed:
(1)计算下边与上边长度的偏差值(下边的长度减去上边的长度),该值是否在预设区间,该预设区间可以人为设置;(1) Calculate the deviation value of the length of the lower side and the upper side (the length of the lower side minus the length of the upper side), whether the value is in the preset interval, the preset interval can be set manually;
(2)计算下边与上边长度的偏差值占下边的比例,该值是否小于预设值;预设值可以人为设置;(2) Calculate the ratio of the difference between the length of the lower side and the upper side to the lower side, and whether the value is less than the preset value; the preset value can be set manually;
(3)计算左边与右边长度的偏差绝对值,该绝对值是否小于预设值;同理,该预设值可以人为设置;(3) Calculate the absolute value of the deviation between the left and right lengths, and whether the absolute value is less than the preset value; in the same way, the preset value can be set manually;
(4)计算四边形左上角与右上角大小的偏差绝对值,该绝对值是否小于预设值;同理,该预设值可以人为设置;(4) Calculate the absolute value of the deviation between the upper left corner and the upper right corner of the quadrilateral, and whether the absolute value is less than the preset value; for the same reason, the preset value can be set manually;
(5)计算四边形左下角与右下角大小的偏差绝对值,该绝对值是否小于预设值;同理,该预设值可以人为设置;(5) Calculate the absolute value of the deviation between the lower left corner and the lower right corner of the quadrilateral, and whether the absolute value is less than the preset value; for the same reason, the preset value can be set manually;
(6)计算四个角与90°的偏差绝对值,该绝对值是否小于预设值;同理,该预设值可以人为设置;(6) Calculate the absolute value of the deviation between the four angles and 90°, and whether the absolute value is less than the preset value; for the same reason, the preset value can be set manually;
(7)计算左边、右边与垂直线的夹角的绝对值,该绝对值是否小于预设值;同理,该预设值可以人为设置;(7) Calculate the absolute value of the angle between the left, right and the vertical line, and whether the absolute value is less than the preset value; for the same reason, the preset value can be set manually;
(8)计算上边与下边的夹角的绝对值,判断该绝对值是否小于预设值;同理,该预设值可以人为设置。(8) Calculate the absolute value of the angle between the upper and lower sides, and judge whether the absolute value is less than the preset value; in the same way, the preset value can be set manually.
进一步地,判断第一偏差度是否满足第一偏差度阈值具体包括:Further, determining whether the first deviation degree meets the first deviation degree threshold specifically includes:
当且仅当第一预设偏差值、第二预设偏差值、第三预设偏差值、第四预设 偏差值、第五预设偏差值以及预设夹角值均被满足时,第一偏差度满足第一偏差度阈值。If and only if the first preset deviation value, the second preset deviation value, the third preset deviation value, the fourth preset deviation value, the fifth preset deviation value and the preset included angle value are all satisfied, the first A degree of deviation satisfies the first degree of deviation threshold.
需要说明的是,上述实施例中的判断项目中,只要有一个不满足,则需要进行后续的判断流程;当且仅当前述的判断项目均符合该项的预设值时,才不需要进行后续的判断流程。It should be noted that as long as one of the judgment items in the above embodiment is not satisfied, the subsequent judgment process needs to be carried out; if and only if the aforementioned judgment items meet the preset value of this item, there is no need to proceed. The subsequent judgment process.
进一步地,第二偏差度具体包括:Further, the second degree of deviation specifically includes:
分别计算获得四边形的四条边与图片的四条边的四个边偏差参数;Calculate and obtain the four-side deviation parameters of the four sides of the quadrilateral and the four sides of the picture respectively;
分别计算获得四边形的上边、下边与水平线的夹角,左边、右边与垂直线的夹角偏差值,得到四个角偏差值;Calculate and obtain the angle deviation between the upper and lower sides of the quadrilateral and the horizontal line, and the deviation of the angle between the left and right sides and the vertical line to obtain the deviation values of the four corners;
计算获得四个目标点的四个匹配度分数,根据四个匹配度分数计算获得四个目标点的四个匹配度偏差值;Calculate the four matching scores of the four target points, and calculate the four matching deviation values of the four target points according to the four matching scores;
根据四个边偏差值、四个角偏差值以及四个匹配度偏差值,分别计算出四个目标点的错误分。According to the four edge deviation values, the four corner deviation values and the four matching degree deviation values, the error scores of the four target points are calculated respectively.
需要说明的是,首先,计算获得四边形边长的偏差参数:P 11,P 12,P 13,P 14It should be noted that, first, calculate and obtain the deviation parameters of the side length of the quadrilateral: P 11 , P 12 , P 13 , P 14 ;
例如图4所示的矩形,W与H分别为照片的宽度与高度,而L 1,L 2,L 3,L 4分别为四个目标点所组成的四边形的四边的长度,则有: For example, in the rectangle shown in Figure 4, W and H are the width and height of the photo, and L 1 , L 2 , L 3 , and L 4 are the lengths of the four sides of the quadrilateral formed by the four target points.
Figure PCTCN2019129059-appb-000001
Figure PCTCN2019129059-appb-000001
计算上边、下边与水平线的夹角的绝对值,计算左边、右边与垂直线的夹角的相对值,得到参数P 21,P 22,P 23,P 24Calculate the absolute value of the angle between the upper and lower sides and the horizontal line, and calculate the relative value of the angle between the left, right and the vertical line to obtain the parameters P 21 , P 22 , P 23 , P 24 ;
计算四个目标点的匹配准确度偏差值,即(1-匹配度分数),此处的匹配度分数为目标查找阶段根据特定的目标查找算法计算得到的目标点的分数,数值范围为0~1,分数越高越表示匹配度越高,得到参数P 31,P 32,P 33,P 34。其中,特定的目标查找方法可以为平方差匹配法、相归一化平方差匹配法、相关匹配法、归一化相关匹配法、系数匹配法和归一化相关系数匹配法。 Calculate the matching accuracy deviation value of the four target points, namely (1-matching score), where the matching score is the score of the target point calculated according to the specific target search algorithm in the target search stage, and the value range is 0~ 1. The higher the score, the higher the matching degree, and the parameters P 31 , P 32 , P 33 , and P 34 are obtained . Among them, the specific target search method can be the square difference matching method, the phase normalized square difference matching method, the correlation matching method, the normalized correlation matching method, the coefficient matching method, and the normalized correlation coefficient matching method.
计算各个目标点的错误分:Calculate the error score of each target point:
第一个目标点的错误分为:E 1=P 11+P 13+P 21+P 23+P 31The error of the first target point is divided into: E 1 =P 11 +P 13 +P 21 +P 23 +P 31 ;
第二个目标点的错误分为:E 2=P 11+P 14+P 21+P 24+P 32The error of the second target point is divided into: E 2 =P 11 +P 14 +P 21 +P 24 +P 32 ;
第三个目标点的错误分为:E 3=P 12+P 13+P 22+P 23+P 33The error of the third target point is divided into: E 3 =P 12 +P 13 +P 22 +P 23 +P 33 ;
第四个目标点的错误分为:E 4=P 12+P 14+P 22+P 24+P 34The error of the fourth target point is divided into: E 4 =P 12 +P 14 +P 22 +P 24 +P 34 ;
进一步地,当存在有目标点的第二偏差度不符合第二偏差度阈值时,具体包括:Further, when there is a second deviation degree of the target point that does not meet the second deviation degree threshold, it specifically includes:
将四个目标点的错误分进行从大到小的排序,最大的错误分对应的目标点即为错误目标点。The error scores of the four target points are sorted from largest to smallest, and the target point corresponding to the largest error score is the wrong target point.
需要说明的是,将上述计算步骤中获得的E 1,E 2,E 3,E 4进行从大到小的排序,最大值对应的目标点即为错误码标点,将该点标记为I。 It should be noted that the E 1 , E 2 , E 3 , and E 4 obtained in the above calculation steps are sorted from largest to smallest, and the target point corresponding to the maximum value is the error code punctuation, which is marked as I.
进一步地,在目标点附近获取新的目标点,具体包括:Further, obtaining a new target point near the target point specifically includes:
分别获取除错误目标点以外的三个目标点的三个二维坐标;Obtain the three two-dimensional coordinates of the three target points except the wrong target point respectively;
获取四边形的四个内角的四个角度值;Obtain the four angle values of the four inner corners of the quadrilateral;
根据三个二维坐标值和四个角度值,计算获得新的目标点的二维坐标值。According to the three two-dimensional coordinate values and the four angle values, the two-dimensional coordinate value of the new target point is calculated.
需要说明的是,对上述步骤中获得的I的正确位置进行预测,再在该位置的局部区域内重新查找目标的具体过程为:It should be noted that the specific process of predicting the correct position of I obtained in the above steps, and then re-finding the target in the local area of the position is:
利用另外三个目标点的坐标计算序号为I的目标点的位置,称为预测位置。Use the coordinates of the other three target points to calculate the position of the target point with the serial number I, which is called the predicted position.
设已知4个目标点的坐标分别为(x1,y1),(x2,y2),(x3,y3),(x4,y4),其中x为水平坐标,y为垂直坐标。四边形的四个内角分别为V1,V2,V3,V4,分别为左上角,右上角,左下角,右下角。Suppose the coordinates of the four known target points are (x1, y1), (x2, y2), (x3, y3), (x4, y4), where x is the horizontal coordinate and y is the vertical coordinate. The four inner corners of the quadrilateral are V1, V2, V3, and V4, which are the upper left corner, the upper right corner, the lower left corner, and the lower right corner.
(1)如果I=1,设(x′ 1,y′ 1)为预测的左上角点的位置,则有: (1) If I=1, let (x′ 1 ,y′ 1 ) be the position of the predicted upper left corner point, then:
如果V p1≤V 4≤V p2,则x′ 1=x 3+x 4-x 2;否则,x′ 1=x 2-x 4+x 3If V p1 ≤V 4 ≤V p2 , then x′ 1 =x 3 +x 4 -x 2 ; otherwise, x′ 1 =x 2 -x 4 +x 3 .
另外有y′ 1=y 3-y 4+y 2 In addition, y′ 1 =y 3 -y 4 +y 2
(2)如果I=2,设(x′ 2,y′ 2)为预测的右上角点的位置,则有: (2) If I=2, let (x′ 2 ,y′ 2 ) be the position of the predicted upper right corner point, then:
如果V p1≤V 3≤V p2,则x′ 2=x 4+x 3-x 1;否则,x′ 2=x 4-x 3+x 1If V p1 ≤V 3 ≤V p2 , then x′ 2 =x 4 +x 3 -x 1 ; otherwise, x′ 2 =x 4 -x 3 +x 1 .
另外有y′ 2=y 4-y 3+y 1 In addition, y′ 2 =y 4 -y 3 +y 1
(3)如果I=3,设(x′ 3,y′ 3)为预测的左下角点的位置,则有: (3) If I=3, let (x′ 3 ,y′ 3 ) be the position of the predicted lower left corner point, then:
如果V p1≤V 2≤V p2,则x′ 3=x 1+x 2-x 4;否则,x′ 3=x 4-x 2+x 1 If V p1 ≤V 2 ≤V p2 , then x′ 3 = x 1 + x 2- x 4 ; otherwise, x′ 3 = x 4- x 2 + x 1
另外有y′ 3=y 1+y 4-y 2 In addition, y′ 3 =y 1 +y 4 -y 2
(4)如果I=4,设(x′ 4,y′ 4)为预测的左下角点的位置,则有: (4) If I=4, let (x′ 4 ,y′ 4 ) be the position of the predicted lower left corner point, then:
如果V p1≤V 1≤V p2,则x′ 4=x 1+x 2-x 3;否则,x′ 4=x 3+x 2-x 1 If V p1 ≤V 1 ≤V p2 , then x′ 4 = x 1 + x 2- x 3 ; otherwise, x′ 4 = x 3 + x 2- x 1
另外有y′ 4=y 2+y 3-y 1 In addition, y′ 4 =y 2 +y 3 -y 1
得到的错误目标点的预测位置后,需再用目标查找方法在该预测位置的局 部区域内重新查找目标,该局部区域的范围为以预测位置为中点的方形区域。得到该点的新的查找位置,并与原有的另外三点组成新的四边形,然后再重复以上的判断步骤,直到符合四边形的偏差度的判断条件,认为查找到最终的目标点;如果超过一定的纠正次数后依然不符合要求,则认为错误无法纠正,结束查找及纠正。After obtaining the predicted position of the wrong target point, the target search method needs to be used to find the target again in the local area of the predicted position, and the range of the local area is a square area with the predicted position as the midpoint. Get the new search position of the point, and form a new quad with the original three points, and then repeat the above judgment steps until it meets the judgment conditions of the deviation of the quadrilateral, it is considered that the final target point is found; if it exceeds If it still fails to meet the requirements after a certain number of corrections, it is deemed that the error cannot be corrected, and the search and correction are ended.
为了便于理解,请参见图3,为本申请提供的一种图片目标点纠正装置的结构示意图;For ease of understanding, please refer to FIG. 3, which is a schematic structural diagram of a picture target point correction device provided for this application;
本申请还提供了一种图片目标点纠正装置,包括:This application also provides an image target point correction device, including:
判断第一偏差度模块10,用于获取能组成四边形的四个目标点,计算四边形与标准矩形的第一偏差度,判断第一偏差度是否满足第一偏差度阈值,若否,分别计算四个目标点相对于标准矩形的第二偏差度;The first degree of deviation judgment module 10 is used to obtain four target points that can form a quadrilateral, calculate the first degree of deviation between the quadrilateral and the standard rectangle, and determine whether the first degree of deviation meets the first degree of deviation threshold, and if not, calculate the four points respectively. The second deviation degree of each target point relative to the standard rectangle;
判断第二偏差度模块20,用于当存在有目标点的第二偏差度不符合第二偏差度阈值时,在目标点附近获取新的目标点,并重复计算获得新的第一偏差度和新的第二偏差度。The second degree of deviation judgment module 20 is used to obtain a new target point near the target point when there is a second degree of deviation of the target point that does not meet the second degree of deviation threshold, and repeat the calculation to obtain a new first degree of deviation and The new second degree of deviation.
本申请还提供了一种图片目标点纠正设备,设备包括处理器以及存储器;This application also provides a picture target point correction device, the device including a processor and a memory;
存储器用于存储程序代码,并将程序代码传输给处理器;The memory is used to store the program code and transmit the program code to the processor;
处理器用于根据程序代码中的指令执行上述实施例的图片目标点纠正方法。The processor is configured to execute the image target point correction method of the above embodiment according to the instructions in the program code.
本申请还提供了一种计算机可读存储介质,计算机可读存储介质用于存储程序代码,程序代码用于执行上述实施例的图片目标点纠正方法。The present application also provides a computer-readable storage medium, where the computer-readable storage medium is used to store program code, and the program code is used to execute the method for correcting image target points in the foregoing embodiment.
本申请的说明书及上述附图中的术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、***、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "including" and "having" in the description of this application and the above-mentioned drawings and any variations of them are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or product that includes a series of steps or units. The equipment is not necessarily limited to those clearly listed steps or units, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products, or equipment.
应当理解,在本申请中,“至少一个(项)”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系,例如,“A和/或B”可以表示:只存在A,只存在B以及同时存在A和B三种情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b或c中 的至少一项(个),可以表示:a,b,c,“a和b”,“a和c”,“b和c”,或“a和b和c”,其中a,b,c可以是单个,也可以是多个。It should be understood that in this application, "at least one (item)" refers to one or more, and "multiple" refers to two or more. "And/or" is used to describe the association relationship of associated objects, indicating that there can be three types of relationships, for example, "A and/or B" can mean: only A, only B, and both A and B , Where A and B can be singular or plural. The character "/" generally indicates that the associated objects before and after are in an "or" relationship. "The following at least one item (a)" or similar expressions refers to any combination of these items, including any combination of a single item (a) or a plurality of items (a). For example, at least one of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c" ", where a, b, and c can be single or multiple.
在本申请所提供的几个实施例中,应该理解到,所揭露的***,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个***,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative, for example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or It can be integrated into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(英文全称:Read-Only Memory,英文缩写:ROM)、随机存取存储器(英文全称:RandomAccess Memory,英文缩写:RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (English full name: Read-Only Memory, English abbreviation: ROM), random access memory (English full name: RandomAccess Memory, English abbreviation: RAM), magnetic disk Or various media that can store program codes, such as an optical disc.
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱 离本申请各实施例技术方案的精神和范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions recorded in the embodiments are modified, or some of the technical features are equivalently replaced; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (10)

  1. 一种图片目标点纠正方法,其特征在于,包括:A method for correcting image target points, which is characterized in that it includes:
    获取图片上能组成四边形的四个目标点,计算所述四边形与标准矩形的第一偏差度,判断所述第一偏差度是否满足第一偏差度阈值,若否,分别计算所述四个目标点相对于所述标准矩形的第二偏差度;Obtain four target points that can form a quadrilateral on the picture, calculate the first deviation degree between the quadrilateral and the standard rectangle, determine whether the first deviation degree meets the first deviation degree threshold, and if not, calculate the four targets separately The second degree of deviation of the point relative to the standard rectangle;
    当存在有目标点的第二偏差度不符合第二偏差度阈值时,在所述目标点附近获取新的目标点,并重复计算获得新的第一偏差度和新的第二偏差度。When there is a target point whose second degree of deviation does not meet the second degree of deviation threshold, a new target point is obtained near the target point, and the calculation is repeated to obtain a new first degree of deviation and a new second degree of deviation.
  2. 根据权利要求1所述的图片目标点纠正方法,其特征在于,所述计算所述四边形与标准矩形的第一偏差度之前,还包括:判断是否有任意两个目标点重合,若是,返回错误结果。The method for correcting image target points according to claim 1, wherein before calculating the first degree of deviation between the quadrilateral and the standard rectangle, the method further comprises: determining whether any two target points overlap, and if so, returning an error result.
  3. 根据权利要求1所述的图片目标点纠正方法,其特征在于,所述第一偏差度具体包括:The method for correcting a picture target point according to claim 1, wherein the first degree of deviation specifically comprises:
    将所述四个目标点顺次连接形成所述四边形;Connecting the four target points sequentially to form the quadrilateral;
    计算获得所述四边形的上下边的长度偏差和左右边的长度偏差,判断是否符合第一预设偏差值;Calculate and obtain the length deviation of the upper and lower sides and the length deviation of the left and right sides of the quadrilateral, and determine whether it meets the first preset deviation value;
    计算获得所述四边形的左上角与右上角的上角偏差,判断是否符合第二预设偏差值;Calculating the upper left corner and the upper right corner of the quadrilateral to obtain the upper corner deviation, and judging whether it meets the second preset deviation value;
    计算获得所述四边形的左下角与右下角的下角偏差,判断是否符合第三预设偏差值;Calculate and obtain the deviation of the lower left corner and the lower right corner of the quadrilateral, and determine whether it meets the third preset deviation value;
    分别计算获得所述四边形的四个内角与九十度的四个内角偏差,判断是否符合第四预设偏差值;Calculate and obtain the deviations of the four internal angles of the quadrilateral from the four internal angles of ninety degrees respectively, and determine whether they meet the fourth preset deviation value;
    计算获得所述四边形的左边、右边与垂直线的垂直偏差,判断是否符合第五预设偏差值;Calculate and obtain the vertical deviation between the left and right sides of the quadrilateral and the vertical line, and determine whether it meets the fifth preset deviation value;
    计算获得所述四边形的上边与下边的夹角,判断是否符合预设夹角值。The angle between the upper edge and the lower edge of the quadrilateral is calculated, and it is judged whether it meets the preset angle value.
  4. 根据权利要求3所述的图片目标点纠正方法,其特征在于,所述判断所述第一偏差度是否满足第一偏差度阈值具体包括:The method for correcting a picture target point according to claim 3, wherein the judging whether the first deviation degree meets a first deviation degree threshold specifically comprises:
    当且仅当所述第一预设偏差值、所述第二预设偏差值、所述第三预设偏差值、所述第四预设偏差值、所述第五预设偏差值以及所述预设夹角值均被满足时,所述第一偏差度满足第一偏差度阈值。If and only if the first preset deviation value, the second preset deviation value, the third preset deviation value, the fourth preset deviation value, the fifth preset deviation value and all When the preset included angle values are all satisfied, the first deviation degree meets a first deviation degree threshold.
  5. 根据权利要求1所述的图片目标点纠正方法,其特征在于,所述第二 偏差度具体包括:The method for correcting a picture target point according to claim 1, wherein the second degree of deviation specifically comprises:
    分别计算获得所述四边形的四条边与所述图片的四条边的四个边偏差参数;Respectively calculating and obtaining four side deviation parameters of the four sides of the quadrilateral and the four sides of the picture;
    分别计算获得所述四边形的上边、下边与水平线的夹角,左边、右边与垂直线的夹角偏差值,得到四个角偏差值;Calculate and obtain the angle deviations between the upper and lower sides of the quadrilateral and the horizontal line, and the deviation values of the angles between the left and right sides and the vertical line to obtain the four corner deviation values;
    计算获得所述四个目标点的四个匹配度分数,根据所述四个匹配度分数计算获得所述四个目标点的四个匹配度偏差值;Calculating and obtaining four matching degree scores of the four target points, and calculating and obtaining four matching degree deviation values of the four target points according to the four matching degree scores;
    根据所述四个边偏差值、所述四个角偏差值以及所述四个匹配度偏差值,分别计算出所述四个目标点的错误分。According to the four edge deviation values, the four angle deviation values, and the four matching degree deviation values, the error scores of the four target points are respectively calculated.
  6. 根据权利要求1所述的图片目标点纠正方法,其特征在于,所述当存在有目标点的第二偏差度不符合第二偏差度阈值时,具体包括:The method for correcting a picture target point according to claim 1, wherein when the second degree of deviation of the target point does not meet the second degree of deviation threshold, the method specifically comprises:
    将所述四个目标点的错误分进行从大到小的排序,最大的错误分对应的目标点即为错误目标点。The error scores of the four target points are sorted from large to small, and the target point corresponding to the largest error score is the wrong target point.
  7. 根据权利要求1所述的图片目标点纠正方法,其特征在于,所述在所述目标点附近获取新的目标点,具体包括:The method for correcting a picture target point according to claim 1, wherein the acquiring a new target point near the target point specifically comprises:
    分别获取除错误目标点以外的三个目标点的三个二维坐标;Obtain the three two-dimensional coordinates of the three target points except the wrong target point respectively;
    获取所述四边形的四个内角的四个角度值;Obtaining four angle values of the four inner corners of the quadrilateral;
    根据所述三个二维坐标值和所述四个角度值,计算获得新的目标点的二维坐标值。According to the three two-dimensional coordinate values and the four angle values, the two-dimensional coordinate value of the new target point is calculated.
  8. 一种图片目标点纠正装置,其特征在于,包括:An image target point correction device, which is characterized in that it comprises:
    判断第一偏差度模块,用于获取能组成四边形的四个目标点,计算所述四边形与标准矩形的第一偏差度,判断所述第一偏差度是否满足第一偏差度阈值,若否,分别计算所述四个目标点相对于所述标准矩形的第二偏差度;The first degree of deviation judgment module is used to obtain four target points that can form a quadrilateral, calculate the first degree of deviation between the quadrilateral and the standard rectangle, and determine whether the first degree of deviation meets the first degree of deviation threshold, if not, Respectively calculating the second degree of deviation of the four target points relative to the standard rectangle;
    判断第二偏差度模块,用于当存在有目标点的第二偏差度不符合第二偏差度阈值时,在所述目标点附近获取新的目标点,并重复计算获得新的第一偏差度和新的第二偏差度。The second degree of deviation judgment module is used to obtain a new target point near the target point when the second degree of deviation of the target point does not meet the second degree of deviation threshold, and repeat the calculation to obtain the new first degree of deviation And the new second degree of deviation.
  9. 一种图片目标点纠正设备,其特征在于,所述设备包括处理器以及存储器;A picture target point correction device, characterized in that the device includes a processor and a memory;
    所述存储器用于存储程序代码,并将所述程序代码传输给所述处理器;The memory is used to store program code and transmit the program code to the processor;
    所述处理器用于根据所述程序代码中的指令执行权利要求1-7任一项所述 的图片目标点纠正方法。The processor is configured to execute the method for correcting image target points according to any one of claims 1-7 according to instructions in the program code.
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质用于存储程序代码,所述程序代码用于执行权利要求1-7任一项所述的图片目标点纠正方法。A computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and the program code is used to execute the method for correcting a picture target point according to any one of claims 1-7.
PCT/CN2019/129059 2019-12-27 2019-12-27 Picture target point correction method, apparatus and device, and storage medium WO2021128242A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201980003348.7A CN111108515B (en) 2019-12-27 2019-12-27 Picture target point correcting method, device and equipment and storage medium
PCT/CN2019/129059 WO2021128242A1 (en) 2019-12-27 2019-12-27 Picture target point correction method, apparatus and device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/129059 WO2021128242A1 (en) 2019-12-27 2019-12-27 Picture target point correction method, apparatus and device, and storage medium

Publications (1)

Publication Number Publication Date
WO2021128242A1 true WO2021128242A1 (en) 2021-07-01

Family

ID=70427290

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/129059 WO2021128242A1 (en) 2019-12-27 2019-12-27 Picture target point correction method, apparatus and device, and storage medium

Country Status (2)

Country Link
CN (1) CN111108515B (en)
WO (1) WO2021128242A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113763507A (en) * 2021-08-23 2021-12-07 广州南方卫星导航仪器有限公司 Ground object right angle correction method and system
CN115837576A (en) * 2022-12-27 2023-03-24 联宝(合肥)电子科技有限公司 Inclined plane screw hole locking method and inclined screw locking machine

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115885314A (en) * 2020-10-27 2023-03-31 Oppo广东移动通信有限公司 Image processing method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101860652A (en) * 2009-04-03 2010-10-13 夏普株式会社 Image output device, mobile terminal device, captured image processing system
JP2015114949A (en) * 2013-12-13 2015-06-22 大日本印刷株式会社 Image processor, image processing method, program for image processor, and recording medium
CN106897974A (en) * 2017-01-24 2017-06-27 武汉帝尔激光科技股份有限公司 The contour correction method and system of a kind of fault image

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5545450B2 (en) * 2010-12-07 2014-07-09 株式会社デンソー Face orientation detection device
CN108345881B (en) * 2018-02-01 2021-12-21 福州大学 Document quality detection method based on computer vision

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101860652A (en) * 2009-04-03 2010-10-13 夏普株式会社 Image output device, mobile terminal device, captured image processing system
JP2015114949A (en) * 2013-12-13 2015-06-22 大日本印刷株式会社 Image processor, image processing method, program for image processor, and recording medium
CN106897974A (en) * 2017-01-24 2017-06-27 武汉帝尔激光科技股份有限公司 The contour correction method and system of a kind of fault image

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113763507A (en) * 2021-08-23 2021-12-07 广州南方卫星导航仪器有限公司 Ground object right angle correction method and system
CN113763507B (en) * 2021-08-23 2023-07-21 广州南方卫星导航仪器有限公司 Method and system for correcting ground object right angles
CN115837576A (en) * 2022-12-27 2023-03-24 联宝(合肥)电子科技有限公司 Inclined plane screw hole locking method and inclined screw locking machine

Also Published As

Publication number Publication date
CN111108515B (en) 2021-11-12
CN111108515A (en) 2020-05-05

Similar Documents

Publication Publication Date Title
WO2021128242A1 (en) Picture target point correction method, apparatus and device, and storage medium
US11164323B2 (en) Method for obtaining image tracking points and device and storage medium thereof
EP3680808A1 (en) Augmented reality scene processing method and apparatus, and computer storage medium
US11667036B2 (en) Workpiece picking device and workpiece picking method
US20150169956A1 (en) Object tracking method and device
CN108133492B (en) Image matching method, device and system
US10438412B2 (en) Techniques to facilitate accurate real and virtual object positioning in displayed scenes
KR101656941B1 (en) Method, server and computer program for improving 2d code recognition ratio
CN112233189B (en) Multi-depth camera external parameter calibration method and device and storage medium
CN109325381A (en) The positioning of QR code and correcting algorithm at a kind of view finding pattern lacks one
WO2024130857A1 (en) Article display inspection method and apparatus, and device and readable storage medium
CN112528776A (en) Text line correction method and device
US20180268212A1 (en) Information processing apparatus, information processing system, and non-transitory computer readable medium
CN115533902A (en) Visual guidance-based unstacking method and device, electronic equipment and system
JP2003150940A (en) Stereo image processor
CN111210506A (en) Three-dimensional reduction method, system, terminal equipment and storage medium
CN112634366B (en) Method for generating position information, related device and computer program product
US20150063637A1 (en) Image recognition method and robot
US20230377102A1 (en) Image processing apparatus, image processing method, and non-transitory computer-readable storage medium
WO2018152710A1 (en) Image correction method and device
CN107369150B (en) Method for detecting rectangular target and rectangular target detection device
CN114596220A (en) Method for correcting image lateral chromatic aberration, electronic device and computer storage medium
CN111738253B (en) Fork truck tray positioning method, device, equipment and readable storage medium
JP6781996B1 (en) Image correction processing system
CN112884047B (en) Method for determining registered image in input image, related device and equipment

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: 19957407

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: 19957407

Country of ref document: EP

Kind code of ref document: A1