skin-deep
skin-deep copied to clipboard
Modify edge weight in denoise process
- In the
Makefile, I add the variableENABLE_OPENMPto enable parallelization. - In the
denoisefunction ofmain.c,edgeis assigned the value CLAMP2BYTE(diff).int edge = CLAMP2BYTE(diff);Ifdiff< 0,edgeis assigned 0. However, the conditiondiff< 0 indicates that current pixel is near the lighter side of an edge. If this kind ofdiffis directly discarded, the light edge won't be preserved. Take the absolute value of this kind ofdiffcan solve this kind of problem.int edge = CLAMP2BYTE(myabs(diff));
myabs() is the function for computing absolute value.
- In the
denoisefunction ofmain.c, we can reorder the computation ofvar. Fromint var = (prev_sum_pow - mean*prev_sum) / window_size;toint var = prev_sum_pow / window_size - mean*mean;This modification takes advantage of pre-calculatedmeanand gain performance in non-parallel version.
The seven rules of a great Git commit message
- Separate subject from body with a blank line.
- Limit the subject line to 50 characters.
- Capitalize the subject line.
- Do not end the subject line with a period.
- Use the imperative mood in the subject line.
- Wrap the body at 72 characters.
- Use the body to explain what and why vs. how.
Read this article carefully and rework the commits along with the subject of this pull request: https://chris.beams.io/posts/git-commit/
- For denoise process in the image, I find that light side of edge is ignored in the original implementation . The
CLAMP2BYTEdirectly discard the negative value which is responsible for strengthening the lighter side.- For the computation in denoise process, I modify the arithmetic order of
varand gain performance in non-parallel version. For 2. and 3., please check my hackmd for details. Thanks.
You should make the descriptions here more informative rather than asking the reviewer to check your note.
Instead of add new commits on top of the existing git commits, please use git rebase -i to rework your commits, ensuring each commit message is meaningful. Then, use git push --force.
The content of pull request and commit messages have been modified. Please check. Thanks.