Ejemplo n.º 1
0
/* 1st order tb mosaic.
 */
int
im_tbmosaic1( IMAGE *ref, IMAGE *sec, IMAGE *out,
	int bandno,
	int xr1, int yr1, int xs1, int ys1, 
	int xr2, int yr2, int xs2, int ys2,
	int halfcorrelation, int halfarea,
	int balancetype,
	int mwidth )
{ 
	return( rotjoin_search( ref, sec, out, im__tbmerge1,
		bandno,
		xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2,
		halfcorrelation, halfarea, balancetype, mwidth ) );
}
Ejemplo n.º 2
0
/**
 * im_tbmosaic1:
 * @ref: reference image
 * @sec: secondary image
 * @out: output image
 * @bandno: band to search for features
 * @xr1: first reference tie-point
 * @yr1: first reference tie-point
 * @xs1: first secondary tie-point
 * @ys1: first secondary tie-point
 * @xr2: second reference tie-point
 * @yr2: second reference tie-point
 * @xs2: second secondary tie-point
 * @ys2: second secondary tie-point
 * @hwindowsize: half window size
 * @hsearchsize: half search size 
 * @balancetype: no longer used
 * @mwidth: maximum blend width
 *
 * This operation joins two images top-bottom (with @ref on the top) 
 * given an approximate pair of tie-points. @sec is scaled and rotated as
 * necessary before the join.
 *
 * Before performing the transformation, the  tie-points are improved by 
 * searching band @bandno in an area of @sec of size @hsearchsize for a
 * match of size @hwindowsize to @ref. 
 *
 * @mwidth limits  the  maximum height of the
 * blend area.  A value of "-1" means "unlimited". The two images are blended 
 * with a raised cosine. 
 *
 * Pixels with all bands equal to zero are "transparent", that
 * is, zero pixels in the overlap area do not  contribute  to  the  merge.
 * This makes it possible to join non-rectangular images.
 *
 * If the number of bands differs, one of the images 
 * must have one band. In this case, an n-band image is formed from the 
 * one-band image by joining n copies of the one-band image together, and then
 * the two n-band images are operated upon.
 *
 * The two input images are cast up to the smallest common type (see table 
 * Smallest common format in 
 * <link linkend="VIPS-arithmetic">arithmetic</link>).
 *
 * See also: im_lrmosaic1(), im_tbmerge(), im_insert(), im_global_balance().
 *
 * Returns: 0 on success, -1 on error
 */
int
im_tbmosaic1( IMAGE *ref, IMAGE *sec, IMAGE *out,
	int bandno,
	int xr1, int yr1, int xs1, int ys1, 
	int xr2, int yr2, int xs2, int ys2,
	int hwindowsize, int hsearchsize,
	int balancetype,
	int mwidth )
{ 
	return( rotjoin_search( ref, sec, out, im__tbmerge1,
		bandno,
		xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2,
		hwindowsize, hsearchsize, balancetype, mwidth ) );
}
Ejemplo n.º 3
0
static int
vips_mosaic1_build( VipsObject *object )
{
	VipsMosaic1 *mosaic1 = (VipsMosaic1 *) object;

	joinfn jfn;

	g_object_set( mosaic1, "out", vips_image_new(), NULL ); 

	if( VIPS_OBJECT_CLASS( vips_mosaic1_parent_class )->build( object ) )
		return( -1 );

	if( !mosaic1->interpolate )
		mosaic1->interpolate = vips_interpolate_new( "bilinear" );

	jfn = mosaic1->direction == VIPS_DIRECTION_HORIZONTAL ?
		im__lrmerge1 : im__tbmerge1;

	if( mosaic1->search ) {
		if( rotjoin_search( mosaic1->ref, mosaic1->sec, mosaic1->out, 
			jfn,
			mosaic1->bandno,
			mosaic1->xr1, mosaic1->yr1, mosaic1->xs1, mosaic1->ys1, 
			mosaic1->xr2, mosaic1->yr2, mosaic1->xs2, mosaic1->ys2,
			mosaic1->hwindow, mosaic1->harea, 
			0,
			mosaic1->mblend ) )
			return( -1 );
	}
	else {
		if( rotjoin( mosaic1->ref, mosaic1->sec, mosaic1->out, 
			jfn,
			mosaic1->xr1, mosaic1->yr1, mosaic1->xs1, mosaic1->ys1, 
			mosaic1->xr2, mosaic1->yr2, mosaic1->xs2, mosaic1->ys2,
			mosaic1->mblend ) )
			return( -1 );
	}

	return( 0 );
}