<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 10 15:59:30 2020

@author: marlon.cruz
"""


from .ridge_segment import ridge_segment
from .ridge_orient import ridge_orient
from .ridge_freq import ridge_freq
from .ridge_filter import ridge_filter

def image_enhance(img):
    blksze = 16;
    thresh = 0.1;
    normim,mask = ridge_segment(img,blksze,thresh);  # normalização da imagem e extração do ROI


    gradientsigma = 1;
    blocksigma = 7;
    orientsmoothsigma = 7;
    orientim = ridge_orient(normim, gradientsigma, blocksigma, orientsmoothsigma);              # buscar orientação de todos os Pixels


    blksze = 38;
    windsze = 5;
    minWaveLength = 5;
    maxWaveLength = 15;
    freq,medfreq = ridge_freq(normim, mask, orientim, blksze, windsze, minWaveLength,maxWaveLength);  # buscando a frequência geral de pixels
    
    
    freq = medfreq*mask;
    kx = 0.65;ky = 0.65;
    newim = ridge_filter(normim, orientim, freq, kx, ky);  # criando filtro gabor e realizando a filtragem 
    
    
    #th, bin_im = cv2.threshold(np.uint8(newim),0,255,cv2.THRESH_BINARY);
    return(newim < -3)
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 10 15:59:30 2020

@author: marlon.cruz
"""


from .ridge_segment import ridge_segment
from .ridge_orient import ridge_orient
from .ridge_freq import ridge_freq
from .ridge_filter import ridge_filter

def image_enhance(img):
    blksze = 16;
    thresh = 0.1;
    normim,mask = ridge_segment(img,blksze,thresh);  # normalização da imagem e extração do ROI


    gradientsigma = 1;
    blocksigma = 7;
    orientsmoothsigma = 7;
    orientim = ridge_orient(normim, gradientsigma, blocksigma, orientsmoothsigma);              # buscar orientação de todos os Pixels


    blksze = 38;
    windsze = 5;
    minWaveLength = 5;
    maxWaveLength = 15;
    freq,medfreq = ridge_freq(normim, mask, orientim, blksze, windsze, minWaveLength,maxWaveLength);  # buscando a frequência geral de pixels
    
    
    freq = medfreq*mask;
    kx = 0.65;ky = 0.65;
    newim = ridge_filter(normim, orientim, freq, kx, ky);  # criando filtro gabor e realizando a filtragem 
    
    
    #th, bin_im = cv2.threshold(np.uint8(newim),0,255,cv2.THRESH_BINARY);
    return(newim < -3)
# -*- coding: utf-8 -*- Created on Tue Nov 10 15:59:30 2020  @author: marlon.cruz # normalização da imagem e extração do ROI # buscar orientação de todos os Pixels # buscando a frequência geral de pixels # criando filtro gabor e realizando a filtragem #th, bin_im = cv2.threshold(np.uint8(newim),0,255,cv2.THRESH_BINARY);