School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae, VUW Images and 2D Graphics COMP 112 2014 # 17.

Slides:



Advertisements
Similar presentations
CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 4 – Digital Image Representation Klara Nahrstedt Spring 2009.
Advertisements

Computer Science 111 Fundamentals of Programming I More Digital Image Processing.
Advanced Computer Graphics (Spring 2006) COMS 4162, Lecture 4: Image Processing 1 Ravi Ramamoorthi
Topic 6 - Image Filtering - I DIGITAL IMAGE PROCESSING Course 3624 Department of Physics and Astronomy Professor Bob Warwick.
Transforming images to images
Advanced Computer Graphics CSE 190 [Spring 2015], Lecture 4 Ravi Ramamoorthi
CS292 Computational Vision and Language Image processing and transform.
E.G.M. PetrakisFiltering1 Linear Systems Many image processing (filtering) operations are modeled as a linear system Linear System δ(x,y) h(x,y)
School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae & david streader, VUW Images and 2D Graphics COMP.
Image Filtering CS485/685 Computer Vision Prof. George Bebis.
Image processing. Image operations Operations on an image –Linear filtering –Non-linear filtering –Transformations –Noise removal –Segmentation.
Computer Vision - A Modern Approach
7. Neighbourhood operations A single pixel considered in isolation conveys information on the intensity and colour at a single location in an image, but.
CS 376b Introduction to Computer Vision 02 / 27 / 2008 Instructor: Michael Eckmann.
Lecture 1: Images and image filtering
CS443: Digital Imaging and Multimedia Filters Spring 2008 Ahmed Elgammal Dept. of Computer Science Rutgers University Spring 2008 Ahmed Elgammal Dept.
Comp 665 Convolution. Questions? Ask here first. Likely someone else has the same question.
Lecture 2: Image filtering
April Geometric Transformations for Computer Graphics Shmuel Wimer Bar Ilan Univ., School of Engineering.
School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae, VUW Images and 2D Graphics COMP # 16.
Harris detector Convert image to greyscale Apply Gaussian convolution to blur the image and remove noise Calculate gradient of image in x and y direction.
Image Processing.  a typical image is simply a 2D array of color or gray values  i.e., a texture  image processing takes as input an image and outputs.
CS 376b Introduction to Computer Vision 02 / 26 / 2008 Instructor: Michael Eckmann.
Machine Vision ENT 273 Image Filters Hema C.R. Lecture 5.
CS559: Computer Graphics Lecture 3: Digital Image Representation Li Zhang Spring 2008.
Geometric transformations Affine transformations Forward mapping Interpolations schemes.
Image Preprocessing: Geometric Correction Image Preprocessing: Geometric Correction Jensen, 2003 John R. Jensen Department of Geography University of South.
Basis beeldverwerking (8D040) dr. Andrea Fuster Prof.dr. Bart ter Haar Romeny dr. Anna Vilanova Prof.dr.ir. Marcel Breeuwer Convolution.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington More Recursion COMP 102 #32.
Filtering Robert Lin April 29, Outline Why filter? Filtering for Graphics Sampling and Reconstruction Convolution The Fourier Transform Overview.
EE663 Image Processing Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.
Lecture 03 Area Based Image Processing Lecture 03 Area Based Image Processing Mata kuliah: T Computer Vision Tahun: 2010.
Image Processing Edge detection Filtering: Noise suppresion.
infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images.
AdeptSight Image Processing Tools Lee Haney January 21, 2010.
Convolution and Filtering
School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae, VUW Image Recognition COMP # 18.
GEOMETRIC OPERATIONS. Transformations and directions Affine (linear) transformations Translation, rotation and scaling Non linear (Warping transformations)
CSC508 Convolution Operators. CSC508 Convolution Arguably the most fundamental operation of computer vision It’s a neighborhood operator –Similar to the.
Image Transforms Transforming images to images. Classification of Image Transforms Point transforms –modify individual pixels –modify pixels’ locations.
Magic Camera Master’s Project Defense By Adam Meadows Project Committee: Dr. Eamonn Keogh Dr. Doug Tolbert.
Image Processing 고려대학교 컴퓨터 그래픽스 연구실 cgvr.korea.ac.kr.
Visual Computing Computer Vision 2 INFO410 & INFO350 S2 2015
Krivljenje slike - warping. Princip 2D krivljenja Demo.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington More Recursion COMP 102 #30.
Digital Image Processing Part 3 Spatial Domain Processing.
Instructor: Mircea Nicolescu Lecture 5 CS 485 / 685 Computer Vision.
Lecture 1: Images and image filtering CS4670/5670: Intro to Computer Vision Noah Snavely Hybrid Images, Oliva et al.,
Non-linear filtering Example: Median filter Replaces pixel value by median value over neighborhood Generates no new gray levels.
School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae & david streader, VUW Images and 2D Graphics COMP.
Filters– Chapter 6. Filter Difference between a Filter and a Point Operation is that a Filter utilizes a neighborhood of pixels from the input image to.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Recursion COMP 102 # T1.
Images and 2D Graphics COMP
Spatial Image Enhancement
Modeling Transformations
图像处理技术讲座(3) Digital Image Processing (3) Basic Image Operations
Basis beeldverwerking (8D040) dr. Andrea Fuster dr. Anna Vilanova Prof
Histogram Histogram is a graph that shows frequency of anything. Histograms usually have bars that represent frequency of occuring of data. Histogram has.
EE/CSE 576 HW 1 Notes.
More Image Manipulation
9th Lecture - Image Filters
Resolution Resolution: 6 x 4.
EE/CSE 576 HW 1 Notes.
Non-local Means Filtering
Harris detector Convert image to greyscale
Lecture 2: Image filtering
Image Processing 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr.
ECE/CSE 576 HW 1 Notes.
Graphics Laboratory Korea University
Image Processing 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr.
Presentation transcript:

