Skip to content

Instantly share code, notes, and snippets.

from __future__ import division
import numpy as np
from skimage import io, color
import matplotlib.pyplot as plt
import vlfeat as vlf
import os
import math
# Reduced matches
l1,d1 = vlf.read_features_from_file('bust_matches.txt')
from __future__ import division
import numpy as np
from skimage import io, color
import matplotlib.pyplot as plt
import vlfeat as vlf
import os
import math
# Reduced matches
l1,d1 = vlf.read_features_from_file('bust_matches.txt')
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from skimage import io, img_as_float
A = img_as_float(io.imread('lego1.jpg', plugin='pil'))
# noise
n = np.random.random_sample()
image1 = io.imread('perold1.jpg')
image2 = io.imread('perold2.jpg')
image = np.zeros((image1.shape[0], image1.shape[1]*2, 3))
image[:, 0:image1.shape[1], :] = image1
image[:, image1.shape[1]:, :] = image2
imshow(image)
from __future__ import division
import numpy as np
from _growcut import growcut
from orientation import orientation
from skimage import io
from skimage.morphology.convex_hull import grid_points_inside_poly
def segmentation(image):
image = np.resize(image, (256, 256))
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from skimage import io, color
from skimage.io import ImageCollection
#Training recognition system
ic = ImageCollection('*.pgm')
for image in enumerate(ic):
image = color.rgb2gray(image)
# On branch master
# Changes to be committed:
#
# new file: experiments/fin_detect_shortest_path.py
# new file: sharkfin/__init__.py
# new file: sharkfin/data.py
#
# Unmerged paths:
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
from __future__ import division
import matplotlib.pyplot as plt
import numpy as np
from skimage import io, color, img_as_float
def histogram_equalization(A):
rows = A.shape[0]
columns = A.shape[1]
histogram, bin_edges = np.histogram(A.flatten(), range=(0, 1), bins=256)
histogram = histogram/np.max(histogram)
from __future__ import division
import matplotlib.pyplot as plt
import numpy as np
from skimage import io, color, img_as_float
def histogram_equalization(A):
rows = A.shape[0]
columns = A.shape[1]
histogram, bin_edges = np.histogram(A.flatten(), range=(0, 1), bins=256)
histogram = histogram/np.max(histogram)
@lizecillie
lizecillie / gist:6330006
Created August 24, 2013 19:34
histogram_equalization.py
def histogram_equalization_point_transformation(A):
B = A.copy()
P1 = B[:, :, 0]
P2 = B[:, :, 1]
P3 = B[:, :, 2]
G = (np.sum(B * (1/3, 1/3, 1/3), axis=2))/255
rows = G.shape[0]
columns = G.shape[1]
histogram, bin_edges = np.histogram(G.flatten(), range=(0, 1), bins=256)