|
|
|
@ -184,10 +184,9 @@ void composite_layers(const cv::UMat background, const cv::UMat foreground, cons |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void setup_gui(cv::Ptr<kb::Window> window) { |
|
|
|
|
window->makeWindow(6, 45, "Settings"); |
|
|
|
|
|
|
|
|
|
auto useOpenCL = window->makeFormVariable("Use OpenCL", use_opencl, "Enable or disable OpenCL acceleration"); |
|
|
|
|
window->makeWindow(5, 45, "Settings"); |
|
|
|
|
|
|
|
|
|
window->makeFormVariable("Use OpenCL", use_opencl, "Enable or disable OpenCL acceleration"); |
|
|
|
|
window->makeGroup("Foreground"); |
|
|
|
|
window->makeFormVariable("Scale", fg_scale, 0.1f, 4.0f, true, "", "Generate the foreground at this scale"); |
|
|
|
|
window->makeFormVariable("Loss", fg_loss, 0.1f, 99.9f, true, "%", "On every frame the foreground loses on brightness"); |
|
|
|
@ -233,9 +232,8 @@ int main(int argc, char **argv) { |
|
|
|
|
exit(1); |
|
|
|
|
} |
|
|
|
|
cv::Ptr<kb::Window> window = new kb::Window(cv::Size(WIDTH, HEIGHT), OFFSCREEN, "Sparse Optical Flow Demo"); |
|
|
|
|
|
|
|
|
|
std::thread worker([&]() { |
|
|
|
|
window->initialize(); |
|
|
|
|
|
|
|
|
|
kb::print_system_info(); |
|
|
|
|
setup_gui(window); |
|
|
|
|
|
|
|
|
@ -302,15 +300,6 @@ int main(int argc, char **argv) { |
|
|
|
|
if(!window->display()) |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
window->close(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
while(!window->isClosed()) { |
|
|
|
|
window->pollEvents(); |
|
|
|
|
std::this_thread::sleep_for(10ms); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
worker.join(); |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|