您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 信息化管理 > 基于Halcon的硒鼓缺陷检测与一维尺寸测量
323Vol.32No.320145JournalofJilinUniversityInformationScienceEditionMay20141671-5896201403-0308-08Halcon2013-06-202011C110451989—Tel86-18368086367E-maililanliu90@yahoo.com.cn1966—Tel86-15088875366E-mailHongjunp66@163.com。316000Halcon.NET。1~2、。TP391ADefectDetectionandOne-DimensionalSizeMeasurementofTonerCartridgeBasedonHalconZHUXianfengPANHongjunSchoolofMathematicsPhysicsandInformationScienceZhejiangOceanUniversityZhoushan316000ChinaAbstractSurfacedefectdetectionandsizemeasurementofthetonercartridgeisanimportantparttodeterminewhetheritisqualified.Toachievethisaspectofworkautomationthetonercartridgesurfacepointdefectsandlinedefectsareaccuratelydetectedandclassifiedbymathematicalmorphologyoperatorsofimageprocessingalgorithmsanditssizeispreciselymeasuredaccordingtosub-pixelmeasurements.ThecartridgeautomaticdefectdetectionandsizemeasurementsystemisdevelopedbythespecialmachinevisionsoftwareHalconand.NET.Testingshowsthatthesystemhasahighaccuracyspeedstabilityandotherdistinctivecharacteristics.Keywordsmorphologyoperatordefectdetectionsub-pixelmeasurement0引言1、CT234。。、、、。。、。Halcon.NETblob、、、、、、。56Halcon、。Halcon。1系统流程5、、、。1。图1机器视觉检测系统流程图Fig.1Flowchartofmachinevisioninspectionsystem2基于Halcon的硒鼓缺陷检测与一维尺寸测量2.1图像采集图2硒鼓源图Fig.2Sourceimageofthetonercartridge78。1read_image2open_framegrabbergrab_image。910。2。2.2图像预处理2.2.1图像灰度化RGB3RGBrgb1_to_grayg=0.299R+0.587G+0.114B1gRGB。。2.2.2图像分解RGB3decompose33R、G、B。R。2.2.3图像去噪11。12、13。9033Halcon2.2.4亚像素级边缘提取图3硒鼓亚像素边缘Fig.3Sub-pixeledgeofthetonercartridgeedges_sub_pixGrayImageEdges‘lanser2’0.12040lanser214。edges_sub_pix。3。2.3硒鼓缺陷检测2.3.1图像平滑change_domainreduce_domain。。15g'xy=1n∑xy∈Dgxy2Dngxyg'xy。。11×11。。2.3.2动态阈值二值化。16。go≥gt+f。gogtf。5<f<40fff=8。。C。C01C1C0.281C0.010.28。C=F/Dmax∧2π3图4缺陷精确提取效果图Fig.4RenderingsofaccuratelyextractingdefectsFDmaxπ。2.3.3缺陷检测4。56。78。01332图5点缺陷图6线缺陷Fig.5PointdefectsFig.6Linedefects图7源图点缺陷图8源图线缺陷Fig.7PointdefectsofsourceimageFig.8Linedefectsofsourceimage2.4硒鼓一维尺寸测量Halcon17。2.4.1RegionofInterest(ROI)内边缘提取fit_rectangle2_contour_xldSelectedXLD‘regression’-10032RowColumnPhiLength1Length2PointOrder2.2.4。Phigen_rectangle2ROIRowColumnPhi+rad90Length11Length21ROI9。ROI。10。图9矩形感兴趣区图10ROIFig.9RegionofinterestFig.10Regionofinterestgen_measure_rectangle2RowColumnPhiLength11Length21WidthHeightInterpolationMeasureHandleMeasureHandle。。。318、1920。1133Halcon。4。。4。11图11双线性插值原理Fig.11Bilinearinterpolationprinciple00、01、10、114f00f10Xx0fx0f01f11Xx1fx1fx0fx1Yxyfxy。。。xi-1xiyi-1yi161xx2x31yy2y[]3=1yy2y3xxyxy2xy3x2x2yx2y2x2y3x3x3yx3y2x3y34Lxy=m1+m2x+m3y+m4x2+m5xy+m6y2+m7x3+m8x2y+m9xy2+m10y3+m11x3y+m12xy3+m13x2y2+m14x3y2+m15x2y3+m16x3y35xi-1yi-1、xi-1yi、xiyi-1、xiyi4fxi-1yi-1、fxi-1yi、fxiyi-1、fxiyi1616。。3。ROI。measure_projectionImageMeasureHandleGrayValuescreate_funct_1d_arrayGrayValuesFunction。W。12131415。ROI。ROIROI。图12ROI宽度W=20像素图13ROI宽度W=80像素Fig.12ROIofW=20pixelFig.13ROIofW=80pixel21332图14ROI宽度W=20,未平滑图15ROI宽度W=80,未平滑Fig.14ROIofW=20,nosmoothingFig.15ROIofW=80,nosmoothingsmooth_funct_1d_gaussFunctionSSmoothedFunctionS=6。1617measure_pairsImageMeasureHandleSThresholdTransitionSelectRowEdgeFirstColumnEdgeFirstAmplitudeFirstRowEdgeSecondColumnEdgeSecondAmplitudeSecondIntraDistanceInterDistanceS。derivate_funct_1dFunctionModeDerivative18。S=11818。图16ROI宽度W=20,S=6图17ROI宽度W=80,S=6Fig.16ROIofW=20,S=6Fig.17ROIofW=20,S=6。。101018。。19ROI。图18ROI宽度W=80,S=1图19检测到的结果边缘Fig.18ROIofW=80,S=1Fig.19Detectededges2.4.2硒鼓的一维尺寸测量2.4.1measure_pairsImageMeasureHandleSigmaThresholdTransitionSelectRowEdgeFirstColumnEdgeFirstAmplitudeFirstRowEdgeSecondColumnEdgeSecondAmplitudeSecondIntraDistanceInterDistance3133HalconIntraDistance。。2021。图20硒鼓直径图21硒鼓长度Fig.20DiameterofthetonercartridgeFig.21Lengthofthetonercartridge2.5软件集成HalconHalcon.NET.NETHalconHalcon.NET。3结语。。3~4。。1.J.200813101396-1398.LIULiboZHAOHuiZHANGHaibo.ResearchonSpotSubdividedLocatingMethodinLaserTriangulationMeasurementJ.ComputerMeasurement&Control200813101396-1398.2.J.CT199522451-58.XIANWuLIShiguangWANGYa.TheOptimalNondestructiveTestingApproachJ.IndustrialCTTechnologyDevelopment199522451-58.3.M.2000.JIAYunde.MachineVisionM.BeijingSciencePress2000.4.J.200527211-17.ZHANGWei.MachineVisionTechnologyandItsIndustrialApplicationsJ.Infrared200527211-17.5.D.2004.RENHuorong.MathematicalMorphologyandItsApplicationsD.Xi'anSchoolofMechanicalEngineeringXi'anUniversity2004.6.J.20043289-92.WANGShuwenYANChengxinZHANGTianxuetal.TheApplicationofMathematicalMorphologyinImageProcessingJ.ComputerEngineeringandApplications20043289-92.7.J.2003118-21.LIUHuanjunWANGYaonanDUANFeng.ImageCaptureTechnologyinMachineVisionJ.ComputerandInformationTechnology2003118-21.8.J.20051136-138141.ZHUZhengtaoLIShaofa.LensDistortionandItsCorrectionTechnologyJ.OpticalTechnology20051136-138141.413329HENRIMAITREWRITE.M..2006190-210.HENRIMAITREWRITE.ModernDigitalImageProcessingM.BeijingElectronicIndustryPress2006190-210.10.J.200026143-55.QIUMaolinMASongdeLIYi.OverviewofCameraCalibrationforComputerVisionJ.ActaAutomaticaSinica200026143-55.11.D.2008.LIBo.NoiseCancellationAlgorithmofDigitalImageD.QufuS
本文标题:基于Halcon的硒鼓缺陷检测与一维尺寸测量
链接地址:https://www.777doc.com/doc-4232707 .html