adjusted window and capture size in all samples

pull/3471/head
kallaballa 2 years ago
parent bcc774fad4
commit b2372c3be8
  1. 2
      modules/v4d/samples/beauty-demo.cpp
  2. 2
      modules/v4d/samples/cube-demo.cpp
  3. 2
      modules/v4d/samples/custom_source_and_sink.cpp
  4. 2
      modules/v4d/samples/display_image.cpp
  5. 2
      modules/v4d/samples/display_image_fb.cpp
  6. 4
      modules/v4d/samples/font-demo.cpp
  7. 2
      modules/v4d/samples/font_rendering.cpp
  8. 2
      modules/v4d/samples/font_with_gui.cpp
  9. 4
      modules/v4d/samples/nanovg-demo.cpp
  10. 20
      modules/v4d/samples/optflow-demo.cpp
  11. 2
      modules/v4d/samples/pedestrian-demo.cpp
  12. 2
      modules/v4d/samples/render_opengl.cpp
  13. 2
      modules/v4d/samples/shader-demo.cpp
  14. 2
      modules/v4d/samples/vector_graphics.cpp
  15. 2
      modules/v4d/samples/vector_graphics_and_fb.cpp
  16. 4
      modules/v4d/samples/video-demo.cpp
  17. 4
      modules/v4d/samples/video_editing.cpp

@ -23,7 +23,7 @@ constexpr long unsigned int WIDTH = 1280;
constexpr long unsigned int HEIGHT = 720;
#else
constexpr long unsigned int WIDTH = 960;
constexpr long unsigned int HEIGHT = 540;
constexpr long unsigned int HEIGHT = 960;
#endif
constexpr unsigned int DOWNSIZE_WIDTH = 960;
constexpr unsigned int DOWNSIZE_HEIGHT = 540;

@ -12,7 +12,7 @@ constexpr long unsigned int WIDTH = 1280;
constexpr long unsigned int HEIGHT = 720;
#else
constexpr long unsigned int WIDTH = 960;
constexpr long unsigned int HEIGHT = 540;
constexpr long unsigned int HEIGHT = 960;
#endif
constexpr bool OFFSCREEN = false;
#ifndef __EMSCRIPTEN__

