A look at OpenCV's licensing

browse Topics tagged legal tag for some idea of the situation

there is the “nonfree” cmake flag.