You can't do this! :)

This is a sample for MOG2, and if you want to make possible to use KNN, you should add command-line options, so user could choose between implementations.