@ -7,7 +7,7 @@ using namespace cv;
using namespace cv::v4d;
int main() {
Ptr<V4D> window = V4D::make(Size(960, 540), cv::Size(), "Custom Source/Sink");
Ptr<V4D> window = V4D::make(Size(960, 960), cv::Size(), "Custom Source/Sink");
string hr = "Hello Rainbow!";
//Make a source that generates rainbow frames.

@ -8,7 +8,7 @@ int main() {
//Creates a V4D window for on screen rendering with a window size of 720p and a framebuffer of the same size.
//Please note that while the window size may change the framebuffer size may not. If you need multiple framebuffer
//sizes you need multiple V4D objects
Ptr<V4D> window = V4D::make(Size(960, 540), cv::Size(), "Display image");
Ptr<V4D> window = V4D::make(Size(960, 960), cv::Size(), "Display image");
//Loads an image as a UMat (just in case we have hardware acceleration available)
#ifdef __EMSCRIPTEN__

@ -6,7 +6,7 @@ using namespace cv::v4d;
int main() {
//Creates a V4D object
Ptr<V4D> window = V4D::make(Size(960, 540), cv::Size(), "Display image and FB");
Ptr<V4D> window = V4D::make(Size(960, 960), cv::Size(), "Display image and FB");
//Loads an image as a UMat (just in case we have hardware acceleration available)
#ifdef __EMSCRIPTEN__

@ -21,7 +21,7 @@ constexpr long unsigned int WIDTH = 1280;
constexpr long unsigned int HEIGHT = 720;
#else
constexpr long unsigned int WIDTH = 960;
constexpr long unsigned int HEIGHT = 540;
constexpr long unsigned int HEIGHT = 960;
#endif
constexpr bool OFFSCREEN = false;
#ifndef __EMSCRIPTEN__
@ -204,7 +204,7 @@ static bool iteration(cv::Ptr<V4D> window) {
int main() {
try {
cv::Ptr<V4D> window = V4D::make(cv::Size(WIDTH, HEIGHT), cv::Size(), "Font Demo", OFFSCREEN, true);
cv::Ptr<V4D> window = V4D::make(cv::Size(WIDTH, HEIGHT), cv::Size(), "Font Demo", OFFSCREEN);
if(!OFFSCREEN) {
setup_gui(window);
}

@ -4,7 +4,7 @@ using namespace cv;
using namespace cv::v4d;
int main() {
Ptr<V4D> window = V4D::make(Size(960, 540), cv::Size(), "Font Rendering");
Ptr<V4D> window = V4D::make(Size(960, 960), cv::Size(), "Font Rendering");
//The text to render
string hw = "Hello World";

@ -4,7 +4,7 @@ using namespace cv;
using namespace cv::v4d;
int main() {
Ptr<V4D> window = V4D::make(Size(960, 540), cv::Size(), "Font Rendering with GUI");
Ptr<V4D> window = V4D::make(Size(960, 960), cv::Size(), "Font Rendering with GUI");
//The text color. NanoGUI uses rgba with floating point
nanogui::Color textColor = {0.0f, 0.0f, 1.0f, 1.0f};

@ -14,7 +14,7 @@ constexpr long unsigned int WIDTH = 1280;
constexpr long unsigned int HEIGHT = 720;
#else
constexpr long unsigned int WIDTH = 960;
constexpr long unsigned int HEIGHT = 540;
constexpr long unsigned int HEIGHT = 960;
#endif
constexpr bool OFFSCREEN = false;
#ifndef __EMSCRIPTEN__
@ -160,7 +160,7 @@ static bool iteration(cv::Ptr<V4D> window) {
//Acquire the framebuffer and convert the rgb into it
window->fb([&](cv::UMat &framebuffer) {
cv::cvtColor(rgb, framebuffer, cv::COLOR_RGB2BGRA);
cv::cvtColor(rgb, framebuffer, cv::COLOR_BGR2BGRA);
});
//Render using nanovg

@ -26,12 +26,13 @@ using namespace std::literals::chrono_literals;
/* Demo parameters */
#ifndef __EMSCRIPTEN__
constexpr long unsigned int WIDTH = 1280;
constexpr long unsigned int HEIGHT = 720;
#else
constexpr long unsigned int WIDTH = 960;
constexpr long unsigned int HEIGHT = 540;
constexpr long unsigned int HEIGHT = 960;
#endif
const unsigned long DIAG = hypot(double(WIDTH), double(HEIGHT));
#ifndef __EMSCRIPTEN__
@ -342,8 +343,8 @@ static void composite_layers(cv::UMat& background, const cv::UMat& foreground, c
using namespace cv::v4d;
//Build the GUI
static void setup_gui(cv::Ptr<V4D> window, cv::Ptr<V4D> dialog) {
window->nanogui([&](cv::v4d::FormHelper& form){
static void setup_gui(cv::Ptr<V4D> main, cv::Ptr<V4D> menu) {
main->nanogui([&](cv::v4d::FormHelper& form){
form.makeDialog(5, 30, "Effects");
form.makeGroup("Foreground");
@ -414,22 +415,22 @@ static void setup_gui(cv::Ptr<V4D> window, cv::Ptr<V4D> dialog) {
form.makeFormVariable("Threshold Diff", scene_change_thresh_diff, 0.1f, 1.0f, true, "", "Difference of peak thresholds. Lowering it makes detection more sensitive");
});
dialog->nanogui([&](cv::v4d::FormHelper& form){
menu->nanogui([&](cv::v4d::FormHelper& form){
form.makeDialog(8, 16, "Display");
form.makeGroup("Display");
form.makeFormVariable("Show FPS", show_fps, "Enable or disable the On-screen FPS display");
form.makeFormVariable("Scale", scale, "Scale the frame buffer to the window size")->set_callback([=](const bool &s) {
window->setScaling(s);
main->setScaling(s);
});
#ifndef __EMSCRIPTEN__
form.makeButton("Fullscreen", [=]() {
window->setFullscreen(!window->isFullscreen());
main->setFullscreen(!main->isFullscreen());
});
form.makeButton("Offscreen", [=]() {
window->setVisible(!window->isVisible());
main->setVisible(!main->isVisible());
});
#endif
});
@ -485,8 +486,8 @@ static bool iteration(cv::Ptr<V4D> window) {
#ifndef __EMSCRIPTEN__
window->write();
menuWindow->feed(menuFrame);
//FIXME
// menuWindow->feed(menuFrame);
if(!menuWindow->display())
return false;
@ -505,6 +506,7 @@ int main(int argc, char **argv) {
int main() {
#endif
try {
using namespace cv::v4d;
cv::Ptr<V4D> window = V4D::make(cv::Size(WIDTH, HEIGHT), cv::Size(), "Sparse Optical Flow Demo", OFFSCREEN);
#ifndef __EMSCRIPTEN__
menuWindow = V4D::make(cv::Size(240, 360), cv::Size(), "Display Settings", OFFSCREEN);

@ -20,7 +20,7 @@ constexpr long unsigned int WIDTH = 1280;
constexpr long unsigned int HEIGHT = 720;
#else
constexpr long unsigned int WIDTH = 960;
constexpr long unsigned int HEIGHT = 540;
constexpr long unsigned int HEIGHT = 960;
#endif
const unsigned long DIAG = hypot(double(WIDTH), double(HEIGHT));
constexpr unsigned int DOWNSIZE_WIDTH = 640;

@ -4,7 +4,7 @@ using namespace cv;
using namespace cv::v4d;
int main() {
Ptr<V4D> window = V4D::make(Size(960, 540), cv::Size(), "GL Blue Screen");
Ptr<V4D> window = V4D::make(Size(960, 960), cv::Size(), "GL Blue Screen");
window->gl([](){
//Sets the clear color to blue

@ -14,7 +14,7 @@ constexpr long unsigned int WIDTH = 1280;
constexpr long unsigned int HEIGHT = 720;
#else
constexpr long unsigned int WIDTH = 960;
constexpr long unsigned int HEIGHT = 540;
constexpr long unsigned int HEIGHT = 960;
#endif
constexpr bool OFFSCREEN = false;
const unsigned long DIAG = hypot(double(WIDTH), double(HEIGHT));

@ -4,7 +4,7 @@ using namespace cv;
using namespace cv::v4d;
int main() {
Ptr<V4D> window = V4D::make(Size(960, 540), cv::Size(), "Vector Graphics");
Ptr<V4D> window = V4D::make(Size(960, 960), cv::Size(), "Vector Graphics");
window->run([=](Ptr<V4D> window) {
//Creates a NanoVG context and draws googly eyes that occasionally blink.

@ -5,7 +5,7 @@ using namespace cv;
using namespace cv::v4d;
int main() {
Ptr<V4D> window = V4D::make(Size(960, 540), cv::Size(), "Vector Graphics and Framebuffer");
Ptr<V4D> window = V4D::make(Size(960, 960), cv::Size(), "Vector Graphics and Framebuffer");
window->run([=](Ptr<V4D> window) {
//Again creates a NanoVG context and draws googly eyes

@ -20,7 +20,7 @@ constexpr long unsigned int WIDTH = 1280;
constexpr long unsigned int HEIGHT = 720;
#else
constexpr long unsigned int WIDTH = 960;
constexpr long unsigned int HEIGHT = 540;
constexpr long unsigned int HEIGHT = 960;
#endif
constexpr bool OFFSCREEN = false;
const unsigned long DIAG = hypot(double(WIDTH), double(HEIGHT));
@ -218,7 +218,7 @@ int main(int argc, char** argv) {
int main() {
#endif
using namespace cv::v4d;
cv::Ptr<V4D> window = V4D::make(cv::Size(WIDTH, HEIGHT), cv::Size(), "Video Demo", OFFSCREEN);
cv::Ptr<V4D> window = V4D::make(cv::Size(WIDTH, HEIGHT), cv::Size(), "Video Demo", OFFSCREEN, false);
window->printSystemInfo();
#ifndef __EMSCRIPTEN__

@ -4,7 +4,7 @@ using namespace cv;
using namespace cv::v4d;
int main(int argc, char** argv) {
Ptr<V4D> window = V4D::make(cv::Size(960, 540), cv::Size(), "Video Editing");
Ptr<V4D> window = V4D::make(cv::Size(960, 960), cv::Size(), "Video Editing");
//In case of WebAssembly
CV_UNUSED(argc);
@ -24,7 +24,7 @@ int main(int argc, char** argv) {
window->setSink(sink);
#else
//Make a webcam Source
Source src = makeCaptureSource(1280, 720, window);
Source src = makeCaptureSource(960, 960, window);
//Attach webcam source
window->setSource(src);
#endif

Loading…
Cancel
Save