Переглянути джерело

Merge branch 'cm_opencv' of dbv.inf-cv.uni-jena.de:/home/ruehle/libs/nice.cmake into cm_opencv

Johannes Ruehle 12 роки тому
батько
коміт
5fb857c00f

+ 2 - 0
core/CMakeLists.txt

@@ -3,6 +3,7 @@ message(STATUS "${NICE_CURR_DIR}")
 ocv_glob_modules(${NICE_CURR_DIR})
 
 
+
 #CONFIGURE_FILE(
 #  "CMakeDefinesConfig.h.in"
 #  "${PROJECT_BINARY_DIR}/CMakeDefinesConfig.h"
@@ -14,6 +15,7 @@ ocv_glob_modules(${NICE_CURR_DIR})
 #INCLUDE_DIRECTORIES(vector)
 #INCLUDE_DIRECTORIES(optimization)
 #INCLUDE_DIRECTORIES(image)
+
 #INCLUDE_DIRECTORIES(iceconversion)
 #INCLUDE_DIRECTORIES(imagedisplay)
 #INCLUDE_DIRECTORIES(matlabAccess)

+ 6 - 2
core/basics/CMakeLists.txt.old

@@ -4,8 +4,12 @@ Config.cpp         FileName.cpp          numerictools.cpp  Streamable.cpp
 Exception.cpp      FrameRateCounter.cpp  Observable.cpp    StringTools.cpp
 )
 
-ADD_SUBDIRECTORY(progs)
+message(STATUS "vector sources: ${core_vectors_src}")
+ADD_LIBRARY(core_basics ${NICE_BUILD_LIBS_STATIC_SHARED} ${core_basics_src} ${core_vectors_src})
+#TARGET_LINK_LIBRARIES(core_basics core_vector)
+
+#add_dependencies(core_basics core_vectors)
 
-ADD_LIBRARY(core_basics ${NICE_BUILD_LIBS_STATIC_SHARED} ${core_basics_src})
+ADD_SUBDIRECTORY(progs)
 
 INSTALL(TARGETS core_basics DESTINATION libs)

+ 2 - 0
core/basics/progs/testConfig.cpp

@@ -16,7 +16,9 @@ using namespace std;
 */
 int main (int argc, char **argv)
 {   
+#ifndef WIN32
     std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
+#endif
 
     Config conf ( argc, argv );
     conf.store(cout);    

+ 14 - 1
core/image/ColorImageT.cpp

@@ -82,7 +82,8 @@ void ColorImageT<Ipp8u>::readPPM(const std::string& ppmFileName,
     }
   } else if(header.format==PGM_RAW) {
     for (int y = 0; y < header.height; y++) {
-      Pixel line[header.width];
+#ifdef WIN32
+		Pixel *line = new Pixel[header.width];
       file.read((char *)line,header.width);
       Pixel *target = getPixelPointerY(y);
       Pixel *src = line;
@@ -91,6 +92,18 @@ void ColorImageT<Ipp8u>::readPPM(const std::string& ppmFileName,
         *target++ = *src;
         *target++ = *src++;
       }
+		delete [] line;
+#else
+	  Pixel line[header.width];
+      file.read((char *)line,header.width);
+      Pixel *target = getPixelPointerY(y);
+      Pixel *src = line;
+      for (int x = 0; x < header.width; x++) {
+        *target++ = *src;
+        *target++ = *src;
+        *target++ = *src++;
+      }
+#endif
     }
   } else {
     fthrow(ImageException,"Format not yet implemented.");

+ 1 - 1
core/image/Filter.h

@@ -19,7 +19,7 @@
 #include <core/image/ColorImageT.h>
 #include <core/image/Buffer.h>
 
-#warning "Filter.h is obsolete. Please use FilterT.h instead and adapt your calls and implement the filter if necessary :)"
+#pragma message WARNING("Filter.h is obsolete. Please use FilterT.h instead and adapt your calls and implement the filter if necessary :)")
 
 namespace NICE {
 /**

+ 16 - 0
core/image/ImageT.cpp

@@ -80,6 +80,21 @@ void ImageT<Ipp8u>::readPGM(const std::string& pgmFileName,
     ippiRGBToGray_8u_C3C1R(line, header.width*header.channel, target, header.width, region);
 #else
     for (int y = 0; y < header.height; y++) {
+#ifdef WIN32
+	  Pixel *line = new Pixel[header.width*header.channel];
+      file.read((char *)line,header.width*header.channel);
+      Pixel *target = getPixelPointerY(y);
+      Pixel *src = line;
+      for (int x = 0; x < header.width; x++) {
+        //  // with lookup table (see firewire ColorConvert)
+        // *target = pLutRg[*src]+pLutGg[*(src+1)]+pLutBg[*(src+2)];
+        // *target++ += (pLutRgr[*src]+pLutGgr[*(src+1)]+pLutBgr[*(src+2)])/64;
+        // src=src+3;
+        *target++ = static_cast<Pixel>(*src*0.299+*(src+1)*0.587+*(src+2)*0.114);
+        src=src+3;
+      }
+	  delete [] line;
+#else
       Pixel line[header.width*header.channel];
       file.read((char *)line,header.width*header.channel);
       Pixel *target = getPixelPointerY(y);
@@ -92,6 +107,7 @@ void ImageT<Ipp8u>::readPGM(const std::string& pgmFileName,
         *target++ = static_cast<Pixel>(*src*0.299+*(src+1)*0.587+*(src+2)*0.114);
         src=src+3;
       }
+#endif
     }
 #endif
   } else {

+ 7 - 5
readme.txt

@@ -34,13 +34,9 @@ foreach dir in subdirlist
 
 endmacro
 
-#####################
-
-
 set(NICE_CURR_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
 
 
-
 #### geile funktionen der OpenCV:
 ---aus OpenCVUtils.cmake:
 macro(ocv_convert_to_full_paths VAR) # convert list of paths to full paths
@@ -60,4 +56,10 @@ ocv_glob_modules(pathcurrdir) -->in modules
   ocv_module_include_directories() ( auch mit zusatzincludes dann übergeben ${ZLib_include_Dir})
   ocv_glob_module_sources() holt cpps und hpp h aus unterordnern -- sources bilden
   ocv_create_module (binary build the module ->add_library,  set_target etc
-  
+  
+
+#######
+defs to care about
+NICE_USELIB_CUDACHOLESKY
+NICE_USELIB_IPP
+