<commit_before>__author__ = 'paulo'

import cv2


class OpenCVIntegration(object):


    @staticmethod
    def adaptive_threshold(filename_in, filename_out):
        img = cv2.imread(filename_in)
        img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
        th = cv2.adaptiveThreshold(img,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY,11,2)
        params = [cv2.cv.CV_IMWRITE_JPEG_QUALITY, 100]
        cv2.imwrite(filename_out, th, params)

    @staticmethod
    def grayscale(filename_in, filename_out):
        img = cv2.imread(filename_in)
        img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
        params = [cv2.cv.CV_IMWRITE_JPEG_QUALITY, 100]
        cv2.imwrite(filename_out, img, params)<commit_msg>Fix IMWRITE_JPEG_QUALITY ref for the newest OpenCV<commit_after>__author__ = 'paulo'

import cv2


class OpenCVIntegration(object):


    @staticmethod
    def adaptive_threshold(filename_in, filename_out):
        img = cv2.imread(filename_in)
        img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
        th = cv2.adaptiveThreshold(img,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY,11,2)
        params = [cv2.IMWRITE_JPEG_QUALITY, 100]
        cv2.imwrite(filename_out, th, params)

    @staticmethod
    def grayscale(filename_in, filename_out):
        img = cv2.imread(filename_in)
        img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
        params = [cv2.IMWRITE_JPEG_QUALITY, 100]
        cv2.imwrite(filename_out, img, params)
{'fraction_non_alphanumeric': 0.09746053534660261, 'fraction_numerical': 0.038435140700068635, 'mean_word_length': 3.6285714285714286, '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': '5855179', 'n_tokens_mistral': 594, 'n_tokens_neox': 551, 'n_words': 83}