-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathBim_d2.py
38 lines (26 loc) · 909 Bytes
/
Bim_d2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# -*- coding: utf-8 -*-
from scipy import signal
import numpy as np
def Bim_d2(X):
"""
J = Bim_d2(I)
Toolbox: Balu
Second derivative of image X.
Input data:
I grayvalue image.
Output:
J = signal.convolve2d(I,np.array([[0,1,0],[1,-4,1],[0,1,0]]),'same');
Example:
import numpy as np
from balu.ImagesAndData import balu_imageload
from mahotas.colors import rgb2gray
X = balu_imageload('testimg2.jpg')
I = rgb2gray(X,dtype=np.uint8)
J = Bim_d2(I);
plt.imshow(J,cmap='gray')
(c) D.Mery, PUC-DCC, 2010
http://dmery.ing.puc.cl
With collaboration from:
Jose Miguel Arrieta Ramos ([email protected]) -> Translated implementation into python (2017)
"""
return signal.convolve2d(X,np.array([[0,1,0],[1,-4,1],[0,1,0]]),'same')