|
| 1 | +package featureextraction; |
| 2 | + |
| 3 | +import image.ImageProcessing; |
| 4 | + |
| 5 | +import java.awt.image.BufferedImage; |
| 6 | +import java.io.IOException; |
| 7 | + |
| 8 | +/** |
| 9 | + * Created by bsse0 on 10/3/2016. |
| 10 | + */ |
| 11 | +public class FeatureExtraction { |
| 12 | + ImageProcessing imageProcessing = new ImageProcessing(); |
| 13 | + |
| 14 | + public void callExtractFeature() throws IOException { |
| 15 | + String basePath = "G:\\Semester 8\\Image Prcessing\\Workspace\\Image-Processing\\src\\feature\\resources\\"; |
| 16 | + String outputFile = "G:\\Semester 8\\Image Prcessing\\Workspace\\Image-Processing\\src\\feature\\resources\\adaboostData.txt"; |
| 17 | + |
| 18 | + extractFeature(basePath+"fold1\\Male2\\", 2051, outputFile); |
| 19 | +// extractFeature(basePath+"fold1\\Female2\\", 595, outputFile); |
| 20 | +// extractFeature(basePath+"fold2\\Male2\\", 2051, outputFile); |
| 21 | +// extractFeature(basePath+"fold2\\Female2\\", 595, outputFile); |
| 22 | +// extractFeature(basePath+"fold3\\Male2\\", 2051, outputFile); |
| 23 | +// extractFeature(basePath+"fold3\\Female2\\", 595, outputFile); |
| 24 | +// extractFeature(basePath+"fold4\\Male2\\", 2051, outputFile); |
| 25 | +// extractFeature(basePath+"fold4\\Female2\\", 595, outputFile); |
| 26 | + } |
| 27 | + |
| 28 | + public void extractFeature(String path, int n, String outputFile) throws IOException { |
| 29 | + String fileName = ""; |
| 30 | + |
| 31 | + for (int i = 1; i <= n; i++) { |
| 32 | + fileName = i + ".png"; |
| 33 | + BufferedImage bufferedImage = imageProcessing.readImage(path + fileName); |
| 34 | + int[][] grayImage = imageProcessing.getGray(bufferedImage); |
| 35 | +// int[][] sobelX = sobel.getX(grayImage); |
| 36 | + } |
| 37 | + } |
| 38 | +} |
0 commit comments