zoukankan      html  css  js  c++  java
  • MATLAB:图像的移动(move函数)

    图像移动涉及到move函数,实现过程如下:

    close all;                  %关闭当前所有图形窗口,清空工作空间变量,清除工作空间所有变量
    clear all;
    clc;
    I=imread('lenna.bmp'); %输入图像
    a=50;b=50;%设置平移坐标
    J1=move(I,a,b);%移动原图像
    a=-50;b=50;%设置平移坐标
    J2=move(I,a,b);%移动原图像
    a=50;b=-50;%设置平移坐标
    J3=move(I,a,b);%移动原图像
    a=-50;b=-50;%设置平移坐标
    J4=move(I,a,b);%移动原图像
    set(0,'defaultFigurePosition',[100,100,1000,500]);%修改图形图像位置的默认设置
    set(0,'defaultFigureColor',[1 1 1])%修改图形背景颜色的设置
    figure,
    subplot(1,2,1),imshow(J1),axis on;%绘制移动后图像
    subplot(1,2,2),imshow(J2),axis on;%绘制移动后图像
    figure,
    subplot(1,2,1),imshow(J3),axis on;%绘制移动后图像
    subplot(1,2,2),imshow(J4),axis on;%绘制移动后图像
    

      效果图如下:

  • 相关阅读:
    三大程序结构
    数组
    php多种排序
    购物车多选提交订单
    AJAX无刷新加购物车
    php常用
    通过判断加载遍历首页内容
    登陆权限验证
    PHP打印数据和mb_substr函数
    apollo3.5搭建教程(调试成功)
  • 原文地址:https://www.cnblogs.com/chenwenyan/p/6836312.html
Copyright © 2011-2022 走看看