Memo

メモ > 技術 > プログラミング言語: Python > skimage(画像処理)

■skimage(画像処理)
skimageとは、画像処理に関するアルゴリズムを集めたライブラリ Pythonを用いた画像処理(openCV,skimage) - Qiita https://qiita.com/taka_baya/items/453e429b466ffaa702c9 ■画像の色の違いの部分を切り分け
import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import cv2 from skimage import data, segmentation, color from skimage.future import graph # 画像を読み込み img = cv2.imread('sample.png', 1) #画像の色の違いの部分を切り分け labels = segmentation.slic(img, compactness=30, n_segments=400, start_label=0) out = color.label2rgb(labels, img, kind='avg', bg_label=0) plt.plot() plt.imshow(out) plt.savefig('rag.png')

Advertisement