pnm mod.crop
Contents: Description, Arguments, Usage, Examples, Images, Related Functions Supported Under Version: > 1.69 Current Davinci Version: 2.27 64-bit Safe: No
Description Automatically crops the blackspace out of an image. Located in "pnm_mod" module.
Arguments and Return Values Inputs: a Val (byte or other) and the sides desired to be manipulated Outputs: a Val that has had the blackspace removed on the sides specified
Usage Syntax: pnm_mod.cut(data = VAL, left = BOOL, right = BOOL, top = BOOL, bottom = BOOL) data: any davinci array (most likely a byte image array) left: 1 to crop this side; 0 to leave it alone (default is 0) right: 1 to crop this side; 0 to leave it alone (default is 0) top: 1 to crop this side; 0 to leave it alone (default is 0) bottom: 1 to crop this side; 0 to leave it alone (default is 0) NOTE: the color of the blackspace is automatically determined by simple image analysis
Examples dv> a=read("http://davinci.asu.edu/images/d/df/llama_face.jpg") Downloading..done. ................................................................ /tmp/dv_7970/2THFJ3: bip JPEG image: 640x530x3, 8 bits 640x530x3 array of byte, bip format [1,017,600 bytes] dv> b=pnm_mod.pad(a,0,70,30,150,20) 740x700x3 array of byte, bip format [1,554,000 bytes] dv> c=pnm_mod.crop(b,1,0,1,1) 669x529x3 array of byte, bip format [1,061,703 bytes] dv> display(a) Writing /tmp/dv_7970/p4ScRL: 640x530x3 PNG file. dv> display(b) Writing /tmp/dv_7970/zagRah: 740x700x3 PNG file. dv> display(c) Writing /tmp/dv_7970/AbO3Hp: 669x529x3 PNG file.
|
DavinciWiki Mini-Nav Bar Contents
Contact Developers
All other topics
Related Functions
Recent Core Changes Modified On: 02-26-2010 |