



全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
import com.sun.media.jai.widget.DisplayJAI;import java.awt.GridLayout;import javax.media.jai.JAI;import javax.media.jai.PlanarImage;import javax.media.jai.operator.MedianFilterDescriptor;import javax.swing.BorderFactory;import javax.swing.JScrollPane;import javax.swing.border.TitledBorder;/* * Median.java * 版权所有 - 贺向前 * 地址:重庆市渝中区医学院路1号 * 重庆医科大学基础医学院计算机教研室 * 邮编:400016 * 邮件: * QQ: 910019784 * 于重庆,石桥铺枫丹苑 2011-11-1, 18:09:13 * 未经授权,不得复制、传播。 */* * * author Administrator */public class Median extends javax.swing.JFrame /* Creates new form Median */ public Median() initComponents(); setTitle(中值滤波); setLayout(new GridLayout(2,2); private void showImage(PlanarImage im,String str) DisplayJAI dj=new DisplayJAI(im); JScrollPane jp=new JScrollPane(dj); TitledBorder titled=BorderFactory.createTitledBorder(+str); jp.setBorder(titled); add(jp); private PlanarImage loadFile(String fileName) PlanarImage dst=JAI.create(fileload,fileName); return dst; /* This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ SuppressWarnings(unchecked) / private void initComponents() setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); addMouseListener(new java.awt.event.MouseAdapter() public void mouseClicked(java.awt.event.MouseEvent evt) formMouseClicked(evt); ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane(); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 400, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 300, Short.MAX_VALUE) ); pack(); / private void formMouseClicked(java.awt.event.MouseEvent evt) / TODO add your handling code here: String fileName=srcx.jpg; PlanarImage im0=loadFile(fileName); showImage(im0,Source); PlanarImage im1=(PlanarImage)JAI.create(medianfilter,im0,MedianFilterDescriptor.MEDIAN_MASK_SQUARE,new Integer(5); showImage(im1,5*5SqureShapeMedian); PlanarImage im2=(PlanarImage)JAI.create(medianfilter,im0,MedianFilterDescriptor.MEDIAN_MASK_X,new Integer(3); showImage(im2,3*3XShapeMedian); PlanarImage im3=(PlanarImage)JAI.create(medianfilter,im0,MedianFilterDescriptor.MEDIAN_MASK_PLUS,new Integer(5); showImage(im3,5*5PlusShapeMedian); JAI.create(filestore, im1, MedianFilter.jpg, jpeg, null); pack(); show(); /* * param args the command line arguments */ public static void main(String args) /* Set the Nimbus look and feel */ / /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see /javase/tutorial/uiswing/lookandfeel/plaf.html */ try for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels() if (Nimbus.equals(info.getName() javax.swing.UIManager.setLookAndFeel(info.getClassName(); break; catch (ClassNotFoundException ex) java.util.logging.Logger.getLogger(Median.class.getName().log(java.util.logging.Level.SEVERE, null, ex); catch (InstantiationException ex) java.util.logging.Logger.getLogger(Median.class.getName().log(java.util.logging.Level.SEVERE, null, ex); catch (IllegalAccessException ex) java.util.logging.Logger.getLogger(Median.class.getName().log(java.util.logging.Level.SEVERE, null, ex); catch (javax.swing.UnsupportedLookAndFeelException ex) java.util.logging.Logger.getLogger(Median.class.getName().log(java.util.logging.Level.SEVERE, null, ex); / /* Create and d
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年注册验船师资格考试(A级船舶检验法律法规)考前模拟试题及答案二
- 2025年殡仪服务职业认证考试面试要点及模拟题集
- 桃花心木课件教学
- 公务员应变面试题及答案
- 2025年艺术设计领域招聘考试试题预测及备考策略
- 2025年国家历史局选拔考试复习题目与答案详解
- 公务员面试题及答案最佳
- 公务员面试题及答案扶贫
- 莫言小说中的民俗元素呈现及其意义
- 2025年环境科学与管理专业高级考试题库及答案
- 矿山基金管理办法
- 肥料登记证授权合同范本
- 工业厂房租赁管理办法
- 辽宁动物检疫管理办法
- 肺癌免疫治疗病例分享
- 2025年汽车智能驾驶技术及产业发展白皮书-清华大学
- 2025云南师范大学辅导员考试题库
- 2025年国考行测试题及答案解析
- 财务岗位安全培训课件
- 2025年贵州省中考语文试卷真题(含答案)
- 2025至2030中国电容膜片真空计行业发展趋势分析与未来投资战略咨询研究报告
评论
0/150
提交评论