The embodiment of the invention provides a pointer type instrument inclination
correction method and
system, and the method comprises the steps: inputting a to-be-corrected inclination instrument image into a key point detection model, and obtaining a detection key scale digital coordinate; performing
ellipse fitting on the detection key scale digital coordinates based on a least square method toobtain a fitting
ellipse; obtaining
ellipse parameters, and determining coordinate points before
perspective transformation; determining an excircle of the ellipse, and determining a coordinate pointafter
perspective transformation; obtaining a
perspective transformation matrix according to the coordinate points before perspective transformation and the coordinate points after perspective transformation; and performing perspective transformation on the instrument image to be corrected according to the perspective
transformation matrix to obtain a corrected front-view instrument image. The keyscale coordinates are acquired to fit the ellipse, the ellipse transformation principle is combined, perspective transformation is used to realize inclination correction of the instrument, the robustness is good, and inclination correction of any circular instrument can still be accurately realized under the conditions of dial shielding, fuzziness, uneven illumination and the like.