Histograms- HPP. What is homogeneous? Homogeneous point process treats all pixels the same. p'=f(p); // homogeneous point processing does not care about.

Slides:



Advertisements
Similar presentations
Types of Image Enhancements in spatial domain
Advertisements

Image Processing Lecture 4
CS & CS Multimedia Processing Lecture 2. Intensity Transformation and Spatial Filtering Spring 2009.
Chapter 3 Image Enhancement in the Spatial Domain.
Chapter - 2 IMAGE ENHANCEMENT
Topic 4 - Image Mapping - I DIGITAL IMAGING Course 3624 Department of Physics and Astronomy Professor Bob Warwick.
Intensity Transformations (Chapter 3)
EE663 Image Processing Histogram Equalization Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.
Digital Image Processing
ECE 472/572 - Digital Image Processing
Image Enhancement in the Spatial Domain
Image (and Video) Coding and Processing Lecture 5: Point Operations Wade Trappe.
Intensity Transformations
1Ellen L. Walker ImageJ Java image processing tool from NIH Reads / writes a large variety of images Many image processing operations.
SCCS 4761 Point Processing Basic Image Processing Operations Arithmetic Operations Histograms.
Digital Image Processing & Pattern Analysis (CSCE 563) Intensity Transformations Prof. Amr Goneid Department of Computer Science & Engineering The American.
Digital Image Processing In The Name Of God Digital Image Processing Lecture3: Image enhancement M. Ghelich Oghli By: M. Ghelich Oghli
Image enhancement in the spatial domain. Human vision for dummies Anatomy and physiology Wavelength Wavelength sensitivity.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
DREAM PLAN IDEA IMPLEMENTATION Introduction to Image Processing Dr. Kourosh Kiani
Image Enhancement To process an image so that the result is more suitable than the original image for a specific application. Spatial domain methods and.
EEE 498/591- Real-Time DSP1 What is image processing? x(t 1,t 2 ) : ANALOG SIGNAL x : real value (t 1,t 2 ) : pair of real continuous space (time) variables.
Point Processing : Computational Photography Alexei Efros, CMU, Fall 2011 Some figures from Steve Seitz, and Gonzalez et al.
Image Processing : Computational Photography Alexei Efros, CMU, Fall 2006 Some figures from Steve Seitz, and Gonzalez et al.
Image Enhancement in the Spatial Domain (chapter 3) Math 5467, Spring 2008 Most slides stolen from Gonzalez & Woods, Steve Seitz and Alexei Efros.
MSU CSE 803 Stockman Linear Operations Using Masks Masks are patterns used to define the weights used in averaging the neighbors of a pixel to compute.
Point Processing : Computational Photography Alexei Efros, CMU, Fall 2008 Some figures from Steve Seitz, and Gonzalez et al.
Digital Image Processing
Image Analysis Preprocessing Arithmetic and Logic Operations Spatial Filters Image Quantization.
IMAGE 1 An image is a two dimensional Function f(x,y) where x and y are spatial coordinates And f at any x,y is related to the brightness at that point.
Lecture 2. Intensity Transformation and Spatial Filtering
Chapter 3 Image Enhancement in the Spatial Domain.
Image Processing I : Rendering and Image Processing Alexei Efros …with most slides shamelessly stolen from Steve Seitz and Gonzalez & Woods.
Linear Algebra and Image Processing
ECE 472/572 - Digital Image Processing Lecture 4 - Image Enhancement - Spatial Filter 09/06/11.
1 DICOM Imaging Pipeline Model Cor loef Philips Medical Systems.
University of Ioannina - Department of Computer Science Intensity Transformations (Point Processing) Christophoros Nikou Digital Image.
Manipulating contrast/point operations. Examples of point operations: Threshold (demo) Threshold (demo) Invert (demo) Invert (demo) Out[x,y] = max – In[x,y]
Point Processing (Szeliski 3.1) cs129: Computational Photography James Hays, Brown, Fall 2012 Some figures from Alexei Efros, Steve Seitz, and Gonzalez.
Chapter 3 Image Enhancement in the Spatial Domain.
Seeram Chapter #3: Digital Imaging
Digital Image Processing Contrast Enhancement: Part I
Pattern Recognition Mrs. Andleeb Y. Khan Lecture 03 BCS-VII.
CS6825: Point Processing Contents – not complete What is point processing? What is point processing? Altering/TRANSFORMING the image at a pixel only.
Digital Image Processing Lecture 4: Image Enhancement: Point Processing Prof. Charlene Tsai.
CIS 601 Image ENHANCEMENT in the SPATIAL DOMAIN Dr. Rolf Lakaemper.
Intensity Transformations or Translation in Spatial Domain.
CIS 601 – 04 Image ENHANCEMENT in the SPATIAL DOMAIN Longin Jan Latecki Based on Slides by Dr. Rolf Lakaemper.
Digital Image Processing EEE415 Lecture 3
Visual Computing Computer Vision 2 INFO410 & INFO350 S2 2015
Homework 2 (Due: 3/26) A. Given a grayscale image I,
CH2. Point Processes Arithmetic Operation Histogram Equalization
©Soham Sengupta,
Lecture Reading  3.1 Background  3.2 Some Basic Gray Level Transformations Some Basic Gray Level Transformations  Image Negatives  Log.
Lecture 02 Point Based Image Processing Lecture 02 Point Based Image Processing Mata kuliah: T Computer Vision Tahun: 2010.
Digital Image Processing Lecture 4: Image Enhancement: Point Processing January 13, 2004 Prof. Charlene Tsai.
Digital Image Processing Image Enhancement in Spatial Domain
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods Chapter 3 Image Enhancement in the Spatial Domain Chapter.
Histogram Equalization
Image Enhancement.
Discussion #29 – Images II
Histogram Histogram is a graph that shows frequency of anything. Histograms usually have bars that represent frequency of occuring of data. Histogram has.
Image Enhancement in the Spatial Domain
Lecture 3 (2.5.07) Image Enhancement in Spatial Domain
Point Processing : Computational Photography
Point Processing cs195g: Computational Photography
Point Processing cs129: Computational Photography
CIS 4350 Image ENHANCEMENT SPATIAL DOMAIN
Presentation transcript:

