How to Save frames to directory
I am trying to save the frames which have entropy >0.78
, i want to save that specific frames
from my video file , it may be more than 100 frames , i tried it , Below is my code
if (entropy>0.78)
{
detector.detect(pre_img, keypoint2);
if (keypoint2.size() >= 20)
{
RetainBestKeypoints(keypoint2, 20);
dextract.compute( pre_img, keypoint2, descriptors_2);
Mat my_img_3 = descriptors_2.reshape(1,1);
float response = svm.predict(my_img_3);
if (response==1)
{
count_4++;
cv::imwrite("images.jpg", pre_img);
}
}
}
This code is not saving all the images , i want to save it in a specific directory like D:\images\