MCPcopy Create free account
hub / github.com/FeiYull/TensorRT-Alpha / setRenderWindow

Method setRenderWindow

utils/utils.cpp:103–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103void utils::setRenderWindow(InitParameter& param)
104{
105 if (!param.is_show)
106 return;
107 int max_w = 960;
108 int max_h = 540;
109 float scale_h = (float)param.src_h / max_h;
110 float scale_w = (float)param.src_w / max_w;
111 if (scale_h > 1.f && scale_w > 1.f)
112 {
113 float scale = scale_h < scale_w ? scale_h : scale_w;
114 cv::namedWindow(param.winname, cv::WINDOW_NORMAL | cv::WINDOW_KEEPRATIO); // for Linux
115 cv::resizeWindow(param.winname, int(param.src_w / scale), int(param.src_h / scale));
116 param.char_width = 16;
117 param.det_info_render_width = 18;
118 param.font_scale = 0.9;
119 }
120 else
121 {
122 cv::namedWindow(param.winname);
123 }
124}
125
126std::string utils::getTimeStamp()
127{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected