图像处理基础——(二值化)java实现

二值化的理解就是讲图片上超过某阈值的像素设为A,不超过的设为B 

以至图片只存在俩种像素。

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.awt.image.RenderedImage;
import java.io.File;
import java.io.IOException;

     
     public   class Binaryization 
{

	static BufferedImage  bufferedIamge,bufferedImageT;
    public Binaryization(){
	 
	
	}
  public static BufferedImage binaryization(BufferedImage image){
	  int width=image.getWidth();
	  int height=image.getHeight();
	  int r=0;
      bufferedImageT= new BufferedImage(width,height, BufferedImage.TYPE_3BYTE_BGR );
	 
	  for(int y=0;y

你可能感兴趣的:(图像处理基础,java,图像处理)