Color matrix requires more than 1 component

Color requires 3 components otherwise I get: *** glibc detected *** ./PartsBasedDetector: malloc(): memory corruption: 0x0000000001c99960 ***