The study focused on the therapeutic effects of high-flow oxygen therapy on patients with critical lung injury using edge detection-based ultrasound images. Firstly, the traditional Canny edge detection algorithm was improved, and the optimal threshold was obtained by optimizing the median filter and combining Otsu algorithm and threshold iteration method. Then, the optimized algorithm was compared with the traditional Canny edge detection algorithm and applied to process the lung ultrasound images of 120 cases of critical lung injury, to compare the efficacy of high-flow oxygen therapy and the traditional oxygen therapy. It was found that the peak signal-to-noise ratio (PSNR) (20.34~31.3), edge intensity value (17.89~27.34), and edge detection effect of the improved Canny algorithm were better than the traditional Canny algorithm (15.2~28.61, 9.44~18.56). The failure rate of extubation (4.1%), reintubation rate (0.8%), comfort (
2.38
±
0.15
points), dry humidity score (
1.07
±
0.21
points), antibiotic use (
7.41
±
0.74
days), and hospital stay (
8.66
±
1.02
days) in the experimental group were significantly lower than the corresponding indexes in the control group (11.7%, 5%,
4.25
±
0.26
minutes,
4.94
±
0.78
minutes,
19.29
±
1.7
days, and
27.49
±
2.22
days), and the difference was statistically significant (
P
<
0.05
). In the experimental group, within 48 hours after extubation, the respiratory rate (RR), heart rate (HR), arterial partial pressure of carbon dioxide (PaCO2), and HCO3- were significantly lower than those of the control group; and the values of transcutaneous oxygen saturation (SpO2), mean arterial pressure (MAP), arterial partial pressure of oxygen (PaO2), and pH were significantly higher than the control group, and the difference was statistically significant (
P
<
0.05
). In conclusion, the algorithm in this study is superior to the traditional Canny algorithm, and the high-flow oxygen therapy can reduce the failure rate of extubation, strengthen patient comfort, improve the degree of gas humidification, stabilize the respiratory function and circulatory system, and shorten the time of antibiotic use and hospital stay.