Home > Java > javaTutorial > Histogram equalization of java images

Histogram equalization of java images

黄舟
Release: 2016-12-30 11:48:47
Original
2504 people have browsed it

Histogram equalization is to make the histogram of the image as average as possible, so that the probability of each 0-255 is equal. The formula is as follows:

Histogram equalization of java images

#This proof can be found in any image processing textbook. The implementation code is provided below:

public void histequalization(){
		toGray();
		double[] hist = math.Norm(hist());
		for (int y = 0; y < h; y++) {
                  for (int x = 0; x < w; x++) {
                   this.data[x + y * w] = (int)(math.sum(hist, this.data[x + y * w])*255); //上面公式           
                 }
              }
	}
Copy after login

The results are as follows:


Original picture:

Histogram equalization of java images

Histogram equalization of java images

# #After histogram equalization:

Histogram equalization of java images

Histogram equalization of java images

The above is the content of histogram equalization of java images. For more related content, please pay attention to PHP Chinese website (m.sbmmt.com)!



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template