⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
imagej workshop
All Projects
imagej workshop
Overview
Activity
Roadmap
Issues
News
Documents
Wiki
Forums
Files
Download (572 Bytes)
Files
» histo-eq-sqrt.txt
example of a macro that does a modified histogram equalization -
Volker Baecker
, 06/28/2011 06:24 PM
// get stats
getRawStatistics(area, mean, min, max, std, h);
width = getWidth();
height = getHeight();
// Cumulative Histogram
h[0] = sqrt(h[0]);
for (i=1;i< h.length;i++) {
h[i] = h[i-1]+sqrt(h[i]);
}
// Normalized Cumulative Histogram
for (i=0;i< h.length;i++) {
h[i] = round( ((h[i] - h[0]) / (h[h.length-1] - h[0])) * 255);
}
for (x=0; x<width;x++) {
for(y=0; y<height; y++) {
p = getPixel(x,y);
setPixel(x,y,h[p]);
}
}
Plot.create("Cumulative Histogram of "+getTitle, "Value", "Sum of pixel count", h);
Plot.show();
// end
« Previous
1
…
14
15
16
17
18
Next »
(16-16/18)
Loading...