I am doing a android project where i have to detect a logo(logo can be of different contrast,hue or saturation),for that i am using histogram comparison of OpenCV-2.3.1 for android.
The steps that i am following is as follows;
1)Calculate the hist value of stored image
private List<Integer> histSize;
private List<Float> ranges;
histSize.add(50);
histSize.add(60);
histSize.add(10);
ranges.add(0f);
ranges.add(256f);
ranges.add(0f);
ranges.add(180f);
ranges.add(0f);
ranges.add(256f);
channels.add(0);
channels.add(1);
channels.add(2);
hsv_base1=new Mat();
Imgproc.cvtColor(image1,hsv_base1, Imgproc.COLOR_BGR2HSV);
hsv_base.add(hsv_base1);
Imgproc.calcHist(hsv_base, channels,new Mat(), hist_base, histSize, ranges,false);
2) Then i am cropping the captured image every frame. The size of the cropped image is exactly same as of the stored image and calculating its histogram value using the same method as above.
3) Comparing the stored hist value of both the images
double base_test2 = Imgproc.compareHist(hist_base1,hist_baseCamera1,Imgproc.CV_COMP_CHISQR);
i get good value of comparehist. However problem is sometime it gives good values for some random captured images, i.e. unwanted.
So now am planning to use some other methods with histogram comparison. My logo consists of a circle .
My question is:: Is there any method so that i can find the captured image consists of circle exactly of same size as that of the circle of the stored logo.
Or any other method that i should use,or i can play with the stored value of channels ,ranges,histSize?
I had used template matching before ,its very slow and pretty difficult for the images of same size
I'd appreciate any light on this.