Skip to content
Snippets Groups Projects
Commit 35215aab authored by Guillaume HEUSCH's avatar Guillaume HEUSCH
Browse files

[cvpr14] return 3 mean colors in compute_average_color mask, instead of green only

parent 23457d9c
No related branches found
No related tags found
1 merge request!8Resolve "Potential bug when computing average color from mask"
...@@ -281,8 +281,8 @@ def compute_average_colors_mask(image, mask, plot=False): ...@@ -281,8 +281,8 @@ def compute_average_colors_mask(image, mask, plot=False):
Returns Returns
------- -------
color: :obj:`float` color: numpy.ndarray
The average green color inside the mask ROI. The average RGB colors inside the mask ROI.
""" """
if plot: if plot:
...@@ -293,8 +293,8 @@ def compute_average_colors_mask(image, mask, plot=False): ...@@ -293,8 +293,8 @@ def compute_average_colors_mask(image, mask, plot=False):
pyplot.title('Mask overlaid on the original frame') pyplot.title('Mask overlaid on the original frame')
pyplot.show() pyplot.show()
green = image[1, mask] [red, green, blue] = image[:, mask]
return numpy.mean(green) return numpy.array([numpy.mean(red), numpy.mean(green), numpy.mean(blue)])
def compute_average_colors_wholeface(image, plot=False): def compute_average_colors_wholeface(image, plot=False):
"""computes the average green color within the provided face image """computes the average green color within the provided face image
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment