CN109255760A - Distorted image correction method and device - Google Patents
Distorted image correction method and device Download PDFInfo
- Publication number
- CN109255760A CN109255760A CN201810915121.7A CN201810915121A CN109255760A CN 109255760 A CN109255760 A CN 109255760A CN 201810915121 A CN201810915121 A CN 201810915121A CN 109255760 A CN109255760 A CN 109255760A
- Authority
- CN
- China
- Prior art keywords
- image
- value
- point
- chromatism
- correction
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 47
- 238000003702 image correction Methods 0.000 title claims abstract description 42
- 238000012937 correction Methods 0.000 claims abstract description 58
- 230000008859 change Effects 0.000 claims abstract description 9
- 230000003287 optical effect Effects 0.000 claims description 27
- 230000006870 function Effects 0.000 claims description 26
- 238000006243 chemical reaction Methods 0.000 claims description 14
- 238000004590 computer program Methods 0.000 claims description 12
- 230000004075 alteration Effects 0.000 claims description 7
- 230000009466 transformation Effects 0.000 claims description 7
- 238000012545 processing Methods 0.000 abstract description 11
- 230000008054 signal transmission Effects 0.000 abstract description 6
- 238000010586 diagram Methods 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 4
- 238000009434 installation Methods 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 230000000007 visual effect Effects 0.000 description 3
- 230000002159 abnormal effect Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 1
- 238000003745 diagnosis Methods 0.000 description 1
- 230000003902 lesion Effects 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 210000000056 organ Anatomy 0.000 description 1
- 238000001356 surgical procedure Methods 0.000 description 1
- 210000001835 viscera Anatomy 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/80—Geometric correction
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
Abstract
The application provides a kind of distorted image correction method and device.This method comprises: determining the distortion function of picture pick-up device according to former fault image and calibration template image, and geometric position correction is carried out to former fault image according to distortion function, obtains the first fault image;By the first fault image by RGB image format change be YCbCr picture format, determine brightness value and value of chromatism of the initial pixel point under YCbCr picture format on the first fault image;It is corrected according to brightness value and value of chromatism of the preset rules to initial pixel point to determine and correct image, preset rules are as follows: determining and initial pixel point is target pixel points apart from the smallest pixel, determines the brightness value of target pixel points and value of chromatism is the brightness value and value of chromatism for the pixel that initial pixel point is mapped to correction image.To reduce algorithm complexity and image processing time, guarantee the real-time of Digital Operating Room signal transmission.
Description
Technical field
This application involves technical field of image processing more particularly to a kind of distorted image correction method and devices.
Background technique
With the fast development that medical surgery is performed the operation, collection conventional lenses technology and the present computer technology, microelectric technique
Etc. the medical digital operating room of new and high technologies have become the very extensive operating room of current application.Doctor passes through number
Word operating room visual area camera or endoscope lens observe the tissue morphology of human viscera organ, and internal lesion situation can
Easily carry out diagnosis and remote teaching.In order to improve diagnostic accuracy, the operative image of Digital Operating Room is to image restoring
Property require to increase, operative image does not allow there are more serious distortion, and pattern distortion, which influences visual area camera effect, even to be influenced
Correct judgement of the doctor to diseased region.The delay of signal is wanted during Digital Operating Room implements teaching operation simultaneously
Ask higher, operating room end and remote teaching (consultation of doctors) end require high synchronism.
More to the method for distorted image correction in the prior art, it is higher that there are algorithm complexities, image processing time
Long problem influences the real-time of Digital Operating Room signal transmission.
Summary of the invention
The application provides a kind of distorted image correction method and device, can reduce algorithm complexity and image processing time.
In a first aspect, the application provides a kind of distorted image correction method, comprising:
The distortion function of picture pick-up device is determined according to former fault image and calibration template image, and according to the distortion function
Geometric position correction is carried out to former fault image, obtains the first fault image;
By first fault image by RGB image format change be YCbCr picture format, determine first distortion figure
As brightness value and value of chromatism of the upper initial pixel point under the YCbCr picture format;
The brightness value of the initial pixel point and the value of chromatism are corrected to determine school according to preset rules
Positive image, the preset rules are as follows: the determining and initial pixel point is target pixel points apart from the smallest pixel, determines institute
The brightness value and value of chromatism for stating target pixel points are the brightness for the pixel that the initial pixel point is mapped to the correction image
Value and value of chromatism.
Optionally, the determination is target pixel points apart from the smallest pixel with the initial pixel point, comprising:
Obtain by the initial pixel point upwards, downwards, to the left and to the right move a pixel after four pictures undetermined
Coordinate (the x of vegetarian refreshmentsi, yi), i=1,2,3,4;
It determines in four pixels undetermined at a distance from the initial pixel pointIt is the smallest
Pixel (x, y) is the target pixel points.
Optionally, the distortion function that picture pick-up device is determined according to former fault image and calibration template image, comprising:
The geometric transformation that pixel coordinate is carried out to former fault image, determines the optical centre coordinate of the picture pick-up device;
On former fault image along first direction with optical centre for the first basic point, successively to far from first basic point
Direction takes N number of point, and calculate N number of point to the optical centre distance Ri(i=1,2 ... ... N), the first direction
For by either three straight lines of optical centre to;
Take up an official post in the calibration template image and take a little as the second basic point, selects N number of point in a second direction, and calculate institute
State N number of point to second basic point distance ri(i=1,2 ... ... N), the second direction is identical as the first direction;
The R is fitted using cubic spline functionsiAnd riFunctional relation, obtain the distortion letter of the picture pick-up device
Number.
Optionally, it is described by first fault image by RGB image format change be YCbCr picture format, determine institute
State brightness value and value of chromatism of the initial pixel point on the first fault image under the YCbCr picture format, comprising:
First fault image is transformed into YCbCr picture format by RGB image format according to following conversion formula, is obtained
Brightness value Y, value of chromatism Cb and color difference of the initial pixel point under the YCbCr picture format on to first fault image
Value Cr:
R=Y+1.402 (Cr-128);
G=Y-0.344 (Cb-128) -0.714 (Cr-128);
B=Y+1.772 (Cb-128);
Wherein, R is the R channel value in RGB color image, and G is the G channel value in RGB color image, and B is RGB color figure
Channel B value as in.
Second aspect, the application provide a kind of distorted image correction device, comprising:
Position correction module, for determining the distortion function of picture pick-up device according to former fault image and calibration template image,
And geometric position correction is carried out to former fault image according to the distortion function, obtain the first fault image;
Space conversion module is used to first fault image be YCbCr picture format by RGB image format change,
Determine brightness value and value of chromatism of the initial pixel point on first fault image under the YCbCr picture format;
Brightness and chromatic aberration correction module, for according to preset rules to the brightness value of the initial pixel point and described
Value of chromatism is corrected to determine and correct image, the preset rules are as follows: the determining and initial pixel point is apart from the smallest picture
Vegetarian refreshments is target pixel points, determines the brightness value of the target pixel points and value of chromatism is described in the initial pixel point is mapped to
Correct the brightness value and value of chromatism of the pixel of image.
Optionally, the brightness and chromatic aberration correction module are used for:
Obtain by the initial pixel point upwards, downwards, to the left and to the right move a pixel after four pictures undetermined
Coordinate (the x of vegetarian refreshmentsi, yi), i=1,2,3,4;
It determines in four pixels undetermined at a distance from the initial pixel pointIt is the smallest
Pixel (x, y) is the target pixel points.
Optionally, the position correction module is used for:
The geometric transformation that pixel coordinate is carried out to former fault image, determines the optical centre coordinate of the picture pick-up device;
On former fault image along first direction with optical centre for the first basic point, successively to far from first basic point
Direction takes N number of point, and calculate N number of point to the optical centre distance Ri(i=1,2 ... ... N), the first direction
For by either three straight lines of optical centre to;
Take up an official post in the calibration template image and take a little as the second basic point, selects N number of point in a second direction, and calculate institute
State N number of point to second basic point distance ri(i=1,2 ... ... N), the second direction is identical as the first direction;
The R is fitted using cubic spline functionsiAnd riFunctional relation, obtain the distortion letter of the picture pick-up device
Number.
Optionally, the space conversion module is used for:
First fault image is transformed into YCbCr picture format by RGB image format according to following conversion formula, is obtained
Brightness value Y, value of chromatism Cb and color difference of the initial pixel point under the YCbCr picture format on to first fault image
Value Cr:
R=Y+1.402 (Cr-128);
G=Y-0.344 (Cb-128) -0.714 (Cr-128);
B=Y+1.772 (Cb-128);
Wherein, R is the R channel value in RGB color image, and G is the G channel value in RGB color image, and B is RGB color figure
Channel B value as in.
The third aspect, the application provide a kind of distorted image correction device, comprising:
Memory, for storing program instruction;
Processor, for calling and executing the program instruction in the memory, to realize the fault image of first aspect
Bearing calibration.
Fourth aspect, the application provide a kind of readable storage medium storing program for executing, are stored with computer program in readable storage medium storing program for executing, when
When at least one processor of distorted image correction device executes the computer program, distorted image correction device executes first party
The distorted image correction method in face.
5th aspect, the application provide a kind of program product, which includes computer program, the computer program
It is stored in readable storage medium storing program for executing.At least one processor of distorted image correction device can be read from readable storage medium storing program for executing should
Computer program, at least one processor execute the computer program and distorted image correction device are made to implement the abnormal of first aspect
Become method for correcting image.
Distorted image correction method and device provided by the present application, by carrying out geometric position correction to former fault image
Afterwards, the brightness and value of chromatism of the initial pixel point on the first fault image after progress geometric position correction are corrected with true
When correcting image surely, by apart from nearest mode, by the brightness value and color of the smallest pixel at a distance from initial pixel point
Difference as initial pixel point be mapped to correction image pixel brightness value and value of chromatism, thus reduce to fault image into
The quantity of the pixel of correction is calculated needed for row timing, to reduce algorithm complexity and image processing time, guarantees letter
The real-time of number transmission, therefore can in real time handle dynamic image, improve treatment effeciency.
Detailed description of the invention
In order to clearly demonstrate the application or technical solution in the prior art, embodiment or the prior art will be retouched below
Attached drawing needed in stating is briefly described, it should be apparent that, the accompanying drawings in the following description is some of the application
Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these
Attached drawing obtains other attached drawings.
Fig. 1 is a kind of flow chart of distorted image correction embodiment of the method provided by the present application;
Fig. 2 is fault image and the mapping relations schematic diagram for correcting a pixel in image;
Fig. 3 is a kind of flow chart of distorted image correction embodiment of the method provided by the present application;
Fig. 4 be it is a kind of using method provided by the present application to the schematic diagram before and after distorted image correction;
Fig. 5 is a kind of structural schematic diagram of distorted image correction Installation practice provided by the present application;
Fig. 6 is a kind of structural schematic diagram of distorted image correction Installation practice provided by the present application.
Specific embodiment
To keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with the attached drawing in the application, to this
Technical solution in application is clearly and completely described, it is clear that and described embodiment is some embodiments of the present application,
Instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art are not making creative labor
Every other embodiment obtained under the premise of dynamic, shall fall in the protection scope of this application.
Distorted image correction method in the prior art, it is higher that there are algorithm complexities, the long problem of image processing time,
The real-time of Digital Operating Room signal transmission is influenced, to solve this problem, the application provides a kind of distorted image correction side
Method and device can be applied in the picture pick-up devices such as Digital Operating Room visual area camera, by carrying out geometry position to fault image
After setting correction, to carry out geometric position correction after fault image on initial pixel point brightness value and value of chromatism be corrected with
When determining correction image, by apart from nearest mode, by the brightness value of the smallest pixel at a distance from initial pixel point and
Value of chromatism is mapped to the brightness value and value of chromatism of the pixel of correction image as initial pixel point, thus reduces to fault image
The quantity of the required pixel for calculating correction guarantees to reduce algorithm complexity and image processing time when being corrected
The real-time of Digital Operating Room signal transmission.The technical solution of the application is described in detail with reference to the accompanying drawing.
Fig. 1 is a kind of flow chart of distorted image correction embodiment of the method provided by the present application, the execution master of the present embodiment
Body can be picture pick-up device or the software or hardware of any distorted image correction function with the present embodiment, as shown in Figure 1, originally
The method of embodiment may include:
S101, the distortion function that picture pick-up device is determined according to former fault image and calibration template image, and according to distortion letter
Several pairs of former fault images carry out geometric position correction, obtain the first fault image.
Specifically, picture pick-up device is after having carried out image taking, if detecting fault image, to carry out to fault image
Correction determines the distortion function of picture pick-up device, then according to distortion letter according to former fault image and calibration template image first
Several pairs of former fault images carry out geometric position correction.
The distortion function of picture pick-up device is determined according to former fault image and calibration template image in the present embodiment, it specifically can be with
Include:
S1011, the geometric transformation that pixel coordinate is carried out to former fault image determine that the optical centre of picture pick-up device is sat
Mark.
Specifically, it can be fitted the equation of three straight lines with least square method in the present embodiment, and finds out this three straight lines
Three intersecting point coordinates intersected two-by-two use the center of the triangle of these three intersection points composition as the optical centre of picture pick-up device.
S1012, on former fault image along first direction with optical centre for the first basic point, successively to far from the first basic point
Direction take N number of point, and calculate N number of point to optical centre distance Ri(i=1,2 ... ... N), first direction are to pass through optics
Either three straight lines at center to.
S1013, taking up an official post in calibration template image takes a little as the second basic point, selects N number of point in a second direction, and calculate
The N number of o'clock distance r to the second basic pointi(i=1,2 ... ... N), second direction is identical as first direction.
S1014, R is fitted using cubic spline functionsiAnd riFunctional relation, obtain the distortion function of picture pick-up device.
Specifically, RiAnd riThe corresponding relationship between correction image and fault image is constituted, cubic spline functions are used
Spline is fitted RiAnd riFunctional relation, so that it may obtain the distortion function of picture pick-up device.T=spline (r, R), T are sample three times
The coefficient matrix of interpolating function can complete the geometric position correction of fault image according to the function.
S102, by the first fault image by RGB image format change be YCbCr picture format, determine the first fault image
On brightness value and value of chromatism of the initial pixel point under YCbCr picture format.
Specifically, the first fault image can be transformed into YCbCr image pane by RGB image format according to following conversion formula
Formula obtains brightness value Y, value of chromatism Cb and value of chromatism of the initial pixel point on the first fault image under YCbCr picture format
Cr:
R=Y+1.402 (Cr-128);
G=Y-0.344 (Cb-128) -0.714 (Cr-128);
B=Y+1.772 (Cb-128);
Wherein, R is the R channel value in RGB color image, and G is the G channel value in RGB color image, and B is RGB color figure
Channel B value as in.
YcbCr, wherein Y is also referred to as luminance component, and Cb is also referred to as chroma blue component, and Cr is also referred to as red color point
Amount.
S103, it is corrected according to brightness value and value of chromatism of the preset rules to initial pixel point to determine and correct image,
Preset rules are as follows: determining and initial pixel point is target pixel points apart from the smallest pixel, determines the brightness of target pixel points
Value and value of chromatism are the brightness value and value of chromatism for the pixel that initial pixel point is mapped to correction image.
Specifically, geometric position is carried out to former fault image to correct after obtaining the first fault image, it then will be according to default
Rule is corrected the brightness value and value of chromatism of the initial pixel point on the first fault image, obtains correction image, specifically
Preset rules are to each initial pixel point on the first fault image, and determination is apart from the smallest pixel with initial pixel point
Target pixel points, determine the brightness value of target pixel points and value of chromatism is the pixel that initial pixel point is mapped to correction image
Brightness value and value of chromatism.
In the present embodiment, determining with initial pixel point is target pixel points apart from the smallest pixel, can be with are as follows:
Obtain by initial pixel point upwards, downwards, to the left and to the right move a pixel after four pixels undetermined
Coordinate (xi, yi), i=1,2,3,4;
It determines in four pixels undetermined at a distance from initial pixel pointThe smallest pixel (x,
It y) is target pixel points.
Fig. 2 is fault image and the mapping relations schematic diagram for correcting a pixel in image, as shown in Fig. 2, for example correcting
The coordinate that pixel (u, v) on image is mapped to the non-integer position in fault image is (x, y), for the initial pixel
Point (x, y), first obtain by initial pixel point upwards, downwards, to the left and to the right move a pixel after four pixels undetermined
Coordinate (the x of pointi, yi), i=1,2,3,4, calculate four pixel (x undeterminedi, yi) and initial pixel point (x, y) between away from
FromDetermine the smallest pixel in four distances, for example, pixel (x2, y2), then by pixel
(x2, y2) brightness value and value of chromatism as initial pixel point (x, y) be mapped to correction image pixel (u, v) brightness value
And value of chromatism.
Compared to high-order differential technique more in the prior art, four pixels around initial pixel point (x, y) are calculated
(xi, yi) i=1,2,3,4 brightness value and value of chromatism pass through further according to the brightness value and value of chromatism of four pixels calculated
Weighted average or high-order method calculate the brightness value and value of chromatism of initial pixel point (x, y), the minimum distance method in the present embodiment,
Only the smallest pixel at a distance from initial pixel point need to be determined, using the brightness value of the pixel and value of chromatism as initial picture
Vegetarian refreshments is mapped to the brightness value and value of chromatism of the pixel of correction image, hence it is evident that when reducing algorithm complexity and image procossing
Between, guarantee the real-time of signal transmission, therefore can handle in real time dynamic image, improves treatment effeciency.
Distorted image correction method provided in this embodiment, by former fault image carry out geometric position correction after,
The brightness value and value of chromatism of initial pixel point on the first fault image after progress geometric position correction are corrected with true
When correcting image surely, by apart from nearest mode, by the brightness value and color of the smallest pixel at a distance from initial pixel point
Difference as initial pixel point be mapped to correction image pixel brightness value and value of chromatism, thus reduce to fault image into
The quantity of the pixel of correction is calculated needed for row timing, to reduce algorithm complexity and image processing time, guarantees letter
The real-time of number transmission, therefore can in real time handle dynamic image, improve treatment effeciency.
A specific embodiment is used below, and the technical solution of embodiment of the method shown in Fig. 1 is described in detail.
Fig. 3 is a kind of flow chart of distorted image correction embodiment of the method provided by the present application, as shown in figure 3, this implementation
Example method may include:
S201, the geometric transformation that pixel coordinate is carried out to former fault image, determine the optical centre coordinate of picture pick-up device.
S202, on former fault image along first direction with optical centre for the first basic point, successively to far from the first basic point
Direction take N number of point, and calculate N number of point to optical centre distance Ri(i=1,2 ... ... N), first direction are to pass through optics
Either three straight lines at center to.
S203, taking up an official post in calibration template image takes a little as the second basic point, selects N number of point in a second direction, and calculate N
A o'clock distance r to the second basic pointi(i=1,2 ... ... N), second direction is identical as first direction.
S204, R is fitted using cubic spline functionsiAnd riFunctional relation, obtain the distortion function of picture pick-up device.
S205, geometric position correction is carried out to former fault image according to distortion function, obtains the first fault image.
S206, by the first fault image by RGB image format change be YCbCr picture format, determine the first fault image
On brightness value and value of chromatism of the initial pixel point under YCbCr picture format.
Specifically, the first fault image can be transformed into YCbCr image pane by RGB image format according to following conversion formula
Formula obtains brightness value Y, value of chromatism Cb and value of chromatism of the initial pixel point on the first fault image under YCbCr picture format
Cr:
R=Y+1.402 (Cr-128);
G=Y-0.344 (Cb-128) -0.714 (Cr-128);
B=Y+1.772 (Cb-128);
Wherein, R is the R channel value in RGB color image, and G is the G channel value in RGB color image, and B is RGB color figure
Channel B value as in.
S207, it is corrected according to brightness value and value of chromatism of the preset rules to initial pixel point to determine and correct image,
Preset rules are as follows: determining and initial pixel point is target pixel points apart from the smallest pixel, determines the brightness of target pixel points
Value and value of chromatism are the brightness value and value of chromatism for the pixel that initial pixel point is mapped to correction image.
Wherein it is determined that with initial pixel point apart from the smallest pixel be target pixel points, specifically:
Obtain by initial pixel point upwards, downwards, to the left and to the right move a pixel after four pixels undetermined
Coordinate (xi, yi), i=1,2,3,4;
It determines in four pixels undetermined at a distance from initial pixel pointThe smallest pixel (x,
It y) is target pixel points.
Distorted image correction method provided in this embodiment need to only determine the smallest pixel at a distance from initial pixel point
Point is mapped to the brightness value and color of the pixel of correction image using the brightness value of the pixel and value of chromatism as initial pixel point
Thus difference reduces the quantity of the required pixel for calculating correction when being corrected to fault image, hence it is evident that it is multiple to reduce algorithm
Miscellaneous degree and image processing time, guarantee the real-time of signal transmission, therefore can handle in real time dynamic image, improve place
Manage efficiency.
Fig. 4 be it is a kind of using method provided by the present application to the schematic diagram before and after distorted image correction, table one is distortion figure
Relevant parameter as correcting front and back compares, if practical image height is yz', ideal image height is y ', and the practical distortion of picture pick-up device is δ
yZ', the relative distortion q ' of picture pick-up device are as follows:
According to table one, relative distortion drops to 0.7% after correction up to 19.4% before correcting.
Under same experimental data, compared with high-order differential technique, phase after correcting is calculated using the present processes
0.7% can reach to distortion, can reach 6.99% using calculated relative distortion after high-order differential technique, difference 0.01% is right
Real image is without influence, but the present processes reduce algorithm complexity and image processing time.
Table one
Ideal image height | Practical image height | Practical distortion | Relative distortion | |
Fault image | 469 | 378 | 91 | 19.4% |
Correct image | 419 | 416 | 3 | 0.7% |
Fig. 5 is a kind of structural schematic diagram of distorted image correction Installation practice provided by the present application, as shown in figure 5, this
The device of embodiment may include: position correction module 11, space conversion module 12 and brightness and chromatic aberration correction module 13,
In,
Position correction module 11 is used to determine the distortion function of picture pick-up device according to former fault image and calibration template image,
And geometric position correction is carried out to former fault image according to distortion function, obtain the first fault image.
Space conversion module 12 is used to the first fault image be YCbCr picture format by RGB image format change, determines
Brightness value and value of chromatism of the initial pixel point under YCbCr picture format on first fault image.
Brightness and chromatic aberration correction module 13 are used to be carried out according to brightness value and value of chromatism of the preset rules to initial pixel point
Correction corrects image, preset rules to determine are as follows: determining and initial pixel point is target pixel points apart from the smallest pixel, really
Set the goal pixel brightness value and value of chromatism be initial pixel point be mapped to correction image pixel brightness value and color difference
Value.
Optionally, brightness and chromatic aberration correction module 13 are used for:
Obtain by initial pixel point upwards, downwards, to the left and to the right move a pixel after four pixels undetermined
Coordinate (xi, yi), i=1,2,3,4;
It determines in four pixels undetermined at a distance from initial pixel pointThe smallest pixel
(x, y) is target pixel points.
Optionally, position correction module 11 is used for:
The geometric transformation that pixel coordinate is carried out to former fault image, determines the optical centre coordinate of picture pick-up device;
On former fault image along first direction with optical centre be the first basic point, successively to far from the first basic point direction
Take N number of point, and calculate N number of point to optical centre distance Ri(i=1,2 ... ... N), first direction are to pass through optical centre
Either three straight lines to;
Take up an official post in calibration template image and take a little as the second basic point, selects N number of point in a second direction, and calculate N number of point
To the distance r of the second basic pointi(i=1,2 ... ... N), second direction is identical as first direction;
R is fitted using cubic spline functionsiAnd riFunctional relation, obtain the distortion function of picture pick-up device.
Optionally, space conversion module 12 is used for:
The first fault image is transformed into YCbCr picture format by RGB image format according to following conversion formula, obtains
Brightness value Y, value of chromatism Cb and value of chromatism Cr of the initial pixel point under YCbCr picture format on one fault image:
R=Y+1.402 (Cr-128);
G=Y-0.344 (Cb-128) -0.714 (Cr-128);
B=Y+1.772 (Cb-128);
Wherein, R is the R channel value in RGB color image, and G is the G channel value in RGB color image, and B is RGB color figure
Channel B value as in.
The device of the present embodiment can be used for executing the technical solution of embodiment of the method shown in Fig. 1 or Fig. 3, realize former
Reason is similar with technical effect, and details are not described herein again.
Distorted image correction device provided in this embodiment, by former fault image carry out geometric position correction after,
The brightness and value of chromatism of initial pixel point on the first fault image after progress geometric position correction are corrected with determination
When correcting image, by apart from nearest mode, by the brightness value and color difference of the smallest pixel at a distance from initial pixel point
Value is mapped to the brightness value and value of chromatism of the pixel of correction image as initial pixel point, thus reduces and carries out to fault image
The quantity of the pixel of correction is calculated needed for timing, to reduce algorithm complexity and image processing time, guarantees signal
The real-time of transmission, therefore dynamic image can be handled in real time, improve treatment effeciency.
Fig. 6 is a kind of structural schematic diagram of distorted image correction Installation practice provided by the present application, as shown in fig. 6, this
The device of embodiment may include: memory 201 and processor 202,
Memory 201, for storing program instruction, which can be flash (flash memory).
Processor 202, for calling and executing the program instruction in memory, to realize Fig. 1 or distortion figure shown in Fig. 3
As each step in bearing calibration.It specifically may refer to the associated description in previous methods embodiment.
It can also include input/output interface 203.Input/output interface 203 may include independent output interface and defeated
Incoming interface, or the integrated integrated interface output and input.Wherein, output interface is used for output data, and input interface is used
In the data for obtaining input, the data of above-mentioned output are the general designation exported in above method embodiment, and the data of input are above-mentioned
The general designation inputted in embodiment of the method.
The application also provides a kind of readable storage medium storing program for executing, is stored with computer program in readable storage medium storing program for executing, works as distortion figure
When executing the computer program as at least one processor of means for correcting, distorted image correction device executes the abnormal of first aspect
Become method for correcting image.
The application also provides a kind of program product, which includes computer program, which is stored in
In readable storage medium storing program for executing.At least one processor of distorted image correction device can read the computer from readable storage medium storing program for executing
Program, at least one processor execute the fault image that the computer program makes distorted image correction device implement first aspect
Bearing calibration.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above-mentioned each method embodiment can lead to
The relevant hardware of program instruction is crossed to complete.Program above-mentioned can be stored in a computer readable storage medium.The journey
When being executed, execution includes the steps that above-mentioned each method embodiment to sequence;And storage medium above-mentioned include: ROM, RAM, magnetic disk or
The various media that can store program code such as person's CD.
Finally, it should be noted that the above various embodiments is only to illustrate the technical solution of the application, rather than its limitations;To the greatest extent
Pipe is described in detail the application referring to foregoing embodiments, those skilled in the art should understand that: its according to
So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into
Row equivalent replacement;And these are modified or replaceed, each embodiment technology of the application that it does not separate the essence of the corresponding technical solution
The range of scheme.
Claims (10)
1. a kind of distorted image correction method characterized by comprising
The distortion function of picture pick-up device is determined according to former fault image and calibration template image, and according to the distortion function to original
Fault image carries out geometric position correction, obtains the first fault image;
By first fault image by RGB image format change be YCbCr picture format, determine on first fault image
Brightness value and value of chromatism of the initial pixel point under the YCbCr picture format;
The brightness value of the initial pixel point and the value of chromatism are corrected to determine correction chart according to preset rules
Picture, the preset rules are as follows: the determining and initial pixel point is target pixel points apart from the smallest pixel, determines the mesh
Mark pixel brightness value and value of chromatism be the initial pixel point be mapped to it is described correction image pixel brightness value and
Value of chromatism.
2. the method according to claim 1, wherein the determination and the initial pixel point are apart from the smallest picture
Vegetarian refreshments is target pixel points, comprising:
Obtain by the initial pixel point upwards, downwards, to the left and to the right move a pixel after four pixels undetermined
Coordinate (xi, yi), i=1,2,3,4;
It determines in four pixels undetermined at a distance from the initial pixel pointThe smallest pixel
Point (x, y) is the target pixel points.
3. the method according to claim 1, wherein described determine according to former fault image and calibration template image
The distortion function of picture pick-up device, comprising:
The geometric transformation that pixel coordinate is carried out to former fault image, determines the optical centre coordinate of the picture pick-up device;
On former fault image along first direction with optical centre be the first basic point, successively to far from first basic point direction
Take N number of point, and calculate N number of point to the optical centre distance Ri(i=1,2 ... ... N), the first direction is logical
Cross either three straight lines of optical centre to;
Take up an official post in the calibration template image and take a little as the second basic point, selects N number of point in a second direction, and calculate the N
Distance r of a point to second basic pointi(i=1,2 ... ... N), the second direction is identical as the first direction;
The R is fitted using cubic spline functionsiAnd riFunctional relation, obtain the distortion function of the picture pick-up device.
4. the method according to claim 1, wherein it is described by first fault image by RGB image format
It is changed into YCbCr picture format, determines the initial pixel point on first fault image under the YCbCr picture format
Brightness value and value of chromatism, comprising:
First fault image is transformed into YCbCr picture format by RGB image format according to following conversion formula, obtains institute
State brightness value Y, value of chromatism Cb and value of chromatism of the initial pixel point on the first fault image under the YCbCr picture format
Cr:
R=Y+1.402 (Cr-128);
G=Y-0.344 (Cb-128) -0.714 (Cr-128);
B=Y+1.772 (Cb-128);
Wherein, R is the R channel value in RGB color image, and G is the G channel value in RGB color image, and B is in RGB color image
Channel B value.
5. a kind of distorted image correction device characterized by comprising
Position correction module, for determining the distortion function of picture pick-up device, and root according to former fault image and calibration template image
Geometric position correction is carried out to former fault image according to the distortion function, obtains the first fault image;
Space conversion module is used to first fault image be YCbCr picture format by RGB image format change, determine
Brightness value and value of chromatism of the initial pixel point under the YCbCr picture format on first fault image;
Brightness and chromatic aberration correction module, for the brightness value and the color difference according to preset rules to the initial pixel point
Value is corrected to determine and correct image, the preset rules are as follows: the determining and initial pixel point is apart from the smallest pixel
For target pixel points, determines the brightness value of the target pixel points and value of chromatism is that the initial pixel point is mapped to the correction
The brightness value and value of chromatism of the pixel of image.
6. device according to claim 5, which is characterized in that the brightness and chromatic aberration correction module are used for:
Obtain by the initial pixel point upwards, downwards, to the left and to the right move a pixel after four pixels undetermined
Coordinate (xi, yi), i=1,2,3,4;
It determines in four pixels undetermined at a distance from the initial pixel pointThe smallest pixel
Point (x, y) is the target pixel points.
7. device according to claim 5, which is characterized in that the position correction module is used for:
The geometric transformation that pixel coordinate is carried out to former fault image, determines the optical centre coordinate of the picture pick-up device;
On former fault image along first direction with optical centre be the first basic point, successively to far from first basic point direction
Take N number of point, and calculate N number of point to the optical centre distance Ri(i=1,2 ... ... N), the first direction is logical
Cross either three straight lines of optical centre to;
Take up an official post in the calibration template image and take a little as the second basic point, selects N number of point in a second direction, and calculate the N
Distance r of a point to second basic pointi(i=1,2 ... ... N), the second direction is identical as the first direction;
The R is fitted using cubic spline functionsiAnd riFunctional relation, obtain the distortion function of the picture pick-up device.
8. device according to claim 5, which is characterized in that the space conversion module is used for:
First fault image is transformed into YCbCr picture format by RGB image format according to following conversion formula, obtains institute
State brightness value Y, value of chromatism Cb and value of chromatism of the initial pixel point on the first fault image under the YCbCr picture format
Cr:
R=Y+1.402 (Cr-128);
G=Y-0.344 (Cb-128) -0.714 (Cr-128);
B=Y+1.772 (Cb-128);
Wherein, R is the R channel value in RGB color image, and G is the G channel value in RGB color image, and B is in RGB color image
Channel B value.
9. a kind of distorted image correction device characterized by comprising
Memory, for storing program instruction;
Processor, for calling and executing the program instruction in the memory, to realize that claim 1-4 is described in any item
Distorted image correction method.
10. a kind of readable storage medium storing program for executing, which is characterized in that be stored with computer program in the readable storage medium storing program for executing, work as distortion
When at least one processor of image correction apparatus executes the computer program, the distorted image correction device perform claim is wanted
Seek the described in any item distorted image correction methods of 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810915121.7A CN109255760A (en) | 2018-08-13 | 2018-08-13 | Distorted image correction method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810915121.7A CN109255760A (en) | 2018-08-13 | 2018-08-13 | Distorted image correction method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109255760A true CN109255760A (en) | 2019-01-22 |
Family
ID=65050144
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810915121.7A Pending CN109255760A (en) | 2018-08-13 | 2018-08-13 | Distorted image correction method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109255760A (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110060200A (en) * | 2019-03-18 | 2019-07-26 | 阿里巴巴集团控股有限公司 | Perspective image transform method, device and equipment |
CN110189263A (en) * | 2019-05-05 | 2019-08-30 | 浙江大学 | It is a kind of based on multi-angle sampling big visual field wear display equipment distortion correction method |
CN110276734A (en) * | 2019-06-24 | 2019-09-24 | Oppo广东移动通信有限公司 | Image distortion correction method and apparatus |
CN110751601A (en) * | 2019-09-10 | 2020-02-04 | 中国科学院上海技术物理研究所 | Distortion correction method based on RC optical system |
CN111260567A (en) * | 2020-01-10 | 2020-06-09 | 昆山丘钛微电子科技有限公司 | Method and device for correcting image distortion |
WO2022031707A1 (en) * | 2020-08-04 | 2022-02-10 | Boston Scientific Scimed, Inc. | Methods and devices for gamma correction |
CN114092384A (en) * | 2020-08-24 | 2022-02-25 | 深圳迈瑞生物医疗电子股份有限公司 | Method for correcting image brightness, image analysis device and analysis system |
CN114827385A (en) * | 2021-01-18 | 2022-07-29 | 北京猎户星空科技有限公司 | Image processing method and device and electronic equipment |
CN115222631A (en) * | 2022-09-13 | 2022-10-21 | 武汉中导光电设备有限公司 | Distorted image correction method, device and equipment and readable storage medium |
US11508043B2 (en) * | 2020-06-18 | 2022-11-22 | Connaught Electronics Ltd. | Method and apparatus for enhanced anti-aliasing filtering on a GPU |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101179745A (en) * | 2007-12-05 | 2008-05-14 | 宁波大学 | Preprocessing method of multi-viewpoint image |
EP1363238A3 (en) * | 2000-03-17 | 2008-07-30 | Sun Microsystems, Inc. | A graphics system having a super-sampled sample buffer with hot spot correction,edge blending, edge matching, distortion correction and chromatic distortion compensation |
CN104700367A (en) * | 2015-03-05 | 2015-06-10 | 清华大学 | Geometric correction method of on-board hyperspectral push-broom imaging data |
CN108305224A (en) * | 2018-01-15 | 2018-07-20 | 上海顺久电子科技有限公司 | A kind of distortion correction method of image, device and television set |
-
2018
- 2018-08-13 CN CN201810915121.7A patent/CN109255760A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1363238A3 (en) * | 2000-03-17 | 2008-07-30 | Sun Microsystems, Inc. | A graphics system having a super-sampled sample buffer with hot spot correction,edge blending, edge matching, distortion correction and chromatic distortion compensation |
CN101179745A (en) * | 2007-12-05 | 2008-05-14 | 宁波大学 | Preprocessing method of multi-viewpoint image |
CN104700367A (en) * | 2015-03-05 | 2015-06-10 | 清华大学 | Geometric correction method of on-board hyperspectral push-broom imaging data |
CN108305224A (en) * | 2018-01-15 | 2018-07-20 | 上海顺久电子科技有限公司 | A kind of distortion correction method of image, device and television set |
Non-Patent Citations (1)
Title |
---|
郁道银 等: "医用电子内窥镜畸变图像的实时校正方法", 《大珩先生九十华诞文集暨中国光学学会2004年学术大会论文集》 * |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110060200B (en) * | 2019-03-18 | 2023-05-30 | 创新先进技术有限公司 | Image perspective transformation method, device and equipment |
CN110060200A (en) * | 2019-03-18 | 2019-07-26 | 阿里巴巴集团控股有限公司 | Perspective image transform method, device and equipment |
CN110189263A (en) * | 2019-05-05 | 2019-08-30 | 浙江大学 | It is a kind of based on multi-angle sampling big visual field wear display equipment distortion correction method |
CN110189263B (en) * | 2019-05-05 | 2021-05-07 | 浙江大学 | Large-view-field head-mounted display equipment distortion correction method based on multi-angle sampling |
CN110276734A (en) * | 2019-06-24 | 2019-09-24 | Oppo广东移动通信有限公司 | Image distortion correction method and apparatus |
US11861813B2 (en) | 2019-06-24 | 2024-01-02 | Guangdong Oppo Mobile Telecommunications Corp., Ltd. | Image distortion correction method and apparatus |
CN110276734B (en) * | 2019-06-24 | 2021-03-23 | Oppo广东移动通信有限公司 | Image distortion correction method and device |
CN110751601A (en) * | 2019-09-10 | 2020-02-04 | 中国科学院上海技术物理研究所 | Distortion correction method based on RC optical system |
CN111260567A (en) * | 2020-01-10 | 2020-06-09 | 昆山丘钛微电子科技有限公司 | Method and device for correcting image distortion |
CN111260567B (en) * | 2020-01-10 | 2024-01-19 | 昆山丘钛微电子科技有限公司 | Image distortion correction method and device |
US11508043B2 (en) * | 2020-06-18 | 2022-11-22 | Connaught Electronics Ltd. | Method and apparatus for enhanced anti-aliasing filtering on a GPU |
WO2022031707A1 (en) * | 2020-08-04 | 2022-02-10 | Boston Scientific Scimed, Inc. | Methods and devices for gamma correction |
CN114092384A (en) * | 2020-08-24 | 2022-02-25 | 深圳迈瑞生物医疗电子股份有限公司 | Method for correcting image brightness, image analysis device and analysis system |
CN114827385A (en) * | 2021-01-18 | 2022-07-29 | 北京猎户星空科技有限公司 | Image processing method and device and electronic equipment |
CN115222631A (en) * | 2022-09-13 | 2022-10-21 | 武汉中导光电设备有限公司 | Distorted image correction method, device and equipment and readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109255760A (en) | Distorted image correction method and device | |
CN110505459B (en) | Image color correction method, device and storage medium suitable for endoscope | |
US9934562B2 (en) | Method for dynamic range editing | |
CN109934776B (en) | Model generation method, video enhancement method, device and computer-readable storage medium | |
US7116820B2 (en) | Detecting and correcting red-eye in a digital image | |
CN110914873B (en) | Augmented reality method, device, mixed reality glasses and storage medium | |
CN102722868B (en) | Tone mapping method for high dynamic range image | |
CN107204034B (en) | A kind of image processing method and terminal | |
US11908107B2 (en) | Method and apparatus for presenting image for virtual reality device, device and non-transitory computer-readable storage medium | |
CN109598673A (en) | Image split-joint method, device, terminal and computer readable storage medium | |
WO2023226218A1 (en) | Axisymmetric optical imaging parallel simulation method and apparatus | |
CN109817170B (en) | Pixel compensation method and device and terminal equipment | |
KR20120021149A (en) | Image correcting apparatus, correction image generating method, correction table generating apparatus, correction table generating method, computer readable recording medium storing a correction table generating program, computer readable recording medium storing a correction image generating program | |
CN103067671B (en) | A kind of method and device showing image | |
JP3621304B2 (en) | Image brightness correction method | |
CN108876742A (en) | image color enhancement method and device | |
CN110335330A (en) | Image simulation generation method and its system, deep learning algorithm training method and electronic equipment | |
CN109255763A (en) | Image processing method, device, equipment and storage medium | |
CN106157241A (en) | A kind of method and device of Panorama Mosaic | |
WO2019205937A1 (en) | Pupil center positioning apparatus and method, and virtual reality device | |
CN117437118A (en) | Image processing method and device and electronic equipment | |
KR20070063781A (en) | Method and apparatus for image adaptive color adjustment of pixel in color gamut | |
CN105488764B (en) | Fisheye image correcting method and device | |
CN116630198A (en) | Multi-scale fusion underwater image enhancement method combining self-adaptive gamma correction | |
WO2021147316A1 (en) | Object recognition method and device |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190122 |