white border while displaying a full image with python2.7 and opencv (Bug #3188)


Added by Stefano Spirolazzi almost 4 years ago. Updated almost 2 years ago.


Status:Open Start date:2013-08-02
Priority:Normal Due date:
Assignee:Alexander Smorkalov % Done:

0%

Category:highgui-images
Target version:Next Hackathon
Affected version:branch '2.4' Operating System:Any
Difficulty: HW Platform:x86
Pull request:

Description

Hi!

I want to display a black image in a full screen mode. It looks a really sample task to do, but when i run the code below i get a little white strip on top and on the left. It doesn't matter if i change the size of the numpy array, i always get it.
If you run this code, do you get a fully black screen??
I have tried with different laptop and different version of opencv
thanks

img = np.zeros((800, 1280)) #my resolution is 800, 1280
cv2.namedWindow("test", cv2.WND_PROP_FULLSCREEN)
cv2.setWindowProperty("test", cv2.WND_PROP_FULLSCREEN, cv2.cv.CV_WINDOW_FULLSCREEN)
cv2.imshow("test",img)
cv2.waitKey(0)


History

Updated by Victor Kocheganov almost 4 years ago

Hello Stefano,

thank you for submitting this ticket!
Could you please duplicate this question to http://answers.opencv.org/questions/, likely somebody's already faced with similar issue and could help. And it would be highly appreciated if you'll have time to investigate this issue and propose your own fix (if this is indeed a bug). Please see also http://www.code.opencv.org/projects/opencv/wiki/How_to_contribute for details.

Thank you in advance,
Victor Kocheganov

  • Category set to highgui-images
  • Status changed from New to Open
  • Target version set to 2.4.7
  • Assignee set to Vadim Pisarevsky

Updated by Victor Kocheganov almost 4 years ago

  • Assignee changed from Vadim Pisarevsky to Alexander Smorkalov

Updated by Alexander Smorkalov almost 4 years ago

Hello Stefano!

I tried to reproduce your issue on my Linux desktop. Your code works perfect for me. I use Ubuntu and GTK back-end for OpenCV. Please select proper platform in ticket properties if you use something other. I will try the same on Windows and close the issue if everything is ok.
My python and c++ code:

import numpy as np
import cv2

img = np.zeros((1080, 1920)) #my resolution is 800, 1280
cv2.namedWindow("test", cv2.WND_PROP_FULLSCREEN)
cv2.setWindowProperty("test", cv2.WND_PROP_FULLSCREEN, cv2.cv.CV_WINDOW_FULLSCREEN)
cv2.imshow("test",img)
cv2.waitKey(0)
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>

int main(int, char**)
{
    cv::Mat frame = cv::Mat::zeros(1080, 1920, CV_8UC3);
    cv::namedWindow("test", cv::WND_PROP_FULLSCREEN);
    cv::setWindowProperty("test", cv::WND_PROP_FULLSCREEN, CV_WINDOW_FULLSCREEN);
    cv::imshow("test", frame);
    cv::waitKey(0);
    return 0;
}

Updated by Alexander Smorkalov almost 4 years ago

I reproduce the issue on Windows 8 with WIN32UI back-end.

Updated by Alexander Smorkalov almost 4 years ago

  • Target version changed from 2.4.7 to Next Hackathon

Updated by Maksim Shabunin almost 2 years ago

Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4605

Also available in: Atom PDF