c# cartoon application

24
C# CARTOON APPLICATION Miles Lamensky

Upload: hinda

Post on 24-Feb-2016

30 views

Category:

Documents


0 download

DESCRIPTION

C# CARTOON APPLICATION. Miles Lamensky. Accepting Demo Pics. [email protected] (

TRANSCRIPT

Page 1: C# CARTOON APPLICATION

C# CARTOON APPLICATIONMiles Lamensky

Page 2: C# CARTOON APPLICATION

Accepting Demo Pics

[email protected]( <600x400 )

Page 3: C# CARTOON APPLICATION

Outline

• Definition and Requirements• Solutions• Methodology• Real-Time Demo• Exceptions• Learning and Development Process

Page 4: C# CARTOON APPLICATION

Definition and RequirementsProject: Develop an application that makes cartoon like images from pictures.

General Requirements: 1. Take an image and convert it to a cartoon like image using rotoscoping techniques.2. Implement save and open functions.3. Examine several rotoscoping algorithms and design your own.4. Control the contrast, tint and intensity of the cartoon.5. Choose a finite number of colors.6. Actually choose the specific colors. 7. Implement a mobile version.9. Consider showing the cartoon image as a preview before taking the picture.

Page 5: C# CARTOON APPLICATION

Solutions

Page 6: C# CARTOON APPLICATION

Solutions cont…

Page 7: C# CARTOON APPLICATION

Methodology• Image Format Conversation (Bitmap->Array, Bitmap->Image, etc.)

• Original Image -> Grayscale• Sobel (Damian Wegner, 2005: http://

compsci02.snc.edu/cs460/2005/wegndt/) • Palette Quantizer, Median Cut (Smart K8:

http://www.codeproject.com/Articles/66341/A-Simple-Yet-Quite-Powerful-Palette-Quantizer-in-C

)

Page 8: C# CARTOON APPLICATION

Image targetImage = GetQuantizedImage(sourceImage);

Bitmap grayed = ToGrayscale(img); InitializeSolidBW(BWArray, grayed);

targetImage = Sobel_Process(targetImage);

Merge(SobelData, img);Sobel(SobelData, BWArray);

Page 9: C# CARTOON APPLICATION

Real-Time Demo

Page 10: C# CARTOON APPLICATION

Learning and Development Process

• Strategies• Extensions• Knowledge• Advice

Page 11: C# CARTOON APPLICATION

Strategies• Cursory/Playful Exploration

1

+ recursive sweeps+ averaging neighbors + color comparisonTHE BAD:+ timeeffectiveness

Page 12: C# CARTOON APPLICATION

2 openCV+ Hough Transform

Page 13: C# CARTOON APPLICATION

3 Sobel+ Working Edge Detection+ Noise Reduction Attempts (Median Cut)

Page 14: C# CARTOON APPLICATION

4 Recursive Technique + SobelTHE BAD:+ too many colors+ still too much time

Page 15: C# CARTOON APPLICATION

5 Color Quantization + Sobel

Page 16: C# CARTOON APPLICATION

Exceptions

• Global Variables*• BIG Files*• Color Leakage• Thickening Detected Edges• Post-Edge Noise Reduction• Already Low-Quality Images

Page 17: C# CARTOON APPLICATION

Color Leakage

Possible Fixes:• Edge Detection

First

+ Color mixing when too few colors

Page 18: C# CARTOON APPLICATION

Thickening Detected EdgesPossible Fixes:• Alter Sobel Function

SobelData[y1, x1] = 255 - sum;

//FEEBLE ATTEMPT TO THICKEN EDGE; FAIL //SobelData[y1-1, x1-1] = 255 - sum; //SobelData[y1, x1 - 1] = 255 - sum; //SobelData[y1 - 1, x1] = 255 - sum; //SobelData[y1 + 1, x1 + 1] = 255 - sum; //SobelData[y1 + 1, x1] = 255 - sum; //SobelData[y1, x1 + 1] = 255 - sum; //SobelData[y1 + 1, x1 - 1] = 255 - sum; //SobelData[y1 - 1, x1 + 1] = 255 - sum;

Page 19: C# CARTOON APPLICATION

Post-Edge Noise Reduction

Possible Fixes:• Noise Reduction Algorithms

Noise Reduction

Page 20: C# CARTOON APPLICATION

Already Low-Quality Images

• The purpose of a color quantization!!!

Page 21: C# CARTOON APPLICATION

Knowledge• Android (-_-)• C# (*)• Color Comparison• RGB• openCV– Hough Transform

• Visual Basic– Sobel

• Color Quantization– Median Cut

Page 22: C# CARTOON APPLICATION

For Future Friends

• Android• Real-Time Conversion (Video)

Page 23: C# CARTOON APPLICATION

Advice• Borrow Shamelessly (i.e. Steal Adapt)• Make a !@#$@ Plan• Read the Project Outline• Swallow Pride (i.e. ???’s)• Error Blog• Step Back– Alternate– Alcohol (if of age)

Page 24: C# CARTOON APPLICATION

Hey. Thanks.