⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 haarcascade.as

📁 Face detection for Actionscript 3
💻 AS
📖 第 1 页 / 共 5 页
字号:
//
// Project Marilena
// Object Detection in Actionscript3
// based on OpenCV (Open Computer Vision Library) Object Detection
//
// Copyright (C) 2008, Masakazu OHTSUKA (mash), all rights reserved.
// contact o.masakazu(at)gmail.com
//
// additional optimizations by Mario Klingemann / Quasimondo
// contact mario(at)quasimondo.com
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
//   * Redistribution's of source code must retain the above copyright notice,
//     this list of conditions and the following disclaimer.
//
//   * Redistribution's in binary form must reproduce the above copyright notice,
//     this list of conditions and the following disclaimer in the documentation
//     and/or other materials provided with the distribution.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//

package jp.maaash.ObjectDetection
{
	import flash.geom.Rectangle;
	
	public final class HaarCascade
	{
		public  var base_window_w   :int;
		public  var base_window_h   :int;
		public  var inv_window_area :Number;
		public  var trees           :Array;
		public var targetImage:TargetImage;
		private var _scale          :Number = 0;
		
		private var firstTree:FeatureTree;
		
		public function HaarCascade()
		{
			init();
		}
		
		private function init():void
		{
			base_window_w = base_window_h =20;
			
			var tree:FeatureTree;
			var feature:FeatureBase;
			
			tree = firstTree = new FeatureTree(0.822689414024353);
			feature = tree.firstFeature = new Feature2Rects(0.004014195874333382,0.0337941907346249,0.8378106951713562,[3,7,14,4,-1],[3,9,14,2,2]);
			feature = feature.next = new Feature2Rects(0.0151513395830989,0.1514132022857666,0.7488812208175659,[1,2,18,4,-1],[7,2,6,4,3]);
			feature.next = new Feature2Rects(0.004210993181914091,0.0900492817163467,0.6374819874763489,[1,7,15,9,-1],[1,10,15,3,3]);
			
			
			tree = tree.next = new FeatureTree(6.956608772277832);
			feature = tree.firstFeature = new Feature2Rects(0.0016227109590545297,0.0693085864186287,0.7110946178436279,[5,6,2,6,-1],[5,9,2,3,2]);
			feature = feature.next = new Feature2Rects(0.002290664939209819,0.1795803010463715,0.6668692231178284,[7,5,6,3,-1],[9,5,2,3,3]);
			feature = feature.next = new Feature2Rects(0.005002570804208517,0.1693672984838486,0.6554006934165955,[4,0,12,9,-1],[4,3,12,3,3]);
			feature = feature.next = new Feature2Rects(0.007965989410877228,0.5866332054138184,0.0914145186543465,[6,9,10,8,-1],[6,13,10,4,2]);
			feature = feature.next = new Feature2Rects(-0.003522701095789671,0.1413166970014572,0.6031895875930786,[3,6,14,8,-1],[3,10,14,4,2]);
			feature = feature.next = new Feature2Rects(0.0366676896810532,0.3675672113895416,0.7920318245887756,[14,1,6,10,-1],[14,1,3,10,2]);
			feature = feature.next = new Feature2Rects(0.009336147457361221,0.6161385774612427,0.2088509947061539,[7,8,5,12,-1],[7,12,5,4,3]);
			feature = feature.next = new Feature2Rects(0.008696131408214569,0.2836230993270874,0.6360273957252502,[1,1,18,3,-1],[7,1,6,3,3]);
			feature = feature.next = new Feature2Rects(0.0011488880263641477,0.2223580926656723,0.5800700783729553,[1,8,17,2,-1],[1,9,17,1,2]);
			feature = feature.next = new Feature2Rects(-0.002148468978703022,0.2406464070081711,0.5787054896354675,[16,6,4,2,-1],[16,7,4,1,2]);
			feature = feature.next = new Feature2Rects(0.0021219060290604834,0.5559654831886292,0.136223703622818,[5,17,2,2,-1],[5,18,2,1,2]);
			feature = feature.next = new Feature2Rects(-0.0939491465687752,0.8502737283706665,0.4717740118503571,[14,2,6,12,-1],[14,2,3,12,2]);
			feature = feature.next = new Feature3Rects(0.0013777789426967502,0.5993673801422119,0.2834529876708984,[4,0,4,12,-1],[4,0,2,6,2],[6,6,2,6,2]);
			feature = feature.next = new Feature2Rects(0.0730631574988365,0.4341886043548584,0.7060034275054932,[2,11,18,8,-1],[8,11,6,8,3]);
			feature = feature.next = new Feature2Rects(0.00036767389974556863,0.3027887940406799,0.6051574945449829,[5,7,10,2,-1],[5,8,10,1,2]);
			feature.next = new Feature2Rects(-0.0060479710809886456,0.17984339594841,0.5675256848335266,[15,11,5,3,-1],[15,12,5,1,3]);
								
			tree = tree.next = new FeatureTree(9.498542785644531);
			feature = tree.firstFeature = new Feature2Rects(-0.0165106896311045,0.6644225120544434,0.1424857974052429,[5,3,10,9,-1],[5,6,10,3,3]);
			feature = feature.next = new Feature2Rects(0.002705249935388565,0.6325352191925049,0.1288477033376694,[9,4,2,14,-1],[9,11,2,7,2]);
			feature = feature.next = new Feature2Rects(0.002806986914947629,0.1240288019180298,0.6193193197250366,[3,5,4,12,-1],[3,9,4,4,3]);
			feature = feature.next = new Feature2Rects(-0.0015402400167658925,0.1432143002748489,0.5670015811920166,[4,5,12,5,-1],[8,5,4,5,3]);
			feature = feature.next = new Feature2Rects(-0.0005638627917505801,0.1657433062791824,0.5905207991600037,[5,6,10,8,-1],[5,10,10,4,2]);
			feature = feature.next = new Feature2Rects(0.0019253729842603209,0.2695507109165192,0.5738824009895325,[8,0,6,9,-1],[8,3,6,3,3]);
			feature = feature.next = new Feature2Rects(-0.005021484103053808,0.1893538981676102,0.5782774090766907,[9,12,1,8,-1],[9,16,1,4,2]);
			feature = feature.next = new Feature2Rects(0.002636542078107595,0.2309329062700272,0.5695425868034363,[0,7,20,6,-1],[0,9,20,2,3]);
			feature = feature.next = new Feature2Rects(-0.0015127769438549876,0.2759602069854736,0.5956642031669617,[7,0,6,17,-1],[9,0,2,17,3]);
			feature = feature.next = new Feature2Rects(-0.0101574398577213,0.1732538044452667,0.5522047281265259,[9,0,6,4,-1],[11,0,2,4,3]);
			feature = feature.next = new Feature2Rects(-0.011953660286963,0.1339409947395325,0.5559014081954956,[5,1,6,4,-1],[7,1,2,4,3]);
			feature = feature.next = new Feature2Rects(0.004885949194431305,0.3628703951835632,0.6188849210739136,[12,1,6,16,-1],[14,1,2,16,3]);
			feature = feature.next = new Feature3Rects(-0.0801329165697098,0.0912110507488251,0.5475944876670837,[0,5,18,8,-1],[0,5,9,4,2],[9,9,9,4,2]);
			feature = feature.next = new Feature3Rects(0.0010643280111253262,0.3715142905712128,0.5711399912834167,[8,15,10,4,-1],[13,15,5,2,2],[8,17,5,2,2]);
			feature = feature.next = new Feature3Rects(-0.0013419450260698795,0.5953313708305359,0.331809788942337,[3,1,4,8,-1],[3,1,2,4,2],[5,5,2,4,2]);
			feature = feature.next = new Feature3Rects(-0.0546011403203011,0.1844065934419632,0.5602846145629883,[3,6,14,10,-1],[10,6,7,5,2],[3,11,7,5,2]);
			feature = feature.next = new Feature2Rects(0.0029071690514683723,0.3594244122505188,0.6131715178489685,[2,1,6,16,-1],[4,1,2,16,3]);
			feature = feature.next = new Feature2Rects(0.0007471871795132757,0.5994353294372559,0.3459562957286835,[0,18,20,2,-1],[0,19,20,1,2]);
			feature = feature.next = new Feature2Rects(0.004301380831748247,0.4172652065753937,0.6990845203399658,[8,13,4,3,-1],[8,14,4,1,3]);
			feature = feature.next = new Feature2Rects(0.004501757211983204,0.4509715139865875,0.7801457047462463,[9,14,2,3,-1],[9,15,2,1,3]);
			feature.next = new Feature2Rects(0.0241385009139776,0.5438212752342224,0.1319826990365982,[0,12,9,6,-1],[0,14,9,2,3]);
		
								
			tree = tree.next = new FeatureTree(18.4129695892334);
			feature = tree.firstFeature = new Feature2Rects(0.001921223010867834,0.1415266990661621,0.6199870705604553,[5,7,3,4,-1],[5,9,3,2,2]);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -