Skip to content

Restored function to rescale pixel values before imshow#13264

Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom
mshabunin:fix-windows
Nov 28, 2018
Merged

Restored function to rescale pixel values before imshow#13264
opencv-pushbot merged 1 commit intoopencv:masterfrom
mshabunin:fix-windows

Conversation

@mshabunin
Copy link
Copy Markdown
Contributor

@mshabunin mshabunin commented Nov 23, 2018

resolves #13216
related #13184

This pullrequest changes

  • adds a single function similar to removed one to rescale pixel values and swap B and R channels before showing image in the window
  • rewrote highgui test to cover different image types passed to imshow

cv::convertScaleAbs(src, tmp, 256.);
break;
}
cv::cvtColor(tmp, dst, cv::COLOR_BGR2RGB, dst.channels());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately, windows needs BGR pixel order

@mshabunin mshabunin force-pushed the fix-windows branch 2 times, most recently from a8283d6 to b4c7e4e Compare November 26, 2018 09:20
@mshabunin
Copy link
Copy Markdown
Contributor Author

I've added BGR image and verified all 4 backends (GTK and Qt on Linux, Mac, Win) visually. Separated trackbar test and disabled it on Mac: callback does not get called in the test while sample apps work fine.

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

highgui: imshow can only show CV_8U images

4 participants