MATLAB图像处理学习(2)——点、线检测

z是与掩模系数相关的像素亮度
z是与掩模系数相关的像素亮度

1、点检测
(1)|R|>=T,则可说在掩模的中心位置已检测出了一个孤立的点。T为非负阈值。MATLAB中用imfilter实现。
对掩模的要求是。当掩模的中心位于一个孤立点时,掩模的响应必须最强,而在亮度不变的区域中响应为零。
在这里插入图片描述
(2)点检测的另一种方法是在所有大小为m x n的邻域中找到最大和最小像素值的差超过t的指定值的点。

2、线检测
令R1、R2、R3、R4表示下图中掩模从左到右的响应,其中R由上面的方程给出。假设这四个掩码分别在图像中运行。如果在图像中的某一点,|Ri|>|RjI,对任意的不等于i的j成立,该点更有可能与掩码i方向上的一条线相关联。
对特定的方向感兴趣,可使用与该方向相关联的掩码,并对其输出设置阈值。若对给定掩模定义的方向的所有线感兴趣,可对图像运行掩模并对结果的绝对值做阈值处理。剩下的点是响应最强烈的那些点,这些点与掩模定义方向最为接近,且组成了只有一个像素宽的线。
在这里插入图片描述

  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
function GRABIT Extracts data points from an image file. % % GRABIT starts a GUI program for extracting data from an image file. % It is capable of reading in BMP, JPG, TIF, GIF, and PNG files (anything % that is readable by IMREAD). Multiple data sets can be extracted from a % single image file, and the data is saved as an n-by-2 matrix variable in % the workspace. It can also be renamed and saved as a MAT file. % % Following steps should be taken: % 1. Load the image file. % 2. Calibrate axes dimensions. You will be prompted to select 4 points % on the image. Zoom and pan enabled. % 3. Grab points by clicking on points. Right-click to delete a point. % Image can be zoomed and panned. % 4. Multiple data sets will remain in memory so long as the GUI is open. % Variables can be renamed, saved to file, or edited in Array Editor. % % Panning is achieved by clicking and dragging on the image. Double-click % to center view. Right click and drag to zoom in and out. In addition, % there are keyboard shortcuts for zooming: % - zoom in % - zoom out % - reset view % % This code will also work for extracting data points from a tilted or a % skewed image (even upside-down or mirrored). The calibration stage % ensures that the imperfect orientation or quality of the image is % accounted for. % % The types of files that will most likely work are BMP, JPG, TIF, GIF (up % to 8-bit), and PNG files. Basically, any format supported by the IMREAD % is accepted. % % GRABIT(FILENAME) will start the GUI program and open the image file % FILENAME.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值