Reducing size of image

1 回表示 (過去 30 日間)
Oah Joan
Oah Joan 2018 年 10 月 15 日
編集済み: Rena Berman 2021 年 1 月 15 日
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 件のコメント
Rik
Rik 2020 年 11 月 20 日
Why did you remove all you questions? That is extremely rude.
Rena Berman
Rena Berman 2021 年 1 月 15 日
(Answers Dev) Restored edit

サインインしてコメントする。

回答 (1 件)

KALYAN ACHARJYA
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

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by