Skip to content

Commit

Permalink
Fixes For Otsu's Thresholding Augmentation issue 170
Browse files Browse the repository at this point in the history
  • Loading branch information
mike committed Mar 28, 2024
1 parent 2367dcf commit 2f87a1d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
import de.edux.augmentation.effects.OtsuThresholdingAugmentation;

import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
import javax.swing.WindowConstants;
import java.awt.BorderLayout;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
Expand All @@ -14,11 +17,11 @@ public class OtsuThresholdingAugmentationExample {
private static final String IMAGE_PATH = "images" + File.separator + "cyborg.png";

public static void main(String[] args) throws IOException {
BufferedImage bufferedImage = loadTestImage(IMAGE_PATH);
BufferedImage originalImage = loadTestImage(IMAGE_PATH);
OtsuThresholdingAugmentation otsuThreshold = new OtsuThresholdingAugmentation();
BufferedImage otsoImage = otsuThreshold.apply(bufferedImage);
display(bufferedImage, "Original Image");
display(otsoImage, "After Otsu Thresholing");
BufferedImage otsuImage = otsuThreshold.apply(originalImage);
display(originalImage, "Original Image");
display(otsuImage, "After Otsu Augmentation");
}

public static BufferedImage loadTestImage(String path) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import de.edux.augmentation.core.AugmentationBuilder;
import de.edux.augmentation.core.AugmentationSequence;
import org.junit.jupiter.api.Test;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
Expand Down

0 comments on commit 2f87a1d

Please sign in to comment.