• 大小: 3.1MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-27
  • 语言: Java
  • 标签:

资源简介

数字图像处理Java实现,涵盖了常用的数字图像处理算法及代码。

资源截图

代码片段和文件信息

/**
 * @Ch10ImageMorph.java
 * @Version 1.0 2010.02.21
 * @Author Xie-Hua Sun 
 */

package process.algorithms;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import process.algorithms.ImageMorph;
import process.common.Common;

public class Ch10ImageMorph extends Jframe implements ActionListenerMouseListener
{
    Image iImage oImage;
     
    boolean loadflag = false       //输入图像标志
            runflag  = false       //执行处理标志   
            fillflag = false;
    int   iw ih;
    int[] pixels;          
             
    ImageMorph morph;
    Common common;
    
    public Ch10ImageMorph()
    {    
        settitle(“数字图像处理-Java编程与实验 第10章 图像形态学“);
        this.setBackground(Color.lightGray);        
              
        //菜单界面
        setMenu();
        
        morph = new ImageMorph();
        common  = new Common();
        
        //关闭窗口
        closeWin();
        
        setSize(530 330);
        setVisible(true);
    }

    public void actionPerformed(ActionEvent evt)
    {
     Graphics graph = getGraphics();
              
        if (evt.getSource() == openItem) 
        {
         //文件选择对话框
            JFileChooser chooser = new JFileChooser();
            common.chooseFile(chooser “./images/ch10“ 0);//设置默认目录过滤文件
            int r = chooser.showOpenDialog(null);
                        
            MediaTracker tracker = new MediaTracker(this);
            
            if(r == JFileChooser.APPROVE_OPTION) 
            {  
                String name = chooser.getSelectedFile().getAbsolutePath();
                 
                if(runflag)
                { 
                    loadflag  = false;
                    runflag   = false;
                }                 
    if(!loadflag)
    {
                //装载图像
    iImage = common.openImage(name tracker);    
    //取载入图像的宽和高
    iw = iImage.getWidth(null);
    ih = iImage.getHeight(null);     
    repaint();
    loadflag = true;
    }                          
            }                        
        }        
        else if (evt.getSource() == erode1Item)//腐蚀
        {
            if(loadflag)        
         {             
         settitle(“第10章 图像形态学 正方形结构腐蚀 作者 孙燮华“);
            removeMouseListener(this);
            show(graph 11 “正方形腐蚀“);              
         }
         else
  JOptionPane.showMessageDialog(null “请先打开图像!“);
        } 
        else if (evt.getSource() == erode2Item)
        {
         if(loadflag)        
         {             
         settitle(“第10章 图像形态学 菱形结构腐蚀 作者 孙燮华“);
            removeMouseListener(this);
            show(graph 12 “菱形腐蚀“);              
         }
         else
  JOptionPane.showMessageDialog(null “请先打开图像!“);
        }
        else if (evt.getSource() == erode3Item)
        {
         if

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      20829  2010-06-04 15:36  zxq-9787111318491\imProcess\Ch10ImageMorph.java

     文件      21695  2010-06-04 10:19  zxq-9787111318491\imProcess\Ch11DigitRecog.java

     文件      12436  2010-06-04 15:07  zxq-9787111318491\imProcess\Ch12ImageCompress.java

     文件       8338  2010-06-04 15:16  zxq-9787111318491\imProcess\Ch13FracImageCompress.java

     文件      17567  2010-06-04 15:23  zxq-9787111318491\imProcess\Ch14ImageCipher.java

     文件      16194  2010-06-04 15:26  zxq-9787111318491\imProcess\Ch15ImageWatermark.java

     文件      10803  2010-06-04 15:32  zxq-9787111318491\imProcess\Ch1Introduction.java

     文件       6266  2010-06-04 15:32  zxq-9787111318491\imProcess\Ch2Digitization.java

     文件      12986  2010-06-04 15:28  zxq-9787111318491\imProcess\Ch3Elements.java

     文件      13929  2010-06-04 15:30  zxq-9787111318491\imProcess\Ch4GeomTrans.java

     文件      13065  2010-06-04 15:30  zxq-9787111318491\imProcess\Ch5ImageTrans.java

     文件      17616  2010-06-02 15:09  zxq-9787111318491\imProcess\Ch6ImageEnhance.java

     文件       4897  2010-03-07 08:26  zxq-9787111318491\imProcess\Ch7ImageRestore.java

     文件      15009  2010-06-04 15:34  zxq-9787111318491\imProcess\Ch8ImageSegment.java

     文件       9722  2010-06-04 15:35  zxq-9787111318491\imProcess\Ch9ImageAnalyse.java

     文件       2000  2009-10-11 02:19  zxq-9787111318491\imProcess\digits.txt

     文件       4000  2010-02-22 04:57  zxq-9787111318491\imProcess\digits23.txt

     文件      19712  2004-05-21 07:02  zxq-9787111318491\imProcess\images\Baboo.jpg

     文件      12170  2008-10-27 04:36  zxq-9787111318491\imProcess\images\boats.JPG

     文件      66614  1996-10-24 09:44  zxq-9787111318491\imProcess\images\ch1\bmp\Lena.BMP

     目录          0  2012-10-06 12:28  zxq-9787111318491\imProcess\images\ch1\bmp

     文件      68509  2008-11-28 09:37  zxq-9787111318491\imProcess\images\ch1\gif\Lena.gif

     文件       7168  2010-03-06 13:24  zxq-9787111318491\imProcess\images\ch1\gif\Thumbs.db

     目录          0  2012-10-06 12:28  zxq-9787111318491\imProcess\images\ch1\gif

     文件      10318  1994-04-18 07:17  zxq-9787111318491\imProcess\images\ch1\pgm\1.pgm

     文件      65554  2009-10-02 09:40  zxq-9787111318491\imProcess\images\ch1\pgm\Baboo.pgm

     文件      65554  2009-10-02 04:18  zxq-9787111318491\imProcess\images\ch1\pgm\cat.pgm

     目录          0  2012-10-06 12:28  zxq-9787111318491\imProcess\images\ch1\pgm

     文件      58800  2010-02-11 16:57  zxq-9787111318491\imProcess\images\ch1\png\Lena.PNG

     文件       7168  2010-03-06 13:54  zxq-9787111318491\imProcess\images\ch1\png\Thumbs.db

............此处省略284个文件信息

评论

共有 条评论