ImageRGB and matrix shares memory pointer reference