Skip to content

highgui: Qt - restore convertscale semantics#13184

Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom
paroj:imshow_cvtscale
Nov 16, 2018
Merged

highgui: Qt - restore convertscale semantics#13184
opencv-pushbot merged 1 commit intoopencv:masterfrom
paroj:imshow_cvtscale

Conversation

@paroj
Copy link
Copy Markdown
Contributor

@paroj paroj commented Nov 16, 2018

broken in 11eafca

Copy link
Copy Markdown
Contributor

@mshabunin mshabunin left a comment

Choose a reason for hiding this comment

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

Probably we will need to make similar changes in other places (e.g. window_w32.cpp or window_cocoa.mm).
Can we extend highgui test to catch other similar issues?

@mshabunin mshabunin added this to the 4.0.0 milestone Nov 16, 2018
@opencv-pushbot opencv-pushbot merged commit f54b230 into opencv:master Nov 16, 2018
int src_depth = src.depth();
double scale = src_depth <= CV_8S ? 1 : src_depth <= CV_32S ? 1./256 : 255;
double shift = src_depth == CV_8S || src_depth == CV_16S ? 128 : 0;
cv::convertScaleAbs(src, tmp, scale, shift);
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.

Shouldn't this just be called when scaling/shifting/conversion actually needs to be done? AFAICT in such cases the function still processes the whole image, which seems wasteful when unnecessary.

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.

5 participants