Image correction method, device, electronic device and storage medium

By setting four positioning markers on the target object and using a camera to acquire and correct the position of the markers in the image, the problems of large framing errors, low efficiency, and poor repeatability are solved, achieving high-precision and high-efficiency framing results.

CN113678163BActive Publication Date: 2024-11-12WINGTECH TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202180001907.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-25
Publication Date
2024-11-12
Estimated Expiration
2041-06-25

AI Technical Summary

Technical Problem

Existing framing technologies suffer from large errors, low efficiency, and poor repeatability, especially when relying on human observation and fine-tuning of the camera position using a viewfinder/preview display.

Method used

By pre-setting four positioning markers on the target object, a camera is used to acquire a target image containing these markers, determine the marker positions, and perform corrections. This includes image acquisition, marker position determination, and image correction modules, enabling precise adjustment of the target image.

Benefits of technology

It improves the accuracy and efficiency of framing, ensures the consistency of framing results, and reduces human error and poor repeatability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113678163B_ABST
    Figure CN113678163B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of image processing technology, and specifically to an image correction method, device, electronic device and storage medium. The method includes: obtaining a target image captured by a camera and containing four positioning marks, wherein the four positioning marks are located in a marking plane in the object space and are arranged in a circle with equal spacing in sequence; determining the marking positions of the four positioning marks in the target image; and correcting the target image according to the marking positions. The technical solution disclosed in the present disclosure automatically corrects the target image according to the four positioning marks in the target image, thereby improving the accuracy and efficiency of framing and ensuring the consistency of the framing results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of image processing technology, and in particular to an image correction method, device, electronic device and storage medium. Background Art

[0002] Framing is a necessary prerequisite for taking photos and videos. Framing is essentially determining the relative position of the camera and the target object on the six axes of space. Framing directly affects the quality of photos and videos.

[0003] Existing framing mainly relies on human eyes to observe the content of the photo in real time on the viewfinder or preview display to fine-tune the position of the camera, and sometimes relies on laser ranging devices to simply judge the distance of the target object. However, existing framing has problems such as large errors, low efficiency and poor repeatability. Summary of the invention

[0004] 1. Technical issues to be resolved

[0005] In the prior art, there are problems such as large errors, low efficiency and poor repeatability when taking pictures and framing.

[0006] (II) Technical solution

[0007] According to various embodiments disclosed in the present disclosure, an image correction method, an apparatus, an electronic device, and a storage medium are provided.

[0008] An image correction method, the method comprising:

[0009] Acquire a target image including four positioning marks captured by a camera, wherein the four positioning marks are located on a marking plane in the object space and are arranged in a circle with equal spacing in sequence;

[0010] Determine the marking positions of the four positioning marks in the target image;

[0011] The target image is corrected according to the marked position.

[0012] An image correction device, comprising:

[0013] An image acquisition module is configured to acquire a target image captured by a camera and including four positioning marks, wherein the four positioning marks are located on a marking plane in the object space and are arranged in a circle with equal spacing in sequence;

[0014] A marker position determination module, configured to determine marker positions of the four positioning markers in the target image;

[0015] The image correction module is configured to correct the target image according to the marked position.

[0016] An electronic device includes a memory and one or more processors, wherein the memory stores computer-readable instructions, and when the one or more processors execute the computer-readable instructions, the steps of an image correction method provided by any embodiment of the present disclosure are implemented.

[0017] One or more non-volatile computer-readable storage media storing computer-readable instructions, on which computer-readable instructions are stored, and when the computer-readable instructions are executed by one or more processors, the steps of an image correction method provided by any embodiment of the present disclosure are implemented.

[0018] (III) Beneficial effects

[0019] The disclosed embodiments provide an image correction method, device, electronic device and storage medium, which obtains a target image captured by a camera and includes four positioning marks, wherein the four positioning marks are located in the marking plane in the object space and are arranged in a circle with equal spacing in sequence; determines the marking positions of the four positioning marks in the target image; and corrects the target image according to the marking positions. The disclosed technical solution pre-sets four positioning marks on the target object, uses a camera to obtain a target image corresponding to the target object including the above four positioning marks, and determines the deviation of the photographed target object according to the marking positions of the four positioning marks in the target image, thereby quickly correcting the target image according to the marking positions, thereby improving the accuracy and efficiency of framing and ensuring the consistency of the framing results.

[0020] Other features and advantages of the present disclosure will be described in the subsequent description, and partly become apparent from the description. The objects and other advantages of the present disclosure are realized and obtained by the structures specifically 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, the following is a detailed description of the optional embodiments in conjunction with the attached drawings as follows. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0023] Figure 1 A schematic diagram of a positioning mark in one or more embodiments;

[0024] Figure 2 A schematic diagram of a marking plane in one or more embodiments;

[0025] Figure 3 A schematic diagram of an application scenario in one or more embodiments;

[0026] Figure 4 is a schematic diagram of a deviation image and a standard image in one or more embodiments;

[0027] Figure 5 is a flowchart of an image correction method in one or more embodiments;

[0028] Figure 6 is a flowchart of an image correction method in one or more embodiments;

[0029] Figure 7 is a schematic diagram of a positional relationship between an image plane and a marking plane in one or more embodiments;

[0030] Figure 8 A schematic diagram of a projection angle measurement in one or more embodiments;

[0031] Fig. 9 is a structural block diagram of an image correction device in one or more embodiments;

[0032] Fig.10 1 is a diagram of the internal structure of an electronic device in one or more embodiments. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.

[0034] At present, framing mainly relies on human eyes 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, there will inevitably be 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, and the framing efficiency is low; in addition, the consistency of multiple framing results is an important prerequisite for ensuring image quality evaluation, but positioning based on human eye observation has the disadvantage of poor repeatability.

[0035] In response to the above technical problems, the embodiment of the present disclosure obtains a target image containing four positioning markers captured by a camera, identifies the positions of the four positioning markers in the target image, and corrects the target image, thereby improving the accuracy and efficiency of framing and ensuring the consistency of framing results.

[0036] The positioning mark involved in the embodiment of the present disclosure may be a graphic with high contrast and spatial symmetry, which can have high anti-interference ability in image recognition. The positioning mark may be as follows: Figure 1 The graphics shown, such as positioning mark 110, positioning mark 120, positioning mark 130 and positioning mark 140, do not limit the specific graphic structure of the positioning marks.

