[go: up one dir, main page]

CN113678163A - Image correction method, device, electronic device and storage medium - Google Patents

Image correction method, device, electronic device and storage medium Download PDF

Info

Publication number
CN113678163A
CN113678163A CN202180001907.8A CN202180001907A CN113678163A CN 113678163 A CN113678163 A CN 113678163A CN 202180001907 A CN202180001907 A CN 202180001907A CN 113678163 A CN113678163 A CN 113678163A
Authority
CN
China
Prior art keywords
deviation
identification
image
preset
camera
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202180001907.8A
Other languages
Chinese (zh)
Other versions
CN113678163B (en
Inventor
刘海军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wentai Technology Shenzhen Co ltd
Original Assignee
Wentai Technology Shenzhen Co ltd
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 Wentai Technology Shenzhen Co ltd filed Critical Wentai Technology Shenzhen Co ltd
Publication of CN113678163A publication Critical patent/CN113678163A/en
Application granted granted Critical
Publication of CN113678163B publication Critical patent/CN113678163B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Studio Devices (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

本公开涉及图像处理技术领域,具体涉及一种图像矫正方法、装置、电子设备和存储介质。其中方法包括:获取摄像头采集的包含四个定位标识的目标图像,其中,所述四个定位标识在物空间中位于标识平面,且依次等间距并环绕排列;确定所述四个定位标识在所述目标图像中的标识位置;根据所述标识位置,对所述目标图像进行矫正。本公开技术方案根据目标图像中的四个定位标识,对目标图像进行自动矫正,提高了取景的精度和效率,保证了取景结果的一致性。

Figure 202180001907

The present disclosure relates to the technical field of image processing, and in particular, to an image correction method, an apparatus, an electronic device and a storage medium. The method includes: acquiring a target image including four positioning marks collected by a camera, wherein the four positioning marks are located on the mark plane in the object space, and are arranged at equal intervals in sequence; The mark position in the target image; according to the mark position, the target image is corrected. The technical solution of the present disclosure automatically corrects the target image according to the four positioning marks in the target image, improves the accuracy and efficiency of framing, and ensures the consistency of framing results.

Figure 202180001907

Description

图像矫正方法、装置、电子设备和存储介质Image correction method, device, electronic device and storage medium

技术领域technical field

本公开实施例涉及一种图像矫正方法、装置、电子设备和存储介质。Embodiments of the present disclosure relate to an image correction method, apparatus, electronic device, and storage medium.

背景技术Background technique

取景是拍摄照片和录像的必要前提动作,而取景本质上是在空间六轴上确定摄像头和目标物体的相对位置,取景直接影响照片和视频质量。Framing is a necessary prerequisite for taking photos and videos, and framing is essentially to determine the relative position of the camera and the target object on the six axes of space, and framing directly affects the quality of photos and videos.

现有的取景主要依靠人眼在取景器或者预览显示屏上实时地去观察照片的内容来微调摄像头的位置,有时依靠激光测距等设备简单判断目标物体的距离。但是,现有的取景存在误差大、效率低和重复性差等问题。The existing viewfinder mainly relies on the human eye to observe the content of the photo in real time on the viewfinder or preview display screen to fine-tune the position of the camera, and sometimes relies on equipment such as laser ranging to simply judge the distance of the target object. However, the existing framing has problems such as large errors, low efficiency and poor repeatability.

发明内容SUMMARY OF THE INVENTION

(一)要解决的技术问题(1) Technical problems to be solved

在现有技术中,拍照取景时存在误差大、效率低和重复性差等问题。In the prior art, there are problems such as large errors, low efficiency and poor repeatability when taking pictures and framing.

(二)技术方案(2) Technical solutions

根据本公开公开的各种实施例,提供了一种图像矫正方法、装置、电子设备和存储介质。According to various embodiments of the present disclosure, an image correction method, apparatus, electronic device, and storage medium are provided.

一种图像矫正方法,所述方法包括:An image correction method, the method comprising:

获取摄像头采集的包含四个定位标识的目标图像,其中,所述四个定位标识在物空间中位于标识平面,且依次等间距并环绕排列;Acquiring a target image including four positioning marks collected by the camera, wherein the four positioning marks are located on the mark plane in the object space, and are arranged at equal intervals and surrounding them in turn;

确定所述四个定位标识在所述目标图像中的标识位置;determining the identification positions of the four positioning marks in the target image;

根据所述标识位置,对所述目标图像进行矫正。The target image is corrected according to the marked position.

一种图像矫正装置,包括:An image correction device, comprising:

图像获取模块,配置成获取摄像头采集的包含四个定位标识的目标图像,其中,所述四个定位标识在物空间中位于标识平面,且依次等间距并环绕排列;an image acquisition module, configured to acquire a target image including four positioning marks collected by the camera, wherein the four positioning marks are located on the mark plane in the object space, and are arranged at equal intervals in turn and in a surrounding arrangement;

标识位置确定模块,配置成确定所述四个定位标识在所述目标图像中的标识位置;an identification position determination module, configured to determine the identification positions of the four positioning marks in the target image;

图像矫正模块,配置成根据所述标识位置,对所述目标图像进行矫正。The image correction module is configured to correct the target image according to the identified position.

一种电子设备,包括存储器和一个或多个处理器,存储器存储有计算机可读指令,一个或多个处理器执行计算机可读指令时实现本公开任意实施例所提供的一种图像矫正方法的步骤。An electronic device includes a memory and one or more processors, the memory stores computer-readable instructions, and when one or more processors execute the computer-readable instructions, an image correction method provided by any embodiment of the present disclosure is implemented. step.

一个或多个存储有计算机可读指令的非易失性计算机可读指令,其上存储有计算机可读指令,计算机可读指令被一个或多个处理器执行时实现本公开任意实施例所提供的一种图像矫正方法的步骤。One or more non-volatile computer-readable instructions storing computer-readable instructions having computer-readable instructions stored thereon that, when executed by one or more processors, implement any of the embodiments of the present disclosure. The steps of an image correction method.

本公开的其他特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见。本公开的目的和其他优点在说明书、权利要求书以及附图中所特别指出的结构来实现和获得。为使本公开的上述目的、特征和优点能更明显易懂,下文特举可选实施例,并配合所附附图,作详细说明如下。Other features and advantages of the present disclosure will be set forth in the description that follows, and in part will become apparent from the description. The objectives and other advantages of the disclosure will be realized and attained by the structure particularly pointed out in the description, claims and drawings. In order to make the above-mentioned objects, features and advantages of the present disclosure more obvious and easy to understand, optional embodiments are exemplified below, and are described in detail as follows in conjunction with the accompanying drawings.

附图说明Description of drawings

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用来解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description serve to explain the principles of the disclosure.

为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the accompanying drawings that are required to be used in the description of the embodiments or the prior art will be briefly introduced below. In other words, on the premise of no creative labor, other drawings can also be obtained from these drawings.

图1为一个或多个实施例中定位标识的示意图;FIG. 1 is a schematic diagram of a positioning marker in one or more embodiments;

图2为一个或多个实施例中一种标识平面的示意图;FIG. 2 is a schematic diagram of an identification plane in one or more embodiments;

图3为一个或多个实施例中一种应用场景的示意图;3 is a schematic diagram of an application scenario in one or more embodiments;

图4为一个或多个实施例中偏差图像与标准图像的示意图;4 is a schematic diagram of a deviation image and a standard image in one or more embodiments;

图5为一个或多个实施例中一种图像矫正方法的流程示意图;5 is a schematic flowchart of an image correction method in one or more embodiments;

图6为一个或多个实施例中一种图像矫正方法的流程示意图;6 is a schematic flowchart of an image correction method in one or more embodiments;

图7为一个或多个实施例中一种像平面与标识平面位置关系的示意图;7 is a schematic diagram of the positional relationship between an image plane and an identification plane in one or more embodiments;

图8为一个或多个实施例中一种投影角度测量的示意图;8 is a schematic diagram of a projection angle measurement in one or more embodiments;

图9为一个或多个实施例中一种图像矫正装置的结构框图;9 is a structural block diagram of an image correction apparatus in one or more embodiments;

图10为一个或多个实施例中电子设备的内部结构图。10 is a diagram of the internal structure of an electronic device in one or more embodiments.

具体实施方式Detailed ways

为了使本公开的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本公开进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本公开,并不用于限定本公开。In order to make the objectives, technical solutions and advantages of the present disclosure more clear, the present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure, but not to limit the present disclosure.

目前,取景主要依靠人眼在取景器或者预览显示屏上实时地去观察照片的内容来微调摄像头的位置。然而,由于人眼观察或者取景器/预览显示屏尺寸的影响,必然带来图像中景物位置的较大误差;而且,需要精确定位时,操作人员需要反复观察调整摄像头,耗时耗力,取景效率低;另外,多次取景结果的一致性是保证图像质量评测的重要前提,但是依靠人眼观察的定位存在着重复性差的缺点。At present, framing mainly relies on the human eye to observe the content of the photo in real time on the viewfinder or preview display screen to fine-tune the position of the camera. However, due to the influence of human eye observation or the size of the viewfinder/preview display screen, it will inevitably bring about a large error in the position of the scene in the image; moreover, when precise positioning is required, the operator needs to observe and adjust the camera repeatedly, which is time-consuming and labor-intensive. The efficiency is low; in addition, the consistency of the results of multiple framing is an important prerequisite for ensuring image quality evaluation, but the positioning relying on human eye observation has the disadvantage of poor repeatability.

针对上述技术问题,本公开实施例通过获取摄像头采集的包含四个定位标识的目标图像,根据四个定位标识在目标图像中标识位置,对目标图像进行矫正,可提高取景的精度和效率,保证取景结果的一致性。In view of the above technical problems, the embodiment of the present disclosure can improve the accuracy and efficiency of framing by acquiring a target image containing four positioning marks collected by a camera, and marking the position in the target image according to the four positioning marks to correct the target image. Consistency of framing results.

本公开实施例涉及的定位标识可以是具有较高对比度以及空间对称性的图形,能够在图像识别中具有较高的抗干扰性,定位标识可以是如图1所示的图形,如定位标识110、定位标识120、定位标识130和定位标识140,对于定位标识的具体图形结构不作限定。The positioning mark involved in the embodiment of the present disclosure may be a graphic with high contrast and spatial symmetry, and can have high anti-interference in image recognition, and the positioning mark may be a graphic as shown in FIG. 1 , such as positioning mark 110 , the positioning mark 120 , the positioning mark 130 and the positioning mark 140 , and the specific graphic structure of the positioning mark is not limited.

本公开实施例中,可以在相对于拍摄目标,在固定空间位置上放置四个定位标识得到标识平面,例如,图2所示的一种标识平面的示意图,采用图1中定位标识120,将四个定位标识120依次等间距环绕放置在物空间中得到标识平面,任意相邻两个定位标识120之间的距离相同。另外,标识平面内的四个定位标识的图形可以相同,也可以不同。In the embodiment of the present disclosure, four positioning marks may be placed at fixed spatial positions relative to the shooting target to obtain a marking plane. For example, for the schematic diagram of a marking plane shown in FIG. 2 , the positioning mark 120 in FIG. The four positioning marks 120 are sequentially placed in the object space at equal intervals to obtain a mark plane, and the distance between any two adjacent positioning marks 120 is the same. In addition, the graphics of the four positioning marks in the identification plane may be the same or different.

本公开实施例提供的图像矫正方法可以由终端或服务器来执行。终端或服务器可以通过目标图像中的四个定位标识的位置,对目标图像进行矫正。The image correction method provided by the embodiment of the present disclosure may be executed by a terminal or a server. The terminal or server can correct the target image through the positions of the four positioning marks in the target image.

例如,在一种应用场景中,如图3所示,服务器32通过目标图像中的四个定位标识的位置,计算目标图像的偏差情况,将目标图像的偏差情况发送至终端31,终端31根据接收到的偏差情况直接对目标图像进行矫正,其中,该目标图像可以是终端31拍摄获得的并发送至服务器32。或者,该目标图像是终端31从其他设备中获取的。再或者,该目标图像是终端31对预设图像进行图像处理后得到的图像,该预设图像可以是终端31拍摄获得的,或者该预设图像可以是终端31从其他设备中获取的。此处,并不对其他设备做具体限定。For example, in an application scenario, as shown in FIG. 3 , the server 32 calculates the deviation of the target image through the positions of the four positioning marks in the target image, and sends the deviation of the target image to the terminal 31, and the terminal 31 according to The received deviation is directly corrected for the target image, where the target image may be captured by the terminal 31 and sent to the server 32 . Alternatively, the target image is acquired by the terminal 31 from other devices. Alternatively, the target image is an image obtained after the terminal 31 performs image processing on the preset image, and the preset image may be obtained by the terminal 31 by shooting, or the preset image may be obtained by the terminal 31 from other devices. Here, other devices are not specifically limited.

在另一种应用场景中,终端31获取目标图像,将目标图像发送至服务器32,服务器32根据目标图像中的四个定位标识的位置,对目标图像进行矫正。In another application scenario, the terminal 31 acquires the target image, and sends the target image to the server 32, and the server 32 corrects the target image according to the positions of the four positioning marks in the target image.

在又一种应用场景中,终端31拍摄获得目标图像,进一步,终端31通过目标图像中的四个定位标识的位置,对目标图像进行矫正。In another application scenario, the terminal 31 captures and obtains the target image, and further, the terminal 31 corrects the target image according to the positions of the four positioning marks in the target image.

在实际取景过程中,由于摄像头与目标物体的相对位置出现偏差,造成摄像头采集的目标图像相对于标准图像出现偏差。本公开实施例中,目标图像相对于标准图像的偏差可包括以下任一种或组合:前后偏差(参考图4中的图像(a));水平偏差(参考图4中的图像(b));垂直偏差(参考图4中的图像(c));旋转偏差(参考图4中的图像(d));左右翻转偏差(参考图4中的图像(e));上下翻转偏差(参考图4中的图像(f))。另外,图4中的图像(o)为标准图像。本公开实施例中,当摄像头采集的目标图像出现前后偏差、水平偏差、垂直偏差和旋转偏差中的至少一种偏差时,摄像头的像平面仍与标识平面平行,而当摄像头采集的目标图像出现左右翻转偏差或上下翻转偏差等翻转偏差时,摄像头的像平面与标识平面相交。本公开技术方案可针对上述任一偏差或组合偏差进行计算,从而对目标图像进行矫正,得到标准图像。During the actual viewing process, due to the deviation of the relative positions of the camera and the target object, the target image collected by the camera is deviated from the standard image. In the embodiment of the present disclosure, the deviation of the target image relative to the standard image may include any one or a combination of the following: front-to-back deviation (refer to image (a) in FIG. 4 ); horizontal deviation (refer to image (b) in FIG. 4 ) ; Vertical deviation (refer to image (c) in Figure 4); Rotational deviation (refer to image (d) in Figure 4); Left and right flip deviation (refer to Figure 4 (e)); Up and down flip deviation (refer to Figure 4 Image in 4 (f)). In addition, the image (o) in FIG. 4 is a standard image. In the embodiment of the present disclosure, when the target image collected by the camera has at least one deviation among front and rear deviation, horizontal deviation, vertical deviation and rotation deviation, the image plane of the camera is still parallel to the marking plane, and when the target image collected by the camera appears When there is a flip deviation such as left-right flip deviation or up-down flip deviation, the image plane of the camera intersects with the marking plane. The technical solution of the present disclosure can calculate any of the above deviations or a combination of deviations, so as to correct the target image and obtain a standard image.

在一个实施例中,如图5所示,提供了一种图像矫正方法,该图像矫正方法适用于摄像头与目标物体的相对位置的精确定位的情况,可应用于自动光学检测和机器视觉等拍摄场景。本实施例以该方法应用于终端进行举例说明,该终端可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备。图像矫正方法包括如图5所示的以下步骤:In one embodiment, as shown in FIG. 5 , an image correction method is provided. The image correction method is suitable for the precise positioning of the relative position of the camera and the target object, and can be applied to automatic optical detection and machine vision shooting. Scenes. This embodiment is exemplified by applying the method to a terminal, and the terminal may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The image correction method includes the following steps as shown in Figure 5:

S510:获取摄像头采集的包含四个定位标识的目标图像。S510: Acquire a target image including four positioning marks collected by the camera.

可选的,四个定位标识在物空间中位于标识平面,且依次等间距并环绕排列。Optionally, the four positioning marks are located on the mark plane in the object space, and are arranged at equal intervals in sequence and in a surrounding arrangement.

可理解的,相对于拍摄目标(目标物体),在物空间(实际空间)中的固定空间位置上放置四个定位标识,参考图2所示的标识平面中四个定位标识的位置,在摄像头与拍摄目标存在一定距离(物距)的情况下,通过摄像头采集包括四个定位标识以及拍摄目标的信息生成目标图像。本公开实施例不限于通过拍摄照片获取目标图像,也可以通过预览截屏和录像等方式获取目标图像。Understandably, relative to the shooting target (target object), four positioning marks are placed at fixed spatial positions in the object space (actual space), referring to the positions of the four positioning marks in the mark plane shown in FIG. When there is a certain distance (object distance) from the shooting target, a target image is generated by collecting information including four positioning marks and the shooting target through the camera. The embodiments of the present disclosure are not limited to acquiring the target image by taking a photo, and the target image may also be acquired by means of previewing screenshots and video recordings.

S520:确定四个定位标识在目标图像中的标识位置。S520: Determine the marker positions of the four positioning markers in the target image.

可理解的,在上述S510的基础上,可以利用图像处理算法计算出四个定位标识在目标图像中的标识位置,其中,标识位置包括四个定位标识在目标图像中的具体位置信息,如四个定位标识在目标图像的直角坐标系下的坐标。Understandably, on the basis of the above S510, the image processing algorithm can be used to calculate the identification positions of the four positioning marks in the target image, wherein the identification positions include the specific position information of the four positioning marks in the target image, such as four positioning marks. The coordinates of a positioning marker in the Cartesian coordinate system of the target image.

S530:根据标识位置,对目标图像进行矫正。S530: Correct the target image according to the marked position.

本公开实施例中,四个定位标识用于定位摄像头与其所拍摄的目标物体的相对位置,从而根据四个定位标识的标识位置即可确定摄像头与目标物体的相对位置,进而通过矫正标识位置即可矫正摄像头与目标物体的相对位置,实现对目标图像的矫正,以得到目标图像对应的标准图像。In the embodiment of the present disclosure, the four positioning marks are used to locate the relative positions of the camera and the target object captured by the camera, so that the relative positions of the camera and the target object can be determined according to the mark positions of the four positioning marks, and then the relative positions of the camera and the target object can be determined by correcting the mark positions, namely The relative position of the camera and the target object can be corrected, and the target image can be corrected to obtain a standard image corresponding to the target image.

在上述实施例中,通过获取摄像头采集的包含四个定位标识的目标图像,其中,四个定位标识在物空间中位于标识平面,且依次等间距并环绕排列;确定四个定位标识在目标图像中的标识位置;根据标识位置,对目标图像进行矫正。本公开技术方案通过在目标物体上预先设置四个定位标识,采用摄像头获取包含上述四个定位标识的目标物体对应的目标图像,根据四个定位标识在目标图像中的标识位置即可确定拍摄的目标物体的偏差情况,从而根据标识位置对目标图像进行快速矫正,提高了取景的精度和效率,保证了取景结果的一致性。In the above-mentioned embodiment, the target image containing four positioning marks collected by the camera is acquired, wherein the four positioning marks are located on the mark plane in the object space, and are arranged at equal intervals in sequence; The mark position in the mark; according to the mark position, the target image is corrected. According to the technical solution of the present disclosure, four positioning marks are preset on the target object, and a camera is used to obtain a target image corresponding to the target object containing the above four positioning marks, and the photographed image can be determined according to the mark positions of the four positioning marks in the target image. The deviation of the target object can be quickly corrected according to the marked position, which improves the accuracy and efficiency of the framing and ensures the consistency of the framing results.

在一个实施例中,如图6所示,提供了一种图像矫正方法,本实施例中,根据标识位置,对目标图像进行矫正,包括如图6所示的以下步骤:In one embodiment, as shown in Figure 6, an image correction method is provided. In this embodiment, according to the identification position, the target image is corrected, including the following steps as shown in Figure 6:

S610:根据标识位置,确定标识偏差。S610: Determine the mark deviation according to the mark position.

其中,标识偏差用于表征目标图像与标准图像之间的偏差,标准图像是预先拍摄的满足取景需求的图像,作为矫正目标图像的参考图像。可选的,标识偏差包括前后偏差、垂直偏差、水平偏差、旋转偏差和翻转偏差中的至少一种,即标识偏差可以是前后偏差、垂直偏差、水平偏差、旋转偏差或翻转偏差,也可以是前后偏差、垂直偏差、水平偏差、旋转偏差和翻转偏差中两种或两种以上的组合。在本公开实施例中,前后偏差是指目标图像相对于标准图像出现放大或缩小,但成像面与标识平面平行,实际拍摄中体现在摄像头的主光轴与标识平面垂直的情况下,摄像头正对目标物体,且摄像头沿其主光轴移动时距离目标物体过近或过远;垂直偏差是指目标图像相对于标准图像出现上下偏移,但成像面与标识平面平行,实际拍摄中体现在摄像头的主光轴与标识平面垂直的情况下,摄像头未正对目标物体,且相对于目标物体向上或向下平移;水平偏差是指目标图像相对于标准图像出现左右偏移,但成像面与标识平面平行,实际拍摄中体现在摄像头的主光轴与标识平面垂直的情况下,摄像头未正对目标物体,且相对于目标物体向左或向右平移;旋转偏差是指目标图像相对于标准图像出现逆时针或顺时针旋转,但成像面与标识平面平行,实际拍摄中体现在摄像头的主光轴与标识平面垂直的情况下,摄像头正对目标物体,且摄像头绕其主光轴顺时针或逆时针旋转;翻转偏差是指目标图像相对于标准图像出现翻转,成像面与标识平面相交,实际拍摄中体现在摄像头的主光轴与标识平面不垂直的情况下,摄像头对目标物体进行拍摄,即摄像头以一定的倾斜角度拍摄目标物体。The identification deviation is used to represent the deviation between the target image and the standard image, and the standard image is a pre-shot image that meets the framing requirements and is used as a reference image for correcting the target image. Optionally, the identification deviation includes at least one of front and rear deviation, vertical deviation, horizontal deviation, rotation deviation and flip deviation, that is, the identification deviation may be front and rear deviation, vertical deviation, horizontal deviation, rotation deviation or flip deviation, or it may be A combination of two or more of front-to-back bias, vertical bias, horizontal bias, rotational bias, and flip bias. In the embodiment of the present disclosure, the front-to-back deviation means that the target image is enlarged or reduced relative to the standard image, but the imaging plane is parallel to the marking plane. For the target object, and the camera is too close or too far from the target object when moving along its main optical axis; vertical deviation refers to the vertical deviation of the target image relative to the standard image, but the imaging surface is parallel to the marking plane, which is reflected in the actual shooting. When the main optical axis of the camera is perpendicular to the marking plane, the camera is not facing the target object, and it translates up or down relative to the target object; horizontal deviation refers to the left and right deviation of the target image relative to the standard image, but the imaging plane is different from the standard image. The marking plane is parallel. In actual shooting, when the main optical axis of the camera is perpendicular to the marking plane, the camera is not facing the target object, and it translates to the left or right relative to the target object; the rotation deviation refers to the target image relative to the standard The image rotates counterclockwise or clockwise, but the imaging surface is parallel to the marking plane. In actual shooting, the camera is facing the target object when the main optical axis of the camera is perpendicular to the marking plane, and the camera is clockwise around its main optical axis. Or rotate counterclockwise; Flip deviation means that the target image is flipped relative to the standard image, and the imaging plane intersects the marking plane. In actual shooting, the camera shoots the target object when the main optical axis of the camera is not perpendicular to the marking plane. , that is, the camera shoots the target object at a certain tilt angle.

可选的,根据标识位置,确定标识偏差,包括S611和S612:Optionally, determine the mark deviation according to the mark position, including S611 and S612:

S611:根据标识位置,确定摄像头的像平面与标识平面的位置关系。S611: Determine the positional relationship between the image plane of the camera and the identification plane according to the identification position.

其中,位置关系包括像平面与标识平面平行或相交。像平面是指摄像头采集到的目标图像所在的平面。可理解的,该位置关系是摄像头采集目标图像时的像平面与标识平面的位置关系。The positional relationship includes the image plane being parallel to or intersecting with the marking plane. The image plane refers to the plane where the target image captured by the camera is located. Understandably, the positional relationship is the positional relationship between the image plane and the identification plane when the camera captures the target image.

在本实施例一实施方案中,当由标识位置确定的第一组对边长度相等,且由标识位置确定的第二组对边长度相等时,像平面与标识平面平行;当由标识位置确定的第一组对边长度和第二组对边长度中的任一组对边长度不相等时,像平面与标识平面相交。In an implementation of this embodiment, when the lengths of the first set of opposite sides determined by the marking positions are equal, and the lengths of the second set of opposite sides determined by the marking positions are equal, the image plane is parallel to the marking plane; When the lengths of any one of the first group of opposite sides and the second group of opposite sides are not equal, the image plane intersects with the identification plane.

具体的,四个定位标识在排列方向上依次包括第一定位标识、第二定位标识、第三定位标识和第四定位标识。根据标识位置,采用两点间距离算法可确定第一定位标识与第二定位标识之间的第一成像距离、第二定位标识与第三定位标识之间的第二成像距离、第三定位标识与第四定位标识之间的第三成像距离以及第四定位标识与第一定位标识之间的第四成像距离。其中,第一成像距离和第三成像距离对应的边为第一组对边,第二成像距离和第四成像距离对应的边为第二组对边。由此,当第一成像距离与第三成像距离相等,且第二成像距离与第四成像距离相等时,像平面与标识平面平行;当第一成像距离与第三成像距离不相等时,或第二成像距离与第四成像距离不相等时,像平面与标识平面相交。Specifically, the four positioning marks sequentially include a first positioning mark, a second positioning mark, a third positioning mark and a fourth positioning mark in the arrangement direction. According to the location of the marker, the distance algorithm between the two points can be used to determine the first imaging distance between the first location marker and the second location marker, the second imaging distance between the second location marker and the third location marker, and the third location marker. The third imaging distance between the fourth positioning mark and the fourth positioning mark and the fourth imaging distance between the fourth positioning mark and the first positioning mark. The sides corresponding to the first imaging distance and the third imaging distance are the first group of opposite sides, and the sides corresponding to the second imaging distance and the fourth imaging distance are the second group of opposite sides. Thus, when the first imaging distance is equal to the third imaging distance, and the second imaging distance is equal to the fourth imaging distance, the image plane is parallel to the marking plane; when the first imaging distance and the third imaging distance are not equal, or When the second imaging distance is not equal to the fourth imaging distance, the image plane intersects the marking plane.

示例性的,参考图7,710表示的是像平面712与标识平面711平行,也就是摄像头713放置在标识平面711的正前方,摄像头713在标识平面711中四个定位标识对角连线的交点的正前方,也就是图中虚线与标识平面711垂直,摄像头713在像平面712生成目标图像,像平面712包括目标图像,此时,四个定位标识之间确定的成像距离相等,可以将生成的目标图像看作是标识平面缩小后的图像。720表示的是像平面721与标识平面711相交,摄像头713的镜头与标识平面711存在倾斜角度,也就是摄像头713的主光轴与标识平面711不垂直,摄像头713对应的像平面721中四个定位标识的位置相对于标识平面711也发生了倾斜,此时,四个定位标识在目标图像中的位置相比较于标识平面中四个定位标识的位置发生了倾斜。图7中目标图像中的四个定位标识分别为第一定位标识P1'、第二定位标识P2'、第三定位标识P3'和第四定位标识P4'。此时,根据P1'和P2'的位置可计算出第一成像距离,根据P2'和P3'的位置可计算出第二成像距离,根据P3'和P4'的位置可计算出第三成像距离,根据P4'和P1'的位置可计算出第四成像距离。Exemplarily, referring to FIG. 7 , 710 shows that the image plane 712 is parallel to the marking plane 711 , that is, the camera 713 is placed directly in front of the marking plane 711 , and the camera 713 is located in the marking plane 711 on the diagonal connection of the four positioning marks. Right in front of the intersection, that is, the dotted line in the figure is perpendicular to the marking plane 711, the camera 713 generates a target image on the image plane 712, and the image plane 712 includes the target image. At this time, the imaging distances determined between the four positioning marks are equal, and the The generated target image is regarded as a reduced image of the identification plane. 720 represents the intersection of the image plane 721 and the identification plane 711, the lens of the camera 713 and the identification plane 711 have an inclination angle, that is, the main optical axis of the camera 713 is not perpendicular to the identification plane 711, and four of the image planes 721 corresponding to the camera 713 The positions of the positioning marks are also inclined with respect to the mark plane 711. At this time, the positions of the four positioning marks in the target image are inclined compared with the positions of the four positioning marks in the mark plane. The four positioning marks in the target image in FIG. 7 are respectively a first positioning mark P 1 ′, a second positioning mark P 2 ′, a third positioning mark P 3 ′ and a fourth positioning mark P 4 ′. At this time, the first imaging distance can be calculated according to the positions of P 1 ' and P 2 ', the second imaging distance can be calculated according to the positions of P 2 ' and P 3 ', and the second imaging distance can be calculated according to the positions of P 3 ' and P 4 '. The third imaging distance is calculated, and the fourth imaging distance can be calculated according to the positions of P 4 ′ and P 1 ′.

S612:根据位置关系和标识位置,确定标识偏差。S612: Determine the mark deviation according to the positional relationship and the mark position.

本实施例先根据标识位置确定位置关系,在位置关系确定的情况下再根据标识位置来确定标识偏差,可提高标识偏差判定的效率和准确性。例如,在直接根据标识位置确定标识偏差时,如果标识位置确定的两个定位标识之间的距离不等于标准距离,则标识偏差可能为前后偏差,也可能为翻转偏差,需要进一步判定标识偏差。而在位置关系确定的情况下,例如位置关系为像平面与标识平面平行,那么上述情况的标识偏差只能为前后偏差,位置关系为像平面与标识平面相交,那么上述情况的标识偏差只能为翻转偏差。In this embodiment, the positional relationship is first determined according to the position of the mark, and when the positional relationship is determined, the mark deviation is determined according to the mark position, which can improve the efficiency and accuracy of the identification deviation determination. For example, when the identification deviation is directly determined according to the identification position, if the distance between the two positioning marks determined by the identification position is not equal to the standard distance, the identification deviation may be a front-to-back deviation or a flip deviation, and further determination of the identification deviation is required. In the case where the positional relationship is determined, for example, the positional relationship is that the image plane is parallel to the marking plane, then the marking deviation in the above situation can only be the front-to-back deviation, and the positional relationship is that the image plane and the marking plane intersect, then the marking deviation in the above situation can only be is the inversion deviation.

具体的,以像平面中的目标像点为原点,建立直角坐标系,直角坐标系的x轴平行于预设标准位置确定的第一边,直角坐标系的y轴平行于预设标准位置确定的第二边,预设标准位置为四个定位标识在标准图像中的位置;在直角坐标系下,确定四个定位标识在目标图像中的标识坐标以及在标准图像中的标准坐标。其中,目标像点可以位于摄像头的像平面的左下角,使得其他像点全部位于直角坐标系的第一象限,即横坐标和纵坐标均为正值,便于计算。参考图4,标准图像(o)中的四个定位标识P1”、P2”、P3”和P4”,P1”和P2”连接形成的边P1”P2”为预设标准位置确定的第一边,P2”和P3”连接形成的边P2”P3”为预设标准位置确定的第二边。Specifically, a rectangular coordinate system is established with the target image point in the image plane as the origin, the x-axis of the rectangular coordinate system is parallel to the first side determined by the preset standard position, and the y-axis of the rectangular coordinate system is determined parallel to the preset standard position On the second side of , the preset standard position is the position of the four positioning marks in the standard image; in the Cartesian coordinate system, the identification coordinates of the four positioning marks in the target image and the standard coordinates in the standard image are determined. The target image point can be located at the lower left corner of the image plane of the camera, so that all other image points are located in the first quadrant of the rectangular coordinate system, that is, the abscissa and the ordinate are both positive values, which is convenient for calculation. Referring to FIG. 4 , the four positioning marks P 1 ”, P 2 ”, P 3 ” and P 4 ” in the standard image (o), the edge P 1 ” and P 2 ” formed by the connection of P 1 ” and P 2 ” are pre- Let the first side determined by the standard position and the side P 2 ”P 3 ” formed by connecting P 2 ” and P 3 ” be the second side determined by the preset standard position.

相应的,根据位置关系和标识位置,确定标识偏差,包括如下至少一个:Correspondingly, the identification deviation is determined according to the positional relationship and the identification position, including at least one of the following:

当像平面与标识平面平行,且由标识坐标确定的两点之间距离,不等于由标准坐标确定的对应两点之间距离时,确定标识偏差为前后偏差;When the image plane is parallel to the marking plane, and the distance between the two points determined by the marking coordinates is not equal to the distance between the corresponding two points determined by the standard coordinates, the marking deviation is determined as the front and rear deviation;

当像平面与标识平面平行,且由标识坐标确定的纵坐标平均值,不等于由标准坐标确定的纵坐标平均值时,确定标识偏差为垂直偏差;When the image plane is parallel to the marking plane, and the average value of the ordinate determined by the marking coordinates is not equal to the average value of the ordinate determined by the standard coordinates, the marking deviation is determined to be the vertical deviation;

当像平面与标识平面平行,且由标识坐标确定的横坐标平均值,不等于由标准坐标确定的横坐标平均值时,确定标识偏差为水平偏差;When the image plane is parallel to the marking plane, and the average abscissa determined by the marking coordinates is not equal to the average abscissa determined by the standard coordinates, the marking deviation is determined as a horizontal deviation;

当像平面与标识平面平行,且经过由标识坐标确定的第一组对边的中点的直线,与y轴相交,或者经过由标识坐标确定的第二组对边的中点的直线,与x轴相交时,确定标识偏差为旋转偏差;When the image plane is parallel to the marking plane, and a line passing through the midpoints of the first set of opposite sides determined by the marking coordinates intersects the y-axis, or a straight line passing through the midpoints of the second set of opposite sides determined by the marking coordinates, and When the x-axis intersects, the identification deviation is determined as the rotation deviation;

当像平面与标识平面相交,且由标识坐标确定的第一组对边不相等,或者由标识坐标确定的第二组对边不相等时,确定标识偏差为翻转偏差。When the image plane and the mark plane intersect, and the first group of opposite sides determined by the mark coordinates are not equal, or the second group of opposite sides determined by the mark coordinates are not equal, the mark deviation is determined as a flip deviation.

示例性的,参考图4,目标图像(a)中,由P1'和P2'的坐标确定P1'和P2'之间的距离P1'P2',标准图像(o)中,由对应的P1”和P2”的坐标确定P1”和P2”之间的距离P1”P2”,当P1'P2'不等于P1”P2”时,确定标识偏差为前后偏差。具体的,前后偏差可包括向前平移偏差或向后平移偏差,当P1'P2'大于P1”P2”时,为向前平移偏差,即摄像头距离目标物体过近;当P1'P2'小于P1”P2””时,为向后平移偏差,即摄像头距离目标物体过远。Exemplarily, referring to FIG. 4, in the target image (a), the distance P 1 'P 2 ' between P 1 ' and P 2 ' is determined by the coordinates of P 1 ' and P 2 ', in the standard image (o) , the distance P 1 ”P 2 ” between P 1 ” and P 2 ” is determined by the coordinates of the corresponding P 1 ” and P 2 ”, when P 1 'P 2 ' is not equal to P 1 ”P 2 ”, determine the distance P 1 ”P 2 ” The deviation is identified as the front-to-back deviation. Specifically, the front-to-back deviation may include forward translation deviation or backward translation deviation. When P 1 'P 2 ' is greater than P 1 'P 2 ', it is forward translation deviation, that is, the camera is too close to the target object; when P 1 When 'P 2 ' is smaller than P 1 ”P 2 ””, it is the backward translation deviation, that is, the camera is too far from the target object.

参考图4,由目标图像(c)中P1'、P2'、P3'和P4'的坐标确定的纵坐标平均值,不等于由标准图像(o)中P1”、P2”、P3”和P4”的坐标确定的纵坐标平均值时,确定标识偏差为垂直偏差。具体的,垂直偏差包括向上平移偏差或向下平移偏差,当P1'、P2'、P3'和P4'的坐标确定的纵坐标平均值,大于P1”、P2”、P3”和P4”的坐标确定的纵坐标平均值时,为向上平移偏差,即摄像头相对于目标物体向下偏移;当P1'、P2'、P3'和P4'的坐标确定的纵坐标平均值,小于P1”、P2”、P3”和P4”的坐标确定的纵坐标平均值时,为向下平移偏差,即摄像头相对于目标物体向上偏移。Referring to FIG. 4 , the average value of the ordinate determined by the coordinates of P 1 ′, P 2 ′, P 3 ′ and P 4 ′ in the target image (c) is not equal to that of P 1 ″, P 2 in the standard image (o) ”, P 3 ” and P 4 ” are determined as the average value of the ordinates, and the identification deviation is determined as the vertical deviation. Specifically, the vertical deviation includes an upward translation deviation or a downward translation deviation. When the average value of the ordinate determined by the coordinates of P 1 ', P 2 ', P 3 ' and P 4 ' is greater than that of P 1 ', P 2 '', P 4 ' When the average value of the ordinates determined by the coordinates of 3 ” and P 4 ” is the upward translation deviation, that is, the camera is shifted downward relative to the target object; when the coordinates of P 1 ', P 2 ', P 3 ' and P 4 ' When the determined average value of the ordinate is smaller than the average value of the ordinate determined by the coordinates of P 1 ”, P 2 ”, P 3 ” and P 4 ”, it is the downward translation deviation, that is, the camera is shifted upward relative to the target object.

参考图4,由目标图像(b)中P1'、P2'、P3'和P4'的坐标确定的横坐标平均值,不等于由标准图像(o)中P1”、P2”、P3”和P4”的坐标确定的横坐标平均值时,确定标识偏差为水平偏差。具体的,水平偏差包括向左平移偏差或向右平移偏差,当P1'、P2'、P3'和P4'的坐标确定的横坐标平均值,大于P1”、P2”、P3”和P4”的坐标确定的横坐标平均值时,为向右平移偏差,即摄像头相对于目标物体向左偏移;当P1'、P2'、P3'和P4'的坐标确定的横坐标平均值,小于P1”、P2”、P3”和P4”的坐标确定的横坐标平均值时,为向左平移偏差,即摄像头相对于目标物体向右偏移。Referring to Fig. 4, the average value of the abscissa determined by the coordinates of P 1 ', P 2 ', P 3 ' and P 4 ' in the target image (b) is not equal to that of P 1 ″, P 2 in the standard image (o) When the average value of the abscissa determined by the coordinates of ”, P 3 ” and P 4 ” is determined, the identification deviation is determined as the horizontal deviation. Specifically, the horizontal deviation includes leftward translation deviation or rightward translation deviation. When the average value of the abscissa determined by the coordinates of P 1 ', P 2 ', P 3 ' and P 4 ' is greater than that of P 1 ', P 2 '', When the average value of the abscissa determined by the coordinates of P 3 ” and P 4 ” is the right translation deviation, that is, the camera is shifted to the left relative to the target object; when P 1 ', P 2 ', P 3 ' and P 4 ' When the average value of the abscissa determined by the coordinates of P 1 ”, P 2 ”, P 3 ” and P 4 ” is smaller than the average value of the abscissa determined by the coordinates of P 1 ”, P 2 ”, P 3 ” and P 4 ”, it is the translation deviation to the left, that is, the camera is offset to the right relative to the target object. shift.

参考图4,在目标图像(d)中,由P1'和P2'的坐标确定的边P1'P2'与由P3'和P4'的坐标确定的边P3'P4'为第一组对边,由P2'和P3'的坐标确定的边P2'P3'与由P4'和P1'的坐标确定的边P4'P1'为第二组对边,经过P1'P2'的中点以及P3'P4'的中点的直线为经过第一组对边的中点的直线,经过P2'P3'的中点以及P4'P1'的中点的直线为经过第二组对边的中点的直线;当经过第一组对边的中点的直线与y轴相交,或者经过第二组对边的中点的直线与x轴相交时,确定标识偏差为旋转偏差。具体的,旋转偏差包括逆时针旋转偏差或顺时针旋转偏差。示例性的,以经过第一组对边的中点的直线与y轴相交为例进行说明。假设逆时针方向为正方向,当经过第一组对边的中点的直线与y轴的夹角大于0时,为逆时针旋转偏差,即摄像头相对于目标物体顺时针旋转;当经过第一组对边的中点的直线与y轴的夹角小于0时,为顺时针旋转偏差,即摄像头相对于目标物体逆时针旋转。Referring to FIG. 4 , in the target image (d), the side P 1 'P 2 ' determined by the coordinates of P 1 ' and P 2 ' and the side P 3 'P 4 determined by the coordinates of P 3 ' and P 4 '' is the first set of opposite sides, the side P 2 'P 3 ' determined by the coordinates of P 2 ' and P 3 ' and the side P 4 'P 1 ' determined by the coordinates of P 4 ' and P 1 ' are the second The line passing through the midpoint of P 1 'P 2 ' and the mid point of P 3 'P 4 ' is the line passing through the mid point of the first set of opposite sides, passing through the mid point of P 2 'P 3 ' and The straight line at the midpoint of P 4 'P 1 ' is the straight line passing through the midpoint of the second set of opposite sides; when the straight line passing through the midpoint of the first set of opposite sides intersects the y-axis, or the line passing through the midpoint of the second set of opposite sides When the line of the point intersects the x-axis, the identification deviation is determined as the rotation deviation. Specifically, the rotation deviation includes a counterclockwise rotation deviation or a clockwise rotation deviation. Exemplarily, the description will be given by taking the line passing through the midpoint of the first pair of opposite sides intersecting the y-axis as an example. Assuming that the counterclockwise direction is the positive direction, when the angle between the straight line passing through the midpoint of the first group of opposite sides and the y-axis is greater than 0, it is a counterclockwise rotation deviation, that is, the camera rotates clockwise relative to the target object; When the angle between the midpoint of the opposite side of the group and the y-axis is less than 0, it is a clockwise rotation deviation, that is, the camera rotates counterclockwise relative to the target object.

另外,翻转偏差包括左右翻转偏差和/或上下翻转偏差。参考图4,在目标图像(e)中,由P2'和P3'的坐标确定的边P2'P3'与由P4'和P1'的坐标确定的边P4'P1'为第二组对边,当P2'P3'和P4'P1'不相等时,为左右翻转偏差。具体的,左右翻转偏差包括向左翻转偏差或向右翻转偏差,当P2'P3'大于P4'P1'时,为向左翻转偏差,即摄像头相对于目标物体向左翻转;当当P2'P3'小于P4'P1'时,为向右翻转偏差,即摄像头相对于目标物体向右翻转。在目标图像(f)中,由P1'和P2'的坐标确定的边P1'P2'与由P3'和P4'的坐标确定的边P3'P4'为第一组对边,当P1'P2'和P3'P4'不相等时,为上下翻转偏差。具体的,上下翻转偏差包括向上翻转偏差或向下翻转偏差,当P1'P2'大于P3'P4'时,为向下翻转偏差,即摄像头相对于目标物体向下翻转;当P1'P2'小于P3'P4'时,为向上翻转偏差,即摄像头相对于目标物体向上翻转。In addition, the rollover deviation includes a left-right rollover deviation and/or an up-down rollover deviation. Referring to FIG. 4 , in the target image (e), the side P 2 'P 3 ' determined by the coordinates of P 2 ' and P 3 ' and the side P 4 'P 1 determined by the coordinates of P 4 ' and P 1 '' is the second group of opposite sides, when P 2 'P 3 ' and P 4 'P 1 ' are not equal, it is the left-right flip deviation. Specifically, the left-right flip deviation includes the left flip deviation or the right flip deviation. When P 2 'P 3 ' is greater than P 4 'P 1 ', it is the left flip deviation, that is, the camera flips to the left relative to the target object; When P 2 'P 3 ' is less than P 4 'P 1 ', it is a right flip deviation, that is, the camera flips to the right relative to the target object. In the target image (f), the edge P 1 'P 2 ' determined by the coordinates of P 1 ' and P 2 ' and the edge P 3 'P 4 ' determined by the coordinates of P 3 ' and P 4 ' are the first On the opposite side of the group, when P 1 'P 2 ' and P 3 'P 4 ' are not equal, it is the upside-down deviation. Specifically, the up-down flip deviation includes flip-up deviation or flip-down deviation. When P 1 'P 2 ' is greater than P 3 'P 4 ', it is flip-down deviation, that is, the camera flips down relative to the target object; when P 1 'P 2 ' is greater than P 3 'P 4 ' When 1 'P 2 ' is smaller than P 3 'P 4 ', it is the upward flip deviation, that is, the camera flips upward relative to the target object.

S620:根据标识偏差,对目标图像进行矫正。S620: Correct the target image according to the mark deviation.

在本公开实施例中,通过调节摄像头的位姿和/或目标物体的位姿,实现对目标图像的矫正。即根据标识偏差,调节摄像头的位姿和/或目标物体的位姿,直至标识偏差满足预设偏差条件,其中,四个标识位于目标物体上,从而依据标识偏差即可矫正目标图像。预设偏差条件为标识偏差符合取景要求,该预设偏差条件可根据不同的应用场景适应设置。优选的,预设偏差条件为标识偏差不存在。In the embodiment of the present disclosure, the correction of the target image is realized by adjusting the pose of the camera and/or the pose of the target object. That is, according to the mark deviation, the pose of the camera and/or the target object is adjusted until the mark deviation meets the preset deviation condition, wherein four marks are located on the target object, so that the target image can be corrected according to the mark deviation. The preset deviation condition is that the identification deviation meets the framing requirements, and the preset deviation condition can be adapted to be set according to different application scenarios. Preferably, the preset deviation condition is that the identification deviation does not exist.

在本实施例中,可步进式矫正目标图像,也可通过计算出具体的偏差量一次性矫正目标图像。In this embodiment, the target image can be corrected step by step, or the target image can be corrected at one time by calculating a specific deviation.

在本实施例一实施方案中,根据标识偏差,调节摄像头的位姿和/或目标物体的位姿,直至标识偏差满足预设偏差条件,包括S621和S622:In an implementation of this embodiment, the pose of the camera and/or the pose of the target object is adjusted according to the identification deviation until the identification deviation satisfies the preset deviation condition, including S621 and S622:

S621:根据标识偏差,确定摄像头和/或目标物体的第一补偿参数。S621: Determine the first compensation parameter of the camera and/or the target object according to the identification deviation.

其中,第一补偿参数包括第一补偿类型和第一补偿方向,第一补偿类型包括角度和/或长度。可理解的,本公开可单独调节摄像头或目标物体的位姿,实现对目标图像的矫正,也可同时调节摄像头和目标物体的位姿,实现对目标图像的矫正。由于摄像头和目标图像相对设置,因此,摄像头和目标物体的第一补偿方向相反。另外,第一补偿类型和第一补偿方向均可根据标识偏差确定。例如,以调节摄像头的位姿为例进行说明。当标识偏差为向前平移偏差时,第一补偿类型为长度,第一补偿方向为向后平移;当标识偏差为向左平移偏差时,第一补偿类型为长度,第一补偿方向为向左平移;当标识偏差为逆时针旋转偏差时,第一补偿类型为角度,第一补偿方向为逆时针旋转;当标识偏差为向上翻转偏差时,第一补偿类型为角度,第一补偿方向为向下翻转。其他根据标识偏差确定第一补偿参数的情况可参考上述确定方式,此处不再赘述。The first compensation parameter includes a first compensation type and a first compensation direction, and the first compensation type includes an angle and/or a length. It is understandable that the present disclosure can adjust the pose of the camera or the target object independently to correct the target image, and can also adjust the pose of the camera and the target object simultaneously to correct the target image. Since the camera and the target image are set relative to each other, the first compensation directions of the camera and the target object are opposite. In addition, both the first compensation type and the first compensation direction can be determined according to the identification deviation. For example, take adjusting the pose of the camera as an example for description. When the identification deviation is forward translation deviation, the first compensation type is length, and the first compensation direction is backward translation; when the identification deviation is leftward translation deviation, the first compensation type is length, and the first compensation direction is leftward Translation; when the identification deviation is a counterclockwise rotation deviation, the first compensation type is angle, and the first compensation direction is counterclockwise rotation; when the identification deviation is an upward flip deviation, the first compensation type is angle, and the first compensation direction is direction. Flip down. For other cases in which the first compensation parameter is determined according to the identification deviation, reference may be made to the above determination method, which will not be repeated here.

S622:根据第一补偿参数,步进式调节摄像头的位姿和/或目标物体的位姿,直至标识偏差满足预设偏差条件。S622: According to the first compensation parameter, stepwise adjust the pose of the camera and/or the pose of the target object until the identification deviation satisfies the preset deviation condition.

具体的,包括S6221至S6226:Specifically, including S6221 to S6226:

S6221:沿第一补偿方向,按照第一补偿类型对应的预设补偿量调节一次摄像头和/或目标物体。S6221: Along the first compensation direction, adjust the camera and/or the target object once according to the preset compensation amount corresponding to the first compensation type.

示例性的,以调节摄像头的位姿为例进行说明。本公开实施例可利用步进电机实现对摄像头位姿的步进调节,预设补偿量为步进电机预设的一次步进的量,可根据第一补偿类型确定为步进长度或步进角度。例如,当标识偏差为向前平移偏差时,步进电机控制摄像头向后平移第一预设长度L1;当标识偏差为向左平移偏差时,步进电机控制摄像头向左平移第二预设长度L2;当标识偏差为逆时针旋转偏差时,步进电机控制摄像头逆时针旋转第一预设角度A1;当标识偏差为向上翻转偏差时,步进电机控制摄像头向下翻转第二预设角度A2。Illustratively, adjusting the pose of the camera is taken as an example for description. In this embodiment of the present disclosure, a stepper motor can be used to realize stepwise adjustment of the camera pose. The preset compensation amount is the amount of one step preset by the stepper motor, which can be determined as the step length or the step length according to the first compensation type. angle. For example, when the identification deviation is forward translation deviation, the stepper motor controls the camera to translate backward by a first preset length L1; when the identification deviation is leftward translation deviation, the stepper motor controls the camera to translate leftward by a second preset length L2; when the identification deviation is a counterclockwise rotation deviation, the stepping motor controls the camera to rotate the first preset angle A1 counterclockwise; when the identification deviation is an upward flip deviation, the stepping motor controls the camera to flip down a second preset angle A2 .

S6222:通过摄像头采集包含四个定位标识的当前图像,并将当前图像作为目标图像。S6222: Collect a current image including four positioning marks through a camera, and use the current image as a target image.

S6223:确定四个定位标识在目标图像中的标识位置。S6223: Determine the marker positions of the four positioning markers in the target image.

S6224:根据标识位置,确定标识偏差。S6224: Determine the mark deviation according to the mark position.

S6225:根据标识偏差,确定摄像头和/或目标物体的第一补偿参数。S6225: Determine the first compensation parameter of the camera and/or the target object according to the identification deviation.

S6226:返回至沿第一补偿方向,按照第一补偿类型对应的预设补偿量再次调节摄像头和/或目标物体,直至标识偏差满足预设偏差条件。S6226: Return to the direction of the first compensation, and adjust the camera and/or the target object again according to the preset compensation amount corresponding to the first compensation type, until the identification deviation satisfies the preset deviation condition.

该实施方案中,因为无需确定精准的偏差量,因此,可在确定标识偏差的过程中判断标识偏差是否满足预设偏差条件。示例性的,当标识偏差为向前平移偏差时,可判断由标识坐标确定的两点之间距离,与由标准坐标确定的对应两点之间距离之差是否小于预设距离差,当由标识坐标确定的两点之间距离,与由标准坐标确定的对应两点之间距离之差小于预设距离差时,标识偏差满足预设偏差条件。In this embodiment, since it is not necessary to determine the precise deviation amount, it can be determined whether the identification deviation satisfies the preset deviation condition during the process of determining the identification deviation. Exemplarily, when the identification deviation is a forward translation deviation, it can be determined whether the difference between the distance between the two points determined by the identification coordinates and the distance between the corresponding two points determined by the standard coordinates is less than the preset distance difference, when the When the difference between the distance between the two points determined by the identification coordinates and the distance between the corresponding two points determined by the standard coordinates is less than the preset distance difference, the identification deviation satisfies the preset deviation condition.

在本实施例另一实施方案中,可通过计算出具体的偏差量一次性矫正目标图像。In another implementation of this embodiment, the target image can be corrected at one time by calculating a specific deviation amount.

具体的,上述方法还包括:根据标识位置,确定标识偏差对应的偏差量。相应的,根据标识偏差,调节摄像头的位姿和/或目标物体的位姿,直至标识偏差满足预设偏差条件,包括S623和S624:Specifically, the above method further includes: determining a deviation amount corresponding to the deviation of the identification according to the position of the identification. Correspondingly, according to the identification deviation, adjust the pose of the camera and/or the pose of the target object until the identification deviation satisfies the preset deviation conditions, including S623 and S624:

S623:根据标识偏差,确定摄像头和/或目标物体的第二补偿参数。S623: Determine the second compensation parameter of the camera and/or the target object according to the identification deviation.

其中,第二补偿参数包括第二补偿类型和第二补偿方向,第二补偿类型包括角度和/或长度。第二补偿参数与上述第一补偿参数相似,此处不再赘述。Wherein, the second compensation parameter includes a second compensation type and a second compensation direction, and the second compensation type includes an angle and/or a length. The second compensation parameter is similar to the above-mentioned first compensation parameter, and will not be repeated here.

S624:根据第二补偿参数以及标识偏差对应的偏差量,调节摄像头的位姿和/或目标物体的位姿。S624: Adjust the pose of the camera and/or the pose of the target object according to the second compensation parameter and the deviation amount corresponding to the identification deviation.

该实施方案中,沿第二补偿方向,按照第二补偿类型对应的偏差量调节摄像头和/或目标物体。由此,可一次将摄像头和/或目标物体调节到标准位姿,通过一次补偿即可实现对目标图像的矫正,进一步提高了取景的效率。In this embodiment, along the second compensation direction, the camera and/or the target object are adjusted according to the deviation amount corresponding to the second compensation type. Therefore, the camera and/or the target object can be adjusted to the standard pose at one time, and the target image can be corrected by one compensation, which further improves the efficiency of framing.

上述方案中,根据标识位置,确定标识偏差对应的偏差量,包括如下至少一个:In the above solution, the deviation amount corresponding to the identification deviation is determined according to the identification position, including at least one of the following:

当标识偏差为翻转偏差时,根据标识位置,确定第一投影角度和第二投影角度,并将第一投影角度和第二投影角度作为标识偏差对应的偏差量,其中,标识平面绕第一预设直线旋转第二投影角度,且绕第二预设直线旋转第一投影角度后,与像平面平行,第一预设直线经过物空间中四个定位标识的第一对角,第二预设直线经过物空间中四个定位标识的第二对角;When the mark deviation is a flip deviation, the first projection angle and the second projection angle are determined according to the mark position, and the first projection angle and the second projection angle are used as the deviation amount corresponding to the mark deviation, wherein the mark plane surrounds the first predetermined angle. Suppose the line is rotated by the second projection angle, and after the first projection angle is rotated around the second preset line, it is parallel to the image plane. The first preset line passes through the first diagonal corner of the four positioning marks in the object space, and the second preset line is The straight line passes through the second diagonal corner of the four positioning marks in the object space;

当标识偏差为前后偏差时,根据标识位置,确定当前物距,将当前物距与预设标准物距的差值作为标识偏差对应的偏差量;When the marking deviation is the front and rear deviation, the current object distance is determined according to the marking position, and the difference between the current object distance and the preset standard object distance is used as the deviation corresponding to the marking deviation;

当标识偏差为垂直偏差时,根据标识位置,确定物空间中四个定位标识的中心到预设点的预设距离,将预设距离与预设角度的正弦值的乘积作为标识偏差对应的偏差量,其中,预设点为摄像头的镜头主光轴与标识平面的交点,预设角度为经过物空间中四个定位标识的中心和预设点的直线与水平线的夹角;When the mark deviation is a vertical deviation, the preset distance from the center of the four positioning marks in the object space to the preset point is determined according to the mark position, and the product of the preset distance and the sine of the preset angle is used as the deviation corresponding to the mark deviation The preset point is the intersection of the main optical axis of the camera lens and the marking plane, and the preset angle is the angle between the horizontal line and the line passing through the center of the four positioning marks in the object space and the preset point;

当标识偏差为水平偏差时,根据标识位置,确定物空间中四个定位标识的中心到预设点的预设距离,将预设距离与预设角度的余弦值的乘积作为标识偏差对应的偏差量;When the marker deviation is a horizontal deviation, the preset distances from the centers of the four positioning markers in the object space to the preset point are determined according to the marker positions, and the product of the preset distance and the cosine value of the preset angle is used as the deviation corresponding to the marker deviation. quantity;

当标识偏差为旋转偏差时,根据标识位置,确定目标图像绕摄像头的镜头主光轴的旋转角度,并将旋转角度作为标识偏差对应的偏差量。When the identification deviation is a rotation deviation, the rotation angle of the target image around the main optical axis of the camera lens is determined according to the identification position, and the rotation angle is used as the deviation amount corresponding to the identification deviation.

可选的,根据标识位置,确定第一投影角度和第二投影角度,包括:Optionally, determining the first projection angle and the second projection angle according to the identification position, including:

采用如下公式确定第一投影角度:Use the following formula to determine the first projection angle:

Figure BDA0003168919480000111
Figure BDA0003168919480000111

采用如下公式确定第二投影角度:Use the following formula to determine the second projection angle:

Figure BDA0003168919480000112
Figure BDA0003168919480000112

其中,α表示第一投影角度,β表示第二投影角度,A'1表示在目标图像中第一定位标识到标识成像中心的距离,A'2表示在目标图像中第二定位标识到标识成像中心的距离,A'3表示在目标图像中第三定位标识到标识成像中心的距离,A'4表示在目标图像中第四定位标识到标识成像中心的距离,f表示摄像头的焦距,标识成像中心为在目标图像中四个定位标识对角连线的交点。Among them, α represents the first projection angle, β represents the second projection angle, A' 1 represents the distance from the first positioning mark to the mark imaging center in the target image, A' 2 indicates the second positioning mark in the target image to the mark imaging The distance from the center, A' 3 represents the distance from the third positioning mark to the marking imaging center in the target image, A' 4 represents the distance from the fourth positioning mark to the marking imaging center in the target image, f represents the focal length of the camera, and the marking imaging The center is the intersection of the diagonal lines connecting the four positioning markers in the target image.

具体的,通过如下公式(1)-(12)计算得到第一投影角度以及第二投影角度,以图8中标记的符号进行说明。Specifically, the first projection angle and the second projection angle are calculated by the following formulas (1)-(12), which are described with the symbols marked in FIG. 8 .

结合图8和成像公式可以得到公式(1)和公式(2)。Combining Figure 8 and the imaging formula, formula (1) and formula (2) can be obtained.

Figure BDA0003168919480000113
Figure BDA0003168919480000113

其中,O点为摄像头L与第二定位标识P2连接的直线LP2和过中线点C且与直线CL垂直的直线的交点,P为摄像头与第四定位标识P4连接的直线的延长线LP4与过中线点C且与直线CL垂直的直线的交点,D为中心点C与摄像头中心L的距离,C'为目标图像中P1'和P3'的连线与P2'和P4'的连线的交点,A'2为C'与P2'之间的距离,f为摄像头的焦距。Wherein, point O is the intersection point of the straight line LP 2 connecting the camera L and the second positioning mark P 2 and the straight line passing through the center line point C and perpendicular to the straight line CL, and P is the extension line of the straight line connecting the camera head and the fourth positioning mark P 4 The intersection point of LP 4 and the straight line passing through the center line point C and perpendicular to the straight line CL, D is the distance between the center point C and the camera center L, and C' is the connection line between P 1 ' and P 3 ' in the target image and P 2 ' and The intersection of the lines of P4', A'2 is the distance between C' and P2', and f is the focal length of the camera.

Figure BDA0003168919480000114
Figure BDA0003168919480000114

其中,A'4为C'与P4'之间的距离。Among them, A' 4 is the distance between C' and P 4 '.

结合图8和三角几何关系可以得到公式(3)至公式(8)。Formulas (3) to (8) can be obtained in combination with FIG. 8 and the triangular geometric relationship.

P2C=A 公式(3)P 2 C=A Formula (3)

其中,A为标识平面内第二定位标识P2与中心点C的距离。Wherein, A is the distance between the second positioning marker P2 and the center point C in the marker plane.

P4C=A 公式(4)P 4 C=A Formula (4)

其中,在标识平面内任一定位标识到中心点C的距离均相等为A。Wherein, the distance from any positioning mark to the center point C in the mark plane is equal to A.

P2M=A×cosα 公式(5)P 2 M=A×cosα Formula (5)

其中,P2M与MC垂直,且P2M与P2C的夹角为第一投影角度α。Wherein, P 2 M is perpendicular to MC, and the included angle between P 2 M and P 2 C is the first projection angle α.

P4N=A×cosα 公式(6)P 4 N=A×cosα Formula (6)

其中,P4N与CL垂直,且P4N与P4C的夹角为第一投影角度α。Wherein, P 4 N is perpendicular to CL, and the included angle between P 4 N and P 4 C is the first projection angle α.

MC=A×sinα 公式(7)MC=A×sinα Formula (7)

NC=A×sinα 公式(8)NC=A×sinα Formula (8)

根据由P2ML组成的三角形与由OCL组成的三角形相似,可以得到公式(9)。According to the similarity of the triangle composed of P 2 ML to the triangle composed of OCL, formula (9) can be obtained.

Figure BDA0003168919480000121
Figure BDA0003168919480000121

结合上述公式(1)、公式(5)、公式(7)和公式(9),得到如下公式(10)。Combining the above formula (1), formula (5), formula (7) and formula (9), the following formula (10) is obtained.

Figure BDA0003168919480000122
Figure BDA0003168919480000122

根据由P4NL组成的三角形与由PCL组成的三角形相似,可以得到公式(11)。Equation (11) can be obtained from the similarity of the triangle formed by P 4 NL to the triangle formed by PCL.

Figure BDA0003168919480000123
Figure BDA0003168919480000123

结合上述公式(2)、公式(6)、公式(8)和公式(10),得到如下公式(12)。Combining the above formula (2), formula (6), formula (8) and formula (10), the following formula (12) is obtained.

Figure BDA0003168919480000124
Figure BDA0003168919480000124

根据公式(10)和公式(12),可以得到第一投影角度α。According to formula (10) and formula (12), the first projection angle α can be obtained.

另外,第二投影角度β的计算方式与第一投影角度α的原理相同,在此不作赘述。In addition, the calculation method of the second projection angle β is the same as the principle of the first projection angle α, which is not repeated here.

可选的,确定当前物距,包括:Optionally, determine the current object distance, including:

根据标识位置,确定目标图像中任意两个定位标识之间的成像距离;根据成像距离并结合成像原理,确定当前物距。According to the position of the mark, the imaging distance between any two positioning marks in the target image is determined; according to the imaging distance and combined with the imaging principle, the current object distance is determined.

可选的,根据标识位置,确定目标图像绕摄像头的镜头主光轴的旋转角度,包括:Optionally, according to the identification position, determine the rotation angle of the target image around the main optical axis of the lens of the camera, including:

参考图4中的目标图像(d),采用如下公式确定旋转角度θ:Referring to the target image (d) in Figure 4, the rotation angle θ is determined by the following formula:

Figure BDA0003168919480000131
或者,
Figure BDA0003168919480000131
or,

Figure BDA0003168919480000132
Figure BDA0003168919480000132

其中,P1'的坐标为(x1',y1'),P2'的坐标为(x2',y2'),P3'的坐标为(x3',y3'),P3'的坐标为(x3',y3')。Among them, the coordinates of P 1 ' are (x 1 ', y 1 '), the coordinates of P 2 ' are (x 2 ', y 2 '), and the coordinates of P 3 ' are (x 3 ', y 3 '), The coordinates of P3 ' are ( x3 ', y3').

在一个实施例中,如图9所示,提供了一种图像矫正装置900,该图像矫正装置900包括图像获取模块910、标识位置确定模块920和图像矫正模块930;其中,图像获取模块910,配置成获取摄像头采集的包含四个定位标识的目标图像,其中,四个定位标识在物空间中位于标识平面,且依次等间距并环绕排列;标识位置确定模块920,配置成确定四个定位标识在目标图像中的标识位置;图像矫正模块930,配置成根据标识位置,对目标图像进行矫正。In one embodiment, as shown in FIG. 9, an image correction device 900 is provided, and the image correction device 900 includes an image acquisition module 910, an identification position determination module 920 and an image correction module 930; wherein, the image acquisition module 910, It is configured to acquire a target image collected by the camera and contains four positioning marks, wherein the four positioning marks are located on the mark plane in the object space, and are arranged at equal intervals in turn and arranged in a circle; the mark position determination module 920 is configured to determine four positioning marks The mark position in the target image; the image correction module 930 is configured to correct the target image according to the mark position.

关于图像矫正装置的具体限定可以参见上文中对于图像矫正方法的限定,在此不再赘述。上述图像矫正装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于电子设备中的一个或多个处理器中,也可以以软件形式存储于电子设备中的存储器中,以便于一个或多个处理器调用执行以上各个模块对应的操作。For specific limitations on the image correction device, reference may be made to the above limitations on the image correction method, which will not be repeated here. Each module in the above-mentioned image correction device may be implemented in whole or in part by software, hardware and combinations thereof. The above modules can be embedded in or independent of one or more processors in the electronic device in the form of hardware, and can also be stored in the memory in the electronic device in the form of software, so that one or more processors can call and execute the above modules. The corresponding operation of the module.

可选的,图像矫正模块930包括:偏差确定单元,配置成根据标识位置,确定标识偏差;图像矫正单元,配置成根据标识偏差,对目标图像进行矫正。Optionally, the image correction module 930 includes: a deviation determination unit, configured to determine the mark deviation according to the mark position; and an image correction unit, configured to correct the target image according to the mark deviation.

可选的,偏差确定单元包括:位置关系确定子单元,配置成根据标识位置,确定摄像头的像平面与标识平面的位置关系,其中,位置关系包括像平面与标识平面平行或相交;偏差确定子单元,配置成根据位置关系和标识位置,确定标识偏差。Optionally, the deviation determination unit includes: a positional relationship determination subunit configured to determine the positional relationship between the image plane of the camera and the identification plane according to the identification position, wherein the positional relationship includes the image plane and the identification plane being parallel or intersecting; the deviation determination subunit. The unit is configured to determine the marker deviation based on the positional relationship and the marker position.

可选的,位置关系确定子单元具体配置成:当由标识位置确定的第一组对边长度相等,且由标识位置确定的第二组对边长度相等时,像平面与标识平面平行;当由标识位置确定的第一组对边长度和第二组对边长度中的任一组对边长度不相等时,像平面与标识平面相交。Optionally, the positional relationship determination subunit is specifically configured to: when the lengths of the first group of opposite sides determined by the mark position are equal, and the length of the second group of opposite sides determined by the mark position are equal, the image plane is parallel to the mark plane; When any one of the lengths of the opposite sides of the first group of opposite sides determined by the mark position and the length of the second group of opposite sides are not equal, the image plane intersects the mark plane.

可选的,标识偏差包括前后偏差、垂直偏差、水平偏差、旋转偏差和翻转偏差中的至少一种。Optionally, the identification deviation includes at least one of a front-to-back deviation, a vertical deviation, a horizontal deviation, a rotation deviation, and a flip deviation.

可选的,图像矫正装置还包括:坐标系建立模块,配置成以像平面中的目标像点为原点,建立直角坐标系,直角坐标系的x轴平行于预设标准位置确定的第一边,直角坐标系的y轴平行于预设标准位置确定的第二边,预设标准位置为四个定位标识在标准图像中的位置;标识坐标确定模块,配置成在直角坐标系下,确定四个定位标识在目标图像中的标识坐标以及在标准图像中的标准坐标。Optionally, the image correction device further includes: a coordinate system establishment module, configured to take the target image point in the image plane as the origin, to establish a rectangular coordinate system, and the x-axis of the rectangular coordinate system is parallel to the first side determined by the preset standard position. , the y-axis of the rectangular coordinate system is parallel to the second side determined by the preset standard position, and the preset standard position is the position of the four positioning marks in the standard image; the identification coordinate determination module is configured to determine the four positioning marks in the rectangular coordinate system. The identification coordinates of each positioning mark in the target image and the standard coordinates in the standard image.

可选的,偏差确定子单元具体配置成:当像平面与标识平面平行,且由标识坐标确定的两点之间距离,不等于由标准坐标确定的对应两点之间距离时,确定标识偏差为前后偏差;当像平面与标识平面平行,且由标识坐标确定的纵坐标平均值,不等于由标准坐标确定的纵坐标平均值时,确定标识偏差为垂直偏差;当像平面与标识平面平行,且由标识坐标确定的横坐标平均值,不等于由标准坐标确定的横坐标平均值时,确定标识偏差为水平偏差;当像平面与标识平面平行,且经过由标识坐标确定的第一组对边的中点的直线,与y轴均相交,或者经过由标识坐标确定的第二组对边的中点的直线,与x轴相交时,确定标识偏差为旋转偏差;当像平面与标识平面相交,且由标识坐标确定的第一组对边不相等,或者由标识坐标确定的第二组对边不相等时,确定标识偏差为翻转偏差。Optionally, the deviation determination subunit is specifically configured to: when the image plane is parallel to the marking plane, and the distance between the two points determined by the marking coordinates is not equal to the distance between the corresponding two points determined by the standard coordinates, determine the marking deviation. It is the deviation before and after; when the image plane is parallel to the marking plane, and the average value of the ordinate determined by the marking coordinates is not equal to the average value of the ordinate determined by the standard coordinates, the marking deviation is determined as the vertical deviation; when the image plane is parallel to the marking plane , and the average value of the abscissa determined by the identification coordinates is not equal to the average value of the abscissa determined by the standard coordinates, the identification deviation is determined as the horizontal deviation; when the image plane is parallel to the identification plane, and passes through the first group determined by the identification coordinates When the straight line at the midpoint of the opposite side intersects with the y-axis, or the straight line passing through the midpoint of the second group of opposite sides determined by the identification coordinates intersects with the x-axis, the identification deviation is determined as the rotation deviation; when the image plane and the identification When the planes intersect and the first group of opposite sides determined by the identification coordinates are not equal, or the second group of opposite sides determined by the identification coordinates are not equal, the identification deviation is determined as a flip deviation.

可选的,前后偏差包括向前平移偏差或向后平移偏差,垂直偏差包括向上平移偏差或向下平移偏差,水平偏差包括向左平移偏差或向右平移偏差,旋转偏差包括逆时针旋转偏差或顺时针旋转偏差,翻转偏差包括向上翻转偏差、向下翻转偏差、向左翻转偏差和向右翻转偏差中的一个或两个。Optionally, the forward and backward deviations include forward translation deviation or backward translation deviation, the vertical deviation includes upward translation deviation or downward translation deviation, the horizontal deviation includes leftward translation deviation or right translation deviation, and the rotation deviation includes counterclockwise rotation deviation or Clockwise rotation bias, flip bias includes one or both of up flip bias, down flip bias, left flip bias, and right flip bias.

可选的,图像矫正单元包括:位姿调节子单元,配置成根据标识偏差,调节摄像头的位姿和/或目标物体的位姿,直至标识偏差满足预设偏差条件,四个标识位于目标物体上。Optionally, the image correction unit includes: a pose adjustment subunit configured to adjust the pose of the camera and/or the pose of the target object according to the marker deviation, until the marker deviation satisfies a preset deviation condition, and the four markers are located on the target object. superior.

可选的,位姿调节子单元具体配置成:根据标识偏差,确定摄像头和/或目标物体的第一补偿参数,第一补偿参数包括第一补偿类型和第一补偿方向,第一补偿类型包括角度和/或长度;根据第一补偿参数,步进式调节摄像头的位姿和/或目标物体的位姿,直至标识偏差满足预设偏差条件。Optionally, the pose adjustment subunit is specifically configured to: determine the first compensation parameter of the camera and/or the target object according to the identification deviation, the first compensation parameter includes a first compensation type and a first compensation direction, and the first compensation type includes Angle and/or length; according to the first compensation parameter, stepwise adjust the pose of the camera and/or the pose of the target object until the marker deviation satisfies the preset deviation condition.

可选的,位姿调节子单元在根据第一补偿参数,步进式调节摄像头的位姿和/或目标物体的位姿,直至标识偏差满足预设偏差条件时,具体配置成:沿第一补偿方向,按照第一补偿类型对应的预设补偿量调节一次摄像头和/或目标物体;通过摄像头采集包含四个定位标识的当前图像,并将当前图像作为目标图像;确定四个定位标识在目标图像中的标识位置;根据标识位置,确定标识偏差;根据标识偏差,确定摄像头和/或目标物体的第一补偿参数;返回至沿第一补偿方向,按照第一补偿类型对应的预设补偿量再次调节摄像头和/或目标物体,直至标识偏差满足预设偏差条件。Optionally, the pose adjustment subunit is configured to stepwise adjust the pose of the camera and/or the pose of the target object according to the first compensation parameter until the marker deviation satisfies the preset deviation condition, and is specifically configured to: Compensation direction, adjust the camera and/or the target object once according to the preset compensation amount corresponding to the first compensation type; collect the current image containing four positioning marks through the camera, and use the current image as the target image; determine that the four positioning marks are on the target Mark position in the image; according to the mark position, determine the mark deviation; according to the mark deviation, determine the first compensation parameter of the camera and/or the target object; return to the preset compensation amount corresponding to the first compensation type along the first compensation direction Adjust the camera and/or the target object again until the marker deviation meets the preset deviation condition.

可选的,装置还包括:偏差量确定模块,配置成根据标识位置,确定标识偏差对应的偏差量。位姿调节子单元具体配置成:根据标识偏差,确定摄像头和/或目标物体的第二补偿参数,第二补偿参数包括第二补偿类型和第二补偿方向,第二补偿类型包括角度和/或长度;根据第二补偿参数以及标识偏差对应的偏差量,调节摄像头的位姿和/或目标物体的位姿。Optionally, the device further includes: a deviation amount determination module, configured to determine the deviation amount corresponding to the identification deviation according to the identification position. The pose adjustment subunit is specifically configured to: determine the second compensation parameter of the camera and/or the target object according to the identification deviation, the second compensation parameter includes a second compensation type and a second compensation direction, and the second compensation type includes an angle and/or length; adjust the pose of the camera and/or the pose of the target object according to the second compensation parameter and the deviation amount corresponding to the identification deviation.

可选的,偏差量确定模块具体配置成:当标识偏差为翻转偏差时,根据标识位置,确定第一投影角度和第二投影角度,并将第一投影角度和第二投影角度作为标识偏差对应的偏差量,其中,标识平面绕第一预设直线旋转第二投影角度,且绕第二预设直线旋转第一投影角度后,与像平面平行,第一预设直线经过物空间中四个定位标识的第一对角,第二预设直线经过物空间中四个定位标识的第二对角;当标识偏差为前后偏差时,根据标识位置,确定当前物距,将当前物距与预设标准物距的差值作为标识偏差对应的偏差量;当标识偏差为垂直偏差时,根据标识位置,确定物空间中四个定位标识的中心到预设点的预设距离,将预设距离与预设角度的正弦值的乘积作为标识偏差对应的偏差量,其中,预设点为摄像头的镜头主光轴与标识平面的交点,预设角度为经过物空间中四个定位标识的中心和预设点的直线与水平线的夹角;当标识偏差为水平偏差时,根据标识位置,确定物空间中四个定位标识的中心到预设点的预设距离,将预设距离与预设角度的余弦值的乘积作为标识偏差对应的偏差量;当标识偏差为旋转偏差时,根据标识位置,确定目标图像绕摄像头的镜头主光轴的旋转角度,并将旋转角度作为标识偏差对应的偏差量。Optionally, the deviation determination module is specifically configured to: when the identification deviation is a flip deviation, according to the identification position, determine the first projection angle and the second projection angle, and take the first projection angle and the second projection angle as the identification deviation corresponding. , where the marking plane rotates around the first preset line by the second projection angle, and after rotating the first projection angle around the second preset line, it is parallel to the image plane, and the first preset line passes through four The first diagonal corner of the positioning mark, and the second preset straight line passes through the second diagonal corner of the four positioning marks in the object space; when the mark deviation is the front and rear deviation, the current object distance is determined according to the mark position, and the current object distance and the preset distance are determined. Set the difference of the standard object distance as the deviation corresponding to the mark deviation; when the mark deviation is a vertical deviation, according to the mark position, determine the preset distance from the center of the four positioning marks in the object space to the preset point, and set the preset distance The product of the sine value of the preset angle is used as the deviation corresponding to the identification deviation, wherein the preset point is the intersection of the main optical axis of the camera lens and the identification plane, and the preset angle is the center and the center of the four positioning marks in the object space. The angle between the straight line of the preset point and the horizontal line; when the mark deviation is the horizontal deviation, according to the mark position, determine the preset distance from the center of the four positioning marks in the object space to the preset point, and compare the preset distance with the preset angle The product of the cosine values of , is used as the deviation corresponding to the logo deviation; when the logo deviation is a rotation deviation, the rotation angle of the target image around the main optical axis of the camera lens is determined according to the logo position, and the rotation angle is used as the deviation corresponding to the logo deviation. .

可选的,偏差量确定模块在根据标识位置,确定第一投影角度和第二投影角度时,具体配置成:采用如下公式确定第一投影角度:Optionally, when determining the first projection angle and the second projection angle according to the identification position, the deviation determination module is specifically configured to: determine the first projection angle by using the following formula:

Figure BDA0003168919480000151
Figure BDA0003168919480000151

采用如下公式确定第二投影角度:Use the following formula to determine the second projection angle:

Figure BDA0003168919480000152
Figure BDA0003168919480000152

其中,α表示第一投影角度,β表示第二投影角度,A'1表示在目标图像中第一定位标识到标识成像中心的距离,A'2表示在目标图像中第二定位标识到标识成像中心的距离,A'3表示在目标图像中第三定位标识到标识成像中心的距离,A'4表示在目标图像中第四定位标识到标识成像中心的距离,f表示摄像头的焦距,标识成像中心为在目标图像中四个定位标识对角连线的交点。Among them, α represents the first projection angle, β represents the second projection angle, A' 1 represents the distance from the first positioning mark to the mark imaging center in the target image, A' 2 indicates the second positioning mark in the target image to the mark imaging The distance from the center, A' 3 represents the distance from the third positioning mark to the marking imaging center in the target image, A' 4 represents the distance from the fourth positioning mark to the marking imaging center in the target image, f represents the focal length of the camera, and the marking imaging The center is the intersection of the diagonal lines connecting the four positioning markers in the target image.

可选的,偏差量确定模块在根据标识位置,确定当前物距时,具体配置成:根据标识位置,确定目标图像中任意两个定位标识之间的成像距离;根据成像距离并结合成像原理,确定当前物距。Optionally, when determining the current object distance according to the position of the mark, the deviation determination module is specifically configured to: according to the position of the mark, determine the imaging distance between any two positioning marks in the target image; according to the imaging distance and in combination with the imaging principle, Determines the current object distance.

在一个实施例中,提供了一种电子设备,该电子设备可以是终端,其内部结构图可以如图10所示。该电子设备包括通过系统总线连接的处理器、存储器、通信接口、显示屏和输入装置。其中,该电子设备的处理器用于提供计算和控制能力。该电子设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机可读指令。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该电子设备的通信接口用于与外部的终端进行有线或无线方式的通信,无线方式可通过WIFI、运营商网络、近场通信(NFC)或其他技术实现。该计算机可读指令被一个或多个处理器执行时以实现一种方法。该电子设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该电子设备的输入装置可以是显示屏上覆盖的触摸层,也可以是电子设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In one embodiment, an electronic device is provided, the electronic device may be a terminal, and its internal structure diagram may be as shown in FIG. 10 . The electronic device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer-readable instructions. The internal memory provides an environment for the execution of the operating system and computer-readable instructions in the non-volatile storage medium. The communication interface of the electronic device is used for wired or wireless communication with an external terminal, and the wireless communication can be realized by WIFI, operator network, near field communication (NFC) or other technologies. The computer readable instructions, when executed by one or more processors, implement a method. The display screen of the electronic device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device may be a touch layer covered on the display screen, or a button, a trackball or a touchpad set on the shell of the electronic device , or an external keyboard, trackpad, or mouse.

本领域技术人员可以理解,图10中示出的结构,仅仅是与本公开方案相关的部分结构的框图,并不构成对本公开方案所应用于其上的电子设备的限定,具体的电子设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 10 is only a block diagram of a partial structure related to the solution of the present disclosure, and does not constitute a limitation on the electronic device to which the solution of the present disclosure is applied. The specific electronic device may be Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.

在一个实施例中,本公开提供的图像矫正装置可以实现为一种计算机可读指令的形式,计算机可读指令可在如图10所示的电子设备上运行。电子设备的存储器中可存储组成该图像矫正装置的各个程序模块,比如,图9所示的图像获取模块910、标识位置确定模块920和图像矫正模块930。各个程序模块构成的计算机可读指令使得一个或多个处理器执行本说明书中描述的本公开各个实施例的图像矫正方法中的步骤。In one embodiment, the image correction apparatus provided by the present disclosure may be implemented in the form of computer-readable instructions, and the computer-readable instructions may be executed on the electronic device as shown in FIG. 10 . Various program modules constituting the image correction apparatus may be stored in the memory of the electronic device, for example, the image acquisition module 910 , the identification position determination module 920 and the image correction module 930 shown in FIG. 9 . The computer-readable instructions constituted by each program module cause one or more processors to execute the steps in the image correction method of the various embodiments of the present disclosure described in this specification.

例如,图10所示的电子设备可以通过如图9所示的装置中的图像获取模块910执行步骤S510。电子设备可通过标识位置确定模块920执行步骤S520。电子设备可通过图像矫正模块930执行步骤S530。For example, the electronic device shown in FIG. 10 may perform step S510 through the image acquisition module 910 in the apparatus shown in FIG. 9 . The electronic device may perform step S520 by identifying the location determination module 920 . The electronic device may perform step S530 through the image correction module 930 .

一个实施例中,提供了一种电子设备,包括存储器和一个或多个处理器,存储器存储有计算机可读指令,该一个或多个处理器执行计算机可读指令时实现上述任一实施例所提供的图像矫正方法的步骤。本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成的,计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本公开所提供的各实施例中所使用的对存储器、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、磁带、软盘、闪存或光存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,比如静态随机存取存储器(Static Random AccessMemory,SRAM)和动态随机存取存储器(Dynamic Random Access Memory,DRAM)等。In one embodiment, an electronic device is provided, which includes a memory and one or more processors, where the memory stores computer-readable instructions, and when the one or more processors execute the computer-readable instructions, implements the functions described in any of the foregoing embodiments. Provides the steps of the image rectification method. Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a non-volatile computer-readable In the storage medium, the computer-readable instructions, when executed, may include the processes of the foregoing method embodiments. Wherein, any reference to memory, database or other media used in the various embodiments provided by the present disclosure may include at least one of non-volatile and volatile memory. The non-volatile memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, and the like. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as Static Random Access Memory (SRAM) and Dynamic Random Access Memory (DRAM).

以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features It is considered to be the range described in this specification.

以上所述实施例仅表达了本公开的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本公开构思的前提下,还可以做出若干变形和改进,这些都属于本公开的保护范围。因此,本公开专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several embodiments of the present disclosure, and the descriptions thereof are relatively specific and detailed, but should not be construed as a limitation on the scope of the invention patent. It should be noted that, for those skilled in the art, without departing from the concept of the present disclosure, several modifications and improvements can be made, which all belong to the protection scope of the present disclosure. Accordingly, the scope of protection of the present disclosure should be determined by the appended claims.

工业实用性Industrial Applicability

本公开提供的图像矫正方法,使得在拍摄照片进行取景时,通过获取预先设置有四个定位标识的目标物体对应的目标图像,根据四个定位标识在目标图像中的标识位置即可确定拍摄的目标物体的偏差情况,从而根据标识位置对目标图像进行快速矫正,提高了取景的精度和效率,保证了取景结果的一致性,具有很强的工业实用性。The image correction method provided by the present disclosure makes it possible to determine the photographed image by acquiring the target image corresponding to the target object pre-set with four positioning marks when taking a photo for framing, and according to the mark positions of the four positioning marks in the target image. The deviation of the target object can be quickly corrected according to the marked position, which improves the accuracy and efficiency of the framing, ensures the consistency of the framing results, and has strong industrial practicability.

Claims (20)

1. An image rectification method, comprising:
acquiring a target image which is acquired by a camera and contains four positioning marks, wherein the four positioning marks are positioned on a mark plane in an object space, are sequentially arranged at equal intervals and are arranged in a surrounding manner;
determining the identification positions of the four positioning identifications in the target image;
and correcting the target image according to the identification position.
2. The method of claim 1, wherein rectifying the target image based on the identified location comprises:
determining an identification deviation according to the identification position;
and correcting the target image according to the identification deviation.
3. The method of claim 2, wherein determining an identification bias from the identification location comprises:
determining the position relation between the image plane of the camera and the identification plane according to the identification position, wherein the position relation comprises that the image plane is parallel to or intersected with the identification plane;
and determining the identification deviation according to the position relation and the identification position.
4. The method of claim 3, wherein determining the position relationship between the image plane of the camera and the identification plane according to the identification position comprises:
when the lengths of a first group of opposite sides determined by the identification position are equal and the lengths of a second group of opposite sides determined by the identification position are equal, the image plane is parallel to the identification plane;
when any one pair of side lengths in the first group of opposite side lengths and the second group of opposite side lengths determined by the identification position is not equal to the side length, the image plane intersects with the identification plane.
5. The method of claim 3, wherein the identification bias comprises at least one of a front-to-back bias, a vertical bias, a horizontal bias, a rotational bias, and a roll-over bias.
6. The method of claim 5, further comprising:
establishing a rectangular coordinate system by taking a target image point in an image plane as an origin, wherein an x axis of the rectangular coordinate system is parallel to a first edge determined by a preset standard position, a y axis of the rectangular coordinate system is parallel to a second edge determined by the preset standard position, and the preset standard position is the position of the four positioning marks in a standard image;
and under the rectangular coordinate system, determining the identification coordinates of the four positioning identifications in the target image and the standard coordinates in the standard image.
7. The method of claim 6, wherein determining the tag bias based on the positional relationship and the tag location comprises at least one of:
when the image plane is parallel to the identification plane and the distance between two points determined by the identification coordinates is not equal to the distance between corresponding two points determined by the standard coordinates, determining the identification deviation as the front-back deviation;
when the image plane is parallel to the identification plane and the mean value of the ordinate determined by the identification coordinate is not equal to the mean value of the ordinate determined by the standard coordinate, determining the identification deviation as the vertical deviation;
when the image plane is parallel to the identification plane and the abscissa average value determined by the identification coordinates is not equal to the abscissa average value determined by the standard coordinates, determining the identification deviation as the horizontal deviation;
when the image plane is parallel to the identification plane and a straight line passing through the middle points of a first group of opposite sides determined by the identification coordinates intersects both the y-axis and the x-axis, or a straight line passing through the middle points of a second group of opposite sides determined by the identification coordinates intersects the x-axis, determining the identification deviation as the rotation deviation;
and when the image plane is intersected with the identification plane, and a first group of opposite sides determined by the identification coordinates are not equal, or a second group of opposite sides determined by the identification coordinates are not equal, determining the identification deviation as the overturning deviation.
8. The method of claim 7, wherein the front-to-back bias comprises a forward translation bias or a backward translation bias, the vertical bias comprises an upward translation bias or a downward translation bias, the horizontal bias comprises a leftward translation bias or a rightward translation bias, the rotational bias comprises a counterclockwise rotation bias or a clockwise rotation bias, and the flip bias comprises one or both of an upward flip bias, a downward flip bias, a leftward flip bias, and a rightward flip bias.
9. The method of claim 2, wherein rectifying the target image based on the identified deviation comprises:
and adjusting the pose of the camera and/or the pose of the target object according to the identification deviation until the identification deviation meets a preset deviation condition, wherein the four identifications are positioned on the target object.
10. The method of claim 9, wherein adjusting the pose of the camera and/or the pose of the target object according to the identification deviation until the identification deviation satisfies a preset deviation condition comprises:
determining a first compensation parameter of the camera and/or the target object according to the identification deviation, wherein the first compensation parameter comprises a first compensation type and a first compensation direction, and the first compensation type comprises an angle and/or a length;
and adjusting the pose of the camera and/or the pose of the target object step by step according to the first compensation parameter until the identification deviation meets a preset deviation condition.
11. The method of claim 10, wherein adjusting the pose of the camera and/or the pose of the target object in steps according to the first compensation parameter until the identification deviation satisfies a preset deviation condition comprises:
adjusting the camera and/or the target object once along the first compensation direction according to a preset compensation amount corresponding to the first compensation type;
acquiring a current image containing the four positioning identifications through the camera, and taking the current image as the target image;
determining the identification positions of the four positioning identifications in the target image;
determining an identification deviation according to the identification position;
determining a first compensation parameter of the camera and/or the target object according to the identification deviation;
and returning to the direction along the first compensation direction, and adjusting the camera and/or the target object again according to the preset compensation amount corresponding to the first compensation type until the identification deviation meets the preset deviation condition.
12. The method of claim 9, further comprising:
and determining a deviation amount corresponding to the identification deviation according to the identification position.
13. The method of claim 12, wherein adjusting the pose of the camera and/or the pose of the target object according to the identification deviation until the identification deviation satisfies a preset deviation condition comprises:
determining a second compensation parameter of the camera and/or the target object according to the identification deviation, wherein the second compensation parameter comprises a second compensation type and a second compensation direction, and the second compensation type comprises an angle and/or a length;
and adjusting the pose of the camera and/or the pose of the target object according to the second compensation parameter and the deviation amount corresponding to the identification deviation.
14. The method of claim 12, wherein determining the deviation amount corresponding to the identification deviation according to the identification position comprises at least one of:
when the identification deviation is a turning deviation, determining a first projection angle and a second projection angle according to the identification position, and taking the first projection angle and the second projection angle as deviation amounts corresponding to the identification deviation, wherein the identification plane rotates around a first preset straight line by the second projection angle, and after rotating around a second preset straight line by the first projection angle, the identification plane is parallel to an image plane, the first preset straight line passes through first diagonal angles of the four positioning identifications in the object space, and the second preset straight line passes through second diagonal angles of the four positioning identifications in the object space;
when the identification deviation is front and back deviation, determining the current object distance according to the identification position, and taking the difference value of the current object distance and a preset standard object distance as the deviation amount corresponding to the identification deviation;
when the identification deviation is vertical deviation, determining a preset distance from the center of the four positioning identifications to a preset point in an object space according to the identification position, and taking the product of the preset distance and the sine value of a preset angle as a deviation amount corresponding to the identification deviation, wherein the preset point is an intersection point of a main optical axis of a lens of the camera and the identification plane, and the preset angle is an included angle between a straight line passing through the centers of the four positioning identifications and the preset point in the object space and a horizontal line;
when the identification deviation is horizontal deviation, determining preset distances from the centers of the four positioning identifications to a preset point in an object space according to the identification positions, and taking the product of the preset distances and cosine values of preset angles as deviation amount corresponding to the identification deviation;
and when the identification deviation is rotation deviation, determining a rotation angle of the target image around a main optical axis of a lens of the camera according to the identification position, and taking the rotation angle as a deviation amount corresponding to the identification deviation.
15. The method of claim 14, wherein determining a first projection angle and a second projection angle from the identified location comprises:
determining the first projection angle using the following equation:
Figure FDA0003168919470000041
determining the second projection angle using the following equation:
Figure FDA0003168919470000042
wherein α represents the first projection angle, β represents the second projection angle, A'1Representing a distance, A ', from a first location marker to a marker imaging center in the target image'2Representing a distance, A ', of a second location marker to a marker imaging center in the target image'3Representing a distance, A ', of a third location marker to a marker imaging center in the target image'4And f represents the focal length of the camera, wherein the identification imaging center is the intersection point of the diagonal lines of the four positioning identifications in the target image.
16. The method of claim 14, wherein determining a current object distance from the identified location comprises:
determining the imaging distance between any two positioning marks in the target image according to the mark positions;
and determining the current object distance according to the imaging distance and combining the imaging principle.
17. An image rectification apparatus, characterized by comprising:
the image acquisition module is configured to acquire a target image which is acquired by a camera and contains four positioning marks, wherein the four positioning marks are positioned on a mark plane in an object space, are sequentially arranged at equal intervals and are arranged in a surrounding manner;
an identification position determination module configured to determine identification positions of the four positioning identifications in the target image;
and the image rectification module is configured to rectify the target image according to the identification position.
18. The apparatus of claim 17, wherein the image rectification module comprises:
a deviation determination unit configured to determine an identification deviation based on the identification position;
and the image correction unit is configured to correct the target image according to the identification deviation.
19. An electronic device comprising a memory and one or more processors, the memory storing computer-readable instructions, wherein the one or more processors, when executing the computer-readable instructions, perform the steps of the method of any one of claims 1 to 16.
20. One or more non-transitory computer-readable instructions having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by one or more processors, implement the steps of the method of any one of claims 1 to 16.
CN202180001907.8A 2021-06-25 2021-06-25 Image correction method, device, electronic device and storage medium Active CN113678163B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/102453 WO2022267027A1 (en) 2021-06-25 2021-06-25 Image correction method and apparatus, and electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN113678163A true CN113678163A (en) 2021-11-19
CN113678163B CN113678163B (en) 2024-11-12

Family

ID=78551016

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202180001907.8A Active CN113678163B (en) 2021-06-25 2021-06-25 Image correction method, device, electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN113678163B (en)
WO (1) WO2022267027A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117579813B (en) * 2024-01-16 2024-04-02 四川新视创伟超高清科技有限公司 Focal depth region imaging chip pose angle correction method and system
CN120107628B (en) * 2025-04-25 2025-07-15 浙江大华技术股份有限公司 A method and device for processing data deviation

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060043264A1 (en) * 2004-09-02 2006-03-02 Casio Computer Co., Ltd. Imaging apparatus, image processing method for imaging apparatus, recording medium and carrier wave signal
CN106203257A (en) * 2016-06-27 2016-12-07 深圳市新国都支付技术有限公司 A kind of method and system of recognizable mark
CN110766615A (en) * 2019-09-09 2020-02-07 北京美院帮网络科技有限公司 Picture correction method, device, terminal and computer readable storage medium
CN113014896A (en) * 2019-12-19 2021-06-22 青岛海信激光显示股份有限公司 Projection image correction method, projection device and system
CN113516131A (en) * 2020-12-24 2021-10-19 阿里巴巴集团控股有限公司 Image processing method, device, equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4975679B2 (en) * 2008-04-18 2012-07-11 株式会社Pfu Notebook information processing apparatus and projective transformation parameter calculation method
CN105894467A (en) * 2016-03-30 2016-08-24 联想(北京)有限公司 Photography correcting method and system
WO2018053756A1 (en) * 2016-09-22 2018-03-29 华为技术有限公司 Image detection method and terminal
CN110677634B (en) * 2019-11-27 2021-06-29 成都极米科技股份有限公司 Trapezoidal correction method, device and system for projector and readable storage medium
CN112689135B (en) * 2021-03-19 2021-07-02 深圳市火乐科技发展有限公司 Projection correction method, projection correction device, storage medium and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060043264A1 (en) * 2004-09-02 2006-03-02 Casio Computer Co., Ltd. Imaging apparatus, image processing method for imaging apparatus, recording medium and carrier wave signal
CN106203257A (en) * 2016-06-27 2016-12-07 深圳市新国都支付技术有限公司 A kind of method and system of recognizable mark
CN110766615A (en) * 2019-09-09 2020-02-07 北京美院帮网络科技有限公司 Picture correction method, device, terminal and computer readable storage medium
CN113014896A (en) * 2019-12-19 2021-06-22 青岛海信激光显示股份有限公司 Projection image correction method, projection device and system
CN113516131A (en) * 2020-12-24 2021-10-19 阿里巴巴集团控股有限公司 Image processing method, device, equipment and storage medium

Also Published As

Publication number Publication date
WO2022267027A1 (en) 2022-12-29
CN113678163B (en) 2024-11-12

Similar Documents

Publication Publication Date Title
CN108932051B (en) Augmented reality image processing method, apparatus and storage medium
WO2018068719A1 (en) Image stitching method and apparatus
CN113923420B (en) Region adjustment method and device, camera and storage medium
WO2019183845A1 (en) Pan-tilt device control method, apparatus and system, computer storage medium and unmanned aerial vehicle
CN109920004B (en) Image processing method, device, calibration object combination, terminal equipment and calibration system
CN107133918B (en) Method for generating panorama at any position in three-dimensional scene
JP2011239361A (en) System and method for ar navigation and difference extraction for repeated photographing, and program thereof
US20130176337A1 (en) Device and Method For Information Processing
CN115174878B (en) Projection picture correction method, apparatus and storage medium
CN113678163A (en) Image correction method, device, electronic device and storage medium
CN105791663B (en) Distance estimation system and distance estimation method
CN115174879B (en) Projection screen correction method, apparatus, computer device and storage medium
JP2020067978A (en) Floor detection program, floor detection method, and terminal device
CN108604374A (en) A kind of image detecting method and terminal
JP2020071854A (en) Image processing apparatus, image processing method, and program
CN116817929A (en) Method and system for simultaneously positioning multiple targets on ground plane by unmanned aerial vehicle
WO2023274090A1 (en) Scanning method and system for portable electronic device, and electronic device and storage medium
TWM594322U (en) Camera configuration system with omnidirectional stereo vision
JP2009253715A (en) Camera calibrating device, camera calibrating method, camera calibrating program, and recording medium for recording the program
CN111161350B (en) Position information and position relation determining method, position information acquiring device
TWI412725B (en) The method of distance measurement and localization
CN116485902A (en) Mark point matching method, device, computer equipment and storage medium
US20180061135A1 (en) Image display apparatus and image display method
CN115278184A (en) Projection picture correction method and device
TWI831495B (en) Positioning system and positioning method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant