当前位置:网站首页>[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
边栏推荐
- SSM整合-前后台协议联调(列表功能、添加功能、添加功能状态处理、修改功能、删除功能)
- Record: writing MySQL commands
- Differential constrained SPFA
- Driveseg: dynamic driving scene segmentation data set
- [leetcode weekly race] game 300 - 6110 Number of incremental paths in the grid graph - difficult
- Record: install MySQL on ubuntu18.04
- What does foo mean in programming?
- 【光学】基于matlab介电常数计算【含Matlab源码 1926期】
- leetcode:11. 盛最多水的容器【雙指針 + 貪心 + 去除最短板】
- Why should the gradient be manually cleared before back propagation in pytorch?
猜你喜欢

Record: writing MySQL commands

leetcode:556. 下一个更大元素 III【模拟 + 尽可能少变更】

NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon

A green plug-in that allows you to stay focused, live and work hard

FBI warning: some people use AI to disguise themselves as others for remote interview

235. 二叉搜索树的最近公共祖先【lca模板 + 找路径相同】

Record: install MySQL on ubuntu18.04

SQL custom collation

application

【光学】基于matlab涡旋光产生【含Matlab源码 1927期】
随机推荐
虚拟机和开发板互Ping问题
Analysis of dart JSON encoder and decoder
达梦数据库的物理备份和还原简解
[combinatorics] dislocation problem (recursive formula | general term formula | derivation process)*
Typescript configuration
The installation path cannot be selected when installing MySQL 8.0.23
东数西算拉动千亿产业,敢啃“硬骨头”的存储厂商才更有机会
Kratos微服务框架下实现CQRS架构模式
Torch learning notes (6) -- logistic regression model (self training)
How can I avoid "div/0!" Errors in Google Docs spreadsheet- How do I avoid the '#DIV/0!' error in Google docs spreadsheet?
Real time split network (continuous update)
Streaming media server (16) -- figure out the difference between live broadcast and on-demand
C enum contains value - C enum contains value
Transformer T5 model read slowly
Ping problem between virtual machine and development board
我眼中真正优秀的CTO长啥样
Caddy server agent
Integrated easy to pay secondary domain name distribution system
A green plug-in that allows you to stay focused, live and work hard
VLAN experiment