实验要求:

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. Django Cookie Session和自定义分页

    Django中操作Cookie 获取Cookie request.COOKIES['key'] request.get_signed_cookie(key, default=RAISE_ERROR, ...

  2. 重构代码 —— 函数即变量(Replace temp with Query)

    函数即变量,这里的函数指的是返回值为某一对象的函数.Replace temp with query,query 是一种查询函数. example 1 double price() { return t ...

  3. zookeeper安装搭建

    一  zookeeper介绍 因为要使用kafka,但是不想用kafka自带的,而且考虑到后面别的地方需要使用,比如分布式job,觉得独立的比较好. zookeeper目前资料一大把,但是一是我需要锻 ...

  4. C#进阶之路(四):拉姆达

    对于拉姆达,许多文章都讲过原理及如何使用,所以这篇文章我主要是摘录我学习过的文字,总结下我自己的学习心得. 什么是拉姆达表达式 "Lambda表达式"是一个匿名函数,是一种高效的类 ...

  5. [Wc2009]shortest

    传送门 终于把这题过了,了了我两年前写堵塞的交通一晚上无果的心结 因为是6要注意蛇皮走位啊!!这种-> S //Achen #include<bits/stdc++.h> #defi ...

  6. 统计数字noip2007

    7909:统计数字 总时间限制:  1000ms 内存限制:  65536kB 描述 某次科研调查时得到了n个自然数,每个数均不超过1500000000(1.5*109).已知不相同的数不超过1000 ...

  7. Unity项目UI图片压缩格式(UGUI)

    http://blog.csdn.net/bobodan123/article/details/70316538 UI制作时候使用的是Ps 8位 RGB通道的色彩. 但导出的是16位RGBA色彩的图片 ...

  8. 查看.Net Framework版本号

    目录 摘要 .NET Framework 的版本 确定计算机上安装的 .NET Framework 版本 补充几个查看.Net Framework版本号 概要 本文描述如何确定计算机上安装的 Micr ...

  9. HDOJ4768(二分区间)

    Flyer Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submi ...

  10. Django基础(四)

    Form表单 Admin     Django Form表单 django 中的form 一般有两种功能: 输入html 验证用户输入 1,先写一个form import re from django ...