The invention provides a thermal fluid image processing method and system, and the method comprises the steps: firstly extracting the features of a histogram of oriented gradients, then calculating the feature difference of the histogram of oriented gradients, and then carrying out the binarization, segmentation, contour extraction and other operations. The method comprises an algorithm for correcting and updating a dynamic background. Meanwhile, the invention provides a corresponding terminal and a medium. The difference between the target area to be detected and the background area can be increased by extracting the histogram characteristics of the oriented gradients of the target area to be detected and the background area. The invention can be applied to the field of thermal fluid image processing, target identification, edge detection and segmentation are performed on the to-be-detected area and the background area, the nvention has advantages under the conditions that the difference between the to-be-detected target and the background is small and the background changes along with frames, and the invention is low in parameter setting sensitivity and good in universality. The invention can be oriented to different cases, working conditions and optical systems, programs are easy to implement, the processing speed is high, and results are accurate and reliable.