Added pair try-catch writing mask foreground file, changed to png type in testUCV