Commit 3205d96c authored by Julien Michel's avatar Julien Michel

MRG

parents 39965ffb 0f687c44
......@@ -34,7 +34,7 @@
// Software Guide : BeginLatex
//
// This example demonstrates the use of the \doxygen{otb}{NCCRegistrationFilter}. This filter performs deformation estimation
// by optimising a PDE based on correlation. This use the finite difference solver hierarchy.
// by optimising a PDE based on the normalized correlation coefficient. It uses the finite difference solver hierarchy.
//
// The first step toward the use of these filters is to include the proper header files.
//
......@@ -107,8 +107,9 @@ int main(int argc, char** argv )
// Software Guide : BeginLatex
//
// To make the correlation possible and to avoid some local minima the first required step is
// to blur the input images. This is done using the \doxygen{itk}{RecursiveGaussianImageFilter}:
// To make the correlation estimation more robust, the first
// required step is to blur the input images. This is done using the
// \doxygen{itk}{RecursiveGaussianImageFilter}:
//
// Software Guide : EndLatex
......@@ -151,7 +152,7 @@ int main(int argc, char** argv )
// Software Guide : BeginLatex
//
// Few parameters need to be specified to the NCCRegistrationFilter:
// Some parameters need to be specified to the NCCRegistrationFilter:
// \begin{itemize}
// \item The area where the search is performed. This area is defined by its radius:
//
......@@ -172,7 +173,7 @@ int main(int argc, char** argv )
// Software Guide : BeginLatex
//
// \item The number of iteration for the PDE resolution:
// \item The number of iterations for the PDE resolution:
//
// Software Guide : EndLatex
......@@ -184,9 +185,11 @@ int main(int argc, char** argv )
// Software Guide : BeginLatex
//
// \end{itemize}
// The execution of the NCCRegistrationFilter will be triggered by the \code{Update()}
// call on the writer at the end of the pipeline. Make sure to use a
// \doxygen{otb}{StreamingImageFileWriter} if you want to benefit from the streaming features.
// The execution of the NCCRegistrationFilter will be triggered by
// the \code{Update()} call on the writer at the end of the
// pipeline. Make sure to use a
// \doxygen{otb}{StreamingImageFileWriter} if you want to benefit
// from the streaming features.
//
// Software Guide : EndLatex
......@@ -241,7 +244,8 @@ int main(int argc, char** argv )
// Software Guide : BeginLatex
//
// Figure~\ref{fig:NCCRegistrationFilterOUTPUT} shows the result of applying.
// Figure~\ref{fig:NCCRegistrationFilterOUTPUT} shows the result of
// applying the disparity map estimation.
//
// \begin{figure}
// \center
......
......@@ -82,7 +82,8 @@ int main( int argc, char * argv[] )
// Software Guide : BeginCodeSnippet
typedef otb::MultiToMonoChannelExtractROI<PixelType, PixelType> ExtractChannelType;
typedef otb::MultiToMonoChannelExtractROI<PixelType, PixelType>
ExtractChannelType;
ExtractChannelType::Pointer extractChannel = ExtractChannelType::New();
// Software Guide : EndCodeSnippet
......@@ -105,7 +106,8 @@ int main( int argc, char * argv[] )
// Software Guide : BeginCodeSnippet
reader->UpdateOutputInformation();
extractChannel->SetExtractionRegion(reader->GetOutput()->GetLargestPossibleRegion());
extractChannel->SetExtractionRegion(
reader->GetOutput()->GetLargestPossibleRegion());
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
......
......@@ -72,10 +72,11 @@ int main( int argc, char* argv[] )
if(argc!=12)
{
std::cout << argv[0] <<" <input_pan_filename> <input_xs_filename> ";
std::cout << "<output_filename> <utm zone> <hemisphere N/S> <x_ground_upper_left_corner> ";
std::cout << "<y_ground_upper_left_corner> <x_Size> <y_Size> ";
std::cout << "<output_filename> <utm zone> <hemisphere N/S> ";
std::cout << "<x_ground_upper_left_corner> <y_ground_upper_left_corner> ";
std::cout << "<x_Size> <y_Size> ";
std::cout << "<x_groundSamplingDistance> ";
std::cout << "<y_groundSamplingDistance (should be negative since origin is upper left)>"
std::cout << "<y_groundSamplingDistance (negative since origin is upper left)>"
<< std::endl;
return EXIT_FAILURE;
......
......@@ -128,7 +128,8 @@ int main( int argc, char * argv[] )
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
parser->SetProgramDescription("This program applies a Harris detector on the input image");
parser->SetProgramDescription(
"This program applies a Harris detector on the input image");
parser->AddInputImage();
parser->AddOutputImage();
parser->AddOption("--SigmaD",
......
......@@ -494,7 +494,7 @@ IF(NOT BUILD_SHARED_LIBS)
ENDIF(NOT BUILD_SHARED_LIBS)
ADD_EXECUTABLE(otbUtilitiesTests otbUtilitiesTests.cxx ${UtilitiesTests_SRCS})
TARGET_LINK_LIBRARIES(otbUtilitiesTests OTBIO OTBCommon gdal ITKIO ITKAlgorithms ITKStatistics ITKCommon otbossim otbsvm otb6S tinyXML otbkml)
TARGET_LINK_LIBRARIES(otbUtilitiesTests OTBIO OTBCommon gdal ITKIO ITKAlgorithms ITKStatistics ITKCommon otbossim otbsvm otb6S tinyXML otbkml )
IF(OTB_COMPILE_JPEG2000)
TARGET_LINK_LIBRARIES(otbUtilitiesTests otbopenjpeg)
......
......@@ -230,7 +230,7 @@ static void HandleFile(const char* kmlfile) {
}
}
int kmlhellohref(int argc, char** argv) {
int kmlhellohref(int argc, char* argv[]) {
if (argc != 2) {
cout << "usage: " << argv[0] << " file.kml" << endl;
return EXIT_FAILURE;
......
......@@ -132,6 +132,34 @@ SET(libzlib_la_SOURCES
${libzlib_la_SOURCES_DIR}/zip.c
)
# Only for Windows Visual Studio
SET(libzlib_win32_la_SOURCES "")
IF(WIN32)
IF(NOT BORLAND)
IF(NOT CYGWIN)
IF(NOT MINGW)
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/third_party/zlib-1.2.3.win32/src")
SET(libzlib_win32_la_SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/zlib-1.2.3.win32/src")
SET(libzlib_win32_la_SOURCES
${libzlib_win32_la_SOURCES_DIR}/adler32.c
${libzlib_win32_la_SOURCES_DIR}/compress.c
${libzlib_win32_la_SOURCES_DIR}/crc32.c
${libzlib_win32_la_SOURCES_DIR}/deflate.c
${libzlib_win32_la_SOURCES_DIR}/inflate.c
${libzlib_win32_la_SOURCES_DIR}/gzio.c
${libzlib_win32_la_SOURCES_DIR}/infback.c
${libzlib_win32_la_SOURCES_DIR}/inffast.c
${libzlib_win32_la_SOURCES_DIR}/inftrees.c
${libzlib_win32_la_SOURCES_DIR}/trees.c
${libzlib_win32_la_SOURCES_DIR}/uncompr.c
${libzlib_win32_la_SOURCES_DIR}/zutil.c
)
ENDIF(NOT MINGW)
ENDIF(NOT CYGWIN)
ENDIF(NOT BORLAND)
ENDIF(WIN32)
SET(liburiparser_la_SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/uriparser-0.7.1/lib")
INCLUDE_DIRECTORIES(${liburiparser_la_SOURCES_DIR})
SET( liburiparser_la_SOURCES
......@@ -163,9 +191,7 @@ SET(libkml_SOURCES
${libkmlregionator_la_SOURCES}
${libzlib_la_SOURCES}
${liburiparser_la_SOURCES}
${libzlib_win32_la_SOURCES}
)
# Adjust the compiler flags to avoid problems with ossim code.
IF(CMAKE_COMPILER_IS_GNUCXX)
......
/* adler32.c -- compute the Adler-32 checksum of a data stream
* Copyright (C) 1995-2004 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#define ZLIB_INTERNAL
#include "zlib.h"
#define BASE 65521UL /* largest prime smaller than 65536 */
#define NMAX 5552
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
#define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;}
#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
#define DO16(buf) DO8(buf,0); DO8(buf,8);
/* use NO_DIVIDE if your processor does not do division in hardware */
#ifdef NO_DIVIDE
# define MOD(a) \
do { \
if (a >= (BASE << 16)) a -= (BASE << 16); \
if (a >= (BASE << 15)) a -= (BASE << 15); \
if (a >= (BASE << 14)) a -= (BASE << 14); \
if (a >= (BASE << 13)) a -= (BASE << 13); \
if (a >= (BASE << 12)) a -= (BASE << 12); \
if (a >= (BASE << 11)) a -= (BASE << 11); \
if (a >= (BASE << 10)) a -= (BASE << 10); \
if (a >= (BASE << 9)) a -= (BASE << 9); \
if (a >= (BASE << 8)) a -= (BASE << 8); \
if (a >= (BASE << 7)) a -= (BASE << 7); \
if (a >= (BASE << 6)) a -= (BASE << 6); \
if (a >= (BASE << 5)) a -= (BASE << 5); \
if (a >= (BASE << 4)) a -= (BASE << 4); \
if (a >= (BASE << 3)) a -= (BASE << 3); \
if (a >= (BASE << 2)) a -= (BASE << 2); \
if (a >= (BASE << 1)) a -= (BASE << 1); \
if (a >= BASE) a -= BASE; \
} while (0)
# define MOD4(a) \
do { \
if (a >= (BASE << 4)) a -= (BASE << 4); \
if (a >= (BASE << 3)) a -= (BASE << 3); \
if (a >= (BASE << 2)) a -= (BASE << 2); \
if (a >= (BASE << 1)) a -= (BASE << 1); \
if (a >= BASE) a -= BASE; \
} while (0)
#else
# define MOD(a) a %= BASE
# define MOD4(a) a %= BASE
#endif
/* ========================================================================= */
uLong ZEXPORT adler32(adler, buf, len)
uLong adler;
const Bytef *buf;
uInt len;
{
unsigned long sum2;
unsigned n;
/* split Adler-32 into component sums */
sum2 = (adler >> 16) & 0xffff;
adler &= 0xffff;
/* in case user likes doing a byte at a time, keep it fast */
if (len == 1) {
adler += buf[0];
if (adler >= BASE)
adler -= BASE;
sum2 += adler;
if (sum2 >= BASE)
sum2 -= BASE;
return adler | (sum2 << 16);
}
/* initial Adler-32 value (deferred check for len == 1 speed) */
if (buf == Z_NULL)
return 1L;
/* in case short lengths are provided, keep it somewhat fast */
if (len < 16) {
while (len--) {
adler += *buf++;
sum2 += adler;
}
if (adler >= BASE)
adler -= BASE;
MOD4(sum2); /* only added so many BASE's */
return adler | (sum2 << 16);
}
/* do length NMAX blocks -- requires just one modulo operation */
while (len >= NMAX) {
len -= NMAX;
n = NMAX / 16; /* NMAX is divisible by 16 */
do {
DO16(buf); /* 16 sums unrolled */
buf += 16;
} while (--n);
MOD(adler);
MOD(sum2);
}
/* do remaining bytes (less than NMAX, still just one modulo) */
if (len) { /* avoid modulos if none remaining */
while (len >= 16) {
len -= 16;
DO16(buf);
buf += 16;
}
while (len--) {
adler += *buf++;
sum2 += adler;
}
MOD(adler);
MOD(sum2);
}
/* return recombined sums */
return adler | (sum2 << 16);
}
/* ========================================================================= */
uLong ZEXPORT adler32_combine(adler1, adler2, len2)
uLong adler1;
uLong adler2;
z_off_t len2;
{
unsigned long sum1;
unsigned long sum2;
unsigned rem;
/* the derivation of this formula is left as an exercise for the reader */
rem = (unsigned)(len2 % BASE);
sum1 = adler1 & 0xffff;
sum2 = rem * sum1;
MOD(sum2);
sum1 += (adler2 & 0xffff) + BASE - 1;
sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
if (sum1 > BASE) sum1 -= BASE;
if (sum1 > BASE) sum1 -= BASE;
if (sum2 > (BASE << 1)) sum2 -= (BASE << 1);
if (sum2 > BASE) sum2 -= BASE;
return sum1 | (sum2 << 16);
}
/* compress.c -- compress a memory buffer
* Copyright (C) 1995-2003 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#define ZLIB_INTERNAL
#include "zlib.h"
/* ===========================================================================
Compresses the source buffer into the destination buffer. The level
parameter has the same meaning as in deflateInit. sourceLen is the byte
length of the source buffer. Upon entry, destLen is the total size of the
destination buffer, which must be at least 0.1% larger than sourceLen plus
12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
Z_STREAM_ERROR if the level parameter is invalid.
*/
int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
uLong sourceLen;
int level;
{
z_stream stream;
int err;
stream.next_in = (Bytef*)source;
stream.avail_in = (uInt)sourceLen;
#ifdef MAXSEG_64K
/* Check for source > 64K on 16-bit machine: */
if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
#endif
stream.next_out = dest;
stream.avail_out = (uInt)*destLen;
if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
stream.zalloc = (alloc_func)0;
stream.zfree = (free_func)0;
stream.opaque = (voidpf)0;
err = deflateInit(&stream, level);
if (err != Z_OK) return err;
err = deflate(&stream, Z_FINISH);
if (err != Z_STREAM_END) {
deflateEnd(&stream);
return err == Z_OK ? Z_BUF_ERROR : err;
}
*destLen = stream.total_out;
err = deflateEnd(&stream);
return err;
}
/* ===========================================================================
*/
int ZEXPORT compress (dest, destLen, source, sourceLen)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
uLong sourceLen;
{
return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
}
/* ===========================================================================
If the default memLevel or windowBits for deflateInit() is changed, then
this function needs to be updated.
*/
uLong ZEXPORT compressBound (sourceLen)
uLong sourceLen;
{
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 11;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* inffast.h -- header to use inffast.c
* Copyright (C) 1995-2003 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the compression library and is
subject to change. Applications should only use zlib.h.
*/
void inflate_fast OF((z_streamp strm, unsigned start));
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment