Atitit 图像处理 公共模块 矩阵扫描器
Atitit 图像处理 公共模块 矩阵扫描器
1.1. 调用说明对矩阵像素遍历处理调用
List<Optional<Color>> li = mtrx.li_clr;
for(int i=0;i<li.size();i++)
{
int clrPointIdx=i;
Optional<Color> clr =li.get(i);
clr.ifPresent((p) -> {
//Integer color = clr.get();
int gray = ColorUtil.gray(p);
assignToBukeByGray(gray, p,clrPointIdx);
});
}
2. 矩阵扫描器主题结构
2.1. 主要说明 从像素点开始填充矩阵
public void fill_and_setMtrx_leftTop_XY_AllMode(int x, int y) {
this.leftTop_point=new Point(x, y);
colorLi_clrIntMod = Lists.newArrayList();
colorLi_grbInt_noOP = Lists.newArrayList();
li_clr = Lists.newArrayList();
li_hsv = Lists.newArrayList();
li_pts= Lists.newArrayList();
this.startPos_left_x = x;
this.start_top_y = y;
for (int i = x; i < w + x; i++)
for (int j = y; j < h + y; j++) {
Point pt=new Point(i,j);
try {
int rgb = img.getRGB(i, j);
Color c=new Color(rgb);
HSV h=ColorUtil.rgb2hsv(c);
h.x=x;h.y=y;
li_hsv.add(Optional.of(h));
li_clr.add(Optional.of(c));
//chMap.put(c, h);
} catch (ArrayIndexOutOfBoundsException e) {
li_clr.add(Optional.empty());
li_hsv.add(Optional.empty());
}
li_pts.add(pt);
}
}
2.2. 得到模板中心点所对应的图像坐标
public Point getCenterPoint() {
int x = this.startPos_left_x + w - 2;
int y = this.start_top_y + h - 2;
return new Point(x, y);
}
2.3. 主题源码
/**
*
*/
package com.attilax.img;
import java.awt.Color;
import java.awt.Point;
import java.awt.image.BufferedImage;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import com.attilax.ex.CantFindForgeColorEx;
import com.attilax.img.other.ColorUtil;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
/**
* @author attilax 2016年11月8日 下午6:15:13
*/
public class Matrix {
public int w;
public int h;
BufferedImage img;
List<Integer> colorLi_grbInt_noOP = Lists.newArrayList();
List<Optional<Integer>> colorLi_clrIntMod = Lists.newArrayList();
public List<Optional<Color>> li_clr = Lists.newArrayList();
public List<Optional<HSV>> li_hsv = Lists.newArrayList();
private int startPos_left_x;
private int start_top_y;
private com.attilax.lang.Function<Integer, Object> checkForgeColorFun;
private Point leftTop_point;
private int radis;
public Matrix(int i, int j) {
w = i;
h = j;
}
public Matrix() {
// TODO Auto-generated constructor stub
}
/**
* attilax 2016年11月8日 下午6:41:22
*
* @return
*/
public Map getCenterXy() {
Map m = Maps.newConcurrentMap();
int x = this.startPos_left_x + w - 2;
int y = this.start_top_y + h - 2;
m.put("x", x);
m.put("y", y);
return m;
}
public Point getCenterPoint() {
int x = this.startPos_left_x + w - 2;
int y = this.start_top_y + h - 2;
return new Point(x, y);
}
public Matrix setRadis(int i) {
this.radis=i;
this.w=2*i+1;
this.h=this.w;
return this;
}
publicMap<Color,HSV> chMap=Maps.newConcurrentMap();
List<Point> li_pts= Lists.newArrayList();
public void fill_and_setMtrx_leftTop_XY_AllMode(int x, int y) {
this.leftTop_point=new Point(x, y);
colorLi_clrIntMod = Lists.newArrayList();
colorLi_grbInt_noOP = Lists.newArrayList();
li_clr = Lists.newArrayList();
li_hsv = Lists.newArrayList();
li_pts= Lists.newArrayList();
this.startPos_left_x = x;
this.start_top_y = y;
for (int i = x; i < w + x; i++)
for (int j = y; j < h + y; j++) {
Point pt=new Point(i,j);
try {
int rgb = img.getRGB(i, j);
Color c=new Color(rgb);
HSV h=ColorUtil.rgb2hsv(c);
h.x=x;h.y=y;
li_hsv.add(Optional.of(h));
li_clr.add(Optional.of(c));
//chMap.put(c, h);
} catch (ArrayIndexOutOfBoundsException e) {
li_clr.add(Optional.empty());
li_hsv.add(Optional.empty());
}
li_pts.add(pt);
}
}
}
作者:: 绰号:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊 )
汉字名:艾提拉(艾龙), EMAIL:1466519819@qq.com
转载请注明来源: http://www.cnblogs.com/attilax/
Atiend
Atitit 图像处理 公共模块 矩阵扫描器的更多相关文章
- Atitit Atitit 图像处理之 Oilpaint油画滤镜 水彩画 源码实现
Atitit Atitit 图像处理之 Oilpaint油画滤镜 水彩画 源码实现 1.1. 具体原理参考1 2. 水彩画滤镜算法如下:1 2.1. 这个其实就是灰度层次降低维度的过程.2 2.2. ...
- Atitit 图像处理和计算机视觉的分类 三部分 图像处理 图像分析 计算机视觉
Atitit 图像处理和计算机视觉的分类 三部分 图像处理 图像分析 计算机视觉 1.1. 按照当前流行的分类方法,可以分为以下三部分:三部分 图像处理 图像分析 计算机视觉1 1.2. 图像处理需要 ...
- Atitit 图像处理知识点体系知识图谱 路线图attilax总结 v4 qcb.xlsx
Atitit 图像处理知识点体系知识图谱 路线图attilax总结 v4 qcb.xlsx 分类 图像处理知识点体系 v2 qb24.xlsx 分类 分类 理论知识 图像金字塔 常用底层操作 卷积扫描 ...
- Atitit 图像处理知识点 知识体系 知识图谱v2
Atitit 图像处理知识点 知识体系 知识图谱v2 霍夫变换(Hough Transform) 霍夫变换是图像处理中从图像中识别几何形状的基本方法之一,应用很广泛,也有很多改进算法.主要用来从图像 ...
- Atitit 图像处理知识点 知识体系 知识图谱
Atitit 图像处理知识点 知识体系 知识图谱 图像处理知识点 图像处理知识点体系 v2 qb24.xlsx 基本知识图像金字塔op膨胀叠加混合变暗识别与检测分类肤色检测other验证码生成 基本 ...
- Atitit 图像处理之理解卷积attilax总结
Atitit 图像处理之理解卷积attilax总结 卷积的运算可以分为反转.平移,相乘,求和. 在图像处理中,图像是一个大矩阵,卷积模板是一个小矩阵.按照上述过程,就是先把小矩阵反转,然 ...
- Atitit 图像处理—图像形态学(膨胀与腐蚀)
Atitit 图像处理-图像形态学(膨胀与腐蚀) 1.1. 膨胀与腐蚀1 1.2. 图像处理之二值膨胀及应用2 1.3. 测试原理,可以给一个5*5pic,测试膨胀算法5 1.4. Photoshop ...
- Atitit 常用sdk 模块 组织架构切分 规范与范例attilax总结
Atitit 常用sdk 模块 组织架构切分 规范与范例attilax总结 常用200个模块 2017/04/12 22:01 <DIR> acc 2017/04 ...
- Atitit 图像处理类库安装与安装模式的前世今生与未来大趋势attilax总结.docx
Atitit 图像处理类库安装与安装模式的前世今生与未来大趋势attilax总结.docx 1. 安装的原理,主要是解压,复制,设置三大步1 2. 目前我们常见的三大种安装模式,二进制模式与源码安装模 ...
随机推荐
- LoopBackJS 之 文件上传下载——使用loopback-component-storage
参考链接: http://loopback.io/doc/en/lb2/Storage-component.html#creating-a-storage-component-data-source ...
- configure: error: no acceptable C compiler found in $PAT 的解决方案
configure: error: no acceptable C compiler found in $PATH See `config.log' for more details.你的机器里没有安 ...
- Java回调函数
维基百科上的定义:在计算机程序设计中,回调函数,或简称回调,是指通过函数参数传递到其它代码的,某一块可执行代码的引用.这一设计允许了底层代码调用在高层定义的子程序. 所谓回调,就是客户程序C调用服务程 ...
- Webservice 65535 错误
修改配置项: <system.serviceModel> <behaviors> <endpointBehaviors> <behavior name=&qu ...
- 20151013 C# 第一篇 流程控制语句
20151013 流程控制语句: 1.选择语句 if … else if...else 选择语句 if(布尔表达式){ 语句块:} if(布尔表达式){ 语句块1:}else{ 语句块2:} i ...
- iOS 设置视图半透明而子控件不透明
用一张半透明的图片做背景 使用colorWithWhite:alpha:方法 white后面的参数表示灰度,从0-1之间表示从黑到白的变化,alpha就是你想调整的透明度 bgView.backgr ...
- Java中将0x开头的十六进制字符串转换成十进制整数
1.Integer.toString(int i) 由于input(输入数据)是以0x开头的字符串,并不是整型.因而在用 String s = Integer.toString(input); 时用会 ...
- Hive使用技巧
hive默认查询不会显示列名, 当一个表字段比较多的时候,往往看不出值与列之间的对应关系,对日常查错及定位问题带来不便,像下面这样. hive> >select * from exampl ...
- Linux Ubuntu12.04下安装OpenCv2.4.10
参考 http://blog.sina.com.cn/s/blog_53b0956801010lfu.html 捣鼓了一个晚上了,OpenCv还没装好,本来以为看个类似的比如Ubuntu安装OpenC ...
- 代写assignment
集英服务社,强于形,慧于心 集英服务社,是一家致力于优质学业设计的服务机构,为大家提供优质原创的学业解决方案.多年来,为海内外学子提供了多份原创优质的学业设计解决方案. 集英服务社,代写essay/a ...