Skip to content

Commit ac1448e

Browse files
author
Moskalenko
committed
Add_Save
1 parent 6e0d128 commit ac1448e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sample_template/application.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#include "application.hpp"
22
#include "processing.hpp"
33
#include "time.h"
4+
#include "stdlib.h"
5+
#include <sstream>
46

57
#include <opencv2/highgui/highgui.hpp>
68

9+
using namespace std;
710
using namespace cv;
811

912
bool testfunction() { return true; }
@@ -101,8 +104,9 @@ int Application::showFrame(const std::string &caption,
101104
// ñ ìåòêîé òåêóùåãî âðåìåíè
102105
// âûçâàòü ôóíêöèþ ñîõðàíåíèÿ imwrite(<image_name>, display)
103106
// ñáðîñèòü çíà÷åíèå guiState.saveState â false
104-
String imgString = "image" + std::to_string(time(0));
105-
imwrite(imgString+".jpg",display);
107+
std::stringstream ss;
108+
ss << "image" << to_string(time(0)) << ".jpg";
109+
imwrite(ss.str(),display);
106110
guiState.saveState = false;
107111
}
108112

0 commit comments

Comments
 (0)