The invention provides a light color cast
correction method and device based on a target area, and is applied to the technical field of
data processing. The method comprises the following steps: acquiring a light original image and a shooting environment parameter through an
image acquisition module; a
light source point is positioned by using a YOLO
algorithm, a white connected domain is extracted by combining an HSV threshold value, a luminous
body contour is obtained through closed contour search, and whether correction is needed or not is judged according to the proportion of 80%; a U-Net model with specific parameters is adopted to segment outer-layer halo, and a color reference annular area is obtained through XOR operation; on the basis of pixel data of the region, through formula calculation, abnormal value filtering and class
logistic regression function fitting, deducing and compensating an HSV (
Hue, Saturation and Value) parameter; and performing non-target area invariance on the color cast area of the inner layer of the
light source, and finally outputting a corrected image and verifying the effect, thereby realizing accurate color cast correction.