Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Saving 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 have a bit knowledge of its use in C interface , which i tried in it , but due to mixing of interface's its showing error , 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);
              //my_img_3.convertTo( training_mat_eva.row(count_3), CV_32FC1 );
              float response = svm.predict(my_img_3);
              if (response==1)
              {
                 count_4++;
                 //sprintf(buffer,"D:/image%u.jpg",c);
                 //cvSaveImage(buffer,pre_img);

                 cv::imwrite("images.jpg", pre_img);

              }
         }
       }

This code is not saving my images

Saving 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 have a bit knowledge of its use in C interface , which i tried in it , but due to mixing of interface's its showing error , 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);
              //my_img_3.convertTo( training_mat_eva.row(count_3), CV_32FC1 );
              float response = svm.predict(my_img_3);
              if (response==1)
              {
                 count_4++;
                 //sprintf(buffer,"D:/image%u.jpg",c);
                 //cvSaveImage(buffer,pre_img);

                 cv::imwrite("images.jpg", pre_img);

              }
         }
       }

This code is not saving my images

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 have a bit knowledge of its use in C interface , which i tried in it , but due to mixing of interface's its showing error , 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);
              //my_img_3.convertTo( training_mat_eva.row(count_3), CV_32FC1 );
               float response = svm.predict(my_img_3);
              if (response==1)
              {
                 count_4++;
                 //sprintf(buffer,"D:/image%u.jpg",c);
                 //cvSaveImage(buffer,pre_img);

                 cv::imwrite("images.jpg", pre_img);

              }
         }
       }

This code is not saving my images

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 frames from my video file , it may be more than 100 frames , i have a bit knowledge of its use in C interface , which i tried in it , but due to mixing of interface's its showing error , 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++;
                 //sprintf(buffer,"D:/image%u.jpg",c);
                 //cvSaveImage(buffer,pre_img);

                 cv::imwrite("images.jpg", pre_img);

              }
         }
       }

This code is not saving my imagesall the images , i want to save it in a specific directory like D:\images\