error in using blkproc

조회 수: 1 (최근 30일)
ramya raj
ramya raj 2011년 9월 5일
hai i am working with matlab R2009a and i have to move a window of size[30,265] over the image and calculate the sum of pixels inside the window at each location
the problem is my image is having NaN values and and i am using the blkproc function to make the window move over my image and i got a matrix of size 24 X 1 with NAN values is my answer correct please some one help me
and my coding is this
erore=double(eror);
g=double(g);
final2=imdivide(edgediff,erore);
figure ,image(final2);
% converting nan and inf values to zero
final2(isnan(final2))=0;
final2(isinf(final2))=0;
[width, height] = size(final2);
%blkproc used to slide and calucate the sum inside the window
B=blkproc(final2,[30 height],@(x)sum(x(:)));
and this the result i am getting
0
-13514
-2521
-1398
1096
2019
-591
-783
-1201
-15247
-11248
2767
-2142
74
1485
-8134
-1750
-1164
1574
943
-1503
-2184
-10789
0
but my result should be in the range of -1 to 4.50r 6
please help me

답변 (1개)

Walter Roberson
Walter Roberson 2011년 9월 6일
We really cannot debug this without knowing what the values of edgediff and eror are like.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by