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

[CHROM] fixes index issues with numpy.where

parent 35d0ad88
No related branches found
No related tags found
1 merge request!5Pad
Pipeline #
......@@ -49,9 +49,12 @@ def compute_mean_rgb(image, mask=None):
The mean blue value
"""
assert len(image.shape) == 3, "This is meant to work with color images (3 channels)"
mean_r = numpy.mean(image[0, numpy.where(mask)])
mean_g = numpy.mean(image[1, numpy.where(mask)])
mean_b = numpy.mean(image[2, numpy.where(mask)])
#mean_r = numpy.mean(image[0, numpy.where(mask)])
#mean_g = numpy.mean(image[1, numpy.where(mask)])
#mean_b = numpy.mean(image[2, numpy.where(mask)])
mean_r = numpy.mean(image[0, mask])
mean_g = numpy.mean(image[1, mask])
mean_b = numpy.mean(image[2, mask])
return mean_r, mean_g, mean_b
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment