在最后一次的作业中,老师让我们编写一个“绘画系统”,提供一系列绘画材料(例如画笔/颜料/滤镜)给用户操作,以创作出动态/交互的绘画作品。这个绘画系统是对“绘画”的概念的扩展,但仍然体现出与传统绘画系统的相似性。可以理解为:创作一个app,看起来比较像“画画”的工具,但又绝不是复现已知的绘画行为,而要体现出通常绘画出不来的效果(动态、交互性)

一 什么是“绘画”

材料:颜料,画布,画笔等物质要素;

作画者:创作的思想/技法有关的内容;

交互方式:作画者如何操作材料;

作品:即呈现效果。通常的绘画作品。

最开始我设想的是一个很基本的绘画系统,即点击某个按钮在面板上可以进行基础的绘画(画点,线,特殊图形),再细致的区分颜色大小粗细等等。但是又看了一遍作业要求之后,发现并不是要我们完全复刻一个类似于电脑自带的画图软件。在这里的给出我的理解。

材料:可以是基础的颜色,颜料,画笔,更可以是一个已经制作好的物体(比如unity里面的预制件,点击某个按钮可以用脚本生成)或者说已经制作好的作品。

作画者:各种对作品能产生改变的功能(比如添加一个新物体,或者对已经弄好的作品本身进行改变,例如旋转,平移,缩放,或者是色彩的改变)。

交互方式:因为是编程制作,更多的是用鼠标拖拽,点击。

作品:最后的绘画作品。

确定好这些概念之后,我的作业大致方向已经确定了,分为基础版的绘画和加强版(好像也不对)的“绘画”。

基础版:制作一个基本的绘画系统,更多的是体现材料和交互方式。

因为matlab自己有各种绘制函数,所以我决定用matlab制作。

最初的基础版设计界面:

这个就是点击下拉框选择不同的形状和颜色(类似于画笔和颜料)在面板上进行绘画操作(交互),可以清除图形(类似橡皮擦的功能),同时可以保存作品。

具体的形状有:点,线,矩形和椭圆。点的形状有:+,o,*和三角形。具体的颜色有:红,绿,蓝,黑。通过这些比较基本的绘制,我们可以得到一个很基本的绘画作品。

下面是具体的代码(参考别人代码,会给出链接):

