Prev: color names
Next: No one?
From: Valentine Oradiegwu on
Hi everyone,
I have successfully segmented a frame from a video into binary blobs that represent the moving object. How can i compute the average color of each of the objects which these blobs represents?
Cheers!
From: ImageAnalyst on
Valentine Oradiegwu
For the blobs, just pass in each color channel one at a time to
regionprops along with the binary image and it will tell you the
mean. In that way, you can get the mean R, G, and B values. But
whether you consider the mean RGB values a color is another
discussion. Have you calibrated your scene in any way (e.g. with an x-
rite ColorChecker chart)? Do you want the CIE LAB values instead of
the RGB values? It's probably too complicated to get into here. It
really depends on what you're going to do with the "color." What are
you going to do with it after you've measured it? You must be wanting
to measure their color for *some* reason, so what is it?

For the blogs - I have no clue there. I guess try to snap screenshots
(or their blogspot account or whatever) and measure the average color
of each color plane with the mean() function, or use regionprops like
you did for the blobs if you want just certain portions of their blog
screen.
From: Valentine Oradiegwu on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <febd7d93-e599-4c19-bac1-9f9b44395d13(a)b7g2000yqd.googlegroups.com>...

ImageAnalyst,
In school, we are required to write a tracking algorithm that associates blobs from subsequent frames using their average color and centroids! That's why i'm trying to compute the average color after having computed the centroid of the blobs. And no, I have not done some scene calibration. What merits can i enjoy from screen calibration and using CIE values instead of RGB?

I can extract each color channel quite comfortably but does regionprops accept arguments that are not Binary, Labelled, or Connected Component? Your suggestion seems a lot more easier (once i can understand a little bit more) than what i did today. I used the property PixelList to return the coordinates of each pixel on the blobs and reckoned that these coordinates will be same on the RGB image and used these coordinates to extract each color channel, sum them up and divide by number of pixels.

Kindly assist in clarifying your excellent suggestion for the average color computation.
Many thanks.
From: Husam Aldahiyat on
"Valentine Oradiegwu" <obioradiegwu(a)yahoo.com> wrote in message <hn15hn$d73$1(a)fred.mathworks.com>...
> Hi everyone,
> I have successfully segmented a frame from a video into binary blobs that represent the moving object. How can i compute the average color of each of the objects which these blobs represents?
> Cheers!

Since you've already segmented the blobs, use the PixelIdxList or the PixelList property of regionprops(), then given the indices of each blob's RGB values, you can find the mean of R then G then B.

I think I'm right.
From: ImageAnalyst on
On Mar 8, 4:13 pm, "Husam Aldahiyat" <numand...(a)gmail.com> wrote:
> Since you've already segmented the blobs, use the PixelIdxList or the PixelList property of regionprops(), then given the indices of each blob's RGB values, you can find the mean of R then G then B.
>
> I think I'm right.
------------------------------
You don't need to mess with PixelIdxList or PixelList since
regionprops gives the mean of the original image directly as one of
its returned measurements (with release 2008a and later).
 |  Next  |  Last
Pages: 1 2 3 4
Prev: color names
Next: No one?