CN112884670B - Correction method for pixel offset between adjacent rows - Google Patents

Correction method for pixel offset between adjacent rows Download PDF

Info

Publication number
CN112884670B
CN112884670B CN202110211966.XA CN202110211966A CN112884670B CN 112884670 B CN112884670 B CN 112884670B CN 202110211966 A CN202110211966 A CN 202110211966A CN 112884670 B CN112884670 B CN 112884670B
Authority
CN
China
Prior art keywords
pixels
phase difference
filtering
image
phase
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
CN202110211966.XA
Other languages
Chinese (zh)
Other versions
CN112884670A (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.)
Yaoshi Suzhou Medical Technology Co ltd
Original Assignee
Yaoshi Suzhou Medical Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yaoshi Suzhou Medical Technology Co ltd filed Critical Yaoshi Suzhou Medical Technology Co ltd
Priority to CN202110211966.XA priority Critical patent/CN112884670B/en
Publication of CN112884670A publication Critical patent/CN112884670A/en
Application granted granted Critical
Publication of CN112884670B publication Critical patent/CN112884670B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • G06T5/90
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/10Image enhancement or restoration by non-spatial domain filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration by the use of local operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration by the use of more than one image, e.g. averaging, subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20224Image subtraction

Abstract

The invention discloses a correction method of pixel offset between adjacent rows, which comprises the following steps: acquiring a phase difference between an odd-line pixel and an even-line pixel of an image; performing filtering processing on the phase difference between the pixels in the odd lines and the pixels in the even lines; performing phase unwrapping treatment on the phase difference after the filtering treatment; filtering the phase difference after the phase unwrapping process; calculating the number and the direction of pixels which are shifted in the obtained image; and correcting pixel offset based on the number and the direction of pixels in the image. The invention can accurately and quickly correct the offset of the pixels between the adjacent rows.

Description

