用来对指定文件夹中的图片按断点进行分割存储。
#include "opencv2\highgui.hpp"
#include "opencv2\opencv.hpp"
#include <iostream>
#include <string>
#include <afx.h>
#include <sstream>
#include <io.h>
#include <vector>
#include "shlwapi.h"
#pragma comment(lib,"shlwapi.lib")
using namespace std;
using namespace cv;
int main()
{
int fileNum, cnt;
cout << "The number of file is : " << endl;
cin >> fileNum;
cout << "The breakpoint of picture is : " << endl;
cin >> cnt;
cout << "The coordinate of breakpoint is : " << endl;
vector <int> array(cnt+2, 0);
for (int i = 1; i <= cnt; i++)
cin >> array[i];
_finddata_t c_file;
string File_Directory = "chinese\\" + format("%d", fileNum);
string buffer = File_Directory + "\\*" + ".jpg";
intptr_t hFile;
hFile = _findfirst(buffer.c_str(), &c_file);
if (hFile == -1L)
printf("No .jpg files in current directory!\n");