Atitit 图像处理 公共模块 矩阵扫描器

1.1. 调用说明对矩阵像素遍历处理调用1

2. 矩阵扫描器主题结构1

2.1. 主要说明 从像素点开始填充矩阵1

2.2. 得到模板中心点所对应的图像坐标2

2.3. 主题源码2

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 图像处理 公共模块 矩阵扫描器的更多相关文章

  1. Atitit Atitit 图像处理之  Oilpaint油画滤镜 水彩画 源码实现

    Atitit Atitit 图像处理之 Oilpaint油画滤镜 水彩画 源码实现 1.1. 具体原理参考1 2. 水彩画滤镜算法如下:1 2.1. 这个其实就是灰度层次降低维度的过程.2 2.2. ...

  2. Atitit 图像处理和计算机视觉的分类 三部分 图像处理 图像分析 计算机视觉

    Atitit 图像处理和计算机视觉的分类 三部分 图像处理 图像分析 计算机视觉 1.1. 按照当前流行的分类方法,可以分为以下三部分:三部分 图像处理 图像分析 计算机视觉1 1.2. 图像处理需要 ...

  3. Atitit 图像处理知识点体系知识图谱 路线图attilax总结 v4 qcb.xlsx

    Atitit 图像处理知识点体系知识图谱 路线图attilax总结 v4 qcb.xlsx 分类 图像处理知识点体系 v2 qb24.xlsx 分类 分类 理论知识 图像金字塔 常用底层操作 卷积扫描 ...

  4. Atitit 图像处理知识点  知识体系 知识图谱v2

    Atitit 图像处理知识点  知识体系 知识图谱v2 霍夫变换(Hough Transform) 霍夫变换是图像处理中从图像中识别几何形状的基本方法之一,应用很广泛,也有很多改进算法.主要用来从图像 ...

  5. Atitit 图像处理知识点  知识体系 知识图谱

    Atitit 图像处理知识点  知识体系 知识图谱 图像处理知识点 图像处理知识点体系 v2 qb24.xlsx 基本知识图像金字塔op膨胀叠加混合变暗识别与检测分类肤色检测other验证码生成 基本 ...

  6. Atitit 图像处理之理解卷积attilax总结

    Atitit 图像处理之理解卷积attilax总结 卷积的运算可以分为反转.平移,相乘,求和.        在图像处理中,图像是一个大矩阵,卷积模板是一个小矩阵.按照上述过程,就是先把小矩阵反转,然 ...

  7. Atitit 图像处理—图像形态学(膨胀与腐蚀)

    Atitit 图像处理-图像形态学(膨胀与腐蚀) 1.1. 膨胀与腐蚀1 1.2. 图像处理之二值膨胀及应用2 1.3. 测试原理,可以给一个5*5pic,测试膨胀算法5 1.4. Photoshop ...

  8. Atitit 常用sdk 模块 组织架构切分 规范与范例attilax总结

    Atitit 常用sdk 模块 组织架构切分 规范与范例attilax总结 常用200个模块 2017/04/12  22:01    <DIR>          acc 2017/04 ...

  9. Atitit 图像处理类库安装与安装模式的前世今生与未来大趋势attilax总结.docx

    Atitit 图像处理类库安装与安装模式的前世今生与未来大趋势attilax总结.docx 1. 安装的原理,主要是解压,复制,设置三大步1 2. 目前我们常见的三大种安装模式,二进制模式与源码安装模 ...

随机推荐

  1. Java程序员从笨鸟到菜鸟之(一百零二)sql注入攻击详解(三)sql注入解决办法

    sql注入攻击详解(二)sql注入过程详解 sql注入攻击详解(一)sql注入原理详解 我们了解了sql注入原理和sql注入过程,今天我们就来了解一下sql注入的解决办法.怎么来解决和防范sql注入, ...

  2. python 版本升级(CentOS) 从2.6.6升级到2.7.6

    安装必须的包 yum install zlib-devel bzip2-devel pcre-devel openssl-devel ncurses-devel sqlite-devel readli ...

  3. wap,h5页面

    网址: 1:天猫(http://m.tmall.com) 2:淘宝(http://m.taobao.com) 3:京东(http://m.jd.com) 4:网易(http://3g.163.com) ...

  4. 20151013 C# 第一篇 流程控制语句

    20151013 流程控制语句: 1.选择语句 if … else if...else 选择语句 if(布尔表达式){  语句块:} if(布尔表达式){  语句块1:}else{  语句块2:} i ...

  5. SqlIO优化

    1SqlIO优化 set statistics io on--sqlset statistics io off 2Sql占用CPU时间 select c.total_worker_time, c.la ...

  6. 关于PDV的那些事

    数据集中的数据来源分为两种: 一.来自于另一个数据集: 二.来自于外部数据源(本文细说此来源): 无论是哪种来源,在它们成为目标数据集中的观测行(官方叫它observation)之前都要进入PDV,先 ...

  7. ubuntu网络配置&&ubuntu apt-get错误解决办法

    网络配置: 方式1:网卡通过DHCP自动获取IP地址 $ sudo gedit /etc/network/interfaces # 修改文件/etc/network/interfaces如下文 #-- ...

  8. gulp实用插件总结

    gulp-sass:预编译sass; gulp-imagemin:压缩png.jpj.git.svg格式图片 gulp-minfy-css:压缩css文件 gulp-rename 重命名文件,把一个文 ...

  9. 关于Mysql查询带单引号及插入带单引号字符串问题

    1.转为带参数查询 String sql=""select id from student where name='?'; Connection connect = DriverM ...

  10. PAT/查找元素习题集

    B1004. 成绩排名 (20) Description: 读入n名学生的姓名.学号.成绩,分别输出成绩最高和成绩最低学生的姓名和学号. Input: 每个测试输入包含1个测试用例,格式为: 第1行: ...