字符细化算法
来源:互联网 发布:虚拟机怎么配置网络 编辑:程序博客网 时间:2024/05/21 13:48
图像细化的作用不多说,本算法通常是一个迭代算法,整个迭代过程分为两步:
Step One:循环所有前景像素点,对符合如下条件的像素点标记为删除:
1. 2 <= N(p1) <=6
2. S(P1) = 1
3. P2 * P4 * P6 = 0
4. P4 * P6 * P8 = 0
Step Two:跟Step One很类似,条件1、2完全一致,只是条件3、4稍微不同,满足如下条件的像素P1则标记为删除,条件如下:
1. 2 <= N(p1) <=6
2. S(P1) = 1
3. P2 * P4 * P8 = 0
4. P2 * P6 * P8 = 0
如图:
原代码如下:
/** * 字符细化算法 * @param image */private void refine(BufferedImage image){int k=1;while(k!=0){k=stepOne(image);k=stepTwo(image);}}/** * 字符细化第一步 * @param image * @return */public int stepOne(BufferedImage image){int result=0;int redRGB=Color.red.getRGB();int width=image.getWidth()-1;int height=image.getHeight()-1;int p[]=new int[9];int k[]=new int[9];int s=0;String a=null;int index1=0,index2=0,con3=0,con4=0;for(int x=1;x=2&&s<=6)&&(index1==index2)&&(con3==con4)){image.setRGB(x, y, redRGB);result++;}}for(int i=0;i 0){for(int x=0;x =2&&s<=6)&&(index1==index2)&&(con3==con4)){image.setRGB(x, y, redRGB);result++;}}for(int i=0;i 0){for(int x=0;x
阅读全文
0 0
- 字符细化算法
- 细化算法
- 细化算法
- 细化算法
- 细化算法
- C#图像细化:Hilditch细化算法
- JAVA图像细化:Hilditch细化算法
- 图象细化算法大全
- 图象细化算法大全
- 并行细化算法
- 腐蚀膨胀细化算法
- 腐蚀、膨胀、细化算法
- 图像细化算法
- 膨胀、腐蚀、细化算法
- 腐蚀,膨胀,细化算法
- Hilditch 细化算法
- 腐蚀,膨胀,细化算法
- 并行细化算法
- struct和typedef struct
- 计算机体系结构-- 字节、字、bit、byte的关系
- SecureCRT 安装、连接虚拟机安装的Linux系统及两个系统间文件的传输
- SRILM的安装与使用
- hdu 1216 Assistance Required
- 字符细化算法
- [线性代数]行列式
- ViewStub使用
- 顺序表应用5:有序顺序表归并
- rup,xp,敏捷过程的含义
- 1014. Waiting in Line (30)
- lower_bound 与 upper_bound 返回值及用法
- Pythonday07
- 1-Two Sum