The invention discloses a refined photo hair
dyeing method and
system, and the method comprises the steps: S1, carrying out the segmentation
network model training of hair sample data based on a
convolutional neural network; s2, performing hair region segmentation on the original picture based on the trained segmentation
network model to obtain a segmentation picture
mask; s3, performing Gaussianfiltering on the segmentation image
mask to obtain a filtering effect image; s4, obtaining a hair area in the original picture according to the filtering effect picture, and performing color adjustment on the hair area to obtain a first dyed picture; s5, performing Alpha fusion on the original picture, the filtering effect picture and the first dyed picture to obtain a second dyed picture; s6, calculating a hair probability
graph based on the original picture; and S7, performing refined hair fusion on the original picture, the second dyed picture and the hair probability graph to obtain a final dyed hair picture. According to the method, the hair probability graph is calculated, the influence of areas such as
skin and clothes on hair
dyeing is effectively weakened, transition is natural, and the sense of discomfort is small.