/DiscreteCosineTransformation

A numpy & pytorch deployment of 2D DiscreteCosineTransformation (DCT)

Primary LanguagePython

Discrete Cosine Transformation

We release the codes of 2D DCT with Numpy and PyTorch.

Our deployment can process a batch of square images with [B, N, N] shape, rather than process image one by one.

Examples

  • Original mask images:

image image

  • transformed by cv2.dct:

image image

  • transformed by our Numpy deployment:

image image

  • transformed by our PyTorch deployment:

image image

  • Recover by cv2.idct:

image image

  • Recover by our Numpy deployment:

image image

  • Recover by our PyTorch deployment:

image image