Q:

How to define our own kernel for Pattern recognition in OPENCV?

I wanted to write my own kernel for Image classification on OpenCV.
But for SVM (Built in function for Opencv) the kernel is already defined.
My question is, is there anything in OpenCV that would allow me to define my kernel?
Actually,I wanted to implement multiple kernel learning for Image classification.

A:

I have looked around an answer and one of the workaround (mentioned in linked question as well) is to use altenative SVM libraries like LibSVM, etc. (and LibSVM is really good one).
Though, if you want to stay in OpenCV only (and thats what appears by your question), then there is a similar question posted on OpenCV forums and somehow workaround is (copying verbatim):

This message means that SVM with custom kernel does not support loading from file. You can try following things:

Use one of the standard kernels (obviously)
Implement your kernel as standard and optionally contribute it to the mainline
Set kernel to standard before saving to file and back to custom after loading from file (workaround)
Implement mechanism for saving/loading custom kernels with parameters (can be hard)

