halcon命令中文注解_第1页
halcon命令中文注解_第2页
halcon命令中文注解_第3页
halcon命令中文注解_第4页
halcon命令中文注解_第5页
已阅读5页,还剩13页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、read_image(WaferDies,wafer_dies)read_image(图片在程序中的名称,图片在计算机中的名称)reopen_window_fit(WaferDies,700,0,0,WindowHandle)reopen_window_fit(图片在程序中的名称,700,0,0,WindowHandle)init_font(WindowHandle,-1,2)和字体有关的一个命令get_window_extents(WindowHandle,_,_,WindowWidth,WindowHeight)设置窗口大小和位置dev_update_all(off)把所有的dev_upd

2、ate从on设到off,这似乎是设定文本显示的滚动与否dev_set_draw(margin)定义区域填充模式。如果DrawMode设置为fill,输出地区被填满,如果设置为margin,只有轮廓显示出来。get_image_pointer1(WaferDies,_,_,Width,Height)get_image_pointer1(Image:Pointer,Type,Width,Height)Accessthepointerofachannel.TheoperatorgetimagepointerlreturnsapointertothefirstchanneloftheimageImag

3、e.Additionally,theimagetype(Type=byte,int2,uint2,etc.)andtheimagesize(widthandheight)arereturned.Consequently,adirectaccesstotheimagedataintheHALCONdatabaseviathepointerispossiblefromtheprogramminglanguageinwhichHALCONisused.AnimageisstoredinHALCONlinearizedinrowmajororder,i.e.,linebyline.指令get_imag

4、e_pointerl返回一个图像WaferDies的第一通道的指针。此外,图像类型(Type=byte,INT2,uint2等)和图像尺寸(宽度和高度)返回。因此,直接通过访问指针来获取HALCON的数据库中的图像数据,在使用了HALCON语言的程序中是可行的。图像在HALCON以线性行模式存储,也就是一行一行的。dev_display(WaferDies)在活动图形窗口显示一个图像对象(图像,地区或XLD)。这相当于对一个窗口内的变量变双击图标。write_message(WindowHandle,-1,-1,Imageofawafer,true)write_message(WindowHa

5、ndle,WindowHeight-30,-1,PressRuntocontinue,true)在窗口上写文字stop()停止*1.Determinethesizeofthediesbyusingautocorrelation确定大小用自相关*rft_generic(WaferDies,ImageFFT,to_freq,none,complex,Width)rft_generic(Image:ImageFFT:Direction,Norm,ResultType,Width:)rft_generic用于计算快速傅立叶变换输入图像的形象。相反,fft_generic,fft_image和fft_i

6、mage_inv,个事实,即在正向输入图像变换是实值图像(即不是一个复杂的图像)使用。在这种情况下,复杂的输出图像具有冗余。在图像的右半部分的值是在图像的左半部分的相应值的复共轭。因此,运行时和可节省内存仅计算和存储的复杂图像的左半边。与resultType参数可用于指定结果的图像类型逆变换(方向=from_freq)。在正变换(方向=to_freq),与resultType必须设置为complex。参数方向确定是否应进行变换到频域空间域或进入回来。为方向=to_freq输入图像必须有一个实数型,即一个复杂的图像可能无法用作输入。所有图片,可以变成一个真正的图像类型转换类型的支持。在这种情况下

7、,输出是一个尺寸(W/2+1)*H,其中W和H是宽度和高度复杂的图像输入图像。在这种模式下,指数-1用于变换(见fft_generic)。为方向=from_freq,输入图像必须是复杂的。在这种情况下,输入图像的大小不足以决定输出图像的大小。这必须通过设置宽度为一个有效的值,即2*的W-2或2*的W-1,其中W是复杂的图像的宽度。在这种模式下,指数1用于在变换。正火因子可设置规范,并且可以利用的量,none,sqrt和n。用户必须确保参数相一致。这意味着,用于规范因素向前和向后转换必须宽*h时产量成倍增加。correlation_fft(ImageFFT,ImageFFT,Correlatio

8、nFFT)correlation_fft(ImageFFT1,ImageFFT2:ImageCorrelation:)correlation_fft计算了傅立叶变换在频域输入图像的相关性。其相关的计算方法是乘以的ImageFFT2复共轭ImageFFTl。应当指出,为了实现在空间域的相关性的正确比例,经营者fft_generic或Norm=none必须用于正变换和fft_generic或rft_generic与Norm=n为rft_generic逆变换。如果ImageFFT1和ImageFFT2含有相同数量的图像,相应的图像相关成对。否则,ImageFFT2只能包含一个单一的形象。在这种情况下

