Splitting an image into smaller regions

11 ビュー (過去 30 日間)
hasan alhussaini
hasan alhussaini 2018 年 2 月 26 日
コメント済み: hasan alhussaini 2018 年 3 月 17 日
Hi Guys,
I'm working on a code that creates an RGB descriptor for visual search. i've managed to implement the rgb descriptor on the whole image. but i wanted to experiment by splitting the same image up into smaller areas and rerun the experiment by calculating the rgb descriptor on smaller parts of the image.
the reason behind this, is because i'm using a query image against a dataset in order to find visually similar results. but if i split up my image into smaller pieces, i got a feeling it will be more accurate.
my question is, is there a function or piece of code that could help me with this?
Thanks

採用された回答

Image Analyst
Image Analyst 2018 年 2 月 26 日
See the FAQ for 2 different ways, depending on how you want to do it.

その他の回答 (2 件)

jonas
jonas 2018 年 2 月 26 日
編集済み: jonas 2018 年 2 月 26 日
Use mat2cell()
Example:
%Load 256x256 grayscale image and divide in 4x4 equally sized subimages
n=4;
I = imread('cameraman.tif');
I_sub=mat2cell(I,ones(1,n)*256/n,ones(1,n)*256/n)
repeat for each RGB channel

hasan alhussaini
hasan alhussaini 2018 年 3 月 17 日
Hi Image Analyst.
I've altered your code to put each block of the image in a bin named F{r,c}.
and F{r,c} is a cell of 2x4, each part representing a part in the image. i want to make a final bin called Fbin that is the sum of the bins created in each section of F{r,c}.
just a reminder of the code i used. http://matlab.wikia.com/wiki/Split_image_into_blocks
i used the first method of dividing an image into blocks using mat2cell.
  4 件のコメント
Image Analyst
Image Analyst 2018 年 3 月 17 日
So you have 2x4 = 8 total histograms, and you want to sum all the bins to get the histogram of the complete array? Well, if so, that would simply be the histogram of the entire, complete image. Why should it be any different??? Then if you sum that histogram, it's simply the sum of all pixel values. Again, why do you expect anything different?
hasan alhussaini
hasan alhussaini 2018 年 3 月 17 日
It's part of a requirement. My task is to compare between splitting an image into sections vs the whole image. But i don't know how to sum the histograms

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

カテゴリ

Help Center および File ExchangeComputer Vision with Simulink についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by