How to load multiple iplimages and save with extra words to original words? [closed]

asked 2019-05-09 22:32:57 -0600

libra90 gravatar image

updated 2019-05-10 03:08:52 -0600

berak gravatar image

Hi. I am beginner of OpenCV.
And I am using OpenCV 2.
BUT I found the way to load multiple images with cv::glob. However, i found that counting the images but cannot show my several images with iplimages and crushed with the path string after cv::glob .

SO HERE IS MY QUESTION :
1. I want to know show to use the cv:glob for handling load and save with it.
image description

std::vector<cv::String> fn;
cv::glob(".\\result\\*.png", fn);
std::vector<cv::Mat> inputs;
for (auto i = 0; i < fn.size(); i++) {
     inputs.push_back(cv::imread(fn[i]));
     printf("%d = %s\n",i, fn[i]);
}
  1. How can i save with extra words to original vocabulary when i am using the cvSaveImage()!
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by libra90
close date 2019-05-21 06:46:42.264712

Comments

opencv does no more use iplimages since 2010

berak gravatar imageberak ( 2019-05-10 01:15:41 -0600 )edit
1

@berak Oh, really? then I have to use the cv::Mat.
By the way, do you know why the directory path show unclear words after using cv::glob function?
I was using this :
std::vector<cv::string> fn;
cv::glob(".\result\*.png", fn);
std::vector<cv::mat> inputs;
for (auto i = 0; i < fn.size(); i++) {
      inputs.push_back(cv::imread(fn[i]));
      printf("%d = %s\n",i, fn[i]);
}

libra90 gravatar imagelibra90 ( 2019-05-10 02:47:26 -0600 )edit

Oh, I found the solution when i changed from 'printf("%d = %s\n",i, fn[i]);' into 'std::cout<<i&lt;&lt;" "&lt;&lt;="" fn[i]&lt;<std::endl'.<="" p="">

libra90 gravatar imagelibra90 ( 2019-05-21 06:46:03 -0600 )edit