[0037] In the embodiment of the present disclosure, four positioning marks can be placed at fixed spatial positions relative to the photographed target to obtain a marking plane, for example, Figure 2 A schematic diagram of a logo plane is shown, using Figure 1 The four positioning marks 120 are placed in the object space in turn with equal spacing to obtain a marking 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 marking plane can be the same or different.

[0038] The image correction method provided in the embodiment of the present disclosure may be executed by a terminal or a server. The terminal or the server may correct the target image according to the positions of the four positioning marks in the target image.

[0039] For example, in an application scenario, such as Figure 3 As shown, 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. The terminal 31 directly corrects the target image according to the received deviation, wherein the target image may be obtained by the terminal 31 and sent to the server 32. Alternatively, the target image is obtained by the terminal 31 from other devices. Alternatively, the target image is an image obtained by the terminal 31 after performing image processing on a preset image, and the preset image may be obtained by the terminal 31, or the preset image may be obtained by the terminal 31 from other devices. Here, other devices are not specifically limited.

[0040] In another application scenario, the terminal 31 acquires a target image and sends the target image to the server 32 , and the server 32 corrects the target image according to the positions of four positioning marks in the target image.

[0041] In another application scenario, the terminal 31 captures a target image, and further, the terminal 31 corrects the target image according to the positions of four positioning marks in the target image.

