当前位置 : 主页 > 编程语言 > python >

【人民币识别】基于RGB颜色空间实现人民币识别附matlab代码

来源:互联网 收集:自由互联 发布时间:2022-06-15
1 简介 市场上人民币变色油墨受损,其特征表现具有多样性,部分仅仅在表面上进行稍微涂污或摩擦,在灰度值上变化并不明显或处于设定的临界阈值附近。而通过调整每个通道图像的检测



1 简介

市场上人民币变色油墨受损,其特征表现具有多样性,部分仅仅在表面上进行稍微涂污或摩擦,在灰度值上变化并不明显或处于设定的临界阈值附近。而通过调整每个通道图像的检测灰度阈值的方法,固然可以提高检测灵敏度,但是会严重影响正常钞票的通过率,造成大量变色油墨拒钞,所以不能从根本上解决问题。本文针对多光谱图像钞票检测设备,通过RGB色彩空间对变色油墨字符颜色属性的进行量化描述,然后对量化后的颜色值进行逻辑判别,则能大大提高变色油墨受损钞票的检测效果。

2 部分代码

function varargout = rmb(varargin)
% RMB M-file for rmb.fig
% RMB, by itself, creates a new RMB or raises the existing
% singleton*.
%
% H = RMB returns the handle to a new RMB or the handle to
% the existing singleton*.
%
% RMB('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in RMB.M with the given input arguments.
%
% RMB('Property','Value',...) creates a new RMB or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before rmb_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to rmb_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @rmb_OpeningFcn, ...
'gui_OutputFcn', @rmb_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 rmb is made visible.
function rmb_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 rmb (see VARARGIN)
% Choose default command line output for rmb
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes rmb wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = rmb_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;
global out;
out=0;
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
recgnise();
global result;
global l;
global x;
global I6;
global I5;
global out;
out=out+result;
set(handles.text3,'string',out);
set(handles.text9,'string',result);
axes(handles.axes1);
imshow(l);
axes(handles.axes2);
imshow(x);
axes(handles.axes3);
imshow(I6);
axes(handles.axes4);
imshow(I5);
% 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)
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, eventdata, handles)
% 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');
end
% --- Executes during object creation, after setting all properties.
function axes1_CreateFcn(hObject, eventdata, handles)
% hObject handle to axes1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: place code in OpeningFcn to populate axes1

3 仿真结果

【人民币识别】基于RGB颜色空间实现人民币识别附matlab代码_matlab代码

【人民币识别】基于RGB颜色空间实现人民币识别附matlab代码_色彩空间_02

【人民币识别】基于RGB颜色空间实现人民币识别附matlab代码_信号处理_03

【人民币识别】基于RGB颜色空间实现人民币识别附matlab代码_信号处理_04

4 参考文献

[1]崔山领, 王倩文, 徐靖. 一种基于Lab色彩空间的人民币变色油墨检测方法[C]// IT时代周刊论文专版(第317期). 2015.

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。


网友评论