【图像处理】打靶仿真系统【含GUI Matlab源码 1043期】

news2024/9/29 19:18:46

⛄一、打靶仿真系统简介

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});
end

if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_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’);
end

function 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’);
end

function 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’);
end

function 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’);
end

function 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’);
end

function 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’);
end

function 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]魏丽芬,陈文印.军事打靶虚拟仿真系统开发研究[J].福建电脑. 2022,38(11)

3 备注
简介此部分摘自互联网,仅供参考,若侵权,联系删除

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/96497.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

《C语言深度解剖》二 static

最名不副实的关键字 static 认识多文件如下 extern 需要extern先声明在使用 生命没有开辟空间!100 在main.c里 所有的变量声明的时候,不能设置初始值 为什么要有头文件 头文件要包含 变量的声明int g_val 函数的声明void show(),没有函数的声明虽然可…

CentOS7配置VNC远程桌面

桌面还是有很多方便的地方,在用U盘给电脑安装了centos7(带gnome)后,接着就需要弄远程桌面。 (1)安装vncserver yum -y install tigervnc* (2)启动vnc服务 vncserver &#xff0…

[paddledet][深度学习][原创]paddledet打印出FLops正确方法

第一步:去PaddleDetection\configs\runtime.yaml将print_flops设置true 在paddle环境安装paddleslim,我是paddlepaddle-gpu2.3.2但是我安装paddleslim2.4.0会报错 ImportError: cannot import name _legacy_C_ops from paddle 然后我换成2.3.4版本就好了…

第二十六天:Denoising Diffusion Probabilistic Models(DDPM)

摘要 我们使用扩散概率模型提出了高质量的图像合成结果,这是一类latent variable模型,灵感来自非平衡热力学。我们最好的结果是通过训练weighted variational bound ,根据新颖的连接扩散概率模型和去噪分数匹配朗之万动力学进行设计&#xf…

【记录】props和data响应式、watch初始化..谁先执行【Vue父子组件生命执行周期】

文章目录一 、 总结1-1 源码中清楚写明:1-2二、 本次遇到的问题: 父传子props,子组件无法在mounted处理2-1 代码如下2-2一 、 总结 1-1 源码中清楚写明: 1、 组件初始化的时候,created,props,data…执行先…

生物素-二硫键-琥珀酰亚胺酯 Biotin-SS-NHS CAS:142439-92-7 具有良好的水溶性

名称:生物素-二硫键-琥珀酰亚胺酯 英文简称:BIOTIN-SS-NHS;NHS-SS-Biotin CAS:122266-55-1 结构式: Biotin-SS-NHS ester结构式 分子式:C19H28N4O6S3 分子量:504.64 纯度:95% …

Python之threading: 带你了解多线程的强大威力!

前言 什么是多线程 多线程是指在一个程序中同时创建和使用多个执行流(thread)来执行不同的任务。这样多个任务就可以同时进行,从而提高程序的执行效率。 在python使用多线程的方法 在 Python 中有两种方法可以使用多线程:使用 Python 自带的 threadin…

Redis Java 客户端工具 - Lettuce框架介绍

Redis Java 客户端 - Lettuce 今天学习下Redis Java客户端开源项目 - Lettuce&#xff0c;Lettuce支持同步、异步通信的方式 API调用&#xff0c;也支持响应式编程API&#xff0c;包括发布/订阅消息、高可用性服务部署架构。 开始之旅 Maven依赖 <dependency><gro…

Python实现SSH远程操作Linux(paramiko库)

参考&#xff1a;https://blog.csdn.net/qq_40558166/article/details/100172501 一、官网 https://www.paramiko.org/ 二、安装库 1.命令 pip install paramiko 或 pip install paramiko –i https://pypi.douban.com/simple/ 三、辅助软件(可忽略) 1.Xshell(执行命令) …

[附源码]Node.js计算机毕业设计黑格伯爵国际英语贵族学校官网Express

项目运行 环境配置&#xff1a; Node.js最新版 Vscode Mysql5.7 HBuilderXNavicat11Vue。 项目技术&#xff1a; Express框架 Node.js Vue 等等组成&#xff0c;B/S模式 Vscode管理前后端分离等等。 环境需要 1.运行环境&#xff1a;最好是Nodejs最新版&#xff0c;我…

Ubuntu 配置本地root登录

Ubuntu 配置本地root登录–18.04 给root用户设置密码 按照下图方式 命令&#xff1a;sudo passwd root 切换到root用户 使用 su 或者是 su root 切换到 root 修改配置文件 进入该目录&#xff1a; cd /usr/share/lightdm/lightdm.conf.d/ 查看文件 ls 使用gedit 编辑文…

Arduino UNO新手零基础入门学习博客汇总

写在开头 最近在上Arduino的课&#xff0c;可以说Arduino对新手来说非常友好了&#xff0c;因为相比于51和32&#xff0c;Arduino的库函数下载就好&#xff0c;不需要自己去写&#xff0c;就很方便 我的硬件设备 博客汇总 博客内容大多数以实际案例为主&#xff0c;基本都是…

机器学习100天(七):007 简单线性回归理论

机器学习100天,今天讲的是简单线性回归理论。 首先来看第一个问题:什么是线性回归?我们先引入一个例子。 假如我现在有一份数据,这份数据是一些地区人口和对应房价的信息。我们把这份数据展示在二维平面上。横坐标是人口,纵坐标是房价,红色的点就表示每个地区的实际人口…

论文精读:EfficientDet: Scalable and Efficient Object Detection

Abstract 首先&#xff0c;本篇论文提出了一种加权双向特征金字塔网络&#xff08;BiFPN&#xff09;&#xff0c;进行简单、快速的多尺度特征融合&#xff1b;其次&#xff0c;作者提出了一种复合尺度方法&#xff0c;同时统一调整所有主干、特征网络和box/类别预测网络的分辨…

kali linux的安装教程

kali linux的安装教程 在网上输入网址https://www.kali.org/get-kali/#kali-virtual-machines。 向下滚动鼠标滑轮选择如下图所示的图标进行安装iso镜像文件。 我们打开虚拟机&#xff0c;选择创建新的虚拟机 选择其中的自定义&#xff0c;随即点击下一步 点击下一步 点击下一步…

uboot通过bootargs传递内核中的模块传递参数

前言 bootargs是uboot向内核传递参数时使用的&#xff0c;本次我们要验证的是bootargs向内核启动后加载的模块传递的参数&#xff0c;真正的跨过山和大海。跟着我的脚步&#xff0c;来一次bootargs之旅。 这是一个综合性&#xff0c;系统性很强的实例验证&#xff0c;要做这个…

模式识别-期末复习题(问题集锦)

1.什么是模式&#xff1f;监督模式识别和非监督模式识别的典型过程分别是什么&#xff1f; 模式&#xff1a;指需要识别且可测量的对象的描述 监督模式识别&#xff1a;分析问题→原始特征提取→特征提取与选择→分类器设计 非监督模式识别&#xff1a;分析问题→原始特征提…

C++ Reference: Standard C++ Library reference: Containers: map: map: insert

C官网参考链接&#xff1a;https://cplusplus.com/reference/map/map/insert/ 公有成员函数 <map> std::map::insert C98 single element (1) pair<iterator,bool> insert (const value_type& val); with hint (2) iterator insert (iterator positio…

【密码学】MD5、UUID,加盐,JWT的理解与使用范例

文章目录MD5加密&#xff1a;1、MD5加密安全访问认证示例代码&#xff1a;2、UUID简介&#xff1a;使用&#xff1a;3、加盐原理&#xff1a;示例代码&#xff1a;4、jwt认知&#xff1a;JWT 结构&#xff1a;范例代码&#xff1a;MD5加密&#xff1a; 1、MD5加密 Message Di…

计算机毕业设计springboot+vue基本微信小程序的疫情防控平台系统

项目介绍 当今社会疫情防控平台是必不可少的,大家都在听从政府的号召在居家隔离,不管是在城市还是在乡镇、农村,这引起我的注目,设计一套社区疫情防控系统,疫情防控需要大家共同努力、团结对社区居民进行了新型冠状病毒肺炎防控知识普及和宣传教育。针对这一需求,本文设计并实现…