v union

From DavinciWiki
Jump to: navigation, search

Description

Find the union of two v_objects. In other words find the places where both of the v_objects exist. The order of the inputs does not matter since the union 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_union(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_union(img1=a,img2=b)
struct, 4 elements
   x: 0
   y: 0
   w: 750
   h: 450

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

dv> c=v_intersect(a,b)
struct, 4 elements
   x: 0
   y: 0
   w: 750
   h: 450

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: 0
   y: 0
   w: 750
   h: 450
   data: 750x450x1 array of int, bsq format [1,350,000 bytes]

dv> v_insert(src=b,dst=c,ignore=0)
dv> v_insert(src=a,dst=c,ignore=0)

This process is very similar to what v_paste does and yeilds the same results.

Images

v make1.png v make2.png v union.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

Recent Library Changes

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

Personal tools