mask transform and histeq(using lib from pcv book).