SIPL: Simple Image Processing Language

Similar documents
SIPL: Simple Image Processing Language

JME Language Reference Manual

PieNum Language Reference Manual

DINO. Language Reference Manual. Author: Manu Jain

SFPL Reference Manual

Typescript on LLVM Language Reference Manual

MATLIP: MATLAB-Like Language for Image Processing

Photogram. Programmable Photoshop Language Language Reference Manual. ( ), Group Leader. (

Ordinary Differential Equation Solver Language (ODESL) Reference Manual

Mirage. Language Reference Manual. Image drawn using Mirage 1.1. Columbia University COMS W4115 Programming Languages and Translators Fall 2006

MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL. John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards

CMAT Language - Language Reference Manual COMS 4115

CLIP - A Crytographic Language with Irritating Parentheses

easel LANGUAGE REFERENCE MANUAL

The pixelman Language Reference Manual. Anthony Chan, Teresa Choe, Gabriel Kramer-Garcia, Brian Tsau

d-file Language Reference Manual

Angela Z: A Language that facilitate the Matrix wise operations Language Reference Manual

The Warhol Language Reference Manual

MR Language Reference Manual. Siyang Dai (sd2694) Jinxiong Tan (jt2649) Zhi Zhang (zz2219) Zeyang Yu (zy2156) Shuai Yuan (sy2420)

GBIL: Generic Binary Instrumentation Language. Language Reference Manual. By: Andrew Calvano. COMS W4115 Fall 2015 CVN

ASML Language Reference Manual

Twister: Language Reference Manual

Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language

GraphQuil Language Reference Manual COMS W4115

Lexical Considerations

Standard 11. Lesson 9. Introduction to C++( Up to Operators) 2. List any two benefits of learning C++?(Any two points)

COMS W4115 Programming Languages & Translators FALL2008. Reference Manual. VideO Processing Language (VOPL) Oct.19 th, 2008

Language Reference Manual

More on Images and Matlab

M/s. Managing distributed workloads. Language Reference Manual. Miranda Li (mjl2206) Benjamin Hanser (bwh2124) Mengdi Lin (ml3567)

1 Lexical Considerations

Sprite an animation manipulation language Language Reference Manual

Contents. Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual

UNIT- 3 Introduction to C++

FotoScript: The Language Reference Manual

Language Design COMS W4115. Prof. Stephen A. Edwards Spring 2003 Columbia University Department of Computer Science

Spoke. Language Reference Manual* CS4118 PROGRAMMING LANGUAGES AND TRANSLATORS. William Yang Wang, Chia-che Tsai, Zhou Yu, Xin Chen 2010/11/03

Programming Languages & Translators. XML Document Manipulation Language (XDML) Language Reference Manual

Onion Language Reference Manual. By: Andrew Aday, (aza2112) Amol Kapoor (ajk2227), Jonathan Zhang (jz2814)

Objectives. Chapter 2: Basic Elements of C++ Introduction. Objectives (cont d.) A C++ Program (cont d.) A C++ Program

Lecture 2 Tao Wang 1

Chapter 2: Basic Elements of C++

Chapter 2: Basic Elements of C++ Objectives. Objectives (cont d.) A C++ Program. Introduction

L-System Fractal Generator: Language Reference Manual

DaMPL. Language Reference Manual. Henrique Grando

Language Reference Manual simplicity

Transform Introduction page 96 Spatial Transforms page 97

Example 1: Color-to-Grayscale Image Processing

SMURF Language Reference Manual Serial MUsic Represented as Functions

Lexical Considerations

Chapter 2. Lexical Elements & Operators

EZ- ASCII: Language Reference Manual

corgi Language Reference Manual COMS W4115

Data Types, Variables and Arrays. OOC 4 th Sem, B Div Prof. Mouna M. Naravani

MELODY. Language Reference Manual. Music Programming Language

Creating a C++ Program

The SPL Programming Language Reference Manual

pixelman Pixel Manipulation Language Anthony Chan tc2665 Teresa Choe tc2716 Gabriel Lucas Kramer-Garcia glk2110 Brian Tsau bt2420

Chapter 2 Basic Elements of C++

ChartLan A Language for Chart COMS W4115 PLT project proposal Professor: Stephen A. Edwards

Course Outline Introduction to C-Programming

YOLOP Language Reference Manual

McGill University School of Computer Science COMP-202A Introduction to Computing 1

9/5/2018. Overview. The C Programming Language. Transitioning to C from Python. Why C? Hello, world! Programming in C

BASIC ELEMENTS OF A COMPUTER PROGRAM

c) Comments do not cause any machine language object code to be generated. d) Lengthy comments can cause poor execution-time performance.

