Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Matlab 以像素为中心的小邻域_Matlab_Image Processing_Computer Vision - Fatal编程技术网

Matlab 以像素为中心的小邻域

Matlab 以像素为中心的小邻域,matlab,image-processing,computer-vision,Matlab,Image Processing,Computer Vision,假设有一个区域Sigma_X,它代表一个以X(像素)为中心半径为W的小邻域。我在下面的附件中已经尝试过了,但它并没有解决我的问题,因为它不是在像素邻域中执行的。我需要一个以X为中心的小邻域,每个像素的半径为W。例如,我的W=13,因此我将有大小为13x13的小邻域(本地窗口) NHOOD = fspecial('disk',radius)>0; h2 = zeros(N,M); h2(c_offset-rad:c_offset+rad,r_offset-rad:r_offset+rad)

假设有一个区域Sigma_X,它代表一个以X(像素)为中心半径为W的小邻域。我在下面的附件中已经尝试过了,但它并没有解决我的问题,因为它不是在像素邻域中执行的。我需要一个以X为中心的小邻域,每个像素的半径为W。例如,我的W=13,因此我将有大小为13x13的小邻域(本地窗口)

NHOOD = fspecial('disk',radius)>0;
h2 = zeros(N,M);
h2(c_offset-rad:c_offset+rad,r_offset-rad:r_offset+rad) = h;

请帮帮我。

你想做什么?这是关于过滤图像(滑动窗口?)我只想将邻域保存在矩阵中,以便稍后在公式中使用
image(h2>0)
是遮罩选择的所有像素。这会为每个像素输出邻域吗?因为在我有了邻域之后,我想根据强度把它分成两个区域。这是一个像素的邻域。然后,您需要通过适当调整
c_offset
r_offset
来迭代所有像素。这些变量确定磁盘在映像上的位置。