What is the meaning of a centroid of an RGB file as opposed the centroid of a grayImage file

2 visualizzazioni (ultimi 30 giorni)
I run the script:
>> grayImage = imread('gray.image.jpg');
stats = regionprops(true(size(grayImage)), grayImage, 'WeightedCentroid');
stats = regionprops(true(size(grayImage)), grayImage, 'WeightedCentroid');
centroid = stats.WeightedCentroid
and get two numbers representing the x and y coordinates of the center of mass
However, when I replace gray-image.jpg with RGB.jpg (i.e. gray-image.jpg that is actually a RBG file I gets three values. The first two are close to the values the grayImage and the third is much smaller
for example instead of 247.2652 313.9184. I get 246.0814 315.0654 1.9728
what is the meaning of 1.9728?
  2 Commenti
David Corwin
David Corwin il 28 Mar 2016
There is one other question that I need to have verified. In the above example with the result 247.2652 313.9184. does 247 represent the x axis and 313.9 represent the y axis. It is confusing only because the picture is characterized by y pixels by x pixels.

Accedi per commentare.

Risposta accettata

Walter Roberson
Walter Roberson il 21 Mar 2016
1.9728 is the centroid along the third dimension. For this purpose remember that the third dimension only happens to be 3 units long.
An interpretation of it would be that the balance is just a hint more to the red channel than to the blue channel, but it's pretty darn close to being at the green channel.
This does not tell you anything about the dispersion of color. The same result could come about on an image that was nearly all pure green with a small number of red pixels, compared to an image that is nearly all gray (which balances red green and blue) with the blue being slightly under-represented in the light, compared to an image that is nearly completely magenta (equal red and blue with no green) with a slight excess of red. All it tells you is that the balance is very nearly in the middle, slightly heavier to one side.

Più risposte (0)

Categorie

Scopri di più su Image Processing Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by