Programming Assignment 1 CS302 Data Structures. Goals Improve your skills with manipulating dynamic arrays. Improve your understanding of constructors,

Slides:



Advertisements
Similar presentations
Computer Graphics- SCC 342
Advertisements

Computer Science 111 Fundamentals of Programming I More Digital Image Processing.
Do Now:.
Warm Up Draw an example of a reflection: Draw an example of a figure that has one or more lines of symmetry: Find the new coordinates of the image after.
Geometric Operations Move over rover. Geometric Operations  Previous operations have taken a sample at some location and changed the sample value (the.
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.
Image Filtering CS485/685 Computer Vision Prof. George Bebis.
CSE 803 Using images in C++ Computing with images Applications & Methods 2D arrays in C++ Programming project 4.
Programming Assignment 2 CS308 Fall Goals Improve your skills with using templates. Learn how to compile your code when using templates. Learn more.
8. Geometric Operations Geometric operations change image geometry by moving pixels around in a carefully constrained way. We might do this to remove distortions.
CS485/685 Computer Vision Prof. George Bebis
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
Lecture 6 Sept 15, 09 Goals: two-dimensional arrays matrix operations circuit analysis using Matlab image processing – simple examples.
Computer Vision Lecture 3: Digital Images
3D Graphics Goal: To produce 2D images of a mathematically described 3D environment Issues: –Describing the environment: Modeling (mostly later) –Computing.
By: Suhas Navada and Antony Jacob
Image processing Lecture 4.
October 8, 2013Computer Vision Lecture 11: The Hough Transform 1 Fitting Curve Models to Edges Most contours can be well described by combining several.
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.
Digital Images Chapter 8 Exploring the Digital Domain.
CS 376b Introduction to Computer Vision 02 / 26 / 2008 Instructor: Michael Eckmann.
COMP 175: Computer Graphics March 24, 2015
Chapter 3: Image Restoration Geometric Transforms.
Image Synthesis Rabie A. Ramadan, PhD 3. 2 Our Problem.
Image Preprocessing: Geometric Correction Image Preprocessing: Geometric Correction Jensen, 2003 John R. Jensen Department of Geography University of South.
Basic Image Manipulation Raed S. Rasheed Agenda Region of Interest (ROI) Basic geometric manipulation. – Enlarge – shrink – Reflection Arithmetic.
Geometric Transformations
Crypto Project Sample Encrypted Data: –Turing: CS Public\CryptoProjectData Crypto_Short_Keys_P_U.out Crypto_Long_Keys_O_R.out Bonus +10 points on.
Digital Image Processing Lecture 6: Image Geometry
September 5, 2013Computer Vision Lecture 2: Digital Images 1 Computer Vision A simple two-stage model of computer vision: Image processing Scene analysis.
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.
1 Principles of Computer Science I Prof. Nadeem Abdul Hamid CSC 120 – Fall 2005 Lecture Unit 2 - Using Objects.
CSC508 Convolution Operators. CSC508 Convolution Arguably the most fundamental operation of computer vision It’s a neighborhood operator –Similar to the.
Transformations To move a figure in the coordinate system to another location or image, by a rule.
1 Absolute Orientation Determination using Horn Approach.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 17, 2015 TRANSFORMATIONS AFFINE TRANSFORMATIONS QUATERNIONS.
School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae, VUW Images and 2D Graphics COMP # 17.
CS 325 Introduction to Computer Graphics 04 / 12 / 2010 Instructor: Michael Eckmann.
Transformations LESSON 26POWER UP FPAGE 169. Transformations The new image is read as “A prime, B prime, C prime”
Properties or Rules of Transformations Equations used to find new locations.
October 16, 2014Computer Vision Lecture 12: Image Segmentation II 1 Hough Transform The Hough transform is a very general technique for feature detection.
Coordinate Systems Lecture 1 Fri, Sep 2, The Coordinate Systems The points we create are transformed through a series of coordinate systems before.
Instructor: Mircea Nicolescu Lecture 5 CS 485 / 685 Computer Vision.
Go Back > Question 1 Describe this transformation. A reflection in the line y = x. ? Object Image.
GEOMETRY SECTION 7 REFLECTIONS & ROTATIONS Geometry S7 Day 3 1.
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.
Computer Graphics CC416 Lecture 04: Bresenham Line Algorithm & Mid-point circle algorithm Dr. Manal Helal – Fall 2014.
Write Bresenham’s algorithm for generation of line also indicate which raster locations would be chosen by Bresenham’s algorithm when scan converting.
IS502:M ULTIMEDIA D ESIGN FOR I NFORMATION S YSTEM D IGITAL S TILL I MAGES Presenter Name: Mahmood A.Moneim Supervised By: Prof. Hesham A.Hefny Winter.
Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis.
Images and 2D Graphics COMP
Fitting Curve Models to Edges
Histogram Histogram is a graph that shows frequency of anything. Histograms usually have bars that represent frequency of occuring of data. Histogram has.
Chapter 6 transformations
(c) 2002 University of Wisconsin, CS 559
Fundamentals of Programming I Introduction to Digital Image Processing
Transformations my dear Watson.
Properties or Rules of Transformations
Transformations Translation Reflection The FRAME Routine
Transformations Review
Introduction to Artificial Intelligence Lecture 22: Computer Vision II
Graphics Laboratory Korea University
DIGITAL IMAGE PROCESSING Elective 3 (5th Sem.)
Pages Draw a Point at the center of dilation (Point P).
Image Processing 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr.
Presentation transcript:

Programming Assignment 1 CS302 Data Structures

Goals Improve your skills with manipulating dynamic arrays. Improve your understanding of constructors, destructors, and copy-constructors. Improve your skills with operator overloading. Familiarize yourself with reading/writing images from/to a file. Familiarize yourself with image processing. Improve your skills with documenting and describing your programs.

Implementation You should implement: image.h (class specification) image.cpp (class implementation) driver.cpp (application or client)

image.h class Image { public: constructor //parameter less constructor //with parameters copy_constructor operator= getImageInfo getPixelVal setPixelVal getSubImage meanGray

image.h (cont’d) enlargeImage shrinkImage reflectImage translateImage rotateImage operator+ operator- negateImage private: int N; //no of rows int M; //no of columns int Q; //no of gray-level values int **pixelVal; };

First... Carefully implement the following functions: –constructor –destructor –copy-constructor –assignment

readImage(fileName, image) (client function – has been provided) Reads in an image in PGM format from a file. A “NOT-PGM” exception should be raised if the image is not in PGM format.

writeImage(fileName, image) (client function – has been provided) Writes out an image to a file in PGM format.

getImageInfo(noRows, noCols, maxVal) (member function – has been provided) Returns: –the height (# of rows) –width (# of columns) of the image –the max gray-level value allowed (i.e., 255 for 8-bit images) These values are “returned” using call by reference.

int getPixelVal(r, c) (member function – has been provided) Returns the pixel value at (r, c) location. An OUT-OF-BOUNDS exception should be raised if (r,c) falls outside the image.

setPixelVal(r, c, value) (member function – has been provided) Sets the pixel value at location (r, c) to value. An OUT-OF-BOUNDS exception should be raised if (r,c) falls outside the image.

getSubImage(Ulr, Ulc, LRr, LRc, oldImage) It crops a rectangular subimage from the input image. –The subimage can be defined by the coordinates of its upper-left (UL) and lower-right (LR) corners. –Useful for limiting the extent of image processing operations to some small part of the image.

int meanGray() Computes the average gray-level value of an image. Returns the value as “int” (i.e., truncate the result)

enlargeImage(s, oldImage) Enlarges the input image by some integer factor s It is useful for magnifying small details in an image. 2 times the original size

enlargeImage (cont’d) Replicate pixels such that each pixel in the input image becomes an s x s block of identical pixels in the output image. Most easily implemented by iterating over pixels of the output image and computing the coordinates of the corresponding input image pixel. Example: s = 2

shrinkImage(s, oldImage) Shrinks the input image by some integer factor s It is useful, for example, for reducing a large image in size so it fits on the screen. 1/2 times the original size

shrinkImage (cont’d) Sample every s-th pixel in the horizontal and vertical dimensions and ignore the other. Most easily implemented by iterating over pixels of the output image and computing the coordinates of the corresponding input image pixel. Example: s = 2

reflectImage(flag, oldImage) Reflects the input image along the horizontal or vertical directions. vertical reflection

reflectImage (cont’d) Reflection along either direction can be performed by simply reversing the order of pixels in the rows or columns of the image

operator+ (image addition) Computes the weighted sum of two images. You can use it for simple image morphing ! + =

operator- (image subtraction) Computes the difference of two given images. Useful for change detection. Compute absolute difference: - =

negateImage() Computes the negative of an image. This can be done using the following transformation negative

translateImage(t, oldImage) Translates the pixel locations by some amount t. Translation can be performed using the equations: 32 x 32 translation

rotateImage(theta, oldImage) Rotates the input image by some angle theta about (0,0). Rotation uses the following equations: if theta > 0: counter- clockwise about (0,0) if theta < 0: clockwise about (0,0)

rotateImage (cont’d) Equations to rotate an image about any point : -45 degrees rotation (about the center of the image)

Ignore pixels whose coordinates fall outside the range. Find nearest neighbors to and rotateImage (cont’d) Practical problems: –consider rotating pixel (0,100) by 90 degrees: –consider rotating pixel (50,0) by 35 degrees:

rotateImage(cont’d) Serious problem: the rotated image could contain numerous “holes” where no value was computed for a pixel !! original rotated

Extra Credit Usually, each assignment will contain a number of extra credit questions; answering the extra credit questions is optional. Your are expected to spend some time thinking about each question and provide a reasonable answer. Reasonable ideas, which have been implemented and demonstrated to the TA, will get extra credit !!

Useful Tips Learn how to use a debugger –Very important for debugging your programs efficiently! Learn how to use makefiles (especially if you use Linux/Unix): –Very useful when your application is split over many files.