[0042] In the actual framing process, due to the deviation of the relative position between the camera and the target object, the target image captured by the camera deviates from the standard image. In the embodiment of the present disclosure, the deviation of the target image from the standard image may include any one or a combination of the following: front-back deviation (reference Figure 4 Image in (a)); horizontal deviation (ref. Figure 4 Image in (b)); vertical deviation (ref. Figure 4 Image in (c)); rotation deviation (ref. Figure 4 Image in (d)); left-right flip deviation (ref. Figure 4 Image in (e)); upside-down deviation (ref. Figure 4 In addition, Figure 4 The image (o) in is the standard image. In the embodiment of the present disclosure, when the target image captured by the camera has at least one of the front-to-back deviation, horizontal deviation, vertical deviation and rotation deviation, the image plane of the camera is still parallel to the identification plane, and when the target image captured by the camera has a flip deviation such as left-right flip deviation or up-down flip deviation, the image plane of the camera intersects with the identification plane. The technical solution disclosed in the present disclosure can calculate any of the above deviations or combined deviations, thereby correcting the target image to obtain a standard image.

[0043] In one embodiment, Figure 5 As shown, an image correction method is provided. The image correction method is applicable to the precise positioning of the relative position between the camera and the target object, and can be applied to shooting scenes such as automatic optical detection and machine vision. This embodiment uses the method applied to a terminal as an example, and the terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The image correction method includes the following: Figure 5 The following steps are shown:

[0044] S510: Obtain a target image including four positioning marks captured by a camera.

[0045] Optionally, the four positioning marks are located on the marking plane in the object space and are arranged in a circle with equal spacing.

[0046] It can be understood that relative to the shooting target (target object), four positioning marks are placed at fixed spatial positions in the object space (real space), referring to Figure 2 The positions of the four positioning marks in the marking plane shown, when there is a certain distance (object distance) between the camera and the shooting target, the camera collects information including the four positioning marks and the shooting target to generate a target image. The disclosed embodiment is not limited to obtaining the target image by taking a photo, and the target image can also be obtained by previewing screenshots and recording videos.

[0047] S520: Determine the positions of four positioning markers in the target image.

[0048] It is understandable that, based on the above S510, the image processing algorithm can be used to calculate the identification positions of the four positioning markers in the target image, wherein the identification positions include the specific position information of the four positioning markers in the target image, such as the coordinates of the four positioning markers in the rectangular coordinate system of the target image.

[0049] S530: Correct the target image according to the marked position.

[0050] In the disclosed embodiment, four positioning marks are used to locate the relative position of the camera and the target object it is photographing, so that the relative position of the camera and the target object can be determined based on the mark positions of the four positioning marks, and then the relative position of the camera and the target object can be corrected by correcting the mark positions, thereby achieving correction of the target image to obtain a standard image corresponding to the target image.

[0051] In the above embodiment, a target image including four positioning marks captured by a camera is obtained, wherein the four positioning marks are located in the marking plane in the object space and are arranged in a circle with equal spacing in sequence; the marking positions of the four positioning marks in the target image are determined; and the target image is corrected according to the marking positions. The disclosed technical solution pre-sets four positioning marks on the target object, uses a camera to obtain the target image corresponding to the target object including the above four positioning marks, and determines the deviation of the photographed target object according to the marking positions of the four positioning marks in the target image, thereby quickly correcting the target image according to the marking positions, thereby improving the accuracy and efficiency of framing and ensuring the consistency of the framing results.

[0052] In one embodiment, Figure 6 As shown, an image correction method is provided. In this embodiment, the target image is corrected according to the marked position, including: Figure 6 The following steps are shown:

[0053] S610: Determine a marker deviation according to the marker position.

[0054] Among them, the identification deviation is used to characterize the deviation between the target image and the standard image. The standard image is an image that is pre-shot and meets the framing requirements and serves as a reference image for correcting the target image. Optionally, the identification deviation includes at least one of front-to-back deviation, vertical deviation, horizontal deviation, rotation deviation and flip deviation, that is, the identification deviation can be a front-to-back deviation, a vertical deviation, a horizontal deviation, a rotation deviation or a flip deviation, or a combination of two or more of the front-to-back deviation, the vertical deviation, the horizontal deviation, the rotation deviation and the flip deviation. In the embodiment of the present disclosure, the front-to-back deviation refers to the target image being enlarged or reduced relative to the standard image, but the imaging plane is parallel to the identification plane. In actual shooting, it is reflected in the case where the main optical axis of the camera is perpendicular to the identification plane, the camera is facing the target object, and the camera is too close or too far from the target object when moving along its main optical axis; the vertical deviation refers to the target image being offset up and down relative to the standard image, but the imaging plane is parallel to the identification plane. In actual shooting, it is reflected in the case where the main optical axis of the camera is perpendicular to the identification plane, the camera is not facing the target object, and is translated upward or downward relative to the target object; the horizontal deviation refers to the target image being offset left and right relative to the standard image, but the imaging plane is parallel to the identification plane. In actual shooting, it is reflected in the case where the main optical axis of the camera is perpendicular to the identification plane, the camera is not facing the target object, and is translated upward or downward relative to the target object. It is reflected in the case that the main optical axis of the camera is perpendicular to the identification plane, the camera is not facing the target object, and is translated to the left or right relative to the target object; rotation deviation refers to the target image rotating counterclockwise or clockwise relative to the standard image, but the imaging plane is parallel to the identification plane. In actual shooting, it is reflected in the case that the main optical axis of the camera is perpendicular to the identification plane, the camera is facing the target object, and the camera rotates clockwise or counterclockwise around its main optical axis; flip deviation refers to the target image flipped relative to the standard image, and the imaging plane intersects with the identification plane. In actual shooting, it is reflected in the case that the main optical axis of the camera is not perpendicular to the identification plane, and the camera shoots the target object, that is, the camera shoots the target object at a certain tilt angle.

[0055] Optionally, determining a marking deviation according to the marking position includes S611 and S612:

[0056] S611: Determine the positional relationship between the camera's image plane and the identification plane according to the identification position.

[0057] The positional relationship includes that the image plane is parallel to or intersects the identification plane. The image plane refers to the plane where the target image captured by the camera is located. It can be understood that the positional relationship is the positional relationship between the image plane and the identification plane when the camera captures the target image.

[0058] In one implementation of the present embodiment, when the lengths of the first set of opposite sides determined by the marking position are equal, and the lengths of the second set of opposite sides determined by the marking position are equal, the image plane is parallel to the marking plane; when the lengths of any one of the first set of opposite sides determined by the marking position and the second set of opposite sides are not equal, the image plane intersects with the marking plane.

[0059] Specifically, the four positioning marks include the first positioning mark, the second positioning mark, the third positioning mark and the fourth positioning mark in the arrangement direction. According to the mark position, the two-point distance algorithm can be used to determine the first imaging distance between the first positioning mark and the second positioning mark, the second imaging distance between the second positioning mark and the third positioning mark, the third imaging distance between the third positioning mark and the fourth positioning mark, and the fourth imaging distance between the fourth positioning mark and the first positioning mark. Among them, the edges corresponding to the first imaging distance and the third imaging distance are the first set of opposite edges, and the edges corresponding to the second imaging distance and the fourth imaging distance are the second set of opposite edges. Therefore, 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 identification plane; when the first imaging distance is not equal to the third imaging distance, or the second imaging distance is not equal to the fourth imaging distance, the image plane intersects with the identification plane.

[0060] Exemplary, reference Figure 7 , 710 indicates that the image plane 712 is parallel to the identification plane 711, that is, the camera 713 is placed in front of the identification plane 711, and the camera 713 is in front of the intersection of the diagonal lines of the four positioning marks in the identification plane 711, that is, the dotted line in the figure is perpendicular to the identification plane 711, and the camera 713 generates a target image in 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 generated target image can be regarded as the image of the identification plane after reduction. 720 indicates that the image plane 721 intersects with the identification plane 711, and the lens of the camera 713 is tilted at an angle to the identification plane 711, that is, the main optical axis of the camera 713 is not perpendicular to the identification plane 711, and the positions of the four positioning marks in the image plane 721 corresponding to the camera 713 are also tilted relative to the identification plane 711. At this time, the positions of the four positioning marks in the target image are tilted compared to the positions of the four positioning marks in the identification plane. Figure 7 The four positioning marks in the target image are the first positioning mark P1', the second positioning mark P2', the third positioning mark P3' and the fourth positioning mark P4'. At this time, the first imaging distance can be calculated according to the positions of P1' and P2', the second imaging distance can be calculated according to the positions of P2' and P3', the third imaging distance can be calculated according to the positions of P3' and P4', and the fourth imaging distance can be calculated according to the positions of P4' and P1'.

[0061] S612: Determine the identification deviation according to the position relationship and the identification position.

[0062] This embodiment first determines the positional relationship based on the marker position, and then determines the marker deviation based on the marker position when the positional relationship is determined, which can improve the efficiency and accuracy of the marker deviation determination. For example, when the marker deviation is determined directly based on the marker position, if the distance between the two positioning markers determined by the marker position is not equal to the standard distance, the marker deviation may be a front-to-back deviation or a flipping deviation, and further determination of the marker deviation is required. In the case where the positional relationship is determined, for example, if the positional relationship is that the image plane is parallel to the marker plane, then the marker deviation in the above case can only be a front-to-back deviation, and if the positional relationship is that the image plane intersects the marker plane, then the marker deviation in the above case can only be a flipping deviation.

[0063] 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 parallel to the second side determined by the preset standard position. The preset standard position is the position of the four positioning marks in the standard image; in the rectangular coordinate system, the identification coordinates of the four positioning marks in the target image and the standard coordinates in the standard image are determined. Among them, the target image point can be located in 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 horizontal coordinate and the vertical coordinate are both positive values, which is convenient for calculation. Reference Figure 4 , the four positioning marks P1", P2", P3" and P4" in the standard image (o), the edge P1"P2" formed by connecting P1" and P2" is the first edge determined by the preset standard position, and the edge P2"P3" formed by connecting P2" and P3" is the second edge determined by the preset standard position.

[0064] Accordingly, the identification deviation is determined according to the position relationship and the identification position, including at least one of the following:

[0065] 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 the corresponding two points determined by the standard coordinates, the identification deviation is determined to be the front-back deviation;

[0066] When the image plane is parallel to the identification plane, and the average value of the ordinate determined by the identification coordinates is not equal to the average value of the ordinate determined by the standard coordinates, the identification deviation is determined to be a vertical deviation;

[0067] When the image plane is parallel to the identification 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 to be a horizontal deviation;

[0068] When the image plane is parallel to the identification plane, and a straight line passing through the midpoints of the first set of opposite sides determined by the identification coordinates intersects the y-axis, or a straight line passing through the midpoints of the second set of opposite sides determined by the identification coordinates intersects the x-axis, the identification deviation is determined to be a rotational deviation;

[0069] When the image plane intersects the identification plane, and a first set of opposite sides determined by the identification coordinates are not equal, or a second set of opposite sides determined by the identification coordinates are not equal, the identification deviation is determined to be a flip deviation.

[0070] Exemplary, reference Figure 4 In the target image (a), the distance P1'P2' between P1' and P2' is determined by the coordinates of P1' and P2'. In the standard image (o), the distance P1"P2" between P1" and P2" is determined by the corresponding coordinates of P1" and P2". When P1'P2' is not equal to P1"P2", the identification deviation is determined to be the front-to-back deviation. Specifically, the front-to-back deviation may include a forward translation deviation or a backward translation deviation. When P1'P2' is greater than P1"P2", it is a forward translation deviation, that is, the camera is too close to the target object; when P1'P2' is less than P1"P2", it is a backward translation deviation, that is, the camera is too far from the target object.

[0071] refer to Figure 4 , when the average value of the ordinates determined by the coordinates of P1', P2', P3' and P4' in the target image (c) is not equal to the average value of the ordinates determined by the coordinates of P1", P2", P3" and P4" in the standard image (o), the identification deviation is determined to be a vertical deviation. Specifically, the vertical deviation includes an upward translation deviation or a downward translation deviation. When the average value of the ordinates determined by the coordinates of P1', P2', P3' and P4' is greater than the average value of the ordinates determined by the coordinates of P1", P2", P3" and P4", it is an upward translation deviation, that is, the camera is offset downward relative to the target object; when the average value of the ordinates determined by the coordinates of P1', P2', P3' and P4' is less than the average value of the ordinates determined by the coordinates of P1", P2", P3" and P4", it is a downward translation deviation, that is, the camera is offset upward relative to the target object.

[0072] refer to Figure 4, when the average value of the horizontal coordinates determined by the coordinates of P1', P2', P3' and P4' in the target image (b) is not equal to the average value of the horizontal coordinates determined by the coordinates of P1", P2", P3" and P4" in the standard image (o), the identification deviation is determined to be a horizontal deviation. Specifically, the horizontal deviation includes a left translation deviation or a right translation deviation. When the average value of the horizontal coordinates determined by the coordinates of P1', P2', P3' and P4' is greater than the average value of the horizontal coordinates determined by the coordinates of P1", P2", P3" and P4", it is a right translation deviation, that is, the camera is offset to the left relative to the target object; when the average value of the horizontal coordinates determined by the coordinates of P1', P2', P3' and P4' is less than the average value of the horizontal coordinates determined by the coordinates of P1", P2", P3" and P4", it is a left translation deviation, that is, the camera is offset to the right relative to the target object.

[0073] refer to Figure 4 , in the target image (d), the side P1'P2' determined by the coordinates of P1' and P2' and the side P3'P4' determined by the coordinates of P3' and P4' are the first set of opposite sides, the side P2'P3' determined by the coordinates of P2' and P3' and the side P4'P1' determined by the coordinates of P4' and P1' are the second set of opposite sides, the straight line passing through the midpoint of P1'P2' and the midpoint of P3'P4' is the straight line passing through the midpoint of the first set of opposite sides, and the straight line passing through the midpoint of P2'P3' and the midpoint of P4'P1' 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 with the y-axis, or the straight line passing through the midpoint of the second set of opposite sides intersects with the x-axis, it is determined that the identification deviation is a rotation deviation. Specifically, the rotation deviation includes a counterclockwise rotation deviation or a clockwise rotation deviation. Exemplarily, the straight line passing through the midpoint of the first set of opposite sides intersects with the y-axis as an example for explanation. Assuming that the counterclockwise direction is the positive direction, when the angle between the straight line passing through the midpoint of the first set 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 straight line passing through the midpoint of the first set of opposite sides 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.

[0074] In addition, the flip deviation includes left-right flip deviation and / or up-down flip deviation. Figure 4In the target image (e), the edge P2'P3' determined by the coordinates of P2' and P3' and the edge P4'P1' determined by the coordinates of P4' and P1' are the second set of opposite edges. When P2'P3' and P4'P1' are not equal, it is a left-right flip deviation. Specifically, the left-right flip deviation includes a left flip deviation or a right flip deviation. When P2'P3' is greater than P4'P1', it is a left flip deviation, that is, the camera is flipped to the left relative to the target object; when P2'P3' is less than P4'P1', it is a right flip deviation, that is, the camera is flipped to the right relative to the target object. In the target image (f), the edge P1'P2' determined by the coordinates of P1' and P2' and the edge P3'P4' determined by the coordinates of P3' and P4' are the first set of opposite edges. When P1'P2' and P3'P4' are not equal, it is an up-down flip deviation. Specifically, the up-down flip deviation includes an upward flip deviation or a downward flip deviation. When P1'P2' is greater than P3'P4', it is a downward flip deviation, that is, the camera is flipped downward relative to the target object; when P1'P2' is less than P3'P4', it is an upward flip deviation, that is, the camera is flipped upward relative to the target object.

[0075] S620: Correct the target image according to the identified deviation.

[0076] In the disclosed embodiment, the correction of the target image is achieved by adjusting the position of the camera and / or the position of the target object. That is, according to the identification deviation, the position of the camera and / or the position of the target object is adjusted until the identification deviation meets the preset deviation condition, wherein the four identifications are located on the target object, so that the target image can be corrected according to the identification deviation. The preset deviation condition is that the identification deviation meets the framing requirements, and the preset deviation condition can be set according to different application scenarios. Preferably, the preset deviation condition is that the identification deviation does not exist.

[0077] In this embodiment, the target image may be corrected step by step, or the target image may be corrected all at once by calculating a specific deviation amount.

[0078] In an implementation scheme of this embodiment, according to the identification deviation, the position and posture of the camera and / or the position and posture of the target object are adjusted until the identification deviation meets the preset deviation condition, including S621 and S622:

[0079] S621: Determine a first compensation parameter of the camera and / or the target object according to the identification deviation.

[0080] Among them, 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 posture of the camera or the target object separately to achieve the correction of the target image, and can also adjust the posture of the camera and the target object at the same time to achieve the correction of the target image. Since the camera and the target image are relatively arranged, 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, the adjustment of the posture of the camera is used as an example for explanation. When the identification deviation is a forward translation deviation, the first compensation type is length, and the first compensation direction is backward translation; when the identification deviation is a left translation deviation, the first compensation type is length, and the first compensation direction is left 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 downward flip. Other situations in which the first compensation parameter is determined according to the identification deviation can refer to the above determination method, which will not be repeated here.

[0081] S622: According to the first compensation parameter, the position and posture of the camera and / or the position and posture of the target object are adjusted in a step-by-step manner until the marked deviation meets a preset deviation condition.

[0082] Specifically, including S6221 to S6226:

[0083] S6221: Adjust 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.

[0084] Exemplarily, the adjustment of the camera's posture is used as an example for explanation. The disclosed embodiment can use a stepper motor to implement step adjustment of the camera's posture, and the preset compensation amount is the amount of one step preset by the stepper motor, which can be determined as a step length or a step angle according to the first compensation type. For example, when the identification deviation is a forward translation deviation, the stepper motor controls the camera to translate backward by a first preset length L1; when the identification deviation is a left translation deviation, the stepper motor controls the camera to translate left by a second preset length L2; when the identification deviation is a counterclockwise rotation deviation, the stepper motor controls the camera to rotate counterclockwise by a first preset angle A1; when the identification deviation is an upward flip deviation, the stepper motor controls the camera to flip downward by a second preset angle A2.

[0085] S6222: Capture a current image including four positioning marks through a camera, and use the current image as a target image.

[0086] S6223: Determine the positions of four positioning markers in the target image.

[0087] S6224: Determine the marking deviation according to the marking position.

[0088] S6225: Determine a first compensation parameter of the camera and / or the target object according to the identification deviation.

[0089] S6226: Return to the first compensation direction, and adjust the camera and / or the target object again according to the preset compensation amount corresponding to the first compensation type until the marked deviation meets the preset deviation condition.

[0090] In this embodiment, since it is not necessary to determine the precise deviation amount, it is possible to determine whether the identification deviation satisfies the preset deviation condition in the process of determining the identification deviation. Exemplarily, when the identification deviation is a forward translation deviation, it is possible to determine 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 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.

[0091] In another implementation of this embodiment, the target image can be corrected at one time by calculating the specific deviation amount.

[0092] Specifically, the method further includes: determining the deviation amount corresponding to the identification deviation according to the identification position. Accordingly, adjusting the position of the camera and / or the position of the target object according to the identification deviation until the identification deviation meets the preset deviation condition, including S623 and S624:

[0093] S623: Determine a second compensation parameter of the camera and / or the target object according to the identification deviation.

[0094] 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 first compensation parameter, and will not be described in detail here.

[0095] S624: Adjust the position and posture of the camera and / or the position and posture of the target object according to the second compensation parameter and the deviation amount corresponding to the identified deviation.

[0096] In this embodiment, the camera and / or the target object are adjusted along the second compensation direction according to the deviation amount corresponding to the second compensation type. Thus, the camera and / or the target object can be adjusted to a standard posture at one time, and the target image can be corrected through one compensation, further improving the efficiency of framing.

[0097] In the above solution, determining the deviation amount corresponding to the marker deviation according to the marker position includes at least one of the following:

[0098] 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 is rotated around the first preset straight line by the second projection angle, and after being rotated around the second preset straight line by the first projection angle, it is parallel to the image plane, the first preset straight line passes through the first diagonal corners of the four positioning marks in the object space, and the second preset straight line passes through the second diagonal corners of the four positioning marks in the object space;

[0099] When the marked deviation is a front-back deviation, the current object distance is determined according to the marked position, and the difference between the current object distance and the preset standard object distance is taken as the deviation amount corresponding to the marked deviation;

[0100] When the marking 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 marking position, and the product of the preset distance and the sine value of the preset angle is taken as the deviation amount corresponding to the marking deviation, wherein 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 straight line passing through the center of the four positioning marks in the object space and the preset point and the horizontal line;

[0101] When the mark deviation is a horizontal 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 cosine value of the preset angle is used as the deviation amount corresponding to the mark deviation;

[0102] 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.

[0103] Optionally, determining the first projection angle and the second projection angle according to the marker position includes:

[0104] The first projection angle is determined using the following formula:

[0105]

[0106] The second projection angle is determined using the following formula:

[0107]

[0108] Among them, α represents the first projection angle, β represents the second projection angle, A'1 represents the distance from the first positioning marker to the marker imaging center in the target image, A'2 represents the distance from the second positioning marker to the marker imaging center in the target image, A'3 represents the distance from the third positioning marker to the marker imaging center in the target image, A'4 represents the distance from the fourth positioning marker to the marker imaging center in the target image, f represents the focal length of the camera, and the marker imaging center is the intersection of the diagonal lines of the four positioning markers in the target image.

[0109] Specifically, the first projection angle and the second projection angle are calculated by the following formulas (1)-(12): Figure 8 The symbols marked in are explained.

[0110] Combination Figure 8 And the imaging formula can get formula (1) and formula (2).

[0111]

[0112] Among them, point O is the intersection of the straight line LP2 connecting the camera L and the second positioning mark P2 and the straight line passing through the midline point C and perpendicular to the straight line CL, P is the intersection of the extended line LP4 connecting the camera and the fourth positioning mark P4 and the straight line passing through the midline point C and perpendicular to the straight line CL, D is the distance between the center point C and the camera center L, C' is the intersection of the line connecting P1' and P3' in the target image and the line connecting P2' and P4', A'2 is the distance between C' and P2', and f is the focal length of the camera.

[0113]

[0114] Wherein, A'4 is the distance between C' and P4'.

[0115] Combination Figure 8 and three The angular geometric relationship can be obtained from formula (3) to formula (8).

[0116] P2C=A Formula (3)

[0117] Wherein, A is the distance between the second positioning mark P2 and the center point C in the marking plane.

[0118] P4C=A Formula (4)

[0119] Among them, the distance from any positioning mark to the center point C in the marking plane is equal to A.

[0120] P2M=A×cosα Formula (5)

[0121] Among them, P2M is perpendicular to MC, and the angle between P2M and P2C is the first projection angle α.

[0122] P4N=A×cosα Formula (6)

[0123] Among them, P4N is perpendicular to CL, and the angle between P4N and P4C is the first projection angle α.

[0124] MC=A×sinα Formula (7)

[0125] NC=A×sinα Formula (8)

[0126] According to the similarity between the triangle composed of P2ML and the triangle composed of OCL, formula (9) can be obtained.

[0127]

[0128] Combining the above formula (1), formula (5), formula (7) and formula (9), the following formula (10) is obtained.

[0129]

[0130] According to the similarity between the triangle composed of P4NL and the triangle composed of PCL, formula (11) can be obtained.

[0131]

[0132] Combining the above formula (2), formula (6), formula (8) and formula (10), the following formula (12) is obtained.

[0133]

[0134] According to formula (10) and formula (12), the first projection angle α can be obtained.

[0135] In addition, the calculation method of the second projection angle β is the same as the principle of the first projection angle α, which will not be described in detail here.

[0136] Optionally, determine the current object distance, including:

[0137] According to the mark positions, the imaging distance between any two positioning marks in the target image is determined; according to the imaging distance and in combination with the imaging principle, the current object distance is determined.

[0138] Optionally, determining a rotation angle of the target image around a principal optical axis of a camera lens according to the marked position includes:

[0139] refer to Figure 4 The target image (d) in the image is rotated by the following formula:

[0140] or,

[0141]

[0142] Among them, the coordinates of P1' are (x1', y1'), the coordinates of P2' are (x2', y2'), the coordinates of P3' are (x3', y3'), and the coordinates of P3' are (x3', y3').

[0143] In one embodiment, Fig. 9 As shown, an image correction device 900 is provided, which includes an image acquisition module 910, a mark position determination module 920 and an image correction module 930; wherein the image acquisition module 910 is configured to acquire a target image captured by a camera and containing four positioning marks, wherein the four positioning marks are located in a mark plane in the object space and are arranged in a circle at equal intervals in sequence; the mark position determination module 920 is configured to determine the mark positions of the four positioning marks in the target image; and the image correction module 930 is configured to correct the target image according to the mark positions.

[0144] For the specific definition of the image correction device, please refer to the definition of the image correction method above, which will not be repeated here. Each module in the above-mentioned image correction device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of one or more processors in the electronic device in the form of hardware, or can be stored in the memory of the electronic device in the form of software, so that one or more processors can call and execute the operations corresponding to the above modules.

[0145] Optionally, the image correction module 930 includes: a deviation determination unit configured to determine the identification deviation according to the identification position; and an image correction unit configured to correct the target image according to the identification deviation.

[0146] Optionally, the deviation determination unit includes: a position relationship determination subunit, configured to determine the position relationship between the image plane of the camera and the identification plane based on the identification position, wherein the position relationship includes the image plane being parallel to or intersecting the identification plane; and a deviation determination subunit, configured to determine the identification deviation based on the position relationship and the identification position.

[0147] Optionally, the position relationship determination subunit is specifically configured as follows: when the lengths of the first group of opposite sides determined by the identification position are equal, and the lengths of the second group of opposite sides determined by the identification position are equal, the image plane is parallel to the identification plane; when the lengths of any one of the first group of opposite sides determined by the identification position and the second group of opposite sides are not equal, the image plane intersects with the identification plane.

[0148] 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.

[0149] Optionally, the image correction device also includes: a coordinate system establishment module, configured to establish a rectangular coordinate system 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 parallel to the second side determined by the preset standard position, and the preset standard position is the position of the four positioning markers in the standard image; a marker coordinate determination module, configured to determine the marker coordinates of the four positioning markers in the target image and the standard coordinates in the standard image under the rectangular coordinate system.

[0150] Optionally, the deviation determination subunit is specifically configured as follows: 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 the corresponding two points determined by the standard coordinates, the identification deviation is determined to be a front-to-back deviation; when the image plane is parallel to the identification plane, and the average value of the vertical coordinates determined by the identification coordinates is not equal to the average value of the vertical coordinates determined by the standard coordinates, the identification deviation is determined to be a vertical deviation; when the image plane is parallel to the identification plane, and the average value of the horizontal coordinates determined by the identification coordinates is not equal to the average value of the horizontal coordinates determined by the standard coordinates, the identification deviation is determined to be a horizontal deviation; when the image plane is parallel to the identification plane, and a straight line passing through the midpoints of a first set of opposite sides determined by the identification coordinates intersects the y-axis, or a straight line passing through the midpoints of a second set of opposite sides determined by the identification coordinates intersects the x-axis, the identification deviation is determined to be a rotational deviation; when the image plane intersects with the identification plane, and the first set of opposite sides determined by the identification coordinates are not equal, or the second set of opposite sides determined by the identification coordinates are not equal, the identification deviation is determined to be a flipping deviation.

[0151] Optionally, the front-to-back deviation includes a forward translation deviation or a backward translation deviation, the vertical deviation includes an upward translation deviation or a downward translation deviation, the horizontal deviation includes a left translation deviation or a right translation deviation, the rotation deviation includes a counterclockwise rotation deviation or a clockwise rotation deviation, and the flip deviation includes one or two of an upward flip deviation, a downward flip deviation, a left flip deviation and a right flip deviation.

[0152] Optionally, the image correction unit includes: a posture adjustment subunit, configured to adjust the posture of the camera and / or the posture of the target object according to the marker deviation until the marker deviation meets a preset deviation condition and the four markers are located on the target object.

[0153] Optionally, the posture adjustment subunit is specifically configured to: determine a first compensation parameter of the camera and / or the target object based on the identification deviation, the first compensation parameter including a first compensation type and a first compensation direction, the first compensation type including an angle and / or a length; according to the first compensation parameter, stepwise adjust the posture of the camera and / or the posture of the target object until the identification deviation meets a preset deviation condition.

[0154] Optionally, when the posture adjustment subunit stepwise adjusts the posture of the camera and / or the posture of the target object according to the first compensation parameter until the identification deviation meets the preset deviation condition, it is specifically configured as follows: 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; capture the current image containing four positioning markers through the camera, and use the current image as the target image; determine the identification positions of the four positioning markers in the target image; determine the identification deviation according to the identification position; determine the first compensation parameter of the camera and / or the target object according to the identification deviation; return to the first compensation direction, 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 meets the preset deviation condition.

[0155] Optionally, the device further includes: a deviation determination module configured to determine the deviation corresponding to the identification deviation according to the identification position. The posture adjustment subunit is specifically configured to: determine a second compensation parameter of the camera and / or the target object according to the identification deviation, the second compensation parameter including a second compensation type and a second compensation direction, the second compensation type including an angle and / or a length; and adjust the posture of the camera and / or the posture of the target object according to the second compensation parameter and the deviation corresponding to the identification deviation.

[0156] Optionally, the deviation determination module is specifically configured as follows: when the identification deviation is a flipping deviation, the first projection angle and the second projection angle are determined according to the identification position, and the first projection angle and the second projection angle are used as the deviation corresponding to the identification deviation, wherein the identification plane is rotated around the first preset straight line by the second projection angle, and after rotating around the second preset straight line by the first projection angle, it is parallel to the image plane, the first preset straight line passes through the first opposite corners of the four positioning marks in the object space, and the second preset straight line passes through the second opposite corners of the four positioning marks in the object space; when the identification deviation is a front-to-back deviation, the current object distance is determined according to the identification position, and the difference between the current object distance and the preset standard object distance is used as the deviation corresponding to the identification deviation; when the identification deviation is a vertical deviation, according to the identification position, Determine the preset distance from the center of the four positioning marks in the object space to the preset point, and use the product of the preset distance and the sine value of the preset angle as the deviation corresponding to the marking deviation, wherein 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 straight line passing through the center of the four positioning marks in the object space and the preset point and the horizontal line; when the marking deviation is a horizontal deviation, determine the preset distance from the center of the four positioning marks in the object space to the preset point according to the marking position, and use the product of the preset distance and the cosine value of the preset angle as the deviation corresponding to the marking deviation; when the marking deviation is a rotational deviation, determine the rotation angle of the target image around the main optical axis of the camera lens according to the marking position, and use the rotation angle as the deviation corresponding to the marking deviation.

[0157] Optionally, when the deviation determination module determines the first projection angle and the second projection angle according to the marked position, it is specifically configured to: determine the first projection angle using the following formula:

[0158]

[0159] The second projection angle is determined using the following formula:

[0160]

[0161] Among them, α represents the first projection angle, β represents the second projection angle, A'1 represents the distance from the first positioning marker to the marker imaging center in the target image, A'2 represents the distance from the second positioning marker to the marker imaging center in the target image, A'3 represents the distance from the third positioning marker to the marker imaging center in the target image, A'4 represents the distance from the fourth positioning marker to the marker imaging center in the target image, f represents the focal length of the camera, and the marker imaging center is the intersection of the diagonal lines of the four positioning markers in the target image.

[0162] Optionally, when the deviation determination module determines the current object distance according to the marker position, it is specifically configured to: determine the imaging distance between any two positioning markers in the target image according to the marker position; and determine the current object distance according to the imaging distance and in combination with the imaging principle.

[0163] In one embodiment, an electronic device is provided. The electronic device may be a terminal, and its internal structure diagram may be as follows: Fig.10 As shown. The electronic device includes a processor, a memory, a communication interface, a display screen and an input device connected via 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 operation of the operating system and computer-readable instructions in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, an operator network, near field communication (NFC) or other technologies. When the computer-readable instructions are executed by one or more processors, a method is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.

[0164] Those skilled in the art will understand that Fig.10The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0165] In one embodiment, the image correction device provided by the present disclosure can be implemented in the form of a computer-readable instruction. The computer-readable instruction can be Fig.10 The memory of the electronic device may store various program modules constituting the image correction device, for example, Fig. 9 The image acquisition module 910, the identification position determination module 920 and the image correction module 930 are shown. The computer-readable instructions constituted by each program module enable one or more processors to execute the steps of the image correction method of each embodiment of the present disclosure described in this specification.

[0166] For example, Fig.10 The electronic device shown can be Fig. 9 The image acquisition module 910 in the device shown in the figure performs step S510. The electronic device can perform step S520 through the identification position determination module 920. The electronic device can perform step S530 through the image correction module 930.

[0167] In one embodiment, an electronic device is provided, including a memory and one or more processors, the memory storing computer-readable instructions, and the one or more processors implement the steps of the image correction method provided in any of the above embodiments when executing the computer-readable instructions. A person of ordinary skill in the art can understand that the implementation of all or part of the process in the above embodiment method can be completed by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a non-volatile computer-readable storage medium. When the computer-readable instructions are executed, they can include the process of the embodiments of the above methods. Among them, any reference to the memory, database or other medium used in the embodiments provided by the present disclosure can include at least one of non-volatile and volatile memory. The non-volatile memory may include a read-only memory (ROM), a magnetic tape, a floppy disk, a flash memory or an optical memory. The volatile memory may include a random access memory (RAM) or an external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static random access memory (SRAM) and dynamic random access memory (DRAM).

[0168] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0169] The above-mentioned embodiments only express several implementation methods of the present disclosure, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present disclosure, and these all belong to the protection scope of the present disclosure. Therefore, the protection scope of the patent of the present disclosure shall be subject to the attached claims.

