<commit_before>package pl.edu.misztal.JImageStreamToolkit.plugins.binarization;

import pl.edu.misztal.JImageStreamToolkit.image.Image;
import pl.edu.misztal.JImageStreamToolkit.plugin.Plugin;


public class OtsuBinarization extends Plugin {
    public void process(Image imgIn, Image imgOut) {
        imgOut.setBufferedImage(
                imgIn.parallelStream()
                        .apply(new pl.edu.uj.JImageStream.filters.color.OtsuBinarization())
                        .collect(new pl.edu.uj.JImageStream.collectors.BufferedImageCollector())
        );
    }
}<commit_msg>weighted otsu<commit_after>package pl.edu.misztal.JImageStreamToolkit.plugins.binarization;

import pl.edu.misztal.JImageStreamToolkit.image.Image;
import pl.edu.misztal.JImageStreamToolkit.plugin.Plugin;


public class OtsuBinarization extends Plugin {
    private boolean weighted = false;

    public OtsuBinarization() {
    }

    public OtsuBinarization(boolean weighted) {
        this.weighted = weighted;
    }

    public void process(Image imgIn, Image imgOut) {
        imgOut.setBufferedImage(
                imgIn.parallelStream()
                        .apply(new pl.edu.uj.JImageStream.filters.color.OtsuBinarization(weighted))
                        .collect(new pl.edu.uj.JImageStream.collectors.BufferedImageCollector())
        );
    }
}
{'fraction_non_alphanumeric': 0.09279881217520415, 'fraction_numerical': 0.0, 'mean_word_length': 2.884726224783862, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7156229', 'n_tokens_mistral': 430, 'n_tokens_neox': 403, 'n_words': 58}