当前位置:首页 > 芯闻号 > 充电吧
[导读]Atitit 图像资料文档分类器 netpic image 网络图片与人像图片分类   微信图片分类D:\0workspace\atiplat_img\src\com\attilax\img\util


Atitit 图像资料文档分类器 netpic image 网络图片与人像图片分类

 

 

 

微信图片分类

D:workspaceatiplat_imgsrccomattilaximgutilWechatPicFinder.java

 

手写日记 账单分类器

D:workspaceatiplat_imgsrccomattilaximgutilWechatPicFinderManaDiaryNCyarlogV2.java

 

package com.attilax.img.picClassifier;

 

import java.awt.Color;

import java.awt.image.BufferedImage;

import java.util.concurrent.ExecutorService;

import java.util.concurrent.Executors;

import java.util.concurrent.ThreadPoolExecutor;

import java.util.function.Function;

 

import com.alibaba.fastjson.serializer.JSONSerializer;

import com.alibaba.fastjson.serializer.PropertyPreFilter;

import com.alibaba.fastjson.serializer.SerializerFeature;

import com.attilax.img.HSV;

import com.attilax.img.HsvRangeV2;

import com.attilax.img.imgx;

import com.attilax.img.other.ColorUtil;

import com.attilax.io.dirx;

import com.attilax.io.filex;

import com.attilax.io.util.FileUtil_tmp4img;

import com.attilax.json.AtiJson;

import com.attilax.util.FileUtil;

 

public class PicClassifierByNetpicNimgpic {

 

public static int num = 0;

 

public static void main(String[] args) {

 

// 28 16 88 , 40 12 85

// HSV hi = new HSV(200, 20, 95);

// sHSV low = new HSV(20, 0, 50);

float NetPicWhitepointCountLmt = 300; // percent

 

String strPath = "C:\0000wechatpic";

strPath = "D:\ati notvery impt\r2017 cp pic bek v5 s229\cp pic r2017 q4";

// + "//cp pic r2017 q2 v3 s223\";

// String targetDir = "C:\0000wechatpic_tar_NetInfoPic";

String targetDir = "D:\ati notvery impt\r2017 cp pic bek v5 s229\cp pic r2017 q4 netpic incInfCyarOcr";

// + "\cp pic r2017 q2 netpic incInfCyarOcr";

 

String strPath_final = strPath;

 

ThreadPoolExecutor ExecutorService1_theardpool = (ThreadPoolExecutor) Executors.newFixedThreadPool(4);

ExecutorService ExecutorService1=ExecutorService1_theardpool;

dirx.traveV3(strPath, new Function

 

@Override

public Object apply(String cur_f) {

num++;

System.out.println("num:" + num);

if (cur_f.contains("IMG_2017"))

return null; // jmp

ExecutorService1_theardpool.submit(new Runnable() {

 

@Override

public void run() {

try {

createTask(NetPicWhitepointCountLmt, targetDir, strPath_final, cur_f);

} catch (Exception e) {

  System.out.println(e);

}


 

}

}); // end sumbit

return null;

// end apply

 

}

 

private Object createTask(float wechatPicLmt, String targetDir, String strPath_final, String cur_f) {

 

System.out.println("tgg");

// only chat msg

// HSV hi = new HSV(95, 65, 95);

// HSV low = new HSV(85, 55, 85);

 

// all wechat pic

 

// HsvRangeV2 ran = new HsvRangeV2(low, hi);

 

// String f = "C:\0000wechatpic\a.png";

/*

 * BufferedImage image = imgx.toImg(cur_f); int heit =

 * image.getHeight(); int gray = 0; int hitCount = 0; for (int

 * curheit = 0; curheit < heit; curheit++) { for (int curwid =

 * 0; curwid < image.getWidth(); curwid++) { if (curwid == 609

 * && curheit == 699) System.out.println("dbg"); int clr_int =

 * image.getRGB(curwid, curheit);

 *

 * Color cc2 = new Color(clr_int); if ( ColorUtil.isWit(cc2)){

 * // if( isInSomeConditon()) hitCount++; }

 *

 * } } float pct = (float) hitCount / (heit * image.getWidth())

 * * 100; System.out.println("hitCount:" + hitCount + ",f:" +

 * cur_f);

 */

// System.out.println("pct:" + pct + ",f:" + cur_f);

 

System.out.println("_theardpool.getQueue().size(:" + ExecutorService1_theardpool.getQueue().size());

// System.out.println("_theardpool:

// "+AtiJson.toJson(ExecutorService1_theardpool));

System.out.println("_theardpool: "

+ com.alibaba.fastjson.JSON.toJSONString(ExecutorService1_theardpool, new PropertyPreFilter() {

 

@Override

public boolean apply(JSONSerializer arg0, Object arg1, String prop) {

//// rt false //not show

if (prop.equals("queue"))

return false;

else

return true;

}

}, new SerializerFeature[] { SerializerFeature.PrettyFormat }));

// if (pct > wechatPicLmt) {

if (imgx.containsWhiteLine(cur_f)) {

 

System.out.println("containsWhiteLine:" + "" + ",f:" + cur_f);

// System.out.println("pct:" + pct + ",f:" + cur_f);

 

filex.move(cur_f, targetDir, strPath_final);

// FileUtil_tmp4img.copy(cur_f, targetDir, strPath_final);

 

}

return null;

}

});

 


ExecutorService1.shutdown();

System.out.println("--ExecutorService1.shutdown");

}

 

}

 


