2016-01-15 32 views
1

我試圖做邊緣檢測在下面的代碼邊緣檢測:應用圖像陣列

lfw_people = fetch_lfw_people(min_faces_per_person=70, resize=0.4) 

# introspect the images arrays to find the shapes (for plotting) 
n_samples, h, w = lfw_people.images.shape 

# for machine learning we use the 2 data directly (as relative pixel 
# positions info is ignored by this model) 
X = lfw_people.data 
n_features = X.shape[1] 

# the label to predict is the id of the person 
y = lfw_people.target 
target_names = lfw_people.target_names 
n_classes = target_names.shape[0] 

print("Total dataset size:") 
print("n_samples: %d" % n_samples) 
print("n_features: %d" % n_features) 
print("n_classes: %d" % n_classes) 



############################################################################### 
# Split into a training set and a test set using a stratified k fold 

# split into a training and testing set 
X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.25) 

我想使用的邊緣檢測索貝爾,但按我的知識索貝爾在1個圖像中。我如何將它應用於多個圖像或圖像陣列?

回答

0

我相信問http://dsp.stackexchange.com或者http://datascience.stackexchange.com(對我來說,聽起來你對提取的功能相當不清楚)對於這個問題是更好的選擇。

+0

如何使用sobel邊緣檢測預處理圖像陣列。在上面的代碼中:'X'我們存儲所有圖像,我如何在X上應用sobel,因爲它包含多個圖像。 – gautam