问题描述
我需要结构元素来细化图像。结构元素是3×3矩阵值1和0。我在JAVA中使用以下代码行声明了一个3x3数组:
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];
请告诉我,我应该为数组分配什么样的0和1顺序?我的意思是如果以下是我的数组:
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]
然后我将如何决定在哪个地方放0和哪里放1?
我必须在2D灰度图像上执行细化。
谢谢!
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!
推荐答案
您可以将其视为数组数组。
You can think of it as an array of arrays.
即se [0] = {0,0,0}
se [1] = {x,1,x}
se [2] = {1,1,1}
i.e. se[0] = {0,0,0} se[1] = {x,1,x} se[2] = {1,1,1}
使se [0] [0] = 0,se [1] [0] = x,se [2] [0] = 1,..
making se[0][0] = 0, se[1][0] = x, se[2][0] = 1, ..
这篇关于结构元素(图像细化)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!