9、,为每一个相关性的ImageFFT1与ImageFFT2形象。rft_generic(CorrelationFFT,Correlation,from_freq,n,real,Width)*Excludelocalmaximaattheimageborder.Itissufficient*toextractthemaximaintheupperleftquarteroftheimagebecause*theautocorrelationisanevenfunction.排除局部极大值在图像边界。它足以在上提取图像的左边季度极大,因为自相关是偶函数。gen_rectangle1(Rectangle

10、,1,1,Height/2,Width/2)gen_rectangle1(:Rectangle:Row1,Column1,Row2,Column2:)Createarectangleparalleltothecoordinateaxes.Theoperatorgenrectanglelgeneratesoneormorerectanglesparalleltothecoordinateaxeswhicharedescribedbytheupperleftcorner(Row1,Columnl)andthelowerrightcorner(Row2,Column2).Morethanonereg

11、ioncanbecreatedbypassingatupleofcornerpoints.Thecoordinatesystemrunsfrom(0,0)(upperleftcorner)to(Width-1,Height-1).Seeget_systemandresetobjdbinthiscontext.创建一个矩形平行于坐标轴。操作员gen_rectangle1生成一个或多个矩形平行于坐标是由左上角(Row1,Column1)和右下角(Row2,Column2)中所述轴。一个以上的地区可以通过创建一个元组的角点。系统运行的坐标从(0,0)(左上角)至(宽度-1,身高-1)。看到这方面ge

12、t_system和reset_obj_db。reduce_domain(Correlation,Rectangle,CorrelationReduced)reduce_domain(Image,Region:ImageReduced:)Reducethedomainofanimage.Theoperatorreducedomainreducesthedefinitiondomainofthegivenimagetotheindicatedregion.Thenewdefinitiondomainiscalculatedastheintersectionoftheolddefinitiondom

13、ainwiththeregion.Thus,thenewdefinitiondomaincanbeasubsetoftheregion.Thesizeofthematrixisnotchanged.降低图像的领域。操作员reduce_domain减少了给定图像的定义域到指定的区域。新的定义域是计算为与该地区的旧定义域的交集。因此,新的定义域可以是该地区的一个子集。矩阵的大小是没有改变。*Extractthelocalmaximaoftheautocorrelationfunction提取的自相关函数的局部极大值local_max_sub_pix(CorrelationReduced,gauss

14、,2,5000000,Row,Col)local_max_sub_pix(Image:Filter,Sigma,Threshold:Row,Col)Subpixelprecisedetectionoflocalmaximainanimage.local_max_subpixextractslocalmaximafromtheimageImagewithsubpixelprecision.Todoso,ineachpointtheinputimageisapproximatedbyaquadraticpolynomialinxandyandsubsequentlythepolynomialise

15、xaminedforlocalmaxima.Thepartialderivatives,whicharenecessaryforsettingupthepolynomial,arecalculatedeitherwithvariousGaussianderivativesorusingthefacetmodel,dependingonFilter.Inthefirstcase,SigmadeterminesthesizeoftheGaussiankernels,whileinthesecondcase,beforebeingprocessedtheinputimageissmoothedbya

16、GaussianwhosesizeisdeterminedbySigma.Therefore,facetresultsinafasterextractionattheexpenseofslightlylessaccurateresults.ApointisacceptedtobealocalmaximumifbotheigenvaluesoftheHessianmatrixaresmallerthan-Threshold.Theeigenvaluescorrespondtothecurvatureofthegrayvaluesurface.亚像素精确的检测图像中的局部最大值。local_max

