Filter löschen
Filter löschen

error in using blkproc

3 Ansichten (letzte 30 Tage)
ramya raj
ramya raj am 5 Sep. 2011
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

Antworten (1)

Walter Roberson
Walter Roberson am 6 Sep. 2011
We really cannot debug this without knowing what the values of edgediff and eror are like.

Community Treasure Hunt

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

Start Hunting!

Translated by