Skip to content
Snippets Groups Projects
Commit e47e7269 authored by Noah Eigenfeld's avatar Noah Eigenfeld
Browse files

Reading files correctly - still not predicting the correct subject

parent b90d3667
No related branches found
No related tags found
1 merge request!5Face detection
...@@ -73,7 +73,7 @@ int main() { ...@@ -73,7 +73,7 @@ int main() {
int i = 0; int i = 0;
while (true) { while (true) {
filename = to_string(i); filename = to_string(i);
string path = directory + subdirectory + filename + ".pgm"; string path = directory + subdirectory + filename + ".png";
cout << "path: " << path << endl; cout << "path: " << path << endl;
load_image = imread(path, 1); load_image = imread(path, 1);
...@@ -97,6 +97,18 @@ int main() { ...@@ -97,6 +97,18 @@ int main() {
} }
} }
//Check that images were read correctly
cout << "Images read: " << images.size() << endl;
int counter = 0;
for (Mat test_image : images) {
string window_name = format("test_image_%d", counter);
namedWindow(window_name, CV_WINDOW_AUTOSIZE);
imshow(window_name, test_image);
cout << "showing image " << counter << endl;
counter++;
}
//Convert to grayscale //Convert to grayscale
picture_grayscale = picture.clone(); picture_grayscale = picture.clone();
cvtColor(picture, picture_grayscale, CV_BGR2GRAY); cvtColor(picture, picture_grayscale, CV_BGR2GRAY);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment