CSE 160 – Lecture 10 Programs 1 and 2. Program 1 Write a “launcher” program to specify exactly where programs are to be spawned, gather output, clean.

Slides:



Advertisements
Similar presentations
Practical techniques & Examples
Advertisements

CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 4 – Digital Image Representation Klara Nahrstedt Spring 2009.
Computational Biology, Part 23 Biological Imaging II Robert F. Murphy Copyright  1996, 1999, All rights reserved.
Spatial Filtering (Chapter 3)
Image Processing in Matlab An Introductory Approach by Sabih D. Khan
Image Processing A brief introduction (by Edgar Alejandro Guerrero Arroyo)
Multimedia communications EG 371Dr Matt Roach Multimedia Communications EG 371 and EE 348 Dr Matt Roach Lecture 6 Image processing (filters)
Quadtrees, Octrees and their Applications in Digital Image Processing
1 Image filtering Hybrid Images, Oliva et al.,
CS 376b Introduction to Computer Vision 04 / 11 / 2008 Instructor: Michael Eckmann.
7. Neighbourhood operations A single pixel considered in isolation conveys information on the intensity and colour at a single location in an image, but.
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.
Quadtrees, Octrees and their Applications in Digital Image Processing
CS 376b Introduction to Computer Vision 02 / 27 / 2008 Instructor: Michael Eckmann.
1 Image Filtering Readings: Ch 5: 5.4, 5.5, 5.6,5.7.3, 5.8 (This lecture does not follow the book.) Images by Pawan SinhaPawan Sinha formal terminology.
Page 1 CS Department Parallel Design of JPEG2000 Image Compression Xiuzhen Huang CS Department UC Santa Barbara April 30th, 2003.
CS 376b Introduction to Computer Vision 04 / 14 / 2008 Instructor: Michael Eckmann.
Objective of Computer Vision
1 Image filtering
CS 376b Introduction to Computer Vision 03 / 04 / 2008 Instructor: Michael Eckmann.
A Novel 2D To 3D Image Technique Based On Object- Oriented Conversion.
MSU CSE 803 Linear Operations Using Masks Masks are patterns used to define the weights used in averaging the neighbors of a pixel to compute some result.
FLANN Fast Library for Approximate Nearest Neighbors
Image processing Lecture 4.
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.
Parallel Edge Detection Daniel Dobkin Asaf Nitzan.
Spatial Filtering: Basics
Computer Science 320 Load Balancing for Hybrid SMP/Clusters.
Chapter 1 What is Programming? Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas, E.
CS 6825: Binary Image Processing – binary blob metrics
Lecture 03 Area Based Image Processing Lecture 03 Area Based Image Processing Mata kuliah: T Computer Vision Tahun: 2010.
Quadtrees, Octrees and their Applications in Digital Image Processing.
Edge Detection Today’s reading Cipolla & Gee on edge detection (available online)Cipolla & Gee on edge detection From Sandlot ScienceSandlot Science.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
SHINTA P. Juli What are edges in an image? Edge Detection Edge Detection Methods Edge Operators Matlab Program.
Data Extraction using Image Similarity CIS 601 Image Processing Ajay Kumar Yadav.
CSC508 What You Should Be Doing Code, code, code –Programming Gaussian Convolution Sobel Edge Operator.
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
SIMD Image Processor Eric Liskay Andrew Northy Neraj Kumar 1.
Computer Science and Engineering Parallel and Distributed Processing CSE 8380 February Session 11.
Gesture Recognition in a Class Room Environment Michael Wallick CS766.
CSC508 Convolution Operators. CSC508 Convolution Arguably the most fundamental operation of computer vision It’s a neighborhood operator –Similar to the.
Image Segmentation in Color Space By Anisa Chaudhary.
Decomposition Data Decomposition – Dividing the data into subgroups and assigning each piece to different processors – Example: Embarrassingly parallel.
Message-Passing Computing Chapter 2. Programming Multicomputer Design special parallel programming language –Occam Extend existing language to handle.
Parallel and Distributed Simulation Time Parallel Simulation.
Computer Science 320 Load Balancing with Clusters.
Geog. 579: GIS and Spatial Analysis - Lecture Overheads 1 Raster Filters Topics: Lecture 03-04: Neighborhood Operations References: Chapter 7 in.
Automating Scoliosis Analysis By Amar Sahai Thomas Jefferson High School for Science and Technology
CSE 6367 Computer Vision Image Operations and Filtering “You cannot teach a man anything, you can only help him find it within himself.” ― Galileo GalileiGalileo.
Image Processing A Study in Pixel Averaging Building a Resolution Pyramid With Parallel Computing Denise Runnels and Farnaz Zand.
Introduction to JPEG m Akram Ben Ahmed
CS Spring 2010 CS 414 – Multimedia Systems Design Lecture 4 – Audio and Digital Image Representation Klara Nahrstedt Spring 2010.
Canny Edge Detection Using an NVIDIA GPU and CUDA Alex Wade CAP6938 Final Project.
Machine Vision Edge Detection Techniques ENT 273 Lecture 6 Hema C.R.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
Vision-Guided Robot Position Control SKYNET Tony BaumgartnerBrock Shepard Jeff Clements Norm Pond Nicholas Vidovich Advisors: Dr. Juliet Hurtig & Dr. J.D.
Essential components of the implementation are:  Formation of the network and weight initialization routine  Pixel analysis of images for symbol detection.
Computer Science and Engineering Parallel and Distributed Processing CSE 8380 February Session 12.
September 26, 2013Computer Vision Lecture 8: Edge Detection II 1Gradient In the one-dimensional case, a step edge corresponds to a local peak in the first.
ITK 9.3. Level Set Segmentation Shape Detection Segmentation
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
Concept 1: Computing Weighted Sum. Is an operation between two tables of numbers, usually between an image and weights. Typically, if one table is smaller,
Miguel Tavares Coimbra
Mean Shift Segmentation
In Class Programming BIS1523 – Lecture 11.
Linear Operations Using Masks
Image Filtering Readings: Ch 5: 5. 4, 5. 5, 5. 6, , 5
Image Filtering with GLSL
Presentation transcript:

