added functions with BufferedImage input instead of Mat