17、_sub_pix提取物与亚像素精度的图像Image局部极大值。为此,在每个点的输入图像近似为二次多项式在x和y以及随后的多项式是局部最大值检查。偏导数,这是设立多项式必要的,是计算出来的各种衍生工具或使用高斯面模型筛选而定。在第一种情况下,适马决定了高斯核的大小,而在第二种情况下,在所处理的输入图像是由高斯,其大小是由西格玛确定平滑。因此,在一个不太准确的结果稍快费用提取面的结果。一个点是接受的,如果是本地最大的Hessian矩阵特征值均小于门限。特征值对应的灰度值表面曲率。*GetthesizeofthediesFindmaximumthatisclosesttotheorigin.This

18、maximumcorrespondstotheoppositerectanglecornerofthedie.获取大小的模具。查找最大值最接近原点。对应于这个最大的模具矩形对面角落。distance_pp(gen_tuple_const(|Row|,0),gen_tuple_const(|Col|,0),Row,Col,Distance)distance_pp(Row1,Column1,Row2,Column2:Distance)Calculatethedistancebetweentwopoints.Theoperatordistanceppcalculatesthedistancebetw

19、eenpairsofpointsaccordingtothefollowingformula:Distance=sqrt(Row1-Row2)2+(Column1-Column2)入2)TheresultisreturnedinDistance.计算两点之间的距离。经营者之间的distance_pp计算按下列公式点对距离:距离=开方(第R0W1-R0W2行)人2+(columnl的-C0LUMN2列)人2)的结果是在距离返回。tuple_gen_const(:Length,Const:Newtuple)Generateatupleofaspecificlengthandinitializeit

20、selements.tuple_qen_constgeneratesanewtupleinNewtuple.TheinputparameterLengthdeterminesthenumberofelementsforthenewtuple.ThusLengthmayonlyconsistofasinglenumber.IfLengthcontainsafloatingpointnumber,thismayonlyrepresentanintegervalue(withoutfraction).Thedatatypeandvalueofeachelementofthenewgeneratedt

21、upleisdeterminedbytheinputparameterConstthatmayonlyconsistofasingleelement.AllelementsinNewtuplehavegotthesamedatatypeandvalueasthesingleelementinConst.生成元组的一个特定的长度和初始化它的元素.tuple_gen_const生成一个Newtuple新的tuple。输入参数的长度决定的元素为新的元组数目。因此长度可能只包含一个数字。如果长度包含一个浮点数,这可能仅仅代表一个整数(无分数)。数据类型和新产生的每个元组元素的值是由输入参数常量,可能只

22、包含一个元素。在Newtuple所有元素都得到了相同的数据类型作为常量单一元素和价值。SortedIndex:=sort_index(Distance)tuple_sort_index(:Tuple:Indices)Sortstheelementsofatupleandreturnstheindicesofthesortedtuple.tuple_sortindexsortsallelementsofTupleinascendingorderandreturnstheindicesoftheelementsofthesortedtuple(inrelationtotheinputtupleTu

23、ple)withIndices.AsapreconditionthesingleelementsofTuplemustbecomparable.ThusTuplemusteitherexclusivelyconsistofstringsoritmustonlycontain(integerorfloatingpoint)numbers.Inthelattercaseintegersandfloatingpointnumbersmaybemixed.排序的元素,并返回一个元组的元组的排序指标。tuple_sort_index升序所有元组元素,并返回该元素的元组指数的排序与指数(有关输入元组元组)

24、。作为一个先决条件的元组的单一元素必须具有可比性。因此,元组必须要么完全由字符串或它必须只包含(整数或浮点)号码。在后一种情况整数和浮点数可以混合使用。Row1:=RowSortedIndex0Col1:=ColSortedIndex0DiagonalLength:=sqrt(Row1*Row1+Col1*Col1)tuple_sqrt(:T:Sqrt)Computethesquarerootofatuple.tuple_sqrtcomputesthesquarerootoftheinputtupleT.Thesquarerootisalwaysreturnedasafloatingpoint

