0

I need "Structuring Element" for thinning an image. Structuring Element is a 3 x 3 matrix values of "1" and "0". I have declared a 3x3 array using following line of code in JAVA:

int [][] structuring_element = new int [3][3];

Kindly tell me, what kind of order of "0s" and "1s" should I assign to array? I mean if following is my array for example:

[0 0 0]
[x 1 x]
[1 1 1]

then how I will decide at what place should I put 0 and where to put 1? I have to perform thinning on a 2D gray-scale image. Thanks!

Marko Topolnik
  • 195,646
  • 29
  • 319
  • 436

1 Answers1

0

You can think of it as an array of arrays.

i.e. se[0] = {0,0,0} se[1] = {x,1,x} se[2] = {1,1,1}

making se[0][0] = 0, se[1][0] = x, se[2][0] = 1, ..

MahdeTo
  • 11,034
  • 2
  • 27
  • 28
  • I want to ask how i will decide whether I should assign 0 like structuring_element[0][0]= 0 or I should assign 1 to it like structuring_element[0][0]= 1 or structuring_element[0][0]= x I mean, on what basis values are assigned to structuring element for image thinning? – user1476497 Jun 28 '12 at 13:34
  • This is not a java question in this case :) – MahdeTo Jun 28 '12 at 13:42
  • You can find a thinning implementation here: http://homepages.inf.ed.ac.uk/rbf/HIPR2/flatjavasrc/Thin.java – MahdeTo Jun 28 '12 at 13:42
  • Dear MahdeTo! It is a Java question. Image processing using JAVA :) – user1476497 Jun 28 '12 at 13:49