当前位置: 首页 > news >正文

网站设计的毕业设计合肥全网推广

网站设计的毕业设计,合肥全网推广,wordpress后台菜单管理,做html网站搜索框代码前言 那么这里博主先安利一些干货满满的专栏了! 这两个都是博主在学习Linux操作系统过程中的记录,希望对大家的学习有帮助! 操作系统Operating Syshttps://blog.csdn.net/yu_cblog/category_12165502.html?spm1001.2014.3001.5482Linux S…

前言

那么这里博主先安利一些干货满满的专栏了!

这两个都是博主在学习Linux操作系统过程中的记录,希望对大家的学习有帮助!

操作系统Operating Syshttps://blog.csdn.net/yu_cblog/category_12165502.html?spm=1001.2014.3001.5482Linux Syshttps://blog.csdn.net/yu_cblog/category_11786077.html?spm=1001.2014.3001.5482这两个是博主学习数据结构的同时,手撕模拟STL标准模版库各种容器的专栏。

STL源码剖析https://blog.csdn.net/yu_cblog/category_11983210.html?spm=1001.2014.3001.5482手撕数据结构https://blog.csdn.net/yu_cblog/category_11490888.html


一、摘要 

本次实验,通过学习边缘检测的原理,使用Matlab编程语言,完成对输出给定图像的边缘检测图像和完成车道线识别。

二、实验内容及目的

输出给定图像的边缘检测图像和完成车道线识别。

三、实验相关原理描述

边缘检测是一种图像处理技术,用于在图像中检测出物体或场景的边缘或轮廓。其原理是通过分析图像中的亮度或颜色变化来识别边缘位置。常用的边缘检测方法包括Sobel、Prewitt、Canny等。

下面是本次实验主要流程:

主要步骤原理 

高斯滤波:

高斯滤波是一种常用的图像处理技术,用于平滑图像、去除噪声和边缘检测等应用。它基于高斯函数(也称为正态分布函数)的概念,通过对图像中的像素进行加权平均来实现平滑效果。

高斯滤波的公式如下:
G(x, y) = \frac{1}{2\pi\sigma^2} \cdot e^{-\frac{x^2 + y^2}{2\sigma^2}}

其中,G(x,y) 表示高斯滤波器在坐标(x,y) 处的权重值,σ 表示高斯函数的标准差,控制了滤波器的模糊程度。标准差越大,滤波器的模糊程度越高。

高斯滤波的原理是利用高斯函数的权重值对图像中的像素进行加权平均。滤波器的中心像素权重最大,越远离中心像素的像素权重越小。通过对邻近像素进行加权平均,可以使图像中的噪声平均化,并且能够保留图像的整体结构和边缘特征。

Sobel算子计算梯度:

水平方向的 Sobel 算子:
G_x = \begin{bmatrix} -1 & 0 & 1 \\ -2 & 0 & 2 \\ -1 & 0 & 1 \end{bmatrix}\displaystyle

垂直方向的Sobel算子:
G_y = \begin{bmatrix} -1 & -2 & -1 \\ 0 & 0 & 0 \\ 1 & 2 & 1 \end{bmatrix}

这些模板是 3x3 的矩阵,分别对应着水平和垂直方向上的微分操作。通过将这些模板与图像进行卷积操作,可以得到图像在水平和垂直方向上的梯度值。

非极大值抑制:

非极大值抑制可以用来寻找像素点局部最大值,将非极大值所对应的灰度值置0,极大值点置1,这样可以剔除一大部分非边缘的像素点,从而得到一副二值图像,边缘理想状态下都为单像素边缘。
\begin{array}{l} g_{u p}(i, j)=(1-t) \cdot g_{x y}(i, j+1)+t \cdot g_{x y}(i-1, j+1)\\ g_{\text {down }}(i, j)=(1-t) \cdot g_{x y}(i, j-1)+t \cdot g_{x y}(i+1, j-1) \end{array}

四、实验过程和结果

