CN111210482B - Real-time correction method for video image of camera, computer storage medium and equipment - Google Patents

Real-time correction method for video image of camera, computer storage medium and equipment Download PDF

Info

Publication number
CN111210482B
CN111210482B CN202010112332.4A CN202010112332A CN111210482B CN 111210482 B CN111210482 B CN 111210482B CN 202010112332 A CN202010112332 A CN 202010112332A CN 111210482 B CN111210482 B CN 111210482B
Authority
CN
China
Prior art keywords
camera
straight line
picture
video image
inclination
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.)
Active
Application number
CN202010112332.4A
Other languages
Chinese (zh)
Other versions
CN111210482A (en
Inventor
杨华明
张永涛
俞翔
刘双广
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Gosuncn Technology Group Co Ltd
Original Assignee
Gosuncn Technology Group 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 Gosuncn Technology Group Co Ltd filed Critical Gosuncn Technology Group Co Ltd
Priority to CN202010112332.4A priority Critical patent/CN111210482B/en
Publication of CN111210482A publication Critical patent/CN111210482A/en
Application granted granted Critical
Publication of CN111210482B publication Critical patent/CN111210482B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/60Rotation of a whole image or part thereof
    • G06T3/608Skewing or deskewing, e.g. by two-pass or three-pass rotation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras

Abstract

The invention provides a real-time correction method for video images of a camera, a computer storage medium and electronic equipment, wherein the method comprises the following steps: s1, adjusting the camera to rotate to any two different positions, and respectively selecting a straight line perpendicular to the ground from the two positions to obtain a straight line A and a straight line B; s2, acquiring coordinates of a straight line A and a straight line B in a camera picture; s3, calculating the inclination rates of the images corresponding to the straight line A and the straight line B and the inclination angles of the camera installation according to the coordinates of the straight line A and the straight line B; s4, acquiring the inclination k of the video image corresponding to any horizontal angle according to the inclination rates of the straight line A and the straight line B and the inclination angle of the camera installation; s5, rotating the original video picture by k degrees anticlockwise, wherein the cutting proportion is R (0-1); s6, after any point in the original video picture is rotated clockwise by k degrees, cutting the point to R times of the original picture, and obtaining a corrected video image.

Description

Real-time correction method for video image of camera, computer storage medium and equipment
Technical Field
The invention relates to the field of video security monitoring, in particular to a real-time correction method for video images of a camera, a computer storage medium and electronic equipment.
Background
For non-PTZ cameras, the problem of tilting of the video image of the camera is often corrected by adjusting the camera equipment when the video image of the camera is tilted. When it is difficult to adjust the camera device, the image can be rotated back to the normal image by the tilt of the video image of the camera using an algorithm.
When the PTZ camera is low in installation position, the video image can be installed again, and the video image inclination caused by the installation inclination problem can be corrected. Multiple installations may occur and the installation tilt problem cannot be corrected. For the installation of higher PTZ cameras, the installation difficulty is high, and if the camera is inclined due to the installation reason, the imaging image is inclined, namely, the video image is inclined to a certain degree. Because the inclination direction of the installation is uncertain, the cradle head rotates different angles, and the video image can incline at different angles, so that the video image can not be corrected; if the secondary construction is installed, more manpower and material resources are spent, so that the phenomenon that the video image is not processed after being inclined even occurs. And when the PTZ camera is mounted tilted, the tilt of the video image will change as the rotation of the PTZ camera changes. The prior art can not correct video images in real time, so that the inclination of video images is obvious when the PTZ camera is installed and inclined, and the image quality is affected.
Disclosure of Invention
In view of the above, the present invention provides a real-time correction method for video images of a camera, a computer storage medium and an electronic device, which can conveniently and effectively implement correction of video images of an inclined camera, reduce secondary installation, and save costs.
In order to solve the technical problems, in one aspect, the invention provides a real-time correction method for video images of a camera, which comprises the following steps: s1, adjusting the camera to rotate to any two different positions, and respectively selecting a straight line perpendicular to the ground from the two positions to obtain a straight line A and a straight line B; s2, acquiring coordinates of a straight line A and a straight line B in a camera picture, wherein the coordinates of two endpoints of the straight line A in the camera picture are A1 (xa 1, ya 1), A2 (xa 2, ya 2), and the coordinates of two endpoints of the straight line B in the camera picture are B1 (xb 1, yb 1), B2 (xb 2, yb 2); s3, calculating the inclination rates of the images corresponding to the straight line A and the straight line B and the inclination angles of the camera installation according to the coordinates of the straight line A and the straight line B;
s4, acquiring the inclination k of the video image corresponding to any horizontal angle according to the inclination rates of the straight line A and the straight line B and the inclination angle of the camera installation; s5, rotating the original video picture by k degrees anticlockwise, wherein the cutting proportion is R; s6, after any point in the original video picture is rotated clockwise by k degrees, cutting the point to R times of the original picture, and obtaining a corrected video image.
According to the real-time correction method for the video image of the camera, disclosed by the embodiment of the invention, the problem of video image inclination caused by installation inclination of the camera can be solved by correcting the inclination amount of the video image in real time and restoring the normal level of the video image.
According to some embodiments of the invention, straight line a and straight line B are each one vertical edge of the building perpendicular to the ground in two positions.
According to some embodiments of the present invention, in step S1, any two positions where the camera rotates are a (p 1, t 1) and B (p 2, t 2), p1++p2, p1-p2++pi, t1=t2, where p1 and t1 are angles between the lens direction of camera position a and the x-axis and the z-axis, and p2 and t2 are angles between the lens direction of camera position B and the x-axis and the z-axis.
According to some embodiments of the invention, in step S3, the tilt rates of the images corresponding to the line a and the line B are k1 and k2, respectively, the camera is mounted at a tilt angle τ, the camera is tilted at an angle θ from vertical,
k1=(ya1-ya2)/(xa1-xa2);
k2=(yb1-yb2)/(xb1-xb2);
τ=k2*sin(p1-θ);
τ=k1*sin(p2-θ);
wherein xa1 is more than or equal to 0 and less than or equal to 1920,0, ya1 is more than or equal to 1080,0, xa2 is more than or equal to 1920,0 and ya2 is more than or equal to 1080.
According to some embodiments of the present invention, in step S4, the inclination k=sin (θ -P) ×τ of the video image corresponding to the arbitrary horizontal angle.
According to some embodiments of the present invention, in step S5, the resolution of the original picture is h×v, and the resolution is unchanged after clipping.
According to some embodiments of the present invention, any point (x, y) in the original video frame is cut to R times the original frame after rotating clockwise by k degrees, and the transformed (x ', y') is:
x0=(x-H/2)*cos(k)-(y-V/2)*sin(k)+H/2;
y0=(x-H/2)*sin(k)+(y-V/2)*cos(k)+V/2;
x’=(x0-(1-R)*(2*H/2)/2.0)/R;
y’=(y0-(1-R)*(2*V/2)/2.0)/R;
H=1920;V=1080
according to some embodiments of the invention, the method further comprises:
s7, adding augmented reality information or calibration information into the rotated video picture, recovering to the original video picture, and converting (x, y) into:
x0=(x’-H/2)*cos(k)-(y′-V/2)*sin(-k)+H/2;
y0=(x’-H/2)*sin(-k)+(y’-V/2)*cos(k)+V/2;
x=(1-R)*(2*H/2)/2.0+R*x0;
y=(1-R)*(2*V/2)/2.0+R*y0;
H=1920;V=1080。
in a second aspect, embodiments of the present invention provide a computer storage medium comprising one or more computer instructions which, when executed, implement a method as described in the above embodiments.
An electronic device according to an embodiment of the third aspect of the present invention includes a memory for storing one or more computer instructions and a processor; the processor is configured to invoke and execute the one or more computer instructions to implement the method as described in any of the embodiments above.
Drawings
FIG. 1 is a schematic diagram of the installation of a camera in a real-time correction method for video images of a camera according to an embodiment of the present invention;
FIG. 2 is a schematic view showing no inclination of the camera in the real-time correction method of video images of the camera according to the embodiment of the invention;
FIG. 3 is a schematic view of the mounting tilt of a camera in a real-time correction method for video images of a camera according to an embodiment of the present invention;
fig. 4 is a schematic diagram showing a comparison between before and after clipping of a video image of a camera in a real-time correction method for video images of a camera according to an embodiment of the present invention;
FIG. 5 is a video image of a camera rotated to a position in a real-time rectification method for video images of a camera according to an embodiment of the present invention;
FIG. 6 is a video image of a camera rotated to another position in a real-time rectification method for video images of a camera according to an embodiment of the present invention;
FIG. 7 is a video image resulting from the correction of the video image of FIG. 5;
fig. 8 is a schematic diagram of an electronic device according to an embodiment of the invention.
Reference numerals:
an electronic device 300;
a memory 310; an operating system 311; an application 312;
a processor 320; a network interface 330; an input device 340; a hard disk 350; and a display device 360.
Detailed Description
The following describes in further detail the embodiments of the present invention with reference to the drawings and examples. The following examples are illustrative of the invention and are not intended to limit the scope of the invention.
The method for correcting the video image of the video camera in real time according to the embodiment of the invention is specifically described below with reference to the accompanying drawings.
As shown in fig. 1 to 7, the real-time correction method for video images of a camera according to an embodiment of the present invention includes the following steps:
s1, adjusting the camera to rotate to any two different positions, and respectively selecting a straight line perpendicular to the ground from the two positions to obtain a straight line A and a straight line B.
S2, acquiring coordinates of a straight line A and a straight line B in a camera picture, wherein the coordinates of two endpoints of the straight line A in the camera picture are A1 (xa 1, ya 1), A2 (xa 2, ya 2), and the coordinates of two endpoints of the straight line B in the camera picture are B1 (xb 1, yb 1) and B2 (xb 2, yb 2).
And S3, calculating the inclination rates of the images corresponding to the straight line A and the straight line B and the inclination angle of the camera installation according to the coordinates of the straight line A and the straight line B.
And S4, acquiring the inclination k of the video image corresponding to any horizontal angle according to the inclination rates of the straight line A and the straight line B and the inclination angle of the camera installation.
S5, rotating the original video picture by k degrees anticlockwise, wherein the clipping proportion is R (0-1).
S6, after any point in the original video picture is rotated clockwise by k degrees, cutting the point to R times of the original picture, and obtaining a corrected video image.
It should be noted that, before implementing the method for correcting the video image of the camera in real time according to the embodiment of the invention, the camera is already assembled at a predetermined position and performs shooting operation, and the position where the camera is assembled is shown in fig. 1 in a coordinate system. When the mounting position of the camera is not inclined, as shown in fig. 2, the vertical center of the camera is parallel to the z axis, p refers to the angle between the lens direction of the camera and the x axis, and t refers to the angle between the lens direction of the camera and the z axis. When the mounting position of the camera is inclined, as shown in fig. 3, OO "is a vertical center of the camera, and an included angle τ between OO" and OO' is sagging, that is, an angle of the mounting inclination of the camera, wherein the angle units are radians. Projection of plane xO ' y where O ' ' is OO ' ', O ' and O ' X The included angle theta is vertical, i.e. the angle at which the camera is mounted is inclined vertically. Because the vertical direction and the sagging degree of the camera are unknown during installation, the real-time correction method of the video image of the camera can be adopted to calculate the vertical direction and the sagging degree through different inclination amounts of two pictures.
According to the real-time correction method for the video image of the camera, when correction is carried out on the camera, the camera is controlled to rotate to any two positions, a straight line perpendicular to the ground is obtained from each position, then coordinates of each straight line in the image are obtained, the inclination rate of the image corresponding to the two straight lines is calculated, and accordingly the inclination angle of the camera is obtained, the inclination of the video image corresponding to any horizontal angle of the camera is further calculated, finally, the original video image of the camera is rotated anticlockwise according to the inclination according to the cutting proportion, the video image is rotated clockwise again, and the original cutting proportion is restored, so that the corrected video image can be obtained.
Therefore, according to the real-time correction method for the video image of the camera, the inclination amount of the video image is corrected in real time, the normal level of the video image is restored, the problem of the inclination of the video image caused by the installation inclination of the camera can be solved, the method is not limited by the installation of the structure of the camera, secondary adjustment of the assembly structure of the camera is not needed, labor is saved, and the quality of the video image of the camera is improved.
According to one embodiment of the invention, straight line a and straight line B are each one vertical edge of the building perpendicular to the ground in two positions. Optionally, in step S1, any two positions of camera rotation are a (p 1, t 1) and B (p 2, t 2), p1+.p2, p1-p2++pi, t1=t2.
Specifically, as shown in fig. 5 and 6, the edge or wall surface of any one building in the video pictures taken by the camera at two rotation positions may be selected as a straight line a or a straight line B, which may be inclined in the video pictures but which is a straight line perpendicular to the ground in reality, and which is preferably the edge or wall surface of two different buildings in the two video pictures.
In some embodiments of the present invention, in step S3, the tilt rates of the images corresponding to the line a and the line B are k1 and k2, respectively, the camera is mounted at a tilt angle τ, the camera is tilted at an angle θ from vertical,
k1=(ya1-ya2)/(xa1-xa2);
k2=(yb1-yb2)/(xb1-xb2);
τ=k2*sin(p1-θ);
τ=k1*sin(p2-θ);
wherein x is more than or equal to 0 and less than or equal to 1920,0, y is more than or equal to 1080.
That is, from the coordinates of the straight line a and the straight line B in the coordinate system, the tilt ratio of the respective video pictures with respect to the vertical direction can be calculated, where (xa 1, ya 1), (xa 2, ya 2), (xb 1, yb 1), (xb 2, yb 2) are video image coordinates, where 0.ltoreq.x.ltoreq. 1920,0.ltoreq.y.ltoreq.1080, and the values of θ and τ can be found, that is, the tilt state of the camera can be calculated from the video image.
On the basis, according to different inclination rates calculated by different straight lines in two video pictures, the theta and the theta are obtained τ After the value of (2), the inclination of the video image corresponding to any P can be obtained. Then there are:
k=sin(θ-P)*τ;
k is the inclination of the video image when the arbitrary horizontal angle is P, that is, the original video image is rotated by k degrees when the horizontal angle is P, so that the video image without inclination can be obtained.
Because the video image is formed by rotating the original video image by k (- - τ.ltoreq.k.ltoreq.τ) at any horizontal angle P, any position of the original video image is also rotated. In many video surveillance systems, the video images are augmented reality information or image-scaled. Therefore, the corresponding relation between the video image before and after rotation needs to be found, and the additional augmented reality information or the image calibration information corresponds to the video image one by one.
Assuming that the current picture resolution is h×v, the picture is tilted counterclockwise by an angle of k degrees (rotation is positive clockwise). The ratio of the cutting is required to be R (ranging from 0 to 1), and the resolution is unchanged before and after cutting, as shown in FIG. 4. One point (x, y) in the original picture is cut down to R times of the original picture after clockwise rotation by k degrees, and the formula of the transformed (x ', y') is as follows:
x0=(x-H/2)*cos(k)-(y-V/2)*sin(k)+H/2;
y0=(x-H/2)*sin(k)+(y-V/2)*cos(k)+V/2;
x’=(x0-(1-R)*(2*H/2)/2.0)/R;
y’=(y0-(1-R)*(2*V/2)/2.0)/R;
H=1920;V=1080
namely, the target position of any point (x, y) after rotating k degrees is (x ', y'), namely, the augmented reality information or calibration information of the (x, y) point in the original video image should be at the position of the rotated video image (x ', y'), and the corrected image can be obtained, wherein fig. 7 is the video image after correcting the video image of fig. 5.
In contrast, if the augmented reality information or the calibration information added to the rotated video image is restored to the original video image as required, the real-time correction method for the video image of the camera according to the embodiment of the invention further includes:
s7, adding augmented reality information or calibration information into the rotated video picture, recovering to the original video picture, and converting (x, y) into:
x0=(x’-H/2)*cos(k)-(y’-V/2)*sin(-k)+H/2;
y0=(x’-H/2)*sin(-k)+(y’-V/2)*cos(k)+V/2;
x=(1-R)*(2*H/2)/2.0+R*x0;
y=(1-R)*(2*V/2)/2.0+R*y0;
H=1920;V=1080。
thus, the corrected image can be restored to the original video image.
In summary, according to the real-time correction method for the video image of the camera, disclosed by the embodiment of the invention, the inclination amount of the video image can be corrected in real time, the normal level of the video image is restored, the problem of video image inclination caused by installation inclination of the camera can be solved, the method is not limited by the installation of a camera structure, secondary adjustment of the camera assembly structure is not needed, labor is saved, and the quality of the video image of the camera is improved.
In addition, the invention also provides a computer storage medium, which comprises one or more computer instructions, wherein the one or more computer instructions realize the real-time correction method for the video image of the camera when being executed.
That is, the computer storage medium stores a computer program that, when executed by a processor, causes the processor to perform any of the camera video image real-time rectification methods described above.
As shown in fig. 8, an embodiment of the present invention provides an electronic device 300, including a memory 310 and a processor 320, where the memory 310 is configured to store one or more computer instructions, and the processor 320 is configured to invoke and execute the one or more computer instructions, thereby implementing any of the methods described above.
That is, the electronic device 300 includes: a processor 320 and a memory 310, in which memory 310 computer program instructions are stored which, when executed by the processor, cause the processor 320 to perform any of the methods described above.
Further, as shown in fig. 8, the electronic device 300 further includes a network interface 330, an input device 340, a hard disk 350, and a display device 360.
The interfaces and devices described above may be interconnected by a bus architecture. The bus architecture may be a bus and bridge that may include any number of interconnects. One or more Central Processing Units (CPUs), represented in particular by processor 320, and various circuits of one or more memories, represented by memory 310, are connected together. The bus architecture may also connect various other circuits together, such as peripheral devices, voltage regulators, and power management circuits. It is understood that a bus architecture is used to enable connected communications between these components. The bus architecture includes, in addition to a data bus, a power bus, a control bus, and a status signal bus, all of which are well known in the art and therefore will not be described in detail herein.
The network interface 330 may be connected to a network (e.g., the internet, a local area network, etc.), and may obtain relevant data from the network and store the relevant data in the hard disk 350.
The input device 340 may receive various instructions from an operator and transmit the instructions to the processor 320 for execution. The input device 340 may include a keyboard or pointing device (e.g., a mouse, a trackball, a touch pad, or a touch screen, among others).
The display device 360 may display results obtained by the processor 320 executing instructions.
The memory 310 is used for storing programs and data necessary for the operation of the operating system, and data such as intermediate results in the calculation process of the processor 320.
It will be appreciated that memory 310 in embodiments of the invention may be volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile memory may be Read Only Memory (ROM), programmable Read Only Memory (PROM), erasable Programmable Read Only Memory (EPROM), electrically Erasable Programmable Read Only Memory (EEPROM), or flash memory, among others. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. The memory 310 of the apparatus and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
In some implementations, the memory 310 stores the following elements, executable modules or data structures, or a subset thereof, or an extended set thereof: an operating system 311 and applications 312.
The operating system 311 includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, for implementing various basic services and processing hardware-based tasks. The application programs 312 include various application programs such as a Browser (Browser) and the like for implementing various application services. A program implementing the method of the embodiment of the present invention may be included in the application program 312.
The method disclosed in the above embodiment of the present invention may be applied to the processor 320 or implemented by the processor 320. Processor 320 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuitry in hardware or instructions in software in processor 320. The processor 320 may be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, or discrete hardware components, which may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present invention. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 310 and the processor 320 reads the information in the memory 310 and in combination with its hardware performs the steps of the method described above.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For a hardware implementation, the processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units designed to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
In particular, the processor 320 is further configured to read the computer program and execute any of the methods described above.
In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may be physically included separately, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units implemented in the form of software functional units described above may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform part of the steps of the transceiving method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that various modifications and adaptations can be made without departing from the principles of the present invention, and such modifications and adaptations are intended to be comprehended within the scope of the present invention.

Claims (7)

1. The real-time correction method for the video image of the camera is characterized by comprising the following steps of:
s1, adjusting the camera to rotate to any two different positions, and respectively selecting a straight line perpendicular to the ground from video pictures shot by the camera at the two positions to obtain a straight line A and a straight line B;
s2, acquiring coordinates of a straight line A and a straight line B in a camera picture, wherein the coordinates of two endpoints of the straight line A in the camera picture are A1 (xa 1, ya 1), A2 (xa 2, ya 2), and the coordinates of two endpoints of the straight line B in the camera picture are B1 (xb 1, yb 1), B2 (xb 2, yb 2);
s3, calculating the inclination rates of the images corresponding to the straight line A and the straight line B and the inclination angles of the camera installation according to the coordinates of the straight line A and the straight line B;
s4, acquiring the inclination k of the video image corresponding to any horizontal angle P according to the inclination rates of the straight line A and the straight line B and the inclination angle of the camera installation;
s5, rotating the original video picture by k degrees anticlockwise, wherein the cutting proportion is R;
s6, after any point in the original video picture is rotated clockwise by k degrees, cutting the point to R times of the original picture, and obtaining a corrected video image;
in step S3, the tilt ratios of the images corresponding to the straight lines a and B are k1 and k2, respectively, and the camera mounting tilt angle isThe angle of the camera inclined to the vertical direction is theta,
k1=(ya1-ya2)/(xa1-xa2);
k2=(yb1-yb2)/(xb1-xb2);
wherein xa1 is more than or equal to 0 and less than or equal to 1920,0, ya1 is more than or equal to 1080, xa2 is more than or equal to 0 and less than or equal to 1920,0, ya2 is more than or equal to 1080;
in step S4, the inclination of the video image corresponding to the arbitrary horizontal angle
In step S1, any two positions of the camera rotating are a (p 1, t 1) and B (p 2, t 2), p1++p2, p1-p2++pi, t1=t2, where p1 and t1 are angles between the lens direction of the camera position a and the x-axis and between the lens direction of the camera position a and the z-axis, and p2 and t2 are angles between the lens direction of the camera position B and the x-axis and between the lens direction of the camera position B and the z-axis.
2. The method of claim 1, wherein line a and line B are each a vertical edge of the building perpendicular to the ground in two positions.
3. The method according to claim 1, wherein in step S5, the picture resolution of the original picture isThe resolution ratio is unchanged after clipping.
4. The method of claim 1, wherein any point (x, y) in the original video picture is cropped to R times the original picture after rotating clockwise by k degrees, and the transformed (x ', y') is:
5. the method as recited in claim 4, further comprising:
s7, adding augmented reality information or calibration information into the rotated video picture, recovering to the original video picture, and converting (x, y) into:
6. a computer storage medium comprising one or more computer instructions which, when executed, implement the method of any of claims 1-5.
7. An electronic device comprising a memory and a processor, characterized in that,
the memory is used for storing one or more computer instructions;
the processor is configured to invoke and execute the one or more computer instructions to implement the method of any of claims 1-5.
CN202010112332.4A 2020-02-24 2020-02-24 Real-time correction method for video image of camera, computer storage medium and equipment Active CN111210482B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010112332.4A CN111210482B (en) 2020-02-24 2020-02-24 Real-time correction method for video image of camera, computer storage medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010112332.4A CN111210482B (en) 2020-02-24 2020-02-24 Real-time correction method for video image of camera, computer storage medium and equipment

Publications (2)

Publication Number Publication Date
CN111210482A CN111210482A (en) 2020-05-29
CN111210482B true CN111210482B (en) 2024-03-05

Family

ID=70786929

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010112332.4A Active CN111210482B (en) 2020-02-24 2020-02-24 Real-time correction method for video image of camera, computer storage medium and equipment

Country Status (1)

Country Link
CN (1) CN111210482B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105430331A (en) * 2015-11-13 2016-03-23 浙江宇视科技有限公司 Method and device for adjusting display direction of monitor image
WO2016157666A1 (en) * 2015-03-27 2016-10-06 パナソニックIpマネジメント株式会社 Camera attitude estimating device, operation supporting device and camera attitude estimating method
JP2017188738A (en) * 2016-04-03 2017-10-12 株式会社デンソー Mounting angle detection device for on-vehicle camera, mounting angle calibration device, mounting angle detection method, mounting angle calibration method, and computer program
CN110320934A (en) * 2018-03-27 2019-10-11 杭州海康机器人技术有限公司 Cloud platform control method, device, holder and mobile device
CN110460769A (en) * 2019-07-05 2019-11-15 浙江大华技术股份有限公司 Image correction method, device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016157666A1 (en) * 2015-03-27 2016-10-06 パナソニックIpマネジメント株式会社 Camera attitude estimating device, operation supporting device and camera attitude estimating method
CN105430331A (en) * 2015-11-13 2016-03-23 浙江宇视科技有限公司 Method and device for adjusting display direction of monitor image
JP2017188738A (en) * 2016-04-03 2017-10-12 株式会社デンソー Mounting angle detection device for on-vehicle camera, mounting angle calibration device, mounting angle detection method, mounting angle calibration method, and computer program
CN110320934A (en) * 2018-03-27 2019-10-11 杭州海康机器人技术有限公司 Cloud platform control method, device, holder and mobile device
CN110460769A (en) * 2019-07-05 2019-11-15 浙江大华技术股份有限公司 Image correction method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111210482A (en) 2020-05-29

Similar Documents

Publication Publication Date Title
CN109040575B (en) Panoramic video processing method, device, equipment and computer readable storage medium
CN110730296B (en) Image processing apparatus, image processing method, and computer readable medium
JP6593484B2 (en) Image processing method and apparatus
CN111093050B (en) Target monitoring method and device
WO2020207108A1 (en) Image processing method, device and system, and robot
CN105430331A (en) Method and device for adjusting display direction of monitor image
CN113194263B (en) Gun and ball linkage control method and device, computer equipment and storage medium
CN113747071B (en) Unmanned aerial vehicle shooting method and device, unmanned aerial vehicle and storage medium
CN109035134B (en) Panoramic image splicing method and device, electronic equipment and storage medium
CN111787232A (en) Image processing method, device and storage medium based on pan-tilt-zoom camera
WO2020135580A1 (en) Panoramic image splicing method, device, terminal and corresponding storage medium
CN111210482B (en) Real-time correction method for video image of camera, computer storage medium and equipment
CN111355926B (en) Linkage method of panoramic camera and PTZ camera, storage medium and equipment
US20190313030A1 (en) Image-capturing system, information processing apparatus, control method of information processing apparatus, and storage medium
CN113112412A (en) Generation method and device of vertical correction matrix and computer readable storage medium
US10715725B2 (en) Method and system for handling 360 degree image content
JP6608920B2 (en) Image processing method and camera
US11023999B2 (en) Image processing apparatus, information processing system, information processing method, and storage medium
JP2004146890A (en) Monitor camera apparatus and monitor camera system apparatus
CN116347245A (en) Camera calibration method and device, electronic equipment and storage medium
CN110426674B (en) Spatial position determination method and device, electronic equipment and storage medium
WO2023124053A1 (en) Position detection method and apparatus based on mobile camera, processing device, and medium
US20220394182A1 (en) Method for optimizing privacy mask of camera with panning and tilting control and imaging device with privacy mask optimization applied
JP2006080580A (en) Wide-angle of view video photographing apparatus
CN112822442B (en) Heat map generation method and device and electronic equipment

Legal Events

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