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. android studio 华为手机看不到具体的错误日志

    手机的开发人员选项打开了么,其中的 USB 调试打开了么?搞定他们并重新运行,是否能找到我们的日志?否,转到 2. 日志中是否有这样 could not disable core file gener ...

  2. Centos 7下搭建WordPress

    1,首先安装MySQL. http://www.cnblogs.com/zyh120/p/6066983.html 2,继续安装httpd,php,php-mysql这3个服务. [root@loca ...

  3. 开园第一篇 - 论移动开发环境 IOS与Android的差异

    首先,在真正写技术之前做个自我简介.本人08年开始学c语言 一年后,转vc++.开始接触MFC MFC做了两年.转眼11年了我考上了一个不知名的大专.搞C++发现没有市场了因为当时酷狗腾讯的软件已经日 ...

  4. innodb的存储结构

    如下所示,innodb的存储结构包含:表空间,段,区,页(块),行 innodb存储结构优化的标准是:一个页里面存放的行数越多,其性能越高 表空间:零散页+段 独立表空间存放的是:数据.索引.插入缓冲 ...

  5. [转]redis-cli的一些有趣也很有用的功能

    本文转至:http://www.tuicool.com/articles/Yvqm2ev http://mdba.cn/category/redis/ redis-cli我们最常用的两个参数就是-h. ...

  6. switch的经典引用

    #include<stdio.h> int main(void) { int i; do{ printf("按1,流量查询\n"); printf("按2,人 ...

  7. VS2013 密钥 – 所有版本(Visual Studio Ultimate,Premium,Professional,TFS)

    Visual Studio Ultimate 2013 KEY(密钥):BWG7X-J98B3-W34RT-33B3R-JVYW9 Visual Studio Premium 2013 KEY(密钥) ...

  8. CAP定理

    from wikipedia CAP定理 CAP定理(CAP theorem),又被称作布鲁尔定理(Brewer's theorem),它指出对于一个分布式计算系统来说,不可能同时满足以下三点: 一致 ...

  9. C#中调用python方法

    最近因为项目设计,有部分使用Python脚本,因此代码中需要调用python方法. 1.首先,在c#中调用python必须安装IronPython,在 http://ironpython.codepl ...

  10. ubuntu安装packet提示重复冲突问题

    今天装个zip出现: dpkg: error processing archive /var/cache/apt/archives/libc6-dev-i386_2.19-0ubuntu6.5_amd ...