function varargout = net1(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...'gui_Singleton',  gui_Singleton, ...'gui_OpeningFcn', @net1_OpeningFcn, ...'gui_OutputFcn',  @net1_OutputFcn, ...'gui_LayoutFcn',  [] , ...'gui_Callback',   []);
if nargin && ischar(varargin{1})gui_State.gui_Callback = str2func(varargin{1});
endif nargout[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
elsegui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT% --- Executes just before net1 is made visible.
function net1_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to net1 (see VARARGIN)% Choose default command line output for net1
handles.output = hObject;
movegui(gcf,'center');
% Update handles structure
guidata(hObject, handles);% UIWAIT makes net1 wait for user response (see UIRESUME)
% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.
function varargout = net1_OutputFcn(hObject, eventdata, handles)
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% Get default command line output from handles structure
varargout{1} = handles.output;% --- Executes on button press in pushbutton1.% --- Executes on mouse press over figure background, over a disabled or
% --- inactive control, or over an axes background.% --- Executes during object creation, after setting all properties.
function figure1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to figure1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns calledglobal flg mark rgb graph;
flg=0;   %f初始鼠标没有按下
graph='点线';
mark='.';
rgb=[1,0,0];
function figure1_WindowButtonDownFcn(hObject, eventdata, handles)
% hObject    handle to figure1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global flg  mark rgb x0 y0 x y rect graph;
flg=1;
set(handles.pushbutton2,'enable','on');
set(handles.pushbutton3,'enable','on');
currPt = get(gca, 'CurrentPoint');
x = currPt(1,1);
y = currPt(1,2);
switch(graph)case '点线'line(x,y, 'marker', mark,'color',rgb);otherwiseline(x,y,'LineStyle',mark,'color',rgb);
end
x0=x;y0=y;
set(handles.edit1,'string',num2str(x));
set(handles.edit2,'string',num2str(y));
set(handles.text3,'string','Mouse down!');% --- Executes on mouse motion over figure - except title and menu.
function figure1_WindowButtonMotionFcn(hObject, eventdata, handles)
% hObject    handle to figure1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global flg mark rgb x0 y0 x y rect graph h;
if flgswitch(graph)case '点线'currPt=get(gca, 'CurrentPoint');x=currPt(1,1);y=currPt(1,2);line(x,y, 'marker', mark,'color',rgb);case '线形'x0=x;y0=y;currPt=get(gca, 'CurrentPoint');x=currPt(1,1);y=currPt(1,2);line([x0 x], [y0,y],'LineStyle',mark,'color',rgb);case '矩形'currPt=get(gca, 'CurrentPoint');x=currPt(1,1);y=currPt(1,2);if x~=x0if ~isempty(h)set(h,'Visible','off')endrect=[min([x0,x]),min([y0,y]),abs(x-x0),abs(y-y0)];if rect(3)*rect(4)~=0h=rectangle('Position',rect,'LineStyle',':');endendcase '椭圆'currPt=get(gca, 'CurrentPoint');x=currPt(1,1);y=currPt(1,2);if x~=x0if ~isempty(h)set(h,'Visible','off')endrect=[min([x0,x]),min([y0,y]),abs(x-x0),abs(y-y0)];if rect(3)*rect(4)~=0h=rectangle('Position',rect,'Curvature',[1,1],'LineStyle',':');endendendset(handles.edit1,'string',num2str(x));set(handles.edit2,'string',num2str(y));set(handles.text3,'string','Mouse is moving!');
endfunction figure1_WindowButtonUpFcn(hObject, eventdata, handles)
% hObject    handle to figure1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global flg rgb mark h graph rect;
flg=0;
switch(graph)case '矩形'set(h,'Visible','off');h=[];if rect(3)*rect(4)~=0rectangle('Position',rect,'edgecolor',rgb,'LineStyle',mark)endcase '椭圆'set(h,'Visible','off');h=[];if rect(3)*rect(4)~=0rectangle('Position',rect,'Curvature',[1,1],'edgecolor',rgb,'LineStyle',mark)end
end
set(handles.text3,'string','Mouse up!');
function edit1_Callback(hObject, eventdata, handles)
% hObject    handle to edit1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit1 as text
%        str2double(get(hObject,'String')) returns contents of edit1 as a double% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, ~, ~)
% hObject    handle to edit1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
endfunction edit2_Callback(~, eventdata, handles)
% hObject    handle to edit2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit2 as text
%        str2double(get(hObject,'String')) returns contents of edit2 as a double% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end% --- Executes when figure1 is resized.
function figure1_ResizeFcn(hObject, eventdata, handles)
% hObject    handle to figure1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% --- Executes on selection change in popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns popupmenu1 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu1
global mark;
str=get(handles.popupmenu1,'string');
index=get(handles.popupmenu1,'value');
str1=char(str(index));
mark=str1(1:2);
% --- Executes during object creation, after setting all properties.
function popupmenu1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end% --- Executes on selection change in popupmenu2.
function popupmenu2_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns popupmenu2 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu2
global rgb;
str=get(handles.popupmenu2,'string');
index=get(handles.popupmenu2,'value');
str1=char(str(index));
switch (str1)case 'red'rgb=[1,0,0];case 'green'rgb=[0,1,0];case 'blue'rgb=[0,0,1];case 'black'rgb=[0,0,0];
end
set(handles.edit1,'foregroundcolor',rgb);
set(handles.edit2,'foregroundcolor',rgb);
set(handles.text3,'foregroundcolor',rgb);
% --- Executes during object creation, after setting all properties.
function popupmenu2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end% --- Executes on mouse press over axes background.
function axes1_ButtonDownFcn(hObject, eventdata, handles)
% hObject    handle to axes1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% set(gcf, 'Interruptible', 'off','BusyAction', 'cancel');
% set(gcf, 'WindowButtonMotionFcn', '','Interruptible', 'off');
cla
set(handles.edit1,'string','');
set(handles.edit2,'string','');
set(handles.text3,'string','');
set(handles.pushbutton2,'enable','off');
set(handles.pushbutton3,'enable','off');
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
[FileName,PathName] = uiputfile({'*.jpg','JPEG(*.jpg)';...'*.bmp','Bitmap(*.bmp)';...'*.gif','GIF(*.gif)';...'*.*',  'All Files (*.*)'},...'Save Picture','Untitled');
if FileName==0return;
elseh=getframe(handles.axes1);imwrite(h.cdata,[PathName,FileName]);
end% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
CleanGlobals;
close(gcf);% --- Executes on selection change in popupmenu3.
function popupmenu3_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns popupmenu3 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu3
global graph flag h mark;
h=[];
str=get(handles.popupmenu3,'string');
index=get(handles.popupmenu3,'value');
graph=char(str(index));
popu={};
switch(graph)case '点线'popu={'. 点';'+ 号';'O 圈';'* 号';'v 三角号'};set(handles.popupmenu1,'string',popu);set(handles.popupmenu1,'value',1);set(handles.text4,'string','选择marker')mark='.';otherwisepopu={'- 实线';'--虚线';': 点线';'-.虚点线';};set(handles.popupmenu1,'string',popu);set(handles.popupmenu1,'value',1);set(handles.text4,'string','选择LineTyple')mark='-';
end
% --- Executes during object creation, after setting all properties.
function popupmenu3_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end%%  清 屏
function CleanGlobals
% Clean up the global workspace
clear global flg mark rgb x0 y0 x y rect graph h;