25、number.Thesquarerootofastringisnotallowed.计算一个元组的平方根。tuple_sqrt计算输入元组T的平方根是始终作为一个浮点数返回平方根。字符串的平方根是不允许的。Phi:=atan2(Row1,Col1)tuple_atan2(:Y,X:ATan)Computethearctangentofatupleforallfourquadrants.tuple_atan2computesthearctangentoftheinputtuplesY/Xwhiletreatingallfourquadrantscorrectly.Thearctangentisa

26、lwaysreturnedasafloatingpointnumber.Thearctangentofastringisnotallowed.计算一个元组所有四个象限反正切。tuple_atan2计算输入的反正切值组是/X,同时正确地对待所有四个象限。总是返回的反正切为浮点数。字符串的反正切值是不允许的。DieWidth:=DiagonalLength*cos(Phi)DieHeight:=DiagonalLength*sin(Phi)*Thecenter,thefirstmaximum,andthesecondmaximum*togetherdefinetheorientationandth

27、esizeofthedies.该中心的第一个最大,第二个最大的共同定义的方向和大小的模具。dev_set_color(blue)dev_set_color(:ColorName:)Setoneormoreoutputcolors.devsetcolordefinesthecolorsforregionandlineorientedoutputinthegraphicswindows.Theavailablecolorscanbequeriedwiththeoperatorquerycolor.The“colorsblackandwhiteareavailableforallscreens.If

28、colorsareusedthatarenotdisplayableonthescreen,HALCONcanchooseasimilar,displayablecoloroftheoutput.Forthis,set_check(:color:)mustbecalled.Thedefinedcolorsareuseduntildevsetcolorordevsetcolorediscalled.Colorsaredefinedforallgraphicswindowsincontrasttotheoperatorsetcolor.AttentionIfdevsetcolorshouldbeu

29、sedforexportedCode(C+),pleasenotethedescriptionofset_colorduetothedifferentsemanticsinC+.设置一个或多个输出的色彩。dev_set_color定义区域和图形化输出Windows行的颜色。可用的颜色可以查询与运营商query_color。“颜色”黑和白是可用于所有的屏幕上。如果颜色使用的是屏幕上没有显示的,HALCON的可以选择一个类似的,输出显示的颜色。为此,set_check(:颜色的:)必须被调用。定义的颜色使用,直至dev_set_color或dev_set_colored被调用。颜色定义为与此相反的

30、操作set_color所有的图形窗口。注意如果dev_set_color出口代码应使用(C+中),请记下set_color说明由于不同的语义在C+。gen_cross_contour_xld(Crosses,Row,Col,8,0.785398)gen_cross_contour_xld(:Cross:Row,Col,Size,Angle:)GenerateoneXLDcontourintheshapeofacrossforeachinputpoint.gencross_contourxldgeneratesanXLDcontourintheshapeofacrossforeachinputp

31、oint(Row,Col).Conceptually,thecontourconsistsoftwolinesoflengthSize,whichintersectexactlyintheinputpoint.TheirorientationisdeterminedbyAngle.ThecrossisreturnedinCross.Iftherearemultiplepointstobeprocessed,theircoordinatesmustbepassedastuples.生成一个XLD在为每一个输入点十字形的轮廓。gen_cross_contour_xld产生在为每一个输入点(行,列)

32、十字XLD轮廓。从概念上讲,外形由两条线的长度大小,在相交点的准确输入。他们的方向是确定的视角。跨跨中返回。如果有多个点进行处理,他们的坐标必须为元组通过。gen_ellipse_contour_xld(Circle,Row1,Col1,0,8,8,0,6.28318,positive,1.5)gen_ellipse_contour_xld(:ContEllipse:Row,Column,Phi,Radius1,Radius2,StartPhi,EndPhi,PointOrder,Resolution:)CreationofanXLDcontourcorrespondingtoanellipt

33、icarc.qen_ellipse_contourxldcreatesoneormoreellipticarcsorclosedellipses.Ellipsesarespecifiedbytheircenter(Row,Column),theorientationofthemainaxisPhi,thelengthofthelargerhalfaxisRadius1,andthelengthofthesmallerhalfaxisRadius2.Inadditiontothat,ellipticarcsarecharacterizedbytheangleofthestartpointStar

