虫虫首页| 资源下载| 资源专辑| 精品软件
登录| 注册

您现在的位置是:虫虫下载站 > 资源下载 > 技术资料 > JPEG压缩matlab源码

JPEG压缩matlab源码

  • 资源大小:57 K
  • 上传时间: 2024-10-16
  • 上传用户:trh505
  • 资源积分:2 下载积分
  • 标      签: matlab JPEG 压缩

资 源 简 介

JPEG压缩解压缩的matlab源代码: 1) take an image (2D matrix) and devide it to 8x8 matrices 2) for each matrix (8x8) use the DCT conversion (from the signal processing toolbox). you will get an (8x8) matrix as an answer 3) build an 8x8 matrix, which is the sum off all the matrices, such that sum_matrix = A + B + C + ... 4) sort elements of the 8x8 matrix from the highest to the smallest and get the indices list. 5) sum the last matrix with part of the elements which have the higher coefficients, until you have a sufficient ratio (lets say 80%). for example : idx = sort( sum_matrix (:) ); part_of_energy = sum_matrix(idx(1:20)); all_energy = sum_matrix(:); ratio = part_of_energy/all_energy; 6) save the partial list of indices, number of matrices (rows,lines) and from each matrix from step (2) save ONLY these coefficients (remember the order you save them)

相 关 资 源