Computer Vision News - February 2017

The code below loads the set of images based on the subdirectory structure, and automatically gives each set of images a name, based on its subdirectory: The imds variable holds the images and the category labels associated with each image. Labels are assigned from the name of the folder the image files resided in. Since the ImageDatastore operates on image file locations, images are not loaded into memory until read, thus reducing memory requirements. To "test" what we have read, the countEachLabel command can be used to count the number of images per category. In our case, the countEachLabel generates the following output: Now, this Datastore can be used to create a bag of visual words for classification purposes -- Bag of words constructs a "vocabulary" of features representative of each image category. Since this is not the focus of our review, we won't enter into the details of the classification functions; we will only mention that this technique was adapted to computer vision from the world of natural language, processing the classification code for the sake of completeness. To learn more about it, read here and here . The code for creating the bag of visual words and classifying the images is: 18 Computer Vision News Tool Tool [trainingSet,testSet] = splitEachLabel(imds,0.3,'randomize'); bag = bagOfFeatures(trainingSet);categoryClassifier = trainImageCategoryClassifier(trainingSet,bag);confMatrix = evaluate(categoryClassifier,testSet);

RkJQdWJsaXNoZXIy NTc3NzU=