注意注册区别 组织用户注册:Sign Up to a Free Trial 个人用户注册:Sign Up to an Open Source account
简单粗暴:gmail注册
插件写在build.gradle中,适用简单功能
class ExtensionBean {
String message = null
}
class TestPlugin implements Plugin<Project> {
@Override
void apply(Project project) {
project.extensions.create('e', ExtensionBean)
project.task('test') << {
println 'msg:' + project['e'].message
}
}
}
apply plugin: TestPlugin
e {
message = 'hello world'
}
源码放在rootProjectDir/buildSrc/src/main/groovy,只对项目可见
|- build.gradle
|-src
|-main
|-groovy
|-包名
|-resources
|-META-INF
|-gradle-plugins
|-插件名.properties
// 本地发布
apply plugin: 'groovy'
apply plugin: 'maven'
dependencies {
implementation gradleApi()
implementation localGroovy()
implementation 'org.javassist:javassist:3.25.0-GA'
implementation 'com.android.tools.build:gradle:3.4.2'
}
repositories {
mavenCentral()
}
group = "..."
version = "1.0.0"
uploadArchives{
repositories {
// 本地发布
mavenDeployer {
repository(url: uri('../repo'))
}
}
}
implementation-class=包名.插件实现类
buildscript {
repositories {
//本地依赖
maven{url uri('repo')}
}
dependencies {
...
classpath 'groupId:modulename:version'
}
}
方式一、图片转换成tif ,设置DPI
#调整图片dpi,生成tif图片
$convert '*.jpg' -density 300 image_%d.tif
方式二、jTessBoxEditor 合并成多个tif文件
训练用tif文件命名格式 : [lang].[fontname].exp[num].tif lang : 语言名称 fontname : 字体名称 num : 字体分组编号
$tesseract chi_sim.Arial.exp1.tif chi_sim.Arial.exp1 makebox batch.nochop
jTessBoxEditor 修改 *.tif *.box准确性
tesseract chi_sim.Arial.exp1.tif chi_sim.Arial.exp1 box.train
## 生成uncharset文件
##Tesseract’s unicharset file contains information on each symbol (unichar) the Tesseract OCR engine is trained to recognize.Currently, generating the unicharset file is done in two steps using these commands: unicharset_extractor and set_unicharset_properties.NOTE: The unicharset file must be regenerated whenever inttemp, normproto and pffmtable are generated (i.e. they must all be recreated when the box file is changed) as they have to be in sync.
$unicharset_extractor chi_sim.Arial.exp1.box chi_sim.Arial.exp2.box chi_sim.Arial.exp3.box chi_sim.Arial.exp4.box
## 设置属性
$set_unicharset_properties -U input_unicharset -O output_unicharset --script_dir=training/langdata
[fontname][italic][bold][fixed][serif][fraktur]
#gen shaptable
$shapeclustering -F font_properties -U chi_sim.unicharset *.tr
#gen inttemp
$mftraining -F font_properties -U unicharset -O chi_sim.unicharset *.tr
# ten normproto
$cntraining *.tr
生成的五个文件shapetable,normproto,inttemp,pffmtable,unicharset 用[lang]为前缀重命名
combine_tessdata chi_sim.