直方图是否足以使用神经网络进行图像分类?

时间:2017-03-05 19:57:27

标签: java opencv image-processing neural-network

我正在尝试制作一个简单的应用程序,以便使用自组织地图对图像进行分类。我使用的是Java 8和OpenCV 320.我使用了20张带花的图像和20张带有狗的图像。所以我想要的结果是2个簇:一个包含鲜花,另一个包含狗。

我做了什么:

1) I resized the images to 500 x 500.
2) I converted the RGB images to Grayscale
3) I applied Imgproc.equalizeHist(grayscaleImage, histogram) for each image;
4) I applied Imgproc.calcHist(image,new MatOfInt(0),new Mat(),histogram,new MatOfInt(256),ranges) for each image (ranges = new MatOfFloat(0f, 256f); )
5) I applied Core.normalize(histogram, histogram, 0, histogram.rows(), Core.NORM_MINMAX);
6) I also wanted to reduce the histogram by applying PCACompute with max of 125 components but I received a 1 x 1 eigenvectors when I was expecting 125 x 1. I don't know why this happened but I got rid of this. Maybe someone can explain it to me.
7) I fed the numbers obtained from the histogram to the SOM.

我遇到的问题是我的SOM没有正确地对花和狗进行分类。就像每个图像都在它自己的集群中一样。直方图数据是否不足以进行此类分类,或者我做错了什么?谢谢大家。

0 个答案:

没有答案