本站声明: 本文章由作者或相关机构授权发布,目的在于传递更多信息,并不代表本站赞同其观点,本站亦不保证或承诺内容真实性等。需要转载请联系该专栏作者,如若文章内容侵犯您的权益,请及时联系本站删除。
换一批
延伸阅读

(全球TMT2021年9月24日)2021年9月24日,佳能(中国)有限公司发布imagePROGRAF TZ系列,并推出了新系列的首款产品 -- imagePROGRAF TZ-5300/5300

关键字: image 佳能

Atitit 格式转换的艺术以excel转换txt为例 目录1. 需要的技术 11.1. 遍历 与循环 11.2. 序列化 31.3. 文本序列化 json csv 32. Bp最佳实践与流程总结 3

关键字: atitit 遍历与循环模式

Atitit 网络设备的自动发现机制需求如下:1、自动获取当前设备所在网段及当前与当前网段有连接的网段的所有IP,并判断出是哪类设备。如:服务器、交换机、防火墙等。2、如何根据第1点得到的信息,获取设

关键字: atitit 网络设备

Atitit  依赖管理之道1. 概念 依赖管理,是指在什么地方以什么形式引入外部代码。 11.1.1. 理解模块化和依赖管理: 11.2. 依赖管理,有三个层面。 单一职责原则,协议对象引用,依赖逻

关键字: atitit

Atitit 知识点 文章 框架 结构 大纲 attilax  总结 艾提拉总结 技术掌握文档总结的 v5 s420.docx1.1. Preface前言 序言 12. 技术流程了解》》选型(标准化与

关键字: atitit

Atitit 健康减肥与软件健康减肥的总结 attilax著 1. 几大最佳实践减肥行为 11.1. 控制饮食分量用小碗 小盘子 小餐具 11.2. 软件如何减肥,控制资源占有率,比如体积 打包体积小

关键字: atitit 封装

Atitit 艾提拉整理清明节的诗歌集合 清明节的特征  万物复苏 百草发芽  尝试从股市 其他外国诗歌集 得到清明的诗歌 约谈春天 歌颂春天下雨 不见方三日、 夜来风雨声,花落知多少。(孟浩然:《春

关键字: atitit

Atitit 知识与学科的分类 杜威十进分类法 图书分类法已经采用二十二个大类 目录1.1. 类知识的积累是一个从少到多的过程 11.2. 杜威十进分类法(Dewey Decimal Classifi

关键字: atitit

Atitit webdav 的问题 -------------大文件传输问题 在某些版本的 Windows 操作系统中,WebDAV 驱动器的最大文件大小被限制为 50MB。如果你试图复制超过 50M

关键字: atitit webdav 大文件传输

Atitit oil painting article list sumup s55  C:\Users\Administrator\Desktop\油画技术资料包\Atitit Atitit 图像处

关键字: atitit
关闭
关闭