当前位置:网站首页>[disease identification] machine vision lung cancer detection system based on Matlab GUI [including Matlab source code 1922]
[disease identification] machine vision lung cancer detection system based on Matlab GUI [including Matlab source code 1922]
2022-07-03 19:02:00 【Poseidon light】
One 、 Introduction to machine vision recognition
Color is an inherent feature of the surface of an object , It plays an irreplaceable role in target recognition and image segmentation . Machine vision is to use photoelectric imaging system and image processing module to size objects 、 shape 、 Identification of color, etc . such , Take the rapidity of the computer 、 Repeatability , Combined with the highly intelligent and abstract ability of human vision , Use machines instead of human eyes to make various measurements and judgments , Greatly improve the flexibility and automation of production . The most suitable color space for display system in image processing is RGB Color space , But it's R、G、B3 The components are highly correlated , Threshold selection is difficult , This paper presents an image segmentation and recognition method with stable color space , And applied to automatic production line , Achieve good results .
1 System structure
The structure of machine vision system is shown in the figure 1 Shown .
In machine vision system , From obtaining image data to finally obtaining processing results , There are usually many algorithms . meanwhile , Machine vision systems for different purposes require different operations on images . The input of machine vision system is image , The final output is some symbols or values , These symbols or values , It is possible to express the characteristics of objects ( Quality goods / Defective product , Arabic numerals, etc ) And location ( Position of IC pins, etc ) .
2.1 Image smoothing
The collected images often have noise interference , Image smoothing is conducive to improving image quality [, This paper adopts adaptive median filtering algorithm . set up Sx, y Represents the center point (x, y) Mask window at a given time . set up Zmin by Sx, y The maximum value of medium gray level ;Zmed by Sx, y Medium gray level median ;Zmax by Sx, y Maximum value of medium gray level ;Zx, y For pixels (x, y) The gray level of ;Smax by Sx, y Maximum allowable size . The adaptive median filter algorithm is :
A Layer algorithm
If A1>0&A2>0 go to B layer . otherwise , Increase the window size .
If the window size ≤Smax repeat A layer . Otherwise output Zx, y.
B Layer algorithm
If A1>0&A2>0, Output Zx, y. Otherwise output Zmed.
2.2 Color model conversion
The image collected by the device is RGB Model , In order to avoid the system misjudgment caused by the color difference or color distortion caused by the interaction of three quantities when the computer processes the image , Need to be converted to HSI Model , In this paper, geometric derivation is used RGB-HSI transformation , take RGB The brightness factor in carries out the double cone transformation of cylindrical polar coordinates , Change 3D to 2D , Find HSI The hue component value of the model .
The conversion formula is as follows :
among :H Define the wavelength of the color , Called hue ;S Indicates the depth of the color , Called saturation ;I Indicates intensity or brightness .
2.3 Object recognition
Threshold color image segmentation
The objects photographed in the machine vision system of the production line are illuminated 、 Noise and other environmental impacts , The color of the collected object image will be different from the actual color , There will also be some color differences between objects , Different parts of the same object may also have color differences , To accurately identify objects , We need to judge the color similarity of adjacent areas through image segmentation [7]. Threshold method image segmentation needs to select the appropriate threshold , Compare the image color features obtained by the computer after color model transformation with the set threshold , To distinguish between artifacts and backgrounds .
f (x, y) Image color features collected for computer ;T For the set threshold . If you binarize the image , be b0 by 0, b1 by 1. This method is more suitable when the recognized object is a single color .
Two 、 Partial source code
function varargout = cancer(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @cancer_OpeningFcn, ...
'gui_OutputFcn', @cancer_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
function cancer_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
guidata(hObject, handles);
function varargout = cancer_OutputFcn(hObject, eventdata, handles)
varargout{
1} = handles.output;
function pushbutton1_Callback(hObject, eventdata, handles)
global I
clc
[filename, pathname] = uigetfile('*.jpg', 'Pick an Image');
if isequal(filename,0) | isequal(pathname,0)
warndlg('File is not selected');
else
I=imread(filename);
axes(handles.axes1)
imshow(I);
title 'Input Image'
end
title ' Input lung image '
function pushbutton2_Callback(hObject, eventdata, handles)
global I
t=rgb2gray(I);
he=histeq(t);
axes(handles.axes2);
imshow(he);
title ' Histogram equalization '
function pushbutton3_Callback(hObject, eventdata, handles)
global I
t=rgb2gray(I);
he=histeq(t);
threshold = graythresh(he);
bw = im2bw(he,threshold);
3、 ... and 、 Running results
Four 、matlab Edition and references
1 matlab edition
2014a
2 reference
[1] Cai Limei .MATLAB The image processing —— theory 、 Algorithm and example analysis [M]. tsinghua university press ,2020.
[2] Yang Dan , Zhao Haibin , Long Zhe .MATLAB Detailed explanation of image processing examples [M]. tsinghua university press ,2013.
[3] Zhou pin .MATLAB Image processing and graphical user interface design [M]. tsinghua university press ,2013.
[4] Liu Chenglong . Master MATLAB The image processing [M]. tsinghua university press ,2015.
3 remarks
This part of the introduction is taken from the Internet , For reference only , If infringement , Contact deletion
边栏推荐
- Add control at the top of compose lazycolumn
- 22.2.14 -- station B login with code -for circular list form - 'no attribute' - 'needs to be in path selenium screenshot deviation -crop clipping error -bytesio(), etc
- 【光学】基于matlab介电常数计算【含Matlab源码 1926期】
- Raft log replication
- What does a really excellent CTO look like in my eyes
- Leetcode: 11. Récipient contenant le plus d'eau [double pointeur + cupidité + enlèvement de la plaque la plus courte]
- 东数西算拉动千亿产业,敢啃“硬骨头”的存储厂商才更有机会
- Transformer T5 model read slowly
- EGO Planner代码解析bspline_optimizer部分(3)
- 【光学】基于matlab涡旋光产生【含Matlab源码 1927期】
猜你喜欢
Streaming media server (16) -- figure out the difference between live broadcast and on-demand
SQL: special update operation
Pan for in-depth understanding of the attention mechanism in CV
[combinatorics] dislocation problem (recursive formula | general term formula | derivation process)*
平淡的生活里除了有扎破皮肤的刺,还有那些原本让你魂牵梦绕的诗与远方
How to read the source code [debug and observe the source code]
In addition to the prickles that pierce your skin, there are poems and distant places that originally haunt you in plain life
【疾病识别】基于matlab GUI机器视觉肺癌检测系统【含Matlab源码 1922期】
【LeetCode】【SQL】刷题笔记
Torch learning notes (7) -- take lenet as an example for dataload operation (detailed explanation + reserve knowledge supplement)
随机推荐
Nous avons fait une plateforme intelligente de règlement de détail
Kratos微服务框架下实现CQRS架构模式
Webrtc[41] - Analysis of the establishment process of webrtc transmission channel
Scrape crawler framework
Differential constrained SPFA
Help change the socket position of PCB part
How can I avoid "div/0!" Errors in Google Docs spreadsheet- How do I avoid the '#DIV/0!' error in Google docs spreadsheet?
Suffix derivation based on query object fields
Pytorch introduction to deep learning practice notes 13- advanced chapter of cyclic neural network - Classification
Smart wax therapy machine based on STM32 and smart cloud
235. 二叉搜索樹的最近公共祖先【lca模板 + 找路徑相同】
Briefly describe the quantitative analysis system of services
Processing of user input parameters in shell script
【LeetCode】【SQL】刷题笔记
Ping problem between virtual machine and development board
leetcode:11. 盛最多水的容器【雙指針 + 貪心 + 去除最短板】
Sqlalchemy - subquery in a where clause - Sqlalchemy - subquery in a where clause
SSM整合-前后台协议联调(列表功能、添加功能、添加功能状态处理、修改功能、删除功能)
CV in transformer learning notes (continuously updated)
Torch learning notes (5) -- autograd