中国科学技术大学硕士学位论文基于机器视觉的精密零件表面质量自动化检测系统研究姓名:李勇申请学位级别:硕士专业:检测技术与自动化装置指导教师:伍先达2011-05-06IHoughABSTRACTIIIABSTRACTDetectionbasedonmachinevisiontechnologyfordigitalimageprocessingtechnologyasthecore,thesmartdetectionhaswideapplicationandbroadprospectsfordevelopment.Detectionefficiencyforartificiallow-impactdefectssuchassubjective,thesubjectofopticalcomponentswiththerealityofCanadianindustry,thedetectionproblem,thedevelopedpartsofthesurfacedefectrecognitionsortingsystemthatusescomputervisionimageprocessingtechnology,automationtechnology,lightmechatronicsortingsystemofautomaticrecognition,machinevisionbasedinspectionsystemforsurfacequalityin-depthresearch.Bymeansofmathematicalmodelingtoestablishthesignalmodelofthepartsurface,thesurfacedetectionprovidesabettertheoreticalfoundation;experimentwithvariouslightingconditions,fordifferentlightingconditions,intheory,algorithm,summedupthequalityatthesurfacefordifferentmachinevision-baseddetectionmethods,developedaseriesofimageprocessingandalgorithmimplementationandresearchconducted;waycoaxialdesignofthelightingpartsurfacequalityautomateddetectionsystems,thebackpartoftheselectedglasses,bothsidesoftheface,twodownAngularsixsurfacedefectsdetection,developmentofqualitycriteriaforclassification,automatedsorting.Themainsubjectofthedesign,developmentofthepartsurfacequalityinspectionofimageprocessingsoftware,thesoftwaresummarizesthelighting,theexperimentalmethodandautomateddetectioncapabilities.Finally,theexperimentalsystemwasexperimentallytestedtoverifytheeffectivenessofthesystemdesigntoachievethesubjectdetectthebeginningofthedevelopmentofstandardsandanimprovedandprospects.Thesystemcannotonlymeetthesurfacequalityoftheselectedpartoftheauto-detectionrequirements,butalsocanbeadaptedtootherrelatedindustries,theproductionline,hasgreatroomforexpansion,thedevelopmentofrelatedindustriesplayacertainrole.KeyWords:MachinevisionSurfacequalityinspectionedgedetectionregiongrowingHoughTransform,__________________________________________________________________________________________1111.11.1.1121.1.2PCB1.220608040%-50%PCB13[1]1994[2][3]1.3141)2)3)4)Hough5)6)2522.1RaRzRyRa0.8um2.2262.32.1272.22.22.32.42.32.42.52.62.5282.6SHK()()2.72.72.42.4.129CCD2.82.8CCDCCD2.4.21)2.32102.12.1()1/30()5um2)()K2.92.91/30Ksd1/15wK31133.1CCD3.1.1CCDCCDCharge-coupledDeviceCCDCCD3.1CCDMV-139413941394USB2.0CPU/MV-1394/312CCD4.65um*4.65um1024x7681392x10401628x1236CCD15/s60/sMV-VS141FM/FCCCD1392*104015/s3.1.2MV-1394Microvision,PCI321394MV-1394PCBICAOI3.2MicrovisionMV-1394BPCI1IEEE1394AIEEE1394.b800Mbps1062CCDAFTvisionZL3131/31/22/3PCBPCBSMTCCD3.1.3SDKSDK,SoftwareDevelopmentKitSDKAPISDKSDKAOIAOIAOISDKSDKSDK3.33.3SDK314CCDSDKHVSnapContinuous:HVSnapSingle:MHVSnapContinuous:MHVSnapSingle:MHVStoreBmp:BMPSDKSDKSDK3.23.2.1LEDLEDLEDLED3.43153.2.23.6CCD3.51803.63.63163.2.33.73.83.73.83.9CCD3173.2.43.103.2.5CCD3183.33.3.1CCDCCD300um—500umCCDCCD()Z3.113.11ZZLasirisTMSNFSNF-501L50um660nm5mW100um20um31920um3.1253.1350um3.3.21960173019603203.3.33.3.23D3.4,321025542244.1CCDA/D4.1.1()4.1.1.1ijf(ij)423g(ij)∑=j)f(i,1),(mjig(4.1)m3*34.24.14.24.1.1.24.34244.34.1.1.34.44.44.1.2[a,b][Z1,Ζk]z[a,b][A,B]1)[a,b][Z1,Ζk]z[a,b]425[A,B]A=a+TB=b+T(T)2)[a,b][Z1,Ζk]z[a,b][A,B]A=f(a)B=f(b)(f)3)[a,b][Z1,Ζk]z[a,b][A,B]A=a*TB=b*T(T)f(i+u,j+v)=(1-u)(1-v)f(i,j)+(1-u)vf(i,j+1)+u(1-v)f(i+1,j)+uvf(i+1,j+1)(4.2)f(i,j)(i,j)uv[0,1]f(i,j)(i,j)4.54.64264.24.2.1LaplacianRobertsSobelCanny4.2.1.1LaplacianLaplacian010141010−f(i,j)=f(i+1,j)+f(i-1,j)+f(i,j+1)+f(i,j-1)-4f(i,j)Laplacian4.74274.7Laplacian4.2.1.2RobertsRoberts0110−1001−(1,)(,1)yffijfij∆=−−−(4.3)(,)(1,1)xffijfij∆=−−−(4.4)22(,)xyGijff=∆+∆G(ij)45135Roberts,Roberts4.84.8Roberts4.2.1.3SobelSobel428y121000121−−−x101202101−−−SobelSobelSol1[8]={-1,-2,-1,0,0,1,2,1}Sol2[8]={-1,0,1,-2,2,-1,0,1}sobelintCEdgeDlg::SobelEdge(intnWidth,intnHeight,int*para,BYTE*pBuf){intdist=1;intaddrNeighbour[8]={-dist*nWidth-dist,-dist*nWidth,-dist*nWidth+dist,-dist,dist,dist*nWidth-dist,dist*nWidth,dist*nWidth+dist};intSol1[8]={-1,-2,-1,0,0,1,2,1};intSol2[8]={-1,0,1,-2,2,-1,0,1};intGau[8]={1,2,1,2,2,1,2,1};intaddr=0;intmax=0;for(inti=dist;inHeight-dist;i++){for(intj=dist;jnWidth-dist;j++){addr=nWidth*i+j;inttemp=0;inttemp1=0;inttemp2=0;for(intk=0;k8;k++){temp1+=Sol1[k]*pBuf[addr+addrNeighbour[k]];temp2+=Sol2[k]*pBuf[addr+addrNeighbour[k]];}429temp1=abs(temp1);temp2=abs(temp2);if(temp1=temp2)m_pCalcBuf[addr]=temp1;elsem_pCalcBuf[addr]=temp2;if(m_pCalcBuf[addr]max)max=m_pCalcBuf[addr];}}returnmax;}Sobel4.94.9Sobel4.2.1.4CannyCannyCannyCannyCannyCannyCanny1234304T1T2T1=0.4*T2T10aT1T20bT1abba4.10CannyCanny4.11CannyLaplacianRoberts431,Sobelcanny4.2.1.524.12sobel4.120-10-14-10-100000N0000------------RSobel4324.134.2.2HoughHough4.2.2.1HoughHoughHoughy=k*x+bHough(,)xy222()()xaybr−+−=Hough(,)xy(,,)abrHough4.144.144334.14xyk-bL0k-bP0x-y90kp=x*cos()+y*sin()x-y(x,y)a-p(0-180)a-p(ap)x-yx-y(xy)p=x*cos()+y*sin()px-y(P)Hough4.2.2.2HoughHoughHoughHoughHoughHoughHough4344.2.34.2.3.11(ij)(ij)844.1544.1684(ij)8