这个时候因为更细致的看了要求之后,便开始了思维的转变,那么,我是不是可以,对一个已经拥有的作品,通过添加某些材料,或者通过某种方式,让它变得更加绚丽或者拥有动态效果呢?

一旦转变到这个思维,我发现这次的作业与matlab的图像处理有那么一点相同,在matlab里面在gui这里添加材料或者通过技法来创作出不一样的绘画作品。

添加材料:首先想的是添加一个新的作品来进行叠加。

function pushbutton18_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton18 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)I1 = getimage(handles.axes1);[filename,pathname] = uigetfile('*.jpg;*.bmp','选择图片','E:\pictures\For_Project\Matlab');
imgaepath = strcat(pathname,filename);
I2 = imread(imgaepath);I1 = (imresize(I1,[600,800]));
I2 = (imresize(I2,[600,800]));d = 0.5;
C = imlincomb(d,I1,1-d,I2,0);axes(handles.axes1);
imshow(C),title('叠底')

最开始的背景:

要叠加的图像:

最后呈现的效果:

最后的效果感觉还可以(但是其实并没有用多少代码)。

之后我突然想到了,既然万物皆可材料(滑稽),为什么我不能添加音乐呢?,这个想法一出现我就开始找资料了,基于matlab的强大,我很快就弄好了。代码如下(音乐效果太难展示了,但是这个代码也可以在m文件中执行):

