1 / 11

專題進度

專題進度. 指導老師 : 鄭朝榮老師 組長 : 王俊元 組員 : 梁森凱 彭俊頎 朱勝群. 目標. 拍攝文字 將圖文傳入 將文字翻譯 回傳. 目前了解. 影像前處理 方向的旋轉 色彩的轉換 文字的細化 等 ……. 影像縮放. public class imageZoom {     public static BufferedImage imageEnlarge(BufferedImage image,double n){

seth
Download Presentation

專題進度

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 專題進度 指導老師:鄭朝榮老師 組長:王俊元 組員:梁森凱 彭俊頎 朱勝群

  2. 目標 • 拍攝文字 • 將圖文傳入 • 將文字翻譯 • 回傳

  3. 目前了解 • 影像前處理 • 方向的旋轉 • 色彩的轉換 • 文字的細化 • 等……

  4. 影像縮放 public class imageZoom {     public static BufferedImage imageEnlarge(BufferedImage image,double n){      BufferedImage image1=new BufferedImage( (int)(image.getWidth()*n),(int)(image.getHeight()*n),image.getType());      for(int i = 0;i<image1.getWidth();i++){      for(int j=0;j<image1.getHeight();j++){      int x=(int)(i/n);      int y=(int)(j/n); try{         image1.setRGB(i,j , image.getRGB(x, y)); }catch(Exception e){} }  }   return image1;     } }

  5. 色彩的轉換 public class ImageClrChg { public static int gray[][];     public static void imagecolor(BufferedImage image){      gray =new int[image.getWidth()][image.getHeight()];        for(int h=0;h<image.getHeight();h++){   for(int w=0;w<image.getWidth();w++){   int rgb=image.getRGB(w, h);   gray[w][h]=(r[w][h]+g[w][h]+b[w][h])/3;   }  }     } public static BufferedImage ToGray(BufferedImage image)       {   imagecolor(image);        for(int h=0;h<image.getHeight();h++){        for(int w=0;w<image.getWidth();w++){        int rgb=(0xff000000|gray[w][h]<<16|gray[w][h]<<8|gray[w][h]);        image.setRGB(w, h, rgb);        }        }        return image;         }     public static BufferedImage ToGreen(BufferedImage image) }

  6. 色彩的轉換

  7. 方向的旋轉 publicstatic BufferedImage imageRotationAngle(BufferedImage image,double theta){ int x0=image.getWidth()/2; int y0=image.getHeight()/2; double r0=Math.hypot(x0, y0)*2; BufferedImage image1=newBufferedImage((int)r0,(int)r0,BufferedImage.TYPE_INT_ARGB ); for(int i = 0;i<image1.getWidth();i++){ for(int j=0;j<image1.getHeight();j++){ int x1=i-x0; int y1=j-y0; double r=Math.hypot(x1, y1); double arfa=Math.atan2(y1, x1); x1=(int)(r0/2+r*Math.cos(arfa-theta)); y1=(int)(r0/2+r*Math.sin(arfa-theta)); //System.out.print(r+"=r\n"+arfa+"=θ\n"); try{ image1.setRGB(x1,y1 , image.getRGB(i, j)); }catch(Exception e){ } } } }

  8. 方向的旋轉

  9. 下次目標 • 影像的前處理完成

  10. 提供一個網頁 • http://www.free-ocr.com/

More Related