[0170] Industrial Applicability

[0171] The image correction method provided by the present disclosure enables, when taking a photo for framing, by obtaining a target image corresponding to a target object with four positioning markers pre-set, the deviation of the photographed target object can be determined according to the marker positions of the four positioning markers in the target image, thereby quickly correcting the target image according to the marker positions, thereby improving the accuracy and efficiency of framing, ensuring the consistency of framing results, and having strong industrial applicability.

Claims

1. An image correction method, It is characterized in that include: Acquire a target image including four positioning marks captured by a camera, wherein the four positioning marks are located on the target object, the four positioning marks are located on a marking plane in the object space, and are arranged in a circle with equal spacing in sequence; Determine the marking positions of the four positioning marks in the target image; Determining a marking deviation according to the marking position, wherein the marking deviation is used to characterize a deviation between the target image and the standard image; According to the identified deviation, the position and posture of the camera and / or the position and posture of the target object are adjusted until the identified deviation meets a preset deviation condition.

2. The method according to claim 1, It is characterized in that Determining a marking deviation according to the marking position includes: Determine, according to the identification position, a positional relationship between the image plane of the camera and the identification plane, wherein the positional relationship includes that the image plane is parallel to or intersects with the identification plane; The identification deviation is determined according to the positional relationship and the identification position.

