public String recognizeText(File imageFile,String imageFormat)throws Exception{
		File tempImage = ImageIOHelper.createImage(imageFile,imageFormat);
		File outputFile = new File(imageFile.getParentFile(),"output");
		StringBuffer strB = new StringBuffer();
		List<String> cmd = new ArrayList<String>();
		if(OS.isWindowsXP()){
			cmd.add(tessPath+"//tesseract");
		}else if(OS.isLinux()){
			cmd.add("tesseract");
		}else{
			cmd.add(tessPath+"//tesseract");
		}
		cmd.add("");
		cmd.add(outputFile.getName());
	//	cmd.add("");
		cmd.add("");
	//	cmd.add(LANG_OPTION);
	//	cmd.add("chi_sim");
	//	cmd.add("eng");
		
	//	cmd.add(" -psm 7 ");
	//	cmd.add(" digits");
		ProcessBuilder pb = new ProcessBuilder();
		pb.directory(imageFile.getParentFile());
	//	System.out.println(imageFile.getParentFile());
		
		cmd.set(1, tempImage.getName());
		
	//	cmd.set(3, " -psm 7");
		cmd.set(3, "digits");
		
	//	System.out.println("cmd为："+cmd);
		pb.command(cmd);
		pb.redirectErrorStream(true);
		
		Process process = pb.start();
		//tesseract.exe 1.jpg 1 -l chi_sim
		int w = process.waitFor();
		
		//删除临时正在工作文件
		tempImage.delete();
		
		if(w==0){
			BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(outputFile.getAbsolutePath()+".txt"),"UTF-8"));
			
			String str;
			while((str = in.readLine())!=null){
				strB.append(str).append(EOL);
			}
			in.close();
		}else{
			String msg;
			switch(w){
				case 1:
					msg = "Errors accessing files.There may be spaces in your image's filename.";
					break;
				case 29:
					msg = "Cannot recongnize the image or its selected region.";
					break;
				case 31:
					msg = "Unsupported image format.";
					break;
				default:
					msg = "Errors occurred.";
			}
			tempImage.delete();
			throw new RuntimeException(msg);
		}
		new File(outputFile.getAbsolutePath()+".txt").delete();
		return strB.toString();
	}