CN112884670A - Method for correcting pixel offset between adjacent rows - Google Patents
Method for correcting pixel offset between adjacent rows Download PDFInfo
- Publication number
- CN112884670A CN112884670A CN202110211966.XA CN202110211966A CN112884670A CN 112884670 A CN112884670 A CN 112884670A CN 202110211966 A CN202110211966 A CN 202110211966A CN 112884670 A CN112884670 A CN 112884670A
- Authority
- CN
- China
- Prior art keywords
- pixels
- phase difference
- filtering
- phase
- image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 32
- 238000001914 filtration Methods 0.000 claims abstract description 54
- 230000009466 transformation Effects 0.000 claims description 13
- 238000010586 diagram Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 239000013589 supplement Substances 0.000 description 1
- 230000001131 transforming effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/10—Image enhancement or restoration using non-spatial domain filtering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/20—Image enhancement or restoration using local operators
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/50—Image enhancement or restoration using two or more images, e.g. averaging or subtraction
-
- 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/20—Special algorithmic details
- G06T2207/20212—Image combination
- G06T2207/20224—Image subtraction
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
Abstract
The invention discloses a method for correcting pixel offset between adjacent rows, which comprises the following steps: acquiring a phase difference between odd-line pixels and even-line pixels of an image; filtering the phase difference between the odd-numbered line pixels and the even-numbered line pixels; performing phase unwrapping processing on the phase difference after the filtering processing; filtering the phase difference after the phase unwrapping processing; calculating the number and direction of pixels with offset in the obtained image; and performing pixel offset correction processing based on the number and direction of pixels with offset in the image. The invention can accurately and quickly correct the offset of the pixels between the adjacent rows.
Description
Technical Field
The invention relates to the technical field of pixel offset, in particular to a method for correcting pixel offset between adjacent rows.
Background
In medical equipment, a reflecting galvanometer is generally used as a scanning device to scan and image a target line by line, wherein one cycle is a round trip. Over time, the time to and fro is randomly dithered during each cycle, which causes the image to shift between odd and even lines, a phenomenon commonly referred to as jitter.
Disclosure of Invention
The invention provides a method for correcting pixel offset between adjacent rows, which can accurately and quickly correct the pixel offset between the adjacent rows.
In order to solve the above technical problem, the present invention provides a method for correcting pixel offset between adjacent rows, comprising:
acquiring a phase difference between odd-line pixels and even-line pixels of an image;
filtering the phase difference between the odd-numbered line pixels and the even-numbered line pixels;
performing phase unwrapping processing on the phase difference after the filtering processing;
filtering the phase difference after the phase unwrapping processing;
calculating the number and direction of pixels with offset in the obtained image;
and performing pixel offset correction processing based on the number and direction of pixels with offset in the image.
As a preferable aspect of the above, before the acquiring the phase difference between the pixels in the odd lines and the pixels in the even lines of the image, the shift correction method further includes: and respectively carrying out Fourier transform on the odd-line pixels and the even-line pixels.
As a preferable aspect of the foregoing technical solution, the filtering the phase difference between the pixels in the odd-numbered lines and the pixels in the even-numbered lines specifically includes: firstly, performing sine transformation and cosine transformation on the phase difference, then performing nonlinear filtering on the phase difference after the sine transformation and the cosine transformation respectively, and then obtaining the phase difference after filtering through calculation.
Preferably, in the above technical solution, a calculation formula for performing nonlinear filtering on the phase difference after the sine transform and the cosine transform is as follows: if the input signal is I and the filtering window length is r, the filtered signal S is:
wherein a and b areConstant, I is the position coordinate in the filtering window, k is the coordinate of the current signal, IiFor the value of the signal with coordinate I within the filtering window, IkIs the value of the signal at coordinate k within the filter window.
Preferably, in the above technical solution, a calculation formula of the phase difference after filtering is: atan2(delta _ phi _ S/delta _ phi _ C), delta _ phi _ S being the phase difference after filtering the sine transformed phase difference and delta _ phi _ C being the phase difference after filtering the cosine transformed phase difference.
Preferably, in the above-described aspect, the phase unwrapping process is performed by converting a discontinuous phase into a continuous phase.
As a preferable aspect of the above, the converting the discontinuous phase into the continuous phase includes: and obtaining a second curve after the phase unwrapping of the first curve obtained based on the phase difference fitting after the filtering.
As a preferred aspect of the foregoing technical solution, the calculating the number and direction of pixels having a shift in the obtained image specifically includes: and calculating the number and the direction of the pixels with the shift in the obtained image based on the second curve.
Preferably, the formula for calculating the number of pixels with offset in the obtained image is as follows: the number of pixels S shifted is (f (x))max-f(x)min) V (2 x pi), where f (x) is the phase after filtering, and pi is the pixel.
Preferably, the direction of the pixels in the image that are shifted is determined by the slope of the second curve, and the positive slope is that the pixels in the even-numbered rows are shifted to the left; the negative slope is an even number.
The invention provides a method for correcting pixel offset between adjacent lines, which comprises the steps of obtaining the phase difference between pixels in odd lines and pixels in even lines of an image; filtering the phase difference between the odd-numbered line pixels and the even-numbered line pixels; performing phase unwrapping processing on the phase difference after the filtering processing; filtering the phase difference after the phase unwrapping processing; calculating the number and direction of pixels with offset in the obtained image; and the correction processing of the pixel shift is performed based on the number and direction of the pixels in the image in which the shift occurs, so it is possible to accurately and quickly correct the shift of the pixels between the adjacent rows.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
FIG. 1 is a flow chart illustrating a method for correcting pixel shift between adjacent rows according to an embodiment of the present invention;
FIG. 2 is a schematic diagram showing initial state fitting of the phase difference obtained in an embodiment of the present invention;
fig. 3 shows a schematic representation of a first curve and a second curve in an embodiment of the invention.
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, an embodiment of the present invention provides a method for correcting pixel shift between adjacent rows, including:
acquiring a phase difference between odd-line pixels and even-line pixels of an image;
filtering the phase difference between the odd-numbered line pixels and the even-numbered line pixels;
performing phase unwrapping processing on the phase difference after the filtering processing;
filtering the phase difference after the phase unwrapping processing;
calculating the number and direction of pixels with offset in the obtained image;
and performing pixel offset correction processing based on the number and direction of pixels with offset in the image.
In general, pixel misalignment between lines caused by jitter varies with time due to changes in stress, temperature, etc., but the number of pixels misaligned in a short time remains substantially constant, so that a two-dimensional method can be adopted as a supplement to pixel misalignment correction.
In this embodiment, 2a continuous lines are taken out from one image as a sub-image to be processed, odd lines and even lines of the sub-image are taken out respectively, two smaller images I _ odd and I _ even with the line number a are synthesized again, and the jitter correction of the 2a line image can be completed by performing two-dimensional pixel offset correction on the two images.
In practical application, the method not only can accurately and quickly correct the offset of the pixels between adjacent rows, but also has higher robustness.
In addition, in the embodiment, the filtering process for the phase difference after the phase unwrapping process may be implemented by using any filtering method in the prior art.
In a further implementation manner of this embodiment, before the phase difference between the pixels on the odd lines and the pixels on the even lines of the acquired image, the shift correction method further includes: and respectively carrying out Fourier transform on the odd-line pixels and the even-line pixels.
Referring specifically to fig. 2, fitting after fourier transforming the data of the odd-numbered line pixels and the data of the even-numbered line pixels results in the schematic diagram shown in fig. 2, and the phase difference is wrapped in a certain range, which is in a discontinuous state.
In a further implementation manner of this embodiment, the filtering the phase difference between the pixels in the odd rows and the pixels in the even rows specifically includes: firstly, performing sine transformation and cosine transformation on the phase difference, then performing nonlinear filtering on the phase difference after the sine transformation and the cosine transformation respectively, and then obtaining the phase difference after filtering through calculation.
Specifically, if the phase difference is delta _ phi, the value is first sine-cosine transformed to protect the part where the phase difference jumps, i.e. the part where the phase difference jumps
delta_phi_sin=sin(delta_phi),delta_phi_cos=cos(delta_phi)。
In a further implementation manner of this embodiment, the calculation formula for performing nonlinear filtering on the phase difference after the sine transform and the cosine transform is as follows: if the input signal is I and the filtering window length is r, the filtered signal S is:
where a, b are constants, I is the position coordinate in the filtering window, k is the coordinate of the current signal, IiFor the value of the signal with coordinate I within the filtering window, IkIs the value of the signal at coordinate k within the filter window.
The calculation formula in the present embodiment can effectively implement the nonlinear filtering process and is proposed to provide accurate performance.
In a further implementation manner of this embodiment, the calculation formula of the phase difference after filtering is: atan2(delta _ phi _ S/delta _ phi _ C), delta _ phi _ S being the phase difference after filtering the sine transformed phase difference and delta _ phi _ C being the phase difference after filtering the cosine transformed phase difference.
In a further implementation of this embodiment, the phase unwrapping process is configured to convert a discontinuous phase into a continuous phase.
In a further implementation manner of this embodiment, the converting the discontinuous phase into the continuous phase includes: and obtaining a second curve after the phase unwrapping of the first curve obtained based on the phase difference fitting after the filtering.
Referring to fig. 3, in which the up-and-down fluctuating portion is a first curve, which is discontinuous, a second curve is obtained in which the middle portion is stable and continuous after unwrapping.
In a further implementation manner of this embodiment, the calculating the number and the direction of the pixels with the shift in the obtained image specifically includes: and calculating the number and the direction of the pixels with the shift in the obtained image based on the second curve.
Based on the second curve, when the phase difference between the pixels in two adjacent rows is greater than a threshold T, it can be determined that the pixels in two adjacent rows are at the position of the jump, so we need to add or subtract the period 2pi to or from the pixels in the even row according to the difference between the two, so that the relationship between the pixels and the pixels in the odd row is more continuous. To eliminate the effect of noise, T is typically slightly less than 2 pi.
In a further implementation manner of this embodiment, the formula for calculating the number of pixels in the obtained image that are shifted is: the number of pixels S shifted is (f (x))max-f(x)min) V (2 x pi), where f (x) is the phase after filtering, and pi is the pixel.
In a further implementation manner of this embodiment, the direction of the pixels in the image that are shifted is determined by the slope of the second curve, and the positive slope is that the pixels in the even rows are shifted to the left; the negative slope is the shift to the right of the even row pixels.
In addition, the calculation process of the pixel count and the cheap direction in the present embodiment can quickly and efficiently calculate the number of pixels that are cheap and the offset direction.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.
Claims (10)
1. A method for correcting pixel shift between adjacent rows, comprising:
acquiring a phase difference between odd-line pixels and even-line pixels of an image;
filtering the phase difference between the odd-numbered line pixels and the even-numbered line pixels;
performing phase unwrapping processing on the phase difference after the filtering processing;
filtering the phase difference after the phase unwrapping processing;
calculating the number and direction of pixels with offset in the obtained image;
and performing pixel offset correction processing based on the number and direction of pixels with offset in the image.
2. The correction method according to claim 1, wherein the shift correction method further includes, before the phase difference between the odd-line pixels and the even-line pixels of the acquired image: and respectively carrying out Fourier transform on the odd-line pixels and the even-line pixels.
3. The correction method according to claim 1, wherein the filtering the phase difference between the odd-line pixels and the even-line pixels specifically comprises: firstly, performing sine transformation and cosine transformation on the phase difference, then performing nonlinear filtering on the phase difference after the sine transformation and the cosine transformation respectively, and then obtaining the phase difference after filtering through calculation.
4. A correction method according to claim 3, characterized in that the calculation formula for the nonlinear filtering of the phase difference after the sine and cosine transformation is: if the input signal is I and the filtering window length is r, the filtered signal S is:
where a, b are constants, I is the position coordinate in the filtering window, k is the coordinate of the current signal, IiFor the value of the signal with coordinate I within the filtering window, IkIs the value of the signal at coordinate k within the filter window.
5. A method for rectification according to claim 3, characterized in that the calculation formula of the phase difference after filtering is: atan2(delta _ phi _ S/delta _ phi _ C), delta _ phi _ S being the phase difference after filtering the sine transformed phase difference and delta _ phi _ C being the phase difference after filtering the cosine transformed phase difference.
6. The corrective method of claim 5, wherein the phase unwrapping process is to convert a discontinuous phase to a continuous phase.
7. The corrective method of claim 6, wherein said converting the discontinuous phase to the continuous phase comprises: and obtaining a second curve after the phase unwrapping of the first curve obtained based on the phase difference fitting after the filtering.
8. The method according to claim 7, wherein calculating the number and direction of pixels in the obtained image that have undergone the shift specifically comprises: and calculating the number and the direction of the pixels with the shift in the obtained image based on the second curve.
9. The rectification method according to claim 8, wherein the formula for calculating the number of pixels in the obtained image that are shifted is: the number of pixels S shifted is (f (x))max-f(x)min) V (2 x pi), where f (x) is the phase after filtering, and pi is the pixel.
10. The method of claim 8, wherein the direction of the shifted pixels in the image is determined by the slope of the second curve, with a positive slope being the even rows of pixels shifted to the left; the negative slope is the shift to the right of the even row pixels.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110211966.XA CN112884670B (en) | 2021-02-25 | 2021-02-25 | Correction method for pixel offset between adjacent rows |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110211966.XA CN112884670B (en) | 2021-02-25 | 2021-02-25 | Correction method for pixel offset between adjacent rows |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112884670A true CN112884670A (en) | 2021-06-01 |
CN112884670B CN112884670B (en) | 2024-02-27 |
Family
ID=76054884
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110211966.XA Active CN112884670B (en) | 2021-02-25 | 2021-02-25 | Correction method for pixel offset between adjacent rows |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112884670B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113660483A (en) * | 2021-08-05 | 2021-11-16 | 北京飞讯数码科技有限公司 | Real-time monitoring method and device for video playing quality and computer equipment |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1803092A (en) * | 2005-11-29 | 2006-07-19 | 东南大学 | Artifact correction method based on even marker in plane echo imaging technique |
CN103971334A (en) * | 2014-04-25 | 2014-08-06 | 中国科学院遥感与数字地球研究所 | Hyperspectral remote sensing image correcting method and device |
CN104569882A (en) * | 2014-12-29 | 2015-04-29 | 苏州朗润医疗系统有限公司 | Phase correction method for fast spin echo of magnetic resonance imaging system and application of phase correction method |
CN104713497A (en) * | 2015-03-13 | 2015-06-17 | 香港应用科技研究院有限公司 | Phase shift calibration method, 3D shape detection method and system and projection system |
CN107290700A (en) * | 2017-08-08 | 2017-10-24 | 上海联影医疗科技有限公司 | A kind of method for correcting phase, device and magnetic resonance system |
CN110530287A (en) * | 2019-08-26 | 2019-12-03 | 西安交通大学 | Phase Unwrapping Algorithm error detection and correction method based on fringe order not accuracy |
CN111265184A (en) * | 2020-03-25 | 2020-06-12 | 佛山科学技术学院 | Phase compensation method and system based on anterior chamber imaging |
CN111413655A (en) * | 2020-03-31 | 2020-07-14 | 浙江大学 | Magnetic resonance CEST imaging frequency drift correction method, device, medium and imaging equipment |
CN112308963A (en) * | 2020-11-13 | 2021-02-02 | 四川川大智胜软件股份有限公司 | Non-inductive three-dimensional face reconstruction method and acquisition reconstruction system |
-
2021
- 2021-02-25 CN CN202110211966.XA patent/CN112884670B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1803092A (en) * | 2005-11-29 | 2006-07-19 | 东南大学 | Artifact correction method based on even marker in plane echo imaging technique |
CN103971334A (en) * | 2014-04-25 | 2014-08-06 | 中国科学院遥感与数字地球研究所 | Hyperspectral remote sensing image correcting method and device |
CN104569882A (en) * | 2014-12-29 | 2015-04-29 | 苏州朗润医疗系统有限公司 | Phase correction method for fast spin echo of magnetic resonance imaging system and application of phase correction method |
CN104713497A (en) * | 2015-03-13 | 2015-06-17 | 香港应用科技研究院有限公司 | Phase shift calibration method, 3D shape detection method and system and projection system |
CN107290700A (en) * | 2017-08-08 | 2017-10-24 | 上海联影医疗科技有限公司 | A kind of method for correcting phase, device and magnetic resonance system |
CN110530287A (en) * | 2019-08-26 | 2019-12-03 | 西安交通大学 | Phase Unwrapping Algorithm error detection and correction method based on fringe order not accuracy |
CN111265184A (en) * | 2020-03-25 | 2020-06-12 | 佛山科学技术学院 | Phase compensation method and system based on anterior chamber imaging |
CN111413655A (en) * | 2020-03-31 | 2020-07-14 | 浙江大学 | Magnetic resonance CEST imaging frequency drift correction method, device, medium and imaging equipment |
CN112308963A (en) * | 2020-11-13 | 2021-02-02 | 四川川大智胜软件股份有限公司 | Non-inductive three-dimensional face reconstruction method and acquisition reconstruction system |
Non-Patent Citations (1)
Title |
---|
普拉莫德(瑞士): "数字光学测量技术和应用", 国防工业出版社, pages: 176 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113660483A (en) * | 2021-08-05 | 2021-11-16 | 北京飞讯数码科技有限公司 | Real-time monitoring method and device for video playing quality and computer equipment |
Also Published As
Publication number | Publication date |
---|---|
CN112884670B (en) | 2024-02-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8000559B2 (en) | Method of correcting image distortion and apparatus for processing image using the method | |
US20220076391A1 (en) | Image Distortion Correction Method and Apparatus | |
US9275463B2 (en) | Stereo image processing device and stereo image processing method | |
US20090244299A1 (en) | Image processing device, computer-readable storage medium, and electronic apparatus | |
EP1855486B1 (en) | Image processor correcting color misregistration, image processing program, image processing method, and electronic camera | |
US9210445B2 (en) | Method and apparatus for periodic structure handling for motion compensation | |
CN106169173B (en) | Image interpolation method | |
US9117271B2 (en) | Apparatus, method and recording medium for image processing | |
JP2015019958A5 (en) | Magnetic resonance imaging apparatus, image processing apparatus, image processing method, and image processing program | |
CN110390690B (en) | Depth map processing method and device | |
GB2547842A (en) | Image processing device and method, image pickup device, program, and recording medium | |
CN104735360A (en) | Method and device for optical field image processing | |
CN112884670A (en) | Method for correcting pixel offset between adjacent rows | |
US11076092B2 (en) | Image processing apparatus, image processing method, and image processing program | |
CN110400344B (en) | Depth map processing method and device | |
US20100040304A1 (en) | Image quality improvement processing apparatus, image quality improvement processing method and computer-readable recording medium storing image quality improvement processing computer program | |
EP3221661B1 (en) | Depth detection apparatus, imaging apparatus and depth detection method | |
US6667766B2 (en) | Method of removing noise from image signal | |
US20150161771A1 (en) | Image processing method, image processing apparatus, image capturing apparatus and non-transitory computer-readable storage medium | |
JP2011055259A (en) | Image processing apparatus, image processing method, image processing program and program storage medium stored with image processing program | |
JP2007088828A (en) | Camera shake correction device | |
US11145033B2 (en) | Method and device for image correction | |
CN110766615A (en) | Picture correction method, device, terminal and computer readable storage medium | |
JP5213896B2 (en) | Image processing method, image processing apparatus, and program | |
JPH07200819A (en) | Image processor |
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 |