first working version for capture, training, detection