I'm using template matching to detect brown color image and set a threshold of 0.7 to accept right match. I created a few templates for brown color image but every time I inspect a new brown image with template I'm getting low scores 0.4 even if there is a very little difference in image may be some spot or lighting. I tried a lot but not able to detect. Due to different scores every time I need to add a lot of templates to achieve the same.
I'm converting the image to gray scale and doing some pre-processing
Image<Gray, byte> grayFrameimgModelROIvariable = ((Image<Bgr, byte>)imgModelROIPic.Image).Convert<Gray, byte>();
Image<Gray, byte> grayFrameimgInspTemplateVariable = ((Image<Bgr, byte>)imgInspectedROIPic.Image).Convert<Gray, byte>();
grayFrameimgModelROIvariable.PyrDown();
grayFrameimgModelROIvariable.PyrUp();
grayFrameimgInspTemplateVariable.PyrDown();
grayFrameimgInspTemplateVariable.PyrUp();
grayFrameimgModelROIvariable._SmoothGaussian(3);
grayFrameimgInspTemplateVariable._SmoothGaussian(3);
Please help