Image Processing in Java - PowerPoint PPT Presentation

1 / 46
About This Presentation
Title:

Image Processing in Java

Description:

Input of values to the system: 9/7/09. http://www.docjava.com ... Brightening and image. 9/7/09. http://www.docjava.com. 37. Computing parameters automatically ... – PowerPoint PPT presentation

Number of Views:492
Avg rating:3.0/5.0
Slides: 47
Provided by: showDo
Category:

less

Transcript and Presenter's Notes

Title: Image Processing in Java


1
Image Processing in Java
  • lyon

2
Introduction
  • Observer-observable DPs
  • Review of HW solution
  • Input of values to the system

3
Agenda
4
Overview
  • public int filterRGB (int rgb)
  • int red (rgb 0xff0000) gtgt16
  • int green (rgb 0xff00) gtgt 8
  • int blue rgb 0xff
  • int gray (red green blue) / 3
  • return (
  • 0xff000000
  • (gray ltlt 16)
  • (gray ltlt 8) gray)

5
Review of Arrays
public static void print(double a) for
(int i 0 i lt a.length i) for (int j
0 j lt a0.length j) System.out.print(ai
j" ") System.out.println()
6
Row-Major
If arrays are row major, then increment the row
more quickly public void print() for
(int j 0 j lt 3 j) for (int i
0 i lt 3 i)
System.out.print(aij" ")
System.out.println()
7
Row vs Column Major
8
Simulating 2D arrays
public int getPixel(int x, int y) return
pelsywidth x
9
Drawing in Java
public void repaint() public void repaint(long
t) public void repaint(int x, int y, int w, int
h) public void repaint(long t, int x, int y, int
w, int h)
10
Damage Control
11
ImageFrame-a series of methods that ease image
processing
12
  • public class ImageFrame extends ShortCutFrame
  • public short r
  • public short g
  • public short b
  • public int width 128
  • public int height 128
  • public ImageFrame(String title)
  • public void setImage(Image i)
  • public Image getImage()
  • public void short2Image()
  • public void image2Short()
  • public void openGif()
  • public void openGif(String fn)
  • public static void main(String args)

13
FilterFrame-Sample
26. public void gray() 27. for (int x0
x lt width x) 28. for (int y0 y lt
height y) 29. rxy (short) 30.
((rxy gxy bxy) /
3) 31. gxy rxy 32.
bxy rxy 33. 34.
short2Image() 35.
14
TestPatterns
15
SnellWlx
16
GrabFrame
  • public class GrabFrame extends FilterFrame
  • public void grab(Container f)
  • public void testPattern()

17
TestPattern
18
Homogeneous Point Processing
  • Every point is treated the same
  • Input size of image is same as output size
  • Good application of statistics!

19
PMF
  • Add the total number of pixels of a particular
    value
  • Divide by the total number of pixels

20
Rules of Prob.
  • Sum of all probs1
  • CMF is sum of all values up to a point.

21
Histogram Computations
histArray new double256 for (int i0
iltwidth i) for (int j0 j lt height
j) histArrayplaneij 0xFF
22
Normalization of PMF
double max 0.0 for(int i0 ilt256
i) if (histArrayi gt max)
max histArrayi // Normalize
for(int i0 ilt256 i) histArrayi
(histArrayi / max)
23
The Histogram of the Image
24
Summary of Histogram
package gui public class Histogram extends
ClosableFrame public double getPMF()
public double getCMF() public void
printPMF() public void show() public
Histogram(short plane, String title)
public void paint(Graphics g)
25
Linear Map and Sample Image
26
Negating an Image
27
Implementation
for (int y0 y lt height y) rxy
(short) (255 - rxy) gxy
(short) (255 - gxy) bxy
(short) (255 - bxy) short2Image()
28
Power law and image processing
29
Washed out images can result
30
1.5 exponentdarkening
31
Darkening Image
32
Darkening and the Histogram
33
Implementing the power xform
public void powImage(double p) for (int x0
x lt width x) for (int y0 y lt height
y) rxy (short)
(255 Math.pow((rxy/255.0),p))
gxy (short) (255
Math.pow((gxy/255.0),p)) bxy
(short) (255
Math.pow((bxy/255.0),p))
short2Image()
34
Changing Brightness and Contrast
35
Linear eq and histogram
36
Brightening and image
37
Computing parameters automatically
38
UNAHE
39
The CMF
40
Adaptive Equalization
41
Histogram an AUHE
42
LUT Implementation
package gui   public class TransformTable
public TransformTable(int size) public short
getLut() public void setLut(short lut)
public void print()
43
The NegateFrame
44
Computing Averages
45
Two kinds of methods for altering an image
  • The direct methods
  • The indirect methods.
  • The direct methods employ a mapping function,
  • Mapping functions are applied to the color planes.

46
Indirect Methods
  • The indirect method use statistical properties
  • Two Kinds of Indirect Methods
  • adaptive and nonadaptive
Write a Comment
User Comments (0)
About PowerShow.com