Java / ImageJ Code

 

Java source code for the programming examples in this book. Many other example plugins can be found on the official ImageJ web site. The ImageJ Short Reference (Appendix C of this book) can be found here.

License

This software is released under the terms of the Creative Commons Attribution-ShareAlike 3.0 Unported License (CC BY-SA 3.0). You are free to

  • share (copy, distribute and transmit) the work,
  • remix (adapt) the work,
  • make commercial use of the work

under the conditions that you

  • attribute the work in the manner specified below,
  • share alike: if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one. 

The full text of the license can be found here. For reference, please use the following attribution:

W. Burger, M. J. Burge: "Digital Image Processing - An Algorithmic Introduction using Java",
Springer-Verlag, New York (2008-). http://www.imagingbook.com

Download

Source code for individual chapters:

 

CHAP

ZIP 

PROG

DESCRIPTION

3

download

3.1

invert 8-bit grayscale images

4

download

4.1

compute the histogram for 8-bit grayscale images 

 

 

4.2

compute a "binned" histogram

 

 

4.3

create and display a new image in ImageJ

5

download

5.1

increase image contrast

 

5.2

linear histogram equalization

 

 

5.3

histogram matching, histogram specification

 

5.4

gamma correction

 

5.5–6

alpha blending

6

download

6.1

3x3 averaging (box) filter

 

6.2

linear 3x3 smoothing filter

 

6.3

linear MxN filter

 

6.4

compute a 1D Gaussian filter kernel

 

6.5

3x3 median filter

7

download

7.1

unsharp-mask filter

8

download

D.1

Harris corner detector

9

download

9.1

Hough transform for straight lines

10

download

morphological filters for binary images with various structuring elements: box, disk, free-form

11

 download

11.1

UPDATED: region labeling in 4 versions: flood-filling (recursive, depth-first, breadth-first), sequential region labeling

 

D.2

combined region labeling and contour following

 

11.2

contour tracing

 

11.3

computing moments

 

 

11.4

computing projections

12

 download

12.1

processing RGB color images with bit operations

 

12.2

processing RGB color images without bit operations

 

12.3

processing index images (increasing brightness)

 

12.4

converting index images to RGB full color images

 

12.5

desaturating RGB color images

 

12.6–7

RGB/HSV conversion and back

 

12.8–9

RGB/HLS conversion and back

 

12.10–11

Java implementation of L*a*b*-color space

 

12.12

counting colors in RGB images

 

12.13

computing combined color histograms

13

download

13.1

one-dimensional DFT for data vectors of arbitrary length (2 versions)

14

download

two-dimensional DFT for images of arbitrary size

15

download

15.1

one-dimensional DCT

 

two-dimensional DCT

16

download

geometric mappings (Affine Mapping, Projective Mapping, Bilinear Mapping, Twirl Mapping, Ripple Mapping, Sphere Mapping)

 

pixel interpolation (Nearest-Neighbor, Bilinear, Bicubic)

17

download

17.1–2

template matching for intensity images using local correlation coefficient

 

template matching for binary images using Distance transform and Chamfer algorithm

App. B

download

utility methods: mod() and duplicating arbitrary arrays

App. C

download

C.1

direct pixel access example

 

C.2

converting ImagePlus objects

 

C.3

animation example (updating and redisplaying an image)

 

C.4–5

stack example – alpha blending

 

C.6

working with non-rectangular regions of interest (ROIs)

 

C.7

use of image properties

 

C.8

use of GenericDialog