![](/img/trans.png)
[英]How to remove a black background from an image and make that transparent using opencv?
[英]Extract person from an image or make the background transparent
我想在沒有任何背景的圖像中提取人。我想對同一類型的多幅圖像執行此操作,請使用Python可以自動完成此過程,幫助我做到這一點。
https://depositphotos.com/148319285/stock-video-man-run-on-green-screen.html我嘗試使用Canny邊緣檢測器只能找到邊緣但無法裁剪邊緣。是否有其他方法可以檢測背景並徹底刪除。
使用opencv進行背景減法。 檢查鏈接以獲取示例和詳細信息: https : //opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_video/py_bg_subtraction/py_bg_subtraction.html
對於這種准備好的圖像,您會發現有用的簡單閾值設置: https ://docs.opencv.org/3.4.0/d7/d4d/tutorial_py_thresholding.html在這種情況下,您需要通過提取綠色通道來獲得灰度圖像圖片。 它將生成二進制(僅黑白)圖像,背景為白色,對象為黑色(或根據您的選擇相反)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.