您现在的位置:首页 >> ★免费资源 >> 源码下载 >> 内容

MATLAB代做-python代做-FPGA代做- 图像量化处理

时间:2019-6-24 0:50:06 点击:

  核心提示:MATLAB代做-python代做-FPGA代做- 图像量化处理...
clc;
close all;
clear all;

O=imread('junzhi9.jpg','jpg');
I=rgb2gray(O);
%I saves the gray information of image model.jpg

I_info=size(I);
M=I_info(1); %the width of the image
N=I_info(2); %the height of the image
%I saves the information of image modelgray.jpg

imshow(I);title('original image');
%display original image

I64=floor(I/4)*4+2;
III=double(I);
I6464=double(I64);
I64_mse=sum(sum((III-I6464).^2))/(M*N);
mean64=sum(sum(I64))/(M*N);
mean64_2=mean64*ones(M,N);
I64_2=double(I64)-mean64_2;
sigma2_64=sum(sum((I64_2).^2))./(M*N);
I64_snr=10*log(sigma2_64/I64_mse);
I64_psnr=10*log(255^2/I64_mse);
fprintf('\nLevel=64, MSE/SNR/PSNR are  %f / %f / %f  separately.\n',I64_mse,I64_snr,I64_psnr);
figure;
imshow(I64);title('quantized image with L=64');
%level=64
%display the MSE/SNR/PSNR and the quantized image

I32=floor(I/8)*8;
I32_mse=sum(sum((I-I32).^2))/(M*N);
I32_snr=255^2/I32_mse;
I32_psnr=10*log(I32_snr);
fprintf('\nLevel=32, MSE/SNR/PSNR are  %f / %f / %f  separately.\n',I32_mse,I32_snr,I32_psnr);
figure;
imshow(I32);title('quantized image with L=32');
%level=32
%display the MSE/SNR/PSNR and the quantized image

I16=floor(I/16)*16;
I16_mse=sum(sum((I-I16).^2))/(M*N);
I16_snr=255^2/I16_mse;
I16_psnr=10*log(I16_snr);
fprintf('\nLevel=16, MSE/SNR/PSNR are  %f / %f / %f  separately.\n',I16_mse,I16_snr,I16_psnr);figure;
imshow(I16);title('quantized image with L=16');
%level=16
%display the MSE/SNR/PSNR and the quantized image

I8=floor(I/32)*32;
I8_mse=sum(sum((I-I8).^2))/(M*N);
I8_snr=255^2/I8_mse;
I8_psnr=10*log(I8_snr);
fprintf('\nLevel=08, MSE/SNR/PSNR are  %f / %f / %f  separately.\n',I8_mse,I8_snr,I8_psnr);figure;
imshow(I8);title('quantized image with L=8');
%level=8
%display the MSE/SNR/PSNR and the quantized image

联系:highspeedlogic

QQ :1224848052

微信:HuangL1121

邮箱:1224848052@qq.com

网站:http://www.mat7lab.com/

网站:http://www.hslogic.com/

微信扫一扫:

作者:图像量化处理 来源:图像量化处理
  • 您是如何找到本站的?
  • 百度搜索
  • Google搜索
  • 查阅资料过程中
  • 论坛发现
  • 百度贴吧发现
  • 朋友介绍
本站最新成功开发工程项目案例
相关文章
  • 没有相关文章
相关评论
发表我的评论
  • 大名:
  • 内容:
  • matlab代做|matlab专业代做|matlab淘宝代做(www.hslogic.com) © 2019 版权所有 All Rights Reserved.
  • Email:highspeed_logic@163.com 站长QQ: 1224848052

    专业代做/代写/承接、MATLAB、SIMULINK、FPGA项目、博士/硕士/本科毕业设计、课题设计、论文,毕业论文,Coursework、Eassy、Assignment