sliding the rectangle using nlfilter
1 view (last 30 days)
Show older comments
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 Comments
Walter Roberson
on 25 Aug 2011
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
on 26 Aug 2011
@kanagapushpavalli: Please post the command you have used, otherwise we cannot guess what's going wrong.
Answers (2)
Walter Roberson
on 25 Aug 2011
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 Comments
Jan
on 25 Aug 2011
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 Comments
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!