亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? newtontrans.java

?? 一個多機器人的仿真平臺
?? JAVA
字號:
/* * NewtonTrans.java */package EDU.gatech.cc.is.newton;import	java.io.*;import	EDU.gatech.cc.is.util.Vec2;/**<B>Introduction</B><BR>Translates objects seen by an newton cognachrome board intorobot-centric coordinates using a linear interpolation method.It (will soon) catagorizes the blobs for channels A & B according to size.<P><B>Frames of Reference</B><BR>If (X,Y) is the center of a colored blob in the image, X is the column, numbered from 0 on the left to 200 on the right.  Y is the row, from0 at the top to 255 on the bottom.<P>In robot coordinates +x is forward, +y is to the left.A Nomad 150 is .24659467 meters in radius.<P><B>File Format</B><BR>To work properly, NewtonTrans must read a configuration file, passedto it at construction time.  Here is the format:<PRE>a_ratio          // true blob area = range * a_ratio * pixels_in_blob num_x            // number of X data elements row x_val        // the row of the bottom of the blob and the x coordinate row x_val        // MUST BE IN ASCENDING ROW ORDER !row x_valrow x_valrow x_valnum_y            // number of Y data elements col y_val        // the col of the center of the blob and the y coordinate col y_valcol y_valcol y_valcol y_val</PRE>Here is an example file:<PRE>0.00007676243391  2.40559129 1.31339235 0.36089395  -0.762136 0190 0.762</PRE>@author (c)1997 Tucker Balch, All Rights Reserved@version July 1997*/public class NewtonTrans	{	protected double[] xLut = new double[256];	protected double[] yLut = new double[256];	protected double	a_ratio;	protected	Newton	newt;	private   double[]	ranges = new double[MAX_BLOBS];	private   double[]	areasd = new double[MAX_BLOBS];	public static final double NO_DATA = -999;	public static final int MAX_BLOBS = 50;	public static final double BIG = 0.08; // square meters	public static final double ALL_MIN = 0.0027; // square meters	public static final boolean DEBUG = false;		/**	Instantiate a <B>newton.NewtonTrans</B> object.	@param n the Newton object to get data from.	@param f the configuration file name.	*/	public NewtonTrans(Newton n, String f) 		{		String token;		// initialize global variables		newt = n;		for(int i=0; i<256; i++)			xLut[i] = NO_DATA;		for(int i=0; i<256; i++)			yLut[i] = NO_DATA;		a_ratio = 0.00007;		try			{			// set up to to reading			FileReader file = new FileReader(f);			StreamTokenizer in = new StreamTokenizer(file);			token = "begining of file";			// get a_ratio			if (in.nextToken()==StreamTokenizer.TT_NUMBER)				a_ratio = in.nval;			else				{				token = in.sval;				throw new IOException();				}			// get x_num			int x_num;			if (in.nextToken()==StreamTokenizer.TT_NUMBER)				x_num = (int)in.nval;			else				{				token = in.sval;				throw new IOException();				}			// fill in the X look up table			in.nextToken();			double start_row = in.nval;			in.nextToken();			double start_x = in.nval;			for (int i=0; i<(x_num-1); i++)				{				in.nextToken();				double next_row = in.nval;				in.nextToken();				double next_x = in.nval;				double step = (next_x-start_x)/						(next_row - start_row);				for(int j = 0; 					j <=(int)(next_row-start_row); j++)						xLut[j+(int)start_row] 							= start_x 							+(double)j*step;				start_row = next_row;				start_x = next_x;				}			// get y_num			int y_num;			if (in.nextToken()==StreamTokenizer.TT_NUMBER)				y_num = (int)in.nval;			else				{				token = in.sval;				throw new IOException();				}			// fill in the Y look up table			in.nextToken();			double start_col = in.nval;			in.nextToken();			double start_y = in.nval;			for (int i=0; i<(y_num-1); i++)				{				in.nextToken();				double next_col = in.nval;				in.nextToken();				double next_y = in.nval;				double step = (next_y-start_y)/						(next_col - start_col);				for(int j = 0; 					j <=(int)(next_col-start_col); j++)						yLut[j+(int)start_col] 							= start_y 							+(double)j*step;				start_col = next_col;				start_y = next_y;				}			}		catch(IOException e)			{			System.out.println(				"NewtonTrans: bad format " + 				"in configuration file, or file doesn't exist");			}		}	/**	Tell the newton to get a data frame.	*/	public void read_frame()		{		if (newt!=null) newt.read_frame();		}	/**	Get an array of Vec2s that point egocentrically from the	turret, or position of the camera to a perceived object.	@param chan the channel (color) of the data to get.	@return the array of visible objects.	*/	public Vec2[] getVisualObjects(int chan)		{		Vec2[] retval = new Vec2[0];		if ((chan < 0)||(chan>6))			{			System.out.println("NewtonTrans.getVisualObjects:"				+" illegal channel number: "+chan);			return(retval);			}		if (newt!=null) 			{			// get the blob data			int num = newt.getNumVis(chan%3);			int[] rows = new int[num];			int[] cols = new int[num];			int[] areas = new int[num];			newt.getY(chan%3,rows);			newt.getX(chan%3,cols);			newt.getArea(chan%3,areas);			if (DEBUG/*true*/) 				System.out.println("NewtonTrans.getVisualObjects: "					+num+" blobs on channel "+chan);			//compute the bottoms and areas of the blobs			int[] bot = new int[num];			for(int i=0; i<num; i++)				{				bot[i] = rows[i] + (areas[i]/2);				if (bot[i]>255) bot[i] = 255;				ranges[i] = yLut[cols[i]]*yLut[cols[i]]						+xLut[bot[i]]*xLut[bot[i]];				ranges[i] = Math.sqrt(ranges[i]);				areasd[i] = ranges[i] * (double)(areas[i]*						areas[i]) * a_ratio;				}			// compute how many blobs are valid			int valid = 0;			for(int i=0; i<num; i++)				{				if (DEBUG) System.out.println(cols[i]+" "+rows[i]+					" "+areas[i]);				if	(						// if looking for small things					((chan<=2)					&&(ranges[i]<Math.abs(NO_DATA))						&&(areasd[i]<BIG)					&&(areas[i]>=5))//noise					||						// if looking for big things					((chan>2)					&&(ranges[i]<Math.abs(NO_DATA))						&&(areasd[i]>=BIG)					&&(areas[i]>=5))//noise					)					valid++;				}			if (DEBUG/*true*/) 				System.out.println("NewtonTrans.getVisualObjects: "					+valid+" valid blobs on channel "+chan);			// fill in the array			retval = new Vec2[valid];			int j = 0;			for(int i=0; i<num; i++)				{				if	(						// if looking for small things					((chan<=2)					&&(ranges[i]<Math.abs(NO_DATA))						&&(areasd[i]<BIG)					&&(areas[i]>=5))//noise					||						// if looking for big things					((chan>2)					&&(ranges[i]<Math.abs(NO_DATA))						&&(areasd[i]>=BIG)					&&(areas[i]>=5))//noise					)							{					retval[j] = new Vec2(						xLut[bot[i]],						yLut[cols[i]]);					j++;					}				}			}		return(retval);		}	/**	Test NewtonTrans	*/	public static void main(String args[])		{		Newton newt = null;		try			{			newt = new Newton(3,38400);			}		catch (Exception e)			{			System.out.println(e);			}		// the first part just demonstrates the file reading		NewtonTrans nt = new NewtonTrans(newt, "newton.cfg");		//System.out.println(nt.a_ratio);		//System.out.println("-----");		//for(int i=0; i<255; i++)			//{			//System.out.print(i+" ");			//if (i<=255)				//{				//System.out.print(nt.xLut[i]);				//System.out.println(" "+nt.yLut[i]);				//}			//else				//System.out.println(nt.xLut[i]);			//}		// now print the data		while(true)			{			newt.read_frame();			System.out.println("------");			Vec2[] things = nt.getVisualObjects(Newton.CHANNEL_A);			for (int i=0;i<things.length;i++)				System.out.println(things[i]);			}		}	}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久综合九色综合97婷婷女人| 亚洲国产视频网站| 一区二区不卡在线视频 午夜欧美不卡在 | 亚洲成人精品在线观看| 国产精品99久久久| 欧美一区二区三区四区五区| 国产精品国产三级国产普通话蜜臀| 免费精品视频在线| 欧美三级乱人伦电影| 亚洲人一二三区| 国产99久久久国产精品潘金| 日韩午夜小视频| 亚洲第一狼人社区| 日本韩国一区二区| 亚洲欧洲色图综合| 波多野结衣中文一区| 久久午夜国产精品| 蜜臂av日日欢夜夜爽一区| 欧美在线制服丝袜| 亚洲一区国产视频| 欧美亚洲动漫精品| 亚洲国产日产av| 欧美在线一二三| 亚洲韩国精品一区| 欧美亚洲日本一区| 亚洲综合久久久久| 欧美日韩精品欧美日韩精品| 夜夜亚洲天天久久| 在线视频国产一区| 一区二区三区免费看视频| 色哟哟亚洲精品| 悠悠色在线精品| 欧美人狂配大交3d怪物一区 | 久久蜜桃一区二区| 国产久卡久卡久卡久卡视频精品| 精品日韩欧美一区二区| 九九**精品视频免费播放| 日韩精品综合一本久道在线视频| 日韩在线卡一卡二| 欧美xxxxx牲另类人与| 精品一区二区三区久久久| 久久日一线二线三线suv| 国产伦精品一区二区三区视频青涩 | 中文字幕一区二区三区蜜月 | 91麻豆精品国产91久久久更新时间 | 久久综合色综合88| 国产精品一区二区在线播放| 久久久久国产精品人| 国产91高潮流白浆在线麻豆 | 蜜芽一区二区三区| 精品国产乱码久久久久久夜甘婷婷| 国内精品自线一区二区三区视频| 国产偷国产偷精品高清尤物 | 午夜天堂影视香蕉久久| 欧美一级在线免费| 国产原创一区二区三区| 中文字幕一区二区三区四区| 欧美美女一区二区三区| 国产伦精品一区二区三区在线观看| 国产精品久久久久7777按摩| 欧美视频你懂的| 国产精品一区二区你懂的| 亚洲女同ⅹxx女同tv| 日韩久久精品一区| 91丨porny丨中文| 蜜桃av一区二区三区| 亚洲视频在线一区二区| 日韩午夜激情视频| 一本久道久久综合中文字幕| 麻豆成人av在线| 亚洲蜜臀av乱码久久精品 | 欧美性猛交一区二区三区精品| 麻豆91免费看| 洋洋成人永久网站入口| 久久品道一品道久久精品| 欧美在线观看视频一区二区| 国产在线一区二区| 天天爽夜夜爽夜夜爽精品视频| 久久久精品综合| 欧美电影在线免费观看| 91亚洲国产成人精品一区二三| 老司机免费视频一区二区三区| 亚洲男人的天堂在线观看| xf在线a精品一区二区视频网站| 欧美偷拍一区二区| 91色九色蝌蚪| 成人午夜av影视| 久久www免费人成看片高清| 亚洲精品福利视频网站| 欧美国产97人人爽人人喊| 欧美一级二级三级乱码| 欧美人与禽zozo性伦| 日本道精品一区二区三区| 成人av手机在线观看| 狠狠色狠狠色合久久伊人| 日韩高清在线不卡| 亚洲va天堂va国产va久| 亚洲精品写真福利| 亚洲男人电影天堂| 亚洲日本一区二区| 综合分类小说区另类春色亚洲小说欧美| 精品国产污污免费网站入口 | 丁香桃色午夜亚洲一区二区三区| 日韩电影在线观看一区| 亚洲国产成人porn| 一区二区激情小说| 亚洲激情一二三区| 国产精品初高中害羞小美女文| 2021久久国产精品不只是精品| 日韩免费电影网站| 欧美刺激脚交jootjob| 欧美成人艳星乳罩| 久久综合九色综合97婷婷女人 | 亚洲一区国产视频| 亚洲国产视频直播| 亚洲不卡在线观看| 麻豆精品国产传媒mv男同| 久久99国产精品免费网站| 另类的小说在线视频另类成人小视频在线| 日本午夜精品视频在线观看| 美日韩黄色大片| 国产精品456| 成人av高清在线| 日本精品视频一区二区| 欧美中文字幕一区二区三区 | 欧美日韩三级一区| 欧美日韩不卡一区| 日韩一区二区三区电影在线观看 | 7777精品伊人久久久大香线蕉| 91精品国产综合久久福利软件 | 日韩一区二区免费在线观看| 欧美成人官网二区| 国产精品视频第一区| 亚洲色欲色欲www在线观看| 一区二区三区加勒比av| 亚洲1区2区3区视频| 免播放器亚洲一区| 成人免费福利片| 欧美日韩亚洲综合在线| 精品裸体舞一区二区三区| 国产精品视频免费| 丝袜国产日韩另类美女| 国产一区二区在线免费观看| 成人免费黄色大片| 777午夜精品视频在线播放| 国产午夜精品理论片a级大结局| 樱桃视频在线观看一区| 日本v片在线高清不卡在线观看| 国产福利一区二区| 色欧美乱欧美15图片| 精品美女在线观看| 一个色综合网站| 国产精品一二三四| 欧美日韩国产电影| 欧美国产日韩在线观看| 舔着乳尖日韩一区| 福利电影一区二区三区| 欧美日韩国产一二三| 国产色婷婷亚洲99精品小说| 亚洲大片在线观看| 风间由美一区二区av101| 欧美一级日韩不卡播放免费| 中文字幕一区二区三区精华液| 久久精品久久久精品美女| 色婷婷激情综合| 久久久综合精品| 日韩综合小视频| 本田岬高潮一区二区三区| 日韩欧美www| 亚洲成人午夜影院| 日本高清无吗v一区| 欧美国产禁国产网站cc| 老司机精品视频导航| 欧美视频一区在线| 亚洲日本在线观看| 成人av手机在线观看| 精品日本一线二线三线不卡| 亚洲精品国产第一综合99久久| 国产成人精品免费网站| 欧美电影免费观看高清完整版在线观看 | 国产一区二区三区精品视频| 在线观看91精品国产麻豆| 亚洲一区在线免费观看| 97se亚洲国产综合在线| 中文字幕av一区二区三区高| 九色综合狠狠综合久久| 欧美一区二区三区精品| 亚洲愉拍自拍另类高清精品| av激情成人网| 国产精品家庭影院| 狠狠色丁香久久婷婷综合丁香| 91精品国产高清一区二区三区蜜臀 | 日韩一区二区三区高清免费看看| 亚洲香肠在线观看| 欧美三级电影在线观看| 亚洲综合成人在线视频| 色老汉av一区二区三区| 一区二区三区四区精品在线视频| eeuss鲁片一区二区三区在线观看| 中文字幕欧美激情一区|