Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 236
Gunjan naik Avatar asked Jan 06 '15 06:01

Gunjan naik


1 Answers

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:

  1. Use one of the standard kernels (obviously)

  2. Implement your kernel as standard and optionally contribute it to the mainline

  3. Set kernel to standard before saving to file and back to custom after loading from file (workaround)

  4. Implement mechanism for saving/loading custom kernels with parameters (can be hard)

like image 72
Failed Scientist Avatar answered Oct 04 '22 22:10

Failed Scientist