当前位置:网站首页>Edge detection and connection of image segmentation realized by MATLAB
Edge detection and connection of image segmentation realized by MATLAB
2022-07-28 19:50:00 【biyezuopinvip】
Edge detection and connection of image segmentation
One 、 Implementation details
This section is divided into four parts to explain the implementation details , Corresponding to this operation : Three methods of edge detection and edge connection
1.1 Sobel Basic edge detection
Implementation steps

Problems encountered
The selection of threshold needs to be adjusted artificially , Too low threshold makes it difficult to remove noise points , Too high threshold makes the edge discontinuous , The final selection threshold is 30%; Besides , While thresholding , Binarization is necessary , Facilitate the subsequent processing of edge connection .
1.2 Marr-Hildreth Edge detector
Implementation steps
Smooth the image with Gauss low-pass filter
Calculate the Laplace of the result of the previous step
Find the zero crossing of the above results
Problems encountered
On the calculation of zero crossing , It was originally written according to the courseware , Ask up and down 、 about 、 The two diagonally opposite corners have a signed difference greater than the threshold value of zero crossing , But the effect is not ideal , There are many burrs on the edge . Later, I referred to an online blog , See the end of the report for specific links , Improved zero crossing Algorithm : First the 3*3 Area passing 2×2 Of all the 1 Filter convolution , Generate 2×2 Region , Then judge whether the maximum and minimum values in the region have opposite symbols and are greater than the threshold .
1.3 Canny Edge detector

Non maximum inhibition , That is to find the direction closest to the gradient direction , If the current pixel is not the maximum value in the direction, the hysteresis threshold is suppressed , That is, two thresholds are used to divide the pixel set into 2 Partial connectivity analysis , The low threshold set will be denoised , Remove all points that are not connected to the high threshold set , Then merge the two sets
Problems encountered
The writing method of non maximum suppression according to the courseware is to set the non maximum pixels to zero , Considering the efficiency of the actual code , Reverse operation , Because the image is sparse , So first set the whole to zero , If the pixel is the largest , The pixel value is set to 255
1.4 Edge connection method
Implementation steps
Given the binary image and starting point, if the starting point pixel is 0 And end it , Otherwise, add the starting point output For the starting point 8 Neighborhood , If there is a point nearby that has not been visited , And the pixel value of the point is 255, Then add to output The newly added point is the new starting point , Cycle according to paragraph 3 Step by step to find .
When 8 When there is no qualified point in the neighborhood , Stop the cycle . Output output
Problems encountered
It was originally intended to use gradients when judging local similarity , But the effect is not ideal , So simply deal with , That is, find it directly 8 The pixel value in the neighborhood is not 0 Just a few points , Of course, you need to avoid repetition when looking , The essential idea is graph traversal ;
Special treatment is required for boundary conditions , For example, the points on the edges and corners of the whole image cannot be used directly 8 Connectivity , Otherwise, the array is out of bounds ;
Pay attention to the order of coordinate parameter transmission , imtool The parameter order of the function is listed first (x) Again (y). And what we achieved my_edgelinking The order of parameter passing is first (row) Then list (col).
The starting point is to join output after , Do not mark it as arrived , The purpose is to facilitate reaching again in the future and make the boundary become a closed curve
The method of edge detection has the best effect Canny detector , On this basis, continue boundary tracking
Two 、 result
This section is divided into three parts , Introduce the structure of the experiment 、 Experimental results 、 Conclusion analysis
2.1 Experimental setup
code The corresponding frame code in the file edge_test.m、my_edge.m、my_edgelinking.m.
among my_edge The parameters of the function method by 1、2、3 Time corresponds to sobel、Marr-Hildreth、Canny Three methods
asset\image The corresponding picture file in the folder
Run the code directly to view the original image 、 The effect of various edge detection and edge connection , To replace the input image, put the imread Function parameters can be modified .
doc In the folder is the report you are reading
2.2 experimental result
2.2.1 rubberband_cap.png






2.2.2 ayu.jpg





2.2.3 giraffe.jpg





2.2.4 leaf.jpg





2.2.5 noise.jpg





边栏推荐
- WPF 实现带蒙版的 MessageBox 消息提示框
- 云计算笔记part.2——应用管理
- Android-第十三节03xUtils-数据库框架(增删改查)详解
- 彻底理解位运算——与(&)、非(~)、或(|)、异或(^)
- Serial port receiving application ring buffer
- Quickly install torch spark, torch geometric and other packages in moment pool cloud
- 助力面板行业创新,FPGA将成屏厂TCON最佳选择?
- andorid系统layout、values、drawable适配
- Oracle insert数据时字符串中有‘单引号问题
- KPMG China: insights into information technology audit projects of securities fund management institutions
猜你喜欢

并发程序设计,你真的懂吗?

英语文章翻译-英语文章翻译软件-免费批量翻译

How to write the SQL statement of time to date?

Oracle insert数据时字符串中有‘单引号问题

KPMG China: insights into information technology audit projects of securities fund management institutions

Servlet学习笔记

【微信小程序开发】页面导航与传参

Thoroughly understand bit operations - shift left, shift right

11、 学习MySQL UNION 操作符

毕马威中国:证券基金经营机构信息技术审计项目发现洞察
随机推荐
Left alignment function of Lua language (handwriting)
英文翻译西班牙语-批量英文翻译西班牙工具免费
BeanFactory not initialized or already closed - call ‘refresh‘ before accessing beans via the Applic
MySQL8 Status Variables: Internal Temporary Tables and Files
The peak rate exceeds 2gbps! Qualcomm first passed 5g millimeter wave MIMO OTA test in China
Sprint for golden nine and silver ten, stay up at night for half a month, collect 1600 real interview questions from Android post of major manufacturers
Investment of 3.545 billion yuan! Gree Group participates in Xiaomi industry fund
NetCoreAPI操作Excel表格
KPMG China: insights into information technology audit projects of securities fund management institutions
MySQL性能测试工具sysbench学习
stc12c5a60s2功能说明(STC12C5A60S2默认触发)
[网络]跨区域网络的通信学习路由表的工作原理
Rust Getting Started Guide (rustup, cargo)
Rust Getting Started Guide (crite Management)
Basic concept and essence of Architecture
Have you ever seen this kind of dynamic programming -- the stock problem of state machine dynamic programming (Part 2)
Serial port receiving application ring buffer
Redis笔记
App自动化测试是怎么实现H5测试的
Leetcode Day1 score ranking