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

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

Info

Publication number
CN112435172A
CN112435172A CN201910790440.4A CN201910790440A CN112435172A CN 112435172 A CN112435172 A CN 112435172A CN 201910790440 A CN201910790440 A CN 201910790440A CN 112435172 A CN112435172 A CN 112435172A
Authority
CN
China
Prior art keywords
image
desktop
determining
compensation
acquisition device
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.)
Pending
Application number
CN201910790440.4A
Other languages
Chinese (zh)
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.)
Beijing Sanhao Interactive Education Science & Technology Co ltd
Original Assignee
Beijing Sanhao Interactive Education Science & Technology 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 Beijing Sanhao Interactive Education Science & Technology Co ltd filed Critical Beijing Sanhao Interactive Education Science & Technology Co ltd
Priority to CN201910790440.4A priority Critical patent/CN112435172A/en
Publication of CN112435172A publication Critical patent/CN112435172A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • G06T5/80

Abstract

The invention provides an image correction method, an image correction device, a storage medium and electronic equipment, wherein the method comprises the following steps: acquiring a desktop image acquired by an image acquisition device, and determining equipment parameters of the image acquisition device; determining a compensation multiple corresponding to each row of pixels of the image acquisition device according to the equipment parameters; and amplifying and compensating the elements of the corresponding line of the desktop image according to the compensation multiple, and generating a compensated desktop image. By the image correction method, the image correction device, the storage medium and the electronic equipment, the compensation multiple can be conveniently and quickly determined, and a distortion-free desktop image can be quickly obtained; the supporting rod is not required to be additionally arranged, so that the hardware cost can be reduced; the desktop image is shot in an inclined mode, the intersection between the collection range of the image collection device and the activity space of the user can be reduced, the possibility of collecting body parts or other objects of the user is reduced, and the image collection device is effectively prevented from being shielded by the user or other objects.

Description

Image correction method and device, storage medium and electronic equipment
Technical Field
The invention relates to the technical field of intelligent teaching, in particular to an image correction method, an image correction device, a storage medium and electronic equipment.
Background
In the live interactive teaching field, the equipment for live broadcast needs to acquire the image of the user desktop, and in order to shoot undistorted images, the camera generally needs to be arranged right above the desktop. The structural schematic diagram of the conventional apparatus is shown in fig. 1, and the apparatus needs an additional supporting rod on which a camera for photographing a desktop is mounted to acquire an image of the undistorted desktop.
In order to prevent image distortion, the traditional equipment needs to be additionally provided with a support rod, so that the hardware cost is increased; and when the body part or other objects of the user are above the desktop, the camera is easily blocked from normally collecting images.
Disclosure of Invention
To solve the above problems, embodiments of the present invention provide a method, an apparatus, a storage medium, and an electronic device for image rectification.
In a first aspect, an embodiment of the present invention provides an image rectification method, including:
acquiring a desktop image acquired by an image acquisition device, and determining equipment parameters of the image acquisition device, wherein the equipment parameters comprise a mounting angle between the image acquisition device and a desktop and a vertical included angle of an acquisition range of the image acquisition device;
determining a compensation multiple corresponding to each row of pixels of the image acquisition device according to the equipment parameters;
and amplifying and compensating the elements of the corresponding line of the desktop image according to the compensation multiple, and generating a compensated desktop image.
In a possible implementation manner, the determining, according to the device parameter, a compensation multiple corresponding to each row of pixels of the image capturing apparatus includes:
and determining the maximum compensation multiple according to the equipment parameters, and determining the compensation multiple corresponding to each row of pixels of the image acquisition device according to the maximum compensation multiple.
In a possible implementation manner, the determining a maximum compensation multiple according to the device parameter includes:
determining an included angle x between the lower edge of the acquisition range of the image acquisition device and a desktop according to the installation angle and the vertical included angle;
determining the maximum compensation multiple N of the equipment parameter according to the included angle x between the lower edge of the acquisition range and the desktop and the vertical included angle y, and:
Figure BDA0002179388380000021
in a possible implementation manner, the determining a compensation multiple corresponding to each row of pixels of the image acquisition apparatus according to the maximum compensation multiple includes:
determining the total number of rows of pixels corresponding to the acquisition range of the image acquisition device;
determining the compensation multiple corresponding to each line of pixels according to the maximum compensation multiple and the total line number of the pixels, and:
Figure BDA0002179388380000022
where i denotes the row number of the pixel, tiAnd p is the compensation multiple corresponding to the pixel of the ith row.
In a possible implementation manner, the performing amplification compensation processing on the elements of the corresponding line of the desktop image according to the compensation multiple includes:
and taking the middle column of the desktop image as a reference, and carrying out amplification compensation processing on the elements on the left side and the right side of the middle column of the corresponding row of the desktop image according to the compensation multiple.
In a second aspect, an embodiment of the present invention further provides an apparatus for image rectification, including:
the acquisition module is used for acquiring a desktop image acquired by an image acquisition device and determining equipment parameters of the image acquisition device, wherein the equipment parameters comprise a mounting angle between the image acquisition device and a desktop and a vertical included angle of an acquisition range of the image acquisition device;
the compensation multiple determining module is used for determining the compensation multiple corresponding to each row of pixels of the image acquisition device according to the equipment parameters;
and the compensation correction module is used for amplifying and compensating the elements of the corresponding line of the desktop image according to the compensation multiple and generating a compensated desktop image.
In a possible implementation manner, the determining a compensation multiple corresponding to each row of pixels of the image capturing apparatus according to the device parameter by the compensation multiple determining module includes:
and determining the maximum compensation multiple according to the equipment parameters, and determining the compensation multiple corresponding to each row of pixels of the image acquisition device according to the maximum compensation multiple.
In a possible implementation manner, the determining a maximum compensation multiple by the compensation multiple determining module according to the device parameter includes:
determining an included angle x between the lower edge of the acquisition range of the image acquisition device and a desktop according to the installation angle and the vertical included angle;
determining the maximum compensation multiple N of the equipment parameter according to the included angle x between the lower edge of the acquisition range and the desktop and the vertical included angle y, and:
Figure BDA0002179388380000031
in a third aspect, an embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores computer-executable instructions, and the computer-executable instructions are used in any one of the above-mentioned image rectification methods.
In a fourth aspect, an embodiment of the present invention further provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of image rectification according to any one of the preceding claims.
In the solution provided by the foregoing first aspect of the embodiment of the present invention, after a desktop image obliquely acquired by an image acquisition device is acquired, a compensation multiple corresponding to each line of pixels of the desktop image is determined by using a mounting angle between an image acquisition device and the desktop and a vertical included angle of an acquisition range of the image acquisition device, and then each line of elements of the desktop image can be subjected to amplification compensation processing by using the compensation multiple of each line, so that a distorted desktop image is corrected and compensated to be an undistorted desktop image. In the embodiment, the compensation multiple can be conveniently and quickly determined, so that a distortion-free desktop image can be quickly obtained; in the mode, when the image acquisition device is not positioned right above the desktop, an undistorted desktop image can be acquired, so that a supporting rod does not need to be additionally arranged, and the hardware cost can be reduced; meanwhile, the desktop image is shot in an inclined mode, so that the intersection between the acquisition range of the image acquisition device and the activity space of the user can be reduced, the possibility that the body part or other objects of the user are acquired by the image acquisition device is reduced, and the image acquisition device is effectively prevented from being shielded by the user or other objects.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic view showing a structure of a conventional apparatus;
FIG. 2 is a flow chart illustrating a method of image rectification provided by an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating a desktop image captured by an image capturing device according to an embodiment of the present invention when the desktop image is tilted;
fig. 4 is a schematic diagram illustrating an image acquisition device provided by an embodiment of the present invention;
FIG. 5a is a schematic diagram of a desktop image captured by an image capturing device according to an embodiment of the present invention;
FIG. 5b is a schematic diagram of an actual desktop corresponding to the capture range of the image capture device provided in the embodiment of the present invention;
FIG. 6 is a schematic diagram illustrating another principle of an image capturing apparatus according to an embodiment of the present invention when capturing a desktop image at an inclined angle; (ii) a
FIG. 7a is a schematic diagram of a lower edge of an acquisition range of an image acquisition device provided by an embodiment of the invention;
FIG. 7b is a schematic diagram illustrating an upper edge of an acquisition range of an image acquisition device according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of an image rectification device according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device for performing an image rectification method according to an embodiment of the present invention.
Detailed Description
In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", and the like, indicate orientations and positional relationships based on those shown in the drawings, and are used only for convenience of description and simplicity of description, and do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be considered as limiting the present invention.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In the present invention, unless otherwise expressly specified or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
An image rectification method provided by an embodiment of the present invention, as shown in fig. 2, includes:
step 101: the method comprises the steps of obtaining a desktop image obliquely collected by an image collecting device, and determining equipment parameters of the image collecting device, wherein the equipment parameters comprise a mounting angle between the image collecting device and a desktop and a vertical included angle of a collecting range of the image collecting device.
In the embodiment of the invention, the equipment parameters comprise the installation angle between the image acquisition device and the desktop and the vertical included angle of the acquisition range of the image acquisition device. Specifically, when the image acquisition device acquires the content on the desktop of the user, an included angle is formed between the image acquisition device and the desktop, that is, the image acquisition device acquires the desktop image in an inclined manner. A schematic diagram of a principle when the image acquisition device acquires a desktop image is shown in fig. 3, wherein an included angle between the image acquisition device 10 and a normal perpendicular to the desktop 200 is a, and the angle a is an installation angle between the image acquisition device 10 and the desktop 200; although the included angle between the image capturing device 10 and the desktop 200 is not equal to the angle a, the sum of the included angle and the angle a is 90 °, that is, the included angle between the image capturing device 10 and the desktop 200 and the angle a have similar properties, and the angle a may represent the included angle between the image capturing device 10 and the desktop 200. Meanwhile, the image capturing apparatus 10 has a corresponding capturing range, which is determined by hardware of the image capturing apparatus 10.
Fig. 4 shows a schematic view of an acquisition range of the image acquisition apparatus 10, where O in fig. 4 represents the image acquisition apparatus 10, a dotted line OM is a main optical axis of the image acquisition apparatus 10, a rectangular ABCD (a two-dimensional figure in fig. 4 schematically represents a three-dimensional shape, and a parallelogram ABCD in fig. 4 actually represents a rectangle in a three-dimensional space) represents an acquisition plane of the image acquisition apparatus 10, and an area corresponding to a corresponding rectangular pyramid O-ABCD is the acquisition range of the image acquisition apparatus 10; here, since the photosensitive element of the image capturing device 10 is rectangular, the capturing surface ABCD perpendicular to the main optical axis OM is also rectangular. In the embodiment of the present invention, the boundary of the acquisition range of the image acquisition device 10 includes an upper edge AOB and a lower edge COD, and an included angle between the upper edge and the lower edge is a vertical included angle of the acquisition range, that is, < EOF in fig. 4 represents the vertical included angle of the acquisition range of the image acquisition device 10. In fig. 3, the dotted line of the image capturing device 10 in fig. 3 represents the main optical axis, and the solid line on the left side of the main optical axis corresponds to the lower edge of the capturing range, and the solid line on the right side corresponds to the upper edge of the capturing range; correspondingly, the angle y in fig. 3 also represents the vertical angle of the acquisition range.
Step 102: and determining the compensation multiple corresponding to each row of pixels of the image acquisition device according to the equipment parameters.
In the embodiment of the present invention, a desktop image captured by the image capturing device 10 is shown in fig. 5a, where a rectangular outer frame in fig. 5a represents a periphery of the desktop image, and a trapezoid in the rectangular outer frame represents an object in the desktop image. Since the image acquisition device 10 is the desktop image obtained by oblique shooting, the corresponding range of the desktop image in the actual scene is an inverted trapezoid, specifically as shown in fig. 5 b; in fig. 5b, the inverted trapezoid, the rectangle in which corresponds to the true shape of the trapezoid object in fig. 5a, represents the scope of the desktop image acquisition shown in fig. 5 a. In fig. 5b, the upper side shows the far end of the image capturing device 10 when actually capturing images, and the lower side shows the near end of the image capturing device 10 when actually capturing images.
As can be seen from fig. 5a and 5b, since the image capturing device 10 shoots obliquely, the object far away from the image capturing device 10 is captured at the upper end of the desktop image, and the distortion is large; correspondingly, the lower end of the desktop image collects an object which is close to the image collecting device 10, and the distortion is small. For the desktop image, different distortion coefficients corresponding to each row of pixels need to be used for distortion correction of each row of pixels respectively by using different compensation factors. The compensation multiple can be determined by the installation angle a between the image acquisition device and the desktop and the vertical included angle y of the acquisition range of the image acquisition device.
Step 103: and amplifying and compensating the elements of the corresponding line of the desktop image according to the compensation multiple, and generating a compensated desktop image.
In the embodiment of the present invention, as can be seen from fig. 5a and 5b, the image corresponding to the pixel at the upper end of the desktop image is a relatively small image, and the image corresponding to the pixel at the lower end of the desktop image is a relatively large image, at this time, the image of the pixel at the lower end can be reduced to make no distortion difference between each row of pixels of the entire desktop image, but the original rectangular desktop image is changed into an inverted trapezoid shape; this problem is avoided in this embodiment by means of amplification compensation. Specifically, in this embodiment, each line of elements in the desktop image is subjected to amplification compensation processing, and the farther a pixel is from the image acquisition device 10, the larger the compensation multiple is; and then deleting the content exceeding the corresponding area of the desktop image after the amplification compensation, thereby ensuring that the finally generated compensated desktop image is rectangular, retaining the content contained in the original desktop image as much as possible and reducing the data loss as much as possible.
According to the image correction method provided by the embodiment of the invention, after the desktop image obliquely acquired by the image acquisition equipment is acquired, the compensation multiple corresponding to each line of pixels of the desktop image is determined by utilizing the installation angle between the image acquisition device and the desktop and the vertical included angle of the acquisition range of the image acquisition device, and then each line of elements of the desktop image can be amplified and compensated by utilizing the compensation multiple of each line, so that the distorted desktop image is corrected and compensated into the undistorted desktop image. In the embodiment, the compensation multiple can be conveniently and quickly determined, so that a distortion-free desktop image can be quickly obtained; in the mode, when the image acquisition device is not positioned right above the desktop, an undistorted desktop image can be acquired, so that a supporting rod does not need to be additionally arranged, and the hardware cost can be reduced; meanwhile, the desktop image is shot in an inclined mode, so that the intersection between the acquisition range of the image acquisition device and the activity space of the user can be reduced, the possibility that the body part or other objects of the user are acquired by the image acquisition device is reduced, and the image acquisition device is effectively prevented from being shielded by the user or other objects.
On the basis of the foregoing embodiment, the step 102 "determining the compensation multiple corresponding to each row of pixels of the image capturing apparatus according to the device parameter" specifically includes: and determining the maximum compensation multiple according to the equipment parameters, and determining the compensation multiple corresponding to each row of pixels of the image acquisition device according to the maximum compensation multiple.
In the embodiment of the present invention, as shown in fig. 5a and 5b, after the real object with a rectangular shape in fig. 5b is mapped into the desktop image shown in fig. 5a, the real object is distorted into a trapezoid shape, so that for the desktop image, the compensation multiples of pixels in different rows are linearly changed, that is, the compensation multiples of pixels in all rows of the desktop image can be determined after the compensation multiples of pixels in some two rows are determined. In this embodiment, because the processing mode of the amplification compensation is adopted, the compensation multiple of the pixels in the lowest row of the desktop image can be preset, and the compensation multiple can be generally set to 1; then, only the compensation multiple corresponding to the top row of pixels of the desktop image needs to be determined, the distortion corresponding to the top row of pixels is the most serious, and the corresponding compensation multiple is the maximum compensation multiple; and then the compensation multiple corresponding to each row of pixels of the image acquisition device can be determined based on the maximum compensation multiple.
Optionally, the step of "determining the compensation multiple corresponding to each row of pixels of the image acquisition device according to the maximum compensation multiple" includes:
step A1: and determining the total number of pixel rows corresponding to the acquisition range of the image acquisition device.
In the embodiment of the present invention, the image capturing device 10 has a corresponding resolution, and the desktop images captured by the image capturing device also have the same resolution, so that the total number of pixels in each row and each column of the capturing range can be determined based on the resolution of the image capturing device 10. For example, if the resolution of the image capturing device is 1920 × 1080, the captured desktop image has 1080 rows of pixels and 1920 columns of pixels (or has 1920 rows of pixels and 1080 columns of pixels, which needs to be determined based on the installation pose of the image capturing device 10), and the total number of rows of pixels at this time is 1080.
Step A2: determining the compensation multiple corresponding to each line of pixels according to the maximum compensation multiple and the total line number of the pixels, and:
Figure BDA0002179388380000091
where i denotes the row number of the pixel, tiAnd p is the compensation multiple corresponding to the pixel of the ith row.
In the embodiment of the invention, i represents the row number of the pixel, and then i belongs to [1, p ]. The 1 st row of pixels refers to the pixels on the uppermost row of the desktop image, namely the compensation multiple corresponding to the 1 st row of pixels is the maximum compensation multiple N, and N is more than 1; correspondingly, the pixel of the p-th row refers to the pixel of the lowest row of the desktop image, the compensation multiple corresponding to the pixel of the p-th row is the minimum compensation multiple, and the compensation multiple is preset and is generally 1, that is, the pixel of the lowest row of the desktop image is taken as a reference to perform amplification compensation processing on the pixels of the other rows.
Optionally, the step of "determining the maximum compensation multiple according to the device parameter" specifically includes:
step B1: and determining an included angle x between the lower edge of the acquisition range of the image acquisition device and the desktop according to the installation angle and the vertical included angle.
In the embodiment of the present invention, as shown in fig. 6, the installation angle a is used to represent an included angle between the image capturing device 10 and the desktop 200; meanwhile, since the installation direction of the image capturing device 10 is consistent with the main optical axis (dashed line in fig. 6), the installation angle a may actually be the included angle between the main optical axis of the image capturing device 10 and the desktop 200; referring to fig. 4 again, the main optical axis OM of the image capturing device 10 bisects the vertical included angle ≤ EOF, i.e., the main optical axis bisecting angle y in fig. 6, so in fig. 6, the included angle x between the lower edge of the capturing range of the image capturing device 10 and the tabletop 200, and:
Figure BDA0002179388380000092
step B2: determining the maximum compensation multiple N according to the equipment parameter determined by the included angle x between the lower edge of the acquisition range and the desktop and the vertical included angle y, and:
Figure BDA0002179388380000101
in the embodiment of the present invention, the lower edge of the acquisition range of the image acquisition apparatus 10 can be determined from the direction a-a shown in fig. 6; accordingly, the upper edge of the capturing range of the image capturing apparatus 10 can be determined from the B-B direction shown in fig. 6. In particular, fig. 7a shows the lower edge of the acquisition range of the image acquisition apparatus 10; in fig. 7a, O indicates the position OF the image capturing device 10, the line segment CD is the intersection between the lower edge OF the capturing range OF the image capturing device 10 and the table top 200, i.e. Δ OCD in fig. 7a indicates the lower edge OF the capturing range OF the image capturing device 10, and the line segment OF is the distance between the image capturing device 10 and the intersection CD, the length OF the line segment OF is h1, and the length h1 corresponds to h1 in fig. 6. Likewise, fig. 7b shows the upper edge of the acquisition range of the image acquisition apparatus 10. In fig. 7b, O indicates the position of the image capturing device 10, a line segment AB is the intersection between the upper edge of the capturing range of the image capturing device 10 and the tabletop 200, i.e. Δ OAB in fig. 7b indicates the lower edge of the capturing range of the image capturing device 10, and a line segment OE is the distance between the image capturing device 10 and the intersection AB, the length of the line segment OE is h2, and the length h2 corresponds to h2 in fig. 6.
Meanwhile, as shown in fig. 4, based on the imaging principle of the image acquisition device 10, the angle ≤ AOB of the upper edge is equal to the angle ≤ COD of the lower edge in the acquisition range; corresponding to fig. 7a and 7b, the ≤ COD in fig. 7a is the same as the ≤ AOB in fig. 7b, so the upper and lower edges OAB and OAD of the acquisition range are shown simultaneously in fig. 7b, and Δ OCD is similar to Δ OBA, so:
Figure BDA0002179388380000102
meanwhile, referring to fig. 7b, the desktop range of the desktop image acquisition is a trapezoid ABCD, and the uppermost row of pixels of the desktop image corresponds to AB and the lowermost row of pixels corresponds to CD; if the bottom line of pixels of the desktop image is used as the reference, i.e. the CD is used as the reference, the real line segment AB in the desktop image is distorted into a line segment with a length equal to the CD, so that the top line of pixels of the desktop image needs to be enlarged to correspond to the pixels of the top line
Figure BDA0002179388380000111
I.e. the maximum compensation factor N of the desktop image is
Figure BDA0002179388380000112
Therefore, it is
Figure BDA0002179388380000113
Referring to fig. 6, assuming that the vertical distance between the image capturing device 10 and the tabletop 200 is h, it can be known from the angle relationship shown in fig. 6 that:
Figure BDA0002179388380000114
so that the maximum compensation multiple is
Figure BDA0002179388380000115
And the maximum compensation multiple N is only related to the included angle x and the vertical included angle y between the lower edge of the acquisition range and the desktop 200, and is not related to other parameters. Wherein, the vertical included angle y is only related to the intrinsic parameters of the image acquisition device 10, that is, for a certain image acquisition device 10, the vertical included angle y is a determined value; meanwhile, the included angle x is only related to the installation angle when the image capturing device 10 is installed, that is, the included angle x may also be related to the installation angle when the image capturing device 10 is installedIs a known definite value.
In addition, since the maximum compensation multiple N is independent of the installation height h of the image capturing device 10, when the body part of the user or other objects block the image of the desktop 200 captured by the image capturing device 10, the image correction method can also perform adaptive correction on the body part of the user or other objects captured in the desktop image.
Optionally, the step 103 of performing amplification compensation processing on the elements of the corresponding line of the desktop image according to the compensation multiple includes: and taking the middle column of the desktop image as a reference, and carrying out amplification compensation processing on the elements on the left side and the right side of the middle column of the corresponding row of the desktop image according to the compensation multiple.
In the embodiment of the invention, the middle column of the desktop image is used as a reference during the amplification compensation processing, and the desktop image after the amplification compensation processing is the same as the middle column of the original desktop image, so that a main body at the middle position of the desktop image is also positioned in the desktop image after the amplification compensation processing.
According to the image correction method provided by the embodiment of the invention, after the desktop image obliquely acquired by the image acquisition equipment is acquired, the compensation multiple corresponding to each line of pixels of the desktop image is determined by utilizing the installation angle between the image acquisition device and the desktop and the vertical included angle of the acquisition range of the image acquisition device, and then each line of elements of the desktop image can be amplified and compensated by utilizing the compensation multiple of each line, so that the distorted desktop image is corrected and compensated into the undistorted desktop image. In the embodiment, the compensation multiple can be conveniently and quickly determined, so that a distortion-free desktop image can be quickly obtained; in the mode, when the image acquisition device is not positioned right above the desktop, an undistorted desktop image can be acquired, so that a supporting rod does not need to be additionally arranged, and the hardware cost can be reduced; meanwhile, the desktop image is shot in an inclined mode, so that the intersection between the acquisition range of the image acquisition device and the activity space of the user can be reduced, the possibility that the body part or other objects of the user are acquired by the image acquisition device is reduced, and the image acquisition device is effectively prevented from being shielded by the user or other objects. The image correction mode only needs to determine the maximum compensation multiple, and the correction method is simple; the maximum compensation multiple is only related to the installation angle and the vertical included angle, so that the installation requirement on the image acquisition device is effectively reduced; in addition, the mode can also carry out adaptive correction on the body part or other objects of the user acquired in the desktop image.
The above describes in detail the flow of the method for image rectification, which can also be implemented by a corresponding apparatus, whose structure and function are described in detail below.
An image rectification apparatus provided by an embodiment of the present invention, as shown in fig. 8, includes:
an obtaining module 201, configured to obtain a desktop image acquired by an image acquisition device, and determine an equipment parameter of the image acquisition device, where the equipment parameter includes a mounting angle between the image acquisition device and a desktop and a vertical included angle of an acquisition range of the image acquisition device;
a compensation multiple determining module 202, configured to determine, according to the device parameter, a compensation multiple corresponding to each row of pixels of the image acquisition apparatus;
and the compensation correction module 203 is configured to perform amplification compensation processing on elements in corresponding rows of the desktop image according to the compensation multiple, and generate a compensated desktop image.
On the basis of the above embodiment, the determining module 202 determines the compensation multiple corresponding to each row of pixels of the image capturing apparatus according to the device parameter, including:
and determining the maximum compensation multiple according to the equipment parameters, and determining the compensation multiple corresponding to each row of pixels of the image acquisition device according to the maximum compensation multiple.
On the basis of the above embodiment, the determining module 202 determines the maximum compensation multiple according to the device parameter, including:
determining an included angle x between the lower edge of the acquisition range of the image acquisition device and a desktop according to the installation angle and the vertical included angle;
determining the maximum compensation multiple N of the equipment parameter according to the included angle x between the lower edge of the acquisition range and the desktop and the vertical included angle y, and:
Figure BDA0002179388380000131
on the basis of the above embodiment, the determining module 202 determines the compensation multiple corresponding to each row of pixels of the image capturing apparatus according to the maximum compensation multiple, including:
determining the total number of rows of pixels corresponding to the acquisition range of the image acquisition device;
determining the compensation multiple corresponding to each line of pixels according to the maximum compensation multiple and the total line number of the pixels, and:
Figure BDA0002179388380000132
where i denotes the row number of the pixel, tiAnd p is the compensation multiple corresponding to the pixel of the ith row.
On the basis of the above embodiment, the performing, by the compensation and correction module 203, amplification and compensation processing on elements in a corresponding line of the desktop image according to the compensation multiple includes:
and taking the middle column of the desktop image as a reference, and carrying out amplification compensation processing on the elements on the left side and the right side of the middle column of the corresponding row of the desktop image according to the compensation multiple.
According to the image correction device provided by the embodiment of the invention, after the desktop image obliquely collected by the image collection equipment is obtained, the compensation multiple corresponding to each line of pixels of the desktop image is determined by utilizing the installation angle between the image collection device and the desktop and the vertical included angle of the collection range of the image collection device, and then each line of elements of the desktop image can be amplified and compensated by utilizing the compensation multiple of each line, so that the distorted desktop image is corrected and compensated into the undistorted desktop image. In the embodiment, the compensation multiple can be conveniently and quickly determined, so that a distortion-free desktop image can be quickly obtained; in the mode, when the image acquisition device is not positioned right above the desktop, an undistorted desktop image can be acquired, so that a supporting rod does not need to be additionally arranged, and the hardware cost can be reduced; meanwhile, the desktop image is shot in an inclined mode, so that the intersection between the acquisition range of the image acquisition device and the activity space of the user can be reduced, the possibility that the body part or other objects of the user are acquired by the image acquisition device is reduced, and the image acquisition device is effectively prevented from being shielded by the user or other objects. The image correction mode only needs to determine the maximum compensation multiple, and the correction device is simple; the maximum compensation multiple is only related to the installation angle and the vertical included angle, so that the installation requirement on the image acquisition device is effectively reduced; in addition, the mode can also carry out adaptive correction on the body part or other objects of the user acquired in the desktop image.
Embodiments of the present invention also provide a computer storage medium, which stores computer-executable instructions, including a program for executing the method for image rectification described above, and the computer-executable instructions can execute the method in any of the above method embodiments.
The computer storage media may be any available media or data storage device that can be accessed by a computer, including but not limited to magnetic memory (e.g., floppy disks, hard disks, magnetic tape, magneto-optical disks (MOs), etc.), optical memory (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor memory (e.g., ROMs, EPROMs, EEPROMs, non-volatile memory (NAND FLASH), Solid State Disks (SSDs)), etc.
Fig. 9 shows a block diagram of an electronic device according to another embodiment of the present invention. The electronic device 1100 may be a host server with computing capabilities, a personal computer PC, or a portable computer or terminal that is portable, or the like. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.
The electronic device 1100 includes at least one processor (processor)1110, a Communications Interface 1120, a memory 1130, and a bus 1140. The processor 1110, the communication interface 1120, and the memory 1130 communicate with each other via the bus 1140.
The communication interface 1120 is used for communicating with network elements including, for example, virtual machine management centers, shared storage, etc.
Processor 1110 is configured to execute programs. Processor 1110 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present invention.
The memory 1130 is used for executable instructions. The memory 1130 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1130 may also be a memory array. The storage 1130 may also be partitioned and the blocks may be combined into virtual volumes according to certain rules. The instructions stored by the memory 1130 are executable by the processor 1110 to enable the processor 1110 to perform the method of image rectification in any of the method embodiments described above.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method of image rectification, comprising:
acquiring a desktop image acquired by an image acquisition device, and determining equipment parameters of the image acquisition device, wherein the equipment parameters comprise a mounting angle between the image acquisition device and a desktop and a vertical included angle of an acquisition range of the image acquisition device;
determining a compensation multiple corresponding to each row of pixels of the image acquisition device according to the equipment parameters;
and amplifying and compensating the elements of the corresponding line of the desktop image according to the compensation multiple, and generating a compensated desktop image.
2. The method of claim 1, wherein determining the compensation factor for each row of pixels of the image capture device according to the device parameters comprises:
and determining the maximum compensation multiple according to the equipment parameters, and determining the compensation multiple corresponding to each row of pixels of the image acquisition device according to the maximum compensation multiple.
3. The method of claim 2, wherein determining the maximum compensation factor based on the device parameter comprises:
determining an included angle x between the lower edge of the acquisition range of the image acquisition device and a desktop according to the installation angle and the vertical included angle;
determining the maximum compensation multiple N of the equipment parameter according to the included angle x between the lower edge of the acquisition range and the desktop and the vertical included angle y, and:
Figure FDA0002179388370000011
4. the method of claim 2, wherein the determining the compensation multiple corresponding to each row of pixels of the image acquisition device according to the maximum compensation multiple comprises:
determining the total number of rows of pixels corresponding to the acquisition range of the image acquisition device;
determining the compensation multiple corresponding to each line of pixels according to the maximum compensation multiple and the total line number of the pixels, and:
Figure FDA0002179388370000012
where i denotes the row number of the pixel, tiAnd p is the compensation multiple corresponding to the pixel of the ith row.
5. The method according to any one of claims 1 to 4, wherein the performing the magnification compensation processing on the elements of the corresponding line of the desktop image according to the compensation multiple comprises:
and taking the middle column of the desktop image as a reference, and carrying out amplification compensation processing on the elements on the left side and the right side of the middle column of the corresponding row of the desktop image according to the compensation multiple.
6. An apparatus for image rectification, comprising:
the acquisition module is used for acquiring a desktop image acquired by an image acquisition device and determining equipment parameters of the image acquisition device, wherein the equipment parameters comprise a mounting angle between the image acquisition device and a desktop and a vertical included angle of an acquisition range of the image acquisition device;
the compensation multiple determining module is used for determining the compensation multiple corresponding to each row of pixels of the image acquisition device according to the equipment parameters;
and the compensation correction module is used for amplifying and compensating the elements of the corresponding line of the desktop image according to the compensation multiple and generating a compensated desktop image.
7. The apparatus of claim 6, wherein the compensation factor determining module determines the compensation factor corresponding to each row of pixels of the image capturing device according to the device parameter, and comprises:
and determining the maximum compensation multiple according to the equipment parameters, and determining the compensation multiple corresponding to each row of pixels of the image acquisition device according to the maximum compensation multiple.
8. The apparatus of claim 6, wherein the compensation factor determining module determines the maximum compensation factor according to the device parameter, comprising:
determining an included angle x between the lower edge of the acquisition range of the image acquisition device and a desktop according to the installation angle and the vertical included angle;
determining the maximum compensation multiple N of the equipment parameter according to the included angle x between the lower edge of the acquisition range and the desktop and the vertical included angle y, and:
Figure FDA0002179388370000021
9. a computer storage medium having stored thereon computer-executable instructions for performing the method of image rectification according to any one of claims 1-5.
10. An electronic device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of image rectification according to any one of claims 1-5.
CN201910790440.4A 2019-08-26 2019-08-26 Image correction method and device, storage medium and electronic equipment Pending CN112435172A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910790440.4A CN112435172A (en) 2019-08-26 2019-08-26 Image correction method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910790440.4A CN112435172A (en) 2019-08-26 2019-08-26 Image correction method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN112435172A true CN112435172A (en) 2021-03-02

Family

ID=74690477

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910790440.4A Pending CN112435172A (en) 2019-08-26 2019-08-26 Image correction method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112435172A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114257799A (en) * 2021-11-15 2022-03-29 深圳市普渡科技有限公司 Robot, projection method, and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030222892A1 (en) * 2002-05-31 2003-12-04 Diamond Michael B. Method and apparatus for display image adjustment
CN1799252A (en) * 2003-06-02 2006-07-05 卡西欧计算机株式会社 Captured image projection apparatus and captured image correction method
CN1845592A (en) * 2005-04-06 2006-10-11 精工爱普生株式会社 Projector trapezoidal correction
CN101566864A (en) * 2008-04-22 2009-10-28 致伸科技股份有限公司 Notebook computer and method for acquiring document image by image acquiring device thereof
CN102572257A (en) * 2010-12-14 2012-07-11 富士施乐株式会社 Image processing device and image processing method
CN109360144A (en) * 2018-09-18 2019-02-19 南京大学 A kind of image real time correction improved method based on cell phone platform

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030222892A1 (en) * 2002-05-31 2003-12-04 Diamond Michael B. Method and apparatus for display image adjustment
CN1799252A (en) * 2003-06-02 2006-07-05 卡西欧计算机株式会社 Captured image projection apparatus and captured image correction method
CN1845592A (en) * 2005-04-06 2006-10-11 精工爱普生株式会社 Projector trapezoidal correction
CN101566864A (en) * 2008-04-22 2009-10-28 致伸科技股份有限公司 Notebook computer and method for acquiring document image by image acquiring device thereof
CN102572257A (en) * 2010-12-14 2012-07-11 富士施乐株式会社 Image processing device and image processing method
CN109360144A (en) * 2018-09-18 2019-02-19 南京大学 A kind of image real time correction improved method based on cell phone platform

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
OLIVER BIMBER 等: "The visual computing of projector-camera systems", 《SIGGRAPH \'08: ACM SIGGRAPH 2008 CLASSESAUGUST 2008》, pages 1 - 25 *
任贵文: "基于OpenCV 的红外与可见光双摄像机标定方法研究", 《科学技术与工程》, vol. 16, no. 3, pages 211 - 214 *
胡荣春 等: "视觉巡线机器人中的摄像头图像透视校正方法", 《计算机与数字工程》, no. 6, pages 104 - 108 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114257799A (en) * 2021-11-15 2022-03-29 深圳市普渡科技有限公司 Robot, projection method, and storage medium

Similar Documents

Publication Publication Date Title
KR102144994B1 (en) Method for decreasing noise of image and image processing apparatus using thereof
US10915998B2 (en) Image processing method and device
US8400555B1 (en) Focused plenoptic camera employing microlenses with different focal lengths
CN109285136B (en) Multi-scale fusion method and device for images, storage medium and terminal
CN105100637A (en) Image processing method and electronic equipment
CN109544643B (en) Video camera image correction method and device
CN109754434A (en) Camera calibration method, apparatus, user equipment and storage medium
CN114399597B (en) Method and device for constructing scene space model and storage medium
EP2764325A1 (en) Using videogrammetry to fabricate parts
CN110717942A (en) Image processing method and device, electronic equipment and computer readable storage medium
CN106131397A (en) A kind of method that multi-medium data shows and electronic equipment
CN111340737B (en) Image correction method, device and electronic system
CN111815715A (en) Method and device for calibrating zoom pan-tilt camera and storage medium
CN111741214A (en) Image processing method and device and electronic equipment
CN109194878A (en) Video image anti-fluttering method, device, equipment and storage medium
CN113572947B (en) Image sensor adjusting method and device, storage medium and electronic device
CN107317953B (en) Image acquisition method and device
CN112435172A (en) Image correction method and device, storage medium and electronic equipment
US11715178B2 (en) Method and apparatus for generating image
CN111260574B (en) Seal photo correction method, terminal and computer readable storage medium
CN111028296B (en) Method, device, equipment and storage device for estimating focal length value of spherical camera
CN106303208B (en) Image Acquisition control method and device
CN111383264B (en) Positioning method, positioning device, terminal and computer storage medium
CN111885371A (en) Image occlusion detection method and device, electronic equipment and computer readable medium
CN110570414A (en) method and device for acquiring alignment reference, electronic equipment and storage medium

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