Reducing size of image
1 次查看(过去 30 天)
显示 更早的评论
Well I want to write a function reducesize(imagematrix, amount) that returns a new image that is reduced in size by the given amount. In particular, it reduces the size of an image by taking only pixels every ‘amount’ pixels apart. For example, if amount=3 then the image will be one third as high and one third as wide. Can you help me?
2 个评论
回答(1 个)
KALYAN ACHARJYA
2018-10-15
编辑:KALYAN ACHARJYA
2018-10-15
function reduced_image=reducesize(imagematrix,amount)
[rows colm]=size(imagematrix);
x=randi(rows);
y=round(amount/x);
reduced_image=imresize(imagematrix,[x y])
end
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!