Histograms- HPP

What is homogeneous? Homogeneous point process treats all pixels the same. p'=f(p); // homogeneous point processing does not care about pixel location. isomorphic pixel mapping.

Homogeneous Point Processing Every point is treated the same Input size of image is same as output size Good application of statistics! input image shape is the same as the output image shape.

Image processing An image processing operation typically defines a new image g in terms of an existing image f.

You need a function! A function has a single possible output value for any unique input value. A relation can have two outputs for a given input. For example x**2+y**2=r**2 is a relation. y=sqrt(x*x+r*r); //take only the + part and you have a function.

Mapping a pixel has many applications Brightening an image Improving the contrast Coloring the image. histogram equalization converting to a new color space.

How do we implements HPP? Standards for HPP base on an INTERFACE. The standardization of the filter into interface allows for polymorphism.

Point Processing The simplest kind of range transformations are these independent of position x,y: g = t(f)

How do we form such an interface? java.awt has RGBImageFilter interface It requires that you implement public int filterRGB(int x, int y, int rgb); 1. Unpack the rgb int 2. Do the HPP 3. repack the int and return the value.

How do we unpack our RGB ints? let RGB=0x7FDEAD50 int a = rgb &0xFF000000>>24; int r = rgb &0x00FF0000 >>16; int g = rgb &0x0000FF00 >> 8; int b = rgb &0x000000FF; int r1 = getRed(r,g,b);int g1=getGreen(r,g,b); int b1 = getBlue(r,g,b); return 0xFF | (r1 << 16) | (g1<<8) | b1;

Adapter Pattern Adapter Pattern take one interface and maps to a new interface. public interface HppFilterInterface { public short getR(int r); public short getG(int g); public short getB(int b); }

InvertFilter public class InvertFilter implements HppFilterInterface { public short getR(int r) { return invert(r); } public short getG(int g) { return invert(g); } public short getB(int b) { return invert(b); }

Invert private short invert(int v) { if (v < 0) return 0; if (v > 255) return 255; return (short) (255 - v); }

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.

Two kinds of methods for altering an image First we do the direct methods….

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

Rules of Prob. Sum of all probs=1 CMF is sum of all values up to a point.

In Prob…Cont vs. Discrete PMF – discrete but PDF are Continuous CMF – discrete by CDF are continuous Example: Toss a coin – discrete Example: Temp. Time, space CMF uses a discrete summation (for-loop) CDF uses an integral discrete means quantized

Histogram Computations histArray = new double[256]; for (int i=0; i<width; i++) for (int j=0; j < height; j++) histArray[plane[i][j] & 0xFF]++; // what happens if you have 24 bit color images?

Normalization of PMF double max = 0.0; for(int i=0; i<256; i++) if (histArray[i] > max) max = histArray[i]; // Normalize for(int i=0; i<256; i++) histArray[i] = (histArray[i] / max);

The Histogram of the Image

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) }

Linear Map and Sample Image

LUT implementation In theory, lut is easy: –outputColor = f(inputColor) –F(x) is an lut. –What happens if x ranges from 0 to 2**24?

Negating an Image

Implementation private short invert(int v) { if (v < 0) return 0; if (v > 255) return 255; return (short) (255 - v); }

HppFilterInterface public short getR(int r); public short getG(int g); public short getB(int b);

What is thresholding? Requanitze an image. for example: –given an image with 256 grays –find an image with only 2 grays How do I know which pixels are black and which are white? –if (v < thresh) v = 0, else v = 255;

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.

Indirect Methods The indirect method use statistical properties Two Kinds of Indirect Methods: adaptive and nonadaptive

Basic Point Processing

Computing Averages

Image Enhancement

Contrast Streching

Power law and image processing

1.5 exponent=darkening

Power-law transformations

Gamma Correction

Washed out images can result

Changing Brightness and Contrast

Linear eq and histogram

Brightening and image

Computing parameters automatically

Darkening Image

Darkening and the Histogram

Implementing the power xform public void powImage(double p) { for (int x=0; x < width; x++) for (int y=0; y < height; y++) { r[x][y] = (short) (255 * Math.pow((r[x][y]/255.0),p)); g[x][y] = (short) (255 * Math.pow((g[x][y]/255.0),p)); b[x][y] = (short) (255 * Math.pow((b[x][y]/255.0),p)); } short2Image(); }

UNAHE

The CMF

Adaptive Equalization

Histogram an AUHE

LUT Implementation package gui; public class TransformTable { public TransformTable(int size) public short[] getLut() public void setLut(short lut[]) public void print() }