/Users/lyon/j4p/src/j2d/edge/MagDOGProcessor.java

1    package j2d.edge; 
2     
3    import j2d.ImageUtils; 
4    import ip.transforms.Gauss; 
5    import j2d.ImageProcessorInterface; 
6     
7    import java.awt.*; 
8     
9     
10   public class MagDOGProcessor implements ImageProcessorInterface { 
11    
12       private int kernelWidth; 
13       private double sigma; 
14    
15    
16       public MagDOGProcessor( 
17               int _kernelWidth, 
18               double _sigma) { 
19    
20           kernelWidth = _kernelWidth; 
21           sigma = _sigma; 
22       } 
23    
24       public Image process(Image img) { 
25           return ImageUtils.sobel( 
26                   magDoG(img)); 
27    
28       } 
29    
30    
31       private Image magDoG(Image img) { 
32           return ImageUtils.convolution(img, 
33                   Gauss.getMagnitudeOfTheDerivativeOfGauss( 
34                           kernelWidth, kernelWidth, sigma)); 
35       } 
36    
37   } 
38    
39