CSE 160 – Lecture 10 Programs 1 and 2

Program 1 Write a “launcher” program to specify exactly where programs are to be spawned, gather output, clean up on error … Write a ring gather program Write a tree gather program

Code Outline for Program 1 Code outlines were given in lecture 5 We will go over an example implementation for all three parts –Looking carefully at each PVM function –Using XPVM to control a virtual machine Space-time diagrams Trace masks Replaying traces This will interactive

Program 2 Implement the Sobel (Section 11.5 in W+A) edge detection algorithm –Input/output files in PGM format –Master/worker configuration –“Bag of tasks” load balancing –Data decomposed by strips Assignment available on the web on Friday

Edge Detection Basic problem: Try to find edges (areas of local sharp contrast) in a greyscale image –Think back to basic 1D calculus When |df/dx| is high, function is changing rapidly –For 2D problems this is generalized to gradients.  f(x,y) = (  f/  x,  f/  y) The goal is to find areas in a picture where the |  f(x,y) | is high.

Approximating the Magnitude of the Gradient |  f(x,y)| =  (  f/  x) 2 + (  f/  y) 2 – For computational simplicity, this is approximated as |  f/  x| + |  f/  y| Let’s consider the following 3 x 3 matrix of values x0x0 x1x1 x2x2 x3x3 x4x4 x5x5 x6x6 x7x7 x8x8

Calculating the |Gradient| at X 4 X 4 is the pixel of interest. Could try an approximation as –  f/  x = x 5 – x 3 (difference left and right) –  f/  y = x 7 – x 1 (difference top and bottom) One gets much better approximation of all surrounding pixels are used to approximate the gradient

The Sobel Operator Look at calculating  f/  y –  f/  y = x 6 –x 0 + 2(x 7 – x 1 ) + x 9 – x 3 –This is only a weighted average of the gradient by using neighboring pixels. Extra weight is given to the pixels directly above and below the center pixel of interest  f/  x = x 2 –x 0 + 2(x 5 – x 3 ) + x 8 – x 6

Cross Correlation Mask Pixels Cross correlation is  i  j x i w j Want to calculate the cross-correlation at each point in an image using two masks. x0x0 x1x1 x2x2 x3x3 x4x4 x5x5 x6x6 x7x7 x8x8 w0w0 w1w1 w2w2 w3w3 w4w4 w5w5 w6w6 w7w7 w8w8 

Final Calculation Calculate a new x 4 ’ with the following Sobel formula –x 4 ’ = (1/9) * ( |x 6 –x 0 + 2(x 7 – x 1 ) + x 9 – x 3 | + |x 2 –x 0 + 2(x 5 – x 3 ) + x 8 – x 6 ) ) Need to do this at every point in the picture.

Master/Worker Model Master reads input/writes final output Give an input file, divide the image into K horizontal strips K Strips

Master Spawns P Workers Master will start P (  K) workers The first P strips are sent to the P slaves. –Slaves compute the Sobel transform on their strip. Return transformed image to the master As the master gets data returned, it doles out more strips until the entire image is converted.

Bag of tasks Load Balancing For this problem, a task is the Sobel transform of an image strip. –Workers may compute at different speeds Faster workers get more work to do (Sounds like life ) Slower workers get less work to do For few workers and may tasks, most workers are busy all of the time.

What to do at the edge of regions to transform? Strip j needs 1 row of pixels from strip j+1 and strip j-1 Have master send these 1 pixel rows as part of the jth strip. at edges, consider the image to have pixel value 0 outside the pixel area. j j-1 j+1

Master Pseudo-code Read command line arguments Spawn P worker tasks Read complete image into an array, pad edges with zeros (N+2)x(M+2) Nrows=ceil((N+2)/K) // rows per block Pkidx=0; //row index to pack stripsLeft = K; for (i = 0; i < P; i++){ label strip i pack label of strip i pack the dimensions of strip i pack the data of strip i send ith strip to ith worker; }

Master Pseudo Code continued stripsleft = K – P; Stripsxformed = 0; While (stripsleft) receive transformed strip from any worker; stripsxformed ++; determine which strip has been sent; Save data; pack strip S = [K – stripsleft]; send strip S to this worker; stripsleft--; }

Master Continued While (stripsxformed < K) receive transformed strip from any worker; stripsxformed++; determine strip that was sent; save data; stripsxformed++; } Broadcast a done message to every worker; Write out transformed data;

Worker Pseudo code done = 0; While (!done) { receive message from parent; (pvm_parent()) determine message tag; (pvm_bufinfo()) if (Tag == donemessage) break; unpack strip id; unpack strip dimension; unpack strip data; transform data; pack strip id, dimension; pack transformed data; send back to parent; }