Chapter 4. Operations on Data

Transforming Objects in Inkscape Transform Menu. Move

GAWK Language Reference Manual

Le L c e t c ur u e e 2 To T p o i p c i s c t o o b e b e co c v o e v r e ed e Variables Operators

The C Programming Language. (with material from Dr. Bin Ren, William & Mary Computer Science)

These are reserved words of the C language. For example int, float, if, else, for, while etc.

Senet. Language Reference Manual. 26 th October Lilia Nikolova Maxim Sigalov Dhruvkumar Motwani Srihari Sridhar Richard Muñoz

MATLAB. Devon Cormack and James Staley

Full file at

MATLAB for Image Processing

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal

Operators. Java operators are classified into three categories:

GOLD Language Reference Manual

ME 461 C review Session Fall 2009 S. Keres

Triangle Manipulation Language TrML Language Reference Manual

UNIT - I. Introduction to C Programming. BY A. Vijay Bharath

Chapter 2: Introduction to C++

VENTURE. Section 1. Lexical Elements. 1.1 Identifiers. 1.2 Keywords. 1.3 Literals

Chapter 2: Special Characters. Parts of a C++ Program. Introduction to C++ Displays output on the computer screen

Fundamental of Programming (C)

PYTHON- AN INNOVATION

Full file at C How to Program, 6/e Multiple Choice Test Bank

CS113: Lecture 3. Topics: Variables. Data types. Arithmetic and Bitwise Operators. Order of Evaluation

egrapher Language Reference Manual

Basics of Java Programming

CSC Web Programming. Introduction to JavaScript

4. Inputting data or messages to a function is called passing data to the function.

BoredGames Language Reference Manual A Language for Board Games. Brandon Kessler (bpk2107) and Kristen Wise (kew2132)

Program Fundamentals

Basic Types, Variables, Literals, Constants

Objectives. In this chapter, you will:

SFU CMPT 361 Computer Graphics Fall 2017 Assignment 2. Assignment due Thursday, October 19, 11:59pm

Language Reference Manual

VLC : Language Reference Manual

Transcription:

2017 Fall COMS 4115 PLT Language Reference Manual SIPL: Simple Image Processing Language Simon Zhai, Ci Chen, Shanshan Zhang, Yihan Zhao, Yuedong Wang {yz3116, cc4192, sz2648, yz2996, yw2931}@columbia.edu 1

Contents 1 Introduction 3 2 Lexical Conventions 3 2.1 Tokens........................................ 3 2.2 Comments...................................... 3 2.3 Keywords...................................... 3 2.4 Identifiers...................................... 3 2.5 Constants...................................... 3 2.5.1 Numeric constants............................. 3 3 Meaning of Identifiers 4 3.1 Data Types..................................... 4 3.1.1 Basic Types................................. 4 3.1.2 Built-in Types............................... 4 4 Object and Definition 4 5 Expressions 4 5.1 Primary Expression................................ 4 5.1.1 Identifier.................................. 4 5.1.2 constant................................... 4 5.1.3 (expr).................................... 4 5.2 Object Creation Expression............................ 4 5.2.1 [expr].................................... 4 6 Operators 5 6.1 Assignment Operators: =............................ 5 6.2 Arithmetic Operatos: +, -, *, /..................... 5 6.3 Matrix Operators:.+,.-,.*........................ 5 6.4 Relational Operators: >, <, >=, <=, ==............... 5 7 Statements 5 7.1 Control Flow Statements.............................. 5 7.1.1 Loop..................................... 5 8 Build-in Functions 5 8.1 Gray Conversion.................................. 5 8.2 Image Rotation................................... 5 8.3 Image Flipping................................... 6 8.4 Matrix Construction................................ 6 8.5 Image Filtering................................... 6 8.6 RGB Channelling.................................. 6 8.7 Image Resizing................................... 6 9 Sample Code 6 10 References 6 2