3. The method according to claim 2, It is characterized in that Determining the positional relationship between the image plane of the camera and the identification plane according to the identification position includes: When the lengths of the first set of opposite sides determined by the marking position are equal, and the lengths of the second set of opposite sides determined by the marking position are equal, the image plane is parallel to the marking plane; When any one of the first set of opposite side lengths and the second set of opposite side lengths determined by the marking position is not equal, the image plane intersects the marking plane.

4. The method according to claim 2, It is characterized in that 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.

5. The method according to claim 4, It is characterized in that The method further comprises: Taking the target image point in the image plane as the origin, a rectangular coordinate system is established, wherein 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 parallel to the second side determined by the preset standard position, wherein the preset standard position is the position of the four positioning marks in the standard image; In the rectangular coordinate system, the identification coordinates of the four positioning markers in the target image and the standard coordinates in the standard image are determined.

6. The method according to claim 5, It is characterized in that Determining the identification deviation according to the position relationship and the identification position includes at least one of the following: 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 two corresponding points determined by the standard coordinates, determining the identification deviation to be the front-back deviation; When the image plane is parallel to the identification plane, and the average value of the ordinates determined by the identification coordinates is not equal to the average value of the ordinates determined by the standard coordinates, determining the identification deviation as the vertical deviation; When the image plane is parallel to the identification 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, determining that the identification deviation is the horizontal deviation; When the image plane is parallel to the identification plane, and a straight line passing through the midpoints of the first set of opposite sides determined by the identification coordinates intersects the y-axis, or a straight line passing through the midpoints of the second set of opposite sides determined by the identification coordinates intersects the x-axis, the identification deviation is determined to be the rotation deviation; When the image plane intersects the identification plane, and a first set of opposite sides determined by the identification coordinates are not equal, or a second set of opposite sides determined by the identification coordinates are not equal, the identification deviation is determined to be the flipping deviation.

