torch-dct
torch-dct copied to clipboard
These results are different from those with cv2.dft
input image "im_gray" of uint8 and size of [256,256], then i made following operations with opencv and torch-dct, respectively: a = cv2.dct(im_gray.astype("float")) b = torch_dct.dct_2d(torch.from_numpy(im_gray.astype("float"))). But a and b are greatly different.
Are you sure you used the same norm method as in cv2? Try this:
a = cv2.dct(im_gray.astype("float")) b = torch_dct.dct_2d(torch.from_numpy(im_gray.astype("float")), norm='ortho')
I suppose both cv2 and MatLab use the orthogonal factor as default.