Image analysis
3 次查看(过去 30 天)
显示 更早的评论
Hello Sir,
I have one doubt regarding for loop.I have 256x256 image then after some operations performed, it would produce 32x32 size output(that means by analysing 8x8 values it will show a singular value 1) How it could be done?Can i try it with mat2cell? But i need some information about mat2cell in depth Please post your suggetions.
My sample code
im=imread('flower.png') %256x256 image
for x=1:8
for y=1:8
im1(x,y)=im(x,y)*cos(0)+im(x,y)*sin(0);
end
end
My question is how to iterate this loop upto 256 values?
8 个评论
Walter Roberson
2011-10-4
You appear to already have a solid foundation for the code to find the moments for a single 8x8 block, in your previous question http://www.mathworks.com/matlabcentral/answers/15798-image-processing
回答(2 个)
Walter Roberson
2011-10-7
image=imread('D:\Jana\images\jann.jpg') %256x256 image
s = blkproc(image, [8 8], @moment);
Warning: your code with cos(90) and sin(90) is very very unlikely to work. Your current version is worse that way than when we asked you before why you had the cos() and sin() in the equations, which is a question I do not recall that you ever answered.
2 个评论
Image Analyst
2011-10-7
And it appears jana does not yet know that there is a cosd() and sind() which should be used when inputting values in degrees instead of radians. (Not that they should even be in there in the first place!)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!