实验要求:

Zooming and Shrinking Images by Pixel Replication

Objective

To manipulate a technique of zooming and shrinking images by pixel replication.

Main requirements: Ability of programming with C, C++, or Matlab.

Instruction manual:

(a) Write a computer program capable of zooming and shrinking an image by pixel replication. Assume that the desired zoom/shrink factors are integers. You may ignore aliasing effects. You will need to download Fig. 2.19(a).

(b) Download Fig. 2.19 (a) and use your program to shrink the image from 1024 x 1024 to 256 x 256 pixels.

(c) Use your program to zoom the image in (b) back to 1024 x 1024. Explain the reasons for their differences.

实验目的就是通过编程对图像大小进行放大或缩小。

上代码:

%%
clear all;
clc;
close all; %%
% 1024*1024 to 256*256 shrink;
img_name = 'general_img_1024.jpg';
img = imread(img_name); img1 = imresize(img, [256, 256]);
figure(1)
imshow(img);
title('1024 * 1024');
figure(2)
imshow(img1);
title('256 * 256'); imwrite(img1,'general_img_shrinked.jpg'); % 256 * 256 to 1024 * 1024 zoom;
img_name = 'general_img_shrinked.jpg'
img2 = imread(img_name);
img3 = imresize(img, [1024, 1024]); figure(3)
imshow(img3);
title('1024 * 1024'); imwrite(img3,'general_img_zoomed.jpg');

程序中主要调用了MATLAB中的 imresize 这个函数对图像大小进行缩放。

实验结果:

数字图像处理实验(3):PROJECT 02-03, Zooming and Shrinking Images by Pixel Replication 标签: 图像处理matlab 20的更多相关文章

  1. 数字图像处理实验(4):PROJECT 02-04 [Multiple Uses],Zooming and Shrinking Images by Bilinear Interpolation 标签: 图像处理MATLAB

    实验要求: Zooming and Shrinking Images by Bilinear Interpolation Objective To manipulate another techniq ...

  2. 数字图像处理实验(总计23个)汇总 标签: 图像处理MATLAB 2017-05-31 10:30 175人阅读 评论(0)

    以下这些实验中的代码全部是我自己编写调试通过的,到此,最后进行一下汇总. 数字图像处理实验(1):PROJECT 02-01, Image Printing Program Based on Half ...

  3. 02.02.03第3章 餐饮项目案例(Power BI商业智能分析)

    02.02.03第3章 餐饮项目案例 02.02.03.01餐饮数据理解与读入 00:06:12 02.02.03.02餐饮数据处理 00:29:57 处理生成的表为: 02.02.03.03餐饮数据 ...

  4. 数字图像处理实验(10):PROJECT 05-01 [Multiple Uses],Noise Generators 标签: 图像处理MATLAB 2017-05-26 23:36

    实验要求: Objective: To know how to generate noise images with different probability density functions ( ...

  5. 数字图像处理实验(16):PROJECT 06-03,Color Image Enhancement by Histogram Processing 标签: 图像处理MATLAB 2017

    实验要求: Objective: To know how to implement image enhancement for color images by histogram processing ...

  6. 数字图像处理实验(15):PROJECT 06-02,Pseudo-Color Image Processing 标签: 图像处理MATLAB 2017-05-27 20:53

    实验要求: 上面的实验要求中Objective(实验目的)部分是错误的. 然而在我拿到的大纲中就是这么写的,所以请忽视那部分,其余部分是没有问题的. 本实验是使用伪彩色强调突出我们感兴趣的灰度范围,在 ...

  7. 数字图像处理实验(14):PROJECT 06-01,Web-Safe Colors 标签: 图像处理MATLAB 2017-05-27 20:45 116人阅读

    实验要求: Objective: To know what are Web-safe colors, how to generate the RGB components for a given jp ...

  8. 数字图像处理实验(12):PROJECT 05-03,Periodic Noise Reduction Using a Notch Filter 标签: 图像处理MATLAB 2017-0

    实验要求: Objective: To understand the principle of the notch filter and its periodic noise reducing abi ...

  9. 数字图像处理实验(11):PROJECT 05-02,Noise Reduction Using a Median Filter 标签: 图像处理MATLAB 2017-05-26 23:

    实验要求: Objective: To understand the non-linearity of median filtering and its noise suppressing abili ...

随机推荐

  1. (转)libcurl库使用方法,好长,好详细。

    一.ibcurl作为是一个多协议的便于客户端使用的URL传输库,基于C语言,提供C语言的API接口,支持DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP ...

  2. python_判断字符串编码的方法

    1. 安装chardet 在命令行中,进入Python27\Scripts目录,输入以下的命令:easy_install chardet 2. 操作 import chardet f = open(' ...

  3. I.MX6 dts 在哪里、怎么编译

    /************************************************************************ * I.MX6 DTS 在哪里.怎么编译 * 说明: ...

  4. 20181229模拟 T1 palindrome

    20181229模拟 T1 palindrome 题意 : \(S\)是字符串\(s\)的子串可重集,求\(\sum\limits_{x\in S}\sum\limits_{y\in S}(|x|+| ...

  5. JDBC小常识

    1 JDBC连接数据库6步 Load the JDBC Driver Establish the Database Connection Create a Statement Object Execu ...

  6. spring mybatis 多个数据源配置

    mybatis生成器:http://blog.csdn.net/tolcf/article/details/50835165 通过命令生成:java -jar mybatis-generator-co ...

  7. 转载:MongoDB 在 58 同城百亿量级数据下的应用实践

    为什么要使用 MongoDB? MongoDB 这个来源英文单词“humongous”,homongous 这个单词的意思是“巨大的”.“奇大无比的”,从 MongoDB 单词本身可以看出它的目标是提 ...

  8. POJ 1276 Cash Machine(单调队列优化多重背包)

    Cash Machine Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 38986   Accepted: 14186 De ...

  9. 侯捷STL学习(四)--OOP-GP/操作符重载-泛化特化

    C++标准库第二讲 体系结构与内核分析 第1-7节为第一讲 读源代码前的准备 第八节:源代码分布 C++基本语法 模板的使用 数据结构和算法 本课程主要使用:Gnu C 2.9.1与Gun C 4.9 ...

  10. PHP函数(五)-回调函数

    回调函数是指调用函数的时候将另一个函数作为参数传递到调用的函数中,而不是传递一个普通的变量作为参数 使用回调函数是为了可以将一段自己定义的功能传到函数内部使用 声明回调函数的方法 变量函数声明 < ...