sliding the rectangle using nlfilter
1 次查看(过去 30 天)
显示 更早的评论
hai
i am new to matlab and studing about optic disc localization
in that my work is to develop two feature maps namely I horizontal map II vertical map
and then create a rectangle and move over the feature map and calculate the sum of pixels inside the rectangle and move the rectangle all over the image and calculate the sum of pixel values in each point.
my third step is i have to plot the values and draw a graph
now i had generated two feature maps and i have created a rectangle also
i have strucked in making the rectangle to move
please tell me wheather an function is available in matlab for moving the rectangle over the image
i want the rectangle to move automatically and not a dragable rectangle and i have trid with imrectwhicvh is of the form of draggable rectangle
please help me
and the code i have used is
*r=rectangle('position',[10,10,30,560],'linewidth',2.4,'edgecolor','w');
func = @(x) sum(x.cdata(:));
B = nlfilter(final2,r,func);
figure,imshow(B);*
please hep me
thanks
hai jan Simon
as you mentioned a have used nlfilter function but i am getting the result as NAN and the time taken for processing also high s0 i used colfilt function but the answer is not coming
what can i do now please tell me thanks
2 个评论
Walter Roberson
2011-8-25
duplicates are at http://www.mathworks.com/matlabcentral/answers/13866-move-rectangle-over-te-image and http://www.mathworks.com/matlabcentral/answers/13444-to-make-the-rectangle-move-over-the-image
Jan
2011-8-26
@kanagapushpavalli: Please post the command you have used, otherwise we cannot guess what's going wrong.
回答(2 个)
Walter Roberson
2011-8-25
Please read the responses to when you asked this before. http://www.mathworks.com/matlabcentral/answers/13866-move-rectangle-over-te-image and http://www.mathworks.com/matlabcentral/answers/13444-to-make-the-rectangle-move-over-the-image
I recommend against the approach you have taken. Please see my answer to the 13444 post.
0 个评论
Jan
2011-8-25
Drawing a rectangle will not help. You want to process rectangular sections of the image data.
Please read the documentation of help nlfilter. There you find: "B = nlfilter(A, [m n], fun)" with m and n are the dimensions of the rectangle and fun is @sum in your case.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!