Automatic RGB grid capture
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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.
0 Commenti
Risposte (1)
Image Analyst
il 5 Set 2012
Modificato: Image Analyst
il 5 Set 2012
Perhaps you want im2html:
http://blogs.mathworks.com/steve/2012/06/02/making-an-html-table-of-pixel-values-with-colored-cells/
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, :);
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!