Parallel edge detection
Download
1 / 16

Parallel Edge Detection - PowerPoint PPT Presentation


  • 133 Views
  • Uploaded on

Parallel Edge Detection. Daniel Dobkin Asaf Nitzan. We’ll talk about…. Introduction to Image Processing What are edges? Why do we need to find them? How do we find them? Motivation to parallelize this process OpenMP implementation. What is an image?. 2-D / 3-D array of pixels

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Parallel Edge Detection' - genero


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Parallel edge detection

Parallel Edge Detection

Daniel Dobkin

AsafNitzan


We ll talk about
We’ll talk about…

Introduction to Image Processing

What are edges? Why do we need to find them? How do we find them?

Motivation to parallelize this process

OpenMP implementation


What is an image
What is an image?

  • 2-D / 3-D array of pixels

  • Color channels

    • RGB – 3 channels

    • Grayscale – 1 channel

  • 1 byte per channel

    values of 0-255


  • A closer look at pixels
    A closer look at pixels

    R = 225

    G = 157

    B = 168

    R = 201

    G = 120

    B = 137


    Edges
    Edges

    • A sharp change in values of adjacent pixels

    • Motivation to find edges

    • A very basic feature in image processing


    Finding edges
    Finding Edges

    • First, convert image from RGB to Grayscale

    • Convolve the image with a special 2-D operator

      • A greater change in intensity indicates a more prominent edge

  • Sobel operator:


  • Finding edges example
    Finding Edges - Example

    • For Sobel x filter: -617

    • For Sobel y filter: -669

    • So now we have 2 numbers, now what?

      • We calculate the magnitude and the orientation of the gradient:


    Motivation to parallelize
    Motivation to Parallelize

    • Large amount of computations

      • 800 x 600 pixels = 480,000 pixels  5.5 million additions, 2 million multiplications

  • Especially when it comes to real-time video…

    • 24 fps = 11.5 million pixels  132 million additions, 48 million multiplications…


  • Openmp
    openMP

    • Processors access same shared memory

      • Each processor performs the region of image assigned to him

      • Reduced communication - There is no need to broadcast the pixels of the image to all other processors


    Openmp implementation
    openMP Implementation

    • Multithreading

      • Master thread forks a number of threads which execute code in parallel

    Original Image

    Parallel task – Sobel filtering

    join

    fork

    A

    Master thread

    Master thread

    B

    C

    D


    Pseudocode
    Pseudocode

    Load Image from Main memory

    Allocate memory to new image

    Set number of threads

    #pragmaomp parallel for \

    shared(inputImage, outputImage, width, height)\

    private(StartPixel, NumOfThreads, Rank , xPixel, yPixel)

    for each Pixel in region

    Convert RGB value to greyscale

    Compute gradient using Sobel filter

    Store result in filtered image

    Join all threads

    Store new image to disk


    Openmp implementation1
    openMP Implementation

    Filtered Image

    Original Image

    Processor 1

    Sobel

    Processor 2

    Sobel

    Processor 3

    Sobel

    Processor 4

    Sobel

    Main Memory


    Speedup graph
    Speedup Graph

    • Linear Speedup due to low communication cost

    http://www.cs.rit.edu/~ptt/courses/4003-531/


    ad