Actually, Live Capture example is good for capturing images, so I am using it to capture images and save them in a folder.
#include <fstream>
#include <string>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc....