Basic Image Manipulation Raed S. Rasheed 2012. Agenda Region of Interest (ROI) Basic geometric manipulation. – Enlarge – shrink – Reflection Arithmetic.

Slides:



Advertisements
Similar presentations
Transformations We want to be able to make changes to the image larger/smaller rotate move This can be efficiently achieved through mathematical operations.
Advertisements

Image Data Representations and Standards
Geometric Transformations
Point Processing Image Arithmetic. Arithmetic Image Operations (blending) 2  Two source images can be added, multiplied, one subtracted from the other.
CS292 Computational Vision and Language Image processing and transform.
BYST Eh-1 DIP - WS2002: Enhancement in the Spatial Domain Digital Image Processing Bundit Thipakorn, Ph.D. Computer Engineering Department Image Enhancement.
Radix Conversion Given a value X represented in source system with radix  s, represent the same number in a destination system with radix  d Consider.
Mapping: Scaling Rotation Translation Warp
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
HCI 530 : Seminar (HCI) Damian Schofield. HCI 530: Seminar (HCI) Transforms –Two Dimensional –Three Dimensional The Graphics Pipeline.
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.
1 CS6825: Simple Geometric Operations 2Scaling This is what happens when you resize an image. If you transform the image from an MxN to a PxQ image where.
Arithmetic & Logic Unit Does the calculations Everything else in the computer is there to service this unit Handles integers May handle floating point.
Image Analysis Preprocessing Image Quantization Binary Image Analysis
8. Geometric Operations Geometric operations change image geometry by moving pixels around in a carefully constrained way. We might do this to remove distortions.
Level ISA3: Information Representation
CS 376b Introduction to Computer Vision 02 / 27 / 2008 Instructor: Michael Eckmann.
Programming Assignment 1 CS308 Data Structures. Goals Familiarize yourself with reading images from a file. Familiarize yourself with writing images to.
Preprocessing ROI Image Geometry
Review of Matrix Algebra
Programming Assignment 1 CS302 Data Structures. Goals Improve your skills with manipulating dynamic arrays. Improve your understanding of constructors,
Image Analysis Preprocessing Arithmetic and Logic Operations Spatial Filters Image Quantization.
Computer ArchitectureFall 2007 © August 29, 2007 Karem Sakallah CS 447 – Computer Architecture.
3D Graphics Goal: To produce 2D images of a mathematically described 3D environment Issues: –Describing the environment: Modeling (mostly later) –Computing.
CS 450: Computer Graphics 2D TRANSFORMATIONS
Operations on data CHAPTER 4.
4 Operations On Data Foundations of Computer Science ã Cengage Learning.
Image processing Lecture 4.
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
Dr. Bernard Chen Ph.D. University of Central Arkansas
CS 376b Introduction to Computer Vision 02 / 26 / 2008 Instructor: Michael Eckmann.
Mathematical Fundamentals
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
COMP 175: Computer Graphics March 24, 2015
ME 2304: 3D Geometry & Vector Calculus Dr. Faraz Junejo Double Integrals.
Computer Arithmetic Nizamettin AYDIN
Chapter 3.5 Logic Circuits. How does Boolean algebra relate to computer circuits? Data is stored and manipulated in a computer as a binary number. Individual.
Geometric transformations Affine transformations Forward mapping Interpolations schemes.
CS1Q Computer Systems Lecture 9 Simon Gay. Lecture 9CS1Q Computer Systems - Simon Gay2 Addition We want to be able to do arithmetic on computers and therefore.
CH09 Computer Arithmetic  CPU combines of ALU and Control Unit, this chapter discusses ALU The Arithmetic and Logic Unit (ALU) Number Systems Integer.
Geometric Transformations
Inequalities and Linear Programming. s ome g roundwork what is the difference between : an expression an equation an inequality an identity ? [ The student.
Computer Arithmetic and the Arithmetic Unit Lesson 2 - Ioan Despi.
EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.
CSC508 Convolution Operators. CSC508 Convolution Arguably the most fundamental operation of computer vision It’s a neighborhood operator –Similar to the.
07/12/ Data Representation Two’s Complement & Binary Arithmetic.
Geometric Transformations Hearn & Baker Chapter 5 Some slides are taken from Robert Thomsons notes.
Binary Arithmetic.
October 16, 2014Computer Vision Lecture 12: Image Segmentation II 1 Hough Transform The Hough transform is a very general technique for feature detection.
Copyright 2008 Koren ECE666/Koren Part.7b.1 Israel Koren Spring 2008 UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering Digital Computer.
Chapter 4 Operations on Bits. Apply arithmetic operations on bits when the integer is represented in two’s complement. Apply logical operations on bits.
Digital Image Processing
Digital Image Processing Image Enhancement in Spatial Domain
09/03/20161 Information Representation Two’s Complement & Binary Arithmetic.
Computer Graphics CC416 Lecture 04: Bresenham Line Algorithm & Mid-point circle algorithm Dr. Manal Helal – Fall 2014.
Chun-Yuan Lin Coordinate Reference Frames 2016/6/22 1 CG.
Image Warping 2D Geometric Transformations
Functions Algebra of Functions. Functions What are functions?
Computer Graphics Lecture 07 Ellipse and Other Curves Taqdees A. Siddiqi
Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis.
Basic Image Manipulation CHAPTER 5. Topics 5.1Storage 5.2Reading and writing images in Java 5.3Display 5.4Printing 5.5Manipulation of pixel data.
Chapter 4 Operations on Bits.
Fitting Curve Models to Edges
FP1 Matrices Transformations
WINDOWING AND CLIPPING
WINDOWING AND CLIPPING
GCSE COMPUTER SCIENCE Topic 3 - Data 3.3 Logical and Arithmetic Shifts.
靜夜思 床前明月光, 疑是地上霜。 舉頭望明月, 低頭思故鄉。 ~ 李白 李商隱.
Presentation transcript:

Basic Image Manipulation Raed S. Rasheed 2012

Agenda Region of Interest (ROI) Basic geometric manipulation. – Enlarge – shrink – Reflection Arithmetic and logical combination of images. – Addition and averaging. – Subtraction. – Division. – AND & OR. Transformation and Rotation

Region of Interest (ROI) A region of interest (ROI) is a rectangular area within the image, defined either by the coordinates of the pixels at its upper-left and lower-right corners or by the coordinates of its upper-left corner and its dimensions.

Basic Geometric Manipulation. Enlarging or shrinking an image can be accomplished by replicating or skipping pixels. These techniques can be used to magnify small details in an image, or reduce a large image in size so that it fits on the screen. They have the advantage of being fast, but can only resize an image by an integer factor.

Basic Geometric Manipulation. Enlarge: To enlarge an image by an integer factor n, we must replicate pixels such that each pixel in the input image becomes an n x n block of identical pixels in the output image. The most straightforward implementation of this involves iterating over the pixels in the larger output image and computing the coordinates of the input image pixel from which a value must be taken. For a pixel (x, y) in the output image, the corresponding pixel in the input image is at (x/n, y/n). Calculation of the coordinates is done using integer arithmetic.

Basic Geometric Manipulation.

Shrink: To shrink an image by an integer factor n, we must sample every n th pixel in the horizontal and vertical dimensions and ignore the others. Again, this technique is most easily implemented by iterating over pixels in the output image and computing the coordinates of the corresponding input image pixel.

Basic Geometric Manipulation.

Reflection: Reflection along either of the image axes can also be performed in place. This simply involves reversing the ordering of pixels in the rows or columns of the image.

Basic Geometric Manipulation.

Arithmetic and logical combination of images. Addition and averaging: I f we add two 8-bit greyscale images, then pixels in the resulting image can have values in the range We should therefore choose a 16-bit representation for the output image or divide every pixel's value by two. If we do the latter, then we are computing an average of the two images. g(x,y) = αf 1 (x,y) + (1 - α)f 2 (x,y)

Arithmetic and logical combination of images. Addition and averaging: for(y=0; y<height; y++) for(x=0; x<width; x++) g(x,y) = αf 1 (x,y) + (1 - α)f 2 (x,y)

Arithmetic and logical combination of images. Subtraction: Subtracting two 8-bit greyscale images can produce values between -255 and This necessitates the use of 16-bit signed integers in the output image unless sign is unimportant, in which case we can simply take the modulus of the result and store it using 8-bit integers: g(x,y) = |f 1 (x,y) - f 2 (x,y)|

Arithmetic and logical combination of images. Subtraction: for(y=0; y<height; y++) for(x=0; x<width; x++) g(x,y) = |f 1 (x,y) - f 2 (x,y)|

Arithmetic and logical combination of images. Subtraction:

Arithmetic and logical combination of images. Division: For division of images to produce meaningful results, floating-point arithmetic must be used. The ratio image can be of the floating-point type, or we can rescale and round pixel values to be in a more convenient range.

Arithmetic and logical combination of images. Division: for(y=0; y<height; y++) for(x=0; x<width; x++) g(x,y) = f 1 (x,y) / f 2 (x,y)

Arithmetic and logical combination of images. Division:

Arithmetic and logical combination of images. AND & OR: Logical AND and OR operations are useful for the masking and compositing of images. For example, if we compute the AND of a binary image with some other image, then pixels for which the corresponding value in the binary image is 1 will be preserved, but pixels for which the corresponding binary value is 0 will be set to 0 themselves. Thus the binary image acts as a 'mask' that removes information from certain parts of the image.

Arithmetic and logical combination of images. AND & OR: for(y=0; y<height; y++) for(x=0; x<width; x++) g(x,y) = f 1 (x,y) && f 2 (x,y) for(y=0; y<height; y++) for(x=0; x<width; x++) g(x,y) = f 1 (x,y) || f 2 (x,y)

Arithmetic and logical combination of images. AND & OR:

Arithmetic and logical combination of images. AND & OR:

Transformation and Rotation

1.The pixel at (0, 100) after a 90° rotation 2.The pixel at (50, 0) after a 35° rotation In case 1, cos 90' is 0 and sin 90' is 1, so the pixel moves to coordinates (-100,0). This is clearly a problem, since pixels cannot have negative coordinates. Case 2 illustrates a different problem. Here, we calculate that x' = x cos θ - y sin θ = 50 cos(35 o ) = 40.96, y' = x sin θ + y cos θ = 50 sin(35 o ) =

Transformation and Rotation The first problem can be solved by testing coordinates to check that they lie within the bounds of the output image before attempting to copy pixel values. A simple solution to the second problem is to find the nearest integers to x' and y' and use these as the coordinates of the transformed pixel.

Transformation and Rotation