Split image in regions

10 ビュー (過去 30 日間)
Omim
Omim 2016 年 4 月 14 日
コメント済み: Image Analyst 2016 年 4 月 15 日
How can I split an image into regions and display the histogram for each region? For example, I have an image of 1024x1024 pixels and I want to split it into regions by 480x480 pixels and plot the histogram for each...

回答 (2 件)

Walter Roberson
Walter Roberson 2016 年 4 月 14 日
480 does not divide into 1024; what would you like to do with the left-over 64 pixel border?

Image Analyst
Image Analyst 2016 年 4 月 14 日
Try this:
% Get sub-image
subImage = grayImage(1:480, 1:480);
% plot histogram in current axes
histogram(subImage(:));
Repeat for other sub images.
  3 件のコメント
Walter Roberson
Walter Roberson 2016 年 4 月 15 日
30 does not divide exactly into 1024. What do you want to do with the extra 4 pixels per side?
Image Analyst
Image Analyst 2016 年 4 月 15 日
Just put it into a loop and change the indexes. Just see the FAQ for guidance: http://matlab.wikia.com/wiki/FAQ#How_do_I_split_an_image_into_non-overlapping_blocks.3F

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

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by