画像image.pngをHOG特徴量を用いて表示したいです。
python
1#!/usr/bin/python 2# coding: UTF-8 3 4import matplotlib.pyplot as plt 5import cv2 6from skimage.feature import hog 7from skimage import data, exposure 8 9img = cv2.imread('C:Users\yuu\Documents\webcamera\image.png',0) 10 11fd, hog_image = hog(img, orientations=8, pixels_per_cell=(16, 16), 12 cells_per_block=(1, 1), visualize=True, multichannel=False) 13hog_image_rescaled = exposure.rescale_intensity(hog_image, in_range=(0, 10)) 14 15plt.axis('off') 16plt.imshow(hog_image_rescaled, cmap=plt.cm.gray) 17plt.savefig('hog.png')
エラーが以下です。
ValueError: Only images with 2 spatial dimensions are supported. If using with color/multichannel images, specify `multichannel=True`.
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/02/13 07:19
2019/02/13 07:23
2019/02/13 07:48
2019/02/13 07:54
2019/02/13 08:00 編集
2019/02/13 08:24
2019/02/13 08:27
2019/02/13 10:33