7. The method according to claim 6, It is characterized in that The front-to-back deviation includes a forward translation deviation or a backward translation deviation, the vertical deviation includes an upward translation deviation or a downward translation deviation, the horizontal deviation includes a left translation deviation or a right translation deviation, the rotation deviation includes a counterclockwise rotation deviation or a clockwise rotation deviation, and the flipping deviation includes one or two of an upward flipping deviation, a downward flipping deviation, a left flipping deviation and a right flipping deviation.

8. The method according to claim 1, It is characterized in that According to the identification deviation, adjusting the position and / or the position and / or the position and / or the position of the target object until the identification deviation satisfies a preset deviation condition, including: Determining a first compensation parameter of the camera and / or the target object according to the identification deviation, the first compensation parameter including a first compensation type and a first compensation direction, the first compensation type including an angle and / or a length; According to the first compensation parameter, the position and posture of the camera and / or the position and posture of the target object are adjusted in a step-by-step manner until the identification deviation meets a preset deviation condition.

9. The method according to claim 8, It is characterized in that According to the first compensation parameter, the position and posture of the camera and / or the position and posture of the target object are adjusted step by step until the identification deviation meets a preset deviation condition, including: Along the first compensation direction, adjusting the camera and / or the target object once according to a preset compensation amount corresponding to the first compensation type; Capturing a current image including the four positioning marks through the camera, and using the current image as the target image; Determine the marking positions of the four positioning marks in the target image; Determining a marking deviation according to the marking position; Determining a first compensation parameter of the camera and / or the target object according to the identification deviation; Returning to the first compensation direction, the camera and / or the target object are adjusted again according to the preset compensation amount corresponding to the first compensation type until the identification deviation meets the preset deviation condition.

