pnm mod.cut

From DavinciWiki
Jump to: navigation, search


Description

Cuts a specific part of an array.

Located in "pnm_mod" module.

Arguments and Return Values

Inputs: a Val (byte or other), upper left position (in pixels) and the width/height of the cut

Outputs: a Val that has been cut to the specified size

Usage

Syntax: pnm_mod.cut(data = VAL, left = INT, top = INT, width = INT, height = INT)

data:     any davinci array (most likely  a  byte image array)
letf:     is the leftmost column (negative  implies from right)
top:      is the topmost row (negative  implies from bottom)
width:    is the number of columns in the  output.
height:   is the number of rows in the  output.

Examples

dv> a=read("http://davinci.asu.edu/images/d/df/llama_face.jpg")
Downloading.done.
...................................................
/tmp/dv_7970/wLeknE:   bip JPEG image: 640x530x3, 8 bits
640x530x3  array of byte, bip format [1,017,600 bytes]

dv>  b=pnm_mod.cut(a,50,100,300,250)
Left:     50     Top:      100    Width:    300    Height:   250
300x250x3  array of byte, bip format [225,000 bytes]

dv>  display(a)
Writing /tmp/dv_7970/FbjH1F: 640x530x3 PNG  file.
dv> display(b)
Writing  /tmp/dv_7970/etLUcX: 300x250x3 PNG file.

Images

llama face.jpg llama face cut.jpg

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Recent Core Changes

Modified On: 02-26-2010

Personal tools