34、tPhi,theangleoftheendpointEndPhi,andthepointorderPointOrderalongtheboundary.Bothanglesrefertothecoordinatesystemoftheellipse,i.e.relativetothemainaxisandinamathematicalpositivedirection.Thus,thetwomainpolescorrespondtotheangles0andPI,thetwominorpolestotheanglesPI/2and3*pi/2.Tocreateaclosedellipsethe

35、values0and2*PI(withpositivepointorder)havetobepassedtotheoperator.AllanglesPhi,StartPhi,EndPhitakearbitraryvaluesandaremappedinternallytotheinterval0,2*PI.TheresolutionoftheresultingcontoursContEllipseiscontrolledviaResolutioncontainingthemaximumEuclideandistancebetweenneighboringcontourpoints.一个XLD

36、轮廓对应一个椭圆弧.gen_ellipse_contour_xld创作创建一个或多个圆弧或椭圆封闭椭圆。由他们指定的椭圆形中心(Row,Column),该椭圆的主轴线沿Phi方向,规模较大的半轴Radius1的长度和较小的半主轴轴Radius2长度。除此之外,椭圆弧的特点是对角StartPhi起点,在终点EndPhi角,沿边界点顺序PointOrder。这两个角涉及到椭圆的坐标系统,即相对于主轴线,并在数学积极的方向。因此,这两个主极对应于角度0和PI,这两个极点的角度轻微的PI/2和3*n/2。要创建一个封闭的椭圆值0和2*PI(在正面点顺序)要传递给经营者。各个角度Phi,StartPhi

37、,EndPhi采取任意值,并映射到内部区间0,2*PI。由此产生的ContEllipse是通过Resolution包含的最大的欧几里德空间距离控制轮廓点轮廓。dev_display(Correlation)dev_display(Object:)Displaysimageobjectsinthecurrentgraphicswindow.devdisplaydisplaysanimageobject(image,region,orXLD)intheactivegraphicswindow.Thisisequivalenttoadoubleclickonaniconvariableinsidet

38、hevariablewindow.AttentionIfdev_displayshouldbeusedforexportedCode(C+),pleasenotethedescriptionofdispobjduetothedifferentsemanticsinC+.Parameters当前图形窗口中显示图像对象。dev_display在窗口中显示一个图形图像主动对象(图像,地区或XLD)。这相当于在一个窗口内的变量变双击图标。如果dev_display应注意对出口代码使用(C+中),请记下disp_obj由于不同的语义描述,在C+。dev_display(Crosses)dev_displ

39、ay(Circle)dev_set_color(green)dev_display(Rectangle)write_message(WindowHandle,-1,-1,Autocorrelation,regionofinterest,andlocalmaxima,true)write_message(WindowHandle,WindowHeight-30,-1,PressRuntocontinue,true)stop()*Visualizetheextractedsizeofthedies可视化提取图片大小gen_rectangle2_contour_xld(Die,Height/2,Wi

40、dth/2,0,DieWidth/2,DieHeight/2)genrectangle2contourxld(:Rectangle:Row,Column,Phi,Length1,Length2:)CreateanXLDcontourintheshapeofarectangle.genrectangle2contourxldcreatesoneormoreXLDcontoursintheshapeofarectanglewitharbitraryorientation.Therectanglehasthecenter(Row,Column),theorientationPhi,andthehal

41、fedgelengthsLengthlandLength2.TheanglePhimustbegiveninradiansandspecifiestheanglebetweenthehorizontalaxisandtheedgewiththehalflengthLengthlinthemathematicallypositivedirection(counterclockwise).MorethanoneXLDcontourcanbecreatedbypassingatupleofrectangleparameters.创建一个矩形的形状XLD轮廓。gen_rectangle2_contou

