v intersect

From DavinciWiki
Jump to: navigation, search

Description

Find the intersection of two v_objects. In other words find the places where the two v_objects overlap. The order of the inputs does not matter since the intersection will not change.

Arguments and Return Values

Arguments: Accepts two v_objects

Return Values: Returns a v_object (with no .data element) that is the size of the intersection

Usage

Syntax: v_intersect(img1 = STRUCT, img2 = STRUCT )

img1 - First v_object

img2 - Second v_object

Examples

dv> a
struct, 7 elements
   data: 500x300x1 array of byte, bsq format [150,000 bytes]
   h: 300
   lines: 0
   samples: 0
   w: 500
   x: 0
   y: 0
dv> b
struct, 7 elements
   data: 500x300x1 array of byte, bsq format [150,000 bytes]
   h: 300
   lines: 0
   samples: 0
   w: 500
   x: 250
   y: 150

dv> c=v_intersect(img1=a,img2=b)
struct, 4 elements
   x: 250
   y: 150
   w: 250
   h: 150

Optional usage where a new structure is created and stored in the variable c

dv> c=v_intersect(a,b)
struct, 4 elements
   x: 250
   y: 150
   w: 250
   h: 150

To illustrate the intersection, we will continue with the process to actually fill in the values.

dv> c=v_create(c,ignore=0)
struct, 5 elements
   x: 250
   y: 150
   w: 250
   h: 150
   data: 250x150x1 array of int, bsq format [150,000 bytes]
dv> v_insert(src=b,dst=c,ignore=0)
dv> v_insert(src=a,dst=c,ignore=0)

Images

v make1.png v make2.png v intersect.png

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

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

All other topics

  • See navigation on the left

Major Sub-Functions

Related Functions

Recent Library Changes

Created On: 02-20-2006
Modified On: 01-17-2008

Personal tools