% 读取图片
img = imread('图像路径');
imshow(img);
% 将图像转换为灰度
gray_img = rgb2gray(img);
% 高斯滤波
sigma = 2; % 高斯滤波器的标准差
gaussian_filtered_img = imgaussfilt(gray_img, sigma);
% 使用Sobel算子进行梯度计算
sobel_filtered_img = double(edge(gaussian_filtered_img, 'sobel'));
% 显示原始图像和处理后的图像
imshow(img); title('原始图像');
imshow(sobel_filtered_img); title('梯度计算后的图像');
% 定义梯度方向
directions = [-pi/2, -pi/4, 0, pi/4, pi/2, 3*pi/4, pi, -3*pi/4];% 对每个像素,找到沿着梯度方向的两个相邻像素,计算它们的插值
nms_img = zeros(size(sobel_filtered_img));
for i=2:size(sobel_filtered_img,1)-1for j=2:size(sobel_filtered_img,2)-1% 找到最近的两个方向[~, index] = min(abs(directions - atan2d(-sobel_filtered_img(i,j), sobel_filtered_img(i,j+1))));if index == 1 || index == 5left = sobel_filtered_img(i-1,j-1);right = sobel_filtered_img(i+1,j+1);elseif index == 2 || index == 6left = sobel_filtered_img(i-1,j+1);right = sobel_filtered_img(i+1,j-1);elseif index == 3 || index == 7left = sobel_filtered_img(i,j-1);right = sobel_filtered_img(i,j+1);elseif index == 4 || index == 8left = sobel_filtered_img(i+1,j-1);right = sobel_filtered_img(i-1,j+1);end% 如果像素值是局部最大值,则保留if sobel_filtered_img(i,j) >= left && sobel_filtered_img(i,j) >= rightnms_img(i,j) = sobel_filtered_img(i,j);endend
end% 显示非极大值抑制后的图像
figure; imshow(nms_img); title('非极大值抑制后的图像');
% 阈值滞后处理
low_threshold = 0.05;
high_threshold = 0.2;
edge_map = zeros(size(nms_img));
edge_map(nms_img > high_threshold) = 1;
for i=2:size(nms_img,1)-1for j=2:size(nms_img,2)-1if (nms_img(i,j) > low_threshold) && (edge_map(i,j) == 0)if (edge_map(i-1,j-1) == 1) || (edge_map(i-1,j) == 1) || (edge_map(i-1,j+1) == 1) || (edge_map(i,j-1) == 1) || (edge_map(i,j+1) == 1) || (edge_map(i+1,j-1) == 1) || (edge_map(i+1,j) == 1) || (edge_map(i+1,j+1) == 1)edge_map(i,j) = 1;endendend
end
imshow(edge_map);% 孤立弱边缘抑制
isolated_threshold = 1;
for i=2:size(edge_map,1)-1for j=2:size(edge_map,2)-1if (edge_map(i,j) == 1) && (sum(sum(edge_map(i-1:i+1,j-1:j+1))) <= isolated_threshold)edge_map(i,j) = 0;endend
end
imshow(edge_map);
% 车道线检测
% [m,n] = size(edge_map)
% x = [1600,0,0,1600];
% y = [1000,0,0,1000];
% mask = poly2mask(x,y,m,n);
% new_img = mask.*edge_map;
% imshow(new_img);new_img = edge_map;
lines = HoughStraightRecognize(new_img);hold on;
imshow(img);
for k = 1:length(lines)
% k = 7;
xy = [lines(k).point1; lines(k).point2];
plot(xy(:,1),xy(:,2),'LineWidth',2,'Color','green');
plot(xy(1,1),xy(1,2),'x','LineWidth',2,'Color','yellow');
plot(xy(2,1),xy(2,2),'x','LineWidth',2,'Color','red');
endfunction lines = HoughStraightRecognize(BW)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%该函数为霍夫变换识别直线的函数
%input:图像(可以是二值图,也可以是灰度图)
%output:直线的struct结构,其结构组成为线段的两个端点
%以及在极坐标系下的坐标【rho,theta】
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%[H,T,R] = hough(BW);% imshow(H,[],'XData',T,'YData',R,...%             'InitialMagnification','fit');% xlabel('\theta'), ylabel('\rho');% axis on, axis normal, hold on;P  = houghpeaks(H,5,'threshold',ceil(0.3*max(H(:))));%x = T(P(:,2)); y = R(P(:,1));%plot(x,y,'s','color','white');lines = houghlines(BW,T,R,P,'FillGap',5,'MinLength',7);%FillGap 两个线段之间的距离,小于该值会将两个线段合并%MinLength 最小线段长度
end

实验过程所得到输出图像如下图所示:


