stitch
Top  Previous  Next

stitch ( integer Input1, integer Input2, integer Output, integer Direction, integer Depth integer Width,
integer WinDepth, integer WinWidht, integer WinDepth, integer Step )

Use this function to perform the stitching of two images containing overlapping areas. Image stitching is typically used to generate a large seamless image from a number of smaller images, each representing a portion of the whole field of view.

Parameters
 
Input1  
 
An integer between 0 and 116 specifying the image to which the second image will be attached. A value of 0 represents the DMA memory buffer of the video device. Values in the range of 100-116 correspond to hidden frames.  
 
Input2  
 
An integer between 0 and 116 specifying the image to be attached. A value of 0 represents the DMA memory buffer of the video device. Values in the range of 100-116 correspond to hidden frames.  
 
 
Output  
 
An integer between 1 and 116 specifying the resulting image. Values in the range of 100-116 correspond to hidden frames.  
 
 
Direction  
 
An enumerated integer specifying the direction of stitching. Must be one of the following values:  
 
STCH_RIGHT=0 - Image2 will be attached to the right edge of Image1.  
STCH_DOWN=0 - Image2 will be attached to the bottom edge of Image1.  
STCH_LEFT=0 - Image2 will be attached to the left edge of Image1.  
STCH_UP=0 - Image2 will be attached to the top edge of Image1.  
 
 
Depth  
 
An integer specifying the depth of search of correlated patterns at the stitching edge of both images. The larger this parameter is, the more overlapping of both images is assumed.  
 
 
Shift  
 
An integer specifying the distance of search of correlated patterns in the direction parallel to the stitching edge. The larger this parameter is, the bigger shift between two images is allowed.  
 
 
WinDepth  
 
An integer specifying the depth of the window used in the correlation procedure. Increasing this parameter will increase the precision of stitching, but the execution will take longer.  
 
 
WinWidth  
 
An integer specifying the width of the window used in the correlation procedure. Increasing this parameter will increase the precision of stitching, but the execution will take longer.  
 
 
Step  
 
An integer specifying the scanning step for the correlation window. Increasing this parameter will increase the speed of stitching, but decrease the precision.  
 
 

Error flags

ERR_OK  
 
The flag set if successful.  
 
ERR_FAILED  
 
The flag set if failed.  

Example

This set of statements breaks a sample image into four overlapping fields and then attempts to restore the original image by applying three stitching operators:  
 
setCurDir("samples")  
loadIm(1,"sample8.iwd")  
setSelect(1,SH_RECT,SEL_NEW,38,9,800,640)  
duplicate(1,2)  
setSelect(1,SH_RECT,SEL_NEW,718,29,1454,639)  
duplicate(1,3)  
setSelect(1,SH_RECT,SEL_NEW,10,507,786,1159)  
duplicate(1,4)  
setSelect(1,SH_RECT,SEL_NEW,702,513,1464,1153)  
duplicate(1,5)  
stitch(2,3,6,STCH_RIGHT,70,30)  
stitch(4,5,7,STCH_RIGHT,70,30)  
stitch(6,7,8,STCH_DOWN,120,50)