help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: histogram matching of colour images


From: Andreas Weber
Subject: Re: histogram matching of colour images
Date: Mon, 31 Aug 2015 08:53:54 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0

Am 31.08.2015 um 04:33 schrieb Terry Duell:
> Hello All,
> I am looking for a method of matching the histogram of a subject image
> to that of a reference image, both r,g,b.
> I don't see any functions in the image package that appear to do that,
> but may be suffering domestic blindness.
> Anyone have any ideas how to do this?

I don't know a function in octave-forge image which would do this but it
should be easy to do it yourself.

## get octave logo
img = ind2rgb (get (0, "defaultimagecdata"), colormap);

bins = 10;
n = zeros (3, bins);
n(1,:) = hist (img (:, :, 1)(:), bins);
n(2,:) = hist (img (:, :, 2)(:), bins);
n(3,:) = hist (img (:, :, 3)(:), bins);


Then you'll have the counts of red, green, blue pixels per bin which I
would normalize to 0..1 and then feed to a "cost" function, perhaps

sumsq (n_ref - n)

to calculate how "similar" the two images are.
HTH, Andy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]