Fix error with complex morphology operations on the matrixes with ROI