opencv lsc
时间: 2023-10-18 17:05:06 浏览: 207
OpenCV中的LSC算法是通过使用ximgproc类下的createSuperpixelLSC子类来实现的。具体的Python实现代码如下:
```
import cv2
import numpy as np
img = cv2.imread("cat.jpg")
lsc = cv2.ximgproc.createSuperpixelLSC(img)
lsc.iterate(10)
mask_lsc = lsc.getLabelContourMask()
label_lsc = lsc.getLabels()
number_lsc = lsc.getNumberOfSuperpixels()
mask_inv_lsc = cv2.bitwise_not(mask_lsc)
img_lsc = cv2.bitwise_and(img, img, mask=mask_inv_lsc)
color_img = np.zeros((img.shape<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [python-opencv实现图像超像素分割(SLIC、SEEDS、LSC)](https://blog.csdn.net/sinat_38059712/article/details/113463888)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [【youcans 的 OpenCV 例程200篇】172.SLIC 超像素区域分割算法比较](https://blog.csdn.net/youcans/article/details/124576598)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文