国产aaaa级全身裸体精油片_337p人体粉嫩久久久红粉影视_一区中文字幕在线观看_国产亚洲精品一区二区_欧美裸体男粗大1609_午夜亚洲激情电影av_黄色小说入口_日本精品久久久久中文字幕_少妇思春三a级_亚洲视频自拍偷拍

首頁 > 化工知識(shí) > 【圖像檢測(cè)】基于區(qū)域生長算法實(shí)現(xiàn)對(duì)焊接孔隙檢測(cè)matlab代碼

【圖像檢測(cè)】基于區(qū)域生長算法實(shí)現(xiàn)對(duì)焊接孔隙檢測(cè)matlab代碼

時(shí)間:2021-12-11 來源: 瀏覽:

【圖像檢測(cè)】基于區(qū)域生長算法實(shí)現(xiàn)對(duì)焊接孔隙檢測(cè)matlab代碼

原創(chuàng) 天天Matlab 天天Matlab
天天Matlab

TT_Matlab

每天分享一點(diǎn)Matlab資料,一起成長進(jìn)步。需要定制程序添加qq1575304183

收錄于話題 #圖像處理matlab源碼 286個(gè) 內(nèi)容

1 簡介

本文采用區(qū)域生長算法對(duì)焊縫缺陷進(jìn)行有效分割.該算法沿承傳統(tǒng)區(qū)域生長算法的思想,主要依據(jù)邊緣灰度突變的信息,在焊縫區(qū)域,先定位出所有可能的種子點(diǎn)并確定行方向上缺陷的邊緣位置,再取對(duì)應(yīng)處的像素灰度均值作為灰度閾值,最后從種子點(diǎn)開始并以不大于灰度閾值為判定準(zhǔn)則進(jìn)行生長.實(shí)驗(yàn)結(jié)果表明,該算法幾乎能分割出焊縫中全部缺陷,并能使缺陷形狀保留完整,這對(duì)后續(xù)缺陷的分類識(shí)別意義重大.

2 完整代碼

clear all, close all, clc f = imread(’defective_weld.tif’); imshow(f), title(’原始圖象’) figure, [counts,x] = imhist(f); bar(x,counts), title(’原始圖象的直方圖’) S = 255; T = 65; [g, NR, SI, TI] = regiongrow(f, S, T); figure, imshow(SI), title(’種子點(diǎn)圖象’) figure, imshow(TI), title(’閾值測(cè)試后的圖象’) figure, imshow(g), title(’8連通性分析后的圖象’) bw = edge(g, ’canny’); figure, imshow(bw), title(’邊緣圖象’) ff = f; ff(bw) = 0; figure, imshow(ff), title(’疊加圖象’)

function [g, NR, SI, TI] = regiongrow(f, S, T) %REGIONGROW Perform segmentation by region growing. %   [G, NR, SI, TI] = REGIONGROW(F, SR, T). S can be an array (the %   same size as F) with a 1 at the coordinates of every seed point %   and 0s elsewhere. S can also be a single seed value. Similarly, %   T can be an array (the same size as F) containing a threshold %   value for each pixel in F. T can also be a scalar, in which %   case it becomes a global threshold.   % %   On the output, G is the result of region growing, with each %   region labeled by a different integer, NR is the number of %   regions, SI is the final seed image used by the algorithm, and TI %   is the image consisting of the pixels in F that satisfied the %   threshold test. %   Copyright 2002-2004 R. C. Gonzalez, R. E. Woods, & S. L. Eddins %   Digital Image Processing Using MATLAB, Prentice-Hall, 2004 %   $Revision: 1.4 $ $Date: 2003/10/26 22:35:37 $ f = double(f); % If S is a scalar, obtain the seed image. if numel(S) == 1   SI = f == S;   S1 = S; else   % S is an array. Eliminate duplicate, connected seed locations   % to reduce the number of loop executions in the following   % sections of code.   SI = bwmorph(S, ’shrink’, Inf);     J = find(SI);   S1 = f(J); % Array of seed values. end TI = false(size(f)); for K = 1:length(S1)   seedvalue = S1(K);   S = abs(f - seedvalue) <= T;   TI = TI | S; end % Use function imreconstruct with SI as the marker image to % obtain the regions corresponding to each seed in S. Function % bwlabel assigns a different integer to each connected region. [g, NR] = bwlabel(imreconstruct(SI, TI));

3 仿真結(jié)果

4 參考文獻(xiàn)

[1]孫太生等. "基于改進(jìn)區(qū)域生長算法的焊縫圖像分割." 現(xiàn)代焊接 2(2012):2.

部分理論引用網(wǎng)絡(luò)文獻(xiàn),若有侵權(quán)聯(lián)系博主刪除。

天天Matlab

贊賞二維碼 微信掃一掃贊賞作者 贊賞

已喜歡, 對(duì)作者說句悄悄話
最多40字,當(dāng)前共

  人贊賞

1 / 3

長按二維碼向我轉(zhuǎn)賬

贊賞二維碼

受蘋果公司新規(guī)定影響,微信 iOS 版的贊賞功能被關(guān)閉,可通過二維碼轉(zhuǎn)賬支持公眾號(hào)。

版權(quán):如無特殊注明,文章轉(zhuǎn)載自網(wǎng)絡(luò),侵權(quán)請(qǐng)聯(lián)系cnmhg168#163.com刪除!文件均為網(wǎng)友上傳,僅供研究和學(xué)習(xí)使用,務(wù)必24小時(shí)內(nèi)刪除。
相關(guān)推薦