当前位置: 首页>>代码示例>>C#>>正文


C# XYCoord.Dispose方法代码示例

本文整理汇总了C#中XYCoord.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# XYCoord.Dispose方法的具体用法?C# XYCoord.Dispose怎么用?C# XYCoord.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XYCoord的用法示例。


在下文中一共展示了XYCoord.Dispose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: image

        /*  Description:
                Locates the characters of the license plate
	                - Warp image (Rectify)
	                - Segment characters
	                - Remove blobs which are to small (Lines between characters)
            Input:
	            //Original image
	            RGB888Image plateImage
	            //Segmented license plate
	            Int16Image binaryPlateImage
            Output:
	            //Image containing binary six characters	
	            ref Int16Image binaryCharacterImage 
            Return:
	            //Function executed successfully
	            bool
        */
        public static bool FindCharacters(RGB888Image plateImage, Int16Image binaryPlateImage, ref Int16Image binaryCharacterImage)
        {
            //Constants
            const int c_height = 100;
            const int c_width = 470;
            const int c_remove_blobs_min = 0;
            const int c_remove_blobs_max = 400;

            XYCoord leftTop = new XYCoord();
            XYCoord rightTop = new XYCoord();
            XYCoord leftBottom = new XYCoord();
            XYCoord rightBottom = new XYCoord();

            // 2de set coordinaten:
            // NIEUW
            XYCoord leftTop2 = new XYCoord();
            XYCoord rightTop2 = new XYCoord();
            XYCoord leftBottom2 = new XYCoord();
            XYCoord rightBottom2 = new XYCoord();

            //Find licenseplate
            Int32Image binaryPlateImage32 = new Int32Image();
            VisionLab.Convert(binaryPlateImage, binaryPlateImage32);
            
            VisionLab.FindCornersRectangle(
                binaryPlateImage32, 
                Connected.EightConnected, 
                0.5, 
                Orientation.Landscape, 
                leftTop, 
                rightTop, 
                leftBottom, 
                rightBottom
            );

            // NIEUW
            // Coordinaten bepalen voor deze functie
            VisionLab.FindCornersRectangleSq(
                    binaryPlateImage32,
                    Connected.EightConnected,
                    leftTop2,
                    rightTop2,
                    leftBottom2,
                    rightBottom2
                );

            binaryPlateImage32.Dispose();

            Int16Image plateImageGray = new Int16Image();

            VisionLab.Convert(plateImage, plateImageGray);
            binaryCharacterImage.Assign_Op(plateImageGray);
            
            // Eerst de standaard wrap proberen
            try
            {
                //Rectify plate
                VisionLab.Warp(
                    plateImageGray, 
                    binaryCharacterImage, 
                    TransformDirection.ForwardT, 
                    new Coord2D(leftTop), 
                    new Coord2D(rightTop), 
                    new Coord2D(leftBottom), 
                    new Coord2D(rightBottom), 
                    c_height, 
                    c_width, 
                    0
                );
            }
            catch (Exception )
            {
                // NIEUW
                // Als dat mislukt dan de andere gebruiken
                try
                {
                    VisionLab.Warp(plateImageGray,
                        binaryCharacterImage,
                        TransformDirection.ForwardT,
                        new Coord2D(leftTop2),
                        new Coord2D(rightTop2),
                        new Coord2D(leftBottom2),
                        new Coord2D(rightBottom2),
//.........这里部分代码省略.........
开发者ID:eddiesprietsma,项目名称:licplates11Okt12_b,代码行数:101,代码来源:LicensePlateMatcher.cs


注:本文中的XYCoord.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。