Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why both #106

Closed
coldstart01 opened this issue Mar 25, 2021 · 4 comments
Closed

why both #106

coldstart01 opened this issue Mar 25, 2021 · 4 comments
Labels

Comments

@coldstart01
Copy link

coldstart01 commented Mar 25, 2021

Hi, love cvui.

Why does it seems that I need both cvui image and imshow to display an image. I've tried them individually but then they don't show anything at all.

cvui::image(frame, 25, 25, im_with_keypoints);
...
cvui::imshow(WINDOW1_NAME, frame);

Thank you.

@WojOstr
Copy link

WojOstr commented Mar 29, 2021

Hi, im not the specialist out there, but as far as I know you can put multiple images on frame, but it won't show up until you call imshow(window, frame), because you have to pass the frame to window to show it

@Dovyski
Copy link
Owner

Dovyski commented Apr 5, 2021

The explanation provided by @WojOstr nailed it. For further understanding, @coldstart01 , the function cvui::image() is one (of the many) drawing primitives cvui has. They all work putting pixels in a frame (a cv::Mat). When you are done drawing things (images, checkboxes, etc), you need to call OpenCV's function to show the frame in a window.

cv::imshow() is that function. Since cvui does a lot of heavy lifting under the hook, e.g. detect shortcut keys, it has its own version of imshow named cvui::imshow. In practice they do the same thing (show a frame in a window), but cvui's one some things extra.

Is it clear now?

@coldstart01
Copy link
Author

coldstart01 commented Apr 5, 2021 via email

@Dovyski
Copy link
Owner

Dovyski commented Apr 6, 2021

I am very glad to hear that, @coldstart01, thank you!

@Dovyski Dovyski closed this as completed Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants