一、打靶仿真系统简介

1 课题描述

2 课题建模过程
a)第一,获取武器的各个参数,并且由这些参数计算武器在方向和高低上的响应公算偏差;
b)第二,射击过程中方向和高低上的偏差呈正态分布。在matlab中取normrnd函数实现改功能(其中,标准差为共算误差);
c)第三,根据计算值,在靶上作出击中点:靶子的10环半径是0.75m,9环半径是1.75m,以此类推,6环半径是4.75m,6环之外均记为0环,输出每次射击的成绩;
d)第四,计算总环数、平均环数和命中率,命中率为6环以上占10枪的比例。
三、课题实现出现的关键难点
a)刚开始做的时候入手难
由于上课听课不认真,说实话,一开始做程序没法入手,完全不知道该如何进展。
在这种情况下,我先买了一本参考书,并对参考书中仅有的一个实例进行了试验。虽然是完全照抄,但过程中也碰到了不少麻烦,书中有几个对象的tag前后不一致,使得程序无法运行。看了一下书,仔细琢磨后,修改了程序,并成功运行。在这过程中,开始对程序有所了解。
看完GUI那一章,基本上开始有头绪了,然后就开始选定课题,动手设计界面,进行功能上的分析。
选课题的时候也纠结了一下,最后选择了一个4星的题目,确实是因为时间安排上的问题,因为周末还要上双学位的课,平常有什么课也不舍得翘。
b)程序上碰到的问题
因为选题还是蛮简单的,程序上做下来一直很顺利,做图形的时候温习了书中图形的部分,写回调函数的时候温习matlab程序上的一些特点,因为学过c语言,感觉除了matlab有一些特殊的用法,像脚本文件、函数文件,还有几个流程控制语句,其他的都很相似。程序上很快就能上手。
其中碰到几个想实现的功能,如隐去坐标轴、弹出对话框等几个功能,都是上网搜的,经过试验,最后写到了程序当中。
c)声音的添加
这个算是我碰到的比较大的麻烦,加它的时候还以为自己很有创意呢,后来我发现也有同学加了那个功能,但是我在这个过程中确实遇到了很大麻烦。
先有这个想法的时候在网上搜能不能添加背景音乐,发现可以wavread函数,然后在网上找了一段ak47的枪声,没想到这段枪声折腾了我好久。
当然,我知道只能添加.wav格式的音频文件,下载的这段枪声也是.wav格式的,但是怎么也添加不进去。进行调试的时候,进入到wavread函数中,发现了报错跳出来的地方,但是也看不懂。把那一段复制粘贴之后,发现了百度上的一个问题正是关于它的。里面提到有些.wav格式不是标准的格式,可能不能输入到matlab中。我搜索了.wav的内容,确认了这个想法,并下载了转换格式的软件,将这段音频转了n多遍却还是不行。
最后,也是巧合,我在看网页的时候发现windows自带的录音机能够产生标准.wav格式,这就成了我最后的希望。如果这个再不行,我觉得放弃掉加载声音了。当然,最后是成功了。

二、部分源代码

function varargout = target(varargin)
% TARGET M-file for target.fig
%      TARGET, by itself, creates a new TARGET or raises the existing
%      singleton*.
%
%      H = TARGET returns the handle to a new TARGET or the handle to
%      the existing singleton*.
%
%      TARGET('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in TARGET.M with the given input arguments.
%
%      TARGET('Property','Value',...) creates a new TARGET or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before target_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to target_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES% Edit the above text to modify the response to help target% Last Modified by GUIDE v2.5 08-Jue-2021 23:48:24% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...'gui_Singleton',  gui_Singleton, ...'gui_OpeningFcn', @target_OpeningFcn, ...'gui_OutputFcn',  @target_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 target is made visible.
function target_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 target (see VARARGIN)%画靶子
draw;% Choose default command line output for target
handles.output = hObject;% Update handles structure
guidata(hObject, handles);% UIWAIT makes target wait for user response (see UIRESUME)
% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.
function varargout = target_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 close.
function close_Callback(hObject, eventdata, handles)
% hObject    handle to close (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
close;function uh_input_Callback(hObject, eventdata, handles)
% hObject    handle to uh_input (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 uh_input as text
%        str2double(get(hObject,'String')) returns contents of uh_input as a double% --- Executes during object creation, after setting all properties.
function uh_input_CreateFcn(hObject, eventdata, handles)
% hObject    handle to uh_input (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 vh_input_Callback(hObject, eventdata, handles)
% hObject    handle to vh_input (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 vh_input as text
%        str2double(get(hObject,'String')) returns contents of vh_input as a double% --- Executes during object creation, after setting all properties.
function vh_input_CreateFcn(hObject, eventdata, handles)
% hObject    handle to vh_input (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 vr_input_Callback(hObject, eventdata, handles)
% hObject    handle to vr_input (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 vr_input as text
%        str2double(get(hObject,'String')) returns contents of vr_input as a double% --- Executes during object creation, after setting all properties.
function vr_input_CreateFcn(hObject, eventdata, handles)
% hObject    handle to vr_input (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 ur_input_Callback(hObject, eventdata, handles)
% hObject    handle to ur_input (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 ur_input as text
%        str2double(get(hObject,'String')) returns contents of ur_input as a double% --- Executes during object creation, after setting all properties.
function ur_input_CreateFcn(hObject, eventdata, handles)
% hObject    handle to ur_input (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 ah_input_Callback(hObject, eventdata, handles)
% hObject    handle to ah_input (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 ah_input as text
%        str2double(get(hObject,'String')) returns contents of ah_input as a double% --- Executes during object creation, after setting all properties.
function ah_input_CreateFcn(hObject, eventdata, handles)
% hObject    handle to ah_input (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 ar_input_Callback(hObject, eventdata, handles)
% hObject    handle to ar_input (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 ar_input as text
%        str2double(get(hObject,'String')) returns contents of ar_input as a double% --- Executes during object creation, after setting all properties.
function ar_input_CreateFcn(hObject, eventdata, handles)
% hObject    handle to ar_input (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 bh_input_Callback(hObject, eventdata, handles)
% hObject    handle to bh_input (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 bh_input as text
%        str2double(get(hObject,'String')) returns contents of bh_input as a double% --- Executes during object creation, after setting all properties.
function bh_input_CreateFcn(hObject, eventdata, handles)
% hObject    handle to bh_input (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

三、运行结果

四、matlab版本及参考文献

1 matlab版本
2014a

2 参考文献
[1] 蔡利梅.MATLAB图像处理——理论、算法与实例分析[M].清华大学出版社,2020.
[2]杨丹,赵海滨,龙哲.MATLAB图像处理实例详解[M].清华大学出版社,2013.
[3]周品.MATLAB图像处理与图形用户界面设计[M].清华大学出版社,2013.
[4]刘成龙.精通MATLAB图像处理[M].清华大学出版社,2015.
[5]陈浩,方勇,朱大洲,王成,陈子龙.基于蚁群算法的玉米植株热红外图像边缘检测[J].农机化研究. 2015,37(06)

【图像处理】基于matlab GUI打靶仿真系统【含Matlab源码 1043期】相关推荐

  1. 【雷达通信】基于matlab雷达探测威力仿真【含Matlab源码 1974期】

    一.获取代码方式 获取代码方式1: 完整代码已上传我的资源:[雷达通信]基于matlab雷达探测威力仿真[含Matlab源码 1974期] 点击上面蓝色字体,直接付费下载,即可. 获取代码方式2: 付 ...

  2. 【机械仿真】基于matlab打桩机运动学仿真【含Matlab源码 2101期】

    ⛄一.获取代码方式 获取代码方式1: 完整代码已上传我的资源:[机械仿真]基于matlab打桩机运动学仿真[含Matlab源码 2101期] 点击上面蓝色字体,直接付费下载,即可. 获取代码方式2: ...

  3. 【数学建模】基于matlab动态水波仿真【含Matlab源码 2056期】

    ⛄一.获取代码方式 获取代码方式1: 完整代码已上传我的资源:[数学建模]基于matlab动态水波仿真[含Matlab源码 2056期] 点击上面蓝色字体,直接付费下载,即可. 获取代码方式2: 付费 ...

  4. 【光学】基于matlab GUI杨氏双缝干涉【含Matlab源码 001期】

    一.获取代码方式 获取代码方式1: 完整代码已上传我的资源:[光学]基于matlab GUI杨氏双缝干涉[含Matlab源码 001期] 点击上面蓝色字体,直接付费下载,即可. 获取代码方式2: 付费 ...

  5. [附源码]计算机毕业设计Python+uniapp基于UNIAPP的教师助手系统6w046(程序+源码+LW+远程部署)

    [附源码]计算机毕业设计Python+uniapp基于UNIAPP的教师助手系统6w046(程序+源码+LW+远程部署) 该项目含有源码.文档.程序.数据库.配套开发软件.软件安装教程 项目运行环境配 ...

  6. 基于JAVA药品自动贩卖系统计算机毕业设计源码+系统+数据库+lw文档+部署

    基于JAVA药品自动贩卖系统计算机毕业设计源码+系统+数据库+lw文档+部署 基于JAVA药品自动贩卖系统计算机毕业设计源码+系统+数据库+lw文档+部署 本源码技术栈: 项目架构:B/S架构 开发语 ...

  7. [附源码]计算机毕业设计Python+uniapp基于Android的网店系统i7581(程序+源码+LW+远程部署)

    [附源码]计算机毕业设计Python+uniapp基于Android的网店系统i7581(程序+源码+LW+远程部署) 该项目含有源码.文档.程序.数据库.配套开发软件.软件安装教程 项目运行环境配置 ...

  8. 基于JAVA校园面包超市系统计算机毕业设计源码+系统+数据库+lw文档+部署

    基于JAVA校园面包超市系统计算机毕业设计源码+系统+数据库+lw文档+部署 基于JAVA校园面包超市系统计算机毕业设计源码+系统+数据库+lw文档+部署 本源码技术栈: 项目架构:B/S架构 开发语 ...

  9. 基于JAVA第二课堂选课系统计算机毕业设计源码+系统+lw文档+部署

    基于JAVA第二课堂选课系统计算机毕业设计源码+系统+lw文档+部署 基于JAVA第二课堂选课系统计算机毕业设计源码+系统+lw文档+部署 本源码技术栈: 项目架构:B/S架构 开发语言:Java语言 ...

  10. 基于java点播影院运营系统计算机毕业设计源码+系统+lw文档+mysql数据库+调试部署

    基于java点播影院运营系统计算机毕业设计源码+系统+lw文档+mysql数据库+调试部署 基于java点播影院运营系统计算机毕业设计源码+系统+lw文档+mysql数据库+调试部署 本源码技术栈: ...

最新文章

  1. 错误 Failed to load module “canberra-gtk-module“ 解决方案
  2. hello world的Java代码,Java语言实现hello world代码
  3. [项目总结]在ios中使用soundtouch库实现变声
  4. 怎么在服务器上加端口映射,Windows服务器中命令行添加端口映射
  5. linux一直显示探测文件,如何在Linux中检测文件访问?
  6. k8s相关面试问题_最常被问到的20道Kubernetes面试题
  7. Spring源码之创建AOP代理
  8. echart 地图 某个地区_使用echarts实现自定义区域地图
  9. python多线程刷网站流量(含ip代理池文档,可制作成exe文件挂服务器代刷)
  10. 栅栏密码(Fence crypto)
  11. kindle oasis2 firmware bug汇总
  12. 信息学奥赛一本通(C++版)在线评测系统 基础(一) 第一章 参考答案(AC代码)
  13. 判断变量x是奇数还是偶数
  14. (predicted == labels).sum().item()作用
  15. chrome F12开发者工具 (二)preview 与response的区别
  16. Android-App的设计架构经验谈,系列篇
  17. 计算机win7卡顿如何解决方法,win7电脑玩2D游戏经常发生卡顿六大解决方法
  18. 解决C盘根目录不能创建文件,只能创建文件夹问题
  19. 通过Python自动压缩文件并发送邮件
  20. UNIX基础--Shells

热门文章

  1. iTOP-4412开发板-QtE4.7-UVC 摄像头使用例程
  2. 目标检测方法总结(R-CNN系列)
  3. canvas绘制圆和弧(三)
  4. css学习笔记---盒模型,布局
  5. 利用Minify加速 优化网站性能教程
  6. 求最大公约数---字符串并集---交集代码小结
  7. 在2003上实现Custom Task Pane
  8. seaborn.scatterplot学习
  9. 190405每日一句
  10. Atitit 软件的俩大要点 提升可读性 提升扩展性 目录 1. 命名可读性 1 2. 提升扩展性法 1 3. 项目常见扩展法 2 1.结构可读性 表驱动代替if else 减少层次 Dsl