Commit 1b47efb3 authored by yangql's avatar yangql
Browse files

Update Src/main.cpp

parent f1f70dc9
...@@ -69,8 +69,18 @@ int main() ...@@ -69,8 +69,18 @@ int main()
while (currentLine < maxLabel+1 && std::getline(file, line)) { while (currentLine < maxLabel+1 && std::getline(file, line)) {
currentLine++; currentLine++;
} }
LOG_INFO(stdout, "class=%s probability=%f\n", line.c_str(), maxConfidence); LOG_INFO(stdout, "class=%s ; probability=%f\n", line.c_str(), maxConfidence);
//保存图像
std::string text = std::string("class=") + line.c_str();
cv::Point text_position(5,20);
int font_face = cv::FONT_HERSHEY_SIMPLEX;
double font_scale = 0.5; // 调整字体大小
cv::Scalar font_color(0, 0, 255); // 白色
int font_thickness = 1;
cv::putText(srcImage, text, text_position, font_face, font_scale, font_color, font_thickness);
cv::imwrite("./output_image.jpg", srcImage);
} }
file.close(); file.close();
return 0; return 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment