We really cannot debug this without knowing what the values of edgediff and eror are like.
error in using blkproc
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!