Skip to content

Commit 3a82136

Browse files
committed
Made a larger structuring element. I'm looking for a more elegant way to do make structuring elements, but I think it can wait for now.
1 parent 171e6ce commit 3a82136

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

MorphologicalClose.java

+9-6
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,15 @@ public static void main(String args[]){
4747
* @return PlanarImage The image after
4848
*/
4949
public static PlanarImage morphClose(PlanarImage img){
50-
float disk[] ={1,1,1,1,1,
51-
1,1,1,1,1,
52-
1,1,1,1,1,
53-
1,1,1,1,1,
54-
1,1,1,1,1};
55-
KernelJAI kern = new KernelJAI(5,5,disk);
50+
float disk[] ={0, 0, 1, 1, 1, 0, 0,
51+
0, 1, 1, 1, 1, 1, 0,
52+
1, 1, 1, 1, 1, 1, 1,
53+
1, 1, 1, 1, 1, 1, 1,
54+
1, 1, 1, 1, 1, 1, 1,
55+
0, 1, 1, 1, 1, 1, 0,
56+
0, 0, 1, 1, 1, 0, 0};
57+
58+
KernelJAI kern = new KernelJAI(7,7,disk);
5659
PlanarImage erode = JAI.create("dilate", img, kern, null);
5760
return JAI.create("erode",img, kern, null);
5861
}

0 commit comments

Comments
 (0)