Automatic RGB grid capture

3 ビュー (過去 30 日間)
asd
asd 2012 年 9 月 5 日
Hi all,
I have a question i have made this code that captures rgb from a image, you can click more or less to get a RGB value :
pixel=impixel(picture);
column = num2cell(pixel,1);
zcolumn = cellfun(@sum,column);
zrow = size(pixel,1);
res = bsxfun(@rdivide,zcolumn,zrow);
tres=round(res);
close all;
I need to put this in a table but every time i need to go thro all of the code to get one RGB value(tres).
I am interested is there a way to create a grid(10X10px boxes) over an image ( allways white background and lets say orange in the middle) and automatically get RGB values for each of that box. That it does not take in a count of any boxes that have, lets say more then 20% white space in a box.

回答 (1 件)

Image Analyst
Image Analyst 2012 年 9 月 5 日
編集済み: Image Analyst 2012 年 9 月 5 日
Perhaps you want im2html:
or this:
row = 123; % or wherever you want to start.
col = 321; % or wherever you want to start.
% Extract a 10 by 10 box there.
rgbValuesInTheBox = rgbImage(row:row+9, col:col+9, :);
  1 件のコメント
asd
asd 2012 年 9 月 6 日
Ill try that thank you .

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

Community Treasure Hunt

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

Start Hunting!

Translated by