skin-deep icon indicating copy to clipboard operation
skin-deep copied to clipboard

Modify edge weight in denoise process

Open ChongMingWei opened this issue 4 years ago • 4 comments
trafficstars

  1. In the Makefile, I add the variable ENABLE_OPENMP to enable parallelization.
  2. In the denoise function of main.c, edge is assigned the value CLAMP2BYTE(diff). int edge = CLAMP2BYTE(diff); If diff < 0, edge is assigned 0. However, the condition diff < 0 indicates that current pixel is near the lighter side of an edge. If this kind of diff is directly discarded, the light edge won't be preserved. Take the absolute value of this kind of diff can solve this kind of problem. int edge = CLAMP2BYTE(myabs(diff));

myabs() is the function for computing absolute value.

  1. In the denoise function of main.c, we can reorder the computation of var. From int var = (prev_sum_pow - mean*prev_sum) / window_size; to int var = prev_sum_pow / window_size - mean*mean; This modification takes advantage of pre-calculated mean and gain performance in non-parallel version.

ChongMingWei avatar Jan 17 '21 15:01 ChongMingWei

The seven rules of a great Git commit message

  1. Separate subject from body with a blank line.
  2. Limit the subject line to 50 characters.
  3. Capitalize the subject line.
  4. Do not end the subject line with a period.
  5. Use the imperative mood in the subject line.
  6. Wrap the body at 72 characters.
  7. 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/

jserv avatar Jan 17 '21 15:01 jserv

  1. For denoise process in the image, I find that light side of edge is ignored in the original implementation . The CLAMP2BYTE directly discard the negative value which is responsible for strengthening the lighter side.
  2. For the computation in denoise process, I modify the arithmetic order of var and 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.

jserv avatar Jan 17 '21 15:01 jserv

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.

jserv avatar Jan 17 '21 16:01 jserv

The content of pull request and commit messages have been modified. Please check. Thanks.

ChongMingWei avatar Jan 17 '21 17:01 ChongMingWei