Correction method for pixel offset between adjacent rows
Technical Field
The invention relates to the technical field of pixel offset, in particular to a correction method of pixel offset between adjacent rows.
Background
In medical devices, a mirror is typically used as a scanning device to scan and image a target line by line, one back and forth over a period. Over time, random jitter may occur in the time to and fro within each cycle, which may cause the image between the odd and even rows to shift, a phenomenon commonly known as jitter.
Disclosure of Invention
The invention provides a correction method for pixel offset between adjacent rows, which can accurately and rapidly correct the offset of pixels between the adjacent rows.
In order to solve the above technical problems, the present invention provides a method for correcting pixel offset between adjacent rows, including:
taking out continuous 2a lines in an image as a sub-image to be processed, and respectively taking out odd lines and even lines of the sub-image;
acquiring a phase difference between an odd-line pixel and an even-line pixel of an image;
performing filtering processing on the phase difference between the pixels in the odd lines and the pixels in the even lines;
performing phase unwrapping treatment on the phase difference after the filtering treatment;
filtering the phase difference after the phase unwrapping process;
calculating the number and the direction of pixels which are shifted in the obtained image;
and correcting pixel offset based on the number and the direction of pixels in the image.
As a preferable aspect of the above-described technology, before the phase difference between the odd-numbered line pixels and the even-numbered line pixels of the acquired image, the correction method further includes: and performing Fourier transform on the pixels in the odd lines and the pixels in the even lines respectively.
As a preferable aspect of the foregoing disclosure, the filtering the phase difference between the odd-numbered line pixels and the even-numbered line pixels specifically includes: the phase difference is firstly subjected to sine transformation and cosine transformation, then the phase difference after the sine transformation and the cosine transformation is respectively subjected to nonlinear filtering, and then the phase difference after the filtering is obtained through calculation.
As a preferable mode of the above technical solution, a calculation formula for nonlinear filtering of a phase difference after sine transformation and cosine transformation is: if the input signal is I and the filter window length is r, the filtered signal S is:
wherein a and b are constants, I is the position coordinate in the filtering window, k is the coordinate of the current signal, I i To filter the value of a signal with a coordinate I within a window, I k Is the value of the signal with a coordinate k within the filter window.
As a preferable mode of the above technical solution, the calculation formula of the phase difference after filtering is: atan2 (delta_phi_s/delta_phi_c), delta_phi_s is the phase difference after filtering the sine transformed phase difference, and delta_phi_c is the phase difference after filtering the cosine transformed phase difference.
As a preferable aspect of the foregoing, the phase unwrapping process is to convert discontinuous phases into continuous phases.
Preferably, the converting the discontinuous phase into the continuous phase includes: the first curve obtained based on the phase difference fitting after filtering is phase unwrapped to obtain the second curve.
As a preferable aspect of the foregoing technical solution, calculating the number and the direction of pixels in the obtained image, which are shifted, specifically includes: the number and the direction of pixels in the image, which are offset, are calculated based on the second curve.
As a preferable mode of the above technical solution, the formula for calculating the number of pixels in the obtained image, which are shifted, is: offset pixel number s= (f (x)) max -f(x) min ) /(2 pi), where f (x) is the phase after filtering and pi is the pixel.
As a preferable aspect of the foregoing disclosure, the direction of the pixel shifted in the image is determined by a slope of a second curve, and the positive slope is that the pixel in the even line shifts to the left; the negative slope is even.
The invention provides a correction method of pixel offset between adjacent lines, which is implemented by acquiring phase differences between pixels of an odd line and pixels of an even line of an image; performing filtering processing on the phase difference between the pixels in the odd lines and the pixels in the even lines; performing phase unwrapping treatment on the phase difference after the filtering treatment; filtering the phase difference after the phase unwrapping process; calculating the number and the direction of pixels which are shifted in the obtained image; and the correction processing of the pixel shift is performed based on the number and direction of pixels in the image where the shift occurs, 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 present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
Drawings
FIG. 1 is a flow chart of a method for correcting pixel offset between adjacent rows according to an embodiment of the invention;
FIG. 2 is a schematic diagram showing initial state fitting of the phase differences in an embodiment of the present invention;
fig. 3 shows a schematic diagram 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 comprehensible, the technical solutions according to the embodiments of the present invention will be clearly described in the following with reference to the accompanying drawings, and it is obvious that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, an embodiment of the present invention provides a method for correcting pixel offset between adjacent rows, which is characterized by comprising:
acquiring a phase difference between an odd-line pixel and an even-line pixel of an image;
performing filtering processing on the phase difference between the pixels in the odd lines and the pixels in the even lines;
performing phase unwrapping treatment on the phase difference after the filtering treatment;
filtering the phase difference after the phase unwrapping process;
calculating the number and the direction of pixels which are shifted in the obtained image;
and correcting pixel offset based on the number and the direction of pixels in the image.
Typically, pixel misalignment between rows due to jitter varies over time due to variations in stress, temperature, etc., but the number of pixels that are misaligned remains substantially unchanged in a short period of time, so we can use a two-dimensional approach as a complement to pixel offset correction.
In this embodiment, continuous 2a lines are taken out from an 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 line number a are recombined, and two-dimensional pixel offset correction is performed on the two images, so that the jitter correction of the 2a line image can be completed.
In practical application, the method not only can accurately and rapidly correct the offset of the pixels between adjacent rows, but also has higher robustness.
In addition, the filtering process for the phase difference after the phase unwrapping process in this embodiment may be implemented by any filtering method in the prior art.
In a further implementation of this embodiment, before the obtaining the phase difference between the pixels of the odd line and the pixels of the even line of the image, the correction method further includes: and performing Fourier transform on the pixels in the odd lines and the pixels in the even lines respectively.
Referring specifically to fig. 2, after fourier transforming the data of the pixels in the odd-numbered rows and the data of the pixels in the even-numbered rows, fitting is performed to obtain 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-numbered rows and the pixels in the even-numbered rows specifically includes: the phase difference is firstly subjected to sine transformation and cosine transformation, then the phase difference after the sine transformation and the cosine transformation is respectively subjected to nonlinear filtering, and then the phase difference after the filtering is obtained through calculation.
Specifically, if the phase difference is delta_phi, the value is subjected to sine-cosine transform to protect the phase difference jump part, namely
delta_phi_sin=sin(delta_phi),delta_phi_cos=cos(delta_phi)。
In a further implementation manner of this embodiment, a calculation formula for performing nonlinear filtering on a phase difference after sine transformation and cosine transformation is: if the input signal is I and the filter window length is r, the filtered signal S is:
wherein a and b are constants, I is the position coordinate in the filtering window, k is the coordinate of the current signal, I i To filter the value of a signal with a coordinate I within a window, I k Is the value of the signal with a coordinate k within the filter window.
The calculation formula in the present embodiment can effectively implement the nonlinear filtering process and propose 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 is the phase difference after filtering the sine transformed phase difference, and delta_phi_c is the phase difference after filtering the cosine transformed phase difference.
In a further implementation of this embodiment, the phase unwrapping process is to convert discontinuous phases to continuous phases.
In a further implementation manner of this embodiment, the converting the discontinuous phase into the continuous phase includes: the first curve obtained based on the phase difference fitting after filtering is phase unwrapped to obtain the second curve.
Referring to fig. 3, the up-and-down fluctuation portion is a first curve, which is in a discontinuous state, and a second curve with a stable and continuous middle portion is obtained after the unwrapping.
In a further implementation manner of this embodiment, calculating the number and the direction of the pixels in the obtained image, which are shifted, specifically includes: the number and the direction of pixels in the image, which are offset, are calculated based on the second curve.
Based on the second curve, when the phase difference between the two adjacent rows of pixels is greater than a certain threshold value T, the two adjacent rows of pixels can be judged to be at the jump position, so that the pixels in even rows need to be correspondingly added or subtracted with the period of 2pi according to the difference value between the two adjacent rows of pixels, and the relation between the pixels in even rows and the pixels in odd rows is more continuous. To eliminate the effect of noise, T is typically slightly less than 2pi.
In a further implementation manner of this embodiment, the formula for calculating the number of pixels in the obtained image, where the offset occurs, is: offset pixel number s= (f (x)) max -f(x) min ) /(2 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 pixel that generates the offset in the image is determined by the slope of the second curve, and the positive slope is that the pixel in the even line generates the left offset; the negative slope is that even rows of pixels are shifted to the right.
In addition, the calculation process of the pixel count and the inexpensive direction in the present embodiment can quickly and efficiently calculate the number of occurrence of pixel cheating and the offset direction.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means 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 present 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, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present invention, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method for correcting pixel shift between adjacent rows, comprising:
taking out continuous 2a lines in an image as a sub-image to be processed, and respectively taking out odd lines and even lines of the sub-image;
acquiring a phase difference between an odd-line pixel and an even-line pixel of an image;
performing filtering processing on the phase difference between the pixels in the odd lines and the pixels in the even lines;
performing phase unwrapping treatment on the phase difference after the filtering treatment;
filtering the phase difference after the phase unwrapping process;
calculating the number and the direction of pixels which are shifted in the obtained image;
and correcting pixel offset based on the number and the direction of pixels in the image.
2. The correction method according to claim 1, characterized in that before the phase difference between the odd-numbered line pixels and the even-numbered line pixels of the acquired image, the correction method further comprises: and performing Fourier transform on the pixels in the odd lines and the pixels in the even lines respectively.
3. The correction method according to claim 1, wherein the filtering the phase difference between the odd-numbered row pixels and the even-numbered row pixels specifically includes: the phase difference is firstly subjected to sine transformation and cosine transformation, then the phase difference after the sine transformation and the cosine transformation is respectively subjected to nonlinear filtering, and then the phase difference after the filtering is obtained through calculation.
4. A correction method according to claim 3, wherein the calculation formula for nonlinear filtering of the phase difference after the sine transform and the cosine transform is: if the input signal is I and the filter window length is r, the filtered signal S is:
wherein a and b are constants, I is the position coordinate in the filtering window, k is the coordinate of the current signal, I i To filter the value of a signal with a coordinate I within a window, I k Is the value of the signal with a coordinate k within the filter window.
5. A correction method according to claim 3, wherein the phase difference after the filtering is calculated by the formula: atan2 (delta_phi_s/delta_phi_c), delta_phi_s is the phase difference after filtering the sine transformed phase difference, and delta_phi_c is the phase difference after filtering the cosine transformed phase difference.
6. The method of claim 5, wherein the phase unwrapping process is to convert discontinuous phases to continuous phases.
7. The method of claim 6, wherein converting the discontinuous phase to a continuous phase comprises: the first curve obtained based on the phase difference fitting after filtering is phase unwrapped to obtain the second curve.
8. The method of claim 7, wherein calculating the number and direction of shifted pixels in the obtained image comprises: the number and the direction of pixels in the image, which are offset, are calculated based on the second curve.
9. Root of Chinese characterThe correction method as set forth in claim 8, wherein the formula for calculating the number of pixels in which the shift occurs in the obtained image is: offset pixel number s= (f (x)) max -f(x) min ) /(2 pi), where f (x) is the phase after filtering and pi is the pixel.
10. The correction method according to claim 8, wherein the direction of the shifted pixels in the image is determined by the slope of the second curve, and the positive slope is shifted to the left for the even-numbered rows of pixels; the negative slope is that even rows of pixels are shifted to the right.
CN202110211966.XA 2021-02-25 2021-02-25 Correction method for pixel offset between adjacent rows Active CN112884670B (en)

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 CN112884670A (en) 2021-06-01
CN112884670B true 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)

Citations (9)

* Cited by examiner, † Cited by third party
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

Patent Citations (9)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
普拉莫德(瑞士).数字光学测量技术和应用.国防工业出版社,2018,第176页-180页. *

Also Published As

Publication number Publication date
CN112884670A (en) 2021-06-01

Similar Documents

Publication Publication Date Title
CN102694979B (en) The control method of picture pick-up device and picture pick-up device
US9275463B2 (en) Stereo image processing device and stereo image processing method
EP2031861A2 (en) Method of correcting image distortion and apparatus for processing image using the method
US6584237B1 (en) Method and apparatus for expanding image data
KR100954133B1 (en) Image processing apparatus and image processing method
JP2015019958A5 (en) Magnetic resonance imaging apparatus, image processing apparatus, image processing method, and image processing program
CN106169173B (en) Image interpolation method
KR101784214B1 (en) Image pickup apparatus, control apparatus, control method, and storage medium
CN110400331B (en) Depth map processing method and device
US20180231885A1 (en) Image processing method and apparatus, and electronic device
EP3221661B1 (en) Depth detection apparatus, imaging apparatus and depth detection method
CN112884670B (en) Correction method for pixel offset between adjacent rows
CN110766615A (en) Picture correction method, device, terminal and computer readable storage medium
US6667766B2 (en) Method of removing noise from image signal
Lelowicz Camera model for lens with strong distortion in automotive application
JP2015076796A (en) Image-capturing device and image-capturing method
CN110400344B (en) Depth map processing method and device
US20150276398A1 (en) Distance determining apparatus, imaging apparatus, distance determining method, and parallax-amount determining apparatus
JP5167614B2 (en) Distance image generating apparatus, distance image generating method and program
CN113781312B (en) Video enhancement method and device, computer equipment and storage medium
TWI435286B (en) Image processing method and apparatus
CN114487963A (en) Phase correction method, phase correction device, computer equipment and storage medium
JP5078394B2 (en) Image processing apparatus and method
CN114487961A (en) Image correction method, system, storage medium and electronic equipment
JP2015076754A5 (en)

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