"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libvips/mosaicing/chkpair.c" between
vips-8.10.6.tar.gz and vips-8.11.0.tar.gz

About: VIPS is a free image processing system (see also the GUI nip2).

chkpair.c  (vips-8.10.6):chkpair.c  (vips-8.11.0)
skipping to change at line 100 skipping to change at line 100
* Returns: 0 on success, -1 on error * Returns: 0 on success, -1 on error
*/ */
int int
vips__correl( VipsImage *ref, VipsImage *sec, vips__correl( VipsImage *ref, VipsImage *sec,
int xref, int yref, int xsec, int ysec, int xref, int yref, int xsec, int ysec,
int hwindowsize, int hsearchsize, int hwindowsize, int hsearchsize,
double *correlation, int *x, int *y ) double *correlation, int *x, int *y )
{ {
VipsImage *surface = vips_image_new(); VipsImage *surface = vips_image_new();
VipsImage **t = (VipsImage **) VipsImage **t = (VipsImage **)
vips_object_local_array( VIPS_OBJECT( surface ), 4 ); vips_object_local_array( VIPS_OBJECT( surface ), 5 );
VipsRect refr, secr; VipsRect refr, secr;
VipsRect winr, srhr; VipsRect winr, srhr;
VipsRect wincr, srhcr; VipsRect wincr, srhcr;
/* Find position of window and search area, and clip against image /* Find position of window and search area, and clip against image
* size. * size.
*/ */
refr.left = 0; refr.left = 0;
refr.top = 0; refr.top = 0;
skipping to change at line 140 skipping to change at line 140
*/ */
if( vips_extract_area( ref, &t[0], if( vips_extract_area( ref, &t[0],
wincr.left, wincr.top, wincr.width, wincr.height, wincr.left, wincr.top, wincr.width, wincr.height,
NULL ) || NULL ) ||
vips_extract_area( sec, &t[1], vips_extract_area( sec, &t[1],
srhcr.left, srhcr.top, srhcr.width, srhcr.height, srhcr.left, srhcr.top, srhcr.width, srhcr.height,
NULL ) ) { NULL ) ) {
g_object_unref( surface ); g_object_unref( surface );
return( -1 ); return( -1 );
} }
ref = t[0];
sec = t[1];
/* Make sure we have just one band. From vips_*mosaic() we will, but /* Make sure we have just one band. From vips_*mosaic() we will, but
* from vips_match() etc. we may not. * from vips_match() etc. we may not.
*/ */
if( t[0]->Bands != 1 ) { if( ref->Bands != 1 ) {
if( vips_extract_band( t[0], &t[2], 0, NULL ) ) { if( vips_extract_band( ref, &t[2], 0, NULL ) ) {
g_object_unref( surface ); g_object_unref( surface );
return( -1 ); return( -1 );
} }
t[0] = t[2]; ref = t[2];
} }
if( t[1]->Bands != 1 ) { if( sec->Bands != 1 ) {
if( vips_extract_band( t[1], &t[3], 0, NULL ) ) { if( vips_extract_band( sec, &t[3], 0, NULL ) ) {
g_object_unref( surface ); g_object_unref( surface );
return( -1 ); return( -1 );
} }
t[1] = t[3]; sec = t[3];
} }
/* Search! /* Search!
*/ */
if( vips_spcor( t[1], t[0], &surface, NULL ) ) { if( vips_spcor( sec, ref, &t[4], NULL ) ) {
g_object_unref( surface ); g_object_unref( surface );
return( -1 ); return( -1 );
} }
/* Find maximum of correlation surface. /* Find maximum of correlation surface.
*/ */
if( vips_max( surface, correlation, "x", x, "y", y, NULL ) ) { if( vips_max( t[4], correlation, "x", x, "y", y, NULL ) ) {
g_object_unref( surface ); g_object_unref( surface );
return( -1 ); return( -1 );
} }
g_object_unref( surface ); g_object_unref( surface );
/* Translate back to position within sec. /* Translate back to position within sec.
*/ */
*x += srhcr.left; *x += srhcr.left;
*y += srhcr.top; *y += srhcr.top;
 End of changes. 8 change blocks. 
9 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)