[英]How to get box around contour using skimage.segmentation.felzenszwalb?
我正在嘗試在圖像邊緣上的分割對象周圍創建一個框,也就是說,由於對象僅部分位於圖像區域內,因此分割周圍沒有輪廓。
我使用skimage.segmentation
, find_boundaries
, clear_border
和regioprops
。 但是, regionprops
不提供這些regionprops
情況
segments_fz = felzenszwalb(cv2.cvtColor(image, cv2.COLOR_BGR2RGB), scale=300, sigma=0.5, min_size=50)
cleared = clear_border(segments_fz)
label_image = label(cleared)
regionprops(label_image)
靠近圖像區域限制的分割對象周圍的方框。
您不應該使用clear_border
。 然后,邊框上的對象將被視為其他對象。 bbox
屬性應該為您感興趣的對象提供一個邊界框,而find_boundaries
和mark_boundaries
將使您可以獲取或可視化段之間的邊界。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.