Discrete-Cosine-Transform | Calculates the DCT at different frequencies | Data Manipulation library

 by   chalmersgit Python Version: Current License: No License

kandi X-RAY | Discrete-Cosine-Transform Summary

kandi X-RAY | Discrete-Cosine-Transform Summary

Discrete-Cosine-Transform is a Python library typically used in Utilities, Data Manipulation, Pytorch, Numpy applications. Discrete-Cosine-Transform has no bugs, it has no vulnerabilities and it has low support. However Discrete-Cosine-Transform build file is not available. You can download it from GitHub.

Discrete Cosine Transform Author: Andrew Chalmers, 2014. This calculates the DCT at different frequencies in two dimensions. Some packages don't allow you to specify the basis (u,v), but instead sum across the frequencies giving you the final result. Useful applications for specifying a certain basis can be for educational purposes (visualising the basis functions), or if you need to split the bases into a dictionary for learning. I've left this unoptimised for clarity. Resources: Image and video processing: From Mars to Hollywood with a stop at the hospital, lecture 10. By Guillermo Sapiro from Duke University.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              Discrete-Cosine-Transform has a low active ecosystem.
              It has 8 star(s) with 2 fork(s). There are 1 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 0 open issues and 1 have been closed. On average issues are closed in 2 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of Discrete-Cosine-Transform is current.

            kandi-Quality Quality

              Discrete-Cosine-Transform has no bugs reported.

            kandi-Security Security

              Discrete-Cosine-Transform has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              Discrete-Cosine-Transform does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              Discrete-Cosine-Transform releases are not available. You will need to build from source code and install.
              Discrete-Cosine-Transform has no build file. You will be need to create the build yourself to build the component from source.

            Top functions reviewed by kandi - BETA

            kandi has reviewed Discrete-Cosine-Transform and discovered the below as its top functions. This is intended to give you an instant insight into Discrete-Cosine-Transform implemented functionality, and help decide if they suit your requirements.
            • Generate a basis set image
            • Convenience function for the DCT function
            Get all kandi verified functions for this library.

            Discrete-Cosine-Transform Key Features

            No Key Features are available at this moment for Discrete-Cosine-Transform.

            Discrete-Cosine-Transform Examples and Code Snippets

            Compute the DCT operator .
            pythondot img1Lines of Code : 127dot img1License : Non-SPDX (Apache License 2.0)
            copy iconCopy
            def dct(input, type=2, n=None, axis=-1, norm=None, name=None):  # pylint: disable=redefined-builtin
              """Computes the 1D [Discrete Cosine Transform (DCT)][dct] of `input`.
            
              Types I, II, III and IV are supported.
              Type I is implemented using a leng  
            Compute the MDCT curve .
            pythondot img2Lines of Code : 72dot img2License : Non-SPDX (Apache License 2.0)
            copy iconCopy
            def mdct(signals, frame_length, window_fn=window_ops.vorbis_window,
                     pad_end=False, norm=None, name=None):
              """Computes the [Modified Discrete Cosine Transform][mdct] of `signals`.
            
              Implemented with TPU/GPU-compatible ops and supports grad  
            Compute the inverse of dct .
            pythondot img3Lines of Code : 42dot img3License : Non-SPDX (Apache License 2.0)
            copy iconCopy
            def idct(input, type=2, n=None, axis=-1, norm=None, name=None):  # pylint: disable=redefined-builtin
              """Computes the 1D [Inverse Discrete Cosine Transform (DCT)][idct] of `input`.
            
              Currently Types I, II, III, IV are supported. Type III is the inv  

            Community Discussions

            QUESTION

            Image compressing - zigzag after Discrete Cosine Transform
            Asked 2018-Sep-05 at 23:50

            I'm trying to make application which compress image from camera. I have mat image and 3 separate arrays for channels. I've found something about discrete cosine transform DCT and read that I should do zigzag algorithm (I've found something with zigzag here).
            I understand that DCT makes output array but I can't see if zigzag makes one too and where.
            Maybe there is some simple example of zigzag algorithm (or dct with zigzag) with input and output arrays?

            ...

            ANSWER

            Answered 2018-Sep-05 at 23:50

            Images are from this wikipedia article.

            TL,DR: see the bold part below.

            Start with a 2D array of pixel values. There are 64 bytes of information.

            After applying an offset, and computing the DCT, the output is a 2D array of frequency coefficients. So now there are 64 floating point values.

            Here's the key behind how JPEG compression works. The frequency coefficients in the upper left of the array (the low frequencies) are much more important to the image quality than the frequency coefficients in the lower right of the array (the high frequencies).

            So the next step is to apply quantization to the array. The quantization allocates a variable number of bits to each value in the array. Values in the upper left get more bits, and values in the lower right get fewer bits. After quantization, the array looks like this.

            Notice that many of the values in the lower right are now zero. So finally we get to the zigzag, which looks like this:

            The purpose of the zigzag is to convert the 2D array of quantized DCT coefficients into a 1D array, where the first elements come from the upper left, and later elements come from the lower right, of the 2D array. After the zigzag, the array looks like this

            Source https://stackoverflow.com/questions/52193536

            QUESTION

            How to implement a fast 16 point dct
            Asked 2018-Aug-04 at 19:24

            I'm trying to find a way to perform a fast 16 point dct2 and dct3 transform.

            I found some articles like this one talking about how to do this in mathematical theory, but I'm novice when it comes to reading complex math equations, so honestly I can't understand it.

            I searched online for an implementation of a fast 16 point dct, and I found this code generator which outputs code based on your desired DCT parameters.

            I asked it to generate a 16 point dct2 and dct3 with double precision, however the outputs were not mirror images as the inputs when ran through both equations. This was my input:

            ...

            ANSWER

            Answered 2018-Aug-04 at 19:24

            The link you posted to a 2012 paper (https://arxiv.org/pdf/1203.3442.pdf) seems to describe a rather interesting DCT algorithm: It has low computational complexity (32*17 + 255 multiplies for a 16*16 block and 16*5 + 63 for size 8*8) but also a very regular structure, which makes it easy to synthesise a double-sized variant.

            When implementing these things, one should mostly just focus on the butterfly graph: Read from left to right to implement forward (Type II) DCT and from right to left to implement inverse (Type III) DCT. Read text and formulas only when needed to interpret any special symbols in the graph.

            That being said, I tried to implement the 8-point DCT II sub-module using the graph from the paper. In this case, the 8 outputs, starting from top, should be re-defined as X0, X4, X2, X6, X1, X3, X5, X7. The first five seem to be within a constant factor of reference DCT output, but I don't seem to get the bottom 3 right.

            Here's my code that tries to calculate the 8-point transform:

            Source https://stackoverflow.com/questions/51657741

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install Discrete-Cosine-Transform

            You can download it from GitHub.
            You can use Discrete-Cosine-Transform like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/chalmersgit/Discrete-Cosine-Transform.git

          • CLI

            gh repo clone chalmersgit/Discrete-Cosine-Transform

          • sshUrl

            git@github.com:chalmersgit/Discrete-Cosine-Transform.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link