From: ImageAnalyst on
David:
You have to divide up the original image into tiles of a certain size
(e.g. 32 pixels by 32 pixels). Then you can use blockproc to scan the
image in jumps of the tilesize and run a function that computes a
feature vector that describes that tile. The feature vector could
contain things like
HSV values
edge strength
edge direction (orientation)
variance (a measure of texture and noise),
etc.
There may be others that people use or you could pick your own. The
more features you use and the larger your source database from which
to draw on, the better your synthesis will be.

Then you resize your source images to be that tile size and get the
feature vector for each of them. Then for each tile in your big
image, I'd pick the top 10 or 20 source database resized images that
have the "closest" matches to your feature vector. It's up to you to
decide how to weight the different features and do the "closeness"
comparison.

Then, for starters, I'd replace each tile with the mini-image from the
database that has the lowest difference (best match) to the feature
vector for that tile. See how it looks. Maybe you might want to do a
few iterations where you try random combinations of the other 20 close
matches that you saved. Maybe one of them will look better than the
very closest match. If you really want to get picky you could go
through tile by tile trying all the top 20 closest matches and see how
they look in relation to the neighbors. You would probably only do
this for the most crucial tile poistions (for example at corners, or
at the pupil or iris of a human face, or some other part of the image
that will tend to draw the most attention.)

Anyway that's how I'd do it if I were to attempt it. The actual
method that actual artists use may be different - I've never actually
had the time, or the images, to try anything like this.
From: david carollo on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <2a525f44-dc9b-4b0f-b5f3-1ea4da07f828(a)v37g2000vbv.googlegroups.com>...
> David:
> You have to divide up the original image into tiles of a certain size
> (e.g. 32 pixels by 32 pixels). Then you can use blockproc to scan the
> image in jumps of the tilesize and run a function that computes a
> feature vector that describes that tile. The feature vector could
> contain things like
> HSV values
> edge strength
> edge direction (orientation)
> variance (a measure of texture and noise),
> etc.
> There may be others that people use or you could pick your own. The
> more features you use and the larger your source database from which
> to draw on, the better your synthesis will be.
>
> Then you resize your source images to be that tile size and get the
> feature vector for each of them. Then for each tile in your big
> image, I'd pick the top 10 or 20 source database resized images that
> have the "closest" matches to your feature vector. It's up to you to
> decide how to weight the different features and do the "closeness"
> comparison.
>
> Then, for starters, I'd replace each tile with the mini-image from the
> database that has the lowest difference (best match) to the feature
> vector for that tile. See how it looks. Maybe you might want to do a
> few iterations where you try random combinations of the other 20 close
> matches that you saved. Maybe one of them will look better than the
> very closest match. If you really want to get picky you could go
> through tile by tile trying all the top 20 closest matches and see how
> they look in relation to the neighbors. You would probably only do
> this for the most crucial tile poistions (for example at corners, or
> at the pupil or iris of a human face, or some other part of the image
> that will tend to draw the most attention.)
>
> Anyway that's how I'd do it if I were to attempt it. The actual
> method that actual artists use may be different - I've never actually
> had the time, or the images, to try anything like this.

This is very good!
How I can create a feature vector contain HSV and texture index (i must use at least 2 feature, i think colore and texture)?Where can I find that informations?

Thank you very much!
From: ImageAnalyst on
Just calculate the things that you want, like mean H, mean S, mean V,
standard deviation, or whatever, and string them all together:
featureVector = [meanH, meanS, meanV, stdDev edgeStrength edgeAngle];

You calculate the mean with the mean function, and standard deviation
with the std() function, and you can compute edge strength with a
Sobel filter on a 3x3 sized version of your input tile or your
candidate image.
From: david carollo on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <366eec96-09a1-4a74-b255-37556b337780(a)o14g2000yqb.googlegroups.com>...
> Just calculate the things that you want, like mean H, mean S, mean V,
> standard deviation, or whatever, and string them all together:
> featureVector = [meanH, meanS, meanV, stdDev edgeStrength edgeAngle];
>
> You calculate the mean with the mean function, and standard deviation
> with the std() function, and you can compute edge strength with a
> Sobel filter on a 3x3 sized version of your input tile or your
> candidate image.

Do tou know a script to extract mean HSV?
Have a nice day!
From: ImageAnalyst on
On May 1, 8:03 am, "david carollo" <xdav...(a)gmail.com> wrote:
> ImageAnalyst ,
> Do tou know a script to extract mean HSV?
> Have a nice day!
--------------------------------------------------------------------------------------

clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
imtool close all; % Close all imtool figures.
clear; % Erase all existing variables.
workspace; % Make sure the workspace panel is showing.

% Change the current folder to the folder of this m-file.
% (The line of code below is from Brett Shoelson of The Mathworks.)
if(~isdeployed)
cd(fileparts(which(mfilename)));
end

% Read in standard MATLAB color demo image.
rgbImage = imread('peppers.png');
[rows columns numberOfColorBands] = size(rgbImage);
% Resize to our tile size of 32 by 32;
tileSize = 32;
rgbImage = imresize(rgbImage, [tileSize tileSize]);
subplot(2, 2, 1);
imshow(rgbImage, []);
caption = sprintf('Original color Image resized to %d by %d',
tileSize, tileSize);
title(caption, 'FontSize', 20);
set(gcf, 'Position', get(0,'Screensize')); % Maximize figure.

% Convert RGB image to HSV
hsvImage = rgb2hsv(rgbImage);
% Extract out teh H, S, and V images individually
hImage = hsvImage(:,:,1);
sImage = hsvImage(:,:,2);
vImage = hsvImage(:,:,3);
% Calculate the means.
meanh = mean(hImage(:));
means = mean(sImage(:));
meanv = mean(vImage(:));

subplot(2, 2, 2);
imshow(hImage, []);
caption = sprintf('Hue Image. Mean = %.2f', meanh);
title(caption, 'FontSize', 20);

subplot(2, 2, 3);
imshow(sImage, []);
caption = sprintf('Saturation Image. Mean = %.2f', means);
title(caption, 'FontSize', 20);

subplot(2, 2, 4);
imshow(vImage, []);
caption = sprintf('Value Image. Mean = %.2f', meanv);
title(caption, 'FontSize', 20);