pnm mod.cut
From DavinciWiki
Contents: Description, Arguments, Usage, Examples, Images, Related Functions Supported Under Version: > 1.69 Current Davinci Version: 2.27 64-bit Safe: No
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.
|
DavinciWiki Mini-Nav Bar Contents
Contact Developers
All other topics
Related Functions
Recent Core Changes Modified On: 02-26-2010 |