42、r_xld中创建一个矩形形状任意方向的一个或多个XLD轮廓。该矩形的中心(Row,Column),方向Phi,半长边Lengthl和Length2。Phi角度必须以弧度,并指定之间的水平轴,与半长长度1在数学正方向(逆时针方向)边缘角。不止一个XLD轮廓可以通过创建一个矩形参数元组。reopen_window_fit(WaferDies,700,0,0,WindowHandle)init_font(WindowHandle,-1,2)dev_display(WaferDies)dev_set_color(blue)dev_display(Die)write_message(WindowHand

43、le,-1,-1,Extracteddiesize,true)write_message(WindowHandle,WindowHeight-30,-1,PressRuntocontinue,true)stop()*2.Determinethepositionofthediesbyusingshape-basedmatching*2。确定位置通过使用基于形状匹配die图片LineWidth:=7LineWidthFraction:=0.6*Generateanartificialmodelimageofthelinesbetweenthedies生成die图片之间的行人工模范形象gen_ima

44、ge_const(Template,byte,Width,Height)gen_image_const(:Image:Type,Width,Height:)Createanimagewithconstantgrayvalue.Theoperatorgenimageconstcreatesanimageoftheindicatedsize.TheheightandwidthoftheimagearedeterminedbyHeightandWidth.HALCONsupportsthefollowingimagetypes:byte(1byteperpixel,valuearea:0.255)i

45、nt1(1byteperpixel,signed)int2(2bytesperpixel,signed)uint2(2bytesperpixel,unsigned)int4(4bytesperpixel,signed)real(4bytesperpixel)complex(tworealmatrices)vector_field(tworealmatrices)dir(1byteperpixel,valuearea:0.180)cyclic(1byteperpixel;cyclicvaluearea:0.255).Thedefaultvalue0issetviatheoperatorsetsy

46、stem(initnewimage,).创建具有恒定灰度值的图像。操作员gen_image_const创建一个指定大小的图片。高度和宽度的图像是由高度和宽度。HALCON的支持下列图像类型:scale_image(Template,Template,1,128)scale_image(Image:ImageScaled:Mult,Add:)Scalethegrayvaluesofanimage.Theoperatorscaleimagescalestheinputimages(Image)bythefollowingtransformation:g:=g*Mult+AddIfanoverflo

47、woranunderflowoccursthevaluesareclipped.Thisoperatorcanbeapplied,e.g.,tomapthegrayvaluesofanimage,i.e.,theintervalGMin,GMax,tothemaximumrange0:255.Forthis,theparametersarechosenasfollows:Mult=255/(GMax-GMin)Add=一Mult*GMinThevaluesforGMinandGMaxcanbedetermined,e.g.,withtheoperatorminmaxgray.Pleasenot

48、ethattheruntimeoftheoperatorvarieswithdifferentcontrolparameters.Forfrequentlyusedcombinationsspecialoptimizationsareused.Additionally,specialoptimizationsareimplementedthatusefixedpointarithmetic(forint2anduint2images),andfurtheroptimizationsthatuseSIMDtechnology(forbyte,int2,anduint2images).Theact

49、ualapplicationofthesespecialoptimizationsiscontrolledbythesystemparametersint_zoomingandmmx_enable(seesetsystem).Ifint_zoomingissettotrue,theinternalcalculationisperformedusingfixedpointarithmetic,leadingtomuchshorterexecutiontimes.However,theaccuracyofthetransformedgrayvaluesisslightlylowerinthismo

50、de.Thedifferencetothemoreaccuratecalculation(usingint_zooming=false)istypicallylessthantwograylevels.Ifmmx_enableissettotrue(andtheSIMDinstructionsetisavailable),theinternalcalculationsareperformedusingfixedpointarithmeticandSIMDtechnology.Inthiscasethesettingofint_zoomingisignored.AttentionNotethat

51、SIMDtechnologyperformsbestonlarge,compactinputregions.DependingontheinputregionandthecapabilitiesofthehardwaretheexecutionofscaleimagemighteventakesignificantlymoretimewithSIMDtechnologythanwithout.Inthiscase,theuseofSIMDtechnologycanbeavoidedbysetsystem(:mmxenable,false:).规模图像的灰度值。在输入图像(影像)由以下变换算sc

