zoukankan      html  css  js  c++  java
  • 9. matlab图像处理基础——JPEG压缩+类型转换

    1、JPEG压缩

      imwrite(原始图像,目标图像,'quality',比率)

      比率:[0, 100]  值越小,压缩比率越大

    %% JPEG压缩
    I = imread('cameraman.tif');
    % imshow(I);
    imwrite(I,'test.jpg','quality',10);
    J = imread('test.jpg');
    subplot(1,2,1),imshow(I);
    subplot(1,2,2),imshow(J);
    

    2、类型转换

    (1)RGB转灰度

      灰度图像 = rgb2gray(RGB图像)

    %% RGB转灰度
    I = imread('coloredChips.png');
    subplot(1,2,1),imshow(I);
    J = rgb2gray(I);
    subplot(1,2,2),imshow(J);
    

    (2)灰度图像二值化

      二值图像 = imbinarize(灰度图像)

    %% 灰度图像二值化
    I = imread('cameraman.tif');
    subplot(1,2,1),imshow(I);
    J = imbinarize(I);
    subplot(1,2,2),imshow(J);
    

  • 相关阅读:
    matplotlib
    Scipy-数值计算库
    Django Templates
    Django Views: Dynamic Content
    Django Views and URLconfs
    Opencv读写文件
    Logistic回归
    demo
    【Python62--scrapy爬虫框架】
    【Python58--正则2】
  • 原文地址:https://www.cnblogs.com/fengxb1213/p/12879446.html
Copyright © 2011-2022 走看看