Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
9097ccf5
Commit
9097ccf5
authored
Sep 09, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drop legacy headers
parent
80610ca0
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
2 additions
and
1349 deletions
+2
-1349
boost.cpp
apps/traincascade/boost.cpp
+0
-1
OpenCVGenConfig.cmake
cmake/OpenCVGenConfig.cmake
+2
-2
CMakeLists.txt
include/CMakeLists.txt
+0
-4
cv.h
include/opencv/cv.h
+0
-73
cv.hpp
include/opencv/cv.hpp
+0
-60
cvaux.h
include/opencv/cvaux.h
+0
-57
cvaux.hpp
include/opencv/cvaux.hpp
+0
-52
cvwimage.h
include/opencv/cvwimage.h
+0
-46
cxcore.h
include/opencv/cxcore.h
+0
-52
cxcore.hpp
include/opencv/cxcore.hpp
+0
-53
cxeigen.hpp
include/opencv/cxeigen.hpp
+0
-48
cxmisc.h
include/opencv/cxmisc.h
+0
-8
highgui.h
include/opencv/highgui.h
+0
-48
ml.h
include/opencv/ml.h
+0
-47
ippasync.hpp
modules/core/include/opencv2/core/ippasync.hpp
+0
-195
wimage.hpp
modules/core/include/opencv2/core/wimage.hpp
+0
-603
No files found.
apps/traincascade/boost.cpp
View file @
9097ccf5
...
...
@@ -30,7 +30,6 @@ using cv::ParallelLoopBody;
#include "boost.h"
#include "cascadeclassifier.h"
#include <queue>
#include "cxmisc.h"
#include "cvconfig.h"
...
...
cmake/OpenCVGenConfig.cmake
View file @
9097ccf5
...
...
@@ -33,7 +33,7 @@ endif()
# -------------------------------------------------------------------------------------------
# Part 1/3: ${BIN_DIR}/OpenCVConfig.cmake -> For use *without* "make install"
# -------------------------------------------------------------------------------------------
set
(
OpenCV_INCLUDE_DIRS_CONFIGCMAKE
"
\"
${
OPENCV_CONFIG_FILE_INCLUDE_DIR
}
\"
\"
${
OpenCV_SOURCE_DIR
}
/include
\"
\"
${
OpenCV_SOURCE_DIR
}
/include/opencv
\"
"
)
set
(
OpenCV_INCLUDE_DIRS_CONFIGCMAKE
"
\"
${
OPENCV_CONFIG_FILE_INCLUDE_DIR
}
\"
\"
${
OpenCV_SOURCE_DIR
}
/include
\"
"
)
foreach
(
m
${
OPENCV_MODULES_BUILD
}
)
if
(
EXISTS
"
${
OPENCV_MODULE_
${
m
}
_LOCATION
}
/include"
)
...
...
@@ -68,7 +68,7 @@ configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.
# Part 2/3: ${BIN_DIR}/unix-install/OpenCVConfig.cmake -> For use *with* "make install"
# -------------------------------------------------------------------------------------------
file
(
RELATIVE_PATH OpenCV_INSTALL_PATH_RELATIVE_CONFIGCMAKE
"
${
CMAKE_INSTALL_PREFIX
}
/
${
OPENCV_CONFIG_INSTALL_PATH
}
/"
${
CMAKE_INSTALL_PREFIX
}
)
set
(
OpenCV_INCLUDE_DIRS_CONFIGCMAKE
"
\"\$
{OpenCV_INSTALL_PATH}/
${
OPENCV_INCLUDE_INSTALL_PATH
}
\"
\"\$
{OpenCV_INSTALL_PATH}/
${
OPENCV_INCLUDE_INSTALL_PATH
}
/opencv
\"
"
)
set
(
OpenCV_INCLUDE_DIRS_CONFIGCMAKE
"
\"\$
{OpenCV_INSTALL_PATH}/
${
OPENCV_INCLUDE_INSTALL_PATH
}
\"
"
)
if
(
USE_IPPICV
)
file
(
RELATIVE_PATH IPPICV_INSTALL_PATH_RELATIVE_CONFIGCMAKE
"
${
CMAKE_INSTALL_PREFIX
}
"
"
${
IPPICV_INSTALL_PATH
}
"
)
...
...
include/CMakeLists.txt
View file @
9097ccf5
file
(
GLOB old_hdrs
"opencv/*.h*"
)
install
(
FILES
${
old_hdrs
}
DESTINATION
${
OPENCV_INCLUDE_INSTALL_PATH
}
/opencv
COMPONENT dev
)
install
(
FILES
"opencv2/opencv.hpp"
DESTINATION
${
OPENCV_INCLUDE_INSTALL_PATH
}
/opencv2
COMPONENT dev
)
include/opencv/cv.h
deleted
100644 → 0
View file @
80610ca0
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef OPENCV_OLD_CV_H
#define OPENCV_OLD_CV_H
#if defined(_MSC_VER)
#define CV_DO_PRAGMA(x) __pragma(x)
#define __CVSTR2__(x) #x
#define __CVSTR1__(x) __CVSTR2__(x)
#define __CVMSVCLOC__ __FILE__ "("__CVSTR1__(__LINE__)") : "
#define CV_MSG_PRAGMA(_msg) CV_DO_PRAGMA(message (__CVMSVCLOC__ _msg))
#elif defined(__GNUC__)
#define CV_DO_PRAGMA(x) _Pragma (#x)
#define CV_MSG_PRAGMA(_msg) CV_DO_PRAGMA(message (_msg))
#else
#define CV_DO_PRAGMA(x)
#define CV_MSG_PRAGMA(_msg)
#endif
#define CV_WARNING(x) CV_MSG_PRAGMA("Warning: " #x)
//CV_WARNING("This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module")
#include "opencv2/core/core_c.h"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/photo/photo_c.h"
#include "opencv2/video/tracking_c.h"
#include "opencv2/objdetect/objdetect_c.h"
#if !defined(CV_IMPL)
#define CV_IMPL extern "C"
#endif //CV_IMPL
#endif // __OPENCV_OLD_CV_H_
include/opencv/cv.hpp
deleted
100644 → 0
View file @
80610ca0
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef OPENCV_OLD_CV_HPP
#define OPENCV_OLD_CV_HPP
//#if defined(__GNUC__)
//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module"
//#endif
#include "cv.h"
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/photo.hpp"
#include "opencv2/video.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/features2d.hpp"
#include "opencv2/calib3d.hpp"
#include "opencv2/objdetect.hpp"
#endif
include/opencv/cvaux.h
deleted
100644 → 0
View file @
80610ca0
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef OPENCV_OLD_AUX_H
#define OPENCV_OLD_AUX_H
//#if defined(__GNUC__)
//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module"
//#endif
#include "opencv2/core/core_c.h"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/photo/photo_c.h"
#include "opencv2/video/tracking_c.h"
#include "opencv2/objdetect/objdetect_c.h"
#endif
/* End of file. */
include/opencv/cvaux.hpp
deleted
100644 → 0
View file @
80610ca0
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef OPENCV_OLD_AUX_HPP
#define OPENCV_OLD_AUX_HPP
//#if defined(__GNUC__)
//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module"
//#endif
#include "cvaux.h"
#include "opencv2/core/utility.hpp"
#endif
include/opencv/cvwimage.h
deleted
100644 → 0
View file @
80610ca0
///////////////////////////////////////////////////////////////////////////////
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to
// this license. If you do not agree to this license, do not download,
// install, copy or use the software.
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2008, Google, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation or contributors may not be used to endorse
// or promote products derived from this software without specific
// prior written permission.
//
// This software is provided by the copyright holders and contributors "as is"
// and any express or implied warranties, including, but not limited to, the
// implied warranties of merchantability and fitness for a particular purpose
// are disclaimed. In no event shall the Intel Corporation or contributors be
// liable for any direct, indirect, incidental, special, exemplary, or
// consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
#ifndef OPENCV_OLD_WIMAGE_HPP
#define OPENCV_OLD_WIMAGE_HPP
#include "opencv2/core/wimage.hpp"
#endif
include/opencv/cxcore.h
deleted
100644 → 0
View file @
80610ca0
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef OPENCV_OLD_CXCORE_H
#define OPENCV_OLD_CXCORE_H
//#if defined(__GNUC__)
//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module"
//#endif
#include "opencv2/core/core_c.h"
#endif
include/opencv/cxcore.hpp
deleted
100644 → 0
View file @
80610ca0
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef OPENCV_OLD_CXCORE_HPP
#define OPENCV_OLD_CXCORE_HPP
//#if defined(__GNUC__)
//#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module"
//#endif
#include "cxcore.h"
#include "opencv2/core.hpp"
#endif
include/opencv/cxeigen.hpp
deleted
100644 → 0
View file @
80610ca0
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef OPENCV_OLD_EIGEN_HPP
#define OPENCV_OLD_EIGEN_HPP
#include "opencv2/core/eigen.hpp"
#endif
include/opencv/cxmisc.h
deleted
100644 → 0
View file @
80610ca0
#ifndef OPENCV_OLD_CXMISC_H
#define OPENCV_OLD_CXMISC_H
#ifdef __cplusplus
# include "opencv2/core/utility.hpp"
#endif
#endif
include/opencv/highgui.h
deleted
100644 → 0
View file @
80610ca0
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef OPENCV_OLD_HIGHGUI_H
#define OPENCV_OLD_HIGHGUI_H
#include "opencv2/core/core_c.h"
#include "opencv2/highgui/highgui_c.h"
#endif
include/opencv/ml.h
deleted
100644 → 0
View file @
80610ca0
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef OPENCV_OLD_ML_H
#define OPENCV_OLD_ML_H
#include "opencv2/core/core_c.h"
#include "opencv2/ml.hpp"
#endif
modules/core/include/opencv2/core/ippasync.hpp
deleted
100644 → 0
View file @
80610ca0
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2015, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Copyright (C) 2015, Itseez Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef OPENCV_CORE_IPPASYNC_HPP
#define OPENCV_CORE_IPPASYNC_HPP
#ifdef HAVE_IPP_A // this file will be removed in OpenCV 4.0
#include "opencv2/core.hpp"
#include <ipp_async_op.h>
#include <ipp_async_accel.h>
namespace
cv
{
namespace
hpp
{
/** @addtogroup core_ipp
This section describes conversion between OpenCV and [Intel® IPP Asynchronous
C/C++](http://software.intel.com/en-us/intel-ipp-preview) library. [Getting Started
Guide](http://registrationcenter.intel.com/irc_nas/3727/ipp_async_get_started.htm) help you to
install the library, configure header and library build paths.
*/
//! @{
//! convert OpenCV data type to hppDataType
inline
int
toHppType
(
const
int
cvType
)
{
int
depth
=
CV_MAT_DEPTH
(
cvType
);
int
hppType
=
depth
==
CV_8U
?
HPP_DATA_TYPE_8U
:
depth
==
CV_16U
?
HPP_DATA_TYPE_16U
:
depth
==
CV_16S
?
HPP_DATA_TYPE_16S
:
depth
==
CV_32S
?
HPP_DATA_TYPE_32S
:
depth
==
CV_32F
?
HPP_DATA_TYPE_32F
:
depth
==
CV_64F
?
HPP_DATA_TYPE_64F
:
-
1
;
CV_Assert
(
hppType
>=
0
);
return
hppType
;
}
//! convert hppDataType to OpenCV data type
inline
int
toCvType
(
const
int
hppType
)
{
int
cvType
=
hppType
==
HPP_DATA_TYPE_8U
?
CV_8U
:
hppType
==
HPP_DATA_TYPE_16U
?
CV_16U
:
hppType
==
HPP_DATA_TYPE_16S
?
CV_16S
:
hppType
==
HPP_DATA_TYPE_32S
?
CV_32S
:
hppType
==
HPP_DATA_TYPE_32F
?
CV_32F
:
hppType
==
HPP_DATA_TYPE_64F
?
CV_64F
:
-
1
;
CV_Assert
(
cvType
>=
0
);
return
cvType
;
}
/** @brief Convert hppiMatrix to Mat.
This function allocates and initializes new matrix (if needed) that has the same size and type as
input matrix. Supports CV_8U, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F.
@param src input hppiMatrix.
@param dst output matrix.
@param accel accelerator instance (see hpp::getHpp for the list of acceleration framework types).
@param cn number of channels.
*/
inline
void
copyHppToMat
(
hppiMatrix
*
src
,
Mat
&
dst
,
hppAccel
accel
,
int
cn
)
{
hppDataType
type
;
hpp32u
width
,
height
;
hppStatus
sts
;
if
(
src
==
NULL
)
return
dst
.
release
();
sts
=
hppiInquireMatrix
(
src
,
&
type
,
&
width
,
&
height
);
CV_Assert
(
sts
==
HPP_STATUS_NO_ERROR
);
int
matType
=
CV_MAKETYPE
(
toCvType
(
type
),
cn
);
CV_Assert
(
width
%
cn
==
0
);
width
/=
cn
;
dst
.
create
((
int
)
height
,
(
int
)
width
,
(
int
)
matType
);
size_t
newSize
=
(
size_t
)(
height
*
(
hpp32u
)(
dst
.
step
));
sts
=
hppiGetMatrixData
(
accel
,
src
,(
hpp32u
)(
dst
.
step
),
dst
.
data
,
&
newSize
);
CV_Assert
(
sts
==
HPP_STATUS_NO_ERROR
);
}
/** @brief Create Mat from hppiMatrix.
This function allocates and initializes the Mat that has the same size and type as input matrix.
Supports CV_8U, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F.
@param src input hppiMatrix.
@param accel accelerator instance (see hpp::getHpp for the list of acceleration framework types).
@param cn number of channels.
@sa howToUseIPPAconversion, hpp::copyHppToMat, hpp::getHpp.
*/
inline
Mat
getMat
(
hppiMatrix
*
src
,
hppAccel
accel
,
int
cn
)
{
Mat
dst
;
copyHppToMat
(
src
,
dst
,
accel
,
cn
);
return
dst
;
}
/** @brief Create hppiMatrix from Mat.
This function allocates and initializes the hppiMatrix that has the same size and type as input
matrix, returns the hppiMatrix*.
If you want to use zero-copy for GPU you should to have 4KB aligned matrix data. See details
[hppiCreateSharedMatrix](http://software.intel.com/ru-ru/node/501697).
Supports CV_8U, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F.
@note The hppiMatrix pointer to the image buffer in system memory refers to the src.data. Control
the lifetime of the matrix and don't change its data, if there is no special need.
@param src input matrix.
@param accel accelerator instance. Supports type:
- **HPP_ACCEL_TYPE_CPU** - accelerated by optimized CPU instructions.
- **HPP_ACCEL_TYPE_GPU** - accelerated by GPU programmable units or fixed-function
accelerators.
- **HPP_ACCEL_TYPE_ANY** - any acceleration or no acceleration available.
@sa howToUseIPPAconversion, hpp::getMat
*/
inline
hppiMatrix
*
getHpp
(
const
Mat
&
src
,
hppAccel
accel
)
{
int
htype
=
toHppType
(
src
.
type
());
int
cn
=
src
.
channels
();
CV_Assert
(
src
.
data
);
hppAccelType
accelType
=
hppQueryAccelType
(
accel
);
if
(
accelType
!=
HPP_ACCEL_TYPE_CPU
)
{
hpp32u
pitch
,
size
;
hppQueryMatrixAllocParams
(
accel
,
src
.
cols
*
cn
,
src
.
rows
,
htype
,
&
pitch
,
&
size
);
if
(
pitch
!=
0
&&
size
!=
0
)
if
((
int
)(
src
.
data
)
%
4096
==
0
&&
pitch
==
(
hpp32u
)(
src
.
step
))
{
return
hppiCreateSharedMatrix
(
htype
,
src
.
cols
*
cn
,
src
.
rows
,
src
.
data
,
pitch
,
size
);
}
}
return
hppiCreateMatrix
(
htype
,
src
.
cols
*
cn
,
src
.
rows
,
src
.
data
,
(
hpp32s
)(
src
.
step
));;
}
//! @}
}}
#endif
#endif
modules/core/include/opencv2/core/wimage.hpp
deleted
100644 → 0
View file @
80610ca0
/*M//////////////////////////////////////////////////////////////////////////////
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to
// this license. If you do not agree to this license, do not download,
// install, copy or use the software.
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2008, Google, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation or contributors may not be used to endorse
// or promote products derived from this software without specific
// prior written permission.
//
// This software is provided by the copyright holders and contributors "as is"
// and any express or implied warranties, including, but not limited to, the
// implied warranties of merchantability and fitness for a particular purpose
// are disclaimed. In no event shall the Intel Corporation or contributors be
// liable for any direct, indirect, incidental, special, exemplary, or
// consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
/////////////////////////////////////////////////////////////////////////////////
//M*/
#ifndef OPENCV_CORE_WIMAGE_HPP
#define OPENCV_CORE_WIMAGE_HPP
#include "opencv2/core/core_c.h"
#ifdef __cplusplus
namespace
cv
{
//! @addtogroup core
//! @{
template
<
typename
T
>
class
WImage
;
template
<
typename
T
>
class
WImageBuffer
;
template
<
typename
T
>
class
WImageView
;
template
<
typename
T
,
int
C
>
class
WImageC
;
template
<
typename
T
,
int
C
>
class
WImageBufferC
;
template
<
typename
T
,
int
C
>
class
WImageViewC
;
// Commonly used typedefs.
typedef
WImage
<
uchar
>
WImage_b
;
typedef
WImageView
<
uchar
>
WImageView_b
;
typedef
WImageBuffer
<
uchar
>
WImageBuffer_b
;
typedef
WImageC
<
uchar
,
1
>
WImage1_b
;
typedef
WImageViewC
<
uchar
,
1
>
WImageView1_b
;
typedef
WImageBufferC
<
uchar
,
1
>
WImageBuffer1_b
;
typedef
WImageC
<
uchar
,
3
>
WImage3_b
;
typedef
WImageViewC
<
uchar
,
3
>
WImageView3_b
;
typedef
WImageBufferC
<
uchar
,
3
>
WImageBuffer3_b
;
typedef
WImage
<
float
>
WImage_f
;
typedef
WImageView
<
float
>
WImageView_f
;
typedef
WImageBuffer
<
float
>
WImageBuffer_f
;
typedef
WImageC
<
float
,
1
>
WImage1_f
;
typedef
WImageViewC
<
float
,
1
>
WImageView1_f
;
typedef
WImageBufferC
<
float
,
1
>
WImageBuffer1_f
;
typedef
WImageC
<
float
,
3
>
WImage3_f
;
typedef
WImageViewC
<
float
,
3
>
WImageView3_f
;
typedef
WImageBufferC
<
float
,
3
>
WImageBuffer3_f
;
// There isn't a standard for signed and unsigned short so be more
// explicit in the typename for these cases.
typedef
WImage
<
short
>
WImage_16s
;
typedef
WImageView
<
short
>
WImageView_16s
;
typedef
WImageBuffer
<
short
>
WImageBuffer_16s
;
typedef
WImageC
<
short
,
1
>
WImage1_16s
;
typedef
WImageViewC
<
short
,
1
>
WImageView1_16s
;
typedef
WImageBufferC
<
short
,
1
>
WImageBuffer1_16s
;
typedef
WImageC
<
short
,
3
>
WImage3_16s
;
typedef
WImageViewC
<
short
,
3
>
WImageView3_16s
;
typedef
WImageBufferC
<
short
,
3
>
WImageBuffer3_16s
;
typedef
WImage
<
ushort
>
WImage_16u
;
typedef
WImageView
<
ushort
>
WImageView_16u
;
typedef
WImageBuffer
<
ushort
>
WImageBuffer_16u
;
typedef
WImageC
<
ushort
,
1
>
WImage1_16u
;
typedef
WImageViewC
<
ushort
,
1
>
WImageView1_16u
;
typedef
WImageBufferC
<
ushort
,
1
>
WImageBuffer1_16u
;
typedef
WImageC
<
ushort
,
3
>
WImage3_16u
;
typedef
WImageViewC
<
ushort
,
3
>
WImageView3_16u
;
typedef
WImageBufferC
<
ushort
,
3
>
WImageBuffer3_16u
;
/** @brief Image class which provides a thin layer around an IplImage.
The goals of the class design are:
-# All the data has explicit ownership to avoid memory leaks
-# No hidden allocations or copies for performance.
-# Easy access to OpenCV methods (which will access IPP if available)
-# Can easily treat external data as an image
-# Easy to create images which are subsets of other images
-# Fast pixel access which can take advantage of number of channels if known at compile time.
The WImage class is the image class which provides the data accessors. The 'W' comes from the fact
that it is also a wrapper around the popular but inconvenient IplImage class. A WImage can be
constructed either using a WImageBuffer class which allocates and frees the data, or using a
WImageView class which constructs a subimage or a view into external data. The view class does no
memory management. Each class actually has two versions, one when the number of channels is known
at compile time and one when it isn't. Using the one with the number of channels specified can
provide some compile time optimizations by using the fact that the number of channels is a
constant.
We use the convention (c,r) to refer to column c and row r with (0,0) being the upper left corner.
This is similar to standard Euclidean coordinates with the first coordinate varying in the
horizontal direction and the second coordinate varying in the vertical direction. Thus (c,r) is
usually in the domain [0, width) X [0, height)
Example usage:
@code
WImageBuffer3_b im(5,7); // Make a 5X7 3 channel image of type uchar
WImageView3_b sub_im(im, 2,2, 3,3); // 3X3 submatrix
vector<float> vec(10, 3.0f);
WImageView1_f user_im(&vec[0], 2, 5); // 2X5 image w/ supplied data
im.SetZero(); // same as cvSetZero(im.Ipl())
*im(2, 3) = 15; // Modify the element at column 2, row 3
MySetRand(&sub_im);
// Copy the second row into the first. This can be done with no memory
// allocation and will use SSE if IPP is available.
int w = im.Width();
im.View(0,0, w,1).CopyFrom(im.View(0,1, w,1));
// Doesn't care about source of data since using WImage
void MySetRand(WImage_b* im) { // Works with any number of channels
for (int r = 0; r < im->Height(); ++r) {
float* row = im->Row(r);
for (int c = 0; c < im->Width(); ++c) {
for (int ch = 0; ch < im->Channels(); ++ch, ++row) {
*row = uchar(rand() & 255);
}
}
}
}
@endcode
Functions that are not part of the basic image allocation, viewing, and access should come from
OpenCV, except some useful functions that are not part of OpenCV can be found in wimage_util.h
*/
template
<
typename
T
>
class
WImage
{
public
:
typedef
T
BaseType
;
// WImage is an abstract class with no other virtual methods so make the
// destructor virtual.
virtual
~
WImage
()
=
0
;
// Accessors
IplImage
*
Ipl
()
{
return
image_
;
}
const
IplImage
*
Ipl
()
const
{
return
image_
;
}
T
*
ImageData
()
{
return
reinterpret_cast
<
T
*>
(
image_
->
imageData
);
}
const
T
*
ImageData
()
const
{
return
reinterpret_cast
<
const
T
*>
(
image_
->
imageData
);
}
int
Width
()
const
{
return
image_
->
width
;
}
int
Height
()
const
{
return
image_
->
height
;
}
// WidthStep is the number of bytes to go to the pixel with the next y coord
int
WidthStep
()
const
{
return
image_
->
widthStep
;
}
int
Channels
()
const
{
return
image_
->
nChannels
;
}
int
ChannelSize
()
const
{
return
sizeof
(
T
);
}
// number of bytes per channel
// Number of bytes per pixel
int
PixelSize
()
const
{
return
Channels
()
*
ChannelSize
();
}
// Return depth type (e.g. IPL_DEPTH_8U, IPL_DEPTH_32F) which is the number
// of bits per channel and with the signed bit set.
// This is known at compile time using specializations.
int
Depth
()
const
;
inline
const
T
*
Row
(
int
r
)
const
{
return
reinterpret_cast
<
T
*>
(
image_
->
imageData
+
r
*
image_
->
widthStep
);
}
inline
T
*
Row
(
int
r
)
{
return
reinterpret_cast
<
T
*>
(
image_
->
imageData
+
r
*
image_
->
widthStep
);
}
// Pixel accessors which returns a pointer to the start of the channel
inline
T
*
operator
()
(
int
c
,
int
r
)
{
return
reinterpret_cast
<
T
*>
(
image_
->
imageData
+
r
*
image_
->
widthStep
)
+
c
*
Channels
();
}
inline
const
T
*
operator
()
(
int
c
,
int
r
)
const
{
return
reinterpret_cast
<
T
*>
(
image_
->
imageData
+
r
*
image_
->
widthStep
)
+
c
*
Channels
();
}
// Copy the contents from another image which is just a convenience to cvCopy
void
CopyFrom
(
const
WImage
<
T
>&
src
)
{
cvCopy
(
src
.
Ipl
(),
image_
);
}
// Set contents to zero which is just a convenient to cvSetZero
void
SetZero
()
{
cvSetZero
(
image_
);
}
// Construct a view into a region of this image
WImageView
<
T
>
View
(
int
c
,
int
r
,
int
width
,
int
height
);
protected
:
// Disallow copy and assignment
WImage
(
const
WImage
&
);
void
operator
=
(
const
WImage
&
);
explicit
WImage
(
IplImage
*
img
)
:
image_
(
img
)
{
assert
(
!
img
||
img
->
depth
==
Depth
());
}
void
SetIpl
(
IplImage
*
image
)
{
assert
(
!
image
||
image
->
depth
==
Depth
());
image_
=
image
;
}
IplImage
*
image_
;
};
/** Image class when both the pixel type and number of channels
are known at compile time. This wrapper will speed up some of the operations
like accessing individual pixels using the () operator.
*/
template
<
typename
T
,
int
C
>
class
WImageC
:
public
WImage
<
T
>
{
public
:
typedef
typename
WImage
<
T
>::
BaseType
BaseType
;
enum
{
kChannels
=
C
};
explicit
WImageC
(
IplImage
*
img
)
:
WImage
<
T
>
(
img
)
{
assert
(
!
img
||
img
->
nChannels
==
Channels
());
}
// Construct a view into a region of this image
WImageViewC
<
T
,
C
>
View
(
int
c
,
int
r
,
int
width
,
int
height
);
// Copy the contents from another image which is just a convenience to cvCopy
void
CopyFrom
(
const
WImageC
<
T
,
C
>&
src
)
{
cvCopy
(
src
.
Ipl
(),
WImage
<
T
>::
image_
);
}
// WImageC is an abstract class with no other virtual methods so make the
// destructor virtual.
virtual
~
WImageC
()
=
0
;
int
Channels
()
const
{
return
C
;
}
protected
:
// Disallow copy and assignment
WImageC
(
const
WImageC
&
);
void
operator
=
(
const
WImageC
&
);
void
SetIpl
(
IplImage
*
image
)
{
assert
(
!
image
||
image
->
depth
==
WImage
<
T
>::
Depth
());
WImage
<
T
>::
SetIpl
(
image
);
}
};
/** Image class which owns the data, so it can be allocated and is always
freed. It cannot be copied but can be explicitly cloned.
*/
template
<
typename
T
>
class
WImageBuffer
:
public
WImage
<
T
>
{
public
:
typedef
typename
WImage
<
T
>::
BaseType
BaseType
;
// Default constructor which creates an object that can be
WImageBuffer
()
:
WImage
<
T
>
(
0
)
{}
WImageBuffer
(
int
width
,
int
height
,
int
nchannels
)
:
WImage
<
T
>
(
0
)
{
Allocate
(
width
,
height
,
nchannels
);
}
// Constructor which takes ownership of a given IplImage so releases
// the image on destruction.
explicit
WImageBuffer
(
IplImage
*
img
)
:
WImage
<
T
>
(
img
)
{}
// Allocate an image. Does nothing if current size is the same as
// the new size.
void
Allocate
(
int
width
,
int
height
,
int
nchannels
);
// Set the data to point to an image, releasing the old data
void
SetIpl
(
IplImage
*
img
)
{
ReleaseImage
();
WImage
<
T
>::
SetIpl
(
img
);
}
// Clone an image which reallocates the image if of a different dimension.
void
CloneFrom
(
const
WImage
<
T
>&
src
)
{
Allocate
(
src
.
Width
(),
src
.
Height
(),
src
.
Channels
());
CopyFrom
(
src
);
}
~
WImageBuffer
()
{
ReleaseImage
();
}
// Release the image if it isn't null.
void
ReleaseImage
()
{
if
(
WImage
<
T
>::
image_
)
{
IplImage
*
image
=
WImage
<
T
>::
image_
;
cvReleaseImage
(
&
image
);
WImage
<
T
>::
SetIpl
(
0
);
}
}
bool
IsNull
()
const
{
return
WImage
<
T
>::
image_
==
NULL
;
}
private
:
// Disallow copy and assignment
WImageBuffer
(
const
WImageBuffer
&
);
void
operator
=
(
const
WImageBuffer
&
);
};
/** Like a WImageBuffer class but when the number of channels is known at compile time.
*/
template
<
typename
T
,
int
C
>
class
WImageBufferC
:
public
WImageC
<
T
,
C
>
{
public
:
typedef
typename
WImage
<
T
>::
BaseType
BaseType
;
enum
{
kChannels
=
C
};
// Default constructor which creates an object that can be
WImageBufferC
()
:
WImageC
<
T
,
C
>
(
0
)
{}
WImageBufferC
(
int
width
,
int
height
)
:
WImageC
<
T
,
C
>
(
0
)
{
Allocate
(
width
,
height
);
}
// Constructor which takes ownership of a given IplImage so releases
// the image on destruction.
explicit
WImageBufferC
(
IplImage
*
img
)
:
WImageC
<
T
,
C
>
(
img
)
{}
// Allocate an image. Does nothing if current size is the same as
// the new size.
void
Allocate
(
int
width
,
int
height
);
// Set the data to point to an image, releasing the old data
void
SetIpl
(
IplImage
*
img
)
{
ReleaseImage
();
WImageC
<
T
,
C
>::
SetIpl
(
img
);
}
// Clone an image which reallocates the image if of a different dimension.
void
CloneFrom
(
const
WImageC
<
T
,
C
>&
src
)
{
Allocate
(
src
.
Width
(),
src
.
Height
());
CopyFrom
(
src
);
}
~
WImageBufferC
()
{
ReleaseImage
();
}
// Release the image if it isn't null.
void
ReleaseImage
()
{
if
(
WImage
<
T
>::
image_
)
{
IplImage
*
image
=
WImage
<
T
>::
image_
;
cvReleaseImage
(
&
image
);
WImageC
<
T
,
C
>::
SetIpl
(
0
);
}
}
bool
IsNull
()
const
{
return
WImage
<
T
>::
image_
==
NULL
;
}
private
:
// Disallow copy and assignment
WImageBufferC
(
const
WImageBufferC
&
);
void
operator
=
(
const
WImageBufferC
&
);
};
/** View into an image class which allows treating a subimage as an image or treating external data
as an image
*/
template
<
typename
T
>
class
WImageView
:
public
WImage
<
T
>
{
public
:
typedef
typename
WImage
<
T
>::
BaseType
BaseType
;
// Construct a subimage. No checks are done that the subimage lies
// completely inside the original image.
WImageView
(
WImage
<
T
>*
img
,
int
c
,
int
r
,
int
width
,
int
height
);
// Refer to external data.
// If not given width_step assumed to be same as width.
WImageView
(
T
*
data
,
int
width
,
int
height
,
int
channels
,
int
width_step
=
-
1
);
// Refer to external data. This does NOT take ownership
// of the supplied IplImage.
WImageView
(
IplImage
*
img
)
:
WImage
<
T
>
(
img
)
{}
// Copy constructor
WImageView
(
const
WImage
<
T
>&
img
)
:
WImage
<
T
>
(
0
)
{
header_
=
*
(
img
.
Ipl
());
WImage
<
T
>::
SetIpl
(
&
header_
);
}
WImageView
&
operator
=
(
const
WImage
<
T
>&
img
)
{
header_
=
*
(
img
.
Ipl
());
WImage
<
T
>::
SetIpl
(
&
header_
);
return
*
this
;
}
protected
:
IplImage
header_
;
};
template
<
typename
T
,
int
C
>
class
WImageViewC
:
public
WImageC
<
T
,
C
>
{
public
:
typedef
typename
WImage
<
T
>::
BaseType
BaseType
;
enum
{
kChannels
=
C
};
// Default constructor needed for vectors of views.
WImageViewC
();
virtual
~
WImageViewC
()
{}
// Construct a subimage. No checks are done that the subimage lies
// completely inside the original image.
WImageViewC
(
WImageC
<
T
,
C
>*
img
,
int
c
,
int
r
,
int
width
,
int
height
);
// Refer to external data
WImageViewC
(
T
*
data
,
int
width
,
int
height
,
int
width_step
=
-
1
);
// Refer to external data. This does NOT take ownership
// of the supplied IplImage.
WImageViewC
(
IplImage
*
img
)
:
WImageC
<
T
,
C
>
(
img
)
{}
// Copy constructor which does a shallow copy to allow multiple views
// of same data. gcc-4.1.1 gets confused if both versions of
// the constructor and assignment operator are not provided.
WImageViewC
(
const
WImageC
<
T
,
C
>&
img
)
:
WImageC
<
T
,
C
>
(
0
)
{
header_
=
*
(
img
.
Ipl
());
WImageC
<
T
,
C
>::
SetIpl
(
&
header_
);
}
WImageViewC
(
const
WImageViewC
<
T
,
C
>&
img
)
:
WImageC
<
T
,
C
>
(
0
)
{
header_
=
*
(
img
.
Ipl
());
WImageC
<
T
,
C
>::
SetIpl
(
&
header_
);
}
WImageViewC
&
operator
=
(
const
WImageC
<
T
,
C
>&
img
)
{
header_
=
*
(
img
.
Ipl
());
WImageC
<
T
,
C
>::
SetIpl
(
&
header_
);
return
*
this
;
}
WImageViewC
&
operator
=
(
const
WImageViewC
<
T
,
C
>&
img
)
{
header_
=
*
(
img
.
Ipl
());
WImageC
<
T
,
C
>::
SetIpl
(
&
header_
);
return
*
this
;
}
protected
:
IplImage
header_
;
};
// Specializations for depth
template
<>
inline
int
WImage
<
uchar
>::
Depth
()
const
{
return
IPL_DEPTH_8U
;
}
template
<>
inline
int
WImage
<
signed
char
>::
Depth
()
const
{
return
IPL_DEPTH_8S
;
}
template
<>
inline
int
WImage
<
short
>::
Depth
()
const
{
return
IPL_DEPTH_16S
;
}
template
<>
inline
int
WImage
<
ushort
>::
Depth
()
const
{
return
IPL_DEPTH_16U
;
}
template
<>
inline
int
WImage
<
int
>::
Depth
()
const
{
return
IPL_DEPTH_32S
;
}
template
<>
inline
int
WImage
<
float
>::
Depth
()
const
{
return
IPL_DEPTH_32F
;
}
template
<>
inline
int
WImage
<
double
>::
Depth
()
const
{
return
IPL_DEPTH_64F
;
}
template
<
typename
T
>
inline
WImage
<
T
>::~
WImage
()
{}
template
<
typename
T
,
int
C
>
inline
WImageC
<
T
,
C
>::~
WImageC
()
{}
template
<
typename
T
>
inline
void
WImageBuffer
<
T
>::
Allocate
(
int
width
,
int
height
,
int
nchannels
)
{
if
(
IsNull
()
||
WImage
<
T
>::
Width
()
!=
width
||
WImage
<
T
>::
Height
()
!=
height
||
WImage
<
T
>::
Channels
()
!=
nchannels
)
{
ReleaseImage
();
WImage
<
T
>::
image_
=
cvCreateImage
(
cvSize
(
width
,
height
),
WImage
<
T
>::
Depth
(),
nchannels
);
}
}
template
<
typename
T
,
int
C
>
inline
void
WImageBufferC
<
T
,
C
>::
Allocate
(
int
width
,
int
height
)
{
if
(
IsNull
()
||
WImage
<
T
>::
Width
()
!=
width
||
WImage
<
T
>::
Height
()
!=
height
)
{
ReleaseImage
();
WImageC
<
T
,
C
>::
SetIpl
(
cvCreateImage
(
cvSize
(
width
,
height
),
WImage
<
T
>::
Depth
(),
C
));
}
}
template
<
typename
T
>
WImageView
<
T
>::
WImageView
(
WImage
<
T
>*
img
,
int
c
,
int
r
,
int
width
,
int
height
)
:
WImage
<
T
>
(
0
)
{
header_
=
*
(
img
->
Ipl
());
header_
.
imageData
=
reinterpret_cast
<
char
*>
((
*
img
)(
c
,
r
));
header_
.
width
=
width
;
header_
.
height
=
height
;
WImage
<
T
>::
SetIpl
(
&
header_
);
}
template
<
typename
T
>
WImageView
<
T
>::
WImageView
(
T
*
data
,
int
width
,
int
height
,
int
nchannels
,
int
width_step
)
:
WImage
<
T
>
(
0
)
{
cvInitImageHeader
(
&
header_
,
cvSize
(
width
,
height
),
WImage
<
T
>::
Depth
(),
nchannels
);
header_
.
imageData
=
reinterpret_cast
<
char
*>
(
data
);
if
(
width_step
>
0
)
{
header_
.
widthStep
=
width_step
;
}
WImage
<
T
>::
SetIpl
(
&
header_
);
}
template
<
typename
T
,
int
C
>
WImageViewC
<
T
,
C
>::
WImageViewC
(
WImageC
<
T
,
C
>*
img
,
int
c
,
int
r
,
int
width
,
int
height
)
:
WImageC
<
T
,
C
>
(
0
)
{
header_
=
*
(
img
->
Ipl
());
header_
.
imageData
=
reinterpret_cast
<
char
*>
((
*
img
)(
c
,
r
));
header_
.
width
=
width
;
header_
.
height
=
height
;
WImageC
<
T
,
C
>::
SetIpl
(
&
header_
);
}
template
<
typename
T
,
int
C
>
WImageViewC
<
T
,
C
>::
WImageViewC
()
:
WImageC
<
T
,
C
>
(
0
)
{
cvInitImageHeader
(
&
header_
,
cvSize
(
0
,
0
),
WImage
<
T
>::
Depth
(),
C
);
header_
.
imageData
=
reinterpret_cast
<
char
*>
(
0
);
WImageC
<
T
,
C
>::
SetIpl
(
&
header_
);
}
template
<
typename
T
,
int
C
>
WImageViewC
<
T
,
C
>::
WImageViewC
(
T
*
data
,
int
width
,
int
height
,
int
width_step
)
:
WImageC
<
T
,
C
>
(
0
)
{
cvInitImageHeader
(
&
header_
,
cvSize
(
width
,
height
),
WImage
<
T
>::
Depth
(),
C
);
header_
.
imageData
=
reinterpret_cast
<
char
*>
(
data
);
if
(
width_step
>
0
)
{
header_
.
widthStep
=
width_step
;
}
WImageC
<
T
,
C
>::
SetIpl
(
&
header_
);
}
// Construct a view into a region of an image
template
<
typename
T
>
WImageView
<
T
>
WImage
<
T
>::
View
(
int
c
,
int
r
,
int
width
,
int
height
)
{
return
WImageView
<
T
>
(
this
,
c
,
r
,
width
,
height
);
}
template
<
typename
T
,
int
C
>
WImageViewC
<
T
,
C
>
WImageC
<
T
,
C
>::
View
(
int
c
,
int
r
,
int
width
,
int
height
)
{
return
WImageViewC
<
T
,
C
>
(
this
,
c
,
r
,
width
,
height
);
}
//! @} core
}
// end of namespace
#endif // __cplusplus
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment