-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
Create multiscale_sharpen #17274
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
Create multiscale_sharpen #17274
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsxyhelu Thanks for the sample. Please format the code with OpenCV coding style: https://github.com/opencv/opencv/wiki/Coding_Style_Guide
samples/cpp/multiscale_sharpen
Outdated
@@ -0,0 +1,82 @@ | |||
#include "opencv2/core/utility.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add license header at the beginning of the file: https://github.com/opencv/opencv/wiki/Coding_Style_Guide#file-structure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asmorkalov Thank you , This pullrequest has benn changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually we don't using license headers in sample files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my mistake, this pullrequest has benn changed.
Adjust code format to conform to Coding_Style_Guide,also add license header ,and modifying unintuitive variable naming。
File must have .cpp extension. |
also remove license
@jsxyhelu Please take a look on CI bot status. It reports build warnings on most of platforms: https://pullrequest.opencv.org/buildbot/builders/precommit_linux64/builds/26054/steps/compile%20release/logs/warnings%20%284%29 |
Thank you! Have Modified the code ,It is "ALL GREEN" now ^v^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good enough for me in general, but I have not found any image in samples/data
suitable for the example. It does not bring visible improvement for images, including Lena.
Here I provide "multiScaleSharpen " image processing effects on "lena.jpg" and "building.jpg". As "building.jpg" is bigger, I chose radius 17 and 33 respectively. Overall, the algorithm can play a role in processing landscape pictures. However, I am not sure whether this algorithm is duplicated with the existing algorithm. If it is indeed the case, please help to point out, thank you very much! |
there is https://github.com/opencv/opencv/blob/master/samples/cpp/tutorial_code/core/mat_mask_operations/mat_mask_operations.cpp in the samples. is this code really better? |
function "Sharpen" is great! |
samples/cpp/multiscale_sharpen.cpp
Outdated
// Create a window | ||
namedWindow(window_name1, 1); | ||
// create a toolbar | ||
createTrackbar("Canny threshold default", window_name1, &sharpenRadius, 7, onTrackbar); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Canny threshold default ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake.Legacy problems caused by reference code.Have fixed it.Thank you.
samples/cpp/multiscale_sharpen.cpp
Outdated
} | ||
static void help(const char** argv) | ||
{ | ||
printf("\nThis sample demonstrates multiScaleSharpen detection\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
detection ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes,"image processing" is better.
it may not be suiltable to pr here. |
This pullrequest changes 0516
This enhanced algorithm comes from paper

Dark image enhancement based on binocular target contrast and multi-scale detail enhancement
https://ieeexplore.ieee.org/abstract/document/7351031/
Section 2.3,there is Screenshot
The core idea of the paper is similar to Retinex, which uses Gaussian blur at three scales, and then subtracts from the original image to obtain different levels of detail information, and then merges these details into the original image through a certain combination, which is strengthened The ability of original image information.
It is worth mentioning that the coefficients of D1 have been specially processed. The algorithm has simple coding and obvious effects.
Core function:
Results show:

CPP Shampe was PR to illustrate the algorithm。
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.