School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae, VUW Images and 2D Graphics COMP # 17

COMP112 17: 2 Menu Graphics Images and image manipulation Admin Test: 15 th April, 4-5pm, A – L: HMLT104, M – Z: HULT323

COMP112 17: 3 Image manipulation What kinds of manipulation are there? Independent pixels: changing colors: (brightness, contrast, redness,…..) Geometric transformations translate, rotate, reflect, skew, scale/resize parts of images may involve interpolation to find new pixel values Selecting and modifying regions spread fill representing non-rectangular regions Applying “filters” blur, sharpen, ….. Image recognition.

COMP112 17: 4 Geometric Transforms If you translate, rotate, scale, etc the pixels may not line up: pixel (3,1)  pixel (2.7, 2.2) pixel (1,4)  pixel (1.3, 2.8) What value do you use for the new pixels? Options: use truncated pixel coordinates use rounded pixel coordinates take average of overlapping pixels interpolate overlapping pixels (average weighted by distance or degree of overlap)

COMP112 17: 5 Geometric Transforms If you translate, rotate, scale, etc the pixels may not line up: pixel (3,1)  pixel (2.7, 2.2) pixel (1,4)  pixel (1.3, 2.8) What about pixels over the edge? What about missing pixel values? Options: drop pixels outside change dimensions of image blank missing pixels (white/black/grey….) use original pixel values.

COMP112 17: 6 Computing new pixel value Truncate/Round coordinates: To compute new pixel value at (i, j) work out the pixel that it came from (eg if translate by dx and dy, came from (i-dx, j-dy)) round/truncate to integers. oi = (int) (i-dx); oj = (int) (j-dy); check coords are within image (oi>= 0 && oi<=width, …) use pixel value at those cords of original image. How do you make sure that the new values don’t mess up the old values during the calculation? Always have two image arrays: original image new image. Construct values in new image from values in old image Then copy over. Easier doing reverse direction than forward direction

COMP112 17: 7 Transforming int [ ][ ][ ] newImage = new int [image.length] [image[0].length] [3]; for (int i = 0; i< newImage.length; i++){ for (int j = 0; j< newImage.length; j++){ int oi = (int)(i - translateX)); // or whatever transformation int oj = (int)(i - translateY); if (oi>=0 && oi = 0 && ok <= image[0].length) { newImage[ i ][ j ] = image[oi][oj]; // not safe!! newImage[ i ][ j ] = Arrays.copyOf(image[oi][oj], 3); } else { newImage [ i ][ j ] = = new int[ ]{ 0, 0,0}; } image = newImage;

COMP112 17: 8 Rotation How can we rotate image by  degrees? Must specify the center of rotation: xCenter, yCenter Need trigonometry: forward xNew = xCenter + (x-xCenter) cos(  ) – (y-yCenter) sin(  ) yNew = yCenter + (x-xCenter) sin(  ) + (y-yCenter) cos(  ) reverse x = xCenter + (xNew-xCenter) cos(  ) + (yNew-yCenter) sin(  ) y = yCenter - (xNew-xCenter) sin(  ) + (yNew-yCenter) cos(  ) x,y xNew, yNew  xCenter,yCenter

COMP112 17: 9 Interpolating double ox = (….i ….. j…); double oy = (…. i …..j…); int oi = (int) ox; double oy = (int) oy; newImage[ i ][ j ] = image[oi][oj] * (1-Math.hypot(ox-oi, oy-oj) + image[oi+1][oj] * + image[oi][oj+1] * + image[oi+1][oj+1] * +

COMP112 17: 10 Blur, Filters, Convolution Many image transformations involve replacing each pixel with some function of the pixel values in its neighbourhood: Blur, changing resolution: pixel → average of neighbourhood Sharpening, edge detection pixel → "difference" between pixel and neighbours

COMP112 17: 11 Blur, Filters, Convolution Many image transformations involve replacing each pixel with some function of the pixel values in its neighbourhood: Blur, changing resolution: pixel → average of neighbourhood Sharpening, edge detection pixel → "difference" between pixel and neighbours Convolution: Apply "neighbour weights" to each pixel in image:

COMP112 17: 12 Convolution Filtering input: image: rows x cols array of pixel filter:height x width array of weights, usually height & width are odd, and weights sum to 1.0 output: newImage: rows x cols array of pixel for row ← 0.. rows-1 for col ← 0.. cols-1 ht2 ← (height-1)/2, wd2 ← (width-1)/2 for r ← –ht2.. ht2 for c ← –wd2.. wd2 newImage[row, col] += image[row+r][col+c] * filter[r+ht2] [c+w2] Problems: Have to take care at the edges How do you multiply colours?

COMP112 17: 13 Filters Blur: what are good weights? Gaussian distribution (weight = gaussian of distance from center)

COMP112 17: 14 Filters "Bokeh" or lens blur effect of an out-of-focus lens convolve with a uniform circular filter

COMP112 17: 15 Sharpening Emphasise pixels that are very different from their neighbours "unsharpening" = original – blurred image has –ve weights ⇒ must be careful not to make invalid pixel values "Real" sharpening: This is symmetric; how does it sharpen an edge? – 0.5 x ⇒

COMP112 17: 16 Sharpening an edge

COMP112 17: 17 Edge Detection Simple: (D of G) sum to 0 ⇒ constant areas → 0 only "edge" regions bright Complex: Requires more than just a convolution filter eg Canny: convolution, gradients, threshold, …