Skip to content

Commit

Permalink
Merge pull request opencv#21528 from sturkmen72:patch-5
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Jan 28, 2022
2 parents 9cab808 + 439ef64 commit 1f6444f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions modules/highgui/src/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,8 @@ void cv::imshow( const String& winname, InputArray _img )
{
CV_TRACE_FUNCTION();

const Size size = _img.size();
CV_Assert(size.width>0 && size.height>0);
{
cv::AutoLock lock(cv::getWindowMutex());
cleanupClosedWindows_();
Expand Down Expand Up @@ -995,17 +997,14 @@ void cv::imshow( const String& winname, InputArray _img )
}
}

const Size size = _img.size();
#ifndef HAVE_OPENGL
CV_Assert(size.width>0 && size.height>0);
{
Mat img = _img.getMat();
CvMat c_img = cvMat(img);
cvShowImage(winname.c_str(), &c_img);
}
#else
const double useGl = getWindowProperty(winname, WND_PROP_OPENGL);
CV_Assert(size.width>0 && size.height>0);

if (useGl <= 0)
{
Expand Down

0 comments on commit 1f6444f

Please sign in to comment.