Closed saikia1 closed 5 years ago
actually there is such a function, but it works directly with image bytes. You can do the following:
`
import cv2 im = cv2.imread('test.img')
from jpeg2dct.numpy import load, loads _, bytes = cv2.imencode('.jpg', im) # these bytes might need a further transform for the right type y, cb, cr = loads(bytes.tostring()) `
For NN training we use data augmentation mostly; the image returned by augmentation function is either a tensor/ndarray; to use DCT based training inputs we will need to save the augmented image to the disk and read again; which is very inefficient.
Can you add one feature to load dct representation using a numpy array (RGB).