This commit is contained in:
张梦南 2025-05-11 22:27:45 +08:00
parent f3bb080957
commit d5760b0e6f

View File

@ -11,6 +11,9 @@ rembg[`仓库`](https://github.com/danielgatis/rembg)地址
_, binary_image = cv2.threshold(image, 1, 255, cv2.THRESH_BINARY) _, binary_image = cv2.threshold(image, 1, 255, cv2.THRESH_BINARY)
``` ```
将图像灰度值 > 1的像素变为255白色也就是将抠图后保留的部分完全设为白色。其他区域像素全为0黑色 将图像灰度值 > 1的像素变为255白色也就是将抠图后保留的部分完全设为白色。其他区域像素全为0黑色
### 结果展示 ## 结果展示
原图、抠图后的图片、二值化处理抠图后的图片的图片<br> 原图、抠图后的图片、二值化处理抠图后的图片的图片<br>
![binarization](/result/result_All.png#pic_center) ![binarization](/result/result_All.png#pic_center)
## 致谢
感谢作者[`Bill FANG`](https://blog.csdn.net/qq_20157013/article/details/140489588)的文章《采用Python的rembg库去除图片背景》<br>
感谢[`rembg`](https://github.com/danielgatis/rembg)项目的每一个成员。