1 Introduction The SIPL language is a linear algebra manipulation language specially targeted for image processing. It uses an efficient way to express complex image manipulation algorithms to complete matrix operations. 2 Lexical Conventions 2.1 Tokens There are five kinds of tokens in SIPL: Keywords, identifiers, constants, control characters and operators. Blanks, tabs, newlines and comments are ignored except that they serve to separate tokens. 2.2 Comments The characters /* introduces a comments which terminates with */. 2.3 Keywords The reserved keywords in SIPL are: 2.4 Identifiers Boolean False Float Kernel Int Matrix True Uint8 Identifiers are composed of a lower or upper-case letter immediately followed by any number of additional letters and/or digits. Identifiers are case sensitive, Simon and simon are different identifiers. Keywords and underscores are not allowed to be identifiers. 2.5 Constants 2.5.1 Numeric constants Integers are represented by a series of number characters. Floats are represented by a series of number character with an optional period character, followed by a lower case f. 3

3 Meaning of Identifiers 3.1 Data Types 3.1.1 Basic Types Int: 32 bit integer Uint8: 8 bit unsigned integer Float: 32 bit real number Boolean: A constants with either True or False 3.1.2 Built-in Types Matrix: n m size of Unit8 matrix. We use one matrix to represent gray images and an array of three matrices to represent colored images. 4 Object and Definition An object in SIPL is either an array of matrices or one single matrix. Each colored image consists of three matrices, each matrix represents a channel(red Green Blue) while each gray image consists of one matrix. 5 Expressions 5.1 Primary Expression 5.1.1 Identifier An Identifier is a primary expression 5.1.2 constant An integer or a floating number is a primary expression 5.1.3 (expr) An expression that is parenthesized is a primary expression, with the same type of original expression. 5.2 Object Creation Expression 5.2.1 [expr] An expression that is bracketed is an object creation expression, it will create a matrix. We use, to separate different elements in one row, and ; to separate different rows. 4

6 Operators 6.1 Assignment Operators: = Assign the value of right to the left, even if it is a matrix, the data would be copied by value. So the space should be pre-allocated. 6.2 Arithmetic Operatos: +, -, *, / Use between Int, Float or Unit8. It will group from left to right, * and / have higher priority than + and -. 6.3 Matrix Operators:.+,.-,.* The two matrix should have the same shape, the output matrix would have the same shape with the imput matrix..+ : Add the two elements in the same position..- : Minus the two elements in the same position..* : Multiply the two elemtns in the same position. 6.4 Relational Operators: >, <, >=, <=, == The value of right expression and left expression should be Int of Float or Uint8. 7 Statements 7.1 Control Flow Statements 7.1.1 Loop While will execute a block that defined by user, if a specific expression is True. while(expr){ Statement } 8 Build-in Functions 8.1 Gray Conversion img.gray := grayimg(img) Change colored image into gray image. 8.2 Image Rotation rotatedimg = rotateimg(img, n) Counter-clockwise rotate an image by ± π 2 (n = 1 for π 2, n = 1 for π 2, otherwise cast an error) 5

8.3 Image Flipping flippedimg = flipimg(img, n) Flip an image(n = 1 for horizontal flip and n = 1 for vertical flip, otherwise cast an error). 8.4 Matrix Construction Use Kernel to construct a matrix 8.5 Image Filtering filteredimage = convimg(img, kernel) Convolve a specific kernel with an image, different kernels will have different convolutions. 8.6 RGB Channelling Get one of the channel from a colored image(red, blue or green), return a matrix. 8.7 Image Resizing resizedimage = resizeimg(img, width, height) Resize the original image, get an image with different width and height. The shape can be changed. 9 Sample Code Img = readimg( img1.png ) /* import an image for operation*/ Img = rotateimg(img, 1) /* rotate this image*/ Img = img + 2; /* enhance the brightness of the rotated image.*/ Matrix kernel = Kernel(1,2) /* create a gaussian kernel*/ Img = convimg(img, kernel) /* we convolve the image using gaussian kernel, which will blur the image.*/ showimg(img) /* check the modified img*/ writeimg(img, /MyDirectory/modified image.png ) /* save the modified image into a directory named modified image.png */ 10 References 1. B. W. Kernighan and D. Ritchie. The C Programming Language 2. Dennis M. Ritchie. C Reference Manual 6