java - DCT implementation -


I am trying to implement image compression algorithm based on DCT for JPEG color. I'm a newbie in image processing, so I need some help. I need clarification of algorithm.

I am using DCT implementation

Therefore, there is an algorithm as I understood it:

  1. Using ImageIO in BufferedImage Load an image.
  2. Create 3 metrics (1: red, green, blue for each channel):

      int rgb = bufferedImage. GetRGB (i, j); Int red = (RGB => 16) & amp; 0xFF; int green = (RGB => 8) & amp; 0xFF; Int blue = RGB & amp; 0xFF; Increase the matrix in size so that they can split into 8x8 part (where is the size of 8 dct matrix, n)   
  3. For each matrix, divide it into 8x8 size segment (the result : SplittedImage)
  4. Perform matrix on splittedImage (result: dctImage).
  5. Matrix from dctImage (result: quantizedImage)

    Here I do not know what to do:

    • Merge the quantizedImage matrix in the matrix merged image, convert it to vector and apply the short impression method.
    • Convert the small matrices to vector from quantizedImage and compress them on the compressImage method, and then take them into a matrix

      Then, here I see red, green and blue Match 3 metrics for color. Compared to using the new buffer image and method set RGB to convert those matrix into one RGB matrix and set the pixel values. Then save the image to save the file.

      Additional question:

      1. Is it better to convert RGB to YCBCR and DCT on Y, CB and CR?
      2. Javadok of Compact Imag method says that this is not a word encoding, but if run-length encoding, then will the image viewer's compressed image be opened? Or should I use Huffman encoding according to the JFEGE specification, and whether there is an open source encoding encoding in Java?

        If you want to follow the implementation steps, I suggest reading

        In relation to your questions:

        1) JPEG does not know anything about the standard color space and you do not care whether you Use RGB or YCBCR, or CMYK. There are many JPEG file formats (e.g., JFIF, XIF, ADOBE) that specify color spaces - usually YCBCR.

        The reason for using YCBCCR is that if the JPEG trend of focused information is more useful information in the Y component compared to CB or CR components. Using YCbCr, you can sample 4 YS for every and every CB ever for CB and CR (or 16). This reduces the amount of data to 1/2.

        Note that JPEG file formats specify the limitations of sampling (JPEG, 2: 3 allows sampling, while most do not implement).

        2) If DCT coefficient are encoded, Huffman (or arithmetic) is encoded. You have to use both.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -