Free Essay

Python Image Processing

In:

Submitted By rloftus23
Words 390
Pages 2
def Pixel_RGB(px): setColor(px, makeColor((getRed (px) / 128) * 255, \ (getGreen(px) / 128) * 255, \ (getBlue (px) / 128) * 255)) return

def Pixel_Negate(px): setColor(px, makeColor(255 - getRed (px), \ 255 - getGreen(px), \ 255 - getBlue (px))) return

def Pixel_Mono(px): Avg = (getRed(px)+ getGreen(px) + getBlue(px))/3 if Avg > 127: setColor (px, white) else: setColor (px,black) return

def Pixel_Gray (px): grayScale = (getRed(px) + getGreen(px) + getBlue(px)) setColor (px, makeColor(grayScale, grayScale, grayScale)) return

def Pixel_Inc_R(px): R = getRed(px) R = R + 20 setRed(px, R) return def Pixel_Dec_R(px): R = getRed(px) R = R - 20 setRed(px, R) return

def Pixel_Inc_G(px): G = getGreen(px) G = G + 20 setGreen(px,G) return def Pixel_Dec_G(px): G = getGreen(px) G = G - 20 setGreen(px,G) return

def Pixel_Inc_B(px): B = getBlue(px) B = B + 20 setBlue(px, B) return def Pixel_Dec_B(px): B = getBlue(px) B = B - 20 setBlue(px, B) return

def Pixel_Lighter(px): R = getRed(px) G = getGreen(px) B = getBlue(px) R = R + 20 G = G + 20 B = B + 20 setRed(px,R) setGreen(px,G) setBlue(px,B) return

def Pixel_Darker (px): R = getRed(px) G = getGreen(px) B = getBlue(px) R = R - 20 G = G - 20 B = B - 20 setRed(px,R) setGreen(px,G) setBlue(px,B) return

def Process(Canvas,FN): for Y in range(getHeight(Canvas)): for X in range(getWidth(Canvas)): FN(getPixel(Canvas,X,Y)) repaint(Canvas) return

def Main(): Message = """Enter a Command. O=Open, S=Save,
8=RGB, - = Negate, 2=Mono,
Q=Quit, "#"=Gray, >=Light, "): Process(Canvas,Pixel_Lighter) elif (Command == "

Similar Documents

Free Essay

Self-Driving Mobile Platform

...interesting because it’s not ’achieved’ even by the current state-of-the-art, there are still lots of works to be done. II. T HEORY will be very hard to distinguish between them and not useful for a long-term solution. Additionally we would encounter a major problem when defining the color and shape of a car. So instead we design an machine-learning algorithm which uses a similar approach like Google and Tesla does. By training our own classifier for each element in traffic signs, which requires most of the computation, it allows our mobile platform to detect traffic signs and differentiate between them. Once the parameters are available, we can computationally cheap detect our classified objects. The result of our very fast image processing allows us to integrate the method...

Words: 3460 - Pages: 14

Free Essay

Change Detection

...detection methods.5 I. Post-Classification Comparison..........................5 II. Direct Classification...................................6 III. Principal Component Analysis (PCA)......................6 IV. Image Differencing......................................8 V. Change Vector Analysis (CVA)............................9 Relative accuracy of the most commonly used change detection methods........................................................9 I. Post-Classification Comparison.........................10 II. Direct Classification..................................11 III. Principal Component Analysis (PCA).....................11 IV. Image Differencing.....................................12 V. Change Vector Analysis (CVA) Conclusion....................................................14 References....................................................15 Introduction Remote sensing change detection has been defined as the process of identifying change in the state of an object or phenomena through the detection of differences between two or more sets of images taken of the same area on different dates (Wang, 1993). The underlying assumption is that changes on the ground cause significant changes in image pixel values (Zhang et al., 2002). Change detection is a vital technique in remote sensing because it plays a role in monitoring and managing natural resources and urban development providing quantitative analysis of the spatial...

Words: 3616 - Pages: 15

Free Essay

Automatic Part Program Generation

...experts' knowledge about image processing techniques, and is capable of solving given vision problems. As a problem domain, we choose vision algorithms for a parts-feeder, which determines the attitude of mechanical parts on a conveyor-belt and rejects parts with inappropriate attitudes. The expert system for parts feeder is designed to consist of three components: FSE (Feature selection expert), IPE (Image processing expert), DTG (Decision tree generator). The knowledge for vision algorithm design to determine parts attitude is discussed. A framework to represent knowledge for finding solutions for pattern classificationproblem is established. 1. Introduction Recently, several expert systems for image processing have been investigated[1][2][3]. Their knowledge-basesinclude human experts' knowledge about image processing techniques, and can generate a sequence of image processing operations to solve the given problem. DIA-Expert system (Digital-Image-Analysis Expert System)[4] is a typical example. When an input image and the goal of analysis are given, it continues to decompose the goal into subgoals until the sequence of executable image processing modules could be found. Here, we apply this framework to the algorithm design for an industrial machine vision[5]. Machine vision systems for advanced automation must solve problems such as the discriminationor positioning of mechanical parts and the detection of their surface flaws. The contemporary image analysis and pattern recognition...

Words: 970 - Pages: 4

Free Essay

Segmentation

...Aim: To study methods of segmentation In computer vision, segmentation refers to the process of partitioning a digital image into multiple segments (sets of pixels, also known as super pixels). The goal of segmentation is to simplify and/or change the representation of an image into something that is more meaningful and easier to analyze. Image segmentation is typically used to locate objects and boundaries (lines, curves, etc.) in images. More precisely, image segmentation is the process of assigning a label to every pixel in an image such that pixels with the same label share certain visual characteristics. The result of image segmentation is a set of segments that collectively cover the entire image, or a set of contours extracted from the image (see edge detection). Each of the pixels in a region are similar with respect to some characteristic or computed property, such as color, intensity, or texture. Adjacent regions are significantly different with respect to the same characteristic(s). Some of the methods of segmentation are described as follows. Clustering methods The K-means algorithm is an iterative technique that is used to partition an image into K clusters. The basic algorithm is: Pick K cluster centers, either randomly or based on some heuristic Assign each pixel in the image to the cluster that minimizes the variance between the pixel and the cluster center Re-compute the cluster centers by averaging all of the pixels in the cluster Repeat steps 2 and 3 until...

Words: 586 - Pages: 3

Free Essay

Image Dithering

...Image Dithering Image and its parameters An image is a two-dimensional representation of a rectilinear array of pixels. A pixel is sample point in the image that has coordinates location it. These samples are obtained from the continuous function CCD cells in a camera, photoreceptors in the eye and rays in a virtual camera. There are three types of image resolution. The first resolution is where each pixel has only the depth bits for color or intensities. The second type of resolution is the spatial resolution which involves the width and the heights of the image only. Lastly, another image resolution is the temporal resolution, and this kind does the monitoring of the image brightness at a particular frequency only. Image dithering Dithering is the approximation of color from a mixture of several colors by the computer program when the desired color is not available. An example if dithering is the when a certain color in the Web page for a particular browser is not supported by the other. In that case, the browser will attempt to replace the desired color by approximating two colors that it can generate. The same may or may not be accepted by the designer of graphics and may appear grainy because it is composed of varied pixel intensities instead of one intensity. Dithering has applications in color image output and for artistic purposes as well. Secondly, dithering is used in web design for reducing images from high color counts to low color counts. It is also used in...

Words: 970 - Pages: 4

Free Essay

Fuzzy and Cla Based Edge Detection Method

...i CERTIFICATE ii COMPLIANCE CERTIFICATE iii THESIS APPROVAL CERTIFICATE iv DECLARATION OF ORIGINALITY v Acknowledgment vi Table of Contents vii List of Figures x Abstract xiii Chapter 1 Introduction 1 1.1 Edge Detection: Analysis 3 1.1.1 Fuzzy Logic in Image Processing 4 1.1.2 Fuzzy Logic for Edge Detection 5 1.1.3 Cellular Learning Automata 6 Chapter 2 Literature Review 7 2.1 Edge Detection: Methodology 7 2.1.1 First Order Derivative Edge Detection 7 2.1.1.1 Prewitts Operator 7 2.1.1.2 [pic] Sobel Operator 8 2.1.1.3 Roberts Cross Operator 11 2.1.1.4 Threshold Selection 11 2.1.2 Second Order Derivative Edge Detection 11 2.1.2.1 Marr-Hildreth Edge Detector 11 2.1.2.2 Canny Edge Detector 12 2.1.3 Soft Computing Approaches to Edge Detection 13 2.1.3.1 Fuzzy Based Approach 14 2.1.3.2 Genetic Algorithm Approach 14 2.1.4 Cellular Learning Automata 15 Chapter 3 Fuzzy Image Processing 18 3.1 Need for Fuzzy Image Processing 19 3.2 Introduction to Fuzzy sets and Crisp sets 20 3.2.1 Classical sets (Crisp sets) 20 3.2.2 Fuzzy sets 21 3.3 Fuzzification 22 3.4 Membership Value Assignment 22 3.5 Defuzzification 23 3.6 Enhancing Edges Using Cellular Learning Automata 26 3.6.1 Divide the Edgy Image Into Overlapping 3 × 3 Windows 26 3.6.2 Penalty and Rewards. 27 Chapter 4 Implementation 30 4.1 Simple algorithm for edge detection using Fuzzy Logic 30 Chapter 5 Conclusion 38 References 39 Appendix A : Acronyms 41 Appendix B : Review Card 42 Appendix C:...

Words: 9151 - Pages: 37

Free Essay

Gender Recognition

...Based Image Retrieval Using Extended Local Tetra Patterns Aasish Sipani1*, Phani Krishna2 and Sarath Chandra3 1*, 2, 3 Department of Computer Science and Engineering, National Institute of Technology, Warangal, India, aasishsipani@gmail.com, ppkk1992@gmail.com, chandra.3162@gmail.com www.ijcaonline.org Received: Oct/26/2014 Revised: Nov/09/2014 Accepted: Nov/20/2014 Published: Nov/30/2014 Abstract— In this modern world, finding the desired image from huge databases has been a vital problem. Content Based Image Retrieval is an efficient method to do this. Many texture based CBIR methods have been proposed so far for better and efficient image retrieval. We aim to give a better image retrieval method by extending the Local Tetra Patterns (LTrP) for CBIR using texture classification by using additional features like Moment Invariants and Color moments. These features give additional information about the color and rotational invariance. So an improvement in the efficiency of image retrieval using CBIR is expected. Keywords— Content Based Image Retrieval (CBIR), Local Tetra Patterns (LTrP), Gabor Filters, Histogram Equalization, Moment Invariants I. INTRODUCTION The explosive growth of digital libraries due to Web cameras, digital cameras, and mobile phones equipped with such devices is making the database management by human annotation an extremely tedious and clumsy task. Thus, there exists a need for developing an efficient approach to search for the desired images form...

Words: 3578 - Pages: 15

Free Essay

Stereo Acoustic Perception Based on Real Time Video Acquisition

...Shetty&, Chinmai$ , Rajeshwari Hegde@ #,*,&,, Department of Telecommunication Engineering, @ Guide and faculty BMS College of Engineering, Bangalore, India # supreethkrao@gmail.com arpithaprasad@gmail.com & anushree.shetty12@gmail.com $ cpchinmai@gmail.com * Abstract— A smart navigation system based on an object detection mechanism has been designed to detect the presence of obstacles that immediately impede the path, by means of real time video processing. This paper is discussed keeping in mind the navigation of the visually impaired. A video camera feeds images of the surroundings to a Da-Vinci Digital Media Processor, DM642, which works on the video, frame by frame. The processor carries out image processing techniques whose result contains information about the object in terms of image pixels. The algorithm aims to select that object, among all others, that poses maximum threat to the navigation. A database containing a total of three sounds is constructed. Hence, each image translates to a beep, where every beep informs the navigator of the obstacles directly in front of him. This paper implements a more efficient algorithm compared to its predecessor, NAVI. Keywords— Navigation, Edge Detection, Flood Function, Object Detection, DM642, Acoustic Transformation I. INTRODUCTION Assistance for the blind or visually impaired can range from simple measures, such as a white cane or a guide dog, to a very sophisticated computer technology...

Words: 2605 - Pages: 11

Premium Essay

Segmenting Brain Structures

...In the diagnosis and treatment of various diseases, often segmenting the brain structures from MRI data is the key step. Since there are larger variations in the anatomical structures of brain, segmentation becomes a crucial process. Using only the intensity information is not enough to segment structures since two or more structures may share the same tissues. Recently use of multiple pre-labeled images called atlases or templates are used in the process of segmentation of image data. Both single atlas and multiple atlases can be used. However, using multiple templates proves a dominant method in segmenting brain structures even for challenging structure variations and overlapping structures. In this paper, we propose two multi atlas segmentation...

Words: 966 - Pages: 4

Premium Essay

Thesis Copy

...WIRELESS FINGERPRINT BASED STUDENT ATTENDANCE SYSTEM A thesis submitted in partial fulfillment of the requirements for the degree of Bachelor of Technology in Electrical Engineering by Debidutt Acharya(10602015) and Arun Kumar Mishra(10602061) Under the guidance of Prof. Susmita Das Department of Electrical Engineering National Institute of Technology Rourkela-769008 2010 WIRELESS FINGERPRINT BASED STUDENT ATTENDANCE SYSTEM A thesis submitted in partial fulfillment of the requirements for the degree of Bachelor of Technology in Electrical Engineering by Debidutt Acharya(10602015) and Arun Kumar Mishra(10602061) Department of Electrical Engineering National Institute of Technology Rourkela-769008 2010 National Institute of Technology Rourkela CERTIFICATE This is to certify that the thesis entitled, “WIRELESS FINGERPRINT-BASED STUDENT ATTENDANCE SYSTEM” submitted by Debidutt Acharya and Arun Kumar Mishra in partial fulfilments for the requirements for the award of Bachelor of Technology Degree in Electrical Engineering at National Institute of Technology, Rourkela is an authentic work carried out by them under my supervision and guidance. To the best of my knowledge, the matter embodied in the thesis has not been submitted to any other University / Institute for the award of any Degree or Diploma. Date: 14-05-2010 Place: Rourkela Prof. Susmita Das Deptt. of Electrical Engineering National Institute of Technology ...

Words: 6449 - Pages: 26

Free Essay

Image

...Analysis of SVD based Image Fusion: A review xxxxxxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxx ABSTRACT: In this paper, we have reviewed different types of Image fusion techniques based on Singular Value Decomposition (SVD) technique. Basically, Image fusion can be described as a technique which is used to generate a single good quality image from one or more images. Image fusion can be applied at many levels viz. pixel level, feature level, signal level and decision level. Image fusion can be applied in many areas like recognition of patterns, to enhance visual features, detection of objects, area surveillance etc.[2] The techniques that are used mostly are Intensity-Hue-Saturation (IHS), high pass filtering, principal component analysis (PCA), different arithmetic combinations, multi resolution analysis based methods (pyramid algorithm and wavelet transform), Artificial Neural Networks(ANN), Singular Value Decomposition (SVD) etc.[4] Nowadays, SVD is becoming very popular technique for image fusion due to many factors like conceptuality, stability and it is also a robust and reliable orthogonal decomposition technique. A huge advantage of SVD is that it can also adjust the variations that are present in the local statistics of an image[2]. In this paper, we have compared and reviewed different types of modifications that can be added to the basic SVD technique. Keywords: Singular Value Decomposition, Tensors, Image fusion. 1. INTRODUCTION Fusion...

Words: 2109 - Pages: 9

Free Essay

Dsp Textbook

...Digital Image Processing Second Edition Rafael C. Gonzalez University of Tennessee Richard E. Woods MedData Interactive Prentice Hall Upper Saddle River, New Jersey 07458 Library of Congress Cataloging-in-Pubblication Data Gonzalez, Rafael C. Digital Image Processing / Richard E. Woods p. cm. Includes bibliographical references ISBN 0-201-18075-8 1. Digital Imaging. 2. Digital Techniques. I. Title. TA1632.G66 621.3—dc21 2001 2001035846 CIP Vice-President and Editorial Director, ECS: Marcia J. Horton Publisher: Tom Robbins Associate Editor: Alice Dworkin Editorial Assistant: Jody McDonnell Vice President and Director of Production and Manufacturing, ESM: David W. Riccardi Executive Managing Editor: Vince O’Brien Managing Editor: David A. George Production Editor: Rose Kernan Composition: Prepare, Inc. Director of Creative Services: Paul Belfanti Creative Director: Carole Anson Art Director and Cover Designer: Heather Scott Art Editor: Greg Dulles Manufacturing Manager: Trudy Pisciotti Manufacturing Buyer: Lisa McDowell Senior Marketing Manager: Jennie Burger © 2002 by Prentice-Hall, Inc. Upper Saddle River, New Jersey 07458 All rights reserved. No part of this book may be reproduced, in any form or by any means, without permission in writing from the publisher. The author and publisher of this book have used their best efforts in preparing this book. These efforts include the development, research, and testing of the theories and programs to determine their effectiveness...

Words: 66542 - Pages: 267

Free Essay

Video Segmentation

...Digital Media Computing Assignment 1: Video Segmentation ------------------------------------------------- HAND IN DATE: 31st October 2010 WEIGHTAGE: 25 Marks ------------------------------------------------- Student Name Name | Student ID | Robert Johnson | 102122913 | Table of Contents User Guide 2 Video Selection 2 Video Playback and Segmentation Execution 2 First Implementation 2 Second Implementation 3 Third Implementation 4 First Implementation 6 Part A: 50% Split 6 Part B: Custom User Percentile 7 Second Implementation 7 Part A: Uniform N-Splits 7 Part B: Histogram Equalization 8 Part C: Average Frames 8 Third Implementation 9 Order of processing 10 Problems Encountered 10 User Guide All three implementations can be accessed by opening the index.html page. The implementations have been tested to be work on Firefox 15 with any resolution above 1024x768. Due to the extensive use of HTML5 canvas, several legacy browsers may not be able to run the web page successfully. Video Selection Once the page has been loaded, the user has an option to select from 3 different videos. Two of which are stored locally. Please ensure to place both file ‘tracker.ogg’ and ‘video.ogg’ in the same folder as the index page. The user can click on either button 1, 2, or 3 to swap between different videos to experiment on. The video can be seen when user clicks on the play/pause button. Video Playback and Segmentation Execution It is important...

Words: 3318 - Pages: 14

Free Essay

Image Processing

...INTRODUCTION The term image refer to two dimensional light intensity function f(x, y), where x and y denote spatial coordinates and the value of at any point (x, y) is proportional to the brightness (or gray level) of the image at that point. A digital image is an image f(x, y) that has been discretized both in spatial coordinate and brightness. A digital image can be considered a matrix whose row and column indices identify a point in the image and the corresponding matrix element value identifies the gray level at that point. The elements of such a digital array are called image elements, picture elements. The term digital image processing refers to processing of a two dimensional picture by a digital computer. An image given in the form of a transparency, slide, photograph or chart is first digitized and stored as matrix of binary digits in computer memory. This digitized image can be processed and/or displayed on a high resolution monitor. Segmentation subdivides an image into its constituent regions or objects .The level to which the segmentation is carried depends on the problem being solved. Segmentation is carried until we are able to distinguish the object from its backgrounds. Image segmentation is based on one of the two basic properties of intensity values: discontinuity and similarity. Thresholding is a similarity approach of segmenting an image. The simplest thresholding technique is to partition the image histogram by...

Words: 560 - Pages: 3

Premium Essay

Firefly Algorithm Analysis

...The goal of speech signal enhancement is to improve the quality of speech is degraded by the noises. Speech enhancement [1] aims to improve the performance of speech communication systems from the noise speech. Mostly speech signal enhancement applications in the areas of speech recognition and speaker identification systems. Speech signal enhancement applied in mobile radio communications, speech to text converting systems, low quality recordings, speech recognition systems, and to improve the performance of hearing. It is a classical problem of signal processing. Speech enhancement is depends on background noise and environmental conditions. If the background noise present in the signal it is very difficult to hearing. Generally we require a signal to noise ratio of about 5-10dB higher than normal hearing listener to achieve the same level understanding the speech signals. Therefore, multi microphones and signals noise reduction strategies have been developed for modern hearing systems. The enhancement of desired speech signal in the presence of stationary noise [11] using an array of microphones has been examined for many years. Algorithms for speech signal enhancement used for different applications like mobile phones, hand free devices etc. mostly used systems for SE to achieve a suppression...

Words: 887 - Pages: 4