250 likes | 393 Views
C# CARTOON APPLICATION. Miles Lamensky. Accepting Demo Pics. miles.lamensky@snc.edu ( <600x400 ). Outline. Definition and Requirements Solutions Methodology Real-Time Demo Exceptions Learning and Development Process. Definition and Requirements.
E N D
C# CARTOON APPLICATION MilesLamensky
Accepting Demo Pics miles.lamensky@snc.edu ( <600x400 )
Outline • Definition and Requirements • Solutions • Methodology • Real-Time Demo • Exceptions • Learning and Development Process
Definition and Requirements Project: 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 rotoscopingtechniques. 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.
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)
targetImage = Sobel_Process(targetImage); Image targetImage = GetQuantizedImage(sourceImage); Bitmap grayed = ToGrayscale(img); InitializeSolidBW(BWArray, grayed); Merge(SobelData, img); Sobel(SobelData, BWArray);
Learning and Development Process • Strategies • Extensions • Knowledge • Advice
Strategies • Cursory/Playful Exploration + recursive sweeps + averaging neighbors + color comparison THE BAD: + time effectiveness 1
2 openCV + Hough Transform
Sobel + Working Edge Detection + Noise Reduction Attempts (Median Cut) 3
Recursive Technique + Sobel THE BAD: + too many colors + still too much time 4
Exceptions • Global Variables* • BIG Files* • Color Leakage • Thickening Detected Edges • Post-Edge Noise Reduction • Already Low-Quality Images
Color Leakage + Color mixing when too few colors Possible Fixes: • Edge Detection First
Thickening Detected Edges Possible 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;
Post-Edge Noise Reduction Possible Fixes: • Noise Reduction Algorithms Noise Reduction
Already Low-Quality Images • The purpose of a color quantization!!!
Knowledge • Android (-_-) • C# (*) • Color Comparison • RGB • openCV • Hough Transform • Visual Basic • Sobel • Color Quantization • Median Cut
For Future Friends • Android • Real-Time Conversion (Video)
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 (ifof age)