播放音乐
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton7 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
[fname,pname]=uigetfile('.wav','选择原始声音文件');
file=[pname,fname];
fs = 8000;
[x,fs] = audioread(file);
sound(x,fs);停止音乐
function stopmusic_Callback(hObject, eventdata, handles)
% hObject    handle to stopmusic (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
clear sound;

因为matlabGUI界面添加多的材料制作的效果不是很好,再加上这个学期我们学了matlab图像处理,所以我更多的方向在于技能(对于已有的作品进行某种操作制作出不同绚丽的效果)上面。(第一张蓝色背景为我创作的基础原图)

首先是图像增强方面:

对比度增加和减少:

a=str2num(get(handles.edit5,'string'));
A=getimage(handles.axes1);
B=A*a;
axes(handles.axes1);
imshow(B);
title('对比度');

效果感觉比之前的还好,所以又对亮度进行了调整。

function pushbutton12_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton12 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
b=str2num(get(handles.edit6,'string'));
A=getimage(handles.axes1);
B=A+b;
axes(handles.axes1);
imshow(B);
title('亮度');

之后对图像进行了假彩色增强(还有其他的增强方法,但是这种效果很绚丽)

function pushbutton13_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton13 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
[RGB]=getimage(handles.axes1);
RGBnew(:,:,1)=RGB(:,:,3);
RGBnew(:,:,2)=RGB(:,:,1);
RGBnew(:,:,3)=RGB(:,:,2);
axes(handles.axes1);
imshow(RGBnew);title('假色彩增强');

以及图像的反色处理。

function pushbutton19_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton19 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
im1=getimage(handles.axes1);
im1 = double(im1);
[r, c, m] = size(im1);
im2 = zeros(r,c,m);
for i=1:m
for j=1:r
for k=1:c
im2(j,k,i)=255-im1(j,k,i); %由最高灰度级减去原坐标位置的灰度级进行反色
end
end
end
im2 = uint8(im2);
axes(handles.axes1);
imshow(im2);
title('图像反色');

这个效果是我觉得最惊艳的。

之后添加了一些其他的风格,

老相册风格:

function pushbutton15_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton15 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
Image=getimage(handles.axes1);
Image=double(Image);
Image_new=Image;
Image_new(:,:,1)=0.393*Image(:,:,1)+0.769*Image(:,:,2)+0.189*Image(:,:,3);
Image_new(:,:,2)=0.349*Image(:,:,1)+0.686*Image(:,:,2)+0.168*Image(:,:,3);
Image_new(:,:,3)=0.272*Image(:,:,1)+0.534*Image(:,:,2)+0.131*Image(:,:,3);
axes(handles.axes1);
imshow(Image_new/255);
title('老照片效果');

渐变效果:

function pushbutton17_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton17 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
Image=getimage(handles.axes1);
Image=double(Image)/255;
size_info=size(Image);
height=size_info(1);
width=size_info(2);  % 设置遮罩层
Map=zeros(height, width);
for i=1:widthMap(:, i)=(1-abs(i*2/width-1))*0.8;
end% 遮罩层与原图相乘
Img_new=Image;
for kk=1:3Img_new(:,:,kk)=Image(:,:,kk).*Map;
end
axes(handles.axes1);
imshow(Img_new);
title('色彩渐变');

之后为了作品具有一定的动态性,我做了三个动画效果。

百叶窗1(因为gif不好制作就贴图了手动滑稽):

function pushbutton6_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton6 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
a=getimage(handles.axes1);[x,y] = size(a(:,:,1));
K = int16(x/4);
for i=1:(x/8)a(i,:,[1,2,3]) = 0;a(i+K,:,[1,2,3]) = 0;a(2*K+i,:,[1,2,3]) = 0;a(3*K+i,:,[1,2,3]) = 0;axes(handles.axes1);imshow(a);title('百叶窗1');pause(0.1);
end

百叶窗2:

function baiyechuang_Callback(hObject, eventdata, handles)
% hObject    handle to baiyechuang (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
image=getimage(handles.axes1);
Image=double(image)/255;
size_info=size(Image);
height=size_info(1);
width=size_info(2);  Map=zeros(height, width);
for row_i=1:heightMap(row_i, :)=1-row_i/height;
endH_shade=10;
Interval=5;Num=height/(H_shade+Interval);
Num=floor(Num);mask=ones(height, width);for j=1:Num+1if(j<=Num)begin_1=1+(j-1)*(H_shade+Interval);mask(begin_1:begin_1+H_shade-1,:)=0;else begin_1=1+Num*(H_shade+Interval);mask(begin_1:height, :)=0;endendfor kk=1:3Image(:,:,kk)=Image(:,:,kk).*(1-mask)+Map.*mask;
end
axes(handles.axes1);imshow(Image);
title('百叶窗2');

最后一个雪花飘落的动态效果(不知道为什么传不了gif只好贴图)

function snow_Callback(hObject, eventdata, handles)
% hObject    handle to snow (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
A=getimage(handles.axes1);%背景图像
h=figure;
imshow(A);   %显示背景图像axes
axis([0 1 0 1]);  %设置坐标范围,并隐藏坐标
axis off;
set(gcf,'color','k'); %设置背景颜色为黑色
%设置显示的雪花数目N=20;
handles=zeros(1,N);
x=rand(2,N);
% fontsize(大)  step 步长
fontsize=floor(rand(1,N)*17+32); %设置字号,32-48之间
new_handles_N=0;
%% 绘图部分
for i=1:Nhandles(i)=text(x(1,i),x(2,i),'*','fontsize',fontsize(i),'color','w');  %handles 存储每一个“雪花”的句柄
end
while 1if ~ishandle(h) return endfor i=1:Ntemp=get(handles(i),'position');step=get(handles(i),'fontsize')/48*0.05;  % 不同大小的雪花,速度不同。if temp(2)<0    %判断是否飘出坐标范围new_handles_N=new_handles_N+1;new_handles(new_handles_N)= copyobj(handles(i),gca);if new_handles_N==500 %扫雪了~\(≧▽≦)/~啦啦啦delete(new_handles);new_handles_N=0;endtemp(1)=rand(1);temp(2)=1;elsetemp(1)=temp(1)+rand(1)*0.1-0.05;temp(2)=temp(2)-step; %速度endset(handles(i),'position',temp,'rotation',get(handles(i),'rotation')+5);endpause(.2)
end

到此为止,整个系统差不多就做完了。下面浅谈一下与传统绘画系统的区别。

技法:传统的绘画更多的是通过画笔来进行操作而创作出真正意义上的绘画作品,这个系统更多的是通过不同的操作来对整体的作品进行改变。

工具;传统的绘画系统则是画笔,橡皮擦,笔刷,颜料填充等等,这个系统基础绘画差不多是这些,加强部分用到的工具则是matlab自带的一些函数。

理念:在开始的时候差不多已经说过了传统绘画是通过画笔来操作颜料进行创作完成作品,我更多则是通过matlab自带的函数操作来操作图片完成不同的图片效果。

创作体验:我觉得非常非常好(做这个的时候),每次有新的风格出来都会觉得很好看。

呈现效果:我觉得基础版和加强版的效果很明显,基础版的效果就像是小时候的简单涂涂画画,加强版的画面更加酷炫。

局限性:我觉得这个系统的局限性更多在于交互体验不是很好(自己matlab学的有点差的可能),传统的绘画系统交互性很好,功能很齐全。

应用:传统绘画更多的可能是制作美术方面的东西(比如sai上面的动漫制作),这个系统更多偏向对于图片的效果处理。

参考资料

matlab实现PS算法之百叶窗、老照片

matlab之PS算法小程序

matlab实现PS算法之渐变

MATLAB GUI实现动态画图曲线的源程序

matlab动态雪花制作

编写一个“绘画系统”相关推荐

  1. 基于P5“尝试开发”一个“绘画系统”

    为了完成大作业,"自愿"开发的"绘画"系统 源代码 因为源代码比较多,所以这里只给出网址: https://editor.p5js.org/Wangshuo/s ...

  2. c语言中如何设计和编写一个应用系统?

    C程序中,如何设计和编写一个应用系统? 一. C语言文件的操作 1. 文件操作的基本方法: C语言将计算机的输入输出设备都看作是文件.例如,键盘文件.屏幕文件等. 向屏幕输出一个信息,例如" ...

  3. ppt编写一个抽奖系统

    本文是用ppt制作一个抽奖系统,点击开始抽取时,屏幕会随机滚动数字,点击停止滚动即显示抽取到的数字. 实现效果,请下载我的作品进行查看:http://download.csdn.net/detail/ ...

  4. 计算机毕业设计中用Java编写一个订餐系统(JAVA SWING)

    一. 开发技术 JDK:JDK1.8,JDK是 Java 语言的软件开发工具包,主要用于移动设备.嵌入式设备上的java应用程序.JDK是整个java开发的核心,它包含了JAVA的运行环境(JVM+J ...

  5. ppt编写一个抽奖系统_PPT小技巧-制作简易抽奖幻灯片

    哈喽,小编最近工作繁忙,一不小心停更了半个多月,不知大家是否想念小编,系统确实是想念了小编哒~归正传,直奔今天的主题,小编来教大家一个简单的制作抽奖的方法,以后有个小活动或者年会的时候就可以小露一手了 ...

  6. c语言编写一个菜单系统_一招教你,轻松解决C语言编写一个正整数的所有因子!...

    这个实例是一个能提高分析能力的实例,这个实例主要用到for语句,关键是如何确定其中变量的范围. 求一个正整数的所有因子 先来看看编程结果演示: 编程演示 输出结果 编程如下: #include /*引 ...

  7. ppt编写一个抽奖系统_自己动手用PPT做个抽奖器

    龙源期刊网 http://www.qikan.com.cn 自己动手用 PPT 做个抽奖器 作者:俞木发 来源:<电脑爱好者> 2017 年第 21 期 喜欢看电视的朋友可能都知道,某电视 ...

  8. 用php编写一个日志系统,php利用单例模式实现日志处理类库

    对于现在的应用程序来说,日志的重要性是不言而喻的.很难想象没有任何日志记录功能的应用程序运行在生产环境中.日志所能提供的功能是多种多样的,包括记录程序运行时产生的错误信息.状态信息.调试信息和执行时间 ...

  9. ppt编写一个抽奖系统_PPT抽奖程序

    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) '参数是长整形(毫秒数).Lib & ...

最新文章

  1. Python(Windows)下安装各种库的多种方法总结--灵活使用pip
  2. Flask模板参数传值的方法
  3. Excel Txt 字符集设置
  4. MFC 强大功能函数
  5. 软件工程过程 - 期末复习
  6. FW:Data Mining UrlScan 3.0 Logs using LogParser 2.2
  7. 电脑前面耳机插孔没声音,后面有声音
  8. RTOS中动态内存和静态内存管理机制
  9. c语言 怎样将数字字符串转化成unicode字符集中的编码值,unicode编码转换
  10. 网页前端学习第五次(HTML)
  11. 让树莓派不再吃灰(Raspberry+Docker+Portainer+青龙面板+甜糖+网心云)
  12. windows远程桌面登录不允许空密码
  13. termux python_【小白教程】Termux实现安卓手机Python编程
  14. 怎么把动图放到word里_word文档如何插入动图?
  15. Ubuntu下adb无法识别android设备的解决方法
  16. 数据库两表联查、多表联查,多重联查
  17. 嵌入式C设计模式---工厂设计模式
  18. magento系统自带批量小结
  19. 5G改变的不仅是网速,还可以改变这些......
  20. 解决Microsoft Office 2010无法打开.doc文件的问题

热门文章

  1. 联合体(union)的使用方法及其本质
  2. 【4745】Two Rabbits
  3. 企业如何查负面和不良事件?
  4. GMS认证送测前自检项小结
  5. OS1和OS2单模光纤的区别
  6. CAD文件版本怎么转换?如何将高版本转换成低版本?
  7. 海康相机html网页源码,海康摄像头 Web3.2_控件
  8. Python Django,模型,模型管理器类(models.Manager)(与数据库交互的接口),自定义模型管理器类
  9. 常用英语食品词汇- 蔬菜类
  10. scanf(%*s)