10. The method according to claim 1, It is characterized in that The method further comprises: According to the marked position, a deviation amount corresponding to the marked deviation is determined.

11. The method according to claim 10, It is characterized in that According to the identification deviation, adjusting the position and / or the position and / or the position and / or the position of the target object until the identification deviation satisfies a preset deviation condition, including: Determining a second compensation parameter of the camera and / or the target object according to the identification deviation, the second compensation parameter including a second compensation type and a second compensation direction, the second compensation type including an angle and / or a length; According to the second compensation parameter and the deviation amount corresponding to the identified deviation, the position and posture of the camera and / or the position and posture of the target object are adjusted.

12. The method according to claim 11, It is characterized in that Determining, according to the identification position, a deviation amount corresponding to the identification deviation, including at least one of the following: When the mark deviation is a flip deviation, a first projection angle and a 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 is rotated around a first preset straight line by the second projection angle, and after being rotated around a second preset straight line by the first projection angle, it is parallel to the image plane, the first preset straight line passes through the first diagonal corners of the four positioning marks in the object space, and the second preset straight line passes through the second diagonal corners of the four positioning marks in the object space; When the marked deviation is a front-back deviation, the current object distance is determined according to the marked position, and the difference between the current object distance and the preset standard object distance is used as the deviation amount corresponding to the marked deviation; When the identification 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 identification position, and the product of the preset distance and the sine value of the preset angle is used as the deviation amount corresponding to the identification deviation, wherein the preset point is the intersection of the main optical axis of the lens of the camera and the identification plane, and the preset angle is the angle between the straight line passing through the centers of the four positioning marks in the object space and the preset point and the horizontal line; When the identification deviation is a horizontal deviation, a preset distance from the center of the four positioning markers in the object space to a preset point is determined according to the identification position, and the product of the preset distance and the cosine value of the preset angle is used as the deviation amount corresponding to the identification deviation; 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.

13. The method according to claim 12, It is characterized in that Determining a first projection angle and a second projection angle according to the marked position includes: The first projection angle is determined by the following formula: ; The second projection angle is determined by the following formula: ; in, represents the first projection angle, represents the second projection angle, represents the distance from the first positioning mark to the mark imaging center in the target image, represents the distance from the second positioning mark to the mark imaging center in the target image, represents the distance from the third positioning mark to the mark imaging center in the target image, represents the distance from the fourth positioning mark to the mark imaging center in the target image, represents the focal length of the camera, and the imaging center of the mark is the intersection of the diagonal lines of the four positioning marks in the target image.

14. The method according to claim 12, It is characterized in that Determining the current object distance according to the marked position includes: Determine the imaging distance between any two positioning marks in the target image according to the mark positions; The current object distance is determined according to the imaging distance and in combination with the imaging principle.

15. An image correction device, It is characterized in that include: An image acquisition module is configured to acquire a target image captured by a camera and including four positioning marks, wherein the four positioning marks are located on the target object, the four positioning marks are located on a marking plane in the object space, and are arranged in a circle with equal spacing in sequence; A marker position determination module, configured to determine marker positions of the four positioning markers in the target image; An image correction module, configured to correct the target image according to the marked position; The image correction module comprises: a deviation determining unit, configured to determine a marking deviation according to the marking position, wherein the marking deviation is used to characterize a deviation between the target image and a standard image; The image correction unit is configured to adjust the position and posture of the camera and / or the position and posture of the target object according to the identification deviation until the identification deviation meets a preset deviation condition.

16. An electronic device comprising a memory and a processor, wherein the memory stores computer-readable instructions, It is characterized in that When the processor executes the computer-readable instructions, the processor implements the steps of the method according to any one of claims 1 to 14.

17. A non-volatile computer-readable storage medium storing computer-readable instructions, wherein computer-readable instructions are stored thereon, It is characterized in that When the computer readable instructions are executed by a processor, the steps of the method according to any one of claims 1 to 14 are implemented.