This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from itertools import product | |
class GridTiler (object): | |
''' | |
Image patch generator | |
A simple generator class for the extraction of image | |
patches, given a binary mask on which evaluate the | |
amount of no-null pixels. The object implements the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import cv2 | |
import numpy as np | |
from scipy import fft | |
# these are used **only** for the entropy filter | |
from skimage.util import img_as_ubyte | |
from skimage.filters.rank import entropy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from itertools import product | |
from collections import defaultdict | |
__author__ = ['Gianluca Carlini', 'Nico Curti'] | |
__email__ = ['gianluca.carlini3@unibo.it', 'nico.curti2@unibo.it'] | |
def npConnectedComponentsWithStats (img : np.ndarray) -> tuple: | |
''' | |
Evaluate the connected components (with statistics) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
import tensorflow as tf | |
__all__ = ['image_pyramid', 'lucas_kanade_optical_flow'] | |
__author__ = ['Nico Curti', 'Gianluca Carlini'] | |
__mail__ = ['nico.curti2@unibo.it', 'gianluca.carlini3@unibo.it'] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import cv2 | |
import numpy as np | |
from itertools import combinations | |
__author__ = ['Nico Curti', 'Gianluca Carlini'] | |
__email__ = ['nico.curti2@unibo.it', 'gianluca.carlini3@unibo.it'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import annotations | |
import itertools | |
import numpy as np | |
from sklearn.base import BaseEstimator | |
from sklearn.base import TransformerMixin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import cv2 # required for cv_bweuler function | |
import numpy as np # required for np_bweuler function | |
import tensorflow as tf # required for tf_bweuler function | |
from functools import wraps # required for checker decorator | |
from scipy.signal import convolve2d # required for np_bweuler function | |
__author__ = ['Nico Curti', 'Gianluca Carlini'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import division | |
from __future__ import print_function | |
import os | |
import argparse | |
import numpy as np | |
from glob import glob |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
import cv2 | |
import argparse | |
import numpy as np | |
from functools import partial |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// g++ macenko.cpp -O3 -std=c++17 `pkg-config opencv --cflags --libs` -o macenko | |
#include <iostream> | |
#include <opencv2/opencv.hpp> | |
void rgb2stains (const cv :: Mat & rgb, cv :: Mat & dst, cv :: InputArray W, double I_0) | |
{ | |
cv :: Mat log = cv :: max(rgb, 1e-16); |
NewerOlder