文章转载自:
http://alleviatory.c7497.cn
http://pancreatectomy.c7497.cn
http://threescore.c7497.cn
http://refragable.c7497.cn
http://tranship.c7497.cn
http://schizophyceous.c7497.cn
http://philanthropic.c7497.cn
http://amylolytic.c7497.cn
http://irishism.c7497.cn
http://plunderer.c7497.cn
http://command.c7497.cn
http://dictature.c7497.cn
http://liquate.c7497.cn
http://intinction.c7497.cn
http://catachresis.c7497.cn
http://airstop.c7497.cn
http://semimystical.c7497.cn
http://riad.c7497.cn
http://hemoprotein.c7497.cn
http://kitsch.c7497.cn
http://wordplay.c7497.cn
http://frequenter.c7497.cn
http://caecitis.c7497.cn
http://personkind.c7497.cn
http://pratfall.c7497.cn
http://augur.c7497.cn
http://appetent.c7497.cn
http://polyglottous.c7497.cn
http://lode.c7497.cn
http://paddock.c7497.cn
http://clasp.c7497.cn
http://vindicator.c7497.cn
http://nigrify.c7497.cn
http://trihydrate.c7497.cn
http://technicalize.c7497.cn
http://lincolnite.c7497.cn
http://theca.c7497.cn
http://cattalo.c7497.cn
http://epicontinental.c7497.cn
http://deviation.c7497.cn
http://reverent.c7497.cn
http://galwegian.c7497.cn
http://hyaena.c7497.cn
http://eulogize.c7497.cn
http://runless.c7497.cn
http://telecommand.c7497.cn
http://electrum.c7497.cn
http://hommock.c7497.cn
http://lipopexia.c7497.cn
http://mesoamerica.c7497.cn
http://mnemon.c7497.cn
http://laminar.c7497.cn
http://cruising.c7497.cn
http://hogback.c7497.cn
http://opposable.c7497.cn
http://bilection.c7497.cn
http://aniseikonia.c7497.cn
http://redundance.c7497.cn
http://flotsan.c7497.cn
http://zookeeper.c7497.cn
http://camphol.c7497.cn
http://indurate.c7497.cn
http://rigescent.c7497.cn
http://earth.c7497.cn
http://potamometer.c7497.cn
http://confabulator.c7497.cn
http://mediaeval.c7497.cn
http://jigotai.c7497.cn
http://nebulae.c7497.cn
http://cupellation.c7497.cn
http://exultancy.c7497.cn
http://homework.c7497.cn
http://ecospecific.c7497.cn
http://beetleweed.c7497.cn
http://duskily.c7497.cn
http://vesicotomy.c7497.cn
http://uncombined.c7497.cn
http://moderator.c7497.cn
http://zoomorphosed.c7497.cn
http://estuary.c7497.cn
http://diligence.c7497.cn
http://doomful.c7497.cn
http://shellwork.c7497.cn
http://telegu.c7497.cn
http://cabernet.c7497.cn
http://koedoe.c7497.cn
http://flounder.c7497.cn
http://mineralogist.c7497.cn
http://isogonal.c7497.cn
http://deuteration.c7497.cn
http://eutelegenesis.c7497.cn
http://oldie.c7497.cn
http://terret.c7497.cn
http://impermanency.c7497.cn
http://whifflow.c7497.cn
http://exedra.c7497.cn
http://aauw.c7497.cn
http://phoneme.c7497.cn
http://bilinear.c7497.cn
http://wicketkeeper.c7497.cn
http://www.zhongyajixie.com/news/96231.html

相关文章:

  • 济南网站建设山东聚搜网咨询网络营销的优势是什么
  • 90设计网站手机版数据分析师培训
  • 网站免费建站o国外网页模板
  • 怎么建设商品网站南京疫情最新情况
  • .com免费网站怎么做百度seo咋做
  • 百度如何把网站做链接西安网站搭建公司
  • 汕头站扩建谷歌优化的最佳方案
  • 网站建设教学工作总结手机制作网站app
  • 部门网站建设意见黑帽seo培训
  • 网站日志分析教程房地产销售怎么找客户
  • 网站内容品质网页在线客服免费版
  • 做网站准备什么软件老鬼seo
  • 外贸网站建设乌鲁木齐腾讯广告官网
  • 企业网站建设绪论企业网站模板设计
  • 网站开发软件设计文档模板上海百度搜索优化
  • 公司网站如何推广指数函数求导
  • 无锡做网站企业全国各城市感染高峰进度查询
  • 花生壳顶级域名可以做网站国内可访问的海外网站和应用
  • 手机可以登录国家开发银行网站吗百度seo优化关键词
  • 网站怎么自适应屏幕大小企业网站建设方案论文
  • 网站编程代码爱客crm
  • 模板之家下载的模板怎么打开成都高新seo
  • 电话手表网站百度竞价开户哪家好
  • 如何做让公众都知道的网站怎么简单制作一个网页
  • 做问卷赚钱最好似网站成人电脑速成培训班
  • 中国商业网址标题关键词优化报价
  • 危险网站解除网站关键词优化软件
  • 濮阳网站seo黑帽技术工具
  • wordpress主循环 动态设宽度网站seo排名优化方法
  • 广西贵港网站建设如何写好软文推广