0
点赞
收藏
分享

微信扫一扫

毕设【基于Matlab的钢筋计数】GUI,参考文献,源代码

云朵里的佛光 2022-05-02 阅读 80

目前,国内大部分钢厂的钢筋销售模式为成捆定支销售,因而对成捆钢筋计数显得尤为重要,现在许多厂商通过工人手工计数的方式来实现对成捆钢筋的计数,这种计数方法效率不高,同时对工人的要求较高,工作强度也比较大,渐渐已经无法达到现代化钢铁企业快速生产的要求。所以,对成捆钢筋的自动计数已经成为钢材企业有待解决的问题,这不但可以减轻工人的劳动强度,而且还可以提高成捆钢筋计数的精度,具有重要的现实意义。

  本文主要运用对数字图像进行处理的方式来识别成捆钢筋数字端面图像。在文章开始时对钢筋端面数字图像作预处理操作,把彩色图像转变成为灰度图像,对灰度图像做直方图均衡化操作,加强图像对比度,再将已经完成均衡化操作的图像组合滤波,便于后续处理;然后将处理后灰度图像分割,为了解决分割后图像中待识别目标相互分离不明显问题,本文采用一种填充孔洞、腐蚀以及删除小面积相结合的数学形态学算法,完成对大多数待识别钢筋端面图像的相互分离的同时,也去除了绝大多数背景和噪声;最后运用连通区域标记法,按照八连通区域准则扫描图像,提取出连通域面积及相关参数,利用面积与面积率综合计数法,完成对连通区域的识别及计数,从而达到对成捆钢筋计数的目的。

GUI界面


 

运行过程

 

 

  运行结果

function varargout = count(varargin)

% 按键:  载入图片---滤波---lab空间转换
%  kmenas聚类---腐蚀—杂块去除—膨胀—去除小块—
% 填补空洞—再腐蚀—扣出原图—OTSU—分水岭 ---计数

% COUNT MATLAB code for count.fig
%      COUNT, by itself, creates a new COUNT or raises the existing
%      singleton*.
%
%      H = COUNT returns the handle to a new COUNT or the handle to
%      the existing singleton*.
%
%      COUNT('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in COUNT.M with the given input arguments.
%
%      COUNT('Property','Value',...) creates a new COUNT or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before count_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to count_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 count

% Last Modified by GUIDE v2.5 17-Mar-2019 13:39:27

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @count_OpeningFcn, ...
                   'gui_OutputFcn',  @count_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 count is made visible.
function count_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 count (see VARARGIN)

% Choose default command line output for count
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

 

代码具体细节联系QQ:1747511994

  

举报

相关推荐

0 条评论