52、ale_image规模:克:=克*+新增的MULT如果发生溢出或下溢值被剪切。这个操作符可以应用,例如,映射的图像,即在区间GMin,GMax,灰度值的最大范围0:255。为此,参数的选择如下:=255的MULT/(GMax-GMin)添加=-*GMin的MULTGMin和GMax值可确定的,如与经营者min_max_gray。请注意,该操作运行时使用不同的控制参数不同。为经常使用的特殊的优化组合使用。此外,特殊的优化实现使用固定点算法(uint2为INT2和图像),并使用单指令多数据技术(字节,整合酶,并uint2图像)进一步优化。这些特殊的优化控制的实际应用,系统参数的int_zoomin

53、g和mmx_enable(见set_system)。如果int_zooming设置为true,内部计算是使用固定点算法,从而大大缩短执行时间。但是,转换后的灰度值的精确度在这种模式下略有降低。到更精确的计算差异(使用int_zooming=假)通常小于两个灰色的水平。如果mmx_enable设置为true(和SIMD指令集可用),内部计算是用固定点算法和SIMD技术。在这种情况下,int_zooming设置将被忽略。请注意,表现最好的SIMD技术在大,结构紧凑输入地区。根据输入地区和硬件上scale_image执行,甚至可能采取的SIMD技术比没有更多的时间的能力。在这种情况下,使用SIMD技

54、术可避免set_system(:mmx_enable,假:)。RefRow:=round(0.5*Height)RefCol:=round(0.5*Width)forRow:=-0.5to0.5by1forCol:=-0.5to0.5by1gen_rectangle2_contour_xld(Rectangle,RefRow+Row*DieHeight,RefCol+Col*DieWidth,0,0.5*DieWidth-0.5*LineWidth,0.5*DieHeight-0.5*LineWidth)gen_rectangle2_contour_xld(:Rectangle:Row,Col

55、umn,Phi,Length1,Length2:)CreateanXLDcontourintheshapeofarectangle.qen_rectanqle2_contour_xldcreatesoneormoreXLDcontoursintheshapeofarectanglewitharbitraryorientation.Therectanglehasthecenter(Row,Column),theorientationPhi,andthehalfedgelengthsLengthlandLength2.TheanglePhimustbegiveninradiansandspecif

56、iestheanglebetweenthehorizontalaxisandtheedgewiththehalflengthLengthlinthemathematicallypositivedirection(counterclockwise).MorethanoneXLDcontourcanbecreatedbypassingatupleofrectangleparameters.Parameterspaint_xld(Rectangle,Template,Template,0)paint_xld(XLD,Image:ImageResult:Grayval:)PaintXLDobjects

57、intoanimage.paintxldpaintstheXLDobjectsXLDoftypecontourorpolygonwiththeconstantgrayvaluesGrayvalintoeachchannelofthebackgroundimagegiveninImageandreturnstheresultinImageResult.OpencontoursofXLDobjectsareclosedandtheirenclosedregionsarefilledup.TherimofthesubpixelXLDobjectsispaintedontothebackgroundi

58、mageusinganti-aliasing.Notethatonlyobjectswithoutcrossingsortouchingsegmentsarepaintedcorrectly.GrayvalcontainsthegrayvaluesforpaintingtheXLDobjects.Thesegrayvaluescaneitherbespecifiedforeachchannelonce,validforallXLDobjects,orforeachXLDobjectseparately.Todefinethelatter,groupthechannelgrayvaluesgof

59、eachXLDobjectandconcatenatethemtoatupleaccordingtotheorderoftheXLDobjects,e.g.,forathreechannelimage:g(channel1,xld1),g(channel2,xld1),g(channel3,xld1),g(channel1,xld2),.endforendforgen_rectangle2_contour_xld(Rectangle,RefRow,RefCol,0,0.5*LineWidthFraction*LineWidth,DieHeight)paint_xld(Rectangle,Tem

60、plate,Template,0)gen_rectangle2_contour_xld(Rectangle,RefRow,RefCol,0,DieWidth,0.5*LineWidthFraction*LineWidth)paint_xld(Rectangle,Template,Template,0)gen_rectangle2(ROI,RefRow,RefCol,0,DieWidth+5,DieHeight+5)gen_rectangle2(:Rectangle:Row,Column,Phi,Length1,Length2:)Createarectangleofanyorientation.

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论