Skip to content

Commit 8e57288

Browse files
committed
Fixed broken sigma 2 denoise
1 parent f0c7846 commit 8e57288

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

backend/lsw_db.mv.db

4 KB
Binary file not shown.

backend/src/main/java/nl/wilcokas/luckystackworker/service/OperationService.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,11 @@ private void applySigmaDenoise1(final ImagePlus image, final Profile profile) {
153153

154154
private void applySigmaDenoise2(final ImagePlus image, final Profile profile) {
155155
if (Constants.DENOISE_ALGORITHM_SIGMA2.equals(profile.getDenoiseAlgorithm2())) {
156-
int iterations = profile.getDenoise1Iterations() == 0 ? 1 : profile.getDenoise1Iterations();
157-
log.info("Applying Sigma denoise mode 2 with value {} to image {}", profile.getDenoise1Amount(), image.getID());
158-
BigDecimal factor = profile.getDenoise1Amount().compareTo(new BigDecimal("100")) > 0 ? new BigDecimal(100) : profile.getDenoise1Amount();
159-
BigDecimal minimum = factor.divide(new BigDecimal(100), 2, RoundingMode.HALF_EVEN);
156+
int iterations = profile.getDenoise2Iterations() == 0 ? 1 : profile.getDenoise2Iterations();
157+
log.info("Applying Sigma denoise mode 2 with radius {} and {} iterations to image {}", profile.getDenoise2Radius(), iterations,
158+
image.getID());
160159
for (int i = 0; i < iterations; i++) {
161-
sigmaFilterPlusFilter.apply(image, profile.getDenoise1Radius().doubleValue(), 5D, minimum.doubleValue());
160+
sigmaFilterPlusFilter.apply(image, profile.getDenoise2Radius().doubleValue(), 5D, 1D);
162161
}
163162
}
164163
}

frontend/src/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ export class AppComponent implements OnInit {
415415

416416
denoise2RadiusChanged(event: any, update: boolean) {
417417
this.profile.denoise2Radius = event.value;
418-
this.denoise1Radius = event.value;
418+
this.denoise2Radius = event.value;
419419
this.settings.operation = 'denoise2Radius';
420420
console.log('denoise2RadiusChanged called: ' + this.profile.denoise2Radius);
421421
if (update) {

0 commit comments

Comments
 (0)