Ask Your Question

Revision history [back]

size of recoverd image gets increased

I am reading image from this method

        Mat originalImage = Highgui.imread(path);
        byte[] imageInByte = new byte[(int) (originalImage.total() * originalImage.channels())];
        originalImage.get(0, 0, imageInByte);

        TYPE = originalImage.type();
        HEIGHT = originalImage.height();
        WIDTH = originalImage.width();

while recovering image i'm using

    Mat mat = new Mat(HEIGHT, WIDTH , TYPE);
    mat.put(0, 0, bytesArrayForImage);
    String filename = Path;
    Highgui.imwrite(filename, mat);

by using these 2 methods i'm getting image of large size and the difference in between these 2 images which i'm getting is only bit depth i'm not getting how to resolve it

click to hide/show revision 2
retagged

updated 2018-06-23 03:58:16 -0600

berak gravatar image

size of recoverd image gets increased

I am reading image from this method

        Mat originalImage = Highgui.imread(path);
        byte[] imageInByte = new byte[(int) (originalImage.total() * originalImage.channels())];
        originalImage.get(0, 0, imageInByte);

        TYPE = originalImage.type();
        HEIGHT = originalImage.height();
        WIDTH = originalImage.width();

while recovering image i'm using

    Mat mat = new Mat(HEIGHT, WIDTH , TYPE);
    mat.put(0, 0, bytesArrayForImage);
    String filename = Path;
    Highgui.imwrite(filename, mat);

by using these 2 methods i'm getting image of large size and the difference in between these 2 images which i'm getting is only bit depth i'm not getting how to resolve it