diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..1ff0c4230 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore index bdc3535f7..6c1515449 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,9 @@ TestResults # Build results [Dd]ebug/ [Rr]elease/ -x64/ +#x64/ +OpenCvSharpExtern/x64 +OpenCvSharpExternGpu/x64 *_i.c *_p.c *.ilk @@ -106,3 +108,10 @@ Generated_Code #added for RIA/Silverlight projects _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML +Help JP +Help EN +/src/Release-Static +/src/OpenCvSharpExtern/Release-Static +*.db +/src/OpenCvSharp.Sandbox/dll/x86/OpenCvSharpExtern.dll +/src/*.opendb diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 6600f1c98..000000000 --- a/LICENSE +++ /dev/null @@ -1,165 +0,0 @@ -GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 000000000..513efb3d1 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,33 @@ +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 + (3-clause BSD License) + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met + + Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + andor other materials provided with the distribution. + + Neither the names of the copyright holders nor the names of the contributors + may 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 copyright holders 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. \ No newline at end of file diff --git a/README.md b/README.md index e1e977f07..1905542eb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,74 @@ -opencvsharp -=========== +#OpenCvSharp +Cross platform wrapper of OpenCV for .NET Framework. -OpenCV wrapper for .NET Framework +OpenCVを.NET Frameworkから利用するための、クロスプラットフォームで動作するラッパーです。 + +## Installation +### NuGet +If you have Visual Studio 2012 or later, it is recommended to use [NuGet](http://www.nuget.org/). Search *'opencvsharp'* on the NuGet Package Manager. + +* [OpenCV3.1 All-in-one package](https://www.nuget.org/packages/OpenCvSharp3-AnyCPU/) - bundles native OpenCV DLLs +* [OpenCV3.1 Minimum package](https://www.nuget.org/packages/OpenCvSharp3-WithoutDll/) +* [OpenCV2.4.10 All-in-one package](https://www.nuget.org/packages/OpenCvSharp-AnyCPU/) - bundles native OpenCV DLLs +* [OpenCV2.4.10 Minimum package](https://www.nuget.org/packages/OpenCvSharp-WithoutDll/) + +### Downloads +If you do not use NuGet, get DLL files from the [release page](https://github.com/shimat/opencvsharp/releases). + +## Requirements +* [OpenCV 3.1 / 2.4.10](http://opencv.org/) +* [Visual C++ 2013 Redistributable Package](http://www.microsoft.com/en-US/download/details.aspx?id=30679) +* [.NET Framework 2.0](http://www.microsoft.com/ja-jp/download/details.aspx?id=1639) or later / [Mono](http://www.mono-project.com/Main_Page) + +On Windows, OpenCvSharp requires OpenCV DLL files built with VC++2013 (msvcr120.dll). The official pre-built DLL files in build/[x86 or x64]/vc12/bin are suitable. + +## Documents +http://shimat.github.io/opencvsharp/ + +## Usage +For more details, see the **[Wiki](https://github.com/shimat/opencvsharp/wiki)** page. + +```C# +// Edge detection by Canny algorithm +using OpenCvSharp; +// using OpenCvSharp.CPlusPlus; //for OpenCvSharp2 + +class Program +{ + static void Main() + { + Mat src = new Mat("lenna.png", ImreadModes.GrayScale); // OpenCvSharp 3.x + //Mat src = new Mat("lenna.png", LoadMode.GrayScale); // OpenCvSharp 2.4.x + Mat dst = new Mat(); + + Cv2.Canny(src, dst, 50, 200); + using (new Window("src image", src)) + using (new Window("dst image", dst)) + { + Cv2.WaitKey(); + } + } +} +``` + +## Features +* OpenCvSharp is modeled on the native OpenCV C/C++ API style as much as possible. +* Many classes of OpenCvSharp implement IDisposable. There is no need to manage unsafe resources. +* OpenCvSharp does not force object-oriented programming style on you. You can also call native-style OpenCV functions. +* OpenCvSharp provides functions for converting from Mat/IplImage into Bitmap(GDI+) or WriteableBitmap(WPF). +* OpenCvSharp can work on [Mono](http://www.mono-project.com/Main_Page). It can run on any platform which [Mono](http://www.mono-project.com/Main_Page) supports (e.g. Linux). + +----- + +* オリジナルのC/C++コードと可能な限り似た記述ができるように設計しています。 +* 多くのクラスがIDisposableインターフェイスを実装しているので、ネイティブリソース管理が容易です。 +* オブジェクト指向な書き方を強制しません。OpenCVのネイティブの関数をそのままの形式で呼べます。 +* GDI+やWPFとの相互利用が可能です。OpenCVのMat/IplImageとGDI+のBitmapやWPFのWriteableBitmapとの変換機能があります。 +* [Mono](http://www.mono-project.com/Main_Page)に対応しています。Linux等のクロスプラットフォームで動作します。 + + +## License +OpenCvSharp is licensed under the +**BSD 3-Clause License**. See [LICENSE.txt](https://github.com/shimat/opencvsharp/blob/master/LICENSE.txt). + +OpenCvSharp.Blob uses [cvBlob](https://code.google.com/p/cvblob/) to implement blob extraction. diff --git a/doc/OpenCvSharp_EN.shfbproj b/doc/OpenCvSharp_EN.shfbproj new file mode 100644 index 000000000..b04e64abd --- /dev/null +++ b/doc/OpenCvSharp_EN.shfbproj @@ -0,0 +1,62 @@ + + + + + Debug + AnyCPU + 2.0 + {69e191e1-d2ff-4983-be76-e92456997fa6} + 1.9.9.0 + + Documentation + Documentation + Documentation + + .\Help EN\ + Documentation + .NET Framework 3.5 + HtmlHelp1, Website + OpenCV wrapper for .NET Framework + OpenCvSharp Class Library + en-US + + + + + + + + + + + + + + OnlyWarningsAndErrors + True + True + False + True + True + 2 + False + Standard + Blank + False + VS2010 + False + Guid + AboveNamespaces + + + + + + + + + \ No newline at end of file diff --git a/doc/OpenCvSharp_JP.shfbproj b/doc/OpenCvSharp_JP.shfbproj new file mode 100644 index 000000000..6fd5868d4 --- /dev/null +++ b/doc/OpenCvSharp_JP.shfbproj @@ -0,0 +1,62 @@ + + + + + Debug + AnyCPU + 2.0 + {69e191e1-d2ff-4983-be76-e92456997fa6} + 1.9.9.0 + + Documentation + Documentation + Documentation + + .\Help JP\ + Documentation + .NET Framework 3.5 + HtmlHelp1, Website + OpenCV wrapper for .NET Framework + OpenCvSharp Class Library + ja-JP + + + + + + + + + + + + + + OnlyWarningsAndErrors + True + True + False + True + True + 2 + False + C#, Managed C++ + Blank + False + VS2010 + False + Guid + BelowNamespaces + + + + + + + + + \ No newline at end of file diff --git a/help/OpenCvSharp.shfbproj b/help/OpenCvSharp.shfbproj new file mode 100644 index 000000000..2b0a8b40e --- /dev/null +++ b/help/OpenCvSharp.shfbproj @@ -0,0 +1,77 @@ + + + + + Debug + AnyCPU + 2.0 + {5cbd22b4-2d40-4629-9138-cf3dd157ee3e} + 2015.6.5.0 + + Documentation + Documentation + Documentation + + .NET Framework 4.5 + .\Help\ + Documentation + en-US + OnlyWarningsAndErrors + HtmlHelp1, Website + False + True + False + True + AutoDocumentCtors, AutoDocumentDispose + + + + + + + + + + 1.0.0.0 + 2 + False + C#, Visual Basic, Managed C++, F#, JavaScript + Blank + False + VS2013 + False + Guid + A Sandcastle Documented Class Library + AboveNamespaces + + + + + + + + + + + + + + + + + + + + + + + + + + + OnBuildSuccess + + \ No newline at end of file diff --git a/lib/opencv/include/opencv/cv.h b/lib/opencv/include/opencv/cv.h new file mode 100644 index 000000000..0aefc6d27 --- /dev/null +++ b/lib/opencv/include/opencv/cv.h @@ -0,0 +1,73 @@ +/*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_ diff --git a/lib/opencv/include/opencv/cv.hpp b/lib/opencv/include/opencv/cv.hpp new file mode 100644 index 000000000..e498d7ac1 --- /dev/null +++ b/lib/opencv/include/opencv/cv.hpp @@ -0,0 +1,60 @@ +/*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 diff --git a/lib/opencv/include/opencv/cvaux.h b/lib/opencv/include/opencv/cvaux.h new file mode 100644 index 000000000..fe86c5d98 --- /dev/null +++ b/lib/opencv/include/opencv/cvaux.h @@ -0,0 +1,57 @@ +/*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. */ diff --git a/lib/opencv/include/opencv/cvaux.hpp b/lib/opencv/include/opencv/cvaux.hpp new file mode 100644 index 000000000..b0e60a303 --- /dev/null +++ b/lib/opencv/include/opencv/cvaux.hpp @@ -0,0 +1,52 @@ +/*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 diff --git a/lib/opencv/include/opencv/cvwimage.h b/lib/opencv/include/opencv/cvwimage.h new file mode 100644 index 000000000..de89c9270 --- /dev/null +++ b/lib/opencv/include/opencv/cvwimage.h @@ -0,0 +1,46 @@ +/////////////////////////////////////////////////////////////////////////////// +// 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 diff --git a/lib/opencv/include/opencv/cxcore.h b/lib/opencv/include/opencv/cxcore.h new file mode 100644 index 000000000..0982bd750 --- /dev/null +++ b/lib/opencv/include/opencv/cxcore.h @@ -0,0 +1,52 @@ +/*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 diff --git a/lib/opencv/include/opencv/cxcore.hpp b/lib/opencv/include/opencv/cxcore.hpp new file mode 100644 index 000000000..9af4ac746 --- /dev/null +++ b/lib/opencv/include/opencv/cxcore.hpp @@ -0,0 +1,53 @@ +/*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 diff --git a/lib/opencv/include/opencv/cxeigen.hpp b/lib/opencv/include/opencv/cxeigen.hpp new file mode 100644 index 000000000..1f04d1a3a --- /dev/null +++ b/lib/opencv/include/opencv/cxeigen.hpp @@ -0,0 +1,48 @@ +/*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 diff --git a/lib/opencv/include/opencv/cxmisc.h b/lib/opencv/include/opencv/cxmisc.h new file mode 100644 index 000000000..6c93a0cce --- /dev/null +++ b/lib/opencv/include/opencv/cxmisc.h @@ -0,0 +1,8 @@ +#ifndef __OPENCV_OLD_CXMISC_H__ +#define __OPENCV_OLD_CXMISC_H__ + +#ifdef __cplusplus +# include "opencv2/core/utility.hpp" +#endif + +#endif diff --git a/lib/opencv/include/opencv/highgui.h b/lib/opencv/include/opencv/highgui.h new file mode 100644 index 000000000..0261029c0 --- /dev/null +++ b/lib/opencv/include/opencv/highgui.h @@ -0,0 +1,48 @@ +/*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 diff --git a/lib/opencv/include/opencv/ml.h b/lib/opencv/include/opencv/ml.h new file mode 100644 index 000000000..d8e967f81 --- /dev/null +++ b/lib/opencv/include/opencv/ml.h @@ -0,0 +1,47 @@ +/*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 diff --git a/lib/opencv/include/opencv2/calib3d.hpp b/lib/opencv/include/opencv2/calib3d.hpp new file mode 100644 index 000000000..ddffffecd --- /dev/null +++ b/lib/opencv/include/opencv2/calib3d.hpp @@ -0,0 +1,2001 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_CALIB3D_HPP__ +#define __OPENCV_CALIB3D_HPP__ + +#include "opencv2/core.hpp" +#include "opencv2/features2d.hpp" +#include "opencv2/core/affine.hpp" + +/** + @defgroup calib3d Camera Calibration and 3D Reconstruction + +The functions in this section use a so-called pinhole camera model. In this model, a scene view is +formed by projecting 3D points into the image plane using a perspective transformation. + +\f[s \; m' = A [R|t] M'\f] + +or + +\f[s \vecthree{u}{v}{1} = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1} +\begin{bmatrix} +r_{11} & r_{12} & r_{13} & t_1 \\ +r_{21} & r_{22} & r_{23} & t_2 \\ +r_{31} & r_{32} & r_{33} & t_3 +\end{bmatrix} +\begin{bmatrix} +X \\ +Y \\ +Z \\ +1 +\end{bmatrix}\f] + +where: + +- \f$(X, Y, Z)\f$ are the coordinates of a 3D point in the world coordinate space +- \f$(u, v)\f$ are the coordinates of the projection point in pixels +- \f$A\f$ is a camera matrix, or a matrix of intrinsic parameters +- \f$(cx, cy)\f$ is a principal point that is usually at the image center +- \f$fx, fy\f$ are the focal lengths expressed in pixel units. + +Thus, if an image from the camera is scaled by a factor, all of these parameters should be scaled +(multiplied/divided, respectively) by the same factor. The matrix of intrinsic parameters does not +depend on the scene viewed. So, once estimated, it can be re-used as long as the focal length is +fixed (in case of zoom lens). The joint rotation-translation matrix \f$[R|t]\f$ is called a matrix of +extrinsic parameters. It is used to describe the camera motion around a static scene, or vice versa, +rigid motion of an object in front of a still camera. That is, \f$[R|t]\f$ translates coordinates of a +point \f$(X, Y, Z)\f$ to a coordinate system, fixed with respect to the camera. The transformation above +is equivalent to the following (when \f$z \ne 0\f$ ): + +\f[\begin{array}{l} +\vecthree{x}{y}{z} = R \vecthree{X}{Y}{Z} + t \\ +x' = x/z \\ +y' = y/z \\ +u = f_x*x' + c_x \\ +v = f_y*y' + c_y +\end{array}\f] + +Real lenses usually have some distortion, mostly radial distortion and slight tangential distortion. +So, the above model is extended as: + +\f[\begin{array}{l} +\vecthree{x}{y}{z} = R \vecthree{X}{Y}{Z} + t \\ +x' = x/z \\ +y' = y/z \\ +x'' = x' \frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6} + 2 p_1 x' y' + p_2(r^2 + 2 x'^2) + s_1 r^2 + s_2 r^4 \\ +y'' = y' \frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6} + p_1 (r^2 + 2 y'^2) + 2 p_2 x' y' + s_3 r^2 + s_4 r^4 \\ +\text{where} \quad r^2 = x'^2 + y'^2 \\ +u = f_x*x'' + c_x \\ +v = f_y*y'' + c_y +\end{array}\f] + +\f$k_1\f$, \f$k_2\f$, \f$k_3\f$, \f$k_4\f$, \f$k_5\f$, and \f$k_6\f$ are radial distortion coefficients. \f$p_1\f$ and \f$p_2\f$ are +tangential distortion coefficients. \f$s_1\f$, \f$s_2\f$, \f$s_3\f$, and \f$s_4\f$, are the thin prism distortion +coefficients. Higher-order coefficients are not considered in OpenCV. + +In some cases the image sensor may be tilted in order to focus an oblique plane in front of the +camera (Scheimpfug condition). This can be useful for particle image velocimetry (PIV) or +triangulation with a laser fan. The tilt causes a perspective distortion of \f$x''\f$ and +\f$y''\f$. This distortion can be modelled in the following way, see e.g. @cite Louhichi07. + +\f[\begin{array}{l} +s\vecthree{x'''}{y'''}{1} = +\vecthreethree{R_{33}(\tau_x, \tau_y)}{0}{-R_{13}(\tau_x, \tau_y)} +{0}{R_{33}(\tau_x, \tau_y)}{-R_{23}(\tau_x, \tau_y)} +{0}{0}{1} R(\tau_x, \tau_y) \vecthree{x''}{y''}{1}\\ +u = f_x*x''' + c_x \\ +v = f_y*y''' + c_y +\end{array}\f] + +where the matrix \f$R(\tau_x, \tau_y)\f$ is defined by two rotations with angular parameter \f$\tau_x\f$ +and \f$\tau_y\f$, respectively, + +\f[ +R(\tau_x, \tau_y) = +\vecthreethree{\cos(\tau_y)}{0}{-\sin(\tau_y)}{0}{1}{0}{\sin(\tau_y)}{0}{\cos(\tau_y)} +\vecthreethree{1}{0}{0}{0}{\cos(\tau_x)}{\sin(\tau_x)}{0}{-\sin(\tau_x)}{\cos(\tau_x)} = +\vecthreethree{\cos(\tau_y)}{\sin(\tau_y)\sin(\tau_x)}{-\sin(\tau_y)\cos(\tau_x)} +{0}{\cos(\tau_x)}{\sin(\tau_x)} +{\sin(\tau_y)}{-\cos(\tau_y)\sin(\tau_x)}{\cos(\tau_y)\cos(\tau_x)}. +\f] + +In the functions below the coefficients are passed or returned as + +\f[(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f] + +vector. That is, if the vector contains four elements, it means that \f$k_3=0\f$ . The distortion +coefficients do not depend on the scene viewed. Thus, they also belong to the intrinsic camera +parameters. And they remain the same regardless of the captured image resolution. If, for example, a +camera has been calibrated on images of 320 x 240 resolution, absolutely the same distortion +coefficients can be used for 640 x 480 images from the same camera while \f$f_x\f$, \f$f_y\f$, \f$c_x\f$, and +\f$c_y\f$ need to be scaled appropriately. + +The functions below use the above model to do the following: + +- Project 3D points to the image plane given intrinsic and extrinsic parameters. +- Compute extrinsic parameters given intrinsic parameters, a few 3D points, and their +projections. +- Estimate intrinsic and extrinsic camera parameters from several views of a known calibration +pattern (every view is described by several 3D-2D point correspondences). +- Estimate the relative position and orientation of the stereo camera "heads" and compute the +*rectification* transformation that makes the camera optical axes parallel. + +@note + - A calibration sample for 3 cameras in horizontal position can be found at + opencv_source_code/samples/cpp/3calibration.cpp + - A calibration sample based on a sequence of images can be found at + opencv_source_code/samples/cpp/calibration.cpp + - A calibration sample in order to do 3D reconstruction can be found at + opencv_source_code/samples/cpp/build3dmodel.cpp + - A calibration sample of an artificially generated camera and chessboard patterns can be + found at opencv_source_code/samples/cpp/calibration_artificial.cpp + - A calibration example on stereo calibration can be found at + opencv_source_code/samples/cpp/stereo_calib.cpp + - A calibration example on stereo matching can be found at + opencv_source_code/samples/cpp/stereo_match.cpp + - (Python) A camera calibration sample can be found at + opencv_source_code/samples/python/calibrate.py + + @{ + @defgroup calib3d_fisheye Fisheye camera model + + Definitions: Let P be a point in 3D of coordinates X in the world reference frame (stored in the + matrix X) The coordinate vector of P in the camera reference frame is: + + \f[Xc = R X + T\f] + + where R is the rotation matrix corresponding to the rotation vector om: R = rodrigues(om); call x, y + and z the 3 coordinates of Xc: + + \f[x = Xc_1 \\ y = Xc_2 \\ z = Xc_3\f] + + The pinehole projection coordinates of P is [a; b] where + + \f[a = x / z \ and \ b = y / z \\ r^2 = a^2 + b^2 \\ \theta = atan(r)\f] + + Fisheye distortion: + + \f[\theta_d = \theta (1 + k_1 \theta^2 + k_2 \theta^4 + k_3 \theta^6 + k_4 \theta^8)\f] + + The distorted point coordinates are [x'; y'] where + + \f[x' = (\theta_d / r) x \\ y' = (\theta_d / r) y \f] + + Finally, conversion into pixel coordinates: The final pixel coordinates vector [u; v] where: + + \f[u = f_x (x' + \alpha y') + c_x \\ + v = f_y yy + c_y\f] + + @defgroup calib3d_c C API + + @} + */ + +namespace cv +{ + +//! @addtogroup calib3d +//! @{ + +//! type of the robust estimation algorithm +enum { LMEDS = 4, //!< least-median algorithm + RANSAC = 8, //!< RANSAC algorithm + RHO = 16 //!< RHO algorithm + }; + +enum { SOLVEPNP_ITERATIVE = 0, + SOLVEPNP_EPNP = 1, //!< EPnP: Efficient Perspective-n-Point Camera Pose Estimation @cite lepetit2009epnp + SOLVEPNP_P3P = 2, //!< Complete Solution Classification for the Perspective-Three-Point Problem @cite gao2003complete + SOLVEPNP_DLS = 3, //!< A Direct Least-Squares (DLS) Method for PnP @cite hesch2011direct + SOLVEPNP_UPNP = 4 //!< Exhaustive Linearization for Robust Camera Pose and Focal Length Estimation @cite penate2013exhaustive + +}; + +enum { CALIB_CB_ADAPTIVE_THRESH = 1, + CALIB_CB_NORMALIZE_IMAGE = 2, + CALIB_CB_FILTER_QUADS = 4, + CALIB_CB_FAST_CHECK = 8 + }; + +enum { CALIB_CB_SYMMETRIC_GRID = 1, + CALIB_CB_ASYMMETRIC_GRID = 2, + CALIB_CB_CLUSTERING = 4 + }; + +enum { CALIB_USE_INTRINSIC_GUESS = 0x00001, + CALIB_FIX_ASPECT_RATIO = 0x00002, + CALIB_FIX_PRINCIPAL_POINT = 0x00004, + CALIB_ZERO_TANGENT_DIST = 0x00008, + CALIB_FIX_FOCAL_LENGTH = 0x00010, + CALIB_FIX_K1 = 0x00020, + CALIB_FIX_K2 = 0x00040, + CALIB_FIX_K3 = 0x00080, + CALIB_FIX_K4 = 0x00800, + CALIB_FIX_K5 = 0x01000, + CALIB_FIX_K6 = 0x02000, + CALIB_RATIONAL_MODEL = 0x04000, + CALIB_THIN_PRISM_MODEL = 0x08000, + CALIB_FIX_S1_S2_S3_S4 = 0x10000, + CALIB_TILTED_MODEL = 0x40000, + CALIB_FIX_TAUX_TAUY = 0x80000, + // only for stereo + CALIB_FIX_INTRINSIC = 0x00100, + CALIB_SAME_FOCAL_LENGTH = 0x00200, + // for stereo rectification + CALIB_ZERO_DISPARITY = 0x00400, + CALIB_USE_LU = (1 << 17), //!< use LU instead of SVD decomposition for solving. much faster but potentially less precise + }; + +//! the algorithm for finding fundamental matrix +enum { FM_7POINT = 1, //!< 7-point algorithm + FM_8POINT = 2, //!< 8-point algorithm + FM_LMEDS = 4, //!< least-median algorithm + FM_RANSAC = 8 //!< RANSAC algorithm + }; + + + +/** @brief Converts a rotation matrix to a rotation vector or vice versa. + +@param src Input rotation vector (3x1 or 1x3) or rotation matrix (3x3). +@param dst Output rotation matrix (3x3) or rotation vector (3x1 or 1x3), respectively. +@param jacobian Optional output Jacobian matrix, 3x9 or 9x3, which is a matrix of partial +derivatives of the output array components with respect to the input array components. + +\f[\begin{array}{l} \theta \leftarrow norm(r) \\ r \leftarrow r/ \theta \\ R = \cos{\theta} I + (1- \cos{\theta} ) r r^T + \sin{\theta} \vecthreethree{0}{-r_z}{r_y}{r_z}{0}{-r_x}{-r_y}{r_x}{0} \end{array}\f] + +Inverse transformation can be also done easily, since + +\f[\sin ( \theta ) \vecthreethree{0}{-r_z}{r_y}{r_z}{0}{-r_x}{-r_y}{r_x}{0} = \frac{R - R^T}{2}\f] + +A rotation vector is a convenient and most compact representation of a rotation matrix (since any +rotation matrix has just 3 degrees of freedom). The representation is used in the global 3D geometry +optimization procedures like calibrateCamera, stereoCalibrate, or solvePnP . + */ +CV_EXPORTS_W void Rodrigues( InputArray src, OutputArray dst, OutputArray jacobian = noArray() ); + +/** @brief Finds a perspective transformation between two planes. + +@param srcPoints Coordinates of the points in the original plane, a matrix of the type CV_32FC2 +or vector\ . +@param dstPoints Coordinates of the points in the target plane, a matrix of the type CV_32FC2 or +a vector\ . +@param method Method used to computed a homography matrix. The following methods are possible: +- **0** - a regular method using all the points +- **RANSAC** - RANSAC-based robust method +- **LMEDS** - Least-Median robust method +- **RHO** - PROSAC-based robust method +@param ransacReprojThreshold Maximum allowed reprojection error to treat a point pair as an inlier +(used in the RANSAC and RHO methods only). That is, if +\f[\| \texttt{dstPoints} _i - \texttt{convertPointsHomogeneous} ( \texttt{H} * \texttt{srcPoints} _i) \| > \texttt{ransacReprojThreshold}\f] +then the point \f$i\f$ is considered an outlier. If srcPoints and dstPoints are measured in pixels, +it usually makes sense to set this parameter somewhere in the range of 1 to 10. +@param mask Optional output mask set by a robust method ( RANSAC or LMEDS ). Note that the input +mask values are ignored. +@param maxIters The maximum number of RANSAC iterations, 2000 is the maximum it can be. +@param confidence Confidence level, between 0 and 1. + +The functions find and return the perspective transformation \f$H\f$ between the source and the +destination planes: + +\f[s_i \vecthree{x'_i}{y'_i}{1} \sim H \vecthree{x_i}{y_i}{1}\f] + +so that the back-projection error + +\f[\sum _i \left ( x'_i- \frac{h_{11} x_i + h_{12} y_i + h_{13}}{h_{31} x_i + h_{32} y_i + h_{33}} \right )^2+ \left ( y'_i- \frac{h_{21} x_i + h_{22} y_i + h_{23}}{h_{31} x_i + h_{32} y_i + h_{33}} \right )^2\f] + +is minimized. If the parameter method is set to the default value 0, the function uses all the point +pairs to compute an initial homography estimate with a simple least-squares scheme. + +However, if not all of the point pairs ( \f$srcPoints_i\f$, \f$dstPoints_i\f$ ) fit the rigid perspective +transformation (that is, there are some outliers), this initial estimate will be poor. In this case, +you can use one of the three robust methods. The methods RANSAC, LMeDS and RHO try many different +random subsets of the corresponding point pairs (of four pairs each), estimate the homography matrix +using this subset and a simple least-square algorithm, and then compute the quality/goodness of the +computed homography (which is the number of inliers for RANSAC or the median re-projection error for +LMeDs). The best subset is then used to produce the initial estimate of the homography matrix and +the mask of inliers/outliers. + +Regardless of the method, robust or not, the computed homography matrix is refined further (using +inliers only in case of a robust method) with the Levenberg-Marquardt method to reduce the +re-projection error even more. + +The methods RANSAC and RHO can handle practically any ratio of outliers but need a threshold to +distinguish inliers from outliers. The method LMeDS does not need any threshold but it works +correctly only when there are more than 50% of inliers. Finally, if there are no outliers and the +noise is rather small, use the default method (method=0). + +The function is used to find initial intrinsic and extrinsic matrices. Homography matrix is +determined up to a scale. Thus, it is normalized so that \f$h_{33}=1\f$. Note that whenever an H matrix +cannot be estimated, an empty one will be returned. + +@sa + getAffineTransform, getPerspectiveTransform, estimateRigidTransform, warpPerspective, + perspectiveTransform + +@note + - A example on calculating a homography for image matching can be found at + opencv_source_code/samples/cpp/video_homography.cpp + + */ +CV_EXPORTS_W Mat findHomography( InputArray srcPoints, InputArray dstPoints, + int method = 0, double ransacReprojThreshold = 3, + OutputArray mask=noArray(), const int maxIters = 2000, + const double confidence = 0.995); + +/** @overload */ +CV_EXPORTS Mat findHomography( InputArray srcPoints, InputArray dstPoints, + OutputArray mask, int method = 0, double ransacReprojThreshold = 3 ); + +/** @brief Computes an RQ decomposition of 3x3 matrices. + +@param src 3x3 input matrix. +@param mtxR Output 3x3 upper-triangular matrix. +@param mtxQ Output 3x3 orthogonal matrix. +@param Qx Optional output 3x3 rotation matrix around x-axis. +@param Qy Optional output 3x3 rotation matrix around y-axis. +@param Qz Optional output 3x3 rotation matrix around z-axis. + +The function computes a RQ decomposition using the given rotations. This function is used in +decomposeProjectionMatrix to decompose the left 3x3 submatrix of a projection matrix into a camera +and a rotation matrix. + +It optionally returns three rotation matrices, one for each axis, and the three Euler angles in +degrees (as the return value) that could be used in OpenGL. Note, there is always more than one +sequence of rotations about the three principle axes that results in the same orientation of an +object, eg. see @cite Slabaugh . Returned tree rotation matrices and corresponding three Euler angules +are only one of the possible solutions. + */ +CV_EXPORTS_W Vec3d RQDecomp3x3( InputArray src, OutputArray mtxR, OutputArray mtxQ, + OutputArray Qx = noArray(), + OutputArray Qy = noArray(), + OutputArray Qz = noArray()); + +/** @brief Decomposes a projection matrix into a rotation matrix and a camera matrix. + +@param projMatrix 3x4 input projection matrix P. +@param cameraMatrix Output 3x3 camera matrix K. +@param rotMatrix Output 3x3 external rotation matrix R. +@param transVect Output 4x1 translation vector T. +@param rotMatrixX Optional 3x3 rotation matrix around x-axis. +@param rotMatrixY Optional 3x3 rotation matrix around y-axis. +@param rotMatrixZ Optional 3x3 rotation matrix around z-axis. +@param eulerAngles Optional three-element vector containing three Euler angles of rotation in +degrees. + +The function computes a decomposition of a projection matrix into a calibration and a rotation +matrix and the position of a camera. + +It optionally returns three rotation matrices, one for each axis, and three Euler angles that could +be used in OpenGL. Note, there is always more than one sequence of rotations about the three +principle axes that results in the same orientation of an object, eg. see @cite Slabaugh . Returned +tree rotation matrices and corresponding three Euler angules are only one of the possible solutions. + +The function is based on RQDecomp3x3 . + */ +CV_EXPORTS_W void decomposeProjectionMatrix( InputArray projMatrix, OutputArray cameraMatrix, + OutputArray rotMatrix, OutputArray transVect, + OutputArray rotMatrixX = noArray(), + OutputArray rotMatrixY = noArray(), + OutputArray rotMatrixZ = noArray(), + OutputArray eulerAngles =noArray() ); + +/** @brief Computes partial derivatives of the matrix product for each multiplied matrix. + +@param A First multiplied matrix. +@param B Second multiplied matrix. +@param dABdA First output derivative matrix d(A\*B)/dA of size +\f$\texttt{A.rows*B.cols} \times {A.rows*A.cols}\f$ . +@param dABdB Second output derivative matrix d(A\*B)/dB of size +\f$\texttt{A.rows*B.cols} \times {B.rows*B.cols}\f$ . + +The function computes partial derivatives of the elements of the matrix product \f$A*B\f$ with regard to +the elements of each of the two input matrices. The function is used to compute the Jacobian +matrices in stereoCalibrate but can also be used in any other similar optimization function. + */ +CV_EXPORTS_W void matMulDeriv( InputArray A, InputArray B, OutputArray dABdA, OutputArray dABdB ); + +/** @brief Combines two rotation-and-shift transformations. + +@param rvec1 First rotation vector. +@param tvec1 First translation vector. +@param rvec2 Second rotation vector. +@param tvec2 Second translation vector. +@param rvec3 Output rotation vector of the superposition. +@param tvec3 Output translation vector of the superposition. +@param dr3dr1 +@param dr3dt1 +@param dr3dr2 +@param dr3dt2 +@param dt3dr1 +@param dt3dt1 +@param dt3dr2 +@param dt3dt2 Optional output derivatives of rvec3 or tvec3 with regard to rvec1, rvec2, tvec1 and +tvec2, respectively. + +The functions compute: + +\f[\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,\f] + +where \f$\mathrm{rodrigues}\f$ denotes a rotation vector to a rotation matrix transformation, and +\f$\mathrm{rodrigues}^{-1}\f$ denotes the inverse transformation. See Rodrigues for details. + +Also, the functions can compute the derivatives of the output vectors with regards to the input +vectors (see matMulDeriv ). The functions are used inside stereoCalibrate but can also be used in +your own code where Levenberg-Marquardt or another gradient-based solver is used to optimize a +function that contains a matrix multiplication. + */ +CV_EXPORTS_W void composeRT( InputArray rvec1, InputArray tvec1, + InputArray rvec2, InputArray tvec2, + OutputArray rvec3, OutputArray tvec3, + OutputArray dr3dr1 = noArray(), OutputArray dr3dt1 = noArray(), + OutputArray dr3dr2 = noArray(), OutputArray dr3dt2 = noArray(), + OutputArray dt3dr1 = noArray(), OutputArray dt3dt1 = noArray(), + OutputArray dt3dr2 = noArray(), OutputArray dt3dt2 = noArray() ); + +/** @brief Projects 3D points to an image plane. + +@param objectPoints Array of object points, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel (or +vector\ ), where N is the number of points in the view. +@param rvec Rotation vector. See Rodrigues for details. +@param tvec Translation vector. +@param cameraMatrix Camera matrix \f$A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}\f$ . +@param distCoeffs Input vector of distortion coefficients +\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of +4, 5, 8, 12 or 14 elements. If the vector is empty, the zero distortion coefficients are assumed. +@param imagePoints Output array of image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, or +vector\ . +@param jacobian Optional output 2Nx(10+\) jacobian matrix of derivatives of image +points with respect to components of the rotation vector, translation vector, focal lengths, +coordinates of the principal point and the distortion coefficients. In the old interface different +components of the jacobian are returned via different output parameters. +@param aspectRatio Optional "fixed aspect ratio" parameter. If the parameter is not 0, the +function assumes that the aspect ratio (*fx/fy*) is fixed and correspondingly adjusts the jacobian +matrix. + +The function computes projections of 3D points to the image plane given intrinsic and extrinsic +camera parameters. Optionally, the function computes Jacobians - matrices of partial derivatives of +image points coordinates (as functions of all the input parameters) with respect to the particular +parameters, intrinsic and/or extrinsic. The Jacobians are used during the global optimization in +calibrateCamera, solvePnP, and stereoCalibrate . The function itself can also be used to compute a +re-projection error given the current intrinsic and extrinsic parameters. + +@note By setting rvec=tvec=(0,0,0) or by setting cameraMatrix to a 3x3 identity matrix, or by +passing zero distortion coefficients, you can get various useful partial cases of the function. This +means that you can compute the distorted coordinates for a sparse set of points or apply a +perspective transformation (and also compute the derivatives) in the ideal zero-distortion setup. + */ +CV_EXPORTS_W void projectPoints( InputArray objectPoints, + InputArray rvec, InputArray tvec, + InputArray cameraMatrix, InputArray distCoeffs, + OutputArray imagePoints, + OutputArray jacobian = noArray(), + double aspectRatio = 0 ); + +/** @brief Finds an object pose from 3D-2D point correspondences. + +@param objectPoints Array of object points in the object coordinate space, 3xN/Nx3 1-channel or +1xN/Nx1 3-channel, where N is the number of points. vector\ can be also passed here. +@param imagePoints Array of corresponding image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, +where N is the number of points. vector\ can be also passed here. +@param cameraMatrix Input camera matrix \f$A = \vecthreethree{fx}{0}{cx}{0}{fy}{cy}{0}{0}{1}\f$ . +@param distCoeffs Input vector of distortion coefficients +\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of +4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are +assumed. +@param rvec Output rotation vector (see Rodrigues ) that, together with tvec , brings points from +the model coordinate system to the camera coordinate system. +@param tvec Output translation vector. +@param useExtrinsicGuess Parameter used for SOLVEPNP_ITERATIVE. If true (1), the function uses +the provided rvec and tvec values as initial approximations of the rotation and translation +vectors, respectively, and further optimizes them. +@param flags Method for solving a PnP problem: +- **SOLVEPNP_ITERATIVE** Iterative method is based on Levenberg-Marquardt optimization. In +this case the function finds such a pose that minimizes reprojection error, that is the sum +of squared distances between the observed projections imagePoints and the projected (using +projectPoints ) objectPoints . +- **SOLVEPNP_P3P** Method is based on the paper of X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang +"Complete Solution Classification for the Perspective-Three-Point Problem". In this case the +function requires exactly four object and image points. +- **SOLVEPNP_EPNP** Method has been introduced by F.Moreno-Noguer, V.Lepetit and P.Fua in the +paper "EPnP: Efficient Perspective-n-Point Camera Pose Estimation". +- **SOLVEPNP_DLS** Method is based on the paper of Joel A. Hesch and Stergios I. Roumeliotis. +"A Direct Least-Squares (DLS) Method for PnP". +- **SOLVEPNP_UPNP** Method is based on the paper of A.Penate-Sanchez, J.Andrade-Cetto, +F.Moreno-Noguer. "Exhaustive Linearization for Robust Camera Pose and Focal Length +Estimation". In this case the function also estimates the parameters \f$f_x\f$ and \f$f_y\f$ +assuming that both have the same value. Then the cameraMatrix is updated with the estimated +focal length. + +The function estimates the object pose given a set of object points, their corresponding image +projections, as well as the camera matrix and the distortion coefficients. + +@note + - An example of how to use solvePnP for planar augmented reality can be found at + opencv_source_code/samples/python/plane_ar.py + - If you are using Python: + - Numpy array slices won't work as input because solvePnP requires contiguous + arrays (enforced by the assertion using cv::Mat::checkVector() around line 55 of + modules/calib3d/src/solvepnp.cpp version 2.4.9) + - The P3P algorithm requires image points to be in an array of shape (N,1,2) due + to its calling of cv::undistortPoints (around line 75 of modules/calib3d/src/solvepnp.cpp version 2.4.9) + which requires 2-channel information. + - Thus, given some data D = np.array(...) where D.shape = (N,M), in order to use a subset of + it as, e.g., imagePoints, one must effectively copy it into a new array: imagePoints = + np.ascontiguousarray(D[:,:2]).reshape((N,1,2)) + */ +CV_EXPORTS_W bool solvePnP( InputArray objectPoints, InputArray imagePoints, + InputArray cameraMatrix, InputArray distCoeffs, + OutputArray rvec, OutputArray tvec, + bool useExtrinsicGuess = false, int flags = SOLVEPNP_ITERATIVE ); + +/** @brief Finds an object pose from 3D-2D point correspondences using the RANSAC scheme. + +@param objectPoints Array of object points in the object coordinate space, 3xN/Nx3 1-channel or +1xN/Nx1 3-channel, where N is the number of points. vector\ can be also passed here. +@param imagePoints Array of corresponding image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, +where N is the number of points. vector\ can be also passed here. +@param cameraMatrix Input camera matrix \f$A = \vecthreethree{fx}{0}{cx}{0}{fy}{cy}{0}{0}{1}\f$ . +@param distCoeffs Input vector of distortion coefficients +\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of +4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are +assumed. +@param rvec Output rotation vector (see Rodrigues ) that, together with tvec , brings points from +the model coordinate system to the camera coordinate system. +@param tvec Output translation vector. +@param useExtrinsicGuess Parameter used for SOLVEPNP_ITERATIVE. If true (1), the function uses +the provided rvec and tvec values as initial approximations of the rotation and translation +vectors, respectively, and further optimizes them. +@param iterationsCount Number of iterations. +@param reprojectionError Inlier threshold value used by the RANSAC procedure. The parameter value +is the maximum allowed distance between the observed and computed point projections to consider it +an inlier. +@param confidence The probability that the algorithm produces a useful result. +@param inliers Output vector that contains indices of inliers in objectPoints and imagePoints . +@param flags Method for solving a PnP problem (see solvePnP ). + +The function estimates an object pose given a set of object points, their corresponding image +projections, as well as the camera matrix and the distortion coefficients. This function finds such +a pose that minimizes reprojection error, that is, the sum of squared distances between the observed +projections imagePoints and the projected (using projectPoints ) objectPoints. The use of RANSAC +makes the function resistant to outliers. + +@note + - An example of how to use solvePNPRansac for object detection can be found at + opencv_source_code/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/ + */ +CV_EXPORTS_W bool solvePnPRansac( InputArray objectPoints, InputArray imagePoints, + InputArray cameraMatrix, InputArray distCoeffs, + OutputArray rvec, OutputArray tvec, + bool useExtrinsicGuess = false, int iterationsCount = 100, + float reprojectionError = 8.0, double confidence = 0.99, + OutputArray inliers = noArray(), int flags = SOLVEPNP_ITERATIVE ); + +/** @brief Finds an initial camera matrix from 3D-2D point correspondences. + +@param objectPoints Vector of vectors of the calibration pattern points in the calibration pattern +coordinate space. In the old interface all the per-view vectors are concatenated. See +calibrateCamera for details. +@param imagePoints Vector of vectors of the projections of the calibration pattern points. In the +old interface all the per-view vectors are concatenated. +@param imageSize Image size in pixels used to initialize the principal point. +@param aspectRatio If it is zero or negative, both \f$f_x\f$ and \f$f_y\f$ are estimated independently. +Otherwise, \f$f_x = f_y * \texttt{aspectRatio}\f$ . + +The function estimates and returns an initial camera matrix for the camera calibration process. +Currently, the function only supports planar calibration patterns, which are patterns where each +object point has z-coordinate =0. + */ +CV_EXPORTS_W Mat initCameraMatrix2D( InputArrayOfArrays objectPoints, + InputArrayOfArrays imagePoints, + Size imageSize, double aspectRatio = 1.0 ); + +/** @brief Finds the positions of internal corners of the chessboard. + +@param image Source chessboard view. It must be an 8-bit grayscale or color image. +@param patternSize Number of inner corners per a chessboard row and column +( patternSize = cvSize(points_per_row,points_per_colum) = cvSize(columns,rows) ). +@param corners Output array of detected corners. +@param flags Various operation flags that can be zero or a combination of the following values: +- **CV_CALIB_CB_ADAPTIVE_THRESH** Use adaptive thresholding to convert the image to black +and white, rather than a fixed threshold level (computed from the average image brightness). +- **CV_CALIB_CB_NORMALIZE_IMAGE** Normalize the image gamma with equalizeHist before +applying fixed or adaptive thresholding. +- **CV_CALIB_CB_FILTER_QUADS** Use additional criteria (like contour area, perimeter, +square-like shape) to filter out false quads extracted at the contour retrieval stage. +- **CALIB_CB_FAST_CHECK** Run a fast check on the image that looks for chessboard corners, +and shortcut the call if none is found. This can drastically speed up the call in the +degenerate condition when no chessboard is observed. + +The function attempts to determine whether the input image is a view of the chessboard pattern and +locate the internal chessboard corners. The function returns a non-zero value if all of the corners +are found and they are placed in a certain order (row by row, left to right in every row). +Otherwise, if the function fails to find all the corners or reorder them, it returns 0. For example, +a regular chessboard has 8 x 8 squares and 7 x 7 internal corners, that is, points where the black +squares touch each other. The detected coordinates are approximate, and to determine their positions +more accurately, the function calls cornerSubPix. You also may use the function cornerSubPix with +different parameters if returned coordinates are not accurate enough. + +Sample usage of detecting and drawing chessboard corners: : +@code + Size patternsize(8,6); //interior number of corners + Mat gray = ....; //source image + vector corners; //this will be filled by the detected corners + + //CALIB_CB_FAST_CHECK saves a lot of time on images + //that do not contain any chessboard corners + bool patternfound = findChessboardCorners(gray, patternsize, corners, + CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE + + CALIB_CB_FAST_CHECK); + + if(patternfound) + cornerSubPix(gray, corners, Size(11, 11), Size(-1, -1), + TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1)); + + drawChessboardCorners(img, patternsize, Mat(corners), patternfound); +@endcode +@note The function requires white space (like a square-thick border, the wider the better) around +the board to make the detection more robust in various environments. Otherwise, if there is no +border and the background is dark, the outer black squares cannot be segmented properly and so the +square grouping and ordering algorithm fails. + */ +CV_EXPORTS_W bool findChessboardCorners( InputArray image, Size patternSize, OutputArray corners, + int flags = CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE ); + +//! finds subpixel-accurate positions of the chessboard corners +CV_EXPORTS bool find4QuadCornerSubpix( InputArray img, InputOutputArray corners, Size region_size ); + +/** @brief Renders the detected chessboard corners. + +@param image Destination image. It must be an 8-bit color image. +@param patternSize Number of inner corners per a chessboard row and column +(patternSize = cv::Size(points_per_row,points_per_column)). +@param corners Array of detected corners, the output of findChessboardCorners. +@param patternWasFound Parameter indicating whether the complete board was found or not. The +return value of findChessboardCorners should be passed here. + +The function draws individual chessboard corners detected either as red circles if the board was not +found, or as colored corners connected with lines if the board was found. + */ +CV_EXPORTS_W void drawChessboardCorners( InputOutputArray image, Size patternSize, + InputArray corners, bool patternWasFound ); + +/** @brief Finds centers in the grid of circles. + +@param image grid view of input circles; it must be an 8-bit grayscale or color image. +@param patternSize number of circles per row and column +( patternSize = Size(points_per_row, points_per_colum) ). +@param centers output array of detected centers. +@param flags various operation flags that can be one of the following values: +- **CALIB_CB_SYMMETRIC_GRID** uses symmetric pattern of circles. +- **CALIB_CB_ASYMMETRIC_GRID** uses asymmetric pattern of circles. +- **CALIB_CB_CLUSTERING** uses a special algorithm for grid detection. It is more robust to +perspective distortions but much more sensitive to background clutter. +@param blobDetector feature detector that finds blobs like dark circles on light background. + +The function attempts to determine whether the input image contains a grid of circles. If it is, the +function locates centers of the circles. The function returns a non-zero value if all of the centers +have been found and they have been placed in a certain order (row by row, left to right in every +row). Otherwise, if the function fails to find all the corners or reorder them, it returns 0. + +Sample usage of detecting and drawing the centers of circles: : +@code + Size patternsize(7,7); //number of centers + Mat gray = ....; //source image + vector centers; //this will be filled by the detected centers + + bool patternfound = findCirclesGrid(gray, patternsize, centers); + + drawChessboardCorners(img, patternsize, Mat(centers), patternfound); +@endcode +@note The function requires white space (like a square-thick border, the wider the better) around +the board to make the detection more robust in various environments. + */ +CV_EXPORTS_W bool findCirclesGrid( InputArray image, Size patternSize, + OutputArray centers, int flags = CALIB_CB_SYMMETRIC_GRID, + const Ptr &blobDetector = SimpleBlobDetector::create()); + +/** @brief Finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern. + +@param objectPoints In the new interface it is a vector of vectors of calibration pattern points in +the calibration pattern coordinate space (e.g. std::vector>). The outer +vector contains as many elements as the number of the pattern views. If the same calibration pattern +is shown in each view and it is fully visible, all the vectors will be the same. Although, it is +possible to use partially occluded patterns, or even different patterns in different views. Then, +the vectors will be different. The points are 3D, but since they are in a pattern coordinate system, +then, if the rig is planar, it may make sense to put the model to a XY coordinate plane so that +Z-coordinate of each input object point is 0. +In the old interface all the vectors of object points from different views are concatenated +together. +@param imagePoints In the new interface it is a vector of vectors of the projections of calibration +pattern points (e.g. std::vector>). imagePoints.size() and +objectPoints.size() and imagePoints[i].size() must be equal to objectPoints[i].size() for each i. +In the old interface all the vectors of object points from different views are concatenated +together. +@param imageSize Size of the image used only to initialize the intrinsic camera matrix. +@param cameraMatrix Output 3x3 floating-point camera matrix +\f$A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ . If CV\_CALIB\_USE\_INTRINSIC\_GUESS +and/or CV_CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be +initialized before calling the function. +@param distCoeffs Output vector of distortion coefficients +\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of +4, 5, 8, 12 or 14 elements. +@param rvecs Output vector of rotation vectors (see Rodrigues ) estimated for each pattern view +(e.g. std::vector>). That is, each k-th rotation vector together with the corresponding +k-th translation vector (see the next output parameter description) brings the calibration pattern +from the model coordinate space (in which object points are specified) to the world coordinate +space, that is, a real position of the calibration pattern in the k-th pattern view (k=0.. *M* -1). +@param tvecs Output vector of translation vectors estimated for each pattern view. +@param flags Different flags that may be zero or a combination of the following values: +- **CV_CALIB_USE_INTRINSIC_GUESS** cameraMatrix contains valid initial values of +fx, fy, cx, cy that are optimized further. Otherwise, (cx, cy) is initially set to the image +center ( imageSize is used), and focal distances are computed in a least-squares fashion. +Note, that if intrinsic parameters are known, there is no need to use this function just to +estimate extrinsic parameters. Use solvePnP instead. +- **CV_CALIB_FIX_PRINCIPAL_POINT** The principal point is not changed during the global +optimization. It stays at the center or at a different location specified when +CV_CALIB_USE_INTRINSIC_GUESS is set too. +- **CV_CALIB_FIX_ASPECT_RATIO** The functions considers only fy as a free parameter. The +ratio fx/fy stays the same as in the input cameraMatrix . When +CV_CALIB_USE_INTRINSIC_GUESS is not set, the actual input values of fx and fy are +ignored, only their ratio is computed and used further. +- **CV_CALIB_ZERO_TANGENT_DIST** Tangential distortion coefficients \f$(p_1, p_2)\f$ are set +to zeros and stay zero. +- **CV_CALIB_FIX_K1,...,CV_CALIB_FIX_K6** The corresponding radial distortion +coefficient is not changed during the optimization. If CV_CALIB_USE_INTRINSIC_GUESS is +set, the coefficient from the supplied distCoeffs matrix is used. Otherwise, it is set to 0. +- **CV_CALIB_RATIONAL_MODEL** Coefficients k4, k5, and k6 are enabled. To provide the +backward compatibility, this extra flag should be explicitly specified to make the +calibration function use the rational model and return 8 coefficients. If the flag is not +set, the function computes and returns only 5 distortion coefficients. +- **CALIB_THIN_PRISM_MODEL** Coefficients s1, s2, s3 and s4 are enabled. To provide the +backward compatibility, this extra flag should be explicitly specified to make the +calibration function use the thin prism model and return 12 coefficients. If the flag is not +set, the function computes and returns only 5 distortion coefficients. +- **CALIB_FIX_S1_S2_S3_S4** The thin prism distortion coefficients are not changed during +the optimization. If CV_CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the +supplied distCoeffs matrix is used. Otherwise, it is set to 0. +- **CALIB_TILTED_MODEL** Coefficients tauX and tauY are enabled. To provide the +backward compatibility, this extra flag should be explicitly specified to make the +calibration function use the tilted sensor model and return 14 coefficients. If the flag is not +set, the function computes and returns only 5 distortion coefficients. +- **CALIB_FIX_TAUX_TAUY** The coefficients of the tilted sensor model are not changed during +the optimization. If CV_CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the +supplied distCoeffs matrix is used. Otherwise, it is set to 0. +@param criteria Termination criteria for the iterative optimization algorithm. + +The function estimates the intrinsic camera parameters and extrinsic parameters for each of the +views. The algorithm is based on @cite Zhang2000 and @cite BouguetMCT . The coordinates of 3D object +points and their corresponding 2D projections in each view must be specified. That may be achieved +by using an object with a known geometry and easily detectable feature points. Such an object is +called a calibration rig or calibration pattern, and OpenCV has built-in support for a chessboard as +a calibration rig (see findChessboardCorners ). Currently, initialization of intrinsic parameters +(when CV_CALIB_USE_INTRINSIC_GUESS is not set) is only implemented for planar calibration +patterns (where Z-coordinates of the object points must be all zeros). 3D calibration rigs can also +be used as long as initial cameraMatrix is provided. + +The algorithm performs the following steps: + +- Compute the initial intrinsic parameters (the option only available for planar calibration + patterns) or read them from the input parameters. The distortion coefficients are all set to + zeros initially unless some of CV_CALIB_FIX_K? are specified. + +- Estimate the initial camera pose as if the intrinsic parameters have been already known. This is + done using solvePnP . + +- Run the global Levenberg-Marquardt optimization algorithm to minimize the reprojection error, + that is, the total sum of squared distances between the observed feature points imagePoints and + the projected (using the current estimates for camera parameters and the poses) object points + objectPoints. See projectPoints for details. + +The function returns the final re-projection error. + +@note + If you use a non-square (=non-NxN) grid and findChessboardCorners for calibration, and + calibrateCamera returns bad values (zero distortion coefficients, an image center very far from + (w/2-0.5,h/2-0.5), and/or large differences between \f$f_x\f$ and \f$f_y\f$ (ratios of 10:1 or more)), + then you have probably used patternSize=cvSize(rows,cols) instead of using + patternSize=cvSize(cols,rows) in findChessboardCorners . + +@sa + findChessboardCorners, solvePnP, initCameraMatrix2D, stereoCalibrate, undistort + */ +CV_EXPORTS_W double calibrateCamera( InputArrayOfArrays objectPoints, + InputArrayOfArrays imagePoints, Size imageSize, + InputOutputArray cameraMatrix, InputOutputArray distCoeffs, + OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, + int flags = 0, TermCriteria criteria = TermCriteria( + TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON) ); + +/** @brief Computes useful camera characteristics from the camera matrix. + +@param cameraMatrix Input camera matrix that can be estimated by calibrateCamera or +stereoCalibrate . +@param imageSize Input image size in pixels. +@param apertureWidth Physical width in mm of the sensor. +@param apertureHeight Physical height in mm of the sensor. +@param fovx Output field of view in degrees along the horizontal sensor axis. +@param fovy Output field of view in degrees along the vertical sensor axis. +@param focalLength Focal length of the lens in mm. +@param principalPoint Principal point in mm. +@param aspectRatio \f$f_y/f_x\f$ + +The function computes various useful camera characteristics from the previously estimated camera +matrix. + +@note + Do keep in mind that the unity measure 'mm' stands for whatever unit of measure one chooses for + the chessboard pitch (it can thus be any value). + */ +CV_EXPORTS_W void calibrationMatrixValues( InputArray cameraMatrix, Size imageSize, + double apertureWidth, double apertureHeight, + CV_OUT double& fovx, CV_OUT double& fovy, + CV_OUT double& focalLength, CV_OUT Point2d& principalPoint, + CV_OUT double& aspectRatio ); + +/** @brief Calibrates the stereo camera. + +@param objectPoints Vector of vectors of the calibration pattern points. +@param imagePoints1 Vector of vectors of the projections of the calibration pattern points, +observed by the first camera. +@param imagePoints2 Vector of vectors of the projections of the calibration pattern points, +observed by the second camera. +@param cameraMatrix1 Input/output first camera matrix: +\f$\vecthreethree{f_x^{(j)}}{0}{c_x^{(j)}}{0}{f_y^{(j)}}{c_y^{(j)}}{0}{0}{1}\f$ , \f$j = 0,\, 1\f$ . If +any of CV_CALIB_USE_INTRINSIC_GUESS , CV_CALIB_FIX_ASPECT_RATIO , +CV_CALIB_FIX_INTRINSIC , or CV_CALIB_FIX_FOCAL_LENGTH are specified, some or all of the +matrix components must be initialized. See the flags description for details. +@param distCoeffs1 Input/output vector of distortion coefficients +\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of +4, 5, 8, 12 or 14 elements. The output vector length depends on the flags. +@param cameraMatrix2 Input/output second camera matrix. The parameter is similar to cameraMatrix1 +@param distCoeffs2 Input/output lens distortion coefficients for the second camera. The parameter +is similar to distCoeffs1 . +@param imageSize Size of the image used only to initialize intrinsic camera matrix. +@param R Output rotation matrix between the 1st and the 2nd camera coordinate systems. +@param T Output translation vector between the coordinate systems of the cameras. +@param E Output essential matrix. +@param F Output fundamental matrix. +@param flags Different flags that may be zero or a combination of the following values: +- **CV_CALIB_FIX_INTRINSIC** Fix cameraMatrix? and distCoeffs? so that only R, T, E , and F +matrices are estimated. +- **CV_CALIB_USE_INTRINSIC_GUESS** Optimize some or all of the intrinsic parameters +according to the specified flags. Initial values are provided by the user. +- **CV_CALIB_FIX_PRINCIPAL_POINT** Fix the principal points during the optimization. +- **CV_CALIB_FIX_FOCAL_LENGTH** Fix \f$f^{(j)}_x\f$ and \f$f^{(j)}_y\f$ . +- **CV_CALIB_FIX_ASPECT_RATIO** Optimize \f$f^{(j)}_y\f$ . Fix the ratio \f$f^{(j)}_x/f^{(j)}_y\f$ +. +- **CV_CALIB_SAME_FOCAL_LENGTH** Enforce \f$f^{(0)}_x=f^{(1)}_x\f$ and \f$f^{(0)}_y=f^{(1)}_y\f$ . +- **CV_CALIB_ZERO_TANGENT_DIST** Set tangential distortion coefficients for each camera to +zeros and fix there. +- **CV_CALIB_FIX_K1,...,CV_CALIB_FIX_K6** Do not change the corresponding radial +distortion coefficient during the optimization. If CV_CALIB_USE_INTRINSIC_GUESS is set, +the coefficient from the supplied distCoeffs matrix is used. Otherwise, it is set to 0. +- **CV_CALIB_RATIONAL_MODEL** Enable coefficients k4, k5, and k6. To provide the backward +compatibility, this extra flag should be explicitly specified to make the calibration +function use the rational model and return 8 coefficients. If the flag is not set, the +function computes and returns only 5 distortion coefficients. +- **CALIB_THIN_PRISM_MODEL** Coefficients s1, s2, s3 and s4 are enabled. To provide the +backward compatibility, this extra flag should be explicitly specified to make the +calibration function use the thin prism model and return 12 coefficients. If the flag is not +set, the function computes and returns only 5 distortion coefficients. +- **CALIB_FIX_S1_S2_S3_S4** The thin prism distortion coefficients are not changed during +the optimization. If CV_CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the +supplied distCoeffs matrix is used. Otherwise, it is set to 0. +- **CALIB_TILTED_MODEL** Coefficients tauX and tauY are enabled. To provide the +backward compatibility, this extra flag should be explicitly specified to make the +calibration function use the tilted sensor model and return 14 coefficients. If the flag is not +set, the function computes and returns only 5 distortion coefficients. +- **CALIB_FIX_TAUX_TAUY** The coefficients of the tilted sensor model are not changed during +the optimization. If CV_CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the +supplied distCoeffs matrix is used. Otherwise, it is set to 0. +@param criteria Termination criteria for the iterative optimization algorithm. + +The function estimates transformation between two cameras making a stereo pair. If you have a stereo +camera where the relative position and orientation of two cameras is fixed, and if you computed +poses of an object relative to the first camera and to the second camera, (R1, T1) and (R2, T2), +respectively (this can be done with solvePnP ), then those poses definitely relate to each other. +This means that, given ( \f$R_1\f$,\f$T_1\f$ ), it should be possible to compute ( \f$R_2\f$,\f$T_2\f$ ). You only +need to know the position and orientation of the second camera relative to the first camera. This is +what the described function does. It computes ( \f$R\f$,\f$T\f$ ) so that: + +\f[R_2=R*R_1 +T_2=R*T_1 + T,\f] + +Optionally, it computes the essential matrix E: + +\f[E= \vecthreethree{0}{-T_2}{T_1}{T_2}{0}{-T_0}{-T_1}{T_0}{0} *R\f] + +where \f$T_i\f$ are components of the translation vector \f$T\f$ : \f$T=[T_0, T_1, T_2]^T\f$ . And the function +can also compute the fundamental matrix F: + +\f[F = cameraMatrix2^{-T} E cameraMatrix1^{-1}\f] + +Besides the stereo-related information, the function can also perform a full calibration of each of +two cameras. However, due to the high dimensionality of the parameter space and noise in the input +data, the function can diverge from the correct solution. If the intrinsic parameters can be +estimated with high accuracy for each of the cameras individually (for example, using +calibrateCamera ), you are recommended to do so and then pass CV_CALIB_FIX_INTRINSIC flag to the +function along with the computed intrinsic parameters. Otherwise, if all the parameters are +estimated at once, it makes sense to restrict some parameters, for example, pass +CV_CALIB_SAME_FOCAL_LENGTH and CV_CALIB_ZERO_TANGENT_DIST flags, which is usually a +reasonable assumption. + +Similarly to calibrateCamera , the function minimizes the total re-projection error for all the +points in all the available views from both cameras. The function returns the final value of the +re-projection error. + */ +CV_EXPORTS_W double stereoCalibrate( InputArrayOfArrays objectPoints, + InputArrayOfArrays imagePoints1, InputArrayOfArrays imagePoints2, + InputOutputArray cameraMatrix1, InputOutputArray distCoeffs1, + InputOutputArray cameraMatrix2, InputOutputArray distCoeffs2, + Size imageSize, OutputArray R,OutputArray T, OutputArray E, OutputArray F, + int flags = CALIB_FIX_INTRINSIC, + TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 1e-6) ); + + +/** @brief Computes rectification transforms for each head of a calibrated stereo camera. + +@param cameraMatrix1 First camera matrix. +@param distCoeffs1 First camera distortion parameters. +@param cameraMatrix2 Second camera matrix. +@param distCoeffs2 Second camera distortion parameters. +@param imageSize Size of the image used for stereo calibration. +@param R Rotation matrix between the coordinate systems of the first and the second cameras. +@param T Translation vector between coordinate systems of the cameras. +@param R1 Output 3x3 rectification transform (rotation matrix) for the first camera. +@param R2 Output 3x3 rectification transform (rotation matrix) for the second camera. +@param P1 Output 3x4 projection matrix in the new (rectified) coordinate systems for the first +camera. +@param P2 Output 3x4 projection matrix in the new (rectified) coordinate systems for the second +camera. +@param Q Output \f$4 \times 4\f$ disparity-to-depth mapping matrix (see reprojectImageTo3D ). +@param flags Operation flags that may be zero or CV_CALIB_ZERO_DISPARITY . If the flag is set, +the function makes the principal points of each camera have the same pixel coordinates in the +rectified views. And if the flag is not set, the function may still shift the images in the +horizontal or vertical direction (depending on the orientation of epipolar lines) to maximize the +useful image area. +@param alpha Free scaling parameter. If it is -1 or absent, the function performs the default +scaling. Otherwise, the parameter should be between 0 and 1. alpha=0 means that the rectified +images are zoomed and shifted so that only valid pixels are visible (no black areas after +rectification). alpha=1 means that the rectified image is decimated and shifted so that all the +pixels from the original images from the cameras are retained in the rectified images (no source +image pixels are lost). Obviously, any intermediate value yields an intermediate result between +those two extreme cases. +@param newImageSize New image resolution after rectification. The same size should be passed to +initUndistortRectifyMap (see the stereo_calib.cpp sample in OpenCV samples directory). When (0,0) +is passed (default), it is set to the original imageSize . Setting it to larger value can help you +preserve details in the original image, especially when there is a big radial distortion. +@param validPixROI1 Optional output rectangles inside the rectified images where all the pixels +are valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller +(see the picture below). +@param validPixROI2 Optional output rectangles inside the rectified images where all the pixels +are valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller +(see the picture below). + +The function computes the rotation matrices for each camera that (virtually) make both camera image +planes the same plane. Consequently, this makes all the epipolar lines parallel and thus simplifies +the dense stereo correspondence problem. The function takes the matrices computed by stereoCalibrate +as input. As output, it provides two rotation matrices and also two projection matrices in the new +coordinates. The function distinguishes the following two cases: + +- **Horizontal stereo**: the first and the second camera views are shifted relative to each other + mainly along the x axis (with possible small vertical shift). In the rectified images, the + corresponding epipolar lines in the left and right cameras are horizontal and have the same + y-coordinate. P1 and P2 look like: + + \f[\texttt{P1} = \begin{bmatrix} f & 0 & cx_1 & 0 \\ 0 & f & cy & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}\f] + + \f[\texttt{P2} = \begin{bmatrix} f & 0 & cx_2 & T_x*f \\ 0 & f & cy & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix} ,\f] + + where \f$T_x\f$ is a horizontal shift between the cameras and \f$cx_1=cx_2\f$ if + CV_CALIB_ZERO_DISPARITY is set. + +- **Vertical stereo**: the first and the second camera views are shifted relative to each other + mainly in vertical direction (and probably a bit in the horizontal direction too). The epipolar + lines in the rectified images are vertical and have the same x-coordinate. P1 and P2 look like: + + \f[\texttt{P1} = \begin{bmatrix} f & 0 & cx & 0 \\ 0 & f & cy_1 & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}\f] + + \f[\texttt{P2} = \begin{bmatrix} f & 0 & cx & 0 \\ 0 & f & cy_2 & T_y*f \\ 0 & 0 & 1 & 0 \end{bmatrix} ,\f] + + where \f$T_y\f$ is a vertical shift between the cameras and \f$cy_1=cy_2\f$ if CALIB_ZERO_DISPARITY is + set. + +As you can see, the first three columns of P1 and P2 will effectively be the new "rectified" camera +matrices. The matrices, together with R1 and R2 , can then be passed to initUndistortRectifyMap to +initialize the rectification map for each camera. + +See below the screenshot from the stereo_calib.cpp sample. Some red horizontal lines pass through +the corresponding image regions. This means that the images are well rectified, which is what most +stereo correspondence algorithms rely on. The green rectangles are roi1 and roi2 . You see that +their interiors are all valid pixels. + +![image](pics/stereo_undistort.jpg) + */ +CV_EXPORTS_W void stereoRectify( InputArray cameraMatrix1, InputArray distCoeffs1, + InputArray cameraMatrix2, InputArray distCoeffs2, + Size imageSize, InputArray R, InputArray T, + OutputArray R1, OutputArray R2, + OutputArray P1, OutputArray P2, + OutputArray Q, int flags = CALIB_ZERO_DISPARITY, + double alpha = -1, Size newImageSize = Size(), + CV_OUT Rect* validPixROI1 = 0, CV_OUT Rect* validPixROI2 = 0 ); + +/** @brief Computes a rectification transform for an uncalibrated stereo camera. + +@param points1 Array of feature points in the first image. +@param points2 The corresponding points in the second image. The same formats as in +findFundamentalMat are supported. +@param F Input fundamental matrix. It can be computed from the same set of point pairs using +findFundamentalMat . +@param imgSize Size of the image. +@param H1 Output rectification homography matrix for the first image. +@param H2 Output rectification homography matrix for the second image. +@param threshold Optional threshold used to filter out the outliers. If the parameter is greater +than zero, all the point pairs that do not comply with the epipolar geometry (that is, the points +for which \f$|\texttt{points2[i]}^T*\texttt{F}*\texttt{points1[i]}|>\texttt{threshold}\f$ ) are +rejected prior to computing the homographies. Otherwise,all the points are considered inliers. + +The function computes the rectification transformations without knowing intrinsic parameters of the +cameras and their relative position in the space, which explains the suffix "uncalibrated". Another +related difference from stereoRectify is that the function outputs not the rectification +transformations in the object (3D) space, but the planar perspective transformations encoded by the +homography matrices H1 and H2 . The function implements the algorithm @cite Hartley99 . + +@note + While the algorithm does not need to know the intrinsic parameters of the cameras, it heavily + depends on the epipolar geometry. Therefore, if the camera lenses have a significant distortion, + it would be better to correct it before computing the fundamental matrix and calling this + function. For example, distortion coefficients can be estimated for each head of stereo camera + separately by using calibrateCamera . Then, the images can be corrected using undistort , or + just the point coordinates can be corrected with undistortPoints . + */ +CV_EXPORTS_W bool stereoRectifyUncalibrated( InputArray points1, InputArray points2, + InputArray F, Size imgSize, + OutputArray H1, OutputArray H2, + double threshold = 5 ); + +//! computes the rectification transformations for 3-head camera, where all the heads are on the same line. +CV_EXPORTS_W float rectify3Collinear( InputArray cameraMatrix1, InputArray distCoeffs1, + InputArray cameraMatrix2, InputArray distCoeffs2, + InputArray cameraMatrix3, InputArray distCoeffs3, + InputArrayOfArrays imgpt1, InputArrayOfArrays imgpt3, + Size imageSize, InputArray R12, InputArray T12, + InputArray R13, InputArray T13, + OutputArray R1, OutputArray R2, OutputArray R3, + OutputArray P1, OutputArray P2, OutputArray P3, + OutputArray Q, double alpha, Size newImgSize, + CV_OUT Rect* roi1, CV_OUT Rect* roi2, int flags ); + +/** @brief Returns the new camera matrix based on the free scaling parameter. + +@param cameraMatrix Input camera matrix. +@param distCoeffs Input vector of distortion coefficients +\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of +4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are +assumed. +@param imageSize Original image size. +@param alpha Free scaling parameter between 0 (when all the pixels in the undistorted image are +valid) and 1 (when all the source image pixels are retained in the undistorted image). See +stereoRectify for details. +@param newImgSize Image size after rectification. By default,it is set to imageSize . +@param validPixROI Optional output rectangle that outlines all-good-pixels region in the +undistorted image. See roi1, roi2 description in stereoRectify . +@param centerPrincipalPoint Optional flag that indicates whether in the new camera matrix the +principal point should be at the image center or not. By default, the principal point is chosen to +best fit a subset of the source image (determined by alpha) to the corrected image. +@return new_camera_matrix Output new camera matrix. + +The function computes and returns the optimal new camera matrix based on the free scaling parameter. +By varying this parameter, you may retrieve only sensible pixels alpha=0 , keep all the original +image pixels if there is valuable information in the corners alpha=1 , or get something in between. +When alpha\>0 , the undistortion result is likely to have some black pixels corresponding to +"virtual" pixels outside of the captured distorted image. The original camera matrix, distortion +coefficients, the computed new camera matrix, and newImageSize should be passed to +initUndistortRectifyMap to produce the maps for remap . + */ +CV_EXPORTS_W Mat getOptimalNewCameraMatrix( InputArray cameraMatrix, InputArray distCoeffs, + Size imageSize, double alpha, Size newImgSize = Size(), + CV_OUT Rect* validPixROI = 0, + bool centerPrincipalPoint = false); + +/** @brief Converts points from Euclidean to homogeneous space. + +@param src Input vector of N-dimensional points. +@param dst Output vector of N+1-dimensional points. + +The function converts points from Euclidean to homogeneous space by appending 1's to the tuple of +point coordinates. That is, each point (x1, x2, ..., xn) is converted to (x1, x2, ..., xn, 1). + */ +CV_EXPORTS_W void convertPointsToHomogeneous( InputArray src, OutputArray dst ); + +/** @brief Converts points from homogeneous to Euclidean space. + +@param src Input vector of N-dimensional points. +@param dst Output vector of N-1-dimensional points. + +The function converts points homogeneous to Euclidean space using perspective projection. That is, +each point (x1, x2, ... x(n-1), xn) is converted to (x1/xn, x2/xn, ..., x(n-1)/xn). When xn=0, the +output point coordinates will be (0,0,0,...). + */ +CV_EXPORTS_W void convertPointsFromHomogeneous( InputArray src, OutputArray dst ); + +/** @brief Converts points to/from homogeneous coordinates. + +@param src Input array or vector of 2D, 3D, or 4D points. +@param dst Output vector of 2D, 3D, or 4D points. + +The function converts 2D or 3D points from/to homogeneous coordinates by calling either +convertPointsToHomogeneous or convertPointsFromHomogeneous. + +@note The function is obsolete. Use one of the previous two functions instead. + */ +CV_EXPORTS void convertPointsHomogeneous( InputArray src, OutputArray dst ); + +/** @brief Calculates a fundamental matrix from the corresponding points in two images. + +@param points1 Array of N points from the first image. The point coordinates should be +floating-point (single or double precision). +@param points2 Array of the second image points of the same size and format as points1 . +@param method Method for computing a fundamental matrix. +- **CV_FM_7POINT** for a 7-point algorithm. \f$N = 7\f$ +- **CV_FM_8POINT** for an 8-point algorithm. \f$N \ge 8\f$ +- **CV_FM_RANSAC** for the RANSAC algorithm. \f$N \ge 8\f$ +- **CV_FM_LMEDS** for the LMedS algorithm. \f$N \ge 8\f$ +@param param1 Parameter used for RANSAC. It is the maximum distance from a point to an epipolar +line in pixels, beyond which the point is considered an outlier and is not used for computing the +final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the +point localization, image resolution, and the image noise. +@param param2 Parameter used for the RANSAC or LMedS methods only. It specifies a desirable level +of confidence (probability) that the estimated matrix is correct. +@param mask + +The epipolar geometry is described by the following equation: + +\f[[p_2; 1]^T F [p_1; 1] = 0\f] + +where \f$F\f$ is a fundamental matrix, \f$p_1\f$ and \f$p_2\f$ are corresponding points in the first and the +second images, respectively. + +The function calculates the fundamental matrix using one of four methods listed above and returns +the found fundamental matrix. Normally just one matrix is found. But in case of the 7-point +algorithm, the function may return up to 3 solutions ( \f$9 \times 3\f$ matrix that stores all 3 +matrices sequentially). + +The calculated fundamental matrix may be passed further to computeCorrespondEpilines that finds the +epipolar lines corresponding to the specified points. It can also be passed to +stereoRectifyUncalibrated to compute the rectification transformation. : +@code + // Example. Estimation of fundamental matrix using the RANSAC algorithm + int point_count = 100; + vector points1(point_count); + vector points2(point_count); + + // initialize the points here ... + for( int i = 0; i < point_count; i++ ) + { + points1[i] = ...; + points2[i] = ...; + } + + Mat fundamental_matrix = + findFundamentalMat(points1, points2, FM_RANSAC, 3, 0.99); +@endcode + */ +CV_EXPORTS_W Mat findFundamentalMat( InputArray points1, InputArray points2, + int method = FM_RANSAC, + double param1 = 3., double param2 = 0.99, + OutputArray mask = noArray() ); + +/** @overload */ +CV_EXPORTS Mat findFundamentalMat( InputArray points1, InputArray points2, + OutputArray mask, int method = FM_RANSAC, + double param1 = 3., double param2 = 0.99 ); + +/** @brief Calculates an essential matrix from the corresponding points in two images. + +@param points1 Array of N (N \>= 5) 2D points from the first image. The point coordinates should +be floating-point (single or double precision). +@param points2 Array of the second image points of the same size and format as points1 . +@param cameraMatrix Camera matrix \f$K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ . +Note that this function assumes that points1 and points2 are feature points from cameras with the +same camera matrix. +@param method Method for computing a fundamental matrix. +- **RANSAC** for the RANSAC algorithm. +- **MEDS** for the LMedS algorithm. +@param threshold Parameter used for RANSAC. It is the maximum distance from a point to an epipolar +line in pixels, beyond which the point is considered an outlier and is not used for computing the +final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the +point localization, image resolution, and the image noise. +@param prob Parameter used for the RANSAC or LMedS methods only. It specifies a desirable level of +confidence (probability) that the estimated matrix is correct. +@param mask Output array of N elements, every element of which is set to 0 for outliers and to 1 +for the other points. The array is computed only in the RANSAC and LMedS methods. + +This function estimates essential matrix based on the five-point algorithm solver in @cite Nister03 . +@cite SteweniusCFS is also a related. The epipolar geometry is described by the following equation: + +\f[[p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\f] + +where \f$E\f$ is an essential matrix, \f$p_1\f$ and \f$p_2\f$ are corresponding points in the first and the +second images, respectively. The result of this function may be passed further to +decomposeEssentialMat or recoverPose to recover the relative pose between cameras. + */ +CV_EXPORTS_W Mat findEssentialMat( InputArray points1, InputArray points2, + InputArray cameraMatrix, int method = RANSAC, + double prob = 0.999, double threshold = 1.0, + OutputArray mask = noArray() ); + +/** @overload +@param points1 Array of N (N \>= 5) 2D points from the first image. The point coordinates should +be floating-point (single or double precision). +@param points2 Array of the second image points of the same size and format as points1 . +@param focal focal length of the camera. Note that this function assumes that points1 and points2 +are feature points from cameras with same focal length and principle point. +@param pp principle point of the camera. +@param method Method for computing a fundamental matrix. +- **RANSAC** for the RANSAC algorithm. +- **LMEDS** for the LMedS algorithm. +@param threshold Parameter used for RANSAC. It is the maximum distance from a point to an epipolar +line in pixels, beyond which the point is considered an outlier and is not used for computing the +final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the +point localization, image resolution, and the image noise. +@param prob Parameter used for the RANSAC or LMedS methods only. It specifies a desirable level of +confidence (probability) that the estimated matrix is correct. +@param mask Output array of N elements, every element of which is set to 0 for outliers and to 1 +for the other points. The array is computed only in the RANSAC and LMedS methods. + +This function differs from the one above that it computes camera matrix from focal length and +principal point: + +\f[K = +\begin{bmatrix} +f & 0 & x_{pp} \\ +0 & f & y_{pp} \\ +0 & 0 & 1 +\end{bmatrix}\f] + */ +CV_EXPORTS_W Mat findEssentialMat( InputArray points1, InputArray points2, + double focal = 1.0, Point2d pp = Point2d(0, 0), + int method = RANSAC, double prob = 0.999, + double threshold = 1.0, OutputArray mask = noArray() ); + +/** @brief Decompose an essential matrix to possible rotations and translation. + +@param E The input essential matrix. +@param R1 One possible rotation matrix. +@param R2 Another possible rotation matrix. +@param t One possible translation. + +This function decompose an essential matrix E using svd decomposition @cite HartleyZ00 . Generally 4 +possible poses exists for a given E. They are \f$[R_1, t]\f$, \f$[R_1, -t]\f$, \f$[R_2, t]\f$, \f$[R_2, -t]\f$. By +decomposing E, you can only get the direction of the translation, so the function returns unit t. + */ +CV_EXPORTS_W void decomposeEssentialMat( InputArray E, OutputArray R1, OutputArray R2, OutputArray t ); + +/** @brief Recover relative camera rotation and translation from an estimated essential matrix and the +corresponding points in two images, using cheirality check. Returns the number of inliers which pass +the check. + +@param E The input essential matrix. +@param points1 Array of N 2D points from the first image. The point coordinates should be +floating-point (single or double precision). +@param points2 Array of the second image points of the same size and format as points1 . +@param cameraMatrix Camera matrix \f$K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ . +Note that this function assumes that points1 and points2 are feature points from cameras with the +same camera matrix. +@param R Recovered relative rotation. +@param t Recoverd relative translation. +@param mask Input/output mask for inliers in points1 and points2. +: If it is not empty, then it marks inliers in points1 and points2 for then given essential +matrix E. Only these inliers will be used to recover pose. In the output mask only inliers +which pass the cheirality check. +This function decomposes an essential matrix using decomposeEssentialMat and then verifies possible +pose hypotheses by doing cheirality check. The cheirality check basically means that the +triangulated 3D points should have positive depth. Some details can be found in @cite Nister03 . + +This function can be used to process output E and mask from findEssentialMat. In this scenario, +points1 and points2 are the same input for findEssentialMat. : +@code + // Example. Estimation of fundamental matrix using the RANSAC algorithm + int point_count = 100; + vector points1(point_count); + vector points2(point_count); + + // initialize the points here ... + for( int i = 0; i < point_count; i++ ) + { + points1[i] = ...; + points2[i] = ...; + } + + // cametra matrix with both focal lengths = 1, and principal point = (0, 0) + Mat cameraMatrix = Mat::eye(3, 3, CV_64F); + + Mat E, R, t, mask; + + E = findEssentialMat(points1, points2, cameraMatrix, RANSAC, 0.999, 1.0, mask); + recoverPose(E, points1, points2, cameraMatrix, R, t, mask); +@endcode + */ +CV_EXPORTS_W int recoverPose( InputArray E, InputArray points1, InputArray points2, + InputArray cameraMatrix, OutputArray R, OutputArray t, + InputOutputArray mask = noArray() ); + +/** @overload +@param E The input essential matrix. +@param points1 Array of N 2D points from the first image. The point coordinates should be +floating-point (single or double precision). +@param points2 Array of the second image points of the same size and format as points1 . +@param R Recovered relative rotation. +@param t Recoverd relative translation. +@param focal Focal length of the camera. Note that this function assumes that points1 and points2 +are feature points from cameras with same focal length and principle point. +@param pp Principle point of the camera. +@param mask Input/output mask for inliers in points1 and points2. +: If it is not empty, then it marks inliers in points1 and points2 for then given essential +matrix E. Only these inliers will be used to recover pose. In the output mask only inliers +which pass the cheirality check. + +This function differs from the one above that it computes camera matrix from focal length and +principal point: + +\f[K = +\begin{bmatrix} +f & 0 & x_{pp} \\ +0 & f & y_{pp} \\ +0 & 0 & 1 +\end{bmatrix}\f] + */ +CV_EXPORTS_W int recoverPose( InputArray E, InputArray points1, InputArray points2, + OutputArray R, OutputArray t, + double focal = 1.0, Point2d pp = Point2d(0, 0), + InputOutputArray mask = noArray() ); + +/** @brief For points in an image of a stereo pair, computes the corresponding epilines in the other image. + +@param points Input points. \f$N \times 1\f$ or \f$1 \times N\f$ matrix of type CV_32FC2 or +vector\ . +@param whichImage Index of the image (1 or 2) that contains the points . +@param F Fundamental matrix that can be estimated using findFundamentalMat or stereoRectify . +@param lines Output vector of the epipolar lines corresponding to the points in the other image. +Each line \f$ax + by + c=0\f$ is encoded by 3 numbers \f$(a, b, c)\f$ . + +For every point in one of the two images of a stereo pair, the function finds the equation of the +corresponding epipolar line in the other image. + +From the fundamental matrix definition (see findFundamentalMat ), line \f$l^{(2)}_i\f$ in the second +image for the point \f$p^{(1)}_i\f$ in the first image (when whichImage=1 ) is computed as: + +\f[l^{(2)}_i = F p^{(1)}_i\f] + +And vice versa, when whichImage=2, \f$l^{(1)}_i\f$ is computed from \f$p^{(2)}_i\f$ as: + +\f[l^{(1)}_i = F^T p^{(2)}_i\f] + +Line coefficients are defined up to a scale. They are normalized so that \f$a_i^2+b_i^2=1\f$ . + */ +CV_EXPORTS_W void computeCorrespondEpilines( InputArray points, int whichImage, + InputArray F, OutputArray lines ); + +/** @brief Reconstructs points by triangulation. + +@param projMatr1 3x4 projection matrix of the first camera. +@param projMatr2 3x4 projection matrix of the second camera. +@param projPoints1 2xN array of feature points in the first image. In case of c++ version it can +be also a vector of feature points or two-channel matrix of size 1xN or Nx1. +@param projPoints2 2xN array of corresponding points in the second image. In case of c++ version +it can be also a vector of feature points or two-channel matrix of size 1xN or Nx1. +@param points4D 4xN array of reconstructed points in homogeneous coordinates. + +The function reconstructs 3-dimensional points (in homogeneous coordinates) by using their +observations with a stereo camera. Projections matrices can be obtained from stereoRectify. + +@note + Keep in mind that all input data should be of float type in order for this function to work. + +@sa + reprojectImageTo3D + */ +CV_EXPORTS_W void triangulatePoints( InputArray projMatr1, InputArray projMatr2, + InputArray projPoints1, InputArray projPoints2, + OutputArray points4D ); + +/** @brief Refines coordinates of corresponding points. + +@param F 3x3 fundamental matrix. +@param points1 1xN array containing the first set of points. +@param points2 1xN array containing the second set of points. +@param newPoints1 The optimized points1. +@param newPoints2 The optimized points2. + +The function implements the Optimal Triangulation Method (see Multiple View Geometry for details). +For each given point correspondence points1[i] \<-\> points2[i], and a fundamental matrix F, it +computes the corrected correspondences newPoints1[i] \<-\> newPoints2[i] that minimize the geometric +error \f$d(points1[i], newPoints1[i])^2 + d(points2[i],newPoints2[i])^2\f$ (where \f$d(a,b)\f$ is the +geometric distance between points \f$a\f$ and \f$b\f$ ) subject to the epipolar constraint +\f$newPoints2^T * F * newPoints1 = 0\f$ . + */ +CV_EXPORTS_W void correctMatches( InputArray F, InputArray points1, InputArray points2, + OutputArray newPoints1, OutputArray newPoints2 ); + +/** @brief Filters off small noise blobs (speckles) in the disparity map + +@param img The input 16-bit signed disparity image +@param newVal The disparity value used to paint-off the speckles +@param maxSpeckleSize The maximum speckle size to consider it a speckle. Larger blobs are not +affected by the algorithm +@param maxDiff Maximum difference between neighbor disparity pixels to put them into the same +blob. Note that since StereoBM, StereoSGBM and may be other algorithms return a fixed-point +disparity map, where disparity values are multiplied by 16, this scale factor should be taken into +account when specifying this parameter value. +@param buf The optional temporary buffer to avoid memory allocation within the function. + */ +CV_EXPORTS_W void filterSpeckles( InputOutputArray img, double newVal, + int maxSpeckleSize, double maxDiff, + InputOutputArray buf = noArray() ); + +//! computes valid disparity ROI from the valid ROIs of the rectified images (that are returned by cv::stereoRectify()) +CV_EXPORTS_W Rect getValidDisparityROI( Rect roi1, Rect roi2, + int minDisparity, int numberOfDisparities, + int SADWindowSize ); + +//! validates disparity using the left-right check. The matrix "cost" should be computed by the stereo correspondence algorithm +CV_EXPORTS_W void validateDisparity( InputOutputArray disparity, InputArray cost, + int minDisparity, int numberOfDisparities, + int disp12MaxDisp = 1 ); + +/** @brief Reprojects a disparity image to 3D space. + +@param disparity Input single-channel 8-bit unsigned, 16-bit signed, 32-bit signed or 32-bit +floating-point disparity image. If 16-bit signed format is used, the values are assumed to have no +fractional bits. +@param _3dImage Output 3-channel floating-point image of the same size as disparity . Each +element of _3dImage(x,y) contains 3D coordinates of the point (x,y) computed from the disparity +map. +@param Q \f$4 \times 4\f$ perspective transformation matrix that can be obtained with stereoRectify. +@param handleMissingValues Indicates, whether the function should handle missing values (i.e. +points where the disparity was not computed). If handleMissingValues=true, then pixels with the +minimal disparity that corresponds to the outliers (see StereoMatcher::compute ) are transformed +to 3D points with a very large Z value (currently set to 10000). +@param ddepth The optional output array depth. If it is -1, the output image will have CV_32F +depth. ddepth can also be set to CV_16S, CV_32S or CV_32F. + +The function transforms a single-channel disparity map to a 3-channel image representing a 3D +surface. That is, for each pixel (x,y) andthe corresponding disparity d=disparity(x,y) , it +computes: + +\f[\begin{array}{l} [X \; Y \; Z \; W]^T = \texttt{Q} *[x \; y \; \texttt{disparity} (x,y) \; 1]^T \\ \texttt{\_3dImage} (x,y) = (X/W, \; Y/W, \; Z/W) \end{array}\f] + +The matrix Q can be an arbitrary \f$4 \times 4\f$ matrix (for example, the one computed by +stereoRectify). To reproject a sparse set of points {(x,y,d),...} to 3D space, use +perspectiveTransform . + */ +CV_EXPORTS_W void reprojectImageTo3D( InputArray disparity, + OutputArray _3dImage, InputArray Q, + bool handleMissingValues = false, + int ddepth = -1 ); + +/** @brief Calculates the Sampson Distance between two points. + +The function sampsonDistance calculates and returns the first order approximation of the geometric error as: +\f[sd( \texttt{pt1} , \texttt{pt2} )= \frac{(\texttt{pt2}^t \cdot \texttt{F} \cdot \texttt{pt1})^2}{(\texttt{F} \cdot \texttt{pt1})(0) + (\texttt{F} \cdot \texttt{pt1})(1) + (\texttt{F}^t \cdot \texttt{pt2})(0) + (\texttt{F}^t \cdot \texttt{pt2})(1)}\f] +The fundamental matrix may be calculated using the cv::findFundamentalMat function. See HZ 11.4.3 for details. +@param pt1 first homogeneous 2d point +@param pt2 second homogeneous 2d point +@param F fundamental matrix +*/ +CV_EXPORTS_W double sampsonDistance(InputArray pt1, InputArray pt2, InputArray F); + +/** @brief Computes an optimal affine transformation between two 3D point sets. + +@param src First input 3D point set. +@param dst Second input 3D point set. +@param out Output 3D affine transformation matrix \f$3 \times 4\f$ . +@param inliers Output vector indicating which points are inliers. +@param ransacThreshold Maximum reprojection error in the RANSAC algorithm to consider a point as +an inlier. +@param confidence Confidence level, between 0 and 1, for the estimated transformation. Anything +between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation +significantly. Values lower than 0.8-0.9 can result in an incorrectly estimated transformation. + +The function estimates an optimal 3D affine transformation between two 3D point sets using the +RANSAC algorithm. + */ +CV_EXPORTS_W int estimateAffine3D(InputArray src, InputArray dst, + OutputArray out, OutputArray inliers, + double ransacThreshold = 3, double confidence = 0.99); + +/** @brief Decompose a homography matrix to rotation(s), translation(s) and plane normal(s). + +@param H The input homography matrix between two images. +@param K The input intrinsic camera calibration matrix. +@param rotations Array of rotation matrices. +@param translations Array of translation matrices. +@param normals Array of plane normal matrices. + +This function extracts relative camera motion between two views observing a planar object from the +homography H induced by the plane. The intrinsic camera matrix K must also be provided. The function +may return up to four mathematical solution sets. At least two of the solutions may further be +invalidated if point correspondences are available by applying positive depth constraint (all points +must be in front of the camera). The decomposition method is described in detail in @cite Malis . + */ +CV_EXPORTS_W int decomposeHomographyMat(InputArray H, + InputArray K, + OutputArrayOfArrays rotations, + OutputArrayOfArrays translations, + OutputArrayOfArrays normals); + +/** @brief The base class for stereo correspondence algorithms. + */ +class CV_EXPORTS_W StereoMatcher : public Algorithm +{ +public: + enum { DISP_SHIFT = 4, + DISP_SCALE = (1 << DISP_SHIFT) + }; + + /** @brief Computes disparity map for the specified stereo pair + + @param left Left 8-bit single-channel image. + @param right Right image of the same size and the same type as the left one. + @param disparity Output disparity map. It has the same size as the input images. Some algorithms, + like StereoBM or StereoSGBM compute 16-bit fixed-point disparity map (where each disparity value + has 4 fractional bits), whereas other algorithms output 32-bit floating-point disparity map. + */ + CV_WRAP virtual void compute( InputArray left, InputArray right, + OutputArray disparity ) = 0; + + CV_WRAP virtual int getMinDisparity() const = 0; + CV_WRAP virtual void setMinDisparity(int minDisparity) = 0; + + CV_WRAP virtual int getNumDisparities() const = 0; + CV_WRAP virtual void setNumDisparities(int numDisparities) = 0; + + CV_WRAP virtual int getBlockSize() const = 0; + CV_WRAP virtual void setBlockSize(int blockSize) = 0; + + CV_WRAP virtual int getSpeckleWindowSize() const = 0; + CV_WRAP virtual void setSpeckleWindowSize(int speckleWindowSize) = 0; + + CV_WRAP virtual int getSpeckleRange() const = 0; + CV_WRAP virtual void setSpeckleRange(int speckleRange) = 0; + + CV_WRAP virtual int getDisp12MaxDiff() const = 0; + CV_WRAP virtual void setDisp12MaxDiff(int disp12MaxDiff) = 0; +}; + + +/** @brief Class for computing stereo correspondence using the block matching algorithm, introduced and +contributed to OpenCV by K. Konolige. + */ +class CV_EXPORTS_W StereoBM : public StereoMatcher +{ +public: + enum { PREFILTER_NORMALIZED_RESPONSE = 0, + PREFILTER_XSOBEL = 1 + }; + + CV_WRAP virtual int getPreFilterType() const = 0; + CV_WRAP virtual void setPreFilterType(int preFilterType) = 0; + + CV_WRAP virtual int getPreFilterSize() const = 0; + CV_WRAP virtual void setPreFilterSize(int preFilterSize) = 0; + + CV_WRAP virtual int getPreFilterCap() const = 0; + CV_WRAP virtual void setPreFilterCap(int preFilterCap) = 0; + + CV_WRAP virtual int getTextureThreshold() const = 0; + CV_WRAP virtual void setTextureThreshold(int textureThreshold) = 0; + + CV_WRAP virtual int getUniquenessRatio() const = 0; + CV_WRAP virtual void setUniquenessRatio(int uniquenessRatio) = 0; + + CV_WRAP virtual int getSmallerBlockSize() const = 0; + CV_WRAP virtual void setSmallerBlockSize(int blockSize) = 0; + + CV_WRAP virtual Rect getROI1() const = 0; + CV_WRAP virtual void setROI1(Rect roi1) = 0; + + CV_WRAP virtual Rect getROI2() const = 0; + CV_WRAP virtual void setROI2(Rect roi2) = 0; + + /** @brief Creates StereoBM object + + @param numDisparities the disparity search range. For each pixel algorithm will find the best + disparity from 0 (default minimum disparity) to numDisparities. The search range can then be + shifted by changing the minimum disparity. + @param blockSize the linear size of the blocks compared by the algorithm. The size should be odd + (as the block is centered at the current pixel). Larger block size implies smoother, though less + accurate disparity map. Smaller block size gives more detailed disparity map, but there is higher + chance for algorithm to find a wrong correspondence. + + The function create StereoBM object. You can then call StereoBM::compute() to compute disparity for + a specific stereo pair. + */ + CV_WRAP static Ptr create(int numDisparities = 0, int blockSize = 21); +}; + +/** @brief The class implements the modified H. Hirschmuller algorithm @cite HH08 that differs from the original +one as follows: + +- By default, the algorithm is single-pass, which means that you consider only 5 directions +instead of 8. Set mode=StereoSGBM::MODE_HH in createStereoSGBM to run the full variant of the +algorithm but beware that it may consume a lot of memory. +- The algorithm matches blocks, not individual pixels. Though, setting blockSize=1 reduces the +blocks to single pixels. +- Mutual information cost function is not implemented. Instead, a simpler Birchfield-Tomasi +sub-pixel metric from @cite BT98 is used. Though, the color images are supported as well. +- Some pre- and post- processing steps from K. Konolige algorithm StereoBM are included, for +example: pre-filtering (StereoBM::PREFILTER_XSOBEL type) and post-filtering (uniqueness +check, quadratic interpolation and speckle filtering). + +@note + - (Python) An example illustrating the use of the StereoSGBM matching algorithm can be found + at opencv_source_code/samples/python/stereo_match.py + */ +class CV_EXPORTS_W StereoSGBM : public StereoMatcher +{ +public: + enum + { + MODE_SGBM = 0, + MODE_HH = 1, + MODE_SGBM_3WAY = 2 + }; + + CV_WRAP virtual int getPreFilterCap() const = 0; + CV_WRAP virtual void setPreFilterCap(int preFilterCap) = 0; + + CV_WRAP virtual int getUniquenessRatio() const = 0; + CV_WRAP virtual void setUniquenessRatio(int uniquenessRatio) = 0; + + CV_WRAP virtual int getP1() const = 0; + CV_WRAP virtual void setP1(int P1) = 0; + + CV_WRAP virtual int getP2() const = 0; + CV_WRAP virtual void setP2(int P2) = 0; + + CV_WRAP virtual int getMode() const = 0; + CV_WRAP virtual void setMode(int mode) = 0; + + /** @brief Creates StereoSGBM object + + @param minDisparity Minimum possible disparity value. Normally, it is zero but sometimes + rectification algorithms can shift images, so this parameter needs to be adjusted accordingly. + @param numDisparities Maximum disparity minus minimum disparity. The value is always greater than + zero. In the current implementation, this parameter must be divisible by 16. + @param blockSize Matched block size. It must be an odd number \>=1 . Normally, it should be + somewhere in the 3..11 range. + @param P1 The first parameter controlling the disparity smoothness. See below. + @param P2 The second parameter controlling the disparity smoothness. The larger the values are, + the smoother the disparity is. P1 is the penalty on the disparity change by plus or minus 1 + between neighbor pixels. P2 is the penalty on the disparity change by more than 1 between neighbor + pixels. The algorithm requires P2 \> P1 . See stereo_match.cpp sample where some reasonably good + P1 and P2 values are shown (like 8\*number_of_image_channels\*SADWindowSize\*SADWindowSize and + 32\*number_of_image_channels\*SADWindowSize\*SADWindowSize , respectively). + @param disp12MaxDiff Maximum allowed difference (in integer pixel units) in the left-right + disparity check. Set it to a non-positive value to disable the check. + @param preFilterCap Truncation value for the prefiltered image pixels. The algorithm first + computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval. + The result values are passed to the Birchfield-Tomasi pixel cost function. + @param uniquenessRatio Margin in percentage by which the best (minimum) computed cost function + value should "win" the second best value to consider the found match correct. Normally, a value + within the 5-15 range is good enough. + @param speckleWindowSize Maximum size of smooth disparity regions to consider their noise speckles + and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the + 50-200 range. + @param speckleRange Maximum disparity variation within each connected component. If you do speckle + filtering, set the parameter to a positive value, it will be implicitly multiplied by 16. + Normally, 1 or 2 is good enough. + @param mode Set it to StereoSGBM::MODE_HH to run the full-scale two-pass dynamic programming + algorithm. It will consume O(W\*H\*numDisparities) bytes, which is large for 640x480 stereo and + huge for HD-size pictures. By default, it is set to false . + + The first constructor initializes StereoSGBM with all the default parameters. So, you only have to + set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter + to a custom value. + */ + CV_WRAP static Ptr create(int minDisparity, int numDisparities, int blockSize, + int P1 = 0, int P2 = 0, int disp12MaxDiff = 0, + int preFilterCap = 0, int uniquenessRatio = 0, + int speckleWindowSize = 0, int speckleRange = 0, + int mode = StereoSGBM::MODE_SGBM); +}; + +//! @} calib3d + +/** @brief The methods in this namespace use a so-called fisheye camera model. + @ingroup calib3d_fisheye +*/ +namespace fisheye +{ +//! @addtogroup calib3d_fisheye +//! @{ + + enum{ + CALIB_USE_INTRINSIC_GUESS = 1, + CALIB_RECOMPUTE_EXTRINSIC = 2, + CALIB_CHECK_COND = 4, + CALIB_FIX_SKEW = 8, + CALIB_FIX_K1 = 16, + CALIB_FIX_K2 = 32, + CALIB_FIX_K3 = 64, + CALIB_FIX_K4 = 128, + CALIB_FIX_INTRINSIC = 256 + }; + + /** @brief Projects points using fisheye model + + @param objectPoints Array of object points, 1xN/Nx1 3-channel (or vector\ ), where N is + the number of points in the view. + @param imagePoints Output array of image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, or + vector\. + @param affine + @param K Camera matrix \f$K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}\f$. + @param D Input vector of distortion coefficients \f$(k_1, k_2, k_3, k_4)\f$. + @param alpha The skew coefficient. + @param jacobian Optional output 2Nx15 jacobian matrix of derivatives of image points with respect + to components of the focal lengths, coordinates of the principal point, distortion coefficients, + rotation vector, translation vector, and the skew. In the old interface different components of + the jacobian are returned via different output parameters. + + The function computes projections of 3D points to the image plane given intrinsic and extrinsic + camera parameters. Optionally, the function computes Jacobians - matrices of partial derivatives of + image points coordinates (as functions of all the input parameters) with respect to the particular + parameters, intrinsic and/or extrinsic. + */ + CV_EXPORTS void projectPoints(InputArray objectPoints, OutputArray imagePoints, const Affine3d& affine, + InputArray K, InputArray D, double alpha = 0, OutputArray jacobian = noArray()); + + /** @overload */ + CV_EXPORTS_W void projectPoints(InputArray objectPoints, OutputArray imagePoints, InputArray rvec, InputArray tvec, + InputArray K, InputArray D, double alpha = 0, OutputArray jacobian = noArray()); + + /** @brief Distorts 2D points using fisheye model. + + @param undistorted Array of object points, 1xN/Nx1 2-channel (or vector\ ), where N is + the number of points in the view. + @param K Camera matrix \f$K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}\f$. + @param D Input vector of distortion coefficients \f$(k_1, k_2, k_3, k_4)\f$. + @param alpha The skew coefficient. + @param distorted Output array of image points, 1xN/Nx1 2-channel, or vector\ . + */ + CV_EXPORTS_W void distortPoints(InputArray undistorted, OutputArray distorted, InputArray K, InputArray D, double alpha = 0); + + /** @brief Undistorts 2D points using fisheye model + + @param distorted Array of object points, 1xN/Nx1 2-channel (or vector\ ), where N is the + number of points in the view. + @param K Camera matrix \f$K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}\f$. + @param D Input vector of distortion coefficients \f$(k_1, k_2, k_3, k_4)\f$. + @param R Rectification transformation in the object space: 3x3 1-channel, or vector: 3x1/1x3 + 1-channel or 1x1 3-channel + @param P New camera matrix (3x3) or new projection matrix (3x4) + @param undistorted Output array of image points, 1xN/Nx1 2-channel, or vector\ . + */ + CV_EXPORTS_W void undistortPoints(InputArray distorted, OutputArray undistorted, + InputArray K, InputArray D, InputArray R = noArray(), InputArray P = noArray()); + + /** @brief Computes undistortion and rectification maps for image transform by cv::remap(). If D is empty zero + distortion is used, if R or P is empty identity matrixes are used. + + @param K Camera matrix \f$K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}\f$. + @param D Input vector of distortion coefficients \f$(k_1, k_2, k_3, k_4)\f$. + @param R Rectification transformation in the object space: 3x3 1-channel, or vector: 3x1/1x3 + 1-channel or 1x1 3-channel + @param P New camera matrix (3x3) or new projection matrix (3x4) + @param size Undistorted image size. + @param m1type Type of the first output map that can be CV_32FC1 or CV_16SC2 . See convertMaps() + for details. + @param map1 The first output map. + @param map2 The second output map. + */ + CV_EXPORTS_W void initUndistortRectifyMap(InputArray K, InputArray D, InputArray R, InputArray P, + const cv::Size& size, int m1type, OutputArray map1, OutputArray map2); + + /** @brief Transforms an image to compensate for fisheye lens distortion. + + @param distorted image with fisheye lens distortion. + @param undistorted Output image with compensated fisheye lens distortion. + @param K Camera matrix \f$K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}\f$. + @param D Input vector of distortion coefficients \f$(k_1, k_2, k_3, k_4)\f$. + @param Knew Camera matrix of the distorted image. By default, it is the identity matrix but you + may additionally scale and shift the result by using a different matrix. + @param new_size + + The function transforms an image to compensate radial and tangential lens distortion. + + The function is simply a combination of fisheye::initUndistortRectifyMap (with unity R ) and remap + (with bilinear interpolation). See the former function for details of the transformation being + performed. + + See below the results of undistortImage. + - a\) result of undistort of perspective camera model (all possible coefficients (k_1, k_2, k_3, + k_4, k_5, k_6) of distortion were optimized under calibration) + - b\) result of fisheye::undistortImage of fisheye camera model (all possible coefficients (k_1, k_2, + k_3, k_4) of fisheye distortion were optimized under calibration) + - c\) original image was captured with fisheye lens + + Pictures a) and b) almost the same. But if we consider points of image located far from the center + of image, we can notice that on image a) these points are distorted. + + ![image](pics/fisheye_undistorted.jpg) + */ + CV_EXPORTS_W void undistortImage(InputArray distorted, OutputArray undistorted, + InputArray K, InputArray D, InputArray Knew = cv::noArray(), const Size& new_size = Size()); + + /** @brief Estimates new camera matrix for undistortion or rectification. + + @param K Camera matrix \f$K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}\f$. + @param image_size + @param D Input vector of distortion coefficients \f$(k_1, k_2, k_3, k_4)\f$. + @param R Rectification transformation in the object space: 3x3 1-channel, or vector: 3x1/1x3 + 1-channel or 1x1 3-channel + @param P New camera matrix (3x3) or new projection matrix (3x4) + @param balance Sets the new focal length in range between the min focal length and the max focal + length. Balance is in range of [0, 1]. + @param new_size + @param fov_scale Divisor for new focal length. + */ + CV_EXPORTS_W void estimateNewCameraMatrixForUndistortRectify(InputArray K, InputArray D, const Size &image_size, InputArray R, + OutputArray P, double balance = 0.0, const Size& new_size = Size(), double fov_scale = 1.0); + + /** @brief Performs camera calibaration + + @param objectPoints vector of vectors of calibration pattern points in the calibration pattern + coordinate space. + @param imagePoints vector of vectors of the projections of calibration pattern points. + imagePoints.size() and objectPoints.size() and imagePoints[i].size() must be equal to + objectPoints[i].size() for each i. + @param image_size Size of the image used only to initialize the intrinsic camera matrix. + @param K Output 3x3 floating-point camera matrix + \f$A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ . If + fisheye::CALIB_USE_INTRINSIC_GUESS/ is specified, some or all of fx, fy, cx, cy must be + initialized before calling the function. + @param D Output vector of distortion coefficients \f$(k_1, k_2, k_3, k_4)\f$. + @param rvecs Output vector of rotation vectors (see Rodrigues ) estimated for each pattern view. + That is, each k-th rotation vector together with the corresponding k-th translation vector (see + the next output parameter description) brings the calibration pattern from the model coordinate + space (in which object points are specified) to the world coordinate space, that is, a real + position of the calibration pattern in the k-th pattern view (k=0.. *M* -1). + @param tvecs Output vector of translation vectors estimated for each pattern view. + @param flags Different flags that may be zero or a combination of the following values: + - **fisheye::CALIB_USE_INTRINSIC_GUESS** cameraMatrix contains valid initial values of + fx, fy, cx, cy that are optimized further. Otherwise, (cx, cy) is initially set to the image + center ( imageSize is used), and focal distances are computed in a least-squares fashion. + - **fisheye::CALIB_RECOMPUTE_EXTRINSIC** Extrinsic will be recomputed after each iteration + of intrinsic optimization. + - **fisheye::CALIB_CHECK_COND** The functions will check validity of condition number. + - **fisheye::CALIB_FIX_SKEW** Skew coefficient (alpha) is set to zero and stay zero. + - **fisheye::CALIB_FIX_K1..4** Selected distortion coefficients are set to zeros and stay + zero. + @param criteria Termination criteria for the iterative optimization algorithm. + */ + CV_EXPORTS_W double calibrate(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints, const Size& image_size, + InputOutputArray K, InputOutputArray D, OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, int flags = 0, + TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON)); + + /** @brief Stereo rectification for fisheye camera model + + @param K1 First camera matrix. + @param D1 First camera distortion parameters. + @param K2 Second camera matrix. + @param D2 Second camera distortion parameters. + @param imageSize Size of the image used for stereo calibration. + @param R Rotation matrix between the coordinate systems of the first and the second + cameras. + @param tvec Translation vector between coordinate systems of the cameras. + @param R1 Output 3x3 rectification transform (rotation matrix) for the first camera. + @param R2 Output 3x3 rectification transform (rotation matrix) for the second camera. + @param P1 Output 3x4 projection matrix in the new (rectified) coordinate systems for the first + camera. + @param P2 Output 3x4 projection matrix in the new (rectified) coordinate systems for the second + camera. + @param Q Output \f$4 \times 4\f$ disparity-to-depth mapping matrix (see reprojectImageTo3D ). + @param flags Operation flags that may be zero or CV_CALIB_ZERO_DISPARITY . If the flag is set, + the function makes the principal points of each camera have the same pixel coordinates in the + rectified views. And if the flag is not set, the function may still shift the images in the + horizontal or vertical direction (depending on the orientation of epipolar lines) to maximize the + useful image area. + @param newImageSize New image resolution after rectification. The same size should be passed to + initUndistortRectifyMap (see the stereo_calib.cpp sample in OpenCV samples directory). When (0,0) + is passed (default), it is set to the original imageSize . Setting it to larger value can help you + preserve details in the original image, especially when there is a big radial distortion. + @param balance Sets the new focal length in range between the min focal length and the max focal + length. Balance is in range of [0, 1]. + @param fov_scale Divisor for new focal length. + */ + CV_EXPORTS_W void stereoRectify(InputArray K1, InputArray D1, InputArray K2, InputArray D2, const Size &imageSize, InputArray R, InputArray tvec, + OutputArray R1, OutputArray R2, OutputArray P1, OutputArray P2, OutputArray Q, int flags, const Size &newImageSize = Size(), + double balance = 0.0, double fov_scale = 1.0); + + /** @brief Performs stereo calibration + + @param objectPoints Vector of vectors of the calibration pattern points. + @param imagePoints1 Vector of vectors of the projections of the calibration pattern points, + observed by the first camera. + @param imagePoints2 Vector of vectors of the projections of the calibration pattern points, + observed by the second camera. + @param K1 Input/output first camera matrix: + \f$\vecthreethree{f_x^{(j)}}{0}{c_x^{(j)}}{0}{f_y^{(j)}}{c_y^{(j)}}{0}{0}{1}\f$ , \f$j = 0,\, 1\f$ . If + any of fisheye::CALIB_USE_INTRINSIC_GUESS , fisheye::CV_CALIB_FIX_INTRINSIC are specified, + some or all of the matrix components must be initialized. + @param D1 Input/output vector of distortion coefficients \f$(k_1, k_2, k_3, k_4)\f$ of 4 elements. + @param K2 Input/output second camera matrix. The parameter is similar to K1 . + @param D2 Input/output lens distortion coefficients for the second camera. The parameter is + similar to D1 . + @param imageSize Size of the image used only to initialize intrinsic camera matrix. + @param R Output rotation matrix between the 1st and the 2nd camera coordinate systems. + @param T Output translation vector between the coordinate systems of the cameras. + @param flags Different flags that may be zero or a combination of the following values: + - **fisheye::CV_CALIB_FIX_INTRINSIC** Fix K1, K2? and D1, D2? so that only R, T matrices + are estimated. + - **fisheye::CALIB_USE_INTRINSIC_GUESS** K1, K2 contains valid initial values of + fx, fy, cx, cy that are optimized further. Otherwise, (cx, cy) is initially set to the image + center (imageSize is used), and focal distances are computed in a least-squares fashion. + - **fisheye::CALIB_RECOMPUTE_EXTRINSIC** Extrinsic will be recomputed after each iteration + of intrinsic optimization. + - **fisheye::CALIB_CHECK_COND** The functions will check validity of condition number. + - **fisheye::CALIB_FIX_SKEW** Skew coefficient (alpha) is set to zero and stay zero. + - **fisheye::CALIB_FIX_K1..4** Selected distortion coefficients are set to zeros and stay + zero. + @param criteria Termination criteria for the iterative optimization algorithm. + */ + CV_EXPORTS_W double stereoCalibrate(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints1, InputArrayOfArrays imagePoints2, + InputOutputArray K1, InputOutputArray D1, InputOutputArray K2, InputOutputArray D2, Size imageSize, + OutputArray R, OutputArray T, int flags = fisheye::CALIB_FIX_INTRINSIC, + TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON)); + +//! @} calib3d_fisheye +} + +} // cv + +#ifndef DISABLE_OPENCV_24_COMPATIBILITY +#include "opencv2/calib3d/calib3d_c.h" +#endif + +#endif diff --git a/lib/opencv/include/opencv2/calib3d/calib3d.hpp b/lib/opencv/include/opencv2/calib3d/calib3d.hpp new file mode 100644 index 000000000..b3da45edd --- /dev/null +++ b/lib/opencv/include/opencv2/calib3d/calib3d.hpp @@ -0,0 +1,48 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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*/ + +#ifdef __OPENCV_BUILD +#error this is a compatibility header which should not be used inside the OpenCV library +#endif + +#include "opencv2/calib3d.hpp" diff --git a/lib/opencv/include/opencv2/calib3d/calib3d_c.h b/lib/opencv/include/opencv2/calib3d/calib3d_c.h new file mode 100644 index 000000000..0e77aa883 --- /dev/null +++ b/lib/opencv/include/opencv2/calib3d/calib3d_c.h @@ -0,0 +1,425 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_CALIB3D_C_H__ +#define __OPENCV_CALIB3D_C_H__ + +#include "opencv2/core/core_c.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup calib3d_c + @{ + */ + +/****************************************************************************************\ +* Camera Calibration, Pose Estimation and Stereo * +\****************************************************************************************/ + +typedef struct CvPOSITObject CvPOSITObject; + +/* Allocates and initializes CvPOSITObject structure before doing cvPOSIT */ +CVAPI(CvPOSITObject*) cvCreatePOSITObject( CvPoint3D32f* points, int point_count ); + + +/* Runs POSIT (POSe from ITeration) algorithm for determining 3d position of + an object given its model and projection in a weak-perspective case */ +CVAPI(void) cvPOSIT( CvPOSITObject* posit_object, CvPoint2D32f* image_points, + double focal_length, CvTermCriteria criteria, + float* rotation_matrix, float* translation_vector); + +/* Releases CvPOSITObject structure */ +CVAPI(void) cvReleasePOSITObject( CvPOSITObject** posit_object ); + +/* updates the number of RANSAC iterations */ +CVAPI(int) cvRANSACUpdateNumIters( double p, double err_prob, + int model_points, int max_iters ); + +CVAPI(void) cvConvertPointsHomogeneous( const CvMat* src, CvMat* dst ); + +/* Calculates fundamental matrix given a set of corresponding points */ +#define CV_FM_7POINT 1 +#define CV_FM_8POINT 2 + +#define CV_LMEDS 4 +#define CV_RANSAC 8 + +#define CV_FM_LMEDS_ONLY CV_LMEDS +#define CV_FM_RANSAC_ONLY CV_RANSAC +#define CV_FM_LMEDS CV_LMEDS +#define CV_FM_RANSAC CV_RANSAC + +enum +{ + CV_ITERATIVE = 0, + CV_EPNP = 1, // F.Moreno-Noguer, V.Lepetit and P.Fua "EPnP: Efficient Perspective-n-Point Camera Pose Estimation" + CV_P3P = 2, // X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang; "Complete Solution Classification for the Perspective-Three-Point Problem" + CV_DLS = 3 // Joel A. Hesch and Stergios I. Roumeliotis. "A Direct Least-Squares (DLS) Method for PnP" +}; + +CVAPI(int) cvFindFundamentalMat( const CvMat* points1, const CvMat* points2, + CvMat* fundamental_matrix, + int method CV_DEFAULT(CV_FM_RANSAC), + double param1 CV_DEFAULT(3.), double param2 CV_DEFAULT(0.99), + CvMat* status CV_DEFAULT(NULL) ); + +/* For each input point on one of images + computes parameters of the corresponding + epipolar line on the other image */ +CVAPI(void) cvComputeCorrespondEpilines( const CvMat* points, + int which_image, + const CvMat* fundamental_matrix, + CvMat* correspondent_lines ); + +/* Triangulation functions */ + +CVAPI(void) cvTriangulatePoints(CvMat* projMatr1, CvMat* projMatr2, + CvMat* projPoints1, CvMat* projPoints2, + CvMat* points4D); + +CVAPI(void) cvCorrectMatches(CvMat* F, CvMat* points1, CvMat* points2, + CvMat* new_points1, CvMat* new_points2); + + +/* Computes the optimal new camera matrix according to the free scaling parameter alpha: + alpha=0 - only valid pixels will be retained in the undistorted image + alpha=1 - all the source image pixels will be retained in the undistorted image +*/ +CVAPI(void) cvGetOptimalNewCameraMatrix( const CvMat* camera_matrix, + const CvMat* dist_coeffs, + CvSize image_size, double alpha, + CvMat* new_camera_matrix, + CvSize new_imag_size CV_DEFAULT(cvSize(0,0)), + CvRect* valid_pixel_ROI CV_DEFAULT(0), + int center_principal_point CV_DEFAULT(0)); + +/* Converts rotation vector to rotation matrix or vice versa */ +CVAPI(int) cvRodrigues2( const CvMat* src, CvMat* dst, + CvMat* jacobian CV_DEFAULT(0) ); + +/* Finds perspective transformation between the object plane and image (view) plane */ +CVAPI(int) cvFindHomography( const CvMat* src_points, + const CvMat* dst_points, + CvMat* homography, + int method CV_DEFAULT(0), + double ransacReprojThreshold CV_DEFAULT(3), + CvMat* mask CV_DEFAULT(0), + int maxIters CV_DEFAULT(2000), + double confidence CV_DEFAULT(0.995)); + +/* Computes RQ decomposition for 3x3 matrices */ +CVAPI(void) cvRQDecomp3x3( const CvMat *matrixM, CvMat *matrixR, CvMat *matrixQ, + CvMat *matrixQx CV_DEFAULT(NULL), + CvMat *matrixQy CV_DEFAULT(NULL), + CvMat *matrixQz CV_DEFAULT(NULL), + CvPoint3D64f *eulerAngles CV_DEFAULT(NULL)); + +/* Computes projection matrix decomposition */ +CVAPI(void) cvDecomposeProjectionMatrix( const CvMat *projMatr, CvMat *calibMatr, + CvMat *rotMatr, CvMat *posVect, + CvMat *rotMatrX CV_DEFAULT(NULL), + CvMat *rotMatrY CV_DEFAULT(NULL), + CvMat *rotMatrZ CV_DEFAULT(NULL), + CvPoint3D64f *eulerAngles CV_DEFAULT(NULL)); + +/* Computes d(AB)/dA and d(AB)/dB */ +CVAPI(void) cvCalcMatMulDeriv( const CvMat* A, const CvMat* B, CvMat* dABdA, CvMat* dABdB ); + +/* Computes r3 = rodrigues(rodrigues(r2)*rodrigues(r1)), + t3 = rodrigues(r2)*t1 + t2 and the respective derivatives */ +CVAPI(void) cvComposeRT( const CvMat* _rvec1, const CvMat* _tvec1, + const CvMat* _rvec2, const CvMat* _tvec2, + CvMat* _rvec3, CvMat* _tvec3, + CvMat* dr3dr1 CV_DEFAULT(0), CvMat* dr3dt1 CV_DEFAULT(0), + CvMat* dr3dr2 CV_DEFAULT(0), CvMat* dr3dt2 CV_DEFAULT(0), + CvMat* dt3dr1 CV_DEFAULT(0), CvMat* dt3dt1 CV_DEFAULT(0), + CvMat* dt3dr2 CV_DEFAULT(0), CvMat* dt3dt2 CV_DEFAULT(0) ); + +/* Projects object points to the view plane using + the specified extrinsic and intrinsic camera parameters */ +CVAPI(void) cvProjectPoints2( const CvMat* object_points, const CvMat* rotation_vector, + const CvMat* translation_vector, const CvMat* camera_matrix, + const CvMat* distortion_coeffs, CvMat* image_points, + CvMat* dpdrot CV_DEFAULT(NULL), CvMat* dpdt CV_DEFAULT(NULL), + CvMat* dpdf CV_DEFAULT(NULL), CvMat* dpdc CV_DEFAULT(NULL), + CvMat* dpddist CV_DEFAULT(NULL), + double aspect_ratio CV_DEFAULT(0)); + +/* Finds extrinsic camera parameters from + a few known corresponding point pairs and intrinsic parameters */ +CVAPI(void) cvFindExtrinsicCameraParams2( const CvMat* object_points, + const CvMat* image_points, + const CvMat* camera_matrix, + const CvMat* distortion_coeffs, + CvMat* rotation_vector, + CvMat* translation_vector, + int use_extrinsic_guess CV_DEFAULT(0) ); + +/* Computes initial estimate of the intrinsic camera parameters + in case of planar calibration target (e.g. chessboard) */ +CVAPI(void) cvInitIntrinsicParams2D( const CvMat* object_points, + const CvMat* image_points, + const CvMat* npoints, CvSize image_size, + CvMat* camera_matrix, + double aspect_ratio CV_DEFAULT(1.) ); + +#define CV_CALIB_CB_ADAPTIVE_THRESH 1 +#define CV_CALIB_CB_NORMALIZE_IMAGE 2 +#define CV_CALIB_CB_FILTER_QUADS 4 +#define CV_CALIB_CB_FAST_CHECK 8 + +// Performs a fast check if a chessboard is in the input image. This is a workaround to +// a problem of cvFindChessboardCorners being slow on images with no chessboard +// - src: input image +// - size: chessboard size +// Returns 1 if a chessboard can be in this image and findChessboardCorners should be called, +// 0 if there is no chessboard, -1 in case of error +CVAPI(int) cvCheckChessboard(IplImage* src, CvSize size); + + /* Detects corners on a chessboard calibration pattern */ +CVAPI(int) cvFindChessboardCorners( const void* image, CvSize pattern_size, + CvPoint2D32f* corners, + int* corner_count CV_DEFAULT(NULL), + int flags CV_DEFAULT(CV_CALIB_CB_ADAPTIVE_THRESH+CV_CALIB_CB_NORMALIZE_IMAGE) ); + +/* Draws individual chessboard corners or the whole chessboard detected */ +CVAPI(void) cvDrawChessboardCorners( CvArr* image, CvSize pattern_size, + CvPoint2D32f* corners, + int count, int pattern_was_found ); + +#define CV_CALIB_USE_INTRINSIC_GUESS 1 +#define CV_CALIB_FIX_ASPECT_RATIO 2 +#define CV_CALIB_FIX_PRINCIPAL_POINT 4 +#define CV_CALIB_ZERO_TANGENT_DIST 8 +#define CV_CALIB_FIX_FOCAL_LENGTH 16 +#define CV_CALIB_FIX_K1 32 +#define CV_CALIB_FIX_K2 64 +#define CV_CALIB_FIX_K3 128 +#define CV_CALIB_FIX_K4 2048 +#define CV_CALIB_FIX_K5 4096 +#define CV_CALIB_FIX_K6 8192 +#define CV_CALIB_RATIONAL_MODEL 16384 +#define CV_CALIB_THIN_PRISM_MODEL 32768 +#define CV_CALIB_FIX_S1_S2_S3_S4 65536 +#define CV_CALIB_TILTED_MODEL 262144 +#define CV_CALIB_FIX_TAUX_TAUY 524288 + + +/* Finds intrinsic and extrinsic camera parameters + from a few views of known calibration pattern */ +CVAPI(double) cvCalibrateCamera2( const CvMat* object_points, + const CvMat* image_points, + const CvMat* point_counts, + CvSize image_size, + CvMat* camera_matrix, + CvMat* distortion_coeffs, + CvMat* rotation_vectors CV_DEFAULT(NULL), + CvMat* translation_vectors CV_DEFAULT(NULL), + int flags CV_DEFAULT(0), + CvTermCriteria term_crit CV_DEFAULT(cvTermCriteria( + CV_TERMCRIT_ITER+CV_TERMCRIT_EPS,30,DBL_EPSILON)) ); + +/* Computes various useful characteristics of the camera from the data computed by + cvCalibrateCamera2 */ +CVAPI(void) cvCalibrationMatrixValues( const CvMat *camera_matrix, + CvSize image_size, + double aperture_width CV_DEFAULT(0), + double aperture_height CV_DEFAULT(0), + double *fovx CV_DEFAULT(NULL), + double *fovy CV_DEFAULT(NULL), + double *focal_length CV_DEFAULT(NULL), + CvPoint2D64f *principal_point CV_DEFAULT(NULL), + double *pixel_aspect_ratio CV_DEFAULT(NULL)); + +#define CV_CALIB_FIX_INTRINSIC 256 +#define CV_CALIB_SAME_FOCAL_LENGTH 512 + +/* Computes the transformation from one camera coordinate system to another one + from a few correspondent views of the same calibration target. Optionally, calibrates + both cameras */ +CVAPI(double) cvStereoCalibrate( const CvMat* object_points, const CvMat* image_points1, + const CvMat* image_points2, const CvMat* npoints, + CvMat* camera_matrix1, CvMat* dist_coeffs1, + CvMat* camera_matrix2, CvMat* dist_coeffs2, + CvSize image_size, CvMat* R, CvMat* T, + CvMat* E CV_DEFAULT(0), CvMat* F CV_DEFAULT(0), + int flags CV_DEFAULT(CV_CALIB_FIX_INTRINSIC), + CvTermCriteria term_crit CV_DEFAULT(cvTermCriteria( + CV_TERMCRIT_ITER+CV_TERMCRIT_EPS,30,1e-6)) ); + +#define CV_CALIB_ZERO_DISPARITY 1024 + +/* Computes 3D rotations (+ optional shift) for each camera coordinate system to make both + views parallel (=> to make all the epipolar lines horizontal or vertical) */ +CVAPI(void) cvStereoRectify( const CvMat* camera_matrix1, const CvMat* camera_matrix2, + const CvMat* dist_coeffs1, const CvMat* dist_coeffs2, + CvSize image_size, const CvMat* R, const CvMat* T, + CvMat* R1, CvMat* R2, CvMat* P1, CvMat* P2, + CvMat* Q CV_DEFAULT(0), + int flags CV_DEFAULT(CV_CALIB_ZERO_DISPARITY), + double alpha CV_DEFAULT(-1), + CvSize new_image_size CV_DEFAULT(cvSize(0,0)), + CvRect* valid_pix_ROI1 CV_DEFAULT(0), + CvRect* valid_pix_ROI2 CV_DEFAULT(0)); + +/* Computes rectification transformations for uncalibrated pair of images using a set + of point correspondences */ +CVAPI(int) cvStereoRectifyUncalibrated( const CvMat* points1, const CvMat* points2, + const CvMat* F, CvSize img_size, + CvMat* H1, CvMat* H2, + double threshold CV_DEFAULT(5)); + + + +/* stereo correspondence parameters and functions */ + +#define CV_STEREO_BM_NORMALIZED_RESPONSE 0 +#define CV_STEREO_BM_XSOBEL 1 + +/* Block matching algorithm structure */ +typedef struct CvStereoBMState +{ + // pre-filtering (normalization of input images) + int preFilterType; // =CV_STEREO_BM_NORMALIZED_RESPONSE now + int preFilterSize; // averaging window size: ~5x5..21x21 + int preFilterCap; // the output of pre-filtering is clipped by [-preFilterCap,preFilterCap] + + // correspondence using Sum of Absolute Difference (SAD) + int SADWindowSize; // ~5x5..21x21 + int minDisparity; // minimum disparity (can be negative) + int numberOfDisparities; // maximum disparity - minimum disparity (> 0) + + // post-filtering + int textureThreshold; // the disparity is only computed for pixels + // with textured enough neighborhood + int uniquenessRatio; // accept the computed disparity d* only if + // SAD(d) >= SAD(d*)*(1 + uniquenessRatio/100.) + // for any d != d*+/-1 within the search range. + int speckleWindowSize; // disparity variation window + int speckleRange; // acceptable range of variation in window + + int trySmallerWindows; // if 1, the results may be more accurate, + // at the expense of slower processing + CvRect roi1, roi2; + int disp12MaxDiff; + + // temporary buffers + CvMat* preFilteredImg0; + CvMat* preFilteredImg1; + CvMat* slidingSumBuf; + CvMat* cost; + CvMat* disp; +} CvStereoBMState; + +#define CV_STEREO_BM_BASIC 0 +#define CV_STEREO_BM_FISH_EYE 1 +#define CV_STEREO_BM_NARROW 2 + +CVAPI(CvStereoBMState*) cvCreateStereoBMState(int preset CV_DEFAULT(CV_STEREO_BM_BASIC), + int numberOfDisparities CV_DEFAULT(0)); + +CVAPI(void) cvReleaseStereoBMState( CvStereoBMState** state ); + +CVAPI(void) cvFindStereoCorrespondenceBM( const CvArr* left, const CvArr* right, + CvArr* disparity, CvStereoBMState* state ); + +CVAPI(CvRect) cvGetValidDisparityROI( CvRect roi1, CvRect roi2, int minDisparity, + int numberOfDisparities, int SADWindowSize ); + +CVAPI(void) cvValidateDisparity( CvArr* disparity, const CvArr* cost, + int minDisparity, int numberOfDisparities, + int disp12MaxDiff CV_DEFAULT(1) ); + +/* Reprojects the computed disparity image to the 3D space using the specified 4x4 matrix */ +CVAPI(void) cvReprojectImageTo3D( const CvArr* disparityImage, + CvArr* _3dImage, const CvMat* Q, + int handleMissingValues CV_DEFAULT(0) ); + +/** @} calib3d_c */ + +#ifdef __cplusplus +} // extern "C" + +////////////////////////////////////////////////////////////////////////////////////////// +class CV_EXPORTS CvLevMarq +{ +public: + CvLevMarq(); + CvLevMarq( int nparams, int nerrs, CvTermCriteria criteria= + cvTermCriteria(CV_TERMCRIT_EPS+CV_TERMCRIT_ITER,30,DBL_EPSILON), + bool completeSymmFlag=false ); + ~CvLevMarq(); + void init( int nparams, int nerrs, CvTermCriteria criteria= + cvTermCriteria(CV_TERMCRIT_EPS+CV_TERMCRIT_ITER,30,DBL_EPSILON), + bool completeSymmFlag=false ); + bool update( const CvMat*& param, CvMat*& J, CvMat*& err ); + bool updateAlt( const CvMat*& param, CvMat*& JtJ, CvMat*& JtErr, double*& errNorm ); + + void clear(); + void step(); + enum { DONE=0, STARTED=1, CALC_J=2, CHECK_ERR=3 }; + + cv::Ptr mask; + cv::Ptr prevParam; + cv::Ptr param; + cv::Ptr J; + cv::Ptr err; + cv::Ptr JtJ; + cv::Ptr JtJN; + cv::Ptr JtErr; + cv::Ptr JtJV; + cv::Ptr JtJW; + double prevErrNorm, errNorm; + int lambdaLg10; + CvTermCriteria criteria; + int state; + int iters; + bool completeSymmFlag; + int solveMethod; +}; + +#endif + +#endif /* __OPENCV_CALIB3D_C_H__ */ diff --git a/lib/opencv/include/opencv2/core.hpp b/lib/opencv/include/opencv2/core.hpp new file mode 100644 index 000000000..559226079 --- /dev/null +++ b/lib/opencv/include/opencv2/core.hpp @@ -0,0 +1,3168 @@ +/*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-2011, Willow Garage Inc., all rights reserved. +// Copyright (C) 2015, 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_HPP__ +#define __OPENCV_CORE_HPP__ + +#ifndef __cplusplus +# error core.hpp header must be compiled as C++ +#endif + +#include "opencv2/core/cvdef.h" +#include "opencv2/core/version.hpp" +#include "opencv2/core/base.hpp" +#include "opencv2/core/cvstd.hpp" +#include "opencv2/core/traits.hpp" +#include "opencv2/core/matx.hpp" +#include "opencv2/core/types.hpp" +#include "opencv2/core/mat.hpp" +#include "opencv2/core/persistence.hpp" + +/** +@defgroup core Core functionality +@{ + @defgroup core_basic Basic structures + @defgroup core_c C structures and operations + @{ + @defgroup core_c_glue Connections with C++ + @} + @defgroup core_array Operations on arrays + @defgroup core_xml XML/YAML Persistence + @defgroup core_cluster Clustering + @defgroup core_utils Utility and system functions and macros + @{ + @defgroup core_utils_sse SSE utilities + @defgroup core_utils_neon NEON utilities + @} + @defgroup core_opengl OpenGL interoperability + @defgroup core_ipp Intel IPP Asynchronous C/C++ Converters + @defgroup core_optim Optimization Algorithms + @defgroup core_directx DirectX interoperability + @defgroup core_eigen Eigen support + @defgroup core_opencl OpenCL support + @defgroup core_va_intel Intel VA-API/OpenCL (CL-VA) interoperability + @defgroup core_hal Hardware Acceleration Layer + @{ + @defgroup core_hal_functions Functions + @defgroup core_hal_interface Interface + @defgroup core_hal_intrin Universal intrinsics + @{ + @defgroup core_hal_intrin_impl Private implementation helpers + @} + @} +@} + */ + +namespace cv { + +//! @addtogroup core_utils +//! @{ + +/*! @brief Class passed to an error. + +This class encapsulates all or almost all necessary +information about the error happened in the program. The exception is +usually constructed and thrown implicitly via CV_Error and CV_Error_ macros. +@see error + */ +class CV_EXPORTS Exception : public std::exception +{ +public: + /*! + Default constructor + */ + Exception(); + /*! + Full constructor. Normally the constuctor is not called explicitly. + Instead, the macros CV_Error(), CV_Error_() and CV_Assert() are used. + */ + Exception(int _code, const String& _err, const String& _func, const String& _file, int _line); + virtual ~Exception() throw(); + + /*! + \return the error description and the context as a text string. + */ + virtual const char *what() const throw(); + void formatMessage(); + + String msg; ///< the formatted error message + + int code; ///< error code @see CVStatus + String err; ///< error description + String func; ///< function name. Available only when the compiler supports getting it + String file; ///< source file name where the error has occured + int line; ///< line number in the source file where the error has occured +}; + +/*! @brief Signals an error and raises the exception. + +By default the function prints information about the error to stderr, +then it either stops if cv::setBreakOnError() had been called before or raises the exception. +It is possible to alternate error processing by using cv::redirectError(). +@param exc the exception raisen. +@deprecated drop this version + */ +CV_EXPORTS void error( const Exception& exc ); + +enum SortFlags { SORT_EVERY_ROW = 0, //!< each matrix row is sorted independently + SORT_EVERY_COLUMN = 1, //!< each matrix column is sorted + //!< independently; this flag and the previous one are + //!< mutually exclusive. + SORT_ASCENDING = 0, //!< each matrix row is sorted in the ascending + //!< order. + SORT_DESCENDING = 16 //!< each matrix row is sorted in the + //!< descending order; this flag and the previous one are also + //!< mutually exclusive. + }; + +//! @} core_utils + +//! @addtogroup core +//! @{ + +//! Covariation flags +enum CovarFlags { + /** The output covariance matrix is calculated as: + \f[\texttt{scale} \cdot [ \texttt{vects} [0]- \texttt{mean} , \texttt{vects} [1]- \texttt{mean} ,...]^T \cdot [ \texttt{vects} [0]- \texttt{mean} , \texttt{vects} [1]- \texttt{mean} ,...],\f] + The covariance matrix will be nsamples x nsamples. Such an unusual covariance matrix is used + for fast PCA of a set of very large vectors (see, for example, the EigenFaces technique for + face recognition). Eigenvalues of this "scrambled" matrix match the eigenvalues of the true + covariance matrix. The "true" eigenvectors can be easily calculated from the eigenvectors of + the "scrambled" covariance matrix. */ + COVAR_SCRAMBLED = 0, + /**The output covariance matrix is calculated as: + \f[\texttt{scale} \cdot [ \texttt{vects} [0]- \texttt{mean} , \texttt{vects} [1]- \texttt{mean} ,...] \cdot [ \texttt{vects} [0]- \texttt{mean} , \texttt{vects} [1]- \texttt{mean} ,...]^T,\f] + covar will be a square matrix of the same size as the total number of elements in each input + vector. One and only one of COVAR_SCRAMBLED and COVAR_NORMAL must be specified.*/ + COVAR_NORMAL = 1, + /** If the flag is specified, the function does not calculate mean from + the input vectors but, instead, uses the passed mean vector. This is useful if mean has been + pre-calculated or known in advance, or if the covariance matrix is calculated by parts. In + this case, mean is not a mean vector of the input sub-set of vectors but rather the mean + vector of the whole set.*/ + COVAR_USE_AVG = 2, + /** If the flag is specified, the covariance matrix is scaled. In the + "normal" mode, scale is 1./nsamples . In the "scrambled" mode, scale is the reciprocal of the + total number of elements in each input vector. By default (if the flag is not specified), the + covariance matrix is not scaled ( scale=1 ).*/ + COVAR_SCALE = 4, + /** If the flag is + specified, all the input vectors are stored as rows of the samples matrix. mean should be a + single-row vector in this case.*/ + COVAR_ROWS = 8, + /** If the flag is + specified, all the input vectors are stored as columns of the samples matrix. mean should be a + single-column vector in this case.*/ + COVAR_COLS = 16 +}; + +//! k-Means flags +enum KmeansFlags { + /** Select random initial centers in each attempt.*/ + KMEANS_RANDOM_CENTERS = 0, + /** Use kmeans++ center initialization by Arthur and Vassilvitskii [Arthur2007].*/ + KMEANS_PP_CENTERS = 2, + /** During the first (and possibly the only) attempt, use the + user-supplied labels instead of computing them from the initial centers. For the second and + further attempts, use the random or semi-random centers. Use one of KMEANS_\*_CENTERS flag + to specify the exact method.*/ + KMEANS_USE_INITIAL_LABELS = 1 +}; + +//! type of line +enum LineTypes { + FILLED = -1, + LINE_4 = 4, //!< 4-connected line + LINE_8 = 8, //!< 8-connected line + LINE_AA = 16 //!< antialiased line +}; + +//! Only a subset of Hershey fonts +//! are supported +enum HersheyFonts { + FONT_HERSHEY_SIMPLEX = 0, //!< normal size sans-serif font + FONT_HERSHEY_PLAIN = 1, //!< small size sans-serif font + FONT_HERSHEY_DUPLEX = 2, //!< normal size sans-serif font (more complex than FONT_HERSHEY_SIMPLEX) + FONT_HERSHEY_COMPLEX = 3, //!< normal size serif font + FONT_HERSHEY_TRIPLEX = 4, //!< normal size serif font (more complex than FONT_HERSHEY_COMPLEX) + FONT_HERSHEY_COMPLEX_SMALL = 5, //!< smaller version of FONT_HERSHEY_COMPLEX + FONT_HERSHEY_SCRIPT_SIMPLEX = 6, //!< hand-writing style font + FONT_HERSHEY_SCRIPT_COMPLEX = 7, //!< more complex variant of FONT_HERSHEY_SCRIPT_SIMPLEX + FONT_ITALIC = 16 //!< flag for italic font +}; + +enum ReduceTypes { REDUCE_SUM = 0, //!< the output is the sum of all rows/columns of the matrix. + REDUCE_AVG = 1, //!< the output is the mean vector of all rows/columns of the matrix. + REDUCE_MAX = 2, //!< the output is the maximum (column/row-wise) of all rows/columns of the matrix. + REDUCE_MIN = 3 //!< the output is the minimum (column/row-wise) of all rows/columns of the matrix. + }; + + +/** @brief Swaps two matrices +*/ +CV_EXPORTS void swap(Mat& a, Mat& b); +/** @overload */ +CV_EXPORTS void swap( UMat& a, UMat& b ); + +//! @} core + +//! @addtogroup core_array +//! @{ + +/** @brief Computes the source location of an extrapolated pixel. + +The function computes and returns the coordinate of a donor pixel corresponding to the specified +extrapolated pixel when using the specified extrapolation border mode. For example, if you use +cv::BORDER_WRAP mode in the horizontal direction, cv::BORDER_REFLECT_101 in the vertical direction and +want to compute value of the "virtual" pixel Point(-5, 100) in a floating-point image img , it +looks like: +@code{.cpp} + float val = img.at(borderInterpolate(100, img.rows, cv::BORDER_REFLECT_101), + borderInterpolate(-5, img.cols, cv::BORDER_WRAP)); +@endcode +Normally, the function is not called directly. It is used inside filtering functions and also in +copyMakeBorder. +@param p 0-based coordinate of the extrapolated pixel along one of the axes, likely \<0 or \>= len +@param len Length of the array along the corresponding axis. +@param borderType Border type, one of the cv::BorderTypes, except for cv::BORDER_TRANSPARENT and +cv::BORDER_ISOLATED . When borderType==cv::BORDER_CONSTANT , the function always returns -1, regardless +of p and len. + +@sa copyMakeBorder +*/ +CV_EXPORTS_W int borderInterpolate(int p, int len, int borderType); + +/** @brief Forms a border around an image. + +The function copies the source image into the middle of the destination image. The areas to the +left, to the right, above and below the copied source image will be filled with extrapolated +pixels. This is not what filtering functions based on it do (they extrapolate pixels on-fly), but +what other more complex functions, including your own, may do to simplify image boundary handling. + +The function supports the mode when src is already in the middle of dst . In this case, the +function does not copy src itself but simply constructs the border, for example: + +@code{.cpp} + // let border be the same in all directions + int border=2; + // constructs a larger image to fit both the image and the border + Mat gray_buf(rgb.rows + border*2, rgb.cols + border*2, rgb.depth()); + // select the middle part of it w/o copying data + Mat gray(gray_canvas, Rect(border, border, rgb.cols, rgb.rows)); + // convert image from RGB to grayscale + cvtColor(rgb, gray, COLOR_RGB2GRAY); + // form a border in-place + copyMakeBorder(gray, gray_buf, border, border, + border, border, BORDER_REPLICATE); + // now do some custom filtering ... + ... +@endcode +@note When the source image is a part (ROI) of a bigger image, the function will try to use the +pixels outside of the ROI to form a border. To disable this feature and always do extrapolation, as +if src was not a ROI, use borderType | BORDER_ISOLATED. + +@param src Source image. +@param dst Destination image of the same type as src and the size Size(src.cols+left+right, +src.rows+top+bottom) . +@param top +@param bottom +@param left +@param right Parameter specifying how many pixels in each direction from the source image rectangle +to extrapolate. For example, top=1, bottom=1, left=1, right=1 mean that 1 pixel-wide border needs +to be built. +@param borderType Border type. See borderInterpolate for details. +@param value Border value if borderType==BORDER_CONSTANT . + +@sa borderInterpolate +*/ +CV_EXPORTS_W void copyMakeBorder(InputArray src, OutputArray dst, + int top, int bottom, int left, int right, + int borderType, const Scalar& value = Scalar() ); + +/** @brief Calculates the per-element sum of two arrays or an array and a scalar. + +The function add calculates: +- Sum of two arrays when both input arrays have the same size and the same number of channels: +\f[\texttt{dst}(I) = \texttt{saturate} ( \texttt{src1}(I) + \texttt{src2}(I)) \quad \texttt{if mask}(I) \ne0\f] +- Sum of an array and a scalar when src2 is constructed from Scalar or has the same number of +elements as `src1.channels()`: +\f[\texttt{dst}(I) = \texttt{saturate} ( \texttt{src1}(I) + \texttt{src2} ) \quad \texttt{if mask}(I) \ne0\f] +- Sum of a scalar and an array when src1 is constructed from Scalar or has the same number of +elements as `src2.channels()`: +\f[\texttt{dst}(I) = \texttt{saturate} ( \texttt{src1} + \texttt{src2}(I) ) \quad \texttt{if mask}(I) \ne0\f] +where `I` is a multi-dimensional index of array elements. In case of multi-channel arrays, each +channel is processed independently. + +The first function in the list above can be replaced with matrix expressions: +@code{.cpp} + dst = src1 + src2; + dst += src1; // equivalent to add(dst, src1, dst); +@endcode +The input arrays and the output array can all have the same or different depths. For example, you +can add a 16-bit unsigned array to a 8-bit signed array and store the sum as a 32-bit +floating-point array. Depth of the output array is determined by the dtype parameter. In the second +and third cases above, as well as in the first case, when src1.depth() == src2.depth(), dtype can +be set to the default -1. In this case, the output array will have the same depth as the input +array, be it src1, src2 or both. +@note Saturation is not applied when the output array has the depth CV_32S. You may even get +result of an incorrect sign in the case of overflow. +@param src1 first input array or a scalar. +@param src2 second input array or a scalar. +@param dst output array that has the same size and number of channels as the input array(s); the +depth is defined by dtype or src1/src2. +@param mask optional operation mask - 8-bit single channel array, that specifies elements of the +output array to be changed. +@param dtype optional depth of the output array (see the discussion below). +@sa subtract, addWeighted, scaleAdd, Mat::convertTo +*/ +CV_EXPORTS_W void add(InputArray src1, InputArray src2, OutputArray dst, + InputArray mask = noArray(), int dtype = -1); + +/** @brief Calculates the per-element difference between two arrays or array and a scalar. + +The function subtract calculates: +- Difference between two arrays, when both input arrays have the same size and the same number of +channels: + \f[\texttt{dst}(I) = \texttt{saturate} ( \texttt{src1}(I) - \texttt{src2}(I)) \quad \texttt{if mask}(I) \ne0\f] +- Difference between an array and a scalar, when src2 is constructed from Scalar or has the same +number of elements as `src1.channels()`: + \f[\texttt{dst}(I) = \texttt{saturate} ( \texttt{src1}(I) - \texttt{src2} ) \quad \texttt{if mask}(I) \ne0\f] +- Difference between a scalar and an array, when src1 is constructed from Scalar or has the same +number of elements as `src2.channels()`: + \f[\texttt{dst}(I) = \texttt{saturate} ( \texttt{src1} - \texttt{src2}(I) ) \quad \texttt{if mask}(I) \ne0\f] +- The reverse difference between a scalar and an array in the case of `SubRS`: + \f[\texttt{dst}(I) = \texttt{saturate} ( \texttt{src2} - \texttt{src1}(I) ) \quad \texttt{if mask}(I) \ne0\f] +where I is a multi-dimensional index of array elements. In case of multi-channel arrays, each +channel is processed independently. + +The first function in the list above can be replaced with matrix expressions: +@code{.cpp} + dst = src1 - src2; + dst -= src1; // equivalent to subtract(dst, src1, dst); +@endcode +The input arrays and the output array can all have the same or different depths. For example, you +can subtract to 8-bit unsigned arrays and store the difference in a 16-bit signed array. Depth of +the output array is determined by dtype parameter. In the second and third cases above, as well as +in the first case, when src1.depth() == src2.depth(), dtype can be set to the default -1. In this +case the output array will have the same depth as the input array, be it src1, src2 or both. +@note Saturation is not applied when the output array has the depth CV_32S. You may even get +result of an incorrect sign in the case of overflow. +@param src1 first input array or a scalar. +@param src2 second input array or a scalar. +@param dst output array of the same size and the same number of channels as the input array. +@param mask optional operation mask; this is an 8-bit single channel array that specifies elements +of the output array to be changed. +@param dtype optional depth of the output array +@sa add, addWeighted, scaleAdd, Mat::convertTo + */ +CV_EXPORTS_W void subtract(InputArray src1, InputArray src2, OutputArray dst, + InputArray mask = noArray(), int dtype = -1); + + +/** @brief Calculates the per-element scaled product of two arrays. + +The function multiply calculates the per-element product of two arrays: + +\f[\texttt{dst} (I)= \texttt{saturate} ( \texttt{scale} \cdot \texttt{src1} (I) \cdot \texttt{src2} (I))\f] + +There is also a @ref MatrixExpressions -friendly variant of the first function. See Mat::mul . + +For a not-per-element matrix product, see gemm . + +@note Saturation is not applied when the output array has the depth +CV_32S. You may even get result of an incorrect sign in the case of +overflow. +@param src1 first input array. +@param src2 second input array of the same size and the same type as src1. +@param dst output array of the same size and type as src1. +@param scale optional scale factor. +@param dtype optional depth of the output array +@sa add, subtract, divide, scaleAdd, addWeighted, accumulate, accumulateProduct, accumulateSquare, +Mat::convertTo +*/ +CV_EXPORTS_W void multiply(InputArray src1, InputArray src2, + OutputArray dst, double scale = 1, int dtype = -1); + +/** @brief Performs per-element division of two arrays or a scalar by an array. + +The functions divide divide one array by another: +\f[\texttt{dst(I) = saturate(src1(I)*scale/src2(I))}\f] +or a scalar by an array when there is no src1 : +\f[\texttt{dst(I) = saturate(scale/src2(I))}\f] + +When src2(I) is zero, dst(I) will also be zero. Different channels of +multi-channel arrays are processed independently. + +@note Saturation is not applied when the output array has the depth CV_32S. You may even get +result of an incorrect sign in the case of overflow. +@param src1 first input array. +@param src2 second input array of the same size and type as src1. +@param scale scalar factor. +@param dst output array of the same size and type as src2. +@param dtype optional depth of the output array; if -1, dst will have depth src2.depth(), but in +case of an array-by-array division, you can only pass -1 when src1.depth()==src2.depth(). +@sa multiply, add, subtract +*/ +CV_EXPORTS_W void divide(InputArray src1, InputArray src2, OutputArray dst, + double scale = 1, int dtype = -1); + +/** @overload */ +CV_EXPORTS_W void divide(double scale, InputArray src2, + OutputArray dst, int dtype = -1); + +/** @brief Calculates the sum of a scaled array and another array. + +The function scaleAdd is one of the classical primitive linear algebra operations, known as DAXPY +or SAXPY in [BLAS](http://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms). It calculates +the sum of a scaled array and another array: +\f[\texttt{dst} (I)= \texttt{scale} \cdot \texttt{src1} (I) + \texttt{src2} (I)\f] +The function can also be emulated with a matrix expression, for example: +@code{.cpp} + Mat A(3, 3, CV_64F); + ... + A.row(0) = A.row(1)*2 + A.row(2); +@endcode +@param src1 first input array. +@param alpha scale factor for the first array. +@param src2 second input array of the same size and type as src1. +@param dst output array of the same size and type as src1. +@sa add, addWeighted, subtract, Mat::dot, Mat::convertTo +*/ +CV_EXPORTS_W void scaleAdd(InputArray src1, double alpha, InputArray src2, OutputArray dst); + +/** @brief Calculates the weighted sum of two arrays. + +The function addWeighted calculates the weighted sum of two arrays as follows: +\f[\texttt{dst} (I)= \texttt{saturate} ( \texttt{src1} (I)* \texttt{alpha} + \texttt{src2} (I)* \texttt{beta} + \texttt{gamma} )\f] +where I is a multi-dimensional index of array elements. In case of multi-channel arrays, each +channel is processed independently. +The function can be replaced with a matrix expression: +@code{.cpp} + dst = src1*alpha + src2*beta + gamma; +@endcode +@note Saturation is not applied when the output array has the depth CV_32S. You may even get +result of an incorrect sign in the case of overflow. +@param src1 first input array. +@param alpha weight of the first array elements. +@param src2 second input array of the same size and channel number as src1. +@param beta weight of the second array elements. +@param gamma scalar added to each sum. +@param dst output array that has the same size and number of channels as the input arrays. +@param dtype optional depth of the output array; when both input arrays have the same depth, dtype +can be set to -1, which will be equivalent to src1.depth(). +@sa add, subtract, scaleAdd, Mat::convertTo +*/ +CV_EXPORTS_W void addWeighted(InputArray src1, double alpha, InputArray src2, + double beta, double gamma, OutputArray dst, int dtype = -1); + +/** @brief Scales, calculates absolute values, and converts the result to 8-bit. + +On each element of the input array, the function convertScaleAbs +performs three operations sequentially: scaling, taking an absolute +value, conversion to an unsigned 8-bit type: +\f[\texttt{dst} (I)= \texttt{saturate\_cast} (| \texttt{src} (I)* \texttt{alpha} + \texttt{beta} |)\f] +In case of multi-channel arrays, the function processes each channel +independently. When the output is not 8-bit, the operation can be +emulated by calling the Mat::convertTo method (or by using matrix +expressions) and then by calculating an absolute value of the result. +For example: +@code{.cpp} + Mat_ A(30,30); + randu(A, Scalar(-100), Scalar(100)); + Mat_ B = A*5 + 3; + B = abs(B); + // Mat_ B = abs(A*5+3) will also do the job, + // but it will allocate a temporary matrix +@endcode +@param src input array. +@param dst output array. +@param alpha optional scale factor. +@param beta optional delta added to the scaled values. +@sa Mat::convertTo, cv::abs(const Mat&) +*/ +CV_EXPORTS_W void convertScaleAbs(InputArray src, OutputArray dst, + double alpha = 1, double beta = 0); + +/** @brief Performs a look-up table transform of an array. + +The function LUT fills the output array with values from the look-up table. Indices of the entries +are taken from the input array. That is, the function processes each element of src as follows: +\f[\texttt{dst} (I) \leftarrow \texttt{lut(src(I) + d)}\f] +where +\f[d = \fork{0}{if \(\texttt{src}\) has depth \(\texttt{CV_8U}\)}{128}{if \(\texttt{src}\) has depth \(\texttt{CV_8S}\)}\f] +@param src input array of 8-bit elements. +@param lut look-up table of 256 elements; in case of multi-channel input array, the table should +either have a single channel (in this case the same table is used for all channels) or the same +number of channels as in the input array. +@param dst output array of the same size and number of channels as src, and the same depth as lut. +@sa convertScaleAbs, Mat::convertTo +*/ +CV_EXPORTS_W void LUT(InputArray src, InputArray lut, OutputArray dst); + +/** @brief Calculates the sum of array elements. + +The functions sum calculate and return the sum of array elements, +independently for each channel. +@param src input array that must have from 1 to 4 channels. +@sa countNonZero, mean, meanStdDev, norm, minMaxLoc, reduce +*/ +CV_EXPORTS_AS(sumElems) Scalar sum(InputArray src); + +/** @brief Counts non-zero array elements. + +The function returns the number of non-zero elements in src : +\f[\sum _{I: \; \texttt{src} (I) \ne0 } 1\f] +@param src single-channel array. +@sa mean, meanStdDev, norm, minMaxLoc, calcCovarMatrix +*/ +CV_EXPORTS_W int countNonZero( InputArray src ); + +/** @brief Returns the list of locations of non-zero pixels + +Given a binary matrix (likely returned from an operation such +as threshold(), compare(), >, ==, etc, return all of +the non-zero indices as a cv::Mat or std::vector (x,y) +For example: +@code{.cpp} + cv::Mat binaryImage; // input, binary image + cv::Mat locations; // output, locations of non-zero pixels + cv::findNonZero(binaryImage, locations); + + // access pixel coordinates + Point pnt = locations.at(i); +@endcode +or +@code{.cpp} + cv::Mat binaryImage; // input, binary image + vector locations; // output, locations of non-zero pixels + cv::findNonZero(binaryImage, locations); + + // access pixel coordinates + Point pnt = locations[i]; +@endcode +@param src single-channel array (type CV_8UC1) +@param idx the output array, type of cv::Mat or std::vector, corresponding to non-zero indices in the input +*/ +CV_EXPORTS_W void findNonZero( InputArray src, OutputArray idx ); + +/** @brief Calculates an average (mean) of array elements. + +The function mean calculates the mean value M of array elements, +independently for each channel, and return it: +\f[\begin{array}{l} N = \sum _{I: \; \texttt{mask} (I) \ne 0} 1 \\ M_c = \left ( \sum _{I: \; \texttt{mask} (I) \ne 0}{ \texttt{mtx} (I)_c} \right )/N \end{array}\f] +When all the mask elements are 0's, the functions return Scalar::all(0) +@param src input array that should have from 1 to 4 channels so that the result can be stored in +Scalar_ . +@param mask optional operation mask. +@sa countNonZero, meanStdDev, norm, minMaxLoc +*/ +CV_EXPORTS_W Scalar mean(InputArray src, InputArray mask = noArray()); + +/** Calculates a mean and standard deviation of array elements. + +The function meanStdDev calculates the mean and the standard deviation M +of array elements independently for each channel and returns it via the +output parameters: +\f[\begin{array}{l} N = \sum _{I, \texttt{mask} (I) \ne 0} 1 \\ \texttt{mean} _c = \frac{\sum_{ I: \; \texttt{mask}(I) \ne 0} \texttt{src} (I)_c}{N} \\ \texttt{stddev} _c = \sqrt{\frac{\sum_{ I: \; \texttt{mask}(I) \ne 0} \left ( \texttt{src} (I)_c - \texttt{mean} _c \right )^2}{N}} \end{array}\f] +When all the mask elements are 0's, the functions return +mean=stddev=Scalar::all(0). +@note The calculated standard deviation is only the diagonal of the +complete normalized covariance matrix. If the full matrix is needed, you +can reshape the multi-channel array M x N to the single-channel array +M\*N x mtx.channels() (only possible when the matrix is continuous) and +then pass the matrix to calcCovarMatrix . +@param src input array that should have from 1 to 4 channels so that the results can be stored in +Scalar_ 's. +@param mean output parameter: calculated mean value. +@param stddev output parameter: calculateded standard deviation. +@param mask optional operation mask. +@sa countNonZero, mean, norm, minMaxLoc, calcCovarMatrix +*/ +CV_EXPORTS_W void meanStdDev(InputArray src, OutputArray mean, OutputArray stddev, + InputArray mask=noArray()); + +/** @brief Calculates an absolute array norm, an absolute difference norm, or a +relative difference norm. + +The functions norm calculate an absolute norm of src1 (when there is no +src2 ): + +\f[norm = \forkthree{\|\texttt{src1}\|_{L_{\infty}} = \max _I | \texttt{src1} (I)|}{if \(\texttt{normType} = \texttt{NORM_INF}\) } +{ \| \texttt{src1} \| _{L_1} = \sum _I | \texttt{src1} (I)|}{if \(\texttt{normType} = \texttt{NORM_L1}\) } +{ \| \texttt{src1} \| _{L_2} = \sqrt{\sum_I \texttt{src1}(I)^2} }{if \(\texttt{normType} = \texttt{NORM_L2}\) }\f] + +or an absolute or relative difference norm if src2 is there: + +\f[norm = \forkthree{\|\texttt{src1}-\texttt{src2}\|_{L_{\infty}} = \max _I | \texttt{src1} (I) - \texttt{src2} (I)|}{if \(\texttt{normType} = \texttt{NORM_INF}\) } +{ \| \texttt{src1} - \texttt{src2} \| _{L_1} = \sum _I | \texttt{src1} (I) - \texttt{src2} (I)|}{if \(\texttt{normType} = \texttt{NORM_L1}\) } +{ \| \texttt{src1} - \texttt{src2} \| _{L_2} = \sqrt{\sum_I (\texttt{src1}(I) - \texttt{src2}(I))^2} }{if \(\texttt{normType} = \texttt{NORM_L2}\) }\f] + +or + +\f[norm = \forkthree{\frac{\|\texttt{src1}-\texttt{src2}\|_{L_{\infty}} }{\|\texttt{src2}\|_{L_{\infty}} }}{if \(\texttt{normType} = \texttt{NORM_RELATIVE_INF}\) } +{ \frac{\|\texttt{src1}-\texttt{src2}\|_{L_1} }{\|\texttt{src2}\|_{L_1}} }{if \(\texttt{normType} = \texttt{NORM_RELATIVE_L1}\) } +{ \frac{\|\texttt{src1}-\texttt{src2}\|_{L_2} }{\|\texttt{src2}\|_{L_2}} }{if \(\texttt{normType} = \texttt{NORM_RELATIVE_L2}\) }\f] + +The functions norm return the calculated norm. + +When the mask parameter is specified and it is not empty, the norm is +calculated only over the region specified by the mask. + +A multi-channel input arrays are treated as a single-channel, that is, +the results for all channels are combined. + +@param src1 first input array. +@param normType type of the norm (see cv::NormTypes). +@param mask optional operation mask; it must have the same size as src1 and CV_8UC1 type. +*/ +CV_EXPORTS_W double norm(InputArray src1, int normType = NORM_L2, InputArray mask = noArray()); + +/** @overload +@param src1 first input array. +@param src2 second input array of the same size and the same type as src1. +@param normType type of the norm (cv::NormTypes). +@param mask optional operation mask; it must have the same size as src1 and CV_8UC1 type. +*/ +CV_EXPORTS_W double norm(InputArray src1, InputArray src2, + int normType = NORM_L2, InputArray mask = noArray()); +/** @overload +@param src first input array. +@param normType type of the norm (see cv::NormTypes). +*/ +CV_EXPORTS double norm( const SparseMat& src, int normType ); + +/** @brief computes PSNR image/video quality metric + +see http://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio for details +@todo document + */ +CV_EXPORTS_W double PSNR(InputArray src1, InputArray src2); + +/** @brief naive nearest neighbor finder + +see http://en.wikipedia.org/wiki/Nearest_neighbor_search +@todo document + */ +CV_EXPORTS_W void batchDistance(InputArray src1, InputArray src2, + OutputArray dist, int dtype, OutputArray nidx, + int normType = NORM_L2, int K = 0, + InputArray mask = noArray(), int update = 0, + bool crosscheck = false); + +/** @brief Normalizes the norm or value range of an array. + +The functions normalize scale and shift the input array elements so that +\f[\| \texttt{dst} \| _{L_p}= \texttt{alpha}\f] +(where p=Inf, 1 or 2) when normType=NORM_INF, NORM_L1, or NORM_L2, respectively; or so that +\f[\min _I \texttt{dst} (I)= \texttt{alpha} , \, \, \max _I \texttt{dst} (I)= \texttt{beta}\f] + +when normType=NORM_MINMAX (for dense arrays only). The optional mask specifies a sub-array to be +normalized. This means that the norm or min-n-max are calculated over the sub-array, and then this +sub-array is modified to be normalized. If you want to only use the mask to calculate the norm or +min-max but modify the whole array, you can use norm and Mat::convertTo. + +In case of sparse matrices, only the non-zero values are analyzed and transformed. Because of this, +the range transformation for sparse matrices is not allowed since it can shift the zero level. + +Possible usage with some positive example data: +@code{.cpp} + vector positiveData = { 2.0, 8.0, 10.0 }; + vector normalizedData_l1, normalizedData_l2, normalizedData_inf, normalizedData_minmax; + + // Norm to probability (total count) + // sum(numbers) = 20.0 + // 2.0 0.1 (2.0/20.0) + // 8.0 0.4 (8.0/20.0) + // 10.0 0.5 (10.0/20.0) + normalize(positiveData, normalizedData_l1, 1.0, 0.0, NORM_L1); + + // Norm to unit vector: ||positiveData|| = 1.0 + // 2.0 0.15 + // 8.0 0.62 + // 10.0 0.77 + normalize(positiveData, normalizedData_l2, 1.0, 0.0, NORM_L2); + + // Norm to max element + // 2.0 0.2 (2.0/10.0) + // 8.0 0.8 (8.0/10.0) + // 10.0 1.0 (10.0/10.0) + normalize(positiveData, normalizedData_inf, 1.0, 0.0, NORM_INF); + + // Norm to range [0.0;1.0] + // 2.0 0.0 (shift to left border) + // 8.0 0.75 (6.0/8.0) + // 10.0 1.0 (shift to right border) + normalize(positiveData, normalizedData_minmax, 1.0, 0.0, NORM_MINMAX); +@endcode + +@param src input array. +@param dst output array of the same size as src . +@param alpha norm value to normalize to or the lower range boundary in case of the range +normalization. +@param beta upper range boundary in case of the range normalization; it is not used for the norm +normalization. +@param norm_type normalization type (see cv::NormTypes). +@param dtype when negative, the output array has the same type as src; otherwise, it has the same +number of channels as src and the depth =CV_MAT_DEPTH(dtype). +@param mask optional operation mask. +@sa norm, Mat::convertTo, SparseMat::convertTo +*/ +CV_EXPORTS_W void normalize( InputArray src, InputOutputArray dst, double alpha = 1, double beta = 0, + int norm_type = NORM_L2, int dtype = -1, InputArray mask = noArray()); + +/** @overload +@param src input array. +@param dst output array of the same size as src . +@param alpha norm value to normalize to or the lower range boundary in case of the range +normalization. +@param normType normalization type (see cv::NormTypes). +*/ +CV_EXPORTS void normalize( const SparseMat& src, SparseMat& dst, double alpha, int normType ); + +/** @brief Finds the global minimum and maximum in an array. + +The functions minMaxLoc find the minimum and maximum element values and their positions. The +extremums are searched across the whole array or, if mask is not an empty array, in the specified +array region. + +The functions do not work with multi-channel arrays. If you need to find minimum or maximum +elements across all the channels, use Mat::reshape first to reinterpret the array as +single-channel. Or you may extract the particular channel using either extractImageCOI , or +mixChannels , or split . +@param src input single-channel array. +@param minVal pointer to the returned minimum value; NULL is used if not required. +@param maxVal pointer to the returned maximum value; NULL is used if not required. +@param minLoc pointer to the returned minimum location (in 2D case); NULL is used if not required. +@param maxLoc pointer to the returned maximum location (in 2D case); NULL is used if not required. +@param mask optional mask used to select a sub-array. +@sa max, min, compare, inRange, extractImageCOI, mixChannels, split, Mat::reshape +*/ +CV_EXPORTS_W void minMaxLoc(InputArray src, CV_OUT double* minVal, + CV_OUT double* maxVal = 0, CV_OUT Point* minLoc = 0, + CV_OUT Point* maxLoc = 0, InputArray mask = noArray()); + + +/** @brief Finds the global minimum and maximum in an array + +The function minMaxIdx finds the minimum and maximum element values and their positions. The +extremums are searched across the whole array or, if mask is not an empty array, in the specified +array region. The function does not work with multi-channel arrays. If you need to find minimum or +maximum elements across all the channels, use Mat::reshape first to reinterpret the array as +single-channel. Or you may extract the particular channel using either extractImageCOI , or +mixChannels , or split . In case of a sparse matrix, the minimum is found among non-zero elements +only. +@note When minIdx is not NULL, it must have at least 2 elements (as well as maxIdx), even if src is +a single-row or single-column matrix. In OpenCV (following MATLAB) each array has at least 2 +dimensions, i.e. single-column matrix is Mx1 matrix (and therefore minIdx/maxIdx will be +(i1,0)/(i2,0)) and single-row matrix is 1xN matrix (and therefore minIdx/maxIdx will be +(0,j1)/(0,j2)). +@param src input single-channel array. +@param minVal pointer to the returned minimum value; NULL is used if not required. +@param maxVal pointer to the returned maximum value; NULL is used if not required. +@param minIdx pointer to the returned minimum location (in nD case); NULL is used if not required; +Otherwise, it must point to an array of src.dims elements, the coordinates of the minimum element +in each dimension are stored there sequentially. +@param maxIdx pointer to the returned maximum location (in nD case). NULL is used if not required. +@param mask specified array region +*/ +CV_EXPORTS void minMaxIdx(InputArray src, double* minVal, double* maxVal = 0, + int* minIdx = 0, int* maxIdx = 0, InputArray mask = noArray()); + +/** @overload +@param a input single-channel array. +@param minVal pointer to the returned minimum value; NULL is used if not required. +@param maxVal pointer to the returned maximum value; NULL is used if not required. +@param minIdx pointer to the returned minimum location (in nD case); NULL is used if not required; +Otherwise, it must point to an array of src.dims elements, the coordinates of the minimum element +in each dimension are stored there sequentially. +@param maxIdx pointer to the returned maximum location (in nD case). NULL is used if not required. +*/ +CV_EXPORTS void minMaxLoc(const SparseMat& a, double* minVal, + double* maxVal, int* minIdx = 0, int* maxIdx = 0); + +/** @brief Reduces a matrix to a vector. + +The function reduce reduces the matrix to a vector by treating the matrix rows/columns as a set of +1D vectors and performing the specified operation on the vectors until a single row/column is +obtained. For example, the function can be used to compute horizontal and vertical projections of a +raster image. In case of REDUCE_SUM and REDUCE_AVG , the output may have a larger element +bit-depth to preserve accuracy. And multi-channel arrays are also supported in these two reduction +modes. +@param src input 2D matrix. +@param dst output vector. Its size and type is defined by dim and dtype parameters. +@param dim dimension index along which the matrix is reduced. 0 means that the matrix is reduced to +a single row. 1 means that the matrix is reduced to a single column. +@param rtype reduction operation that could be one of cv::ReduceTypes +@param dtype when negative, the output vector will have the same type as the input matrix, +otherwise, its type will be CV_MAKE_TYPE(CV_MAT_DEPTH(dtype), src.channels()). +@sa repeat +*/ +CV_EXPORTS_W void reduce(InputArray src, OutputArray dst, int dim, int rtype, int dtype = -1); + +/** @brief Creates one multi-channel array out of several single-channel ones. + +The function merge merges several arrays to make a single multi-channel array. That is, each +element of the output array will be a concatenation of the elements of the input arrays, where +elements of i-th input array are treated as mv[i].channels()-element vectors. + +The function cv::split does the reverse operation. If you need to shuffle channels in some other +advanced way, use cv::mixChannels. +@param mv input array of matrices to be merged; all the matrices in mv must have the same +size and the same depth. +@param count number of input matrices when mv is a plain C array; it must be greater than zero. +@param dst output array of the same size and the same depth as mv[0]; The number of channels will +be equal to the parameter count. +@sa mixChannels, split, Mat::reshape +*/ +CV_EXPORTS void merge(const Mat* mv, size_t count, OutputArray dst); + +/** @overload +@param mv input vector of matrices to be merged; all the matrices in mv must have the same +size and the same depth. +@param dst output array of the same size and the same depth as mv[0]; The number of channels will +be the total number of channels in the matrix array. + */ +CV_EXPORTS_W void merge(InputArrayOfArrays mv, OutputArray dst); + +/** @brief Divides a multi-channel array into several single-channel arrays. + +The functions split split a multi-channel array into separate single-channel arrays: +\f[\texttt{mv} [c](I) = \texttt{src} (I)_c\f] +If you need to extract a single channel or do some other sophisticated channel permutation, use +mixChannels . +@param src input multi-channel array. +@param mvbegin output array; the number of arrays must match src.channels(); the arrays themselves are +reallocated, if needed. +@sa merge, mixChannels, cvtColor +*/ +CV_EXPORTS void split(const Mat& src, Mat* mvbegin); + +/** @overload +@param m input multi-channel array. +@param mv output vector of arrays; the arrays themselves are reallocated, if needed. +*/ +CV_EXPORTS_W void split(InputArray m, OutputArrayOfArrays mv); + +/** @brief Copies specified channels from input arrays to the specified channels of +output arrays. + +The function cv::mixChannels provides an advanced mechanism for shuffling image channels. + +cv::split and cv::merge and some forms of cv::cvtColor are partial cases of cv::mixChannels . + +In the example below, the code splits a 4-channel BGRA image into a 3-channel BGR (with B and R +channels swapped) and a separate alpha-channel image: +@code{.cpp} + Mat bgra( 100, 100, CV_8UC4, Scalar(255,0,0,255) ); + Mat bgr( bgra.rows, bgra.cols, CV_8UC3 ); + Mat alpha( bgra.rows, bgra.cols, CV_8UC1 ); + + // forming an array of matrices is a quite efficient operation, + // because the matrix data is not copied, only the headers + Mat out[] = { bgr, alpha }; + // bgra[0] -> bgr[2], bgra[1] -> bgr[1], + // bgra[2] -> bgr[0], bgra[3] -> alpha[0] + int from_to[] = { 0,2, 1,1, 2,0, 3,3 }; + mixChannels( &bgra, 1, out, 2, from_to, 4 ); +@endcode +@note Unlike many other new-style C++ functions in OpenCV (see the introduction section and +Mat::create ), cv::mixChannels requires the output arrays to be pre-allocated before calling the +function. +@param src input array or vector of matrices; all of the matrices must have the same size and the +same depth. +@param nsrcs number of matrices in `src`. +@param dst output array or vector of matrices; all the matrices **must be allocated**; their size and +depth must be the same as in `src[0]`. +@param ndsts number of matrices in `dst`. +@param fromTo array of index pairs specifying which channels are copied and where; fromTo[k\*2] is +a 0-based index of the input channel in src, fromTo[k\*2+1] is an index of the output channel in +dst; the continuous channel numbering is used: the first input image channels are indexed from 0 to +src[0].channels()-1, the second input image channels are indexed from src[0].channels() to +src[0].channels() + src[1].channels()-1, and so on, the same scheme is used for the output image +channels; as a special case, when fromTo[k\*2] is negative, the corresponding output channel is +filled with zero . +@param npairs number of index pairs in `fromTo`. +@sa cv::split, cv::merge, cv::cvtColor +*/ +CV_EXPORTS void mixChannels(const Mat* src, size_t nsrcs, Mat* dst, size_t ndsts, + const int* fromTo, size_t npairs); + +/** @overload +@param src input array or vector of matrices; all of the matrices must have the same size and the +same depth. +@param dst output array or vector of matrices; all the matrices **must be allocated**; their size and +depth must be the same as in src[0]. +@param fromTo array of index pairs specifying which channels are copied and where; fromTo[k\*2] is +a 0-based index of the input channel in src, fromTo[k\*2+1] is an index of the output channel in +dst; the continuous channel numbering is used: the first input image channels are indexed from 0 to +src[0].channels()-1, the second input image channels are indexed from src[0].channels() to +src[0].channels() + src[1].channels()-1, and so on, the same scheme is used for the output image +channels; as a special case, when fromTo[k\*2] is negative, the corresponding output channel is +filled with zero . +@param npairs number of index pairs in fromTo. +*/ +CV_EXPORTS void mixChannels(InputArrayOfArrays src, InputOutputArrayOfArrays dst, + const int* fromTo, size_t npairs); + +/** @overload +@param src input array or vector of matrices; all of the matrices must have the same size and the +same depth. +@param dst output array or vector of matrices; all the matrices **must be allocated**; their size and +depth must be the same as in src[0]. +@param fromTo array of index pairs specifying which channels are copied and where; fromTo[k\*2] is +a 0-based index of the input channel in src, fromTo[k\*2+1] is an index of the output channel in +dst; the continuous channel numbering is used: the first input image channels are indexed from 0 to +src[0].channels()-1, the second input image channels are indexed from src[0].channels() to +src[0].channels() + src[1].channels()-1, and so on, the same scheme is used for the output image +channels; as a special case, when fromTo[k\*2] is negative, the corresponding output channel is +filled with zero . +*/ +CV_EXPORTS_W void mixChannels(InputArrayOfArrays src, InputOutputArrayOfArrays dst, + const std::vector& fromTo); + +/** @brief extracts a single channel from src (coi is 0-based index) +@todo document +*/ +CV_EXPORTS_W void extractChannel(InputArray src, OutputArray dst, int coi); + +/** @brief inserts a single channel to dst (coi is 0-based index) +@todo document +*/ +CV_EXPORTS_W void insertChannel(InputArray src, InputOutputArray dst, int coi); + +/** @brief Flips a 2D array around vertical, horizontal, or both axes. + +The function flip flips the array in one of three different ways (row +and column indices are 0-based): +\f[\texttt{dst} _{ij} = +\left\{ +\begin{array}{l l} +\texttt{src} _{\texttt{src.rows}-i-1,j} & if\; \texttt{flipCode} = 0 \\ +\texttt{src} _{i, \texttt{src.cols} -j-1} & if\; \texttt{flipCode} > 0 \\ +\texttt{src} _{ \texttt{src.rows} -i-1, \texttt{src.cols} -j-1} & if\; \texttt{flipCode} < 0 \\ +\end{array} +\right.\f] +The example scenarios of using the function are the following: +* Vertical flipping of the image (flipCode == 0) to switch between + top-left and bottom-left image origin. This is a typical operation + in video processing on Microsoft Windows\* OS. +* Horizontal flipping of the image with the subsequent horizontal + shift and absolute difference calculation to check for a + vertical-axis symmetry (flipCode \> 0). +* Simultaneous horizontal and vertical flipping of the image with + the subsequent shift and absolute difference calculation to check + for a central symmetry (flipCode \< 0). +* Reversing the order of point arrays (flipCode \> 0 or + flipCode == 0). +@param src input array. +@param dst output array of the same size and type as src. +@param flipCode a flag to specify how to flip the array; 0 means +flipping around the x-axis and positive value (for example, 1) means +flipping around y-axis. Negative value (for example, -1) means flipping +around both axes. +@sa transpose , repeat , completeSymm +*/ +CV_EXPORTS_W void flip(InputArray src, OutputArray dst, int flipCode); + +/** @brief Fills the output array with repeated copies of the input array. + +The functions repeat duplicate the input array one or more times along each of the two axes: +\f[\texttt{dst} _{ij}= \texttt{src} _{i\mod src.rows, \; j\mod src.cols }\f] +The second variant of the function is more convenient to use with @ref MatrixExpressions. +@param src input array to replicate. +@param dst output array of the same type as src. +@param ny Flag to specify how many times the src is repeated along the +vertical axis. +@param nx Flag to specify how many times the src is repeated along the +horizontal axis. +@sa reduce +*/ +CV_EXPORTS_W void repeat(InputArray src, int ny, int nx, OutputArray dst); + +/** @overload +@param src input array to replicate. +@param ny Flag to specify how many times the src is repeated along the +vertical axis. +@param nx Flag to specify how many times the src is repeated along the +horizontal axis. + */ +CV_EXPORTS Mat repeat(const Mat& src, int ny, int nx); + +/** @brief Applies horizontal concatenation to given matrices. + +The function horizontally concatenates two or more cv::Mat matrices (with the same number of rows). +@code{.cpp} + cv::Mat matArray[] = { cv::Mat(4, 1, CV_8UC1, cv::Scalar(1)), + cv::Mat(4, 1, CV_8UC1, cv::Scalar(2)), + cv::Mat(4, 1, CV_8UC1, cv::Scalar(3)),}; + + cv::Mat out; + cv::hconcat( matArray, 3, out ); + //out: + //[1, 2, 3; + // 1, 2, 3; + // 1, 2, 3; + // 1, 2, 3] +@endcode +@param src input array or vector of matrices. all of the matrices must have the same number of rows and the same depth. +@param nsrc number of matrices in src. +@param dst output array. It has the same number of rows and depth as the src, and the sum of cols of the src. +@sa cv::vconcat(const Mat*, size_t, OutputArray), @sa cv::vconcat(InputArrayOfArrays, OutputArray) and @sa cv::vconcat(InputArray, InputArray, OutputArray) +*/ +CV_EXPORTS void hconcat(const Mat* src, size_t nsrc, OutputArray dst); +/** @overload + @code{.cpp} + cv::Mat_ A = (cv::Mat_(3, 2) << 1, 4, + 2, 5, + 3, 6); + cv::Mat_ B = (cv::Mat_(3, 2) << 7, 10, + 8, 11, + 9, 12); + + cv::Mat C; + cv::hconcat(A, B, C); + //C: + //[1, 4, 7, 10; + // 2, 5, 8, 11; + // 3, 6, 9, 12] + @endcode + @param src1 first input array to be considered for horizontal concatenation. + @param src2 second input array to be considered for horizontal concatenation. + @param dst output array. It has the same number of rows and depth as the src1 and src2, and the sum of cols of the src1 and src2. + */ +CV_EXPORTS void hconcat(InputArray src1, InputArray src2, OutputArray dst); +/** @overload + @code{.cpp} + std::vector matrices = { cv::Mat(4, 1, CV_8UC1, cv::Scalar(1)), + cv::Mat(4, 1, CV_8UC1, cv::Scalar(2)), + cv::Mat(4, 1, CV_8UC1, cv::Scalar(3)),}; + + cv::Mat out; + cv::hconcat( matrices, out ); + //out: + //[1, 2, 3; + // 1, 2, 3; + // 1, 2, 3; + // 1, 2, 3] + @endcode + @param src input array or vector of matrices. all of the matrices must have the same number of rows and the same depth. + @param dst output array. It has the same number of rows and depth as the src, and the sum of cols of the src. +same depth. + */ +CV_EXPORTS_W void hconcat(InputArrayOfArrays src, OutputArray dst); + +/** @brief Applies vertical concatenation to given matrices. + +The function vertically concatenates two or more cv::Mat matrices (with the same number of cols). +@code{.cpp} + cv::Mat matArray[] = { cv::Mat(1, 4, CV_8UC1, cv::Scalar(1)), + cv::Mat(1, 4, CV_8UC1, cv::Scalar(2)), + cv::Mat(1, 4, CV_8UC1, cv::Scalar(3)),}; + + cv::Mat out; + cv::vconcat( matArray, 3, out ); + //out: + //[1, 1, 1, 1; + // 2, 2, 2, 2; + // 3, 3, 3, 3] +@endcode +@param src input array or vector of matrices. all of the matrices must have the same number of cols and the same depth. +@param nsrc number of matrices in src. +@param dst output array. It has the same number of cols and depth as the src, and the sum of rows of the src. +@sa cv::hconcat(const Mat*, size_t, OutputArray), @sa cv::hconcat(InputArrayOfArrays, OutputArray) and @sa cv::hconcat(InputArray, InputArray, OutputArray) +*/ +CV_EXPORTS void vconcat(const Mat* src, size_t nsrc, OutputArray dst); +/** @overload + @code{.cpp} + cv::Mat_ A = (cv::Mat_(3, 2) << 1, 7, + 2, 8, + 3, 9); + cv::Mat_ B = (cv::Mat_(3, 2) << 4, 10, + 5, 11, + 6, 12); + + cv::Mat C; + cv::vconcat(A, B, C); + //C: + //[1, 7; + // 2, 8; + // 3, 9; + // 4, 10; + // 5, 11; + // 6, 12] + @endcode + @param src1 first input array to be considered for vertical concatenation. + @param src2 second input array to be considered for vertical concatenation. + @param dst output array. It has the same number of cols and depth as the src1 and src2, and the sum of rows of the src1 and src2. + */ +CV_EXPORTS void vconcat(InputArray src1, InputArray src2, OutputArray dst); +/** @overload + @code{.cpp} + std::vector matrices = { cv::Mat(1, 4, CV_8UC1, cv::Scalar(1)), + cv::Mat(1, 4, CV_8UC1, cv::Scalar(2)), + cv::Mat(1, 4, CV_8UC1, cv::Scalar(3)),}; + + cv::Mat out; + cv::vconcat( matrices, out ); + //out: + //[1, 1, 1, 1; + // 2, 2, 2, 2; + // 3, 3, 3, 3] + @endcode + @param src input array or vector of matrices. all of the matrices must have the same number of cols and the same depth + @param dst output array. It has the same number of cols and depth as the src, and the sum of rows of the src. +same depth. + */ +CV_EXPORTS_W void vconcat(InputArrayOfArrays src, OutputArray dst); + +/** @brief computes bitwise conjunction of the two arrays (dst = src1 & src2) +Calculates the per-element bit-wise conjunction of two arrays or an +array and a scalar. + +The function calculates the per-element bit-wise logical conjunction for: +* Two arrays when src1 and src2 have the same size: + \f[\texttt{dst} (I) = \texttt{src1} (I) \wedge \texttt{src2} (I) \quad \texttt{if mask} (I) \ne0\f] +* An array and a scalar when src2 is constructed from Scalar or has + the same number of elements as `src1.channels()`: + \f[\texttt{dst} (I) = \texttt{src1} (I) \wedge \texttt{src2} \quad \texttt{if mask} (I) \ne0\f] +* A scalar and an array when src1 is constructed from Scalar or has + the same number of elements as `src2.channels()`: + \f[\texttt{dst} (I) = \texttt{src1} \wedge \texttt{src2} (I) \quad \texttt{if mask} (I) \ne0\f] +In case of floating-point arrays, their machine-specific bit +representations (usually IEEE754-compliant) are used for the operation. +In case of multi-channel arrays, each channel is processed +independently. In the second and third cases above, the scalar is first +converted to the array type. +@param src1 first input array or a scalar. +@param src2 second input array or a scalar. +@param dst output array that has the same size and type as the input +arrays. +@param mask optional operation mask, 8-bit single channel array, that +specifies elements of the output array to be changed. +*/ +CV_EXPORTS_W void bitwise_and(InputArray src1, InputArray src2, + OutputArray dst, InputArray mask = noArray()); + +/** @brief Calculates the per-element bit-wise disjunction of two arrays or an +array and a scalar. + +The function calculates the per-element bit-wise logical disjunction for: +* Two arrays when src1 and src2 have the same size: + \f[\texttt{dst} (I) = \texttt{src1} (I) \vee \texttt{src2} (I) \quad \texttt{if mask} (I) \ne0\f] +* An array and a scalar when src2 is constructed from Scalar or has + the same number of elements as `src1.channels()`: + \f[\texttt{dst} (I) = \texttt{src1} (I) \vee \texttt{src2} \quad \texttt{if mask} (I) \ne0\f] +* A scalar and an array when src1 is constructed from Scalar or has + the same number of elements as `src2.channels()`: + \f[\texttt{dst} (I) = \texttt{src1} \vee \texttt{src2} (I) \quad \texttt{if mask} (I) \ne0\f] +In case of floating-point arrays, their machine-specific bit +representations (usually IEEE754-compliant) are used for the operation. +In case of multi-channel arrays, each channel is processed +independently. In the second and third cases above, the scalar is first +converted to the array type. +@param src1 first input array or a scalar. +@param src2 second input array or a scalar. +@param dst output array that has the same size and type as the input +arrays. +@param mask optional operation mask, 8-bit single channel array, that +specifies elements of the output array to be changed. +*/ +CV_EXPORTS_W void bitwise_or(InputArray src1, InputArray src2, + OutputArray dst, InputArray mask = noArray()); + +/** @brief Calculates the per-element bit-wise "exclusive or" operation on two +arrays or an array and a scalar. + +The function calculates the per-element bit-wise logical "exclusive-or" +operation for: +* Two arrays when src1 and src2 have the same size: + \f[\texttt{dst} (I) = \texttt{src1} (I) \oplus \texttt{src2} (I) \quad \texttt{if mask} (I) \ne0\f] +* An array and a scalar when src2 is constructed from Scalar or has + the same number of elements as `src1.channels()`: + \f[\texttt{dst} (I) = \texttt{src1} (I) \oplus \texttt{src2} \quad \texttt{if mask} (I) \ne0\f] +* A scalar and an array when src1 is constructed from Scalar or has + the same number of elements as `src2.channels()`: + \f[\texttt{dst} (I) = \texttt{src1} \oplus \texttt{src2} (I) \quad \texttt{if mask} (I) \ne0\f] +In case of floating-point arrays, their machine-specific bit +representations (usually IEEE754-compliant) are used for the operation. +In case of multi-channel arrays, each channel is processed +independently. In the 2nd and 3rd cases above, the scalar is first +converted to the array type. +@param src1 first input array or a scalar. +@param src2 second input array or a scalar. +@param dst output array that has the same size and type as the input +arrays. +@param mask optional operation mask, 8-bit single channel array, that +specifies elements of the output array to be changed. +*/ +CV_EXPORTS_W void bitwise_xor(InputArray src1, InputArray src2, + OutputArray dst, InputArray mask = noArray()); + +/** @brief Inverts every bit of an array. + +The function calculates per-element bit-wise inversion of the input +array: +\f[\texttt{dst} (I) = \neg \texttt{src} (I)\f] +In case of a floating-point input array, its machine-specific bit +representation (usually IEEE754-compliant) is used for the operation. In +case of multi-channel arrays, each channel is processed independently. +@param src input array. +@param dst output array that has the same size and type as the input +array. +@param mask optional operation mask, 8-bit single channel array, that +specifies elements of the output array to be changed. +*/ +CV_EXPORTS_W void bitwise_not(InputArray src, OutputArray dst, + InputArray mask = noArray()); + +/** @brief Calculates the per-element absolute difference between two arrays or between an array and a scalar. + +The function absdiff calculates: +* Absolute difference between two arrays when they have the same + size and type: + \f[\texttt{dst}(I) = \texttt{saturate} (| \texttt{src1}(I) - \texttt{src2}(I)|)\f] +* Absolute difference between an array and a scalar when the second + array is constructed from Scalar or has as many elements as the + number of channels in `src1`: + \f[\texttt{dst}(I) = \texttt{saturate} (| \texttt{src1}(I) - \texttt{src2} |)\f] +* Absolute difference between a scalar and an array when the first + array is constructed from Scalar or has as many elements as the + number of channels in `src2`: + \f[\texttt{dst}(I) = \texttt{saturate} (| \texttt{src1} - \texttt{src2}(I) |)\f] + where I is a multi-dimensional index of array elements. In case of + multi-channel arrays, each channel is processed independently. +@note Saturation is not applied when the arrays have the depth CV_32S. +You may even get a negative value in the case of overflow. +@param src1 first input array or a scalar. +@param src2 second input array or a scalar. +@param dst output array that has the same size and type as input arrays. +@sa cv::abs(const Mat&) +*/ +CV_EXPORTS_W void absdiff(InputArray src1, InputArray src2, OutputArray dst); + +/** @brief Checks if array elements lie between the elements of two other arrays. + +The function checks the range as follows: +- For every element of a single-channel input array: + \f[\texttt{dst} (I)= \texttt{lowerb} (I)_0 \leq \texttt{src} (I)_0 \leq \texttt{upperb} (I)_0\f] +- For two-channel arrays: + \f[\texttt{dst} (I)= \texttt{lowerb} (I)_0 \leq \texttt{src} (I)_0 \leq \texttt{upperb} (I)_0 \land \texttt{lowerb} (I)_1 \leq \texttt{src} (I)_1 \leq \texttt{upperb} (I)_1\f] +- and so forth. + +That is, dst (I) is set to 255 (all 1 -bits) if src (I) is within the +specified 1D, 2D, 3D, ... box and 0 otherwise. + +When the lower and/or upper boundary parameters are scalars, the indexes +(I) at lowerb and upperb in the above formulas should be omitted. +@param src first input array. +@param lowerb inclusive lower boundary array or a scalar. +@param upperb inclusive upper boundary array or a scalar. +@param dst output array of the same size as src and CV_8U type. +*/ +CV_EXPORTS_W void inRange(InputArray src, InputArray lowerb, + InputArray upperb, OutputArray dst); + +/** @brief Performs the per-element comparison of two arrays or an array and scalar value. + +The function compares: +* Elements of two arrays when src1 and src2 have the same size: + \f[\texttt{dst} (I) = \texttt{src1} (I) \,\texttt{cmpop}\, \texttt{src2} (I)\f] +* Elements of src1 with a scalar src2 when src2 is constructed from + Scalar or has a single element: + \f[\texttt{dst} (I) = \texttt{src1}(I) \,\texttt{cmpop}\, \texttt{src2}\f] +* src1 with elements of src2 when src1 is constructed from Scalar or + has a single element: + \f[\texttt{dst} (I) = \texttt{src1} \,\texttt{cmpop}\, \texttt{src2} (I)\f] +When the comparison result is true, the corresponding element of output +array is set to 255. The comparison operations can be replaced with the +equivalent matrix expressions: +@code{.cpp} + Mat dst1 = src1 >= src2; + Mat dst2 = src1 < 8; + ... +@endcode +@param src1 first input array or a scalar; when it is an array, it must have a single channel. +@param src2 second input array or a scalar; when it is an array, it must have a single channel. +@param dst output array of type ref CV_8U that has the same size and the same number of channels as + the input arrays. +@param cmpop a flag, that specifies correspondence between the arrays (cv::CmpTypes) +@sa checkRange, min, max, threshold +*/ +CV_EXPORTS_W void compare(InputArray src1, InputArray src2, OutputArray dst, int cmpop); + +/** @brief Calculates per-element minimum of two arrays or an array and a scalar. + +The functions min calculate the per-element minimum of two arrays: +\f[\texttt{dst} (I)= \min ( \texttt{src1} (I), \texttt{src2} (I))\f] +or array and a scalar: +\f[\texttt{dst} (I)= \min ( \texttt{src1} (I), \texttt{value} )\f] +@param src1 first input array. +@param src2 second input array of the same size and type as src1. +@param dst output array of the same size and type as src1. +@sa max, compare, inRange, minMaxLoc +*/ +CV_EXPORTS_W void min(InputArray src1, InputArray src2, OutputArray dst); +/** @overload +needed to avoid conflicts with const _Tp& std::min(const _Tp&, const _Tp&, _Compare) +*/ +CV_EXPORTS void min(const Mat& src1, const Mat& src2, Mat& dst); +/** @overload +needed to avoid conflicts with const _Tp& std::min(const _Tp&, const _Tp&, _Compare) +*/ +CV_EXPORTS void min(const UMat& src1, const UMat& src2, UMat& dst); + +/** @brief Calculates per-element maximum of two arrays or an array and a scalar. + +The functions max calculate the per-element maximum of two arrays: +\f[\texttt{dst} (I)= \max ( \texttt{src1} (I), \texttt{src2} (I))\f] +or array and a scalar: +\f[\texttt{dst} (I)= \max ( \texttt{src1} (I), \texttt{value} )\f] +@param src1 first input array. +@param src2 second input array of the same size and type as src1 . +@param dst output array of the same size and type as src1. +@sa min, compare, inRange, minMaxLoc, @ref MatrixExpressions +*/ +CV_EXPORTS_W void max(InputArray src1, InputArray src2, OutputArray dst); +/** @overload +needed to avoid conflicts with const _Tp& std::min(const _Tp&, const _Tp&, _Compare) +*/ +CV_EXPORTS void max(const Mat& src1, const Mat& src2, Mat& dst); +/** @overload +needed to avoid conflicts with const _Tp& std::min(const _Tp&, const _Tp&, _Compare) +*/ +CV_EXPORTS void max(const UMat& src1, const UMat& src2, UMat& dst); + +/** @brief Calculates a square root of array elements. + +The functions sqrt calculate a square root of each input array element. +In case of multi-channel arrays, each channel is processed +independently. The accuracy is approximately the same as of the built-in +std::sqrt . +@param src input floating-point array. +@param dst output array of the same size and type as src. +*/ +CV_EXPORTS_W void sqrt(InputArray src, OutputArray dst); + +/** @brief Raises every array element to a power. + +The function pow raises every element of the input array to power : +\f[\texttt{dst} (I) = \fork{\texttt{src}(I)^{power}}{if \(\texttt{power}\) is integer}{|\texttt{src}(I)|^{power}}{otherwise}\f] + +So, for a non-integer power exponent, the absolute values of input array +elements are used. However, it is possible to get true values for +negative values using some extra operations. In the example below, +computing the 5th root of array src shows: +@code{.cpp} + Mat mask = src < 0; + pow(src, 1./5, dst); + subtract(Scalar::all(0), dst, dst, mask); +@endcode +For some values of power, such as integer values, 0.5 and -0.5, +specialized faster algorithms are used. + +Special values (NaN, Inf) are not handled. +@param src input array. +@param power exponent of power. +@param dst output array of the same size and type as src. +@sa sqrt, exp, log, cartToPolar, polarToCart +*/ +CV_EXPORTS_W void pow(InputArray src, double power, OutputArray dst); + +/** @brief Calculates the exponent of every array element. + +The function exp calculates the exponent of every element of the input +array: +\f[\texttt{dst} [I] = e^{ src(I) }\f] + +The maximum relative error is about 7e-6 for single-precision input and +less than 1e-10 for double-precision input. Currently, the function +converts denormalized values to zeros on output. Special values (NaN, +Inf) are not handled. +@param src input array. +@param dst output array of the same size and type as src. +@sa log , cartToPolar , polarToCart , phase , pow , sqrt , magnitude +*/ +CV_EXPORTS_W void exp(InputArray src, OutputArray dst); + +/** @brief Calculates the natural logarithm of every array element. + +The function log calculates the natural logarithm of the absolute value +of every element of the input array: +\f[\texttt{dst} (I) = \fork{\log |\texttt{src}(I)|}{if \(\texttt{src}(I) \ne 0\) }{\texttt{C}}{otherwise}\f] + +where C is a large negative number (about -700 in the current +implementation). The maximum relative error is about 7e-6 for +single-precision input and less than 1e-10 for double-precision input. +Special values (NaN, Inf) are not handled. +@param src input array. +@param dst output array of the same size and type as src . +@sa exp, cartToPolar, polarToCart, phase, pow, sqrt, magnitude +*/ +CV_EXPORTS_W void log(InputArray src, OutputArray dst); + +/** @brief Calculates x and y coordinates of 2D vectors from their magnitude and angle. + +The function polarToCart calculates the Cartesian coordinates of each 2D +vector represented by the corresponding elements of magnitude and angle: +\f[\begin{array}{l} \texttt{x} (I) = \texttt{magnitude} (I) \cos ( \texttt{angle} (I)) \\ \texttt{y} (I) = \texttt{magnitude} (I) \sin ( \texttt{angle} (I)) \\ \end{array}\f] + +The relative accuracy of the estimated coordinates is about 1e-6. +@param magnitude input floating-point array of magnitudes of 2D vectors; +it can be an empty matrix (=Mat()), in this case, the function assumes +that all the magnitudes are =1; if it is not empty, it must have the +same size and type as angle. +@param angle input floating-point array of angles of 2D vectors. +@param x output array of x-coordinates of 2D vectors; it has the same +size and type as angle. +@param y output array of y-coordinates of 2D vectors; it has the same +size and type as angle. +@param angleInDegrees when true, the input angles are measured in +degrees, otherwise, they are measured in radians. +@sa cartToPolar, magnitude, phase, exp, log, pow, sqrt +*/ +CV_EXPORTS_W void polarToCart(InputArray magnitude, InputArray angle, + OutputArray x, OutputArray y, bool angleInDegrees = false); + +/** @brief Calculates the magnitude and angle of 2D vectors. + +The function cartToPolar calculates either the magnitude, angle, or both +for every 2D vector (x(I),y(I)): +\f[\begin{array}{l} \texttt{magnitude} (I)= \sqrt{\texttt{x}(I)^2+\texttt{y}(I)^2} , \\ \texttt{angle} (I)= \texttt{atan2} ( \texttt{y} (I), \texttt{x} (I))[ \cdot180 / \pi ] \end{array}\f] + +The angles are calculated with accuracy about 0.3 degrees. For the point +(0,0), the angle is set to 0. +@param x array of x-coordinates; this must be a single-precision or +double-precision floating-point array. +@param y array of y-coordinates, that must have the same size and same type as x. +@param magnitude output array of magnitudes of the same size and type as x. +@param angle output array of angles that has the same size and type as +x; the angles are measured in radians (from 0 to 2\*Pi) or in degrees (0 to 360 degrees). +@param angleInDegrees a flag, indicating whether the angles are measured +in radians (which is by default), or in degrees. +@sa Sobel, Scharr +*/ +CV_EXPORTS_W void cartToPolar(InputArray x, InputArray y, + OutputArray magnitude, OutputArray angle, + bool angleInDegrees = false); + +/** @brief Calculates the rotation angle of 2D vectors. + +The function phase calculates the rotation angle of each 2D vector that +is formed from the corresponding elements of x and y : +\f[\texttt{angle} (I) = \texttt{atan2} ( \texttt{y} (I), \texttt{x} (I))\f] + +The angle estimation accuracy is about 0.3 degrees. When x(I)=y(I)=0 , +the corresponding angle(I) is set to 0. +@param x input floating-point array of x-coordinates of 2D vectors. +@param y input array of y-coordinates of 2D vectors; it must have the +same size and the same type as x. +@param angle output array of vector angles; it has the same size and +same type as x . +@param angleInDegrees when true, the function calculates the angle in +degrees, otherwise, they are measured in radians. +*/ +CV_EXPORTS_W void phase(InputArray x, InputArray y, OutputArray angle, + bool angleInDegrees = false); + +/** @brief Calculates the magnitude of 2D vectors. + +The function magnitude calculates the magnitude of 2D vectors formed +from the corresponding elements of x and y arrays: +\f[\texttt{dst} (I) = \sqrt{\texttt{x}(I)^2 + \texttt{y}(I)^2}\f] +@param x floating-point array of x-coordinates of the vectors. +@param y floating-point array of y-coordinates of the vectors; it must +have the same size as x. +@param magnitude output array of the same size and type as x. +@sa cartToPolar, polarToCart, phase, sqrt +*/ +CV_EXPORTS_W void magnitude(InputArray x, InputArray y, OutputArray magnitude); + +/** @brief Checks every element of an input array for invalid values. + +The functions checkRange check that every array element is neither NaN nor infinite. When minVal \> +-DBL_MAX and maxVal \< DBL_MAX, the functions also check that each value is between minVal and +maxVal. In case of multi-channel arrays, each channel is processed independently. If some values +are out of range, position of the first outlier is stored in pos (when pos != NULL). Then, the +functions either return false (when quiet=true) or throw an exception. +@param a input array. +@param quiet a flag, indicating whether the functions quietly return false when the array elements +are out of range or they throw an exception. +@param pos optional output parameter, when not NULL, must be a pointer to array of src.dims +elements. +@param minVal inclusive lower boundary of valid values range. +@param maxVal exclusive upper boundary of valid values range. +*/ +CV_EXPORTS_W bool checkRange(InputArray a, bool quiet = true, CV_OUT Point* pos = 0, + double minVal = -DBL_MAX, double maxVal = DBL_MAX); + +/** @brief converts NaN's to the given number +*/ +CV_EXPORTS_W void patchNaNs(InputOutputArray a, double val = 0); + +/** @brief Performs generalized matrix multiplication. + +The function performs generalized matrix multiplication similar to the +gemm functions in BLAS level 3. For example, +`gemm(src1, src2, alpha, src3, beta, dst, GEMM_1_T + GEMM_3_T)` +corresponds to +\f[\texttt{dst} = \texttt{alpha} \cdot \texttt{src1} ^T \cdot \texttt{src2} + \texttt{beta} \cdot \texttt{src3} ^T\f] + +In case of complex (two-channel) data, performed a complex matrix +multiplication. + +The function can be replaced with a matrix expression. For example, the +above call can be replaced with: +@code{.cpp} + dst = alpha*src1.t()*src2 + beta*src3.t(); +@endcode +@param src1 first multiplied input matrix that could be real(CV_32FC1, +CV_64FC1) or complex(CV_32FC2, CV_64FC2). +@param src2 second multiplied input matrix of the same type as src1. +@param alpha weight of the matrix product. +@param src3 third optional delta matrix added to the matrix product; it +should have the same type as src1 and src2. +@param beta weight of src3. +@param dst output matrix; it has the proper size and the same type as +input matrices. +@param flags operation flags (cv::GemmFlags) +@sa mulTransposed , transform +*/ +CV_EXPORTS_W void gemm(InputArray src1, InputArray src2, double alpha, + InputArray src3, double beta, OutputArray dst, int flags = 0); + +/** @brief Calculates the product of a matrix and its transposition. + +The function mulTransposed calculates the product of src and its +transposition: +\f[\texttt{dst} = \texttt{scale} ( \texttt{src} - \texttt{delta} )^T ( \texttt{src} - \texttt{delta} )\f] +if aTa=true , and +\f[\texttt{dst} = \texttt{scale} ( \texttt{src} - \texttt{delta} ) ( \texttt{src} - \texttt{delta} )^T\f] +otherwise. The function is used to calculate the covariance matrix. With +zero delta, it can be used as a faster substitute for general matrix +product A\*B when B=A' +@param src input single-channel matrix. Note that unlike gemm, the +function can multiply not only floating-point matrices. +@param dst output square matrix. +@param aTa Flag specifying the multiplication ordering. See the +description below. +@param delta Optional delta matrix subtracted from src before the +multiplication. When the matrix is empty ( delta=noArray() ), it is +assumed to be zero, that is, nothing is subtracted. If it has the same +size as src , it is simply subtracted. Otherwise, it is "repeated" (see +repeat ) to cover the full src and then subtracted. Type of the delta +matrix, when it is not empty, must be the same as the type of created +output matrix. See the dtype parameter description below. +@param scale Optional scale factor for the matrix product. +@param dtype Optional type of the output matrix. When it is negative, +the output matrix will have the same type as src . Otherwise, it will be +type=CV_MAT_DEPTH(dtype) that should be either CV_32F or CV_64F . +@sa calcCovarMatrix, gemm, repeat, reduce +*/ +CV_EXPORTS_W void mulTransposed( InputArray src, OutputArray dst, bool aTa, + InputArray delta = noArray(), + double scale = 1, int dtype = -1 ); + +/** @brief Transposes a matrix. + +The function transpose transposes the matrix src : +\f[\texttt{dst} (i,j) = \texttt{src} (j,i)\f] +@note No complex conjugation is done in case of a complex matrix. It it +should be done separately if needed. +@param src input array. +@param dst output array of the same type as src. +*/ +CV_EXPORTS_W void transpose(InputArray src, OutputArray dst); + +/** @brief Performs the matrix transformation of every array element. + +The function transform performs the matrix transformation of every +element of the array src and stores the results in dst : +\f[\texttt{dst} (I) = \texttt{m} \cdot \texttt{src} (I)\f] +(when m.cols=src.channels() ), or +\f[\texttt{dst} (I) = \texttt{m} \cdot [ \texttt{src} (I); 1]\f] +(when m.cols=src.channels()+1 ) + +Every element of the N -channel array src is interpreted as N -element +vector that is transformed using the M x N or M x (N+1) matrix m to +M-element vector - the corresponding element of the output array dst . + +The function may be used for geometrical transformation of +N -dimensional points, arbitrary linear color space transformation (such +as various kinds of RGB to YUV transforms), shuffling the image +channels, and so forth. +@param src input array that must have as many channels (1 to 4) as +m.cols or m.cols-1. +@param dst output array of the same size and depth as src; it has as +many channels as m.rows. +@param m transformation 2x2 or 2x3 floating-point matrix. +@sa perspectiveTransform, getAffineTransform, estimateRigidTransform, warpAffine, warpPerspective +*/ +CV_EXPORTS_W void transform(InputArray src, OutputArray dst, InputArray m ); + +/** @brief Performs the perspective matrix transformation of vectors. + +The function perspectiveTransform transforms every element of src by +treating it as a 2D or 3D vector, in the following way: +\f[(x, y, z) \rightarrow (x'/w, y'/w, z'/w)\f] +where +\f[(x', y', z', w') = \texttt{mat} \cdot \begin{bmatrix} x & y & z & 1 \end{bmatrix}\f] +and +\f[w = \fork{w'}{if \(w' \ne 0\)}{\infty}{otherwise}\f] + +Here a 3D vector transformation is shown. In case of a 2D vector +transformation, the z component is omitted. + +@note The function transforms a sparse set of 2D or 3D vectors. If you +want to transform an image using perspective transformation, use +warpPerspective . If you have an inverse problem, that is, you want to +compute the most probable perspective transformation out of several +pairs of corresponding points, you can use getPerspectiveTransform or +findHomography . +@param src input two-channel or three-channel floating-point array; each +element is a 2D/3D vector to be transformed. +@param dst output array of the same size and type as src. +@param m 3x3 or 4x4 floating-point transformation matrix. +@sa transform, warpPerspective, getPerspectiveTransform, findHomography +*/ +CV_EXPORTS_W void perspectiveTransform(InputArray src, OutputArray dst, InputArray m ); + +/** @brief Copies the lower or the upper half of a square matrix to another half. + +The function completeSymm copies the lower half of a square matrix to +its another half. The matrix diagonal remains unchanged: +* \f$\texttt{mtx}_{ij}=\texttt{mtx}_{ji}\f$ for \f$i > j\f$ if + lowerToUpper=false +* \f$\texttt{mtx}_{ij}=\texttt{mtx}_{ji}\f$ for \f$i < j\f$ if + lowerToUpper=true +@param mtx input-output floating-point square matrix. +@param lowerToUpper operation flag; if true, the lower half is copied to +the upper half. Otherwise, the upper half is copied to the lower half. +@sa flip, transpose +*/ +CV_EXPORTS_W void completeSymm(InputOutputArray mtx, bool lowerToUpper = false); + +/** @brief Initializes a scaled identity matrix. + +The function setIdentity initializes a scaled identity matrix: +\f[\texttt{mtx} (i,j)= \fork{\texttt{value}}{ if \(i=j\)}{0}{otherwise}\f] + +The function can also be emulated using the matrix initializers and the +matrix expressions: +@code + Mat A = Mat::eye(4, 3, CV_32F)*5; + // A will be set to [[5, 0, 0], [0, 5, 0], [0, 0, 5], [0, 0, 0]] +@endcode +@param mtx matrix to initialize (not necessarily square). +@param s value to assign to diagonal elements. +@sa Mat::zeros, Mat::ones, Mat::setTo, Mat::operator= +*/ +CV_EXPORTS_W void setIdentity(InputOutputArray mtx, const Scalar& s = Scalar(1)); + +/** @brief Returns the determinant of a square floating-point matrix. + +The function determinant calculates and returns the determinant of the +specified matrix. For small matrices ( mtx.cols=mtx.rows\<=3 ), the +direct method is used. For larger matrices, the function uses LU +factorization with partial pivoting. + +For symmetric positively-determined matrices, it is also possible to use +eigen decomposition to calculate the determinant. +@param mtx input matrix that must have CV_32FC1 or CV_64FC1 type and +square size. +@sa trace, invert, solve, eigen, @ref MatrixExpressions +*/ +CV_EXPORTS_W double determinant(InputArray mtx); + +/** @brief Returns the trace of a matrix. + +The function trace returns the sum of the diagonal elements of the +matrix mtx . +\f[\mathrm{tr} ( \texttt{mtx} ) = \sum _i \texttt{mtx} (i,i)\f] +@param mtx input matrix. +*/ +CV_EXPORTS_W Scalar trace(InputArray mtx); + +/** @brief Finds the inverse or pseudo-inverse of a matrix. + +The function invert inverts the matrix src and stores the result in dst +. When the matrix src is singular or non-square, the function calculates +the pseudo-inverse matrix (the dst matrix) so that norm(src\*dst - I) is +minimal, where I is an identity matrix. + +In case of the DECOMP_LU method, the function returns non-zero value if +the inverse has been successfully calculated and 0 if src is singular. + +In case of the DECOMP_SVD method, the function returns the inverse +condition number of src (the ratio of the smallest singular value to the +largest singular value) and 0 if src is singular. The SVD method +calculates a pseudo-inverse matrix if src is singular. + +Similarly to DECOMP_LU, the method DECOMP_CHOLESKY works only with +non-singular square matrices that should also be symmetrical and +positively defined. In this case, the function stores the inverted +matrix in dst and returns non-zero. Otherwise, it returns 0. + +@param src input floating-point M x N matrix. +@param dst output matrix of N x M size and the same type as src. +@param flags inversion method (cv::DecompTypes) +@sa solve, SVD +*/ +CV_EXPORTS_W double invert(InputArray src, OutputArray dst, int flags = DECOMP_LU); + +/** @brief Solves one or more linear systems or least-squares problems. + +The function solve solves a linear system or least-squares problem (the +latter is possible with SVD or QR methods, or by specifying the flag +DECOMP_NORMAL ): +\f[\texttt{dst} = \arg \min _X \| \texttt{src1} \cdot \texttt{X} - \texttt{src2} \|\f] + +If DECOMP_LU or DECOMP_CHOLESKY method is used, the function returns 1 +if src1 (or \f$\texttt{src1}^T\texttt{src1}\f$ ) is non-singular. Otherwise, +it returns 0. In the latter case, dst is not valid. Other methods find a +pseudo-solution in case of a singular left-hand side part. + +@note If you want to find a unity-norm solution of an under-defined +singular system \f$\texttt{src1}\cdot\texttt{dst}=0\f$ , the function solve +will not do the work. Use SVD::solveZ instead. + +@param src1 input matrix on the left-hand side of the system. +@param src2 input matrix on the right-hand side of the system. +@param dst output solution. +@param flags solution (matrix inversion) method (cv::DecompTypes) +@sa invert, SVD, eigen +*/ +CV_EXPORTS_W bool solve(InputArray src1, InputArray src2, + OutputArray dst, int flags = DECOMP_LU); + +/** @brief Sorts each row or each column of a matrix. + +The function sort sorts each matrix row or each matrix column in +ascending or descending order. So you should pass two operation flags to +get desired behaviour. If you want to sort matrix rows or columns +lexicographically, you can use STL std::sort generic function with the +proper comparison predicate. + +@param src input single-channel array. +@param dst output array of the same size and type as src. +@param flags operation flags, a combination of cv::SortFlags +@sa sortIdx, randShuffle +*/ +CV_EXPORTS_W void sort(InputArray src, OutputArray dst, int flags); + +/** @brief Sorts each row or each column of a matrix. + +The function sortIdx sorts each matrix row or each matrix column in the +ascending or descending order. So you should pass two operation flags to +get desired behaviour. Instead of reordering the elements themselves, it +stores the indices of sorted elements in the output array. For example: +@code + Mat A = Mat::eye(3,3,CV_32F), B; + sortIdx(A, B, SORT_EVERY_ROW + SORT_ASCENDING); + // B will probably contain + // (because of equal elements in A some permutations are possible): + // [[1, 2, 0], [0, 2, 1], [0, 1, 2]] +@endcode +@param src input single-channel array. +@param dst output integer array of the same size as src. +@param flags operation flags that could be a combination of cv::SortFlags +@sa sort, randShuffle +*/ +CV_EXPORTS_W void sortIdx(InputArray src, OutputArray dst, int flags); + +/** @brief Finds the real roots of a cubic equation. + +The function solveCubic finds the real roots of a cubic equation: +- if coeffs is a 4-element vector: +\f[\texttt{coeffs} [0] x^3 + \texttt{coeffs} [1] x^2 + \texttt{coeffs} [2] x + \texttt{coeffs} [3] = 0\f] +- if coeffs is a 3-element vector: +\f[x^3 + \texttt{coeffs} [0] x^2 + \texttt{coeffs} [1] x + \texttt{coeffs} [2] = 0\f] + +The roots are stored in the roots array. +@param coeffs equation coefficients, an array of 3 or 4 elements. +@param roots output array of real roots that has 1 or 3 elements. +*/ +CV_EXPORTS_W int solveCubic(InputArray coeffs, OutputArray roots); + +/** @brief Finds the real or complex roots of a polynomial equation. + +The function solvePoly finds real and complex roots of a polynomial equation: +\f[\texttt{coeffs} [n] x^{n} + \texttt{coeffs} [n-1] x^{n-1} + ... + \texttt{coeffs} [1] x + \texttt{coeffs} [0] = 0\f] +@param coeffs array of polynomial coefficients. +@param roots output (complex) array of roots. +@param maxIters maximum number of iterations the algorithm does. +*/ +CV_EXPORTS_W double solvePoly(InputArray coeffs, OutputArray roots, int maxIters = 300); + +/** @brief Calculates eigenvalues and eigenvectors of a symmetric matrix. + +The functions eigen calculate just eigenvalues, or eigenvalues and eigenvectors of the symmetric +matrix src: +@code + src*eigenvectors.row(i).t() = eigenvalues.at(i)*eigenvectors.row(i).t() +@endcode +@note in the new and the old interfaces different ordering of eigenvalues and eigenvectors +parameters is used. +@param src input matrix that must have CV_32FC1 or CV_64FC1 type, square size and be symmetrical +(src ^T^ == src). +@param eigenvalues output vector of eigenvalues of the same type as src; the eigenvalues are stored +in the descending order. +@param eigenvectors output matrix of eigenvectors; it has the same size and type as src; the +eigenvectors are stored as subsequent matrix rows, in the same order as the corresponding +eigenvalues. +@sa completeSymm , PCA +*/ +CV_EXPORTS_W bool eigen(InputArray src, OutputArray eigenvalues, + OutputArray eigenvectors = noArray()); + +/** @brief Calculates the covariance matrix of a set of vectors. + +The functions calcCovarMatrix calculate the covariance matrix and, optionally, the mean vector of +the set of input vectors. +@param samples samples stored as separate matrices +@param nsamples number of samples +@param covar output covariance matrix of the type ctype and square size. +@param mean input or output (depending on the flags) array as the average value of the input vectors. +@param flags operation flags as a combination of cv::CovarFlags +@param ctype type of the matrixl; it equals 'CV_64F' by default. +@sa PCA, mulTransposed, Mahalanobis +@todo InputArrayOfArrays +*/ +CV_EXPORTS void calcCovarMatrix( const Mat* samples, int nsamples, Mat& covar, Mat& mean, + int flags, int ctype = CV_64F); + +/** @overload +@note use cv::COVAR_ROWS or cv::COVAR_COLS flag +@param samples samples stored as rows/columns of a single matrix. +@param covar output covariance matrix of the type ctype and square size. +@param mean input or output (depending on the flags) array as the average value of the input vectors. +@param flags operation flags as a combination of cv::CovarFlags +@param ctype type of the matrixl; it equals 'CV_64F' by default. +*/ +CV_EXPORTS_W void calcCovarMatrix( InputArray samples, OutputArray covar, + InputOutputArray mean, int flags, int ctype = CV_64F); + +/** wrap PCA::operator() */ +CV_EXPORTS_W void PCACompute(InputArray data, InputOutputArray mean, + OutputArray eigenvectors, int maxComponents = 0); + +/** wrap PCA::operator() */ +CV_EXPORTS_W void PCACompute(InputArray data, InputOutputArray mean, + OutputArray eigenvectors, double retainedVariance); + +/** wrap PCA::project */ +CV_EXPORTS_W void PCAProject(InputArray data, InputArray mean, + InputArray eigenvectors, OutputArray result); + +/** wrap PCA::backProject */ +CV_EXPORTS_W void PCABackProject(InputArray data, InputArray mean, + InputArray eigenvectors, OutputArray result); + +/** wrap SVD::compute */ +CV_EXPORTS_W void SVDecomp( InputArray src, OutputArray w, OutputArray u, OutputArray vt, int flags = 0 ); + +/** wrap SVD::backSubst */ +CV_EXPORTS_W void SVBackSubst( InputArray w, InputArray u, InputArray vt, + InputArray rhs, OutputArray dst ); + +/** @brief Calculates the Mahalanobis distance between two vectors. + +The function Mahalanobis calculates and returns the weighted distance between two vectors: +\f[d( \texttt{vec1} , \texttt{vec2} )= \sqrt{\sum_{i,j}{\texttt{icovar(i,j)}\cdot(\texttt{vec1}(I)-\texttt{vec2}(I))\cdot(\texttt{vec1(j)}-\texttt{vec2(j)})} }\f] +The covariance matrix may be calculated using the cv::calcCovarMatrix function and then inverted using +the invert function (preferably using the cv::DECOMP_SVD method, as the most accurate). +@param v1 first 1D input vector. +@param v2 second 1D input vector. +@param icovar inverse covariance matrix. +*/ +CV_EXPORTS_W double Mahalanobis(InputArray v1, InputArray v2, InputArray icovar); + +/** @brief Performs a forward or inverse Discrete Fourier transform of a 1D or 2D floating-point array. + +The function performs one of the following: +- Forward the Fourier transform of a 1D vector of N elements: + \f[Y = F^{(N)} \cdot X,\f] + where \f$F^{(N)}_{jk}=\exp(-2\pi i j k/N)\f$ and \f$i=\sqrt{-1}\f$ +- Inverse the Fourier transform of a 1D vector of N elements: + \f[\begin{array}{l} X'= \left (F^{(N)} \right )^{-1} \cdot Y = \left (F^{(N)} \right )^* \cdot y \\ X = (1/N) \cdot X, \end{array}\f] + where \f$F^*=\left(\textrm{Re}(F^{(N)})-\textrm{Im}(F^{(N)})\right)^T\f$ +- Forward the 2D Fourier transform of a M x N matrix: + \f[Y = F^{(M)} \cdot X \cdot F^{(N)}\f] +- Inverse the 2D Fourier transform of a M x N matrix: + \f[\begin{array}{l} X'= \left (F^{(M)} \right )^* \cdot Y \cdot \left (F^{(N)} \right )^* \\ X = \frac{1}{M \cdot N} \cdot X' \end{array}\f] + +In case of real (single-channel) data, the output spectrum of the forward Fourier transform or input +spectrum of the inverse Fourier transform can be represented in a packed format called *CCS* +(complex-conjugate-symmetrical). It was borrowed from IPL (Intel\* Image Processing Library). Here +is how 2D *CCS* spectrum looks: +\f[\begin{bmatrix} Re Y_{0,0} & Re Y_{0,1} & Im Y_{0,1} & Re Y_{0,2} & Im Y_{0,2} & \cdots & Re Y_{0,N/2-1} & Im Y_{0,N/2-1} & Re Y_{0,N/2} \\ Re Y_{1,0} & Re Y_{1,1} & Im Y_{1,1} & Re Y_{1,2} & Im Y_{1,2} & \cdots & Re Y_{1,N/2-1} & Im Y_{1,N/2-1} & Re Y_{1,N/2} \\ Im Y_{1,0} & Re Y_{2,1} & Im Y_{2,1} & Re Y_{2,2} & Im Y_{2,2} & \cdots & Re Y_{2,N/2-1} & Im Y_{2,N/2-1} & Im Y_{1,N/2} \\ \hdotsfor{9} \\ Re Y_{M/2-1,0} & Re Y_{M-3,1} & Im Y_{M-3,1} & \hdotsfor{3} & Re Y_{M-3,N/2-1} & Im Y_{M-3,N/2-1}& Re Y_{M/2-1,N/2} \\ Im Y_{M/2-1,0} & Re Y_{M-2,1} & Im Y_{M-2,1} & \hdotsfor{3} & Re Y_{M-2,N/2-1} & Im Y_{M-2,N/2-1}& Im Y_{M/2-1,N/2} \\ Re Y_{M/2,0} & Re Y_{M-1,1} & Im Y_{M-1,1} & \hdotsfor{3} & Re Y_{M-1,N/2-1} & Im Y_{M-1,N/2-1}& Re Y_{M/2,N/2} \end{bmatrix}\f] + +In case of 1D transform of a real vector, the output looks like the first row of the matrix above. + +So, the function chooses an operation mode depending on the flags and size of the input array: +- If DFT_ROWS is set or the input array has a single row or single column, the function + performs a 1D forward or inverse transform of each row of a matrix when DFT_ROWS is set. + Otherwise, it performs a 2D transform. +- If the input array is real and DFT_INVERSE is not set, the function performs a forward 1D or + 2D transform: + - When DFT_COMPLEX_OUTPUT is set, the output is a complex matrix of the same size as + input. + - When DFT_COMPLEX_OUTPUT is not set, the output is a real matrix of the same size as + input. In case of 2D transform, it uses the packed format as shown above. In case of a + single 1D transform, it looks like the first row of the matrix above. In case of + multiple 1D transforms (when using the DFT_ROWS flag), each row of the output matrix + looks like the first row of the matrix above. +- If the input array is complex and either DFT_INVERSE or DFT_REAL_OUTPUT are not set, the + output is a complex array of the same size as input. The function performs a forward or + inverse 1D or 2D transform of the whole input array or each row of the input array + independently, depending on the flags DFT_INVERSE and DFT_ROWS. +- When DFT_INVERSE is set and the input array is real, or it is complex but DFT_REAL_OUTPUT + is set, the output is a real array of the same size as input. The function performs a 1D or 2D + inverse transformation of the whole input array or each individual row, depending on the flags + DFT_INVERSE and DFT_ROWS. + +If DFT_SCALE is set, the scaling is done after the transformation. + +Unlike dct , the function supports arrays of arbitrary size. But only those arrays are processed +efficiently, whose sizes can be factorized in a product of small prime numbers (2, 3, and 5 in the +current implementation). Such an efficient DFT size can be calculated using the getOptimalDFTSize +method. + +The sample below illustrates how to calculate a DFT-based convolution of two 2D real arrays: +@code + void convolveDFT(InputArray A, InputArray B, OutputArray C) + { + // reallocate the output array if needed + C.create(abs(A.rows - B.rows)+1, abs(A.cols - B.cols)+1, A.type()); + Size dftSize; + // calculate the size of DFT transform + dftSize.width = getOptimalDFTSize(A.cols + B.cols - 1); + dftSize.height = getOptimalDFTSize(A.rows + B.rows - 1); + + // allocate temporary buffers and initialize them with 0's + Mat tempA(dftSize, A.type(), Scalar::all(0)); + Mat tempB(dftSize, B.type(), Scalar::all(0)); + + // copy A and B to the top-left corners of tempA and tempB, respectively + Mat roiA(tempA, Rect(0,0,A.cols,A.rows)); + A.copyTo(roiA); + Mat roiB(tempB, Rect(0,0,B.cols,B.rows)); + B.copyTo(roiB); + + // now transform the padded A & B in-place; + // use "nonzeroRows" hint for faster processing + dft(tempA, tempA, 0, A.rows); + dft(tempB, tempB, 0, B.rows); + + // multiply the spectrums; + // the function handles packed spectrum representations well + mulSpectrums(tempA, tempB, tempA); + + // transform the product back from the frequency domain. + // Even though all the result rows will be non-zero, + // you need only the first C.rows of them, and thus you + // pass nonzeroRows == C.rows + dft(tempA, tempA, DFT_INVERSE + DFT_SCALE, C.rows); + + // now copy the result back to C. + tempA(Rect(0, 0, C.cols, C.rows)).copyTo(C); + + // all the temporary buffers will be deallocated automatically + } +@endcode +To optimize this sample, consider the following approaches: +- Since nonzeroRows != 0 is passed to the forward transform calls and since A and B are copied to + the top-left corners of tempA and tempB, respectively, it is not necessary to clear the whole + tempA and tempB. It is only necessary to clear the tempA.cols - A.cols ( tempB.cols - B.cols) + rightmost columns of the matrices. +- This DFT-based convolution does not have to be applied to the whole big arrays, especially if B + is significantly smaller than A or vice versa. Instead, you can calculate convolution by parts. + To do this, you need to split the output array C into multiple tiles. For each tile, estimate + which parts of A and B are required to calculate convolution in this tile. If the tiles in C are + too small, the speed will decrease a lot because of repeated work. In the ultimate case, when + each tile in C is a single pixel, the algorithm becomes equivalent to the naive convolution + algorithm. If the tiles are too big, the temporary arrays tempA and tempB become too big and + there is also a slowdown because of bad cache locality. So, there is an optimal tile size + somewhere in the middle. +- If different tiles in C can be calculated in parallel and, thus, the convolution is done by + parts, the loop can be threaded. + +All of the above improvements have been implemented in matchTemplate and filter2D . Therefore, by +using them, you can get the performance even better than with the above theoretically optimal +implementation. Though, those two functions actually calculate cross-correlation, not convolution, +so you need to "flip" the second convolution operand B vertically and horizontally using flip . +@note +- An example using the discrete fourier transform can be found at + opencv_source_code/samples/cpp/dft.cpp +- (Python) An example using the dft functionality to perform Wiener deconvolution can be found + at opencv_source/samples/python/deconvolution.py +- (Python) An example rearranging the quadrants of a Fourier image can be found at + opencv_source/samples/python/dft.py +@param src input array that could be real or complex. +@param dst output array whose size and type depends on the flags . +@param flags transformation flags, representing a combination of the cv::DftFlags +@param nonzeroRows when the parameter is not zero, the function assumes that only the first +nonzeroRows rows of the input array (DFT_INVERSE is not set) or only the first nonzeroRows of the +output array (DFT_INVERSE is set) contain non-zeros, thus, the function can handle the rest of the +rows more efficiently and save some time; this technique is very useful for calculating array +cross-correlation or convolution using DFT. +@sa dct , getOptimalDFTSize , mulSpectrums, filter2D , matchTemplate , flip , cartToPolar , +magnitude , phase +*/ +CV_EXPORTS_W void dft(InputArray src, OutputArray dst, int flags = 0, int nonzeroRows = 0); + +/** @brief Calculates the inverse Discrete Fourier Transform of a 1D or 2D array. + +idft(src, dst, flags) is equivalent to dft(src, dst, flags | DFT_INVERSE) . +@note None of dft and idft scales the result by default. So, you should pass DFT_SCALE to one of +dft or idft explicitly to make these transforms mutually inverse. +@sa dft, dct, idct, mulSpectrums, getOptimalDFTSize +@param src input floating-point real or complex array. +@param dst output array whose size and type depend on the flags. +@param flags operation flags (see dft and cv::DftFlags). +@param nonzeroRows number of dst rows to process; the rest of the rows have undefined content (see +the convolution sample in dft description. +*/ +CV_EXPORTS_W void idft(InputArray src, OutputArray dst, int flags = 0, int nonzeroRows = 0); + +/** @brief Performs a forward or inverse discrete Cosine transform of 1D or 2D array. + +The function dct performs a forward or inverse discrete Cosine transform (DCT) of a 1D or 2D +floating-point array: +- Forward Cosine transform of a 1D vector of N elements: + \f[Y = C^{(N)} \cdot X\f] + where + \f[C^{(N)}_{jk}= \sqrt{\alpha_j/N} \cos \left ( \frac{\pi(2k+1)j}{2N} \right )\f] + and + \f$\alpha_0=1\f$, \f$\alpha_j=2\f$ for *j \> 0*. +- Inverse Cosine transform of a 1D vector of N elements: + \f[X = \left (C^{(N)} \right )^{-1} \cdot Y = \left (C^{(N)} \right )^T \cdot Y\f] + (since \f$C^{(N)}\f$ is an orthogonal matrix, \f$C^{(N)} \cdot \left(C^{(N)}\right)^T = I\f$ ) +- Forward 2D Cosine transform of M x N matrix: + \f[Y = C^{(N)} \cdot X \cdot \left (C^{(N)} \right )^T\f] +- Inverse 2D Cosine transform of M x N matrix: + \f[X = \left (C^{(N)} \right )^T \cdot X \cdot C^{(N)}\f] + +The function chooses the mode of operation by looking at the flags and size of the input array: +- If (flags & DCT_INVERSE) == 0 , the function does a forward 1D or 2D transform. Otherwise, it + is an inverse 1D or 2D transform. +- If (flags & DCT_ROWS) != 0 , the function performs a 1D transform of each row. +- If the array is a single column or a single row, the function performs a 1D transform. +- If none of the above is true, the function performs a 2D transform. + +@note Currently dct supports even-size arrays (2, 4, 6 ...). For data analysis and approximation, you +can pad the array when necessary. +Also, the function performance depends very much, and not monotonically, on the array size (see +getOptimalDFTSize ). In the current implementation DCT of a vector of size N is calculated via DFT +of a vector of size N/2 . Thus, the optimal DCT size N1 \>= N can be calculated as: +@code + size_t getOptimalDCTSize(size_t N) { return 2*getOptimalDFTSize((N+1)/2); } + N1 = getOptimalDCTSize(N); +@endcode +@param src input floating-point array. +@param dst output array of the same size and type as src . +@param flags transformation flags as a combination of cv::DftFlags (DCT_*) +@sa dft , getOptimalDFTSize , idct +*/ +CV_EXPORTS_W void dct(InputArray src, OutputArray dst, int flags = 0); + +/** @brief Calculates the inverse Discrete Cosine Transform of a 1D or 2D array. + +idct(src, dst, flags) is equivalent to dct(src, dst, flags | DCT_INVERSE). +@param src input floating-point single-channel array. +@param dst output array of the same size and type as src. +@param flags operation flags. +@sa dct, dft, idft, getOptimalDFTSize +*/ +CV_EXPORTS_W void idct(InputArray src, OutputArray dst, int flags = 0); + +/** @brief Performs the per-element multiplication of two Fourier spectrums. + +The function mulSpectrums performs the per-element multiplication of the two CCS-packed or complex +matrices that are results of a real or complex Fourier transform. + +The function, together with dft and idft , may be used to calculate convolution (pass conjB=false ) +or correlation (pass conjB=true ) of two arrays rapidly. When the arrays are complex, they are +simply multiplied (per element) with an optional conjugation of the second-array elements. When the +arrays are real, they are assumed to be CCS-packed (see dft for details). +@param a first input array. +@param b second input array of the same size and type as src1 . +@param c output array of the same size and type as src1 . +@param flags operation flags; currently, the only supported flag is cv::DFT_ROWS, which indicates that +each row of src1 and src2 is an independent 1D Fourier spectrum. If you do not want to use this flag, then simply add a `0` as value. +@param conjB optional flag that conjugates the second input array before the multiplication (true) +or not (false). +*/ +CV_EXPORTS_W void mulSpectrums(InputArray a, InputArray b, OutputArray c, + int flags, bool conjB = false); + +/** @brief Returns the optimal DFT size for a given vector size. + +DFT performance is not a monotonic function of a vector size. Therefore, when you calculate +convolution of two arrays or perform the spectral analysis of an array, it usually makes sense to +pad the input data with zeros to get a bit larger array that can be transformed much faster than the +original one. Arrays whose size is a power-of-two (2, 4, 8, 16, 32, ...) are the fastest to process. +Though, the arrays whose size is a product of 2's, 3's, and 5's (for example, 300 = 5\*5\*3\*2\*2) +are also processed quite efficiently. + +The function getOptimalDFTSize returns the minimum number N that is greater than or equal to vecsize +so that the DFT of a vector of size N can be processed efficiently. In the current implementation N += 2 ^p^ \* 3 ^q^ \* 5 ^r^ for some integer p, q, r. + +The function returns a negative number if vecsize is too large (very close to INT_MAX ). + +While the function cannot be used directly to estimate the optimal vector size for DCT transform +(since the current DCT implementation supports only even-size vectors), it can be easily processed +as getOptimalDFTSize((vecsize+1)/2)\*2. +@param vecsize vector size. +@sa dft , dct , idft , idct , mulSpectrums +*/ +CV_EXPORTS_W int getOptimalDFTSize(int vecsize); + +/** @brief Returns the default random number generator. + +The function theRNG returns the default random number generator. For each thread, there is a +separate random number generator, so you can use the function safely in multi-thread environments. +If you just need to get a single random number using this generator or initialize an array, you can +use randu or randn instead. But if you are going to generate many random numbers inside a loop, it +is much faster to use this function to retrieve the generator and then use RNG::operator _Tp() . +@sa RNG, randu, randn +*/ +CV_EXPORTS RNG& theRNG(); + +/** @brief Generates a single uniformly-distributed random number or an array of random numbers. + +Non-template variant of the function fills the matrix dst with uniformly-distributed +random numbers from the specified range: +\f[\texttt{low} _c \leq \texttt{dst} (I)_c < \texttt{high} _c\f] +@param dst output array of random numbers; the array must be pre-allocated. +@param low inclusive lower boundary of the generated random numbers. +@param high exclusive upper boundary of the generated random numbers. +@sa RNG, randn, theRNG +*/ +CV_EXPORTS_W void randu(InputOutputArray dst, InputArray low, InputArray high); + +/** @brief Fills the array with normally distributed random numbers. + +The function randn fills the matrix dst with normally distributed random numbers with the specified +mean vector and the standard deviation matrix. The generated random numbers are clipped to fit the +value range of the output array data type. +@param dst output array of random numbers; the array must be pre-allocated and have 1 to 4 channels. +@param mean mean value (expectation) of the generated random numbers. +@param stddev standard deviation of the generated random numbers; it can be either a vector (in +which case a diagonal standard deviation matrix is assumed) or a square matrix. +@sa RNG, randu +*/ +CV_EXPORTS_W void randn(InputOutputArray dst, InputArray mean, InputArray stddev); + +/** @brief Shuffles the array elements randomly. + +The function randShuffle shuffles the specified 1D array by randomly choosing pairs of elements and +swapping them. The number of such swap operations will be dst.rows\*dst.cols\*iterFactor . +@param dst input/output numerical 1D array. +@param iterFactor scale factor that determines the number of random swap operations (see the details +below). +@param rng optional random number generator used for shuffling; if it is zero, theRNG () is used +instead. +@sa RNG, sort +*/ +CV_EXPORTS_W void randShuffle(InputOutputArray dst, double iterFactor = 1., RNG* rng = 0); + +/** @brief Principal Component Analysis + +The class is used to calculate a special basis for a set of vectors. The +basis will consist of eigenvectors of the covariance matrix calculated +from the input set of vectors. The class %PCA can also transform +vectors to/from the new coordinate space defined by the basis. Usually, +in this new coordinate system, each vector from the original set (and +any linear combination of such vectors) can be quite accurately +approximated by taking its first few components, corresponding to the +eigenvectors of the largest eigenvalues of the covariance matrix. +Geometrically it means that you calculate a projection of the vector to +a subspace formed by a few eigenvectors corresponding to the dominant +eigenvalues of the covariance matrix. And usually such a projection is +very close to the original vector. So, you can represent the original +vector from a high-dimensional space with a much shorter vector +consisting of the projected vector's coordinates in the subspace. Such a +transformation is also known as Karhunen-Loeve Transform, or KLT. +See http://en.wikipedia.org/wiki/Principal_component_analysis + +The sample below is the function that takes two matrices. The first +function stores a set of vectors (a row per vector) that is used to +calculate PCA. The second function stores another "test" set of vectors +(a row per vector). First, these vectors are compressed with PCA, then +reconstructed back, and then the reconstruction error norm is computed +and printed for each vector. : + +@code{.cpp} +using namespace cv; + +PCA compressPCA(const Mat& pcaset, int maxComponents, + const Mat& testset, Mat& compressed) +{ + PCA pca(pcaset, // pass the data + Mat(), // we do not have a pre-computed mean vector, + // so let the PCA engine to compute it + PCA::DATA_AS_ROW, // indicate that the vectors + // are stored as matrix rows + // (use PCA::DATA_AS_COL if the vectors are + // the matrix columns) + maxComponents // specify, how many principal components to retain + ); + // if there is no test data, just return the computed basis, ready-to-use + if( !testset.data ) + return pca; + CV_Assert( testset.cols == pcaset.cols ); + + compressed.create(testset.rows, maxComponents, testset.type()); + + Mat reconstructed; + for( int i = 0; i < testset.rows; i++ ) + { + Mat vec = testset.row(i), coeffs = compressed.row(i), reconstructed; + // compress the vector, the result will be stored + // in the i-th row of the output matrix + pca.project(vec, coeffs); + // and then reconstruct it + pca.backProject(coeffs, reconstructed); + // and measure the error + printf("%d. diff = %g\n", i, norm(vec, reconstructed, NORM_L2)); + } + return pca; +} +@endcode +@sa calcCovarMatrix, mulTransposed, SVD, dft, dct +*/ +class CV_EXPORTS PCA +{ +public: + enum Flags { DATA_AS_ROW = 0, //!< indicates that the input samples are stored as matrix rows + DATA_AS_COL = 1, //!< indicates that the input samples are stored as matrix columns + USE_AVG = 2 //! + }; + + /** @brief default constructor + + The default constructor initializes an empty %PCA structure. The other + constructors initialize the structure and call PCA::operator()(). + */ + PCA(); + + /** @overload + @param data input samples stored as matrix rows or matrix columns. + @param mean optional mean value; if the matrix is empty (@c noArray()), + the mean is computed from the data. + @param flags operation flags; currently the parameter is only used to + specify the data layout (PCA::Flags) + @param maxComponents maximum number of components that %PCA should + retain; by default, all the components are retained. + */ + PCA(InputArray data, InputArray mean, int flags, int maxComponents = 0); + + /** @overload + @param data input samples stored as matrix rows or matrix columns. + @param mean optional mean value; if the matrix is empty (noArray()), + the mean is computed from the data. + @param flags operation flags; currently the parameter is only used to + specify the data layout (PCA::Flags) + @param retainedVariance Percentage of variance that PCA should retain. + Using this parameter will let the PCA decided how many components to + retain but it will always keep at least 2. + */ + PCA(InputArray data, InputArray mean, int flags, double retainedVariance); + + /** @brief performs %PCA + + The operator performs %PCA of the supplied dataset. It is safe to reuse + the same PCA structure for multiple datasets. That is, if the structure + has been previously used with another dataset, the existing internal + data is reclaimed and the new eigenvalues, @ref eigenvectors , and @ref + mean are allocated and computed. + + The computed eigenvalues are sorted from the largest to the smallest and + the corresponding eigenvectors are stored as eigenvectors rows. + + @param data input samples stored as the matrix rows or as the matrix + columns. + @param mean optional mean value; if the matrix is empty (noArray()), + the mean is computed from the data. + @param flags operation flags; currently the parameter is only used to + specify the data layout. (Flags) + @param maxComponents maximum number of components that PCA should + retain; by default, all the components are retained. + */ + PCA& operator()(InputArray data, InputArray mean, int flags, int maxComponents = 0); + + /** @overload + @param data input samples stored as the matrix rows or as the matrix + columns. + @param mean optional mean value; if the matrix is empty (noArray()), + the mean is computed from the data. + @param flags operation flags; currently the parameter is only used to + specify the data layout. (PCA::Flags) + @param retainedVariance Percentage of variance that %PCA should retain. + Using this parameter will let the %PCA decided how many components to + retain but it will always keep at least 2. + */ + PCA& operator()(InputArray data, InputArray mean, int flags, double retainedVariance); + + /** @brief Projects vector(s) to the principal component subspace. + + The methods project one or more vectors to the principal component + subspace, where each vector projection is represented by coefficients in + the principal component basis. The first form of the method returns the + matrix that the second form writes to the result. So the first form can + be used as a part of expression while the second form can be more + efficient in a processing loop. + @param vec input vector(s); must have the same dimensionality and the + same layout as the input data used at %PCA phase, that is, if + DATA_AS_ROW are specified, then `vec.cols==data.cols` + (vector dimensionality) and `vec.rows` is the number of vectors to + project, and the same is true for the PCA::DATA_AS_COL case. + */ + Mat project(InputArray vec) const; + + /** @overload + @param vec input vector(s); must have the same dimensionality and the + same layout as the input data used at PCA phase, that is, if + DATA_AS_ROW are specified, then `vec.cols==data.cols` + (vector dimensionality) and `vec.rows` is the number of vectors to + project, and the same is true for the PCA::DATA_AS_COL case. + @param result output vectors; in case of PCA::DATA_AS_COL, the + output matrix has as many columns as the number of input vectors, this + means that `result.cols==vec.cols` and the number of rows match the + number of principal components (for example, `maxComponents` parameter + passed to the constructor). + */ + void project(InputArray vec, OutputArray result) const; + + /** @brief Reconstructs vectors from their PC projections. + + The methods are inverse operations to PCA::project. They take PC + coordinates of projected vectors and reconstruct the original vectors. + Unless all the principal components have been retained, the + reconstructed vectors are different from the originals. But typically, + the difference is small if the number of components is large enough (but + still much smaller than the original vector dimensionality). As a + result, PCA is used. + @param vec coordinates of the vectors in the principal component + subspace, the layout and size are the same as of PCA::project output + vectors. + */ + Mat backProject(InputArray vec) const; + + /** @overload + @param vec coordinates of the vectors in the principal component + subspace, the layout and size are the same as of PCA::project output + vectors. + @param result reconstructed vectors; the layout and size are the same as + of PCA::project input vectors. + */ + void backProject(InputArray vec, OutputArray result) const; + + /** @brief write and load PCA matrix + +*/ + void write(FileStorage& fs ) const; + void read(const FileNode& fs); + + Mat eigenvectors; //!< eigenvectors of the covariation matrix + Mat eigenvalues; //!< eigenvalues of the covariation matrix + Mat mean; //!< mean value subtracted before the projection and added after the back projection +}; + +/** @example pca.cpp + An example using %PCA for dimensionality reduction while maintaining an amount of variance + */ + +/** + @brief Linear Discriminant Analysis + @todo document this class + */ +class CV_EXPORTS LDA +{ +public: + /** @brief constructor + Initializes a LDA with num_components (default 0). + */ + explicit LDA(int num_components = 0); + + /** Initializes and performs a Discriminant Analysis with Fisher's + Optimization Criterion on given data in src and corresponding labels + in labels. If 0 (or less) number of components are given, they are + automatically determined for given data in computation. + */ + LDA(InputArrayOfArrays src, InputArray labels, int num_components = 0); + + /** Serializes this object to a given filename. + */ + void save(const String& filename) const; + + /** Deserializes this object from a given filename. + */ + void load(const String& filename); + + /** Serializes this object to a given cv::FileStorage. + */ + void save(FileStorage& fs) const; + + /** Deserializes this object from a given cv::FileStorage. + */ + void load(const FileStorage& node); + + /** destructor + */ + ~LDA(); + + /** Compute the discriminants for data in src (row aligned) and labels. + */ + void compute(InputArrayOfArrays src, InputArray labels); + + /** Projects samples into the LDA subspace. + src may be one or more row aligned samples. + */ + Mat project(InputArray src); + + /** Reconstructs projections from the LDA subspace. + src may be one or more row aligned projections. + */ + Mat reconstruct(InputArray src); + + /** Returns the eigenvectors of this LDA. + */ + Mat eigenvectors() const { return _eigenvectors; } + + /** Returns the eigenvalues of this LDA. + */ + Mat eigenvalues() const { return _eigenvalues; } + + static Mat subspaceProject(InputArray W, InputArray mean, InputArray src); + static Mat subspaceReconstruct(InputArray W, InputArray mean, InputArray src); + +protected: + bool _dataAsRow; // unused, but needed for 3.0 ABI compatibility. + int _num_components; + Mat _eigenvectors; + Mat _eigenvalues; + void lda(InputArrayOfArrays src, InputArray labels); +}; + +/** @brief Singular Value Decomposition + +Class for computing Singular Value Decomposition of a floating-point +matrix. The Singular Value Decomposition is used to solve least-square +problems, under-determined linear systems, invert matrices, compute +condition numbers, and so on. + +If you want to compute a condition number of a matrix or an absolute value of +its determinant, you do not need `u` and `vt`. You can pass +flags=SVD::NO_UV|... . Another flag SVD::FULL_UV indicates that full-size u +and vt must be computed, which is not necessary most of the time. + +@sa invert, solve, eigen, determinant +*/ +class CV_EXPORTS SVD +{ +public: + enum Flags { + /** allow the algorithm to modify the decomposed matrix; it can save space and speed up + processing. currently ignored. */ + MODIFY_A = 1, + /** indicates that only a vector of singular values `w` is to be processed, while u and vt + will be set to empty matrices */ + NO_UV = 2, + /** when the matrix is not square, by default the algorithm produces u and vt matrices of + sufficiently large size for the further A reconstruction; if, however, FULL_UV flag is + specified, u and vt will be full-size square orthogonal matrices.*/ + FULL_UV = 4 + }; + + /** @brief the default constructor + + initializes an empty SVD structure + */ + SVD(); + + /** @overload + initializes an empty SVD structure and then calls SVD::operator() + @param src decomposed matrix. + @param flags operation flags (SVD::Flags) + */ + SVD( InputArray src, int flags = 0 ); + + /** @brief the operator that performs SVD. The previously allocated u, w and vt are released. + + The operator performs the singular value decomposition of the supplied + matrix. The u,`vt` , and the vector of singular values w are stored in + the structure. The same SVD structure can be reused many times with + different matrices. Each time, if needed, the previous u,`vt` , and w + are reclaimed and the new matrices are created, which is all handled by + Mat::create. + @param src decomposed matrix. + @param flags operation flags (SVD::Flags) + */ + SVD& operator ()( InputArray src, int flags = 0 ); + + /** @brief decomposes matrix and stores the results to user-provided matrices + + The methods/functions perform SVD of matrix. Unlike SVD::SVD constructor + and SVD::operator(), they store the results to the user-provided + matrices: + + @code{.cpp} + Mat A, w, u, vt; + SVD::compute(A, w, u, vt); + @endcode + + @param src decomposed matrix + @param w calculated singular values + @param u calculated left singular vectors + @param vt transposed matrix of right singular values + @param flags operation flags - see SVD::SVD. + */ + static void compute( InputArray src, OutputArray w, + OutputArray u, OutputArray vt, int flags = 0 ); + + /** @overload + computes singular values of a matrix + @param src decomposed matrix + @param w calculated singular values + @param flags operation flags - see SVD::Flags. + */ + static void compute( InputArray src, OutputArray w, int flags = 0 ); + + /** @brief performs back substitution + */ + static void backSubst( InputArray w, InputArray u, + InputArray vt, InputArray rhs, + OutputArray dst ); + + /** @brief solves an under-determined singular linear system + + The method finds a unit-length solution x of a singular linear system + A\*x = 0. Depending on the rank of A, there can be no solutions, a + single solution or an infinite number of solutions. In general, the + algorithm solves the following problem: + \f[dst = \arg \min _{x: \| x \| =1} \| src \cdot x \|\f] + @param src left-hand-side matrix. + @param dst found solution. + */ + static void solveZ( InputArray src, OutputArray dst ); + + /** @brief performs a singular value back substitution. + + The method calculates a back substitution for the specified right-hand + side: + + \f[\texttt{x} = \texttt{vt} ^T \cdot diag( \texttt{w} )^{-1} \cdot \texttt{u} ^T \cdot \texttt{rhs} \sim \texttt{A} ^{-1} \cdot \texttt{rhs}\f] + + Using this technique you can either get a very accurate solution of the + convenient linear system, or the best (in the least-squares terms) + pseudo-solution of an overdetermined linear system. + + @param rhs right-hand side of a linear system (u\*w\*v')\*dst = rhs to + be solved, where A has been previously decomposed. + + @param dst found solution of the system. + + @note Explicit SVD with the further back substitution only makes sense + if you need to solve many linear systems with the same left-hand side + (for example, src ). If all you need is to solve a single system + (possibly with multiple rhs immediately available), simply call solve + add pass DECOMP_SVD there. It does absolutely the same thing. + */ + void backSubst( InputArray rhs, OutputArray dst ) const; + + /** @todo document */ + template static + void compute( const Matx<_Tp, m, n>& a, Matx<_Tp, nm, 1>& w, Matx<_Tp, m, nm>& u, Matx<_Tp, n, nm>& vt ); + + /** @todo document */ + template static + void compute( const Matx<_Tp, m, n>& a, Matx<_Tp, nm, 1>& w ); + + /** @todo document */ + template static + void backSubst( const Matx<_Tp, nm, 1>& w, const Matx<_Tp, m, nm>& u, const Matx<_Tp, n, nm>& vt, const Matx<_Tp, m, nb>& rhs, Matx<_Tp, n, nb>& dst ); + + Mat u, w, vt; +}; + +/** @brief Random Number Generator + +Random number generator. It encapsulates the state (currently, a 64-bit +integer) and has methods to return scalar random values and to fill +arrays with random values. Currently it supports uniform and Gaussian +(normal) distributions. The generator uses Multiply-With-Carry +algorithm, introduced by G. Marsaglia ( + ). +Gaussian-distribution random numbers are generated using the Ziggurat +algorithm ( ), +introduced by G. Marsaglia and W. W. Tsang. +*/ +class CV_EXPORTS RNG +{ +public: + enum { UNIFORM = 0, + NORMAL = 1 + }; + + /** @brief constructor + + These are the RNG constructors. The first form sets the state to some + pre-defined value, equal to 2\*\*32-1 in the current implementation. The + second form sets the state to the specified value. If you passed state=0 + , the constructor uses the above default value instead to avoid the + singular random number sequence, consisting of all zeros. + */ + RNG(); + /** @overload + @param state 64-bit value used to initialize the RNG. + */ + RNG(uint64 state); + /**The method updates the state using the MWC algorithm and returns the + next 32-bit random number.*/ + unsigned next(); + + /**Each of the methods updates the state using the MWC algorithm and + returns the next random number of the specified type. In case of integer + types, the returned number is from the available value range for the + specified type. In case of floating-point types, the returned value is + from [0,1) range. + */ + operator uchar(); + /** @overload */ + operator schar(); + /** @overload */ + operator ushort(); + /** @overload */ + operator short(); + /** @overload */ + operator unsigned(); + /** @overload */ + operator int(); + /** @overload */ + operator float(); + /** @overload */ + operator double(); + + /** @brief returns a random integer sampled uniformly from [0, N). + + The methods transform the state using the MWC algorithm and return the + next random number. The first form is equivalent to RNG::next . The + second form returns the random number modulo N , which means that the + result is in the range [0, N) . + */ + unsigned operator ()(); + /** @overload + @param N upper non-inclusive boundary of the returned random number. + */ + unsigned operator ()(unsigned N); + + /** @brief returns uniformly distributed integer random number from [a,b) range + + The methods transform the state using the MWC algorithm and return the + next uniformly-distributed random number of the specified type, deduced + from the input parameter type, from the range [a, b) . There is a nuance + illustrated by the following sample: + + @code{.cpp} + RNG rng; + + // always produces 0 + double a = rng.uniform(0, 1); + + // produces double from [0, 1) + double a1 = rng.uniform((double)0, (double)1); + + // produces float from [0, 1) + double b = rng.uniform(0.f, 1.f); + + // produces double from [0, 1) + double c = rng.uniform(0., 1.); + + // may cause compiler error because of ambiguity: + // RNG::uniform(0, (int)0.999999)? or RNG::uniform((double)0, 0.99999)? + double d = rng.uniform(0, 0.999999); + @endcode + + The compiler does not take into account the type of the variable to + which you assign the result of RNG::uniform . The only thing that + matters to the compiler is the type of a and b parameters. So, if you + want a floating-point random number, but the range boundaries are + integer numbers, either put dots in the end, if they are constants, or + use explicit type cast operators, as in the a1 initialization above. + @param a lower inclusive boundary of the returned random numbers. + @param b upper non-inclusive boundary of the returned random numbers. + */ + int uniform(int a, int b); + /** @overload */ + float uniform(float a, float b); + /** @overload */ + double uniform(double a, double b); + + /** @brief Fills arrays with random numbers. + + @param mat 2D or N-dimensional matrix; currently matrices with more than + 4 channels are not supported by the methods, use Mat::reshape as a + possible workaround. + @param distType distribution type, RNG::UNIFORM or RNG::NORMAL. + @param a first distribution parameter; in case of the uniform + distribution, this is an inclusive lower boundary, in case of the normal + distribution, this is a mean value. + @param b second distribution parameter; in case of the uniform + distribution, this is a non-inclusive upper boundary, in case of the + normal distribution, this is a standard deviation (diagonal of the + standard deviation matrix or the full standard deviation matrix). + @param saturateRange pre-saturation flag; for uniform distribution only; + if true, the method will first convert a and b to the acceptable value + range (according to the mat datatype) and then will generate uniformly + distributed random numbers within the range [saturate(a), saturate(b)), + if saturateRange=false, the method will generate uniformly distributed + random numbers in the original range [a, b) and then will saturate them, + it means, for example, that + theRNG().fill(mat_8u, RNG::UNIFORM, -DBL_MAX, DBL_MAX) will likely + produce array mostly filled with 0's and 255's, since the range (0, 255) + is significantly smaller than [-DBL_MAX, DBL_MAX). + + Each of the methods fills the matrix with the random values from the + specified distribution. As the new numbers are generated, the RNG state + is updated accordingly. In case of multiple-channel images, every + channel is filled independently, which means that RNG cannot generate + samples from the multi-dimensional Gaussian distribution with + non-diagonal covariance matrix directly. To do that, the method + generates samples from multi-dimensional standard Gaussian distribution + with zero mean and identity covariation matrix, and then transforms them + using transform to get samples from the specified Gaussian distribution. + */ + void fill( InputOutputArray mat, int distType, InputArray a, InputArray b, bool saturateRange = false ); + + /** @brief Returns the next random number sampled from the Gaussian distribution + @param sigma standard deviation of the distribution. + + The method transforms the state using the MWC algorithm and returns the + next random number from the Gaussian distribution N(0,sigma) . That is, + the mean value of the returned random numbers is zero and the standard + deviation is the specified sigma . + */ + double gaussian(double sigma); + + uint64 state; +}; + +/** @brief Mersenne Twister random number generator + +Inspired by http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c +@todo document + */ +class CV_EXPORTS RNG_MT19937 +{ +public: + RNG_MT19937(); + RNG_MT19937(unsigned s); + void seed(unsigned s); + + unsigned next(); + + operator int(); + operator unsigned(); + operator float(); + operator double(); + + unsigned operator ()(unsigned N); + unsigned operator ()(); + + /** @brief returns uniformly distributed integer random number from [a,b) range + +*/ + int uniform(int a, int b); + /** @brief returns uniformly distributed floating-point random number from [a,b) range + +*/ + float uniform(float a, float b); + /** @brief returns uniformly distributed double-precision floating-point random number from [a,b) range + +*/ + double uniform(double a, double b); + +private: + enum PeriodParameters {N = 624, M = 397}; + unsigned state[N]; + int mti; +}; + +//! @} core_array + +//! @addtogroup core_cluster +//! @{ + +/** @example kmeans.cpp + An example on K-means clustering +*/ + +/** @brief Finds centers of clusters and groups input samples around the clusters. + +The function kmeans implements a k-means algorithm that finds the centers of cluster_count clusters +and groups the input samples around the clusters. As an output, \f$\texttt{labels}_i\f$ contains a +0-based cluster index for the sample stored in the \f$i^{th}\f$ row of the samples matrix. + +@note +- (Python) An example on K-means clustering can be found at + opencv_source_code/samples/python/kmeans.py +@param data Data for clustering. An array of N-Dimensional points with float coordinates is needed. +Examples of this array can be: +- Mat points(count, 2, CV_32F); +- Mat points(count, 1, CV_32FC2); +- Mat points(1, count, CV_32FC2); +- std::vector\ points(sampleCount); +@param K Number of clusters to split the set by. +@param bestLabels Input/output integer array that stores the cluster indices for every sample. +@param criteria The algorithm termination criteria, that is, the maximum number of iterations and/or +the desired accuracy. The accuracy is specified as criteria.epsilon. As soon as each of the cluster +centers moves by less than criteria.epsilon on some iteration, the algorithm stops. +@param attempts Flag to specify the number of times the algorithm is executed using different +initial labellings. The algorithm returns the labels that yield the best compactness (see the last +function parameter). +@param flags Flag that can take values of cv::KmeansFlags +@param centers Output matrix of the cluster centers, one row per each cluster center. +@return The function returns the compactness measure that is computed as +\f[\sum _i \| \texttt{samples} _i - \texttt{centers} _{ \texttt{labels} _i} \| ^2\f] +after every attempt. The best (minimum) value is chosen and the corresponding labels and the +compactness value are returned by the function. Basically, you can use only the core of the +function, set the number of attempts to 1, initialize labels each time using a custom algorithm, +pass them with the ( flags = KMEANS_USE_INITIAL_LABELS ) flag, and then choose the best +(most-compact) clustering. +*/ +CV_EXPORTS_W double kmeans( InputArray data, int K, InputOutputArray bestLabels, + TermCriteria criteria, int attempts, + int flags, OutputArray centers = noArray() ); + +//! @} core_cluster + +//! @addtogroup core_basic +//! @{ + +/////////////////////////////// Formatted output of cv::Mat /////////////////////////// + +/** @todo document */ +class CV_EXPORTS Formatted +{ +public: + virtual const char* next() = 0; + virtual void reset() = 0; + virtual ~Formatted(); +}; + +/** @todo document */ +class CV_EXPORTS Formatter +{ +public: + enum { FMT_DEFAULT = 0, + FMT_MATLAB = 1, + FMT_CSV = 2, + FMT_PYTHON = 3, + FMT_NUMPY = 4, + FMT_C = 5 + }; + + virtual ~Formatter(); + + virtual Ptr format(const Mat& mtx) const = 0; + + virtual void set32fPrecision(int p = 8) = 0; + virtual void set64fPrecision(int p = 16) = 0; + virtual void setMultiline(bool ml = true) = 0; + + static Ptr get(int fmt = FMT_DEFAULT); + +}; + +static inline +String& operator << (String& out, Ptr fmtd) +{ + fmtd->reset(); + for(const char* str = fmtd->next(); str; str = fmtd->next()) + out += cv::String(str); + return out; +} + +static inline +String& operator << (String& out, const Mat& mtx) +{ + return out << Formatter::get()->format(mtx); +} + +//////////////////////////////////////// Algorithm //////////////////////////////////// + +class CV_EXPORTS Algorithm; + +template struct ParamType {}; + + +/** @brief This is a base class for all more or less complex algorithms in OpenCV + +especially for classes of algorithms, for which there can be multiple implementations. The examples +are stereo correspondence (for which there are algorithms like block matching, semi-global block +matching, graph-cut etc.), background subtraction (which can be done using mixture-of-gaussians +models, codebook-based algorithm etc.), optical flow (block matching, Lucas-Kanade, Horn-Schunck +etc.). + +Here is example of SIFT use in your application via Algorithm interface: +@code + #include "opencv2/opencv.hpp" + #include "opencv2/xfeatures2d.hpp" + using namespace cv::xfeatures2d; + + Ptr sift = SIFT::create(); + FileStorage fs("sift_params.xml", FileStorage::READ); + if( fs.isOpened() ) // if we have file with parameters, read them + { + sift->read(fs["sift_params"]); + fs.release(); + } + else // else modify the parameters and store them; user can later edit the file to use different parameters + { + sift->setContrastThreshold(0.01f); // lower the contrast threshold, compared to the default value + { + WriteStructContext ws(fs, "sift_params", CV_NODE_MAP); + sift->write(fs); + } + } + Mat image = imread("myimage.png", 0), descriptors; + vector keypoints; + sift->detectAndCompute(image, noArray(), keypoints, descriptors); +@endcode + */ +class CV_EXPORTS_W Algorithm +{ +public: + Algorithm(); + virtual ~Algorithm(); + + /** @brief Clears the algorithm state + */ + CV_WRAP virtual void clear() {} + + /** @brief Stores algorithm parameters in a file storage + */ + virtual void write(FileStorage& fs) const { (void)fs; } + + /** @brief Reads algorithm parameters from a file storage + */ + virtual void read(const FileNode& fn) { (void)fn; } + + /** @brief Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read + */ + virtual bool empty() const { return false; } + + /** @brief Reads algorithm from the file node + + This is static template method of Algorithm. It's usage is following (in the case of SVM): + @code + Ptr svm = Algorithm::read(fn); + @endcode + In order to make this method work, the derived class must overwrite Algorithm::read(const + FileNode& fn) and also have static create() method without parameters + (or with all the optional parameters) + */ + template static Ptr<_Tp> read(const FileNode& fn) + { + Ptr<_Tp> obj = _Tp::create(); + obj->read(fn); + return !obj->empty() ? obj : Ptr<_Tp>(); + } + + /** @brief Loads algorithm from the file + + @param filename Name of the file to read. + @param objname The optional name of the node to read (if empty, the first top-level node will be used) + + This is static template method of Algorithm. It's usage is following (in the case of SVM): + @code + Ptr svm = Algorithm::load("my_svm_model.xml"); + @endcode + In order to make this method work, the derived class must overwrite Algorithm::read(const + FileNode& fn). + */ + template static Ptr<_Tp> load(const String& filename, const String& objname=String()) + { + FileStorage fs(filename, FileStorage::READ); + FileNode fn = objname.empty() ? fs.getFirstTopLevelNode() : fs[objname]; + Ptr<_Tp> obj = _Tp::create(); + obj->read(fn); + return !obj->empty() ? obj : Ptr<_Tp>(); + } + + /** @brief Loads algorithm from a String + + @param strModel The string variable containing the model you want to load. + @param objname The optional name of the node to read (if empty, the first top-level node will be used) + + This is static template method of Algorithm. It's usage is following (in the case of SVM): + @code + Ptr svm = Algorithm::loadFromString(myStringModel); + @endcode + */ + template static Ptr<_Tp> loadFromString(const String& strModel, const String& objname=String()) + { + FileStorage fs(strModel, FileStorage::READ + FileStorage::MEMORY); + FileNode fn = objname.empty() ? fs.getFirstTopLevelNode() : fs[objname]; + Ptr<_Tp> obj = _Tp::create(); + obj->read(fn); + return !obj->empty() ? obj : Ptr<_Tp>(); + } + + /** Saves the algorithm to a file. + In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs). */ + CV_WRAP virtual void save(const String& filename) const; + + /** Returns the algorithm string identifier. + This string is used as top level xml/yml node tag when the object is saved to a file or string. */ + CV_WRAP virtual String getDefaultName() const; +}; + +struct Param { + enum { INT=0, BOOLEAN=1, REAL=2, STRING=3, MAT=4, MAT_VECTOR=5, ALGORITHM=6, FLOAT=7, + UNSIGNED_INT=8, UINT64=9, UCHAR=11 }; +}; + + + +template<> struct ParamType +{ + typedef bool const_param_type; + typedef bool member_type; + + enum { type = Param::BOOLEAN }; +}; + +template<> struct ParamType +{ + typedef int const_param_type; + typedef int member_type; + + enum { type = Param::INT }; +}; + +template<> struct ParamType +{ + typedef double const_param_type; + typedef double member_type; + + enum { type = Param::REAL }; +}; + +template<> struct ParamType +{ + typedef const String& const_param_type; + typedef String member_type; + + enum { type = Param::STRING }; +}; + +template<> struct ParamType +{ + typedef const Mat& const_param_type; + typedef Mat member_type; + + enum { type = Param::MAT }; +}; + +template<> struct ParamType > +{ + typedef const std::vector& const_param_type; + typedef std::vector member_type; + + enum { type = Param::MAT_VECTOR }; +}; + +template<> struct ParamType +{ + typedef const Ptr& const_param_type; + typedef Ptr member_type; + + enum { type = Param::ALGORITHM }; +}; + +template<> struct ParamType +{ + typedef float const_param_type; + typedef float member_type; + + enum { type = Param::FLOAT }; +}; + +template<> struct ParamType +{ + typedef unsigned const_param_type; + typedef unsigned member_type; + + enum { type = Param::UNSIGNED_INT }; +}; + +template<> struct ParamType +{ + typedef uint64 const_param_type; + typedef uint64 member_type; + + enum { type = Param::UINT64 }; +}; + +template<> struct ParamType +{ + typedef uchar const_param_type; + typedef uchar member_type; + + enum { type = Param::UCHAR }; +}; + +//! @} core_basic + +} //namespace cv + +#include "opencv2/core/operations.hpp" +#include "opencv2/core/cvstd.inl.hpp" +#include "opencv2/core/utility.hpp" +#include "opencv2/core/optim.hpp" + +#endif /*__OPENCV_CORE_HPP__*/ diff --git a/lib/opencv/include/opencv2/core/affine.hpp b/lib/opencv/include/opencv2/core/affine.hpp new file mode 100644 index 000000000..2bce5b989 --- /dev/null +++ b/lib/opencv/include/opencv2/core/affine.hpp @@ -0,0 +1,522 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_AFFINE3_HPP__ +#define __OPENCV_CORE_AFFINE3_HPP__ + +#ifdef __cplusplus + +#include + +namespace cv +{ + +//! @addtogroup core +//! @{ + + /** @brief Affine transform + @todo document + */ + template + class Affine3 + { + public: + typedef T float_type; + typedef Matx Mat3; + typedef Matx Mat4; + typedef Vec Vec3; + + Affine3(); + + //! Augmented affine matrix + Affine3(const Mat4& affine); + + //! Rotation matrix + Affine3(const Mat3& R, const Vec3& t = Vec3::all(0)); + + //! Rodrigues vector + Affine3(const Vec3& rvec, const Vec3& t = Vec3::all(0)); + + //! Combines all contructors above. Supports 4x4, 4x3, 3x3, 1x3, 3x1 sizes of data matrix + explicit Affine3(const Mat& data, const Vec3& t = Vec3::all(0)); + + //! From 16th element array + explicit Affine3(const float_type* vals); + + //! Create identity transform + static Affine3 Identity(); + + //! Rotation matrix + void rotation(const Mat3& R); + + //! Rodrigues vector + void rotation(const Vec3& rvec); + + //! Combines rotation methods above. Suports 3x3, 1x3, 3x1 sizes of data matrix; + void rotation(const Mat& data); + + void linear(const Mat3& L); + void translation(const Vec3& t); + + Mat3 rotation() const; + Mat3 linear() const; + Vec3 translation() const; + + //! Rodrigues vector + Vec3 rvec() const; + + Affine3 inv(int method = cv::DECOMP_SVD) const; + + //! a.rotate(R) is equivalent to Affine(R, 0) * a; + Affine3 rotate(const Mat3& R) const; + + //! a.rotate(rvec) is equivalent to Affine(rvec, 0) * a; + Affine3 rotate(const Vec3& rvec) const; + + //! a.translate(t) is equivalent to Affine(E, t) * a; + Affine3 translate(const Vec3& t) const; + + //! a.concatenate(affine) is equivalent to affine * a; + Affine3 concatenate(const Affine3& affine) const; + + template operator Affine3() const; + + template Affine3 cast() const; + + Mat4 matrix; + +#if defined EIGEN_WORLD_VERSION && defined EIGEN_GEOMETRY_MODULE_H + Affine3(const Eigen::Transform& affine); + Affine3(const Eigen::Transform& affine); + operator Eigen::Transform() const; + operator Eigen::Transform() const; +#endif + }; + + template static + Affine3 operator*(const Affine3& affine1, const Affine3& affine2); + + template static + V operator*(const Affine3& affine, const V& vector); + + typedef Affine3 Affine3f; + typedef Affine3 Affine3d; + + static Vec3f operator*(const Affine3f& affine, const Vec3f& vector); + static Vec3d operator*(const Affine3d& affine, const Vec3d& vector); + + template class DataType< Affine3<_Tp> > + { + public: + typedef Affine3<_Tp> value_type; + typedef Affine3::work_type> work_type; + typedef _Tp channel_type; + + enum { generic_type = 0, + depth = DataType::depth, + channels = 16, + fmt = DataType::fmt + ((channels - 1) << 8), + type = CV_MAKETYPE(depth, channels) + }; + + typedef Vec vec_type; + }; + +//! @} core + +} + +//! @cond IGNORED + +/////////////////////////////////////////////////////////////////////////////////// +// Implementaiton + +template inline +cv::Affine3::Affine3() + : matrix(Mat4::eye()) +{} + +template inline +cv::Affine3::Affine3(const Mat4& affine) + : matrix(affine) +{} + +template inline +cv::Affine3::Affine3(const Mat3& R, const Vec3& t) +{ + rotation(R); + translation(t); + matrix.val[12] = matrix.val[13] = matrix.val[14] = 0; + matrix.val[15] = 1; +} + +template inline +cv::Affine3::Affine3(const Vec3& _rvec, const Vec3& t) +{ + rotation(_rvec); + translation(t); + matrix.val[12] = matrix.val[13] = matrix.val[14] = 0; + matrix.val[15] = 1; +} + +template inline +cv::Affine3::Affine3(const cv::Mat& data, const Vec3& t) +{ + CV_Assert(data.type() == cv::DataType::type); + + if (data.cols == 4 && data.rows == 4) + { + data.copyTo(matrix); + return; + } + else if (data.cols == 4 && data.rows == 3) + { + rotation(data(Rect(0, 0, 3, 3))); + translation(data(Rect(3, 0, 1, 3))); + return; + } + + rotation(data); + translation(t); + matrix.val[12] = matrix.val[13] = matrix.val[14] = 0; + matrix.val[15] = 1; +} + +template inline +cv::Affine3::Affine3(const float_type* vals) : matrix(vals) +{} + +template inline +cv::Affine3 cv::Affine3::Identity() +{ + return Affine3(cv::Affine3::Mat4::eye()); +} + +template inline +void cv::Affine3::rotation(const Mat3& R) +{ + linear(R); +} + +template inline +void cv::Affine3::rotation(const Vec3& _rvec) +{ + double rx = _rvec[0], ry = _rvec[1], rz = _rvec[2]; + double theta = std::sqrt(rx*rx + ry*ry + rz*rz); + + if (theta < DBL_EPSILON) + rotation(Mat3::eye()); + else + { + const double I[] = { 1, 0, 0, 0, 1, 0, 0, 0, 1 }; + + double c = std::cos(theta); + double s = std::sin(theta); + double c1 = 1. - c; + double itheta = (theta != 0) ? 1./theta : 0.; + + rx *= itheta; ry *= itheta; rz *= itheta; + + double rrt[] = { rx*rx, rx*ry, rx*rz, rx*ry, ry*ry, ry*rz, rx*rz, ry*rz, rz*rz }; + double _r_x_[] = { 0, -rz, ry, rz, 0, -rx, -ry, rx, 0 }; + Mat3 R; + + // R = cos(theta)*I + (1 - cos(theta))*r*rT + sin(theta)*[r_x] + // where [r_x] is [0 -rz ry; rz 0 -rx; -ry rx 0] + for(int k = 0; k < 9; ++k) + R.val[k] = static_cast(c*I[k] + c1*rrt[k] + s*_r_x_[k]); + + rotation(R); + } +} + +//Combines rotation methods above. Suports 3x3, 1x3, 3x1 sizes of data matrix; +template inline +void cv::Affine3::rotation(const cv::Mat& data) +{ + CV_Assert(data.type() == cv::DataType::type); + + if (data.cols == 3 && data.rows == 3) + { + Mat3 R; + data.copyTo(R); + rotation(R); + } + else if ((data.cols == 3 && data.rows == 1) || (data.cols == 1 && data.rows == 3)) + { + Vec3 _rvec; + data.reshape(1, 3).copyTo(_rvec); + rotation(_rvec); + } + else + CV_Assert(!"Input marix can be 3x3, 1x3 or 3x1"); +} + +template inline +void cv::Affine3::linear(const Mat3& L) +{ + matrix.val[0] = L.val[0]; matrix.val[1] = L.val[1]; matrix.val[ 2] = L.val[2]; + matrix.val[4] = L.val[3]; matrix.val[5] = L.val[4]; matrix.val[ 6] = L.val[5]; + matrix.val[8] = L.val[6]; matrix.val[9] = L.val[7]; matrix.val[10] = L.val[8]; +} + +template inline +void cv::Affine3::translation(const Vec3& t) +{ + matrix.val[3] = t[0]; matrix.val[7] = t[1]; matrix.val[11] = t[2]; +} + +template inline +typename cv::Affine3::Mat3 cv::Affine3::rotation() const +{ + return linear(); +} + +template inline +typename cv::Affine3::Mat3 cv::Affine3::linear() const +{ + typename cv::Affine3::Mat3 R; + R.val[0] = matrix.val[0]; R.val[1] = matrix.val[1]; R.val[2] = matrix.val[ 2]; + R.val[3] = matrix.val[4]; R.val[4] = matrix.val[5]; R.val[5] = matrix.val[ 6]; + R.val[6] = matrix.val[8]; R.val[7] = matrix.val[9]; R.val[8] = matrix.val[10]; + return R; +} + +template inline +typename cv::Affine3::Vec3 cv::Affine3::translation() const +{ + return Vec3(matrix.val[3], matrix.val[7], matrix.val[11]); +} + +template inline +typename cv::Affine3::Vec3 cv::Affine3::rvec() const +{ + cv::Vec3d w; + cv::Matx33d u, vt, R = rotation(); + cv::SVD::compute(R, w, u, vt, cv::SVD::FULL_UV + cv::SVD::MODIFY_A); + R = u * vt; + + double rx = R.val[7] - R.val[5]; + double ry = R.val[2] - R.val[6]; + double rz = R.val[3] - R.val[1]; + + double s = std::sqrt((rx*rx + ry*ry + rz*rz)*0.25); + double c = (R.val[0] + R.val[4] + R.val[8] - 1) * 0.5; + c = c > 1.0 ? 1.0 : c < -1.0 ? -1.0 : c; + double theta = acos(c); + + if( s < 1e-5 ) + { + if( c > 0 ) + rx = ry = rz = 0; + else + { + double t; + t = (R.val[0] + 1) * 0.5; + rx = std::sqrt(std::max(t, 0.0)); + t = (R.val[4] + 1) * 0.5; + ry = std::sqrt(std::max(t, 0.0)) * (R.val[1] < 0 ? -1.0 : 1.0); + t = (R.val[8] + 1) * 0.5; + rz = std::sqrt(std::max(t, 0.0)) * (R.val[2] < 0 ? -1.0 : 1.0); + + if( fabs(rx) < fabs(ry) && fabs(rx) < fabs(rz) && (R.val[5] > 0) != (ry*rz > 0) ) + rz = -rz; + theta /= std::sqrt(rx*rx + ry*ry + rz*rz); + rx *= theta; + ry *= theta; + rz *= theta; + } + } + else + { + double vth = 1/(2*s); + vth *= theta; + rx *= vth; ry *= vth; rz *= vth; + } + + return cv::Vec3d(rx, ry, rz); +} + +template inline +cv::Affine3 cv::Affine3::inv(int method) const +{ + return matrix.inv(method); +} + +template inline +cv::Affine3 cv::Affine3::rotate(const Mat3& R) const +{ + Mat3 Lc = linear(); + Vec3 tc = translation(); + Mat4 result; + result.val[12] = result.val[13] = result.val[14] = 0; + result.val[15] = 1; + + for(int j = 0; j < 3; ++j) + { + for(int i = 0; i < 3; ++i) + { + float_type value = 0; + for(int k = 0; k < 3; ++k) + value += R(j, k) * Lc(k, i); + result(j, i) = value; + } + + result(j, 3) = R.row(j).dot(tc.t()); + } + return result; +} + +template inline +cv::Affine3 cv::Affine3::rotate(const Vec3& _rvec) const +{ + return rotate(Affine3f(_rvec).rotation()); +} + +template inline +cv::Affine3 cv::Affine3::translate(const Vec3& t) const +{ + Mat4 m = matrix; + m.val[ 3] += t[0]; + m.val[ 7] += t[1]; + m.val[11] += t[2]; + return m; +} + +template inline +cv::Affine3 cv::Affine3::concatenate(const Affine3& affine) const +{ + return (*this).rotate(affine.rotation()).translate(affine.translation()); +} + +template template inline +cv::Affine3::operator Affine3() const +{ + return Affine3(matrix); +} + +template template inline +cv::Affine3 cv::Affine3::cast() const +{ + return Affine3(matrix); +} + +template inline +cv::Affine3 cv::operator*(const cv::Affine3& affine1, const cv::Affine3& affine2) +{ + return affine2.concatenate(affine1); +} + +template inline +V cv::operator*(const cv::Affine3& affine, const V& v) +{ + const typename Affine3::Mat4& m = affine.matrix; + + V r; + r.x = m.val[0] * v.x + m.val[1] * v.y + m.val[ 2] * v.z + m.val[ 3]; + r.y = m.val[4] * v.x + m.val[5] * v.y + m.val[ 6] * v.z + m.val[ 7]; + r.z = m.val[8] * v.x + m.val[9] * v.y + m.val[10] * v.z + m.val[11]; + return r; +} + +static inline +cv::Vec3f cv::operator*(const cv::Affine3f& affine, const cv::Vec3f& v) +{ + const cv::Matx44f& m = affine.matrix; + cv::Vec3f r; + r.val[0] = m.val[0] * v[0] + m.val[1] * v[1] + m.val[ 2] * v[2] + m.val[ 3]; + r.val[1] = m.val[4] * v[0] + m.val[5] * v[1] + m.val[ 6] * v[2] + m.val[ 7]; + r.val[2] = m.val[8] * v[0] + m.val[9] * v[1] + m.val[10] * v[2] + m.val[11]; + return r; +} + +static inline +cv::Vec3d cv::operator*(const cv::Affine3d& affine, const cv::Vec3d& v) +{ + const cv::Matx44d& m = affine.matrix; + cv::Vec3d r; + r.val[0] = m.val[0] * v[0] + m.val[1] * v[1] + m.val[ 2] * v[2] + m.val[ 3]; + r.val[1] = m.val[4] * v[0] + m.val[5] * v[1] + m.val[ 6] * v[2] + m.val[ 7]; + r.val[2] = m.val[8] * v[0] + m.val[9] * v[1] + m.val[10] * v[2] + m.val[11]; + return r; +} + + + +#if defined EIGEN_WORLD_VERSION && defined EIGEN_GEOMETRY_MODULE_H + +template inline +cv::Affine3::Affine3(const Eigen::Transform& affine) +{ + cv::Mat(4, 4, cv::DataType::type, affine.matrix().data()).copyTo(matrix); +} + +template inline +cv::Affine3::Affine3(const Eigen::Transform& affine) +{ + Eigen::Transform a = affine; + cv::Mat(4, 4, cv::DataType::type, a.matrix().data()).copyTo(matrix); +} + +template inline +cv::Affine3::operator Eigen::Transform() const +{ + Eigen::Transform r; + cv::Mat hdr(4, 4, cv::DataType::type, r.matrix().data()); + cv::Mat(matrix, false).copyTo(hdr); + return r; +} + +template inline +cv::Affine3::operator Eigen::Transform() const +{ + return this->operator Eigen::Transform(); +} + +#endif /* defined EIGEN_WORLD_VERSION && defined EIGEN_GEOMETRY_MODULE_H */ + +//! @endcond + +#endif /* __cplusplus */ + +#endif /* __OPENCV_CORE_AFFINE3_HPP__ */ diff --git a/lib/opencv/include/opencv2/core/base.hpp b/lib/opencv/include/opencv2/core/base.hpp new file mode 100644 index 000000000..ed633f5dc --- /dev/null +++ b/lib/opencv/include/opencv2/core/base.hpp @@ -0,0 +1,689 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Copyright (C) 2014, 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_BASE_HPP__ +#define __OPENCV_CORE_BASE_HPP__ + +#ifndef __cplusplus +# error base.hpp header must be compiled as C++ +#endif + +#include +#include + +#include "opencv2/core/cvdef.h" +#include "opencv2/core/cvstd.hpp" + +namespace cv +{ + +//! @addtogroup core_utils +//! @{ + +namespace Error { +//! error codes +enum Code { + StsOk= 0, //!< everithing is ok + StsBackTrace= -1, //!< pseudo error for back trace + StsError= -2, //!< unknown /unspecified error + StsInternal= -3, //!< internal error (bad state) + StsNoMem= -4, //!< insufficient memory + StsBadArg= -5, //!< function arg/param is bad + StsBadFunc= -6, //!< unsupported function + StsNoConv= -7, //!< iter. didn't converge + StsAutoTrace= -8, //!< tracing + HeaderIsNull= -9, //!< image header is NULL + BadImageSize= -10, //!< image size is invalid + BadOffset= -11, //!< offset is invalid + BadDataPtr= -12, //!< + BadStep= -13, //!< + BadModelOrChSeq= -14, //!< + BadNumChannels= -15, //!< + BadNumChannel1U= -16, //!< + BadDepth= -17, //!< + BadAlphaChannel= -18, //!< + BadOrder= -19, //!< + BadOrigin= -20, //!< + BadAlign= -21, //!< + BadCallBack= -22, //!< + BadTileSize= -23, //!< + BadCOI= -24, //!< + BadROISize= -25, //!< + MaskIsTiled= -26, //!< + StsNullPtr= -27, //!< null pointer + StsVecLengthErr= -28, //!< incorrect vector length + StsFilterStructContentErr= -29, //!< incorr. filter structure content + StsKernelStructContentErr= -30, //!< incorr. transform kernel content + StsFilterOffsetErr= -31, //!< incorrect filter ofset value + StsBadSize= -201, //!< the input/output structure size is incorrect + StsDivByZero= -202, //!< division by zero + StsInplaceNotSupported= -203, //!< in-place operation is not supported + StsObjectNotFound= -204, //!< request can't be completed + StsUnmatchedFormats= -205, //!< formats of input/output arrays differ + StsBadFlag= -206, //!< flag is wrong or not supported + StsBadPoint= -207, //!< bad CvPoint + StsBadMask= -208, //!< bad format of mask (neither 8uC1 nor 8sC1) + StsUnmatchedSizes= -209, //!< sizes of input/output structures do not match + StsUnsupportedFormat= -210, //!< the data format/type is not supported by the function + StsOutOfRange= -211, //!< some of parameters are out of range + StsParseError= -212, //!< invalid syntax/structure of the parsed file + StsNotImplemented= -213, //!< the requested function/feature is not implemented + StsBadMemBlock= -214, //!< an allocated block has been corrupted + StsAssert= -215, //!< assertion failed + GpuNotSupported= -216, + GpuApiCallError= -217, + OpenGlNotSupported= -218, + OpenGlApiCallError= -219, + OpenCLApiCallError= -220, + OpenCLDoubleNotSupported= -221, + OpenCLInitError= -222, + OpenCLNoAMDBlasFft= -223 +}; +} //Error + +//! @} core_utils + +//! @addtogroup core_array +//! @{ + +//! matrix decomposition types +enum DecompTypes { + /** Gaussian elimination with the optimal pivot element chosen. */ + DECOMP_LU = 0, + /** singular value decomposition (SVD) method; the system can be over-defined and/or the matrix + src1 can be singular */ + DECOMP_SVD = 1, + /** eigenvalue decomposition; the matrix src1 must be symmetrical */ + DECOMP_EIG = 2, + /** Cholesky \f$LL^T\f$ factorization; the matrix src1 must be symmetrical and positively + defined */ + DECOMP_CHOLESKY = 3, + /** QR factorization; the system can be over-defined and/or the matrix src1 can be singular */ + DECOMP_QR = 4, + /** while all the previous flags are mutually exclusive, this flag can be used together with + any of the previous; it means that the normal equations + \f$\texttt{src1}^T\cdot\texttt{src1}\cdot\texttt{dst}=\texttt{src1}^T\texttt{src2}\f$ are + solved instead of the original system + \f$\texttt{src1}\cdot\texttt{dst}=\texttt{src2}\f$ */ + DECOMP_NORMAL = 16 +}; + +/** norm types +- For one array: +\f[norm = \forkthree{\|\texttt{src1}\|_{L_{\infty}} = \max _I | \texttt{src1} (I)|}{if \(\texttt{normType} = \texttt{NORM_INF}\) } +{ \| \texttt{src1} \| _{L_1} = \sum _I | \texttt{src1} (I)|}{if \(\texttt{normType} = \texttt{NORM_L1}\) } +{ \| \texttt{src1} \| _{L_2} = \sqrt{\sum_I \texttt{src1}(I)^2} }{if \(\texttt{normType} = \texttt{NORM_L2}\) }\f] + +- Absolute norm for two arrays +\f[norm = \forkthree{\|\texttt{src1}-\texttt{src2}\|_{L_{\infty}} = \max _I | \texttt{src1} (I) - \texttt{src2} (I)|}{if \(\texttt{normType} = \texttt{NORM_INF}\) } +{ \| \texttt{src1} - \texttt{src2} \| _{L_1} = \sum _I | \texttt{src1} (I) - \texttt{src2} (I)|}{if \(\texttt{normType} = \texttt{NORM_L1}\) } +{ \| \texttt{src1} - \texttt{src2} \| _{L_2} = \sqrt{\sum_I (\texttt{src1}(I) - \texttt{src2}(I))^2} }{if \(\texttt{normType} = \texttt{NORM_L2}\) }\f] + +- Relative norm for two arrays +\f[norm = \forkthree{\frac{\|\texttt{src1}-\texttt{src2}\|_{L_{\infty}} }{\|\texttt{src2}\|_{L_{\infty}} }}{if \(\texttt{normType} = \texttt{NORM_RELATIVE_INF}\) } +{ \frac{\|\texttt{src1}-\texttt{src2}\|_{L_1} }{\|\texttt{src2}\|_{L_1}} }{if \(\texttt{normType} = \texttt{NORM_RELATIVE_L1}\) } +{ \frac{\|\texttt{src1}-\texttt{src2}\|_{L_2} }{\|\texttt{src2}\|_{L_2}} }{if \(\texttt{normType} = \texttt{NORM_RELATIVE_L2}\) }\f] + +As example for one array consider the function \f$r(x)= \begin{pmatrix} x \\ 1-x \end{pmatrix}, x \in [-1;1]\f$. +The \f$ L_{1}, L_{2} \f$ and \f$ L_{\infty} \f$ norm for the sample value \f$r(-1) = \begin{pmatrix} -1 \\ 2 \end{pmatrix}\f$ +is calculated as follows +\f{align*} + \| r(-1) \|_{L_1} &= |-1| + |2| = 3 \\ + \| r(-1) \|_{L_2} &= \sqrt{(-1)^{2} + (2)^{2}} = \sqrt{5} \\ + \| r(-1) \|_{L_\infty} &= \max(|-1|,|2|) = 2 +\f} +and for \f$r(0.5) = \begin{pmatrix} 0.5 \\ 0.5 \end{pmatrix}\f$ the calculation is +\f{align*} + \| r(0.5) \|_{L_1} &= |0.5| + |0.5| = 1 \\ + \| r(0.5) \|_{L_2} &= \sqrt{(0.5)^{2} + (0.5)^{2}} = \sqrt{0.5} \\ + \| r(0.5) \|_{L_\infty} &= \max(|0.5|,|0.5|) = 0.5. +\f} +The following graphic shows all values for the three norm functions \f$\| r(x) \|_{L_1}, \| r(x) \|_{L_2}\f$ and \f$\| r(x) \|_{L_\infty}\f$. +It is notable that the \f$ L_{1} \f$ norm forms the upper and the \f$ L_{\infty} \f$ norm forms the lower border for the example function \f$ r(x) \f$. +![Graphs for the different norm functions from the above example](pics/NormTypes_OneArray_1-2-INF.png) + */ +enum NormTypes { NORM_INF = 1, + NORM_L1 = 2, + NORM_L2 = 4, + NORM_L2SQR = 5, + NORM_HAMMING = 6, + NORM_HAMMING2 = 7, + NORM_TYPE_MASK = 7, + NORM_RELATIVE = 8, //!< flag + NORM_MINMAX = 32 //!< flag + }; + +//! comparison types +enum CmpTypes { CMP_EQ = 0, //!< src1 is equal to src2. + CMP_GT = 1, //!< src1 is greater than src2. + CMP_GE = 2, //!< src1 is greater than or equal to src2. + CMP_LT = 3, //!< src1 is less than src2. + CMP_LE = 4, //!< src1 is less than or equal to src2. + CMP_NE = 5 //!< src1 is unequal to src2. + }; + +//! generalized matrix multiplication flags +enum GemmFlags { GEMM_1_T = 1, //!< transposes src1 + GEMM_2_T = 2, //!< transposes src2 + GEMM_3_T = 4 //!< transposes src3 + }; + +enum DftFlags { + /** performs an inverse 1D or 2D transform instead of the default forward + transform. */ + DFT_INVERSE = 1, + /** scales the result: divide it by the number of array elements. Normally, it is + combined with DFT_INVERSE. */ + DFT_SCALE = 2, + /** performs a forward or inverse transform of every individual row of the input + matrix; this flag enables you to transform multiple vectors simultaneously and can be used to + decrease the overhead (which is sometimes several times larger than the processing itself) to + perform 3D and higher-dimensional transformations and so forth.*/ + DFT_ROWS = 4, + /** performs a forward transformation of 1D or 2D real array; the result, + though being a complex array, has complex-conjugate symmetry (*CCS*, see the function + description below for details), and such an array can be packed into a real array of the same + size as input, which is the fastest option and which is what the function does by default; + however, you may wish to get a full complex array (for simpler spectrum analysis, and so on) - + pass the flag to enable the function to produce a full-size complex output array. */ + DFT_COMPLEX_OUTPUT = 16, + /** performs an inverse transformation of a 1D or 2D complex array; the + result is normally a complex array of the same size, however, if the input array has + conjugate-complex symmetry (for example, it is a result of forward transformation with + DFT_COMPLEX_OUTPUT flag), the output is a real array; while the function itself does not + check whether the input is symmetrical or not, you can pass the flag and then the function + will assume the symmetry and produce the real output array (note that when the input is packed + into a real array and inverse transformation is executed, the function treats the input as a + packed complex-conjugate symmetrical array, and the output will also be a real array). */ + DFT_REAL_OUTPUT = 32, + /** performs an inverse 1D or 2D transform instead of the default forward transform. */ + DCT_INVERSE = DFT_INVERSE, + /** performs a forward or inverse transform of every individual row of the input + matrix. This flag enables you to transform multiple vectors simultaneously and can be used to + decrease the overhead (which is sometimes several times larger than the processing itself) to + perform 3D and higher-dimensional transforms and so forth.*/ + DCT_ROWS = DFT_ROWS +}; + +//! Various border types, image boundaries are denoted with `|` +//! @see borderInterpolate, copyMakeBorder +enum BorderTypes { + BORDER_CONSTANT = 0, //!< `iiiiii|abcdefgh|iiiiiii` with some specified `i` + BORDER_REPLICATE = 1, //!< `aaaaaa|abcdefgh|hhhhhhh` + BORDER_REFLECT = 2, //!< `fedcba|abcdefgh|hgfedcb` + BORDER_WRAP = 3, //!< `cdefgh|abcdefgh|abcdefg` + BORDER_REFLECT_101 = 4, //!< `gfedcb|abcdefgh|gfedcba` + BORDER_TRANSPARENT = 5, //!< `uvwxyz|absdefgh|ijklmno` + + BORDER_REFLECT101 = BORDER_REFLECT_101, //!< same as BORDER_REFLECT_101 + BORDER_DEFAULT = BORDER_REFLECT_101, //!< same as BORDER_REFLECT_101 + BORDER_ISOLATED = 16 //!< do not look outside of ROI +}; + +//! @} core_array + +//! @addtogroup core_utils +//! @{ + +//! @cond IGNORED + +//////////////// static assert ///////////////// +#define CVAUX_CONCAT_EXP(a, b) a##b +#define CVAUX_CONCAT(a, b) CVAUX_CONCAT_EXP(a,b) + +#if defined(__clang__) +# ifndef __has_extension +# define __has_extension __has_feature /* compatibility, for older versions of clang */ +# endif +# if __has_extension(cxx_static_assert) +# define CV_StaticAssert(condition, reason) static_assert((condition), reason " " #condition) +# elif __has_extension(c_static_assert) +# define CV_StaticAssert(condition, reason) _Static_assert((condition), reason " " #condition) +# endif +#elif defined(__GNUC__) +# if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L) +# define CV_StaticAssert(condition, reason) static_assert((condition), reason " " #condition) +# endif +#elif defined(_MSC_VER) +# if _MSC_VER >= 1600 /* MSVC 10 */ +# define CV_StaticAssert(condition, reason) static_assert((condition), reason " " #condition) +# endif +#endif +#ifndef CV_StaticAssert +# if !defined(__clang__) && defined(__GNUC__) && (__GNUC__*100 + __GNUC_MINOR__ > 302) +# define CV_StaticAssert(condition, reason) ({ extern int __attribute__((error("CV_StaticAssert: " reason " " #condition))) CV_StaticAssert(); ((condition) ? 0 : CV_StaticAssert()); }) +# else + template struct CV_StaticAssert_failed; + template <> struct CV_StaticAssert_failed { enum { val = 1 }; }; + template struct CV_StaticAssert_test {}; +# define CV_StaticAssert(condition, reason)\ + typedef cv::CV_StaticAssert_test< sizeof(cv::CV_StaticAssert_failed< static_cast(condition) >) > CVAUX_CONCAT(CV_StaticAssert_failed_at_, __LINE__) +# endif +#endif + +// Suppress warning "-Wdeprecated-declarations" / C4996 +#if defined(_MSC_VER) + #define CV_DO_PRAGMA(x) __pragma(x) +#elif defined(__GNUC__) + #define CV_DO_PRAGMA(x) _Pragma (#x) +#else + #define CV_DO_PRAGMA(x) +#endif + +#ifdef _MSC_VER +#define CV_SUPPRESS_DEPRECATED_START \ + CV_DO_PRAGMA(warning(push)) \ + CV_DO_PRAGMA(warning(disable: 4996)) +#define CV_SUPPRESS_DEPRECATED_END CV_DO_PRAGMA(warning(pop)) +#elif defined (__clang__) || ((__GNUC__) && (__GNUC__*100 + __GNUC_MINOR__ > 405)) +#define CV_SUPPRESS_DEPRECATED_START \ + CV_DO_PRAGMA(GCC diagnostic push) \ + CV_DO_PRAGMA(GCC diagnostic ignored "-Wdeprecated-declarations") +#define CV_SUPPRESS_DEPRECATED_END CV_DO_PRAGMA(GCC diagnostic pop) +#else +#define CV_SUPPRESS_DEPRECATED_START +#define CV_SUPPRESS_DEPRECATED_END +#endif +#define CV_UNUSED(name) (void)name +//! @endcond + +/*! @brief Signals an error and raises the exception. + +By default the function prints information about the error to stderr, +then it either stops if setBreakOnError() had been called before or raises the exception. +It is possible to alternate error processing by using redirectError(). +@param _code - error code (Error::Code) +@param _err - error description +@param _func - function name. Available only when the compiler supports getting it +@param _file - source file name where the error has occured +@param _line - line number in the source file where the error has occured +@see CV_Error, CV_Error_, CV_ErrorNoReturn, CV_ErrorNoReturn_, CV_Assert, CV_DbgAssert + */ +CV_EXPORTS void error(int _code, const String& _err, const char* _func, const char* _file, int _line); + +#ifdef __GNUC__ +# if defined __clang__ || defined __APPLE__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Winvalid-noreturn" +# endif +#endif + +/** same as cv::error, but does not return */ +CV_INLINE CV_NORETURN void errorNoReturn(int _code, const String& _err, const char* _func, const char* _file, int _line) +{ + error(_code, _err, _func, _file, _line); +#ifdef __GNUC__ +# if !defined __clang__ && !defined __APPLE__ + // this suppresses this warning: "noreturn" function does return [enabled by default] + __builtin_trap(); + // or use infinite loop: for (;;) {} +# endif +#endif +} +#ifdef __GNUC__ +# if defined __clang__ || defined __APPLE__ +# pragma GCC diagnostic pop +# endif +#endif + +#if defined __GNUC__ +#define CV_Func __func__ +#elif defined _MSC_VER +#define CV_Func __FUNCTION__ +#else +#define CV_Func "" +#endif + +/** @brief Call the error handler. + +Currently, the error handler prints the error code and the error message to the standard +error stream `stderr`. In the Debug configuration, it then provokes memory access violation, so that +the execution stack and all the parameters can be analyzed by the debugger. In the Release +configuration, the exception is thrown. + +@param code one of Error::Code +@param msg error message +*/ +#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ ) + +/** @brief Call the error handler. + +This macro can be used to construct an error message on-fly to include some dynamic information, +for example: +@code + // note the extra parentheses around the formatted text message + CV_Error_( CV_StsOutOfRange, + ("the value at (%d, %d)=%g is out of range", badPt.x, badPt.y, badValue)); +@endcode +@param code one of Error::Code +@param args printf-like formatted error message in parentheses +*/ +#define CV_Error_( code, args ) cv::error( code, cv::format args, CV_Func, __FILE__, __LINE__ ) + +/** @brief Checks a condition at runtime and throws exception if it fails + +The macros CV_Assert (and CV_DbgAssert(expr)) evaluate the specified expression. If it is 0, the macros +raise an error (see cv::error). The macro CV_Assert checks the condition in both Debug and Release +configurations while CV_DbgAssert is only retained in the Debug configuration. +*/ +#define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ) + +/** same as CV_Error(code,msg), but does not return */ +#define CV_ErrorNoReturn( code, msg ) cv::errorNoReturn( code, msg, CV_Func, __FILE__, __LINE__ ) + +/** same as CV_Error_(code,args), but does not return */ +#define CV_ErrorNoReturn_( code, args ) cv::errorNoReturn( code, cv::format args, CV_Func, __FILE__, __LINE__ ) + +/** replaced with CV_Assert(expr) in Debug configuration */ +#ifdef _DEBUG +# define CV_DbgAssert(expr) CV_Assert(expr) +#else +# define CV_DbgAssert(expr) +#endif + +/* + * Hamming distance functor - counts the bit differences between two strings - useful for the Brief descriptor + * bit count of A exclusive XOR'ed with B + */ +struct CV_EXPORTS Hamming +{ + enum { normType = NORM_HAMMING }; + typedef unsigned char ValueType; + typedef int ResultType; + + /** this will count the bits in a ^ b + */ + ResultType operator()( const unsigned char* a, const unsigned char* b, int size ) const; +}; + +typedef Hamming HammingLUT; + +/////////////////////////////////// inline norms //////////////////////////////////// + +template inline _Tp cv_abs(_Tp x) { return std::abs(x); } +inline int cv_abs(uchar x) { return x; } +inline int cv_abs(schar x) { return std::abs(x); } +inline int cv_abs(ushort x) { return x; } +inline int cv_abs(short x) { return std::abs(x); } + +template static inline +_AccTp normL2Sqr(const _Tp* a, int n) +{ + _AccTp s = 0; + int i=0; +#if CV_ENABLE_UNROLLED + for( ; i <= n - 4; i += 4 ) + { + _AccTp v0 = a[i], v1 = a[i+1], v2 = a[i+2], v3 = a[i+3]; + s += v0*v0 + v1*v1 + v2*v2 + v3*v3; + } +#endif + for( ; i < n; i++ ) + { + _AccTp v = a[i]; + s += v*v; + } + return s; +} + +template static inline +_AccTp normL1(const _Tp* a, int n) +{ + _AccTp s = 0; + int i = 0; +#if CV_ENABLE_UNROLLED + for(; i <= n - 4; i += 4 ) + { + s += (_AccTp)cv_abs(a[i]) + (_AccTp)cv_abs(a[i+1]) + + (_AccTp)cv_abs(a[i+2]) + (_AccTp)cv_abs(a[i+3]); + } +#endif + for( ; i < n; i++ ) + s += cv_abs(a[i]); + return s; +} + +template static inline +_AccTp normInf(const _Tp* a, int n) +{ + _AccTp s = 0; + for( int i = 0; i < n; i++ ) + s = std::max(s, (_AccTp)cv_abs(a[i])); + return s; +} + +template static inline +_AccTp normL2Sqr(const _Tp* a, const _Tp* b, int n) +{ + _AccTp s = 0; + int i= 0; +#if CV_ENABLE_UNROLLED + for(; i <= n - 4; i += 4 ) + { + _AccTp v0 = _AccTp(a[i] - b[i]), v1 = _AccTp(a[i+1] - b[i+1]), v2 = _AccTp(a[i+2] - b[i+2]), v3 = _AccTp(a[i+3] - b[i+3]); + s += v0*v0 + v1*v1 + v2*v2 + v3*v3; + } +#endif + for( ; i < n; i++ ) + { + _AccTp v = _AccTp(a[i] - b[i]); + s += v*v; + } + return s; +} + +static inline float normL2Sqr(const float* a, const float* b, int n) +{ + float s = 0.f; + for( int i = 0; i < n; i++ ) + { + float v = a[i] - b[i]; + s += v*v; + } + return s; +} + +template static inline +_AccTp normL1(const _Tp* a, const _Tp* b, int n) +{ + _AccTp s = 0; + int i= 0; +#if CV_ENABLE_UNROLLED + for(; i <= n - 4; i += 4 ) + { + _AccTp v0 = _AccTp(a[i] - b[i]), v1 = _AccTp(a[i+1] - b[i+1]), v2 = _AccTp(a[i+2] - b[i+2]), v3 = _AccTp(a[i+3] - b[i+3]); + s += std::abs(v0) + std::abs(v1) + std::abs(v2) + std::abs(v3); + } +#endif + for( ; i < n; i++ ) + { + _AccTp v = _AccTp(a[i] - b[i]); + s += std::abs(v); + } + return s; +} + +inline float normL1(const float* a, const float* b, int n) +{ + float s = 0.f; + for( int i = 0; i < n; i++ ) + { + s += std::abs(a[i] - b[i]); + } + return s; +} + +inline int normL1(const uchar* a, const uchar* b, int n) +{ + int s = 0; + for( int i = 0; i < n; i++ ) + { + s += std::abs(a[i] - b[i]); + } + return s; +} + +template static inline +_AccTp normInf(const _Tp* a, const _Tp* b, int n) +{ + _AccTp s = 0; + for( int i = 0; i < n; i++ ) + { + _AccTp v0 = a[i] - b[i]; + s = std::max(s, std::abs(v0)); + } + return s; +} + +/** @brief Computes the cube root of an argument. + + The function cubeRoot computes \f$\sqrt[3]{\texttt{val}}\f$. Negative arguments are handled correctly. + NaN and Inf are not handled. The accuracy approaches the maximum possible accuracy for + single-precision data. + @param val A function argument. + */ +CV_EXPORTS_W float cubeRoot(float val); + +/** @brief Calculates the angle of a 2D vector in degrees. + + The function fastAtan2 calculates the full-range angle of an input 2D vector. The angle is measured + in degrees and varies from 0 to 360 degrees. The accuracy is about 0.3 degrees. + @param x x-coordinate of the vector. + @param y y-coordinate of the vector. + */ +CV_EXPORTS_W float fastAtan2(float y, float x); + +/** proxy for hal::LU */ +CV_EXPORTS int LU(float* A, size_t astep, int m, float* b, size_t bstep, int n); +/** proxy for hal::LU */ +CV_EXPORTS int LU(double* A, size_t astep, int m, double* b, size_t bstep, int n); +/** proxy for hal::Cholesky */ +CV_EXPORTS bool Cholesky(float* A, size_t astep, int m, float* b, size_t bstep, int n); +/** proxy for hal::Cholesky */ +CV_EXPORTS bool Cholesky(double* A, size_t astep, int m, double* b, size_t bstep, int n); + +////////////////// forward declarations for important OpenCV types ////////////////// + +//! @cond IGNORED + +template class Vec; +template class Matx; + +template class Complex; +template class Point_; +template class Point3_; +template class Size_; +template class Rect_; +template class Scalar_; + +class CV_EXPORTS RotatedRect; +class CV_EXPORTS Range; +class CV_EXPORTS TermCriteria; +class CV_EXPORTS KeyPoint; +class CV_EXPORTS DMatch; +class CV_EXPORTS RNG; + +class CV_EXPORTS Mat; +class CV_EXPORTS MatExpr; + +class CV_EXPORTS UMat; + +class CV_EXPORTS SparseMat; +typedef Mat MatND; + +template class Mat_; +template class SparseMat_; + +class CV_EXPORTS MatConstIterator; +class CV_EXPORTS SparseMatIterator; +class CV_EXPORTS SparseMatConstIterator; +template class MatIterator_; +template class MatConstIterator_; +template class SparseMatIterator_; +template class SparseMatConstIterator_; + +namespace ogl +{ + class CV_EXPORTS Buffer; + class CV_EXPORTS Texture2D; + class CV_EXPORTS Arrays; +} + +namespace cuda +{ + class CV_EXPORTS GpuMat; + class CV_EXPORTS HostMem; + class CV_EXPORTS Stream; + class CV_EXPORTS Event; +} + +namespace cudev +{ + template class GpuMat_; +} + +namespace ipp +{ +CV_EXPORTS int getIppFeatures(); +CV_EXPORTS void setIppStatus(int status, const char * const funcname = NULL, const char * const filename = NULL, + int line = 0); +CV_EXPORTS int getIppStatus(); +CV_EXPORTS String getIppErrorLocation(); +CV_EXPORTS bool useIPP(); +CV_EXPORTS void setUseIPP(bool flag); + +} // ipp + +//! @endcond + +//! @} core_utils + + + + +} // cv + +#include "opencv2/core/neon_utils.hpp" + +#endif //__OPENCV_CORE_BASE_HPP__ diff --git a/lib/opencv/include/opencv2/core/bufferpool.hpp b/lib/opencv/include/opencv2/core/bufferpool.hpp new file mode 100644 index 000000000..76df2d29f --- /dev/null +++ b/lib/opencv/include/opencv2/core/bufferpool.hpp @@ -0,0 +1,31 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. +// +// Copyright (C) 2014, Advanced Micro Devices, Inc., all rights reserved. + +#ifndef __OPENCV_CORE_BUFFER_POOL_HPP__ +#define __OPENCV_CORE_BUFFER_POOL_HPP__ + +namespace cv +{ + +//! @addtogroup core +//! @{ + +class BufferPoolController +{ +protected: + ~BufferPoolController() { } +public: + virtual size_t getReservedSize() const = 0; + virtual size_t getMaxReservedSize() const = 0; + virtual void setMaxReservedSize(size_t size) = 0; + virtual void freeAllReservedBuffers() = 0; +}; + +//! @} + +} + +#endif // __OPENCV_CORE_BUFFER_POOL_HPP__ diff --git a/lib/opencv/include/opencv2/core/core.hpp b/lib/opencv/include/opencv2/core/core.hpp new file mode 100644 index 000000000..438918359 --- /dev/null +++ b/lib/opencv/include/opencv2/core/core.hpp @@ -0,0 +1,48 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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*/ + +#ifdef __OPENCV_BUILD +#error this is a compatibility header which should not be used inside the OpenCV library +#endif + +#include "opencv2/core.hpp" diff --git a/lib/opencv/include/opencv2/core/core_c.h b/lib/opencv/include/opencv2/core/core_c.h new file mode 100644 index 000000000..a0ed63264 --- /dev/null +++ b/lib/opencv/include/opencv2/core/core_c.h @@ -0,0 +1,3152 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_C_H__ +#define __OPENCV_CORE_C_H__ + +#include "opencv2/core/types_c.h" + +#ifdef __cplusplus +# ifdef _MSC_VER +/* disable warning C4190: 'function' has C-linkage specified, but returns UDT 'typename' + which is incompatible with C + + It is OK to disable it because we only extend few plain structures with + C++ construrtors for simpler interoperability with C++ API of the library +*/ +# pragma warning(disable:4190) +# elif defined __clang__ && __clang_major__ >= 3 +# pragma GCC diagnostic ignored "-Wreturn-type-c-linkage" +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup core_c + @{ +*/ + +/****************************************************************************************\ +* Array allocation, deallocation, initialization and access to elements * +\****************************************************************************************/ + +/** `malloc` wrapper. + If there is no enough memory, the function + (as well as other OpenCV functions that call cvAlloc) + raises an error. */ +CVAPI(void*) cvAlloc( size_t size ); + +/** `free` wrapper. + Here and further all the memory releasing functions + (that all call cvFree) take double pointer in order to + to clear pointer to the data after releasing it. + Passing pointer to NULL pointer is Ok: nothing happens in this case +*/ +CVAPI(void) cvFree_( void* ptr ); +#define cvFree(ptr) (cvFree_(*(ptr)), *(ptr)=0) + +/** @brief Creates an image header but does not allocate the image data. + +@param size Image width and height +@param depth Image depth (see cvCreateImage ) +@param channels Number of channels (see cvCreateImage ) + */ +CVAPI(IplImage*) cvCreateImageHeader( CvSize size, int depth, int channels ); + +/** @brief Initializes an image header that was previously allocated. + +The returned IplImage\* points to the initialized header. +@param image Image header to initialize +@param size Image width and height +@param depth Image depth (see cvCreateImage ) +@param channels Number of channels (see cvCreateImage ) +@param origin Top-left IPL_ORIGIN_TL or bottom-left IPL_ORIGIN_BL +@param align Alignment for image rows, typically 4 or 8 bytes + */ +CVAPI(IplImage*) cvInitImageHeader( IplImage* image, CvSize size, int depth, + int channels, int origin CV_DEFAULT(0), + int align CV_DEFAULT(4)); + +/** @brief Creates an image header and allocates the image data. + +This function call is equivalent to the following code: +@code + header = cvCreateImageHeader(size, depth, channels); + cvCreateData(header); +@endcode +@param size Image width and height +@param depth Bit depth of image elements. See IplImage for valid depths. +@param channels Number of channels per pixel. See IplImage for details. This function only creates +images with interleaved channels. + */ +CVAPI(IplImage*) cvCreateImage( CvSize size, int depth, int channels ); + +/** @brief Deallocates an image header. + +This call is an analogue of : +@code + if(image ) + { + iplDeallocate(*image, IPL_IMAGE_HEADER | IPL_IMAGE_ROI); + *image = 0; + } +@endcode +but it does not use IPL functions by default (see the CV_TURN_ON_IPL_COMPATIBILITY macro). +@param image Double pointer to the image header + */ +CVAPI(void) cvReleaseImageHeader( IplImage** image ); + +/** @brief Deallocates the image header and the image data. + +This call is a shortened form of : +@code + if(*image ) + { + cvReleaseData(*image); + cvReleaseImageHeader(image); + } +@endcode +@param image Double pointer to the image header +*/ +CVAPI(void) cvReleaseImage( IplImage** image ); + +/** Creates a copy of IPL image (widthStep may differ) */ +CVAPI(IplImage*) cvCloneImage( const IplImage* image ); + +/** @brief Sets the channel of interest in an IplImage. + +If the ROI is set to NULL and the coi is *not* 0, the ROI is allocated. Most OpenCV functions do +*not* support the COI setting, so to process an individual image/matrix channel one may copy (via +cvCopy or cvSplit) the channel to a separate image/matrix, process it and then copy the result +back (via cvCopy or cvMerge) if needed. +@param image A pointer to the image header +@param coi The channel of interest. 0 - all channels are selected, 1 - first channel is selected, +etc. Note that the channel indices become 1-based. + */ +CVAPI(void) cvSetImageCOI( IplImage* image, int coi ); + +/** @brief Returns the index of the channel of interest. + +Returns the channel of interest of in an IplImage. Returned values correspond to the coi in +cvSetImageCOI. +@param image A pointer to the image header + */ +CVAPI(int) cvGetImageCOI( const IplImage* image ); + +/** @brief Sets an image Region Of Interest (ROI) for a given rectangle. + +If the original image ROI was NULL and the rect is not the whole image, the ROI structure is +allocated. + +Most OpenCV functions support the use of ROI and treat the image rectangle as a separate image. For +example, all of the pixel coordinates are counted from the top-left (or bottom-left) corner of the +ROI, not the original image. +@param image A pointer to the image header +@param rect The ROI rectangle + */ +CVAPI(void) cvSetImageROI( IplImage* image, CvRect rect ); + +/** @brief Resets the image ROI to include the entire image and releases the ROI structure. + +This produces a similar result to the following, but in addition it releases the ROI structure. : +@code + cvSetImageROI(image, cvRect(0, 0, image->width, image->height )); + cvSetImageCOI(image, 0); +@endcode +@param image A pointer to the image header + */ +CVAPI(void) cvResetImageROI( IplImage* image ); + +/** @brief Returns the image ROI. + +If there is no ROI set, cvRect(0,0,image-\>width,image-\>height) is returned. +@param image A pointer to the image header + */ +CVAPI(CvRect) cvGetImageROI( const IplImage* image ); + +/** @brief Creates a matrix header but does not allocate the matrix data. + +The function allocates a new matrix header and returns a pointer to it. The matrix data can then be +allocated using cvCreateData or set explicitly to user-allocated data via cvSetData. +@param rows Number of rows in the matrix +@param cols Number of columns in the matrix +@param type Type of the matrix elements, see cvCreateMat + */ +CVAPI(CvMat*) cvCreateMatHeader( int rows, int cols, int type ); + +#define CV_AUTOSTEP 0x7fffffff + +/** @brief Initializes a pre-allocated matrix header. + +This function is often used to process raw data with OpenCV matrix functions. For example, the +following code computes the matrix product of two matrices, stored as ordinary arrays: +@code + double a[] = { 1, 2, 3, 4, + 5, 6, 7, 8, + 9, 10, 11, 12 }; + + double b[] = { 1, 5, 9, + 2, 6, 10, + 3, 7, 11, + 4, 8, 12 }; + + double c[9]; + CvMat Ma, Mb, Mc ; + + cvInitMatHeader(&Ma, 3, 4, CV_64FC1, a); + cvInitMatHeader(&Mb, 4, 3, CV_64FC1, b); + cvInitMatHeader(&Mc, 3, 3, CV_64FC1, c); + + cvMatMulAdd(&Ma, &Mb, 0, &Mc); + // the c array now contains the product of a (3x4) and b (4x3) +@endcode +@param mat A pointer to the matrix header to be initialized +@param rows Number of rows in the matrix +@param cols Number of columns in the matrix +@param type Type of the matrix elements, see cvCreateMat . +@param data Optional: data pointer assigned to the matrix header +@param step Optional: full row width in bytes of the assigned data. By default, the minimal +possible step is used which assumes there are no gaps between subsequent rows of the matrix. + */ +CVAPI(CvMat*) cvInitMatHeader( CvMat* mat, int rows, int cols, + int type, void* data CV_DEFAULT(NULL), + int step CV_DEFAULT(CV_AUTOSTEP) ); + +/** @brief Creates a matrix header and allocates the matrix data. + +The function call is equivalent to the following code: +@code + CvMat* mat = cvCreateMatHeader(rows, cols, type); + cvCreateData(mat); +@endcode +@param rows Number of rows in the matrix +@param cols Number of columns in the matrix +@param type The type of the matrix elements in the form +CV_\\C\ , where S=signed, U=unsigned, F=float. For +example, CV _ 8UC1 means the elements are 8-bit unsigned and the there is 1 channel, and CV _ +32SC2 means the elements are 32-bit signed and there are 2 channels. + */ +CVAPI(CvMat*) cvCreateMat( int rows, int cols, int type ); + +/** @brief Deallocates a matrix. + +The function decrements the matrix data reference counter and deallocates matrix header. If the data +reference counter is 0, it also deallocates the data. : +@code + if(*mat ) + cvDecRefData(*mat); + cvFree((void**)mat); +@endcode +@param mat Double pointer to the matrix + */ +CVAPI(void) cvReleaseMat( CvMat** mat ); + +/** @brief Decrements an array data reference counter. + +The function decrements the data reference counter in a CvMat or CvMatND if the reference counter + +pointer is not NULL. If the counter reaches zero, the data is deallocated. In the current +implementation the reference counter is not NULL only if the data was allocated using the +cvCreateData function. The counter will be NULL in other cases such as: external data was assigned +to the header using cvSetData, header is part of a larger matrix or image, or the header was +converted from an image or n-dimensional matrix header. +@param arr Pointer to an array header + */ +CV_INLINE void cvDecRefData( CvArr* arr ) +{ + if( CV_IS_MAT( arr )) + { + CvMat* mat = (CvMat*)arr; + mat->data.ptr = NULL; + if( mat->refcount != NULL && --*mat->refcount == 0 ) + cvFree( &mat->refcount ); + mat->refcount = NULL; + } + else if( CV_IS_MATND( arr )) + { + CvMatND* mat = (CvMatND*)arr; + mat->data.ptr = NULL; + if( mat->refcount != NULL && --*mat->refcount == 0 ) + cvFree( &mat->refcount ); + mat->refcount = NULL; + } +} + +/** @brief Increments array data reference counter. + +The function increments CvMat or CvMatND data reference counter and returns the new counter value if +the reference counter pointer is not NULL, otherwise it returns zero. +@param arr Array header + */ +CV_INLINE int cvIncRefData( CvArr* arr ) +{ + int refcount = 0; + if( CV_IS_MAT( arr )) + { + CvMat* mat = (CvMat*)arr; + if( mat->refcount != NULL ) + refcount = ++*mat->refcount; + } + else if( CV_IS_MATND( arr )) + { + CvMatND* mat = (CvMatND*)arr; + if( mat->refcount != NULL ) + refcount = ++*mat->refcount; + } + return refcount; +} + + +/** Creates an exact copy of the input matrix (except, may be, step value) */ +CVAPI(CvMat*) cvCloneMat( const CvMat* mat ); + + +/** @brief Returns matrix header corresponding to the rectangular sub-array of input image or matrix. + +The function returns header, corresponding to a specified rectangle of the input array. In other + +words, it allows the user to treat a rectangular part of input array as a stand-alone array. ROI is +taken into account by the function so the sub-array of ROI is actually extracted. +@param arr Input array +@param submat Pointer to the resultant sub-array header +@param rect Zero-based coordinates of the rectangle of interest + */ +CVAPI(CvMat*) cvGetSubRect( const CvArr* arr, CvMat* submat, CvRect rect ); +#define cvGetSubArr cvGetSubRect + +/** @brief Returns array row or row span. + +The functions return the header, corresponding to a specified row/row span of the input array. +cvGetRow(arr, submat, row) is a shortcut for cvGetRows(arr, submat, row, row+1). +@param arr Input array +@param submat Pointer to the resulting sub-array header +@param start_row Zero-based index of the starting row (inclusive) of the span +@param end_row Zero-based index of the ending row (exclusive) of the span +@param delta_row Index step in the row span. That is, the function extracts every delta_row -th +row from start_row and up to (but not including) end_row . + */ +CVAPI(CvMat*) cvGetRows( const CvArr* arr, CvMat* submat, + int start_row, int end_row, + int delta_row CV_DEFAULT(1)); + +/** @overload +@param arr Input array +@param submat Pointer to the resulting sub-array header +@param row Zero-based index of the selected row +*/ +CV_INLINE CvMat* cvGetRow( const CvArr* arr, CvMat* submat, int row ) +{ + return cvGetRows( arr, submat, row, row + 1, 1 ); +} + + +/** @brief Returns one of more array columns. + +The functions return the header, corresponding to a specified column span of the input array. That + +is, no data is copied. Therefore, any modifications of the submatrix will affect the original array. +If you need to copy the columns, use cvCloneMat. cvGetCol(arr, submat, col) is a shortcut for +cvGetCols(arr, submat, col, col+1). +@param arr Input array +@param submat Pointer to the resulting sub-array header +@param start_col Zero-based index of the starting column (inclusive) of the span +@param end_col Zero-based index of the ending column (exclusive) of the span + */ +CVAPI(CvMat*) cvGetCols( const CvArr* arr, CvMat* submat, + int start_col, int end_col ); + +/** @overload +@param arr Input array +@param submat Pointer to the resulting sub-array header +@param col Zero-based index of the selected column +*/ +CV_INLINE CvMat* cvGetCol( const CvArr* arr, CvMat* submat, int col ) +{ + return cvGetCols( arr, submat, col, col + 1 ); +} + +/** @brief Returns one of array diagonals. + +The function returns the header, corresponding to a specified diagonal of the input array. +@param arr Input array +@param submat Pointer to the resulting sub-array header +@param diag Index of the array diagonal. Zero value corresponds to the main diagonal, -1 +corresponds to the diagonal above the main, 1 corresponds to the diagonal below the main, and so +forth. + */ +CVAPI(CvMat*) cvGetDiag( const CvArr* arr, CvMat* submat, + int diag CV_DEFAULT(0)); + +/** low-level scalar <-> raw data conversion functions */ +CVAPI(void) cvScalarToRawData( const CvScalar* scalar, void* data, int type, + int extend_to_12 CV_DEFAULT(0) ); + +CVAPI(void) cvRawDataToScalar( const void* data, int type, CvScalar* scalar ); + +/** @brief Creates a new matrix header but does not allocate the matrix data. + +The function allocates a header for a multi-dimensional dense array. The array data can further be +allocated using cvCreateData or set explicitly to user-allocated data via cvSetData. +@param dims Number of array dimensions +@param sizes Array of dimension sizes +@param type Type of array elements, see cvCreateMat + */ +CVAPI(CvMatND*) cvCreateMatNDHeader( int dims, const int* sizes, int type ); + +/** @brief Creates the header and allocates the data for a multi-dimensional dense array. + +This function call is equivalent to the following code: +@code + CvMatND* mat = cvCreateMatNDHeader(dims, sizes, type); + cvCreateData(mat); +@endcode +@param dims Number of array dimensions. This must not exceed CV_MAX_DIM (32 by default, but can be +changed at build time). +@param sizes Array of dimension sizes. +@param type Type of array elements, see cvCreateMat . + */ +CVAPI(CvMatND*) cvCreateMatND( int dims, const int* sizes, int type ); + +/** @brief Initializes a pre-allocated multi-dimensional array header. + +@param mat A pointer to the array header to be initialized +@param dims The number of array dimensions +@param sizes An array of dimension sizes +@param type Type of array elements, see cvCreateMat +@param data Optional data pointer assigned to the matrix header + */ +CVAPI(CvMatND*) cvInitMatNDHeader( CvMatND* mat, int dims, const int* sizes, + int type, void* data CV_DEFAULT(NULL) ); + +/** @brief Deallocates a multi-dimensional array. + +The function decrements the array data reference counter and releases the array header. If the +reference counter reaches 0, it also deallocates the data. : +@code + if(*mat ) + cvDecRefData(*mat); + cvFree((void**)mat); +@endcode +@param mat Double pointer to the array + */ +CV_INLINE void cvReleaseMatND( CvMatND** mat ) +{ + cvReleaseMat( (CvMat**)mat ); +} + +/** Creates a copy of CvMatND (except, may be, steps) */ +CVAPI(CvMatND*) cvCloneMatND( const CvMatND* mat ); + +/** @brief Creates sparse array. + +The function allocates a multi-dimensional sparse array. Initially the array contain no elements, +that is PtrND and other related functions will return 0 for every index. +@param dims Number of array dimensions. In contrast to the dense matrix, the number of dimensions is +practically unlimited (up to \f$2^{16}\f$ ). +@param sizes Array of dimension sizes +@param type Type of array elements. The same as for CvMat + */ +CVAPI(CvSparseMat*) cvCreateSparseMat( int dims, const int* sizes, int type ); + +/** @brief Deallocates sparse array. + +The function releases the sparse array and clears the array pointer upon exit. +@param mat Double pointer to the array + */ +CVAPI(void) cvReleaseSparseMat( CvSparseMat** mat ); + +/** Creates a copy of CvSparseMat (except, may be, zero items) */ +CVAPI(CvSparseMat*) cvCloneSparseMat( const CvSparseMat* mat ); + +/** @brief Initializes sparse array elements iterator. + +The function initializes iterator of sparse array elements and returns pointer to the first element, +or NULL if the array is empty. +@param mat Input array +@param mat_iterator Initialized iterator + */ +CVAPI(CvSparseNode*) cvInitSparseMatIterator( const CvSparseMat* mat, + CvSparseMatIterator* mat_iterator ); + +/** @brief Returns the next sparse matrix element + +The function moves iterator to the next sparse matrix element and returns pointer to it. In the +current version there is no any particular order of the elements, because they are stored in the +hash table. The sample below demonstrates how to iterate through the sparse matrix: +@code + // print all the non-zero sparse matrix elements and compute their sum + double sum = 0; + int i, dims = cvGetDims(sparsemat); + CvSparseMatIterator it; + CvSparseNode* node = cvInitSparseMatIterator(sparsemat, &it); + + for(; node != 0; node = cvGetNextSparseNode(&it)) + { + int* idx = CV_NODE_IDX(array, node); + float val = *(float*)CV_NODE_VAL(array, node); + printf("M"); + for(i = 0; i < dims; i++ ) + printf("[%d]", idx[i]); + printf("=%g\n", val); + + sum += val; + } + + printf("nTotal sum = %g\n", sum); +@endcode +@param mat_iterator Sparse array iterator + */ +CV_INLINE CvSparseNode* cvGetNextSparseNode( CvSparseMatIterator* mat_iterator ) +{ + if( mat_iterator->node->next ) + return mat_iterator->node = mat_iterator->node->next; + else + { + int idx; + for( idx = ++mat_iterator->curidx; idx < mat_iterator->mat->hashsize; idx++ ) + { + CvSparseNode* node = (CvSparseNode*)mat_iterator->mat->hashtable[idx]; + if( node ) + { + mat_iterator->curidx = idx; + return mat_iterator->node = node; + } + } + return NULL; + } +} + + +#define CV_MAX_ARR 10 + +/** matrix iterator: used for n-ary operations on dense arrays */ +typedef struct CvNArrayIterator +{ + int count; /**< number of arrays */ + int dims; /**< number of dimensions to iterate */ + CvSize size; /**< maximal common linear size: { width = size, height = 1 } */ + uchar* ptr[CV_MAX_ARR]; /**< pointers to the array slices */ + int stack[CV_MAX_DIM]; /**< for internal use */ + CvMatND* hdr[CV_MAX_ARR]; /**< pointers to the headers of the + matrices that are processed */ +} +CvNArrayIterator; + +#define CV_NO_DEPTH_CHECK 1 +#define CV_NO_CN_CHECK 2 +#define CV_NO_SIZE_CHECK 4 + +/** initializes iterator that traverses through several arrays simulteneously + (the function together with cvNextArraySlice is used for + N-ari element-wise operations) */ +CVAPI(int) cvInitNArrayIterator( int count, CvArr** arrs, + const CvArr* mask, CvMatND* stubs, + CvNArrayIterator* array_iterator, + int flags CV_DEFAULT(0) ); + +/** returns zero value if iteration is finished, non-zero (slice length) otherwise */ +CVAPI(int) cvNextNArraySlice( CvNArrayIterator* array_iterator ); + + +/** @brief Returns type of array elements. + +The function returns type of the array elements. In the case of IplImage the type is converted to +CvMat-like representation. For example, if the image has been created as: +@code + IplImage* img = cvCreateImage(cvSize(640, 480), IPL_DEPTH_8U, 3); +@endcode +The code cvGetElemType(img) will return CV_8UC3. +@param arr Input array + */ +CVAPI(int) cvGetElemType( const CvArr* arr ); + +/** @brief Return number of array dimensions + +The function returns the array dimensionality and the array of dimension sizes. In the case of +IplImage or CvMat it always returns 2 regardless of number of image/matrix rows. For example, the +following code calculates total number of array elements: +@code + int sizes[CV_MAX_DIM]; + int i, total = 1; + int dims = cvGetDims(arr, size); + for(i = 0; i < dims; i++ ) + total *= sizes[i]; +@endcode +@param arr Input array +@param sizes Optional output vector of the array dimension sizes. For 2d arrays the number of rows +(height) goes first, number of columns (width) next. + */ +CVAPI(int) cvGetDims( const CvArr* arr, int* sizes CV_DEFAULT(NULL) ); + + +/** @brief Returns array size along the specified dimension. + +@param arr Input array +@param index Zero-based dimension index (for matrices 0 means number of rows, 1 means number of +columns; for images 0 means height, 1 means width) + */ +CVAPI(int) cvGetDimSize( const CvArr* arr, int index ); + + +/** @brief Return pointer to a particular array element. + +The functions return a pointer to a specific array element. Number of array dimension should match +to the number of indices passed to the function except for cvPtr1D function that can be used for +sequential access to 1D, 2D or nD dense arrays. + +The functions can be used for sparse arrays as well - if the requested node does not exist they +create it and set it to zero. + +All these as well as other functions accessing array elements ( cvGetND , cvGetRealND , cvSet +, cvSetND , cvSetRealND ) raise an error in case if the element index is out of range. +@param arr Input array +@param idx0 The first zero-based component of the element index +@param type Optional output parameter: type of matrix elements + */ +CVAPI(uchar*) cvPtr1D( const CvArr* arr, int idx0, int* type CV_DEFAULT(NULL)); +/** @overload */ +CVAPI(uchar*) cvPtr2D( const CvArr* arr, int idx0, int idx1, int* type CV_DEFAULT(NULL) ); +/** @overload */ +CVAPI(uchar*) cvPtr3D( const CvArr* arr, int idx0, int idx1, int idx2, + int* type CV_DEFAULT(NULL)); +/** @overload +@param arr Input array +@param idx Array of the element indices +@param type Optional output parameter: type of matrix elements +@param create_node Optional input parameter for sparse matrices. Non-zero value of the parameter +means that the requested element is created if it does not exist already. +@param precalc_hashval Optional input parameter for sparse matrices. If the pointer is not NULL, +the function does not recalculate the node hash value, but takes it from the specified location. +It is useful for speeding up pair-wise operations (TODO: provide an example) +*/ +CVAPI(uchar*) cvPtrND( const CvArr* arr, const int* idx, int* type CV_DEFAULT(NULL), + int create_node CV_DEFAULT(1), + unsigned* precalc_hashval CV_DEFAULT(NULL)); + +/** @brief Return a specific array element. + +The functions return a specific array element. In the case of a sparse array the functions return 0 +if the requested node does not exist (no new node is created by the functions). +@param arr Input array +@param idx0 The first zero-based component of the element index + */ +CVAPI(CvScalar) cvGet1D( const CvArr* arr, int idx0 ); +/** @overload */ +CVAPI(CvScalar) cvGet2D( const CvArr* arr, int idx0, int idx1 ); +/** @overload */ +CVAPI(CvScalar) cvGet3D( const CvArr* arr, int idx0, int idx1, int idx2 ); +/** @overload +@param arr Input array +@param idx Array of the element indices +*/ +CVAPI(CvScalar) cvGetND( const CvArr* arr, const int* idx ); + +/** @brief Return a specific element of single-channel 1D, 2D, 3D or nD array. + +Returns a specific element of a single-channel array. If the array has multiple channels, a runtime +error is raised. Note that Get?D functions can be used safely for both single-channel and +multiple-channel arrays though they are a bit slower. + +In the case of a sparse array the functions return 0 if the requested node does not exist (no new +node is created by the functions). +@param arr Input array. Must have a single channel. +@param idx0 The first zero-based component of the element index + */ +CVAPI(double) cvGetReal1D( const CvArr* arr, int idx0 ); +/** @overload */ +CVAPI(double) cvGetReal2D( const CvArr* arr, int idx0, int idx1 ); +/** @overload */ +CVAPI(double) cvGetReal3D( const CvArr* arr, int idx0, int idx1, int idx2 ); +/** @overload +@param arr Input array. Must have a single channel. +@param idx Array of the element indices +*/ +CVAPI(double) cvGetRealND( const CvArr* arr, const int* idx ); + +/** @brief Change the particular array element. + +The functions assign the new value to a particular array element. In the case of a sparse array the +functions create the node if it does not exist yet. +@param arr Input array +@param idx0 The first zero-based component of the element index +@param value The assigned value + */ +CVAPI(void) cvSet1D( CvArr* arr, int idx0, CvScalar value ); +/** @overload */ +CVAPI(void) cvSet2D( CvArr* arr, int idx0, int idx1, CvScalar value ); +/** @overload */ +CVAPI(void) cvSet3D( CvArr* arr, int idx0, int idx1, int idx2, CvScalar value ); +/** @overload +@param arr Input array +@param idx Array of the element indices +@param value The assigned value +*/ +CVAPI(void) cvSetND( CvArr* arr, const int* idx, CvScalar value ); + +/** @brief Change a specific array element. + +The functions assign a new value to a specific element of a single-channel array. If the array has +multiple channels, a runtime error is raised. Note that the Set\*D function can be used safely for +both single-channel and multiple-channel arrays, though they are a bit slower. + +In the case of a sparse array the functions create the node if it does not yet exist. +@param arr Input array +@param idx0 The first zero-based component of the element index +@param value The assigned value + */ +CVAPI(void) cvSetReal1D( CvArr* arr, int idx0, double value ); +/** @overload */ +CVAPI(void) cvSetReal2D( CvArr* arr, int idx0, int idx1, double value ); +/** @overload */ +CVAPI(void) cvSetReal3D( CvArr* arr, int idx0, + int idx1, int idx2, double value ); +/** @overload +@param arr Input array +@param idx Array of the element indices +@param value The assigned value +*/ +CVAPI(void) cvSetRealND( CvArr* arr, const int* idx, double value ); + +/** clears element of ND dense array, + in case of sparse arrays it deletes the specified node */ +CVAPI(void) cvClearND( CvArr* arr, const int* idx ); + +/** @brief Returns matrix header for arbitrary array. + +The function returns a matrix header for the input array that can be a matrix - CvMat, an image - +IplImage, or a multi-dimensional dense array - CvMatND (the third option is allowed only if +allowND != 0) . In the case of matrix the function simply returns the input pointer. In the case of +IplImage\* or CvMatND it initializes the header structure with parameters of the current image ROI +and returns &header. Because COI is not supported by CvMat, it is returned separately. + +The function provides an easy way to handle both types of arrays - IplImage and CvMat using the same +code. Input array must have non-zero data pointer, otherwise the function will report an error. + +@note If the input array is IplImage with planar data layout and COI set, the function returns the +pointer to the selected plane and COI == 0. This feature allows user to process IplImage structures +with planar data layout, even though OpenCV does not support such images. +@param arr Input array +@param header Pointer to CvMat structure used as a temporary buffer +@param coi Optional output parameter for storing COI +@param allowND If non-zero, the function accepts multi-dimensional dense arrays (CvMatND\*) and +returns 2D matrix (if CvMatND has two dimensions) or 1D matrix (when CvMatND has 1 dimension or +more than 2 dimensions). The CvMatND array must be continuous. +@sa cvGetImage, cvarrToMat. + */ +CVAPI(CvMat*) cvGetMat( const CvArr* arr, CvMat* header, + int* coi CV_DEFAULT(NULL), + int allowND CV_DEFAULT(0)); + +/** @brief Returns image header for arbitrary array. + +The function returns the image header for the input array that can be a matrix (CvMat) or image +(IplImage). In the case of an image the function simply returns the input pointer. In the case of +CvMat it initializes an image_header structure with the parameters of the input matrix. Note that +if we transform IplImage to CvMat using cvGetMat and then transform CvMat back to IplImage using +this function, we will get different headers if the ROI is set in the original image. +@param arr Input array +@param image_header Pointer to IplImage structure used as a temporary buffer + */ +CVAPI(IplImage*) cvGetImage( const CvArr* arr, IplImage* image_header ); + + +/** @brief Changes the shape of a multi-dimensional array without copying the data. + +The function is an advanced version of cvReshape that can work with multi-dimensional arrays as +well (though it can work with ordinary images and matrices) and change the number of dimensions. + +Below are the two samples from the cvReshape description rewritten using cvReshapeMatND: +@code + IplImage* color_img = cvCreateImage(cvSize(320,240), IPL_DEPTH_8U, 3); + IplImage gray_img_hdr, *gray_img; + gray_img = (IplImage*)cvReshapeMatND(color_img, sizeof(gray_img_hdr), &gray_img_hdr, 1, 0, 0); + ... + int size[] = { 2, 2, 2 }; + CvMatND* mat = cvCreateMatND(3, size, CV_32F); + CvMat row_header, *row; + row = (CvMat*)cvReshapeMatND(mat, sizeof(row_header), &row_header, 0, 1, 0); +@endcode +In C, the header file for this function includes a convenient macro cvReshapeND that does away with +the sizeof_header parameter. So, the lines containing the call to cvReshapeMatND in the examples +may be replaced as follow: +@code + gray_img = (IplImage*)cvReshapeND(color_img, &gray_img_hdr, 1, 0, 0); + ... + row = (CvMat*)cvReshapeND(mat, &row_header, 0, 1, 0); +@endcode +@param arr Input array +@param sizeof_header Size of output header to distinguish between IplImage, CvMat and CvMatND +output headers +@param header Output header to be filled +@param new_cn New number of channels. new_cn = 0 means that the number of channels remains +unchanged. +@param new_dims New number of dimensions. new_dims = 0 means that the number of dimensions +remains the same. +@param new_sizes Array of new dimension sizes. Only new_dims-1 values are used, because the +total number of elements must remain the same. Thus, if new_dims = 1, new_sizes array is not +used. + */ +CVAPI(CvArr*) cvReshapeMatND( const CvArr* arr, + int sizeof_header, CvArr* header, + int new_cn, int new_dims, int* new_sizes ); + +#define cvReshapeND( arr, header, new_cn, new_dims, new_sizes ) \ + cvReshapeMatND( (arr), sizeof(*(header)), (header), \ + (new_cn), (new_dims), (new_sizes)) + +/** @brief Changes shape of matrix/image without copying data. + +The function initializes the CvMat header so that it points to the same data as the original array +but has a different shape - different number of channels, different number of rows, or both. + +The following example code creates one image buffer and two image headers, the first is for a +320x240x3 image and the second is for a 960x240x1 image: +@code + IplImage* color_img = cvCreateImage(cvSize(320,240), IPL_DEPTH_8U, 3); + CvMat gray_mat_hdr; + IplImage gray_img_hdr, *gray_img; + cvReshape(color_img, &gray_mat_hdr, 1); + gray_img = cvGetImage(&gray_mat_hdr, &gray_img_hdr); +@endcode +And the next example converts a 3x3 matrix to a single 1x9 vector: +@code + CvMat* mat = cvCreateMat(3, 3, CV_32F); + CvMat row_header, *row; + row = cvReshape(mat, &row_header, 0, 1); +@endcode +@param arr Input array +@param header Output header to be filled +@param new_cn New number of channels. 'new_cn = 0' means that the number of channels remains +unchanged. +@param new_rows New number of rows. 'new_rows = 0' means that the number of rows remains +unchanged unless it needs to be changed according to new_cn value. +*/ +CVAPI(CvMat*) cvReshape( const CvArr* arr, CvMat* header, + int new_cn, int new_rows CV_DEFAULT(0) ); + +/** Repeats source 2d array several times in both horizontal and + vertical direction to fill destination array */ +CVAPI(void) cvRepeat( const CvArr* src, CvArr* dst ); + +/** @brief Allocates array data + +The function allocates image, matrix or multi-dimensional dense array data. Note that in the case of +matrix types OpenCV allocation functions are used. In the case of IplImage they are used unless +CV_TURN_ON_IPL_COMPATIBILITY() has been called before. In the latter case IPL functions are used +to allocate the data. +@param arr Array header + */ +CVAPI(void) cvCreateData( CvArr* arr ); + +/** @brief Releases array data. + +The function releases the array data. In the case of CvMat or CvMatND it simply calls +cvDecRefData(), that is the function can not deallocate external data. See also the note to +cvCreateData . +@param arr Array header + */ +CVAPI(void) cvReleaseData( CvArr* arr ); + +/** @brief Assigns user data to the array header. + +The function assigns user data to the array header. Header should be initialized before using +cvCreateMatHeader, cvCreateImageHeader, cvCreateMatNDHeader, cvInitMatHeader, +cvInitImageHeader or cvInitMatNDHeader. +@param arr Array header +@param data User data +@param step Full row length in bytes + */ +CVAPI(void) cvSetData( CvArr* arr, void* data, int step ); + +/** @brief Retrieves low-level information about the array. + +The function fills output variables with low-level information about the array data. All output + +parameters are optional, so some of the pointers may be set to NULL. If the array is IplImage with +ROI set, the parameters of ROI are returned. + +The following example shows how to get access to array elements. It computes absolute values of the +array elements : +@code + float* data; + int step; + CvSize size; + + cvGetRawData(array, (uchar**)&data, &step, &size); + step /= sizeof(data[0]); + + for(int y = 0; y < size.height; y++, data += step ) + for(int x = 0; x < size.width; x++ ) + data[x] = (float)fabs(data[x]); +@endcode +@param arr Array header +@param data Output pointer to the whole image origin or ROI origin if ROI is set +@param step Output full row length in bytes +@param roi_size Output ROI size + */ +CVAPI(void) cvGetRawData( const CvArr* arr, uchar** data, + int* step CV_DEFAULT(NULL), + CvSize* roi_size CV_DEFAULT(NULL)); + +/** @brief Returns size of matrix or image ROI. + +The function returns number of rows (CvSize::height) and number of columns (CvSize::width) of the +input matrix or image. In the case of image the size of ROI is returned. +@param arr array header + */ +CVAPI(CvSize) cvGetSize( const CvArr* arr ); + +/** @brief Copies one array to another. + +The function copies selected elements from an input array to an output array: + +\f[\texttt{dst} (I)= \texttt{src} (I) \quad \text{if} \quad \texttt{mask} (I) \ne 0.\f] + +If any of the passed arrays is of IplImage type, then its ROI and COI fields are used. Both arrays +must have the same type, the same number of dimensions, and the same size. The function can also +copy sparse arrays (mask is not supported in this case). +@param src The source array +@param dst The destination array +@param mask Operation mask, 8-bit single channel array; specifies elements of the destination array +to be changed + */ +CVAPI(void) cvCopy( const CvArr* src, CvArr* dst, + const CvArr* mask CV_DEFAULT(NULL) ); + +/** @brief Sets every element of an array to a given value. + +The function copies the scalar value to every selected element of the destination array: +\f[\texttt{arr} (I)= \texttt{value} \quad \text{if} \quad \texttt{mask} (I) \ne 0\f] +If array arr is of IplImage type, then is ROI used, but COI must not be set. +@param arr The destination array +@param value Fill value +@param mask Operation mask, 8-bit single channel array; specifies elements of the destination +array to be changed + */ +CVAPI(void) cvSet( CvArr* arr, CvScalar value, + const CvArr* mask CV_DEFAULT(NULL) ); + +/** @brief Clears the array. + +The function clears the array. In the case of dense arrays (CvMat, CvMatND or IplImage), +cvZero(array) is equivalent to cvSet(array,cvScalarAll(0),0). In the case of sparse arrays all the +elements are removed. +@param arr Array to be cleared + */ +CVAPI(void) cvSetZero( CvArr* arr ); +#define cvZero cvSetZero + + +/** Splits a multi-channel array into the set of single-channel arrays or + extracts particular [color] plane */ +CVAPI(void) cvSplit( const CvArr* src, CvArr* dst0, CvArr* dst1, + CvArr* dst2, CvArr* dst3 ); + +/** Merges a set of single-channel arrays into the single multi-channel array + or inserts one particular [color] plane to the array */ +CVAPI(void) cvMerge( const CvArr* src0, const CvArr* src1, + const CvArr* src2, const CvArr* src3, + CvArr* dst ); + +/** Copies several channels from input arrays to + certain channels of output arrays */ +CVAPI(void) cvMixChannels( const CvArr** src, int src_count, + CvArr** dst, int dst_count, + const int* from_to, int pair_count ); + +/** @brief Converts one array to another with optional linear transformation. + +The function has several different purposes, and thus has several different names. It copies one +array to another with optional scaling, which is performed first, and/or optional type conversion, +performed after: + +\f[\texttt{dst} (I) = \texttt{scale} \texttt{src} (I) + ( \texttt{shift} _0, \texttt{shift} _1,...)\f] + +All the channels of multi-channel arrays are processed independently. + +The type of conversion is done with rounding and saturation, that is if the result of scaling + +conversion can not be represented exactly by a value of the destination array element type, it is +set to the nearest representable value on the real axis. +@param src Source array +@param dst Destination array +@param scale Scale factor +@param shift Value added to the scaled source array elements + */ +CVAPI(void) cvConvertScale( const CvArr* src, CvArr* dst, + double scale CV_DEFAULT(1), + double shift CV_DEFAULT(0) ); +#define cvCvtScale cvConvertScale +#define cvScale cvConvertScale +#define cvConvert( src, dst ) cvConvertScale( (src), (dst), 1, 0 ) + + +/** Performs linear transformation on every source array element, + stores absolute value of the result: + dst(x,y,c) = abs(scale*src(x,y,c)+shift). + destination array must have 8u type. + In other cases one may use cvConvertScale + cvAbsDiffS */ +CVAPI(void) cvConvertScaleAbs( const CvArr* src, CvArr* dst, + double scale CV_DEFAULT(1), + double shift CV_DEFAULT(0) ); +#define cvCvtScaleAbs cvConvertScaleAbs + + +/** checks termination criteria validity and + sets eps to default_eps (if it is not set), + max_iter to default_max_iters (if it is not set) +*/ +CVAPI(CvTermCriteria) cvCheckTermCriteria( CvTermCriteria criteria, + double default_eps, + int default_max_iters ); + +/****************************************************************************************\ +* Arithmetic, logic and comparison operations * +\****************************************************************************************/ + +/** dst(mask) = src1(mask) + src2(mask) */ +CVAPI(void) cvAdd( const CvArr* src1, const CvArr* src2, CvArr* dst, + const CvArr* mask CV_DEFAULT(NULL)); + +/** dst(mask) = src(mask) + value */ +CVAPI(void) cvAddS( const CvArr* src, CvScalar value, CvArr* dst, + const CvArr* mask CV_DEFAULT(NULL)); + +/** dst(mask) = src1(mask) - src2(mask) */ +CVAPI(void) cvSub( const CvArr* src1, const CvArr* src2, CvArr* dst, + const CvArr* mask CV_DEFAULT(NULL)); + +/** dst(mask) = src(mask) - value = src(mask) + (-value) */ +CV_INLINE void cvSubS( const CvArr* src, CvScalar value, CvArr* dst, + const CvArr* mask CV_DEFAULT(NULL)) +{ + cvAddS( src, cvScalar( -value.val[0], -value.val[1], -value.val[2], -value.val[3]), + dst, mask ); +} + +/** dst(mask) = value - src(mask) */ +CVAPI(void) cvSubRS( const CvArr* src, CvScalar value, CvArr* dst, + const CvArr* mask CV_DEFAULT(NULL)); + +/** dst(idx) = src1(idx) * src2(idx) * scale + (scaled element-wise multiplication of 2 arrays) */ +CVAPI(void) cvMul( const CvArr* src1, const CvArr* src2, + CvArr* dst, double scale CV_DEFAULT(1) ); + +/** element-wise division/inversion with scaling: + dst(idx) = src1(idx) * scale / src2(idx) + or dst(idx) = scale / src2(idx) if src1 == 0 */ +CVAPI(void) cvDiv( const CvArr* src1, const CvArr* src2, + CvArr* dst, double scale CV_DEFAULT(1)); + +/** dst = src1 * scale + src2 */ +CVAPI(void) cvScaleAdd( const CvArr* src1, CvScalar scale, + const CvArr* src2, CvArr* dst ); +#define cvAXPY( A, real_scalar, B, C ) cvScaleAdd(A, cvRealScalar(real_scalar), B, C) + +/** dst = src1 * alpha + src2 * beta + gamma */ +CVAPI(void) cvAddWeighted( const CvArr* src1, double alpha, + const CvArr* src2, double beta, + double gamma, CvArr* dst ); + +/** @brief Calculates the dot product of two arrays in Euclidean metrics. + +The function calculates and returns the Euclidean dot product of two arrays. + +\f[src1 \bullet src2 = \sum _I ( \texttt{src1} (I) \texttt{src2} (I))\f] + +In the case of multiple channel arrays, the results for all channels are accumulated. In particular, +cvDotProduct(a,a) where a is a complex vector, will return \f$||\texttt{a}||^2\f$. The function can +process multi-dimensional arrays, row by row, layer by layer, and so on. +@param src1 The first source array +@param src2 The second source array + */ +CVAPI(double) cvDotProduct( const CvArr* src1, const CvArr* src2 ); + +/** dst(idx) = src1(idx) & src2(idx) */ +CVAPI(void) cvAnd( const CvArr* src1, const CvArr* src2, + CvArr* dst, const CvArr* mask CV_DEFAULT(NULL)); + +/** dst(idx) = src(idx) & value */ +CVAPI(void) cvAndS( const CvArr* src, CvScalar value, + CvArr* dst, const CvArr* mask CV_DEFAULT(NULL)); + +/** dst(idx) = src1(idx) | src2(idx) */ +CVAPI(void) cvOr( const CvArr* src1, const CvArr* src2, + CvArr* dst, const CvArr* mask CV_DEFAULT(NULL)); + +/** dst(idx) = src(idx) | value */ +CVAPI(void) cvOrS( const CvArr* src, CvScalar value, + CvArr* dst, const CvArr* mask CV_DEFAULT(NULL)); + +/** dst(idx) = src1(idx) ^ src2(idx) */ +CVAPI(void) cvXor( const CvArr* src1, const CvArr* src2, + CvArr* dst, const CvArr* mask CV_DEFAULT(NULL)); + +/** dst(idx) = src(idx) ^ value */ +CVAPI(void) cvXorS( const CvArr* src, CvScalar value, + CvArr* dst, const CvArr* mask CV_DEFAULT(NULL)); + +/** dst(idx) = ~src(idx) */ +CVAPI(void) cvNot( const CvArr* src, CvArr* dst ); + +/** dst(idx) = lower(idx) <= src(idx) < upper(idx) */ +CVAPI(void) cvInRange( const CvArr* src, const CvArr* lower, + const CvArr* upper, CvArr* dst ); + +/** dst(idx) = lower <= src(idx) < upper */ +CVAPI(void) cvInRangeS( const CvArr* src, CvScalar lower, + CvScalar upper, CvArr* dst ); + +#define CV_CMP_EQ 0 +#define CV_CMP_GT 1 +#define CV_CMP_GE 2 +#define CV_CMP_LT 3 +#define CV_CMP_LE 4 +#define CV_CMP_NE 5 + +/** The comparison operation support single-channel arrays only. + Destination image should be 8uC1 or 8sC1 */ + +/** dst(idx) = src1(idx) _cmp_op_ src2(idx) */ +CVAPI(void) cvCmp( const CvArr* src1, const CvArr* src2, CvArr* dst, int cmp_op ); + +/** dst(idx) = src1(idx) _cmp_op_ value */ +CVAPI(void) cvCmpS( const CvArr* src, double value, CvArr* dst, int cmp_op ); + +/** dst(idx) = min(src1(idx),src2(idx)) */ +CVAPI(void) cvMin( const CvArr* src1, const CvArr* src2, CvArr* dst ); + +/** dst(idx) = max(src1(idx),src2(idx)) */ +CVAPI(void) cvMax( const CvArr* src1, const CvArr* src2, CvArr* dst ); + +/** dst(idx) = min(src(idx),value) */ +CVAPI(void) cvMinS( const CvArr* src, double value, CvArr* dst ); + +/** dst(idx) = max(src(idx),value) */ +CVAPI(void) cvMaxS( const CvArr* src, double value, CvArr* dst ); + +/** dst(x,y,c) = abs(src1(x,y,c) - src2(x,y,c)) */ +CVAPI(void) cvAbsDiff( const CvArr* src1, const CvArr* src2, CvArr* dst ); + +/** dst(x,y,c) = abs(src(x,y,c) - value(c)) */ +CVAPI(void) cvAbsDiffS( const CvArr* src, CvArr* dst, CvScalar value ); +#define cvAbs( src, dst ) cvAbsDiffS( (src), (dst), cvScalarAll(0)) + +/****************************************************************************************\ +* Math operations * +\****************************************************************************************/ + +/** Does cartesian->polar coordinates conversion. + Either of output components (magnitude or angle) is optional */ +CVAPI(void) cvCartToPolar( const CvArr* x, const CvArr* y, + CvArr* magnitude, CvArr* angle CV_DEFAULT(NULL), + int angle_in_degrees CV_DEFAULT(0)); + +/** Does polar->cartesian coordinates conversion. + Either of output components (magnitude or angle) is optional. + If magnitude is missing it is assumed to be all 1's */ +CVAPI(void) cvPolarToCart( const CvArr* magnitude, const CvArr* angle, + CvArr* x, CvArr* y, + int angle_in_degrees CV_DEFAULT(0)); + +/** Does powering: dst(idx) = src(idx)^power */ +CVAPI(void) cvPow( const CvArr* src, CvArr* dst, double power ); + +/** Does exponention: dst(idx) = exp(src(idx)). + Overflow is not handled yet. Underflow is handled. + Maximal relative error is ~7e-6 for single-precision input */ +CVAPI(void) cvExp( const CvArr* src, CvArr* dst ); + +/** Calculates natural logarithms: dst(idx) = log(abs(src(idx))). + Logarithm of 0 gives large negative number(~-700) + Maximal relative error is ~3e-7 for single-precision output +*/ +CVAPI(void) cvLog( const CvArr* src, CvArr* dst ); + +/** Fast arctangent calculation */ +CVAPI(float) cvFastArctan( float y, float x ); + +/** Fast cubic root calculation */ +CVAPI(float) cvCbrt( float value ); + +#define CV_CHECK_RANGE 1 +#define CV_CHECK_QUIET 2 +/** Checks array values for NaNs, Infs or simply for too large numbers + (if CV_CHECK_RANGE is set). If CV_CHECK_QUIET is set, + no runtime errors is raised (function returns zero value in case of "bad" values). + Otherwise cvError is called */ +CVAPI(int) cvCheckArr( const CvArr* arr, int flags CV_DEFAULT(0), + double min_val CV_DEFAULT(0), double max_val CV_DEFAULT(0)); +#define cvCheckArray cvCheckArr + +#define CV_RAND_UNI 0 +#define CV_RAND_NORMAL 1 + +/** @brief Fills an array with random numbers and updates the RNG state. + +The function fills the destination array with uniformly or normally distributed random numbers. +@param rng CvRNG state initialized by cvRNG +@param arr The destination array +@param dist_type Distribution type +> - **CV_RAND_UNI** uniform distribution +> - **CV_RAND_NORMAL** normal or Gaussian distribution +@param param1 The first parameter of the distribution. In the case of a uniform distribution it is +the inclusive lower boundary of the random numbers range. In the case of a normal distribution it +is the mean value of the random numbers. +@param param2 The second parameter of the distribution. In the case of a uniform distribution it +is the exclusive upper boundary of the random numbers range. In the case of a normal distribution +it is the standard deviation of the random numbers. +@sa randu, randn, RNG::fill. + */ +CVAPI(void) cvRandArr( CvRNG* rng, CvArr* arr, int dist_type, + CvScalar param1, CvScalar param2 ); + +CVAPI(void) cvRandShuffle( CvArr* mat, CvRNG* rng, + double iter_factor CV_DEFAULT(1.)); + +#define CV_SORT_EVERY_ROW 0 +#define CV_SORT_EVERY_COLUMN 1 +#define CV_SORT_ASCENDING 0 +#define CV_SORT_DESCENDING 16 + +CVAPI(void) cvSort( const CvArr* src, CvArr* dst CV_DEFAULT(NULL), + CvArr* idxmat CV_DEFAULT(NULL), + int flags CV_DEFAULT(0)); + +/** Finds real roots of a cubic equation */ +CVAPI(int) cvSolveCubic( const CvMat* coeffs, CvMat* roots ); + +/** Finds all real and complex roots of a polynomial equation */ +CVAPI(void) cvSolvePoly(const CvMat* coeffs, CvMat *roots2, + int maxiter CV_DEFAULT(20), int fig CV_DEFAULT(100)); + +/****************************************************************************************\ +* Matrix operations * +\****************************************************************************************/ + +/** @brief Calculates the cross product of two 3D vectors. + +The function calculates the cross product of two 3D vectors: +\f[\texttt{dst} = \texttt{src1} \times \texttt{src2}\f] +or: +\f[\begin{array}{l} \texttt{dst} _1 = \texttt{src1} _2 \texttt{src2} _3 - \texttt{src1} _3 \texttt{src2} _2 \\ \texttt{dst} _2 = \texttt{src1} _3 \texttt{src2} _1 - \texttt{src1} _1 \texttt{src2} _3 \\ \texttt{dst} _3 = \texttt{src1} _1 \texttt{src2} _2 - \texttt{src1} _2 \texttt{src2} _1 \end{array}\f] +@param src1 The first source vector +@param src2 The second source vector +@param dst The destination vector + */ +CVAPI(void) cvCrossProduct( const CvArr* src1, const CvArr* src2, CvArr* dst ); + +/** Matrix transform: dst = A*B + C, C is optional */ +#define cvMatMulAdd( src1, src2, src3, dst ) cvGEMM( (src1), (src2), 1., (src3), 1., (dst), 0 ) +#define cvMatMul( src1, src2, dst ) cvMatMulAdd( (src1), (src2), NULL, (dst)) + +#define CV_GEMM_A_T 1 +#define CV_GEMM_B_T 2 +#define CV_GEMM_C_T 4 +/** Extended matrix transform: + dst = alpha*op(A)*op(B) + beta*op(C), where op(X) is X or X^T */ +CVAPI(void) cvGEMM( const CvArr* src1, const CvArr* src2, double alpha, + const CvArr* src3, double beta, CvArr* dst, + int tABC CV_DEFAULT(0)); +#define cvMatMulAddEx cvGEMM + +/** Transforms each element of source array and stores + resultant vectors in destination array */ +CVAPI(void) cvTransform( const CvArr* src, CvArr* dst, + const CvMat* transmat, + const CvMat* shiftvec CV_DEFAULT(NULL)); +#define cvMatMulAddS cvTransform + +/** Does perspective transform on every element of input array */ +CVAPI(void) cvPerspectiveTransform( const CvArr* src, CvArr* dst, + const CvMat* mat ); + +/** Calculates (A-delta)*(A-delta)^T (order=0) or (A-delta)^T*(A-delta) (order=1) */ +CVAPI(void) cvMulTransposed( const CvArr* src, CvArr* dst, int order, + const CvArr* delta CV_DEFAULT(NULL), + double scale CV_DEFAULT(1.) ); + +/** Tranposes matrix. Square matrices can be transposed in-place */ +CVAPI(void) cvTranspose( const CvArr* src, CvArr* dst ); +#define cvT cvTranspose + +/** Completes the symmetric matrix from the lower (LtoR=0) or from the upper (LtoR!=0) part */ +CVAPI(void) cvCompleteSymm( CvMat* matrix, int LtoR CV_DEFAULT(0) ); + +/** Mirror array data around horizontal (flip=0), + vertical (flip=1) or both(flip=-1) axises: + cvFlip(src) flips images vertically and sequences horizontally (inplace) */ +CVAPI(void) cvFlip( const CvArr* src, CvArr* dst CV_DEFAULT(NULL), + int flip_mode CV_DEFAULT(0)); +#define cvMirror cvFlip + + +#define CV_SVD_MODIFY_A 1 +#define CV_SVD_U_T 2 +#define CV_SVD_V_T 4 + +/** Performs Singular Value Decomposition of a matrix */ +CVAPI(void) cvSVD( CvArr* A, CvArr* W, CvArr* U CV_DEFAULT(NULL), + CvArr* V CV_DEFAULT(NULL), int flags CV_DEFAULT(0)); + +/** Performs Singular Value Back Substitution (solves A*X = B): + flags must be the same as in cvSVD */ +CVAPI(void) cvSVBkSb( const CvArr* W, const CvArr* U, + const CvArr* V, const CvArr* B, + CvArr* X, int flags ); + +#define CV_LU 0 +#define CV_SVD 1 +#define CV_SVD_SYM 2 +#define CV_CHOLESKY 3 +#define CV_QR 4 +#define CV_NORMAL 16 + +/** Inverts matrix */ +CVAPI(double) cvInvert( const CvArr* src, CvArr* dst, + int method CV_DEFAULT(CV_LU)); +#define cvInv cvInvert + +/** Solves linear system (src1)*(dst) = (src2) + (returns 0 if src1 is a singular and CV_LU method is used) */ +CVAPI(int) cvSolve( const CvArr* src1, const CvArr* src2, CvArr* dst, + int method CV_DEFAULT(CV_LU)); + +/** Calculates determinant of input matrix */ +CVAPI(double) cvDet( const CvArr* mat ); + +/** Calculates trace of the matrix (sum of elements on the main diagonal) */ +CVAPI(CvScalar) cvTrace( const CvArr* mat ); + +/** Finds eigen values and vectors of a symmetric matrix */ +CVAPI(void) cvEigenVV( CvArr* mat, CvArr* evects, CvArr* evals, + double eps CV_DEFAULT(0), + int lowindex CV_DEFAULT(-1), + int highindex CV_DEFAULT(-1)); + +///* Finds selected eigen values and vectors of a symmetric matrix */ +//CVAPI(void) cvSelectedEigenVV( CvArr* mat, CvArr* evects, CvArr* evals, +// int lowindex, int highindex ); + +/** Makes an identity matrix (mat_ij = i == j) */ +CVAPI(void) cvSetIdentity( CvArr* mat, CvScalar value CV_DEFAULT(cvRealScalar(1)) ); + +/** Fills matrix with given range of numbers */ +CVAPI(CvArr*) cvRange( CvArr* mat, double start, double end ); + +/** @anchor core_c_CovarFlags +@name Flags for cvCalcCovarMatrix +@see cvCalcCovarMatrix + @{ +*/ + +/** flag for cvCalcCovarMatrix, transpose([v1-avg, v2-avg,...]) * [v1-avg,v2-avg,...] */ +#define CV_COVAR_SCRAMBLED 0 + +/** flag for cvCalcCovarMatrix, [v1-avg, v2-avg,...] * transpose([v1-avg,v2-avg,...]) */ +#define CV_COVAR_NORMAL 1 + +/** flag for cvCalcCovarMatrix, do not calc average (i.e. mean vector) - use the input vector instead + (useful for calculating covariance matrix by parts) */ +#define CV_COVAR_USE_AVG 2 + +/** flag for cvCalcCovarMatrix, scale the covariance matrix coefficients by number of the vectors */ +#define CV_COVAR_SCALE 4 + +/** flag for cvCalcCovarMatrix, all the input vectors are stored in a single matrix, as its rows */ +#define CV_COVAR_ROWS 8 + +/** flag for cvCalcCovarMatrix, all the input vectors are stored in a single matrix, as its columns */ +#define CV_COVAR_COLS 16 + +/** @} */ + +/** Calculates covariation matrix for a set of vectors +@see @ref core_c_CovarFlags "flags" +*/ +CVAPI(void) cvCalcCovarMatrix( const CvArr** vects, int count, + CvArr* cov_mat, CvArr* avg, int flags ); + +#define CV_PCA_DATA_AS_ROW 0 +#define CV_PCA_DATA_AS_COL 1 +#define CV_PCA_USE_AVG 2 +CVAPI(void) cvCalcPCA( const CvArr* data, CvArr* mean, + CvArr* eigenvals, CvArr* eigenvects, int flags ); + +CVAPI(void) cvProjectPCA( const CvArr* data, const CvArr* mean, + const CvArr* eigenvects, CvArr* result ); + +CVAPI(void) cvBackProjectPCA( const CvArr* proj, const CvArr* mean, + const CvArr* eigenvects, CvArr* result ); + +/** Calculates Mahalanobis(weighted) distance */ +CVAPI(double) cvMahalanobis( const CvArr* vec1, const CvArr* vec2, const CvArr* mat ); +#define cvMahalonobis cvMahalanobis + +/****************************************************************************************\ +* Array Statistics * +\****************************************************************************************/ + +/** Finds sum of array elements */ +CVAPI(CvScalar) cvSum( const CvArr* arr ); + +/** Calculates number of non-zero pixels */ +CVAPI(int) cvCountNonZero( const CvArr* arr ); + +/** Calculates mean value of array elements */ +CVAPI(CvScalar) cvAvg( const CvArr* arr, const CvArr* mask CV_DEFAULT(NULL) ); + +/** Calculates mean and standard deviation of pixel values */ +CVAPI(void) cvAvgSdv( const CvArr* arr, CvScalar* mean, CvScalar* std_dev, + const CvArr* mask CV_DEFAULT(NULL) ); + +/** Finds global minimum, maximum and their positions */ +CVAPI(void) cvMinMaxLoc( const CvArr* arr, double* min_val, double* max_val, + CvPoint* min_loc CV_DEFAULT(NULL), + CvPoint* max_loc CV_DEFAULT(NULL), + const CvArr* mask CV_DEFAULT(NULL) ); + +/** @anchor core_c_NormFlags + @name Flags for cvNorm and cvNormalize + @{ +*/ +#define CV_C 1 +#define CV_L1 2 +#define CV_L2 4 +#define CV_NORM_MASK 7 +#define CV_RELATIVE 8 +#define CV_DIFF 16 +#define CV_MINMAX 32 + +#define CV_DIFF_C (CV_DIFF | CV_C) +#define CV_DIFF_L1 (CV_DIFF | CV_L1) +#define CV_DIFF_L2 (CV_DIFF | CV_L2) +#define CV_RELATIVE_C (CV_RELATIVE | CV_C) +#define CV_RELATIVE_L1 (CV_RELATIVE | CV_L1) +#define CV_RELATIVE_L2 (CV_RELATIVE | CV_L2) +/** @} */ + +/** Finds norm, difference norm or relative difference norm for an array (or two arrays) +@see ref core_c_NormFlags "flags" +*/ +CVAPI(double) cvNorm( const CvArr* arr1, const CvArr* arr2 CV_DEFAULT(NULL), + int norm_type CV_DEFAULT(CV_L2), + const CvArr* mask CV_DEFAULT(NULL) ); + +/** @see ref core_c_NormFlags "flags" */ +CVAPI(void) cvNormalize( const CvArr* src, CvArr* dst, + double a CV_DEFAULT(1.), double b CV_DEFAULT(0.), + int norm_type CV_DEFAULT(CV_L2), + const CvArr* mask CV_DEFAULT(NULL) ); + +/** @anchor core_c_ReduceFlags + @name Flags for cvReduce + @{ +*/ +#define CV_REDUCE_SUM 0 +#define CV_REDUCE_AVG 1 +#define CV_REDUCE_MAX 2 +#define CV_REDUCE_MIN 3 +/** @} */ + +/** @see @ref core_c_ReduceFlags "flags" */ +CVAPI(void) cvReduce( const CvArr* src, CvArr* dst, int dim CV_DEFAULT(-1), + int op CV_DEFAULT(CV_REDUCE_SUM) ); + +/****************************************************************************************\ +* Discrete Linear Transforms and Related Functions * +\****************************************************************************************/ + +/** @anchor core_c_DftFlags + @name Flags for cvDFT, cvDCT and cvMulSpectrums + @{ + */ +#define CV_DXT_FORWARD 0 +#define CV_DXT_INVERSE 1 +#define CV_DXT_SCALE 2 /**< divide result by size of array */ +#define CV_DXT_INV_SCALE (CV_DXT_INVERSE + CV_DXT_SCALE) +#define CV_DXT_INVERSE_SCALE CV_DXT_INV_SCALE +#define CV_DXT_ROWS 4 /**< transform each row individually */ +#define CV_DXT_MUL_CONJ 8 /**< conjugate the second argument of cvMulSpectrums */ +/** @} */ + +/** Discrete Fourier Transform: + complex->complex, + real->ccs (forward), + ccs->real (inverse) +@see core_c_DftFlags "flags" +*/ +CVAPI(void) cvDFT( const CvArr* src, CvArr* dst, int flags, + int nonzero_rows CV_DEFAULT(0) ); +#define cvFFT cvDFT + +/** Multiply results of DFTs: DFT(X)*DFT(Y) or DFT(X)*conj(DFT(Y)) +@see core_c_DftFlags "flags" +*/ +CVAPI(void) cvMulSpectrums( const CvArr* src1, const CvArr* src2, + CvArr* dst, int flags ); + +/** Finds optimal DFT vector size >= size0 */ +CVAPI(int) cvGetOptimalDFTSize( int size0 ); + +/** Discrete Cosine Transform +@see core_c_DftFlags "flags" +*/ +CVAPI(void) cvDCT( const CvArr* src, CvArr* dst, int flags ); + +/****************************************************************************************\ +* Dynamic data structures * +\****************************************************************************************/ + +/** Calculates length of sequence slice (with support of negative indices). */ +CVAPI(int) cvSliceLength( CvSlice slice, const CvSeq* seq ); + + +/** Creates new memory storage. + block_size == 0 means that default, + somewhat optimal size, is used (currently, it is 64K) */ +CVAPI(CvMemStorage*) cvCreateMemStorage( int block_size CV_DEFAULT(0)); + + +/** Creates a memory storage that will borrow memory blocks from parent storage */ +CVAPI(CvMemStorage*) cvCreateChildMemStorage( CvMemStorage* parent ); + + +/** Releases memory storage. All the children of a parent must be released before + the parent. A child storage returns all the blocks to parent when it is released */ +CVAPI(void) cvReleaseMemStorage( CvMemStorage** storage ); + + +/** Clears memory storage. This is the only way(!!!) (besides cvRestoreMemStoragePos) + to reuse memory allocated for the storage - cvClearSeq,cvClearSet ... + do not free any memory. + A child storage returns all the blocks to the parent when it is cleared */ +CVAPI(void) cvClearMemStorage( CvMemStorage* storage ); + +/** Remember a storage "free memory" position */ +CVAPI(void) cvSaveMemStoragePos( const CvMemStorage* storage, CvMemStoragePos* pos ); + +/** Restore a storage "free memory" position */ +CVAPI(void) cvRestoreMemStoragePos( CvMemStorage* storage, CvMemStoragePos* pos ); + +/** Allocates continuous buffer of the specified size in the storage */ +CVAPI(void*) cvMemStorageAlloc( CvMemStorage* storage, size_t size ); + +/** Allocates string in memory storage */ +CVAPI(CvString) cvMemStorageAllocString( CvMemStorage* storage, const char* ptr, + int len CV_DEFAULT(-1) ); + +/** Creates new empty sequence that will reside in the specified storage */ +CVAPI(CvSeq*) cvCreateSeq( int seq_flags, size_t header_size, + size_t elem_size, CvMemStorage* storage ); + +/** Changes default size (granularity) of sequence blocks. + The default size is ~1Kbyte */ +CVAPI(void) cvSetSeqBlockSize( CvSeq* seq, int delta_elems ); + + +/** Adds new element to the end of sequence. Returns pointer to the element */ +CVAPI(schar*) cvSeqPush( CvSeq* seq, const void* element CV_DEFAULT(NULL)); + + +/** Adds new element to the beginning of sequence. Returns pointer to it */ +CVAPI(schar*) cvSeqPushFront( CvSeq* seq, const void* element CV_DEFAULT(NULL)); + + +/** Removes the last element from sequence and optionally saves it */ +CVAPI(void) cvSeqPop( CvSeq* seq, void* element CV_DEFAULT(NULL)); + + +/** Removes the first element from sequence and optioanally saves it */ +CVAPI(void) cvSeqPopFront( CvSeq* seq, void* element CV_DEFAULT(NULL)); + + +#define CV_FRONT 1 +#define CV_BACK 0 +/** Adds several new elements to the end of sequence */ +CVAPI(void) cvSeqPushMulti( CvSeq* seq, const void* elements, + int count, int in_front CV_DEFAULT(0) ); + +/** Removes several elements from the end of sequence and optionally saves them */ +CVAPI(void) cvSeqPopMulti( CvSeq* seq, void* elements, + int count, int in_front CV_DEFAULT(0) ); + +/** Inserts a new element in the middle of sequence. + cvSeqInsert(seq,0,elem) == cvSeqPushFront(seq,elem) */ +CVAPI(schar*) cvSeqInsert( CvSeq* seq, int before_index, + const void* element CV_DEFAULT(NULL)); + +/** Removes specified sequence element */ +CVAPI(void) cvSeqRemove( CvSeq* seq, int index ); + + +/** Removes all the elements from the sequence. The freed memory + can be reused later only by the same sequence unless cvClearMemStorage + or cvRestoreMemStoragePos is called */ +CVAPI(void) cvClearSeq( CvSeq* seq ); + + +/** Retrieves pointer to specified sequence element. + Negative indices are supported and mean counting from the end + (e.g -1 means the last sequence element) */ +CVAPI(schar*) cvGetSeqElem( const CvSeq* seq, int index ); + +/** Calculates index of the specified sequence element. + Returns -1 if element does not belong to the sequence */ +CVAPI(int) cvSeqElemIdx( const CvSeq* seq, const void* element, + CvSeqBlock** block CV_DEFAULT(NULL) ); + +/** Initializes sequence writer. The new elements will be added to the end of sequence */ +CVAPI(void) cvStartAppendToSeq( CvSeq* seq, CvSeqWriter* writer ); + + +/** Combination of cvCreateSeq and cvStartAppendToSeq */ +CVAPI(void) cvStartWriteSeq( int seq_flags, int header_size, + int elem_size, CvMemStorage* storage, + CvSeqWriter* writer ); + +/** Closes sequence writer, updates sequence header and returns pointer + to the resultant sequence + (which may be useful if the sequence was created using cvStartWriteSeq)) +*/ +CVAPI(CvSeq*) cvEndWriteSeq( CvSeqWriter* writer ); + + +/** Updates sequence header. May be useful to get access to some of previously + written elements via cvGetSeqElem or sequence reader */ +CVAPI(void) cvFlushSeqWriter( CvSeqWriter* writer ); + + +/** Initializes sequence reader. + The sequence can be read in forward or backward direction */ +CVAPI(void) cvStartReadSeq( const CvSeq* seq, CvSeqReader* reader, + int reverse CV_DEFAULT(0) ); + + +/** Returns current sequence reader position (currently observed sequence element) */ +CVAPI(int) cvGetSeqReaderPos( CvSeqReader* reader ); + + +/** Changes sequence reader position. It may seek to an absolute or + to relative to the current position */ +CVAPI(void) cvSetSeqReaderPos( CvSeqReader* reader, int index, + int is_relative CV_DEFAULT(0)); + +/** Copies sequence content to a continuous piece of memory */ +CVAPI(void*) cvCvtSeqToArray( const CvSeq* seq, void* elements, + CvSlice slice CV_DEFAULT(CV_WHOLE_SEQ) ); + +/** Creates sequence header for array. + After that all the operations on sequences that do not alter the content + can be applied to the resultant sequence */ +CVAPI(CvSeq*) cvMakeSeqHeaderForArray( int seq_type, int header_size, + int elem_size, void* elements, int total, + CvSeq* seq, CvSeqBlock* block ); + +/** Extracts sequence slice (with or without copying sequence elements) */ +CVAPI(CvSeq*) cvSeqSlice( const CvSeq* seq, CvSlice slice, + CvMemStorage* storage CV_DEFAULT(NULL), + int copy_data CV_DEFAULT(0)); + +CV_INLINE CvSeq* cvCloneSeq( const CvSeq* seq, CvMemStorage* storage CV_DEFAULT(NULL)) +{ + return cvSeqSlice( seq, CV_WHOLE_SEQ, storage, 1 ); +} + +/** Removes sequence slice */ +CVAPI(void) cvSeqRemoveSlice( CvSeq* seq, CvSlice slice ); + +/** Inserts a sequence or array into another sequence */ +CVAPI(void) cvSeqInsertSlice( CvSeq* seq, int before_index, const CvArr* from_arr ); + +/** a < b ? -1 : a > b ? 1 : 0 */ +typedef int (CV_CDECL* CvCmpFunc)(const void* a, const void* b, void* userdata ); + +/** Sorts sequence in-place given element comparison function */ +CVAPI(void) cvSeqSort( CvSeq* seq, CvCmpFunc func, void* userdata CV_DEFAULT(NULL) ); + +/** Finds element in a [sorted] sequence */ +CVAPI(schar*) cvSeqSearch( CvSeq* seq, const void* elem, CvCmpFunc func, + int is_sorted, int* elem_idx, + void* userdata CV_DEFAULT(NULL) ); + +/** Reverses order of sequence elements in-place */ +CVAPI(void) cvSeqInvert( CvSeq* seq ); + +/** Splits sequence into one or more equivalence classes using the specified criteria */ +CVAPI(int) cvSeqPartition( const CvSeq* seq, CvMemStorage* storage, + CvSeq** labels, CvCmpFunc is_equal, void* userdata ); + +/************ Internal sequence functions ************/ +CVAPI(void) cvChangeSeqBlock( void* reader, int direction ); +CVAPI(void) cvCreateSeqBlock( CvSeqWriter* writer ); + + +/** Creates a new set */ +CVAPI(CvSet*) cvCreateSet( int set_flags, int header_size, + int elem_size, CvMemStorage* storage ); + +/** Adds new element to the set and returns pointer to it */ +CVAPI(int) cvSetAdd( CvSet* set_header, CvSetElem* elem CV_DEFAULT(NULL), + CvSetElem** inserted_elem CV_DEFAULT(NULL) ); + +/** Fast variant of cvSetAdd */ +CV_INLINE CvSetElem* cvSetNew( CvSet* set_header ) +{ + CvSetElem* elem = set_header->free_elems; + if( elem ) + { + set_header->free_elems = elem->next_free; + elem->flags = elem->flags & CV_SET_ELEM_IDX_MASK; + set_header->active_count++; + } + else + cvSetAdd( set_header, NULL, &elem ); + return elem; +} + +/** Removes set element given its pointer */ +CV_INLINE void cvSetRemoveByPtr( CvSet* set_header, void* elem ) +{ + CvSetElem* _elem = (CvSetElem*)elem; + assert( _elem->flags >= 0 /*&& (elem->flags & CV_SET_ELEM_IDX_MASK) < set_header->total*/ ); + _elem->next_free = set_header->free_elems; + _elem->flags = (_elem->flags & CV_SET_ELEM_IDX_MASK) | CV_SET_ELEM_FREE_FLAG; + set_header->free_elems = _elem; + set_header->active_count--; +} + +/** Removes element from the set by its index */ +CVAPI(void) cvSetRemove( CvSet* set_header, int index ); + +/** Returns a set element by index. If the element doesn't belong to the set, + NULL is returned */ +CV_INLINE CvSetElem* cvGetSetElem( const CvSet* set_header, int idx ) +{ + CvSetElem* elem = (CvSetElem*)(void *)cvGetSeqElem( (CvSeq*)set_header, idx ); + return elem && CV_IS_SET_ELEM( elem ) ? elem : 0; +} + +/** Removes all the elements from the set */ +CVAPI(void) cvClearSet( CvSet* set_header ); + +/** Creates new graph */ +CVAPI(CvGraph*) cvCreateGraph( int graph_flags, int header_size, + int vtx_size, int edge_size, + CvMemStorage* storage ); + +/** Adds new vertex to the graph */ +CVAPI(int) cvGraphAddVtx( CvGraph* graph, const CvGraphVtx* vtx CV_DEFAULT(NULL), + CvGraphVtx** inserted_vtx CV_DEFAULT(NULL) ); + + +/** Removes vertex from the graph together with all incident edges */ +CVAPI(int) cvGraphRemoveVtx( CvGraph* graph, int index ); +CVAPI(int) cvGraphRemoveVtxByPtr( CvGraph* graph, CvGraphVtx* vtx ); + + +/** Link two vertices specifed by indices or pointers if they + are not connected or return pointer to already existing edge + connecting the vertices. + Functions return 1 if a new edge was created, 0 otherwise */ +CVAPI(int) cvGraphAddEdge( CvGraph* graph, + int start_idx, int end_idx, + const CvGraphEdge* edge CV_DEFAULT(NULL), + CvGraphEdge** inserted_edge CV_DEFAULT(NULL) ); + +CVAPI(int) cvGraphAddEdgeByPtr( CvGraph* graph, + CvGraphVtx* start_vtx, CvGraphVtx* end_vtx, + const CvGraphEdge* edge CV_DEFAULT(NULL), + CvGraphEdge** inserted_edge CV_DEFAULT(NULL) ); + +/** Remove edge connecting two vertices */ +CVAPI(void) cvGraphRemoveEdge( CvGraph* graph, int start_idx, int end_idx ); +CVAPI(void) cvGraphRemoveEdgeByPtr( CvGraph* graph, CvGraphVtx* start_vtx, + CvGraphVtx* end_vtx ); + +/** Find edge connecting two vertices */ +CVAPI(CvGraphEdge*) cvFindGraphEdge( const CvGraph* graph, int start_idx, int end_idx ); +CVAPI(CvGraphEdge*) cvFindGraphEdgeByPtr( const CvGraph* graph, + const CvGraphVtx* start_vtx, + const CvGraphVtx* end_vtx ); +#define cvGraphFindEdge cvFindGraphEdge +#define cvGraphFindEdgeByPtr cvFindGraphEdgeByPtr + +/** Remove all vertices and edges from the graph */ +CVAPI(void) cvClearGraph( CvGraph* graph ); + + +/** Count number of edges incident to the vertex */ +CVAPI(int) cvGraphVtxDegree( const CvGraph* graph, int vtx_idx ); +CVAPI(int) cvGraphVtxDegreeByPtr( const CvGraph* graph, const CvGraphVtx* vtx ); + + +/** Retrieves graph vertex by given index */ +#define cvGetGraphVtx( graph, idx ) (CvGraphVtx*)cvGetSetElem((CvSet*)(graph), (idx)) + +/** Retrieves index of a graph vertex given its pointer */ +#define cvGraphVtxIdx( graph, vtx ) ((vtx)->flags & CV_SET_ELEM_IDX_MASK) + +/** Retrieves index of a graph edge given its pointer */ +#define cvGraphEdgeIdx( graph, edge ) ((edge)->flags & CV_SET_ELEM_IDX_MASK) + +#define cvGraphGetVtxCount( graph ) ((graph)->active_count) +#define cvGraphGetEdgeCount( graph ) ((graph)->edges->active_count) + +#define CV_GRAPH_VERTEX 1 +#define CV_GRAPH_TREE_EDGE 2 +#define CV_GRAPH_BACK_EDGE 4 +#define CV_GRAPH_FORWARD_EDGE 8 +#define CV_GRAPH_CROSS_EDGE 16 +#define CV_GRAPH_ANY_EDGE 30 +#define CV_GRAPH_NEW_TREE 32 +#define CV_GRAPH_BACKTRACKING 64 +#define CV_GRAPH_OVER -1 + +#define CV_GRAPH_ALL_ITEMS -1 + +/** flags for graph vertices and edges */ +#define CV_GRAPH_ITEM_VISITED_FLAG (1 << 30) +#define CV_IS_GRAPH_VERTEX_VISITED(vtx) \ + (((CvGraphVtx*)(vtx))->flags & CV_GRAPH_ITEM_VISITED_FLAG) +#define CV_IS_GRAPH_EDGE_VISITED(edge) \ + (((CvGraphEdge*)(edge))->flags & CV_GRAPH_ITEM_VISITED_FLAG) +#define CV_GRAPH_SEARCH_TREE_NODE_FLAG (1 << 29) +#define CV_GRAPH_FORWARD_EDGE_FLAG (1 << 28) + +typedef struct CvGraphScanner +{ + CvGraphVtx* vtx; /* current graph vertex (or current edge origin) */ + CvGraphVtx* dst; /* current graph edge destination vertex */ + CvGraphEdge* edge; /* current edge */ + + CvGraph* graph; /* the graph */ + CvSeq* stack; /* the graph vertex stack */ + int index; /* the lower bound of certainly visited vertices */ + int mask; /* event mask */ +} +CvGraphScanner; + +/** Creates new graph scanner. */ +CVAPI(CvGraphScanner*) cvCreateGraphScanner( CvGraph* graph, + CvGraphVtx* vtx CV_DEFAULT(NULL), + int mask CV_DEFAULT(CV_GRAPH_ALL_ITEMS)); + +/** Releases graph scanner. */ +CVAPI(void) cvReleaseGraphScanner( CvGraphScanner** scanner ); + +/** Get next graph element */ +CVAPI(int) cvNextGraphItem( CvGraphScanner* scanner ); + +/** Creates a copy of graph */ +CVAPI(CvGraph*) cvCloneGraph( const CvGraph* graph, CvMemStorage* storage ); + + +/** Does look-up transformation. Elements of the source array + (that should be 8uC1 or 8sC1) are used as indexes in lutarr 256-element table */ +CVAPI(void) cvLUT( const CvArr* src, CvArr* dst, const CvArr* lut ); + + +/******************* Iteration through the sequence tree *****************/ +typedef struct CvTreeNodeIterator +{ + const void* node; + int level; + int max_level; +} +CvTreeNodeIterator; + +CVAPI(void) cvInitTreeNodeIterator( CvTreeNodeIterator* tree_iterator, + const void* first, int max_level ); +CVAPI(void*) cvNextTreeNode( CvTreeNodeIterator* tree_iterator ); +CVAPI(void*) cvPrevTreeNode( CvTreeNodeIterator* tree_iterator ); + +/** Inserts sequence into tree with specified "parent" sequence. + If parent is equal to frame (e.g. the most external contour), + then added contour will have null pointer to parent. */ +CVAPI(void) cvInsertNodeIntoTree( void* node, void* parent, void* frame ); + +/** Removes contour from tree (together with the contour children). */ +CVAPI(void) cvRemoveNodeFromTree( void* node, void* frame ); + +/** Gathers pointers to all the sequences, + accessible from the `first`, to the single sequence */ +CVAPI(CvSeq*) cvTreeToNodeSeq( const void* first, int header_size, + CvMemStorage* storage ); + +/** The function implements the K-means algorithm for clustering an array of sample + vectors in a specified number of classes */ +#define CV_KMEANS_USE_INITIAL_LABELS 1 +CVAPI(int) cvKMeans2( const CvArr* samples, int cluster_count, CvArr* labels, + CvTermCriteria termcrit, int attempts CV_DEFAULT(1), + CvRNG* rng CV_DEFAULT(0), int flags CV_DEFAULT(0), + CvArr* _centers CV_DEFAULT(0), double* compactness CV_DEFAULT(0) ); + +/****************************************************************************************\ +* System functions * +\****************************************************************************************/ + +/** Loads optimized functions from IPP, MKL etc. or switches back to pure C code */ +CVAPI(int) cvUseOptimized( int on_off ); + +typedef IplImage* (CV_STDCALL* Cv_iplCreateImageHeader) + (int,int,int,char*,char*,int,int,int,int,int, + IplROI*,IplImage*,void*,IplTileInfo*); +typedef void (CV_STDCALL* Cv_iplAllocateImageData)(IplImage*,int,int); +typedef void (CV_STDCALL* Cv_iplDeallocate)(IplImage*,int); +typedef IplROI* (CV_STDCALL* Cv_iplCreateROI)(int,int,int,int,int); +typedef IplImage* (CV_STDCALL* Cv_iplCloneImage)(const IplImage*); + +/** @brief Makes OpenCV use IPL functions for allocating IplImage and IplROI structures. + +Normally, the function is not called directly. Instead, a simple macro +CV_TURN_ON_IPL_COMPATIBILITY() is used that calls cvSetIPLAllocators and passes there pointers +to IPL allocation functions. : +@code + ... + CV_TURN_ON_IPL_COMPATIBILITY() + ... +@endcode +@param create_header pointer to a function, creating IPL image header. +@param allocate_data pointer to a function, allocating IPL image data. +@param deallocate pointer to a function, deallocating IPL image. +@param create_roi pointer to a function, creating IPL image ROI (i.e. Region of Interest). +@param clone_image pointer to a function, cloning an IPL image. + */ +CVAPI(void) cvSetIPLAllocators( Cv_iplCreateImageHeader create_header, + Cv_iplAllocateImageData allocate_data, + Cv_iplDeallocate deallocate, + Cv_iplCreateROI create_roi, + Cv_iplCloneImage clone_image ); + +#define CV_TURN_ON_IPL_COMPATIBILITY() \ + cvSetIPLAllocators( iplCreateImageHeader, iplAllocateImage, \ + iplDeallocate, iplCreateROI, iplCloneImage ) + +/****************************************************************************************\ +* Data Persistence * +\****************************************************************************************/ + +/********************************** High-level functions ********************************/ + +/** @brief Opens file storage for reading or writing data. + +The function opens file storage for reading or writing data. In the latter case, a new file is +created or an existing file is rewritten. The type of the read or written file is determined by the +filename extension: .xml for XML and .yml or .yaml for YAML. The function returns a pointer to the +CvFileStorage structure. If the file cannot be opened then the function returns NULL. +@param filename Name of the file associated with the storage +@param memstorage Memory storage used for temporary data and for +: storing dynamic structures, such as CvSeq or CvGraph . If it is NULL, a temporary memory + storage is created and used. +@param flags Can be one of the following: +> - **CV_STORAGE_READ** the storage is open for reading +> - **CV_STORAGE_WRITE** the storage is open for writing +@param encoding + */ +CVAPI(CvFileStorage*) cvOpenFileStorage( const char* filename, CvMemStorage* memstorage, + int flags, const char* encoding CV_DEFAULT(NULL) ); + +/** @brief Releases file storage. + +The function closes the file associated with the storage and releases all the temporary structures. +It must be called after all I/O operations with the storage are finished. +@param fs Double pointer to the released file storage + */ +CVAPI(void) cvReleaseFileStorage( CvFileStorage** fs ); + +/** returns attribute value or 0 (NULL) if there is no such attribute */ +CVAPI(const char*) cvAttrValue( const CvAttrList* attr, const char* attr_name ); + +/** @brief Starts writing a new structure. + +The function starts writing a compound structure (collection) that can be a sequence or a map. After +all the structure fields, which can be scalars or structures, are written, cvEndWriteStruct should +be called. The function can be used to group some objects or to implement the write function for a +some user object (see CvTypeInfo). +@param fs File storage +@param name Name of the written structure. The structure can be accessed by this name when the +storage is read. +@param struct_flags A combination one of the following values: +- **CV_NODE_SEQ** the written structure is a sequence (see discussion of CvFileStorage ), + that is, its elements do not have a name. +- **CV_NODE_MAP** the written structure is a map (see discussion of CvFileStorage ), that + is, all its elements have names. +One and only one of the two above flags must be specified +- **CV_NODE_FLOW** the optional flag that makes sense only for YAML streams. It means that + the structure is written as a flow (not as a block), which is more compact. It is + recommended to use this flag for structures or arrays whose elements are all scalars. +@param type_name Optional parameter - the object type name. In + case of XML it is written as a type_id attribute of the structure opening tag. In the case of + YAML it is written after a colon following the structure name (see the example in + CvFileStorage description). Mainly it is used with user objects. When the storage is read, the + encoded type name is used to determine the object type (see CvTypeInfo and cvFindType ). +@param attributes This parameter is not used in the current implementation + */ +CVAPI(void) cvStartWriteStruct( CvFileStorage* fs, const char* name, + int struct_flags, const char* type_name CV_DEFAULT(NULL), + CvAttrList attributes CV_DEFAULT(cvAttrList())); + +/** @brief Finishes writing to a file node collection. +@param fs File storage +@sa cvStartWriteStruct. + */ +CVAPI(void) cvEndWriteStruct( CvFileStorage* fs ); + +/** @brief Writes an integer value. + +The function writes a single integer value (with or without a name) to the file storage. +@param fs File storage +@param name Name of the written value. Should be NULL if and only if the parent structure is a +sequence. +@param value The written value + */ +CVAPI(void) cvWriteInt( CvFileStorage* fs, const char* name, int value ); + +/** @brief Writes a floating-point value. + +The function writes a single floating-point value (with or without a name) to file storage. Special +values are encoded as follows: NaN (Not A Number) as .NaN, infinity as +.Inf or -.Inf. + +The following example shows how to use the low-level writing functions to store custom structures, +such as termination criteria, without registering a new type. : +@code + void write_termcriteria( CvFileStorage* fs, const char* struct_name, + CvTermCriteria* termcrit ) + { + cvStartWriteStruct( fs, struct_name, CV_NODE_MAP, NULL, cvAttrList(0,0)); + cvWriteComment( fs, "termination criteria", 1 ); // just a description + if( termcrit->type & CV_TERMCRIT_ITER ) + cvWriteInteger( fs, "max_iterations", termcrit->max_iter ); + if( termcrit->type & CV_TERMCRIT_EPS ) + cvWriteReal( fs, "accuracy", termcrit->epsilon ); + cvEndWriteStruct( fs ); + } +@endcode +@param fs File storage +@param name Name of the written value. Should be NULL if and only if the parent structure is a +sequence. +@param value The written value +*/ +CVAPI(void) cvWriteReal( CvFileStorage* fs, const char* name, double value ); + +/** @brief Writes a text string. + +The function writes a text string to file storage. +@param fs File storage +@param name Name of the written string . Should be NULL if and only if the parent structure is a +sequence. +@param str The written text string +@param quote If non-zero, the written string is put in quotes, regardless of whether they are +required. Otherwise, if the flag is zero, quotes are used only when they are required (e.g. when +the string starts with a digit or contains spaces). + */ +CVAPI(void) cvWriteString( CvFileStorage* fs, const char* name, + const char* str, int quote CV_DEFAULT(0) ); + +/** @brief Writes a comment. + +The function writes a comment into file storage. The comments are skipped when the storage is read. +@param fs File storage +@param comment The written comment, single-line or multi-line +@param eol_comment If non-zero, the function tries to put the comment at the end of current line. +If the flag is zero, if the comment is multi-line, or if it does not fit at the end of the current +line, the comment starts a new line. + */ +CVAPI(void) cvWriteComment( CvFileStorage* fs, const char* comment, + int eol_comment ); + +/** @brief Writes an object to file storage. + +The function writes an object to file storage. First, the appropriate type info is found using +cvTypeOf. Then, the write method associated with the type info is called. + +Attributes are used to customize the writing procedure. The standard types support the following +attributes (all the dt attributes have the same format as in cvWriteRawData): + +-# CvSeq + - **header_dt** description of user fields of the sequence header that follow CvSeq, or + CvChain (if the sequence is a Freeman chain) or CvContour (if the sequence is a contour or + point sequence) + - **dt** description of the sequence elements. + - **recursive** if the attribute is present and is not equal to "0" or "false", the whole + tree of sequences (contours) is stored. +-# CvGraph + - **header_dt** description of user fields of the graph header that follows CvGraph; + - **vertex_dt** description of user fields of graph vertices + - **edge_dt** description of user fields of graph edges (note that the edge weight is + always written, so there is no need to specify it explicitly) + +Below is the code that creates the YAML file shown in the CvFileStorage description: +@code + #include "cxcore.h" + + int main( int argc, char** argv ) + { + CvMat* mat = cvCreateMat( 3, 3, CV_32F ); + CvFileStorage* fs = cvOpenFileStorage( "example.yml", 0, CV_STORAGE_WRITE ); + + cvSetIdentity( mat ); + cvWrite( fs, "A", mat, cvAttrList(0,0) ); + + cvReleaseFileStorage( &fs ); + cvReleaseMat( &mat ); + return 0; + } +@endcode +@param fs File storage +@param name Name of the written object. Should be NULL if and only if the parent structure is a +sequence. +@param ptr Pointer to the object +@param attributes The attributes of the object. They are specific for each particular type (see +the discussion below). + */ +CVAPI(void) cvWrite( CvFileStorage* fs, const char* name, const void* ptr, + CvAttrList attributes CV_DEFAULT(cvAttrList())); + +/** @brief Starts the next stream. + +The function finishes the currently written stream and starts the next stream. In the case of XML +the file with multiple streams looks like this: +@code{.xml} + + + + + + + ... +@endcode +The YAML file will look like this: +@code{.yaml} + %YAML:1.0 + # stream #1 data + ... + --- + # stream #2 data +@endcode +This is useful for concatenating files or for resuming the writing process. +@param fs File storage + */ +CVAPI(void) cvStartNextStream( CvFileStorage* fs ); + +/** @brief Writes multiple numbers. + +The function writes an array, whose elements consist of single or multiple numbers. The function +call can be replaced with a loop containing a few cvWriteInt and cvWriteReal calls, but a single +call is more efficient. Note that because none of the elements have a name, they should be written +to a sequence rather than a map. +@param fs File storage +@param src Pointer to the written array +@param len Number of the array elements to write +@param dt Specification of each array element, see @ref format_spec "format specification" + */ +CVAPI(void) cvWriteRawData( CvFileStorage* fs, const void* src, + int len, const char* dt ); + +/** @brief Returns a unique pointer for a given name. + +The function returns a unique pointer for each particular file node name. This pointer can be then +passed to the cvGetFileNode function that is faster than cvGetFileNodeByName because it compares +text strings by comparing pointers rather than the strings' content. + +Consider the following example where an array of points is encoded as a sequence of 2-entry maps: +@code + points: + - { x: 10, y: 10 } + - { x: 20, y: 20 } + - { x: 30, y: 30 } + # ... +@endcode +Then, it is possible to get hashed "x" and "y" pointers to speed up decoding of the points. : +@code + #include "cxcore.h" + + int main( int argc, char** argv ) + { + CvFileStorage* fs = cvOpenFileStorage( "points.yml", 0, CV_STORAGE_READ ); + CvStringHashNode* x_key = cvGetHashedNode( fs, "x", -1, 1 ); + CvStringHashNode* y_key = cvGetHashedNode( fs, "y", -1, 1 ); + CvFileNode* points = cvGetFileNodeByName( fs, 0, "points" ); + + if( CV_NODE_IS_SEQ(points->tag) ) + { + CvSeq* seq = points->data.seq; + int i, total = seq->total; + CvSeqReader reader; + cvStartReadSeq( seq, &reader, 0 ); + for( i = 0; i < total; i++ ) + { + CvFileNode* pt = (CvFileNode*)reader.ptr; + #if 1 // faster variant + CvFileNode* xnode = cvGetFileNode( fs, pt, x_key, 0 ); + CvFileNode* ynode = cvGetFileNode( fs, pt, y_key, 0 ); + assert( xnode && CV_NODE_IS_INT(xnode->tag) && + ynode && CV_NODE_IS_INT(ynode->tag)); + int x = xnode->data.i; // or x = cvReadInt( xnode, 0 ); + int y = ynode->data.i; // or y = cvReadInt( ynode, 0 ); + #elif 1 // slower variant; does not use x_key & y_key + CvFileNode* xnode = cvGetFileNodeByName( fs, pt, "x" ); + CvFileNode* ynode = cvGetFileNodeByName( fs, pt, "y" ); + assert( xnode && CV_NODE_IS_INT(xnode->tag) && + ynode && CV_NODE_IS_INT(ynode->tag)); + int x = xnode->data.i; // or x = cvReadInt( xnode, 0 ); + int y = ynode->data.i; // or y = cvReadInt( ynode, 0 ); + #else // the slowest yet the easiest to use variant + int x = cvReadIntByName( fs, pt, "x", 0 ); + int y = cvReadIntByName( fs, pt, "y", 0 ); + #endif + CV_NEXT_SEQ_ELEM( seq->elem_size, reader ); + printf(" + } + } + cvReleaseFileStorage( &fs ); + return 0; + } +@endcode +Please note that whatever method of accessing a map you are using, it is still much slower than +using plain sequences; for example, in the above example, it is more efficient to encode the points +as pairs of integers in a single numeric sequence. +@param fs File storage +@param name Literal node name +@param len Length of the name (if it is known apriori), or -1 if it needs to be calculated +@param create_missing Flag that specifies, whether an absent key should be added into the hash table +*/ +CVAPI(CvStringHashNode*) cvGetHashedKey( CvFileStorage* fs, const char* name, + int len CV_DEFAULT(-1), + int create_missing CV_DEFAULT(0)); + +/** @brief Retrieves one of the top-level nodes of the file storage. + +The function returns one of the top-level file nodes. The top-level nodes do not have a name, they +correspond to the streams that are stored one after another in the file storage. If the index is out +of range, the function returns a NULL pointer, so all the top-level nodes can be iterated by +subsequent calls to the function with stream_index=0,1,..., until the NULL pointer is returned. +This function can be used as a base for recursive traversal of the file storage. +@param fs File storage +@param stream_index Zero-based index of the stream. See cvStartNextStream . In most cases, +there is only one stream in the file; however, there can be several. + */ +CVAPI(CvFileNode*) cvGetRootFileNode( const CvFileStorage* fs, + int stream_index CV_DEFAULT(0) ); + +/** @brief Finds a node in a map or file storage. + +The function finds a file node. It is a faster version of cvGetFileNodeByName (see +cvGetHashedKey discussion). Also, the function can insert a new node, if it is not in the map yet. +@param fs File storage +@param map The parent map. If it is NULL, the function searches a top-level node. If both map and +key are NULLs, the function returns the root file node - a map that contains top-level nodes. +@param key Unique pointer to the node name, retrieved with cvGetHashedKey +@param create_missing Flag that specifies whether an absent node should be added to the map + */ +CVAPI(CvFileNode*) cvGetFileNode( CvFileStorage* fs, CvFileNode* map, + const CvStringHashNode* key, + int create_missing CV_DEFAULT(0) ); + +/** @brief Finds a node in a map or file storage. + +The function finds a file node by name. The node is searched either in map or, if the pointer is +NULL, among the top-level file storage nodes. Using this function for maps and cvGetSeqElem (or +sequence reader) for sequences, it is possible to navigate through the file storage. To speed up +multiple queries for a certain key (e.g., in the case of an array of structures) one may use a +combination of cvGetHashedKey and cvGetFileNode. +@param fs File storage +@param map The parent map. If it is NULL, the function searches in all the top-level nodes +(streams), starting with the first one. +@param name The file node name + */ +CVAPI(CvFileNode*) cvGetFileNodeByName( const CvFileStorage* fs, + const CvFileNode* map, + const char* name ); + +/** @brief Retrieves an integer value from a file node. + +The function returns an integer that is represented by the file node. If the file node is NULL, the +default_value is returned (thus, it is convenient to call the function right after cvGetFileNode +without checking for a NULL pointer). If the file node has type CV_NODE_INT, then node-\>data.i is +returned. If the file node has type CV_NODE_REAL, then node-\>data.f is converted to an integer +and returned. Otherwise the error is reported. +@param node File node +@param default_value The value that is returned if node is NULL + */ +CV_INLINE int cvReadInt( const CvFileNode* node, int default_value CV_DEFAULT(0) ) +{ + return !node ? default_value : + CV_NODE_IS_INT(node->tag) ? node->data.i : + CV_NODE_IS_REAL(node->tag) ? cvRound(node->data.f) : 0x7fffffff; +} + +/** @brief Finds a file node and returns its value. + +The function is a simple superposition of cvGetFileNodeByName and cvReadInt. +@param fs File storage +@param map The parent map. If it is NULL, the function searches a top-level node. +@param name The node name +@param default_value The value that is returned if the file node is not found + */ +CV_INLINE int cvReadIntByName( const CvFileStorage* fs, const CvFileNode* map, + const char* name, int default_value CV_DEFAULT(0) ) +{ + return cvReadInt( cvGetFileNodeByName( fs, map, name ), default_value ); +} + +/** @brief Retrieves a floating-point value from a file node. + +The function returns a floating-point value that is represented by the file node. If the file node +is NULL, the default_value is returned (thus, it is convenient to call the function right after +cvGetFileNode without checking for a NULL pointer). If the file node has type CV_NODE_REAL , +then node-\>data.f is returned. If the file node has type CV_NODE_INT , then node-:math:\>data.f +is converted to floating-point and returned. Otherwise the result is not determined. +@param node File node +@param default_value The value that is returned if node is NULL + */ +CV_INLINE double cvReadReal( const CvFileNode* node, double default_value CV_DEFAULT(0.) ) +{ + return !node ? default_value : + CV_NODE_IS_INT(node->tag) ? (double)node->data.i : + CV_NODE_IS_REAL(node->tag) ? node->data.f : 1e300; +} + +/** @brief Finds a file node and returns its value. + +The function is a simple superposition of cvGetFileNodeByName and cvReadReal . +@param fs File storage +@param map The parent map. If it is NULL, the function searches a top-level node. +@param name The node name +@param default_value The value that is returned if the file node is not found + */ +CV_INLINE double cvReadRealByName( const CvFileStorage* fs, const CvFileNode* map, + const char* name, double default_value CV_DEFAULT(0.) ) +{ + return cvReadReal( cvGetFileNodeByName( fs, map, name ), default_value ); +} + +/** @brief Retrieves a text string from a file node. + +The function returns a text string that is represented by the file node. If the file node is NULL, +the default_value is returned (thus, it is convenient to call the function right after +cvGetFileNode without checking for a NULL pointer). If the file node has type CV_NODE_STR , then +node-:math:\>data.str.ptr is returned. Otherwise the result is not determined. +@param node File node +@param default_value The value that is returned if node is NULL + */ +CV_INLINE const char* cvReadString( const CvFileNode* node, + const char* default_value CV_DEFAULT(NULL) ) +{ + return !node ? default_value : CV_NODE_IS_STRING(node->tag) ? node->data.str.ptr : 0; +} + +/** @brief Finds a file node by its name and returns its value. + +The function is a simple superposition of cvGetFileNodeByName and cvReadString . +@param fs File storage +@param map The parent map. If it is NULL, the function searches a top-level node. +@param name The node name +@param default_value The value that is returned if the file node is not found + */ +CV_INLINE const char* cvReadStringByName( const CvFileStorage* fs, const CvFileNode* map, + const char* name, const char* default_value CV_DEFAULT(NULL) ) +{ + return cvReadString( cvGetFileNodeByName( fs, map, name ), default_value ); +} + + +/** @brief Decodes an object and returns a pointer to it. + +The function decodes a user object (creates an object in a native representation from the file +storage subtree) and returns it. The object to be decoded must be an instance of a registered type +that supports the read method (see CvTypeInfo). The type of the object is determined by the type +name that is encoded in the file. If the object is a dynamic structure, it is created either in +memory storage and passed to cvOpenFileStorage or, if a NULL pointer was passed, in temporary +memory storage, which is released when cvReleaseFileStorage is called. Otherwise, if the object is +not a dynamic structure, it is created in a heap and should be released with a specialized function +or by using the generic cvRelease. +@param fs File storage +@param node The root object node +@param attributes Unused parameter + */ +CVAPI(void*) cvRead( CvFileStorage* fs, CvFileNode* node, + CvAttrList* attributes CV_DEFAULT(NULL)); + +/** @brief Finds an object by name and decodes it. + +The function is a simple superposition of cvGetFileNodeByName and cvRead. +@param fs File storage +@param map The parent map. If it is NULL, the function searches a top-level node. +@param name The node name +@param attributes Unused parameter + */ +CV_INLINE void* cvReadByName( CvFileStorage* fs, const CvFileNode* map, + const char* name, CvAttrList* attributes CV_DEFAULT(NULL) ) +{ + return cvRead( fs, cvGetFileNodeByName( fs, map, name ), attributes ); +} + + +/** @brief Initializes the file node sequence reader. + +The function initializes the sequence reader to read data from a file node. The initialized reader +can be then passed to cvReadRawDataSlice. +@param fs File storage +@param src The file node (a sequence) to read numbers from +@param reader Pointer to the sequence reader + */ +CVAPI(void) cvStartReadRawData( const CvFileStorage* fs, const CvFileNode* src, + CvSeqReader* reader ); + +/** @brief Initializes file node sequence reader. + +The function reads one or more elements from the file node, representing a sequence, to a +user-specified array. The total number of read sequence elements is a product of total and the +number of components in each array element. For example, if dt=2if, the function will read total\*3 +sequence elements. As with any sequence, some parts of the file node sequence can be skipped or read +repeatedly by repositioning the reader using cvSetSeqReaderPos. +@param fs File storage +@param reader The sequence reader. Initialize it with cvStartReadRawData . +@param count The number of elements to read +@param dst Pointer to the destination array +@param dt Specification of each array element. It has the same format as in cvWriteRawData . + */ +CVAPI(void) cvReadRawDataSlice( const CvFileStorage* fs, CvSeqReader* reader, + int count, void* dst, const char* dt ); + +/** @brief Reads multiple numbers. + +The function reads elements from a file node that represents a sequence of scalars. +@param fs File storage +@param src The file node (a sequence) to read numbers from +@param dst Pointer to the destination array +@param dt Specification of each array element. It has the same format as in cvWriteRawData . + */ +CVAPI(void) cvReadRawData( const CvFileStorage* fs, const CvFileNode* src, + void* dst, const char* dt ); + +/** @brief Writes a file node to another file storage. + +The function writes a copy of a file node to file storage. Possible applications of the function are +merging several file storages into one and conversion between XML and YAML formats. +@param fs Destination file storage +@param new_node_name New name of the file node in the destination file storage. To keep the +existing name, use cvcvGetFileNodeName +@param node The written node +@param embed If the written node is a collection and this parameter is not zero, no extra level of +hierarchy is created. Instead, all the elements of node are written into the currently written +structure. Of course, map elements can only be embedded into another map, and sequence elements +can only be embedded into another sequence. + */ +CVAPI(void) cvWriteFileNode( CvFileStorage* fs, const char* new_node_name, + const CvFileNode* node, int embed ); + +/** @brief Returns the name of a file node. + +The function returns the name of a file node or NULL, if the file node does not have a name or if +node is NULL. +@param node File node + */ +CVAPI(const char*) cvGetFileNodeName( const CvFileNode* node ); + +/*********************************** Adding own types ***********************************/ + +/** @brief Registers a new type. + +The function registers a new type, which is described by info . The function creates a copy of the +structure, so the user should delete it after calling the function. +@param info Type info structure + */ +CVAPI(void) cvRegisterType( const CvTypeInfo* info ); + +/** @brief Unregisters the type. + +The function unregisters a type with a specified name. If the name is unknown, it is possible to +locate the type info by an instance of the type using cvTypeOf or by iterating the type list, +starting from cvFirstType, and then calling cvUnregisterType(info-\>typeName). +@param type_name Name of an unregistered type + */ +CVAPI(void) cvUnregisterType( const char* type_name ); + +/** @brief Returns the beginning of a type list. + +The function returns the first type in the list of registered types. Navigation through the list can +be done via the prev and next fields of the CvTypeInfo structure. + */ +CVAPI(CvTypeInfo*) cvFirstType(void); + +/** @brief Finds a type by its name. + +The function finds a registered type by its name. It returns NULL if there is no type with the +specified name. +@param type_name Type name + */ +CVAPI(CvTypeInfo*) cvFindType( const char* type_name ); + +/** @brief Returns the type of an object. + +The function finds the type of a given object. It iterates through the list of registered types and +calls the is_instance function/method for every type info structure with that object until one of +them returns non-zero or until the whole list has been traversed. In the latter case, the function +returns NULL. +@param struct_ptr The object pointer + */ +CVAPI(CvTypeInfo*) cvTypeOf( const void* struct_ptr ); + +/** @brief Releases an object. + +The function finds the type of a given object and calls release with the double pointer. +@param struct_ptr Double pointer to the object + */ +CVAPI(void) cvRelease( void** struct_ptr ); + +/** @brief Makes a clone of an object. + +The function finds the type of a given object and calls clone with the passed object. Of course, if +you know the object type, for example, struct_ptr is CvMat\*, it is faster to call the specific +function, like cvCloneMat. +@param struct_ptr The object to clone + */ +CVAPI(void*) cvClone( const void* struct_ptr ); + +/** @brief Saves an object to a file. + +The function saves an object to a file. It provides a simple interface to cvWrite . +@param filename File name +@param struct_ptr Object to save +@param name Optional object name. If it is NULL, the name will be formed from filename . +@param comment Optional comment to put in the beginning of the file +@param attributes Optional attributes passed to cvWrite + */ +CVAPI(void) cvSave( const char* filename, const void* struct_ptr, + const char* name CV_DEFAULT(NULL), + const char* comment CV_DEFAULT(NULL), + CvAttrList attributes CV_DEFAULT(cvAttrList())); + +/** @brief Loads an object from a file. + +The function loads an object from a file. It basically reads the specified file, find the first +top-level node and calls cvRead for that node. If the file node does not have type information or +the type information can not be found by the type name, the function returns NULL. After the object +is loaded, the file storage is closed and all the temporary buffers are deleted. Thus, to load a +dynamic structure, such as a sequence, contour, or graph, one should pass a valid memory storage +destination to the function. +@param filename File name +@param memstorage Memory storage for dynamic structures, such as CvSeq or CvGraph . It is not used +for matrices or images. +@param name Optional object name. If it is NULL, the first top-level object in the storage will be +loaded. +@param real_name Optional output parameter that will contain the name of the loaded object +(useful if name=NULL ) + */ +CVAPI(void*) cvLoad( const char* filename, + CvMemStorage* memstorage CV_DEFAULT(NULL), + const char* name CV_DEFAULT(NULL), + const char** real_name CV_DEFAULT(NULL) ); + +/*********************************** Measuring Execution Time ***************************/ + +/** helper functions for RNG initialization and accurate time measurement: + uses internal clock counter on x86 */ +CVAPI(int64) cvGetTickCount( void ); +CVAPI(double) cvGetTickFrequency( void ); + +/*********************************** CPU capabilities ***********************************/ + +CVAPI(int) cvCheckHardwareSupport(int feature); + +/*********************************** Multi-Threading ************************************/ + +/** retrieve/set the number of threads used in OpenMP implementations */ +CVAPI(int) cvGetNumThreads( void ); +CVAPI(void) cvSetNumThreads( int threads CV_DEFAULT(0) ); +/** get index of the thread being executed */ +CVAPI(int) cvGetThreadNum( void ); + + +/********************************** Error Handling **************************************/ + +/** Get current OpenCV error status */ +CVAPI(int) cvGetErrStatus( void ); + +/** Sets error status silently */ +CVAPI(void) cvSetErrStatus( int status ); + +#define CV_ErrModeLeaf 0 /* Print error and exit program */ +#define CV_ErrModeParent 1 /* Print error and continue */ +#define CV_ErrModeSilent 2 /* Don't print and continue */ + +/** Retrives current error processing mode */ +CVAPI(int) cvGetErrMode( void ); + +/** Sets error processing mode, returns previously used mode */ +CVAPI(int) cvSetErrMode( int mode ); + +/** Sets error status and performs some additonal actions (displaying message box, + writing message to stderr, terminating application etc.) + depending on the current error mode */ +CVAPI(void) cvError( int status, const char* func_name, + const char* err_msg, const char* file_name, int line ); + +/** Retrieves textual description of the error given its code */ +CVAPI(const char*) cvErrorStr( int status ); + +/** Retrieves detailed information about the last error occured */ +CVAPI(int) cvGetErrInfo( const char** errcode_desc, const char** description, + const char** filename, int* line ); + +/** Maps IPP error codes to the counterparts from OpenCV */ +CVAPI(int) cvErrorFromIppStatus( int ipp_status ); + +typedef int (CV_CDECL *CvErrorCallback)( int status, const char* func_name, + const char* err_msg, const char* file_name, int line, void* userdata ); + +/** Assigns a new error-handling function */ +CVAPI(CvErrorCallback) cvRedirectError( CvErrorCallback error_handler, + void* userdata CV_DEFAULT(NULL), + void** prev_userdata CV_DEFAULT(NULL) ); + +/** Output nothing */ +CVAPI(int) cvNulDevReport( int status, const char* func_name, const char* err_msg, + const char* file_name, int line, void* userdata ); + +/** Output to console(fprintf(stderr,...)) */ +CVAPI(int) cvStdErrReport( int status, const char* func_name, const char* err_msg, + const char* file_name, int line, void* userdata ); + +/** Output to MessageBox(WIN32) */ +CVAPI(int) cvGuiBoxReport( int status, const char* func_name, const char* err_msg, + const char* file_name, int line, void* userdata ); + +#define OPENCV_ERROR(status,func,context) \ +cvError((status),(func),(context),__FILE__,__LINE__) + +#define OPENCV_ASSERT(expr,func,context) \ +{if (! (expr)) \ +{OPENCV_ERROR(CV_StsInternal,(func),(context));}} + +#define OPENCV_CALL( Func ) \ +{ \ +Func; \ +} + + +/** CV_FUNCNAME macro defines icvFuncName constant which is used by CV_ERROR macro */ +#ifdef CV_NO_FUNC_NAMES +#define CV_FUNCNAME( Name ) +#define cvFuncName "" +#else +#define CV_FUNCNAME( Name ) \ +static char cvFuncName[] = Name +#endif + + +/** + CV_ERROR macro unconditionally raises error with passed code and message. + After raising error, control will be transferred to the exit label. + */ +#define CV_ERROR( Code, Msg ) \ +{ \ + cvError( (Code), cvFuncName, Msg, __FILE__, __LINE__ ); \ + __CV_EXIT__; \ +} + +/** + CV_CHECK macro checks error status after CV (or IPL) + function call. If error detected, control will be transferred to the exit + label. + */ +#define CV_CHECK() \ +{ \ + if( cvGetErrStatus() < 0 ) \ + CV_ERROR( CV_StsBackTrace, "Inner function failed." ); \ +} + + +/** + CV_CALL macro calls CV (or IPL) function, checks error status and + signals a error if the function failed. Useful in "parent node" + error procesing mode + */ +#define CV_CALL( Func ) \ +{ \ + Func; \ + CV_CHECK(); \ +} + + +/** Runtime assertion macro */ +#define CV_ASSERT( Condition ) \ +{ \ + if( !(Condition) ) \ + CV_ERROR( CV_StsInternal, "Assertion: " #Condition " failed" ); \ +} + +#define __CV_BEGIN__ { +#define __CV_END__ goto exit; exit: ; } +#define __CV_EXIT__ goto exit + +/** @} core_c */ + +#ifdef __cplusplus +} // extern "C" +#endif + +#ifdef __cplusplus + +//! @addtogroup core_c_glue +//! @{ + +//! class for automatic module/RTTI data registration/unregistration +struct CV_EXPORTS CvType +{ + CvType( const char* type_name, + CvIsInstanceFunc is_instance, CvReleaseFunc release=0, + CvReadFunc read=0, CvWriteFunc write=0, CvCloneFunc clone=0 ); + ~CvType(); + CvTypeInfo* info; + + static CvTypeInfo* first; + static CvTypeInfo* last; +}; + +//! @} + +#include "opencv2/core/utility.hpp" + +namespace cv +{ + +//! @addtogroup core_c_glue +//! @{ + +/////////////////////////////////////////// glue /////////////////////////////////////////// + +//! converts array (CvMat or IplImage) to cv::Mat +CV_EXPORTS Mat cvarrToMat(const CvArr* arr, bool copyData=false, + bool allowND=true, int coiMode=0, + AutoBuffer* buf=0); + +static inline Mat cvarrToMatND(const CvArr* arr, bool copyData=false, int coiMode=0) +{ + return cvarrToMat(arr, copyData, true, coiMode); +} + + +//! extracts Channel of Interest from CvMat or IplImage and makes cv::Mat out of it. +CV_EXPORTS void extractImageCOI(const CvArr* arr, OutputArray coiimg, int coi=-1); +//! inserts single-channel cv::Mat into a multi-channel CvMat or IplImage +CV_EXPORTS void insertImageCOI(InputArray coiimg, CvArr* arr, int coi=-1); + + + +////// specialized implementations of DefaultDeleter::operator() for classic OpenCV types ////// + +template<> CV_EXPORTS void DefaultDeleter::operator ()(CvMat* obj) const; +template<> CV_EXPORTS void DefaultDeleter::operator ()(IplImage* obj) const; +template<> CV_EXPORTS void DefaultDeleter::operator ()(CvMatND* obj) const; +template<> CV_EXPORTS void DefaultDeleter::operator ()(CvSparseMat* obj) const; +template<> CV_EXPORTS void DefaultDeleter::operator ()(CvMemStorage* obj) const; + +////////////// convenient wrappers for operating old-style dynamic structures ////////////// + +template class SeqIterator; + +typedef Ptr MemStorage; + +/*! + Template Sequence Class derived from CvSeq + + The class provides more convenient access to sequence elements, + STL-style operations and iterators. + + \note The class is targeted for simple data types, + i.e. no constructors or destructors + are called for the sequence elements. +*/ +template class Seq +{ +public: + typedef SeqIterator<_Tp> iterator; + typedef SeqIterator<_Tp> const_iterator; + + //! the default constructor + Seq(); + //! the constructor for wrapping CvSeq structure. The real element type in CvSeq should match _Tp. + Seq(const CvSeq* seq); + //! creates the empty sequence that resides in the specified storage + Seq(MemStorage& storage, int headerSize = sizeof(CvSeq)); + //! returns read-write reference to the specified element + _Tp& operator [](int idx); + //! returns read-only reference to the specified element + const _Tp& operator[](int idx) const; + //! returns iterator pointing to the beginning of the sequence + SeqIterator<_Tp> begin() const; + //! returns iterator pointing to the element following the last sequence element + SeqIterator<_Tp> end() const; + //! returns the number of elements in the sequence + size_t size() const; + //! returns the type of sequence elements (CV_8UC1 ... CV_64FC(CV_CN_MAX) ...) + int type() const; + //! returns the depth of sequence elements (CV_8U ... CV_64F) + int depth() const; + //! returns the number of channels in each sequence element + int channels() const; + //! returns the size of each sequence element + size_t elemSize() const; + //! returns index of the specified sequence element + size_t index(const _Tp& elem) const; + //! appends the specified element to the end of the sequence + void push_back(const _Tp& elem); + //! appends the specified element to the front of the sequence + void push_front(const _Tp& elem); + //! appends zero or more elements to the end of the sequence + void push_back(const _Tp* elems, size_t count); + //! appends zero or more elements to the front of the sequence + void push_front(const _Tp* elems, size_t count); + //! inserts the specified element to the specified position + void insert(int idx, const _Tp& elem); + //! inserts zero or more elements to the specified position + void insert(int idx, const _Tp* elems, size_t count); + //! removes element at the specified position + void remove(int idx); + //! removes the specified subsequence + void remove(const Range& r); + + //! returns reference to the first sequence element + _Tp& front(); + //! returns read-only reference to the first sequence element + const _Tp& front() const; + //! returns reference to the last sequence element + _Tp& back(); + //! returns read-only reference to the last sequence element + const _Tp& back() const; + //! returns true iff the sequence contains no elements + bool empty() const; + + //! removes all the elements from the sequence + void clear(); + //! removes the first element from the sequence + void pop_front(); + //! removes the last element from the sequence + void pop_back(); + //! removes zero or more elements from the beginning of the sequence + void pop_front(_Tp* elems, size_t count); + //! removes zero or more elements from the end of the sequence + void pop_back(_Tp* elems, size_t count); + + //! copies the whole sequence or the sequence slice to the specified vector + void copyTo(std::vector<_Tp>& vec, const Range& range=Range::all()) const; + //! returns the vector containing all the sequence elements + operator std::vector<_Tp>() const; + + CvSeq* seq; +}; + + +/*! + STL-style Sequence Iterator inherited from the CvSeqReader structure +*/ +template class SeqIterator : public CvSeqReader +{ +public: + //! the default constructor + SeqIterator(); + //! the constructor setting the iterator to the beginning or to the end of the sequence + SeqIterator(const Seq<_Tp>& seq, bool seekEnd=false); + //! positions the iterator within the sequence + void seek(size_t pos); + //! reports the current iterator position + size_t tell() const; + //! returns reference to the current sequence element + _Tp& operator *(); + //! returns read-only reference to the current sequence element + const _Tp& operator *() const; + //! moves iterator to the next sequence element + SeqIterator& operator ++(); + //! moves iterator to the next sequence element + SeqIterator operator ++(int) const; + //! moves iterator to the previous sequence element + SeqIterator& operator --(); + //! moves iterator to the previous sequence element + SeqIterator operator --(int) const; + + //! moves iterator forward by the specified offset (possibly negative) + SeqIterator& operator +=(int); + //! moves iterator backward by the specified offset (possibly negative) + SeqIterator& operator -=(int); + + // this is index of the current element module seq->total*2 + // (to distinguish between 0 and seq->total) + int index; +}; + + + +// bridge C++ => C Seq API +CV_EXPORTS schar* seqPush( CvSeq* seq, const void* element=0); +CV_EXPORTS schar* seqPushFront( CvSeq* seq, const void* element=0); +CV_EXPORTS void seqPop( CvSeq* seq, void* element=0); +CV_EXPORTS void seqPopFront( CvSeq* seq, void* element=0); +CV_EXPORTS void seqPopMulti( CvSeq* seq, void* elements, + int count, int in_front=0 ); +CV_EXPORTS void seqRemove( CvSeq* seq, int index ); +CV_EXPORTS void clearSeq( CvSeq* seq ); +CV_EXPORTS schar* getSeqElem( const CvSeq* seq, int index ); +CV_EXPORTS void seqRemoveSlice( CvSeq* seq, CvSlice slice ); +CV_EXPORTS void seqInsertSlice( CvSeq* seq, int before_index, const CvArr* from_arr ); + +template inline Seq<_Tp>::Seq() : seq(0) {} +template inline Seq<_Tp>::Seq( const CvSeq* _seq ) : seq((CvSeq*)_seq) +{ + CV_Assert(!_seq || _seq->elem_size == sizeof(_Tp)); +} + +template inline Seq<_Tp>::Seq( MemStorage& storage, + int headerSize ) +{ + CV_Assert(headerSize >= (int)sizeof(CvSeq)); + seq = cvCreateSeq(DataType<_Tp>::type, headerSize, sizeof(_Tp), storage); +} + +template inline _Tp& Seq<_Tp>::operator [](int idx) +{ return *(_Tp*)getSeqElem(seq, idx); } + +template inline const _Tp& Seq<_Tp>::operator [](int idx) const +{ return *(_Tp*)getSeqElem(seq, idx); } + +template inline SeqIterator<_Tp> Seq<_Tp>::begin() const +{ return SeqIterator<_Tp>(*this); } + +template inline SeqIterator<_Tp> Seq<_Tp>::end() const +{ return SeqIterator<_Tp>(*this, true); } + +template inline size_t Seq<_Tp>::size() const +{ return seq ? seq->total : 0; } + +template inline int Seq<_Tp>::type() const +{ return seq ? CV_MAT_TYPE(seq->flags) : 0; } + +template inline int Seq<_Tp>::depth() const +{ return seq ? CV_MAT_DEPTH(seq->flags) : 0; } + +template inline int Seq<_Tp>::channels() const +{ return seq ? CV_MAT_CN(seq->flags) : 0; } + +template inline size_t Seq<_Tp>::elemSize() const +{ return seq ? seq->elem_size : 0; } + +template inline size_t Seq<_Tp>::index(const _Tp& elem) const +{ return cvSeqElemIdx(seq, &elem); } + +template inline void Seq<_Tp>::push_back(const _Tp& elem) +{ cvSeqPush(seq, &elem); } + +template inline void Seq<_Tp>::push_front(const _Tp& elem) +{ cvSeqPushFront(seq, &elem); } + +template inline void Seq<_Tp>::push_back(const _Tp* elem, size_t count) +{ cvSeqPushMulti(seq, elem, (int)count, 0); } + +template inline void Seq<_Tp>::push_front(const _Tp* elem, size_t count) +{ cvSeqPushMulti(seq, elem, (int)count, 1); } + +template inline _Tp& Seq<_Tp>::back() +{ return *(_Tp*)getSeqElem(seq, -1); } + +template inline const _Tp& Seq<_Tp>::back() const +{ return *(const _Tp*)getSeqElem(seq, -1); } + +template inline _Tp& Seq<_Tp>::front() +{ return *(_Tp*)getSeqElem(seq, 0); } + +template inline const _Tp& Seq<_Tp>::front() const +{ return *(const _Tp*)getSeqElem(seq, 0); } + +template inline bool Seq<_Tp>::empty() const +{ return !seq || seq->total == 0; } + +template inline void Seq<_Tp>::clear() +{ if(seq) clearSeq(seq); } + +template inline void Seq<_Tp>::pop_back() +{ seqPop(seq); } + +template inline void Seq<_Tp>::pop_front() +{ seqPopFront(seq); } + +template inline void Seq<_Tp>::pop_back(_Tp* elem, size_t count) +{ seqPopMulti(seq, elem, (int)count, 0); } + +template inline void Seq<_Tp>::pop_front(_Tp* elem, size_t count) +{ seqPopMulti(seq, elem, (int)count, 1); } + +template inline void Seq<_Tp>::insert(int idx, const _Tp& elem) +{ seqInsert(seq, idx, &elem); } + +template inline void Seq<_Tp>::insert(int idx, const _Tp* elems, size_t count) +{ + CvMat m = cvMat(1, count, DataType<_Tp>::type, elems); + seqInsertSlice(seq, idx, &m); +} + +template inline void Seq<_Tp>::remove(int idx) +{ seqRemove(seq, idx); } + +template inline void Seq<_Tp>::remove(const Range& r) +{ seqRemoveSlice(seq, cvSlice(r.start, r.end)); } + +template inline void Seq<_Tp>::copyTo(std::vector<_Tp>& vec, const Range& range) const +{ + size_t len = !seq ? 0 : range == Range::all() ? seq->total : range.end - range.start; + vec.resize(len); + if( seq && len ) + cvCvtSeqToArray(seq, &vec[0], range); +} + +template inline Seq<_Tp>::operator std::vector<_Tp>() const +{ + std::vector<_Tp> vec; + copyTo(vec); + return vec; +} + +template inline SeqIterator<_Tp>::SeqIterator() +{ memset(this, 0, sizeof(*this)); } + +template inline SeqIterator<_Tp>::SeqIterator(const Seq<_Tp>& _seq, bool seekEnd) +{ + cvStartReadSeq(_seq.seq, this); + index = seekEnd ? _seq.seq->total : 0; +} + +template inline void SeqIterator<_Tp>::seek(size_t pos) +{ + cvSetSeqReaderPos(this, (int)pos, false); + index = pos; +} + +template inline size_t SeqIterator<_Tp>::tell() const +{ return index; } + +template inline _Tp& SeqIterator<_Tp>::operator *() +{ return *(_Tp*)ptr; } + +template inline const _Tp& SeqIterator<_Tp>::operator *() const +{ return *(const _Tp*)ptr; } + +template inline SeqIterator<_Tp>& SeqIterator<_Tp>::operator ++() +{ + CV_NEXT_SEQ_ELEM(sizeof(_Tp), *this); + if( ++index >= seq->total*2 ) + index = 0; + return *this; +} + +template inline SeqIterator<_Tp> SeqIterator<_Tp>::operator ++(int) const +{ + SeqIterator<_Tp> it = *this; + ++*this; + return it; +} + +template inline SeqIterator<_Tp>& SeqIterator<_Tp>::operator --() +{ + CV_PREV_SEQ_ELEM(sizeof(_Tp), *this); + if( --index < 0 ) + index = seq->total*2-1; + return *this; +} + +template inline SeqIterator<_Tp> SeqIterator<_Tp>::operator --(int) const +{ + SeqIterator<_Tp> it = *this; + --*this; + return it; +} + +template inline SeqIterator<_Tp>& SeqIterator<_Tp>::operator +=(int delta) +{ + cvSetSeqReaderPos(this, delta, 1); + index += delta; + int n = seq->total*2; + if( index < 0 ) + index += n; + if( index >= n ) + index -= n; + return *this; +} + +template inline SeqIterator<_Tp>& SeqIterator<_Tp>::operator -=(int delta) +{ + return (*this += -delta); +} + +template inline ptrdiff_t operator - (const SeqIterator<_Tp>& a, + const SeqIterator<_Tp>& b) +{ + ptrdiff_t delta = a.index - b.index, n = a.seq->total; + if( delta > n || delta < -n ) + delta += delta < 0 ? n : -n; + return delta; +} + +template inline bool operator == (const SeqIterator<_Tp>& a, + const SeqIterator<_Tp>& b) +{ + return a.seq == b.seq && a.index == b.index; +} + +template inline bool operator != (const SeqIterator<_Tp>& a, + const SeqIterator<_Tp>& b) +{ + return !(a == b); +} + +//! @} + +} // cv + +#endif + +#endif diff --git a/lib/opencv/include/opencv2/core/cuda.hpp b/lib/opencv/include/opencv2/core/cuda.hpp new file mode 100644 index 000000000..64bc53ef5 --- /dev/null +++ b/lib/opencv/include/opencv2/core/cuda.hpp @@ -0,0 +1,846 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_CUDA_HPP__ +#define __OPENCV_CORE_CUDA_HPP__ + +#ifndef __cplusplus +# error cuda.hpp header must be compiled as C++ +#endif + +#include "opencv2/core.hpp" +#include "opencv2/core/cuda_types.hpp" + +/** + @defgroup cuda CUDA-accelerated Computer Vision + @{ + @defgroup cudacore Core part + @{ + @defgroup cudacore_init Initalization and Information + @defgroup cudacore_struct Data Structures + @} + @} + */ + +namespace cv { namespace cuda { + +//! @addtogroup cudacore_struct +//! @{ + +//=================================================================================== +// GpuMat +//=================================================================================== + +/** @brief Base storage class for GPU memory with reference counting. + +Its interface matches the Mat interface with the following limitations: + +- no arbitrary dimensions support (only 2D) +- no functions that return references to their data (because references on GPU are not valid for + CPU) +- no expression templates technique support + +Beware that the latter limitation may lead to overloaded matrix operators that cause memory +allocations. The GpuMat class is convertible to cuda::PtrStepSz and cuda::PtrStep so it can be +passed directly to the kernel. + +@note In contrast with Mat, in most cases GpuMat::isContinuous() == false . This means that rows are +aligned to a size depending on the hardware. Single-row GpuMat is always a continuous matrix. + +@note You are not recommended to leave static or global GpuMat variables allocated, that is, to rely +on its destructor. The destruction order of such variables and CUDA context is undefined. GPU memory +release function returns error if the CUDA context has been destroyed before. + +@sa Mat + */ +class CV_EXPORTS GpuMat +{ +public: + class CV_EXPORTS Allocator + { + public: + virtual ~Allocator() {} + + // allocator must fill data, step and refcount fields + virtual bool allocate(GpuMat* mat, int rows, int cols, size_t elemSize) = 0; + virtual void free(GpuMat* mat) = 0; + }; + + //! default allocator + static Allocator* defaultAllocator(); + static void setDefaultAllocator(Allocator* allocator); + + //! default constructor + explicit GpuMat(Allocator* allocator = defaultAllocator()); + + //! constructs GpuMat of the specified size and type + GpuMat(int rows, int cols, int type, Allocator* allocator = defaultAllocator()); + GpuMat(Size size, int type, Allocator* allocator = defaultAllocator()); + + //! constucts GpuMat and fills it with the specified value _s + GpuMat(int rows, int cols, int type, Scalar s, Allocator* allocator = defaultAllocator()); + GpuMat(Size size, int type, Scalar s, Allocator* allocator = defaultAllocator()); + + //! copy constructor + GpuMat(const GpuMat& m); + + //! constructor for GpuMat headers pointing to user-allocated data + GpuMat(int rows, int cols, int type, void* data, size_t step = Mat::AUTO_STEP); + GpuMat(Size size, int type, void* data, size_t step = Mat::AUTO_STEP); + + //! creates a GpuMat header for a part of the bigger matrix + GpuMat(const GpuMat& m, Range rowRange, Range colRange); + GpuMat(const GpuMat& m, Rect roi); + + //! builds GpuMat from host memory (Blocking call) + explicit GpuMat(InputArray arr, Allocator* allocator = defaultAllocator()); + + //! destructor - calls release() + ~GpuMat(); + + //! assignment operators + GpuMat& operator =(const GpuMat& m); + + //! allocates new GpuMat data unless the GpuMat already has specified size and type + void create(int rows, int cols, int type); + void create(Size size, int type); + + //! decreases reference counter, deallocate the data when reference counter reaches 0 + void release(); + + //! swaps with other smart pointer + void swap(GpuMat& mat); + + //! pefroms upload data to GpuMat (Blocking call) + void upload(InputArray arr); + + //! pefroms upload data to GpuMat (Non-Blocking call) + void upload(InputArray arr, Stream& stream); + + //! pefroms download data from device to host memory (Blocking call) + void download(OutputArray dst) const; + + //! pefroms download data from device to host memory (Non-Blocking call) + void download(OutputArray dst, Stream& stream) const; + + //! returns deep copy of the GpuMat, i.e. the data is copied + GpuMat clone() const; + + //! copies the GpuMat content to device memory (Blocking call) + void copyTo(OutputArray dst) const; + + //! copies the GpuMat content to device memory (Non-Blocking call) + void copyTo(OutputArray dst, Stream& stream) const; + + //! copies those GpuMat elements to "m" that are marked with non-zero mask elements (Blocking call) + void copyTo(OutputArray dst, InputArray mask) const; + + //! copies those GpuMat elements to "m" that are marked with non-zero mask elements (Non-Blocking call) + void copyTo(OutputArray dst, InputArray mask, Stream& stream) const; + + //! sets some of the GpuMat elements to s (Blocking call) + GpuMat& setTo(Scalar s); + + //! sets some of the GpuMat elements to s (Non-Blocking call) + GpuMat& setTo(Scalar s, Stream& stream); + + //! sets some of the GpuMat elements to s, according to the mask (Blocking call) + GpuMat& setTo(Scalar s, InputArray mask); + + //! sets some of the GpuMat elements to s, according to the mask (Non-Blocking call) + GpuMat& setTo(Scalar s, InputArray mask, Stream& stream); + + //! converts GpuMat to another datatype (Blocking call) + void convertTo(OutputArray dst, int rtype) const; + + //! converts GpuMat to another datatype (Non-Blocking call) + void convertTo(OutputArray dst, int rtype, Stream& stream) const; + + //! converts GpuMat to another datatype with scaling (Blocking call) + void convertTo(OutputArray dst, int rtype, double alpha, double beta = 0.0) const; + + //! converts GpuMat to another datatype with scaling (Non-Blocking call) + void convertTo(OutputArray dst, int rtype, double alpha, Stream& stream) const; + + //! converts GpuMat to another datatype with scaling (Non-Blocking call) + void convertTo(OutputArray dst, int rtype, double alpha, double beta, Stream& stream) const; + + void assignTo(GpuMat& m, int type=-1) const; + + //! returns pointer to y-th row + uchar* ptr(int y = 0); + const uchar* ptr(int y = 0) const; + + //! template version of the above method + template _Tp* ptr(int y = 0); + template const _Tp* ptr(int y = 0) const; + + template operator PtrStepSz<_Tp>() const; + template operator PtrStep<_Tp>() const; + + //! returns a new GpuMat header for the specified row + GpuMat row(int y) const; + + //! returns a new GpuMat header for the specified column + GpuMat col(int x) const; + + //! ... for the specified row span + GpuMat rowRange(int startrow, int endrow) const; + GpuMat rowRange(Range r) const; + + //! ... for the specified column span + GpuMat colRange(int startcol, int endcol) const; + GpuMat colRange(Range r) const; + + //! extracts a rectangular sub-GpuMat (this is a generalized form of row, rowRange etc.) + GpuMat operator ()(Range rowRange, Range colRange) const; + GpuMat operator ()(Rect roi) const; + + //! creates alternative GpuMat header for the same data, with different + //! number of channels and/or different number of rows + GpuMat reshape(int cn, int rows = 0) const; + + //! locates GpuMat header within a parent GpuMat + void locateROI(Size& wholeSize, Point& ofs) const; + + //! moves/resizes the current GpuMat ROI inside the parent GpuMat + GpuMat& adjustROI(int dtop, int dbottom, int dleft, int dright); + + //! returns true iff the GpuMat data is continuous + //! (i.e. when there are no gaps between successive rows) + bool isContinuous() const; + + //! returns element size in bytes + size_t elemSize() const; + + //! returns the size of element channel in bytes + size_t elemSize1() const; + + //! returns element type + int type() const; + + //! returns element type + int depth() const; + + //! returns number of channels + int channels() const; + + //! returns step/elemSize1() + size_t step1() const; + + //! returns GpuMat size : width == number of columns, height == number of rows + Size size() const; + + //! returns true if GpuMat data is NULL + bool empty() const; + + /*! includes several bit-fields: + - the magic signature + - continuity flag + - depth + - number of channels + */ + int flags; + + //! the number of rows and columns + int rows, cols; + + //! a distance between successive rows in bytes; includes the gap if any + size_t step; + + //! pointer to the data + uchar* data; + + //! pointer to the reference counter; + //! when GpuMat points to user-allocated data, the pointer is NULL + int* refcount; + + //! helper fields used in locateROI and adjustROI + uchar* datastart; + const uchar* dataend; + + //! allocator + Allocator* allocator; +}; + +/** @brief Creates a continuous matrix. + +@param rows Row count. +@param cols Column count. +@param type Type of the matrix. +@param arr Destination matrix. This parameter changes only if it has a proper type and area ( +\f$\texttt{rows} \times \texttt{cols}\f$ ). + +Matrix is called continuous if its elements are stored continuously, that is, without gaps at the +end of each row. + */ +CV_EXPORTS void createContinuous(int rows, int cols, int type, OutputArray arr); + +/** @brief Ensures that the size of a matrix is big enough and the matrix has a proper type. + +@param rows Minimum desired number of rows. +@param cols Minimum desired number of columns. +@param type Desired matrix type. +@param arr Destination matrix. + +The function does not reallocate memory if the matrix has proper attributes already. + */ +CV_EXPORTS void ensureSizeIsEnough(int rows, int cols, int type, OutputArray arr); + +//! BufferPool management (must be called before Stream creation) +CV_EXPORTS void setBufferPoolUsage(bool on); +CV_EXPORTS void setBufferPoolConfig(int deviceId, size_t stackSize, int stackCount); + +//=================================================================================== +// HostMem +//=================================================================================== + +/** @brief Class with reference counting wrapping special memory type allocation functions from CUDA. + +Its interface is also Mat-like but with additional memory type parameters. + +- **PAGE_LOCKED** sets a page locked memory type used commonly for fast and asynchronous + uploading/downloading data from/to GPU. +- **SHARED** specifies a zero copy memory allocation that enables mapping the host memory to GPU + address space, if supported. +- **WRITE_COMBINED** sets the write combined buffer that is not cached by CPU. Such buffers are + used to supply GPU with data when GPU only reads it. The advantage is a better CPU cache + utilization. + +@note Allocation size of such memory types is usually limited. For more details, see *CUDA 2.2 +Pinned Memory APIs* document or *CUDA C Programming Guide*. + */ +class CV_EXPORTS HostMem +{ +public: + enum AllocType { PAGE_LOCKED = 1, SHARED = 2, WRITE_COMBINED = 4 }; + + static MatAllocator* getAllocator(AllocType alloc_type = PAGE_LOCKED); + + explicit HostMem(AllocType alloc_type = PAGE_LOCKED); + + HostMem(const HostMem& m); + + HostMem(int rows, int cols, int type, AllocType alloc_type = PAGE_LOCKED); + HostMem(Size size, int type, AllocType alloc_type = PAGE_LOCKED); + + //! creates from host memory with coping data + explicit HostMem(InputArray arr, AllocType alloc_type = PAGE_LOCKED); + + ~HostMem(); + + HostMem& operator =(const HostMem& m); + + //! swaps with other smart pointer + void swap(HostMem& b); + + //! returns deep copy of the matrix, i.e. the data is copied + HostMem clone() const; + + //! allocates new matrix data unless the matrix already has specified size and type. + void create(int rows, int cols, int type); + void create(Size size, int type); + + //! creates alternative HostMem header for the same data, with different + //! number of channels and/or different number of rows + HostMem reshape(int cn, int rows = 0) const; + + //! decrements reference counter and released memory if needed. + void release(); + + //! returns matrix header with disabled reference counting for HostMem data. + Mat createMatHeader() const; + + /** @brief Maps CPU memory to GPU address space and creates the cuda::GpuMat header without reference counting + for it. + + This can be done only if memory was allocated with the SHARED flag and if it is supported by the + hardware. Laptops often share video and CPU memory, so address spaces can be mapped, which + eliminates an extra copy. + */ + GpuMat createGpuMatHeader() const; + + // Please see cv::Mat for descriptions + bool isContinuous() const; + size_t elemSize() const; + size_t elemSize1() const; + int type() const; + int depth() const; + int channels() const; + size_t step1() const; + Size size() const; + bool empty() const; + + // Please see cv::Mat for descriptions + int flags; + int rows, cols; + size_t step; + + uchar* data; + int* refcount; + + uchar* datastart; + const uchar* dataend; + + AllocType alloc_type; +}; + +/** @brief Page-locks the memory of matrix and maps it for the device(s). + +@param m Input matrix. + */ +CV_EXPORTS void registerPageLocked(Mat& m); + +/** @brief Unmaps the memory of matrix and makes it pageable again. + +@param m Input matrix. + */ +CV_EXPORTS void unregisterPageLocked(Mat& m); + +//=================================================================================== +// Stream +//=================================================================================== + +/** @brief This class encapsulates a queue of asynchronous calls. + +@note Currently, you may face problems if an operation is enqueued twice with different data. Some +functions use the constant GPU memory, and next call may update the memory before the previous one +has been finished. But calling different operations asynchronously is safe because each operation +has its own constant buffer. Memory copy/upload/download/set operations to the buffers you hold are +also safe. : + */ +class CV_EXPORTS Stream +{ + typedef void (Stream::*bool_type)() const; + void this_type_does_not_support_comparisons() const {} + +public: + typedef void (*StreamCallback)(int status, void* userData); + + //! creates a new asynchronous stream + Stream(); + + /** @brief Returns true if the current stream queue is finished. Otherwise, it returns false. + */ + bool queryIfComplete() const; + + /** @brief Blocks the current CPU thread until all operations in the stream are complete. + */ + void waitForCompletion(); + + /** @brief Makes a compute stream wait on an event. + */ + void waitEvent(const Event& event); + + /** @brief Adds a callback to be called on the host after all currently enqueued items in the stream have + completed. + + @note Callbacks must not make any CUDA API calls. Callbacks must not perform any synchronization + that may depend on outstanding device work or other callbacks that are not mandated to run earlier. + Callbacks without a mandated order (in independent streams) execute in undefined order and may be + serialized. + */ + void enqueueHostCallback(StreamCallback callback, void* userData); + + //! return Stream object for default CUDA stream + static Stream& Null(); + + //! returns true if stream object is not default (!= 0) + operator bool_type() const; + + class Impl; + +private: + Ptr impl_; + Stream(const Ptr& impl); + + friend struct StreamAccessor; + friend class BufferPool; + friend class DefaultDeviceInitializer; +}; + +class CV_EXPORTS Event +{ +public: + enum CreateFlags + { + DEFAULT = 0x00, /**< Default event flag */ + BLOCKING_SYNC = 0x01, /**< Event uses blocking synchronization */ + DISABLE_TIMING = 0x02, /**< Event will not record timing data */ + INTERPROCESS = 0x04 /**< Event is suitable for interprocess use. DisableTiming must be set */ + }; + + explicit Event(CreateFlags flags = DEFAULT); + + //! records an event + void record(Stream& stream = Stream::Null()); + + //! queries an event's status + bool queryIfComplete() const; + + //! waits for an event to complete + void waitForCompletion(); + + //! computes the elapsed time between events + static float elapsedTime(const Event& start, const Event& end); + + class Impl; + +private: + Ptr impl_; + Event(const Ptr& impl); + + friend struct EventAccessor; +}; + +//! @} cudacore_struct + +//=================================================================================== +// Initialization & Info +//=================================================================================== + +//! @addtogroup cudacore_init +//! @{ + +/** @brief Returns the number of installed CUDA-enabled devices. + +Use this function before any other CUDA functions calls. If OpenCV is compiled without CUDA support, +this function returns 0. + */ +CV_EXPORTS int getCudaEnabledDeviceCount(); + +/** @brief Sets a device and initializes it for the current thread. + +@param device System index of a CUDA device starting with 0. + +If the call of this function is omitted, a default device is initialized at the fist CUDA usage. + */ +CV_EXPORTS void setDevice(int device); + +/** @brief Returns the current device index set by cuda::setDevice or initialized by default. + */ +CV_EXPORTS int getDevice(); + +/** @brief Explicitly destroys and cleans up all resources associated with the current device in the current +process. + +Any subsequent API call to this device will reinitialize the device. + */ +CV_EXPORTS void resetDevice(); + +/** @brief Enumeration providing CUDA computing features. + */ +enum FeatureSet +{ + FEATURE_SET_COMPUTE_10 = 10, + FEATURE_SET_COMPUTE_11 = 11, + FEATURE_SET_COMPUTE_12 = 12, + FEATURE_SET_COMPUTE_13 = 13, + FEATURE_SET_COMPUTE_20 = 20, + FEATURE_SET_COMPUTE_21 = 21, + FEATURE_SET_COMPUTE_30 = 30, + FEATURE_SET_COMPUTE_32 = 32, + FEATURE_SET_COMPUTE_35 = 35, + FEATURE_SET_COMPUTE_50 = 50, + + GLOBAL_ATOMICS = FEATURE_SET_COMPUTE_11, + SHARED_ATOMICS = FEATURE_SET_COMPUTE_12, + NATIVE_DOUBLE = FEATURE_SET_COMPUTE_13, + WARP_SHUFFLE_FUNCTIONS = FEATURE_SET_COMPUTE_30, + DYNAMIC_PARALLELISM = FEATURE_SET_COMPUTE_35 +}; + +//! checks whether current device supports the given feature +CV_EXPORTS bool deviceSupports(FeatureSet feature_set); + +/** @brief Class providing a set of static methods to check what NVIDIA\* card architecture the CUDA module was +built for. + +According to the CUDA C Programming Guide Version 3.2: "PTX code produced for some specific compute +capability can always be compiled to binary code of greater or equal compute capability". + */ +class CV_EXPORTS TargetArchs +{ +public: + /** @brief The following method checks whether the module was built with the support of the given feature: + + @param feature_set Features to be checked. See :ocvcuda::FeatureSet. + */ + static bool builtWith(FeatureSet feature_set); + + /** @brief There is a set of methods to check whether the module contains intermediate (PTX) or binary CUDA + code for the given architecture(s): + + @param major Major compute capability version. + @param minor Minor compute capability version. + */ + static bool has(int major, int minor); + static bool hasPtx(int major, int minor); + static bool hasBin(int major, int minor); + + static bool hasEqualOrLessPtx(int major, int minor); + static bool hasEqualOrGreater(int major, int minor); + static bool hasEqualOrGreaterPtx(int major, int minor); + static bool hasEqualOrGreaterBin(int major, int minor); +}; + +/** @brief Class providing functionality for querying the specified GPU properties. + */ +class CV_EXPORTS DeviceInfo +{ +public: + //! creates DeviceInfo object for the current GPU + DeviceInfo(); + + /** @brief The constructors. + + @param device_id System index of the CUDA device starting with 0. + + Constructs the DeviceInfo object for the specified device. If device_id parameter is missed, it + constructs an object for the current device. + */ + DeviceInfo(int device_id); + + /** @brief Returns system index of the CUDA device starting with 0. + */ + int deviceID() const; + + //! ASCII string identifying device + const char* name() const; + + //! global memory available on device in bytes + size_t totalGlobalMem() const; + + //! shared memory available per block in bytes + size_t sharedMemPerBlock() const; + + //! 32-bit registers available per block + int regsPerBlock() const; + + //! warp size in threads + int warpSize() const; + + //! maximum pitch in bytes allowed by memory copies + size_t memPitch() const; + + //! maximum number of threads per block + int maxThreadsPerBlock() const; + + //! maximum size of each dimension of a block + Vec3i maxThreadsDim() const; + + //! maximum size of each dimension of a grid + Vec3i maxGridSize() const; + + //! clock frequency in kilohertz + int clockRate() const; + + //! constant memory available on device in bytes + size_t totalConstMem() const; + + //! major compute capability + int majorVersion() const; + + //! minor compute capability + int minorVersion() const; + + //! alignment requirement for textures + size_t textureAlignment() const; + + //! pitch alignment requirement for texture references bound to pitched memory + size_t texturePitchAlignment() const; + + //! number of multiprocessors on device + int multiProcessorCount() const; + + //! specified whether there is a run time limit on kernels + bool kernelExecTimeoutEnabled() const; + + //! device is integrated as opposed to discrete + bool integrated() const; + + //! device can map host memory with cudaHostAlloc/cudaHostGetDevicePointer + bool canMapHostMemory() const; + + enum ComputeMode + { + ComputeModeDefault, /**< default compute mode (Multiple threads can use cudaSetDevice with this device) */ + ComputeModeExclusive, /**< compute-exclusive-thread mode (Only one thread in one process will be able to use cudaSetDevice with this device) */ + ComputeModeProhibited, /**< compute-prohibited mode (No threads can use cudaSetDevice with this device) */ + ComputeModeExclusiveProcess /**< compute-exclusive-process mode (Many threads in one process will be able to use cudaSetDevice with this device) */ + }; + + //! compute mode + ComputeMode computeMode() const; + + //! maximum 1D texture size + int maxTexture1D() const; + + //! maximum 1D mipmapped texture size + int maxTexture1DMipmap() const; + + //! maximum size for 1D textures bound to linear memory + int maxTexture1DLinear() const; + + //! maximum 2D texture dimensions + Vec2i maxTexture2D() const; + + //! maximum 2D mipmapped texture dimensions + Vec2i maxTexture2DMipmap() const; + + //! maximum dimensions (width, height, pitch) for 2D textures bound to pitched memory + Vec3i maxTexture2DLinear() const; + + //! maximum 2D texture dimensions if texture gather operations have to be performed + Vec2i maxTexture2DGather() const; + + //! maximum 3D texture dimensions + Vec3i maxTexture3D() const; + + //! maximum Cubemap texture dimensions + int maxTextureCubemap() const; + + //! maximum 1D layered texture dimensions + Vec2i maxTexture1DLayered() const; + + //! maximum 2D layered texture dimensions + Vec3i maxTexture2DLayered() const; + + //! maximum Cubemap layered texture dimensions + Vec2i maxTextureCubemapLayered() const; + + //! maximum 1D surface size + int maxSurface1D() const; + + //! maximum 2D surface dimensions + Vec2i maxSurface2D() const; + + //! maximum 3D surface dimensions + Vec3i maxSurface3D() const; + + //! maximum 1D layered surface dimensions + Vec2i maxSurface1DLayered() const; + + //! maximum 2D layered surface dimensions + Vec3i maxSurface2DLayered() const; + + //! maximum Cubemap surface dimensions + int maxSurfaceCubemap() const; + + //! maximum Cubemap layered surface dimensions + Vec2i maxSurfaceCubemapLayered() const; + + //! alignment requirements for surfaces + size_t surfaceAlignment() const; + + //! device can possibly execute multiple kernels concurrently + bool concurrentKernels() const; + + //! device has ECC support enabled + bool ECCEnabled() const; + + //! PCI bus ID of the device + int pciBusID() const; + + //! PCI device ID of the device + int pciDeviceID() const; + + //! PCI domain ID of the device + int pciDomainID() const; + + //! true if device is a Tesla device using TCC driver, false otherwise + bool tccDriver() const; + + //! number of asynchronous engines + int asyncEngineCount() const; + + //! device shares a unified address space with the host + bool unifiedAddressing() const; + + //! peak memory clock frequency in kilohertz + int memoryClockRate() const; + + //! global memory bus width in bits + int memoryBusWidth() const; + + //! size of L2 cache in bytes + int l2CacheSize() const; + + //! maximum resident threads per multiprocessor + int maxThreadsPerMultiProcessor() const; + + //! gets free and total device memory + void queryMemory(size_t& totalMemory, size_t& freeMemory) const; + size_t freeMemory() const; + size_t totalMemory() const; + + /** @brief Provides information on CUDA feature support. + + @param feature_set Features to be checked. See cuda::FeatureSet. + + This function returns true if the device has the specified CUDA feature. Otherwise, it returns false + */ + bool supports(FeatureSet feature_set) const; + + /** @brief Checks the CUDA module and device compatibility. + + This function returns true if the CUDA module can be run on the specified device. Otherwise, it + returns false . + */ + bool isCompatible() const; + +private: + int device_id_; +}; + +CV_EXPORTS void printCudaDeviceInfo(int device); +CV_EXPORTS void printShortCudaDeviceInfo(int device); + +//! @} cudacore_init + +}} // namespace cv { namespace cuda { + + +#include "opencv2/core/cuda.inl.hpp" + +#endif /* __OPENCV_CORE_CUDA_HPP__ */ diff --git a/lib/opencv/include/opencv2/core/cuda.inl.hpp b/lib/opencv/include/opencv2/core/cuda.inl.hpp new file mode 100644 index 000000000..01dc6d7c0 --- /dev/null +++ b/lib/opencv/include/opencv2/core/cuda.inl.hpp @@ -0,0 +1,631 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_CUDAINL_HPP__ +#define __OPENCV_CORE_CUDAINL_HPP__ + +#include "opencv2/core/cuda.hpp" + +//! @cond IGNORED + +namespace cv { namespace cuda { + +//=================================================================================== +// GpuMat +//=================================================================================== + +inline +GpuMat::GpuMat(Allocator* allocator_) + : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), allocator(allocator_) +{} + +inline +GpuMat::GpuMat(int rows_, int cols_, int type_, Allocator* allocator_) + : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), allocator(allocator_) +{ + if (rows_ > 0 && cols_ > 0) + create(rows_, cols_, type_); +} + +inline +GpuMat::GpuMat(Size size_, int type_, Allocator* allocator_) + : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), allocator(allocator_) +{ + if (size_.height > 0 && size_.width > 0) + create(size_.height, size_.width, type_); +} + +inline +GpuMat::GpuMat(int rows_, int cols_, int type_, Scalar s_, Allocator* allocator_) + : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), allocator(allocator_) +{ + if (rows_ > 0 && cols_ > 0) + { + create(rows_, cols_, type_); + setTo(s_); + } +} + +inline +GpuMat::GpuMat(Size size_, int type_, Scalar s_, Allocator* allocator_) + : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), allocator(allocator_) +{ + if (size_.height > 0 && size_.width > 0) + { + create(size_.height, size_.width, type_); + setTo(s_); + } +} + +inline +GpuMat::GpuMat(const GpuMat& m) + : flags(m.flags), rows(m.rows), cols(m.cols), step(m.step), data(m.data), refcount(m.refcount), datastart(m.datastart), dataend(m.dataend), allocator(m.allocator) +{ + if (refcount) + CV_XADD(refcount, 1); +} + +inline +GpuMat::GpuMat(InputArray arr, Allocator* allocator_) : + flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), allocator(allocator_) +{ + upload(arr); +} + +inline +GpuMat::~GpuMat() +{ + release(); +} + +inline +GpuMat& GpuMat::operator =(const GpuMat& m) +{ + if (this != &m) + { + GpuMat temp(m); + swap(temp); + } + + return *this; +} + +inline +void GpuMat::create(Size size_, int type_) +{ + create(size_.height, size_.width, type_); +} + +inline +void GpuMat::swap(GpuMat& b) +{ + std::swap(flags, b.flags); + std::swap(rows, b.rows); + std::swap(cols, b.cols); + std::swap(step, b.step); + std::swap(data, b.data); + std::swap(datastart, b.datastart); + std::swap(dataend, b.dataend); + std::swap(refcount, b.refcount); + std::swap(allocator, b.allocator); +} + +inline +GpuMat GpuMat::clone() const +{ + GpuMat m; + copyTo(m); + return m; +} + +inline +void GpuMat::copyTo(OutputArray dst, InputArray mask) const +{ + copyTo(dst, mask, Stream::Null()); +} + +inline +GpuMat& GpuMat::setTo(Scalar s) +{ + return setTo(s, Stream::Null()); +} + +inline +GpuMat& GpuMat::setTo(Scalar s, InputArray mask) +{ + return setTo(s, mask, Stream::Null()); +} + +inline +void GpuMat::convertTo(OutputArray dst, int rtype) const +{ + convertTo(dst, rtype, Stream::Null()); +} + +inline +void GpuMat::convertTo(OutputArray dst, int rtype, double alpha, double beta) const +{ + convertTo(dst, rtype, alpha, beta, Stream::Null()); +} + +inline +void GpuMat::convertTo(OutputArray dst, int rtype, double alpha, Stream& stream) const +{ + convertTo(dst, rtype, alpha, 0.0, stream); +} + +inline +void GpuMat::assignTo(GpuMat& m, int _type) const +{ + if (_type < 0) + m = *this; + else + convertTo(m, _type); +} + +inline +uchar* GpuMat::ptr(int y) +{ + CV_DbgAssert( (unsigned)y < (unsigned)rows ); + return data + step * y; +} + +inline +const uchar* GpuMat::ptr(int y) const +{ + CV_DbgAssert( (unsigned)y < (unsigned)rows ); + return data + step * y; +} + +template inline +_Tp* GpuMat::ptr(int y) +{ + return (_Tp*)ptr(y); +} + +template inline +const _Tp* GpuMat::ptr(int y) const +{ + return (const _Tp*)ptr(y); +} + +template inline +GpuMat::operator PtrStepSz() const +{ + return PtrStepSz(rows, cols, (T*)data, step); +} + +template inline +GpuMat::operator PtrStep() const +{ + return PtrStep((T*)data, step); +} + +inline +GpuMat GpuMat::row(int y) const +{ + return GpuMat(*this, Range(y, y+1), Range::all()); +} + +inline +GpuMat GpuMat::col(int x) const +{ + return GpuMat(*this, Range::all(), Range(x, x+1)); +} + +inline +GpuMat GpuMat::rowRange(int startrow, int endrow) const +{ + return GpuMat(*this, Range(startrow, endrow), Range::all()); +} + +inline +GpuMat GpuMat::rowRange(Range r) const +{ + return GpuMat(*this, r, Range::all()); +} + +inline +GpuMat GpuMat::colRange(int startcol, int endcol) const +{ + return GpuMat(*this, Range::all(), Range(startcol, endcol)); +} + +inline +GpuMat GpuMat::colRange(Range r) const +{ + return GpuMat(*this, Range::all(), r); +} + +inline +GpuMat GpuMat::operator ()(Range rowRange_, Range colRange_) const +{ + return GpuMat(*this, rowRange_, colRange_); +} + +inline +GpuMat GpuMat::operator ()(Rect roi) const +{ + return GpuMat(*this, roi); +} + +inline +bool GpuMat::isContinuous() const +{ + return (flags & Mat::CONTINUOUS_FLAG) != 0; +} + +inline +size_t GpuMat::elemSize() const +{ + return CV_ELEM_SIZE(flags); +} + +inline +size_t GpuMat::elemSize1() const +{ + return CV_ELEM_SIZE1(flags); +} + +inline +int GpuMat::type() const +{ + return CV_MAT_TYPE(flags); +} + +inline +int GpuMat::depth() const +{ + return CV_MAT_DEPTH(flags); +} + +inline +int GpuMat::channels() const +{ + return CV_MAT_CN(flags); +} + +inline +size_t GpuMat::step1() const +{ + return step / elemSize1(); +} + +inline +Size GpuMat::size() const +{ + return Size(cols, rows); +} + +inline +bool GpuMat::empty() const +{ + return data == 0; +} + +static inline +GpuMat createContinuous(int rows, int cols, int type) +{ + GpuMat m; + createContinuous(rows, cols, type, m); + return m; +} + +static inline +void createContinuous(Size size, int type, OutputArray arr) +{ + createContinuous(size.height, size.width, type, arr); +} + +static inline +GpuMat createContinuous(Size size, int type) +{ + GpuMat m; + createContinuous(size, type, m); + return m; +} + +static inline +void ensureSizeIsEnough(Size size, int type, OutputArray arr) +{ + ensureSizeIsEnough(size.height, size.width, type, arr); +} + +static inline +void swap(GpuMat& a, GpuMat& b) +{ + a.swap(b); +} + +//=================================================================================== +// HostMem +//=================================================================================== + +inline +HostMem::HostMem(AllocType alloc_type_) + : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), alloc_type(alloc_type_) +{ +} + +inline +HostMem::HostMem(const HostMem& m) + : flags(m.flags), rows(m.rows), cols(m.cols), step(m.step), data(m.data), refcount(m.refcount), datastart(m.datastart), dataend(m.dataend), alloc_type(m.alloc_type) +{ + if( refcount ) + CV_XADD(refcount, 1); +} + +inline +HostMem::HostMem(int rows_, int cols_, int type_, AllocType alloc_type_) + : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), alloc_type(alloc_type_) +{ + if (rows_ > 0 && cols_ > 0) + create(rows_, cols_, type_); +} + +inline +HostMem::HostMem(Size size_, int type_, AllocType alloc_type_) + : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), alloc_type(alloc_type_) +{ + if (size_.height > 0 && size_.width > 0) + create(size_.height, size_.width, type_); +} + +inline +HostMem::HostMem(InputArray arr, AllocType alloc_type_) + : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), alloc_type(alloc_type_) +{ + arr.getMat().copyTo(*this); +} + +inline +HostMem::~HostMem() +{ + release(); +} + +inline +HostMem& HostMem::operator =(const HostMem& m) +{ + if (this != &m) + { + HostMem temp(m); + swap(temp); + } + + return *this; +} + +inline +void HostMem::swap(HostMem& b) +{ + std::swap(flags, b.flags); + std::swap(rows, b.rows); + std::swap(cols, b.cols); + std::swap(step, b.step); + std::swap(data, b.data); + std::swap(datastart, b.datastart); + std::swap(dataend, b.dataend); + std::swap(refcount, b.refcount); + std::swap(alloc_type, b.alloc_type); +} + +inline +HostMem HostMem::clone() const +{ + HostMem m(size(), type(), alloc_type); + createMatHeader().copyTo(m); + return m; +} + +inline +void HostMem::create(Size size_, int type_) +{ + create(size_.height, size_.width, type_); +} + +inline +Mat HostMem::createMatHeader() const +{ + return Mat(size(), type(), data, step); +} + +inline +bool HostMem::isContinuous() const +{ + return (flags & Mat::CONTINUOUS_FLAG) != 0; +} + +inline +size_t HostMem::elemSize() const +{ + return CV_ELEM_SIZE(flags); +} + +inline +size_t HostMem::elemSize1() const +{ + return CV_ELEM_SIZE1(flags); +} + +inline +int HostMem::type() const +{ + return CV_MAT_TYPE(flags); +} + +inline +int HostMem::depth() const +{ + return CV_MAT_DEPTH(flags); +} + +inline +int HostMem::channels() const +{ + return CV_MAT_CN(flags); +} + +inline +size_t HostMem::step1() const +{ + return step / elemSize1(); +} + +inline +Size HostMem::size() const +{ + return Size(cols, rows); +} + +inline +bool HostMem::empty() const +{ + return data == 0; +} + +static inline +void swap(HostMem& a, HostMem& b) +{ + a.swap(b); +} + +//=================================================================================== +// Stream +//=================================================================================== + +inline +Stream::Stream(const Ptr& impl) + : impl_(impl) +{ +} + +//=================================================================================== +// Event +//=================================================================================== + +inline +Event::Event(const Ptr& impl) + : impl_(impl) +{ +} + +//=================================================================================== +// Initialization & Info +//=================================================================================== + +inline +bool TargetArchs::has(int major, int minor) +{ + return hasPtx(major, minor) || hasBin(major, minor); +} + +inline +bool TargetArchs::hasEqualOrGreater(int major, int minor) +{ + return hasEqualOrGreaterPtx(major, minor) || hasEqualOrGreaterBin(major, minor); +} + +inline +DeviceInfo::DeviceInfo() +{ + device_id_ = getDevice(); +} + +inline +DeviceInfo::DeviceInfo(int device_id) +{ + CV_Assert( device_id >= 0 && device_id < getCudaEnabledDeviceCount() ); + device_id_ = device_id; +} + +inline +int DeviceInfo::deviceID() const +{ + return device_id_; +} + +inline +size_t DeviceInfo::freeMemory() const +{ + size_t _totalMemory = 0, _freeMemory = 0; + queryMemory(_totalMemory, _freeMemory); + return _freeMemory; +} + +inline +size_t DeviceInfo::totalMemory() const +{ + size_t _totalMemory = 0, _freeMemory = 0; + queryMemory(_totalMemory, _freeMemory); + return _totalMemory; +} + +inline +bool DeviceInfo::supports(FeatureSet feature_set) const +{ + int version = majorVersion() * 10 + minorVersion(); + return version >= feature_set; +} + + +}} // namespace cv { namespace cuda { + +//=================================================================================== +// Mat +//=================================================================================== + +namespace cv { + +inline +Mat::Mat(const cuda::GpuMat& m) + : flags(0), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0), datalimit(0), allocator(0), u(0), size(&rows) +{ + m.download(*this); +} + +} + +//! @endcond + +#endif // __OPENCV_CORE_CUDAINL_HPP__ diff --git a/lib/opencv/include/opencv2/core/cuda_stream_accessor.hpp b/lib/opencv/include/opencv2/core/cuda_stream_accessor.hpp new file mode 100644 index 000000000..0f8ee9b2d --- /dev/null +++ b/lib/opencv/include/opencv2/core/cuda_stream_accessor.hpp @@ -0,0 +1,86 @@ +/*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_CORE_CUDA_STREAM_ACCESSOR_HPP__ +#define __OPENCV_CORE_CUDA_STREAM_ACCESSOR_HPP__ + +#ifndef __cplusplus +# error cuda_stream_accessor.hpp header must be compiled as C++ +#endif + +/** @file cuda_stream_accessor.hpp + * This is only header file that depends on CUDA Runtime API. All other headers are independent. + */ + +#include +#include "opencv2/core/cuda.hpp" + +namespace cv +{ + namespace cuda + { + +//! @addtogroup cudacore_struct +//! @{ + + /** @brief Class that enables getting cudaStream_t from cuda::Stream + */ + struct StreamAccessor + { + CV_EXPORTS static cudaStream_t getStream(const Stream& stream); + CV_EXPORTS static Stream wrapStream(cudaStream_t stream); + }; + + /** @brief Class that enables getting cudaEvent_t from cuda::Event + */ + struct EventAccessor + { + CV_EXPORTS static cudaEvent_t getEvent(const Event& event); + CV_EXPORTS static Event wrapEvent(cudaEvent_t event); + }; + +//! @} + + } +} + +#endif /* __OPENCV_CORE_CUDA_STREAM_ACCESSOR_HPP__ */ diff --git a/lib/opencv/include/opencv2/core/cuda_types.hpp b/lib/opencv/include/opencv2/core/cuda_types.hpp new file mode 100644 index 000000000..8df816e8d --- /dev/null +++ b/lib/opencv/include/opencv2/core/cuda_types.hpp @@ -0,0 +1,135 @@ +/*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_CORE_CUDA_TYPES_HPP__ +#define __OPENCV_CORE_CUDA_TYPES_HPP__ + +#ifndef __cplusplus +# error cuda_types.hpp header must be compiled as C++ +#endif + +/** @file + * @deprecated Use @ref cudev instead. + */ + +//! @cond IGNORED + +#ifdef __CUDACC__ + #define __CV_CUDA_HOST_DEVICE__ __host__ __device__ __forceinline__ +#else + #define __CV_CUDA_HOST_DEVICE__ +#endif + +namespace cv +{ + namespace cuda + { + + // Simple lightweight structures that encapsulates information about an image on device. + // It is intended to pass to nvcc-compiled code. GpuMat depends on headers that nvcc can't compile + + template struct DevPtr + { + typedef T elem_type; + typedef int index_type; + + enum { elem_size = sizeof(elem_type) }; + + T* data; + + __CV_CUDA_HOST_DEVICE__ DevPtr() : data(0) {} + __CV_CUDA_HOST_DEVICE__ DevPtr(T* data_) : data(data_) {} + + __CV_CUDA_HOST_DEVICE__ size_t elemSize() const { return elem_size; } + __CV_CUDA_HOST_DEVICE__ operator T*() { return data; } + __CV_CUDA_HOST_DEVICE__ operator const T*() const { return data; } + }; + + template struct PtrSz : public DevPtr + { + __CV_CUDA_HOST_DEVICE__ PtrSz() : size(0) {} + __CV_CUDA_HOST_DEVICE__ PtrSz(T* data_, size_t size_) : DevPtr(data_), size(size_) {} + + size_t size; + }; + + template struct PtrStep : public DevPtr + { + __CV_CUDA_HOST_DEVICE__ PtrStep() : step(0) {} + __CV_CUDA_HOST_DEVICE__ PtrStep(T* data_, size_t step_) : DevPtr(data_), step(step_) {} + + size_t step; + + __CV_CUDA_HOST_DEVICE__ T* ptr(int y = 0) { return ( T*)( ( char*)DevPtr::data + y * step); } + __CV_CUDA_HOST_DEVICE__ const T* ptr(int y = 0) const { return (const T*)( (const char*)DevPtr::data + y * step); } + + __CV_CUDA_HOST_DEVICE__ T& operator ()(int y, int x) { return ptr(y)[x]; } + __CV_CUDA_HOST_DEVICE__ const T& operator ()(int y, int x) const { return ptr(y)[x]; } + }; + + template struct PtrStepSz : public PtrStep + { + __CV_CUDA_HOST_DEVICE__ PtrStepSz() : cols(0), rows(0) {} + __CV_CUDA_HOST_DEVICE__ PtrStepSz(int rows_, int cols_, T* data_, size_t step_) + : PtrStep(data_, step_), cols(cols_), rows(rows_) {} + + template + explicit PtrStepSz(const PtrStepSz& d) : PtrStep((T*)d.data, d.step), cols(d.cols), rows(d.rows){} + + int cols; + int rows; + }; + + typedef PtrStepSz PtrStepSzb; + typedef PtrStepSz PtrStepSzf; + typedef PtrStepSz PtrStepSzi; + + typedef PtrStep PtrStepb; + typedef PtrStep PtrStepf; + typedef PtrStep PtrStepi; + + } +} + +//! @endcond + +#endif /* __OPENCV_CORE_CUDA_TYPES_HPP__ */ diff --git a/lib/opencv/include/opencv2/core/cvdef.h b/lib/opencv/include/opencv2/core/cvdef.h new file mode 100644 index 000000000..af2abfbb2 --- /dev/null +++ b/lib/opencv/include/opencv2/core/cvdef.h @@ -0,0 +1,515 @@ +/*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. +// 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_CVDEF_H__ +#define __OPENCV_CORE_CVDEF_H__ + +//! @addtogroup core_utils +//! @{ + +#if !defined _CRT_SECURE_NO_DEPRECATE && defined _MSC_VER && _MSC_VER > 1300 +# define _CRT_SECURE_NO_DEPRECATE /* to avoid multiple Visual Studio warnings */ +#endif + +// undef problematic defines sometimes defined by system headers (windows.h in particular) +#undef small +#undef min +#undef max +#undef abs +#undef Complex + +#if !defined _CRT_SECURE_NO_DEPRECATE && defined _MSC_VER && _MSC_VER > 1300 +# define _CRT_SECURE_NO_DEPRECATE /* to avoid multiple Visual Studio warnings */ +#endif + +#include +#include "opencv2/core/hal/interface.h" + +#if defined __ICL +# define CV_ICC __ICL +#elif defined __ICC +# define CV_ICC __ICC +#elif defined __ECL +# define CV_ICC __ECL +#elif defined __ECC +# define CV_ICC __ECC +#elif defined __INTEL_COMPILER +# define CV_ICC __INTEL_COMPILER +#endif + +#ifndef CV_INLINE +# if defined __cplusplus +# define CV_INLINE static inline +# elif defined _MSC_VER +# define CV_INLINE __inline +# else +# define CV_INLINE static +# endif +#endif + +#if defined CV_ICC && !defined CV_ENABLE_UNROLLED +# define CV_ENABLE_UNROLLED 0 +#else +# define CV_ENABLE_UNROLLED 1 +#endif + +#ifdef __GNUC__ +# define CV_DECL_ALIGNED(x) __attribute__ ((aligned (x))) +#elif defined _MSC_VER +# define CV_DECL_ALIGNED(x) __declspec(align(x)) +#else +# define CV_DECL_ALIGNED(x) +#endif + +/* CPU features and intrinsics support */ +#define CV_CPU_NONE 0 +#define CV_CPU_MMX 1 +#define CV_CPU_SSE 2 +#define CV_CPU_SSE2 3 +#define CV_CPU_SSE3 4 +#define CV_CPU_SSSE3 5 +#define CV_CPU_SSE4_1 6 +#define CV_CPU_SSE4_2 7 +#define CV_CPU_POPCNT 8 + +#define CV_CPU_AVX 10 +#define CV_CPU_AVX2 11 +#define CV_CPU_FMA3 12 + +#define CV_CPU_AVX_512F 13 +#define CV_CPU_AVX_512BW 14 +#define CV_CPU_AVX_512CD 15 +#define CV_CPU_AVX_512DQ 16 +#define CV_CPU_AVX_512ER 17 +#define CV_CPU_AVX_512IFMA512 18 +#define CV_CPU_AVX_512PF 19 +#define CV_CPU_AVX_512VBMI 20 +#define CV_CPU_AVX_512VL 21 + +#define CV_CPU_NEON 100 + +// when adding to this list remember to update the following enum +#define CV_HARDWARE_MAX_FEATURE 255 + +/** @brief Available CPU features. +*/ +enum CpuFeatures { + CPU_MMX = 1, + CPU_SSE = 2, + CPU_SSE2 = 3, + CPU_SSE3 = 4, + CPU_SSSE3 = 5, + CPU_SSE4_1 = 6, + CPU_SSE4_2 = 7, + CPU_POPCNT = 8, + + CPU_AVX = 10, + CPU_AVX2 = 11, + CPU_FMA3 = 12, + + CPU_AVX_512F = 13, + CPU_AVX_512BW = 14, + CPU_AVX_512CD = 15, + CPU_AVX_512DQ = 16, + CPU_AVX_512ER = 17, + CPU_AVX_512IFMA512 = 18, + CPU_AVX_512PF = 19, + CPU_AVX_512VBMI = 20, + CPU_AVX_512VL = 21, + + CPU_NEON = 100 +}; + +// do not include SSE/AVX/NEON headers for NVCC compiler +#ifndef __CUDACC__ + +#if defined __SSE2__ || defined _M_X64 || (defined _M_IX86_FP && _M_IX86_FP >= 2) +# include +# define CV_MMX 1 +# define CV_SSE 1 +# define CV_SSE2 1 +# if defined __SSE3__ || (defined _MSC_VER && _MSC_VER >= 1500) +# include +# define CV_SSE3 1 +# endif +# if defined __SSSE3__ || (defined _MSC_VER && _MSC_VER >= 1500) +# include +# define CV_SSSE3 1 +# endif +# if defined __SSE4_1__ || (defined _MSC_VER && _MSC_VER >= 1500) +# include +# define CV_SSE4_1 1 +# endif +# if defined __SSE4_2__ || (defined _MSC_VER && _MSC_VER >= 1500) +# include +# define CV_SSE4_2 1 +# endif +# if defined __POPCNT__ || (defined _MSC_VER && _MSC_VER >= 1500) +# ifdef _MSC_VER +# include +# else +# include +# endif +# define CV_POPCNT 1 +# endif +# if defined __AVX__ || (defined _MSC_VER && _MSC_VER >= 1600 && 0) +// MS Visual Studio 2010 (2012?) has no macro pre-defined to identify the use of /arch:AVX +// See: http://connect.microsoft.com/VisualStudio/feedback/details/605858/arch-avx-should-define-a-predefined-macro-in-x64-and-set-a-unique-value-for-m-ix86-fp-in-win32 +# include +# define CV_AVX 1 +# if defined(_XCR_XFEATURE_ENABLED_MASK) +# define __xgetbv() _xgetbv(_XCR_XFEATURE_ENABLED_MASK) +# else +# define __xgetbv() 0 +# endif +# endif +# if defined __AVX2__ || (defined _MSC_VER && _MSC_VER >= 1800 && 0) +# include +# define CV_AVX2 1 +# if defined __FMA__ +# define CV_FMA3 1 +# endif +# endif +#endif + +#if (defined WIN32 || defined _WIN32) && defined(_M_ARM) +# include +# include "arm_neon.h" +# define CV_NEON 1 +# define CPU_HAS_NEON_FEATURE (true) +#elif defined(__ARM_NEON__) || (defined (__ARM_NEON) && defined(__aarch64__)) +# include +# define CV_NEON 1 +#endif + +#if defined __GNUC__ && defined __arm__ && (defined __ARM_PCS_VFP || defined __ARM_VFPV3__ || defined __ARM_NEON__) && !defined __SOFTFP__ +# define CV_VFP 1 +#endif + +#endif // __CUDACC__ + +#ifndef CV_POPCNT +#define CV_POPCNT 0 +#endif +#ifndef CV_MMX +# define CV_MMX 0 +#endif +#ifndef CV_SSE +# define CV_SSE 0 +#endif +#ifndef CV_SSE2 +# define CV_SSE2 0 +#endif +#ifndef CV_SSE3 +# define CV_SSE3 0 +#endif +#ifndef CV_SSSE3 +# define CV_SSSE3 0 +#endif +#ifndef CV_SSE4_1 +# define CV_SSE4_1 0 +#endif +#ifndef CV_SSE4_2 +# define CV_SSE4_2 0 +#endif +#ifndef CV_AVX +# define CV_AVX 0 +#endif +#ifndef CV_AVX2 +# define CV_AVX2 0 +#endif +#ifndef CV_FMA3 +# define CV_FMA3 0 +#endif +#ifndef CV_AVX_512F +# define CV_AVX_512F 0 +#endif +#ifndef CV_AVX_512BW +# define CV_AVX_512BW 0 +#endif +#ifndef CV_AVX_512CD +# define CV_AVX_512CD 0 +#endif +#ifndef CV_AVX_512DQ +# define CV_AVX_512DQ 0 +#endif +#ifndef CV_AVX_512ER +# define CV_AVX_512ER 0 +#endif +#ifndef CV_AVX_512IFMA512 +# define CV_AVX_512IFMA512 0 +#endif +#ifndef CV_AVX_512PF +# define CV_AVX_512PF 0 +#endif +#ifndef CV_AVX_512VBMI +# define CV_AVX_512VBMI 0 +#endif +#ifndef CV_AVX_512VL +# define CV_AVX_512VL 0 +#endif + +#ifndef CV_NEON +# define CV_NEON 0 +#endif + +#ifndef CV_VFP +# define CV_VFP 0 +#endif + +/* fundamental constants */ +#define CV_PI 3.1415926535897932384626433832795 +#define CV_2PI 6.283185307179586476925286766559 +#define CV_LOG2 0.69314718055994530941723212145818 + +typedef union Cv32suf +{ + int i; + unsigned u; + float f; +} +Cv32suf; + +typedef union Cv64suf +{ + int64 i; + uint64 u; + double f; +} +Cv64suf; + +#define OPENCV_ABI_COMPATIBILITY 300 + +#ifdef __OPENCV_BUILD +# define DISABLE_OPENCV_24_COMPATIBILITY +#endif + +#if (defined WIN32 || defined _WIN32 || defined WINCE || defined __CYGWIN__) && defined CVAPI_EXPORTS +# define CV_EXPORTS __declspec(dllexport) +#elif defined __GNUC__ && __GNUC__ >= 4 +# define CV_EXPORTS __attribute__ ((visibility ("default"))) +#else +# define CV_EXPORTS +#endif + +#ifndef CV_EXTERN_C +# ifdef __cplusplus +# define CV_EXTERN_C extern "C" +# else +# define CV_EXTERN_C +# endif +#endif + +/* special informative macros for wrapper generators */ +#define CV_EXPORTS_W CV_EXPORTS +#define CV_EXPORTS_W_SIMPLE CV_EXPORTS +#define CV_EXPORTS_AS(synonym) CV_EXPORTS +#define CV_EXPORTS_W_MAP CV_EXPORTS +#define CV_IN_OUT +#define CV_OUT +#define CV_PROP +#define CV_PROP_RW +#define CV_WRAP +#define CV_WRAP_AS(synonym) + +/****************************************************************************************\ +* Matrix type (Mat) * +\****************************************************************************************/ + +#define CV_CN_MAX 512 +#define CV_CN_SHIFT 3 +#define CV_DEPTH_MAX (1 << CV_CN_SHIFT) + +#define CV_8U 0 +#define CV_8S 1 +#define CV_16U 2 +#define CV_16S 3 +#define CV_32S 4 +#define CV_32F 5 +#define CV_64F 6 +#define CV_USRTYPE1 7 + +#define CV_MAT_DEPTH_MASK (CV_DEPTH_MAX - 1) +#define CV_MAT_DEPTH(flags) ((flags) & CV_MAT_DEPTH_MASK) + +#define CV_MAKETYPE(depth,cn) (CV_MAT_DEPTH(depth) + (((cn)-1) << CV_CN_SHIFT)) +#define CV_MAKE_TYPE CV_MAKETYPE + +#define CV_8UC1 CV_MAKETYPE(CV_8U,1) +#define CV_8UC2 CV_MAKETYPE(CV_8U,2) +#define CV_8UC3 CV_MAKETYPE(CV_8U,3) +#define CV_8UC4 CV_MAKETYPE(CV_8U,4) +#define CV_8UC(n) CV_MAKETYPE(CV_8U,(n)) + +#define CV_8SC1 CV_MAKETYPE(CV_8S,1) +#define CV_8SC2 CV_MAKETYPE(CV_8S,2) +#define CV_8SC3 CV_MAKETYPE(CV_8S,3) +#define CV_8SC4 CV_MAKETYPE(CV_8S,4) +#define CV_8SC(n) CV_MAKETYPE(CV_8S,(n)) + +#define CV_16UC1 CV_MAKETYPE(CV_16U,1) +#define CV_16UC2 CV_MAKETYPE(CV_16U,2) +#define CV_16UC3 CV_MAKETYPE(CV_16U,3) +#define CV_16UC4 CV_MAKETYPE(CV_16U,4) +#define CV_16UC(n) CV_MAKETYPE(CV_16U,(n)) + +#define CV_16SC1 CV_MAKETYPE(CV_16S,1) +#define CV_16SC2 CV_MAKETYPE(CV_16S,2) +#define CV_16SC3 CV_MAKETYPE(CV_16S,3) +#define CV_16SC4 CV_MAKETYPE(CV_16S,4) +#define CV_16SC(n) CV_MAKETYPE(CV_16S,(n)) + +#define CV_32SC1 CV_MAKETYPE(CV_32S,1) +#define CV_32SC2 CV_MAKETYPE(CV_32S,2) +#define CV_32SC3 CV_MAKETYPE(CV_32S,3) +#define CV_32SC4 CV_MAKETYPE(CV_32S,4) +#define CV_32SC(n) CV_MAKETYPE(CV_32S,(n)) + +#define CV_32FC1 CV_MAKETYPE(CV_32F,1) +#define CV_32FC2 CV_MAKETYPE(CV_32F,2) +#define CV_32FC3 CV_MAKETYPE(CV_32F,3) +#define CV_32FC4 CV_MAKETYPE(CV_32F,4) +#define CV_32FC(n) CV_MAKETYPE(CV_32F,(n)) + +#define CV_64FC1 CV_MAKETYPE(CV_64F,1) +#define CV_64FC2 CV_MAKETYPE(CV_64F,2) +#define CV_64FC3 CV_MAKETYPE(CV_64F,3) +#define CV_64FC4 CV_MAKETYPE(CV_64F,4) +#define CV_64FC(n) CV_MAKETYPE(CV_64F,(n)) + +#define CV_MAT_CN_MASK ((CV_CN_MAX - 1) << CV_CN_SHIFT) +#define CV_MAT_CN(flags) ((((flags) & CV_MAT_CN_MASK) >> CV_CN_SHIFT) + 1) +#define CV_MAT_TYPE_MASK (CV_DEPTH_MAX*CV_CN_MAX - 1) +#define CV_MAT_TYPE(flags) ((flags) & CV_MAT_TYPE_MASK) +#define CV_MAT_CONT_FLAG_SHIFT 14 +#define CV_MAT_CONT_FLAG (1 << CV_MAT_CONT_FLAG_SHIFT) +#define CV_IS_MAT_CONT(flags) ((flags) & CV_MAT_CONT_FLAG) +#define CV_IS_CONT_MAT CV_IS_MAT_CONT +#define CV_SUBMAT_FLAG_SHIFT 15 +#define CV_SUBMAT_FLAG (1 << CV_SUBMAT_FLAG_SHIFT) +#define CV_IS_SUBMAT(flags) ((flags) & CV_MAT_SUBMAT_FLAG) + +/** Size of each channel item, + 0x124489 = 1000 0100 0100 0010 0010 0001 0001 ~ array of sizeof(arr_type_elem) */ +#define CV_ELEM_SIZE1(type) \ + ((((sizeof(size_t)<<28)|0x8442211) >> CV_MAT_DEPTH(type)*4) & 15) + +/** 0x3a50 = 11 10 10 01 01 00 00 ~ array of log2(sizeof(arr_type_elem)) */ +#define CV_ELEM_SIZE(type) \ + (CV_MAT_CN(type) << ((((sizeof(size_t)/4+1)*16384|0x3a50) >> CV_MAT_DEPTH(type)*2) & 3)) + +#ifndef MIN +# define MIN(a,b) ((a) > (b) ? (b) : (a)) +#endif + +#ifndef MAX +# define MAX(a,b) ((a) < (b) ? (b) : (a)) +#endif + +/****************************************************************************************\ +* exchange-add operation for atomic operations on reference counters * +\****************************************************************************************/ + +#if defined __INTEL_COMPILER && !(defined WIN32 || defined _WIN32) + // atomic increment on the linux version of the Intel(tm) compiler +# define CV_XADD(addr, delta) (int)_InterlockedExchangeAdd(const_cast(reinterpret_cast(addr)), delta) +#elif defined __GNUC__ +# if defined __clang__ && __clang_major__ >= 3 && !defined __ANDROID__ && !defined __EMSCRIPTEN__ && !defined(__CUDACC__) +# ifdef __ATOMIC_ACQ_REL +# define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), delta, __ATOMIC_ACQ_REL) +# else +# define CV_XADD(addr, delta) __atomic_fetch_add((_Atomic(int)*)(addr), delta, 4) +# endif +# else +# if defined __ATOMIC_ACQ_REL && !defined __clang__ + // version for gcc >= 4.7 +# define CV_XADD(addr, delta) (int)__atomic_fetch_add((unsigned*)(addr), (unsigned)(delta), __ATOMIC_ACQ_REL) +# else +# define CV_XADD(addr, delta) (int)__sync_fetch_and_add((unsigned*)(addr), (unsigned)(delta)) +# endif +# endif +#elif defined _MSC_VER && !defined RC_INVOKED +# include +# define CV_XADD(addr, delta) (int)_InterlockedExchangeAdd((long volatile*)addr, delta) +#else + CV_INLINE CV_XADD(int* addr, int delta) { int tmp = *addr; *addr += delta; return tmp; } +#endif + + +/****************************************************************************************\ +* CV_NORETURN attribute * +\****************************************************************************************/ + +#ifndef CV_NORETURN +# if defined(__GNUC__) +# define CV_NORETURN __attribute__((__noreturn__)) +# elif defined(_MSC_VER) && (_MSC_VER >= 1300) +# define CV_NORETURN __declspec(noreturn) +# else +# define CV_NORETURN /* nothing by default */ +# endif +#endif + + +/****************************************************************************************\ +* C++ Move semantics * +\****************************************************************************************/ + +#ifndef CV_CXX_MOVE_SEMANTICS +# if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(_MSC_VER) && _MSC_VER >= 1600 +# define CV_CXX_MOVE_SEMANTICS 1 +# elif defined(__clang) +# if __has_feature(cxx_rvalue_references) +# define CV_CXX_MOVE_SEMANTICS 1 +# endif +# endif +#else +# if CV_CXX_MOVE_SEMANTICS == 0 +# undef CV_CXX_MOVE_SEMANTICS +# endif +#endif + +//! @} + +#endif // __OPENCV_CORE_CVDEF_H__ diff --git a/lib/opencv/include/opencv2/core/cvstd.hpp b/lib/opencv/include/opencv2/core/cvstd.hpp new file mode 100644 index 000000000..edae954ff --- /dev/null +++ b/lib/opencv/include/opencv2/core/cvstd.hpp @@ -0,0 +1,1069 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_CVSTD_HPP__ +#define __OPENCV_CORE_CVSTD_HPP__ + +#ifndef __cplusplus +# error cvstd.hpp header must be compiled as C++ +#endif + +#include "opencv2/core/cvdef.h" + +#include +#include +#include + +#ifndef OPENCV_NOSTL +# include +#endif + +// import useful primitives from stl +#ifndef OPENCV_NOSTL_TRANSITIONAL +# include +# include +# include //for abs(int) +# include + +namespace cv +{ + using std::min; + using std::max; + using std::abs; + using std::swap; + using std::sqrt; + using std::exp; + using std::pow; + using std::log; +} + +namespace std +{ + static inline uchar abs(uchar a) { return a; } + static inline ushort abs(ushort a) { return a; } + static inline unsigned abs(unsigned a) { return a; } + static inline uint64 abs(uint64 a) { return a; } +} + +#else +namespace cv +{ + template static inline T min(T a, T b) { return a < b ? a : b; } + template static inline T max(T a, T b) { return a > b ? a : b; } + template static inline T abs(T a) { return a < 0 ? -a : a; } + template static inline void swap(T& a, T& b) { T tmp = a; a = b; b = tmp; } + + template<> inline uchar abs(uchar a) { return a; } + template<> inline ushort abs(ushort a) { return a; } + template<> inline unsigned abs(unsigned a) { return a; } + template<> inline uint64 abs(uint64 a) { return a; } +} +#endif + +namespace cv { + +//! @addtogroup core_utils +//! @{ + +//////////////////////////// memory management functions //////////////////////////// + +/** @brief Allocates an aligned memory buffer. + +The function allocates the buffer of the specified size and returns it. When the buffer size is 16 +bytes or more, the returned buffer is aligned to 16 bytes. +@param bufSize Allocated buffer size. + */ +CV_EXPORTS void* fastMalloc(size_t bufSize); + +/** @brief Deallocates a memory buffer. + +The function deallocates the buffer allocated with fastMalloc . If NULL pointer is passed, the +function does nothing. C version of the function clears the pointer *pptr* to avoid problems with +double memory deallocation. +@param ptr Pointer to the allocated buffer. + */ +CV_EXPORTS void fastFree(void* ptr); + +/*! + The STL-compilant memory Allocator based on cv::fastMalloc() and cv::fastFree() +*/ +template class Allocator +{ +public: + typedef _Tp value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef size_t size_type; + typedef ptrdiff_t difference_type; + template class rebind { typedef Allocator other; }; + + explicit Allocator() {} + ~Allocator() {} + explicit Allocator(Allocator const&) {} + template + explicit Allocator(Allocator const&) {} + + // address + pointer address(reference r) { return &r; } + const_pointer address(const_reference r) { return &r; } + + pointer allocate(size_type count, const void* =0) { return reinterpret_cast(fastMalloc(count * sizeof (_Tp))); } + void deallocate(pointer p, size_type) { fastFree(p); } + + void construct(pointer p, const _Tp& v) { new(static_cast(p)) _Tp(v); } + void destroy(pointer p) { p->~_Tp(); } + + size_type max_size() const { return cv::max(static_cast<_Tp>(-1)/sizeof(_Tp), 1); } +}; + +//! @} core_utils + +//! @cond IGNORED + +namespace detail +{ + +// Metafunction to avoid taking a reference to void. +template +struct RefOrVoid { typedef T& type; }; + +template<> +struct RefOrVoid{ typedef void type; }; + +template<> +struct RefOrVoid{ typedef const void type; }; + +template<> +struct RefOrVoid{ typedef volatile void type; }; + +template<> +struct RefOrVoid{ typedef const volatile void type; }; + +// This class would be private to Ptr, if it didn't have to be a non-template. +struct PtrOwner; + +} + +template +struct DefaultDeleter +{ + void operator () (Y* p) const; +}; + +//! @endcond + +//! @addtogroup core_basic +//! @{ + +/** @brief Template class for smart pointers with shared ownership + +A Ptr\ pretends to be a pointer to an object of type T. Unlike an ordinary pointer, however, the +object will be automatically cleaned up once all Ptr instances pointing to it are destroyed. + +Ptr is similar to boost::shared_ptr that is part of the Boost library +() and std::shared_ptr from +the [C++11](http://en.wikipedia.org/wiki/C++11) standard. + +This class provides the following advantages: +- Default constructor, copy constructor, and assignment operator for an arbitrary C++ class or C + structure. For some objects, like files, windows, mutexes, sockets, and others, a copy + constructor or an assignment operator are difficult to define. For some other objects, like + complex classifiers in OpenCV, copy constructors are absent and not easy to implement. Finally, + some of complex OpenCV and your own data structures may be written in C. However, copy + constructors and default constructors can simplify programming a lot. Besides, they are often + required (for example, by STL containers). By using a Ptr to such an object instead of the + object itself, you automatically get all of the necessary constructors and the assignment + operator. +- *O(1)* complexity of the above-mentioned operations. While some structures, like std::vector, + provide a copy constructor and an assignment operator, the operations may take a considerable + amount of time if the data structures are large. But if the structures are put into a Ptr, the + overhead is small and independent of the data size. +- Automatic and customizable cleanup, even for C structures. See the example below with FILE\*. +- Heterogeneous collections of objects. The standard STL and most other C++ and OpenCV containers + can store only objects of the same type and the same size. The classical solution to store + objects of different types in the same container is to store pointers to the base class (Base\*) + instead but then you lose the automatic memory management. Again, by using Ptr\ instead + of raw pointers, you can solve the problem. + +A Ptr is said to *own* a pointer - that is, for each Ptr there is a pointer that will be deleted +once all Ptr instances that own it are destroyed. The owned pointer may be null, in which case +nothing is deleted. Each Ptr also *stores* a pointer. The stored pointer is the pointer the Ptr +pretends to be; that is, the one you get when you use Ptr::get or the conversion to T\*. It's +usually the same as the owned pointer, but if you use casts or the general shared-ownership +constructor, the two may diverge: the Ptr will still own the original pointer, but will itself point +to something else. + +The owned pointer is treated as a black box. The only thing Ptr needs to know about it is how to +delete it. This knowledge is encapsulated in the *deleter* - an auxiliary object that is associated +with the owned pointer and shared between all Ptr instances that own it. The default deleter is an +instance of DefaultDeleter, which uses the standard C++ delete operator; as such it will work with +any pointer allocated with the standard new operator. + +However, if the pointer must be deleted in a different way, you must specify a custom deleter upon +Ptr construction. A deleter is simply a callable object that accepts the pointer as its sole +argument. For example, if you want to wrap FILE, you may do so as follows: +@code + Ptr f(fopen("myfile.txt", "w"), fclose); + if(!f) throw ...; + fprintf(f, ....); + ... + // the file will be closed automatically by f's destructor. +@endcode +Alternatively, if you want all pointers of a particular type to be deleted the same way, you can +specialize DefaultDeleter::operator() for that type, like this: +@code + namespace cv { + template<> void DefaultDeleter::operator ()(FILE * obj) const + { + fclose(obj); + } + } +@endcode +For convenience, the following types from the OpenCV C API already have such a specialization that +calls the appropriate release function: +- CvCapture +- CvFileStorage +- CvHaarClassifierCascade +- CvMat +- CvMatND +- CvMemStorage +- CvSparseMat +- CvVideoWriter +- IplImage +@note The shared ownership mechanism is implemented with reference counting. As such, cyclic +ownership (e.g. when object a contains a Ptr to object b, which contains a Ptr to object a) will +lead to all involved objects never being cleaned up. Avoid such situations. +@note It is safe to concurrently read (but not write) a Ptr instance from multiple threads and +therefore it is normally safe to use it in multi-threaded applications. The same is true for Mat and +other C++ OpenCV classes that use internal reference counts. +*/ +template +struct Ptr +{ + /** Generic programming support. */ + typedef T element_type; + + /** The default constructor creates a null Ptr - one that owns and stores a null pointer. + */ + Ptr(); + + /** + If p is null, these are equivalent to the default constructor. + Otherwise, these constructors assume ownership of p - that is, the created Ptr owns and stores p + and assumes it is the sole owner of it. Don't use them if p is already owned by another Ptr, or + else p will get deleted twice. + With the first constructor, DefaultDeleter\() becomes the associated deleter (so p will + eventually be deleted with the standard delete operator). Y must be a complete type at the point + of invocation. + With the second constructor, d becomes the associated deleter. + Y\* must be convertible to T\*. + @param p Pointer to own. + @note It is often easier to use makePtr instead. + */ + template +#ifdef DISABLE_OPENCV_24_COMPATIBILITY + explicit +#endif + Ptr(Y* p); + + /** @overload + @param d Deleter to use for the owned pointer. + @param p Pointer to own. + */ + template + Ptr(Y* p, D d); + + /** + These constructors create a Ptr that shares ownership with another Ptr - that is, own the same + pointer as o. + With the first two, the same pointer is stored, as well; for the second, Y\* must be convertible + to T\*. + With the third, p is stored, and Y may be any type. This constructor allows to have completely + unrelated owned and stored pointers, and should be used with care to avoid confusion. A relatively + benign use is to create a non-owning Ptr, like this: + @code + ptr = Ptr(Ptr(), dont_delete_me); // owns nothing; will not delete the pointer. + @endcode + @param o Ptr to share ownership with. + */ + Ptr(const Ptr& o); + + /** @overload + @param o Ptr to share ownership with. + */ + template + Ptr(const Ptr& o); + + /** @overload + @param o Ptr to share ownership with. + @param p Pointer to store. + */ + template + Ptr(const Ptr& o, T* p); + + /** The destructor is equivalent to calling Ptr::release. */ + ~Ptr(); + + /** + Assignment replaces the current Ptr instance with one that owns and stores same pointers as o and + then destroys the old instance. + @param o Ptr to share ownership with. + */ + Ptr& operator = (const Ptr& o); + + /** @overload */ + template + Ptr& operator = (const Ptr& o); + + /** If no other Ptr instance owns the owned pointer, deletes it with the associated deleter. Then sets + both the owned and the stored pointers to NULL. + */ + void release(); + + /** + `ptr.reset(...)` is equivalent to `ptr = Ptr(...)`. + @param p Pointer to own. + */ + template + void reset(Y* p); + + /** @overload + @param d Deleter to use for the owned pointer. + @param p Pointer to own. + */ + template + void reset(Y* p, D d); + + /** + Swaps the owned and stored pointers (and deleters, if any) of this and o. + @param o Ptr to swap with. + */ + void swap(Ptr& o); + + /** Returns the stored pointer. */ + T* get() const; + + /** Ordinary pointer emulation. */ + typename detail::RefOrVoid::type operator * () const; + + /** Ordinary pointer emulation. */ + T* operator -> () const; + + /** Equivalent to get(). */ + operator T* () const; + + /** ptr.empty() is equivalent to `!ptr.get()`. */ + bool empty() const; + + /** Returns a Ptr that owns the same pointer as this, and stores the same + pointer as this, except converted via static_cast to Y*. + */ + template + Ptr staticCast() const; + + /** Ditto for const_cast. */ + template + Ptr constCast() const; + + /** Ditto for dynamic_cast. */ + template + Ptr dynamicCast() const; + +#ifdef CV_CXX_MOVE_SEMANTICS + Ptr(Ptr&& o); + Ptr& operator = (Ptr&& o); +#endif + +private: + detail::PtrOwner* owner; + T* stored; + + template + friend struct Ptr; // have to do this for the cross-type copy constructor +}; + +/** Equivalent to ptr1.swap(ptr2). Provided to help write generic algorithms. */ +template +void swap(Ptr& ptr1, Ptr& ptr2); + +/** Return whether ptr1.get() and ptr2.get() are equal and not equal, respectively. */ +template +bool operator == (const Ptr& ptr1, const Ptr& ptr2); +template +bool operator != (const Ptr& ptr1, const Ptr& ptr2); + +/** `makePtr(...)` is equivalent to `Ptr(new T(...))`. It is shorter than the latter, and it's +marginally safer than using a constructor or Ptr::reset, since it ensures that the owned pointer +is new and thus not owned by any other Ptr instance. +Unfortunately, perfect forwarding is impossible to implement in C++03, and so makePtr is limited +to constructors of T that have up to 10 arguments, none of which are non-const references. + */ +template +Ptr makePtr(); +/** @overload */ +template +Ptr makePtr(const A1& a1); +/** @overload */ +template +Ptr makePtr(const A1& a1, const A2& a2); +/** @overload */ +template +Ptr makePtr(const A1& a1, const A2& a2, const A3& a3); +/** @overload */ +template +Ptr makePtr(const A1& a1, const A2& a2, const A3& a3, const A4& a4); +/** @overload */ +template +Ptr makePtr(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5); +/** @overload */ +template +Ptr makePtr(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6); +/** @overload */ +template +Ptr makePtr(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7); +/** @overload */ +template +Ptr makePtr(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8); +/** @overload */ +template +Ptr makePtr(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9); +/** @overload */ +template +Ptr makePtr(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10); + +//////////////////////////////// string class //////////////////////////////// + +class CV_EXPORTS FileNode; //for string constructor from FileNode + +class CV_EXPORTS String +{ +public: + typedef char value_type; + typedef char& reference; + typedef const char& const_reference; + typedef char* pointer; + typedef const char* const_pointer; + typedef ptrdiff_t difference_type; + typedef size_t size_type; + typedef char* iterator; + typedef const char* const_iterator; + + static const size_t npos = size_t(-1); + + explicit String(); + String(const String& str); + String(const String& str, size_t pos, size_t len = npos); + String(const char* s); + String(const char* s, size_t n); + String(size_t n, char c); + String(const char* first, const char* last); + template String(Iterator first, Iterator last); + explicit String(const FileNode& fn); + ~String(); + + String& operator=(const String& str); + String& operator=(const char* s); + String& operator=(char c); + + String& operator+=(const String& str); + String& operator+=(const char* s); + String& operator+=(char c); + + size_t size() const; + size_t length() const; + + char operator[](size_t idx) const; + char operator[](int idx) const; + + const char* begin() const; + const char* end() const; + + const char* c_str() const; + + bool empty() const; + void clear(); + + int compare(const char* s) const; + int compare(const String& str) const; + + void swap(String& str); + String substr(size_t pos = 0, size_t len = npos) const; + + size_t find(const char* s, size_t pos, size_t n) const; + size_t find(char c, size_t pos = 0) const; + size_t find(const String& str, size_t pos = 0) const; + size_t find(const char* s, size_t pos = 0) const; + + size_t rfind(const char* s, size_t pos, size_t n) const; + size_t rfind(char c, size_t pos = npos) const; + size_t rfind(const String& str, size_t pos = npos) const; + size_t rfind(const char* s, size_t pos = npos) const; + + size_t find_first_of(const char* s, size_t pos, size_t n) const; + size_t find_first_of(char c, size_t pos = 0) const; + size_t find_first_of(const String& str, size_t pos = 0) const; + size_t find_first_of(const char* s, size_t pos = 0) const; + + size_t find_last_of(const char* s, size_t pos, size_t n) const; + size_t find_last_of(char c, size_t pos = npos) const; + size_t find_last_of(const String& str, size_t pos = npos) const; + size_t find_last_of(const char* s, size_t pos = npos) const; + + friend String operator+ (const String& lhs, const String& rhs); + friend String operator+ (const String& lhs, const char* rhs); + friend String operator+ (const char* lhs, const String& rhs); + friend String operator+ (const String& lhs, char rhs); + friend String operator+ (char lhs, const String& rhs); + + String toLowerCase() const; + +#ifndef OPENCV_NOSTL + String(const std::string& str); + String(const std::string& str, size_t pos, size_t len = npos); + String& operator=(const std::string& str); + String& operator+=(const std::string& str); + operator std::string() const; + + friend String operator+ (const String& lhs, const std::string& rhs); + friend String operator+ (const std::string& lhs, const String& rhs); +#endif + +private: + char* cstr_; + size_t len_; + + char* allocate(size_t len); // len without trailing 0 + void deallocate(); + + String(int); // disabled and invalid. Catch invalid usages like, commandLineParser.has(0) problem +}; + +//! @} core_basic + +////////////////////////// cv::String implementation ///////////////////////// + +//! @cond IGNORED + +inline +String::String() + : cstr_(0), len_(0) +{} + +inline +String::String(const String& str) + : cstr_(str.cstr_), len_(str.len_) +{ + if (cstr_) + CV_XADD(((int*)cstr_)-1, 1); +} + +inline +String::String(const String& str, size_t pos, size_t len) + : cstr_(0), len_(0) +{ + pos = min(pos, str.len_); + len = min(str.len_ - pos, len); + if (!len) return; + if (len == str.len_) + { + CV_XADD(((int*)str.cstr_)-1, 1); + cstr_ = str.cstr_; + len_ = str.len_; + return; + } + memcpy(allocate(len), str.cstr_ + pos, len); +} + +inline +String::String(const char* s) + : cstr_(0), len_(0) +{ + if (!s) return; + size_t len = strlen(s); + memcpy(allocate(len), s, len); +} + +inline +String::String(const char* s, size_t n) + : cstr_(0), len_(0) +{ + if (!n) return; + memcpy(allocate(n), s, n); +} + +inline +String::String(size_t n, char c) + : cstr_(0), len_(0) +{ + memset(allocate(n), c, n); +} + +inline +String::String(const char* first, const char* last) + : cstr_(0), len_(0) +{ + size_t len = (size_t)(last - first); + memcpy(allocate(len), first, len); +} + +template inline +String::String(Iterator first, Iterator last) + : cstr_(0), len_(0) +{ + size_t len = (size_t)(last - first); + char* str = allocate(len); + while (first != last) + { + *str++ = *first; + ++first; + } +} + +inline +String::~String() +{ + deallocate(); +} + +inline +String& String::operator=(const String& str) +{ + if (&str == this) return *this; + + deallocate(); + if (str.cstr_) CV_XADD(((int*)str.cstr_)-1, 1); + cstr_ = str.cstr_; + len_ = str.len_; + return *this; +} + +inline +String& String::operator=(const char* s) +{ + deallocate(); + if (!s) return *this; + size_t len = strlen(s); + memcpy(allocate(len), s, len); + return *this; +} + +inline +String& String::operator=(char c) +{ + deallocate(); + allocate(1)[0] = c; + return *this; +} + +inline +String& String::operator+=(const String& str) +{ + *this = *this + str; + return *this; +} + +inline +String& String::operator+=(const char* s) +{ + *this = *this + s; + return *this; +} + +inline +String& String::operator+=(char c) +{ + *this = *this + c; + return *this; +} + +inline +size_t String::size() const +{ + return len_; +} + +inline +size_t String::length() const +{ + return len_; +} + +inline +char String::operator[](size_t idx) const +{ + return cstr_[idx]; +} + +inline +char String::operator[](int idx) const +{ + return cstr_[idx]; +} + +inline +const char* String::begin() const +{ + return cstr_; +} + +inline +const char* String::end() const +{ + return len_ ? cstr_ + 1 : 0; +} + +inline +bool String::empty() const +{ + return len_ == 0; +} + +inline +const char* String::c_str() const +{ + return cstr_ ? cstr_ : ""; +} + +inline +void String::swap(String& str) +{ + cv::swap(cstr_, str.cstr_); + cv::swap(len_, str.len_); +} + +inline +void String::clear() +{ + deallocate(); +} + +inline +int String::compare(const char* s) const +{ + if (cstr_ == s) return 0; + return strcmp(c_str(), s); +} + +inline +int String::compare(const String& str) const +{ + if (cstr_ == str.cstr_) return 0; + return strcmp(c_str(), str.c_str()); +} + +inline +String String::substr(size_t pos, size_t len) const +{ + return String(*this, pos, len); +} + +inline +size_t String::find(const char* s, size_t pos, size_t n) const +{ + if (n == 0 || pos + n > len_) return npos; + const char* lmax = cstr_ + len_ - n; + for (const char* i = cstr_ + pos; i <= lmax; ++i) + { + size_t j = 0; + while (j < n && s[j] == i[j]) ++j; + if (j == n) return (size_t)(i - cstr_); + } + return npos; +} + +inline +size_t String::find(char c, size_t pos) const +{ + return find(&c, pos, 1); +} + +inline +size_t String::find(const String& str, size_t pos) const +{ + return find(str.c_str(), pos, str.len_); +} + +inline +size_t String::find(const char* s, size_t pos) const +{ + if (pos >= len_ || !s[0]) return npos; + const char* lmax = cstr_ + len_; + for (const char* i = cstr_ + pos; i < lmax; ++i) + { + size_t j = 0; + while (s[j] && s[j] == i[j]) + { if(i + j >= lmax) return npos; + ++j; + } + if (!s[j]) return (size_t)(i - cstr_); + } + return npos; +} + +inline +size_t String::rfind(const char* s, size_t pos, size_t n) const +{ + if (n > len_) return npos; + if (pos > len_ - n) pos = len_ - n; + for (const char* i = cstr_ + pos; i >= cstr_; --i) + { + size_t j = 0; + while (j < n && s[j] == i[j]) ++j; + if (j == n) return (size_t)(i - cstr_); + } + return npos; +} + +inline +size_t String::rfind(char c, size_t pos) const +{ + return rfind(&c, pos, 1); +} + +inline +size_t String::rfind(const String& str, size_t pos) const +{ + return rfind(str.c_str(), pos, str.len_); +} + +inline +size_t String::rfind(const char* s, size_t pos) const +{ + return rfind(s, pos, strlen(s)); +} + +inline +size_t String::find_first_of(const char* s, size_t pos, size_t n) const +{ + if (n == 0 || pos + n > len_) return npos; + const char* lmax = cstr_ + len_; + for (const char* i = cstr_ + pos; i < lmax; ++i) + { + for (size_t j = 0; j < n; ++j) + if (s[j] == *i) + return (size_t)(i - cstr_); + } + return npos; +} + +inline +size_t String::find_first_of(char c, size_t pos) const +{ + return find_first_of(&c, pos, 1); +} + +inline +size_t String::find_first_of(const String& str, size_t pos) const +{ + return find_first_of(str.c_str(), pos, str.len_); +} + +inline +size_t String::find_first_of(const char* s, size_t pos) const +{ + if (len_ == 0) return npos; + if (pos >= len_ || !s[0]) return npos; + const char* lmax = cstr_ + len_; + for (const char* i = cstr_ + pos; i < lmax; ++i) + { + for (size_t j = 0; s[j]; ++j) + if (s[j] == *i) + return (size_t)(i - cstr_); + } + return npos; +} + +inline +size_t String::find_last_of(const char* s, size_t pos, size_t n) const +{ + if (len_ == 0) return npos; + if (pos >= len_) pos = len_ - 1; + for (const char* i = cstr_ + pos; i >= cstr_; --i) + { + for (size_t j = 0; j < n; ++j) + if (s[j] == *i) + return (size_t)(i - cstr_); + } + return npos; +} + +inline +size_t String::find_last_of(char c, size_t pos) const +{ + return find_last_of(&c, pos, 1); +} + +inline +size_t String::find_last_of(const String& str, size_t pos) const +{ + return find_last_of(str.c_str(), pos, str.len_); +} + +inline +size_t String::find_last_of(const char* s, size_t pos) const +{ + if (len_ == 0) return npos; + if (pos >= len_) pos = len_ - 1; + for (const char* i = cstr_ + pos; i >= cstr_; --i) + { + for (size_t j = 0; s[j]; ++j) + if (s[j] == *i) + return (size_t)(i - cstr_); + } + return npos; +} + +inline +String String::toLowerCase() const +{ + String res(cstr_, len_); + + for (size_t i = 0; i < len_; ++i) + res.cstr_[i] = (char) ::tolower(cstr_[i]); + + return res; +} + +//! @endcond + +// ************************* cv::String non-member functions ************************* + +//! @relates cv::String +//! @{ + +inline +String operator + (const String& lhs, const String& rhs) +{ + String s; + s.allocate(lhs.len_ + rhs.len_); + memcpy(s.cstr_, lhs.cstr_, lhs.len_); + memcpy(s.cstr_ + lhs.len_, rhs.cstr_, rhs.len_); + return s; +} + +inline +String operator + (const String& lhs, const char* rhs) +{ + String s; + size_t rhslen = strlen(rhs); + s.allocate(lhs.len_ + rhslen); + memcpy(s.cstr_, lhs.cstr_, lhs.len_); + memcpy(s.cstr_ + lhs.len_, rhs, rhslen); + return s; +} + +inline +String operator + (const char* lhs, const String& rhs) +{ + String s; + size_t lhslen = strlen(lhs); + s.allocate(lhslen + rhs.len_); + memcpy(s.cstr_, lhs, lhslen); + memcpy(s.cstr_ + lhslen, rhs.cstr_, rhs.len_); + return s; +} + +inline +String operator + (const String& lhs, char rhs) +{ + String s; + s.allocate(lhs.len_ + 1); + memcpy(s.cstr_, lhs.cstr_, lhs.len_); + s.cstr_[lhs.len_] = rhs; + return s; +} + +inline +String operator + (char lhs, const String& rhs) +{ + String s; + s.allocate(rhs.len_ + 1); + s.cstr_[0] = lhs; + memcpy(s.cstr_ + 1, rhs.cstr_, rhs.len_); + return s; +} + +static inline bool operator== (const String& lhs, const String& rhs) { return 0 == lhs.compare(rhs); } +static inline bool operator== (const char* lhs, const String& rhs) { return 0 == rhs.compare(lhs); } +static inline bool operator== (const String& lhs, const char* rhs) { return 0 == lhs.compare(rhs); } +static inline bool operator!= (const String& lhs, const String& rhs) { return 0 != lhs.compare(rhs); } +static inline bool operator!= (const char* lhs, const String& rhs) { return 0 != rhs.compare(lhs); } +static inline bool operator!= (const String& lhs, const char* rhs) { return 0 != lhs.compare(rhs); } +static inline bool operator< (const String& lhs, const String& rhs) { return lhs.compare(rhs) < 0; } +static inline bool operator< (const char* lhs, const String& rhs) { return rhs.compare(lhs) > 0; } +static inline bool operator< (const String& lhs, const char* rhs) { return lhs.compare(rhs) < 0; } +static inline bool operator<= (const String& lhs, const String& rhs) { return lhs.compare(rhs) <= 0; } +static inline bool operator<= (const char* lhs, const String& rhs) { return rhs.compare(lhs) >= 0; } +static inline bool operator<= (const String& lhs, const char* rhs) { return lhs.compare(rhs) <= 0; } +static inline bool operator> (const String& lhs, const String& rhs) { return lhs.compare(rhs) > 0; } +static inline bool operator> (const char* lhs, const String& rhs) { return rhs.compare(lhs) < 0; } +static inline bool operator> (const String& lhs, const char* rhs) { return lhs.compare(rhs) > 0; } +static inline bool operator>= (const String& lhs, const String& rhs) { return lhs.compare(rhs) >= 0; } +static inline bool operator>= (const char* lhs, const String& rhs) { return rhs.compare(lhs) <= 0; } +static inline bool operator>= (const String& lhs, const char* rhs) { return lhs.compare(rhs) >= 0; } + +//! @} relates cv::String + +} // cv + +#ifndef OPENCV_NOSTL_TRANSITIONAL +namespace std +{ + static inline void swap(cv::String& a, cv::String& b) { a.swap(b); } +} +#else +namespace cv +{ + template<> inline + void swap(cv::String& a, cv::String& b) + { + a.swap(b); + } +} +#endif + +#include "opencv2/core/ptr.inl.hpp" + +#endif //__OPENCV_CORE_CVSTD_HPP__ diff --git a/lib/opencv/include/opencv2/core/cvstd.inl.hpp b/lib/opencv/include/opencv2/core/cvstd.inl.hpp new file mode 100644 index 000000000..ad154061e --- /dev/null +++ b/lib/opencv/include/opencv2/core/cvstd.inl.hpp @@ -0,0 +1,267 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_CVSTDINL_HPP__ +#define __OPENCV_CORE_CVSTDINL_HPP__ + +#ifndef OPENCV_NOSTL +# include +# include +#endif + +//! @cond IGNORED + +namespace cv +{ +#ifndef OPENCV_NOSTL + +template class DataType< std::complex<_Tp> > +{ +public: + typedef std::complex<_Tp> value_type; + typedef value_type work_type; + typedef _Tp channel_type; + + enum { generic_type = 0, + depth = DataType::depth, + channels = 2, + fmt = DataType::fmt + ((channels - 1) << 8), + type = CV_MAKETYPE(depth, channels) }; + + typedef Vec vec_type; +}; + +inline +String::String(const std::string& str) + : cstr_(0), len_(0) +{ + if (!str.empty()) + { + size_t len = str.size(); + memcpy(allocate(len), str.c_str(), len); + } +} + +inline +String::String(const std::string& str, size_t pos, size_t len) + : cstr_(0), len_(0) +{ + size_t strlen = str.size(); + pos = min(pos, strlen); + len = min(strlen - pos, len); + if (!len) return; + memcpy(allocate(len), str.c_str() + pos, len); +} + +inline +String& String::operator = (const std::string& str) +{ + deallocate(); + if (!str.empty()) + { + size_t len = str.size(); + memcpy(allocate(len), str.c_str(), len); + } + return *this; +} + +inline +String& String::operator += (const std::string& str) +{ + *this = *this + str; + return *this; +} + +inline +String::operator std::string() const +{ + return std::string(cstr_, len_); +} + +inline +String operator + (const String& lhs, const std::string& rhs) +{ + String s; + size_t rhslen = rhs.size(); + s.allocate(lhs.len_ + rhslen); + memcpy(s.cstr_, lhs.cstr_, lhs.len_); + memcpy(s.cstr_ + lhs.len_, rhs.c_str(), rhslen); + return s; +} + +inline +String operator + (const std::string& lhs, const String& rhs) +{ + String s; + size_t lhslen = lhs.size(); + s.allocate(lhslen + rhs.len_); + memcpy(s.cstr_, lhs.c_str(), lhslen); + memcpy(s.cstr_ + lhslen, rhs.cstr_, rhs.len_); + return s; +} + +inline +FileNode::operator std::string() const +{ + String value; + read(*this, value, value); + return value; +} + +template<> inline +void operator >> (const FileNode& n, std::string& value) +{ + String val; + read(n, val, val); + value = val; +} + +template<> inline +FileStorage& operator << (FileStorage& fs, const std::string& value) +{ + return fs << cv::String(value); +} + +static inline +std::ostream& operator << (std::ostream& os, const String& str) +{ + return os << str.c_str(); +} + +static inline +std::ostream& operator << (std::ostream& out, Ptr fmtd) +{ + fmtd->reset(); + for(const char* str = fmtd->next(); str; str = fmtd->next()) + out << str; + return out; +} + +static inline +std::ostream& operator << (std::ostream& out, const Mat& mtx) +{ + return out << Formatter::get()->format(mtx); +} + +template static inline +std::ostream& operator << (std::ostream& out, const std::vector >& vec) +{ + return out << Formatter::get()->format(Mat(vec)); +} + + +template static inline +std::ostream& operator << (std::ostream& out, const std::vector >& vec) +{ + return out << Formatter::get()->format(Mat(vec)); +} + + +template static inline +std::ostream& operator << (std::ostream& out, const Matx<_Tp, m, n>& matx) +{ + return out << Formatter::get()->format(Mat(matx)); +} + +template static inline +std::ostream& operator << (std::ostream& out, const Point_<_Tp>& p) +{ + out << "[" << p.x << ", " << p.y << "]"; + return out; +} + +template static inline +std::ostream& operator << (std::ostream& out, const Point3_<_Tp>& p) +{ + out << "[" << p.x << ", " << p.y << ", " << p.z << "]"; + return out; +} + +template static inline +std::ostream& operator << (std::ostream& out, const Vec<_Tp, n>& vec) +{ + out << "["; +#ifdef _MSC_VER +#pragma warning( push ) +#pragma warning( disable: 4127 ) +#endif + if(Vec<_Tp, n>::depth < CV_32F) +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + { + for (int i = 0; i < n - 1; ++i) { + out << (int)vec[i] << ", "; + } + out << (int)vec[n-1] << "]"; + } + else + { + for (int i = 0; i < n - 1; ++i) { + out << vec[i] << ", "; + } + out << vec[n-1] << "]"; + } + + return out; +} + +template static inline +std::ostream& operator << (std::ostream& out, const Size_<_Tp>& size) +{ + return out << "[" << size.width << " x " << size.height << "]"; +} + +template static inline +std::ostream& operator << (std::ostream& out, const Rect_<_Tp>& rect) +{ + return out << "[" << rect.width << " x " << rect.height << " from (" << rect.x << ", " << rect.y << ")]"; +} + + +#endif // OPENCV_NOSTL +} // cv + +//! @endcond + +#endif // __OPENCV_CORE_CVSTDINL_HPP__ diff --git a/lib/opencv/include/opencv2/core/directx.hpp b/lib/opencv/include/opencv2/core/directx.hpp new file mode 100644 index 000000000..764af74d7 --- /dev/null +++ b/lib/opencv/include/opencv2/core/directx.hpp @@ -0,0 +1,184 @@ +/*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) 2010-2013, Advanced Micro Devices, 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 copyright holders 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_DIRECTX_HPP__ +#define __OPENCV_CORE_DIRECTX_HPP__ + +#include "mat.hpp" +#include "ocl.hpp" + +#if !defined(__d3d11_h__) +struct ID3D11Device; +struct ID3D11Texture2D; +#endif + +#if !defined(__d3d10_h__) +struct ID3D10Device; +struct ID3D10Texture2D; +#endif + +#if !defined(_D3D9_H_) +struct IDirect3DDevice9; +struct IDirect3DDevice9Ex; +struct IDirect3DSurface9; +#endif + + +namespace cv { namespace directx { + +namespace ocl { +using namespace cv::ocl; + +//! @addtogroup core_directx +// This section describes OpenCL and DirectX interoperability. +// +// To enable DirectX support, configure OpenCV using CMake with WITH_DIRECTX=ON . Note, DirectX is +// supported only on Windows. +// +// To use OpenCL functionality you should first initialize OpenCL context from DirectX resource. +// +//! @{ + +// TODO static functions in the Context class +//! @brief Creates OpenCL context from D3D11 device +// +//! @param pD3D11Device - pointer to D3D11 device +//! @return Returns reference to OpenCL Context +CV_EXPORTS Context& initializeContextFromD3D11Device(ID3D11Device* pD3D11Device); + +//! @brief Creates OpenCL context from D3D10 device +// +//! @param pD3D10Device - pointer to D3D10 device +//! @return Returns reference to OpenCL Context +CV_EXPORTS Context& initializeContextFromD3D10Device(ID3D10Device* pD3D10Device); + +//! @brief Creates OpenCL context from Direct3DDevice9Ex device +// +//! @param pDirect3DDevice9Ex - pointer to Direct3DDevice9Ex device +//! @return Returns reference to OpenCL Context +CV_EXPORTS Context& initializeContextFromDirect3DDevice9Ex(IDirect3DDevice9Ex* pDirect3DDevice9Ex); + +//! @brief Creates OpenCL context from Direct3DDevice9 device +// +//! @param pDirect3DDevice9 - pointer to Direct3Device9 device +//! @return Returns reference to OpenCL Context +CV_EXPORTS Context& initializeContextFromDirect3DDevice9(IDirect3DDevice9* pDirect3DDevice9); + +//! @} + +} // namespace cv::directx::ocl + +//! @addtogroup core_directx +//! @{ + +//! @brief Converts InputArray to ID3D11Texture2D. If destination texture format is DXGI_FORMAT_NV12 then +//! input UMat expected to be in BGR format and data will be downsampled and color-converted to NV12. +// +//! @note Note: Destination texture must be allocated by application. Function does memory copy from src to +//! pD3D11Texture2D +// +//! @param src - source InputArray +//! @param pD3D11Texture2D - destination D3D11 texture +CV_EXPORTS void convertToD3D11Texture2D(InputArray src, ID3D11Texture2D* pD3D11Texture2D); + +//! @brief Converts ID3D11Texture2D to OutputArray. If input texture format is DXGI_FORMAT_NV12 then +//! data will be upsampled and color-converted to BGR format. +// +//! @note Note: Destination matrix will be re-allocated if it has not enough memory to match texture size. +//! function does memory copy from pD3D11Texture2D to dst +// +//! @param pD3D11Texture2D - source D3D11 texture +//! @param dst - destination OutputArray +CV_EXPORTS void convertFromD3D11Texture2D(ID3D11Texture2D* pD3D11Texture2D, OutputArray dst); + +//! @brief Converts InputArray to ID3D10Texture2D +// +//! @note Note: function does memory copy from src to +//! pD3D10Texture2D +// +//! @param src - source InputArray +//! @param pD3D10Texture2D - destination D3D10 texture +CV_EXPORTS void convertToD3D10Texture2D(InputArray src, ID3D10Texture2D* pD3D10Texture2D); + +//! @brief Converts ID3D10Texture2D to OutputArray +// +//! @note Note: function does memory copy from pD3D10Texture2D +//! to dst +// +//! @param pD3D10Texture2D - source D3D10 texture +//! @param dst - destination OutputArray +CV_EXPORTS void convertFromD3D10Texture2D(ID3D10Texture2D* pD3D10Texture2D, OutputArray dst); + +//! @brief Converts InputArray to IDirect3DSurface9 +// +//! @note Note: function does memory copy from src to +//! pDirect3DSurface9 +// +//! @param src - source InputArray +//! @param pDirect3DSurface9 - destination D3D10 texture +//! @param surfaceSharedHandle - shared handle +CV_EXPORTS void convertToDirect3DSurface9(InputArray src, IDirect3DSurface9* pDirect3DSurface9, void* surfaceSharedHandle = NULL); + +//! @brief Converts IDirect3DSurface9 to OutputArray +// +//! @note Note: function does memory copy from pDirect3DSurface9 +//! to dst +// +//! @param pDirect3DSurface9 - source D3D10 texture +//! @param dst - destination OutputArray +//! @param surfaceSharedHandle - shared handle +CV_EXPORTS void convertFromDirect3DSurface9(IDirect3DSurface9* pDirect3DSurface9, OutputArray dst, void* surfaceSharedHandle = NULL); + +//! @brief Get OpenCV type from DirectX type +//! @param iDXGI_FORMAT - enum DXGI_FORMAT for D3D10/D3D11 +//! @return OpenCV type or -1 if there is no equivalent +CV_EXPORTS int getTypeFromDXGI_FORMAT(const int iDXGI_FORMAT); // enum DXGI_FORMAT for D3D10/D3D11 + +//! @brief Get OpenCV type from DirectX type +//! @param iD3DFORMAT - enum D3DTYPE for D3D9 +//! @return OpenCV type or -1 if there is no equivalent +CV_EXPORTS int getTypeFromD3DFORMAT(const int iD3DFORMAT); // enum D3DTYPE for D3D9 + +//! @} + +} } // namespace cv::directx + +#endif // __OPENCV_CORE_DIRECTX_HPP__ diff --git a/lib/opencv/include/opencv2/core/eigen.hpp b/lib/opencv/include/opencv2/core/eigen.hpp new file mode 100644 index 000000000..44df04c50 --- /dev/null +++ b/lib/opencv/include/opencv2/core/eigen.hpp @@ -0,0 +1,280 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_EIGEN_HPP__ +#define __OPENCV_CORE_EIGEN_HPP__ + +#include "opencv2/core.hpp" + +#if defined _MSC_VER && _MSC_VER >= 1200 +#pragma warning( disable: 4714 ) //__forceinline is not inlined +#pragma warning( disable: 4127 ) //conditional expression is constant +#pragma warning( disable: 4244 ) //conversion from '__int64' to 'int', possible loss of data +#endif + +namespace cv +{ + +//! @addtogroup core_eigen +//! @{ + +template static inline +void eigen2cv( const Eigen::Matrix<_Tp, _rows, _cols, _options, _maxRows, _maxCols>& src, Mat& dst ) +{ + if( !(src.Flags & Eigen::RowMajorBit) ) + { + Mat _src(src.cols(), src.rows(), DataType<_Tp>::type, + (void*)src.data(), src.stride()*sizeof(_Tp)); + transpose(_src, dst); + } + else + { + Mat _src(src.rows(), src.cols(), DataType<_Tp>::type, + (void*)src.data(), src.stride()*sizeof(_Tp)); + _src.copyTo(dst); + } +} + +// Matx case +template static inline +void eigen2cv( const Eigen::Matrix<_Tp, _rows, _cols, _options, _maxRows, _maxCols>& src, + Matx<_Tp, _rows, _cols>& dst ) +{ + if( !(src.Flags & Eigen::RowMajorBit) ) + { + dst = Matx<_Tp, _cols, _rows>(static_cast(src.data())).t(); + } + else + { + dst = Matx<_Tp, _rows, _cols>(static_cast(src.data())); + } +} + +template static inline +void cv2eigen( const Mat& src, + Eigen::Matrix<_Tp, _rows, _cols, _options, _maxRows, _maxCols>& dst ) +{ + CV_DbgAssert(src.rows == _rows && src.cols == _cols); + if( !(dst.Flags & Eigen::RowMajorBit) ) + { + const Mat _dst(src.cols, src.rows, DataType<_Tp>::type, + dst.data(), (size_t)(dst.stride()*sizeof(_Tp))); + if( src.type() == _dst.type() ) + transpose(src, _dst); + else if( src.cols == src.rows ) + { + src.convertTo(_dst, _dst.type()); + transpose(_dst, _dst); + } + else + Mat(src.t()).convertTo(_dst, _dst.type()); + } + else + { + const Mat _dst(src.rows, src.cols, DataType<_Tp>::type, + dst.data(), (size_t)(dst.stride()*sizeof(_Tp))); + src.convertTo(_dst, _dst.type()); + } +} + +// Matx case +template static inline +void cv2eigen( const Matx<_Tp, _rows, _cols>& src, + Eigen::Matrix<_Tp, _rows, _cols, _options, _maxRows, _maxCols>& dst ) +{ + if( !(dst.Flags & Eigen::RowMajorBit) ) + { + const Mat _dst(_cols, _rows, DataType<_Tp>::type, + dst.data(), (size_t)(dst.stride()*sizeof(_Tp))); + transpose(src, _dst); + } + else + { + const Mat _dst(_rows, _cols, DataType<_Tp>::type, + dst.data(), (size_t)(dst.stride()*sizeof(_Tp))); + Mat(src).copyTo(_dst); + } +} + +template static inline +void cv2eigen( const Mat& src, + Eigen::Matrix<_Tp, Eigen::Dynamic, Eigen::Dynamic>& dst ) +{ + dst.resize(src.rows, src.cols); + if( !(dst.Flags & Eigen::RowMajorBit) ) + { + const Mat _dst(src.cols, src.rows, DataType<_Tp>::type, + dst.data(), (size_t)(dst.stride()*sizeof(_Tp))); + if( src.type() == _dst.type() ) + transpose(src, _dst); + else if( src.cols == src.rows ) + { + src.convertTo(_dst, _dst.type()); + transpose(_dst, _dst); + } + else + Mat(src.t()).convertTo(_dst, _dst.type()); + } + else + { + const Mat _dst(src.rows, src.cols, DataType<_Tp>::type, + dst.data(), (size_t)(dst.stride()*sizeof(_Tp))); + src.convertTo(_dst, _dst.type()); + } +} + +// Matx case +template static inline +void cv2eigen( const Matx<_Tp, _rows, _cols>& src, + Eigen::Matrix<_Tp, Eigen::Dynamic, Eigen::Dynamic>& dst ) +{ + dst.resize(_rows, _cols); + if( !(dst.Flags & Eigen::RowMajorBit) ) + { + const Mat _dst(_cols, _rows, DataType<_Tp>::type, + dst.data(), (size_t)(dst.stride()*sizeof(_Tp))); + transpose(src, _dst); + } + else + { + const Mat _dst(_rows, _cols, DataType<_Tp>::type, + dst.data(), (size_t)(dst.stride()*sizeof(_Tp))); + Mat(src).copyTo(_dst); + } +} + +template static inline +void cv2eigen( const Mat& src, + Eigen::Matrix<_Tp, Eigen::Dynamic, 1>& dst ) +{ + CV_Assert(src.cols == 1); + dst.resize(src.rows); + + if( !(dst.Flags & Eigen::RowMajorBit) ) + { + const Mat _dst(src.cols, src.rows, DataType<_Tp>::type, + dst.data(), (size_t)(dst.stride()*sizeof(_Tp))); + if( src.type() == _dst.type() ) + transpose(src, _dst); + else + Mat(src.t()).convertTo(_dst, _dst.type()); + } + else + { + const Mat _dst(src.rows, src.cols, DataType<_Tp>::type, + dst.data(), (size_t)(dst.stride()*sizeof(_Tp))); + src.convertTo(_dst, _dst.type()); + } +} + +// Matx case +template static inline +void cv2eigen( const Matx<_Tp, _rows, 1>& src, + Eigen::Matrix<_Tp, Eigen::Dynamic, 1>& dst ) +{ + dst.resize(_rows); + + if( !(dst.Flags & Eigen::RowMajorBit) ) + { + const Mat _dst(1, _rows, DataType<_Tp>::type, + dst.data(), (size_t)(dst.stride()*sizeof(_Tp))); + transpose(src, _dst); + } + else + { + const Mat _dst(_rows, 1, DataType<_Tp>::type, + dst.data(), (size_t)(dst.stride()*sizeof(_Tp))); + src.copyTo(_dst); + } +} + + +template static inline +void cv2eigen( const Mat& src, + Eigen::Matrix<_Tp, 1, Eigen::Dynamic>& dst ) +{ + CV_Assert(src.rows == 1); + dst.resize(src.cols); + if( !(dst.Flags & Eigen::RowMajorBit) ) + { + const Mat _dst(src.cols, src.rows, DataType<_Tp>::type, + dst.data(), (size_t)(dst.stride()*sizeof(_Tp))); + if( src.type() == _dst.type() ) + transpose(src, _dst); + else + Mat(src.t()).convertTo(_dst, _dst.type()); + } + else + { + const Mat _dst(src.rows, src.cols, DataType<_Tp>::type, + dst.data(), (size_t)(dst.stride()*sizeof(_Tp))); + src.convertTo(_dst, _dst.type()); + } +} + +//Matx +template static inline +void cv2eigen( const Matx<_Tp, 1, _cols>& src, + Eigen::Matrix<_Tp, 1, Eigen::Dynamic>& dst ) +{ + dst.resize(_cols); + if( !(dst.Flags & Eigen::RowMajorBit) ) + { + const Mat _dst(_cols, 1, DataType<_Tp>::type, + dst.data(), (size_t)(dst.stride()*sizeof(_Tp))); + transpose(src, _dst); + } + else + { + const Mat _dst(1, _cols, DataType<_Tp>::type, + dst.data(), (size_t)(dst.stride()*sizeof(_Tp))); + Mat(src).copyTo(_dst); + } +} + +//! @} + +} // cv + +#endif diff --git a/lib/opencv/include/opencv2/core/fast_math.hpp b/lib/opencv/include/opencv2/core/fast_math.hpp new file mode 100644 index 000000000..b8b241b02 --- /dev/null +++ b/lib/opencv/include/opencv2/core/fast_math.hpp @@ -0,0 +1,302 @@ +/*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. +// 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_FAST_MATH_HPP__ +#define __OPENCV_CORE_FAST_MATH_HPP__ + +#include "opencv2/core/cvdef.h" + +//! @addtogroup core_utils +//! @{ + +/****************************************************************************************\ +* fast math * +\****************************************************************************************/ + +#if defined __BORLANDC__ +# include +#elif defined __cplusplus +# include +#else +# include +#endif + +#ifdef HAVE_TEGRA_OPTIMIZATION +# include "tegra_round.hpp" +#endif + +#if CV_VFP + // 1. general scheme + #define ARM_ROUND(_value, _asm_string) \ + int res; \ + float temp; \ + asm(_asm_string : [res] "=r" (res), [temp] "=w" (temp) : [value] "w" (_value)); \ + return res + // 2. version for double + #ifdef __clang__ + #define ARM_ROUND_DBL(value) ARM_ROUND(value, "vcvtr.s32.f64 %[temp], %[value] \n vmov %[res], %[temp]") + #else + #define ARM_ROUND_DBL(value) ARM_ROUND(value, "vcvtr.s32.f64 %[temp], %P[value] \n vmov %[res], %[temp]") + #endif + // 3. version for float + #define ARM_ROUND_FLT(value) ARM_ROUND(value, "vcvtr.s32.f32 %[temp], %[value]\n vmov %[res], %[temp]") +#endif // CV_VFP + +/** @brief Rounds floating-point number to the nearest integer + + @param value floating-point number. If the value is outside of INT_MIN ... INT_MAX range, the + result is not defined. + */ +CV_INLINE int +cvRound( double value ) +{ +#if ((defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ \ + && defined __SSE2__ && !defined __APPLE__)) && !defined(__CUDACC__) + __m128d t = _mm_set_sd( value ); + return _mm_cvtsd_si32(t); +#elif defined _MSC_VER && defined _M_IX86 + int t; + __asm + { + fld value; + fistp t; + } + return t; +#elif ((defined _MSC_VER && defined _M_ARM) || defined CV_ICC || \ + defined __GNUC__) && defined HAVE_TEGRA_OPTIMIZATION + TEGRA_ROUND_DBL(value); +#elif defined CV_ICC || defined __GNUC__ +# if CV_VFP + ARM_ROUND_DBL(value); +# else + return (int)lrint(value); +# endif +#else + /* it's ok if round does not comply with IEEE754 standard; + the tests should allow +/-1 difference when the tested functions use round */ + return (int)(value + (value >= 0 ? 0.5 : -0.5)); +#endif +} + + +/** @brief Rounds floating-point number to the nearest integer not larger than the original. + + The function computes an integer i such that: + \f[i \le \texttt{value} < i+1\f] + @param value floating-point number. If the value is outside of INT_MIN ... INT_MAX range, the + result is not defined. + */ +CV_INLINE int cvFloor( double value ) +{ +#if (defined _MSC_VER && defined _M_X64 || (defined __GNUC__ && defined __SSE2__ && !defined __APPLE__)) && !defined(__CUDACC__) + __m128d t = _mm_set_sd( value ); + int i = _mm_cvtsd_si32(t); + return i - _mm_movemask_pd(_mm_cmplt_sd(t, _mm_cvtsi32_sd(t,i))); +#elif defined __GNUC__ + int i = (int)value; + return i - (i > value); +#else + int i = cvRound(value); + float diff = (float)(value - i); + return i - (diff < 0); +#endif +} + +/** @brief Rounds floating-point number to the nearest integer not smaller than the original. + + The function computes an integer i such that: + \f[i \le \texttt{value} < i+1\f] + @param value floating-point number. If the value is outside of INT_MIN ... INT_MAX range, the + result is not defined. + */ +CV_INLINE int cvCeil( double value ) +{ +#if (defined _MSC_VER && defined _M_X64 || (defined __GNUC__ && defined __SSE2__&& !defined __APPLE__)) && !defined(__CUDACC__) + __m128d t = _mm_set_sd( value ); + int i = _mm_cvtsd_si32(t); + return i + _mm_movemask_pd(_mm_cmplt_sd(_mm_cvtsi32_sd(t,i), t)); +#elif defined __GNUC__ + int i = (int)value; + return i + (i < value); +#else + int i = cvRound(value); + float diff = (float)(i - value); + return i + (diff < 0); +#endif +} + +/** @brief Determines if the argument is Not A Number. + + @param value The input floating-point value + + The function returns 1 if the argument is Not A Number (as defined by IEEE754 standard), 0 + otherwise. */ +CV_INLINE int cvIsNaN( double value ) +{ + Cv64suf ieee754; + ieee754.f = value; + return ((unsigned)(ieee754.u >> 32) & 0x7fffffff) + + ((unsigned)ieee754.u != 0) > 0x7ff00000; +} + +/** @brief Determines if the argument is Infinity. + + @param value The input floating-point value + + The function returns 1 if the argument is a plus or minus infinity (as defined by IEEE754 standard) + and 0 otherwise. */ +CV_INLINE int cvIsInf( double value ) +{ + Cv64suf ieee754; + ieee754.f = value; + return ((unsigned)(ieee754.u >> 32) & 0x7fffffff) == 0x7ff00000 && + (unsigned)ieee754.u == 0; +} + +#ifdef __cplusplus + +/** @overload */ +CV_INLINE int cvRound(float value) +{ +#if ((defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ && \ + defined __SSE2__ && !defined __APPLE__)) && !defined(__CUDACC__) + __m128 t = _mm_set_ss( value ); + return _mm_cvtss_si32(t); +#elif defined _MSC_VER && defined _M_IX86 + int t; + __asm + { + fld value; + fistp t; + } + return t; +#elif ((defined _MSC_VER && defined _M_ARM) || defined CV_ICC || \ + defined __GNUC__) && defined HAVE_TEGRA_OPTIMIZATION + TEGRA_ROUND_FLT(value); +#elif defined CV_ICC || defined __GNUC__ +# if CV_VFP + ARM_ROUND_FLT(value); +# else + return (int)lrintf(value); +# endif +#else + /* it's ok if round does not comply with IEEE754 standard; + the tests should allow +/-1 difference when the tested functions use round */ + return (int)(value + (value >= 0 ? 0.5f : -0.5f)); +#endif +} + +/** @overload */ +CV_INLINE int cvRound( int value ) +{ + return value; +} + +/** @overload */ +CV_INLINE int cvFloor( float value ) +{ +#if (defined _MSC_VER && defined _M_X64 || (defined __GNUC__ && defined __SSE2__ && !defined __APPLE__)) && !defined(__CUDACC__) + __m128 t = _mm_set_ss( value ); + int i = _mm_cvtss_si32(t); + return i - _mm_movemask_ps(_mm_cmplt_ss(t, _mm_cvtsi32_ss(t,i))); +#elif defined __GNUC__ + int i = (int)value; + return i - (i > value); +#else + int i = cvRound(value); + float diff = (float)(value - i); + return i - (diff < 0); +#endif +} + +/** @overload */ +CV_INLINE int cvFloor( int value ) +{ + return value; +} + +/** @overload */ +CV_INLINE int cvCeil( float value ) +{ +#if (defined _MSC_VER && defined _M_X64 || (defined __GNUC__ && defined __SSE2__&& !defined __APPLE__)) && !defined(__CUDACC__) + __m128 t = _mm_set_ss( value ); + int i = _mm_cvtss_si32(t); + return i + _mm_movemask_ps(_mm_cmplt_ss(_mm_cvtsi32_ss(t,i), t)); +#elif defined __GNUC__ + int i = (int)value; + return i + (i < value); +#else + int i = cvRound(value); + float diff = (float)(i - value); + return i + (diff < 0); +#endif +} + +/** @overload */ +CV_INLINE int cvCeil( int value ) +{ + return value; +} + +/** @overload */ +CV_INLINE int cvIsNaN( float value ) +{ + Cv32suf ieee754; + ieee754.f = value; + return (ieee754.u & 0x7fffffff) > 0x7f800000; +} + +/** @overload */ +CV_INLINE int cvIsInf( float value ) +{ + Cv32suf ieee754; + ieee754.f = value; + return (ieee754.u & 0x7fffffff) == 0x7f800000; +} + +#endif // __cplusplus + +//! @} core_utils + +#endif diff --git a/lib/opencv/include/opencv2/core/hal/hal.hpp b/lib/opencv/include/opencv2/core/hal/hal.hpp new file mode 100644 index 000000000..118913eb7 --- /dev/null +++ b/lib/opencv/include/opencv2/core/hal/hal.hpp @@ -0,0 +1,218 @@ +/*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. +// 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_HAL_HPP__ +#define __OPENCV_HAL_HPP__ + +#include "opencv2/core/cvdef.h" +#include "opencv2/core/hal/interface.h" + +//! @cond IGNORED +#define CALL_HAL(name, fun, ...) \ + int res = fun(__VA_ARGS__); \ + if (res == CV_HAL_ERROR_OK) \ + return; \ + else if (res != CV_HAL_ERROR_NOT_IMPLEMENTED) \ + CV_Error_(cv::Error::StsInternal, \ + ("HAL implementation " CVAUX_STR(name) " ==> " CVAUX_STR(fun) " returned %d (0x%08x)", res, res)); +//! @endcond + + +namespace cv { namespace hal { + +//! @addtogroup core_hal_functions +//! @{ + +CV_EXPORTS int normHamming(const uchar* a, int n); +CV_EXPORTS int normHamming(const uchar* a, const uchar* b, int n); + +CV_EXPORTS int normHamming(const uchar* a, int n, int cellSize); +CV_EXPORTS int normHamming(const uchar* a, const uchar* b, int n, int cellSize); + +CV_EXPORTS int LU32f(float* A, size_t astep, int m, float* b, size_t bstep, int n); +CV_EXPORTS int LU64f(double* A, size_t astep, int m, double* b, size_t bstep, int n); +CV_EXPORTS bool Cholesky32f(float* A, size_t astep, int m, float* b, size_t bstep, int n); +CV_EXPORTS bool Cholesky64f(double* A, size_t astep, int m, double* b, size_t bstep, int n); + +CV_EXPORTS int normL1_(const uchar* a, const uchar* b, int n); +CV_EXPORTS float normL1_(const float* a, const float* b, int n); +CV_EXPORTS float normL2Sqr_(const float* a, const float* b, int n); + +CV_EXPORTS void exp32f(const float* src, float* dst, int n); +CV_EXPORTS void exp64f(const double* src, double* dst, int n); +CV_EXPORTS void log32f(const float* src, float* dst, int n); +CV_EXPORTS void log64f(const double* src, double* dst, int n); + +CV_EXPORTS void fastAtan2(const float* y, const float* x, float* dst, int n, bool angleInDegrees); +CV_EXPORTS void magnitude32f(const float* x, const float* y, float* dst, int n); +CV_EXPORTS void magnitude64f(const double* x, const double* y, double* dst, int n); +CV_EXPORTS void sqrt32f(const float* src, float* dst, int len); +CV_EXPORTS void sqrt64f(const double* src, double* dst, int len); +CV_EXPORTS void invSqrt32f(const float* src, float* dst, int len); +CV_EXPORTS void invSqrt64f(const double* src, double* dst, int len); + +CV_EXPORTS void split8u(const uchar* src, uchar** dst, int len, int cn ); +CV_EXPORTS void split16u(const ushort* src, ushort** dst, int len, int cn ); +CV_EXPORTS void split32s(const int* src, int** dst, int len, int cn ); +CV_EXPORTS void split64s(const int64* src, int64** dst, int len, int cn ); + +CV_EXPORTS void merge8u(const uchar** src, uchar* dst, int len, int cn ); +CV_EXPORTS void merge16u(const ushort** src, ushort* dst, int len, int cn ); +CV_EXPORTS void merge32s(const int** src, int* dst, int len, int cn ); +CV_EXPORTS void merge64s(const int64** src, int64* dst, int len, int cn ); + +CV_EXPORTS void add8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void add8s( const schar* src1, size_t step1, const schar* src2, size_t step2, schar* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void add16u( const ushort* src1, size_t step1, const ushort* src2, size_t step2, ushort* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void add16s( const short* src1, size_t step1, const short* src2, size_t step2, short* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void add32s( const int* src1, size_t step1, const int* src2, size_t step2, int* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void add32f( const float* src1, size_t step1, const float* src2, size_t step2, float* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void add64f( const double* src1, size_t step1, const double* src2, size_t step2, double* dst, size_t step, int width, int height, void* ); + +CV_EXPORTS void sub8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void sub8s( const schar* src1, size_t step1, const schar* src2, size_t step2, schar* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void sub16u( const ushort* src1, size_t step1, const ushort* src2, size_t step2, ushort* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void sub16s( const short* src1, size_t step1, const short* src2, size_t step2, short* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void sub32s( const int* src1, size_t step1, const int* src2, size_t step2, int* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void sub32f( const float* src1, size_t step1, const float* src2, size_t step2, float* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void sub64f( const double* src1, size_t step1, const double* src2, size_t step2, double* dst, size_t step, int width, int height, void* ); + +CV_EXPORTS void max8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void max8s( const schar* src1, size_t step1, const schar* src2, size_t step2, schar* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void max16u( const ushort* src1, size_t step1, const ushort* src2, size_t step2, ushort* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void max16s( const short* src1, size_t step1, const short* src2, size_t step2, short* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void max32s( const int* src1, size_t step1, const int* src2, size_t step2, int* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void max32f( const float* src1, size_t step1, const float* src2, size_t step2, float* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void max64f( const double* src1, size_t step1, const double* src2, size_t step2, double* dst, size_t step, int width, int height, void* ); + +CV_EXPORTS void min8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void min8s( const schar* src1, size_t step1, const schar* src2, size_t step2, schar* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void min16u( const ushort* src1, size_t step1, const ushort* src2, size_t step2, ushort* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void min16s( const short* src1, size_t step1, const short* src2, size_t step2, short* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void min32s( const int* src1, size_t step1, const int* src2, size_t step2, int* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void min32f( const float* src1, size_t step1, const float* src2, size_t step2, float* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void min64f( const double* src1, size_t step1, const double* src2, size_t step2, double* dst, size_t step, int width, int height, void* ); + +CV_EXPORTS void absdiff8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void absdiff8s( const schar* src1, size_t step1, const schar* src2, size_t step2, schar* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void absdiff16u( const ushort* src1, size_t step1, const ushort* src2, size_t step2, ushort* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void absdiff16s( const short* src1, size_t step1, const short* src2, size_t step2, short* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void absdiff32s( const int* src1, size_t step1, const int* src2, size_t step2, int* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void absdiff32f( const float* src1, size_t step1, const float* src2, size_t step2, float* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void absdiff64f( const double* src1, size_t step1, const double* src2, size_t step2, double* dst, size_t step, int width, int height, void* ); + +CV_EXPORTS void and8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void or8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void xor8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* ); +CV_EXPORTS void not8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* ); + +CV_EXPORTS void cmp8u(const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* _cmpop); +CV_EXPORTS void cmp8s(const schar* src1, size_t step1, const schar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* _cmpop); +CV_EXPORTS void cmp16u(const ushort* src1, size_t step1, const ushort* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* _cmpop); +CV_EXPORTS void cmp16s(const short* src1, size_t step1, const short* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* _cmpop); +CV_EXPORTS void cmp32s(const int* src1, size_t step1, const int* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* _cmpop); +CV_EXPORTS void cmp32f(const float* src1, size_t step1, const float* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* _cmpop); +CV_EXPORTS void cmp64f(const double* src1, size_t step1, const double* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* _cmpop); + +CV_EXPORTS void mul8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* scale); +CV_EXPORTS void mul8s( const schar* src1, size_t step1, const schar* src2, size_t step2, schar* dst, size_t step, int width, int height, void* scale); +CV_EXPORTS void mul16u( const ushort* src1, size_t step1, const ushort* src2, size_t step2, ushort* dst, size_t step, int width, int height, void* scale); +CV_EXPORTS void mul16s( const short* src1, size_t step1, const short* src2, size_t step2, short* dst, size_t step, int width, int height, void* scale); +CV_EXPORTS void mul32s( const int* src1, size_t step1, const int* src2, size_t step2, int* dst, size_t step, int width, int height, void* scale); +CV_EXPORTS void mul32f( const float* src1, size_t step1, const float* src2, size_t step2, float* dst, size_t step, int width, int height, void* scale); +CV_EXPORTS void mul64f( const double* src1, size_t step1, const double* src2, size_t step2, double* dst, size_t step, int width, int height, void* scale); + +CV_EXPORTS void div8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* scale); +CV_EXPORTS void div8s( const schar* src1, size_t step1, const schar* src2, size_t step2, schar* dst, size_t step, int width, int height, void* scale); +CV_EXPORTS void div16u( const ushort* src1, size_t step1, const ushort* src2, size_t step2, ushort* dst, size_t step, int width, int height, void* scale); +CV_EXPORTS void div16s( const short* src1, size_t step1, const short* src2, size_t step2, short* dst, size_t step, int width, int height, void* scale); +CV_EXPORTS void div32s( const int* src1, size_t step1, const int* src2, size_t step2, int* dst, size_t step, int width, int height, void* scale); +CV_EXPORTS void div32f( const float* src1, size_t step1, const float* src2, size_t step2, float* dst, size_t step, int width, int height, void* scale); +CV_EXPORTS void div64f( const double* src1, size_t step1, const double* src2, size_t step2, double* dst, size_t step, int width, int height, void* scale); + +CV_EXPORTS void recip8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* scale); +CV_EXPORTS void recip8s( const schar* src1, size_t step1, const schar* src2, size_t step2, schar* dst, size_t step, int width, int height, void* scale); +CV_EXPORTS void recip16u( const ushort* src1, size_t step1, const ushort* src2, size_t step2, ushort* dst, size_t step, int width, int height, void* scale); +CV_EXPORTS void recip16s( const short* src1, size_t step1, const short* src2, size_t step2, short* dst, size_t step, int width, int height, void* scale); +CV_EXPORTS void recip32s( const int* src1, size_t step1, const int* src2, size_t step2, int* dst, size_t step, int width, int height, void* scale); +CV_EXPORTS void recip32f( const float* src1, size_t step1, const float* src2, size_t step2, float* dst, size_t step, int width, int height, void* scale); +CV_EXPORTS void recip64f( const double* src1, size_t step1, const double* src2, size_t step2, double* dst, size_t step, int width, int height, void* scale); + +CV_EXPORTS void addWeighted8u( const uchar* src1, size_t step1, const uchar* src2, size_t step2, uchar* dst, size_t step, int width, int height, void* _scalars ); +CV_EXPORTS void addWeighted8s( const schar* src1, size_t step1, const schar* src2, size_t step2, schar* dst, size_t step, int width, int height, void* scalars ); +CV_EXPORTS void addWeighted16u( const ushort* src1, size_t step1, const ushort* src2, size_t step2, ushort* dst, size_t step, int width, int height, void* scalars ); +CV_EXPORTS void addWeighted16s( const short* src1, size_t step1, const short* src2, size_t step2, short* dst, size_t step, int width, int height, void* scalars ); +CV_EXPORTS void addWeighted32s( const int* src1, size_t step1, const int* src2, size_t step2, int* dst, size_t step, int width, int height, void* scalars ); +CV_EXPORTS void addWeighted32f( const float* src1, size_t step1, const float* src2, size_t step2, float* dst, size_t step, int width, int height, void* scalars ); +CV_EXPORTS void addWeighted64f( const double* src1, size_t step1, const double* src2, size_t step2, double* dst, size_t step, int width, int height, void* scalars ); + +//! @} core_hal + +//============================================================================= +// for binary compatibility with 3.0 + +//! @cond IGNORED + +CV_EXPORTS int LU(float* A, size_t astep, int m, float* b, size_t bstep, int n); +CV_EXPORTS int LU(double* A, size_t astep, int m, double* b, size_t bstep, int n); +CV_EXPORTS bool Cholesky(float* A, size_t astep, int m, float* b, size_t bstep, int n); +CV_EXPORTS bool Cholesky(double* A, size_t astep, int m, double* b, size_t bstep, int n); + +CV_EXPORTS void exp(const float* src, float* dst, int n); +CV_EXPORTS void exp(const double* src, double* dst, int n); +CV_EXPORTS void log(const float* src, float* dst, int n); +CV_EXPORTS void log(const double* src, double* dst, int n); + +CV_EXPORTS void magnitude(const float* x, const float* y, float* dst, int n); +CV_EXPORTS void magnitude(const double* x, const double* y, double* dst, int n); +CV_EXPORTS void sqrt(const float* src, float* dst, int len); +CV_EXPORTS void sqrt(const double* src, double* dst, int len); +CV_EXPORTS void invSqrt(const float* src, float* dst, int len); +CV_EXPORTS void invSqrt(const double* src, double* dst, int len); + +//! @endcond + +}} //cv::hal + +#endif //__OPENCV_HAL_HPP__ diff --git a/lib/opencv/include/opencv2/core/hal/interface.h b/lib/opencv/include/opencv2/core/hal/interface.h new file mode 100644 index 000000000..51f760610 --- /dev/null +++ b/lib/opencv/include/opencv2/core/hal/interface.h @@ -0,0 +1,69 @@ +#ifndef _HAL_INTERFACE_HPP_INCLUDED_ +#define _HAL_INTERFACE_HPP_INCLUDED_ + +//! @addtogroup core_hal_interface +//! @{ + +#define CV_HAL_ERROR_OK 0 +#define CV_HAL_ERROR_NOT_IMPLEMENTED 1 +#define CV_HAL_ERROR_UNKNOWN -1 + +#define CV_HAL_CMP_EQ 0 +#define CV_HAL_CMP_GT 1 +#define CV_HAL_CMP_GE 2 +#define CV_HAL_CMP_LT 3 +#define CV_HAL_CMP_LE 4 +#define CV_HAL_CMP_NE 5 + +#ifdef __cplusplus +#include +#else +#include +#endif + +/* primitive types */ +/* + schar - signed 1 byte integer + uchar - unsigned 1 byte integer + short - signed 2 byte integer + ushort - unsigned 2 byte integer + int - signed 4 byte integer + uint - unsigned 4 byte integer + int64 - signed 8 byte integer + uint64 - unsigned 8 byte integer +*/ + +#if !defined _MSC_VER && !defined __BORLANDC__ +# if defined __cplusplus && __cplusplus >= 201103L && !defined __APPLE__ +# include + typedef std::uint32_t uint; +# else +# include + typedef uint32_t uint; +# endif +#else + typedef unsigned uint; +#endif + +typedef signed char schar; + +#ifndef __IPL_H__ + typedef unsigned char uchar; + typedef unsigned short ushort; +#endif + +#if defined _MSC_VER || defined __BORLANDC__ + typedef __int64 int64; + typedef unsigned __int64 uint64; +# define CV_BIG_INT(n) n##I64 +# define CV_BIG_UINT(n) n##UI64 +#else + typedef int64_t int64; + typedef uint64_t uint64; +# define CV_BIG_INT(n) n##LL +# define CV_BIG_UINT(n) n##ULL +#endif + +//! @} + +#endif diff --git a/lib/opencv/include/opencv2/core/hal/intrin.hpp b/lib/opencv/include/opencv2/core/hal/intrin.hpp new file mode 100644 index 000000000..33e14b486 --- /dev/null +++ b/lib/opencv/include/opencv2/core/hal/intrin.hpp @@ -0,0 +1,320 @@ +/*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. +// 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_HAL_INTRIN_HPP__ +#define __OPENCV_HAL_INTRIN_HPP__ + +#include +#include +#include +#include "opencv2/core/cvdef.h" + +#define OPENCV_HAL_ADD(a, b) ((a) + (b)) +#define OPENCV_HAL_AND(a, b) ((a) & (b)) +#define OPENCV_HAL_NOP(a) (a) +#define OPENCV_HAL_1ST(a, b) (a) + +// unlike HAL API, which is in cv::hal, +// we put intrinsics into cv namespace to make its +// access from within opencv code more accessible +namespace cv { + +//! @addtogroup core_hal_intrin +//! @{ + +//! @cond IGNORED +template struct V_TypeTraits +{ + typedef _Tp int_type; + typedef _Tp uint_type; + typedef _Tp abs_type; + typedef _Tp sum_type; + + enum { delta = 0, shift = 0 }; + + static int_type reinterpret_int(_Tp x) { return x; } + static uint_type reinterpet_uint(_Tp x) { return x; } + static _Tp reinterpret_from_int(int_type x) { return (_Tp)x; } +}; + +template<> struct V_TypeTraits +{ + typedef uchar value_type; + typedef schar int_type; + typedef uchar uint_type; + typedef uchar abs_type; + typedef int sum_type; + + typedef ushort w_type; + typedef unsigned q_type; + + enum { delta = 128, shift = 8 }; + + static int_type reinterpret_int(value_type x) { return (int_type)x; } + static uint_type reinterpret_uint(value_type x) { return (uint_type)x; } + static value_type reinterpret_from_int(int_type x) { return (value_type)x; } +}; + +template<> struct V_TypeTraits +{ + typedef schar value_type; + typedef schar int_type; + typedef uchar uint_type; + typedef uchar abs_type; + typedef int sum_type; + + typedef short w_type; + typedef int q_type; + + enum { delta = 128, shift = 8 }; + + static int_type reinterpret_int(value_type x) { return (int_type)x; } + static uint_type reinterpret_uint(value_type x) { return (uint_type)x; } + static value_type reinterpret_from_int(int_type x) { return (value_type)x; } +}; + +template<> struct V_TypeTraits +{ + typedef ushort value_type; + typedef short int_type; + typedef ushort uint_type; + typedef ushort abs_type; + typedef int sum_type; + + typedef unsigned w_type; + typedef uchar nu_type; + + enum { delta = 32768, shift = 16 }; + + static int_type reinterpret_int(value_type x) { return (int_type)x; } + static uint_type reinterpret_uint(value_type x) { return (uint_type)x; } + static value_type reinterpret_from_int(int_type x) { return (value_type)x; } +}; + +template<> struct V_TypeTraits +{ + typedef short value_type; + typedef short int_type; + typedef ushort uint_type; + typedef ushort abs_type; + typedef int sum_type; + + typedef int w_type; + typedef uchar nu_type; + typedef schar n_type; + + enum { delta = 128, shift = 8 }; + + static int_type reinterpret_int(value_type x) { return (int_type)x; } + static uint_type reinterpret_uint(value_type x) { return (uint_type)x; } + static value_type reinterpret_from_int(int_type x) { return (value_type)x; } +}; + +template<> struct V_TypeTraits +{ + typedef unsigned value_type; + typedef int int_type; + typedef unsigned uint_type; + typedef unsigned abs_type; + typedef unsigned sum_type; + + typedef uint64 w_type; + typedef ushort nu_type; + + static int_type reinterpret_int(value_type x) { return (int_type)x; } + static uint_type reinterpret_uint(value_type x) { return (uint_type)x; } + static value_type reinterpret_from_int(int_type x) { return (value_type)x; } +}; + +template<> struct V_TypeTraits +{ + typedef int value_type; + typedef int int_type; + typedef unsigned uint_type; + typedef unsigned abs_type; + typedef int sum_type; + + typedef int64 w_type; + typedef short n_type; + typedef ushort nu_type; + + static int_type reinterpret_int(value_type x) { return (int_type)x; } + static uint_type reinterpret_uint(value_type x) { return (uint_type)x; } + static value_type reinterpret_from_int(int_type x) { return (value_type)x; } +}; + +template<> struct V_TypeTraits +{ + typedef uint64 value_type; + typedef int64 int_type; + typedef uint64 uint_type; + typedef uint64 abs_type; + typedef uint64 sum_type; + + typedef unsigned nu_type; + + static int_type reinterpret_int(value_type x) { return (int_type)x; } + static uint_type reinterpret_uint(value_type x) { return (uint_type)x; } + static value_type reinterpret_from_int(int_type x) { return (value_type)x; } +}; + +template<> struct V_TypeTraits +{ + typedef int64 value_type; + typedef int64 int_type; + typedef uint64 uint_type; + typedef uint64 abs_type; + typedef int64 sum_type; + + typedef int nu_type; + + static int_type reinterpret_int(value_type x) { return (int_type)x; } + static uint_type reinterpret_uint(value_type x) { return (uint_type)x; } + static value_type reinterpret_from_int(int_type x) { return (value_type)x; } +}; + + +template<> struct V_TypeTraits +{ + typedef float value_type; + typedef int int_type; + typedef unsigned uint_type; + typedef float abs_type; + typedef float sum_type; + + typedef double w_type; + + static int_type reinterpret_int(value_type x) + { + Cv32suf u; + u.f = x; + return u.i; + } + static uint_type reinterpet_uint(value_type x) + { + Cv32suf u; + u.f = x; + return u.u; + } + static value_type reinterpret_from_int(int_type x) + { + Cv32suf u; + u.i = x; + return u.f; + } +}; + +template<> struct V_TypeTraits +{ + typedef double value_type; + typedef int64 int_type; + typedef uint64 uint_type; + typedef double abs_type; + typedef double sum_type; + static int_type reinterpret_int(value_type x) + { + Cv64suf u; + u.f = x; + return u.i; + } + static uint_type reinterpet_uint(value_type x) + { + Cv64suf u; + u.f = x; + return u.u; + } + static value_type reinterpret_from_int(int_type x) + { + Cv64suf u; + u.i = x; + return u.f; + } +}; + +template struct V_SIMD128Traits +{ + enum { nlanes = 16 / sizeof(T) }; +}; + +//! @endcond + +//! @} + +} + +#ifdef CV_DOXYGEN +# undef CV_SSE2 +# undef CV_NEON +#endif + +#if CV_SSE2 + +#include "opencv2/core/hal/intrin_sse.hpp" + +#elif CV_NEON + +#include "opencv2/core/hal/intrin_neon.hpp" + +#else + +#include "opencv2/core/hal/intrin_cpp.hpp" + +#endif + +//! @addtogroup core_hal_intrin +//! @{ + +#ifndef CV_SIMD128 +//! Set to 1 if current compiler supports vector extensions (NEON or SSE is enabled) +#define CV_SIMD128 0 +#endif + +#ifndef CV_SIMD128_64F +//! Set to 1 if current intrinsics implementation supports 64-bit float vectors +#define CV_SIMD128_64F 0 +#endif + +//! @} + +#endif diff --git a/lib/opencv/include/opencv2/core/hal/intrin_cpp.hpp b/lib/opencv/include/opencv2/core/hal/intrin_cpp.hpp new file mode 100644 index 000000000..3929e0d03 --- /dev/null +++ b/lib/opencv/include/opencv2/core/hal/intrin_cpp.hpp @@ -0,0 +1,1738 @@ +/*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. +// 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_HAL_INTRIN_CPP_HPP__ +#define __OPENCV_HAL_INTRIN_CPP_HPP__ + +#include +#include +#include +#include "opencv2/core/saturate.hpp" + +namespace cv +{ + +/** @addtogroup core_hal_intrin + +"Universal intrinsics" is a types and functions set intended to simplify vectorization of code on +different platforms. Currently there are two supported SIMD extensions: __SSE/SSE2__ on x86 +architectures and __NEON__ on ARM architectures, both allow working with 128 bit registers +containing packed values of different types. In case when there is no SIMD extension available +during compilation, fallback C++ implementation of intrinsics will be chosen and code will work as +expected although it could be slower. + +### Types + +There are several types representing 128-bit register as a vector of packed values, each type is +implemented as a structure based on a one SIMD register. + +- cv::v_uint8x16 and cv::v_int8x16: sixteen 8-bit integer values (unsigned/signed) - char +- cv::v_uint16x8 and cv::v_int16x8: eight 16-bit integer values (unsigned/signed) - short +- cv::v_uint32x4 and cv::v_int32x4: four 32-bit integer values (unsgined/signed) - int +- cv::v_uint64x2 and cv::v_int64x2: two 64-bit integer values (unsigned/signed) - int64 +- cv::v_float32x4: four 32-bit floating point values (signed) - float +- cv::v_float64x2: two 64-bit floating point valies (signed) - double + +@note +cv::v_float64x2 is not implemented in NEON variant, if you want to use this type, don't forget to +check the CV_SIMD128_64F preprocessor definition: +@code +#if CV_SIMD128_64F +//... +#endif +@endcode + +### Load and store operations + +These operations allow to set contents of the register explicitly or by loading it from some memory +block and to save contents of the register to memory block. + +- Constructors: +@ref v_reg::v_reg(const _Tp *ptr) "from memory", +@ref v_reg::v_reg(_Tp s0, _Tp s1) "from two values", ... +- Other create methods: +@ref v_setall_s8, @ref v_setall_u8, ..., +@ref v_setzero_u8, @ref v_setzero_s8, ... +- Memory operations: +@ref v_load, @ref v_load_aligned, @ref v_load_halves, +@ref v_store, @ref v_store_aligned, +@ref v_store_high, @ref v_store_low + +### Value reordering + +These operations allow to reorder or recombine elements in one or multiple vectors. + +- Interleave, deinterleave (3 and 4 channels): @ref v_load_deinterleave, @ref v_store_interleave +- Expand: @ref v_load_expand, @ref v_load_expand_q, @ref v_expand +- Pack: @ref v_pack, @ref v_pack_u, @ref v_rshr_pack, @ref v_rshr_pack_u, +@ref v_pack_store, @ref v_pack_u_store, @ref v_rshr_pack_store, @ref v_rshr_pack_u_store +- Recombine: @ref v_zip, @ref v_recombine, @ref v_combine_low, @ref v_combine_high +- Extract: @ref v_extract + + +### Arithmetic, bitwise and comparison operations + +Element-wise binary and unary operations. + +- Arithmetics: +@ref operator+(const v_reg &a, const v_reg &b) "+", +@ref operator-(const v_reg &a, const v_reg &b) "-", +@ref operator*(const v_reg &a, const v_reg &b) "*", +@ref operator/(const v_reg &a, const v_reg &b) "/", +@ref v_mul_expand + +- Non-saturating arithmetics: @ref v_add_wrap, @ref v_sub_wrap + +- Bitwise shifts: +@ref operator<<(const v_reg &a, int s) "<<", +@ref operator>>(const v_reg &a, int s) ">>", +@ref v_shl, @ref v_shr + +- Bitwise logic: +@ref operator&(const v_reg &a, const v_reg &b) "&", +@ref operator|(const v_reg &a, const v_reg &b) "|", +@ref operator^(const v_reg &a, const v_reg &b) "^", +@ref operator~(const v_reg &a) "~" + +- Comparison: +@ref operator>(const v_reg &a, const v_reg &b) ">", +@ref operator>=(const v_reg &a, const v_reg &b) ">=", +@ref operator<(const v_reg &a, const v_reg &b) "<", +@ref operator<=(const v_reg &a, const v_reg &b) "<=", +@ref operator==(const v_reg &a, const v_reg &b) "==", +@ref operator!=(const v_reg &a, const v_reg &b) "!=" + +- min/max: @ref v_min, @ref v_max + +### Reduce and mask + +Most of these operations return only one value. + +- Reduce: @ref v_reduce_min, @ref v_reduce_max, @ref v_reduce_sum +- Mask: @ref v_signmask, @ref v_check_all, @ref v_check_any, @ref v_select + +### Other math + +- Some frequent operations: @ref v_sqrt, @ref v_invsqrt, @ref v_magnitude, @ref v_sqr_magnitude +- Absolute values: @ref v_abs, @ref v_absdiff + +### Conversions + +Different type conversions and casts: + +- Rounding: @ref v_round, @ref v_floor, @ref v_ceil, @ref v_trunc, +- To float: @ref v_cvt_f32, @ref v_cvt_f64 +- Reinterpret: @ref v_reinterpret_as_u8, @ref v_reinterpret_as_s8, ... + +### Matrix operations + +In these operations vectors represent matrix rows/columns: @ref v_dotprod, @ref v_matmul, @ref v_transpose4x4 + +### Usability + +Most operations are implemented only for some subset of the available types, following matrices +shows the applicability of different operations to the types. + +Regular integers: + +| Operations\\Types | uint 8x16 | int 8x16 | uint 16x8 | int 16x8 | uint 32x4 | int 32x4 | +|-------------------|:-:|:-:|:-:|:-:|:-:|:-:| +|load, store | x | x | x | x | x | x | +|interleave | x | x | x | x | x | x | +|expand | x | x | x | x | x | x | +|expand_q | x | x | | | | | +|add, sub | x | x | x | x | x | x | +|add_wrap, sub_wrap | x | x | x | x | | | +|mul | | | x | x | x | x | +|mul_expand | | | x | x | x | | +|compare | x | x | x | x | x | x | +|shift | | | x | x | x | x | +|dotprod | | | | x | | | +|logical | x | x | x | x | x | x | +|min, max | x | x | x | x | x | x | +|absdiff | x | x | x | x | x | x | +|reduce | | | | | x | x | +|mask | x | x | x | x | x | x | +|pack | x | x | x | x | x | x | +|pack_u | x | | x | | | | +|unpack | x | x | x | x | x | x | +|extract | x | x | x | x | x | x | +|cvt_flt32 | | | | | | x | +|cvt_flt64 | | | | | | x | +|transpose4x4 | | | | | x | x | + +Big integers: + +| Operations\\Types | uint 64x2 | int 64x2 | +|-------------------|:-:|:-:| +|load, store | x | x | +|add, sub | x | x | +|shift | x | x | +|logical | x | x | +|extract | x | x | + +Floating point: + +| Operations\\Types | float 32x4 | float 64x2 | +|-------------------|:-:|:-:| +|load, store | x | x | +|interleave | x | | +|add, sub | x | x | +|mul | x | x | +|div | x | x | +|compare | x | x | +|min, max | x | x | +|absdiff | x | x | +|reduce | x | | +|mask | x | x | +|unpack | x | x | +|cvt_flt32 | | x | +|cvt_flt64 | x | | +|sqrt, abs | x | x | +|float math | x | x | +|transpose4x4 | x | | + + + @{ */ + +template struct v_reg +{ +//! @cond IGNORED + typedef _Tp lane_type; + typedef v_reg::int_type, n> int_vec; + typedef v_reg::abs_type, n> abs_vec; + enum { nlanes = n }; +// !@endcond + + /** @brief Constructor + + Initializes register with data from memory + @param ptr pointer to memory block with data for register */ + explicit v_reg(const _Tp* ptr) { for( int i = 0; i < n; i++ ) s[i] = ptr[i]; } + + /** @brief Constructor + + Initializes register with two 64-bit values */ + v_reg(_Tp s0, _Tp s1) { s[0] = s0; s[1] = s1; } + + /** @brief Constructor + + Initializes register with four 32-bit values */ + v_reg(_Tp s0, _Tp s1, _Tp s2, _Tp s3) { s[0] = s0; s[1] = s1; s[2] = s2; s[3] = s3; } + + /** @brief Constructor + + Initializes register with eight 16-bit values */ + v_reg(_Tp s0, _Tp s1, _Tp s2, _Tp s3, + _Tp s4, _Tp s5, _Tp s6, _Tp s7) + { + s[0] = s0; s[1] = s1; s[2] = s2; s[3] = s3; + s[4] = s4; s[5] = s5; s[6] = s6; s[7] = s7; + } + + /** @brief Constructor + + Initializes register with sixteen 8-bit values */ + v_reg(_Tp s0, _Tp s1, _Tp s2, _Tp s3, + _Tp s4, _Tp s5, _Tp s6, _Tp s7, + _Tp s8, _Tp s9, _Tp s10, _Tp s11, + _Tp s12, _Tp s13, _Tp s14, _Tp s15) + { + s[0] = s0; s[1] = s1; s[2] = s2; s[3] = s3; + s[4] = s4; s[5] = s5; s[6] = s6; s[7] = s7; + s[8] = s8; s[9] = s9; s[10] = s10; s[11] = s11; + s[12] = s12; s[13] = s13; s[14] = s14; s[15] = s15; + } + + /** @brief Default constructor + + Does not initialize anything*/ + v_reg() {} + + /** @brief Copy constructor */ + v_reg(const v_reg<_Tp, n> & r) + { + for( int i = 0; i < n; i++ ) + s[i] = r.s[i]; + } + /** @brief Access first value + + Returns value of the first lane according to register type, for example: + @code{.cpp} + v_int32x4 r(1, 2, 3, 4); + int v = r.get0(); // returns 1 + v_uint64x2 r(1, 2); + uint64_t v = r.get0(); // returns 1 + @endcode + */ + _Tp get0() const { return s[0]; } + +//! @cond IGNORED + _Tp get(const int i) const { return s[i]; } + v_reg<_Tp, n> high() const + { + v_reg<_Tp, n> c; + int i; + for( i = 0; i < n/2; i++ ) + { + c.s[i] = s[i+(n/2)]; + c.s[i+(n/2)] = 0; + } + return c; + } + + static v_reg<_Tp, n> zero() + { + v_reg<_Tp, n> c; + for( int i = 0; i < n; i++ ) + c.s[i] = (_Tp)0; + return c; + } + + static v_reg<_Tp, n> all(_Tp s) + { + v_reg<_Tp, n> c; + for( int i = 0; i < n; i++ ) + c.s[i] = s; + return c; + } + + template v_reg<_Tp2, n2> reinterpret_as() const + { + size_t bytes = std::min(sizeof(_Tp2)*n2, sizeof(_Tp)*n); + v_reg<_Tp2, n2> c; + std::memcpy(&c.s[0], &s[0], bytes); + return c; + } + + _Tp s[n]; +//! @endcond +}; + +/** @brief Sixteen 8-bit unsigned integer values */ +typedef v_reg v_uint8x16; +/** @brief Sixteen 8-bit signed integer values */ +typedef v_reg v_int8x16; +/** @brief Eight 16-bit unsigned integer values */ +typedef v_reg v_uint16x8; +/** @brief Eight 16-bit signed integer values */ +typedef v_reg v_int16x8; +/** @brief Four 32-bit unsigned integer values */ +typedef v_reg v_uint32x4; +/** @brief Four 32-bit signed integer values */ +typedef v_reg v_int32x4; +/** @brief Four 32-bit floating point values (single precision) */ +typedef v_reg v_float32x4; +/** @brief Two 64-bit floating point values (double precision) */ +typedef v_reg v_float64x2; +/** @brief Two 64-bit unsigned integer values */ +typedef v_reg v_uint64x2; +/** @brief Two 64-bit signed integer values */ +typedef v_reg v_int64x2; + +//! @brief Helper macro +//! @ingroup core_hal_intrin_impl +#define OPENCV_HAL_IMPL_BIN_OP(bin_op) \ +template inline v_reg<_Tp, n> \ + operator bin_op (const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \ +{ \ + v_reg<_Tp, n> c; \ + for( int i = 0; i < n; i++ ) \ + c.s[i] = saturate_cast<_Tp>(a.s[i] bin_op b.s[i]); \ + return c; \ +} \ +template inline v_reg<_Tp, n>& \ + operator bin_op##= (v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \ +{ \ + for( int i = 0; i < n; i++ ) \ + a.s[i] = saturate_cast<_Tp>(a.s[i] bin_op b.s[i]); \ + return a; \ +} + +/** @brief Add values + +For all types. */ +OPENCV_HAL_IMPL_BIN_OP(+) + +/** @brief Subtract values + +For all types. */ +OPENCV_HAL_IMPL_BIN_OP(-) + +/** @brief Multiply values + +For 16- and 32-bit integer types and floating types. */ +OPENCV_HAL_IMPL_BIN_OP(*) + +/** @brief Divide values + +For floating types only. */ +OPENCV_HAL_IMPL_BIN_OP(/) + +//! @brief Helper macro +//! @ingroup core_hal_intrin_impl +#define OPENCV_HAL_IMPL_BIT_OP(bit_op) \ +template inline v_reg<_Tp, n> operator bit_op \ + (const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \ +{ \ + v_reg<_Tp, n> c; \ + typedef typename V_TypeTraits<_Tp>::int_type itype; \ + for( int i = 0; i < n; i++ ) \ + c.s[i] = V_TypeTraits<_Tp>::reinterpret_from_int((itype)(V_TypeTraits<_Tp>::reinterpret_int(a.s[i]) bit_op \ + V_TypeTraits<_Tp>::reinterpret_int(b.s[i]))); \ + return c; \ +} \ +template inline v_reg<_Tp, n>& operator \ + bit_op##= (v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \ +{ \ + typedef typename V_TypeTraits<_Tp>::int_type itype; \ + for( int i = 0; i < n; i++ ) \ + a.s[i] = V_TypeTraits<_Tp>::reinterpret_from_int((itype)(V_TypeTraits<_Tp>::reinterpret_int(a.s[i]) bit_op \ + V_TypeTraits<_Tp>::reinterpret_int(b.s[i]))); \ + return a; \ +} + +/** @brief Bitwise AND + +Only for integer types. */ +OPENCV_HAL_IMPL_BIT_OP(&) + +/** @brief Bitwise OR + +Only for integer types. */ +OPENCV_HAL_IMPL_BIT_OP(|) + +/** @brief Bitwise XOR + +Only for integer types.*/ +OPENCV_HAL_IMPL_BIT_OP(^) + +/** @brief Bitwise NOT + +Only for integer types.*/ +template inline v_reg<_Tp, n> operator ~ (const v_reg<_Tp, n>& a) +{ + v_reg<_Tp, n> c; + for( int i = 0; i < n; i++ ) + c.s[i] = V_TypeTraits<_Tp>::reinterpret_from_int(~V_TypeTraits<_Tp>::reinterpret_int(a.s[i])); + return c; +} + +//! @brief Helper macro +//! @ingroup core_hal_intrin_impl +#define OPENCV_HAL_IMPL_MATH_FUNC(func, cfunc, _Tp2) \ +template inline v_reg<_Tp2, n> func(const v_reg<_Tp, n>& a) \ +{ \ + v_reg<_Tp2, n> c; \ + for( int i = 0; i < n; i++ ) \ + c.s[i] = cfunc(a.s[i]); \ + return c; \ +} + +/** @brief Square root of elements + +Only for floating point types.*/ +OPENCV_HAL_IMPL_MATH_FUNC(v_sqrt, std::sqrt, _Tp) + +//! @cond IGNORED +OPENCV_HAL_IMPL_MATH_FUNC(v_sin, std::sin, _Tp) +OPENCV_HAL_IMPL_MATH_FUNC(v_cos, std::cos, _Tp) +OPENCV_HAL_IMPL_MATH_FUNC(v_exp, std::exp, _Tp) +OPENCV_HAL_IMPL_MATH_FUNC(v_log, std::log, _Tp) +//! @endcond + +/** @brief Absolute value of elements + +Only for floating point types.*/ +OPENCV_HAL_IMPL_MATH_FUNC(v_abs, (typename V_TypeTraits<_Tp>::abs_type)std::abs, + typename V_TypeTraits<_Tp>::abs_type) + +/** @brief Round elements + +Only for floating point types.*/ +OPENCV_HAL_IMPL_MATH_FUNC(v_round, cvRound, int) + +/** @brief Floor elements + +Only for floating point types.*/ +OPENCV_HAL_IMPL_MATH_FUNC(v_floor, cvFloor, int) + +/** @brief Ceil elements + +Only for floating point types.*/ +OPENCV_HAL_IMPL_MATH_FUNC(v_ceil, cvCeil, int) + +/** @brief Truncate elements + +Only for floating point types.*/ +OPENCV_HAL_IMPL_MATH_FUNC(v_trunc, int, int) + +//! @brief Helper macro +//! @ingroup core_hal_intrin_impl +#define OPENCV_HAL_IMPL_MINMAX_FUNC(func, cfunc) \ +template inline v_reg<_Tp, n> func(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \ +{ \ + v_reg<_Tp, n> c; \ + for( int i = 0; i < n; i++ ) \ + c.s[i] = cfunc(a.s[i], b.s[i]); \ + return c; \ +} + +//! @brief Helper macro +//! @ingroup core_hal_intrin_impl +#define OPENCV_HAL_IMPL_REDUCE_MINMAX_FUNC(func, cfunc) \ +template inline _Tp func(const v_reg<_Tp, n>& a) \ +{ \ + _Tp c = a.s[0]; \ + for( int i = 1; i < n; i++ ) \ + c = cfunc(c, a.s[i]); \ + return c; \ +} + +/** @brief Choose min values for each pair + +Scheme: +@code +{A1 A2 ...} +{B1 B2 ...} +-------------- +{min(A1,B1) min(A2,B2) ...} +@endcode +For all types except 64-bit integer. */ +OPENCV_HAL_IMPL_MINMAX_FUNC(v_min, std::min) + +/** @brief Choose max values for each pair + +Scheme: +@code +{A1 A2 ...} +{B1 B2 ...} +-------------- +{max(A1,B1) max(A2,B2) ...} +@endcode +For all types except 64-bit integer. */ +OPENCV_HAL_IMPL_MINMAX_FUNC(v_max, std::max) + +/** @brief Find one min value + +Scheme: +@code +{A1 A2 A3 ...} => min(A1,A2,A3,...) +@endcode +For 32-bit integer and 32-bit floating point types. */ +OPENCV_HAL_IMPL_REDUCE_MINMAX_FUNC(v_reduce_min, std::min) + +/** @brief Find one max value + +Scheme: +@code +{A1 A2 A3 ...} => max(A1,A2,A3,...) +@endcode +For 32-bit integer and 32-bit floating point types. */ +OPENCV_HAL_IMPL_REDUCE_MINMAX_FUNC(v_reduce_max, std::max) + +//! @cond IGNORED +template +inline void v_minmax( const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b, + v_reg<_Tp, n>& minval, v_reg<_Tp, n>& maxval ) +{ + for( int i = 0; i < n; i++ ) + { + minval.s[i] = std::min(a.s[i], b.s[i]); + maxval.s[i] = std::max(a.s[i], b.s[i]); + } +} +//! @endcond + +//! @brief Helper macro +//! @ingroup core_hal_intrin_impl +#define OPENCV_HAL_IMPL_CMP_OP(cmp_op) \ +template \ +inline v_reg<_Tp, n> operator cmp_op(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \ +{ \ + typedef typename V_TypeTraits<_Tp>::int_type itype; \ + v_reg<_Tp, n> c; \ + for( int i = 0; i < n; i++ ) \ + c.s[i] = V_TypeTraits<_Tp>::reinterpret_from_int((itype)-(int)(a.s[i] cmp_op b.s[i])); \ + return c; \ +} + +/** @brief Less-than comparison + +For all types except 64-bit integer values. */ +OPENCV_HAL_IMPL_CMP_OP(<) + +/** @brief Greater-than comparison + +For all types except 64-bit integer values. */ +OPENCV_HAL_IMPL_CMP_OP(>) + +/** @brief Less-than or equal comparison + +For all types except 64-bit integer values. */ +OPENCV_HAL_IMPL_CMP_OP(<=) + +/** @brief Greater-than or equal comparison + +For all types except 64-bit integer values. */ +OPENCV_HAL_IMPL_CMP_OP(>=) + +/** @brief Equal comparison + +For all types except 64-bit integer values. */ +OPENCV_HAL_IMPL_CMP_OP(==) + +/** @brief Not equal comparison + +For all types except 64-bit integer values. */ +OPENCV_HAL_IMPL_CMP_OP(!=) + +//! @brief Helper macro +//! @ingroup core_hal_intrin_impl +#define OPENCV_HAL_IMPL_ADD_SUB_OP(func, bin_op, cast_op, _Tp2) \ +template \ +inline v_reg<_Tp2, n> func(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \ +{ \ + typedef _Tp2 rtype; \ + v_reg c; \ + for( int i = 0; i < n; i++ ) \ + c.s[i] = cast_op(a.s[i] bin_op b.s[i]); \ + return c; \ +} + +/** @brief Add values without saturation + +For 8- and 16-bit integer values. */ +OPENCV_HAL_IMPL_ADD_SUB_OP(v_add_wrap, +, (_Tp), _Tp) + +/** @brief Subtract values without saturation + +For 8- and 16-bit integer values. */ +OPENCV_HAL_IMPL_ADD_SUB_OP(v_sub_wrap, -, (_Tp), _Tp) + +//! @cond IGNORED +template inline T _absdiff(T a, T b) +{ + return a > b ? a - b : b - a; +} +//! @endcond + +/** @brief Absolute difference + +Returns \f$ |a - b| \f$ converted to corresponding unsigned type. +Example: +@code{.cpp} +v_int32x4 a, b; // {1, 2, 3, 4} and {4, 3, 2, 1} +v_uint32x4 c = v_absdiff(a, b); // result is {3, 1, 1, 3} +@endcode +For 8-, 16-, 32-bit integer source types. */ +template +inline v_reg::abs_type, n> v_absdiff(const v_reg<_Tp, n>& a, const v_reg<_Tp, n> & b) +{ + typedef typename V_TypeTraits<_Tp>::abs_type rtype; + v_reg c; + const rtype mask = std::numeric_limits<_Tp>::is_signed ? (1 << (sizeof(rtype)*8 - 1)) : 0; + for( int i = 0; i < n; i++ ) + { + rtype ua = a.s[i] ^ mask; + rtype ub = b.s[i] ^ mask; + c.s[i] = _absdiff(ua, ub); + } + return c; +} + +/** @overload + +For 32-bit floating point values */ +inline v_float32x4 v_absdiff(const v_float32x4& a, const v_float32x4& b) +{ + v_float32x4 c; + for( int i = 0; i < c.nlanes; i++ ) + c.s[i] = _absdiff(a.s[i], b.s[i]); + return c; +} + +/** @overload + +For 64-bit floating point values */ +inline v_float64x2 v_absdiff(const v_float64x2& a, const v_float64x2& b) +{ + v_float64x2 c; + for( int i = 0; i < c.nlanes; i++ ) + c.s[i] = _absdiff(a.s[i], b.s[i]); + return c; +} + +/** @brief Inversed square root + +Returns \f$ 1/sqrt(a) \f$ +For floating point types only. */ +template +inline v_reg<_Tp, n> v_invsqrt(const v_reg<_Tp, n>& a) +{ + v_reg<_Tp, n> c; + for( int i = 0; i < n; i++ ) + c.s[i] = 1.f/std::sqrt(a.s[i]); + return c; +} + +/** @brief Magnitude + +Returns \f$ sqrt(a^2 + b^2) \f$ +For floating point types only. */ +template +inline v_reg<_Tp, n> v_magnitude(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) +{ + v_reg<_Tp, n> c; + for( int i = 0; i < n; i++ ) + c.s[i] = std::sqrt(a.s[i]*a.s[i] + b.s[i]*b.s[i]); + return c; +} + +/** @brief Square of the magnitude + +Returns \f$ a^2 + b^2 \f$ +For floating point types only. */ +template +inline v_reg<_Tp, n> v_sqr_magnitude(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) +{ + v_reg<_Tp, n> c; + for( int i = 0; i < n; i++ ) + c.s[i] = a.s[i]*a.s[i] + b.s[i]*b.s[i]; + return c; +} + +/** @brief Multiply and add + +Returns \f$ a*b + c \f$ +For floating point types only. */ +template +inline v_reg<_Tp, n> v_muladd(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b, + const v_reg<_Tp, n>& c) +{ + v_reg<_Tp, n> d; + for( int i = 0; i < n; i++ ) + d.s[i] = a.s[i]*b.s[i] + c.s[i]; + return d; +} + +/** @brief Dot product of elements + +Multiply values in two registers and sum adjacent result pairs. +Scheme: +@code + {A1 A2 ...} // 16-bit +x {B1 B2 ...} // 16-bit +------------- +{A1B1+A2B2 ...} // 32-bit +@endcode +Implemented only for 16-bit signed source type (v_int16x8). +*/ +template inline v_reg::w_type, n/2> + v_dotprod(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) +{ + typedef typename V_TypeTraits<_Tp>::w_type w_type; + v_reg c; + for( int i = 0; i < (n/2); i++ ) + c.s[i] = (w_type)a.s[i*2]*b.s[i*2] + (w_type)a.s[i*2+1]*b.s[i*2+1]; + return c; +} + +/** @brief Multiply and expand + +Multiply values two registers and store results in two registers with wider pack type. +Scheme: +@code + {A B C D} // 32-bit +x {E F G H} // 32-bit +--------------- +{AE BF} // 64-bit + {CG DH} // 64-bit +@endcode +Example: +@code{.cpp} +v_uint32x4 a, b; // {1,2,3,4} and {2,2,2,2} +v_uint64x2 c, d; // results +v_mul_expand(a, b, c, d); // c, d = {2,4}, {6, 8} +@endcode +Implemented only for 16- and unsigned 32-bit source types (v_int16x8, v_uint16x8, v_uint32x4). +*/ +template inline void v_mul_expand(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b, + v_reg::w_type, n/2>& c, + v_reg::w_type, n/2>& d) +{ + typedef typename V_TypeTraits<_Tp>::w_type w_type; + for( int i = 0; i < (n/2); i++ ) + { + c.s[i] = (w_type)a.s[i]*b.s[i]; + d.s[i] = (w_type)a.s[i+(n/2)]*b.s[i+(n/2)]; + } +} + +//! @cond IGNORED +template inline void v_hsum(const v_reg<_Tp, n>& a, + v_reg::w_type, n/2>& c) +{ + typedef typename V_TypeTraits<_Tp>::w_type w_type; + for( int i = 0; i < (n/2); i++ ) + { + c.s[i] = (w_type)a.s[i*2] + a.s[i*2+1]; + } +} +//! @endcond + +//! @brief Helper macro +//! @ingroup core_hal_intrin_impl +#define OPENCV_HAL_IMPL_SHIFT_OP(shift_op) \ +template inline v_reg<_Tp, n> operator shift_op(const v_reg<_Tp, n>& a, int imm) \ +{ \ + v_reg<_Tp, n> c; \ + for( int i = 0; i < n; i++ ) \ + c.s[i] = (_Tp)(a.s[i] shift_op imm); \ + return c; \ +} + +/** @brief Bitwise shift left + +For 16-, 32- and 64-bit integer values. */ +OPENCV_HAL_IMPL_SHIFT_OP(<<) + +/** @brief Bitwise shift right + +For 16-, 32- and 64-bit integer values. */ +OPENCV_HAL_IMPL_SHIFT_OP(>>) + +/** @brief Sum packed values + +Scheme: +@code +{A1 A2 A3 ...} => sum{A1,A2,A3,...} +@endcode +For 32-bit integer and 32-bit floating point types.*/ +template inline typename V_TypeTraits<_Tp>::sum_type v_reduce_sum(const v_reg<_Tp, n>& a) +{ + typename V_TypeTraits<_Tp>::sum_type c = a.s[0]; + for( int i = 1; i < n; i++ ) + c += a.s[i]; + return c; +} + +/** @brief Get negative values mask + +Returned value is a bit mask with bits set to 1 on places corresponding to negative packed values indexes. +Example: +@code{.cpp} +v_int32x4 r; // set to {-1, -1, 1, 1} +int mask = v_signmask(r); // mask = 3 <== 00000000 00000000 00000000 00000011 +@endcode +For all types except 64-bit. */ +template inline int v_signmask(const v_reg<_Tp, n>& a) +{ + int mask = 0; + for( int i = 0; i < n; i++ ) + mask |= (V_TypeTraits<_Tp>::reinterpret_int(a.s[i]) < 0) << i; + return mask; +} + +/** @brief Check if all packed values are less than zero + +Unsigned values will be casted to signed: `uchar 254 => char -2`. +For all types except 64-bit. */ +template inline bool v_check_all(const v_reg<_Tp, n>& a) +{ + for( int i = 0; i < n; i++ ) + if( V_TypeTraits<_Tp>::reinterpret_int(a.s[i]) >= 0 ) + return false; + return true; +} + +/** @brief Check if any of packed values is less than zero + +Unsigned values will be casted to signed: `uchar 254 => char -2`. +For all types except 64-bit. */ +template inline bool v_check_any(const v_reg<_Tp, n>& a) +{ + for( int i = 0; i < n; i++ ) + if( V_TypeTraits<_Tp>::reinterpret_int(a.s[i]) < 0 ) + return true; + return false; +} + +/** @brief Bitwise select + +Return value will be built by combining values a and b using the following scheme: +If the i-th bit in _mask_ is 1 + select i-th bit from _a_ +else + select i-th bit from _b_ */ +template inline v_reg<_Tp, n> v_select(const v_reg<_Tp, n>& mask, + const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) +{ + typedef V_TypeTraits<_Tp> Traits; + typedef typename Traits::int_type int_type; + v_reg<_Tp, n> c; + for( int i = 0; i < n; i++ ) + { + int_type m = Traits::reinterpret_int(mask.s[i]); + c.s[i] = Traits::reinterpret_from_int((Traits::reinterpret_int(a.s[i]) & m) + | (Traits::reinterpret_int(b.s[i]) & ~m)); + } + return c; +} + +/** @brief Expand values to the wider pack type + +Copy contents of register to two registers with 2x wider pack type. +Scheme: +@code + int32x4 int64x2 int64x2 +{A B C D} ==> {A B} , {C D} +@endcode */ +template inline void v_expand(const v_reg<_Tp, n>& a, + v_reg::w_type, n/2>& b0, + v_reg::w_type, n/2>& b1) +{ + for( int i = 0; i < (n/2); i++ ) + { + b0.s[i] = a.s[i]; + b1.s[i] = a.s[i+(n/2)]; + } +} + +//! @cond IGNORED +template inline v_reg::int_type, n> + v_reinterpret_as_int(const v_reg<_Tp, n>& a) +{ + v_reg::int_type, n> c; + for( int i = 0; i < n; i++ ) + c.s[i] = V_TypeTraits<_Tp>::reinterpret_int(a.s[i]); + return c; +} + +template inline v_reg::uint_type, n> + v_reinterpret_as_uint(const v_reg<_Tp, n>& a) +{ + v_reg::uint_type, n> c; + for( int i = 0; i < n; i++ ) + c.s[i] = V_TypeTraits<_Tp>::reinterpret_uint(a.s[i]); + return c; +} +//! @endcond + +/** @brief Interleave two vectors + +Scheme: +@code + {A1 A2 A3 A4} + {B1 B2 B3 B4} +--------------- + {A1 B1 A2 B2} and {A3 B3 A4 B4} +@endcode +For all types except 64-bit. +*/ +template inline void v_zip( const v_reg<_Tp, n>& a0, const v_reg<_Tp, n>& a1, + v_reg<_Tp, n>& b0, v_reg<_Tp, n>& b1 ) +{ + int i; + for( i = 0; i < n/2; i++ ) + { + b0.s[i*2] = a0.s[i]; + b0.s[i*2+1] = a1.s[i]; + } + for( ; i < n; i++ ) + { + b1.s[i*2-n] = a0.s[i]; + b1.s[i*2-n+1] = a1.s[i]; + } +} + +/** @brief Load register contents from memory + +@param ptr pointer to memory block with data +@return register object + +@note Returned type will be detected from passed pointer type, for example uchar ==> cv::v_uint8x16, int ==> cv::v_int32x4, etc. + */ +template +inline v_reg<_Tp, V_SIMD128Traits<_Tp>::nlanes> v_load(const _Tp* ptr) +{ + return v_reg<_Tp, V_SIMD128Traits<_Tp>::nlanes>(ptr); +} + +/** @brief Load register contents from memory (aligned) + +similar to cv::v_load, but source memory block should be aligned (to 16-byte boundary) + */ +template +inline v_reg<_Tp, V_SIMD128Traits<_Tp>::nlanes> v_load_aligned(const _Tp* ptr) +{ + return v_reg<_Tp, V_SIMD128Traits<_Tp>::nlanes>(ptr); +} + +/** @brief Load register contents from two memory blocks + +@param loptr memory block containing data for first half (0..n/2) +@param hiptr memory block containing data for second half (n/2..n) + +@code{.cpp} +int lo[2] = { 1, 2 }, hi[2] = { 3, 4 }; +v_int32x4 r = v_load_halves(lo, hi); +@endcode + */ +template +inline v_reg<_Tp, V_SIMD128Traits<_Tp>::nlanes> v_load_halves(const _Tp* loptr, const _Tp* hiptr) +{ + v_reg<_Tp, V_SIMD128Traits<_Tp>::nlanes> c; + for( int i = 0; i < c.nlanes/2; i++ ) + { + c.s[i] = loptr[i]; + c.s[i+c.nlanes/2] = hiptr[i]; + } + return c; +} + +/** @brief Load register contents from memory with double expand + +Same as cv::v_load, but result pack type will be 2x wider than memory type. + +@code{.cpp} +short buf[4] = {1, 2, 3, 4}; // type is int16 +v_int32x4 r = v_load_expand(buf); // r = {1, 2, 3, 4} - type is int32 +@endcode +For 8-, 16-, 32-bit integer source types. */ +template +inline v_reg::w_type, V_SIMD128Traits<_Tp>::nlanes / 2> +v_load_expand(const _Tp* ptr) +{ + typedef typename V_TypeTraits<_Tp>::w_type w_type; + v_reg::nlanes> c; + for( int i = 0; i < c.nlanes; i++ ) + { + c.s[i] = ptr[i]; + } + return c; +} + +/** @brief Load register contents from memory with quad expand + +Same as cv::v_load_expand, but result type is 4 times wider than source. +@code{.cpp} +char buf[4] = {1, 2, 3, 4}; // type is int8 +v_int32x4 r = v_load_q(buf); // r = {1, 2, 3, 4} - type is int32 +@endcode +For 8-bit integer source types. */ +template +inline v_reg::q_type, V_SIMD128Traits<_Tp>::nlanes / 4> +v_load_expand_q(const _Tp* ptr) +{ + typedef typename V_TypeTraits<_Tp>::q_type q_type; + v_reg::nlanes> c; + for( int i = 0; i < c.nlanes; i++ ) + { + c.s[i] = ptr[i]; + } + return c; +} + +/** @brief Load and deinterleave (4 channels) + +Load data from memory deinterleave and store to 4 registers. +Scheme: +@code +{A1 B1 C1 D1 A2 B2 C2 D2 ...} ==> {A1 A2 ...}, {B1 B2 ...}, {C1 C2 ...}, {D1 D2 ...} +@endcode +For all types except 64-bit. */ +template inline void v_load_deinterleave(const _Tp* ptr, v_reg<_Tp, n>& a, + v_reg<_Tp, n>& b, v_reg<_Tp, n>& c) +{ + int i, i3; + for( i = i3 = 0; i < n; i++, i3 += 3 ) + { + a.s[i] = ptr[i3]; + b.s[i] = ptr[i3+1]; + c.s[i] = ptr[i3+2]; + } +} + +/** @brief Load and deinterleave (3 channels) + +Load data from memory deinterleave and store to 3 registers. +Scheme: +@code +{A1 B1 C1 A2 B2 C2 ...} ==> {A1 A2 ...}, {B1 B2 ...}, {C1 C2 ...} +@endcode +For all types except 64-bit. */ +template +inline void v_load_deinterleave(const _Tp* ptr, v_reg<_Tp, n>& a, + v_reg<_Tp, n>& b, v_reg<_Tp, n>& c, + v_reg<_Tp, n>& d) +{ + int i, i4; + for( i = i4 = 0; i < n; i++, i4 += 4 ) + { + a.s[i] = ptr[i4]; + b.s[i] = ptr[i4+1]; + c.s[i] = ptr[i4+2]; + d.s[i] = ptr[i4+3]; + } +} + +/** @brief Interleave and store (3 channels) + +Interleave and store data from 3 registers to memory. +Scheme: +@code +{A1 A2 ...}, {B1 B2 ...}, {C1 C2 ...}, {D1 D2 ...} ==> {A1 B1 C1 D1 A2 B2 C2 D2 ...} +@endcode +For all types except 64-bit. */ +template +inline void v_store_interleave( _Tp* ptr, const v_reg<_Tp, n>& a, + const v_reg<_Tp, n>& b, const v_reg<_Tp, n>& c) +{ + int i, i3; + for( i = i3 = 0; i < n; i++, i3 += 3 ) + { + ptr[i3] = a.s[i]; + ptr[i3+1] = b.s[i]; + ptr[i3+2] = c.s[i]; + } +} + +/** @brief Interleave and store (4 channels) + +Interleave and store data from 4 registers to memory. +Scheme: +@code +{A1 A2 ...}, {B1 B2 ...}, {C1 C2 ...}, {D1 D2 ...} ==> {A1 B1 C1 D1 A2 B2 C2 D2 ...} +@endcode +For all types except 64-bit. */ +template inline void v_store_interleave( _Tp* ptr, const v_reg<_Tp, n>& a, + const v_reg<_Tp, n>& b, const v_reg<_Tp, n>& c, + const v_reg<_Tp, n>& d) +{ + int i, i4; + for( i = i4 = 0; i < n; i++, i4 += 4 ) + { + ptr[i4] = a.s[i]; + ptr[i4+1] = b.s[i]; + ptr[i4+2] = c.s[i]; + ptr[i4+3] = d.s[i]; + } +} + +/** @brief Store data to memory + +Store register contents to memory. +Scheme: +@code + REG {A B C D} ==> MEM {A B C D} +@endcode +Pointer can be unaligned. */ +template +inline void v_store(_Tp* ptr, const v_reg<_Tp, n>& a) +{ + for( int i = 0; i < n; i++ ) + ptr[i] = a.s[i]; +} + +/** @brief Store data to memory (lower half) + +Store lower half of register contents to memory. +Scheme: +@code + REG {A B C D} ==> MEM {A B} +@endcode */ +template +inline void v_store_low(_Tp* ptr, const v_reg<_Tp, n>& a) +{ + for( int i = 0; i < (n/2); i++ ) + ptr[i] = a.s[i]; +} + +/** @brief Store data to memory (higher half) + +Store higher half of register contents to memory. +Scheme: +@code + REG {A B C D} ==> MEM {C D} +@endcode */ +template +inline void v_store_high(_Tp* ptr, const v_reg<_Tp, n>& a) +{ + for( int i = 0; i < (n/2); i++ ) + ptr[i] = a.s[i+(n/2)]; +} + +/** @brief Store data to memory (aligned) + +Store register contents to memory. +Scheme: +@code + REG {A B C D} ==> MEM {A B C D} +@endcode +Pointer __should__ be aligned by 16-byte boundary. */ +template +inline void v_store_aligned(_Tp* ptr, const v_reg<_Tp, n>& a) +{ + for( int i = 0; i < n; i++ ) + ptr[i] = a.s[i]; +} + +/** @brief Combine vector from first elements of two vectors + +Scheme: +@code + {A1 A2 A3 A4} + {B1 B2 B3 B4} +--------------- + {A1 A2 B1 B2} +@endcode +For all types except 64-bit. */ +template +inline v_reg<_Tp, n> v_combine_low(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) +{ + v_reg<_Tp, n> c; + for( int i = 0; i < (n/2); i++ ) + { + c.s[i] = a.s[i]; + c.s[i+(n/2)] = b.s[i]; + } + return c; +} + +/** @brief Combine vector from last elements of two vectors + +Scheme: +@code + {A1 A2 A3 A4} + {B1 B2 B3 B4} +--------------- + {A3 A4 B3 B4} +@endcode +For all types except 64-bit. */ +template +inline v_reg<_Tp, n> v_combine_high(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) +{ + v_reg<_Tp, n> c; + for( int i = 0; i < (n/2); i++ ) + { + c.s[i] = a.s[i+(n/2)]; + c.s[i+(n/2)] = b.s[i+(n/2)]; + } + return c; +} + +/** @brief Combine two vectors from lower and higher parts of two other vectors + +@code{.cpp} +low = cv::v_combine_low(a, b); +high = cv::v_combine_high(a, b); +@endcode */ +template +inline void v_recombine(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b, + v_reg<_Tp, n>& low, v_reg<_Tp, n>& high) +{ + for( int i = 0; i < (n/2); i++ ) + { + low.s[i] = a.s[i]; + low.s[i+(n/2)] = b.s[i]; + high.s[i] = a.s[i+(n/2)]; + high.s[i+(n/2)] = b.s[i+(n/2)]; + } +} + +/** @brief Vector extract + +Scheme: +@code + {A1 A2 A3 A4} + {B1 B2 B3 B4} +======================== +shift = 1 {A2 A3 A4 B1} +shift = 2 {A3 A4 B1 B2} +shift = 3 {A4 B1 B2 B3} +@endcode +Restriction: 0 <= shift < nlanes + +Usage: +@code +v_int32x4 a, b, c; +c = v_extract<2>(a, b); +@endcode +For integer types only. */ +template +inline v_reg<_Tp, n> v_extract(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) +{ + v_reg<_Tp, n> r; + const int shift = n - s; + int i = 0; + for (; i < shift; ++i) + r.s[i] = a.s[i+s]; + for (; i < n; ++i) + r.s[i] = b.s[i-shift]; + return r; +} + +/** @brief Round + +Rounds each value. Input type is float vector ==> output type is int vector.*/ +template inline v_reg v_round(const v_reg& a) +{ + v_reg c; + for( int i = 0; i < n; i++ ) + c.s[i] = cvRound(a.s[i]); + return c; +} + +/** @brief Floor + +Floor each value. Input type is float vector ==> output type is int vector.*/ +template inline v_reg v_floor(const v_reg& a) +{ + v_reg c; + for( int i = 0; i < n; i++ ) + c.s[i] = cvFloor(a.s[i]); + return c; +} + +/** @brief Ceil + +Ceil each value. Input type is float vector ==> output type is int vector.*/ +template inline v_reg v_ceil(const v_reg& a) +{ + v_reg c; + for( int i = 0; i < n; i++ ) + c.s[i] = cvCeil(a.s[i]); + return c; +} + +/** @brief Trunc + +Truncate each value. Input type is float vector ==> output type is int vector.*/ +template inline v_reg v_trunc(const v_reg& a) +{ + v_reg c; + for( int i = 0; i < n; i++ ) + c.s[i] = (int)(a.s[i]); + return c; +} + +/** @overload */ +template inline v_reg v_round(const v_reg& a) +{ + v_reg c; + for( int i = 0; i < n; i++ ) + { + c.s[i] = cvRound(a.s[i]); + c.s[i+n] = 0; + } + return c; +} + +/** @overload */ +template inline v_reg v_floor(const v_reg& a) +{ + v_reg c; + for( int i = 0; i < n; i++ ) + { + c.s[i] = cvFloor(a.s[i]); + c.s[i+n] = 0; + } + return c; +} + +/** @overload */ +template inline v_reg v_ceil(const v_reg& a) +{ + v_reg c; + for( int i = 0; i < n; i++ ) + { + c.s[i] = cvCeil(a.s[i]); + c.s[i+n] = 0; + } + return c; +} + +/** @overload */ +template inline v_reg v_trunc(const v_reg& a) +{ + v_reg c; + for( int i = 0; i < n; i++ ) + { + c.s[i] = cvCeil(a.s[i]); + c.s[i+n] = 0; + } + return c; +} + +/** @brief Convert to float + +Supported input type is cv::v_int32x4. */ +template inline v_reg v_cvt_f32(const v_reg& a) +{ + v_reg c; + for( int i = 0; i < n; i++ ) + c.s[i] = (float)a.s[i]; + return c; +} + +/** @brief Convert to double + +Supported input type is cv::v_int32x4. */ +template inline v_reg v_cvt_f64(const v_reg& a) +{ + v_reg c; + for( int i = 0; i < n; i++ ) + c.s[i] = (double)a.s[i]; + return c; +} + +/** @brief Convert to double + +Supported input type is cv::v_float32x4. */ +template inline v_reg v_cvt_f64(const v_reg& a) +{ + v_reg c; + for( int i = 0; i < n; i++ ) + c.s[i] = (double)a.s[i]; + return c; +} + +/** @brief Transpose 4x4 matrix + +Scheme: +@code +a0 {A1 A2 A3 A4} +a1 {B1 B2 B3 B4} +a2 {C1 C2 C3 C4} +a3 {D1 D2 D3 D4} +=============== +b0 {A1 B1 C1 D1} +b1 {A2 B2 C2 D2} +b2 {A3 B3 C3 D3} +b3 {A4 B4 C4 D4} +@endcode +*/ +template +inline void v_transpose4x4( v_reg<_Tp, 4>& a0, const v_reg<_Tp, 4>& a1, + const v_reg<_Tp, 4>& a2, const v_reg<_Tp, 4>& a3, + v_reg<_Tp, 4>& b0, v_reg<_Tp, 4>& b1, + v_reg<_Tp, 4>& b2, v_reg<_Tp, 4>& b3 ) +{ + b0 = v_reg<_Tp, 4>(a0.s[0], a1.s[0], a2.s[0], a3.s[0]); + b1 = v_reg<_Tp, 4>(a0.s[1], a1.s[1], a2.s[1], a3.s[1]); + b2 = v_reg<_Tp, 4>(a0.s[2], a1.s[2], a2.s[2], a3.s[2]); + b3 = v_reg<_Tp, 4>(a0.s[3], a1.s[3], a2.s[3], a3.s[3]); +} + +//! @brief Helper macro +//! @ingroup core_hal_intrin_impl +#define OPENCV_HAL_IMPL_C_INIT_ZERO(_Tpvec, _Tp, suffix) \ +inline _Tpvec v_setzero_##suffix() { return _Tpvec::zero(); } + +//! @name Init with zero +//! @{ +//! @brief Create new vector with zero elements +OPENCV_HAL_IMPL_C_INIT_ZERO(v_uint8x16, uchar, u8) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_int8x16, schar, s8) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_uint16x8, ushort, u16) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_int16x8, short, s16) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_uint32x4, unsigned, u32) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_int32x4, int, s32) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_float32x4, float, f32) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_float64x2, double, f64) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_uint64x2, uint64, u64) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_int64x2, int64, s64) +//! @} + +//! @brief Helper macro +//! @ingroup core_hal_intrin_impl +#define OPENCV_HAL_IMPL_C_INIT_VAL(_Tpvec, _Tp, suffix) \ +inline _Tpvec v_setall_##suffix(_Tp val) { return _Tpvec::all(val); } + +//! @name Init with value +//! @{ +//! @brief Create new vector with elements set to a specific value +OPENCV_HAL_IMPL_C_INIT_VAL(v_uint8x16, uchar, u8) +OPENCV_HAL_IMPL_C_INIT_VAL(v_int8x16, schar, s8) +OPENCV_HAL_IMPL_C_INIT_VAL(v_uint16x8, ushort, u16) +OPENCV_HAL_IMPL_C_INIT_VAL(v_int16x8, short, s16) +OPENCV_HAL_IMPL_C_INIT_VAL(v_uint32x4, unsigned, u32) +OPENCV_HAL_IMPL_C_INIT_VAL(v_int32x4, int, s32) +OPENCV_HAL_IMPL_C_INIT_VAL(v_float32x4, float, f32) +OPENCV_HAL_IMPL_C_INIT_VAL(v_float64x2, double, f64) +OPENCV_HAL_IMPL_C_INIT_VAL(v_uint64x2, uint64, u64) +OPENCV_HAL_IMPL_C_INIT_VAL(v_int64x2, int64, s64) +//! @} + +//! @brief Helper macro +//! @ingroup core_hal_intrin_impl +#define OPENCV_HAL_IMPL_C_REINTERPRET(_Tpvec, _Tp, suffix) \ +template inline _Tpvec \ + v_reinterpret_as_##suffix(const v_reg<_Tp0, n0>& a) \ +{ return a.template reinterpret_as<_Tp, _Tpvec::nlanes>(); } + +//! @name Reinterpret +//! @{ +//! @brief Convert vector to different type without modifying underlying data. +OPENCV_HAL_IMPL_C_REINTERPRET(v_uint8x16, uchar, u8) +OPENCV_HAL_IMPL_C_REINTERPRET(v_int8x16, schar, s8) +OPENCV_HAL_IMPL_C_REINTERPRET(v_uint16x8, ushort, u16) +OPENCV_HAL_IMPL_C_REINTERPRET(v_int16x8, short, s16) +OPENCV_HAL_IMPL_C_REINTERPRET(v_uint32x4, unsigned, u32) +OPENCV_HAL_IMPL_C_REINTERPRET(v_int32x4, int, s32) +OPENCV_HAL_IMPL_C_REINTERPRET(v_float32x4, float, f32) +OPENCV_HAL_IMPL_C_REINTERPRET(v_float64x2, double, f64) +OPENCV_HAL_IMPL_C_REINTERPRET(v_uint64x2, uint64, u64) +OPENCV_HAL_IMPL_C_REINTERPRET(v_int64x2, int64, s64) +//! @} + +//! @brief Helper macro +//! @ingroup core_hal_intrin_impl +#define OPENCV_HAL_IMPL_C_SHIFTL(_Tpvec, _Tp) \ +template inline _Tpvec v_shl(const _Tpvec& a) \ +{ return a << n; } + +//! @name Left shift +//! @{ +//! @brief Shift left +OPENCV_HAL_IMPL_C_SHIFTL(v_uint16x8, ushort) +OPENCV_HAL_IMPL_C_SHIFTL(v_int16x8, short) +OPENCV_HAL_IMPL_C_SHIFTL(v_uint32x4, unsigned) +OPENCV_HAL_IMPL_C_SHIFTL(v_int32x4, int) +OPENCV_HAL_IMPL_C_SHIFTL(v_uint64x2, uint64) +OPENCV_HAL_IMPL_C_SHIFTL(v_int64x2, int64) +//! @} + +//! @brief Helper macro +//! @ingroup core_hal_intrin_impl +#define OPENCV_HAL_IMPL_C_SHIFTR(_Tpvec, _Tp) \ +template inline _Tpvec v_shr(const _Tpvec& a) \ +{ return a >> n; } + +//! @name Right shift +//! @{ +//! @brief Shift right +OPENCV_HAL_IMPL_C_SHIFTR(v_uint16x8, ushort) +OPENCV_HAL_IMPL_C_SHIFTR(v_int16x8, short) +OPENCV_HAL_IMPL_C_SHIFTR(v_uint32x4, unsigned) +OPENCV_HAL_IMPL_C_SHIFTR(v_int32x4, int) +OPENCV_HAL_IMPL_C_SHIFTR(v_uint64x2, uint64) +OPENCV_HAL_IMPL_C_SHIFTR(v_int64x2, int64) +//! @} + +//! @brief Helper macro +//! @ingroup core_hal_intrin_impl +#define OPENCV_HAL_IMPL_C_RSHIFTR(_Tpvec, _Tp) \ +template inline _Tpvec v_rshr(const _Tpvec& a) \ +{ \ + _Tpvec c; \ + for( int i = 0; i < _Tpvec::nlanes; i++ ) \ + c.s[i] = (_Tp)((a.s[i] + ((_Tp)1 << (n - 1))) >> n); \ + return c; \ +} + +//! @name Rounding shift +//! @{ +//! @brief Rounding shift right +OPENCV_HAL_IMPL_C_RSHIFTR(v_uint16x8, ushort) +OPENCV_HAL_IMPL_C_RSHIFTR(v_int16x8, short) +OPENCV_HAL_IMPL_C_RSHIFTR(v_uint32x4, unsigned) +OPENCV_HAL_IMPL_C_RSHIFTR(v_int32x4, int) +OPENCV_HAL_IMPL_C_RSHIFTR(v_uint64x2, uint64) +OPENCV_HAL_IMPL_C_RSHIFTR(v_int64x2, int64) +//! @} + +//! @brief Helper macro +//! @ingroup core_hal_intrin_impl +#define OPENCV_HAL_IMPL_C_PACK(_Tpvec, _Tpnvec, _Tpn, pack_suffix) \ +inline _Tpnvec v_##pack_suffix(const _Tpvec& a, const _Tpvec& b) \ +{ \ + _Tpnvec c; \ + for( int i = 0; i < _Tpvec::nlanes; i++ ) \ + { \ + c.s[i] = saturate_cast<_Tpn>(a.s[i]); \ + c.s[i+_Tpvec::nlanes] = saturate_cast<_Tpn>(b.s[i]); \ + } \ + return c; \ +} + +//! @name Pack +//! @{ +//! @brief Pack values from two vectors to one +//! +//! Return vector type have twice more elements than input vector types. Variant with _u_ suffix also +//! converts to corresponding unsigned type. +//! +//! - pack: for 16-, 32- and 64-bit integer input types +//! - pack_u: for 16- and 32-bit signed integer input types +OPENCV_HAL_IMPL_C_PACK(v_uint16x8, v_uint8x16, uchar, pack) +OPENCV_HAL_IMPL_C_PACK(v_int16x8, v_int8x16, schar, pack) +OPENCV_HAL_IMPL_C_PACK(v_uint32x4, v_uint16x8, ushort, pack) +OPENCV_HAL_IMPL_C_PACK(v_int32x4, v_int16x8, short, pack) +OPENCV_HAL_IMPL_C_PACK(v_uint64x2, v_uint32x4, unsigned, pack) +OPENCV_HAL_IMPL_C_PACK(v_int64x2, v_int32x4, int, pack) +OPENCV_HAL_IMPL_C_PACK(v_int16x8, v_uint8x16, uchar, pack_u) +OPENCV_HAL_IMPL_C_PACK(v_int32x4, v_uint16x8, ushort, pack_u) +//! @} + +//! @brief Helper macro +//! @ingroup core_hal_intrin_impl +#define OPENCV_HAL_IMPL_C_RSHR_PACK(_Tpvec, _Tp, _Tpnvec, _Tpn, pack_suffix) \ +template inline _Tpnvec v_rshr_##pack_suffix(const _Tpvec& a, const _Tpvec& b) \ +{ \ + _Tpnvec c; \ + for( int i = 0; i < _Tpvec::nlanes; i++ ) \ + { \ + c.s[i] = saturate_cast<_Tpn>((a.s[i] + ((_Tp)1 << (n - 1))) >> n); \ + c.s[i+_Tpvec::nlanes] = saturate_cast<_Tpn>((b.s[i] + ((_Tp)1 << (n - 1))) >> n); \ + } \ + return c; \ +} + +//! @name Pack with rounding shift +//! @{ +//! @brief Pack values from two vectors to one with rounding shift +//! +//! Values from the input vectors will be shifted right by _n_ bits with rounding, converted to narrower +//! type and returned in the result vector. Variant with _u_ suffix converts to unsigned type. +//! +//! - pack: for 16-, 32- and 64-bit integer input types +//! - pack_u: for 16- and 32-bit signed integer input types +OPENCV_HAL_IMPL_C_RSHR_PACK(v_uint16x8, ushort, v_uint8x16, uchar, pack) +OPENCV_HAL_IMPL_C_RSHR_PACK(v_int16x8, short, v_int8x16, schar, pack) +OPENCV_HAL_IMPL_C_RSHR_PACK(v_uint32x4, unsigned, v_uint16x8, ushort, pack) +OPENCV_HAL_IMPL_C_RSHR_PACK(v_int32x4, int, v_int16x8, short, pack) +OPENCV_HAL_IMPL_C_RSHR_PACK(v_uint64x2, uint64, v_uint32x4, unsigned, pack) +OPENCV_HAL_IMPL_C_RSHR_PACK(v_int64x2, int64, v_int32x4, int, pack) +OPENCV_HAL_IMPL_C_RSHR_PACK(v_int16x8, short, v_uint8x16, uchar, pack_u) +OPENCV_HAL_IMPL_C_RSHR_PACK(v_int32x4, int, v_uint16x8, ushort, pack_u) +//! @} + +//! @brief Helper macro +//! @ingroup core_hal_intrin_impl +#define OPENCV_HAL_IMPL_C_PACK_STORE(_Tpvec, _Tp, _Tpnvec, _Tpn, pack_suffix) \ +inline void v_##pack_suffix##_store(_Tpn* ptr, const _Tpvec& a) \ +{ \ + for( int i = 0; i < _Tpvec::nlanes; i++ ) \ + ptr[i] = saturate_cast<_Tpn>(a.s[i]); \ +} + +//! @name Pack and store +//! @{ +//! @brief Store values from the input vector into memory with pack +//! +//! Values will be stored into memory with saturating conversion to narrower type. +//! Variant with _u_ suffix converts to corresponding unsigned type. +//! +//! - pack: for 16-, 32- and 64-bit integer input types +//! - pack_u: for 16- and 32-bit signed integer input types +OPENCV_HAL_IMPL_C_PACK_STORE(v_uint16x8, ushort, v_uint8x16, uchar, pack) +OPENCV_HAL_IMPL_C_PACK_STORE(v_int16x8, short, v_int8x16, schar, pack) +OPENCV_HAL_IMPL_C_PACK_STORE(v_uint32x4, unsigned, v_uint16x8, ushort, pack) +OPENCV_HAL_IMPL_C_PACK_STORE(v_int32x4, int, v_int16x8, short, pack) +OPENCV_HAL_IMPL_C_PACK_STORE(v_uint64x2, uint64, v_uint32x4, unsigned, pack) +OPENCV_HAL_IMPL_C_PACK_STORE(v_int64x2, int64, v_int32x4, int, pack) +OPENCV_HAL_IMPL_C_PACK_STORE(v_int16x8, short, v_uint8x16, uchar, pack_u) +OPENCV_HAL_IMPL_C_PACK_STORE(v_int32x4, int, v_uint16x8, ushort, pack_u) +//! @} + +//! @brief Helper macro +//! @ingroup core_hal_intrin_impl +#define OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(_Tpvec, _Tp, _Tpnvec, _Tpn, pack_suffix) \ +template inline void v_rshr_##pack_suffix##_store(_Tpn* ptr, const _Tpvec& a) \ +{ \ + for( int i = 0; i < _Tpvec::nlanes; i++ ) \ + ptr[i] = saturate_cast<_Tpn>((a.s[i] + ((_Tp)1 << (n - 1))) >> n); \ +} + +//! @name Pack and store with rounding shift +//! @{ +//! @brief Store values from the input vector into memory with pack +//! +//! Values will be shifted _n_ bits right with rounding, converted to narrower type and stored into +//! memory. Variant with _u_ suffix converts to unsigned type. +//! +//! - pack: for 16-, 32- and 64-bit integer input types +//! - pack_u: for 16- and 32-bit signed integer input types +OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(v_uint16x8, ushort, v_uint8x16, uchar, pack) +OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(v_int16x8, short, v_int8x16, schar, pack) +OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(v_uint32x4, unsigned, v_uint16x8, ushort, pack) +OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(v_int32x4, int, v_int16x8, short, pack) +OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(v_uint64x2, uint64, v_uint32x4, unsigned, pack) +OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(v_int64x2, int64, v_int32x4, int, pack) +OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(v_int16x8, short, v_uint8x16, uchar, pack_u) +OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(v_int32x4, int, v_uint16x8, ushort, pack_u) +//! @} + +/** @brief Matrix multiplication + +Scheme: +@code +{A0 A1 A2 A3} |V0| +{B0 B1 B2 B3} |V1| +{C0 C1 C2 C3} |V2| +{D0 D1 D2 D3} x |V3| +==================== +{R0 R1 R2 R3}, where: +R0 = A0V0 + A1V1 + A2V2 + A3V3, +R1 = B0V0 + B1V1 + B2V2 + B3V3 +... +@endcode +*/ +inline v_float32x4 v_matmul(const v_float32x4& v, const v_float32x4& m0, + const v_float32x4& m1, const v_float32x4& m2, + const v_float32x4& m3) +{ + return v_float32x4(v.s[0]*m0.s[0] + v.s[1]*m1.s[0] + v.s[2]*m2.s[0] + v.s[3]*m3.s[0], + v.s[0]*m0.s[1] + v.s[1]*m1.s[1] + v.s[2]*m2.s[1] + v.s[3]*m3.s[1], + v.s[0]*m0.s[2] + v.s[1]*m1.s[2] + v.s[2]*m2.s[2] + v.s[3]*m3.s[2], + v.s[0]*m0.s[3] + v.s[1]*m1.s[3] + v.s[2]*m2.s[3] + v.s[3]*m3.s[3]); +} + +//! @} + +} + +#endif diff --git a/lib/opencv/include/opencv2/core/hal/intrin_neon.hpp b/lib/opencv/include/opencv2/core/hal/intrin_neon.hpp new file mode 100644 index 000000000..f3e47ca8b --- /dev/null +++ b/lib/opencv/include/opencv2/core/hal/intrin_neon.hpp @@ -0,0 +1,864 @@ +/*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. +// 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_HAL_INTRIN_NEON_HPP__ +#define __OPENCV_HAL_INTRIN_NEON_HPP__ + +#include + +namespace cv +{ + +//! @cond IGNORED + +#define CV_SIMD128 1 + +struct v_uint8x16 +{ + typedef uchar lane_type; + enum { nlanes = 16 }; + + v_uint8x16() {} + explicit v_uint8x16(uint8x16_t v) : val(v) {} + v_uint8x16(uchar v0, uchar v1, uchar v2, uchar v3, uchar v4, uchar v5, uchar v6, uchar v7, + uchar v8, uchar v9, uchar v10, uchar v11, uchar v12, uchar v13, uchar v14, uchar v15) + { + uchar v[] = {v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15}; + val = vld1q_u8(v); + } + uchar get0() const + { + return vgetq_lane_u8(val, 0); + } + + uint8x16_t val; +}; + +struct v_int8x16 +{ + typedef schar lane_type; + enum { nlanes = 16 }; + + v_int8x16() {} + explicit v_int8x16(int8x16_t v) : val(v) {} + v_int8x16(schar v0, schar v1, schar v2, schar v3, schar v4, schar v5, schar v6, schar v7, + schar v8, schar v9, schar v10, schar v11, schar v12, schar v13, schar v14, schar v15) + { + schar v[] = {v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15}; + val = vld1q_s8(v); + } + schar get0() const + { + return vgetq_lane_s8(val, 0); + } + + int8x16_t val; +}; + +struct v_uint16x8 +{ + typedef ushort lane_type; + enum { nlanes = 8 }; + + v_uint16x8() {} + explicit v_uint16x8(uint16x8_t v) : val(v) {} + v_uint16x8(ushort v0, ushort v1, ushort v2, ushort v3, ushort v4, ushort v5, ushort v6, ushort v7) + { + ushort v[] = {v0, v1, v2, v3, v4, v5, v6, v7}; + val = vld1q_u16(v); + } + ushort get0() const + { + return vgetq_lane_u16(val, 0); + } + + uint16x8_t val; +}; + +struct v_int16x8 +{ + typedef short lane_type; + enum { nlanes = 8 }; + + v_int16x8() {} + explicit v_int16x8(int16x8_t v) : val(v) {} + v_int16x8(short v0, short v1, short v2, short v3, short v4, short v5, short v6, short v7) + { + short v[] = {v0, v1, v2, v3, v4, v5, v6, v7}; + val = vld1q_s16(v); + } + short get0() const + { + return vgetq_lane_s16(val, 0); + } + + int16x8_t val; +}; + +struct v_uint32x4 +{ + typedef unsigned lane_type; + enum { nlanes = 4 }; + + v_uint32x4() {} + explicit v_uint32x4(uint32x4_t v) : val(v) {} + v_uint32x4(unsigned v0, unsigned v1, unsigned v2, unsigned v3) + { + unsigned v[] = {v0, v1, v2, v3}; + val = vld1q_u32(v); + } + unsigned get0() const + { + return vgetq_lane_u32(val, 0); + } + + uint32x4_t val; +}; + +struct v_int32x4 +{ + typedef int lane_type; + enum { nlanes = 4 }; + + v_int32x4() {} + explicit v_int32x4(int32x4_t v) : val(v) {} + v_int32x4(int v0, int v1, int v2, int v3) + { + int v[] = {v0, v1, v2, v3}; + val = vld1q_s32(v); + } + int get0() const + { + return vgetq_lane_s32(val, 0); + } + int32x4_t val; +}; + +struct v_float32x4 +{ + typedef float lane_type; + enum { nlanes = 4 }; + + v_float32x4() {} + explicit v_float32x4(float32x4_t v) : val(v) {} + v_float32x4(float v0, float v1, float v2, float v3) + { + float v[] = {v0, v1, v2, v3}; + val = vld1q_f32(v); + } + float get0() const + { + return vgetq_lane_f32(val, 0); + } + float32x4_t val; +}; + +struct v_uint64x2 +{ + typedef uint64 lane_type; + enum { nlanes = 2 }; + + v_uint64x2() {} + explicit v_uint64x2(uint64x2_t v) : val(v) {} + v_uint64x2(unsigned v0, unsigned v1) + { + uint64 v[] = {v0, v1}; + val = vld1q_u64(v); + } + uint64 get0() const + { + return vgetq_lane_u64(val, 0); + } + uint64x2_t val; +}; + +struct v_int64x2 +{ + typedef int64 lane_type; + enum { nlanes = 2 }; + + v_int64x2() {} + explicit v_int64x2(int64x2_t v) : val(v) {} + v_int64x2(int v0, int v1) + { + int64 v[] = {v0, v1}; + val = vld1q_s64(v); + } + int64 get0() const + { + return vgetq_lane_s64(val, 0); + } + int64x2_t val; +}; + +#define OPENCV_HAL_IMPL_NEON_INIT(_Tpv, _Tp, suffix) \ +inline v_##_Tpv v_setzero_##suffix() { return v_##_Tpv(vdupq_n_##suffix((_Tp)0)); } \ +inline v_##_Tpv v_setall_##suffix(_Tp v) { return v_##_Tpv(vdupq_n_##suffix(v)); } \ +inline _Tpv##_t vreinterpretq_##suffix##_##suffix(_Tpv##_t v) { return v; } \ +inline v_uint8x16 v_reinterpret_as_u8(const v_##_Tpv& v) { return v_uint8x16(vreinterpretq_u8_##suffix(v.val)); } \ +inline v_int8x16 v_reinterpret_as_s8(const v_##_Tpv& v) { return v_int8x16(vreinterpretq_s8_##suffix(v.val)); } \ +inline v_uint16x8 v_reinterpret_as_u16(const v_##_Tpv& v) { return v_uint16x8(vreinterpretq_u16_##suffix(v.val)); } \ +inline v_int16x8 v_reinterpret_as_s16(const v_##_Tpv& v) { return v_int16x8(vreinterpretq_s16_##suffix(v.val)); } \ +inline v_uint32x4 v_reinterpret_as_u32(const v_##_Tpv& v) { return v_uint32x4(vreinterpretq_u32_##suffix(v.val)); } \ +inline v_int32x4 v_reinterpret_as_s32(const v_##_Tpv& v) { return v_int32x4(vreinterpretq_s32_##suffix(v.val)); } \ +inline v_uint64x2 v_reinterpret_as_u64(const v_##_Tpv& v) { return v_uint64x2(vreinterpretq_u64_##suffix(v.val)); } \ +inline v_int64x2 v_reinterpret_as_s64(const v_##_Tpv& v) { return v_int64x2(vreinterpretq_s64_##suffix(v.val)); } \ +inline v_float32x4 v_reinterpret_as_f32(const v_##_Tpv& v) { return v_float32x4(vreinterpretq_f32_##suffix(v.val)); } + +OPENCV_HAL_IMPL_NEON_INIT(uint8x16, uchar, u8) +OPENCV_HAL_IMPL_NEON_INIT(int8x16, schar, s8) +OPENCV_HAL_IMPL_NEON_INIT(uint16x8, ushort, u16) +OPENCV_HAL_IMPL_NEON_INIT(int16x8, short, s16) +OPENCV_HAL_IMPL_NEON_INIT(uint32x4, unsigned, u32) +OPENCV_HAL_IMPL_NEON_INIT(int32x4, int, s32) +OPENCV_HAL_IMPL_NEON_INIT(uint64x2, uint64, u64) +OPENCV_HAL_IMPL_NEON_INIT(int64x2, int64, s64) +OPENCV_HAL_IMPL_NEON_INIT(float32x4, float, f32) + +#define OPENCV_HAL_IMPL_NEON_PACK(_Tpvec, _Tp, hreg, suffix, _Tpwvec, wsuffix, pack, op) \ +inline _Tpvec v_##pack(const _Tpwvec& a, const _Tpwvec& b) \ +{ \ + hreg a1 = vqmov##op##_##wsuffix(a.val), b1 = vqmov##op##_##wsuffix(b.val); \ + return _Tpvec(vcombine_##suffix(a1, b1)); \ +} \ +inline void v_##pack##_store(_Tp* ptr, const _Tpwvec& a) \ +{ \ + hreg a1 = vqmov##op##_##wsuffix(a.val); \ + vst1_##suffix(ptr, a1); \ +} \ +template inline \ +_Tpvec v_rshr_##pack(const _Tpwvec& a, const _Tpwvec& b) \ +{ \ + hreg a1 = vqrshr##op##_n_##wsuffix(a.val, n); \ + hreg b1 = vqrshr##op##_n_##wsuffix(b.val, n); \ + return _Tpvec(vcombine_##suffix(a1, b1)); \ +} \ +template inline \ +void v_rshr_##pack##_store(_Tp* ptr, const _Tpwvec& a) \ +{ \ + hreg a1 = vqrshr##op##_n_##wsuffix(a.val, n); \ + vst1_##suffix(ptr, a1); \ +} + +OPENCV_HAL_IMPL_NEON_PACK(v_uint8x16, uchar, uint8x8_t, u8, v_uint16x8, u16, pack, n) +OPENCV_HAL_IMPL_NEON_PACK(v_int8x16, schar, int8x8_t, s8, v_int16x8, s16, pack, n) +OPENCV_HAL_IMPL_NEON_PACK(v_uint16x8, ushort, uint16x4_t, u16, v_uint32x4, u32, pack, n) +OPENCV_HAL_IMPL_NEON_PACK(v_int16x8, short, int16x4_t, s16, v_int32x4, s32, pack, n) +OPENCV_HAL_IMPL_NEON_PACK(v_uint32x4, unsigned, uint32x2_t, u32, v_uint64x2, u64, pack, n) +OPENCV_HAL_IMPL_NEON_PACK(v_int32x4, int, int32x2_t, s32, v_int64x2, s64, pack, n) + +OPENCV_HAL_IMPL_NEON_PACK(v_uint8x16, uchar, uint8x8_t, u8, v_int16x8, s16, pack_u, un) +OPENCV_HAL_IMPL_NEON_PACK(v_uint16x8, ushort, uint16x4_t, u16, v_int32x4, s32, pack_u, un) + +inline v_float32x4 v_matmul(const v_float32x4& v, const v_float32x4& m0, + const v_float32x4& m1, const v_float32x4& m2, + const v_float32x4& m3) +{ + float32x2_t vl = vget_low_f32(v.val), vh = vget_high_f32(v.val); + float32x4_t res = vmulq_lane_f32(m0.val, vl, 0); + res = vmlaq_lane_f32(res, m1.val, vl, 1); + res = vmlaq_lane_f32(res, m2.val, vh, 0); + res = vmlaq_lane_f32(res, m3.val, vh, 1); + return v_float32x4(res); +} + +#define OPENCV_HAL_IMPL_NEON_BIN_OP(bin_op, _Tpvec, intrin) \ +inline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec(intrin(a.val, b.val)); \ +} \ +inline _Tpvec& operator bin_op##= (_Tpvec& a, const _Tpvec& b) \ +{ \ + a.val = intrin(a.val, b.val); \ + return a; \ +} + +OPENCV_HAL_IMPL_NEON_BIN_OP(+, v_uint8x16, vqaddq_u8) +OPENCV_HAL_IMPL_NEON_BIN_OP(-, v_uint8x16, vqsubq_u8) +OPENCV_HAL_IMPL_NEON_BIN_OP(+, v_int8x16, vqaddq_s8) +OPENCV_HAL_IMPL_NEON_BIN_OP(-, v_int8x16, vqsubq_s8) +OPENCV_HAL_IMPL_NEON_BIN_OP(+, v_uint16x8, vqaddq_u16) +OPENCV_HAL_IMPL_NEON_BIN_OP(-, v_uint16x8, vqsubq_u16) +OPENCV_HAL_IMPL_NEON_BIN_OP(*, v_uint16x8, vmulq_u16) +OPENCV_HAL_IMPL_NEON_BIN_OP(+, v_int16x8, vqaddq_s16) +OPENCV_HAL_IMPL_NEON_BIN_OP(-, v_int16x8, vqsubq_s16) +OPENCV_HAL_IMPL_NEON_BIN_OP(*, v_int16x8, vmulq_s16) +OPENCV_HAL_IMPL_NEON_BIN_OP(+, v_int32x4, vaddq_s32) +OPENCV_HAL_IMPL_NEON_BIN_OP(-, v_int32x4, vsubq_s32) +OPENCV_HAL_IMPL_NEON_BIN_OP(*, v_int32x4, vmulq_s32) +OPENCV_HAL_IMPL_NEON_BIN_OP(+, v_uint32x4, vaddq_u32) +OPENCV_HAL_IMPL_NEON_BIN_OP(-, v_uint32x4, vsubq_u32) +OPENCV_HAL_IMPL_NEON_BIN_OP(*, v_uint32x4, vmulq_u32) +OPENCV_HAL_IMPL_NEON_BIN_OP(+, v_float32x4, vaddq_f32) +OPENCV_HAL_IMPL_NEON_BIN_OP(-, v_float32x4, vsubq_f32) +OPENCV_HAL_IMPL_NEON_BIN_OP(*, v_float32x4, vmulq_f32) +OPENCV_HAL_IMPL_NEON_BIN_OP(+, v_int64x2, vaddq_s64) +OPENCV_HAL_IMPL_NEON_BIN_OP(-, v_int64x2, vsubq_s64) +OPENCV_HAL_IMPL_NEON_BIN_OP(+, v_uint64x2, vaddq_u64) +OPENCV_HAL_IMPL_NEON_BIN_OP(-, v_uint64x2, vsubq_u64) + +inline v_float32x4 operator / (const v_float32x4& a, const v_float32x4& b) +{ + float32x4_t reciprocal = vrecpeq_f32(b.val); + reciprocal = vmulq_f32(vrecpsq_f32(b.val, reciprocal), reciprocal); + reciprocal = vmulq_f32(vrecpsq_f32(b.val, reciprocal), reciprocal); + return v_float32x4(vmulq_f32(a.val, reciprocal)); +} +inline v_float32x4& operator /= (v_float32x4& a, const v_float32x4& b) +{ + float32x4_t reciprocal = vrecpeq_f32(b.val); + reciprocal = vmulq_f32(vrecpsq_f32(b.val, reciprocal), reciprocal); + reciprocal = vmulq_f32(vrecpsq_f32(b.val, reciprocal), reciprocal); + a.val = vmulq_f32(a.val, reciprocal); + return a; +} + +inline void v_mul_expand(const v_int16x8& a, const v_int16x8& b, + v_int32x4& c, v_int32x4& d) +{ + c.val = vmull_s16(vget_low_s16(a.val), vget_low_s16(b.val)); + d.val = vmull_s16(vget_high_s16(a.val), vget_high_s16(b.val)); +} + +inline void v_mul_expand(const v_uint16x8& a, const v_uint16x8& b, + v_uint32x4& c, v_uint32x4& d) +{ + c.val = vmull_u16(vget_low_u16(a.val), vget_low_u16(b.val)); + d.val = vmull_u16(vget_high_u16(a.val), vget_high_u16(b.val)); +} + +inline void v_mul_expand(const v_uint32x4& a, const v_uint32x4& b, + v_uint64x2& c, v_uint64x2& d) +{ + c.val = vmull_u32(vget_low_u32(a.val), vget_low_u32(b.val)); + d.val = vmull_u32(vget_high_u32(a.val), vget_high_u32(b.val)); +} + +inline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b) +{ + int32x4_t c = vmull_s16(vget_low_s16(a.val), vget_low_s16(b.val)); + int32x4_t d = vmull_s16(vget_high_s16(a.val), vget_high_s16(b.val)); + int32x4x2_t cd = vuzpq_s32(c, d); + return v_int32x4(vaddq_s32(cd.val[0], cd.val[1])); +} + +#define OPENCV_HAL_IMPL_NEON_LOGIC_OP(_Tpvec, suffix) \ + OPENCV_HAL_IMPL_NEON_BIN_OP(&, _Tpvec, vandq_##suffix) \ + OPENCV_HAL_IMPL_NEON_BIN_OP(|, _Tpvec, vorrq_##suffix) \ + OPENCV_HAL_IMPL_NEON_BIN_OP(^, _Tpvec, veorq_##suffix) \ + inline _Tpvec operator ~ (const _Tpvec& a) \ + { \ + return _Tpvec(vreinterpretq_##suffix##_u8(vmvnq_u8(vreinterpretq_u8_##suffix(a.val)))); \ + } + +OPENCV_HAL_IMPL_NEON_LOGIC_OP(v_uint8x16, u8) +OPENCV_HAL_IMPL_NEON_LOGIC_OP(v_int8x16, s8) +OPENCV_HAL_IMPL_NEON_LOGIC_OP(v_uint16x8, u16) +OPENCV_HAL_IMPL_NEON_LOGIC_OP(v_int16x8, s16) +OPENCV_HAL_IMPL_NEON_LOGIC_OP(v_uint32x4, u32) +OPENCV_HAL_IMPL_NEON_LOGIC_OP(v_int32x4, s32) +OPENCV_HAL_IMPL_NEON_LOGIC_OP(v_uint64x2, u64) +OPENCV_HAL_IMPL_NEON_LOGIC_OP(v_int64x2, s64) + +#define OPENCV_HAL_IMPL_NEON_FLT_BIT_OP(bin_op, intrin) \ +inline v_float32x4 operator bin_op (const v_float32x4& a, const v_float32x4& b) \ +{ \ + return v_float32x4(vreinterpretq_f32_s32(intrin(vreinterpretq_s32_f32(a.val), vreinterpretq_s32_f32(b.val)))); \ +} \ +inline v_float32x4& operator bin_op##= (v_float32x4& a, const v_float32x4& b) \ +{ \ + a.val = vreinterpretq_f32_s32(intrin(vreinterpretq_s32_f32(a.val), vreinterpretq_s32_f32(b.val))); \ + return a; \ +} + +OPENCV_HAL_IMPL_NEON_FLT_BIT_OP(&, vandq_s32) +OPENCV_HAL_IMPL_NEON_FLT_BIT_OP(|, vorrq_s32) +OPENCV_HAL_IMPL_NEON_FLT_BIT_OP(^, veorq_s32) + +inline v_float32x4 operator ~ (const v_float32x4& a) +{ + return v_float32x4(vreinterpretq_f32_s32(vmvnq_s32(vreinterpretq_s32_f32(a.val)))); +} + +inline v_float32x4 v_sqrt(const v_float32x4& x) +{ + float32x4_t x1 = vmaxq_f32(x.val, vdupq_n_f32(FLT_MIN)); + float32x4_t e = vrsqrteq_f32(x1); + e = vmulq_f32(vrsqrtsq_f32(vmulq_f32(x1, e), e), e); + e = vmulq_f32(vrsqrtsq_f32(vmulq_f32(x1, e), e), e); + return v_float32x4(vmulq_f32(x.val, e)); +} + +inline v_float32x4 v_invsqrt(const v_float32x4& x) +{ + float32x4_t e = vrsqrteq_f32(x.val); + e = vmulq_f32(vrsqrtsq_f32(vmulq_f32(x.val, e), e), e); + e = vmulq_f32(vrsqrtsq_f32(vmulq_f32(x.val, e), e), e); + return v_float32x4(e); +} + +inline v_float32x4 v_abs(v_float32x4 x) +{ return v_float32x4(vabsq_f32(x.val)); } + +// TODO: exp, log, sin, cos + +#define OPENCV_HAL_IMPL_NEON_BIN_FUNC(_Tpvec, func, intrin) \ +inline _Tpvec func(const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec(intrin(a.val, b.val)); \ +} + +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint8x16, v_min, vminq_u8) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint8x16, v_max, vmaxq_u8) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int8x16, v_min, vminq_s8) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int8x16, v_max, vmaxq_s8) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint16x8, v_min, vminq_u16) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint16x8, v_max, vmaxq_u16) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int16x8, v_min, vminq_s16) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int16x8, v_max, vmaxq_s16) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint32x4, v_min, vminq_u32) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint32x4, v_max, vmaxq_u32) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int32x4, v_min, vminq_s32) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int32x4, v_max, vmaxq_s32) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_float32x4, v_min, vminq_f32) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_float32x4, v_max, vmaxq_f32) + + +#define OPENCV_HAL_IMPL_NEON_INT_CMP_OP(_Tpvec, cast, suffix, not_suffix) \ +inline _Tpvec operator == (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(cast(vceqq_##suffix(a.val, b.val))); } \ +inline _Tpvec operator != (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(cast(vmvnq_##not_suffix(vceqq_##suffix(a.val, b.val)))); } \ +inline _Tpvec operator < (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(cast(vcltq_##suffix(a.val, b.val))); } \ +inline _Tpvec operator > (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(cast(vcgtq_##suffix(a.val, b.val))); } \ +inline _Tpvec operator <= (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(cast(vcleq_##suffix(a.val, b.val))); } \ +inline _Tpvec operator >= (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(cast(vcgeq_##suffix(a.val, b.val))); } + +OPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_uint8x16, OPENCV_HAL_NOP, u8, u8) +OPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_int8x16, vreinterpretq_s8_u8, s8, u8) +OPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_uint16x8, OPENCV_HAL_NOP, u16, u16) +OPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_int16x8, vreinterpretq_s16_u16, s16, u16) +OPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_uint32x4, OPENCV_HAL_NOP, u32, u32) +OPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_int32x4, vreinterpretq_s32_u32, s32, u32) +OPENCV_HAL_IMPL_NEON_INT_CMP_OP(v_float32x4, vreinterpretq_f32_u32, f32, u32) + +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint8x16, v_add_wrap, vaddq_u8) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int8x16, v_add_wrap, vaddq_s8) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint16x8, v_add_wrap, vaddq_u16) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int16x8, v_add_wrap, vaddq_s16) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint8x16, v_sub_wrap, vsubq_u8) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int8x16, v_sub_wrap, vsubq_s8) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint16x8, v_sub_wrap, vsubq_u16) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_int16x8, v_sub_wrap, vsubq_s16) + +// TODO: absdiff for signed integers +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint8x16, v_absdiff, vabdq_u8) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint16x8, v_absdiff, vabdq_u16) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_uint32x4, v_absdiff, vabdq_u32) +OPENCV_HAL_IMPL_NEON_BIN_FUNC(v_float32x4, v_absdiff, vabdq_f32) + +#define OPENCV_HAL_IMPL_NEON_BIN_FUNC2(_Tpvec, _Tpvec2, cast, func, intrin) \ +inline _Tpvec2 func(const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec2(cast(intrin(a.val, b.val))); \ +} + +OPENCV_HAL_IMPL_NEON_BIN_FUNC2(v_int8x16, v_uint8x16, vreinterpretq_u8_s8, v_absdiff, vabdq_s8) +OPENCV_HAL_IMPL_NEON_BIN_FUNC2(v_int16x8, v_uint16x8, vreinterpretq_u16_s16, v_absdiff, vabdq_s16) +OPENCV_HAL_IMPL_NEON_BIN_FUNC2(v_int32x4, v_uint32x4, vreinterpretq_u32_s32, v_absdiff, vabdq_s32) + +inline v_float32x4 v_magnitude(const v_float32x4& a, const v_float32x4& b) +{ + v_float32x4 x(vmlaq_f32(vmulq_f32(a.val, a.val), b.val, b.val)); + return v_sqrt(x); +} + +inline v_float32x4 v_sqr_magnitude(const v_float32x4& a, const v_float32x4& b) +{ + return v_float32x4(vmlaq_f32(vmulq_f32(a.val, a.val), b.val, b.val)); +} + +inline v_float32x4 v_muladd(const v_float32x4& a, const v_float32x4& b, const v_float32x4& c) +{ + return v_float32x4(vmlaq_f32(c.val, a.val, b.val)); +} + +// trade efficiency for convenience +#define OPENCV_HAL_IMPL_NEON_SHIFT_OP(_Tpvec, suffix, _Tps, ssuffix) \ +inline _Tpvec operator << (const _Tpvec& a, int n) \ +{ return _Tpvec(vshlq_##suffix(a.val, vdupq_n_##ssuffix((_Tps)n))); } \ +inline _Tpvec operator >> (const _Tpvec& a, int n) \ +{ return _Tpvec(vshlq_##suffix(a.val, vdupq_n_##ssuffix((_Tps)-n))); } \ +template inline _Tpvec v_shl(const _Tpvec& a) \ +{ return _Tpvec(vshlq_n_##suffix(a.val, n)); } \ +template inline _Tpvec v_shr(const _Tpvec& a) \ +{ return _Tpvec(vshrq_n_##suffix(a.val, n)); } \ +template inline _Tpvec v_rshr(const _Tpvec& a) \ +{ return _Tpvec(vrshrq_n_##suffix(a.val, n)); } + +OPENCV_HAL_IMPL_NEON_SHIFT_OP(v_uint8x16, u8, schar, s8) +OPENCV_HAL_IMPL_NEON_SHIFT_OP(v_int8x16, s8, schar, s8) +OPENCV_HAL_IMPL_NEON_SHIFT_OP(v_uint16x8, u16, short, s16) +OPENCV_HAL_IMPL_NEON_SHIFT_OP(v_int16x8, s16, short, s16) +OPENCV_HAL_IMPL_NEON_SHIFT_OP(v_uint32x4, u32, int, s32) +OPENCV_HAL_IMPL_NEON_SHIFT_OP(v_int32x4, s32, int, s32) +OPENCV_HAL_IMPL_NEON_SHIFT_OP(v_uint64x2, u64, int64, s64) +OPENCV_HAL_IMPL_NEON_SHIFT_OP(v_int64x2, s64, int64, s64) + +#define OPENCV_HAL_IMPL_NEON_LOADSTORE_OP(_Tpvec, _Tp, suffix) \ +inline _Tpvec v_load(const _Tp* ptr) \ +{ return _Tpvec(vld1q_##suffix(ptr)); } \ +inline _Tpvec v_load_aligned(const _Tp* ptr) \ +{ return _Tpvec(vld1q_##suffix(ptr)); } \ +inline _Tpvec v_load_halves(const _Tp* ptr0, const _Tp* ptr1) \ +{ return _Tpvec(vcombine_##suffix(vld1_##suffix(ptr0), vld1_##suffix(ptr1))); } \ +inline void v_store(_Tp* ptr, const _Tpvec& a) \ +{ vst1q_##suffix(ptr, a.val); } \ +inline void v_store_aligned(_Tp* ptr, const _Tpvec& a) \ +{ vst1q_##suffix(ptr, a.val); } \ +inline void v_store_low(_Tp* ptr, const _Tpvec& a) \ +{ vst1_##suffix(ptr, vget_low_##suffix(a.val)); } \ +inline void v_store_high(_Tp* ptr, const _Tpvec& a) \ +{ vst1_##suffix(ptr, vget_high_##suffix(a.val)); } + +OPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_uint8x16, uchar, u8) +OPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_int8x16, schar, s8) +OPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_uint16x8, ushort, u16) +OPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_int16x8, short, s16) +OPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_uint32x4, unsigned, u32) +OPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_int32x4, int, s32) +OPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_uint64x2, uint64, u64) +OPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_int64x2, int64, s64) +OPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_float32x4, float, f32) + +#define OPENCV_HAL_IMPL_NEON_REDUCE_OP_4(_Tpvec, scalartype, func, scalar_func) \ +inline scalartype v_reduce_##func(const _Tpvec& a) \ +{ \ + scalartype CV_DECL_ALIGNED(16) buf[4]; \ + v_store_aligned(buf, a); \ + scalartype s0 = scalar_func(buf[0], buf[1]); \ + scalartype s1 = scalar_func(buf[2], buf[3]); \ + return scalar_func(s0, s1); \ +} + +OPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_uint32x4, unsigned, sum, OPENCV_HAL_ADD) +OPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_uint32x4, unsigned, max, std::max) +OPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_uint32x4, unsigned, min, std::min) +OPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_int32x4, int, sum, OPENCV_HAL_ADD) +OPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_int32x4, int, max, std::max) +OPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_int32x4, int, min, std::min) +OPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_float32x4, float, sum, OPENCV_HAL_ADD) +OPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_float32x4, float, max, std::max) +OPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_float32x4, float, min, std::min) + +inline int v_signmask(const v_uint8x16& a) +{ + int8x8_t m0 = vcreate_s8(CV_BIG_UINT(0x0706050403020100)); + uint8x16_t v0 = vshlq_u8(vshrq_n_u8(a.val, 7), vcombine_s8(m0, m0)); + uint64x2_t v1 = vpaddlq_u32(vpaddlq_u16(vpaddlq_u8(v0))); + return (int)vgetq_lane_u64(v1, 0) + ((int)vgetq_lane_u64(v1, 1) << 8); +} +inline int v_signmask(const v_int8x16& a) +{ return v_signmask(v_reinterpret_as_u8(a)); } + +inline int v_signmask(const v_uint16x8& a) +{ + int16x4_t m0 = vcreate_s16(CV_BIG_UINT(0x0003000200010000)); + uint16x8_t v0 = vshlq_u16(vshrq_n_u16(a.val, 15), vcombine_s16(m0, m0)); + uint64x2_t v1 = vpaddlq_u32(vpaddlq_u16(v0)); + return (int)vgetq_lane_u64(v1, 0) + ((int)vgetq_lane_u64(v1, 1) << 4); +} +inline int v_signmask(const v_int16x8& a) +{ return v_signmask(v_reinterpret_as_u16(a)); } + +inline int v_signmask(const v_uint32x4& a) +{ + int32x2_t m0 = vcreate_s32(CV_BIG_UINT(0x0000000100000000)); + uint32x4_t v0 = vshlq_u32(vshrq_n_u32(a.val, 31), vcombine_s32(m0, m0)); + uint64x2_t v1 = vpaddlq_u32(v0); + return (int)vgetq_lane_u64(v1, 0) + ((int)vgetq_lane_u64(v1, 1) << 2); +} +inline int v_signmask(const v_int32x4& a) +{ return v_signmask(v_reinterpret_as_u32(a)); } +inline int v_signmask(const v_float32x4& a) +{ return v_signmask(v_reinterpret_as_u32(a)); } + +#define OPENCV_HAL_IMPL_NEON_CHECK_ALLANY(_Tpvec, suffix, shift) \ +inline bool v_check_all(const v_##_Tpvec& a) \ +{ \ + _Tpvec##_t v0 = vshrq_n_##suffix(vmvnq_##suffix(a.val), shift); \ + uint64x2_t v1 = vreinterpretq_u64_##suffix(v0); \ + return (vgetq_lane_u64(v1, 0) | vgetq_lane_u64(v1, 1)) == 0; \ +} \ +inline bool v_check_any(const v_##_Tpvec& a) \ +{ \ + _Tpvec##_t v0 = vshrq_n_##suffix(a.val, shift); \ + uint64x2_t v1 = vreinterpretq_u64_##suffix(v0); \ + return (vgetq_lane_u64(v1, 0) | vgetq_lane_u64(v1, 1)) != 0; \ +} + +OPENCV_HAL_IMPL_NEON_CHECK_ALLANY(uint8x16, u8, 7) +OPENCV_HAL_IMPL_NEON_CHECK_ALLANY(uint16x8, u16, 15) +OPENCV_HAL_IMPL_NEON_CHECK_ALLANY(uint32x4, u32, 31) + +inline bool v_check_all(const v_int8x16& a) +{ return v_check_all(v_reinterpret_as_u8(a)); } +inline bool v_check_all(const v_int16x8& a) +{ return v_check_all(v_reinterpret_as_u16(a)); } +inline bool v_check_all(const v_int32x4& a) +{ return v_check_all(v_reinterpret_as_u32(a)); } +inline bool v_check_all(const v_float32x4& a) +{ return v_check_all(v_reinterpret_as_u32(a)); } + +inline bool v_check_any(const v_int8x16& a) +{ return v_check_any(v_reinterpret_as_u8(a)); } +inline bool v_check_any(const v_int16x8& a) +{ return v_check_any(v_reinterpret_as_u16(a)); } +inline bool v_check_any(const v_int32x4& a) +{ return v_check_any(v_reinterpret_as_u32(a)); } +inline bool v_check_any(const v_float32x4& a) +{ return v_check_any(v_reinterpret_as_u32(a)); } + +#define OPENCV_HAL_IMPL_NEON_SELECT(_Tpvec, suffix, usuffix) \ +inline _Tpvec v_select(const _Tpvec& mask, const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec(vbslq_##suffix(vreinterpretq_##usuffix##_##suffix(mask.val), a.val, b.val)); \ +} + +OPENCV_HAL_IMPL_NEON_SELECT(v_uint8x16, u8, u8) +OPENCV_HAL_IMPL_NEON_SELECT(v_int8x16, s8, u8) +OPENCV_HAL_IMPL_NEON_SELECT(v_uint16x8, u16, u16) +OPENCV_HAL_IMPL_NEON_SELECT(v_int16x8, s16, u16) +OPENCV_HAL_IMPL_NEON_SELECT(v_uint32x4, u32, u32) +OPENCV_HAL_IMPL_NEON_SELECT(v_int32x4, s32, u32) +OPENCV_HAL_IMPL_NEON_SELECT(v_float32x4, f32, u32) + +#define OPENCV_HAL_IMPL_NEON_EXPAND(_Tpvec, _Tpwvec, _Tp, suffix) \ +inline void v_expand(const _Tpvec& a, _Tpwvec& b0, _Tpwvec& b1) \ +{ \ + b0.val = vmovl_##suffix(vget_low_##suffix(a.val)); \ + b1.val = vmovl_##suffix(vget_high_##suffix(a.val)); \ +} \ +inline _Tpwvec v_load_expand(const _Tp* ptr) \ +{ \ + return _Tpwvec(vmovl_##suffix(vld1_##suffix(ptr))); \ +} + +OPENCV_HAL_IMPL_NEON_EXPAND(v_uint8x16, v_uint16x8, uchar, u8) +OPENCV_HAL_IMPL_NEON_EXPAND(v_int8x16, v_int16x8, schar, s8) +OPENCV_HAL_IMPL_NEON_EXPAND(v_uint16x8, v_uint32x4, ushort, u16) +OPENCV_HAL_IMPL_NEON_EXPAND(v_int16x8, v_int32x4, short, s16) +OPENCV_HAL_IMPL_NEON_EXPAND(v_uint32x4, v_uint64x2, uint, u32) +OPENCV_HAL_IMPL_NEON_EXPAND(v_int32x4, v_int64x2, int, s32) + +inline v_uint32x4 v_load_expand_q(const uchar* ptr) +{ + uint8x8_t v0 = vcreate_u8(*(unsigned*)ptr); + uint16x4_t v1 = vget_low_u16(vmovl_u8(v0)); + return v_uint32x4(vmovl_u16(v1)); +} + +inline v_int32x4 v_load_expand_q(const schar* ptr) +{ + int8x8_t v0 = vcreate_s8(*(unsigned*)ptr); + int16x4_t v1 = vget_low_s16(vmovl_s8(v0)); + return v_int32x4(vmovl_s16(v1)); +} + +#define OPENCV_HAL_IMPL_NEON_UNPACKS(_Tpvec, suffix) \ +inline void v_zip(const v_##_Tpvec& a0, const v_##_Tpvec& a1, v_##_Tpvec& b0, v_##_Tpvec& b1) \ +{ \ + _Tpvec##x2_t p = vzipq_##suffix(a0.val, a1.val); \ + b0.val = p.val[0]; \ + b1.val = p.val[1]; \ +} \ +inline v_##_Tpvec v_combine_low(const v_##_Tpvec& a, const v_##_Tpvec& b) \ +{ \ + return v_##_Tpvec(vcombine_##suffix(vget_low_##suffix(a.val), vget_low_##suffix(b.val))); \ +} \ +inline v_##_Tpvec v_combine_high(const v_##_Tpvec& a, const v_##_Tpvec& b) \ +{ \ + return v_##_Tpvec(vcombine_##suffix(vget_high_##suffix(a.val), vget_high_##suffix(b.val))); \ +} \ +inline void v_recombine(const v_##_Tpvec& a, const v_##_Tpvec& b, v_##_Tpvec& c, v_##_Tpvec& d) \ +{ \ + c.val = vcombine_##suffix(vget_low_##suffix(a.val), vget_low_##suffix(b.val)); \ + d.val = vcombine_##suffix(vget_high_##suffix(a.val), vget_high_##suffix(b.val)); \ +} + +OPENCV_HAL_IMPL_NEON_UNPACKS(uint8x16, u8) +OPENCV_HAL_IMPL_NEON_UNPACKS(int8x16, s8) +OPENCV_HAL_IMPL_NEON_UNPACKS(uint16x8, u16) +OPENCV_HAL_IMPL_NEON_UNPACKS(int16x8, s16) +OPENCV_HAL_IMPL_NEON_UNPACKS(uint32x4, u32) +OPENCV_HAL_IMPL_NEON_UNPACKS(int32x4, s32) +OPENCV_HAL_IMPL_NEON_UNPACKS(float32x4, f32) + +#define OPENCV_HAL_IMPL_NEON_EXTRACT(_Tpvec, suffix) \ +template \ +inline v_##_Tpvec v_extract(const v_##_Tpvec& a, const v_##_Tpvec& b) \ +{ \ + return v_##_Tpvec(vextq_##suffix(a.val, b.val, s)); \ +} + +OPENCV_HAL_IMPL_NEON_EXTRACT(uint8x16, u8) +OPENCV_HAL_IMPL_NEON_EXTRACT(int8x16, s8) +OPENCV_HAL_IMPL_NEON_EXTRACT(uint16x8, u16) +OPENCV_HAL_IMPL_NEON_EXTRACT(int16x8, s16) +OPENCV_HAL_IMPL_NEON_EXTRACT(uint32x4, u32) +OPENCV_HAL_IMPL_NEON_EXTRACT(int32x4, s32) +OPENCV_HAL_IMPL_NEON_EXTRACT(uint64x2, u64) +OPENCV_HAL_IMPL_NEON_EXTRACT(int64x2, s64) +OPENCV_HAL_IMPL_NEON_EXTRACT(float32x4, f32) + +inline v_int32x4 v_round(const v_float32x4& a) +{ + static const int32x4_t v_sign = vdupq_n_s32(1 << 31), + v_05 = vreinterpretq_s32_f32(vdupq_n_f32(0.5f)); + + int32x4_t v_addition = vorrq_s32(v_05, vandq_s32(v_sign, vreinterpretq_s32_f32(a.val))); + return v_int32x4(vcvtq_s32_f32(vaddq_f32(a.val, vreinterpretq_f32_s32(v_addition)))); +} + +inline v_int32x4 v_floor(const v_float32x4& a) +{ + int32x4_t a1 = vcvtq_s32_f32(a.val); + uint32x4_t mask = vcgtq_f32(vcvtq_f32_s32(a1), a.val); + return v_int32x4(vaddq_s32(a1, vreinterpretq_s32_u32(mask))); +} + +inline v_int32x4 v_ceil(const v_float32x4& a) +{ + int32x4_t a1 = vcvtq_s32_f32(a.val); + uint32x4_t mask = vcgtq_f32(a.val, vcvtq_f32_s32(a1)); + return v_int32x4(vsubq_s32(a1, vreinterpretq_s32_u32(mask))); +} + +inline v_int32x4 v_trunc(const v_float32x4& a) +{ return v_int32x4(vcvtq_s32_f32(a.val)); } + +#define OPENCV_HAL_IMPL_NEON_TRANSPOSE4x4(_Tpvec, suffix) \ +inline void v_transpose4x4(const v_##_Tpvec& a0, const v_##_Tpvec& a1, \ + const v_##_Tpvec& a2, const v_##_Tpvec& a3, \ + v_##_Tpvec& b0, v_##_Tpvec& b1, \ + v_##_Tpvec& b2, v_##_Tpvec& b3) \ +{ \ + /* m00 m01 m02 m03 */ \ + /* m10 m11 m12 m13 */ \ + /* m20 m21 m22 m23 */ \ + /* m30 m31 m32 m33 */ \ + _Tpvec##x2_t t0 = vtrnq_##suffix(a0.val, a1.val); \ + _Tpvec##x2_t t1 = vtrnq_##suffix(a2.val, a3.val); \ + /* m00 m10 m02 m12 */ \ + /* m01 m11 m03 m13 */ \ + /* m20 m30 m22 m32 */ \ + /* m21 m31 m23 m33 */ \ + b0.val = vcombine_##suffix(vget_low_##suffix(t0.val[0]), vget_low_##suffix(t1.val[0])); \ + b1.val = vcombine_##suffix(vget_low_##suffix(t0.val[1]), vget_low_##suffix(t1.val[1])); \ + b2.val = vcombine_##suffix(vget_high_##suffix(t0.val[0]), vget_high_##suffix(t1.val[0])); \ + b3.val = vcombine_##suffix(vget_high_##suffix(t0.val[1]), vget_high_##suffix(t1.val[1])); \ +} + +OPENCV_HAL_IMPL_NEON_TRANSPOSE4x4(uint32x4, u32) +OPENCV_HAL_IMPL_NEON_TRANSPOSE4x4(int32x4, s32) +OPENCV_HAL_IMPL_NEON_TRANSPOSE4x4(float32x4, f32) + +#define OPENCV_HAL_IMPL_NEON_INTERLEAVED(_Tpvec, _Tp, suffix) \ +inline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec& a, v_##_Tpvec& b, v_##_Tpvec& c) \ +{ \ + _Tpvec##x3_t v = vld3q_##suffix(ptr); \ + a.val = v.val[0]; \ + b.val = v.val[1]; \ + c.val = v.val[2]; \ +} \ +inline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec& a, v_##_Tpvec& b, \ + v_##_Tpvec& c, v_##_Tpvec& d) \ +{ \ + _Tpvec##x4_t v = vld4q_##suffix(ptr); \ + a.val = v.val[0]; \ + b.val = v.val[1]; \ + c.val = v.val[2]; \ + d.val = v.val[3]; \ +} \ +inline void v_store_interleave( _Tp* ptr, const v_##_Tpvec& a, const v_##_Tpvec& b, const v_##_Tpvec& c) \ +{ \ + _Tpvec##x3_t v; \ + v.val[0] = a.val; \ + v.val[1] = b.val; \ + v.val[2] = c.val; \ + vst3q_##suffix(ptr, v); \ +} \ +inline void v_store_interleave( _Tp* ptr, const v_##_Tpvec& a, const v_##_Tpvec& b, \ + const v_##_Tpvec& c, const v_##_Tpvec& d) \ +{ \ + _Tpvec##x4_t v; \ + v.val[0] = a.val; \ + v.val[1] = b.val; \ + v.val[2] = c.val; \ + v.val[3] = d.val; \ + vst4q_##suffix(ptr, v); \ +} + +OPENCV_HAL_IMPL_NEON_INTERLEAVED(uint8x16, uchar, u8) +OPENCV_HAL_IMPL_NEON_INTERLEAVED(int8x16, schar, s8) +OPENCV_HAL_IMPL_NEON_INTERLEAVED(uint16x8, ushort, u16) +OPENCV_HAL_IMPL_NEON_INTERLEAVED(int16x8, short, s16) +OPENCV_HAL_IMPL_NEON_INTERLEAVED(uint32x4, unsigned, u32) +OPENCV_HAL_IMPL_NEON_INTERLEAVED(int32x4, int, s32) +OPENCV_HAL_IMPL_NEON_INTERLEAVED(float32x4, float, f32) + +inline v_float32x4 v_cvt_f32(const v_int32x4& a) +{ + return v_float32x4(vcvtq_f32_s32(a.val)); +} + +//! @endcond + +} + +#endif diff --git a/lib/opencv/include/opencv2/core/hal/intrin_sse.hpp b/lib/opencv/include/opencv2/core/hal/intrin_sse.hpp new file mode 100644 index 000000000..1840e0305 --- /dev/null +++ b/lib/opencv/include/opencv2/core/hal/intrin_sse.hpp @@ -0,0 +1,1599 @@ +/*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. +// 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_HAL_SSE_HPP__ +#define __OPENCV_HAL_SSE_HPP__ + +#include + +#define CV_SIMD128 1 +#define CV_SIMD128_64F 1 + +namespace cv +{ + +//! @cond IGNORED + +struct v_uint8x16 +{ + typedef uchar lane_type; + enum { nlanes = 16 }; + + v_uint8x16() {} + explicit v_uint8x16(__m128i v) : val(v) {} + v_uint8x16(uchar v0, uchar v1, uchar v2, uchar v3, uchar v4, uchar v5, uchar v6, uchar v7, + uchar v8, uchar v9, uchar v10, uchar v11, uchar v12, uchar v13, uchar v14, uchar v15) + { + val = _mm_setr_epi8((char)v0, (char)v1, (char)v2, (char)v3, + (char)v4, (char)v5, (char)v6, (char)v7, + (char)v8, (char)v9, (char)v10, (char)v11, + (char)v12, (char)v13, (char)v14, (char)v15); + } + uchar get0() const + { + return (uchar)_mm_cvtsi128_si32(val); + } + + __m128i val; +}; + +struct v_int8x16 +{ + typedef schar lane_type; + enum { nlanes = 16 }; + + v_int8x16() {} + explicit v_int8x16(__m128i v) : val(v) {} + v_int8x16(schar v0, schar v1, schar v2, schar v3, schar v4, schar v5, schar v6, schar v7, + schar v8, schar v9, schar v10, schar v11, schar v12, schar v13, schar v14, schar v15) + { + val = _mm_setr_epi8((char)v0, (char)v1, (char)v2, (char)v3, + (char)v4, (char)v5, (char)v6, (char)v7, + (char)v8, (char)v9, (char)v10, (char)v11, + (char)v12, (char)v13, (char)v14, (char)v15); + } + schar get0() const + { + return (schar)_mm_cvtsi128_si32(val); + } + + __m128i val; +}; + +struct v_uint16x8 +{ + typedef ushort lane_type; + enum { nlanes = 8 }; + + v_uint16x8() {} + explicit v_uint16x8(__m128i v) : val(v) {} + v_uint16x8(ushort v0, ushort v1, ushort v2, ushort v3, ushort v4, ushort v5, ushort v6, ushort v7) + { + val = _mm_setr_epi16((short)v0, (short)v1, (short)v2, (short)v3, + (short)v4, (short)v5, (short)v6, (short)v7); + } + ushort get0() const + { + return (ushort)_mm_cvtsi128_si32(val); + } + + __m128i val; +}; + +struct v_int16x8 +{ + typedef short lane_type; + enum { nlanes = 8 }; + + v_int16x8() {} + explicit v_int16x8(__m128i v) : val(v) {} + v_int16x8(short v0, short v1, short v2, short v3, short v4, short v5, short v6, short v7) + { + val = _mm_setr_epi16((short)v0, (short)v1, (short)v2, (short)v3, + (short)v4, (short)v5, (short)v6, (short)v7); + } + short get0() const + { + return (short)_mm_cvtsi128_si32(val); + } + __m128i val; +}; + +struct v_uint32x4 +{ + typedef unsigned lane_type; + enum { nlanes = 4 }; + + v_uint32x4() {} + explicit v_uint32x4(__m128i v) : val(v) {} + v_uint32x4(unsigned v0, unsigned v1, unsigned v2, unsigned v3) + { + val = _mm_setr_epi32((int)v0, (int)v1, (int)v2, (int)v3); + } + unsigned get0() const + { + return (unsigned)_mm_cvtsi128_si32(val); + } + __m128i val; +}; + +struct v_int32x4 +{ + typedef int lane_type; + enum { nlanes = 4 }; + + v_int32x4() {} + explicit v_int32x4(__m128i v) : val(v) {} + v_int32x4(int v0, int v1, int v2, int v3) + { + val = _mm_setr_epi32(v0, v1, v2, v3); + } + int get0() const + { + return _mm_cvtsi128_si32(val); + } + __m128i val; +}; + +struct v_float32x4 +{ + typedef float lane_type; + enum { nlanes = 4 }; + + v_float32x4() {} + explicit v_float32x4(__m128 v) : val(v) {} + v_float32x4(float v0, float v1, float v2, float v3) + { + val = _mm_setr_ps(v0, v1, v2, v3); + } + float get0() const + { + return _mm_cvtss_f32(val); + } + __m128 val; +}; + +struct v_uint64x2 +{ + typedef uint64 lane_type; + enum { nlanes = 2 }; + + v_uint64x2() {} + explicit v_uint64x2(__m128i v) : val(v) {} + v_uint64x2(uint64 v0, uint64 v1) + { + val = _mm_setr_epi32((int)v0, (int)(v0 >> 32), (int)v1, (int)(v1 >> 32)); + } + uint64 get0() const + { + int a = _mm_cvtsi128_si32(val); + int b = _mm_cvtsi128_si32(_mm_srli_epi64(val, 32)); + return (unsigned)a | ((uint64)(unsigned)b << 32); + } + __m128i val; +}; + +struct v_int64x2 +{ + typedef int64 lane_type; + enum { nlanes = 2 }; + + v_int64x2() {} + explicit v_int64x2(__m128i v) : val(v) {} + v_int64x2(int64 v0, int64 v1) + { + val = _mm_setr_epi32((int)v0, (int)(v0 >> 32), (int)v1, (int)(v1 >> 32)); + } + int64 get0() const + { + int a = _mm_cvtsi128_si32(val); + int b = _mm_cvtsi128_si32(_mm_srli_epi64(val, 32)); + return (int64)((unsigned)a | ((uint64)(unsigned)b << 32)); + } + __m128i val; +}; + +struct v_float64x2 +{ + typedef double lane_type; + enum { nlanes = 2 }; + + v_float64x2() {} + explicit v_float64x2(__m128d v) : val(v) {} + v_float64x2(double v0, double v1) + { + val = _mm_setr_pd(v0, v1); + } + double get0() const + { + return _mm_cvtsd_f64(val); + } + __m128d val; +}; + +#define OPENCV_HAL_IMPL_SSE_INITVEC(_Tpvec, _Tp, suffix, zsuffix, ssuffix, _Tps, cast) \ +inline _Tpvec v_setzero_##suffix() { return _Tpvec(_mm_setzero_##zsuffix()); } \ +inline _Tpvec v_setall_##suffix(_Tp v) { return _Tpvec(_mm_set1_##ssuffix((_Tps)v)); } \ +template inline _Tpvec v_reinterpret_as_##suffix(const _Tpvec0& a) \ +{ return _Tpvec(cast(a.val)); } + +OPENCV_HAL_IMPL_SSE_INITVEC(v_uint8x16, uchar, u8, si128, epi8, char, OPENCV_HAL_NOP) +OPENCV_HAL_IMPL_SSE_INITVEC(v_int8x16, schar, s8, si128, epi8, char, OPENCV_HAL_NOP) +OPENCV_HAL_IMPL_SSE_INITVEC(v_uint16x8, ushort, u16, si128, epi16, short, OPENCV_HAL_NOP) +OPENCV_HAL_IMPL_SSE_INITVEC(v_int16x8, short, s16, si128, epi16, short, OPENCV_HAL_NOP) +OPENCV_HAL_IMPL_SSE_INITVEC(v_uint32x4, unsigned, u32, si128, epi32, int, OPENCV_HAL_NOP) +OPENCV_HAL_IMPL_SSE_INITVEC(v_int32x4, int, s32, si128, epi32, int, OPENCV_HAL_NOP) +OPENCV_HAL_IMPL_SSE_INITVEC(v_float32x4, float, f32, ps, ps, float, _mm_castsi128_ps) +OPENCV_HAL_IMPL_SSE_INITVEC(v_float64x2, double, f64, pd, pd, double, _mm_castsi128_pd) + +inline v_uint64x2 v_setzero_u64() { return v_uint64x2(_mm_setzero_si128()); } +inline v_int64x2 v_setzero_s64() { return v_int64x2(_mm_setzero_si128()); } +inline v_uint64x2 v_setall_u64(uint64 val) { return v_uint64x2(val, val); } +inline v_int64x2 v_setall_s64(int64 val) { return v_int64x2(val, val); } + +template inline +v_uint64x2 v_reinterpret_as_u64(const _Tpvec& a) { return v_uint64x2(a.val); } +template inline +v_int64x2 v_reinterpret_as_s64(const _Tpvec& a) { return v_int64x2(a.val); } +inline v_float32x4 v_reinterpret_as_f32(const v_uint64x2& a) +{ return v_float32x4(_mm_castsi128_ps(a.val)); } +inline v_float32x4 v_reinterpret_as_f32(const v_int64x2& a) +{ return v_float32x4(_mm_castsi128_ps(a.val)); } +inline v_float64x2 v_reinterpret_as_f64(const v_uint64x2& a) +{ return v_float64x2(_mm_castsi128_pd(a.val)); } +inline v_float64x2 v_reinterpret_as_f64(const v_int64x2& a) +{ return v_float64x2(_mm_castsi128_pd(a.val)); } + +#define OPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(_Tpvec, suffix) \ +inline _Tpvec v_reinterpret_as_##suffix(const v_float32x4& a) \ +{ return _Tpvec(_mm_castps_si128(a.val)); } \ +inline _Tpvec v_reinterpret_as_##suffix(const v_float64x2& a) \ +{ return _Tpvec(_mm_castpd_si128(a.val)); } + +OPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_uint8x16, u8) +OPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_int8x16, s8) +OPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_uint16x8, u16) +OPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_int16x8, s16) +OPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_uint32x4, u32) +OPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_int32x4, s32) +OPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_uint64x2, u64) +OPENCV_HAL_IMPL_SSE_INIT_FROM_FLT(v_int64x2, s64) + +inline v_float32x4 v_reinterpret_as_f32(const v_float32x4& a) {return a; } +inline v_float64x2 v_reinterpret_as_f64(const v_float64x2& a) {return a; } +inline v_float32x4 v_reinterpret_as_f32(const v_float64x2& a) {return v_float32x4(_mm_castpd_ps(a.val)); } +inline v_float64x2 v_reinterpret_as_f64(const v_float32x4& a) {return v_float64x2(_mm_castps_pd(a.val)); } + +//////////////// PACK /////////////// +inline v_uint8x16 v_pack(const v_uint16x8& a, const v_uint16x8& b) +{ + __m128i delta = _mm_set1_epi16(255); + return v_uint8x16(_mm_packus_epi16(_mm_subs_epu16(a.val, _mm_subs_epu16(a.val, delta)), + _mm_subs_epu16(b.val, _mm_subs_epu16(b.val, delta)))); +} + +inline void v_pack_store(uchar* ptr, const v_uint16x8& a) +{ + __m128i delta = _mm_set1_epi16(255); + __m128i a1 = _mm_subs_epu16(a.val, _mm_subs_epu16(a.val, delta)); + _mm_storel_epi64((__m128i*)ptr, _mm_packus_epi16(a1, a1)); +} + +inline v_uint8x16 v_pack_u(const v_int16x8& a, const v_int16x8& b) +{ return v_uint8x16(_mm_packus_epi16(a.val, b.val)); } + +inline void v_pack_u_store(uchar* ptr, const v_int16x8& a) +{ _mm_storel_epi64((__m128i*)ptr, _mm_packus_epi16(a.val, a.val)); } + +template inline +v_uint8x16 v_rshr_pack(const v_uint16x8& a, const v_uint16x8& b) +{ + // we assume that n > 0, and so the shifted 16-bit values can be treated as signed numbers. + __m128i delta = _mm_set1_epi16((short)(1 << (n-1))); + return v_uint8x16(_mm_packus_epi16(_mm_srli_epi16(_mm_adds_epu16(a.val, delta), n), + _mm_srli_epi16(_mm_adds_epu16(b.val, delta), n))); +} + +template inline +void v_rshr_pack_store(uchar* ptr, const v_uint16x8& a) +{ + __m128i delta = _mm_set1_epi16((short)(1 << (n-1))); + __m128i a1 = _mm_srli_epi16(_mm_adds_epu16(a.val, delta), n); + _mm_storel_epi64((__m128i*)ptr, _mm_packus_epi16(a1, a1)); +} + +template inline +v_uint8x16 v_rshr_pack_u(const v_int16x8& a, const v_int16x8& b) +{ + __m128i delta = _mm_set1_epi16((short)(1 << (n-1))); + return v_uint8x16(_mm_packus_epi16(_mm_srai_epi16(_mm_adds_epi16(a.val, delta), n), + _mm_srai_epi16(_mm_adds_epi16(b.val, delta), n))); +} + +template inline +void v_rshr_pack_u_store(uchar* ptr, const v_int16x8& a) +{ + __m128i delta = _mm_set1_epi16((short)(1 << (n-1))); + __m128i a1 = _mm_srai_epi16(_mm_adds_epi16(a.val, delta), n); + _mm_storel_epi64((__m128i*)ptr, _mm_packus_epi16(a1, a1)); +} + +inline v_int8x16 v_pack(const v_int16x8& a, const v_int16x8& b) +{ return v_int8x16(_mm_packs_epi16(a.val, b.val)); } + +inline void v_pack_store(schar* ptr, v_int16x8& a) +{ _mm_storel_epi64((__m128i*)ptr, _mm_packs_epi16(a.val, a.val)); } + +template inline +v_int8x16 v_rshr_pack(const v_int16x8& a, const v_int16x8& b) +{ + // we assume that n > 0, and so the shifted 16-bit values can be treated as signed numbers. + __m128i delta = _mm_set1_epi16((short)(1 << (n-1))); + return v_int8x16(_mm_packs_epi16(_mm_srai_epi16(_mm_adds_epi16(a.val, delta), n), + _mm_srai_epi16(_mm_adds_epi16(b.val, delta), n))); +} +template inline +void v_rshr_pack_store(schar* ptr, const v_int16x8& a) +{ + // we assume that n > 0, and so the shifted 16-bit values can be treated as signed numbers. + __m128i delta = _mm_set1_epi16((short)(1 << (n-1))); + __m128i a1 = _mm_srai_epi16(_mm_adds_epi16(a.val, delta), n); + _mm_storel_epi64((__m128i*)ptr, _mm_packs_epi16(a1, a1)); +} + + +// bit-wise "mask ? a : b" +inline __m128i v_select_si128(__m128i mask, __m128i a, __m128i b) +{ + return _mm_xor_si128(b, _mm_and_si128(_mm_xor_si128(a, b), mask)); +} + +inline v_uint16x8 v_pack(const v_uint32x4& a, const v_uint32x4& b) +{ + __m128i z = _mm_setzero_si128(), maxval32 = _mm_set1_epi32(65535), delta32 = _mm_set1_epi32(32768); + __m128i a1 = _mm_sub_epi32(v_select_si128(_mm_cmpgt_epi32(z, a.val), maxval32, a.val), delta32); + __m128i b1 = _mm_sub_epi32(v_select_si128(_mm_cmpgt_epi32(z, b.val), maxval32, b.val), delta32); + __m128i r = _mm_packs_epi32(a1, b1); + return v_uint16x8(_mm_sub_epi16(r, _mm_set1_epi16(-32768))); +} + +inline void v_pack_store(ushort* ptr, const v_uint32x4& a) +{ + __m128i z = _mm_setzero_si128(), maxval32 = _mm_set1_epi32(65535), delta32 = _mm_set1_epi32(32768); + __m128i a1 = _mm_sub_epi32(v_select_si128(_mm_cmpgt_epi32(z, a.val), maxval32, a.val), delta32); + __m128i r = _mm_packs_epi32(a1, a1); + _mm_storel_epi64((__m128i*)ptr, _mm_sub_epi16(r, _mm_set1_epi16(-32768))); +} + +template inline +v_uint16x8 v_rshr_pack(const v_uint32x4& a, const v_uint32x4& b) +{ + __m128i delta = _mm_set1_epi32(1 << (n-1)), delta32 = _mm_set1_epi32(32768); + __m128i a1 = _mm_sub_epi32(_mm_srli_epi32(_mm_add_epi32(a.val, delta), n), delta32); + __m128i b1 = _mm_sub_epi32(_mm_srli_epi32(_mm_add_epi32(b.val, delta), n), delta32); + return v_uint16x8(_mm_sub_epi16(_mm_packs_epi32(a1, b1), _mm_set1_epi16(-32768))); +} + +template inline +void v_rshr_pack_store(ushort* ptr, const v_uint32x4& a) +{ + __m128i delta = _mm_set1_epi32(1 << (n-1)), delta32 = _mm_set1_epi32(32768); + __m128i a1 = _mm_sub_epi32(_mm_srli_epi32(_mm_add_epi32(a.val, delta), n), delta32); + __m128i a2 = _mm_sub_epi16(_mm_packs_epi32(a1, a1), _mm_set1_epi16(-32768)); + _mm_storel_epi64((__m128i*)ptr, a2); +} + +inline v_uint16x8 v_pack_u(const v_int32x4& a, const v_int32x4& b) +{ + __m128i delta32 = _mm_set1_epi32(32768); + __m128i r = _mm_packs_epi32(_mm_sub_epi32(a.val, delta32), _mm_sub_epi32(b.val, delta32)); + return v_uint16x8(_mm_sub_epi16(r, _mm_set1_epi16(-32768))); +} + +inline void v_pack_u_store(ushort* ptr, const v_int32x4& a) +{ + __m128i delta32 = _mm_set1_epi32(32768); + __m128i a1 = _mm_sub_epi32(a.val, delta32); + __m128i r = _mm_sub_epi16(_mm_packs_epi32(a1, a1), _mm_set1_epi16(-32768)); + _mm_storel_epi64((__m128i*)ptr, r); +} + +template inline +v_uint16x8 v_rshr_pack_u(const v_int32x4& a, const v_int32x4& b) +{ + __m128i delta = _mm_set1_epi32(1 << (n-1)), delta32 = _mm_set1_epi32(32768); + __m128i a1 = _mm_sub_epi32(_mm_srai_epi32(_mm_add_epi32(a.val, delta), n), delta32); + __m128i a2 = _mm_sub_epi16(_mm_packs_epi32(a1, a1), _mm_set1_epi16(-32768)); + __m128i b1 = _mm_sub_epi32(_mm_srai_epi32(_mm_add_epi32(b.val, delta), n), delta32); + __m128i b2 = _mm_sub_epi16(_mm_packs_epi32(b1, b1), _mm_set1_epi16(-32768)); + return v_uint16x8(_mm_unpacklo_epi64(a2, b2)); +} + +template inline +void v_rshr_pack_u_store(ushort* ptr, const v_int32x4& a) +{ + __m128i delta = _mm_set1_epi32(1 << (n-1)), delta32 = _mm_set1_epi32(32768); + __m128i a1 = _mm_sub_epi32(_mm_srai_epi32(_mm_add_epi32(a.val, delta), n), delta32); + __m128i a2 = _mm_sub_epi16(_mm_packs_epi32(a1, a1), _mm_set1_epi16(-32768)); + _mm_storel_epi64((__m128i*)ptr, a2); +} + +inline v_int16x8 v_pack(const v_int32x4& a, const v_int32x4& b) +{ return v_int16x8(_mm_packs_epi32(a.val, b.val)); } + +inline void v_pack_store(short* ptr, const v_int32x4& a) +{ + _mm_storel_epi64((__m128i*)ptr, _mm_packs_epi32(a.val, a.val)); +} + +template inline +v_int16x8 v_rshr_pack(const v_int32x4& a, const v_int32x4& b) +{ + __m128i delta = _mm_set1_epi32(1 << (n-1)); + return v_int16x8(_mm_packs_epi32(_mm_srai_epi32(_mm_add_epi32(a.val, delta), n), + _mm_srai_epi32(_mm_add_epi32(b.val, delta), n))); +} + +template inline +void v_rshr_pack_store(short* ptr, const v_int32x4& a) +{ + __m128i delta = _mm_set1_epi32(1 << (n-1)); + __m128i a1 = _mm_srai_epi32(_mm_add_epi32(a.val, delta), n); + _mm_storel_epi64((__m128i*)ptr, _mm_packs_epi32(a1, a1)); +} + + +// [a0 0 | b0 0] [a1 0 | b1 0] +inline v_uint32x4 v_pack(const v_uint64x2& a, const v_uint64x2& b) +{ + __m128i v0 = _mm_unpacklo_epi32(a.val, b.val); // a0 a1 0 0 + __m128i v1 = _mm_unpackhi_epi32(a.val, b.val); // b0 b1 0 0 + return v_uint32x4(_mm_unpacklo_epi32(v0, v1)); +} + +inline void v_pack_store(unsigned* ptr, const v_uint64x2& a) +{ + __m128i a1 = _mm_shuffle_epi32(a.val, _MM_SHUFFLE(0, 2, 2, 0)); + _mm_storel_epi64((__m128i*)ptr, a1); +} + +// [a0 0 | b0 0] [a1 0 | b1 0] +inline v_int32x4 v_pack(const v_int64x2& a, const v_int64x2& b) +{ + __m128i v0 = _mm_unpacklo_epi32(a.val, b.val); // a0 a1 0 0 + __m128i v1 = _mm_unpackhi_epi32(a.val, b.val); // b0 b1 0 0 + return v_int32x4(_mm_unpacklo_epi32(v0, v1)); +} + +inline void v_pack_store(int* ptr, const v_int64x2& a) +{ + __m128i a1 = _mm_shuffle_epi32(a.val, _MM_SHUFFLE(0, 2, 2, 0)); + _mm_storel_epi64((__m128i*)ptr, a1); +} + +template inline +v_uint32x4 v_rshr_pack(const v_uint64x2& a, const v_uint64x2& b) +{ + uint64 delta = (uint64)1 << (n-1); + v_uint64x2 delta2(delta, delta); + __m128i a1 = _mm_srli_epi64(_mm_add_epi64(a.val, delta2.val), n); + __m128i b1 = _mm_srli_epi64(_mm_add_epi64(b.val, delta2.val), n); + __m128i v0 = _mm_unpacklo_epi32(a1, b1); // a0 a1 0 0 + __m128i v1 = _mm_unpackhi_epi32(a1, b1); // b0 b1 0 0 + return v_uint32x4(_mm_unpacklo_epi32(v0, v1)); +} + +template inline +void v_rshr_pack_store(unsigned* ptr, const v_uint64x2& a) +{ + uint64 delta = (uint64)1 << (n-1); + v_uint64x2 delta2(delta, delta); + __m128i a1 = _mm_srli_epi64(_mm_add_epi64(a.val, delta2.val), n); + __m128i a2 = _mm_shuffle_epi32(a1, _MM_SHUFFLE(0, 2, 2, 0)); + _mm_storel_epi64((__m128i*)ptr, a2); +} + +inline __m128i v_sign_epi64(__m128i a) +{ + return _mm_shuffle_epi32(_mm_srai_epi32(a, 31), _MM_SHUFFLE(3, 3, 1, 1)); // x m0 | x m1 +} + +inline __m128i v_srai_epi64(__m128i a, int imm) +{ + __m128i smask = v_sign_epi64(a); + return _mm_xor_si128(_mm_srli_epi64(_mm_xor_si128(a, smask), imm), smask); +} + +template inline +v_int32x4 v_rshr_pack(const v_int64x2& a, const v_int64x2& b) +{ + int64 delta = (int64)1 << (n-1); + v_int64x2 delta2(delta, delta); + __m128i a1 = v_srai_epi64(_mm_add_epi64(a.val, delta2.val), n); + __m128i b1 = v_srai_epi64(_mm_add_epi64(b.val, delta2.val), n); + __m128i v0 = _mm_unpacklo_epi32(a1, b1); // a0 a1 0 0 + __m128i v1 = _mm_unpackhi_epi32(a1, b1); // b0 b1 0 0 + return v_int32x4(_mm_unpacklo_epi32(v0, v1)); +} + +template inline +void v_rshr_pack_store(int* ptr, const v_int64x2& a) +{ + int64 delta = (int64)1 << (n-1); + v_int64x2 delta2(delta, delta); + __m128i a1 = v_srai_epi64(_mm_add_epi64(a.val, delta2.val), n); + __m128i a2 = _mm_shuffle_epi32(a1, _MM_SHUFFLE(0, 2, 2, 0)); + _mm_storel_epi64((__m128i*)ptr, a2); +} + +inline v_float32x4 v_matmul(const v_float32x4& v, const v_float32x4& m0, + const v_float32x4& m1, const v_float32x4& m2, + const v_float32x4& m3) +{ + __m128 v0 = _mm_mul_ps(_mm_shuffle_ps(v.val, v.val, _MM_SHUFFLE(0, 0, 0, 0)), m0.val); + __m128 v1 = _mm_mul_ps(_mm_shuffle_ps(v.val, v.val, _MM_SHUFFLE(1, 1, 1, 1)), m1.val); + __m128 v2 = _mm_mul_ps(_mm_shuffle_ps(v.val, v.val, _MM_SHUFFLE(2, 2, 2, 2)), m2.val); + __m128 v3 = _mm_mul_ps(_mm_shuffle_ps(v.val, v.val, _MM_SHUFFLE(3, 3, 3, 3)), m3.val); + + return v_float32x4(_mm_add_ps(_mm_add_ps(v0, v1), _mm_add_ps(v2, v3))); +} + + +#define OPENCV_HAL_IMPL_SSE_BIN_OP(bin_op, _Tpvec, intrin) \ + inline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b) \ + { \ + return _Tpvec(intrin(a.val, b.val)); \ + } \ + inline _Tpvec& operator bin_op##= (_Tpvec& a, const _Tpvec& b) \ + { \ + a.val = intrin(a.val, b.val); \ + return a; \ + } + +OPENCV_HAL_IMPL_SSE_BIN_OP(+, v_uint8x16, _mm_adds_epu8) +OPENCV_HAL_IMPL_SSE_BIN_OP(-, v_uint8x16, _mm_subs_epu8) +OPENCV_HAL_IMPL_SSE_BIN_OP(+, v_int8x16, _mm_adds_epi8) +OPENCV_HAL_IMPL_SSE_BIN_OP(-, v_int8x16, _mm_subs_epi8) +OPENCV_HAL_IMPL_SSE_BIN_OP(+, v_uint16x8, _mm_adds_epu16) +OPENCV_HAL_IMPL_SSE_BIN_OP(-, v_uint16x8, _mm_subs_epu16) +OPENCV_HAL_IMPL_SSE_BIN_OP(*, v_uint16x8, _mm_mullo_epi16) +OPENCV_HAL_IMPL_SSE_BIN_OP(+, v_int16x8, _mm_adds_epi16) +OPENCV_HAL_IMPL_SSE_BIN_OP(-, v_int16x8, _mm_subs_epi16) +OPENCV_HAL_IMPL_SSE_BIN_OP(*, v_int16x8, _mm_mullo_epi16) +OPENCV_HAL_IMPL_SSE_BIN_OP(+, v_uint32x4, _mm_add_epi32) +OPENCV_HAL_IMPL_SSE_BIN_OP(-, v_uint32x4, _mm_sub_epi32) +OPENCV_HAL_IMPL_SSE_BIN_OP(+, v_int32x4, _mm_add_epi32) +OPENCV_HAL_IMPL_SSE_BIN_OP(-, v_int32x4, _mm_sub_epi32) +OPENCV_HAL_IMPL_SSE_BIN_OP(+, v_float32x4, _mm_add_ps) +OPENCV_HAL_IMPL_SSE_BIN_OP(-, v_float32x4, _mm_sub_ps) +OPENCV_HAL_IMPL_SSE_BIN_OP(*, v_float32x4, _mm_mul_ps) +OPENCV_HAL_IMPL_SSE_BIN_OP(/, v_float32x4, _mm_div_ps) +OPENCV_HAL_IMPL_SSE_BIN_OP(+, v_float64x2, _mm_add_pd) +OPENCV_HAL_IMPL_SSE_BIN_OP(-, v_float64x2, _mm_sub_pd) +OPENCV_HAL_IMPL_SSE_BIN_OP(*, v_float64x2, _mm_mul_pd) +OPENCV_HAL_IMPL_SSE_BIN_OP(/, v_float64x2, _mm_div_pd) +OPENCV_HAL_IMPL_SSE_BIN_OP(+, v_uint64x2, _mm_add_epi64) +OPENCV_HAL_IMPL_SSE_BIN_OP(-, v_uint64x2, _mm_sub_epi64) +OPENCV_HAL_IMPL_SSE_BIN_OP(+, v_int64x2, _mm_add_epi64) +OPENCV_HAL_IMPL_SSE_BIN_OP(-, v_int64x2, _mm_sub_epi64) + +inline v_uint32x4 operator * (const v_uint32x4& a, const v_uint32x4& b) +{ + __m128i c0 = _mm_mul_epu32(a.val, b.val); + __m128i c1 = _mm_mul_epu32(_mm_srli_epi64(a.val, 32), _mm_srli_epi64(b.val, 32)); + __m128i d0 = _mm_unpacklo_epi32(c0, c1); + __m128i d1 = _mm_unpackhi_epi32(c0, c1); + return v_uint32x4(_mm_unpacklo_epi64(d0, d1)); +} +inline v_int32x4 operator * (const v_int32x4& a, const v_int32x4& b) +{ + __m128i c0 = _mm_mul_epu32(a.val, b.val); + __m128i c1 = _mm_mul_epu32(_mm_srli_epi64(a.val, 32), _mm_srli_epi64(b.val, 32)); + __m128i d0 = _mm_unpacklo_epi32(c0, c1); + __m128i d1 = _mm_unpackhi_epi32(c0, c1); + return v_int32x4(_mm_unpacklo_epi64(d0, d1)); +} +inline v_uint32x4& operator *= (v_uint32x4& a, const v_uint32x4& b) +{ + a = a * b; + return a; +} +inline v_int32x4& operator *= (v_int32x4& a, const v_int32x4& b) +{ + a = a * b; + return a; +} + +inline void v_mul_expand(const v_int16x8& a, const v_int16x8& b, + v_int32x4& c, v_int32x4& d) +{ + __m128i v0 = _mm_mullo_epi16(a.val, b.val); + __m128i v1 = _mm_mulhi_epi16(a.val, b.val); + c.val = _mm_unpacklo_epi16(v0, v1); + d.val = _mm_unpackhi_epi16(v0, v1); +} + +inline void v_mul_expand(const v_uint16x8& a, const v_uint16x8& b, + v_uint32x4& c, v_uint32x4& d) +{ + __m128i v0 = _mm_mullo_epi16(a.val, b.val); + __m128i v1 = _mm_mulhi_epu16(a.val, b.val); + c.val = _mm_unpacklo_epi16(v0, v1); + d.val = _mm_unpackhi_epi16(v0, v1); +} + +inline void v_mul_expand(const v_uint32x4& a, const v_uint32x4& b, + v_uint64x2& c, v_uint64x2& d) +{ + __m128i c0 = _mm_mul_epu32(a.val, b.val); + __m128i c1 = _mm_mul_epu32(_mm_srli_epi64(a.val, 32), _mm_srli_epi64(b.val, 32)); + c.val = _mm_unpacklo_epi64(c0, c1); + d.val = _mm_unpackhi_epi64(c0, c1); +} + +inline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b) +{ + return v_int32x4(_mm_madd_epi16(a.val, b.val)); +} + +#define OPENCV_HAL_IMPL_SSE_LOGIC_OP(_Tpvec, suffix, not_const) \ + OPENCV_HAL_IMPL_SSE_BIN_OP(&, _Tpvec, _mm_and_##suffix) \ + OPENCV_HAL_IMPL_SSE_BIN_OP(|, _Tpvec, _mm_or_##suffix) \ + OPENCV_HAL_IMPL_SSE_BIN_OP(^, _Tpvec, _mm_xor_##suffix) \ + inline _Tpvec operator ~ (const _Tpvec& a) \ + { \ + return _Tpvec(_mm_xor_##suffix(a.val, not_const)); \ + } + +OPENCV_HAL_IMPL_SSE_LOGIC_OP(v_uint8x16, si128, _mm_set1_epi32(-1)) +OPENCV_HAL_IMPL_SSE_LOGIC_OP(v_int8x16, si128, _mm_set1_epi32(-1)) +OPENCV_HAL_IMPL_SSE_LOGIC_OP(v_uint16x8, si128, _mm_set1_epi32(-1)) +OPENCV_HAL_IMPL_SSE_LOGIC_OP(v_int16x8, si128, _mm_set1_epi32(-1)) +OPENCV_HAL_IMPL_SSE_LOGIC_OP(v_uint32x4, si128, _mm_set1_epi32(-1)) +OPENCV_HAL_IMPL_SSE_LOGIC_OP(v_int32x4, si128, _mm_set1_epi32(-1)) +OPENCV_HAL_IMPL_SSE_LOGIC_OP(v_uint64x2, si128, _mm_set1_epi32(-1)) +OPENCV_HAL_IMPL_SSE_LOGIC_OP(v_int64x2, si128, _mm_set1_epi32(-1)) +OPENCV_HAL_IMPL_SSE_LOGIC_OP(v_float32x4, ps, _mm_castsi128_ps(_mm_set1_epi32(-1))) +OPENCV_HAL_IMPL_SSE_LOGIC_OP(v_float64x2, pd, _mm_castsi128_pd(_mm_set1_epi32(-1))) + +inline v_float32x4 v_sqrt(const v_float32x4& x) +{ return v_float32x4(_mm_sqrt_ps(x.val)); } + +inline v_float32x4 v_invsqrt(const v_float32x4& x) +{ + static const __m128 _0_5 = _mm_set1_ps(0.5f), _1_5 = _mm_set1_ps(1.5f); + __m128 t = x.val; + __m128 h = _mm_mul_ps(t, _0_5); + t = _mm_rsqrt_ps(t); + t = _mm_mul_ps(t, _mm_sub_ps(_1_5, _mm_mul_ps(_mm_mul_ps(t, t), h))); + return v_float32x4(t); +} + +inline v_float64x2 v_sqrt(const v_float64x2& x) +{ return v_float64x2(_mm_sqrt_pd(x.val)); } + +inline v_float64x2 v_invsqrt(const v_float64x2& x) +{ + static const __m128d v_1 = _mm_set1_pd(1.); + return v_float64x2(_mm_div_pd(v_1, _mm_sqrt_pd(x.val))); +} + +inline v_float32x4 v_abs(const v_float32x4& x) +{ return v_float32x4(_mm_and_ps(x.val, _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff)))); } +inline v_float64x2 v_abs(const v_float64x2& x) +{ + return v_float64x2(_mm_and_pd(x.val, + _mm_castsi128_pd(_mm_srli_epi64(_mm_set1_epi32(-1), 1)))); +} + +// TODO: exp, log, sin, cos + +#define OPENCV_HAL_IMPL_SSE_BIN_FUNC(_Tpvec, func, intrin) \ +inline _Tpvec func(const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec(intrin(a.val, b.val)); \ +} + +OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_uint8x16, v_min, _mm_min_epu8) +OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_uint8x16, v_max, _mm_max_epu8) +OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_int16x8, v_min, _mm_min_epi16) +OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_int16x8, v_max, _mm_max_epi16) +OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_float32x4, v_min, _mm_min_ps) +OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_float32x4, v_max, _mm_max_ps) +OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_float64x2, v_min, _mm_min_pd) +OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_float64x2, v_max, _mm_max_pd) + +inline v_int8x16 v_min(const v_int8x16& a, const v_int8x16& b) +{ + __m128i delta = _mm_set1_epi8((char)-128); + return v_int8x16(_mm_xor_si128(delta, _mm_min_epu8(_mm_xor_si128(a.val, delta), + _mm_xor_si128(b.val, delta)))); +} +inline v_int8x16 v_max(const v_int8x16& a, const v_int8x16& b) +{ + __m128i delta = _mm_set1_epi8((char)-128); + return v_int8x16(_mm_xor_si128(delta, _mm_max_epu8(_mm_xor_si128(a.val, delta), + _mm_xor_si128(b.val, delta)))); +} +inline v_uint16x8 v_min(const v_uint16x8& a, const v_uint16x8& b) +{ + return v_uint16x8(_mm_subs_epu16(a.val, _mm_subs_epu16(a.val, b.val))); +} +inline v_uint16x8 v_max(const v_uint16x8& a, const v_uint16x8& b) +{ + return v_uint16x8(_mm_adds_epu16(_mm_subs_epu16(a.val, b.val), b.val)); +} +inline v_uint32x4 v_min(const v_uint32x4& a, const v_uint32x4& b) +{ + __m128i delta = _mm_set1_epi32((int)0x80000000); + __m128i mask = _mm_cmpgt_epi32(_mm_xor_si128(a.val, delta), _mm_xor_si128(b.val, delta)); + return v_uint32x4(v_select_si128(mask, b.val, a.val)); +} +inline v_uint32x4 v_max(const v_uint32x4& a, const v_uint32x4& b) +{ + __m128i delta = _mm_set1_epi32((int)0x80000000); + __m128i mask = _mm_cmpgt_epi32(_mm_xor_si128(a.val, delta), _mm_xor_si128(b.val, delta)); + return v_uint32x4(v_select_si128(mask, a.val, b.val)); +} +inline v_int32x4 v_min(const v_int32x4& a, const v_int32x4& b) +{ + return v_int32x4(v_select_si128(_mm_cmpgt_epi32(a.val, b.val), b.val, a.val)); +} +inline v_int32x4 v_max(const v_int32x4& a, const v_int32x4& b) +{ + return v_int32x4(v_select_si128(_mm_cmpgt_epi32(a.val, b.val), a.val, b.val)); +} + +#define OPENCV_HAL_IMPL_SSE_INT_CMP_OP(_Tpuvec, _Tpsvec, suffix, sbit) \ +inline _Tpuvec operator == (const _Tpuvec& a, const _Tpuvec& b) \ +{ return _Tpuvec(_mm_cmpeq_##suffix(a.val, b.val)); } \ +inline _Tpuvec operator != (const _Tpuvec& a, const _Tpuvec& b) \ +{ \ + __m128i not_mask = _mm_set1_epi32(-1); \ + return _Tpuvec(_mm_xor_si128(_mm_cmpeq_##suffix(a.val, b.val), not_mask)); \ +} \ +inline _Tpsvec operator == (const _Tpsvec& a, const _Tpsvec& b) \ +{ return _Tpsvec(_mm_cmpeq_##suffix(a.val, b.val)); } \ +inline _Tpsvec operator != (const _Tpsvec& a, const _Tpsvec& b) \ +{ \ + __m128i not_mask = _mm_set1_epi32(-1); \ + return _Tpsvec(_mm_xor_si128(_mm_cmpeq_##suffix(a.val, b.val), not_mask)); \ +} \ +inline _Tpuvec operator < (const _Tpuvec& a, const _Tpuvec& b) \ +{ \ + __m128i smask = _mm_set1_##suffix(sbit); \ + return _Tpuvec(_mm_cmpgt_##suffix(_mm_xor_si128(b.val, smask), _mm_xor_si128(a.val, smask))); \ +} \ +inline _Tpuvec operator > (const _Tpuvec& a, const _Tpuvec& b) \ +{ \ + __m128i smask = _mm_set1_##suffix(sbit); \ + return _Tpuvec(_mm_cmpgt_##suffix(_mm_xor_si128(a.val, smask), _mm_xor_si128(b.val, smask))); \ +} \ +inline _Tpuvec operator <= (const _Tpuvec& a, const _Tpuvec& b) \ +{ \ + __m128i smask = _mm_set1_##suffix(sbit); \ + __m128i not_mask = _mm_set1_epi32(-1); \ + __m128i res = _mm_cmpgt_##suffix(_mm_xor_si128(a.val, smask), _mm_xor_si128(b.val, smask)); \ + return _Tpuvec(_mm_xor_si128(res, not_mask)); \ +} \ +inline _Tpuvec operator >= (const _Tpuvec& a, const _Tpuvec& b) \ +{ \ + __m128i smask = _mm_set1_##suffix(sbit); \ + __m128i not_mask = _mm_set1_epi32(-1); \ + __m128i res = _mm_cmpgt_##suffix(_mm_xor_si128(b.val, smask), _mm_xor_si128(a.val, smask)); \ + return _Tpuvec(_mm_xor_si128(res, not_mask)); \ +} \ +inline _Tpsvec operator < (const _Tpsvec& a, const _Tpsvec& b) \ +{ \ + return _Tpsvec(_mm_cmpgt_##suffix(b.val, a.val)); \ +} \ +inline _Tpsvec operator > (const _Tpsvec& a, const _Tpsvec& b) \ +{ \ + return _Tpsvec(_mm_cmpgt_##suffix(a.val, b.val)); \ +} \ +inline _Tpsvec operator <= (const _Tpsvec& a, const _Tpsvec& b) \ +{ \ + __m128i not_mask = _mm_set1_epi32(-1); \ + return _Tpsvec(_mm_xor_si128(_mm_cmpgt_##suffix(a.val, b.val), not_mask)); \ +} \ +inline _Tpsvec operator >= (const _Tpsvec& a, const _Tpsvec& b) \ +{ \ + __m128i not_mask = _mm_set1_epi32(-1); \ + return _Tpsvec(_mm_xor_si128(_mm_cmpgt_##suffix(b.val, a.val), not_mask)); \ +} + +OPENCV_HAL_IMPL_SSE_INT_CMP_OP(v_uint8x16, v_int8x16, epi8, (char)-128) +OPENCV_HAL_IMPL_SSE_INT_CMP_OP(v_uint16x8, v_int16x8, epi16, (short)-32768) +OPENCV_HAL_IMPL_SSE_INT_CMP_OP(v_uint32x4, v_int32x4, epi32, (int)0x80000000) + +#define OPENCV_HAL_IMPL_SSE_FLT_CMP_OP(_Tpvec, suffix) \ +inline _Tpvec operator == (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(_mm_cmpeq_##suffix(a.val, b.val)); } \ +inline _Tpvec operator != (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(_mm_cmpneq_##suffix(a.val, b.val)); } \ +inline _Tpvec operator < (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(_mm_cmplt_##suffix(a.val, b.val)); } \ +inline _Tpvec operator > (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(_mm_cmpgt_##suffix(a.val, b.val)); } \ +inline _Tpvec operator <= (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(_mm_cmple_##suffix(a.val, b.val)); } \ +inline _Tpvec operator >= (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(_mm_cmpge_##suffix(a.val, b.val)); } + +OPENCV_HAL_IMPL_SSE_FLT_CMP_OP(v_float32x4, ps) +OPENCV_HAL_IMPL_SSE_FLT_CMP_OP(v_float64x2, pd) + +OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_uint8x16, v_add_wrap, _mm_add_epi8) +OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_int8x16, v_add_wrap, _mm_add_epi8) +OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_uint16x8, v_add_wrap, _mm_add_epi16) +OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_int16x8, v_add_wrap, _mm_add_epi16) +OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_uint8x16, v_sub_wrap, _mm_sub_epi8) +OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_int8x16, v_sub_wrap, _mm_sub_epi8) +OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_uint16x8, v_sub_wrap, _mm_sub_epi16) +OPENCV_HAL_IMPL_SSE_BIN_FUNC(v_int16x8, v_sub_wrap, _mm_sub_epi16) + +#define OPENCV_HAL_IMPL_SSE_ABSDIFF_8_16(_Tpuvec, _Tpsvec, bits, smask32) \ +inline _Tpuvec v_absdiff(const _Tpuvec& a, const _Tpuvec& b) \ +{ \ + return _Tpuvec(_mm_add_epi##bits(_mm_subs_epu##bits(a.val, b.val), _mm_subs_epu##bits(b.val, a.val))); \ +} \ +inline _Tpuvec v_absdiff(const _Tpsvec& a, const _Tpsvec& b) \ +{ \ + __m128i smask = _mm_set1_epi32(smask32); \ + __m128i a1 = _mm_xor_si128(a.val, smask); \ + __m128i b1 = _mm_xor_si128(b.val, smask); \ + return _Tpuvec(_mm_add_epi##bits(_mm_subs_epu##bits(a1, b1), _mm_subs_epu##bits(b1, a1))); \ +} + +OPENCV_HAL_IMPL_SSE_ABSDIFF_8_16(v_uint8x16, v_int8x16, 8, (int)0x80808080) +OPENCV_HAL_IMPL_SSE_ABSDIFF_8_16(v_uint16x8, v_int16x8, 16, (int)0x80008000) + +inline v_uint32x4 v_absdiff(const v_uint32x4& a, const v_uint32x4& b) +{ + return v_max(a, b) - v_min(a, b); +} + +inline v_uint32x4 v_absdiff(const v_int32x4& a, const v_int32x4& b) +{ + __m128i d = _mm_sub_epi32(a.val, b.val); + __m128i m = _mm_cmpgt_epi32(b.val, a.val); + return v_uint32x4(_mm_sub_epi32(_mm_xor_si128(d, m), m)); +} + +#define OPENCV_HAL_IMPL_SSE_MISC_FLT_OP(_Tpvec, _Tp, _Tpreg, suffix, absmask_vec) \ +inline _Tpvec v_absdiff(const _Tpvec& a, const _Tpvec& b) \ +{ \ + _Tpreg absmask = _mm_castsi128_##suffix(absmask_vec); \ + return _Tpvec(_mm_and_##suffix(_mm_sub_##suffix(a.val, b.val), absmask)); \ +} \ +inline _Tpvec v_magnitude(const _Tpvec& a, const _Tpvec& b) \ +{ \ + _Tpreg res = _mm_add_##suffix(_mm_mul_##suffix(a.val, a.val), _mm_mul_##suffix(b.val, b.val)); \ + return _Tpvec(_mm_sqrt_##suffix(res)); \ +} \ +inline _Tpvec v_sqr_magnitude(const _Tpvec& a, const _Tpvec& b) \ +{ \ + _Tpreg res = _mm_add_##suffix(_mm_mul_##suffix(a.val, a.val), _mm_mul_##suffix(b.val, b.val)); \ + return _Tpvec(res); \ +} \ +inline _Tpvec v_muladd(const _Tpvec& a, const _Tpvec& b, const _Tpvec& c) \ +{ \ + return _Tpvec(_mm_add_##suffix(_mm_mul_##suffix(a.val, b.val), c.val)); \ +} + +OPENCV_HAL_IMPL_SSE_MISC_FLT_OP(v_float32x4, float, __m128, ps, _mm_set1_epi32((int)0x7fffffff)) +OPENCV_HAL_IMPL_SSE_MISC_FLT_OP(v_float64x2, double, __m128d, pd, _mm_srli_epi64(_mm_set1_epi32(-1), 1)) + +#define OPENCV_HAL_IMPL_SSE_SHIFT_OP(_Tpuvec, _Tpsvec, suffix, srai) \ +inline _Tpuvec operator << (const _Tpuvec& a, int imm) \ +{ \ + return _Tpuvec(_mm_slli_##suffix(a.val, imm)); \ +} \ +inline _Tpsvec operator << (const _Tpsvec& a, int imm) \ +{ \ + return _Tpsvec(_mm_slli_##suffix(a.val, imm)); \ +} \ +inline _Tpuvec operator >> (const _Tpuvec& a, int imm) \ +{ \ + return _Tpuvec(_mm_srli_##suffix(a.val, imm)); \ +} \ +inline _Tpsvec operator >> (const _Tpsvec& a, int imm) \ +{ \ + return _Tpsvec(srai(a.val, imm)); \ +} \ +template \ +inline _Tpuvec v_shl(const _Tpuvec& a) \ +{ \ + return _Tpuvec(_mm_slli_##suffix(a.val, imm)); \ +} \ +template \ +inline _Tpsvec v_shl(const _Tpsvec& a) \ +{ \ + return _Tpsvec(_mm_slli_##suffix(a.val, imm)); \ +} \ +template \ +inline _Tpuvec v_shr(const _Tpuvec& a) \ +{ \ + return _Tpuvec(_mm_srli_##suffix(a.val, imm)); \ +} \ +template \ +inline _Tpsvec v_shr(const _Tpsvec& a) \ +{ \ + return _Tpsvec(srai(a.val, imm)); \ +} + +OPENCV_HAL_IMPL_SSE_SHIFT_OP(v_uint16x8, v_int16x8, epi16, _mm_srai_epi16) +OPENCV_HAL_IMPL_SSE_SHIFT_OP(v_uint32x4, v_int32x4, epi32, _mm_srai_epi32) +OPENCV_HAL_IMPL_SSE_SHIFT_OP(v_uint64x2, v_int64x2, epi64, v_srai_epi64) + +#define OPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(_Tpvec, _Tp) \ +inline _Tpvec v_load(const _Tp* ptr) \ +{ return _Tpvec(_mm_loadu_si128((const __m128i*)ptr)); } \ +inline _Tpvec v_load_aligned(const _Tp* ptr) \ +{ return _Tpvec(_mm_load_si128((const __m128i*)ptr)); } \ +inline _Tpvec v_load_halves(const _Tp* ptr0, const _Tp* ptr1) \ +{ \ + return _Tpvec(_mm_unpacklo_epi64(_mm_loadl_epi64((const __m128i*)ptr0), \ + _mm_loadl_epi64((const __m128i*)ptr1))); \ +} \ +inline void v_store(_Tp* ptr, const _Tpvec& a) \ +{ _mm_storeu_si128((__m128i*)ptr, a.val); } \ +inline void v_store_aligned(_Tp* ptr, const _Tpvec& a) \ +{ _mm_store_si128((__m128i*)ptr, a.val); } \ +inline void v_store_low(_Tp* ptr, const _Tpvec& a) \ +{ _mm_storel_epi64((__m128i*)ptr, a.val); } \ +inline void v_store_high(_Tp* ptr, const _Tpvec& a) \ +{ _mm_storel_epi64((__m128i*)ptr, _mm_unpackhi_epi64(a.val, a.val)); } + +OPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_uint8x16, uchar) +OPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_int8x16, schar) +OPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_uint16x8, ushort) +OPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_int16x8, short) +OPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_uint32x4, unsigned) +OPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_int32x4, int) +OPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_uint64x2, uint64) +OPENCV_HAL_IMPL_SSE_LOADSTORE_INT_OP(v_int64x2, int64) + +#define OPENCV_HAL_IMPL_SSE_LOADSTORE_FLT_OP(_Tpvec, _Tp, suffix) \ +inline _Tpvec v_load(const _Tp* ptr) \ +{ return _Tpvec(_mm_loadu_##suffix(ptr)); } \ +inline _Tpvec v_load_aligned(const _Tp* ptr) \ +{ return _Tpvec(_mm_load_##suffix(ptr)); } \ +inline _Tpvec v_load_halves(const _Tp* ptr0, const _Tp* ptr1) \ +{ \ + return _Tpvec(_mm_castsi128_##suffix( \ + _mm_unpacklo_epi64(_mm_loadl_epi64((const __m128i*)ptr0), \ + _mm_loadl_epi64((const __m128i*)ptr1)))); \ +} \ +inline void v_store(_Tp* ptr, const _Tpvec& a) \ +{ _mm_storeu_##suffix(ptr, a.val); } \ +inline void v_store_aligned(_Tp* ptr, const _Tpvec& a) \ +{ _mm_store_##suffix(ptr, a.val); } \ +inline void v_store_low(_Tp* ptr, const _Tpvec& a) \ +{ _mm_storel_epi64((__m128i*)ptr, _mm_cast##suffix##_si128(a.val)); } \ +inline void v_store_high(_Tp* ptr, const _Tpvec& a) \ +{ \ + __m128i a1 = _mm_cast##suffix##_si128(a.val); \ + _mm_storel_epi64((__m128i*)ptr, _mm_unpackhi_epi64(a1, a1)); \ +} + +OPENCV_HAL_IMPL_SSE_LOADSTORE_FLT_OP(v_float32x4, float, ps) +OPENCV_HAL_IMPL_SSE_LOADSTORE_FLT_OP(v_float64x2, double, pd) + +#define OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(_Tpvec, scalartype, func, scalar_func) \ +inline scalartype v_reduce_##func(const _Tpvec& a) \ +{ \ + scalartype CV_DECL_ALIGNED(16) buf[4]; \ + v_store_aligned(buf, a); \ + scalartype s0 = scalar_func(buf[0], buf[1]); \ + scalartype s1 = scalar_func(buf[2], buf[3]); \ + return scalar_func(s0, s1); \ +} + +OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_uint32x4, unsigned, sum, OPENCV_HAL_ADD) +OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_uint32x4, unsigned, max, std::max) +OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_uint32x4, unsigned, min, std::min) +OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_int32x4, int, sum, OPENCV_HAL_ADD) +OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_int32x4, int, max, std::max) +OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_int32x4, int, min, std::min) +OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_float32x4, float, sum, OPENCV_HAL_ADD) +OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_float32x4, float, max, std::max) +OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_float32x4, float, min, std::min) + +#define OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(_Tpvec, suffix, pack_op, and_op, signmask, allmask) \ +inline int v_signmask(const _Tpvec& a) \ +{ \ + return and_op(_mm_movemask_##suffix(pack_op(a.val)), signmask); \ +} \ +inline bool v_check_all(const _Tpvec& a) \ +{ return and_op(_mm_movemask_##suffix(a.val), allmask) == allmask; } \ +inline bool v_check_any(const _Tpvec& a) \ +{ return and_op(_mm_movemask_##suffix(a.val), allmask) != 0; } + +#define OPENCV_HAL_PACKS(a) _mm_packs_epi16(a, a) +inline __m128i v_packq_epi32(__m128i a) +{ + __m128i b = _mm_packs_epi32(a, a); + return _mm_packs_epi16(b, b); +} + +OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_uint8x16, epi8, OPENCV_HAL_NOP, OPENCV_HAL_1ST, 65535, 65535) +OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_int8x16, epi8, OPENCV_HAL_NOP, OPENCV_HAL_1ST, 65535, 65535) +OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_uint16x8, epi8, OPENCV_HAL_PACKS, OPENCV_HAL_AND, 255, (int)0xaaaa) +OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_int16x8, epi8, OPENCV_HAL_PACKS, OPENCV_HAL_AND, 255, (int)0xaaaa) +OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_uint32x4, epi8, v_packq_epi32, OPENCV_HAL_AND, 15, (int)0x8888) +OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_int32x4, epi8, v_packq_epi32, OPENCV_HAL_AND, 15, (int)0x8888) +OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_float32x4, ps, OPENCV_HAL_NOP, OPENCV_HAL_1ST, 15, 15) +OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_float64x2, pd, OPENCV_HAL_NOP, OPENCV_HAL_1ST, 3, 3) + +#define OPENCV_HAL_IMPL_SSE_SELECT(_Tpvec, suffix) \ +inline _Tpvec v_select(const _Tpvec& mask, const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec(_mm_xor_##suffix(b.val, _mm_and_##suffix(_mm_xor_##suffix(b.val, a.val), mask.val))); \ +} + +OPENCV_HAL_IMPL_SSE_SELECT(v_uint8x16, si128) +OPENCV_HAL_IMPL_SSE_SELECT(v_int8x16, si128) +OPENCV_HAL_IMPL_SSE_SELECT(v_uint16x8, si128) +OPENCV_HAL_IMPL_SSE_SELECT(v_int16x8, si128) +OPENCV_HAL_IMPL_SSE_SELECT(v_uint32x4, si128) +OPENCV_HAL_IMPL_SSE_SELECT(v_int32x4, si128) +// OPENCV_HAL_IMPL_SSE_SELECT(v_uint64x2, si128) +// OPENCV_HAL_IMPL_SSE_SELECT(v_int64x2, si128) +OPENCV_HAL_IMPL_SSE_SELECT(v_float32x4, ps) +OPENCV_HAL_IMPL_SSE_SELECT(v_float64x2, pd) + +#define OPENCV_HAL_IMPL_SSE_EXPAND(_Tpuvec, _Tpwuvec, _Tpu, _Tpsvec, _Tpwsvec, _Tps, suffix, wsuffix, shift) \ +inline void v_expand(const _Tpuvec& a, _Tpwuvec& b0, _Tpwuvec& b1) \ +{ \ + __m128i z = _mm_setzero_si128(); \ + b0.val = _mm_unpacklo_##suffix(a.val, z); \ + b1.val = _mm_unpackhi_##suffix(a.val, z); \ +} \ +inline _Tpwuvec v_load_expand(const _Tpu* ptr) \ +{ \ + __m128i z = _mm_setzero_si128(); \ + return _Tpwuvec(_mm_unpacklo_##suffix(_mm_loadl_epi64((const __m128i*)ptr), z)); \ +} \ +inline void v_expand(const _Tpsvec& a, _Tpwsvec& b0, _Tpwsvec& b1) \ +{ \ + b0.val = _mm_srai_##wsuffix(_mm_unpacklo_##suffix(a.val, a.val), shift); \ + b1.val = _mm_srai_##wsuffix(_mm_unpackhi_##suffix(a.val, a.val), shift); \ +} \ +inline _Tpwsvec v_load_expand(const _Tps* ptr) \ +{ \ + __m128i a = _mm_loadl_epi64((const __m128i*)ptr); \ + return _Tpwsvec(_mm_srai_##wsuffix(_mm_unpacklo_##suffix(a, a), shift)); \ +} + +OPENCV_HAL_IMPL_SSE_EXPAND(v_uint8x16, v_uint16x8, uchar, v_int8x16, v_int16x8, schar, epi8, epi16, 8) +OPENCV_HAL_IMPL_SSE_EXPAND(v_uint16x8, v_uint32x4, ushort, v_int16x8, v_int32x4, short, epi16, epi32, 16) + +inline void v_expand(const v_uint32x4& a, v_uint64x2& b0, v_uint64x2& b1) +{ + __m128i z = _mm_setzero_si128(); + b0.val = _mm_unpacklo_epi32(a.val, z); + b1.val = _mm_unpackhi_epi32(a.val, z); +} +inline v_uint64x2 v_load_expand(const unsigned* ptr) +{ + __m128i z = _mm_setzero_si128(); + return v_uint64x2(_mm_unpacklo_epi32(_mm_loadl_epi64((const __m128i*)ptr), z)); +} +inline void v_expand(const v_int32x4& a, v_int64x2& b0, v_int64x2& b1) +{ + __m128i s = _mm_srai_epi32(a.val, 31); + b0.val = _mm_unpacklo_epi32(a.val, s); + b1.val = _mm_unpackhi_epi32(a.val, s); +} +inline v_int64x2 v_load_expand(const int* ptr) +{ + __m128i a = _mm_loadl_epi64((const __m128i*)ptr); + __m128i s = _mm_srai_epi32(a, 31); + return v_int64x2(_mm_unpacklo_epi32(a, s)); +} + +inline v_uint32x4 v_load_expand_q(const uchar* ptr) +{ + __m128i z = _mm_setzero_si128(); + __m128i a = _mm_cvtsi32_si128(*(const int*)ptr); + return v_uint32x4(_mm_unpacklo_epi16(_mm_unpacklo_epi8(a, z), z)); +} + +inline v_int32x4 v_load_expand_q(const schar* ptr) +{ + __m128i a = _mm_cvtsi32_si128(*(const int*)ptr); + a = _mm_unpacklo_epi8(a, a); + a = _mm_unpacklo_epi8(a, a); + return v_int32x4(_mm_srai_epi32(a, 24)); +} + +#define OPENCV_HAL_IMPL_SSE_UNPACKS(_Tpvec, suffix, cast_from, cast_to) \ +inline void v_zip(const _Tpvec& a0, const _Tpvec& a1, _Tpvec& b0, _Tpvec& b1) \ +{ \ + b0.val = _mm_unpacklo_##suffix(a0.val, a1.val); \ + b1.val = _mm_unpackhi_##suffix(a0.val, a1.val); \ +} \ +inline _Tpvec v_combine_low(const _Tpvec& a, const _Tpvec& b) \ +{ \ + __m128i a1 = cast_from(a.val), b1 = cast_from(b.val); \ + return _Tpvec(cast_to(_mm_unpacklo_epi64(a1, b1))); \ +} \ +inline _Tpvec v_combine_high(const _Tpvec& a, const _Tpvec& b) \ +{ \ + __m128i a1 = cast_from(a.val), b1 = cast_from(b.val); \ + return _Tpvec(cast_to(_mm_unpackhi_epi64(a1, b1))); \ +} \ +inline void v_recombine(const _Tpvec& a, const _Tpvec& b, _Tpvec& c, _Tpvec& d) \ +{ \ + __m128i a1 = cast_from(a.val), b1 = cast_from(b.val); \ + c.val = cast_to(_mm_unpacklo_epi64(a1, b1)); \ + d.val = cast_to(_mm_unpackhi_epi64(a1, b1)); \ +} + +OPENCV_HAL_IMPL_SSE_UNPACKS(v_uint8x16, epi8, OPENCV_HAL_NOP, OPENCV_HAL_NOP) +OPENCV_HAL_IMPL_SSE_UNPACKS(v_int8x16, epi8, OPENCV_HAL_NOP, OPENCV_HAL_NOP) +OPENCV_HAL_IMPL_SSE_UNPACKS(v_uint16x8, epi16, OPENCV_HAL_NOP, OPENCV_HAL_NOP) +OPENCV_HAL_IMPL_SSE_UNPACKS(v_int16x8, epi16, OPENCV_HAL_NOP, OPENCV_HAL_NOP) +OPENCV_HAL_IMPL_SSE_UNPACKS(v_uint32x4, epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP) +OPENCV_HAL_IMPL_SSE_UNPACKS(v_int32x4, epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP) +OPENCV_HAL_IMPL_SSE_UNPACKS(v_float32x4, ps, _mm_castps_si128, _mm_castsi128_ps) +OPENCV_HAL_IMPL_SSE_UNPACKS(v_float64x2, pd, _mm_castpd_si128, _mm_castsi128_pd) + +template +inline _Tpvec v_extract(const _Tpvec& a, const _Tpvec& b) +{ + const int w = sizeof(typename _Tpvec::lane_type); + const int n = _Tpvec::nlanes; + __m128i ra, rb; + ra = _mm_srli_si128(a.val, s*w); + rb = _mm_slli_si128(b.val, (n-s)*w); + return _Tpvec(_mm_or_si128(ra, rb)); +} + +inline v_int32x4 v_round(const v_float32x4& a) +{ return v_int32x4(_mm_cvtps_epi32(a.val)); } + +inline v_int32x4 v_floor(const v_float32x4& a) +{ + __m128i a1 = _mm_cvtps_epi32(a.val); + __m128i mask = _mm_castps_si128(_mm_cmpgt_ps(_mm_cvtepi32_ps(a1), a.val)); + return v_int32x4(_mm_add_epi32(a1, mask)); +} + +inline v_int32x4 v_ceil(const v_float32x4& a) +{ + __m128i a1 = _mm_cvtps_epi32(a.val); + __m128i mask = _mm_castps_si128(_mm_cmpgt_ps(a.val, _mm_cvtepi32_ps(a1))); + return v_int32x4(_mm_sub_epi32(a1, mask)); +} + +inline v_int32x4 v_trunc(const v_float32x4& a) +{ return v_int32x4(_mm_cvttps_epi32(a.val)); } + +inline v_int32x4 v_round(const v_float64x2& a) +{ return v_int32x4(_mm_cvtpd_epi32(a.val)); } + +inline v_int32x4 v_floor(const v_float64x2& a) +{ + __m128i a1 = _mm_cvtpd_epi32(a.val); + __m128i mask = _mm_castpd_si128(_mm_cmpgt_pd(_mm_cvtepi32_pd(a1), a.val)); + mask = _mm_srli_si128(_mm_slli_si128(mask, 4), 8); // m0 m0 m1 m1 => m0 m1 0 0 + return v_int32x4(_mm_add_epi32(a1, mask)); +} + +inline v_int32x4 v_ceil(const v_float64x2& a) +{ + __m128i a1 = _mm_cvtpd_epi32(a.val); + __m128i mask = _mm_castpd_si128(_mm_cmpgt_pd(a.val, _mm_cvtepi32_pd(a1))); + mask = _mm_srli_si128(_mm_slli_si128(mask, 4), 8); // m0 m0 m1 m1 => m0 m1 0 0 + return v_int32x4(_mm_sub_epi32(a1, mask)); +} + +inline v_int32x4 v_trunc(const v_float64x2& a) +{ return v_int32x4(_mm_cvttpd_epi32(a.val)); } + +#define OPENCV_HAL_IMPL_SSE_TRANSPOSE4x4(_Tpvec, suffix, cast_from, cast_to) \ +inline void v_transpose4x4(const _Tpvec& a0, const _Tpvec& a1, \ + const _Tpvec& a2, const _Tpvec& a3, \ + _Tpvec& b0, _Tpvec& b1, \ + _Tpvec& b2, _Tpvec& b3) \ +{ \ + __m128i t0 = cast_from(_mm_unpacklo_##suffix(a0.val, a1.val)); \ + __m128i t1 = cast_from(_mm_unpacklo_##suffix(a2.val, a3.val)); \ + __m128i t2 = cast_from(_mm_unpackhi_##suffix(a0.val, a1.val)); \ + __m128i t3 = cast_from(_mm_unpackhi_##suffix(a2.val, a3.val)); \ +\ + b0.val = cast_to(_mm_unpacklo_epi64(t0, t1)); \ + b1.val = cast_to(_mm_unpackhi_epi64(t0, t1)); \ + b2.val = cast_to(_mm_unpacklo_epi64(t2, t3)); \ + b3.val = cast_to(_mm_unpackhi_epi64(t2, t3)); \ +} + +OPENCV_HAL_IMPL_SSE_TRANSPOSE4x4(v_uint32x4, epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP) +OPENCV_HAL_IMPL_SSE_TRANSPOSE4x4(v_int32x4, epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP) +OPENCV_HAL_IMPL_SSE_TRANSPOSE4x4(v_float32x4, ps, _mm_castps_si128, _mm_castsi128_ps) + +// adopted from sse_utils.hpp +inline void v_load_deinterleave(const uchar* ptr, v_uint8x16& a, v_uint8x16& b, v_uint8x16& c) +{ + __m128i t00 = _mm_loadu_si128((const __m128i*)ptr); + __m128i t01 = _mm_loadu_si128((const __m128i*)(ptr + 16)); + __m128i t02 = _mm_loadu_si128((const __m128i*)(ptr + 32)); + + __m128i t10 = _mm_unpacklo_epi8(t00, _mm_unpackhi_epi64(t01, t01)); + __m128i t11 = _mm_unpacklo_epi8(_mm_unpackhi_epi64(t00, t00), t02); + __m128i t12 = _mm_unpacklo_epi8(t01, _mm_unpackhi_epi64(t02, t02)); + + __m128i t20 = _mm_unpacklo_epi8(t10, _mm_unpackhi_epi64(t11, t11)); + __m128i t21 = _mm_unpacklo_epi8(_mm_unpackhi_epi64(t10, t10), t12); + __m128i t22 = _mm_unpacklo_epi8(t11, _mm_unpackhi_epi64(t12, t12)); + + __m128i t30 = _mm_unpacklo_epi8(t20, _mm_unpackhi_epi64(t21, t21)); + __m128i t31 = _mm_unpacklo_epi8(_mm_unpackhi_epi64(t20, t20), t22); + __m128i t32 = _mm_unpacklo_epi8(t21, _mm_unpackhi_epi64(t22, t22)); + + a.val = _mm_unpacklo_epi8(t30, _mm_unpackhi_epi64(t31, t31)); + b.val = _mm_unpacklo_epi8(_mm_unpackhi_epi64(t30, t30), t32); + c.val = _mm_unpacklo_epi8(t31, _mm_unpackhi_epi64(t32, t32)); +} + +inline void v_load_deinterleave(const uchar* ptr, v_uint8x16& a, v_uint8x16& b, v_uint8x16& c, v_uint8x16& d) +{ + __m128i u0 = _mm_loadu_si128((const __m128i*)ptr); // a0 b0 c0 d0 a1 b1 c1 d1 ... + __m128i u1 = _mm_loadu_si128((const __m128i*)(ptr + 16)); // a4 b4 c4 d4 ... + __m128i u2 = _mm_loadu_si128((const __m128i*)(ptr + 32)); // a8 b8 c8 d8 ... + __m128i u3 = _mm_loadu_si128((const __m128i*)(ptr + 48)); // a12 b12 c12 d12 ... + + __m128i v0 = _mm_unpacklo_epi8(u0, u2); // a0 a8 b0 b8 ... + __m128i v1 = _mm_unpackhi_epi8(u0, u2); // a2 a10 b2 b10 ... + __m128i v2 = _mm_unpacklo_epi8(u1, u3); // a4 a12 b4 b12 ... + __m128i v3 = _mm_unpackhi_epi8(u1, u3); // a6 a14 b6 b14 ... + + u0 = _mm_unpacklo_epi8(v0, v2); // a0 a4 a8 a12 ... + u1 = _mm_unpacklo_epi8(v1, v3); // a2 a6 a10 a14 ... + u2 = _mm_unpackhi_epi8(v0, v2); // a1 a5 a9 a13 ... + u3 = _mm_unpackhi_epi8(v1, v3); // a3 a7 a11 a15 ... + + v0 = _mm_unpacklo_epi8(u0, u1); // a0 a2 a4 a6 ... + v1 = _mm_unpacklo_epi8(u2, u3); // a1 a3 a5 a7 ... + v2 = _mm_unpackhi_epi8(u0, u1); // c0 c2 c4 c6 ... + v3 = _mm_unpackhi_epi8(u2, u3); // c1 c3 c5 c7 ... + + a.val = _mm_unpacklo_epi8(v0, v1); + b.val = _mm_unpackhi_epi8(v0, v1); + c.val = _mm_unpacklo_epi8(v2, v3); + d.val = _mm_unpackhi_epi8(v2, v3); +} + +inline void v_load_deinterleave(const ushort* ptr, v_uint16x8& a, v_uint16x8& b, v_uint16x8& c) +{ + __m128i t00 = _mm_loadu_si128((const __m128i*)ptr); + __m128i t01 = _mm_loadu_si128((const __m128i*)(ptr + 8)); + __m128i t02 = _mm_loadu_si128((const __m128i*)(ptr + 16)); + + __m128i t10 = _mm_unpacklo_epi16(t00, _mm_unpackhi_epi64(t01, t01)); + __m128i t11 = _mm_unpacklo_epi16(_mm_unpackhi_epi64(t00, t00), t02); + __m128i t12 = _mm_unpacklo_epi16(t01, _mm_unpackhi_epi64(t02, t02)); + + __m128i t20 = _mm_unpacklo_epi16(t10, _mm_unpackhi_epi64(t11, t11)); + __m128i t21 = _mm_unpacklo_epi16(_mm_unpackhi_epi64(t10, t10), t12); + __m128i t22 = _mm_unpacklo_epi16(t11, _mm_unpackhi_epi64(t12, t12)); + + a.val = _mm_unpacklo_epi16(t20, _mm_unpackhi_epi64(t21, t21)); + b.val = _mm_unpacklo_epi16(_mm_unpackhi_epi64(t20, t20), t22); + c.val = _mm_unpacklo_epi16(t21, _mm_unpackhi_epi64(t22, t22)); +} + +inline void v_load_deinterleave(const ushort* ptr, v_uint16x8& a, v_uint16x8& b, v_uint16x8& c, v_uint16x8& d) +{ + __m128i u0 = _mm_loadu_si128((const __m128i*)ptr); // a0 b0 c0 d0 a1 b1 c1 d1 + __m128i u1 = _mm_loadu_si128((const __m128i*)(ptr + 8)); // a2 b2 c2 d2 ... + __m128i u2 = _mm_loadu_si128((const __m128i*)(ptr + 16)); // a4 b4 c4 d4 ... + __m128i u3 = _mm_loadu_si128((const __m128i*)(ptr + 24)); // a6 b6 c6 d6 ... + + __m128i v0 = _mm_unpacklo_epi16(u0, u2); // a0 a4 b0 b4 ... + __m128i v1 = _mm_unpackhi_epi16(u0, u2); // a1 a5 b1 b5 ... + __m128i v2 = _mm_unpacklo_epi16(u1, u3); // a2 a6 b2 b6 ... + __m128i v3 = _mm_unpackhi_epi16(u1, u3); // a3 a7 b3 b7 ... + + u0 = _mm_unpacklo_epi16(v0, v2); // a0 a2 a4 a6 ... + u1 = _mm_unpacklo_epi16(v1, v3); // a1 a3 a5 a7 ... + u2 = _mm_unpackhi_epi16(v0, v2); // c0 c2 c4 c6 ... + u3 = _mm_unpackhi_epi16(v1, v3); // c1 c3 c5 c7 ... + + a.val = _mm_unpacklo_epi16(u0, u1); + b.val = _mm_unpackhi_epi16(u0, u1); + c.val = _mm_unpacklo_epi16(u2, u3); + d.val = _mm_unpackhi_epi16(u2, u3); +} + +inline void v_load_deinterleave(const unsigned* ptr, v_uint32x4& a, v_uint32x4& b, v_uint32x4& c) +{ + __m128i t00 = _mm_loadu_si128((const __m128i*)ptr); + __m128i t01 = _mm_loadu_si128((const __m128i*)(ptr + 4)); + __m128i t02 = _mm_loadu_si128((const __m128i*)(ptr + 8)); + + __m128i t10 = _mm_unpacklo_epi32(t00, _mm_unpackhi_epi64(t01, t01)); + __m128i t11 = _mm_unpacklo_epi32(_mm_unpackhi_epi64(t00, t00), t02); + __m128i t12 = _mm_unpacklo_epi32(t01, _mm_unpackhi_epi64(t02, t02)); + + a.val = _mm_unpacklo_epi32(t10, _mm_unpackhi_epi64(t11, t11)); + b.val = _mm_unpacklo_epi32(_mm_unpackhi_epi64(t10, t10), t12); + c.val = _mm_unpacklo_epi32(t11, _mm_unpackhi_epi64(t12, t12)); +} + +inline void v_load_deinterleave(const unsigned* ptr, v_uint32x4& a, v_uint32x4& b, v_uint32x4& c, v_uint32x4& d) +{ + v_uint32x4 u0(_mm_loadu_si128((const __m128i*)ptr)); // a0 b0 c0 d0 + v_uint32x4 u1(_mm_loadu_si128((const __m128i*)(ptr + 4))); // a1 b1 c1 d1 + v_uint32x4 u2(_mm_loadu_si128((const __m128i*)(ptr + 8))); // a2 b2 c2 d2 + v_uint32x4 u3(_mm_loadu_si128((const __m128i*)(ptr + 12))); // a3 b3 c3 d3 + + v_transpose4x4(u0, u1, u2, u3, a, b, c, d); +} + +inline void v_store_interleave( uchar* ptr, const v_uint8x16& a, const v_uint8x16& b, + const v_uint8x16& c ) +{ + __m128i z = _mm_setzero_si128(); + __m128i ab0 = _mm_unpacklo_epi8(a.val, b.val); + __m128i ab1 = _mm_unpackhi_epi8(a.val, b.val); + __m128i c0 = _mm_unpacklo_epi8(c.val, z); + __m128i c1 = _mm_unpackhi_epi8(c.val, z); + + __m128i p00 = _mm_unpacklo_epi16(ab0, c0); + __m128i p01 = _mm_unpackhi_epi16(ab0, c0); + __m128i p02 = _mm_unpacklo_epi16(ab1, c1); + __m128i p03 = _mm_unpackhi_epi16(ab1, c1); + + __m128i p10 = _mm_unpacklo_epi32(p00, p01); + __m128i p11 = _mm_unpackhi_epi32(p00, p01); + __m128i p12 = _mm_unpacklo_epi32(p02, p03); + __m128i p13 = _mm_unpackhi_epi32(p02, p03); + + __m128i p20 = _mm_unpacklo_epi64(p10, p11); + __m128i p21 = _mm_unpackhi_epi64(p10, p11); + __m128i p22 = _mm_unpacklo_epi64(p12, p13); + __m128i p23 = _mm_unpackhi_epi64(p12, p13); + + p20 = _mm_slli_si128(p20, 1); + p22 = _mm_slli_si128(p22, 1); + + __m128i p30 = _mm_slli_epi64(_mm_unpacklo_epi32(p20, p21), 8); + __m128i p31 = _mm_srli_epi64(_mm_unpackhi_epi32(p20, p21), 8); + __m128i p32 = _mm_slli_epi64(_mm_unpacklo_epi32(p22, p23), 8); + __m128i p33 = _mm_srli_epi64(_mm_unpackhi_epi32(p22, p23), 8); + + __m128i p40 = _mm_unpacklo_epi64(p30, p31); + __m128i p41 = _mm_unpackhi_epi64(p30, p31); + __m128i p42 = _mm_unpacklo_epi64(p32, p33); + __m128i p43 = _mm_unpackhi_epi64(p32, p33); + + __m128i v0 = _mm_or_si128(_mm_srli_si128(p40, 2), _mm_slli_si128(p41, 10)); + __m128i v1 = _mm_or_si128(_mm_srli_si128(p41, 6), _mm_slli_si128(p42, 6)); + __m128i v2 = _mm_or_si128(_mm_srli_si128(p42, 10), _mm_slli_si128(p43, 2)); + + _mm_storeu_si128((__m128i*)(ptr), v0); + _mm_storeu_si128((__m128i*)(ptr + 16), v1); + _mm_storeu_si128((__m128i*)(ptr + 32), v2); +} + +inline void v_store_interleave( uchar* ptr, const v_uint8x16& a, const v_uint8x16& b, + const v_uint8x16& c, const v_uint8x16& d) +{ + // a0 a1 a2 a3 .... + // b0 b1 b2 b3 .... + // c0 c1 c2 c3 .... + // d0 d1 d2 d3 .... + __m128i u0 = _mm_unpacklo_epi8(a.val, c.val); // a0 c0 a1 c1 ... + __m128i u1 = _mm_unpackhi_epi8(a.val, c.val); // a8 c8 a9 c9 ... + __m128i u2 = _mm_unpacklo_epi8(b.val, d.val); // b0 d0 b1 d1 ... + __m128i u3 = _mm_unpackhi_epi8(b.val, d.val); // b8 d8 b9 d9 ... + + __m128i v0 = _mm_unpacklo_epi8(u0, u2); // a0 b0 c0 d0 ... + __m128i v1 = _mm_unpacklo_epi8(u1, u3); // a8 b8 c8 d8 ... + __m128i v2 = _mm_unpackhi_epi8(u0, u2); // a4 b4 c4 d4 ... + __m128i v3 = _mm_unpackhi_epi8(u1, u3); // a12 b12 c12 d12 ... + + _mm_storeu_si128((__m128i*)ptr, v0); + _mm_storeu_si128((__m128i*)(ptr + 16), v2); + _mm_storeu_si128((__m128i*)(ptr + 32), v1); + _mm_storeu_si128((__m128i*)(ptr + 48), v3); +} + +inline void v_store_interleave( ushort* ptr, const v_uint16x8& a, + const v_uint16x8& b, + const v_uint16x8& c ) +{ + __m128i z = _mm_setzero_si128(); + __m128i ab0 = _mm_unpacklo_epi16(a.val, b.val); + __m128i ab1 = _mm_unpackhi_epi16(a.val, b.val); + __m128i c0 = _mm_unpacklo_epi16(c.val, z); + __m128i c1 = _mm_unpackhi_epi16(c.val, z); + + __m128i p10 = _mm_unpacklo_epi32(ab0, c0); + __m128i p11 = _mm_unpackhi_epi32(ab0, c0); + __m128i p12 = _mm_unpacklo_epi32(ab1, c1); + __m128i p13 = _mm_unpackhi_epi32(ab1, c1); + + __m128i p20 = _mm_unpacklo_epi64(p10, p11); + __m128i p21 = _mm_unpackhi_epi64(p10, p11); + __m128i p22 = _mm_unpacklo_epi64(p12, p13); + __m128i p23 = _mm_unpackhi_epi64(p12, p13); + + p20 = _mm_slli_si128(p20, 2); + p22 = _mm_slli_si128(p22, 2); + + __m128i p30 = _mm_unpacklo_epi64(p20, p21); + __m128i p31 = _mm_unpackhi_epi64(p20, p21); + __m128i p32 = _mm_unpacklo_epi64(p22, p23); + __m128i p33 = _mm_unpackhi_epi64(p22, p23); + + __m128i v0 = _mm_or_si128(_mm_srli_si128(p30, 2), _mm_slli_si128(p31, 10)); + __m128i v1 = _mm_or_si128(_mm_srli_si128(p31, 6), _mm_slli_si128(p32, 6)); + __m128i v2 = _mm_or_si128(_mm_srli_si128(p32, 10), _mm_slli_si128(p33, 2)); + + _mm_storeu_si128((__m128i*)(ptr), v0); + _mm_storeu_si128((__m128i*)(ptr + 8), v1); + _mm_storeu_si128((__m128i*)(ptr + 16), v2); +} + +inline void v_store_interleave( ushort* ptr, const v_uint16x8& a, const v_uint16x8& b, + const v_uint16x8& c, const v_uint16x8& d) +{ + // a0 a1 a2 a3 .... + // b0 b1 b2 b3 .... + // c0 c1 c2 c3 .... + // d0 d1 d2 d3 .... + __m128i u0 = _mm_unpacklo_epi16(a.val, c.val); // a0 c0 a1 c1 ... + __m128i u1 = _mm_unpackhi_epi16(a.val, c.val); // a4 c4 a5 c5 ... + __m128i u2 = _mm_unpacklo_epi16(b.val, d.val); // b0 d0 b1 d1 ... + __m128i u3 = _mm_unpackhi_epi16(b.val, d.val); // b4 d4 b5 d5 ... + + __m128i v0 = _mm_unpacklo_epi16(u0, u2); // a0 b0 c0 d0 ... + __m128i v1 = _mm_unpacklo_epi16(u1, u3); // a4 b4 c4 d4 ... + __m128i v2 = _mm_unpackhi_epi16(u0, u2); // a2 b2 c2 d2 ... + __m128i v3 = _mm_unpackhi_epi16(u1, u3); // a6 b6 c6 d6 ... + + _mm_storeu_si128((__m128i*)ptr, v0); + _mm_storeu_si128((__m128i*)(ptr + 8), v2); + _mm_storeu_si128((__m128i*)(ptr + 16), v1); + _mm_storeu_si128((__m128i*)(ptr + 24), v3); +} + +inline void v_store_interleave( unsigned* ptr, const v_uint32x4& a, const v_uint32x4& b, + const v_uint32x4& c ) +{ + v_uint32x4 z = v_setzero_u32(), u0, u1, u2, u3; + v_transpose4x4(a, b, c, z, u0, u1, u2, u3); + + __m128i v0 = _mm_or_si128(u0.val, _mm_slli_si128(u1.val, 12)); + __m128i v1 = _mm_or_si128(_mm_srli_si128(u1.val, 4), _mm_slli_si128(u2.val, 8)); + __m128i v2 = _mm_or_si128(_mm_srli_si128(u2.val, 8), _mm_slli_si128(u3.val, 4)); + + _mm_storeu_si128((__m128i*)ptr, v0); + _mm_storeu_si128((__m128i*)(ptr + 4), v1); + _mm_storeu_si128((__m128i*)(ptr + 8), v2); +} + +inline void v_store_interleave(unsigned* ptr, const v_uint32x4& a, const v_uint32x4& b, + const v_uint32x4& c, const v_uint32x4& d) +{ + v_uint32x4 t0, t1, t2, t3; + v_transpose4x4(a, b, c, d, t0, t1, t2, t3); + v_store(ptr, t0); + v_store(ptr + 4, t1); + v_store(ptr + 8, t2); + v_store(ptr + 12, t3); +} + +#define OPENCV_HAL_IMPL_SSE_LOADSTORE_INTERLEAVE(_Tpvec, _Tp, suffix, _Tpuvec, _Tpu, usuffix) \ +inline void v_load_deinterleave( const _Tp* ptr, _Tpvec& a0, \ + _Tpvec& b0, _Tpvec& c0 ) \ +{ \ + _Tpuvec a1, b1, c1; \ + v_load_deinterleave((const _Tpu*)ptr, a1, b1, c1); \ + a0 = v_reinterpret_as_##suffix(a1); \ + b0 = v_reinterpret_as_##suffix(b1); \ + c0 = v_reinterpret_as_##suffix(c1); \ +} \ +inline void v_load_deinterleave( const _Tp* ptr, _Tpvec& a0, \ + _Tpvec& b0, _Tpvec& c0, _Tpvec& d0 ) \ +{ \ + _Tpuvec a1, b1, c1, d1; \ + v_load_deinterleave((const _Tpu*)ptr, a1, b1, c1, d1); \ + a0 = v_reinterpret_as_##suffix(a1); \ + b0 = v_reinterpret_as_##suffix(b1); \ + c0 = v_reinterpret_as_##suffix(c1); \ + d0 = v_reinterpret_as_##suffix(d1); \ +} \ +inline void v_store_interleave( _Tp* ptr, const _Tpvec& a0, \ + const _Tpvec& b0, const _Tpvec& c0 ) \ +{ \ + _Tpuvec a1 = v_reinterpret_as_##usuffix(a0); \ + _Tpuvec b1 = v_reinterpret_as_##usuffix(b0); \ + _Tpuvec c1 = v_reinterpret_as_##usuffix(c0); \ + v_store_interleave((_Tpu*)ptr, a1, b1, c1); \ +} \ +inline void v_store_interleave( _Tp* ptr, const _Tpvec& a0, const _Tpvec& b0, \ + const _Tpvec& c0, const _Tpvec& d0 ) \ +{ \ + _Tpuvec a1 = v_reinterpret_as_##usuffix(a0); \ + _Tpuvec b1 = v_reinterpret_as_##usuffix(b0); \ + _Tpuvec c1 = v_reinterpret_as_##usuffix(c0); \ + _Tpuvec d1 = v_reinterpret_as_##usuffix(d0); \ + v_store_interleave((_Tpu*)ptr, a1, b1, c1, d1); \ +} + +OPENCV_HAL_IMPL_SSE_LOADSTORE_INTERLEAVE(v_int8x16, schar, s8, v_uint8x16, uchar, u8) +OPENCV_HAL_IMPL_SSE_LOADSTORE_INTERLEAVE(v_int16x8, short, s16, v_uint16x8, ushort, u16) +OPENCV_HAL_IMPL_SSE_LOADSTORE_INTERLEAVE(v_int32x4, int, s32, v_uint32x4, unsigned, u32) +OPENCV_HAL_IMPL_SSE_LOADSTORE_INTERLEAVE(v_float32x4, float, f32, v_uint32x4, unsigned, u32) + +inline v_float32x4 v_cvt_f32(const v_int32x4& a) +{ + return v_float32x4(_mm_cvtepi32_ps(a.val)); +} + +inline v_float32x4 v_cvt_f32(const v_float64x2& a) +{ + return v_float32x4(_mm_cvtpd_ps(a.val)); +} + +inline v_float64x2 v_cvt_f64(const v_int32x4& a) +{ + return v_float64x2(_mm_cvtepi32_pd(a.val)); +} + +inline v_float64x2 v_cvt_f64(const v_float32x4& a) +{ + return v_float64x2(_mm_cvtps_pd(a.val)); +} + +//! @endcond + +} + +#endif diff --git a/lib/opencv/include/opencv2/core/ippasync.hpp b/lib/opencv/include/opencv2/core/ippasync.hpp new file mode 100644 index 000000000..4de8611db --- /dev/null +++ b/lib/opencv/include/opencv2/core/ippasync.hpp @@ -0,0 +1,195 @@ +/*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 + +#include "opencv2/core.hpp" +#include +#include + +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 diff --git a/lib/opencv/include/opencv2/core/mat.hpp b/lib/opencv/include/opencv2/core/mat.hpp new file mode 100644 index 000000000..ffec53865 --- /dev/null +++ b/lib/opencv/include/opencv2/core/mat.hpp @@ -0,0 +1,3431 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_MAT_HPP__ +#define __OPENCV_CORE_MAT_HPP__ + +#ifndef __cplusplus +# error mat.hpp header must be compiled as C++ +#endif + +#include "opencv2/core/matx.hpp" +#include "opencv2/core/types.hpp" + +#include "opencv2/core/bufferpool.hpp" + +namespace cv +{ + +//! @addtogroup core_basic +//! @{ + +enum { ACCESS_READ=1<<24, ACCESS_WRITE=1<<25, + ACCESS_RW=3<<24, ACCESS_MASK=ACCESS_RW, ACCESS_FAST=1<<26 }; + +class CV_EXPORTS _OutputArray; + +//////////////////////// Input/Output Array Arguments ///////////////////////////////// + +/** @brief This is the proxy class for passing read-only input arrays into OpenCV functions. + +It is defined as: +@code + typedef const _InputArray& InputArray; +@endcode +where _InputArray is a class that can be constructed from `Mat`, `Mat_`, `Matx`, +`std::vector`, `std::vector >` or `std::vector`. It can also be constructed +from a matrix expression. + +Since this is mostly implementation-level class, and its interface may change in future versions, we +do not describe it in details. There are a few key things, though, that should be kept in mind: + +- When you see in the reference manual or in OpenCV source code a function that takes + InputArray, it means that you can actually pass `Mat`, `Matx`, `vector` etc. (see above the + complete list). +- Optional input arguments: If some of the input arrays may be empty, pass cv::noArray() (or + simply cv::Mat() as you probably did before). +- The class is designed solely for passing parameters. That is, normally you *should not* + declare class members, local and global variables of this type. +- If you want to design your own function or a class method that can operate of arrays of + multiple types, you can use InputArray (or OutputArray) for the respective parameters. Inside + a function you should use _InputArray::getMat() method to construct a matrix header for the + array (without copying data). _InputArray::kind() can be used to distinguish Mat from + `vector<>` etc., but normally it is not needed. + +Here is how you can use a function that takes InputArray : +@code + std::vector vec; + // points or a circle + for( int i = 0; i < 30; i++ ) + vec.push_back(Point2f((float)(100 + 30*cos(i*CV_PI*2/5)), + (float)(100 - 30*sin(i*CV_PI*2/5)))); + cv::transform(vec, vec, cv::Matx23f(0.707, -0.707, 10, 0.707, 0.707, 20)); +@endcode +That is, we form an STL vector containing points, and apply in-place affine transformation to the +vector using the 2x3 matrix created inline as `Matx` instance. + +Here is how such a function can be implemented (for simplicity, we implement a very specific case of +it, according to the assertion statement inside) : +@code + void myAffineTransform(InputArray _src, OutputArray _dst, InputArray _m) + { + // get Mat headers for input arrays. This is O(1) operation, + // unless _src and/or _m are matrix expressions. + Mat src = _src.getMat(), m = _m.getMat(); + CV_Assert( src.type() == CV_32FC2 && m.type() == CV_32F && m.size() == Size(3, 2) ); + + // [re]create the output array so that it has the proper size and type. + // In case of Mat it calls Mat::create, in case of STL vector it calls vector::resize. + _dst.create(src.size(), src.type()); + Mat dst = _dst.getMat(); + + for( int i = 0; i < src.rows; i++ ) + for( int j = 0; j < src.cols; j++ ) + { + Point2f pt = src.at(i, j); + dst.at(i, j) = Point2f(m.at(0, 0)*pt.x + + m.at(0, 1)*pt.y + + m.at(0, 2), + m.at(1, 0)*pt.x + + m.at(1, 1)*pt.y + + m.at(1, 2)); + } + } +@endcode +There is another related type, InputArrayOfArrays, which is currently defined as a synonym for +InputArray: +@code + typedef InputArray InputArrayOfArrays; +@endcode +It denotes function arguments that are either vectors of vectors or vectors of matrices. A separate +synonym is needed to generate Python/Java etc. wrappers properly. At the function implementation +level their use is similar, but _InputArray::getMat(idx) should be used to get header for the +idx-th component of the outer vector and _InputArray::size().area() should be used to find the +number of components (vectors/matrices) of the outer vector. + */ +class CV_EXPORTS _InputArray +{ +public: + enum { + KIND_SHIFT = 16, + FIXED_TYPE = 0x8000 << KIND_SHIFT, + FIXED_SIZE = 0x4000 << KIND_SHIFT, + KIND_MASK = 31 << KIND_SHIFT, + + NONE = 0 << KIND_SHIFT, + MAT = 1 << KIND_SHIFT, + MATX = 2 << KIND_SHIFT, + STD_VECTOR = 3 << KIND_SHIFT, + STD_VECTOR_VECTOR = 4 << KIND_SHIFT, + STD_VECTOR_MAT = 5 << KIND_SHIFT, + EXPR = 6 << KIND_SHIFT, + OPENGL_BUFFER = 7 << KIND_SHIFT, + CUDA_HOST_MEM = 8 << KIND_SHIFT, + CUDA_GPU_MAT = 9 << KIND_SHIFT, + UMAT =10 << KIND_SHIFT, + STD_VECTOR_UMAT =11 << KIND_SHIFT, + STD_BOOL_VECTOR =12 << KIND_SHIFT, + STD_VECTOR_CUDA_GPU_MAT = 13 << KIND_SHIFT + }; + + _InputArray(); + _InputArray(int _flags, void* _obj); + _InputArray(const Mat& m); + _InputArray(const MatExpr& expr); + _InputArray(const std::vector& vec); + template _InputArray(const Mat_<_Tp>& m); + template _InputArray(const std::vector<_Tp>& vec); + _InputArray(const std::vector& vec); + template _InputArray(const std::vector >& vec); + template _InputArray(const std::vector >& vec); + template _InputArray(const _Tp* vec, int n); + template _InputArray(const Matx<_Tp, m, n>& matx); + _InputArray(const double& val); + _InputArray(const cuda::GpuMat& d_mat); + _InputArray(const std::vector& d_mat_array); + _InputArray(const ogl::Buffer& buf); + _InputArray(const cuda::HostMem& cuda_mem); + template _InputArray(const cudev::GpuMat_<_Tp>& m); + _InputArray(const UMat& um); + _InputArray(const std::vector& umv); + + Mat getMat(int idx=-1) const; + Mat getMat_(int idx=-1) const; + UMat getUMat(int idx=-1) const; + void getMatVector(std::vector& mv) const; + void getUMatVector(std::vector& umv) const; + void getGpuMatVector(std::vector& gpumv) const; + cuda::GpuMat getGpuMat() const; + ogl::Buffer getOGlBuffer() const; + + int getFlags() const; + void* getObj() const; + Size getSz() const; + + int kind() const; + int dims(int i=-1) const; + int cols(int i=-1) const; + int rows(int i=-1) const; + Size size(int i=-1) const; + int sizend(int* sz, int i=-1) const; + bool sameSize(const _InputArray& arr) const; + size_t total(int i=-1) const; + int type(int i=-1) const; + int depth(int i=-1) const; + int channels(int i=-1) const; + bool isContinuous(int i=-1) const; + bool isSubmatrix(int i=-1) const; + bool empty() const; + void copyTo(const _OutputArray& arr) const; + void copyTo(const _OutputArray& arr, const _InputArray & mask) const; + size_t offset(int i=-1) const; + size_t step(int i=-1) const; + bool isMat() const; + bool isUMat() const; + bool isMatVector() const; + bool isUMatVector() const; + bool isMatx() const; + bool isVector() const; + bool isGpuMatVector() const; + ~_InputArray(); + +protected: + int flags; + void* obj; + Size sz; + + void init(int _flags, const void* _obj); + void init(int _flags, const void* _obj, Size _sz); +}; + + +/** @brief This type is very similar to InputArray except that it is used for input/output and output function +parameters. + +Just like with InputArray, OpenCV users should not care about OutputArray, they just pass `Mat`, +`vector` etc. to the functions. The same limitation as for `InputArray`: *Do not explicitly +create OutputArray instances* applies here too. + +If you want to make your function polymorphic (i.e. accept different arrays as output parameters), +it is also not very difficult. Take the sample above as the reference. Note that +_OutputArray::create() needs to be called before _OutputArray::getMat(). This way you guarantee +that the output array is properly allocated. + +Optional output parameters. If you do not need certain output array to be computed and returned to +you, pass cv::noArray(), just like you would in the case of optional input array. At the +implementation level, use _OutputArray::needed() to check if certain output array needs to be +computed or not. + +There are several synonyms for OutputArray that are used to assist automatic Python/Java/... wrapper +generators: +@code + typedef OutputArray OutputArrayOfArrays; + typedef OutputArray InputOutputArray; + typedef OutputArray InputOutputArrayOfArrays; +@endcode + */ +class CV_EXPORTS _OutputArray : public _InputArray +{ +public: + enum + { + DEPTH_MASK_8U = 1 << CV_8U, + DEPTH_MASK_8S = 1 << CV_8S, + DEPTH_MASK_16U = 1 << CV_16U, + DEPTH_MASK_16S = 1 << CV_16S, + DEPTH_MASK_32S = 1 << CV_32S, + DEPTH_MASK_32F = 1 << CV_32F, + DEPTH_MASK_64F = 1 << CV_64F, + DEPTH_MASK_ALL = (DEPTH_MASK_64F<<1)-1, + DEPTH_MASK_ALL_BUT_8S = DEPTH_MASK_ALL & ~DEPTH_MASK_8S, + DEPTH_MASK_FLT = DEPTH_MASK_32F + DEPTH_MASK_64F + }; + + _OutputArray(); + _OutputArray(int _flags, void* _obj); + _OutputArray(Mat& m); + _OutputArray(std::vector& vec); + _OutputArray(cuda::GpuMat& d_mat); + _OutputArray(std::vector& d_mat); + _OutputArray(ogl::Buffer& buf); + _OutputArray(cuda::HostMem& cuda_mem); + template _OutputArray(cudev::GpuMat_<_Tp>& m); + template _OutputArray(std::vector<_Tp>& vec); + _OutputArray(std::vector& vec); + template _OutputArray(std::vector >& vec); + template _OutputArray(std::vector >& vec); + template _OutputArray(Mat_<_Tp>& m); + template _OutputArray(_Tp* vec, int n); + template _OutputArray(Matx<_Tp, m, n>& matx); + _OutputArray(UMat& m); + _OutputArray(std::vector& vec); + + _OutputArray(const Mat& m); + _OutputArray(const std::vector& vec); + _OutputArray(const cuda::GpuMat& d_mat); + _OutputArray(const std::vector& d_mat); + _OutputArray(const ogl::Buffer& buf); + _OutputArray(const cuda::HostMem& cuda_mem); + template _OutputArray(const cudev::GpuMat_<_Tp>& m); + template _OutputArray(const std::vector<_Tp>& vec); + template _OutputArray(const std::vector >& vec); + template _OutputArray(const std::vector >& vec); + template _OutputArray(const Mat_<_Tp>& m); + template _OutputArray(const _Tp* vec, int n); + template _OutputArray(const Matx<_Tp, m, n>& matx); + _OutputArray(const UMat& m); + _OutputArray(const std::vector& vec); + + bool fixedSize() const; + bool fixedType() const; + bool needed() const; + Mat& getMatRef(int i=-1) const; + UMat& getUMatRef(int i=-1) const; + cuda::GpuMat& getGpuMatRef() const; + std::vector& getGpuMatVecRef() const; + ogl::Buffer& getOGlBufferRef() const; + cuda::HostMem& getHostMemRef() const; + void create(Size sz, int type, int i=-1, bool allowTransposed=false, int fixedDepthMask=0) const; + void create(int rows, int cols, int type, int i=-1, bool allowTransposed=false, int fixedDepthMask=0) const; + void create(int dims, const int* size, int type, int i=-1, bool allowTransposed=false, int fixedDepthMask=0) const; + void createSameSize(const _InputArray& arr, int mtype) const; + void release() const; + void clear() const; + void setTo(const _InputArray& value, const _InputArray & mask = _InputArray()) const; + + void assign(const UMat& u) const; + void assign(const Mat& m) const; +}; + + +class CV_EXPORTS _InputOutputArray : public _OutputArray +{ +public: + _InputOutputArray(); + _InputOutputArray(int _flags, void* _obj); + _InputOutputArray(Mat& m); + _InputOutputArray(std::vector& vec); + _InputOutputArray(cuda::GpuMat& d_mat); + _InputOutputArray(ogl::Buffer& buf); + _InputOutputArray(cuda::HostMem& cuda_mem); + template _InputOutputArray(cudev::GpuMat_<_Tp>& m); + template _InputOutputArray(std::vector<_Tp>& vec); + _InputOutputArray(std::vector& vec); + template _InputOutputArray(std::vector >& vec); + template _InputOutputArray(std::vector >& vec); + template _InputOutputArray(Mat_<_Tp>& m); + template _InputOutputArray(_Tp* vec, int n); + template _InputOutputArray(Matx<_Tp, m, n>& matx); + _InputOutputArray(UMat& m); + _InputOutputArray(std::vector& vec); + + _InputOutputArray(const Mat& m); + _InputOutputArray(const std::vector& vec); + _InputOutputArray(const cuda::GpuMat& d_mat); + _InputOutputArray(const std::vector& d_mat); + _InputOutputArray(const ogl::Buffer& buf); + _InputOutputArray(const cuda::HostMem& cuda_mem); + template _InputOutputArray(const cudev::GpuMat_<_Tp>& m); + template _InputOutputArray(const std::vector<_Tp>& vec); + template _InputOutputArray(const std::vector >& vec); + template _InputOutputArray(const std::vector >& vec); + template _InputOutputArray(const Mat_<_Tp>& m); + template _InputOutputArray(const _Tp* vec, int n); + template _InputOutputArray(const Matx<_Tp, m, n>& matx); + _InputOutputArray(const UMat& m); + _InputOutputArray(const std::vector& vec); +}; + +typedef const _InputArray& InputArray; +typedef InputArray InputArrayOfArrays; +typedef const _OutputArray& OutputArray; +typedef OutputArray OutputArrayOfArrays; +typedef const _InputOutputArray& InputOutputArray; +typedef InputOutputArray InputOutputArrayOfArrays; + +CV_EXPORTS InputOutputArray noArray(); + +/////////////////////////////////// MatAllocator ////////////////////////////////////// + +//! Usage flags for allocator +enum UMatUsageFlags +{ + USAGE_DEFAULT = 0, + + // buffer allocation policy is platform and usage specific + USAGE_ALLOCATE_HOST_MEMORY = 1 << 0, + USAGE_ALLOCATE_DEVICE_MEMORY = 1 << 1, + USAGE_ALLOCATE_SHARED_MEMORY = 1 << 2, // It is not equal to: USAGE_ALLOCATE_HOST_MEMORY | USAGE_ALLOCATE_DEVICE_MEMORY + + __UMAT_USAGE_FLAGS_32BIT = 0x7fffffff // Binary compatibility hint +}; + +struct CV_EXPORTS UMatData; + +/** @brief Custom array allocator +*/ +class CV_EXPORTS MatAllocator +{ +public: + MatAllocator() {} + virtual ~MatAllocator() {} + + // let's comment it off for now to detect and fix all the uses of allocator + //virtual void allocate(int dims, const int* sizes, int type, int*& refcount, + // uchar*& datastart, uchar*& data, size_t* step) = 0; + //virtual void deallocate(int* refcount, uchar* datastart, uchar* data) = 0; + virtual UMatData* allocate(int dims, const int* sizes, int type, + void* data, size_t* step, int flags, UMatUsageFlags usageFlags) const = 0; + virtual bool allocate(UMatData* data, int accessflags, UMatUsageFlags usageFlags) const = 0; + virtual void deallocate(UMatData* data) const = 0; + virtual void map(UMatData* data, int accessflags) const; + virtual void unmap(UMatData* data) const; + virtual void download(UMatData* data, void* dst, int dims, const size_t sz[], + const size_t srcofs[], const size_t srcstep[], + const size_t dststep[]) const; + virtual void upload(UMatData* data, const void* src, int dims, const size_t sz[], + const size_t dstofs[], const size_t dststep[], + const size_t srcstep[]) const; + virtual void copy(UMatData* srcdata, UMatData* dstdata, int dims, const size_t sz[], + const size_t srcofs[], const size_t srcstep[], + const size_t dstofs[], const size_t dststep[], bool sync) const; + + // default implementation returns DummyBufferPoolController + virtual BufferPoolController* getBufferPoolController(const char* id = NULL) const; +}; + + +//////////////////////////////// MatCommaInitializer ////////////////////////////////// + +/** @brief Comma-separated Matrix Initializer + + The class instances are usually not created explicitly. + Instead, they are created on "matrix << firstValue" operator. + + The sample below initializes 2x2 rotation matrix: + + \code + double angle = 30, a = cos(angle*CV_PI/180), b = sin(angle*CV_PI/180); + Mat R = (Mat_(2,2) << a, -b, b, a); + \endcode +*/ +template class MatCommaInitializer_ +{ +public: + //! the constructor, created by "matrix << firstValue" operator, where matrix is cv::Mat + MatCommaInitializer_(Mat_<_Tp>* _m); + //! the operator that takes the next value and put it to the matrix + template MatCommaInitializer_<_Tp>& operator , (T2 v); + //! another form of conversion operator + operator Mat_<_Tp>() const; +protected: + MatIterator_<_Tp> it; +}; + + +/////////////////////////////////////// Mat /////////////////////////////////////////// + +// note that umatdata might be allocated together +// with the matrix data, not as a separate object. +// therefore, it does not have constructor or destructor; +// it should be explicitly initialized using init(). +struct CV_EXPORTS UMatData +{ + enum { COPY_ON_MAP=1, HOST_COPY_OBSOLETE=2, + DEVICE_COPY_OBSOLETE=4, TEMP_UMAT=8, TEMP_COPIED_UMAT=24, + USER_ALLOCATED=32, DEVICE_MEM_MAPPED=64}; + UMatData(const MatAllocator* allocator); + ~UMatData(); + + // provide atomic access to the structure + void lock(); + void unlock(); + + bool hostCopyObsolete() const; + bool deviceCopyObsolete() const; + bool deviceMemMapped() const; + bool copyOnMap() const; + bool tempUMat() const; + bool tempCopiedUMat() const; + void markHostCopyObsolete(bool flag); + void markDeviceCopyObsolete(bool flag); + void markDeviceMemMapped(bool flag); + + const MatAllocator* prevAllocator; + const MatAllocator* currAllocator; + int urefcount; + int refcount; + uchar* data; + uchar* origdata; + size_t size; + + int flags; + void* handle; + void* userdata; + int allocatorFlags_; + int mapcount; + UMatData* originalUMatData; +}; + + +struct CV_EXPORTS UMatDataAutoLock +{ + explicit UMatDataAutoLock(UMatData* u); + ~UMatDataAutoLock(); + UMatData* u; +}; + + +struct CV_EXPORTS MatSize +{ + explicit MatSize(int* _p); + Size operator()() const; + const int& operator[](int i) const; + int& operator[](int i); + operator const int*() const; + bool operator == (const MatSize& sz) const; + bool operator != (const MatSize& sz) const; + + int* p; +}; + +struct CV_EXPORTS MatStep +{ + MatStep(); + explicit MatStep(size_t s); + const size_t& operator[](int i) const; + size_t& operator[](int i); + operator size_t() const; + MatStep& operator = (size_t s); + + size_t* p; + size_t buf[2]; +protected: + MatStep& operator = (const MatStep&); +}; + +/** @example cout_mat.cpp +An example demonstrating the serial out capabilities of cv::Mat +*/ + + /** @brief n-dimensional dense array class + +The class Mat represents an n-dimensional dense numerical single-channel or multi-channel array. It +can be used to store real or complex-valued vectors and matrices, grayscale or color images, voxel +volumes, vector fields, point clouds, tensors, histograms (though, very high-dimensional histograms +may be better stored in a SparseMat ). The data layout of the array `M` is defined by the array +`M.step[]`, so that the address of element \f$(i_0,...,i_{M.dims-1})\f$, where \f$0\leq i_k= M.step[i+1]` (in fact, `M.step[i] >= M.step[i+1]*M.size[i+1]` ). This means +that 2-dimensional matrices are stored row-by-row, 3-dimensional matrices are stored plane-by-plane, +and so on. M.step[M.dims-1] is minimal and always equal to the element size M.elemSize() . + +So, the data layout in Mat is fully compatible with CvMat, IplImage, and CvMatND types from OpenCV +1.x. It is also compatible with the majority of dense array types from the standard toolkits and +SDKs, such as Numpy (ndarray), Win32 (independent device bitmaps), and others, that is, with any +array that uses *steps* (or *strides*) to compute the position of a pixel. Due to this +compatibility, it is possible to make a Mat header for user-allocated data and process it in-place +using OpenCV functions. + +There are many different ways to create a Mat object. The most popular options are listed below: + +- Use the create(nrows, ncols, type) method or the similar Mat(nrows, ncols, type[, fillValue]) +constructor. A new array of the specified size and type is allocated. type has the same meaning as +in the cvCreateMat method. For example, CV_8UC1 means a 8-bit single-channel array, CV_32FC2 +means a 2-channel (complex) floating-point array, and so on. +@code + // make a 7x7 complex matrix filled with 1+3j. + Mat M(7,7,CV_32FC2,Scalar(1,3)); + // and now turn M to a 100x60 15-channel 8-bit matrix. + // The old content will be deallocated + M.create(100,60,CV_8UC(15)); +@endcode +As noted in the introduction to this chapter, create() allocates only a new array when the shape +or type of the current array are different from the specified ones. + +- Create a multi-dimensional array: +@code + // create a 100x100x100 8-bit array + int sz[] = {100, 100, 100}; + Mat bigCube(3, sz, CV_8U, Scalar::all(0)); +@endcode +It passes the number of dimensions =1 to the Mat constructor but the created array will be +2-dimensional with the number of columns set to 1. So, Mat::dims is always \>= 2 (can also be 0 +when the array is empty). + +- Use a copy constructor or assignment operator where there can be an array or expression on the +right side (see below). As noted in the introduction, the array assignment is an O(1) operation +because it only copies the header and increases the reference counter. The Mat::clone() method can +be used to get a full (deep) copy of the array when you need it. + +- Construct a header for a part of another array. It can be a single row, single column, several +rows, several columns, rectangular region in the array (called a *minor* in algebra) or a +diagonal. Such operations are also O(1) because the new header references the same data. You can +actually modify a part of the array using this feature, for example: +@code + // add the 5-th row, multiplied by 3 to the 3rd row + M.row(3) = M.row(3) + M.row(5)*3; + // now copy the 7-th column to the 1-st column + // M.col(1) = M.col(7); // this will not work + Mat M1 = M.col(1); + M.col(7).copyTo(M1); + // create a new 320x240 image + Mat img(Size(320,240),CV_8UC3); + // select a ROI + Mat roi(img, Rect(10,10,100,100)); + // fill the ROI with (0,255,0) (which is green in RGB space); + // the original 320x240 image will be modified + roi = Scalar(0,255,0); +@endcode +Due to the additional datastart and dataend members, it is possible to compute a relative +sub-array position in the main *container* array using locateROI(): +@code + Mat A = Mat::eye(10, 10, CV_32S); + // extracts A columns, 1 (inclusive) to 3 (exclusive). + Mat B = A(Range::all(), Range(1, 3)); + // extracts B rows, 5 (inclusive) to 9 (exclusive). + // that is, C \~ A(Range(5, 9), Range(1, 3)) + Mat C = B(Range(5, 9), Range::all()); + Size size; Point ofs; + C.locateROI(size, ofs); + // size will be (width=10,height=10) and the ofs will be (x=1, y=5) +@endcode +As in case of whole matrices, if you need a deep copy, use the `clone()` method of the extracted +sub-matrices. + +- Make a header for user-allocated data. It can be useful to do the following: + -# Process "foreign" data using OpenCV (for example, when you implement a DirectShow\* filter or + a processing module for gstreamer, and so on). For example: + @code + void process_video_frame(const unsigned char* pixels, + int width, int height, int step) + { + Mat img(height, width, CV_8UC3, pixels, step); + GaussianBlur(img, img, Size(7,7), 1.5, 1.5); + } + @endcode + -# Quickly initialize small matrices and/or get a super-fast element access. + @code + double m[3][3] = {{a, b, c}, {d, e, f}, {g, h, i}}; + Mat M = Mat(3, 3, CV_64F, m).inv(); + @endcode + . + Partial yet very common cases of this *user-allocated data* case are conversions from CvMat and + IplImage to Mat. For this purpose, there is function cv::cvarrToMat taking pointers to CvMat or + IplImage and the optional flag indicating whether to copy the data or not. + @snippet samples/cpp/image.cpp iplimage + +- Use MATLAB-style array initializers, zeros(), ones(), eye(), for example: +@code + // create a double-precision identity martix and add it to M. + M += Mat::eye(M.rows, M.cols, CV_64F); +@endcode + +- Use a comma-separated initializer: +@code + // create a 3x3 double-precision identity matrix + Mat M = (Mat_(3,3) << 1, 0, 0, 0, 1, 0, 0, 0, 1); +@endcode +With this approach, you first call a constructor of the Mat class with the proper parameters, and +then you just put `<< operator` followed by comma-separated values that can be constants, +variables, expressions, and so on. Also, note the extra parentheses required to avoid compilation +errors. + +Once the array is created, it is automatically managed via a reference-counting mechanism. If the +array header is built on top of user-allocated data, you should handle the data by yourself. The +array data is deallocated when no one points to it. If you want to release the data pointed by a +array header before the array destructor is called, use Mat::release(). + +The next important thing to learn about the array class is element access. This manual already +described how to compute an address of each array element. Normally, you are not required to use the +formula directly in the code. If you know the array element type (which can be retrieved using the +method Mat::type() ), you can access the element \f$M_{ij}\f$ of a 2-dimensional array as: +@code + M.at(i,j) += 1.f; +@endcode +assuming that `M` is a double-precision floating-point array. There are several variants of the method +at for a different number of dimensions. + +If you need to process a whole row of a 2D array, the most efficient way is to get the pointer to +the row first, and then just use the plain C operator [] : +@code + // compute sum of positive matrix elements + // (assuming that M isa double-precision matrix) + double sum=0; + for(int i = 0; i < M.rows; i++) + { + const double* Mi = M.ptr(i); + for(int j = 0; j < M.cols; j++) + sum += std::max(Mi[j], 0.); + } +@endcode +Some operations, like the one above, do not actually depend on the array shape. They just process +elements of an array one by one (or elements from multiple arrays that have the same coordinates, +for example, array addition). Such operations are called *element-wise*. It makes sense to check +whether all the input/output arrays are continuous, namely, have no gaps at the end of each row. If +yes, process them as a long single row: +@code + // compute the sum of positive matrix elements, optimized variant + double sum=0; + int cols = M.cols, rows = M.rows; + if(M.isContinuous()) + { + cols *= rows; + rows = 1; + } + for(int i = 0; i < rows; i++) + { + const double* Mi = M.ptr(i); + for(int j = 0; j < cols; j++) + sum += std::max(Mi[j], 0.); + } +@endcode +In case of the continuous matrix, the outer loop body is executed just once. So, the overhead is +smaller, which is especially noticeable in case of small matrices. + +Finally, there are STL-style iterators that are smart enough to skip gaps between successive rows: +@code + // compute sum of positive matrix elements, iterator-based variant + double sum=0; + MatConstIterator_ it = M.begin(), it_end = M.end(); + for(; it != it_end; ++it) + sum += std::max(*it, 0.); +@endcode +The matrix iterators are random-access iterators, so they can be passed to any STL algorithm, +including std::sort(). +*/ +class CV_EXPORTS Mat +{ +public: + /** + These are various constructors that form a matrix. As noted in the AutomaticAllocation, often + the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. + The constructed matrix can further be assigned to another matrix or matrix expression or can be + allocated with Mat::create . In the former case, the old content is de-referenced. + */ + Mat(); + + /** @overload + @param rows Number of rows in a 2D array. + @param cols Number of columns in a 2D array. + @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or + CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices. + */ + Mat(int rows, int cols, int type); + + /** @overload + @param size 2D array size: Size(cols, rows) . In the Size() constructor, the number of rows and the + number of columns go in the reverse order. + @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or + CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices. + */ + Mat(Size size, int type); + + /** @overload + @param rows Number of rows in a 2D array. + @param cols Number of columns in a 2D array. + @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or + CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices. + @param s An optional value to initialize each matrix element with. To set all the matrix elements to + the particular value after the construction, use the assignment operator + Mat::operator=(const Scalar& value) . + */ + Mat(int rows, int cols, int type, const Scalar& s); + + /** @overload + @param size 2D array size: Size(cols, rows) . In the Size() constructor, the number of rows and the + number of columns go in the reverse order. + @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or + CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices. + @param s An optional value to initialize each matrix element with. To set all the matrix elements to + the particular value after the construction, use the assignment operator + Mat::operator=(const Scalar& value) . + */ + Mat(Size size, int type, const Scalar& s); + + /** @overload + @param ndims Array dimensionality. + @param sizes Array of integers specifying an n-dimensional array shape. + @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or + CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices. + */ + Mat(int ndims, const int* sizes, int type); + + /** @overload + @param ndims Array dimensionality. + @param sizes Array of integers specifying an n-dimensional array shape. + @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or + CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices. + @param s An optional value to initialize each matrix element with. To set all the matrix elements to + the particular value after the construction, use the assignment operator + Mat::operator=(const Scalar& value) . + */ + Mat(int ndims, const int* sizes, int type, const Scalar& s); + + /** @overload + @param m Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied + by these constructors. Instead, the header pointing to m data or its sub-array is constructed and + associated with it. The reference counter, if any, is incremented. So, when you modify the matrix + formed using such a constructor, you also modify the corresponding elements of m . If you want to + have an independent copy of the sub-array, use Mat::clone() . + */ + Mat(const Mat& m); + + /** @overload + @param rows Number of rows in a 2D array. + @param cols Number of columns in a 2D array. + @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or + CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices. + @param data Pointer to the user data. Matrix constructors that take data and step parameters do not + allocate matrix data. Instead, they just initialize the matrix header that points to the specified + data, which means that no data is copied. This operation is very efficient and can be used to + process external data using OpenCV functions. The external data is not automatically deallocated, so + you should take care of it. + @param step Number of bytes each matrix row occupies. The value should include the padding bytes at + the end of each row, if any. If the parameter is missing (set to AUTO_STEP ), no padding is assumed + and the actual step is calculated as cols*elemSize(). See Mat::elemSize. + */ + Mat(int rows, int cols, int type, void* data, size_t step=AUTO_STEP); + + /** @overload + @param size 2D array size: Size(cols, rows) . In the Size() constructor, the number of rows and the + number of columns go in the reverse order. + @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or + CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices. + @param data Pointer to the user data. Matrix constructors that take data and step parameters do not + allocate matrix data. Instead, they just initialize the matrix header that points to the specified + data, which means that no data is copied. This operation is very efficient and can be used to + process external data using OpenCV functions. The external data is not automatically deallocated, so + you should take care of it. + @param step Number of bytes each matrix row occupies. The value should include the padding bytes at + the end of each row, if any. If the parameter is missing (set to AUTO_STEP ), no padding is assumed + and the actual step is calculated as cols*elemSize(). See Mat::elemSize. + */ + Mat(Size size, int type, void* data, size_t step=AUTO_STEP); + + /** @overload + @param ndims Array dimensionality. + @param sizes Array of integers specifying an n-dimensional array shape. + @param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or + CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices. + @param data Pointer to the user data. Matrix constructors that take data and step parameters do not + allocate matrix data. Instead, they just initialize the matrix header that points to the specified + data, which means that no data is copied. This operation is very efficient and can be used to + process external data using OpenCV functions. The external data is not automatically deallocated, so + you should take care of it. + @param steps Array of ndims-1 steps in case of a multi-dimensional array (the last step is always + set to the element size). If not specified, the matrix is assumed to be continuous. + */ + Mat(int ndims, const int* sizes, int type, void* data, const size_t* steps=0); + + /** @overload + @param m Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied + by these constructors. Instead, the header pointing to m data or its sub-array is constructed and + associated with it. The reference counter, if any, is incremented. So, when you modify the matrix + formed using such a constructor, you also modify the corresponding elements of m . If you want to + have an independent copy of the sub-array, use Mat::clone() . + @param rowRange Range of the m rows to take. As usual, the range start is inclusive and the range + end is exclusive. Use Range::all() to take all the rows. + @param colRange Range of the m columns to take. Use Range::all() to take all the columns. + */ + Mat(const Mat& m, const Range& rowRange, const Range& colRange=Range::all()); + + /** @overload + @param m Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied + by these constructors. Instead, the header pointing to m data or its sub-array is constructed and + associated with it. The reference counter, if any, is incremented. So, when you modify the matrix + formed using such a constructor, you also modify the corresponding elements of m . If you want to + have an independent copy of the sub-array, use Mat::clone() . + @param roi Region of interest. + */ + Mat(const Mat& m, const Rect& roi); + + /** @overload + @param m Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied + by these constructors. Instead, the header pointing to m data or its sub-array is constructed and + associated with it. The reference counter, if any, is incremented. So, when you modify the matrix + formed using such a constructor, you also modify the corresponding elements of m . If you want to + have an independent copy of the sub-array, use Mat::clone() . + @param ranges Array of selected ranges of m along each dimensionality. + */ + Mat(const Mat& m, const Range* ranges); + + /** @overload + @param vec STL vector whose elements form the matrix. The matrix has a single column and the number + of rows equal to the number of vector elements. Type of the matrix matches the type of vector + elements. The constructor can handle arbitrary types, for which there is a properly declared + DataType . This means that the vector elements must be primitive numbers or uni-type numerical + tuples of numbers. Mixed-type structures are not supported. The corresponding constructor is + explicit. Since STL vectors are not automatically converted to Mat instances, you should write + Mat(vec) explicitly. Unless you copy the data into the matrix ( copyData=true ), no new elements + will be added to the vector because it can potentially yield vector data reallocation, and, thus, + the matrix data pointer will be invalid. + @param copyData Flag to specify whether the underlying data of the STL vector should be copied + to (true) or shared with (false) the newly constructed matrix. When the data is copied, the + allocated buffer is managed using Mat reference counting mechanism. While the data is shared, + the reference counter is NULL, and you should not deallocate the data until the matrix is not + destructed. + */ + template explicit Mat(const std::vector<_Tp>& vec, bool copyData=false); + + /** @overload + */ + template explicit Mat(const Vec<_Tp, n>& vec, bool copyData=true); + + /** @overload + */ + template explicit Mat(const Matx<_Tp, m, n>& mtx, bool copyData=true); + + /** @overload + */ + template explicit Mat(const Point_<_Tp>& pt, bool copyData=true); + + /** @overload + */ + template explicit Mat(const Point3_<_Tp>& pt, bool copyData=true); + + /** @overload + */ + template explicit Mat(const MatCommaInitializer_<_Tp>& commaInitializer); + + //! download data from GpuMat + explicit Mat(const cuda::GpuMat& m); + + //! destructor - calls release() + ~Mat(); + + /** @brief assignment operators + + These are available assignment operators. Since they all are very different, make sure to read the + operator parameters description. + @param m Assigned, right-hand-side matrix. Matrix assignment is an O(1) operation. This means that + no data is copied but the data is shared and the reference counter, if any, is incremented. Before + assigning new data, the old data is de-referenced via Mat::release . + */ + Mat& operator = (const Mat& m); + + /** @overload + @param expr Assigned matrix expression object. As opposite to the first form of the assignment + operation, the second form can reuse already allocated matrix if it has the right size and type to + fit the matrix expression result. It is automatically handled by the real function that the matrix + expressions is expanded to. For example, C=A+B is expanded to add(A, B, C), and add takes care of + automatic C reallocation. + */ + Mat& operator = (const MatExpr& expr); + + //! retrieve UMat from Mat + UMat getUMat(int accessFlags, UMatUsageFlags usageFlags = USAGE_DEFAULT) const; + + /** @brief Creates a matrix header for the specified matrix row. + + The method makes a new header for the specified matrix row and returns it. This is an O(1) + operation, regardless of the matrix size. The underlying data of the new matrix is shared with the + original matrix. Here is the example of one of the classical basic matrix processing operations, + axpy, used by LU and many other algorithms: + @code + inline void matrix_axpy(Mat& A, int i, int j, double alpha) + { + A.row(i) += A.row(j)*alpha; + } + @endcode + @note In the current implementation, the following code does not work as expected: + @code + Mat A; + ... + A.row(i) = A.row(j); // will not work + @endcode + This happens because A.row(i) forms a temporary header that is further assigned to another header. + Remember that each of these operations is O(1), that is, no data is copied. Thus, the above + assignment is not true if you may have expected the j-th row to be copied to the i-th row. To + achieve that, you should either turn this simple assignment into an expression or use the + Mat::copyTo method: + @code + Mat A; + ... + // works, but looks a bit obscure. + A.row(i) = A.row(j) + 0; + // this is a bit longer, but the recommended method. + A.row(j).copyTo(A.row(i)); + @endcode + @param y A 0-based row index. + */ + Mat row(int y) const; + + /** @brief Creates a matrix header for the specified matrix column. + + The method makes a new header for the specified matrix column and returns it. This is an O(1) + operation, regardless of the matrix size. The underlying data of the new matrix is shared with the + original matrix. See also the Mat::row description. + @param x A 0-based column index. + */ + Mat col(int x) const; + + /** @brief Creates a matrix header for the specified row span. + + The method makes a new header for the specified row span of the matrix. Similarly to Mat::row and + Mat::col , this is an O(1) operation. + @param startrow An inclusive 0-based start index of the row span. + @param endrow An exclusive 0-based ending index of the row span. + */ + Mat rowRange(int startrow, int endrow) const; + + /** @overload + @param r Range structure containing both the start and the end indices. + */ + Mat rowRange(const Range& r) const; + + /** @brief Creates a matrix header for the specified column span. + + The method makes a new header for the specified column span of the matrix. Similarly to Mat::row and + Mat::col , this is an O(1) operation. + @param startcol An inclusive 0-based start index of the column span. + @param endcol An exclusive 0-based ending index of the column span. + */ + Mat colRange(int startcol, int endcol) const; + + /** @overload + @param r Range structure containing both the start and the end indices. + */ + Mat colRange(const Range& r) const; + + /** @brief Extracts a diagonal from a matrix + + The method makes a new header for the specified matrix diagonal. The new matrix is represented as a + single-column matrix. Similarly to Mat::row and Mat::col, this is an O(1) operation. + @param d index of the diagonal, with the following values: + - `d=0` is the main diagonal. + - `d>0` is a diagonal from the lower half. For example, d=1 means the diagonal is set + immediately below the main one. + - `d<0` is a diagonal from the upper half. For example, d=-1 means the diagonal is set + immediately above the main one. + */ + Mat diag(int d=0) const; + + /** @brief creates a diagonal matrix + + The method makes a new header for the specified matrix diagonal. The new matrix is represented as a + single-column matrix. Similarly to Mat::row and Mat::col, this is an O(1) operation. + @param d Single-column matrix that forms a diagonal matrix + */ + static Mat diag(const Mat& d); + + /** @brief Creates a full copy of the array and the underlying data. + + The method creates a full copy of the array. The original step[] is not taken into account. So, the + array copy is a continuous array occupying total()*elemSize() bytes. + */ + Mat clone() const; + + /** @brief Copies the matrix to another one. + + The method copies the matrix data to another matrix. Before copying the data, the method invokes : + @code + m.create(this->size(), this->type()); + @endcode + so that the destination matrix is reallocated if needed. While m.copyTo(m); works flawlessly, the + function does not handle the case of a partial overlap between the source and the destination + matrices. + + When the operation mask is specified, if the Mat::create call shown above reallocates the matrix, + the newly allocated matrix is initialized with all zeros before copying the data. + @param m Destination matrix. If it does not have a proper size or type before the operation, it is + reallocated. + */ + void copyTo( OutputArray m ) const; + + /** @overload + @param m Destination matrix. If it does not have a proper size or type before the operation, it is + reallocated. + @param mask Operation mask. Its non-zero elements indicate which matrix elements need to be copied. + The mask has to be of type CV_8U and can have 1 or multiple channels. + */ + void copyTo( OutputArray m, InputArray mask ) const; + + /** @brief Converts an array to another data type with optional scaling. + + The method converts source pixel values to the target data type. saturate_cast\<\> is applied at + the end to avoid possible overflows: + + \f[m(x,y) = saturate \_ cast( \alpha (*this)(x,y) + \beta )\f] + @param m output matrix; if it does not have a proper size or type before the operation, it is + reallocated. + @param rtype desired output matrix type or, rather, the depth since the number of channels are the + same as the input has; if rtype is negative, the output matrix will have the same type as the input. + @param alpha optional scale factor. + @param beta optional delta added to the scaled values. + */ + void convertTo( OutputArray m, int rtype, double alpha=1, double beta=0 ) const; + + /** @brief Provides a functional form of convertTo. + + This is an internally used method called by the @ref MatrixExpressions engine. + @param m Destination array. + @param type Desired destination array depth (or -1 if it should be the same as the source type). + */ + void assignTo( Mat& m, int type=-1 ) const; + + /** @brief Sets all or some of the array elements to the specified value. + @param s Assigned scalar converted to the actual array type. + */ + Mat& operator = (const Scalar& s); + + /** @brief Sets all or some of the array elements to the specified value. + + This is an advanced variant of the Mat::operator=(const Scalar& s) operator. + @param value Assigned scalar converted to the actual array type. + @param mask Operation mask of the same size as \*this. + */ + Mat& setTo(InputArray value, InputArray mask=noArray()); + + /** @brief Changes the shape and/or the number of channels of a 2D matrix without copying the data. + + The method makes a new matrix header for \*this elements. The new matrix may have a different size + and/or different number of channels. Any combination is possible if: + - No extra elements are included into the new matrix and no elements are excluded. Consequently, + the product rows\*cols\*channels() must stay the same after the transformation. + - No data is copied. That is, this is an O(1) operation. Consequently, if you change the number of + rows, or the operation changes the indices of elements row in some other way, the matrix must be + continuous. See Mat::isContinuous . + + For example, if there is a set of 3D points stored as an STL vector, and you want to represent the + points as a 3xN matrix, do the following: + @code + std::vector vec; + ... + Mat pointMat = Mat(vec). // convert vector to Mat, O(1) operation + reshape(1). // make Nx3 1-channel matrix out of Nx1 3-channel. + // Also, an O(1) operation + t(); // finally, transpose the Nx3 matrix. + // This involves copying all the elements + @endcode + @param cn New number of channels. If the parameter is 0, the number of channels remains the same. + @param rows New number of rows. If the parameter is 0, the number of rows remains the same. + */ + Mat reshape(int cn, int rows=0) const; + + /** @overload */ + Mat reshape(int cn, int newndims, const int* newsz) const; + + /** @brief Transposes a matrix. + + The method performs matrix transposition by means of matrix expressions. It does not perform the + actual transposition but returns a temporary matrix transposition object that can be further used as + a part of more complex matrix expressions or can be assigned to a matrix: + @code + Mat A1 = A + Mat::eye(A.size(), A.type())*lambda; + Mat C = A1.t()*A1; // compute (A + lambda*I)^t * (A + lamda*I) + @endcode + */ + MatExpr t() const; + + /** @brief Inverses a matrix. + + The method performs a matrix inversion by means of matrix expressions. This means that a temporary + matrix inversion object is returned by the method and can be used further as a part of more complex + matrix expressions or can be assigned to a matrix. + @param method Matrix inversion method. One of cv::DecompTypes + */ + MatExpr inv(int method=DECOMP_LU) const; + + /** @brief Performs an element-wise multiplication or division of the two matrices. + + The method returns a temporary object encoding per-element array multiplication, with optional + scale. Note that this is not a matrix multiplication that corresponds to a simpler "\*" operator. + + Example: + @code + Mat C = A.mul(5/B); // equivalent to divide(A, B, C, 5) + @endcode + @param m Another array of the same type and the same size as \*this, or a matrix expression. + @param scale Optional scale factor. + */ + MatExpr mul(InputArray m, double scale=1) const; + + /** @brief Computes a cross-product of two 3-element vectors. + + The method computes a cross-product of two 3-element vectors. The vectors must be 3-element + floating-point vectors of the same shape and size. The result is another 3-element vector of the + same shape and type as operands. + @param m Another cross-product operand. + */ + Mat cross(InputArray m) const; + + /** @brief Computes a dot-product of two vectors. + + The method computes a dot-product of two matrices. If the matrices are not single-column or + single-row vectors, the top-to-bottom left-to-right scan ordering is used to treat them as 1D + vectors. The vectors must have the same size and type. If the matrices have more than one channel, + the dot products from all the channels are summed together. + @param m another dot-product operand. + */ + double dot(InputArray m) const; + + /** @brief Returns a zero array of the specified size and type. + + The method returns a Matlab-style zero array initializer. It can be used to quickly form a constant + array as a function parameter, part of a matrix expression, or as a matrix initializer. : + @code + Mat A; + A = Mat::zeros(3, 3, CV_32F); + @endcode + In the example above, a new matrix is allocated only if A is not a 3x3 floating-point matrix. + Otherwise, the existing matrix A is filled with zeros. + @param rows Number of rows. + @param cols Number of columns. + @param type Created matrix type. + */ + static MatExpr zeros(int rows, int cols, int type); + + /** @overload + @param size Alternative to the matrix size specification Size(cols, rows) . + @param type Created matrix type. + */ + static MatExpr zeros(Size size, int type); + + /** @overload + @param ndims Array dimensionality. + @param sz Array of integers specifying the array shape. + @param type Created matrix type. + */ + static MatExpr zeros(int ndims, const int* sz, int type); + + /** @brief Returns an array of all 1's of the specified size and type. + + The method returns a Matlab-style 1's array initializer, similarly to Mat::zeros. Note that using + this method you can initialize an array with an arbitrary value, using the following Matlab idiom: + @code + Mat A = Mat::ones(100, 100, CV_8U)*3; // make 100x100 matrix filled with 3. + @endcode + The above operation does not form a 100x100 matrix of 1's and then multiply it by 3. Instead, it + just remembers the scale factor (3 in this case) and use it when actually invoking the matrix + initializer. + @param rows Number of rows. + @param cols Number of columns. + @param type Created matrix type. + */ + static MatExpr ones(int rows, int cols, int type); + + /** @overload + @param size Alternative to the matrix size specification Size(cols, rows) . + @param type Created matrix type. + */ + static MatExpr ones(Size size, int type); + + /** @overload + @param ndims Array dimensionality. + @param sz Array of integers specifying the array shape. + @param type Created matrix type. + */ + static MatExpr ones(int ndims, const int* sz, int type); + + /** @brief Returns an identity matrix of the specified size and type. + + The method returns a Matlab-style identity matrix initializer, similarly to Mat::zeros. Similarly to + Mat::ones, you can use a scale operation to create a scaled identity matrix efficiently: + @code + // make a 4x4 diagonal matrix with 0.1's on the diagonal. + Mat A = Mat::eye(4, 4, CV_32F)*0.1; + @endcode + @param rows Number of rows. + @param cols Number of columns. + @param type Created matrix type. + */ + static MatExpr eye(int rows, int cols, int type); + + /** @overload + @param size Alternative matrix size specification as Size(cols, rows) . + @param type Created matrix type. + */ + static MatExpr eye(Size size, int type); + + /** @brief Allocates new array data if needed. + + This is one of the key Mat methods. Most new-style OpenCV functions and methods that produce arrays + call this method for each output array. The method uses the following algorithm: + + -# If the current array shape and the type match the new ones, return immediately. Otherwise, + de-reference the previous data by calling Mat::release. + -# Initialize the new header. + -# Allocate the new data of total()\*elemSize() bytes. + -# Allocate the new, associated with the data, reference counter and set it to 1. + + Such a scheme makes the memory management robust and efficient at the same time and helps avoid + extra typing for you. This means that usually there is no need to explicitly allocate output arrays. + That is, instead of writing: + @code + Mat color; + ... + Mat gray(color.rows, color.cols, color.depth()); + cvtColor(color, gray, COLOR_BGR2GRAY); + @endcode + you can simply write: + @code + Mat color; + ... + Mat gray; + cvtColor(color, gray, COLOR_BGR2GRAY); + @endcode + because cvtColor, as well as the most of OpenCV functions, calls Mat::create() for the output array + internally. + @param rows New number of rows. + @param cols New number of columns. + @param type New matrix type. + */ + void create(int rows, int cols, int type); + + /** @overload + @param size Alternative new matrix size specification: Size(cols, rows) + @param type New matrix type. + */ + void create(Size size, int type); + + /** @overload + @param ndims New array dimensionality. + @param sizes Array of integers specifying a new array shape. + @param type New matrix type. + */ + void create(int ndims, const int* sizes, int type); + + /** @brief Increments the reference counter. + + The method increments the reference counter associated with the matrix data. If the matrix header + points to an external data set (see Mat::Mat ), the reference counter is NULL, and the method has no + effect in this case. Normally, to avoid memory leaks, the method should not be called explicitly. It + is called implicitly by the matrix assignment operator. The reference counter increment is an atomic + operation on the platforms that support it. Thus, it is safe to operate on the same matrices + asynchronously in different threads. + */ + void addref(); + + /** @brief Decrements the reference counter and deallocates the matrix if needed. + + The method decrements the reference counter associated with the matrix data. When the reference + counter reaches 0, the matrix data is deallocated and the data and the reference counter pointers + are set to NULL's. If the matrix header points to an external data set (see Mat::Mat ), the + reference counter is NULL, and the method has no effect in this case. + + This method can be called manually to force the matrix data deallocation. But since this method is + automatically called in the destructor, or by any other method that changes the data pointer, it is + usually not needed. The reference counter decrement and check for 0 is an atomic operation on the + platforms that support it. Thus, it is safe to operate on the same matrices asynchronously in + different threads. + */ + void release(); + + //! deallocates the matrix data + void deallocate(); + //! internal use function; properly re-allocates _size, _step arrays + void copySize(const Mat& m); + + /** @brief Reserves space for the certain number of rows. + + The method reserves space for sz rows. If the matrix already has enough space to store sz rows, + nothing happens. If the matrix is reallocated, the first Mat::rows rows are preserved. The method + emulates the corresponding method of the STL vector class. + @param sz Number of rows. + */ + void reserve(size_t sz); + + /** @brief Changes the number of matrix rows. + + The methods change the number of matrix rows. If the matrix is reallocated, the first + min(Mat::rows, sz) rows are preserved. The methods emulate the corresponding methods of the STL + vector class. + @param sz New number of rows. + */ + void resize(size_t sz); + + /** @overload + @param sz New number of rows. + @param s Value assigned to the newly added elements. + */ + void resize(size_t sz, const Scalar& s); + + //! internal function + void push_back_(const void* elem); + + /** @brief Adds elements to the bottom of the matrix. + + The methods add one or more elements to the bottom of the matrix. They emulate the corresponding + method of the STL vector class. When elem is Mat , its type and the number of columns must be the + same as in the container matrix. + @param elem Added element(s). + */ + template void push_back(const _Tp& elem); + + /** @overload + @param elem Added element(s). + */ + template void push_back(const Mat_<_Tp>& elem); + + /** @overload + @param m Added line(s). + */ + void push_back(const Mat& m); + + /** @brief Removes elements from the bottom of the matrix. + + The method removes one or more rows from the bottom of the matrix. + @param nelems Number of removed rows. If it is greater than the total number of rows, an exception + is thrown. + */ + void pop_back(size_t nelems=1); + + /** @brief Locates the matrix header within a parent matrix. + + After you extracted a submatrix from a matrix using Mat::row, Mat::col, Mat::rowRange, + Mat::colRange, and others, the resultant submatrix points just to the part of the original big + matrix. However, each submatrix contains information (represented by datastart and dataend + fields) that helps reconstruct the original matrix size and the position of the extracted + submatrix within the original matrix. The method locateROI does exactly that. + @param wholeSize Output parameter that contains the size of the whole matrix containing *this* + as a part. + @param ofs Output parameter that contains an offset of *this* inside the whole matrix. + */ + void locateROI( Size& wholeSize, Point& ofs ) const; + + /** @brief Adjusts a submatrix size and position within the parent matrix. + + The method is complimentary to Mat::locateROI . The typical use of these functions is to determine + the submatrix position within the parent matrix and then shift the position somehow. Typically, it + can be required for filtering operations when pixels outside of the ROI should be taken into + account. When all the method parameters are positive, the ROI needs to grow in all directions by the + specified amount, for example: + @code + A.adjustROI(2, 2, 2, 2); + @endcode + In this example, the matrix size is increased by 4 elements in each direction. The matrix is shifted + by 2 elements to the left and 2 elements up, which brings in all the necessary pixels for the + filtering with the 5x5 kernel. + + adjustROI forces the adjusted ROI to be inside of the parent matrix that is boundaries of the + adjusted ROI are constrained by boundaries of the parent matrix. For example, if the submatrix A is + located in the first row of a parent matrix and you called A.adjustROI(2, 2, 2, 2) then A will not + be increased in the upward direction. + + The function is used internally by the OpenCV filtering functions, like filter2D , morphological + operations, and so on. + @param dtop Shift of the top submatrix boundary upwards. + @param dbottom Shift of the bottom submatrix boundary downwards. + @param dleft Shift of the left submatrix boundary to the left. + @param dright Shift of the right submatrix boundary to the right. + @sa copyMakeBorder + */ + Mat& adjustROI( int dtop, int dbottom, int dleft, int dright ); + + /** @brief Extracts a rectangular submatrix. + + The operators make a new header for the specified sub-array of \*this . They are the most + generalized forms of Mat::row, Mat::col, Mat::rowRange, and Mat::colRange . For example, + `A(Range(0, 10), Range::all())` is equivalent to `A.rowRange(0, 10)`. Similarly to all of the above, + the operators are O(1) operations, that is, no matrix data is copied. + @param rowRange Start and end row of the extracted submatrix. The upper boundary is not included. To + select all the rows, use Range::all(). + @param colRange Start and end column of the extracted submatrix. The upper boundary is not included. + To select all the columns, use Range::all(). + */ + Mat operator()( Range rowRange, Range colRange ) const; + + /** @overload + @param roi Extracted submatrix specified as a rectangle. + */ + Mat operator()( const Rect& roi ) const; + + /** @overload + @param ranges Array of selected ranges along each array dimension. + */ + Mat operator()( const Range* ranges ) const; + + // //! converts header to CvMat; no data is copied + // operator CvMat() const; + // //! converts header to CvMatND; no data is copied + // operator CvMatND() const; + // //! converts header to IplImage; no data is copied + // operator IplImage() const; + + template operator std::vector<_Tp>() const; + template operator Vec<_Tp, n>() const; + template operator Matx<_Tp, m, n>() const; + + /** @brief Reports whether the matrix is continuous or not. + + The method returns true if the matrix elements are stored continuously without gaps at the end of + each row. Otherwise, it returns false. Obviously, 1x1 or 1xN matrices are always continuous. + Matrices created with Mat::create are always continuous. But if you extract a part of the matrix + using Mat::col, Mat::diag, and so on, or constructed a matrix header for externally allocated data, + such matrices may no longer have this property. + + The continuity flag is stored as a bit in the Mat::flags field and is computed automatically when + you construct a matrix header. Thus, the continuity check is a very fast operation, though + theoretically it could be done as follows: + @code + // alternative implementation of Mat::isContinuous() + bool myCheckMatContinuity(const Mat& m) + { + //return (m.flags & Mat::CONTINUOUS_FLAG) != 0; + return m.rows == 1 || m.step == m.cols*m.elemSize(); + } + @endcode + The method is used in quite a few of OpenCV functions. The point is that element-wise operations + (such as arithmetic and logical operations, math functions, alpha blending, color space + transformations, and others) do not depend on the image geometry. Thus, if all the input and output + arrays are continuous, the functions can process them as very long single-row vectors. The example + below illustrates how an alpha-blending function can be implemented: + @code + template + void alphaBlendRGBA(const Mat& src1, const Mat& src2, Mat& dst) + { + const float alpha_scale = (float)std::numeric_limits::max(), + inv_scale = 1.f/alpha_scale; + + CV_Assert( src1.type() == src2.type() && + src1.type() == CV_MAKETYPE(DataType::depth, 4) && + src1.size() == src2.size()); + Size size = src1.size(); + dst.create(size, src1.type()); + + // here is the idiom: check the arrays for continuity and, + // if this is the case, + // treat the arrays as 1D vectors + if( src1.isContinuous() && src2.isContinuous() && dst.isContinuous() ) + { + size.width *= size.height; + size.height = 1; + } + size.width *= 4; + + for( int i = 0; i < size.height; i++ ) + { + // when the arrays are continuous, + // the outer loop is executed only once + const T* ptr1 = src1.ptr(i); + const T* ptr2 = src2.ptr(i); + T* dptr = dst.ptr(i); + + for( int j = 0; j < size.width; j += 4 ) + { + float alpha = ptr1[j+3]*inv_scale, beta = ptr2[j+3]*inv_scale; + dptr[j] = saturate_cast(ptr1[j]*alpha + ptr2[j]*beta); + dptr[j+1] = saturate_cast(ptr1[j+1]*alpha + ptr2[j+1]*beta); + dptr[j+2] = saturate_cast(ptr1[j+2]*alpha + ptr2[j+2]*beta); + dptr[j+3] = saturate_cast((1 - (1-alpha)*(1-beta))*alpha_scale); + } + } + } + @endcode + This approach, while being very simple, can boost the performance of a simple element-operation by + 10-20 percents, especially if the image is rather small and the operation is quite simple. + + Another OpenCV idiom in this function, a call of Mat::create for the destination array, that + allocates the destination array unless it already has the proper size and type. And while the newly + allocated arrays are always continuous, you still need to check the destination array because + Mat::create does not always allocate a new matrix. + */ + bool isContinuous() const; + + //! returns true if the matrix is a submatrix of another matrix + bool isSubmatrix() const; + + /** @brief Returns the matrix element size in bytes. + + The method returns the matrix element size in bytes. For example, if the matrix type is CV_16SC3 , + the method returns 3\*sizeof(short) or 6. + */ + size_t elemSize() const; + + /** @brief Returns the size of each matrix element channel in bytes. + + The method returns the matrix element channel size in bytes, that is, it ignores the number of + channels. For example, if the matrix type is CV_16SC3 , the method returns sizeof(short) or 2. + */ + size_t elemSize1() const; + + /** @brief Returns the type of a matrix element. + + The method returns a matrix element type. This is an identifier compatible with the CvMat type + system, like CV_16SC3 or 16-bit signed 3-channel array, and so on. + */ + int type() const; + + /** @brief Returns the depth of a matrix element. + + The method returns the identifier of the matrix element depth (the type of each individual channel). + For example, for a 16-bit signed element array, the method returns CV_16S . A complete list of + matrix types contains the following values: + - CV_8U - 8-bit unsigned integers ( 0..255 ) + - CV_8S - 8-bit signed integers ( -128..127 ) + - CV_16U - 16-bit unsigned integers ( 0..65535 ) + - CV_16S - 16-bit signed integers ( -32768..32767 ) + - CV_32S - 32-bit signed integers ( -2147483648..2147483647 ) + - CV_32F - 32-bit floating-point numbers ( -FLT_MAX..FLT_MAX, INF, NAN ) + - CV_64F - 64-bit floating-point numbers ( -DBL_MAX..DBL_MAX, INF, NAN ) + */ + int depth() const; + + /** @brief Returns the number of matrix channels. + + The method returns the number of matrix channels. + */ + int channels() const; + + /** @brief Returns a normalized step. + + The method returns a matrix step divided by Mat::elemSize1() . It can be useful to quickly access an + arbitrary matrix element. + */ + size_t step1(int i=0) const; + + /** @brief Returns true if the array has no elements. + + The method returns true if Mat::total() is 0 or if Mat::data is NULL. Because of pop_back() and + resize() methods `M.total() == 0` does not imply that `M.data == NULL`. + */ + bool empty() const; + + /** @brief Returns the total number of array elements. + + The method returns the number of array elements (a number of pixels if the array represents an + image). + */ + size_t total() const; + + //! returns N if the matrix is 1-channel (N x ptdim) or ptdim-channel (1 x N) or (N x 1); negative number otherwise + int checkVector(int elemChannels, int depth=-1, bool requireContinuous=true) const; + + /** @brief Returns a pointer to the specified matrix row. + + The methods return `uchar*` or typed pointer to the specified matrix row. See the sample in + Mat::isContinuous to know how to use these methods. + @param i0 A 0-based row index. + */ + uchar* ptr(int i0=0); + /** @overload */ + const uchar* ptr(int i0=0) const; + + /** @overload */ + uchar* ptr(int i0, int i1); + /** @overload */ + const uchar* ptr(int i0, int i1) const; + + /** @overload */ + uchar* ptr(int i0, int i1, int i2); + /** @overload */ + const uchar* ptr(int i0, int i1, int i2) const; + + /** @overload */ + uchar* ptr(const int* idx); + /** @overload */ + const uchar* ptr(const int* idx) const; + /** @overload */ + template uchar* ptr(const Vec& idx); + /** @overload */ + template const uchar* ptr(const Vec& idx) const; + + /** @overload */ + template _Tp* ptr(int i0=0); + /** @overload */ + template const _Tp* ptr(int i0=0) const; + /** @overload */ + template _Tp* ptr(int i0, int i1); + /** @overload */ + template const _Tp* ptr(int i0, int i1) const; + /** @overload */ + template _Tp* ptr(int i0, int i1, int i2); + /** @overload */ + template const _Tp* ptr(int i0, int i1, int i2) const; + /** @overload */ + template _Tp* ptr(const int* idx); + /** @overload */ + template const _Tp* ptr(const int* idx) const; + /** @overload */ + template _Tp* ptr(const Vec& idx); + /** @overload */ + template const _Tp* ptr(const Vec& idx) const; + + /** @brief Returns a reference to the specified array element. + + The template methods return a reference to the specified array element. For the sake of higher + performance, the index range checks are only performed in the Debug configuration. + + Note that the variants with a single index (i) can be used to access elements of single-row or + single-column 2-dimensional arrays. That is, if, for example, A is a 1 x N floating-point matrix and + B is an M x 1 integer matrix, you can simply write `A.at(k+4)` and `B.at(2*i+1)` + instead of `A.at(0,k+4)` and `B.at(2*i+1,0)`, respectively. + + The example below initializes a Hilbert matrix: + @code + Mat H(100, 100, CV_64F); + for(int i = 0; i < H.rows; i++) + for(int j = 0; j < H.cols; j++) + H.at(i,j)=1./(i+j+1); + @endcode + @param i0 Index along the dimension 0 + */ + template _Tp& at(int i0=0); + /** @overload + @param i0 Index along the dimension 0 + */ + template const _Tp& at(int i0=0) const; + /** @overload + @param i0 Index along the dimension 0 + @param i1 Index along the dimension 1 + */ + template _Tp& at(int i0, int i1); + /** @overload + @param i0 Index along the dimension 0 + @param i1 Index along the dimension 1 + */ + template const _Tp& at(int i0, int i1) const; + + /** @overload + @param i0 Index along the dimension 0 + @param i1 Index along the dimension 1 + @param i2 Index along the dimension 2 + */ + template _Tp& at(int i0, int i1, int i2); + /** @overload + @param i0 Index along the dimension 0 + @param i1 Index along the dimension 1 + @param i2 Index along the dimension 2 + */ + template const _Tp& at(int i0, int i1, int i2) const; + + /** @overload + @param idx Array of Mat::dims indices. + */ + template _Tp& at(const int* idx); + /** @overload + @param idx Array of Mat::dims indices. + */ + template const _Tp& at(const int* idx) const; + + /** @overload */ + template _Tp& at(const Vec& idx); + /** @overload */ + template const _Tp& at(const Vec& idx) const; + + /** @overload + special versions for 2D arrays (especially convenient for referencing image pixels) + @param pt Element position specified as Point(j,i) . + */ + template _Tp& at(Point pt); + /** @overload + special versions for 2D arrays (especially convenient for referencing image pixels) + @param pt Element position specified as Point(j,i) . + */ + template const _Tp& at(Point pt) const; + + /** @brief Returns the matrix iterator and sets it to the first matrix element. + + The methods return the matrix read-only or read-write iterators. The use of matrix iterators is very + similar to the use of bi-directional STL iterators. In the example below, the alpha blending + function is rewritten using the matrix iterators: + @code + template + void alphaBlendRGBA(const Mat& src1, const Mat& src2, Mat& dst) + { + typedef Vec VT; + + const float alpha_scale = (float)std::numeric_limits::max(), + inv_scale = 1.f/alpha_scale; + + CV_Assert( src1.type() == src2.type() && + src1.type() == DataType::type && + src1.size() == src2.size()); + Size size = src1.size(); + dst.create(size, src1.type()); + + MatConstIterator_ it1 = src1.begin(), it1_end = src1.end(); + MatConstIterator_ it2 = src2.begin(); + MatIterator_ dst_it = dst.begin(); + + for( ; it1 != it1_end; ++it1, ++it2, ++dst_it ) + { + VT pix1 = *it1, pix2 = *it2; + float alpha = pix1[3]*inv_scale, beta = pix2[3]*inv_scale; + *dst_it = VT(saturate_cast(pix1[0]*alpha + pix2[0]*beta), + saturate_cast(pix1[1]*alpha + pix2[1]*beta), + saturate_cast(pix1[2]*alpha + pix2[2]*beta), + saturate_cast((1 - (1-alpha)*(1-beta))*alpha_scale)); + } + } + @endcode + */ + template MatIterator_<_Tp> begin(); + template MatConstIterator_<_Tp> begin() const; + + /** @brief Returns the matrix iterator and sets it to the after-last matrix element. + + The methods return the matrix read-only or read-write iterators, set to the point following the last + matrix element. + */ + template MatIterator_<_Tp> end(); + template MatConstIterator_<_Tp> end() const; + + /** @brief Invoke with arguments functor, and runs the functor over all matrix element. + + The methods runs operation in parallel. Operation is passed by arguments. Operation have to be a + function pointer, a function object or a lambda(C++11). + + All of below operation is equal. Put 0xFF to first channel of all matrix elements: + @code + Mat image(1920, 1080, CV_8UC3); + typedef cv::Point3_ Pixel; + + // first. raw pointer access. + for (int r = 0; r < image.rows; ++r) { + Pixel* ptr = image.ptr(0, r); + const Pixel* ptr_end = ptr + image.cols; + for (; ptr != ptr_end; ++ptr) { + ptr->x = 255; + } + } + + // Using MatIterator. (Simple but there are a Iterator's overhead) + for (Pixel &p : cv::Mat_(image)) { + p.x = 255; + } + + // Parallel execution with function object. + struct Operator { + void operator ()(Pixel &pixel, const int * position) { + pixel.x = 255; + } + }; + image.forEach(Operator()); + + // Parallel execution using C++11 lambda. + image.forEach([](Pixel &p, const int * position) -> void { + p.x = 255; + }); + @endcode + position parameter is index of current pixel: + @code + // Creating 3D matrix (255 x 255 x 255) typed uint8_t, + // and initialize all elements by the value which equals elements position. + // i.e. pixels (x,y,z) = (1,2,3) is (b,g,r) = (1,2,3). + + int sizes[] = { 255, 255, 255 }; + typedef cv::Point3_ Pixel; + + Mat_ image = Mat::zeros(3, sizes, CV_8UC3); + + image.forEachWithPosition([&](Pixel& pixel, const int position[]) -> void{ + pixel.x = position[0]; + pixel.y = position[1]; + pixel.z = position[2]; + }); + @endcode + */ + template void forEach(const Functor& operation); + /** @overload */ + template void forEach(const Functor& operation) const; + +#ifdef CV_CXX_MOVE_SEMANTICS + Mat(Mat&& m); + Mat& operator = (Mat&& m); +#endif + + enum { MAGIC_VAL = 0x42FF0000, AUTO_STEP = 0, CONTINUOUS_FLAG = CV_MAT_CONT_FLAG, SUBMATRIX_FLAG = CV_SUBMAT_FLAG }; + enum { MAGIC_MASK = 0xFFFF0000, TYPE_MASK = 0x00000FFF, DEPTH_MASK = 7 }; + + /*! includes several bit-fields: + - the magic signature + - continuity flag + - depth + - number of channels + */ + int flags; + //! the matrix dimensionality, >= 2 + int dims; + //! the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions + int rows, cols; + //! pointer to the data + uchar* data; + + //! helper fields used in locateROI and adjustROI + const uchar* datastart; + const uchar* dataend; + const uchar* datalimit; + + //! custom allocator + MatAllocator* allocator; + //! and the standard allocator + static MatAllocator* getStdAllocator(); + static MatAllocator* getDefaultAllocator(); + static void setDefaultAllocator(MatAllocator* allocator); + + //! interaction with UMat + UMatData* u; + + MatSize size; + MatStep step; + +protected: + template void forEach_impl(const Functor& operation); +}; + + +///////////////////////////////// Mat_<_Tp> //////////////////////////////////// + +/** @brief Template matrix class derived from Mat + +@code + template class Mat_ : public Mat + { + public: + // ... some specific methods + // and + // no new extra fields + }; +@endcode +The class `Mat_<_Tp>` is a *thin* template wrapper on top of the Mat class. It does not have any +extra data fields. Nor this class nor Mat has any virtual methods. Thus, references or pointers to +these two classes can be freely but carefully converted one to another. For example: +@code + // create a 100x100 8-bit matrix + Mat M(100,100,CV_8U); + // this will be compiled fine. no any data conversion will be done. + Mat_& M1 = (Mat_&)M; + // the program is likely to crash at the statement below + M1(99,99) = 1.f; +@endcode +While Mat is sufficient in most cases, Mat_ can be more convenient if you use a lot of element +access operations and if you know matrix type at the compilation time. Note that +`Mat::at(int y,int x)` and `Mat_::operator()(int y,int x)` do absolutely the same +and run at the same speed, but the latter is certainly shorter: +@code + Mat_ M(20,20); + for(int i = 0; i < M.rows; i++) + for(int j = 0; j < M.cols; j++) + M(i,j) = 1./(i+j+1); + Mat E, V; + eigen(M,E,V); + cout << E.at(0,0)/E.at(M.rows-1,0); +@endcode +To use Mat_ for multi-channel images/matrices, pass Vec as a Mat_ parameter: +@code + // allocate a 320x240 color image and fill it with green (in RGB space) + Mat_ img(240, 320, Vec3b(0,255,0)); + // now draw a diagonal white line + for(int i = 0; i < 100; i++) + img(i,i)=Vec3b(255,255,255); + // and now scramble the 2nd (red) channel of each pixel + for(int i = 0; i < img.rows; i++) + for(int j = 0; j < img.cols; j++) + img(i,j)[2] ^= (uchar)(i ^ j); +@endcode + */ +template class Mat_ : public Mat +{ +public: + typedef _Tp value_type; + typedef typename DataType<_Tp>::channel_type channel_type; + typedef MatIterator_<_Tp> iterator; + typedef MatConstIterator_<_Tp> const_iterator; + + //! default constructor + Mat_(); + //! equivalent to Mat(_rows, _cols, DataType<_Tp>::type) + Mat_(int _rows, int _cols); + //! constructor that sets each matrix element to specified value + Mat_(int _rows, int _cols, const _Tp& value); + //! equivalent to Mat(_size, DataType<_Tp>::type) + explicit Mat_(Size _size); + //! constructor that sets each matrix element to specified value + Mat_(Size _size, const _Tp& value); + //! n-dim array constructor + Mat_(int _ndims, const int* _sizes); + //! n-dim array constructor that sets each matrix element to specified value + Mat_(int _ndims, const int* _sizes, const _Tp& value); + //! copy/conversion contructor. If m is of different type, it's converted + Mat_(const Mat& m); + //! copy constructor + Mat_(const Mat_& m); + //! constructs a matrix on top of user-allocated data. step is in bytes(!!!), regardless of the type + Mat_(int _rows, int _cols, _Tp* _data, size_t _step=AUTO_STEP); + //! constructs n-dim matrix on top of user-allocated data. steps are in bytes(!!!), regardless of the type + Mat_(int _ndims, const int* _sizes, _Tp* _data, const size_t* _steps=0); + //! selects a submatrix + Mat_(const Mat_& m, const Range& rowRange, const Range& colRange=Range::all()); + //! selects a submatrix + Mat_(const Mat_& m, const Rect& roi); + //! selects a submatrix, n-dim version + Mat_(const Mat_& m, const Range* ranges); + //! from a matrix expression + explicit Mat_(const MatExpr& e); + //! makes a matrix out of Vec, std::vector, Point_ or Point3_. The matrix will have a single column + explicit Mat_(const std::vector<_Tp>& vec, bool copyData=false); + template explicit Mat_(const Vec::channel_type, n>& vec, bool copyData=true); + template explicit Mat_(const Matx::channel_type, m, n>& mtx, bool copyData=true); + explicit Mat_(const Point_::channel_type>& pt, bool copyData=true); + explicit Mat_(const Point3_::channel_type>& pt, bool copyData=true); + explicit Mat_(const MatCommaInitializer_<_Tp>& commaInitializer); + + Mat_& operator = (const Mat& m); + Mat_& operator = (const Mat_& m); + //! set all the elements to s. + Mat_& operator = (const _Tp& s); + //! assign a matrix expression + Mat_& operator = (const MatExpr& e); + + //! iterators; they are smart enough to skip gaps in the end of rows + iterator begin(); + iterator end(); + const_iterator begin() const; + const_iterator end() const; + + //! template methods for for operation over all matrix elements. + // the operations take care of skipping gaps in the end of rows (if any) + template void forEach(const Functor& operation); + template void forEach(const Functor& operation) const; + + //! equivalent to Mat::create(_rows, _cols, DataType<_Tp>::type) + void create(int _rows, int _cols); + //! equivalent to Mat::create(_size, DataType<_Tp>::type) + void create(Size _size); + //! equivalent to Mat::create(_ndims, _sizes, DatType<_Tp>::type) + void create(int _ndims, const int* _sizes); + //! cross-product + Mat_ cross(const Mat_& m) const; + //! data type conversion + template operator Mat_() const; + //! overridden forms of Mat::row() etc. + Mat_ row(int y) const; + Mat_ col(int x) const; + Mat_ diag(int d=0) const; + Mat_ clone() const; + + //! overridden forms of Mat::elemSize() etc. + size_t elemSize() const; + size_t elemSize1() const; + int type() const; + int depth() const; + int channels() const; + size_t step1(int i=0) const; + //! returns step()/sizeof(_Tp) + size_t stepT(int i=0) const; + + //! overridden forms of Mat::zeros() etc. Data type is omitted, of course + static MatExpr zeros(int rows, int cols); + static MatExpr zeros(Size size); + static MatExpr zeros(int _ndims, const int* _sizes); + static MatExpr ones(int rows, int cols); + static MatExpr ones(Size size); + static MatExpr ones(int _ndims, const int* _sizes); + static MatExpr eye(int rows, int cols); + static MatExpr eye(Size size); + + //! some more overriden methods + Mat_& adjustROI( int dtop, int dbottom, int dleft, int dright ); + Mat_ operator()( const Range& rowRange, const Range& colRange ) const; + Mat_ operator()( const Rect& roi ) const; + Mat_ operator()( const Range* ranges ) const; + + //! more convenient forms of row and element access operators + _Tp* operator [](int y); + const _Tp* operator [](int y) const; + + //! returns reference to the specified element + _Tp& operator ()(const int* idx); + //! returns read-only reference to the specified element + const _Tp& operator ()(const int* idx) const; + + //! returns reference to the specified element + template _Tp& operator ()(const Vec& idx); + //! returns read-only reference to the specified element + template const _Tp& operator ()(const Vec& idx) const; + + //! returns reference to the specified element (1D case) + _Tp& operator ()(int idx0); + //! returns read-only reference to the specified element (1D case) + const _Tp& operator ()(int idx0) const; + //! returns reference to the specified element (2D case) + _Tp& operator ()(int idx0, int idx1); + //! returns read-only reference to the specified element (2D case) + const _Tp& operator ()(int idx0, int idx1) const; + //! returns reference to the specified element (3D case) + _Tp& operator ()(int idx0, int idx1, int idx2); + //! returns read-only reference to the specified element (3D case) + const _Tp& operator ()(int idx0, int idx1, int idx2) const; + + _Tp& operator ()(Point pt); + const _Tp& operator ()(Point pt) const; + + //! conversion to vector. + operator std::vector<_Tp>() const; + //! conversion to Vec + template operator Vec::channel_type, n>() const; + //! conversion to Matx + template operator Matx::channel_type, m, n>() const; + +#ifdef CV_CXX_MOVE_SEMANTICS + Mat_(Mat_&& m); + Mat_& operator = (Mat_&& m); + + Mat_(Mat&& m); + Mat_& operator = (Mat&& m); + + Mat_(MatExpr&& e); +#endif +}; + +typedef Mat_ Mat1b; +typedef Mat_ Mat2b; +typedef Mat_ Mat3b; +typedef Mat_ Mat4b; + +typedef Mat_ Mat1s; +typedef Mat_ Mat2s; +typedef Mat_ Mat3s; +typedef Mat_ Mat4s; + +typedef Mat_ Mat1w; +typedef Mat_ Mat2w; +typedef Mat_ Mat3w; +typedef Mat_ Mat4w; + +typedef Mat_ Mat1i; +typedef Mat_ Mat2i; +typedef Mat_ Mat3i; +typedef Mat_ Mat4i; + +typedef Mat_ Mat1f; +typedef Mat_ Mat2f; +typedef Mat_ Mat3f; +typedef Mat_ Mat4f; + +typedef Mat_ Mat1d; +typedef Mat_ Mat2d; +typedef Mat_ Mat3d; +typedef Mat_ Mat4d; + +/** @todo document */ +class CV_EXPORTS UMat +{ +public: + //! default constructor + UMat(UMatUsageFlags usageFlags = USAGE_DEFAULT); + //! constructs 2D matrix of the specified size and type + // (_type is CV_8UC1, CV_64FC3, CV_32SC(12) etc.) + UMat(int rows, int cols, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT); + UMat(Size size, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT); + //! constucts 2D matrix and fills it with the specified value _s. + UMat(int rows, int cols, int type, const Scalar& s, UMatUsageFlags usageFlags = USAGE_DEFAULT); + UMat(Size size, int type, const Scalar& s, UMatUsageFlags usageFlags = USAGE_DEFAULT); + + //! constructs n-dimensional matrix + UMat(int ndims, const int* sizes, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT); + UMat(int ndims, const int* sizes, int type, const Scalar& s, UMatUsageFlags usageFlags = USAGE_DEFAULT); + + //! copy constructor + UMat(const UMat& m); + + //! creates a matrix header for a part of the bigger matrix + UMat(const UMat& m, const Range& rowRange, const Range& colRange=Range::all()); + UMat(const UMat& m, const Rect& roi); + UMat(const UMat& m, const Range* ranges); + //! builds matrix from std::vector with or without copying the data + template explicit UMat(const std::vector<_Tp>& vec, bool copyData=false); + //! builds matrix from cv::Vec; the data is copied by default + template explicit UMat(const Vec<_Tp, n>& vec, bool copyData=true); + //! builds matrix from cv::Matx; the data is copied by default + template explicit UMat(const Matx<_Tp, m, n>& mtx, bool copyData=true); + //! builds matrix from a 2D point + template explicit UMat(const Point_<_Tp>& pt, bool copyData=true); + //! builds matrix from a 3D point + template explicit UMat(const Point3_<_Tp>& pt, bool copyData=true); + //! builds matrix from comma initializer + template explicit UMat(const MatCommaInitializer_<_Tp>& commaInitializer); + + //! destructor - calls release() + ~UMat(); + //! assignment operators + UMat& operator = (const UMat& m); + + Mat getMat(int flags) const; + + //! returns a new matrix header for the specified row + UMat row(int y) const; + //! returns a new matrix header for the specified column + UMat col(int x) const; + //! ... for the specified row span + UMat rowRange(int startrow, int endrow) const; + UMat rowRange(const Range& r) const; + //! ... for the specified column span + UMat colRange(int startcol, int endcol) const; + UMat colRange(const Range& r) const; + //! ... for the specified diagonal + // (d=0 - the main diagonal, + // >0 - a diagonal from the lower half, + // <0 - a diagonal from the upper half) + UMat diag(int d=0) const; + //! constructs a square diagonal matrix which main diagonal is vector "d" + static UMat diag(const UMat& d); + + //! returns deep copy of the matrix, i.e. the data is copied + UMat clone() const; + //! copies the matrix content to "m". + // It calls m.create(this->size(), this->type()). + void copyTo( OutputArray m ) const; + //! copies those matrix elements to "m" that are marked with non-zero mask elements. + void copyTo( OutputArray m, InputArray mask ) const; + //! converts matrix to another datatype with optional scalng. See cvConvertScale. + void convertTo( OutputArray m, int rtype, double alpha=1, double beta=0 ) const; + + void assignTo( UMat& m, int type=-1 ) const; + + //! sets every matrix element to s + UMat& operator = (const Scalar& s); + //! sets some of the matrix elements to s, according to the mask + UMat& setTo(InputArray value, InputArray mask=noArray()); + //! creates alternative matrix header for the same data, with different + // number of channels and/or different number of rows. see cvReshape. + UMat reshape(int cn, int rows=0) const; + UMat reshape(int cn, int newndims, const int* newsz) const; + + //! matrix transposition by means of matrix expressions + UMat t() const; + //! matrix inversion by means of matrix expressions + UMat inv(int method=DECOMP_LU) const; + //! per-element matrix multiplication by means of matrix expressions + UMat mul(InputArray m, double scale=1) const; + + //! computes dot-product + double dot(InputArray m) const; + + //! Matlab-style matrix initialization + static UMat zeros(int rows, int cols, int type); + static UMat zeros(Size size, int type); + static UMat zeros(int ndims, const int* sz, int type); + static UMat ones(int rows, int cols, int type); + static UMat ones(Size size, int type); + static UMat ones(int ndims, const int* sz, int type); + static UMat eye(int rows, int cols, int type); + static UMat eye(Size size, int type); + + //! allocates new matrix data unless the matrix already has specified size and type. + // previous data is unreferenced if needed. + void create(int rows, int cols, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT); + void create(Size size, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT); + void create(int ndims, const int* sizes, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT); + + //! increases the reference counter; use with care to avoid memleaks + void addref(); + //! decreases reference counter; + // deallocates the data when reference counter reaches 0. + void release(); + + //! deallocates the matrix data + void deallocate(); + //! internal use function; properly re-allocates _size, _step arrays + void copySize(const UMat& m); + + //! locates matrix header within a parent matrix. See below + void locateROI( Size& wholeSize, Point& ofs ) const; + //! moves/resizes the current matrix ROI inside the parent matrix. + UMat& adjustROI( int dtop, int dbottom, int dleft, int dright ); + //! extracts a rectangular sub-matrix + // (this is a generalized form of row, rowRange etc.) + UMat operator()( Range rowRange, Range colRange ) const; + UMat operator()( const Rect& roi ) const; + UMat operator()( const Range* ranges ) const; + + //! returns true iff the matrix data is continuous + // (i.e. when there are no gaps between successive rows). + // similar to CV_IS_MAT_CONT(cvmat->type) + bool isContinuous() const; + + //! returns true if the matrix is a submatrix of another matrix + bool isSubmatrix() const; + + //! returns element size in bytes, + // similar to CV_ELEM_SIZE(cvmat->type) + size_t elemSize() const; + //! returns the size of element channel in bytes. + size_t elemSize1() const; + //! returns element type, similar to CV_MAT_TYPE(cvmat->type) + int type() const; + //! returns element type, similar to CV_MAT_DEPTH(cvmat->type) + int depth() const; + //! returns element type, similar to CV_MAT_CN(cvmat->type) + int channels() const; + //! returns step/elemSize1() + size_t step1(int i=0) const; + //! returns true if matrix data is NULL + bool empty() const; + //! returns the total number of matrix elements + size_t total() const; + + //! returns N if the matrix is 1-channel (N x ptdim) or ptdim-channel (1 x N) or (N x 1); negative number otherwise + int checkVector(int elemChannels, int depth=-1, bool requireContinuous=true) const; + +#ifdef CV_CXX_MOVE_SEMANTICS + UMat(UMat&& m); + UMat& operator = (UMat&& m); +#endif + + void* handle(int accessFlags) const; + void ndoffset(size_t* ofs) const; + + enum { MAGIC_VAL = 0x42FF0000, AUTO_STEP = 0, CONTINUOUS_FLAG = CV_MAT_CONT_FLAG, SUBMATRIX_FLAG = CV_SUBMAT_FLAG }; + enum { MAGIC_MASK = 0xFFFF0000, TYPE_MASK = 0x00000FFF, DEPTH_MASK = 7 }; + + /*! includes several bit-fields: + - the magic signature + - continuity flag + - depth + - number of channels + */ + int flags; + //! the matrix dimensionality, >= 2 + int dims; + //! the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions + int rows, cols; + + //! custom allocator + MatAllocator* allocator; + UMatUsageFlags usageFlags; // usage flags for allocator + //! and the standard allocator + static MatAllocator* getStdAllocator(); + + // black-box container of UMat data + UMatData* u; + + // offset of the submatrix (or 0) + size_t offset; + + MatSize size; + MatStep step; + +protected: +}; + + +/////////////////////////// multi-dimensional sparse matrix ////////////////////////// + +/** @brief The class SparseMat represents multi-dimensional sparse numerical arrays. + +Such a sparse array can store elements of any type that Mat can store. *Sparse* means that only +non-zero elements are stored (though, as a result of operations on a sparse matrix, some of its +stored elements can actually become 0. It is up to you to detect such elements and delete them +using SparseMat::erase ). The non-zero elements are stored in a hash table that grows when it is +filled so that the search time is O(1) in average (regardless of whether element is there or not). +Elements can be accessed using the following methods: +- Query operations (SparseMat::ptr and the higher-level SparseMat::ref, SparseMat::value and + SparseMat::find), for example: + @code + const int dims = 5; + int size[] = {10, 10, 10, 10, 10}; + SparseMat sparse_mat(dims, size, CV_32F); + for(int i = 0; i < 1000; i++) + { + int idx[dims]; + for(int k = 0; k < dims; k++) + idx[k] = rand() + sparse_mat.ref(idx) += 1.f; + } + @endcode +- Sparse matrix iterators. They are similar to MatIterator but different from NAryMatIterator. + That is, the iteration loop is familiar to STL users: + @code + // prints elements of a sparse floating-point matrix + // and the sum of elements. + SparseMatConstIterator_ + it = sparse_mat.begin(), + it_end = sparse_mat.end(); + double s = 0; + int dims = sparse_mat.dims(); + for(; it != it_end; ++it) + { + // print element indices and the element value + const SparseMat::Node* n = it.node(); + printf("("); + for(int i = 0; i < dims; i++) + printf("%d%s", n->idx[i], i < dims-1 ? ", " : ")"); + printf(": %g\n", it.value()); + s += *it; + } + printf("Element sum is %g\n", s); + @endcode + If you run this loop, you will notice that elements are not enumerated in a logical order + (lexicographical, and so on). They come in the same order as they are stored in the hash table + (semi-randomly). You may collect pointers to the nodes and sort them to get the proper ordering. + Note, however, that pointers to the nodes may become invalid when you add more elements to the + matrix. This may happen due to possible buffer reallocation. +- Combination of the above 2 methods when you need to process 2 or more sparse matrices + simultaneously. For example, this is how you can compute unnormalized cross-correlation of the 2 + floating-point sparse matrices: + @code + double cross_corr(const SparseMat& a, const SparseMat& b) + { + const SparseMat *_a = &a, *_b = &b; + // if b contains less elements than a, + // it is faster to iterate through b + if(_a->nzcount() > _b->nzcount()) + std::swap(_a, _b); + SparseMatConstIterator_ it = _a->begin(), + it_end = _a->end(); + double ccorr = 0; + for(; it != it_end; ++it) + { + // take the next element from the first matrix + float avalue = *it; + const Node* anode = it.node(); + // and try to find an element with the same index in the second matrix. + // since the hash value depends only on the element index, + // reuse the hash value stored in the node + float bvalue = _b->value(anode->idx,&anode->hashval); + ccorr += avalue*bvalue; + } + return ccorr; + } + @endcode + */ +class CV_EXPORTS SparseMat +{ +public: + typedef SparseMatIterator iterator; + typedef SparseMatConstIterator const_iterator; + + enum { MAGIC_VAL=0x42FD0000, MAX_DIM=32, HASH_SCALE=0x5bd1e995, HASH_BIT=0x80000000 }; + + //! the sparse matrix header + struct CV_EXPORTS Hdr + { + Hdr(int _dims, const int* _sizes, int _type); + void clear(); + int refcount; + int dims; + int valueOffset; + size_t nodeSize; + size_t nodeCount; + size_t freeList; + std::vector pool; + std::vector hashtab; + int size[MAX_DIM]; + }; + + //! sparse matrix node - element of a hash table + struct CV_EXPORTS Node + { + //! hash value + size_t hashval; + //! index of the next node in the same hash table entry + size_t next; + //! index of the matrix element + int idx[MAX_DIM]; + }; + + /** @brief Various SparseMat constructors. + */ + SparseMat(); + + /** @overload + @param dims Array dimensionality. + @param _sizes Sparce matrix size on all dementions. + @param _type Sparse matrix data type. + */ + SparseMat(int dims, const int* _sizes, int _type); + + /** @overload + @param m Source matrix for copy constructor. If m is dense matrix (ocvMat) then it will be converted + to sparse representation. + */ + SparseMat(const SparseMat& m); + + /** @overload + @param m Source matrix for copy constructor. If m is dense matrix (ocvMat) then it will be converted + to sparse representation. + */ + explicit SparseMat(const Mat& m); + + //! the destructor + ~SparseMat(); + + //! assignment operator. This is O(1) operation, i.e. no data is copied + SparseMat& operator = (const SparseMat& m); + //! equivalent to the corresponding constructor + SparseMat& operator = (const Mat& m); + + //! creates full copy of the matrix + SparseMat clone() const; + + //! copies all the data to the destination matrix. All the previous content of m is erased + void copyTo( SparseMat& m ) const; + //! converts sparse matrix to dense matrix. + void copyTo( Mat& m ) const; + //! multiplies all the matrix elements by the specified scale factor alpha and converts the results to the specified data type + void convertTo( SparseMat& m, int rtype, double alpha=1 ) const; + //! converts sparse matrix to dense n-dim matrix with optional type conversion and scaling. + /*! + @param [out] m - output matrix; if it does not have a proper size or type before the operation, + it is reallocated + @param [in] rtype – desired output matrix type or, rather, the depth since the number of channels + are the same as the input has; if rtype is negative, the output matrix will have the + same type as the input. + @param [in] alpha – optional scale factor + @param [in] beta – optional delta added to the scaled values + */ + void convertTo( Mat& m, int rtype, double alpha=1, double beta=0 ) const; + + // not used now + void assignTo( SparseMat& m, int type=-1 ) const; + + //! reallocates sparse matrix. + /*! + If the matrix already had the proper size and type, + it is simply cleared with clear(), otherwise, + the old matrix is released (using release()) and the new one is allocated. + */ + void create(int dims, const int* _sizes, int _type); + //! sets all the sparse matrix elements to 0, which means clearing the hash table. + void clear(); + //! manually increments the reference counter to the header. + void addref(); + // decrements the header reference counter. When the counter reaches 0, the header and all the underlying data are deallocated. + void release(); + + //! converts sparse matrix to the old-style representation; all the elements are copied. + //operator CvSparseMat*() const; + //! returns the size of each element in bytes (not including the overhead - the space occupied by SparseMat::Node elements) + size_t elemSize() const; + //! returns elemSize()/channels() + size_t elemSize1() const; + + //! returns type of sparse matrix elements + int type() const; + //! returns the depth of sparse matrix elements + int depth() const; + //! returns the number of channels + int channels() const; + + //! returns the array of sizes, or NULL if the matrix is not allocated + const int* size() const; + //! returns the size of i-th matrix dimension (or 0) + int size(int i) const; + //! returns the matrix dimensionality + int dims() const; + //! returns the number of non-zero elements (=the number of hash table nodes) + size_t nzcount() const; + + //! computes the element hash value (1D case) + size_t hash(int i0) const; + //! computes the element hash value (2D case) + size_t hash(int i0, int i1) const; + //! computes the element hash value (3D case) + size_t hash(int i0, int i1, int i2) const; + //! computes the element hash value (nD case) + size_t hash(const int* idx) const; + + //!@{ + /*! + specialized variants for 1D, 2D, 3D cases and the generic_type one for n-D case. + return pointer to the matrix element. + - if the element is there (it's non-zero), the pointer to it is returned + - if it's not there and createMissing=false, NULL pointer is returned + - if it's not there and createMissing=true, then the new element + is created and initialized with 0. Pointer to it is returned + - if the optional hashval pointer is not NULL, the element hash value is + not computed, but *hashval is taken instead. + */ + //! returns pointer to the specified element (1D case) + uchar* ptr(int i0, bool createMissing, size_t* hashval=0); + //! returns pointer to the specified element (2D case) + uchar* ptr(int i0, int i1, bool createMissing, size_t* hashval=0); + //! returns pointer to the specified element (3D case) + uchar* ptr(int i0, int i1, int i2, bool createMissing, size_t* hashval=0); + //! returns pointer to the specified element (nD case) + uchar* ptr(const int* idx, bool createMissing, size_t* hashval=0); + //!@} + + //!@{ + /*! + return read-write reference to the specified sparse matrix element. + + `ref<_Tp>(i0,...[,hashval])` is equivalent to `*(_Tp*)ptr(i0,...,true[,hashval])`. + The methods always return a valid reference. + If the element did not exist, it is created and initialiazed with 0. + */ + //! returns reference to the specified element (1D case) + template _Tp& ref(int i0, size_t* hashval=0); + //! returns reference to the specified element (2D case) + template _Tp& ref(int i0, int i1, size_t* hashval=0); + //! returns reference to the specified element (3D case) + template _Tp& ref(int i0, int i1, int i2, size_t* hashval=0); + //! returns reference to the specified element (nD case) + template _Tp& ref(const int* idx, size_t* hashval=0); + //!@} + + //!@{ + /*! + return value of the specified sparse matrix element. + + `value<_Tp>(i0,...[,hashval])` is equivalent to + @code + { const _Tp* p = find<_Tp>(i0,...[,hashval]); return p ? *p : _Tp(); } + @endcode + + That is, if the element did not exist, the methods return 0. + */ + //! returns value of the specified element (1D case) + template _Tp value(int i0, size_t* hashval=0) const; + //! returns value of the specified element (2D case) + template _Tp value(int i0, int i1, size_t* hashval=0) const; + //! returns value of the specified element (3D case) + template _Tp value(int i0, int i1, int i2, size_t* hashval=0) const; + //! returns value of the specified element (nD case) + template _Tp value(const int* idx, size_t* hashval=0) const; + //!@} + + //!@{ + /*! + Return pointer to the specified sparse matrix element if it exists + + `find<_Tp>(i0,...[,hashval])` is equivalent to `(_const Tp*)ptr(i0,...false[,hashval])`. + + If the specified element does not exist, the methods return NULL. + */ + //! returns pointer to the specified element (1D case) + template const _Tp* find(int i0, size_t* hashval=0) const; + //! returns pointer to the specified element (2D case) + template const _Tp* find(int i0, int i1, size_t* hashval=0) const; + //! returns pointer to the specified element (3D case) + template const _Tp* find(int i0, int i1, int i2, size_t* hashval=0) const; + //! returns pointer to the specified element (nD case) + template const _Tp* find(const int* idx, size_t* hashval=0) const; + //!@} + + //! erases the specified element (2D case) + void erase(int i0, int i1, size_t* hashval=0); + //! erases the specified element (3D case) + void erase(int i0, int i1, int i2, size_t* hashval=0); + //! erases the specified element (nD case) + void erase(const int* idx, size_t* hashval=0); + + //!@{ + /*! + return the sparse matrix iterator pointing to the first sparse matrix element + */ + //! returns the sparse matrix iterator at the matrix beginning + SparseMatIterator begin(); + //! returns the sparse matrix iterator at the matrix beginning + template SparseMatIterator_<_Tp> begin(); + //! returns the read-only sparse matrix iterator at the matrix beginning + SparseMatConstIterator begin() const; + //! returns the read-only sparse matrix iterator at the matrix beginning + template SparseMatConstIterator_<_Tp> begin() const; + //!@} + /*! + return the sparse matrix iterator pointing to the element following the last sparse matrix element + */ + //! returns the sparse matrix iterator at the matrix end + SparseMatIterator end(); + //! returns the read-only sparse matrix iterator at the matrix end + SparseMatConstIterator end() const; + //! returns the typed sparse matrix iterator at the matrix end + template SparseMatIterator_<_Tp> end(); + //! returns the typed read-only sparse matrix iterator at the matrix end + template SparseMatConstIterator_<_Tp> end() const; + + //! returns the value stored in the sparse martix node + template _Tp& value(Node* n); + //! returns the value stored in the sparse martix node + template const _Tp& value(const Node* n) const; + + ////////////// some internal-use methods /////////////// + Node* node(size_t nidx); + const Node* node(size_t nidx) const; + + uchar* newNode(const int* idx, size_t hashval); + void removeNode(size_t hidx, size_t nidx, size_t previdx); + void resizeHashTab(size_t newsize); + + int flags; + Hdr* hdr; +}; + + + +///////////////////////////////// SparseMat_<_Tp> //////////////////////////////////// + +/** @brief Template sparse n-dimensional array class derived from SparseMat + +SparseMat_ is a thin wrapper on top of SparseMat created in the same way as Mat_ . It simplifies +notation of some operations: +@code + int sz[] = {10, 20, 30}; + SparseMat_ M(3, sz); + ... + M.ref(1, 2, 3) = M(4, 5, 6) + M(7, 8, 9); +@endcode + */ +template class SparseMat_ : public SparseMat +{ +public: + typedef SparseMatIterator_<_Tp> iterator; + typedef SparseMatConstIterator_<_Tp> const_iterator; + + //! the default constructor + SparseMat_(); + //! the full constructor equivelent to SparseMat(dims, _sizes, DataType<_Tp>::type) + SparseMat_(int dims, const int* _sizes); + //! the copy constructor. If DataType<_Tp>.type != m.type(), the m elements are converted + SparseMat_(const SparseMat& m); + //! the copy constructor. This is O(1) operation - no data is copied + SparseMat_(const SparseMat_& m); + //! converts dense matrix to the sparse form + SparseMat_(const Mat& m); + //! converts the old-style sparse matrix to the C++ class. All the elements are copied + //SparseMat_(const CvSparseMat* m); + //! the assignment operator. If DataType<_Tp>.type != m.type(), the m elements are converted + SparseMat_& operator = (const SparseMat& m); + //! the assignment operator. This is O(1) operation - no data is copied + SparseMat_& operator = (const SparseMat_& m); + //! converts dense matrix to the sparse form + SparseMat_& operator = (const Mat& m); + + //! makes full copy of the matrix. All the elements are duplicated + SparseMat_ clone() const; + //! equivalent to cv::SparseMat::create(dims, _sizes, DataType<_Tp>::type) + void create(int dims, const int* _sizes); + //! converts sparse matrix to the old-style CvSparseMat. All the elements are copied + //operator CvSparseMat*() const; + + //! returns type of the matrix elements + int type() const; + //! returns depth of the matrix elements + int depth() const; + //! returns the number of channels in each matrix element + int channels() const; + + //! equivalent to SparseMat::ref<_Tp>(i0, hashval) + _Tp& ref(int i0, size_t* hashval=0); + //! equivalent to SparseMat::ref<_Tp>(i0, i1, hashval) + _Tp& ref(int i0, int i1, size_t* hashval=0); + //! equivalent to SparseMat::ref<_Tp>(i0, i1, i2, hashval) + _Tp& ref(int i0, int i1, int i2, size_t* hashval=0); + //! equivalent to SparseMat::ref<_Tp>(idx, hashval) + _Tp& ref(const int* idx, size_t* hashval=0); + + //! equivalent to SparseMat::value<_Tp>(i0, hashval) + _Tp operator()(int i0, size_t* hashval=0) const; + //! equivalent to SparseMat::value<_Tp>(i0, i1, hashval) + _Tp operator()(int i0, int i1, size_t* hashval=0) const; + //! equivalent to SparseMat::value<_Tp>(i0, i1, i2, hashval) + _Tp operator()(int i0, int i1, int i2, size_t* hashval=0) const; + //! equivalent to SparseMat::value<_Tp>(idx, hashval) + _Tp operator()(const int* idx, size_t* hashval=0) const; + + //! returns sparse matrix iterator pointing to the first sparse matrix element + SparseMatIterator_<_Tp> begin(); + //! returns read-only sparse matrix iterator pointing to the first sparse matrix element + SparseMatConstIterator_<_Tp> begin() const; + //! returns sparse matrix iterator pointing to the element following the last sparse matrix element + SparseMatIterator_<_Tp> end(); + //! returns read-only sparse matrix iterator pointing to the element following the last sparse matrix element + SparseMatConstIterator_<_Tp> end() const; +}; + + + +////////////////////////////////// MatConstIterator ////////////////////////////////// + +class CV_EXPORTS MatConstIterator +{ +public: + typedef uchar* value_type; + typedef ptrdiff_t difference_type; + typedef const uchar** pointer; + typedef uchar* reference; + +#ifndef OPENCV_NOSTL + typedef std::random_access_iterator_tag iterator_category; +#endif + + //! default constructor + MatConstIterator(); + //! constructor that sets the iterator to the beginning of the matrix + MatConstIterator(const Mat* _m); + //! constructor that sets the iterator to the specified element of the matrix + MatConstIterator(const Mat* _m, int _row, int _col=0); + //! constructor that sets the iterator to the specified element of the matrix + MatConstIterator(const Mat* _m, Point _pt); + //! constructor that sets the iterator to the specified element of the matrix + MatConstIterator(const Mat* _m, const int* _idx); + //! copy constructor + MatConstIterator(const MatConstIterator& it); + + //! copy operator + MatConstIterator& operator = (const MatConstIterator& it); + //! returns the current matrix element + const uchar* operator *() const; + //! returns the i-th matrix element, relative to the current + const uchar* operator [](ptrdiff_t i) const; + + //! shifts the iterator forward by the specified number of elements + MatConstIterator& operator += (ptrdiff_t ofs); + //! shifts the iterator backward by the specified number of elements + MatConstIterator& operator -= (ptrdiff_t ofs); + //! decrements the iterator + MatConstIterator& operator --(); + //! decrements the iterator + MatConstIterator operator --(int); + //! increments the iterator + MatConstIterator& operator ++(); + //! increments the iterator + MatConstIterator operator ++(int); + //! returns the current iterator position + Point pos() const; + //! returns the current iterator position + void pos(int* _idx) const; + + ptrdiff_t lpos() const; + void seek(ptrdiff_t ofs, bool relative = false); + void seek(const int* _idx, bool relative = false); + + const Mat* m; + size_t elemSize; + const uchar* ptr; + const uchar* sliceStart; + const uchar* sliceEnd; +}; + + + +////////////////////////////////// MatConstIterator_ ///////////////////////////////// + +/** @brief Matrix read-only iterator + */ +template +class MatConstIterator_ : public MatConstIterator +{ +public: + typedef _Tp value_type; + typedef ptrdiff_t difference_type; + typedef const _Tp* pointer; + typedef const _Tp& reference; + +#ifndef OPENCV_NOSTL + typedef std::random_access_iterator_tag iterator_category; +#endif + + //! default constructor + MatConstIterator_(); + //! constructor that sets the iterator to the beginning of the matrix + MatConstIterator_(const Mat_<_Tp>* _m); + //! constructor that sets the iterator to the specified element of the matrix + MatConstIterator_(const Mat_<_Tp>* _m, int _row, int _col=0); + //! constructor that sets the iterator to the specified element of the matrix + MatConstIterator_(const Mat_<_Tp>* _m, Point _pt); + //! constructor that sets the iterator to the specified element of the matrix + MatConstIterator_(const Mat_<_Tp>* _m, const int* _idx); + //! copy constructor + MatConstIterator_(const MatConstIterator_& it); + + //! copy operator + MatConstIterator_& operator = (const MatConstIterator_& it); + //! returns the current matrix element + _Tp operator *() const; + //! returns the i-th matrix element, relative to the current + _Tp operator [](ptrdiff_t i) const; + + //! shifts the iterator forward by the specified number of elements + MatConstIterator_& operator += (ptrdiff_t ofs); + //! shifts the iterator backward by the specified number of elements + MatConstIterator_& operator -= (ptrdiff_t ofs); + //! decrements the iterator + MatConstIterator_& operator --(); + //! decrements the iterator + MatConstIterator_ operator --(int); + //! increments the iterator + MatConstIterator_& operator ++(); + //! increments the iterator + MatConstIterator_ operator ++(int); + //! returns the current iterator position + Point pos() const; +}; + + + +//////////////////////////////////// MatIterator_ //////////////////////////////////// + +/** @brief Matrix read-write iterator +*/ +template +class MatIterator_ : public MatConstIterator_<_Tp> +{ +public: + typedef _Tp* pointer; + typedef _Tp& reference; + +#ifndef OPENCV_NOSTL + typedef std::random_access_iterator_tag iterator_category; +#endif + + //! the default constructor + MatIterator_(); + //! constructor that sets the iterator to the beginning of the matrix + MatIterator_(Mat_<_Tp>* _m); + //! constructor that sets the iterator to the specified element of the matrix + MatIterator_(Mat_<_Tp>* _m, int _row, int _col=0); + //! constructor that sets the iterator to the specified element of the matrix + MatIterator_(Mat_<_Tp>* _m, Point _pt); + //! constructor that sets the iterator to the specified element of the matrix + MatIterator_(Mat_<_Tp>* _m, const int* _idx); + //! copy constructor + MatIterator_(const MatIterator_& it); + //! copy operator + MatIterator_& operator = (const MatIterator_<_Tp>& it ); + + //! returns the current matrix element + _Tp& operator *() const; + //! returns the i-th matrix element, relative to the current + _Tp& operator [](ptrdiff_t i) const; + + //! shifts the iterator forward by the specified number of elements + MatIterator_& operator += (ptrdiff_t ofs); + //! shifts the iterator backward by the specified number of elements + MatIterator_& operator -= (ptrdiff_t ofs); + //! decrements the iterator + MatIterator_& operator --(); + //! decrements the iterator + MatIterator_ operator --(int); + //! increments the iterator + MatIterator_& operator ++(); + //! increments the iterator + MatIterator_ operator ++(int); +}; + + + +/////////////////////////////// SparseMatConstIterator /////////////////////////////// + +/** @brief Read-Only Sparse Matrix Iterator. + + Here is how to use the iterator to compute the sum of floating-point sparse matrix elements: + + \code + SparseMatConstIterator it = m.begin(), it_end = m.end(); + double s = 0; + CV_Assert( m.type() == CV_32F ); + for( ; it != it_end; ++it ) + s += it.value(); + \endcode +*/ +class CV_EXPORTS SparseMatConstIterator +{ +public: + //! the default constructor + SparseMatConstIterator(); + //! the full constructor setting the iterator to the first sparse matrix element + SparseMatConstIterator(const SparseMat* _m); + //! the copy constructor + SparseMatConstIterator(const SparseMatConstIterator& it); + + //! the assignment operator + SparseMatConstIterator& operator = (const SparseMatConstIterator& it); + + //! template method returning the current matrix element + template const _Tp& value() const; + //! returns the current node of the sparse matrix. it.node->idx is the current element index + const SparseMat::Node* node() const; + + //! moves iterator to the previous element + SparseMatConstIterator& operator --(); + //! moves iterator to the previous element + SparseMatConstIterator operator --(int); + //! moves iterator to the next element + SparseMatConstIterator& operator ++(); + //! moves iterator to the next element + SparseMatConstIterator operator ++(int); + + //! moves iterator to the element after the last element + void seekEnd(); + + const SparseMat* m; + size_t hashidx; + uchar* ptr; +}; + + + +////////////////////////////////// SparseMatIterator ///////////////////////////////// + +/** @brief Read-write Sparse Matrix Iterator + + The class is similar to cv::SparseMatConstIterator, + but can be used for in-place modification of the matrix elements. +*/ +class CV_EXPORTS SparseMatIterator : public SparseMatConstIterator +{ +public: + //! the default constructor + SparseMatIterator(); + //! the full constructor setting the iterator to the first sparse matrix element + SparseMatIterator(SparseMat* _m); + //! the full constructor setting the iterator to the specified sparse matrix element + SparseMatIterator(SparseMat* _m, const int* idx); + //! the copy constructor + SparseMatIterator(const SparseMatIterator& it); + + //! the assignment operator + SparseMatIterator& operator = (const SparseMatIterator& it); + //! returns read-write reference to the current sparse matrix element + template _Tp& value() const; + //! returns pointer to the current sparse matrix node. it.node->idx is the index of the current element (do not modify it!) + SparseMat::Node* node() const; + + //! moves iterator to the next element + SparseMatIterator& operator ++(); + //! moves iterator to the next element + SparseMatIterator operator ++(int); +}; + + + +/////////////////////////////// SparseMatConstIterator_ ////////////////////////////// + +/** @brief Template Read-Only Sparse Matrix Iterator Class. + + This is the derived from SparseMatConstIterator class that + introduces more convenient operator *() for accessing the current element. +*/ +template class SparseMatConstIterator_ : public SparseMatConstIterator +{ +public: + +#ifndef OPENCV_NOSTL + typedef std::forward_iterator_tag iterator_category; +#endif + + //! the default constructor + SparseMatConstIterator_(); + //! the full constructor setting the iterator to the first sparse matrix element + SparseMatConstIterator_(const SparseMat_<_Tp>* _m); + SparseMatConstIterator_(const SparseMat* _m); + //! the copy constructor + SparseMatConstIterator_(const SparseMatConstIterator_& it); + + //! the assignment operator + SparseMatConstIterator_& operator = (const SparseMatConstIterator_& it); + //! the element access operator + const _Tp& operator *() const; + + //! moves iterator to the next element + SparseMatConstIterator_& operator ++(); + //! moves iterator to the next element + SparseMatConstIterator_ operator ++(int); +}; + + + +///////////////////////////////// SparseMatIterator_ ///////////////////////////////// + +/** @brief Template Read-Write Sparse Matrix Iterator Class. + + This is the derived from cv::SparseMatConstIterator_ class that + introduces more convenient operator *() for accessing the current element. +*/ +template class SparseMatIterator_ : public SparseMatConstIterator_<_Tp> +{ +public: + +#ifndef OPENCV_NOSTL + typedef std::forward_iterator_tag iterator_category; +#endif + + //! the default constructor + SparseMatIterator_(); + //! the full constructor setting the iterator to the first sparse matrix element + SparseMatIterator_(SparseMat_<_Tp>* _m); + SparseMatIterator_(SparseMat* _m); + //! the copy constructor + SparseMatIterator_(const SparseMatIterator_& it); + + //! the assignment operator + SparseMatIterator_& operator = (const SparseMatIterator_& it); + //! returns the reference to the current element + _Tp& operator *() const; + + //! moves the iterator to the next element + SparseMatIterator_& operator ++(); + //! moves the iterator to the next element + SparseMatIterator_ operator ++(int); +}; + + + +/////////////////////////////////// NAryMatIterator ////////////////////////////////// + +/** @brief n-ary multi-dimensional array iterator. + +Use the class to implement unary, binary, and, generally, n-ary element-wise operations on +multi-dimensional arrays. Some of the arguments of an n-ary function may be continuous arrays, some +may be not. It is possible to use conventional MatIterator 's for each array but incrementing all of +the iterators after each small operations may be a big overhead. In this case consider using +NAryMatIterator to iterate through several matrices simultaneously as long as they have the same +geometry (dimensionality and all the dimension sizes are the same). On each iteration `it.planes[0]`, +`it.planes[1]`,... will be the slices of the corresponding matrices. + +The example below illustrates how you can compute a normalized and threshold 3D color histogram: +@code + void computeNormalizedColorHist(const Mat& image, Mat& hist, int N, double minProb) + { + const int histSize[] = {N, N, N}; + + // make sure that the histogram has a proper size and type + hist.create(3, histSize, CV_32F); + + // and clear it + hist = Scalar(0); + + // the loop below assumes that the image + // is a 8-bit 3-channel. check it. + CV_Assert(image.type() == CV_8UC3); + MatConstIterator_ it = image.begin(), + it_end = image.end(); + for( ; it != it_end; ++it ) + { + const Vec3b& pix = *it; + hist.at(pix[0]*N/256, pix[1]*N/256, pix[2]*N/256) += 1.f; + } + + minProb *= image.rows*image.cols; + Mat plane; + NAryMatIterator it(&hist, &plane, 1); + double s = 0; + // iterate through the matrix. on each iteration + // it.planes[*] (of type Mat) will be set to the current plane. + for(int p = 0; p < it.nplanes; p++, ++it) + { + threshold(it.planes[0], it.planes[0], minProb, 0, THRESH_TOZERO); + s += sum(it.planes[0])[0]; + } + + s = 1./s; + it = NAryMatIterator(&hist, &plane, 1); + for(int p = 0; p < it.nplanes; p++, ++it) + it.planes[0] *= s; + } +@endcode + */ +class CV_EXPORTS NAryMatIterator +{ +public: + //! the default constructor + NAryMatIterator(); + //! the full constructor taking arbitrary number of n-dim matrices + NAryMatIterator(const Mat** arrays, uchar** ptrs, int narrays=-1); + //! the full constructor taking arbitrary number of n-dim matrices + NAryMatIterator(const Mat** arrays, Mat* planes, int narrays=-1); + //! the separate iterator initialization method + void init(const Mat** arrays, Mat* planes, uchar** ptrs, int narrays=-1); + + //! proceeds to the next plane of every iterated matrix + NAryMatIterator& operator ++(); + //! proceeds to the next plane of every iterated matrix (postfix increment operator) + NAryMatIterator operator ++(int); + + //! the iterated arrays + const Mat** arrays; + //! the current planes + Mat* planes; + //! data pointers + uchar** ptrs; + //! the number of arrays + int narrays; + //! the number of hyper-planes that the iterator steps through + size_t nplanes; + //! the size of each segment (in elements) + size_t size; +protected: + int iterdepth; + size_t idx; +}; + + + +///////////////////////////////// Matrix Expressions ///////////////////////////////// + +class CV_EXPORTS MatOp +{ +public: + MatOp(); + virtual ~MatOp(); + + virtual bool elementWise(const MatExpr& expr) const; + virtual void assign(const MatExpr& expr, Mat& m, int type=-1) const = 0; + virtual void roi(const MatExpr& expr, const Range& rowRange, + const Range& colRange, MatExpr& res) const; + virtual void diag(const MatExpr& expr, int d, MatExpr& res) const; + virtual void augAssignAdd(const MatExpr& expr, Mat& m) const; + virtual void augAssignSubtract(const MatExpr& expr, Mat& m) const; + virtual void augAssignMultiply(const MatExpr& expr, Mat& m) const; + virtual void augAssignDivide(const MatExpr& expr, Mat& m) const; + virtual void augAssignAnd(const MatExpr& expr, Mat& m) const; + virtual void augAssignOr(const MatExpr& expr, Mat& m) const; + virtual void augAssignXor(const MatExpr& expr, Mat& m) const; + + virtual void add(const MatExpr& expr1, const MatExpr& expr2, MatExpr& res) const; + virtual void add(const MatExpr& expr1, const Scalar& s, MatExpr& res) const; + + virtual void subtract(const MatExpr& expr1, const MatExpr& expr2, MatExpr& res) const; + virtual void subtract(const Scalar& s, const MatExpr& expr, MatExpr& res) const; + + virtual void multiply(const MatExpr& expr1, const MatExpr& expr2, MatExpr& res, double scale=1) const; + virtual void multiply(const MatExpr& expr1, double s, MatExpr& res) const; + + virtual void divide(const MatExpr& expr1, const MatExpr& expr2, MatExpr& res, double scale=1) const; + virtual void divide(double s, const MatExpr& expr, MatExpr& res) const; + + virtual void abs(const MatExpr& expr, MatExpr& res) const; + + virtual void transpose(const MatExpr& expr, MatExpr& res) const; + virtual void matmul(const MatExpr& expr1, const MatExpr& expr2, MatExpr& res) const; + virtual void invert(const MatExpr& expr, int method, MatExpr& res) const; + + virtual Size size(const MatExpr& expr) const; + virtual int type(const MatExpr& expr) const; +}; + +/** @brief Matrix expression representation +@anchor MatrixExpressions +This is a list of implemented matrix operations that can be combined in arbitrary complex +expressions (here A, B stand for matrices ( Mat ), s for a scalar ( Scalar ), alpha for a +real-valued scalar ( double )): +- Addition, subtraction, negation: `A+B`, `A-B`, `A+s`, `A-s`, `s+A`, `s-A`, `-A` +- Scaling: `A*alpha` +- Per-element multiplication and division: `A.mul(B)`, `A/B`, `alpha/A` +- Matrix multiplication: `A*B` +- Transposition: `A.t()` (means AT) +- Matrix inversion and pseudo-inversion, solving linear systems and least-squares problems: + `A.inv([method]) (~ A-1)`, `A.inv([method])*B (~ X: AX=B)` +- Comparison: `A cmpop B`, `A cmpop alpha`, `alpha cmpop A`, where *cmpop* is one of + `>`, `>=`, `==`, `!=`, `<=`, `<`. The result of comparison is an 8-bit single channel mask whose + elements are set to 255 (if the particular element or pair of elements satisfy the condition) or + 0. +- Bitwise logical operations: `A logicop B`, `A logicop s`, `s logicop A`, `~A`, where *logicop* is one of + `&`, `|`, `^`. +- Element-wise minimum and maximum: `min(A, B)`, `min(A, alpha)`, `max(A, B)`, `max(A, alpha)` +- Element-wise absolute value: `abs(A)` +- Cross-product, dot-product: `A.cross(B)`, `A.dot(B)` +- Any function of matrix or matrices and scalars that returns a matrix or a scalar, such as norm, + mean, sum, countNonZero, trace, determinant, repeat, and others. +- Matrix initializers ( Mat::eye(), Mat::zeros(), Mat::ones() ), matrix comma-separated + initializers, matrix constructors and operators that extract sub-matrices (see Mat description). +- Mat_() constructors to cast the result to the proper type. +@note Comma-separated initializers and probably some other operations may require additional +explicit Mat() or Mat_() constructor calls to resolve a possible ambiguity. + +Here are examples of matrix expressions: +@code + // compute pseudo-inverse of A, equivalent to A.inv(DECOMP_SVD) + SVD svd(A); + Mat pinvA = svd.vt.t()*Mat::diag(1./svd.w)*svd.u.t(); + + // compute the new vector of parameters in the Levenberg-Marquardt algorithm + x -= (A.t()*A + lambda*Mat::eye(A.cols,A.cols,A.type())).inv(DECOMP_CHOLESKY)*(A.t()*err); + + // sharpen image using "unsharp mask" algorithm + Mat blurred; double sigma = 1, threshold = 5, amount = 1; + GaussianBlur(img, blurred, Size(), sigma, sigma); + Mat lowContrastMask = abs(img - blurred) < threshold; + Mat sharpened = img*(1+amount) + blurred*(-amount); + img.copyTo(sharpened, lowContrastMask); +@endcode +*/ +class CV_EXPORTS MatExpr +{ +public: + MatExpr(); + explicit MatExpr(const Mat& m); + + MatExpr(const MatOp* _op, int _flags, const Mat& _a = Mat(), const Mat& _b = Mat(), + const Mat& _c = Mat(), double _alpha = 1, double _beta = 1, const Scalar& _s = Scalar()); + + operator Mat() const; + template operator Mat_<_Tp>() const; + + Size size() const; + int type() const; + + MatExpr row(int y) const; + MatExpr col(int x) const; + MatExpr diag(int d = 0) const; + MatExpr operator()( const Range& rowRange, const Range& colRange ) const; + MatExpr operator()( const Rect& roi ) const; + + MatExpr t() const; + MatExpr inv(int method = DECOMP_LU) const; + MatExpr mul(const MatExpr& e, double scale=1) const; + MatExpr mul(const Mat& m, double scale=1) const; + + Mat cross(const Mat& m) const; + double dot(const Mat& m) const; + + const MatOp* op; + int flags; + + Mat a, b, c; + double alpha, beta; + Scalar s; +}; + +//! @} core_basic + +//! @relates cv::MatExpr +//! @{ +CV_EXPORTS MatExpr operator + (const Mat& a, const Mat& b); +CV_EXPORTS MatExpr operator + (const Mat& a, const Scalar& s); +CV_EXPORTS MatExpr operator + (const Scalar& s, const Mat& a); +CV_EXPORTS MatExpr operator + (const MatExpr& e, const Mat& m); +CV_EXPORTS MatExpr operator + (const Mat& m, const MatExpr& e); +CV_EXPORTS MatExpr operator + (const MatExpr& e, const Scalar& s); +CV_EXPORTS MatExpr operator + (const Scalar& s, const MatExpr& e); +CV_EXPORTS MatExpr operator + (const MatExpr& e1, const MatExpr& e2); + +CV_EXPORTS MatExpr operator - (const Mat& a, const Mat& b); +CV_EXPORTS MatExpr operator - (const Mat& a, const Scalar& s); +CV_EXPORTS MatExpr operator - (const Scalar& s, const Mat& a); +CV_EXPORTS MatExpr operator - (const MatExpr& e, const Mat& m); +CV_EXPORTS MatExpr operator - (const Mat& m, const MatExpr& e); +CV_EXPORTS MatExpr operator - (const MatExpr& e, const Scalar& s); +CV_EXPORTS MatExpr operator - (const Scalar& s, const MatExpr& e); +CV_EXPORTS MatExpr operator - (const MatExpr& e1, const MatExpr& e2); + +CV_EXPORTS MatExpr operator - (const Mat& m); +CV_EXPORTS MatExpr operator - (const MatExpr& e); + +CV_EXPORTS MatExpr operator * (const Mat& a, const Mat& b); +CV_EXPORTS MatExpr operator * (const Mat& a, double s); +CV_EXPORTS MatExpr operator * (double s, const Mat& a); +CV_EXPORTS MatExpr operator * (const MatExpr& e, const Mat& m); +CV_EXPORTS MatExpr operator * (const Mat& m, const MatExpr& e); +CV_EXPORTS MatExpr operator * (const MatExpr& e, double s); +CV_EXPORTS MatExpr operator * (double s, const MatExpr& e); +CV_EXPORTS MatExpr operator * (const MatExpr& e1, const MatExpr& e2); + +CV_EXPORTS MatExpr operator / (const Mat& a, const Mat& b); +CV_EXPORTS MatExpr operator / (const Mat& a, double s); +CV_EXPORTS MatExpr operator / (double s, const Mat& a); +CV_EXPORTS MatExpr operator / (const MatExpr& e, const Mat& m); +CV_EXPORTS MatExpr operator / (const Mat& m, const MatExpr& e); +CV_EXPORTS MatExpr operator / (const MatExpr& e, double s); +CV_EXPORTS MatExpr operator / (double s, const MatExpr& e); +CV_EXPORTS MatExpr operator / (const MatExpr& e1, const MatExpr& e2); + +CV_EXPORTS MatExpr operator < (const Mat& a, const Mat& b); +CV_EXPORTS MatExpr operator < (const Mat& a, double s); +CV_EXPORTS MatExpr operator < (double s, const Mat& a); + +CV_EXPORTS MatExpr operator <= (const Mat& a, const Mat& b); +CV_EXPORTS MatExpr operator <= (const Mat& a, double s); +CV_EXPORTS MatExpr operator <= (double s, const Mat& a); + +CV_EXPORTS MatExpr operator == (const Mat& a, const Mat& b); +CV_EXPORTS MatExpr operator == (const Mat& a, double s); +CV_EXPORTS MatExpr operator == (double s, const Mat& a); + +CV_EXPORTS MatExpr operator != (const Mat& a, const Mat& b); +CV_EXPORTS MatExpr operator != (const Mat& a, double s); +CV_EXPORTS MatExpr operator != (double s, const Mat& a); + +CV_EXPORTS MatExpr operator >= (const Mat& a, const Mat& b); +CV_EXPORTS MatExpr operator >= (const Mat& a, double s); +CV_EXPORTS MatExpr operator >= (double s, const Mat& a); + +CV_EXPORTS MatExpr operator > (const Mat& a, const Mat& b); +CV_EXPORTS MatExpr operator > (const Mat& a, double s); +CV_EXPORTS MatExpr operator > (double s, const Mat& a); + +CV_EXPORTS MatExpr operator & (const Mat& a, const Mat& b); +CV_EXPORTS MatExpr operator & (const Mat& a, const Scalar& s); +CV_EXPORTS MatExpr operator & (const Scalar& s, const Mat& a); + +CV_EXPORTS MatExpr operator | (const Mat& a, const Mat& b); +CV_EXPORTS MatExpr operator | (const Mat& a, const Scalar& s); +CV_EXPORTS MatExpr operator | (const Scalar& s, const Mat& a); + +CV_EXPORTS MatExpr operator ^ (const Mat& a, const Mat& b); +CV_EXPORTS MatExpr operator ^ (const Mat& a, const Scalar& s); +CV_EXPORTS MatExpr operator ^ (const Scalar& s, const Mat& a); + +CV_EXPORTS MatExpr operator ~(const Mat& m); + +CV_EXPORTS MatExpr min(const Mat& a, const Mat& b); +CV_EXPORTS MatExpr min(const Mat& a, double s); +CV_EXPORTS MatExpr min(double s, const Mat& a); + +CV_EXPORTS MatExpr max(const Mat& a, const Mat& b); +CV_EXPORTS MatExpr max(const Mat& a, double s); +CV_EXPORTS MatExpr max(double s, const Mat& a); + +/** @brief Calculates an absolute value of each matrix element. + +abs is a meta-function that is expanded to one of absdiff or convertScaleAbs forms: +- C = abs(A-B) is equivalent to `absdiff(A, B, C)` +- C = abs(A) is equivalent to `absdiff(A, Scalar::all(0), C)` +- C = `Mat_ >(abs(A*alpha + beta))` is equivalent to `convertScaleAbs(A, C, alpha, +beta)` + +The output matrix has the same size and the same type as the input one except for the last case, +where C is depth=CV_8U . +@param m matrix. +@sa @ref MatrixExpressions, absdiff, convertScaleAbs + */ +CV_EXPORTS MatExpr abs(const Mat& m); +/** @overload +@param e matrix expression. +*/ +CV_EXPORTS MatExpr abs(const MatExpr& e); +//! @} relates cv::MatExpr + +} // cv + +#include "opencv2/core/mat.inl.hpp" + +#endif // __OPENCV_CORE_MAT_HPP__ diff --git a/lib/opencv/include/opencv2/core/mat.inl.hpp b/lib/opencv/include/opencv2/core/mat.inl.hpp new file mode 100644 index 000000000..54103401f --- /dev/null +++ b/lib/opencv/include/opencv2/core/mat.inl.hpp @@ -0,0 +1,3668 @@ +/*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. +// 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_MATRIX_OPERATIONS_HPP__ +#define __OPENCV_CORE_MATRIX_OPERATIONS_HPP__ + +#ifndef __cplusplus +# error mat.inl.hpp header must be compiled as C++ +#endif + +namespace cv +{ + +//! @cond IGNORED + +//////////////////////// Input/Output Arrays //////////////////////// + +inline void _InputArray::init(int _flags, const void* _obj) +{ flags = _flags; obj = (void*)_obj; } + +inline void _InputArray::init(int _flags, const void* _obj, Size _sz) +{ flags = _flags; obj = (void*)_obj; sz = _sz; } + +inline void* _InputArray::getObj() const { return obj; } +inline int _InputArray::getFlags() const { return flags; } +inline Size _InputArray::getSz() const { return sz; } + +inline _InputArray::_InputArray() { init(NONE, 0); } +inline _InputArray::_InputArray(int _flags, void* _obj) { init(_flags, _obj); } +inline _InputArray::_InputArray(const Mat& m) { init(MAT+ACCESS_READ, &m); } +inline _InputArray::_InputArray(const std::vector& vec) { init(STD_VECTOR_MAT+ACCESS_READ, &vec); } +inline _InputArray::_InputArray(const UMat& m) { init(UMAT+ACCESS_READ, &m); } +inline _InputArray::_InputArray(const std::vector& vec) { init(STD_VECTOR_UMAT+ACCESS_READ, &vec); } + +template inline +_InputArray::_InputArray(const std::vector<_Tp>& vec) +{ init(FIXED_TYPE + STD_VECTOR + DataType<_Tp>::type + ACCESS_READ, &vec); } + +inline +_InputArray::_InputArray(const std::vector& vec) +{ init(FIXED_TYPE + STD_BOOL_VECTOR + DataType::type + ACCESS_READ, &vec); } + +template inline +_InputArray::_InputArray(const std::vector >& vec) +{ init(FIXED_TYPE + STD_VECTOR_VECTOR + DataType<_Tp>::type + ACCESS_READ, &vec); } + +template inline +_InputArray::_InputArray(const std::vector >& vec) +{ init(FIXED_TYPE + STD_VECTOR_MAT + DataType<_Tp>::type + ACCESS_READ, &vec); } + +template inline +_InputArray::_InputArray(const Matx<_Tp, m, n>& mtx) +{ init(FIXED_TYPE + FIXED_SIZE + MATX + DataType<_Tp>::type + ACCESS_READ, &mtx, Size(n, m)); } + +template inline +_InputArray::_InputArray(const _Tp* vec, int n) +{ init(FIXED_TYPE + FIXED_SIZE + MATX + DataType<_Tp>::type + ACCESS_READ, vec, Size(n, 1)); } + +template inline +_InputArray::_InputArray(const Mat_<_Tp>& m) +{ init(FIXED_TYPE + MAT + DataType<_Tp>::type + ACCESS_READ, &m); } + +inline _InputArray::_InputArray(const double& val) +{ init(FIXED_TYPE + FIXED_SIZE + MATX + CV_64F + ACCESS_READ, &val, Size(1,1)); } + +inline _InputArray::_InputArray(const MatExpr& expr) +{ init(FIXED_TYPE + FIXED_SIZE + EXPR + ACCESS_READ, &expr); } + +inline _InputArray::_InputArray(const cuda::GpuMat& d_mat) +{ init(CUDA_GPU_MAT + ACCESS_READ, &d_mat); } + +inline _InputArray::_InputArray(const std::vector& d_mat) +{ init(STD_VECTOR_CUDA_GPU_MAT + ACCESS_READ, &d_mat);} + +inline _InputArray::_InputArray(const ogl::Buffer& buf) +{ init(OPENGL_BUFFER + ACCESS_READ, &buf); } + +inline _InputArray::_InputArray(const cuda::HostMem& cuda_mem) +{ init(CUDA_HOST_MEM + ACCESS_READ, &cuda_mem); } + +inline _InputArray::~_InputArray() {} + +inline Mat _InputArray::getMat(int i) const +{ + if( kind() == MAT && i < 0 ) + return *(const Mat*)obj; + return getMat_(i); +} + +inline bool _InputArray::isMat() const { return kind() == _InputArray::MAT; } +inline bool _InputArray::isUMat() const { return kind() == _InputArray::UMAT; } +inline bool _InputArray::isMatVector() const { return kind() == _InputArray::STD_VECTOR_MAT; } +inline bool _InputArray::isUMatVector() const { return kind() == _InputArray::STD_VECTOR_UMAT; } +inline bool _InputArray::isMatx() const { return kind() == _InputArray::MATX; } +inline bool _InputArray::isVector() const { return kind() == _InputArray::STD_VECTOR || kind() == _InputArray::STD_BOOL_VECTOR; } +inline bool _InputArray::isGpuMatVector() const { return kind() == _InputArray::STD_VECTOR_CUDA_GPU_MAT; } + +//////////////////////////////////////////////////////////////////////////////////////// + +inline _OutputArray::_OutputArray() { init(ACCESS_WRITE, 0); } +inline _OutputArray::_OutputArray(int _flags, void* _obj) { init(_flags|ACCESS_WRITE, _obj); } +inline _OutputArray::_OutputArray(Mat& m) { init(MAT+ACCESS_WRITE, &m); } +inline _OutputArray::_OutputArray(std::vector& vec) { init(STD_VECTOR_MAT+ACCESS_WRITE, &vec); } +inline _OutputArray::_OutputArray(UMat& m) { init(UMAT+ACCESS_WRITE, &m); } +inline _OutputArray::_OutputArray(std::vector& vec) { init(STD_VECTOR_UMAT+ACCESS_WRITE, &vec); } + +template inline +_OutputArray::_OutputArray(std::vector<_Tp>& vec) +{ init(FIXED_TYPE + STD_VECTOR + DataType<_Tp>::type + ACCESS_WRITE, &vec); } + +inline +_OutputArray::_OutputArray(std::vector&) +{ CV_Error(Error::StsUnsupportedFormat, "std::vector cannot be an output array\n"); } + +template inline +_OutputArray::_OutputArray(std::vector >& vec) +{ init(FIXED_TYPE + STD_VECTOR_VECTOR + DataType<_Tp>::type + ACCESS_WRITE, &vec); } + +template inline +_OutputArray::_OutputArray(std::vector >& vec) +{ init(FIXED_TYPE + STD_VECTOR_MAT + DataType<_Tp>::type + ACCESS_WRITE, &vec); } + +template inline +_OutputArray::_OutputArray(Mat_<_Tp>& m) +{ init(FIXED_TYPE + MAT + DataType<_Tp>::type + ACCESS_WRITE, &m); } + +template inline +_OutputArray::_OutputArray(Matx<_Tp, m, n>& mtx) +{ init(FIXED_TYPE + FIXED_SIZE + MATX + DataType<_Tp>::type + ACCESS_WRITE, &mtx, Size(n, m)); } + +template inline +_OutputArray::_OutputArray(_Tp* vec, int n) +{ init(FIXED_TYPE + FIXED_SIZE + MATX + DataType<_Tp>::type + ACCESS_WRITE, vec, Size(n, 1)); } + +template inline +_OutputArray::_OutputArray(const std::vector<_Tp>& vec) +{ init(FIXED_TYPE + FIXED_SIZE + STD_VECTOR + DataType<_Tp>::type + ACCESS_WRITE, &vec); } + +template inline +_OutputArray::_OutputArray(const std::vector >& vec) +{ init(FIXED_TYPE + FIXED_SIZE + STD_VECTOR_VECTOR + DataType<_Tp>::type + ACCESS_WRITE, &vec); } + +template inline +_OutputArray::_OutputArray(const std::vector >& vec) +{ init(FIXED_TYPE + FIXED_SIZE + STD_VECTOR_MAT + DataType<_Tp>::type + ACCESS_WRITE, &vec); } + +template inline +_OutputArray::_OutputArray(const Mat_<_Tp>& m) +{ init(FIXED_TYPE + FIXED_SIZE + MAT + DataType<_Tp>::type + ACCESS_WRITE, &m); } + +template inline +_OutputArray::_OutputArray(const Matx<_Tp, m, n>& mtx) +{ init(FIXED_TYPE + FIXED_SIZE + MATX + DataType<_Tp>::type + ACCESS_WRITE, &mtx, Size(n, m)); } + +template inline +_OutputArray::_OutputArray(const _Tp* vec, int n) +{ init(FIXED_TYPE + FIXED_SIZE + MATX + DataType<_Tp>::type + ACCESS_WRITE, vec, Size(n, 1)); } + +inline _OutputArray::_OutputArray(cuda::GpuMat& d_mat) +{ init(CUDA_GPU_MAT + ACCESS_WRITE, &d_mat); } + +inline _OutputArray::_OutputArray(std::vector& d_mat) +{ init(STD_VECTOR_CUDA_GPU_MAT + ACCESS_WRITE, &d_mat);} + +inline _OutputArray::_OutputArray(ogl::Buffer& buf) +{ init(OPENGL_BUFFER + ACCESS_WRITE, &buf); } + +inline _OutputArray::_OutputArray(cuda::HostMem& cuda_mem) +{ init(CUDA_HOST_MEM + ACCESS_WRITE, &cuda_mem); } + +inline _OutputArray::_OutputArray(const Mat& m) +{ init(FIXED_TYPE + FIXED_SIZE + MAT + ACCESS_WRITE, &m); } + +inline _OutputArray::_OutputArray(const std::vector& vec) +{ init(FIXED_SIZE + STD_VECTOR_MAT + ACCESS_WRITE, &vec); } + +inline _OutputArray::_OutputArray(const UMat& m) +{ init(FIXED_TYPE + FIXED_SIZE + UMAT + ACCESS_WRITE, &m); } + +inline _OutputArray::_OutputArray(const std::vector& vec) +{ init(FIXED_SIZE + STD_VECTOR_UMAT + ACCESS_WRITE, &vec); } + +inline _OutputArray::_OutputArray(const cuda::GpuMat& d_mat) +{ init(FIXED_TYPE + FIXED_SIZE + CUDA_GPU_MAT + ACCESS_WRITE, &d_mat); } + + +inline _OutputArray::_OutputArray(const ogl::Buffer& buf) +{ init(FIXED_TYPE + FIXED_SIZE + OPENGL_BUFFER + ACCESS_WRITE, &buf); } + +inline _OutputArray::_OutputArray(const cuda::HostMem& cuda_mem) +{ init(FIXED_TYPE + FIXED_SIZE + CUDA_HOST_MEM + ACCESS_WRITE, &cuda_mem); } + +/////////////////////////////////////////////////////////////////////////////////////////// + +inline _InputOutputArray::_InputOutputArray() { init(ACCESS_RW, 0); } +inline _InputOutputArray::_InputOutputArray(int _flags, void* _obj) { init(_flags|ACCESS_RW, _obj); } +inline _InputOutputArray::_InputOutputArray(Mat& m) { init(MAT+ACCESS_RW, &m); } +inline _InputOutputArray::_InputOutputArray(std::vector& vec) { init(STD_VECTOR_MAT+ACCESS_RW, &vec); } +inline _InputOutputArray::_InputOutputArray(UMat& m) { init(UMAT+ACCESS_RW, &m); } +inline _InputOutputArray::_InputOutputArray(std::vector& vec) { init(STD_VECTOR_UMAT+ACCESS_RW, &vec); } + +template inline +_InputOutputArray::_InputOutputArray(std::vector<_Tp>& vec) +{ init(FIXED_TYPE + STD_VECTOR + DataType<_Tp>::type + ACCESS_RW, &vec); } + +inline _InputOutputArray::_InputOutputArray(std::vector&) +{ CV_Error(Error::StsUnsupportedFormat, "std::vector cannot be an input/output array\n"); } + +template inline +_InputOutputArray::_InputOutputArray(std::vector >& vec) +{ init(FIXED_TYPE + STD_VECTOR_VECTOR + DataType<_Tp>::type + ACCESS_RW, &vec); } + +template inline +_InputOutputArray::_InputOutputArray(std::vector >& vec) +{ init(FIXED_TYPE + STD_VECTOR_MAT + DataType<_Tp>::type + ACCESS_RW, &vec); } + +template inline +_InputOutputArray::_InputOutputArray(Mat_<_Tp>& m) +{ init(FIXED_TYPE + MAT + DataType<_Tp>::type + ACCESS_RW, &m); } + +template inline +_InputOutputArray::_InputOutputArray(Matx<_Tp, m, n>& mtx) +{ init(FIXED_TYPE + FIXED_SIZE + MATX + DataType<_Tp>::type + ACCESS_RW, &mtx, Size(n, m)); } + +template inline +_InputOutputArray::_InputOutputArray(_Tp* vec, int n) +{ init(FIXED_TYPE + FIXED_SIZE + MATX + DataType<_Tp>::type + ACCESS_RW, vec, Size(n, 1)); } + +template inline +_InputOutputArray::_InputOutputArray(const std::vector<_Tp>& vec) +{ init(FIXED_TYPE + FIXED_SIZE + STD_VECTOR + DataType<_Tp>::type + ACCESS_RW, &vec); } + +template inline +_InputOutputArray::_InputOutputArray(const std::vector >& vec) +{ init(FIXED_TYPE + FIXED_SIZE + STD_VECTOR_VECTOR + DataType<_Tp>::type + ACCESS_RW, &vec); } + +template inline +_InputOutputArray::_InputOutputArray(const std::vector >& vec) +{ init(FIXED_TYPE + FIXED_SIZE + STD_VECTOR_MAT + DataType<_Tp>::type + ACCESS_RW, &vec); } + +template inline +_InputOutputArray::_InputOutputArray(const Mat_<_Tp>& m) +{ init(FIXED_TYPE + FIXED_SIZE + MAT + DataType<_Tp>::type + ACCESS_RW, &m); } + +template inline +_InputOutputArray::_InputOutputArray(const Matx<_Tp, m, n>& mtx) +{ init(FIXED_TYPE + FIXED_SIZE + MATX + DataType<_Tp>::type + ACCESS_RW, &mtx, Size(n, m)); } + +template inline +_InputOutputArray::_InputOutputArray(const _Tp* vec, int n) +{ init(FIXED_TYPE + FIXED_SIZE + MATX + DataType<_Tp>::type + ACCESS_RW, vec, Size(n, 1)); } + +inline _InputOutputArray::_InputOutputArray(cuda::GpuMat& d_mat) +{ init(CUDA_GPU_MAT + ACCESS_RW, &d_mat); } + +inline _InputOutputArray::_InputOutputArray(ogl::Buffer& buf) +{ init(OPENGL_BUFFER + ACCESS_RW, &buf); } + +inline _InputOutputArray::_InputOutputArray(cuda::HostMem& cuda_mem) +{ init(CUDA_HOST_MEM + ACCESS_RW, &cuda_mem); } + +inline _InputOutputArray::_InputOutputArray(const Mat& m) +{ init(FIXED_TYPE + FIXED_SIZE + MAT + ACCESS_RW, &m); } + +inline _InputOutputArray::_InputOutputArray(const std::vector& vec) +{ init(FIXED_SIZE + STD_VECTOR_MAT + ACCESS_RW, &vec); } + +inline _InputOutputArray::_InputOutputArray(const UMat& m) +{ init(FIXED_TYPE + FIXED_SIZE + UMAT + ACCESS_RW, &m); } + +inline _InputOutputArray::_InputOutputArray(const std::vector& vec) +{ init(FIXED_SIZE + STD_VECTOR_UMAT + ACCESS_RW, &vec); } + +inline _InputOutputArray::_InputOutputArray(const cuda::GpuMat& d_mat) +{ init(FIXED_TYPE + FIXED_SIZE + CUDA_GPU_MAT + ACCESS_RW, &d_mat); } +inline _InputOutputArray::_InputOutputArray(const std::vector& d_mat) +{ init(FIXED_TYPE + FIXED_SIZE + STD_VECTOR_CUDA_GPU_MAT + ACCESS_RW, &d_mat);} + +inline _InputOutputArray::_InputOutputArray(const ogl::Buffer& buf) +{ init(FIXED_TYPE + FIXED_SIZE + OPENGL_BUFFER + ACCESS_RW, &buf); } + +inline _InputOutputArray::_InputOutputArray(const cuda::HostMem& cuda_mem) +{ init(FIXED_TYPE + FIXED_SIZE + CUDA_HOST_MEM + ACCESS_RW, &cuda_mem); } + +//////////////////////////////////////////// Mat ////////////////////////////////////////// + +inline +Mat::Mat() + : flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0), + datalimit(0), allocator(0), u(0), size(&rows) +{} + +inline +Mat::Mat(int _rows, int _cols, int _type) + : flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0), + datalimit(0), allocator(0), u(0), size(&rows) +{ + create(_rows, _cols, _type); +} + +inline +Mat::Mat(int _rows, int _cols, int _type, const Scalar& _s) + : flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0), + datalimit(0), allocator(0), u(0), size(&rows) +{ + create(_rows, _cols, _type); + *this = _s; +} + +inline +Mat::Mat(Size _sz, int _type) + : flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0), + datalimit(0), allocator(0), u(0), size(&rows) +{ + create( _sz.height, _sz.width, _type ); +} + +inline +Mat::Mat(Size _sz, int _type, const Scalar& _s) + : flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0), + datalimit(0), allocator(0), u(0), size(&rows) +{ + create(_sz.height, _sz.width, _type); + *this = _s; +} + +inline +Mat::Mat(int _dims, const int* _sz, int _type) + : flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0), + datalimit(0), allocator(0), u(0), size(&rows) +{ + create(_dims, _sz, _type); +} + +inline +Mat::Mat(int _dims, const int* _sz, int _type, const Scalar& _s) + : flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0), + datalimit(0), allocator(0), u(0), size(&rows) +{ + create(_dims, _sz, _type); + *this = _s; +} + +inline +Mat::Mat(const Mat& m) + : flags(m.flags), dims(m.dims), rows(m.rows), cols(m.cols), data(m.data), + datastart(m.datastart), dataend(m.dataend), datalimit(m.datalimit), allocator(m.allocator), + u(m.u), size(&rows) +{ + if( u ) + CV_XADD(&u->refcount, 1); + if( m.dims <= 2 ) + { + step[0] = m.step[0]; step[1] = m.step[1]; + } + else + { + dims = 0; + copySize(m); + } +} + +inline +Mat::Mat(int _rows, int _cols, int _type, void* _data, size_t _step) + : flags(MAGIC_VAL + (_type & TYPE_MASK)), dims(2), rows(_rows), cols(_cols), + data((uchar*)_data), datastart((uchar*)_data), dataend(0), datalimit(0), + allocator(0), u(0), size(&rows) +{ + CV_Assert(total() == 0 || data != NULL); + + size_t esz = CV_ELEM_SIZE(_type), esz1 = CV_ELEM_SIZE1(_type); + size_t minstep = cols * esz; + if( _step == AUTO_STEP ) + { + _step = minstep; + flags |= CONTINUOUS_FLAG; + } + else + { + if( rows == 1 ) _step = minstep; + CV_DbgAssert( _step >= minstep ); + + if (_step % esz1 != 0) + { + CV_Error(Error::BadStep, "Step must be a multiple of esz1"); + } + + flags |= _step == minstep ? CONTINUOUS_FLAG : 0; + } + step[0] = _step; + step[1] = esz; + datalimit = datastart + _step * rows; + dataend = datalimit - _step + minstep; +} + +inline +Mat::Mat(Size _sz, int _type, void* _data, size_t _step) + : flags(MAGIC_VAL + (_type & TYPE_MASK)), dims(2), rows(_sz.height), cols(_sz.width), + data((uchar*)_data), datastart((uchar*)_data), dataend(0), datalimit(0), + allocator(0), u(0), size(&rows) +{ + CV_Assert(total() == 0 || data != NULL); + + size_t esz = CV_ELEM_SIZE(_type), esz1 = CV_ELEM_SIZE1(_type); + size_t minstep = cols*esz; + if( _step == AUTO_STEP ) + { + _step = minstep; + flags |= CONTINUOUS_FLAG; + } + else + { + if( rows == 1 ) _step = minstep; + CV_DbgAssert( _step >= minstep ); + + if (_step % esz1 != 0) + { + CV_Error(Error::BadStep, "Step must be a multiple of esz1"); + } + + flags |= _step == minstep ? CONTINUOUS_FLAG : 0; + } + step[0] = _step; + step[1] = esz; + datalimit = datastart + _step*rows; + dataend = datalimit - _step + minstep; +} + +template inline +Mat::Mat(const std::vector<_Tp>& vec, bool copyData) + : flags(MAGIC_VAL | DataType<_Tp>::type | CV_MAT_CONT_FLAG), dims(2), rows((int)vec.size()), + cols(1), data(0), datastart(0), dataend(0), allocator(0), u(0), size(&rows) +{ + if(vec.empty()) + return; + if( !copyData ) + { + step[0] = step[1] = sizeof(_Tp); + datastart = data = (uchar*)&vec[0]; + datalimit = dataend = datastart + rows * step[0]; + } + else + Mat((int)vec.size(), 1, DataType<_Tp>::type, (uchar*)&vec[0]).copyTo(*this); +} + +template inline +Mat::Mat(const Vec<_Tp, n>& vec, bool copyData) + : flags(MAGIC_VAL | DataType<_Tp>::type | CV_MAT_CONT_FLAG), dims(2), rows(n), cols(1), data(0), + datastart(0), dataend(0), allocator(0), u(0), size(&rows) +{ + if( !copyData ) + { + step[0] = step[1] = sizeof(_Tp); + datastart = data = (uchar*)vec.val; + datalimit = dataend = datastart + rows * step[0]; + } + else + Mat(n, 1, DataType<_Tp>::type, (void*)vec.val).copyTo(*this); +} + + +template inline +Mat::Mat(const Matx<_Tp,m,n>& M, bool copyData) + : flags(MAGIC_VAL | DataType<_Tp>::type | CV_MAT_CONT_FLAG), dims(2), rows(m), cols(n), data(0), + datastart(0), dataend(0), allocator(0), u(0), size(&rows) +{ + if( !copyData ) + { + step[0] = cols * sizeof(_Tp); + step[1] = sizeof(_Tp); + datastart = data = (uchar*)M.val; + datalimit = dataend = datastart + rows * step[0]; + } + else + Mat(m, n, DataType<_Tp>::type, (uchar*)M.val).copyTo(*this); +} + +template inline +Mat::Mat(const Point_<_Tp>& pt, bool copyData) + : flags(MAGIC_VAL | DataType<_Tp>::type | CV_MAT_CONT_FLAG), dims(2), rows(2), cols(1), data(0), + datastart(0), dataend(0), allocator(0), u(0), size(&rows) +{ + if( !copyData ) + { + step[0] = step[1] = sizeof(_Tp); + datastart = data = (uchar*)&pt.x; + datalimit = dataend = datastart + rows * step[0]; + } + else + { + create(2, 1, DataType<_Tp>::type); + ((_Tp*)data)[0] = pt.x; + ((_Tp*)data)[1] = pt.y; + } +} + +template inline +Mat::Mat(const Point3_<_Tp>& pt, bool copyData) + : flags(MAGIC_VAL | DataType<_Tp>::type | CV_MAT_CONT_FLAG), dims(2), rows(3), cols(1), data(0), + datastart(0), dataend(0), allocator(0), u(0), size(&rows) +{ + if( !copyData ) + { + step[0] = step[1] = sizeof(_Tp); + datastart = data = (uchar*)&pt.x; + datalimit = dataend = datastart + rows * step[0]; + } + else + { + create(3, 1, DataType<_Tp>::type); + ((_Tp*)data)[0] = pt.x; + ((_Tp*)data)[1] = pt.y; + ((_Tp*)data)[2] = pt.z; + } +} + +template inline +Mat::Mat(const MatCommaInitializer_<_Tp>& commaInitializer) + : flags(MAGIC_VAL | DataType<_Tp>::type | CV_MAT_CONT_FLAG), dims(0), rows(0), cols(0), data(0), + datastart(0), dataend(0), allocator(0), u(0), size(&rows) +{ + *this = commaInitializer.operator Mat_<_Tp>(); +} + +inline +Mat::~Mat() +{ + release(); + if( step.p != step.buf ) + fastFree(step.p); +} + +inline +Mat& Mat::operator = (const Mat& m) +{ + if( this != &m ) + { + if( m.u ) + CV_XADD(&m.u->refcount, 1); + release(); + flags = m.flags; + if( dims <= 2 && m.dims <= 2 ) + { + dims = m.dims; + rows = m.rows; + cols = m.cols; + step[0] = m.step[0]; + step[1] = m.step[1]; + } + else + copySize(m); + data = m.data; + datastart = m.datastart; + dataend = m.dataend; + datalimit = m.datalimit; + allocator = m.allocator; + u = m.u; + } + return *this; +} + +inline +Mat Mat::row(int y) const +{ + return Mat(*this, Range(y, y + 1), Range::all()); +} + +inline +Mat Mat::col(int x) const +{ + return Mat(*this, Range::all(), Range(x, x + 1)); +} + +inline +Mat Mat::rowRange(int startrow, int endrow) const +{ + return Mat(*this, Range(startrow, endrow), Range::all()); +} + +inline +Mat Mat::rowRange(const Range& r) const +{ + return Mat(*this, r, Range::all()); +} + +inline +Mat Mat::colRange(int startcol, int endcol) const +{ + return Mat(*this, Range::all(), Range(startcol, endcol)); +} + +inline +Mat Mat::colRange(const Range& r) const +{ + return Mat(*this, Range::all(), r); +} + +inline +Mat Mat::clone() const +{ + Mat m; + copyTo(m); + return m; +} + +inline +void Mat::assignTo( Mat& m, int _type ) const +{ + if( _type < 0 ) + m = *this; + else + convertTo(m, _type); +} + +inline +void Mat::create(int _rows, int _cols, int _type) +{ + _type &= TYPE_MASK; + if( dims <= 2 && rows == _rows && cols == _cols && type() == _type && data ) + return; + int sz[] = {_rows, _cols}; + create(2, sz, _type); +} + +inline +void Mat::create(Size _sz, int _type) +{ + create(_sz.height, _sz.width, _type); +} + +inline +void Mat::addref() +{ + if( u ) + CV_XADD(&u->refcount, 1); +} + +inline void Mat::release() +{ + if( u && CV_XADD(&u->refcount, -1) == 1 ) + deallocate(); + u = NULL; + datastart = dataend = datalimit = data = 0; + for(int i = 0; i < dims; i++) + size.p[i] = 0; +} + +inline +Mat Mat::operator()( Range _rowRange, Range _colRange ) const +{ + return Mat(*this, _rowRange, _colRange); +} + +inline +Mat Mat::operator()( const Rect& roi ) const +{ + return Mat(*this, roi); +} + +inline +Mat Mat::operator()(const Range* ranges) const +{ + return Mat(*this, ranges); +} + +inline +bool Mat::isContinuous() const +{ + return (flags & CONTINUOUS_FLAG) != 0; +} + +inline +bool Mat::isSubmatrix() const +{ + return (flags & SUBMATRIX_FLAG) != 0; +} + +inline +size_t Mat::elemSize() const +{ + return dims > 0 ? step.p[dims - 1] : 0; +} + +inline +size_t Mat::elemSize1() const +{ + return CV_ELEM_SIZE1(flags); +} + +inline +int Mat::type() const +{ + return CV_MAT_TYPE(flags); +} + +inline +int Mat::depth() const +{ + return CV_MAT_DEPTH(flags); +} + +inline +int Mat::channels() const +{ + return CV_MAT_CN(flags); +} + +inline +size_t Mat::step1(int i) const +{ + return step.p[i] / elemSize1(); +} + +inline +bool Mat::empty() const +{ + return data == 0 || total() == 0; +} + +inline +size_t Mat::total() const +{ + if( dims <= 2 ) + return (size_t)rows * cols; + size_t p = 1; + for( int i = 0; i < dims; i++ ) + p *= size[i]; + return p; +} + +inline +uchar* Mat::ptr(int y) +{ + CV_DbgAssert( y == 0 || (data && dims >= 1 && (unsigned)y < (unsigned)size.p[0]) ); + return data + step.p[0] * y; +} + +inline +const uchar* Mat::ptr(int y) const +{ + CV_DbgAssert( y == 0 || (data && dims >= 1 && (unsigned)y < (unsigned)size.p[0]) ); + return data + step.p[0] * y; +} + +template inline +_Tp* Mat::ptr(int y) +{ + CV_DbgAssert( y == 0 || (data && dims >= 1 && (unsigned)y < (unsigned)size.p[0]) ); + return (_Tp*)(data + step.p[0] * y); +} + +template inline +const _Tp* Mat::ptr(int y) const +{ + CV_DbgAssert( y == 0 || (data && dims >= 1 && data && (unsigned)y < (unsigned)size.p[0]) ); + return (const _Tp*)(data + step.p[0] * y); +} + +inline +uchar* Mat::ptr(int i0, int i1) +{ + CV_DbgAssert(dims >= 2); + CV_DbgAssert(data); + CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]); + CV_DbgAssert((unsigned)i1 < (unsigned)size.p[1]); + return data + i0 * step.p[0] + i1 * step.p[1]; +} + +inline +const uchar* Mat::ptr(int i0, int i1) const +{ + CV_DbgAssert(dims >= 2); + CV_DbgAssert(data); + CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]); + CV_DbgAssert((unsigned)i1 < (unsigned)size.p[1]); + return data + i0 * step.p[0] + i1 * step.p[1]; +} + +template inline +_Tp* Mat::ptr(int i0, int i1) +{ + CV_DbgAssert(dims >= 2); + CV_DbgAssert(data); + CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]); + CV_DbgAssert((unsigned)i1 < (unsigned)size.p[1]); + return (_Tp*)(data + i0 * step.p[0] + i1 * step.p[1]); +} + +template inline +const _Tp* Mat::ptr(int i0, int i1) const +{ + CV_DbgAssert(dims >= 2); + CV_DbgAssert(data); + CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]); + CV_DbgAssert((unsigned)i1 < (unsigned)size.p[1]); + return (const _Tp*)(data + i0 * step.p[0] + i1 * step.p[1]); +} + +inline +uchar* Mat::ptr(int i0, int i1, int i2) +{ + CV_DbgAssert(dims >= 3); + CV_DbgAssert(data); + CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]); + CV_DbgAssert((unsigned)i1 < (unsigned)size.p[1]); + CV_DbgAssert((unsigned)i2 < (unsigned)size.p[2]); + return data + i0 * step.p[0] + i1 * step.p[1] + i2 * step.p[2]; +} + +inline +const uchar* Mat::ptr(int i0, int i1, int i2) const +{ + CV_DbgAssert(dims >= 3); + CV_DbgAssert(data); + CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]); + CV_DbgAssert((unsigned)i1 < (unsigned)size.p[1]); + CV_DbgAssert((unsigned)i2 < (unsigned)size.p[2]); + return data + i0 * step.p[0] + i1 * step.p[1] + i2 * step.p[2]; +} + +template inline +_Tp* Mat::ptr(int i0, int i1, int i2) +{ + CV_DbgAssert(dims >= 3); + CV_DbgAssert(data); + CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]); + CV_DbgAssert((unsigned)i1 < (unsigned)size.p[1]); + CV_DbgAssert((unsigned)i2 < (unsigned)size.p[2]); + return (_Tp*)(data + i0 * step.p[0] + i1 * step.p[1] + i2 * step.p[2]); +} + +template inline +const _Tp* Mat::ptr(int i0, int i1, int i2) const +{ + CV_DbgAssert(dims >= 3); + CV_DbgAssert(data); + CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]); + CV_DbgAssert((unsigned)i1 < (unsigned)size.p[1]); + CV_DbgAssert((unsigned)i2 < (unsigned)size.p[2]); + return (const _Tp*)(data + i0 * step.p[0] + i1 * step.p[1] + i2 * step.p[2]); +} + +inline +uchar* Mat::ptr(const int* idx) +{ + int i, d = dims; + uchar* p = data; + CV_DbgAssert( d >= 1 && p ); + for( i = 0; i < d; i++ ) + { + CV_DbgAssert( (unsigned)idx[i] < (unsigned)size.p[i] ); + p += idx[i] * step.p[i]; + } + return p; +} + +inline +const uchar* Mat::ptr(const int* idx) const +{ + int i, d = dims; + uchar* p = data; + CV_DbgAssert( d >= 1 && p ); + for( i = 0; i < d; i++ ) + { + CV_DbgAssert( (unsigned)idx[i] < (unsigned)size.p[i] ); + p += idx[i] * step.p[i]; + } + return p; +} + +template inline +_Tp& Mat::at(int i0, int i1) +{ + CV_DbgAssert(dims <= 2); + CV_DbgAssert(data); + CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]); + CV_DbgAssert((unsigned)(i1 * DataType<_Tp>::channels) < (unsigned)(size.p[1] * channels())); + CV_DbgAssert(CV_ELEM_SIZE1(DataType<_Tp>::depth) == elemSize1()); + return ((_Tp*)(data + step.p[0] * i0))[i1]; +} + +template inline +const _Tp& Mat::at(int i0, int i1) const +{ + CV_DbgAssert(dims <= 2); + CV_DbgAssert(data); + CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]); + CV_DbgAssert((unsigned)(i1 * DataType<_Tp>::channels) < (unsigned)(size.p[1] * channels())); + CV_DbgAssert(CV_ELEM_SIZE1(DataType<_Tp>::depth) == elemSize1()); + return ((const _Tp*)(data + step.p[0] * i0))[i1]; +} + +template inline +_Tp& Mat::at(Point pt) +{ + CV_DbgAssert(dims <= 2); + CV_DbgAssert(data); + CV_DbgAssert((unsigned)pt.y < (unsigned)size.p[0]); + CV_DbgAssert((unsigned)(pt.x * DataType<_Tp>::channels) < (unsigned)(size.p[1] * channels())); + CV_DbgAssert(CV_ELEM_SIZE1(DataType<_Tp>::depth) == elemSize1()); + return ((_Tp*)(data + step.p[0] * pt.y))[pt.x]; +} + +template inline +const _Tp& Mat::at(Point pt) const +{ + CV_DbgAssert(dims <= 2); + CV_DbgAssert(data); + CV_DbgAssert((unsigned)pt.y < (unsigned)size.p[0]); + CV_DbgAssert((unsigned)(pt.x * DataType<_Tp>::channels) < (unsigned)(size.p[1] * channels())); + CV_DbgAssert(CV_ELEM_SIZE1(DataType<_Tp>::depth) == elemSize1()); + return ((const _Tp*)(data + step.p[0] * pt.y))[pt.x]; +} + +template inline +_Tp& Mat::at(int i0) +{ + CV_DbgAssert(dims <= 2); + CV_DbgAssert(data); + CV_DbgAssert((unsigned)i0 < (unsigned)(size.p[0] * size.p[1])); + CV_DbgAssert(elemSize() == CV_ELEM_SIZE(DataType<_Tp>::type)); + if( isContinuous() || size.p[0] == 1 ) + return ((_Tp*)data)[i0]; + if( size.p[1] == 1 ) + return *(_Tp*)(data + step.p[0] * i0); + int i = i0 / cols, j = i0 - i * cols; + return ((_Tp*)(data + step.p[0] * i))[j]; +} + +template inline +const _Tp& Mat::at(int i0) const +{ + CV_DbgAssert(dims <= 2); + CV_DbgAssert(data); + CV_DbgAssert((unsigned)i0 < (unsigned)(size.p[0] * size.p[1])); + CV_DbgAssert(elemSize() == CV_ELEM_SIZE(DataType<_Tp>::type)); + if( isContinuous() || size.p[0] == 1 ) + return ((const _Tp*)data)[i0]; + if( size.p[1] == 1 ) + return *(const _Tp*)(data + step.p[0] * i0); + int i = i0 / cols, j = i0 - i * cols; + return ((const _Tp*)(data + step.p[0] * i))[j]; +} + +template inline +_Tp& Mat::at(int i0, int i1, int i2) +{ + CV_DbgAssert( elemSize() == CV_ELEM_SIZE(DataType<_Tp>::type) ); + return *(_Tp*)ptr(i0, i1, i2); +} + +template inline +const _Tp& Mat::at(int i0, int i1, int i2) const +{ + CV_DbgAssert( elemSize() == CV_ELEM_SIZE(DataType<_Tp>::type) ); + return *(const _Tp*)ptr(i0, i1, i2); +} + +template inline +_Tp& Mat::at(const int* idx) +{ + CV_DbgAssert( elemSize() == CV_ELEM_SIZE(DataType<_Tp>::type) ); + return *(_Tp*)ptr(idx); +} + +template inline +const _Tp& Mat::at(const int* idx) const +{ + CV_DbgAssert( elemSize() == CV_ELEM_SIZE(DataType<_Tp>::type) ); + return *(const _Tp*)ptr(idx); +} + +template inline +_Tp& Mat::at(const Vec& idx) +{ + CV_DbgAssert( elemSize() == CV_ELEM_SIZE(DataType<_Tp>::type) ); + return *(_Tp*)ptr(idx.val); +} + +template inline +const _Tp& Mat::at(const Vec& idx) const +{ + CV_DbgAssert( elemSize() == CV_ELEM_SIZE(DataType<_Tp>::type) ); + return *(const _Tp*)ptr(idx.val); +} + +template inline +MatConstIterator_<_Tp> Mat::begin() const +{ + CV_DbgAssert( elemSize() == sizeof(_Tp) ); + return MatConstIterator_<_Tp>((const Mat_<_Tp>*)this); +} + +template inline +MatConstIterator_<_Tp> Mat::end() const +{ + CV_DbgAssert( elemSize() == sizeof(_Tp) ); + MatConstIterator_<_Tp> it((const Mat_<_Tp>*)this); + it += total(); + return it; +} + +template inline +MatIterator_<_Tp> Mat::begin() +{ + CV_DbgAssert( elemSize() == sizeof(_Tp) ); + return MatIterator_<_Tp>((Mat_<_Tp>*)this); +} + +template inline +MatIterator_<_Tp> Mat::end() +{ + CV_DbgAssert( elemSize() == sizeof(_Tp) ); + MatIterator_<_Tp> it((Mat_<_Tp>*)this); + it += total(); + return it; +} + +template inline +void Mat::forEach(const Functor& operation) { + this->forEach_impl<_Tp>(operation); +} + +template inline +void Mat::forEach(const Functor& operation) const { + // call as not const + (const_cast(this))->forEach(operation); +} + +template inline +Mat::operator std::vector<_Tp>() const +{ + std::vector<_Tp> v; + copyTo(v); + return v; +} + +template inline +Mat::operator Vec<_Tp, n>() const +{ + CV_Assert( data && dims <= 2 && (rows == 1 || cols == 1) && + rows + cols - 1 == n && channels() == 1 ); + + if( isContinuous() && type() == DataType<_Tp>::type ) + return Vec<_Tp, n>((_Tp*)data); + Vec<_Tp, n> v; + Mat tmp(rows, cols, DataType<_Tp>::type, v.val); + convertTo(tmp, tmp.type()); + return v; +} + +template inline +Mat::operator Matx<_Tp, m, n>() const +{ + CV_Assert( data && dims <= 2 && rows == m && cols == n && channels() == 1 ); + + if( isContinuous() && type() == DataType<_Tp>::type ) + return Matx<_Tp, m, n>((_Tp*)data); + Matx<_Tp, m, n> mtx; + Mat tmp(rows, cols, DataType<_Tp>::type, mtx.val); + convertTo(tmp, tmp.type()); + return mtx; +} + +template inline +void Mat::push_back(const _Tp& elem) +{ + if( !data ) + { + *this = Mat(1, 1, DataType<_Tp>::type, (void*)&elem).clone(); + return; + } + CV_Assert(DataType<_Tp>::type == type() && cols == 1 + /* && dims == 2 (cols == 1 implies dims == 2) */); + const uchar* tmp = dataend + step[0]; + if( !isSubmatrix() && isContinuous() && tmp <= datalimit ) + { + *(_Tp*)(data + (size.p[0]++) * step.p[0]) = elem; + dataend = tmp; + } + else + push_back_(&elem); +} + +template inline +void Mat::push_back(const Mat_<_Tp>& m) +{ + push_back((const Mat&)m); +} + +template<> inline +void Mat::push_back(const MatExpr& expr) +{ + push_back(static_cast(expr)); +} + +#ifdef CV_CXX_MOVE_SEMANTICS + +inline +Mat::Mat(Mat&& m) + : flags(m.flags), dims(m.dims), rows(m.rows), cols(m.cols), data(m.data), + datastart(m.datastart), dataend(m.dataend), datalimit(m.datalimit), allocator(m.allocator), + u(m.u), size(&rows) +{ + if (m.dims <= 2) // move new step/size info + { + step[0] = m.step[0]; + step[1] = m.step[1]; + } + else + { + CV_DbgAssert(m.step.p != m.step.buf); + step.p = m.step.p; + size.p = m.size.p; + m.step.p = m.step.buf; + m.size.p = &m.rows; + } + m.flags = MAGIC_VAL; m.dims = m.rows = m.cols = 0; + m.data = NULL; m.datastart = NULL; m.dataend = NULL; m.datalimit = NULL; + m.allocator = NULL; + m.u = NULL; +} + +inline +Mat& Mat::operator = (Mat&& m) +{ + release(); + flags = m.flags; dims = m.dims; rows = m.rows; cols = m.cols; data = m.data; + datastart = m.datastart; dataend = m.dataend; datalimit = m.datalimit; allocator = m.allocator; + u = m.u; + if (step.p != step.buf) // release self step/size + { + fastFree(step.p); + step.p = step.buf; + size.p = &rows; + } + if (m.dims <= 2) // move new step/size info + { + step[0] = m.step[0]; + step[1] = m.step[1]; + } + else + { + CV_DbgAssert(m.step.p != m.step.buf); + step.p = m.step.p; + size.p = m.size.p; + m.step.p = m.step.buf; + m.size.p = &m.rows; + } + m.flags = MAGIC_VAL; m.dims = m.rows = m.cols = 0; + m.data = NULL; m.datastart = NULL; m.dataend = NULL; m.datalimit = NULL; + m.allocator = NULL; + m.u = NULL; + return *this; +} + +#endif + + +///////////////////////////// MatSize //////////////////////////// + +inline +MatSize::MatSize(int* _p) + : p(_p) {} + +inline +Size MatSize::operator()() const +{ + CV_DbgAssert(p[-1] <= 2); + return Size(p[1], p[0]); +} + +inline +const int& MatSize::operator[](int i) const +{ + return p[i]; +} + +inline +int& MatSize::operator[](int i) +{ + return p[i]; +} + +inline +MatSize::operator const int*() const +{ + return p; +} + +inline +bool MatSize::operator == (const MatSize& sz) const +{ + int d = p[-1]; + int dsz = sz.p[-1]; + if( d != dsz ) + return false; + if( d == 2 ) + return p[0] == sz.p[0] && p[1] == sz.p[1]; + + for( int i = 0; i < d; i++ ) + if( p[i] != sz.p[i] ) + return false; + return true; +} + +inline +bool MatSize::operator != (const MatSize& sz) const +{ + return !(*this == sz); +} + + + +///////////////////////////// MatStep //////////////////////////// + +inline +MatStep::MatStep() +{ + p = buf; p[0] = p[1] = 0; +} + +inline +MatStep::MatStep(size_t s) +{ + p = buf; p[0] = s; p[1] = 0; +} + +inline +const size_t& MatStep::operator[](int i) const +{ + return p[i]; +} + +inline +size_t& MatStep::operator[](int i) +{ + return p[i]; +} + +inline MatStep::operator size_t() const +{ + CV_DbgAssert( p == buf ); + return buf[0]; +} + +inline MatStep& MatStep::operator = (size_t s) +{ + CV_DbgAssert( p == buf ); + buf[0] = s; + return *this; +} + + + +////////////////////////////// Mat_<_Tp> //////////////////////////// + +template inline +Mat_<_Tp>::Mat_() + : Mat() +{ + flags = (flags & ~CV_MAT_TYPE_MASK) | DataType<_Tp>::type; +} + +template inline +Mat_<_Tp>::Mat_(int _rows, int _cols) + : Mat(_rows, _cols, DataType<_Tp>::type) +{ +} + +template inline +Mat_<_Tp>::Mat_(int _rows, int _cols, const _Tp& value) + : Mat(_rows, _cols, DataType<_Tp>::type) +{ + *this = value; +} + +template inline +Mat_<_Tp>::Mat_(Size _sz) + : Mat(_sz.height, _sz.width, DataType<_Tp>::type) +{} + +template inline +Mat_<_Tp>::Mat_(Size _sz, const _Tp& value) + : Mat(_sz.height, _sz.width, DataType<_Tp>::type) +{ + *this = value; +} + +template inline +Mat_<_Tp>::Mat_(int _dims, const int* _sz) + : Mat(_dims, _sz, DataType<_Tp>::type) +{} + +template inline +Mat_<_Tp>::Mat_(int _dims, const int* _sz, const _Tp& _s) + : Mat(_dims, _sz, DataType<_Tp>::type, Scalar(_s)) +{} + +template inline +Mat_<_Tp>::Mat_(const Mat_<_Tp>& m, const Range* ranges) + : Mat(m, ranges) +{} + +template inline +Mat_<_Tp>::Mat_(const Mat& m) + : Mat() +{ + flags = (flags & ~CV_MAT_TYPE_MASK) | DataType<_Tp>::type; + *this = m; +} + +template inline +Mat_<_Tp>::Mat_(const Mat_& m) + : Mat(m) +{} + +template inline +Mat_<_Tp>::Mat_(int _rows, int _cols, _Tp* _data, size_t steps) + : Mat(_rows, _cols, DataType<_Tp>::type, _data, steps) +{} + +template inline +Mat_<_Tp>::Mat_(const Mat_& m, const Range& _rowRange, const Range& _colRange) + : Mat(m, _rowRange, _colRange) +{} + +template inline +Mat_<_Tp>::Mat_(const Mat_& m, const Rect& roi) + : Mat(m, roi) +{} + +template template inline +Mat_<_Tp>::Mat_(const Vec::channel_type, n>& vec, bool copyData) + : Mat(n / DataType<_Tp>::channels, 1, DataType<_Tp>::type, (void*)&vec) +{ + CV_Assert(n%DataType<_Tp>::channels == 0); + if( copyData ) + *this = clone(); +} + +template template inline +Mat_<_Tp>::Mat_(const Matx::channel_type, m, n>& M, bool copyData) + : Mat(m, n / DataType<_Tp>::channels, DataType<_Tp>::type, (void*)&M) +{ + CV_Assert(n % DataType<_Tp>::channels == 0); + if( copyData ) + *this = clone(); +} + +template inline +Mat_<_Tp>::Mat_(const Point_::channel_type>& pt, bool copyData) + : Mat(2 / DataType<_Tp>::channels, 1, DataType<_Tp>::type, (void*)&pt) +{ + CV_Assert(2 % DataType<_Tp>::channels == 0); + if( copyData ) + *this = clone(); +} + +template inline +Mat_<_Tp>::Mat_(const Point3_::channel_type>& pt, bool copyData) + : Mat(3 / DataType<_Tp>::channels, 1, DataType<_Tp>::type, (void*)&pt) +{ + CV_Assert(3 % DataType<_Tp>::channels == 0); + if( copyData ) + *this = clone(); +} + +template inline +Mat_<_Tp>::Mat_(const MatCommaInitializer_<_Tp>& commaInitializer) + : Mat(commaInitializer) +{} + +template inline +Mat_<_Tp>::Mat_(const std::vector<_Tp>& vec, bool copyData) + : Mat(vec, copyData) +{} + +template inline +Mat_<_Tp>& Mat_<_Tp>::operator = (const Mat& m) +{ + if( DataType<_Tp>::type == m.type() ) + { + Mat::operator = (m); + return *this; + } + if( DataType<_Tp>::depth == m.depth() ) + { + return (*this = m.reshape(DataType<_Tp>::channels, m.dims, 0)); + } + CV_DbgAssert(DataType<_Tp>::channels == m.channels()); + m.convertTo(*this, type()); + return *this; +} + +template inline +Mat_<_Tp>& Mat_<_Tp>::operator = (const Mat_& m) +{ + Mat::operator=(m); + return *this; +} + +template inline +Mat_<_Tp>& Mat_<_Tp>::operator = (const _Tp& s) +{ + typedef typename DataType<_Tp>::vec_type VT; + Mat::operator=(Scalar((const VT&)s)); + return *this; +} + +template inline +void Mat_<_Tp>::create(int _rows, int _cols) +{ + Mat::create(_rows, _cols, DataType<_Tp>::type); +} + +template inline +void Mat_<_Tp>::create(Size _sz) +{ + Mat::create(_sz, DataType<_Tp>::type); +} + +template inline +void Mat_<_Tp>::create(int _dims, const int* _sz) +{ + Mat::create(_dims, _sz, DataType<_Tp>::type); +} + +template inline +Mat_<_Tp> Mat_<_Tp>::cross(const Mat_& m) const +{ + return Mat_<_Tp>(Mat::cross(m)); +} + +template template inline +Mat_<_Tp>::operator Mat_() const +{ + return Mat_(*this); +} + +template inline +Mat_<_Tp> Mat_<_Tp>::row(int y) const +{ + return Mat_(*this, Range(y, y+1), Range::all()); +} + +template inline +Mat_<_Tp> Mat_<_Tp>::col(int x) const +{ + return Mat_(*this, Range::all(), Range(x, x+1)); +} + +template inline +Mat_<_Tp> Mat_<_Tp>::diag(int d) const +{ + return Mat_(Mat::diag(d)); +} + +template inline +Mat_<_Tp> Mat_<_Tp>::clone() const +{ + return Mat_(Mat::clone()); +} + +template inline +size_t Mat_<_Tp>::elemSize() const +{ + CV_DbgAssert( Mat::elemSize() == sizeof(_Tp) ); + return sizeof(_Tp); +} + +template inline +size_t Mat_<_Tp>::elemSize1() const +{ + CV_DbgAssert( Mat::elemSize1() == sizeof(_Tp) / DataType<_Tp>::channels ); + return sizeof(_Tp) / DataType<_Tp>::channels; +} + +template inline +int Mat_<_Tp>::type() const +{ + CV_DbgAssert( Mat::type() == DataType<_Tp>::type ); + return DataType<_Tp>::type; +} + +template inline +int Mat_<_Tp>::depth() const +{ + CV_DbgAssert( Mat::depth() == DataType<_Tp>::depth ); + return DataType<_Tp>::depth; +} + +template inline +int Mat_<_Tp>::channels() const +{ + CV_DbgAssert( Mat::channels() == DataType<_Tp>::channels ); + return DataType<_Tp>::channels; +} + +template inline +size_t Mat_<_Tp>::stepT(int i) const +{ + return step.p[i] / elemSize(); +} + +template inline +size_t Mat_<_Tp>::step1(int i) const +{ + return step.p[i] / elemSize1(); +} + +template inline +Mat_<_Tp>& Mat_<_Tp>::adjustROI( int dtop, int dbottom, int dleft, int dright ) +{ + return (Mat_<_Tp>&)(Mat::adjustROI(dtop, dbottom, dleft, dright)); +} + +template inline +Mat_<_Tp> Mat_<_Tp>::operator()( const Range& _rowRange, const Range& _colRange ) const +{ + return Mat_<_Tp>(*this, _rowRange, _colRange); +} + +template inline +Mat_<_Tp> Mat_<_Tp>::operator()( const Rect& roi ) const +{ + return Mat_<_Tp>(*this, roi); +} + +template inline +Mat_<_Tp> Mat_<_Tp>::operator()( const Range* ranges ) const +{ + return Mat_<_Tp>(*this, ranges); +} + +template inline +_Tp* Mat_<_Tp>::operator [](int y) +{ + CV_DbgAssert( 0 <= y && y < rows ); + return (_Tp*)(data + y*step.p[0]); +} + +template inline +const _Tp* Mat_<_Tp>::operator [](int y) const +{ + CV_DbgAssert( 0 <= y && y < rows ); + return (const _Tp*)(data + y*step.p[0]); +} + +template inline +_Tp& Mat_<_Tp>::operator ()(int i0, int i1) +{ + CV_DbgAssert(dims <= 2); + CV_DbgAssert(data); + CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]); + CV_DbgAssert((unsigned)i1 < (unsigned)size.p[1]); + CV_DbgAssert(type() == DataType<_Tp>::type); + return ((_Tp*)(data + step.p[0] * i0))[i1]; +} + +template inline +const _Tp& Mat_<_Tp>::operator ()(int i0, int i1) const +{ + CV_DbgAssert(dims <= 2); + CV_DbgAssert(data); + CV_DbgAssert((unsigned)i0 < (unsigned)size.p[0]); + CV_DbgAssert((unsigned)i1 < (unsigned)size.p[1]); + CV_DbgAssert(type() == DataType<_Tp>::type); + return ((const _Tp*)(data + step.p[0] * i0))[i1]; +} + +template inline +_Tp& Mat_<_Tp>::operator ()(Point pt) +{ + CV_DbgAssert(dims <= 2); + CV_DbgAssert(data); + CV_DbgAssert((unsigned)pt.y < (unsigned)size.p[0]); + CV_DbgAssert((unsigned)pt.x < (unsigned)size.p[1]); + CV_DbgAssert(type() == DataType<_Tp>::type); + return ((_Tp*)(data + step.p[0] * pt.y))[pt.x]; +} + +template inline +const _Tp& Mat_<_Tp>::operator ()(Point pt) const +{ + CV_DbgAssert(dims <= 2); + CV_DbgAssert(data); + CV_DbgAssert((unsigned)pt.y < (unsigned)size.p[0]); + CV_DbgAssert((unsigned)pt.x < (unsigned)size.p[1]); + CV_DbgAssert(type() == DataType<_Tp>::type); + return ((const _Tp*)(data + step.p[0] * pt.y))[pt.x]; +} + +template inline +_Tp& Mat_<_Tp>::operator ()(const int* idx) +{ + return Mat::at<_Tp>(idx); +} + +template inline +const _Tp& Mat_<_Tp>::operator ()(const int* idx) const +{ + return Mat::at<_Tp>(idx); +} + +template template inline +_Tp& Mat_<_Tp>::operator ()(const Vec& idx) +{ + return Mat::at<_Tp>(idx); +} + +template template inline +const _Tp& Mat_<_Tp>::operator ()(const Vec& idx) const +{ + return Mat::at<_Tp>(idx); +} + +template inline +_Tp& Mat_<_Tp>::operator ()(int i0) +{ + return this->at<_Tp>(i0); +} + +template inline +const _Tp& Mat_<_Tp>::operator ()(int i0) const +{ + return this->at<_Tp>(i0); +} + +template inline +_Tp& Mat_<_Tp>::operator ()(int i0, int i1, int i2) +{ + return this->at<_Tp>(i0, i1, i2); +} + +template inline +const _Tp& Mat_<_Tp>::operator ()(int i0, int i1, int i2) const +{ + return this->at<_Tp>(i0, i1, i2); +} + +template inline +Mat_<_Tp>::operator std::vector<_Tp>() const +{ + std::vector<_Tp> v; + copyTo(v); + return v; +} + +template template inline +Mat_<_Tp>::operator Vec::channel_type, n>() const +{ + CV_Assert(n % DataType<_Tp>::channels == 0); + +#if defined _MSC_VER + const Mat* pMat = (const Mat*)this; // workaround for MSVS <= 2012 compiler bugs (but GCC 4.6 dislikes this workaround) + return pMat->operator Vec::channel_type, n>(); +#else + return this->Mat::operator Vec::channel_type, n>(); +#endif +} + +template template inline +Mat_<_Tp>::operator Matx::channel_type, m, n>() const +{ + CV_Assert(n % DataType<_Tp>::channels == 0); + +#if defined _MSC_VER + const Mat* pMat = (const Mat*)this; // workaround for MSVS <= 2012 compiler bugs (but GCC 4.6 dislikes this workaround) + Matx::channel_type, m, n> res = pMat->operator Matx::channel_type, m, n>(); + return res; +#else + Matx::channel_type, m, n> res = this->Mat::operator Matx::channel_type, m, n>(); + return res; +#endif +} + +template inline +MatConstIterator_<_Tp> Mat_<_Tp>::begin() const +{ + return Mat::begin<_Tp>(); +} + +template inline +MatConstIterator_<_Tp> Mat_<_Tp>::end() const +{ + return Mat::end<_Tp>(); +} + +template inline +MatIterator_<_Tp> Mat_<_Tp>::begin() +{ + return Mat::begin<_Tp>(); +} + +template inline +MatIterator_<_Tp> Mat_<_Tp>::end() +{ + return Mat::end<_Tp>(); +} + +template template inline +void Mat_<_Tp>::forEach(const Functor& operation) { + Mat::forEach<_Tp, Functor>(operation); +} + +template template inline +void Mat_<_Tp>::forEach(const Functor& operation) const { + Mat::forEach<_Tp, Functor>(operation); +} + +#ifdef CV_CXX_MOVE_SEMANTICS + +template inline +Mat_<_Tp>::Mat_(Mat_&& m) + : Mat(m) +{ +} + +template inline +Mat_<_Tp>& Mat_<_Tp>::operator = (Mat_&& m) +{ + Mat::operator = (m); + return *this; +} + +template inline +Mat_<_Tp>::Mat_(Mat&& m) + : Mat() +{ + flags = (flags & ~CV_MAT_TYPE_MASK) | DataType<_Tp>::type; + *this = m; +} + +template inline +Mat_<_Tp>& Mat_<_Tp>::operator = (Mat&& m) +{ + if( DataType<_Tp>::type == m.type() ) + { + Mat::operator = ((Mat&&)m); + return *this; + } + if( DataType<_Tp>::depth == m.depth() ) + { + Mat::operator = ((Mat&&)m.reshape(DataType<_Tp>::channels, m.dims, 0)); + return *this; + } + CV_DbgAssert(DataType<_Tp>::channels == m.channels()); + m.convertTo(*this, type()); + return *this; +} + +template inline +Mat_<_Tp>::Mat_(MatExpr&& e) + : Mat() +{ + flags = (flags & ~CV_MAT_TYPE_MASK) | DataType<_Tp>::type; + *this = Mat(e); +} + +#endif + +///////////////////////////// SparseMat ///////////////////////////// + +inline +SparseMat::SparseMat() + : flags(MAGIC_VAL), hdr(0) +{} + +inline +SparseMat::SparseMat(int _dims, const int* _sizes, int _type) + : flags(MAGIC_VAL), hdr(0) +{ + create(_dims, _sizes, _type); +} + +inline +SparseMat::SparseMat(const SparseMat& m) + : flags(m.flags), hdr(m.hdr) +{ + addref(); +} + +inline +SparseMat::~SparseMat() +{ + release(); +} + +inline +SparseMat& SparseMat::operator = (const SparseMat& m) +{ + if( this != &m ) + { + if( m.hdr ) + CV_XADD(&m.hdr->refcount, 1); + release(); + flags = m.flags; + hdr = m.hdr; + } + return *this; +} + +inline +SparseMat& SparseMat::operator = (const Mat& m) +{ + return (*this = SparseMat(m)); +} + +inline +SparseMat SparseMat::clone() const +{ + SparseMat temp; + this->copyTo(temp); + return temp; +} + +inline +void SparseMat::assignTo( SparseMat& m, int _type ) const +{ + if( _type < 0 ) + m = *this; + else + convertTo(m, _type); +} + +inline +void SparseMat::addref() +{ + if( hdr ) + CV_XADD(&hdr->refcount, 1); +} + +inline +void SparseMat::release() +{ + if( hdr && CV_XADD(&hdr->refcount, -1) == 1 ) + delete hdr; + hdr = 0; +} + +inline +size_t SparseMat::elemSize() const +{ + return CV_ELEM_SIZE(flags); +} + +inline +size_t SparseMat::elemSize1() const +{ + return CV_ELEM_SIZE1(flags); +} + +inline +int SparseMat::type() const +{ + return CV_MAT_TYPE(flags); +} + +inline +int SparseMat::depth() const +{ + return CV_MAT_DEPTH(flags); +} + +inline +int SparseMat::channels() const +{ + return CV_MAT_CN(flags); +} + +inline +const int* SparseMat::size() const +{ + return hdr ? hdr->size : 0; +} + +inline +int SparseMat::size(int i) const +{ + if( hdr ) + { + CV_DbgAssert((unsigned)i < (unsigned)hdr->dims); + return hdr->size[i]; + } + return 0; +} + +inline +int SparseMat::dims() const +{ + return hdr ? hdr->dims : 0; +} + +inline +size_t SparseMat::nzcount() const +{ + return hdr ? hdr->nodeCount : 0; +} + +inline +size_t SparseMat::hash(int i0) const +{ + return (size_t)i0; +} + +inline +size_t SparseMat::hash(int i0, int i1) const +{ + return (size_t)(unsigned)i0 * HASH_SCALE + (unsigned)i1; +} + +inline +size_t SparseMat::hash(int i0, int i1, int i2) const +{ + return ((size_t)(unsigned)i0 * HASH_SCALE + (unsigned)i1) * HASH_SCALE + (unsigned)i2; +} + +inline +size_t SparseMat::hash(const int* idx) const +{ + size_t h = (unsigned)idx[0]; + if( !hdr ) + return 0; + int d = hdr->dims; + for(int i = 1; i < d; i++ ) + h = h * HASH_SCALE + (unsigned)idx[i]; + return h; +} + +template inline +_Tp& SparseMat::ref(int i0, size_t* hashval) +{ + return *(_Tp*)((SparseMat*)this)->ptr(i0, true, hashval); +} + +template inline +_Tp& SparseMat::ref(int i0, int i1, size_t* hashval) +{ + return *(_Tp*)((SparseMat*)this)->ptr(i0, i1, true, hashval); +} + +template inline +_Tp& SparseMat::ref(int i0, int i1, int i2, size_t* hashval) +{ + return *(_Tp*)((SparseMat*)this)->ptr(i0, i1, i2, true, hashval); +} + +template inline +_Tp& SparseMat::ref(const int* idx, size_t* hashval) +{ + return *(_Tp*)((SparseMat*)this)->ptr(idx, true, hashval); +} + +template inline +_Tp SparseMat::value(int i0, size_t* hashval) const +{ + const _Tp* p = (const _Tp*)((SparseMat*)this)->ptr(i0, false, hashval); + return p ? *p : _Tp(); +} + +template inline +_Tp SparseMat::value(int i0, int i1, size_t* hashval) const +{ + const _Tp* p = (const _Tp*)((SparseMat*)this)->ptr(i0, i1, false, hashval); + return p ? *p : _Tp(); +} + +template inline +_Tp SparseMat::value(int i0, int i1, int i2, size_t* hashval) const +{ + const _Tp* p = (const _Tp*)((SparseMat*)this)->ptr(i0, i1, i2, false, hashval); + return p ? *p : _Tp(); +} + +template inline +_Tp SparseMat::value(const int* idx, size_t* hashval) const +{ + const _Tp* p = (const _Tp*)((SparseMat*)this)->ptr(idx, false, hashval); + return p ? *p : _Tp(); +} + +template inline +const _Tp* SparseMat::find(int i0, size_t* hashval) const +{ + return (const _Tp*)((SparseMat*)this)->ptr(i0, false, hashval); +} + +template inline +const _Tp* SparseMat::find(int i0, int i1, size_t* hashval) const +{ + return (const _Tp*)((SparseMat*)this)->ptr(i0, i1, false, hashval); +} + +template inline +const _Tp* SparseMat::find(int i0, int i1, int i2, size_t* hashval) const +{ + return (const _Tp*)((SparseMat*)this)->ptr(i0, i1, i2, false, hashval); +} + +template inline +const _Tp* SparseMat::find(const int* idx, size_t* hashval) const +{ + return (const _Tp*)((SparseMat*)this)->ptr(idx, false, hashval); +} + +template inline +_Tp& SparseMat::value(Node* n) +{ + return *(_Tp*)((uchar*)n + hdr->valueOffset); +} + +template inline +const _Tp& SparseMat::value(const Node* n) const +{ + return *(const _Tp*)((const uchar*)n + hdr->valueOffset); +} + +inline +SparseMat::Node* SparseMat::node(size_t nidx) +{ + return (Node*)(void*)&hdr->pool[nidx]; +} + +inline +const SparseMat::Node* SparseMat::node(size_t nidx) const +{ + return (const Node*)(const void*)&hdr->pool[nidx]; +} + +inline +SparseMatIterator SparseMat::begin() +{ + return SparseMatIterator(this); +} + +inline +SparseMatConstIterator SparseMat::begin() const +{ + return SparseMatConstIterator(this); +} + +inline +SparseMatIterator SparseMat::end() +{ + SparseMatIterator it(this); + it.seekEnd(); + return it; +} + +inline +SparseMatConstIterator SparseMat::end() const +{ + SparseMatConstIterator it(this); + it.seekEnd(); + return it; +} + +template inline +SparseMatIterator_<_Tp> SparseMat::begin() +{ + return SparseMatIterator_<_Tp>(this); +} + +template inline +SparseMatConstIterator_<_Tp> SparseMat::begin() const +{ + return SparseMatConstIterator_<_Tp>(this); +} + +template inline +SparseMatIterator_<_Tp> SparseMat::end() +{ + SparseMatIterator_<_Tp> it(this); + it.seekEnd(); + return it; +} + +template inline +SparseMatConstIterator_<_Tp> SparseMat::end() const +{ + SparseMatConstIterator_<_Tp> it(this); + it.seekEnd(); + return it; +} + + + +///////////////////////////// SparseMat_ //////////////////////////// + +template inline +SparseMat_<_Tp>::SparseMat_() +{ + flags = MAGIC_VAL | DataType<_Tp>::type; +} + +template inline +SparseMat_<_Tp>::SparseMat_(int _dims, const int* _sizes) + : SparseMat(_dims, _sizes, DataType<_Tp>::type) +{} + +template inline +SparseMat_<_Tp>::SparseMat_(const SparseMat& m) +{ + if( m.type() == DataType<_Tp>::type ) + *this = (const SparseMat_<_Tp>&)m; + else + m.convertTo(*this, DataType<_Tp>::type); +} + +template inline +SparseMat_<_Tp>::SparseMat_(const SparseMat_<_Tp>& m) +{ + this->flags = m.flags; + this->hdr = m.hdr; + if( this->hdr ) + CV_XADD(&this->hdr->refcount, 1); +} + +template inline +SparseMat_<_Tp>::SparseMat_(const Mat& m) +{ + SparseMat sm(m); + *this = sm; +} + +template inline +SparseMat_<_Tp>& SparseMat_<_Tp>::operator = (const SparseMat_<_Tp>& m) +{ + if( this != &m ) + { + if( m.hdr ) CV_XADD(&m.hdr->refcount, 1); + release(); + flags = m.flags; + hdr = m.hdr; + } + return *this; +} + +template inline +SparseMat_<_Tp>& SparseMat_<_Tp>::operator = (const SparseMat& m) +{ + if( m.type() == DataType<_Tp>::type ) + return (*this = (const SparseMat_<_Tp>&)m); + m.convertTo(*this, DataType<_Tp>::type); + return *this; +} + +template inline +SparseMat_<_Tp>& SparseMat_<_Tp>::operator = (const Mat& m) +{ + return (*this = SparseMat(m)); +} + +template inline +SparseMat_<_Tp> SparseMat_<_Tp>::clone() const +{ + SparseMat_<_Tp> m; + this->copyTo(m); + return m; +} + +template inline +void SparseMat_<_Tp>::create(int _dims, const int* _sizes) +{ + SparseMat::create(_dims, _sizes, DataType<_Tp>::type); +} + +template inline +int SparseMat_<_Tp>::type() const +{ + return DataType<_Tp>::type; +} + +template inline +int SparseMat_<_Tp>::depth() const +{ + return DataType<_Tp>::depth; +} + +template inline +int SparseMat_<_Tp>::channels() const +{ + return DataType<_Tp>::channels; +} + +template inline +_Tp& SparseMat_<_Tp>::ref(int i0, size_t* hashval) +{ + return SparseMat::ref<_Tp>(i0, hashval); +} + +template inline +_Tp SparseMat_<_Tp>::operator()(int i0, size_t* hashval) const +{ + return SparseMat::value<_Tp>(i0, hashval); +} + +template inline +_Tp& SparseMat_<_Tp>::ref(int i0, int i1, size_t* hashval) +{ + return SparseMat::ref<_Tp>(i0, i1, hashval); +} + +template inline +_Tp SparseMat_<_Tp>::operator()(int i0, int i1, size_t* hashval) const +{ + return SparseMat::value<_Tp>(i0, i1, hashval); +} + +template inline +_Tp& SparseMat_<_Tp>::ref(int i0, int i1, int i2, size_t* hashval) +{ + return SparseMat::ref<_Tp>(i0, i1, i2, hashval); +} + +template inline +_Tp SparseMat_<_Tp>::operator()(int i0, int i1, int i2, size_t* hashval) const +{ + return SparseMat::value<_Tp>(i0, i1, i2, hashval); +} + +template inline +_Tp& SparseMat_<_Tp>::ref(const int* idx, size_t* hashval) +{ + return SparseMat::ref<_Tp>(idx, hashval); +} + +template inline +_Tp SparseMat_<_Tp>::operator()(const int* idx, size_t* hashval) const +{ + return SparseMat::value<_Tp>(idx, hashval); +} + +template inline +SparseMatIterator_<_Tp> SparseMat_<_Tp>::begin() +{ + return SparseMatIterator_<_Tp>(this); +} + +template inline +SparseMatConstIterator_<_Tp> SparseMat_<_Tp>::begin() const +{ + return SparseMatConstIterator_<_Tp>(this); +} + +template inline +SparseMatIterator_<_Tp> SparseMat_<_Tp>::end() +{ + SparseMatIterator_<_Tp> it(this); + it.seekEnd(); + return it; +} + +template inline +SparseMatConstIterator_<_Tp> SparseMat_<_Tp>::end() const +{ + SparseMatConstIterator_<_Tp> it(this); + it.seekEnd(); + return it; +} + + + +////////////////////////// MatConstIterator ///////////////////////// + +inline +MatConstIterator::MatConstIterator() + : m(0), elemSize(0), ptr(0), sliceStart(0), sliceEnd(0) +{} + +inline +MatConstIterator::MatConstIterator(const Mat* _m) + : m(_m), elemSize(_m->elemSize()), ptr(0), sliceStart(0), sliceEnd(0) +{ + if( m && m->isContinuous() ) + { + sliceStart = m->ptr(); + sliceEnd = sliceStart + m->total()*elemSize; + } + seek((const int*)0); +} + +inline +MatConstIterator::MatConstIterator(const Mat* _m, int _row, int _col) + : m(_m), elemSize(_m->elemSize()), ptr(0), sliceStart(0), sliceEnd(0) +{ + CV_Assert(m && m->dims <= 2); + if( m->isContinuous() ) + { + sliceStart = m->ptr(); + sliceEnd = sliceStart + m->total()*elemSize; + } + int idx[] = {_row, _col}; + seek(idx); +} + +inline +MatConstIterator::MatConstIterator(const Mat* _m, Point _pt) + : m(_m), elemSize(_m->elemSize()), ptr(0), sliceStart(0), sliceEnd(0) +{ + CV_Assert(m && m->dims <= 2); + if( m->isContinuous() ) + { + sliceStart = m->ptr(); + sliceEnd = sliceStart + m->total()*elemSize; + } + int idx[] = {_pt.y, _pt.x}; + seek(idx); +} + +inline +MatConstIterator::MatConstIterator(const MatConstIterator& it) + : m(it.m), elemSize(it.elemSize), ptr(it.ptr), sliceStart(it.sliceStart), sliceEnd(it.sliceEnd) +{} + +inline +MatConstIterator& MatConstIterator::operator = (const MatConstIterator& it ) +{ + m = it.m; elemSize = it.elemSize; ptr = it.ptr; + sliceStart = it.sliceStart; sliceEnd = it.sliceEnd; + return *this; +} + +inline +const uchar* MatConstIterator::operator *() const +{ + return ptr; +} + +inline MatConstIterator& MatConstIterator::operator += (ptrdiff_t ofs) +{ + if( !m || ofs == 0 ) + return *this; + ptrdiff_t ofsb = ofs*elemSize; + ptr += ofsb; + if( ptr < sliceStart || sliceEnd <= ptr ) + { + ptr -= ofsb; + seek(ofs, true); + } + return *this; +} + +inline +MatConstIterator& MatConstIterator::operator -= (ptrdiff_t ofs) +{ + return (*this += -ofs); +} + +inline +MatConstIterator& MatConstIterator::operator --() +{ + if( m && (ptr -= elemSize) < sliceStart ) + { + ptr += elemSize; + seek(-1, true); + } + return *this; +} + +inline +MatConstIterator MatConstIterator::operator --(int) +{ + MatConstIterator b = *this; + *this += -1; + return b; +} + +inline +MatConstIterator& MatConstIterator::operator ++() +{ + if( m && (ptr += elemSize) >= sliceEnd ) + { + ptr -= elemSize; + seek(1, true); + } + return *this; +} + +inline MatConstIterator MatConstIterator::operator ++(int) +{ + MatConstIterator b = *this; + *this += 1; + return b; +} + + +static inline +bool operator == (const MatConstIterator& a, const MatConstIterator& b) +{ + return a.m == b.m && a.ptr == b.ptr; +} + +static inline +bool operator != (const MatConstIterator& a, const MatConstIterator& b) +{ + return !(a == b); +} + +static inline +bool operator < (const MatConstIterator& a, const MatConstIterator& b) +{ + return a.ptr < b.ptr; +} + +static inline +bool operator > (const MatConstIterator& a, const MatConstIterator& b) +{ + return a.ptr > b.ptr; +} + +static inline +bool operator <= (const MatConstIterator& a, const MatConstIterator& b) +{ + return a.ptr <= b.ptr; +} + +static inline +bool operator >= (const MatConstIterator& a, const MatConstIterator& b) +{ + return a.ptr >= b.ptr; +} + +static inline +ptrdiff_t operator - (const MatConstIterator& b, const MatConstIterator& a) +{ + if( a.m != b.m ) + return ((size_t)(-1) >> 1); + if( a.sliceEnd == b.sliceEnd ) + return (b.ptr - a.ptr)/b.elemSize; + + return b.lpos() - a.lpos(); +} + +static inline +MatConstIterator operator + (const MatConstIterator& a, ptrdiff_t ofs) +{ + MatConstIterator b = a; + return b += ofs; +} + +static inline +MatConstIterator operator + (ptrdiff_t ofs, const MatConstIterator& a) +{ + MatConstIterator b = a; + return b += ofs; +} + +static inline +MatConstIterator operator - (const MatConstIterator& a, ptrdiff_t ofs) +{ + MatConstIterator b = a; + return b += -ofs; +} + + +inline +const uchar* MatConstIterator::operator [](ptrdiff_t i) const +{ + return *(*this + i); +} + + + +///////////////////////// MatConstIterator_ ///////////////////////// + +template inline +MatConstIterator_<_Tp>::MatConstIterator_() +{} + +template inline +MatConstIterator_<_Tp>::MatConstIterator_(const Mat_<_Tp>* _m) + : MatConstIterator(_m) +{} + +template inline +MatConstIterator_<_Tp>::MatConstIterator_(const Mat_<_Tp>* _m, int _row, int _col) + : MatConstIterator(_m, _row, _col) +{} + +template inline +MatConstIterator_<_Tp>::MatConstIterator_(const Mat_<_Tp>* _m, Point _pt) + : MatConstIterator(_m, _pt) +{} + +template inline +MatConstIterator_<_Tp>::MatConstIterator_(const MatConstIterator_& it) + : MatConstIterator(it) +{} + +template inline +MatConstIterator_<_Tp>& MatConstIterator_<_Tp>::operator = (const MatConstIterator_& it ) +{ + MatConstIterator::operator = (it); + return *this; +} + +template inline +_Tp MatConstIterator_<_Tp>::operator *() const +{ + return *(_Tp*)(this->ptr); +} + +template inline +MatConstIterator_<_Tp>& MatConstIterator_<_Tp>::operator += (ptrdiff_t ofs) +{ + MatConstIterator::operator += (ofs); + return *this; +} + +template inline +MatConstIterator_<_Tp>& MatConstIterator_<_Tp>::operator -= (ptrdiff_t ofs) +{ + return (*this += -ofs); +} + +template inline +MatConstIterator_<_Tp>& MatConstIterator_<_Tp>::operator --() +{ + MatConstIterator::operator --(); + return *this; +} + +template inline +MatConstIterator_<_Tp> MatConstIterator_<_Tp>::operator --(int) +{ + MatConstIterator_ b = *this; + MatConstIterator::operator --(); + return b; +} + +template inline +MatConstIterator_<_Tp>& MatConstIterator_<_Tp>::operator ++() +{ + MatConstIterator::operator ++(); + return *this; +} + +template inline +MatConstIterator_<_Tp> MatConstIterator_<_Tp>::operator ++(int) +{ + MatConstIterator_ b = *this; + MatConstIterator::operator ++(); + return b; +} + + +template inline +Point MatConstIterator_<_Tp>::pos() const +{ + if( !m ) + return Point(); + CV_DbgAssert( m->dims <= 2 ); + if( m->isContinuous() ) + { + ptrdiff_t ofs = (const _Tp*)ptr - (const _Tp*)m->data; + int y = (int)(ofs / m->cols); + int x = (int)(ofs - (ptrdiff_t)y * m->cols); + return Point(x, y); + } + else + { + ptrdiff_t ofs = (uchar*)ptr - m->data; + int y = (int)(ofs / m->step); + int x = (int)((ofs - y * m->step)/sizeof(_Tp)); + return Point(x, y); + } +} + + +template static inline +bool operator == (const MatConstIterator_<_Tp>& a, const MatConstIterator_<_Tp>& b) +{ + return a.m == b.m && a.ptr == b.ptr; +} + +template static inline +bool operator != (const MatConstIterator_<_Tp>& a, const MatConstIterator_<_Tp>& b) +{ + return a.m != b.m || a.ptr != b.ptr; +} + +template static inline +MatConstIterator_<_Tp> operator + (const MatConstIterator_<_Tp>& a, ptrdiff_t ofs) +{ + MatConstIterator t = (const MatConstIterator&)a + ofs; + return (MatConstIterator_<_Tp>&)t; +} + +template static inline +MatConstIterator_<_Tp> operator + (ptrdiff_t ofs, const MatConstIterator_<_Tp>& a) +{ + MatConstIterator t = (const MatConstIterator&)a + ofs; + return (MatConstIterator_<_Tp>&)t; +} + +template static inline +MatConstIterator_<_Tp> operator - (const MatConstIterator_<_Tp>& a, ptrdiff_t ofs) +{ + MatConstIterator t = (const MatConstIterator&)a - ofs; + return (MatConstIterator_<_Tp>&)t; +} + +template inline +_Tp MatConstIterator_<_Tp>::operator [](ptrdiff_t i) const +{ + return *(_Tp*)MatConstIterator::operator [](i); +} + + + +//////////////////////////// MatIterator_ /////////////////////////// + +template inline +MatIterator_<_Tp>::MatIterator_() + : MatConstIterator_<_Tp>() +{} + +template inline +MatIterator_<_Tp>::MatIterator_(Mat_<_Tp>* _m) + : MatConstIterator_<_Tp>(_m) +{} + +template inline +MatIterator_<_Tp>::MatIterator_(Mat_<_Tp>* _m, int _row, int _col) + : MatConstIterator_<_Tp>(_m, _row, _col) +{} + +template inline +MatIterator_<_Tp>::MatIterator_(Mat_<_Tp>* _m, Point _pt) + : MatConstIterator_<_Tp>(_m, _pt) +{} + +template inline +MatIterator_<_Tp>::MatIterator_(Mat_<_Tp>* _m, const int* _idx) + : MatConstIterator_<_Tp>(_m, _idx) +{} + +template inline +MatIterator_<_Tp>::MatIterator_(const MatIterator_& it) + : MatConstIterator_<_Tp>(it) +{} + +template inline +MatIterator_<_Tp>& MatIterator_<_Tp>::operator = (const MatIterator_<_Tp>& it ) +{ + MatConstIterator::operator = (it); + return *this; +} + +template inline +_Tp& MatIterator_<_Tp>::operator *() const +{ + return *(_Tp*)(this->ptr); +} + +template inline +MatIterator_<_Tp>& MatIterator_<_Tp>::operator += (ptrdiff_t ofs) +{ + MatConstIterator::operator += (ofs); + return *this; +} + +template inline +MatIterator_<_Tp>& MatIterator_<_Tp>::operator -= (ptrdiff_t ofs) +{ + MatConstIterator::operator += (-ofs); + return *this; +} + +template inline +MatIterator_<_Tp>& MatIterator_<_Tp>::operator --() +{ + MatConstIterator::operator --(); + return *this; +} + +template inline +MatIterator_<_Tp> MatIterator_<_Tp>::operator --(int) +{ + MatIterator_ b = *this; + MatConstIterator::operator --(); + return b; +} + +template inline +MatIterator_<_Tp>& MatIterator_<_Tp>::operator ++() +{ + MatConstIterator::operator ++(); + return *this; +} + +template inline +MatIterator_<_Tp> MatIterator_<_Tp>::operator ++(int) +{ + MatIterator_ b = *this; + MatConstIterator::operator ++(); + return b; +} + +template inline +_Tp& MatIterator_<_Tp>::operator [](ptrdiff_t i) const +{ + return *(*this + i); +} + + +template static inline +bool operator == (const MatIterator_<_Tp>& a, const MatIterator_<_Tp>& b) +{ + return a.m == b.m && a.ptr == b.ptr; +} + +template static inline +bool operator != (const MatIterator_<_Tp>& a, const MatIterator_<_Tp>& b) +{ + return a.m != b.m || a.ptr != b.ptr; +} + +template static inline +MatIterator_<_Tp> operator + (const MatIterator_<_Tp>& a, ptrdiff_t ofs) +{ + MatConstIterator t = (const MatConstIterator&)a + ofs; + return (MatIterator_<_Tp>&)t; +} + +template static inline +MatIterator_<_Tp> operator + (ptrdiff_t ofs, const MatIterator_<_Tp>& a) +{ + MatConstIterator t = (const MatConstIterator&)a + ofs; + return (MatIterator_<_Tp>&)t; +} + +template static inline +MatIterator_<_Tp> operator - (const MatIterator_<_Tp>& a, ptrdiff_t ofs) +{ + MatConstIterator t = (const MatConstIterator&)a - ofs; + return (MatIterator_<_Tp>&)t; +} + + + +/////////////////////// SparseMatConstIterator ////////////////////// + +inline +SparseMatConstIterator::SparseMatConstIterator() + : m(0), hashidx(0), ptr(0) +{} + +inline +SparseMatConstIterator::SparseMatConstIterator(const SparseMatConstIterator& it) + : m(it.m), hashidx(it.hashidx), ptr(it.ptr) +{} + +inline SparseMatConstIterator& SparseMatConstIterator::operator = (const SparseMatConstIterator& it) +{ + if( this != &it ) + { + m = it.m; + hashidx = it.hashidx; + ptr = it.ptr; + } + return *this; +} + +template inline +const _Tp& SparseMatConstIterator::value() const +{ + return *(const _Tp*)ptr; +} + +inline +const SparseMat::Node* SparseMatConstIterator::node() const +{ + return (ptr && m && m->hdr) ? (const SparseMat::Node*)(const void*)(ptr - m->hdr->valueOffset) : 0; +} + +inline +SparseMatConstIterator SparseMatConstIterator::operator ++(int) +{ + SparseMatConstIterator it = *this; + ++*this; + return it; +} + +inline +void SparseMatConstIterator::seekEnd() +{ + if( m && m->hdr ) + { + hashidx = m->hdr->hashtab.size(); + ptr = 0; + } +} + + +static inline +bool operator == (const SparseMatConstIterator& it1, const SparseMatConstIterator& it2) +{ + return it1.m == it2.m && it1.ptr == it2.ptr; +} + +static inline +bool operator != (const SparseMatConstIterator& it1, const SparseMatConstIterator& it2) +{ + return !(it1 == it2); +} + + + +///////////////////////// SparseMatIterator ///////////////////////// + +inline +SparseMatIterator::SparseMatIterator() +{} + +inline +SparseMatIterator::SparseMatIterator(SparseMat* _m) + : SparseMatConstIterator(_m) +{} + +inline +SparseMatIterator::SparseMatIterator(const SparseMatIterator& it) + : SparseMatConstIterator(it) +{} + +inline +SparseMatIterator& SparseMatIterator::operator = (const SparseMatIterator& it) +{ + (SparseMatConstIterator&)*this = it; + return *this; +} + +template inline +_Tp& SparseMatIterator::value() const +{ + return *(_Tp*)ptr; +} + +inline +SparseMat::Node* SparseMatIterator::node() const +{ + return (SparseMat::Node*)SparseMatConstIterator::node(); +} + +inline +SparseMatIterator& SparseMatIterator::operator ++() +{ + SparseMatConstIterator::operator ++(); + return *this; +} + +inline +SparseMatIterator SparseMatIterator::operator ++(int) +{ + SparseMatIterator it = *this; + ++*this; + return it; +} + + + +////////////////////// SparseMatConstIterator_ ////////////////////// + +template inline +SparseMatConstIterator_<_Tp>::SparseMatConstIterator_() +{} + +template inline +SparseMatConstIterator_<_Tp>::SparseMatConstIterator_(const SparseMat_<_Tp>* _m) + : SparseMatConstIterator(_m) +{} + +template inline +SparseMatConstIterator_<_Tp>::SparseMatConstIterator_(const SparseMat* _m) + : SparseMatConstIterator(_m) +{ + CV_Assert( _m->type() == DataType<_Tp>::type ); +} + +template inline +SparseMatConstIterator_<_Tp>::SparseMatConstIterator_(const SparseMatConstIterator_<_Tp>& it) + : SparseMatConstIterator(it) +{} + +template inline +SparseMatConstIterator_<_Tp>& SparseMatConstIterator_<_Tp>::operator = (const SparseMatConstIterator_<_Tp>& it) +{ + return reinterpret_cast&> + (*reinterpret_cast(this) = + reinterpret_cast(it)); +} + +template inline +const _Tp& SparseMatConstIterator_<_Tp>::operator *() const +{ + return *(const _Tp*)this->ptr; +} + +template inline +SparseMatConstIterator_<_Tp>& SparseMatConstIterator_<_Tp>::operator ++() +{ + SparseMatConstIterator::operator ++(); + return *this; +} + +template inline +SparseMatConstIterator_<_Tp> SparseMatConstIterator_<_Tp>::operator ++(int) +{ + SparseMatConstIterator_<_Tp> it = *this; + SparseMatConstIterator::operator ++(); + return it; +} + + + +///////////////////////// SparseMatIterator_ //////////////////////// + +template inline +SparseMatIterator_<_Tp>::SparseMatIterator_() +{} + +template inline +SparseMatIterator_<_Tp>::SparseMatIterator_(SparseMat_<_Tp>* _m) + : SparseMatConstIterator_<_Tp>(_m) +{} + +template inline +SparseMatIterator_<_Tp>::SparseMatIterator_(SparseMat* _m) + : SparseMatConstIterator_<_Tp>(_m) +{} + +template inline +SparseMatIterator_<_Tp>::SparseMatIterator_(const SparseMatIterator_<_Tp>& it) + : SparseMatConstIterator_<_Tp>(it) +{} + +template inline +SparseMatIterator_<_Tp>& SparseMatIterator_<_Tp>::operator = (const SparseMatIterator_<_Tp>& it) +{ + return reinterpret_cast&> + (*reinterpret_cast(this) = + reinterpret_cast(it)); +} + +template inline +_Tp& SparseMatIterator_<_Tp>::operator *() const +{ + return *(_Tp*)this->ptr; +} + +template inline +SparseMatIterator_<_Tp>& SparseMatIterator_<_Tp>::operator ++() +{ + SparseMatConstIterator::operator ++(); + return *this; +} + +template inline +SparseMatIterator_<_Tp> SparseMatIterator_<_Tp>::operator ++(int) +{ + SparseMatIterator_<_Tp> it = *this; + SparseMatConstIterator::operator ++(); + return it; +} + + + +//////////////////////// MatCommaInitializer_ /////////////////////// + +template inline +MatCommaInitializer_<_Tp>::MatCommaInitializer_(Mat_<_Tp>* _m) + : it(_m) +{} + +template template inline +MatCommaInitializer_<_Tp>& MatCommaInitializer_<_Tp>::operator , (T2 v) +{ + CV_DbgAssert( this->it < ((const Mat_<_Tp>*)this->it.m)->end() ); + *this->it = _Tp(v); + ++this->it; + return *this; +} + +template inline +MatCommaInitializer_<_Tp>::operator Mat_<_Tp>() const +{ + CV_DbgAssert( this->it == ((const Mat_<_Tp>*)this->it.m)->end() ); + return Mat_<_Tp>(*this->it.m); +} + + +template static inline +MatCommaInitializer_<_Tp> operator << (const Mat_<_Tp>& m, T2 val) +{ + MatCommaInitializer_<_Tp> commaInitializer((Mat_<_Tp>*)&m); + return (commaInitializer, val); +} + + + +///////////////////////// Matrix Expressions //////////////////////// + +inline +Mat& Mat::operator = (const MatExpr& e) +{ + e.op->assign(e, *this); + return *this; +} + +template inline +Mat_<_Tp>::Mat_(const MatExpr& e) +{ + e.op->assign(e, *this, DataType<_Tp>::type); +} + +template inline +Mat_<_Tp>& Mat_<_Tp>::operator = (const MatExpr& e) +{ + e.op->assign(e, *this, DataType<_Tp>::type); + return *this; +} + +template inline +MatExpr Mat_<_Tp>::zeros(int rows, int cols) +{ + return Mat::zeros(rows, cols, DataType<_Tp>::type); +} + +template inline +MatExpr Mat_<_Tp>::zeros(Size sz) +{ + return Mat::zeros(sz, DataType<_Tp>::type); +} + +template inline +MatExpr Mat_<_Tp>::ones(int rows, int cols) +{ + return Mat::ones(rows, cols, DataType<_Tp>::type); +} + +template inline +MatExpr Mat_<_Tp>::ones(Size sz) +{ + return Mat::ones(sz, DataType<_Tp>::type); +} + +template inline +MatExpr Mat_<_Tp>::eye(int rows, int cols) +{ + return Mat::eye(rows, cols, DataType<_Tp>::type); +} + +template inline +MatExpr Mat_<_Tp>::eye(Size sz) +{ + return Mat::eye(sz, DataType<_Tp>::type); +} + +inline +MatExpr::MatExpr() + : op(0), flags(0), a(Mat()), b(Mat()), c(Mat()), alpha(0), beta(0), s() +{} + +inline +MatExpr::MatExpr(const MatOp* _op, int _flags, const Mat& _a, const Mat& _b, + const Mat& _c, double _alpha, double _beta, const Scalar& _s) + : op(_op), flags(_flags), a(_a), b(_b), c(_c), alpha(_alpha), beta(_beta), s(_s) +{} + +inline +MatExpr::operator Mat() const +{ + Mat m; + op->assign(*this, m); + return m; +} + +template inline +MatExpr::operator Mat_<_Tp>() const +{ + Mat_<_Tp> m; + op->assign(*this, m, DataType<_Tp>::type); + return m; +} + + +template static inline +MatExpr min(const Mat_<_Tp>& a, const Mat_<_Tp>& b) +{ + return cv::min((const Mat&)a, (const Mat&)b); +} + +template static inline +MatExpr min(const Mat_<_Tp>& a, double s) +{ + return cv::min((const Mat&)a, s); +} + +template static inline +MatExpr min(double s, const Mat_<_Tp>& a) +{ + return cv::min((const Mat&)a, s); +} + +template static inline +MatExpr max(const Mat_<_Tp>& a, const Mat_<_Tp>& b) +{ + return cv::max((const Mat&)a, (const Mat&)b); +} + +template static inline +MatExpr max(const Mat_<_Tp>& a, double s) +{ + return cv::max((const Mat&)a, s); +} + +template static inline +MatExpr max(double s, const Mat_<_Tp>& a) +{ + return cv::max((const Mat&)a, s); +} + +template static inline +MatExpr abs(const Mat_<_Tp>& m) +{ + return cv::abs((const Mat&)m); +} + + +static inline +Mat& operator += (Mat& a, const MatExpr& b) +{ + b.op->augAssignAdd(b, a); + return a; +} + +static inline +const Mat& operator += (const Mat& a, const MatExpr& b) +{ + b.op->augAssignAdd(b, (Mat&)a); + return a; +} + +template static inline +Mat_<_Tp>& operator += (Mat_<_Tp>& a, const MatExpr& b) +{ + b.op->augAssignAdd(b, a); + return a; +} + +template static inline +const Mat_<_Tp>& operator += (const Mat_<_Tp>& a, const MatExpr& b) +{ + b.op->augAssignAdd(b, (Mat&)a); + return a; +} + +static inline +Mat& operator -= (Mat& a, const MatExpr& b) +{ + b.op->augAssignSubtract(b, a); + return a; +} + +static inline +const Mat& operator -= (const Mat& a, const MatExpr& b) +{ + b.op->augAssignSubtract(b, (Mat&)a); + return a; +} + +template static inline +Mat_<_Tp>& operator -= (Mat_<_Tp>& a, const MatExpr& b) +{ + b.op->augAssignSubtract(b, a); + return a; +} + +template static inline +const Mat_<_Tp>& operator -= (const Mat_<_Tp>& a, const MatExpr& b) +{ + b.op->augAssignSubtract(b, (Mat&)a); + return a; +} + +static inline +Mat& operator *= (Mat& a, const MatExpr& b) +{ + b.op->augAssignMultiply(b, a); + return a; +} + +static inline +const Mat& operator *= (const Mat& a, const MatExpr& b) +{ + b.op->augAssignMultiply(b, (Mat&)a); + return a; +} + +template static inline +Mat_<_Tp>& operator *= (Mat_<_Tp>& a, const MatExpr& b) +{ + b.op->augAssignMultiply(b, a); + return a; +} + +template static inline +const Mat_<_Tp>& operator *= (const Mat_<_Tp>& a, const MatExpr& b) +{ + b.op->augAssignMultiply(b, (Mat&)a); + return a; +} + +static inline +Mat& operator /= (Mat& a, const MatExpr& b) +{ + b.op->augAssignDivide(b, a); + return a; +} + +static inline +const Mat& operator /= (const Mat& a, const MatExpr& b) +{ + b.op->augAssignDivide(b, (Mat&)a); + return a; +} + +template static inline +Mat_<_Tp>& operator /= (Mat_<_Tp>& a, const MatExpr& b) +{ + b.op->augAssignDivide(b, a); + return a; +} + +template static inline +const Mat_<_Tp>& operator /= (const Mat_<_Tp>& a, const MatExpr& b) +{ + b.op->augAssignDivide(b, (Mat&)a); + return a; +} + + +//////////////////////////////// UMat //////////////////////////////// + +inline +UMat::UMat(UMatUsageFlags _usageFlags) +: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) +{} + +inline +UMat::UMat(int _rows, int _cols, int _type, UMatUsageFlags _usageFlags) +: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) +{ + create(_rows, _cols, _type); +} + +inline +UMat::UMat(int _rows, int _cols, int _type, const Scalar& _s, UMatUsageFlags _usageFlags) +: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) +{ + create(_rows, _cols, _type); + *this = _s; +} + +inline +UMat::UMat(Size _sz, int _type, UMatUsageFlags _usageFlags) +: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) +{ + create( _sz.height, _sz.width, _type ); +} + +inline +UMat::UMat(Size _sz, int _type, const Scalar& _s, UMatUsageFlags _usageFlags) +: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) +{ + create(_sz.height, _sz.width, _type); + *this = _s; +} + +inline +UMat::UMat(int _dims, const int* _sz, int _type, UMatUsageFlags _usageFlags) +: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) +{ + create(_dims, _sz, _type); +} + +inline +UMat::UMat(int _dims, const int* _sz, int _type, const Scalar& _s, UMatUsageFlags _usageFlags) +: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) +{ + create(_dims, _sz, _type); + *this = _s; +} + +inline +UMat::UMat(const UMat& m) +: flags(m.flags), dims(m.dims), rows(m.rows), cols(m.cols), allocator(m.allocator), + usageFlags(m.usageFlags), u(m.u), offset(m.offset), size(&rows) +{ + addref(); + if( m.dims <= 2 ) + { + step[0] = m.step[0]; step[1] = m.step[1]; + } + else + { + dims = 0; + copySize(m); + } +} + + +template inline +UMat::UMat(const std::vector<_Tp>& vec, bool copyData) +: flags(MAGIC_VAL | DataType<_Tp>::type | CV_MAT_CONT_FLAG), dims(2), rows((int)vec.size()), +cols(1), allocator(0), usageFlags(USAGE_DEFAULT), u(0), offset(0), size(&rows) +{ + if(vec.empty()) + return; + if( !copyData ) + { + // !!!TODO!!! + CV_Error(Error::StsNotImplemented, ""); + } + else + Mat((int)vec.size(), 1, DataType<_Tp>::type, (uchar*)&vec[0]).copyTo(*this); +} + + +inline +UMat& UMat::operator = (const UMat& m) +{ + if( this != &m ) + { + const_cast(m).addref(); + release(); + flags = m.flags; + if( dims <= 2 && m.dims <= 2 ) + { + dims = m.dims; + rows = m.rows; + cols = m.cols; + step[0] = m.step[0]; + step[1] = m.step[1]; + } + else + copySize(m); + allocator = m.allocator; + if (usageFlags == USAGE_DEFAULT) + usageFlags = m.usageFlags; + u = m.u; + offset = m.offset; + } + return *this; +} + +inline +UMat UMat::row(int y) const +{ + return UMat(*this, Range(y, y + 1), Range::all()); +} + +inline +UMat UMat::col(int x) const +{ + return UMat(*this, Range::all(), Range(x, x + 1)); +} + +inline +UMat UMat::rowRange(int startrow, int endrow) const +{ + return UMat(*this, Range(startrow, endrow), Range::all()); +} + +inline +UMat UMat::rowRange(const Range& r) const +{ + return UMat(*this, r, Range::all()); +} + +inline +UMat UMat::colRange(int startcol, int endcol) const +{ + return UMat(*this, Range::all(), Range(startcol, endcol)); +} + +inline +UMat UMat::colRange(const Range& r) const +{ + return UMat(*this, Range::all(), r); +} + +inline +UMat UMat::clone() const +{ + UMat m; + copyTo(m); + return m; +} + +inline +void UMat::assignTo( UMat& m, int _type ) const +{ + if( _type < 0 ) + m = *this; + else + convertTo(m, _type); +} + +inline +void UMat::create(int _rows, int _cols, int _type, UMatUsageFlags _usageFlags) +{ + _type &= TYPE_MASK; + if( dims <= 2 && rows == _rows && cols == _cols && type() == _type && u ) + return; + int sz[] = {_rows, _cols}; + create(2, sz, _type, _usageFlags); +} + +inline +void UMat::create(Size _sz, int _type, UMatUsageFlags _usageFlags) +{ + create(_sz.height, _sz.width, _type, _usageFlags); +} + +inline +void UMat::addref() +{ + if( u ) + CV_XADD(&(u->urefcount), 1); +} + +inline void UMat::release() +{ + if( u && CV_XADD(&(u->urefcount), -1) == 1 ) + deallocate(); + for(int i = 0; i < dims; i++) + size.p[i] = 0; + u = 0; +} + +inline +UMat UMat::operator()( Range _rowRange, Range _colRange ) const +{ + return UMat(*this, _rowRange, _colRange); +} + +inline +UMat UMat::operator()( const Rect& roi ) const +{ + return UMat(*this, roi); +} + +inline +UMat UMat::operator()(const Range* ranges) const +{ + return UMat(*this, ranges); +} + +inline +bool UMat::isContinuous() const +{ + return (flags & CONTINUOUS_FLAG) != 0; +} + +inline +bool UMat::isSubmatrix() const +{ + return (flags & SUBMATRIX_FLAG) != 0; +} + +inline +size_t UMat::elemSize() const +{ + return dims > 0 ? step.p[dims - 1] : 0; +} + +inline +size_t UMat::elemSize1() const +{ + return CV_ELEM_SIZE1(flags); +} + +inline +int UMat::type() const +{ + return CV_MAT_TYPE(flags); +} + +inline +int UMat::depth() const +{ + return CV_MAT_DEPTH(flags); +} + +inline +int UMat::channels() const +{ + return CV_MAT_CN(flags); +} + +inline +size_t UMat::step1(int i) const +{ + return step.p[i] / elemSize1(); +} + +inline +bool UMat::empty() const +{ + return u == 0 || total() == 0; +} + +inline +size_t UMat::total() const +{ + if( dims <= 2 ) + return (size_t)rows * cols; + size_t p = 1; + for( int i = 0; i < dims; i++ ) + p *= size[i]; + return p; +} + +#ifdef CV_CXX_MOVE_SEMANTICS + +inline +UMat::UMat(UMat&& m) +: flags(m.flags), dims(m.dims), rows(m.rows), cols(m.cols), allocator(m.allocator), + usageFlags(m.usageFlags), u(m.u), offset(m.offset), size(&rows) +{ + if (m.dims <= 2) // move new step/size info + { + step[0] = m.step[0]; + step[1] = m.step[1]; + } + else + { + CV_DbgAssert(m.step.p != m.step.buf); + step.p = m.step.p; + size.p = m.size.p; + m.step.p = m.step.buf; + m.size.p = &m.rows; + } + m.flags = MAGIC_VAL; m.dims = m.rows = m.cols = 0; + m.allocator = NULL; + m.u = NULL; + m.offset = 0; +} + +inline +UMat& UMat::operator = (UMat&& m) +{ + release(); + flags = m.flags; dims = m.dims; rows = m.rows; cols = m.cols; + allocator = m.allocator; usageFlags = m.usageFlags; + u = m.u; + offset = m.offset; + if (step.p != step.buf) // release self step/size + { + fastFree(step.p); + step.p = step.buf; + size.p = &rows; + } + if (m.dims <= 2) // move new step/size info + { + step[0] = m.step[0]; + step[1] = m.step[1]; + } + else + { + CV_DbgAssert(m.step.p != m.step.buf); + step.p = m.step.p; + size.p = m.size.p; + m.step.p = m.step.buf; + m.size.p = &m.rows; + } + m.flags = MAGIC_VAL; m.dims = m.rows = m.cols = 0; + m.allocator = NULL; + m.u = NULL; + m.offset = 0; + return *this; +} + +#endif + + +inline bool UMatData::hostCopyObsolete() const { return (flags & HOST_COPY_OBSOLETE) != 0; } +inline bool UMatData::deviceCopyObsolete() const { return (flags & DEVICE_COPY_OBSOLETE) != 0; } +inline bool UMatData::deviceMemMapped() const { return (flags & DEVICE_MEM_MAPPED) != 0; } +inline bool UMatData::copyOnMap() const { return (flags & COPY_ON_MAP) != 0; } +inline bool UMatData::tempUMat() const { return (flags & TEMP_UMAT) != 0; } +inline bool UMatData::tempCopiedUMat() const { return (flags & TEMP_COPIED_UMAT) == TEMP_COPIED_UMAT; } + +inline void UMatData::markDeviceMemMapped(bool flag) +{ + if(flag) + flags |= DEVICE_MEM_MAPPED; + else + flags &= ~DEVICE_MEM_MAPPED; +} + +inline void UMatData::markHostCopyObsolete(bool flag) +{ + if(flag) + flags |= HOST_COPY_OBSOLETE; + else + flags &= ~HOST_COPY_OBSOLETE; +} +inline void UMatData::markDeviceCopyObsolete(bool flag) +{ + if(flag) + flags |= DEVICE_COPY_OBSOLETE; + else + flags &= ~DEVICE_COPY_OBSOLETE; +} + +inline UMatDataAutoLock::UMatDataAutoLock(UMatData* _u) : u(_u) { u->lock(); } +inline UMatDataAutoLock::~UMatDataAutoLock() { u->unlock(); } + +//! @endcond + +} //cv + +#endif diff --git a/lib/opencv/include/opencv2/core/matx.hpp b/lib/opencv/include/opencv2/core/matx.hpp new file mode 100644 index 000000000..ca5f26198 --- /dev/null +++ b/lib/opencv/include/opencv2/core/matx.hpp @@ -0,0 +1,1407 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_MATX_HPP__ +#define __OPENCV_CORE_MATX_HPP__ + +#ifndef __cplusplus +# error matx.hpp header must be compiled as C++ +#endif + +#include "opencv2/core/cvdef.h" +#include "opencv2/core/base.hpp" +#include "opencv2/core/traits.hpp" +#include "opencv2/core/saturate.hpp" + +namespace cv +{ + +//! @addtogroup core_basic +//! @{ + +////////////////////////////// Small Matrix /////////////////////////// + +//! @cond IGNORED +struct CV_EXPORTS Matx_AddOp {}; +struct CV_EXPORTS Matx_SubOp {}; +struct CV_EXPORTS Matx_ScaleOp {}; +struct CV_EXPORTS Matx_MulOp {}; +struct CV_EXPORTS Matx_DivOp {}; +struct CV_EXPORTS Matx_MatMulOp {}; +struct CV_EXPORTS Matx_TOp {}; +//! @endcond + +/** @brief Template class for small matrices whose type and size are known at compilation time + +If you need a more flexible type, use Mat . The elements of the matrix M are accessible using the +M(i,j) notation. Most of the common matrix operations (see also @ref MatrixExpressions ) are +available. To do an operation on Matx that is not implemented, you can easily convert the matrix to +Mat and backwards: +@code + Matx33f m(1, 2, 3, + 4, 5, 6, + 7, 8, 9); + cout << sum(Mat(m*m.t())) << endl; + @endcode + */ +template class Matx +{ +public: + enum { depth = DataType<_Tp>::depth, + rows = m, + cols = n, + channels = rows*cols, + type = CV_MAKETYPE(depth, channels), + shortdim = (m < n ? m : n) + }; + + typedef _Tp value_type; + typedef Matx<_Tp, m, n> mat_type; + typedef Matx<_Tp, shortdim, 1> diag_type; + + //! default constructor + Matx(); + + Matx(_Tp v0); //!< 1x1 matrix + Matx(_Tp v0, _Tp v1); //!< 1x2 or 2x1 matrix + Matx(_Tp v0, _Tp v1, _Tp v2); //!< 1x3 or 3x1 matrix + Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3); //!< 1x4, 2x2 or 4x1 matrix + Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4); //!< 1x5 or 5x1 matrix + Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5); //!< 1x6, 2x3, 3x2 or 6x1 matrix + Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6); //!< 1x7 or 7x1 matrix + Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7); //!< 1x8, 2x4, 4x2 or 8x1 matrix + Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8); //!< 1x9, 3x3 or 9x1 matrix + Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9); //!< 1x10, 2x5 or 5x2 or 10x1 matrix + Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, + _Tp v4, _Tp v5, _Tp v6, _Tp v7, + _Tp v8, _Tp v9, _Tp v10, _Tp v11); //!< 1x12, 2x6, 3x4, 4x3, 6x2 or 12x1 matrix + Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, + _Tp v4, _Tp v5, _Tp v6, _Tp v7, + _Tp v8, _Tp v9, _Tp v10, _Tp v11, + _Tp v12, _Tp v13); //!< 1x14, 2x7, 7x2 or 14x1 matrix + Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, + _Tp v4, _Tp v5, _Tp v6, _Tp v7, + _Tp v8, _Tp v9, _Tp v10, _Tp v11, + _Tp v12, _Tp v13, _Tp v14, _Tp v15); //!< 1x16, 4x4 or 16x1 matrix + explicit Matx(const _Tp* vals); //!< initialize from a plain array + + static Matx all(_Tp alpha); + static Matx zeros(); + static Matx ones(); + static Matx eye(); + static Matx diag(const diag_type& d); + static Matx randu(_Tp a, _Tp b); + static Matx randn(_Tp a, _Tp b); + + //! dot product computed with the default precision + _Tp dot(const Matx<_Tp, m, n>& v) const; + + //! dot product computed in double-precision arithmetics + double ddot(const Matx<_Tp, m, n>& v) const; + + //! conversion to another data type + template operator Matx() const; + + //! change the matrix shape + template Matx<_Tp, m1, n1> reshape() const; + + //! extract part of the matrix + template Matx<_Tp, m1, n1> get_minor(int i, int j) const; + + //! extract the matrix row + Matx<_Tp, 1, n> row(int i) const; + + //! extract the matrix column + Matx<_Tp, m, 1> col(int i) const; + + //! extract the matrix diagonal + diag_type diag() const; + + //! transpose the matrix + Matx<_Tp, n, m> t() const; + + //! invert the matrix + Matx<_Tp, n, m> inv(int method=DECOMP_LU, bool *p_is_ok = NULL) const; + + //! solve linear system + template Matx<_Tp, n, l> solve(const Matx<_Tp, m, l>& rhs, int flags=DECOMP_LU) const; + Vec<_Tp, n> solve(const Vec<_Tp, m>& rhs, int method) const; + + //! multiply two matrices element-wise + Matx<_Tp, m, n> mul(const Matx<_Tp, m, n>& a) const; + + //! divide two matrices element-wise + Matx<_Tp, m, n> div(const Matx<_Tp, m, n>& a) const; + + //! element access + const _Tp& operator ()(int i, int j) const; + _Tp& operator ()(int i, int j); + + //! 1D element access + const _Tp& operator ()(int i) const; + _Tp& operator ()(int i); + + Matx(const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b, Matx_AddOp); + Matx(const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b, Matx_SubOp); + template Matx(const Matx<_Tp, m, n>& a, _T2 alpha, Matx_ScaleOp); + Matx(const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b, Matx_MulOp); + Matx(const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b, Matx_DivOp); + template Matx(const Matx<_Tp, m, l>& a, const Matx<_Tp, l, n>& b, Matx_MatMulOp); + Matx(const Matx<_Tp, n, m>& a, Matx_TOp); + + _Tp val[m*n]; //< matrix elements +}; + +typedef Matx Matx12f; +typedef Matx Matx12d; +typedef Matx Matx13f; +typedef Matx Matx13d; +typedef Matx Matx14f; +typedef Matx Matx14d; +typedef Matx Matx16f; +typedef Matx Matx16d; + +typedef Matx Matx21f; +typedef Matx Matx21d; +typedef Matx Matx31f; +typedef Matx Matx31d; +typedef Matx Matx41f; +typedef Matx Matx41d; +typedef Matx Matx61f; +typedef Matx Matx61d; + +typedef Matx Matx22f; +typedef Matx Matx22d; +typedef Matx Matx23f; +typedef Matx Matx23d; +typedef Matx Matx32f; +typedef Matx Matx32d; + +typedef Matx Matx33f; +typedef Matx Matx33d; + +typedef Matx Matx34f; +typedef Matx Matx34d; +typedef Matx Matx43f; +typedef Matx Matx43d; + +typedef Matx Matx44f; +typedef Matx Matx44d; +typedef Matx Matx66f; +typedef Matx Matx66d; + +/*! + traits +*/ +template class DataType< Matx<_Tp, m, n> > +{ +public: + typedef Matx<_Tp, m, n> value_type; + typedef Matx::work_type, m, n> work_type; + typedef _Tp channel_type; + typedef value_type vec_type; + + enum { generic_type = 0, + depth = DataType::depth, + channels = m * n, + fmt = DataType::fmt + ((channels - 1) << 8), + type = CV_MAKETYPE(depth, channels) + }; +}; + +/** @brief Comma-separated Matrix Initializer +*/ +template class MatxCommaInitializer +{ +public: + MatxCommaInitializer(Matx<_Tp, m, n>* _mtx); + template MatxCommaInitializer<_Tp, m, n>& operator , (T2 val); + Matx<_Tp, m, n> operator *() const; + + Matx<_Tp, m, n>* dst; + int idx; +}; + +/* + Utility methods +*/ +template static double determinant(const Matx<_Tp, m, m>& a); +template static double trace(const Matx<_Tp, m, n>& a); +template static double norm(const Matx<_Tp, m, n>& M); +template static double norm(const Matx<_Tp, m, n>& M, int normType); + + + +/////////////////////// Vec (used as element of multi-channel images ///////////////////// + +/** @brief Template class for short numerical vectors, a partial case of Matx + +This template class represents short numerical vectors (of 1, 2, 3, 4 ... elements) on which you +can perform basic arithmetical operations, access individual elements using [] operator etc. The +vectors are allocated on stack, as opposite to std::valarray, std::vector, cv::Mat etc., which +elements are dynamically allocated in the heap. + +The template takes 2 parameters: +@tparam _Tp element type +@tparam cn the number of elements + +In addition to the universal notation like Vec, you can use shorter aliases +for the most popular specialized variants of Vec, e.g. Vec3f ~ Vec. + +It is possible to convert Vec\ to/from Point_, Vec\ to/from Point3_ , and Vec\ +to CvScalar or Scalar_. Use operator[] to access the elements of Vec. + +All the expected vector operations are also implemented: +- v1 = v2 + v3 +- v1 = v2 - v3 +- v1 = v2 \* scale +- v1 = scale \* v2 +- v1 = -v2 +- v1 += v2 and other augmenting operations +- v1 == v2, v1 != v2 +- norm(v1) (euclidean norm) +The Vec class is commonly used to describe pixel types of multi-channel arrays. See Mat for details. +*/ +template class Vec : public Matx<_Tp, cn, 1> +{ +public: + typedef _Tp value_type; + enum { depth = Matx<_Tp, cn, 1>::depth, + channels = cn, + type = CV_MAKETYPE(depth, channels) + }; + + //! default constructor + Vec(); + + Vec(_Tp v0); //!< 1-element vector constructor + Vec(_Tp v0, _Tp v1); //!< 2-element vector constructor + Vec(_Tp v0, _Tp v1, _Tp v2); //!< 3-element vector constructor + Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3); //!< 4-element vector constructor + Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4); //!< 5-element vector constructor + Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5); //!< 6-element vector constructor + Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6); //!< 7-element vector constructor + Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7); //!< 8-element vector constructor + Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8); //!< 9-element vector constructor + Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9); //!< 10-element vector constructor + Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9, _Tp v10, _Tp v11, _Tp v12, _Tp v13); //!< 14-element vector constructor + explicit Vec(const _Tp* values); + + Vec(const Vec<_Tp, cn>& v); + + static Vec all(_Tp alpha); + + //! per-element multiplication + Vec mul(const Vec<_Tp, cn>& v) const; + + //! conjugation (makes sense for complex numbers and quaternions) + Vec conj() const; + + /*! + cross product of the two 3D vectors. + + For other dimensionalities the exception is raised + */ + Vec cross(const Vec& v) const; + //! conversion to another data type + template operator Vec() const; + + /*! element access */ + const _Tp& operator [](int i) const; + _Tp& operator[](int i); + const _Tp& operator ()(int i) const; + _Tp& operator ()(int i); + + Vec(const Matx<_Tp, cn, 1>& a, const Matx<_Tp, cn, 1>& b, Matx_AddOp); + Vec(const Matx<_Tp, cn, 1>& a, const Matx<_Tp, cn, 1>& b, Matx_SubOp); + template Vec(const Matx<_Tp, cn, 1>& a, _T2 alpha, Matx_ScaleOp); +}; + +/** @name Shorter aliases for the most popular specializations of Vec + @{ +*/ +typedef Vec Vec2b; +typedef Vec Vec3b; +typedef Vec Vec4b; + +typedef Vec Vec2s; +typedef Vec Vec3s; +typedef Vec Vec4s; + +typedef Vec Vec2w; +typedef Vec Vec3w; +typedef Vec Vec4w; + +typedef Vec Vec2i; +typedef Vec Vec3i; +typedef Vec Vec4i; +typedef Vec Vec6i; +typedef Vec Vec8i; + +typedef Vec Vec2f; +typedef Vec Vec3f; +typedef Vec Vec4f; +typedef Vec Vec6f; + +typedef Vec Vec2d; +typedef Vec Vec3d; +typedef Vec Vec4d; +typedef Vec Vec6d; +/** @} */ + +/*! + traits +*/ +template class DataType< Vec<_Tp, cn> > +{ +public: + typedef Vec<_Tp, cn> value_type; + typedef Vec::work_type, cn> work_type; + typedef _Tp channel_type; + typedef value_type vec_type; + + enum { generic_type = 0, + depth = DataType::depth, + channels = cn, + fmt = DataType::fmt + ((channels - 1) << 8), + type = CV_MAKETYPE(depth, channels) + }; +}; + +/** @brief Comma-separated Vec Initializer +*/ +template class VecCommaInitializer : public MatxCommaInitializer<_Tp, m, 1> +{ +public: + VecCommaInitializer(Vec<_Tp, m>* _vec); + template VecCommaInitializer<_Tp, m>& operator , (T2 val); + Vec<_Tp, m> operator *() const; +}; + +template static Vec<_Tp, cn> normalize(const Vec<_Tp, cn>& v); + +//! @} core_basic + +//! @cond IGNORED + +///////////////////////////////////// helper classes ///////////////////////////////////// +namespace internal +{ + +template struct Matx_DetOp +{ + double operator ()(const Matx<_Tp, m, m>& a) const + { + Matx<_Tp, m, m> temp = a; + double p = LU(temp.val, m*sizeof(_Tp), m, 0, 0, 0); + if( p == 0 ) + return p; + for( int i = 0; i < m; i++ ) + p *= temp(i, i); + return 1./p; + } +}; + +template struct Matx_DetOp<_Tp, 1> +{ + double operator ()(const Matx<_Tp, 1, 1>& a) const + { + return a(0,0); + } +}; + +template struct Matx_DetOp<_Tp, 2> +{ + double operator ()(const Matx<_Tp, 2, 2>& a) const + { + return a(0,0)*a(1,1) - a(0,1)*a(1,0); + } +}; + +template struct Matx_DetOp<_Tp, 3> +{ + double operator ()(const Matx<_Tp, 3, 3>& a) const + { + return a(0,0)*(a(1,1)*a(2,2) - a(2,1)*a(1,2)) - + a(0,1)*(a(1,0)*a(2,2) - a(2,0)*a(1,2)) + + a(0,2)*(a(1,0)*a(2,1) - a(2,0)*a(1,1)); + } +}; + +template Vec<_Tp, 2> inline conjugate(const Vec<_Tp, 2>& v) +{ + return Vec<_Tp, 2>(v[0], -v[1]); +} + +template Vec<_Tp, 4> inline conjugate(const Vec<_Tp, 4>& v) +{ + return Vec<_Tp, 4>(v[0], -v[1], -v[2], -v[3]); +} + +} // internal + + + +////////////////////////////////// Matx Implementation /////////////////////////////////// + +template inline +Matx<_Tp, m, n>::Matx() +{ + for(int i = 0; i < channels; i++) val[i] = _Tp(0); +} + +template inline +Matx<_Tp, m, n>::Matx(_Tp v0) +{ + val[0] = v0; + for(int i = 1; i < channels; i++) val[i] = _Tp(0); +} + +template inline +Matx<_Tp, m, n>::Matx(_Tp v0, _Tp v1) +{ + CV_StaticAssert(channels >= 2, "Matx should have at least 2 elements."); + val[0] = v0; val[1] = v1; + for(int i = 2; i < channels; i++) val[i] = _Tp(0); +} + +template inline +Matx<_Tp, m, n>::Matx(_Tp v0, _Tp v1, _Tp v2) +{ + CV_StaticAssert(channels >= 3, "Matx should have at least 3 elements."); + val[0] = v0; val[1] = v1; val[2] = v2; + for(int i = 3; i < channels; i++) val[i] = _Tp(0); +} + +template inline +Matx<_Tp, m, n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3) +{ + CV_StaticAssert(channels >= 4, "Matx should have at least 4 elements."); + val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3; + for(int i = 4; i < channels; i++) val[i] = _Tp(0); +} + +template inline +Matx<_Tp, m, n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4) +{ + CV_StaticAssert(channels >= 5, "Matx should have at least 5 elements."); + val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3; val[4] = v4; + for(int i = 5; i < channels; i++) val[i] = _Tp(0); +} + +template inline +Matx<_Tp, m, n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5) +{ + CV_StaticAssert(channels >= 6, "Matx should have at least 6 elements."); + val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3; + val[4] = v4; val[5] = v5; + for(int i = 6; i < channels; i++) val[i] = _Tp(0); +} + +template inline +Matx<_Tp, m, n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6) +{ + CV_StaticAssert(channels >= 7, "Matx should have at least 7 elements."); + val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3; + val[4] = v4; val[5] = v5; val[6] = v6; + for(int i = 7; i < channels; i++) val[i] = _Tp(0); +} + +template inline +Matx<_Tp, m, n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7) +{ + CV_StaticAssert(channels >= 8, "Matx should have at least 8 elements."); + val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3; + val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7; + for(int i = 8; i < channels; i++) val[i] = _Tp(0); +} + +template inline +Matx<_Tp, m, n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8) +{ + CV_StaticAssert(channels >= 9, "Matx should have at least 9 elements."); + val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3; + val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7; + val[8] = v8; + for(int i = 9; i < channels; i++) val[i] = _Tp(0); +} + +template inline +Matx<_Tp, m, n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9) +{ + CV_StaticAssert(channels >= 10, "Matx should have at least 10 elements."); + val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3; + val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7; + val[8] = v8; val[9] = v9; + for(int i = 10; i < channels; i++) val[i] = _Tp(0); +} + + +template inline +Matx<_Tp,m,n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9, _Tp v10, _Tp v11) +{ + CV_StaticAssert(channels >= 12, "Matx should have at least 12 elements."); + val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3; + val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7; + val[8] = v8; val[9] = v9; val[10] = v10; val[11] = v11; + for(int i = 12; i < channels; i++) val[i] = _Tp(0); +} + +template inline +Matx<_Tp,m,n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9, _Tp v10, _Tp v11, _Tp v12, _Tp v13) +{ + CV_StaticAssert(channels == 14, "Matx should have at least 14 elements."); + val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3; + val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7; + val[8] = v8; val[9] = v9; val[10] = v10; val[11] = v11; + val[12] = v12; val[13] = v13; +} + + +template inline +Matx<_Tp,m,n>::Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9, _Tp v10, _Tp v11, _Tp v12, _Tp v13, _Tp v14, _Tp v15) +{ + CV_StaticAssert(channels >= 16, "Matx should have at least 16 elements."); + val[0] = v0; val[1] = v1; val[2] = v2; val[3] = v3; + val[4] = v4; val[5] = v5; val[6] = v6; val[7] = v7; + val[8] = v8; val[9] = v9; val[10] = v10; val[11] = v11; + val[12] = v12; val[13] = v13; val[14] = v14; val[15] = v15; + for(int i = 16; i < channels; i++) val[i] = _Tp(0); +} + +template inline +Matx<_Tp, m, n>::Matx(const _Tp* values) +{ + for( int i = 0; i < channels; i++ ) val[i] = values[i]; +} + +template inline +Matx<_Tp, m, n> Matx<_Tp, m, n>::all(_Tp alpha) +{ + Matx<_Tp, m, n> M; + for( int i = 0; i < m*n; i++ ) M.val[i] = alpha; + return M; +} + +template inline +Matx<_Tp,m,n> Matx<_Tp,m,n>::zeros() +{ + return all(0); +} + +template inline +Matx<_Tp,m,n> Matx<_Tp,m,n>::ones() +{ + return all(1); +} + +template inline +Matx<_Tp,m,n> Matx<_Tp,m,n>::eye() +{ + Matx<_Tp,m,n> M; + for(int i = 0; i < shortdim; i++) + M(i,i) = 1; + return M; +} + +template inline +_Tp Matx<_Tp, m, n>::dot(const Matx<_Tp, m, n>& M) const +{ + _Tp s = 0; + for( int i = 0; i < channels; i++ ) s += val[i]*M.val[i]; + return s; +} + +template inline +double Matx<_Tp, m, n>::ddot(const Matx<_Tp, m, n>& M) const +{ + double s = 0; + for( int i = 0; i < channels; i++ ) s += (double)val[i]*M.val[i]; + return s; +} + +template inline +Matx<_Tp,m,n> Matx<_Tp,m,n>::diag(const typename Matx<_Tp,m,n>::diag_type& d) +{ + Matx<_Tp,m,n> M; + for(int i = 0; i < shortdim; i++) + M(i,i) = d(i, 0); + return M; +} + +template template +inline Matx<_Tp, m, n>::operator Matx() const +{ + Matx M; + for( int i = 0; i < m*n; i++ ) M.val[i] = saturate_cast(val[i]); + return M; +} + +template template inline +Matx<_Tp, m1, n1> Matx<_Tp, m, n>::reshape() const +{ + CV_StaticAssert(m1*n1 == m*n, "Input and destnarion matrices must have the same number of elements"); + return (const Matx<_Tp, m1, n1>&)*this; +} + +template +template inline +Matx<_Tp, m1, n1> Matx<_Tp, m, n>::get_minor(int i, int j) const +{ + CV_DbgAssert(0 <= i && i+m1 <= m && 0 <= j && j+n1 <= n); + Matx<_Tp, m1, n1> s; + for( int di = 0; di < m1; di++ ) + for( int dj = 0; dj < n1; dj++ ) + s(di, dj) = (*this)(i+di, j+dj); + return s; +} + +template inline +Matx<_Tp, 1, n> Matx<_Tp, m, n>::row(int i) const +{ + CV_DbgAssert((unsigned)i < (unsigned)m); + return Matx<_Tp, 1, n>(&val[i*n]); +} + +template inline +Matx<_Tp, m, 1> Matx<_Tp, m, n>::col(int j) const +{ + CV_DbgAssert((unsigned)j < (unsigned)n); + Matx<_Tp, m, 1> v; + for( int i = 0; i < m; i++ ) + v.val[i] = val[i*n + j]; + return v; +} + +template inline +typename Matx<_Tp, m, n>::diag_type Matx<_Tp, m, n>::diag() const +{ + diag_type d; + for( int i = 0; i < shortdim; i++ ) + d.val[i] = val[i*n + i]; + return d; +} + +template inline +const _Tp& Matx<_Tp, m, n>::operator()(int i, int j) const +{ + CV_DbgAssert( (unsigned)i < (unsigned)m && (unsigned)j < (unsigned)n ); + return this->val[i*n + j]; +} + +template inline +_Tp& Matx<_Tp, m, n>::operator ()(int i, int j) +{ + CV_DbgAssert( (unsigned)i < (unsigned)m && (unsigned)j < (unsigned)n ); + return val[i*n + j]; +} + +template inline +const _Tp& Matx<_Tp, m, n>::operator ()(int i) const +{ + CV_StaticAssert(m == 1 || n == 1, "Single index indexation requires matrix to be a column or a row"); + CV_DbgAssert( (unsigned)i < (unsigned)(m+n-1) ); + return val[i]; +} + +template inline +_Tp& Matx<_Tp, m, n>::operator ()(int i) +{ + CV_StaticAssert(m == 1 || n == 1, "Single index indexation requires matrix to be a column or a row"); + CV_DbgAssert( (unsigned)i < (unsigned)(m+n-1) ); + return val[i]; +} + +template inline +Matx<_Tp,m,n>::Matx(const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b, Matx_AddOp) +{ + for( int i = 0; i < channels; i++ ) + val[i] = saturate_cast<_Tp>(a.val[i] + b.val[i]); +} + +template inline +Matx<_Tp,m,n>::Matx(const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b, Matx_SubOp) +{ + for( int i = 0; i < channels; i++ ) + val[i] = saturate_cast<_Tp>(a.val[i] - b.val[i]); +} + +template template inline +Matx<_Tp,m,n>::Matx(const Matx<_Tp, m, n>& a, _T2 alpha, Matx_ScaleOp) +{ + for( int i = 0; i < channels; i++ ) + val[i] = saturate_cast<_Tp>(a.val[i] * alpha); +} + +template inline +Matx<_Tp,m,n>::Matx(const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b, Matx_MulOp) +{ + for( int i = 0; i < channels; i++ ) + val[i] = saturate_cast<_Tp>(a.val[i] * b.val[i]); +} + +template inline +Matx<_Tp,m,n>::Matx(const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b, Matx_DivOp) +{ + for( int i = 0; i < channels; i++ ) + val[i] = saturate_cast<_Tp>(a.val[i] / b.val[i]); +} + +template template inline +Matx<_Tp,m,n>::Matx(const Matx<_Tp, m, l>& a, const Matx<_Tp, l, n>& b, Matx_MatMulOp) +{ + for( int i = 0; i < m; i++ ) + for( int j = 0; j < n; j++ ) + { + _Tp s = 0; + for( int k = 0; k < l; k++ ) + s += a(i, k) * b(k, j); + val[i*n + j] = s; + } +} + +template inline +Matx<_Tp,m,n>::Matx(const Matx<_Tp, n, m>& a, Matx_TOp) +{ + for( int i = 0; i < m; i++ ) + for( int j = 0; j < n; j++ ) + val[i*n + j] = a(j, i); +} + +template inline +Matx<_Tp, m, n> Matx<_Tp, m, n>::mul(const Matx<_Tp, m, n>& a) const +{ + return Matx<_Tp, m, n>(*this, a, Matx_MulOp()); +} + +template inline +Matx<_Tp, m, n> Matx<_Tp, m, n>::div(const Matx<_Tp, m, n>& a) const +{ + return Matx<_Tp, m, n>(*this, a, Matx_DivOp()); +} + +template inline +Matx<_Tp, n, m> Matx<_Tp, m, n>::t() const +{ + return Matx<_Tp, n, m>(*this, Matx_TOp()); +} + +template inline +Vec<_Tp, n> Matx<_Tp, m, n>::solve(const Vec<_Tp, m>& rhs, int method) const +{ + Matx<_Tp, n, 1> x = solve((const Matx<_Tp, m, 1>&)(rhs), method); + return (Vec<_Tp, n>&)(x); +} + +template static inline +double determinant(const Matx<_Tp, m, m>& a) +{ + return cv::internal::Matx_DetOp<_Tp, m>()(a); +} + +template static inline +double trace(const Matx<_Tp, m, n>& a) +{ + _Tp s = 0; + for( int i = 0; i < std::min(m, n); i++ ) + s += a(i,i); + return s; +} + +template static inline +double norm(const Matx<_Tp, m, n>& M) +{ + return std::sqrt(normL2Sqr<_Tp, double>(M.val, m*n)); +} + +template static inline +double norm(const Matx<_Tp, m, n>& M, int normType) +{ + switch(normType) { + case NORM_INF: + return (double)normInf<_Tp, typename DataType<_Tp>::work_type>(M.val, m*n); + case NORM_L1: + return (double)normL1<_Tp, typename DataType<_Tp>::work_type>(M.val, m*n); + case NORM_L2SQR: + return (double)normL2Sqr<_Tp, typename DataType<_Tp>::work_type>(M.val, m*n); + default: + case NORM_L2: + return std::sqrt((double)normL2Sqr<_Tp, typename DataType<_Tp>::work_type>(M.val, m*n)); + } +} + + + +//////////////////////////////// matx comma initializer ////////////////////////////////// + +template static inline +MatxCommaInitializer<_Tp, m, n> operator << (const Matx<_Tp, m, n>& mtx, _T2 val) +{ + MatxCommaInitializer<_Tp, m, n> commaInitializer((Matx<_Tp, m, n>*)&mtx); + return (commaInitializer, val); +} + +template inline +MatxCommaInitializer<_Tp, m, n>::MatxCommaInitializer(Matx<_Tp, m, n>* _mtx) + : dst(_mtx), idx(0) +{} + +template template inline +MatxCommaInitializer<_Tp, m, n>& MatxCommaInitializer<_Tp, m, n>::operator , (_T2 value) +{ + CV_DbgAssert( idx < m*n ); + dst->val[idx++] = saturate_cast<_Tp>(value); + return *this; +} + +template inline +Matx<_Tp, m, n> MatxCommaInitializer<_Tp, m, n>::operator *() const +{ + CV_DbgAssert( idx == n*m ); + return *dst; +} + + + +/////////////////////////////////// Vec Implementation /////////////////////////////////// + +template inline +Vec<_Tp, cn>::Vec() {} + +template inline +Vec<_Tp, cn>::Vec(_Tp v0) + : Matx<_Tp, cn, 1>(v0) {} + +template inline +Vec<_Tp, cn>::Vec(_Tp v0, _Tp v1) + : Matx<_Tp, cn, 1>(v0, v1) {} + +template inline +Vec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2) + : Matx<_Tp, cn, 1>(v0, v1, v2) {} + +template inline +Vec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3) + : Matx<_Tp, cn, 1>(v0, v1, v2, v3) {} + +template inline +Vec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4) + : Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4) {} + +template inline +Vec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5) + : Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5) {} + +template inline +Vec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6) + : Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5, v6) {} + +template inline +Vec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7) + : Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5, v6, v7) {} + +template inline +Vec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8) + : Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5, v6, v7, v8) {} + +template inline +Vec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9) + : Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9) {} + +template inline +Vec<_Tp, cn>::Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9, _Tp v10, _Tp v11, _Tp v12, _Tp v13) + : Matx<_Tp, cn, 1>(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) {} + +template inline +Vec<_Tp, cn>::Vec(const _Tp* values) + : Matx<_Tp, cn, 1>(values) {} + +template inline +Vec<_Tp, cn>::Vec(const Vec<_Tp, cn>& m) + : Matx<_Tp, cn, 1>(m.val) {} + +template inline +Vec<_Tp, cn>::Vec(const Matx<_Tp, cn, 1>& a, const Matx<_Tp, cn, 1>& b, Matx_AddOp op) + : Matx<_Tp, cn, 1>(a, b, op) {} + +template inline +Vec<_Tp, cn>::Vec(const Matx<_Tp, cn, 1>& a, const Matx<_Tp, cn, 1>& b, Matx_SubOp op) + : Matx<_Tp, cn, 1>(a, b, op) {} + +template template inline +Vec<_Tp, cn>::Vec(const Matx<_Tp, cn, 1>& a, _T2 alpha, Matx_ScaleOp op) + : Matx<_Tp, cn, 1>(a, alpha, op) {} + +template inline +Vec<_Tp, cn> Vec<_Tp, cn>::all(_Tp alpha) +{ + Vec v; + for( int i = 0; i < cn; i++ ) v.val[i] = alpha; + return v; +} + +template inline +Vec<_Tp, cn> Vec<_Tp, cn>::mul(const Vec<_Tp, cn>& v) const +{ + Vec<_Tp, cn> w; + for( int i = 0; i < cn; i++ ) w.val[i] = saturate_cast<_Tp>(this->val[i]*v.val[i]); + return w; +} + +template<> inline +Vec Vec::conj() const +{ + return cv::internal::conjugate(*this); +} + +template<> inline +Vec Vec::conj() const +{ + return cv::internal::conjugate(*this); +} + +template<> inline +Vec Vec::conj() const +{ + return cv::internal::conjugate(*this); +} + +template<> inline +Vec Vec::conj() const +{ + return cv::internal::conjugate(*this); +} + +template inline +Vec<_Tp, cn> Vec<_Tp, cn>::cross(const Vec<_Tp, cn>&) const +{ + CV_StaticAssert(cn == 3, "for arbitrary-size vector there is no cross-product defined"); + return Vec<_Tp, cn>(); +} + +template<> inline +Vec Vec::cross(const Vec& v) const +{ + return Vec(val[1]*v.val[2] - val[2]*v.val[1], + val[2]*v.val[0] - val[0]*v.val[2], + val[0]*v.val[1] - val[1]*v.val[0]); +} + +template<> inline +Vec Vec::cross(const Vec& v) const +{ + return Vec(val[1]*v.val[2] - val[2]*v.val[1], + val[2]*v.val[0] - val[0]*v.val[2], + val[0]*v.val[1] - val[1]*v.val[0]); +} + +template template inline +Vec<_Tp, cn>::operator Vec() const +{ + Vec v; + for( int i = 0; i < cn; i++ ) v.val[i] = saturate_cast(this->val[i]); + return v; +} + +template inline +const _Tp& Vec<_Tp, cn>::operator [](int i) const +{ + CV_DbgAssert( (unsigned)i < (unsigned)cn ); + return this->val[i]; +} + +template inline +_Tp& Vec<_Tp, cn>::operator [](int i) +{ + CV_DbgAssert( (unsigned)i < (unsigned)cn ); + return this->val[i]; +} + +template inline +const _Tp& Vec<_Tp, cn>::operator ()(int i) const +{ + CV_DbgAssert( (unsigned)i < (unsigned)cn ); + return this->val[i]; +} + +template inline +_Tp& Vec<_Tp, cn>::operator ()(int i) +{ + CV_DbgAssert( (unsigned)i < (unsigned)cn ); + return this->val[i]; +} + +template inline +Vec<_Tp, cn> normalize(const Vec<_Tp, cn>& v) +{ + double nv = norm(v); + return v * (nv ? 1./nv : 0.); +} + + + +//////////////////////////////// matx comma initializer ////////////////////////////////// + + +template static inline +VecCommaInitializer<_Tp, cn> operator << (const Vec<_Tp, cn>& vec, _T2 val) +{ + VecCommaInitializer<_Tp, cn> commaInitializer((Vec<_Tp, cn>*)&vec); + return (commaInitializer, val); +} + +template inline +VecCommaInitializer<_Tp, cn>::VecCommaInitializer(Vec<_Tp, cn>* _vec) + : MatxCommaInitializer<_Tp, cn, 1>(_vec) +{} + +template template inline +VecCommaInitializer<_Tp, cn>& VecCommaInitializer<_Tp, cn>::operator , (_T2 value) +{ + CV_DbgAssert( this->idx < cn ); + this->dst->val[this->idx++] = saturate_cast<_Tp>(value); + return *this; +} + +template inline +Vec<_Tp, cn> VecCommaInitializer<_Tp, cn>::operator *() const +{ + CV_DbgAssert( this->idx == cn ); + return *this->dst; +} + +//! @endcond + +///////////////////////////// Matx out-of-class operators //////////////////////////////// + +//! @relates cv::Matx +//! @{ + +template static inline +Matx<_Tp1, m, n>& operator += (Matx<_Tp1, m, n>& a, const Matx<_Tp2, m, n>& b) +{ + for( int i = 0; i < m*n; i++ ) + a.val[i] = saturate_cast<_Tp1>(a.val[i] + b.val[i]); + return a; +} + +template static inline +Matx<_Tp1, m, n>& operator -= (Matx<_Tp1, m, n>& a, const Matx<_Tp2, m, n>& b) +{ + for( int i = 0; i < m*n; i++ ) + a.val[i] = saturate_cast<_Tp1>(a.val[i] - b.val[i]); + return a; +} + +template static inline +Matx<_Tp, m, n> operator + (const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b) +{ + return Matx<_Tp, m, n>(a, b, Matx_AddOp()); +} + +template static inline +Matx<_Tp, m, n> operator - (const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b) +{ + return Matx<_Tp, m, n>(a, b, Matx_SubOp()); +} + +template static inline +Matx<_Tp, m, n>& operator *= (Matx<_Tp, m, n>& a, int alpha) +{ + for( int i = 0; i < m*n; i++ ) + a.val[i] = saturate_cast<_Tp>(a.val[i] * alpha); + return a; +} + +template static inline +Matx<_Tp, m, n>& operator *= (Matx<_Tp, m, n>& a, float alpha) +{ + for( int i = 0; i < m*n; i++ ) + a.val[i] = saturate_cast<_Tp>(a.val[i] * alpha); + return a; +} + +template static inline +Matx<_Tp, m, n>& operator *= (Matx<_Tp, m, n>& a, double alpha) +{ + for( int i = 0; i < m*n; i++ ) + a.val[i] = saturate_cast<_Tp>(a.val[i] * alpha); + return a; +} + +template static inline +Matx<_Tp, m, n> operator * (const Matx<_Tp, m, n>& a, int alpha) +{ + return Matx<_Tp, m, n>(a, alpha, Matx_ScaleOp()); +} + +template static inline +Matx<_Tp, m, n> operator * (const Matx<_Tp, m, n>& a, float alpha) +{ + return Matx<_Tp, m, n>(a, alpha, Matx_ScaleOp()); +} + +template static inline +Matx<_Tp, m, n> operator * (const Matx<_Tp, m, n>& a, double alpha) +{ + return Matx<_Tp, m, n>(a, alpha, Matx_ScaleOp()); +} + +template static inline +Matx<_Tp, m, n> operator * (int alpha, const Matx<_Tp, m, n>& a) +{ + return Matx<_Tp, m, n>(a, alpha, Matx_ScaleOp()); +} + +template static inline +Matx<_Tp, m, n> operator * (float alpha, const Matx<_Tp, m, n>& a) +{ + return Matx<_Tp, m, n>(a, alpha, Matx_ScaleOp()); +} + +template static inline +Matx<_Tp, m, n> operator * (double alpha, const Matx<_Tp, m, n>& a) +{ + return Matx<_Tp, m, n>(a, alpha, Matx_ScaleOp()); +} + +template static inline +Matx<_Tp, m, n> operator - (const Matx<_Tp, m, n>& a) +{ + return Matx<_Tp, m, n>(a, -1, Matx_ScaleOp()); +} + +template static inline +Matx<_Tp, m, n> operator * (const Matx<_Tp, m, l>& a, const Matx<_Tp, l, n>& b) +{ + return Matx<_Tp, m, n>(a, b, Matx_MatMulOp()); +} + +template static inline +Vec<_Tp, m> operator * (const Matx<_Tp, m, n>& a, const Vec<_Tp, n>& b) +{ + Matx<_Tp, m, 1> c(a, b, Matx_MatMulOp()); + return (const Vec<_Tp, m>&)(c); +} + +template static inline +bool operator == (const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b) +{ + for( int i = 0; i < m*n; i++ ) + if( a.val[i] != b.val[i] ) return false; + return true; +} + +template static inline +bool operator != (const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b) +{ + return !(a == b); +} + +//! @} + +////////////////////////////// Vec out-of-class operators //////////////////////////////// + +//! @relates cv::Vec +//! @{ + +template static inline +Vec<_Tp1, cn>& operator += (Vec<_Tp1, cn>& a, const Vec<_Tp2, cn>& b) +{ + for( int i = 0; i < cn; i++ ) + a.val[i] = saturate_cast<_Tp1>(a.val[i] + b.val[i]); + return a; +} + +template static inline +Vec<_Tp1, cn>& operator -= (Vec<_Tp1, cn>& a, const Vec<_Tp2, cn>& b) +{ + for( int i = 0; i < cn; i++ ) + a.val[i] = saturate_cast<_Tp1>(a.val[i] - b.val[i]); + return a; +} + +template static inline +Vec<_Tp, cn> operator + (const Vec<_Tp, cn>& a, const Vec<_Tp, cn>& b) +{ + return Vec<_Tp, cn>(a, b, Matx_AddOp()); +} + +template static inline +Vec<_Tp, cn> operator - (const Vec<_Tp, cn>& a, const Vec<_Tp, cn>& b) +{ + return Vec<_Tp, cn>(a, b, Matx_SubOp()); +} + +template static inline +Vec<_Tp, cn>& operator *= (Vec<_Tp, cn>& a, int alpha) +{ + for( int i = 0; i < cn; i++ ) + a[i] = saturate_cast<_Tp>(a[i]*alpha); + return a; +} + +template static inline +Vec<_Tp, cn>& operator *= (Vec<_Tp, cn>& a, float alpha) +{ + for( int i = 0; i < cn; i++ ) + a[i] = saturate_cast<_Tp>(a[i]*alpha); + return a; +} + +template static inline +Vec<_Tp, cn>& operator *= (Vec<_Tp, cn>& a, double alpha) +{ + for( int i = 0; i < cn; i++ ) + a[i] = saturate_cast<_Tp>(a[i]*alpha); + return a; +} + +template static inline +Vec<_Tp, cn>& operator /= (Vec<_Tp, cn>& a, int alpha) +{ + double ialpha = 1./alpha; + for( int i = 0; i < cn; i++ ) + a[i] = saturate_cast<_Tp>(a[i]*ialpha); + return a; +} + +template static inline +Vec<_Tp, cn>& operator /= (Vec<_Tp, cn>& a, float alpha) +{ + float ialpha = 1.f/alpha; + for( int i = 0; i < cn; i++ ) + a[i] = saturate_cast<_Tp>(a[i]*ialpha); + return a; +} + +template static inline +Vec<_Tp, cn>& operator /= (Vec<_Tp, cn>& a, double alpha) +{ + double ialpha = 1./alpha; + for( int i = 0; i < cn; i++ ) + a[i] = saturate_cast<_Tp>(a[i]*ialpha); + return a; +} + +template static inline +Vec<_Tp, cn> operator * (const Vec<_Tp, cn>& a, int alpha) +{ + return Vec<_Tp, cn>(a, alpha, Matx_ScaleOp()); +} + +template static inline +Vec<_Tp, cn> operator * (int alpha, const Vec<_Tp, cn>& a) +{ + return Vec<_Tp, cn>(a, alpha, Matx_ScaleOp()); +} + +template static inline +Vec<_Tp, cn> operator * (const Vec<_Tp, cn>& a, float alpha) +{ + return Vec<_Tp, cn>(a, alpha, Matx_ScaleOp()); +} + +template static inline +Vec<_Tp, cn> operator * (float alpha, const Vec<_Tp, cn>& a) +{ + return Vec<_Tp, cn>(a, alpha, Matx_ScaleOp()); +} + +template static inline +Vec<_Tp, cn> operator * (const Vec<_Tp, cn>& a, double alpha) +{ + return Vec<_Tp, cn>(a, alpha, Matx_ScaleOp()); +} + +template static inline +Vec<_Tp, cn> operator * (double alpha, const Vec<_Tp, cn>& a) +{ + return Vec<_Tp, cn>(a, alpha, Matx_ScaleOp()); +} + +template static inline +Vec<_Tp, cn> operator / (const Vec<_Tp, cn>& a, int alpha) +{ + return Vec<_Tp, cn>(a, 1./alpha, Matx_ScaleOp()); +} + +template static inline +Vec<_Tp, cn> operator / (const Vec<_Tp, cn>& a, float alpha) +{ + return Vec<_Tp, cn>(a, 1.f/alpha, Matx_ScaleOp()); +} + +template static inline +Vec<_Tp, cn> operator / (const Vec<_Tp, cn>& a, double alpha) +{ + return Vec<_Tp, cn>(a, 1./alpha, Matx_ScaleOp()); +} + +template static inline +Vec<_Tp, cn> operator - (const Vec<_Tp, cn>& a) +{ + Vec<_Tp,cn> t; + for( int i = 0; i < cn; i++ ) t.val[i] = saturate_cast<_Tp>(-a.val[i]); + return t; +} + +template inline Vec<_Tp, 4> operator * (const Vec<_Tp, 4>& v1, const Vec<_Tp, 4>& v2) +{ + return Vec<_Tp, 4>(saturate_cast<_Tp>(v1[0]*v2[0] - v1[1]*v2[1] - v1[2]*v2[2] - v1[3]*v2[3]), + saturate_cast<_Tp>(v1[0]*v2[1] + v1[1]*v2[0] + v1[2]*v2[3] - v1[3]*v2[2]), + saturate_cast<_Tp>(v1[0]*v2[2] - v1[1]*v2[3] + v1[2]*v2[0] + v1[3]*v2[1]), + saturate_cast<_Tp>(v1[0]*v2[3] + v1[1]*v2[2] - v1[2]*v2[1] + v1[3]*v2[0])); +} + +template inline Vec<_Tp, 4>& operator *= (Vec<_Tp, 4>& v1, const Vec<_Tp, 4>& v2) +{ + v1 = v1 * v2; + return v1; +} + +//! @} + +} // cv + +#endif // __OPENCV_CORE_MATX_HPP__ diff --git a/lib/opencv/include/opencv2/core/neon_utils.hpp b/lib/opencv/include/opencv2/core/neon_utils.hpp new file mode 100644 index 000000000..adb750fd4 --- /dev/null +++ b/lib/opencv/include/opencv2/core/neon_utils.hpp @@ -0,0 +1,128 @@ +/*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) 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_HAL_NEON_UTILS_HPP__ +#define __OPENCV_HAL_NEON_UTILS_HPP__ + +#include "opencv2/core/cvdef.h" + +//! @addtogroup core_utils_neon +//! @{ + +#if CV_NEON + +inline int32x2_t cv_vrnd_s32_f32(float32x2_t v) +{ + static int32x2_t v_sign = vdup_n_s32(1 << 31), + v_05 = vreinterpret_s32_f32(vdup_n_f32(0.5f)); + + int32x2_t v_addition = vorr_s32(v_05, vand_s32(v_sign, vreinterpret_s32_f32(v))); + return vcvt_s32_f32(vadd_f32(v, vreinterpret_f32_s32(v_addition))); +} + +inline int32x4_t cv_vrndq_s32_f32(float32x4_t v) +{ + static int32x4_t v_sign = vdupq_n_s32(1 << 31), + v_05 = vreinterpretq_s32_f32(vdupq_n_f32(0.5f)); + + int32x4_t v_addition = vorrq_s32(v_05, vandq_s32(v_sign, vreinterpretq_s32_f32(v))); + return vcvtq_s32_f32(vaddq_f32(v, vreinterpretq_f32_s32(v_addition))); +} + +inline uint32x2_t cv_vrnd_u32_f32(float32x2_t v) +{ + static float32x2_t v_05 = vdup_n_f32(0.5f); + return vcvt_u32_f32(vadd_f32(v, v_05)); +} + +inline uint32x4_t cv_vrndq_u32_f32(float32x4_t v) +{ + static float32x4_t v_05 = vdupq_n_f32(0.5f); + return vcvtq_u32_f32(vaddq_f32(v, v_05)); +} + +inline float32x4_t cv_vrecpq_f32(float32x4_t val) +{ + float32x4_t reciprocal = vrecpeq_f32(val); + reciprocal = vmulq_f32(vrecpsq_f32(val, reciprocal), reciprocal); + reciprocal = vmulq_f32(vrecpsq_f32(val, reciprocal), reciprocal); + return reciprocal; +} + +inline float32x2_t cv_vrecp_f32(float32x2_t val) +{ + float32x2_t reciprocal = vrecpe_f32(val); + reciprocal = vmul_f32(vrecps_f32(val, reciprocal), reciprocal); + reciprocal = vmul_f32(vrecps_f32(val, reciprocal), reciprocal); + return reciprocal; +} + +inline float32x4_t cv_vrsqrtq_f32(float32x4_t val) +{ + float32x4_t e = vrsqrteq_f32(val); + e = vmulq_f32(vrsqrtsq_f32(vmulq_f32(e, e), val), e); + e = vmulq_f32(vrsqrtsq_f32(vmulq_f32(e, e), val), e); + return e; +} + +inline float32x2_t cv_vrsqrt_f32(float32x2_t val) +{ + float32x2_t e = vrsqrte_f32(val); + e = vmul_f32(vrsqrts_f32(vmul_f32(e, e), val), e); + e = vmul_f32(vrsqrts_f32(vmul_f32(e, e), val), e); + return e; +} + +inline float32x4_t cv_vsqrtq_f32(float32x4_t val) +{ + return cv_vrecpq_f32(cv_vrsqrtq_f32(val)); +} + +inline float32x2_t cv_vsqrt_f32(float32x2_t val) +{ + return cv_vrecp_f32(cv_vrsqrt_f32(val)); +} + +#endif + +//! @} + +#endif // __OPENCV_HAL_NEON_UTILS_HPP__ diff --git a/lib/opencv/include/opencv2/core/ocl.hpp b/lib/opencv/include/opencv2/core/ocl.hpp new file mode 100644 index 000000000..bc989a328 --- /dev/null +++ b/lib/opencv/include/opencv2/core/ocl.hpp @@ -0,0 +1,743 @@ +/*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) 2013, OpenCV Foundation, 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 OpenCV Foundation 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_OPENCL_HPP__ +#define __OPENCV_OPENCL_HPP__ + +#include "opencv2/core.hpp" + +namespace cv { namespace ocl { + +//! @addtogroup core_opencl +//! @{ + +CV_EXPORTS_W bool haveOpenCL(); +CV_EXPORTS_W bool useOpenCL(); +CV_EXPORTS_W bool haveAmdBlas(); +CV_EXPORTS_W bool haveAmdFft(); +CV_EXPORTS_W void setUseOpenCL(bool flag); +CV_EXPORTS_W void finish(); + +CV_EXPORTS bool haveSVM(); + +class CV_EXPORTS Context; +class CV_EXPORTS Device; +class CV_EXPORTS Kernel; +class CV_EXPORTS Program; +class CV_EXPORTS ProgramSource; +class CV_EXPORTS Queue; +class CV_EXPORTS PlatformInfo; +class CV_EXPORTS Image2D; + +class CV_EXPORTS Device +{ +public: + Device(); + explicit Device(void* d); + Device(const Device& d); + Device& operator = (const Device& d); + ~Device(); + + void set(void* d); + + enum + { + TYPE_DEFAULT = (1 << 0), + TYPE_CPU = (1 << 1), + TYPE_GPU = (1 << 2), + TYPE_ACCELERATOR = (1 << 3), + TYPE_DGPU = TYPE_GPU + (1 << 16), + TYPE_IGPU = TYPE_GPU + (1 << 17), + TYPE_ALL = 0xFFFFFFFF + }; + + String name() const; + String extensions() const; + String version() const; + String vendorName() const; + String OpenCL_C_Version() const; + String OpenCLVersion() const; + int deviceVersionMajor() const; + int deviceVersionMinor() const; + String driverVersion() const; + void* ptr() const; + + int type() const; + + int addressBits() const; + bool available() const; + bool compilerAvailable() const; + bool linkerAvailable() const; + + enum + { + FP_DENORM=(1 << 0), + FP_INF_NAN=(1 << 1), + FP_ROUND_TO_NEAREST=(1 << 2), + FP_ROUND_TO_ZERO=(1 << 3), + FP_ROUND_TO_INF=(1 << 4), + FP_FMA=(1 << 5), + FP_SOFT_FLOAT=(1 << 6), + FP_CORRECTLY_ROUNDED_DIVIDE_SQRT=(1 << 7) + }; + int doubleFPConfig() const; + int singleFPConfig() const; + int halfFPConfig() const; + + bool endianLittle() const; + bool errorCorrectionSupport() const; + + enum + { + EXEC_KERNEL=(1 << 0), + EXEC_NATIVE_KERNEL=(1 << 1) + }; + int executionCapabilities() const; + + size_t globalMemCacheSize() const; + + enum + { + NO_CACHE=0, + READ_ONLY_CACHE=1, + READ_WRITE_CACHE=2 + }; + int globalMemCacheType() const; + int globalMemCacheLineSize() const; + size_t globalMemSize() const; + + size_t localMemSize() const; + enum + { + NO_LOCAL_MEM=0, + LOCAL_IS_LOCAL=1, + LOCAL_IS_GLOBAL=2 + }; + int localMemType() const; + bool hostUnifiedMemory() const; + + bool imageSupport() const; + + bool imageFromBufferSupport() const; + uint imagePitchAlignment() const; + uint imageBaseAddressAlignment() const; + + size_t image2DMaxWidth() const; + size_t image2DMaxHeight() const; + + size_t image3DMaxWidth() const; + size_t image3DMaxHeight() const; + size_t image3DMaxDepth() const; + + size_t imageMaxBufferSize() const; + size_t imageMaxArraySize() const; + + enum + { + UNKNOWN_VENDOR=0, + VENDOR_AMD=1, + VENDOR_INTEL=2, + VENDOR_NVIDIA=3 + }; + int vendorID() const; + // FIXIT + // dev.isAMD() doesn't work for OpenCL CPU devices from AMD OpenCL platform. + // This method should use platform name instead of vendor name. + // After fix restore code in arithm.cpp: ocl_compare() + inline bool isAMD() const { return vendorID() == VENDOR_AMD; } + inline bool isIntel() const { return vendorID() == VENDOR_INTEL; } + inline bool isNVidia() const { return vendorID() == VENDOR_NVIDIA; } + + int maxClockFrequency() const; + int maxComputeUnits() const; + int maxConstantArgs() const; + size_t maxConstantBufferSize() const; + + size_t maxMemAllocSize() const; + size_t maxParameterSize() const; + + int maxReadImageArgs() const; + int maxWriteImageArgs() const; + int maxSamplers() const; + + size_t maxWorkGroupSize() const; + int maxWorkItemDims() const; + void maxWorkItemSizes(size_t*) const; + + int memBaseAddrAlign() const; + + int nativeVectorWidthChar() const; + int nativeVectorWidthShort() const; + int nativeVectorWidthInt() const; + int nativeVectorWidthLong() const; + int nativeVectorWidthFloat() const; + int nativeVectorWidthDouble() const; + int nativeVectorWidthHalf() const; + + int preferredVectorWidthChar() const; + int preferredVectorWidthShort() const; + int preferredVectorWidthInt() const; + int preferredVectorWidthLong() const; + int preferredVectorWidthFloat() const; + int preferredVectorWidthDouble() const; + int preferredVectorWidthHalf() const; + + size_t printfBufferSize() const; + size_t profilingTimerResolution() const; + + static const Device& getDefault(); + +protected: + struct Impl; + Impl* p; +}; + + +class CV_EXPORTS Context +{ +public: + Context(); + explicit Context(int dtype); + ~Context(); + Context(const Context& c); + Context& operator = (const Context& c); + + bool create(); + bool create(int dtype); + size_t ndevices() const; + const Device& device(size_t idx) const; + Program getProg(const ProgramSource& prog, + const String& buildopt, String& errmsg); + + static Context& getDefault(bool initialize = true); + void* ptr() const; + + friend void initializeContextFromHandle(Context& ctx, void* platform, void* context, void* device); + + bool useSVM() const; + void setUseSVM(bool enabled); + + struct Impl; + Impl* p; +}; + +class CV_EXPORTS Platform +{ +public: + Platform(); + ~Platform(); + Platform(const Platform& p); + Platform& operator = (const Platform& p); + + void* ptr() const; + static Platform& getDefault(); + + friend void initializeContextFromHandle(Context& ctx, void* platform, void* context, void* device); +protected: + struct Impl; + Impl* p; +}; + +/* +//! @brief Attaches OpenCL context to OpenCV +// +//! @note Note: +// OpenCV will check if available OpenCL platform has platformName name, +// then assign context to OpenCV and call clRetainContext function. +// The deviceID device will be used as target device and new command queue +// will be created. +// +// Params: +//! @param platformName - name of OpenCL platform to attach, +//! this string is used to check if platform is available +//! to OpenCV at runtime +//! @param platfromID - ID of platform attached context was created for +//! @param context - OpenCL context to be attached to OpenCV +//! @param deviceID - ID of device, must be created from attached context +*/ +CV_EXPORTS void attachContext(const String& platformName, void* platformID, void* context, void* deviceID); + +/* +//! @brief Convert OpenCL buffer to UMat +// +//! @note Note: +// OpenCL buffer (cl_mem_buffer) should contain 2D image data, compatible with OpenCV. +// Memory content is not copied from clBuffer to UMat. Instead, buffer handle assigned +// to UMat and clRetainMemObject is called. +// +// Params: +//! @param cl_mem_buffer - source clBuffer handle +//! @param step - num of bytes in single row +//! @param rows - number of rows +//! @param cols - number of cols +//! @param type - OpenCV type of image +//! @param dst - destination UMat +*/ +CV_EXPORTS void convertFromBuffer(void* cl_mem_buffer, size_t step, int rows, int cols, int type, UMat& dst); + +/* +//! @brief Convert OpenCL image2d_t to UMat +// +//! @note Note: +// OpenCL image2d_t (cl_mem_image), should be compatible with OpenCV +// UMat formats. +// Memory content is copied from image to UMat with +// clEnqueueCopyImageToBuffer function. +// +// Params: +//! @param cl_mem_image - source image2d_t handle +//! @param dst - destination UMat +*/ +CV_EXPORTS void convertFromImage(void* cl_mem_image, UMat& dst); + +// TODO Move to internal header +void initializeContextFromHandle(Context& ctx, void* platform, void* context, void* device); + +class CV_EXPORTS Queue +{ +public: + Queue(); + explicit Queue(const Context& c, const Device& d=Device()); + ~Queue(); + Queue(const Queue& q); + Queue& operator = (const Queue& q); + + bool create(const Context& c=Context(), const Device& d=Device()); + void finish(); + void* ptr() const; + static Queue& getDefault(); + +protected: + struct Impl; + Impl* p; +}; + + +class CV_EXPORTS KernelArg +{ +public: + enum { LOCAL=1, READ_ONLY=2, WRITE_ONLY=4, READ_WRITE=6, CONSTANT=8, PTR_ONLY = 16, NO_SIZE=256 }; + KernelArg(int _flags, UMat* _m, int wscale=1, int iwscale=1, const void* _obj=0, size_t _sz=0); + KernelArg(); + + static KernelArg Local() { return KernelArg(LOCAL, 0); } + static KernelArg PtrWriteOnly(const UMat& m) + { return KernelArg(PTR_ONLY+WRITE_ONLY, (UMat*)&m); } + static KernelArg PtrReadOnly(const UMat& m) + { return KernelArg(PTR_ONLY+READ_ONLY, (UMat*)&m); } + static KernelArg PtrReadWrite(const UMat& m) + { return KernelArg(PTR_ONLY+READ_WRITE, (UMat*)&m); } + static KernelArg ReadWrite(const UMat& m, int wscale=1, int iwscale=1) + { return KernelArg(READ_WRITE, (UMat*)&m, wscale, iwscale); } + static KernelArg ReadWriteNoSize(const UMat& m, int wscale=1, int iwscale=1) + { return KernelArg(READ_WRITE+NO_SIZE, (UMat*)&m, wscale, iwscale); } + static KernelArg ReadOnly(const UMat& m, int wscale=1, int iwscale=1) + { return KernelArg(READ_ONLY, (UMat*)&m, wscale, iwscale); } + static KernelArg WriteOnly(const UMat& m, int wscale=1, int iwscale=1) + { return KernelArg(WRITE_ONLY, (UMat*)&m, wscale, iwscale); } + static KernelArg ReadOnlyNoSize(const UMat& m, int wscale=1, int iwscale=1) + { return KernelArg(READ_ONLY+NO_SIZE, (UMat*)&m, wscale, iwscale); } + static KernelArg WriteOnlyNoSize(const UMat& m, int wscale=1, int iwscale=1) + { return KernelArg(WRITE_ONLY+NO_SIZE, (UMat*)&m, wscale, iwscale); } + static KernelArg Constant(const Mat& m); + template static KernelArg Constant(const _Tp* arr, size_t n) + { return KernelArg(CONSTANT, 0, 1, 1, (void*)arr, n); } + + int flags; + UMat* m; + const void* obj; + size_t sz; + int wscale, iwscale; +}; + + +class CV_EXPORTS Kernel +{ +public: + Kernel(); + Kernel(const char* kname, const Program& prog); + Kernel(const char* kname, const ProgramSource& prog, + const String& buildopts = String(), String* errmsg=0); + ~Kernel(); + Kernel(const Kernel& k); + Kernel& operator = (const Kernel& k); + + bool empty() const; + bool create(const char* kname, const Program& prog); + bool create(const char* kname, const ProgramSource& prog, + const String& buildopts, String* errmsg=0); + + int set(int i, const void* value, size_t sz); + int set(int i, const Image2D& image2D); + int set(int i, const UMat& m); + int set(int i, const KernelArg& arg); + template int set(int i, const _Tp& value) + { return set(i, &value, sizeof(value)); } + + template + Kernel& args(const _Tp0& a0) + { + set(0, a0); return *this; + } + + template + Kernel& args(const _Tp0& a0, const _Tp1& a1) + { + int i = set(0, a0); set(i, a1); return *this; + } + + template + Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2) + { + int i = set(0, a0); i = set(i, a1); set(i, a2); return *this; + } + + template + Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3) + { + int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3); return *this; + } + + template + Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, + const _Tp3& a3, const _Tp4& a4) + { + int i = set(0, a0); i = set(i, a1); i = set(i, a2); + i = set(i, a3); set(i, a4); return *this; + } + + template + Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, + const _Tp3& a3, const _Tp4& a4, const _Tp5& a5) + { + int i = set(0, a0); i = set(i, a1); i = set(i, a2); + i = set(i, a3); i = set(i, a4); set(i, a5); return *this; + } + + template + Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3, + const _Tp4& a4, const _Tp5& a5, const _Tp6& a6) + { + int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3); + i = set(i, a4); i = set(i, a5); set(i, a6); return *this; + } + + template + Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3, + const _Tp4& a4, const _Tp5& a5, const _Tp6& a6, const _Tp7& a7) + { + int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3); + i = set(i, a4); i = set(i, a5); i = set(i, a6); set(i, a7); return *this; + } + + template + Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3, + const _Tp4& a4, const _Tp5& a5, const _Tp6& a6, const _Tp7& a7, + const _Tp8& a8) + { + int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3); i = set(i, a4); + i = set(i, a5); i = set(i, a6); i = set(i, a7); set(i, a8); return *this; + } + + template + Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3, + const _Tp4& a4, const _Tp5& a5, const _Tp6& a6, const _Tp7& a7, + const _Tp8& a8, const _Tp9& a9) + { + int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3); i = set(i, a4); i = set(i, a5); + i = set(i, a6); i = set(i, a7); i = set(i, a8); set(i, a9); return *this; + } + + template + Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3, + const _Tp4& a4, const _Tp5& a5, const _Tp6& a6, const _Tp7& a7, + const _Tp8& a8, const _Tp9& a9, const _Tp10& a10) + { + int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3); i = set(i, a4); i = set(i, a5); + i = set(i, a6); i = set(i, a7); i = set(i, a8); i = set(i, a9); set(i, a10); return *this; + } + + template + Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3, + const _Tp4& a4, const _Tp5& a5, const _Tp6& a6, const _Tp7& a7, + const _Tp8& a8, const _Tp9& a9, const _Tp10& a10, const _Tp11& a11) + { + int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3); i = set(i, a4); i = set(i, a5); + i = set(i, a6); i = set(i, a7); i = set(i, a8); i = set(i, a9); i = set(i, a10); set(i, a11); return *this; + } + + template + Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3, + const _Tp4& a4, const _Tp5& a5, const _Tp6& a6, const _Tp7& a7, + const _Tp8& a8, const _Tp9& a9, const _Tp10& a10, const _Tp11& a11, + const _Tp12& a12) + { + int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3); i = set(i, a4); i = set(i, a5); + i = set(i, a6); i = set(i, a7); i = set(i, a8); i = set(i, a9); i = set(i, a10); i = set(i, a11); + set(i, a12); return *this; + } + + template + Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3, + const _Tp4& a4, const _Tp5& a5, const _Tp6& a6, const _Tp7& a7, + const _Tp8& a8, const _Tp9& a9, const _Tp10& a10, const _Tp11& a11, + const _Tp12& a12, const _Tp13& a13) + { + int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3); i = set(i, a4); i = set(i, a5); + i = set(i, a6); i = set(i, a7); i = set(i, a8); i = set(i, a9); i = set(i, a10); i = set(i, a11); + i = set(i, a12); set(i, a13); return *this; + } + + template + Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3, + const _Tp4& a4, const _Tp5& a5, const _Tp6& a6, const _Tp7& a7, + const _Tp8& a8, const _Tp9& a9, const _Tp10& a10, const _Tp11& a11, + const _Tp12& a12, const _Tp13& a13, const _Tp14& a14) + { + int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3); i = set(i, a4); i = set(i, a5); + i = set(i, a6); i = set(i, a7); i = set(i, a8); i = set(i, a9); i = set(i, a10); i = set(i, a11); + i = set(i, a12); i = set(i, a13); set(i, a14); return *this; + } + + template + Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3, + const _Tp4& a4, const _Tp5& a5, const _Tp6& a6, const _Tp7& a7, + const _Tp8& a8, const _Tp9& a9, const _Tp10& a10, const _Tp11& a11, + const _Tp12& a12, const _Tp13& a13, const _Tp14& a14, const _Tp15& a15) + { + int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3); i = set(i, a4); i = set(i, a5); + i = set(i, a6); i = set(i, a7); i = set(i, a8); i = set(i, a9); i = set(i, a10); i = set(i, a11); + i = set(i, a12); i = set(i, a13); i = set(i, a14); set(i, a15); return *this; + } + + bool run(int dims, size_t globalsize[], + size_t localsize[], bool sync, const Queue& q=Queue()); + bool runTask(bool sync, const Queue& q=Queue()); + + size_t workGroupSize() const; + size_t preferedWorkGroupSizeMultiple() const; + bool compileWorkGroupSize(size_t wsz[]) const; + size_t localMemSize() const; + + void* ptr() const; + struct Impl; + +protected: + Impl* p; +}; + +class CV_EXPORTS Program +{ +public: + Program(); + Program(const ProgramSource& src, + const String& buildflags, String& errmsg); + explicit Program(const String& buf); + Program(const Program& prog); + + Program& operator = (const Program& prog); + ~Program(); + + bool create(const ProgramSource& src, + const String& buildflags, String& errmsg); + bool read(const String& buf, const String& buildflags); + bool write(String& buf) const; + + const ProgramSource& source() const; + void* ptr() const; + + String getPrefix() const; + static String getPrefix(const String& buildflags); + +protected: + struct Impl; + Impl* p; +}; + + +class CV_EXPORTS ProgramSource +{ +public: + typedef uint64 hash_t; + + ProgramSource(); + explicit ProgramSource(const String& prog); + explicit ProgramSource(const char* prog); + ~ProgramSource(); + ProgramSource(const ProgramSource& prog); + ProgramSource& operator = (const ProgramSource& prog); + + const String& source() const; + hash_t hash() const; + +protected: + struct Impl; + Impl* p; +}; + +class CV_EXPORTS PlatformInfo +{ +public: + PlatformInfo(); + explicit PlatformInfo(void* id); + ~PlatformInfo(); + + PlatformInfo(const PlatformInfo& i); + PlatformInfo& operator =(const PlatformInfo& i); + + String name() const; + String vendor() const; + String version() const; + int deviceNumber() const; + void getDevice(Device& device, int d) const; + +protected: + struct Impl; + Impl* p; +}; + +CV_EXPORTS const char* convertTypeStr(int sdepth, int ddepth, int cn, char* buf); +CV_EXPORTS const char* typeToStr(int t); +CV_EXPORTS const char* memopTypeToStr(int t); +CV_EXPORTS const char* vecopTypeToStr(int t); +CV_EXPORTS String kernelToStr(InputArray _kernel, int ddepth = -1, const char * name = NULL); +CV_EXPORTS void getPlatfomsInfo(std::vector& platform_info); + + +enum OclVectorStrategy +{ + // all matrices have its own vector width + OCL_VECTOR_OWN = 0, + // all matrices have maximal vector width among all matrices + // (useful for cases when matrices have different data types) + OCL_VECTOR_MAX = 1, + + // default strategy + OCL_VECTOR_DEFAULT = OCL_VECTOR_OWN +}; + +CV_EXPORTS int predictOptimalVectorWidth(InputArray src1, InputArray src2 = noArray(), InputArray src3 = noArray(), + InputArray src4 = noArray(), InputArray src5 = noArray(), InputArray src6 = noArray(), + InputArray src7 = noArray(), InputArray src8 = noArray(), InputArray src9 = noArray(), + OclVectorStrategy strat = OCL_VECTOR_DEFAULT); + +CV_EXPORTS int checkOptimalVectorWidth(const int *vectorWidths, + InputArray src1, InputArray src2 = noArray(), InputArray src3 = noArray(), + InputArray src4 = noArray(), InputArray src5 = noArray(), InputArray src6 = noArray(), + InputArray src7 = noArray(), InputArray src8 = noArray(), InputArray src9 = noArray(), + OclVectorStrategy strat = OCL_VECTOR_DEFAULT); + +// with OCL_VECTOR_MAX strategy +CV_EXPORTS int predictOptimalVectorWidthMax(InputArray src1, InputArray src2 = noArray(), InputArray src3 = noArray(), + InputArray src4 = noArray(), InputArray src5 = noArray(), InputArray src6 = noArray(), + InputArray src7 = noArray(), InputArray src8 = noArray(), InputArray src9 = noArray()); + +CV_EXPORTS void buildOptionsAddMatrixDescription(String& buildOptions, const String& name, InputArray _m); + +class CV_EXPORTS Image2D +{ +public: + Image2D(); + + // src: The UMat from which to get image properties and data + // norm: Flag to enable the use of normalized channel data types + // alias: Flag indicating that the image should alias the src UMat. + // If true, changes to the image or src will be reflected in + // both objects. + explicit Image2D(const UMat &src, bool norm = false, bool alias = false); + Image2D(const Image2D & i); + ~Image2D(); + + Image2D & operator = (const Image2D & i); + + // Indicates if creating an aliased image should succeed. Depends on the + // underlying platform and the dimensions of the UMat. + static bool canCreateAlias(const UMat &u); + + // Indicates if the image format is supported. + static bool isFormatSupported(int depth, int cn, bool norm); + + void* ptr() const; +protected: + struct Impl; + Impl* p; +}; + + +CV_EXPORTS MatAllocator* getOpenCLAllocator(); + + +#ifdef __OPENCV_BUILD +namespace internal { + +CV_EXPORTS bool isPerformanceCheckBypassed(); +#define OCL_PERFORMANCE_CHECK(condition) (cv::ocl::internal::isPerformanceCheckBypassed() || (condition)) + +CV_EXPORTS bool isCLBuffer(UMat& u); + +} // namespace internal +#endif + +//! @} + +}} + +#endif diff --git a/lib/opencv/include/opencv2/core/ocl_genbase.hpp b/lib/opencv/include/opencv2/core/ocl_genbase.hpp new file mode 100644 index 000000000..d53bc1abb --- /dev/null +++ b/lib/opencv/include/opencv2/core/ocl_genbase.hpp @@ -0,0 +1,64 @@ +/*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) 2013, OpenCV Foundation, 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 OpenCV Foundation 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_OPENCL_GENBASE_HPP__ +#define __OPENCV_OPENCL_GENBASE_HPP__ + +namespace cv +{ +namespace ocl +{ + +//! @cond IGNORED + +struct ProgramEntry +{ + const char* name; + const char* programStr; + const char* programHash; +}; + +//! @endcond + +} +} + +#endif diff --git a/lib/opencv/include/opencv2/core/opengl.hpp b/lib/opencv/include/opencv2/core/opengl.hpp new file mode 100644 index 000000000..fd47c520e --- /dev/null +++ b/lib/opencv/include/opencv2/core/opengl.hpp @@ -0,0 +1,729 @@ +/*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_CORE_OPENGL_HPP__ +#define __OPENCV_CORE_OPENGL_HPP__ + +#ifndef __cplusplus +# error opengl.hpp header must be compiled as C++ +#endif + +#include "opencv2/core.hpp" +#include "ocl.hpp" + +namespace cv { namespace ogl { + +/** @addtogroup core_opengl +This section describes OpenGL interoperability. + +To enable OpenGL support, configure OpenCV using CMake with WITH_OPENGL=ON . Currently OpenGL is +supported only with WIN32, GTK and Qt backends on Windows and Linux (MacOS and Android are not +supported). For GTK backend gtkglext-1.0 library is required. + +To use OpenGL functionality you should first create OpenGL context (window or frame buffer). You can +do this with namedWindow function or with other OpenGL toolkit (GLUT, for example). +*/ +//! @{ + +/////////////////// OpenGL Objects /////////////////// + +/** @brief Smart pointer for OpenGL buffer object with reference counting. + +Buffer Objects are OpenGL objects that store an array of unformatted memory allocated by the OpenGL +context. These can be used to store vertex data, pixel data retrieved from images or the +framebuffer, and a variety of other things. + +ogl::Buffer has interface similar with Mat interface and represents 2D array memory. + +ogl::Buffer supports memory transfers between host and device and also can be mapped to CUDA memory. + */ +class CV_EXPORTS Buffer +{ +public: + /** @brief The target defines how you intend to use the buffer object. + */ + enum Target + { + ARRAY_BUFFER = 0x8892, //!< The buffer will be used as a source for vertex data + ELEMENT_ARRAY_BUFFER = 0x8893, //!< The buffer will be used for indices (in glDrawElements, for example) + PIXEL_PACK_BUFFER = 0x88EB, //!< The buffer will be used for reading from OpenGL textures + PIXEL_UNPACK_BUFFER = 0x88EC //!< The buffer will be used for writing to OpenGL textures + }; + + enum Access + { + READ_ONLY = 0x88B8, + WRITE_ONLY = 0x88B9, + READ_WRITE = 0x88BA + }; + + /** @brief The constructors. + + Creates empty ogl::Buffer object, creates ogl::Buffer object from existed buffer ( abufId + parameter), allocates memory for ogl::Buffer object or copies from host/device memory. + */ + Buffer(); + + /** @overload + @param arows Number of rows in a 2D array. + @param acols Number of columns in a 2D array. + @param atype Array type ( CV_8UC1, ..., CV_64FC4 ). See Mat for details. + @param abufId Buffer object name. + @param autoRelease Auto release mode (if true, release will be called in object's destructor). + */ + Buffer(int arows, int acols, int atype, unsigned int abufId, bool autoRelease = false); + + /** @overload + @param asize 2D array size. + @param atype Array type ( CV_8UC1, ..., CV_64FC4 ). See Mat for details. + @param abufId Buffer object name. + @param autoRelease Auto release mode (if true, release will be called in object's destructor). + */ + Buffer(Size asize, int atype, unsigned int abufId, bool autoRelease = false); + + /** @overload + @param arows Number of rows in a 2D array. + @param acols Number of columns in a 2D array. + @param atype Array type ( CV_8UC1, ..., CV_64FC4 ). See Mat for details. + @param target Buffer usage. See cv::ogl::Buffer::Target . + @param autoRelease Auto release mode (if true, release will be called in object's destructor). + */ + Buffer(int arows, int acols, int atype, Target target = ARRAY_BUFFER, bool autoRelease = false); + + /** @overload + @param asize 2D array size. + @param atype Array type ( CV_8UC1, ..., CV_64FC4 ). See Mat for details. + @param target Buffer usage. See cv::ogl::Buffer::Target . + @param autoRelease Auto release mode (if true, release will be called in object's destructor). + */ + Buffer(Size asize, int atype, Target target = ARRAY_BUFFER, bool autoRelease = false); + + /** @overload + @param arr Input array (host or device memory, it can be Mat , cuda::GpuMat or std::vector ). + @param target Buffer usage. See cv::ogl::Buffer::Target . + @param autoRelease Auto release mode (if true, release will be called in object's destructor). + */ + explicit Buffer(InputArray arr, Target target = ARRAY_BUFFER, bool autoRelease = false); + + /** @brief Allocates memory for ogl::Buffer object. + + @param arows Number of rows in a 2D array. + @param acols Number of columns in a 2D array. + @param atype Array type ( CV_8UC1, ..., CV_64FC4 ). See Mat for details. + @param target Buffer usage. See cv::ogl::Buffer::Target . + @param autoRelease Auto release mode (if true, release will be called in object's destructor). + */ + void create(int arows, int acols, int atype, Target target = ARRAY_BUFFER, bool autoRelease = false); + + /** @overload + @param asize 2D array size. + @param atype Array type ( CV_8UC1, ..., CV_64FC4 ). See Mat for details. + @param target Buffer usage. See cv::ogl::Buffer::Target . + @param autoRelease Auto release mode (if true, release will be called in object's destructor). + */ + void create(Size asize, int atype, Target target = ARRAY_BUFFER, bool autoRelease = false); + + /** @brief Decrements the reference counter and destroys the buffer object if needed. + + The function will call setAutoRelease(true) . + */ + void release(); + + /** @brief Sets auto release mode. + + The lifetime of the OpenGL object is tied to the lifetime of the context. If OpenGL context was + bound to a window it could be released at any time (user can close a window). If object's destructor + is called after destruction of the context it will cause an error. Thus ogl::Buffer doesn't destroy + OpenGL object in destructor by default (all OpenGL resources will be released with OpenGL context). + This function can force ogl::Buffer destructor to destroy OpenGL object. + @param flag Auto release mode (if true, release will be called in object's destructor). + */ + void setAutoRelease(bool flag); + + /** @brief Copies from host/device memory to OpenGL buffer. + @param arr Input array (host or device memory, it can be Mat , cuda::GpuMat or std::vector ). + @param target Buffer usage. See cv::ogl::Buffer::Target . + @param autoRelease Auto release mode (if true, release will be called in object's destructor). + */ + void copyFrom(InputArray arr, Target target = ARRAY_BUFFER, bool autoRelease = false); + + /** @overload */ + void copyFrom(InputArray arr, cuda::Stream& stream, Target target = ARRAY_BUFFER, bool autoRelease = false); + + /** @brief Copies from OpenGL buffer to host/device memory or another OpenGL buffer object. + + @param arr Destination array (host or device memory, can be Mat , cuda::GpuMat , std::vector or + ogl::Buffer ). + */ + void copyTo(OutputArray arr) const; + + /** @overload */ + void copyTo(OutputArray arr, cuda::Stream& stream) const; + + /** @brief Creates a full copy of the buffer object and the underlying data. + + @param target Buffer usage for destination buffer. + @param autoRelease Auto release mode for destination buffer. + */ + Buffer clone(Target target = ARRAY_BUFFER, bool autoRelease = false) const; + + /** @brief Binds OpenGL buffer to the specified buffer binding point. + + @param target Binding point. See cv::ogl::Buffer::Target . + */ + void bind(Target target) const; + + /** @brief Unbind any buffers from the specified binding point. + + @param target Binding point. See cv::ogl::Buffer::Target . + */ + static void unbind(Target target); + + /** @brief Maps OpenGL buffer to host memory. + + mapHost maps to the client's address space the entire data store of the buffer object. The data can + then be directly read and/or written relative to the returned pointer, depending on the specified + access policy. + + A mapped data store must be unmapped with ogl::Buffer::unmapHost before its buffer object is used. + + This operation can lead to memory transfers between host and device. + + Only one buffer object can be mapped at a time. + @param access Access policy, indicating whether it will be possible to read from, write to, or both + read from and write to the buffer object's mapped data store. The symbolic constant must be + ogl::Buffer::READ_ONLY , ogl::Buffer::WRITE_ONLY or ogl::Buffer::READ_WRITE . + */ + Mat mapHost(Access access); + + /** @brief Unmaps OpenGL buffer. + */ + void unmapHost(); + + //! map to device memory (blocking) + cuda::GpuMat mapDevice(); + void unmapDevice(); + + /** @brief Maps OpenGL buffer to CUDA device memory. + + This operatation doesn't copy data. Several buffer objects can be mapped to CUDA memory at a time. + + A mapped data store must be unmapped with ogl::Buffer::unmapDevice before its buffer object is used. + */ + cuda::GpuMat mapDevice(cuda::Stream& stream); + + /** @brief Unmaps OpenGL buffer. + */ + void unmapDevice(cuda::Stream& stream); + + int rows() const; + int cols() const; + Size size() const; + bool empty() const; + + int type() const; + int depth() const; + int channels() const; + int elemSize() const; + int elemSize1() const; + + //! get OpenGL opject id + unsigned int bufId() const; + + class Impl; + +private: + Ptr impl_; + int rows_; + int cols_; + int type_; +}; + +/** @brief Smart pointer for OpenGL 2D texture memory with reference counting. + */ +class CV_EXPORTS Texture2D +{ +public: + /** @brief An Image Format describes the way that the images in Textures store their data. + */ + enum Format + { + NONE = 0, + DEPTH_COMPONENT = 0x1902, //!< Depth + RGB = 0x1907, //!< Red, Green, Blue + RGBA = 0x1908 //!< Red, Green, Blue, Alpha + }; + + /** @brief The constructors. + + Creates empty ogl::Texture2D object, allocates memory for ogl::Texture2D object or copies from + host/device memory. + */ + Texture2D(); + + /** @overload */ + Texture2D(int arows, int acols, Format aformat, unsigned int atexId, bool autoRelease = false); + + /** @overload */ + Texture2D(Size asize, Format aformat, unsigned int atexId, bool autoRelease = false); + + /** @overload + @param arows Number of rows. + @param acols Number of columns. + @param aformat Image format. See cv::ogl::Texture2D::Format . + @param autoRelease Auto release mode (if true, release will be called in object's destructor). + */ + Texture2D(int arows, int acols, Format aformat, bool autoRelease = false); + + /** @overload + @param asize 2D array size. + @param aformat Image format. See cv::ogl::Texture2D::Format . + @param autoRelease Auto release mode (if true, release will be called in object's destructor). + */ + Texture2D(Size asize, Format aformat, bool autoRelease = false); + + /** @overload + @param arr Input array (host or device memory, it can be Mat , cuda::GpuMat or ogl::Buffer ). + @param autoRelease Auto release mode (if true, release will be called in object's destructor). + */ + explicit Texture2D(InputArray arr, bool autoRelease = false); + + /** @brief Allocates memory for ogl::Texture2D object. + + @param arows Number of rows. + @param acols Number of columns. + @param aformat Image format. See cv::ogl::Texture2D::Format . + @param autoRelease Auto release mode (if true, release will be called in object's destructor). + */ + void create(int arows, int acols, Format aformat, bool autoRelease = false); + /** @overload + @param asize 2D array size. + @param aformat Image format. See cv::ogl::Texture2D::Format . + @param autoRelease Auto release mode (if true, release will be called in object's destructor). + */ + void create(Size asize, Format aformat, bool autoRelease = false); + + /** @brief Decrements the reference counter and destroys the texture object if needed. + + The function will call setAutoRelease(true) . + */ + void release(); + + /** @brief Sets auto release mode. + + @param flag Auto release mode (if true, release will be called in object's destructor). + + The lifetime of the OpenGL object is tied to the lifetime of the context. If OpenGL context was + bound to a window it could be released at any time (user can close a window). If object's destructor + is called after destruction of the context it will cause an error. Thus ogl::Texture2D doesn't + destroy OpenGL object in destructor by default (all OpenGL resources will be released with OpenGL + context). This function can force ogl::Texture2D destructor to destroy OpenGL object. + */ + void setAutoRelease(bool flag); + + /** @brief Copies from host/device memory to OpenGL texture. + + @param arr Input array (host or device memory, it can be Mat , cuda::GpuMat or ogl::Buffer ). + @param autoRelease Auto release mode (if true, release will be called in object's destructor). + */ + void copyFrom(InputArray arr, bool autoRelease = false); + + /** @brief Copies from OpenGL texture to host/device memory or another OpenGL texture object. + + @param arr Destination array (host or device memory, can be Mat , cuda::GpuMat , ogl::Buffer or + ogl::Texture2D ). + @param ddepth Destination depth. + @param autoRelease Auto release mode for destination buffer (if arr is OpenGL buffer or texture). + */ + void copyTo(OutputArray arr, int ddepth = CV_32F, bool autoRelease = false) const; + + /** @brief Binds texture to current active texture unit for GL_TEXTURE_2D target. + */ + void bind() const; + + int rows() const; + int cols() const; + Size size() const; + bool empty() const; + + Format format() const; + + //! get OpenGL opject id + unsigned int texId() const; + + class Impl; + +private: + Ptr impl_; + int rows_; + int cols_; + Format format_; +}; + +/** @brief Wrapper for OpenGL Client-Side Vertex arrays. + +ogl::Arrays stores vertex data in ogl::Buffer objects. + */ +class CV_EXPORTS Arrays +{ +public: + /** @brief Default constructor + */ + Arrays(); + + /** @brief Sets an array of vertex coordinates. + @param vertex array with vertex coordinates, can be both host and device memory. + */ + void setVertexArray(InputArray vertex); + + /** @brief Resets vertex coordinates. + */ + void resetVertexArray(); + + /** @brief Sets an array of vertex colors. + @param color array with vertex colors, can be both host and device memory. + */ + void setColorArray(InputArray color); + + /** @brief Resets vertex colors. + */ + void resetColorArray(); + + /** @brief Sets an array of vertex normals. + @param normal array with vertex normals, can be both host and device memory. + */ + void setNormalArray(InputArray normal); + + /** @brief Resets vertex normals. + */ + void resetNormalArray(); + + /** @brief Sets an array of vertex texture coordinates. + @param texCoord array with vertex texture coordinates, can be both host and device memory. + */ + void setTexCoordArray(InputArray texCoord); + + /** @brief Resets vertex texture coordinates. + */ + void resetTexCoordArray(); + + /** @brief Releases all inner buffers. + */ + void release(); + + /** @brief Sets auto release mode all inner buffers. + @param flag Auto release mode. + */ + void setAutoRelease(bool flag); + + /** @brief Binds all vertex arrays. + */ + void bind() const; + + /** @brief Returns the vertex count. + */ + int size() const; + bool empty() const; + +private: + int size_; + Buffer vertex_; + Buffer color_; + Buffer normal_; + Buffer texCoord_; +}; + +/////////////////// Render Functions /////////////////// + +//! render mode +enum RenderModes { + POINTS = 0x0000, + LINES = 0x0001, + LINE_LOOP = 0x0002, + LINE_STRIP = 0x0003, + TRIANGLES = 0x0004, + TRIANGLE_STRIP = 0x0005, + TRIANGLE_FAN = 0x0006, + QUADS = 0x0007, + QUAD_STRIP = 0x0008, + POLYGON = 0x0009 +}; + +/** @brief Render OpenGL texture or primitives. +@param tex Texture to draw. +@param wndRect Region of window, where to draw a texture (normalized coordinates). +@param texRect Region of texture to draw (normalized coordinates). + */ +CV_EXPORTS void render(const Texture2D& tex, + Rect_ wndRect = Rect_(0.0, 0.0, 1.0, 1.0), + Rect_ texRect = Rect_(0.0, 0.0, 1.0, 1.0)); + +/** @overload +@param arr Array of privitives vertices. +@param mode Render mode. One of cv::ogl::RenderModes +@param color Color for all vertices. Will be used if arr doesn't contain color array. +*/ +CV_EXPORTS void render(const Arrays& arr, int mode = POINTS, Scalar color = Scalar::all(255)); + +/** @overload +@param arr Array of privitives vertices. +@param indices Array of vertices indices (host or device memory). +@param mode Render mode. One of cv::ogl::RenderModes +@param color Color for all vertices. Will be used if arr doesn't contain color array. +*/ +CV_EXPORTS void render(const Arrays& arr, InputArray indices, int mode = POINTS, Scalar color = Scalar::all(255)); + +/////////////////// CL-GL Interoperability Functions /////////////////// + +namespace ocl { +using namespace cv::ocl; + +// TODO static functions in the Context class +/** @brief Creates OpenCL context from GL. +@return Returns reference to OpenCL Context + */ +CV_EXPORTS Context& initializeContextFromGL(); + +} // namespace cv::ogl::ocl + +/** @brief Converts InputArray to Texture2D object. +@param src - source InputArray. +@param texture - destination Texture2D object. + */ +CV_EXPORTS void convertToGLTexture2D(InputArray src, Texture2D& texture); + +/** @brief Converts Texture2D object to OutputArray. +@param texture - source Texture2D object. +@param dst - destination OutputArray. + */ +CV_EXPORTS void convertFromGLTexture2D(const Texture2D& texture, OutputArray dst); + +/** @brief Maps Buffer object to process on CL side (convert to UMat). + +Function creates CL buffer from GL one, and then constructs UMat that can be used +to process buffer data with OpenCV functions. Note that in current implementation +UMat constructed this way doesn't own corresponding GL buffer object, so it is +the user responsibility to close down CL/GL buffers relationships by explicitly +calling unmapGLBuffer() function. +@param buffer - source Buffer object. +@param accessFlags - data access flags (ACCESS_READ|ACCESS_WRITE). +@return Returns UMat object + */ +CV_EXPORTS UMat mapGLBuffer(const Buffer& buffer, int accessFlags = ACCESS_READ|ACCESS_WRITE); + +/** @brief Unmaps Buffer object (releases UMat, previously mapped from Buffer). + +Function must be called explicitly by the user for each UMat previously constructed +by the call to mapGLBuffer() function. +@param u - source UMat, created by mapGLBuffer(). + */ +CV_EXPORTS void unmapGLBuffer(UMat& u); + +}} // namespace cv::ogl + +namespace cv { namespace cuda { + +//! @addtogroup cuda +//! @{ + +/** @brief Sets a CUDA device and initializes it for the current thread with OpenGL interoperability. + +This function should be explicitly called after OpenGL context creation and before any CUDA calls. +@param device System index of a CUDA device starting with 0. +@ingroup core_opengl + */ +CV_EXPORTS void setGlDevice(int device = 0); + +//! @} + +}} + +//! @cond IGNORED + +//////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// + +inline +cv::ogl::Buffer::Buffer(int arows, int acols, int atype, Target target, bool autoRelease) : rows_(0), cols_(0), type_(0) +{ + create(arows, acols, atype, target, autoRelease); +} + +inline +cv::ogl::Buffer::Buffer(Size asize, int atype, Target target, bool autoRelease) : rows_(0), cols_(0), type_(0) +{ + create(asize, atype, target, autoRelease); +} + +inline +void cv::ogl::Buffer::create(Size asize, int atype, Target target, bool autoRelease) +{ + create(asize.height, asize.width, atype, target, autoRelease); +} + +inline +int cv::ogl::Buffer::rows() const +{ + return rows_; +} + +inline +int cv::ogl::Buffer::cols() const +{ + return cols_; +} + +inline +cv::Size cv::ogl::Buffer::size() const +{ + return Size(cols_, rows_); +} + +inline +bool cv::ogl::Buffer::empty() const +{ + return rows_ == 0 || cols_ == 0; +} + +inline +int cv::ogl::Buffer::type() const +{ + return type_; +} + +inline +int cv::ogl::Buffer::depth() const +{ + return CV_MAT_DEPTH(type_); +} + +inline +int cv::ogl::Buffer::channels() const +{ + return CV_MAT_CN(type_); +} + +inline +int cv::ogl::Buffer::elemSize() const +{ + return CV_ELEM_SIZE(type_); +} + +inline +int cv::ogl::Buffer::elemSize1() const +{ + return CV_ELEM_SIZE1(type_); +} + +/////// + +inline +cv::ogl::Texture2D::Texture2D(int arows, int acols, Format aformat, bool autoRelease) : rows_(0), cols_(0), format_(NONE) +{ + create(arows, acols, aformat, autoRelease); +} + +inline +cv::ogl::Texture2D::Texture2D(Size asize, Format aformat, bool autoRelease) : rows_(0), cols_(0), format_(NONE) +{ + create(asize, aformat, autoRelease); +} + +inline +void cv::ogl::Texture2D::create(Size asize, Format aformat, bool autoRelease) +{ + create(asize.height, asize.width, aformat, autoRelease); +} + +inline +int cv::ogl::Texture2D::rows() const +{ + return rows_; +} + +inline +int cv::ogl::Texture2D::cols() const +{ + return cols_; +} + +inline +cv::Size cv::ogl::Texture2D::size() const +{ + return Size(cols_, rows_); +} + +inline +bool cv::ogl::Texture2D::empty() const +{ + return rows_ == 0 || cols_ == 0; +} + +inline +cv::ogl::Texture2D::Format cv::ogl::Texture2D::format() const +{ + return format_; +} + +/////// + +inline +cv::ogl::Arrays::Arrays() : size_(0) +{ +} + +inline +int cv::ogl::Arrays::size() const +{ + return size_; +} + +inline +bool cv::ogl::Arrays::empty() const +{ + return size_ == 0; +} + +//! @endcond + +#endif /* __OPENCV_CORE_OPENGL_HPP__ */ diff --git a/lib/opencv/include/opencv2/core/operations.hpp b/lib/opencv/include/opencv2/core/operations.hpp new file mode 100644 index 000000000..bced1a755 --- /dev/null +++ b/lib/opencv/include/opencv2/core/operations.hpp @@ -0,0 +1,530 @@ +/*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. +// 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_OPERATIONS_HPP__ +#define __OPENCV_CORE_OPERATIONS_HPP__ + +#ifndef __cplusplus +# error operations.hpp header must be compiled as C++ +#endif + +#include + +//! @cond IGNORED + +namespace cv +{ + +////////////////////////////// Matx methods depending on core API ///////////////////////////// + +namespace internal +{ + +template struct Matx_FastInvOp +{ + bool operator()(const Matx<_Tp, m, m>& a, Matx<_Tp, m, m>& b, int method) const + { + Matx<_Tp, m, m> temp = a; + + // assume that b is all 0's on input => make it a unity matrix + for( int i = 0; i < m; i++ ) + b(i, i) = (_Tp)1; + + if( method == DECOMP_CHOLESKY ) + return Cholesky(temp.val, m*sizeof(_Tp), m, b.val, m*sizeof(_Tp), m); + + return LU(temp.val, m*sizeof(_Tp), m, b.val, m*sizeof(_Tp), m) != 0; + } +}; + +template struct Matx_FastInvOp<_Tp, 2> +{ + bool operator()(const Matx<_Tp, 2, 2>& a, Matx<_Tp, 2, 2>& b, int) const + { + _Tp d = determinant(a); + if( d == 0 ) + return false; + d = 1/d; + b(1,1) = a(0,0)*d; + b(0,0) = a(1,1)*d; + b(0,1) = -a(0,1)*d; + b(1,0) = -a(1,0)*d; + return true; + } +}; + +template struct Matx_FastInvOp<_Tp, 3> +{ + bool operator()(const Matx<_Tp, 3, 3>& a, Matx<_Tp, 3, 3>& b, int) const + { + _Tp d = (_Tp)determinant(a); + if( d == 0 ) + return false; + d = 1/d; + b(0,0) = (a(1,1) * a(2,2) - a(1,2) * a(2,1)) * d; + b(0,1) = (a(0,2) * a(2,1) - a(0,1) * a(2,2)) * d; + b(0,2) = (a(0,1) * a(1,2) - a(0,2) * a(1,1)) * d; + + b(1,0) = (a(1,2) * a(2,0) - a(1,0) * a(2,2)) * d; + b(1,1) = (a(0,0) * a(2,2) - a(0,2) * a(2,0)) * d; + b(1,2) = (a(0,2) * a(1,0) - a(0,0) * a(1,2)) * d; + + b(2,0) = (a(1,0) * a(2,1) - a(1,1) * a(2,0)) * d; + b(2,1) = (a(0,1) * a(2,0) - a(0,0) * a(2,1)) * d; + b(2,2) = (a(0,0) * a(1,1) - a(0,1) * a(1,0)) * d; + return true; + } +}; + + +template struct Matx_FastSolveOp +{ + bool operator()(const Matx<_Tp, m, m>& a, const Matx<_Tp, m, n>& b, + Matx<_Tp, m, n>& x, int method) const + { + Matx<_Tp, m, m> temp = a; + x = b; + if( method == DECOMP_CHOLESKY ) + return Cholesky(temp.val, m*sizeof(_Tp), m, x.val, n*sizeof(_Tp), n); + + return LU(temp.val, m*sizeof(_Tp), m, x.val, n*sizeof(_Tp), n) != 0; + } +}; + +template struct Matx_FastSolveOp<_Tp, 2, 1> +{ + bool operator()(const Matx<_Tp, 2, 2>& a, const Matx<_Tp, 2, 1>& b, + Matx<_Tp, 2, 1>& x, int) const + { + _Tp d = determinant(a); + if( d == 0 ) + return false; + d = 1/d; + x(0) = (b(0)*a(1,1) - b(1)*a(0,1))*d; + x(1) = (b(1)*a(0,0) - b(0)*a(1,0))*d; + return true; + } +}; + +template struct Matx_FastSolveOp<_Tp, 3, 1> +{ + bool operator()(const Matx<_Tp, 3, 3>& a, const Matx<_Tp, 3, 1>& b, + Matx<_Tp, 3, 1>& x, int) const + { + _Tp d = (_Tp)determinant(a); + if( d == 0 ) + return false; + d = 1/d; + x(0) = d*(b(0)*(a(1,1)*a(2,2) - a(1,2)*a(2,1)) - + a(0,1)*(b(1)*a(2,2) - a(1,2)*b(2)) + + a(0,2)*(b(1)*a(2,1) - a(1,1)*b(2))); + + x(1) = d*(a(0,0)*(b(1)*a(2,2) - a(1,2)*b(2)) - + b(0)*(a(1,0)*a(2,2) - a(1,2)*a(2,0)) + + a(0,2)*(a(1,0)*b(2) - b(1)*a(2,0))); + + x(2) = d*(a(0,0)*(a(1,1)*b(2) - b(1)*a(2,1)) - + a(0,1)*(a(1,0)*b(2) - b(1)*a(2,0)) + + b(0)*(a(1,0)*a(2,1) - a(1,1)*a(2,0))); + return true; + } +}; + +} // internal + +template inline +Matx<_Tp,m,n> Matx<_Tp,m,n>::randu(_Tp a, _Tp b) +{ + Matx<_Tp,m,n> M; + cv::randu(M, Scalar(a), Scalar(b)); + return M; +} + +template inline +Matx<_Tp,m,n> Matx<_Tp,m,n>::randn(_Tp a, _Tp b) +{ + Matx<_Tp,m,n> M; + cv::randn(M, Scalar(a), Scalar(b)); + return M; +} + +template inline +Matx<_Tp, n, m> Matx<_Tp, m, n>::inv(int method, bool *p_is_ok /*= NULL*/) const +{ + Matx<_Tp, n, m> b; + bool ok; + if( method == DECOMP_LU || method == DECOMP_CHOLESKY ) + ok = cv::internal::Matx_FastInvOp<_Tp, m>()(*this, b, method); + else + { + Mat A(*this, false), B(b, false); + ok = (invert(A, B, method) != 0); + } + if( NULL != p_is_ok ) { *p_is_ok = ok; } + return ok ? b : Matx<_Tp, n, m>::zeros(); +} + +template template inline +Matx<_Tp, n, l> Matx<_Tp, m, n>::solve(const Matx<_Tp, m, l>& rhs, int method) const +{ + Matx<_Tp, n, l> x; + bool ok; + if( method == DECOMP_LU || method == DECOMP_CHOLESKY ) + ok = cv::internal::Matx_FastSolveOp<_Tp, m, l>()(*this, rhs, x, method); + else + { + Mat A(*this, false), B(rhs, false), X(x, false); + ok = cv::solve(A, B, X, method); + } + + return ok ? x : Matx<_Tp, n, l>::zeros(); +} + + + +////////////////////////// Augmenting algebraic & logical operations ////////////////////////// + +#define CV_MAT_AUG_OPERATOR1(op, cvop, A, B) \ + static inline A& operator op (A& a, const B& b) { cvop; return a; } + +#define CV_MAT_AUG_OPERATOR(op, cvop, A, B) \ + CV_MAT_AUG_OPERATOR1(op, cvop, A, B) \ + CV_MAT_AUG_OPERATOR1(op, cvop, const A, B) + +#define CV_MAT_AUG_OPERATOR_T(op, cvop, A, B) \ + template CV_MAT_AUG_OPERATOR1(op, cvop, A, B) \ + template CV_MAT_AUG_OPERATOR1(op, cvop, const A, B) + +CV_MAT_AUG_OPERATOR (+=, cv::add(a,b,a), Mat, Mat) +CV_MAT_AUG_OPERATOR (+=, cv::add(a,b,a), Mat, Scalar) +CV_MAT_AUG_OPERATOR_T(+=, cv::add(a,b,a), Mat_<_Tp>, Mat) +CV_MAT_AUG_OPERATOR_T(+=, cv::add(a,b,a), Mat_<_Tp>, Scalar) +CV_MAT_AUG_OPERATOR_T(+=, cv::add(a,b,a), Mat_<_Tp>, Mat_<_Tp>) + +CV_MAT_AUG_OPERATOR (-=, cv::subtract(a,b,a), Mat, Mat) +CV_MAT_AUG_OPERATOR (-=, cv::subtract(a,b,a), Mat, Scalar) +CV_MAT_AUG_OPERATOR_T(-=, cv::subtract(a,b,a), Mat_<_Tp>, Mat) +CV_MAT_AUG_OPERATOR_T(-=, cv::subtract(a,b,a), Mat_<_Tp>, Scalar) +CV_MAT_AUG_OPERATOR_T(-=, cv::subtract(a,b,a), Mat_<_Tp>, Mat_<_Tp>) + +CV_MAT_AUG_OPERATOR (*=, cv::gemm(a, b, 1, Mat(), 0, a, 0), Mat, Mat) +CV_MAT_AUG_OPERATOR_T(*=, cv::gemm(a, b, 1, Mat(), 0, a, 0), Mat_<_Tp>, Mat) +CV_MAT_AUG_OPERATOR_T(*=, cv::gemm(a, b, 1, Mat(), 0, a, 0), Mat_<_Tp>, Mat_<_Tp>) +CV_MAT_AUG_OPERATOR (*=, a.convertTo(a, -1, b), Mat, double) +CV_MAT_AUG_OPERATOR_T(*=, a.convertTo(a, -1, b), Mat_<_Tp>, double) + +CV_MAT_AUG_OPERATOR (/=, cv::divide(a,b,a), Mat, Mat) +CV_MAT_AUG_OPERATOR_T(/=, cv::divide(a,b,a), Mat_<_Tp>, Mat) +CV_MAT_AUG_OPERATOR_T(/=, cv::divide(a,b,a), Mat_<_Tp>, Mat_<_Tp>) +CV_MAT_AUG_OPERATOR (/=, a.convertTo((Mat&)a, -1, 1./b), Mat, double) +CV_MAT_AUG_OPERATOR_T(/=, a.convertTo((Mat&)a, -1, 1./b), Mat_<_Tp>, double) + +CV_MAT_AUG_OPERATOR (&=, cv::bitwise_and(a,b,a), Mat, Mat) +CV_MAT_AUG_OPERATOR (&=, cv::bitwise_and(a,b,a), Mat, Scalar) +CV_MAT_AUG_OPERATOR_T(&=, cv::bitwise_and(a,b,a), Mat_<_Tp>, Mat) +CV_MAT_AUG_OPERATOR_T(&=, cv::bitwise_and(a,b,a), Mat_<_Tp>, Scalar) +CV_MAT_AUG_OPERATOR_T(&=, cv::bitwise_and(a,b,a), Mat_<_Tp>, Mat_<_Tp>) + +CV_MAT_AUG_OPERATOR (|=, cv::bitwise_or(a,b,a), Mat, Mat) +CV_MAT_AUG_OPERATOR (|=, cv::bitwise_or(a,b,a), Mat, Scalar) +CV_MAT_AUG_OPERATOR_T(|=, cv::bitwise_or(a,b,a), Mat_<_Tp>, Mat) +CV_MAT_AUG_OPERATOR_T(|=, cv::bitwise_or(a,b,a), Mat_<_Tp>, Scalar) +CV_MAT_AUG_OPERATOR_T(|=, cv::bitwise_or(a,b,a), Mat_<_Tp>, Mat_<_Tp>) + +CV_MAT_AUG_OPERATOR (^=, cv::bitwise_xor(a,b,a), Mat, Mat) +CV_MAT_AUG_OPERATOR (^=, cv::bitwise_xor(a,b,a), Mat, Scalar) +CV_MAT_AUG_OPERATOR_T(^=, cv::bitwise_xor(a,b,a), Mat_<_Tp>, Mat) +CV_MAT_AUG_OPERATOR_T(^=, cv::bitwise_xor(a,b,a), Mat_<_Tp>, Scalar) +CV_MAT_AUG_OPERATOR_T(^=, cv::bitwise_xor(a,b,a), Mat_<_Tp>, Mat_<_Tp>) + +#undef CV_MAT_AUG_OPERATOR_T +#undef CV_MAT_AUG_OPERATOR +#undef CV_MAT_AUG_OPERATOR1 + + + +///////////////////////////////////////////// SVD ///////////////////////////////////////////// + +inline SVD::SVD() {} +inline SVD::SVD( InputArray m, int flags ) { operator ()(m, flags); } +inline void SVD::solveZ( InputArray m, OutputArray _dst ) +{ + Mat mtx = m.getMat(); + SVD svd(mtx, (mtx.rows >= mtx.cols ? 0 : SVD::FULL_UV)); + _dst.create(svd.vt.cols, 1, svd.vt.type()); + Mat dst = _dst.getMat(); + svd.vt.row(svd.vt.rows-1).reshape(1,svd.vt.cols).copyTo(dst); +} + +template inline void + SVD::compute( const Matx<_Tp, m, n>& a, Matx<_Tp, nm, 1>& w, Matx<_Tp, m, nm>& u, Matx<_Tp, n, nm>& vt ) +{ + CV_StaticAssert( nm == MIN(m, n), "Invalid size of output vector."); + Mat _a(a, false), _u(u, false), _w(w, false), _vt(vt, false); + SVD::compute(_a, _w, _u, _vt); + CV_Assert(_w.data == (uchar*)&w.val[0] && _u.data == (uchar*)&u.val[0] && _vt.data == (uchar*)&vt.val[0]); +} + +template inline void +SVD::compute( const Matx<_Tp, m, n>& a, Matx<_Tp, nm, 1>& w ) +{ + CV_StaticAssert( nm == MIN(m, n), "Invalid size of output vector."); + Mat _a(a, false), _w(w, false); + SVD::compute(_a, _w); + CV_Assert(_w.data == (uchar*)&w.val[0]); +} + +template inline void +SVD::backSubst( const Matx<_Tp, nm, 1>& w, const Matx<_Tp, m, nm>& u, + const Matx<_Tp, n, nm>& vt, const Matx<_Tp, m, nb>& rhs, + Matx<_Tp, n, nb>& dst ) +{ + CV_StaticAssert( nm == MIN(m, n), "Invalid size of output vector."); + Mat _u(u, false), _w(w, false), _vt(vt, false), _rhs(rhs, false), _dst(dst, false); + SVD::backSubst(_w, _u, _vt, _rhs, _dst); + CV_Assert(_dst.data == (uchar*)&dst.val[0]); +} + + + +/////////////////////////////////// Multiply-with-Carry RNG /////////////////////////////////// + +inline RNG::RNG() { state = 0xffffffff; } +inline RNG::RNG(uint64 _state) { state = _state ? _state : 0xffffffff; } + +inline RNG::operator uchar() { return (uchar)next(); } +inline RNG::operator schar() { return (schar)next(); } +inline RNG::operator ushort() { return (ushort)next(); } +inline RNG::operator short() { return (short)next(); } +inline RNG::operator int() { return (int)next(); } +inline RNG::operator unsigned() { return next(); } +inline RNG::operator float() { return next()*2.3283064365386962890625e-10f; } +inline RNG::operator double() { unsigned t = next(); return (((uint64)t << 32) | next()) * 5.4210108624275221700372640043497e-20; } + +inline unsigned RNG::operator ()(unsigned N) { return (unsigned)uniform(0,N); } +inline unsigned RNG::operator ()() { return next(); } + +inline int RNG::uniform(int a, int b) { return a == b ? a : (int)(next() % (b - a) + a); } +inline float RNG::uniform(float a, float b) { return ((float)*this)*(b - a) + a; } +inline double RNG::uniform(double a, double b) { return ((double)*this)*(b - a) + a; } + +inline unsigned RNG::next() +{ + state = (uint64)(unsigned)state* /*CV_RNG_COEFF*/ 4164903690U + (unsigned)(state >> 32); + return (unsigned)state; +} + +//! returns the next unifomly-distributed random number of the specified type +template static inline _Tp randu() +{ + return (_Tp)theRNG(); +} + +///////////////////////////////// Formatted string generation ///////////////////////////////// + +CV_EXPORTS String format( const char* fmt, ... ); + +///////////////////////////////// Formatted output of cv::Mat ///////////////////////////////// + +static inline +Ptr format(InputArray mtx, int fmt) +{ + return Formatter::get(fmt)->format(mtx.getMat()); +} + +static inline +int print(Ptr fmtd, FILE* stream = stdout) +{ + int written = 0; + fmtd->reset(); + for(const char* str = fmtd->next(); str; str = fmtd->next()) + written += fputs(str, stream); + + return written; +} + +static inline +int print(const Mat& mtx, FILE* stream = stdout) +{ + return print(Formatter::get()->format(mtx), stream); +} + +static inline +int print(const UMat& mtx, FILE* stream = stdout) +{ + return print(Formatter::get()->format(mtx.getMat(ACCESS_READ)), stream); +} + +template static inline +int print(const std::vector >& vec, FILE* stream = stdout) +{ + return print(Formatter::get()->format(Mat(vec)), stream); +} + +template static inline +int print(const std::vector >& vec, FILE* stream = stdout) +{ + return print(Formatter::get()->format(Mat(vec)), stream); +} + +template static inline +int print(const Matx<_Tp, m, n>& matx, FILE* stream = stdout) +{ + return print(Formatter::get()->format(cv::Mat(matx)), stream); +} + +//! @endcond + +/****************************************************************************************\ +* Auxiliary algorithms * +\****************************************************************************************/ + +/** @brief Splits an element set into equivalency classes. + +The generic function partition implements an \f$O(N^2)\f$ algorithm for splitting a set of \f$N\f$ elements +into one or more equivalency classes, as described in + . The function returns the number of +equivalency classes. +@param _vec Set of elements stored as a vector. +@param labels Output vector of labels. It contains as many elements as vec. Each label labels[i] is +a 0-based cluster index of `vec[i]`. +@param predicate Equivalence predicate (pointer to a boolean function of two arguments or an +instance of the class that has the method bool operator()(const _Tp& a, const _Tp& b) ). The +predicate returns true when the elements are certainly in the same class, and returns false if they +may or may not be in the same class. +@ingroup core_cluster +*/ +template int +partition( const std::vector<_Tp>& _vec, std::vector& labels, + _EqPredicate predicate=_EqPredicate()) +{ + int i, j, N = (int)_vec.size(); + const _Tp* vec = &_vec[0]; + + const int PARENT=0; + const int RANK=1; + + std::vector _nodes(N*2); + int (*nodes)[2] = (int(*)[2])&_nodes[0]; + + // The first O(N) pass: create N single-vertex trees + for(i = 0; i < N; i++) + { + nodes[i][PARENT]=-1; + nodes[i][RANK] = 0; + } + + // The main O(N^2) pass: merge connected components + for( i = 0; i < N; i++ ) + { + int root = i; + + // find root + while( nodes[root][PARENT] >= 0 ) + root = nodes[root][PARENT]; + + for( j = 0; j < N; j++ ) + { + if( i == j || !predicate(vec[i], vec[j])) + continue; + int root2 = j; + + while( nodes[root2][PARENT] >= 0 ) + root2 = nodes[root2][PARENT]; + + if( root2 != root ) + { + // unite both trees + int rank = nodes[root][RANK], rank2 = nodes[root2][RANK]; + if( rank > rank2 ) + nodes[root2][PARENT] = root; + else + { + nodes[root][PARENT] = root2; + nodes[root2][RANK] += rank == rank2; + root = root2; + } + CV_Assert( nodes[root][PARENT] < 0 ); + + int k = j, parent; + + // compress the path from node2 to root + while( (parent = nodes[k][PARENT]) >= 0 ) + { + nodes[k][PARENT] = root; + k = parent; + } + + // compress the path from node to root + k = i; + while( (parent = nodes[k][PARENT]) >= 0 ) + { + nodes[k][PARENT] = root; + k = parent; + } + } + } + } + + // Final O(N) pass: enumerate classes + labels.resize(N); + int nclasses = 0; + + for( i = 0; i < N; i++ ) + { + int root = i; + while( nodes[root][PARENT] >= 0 ) + root = nodes[root][PARENT]; + // re-use the rank as the class label + if( nodes[root][RANK] >= 0 ) + nodes[root][RANK] = ~nclasses++; + labels[i] = ~nodes[root][RANK]; + } + + return nclasses; +} + +} // cv + +#endif diff --git a/lib/opencv/include/opencv2/core/optim.hpp b/lib/opencv/include/opencv2/core/optim.hpp new file mode 100644 index 000000000..23e215583 --- /dev/null +++ b/lib/opencv/include/opencv2/core/optim.hpp @@ -0,0 +1,302 @@ +/*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) 2013, OpenCV Foundation, 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 OpenCV Foundation 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_OPTIM_HPP__ +#define __OPENCV_OPTIM_HPP__ + +#include "opencv2/core.hpp" + +namespace cv +{ + +/** @addtogroup core_optim +The algorithms in this section minimize or maximize function value within specified constraints or +without any constraints. +@{ +*/ + +/** @brief Basic interface for all solvers + */ +class CV_EXPORTS MinProblemSolver : public Algorithm +{ +public: + /** @brief Represents function being optimized + */ + class CV_EXPORTS Function + { + public: + virtual ~Function() {} + virtual int getDims() const = 0; + virtual double getGradientEps() const; + virtual double calc(const double* x) const = 0; + virtual void getGradient(const double* x,double* grad); + }; + + /** @brief Getter for the optimized function. + + The optimized function is represented by Function interface, which requires derivatives to + implement the sole method calc(double*) to evaluate the function. + + @return Smart-pointer to an object that implements Function interface - it represents the + function that is being optimized. It can be empty, if no function was given so far. + */ + virtual Ptr getFunction() const = 0; + + /** @brief Setter for the optimized function. + + *It should be called at least once before the call to* minimize(), as default value is not usable. + + @param f The new function to optimize. + */ + virtual void setFunction(const Ptr& f) = 0; + + /** @brief Getter for the previously set terminal criteria for this algorithm. + + @return Deep copy of the terminal criteria used at the moment. + */ + virtual TermCriteria getTermCriteria() const = 0; + + /** @brief Set terminal criteria for solver. + + This method *is not necessary* to be called before the first call to minimize(), as the default + value is sensible. + + Algorithm stops when the number of function evaluations done exceeds termcrit.maxCount, when + the function values at the vertices of simplex are within termcrit.epsilon range or simplex + becomes so small that it can enclosed in a box with termcrit.epsilon sides, whatever comes + first. + @param termcrit Terminal criteria to be used, represented as cv::TermCriteria structure. + */ + virtual void setTermCriteria(const TermCriteria& termcrit) = 0; + + /** @brief actually runs the algorithm and performs the minimization. + + The sole input parameter determines the centroid of the starting simplex (roughly, it tells + where to start), all the others (terminal criteria, initial step, function to be minimized) are + supposed to be set via the setters before the call to this method or the default values (not + always sensible) will be used. + + @param x The initial point, that will become a centroid of an initial simplex. After the algorithm + will terminate, it will be setted to the point where the algorithm stops, the point of possible + minimum. + @return The value of a function at the point found. + */ + virtual double minimize(InputOutputArray x) = 0; +}; + +/** @brief This class is used to perform the non-linear non-constrained minimization of a function, + +defined on an `n`-dimensional Euclidean space, using the **Nelder-Mead method**, also known as +**downhill simplex method**. The basic idea about the method can be obtained from +. + +It should be noted, that this method, although deterministic, is rather a heuristic and therefore +may converge to a local minima, not necessary a global one. It is iterative optimization technique, +which at each step uses an information about the values of a function evaluated only at `n+1` +points, arranged as a *simplex* in `n`-dimensional space (hence the second name of the method). At +each step new point is chosen to evaluate function at, obtained value is compared with previous +ones and based on this information simplex changes it's shape , slowly moving to the local minimum. +Thus this method is using *only* function values to make decision, on contrary to, say, Nonlinear +Conjugate Gradient method (which is also implemented in optim). + +Algorithm stops when the number of function evaluations done exceeds termcrit.maxCount, when the +function values at the vertices of simplex are within termcrit.epsilon range or simplex becomes so +small that it can enclosed in a box with termcrit.epsilon sides, whatever comes first, for some +defined by user positive integer termcrit.maxCount and positive non-integer termcrit.epsilon. + +@note DownhillSolver is a derivative of the abstract interface +cv::MinProblemSolver, which in turn is derived from the Algorithm interface and is used to +encapsulate the functionality, common to all non-linear optimization algorithms in the optim +module. + +@note term criteria should meet following condition: +@code + termcrit.type == (TermCriteria::MAX_ITER + TermCriteria::EPS) && termcrit.epsilon > 0 && termcrit.maxCount > 0 +@endcode + */ +class CV_EXPORTS DownhillSolver : public MinProblemSolver +{ +public: + /** @brief Returns the initial step that will be used in downhill simplex algorithm. + + @param step Initial step that will be used in algorithm. Note, that although corresponding setter + accepts column-vectors as well as row-vectors, this method will return a row-vector. + @see DownhillSolver::setInitStep + */ + virtual void getInitStep(OutputArray step) const=0; + + /** @brief Sets the initial step that will be used in downhill simplex algorithm. + + Step, together with initial point (givin in DownhillSolver::minimize) are two `n`-dimensional + vectors that are used to determine the shape of initial simplex. Roughly said, initial point + determines the position of a simplex (it will become simplex's centroid), while step determines the + spread (size in each dimension) of a simplex. To be more precise, if \f$s,x_0\in\mathbb{R}^n\f$ are + the initial step and initial point respectively, the vertices of a simplex will be: + \f$v_0:=x_0-\frac{1}{2} s\f$ and \f$v_i:=x_0+s_i\f$ for \f$i=1,2,\dots,n\f$ where \f$s_i\f$ denotes + projections of the initial step of *n*-th coordinate (the result of projection is treated to be + vector given by \f$s_i:=e_i\cdot\left\f$, where \f$e_i\f$ form canonical basis) + + @param step Initial step that will be used in algorithm. Roughly said, it determines the spread + (size in each dimension) of an initial simplex. + */ + virtual void setInitStep(InputArray step)=0; + + /** @brief This function returns the reference to the ready-to-use DownhillSolver object. + + All the parameters are optional, so this procedure can be called even without parameters at + all. In this case, the default values will be used. As default value for terminal criteria are + the only sensible ones, MinProblemSolver::setFunction() and DownhillSolver::setInitStep() + should be called upon the obtained object, if the respective parameters were not given to + create(). Otherwise, the two ways (give parameters to createDownhillSolver() or miss them out + and call the MinProblemSolver::setFunction() and DownhillSolver::setInitStep()) are absolutely + equivalent (and will drop the same errors in the same way, should invalid input be detected). + @param f Pointer to the function that will be minimized, similarly to the one you submit via + MinProblemSolver::setFunction. + @param initStep Initial step, that will be used to construct the initial simplex, similarly to the one + you submit via MinProblemSolver::setInitStep. + @param termcrit Terminal criteria to the algorithm, similarly to the one you submit via + MinProblemSolver::setTermCriteria. + */ + static Ptr create(const Ptr& f=Ptr(), + InputArray initStep=Mat_(1,1,0.0), + TermCriteria termcrit=TermCriteria(TermCriteria::MAX_ITER+TermCriteria::EPS,5000,0.000001)); +}; + +/** @brief This class is used to perform the non-linear non-constrained minimization of a function +with known gradient, + +defined on an *n*-dimensional Euclidean space, using the **Nonlinear Conjugate Gradient method**. +The implementation was done based on the beautifully clear explanatory article [An Introduction to +the Conjugate Gradient Method Without the Agonizing +Pain](http://www.cs.cmu.edu/~quake-papers/painless-conjugate-gradient.pdf) by Jonathan Richard +Shewchuk. The method can be seen as an adaptation of a standard Conjugate Gradient method (see, for +example ) for numerically solving the +systems of linear equations. + +It should be noted, that this method, although deterministic, is rather a heuristic method and +therefore may converge to a local minima, not necessary a global one. What is even more disastrous, +most of its behaviour is ruled by gradient, therefore it essentially cannot distinguish between +local minima and maxima. Therefore, if it starts sufficiently near to the local maximum, it may +converge to it. Another obvious restriction is that it should be possible to compute the gradient of +a function at any point, thus it is preferable to have analytic expression for gradient and +computational burden should be born by the user. + +The latter responsibility is accompilished via the getGradient method of a +MinProblemSolver::Function interface (which represents function being optimized). This method takes +point a point in *n*-dimensional space (first argument represents the array of coordinates of that +point) and comput its gradient (it should be stored in the second argument as an array). + +@note class ConjGradSolver thus does not add any new methods to the basic MinProblemSolver interface. + +@note term criteria should meet following condition: +@code + termcrit.type == (TermCriteria::MAX_ITER + TermCriteria::EPS) && termcrit.epsilon > 0 && termcrit.maxCount > 0 + // or + termcrit.type == TermCriteria::MAX_ITER) && termcrit.maxCount > 0 +@endcode + */ +class CV_EXPORTS ConjGradSolver : public MinProblemSolver +{ +public: + /** @brief This function returns the reference to the ready-to-use ConjGradSolver object. + + All the parameters are optional, so this procedure can be called even without parameters at + all. In this case, the default values will be used. As default value for terminal criteria are + the only sensible ones, MinProblemSolver::setFunction() should be called upon the obtained + object, if the function was not given to create(). Otherwise, the two ways (submit it to + create() or miss it out and call the MinProblemSolver::setFunction()) are absolutely equivalent + (and will drop the same errors in the same way, should invalid input be detected). + @param f Pointer to the function that will be minimized, similarly to the one you submit via + MinProblemSolver::setFunction. + @param termcrit Terminal criteria to the algorithm, similarly to the one you submit via + MinProblemSolver::setTermCriteria. + */ + static Ptr create(const Ptr& f=Ptr(), + TermCriteria termcrit=TermCriteria(TermCriteria::MAX_ITER+TermCriteria::EPS,5000,0.000001)); +}; + +//! return codes for cv::solveLP() function +enum SolveLPResult +{ + SOLVELP_UNBOUNDED = -2, //!< problem is unbounded (target function can achieve arbitrary high values) + SOLVELP_UNFEASIBLE = -1, //!< problem is unfeasible (there are no points that satisfy all the constraints imposed) + SOLVELP_SINGLE = 0, //!< there is only one maximum for target function + SOLVELP_MULTI = 1 //!< there are multiple maxima for target function - the arbitrary one is returned +}; + +/** @brief Solve given (non-integer) linear programming problem using the Simplex Algorithm (Simplex Method). + +What we mean here by "linear programming problem" (or LP problem, for short) can be formulated as: + +\f[\mbox{Maximize } c\cdot x\\ + \mbox{Subject to:}\\ + Ax\leq b\\ + x\geq 0\f] + +Where \f$c\f$ is fixed `1`-by-`n` row-vector, \f$A\f$ is fixed `m`-by-`n` matrix, \f$b\f$ is fixed `m`-by-`1` +column vector and \f$x\f$ is an arbitrary `n`-by-`1` column vector, which satisfies the constraints. + +Simplex algorithm is one of many algorithms that are designed to handle this sort of problems +efficiently. Although it is not optimal in theoretical sense (there exist algorithms that can solve +any problem written as above in polynomial time, while simplex method degenerates to exponential +time for some special cases), it is well-studied, easy to implement and is shown to work well for +real-life purposes. + +The particular implementation is taken almost verbatim from **Introduction to Algorithms, third +edition** by T. H. Cormen, C. E. Leiserson, R. L. Rivest and Clifford Stein. In particular, the +Bland's rule is used to prevent cycling. + +@param Func This row-vector corresponds to \f$c\f$ in the LP problem formulation (see above). It should +contain 32- or 64-bit floating point numbers. As a convenience, column-vector may be also submitted, +in the latter case it is understood to correspond to \f$c^T\f$. +@param Constr `m`-by-`n+1` matrix, whose rightmost column corresponds to \f$b\f$ in formulation above +and the remaining to \f$A\f$. It should containt 32- or 64-bit floating point numbers. +@param z The solution will be returned here as a column-vector - it corresponds to \f$c\f$ in the +formulation above. It will contain 64-bit floating point numbers. +@return One of cv::SolveLPResult + */ +CV_EXPORTS_W int solveLP(const Mat& Func, const Mat& Constr, Mat& z); + +//! @} + +}// cv + +#endif diff --git a/lib/opencv/include/opencv2/core/persistence.hpp b/lib/opencv/include/opencv2/core/persistence.hpp new file mode 100644 index 000000000..17686dd0d --- /dev/null +++ b/lib/opencv/include/opencv2/core/persistence.hpp @@ -0,0 +1,1195 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_PERSISTENCE_HPP__ +#define __OPENCV_CORE_PERSISTENCE_HPP__ + +#ifndef __cplusplus +# error persistence.hpp header must be compiled as C++ +#endif + +//! @addtogroup core_c +//! @{ + +/** @brief "black box" representation of the file storage associated with a file on disk. + +Several functions that are described below take CvFileStorage\* as inputs and allow the user to +save or to load hierarchical collections that consist of scalar values, standard CXCore objects +(such as matrices, sequences, graphs), and user-defined objects. + +OpenCV can read and write data in XML () or YAML () +formats. Below is an example of 3x3 floating-point identity matrix A, stored in XML and YAML files +using CXCore functions: +XML: +@code{.xml} + + + + 3 + 3 +
f
+ 1. 0. 0. 0. 1. 0. 0. 0. 1. +
+
+@endcode +YAML: +@code{.yaml} + %YAML:1.0 + A: !!opencv-matrix + rows: 3 + cols: 3 + dt: f + data: [ 1., 0., 0., 0., 1., 0., 0., 0., 1.] +@endcode +As it can be seen from the examples, XML uses nested tags to represent hierarchy, while YAML uses +indentation for that purpose (similar to the Python programming language). + +The same functions can read and write data in both formats; the particular format is determined by +the extension of the opened file, ".xml" for XML files and ".yml" or ".yaml" for YAML. + */ +typedef struct CvFileStorage CvFileStorage; +typedef struct CvFileNode CvFileNode; + +//! @} core_c + +#include "opencv2/core/types.hpp" +#include "opencv2/core/mat.hpp" + +namespace cv { + +/** @addtogroup core_xml + +XML/YAML file storages. {#xml_storage} +======================= +Writing to a file storage. +-------------------------- +You can store and then restore various OpenCV data structures to/from XML () +or YAML () formats. Also, it is possible store and load arbitrarily complex +data structures, which include OpenCV data structures, as well as primitive data types (integer and +floating-point numbers and text strings) as their elements. + +Use the following procedure to write something to XML or YAML: +-# Create new FileStorage and open it for writing. It can be done with a single call to +FileStorage::FileStorage constructor that takes a filename, or you can use the default constructor +and then call FileStorage::open. Format of the file (XML or YAML) is determined from the filename +extension (".xml" and ".yml"/".yaml", respectively) +-# Write all the data you want using the streaming operator `<<`, just like in the case of STL +streams. +-# Close the file using FileStorage::release. FileStorage destructor also closes the file. + +Here is an example: +@code + #include "opencv2/opencv.hpp" + #include + + using namespace cv; + + int main(int, char** argv) + { + FileStorage fs("test.yml", FileStorage::WRITE); + + fs << "frameCount" << 5; + time_t rawtime; time(&rawtime); + fs << "calibrationDate" << asctime(localtime(&rawtime)); + Mat cameraMatrix = (Mat_(3,3) << 1000, 0, 320, 0, 1000, 240, 0, 0, 1); + Mat distCoeffs = (Mat_(5,1) << 0.1, 0.01, -0.001, 0, 0); + fs << "cameraMatrix" << cameraMatrix << "distCoeffs" << distCoeffs; + fs << "features" << "["; + for( int i = 0; i < 3; i++ ) + { + int x = rand() % 640; + int y = rand() % 480; + uchar lbp = rand() % 256; + + fs << "{:" << "x" << x << "y" << y << "lbp" << "[:"; + for( int j = 0; j < 8; j++ ) + fs << ((lbp >> j) & 1); + fs << "]" << "}"; + } + fs << "]"; + fs.release(); + return 0; + } +@endcode +The sample above stores to XML and integer, text string (calibration date), 2 matrices, and a custom +structure "feature", which includes feature coordinates and LBP (local binary pattern) value. Here +is output of the sample: +@code{.yaml} +%YAML:1.0 +frameCount: 5 +calibrationDate: "Fri Jun 17 14:09:29 2011\n" +cameraMatrix: !!opencv-matrix + rows: 3 + cols: 3 + dt: d + data: [ 1000., 0., 320., 0., 1000., 240., 0., 0., 1. ] +distCoeffs: !!opencv-matrix + rows: 5 + cols: 1 + dt: d + data: [ 1.0000000000000001e-01, 1.0000000000000000e-02, + -1.0000000000000000e-03, 0., 0. ] +features: + - { x:167, y:49, lbp:[ 1, 0, 0, 1, 1, 0, 1, 1 ] } + - { x:298, y:130, lbp:[ 0, 0, 0, 1, 0, 0, 1, 1 ] } + - { x:344, y:158, lbp:[ 1, 1, 0, 0, 0, 0, 1, 0 ] } +@endcode + +As an exercise, you can replace ".yml" with ".xml" in the sample above and see, how the +corresponding XML file will look like. + +Several things can be noted by looking at the sample code and the output: + +- The produced YAML (and XML) consists of heterogeneous collections that can be nested. There are 2 + types of collections: named collections (mappings) and unnamed collections (sequences). In mappings + each element has a name and is accessed by name. This is similar to structures and std::map in + C/C++ and dictionaries in Python. In sequences elements do not have names, they are accessed by + indices. This is similar to arrays and std::vector in C/C++ and lists, tuples in Python. + "Heterogeneous" means that elements of each single collection can have different types. + + Top-level collection in YAML/XML is a mapping. Each matrix is stored as a mapping, and the matrix + elements are stored as a sequence. Then, there is a sequence of features, where each feature is + represented a mapping, and lbp value in a nested sequence. + +- When you write to a mapping (a structure), you write element name followed by its value. When you + write to a sequence, you simply write the elements one by one. OpenCV data structures (such as + cv::Mat) are written in absolutely the same way as simple C data structures - using `<<` + operator. + +- To write a mapping, you first write the special string `{` to the storage, then write the + elements as pairs (`fs << << `) and then write the closing + `}`. + +- To write a sequence, you first write the special string `[`, then write the elements, then + write the closing `]`. + +- In YAML (but not XML), mappings and sequences can be written in a compact Python-like inline + form. In the sample above matrix elements, as well as each feature, including its lbp value, is + stored in such inline form. To store a mapping/sequence in a compact form, put `:` after the + opening character, e.g. use `{:` instead of `{` and `[:` instead of `[`. When the + data is written to XML, those extra `:` are ignored. + +Reading data from a file storage. +--------------------------------- +To read the previously written XML or YAML file, do the following: +-# Open the file storage using FileStorage::FileStorage constructor or FileStorage::open method. + In the current implementation the whole file is parsed and the whole representation of file + storage is built in memory as a hierarchy of file nodes (see FileNode) + +-# Read the data you are interested in. Use FileStorage::operator [], FileNode::operator [] + and/or FileNodeIterator. + +-# Close the storage using FileStorage::release. + +Here is how to read the file created by the code sample above: +@code + FileStorage fs2("test.yml", FileStorage::READ); + + // first method: use (type) operator on FileNode. + int frameCount = (int)fs2["frameCount"]; + + String date; + // second method: use FileNode::operator >> + fs2["calibrationDate"] >> date; + + Mat cameraMatrix2, distCoeffs2; + fs2["cameraMatrix"] >> cameraMatrix2; + fs2["distCoeffs"] >> distCoeffs2; + + cout << "frameCount: " << frameCount << endl + << "calibration date: " << date << endl + << "camera matrix: " << cameraMatrix2 << endl + << "distortion coeffs: " << distCoeffs2 << endl; + + FileNode features = fs2["features"]; + FileNodeIterator it = features.begin(), it_end = features.end(); + int idx = 0; + std::vector lbpval; + + // iterate through a sequence using FileNodeIterator + for( ; it != it_end; ++it, idx++ ) + { + cout << "feature #" << idx << ": "; + cout << "x=" << (int)(*it)["x"] << ", y=" << (int)(*it)["y"] << ", lbp: ("; + // you can also easily read numerical arrays using FileNode >> std::vector operator. + (*it)["lbp"] >> lbpval; + for( int i = 0; i < (int)lbpval.size(); i++ ) + cout << " " << (int)lbpval[i]; + cout << ")" << endl; + } + fs2.release(); +@endcode + +Format specification {#format_spec} +-------------------- +`([count]{u|c|w|s|i|f|d})`... where the characters correspond to fundamental C++ types: +- `u` 8-bit unsigned number +- `c` 8-bit signed number +- `w` 16-bit unsigned number +- `s` 16-bit signed number +- `i` 32-bit signed number +- `f` single precision floating-point number +- `d` double precision floating-point number +- `r` pointer, 32 lower bits of which are written as a signed integer. The type can be used to + store structures with links between the elements. + +`count` is the optional counter of values of a given type. For example, `2if` means that each array +element is a structure of 2 integers, followed by a single-precision floating-point number. The +equivalent notations of the above specification are `iif`, `2i1f` and so forth. Other examples: `u` +means that the array consists of bytes, and `2d` means the array consists of pairs of doubles. + +@see @ref filestorage.cpp +*/ + +//! @{ + +/** @example filestorage.cpp +A complete example using the FileStorage interface +*/ + +////////////////////////// XML & YAML I/O ////////////////////////// + +class CV_EXPORTS FileNode; +class CV_EXPORTS FileNodeIterator; + +/** @brief XML/YAML file storage class that encapsulates all the information necessary for writing or reading +data to/from a file. + */ +class CV_EXPORTS_W FileStorage +{ +public: + //! file storage mode + enum Mode + { + READ = 0, //!< value, open the file for reading + WRITE = 1, //!< value, open the file for writing + APPEND = 2, //!< value, open the file for appending + MEMORY = 4, //!< flag, read data from source or write data to the internal buffer (which is + //!< returned by FileStorage::release) + FORMAT_MASK = (7<<3), //!< mask for format flags + FORMAT_AUTO = 0, //!< flag, auto format + FORMAT_XML = (1<<3), //!< flag, XML format + FORMAT_YAML = (2<<3) //!< flag, YAML format + }; + enum + { + UNDEFINED = 0, + VALUE_EXPECTED = 1, + NAME_EXPECTED = 2, + INSIDE_MAP = 4 + }; + + /** @brief The constructors. + + The full constructor opens the file. Alternatively you can use the default constructor and then + call FileStorage::open. + */ + CV_WRAP FileStorage(); + + /** @overload + @param source Name of the file to open or the text string to read the data from. Extension of the + file (.xml or .yml/.yaml) determines its format (XML or YAML respectively). Also you can append .gz + to work with compressed files, for example myHugeMatrix.xml.gz. If both FileStorage::WRITE and + FileStorage::MEMORY flags are specified, source is used just to specify the output file format (e.g. + mydata.xml, .yml etc.). + @param flags Mode of operation. See FileStorage::Mode + @param encoding Encoding of the file. Note that UTF-16 XML encoding is not supported currently and + you should use 8-bit encoding instead of it. + */ + CV_WRAP FileStorage(const String& source, int flags, const String& encoding=String()); + + /** @overload */ + FileStorage(CvFileStorage* fs, bool owning=true); + + //! the destructor. calls release() + virtual ~FileStorage(); + + /** @brief Opens a file. + + See description of parameters in FileStorage::FileStorage. The method calls FileStorage::release + before opening the file. + @param filename Name of the file to open or the text string to read the data from. + Extension of the file (.xml or .yml/.yaml) determines its format (XML or YAML respectively). + Also you can append .gz to work with compressed files, for example myHugeMatrix.xml.gz. If both + FileStorage::WRITE and FileStorage::MEMORY flags are specified, source is used just to specify + the output file format (e.g. mydata.xml, .yml etc.). + @param flags Mode of operation. One of FileStorage::Mode + @param encoding Encoding of the file. Note that UTF-16 XML encoding is not supported currently and + you should use 8-bit encoding instead of it. + */ + CV_WRAP virtual bool open(const String& filename, int flags, const String& encoding=String()); + + /** @brief Checks whether the file is opened. + + @returns true if the object is associated with the current file and false otherwise. It is a + good practice to call this method after you tried to open a file. + */ + CV_WRAP virtual bool isOpened() const; + + /** @brief Closes the file and releases all the memory buffers. + + Call this method after all I/O operations with the storage are finished. + */ + CV_WRAP virtual void release(); + + /** @brief Closes the file and releases all the memory buffers. + + Call this method after all I/O operations with the storage are finished. If the storage was + opened for writing data and FileStorage::WRITE was specified + */ + CV_WRAP virtual String releaseAndGetString(); + + /** @brief Returns the first element of the top-level mapping. + @returns The first element of the top-level mapping. + */ + CV_WRAP FileNode getFirstTopLevelNode() const; + + /** @brief Returns the top-level mapping + @param streamidx Zero-based index of the stream. In most cases there is only one stream in the file. + However, YAML supports multiple streams and so there can be several. + @returns The top-level mapping. + */ + CV_WRAP FileNode root(int streamidx=0) const; + + /** @brief Returns the specified element of the top-level mapping. + @param nodename Name of the file node. + @returns Node with the given name. + */ + FileNode operator[](const String& nodename) const; + + /** @overload */ + CV_WRAP FileNode operator[](const char* nodename) const; + + /** @brief Returns the obsolete C FileStorage structure. + @returns Pointer to the underlying C FileStorage structure + */ + CvFileStorage* operator *() { return fs.get(); } + + /** @overload */ + const CvFileStorage* operator *() const { return fs.get(); } + + /** @brief Writes multiple numbers. + + Writes one or more numbers of the specified format to the currently written structure. Usually it is + more convenient to use operator `<<` instead of this method. + @param fmt Specification of each array element, see @ref format_spec "format specification" + @param vec Pointer to the written array. + @param len Number of the uchar elements to write. + */ + void writeRaw( const String& fmt, const uchar* vec, size_t len ); + + /** @brief Writes the registered C structure (CvMat, CvMatND, CvSeq). + @param name Name of the written object. + @param obj Pointer to the object. + @see ocvWrite for details. + */ + void writeObj( const String& name, const void* obj ); + + /** @brief Returns the normalized object name for the specified name of a file. + @param filename Name of a file + @returns The normalized object name. + */ + static String getDefaultObjectName(const String& filename); + + Ptr fs; //!< the underlying C FileStorage structure + String elname; //!< the currently written element + std::vector structs; //!< the stack of written structures + int state; //!< the writer state +}; + +template<> CV_EXPORTS void DefaultDeleter::operator ()(CvFileStorage* obj) const; + +/** @brief File Storage Node class. + +The node is used to store each and every element of the file storage opened for reading. When +XML/YAML file is read, it is first parsed and stored in the memory as a hierarchical collection of +nodes. Each node can be a “leaf” that is contain a single number or a string, or be a collection of +other nodes. There can be named collections (mappings) where each element has a name and it is +accessed by a name, and ordered collections (sequences) where elements do not have names but rather +accessed by index. Type of the file node can be determined using FileNode::type method. + +Note that file nodes are only used for navigating file storages opened for reading. When a file +storage is opened for writing, no data is stored in memory after it is written. + */ +class CV_EXPORTS_W_SIMPLE FileNode +{ +public: + //! type of the file storage node + enum Type + { + NONE = 0, //!< empty node + INT = 1, //!< an integer + REAL = 2, //!< floating-point number + FLOAT = REAL, //!< synonym or REAL + STR = 3, //!< text string in UTF-8 encoding + STRING = STR, //!< synonym for STR + REF = 4, //!< integer of size size_t. Typically used for storing complex dynamic structures where some elements reference the others + SEQ = 5, //!< sequence + MAP = 6, //!< mapping + TYPE_MASK = 7, + FLOW = 8, //!< compact representation of a sequence or mapping. Used only by YAML writer + USER = 16, //!< a registered object (e.g. a matrix) + EMPTY = 32, //!< empty structure (sequence or mapping) + NAMED = 64 //!< the node has a name (i.e. it is element of a mapping) + }; + /** @brief The constructors. + + These constructors are used to create a default file node, construct it from obsolete structures or + from the another file node. + */ + CV_WRAP FileNode(); + + /** @overload + @param fs Pointer to the obsolete file storage structure. + @param node File node to be used as initialization for the created file node. + */ + FileNode(const CvFileStorage* fs, const CvFileNode* node); + + /** @overload + @param node File node to be used as initialization for the created file node. + */ + FileNode(const FileNode& node); + + /** @brief Returns element of a mapping node or a sequence node. + @param nodename Name of an element in the mapping node. + @returns Returns the element with the given identifier. + */ + FileNode operator[](const String& nodename) const; + + /** @overload + @param nodename Name of an element in the mapping node. + */ + CV_WRAP FileNode operator[](const char* nodename) const; + + /** @overload + @param i Index of an element in the sequence node. + */ + CV_WRAP FileNode operator[](int i) const; + + /** @brief Returns type of the node. + @returns Type of the node. See FileNode::Type + */ + CV_WRAP int type() const; + + //! returns true if the node is empty + CV_WRAP bool empty() const; + //! returns true if the node is a "none" object + CV_WRAP bool isNone() const; + //! returns true if the node is a sequence + CV_WRAP bool isSeq() const; + //! returns true if the node is a mapping + CV_WRAP bool isMap() const; + //! returns true if the node is an integer + CV_WRAP bool isInt() const; + //! returns true if the node is a floating-point number + CV_WRAP bool isReal() const; + //! returns true if the node is a text string + CV_WRAP bool isString() const; + //! returns true if the node has a name + CV_WRAP bool isNamed() const; + //! returns the node name or an empty string if the node is nameless + CV_WRAP String name() const; + //! returns the number of elements in the node, if it is a sequence or mapping, or 1 otherwise. + CV_WRAP size_t size() const; + //! returns the node content as an integer. If the node stores floating-point number, it is rounded. + operator int() const; + //! returns the node content as float + operator float() const; + //! returns the node content as double + operator double() const; + //! returns the node content as text string + operator String() const; +#ifndef OPENCV_NOSTL + operator std::string() const; +#endif + + //! returns pointer to the underlying file node + CvFileNode* operator *(); + //! returns pointer to the underlying file node + const CvFileNode* operator* () const; + + //! returns iterator pointing to the first node element + FileNodeIterator begin() const; + //! returns iterator pointing to the element following the last node element + FileNodeIterator end() const; + + /** @brief Reads node elements to the buffer with the specified format. + + Usually it is more convenient to use operator `>>` instead of this method. + @param fmt Specification of each array element. See @ref format_spec "format specification" + @param vec Pointer to the destination array. + @param len Number of elements to read. If it is greater than number of remaining elements then all + of them will be read. + */ + void readRaw( const String& fmt, uchar* vec, size_t len ) const; + + //! reads the registered object and returns pointer to it + void* readObj() const; + + // do not use wrapper pointer classes for better efficiency + const CvFileStorage* fs; + const CvFileNode* node; +}; + + +/** @brief used to iterate through sequences and mappings. + +A standard STL notation, with node.begin(), node.end() denoting the beginning and the end of a +sequence, stored in node. See the data reading sample in the beginning of the section. + */ +class CV_EXPORTS FileNodeIterator +{ +public: + /** @brief The constructors. + + These constructors are used to create a default iterator, set it to specific element in a file node + or construct it from another iterator. + */ + FileNodeIterator(); + + /** @overload + @param fs File storage for the iterator. + @param node File node for the iterator. + @param ofs Index of the element in the node. The created iterator will point to this element. + */ + FileNodeIterator(const CvFileStorage* fs, const CvFileNode* node, size_t ofs=0); + + /** @overload + @param it Iterator to be used as initialization for the created iterator. + */ + FileNodeIterator(const FileNodeIterator& it); + + //! returns the currently observed element + FileNode operator *() const; + //! accesses the currently observed element methods + FileNode operator ->() const; + + //! moves iterator to the next node + FileNodeIterator& operator ++ (); + //! moves iterator to the next node + FileNodeIterator operator ++ (int); + //! moves iterator to the previous node + FileNodeIterator& operator -- (); + //! moves iterator to the previous node + FileNodeIterator operator -- (int); + //! moves iterator forward by the specified offset (possibly negative) + FileNodeIterator& operator += (int ofs); + //! moves iterator backward by the specified offset (possibly negative) + FileNodeIterator& operator -= (int ofs); + + /** @brief Reads node elements to the buffer with the specified format. + + Usually it is more convenient to use operator `>>` instead of this method. + @param fmt Specification of each array element. See @ref format_spec "format specification" + @param vec Pointer to the destination array. + @param maxCount Number of elements to read. If it is greater than number of remaining elements then + all of them will be read. + */ + FileNodeIterator& readRaw( const String& fmt, uchar* vec, + size_t maxCount=(size_t)INT_MAX ); + + struct SeqReader + { + int header_size; + void* seq; /* sequence, beign read; CvSeq */ + void* block; /* current block; CvSeqBlock */ + schar* ptr; /* pointer to element be read next */ + schar* block_min; /* pointer to the beginning of block */ + schar* block_max; /* pointer to the end of block */ + int delta_index;/* = seq->first->start_index */ + schar* prev_elem; /* pointer to previous element */ + }; + + const CvFileStorage* fs; + const CvFileNode* container; + SeqReader reader; + size_t remaining; +}; + +//! @} core_xml + +/////////////////// XML & YAML I/O implementation ////////////////// + +//! @relates cv::FileStorage +//! @{ + +CV_EXPORTS void write( FileStorage& fs, const String& name, int value ); +CV_EXPORTS void write( FileStorage& fs, const String& name, float value ); +CV_EXPORTS void write( FileStorage& fs, const String& name, double value ); +CV_EXPORTS void write( FileStorage& fs, const String& name, const String& value ); +CV_EXPORTS void write( FileStorage& fs, const String& name, const Mat& value ); +CV_EXPORTS void write( FileStorage& fs, const String& name, const SparseMat& value ); +CV_EXPORTS void write( FileStorage& fs, const String& name, const std::vector& value); +CV_EXPORTS void write( FileStorage& fs, const String& name, const std::vector& value); + +CV_EXPORTS void writeScalar( FileStorage& fs, int value ); +CV_EXPORTS void writeScalar( FileStorage& fs, float value ); +CV_EXPORTS void writeScalar( FileStorage& fs, double value ); +CV_EXPORTS void writeScalar( FileStorage& fs, const String& value ); + +//! @} + +//! @relates cv::FileNode +//! @{ + +CV_EXPORTS void read(const FileNode& node, int& value, int default_value); +CV_EXPORTS void read(const FileNode& node, float& value, float default_value); +CV_EXPORTS void read(const FileNode& node, double& value, double default_value); +CV_EXPORTS void read(const FileNode& node, String& value, const String& default_value); +CV_EXPORTS void read(const FileNode& node, Mat& mat, const Mat& default_mat = Mat() ); +CV_EXPORTS void read(const FileNode& node, SparseMat& mat, const SparseMat& default_mat = SparseMat() ); +CV_EXPORTS void read(const FileNode& node, std::vector& keypoints); +CV_EXPORTS void read(const FileNode& node, std::vector& matches); + +template static inline void read(const FileNode& node, Point_<_Tp>& value, const Point_<_Tp>& default_value) +{ + std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp; + value = temp.size() != 2 ? default_value : Point_<_Tp>(saturate_cast<_Tp>(temp[0]), saturate_cast<_Tp>(temp[1])); +} + +template static inline void read(const FileNode& node, Point3_<_Tp>& value, const Point3_<_Tp>& default_value) +{ + std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp; + value = temp.size() != 3 ? default_value : Point3_<_Tp>(saturate_cast<_Tp>(temp[0]), saturate_cast<_Tp>(temp[1]), + saturate_cast<_Tp>(temp[2])); +} + +template static inline void read(const FileNode& node, Size_<_Tp>& value, const Size_<_Tp>& default_value) +{ + std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp; + value = temp.size() != 2 ? default_value : Size_<_Tp>(saturate_cast<_Tp>(temp[0]), saturate_cast<_Tp>(temp[1])); +} + +template static inline void read(const FileNode& node, Complex<_Tp>& value, const Complex<_Tp>& default_value) +{ + std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp; + value = temp.size() != 2 ? default_value : Complex<_Tp>(saturate_cast<_Tp>(temp[0]), saturate_cast<_Tp>(temp[1])); +} + +template static inline void read(const FileNode& node, Rect_<_Tp>& value, const Rect_<_Tp>& default_value) +{ + std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp; + value = temp.size() != 4 ? default_value : Rect_<_Tp>(saturate_cast<_Tp>(temp[0]), saturate_cast<_Tp>(temp[1]), + saturate_cast<_Tp>(temp[2]), saturate_cast<_Tp>(temp[3])); +} + +template static inline void read(const FileNode& node, Vec<_Tp, cn>& value, const Vec<_Tp, cn>& default_value) +{ + std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp; + value = temp.size() != cn ? default_value : Vec<_Tp, cn>(&temp[0]); +} + +template static inline void read(const FileNode& node, Scalar_<_Tp>& value, const Scalar_<_Tp>& default_value) +{ + std::vector<_Tp> temp; FileNodeIterator it = node.begin(); it >> temp; + value = temp.size() != 4 ? default_value : Scalar_<_Tp>(saturate_cast<_Tp>(temp[0]), saturate_cast<_Tp>(temp[1]), + saturate_cast<_Tp>(temp[2]), saturate_cast<_Tp>(temp[3])); +} + +static inline void read(const FileNode& node, Range& value, const Range& default_value) +{ + Point2i temp(value.start, value.end); const Point2i default_temp = Point2i(default_value.start, default_value.end); + read(node, temp, default_temp); + value.start = temp.x; value.end = temp.y; +} + +//! @} + +/** @brief Writes string to a file storage. +@relates cv::FileStorage + */ +CV_EXPORTS FileStorage& operator << (FileStorage& fs, const String& str); + +//! @cond IGNORED + +namespace internal +{ + class CV_EXPORTS WriteStructContext + { + public: + WriteStructContext(FileStorage& _fs, const String& name, int flags, const String& typeName = String()); + ~WriteStructContext(); + private: + FileStorage* fs; + }; + + template class VecWriterProxy + { + public: + VecWriterProxy( FileStorage* _fs ) : fs(_fs) {} + void operator()(const std::vector<_Tp>& vec) const + { + size_t count = vec.size(); + for (size_t i = 0; i < count; i++) + write(*fs, vec[i]); + } + private: + FileStorage* fs; + }; + + template class VecWriterProxy<_Tp, 1> + { + public: + VecWriterProxy( FileStorage* _fs ) : fs(_fs) {} + void operator()(const std::vector<_Tp>& vec) const + { + int _fmt = DataType<_Tp>::fmt; + char fmt[] = { (char)((_fmt >> 8) + '1'), (char)_fmt, '\0' }; + fs->writeRaw(fmt, !vec.empty() ? (uchar*)&vec[0] : 0, vec.size() * sizeof(_Tp)); + } + private: + FileStorage* fs; + }; + + template class VecReaderProxy + { + public: + VecReaderProxy( FileNodeIterator* _it ) : it(_it) {} + void operator()(std::vector<_Tp>& vec, size_t count) const + { + count = std::min(count, it->remaining); + vec.resize(count); + for (size_t i = 0; i < count; i++, ++(*it)) + read(**it, vec[i], _Tp()); + } + private: + FileNodeIterator* it; + }; + + template class VecReaderProxy<_Tp, 1> + { + public: + VecReaderProxy( FileNodeIterator* _it ) : it(_it) {} + void operator()(std::vector<_Tp>& vec, size_t count) const + { + size_t remaining = it->remaining; + size_t cn = DataType<_Tp>::channels; + int _fmt = DataType<_Tp>::fmt; + char fmt[] = { (char)((_fmt >> 8)+'1'), (char)_fmt, '\0' }; + size_t remaining1 = remaining / cn; + count = count < remaining1 ? count : remaining1; + vec.resize(count); + it->readRaw(fmt, !vec.empty() ? (uchar*)&vec[0] : 0, count*sizeof(_Tp)); + } + private: + FileNodeIterator* it; + }; + +} // internal + +//! @endcond + +//! @relates cv::FileStorage +//! @{ + +template static inline +void write(FileStorage& fs, const _Tp& value) +{ + write(fs, String(), value); +} + +template<> inline +void write( FileStorage& fs, const int& value ) +{ + writeScalar(fs, value); +} + +template<> inline +void write( FileStorage& fs, const float& value ) +{ + writeScalar(fs, value); +} + +template<> inline +void write( FileStorage& fs, const double& value ) +{ + writeScalar(fs, value); +} + +template<> inline +void write( FileStorage& fs, const String& value ) +{ + writeScalar(fs, value); +} + +template static inline +void write(FileStorage& fs, const Point_<_Tp>& pt ) +{ + write(fs, pt.x); + write(fs, pt.y); +} + +template static inline +void write(FileStorage& fs, const Point3_<_Tp>& pt ) +{ + write(fs, pt.x); + write(fs, pt.y); + write(fs, pt.z); +} + +template static inline +void write(FileStorage& fs, const Size_<_Tp>& sz ) +{ + write(fs, sz.width); + write(fs, sz.height); +} + +template static inline +void write(FileStorage& fs, const Complex<_Tp>& c ) +{ + write(fs, c.re); + write(fs, c.im); +} + +template static inline +void write(FileStorage& fs, const Rect_<_Tp>& r ) +{ + write(fs, r.x); + write(fs, r.y); + write(fs, r.width); + write(fs, r.height); +} + +template static inline +void write(FileStorage& fs, const Vec<_Tp, cn>& v ) +{ + for(int i = 0; i < cn; i++) + write(fs, v.val[i]); +} + +template static inline +void write(FileStorage& fs, const Scalar_<_Tp>& s ) +{ + write(fs, s.val[0]); + write(fs, s.val[1]); + write(fs, s.val[2]); + write(fs, s.val[3]); +} + +static inline +void write(FileStorage& fs, const Range& r ) +{ + write(fs, r.start); + write(fs, r.end); +} + +template static inline +void write( FileStorage& fs, const std::vector<_Tp>& vec ) +{ + cv::internal::VecWriterProxy<_Tp, DataType<_Tp>::fmt != 0> w(&fs); + w(vec); +} + + +template static inline +void write(FileStorage& fs, const String& name, const Point_<_Tp>& pt ) +{ + cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); + write(fs, pt); +} + +template static inline +void write(FileStorage& fs, const String& name, const Point3_<_Tp>& pt ) +{ + cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); + write(fs, pt); +} + +template static inline +void write(FileStorage& fs, const String& name, const Size_<_Tp>& sz ) +{ + cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); + write(fs, sz); +} + +template static inline +void write(FileStorage& fs, const String& name, const Complex<_Tp>& c ) +{ + cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); + write(fs, c); +} + +template static inline +void write(FileStorage& fs, const String& name, const Rect_<_Tp>& r ) +{ + cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); + write(fs, r); +} + +template static inline +void write(FileStorage& fs, const String& name, const Vec<_Tp, cn>& v ) +{ + cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); + write(fs, v); +} + +template static inline +void write(FileStorage& fs, const String& name, const Scalar_<_Tp>& s ) +{ + cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); + write(fs, s); +} + +static inline +void write(FileStorage& fs, const String& name, const Range& r ) +{ + cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); + write(fs, r); +} + +template static inline +void write( FileStorage& fs, const String& name, const std::vector<_Tp>& vec ) +{ + cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+(DataType<_Tp>::fmt != 0 ? FileNode::FLOW : 0)); + write(fs, vec); +} + +//! @} FileStorage + +//! @relates cv::FileNode +//! @{ + +static inline +void read(const FileNode& node, bool& value, bool default_value) +{ + int temp; + read(node, temp, (int)default_value); + value = temp != 0; +} + +static inline +void read(const FileNode& node, uchar& value, uchar default_value) +{ + int temp; + read(node, temp, (int)default_value); + value = saturate_cast(temp); +} + +static inline +void read(const FileNode& node, schar& value, schar default_value) +{ + int temp; + read(node, temp, (int)default_value); + value = saturate_cast(temp); +} + +static inline +void read(const FileNode& node, ushort& value, ushort default_value) +{ + int temp; + read(node, temp, (int)default_value); + value = saturate_cast(temp); +} + +static inline +void read(const FileNode& node, short& value, short default_value) +{ + int temp; + read(node, temp, (int)default_value); + value = saturate_cast(temp); +} + +template static inline +void read( FileNodeIterator& it, std::vector<_Tp>& vec, size_t maxCount = (size_t)INT_MAX ) +{ + cv::internal::VecReaderProxy<_Tp, DataType<_Tp>::fmt != 0> r(&it); + r(vec, maxCount); +} + +template static inline +void read( const FileNode& node, std::vector<_Tp>& vec, const std::vector<_Tp>& default_value = std::vector<_Tp>() ) +{ + if(!node.node) + vec = default_value; + else + { + FileNodeIterator it = node.begin(); + read( it, vec ); + } +} + +//! @} FileNode + +//! @relates cv::FileStorage +//! @{ + +/** @brief Writes data to a file storage. + */ +template static inline +FileStorage& operator << (FileStorage& fs, const _Tp& value) +{ + if( !fs.isOpened() ) + return fs; + if( fs.state == FileStorage::NAME_EXPECTED + FileStorage::INSIDE_MAP ) + CV_Error( Error::StsError, "No element name has been given" ); + write( fs, fs.elname, value ); + if( fs.state & FileStorage::INSIDE_MAP ) + fs.state = FileStorage::NAME_EXPECTED + FileStorage::INSIDE_MAP; + return fs; +} + +/** @brief Writes data to a file storage. + */ +static inline +FileStorage& operator << (FileStorage& fs, const char* str) +{ + return (fs << String(str)); +} + +/** @brief Writes data to a file storage. + */ +static inline +FileStorage& operator << (FileStorage& fs, char* value) +{ + return (fs << String(value)); +} + +//! @} FileStorage + +//! @relates cv::FileNodeIterator +//! @{ + +/** @brief Reads data from a file storage. + */ +template static inline +FileNodeIterator& operator >> (FileNodeIterator& it, _Tp& value) +{ + read( *it, value, _Tp()); + return ++it; +} + +/** @brief Reads data from a file storage. + */ +template static inline +FileNodeIterator& operator >> (FileNodeIterator& it, std::vector<_Tp>& vec) +{ + cv::internal::VecReaderProxy<_Tp, DataType<_Tp>::fmt != 0> r(&it); + r(vec, (size_t)INT_MAX); + return it; +} + +//! @} FileNodeIterator + +//! @relates cv::FileNode +//! @{ + +/** @brief Reads data from a file storage. + */ +template static inline +void operator >> (const FileNode& n, _Tp& value) +{ + read( n, value, _Tp()); +} + +/** @brief Reads data from a file storage. + */ +template static inline +void operator >> (const FileNode& n, std::vector<_Tp>& vec) +{ + FileNodeIterator it = n.begin(); + it >> vec; +} + +//! @} FileNode + +//! @relates cv::FileNodeIterator +//! @{ + +static inline +bool operator == (const FileNodeIterator& it1, const FileNodeIterator& it2) +{ + return it1.fs == it2.fs && it1.container == it2.container && + it1.reader.ptr == it2.reader.ptr && it1.remaining == it2.remaining; +} + +static inline +bool operator != (const FileNodeIterator& it1, const FileNodeIterator& it2) +{ + return !(it1 == it2); +} + +static inline +ptrdiff_t operator - (const FileNodeIterator& it1, const FileNodeIterator& it2) +{ + return it2.remaining - it1.remaining; +} + +static inline +bool operator < (const FileNodeIterator& it1, const FileNodeIterator& it2) +{ + return it1.remaining > it2.remaining; +} + +//! @} FileNodeIterator + +//! @cond IGNORED + +inline FileNode FileStorage::getFirstTopLevelNode() const { FileNode r = root(); FileNodeIterator it = r.begin(); return it != r.end() ? *it : FileNode(); } +inline FileNode::FileNode() : fs(0), node(0) {} +inline FileNode::FileNode(const CvFileStorage* _fs, const CvFileNode* _node) : fs(_fs), node(_node) {} +inline FileNode::FileNode(const FileNode& _node) : fs(_node.fs), node(_node.node) {} +inline bool FileNode::empty() const { return node == 0; } +inline bool FileNode::isNone() const { return type() == NONE; } +inline bool FileNode::isSeq() const { return type() == SEQ; } +inline bool FileNode::isMap() const { return type() == MAP; } +inline bool FileNode::isInt() const { return type() == INT; } +inline bool FileNode::isReal() const { return type() == REAL; } +inline bool FileNode::isString() const { return type() == STR; } +inline CvFileNode* FileNode::operator *() { return (CvFileNode*)node; } +inline const CvFileNode* FileNode::operator* () const { return node; } +inline FileNode::operator int() const { int value; read(*this, value, 0); return value; } +inline FileNode::operator float() const { float value; read(*this, value, 0.f); return value; } +inline FileNode::operator double() const { double value; read(*this, value, 0.); return value; } +inline FileNode::operator String() const { String value; read(*this, value, value); return value; } +inline FileNodeIterator FileNode::begin() const { return FileNodeIterator(fs, node); } +inline FileNodeIterator FileNode::end() const { return FileNodeIterator(fs, node, size()); } +inline void FileNode::readRaw( const String& fmt, uchar* vec, size_t len ) const { begin().readRaw( fmt, vec, len ); } +inline FileNode FileNodeIterator::operator *() const { return FileNode(fs, (const CvFileNode*)(const void*)reader.ptr); } +inline FileNode FileNodeIterator::operator ->() const { return FileNode(fs, (const CvFileNode*)(const void*)reader.ptr); } +inline String::String(const FileNode& fn): cstr_(0), len_(0) { read(fn, *this, *this); } + +//! @endcond + +} // cv + +#endif // __OPENCV_CORE_PERSISTENCE_HPP__ diff --git a/lib/opencv/include/opencv2/core/private.cuda.hpp b/lib/opencv/include/opencv2/core/private.cuda.hpp new file mode 100644 index 000000000..d676ce850 --- /dev/null +++ b/lib/opencv/include/opencv2/core/private.cuda.hpp @@ -0,0 +1,172 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_PRIVATE_CUDA_HPP__ +#define __OPENCV_CORE_PRIVATE_CUDA_HPP__ + +#ifndef __OPENCV_BUILD +# error this is a private header which should not be used from outside of the OpenCV library +#endif + +#include "cvconfig.h" + +#include "opencv2/core/cvdef.h" +#include "opencv2/core/base.hpp" + +#include "opencv2/core/cuda.hpp" + +#ifdef HAVE_CUDA +# include +# include +# include +# include "opencv2/core/cuda_stream_accessor.hpp" +# include "opencv2/core/cuda/common.hpp" + +# define NPP_VERSION (NPP_VERSION_MAJOR * 1000 + NPP_VERSION_MINOR * 100 + NPP_VERSION_BUILD) + +# define CUDART_MINIMUM_REQUIRED_VERSION 4020 + +# if (CUDART_VERSION < CUDART_MINIMUM_REQUIRED_VERSION) +# error "Insufficient Cuda Runtime library version, please update it." +# endif + +# if defined(CUDA_ARCH_BIN_OR_PTX_10) +# error "OpenCV CUDA module doesn't support NVIDIA compute capability 1.0" +# endif +#endif + +//! @cond IGNORED + +namespace cv { namespace cuda { + CV_EXPORTS cv::String getNppErrorMessage(int code); + CV_EXPORTS cv::String getCudaDriverApiErrorMessage(int code); + + CV_EXPORTS GpuMat getInputMat(InputArray _src, Stream& stream); + + CV_EXPORTS GpuMat getOutputMat(OutputArray _dst, int rows, int cols, int type, Stream& stream); + static inline GpuMat getOutputMat(OutputArray _dst, Size size, int type, Stream& stream) + { + return getOutputMat(_dst, size.height, size.width, type, stream); + } + + CV_EXPORTS void syncOutput(const GpuMat& dst, OutputArray _dst, Stream& stream); +}} + +#ifndef HAVE_CUDA + +static inline void throw_no_cuda() { CV_Error(cv::Error::GpuNotSupported, "The library is compiled without CUDA support"); } + +#else // HAVE_CUDA + +static inline void throw_no_cuda() { CV_Error(cv::Error::StsNotImplemented, "The called functionality is disabled for current build or platform"); } + +namespace cv { namespace cuda +{ + class CV_EXPORTS BufferPool + { + public: + explicit BufferPool(Stream& stream); + + GpuMat getBuffer(int rows, int cols, int type); + GpuMat getBuffer(Size size, int type) { return getBuffer(size.height, size.width, type); } + + GpuMat::Allocator* getAllocator() const { return allocator_; } + + private: + GpuMat::Allocator* allocator_; + }; + + static inline void checkNppError(int code, const char* file, const int line, const char* func) + { + if (code < 0) + cv::error(cv::Error::GpuApiCallError, getNppErrorMessage(code), func, file, line); + } + + static inline void checkCudaDriverApiError(int code, const char* file, const int line, const char* func) + { + if (code != CUDA_SUCCESS) + cv::error(cv::Error::GpuApiCallError, getCudaDriverApiErrorMessage(code), func, file, line); + } + + template struct NPPTypeTraits; + template<> struct NPPTypeTraits { typedef Npp8u npp_type; }; + template<> struct NPPTypeTraits { typedef Npp8s npp_type; }; + template<> struct NPPTypeTraits { typedef Npp16u npp_type; }; + template<> struct NPPTypeTraits { typedef Npp16s npp_type; }; + template<> struct NPPTypeTraits { typedef Npp32s npp_type; }; + template<> struct NPPTypeTraits { typedef Npp32f npp_type; }; + template<> struct NPPTypeTraits { typedef Npp64f npp_type; }; + + class NppStreamHandler + { + public: + inline explicit NppStreamHandler(Stream& newStream) + { + oldStream = nppGetStream(); + nppSetStream(StreamAccessor::getStream(newStream)); + } + + inline explicit NppStreamHandler(cudaStream_t newStream) + { + oldStream = nppGetStream(); + nppSetStream(newStream); + } + + inline ~NppStreamHandler() + { + nppSetStream(oldStream); + } + + private: + cudaStream_t oldStream; + }; +}} + +#define nppSafeCall(expr) cv::cuda::checkNppError(expr, __FILE__, __LINE__, CV_Func) +#define cuSafeCall(expr) cv::cuda::checkCudaDriverApiError(expr, __FILE__, __LINE__, CV_Func) + +#endif // HAVE_CUDA + +//! @endcond + +#endif // __OPENCV_CORE_CUDA_PRIVATE_HPP__ diff --git a/lib/opencv/include/opencv2/core/private.hpp b/lib/opencv/include/opencv2/core/private.hpp new file mode 100644 index 000000000..c71ec626e --- /dev/null +++ b/lib/opencv/include/opencv2/core/private.hpp @@ -0,0 +1,425 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_PRIVATE_HPP__ +#define __OPENCV_CORE_PRIVATE_HPP__ + +#ifndef __OPENCV_BUILD +# error this is a private header which should not be used from outside of the OpenCV library +#endif + +#include "opencv2/core.hpp" +#include "cvconfig.h" + +#ifdef HAVE_EIGEN +# if defined __GNUC__ && defined __APPLE__ +# pragma GCC diagnostic ignored "-Wshadow" +# endif +# include +# include "opencv2/core/eigen.hpp" +#endif + +#ifdef HAVE_TBB +# include "tbb/tbb_stddef.h" +# if TBB_VERSION_MAJOR*100 + TBB_VERSION_MINOR >= 202 +# include "tbb/tbb.h" +# include "tbb/task.h" +# undef min +# undef max +# else +# undef HAVE_TBB +# endif +#endif + +//! @cond IGNORED + +namespace cv +{ +#ifdef HAVE_TBB + + typedef tbb::blocked_range BlockedRange; + + template static inline + void parallel_for( const BlockedRange& range, const Body& body ) + { + tbb::parallel_for(range, body); + } + + typedef tbb::split Split; + + template static inline + void parallel_reduce( const BlockedRange& range, Body& body ) + { + tbb::parallel_reduce(range, body); + } + + typedef tbb::concurrent_vector ConcurrentRectVector; +#else + class BlockedRange + { + public: + BlockedRange() : _begin(0), _end(0), _grainsize(0) {} + BlockedRange(int b, int e, int g=1) : _begin(b), _end(e), _grainsize(g) {} + int begin() const { return _begin; } + int end() const { return _end; } + int grainsize() const { return _grainsize; } + + protected: + int _begin, _end, _grainsize; + }; + + template static inline + void parallel_for( const BlockedRange& range, const Body& body ) + { + body(range); + } + typedef std::vector ConcurrentRectVector; + + class Split {}; + + template static inline + void parallel_reduce( const BlockedRange& range, Body& body ) + { + body(range); + } +#endif + + // Returns a static string if there is a parallel framework, + // NULL otherwise. + CV_EXPORTS const char* currentParallelFramework(); +} //namespace cv + +/****************************************************************************************\ +* Common declarations * +\****************************************************************************************/ + +/* the alignment of all the allocated buffers */ +#define CV_MALLOC_ALIGN 16 + +/* IEEE754 constants and macros */ +#define CV_TOGGLE_FLT(x) ((x)^((int)(x) < 0 ? 0x7fffffff : 0)) +#define CV_TOGGLE_DBL(x) ((x)^((int64)(x) < 0 ? CV_BIG_INT(0x7fffffffffffffff) : 0)) + +static inline void* cvAlignPtr( const void* ptr, int align = 32 ) +{ + CV_DbgAssert ( (align & (align-1)) == 0 ); + return (void*)( ((size_t)ptr + align - 1) & ~(size_t)(align-1) ); +} + +static inline int cvAlign( int size, int align ) +{ + CV_DbgAssert( (align & (align-1)) == 0 && size < INT_MAX ); + return (size + align - 1) & -align; +} + +#ifdef IPL_DEPTH_8U +static inline cv::Size cvGetMatSize( const CvMat* mat ) +{ + return cv::Size(mat->cols, mat->rows); +} +#endif + +namespace cv +{ +CV_EXPORTS void scalarToRawData(const cv::Scalar& s, void* buf, int type, int unroll_to = 0); +} + +// property implementation macros + +#define CV_IMPL_PROPERTY_RO(type, name, member) \ + inline type get##name() const { return member; } + +#define CV_HELP_IMPL_PROPERTY(r_type, w_type, name, member) \ + CV_IMPL_PROPERTY_RO(r_type, name, member) \ + inline void set##name(w_type val) { member = val; } + +#define CV_HELP_WRAP_PROPERTY(r_type, w_type, name, internal_name, internal_obj) \ + r_type get##name() const { return internal_obj.get##internal_name(); } \ + void set##name(w_type val) { internal_obj.set##internal_name(val); } + +#define CV_IMPL_PROPERTY(type, name, member) CV_HELP_IMPL_PROPERTY(type, type, name, member) +#define CV_IMPL_PROPERTY_S(type, name, member) CV_HELP_IMPL_PROPERTY(type, const type &, name, member) + +#define CV_WRAP_PROPERTY(type, name, internal_name, internal_obj) CV_HELP_WRAP_PROPERTY(type, type, name, internal_name, internal_obj) +#define CV_WRAP_PROPERTY_S(type, name, internal_name, internal_obj) CV_HELP_WRAP_PROPERTY(type, const type &, name, internal_name, internal_obj) + +#define CV_WRAP_SAME_PROPERTY(type, name, internal_obj) CV_WRAP_PROPERTY(type, name, name, internal_obj) +#define CV_WRAP_SAME_PROPERTY_S(type, name, internal_obj) CV_WRAP_PROPERTY_S(type, name, name, internal_obj) + +/****************************************************************************************\ +* Structures and macros for integration with IPP * +\****************************************************************************************/ + +#ifdef HAVE_IPP +#include "ipp.h" + +#ifndef IPP_VERSION_UPDATE // prior to 7.1 +#define IPP_VERSION_UPDATE 0 +#endif + +#define IPP_VERSION_X100 (IPP_VERSION_MAJOR * 100 + IPP_VERSION_MINOR*10 + IPP_VERSION_UPDATE) + +// General define for ipp function disabling +#define IPP_DISABLE_BLOCK 0 + +#ifdef CV_MALLOC_ALIGN +#undef CV_MALLOC_ALIGN +#endif +#define CV_MALLOC_ALIGN 32 // required for AVX optimization + +#define setIppErrorStatus() cv::ipp::setIppStatus(-1, CV_Func, __FILE__, __LINE__) + +static inline IppiSize ippiSize(int width, int height) +{ + IppiSize size = { width, height }; + return size; +} + +static inline IppiSize ippiSize(const cv::Size & _size) +{ + IppiSize size = { _size.width, _size.height }; + return size; +} + +static inline IppiBorderType ippiGetBorderType(int borderTypeNI) +{ + return borderTypeNI == cv::BORDER_CONSTANT ? ippBorderConst : + borderTypeNI == cv::BORDER_WRAP ? ippBorderWrap : + borderTypeNI == cv::BORDER_REPLICATE ? ippBorderRepl : + borderTypeNI == cv::BORDER_REFLECT_101 ? ippBorderMirror : + borderTypeNI == cv::BORDER_REFLECT ? ippBorderMirrorR : (IppiBorderType)-1; +} + +static inline IppDataType ippiGetDataType(int depth) +{ + return depth == CV_8U ? ipp8u : + depth == CV_8S ? ipp8s : + depth == CV_16U ? ipp16u : + depth == CV_16S ? ipp16s : + depth == CV_32S ? ipp32s : + depth == CV_32F ? ipp32f : + depth == CV_64F ? ipp64f : (IppDataType)-1; +} + +// IPP temporary buffer hepler +template +class IppAutoBuffer +{ +public: + IppAutoBuffer() { m_pBuffer = NULL; } + IppAutoBuffer(int size) { Alloc(size); } + ~IppAutoBuffer() { Release(); } + T* Alloc(int size) { m_pBuffer = (T*)ippMalloc(size); return m_pBuffer; } + void Release() { if(m_pBuffer) ippFree(m_pBuffer); } + inline operator T* () { return (T*)m_pBuffer;} + inline operator const T* () const { return (const T*)m_pBuffer;} +private: + // Disable copy operations + IppAutoBuffer(IppAutoBuffer &) {}; + IppAutoBuffer& operator =(const IppAutoBuffer &) {return *this;}; + + T* m_pBuffer; +}; + +#else +#define IPP_VERSION_X100 0 +#endif + +// There shoud be no API difference in OpenCV between ICV and IPP since 9.0 +#if (defined HAVE_IPP_ICV_ONLY) && IPP_VERSION_X100 >= 900 +#undef HAVE_IPP_ICV_ONLY +#endif + +#ifdef HAVE_IPP_ICV_ONLY +#define HAVE_ICV 1 +#else +#define HAVE_ICV 0 +#endif + +#if defined HAVE_IPP +#if IPP_VERSION_X100 >= 900 +#define IPP_INITIALIZER(FEAT) \ +{ \ + if(FEAT) \ + ippSetCpuFeatures(FEAT); \ + else \ + ippInit(); \ +} +#elif IPP_VERSION_X100 >= 800 +#define IPP_INITIALIZER(FEAT) \ +{ \ + ippInit(); \ +} +#else +#define IPP_INITIALIZER(FEAT) \ +{ \ + ippStaticInit(); \ +} +#endif + +#ifdef CVAPI_EXPORTS +#define IPP_INITIALIZER_AUTO \ +struct __IppInitializer__ \ +{ \ + __IppInitializer__() \ + {IPP_INITIALIZER(cv::ipp::getIppFeatures())} \ +}; \ +static struct __IppInitializer__ __ipp_initializer__; +#else +#define IPP_INITIALIZER_AUTO +#endif +#else +#define IPP_INITIALIZER +#define IPP_INITIALIZER_AUTO +#endif + +#define CV_IPP_CHECK_COND (cv::ipp::useIPP()) +#define CV_IPP_CHECK() if(CV_IPP_CHECK_COND) + +#ifdef HAVE_IPP + +#ifdef CV_IPP_RUN_VERBOSE +#define CV_IPP_RUN_(condition, func, ...) \ + { \ + if (cv::ipp::useIPP() && (condition) && func) \ + { \ + printf("%s: IPP implementation is running\n", CV_Func); \ + fflush(stdout); \ + CV_IMPL_ADD(CV_IMPL_IPP); \ + return __VA_ARGS__; \ + } \ + else \ + { \ + printf("%s: Plain implementation is running\n", CV_Func); \ + fflush(stdout); \ + } \ + } +#elif defined CV_IPP_RUN_ASSERT +#define CV_IPP_RUN_(condition, func, ...) \ + { \ + if (cv::ipp::useIPP() && (condition)) \ + { \ + if(func) \ + { \ + CV_IMPL_ADD(CV_IMPL_IPP); \ + } \ + else \ + { \ + setIppErrorStatus(); \ + CV_Error(cv::Error::StsAssert, #func); \ + } \ + return __VA_ARGS__; \ + } \ + } +#else +#define CV_IPP_RUN_(condition, func, ...) \ + if (cv::ipp::useIPP() && (condition) && func) \ + { \ + CV_IMPL_ADD(CV_IMPL_IPP); \ + return __VA_ARGS__; \ + } +#endif + +#else +#define CV_IPP_RUN_(condition, func, ...) +#endif + +#define CV_IPP_RUN(condition, func, ...) CV_IPP_RUN_(condition, func, __VA_ARGS__) + + +#ifndef IPPI_CALL +# define IPPI_CALL(func) CV_Assert((func) >= 0) +#endif + +/* IPP-compatible return codes */ +typedef enum CvStatus +{ + CV_BADMEMBLOCK_ERR = -113, + CV_INPLACE_NOT_SUPPORTED_ERR= -112, + CV_UNMATCHED_ROI_ERR = -111, + CV_NOTFOUND_ERR = -110, + CV_BADCONVERGENCE_ERR = -109, + + CV_BADDEPTH_ERR = -107, + CV_BADROI_ERR = -106, + CV_BADHEADER_ERR = -105, + CV_UNMATCHED_FORMATS_ERR = -104, + CV_UNSUPPORTED_COI_ERR = -103, + CV_UNSUPPORTED_CHANNELS_ERR = -102, + CV_UNSUPPORTED_DEPTH_ERR = -101, + CV_UNSUPPORTED_FORMAT_ERR = -100, + + CV_BADARG_ERR = -49, //ipp comp + CV_NOTDEFINED_ERR = -48, //ipp comp + + CV_BADCHANNELS_ERR = -47, //ipp comp + CV_BADRANGE_ERR = -44, //ipp comp + CV_BADSTEP_ERR = -29, //ipp comp + + CV_BADFLAG_ERR = -12, + CV_DIV_BY_ZERO_ERR = -11, //ipp comp + CV_BADCOEF_ERR = -10, + + CV_BADFACTOR_ERR = -7, + CV_BADPOINT_ERR = -6, + CV_BADSCALE_ERR = -4, + CV_OUTOFMEM_ERR = -3, + CV_NULLPTR_ERR = -2, + CV_BADSIZE_ERR = -1, + CV_NO_ERR = 0, + CV_OK = CV_NO_ERR +} +CvStatus; + +#ifdef HAVE_TEGRA_OPTIMIZATION +namespace tegra { + +CV_EXPORTS bool useTegra(); +CV_EXPORTS void setUseTegra(bool flag); + +} +#endif + +//! @endcond + +#endif // __OPENCV_CORE_PRIVATE_HPP__ diff --git a/lib/opencv/include/opencv2/core/ptr.inl.hpp b/lib/opencv/include/opencv2/core/ptr.inl.hpp new file mode 100644 index 000000000..3f6f214a8 --- /dev/null +++ b/lib/opencv/include/opencv2/core/ptr.inl.hpp @@ -0,0 +1,365 @@ +/*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) 2013, NVIDIA 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 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 copyright holders 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_PTR_INL_HPP__ +#define __OPENCV_CORE_PTR_INL_HPP__ + +#include + +//! @cond IGNORED + +namespace cv { + +template +void DefaultDeleter::operator () (Y* p) const +{ + delete p; +} + +namespace detail +{ + +struct PtrOwner +{ + PtrOwner() : refCount(1) + {} + + void incRef() + { + CV_XADD(&refCount, 1); + } + + void decRef() + { + if (CV_XADD(&refCount, -1) == 1) deleteSelf(); + } + +protected: + /* This doesn't really need to be virtual, since PtrOwner is never deleted + directly, but it doesn't hurt and it helps avoid warnings. */ + virtual ~PtrOwner() + {} + + virtual void deleteSelf() = 0; + +private: + unsigned int refCount; + + // noncopyable + PtrOwner(const PtrOwner&); + PtrOwner& operator = (const PtrOwner&); +}; + +template +struct PtrOwnerImpl : PtrOwner +{ + PtrOwnerImpl(Y* p, D d) : owned(p), deleter(d) + {} + + void deleteSelf() + { + deleter(owned); + delete this; + } + +private: + Y* owned; + D deleter; +}; + + +} + +template +Ptr::Ptr() : owner(NULL), stored(NULL) +{} + +template +template +Ptr::Ptr(Y* p) + : owner(p + ? new detail::PtrOwnerImpl >(p, DefaultDeleter()) + : NULL), + stored(p) +{} + +template +template +Ptr::Ptr(Y* p, D d) + : owner(p + ? new detail::PtrOwnerImpl(p, d) + : NULL), + stored(p) +{} + +template +Ptr::Ptr(const Ptr& o) : owner(o.owner), stored(o.stored) +{ + if (owner) owner->incRef(); +} + +template +template +Ptr::Ptr(const Ptr& o) : owner(o.owner), stored(o.stored) +{ + if (owner) owner->incRef(); +} + +template +template +Ptr::Ptr(const Ptr& o, T* p) : owner(o.owner), stored(p) +{ + if (owner) owner->incRef(); +} + +template +Ptr::~Ptr() +{ + release(); +} + +template +Ptr& Ptr::operator = (const Ptr& o) +{ + Ptr(o).swap(*this); + return *this; +} + +template +template +Ptr& Ptr::operator = (const Ptr& o) +{ + Ptr(o).swap(*this); + return *this; +} + +template +void Ptr::release() +{ + if (owner) owner->decRef(); + owner = NULL; + stored = NULL; +} + +template +template +void Ptr::reset(Y* p) +{ + Ptr(p).swap(*this); +} + +template +template +void Ptr::reset(Y* p, D d) +{ + Ptr(p, d).swap(*this); +} + +template +void Ptr::swap(Ptr& o) +{ + std::swap(owner, o.owner); + std::swap(stored, o.stored); +} + +template +T* Ptr::get() const +{ + return stored; +} + +template +typename detail::RefOrVoid::type Ptr::operator * () const +{ + return *stored; +} + +template +T* Ptr::operator -> () const +{ + return stored; +} + +template +Ptr::operator T* () const +{ + return stored; +} + + +template +bool Ptr::empty() const +{ + return !stored; +} + +template +template +Ptr Ptr::staticCast() const +{ + return Ptr(*this, static_cast(stored)); +} + +template +template +Ptr Ptr::constCast() const +{ + return Ptr(*this, const_cast(stored)); +} + +template +template +Ptr Ptr::dynamicCast() const +{ + return Ptr(*this, dynamic_cast(stored)); +} + +#ifdef CV_CXX_MOVE_SEMANTICS + +template +Ptr::Ptr(Ptr&& o) : owner(o.owner), stored(o.stored) +{ + o.owner = NULL; + o.stored = NULL; +} + +template +Ptr& Ptr::operator = (Ptr&& o) +{ + release(); + owner = o.owner; + stored = o.stored; + o.owner = NULL; + o.stored = NULL; + return *this; +} + +#endif + + +template +void swap(Ptr& ptr1, Ptr& ptr2){ + ptr1.swap(ptr2); +} + +template +bool operator == (const Ptr& ptr1, const Ptr& ptr2) +{ + return ptr1.get() == ptr2.get(); +} + +template +bool operator != (const Ptr& ptr1, const Ptr& ptr2) +{ + return ptr1.get() != ptr2.get(); +} + +template +Ptr makePtr() +{ + return Ptr(new T()); +} + +template +Ptr makePtr(const A1& a1) +{ + return Ptr(new T(a1)); +} + +template +Ptr makePtr(const A1& a1, const A2& a2) +{ + return Ptr(new T(a1, a2)); +} + +template +Ptr makePtr(const A1& a1, const A2& a2, const A3& a3) +{ + return Ptr(new T(a1, a2, a3)); +} + +template +Ptr makePtr(const A1& a1, const A2& a2, const A3& a3, const A4& a4) +{ + return Ptr(new T(a1, a2, a3, a4)); +} + +template +Ptr makePtr(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5) +{ + return Ptr(new T(a1, a2, a3, a4, a5)); +} + +template +Ptr makePtr(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6) +{ + return Ptr(new T(a1, a2, a3, a4, a5, a6)); +} + +template +Ptr makePtr(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7) +{ + return Ptr(new T(a1, a2, a3, a4, a5, a6, a7)); +} + +template +Ptr makePtr(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8) +{ + return Ptr(new T(a1, a2, a3, a4, a5, a6, a7, a8)); +} + +template +Ptr makePtr(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9) +{ + return Ptr(new T(a1, a2, a3, a4, a5, a6, a7, a8, a9)); +} + +template +Ptr makePtr(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10) +{ + return Ptr(new T(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)); +} + +} // namespace cv + +//! @endcond + +#endif // __OPENCV_CORE_PTR_INL_HPP__ diff --git a/lib/opencv/include/opencv2/core/saturate.hpp b/lib/opencv/include/opencv2/core/saturate.hpp new file mode 100644 index 000000000..1442eab11 --- /dev/null +++ b/lib/opencv/include/opencv2/core/saturate.hpp @@ -0,0 +1,150 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Copyright (C) 2014, 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_SATURATE_HPP__ +#define __OPENCV_CORE_SATURATE_HPP__ + +#include "opencv2/core/cvdef.h" +#include "opencv2/core/fast_math.hpp" + +namespace cv +{ + +//! @addtogroup core_utils +//! @{ + +/////////////// saturate_cast (used in image & signal processing) /////////////////// + +/** @brief Template function for accurate conversion from one primitive type to another. + + The functions saturate_cast resemble the standard C++ cast operations, such as static_cast\() + and others. They perform an efficient and accurate conversion from one primitive type to another + (see the introduction chapter). saturate in the name means that when the input value v is out of the + range of the target type, the result is not formed just by taking low bits of the input, but instead + the value is clipped. For example: + @code + uchar a = saturate_cast(-100); // a = 0 (UCHAR_MIN) + short b = saturate_cast(33333.33333); // b = 32767 (SHRT_MAX) + @endcode + Such clipping is done when the target type is unsigned char , signed char , unsigned short or + signed short . For 32-bit integers, no clipping is done. + + When the parameter is a floating-point value and the target type is an integer (8-, 16- or 32-bit), + the floating-point value is first rounded to the nearest integer and then clipped if needed (when + the target type is 8- or 16-bit). + + This operation is used in the simplest or most complex image processing functions in OpenCV. + + @param v Function parameter. + @sa add, subtract, multiply, divide, Mat::convertTo + */ +template static inline _Tp saturate_cast(uchar v) { return _Tp(v); } +/** @overload */ +template static inline _Tp saturate_cast(schar v) { return _Tp(v); } +/** @overload */ +template static inline _Tp saturate_cast(ushort v) { return _Tp(v); } +/** @overload */ +template static inline _Tp saturate_cast(short v) { return _Tp(v); } +/** @overload */ +template static inline _Tp saturate_cast(unsigned v) { return _Tp(v); } +/** @overload */ +template static inline _Tp saturate_cast(int v) { return _Tp(v); } +/** @overload */ +template static inline _Tp saturate_cast(float v) { return _Tp(v); } +/** @overload */ +template static inline _Tp saturate_cast(double v) { return _Tp(v); } +/** @overload */ +template static inline _Tp saturate_cast(int64 v) { return _Tp(v); } +/** @overload */ +template static inline _Tp saturate_cast(uint64 v) { return _Tp(v); } + +template<> inline uchar saturate_cast(schar v) { return (uchar)std::max((int)v, 0); } +template<> inline uchar saturate_cast(ushort v) { return (uchar)std::min((unsigned)v, (unsigned)UCHAR_MAX); } +template<> inline uchar saturate_cast(int v) { return (uchar)((unsigned)v <= UCHAR_MAX ? v : v > 0 ? UCHAR_MAX : 0); } +template<> inline uchar saturate_cast(short v) { return saturate_cast((int)v); } +template<> inline uchar saturate_cast(unsigned v) { return (uchar)std::min(v, (unsigned)UCHAR_MAX); } +template<> inline uchar saturate_cast(float v) { int iv = cvRound(v); return saturate_cast(iv); } +template<> inline uchar saturate_cast(double v) { int iv = cvRound(v); return saturate_cast(iv); } +template<> inline uchar saturate_cast(int64 v) { return (uchar)((uint64)v <= (uint64)UCHAR_MAX ? v : v > 0 ? UCHAR_MAX : 0); } +template<> inline uchar saturate_cast(uint64 v) { return (uchar)std::min(v, (uint64)UCHAR_MAX); } + +template<> inline schar saturate_cast(uchar v) { return (schar)std::min((int)v, SCHAR_MAX); } +template<> inline schar saturate_cast(ushort v) { return (schar)std::min((unsigned)v, (unsigned)SCHAR_MAX); } +template<> inline schar saturate_cast(int v) { return (schar)((unsigned)(v-SCHAR_MIN) <= (unsigned)UCHAR_MAX ? v : v > 0 ? SCHAR_MAX : SCHAR_MIN); } +template<> inline schar saturate_cast(short v) { return saturate_cast((int)v); } +template<> inline schar saturate_cast(unsigned v) { return (schar)std::min(v, (unsigned)SCHAR_MAX); } +template<> inline schar saturate_cast(float v) { int iv = cvRound(v); return saturate_cast(iv); } +template<> inline schar saturate_cast(double v) { int iv = cvRound(v); return saturate_cast(iv); } +template<> inline schar saturate_cast(int64 v) { return (schar)((uint64)((int64)v-SCHAR_MIN) <= (uint64)UCHAR_MAX ? v : v > 0 ? SCHAR_MAX : SCHAR_MIN); } +template<> inline schar saturate_cast(uint64 v) { return (schar)std::min(v, (uint64)SCHAR_MAX); } + +template<> inline ushort saturate_cast(schar v) { return (ushort)std::max((int)v, 0); } +template<> inline ushort saturate_cast(short v) { return (ushort)std::max((int)v, 0); } +template<> inline ushort saturate_cast(int v) { return (ushort)((unsigned)v <= (unsigned)USHRT_MAX ? v : v > 0 ? USHRT_MAX : 0); } +template<> inline ushort saturate_cast(unsigned v) { return (ushort)std::min(v, (unsigned)USHRT_MAX); } +template<> inline ushort saturate_cast(float v) { int iv = cvRound(v); return saturate_cast(iv); } +template<> inline ushort saturate_cast(double v) { int iv = cvRound(v); return saturate_cast(iv); } +template<> inline ushort saturate_cast(int64 v) { return (ushort)((uint64)v <= (uint64)USHRT_MAX ? v : v > 0 ? USHRT_MAX : 0); } +template<> inline ushort saturate_cast(uint64 v) { return (ushort)std::min(v, (uint64)USHRT_MAX); } + +template<> inline short saturate_cast(ushort v) { return (short)std::min((int)v, SHRT_MAX); } +template<> inline short saturate_cast(int v) { return (short)((unsigned)(v - SHRT_MIN) <= (unsigned)USHRT_MAX ? v : v > 0 ? SHRT_MAX : SHRT_MIN); } +template<> inline short saturate_cast(unsigned v) { return (short)std::min(v, (unsigned)SHRT_MAX); } +template<> inline short saturate_cast(float v) { int iv = cvRound(v); return saturate_cast(iv); } +template<> inline short saturate_cast(double v) { int iv = cvRound(v); return saturate_cast(iv); } +template<> inline short saturate_cast(int64 v) { return (short)((uint64)((int64)v - SHRT_MIN) <= (uint64)USHRT_MAX ? v : v > 0 ? SHRT_MAX : SHRT_MIN); } +template<> inline short saturate_cast(uint64 v) { return (short)std::min(v, (uint64)SHRT_MAX); } + +template<> inline int saturate_cast(float v) { return cvRound(v); } +template<> inline int saturate_cast(double v) { return cvRound(v); } + +// we intentionally do not clip negative numbers, to make -1 become 0xffffffff etc. +template<> inline unsigned saturate_cast(float v) { return cvRound(v); } +template<> inline unsigned saturate_cast(double v) { return cvRound(v); } + +//! @} + +} // cv + +#endif // __OPENCV_CORE_SATURATE_HPP__ diff --git a/lib/opencv/include/opencv2/core/sse_utils.hpp b/lib/opencv/include/opencv2/core/sse_utils.hpp new file mode 100644 index 000000000..c87b029ab --- /dev/null +++ b/lib/opencv/include/opencv2/core/sse_utils.hpp @@ -0,0 +1,652 @@ +/*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) 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_SSE_UTILS_HPP__ +#define __OPENCV_CORE_SSE_UTILS_HPP__ + +#ifndef __cplusplus +# error sse_utils.hpp header must be compiled as C++ +#endif + +#include "opencv2/core/cvdef.h" + +//! @addtogroup core_utils_sse +//! @{ + +#if CV_SSE2 + +inline void _mm_deinterleave_epi8(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0, __m128i & v_g1) +{ + __m128i layer1_chunk0 = _mm_unpacklo_epi8(v_r0, v_g0); + __m128i layer1_chunk1 = _mm_unpackhi_epi8(v_r0, v_g0); + __m128i layer1_chunk2 = _mm_unpacklo_epi8(v_r1, v_g1); + __m128i layer1_chunk3 = _mm_unpackhi_epi8(v_r1, v_g1); + + __m128i layer2_chunk0 = _mm_unpacklo_epi8(layer1_chunk0, layer1_chunk2); + __m128i layer2_chunk1 = _mm_unpackhi_epi8(layer1_chunk0, layer1_chunk2); + __m128i layer2_chunk2 = _mm_unpacklo_epi8(layer1_chunk1, layer1_chunk3); + __m128i layer2_chunk3 = _mm_unpackhi_epi8(layer1_chunk1, layer1_chunk3); + + __m128i layer3_chunk0 = _mm_unpacklo_epi8(layer2_chunk0, layer2_chunk2); + __m128i layer3_chunk1 = _mm_unpackhi_epi8(layer2_chunk0, layer2_chunk2); + __m128i layer3_chunk2 = _mm_unpacklo_epi8(layer2_chunk1, layer2_chunk3); + __m128i layer3_chunk3 = _mm_unpackhi_epi8(layer2_chunk1, layer2_chunk3); + + __m128i layer4_chunk0 = _mm_unpacklo_epi8(layer3_chunk0, layer3_chunk2); + __m128i layer4_chunk1 = _mm_unpackhi_epi8(layer3_chunk0, layer3_chunk2); + __m128i layer4_chunk2 = _mm_unpacklo_epi8(layer3_chunk1, layer3_chunk3); + __m128i layer4_chunk3 = _mm_unpackhi_epi8(layer3_chunk1, layer3_chunk3); + + v_r0 = _mm_unpacklo_epi8(layer4_chunk0, layer4_chunk2); + v_r1 = _mm_unpackhi_epi8(layer4_chunk0, layer4_chunk2); + v_g0 = _mm_unpacklo_epi8(layer4_chunk1, layer4_chunk3); + v_g1 = _mm_unpackhi_epi8(layer4_chunk1, layer4_chunk3); +} + +inline void _mm_deinterleave_epi8(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0, + __m128i & v_g1, __m128i & v_b0, __m128i & v_b1) +{ + __m128i layer1_chunk0 = _mm_unpacklo_epi8(v_r0, v_g1); + __m128i layer1_chunk1 = _mm_unpackhi_epi8(v_r0, v_g1); + __m128i layer1_chunk2 = _mm_unpacklo_epi8(v_r1, v_b0); + __m128i layer1_chunk3 = _mm_unpackhi_epi8(v_r1, v_b0); + __m128i layer1_chunk4 = _mm_unpacklo_epi8(v_g0, v_b1); + __m128i layer1_chunk5 = _mm_unpackhi_epi8(v_g0, v_b1); + + __m128i layer2_chunk0 = _mm_unpacklo_epi8(layer1_chunk0, layer1_chunk3); + __m128i layer2_chunk1 = _mm_unpackhi_epi8(layer1_chunk0, layer1_chunk3); + __m128i layer2_chunk2 = _mm_unpacklo_epi8(layer1_chunk1, layer1_chunk4); + __m128i layer2_chunk3 = _mm_unpackhi_epi8(layer1_chunk1, layer1_chunk4); + __m128i layer2_chunk4 = _mm_unpacklo_epi8(layer1_chunk2, layer1_chunk5); + __m128i layer2_chunk5 = _mm_unpackhi_epi8(layer1_chunk2, layer1_chunk5); + + __m128i layer3_chunk0 = _mm_unpacklo_epi8(layer2_chunk0, layer2_chunk3); + __m128i layer3_chunk1 = _mm_unpackhi_epi8(layer2_chunk0, layer2_chunk3); + __m128i layer3_chunk2 = _mm_unpacklo_epi8(layer2_chunk1, layer2_chunk4); + __m128i layer3_chunk3 = _mm_unpackhi_epi8(layer2_chunk1, layer2_chunk4); + __m128i layer3_chunk4 = _mm_unpacklo_epi8(layer2_chunk2, layer2_chunk5); + __m128i layer3_chunk5 = _mm_unpackhi_epi8(layer2_chunk2, layer2_chunk5); + + __m128i layer4_chunk0 = _mm_unpacklo_epi8(layer3_chunk0, layer3_chunk3); + __m128i layer4_chunk1 = _mm_unpackhi_epi8(layer3_chunk0, layer3_chunk3); + __m128i layer4_chunk2 = _mm_unpacklo_epi8(layer3_chunk1, layer3_chunk4); + __m128i layer4_chunk3 = _mm_unpackhi_epi8(layer3_chunk1, layer3_chunk4); + __m128i layer4_chunk4 = _mm_unpacklo_epi8(layer3_chunk2, layer3_chunk5); + __m128i layer4_chunk5 = _mm_unpackhi_epi8(layer3_chunk2, layer3_chunk5); + + v_r0 = _mm_unpacklo_epi8(layer4_chunk0, layer4_chunk3); + v_r1 = _mm_unpackhi_epi8(layer4_chunk0, layer4_chunk3); + v_g0 = _mm_unpacklo_epi8(layer4_chunk1, layer4_chunk4); + v_g1 = _mm_unpackhi_epi8(layer4_chunk1, layer4_chunk4); + v_b0 = _mm_unpacklo_epi8(layer4_chunk2, layer4_chunk5); + v_b1 = _mm_unpackhi_epi8(layer4_chunk2, layer4_chunk5); +} + +inline void _mm_deinterleave_epi8(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0, __m128i & v_g1, + __m128i & v_b0, __m128i & v_b1, __m128i & v_a0, __m128i & v_a1) +{ + __m128i layer1_chunk0 = _mm_unpacklo_epi8(v_r0, v_b0); + __m128i layer1_chunk1 = _mm_unpackhi_epi8(v_r0, v_b0); + __m128i layer1_chunk2 = _mm_unpacklo_epi8(v_r1, v_b1); + __m128i layer1_chunk3 = _mm_unpackhi_epi8(v_r1, v_b1); + __m128i layer1_chunk4 = _mm_unpacklo_epi8(v_g0, v_a0); + __m128i layer1_chunk5 = _mm_unpackhi_epi8(v_g0, v_a0); + __m128i layer1_chunk6 = _mm_unpacklo_epi8(v_g1, v_a1); + __m128i layer1_chunk7 = _mm_unpackhi_epi8(v_g1, v_a1); + + __m128i layer2_chunk0 = _mm_unpacklo_epi8(layer1_chunk0, layer1_chunk4); + __m128i layer2_chunk1 = _mm_unpackhi_epi8(layer1_chunk0, layer1_chunk4); + __m128i layer2_chunk2 = _mm_unpacklo_epi8(layer1_chunk1, layer1_chunk5); + __m128i layer2_chunk3 = _mm_unpackhi_epi8(layer1_chunk1, layer1_chunk5); + __m128i layer2_chunk4 = _mm_unpacklo_epi8(layer1_chunk2, layer1_chunk6); + __m128i layer2_chunk5 = _mm_unpackhi_epi8(layer1_chunk2, layer1_chunk6); + __m128i layer2_chunk6 = _mm_unpacklo_epi8(layer1_chunk3, layer1_chunk7); + __m128i layer2_chunk7 = _mm_unpackhi_epi8(layer1_chunk3, layer1_chunk7); + + __m128i layer3_chunk0 = _mm_unpacklo_epi8(layer2_chunk0, layer2_chunk4); + __m128i layer3_chunk1 = _mm_unpackhi_epi8(layer2_chunk0, layer2_chunk4); + __m128i layer3_chunk2 = _mm_unpacklo_epi8(layer2_chunk1, layer2_chunk5); + __m128i layer3_chunk3 = _mm_unpackhi_epi8(layer2_chunk1, layer2_chunk5); + __m128i layer3_chunk4 = _mm_unpacklo_epi8(layer2_chunk2, layer2_chunk6); + __m128i layer3_chunk5 = _mm_unpackhi_epi8(layer2_chunk2, layer2_chunk6); + __m128i layer3_chunk6 = _mm_unpacklo_epi8(layer2_chunk3, layer2_chunk7); + __m128i layer3_chunk7 = _mm_unpackhi_epi8(layer2_chunk3, layer2_chunk7); + + __m128i layer4_chunk0 = _mm_unpacklo_epi8(layer3_chunk0, layer3_chunk4); + __m128i layer4_chunk1 = _mm_unpackhi_epi8(layer3_chunk0, layer3_chunk4); + __m128i layer4_chunk2 = _mm_unpacklo_epi8(layer3_chunk1, layer3_chunk5); + __m128i layer4_chunk3 = _mm_unpackhi_epi8(layer3_chunk1, layer3_chunk5); + __m128i layer4_chunk4 = _mm_unpacklo_epi8(layer3_chunk2, layer3_chunk6); + __m128i layer4_chunk5 = _mm_unpackhi_epi8(layer3_chunk2, layer3_chunk6); + __m128i layer4_chunk6 = _mm_unpacklo_epi8(layer3_chunk3, layer3_chunk7); + __m128i layer4_chunk7 = _mm_unpackhi_epi8(layer3_chunk3, layer3_chunk7); + + v_r0 = _mm_unpacklo_epi8(layer4_chunk0, layer4_chunk4); + v_r1 = _mm_unpackhi_epi8(layer4_chunk0, layer4_chunk4); + v_g0 = _mm_unpacklo_epi8(layer4_chunk1, layer4_chunk5); + v_g1 = _mm_unpackhi_epi8(layer4_chunk1, layer4_chunk5); + v_b0 = _mm_unpacklo_epi8(layer4_chunk2, layer4_chunk6); + v_b1 = _mm_unpackhi_epi8(layer4_chunk2, layer4_chunk6); + v_a0 = _mm_unpacklo_epi8(layer4_chunk3, layer4_chunk7); + v_a1 = _mm_unpackhi_epi8(layer4_chunk3, layer4_chunk7); +} + +inline void _mm_interleave_epi8(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0, __m128i & v_g1) +{ + __m128i v_mask = _mm_set1_epi16(0x00ff); + + __m128i layer4_chunk0 = _mm_packus_epi16(_mm_and_si128(v_r0, v_mask), _mm_and_si128(v_r1, v_mask)); + __m128i layer4_chunk2 = _mm_packus_epi16(_mm_srli_epi16(v_r0, 8), _mm_srli_epi16(v_r1, 8)); + __m128i layer4_chunk1 = _mm_packus_epi16(_mm_and_si128(v_g0, v_mask), _mm_and_si128(v_g1, v_mask)); + __m128i layer4_chunk3 = _mm_packus_epi16(_mm_srli_epi16(v_g0, 8), _mm_srli_epi16(v_g1, 8)); + + __m128i layer3_chunk0 = _mm_packus_epi16(_mm_and_si128(layer4_chunk0, v_mask), _mm_and_si128(layer4_chunk1, v_mask)); + __m128i layer3_chunk2 = _mm_packus_epi16(_mm_srli_epi16(layer4_chunk0, 8), _mm_srli_epi16(layer4_chunk1, 8)); + __m128i layer3_chunk1 = _mm_packus_epi16(_mm_and_si128(layer4_chunk2, v_mask), _mm_and_si128(layer4_chunk3, v_mask)); + __m128i layer3_chunk3 = _mm_packus_epi16(_mm_srli_epi16(layer4_chunk2, 8), _mm_srli_epi16(layer4_chunk3, 8)); + + __m128i layer2_chunk0 = _mm_packus_epi16(_mm_and_si128(layer3_chunk0, v_mask), _mm_and_si128(layer3_chunk1, v_mask)); + __m128i layer2_chunk2 = _mm_packus_epi16(_mm_srli_epi16(layer3_chunk0, 8), _mm_srli_epi16(layer3_chunk1, 8)); + __m128i layer2_chunk1 = _mm_packus_epi16(_mm_and_si128(layer3_chunk2, v_mask), _mm_and_si128(layer3_chunk3, v_mask)); + __m128i layer2_chunk3 = _mm_packus_epi16(_mm_srli_epi16(layer3_chunk2, 8), _mm_srli_epi16(layer3_chunk3, 8)); + + __m128i layer1_chunk0 = _mm_packus_epi16(_mm_and_si128(layer2_chunk0, v_mask), _mm_and_si128(layer2_chunk1, v_mask)); + __m128i layer1_chunk2 = _mm_packus_epi16(_mm_srli_epi16(layer2_chunk0, 8), _mm_srli_epi16(layer2_chunk1, 8)); + __m128i layer1_chunk1 = _mm_packus_epi16(_mm_and_si128(layer2_chunk2, v_mask), _mm_and_si128(layer2_chunk3, v_mask)); + __m128i layer1_chunk3 = _mm_packus_epi16(_mm_srli_epi16(layer2_chunk2, 8), _mm_srli_epi16(layer2_chunk3, 8)); + + v_r0 = _mm_packus_epi16(_mm_and_si128(layer1_chunk0, v_mask), _mm_and_si128(layer1_chunk1, v_mask)); + v_g0 = _mm_packus_epi16(_mm_srli_epi16(layer1_chunk0, 8), _mm_srli_epi16(layer1_chunk1, 8)); + v_r1 = _mm_packus_epi16(_mm_and_si128(layer1_chunk2, v_mask), _mm_and_si128(layer1_chunk3, v_mask)); + v_g1 = _mm_packus_epi16(_mm_srli_epi16(layer1_chunk2, 8), _mm_srli_epi16(layer1_chunk3, 8)); +} + +inline void _mm_interleave_epi8(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0, + __m128i & v_g1, __m128i & v_b0, __m128i & v_b1) +{ + __m128i v_mask = _mm_set1_epi16(0x00ff); + + __m128i layer4_chunk0 = _mm_packus_epi16(_mm_and_si128(v_r0, v_mask), _mm_and_si128(v_r1, v_mask)); + __m128i layer4_chunk3 = _mm_packus_epi16(_mm_srli_epi16(v_r0, 8), _mm_srli_epi16(v_r1, 8)); + __m128i layer4_chunk1 = _mm_packus_epi16(_mm_and_si128(v_g0, v_mask), _mm_and_si128(v_g1, v_mask)); + __m128i layer4_chunk4 = _mm_packus_epi16(_mm_srli_epi16(v_g0, 8), _mm_srli_epi16(v_g1, 8)); + __m128i layer4_chunk2 = _mm_packus_epi16(_mm_and_si128(v_b0, v_mask), _mm_and_si128(v_b1, v_mask)); + __m128i layer4_chunk5 = _mm_packus_epi16(_mm_srli_epi16(v_b0, 8), _mm_srli_epi16(v_b1, 8)); + + __m128i layer3_chunk0 = _mm_packus_epi16(_mm_and_si128(layer4_chunk0, v_mask), _mm_and_si128(layer4_chunk1, v_mask)); + __m128i layer3_chunk3 = _mm_packus_epi16(_mm_srli_epi16(layer4_chunk0, 8), _mm_srli_epi16(layer4_chunk1, 8)); + __m128i layer3_chunk1 = _mm_packus_epi16(_mm_and_si128(layer4_chunk2, v_mask), _mm_and_si128(layer4_chunk3, v_mask)); + __m128i layer3_chunk4 = _mm_packus_epi16(_mm_srli_epi16(layer4_chunk2, 8), _mm_srli_epi16(layer4_chunk3, 8)); + __m128i layer3_chunk2 = _mm_packus_epi16(_mm_and_si128(layer4_chunk4, v_mask), _mm_and_si128(layer4_chunk5, v_mask)); + __m128i layer3_chunk5 = _mm_packus_epi16(_mm_srli_epi16(layer4_chunk4, 8), _mm_srli_epi16(layer4_chunk5, 8)); + + __m128i layer2_chunk0 = _mm_packus_epi16(_mm_and_si128(layer3_chunk0, v_mask), _mm_and_si128(layer3_chunk1, v_mask)); + __m128i layer2_chunk3 = _mm_packus_epi16(_mm_srli_epi16(layer3_chunk0, 8), _mm_srli_epi16(layer3_chunk1, 8)); + __m128i layer2_chunk1 = _mm_packus_epi16(_mm_and_si128(layer3_chunk2, v_mask), _mm_and_si128(layer3_chunk3, v_mask)); + __m128i layer2_chunk4 = _mm_packus_epi16(_mm_srli_epi16(layer3_chunk2, 8), _mm_srli_epi16(layer3_chunk3, 8)); + __m128i layer2_chunk2 = _mm_packus_epi16(_mm_and_si128(layer3_chunk4, v_mask), _mm_and_si128(layer3_chunk5, v_mask)); + __m128i layer2_chunk5 = _mm_packus_epi16(_mm_srli_epi16(layer3_chunk4, 8), _mm_srli_epi16(layer3_chunk5, 8)); + + __m128i layer1_chunk0 = _mm_packus_epi16(_mm_and_si128(layer2_chunk0, v_mask), _mm_and_si128(layer2_chunk1, v_mask)); + __m128i layer1_chunk3 = _mm_packus_epi16(_mm_srli_epi16(layer2_chunk0, 8), _mm_srli_epi16(layer2_chunk1, 8)); + __m128i layer1_chunk1 = _mm_packus_epi16(_mm_and_si128(layer2_chunk2, v_mask), _mm_and_si128(layer2_chunk3, v_mask)); + __m128i layer1_chunk4 = _mm_packus_epi16(_mm_srli_epi16(layer2_chunk2, 8), _mm_srli_epi16(layer2_chunk3, 8)); + __m128i layer1_chunk2 = _mm_packus_epi16(_mm_and_si128(layer2_chunk4, v_mask), _mm_and_si128(layer2_chunk5, v_mask)); + __m128i layer1_chunk5 = _mm_packus_epi16(_mm_srli_epi16(layer2_chunk4, 8), _mm_srli_epi16(layer2_chunk5, 8)); + + v_r0 = _mm_packus_epi16(_mm_and_si128(layer1_chunk0, v_mask), _mm_and_si128(layer1_chunk1, v_mask)); + v_g1 = _mm_packus_epi16(_mm_srli_epi16(layer1_chunk0, 8), _mm_srli_epi16(layer1_chunk1, 8)); + v_r1 = _mm_packus_epi16(_mm_and_si128(layer1_chunk2, v_mask), _mm_and_si128(layer1_chunk3, v_mask)); + v_b0 = _mm_packus_epi16(_mm_srli_epi16(layer1_chunk2, 8), _mm_srli_epi16(layer1_chunk3, 8)); + v_g0 = _mm_packus_epi16(_mm_and_si128(layer1_chunk4, v_mask), _mm_and_si128(layer1_chunk5, v_mask)); + v_b1 = _mm_packus_epi16(_mm_srli_epi16(layer1_chunk4, 8), _mm_srli_epi16(layer1_chunk5, 8)); +} + +inline void _mm_interleave_epi8(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0, __m128i & v_g1, + __m128i & v_b0, __m128i & v_b1, __m128i & v_a0, __m128i & v_a1) +{ + __m128i v_mask = _mm_set1_epi16(0x00ff); + + __m128i layer4_chunk0 = _mm_packus_epi16(_mm_and_si128(v_r0, v_mask), _mm_and_si128(v_r1, v_mask)); + __m128i layer4_chunk4 = _mm_packus_epi16(_mm_srli_epi16(v_r0, 8), _mm_srli_epi16(v_r1, 8)); + __m128i layer4_chunk1 = _mm_packus_epi16(_mm_and_si128(v_g0, v_mask), _mm_and_si128(v_g1, v_mask)); + __m128i layer4_chunk5 = _mm_packus_epi16(_mm_srli_epi16(v_g0, 8), _mm_srli_epi16(v_g1, 8)); + __m128i layer4_chunk2 = _mm_packus_epi16(_mm_and_si128(v_b0, v_mask), _mm_and_si128(v_b1, v_mask)); + __m128i layer4_chunk6 = _mm_packus_epi16(_mm_srli_epi16(v_b0, 8), _mm_srli_epi16(v_b1, 8)); + __m128i layer4_chunk3 = _mm_packus_epi16(_mm_and_si128(v_a0, v_mask), _mm_and_si128(v_a1, v_mask)); + __m128i layer4_chunk7 = _mm_packus_epi16(_mm_srli_epi16(v_a0, 8), _mm_srli_epi16(v_a1, 8)); + + __m128i layer3_chunk0 = _mm_packus_epi16(_mm_and_si128(layer4_chunk0, v_mask), _mm_and_si128(layer4_chunk1, v_mask)); + __m128i layer3_chunk4 = _mm_packus_epi16(_mm_srli_epi16(layer4_chunk0, 8), _mm_srli_epi16(layer4_chunk1, 8)); + __m128i layer3_chunk1 = _mm_packus_epi16(_mm_and_si128(layer4_chunk2, v_mask), _mm_and_si128(layer4_chunk3, v_mask)); + __m128i layer3_chunk5 = _mm_packus_epi16(_mm_srli_epi16(layer4_chunk2, 8), _mm_srli_epi16(layer4_chunk3, 8)); + __m128i layer3_chunk2 = _mm_packus_epi16(_mm_and_si128(layer4_chunk4, v_mask), _mm_and_si128(layer4_chunk5, v_mask)); + __m128i layer3_chunk6 = _mm_packus_epi16(_mm_srli_epi16(layer4_chunk4, 8), _mm_srli_epi16(layer4_chunk5, 8)); + __m128i layer3_chunk3 = _mm_packus_epi16(_mm_and_si128(layer4_chunk6, v_mask), _mm_and_si128(layer4_chunk7, v_mask)); + __m128i layer3_chunk7 = _mm_packus_epi16(_mm_srli_epi16(layer4_chunk6, 8), _mm_srli_epi16(layer4_chunk7, 8)); + + __m128i layer2_chunk0 = _mm_packus_epi16(_mm_and_si128(layer3_chunk0, v_mask), _mm_and_si128(layer3_chunk1, v_mask)); + __m128i layer2_chunk4 = _mm_packus_epi16(_mm_srli_epi16(layer3_chunk0, 8), _mm_srli_epi16(layer3_chunk1, 8)); + __m128i layer2_chunk1 = _mm_packus_epi16(_mm_and_si128(layer3_chunk2, v_mask), _mm_and_si128(layer3_chunk3, v_mask)); + __m128i layer2_chunk5 = _mm_packus_epi16(_mm_srli_epi16(layer3_chunk2, 8), _mm_srli_epi16(layer3_chunk3, 8)); + __m128i layer2_chunk2 = _mm_packus_epi16(_mm_and_si128(layer3_chunk4, v_mask), _mm_and_si128(layer3_chunk5, v_mask)); + __m128i layer2_chunk6 = _mm_packus_epi16(_mm_srli_epi16(layer3_chunk4, 8), _mm_srli_epi16(layer3_chunk5, 8)); + __m128i layer2_chunk3 = _mm_packus_epi16(_mm_and_si128(layer3_chunk6, v_mask), _mm_and_si128(layer3_chunk7, v_mask)); + __m128i layer2_chunk7 = _mm_packus_epi16(_mm_srli_epi16(layer3_chunk6, 8), _mm_srli_epi16(layer3_chunk7, 8)); + + __m128i layer1_chunk0 = _mm_packus_epi16(_mm_and_si128(layer2_chunk0, v_mask), _mm_and_si128(layer2_chunk1, v_mask)); + __m128i layer1_chunk4 = _mm_packus_epi16(_mm_srli_epi16(layer2_chunk0, 8), _mm_srli_epi16(layer2_chunk1, 8)); + __m128i layer1_chunk1 = _mm_packus_epi16(_mm_and_si128(layer2_chunk2, v_mask), _mm_and_si128(layer2_chunk3, v_mask)); + __m128i layer1_chunk5 = _mm_packus_epi16(_mm_srli_epi16(layer2_chunk2, 8), _mm_srli_epi16(layer2_chunk3, 8)); + __m128i layer1_chunk2 = _mm_packus_epi16(_mm_and_si128(layer2_chunk4, v_mask), _mm_and_si128(layer2_chunk5, v_mask)); + __m128i layer1_chunk6 = _mm_packus_epi16(_mm_srli_epi16(layer2_chunk4, 8), _mm_srli_epi16(layer2_chunk5, 8)); + __m128i layer1_chunk3 = _mm_packus_epi16(_mm_and_si128(layer2_chunk6, v_mask), _mm_and_si128(layer2_chunk7, v_mask)); + __m128i layer1_chunk7 = _mm_packus_epi16(_mm_srli_epi16(layer2_chunk6, 8), _mm_srli_epi16(layer2_chunk7, 8)); + + v_r0 = _mm_packus_epi16(_mm_and_si128(layer1_chunk0, v_mask), _mm_and_si128(layer1_chunk1, v_mask)); + v_b0 = _mm_packus_epi16(_mm_srli_epi16(layer1_chunk0, 8), _mm_srli_epi16(layer1_chunk1, 8)); + v_r1 = _mm_packus_epi16(_mm_and_si128(layer1_chunk2, v_mask), _mm_and_si128(layer1_chunk3, v_mask)); + v_b1 = _mm_packus_epi16(_mm_srli_epi16(layer1_chunk2, 8), _mm_srli_epi16(layer1_chunk3, 8)); + v_g0 = _mm_packus_epi16(_mm_and_si128(layer1_chunk4, v_mask), _mm_and_si128(layer1_chunk5, v_mask)); + v_a0 = _mm_packus_epi16(_mm_srli_epi16(layer1_chunk4, 8), _mm_srli_epi16(layer1_chunk5, 8)); + v_g1 = _mm_packus_epi16(_mm_and_si128(layer1_chunk6, v_mask), _mm_and_si128(layer1_chunk7, v_mask)); + v_a1 = _mm_packus_epi16(_mm_srli_epi16(layer1_chunk6, 8), _mm_srli_epi16(layer1_chunk7, 8)); +} + +inline void _mm_deinterleave_epi16(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0, __m128i & v_g1) +{ + __m128i layer1_chunk0 = _mm_unpacklo_epi16(v_r0, v_g0); + __m128i layer1_chunk1 = _mm_unpackhi_epi16(v_r0, v_g0); + __m128i layer1_chunk2 = _mm_unpacklo_epi16(v_r1, v_g1); + __m128i layer1_chunk3 = _mm_unpackhi_epi16(v_r1, v_g1); + + __m128i layer2_chunk0 = _mm_unpacklo_epi16(layer1_chunk0, layer1_chunk2); + __m128i layer2_chunk1 = _mm_unpackhi_epi16(layer1_chunk0, layer1_chunk2); + __m128i layer2_chunk2 = _mm_unpacklo_epi16(layer1_chunk1, layer1_chunk3); + __m128i layer2_chunk3 = _mm_unpackhi_epi16(layer1_chunk1, layer1_chunk3); + + __m128i layer3_chunk0 = _mm_unpacklo_epi16(layer2_chunk0, layer2_chunk2); + __m128i layer3_chunk1 = _mm_unpackhi_epi16(layer2_chunk0, layer2_chunk2); + __m128i layer3_chunk2 = _mm_unpacklo_epi16(layer2_chunk1, layer2_chunk3); + __m128i layer3_chunk3 = _mm_unpackhi_epi16(layer2_chunk1, layer2_chunk3); + + v_r0 = _mm_unpacklo_epi16(layer3_chunk0, layer3_chunk2); + v_r1 = _mm_unpackhi_epi16(layer3_chunk0, layer3_chunk2); + v_g0 = _mm_unpacklo_epi16(layer3_chunk1, layer3_chunk3); + v_g1 = _mm_unpackhi_epi16(layer3_chunk1, layer3_chunk3); +} + +inline void _mm_deinterleave_epi16(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0, + __m128i & v_g1, __m128i & v_b0, __m128i & v_b1) +{ + __m128i layer1_chunk0 = _mm_unpacklo_epi16(v_r0, v_g1); + __m128i layer1_chunk1 = _mm_unpackhi_epi16(v_r0, v_g1); + __m128i layer1_chunk2 = _mm_unpacklo_epi16(v_r1, v_b0); + __m128i layer1_chunk3 = _mm_unpackhi_epi16(v_r1, v_b0); + __m128i layer1_chunk4 = _mm_unpacklo_epi16(v_g0, v_b1); + __m128i layer1_chunk5 = _mm_unpackhi_epi16(v_g0, v_b1); + + __m128i layer2_chunk0 = _mm_unpacklo_epi16(layer1_chunk0, layer1_chunk3); + __m128i layer2_chunk1 = _mm_unpackhi_epi16(layer1_chunk0, layer1_chunk3); + __m128i layer2_chunk2 = _mm_unpacklo_epi16(layer1_chunk1, layer1_chunk4); + __m128i layer2_chunk3 = _mm_unpackhi_epi16(layer1_chunk1, layer1_chunk4); + __m128i layer2_chunk4 = _mm_unpacklo_epi16(layer1_chunk2, layer1_chunk5); + __m128i layer2_chunk5 = _mm_unpackhi_epi16(layer1_chunk2, layer1_chunk5); + + __m128i layer3_chunk0 = _mm_unpacklo_epi16(layer2_chunk0, layer2_chunk3); + __m128i layer3_chunk1 = _mm_unpackhi_epi16(layer2_chunk0, layer2_chunk3); + __m128i layer3_chunk2 = _mm_unpacklo_epi16(layer2_chunk1, layer2_chunk4); + __m128i layer3_chunk3 = _mm_unpackhi_epi16(layer2_chunk1, layer2_chunk4); + __m128i layer3_chunk4 = _mm_unpacklo_epi16(layer2_chunk2, layer2_chunk5); + __m128i layer3_chunk5 = _mm_unpackhi_epi16(layer2_chunk2, layer2_chunk5); + + v_r0 = _mm_unpacklo_epi16(layer3_chunk0, layer3_chunk3); + v_r1 = _mm_unpackhi_epi16(layer3_chunk0, layer3_chunk3); + v_g0 = _mm_unpacklo_epi16(layer3_chunk1, layer3_chunk4); + v_g1 = _mm_unpackhi_epi16(layer3_chunk1, layer3_chunk4); + v_b0 = _mm_unpacklo_epi16(layer3_chunk2, layer3_chunk5); + v_b1 = _mm_unpackhi_epi16(layer3_chunk2, layer3_chunk5); +} + +inline void _mm_deinterleave_epi16(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0, __m128i & v_g1, + __m128i & v_b0, __m128i & v_b1, __m128i & v_a0, __m128i & v_a1) +{ + __m128i layer1_chunk0 = _mm_unpacklo_epi16(v_r0, v_b0); + __m128i layer1_chunk1 = _mm_unpackhi_epi16(v_r0, v_b0); + __m128i layer1_chunk2 = _mm_unpacklo_epi16(v_r1, v_b1); + __m128i layer1_chunk3 = _mm_unpackhi_epi16(v_r1, v_b1); + __m128i layer1_chunk4 = _mm_unpacklo_epi16(v_g0, v_a0); + __m128i layer1_chunk5 = _mm_unpackhi_epi16(v_g0, v_a0); + __m128i layer1_chunk6 = _mm_unpacklo_epi16(v_g1, v_a1); + __m128i layer1_chunk7 = _mm_unpackhi_epi16(v_g1, v_a1); + + __m128i layer2_chunk0 = _mm_unpacklo_epi16(layer1_chunk0, layer1_chunk4); + __m128i layer2_chunk1 = _mm_unpackhi_epi16(layer1_chunk0, layer1_chunk4); + __m128i layer2_chunk2 = _mm_unpacklo_epi16(layer1_chunk1, layer1_chunk5); + __m128i layer2_chunk3 = _mm_unpackhi_epi16(layer1_chunk1, layer1_chunk5); + __m128i layer2_chunk4 = _mm_unpacklo_epi16(layer1_chunk2, layer1_chunk6); + __m128i layer2_chunk5 = _mm_unpackhi_epi16(layer1_chunk2, layer1_chunk6); + __m128i layer2_chunk6 = _mm_unpacklo_epi16(layer1_chunk3, layer1_chunk7); + __m128i layer2_chunk7 = _mm_unpackhi_epi16(layer1_chunk3, layer1_chunk7); + + __m128i layer3_chunk0 = _mm_unpacklo_epi16(layer2_chunk0, layer2_chunk4); + __m128i layer3_chunk1 = _mm_unpackhi_epi16(layer2_chunk0, layer2_chunk4); + __m128i layer3_chunk2 = _mm_unpacklo_epi16(layer2_chunk1, layer2_chunk5); + __m128i layer3_chunk3 = _mm_unpackhi_epi16(layer2_chunk1, layer2_chunk5); + __m128i layer3_chunk4 = _mm_unpacklo_epi16(layer2_chunk2, layer2_chunk6); + __m128i layer3_chunk5 = _mm_unpackhi_epi16(layer2_chunk2, layer2_chunk6); + __m128i layer3_chunk6 = _mm_unpacklo_epi16(layer2_chunk3, layer2_chunk7); + __m128i layer3_chunk7 = _mm_unpackhi_epi16(layer2_chunk3, layer2_chunk7); + + v_r0 = _mm_unpacklo_epi16(layer3_chunk0, layer3_chunk4); + v_r1 = _mm_unpackhi_epi16(layer3_chunk0, layer3_chunk4); + v_g0 = _mm_unpacklo_epi16(layer3_chunk1, layer3_chunk5); + v_g1 = _mm_unpackhi_epi16(layer3_chunk1, layer3_chunk5); + v_b0 = _mm_unpacklo_epi16(layer3_chunk2, layer3_chunk6); + v_b1 = _mm_unpackhi_epi16(layer3_chunk2, layer3_chunk6); + v_a0 = _mm_unpacklo_epi16(layer3_chunk3, layer3_chunk7); + v_a1 = _mm_unpackhi_epi16(layer3_chunk3, layer3_chunk7); +} + +#if CV_SSE4_1 + +inline void _mm_interleave_epi16(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0, __m128i & v_g1) +{ + __m128i v_mask = _mm_set1_epi32(0x0000ffff); + + __m128i layer3_chunk0 = _mm_packus_epi32(_mm_and_si128(v_r0, v_mask), _mm_and_si128(v_r1, v_mask)); + __m128i layer3_chunk2 = _mm_packus_epi32(_mm_srli_epi32(v_r0, 16), _mm_srli_epi32(v_r1, 16)); + __m128i layer3_chunk1 = _mm_packus_epi32(_mm_and_si128(v_g0, v_mask), _mm_and_si128(v_g1, v_mask)); + __m128i layer3_chunk3 = _mm_packus_epi32(_mm_srli_epi32(v_g0, 16), _mm_srli_epi32(v_g1, 16)); + + __m128i layer2_chunk0 = _mm_packus_epi32(_mm_and_si128(layer3_chunk0, v_mask), _mm_and_si128(layer3_chunk1, v_mask)); + __m128i layer2_chunk2 = _mm_packus_epi32(_mm_srli_epi32(layer3_chunk0, 16), _mm_srli_epi32(layer3_chunk1, 16)); + __m128i layer2_chunk1 = _mm_packus_epi32(_mm_and_si128(layer3_chunk2, v_mask), _mm_and_si128(layer3_chunk3, v_mask)); + __m128i layer2_chunk3 = _mm_packus_epi32(_mm_srli_epi32(layer3_chunk2, 16), _mm_srli_epi32(layer3_chunk3, 16)); + + __m128i layer1_chunk0 = _mm_packus_epi32(_mm_and_si128(layer2_chunk0, v_mask), _mm_and_si128(layer2_chunk1, v_mask)); + __m128i layer1_chunk2 = _mm_packus_epi32(_mm_srli_epi32(layer2_chunk0, 16), _mm_srli_epi32(layer2_chunk1, 16)); + __m128i layer1_chunk1 = _mm_packus_epi32(_mm_and_si128(layer2_chunk2, v_mask), _mm_and_si128(layer2_chunk3, v_mask)); + __m128i layer1_chunk3 = _mm_packus_epi32(_mm_srli_epi32(layer2_chunk2, 16), _mm_srli_epi32(layer2_chunk3, 16)); + + v_r0 = _mm_packus_epi32(_mm_and_si128(layer1_chunk0, v_mask), _mm_and_si128(layer1_chunk1, v_mask)); + v_g0 = _mm_packus_epi32(_mm_srli_epi32(layer1_chunk0, 16), _mm_srli_epi32(layer1_chunk1, 16)); + v_r1 = _mm_packus_epi32(_mm_and_si128(layer1_chunk2, v_mask), _mm_and_si128(layer1_chunk3, v_mask)); + v_g1 = _mm_packus_epi32(_mm_srli_epi32(layer1_chunk2, 16), _mm_srli_epi32(layer1_chunk3, 16)); +} + +inline void _mm_interleave_epi16(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0, + __m128i & v_g1, __m128i & v_b0, __m128i & v_b1) +{ + __m128i v_mask = _mm_set1_epi32(0x0000ffff); + + __m128i layer3_chunk0 = _mm_packus_epi32(_mm_and_si128(v_r0, v_mask), _mm_and_si128(v_r1, v_mask)); + __m128i layer3_chunk3 = _mm_packus_epi32(_mm_srli_epi32(v_r0, 16), _mm_srli_epi32(v_r1, 16)); + __m128i layer3_chunk1 = _mm_packus_epi32(_mm_and_si128(v_g0, v_mask), _mm_and_si128(v_g1, v_mask)); + __m128i layer3_chunk4 = _mm_packus_epi32(_mm_srli_epi32(v_g0, 16), _mm_srli_epi32(v_g1, 16)); + __m128i layer3_chunk2 = _mm_packus_epi32(_mm_and_si128(v_b0, v_mask), _mm_and_si128(v_b1, v_mask)); + __m128i layer3_chunk5 = _mm_packus_epi32(_mm_srli_epi32(v_b0, 16), _mm_srli_epi32(v_b1, 16)); + + __m128i layer2_chunk0 = _mm_packus_epi32(_mm_and_si128(layer3_chunk0, v_mask), _mm_and_si128(layer3_chunk1, v_mask)); + __m128i layer2_chunk3 = _mm_packus_epi32(_mm_srli_epi32(layer3_chunk0, 16), _mm_srli_epi32(layer3_chunk1, 16)); + __m128i layer2_chunk1 = _mm_packus_epi32(_mm_and_si128(layer3_chunk2, v_mask), _mm_and_si128(layer3_chunk3, v_mask)); + __m128i layer2_chunk4 = _mm_packus_epi32(_mm_srli_epi32(layer3_chunk2, 16), _mm_srli_epi32(layer3_chunk3, 16)); + __m128i layer2_chunk2 = _mm_packus_epi32(_mm_and_si128(layer3_chunk4, v_mask), _mm_and_si128(layer3_chunk5, v_mask)); + __m128i layer2_chunk5 = _mm_packus_epi32(_mm_srli_epi32(layer3_chunk4, 16), _mm_srli_epi32(layer3_chunk5, 16)); + + __m128i layer1_chunk0 = _mm_packus_epi32(_mm_and_si128(layer2_chunk0, v_mask), _mm_and_si128(layer2_chunk1, v_mask)); + __m128i layer1_chunk3 = _mm_packus_epi32(_mm_srli_epi32(layer2_chunk0, 16), _mm_srli_epi32(layer2_chunk1, 16)); + __m128i layer1_chunk1 = _mm_packus_epi32(_mm_and_si128(layer2_chunk2, v_mask), _mm_and_si128(layer2_chunk3, v_mask)); + __m128i layer1_chunk4 = _mm_packus_epi32(_mm_srli_epi32(layer2_chunk2, 16), _mm_srli_epi32(layer2_chunk3, 16)); + __m128i layer1_chunk2 = _mm_packus_epi32(_mm_and_si128(layer2_chunk4, v_mask), _mm_and_si128(layer2_chunk5, v_mask)); + __m128i layer1_chunk5 = _mm_packus_epi32(_mm_srli_epi32(layer2_chunk4, 16), _mm_srli_epi32(layer2_chunk5, 16)); + + v_r0 = _mm_packus_epi32(_mm_and_si128(layer1_chunk0, v_mask), _mm_and_si128(layer1_chunk1, v_mask)); + v_g1 = _mm_packus_epi32(_mm_srli_epi32(layer1_chunk0, 16), _mm_srli_epi32(layer1_chunk1, 16)); + v_r1 = _mm_packus_epi32(_mm_and_si128(layer1_chunk2, v_mask), _mm_and_si128(layer1_chunk3, v_mask)); + v_b0 = _mm_packus_epi32(_mm_srli_epi32(layer1_chunk2, 16), _mm_srli_epi32(layer1_chunk3, 16)); + v_g0 = _mm_packus_epi32(_mm_and_si128(layer1_chunk4, v_mask), _mm_and_si128(layer1_chunk5, v_mask)); + v_b1 = _mm_packus_epi32(_mm_srli_epi32(layer1_chunk4, 16), _mm_srli_epi32(layer1_chunk5, 16)); +} + +inline void _mm_interleave_epi16(__m128i & v_r0, __m128i & v_r1, __m128i & v_g0, __m128i & v_g1, + __m128i & v_b0, __m128i & v_b1, __m128i & v_a0, __m128i & v_a1) +{ + __m128i v_mask = _mm_set1_epi32(0x0000ffff); + + __m128i layer3_chunk0 = _mm_packus_epi32(_mm_and_si128(v_r0, v_mask), _mm_and_si128(v_r1, v_mask)); + __m128i layer3_chunk4 = _mm_packus_epi32(_mm_srli_epi32(v_r0, 16), _mm_srli_epi32(v_r1, 16)); + __m128i layer3_chunk1 = _mm_packus_epi32(_mm_and_si128(v_g0, v_mask), _mm_and_si128(v_g1, v_mask)); + __m128i layer3_chunk5 = _mm_packus_epi32(_mm_srli_epi32(v_g0, 16), _mm_srli_epi32(v_g1, 16)); + __m128i layer3_chunk2 = _mm_packus_epi32(_mm_and_si128(v_b0, v_mask), _mm_and_si128(v_b1, v_mask)); + __m128i layer3_chunk6 = _mm_packus_epi32(_mm_srli_epi32(v_b0, 16), _mm_srli_epi32(v_b1, 16)); + __m128i layer3_chunk3 = _mm_packus_epi32(_mm_and_si128(v_a0, v_mask), _mm_and_si128(v_a1, v_mask)); + __m128i layer3_chunk7 = _mm_packus_epi32(_mm_srli_epi32(v_a0, 16), _mm_srli_epi32(v_a1, 16)); + + __m128i layer2_chunk0 = _mm_packus_epi32(_mm_and_si128(layer3_chunk0, v_mask), _mm_and_si128(layer3_chunk1, v_mask)); + __m128i layer2_chunk4 = _mm_packus_epi32(_mm_srli_epi32(layer3_chunk0, 16), _mm_srli_epi32(layer3_chunk1, 16)); + __m128i layer2_chunk1 = _mm_packus_epi32(_mm_and_si128(layer3_chunk2, v_mask), _mm_and_si128(layer3_chunk3, v_mask)); + __m128i layer2_chunk5 = _mm_packus_epi32(_mm_srli_epi32(layer3_chunk2, 16), _mm_srli_epi32(layer3_chunk3, 16)); + __m128i layer2_chunk2 = _mm_packus_epi32(_mm_and_si128(layer3_chunk4, v_mask), _mm_and_si128(layer3_chunk5, v_mask)); + __m128i layer2_chunk6 = _mm_packus_epi32(_mm_srli_epi32(layer3_chunk4, 16), _mm_srli_epi32(layer3_chunk5, 16)); + __m128i layer2_chunk3 = _mm_packus_epi32(_mm_and_si128(layer3_chunk6, v_mask), _mm_and_si128(layer3_chunk7, v_mask)); + __m128i layer2_chunk7 = _mm_packus_epi32(_mm_srli_epi32(layer3_chunk6, 16), _mm_srli_epi32(layer3_chunk7, 16)); + + __m128i layer1_chunk0 = _mm_packus_epi32(_mm_and_si128(layer2_chunk0, v_mask), _mm_and_si128(layer2_chunk1, v_mask)); + __m128i layer1_chunk4 = _mm_packus_epi32(_mm_srli_epi32(layer2_chunk0, 16), _mm_srli_epi32(layer2_chunk1, 16)); + __m128i layer1_chunk1 = _mm_packus_epi32(_mm_and_si128(layer2_chunk2, v_mask), _mm_and_si128(layer2_chunk3, v_mask)); + __m128i layer1_chunk5 = _mm_packus_epi32(_mm_srli_epi32(layer2_chunk2, 16), _mm_srli_epi32(layer2_chunk3, 16)); + __m128i layer1_chunk2 = _mm_packus_epi32(_mm_and_si128(layer2_chunk4, v_mask), _mm_and_si128(layer2_chunk5, v_mask)); + __m128i layer1_chunk6 = _mm_packus_epi32(_mm_srli_epi32(layer2_chunk4, 16), _mm_srli_epi32(layer2_chunk5, 16)); + __m128i layer1_chunk3 = _mm_packus_epi32(_mm_and_si128(layer2_chunk6, v_mask), _mm_and_si128(layer2_chunk7, v_mask)); + __m128i layer1_chunk7 = _mm_packus_epi32(_mm_srli_epi32(layer2_chunk6, 16), _mm_srli_epi32(layer2_chunk7, 16)); + + v_r0 = _mm_packus_epi32(_mm_and_si128(layer1_chunk0, v_mask), _mm_and_si128(layer1_chunk1, v_mask)); + v_b0 = _mm_packus_epi32(_mm_srli_epi32(layer1_chunk0, 16), _mm_srli_epi32(layer1_chunk1, 16)); + v_r1 = _mm_packus_epi32(_mm_and_si128(layer1_chunk2, v_mask), _mm_and_si128(layer1_chunk3, v_mask)); + v_b1 = _mm_packus_epi32(_mm_srli_epi32(layer1_chunk2, 16), _mm_srli_epi32(layer1_chunk3, 16)); + v_g0 = _mm_packus_epi32(_mm_and_si128(layer1_chunk4, v_mask), _mm_and_si128(layer1_chunk5, v_mask)); + v_a0 = _mm_packus_epi32(_mm_srli_epi32(layer1_chunk4, 16), _mm_srli_epi32(layer1_chunk5, 16)); + v_g1 = _mm_packus_epi32(_mm_and_si128(layer1_chunk6, v_mask), _mm_and_si128(layer1_chunk7, v_mask)); + v_a1 = _mm_packus_epi32(_mm_srli_epi32(layer1_chunk6, 16), _mm_srli_epi32(layer1_chunk7, 16)); +} + +#endif // CV_SSE4_1 + +inline void _mm_deinterleave_ps(__m128 & v_r0, __m128 & v_r1, __m128 & v_g0, __m128 & v_g1) +{ + __m128 layer1_chunk0 = _mm_unpacklo_ps(v_r0, v_g0); + __m128 layer1_chunk1 = _mm_unpackhi_ps(v_r0, v_g0); + __m128 layer1_chunk2 = _mm_unpacklo_ps(v_r1, v_g1); + __m128 layer1_chunk3 = _mm_unpackhi_ps(v_r1, v_g1); + + __m128 layer2_chunk0 = _mm_unpacklo_ps(layer1_chunk0, layer1_chunk2); + __m128 layer2_chunk1 = _mm_unpackhi_ps(layer1_chunk0, layer1_chunk2); + __m128 layer2_chunk2 = _mm_unpacklo_ps(layer1_chunk1, layer1_chunk3); + __m128 layer2_chunk3 = _mm_unpackhi_ps(layer1_chunk1, layer1_chunk3); + + v_r0 = _mm_unpacklo_ps(layer2_chunk0, layer2_chunk2); + v_r1 = _mm_unpackhi_ps(layer2_chunk0, layer2_chunk2); + v_g0 = _mm_unpacklo_ps(layer2_chunk1, layer2_chunk3); + v_g1 = _mm_unpackhi_ps(layer2_chunk1, layer2_chunk3); +} + +inline void _mm_deinterleave_ps(__m128 & v_r0, __m128 & v_r1, __m128 & v_g0, + __m128 & v_g1, __m128 & v_b0, __m128 & v_b1) +{ + __m128 layer1_chunk0 = _mm_unpacklo_ps(v_r0, v_g1); + __m128 layer1_chunk1 = _mm_unpackhi_ps(v_r0, v_g1); + __m128 layer1_chunk2 = _mm_unpacklo_ps(v_r1, v_b0); + __m128 layer1_chunk3 = _mm_unpackhi_ps(v_r1, v_b0); + __m128 layer1_chunk4 = _mm_unpacklo_ps(v_g0, v_b1); + __m128 layer1_chunk5 = _mm_unpackhi_ps(v_g0, v_b1); + + __m128 layer2_chunk0 = _mm_unpacklo_ps(layer1_chunk0, layer1_chunk3); + __m128 layer2_chunk1 = _mm_unpackhi_ps(layer1_chunk0, layer1_chunk3); + __m128 layer2_chunk2 = _mm_unpacklo_ps(layer1_chunk1, layer1_chunk4); + __m128 layer2_chunk3 = _mm_unpackhi_ps(layer1_chunk1, layer1_chunk4); + __m128 layer2_chunk4 = _mm_unpacklo_ps(layer1_chunk2, layer1_chunk5); + __m128 layer2_chunk5 = _mm_unpackhi_ps(layer1_chunk2, layer1_chunk5); + + v_r0 = _mm_unpacklo_ps(layer2_chunk0, layer2_chunk3); + v_r1 = _mm_unpackhi_ps(layer2_chunk0, layer2_chunk3); + v_g0 = _mm_unpacklo_ps(layer2_chunk1, layer2_chunk4); + v_g1 = _mm_unpackhi_ps(layer2_chunk1, layer2_chunk4); + v_b0 = _mm_unpacklo_ps(layer2_chunk2, layer2_chunk5); + v_b1 = _mm_unpackhi_ps(layer2_chunk2, layer2_chunk5); +} + +inline void _mm_deinterleave_ps(__m128 & v_r0, __m128 & v_r1, __m128 & v_g0, __m128 & v_g1, + __m128 & v_b0, __m128 & v_b1, __m128 & v_a0, __m128 & v_a1) +{ + __m128 layer1_chunk0 = _mm_unpacklo_ps(v_r0, v_b0); + __m128 layer1_chunk1 = _mm_unpackhi_ps(v_r0, v_b0); + __m128 layer1_chunk2 = _mm_unpacklo_ps(v_r1, v_b1); + __m128 layer1_chunk3 = _mm_unpackhi_ps(v_r1, v_b1); + __m128 layer1_chunk4 = _mm_unpacklo_ps(v_g0, v_a0); + __m128 layer1_chunk5 = _mm_unpackhi_ps(v_g0, v_a0); + __m128 layer1_chunk6 = _mm_unpacklo_ps(v_g1, v_a1); + __m128 layer1_chunk7 = _mm_unpackhi_ps(v_g1, v_a1); + + __m128 layer2_chunk0 = _mm_unpacklo_ps(layer1_chunk0, layer1_chunk4); + __m128 layer2_chunk1 = _mm_unpackhi_ps(layer1_chunk0, layer1_chunk4); + __m128 layer2_chunk2 = _mm_unpacklo_ps(layer1_chunk1, layer1_chunk5); + __m128 layer2_chunk3 = _mm_unpackhi_ps(layer1_chunk1, layer1_chunk5); + __m128 layer2_chunk4 = _mm_unpacklo_ps(layer1_chunk2, layer1_chunk6); + __m128 layer2_chunk5 = _mm_unpackhi_ps(layer1_chunk2, layer1_chunk6); + __m128 layer2_chunk6 = _mm_unpacklo_ps(layer1_chunk3, layer1_chunk7); + __m128 layer2_chunk7 = _mm_unpackhi_ps(layer1_chunk3, layer1_chunk7); + + v_r0 = _mm_unpacklo_ps(layer2_chunk0, layer2_chunk4); + v_r1 = _mm_unpackhi_ps(layer2_chunk0, layer2_chunk4); + v_g0 = _mm_unpacklo_ps(layer2_chunk1, layer2_chunk5); + v_g1 = _mm_unpackhi_ps(layer2_chunk1, layer2_chunk5); + v_b0 = _mm_unpacklo_ps(layer2_chunk2, layer2_chunk6); + v_b1 = _mm_unpackhi_ps(layer2_chunk2, layer2_chunk6); + v_a0 = _mm_unpacklo_ps(layer2_chunk3, layer2_chunk7); + v_a1 = _mm_unpackhi_ps(layer2_chunk3, layer2_chunk7); +} + +inline void _mm_interleave_ps(__m128 & v_r0, __m128 & v_r1, __m128 & v_g0, __m128 & v_g1) +{ + const int mask_lo = _MM_SHUFFLE(2, 0, 2, 0), mask_hi = _MM_SHUFFLE(3, 1, 3, 1); + + __m128 layer2_chunk0 = _mm_shuffle_ps(v_r0, v_r1, mask_lo); + __m128 layer2_chunk2 = _mm_shuffle_ps(v_r0, v_r1, mask_hi); + __m128 layer2_chunk1 = _mm_shuffle_ps(v_g0, v_g1, mask_lo); + __m128 layer2_chunk3 = _mm_shuffle_ps(v_g0, v_g1, mask_hi); + + __m128 layer1_chunk0 = _mm_shuffle_ps(layer2_chunk0, layer2_chunk1, mask_lo); + __m128 layer1_chunk2 = _mm_shuffle_ps(layer2_chunk0, layer2_chunk1, mask_hi); + __m128 layer1_chunk1 = _mm_shuffle_ps(layer2_chunk2, layer2_chunk3, mask_lo); + __m128 layer1_chunk3 = _mm_shuffle_ps(layer2_chunk2, layer2_chunk3, mask_hi); + + v_r0 = _mm_shuffle_ps(layer1_chunk0, layer1_chunk1, mask_lo); + v_g0 = _mm_shuffle_ps(layer1_chunk0, layer1_chunk1, mask_hi); + v_r1 = _mm_shuffle_ps(layer1_chunk2, layer1_chunk3, mask_lo); + v_g1 = _mm_shuffle_ps(layer1_chunk2, layer1_chunk3, mask_hi); +} + +inline void _mm_interleave_ps(__m128 & v_r0, __m128 & v_r1, __m128 & v_g0, + __m128 & v_g1, __m128 & v_b0, __m128 & v_b1) +{ + const int mask_lo = _MM_SHUFFLE(2, 0, 2, 0), mask_hi = _MM_SHUFFLE(3, 1, 3, 1); + + __m128 layer2_chunk0 = _mm_shuffle_ps(v_r0, v_r1, mask_lo); + __m128 layer2_chunk3 = _mm_shuffle_ps(v_r0, v_r1, mask_hi); + __m128 layer2_chunk1 = _mm_shuffle_ps(v_g0, v_g1, mask_lo); + __m128 layer2_chunk4 = _mm_shuffle_ps(v_g0, v_g1, mask_hi); + __m128 layer2_chunk2 = _mm_shuffle_ps(v_b0, v_b1, mask_lo); + __m128 layer2_chunk5 = _mm_shuffle_ps(v_b0, v_b1, mask_hi); + + __m128 layer1_chunk0 = _mm_shuffle_ps(layer2_chunk0, layer2_chunk1, mask_lo); + __m128 layer1_chunk3 = _mm_shuffle_ps(layer2_chunk0, layer2_chunk1, mask_hi); + __m128 layer1_chunk1 = _mm_shuffle_ps(layer2_chunk2, layer2_chunk3, mask_lo); + __m128 layer1_chunk4 = _mm_shuffle_ps(layer2_chunk2, layer2_chunk3, mask_hi); + __m128 layer1_chunk2 = _mm_shuffle_ps(layer2_chunk4, layer2_chunk5, mask_lo); + __m128 layer1_chunk5 = _mm_shuffle_ps(layer2_chunk4, layer2_chunk5, mask_hi); + + v_r0 = _mm_shuffle_ps(layer1_chunk0, layer1_chunk1, mask_lo); + v_g1 = _mm_shuffle_ps(layer1_chunk0, layer1_chunk1, mask_hi); + v_r1 = _mm_shuffle_ps(layer1_chunk2, layer1_chunk3, mask_lo); + v_b0 = _mm_shuffle_ps(layer1_chunk2, layer1_chunk3, mask_hi); + v_g0 = _mm_shuffle_ps(layer1_chunk4, layer1_chunk5, mask_lo); + v_b1 = _mm_shuffle_ps(layer1_chunk4, layer1_chunk5, mask_hi); +} + +inline void _mm_interleave_ps(__m128 & v_r0, __m128 & v_r1, __m128 & v_g0, __m128 & v_g1, + __m128 & v_b0, __m128 & v_b1, __m128 & v_a0, __m128 & v_a1) +{ + const int mask_lo = _MM_SHUFFLE(2, 0, 2, 0), mask_hi = _MM_SHUFFLE(3, 1, 3, 1); + + __m128 layer2_chunk0 = _mm_shuffle_ps(v_r0, v_r1, mask_lo); + __m128 layer2_chunk4 = _mm_shuffle_ps(v_r0, v_r1, mask_hi); + __m128 layer2_chunk1 = _mm_shuffle_ps(v_g0, v_g1, mask_lo); + __m128 layer2_chunk5 = _mm_shuffle_ps(v_g0, v_g1, mask_hi); + __m128 layer2_chunk2 = _mm_shuffle_ps(v_b0, v_b1, mask_lo); + __m128 layer2_chunk6 = _mm_shuffle_ps(v_b0, v_b1, mask_hi); + __m128 layer2_chunk3 = _mm_shuffle_ps(v_a0, v_a1, mask_lo); + __m128 layer2_chunk7 = _mm_shuffle_ps(v_a0, v_a1, mask_hi); + + __m128 layer1_chunk0 = _mm_shuffle_ps(layer2_chunk0, layer2_chunk1, mask_lo); + __m128 layer1_chunk4 = _mm_shuffle_ps(layer2_chunk0, layer2_chunk1, mask_hi); + __m128 layer1_chunk1 = _mm_shuffle_ps(layer2_chunk2, layer2_chunk3, mask_lo); + __m128 layer1_chunk5 = _mm_shuffle_ps(layer2_chunk2, layer2_chunk3, mask_hi); + __m128 layer1_chunk2 = _mm_shuffle_ps(layer2_chunk4, layer2_chunk5, mask_lo); + __m128 layer1_chunk6 = _mm_shuffle_ps(layer2_chunk4, layer2_chunk5, mask_hi); + __m128 layer1_chunk3 = _mm_shuffle_ps(layer2_chunk6, layer2_chunk7, mask_lo); + __m128 layer1_chunk7 = _mm_shuffle_ps(layer2_chunk6, layer2_chunk7, mask_hi); + + v_r0 = _mm_shuffle_ps(layer1_chunk0, layer1_chunk1, mask_lo); + v_b0 = _mm_shuffle_ps(layer1_chunk0, layer1_chunk1, mask_hi); + v_r1 = _mm_shuffle_ps(layer1_chunk2, layer1_chunk3, mask_lo); + v_b1 = _mm_shuffle_ps(layer1_chunk2, layer1_chunk3, mask_hi); + v_g0 = _mm_shuffle_ps(layer1_chunk4, layer1_chunk5, mask_lo); + v_a0 = _mm_shuffle_ps(layer1_chunk4, layer1_chunk5, mask_hi); + v_g1 = _mm_shuffle_ps(layer1_chunk6, layer1_chunk7, mask_lo); + v_a1 = _mm_shuffle_ps(layer1_chunk6, layer1_chunk7, mask_hi); +} + +#endif // CV_SSE2 + +//! @} + +#endif //__OPENCV_CORE_SSE_UTILS_HPP__ diff --git a/lib/opencv/include/opencv2/core/traits.hpp b/lib/opencv/include/opencv2/core/traits.hpp new file mode 100644 index 000000000..49bc8440d --- /dev/null +++ b/lib/opencv/include/opencv2/core/traits.hpp @@ -0,0 +1,326 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_TRAITS_HPP__ +#define __OPENCV_CORE_TRAITS_HPP__ + +#include "opencv2/core/cvdef.h" + +namespace cv +{ + +//! @addtogroup core_basic +//! @{ + +/** @brief Template "trait" class for OpenCV primitive data types. + +A primitive OpenCV data type is one of unsigned char, bool, signed char, unsigned short, signed +short, int, float, double, or a tuple of values of one of these types, where all the values in the +tuple have the same type. Any primitive type from the list can be defined by an identifier in the +form CV_\{U|S|F}C(\), for example: uchar \~ CV_8UC1, 3-element +floating-point tuple \~ CV_32FC3, and so on. A universal OpenCV structure that is able to store a +single instance of such a primitive data type is Vec. Multiple instances of such a type can be +stored in a std::vector, Mat, Mat_, SparseMat, SparseMat_, or any other container that is able to +store Vec instances. + +The DataType class is basically used to provide a description of such primitive data types without +adding any fields or methods to the corresponding classes (and it is actually impossible to add +anything to primitive C/C++ data types). This technique is known in C++ as class traits. It is not +DataType itself that is used but its specialized versions, such as: +@code + template<> class DataType + { + typedef uchar value_type; + typedef int work_type; + typedef uchar channel_type; + enum { channel_type = CV_8U, channels = 1, fmt='u', type = CV_8U }; + }; + ... + template DataType > + { + typedef std::complex<_Tp> value_type; + typedef std::complex<_Tp> work_type; + typedef _Tp channel_type; + // DataDepth is another helper trait class + enum { depth = DataDepth<_Tp>::value, channels=2, + fmt=(channels-1)*256+DataDepth<_Tp>::fmt, + type=CV_MAKETYPE(depth, channels) }; + }; + ... +@endcode +The main purpose of this class is to convert compilation-time type information to an +OpenCV-compatible data type identifier, for example: +@code + // allocates a 30x40 floating-point matrix + Mat A(30, 40, DataType::type); + + Mat B = Mat_ >(3, 3); + // the statement below will print 6, 2 , that is depth == CV_64F, channels == 2 + cout << B.depth() << ", " << B.channels() << endl; +@endcode +So, such traits are used to tell OpenCV which data type you are working with, even if such a type is +not native to OpenCV. For example, the matrix B initialization above is compiled because OpenCV +defines the proper specialized template class DataType\ \> . This mechanism is also +useful (and used in OpenCV this way) for generic algorithms implementations. +*/ +template class DataType +{ +public: + typedef _Tp value_type; + typedef value_type work_type; + typedef value_type channel_type; + typedef value_type vec_type; + enum { generic_type = 1, + depth = -1, + channels = 1, + fmt = 0, + type = CV_MAKETYPE(depth, channels) + }; +}; + +template<> class DataType +{ +public: + typedef bool value_type; + typedef int work_type; + typedef value_type channel_type; + typedef value_type vec_type; + enum { generic_type = 0, + depth = CV_8U, + channels = 1, + fmt = (int)'u', + type = CV_MAKETYPE(depth, channels) + }; +}; + +template<> class DataType +{ +public: + typedef uchar value_type; + typedef int work_type; + typedef value_type channel_type; + typedef value_type vec_type; + enum { generic_type = 0, + depth = CV_8U, + channels = 1, + fmt = (int)'u', + type = CV_MAKETYPE(depth, channels) + }; +}; + +template<> class DataType +{ +public: + typedef schar value_type; + typedef int work_type; + typedef value_type channel_type; + typedef value_type vec_type; + enum { generic_type = 0, + depth = CV_8S, + channels = 1, + fmt = (int)'c', + type = CV_MAKETYPE(depth, channels) + }; +}; + +template<> class DataType +{ +public: + typedef schar value_type; + typedef int work_type; + typedef value_type channel_type; + typedef value_type vec_type; + enum { generic_type = 0, + depth = CV_8S, + channels = 1, + fmt = (int)'c', + type = CV_MAKETYPE(depth, channels) + }; +}; + +template<> class DataType +{ +public: + typedef ushort value_type; + typedef int work_type; + typedef value_type channel_type; + typedef value_type vec_type; + enum { generic_type = 0, + depth = CV_16U, + channels = 1, + fmt = (int)'w', + type = CV_MAKETYPE(depth, channels) + }; +}; + +template<> class DataType +{ +public: + typedef short value_type; + typedef int work_type; + typedef value_type channel_type; + typedef value_type vec_type; + enum { generic_type = 0, + depth = CV_16S, + channels = 1, + fmt = (int)'s', + type = CV_MAKETYPE(depth, channels) + }; +}; + +template<> class DataType +{ +public: + typedef int value_type; + typedef value_type work_type; + typedef value_type channel_type; + typedef value_type vec_type; + enum { generic_type = 0, + depth = CV_32S, + channels = 1, + fmt = (int)'i', + type = CV_MAKETYPE(depth, channels) + }; +}; + +template<> class DataType +{ +public: + typedef float value_type; + typedef value_type work_type; + typedef value_type channel_type; + typedef value_type vec_type; + enum { generic_type = 0, + depth = CV_32F, + channels = 1, + fmt = (int)'f', + type = CV_MAKETYPE(depth, channels) + }; +}; + +template<> class DataType +{ +public: + typedef double value_type; + typedef value_type work_type; + typedef value_type channel_type; + typedef value_type vec_type; + enum { generic_type = 0, + depth = CV_64F, + channels = 1, + fmt = (int)'d', + type = CV_MAKETYPE(depth, channels) + }; +}; + + +/** @brief A helper class for cv::DataType + +The class is specialized for each fundamental numerical data type supported by OpenCV. It provides +DataDepth::value constant. +*/ +template class DataDepth +{ +public: + enum + { + value = DataType<_Tp>::depth, + fmt = DataType<_Tp>::fmt + }; +}; + + + +template class TypeDepth +{ + enum { depth = CV_USRTYPE1 }; + typedef void value_type; +}; + +template<> class TypeDepth +{ + enum { depth = CV_8U }; + typedef uchar value_type; +}; + +template<> class TypeDepth +{ + enum { depth = CV_8S }; + typedef schar value_type; +}; + +template<> class TypeDepth +{ + enum { depth = CV_16U }; + typedef ushort value_type; +}; + +template<> class TypeDepth +{ + enum { depth = CV_16S }; + typedef short value_type; +}; + +template<> class TypeDepth +{ + enum { depth = CV_32S }; + typedef int value_type; +}; + +template<> class TypeDepth +{ + enum { depth = CV_32F }; + typedef float value_type; +}; + +template<> class TypeDepth +{ + enum { depth = CV_64F }; + typedef double value_type; +}; + +//! @} + +} // cv + +#endif // __OPENCV_CORE_TRAITS_HPP__ diff --git a/lib/opencv/include/opencv2/core/types.hpp b/lib/opencv/include/opencv2/core/types.hpp new file mode 100644 index 000000000..e166556af --- /dev/null +++ b/lib/opencv/include/opencv2/core/types.hpp @@ -0,0 +1,2228 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_TYPES_HPP__ +#define __OPENCV_CORE_TYPES_HPP__ + +#ifndef __cplusplus +# error types.hpp header must be compiled as C++ +#endif + +#include +#include +#include + +#include "opencv2/core/cvdef.h" +#include "opencv2/core/cvstd.hpp" +#include "opencv2/core/matx.hpp" + +namespace cv +{ + +//! @addtogroup core_basic +//! @{ + +//////////////////////////////// Complex ////////////////////////////// + +/** @brief A complex number class. + + The template class is similar and compatible with std::complex, however it provides slightly + more convenient access to the real and imaginary parts using through the simple field access, as opposite + to std::complex::real() and std::complex::imag(). +*/ +template class Complex +{ +public: + + //! constructors + Complex(); + Complex( _Tp _re, _Tp _im = 0 ); + + //! conversion to another data type + template operator Complex() const; + //! conjugation + Complex conj() const; + + _Tp re, im; //< the real and the imaginary parts +}; + +typedef Complex Complexf; +typedef Complex Complexd; + +template class DataType< Complex<_Tp> > +{ +public: + typedef Complex<_Tp> value_type; + typedef value_type work_type; + typedef _Tp channel_type; + + enum { generic_type = 0, + depth = DataType::depth, + channels = 2, + fmt = DataType::fmt + ((channels - 1) << 8), + type = CV_MAKETYPE(depth, channels) }; + + typedef Vec vec_type; +}; + + + +//////////////////////////////// Point_ //////////////////////////////// + +/** @brief Template class for 2D points specified by its coordinates `x` and `y`. + +An instance of the class is interchangeable with C structures, CvPoint and CvPoint2D32f . There is +also a cast operator to convert point coordinates to the specified type. The conversion from +floating-point coordinates to integer coordinates is done by rounding. Commonly, the conversion +uses this operation for each of the coordinates. Besides the class members listed in the +declaration above, the following operations on points are implemented: +@code + pt1 = pt2 + pt3; + pt1 = pt2 - pt3; + pt1 = pt2 * a; + pt1 = a * pt2; + pt1 = pt2 / a; + pt1 += pt2; + pt1 -= pt2; + pt1 *= a; + pt1 /= a; + double value = norm(pt); // L2 norm + pt1 == pt2; + pt1 != pt2; +@endcode +For your convenience, the following type aliases are defined: +@code + typedef Point_ Point2i; + typedef Point2i Point; + typedef Point_ Point2f; + typedef Point_ Point2d; +@endcode +Example: +@code + Point2f a(0.3f, 0.f), b(0.f, 0.4f); + Point pt = (a + b)*10.f; + cout << pt.x << ", " << pt.y << endl; +@endcode +*/ +template class Point_ +{ +public: + typedef _Tp value_type; + + // various constructors + Point_(); + Point_(_Tp _x, _Tp _y); + Point_(const Point_& pt); + Point_(const Size_<_Tp>& sz); + Point_(const Vec<_Tp, 2>& v); + + Point_& operator = (const Point_& pt); + //! conversion to another data type + template operator Point_<_Tp2>() const; + + //! conversion to the old-style C structures + operator Vec<_Tp, 2>() const; + + //! dot product + _Tp dot(const Point_& pt) const; + //! dot product computed in double-precision arithmetics + double ddot(const Point_& pt) const; + //! cross-product + double cross(const Point_& pt) const; + //! checks whether the point is inside the specified rectangle + bool inside(const Rect_<_Tp>& r) const; + + _Tp x, y; //< the point coordinates +}; + +typedef Point_ Point2i; +typedef Point_ Point2f; +typedef Point_ Point2d; +typedef Point2i Point; + +template class DataType< Point_<_Tp> > +{ +public: + typedef Point_<_Tp> value_type; + typedef Point_::work_type> work_type; + typedef _Tp channel_type; + + enum { generic_type = 0, + depth = DataType::depth, + channels = 2, + fmt = DataType::fmt + ((channels - 1) << 8), + type = CV_MAKETYPE(depth, channels) + }; + + typedef Vec vec_type; +}; + + + +//////////////////////////////// Point3_ //////////////////////////////// + +/** @brief Template class for 3D points specified by its coordinates `x`, `y` and `z`. + +An instance of the class is interchangeable with the C structure CvPoint2D32f . Similarly to +Point_ , the coordinates of 3D points can be converted to another type. The vector arithmetic and +comparison operations are also supported. + +The following Point3_\<\> aliases are available: +@code + typedef Point3_ Point3i; + typedef Point3_ Point3f; + typedef Point3_ Point3d; +@endcode +@see cv::Point3i, cv::Point3f and cv::Point3d +*/ +template class Point3_ +{ +public: + typedef _Tp value_type; + + // various constructors + Point3_(); + Point3_(_Tp _x, _Tp _y, _Tp _z); + Point3_(const Point3_& pt); + explicit Point3_(const Point_<_Tp>& pt); + Point3_(const Vec<_Tp, 3>& v); + + Point3_& operator = (const Point3_& pt); + //! conversion to another data type + template operator Point3_<_Tp2>() const; + //! conversion to cv::Vec<> + operator Vec<_Tp, 3>() const; + + //! dot product + _Tp dot(const Point3_& pt) const; + //! dot product computed in double-precision arithmetics + double ddot(const Point3_& pt) const; + //! cross product of the 2 3D points + Point3_ cross(const Point3_& pt) const; + + _Tp x, y, z; //< the point coordinates +}; + +typedef Point3_ Point3i; +typedef Point3_ Point3f; +typedef Point3_ Point3d; + +template class DataType< Point3_<_Tp> > +{ +public: + typedef Point3_<_Tp> value_type; + typedef Point3_::work_type> work_type; + typedef _Tp channel_type; + + enum { generic_type = 0, + depth = DataType::depth, + channels = 3, + fmt = DataType::fmt + ((channels - 1) << 8), + type = CV_MAKETYPE(depth, channels) + }; + + typedef Vec vec_type; +}; + + + +//////////////////////////////// Size_ //////////////////////////////// + +/** @brief Template class for specifying the size of an image or rectangle. + +The class includes two members called width and height. The structure can be converted to and from +the old OpenCV structures CvSize and CvSize2D32f . The same set of arithmetic and comparison +operations as for Point_ is available. + +OpenCV defines the following Size_\<\> aliases: +@code + typedef Size_ Size2i; + typedef Size2i Size; + typedef Size_ Size2f; +@endcode +*/ +template class Size_ +{ +public: + typedef _Tp value_type; + + //! various constructors + Size_(); + Size_(_Tp _width, _Tp _height); + Size_(const Size_& sz); + Size_(const Point_<_Tp>& pt); + + Size_& operator = (const Size_& sz); + //! the area (width*height) + _Tp area() const; + + //! conversion of another data type. + template operator Size_<_Tp2>() const; + + _Tp width, height; // the width and the height +}; + +typedef Size_ Size2i; +typedef Size_ Size2f; +typedef Size_ Size2d; +typedef Size2i Size; + +template class DataType< Size_<_Tp> > +{ +public: + typedef Size_<_Tp> value_type; + typedef Size_::work_type> work_type; + typedef _Tp channel_type; + + enum { generic_type = 0, + depth = DataType::depth, + channels = 2, + fmt = DataType::fmt + ((channels - 1) << 8), + type = CV_MAKETYPE(depth, channels) + }; + + typedef Vec vec_type; +}; + + + +//////////////////////////////// Rect_ //////////////////////////////// + +/** @brief Template class for 2D rectangles + +described by the following parameters: +- Coordinates of the top-left corner. This is a default interpretation of Rect_::x and Rect_::y + in OpenCV. Though, in your algorithms you may count x and y from the bottom-left corner. +- Rectangle width and height. + +OpenCV typically assumes that the top and left boundary of the rectangle are inclusive, while the +right and bottom boundaries are not. For example, the method Rect_::contains returns true if + +\f[x \leq pt.x < x+width, + y \leq pt.y < y+height\f] + +Virtually every loop over an image ROI in OpenCV (where ROI is specified by Rect_\ ) is +implemented as: +@code + for(int y = roi.y; y < roi.y + roi.height; y++) + for(int x = roi.x; x < roi.x + roi.width; x++) + { + // ... + } +@endcode +In addition to the class members, the following operations on rectangles are implemented: +- \f$\texttt{rect} = \texttt{rect} \pm \texttt{point}\f$ (shifting a rectangle by a certain offset) +- \f$\texttt{rect} = \texttt{rect} \pm \texttt{size}\f$ (expanding or shrinking a rectangle by a + certain amount) +- rect += point, rect -= point, rect += size, rect -= size (augmenting operations) +- rect = rect1 & rect2 (rectangle intersection) +- rect = rect1 | rect2 (minimum area rectangle containing rect1 and rect2 ) +- rect &= rect1, rect |= rect1 (and the corresponding augmenting operations) +- rect == rect1, rect != rect1 (rectangle comparison) + +This is an example how the partial ordering on rectangles can be established (rect1 \f$\subseteq\f$ +rect2): +@code + template inline bool + operator <= (const Rect_<_Tp>& r1, const Rect_<_Tp>& r2) + { + return (r1 & r2) == r1; + } +@endcode +For your convenience, the Rect_\<\> alias is available: cv::Rect +*/ +template class Rect_ +{ +public: + typedef _Tp value_type; + + //! various constructors + Rect_(); + Rect_(_Tp _x, _Tp _y, _Tp _width, _Tp _height); + Rect_(const Rect_& r); + Rect_(const Point_<_Tp>& org, const Size_<_Tp>& sz); + Rect_(const Point_<_Tp>& pt1, const Point_<_Tp>& pt2); + + Rect_& operator = ( const Rect_& r ); + //! the top-left corner + Point_<_Tp> tl() const; + //! the bottom-right corner + Point_<_Tp> br() const; + + //! size (width, height) of the rectangle + Size_<_Tp> size() const; + //! area (width*height) of the rectangle + _Tp area() const; + + //! conversion to another data type + template operator Rect_<_Tp2>() const; + + //! checks whether the rectangle contains the point + bool contains(const Point_<_Tp>& pt) const; + + _Tp x, y, width, height; //< the top-left corner, as well as width and height of the rectangle +}; + +typedef Rect_ Rect2i; +typedef Rect_ Rect2f; +typedef Rect_ Rect2d; +typedef Rect2i Rect; + +template class DataType< Rect_<_Tp> > +{ +public: + typedef Rect_<_Tp> value_type; + typedef Rect_::work_type> work_type; + typedef _Tp channel_type; + + enum { generic_type = 0, + depth = DataType::depth, + channels = 4, + fmt = DataType::fmt + ((channels - 1) << 8), + type = CV_MAKETYPE(depth, channels) + }; + + typedef Vec vec_type; +}; + + + +///////////////////////////// RotatedRect ///////////////////////////// + +/** @brief The class represents rotated (i.e. not up-right) rectangles on a plane. + +Each rectangle is specified by the center point (mass center), length of each side (represented by +cv::Size2f structure) and the rotation angle in degrees. + +The sample below demonstrates how to use RotatedRect: +@code + Mat image(200, 200, CV_8UC3, Scalar(0)); + RotatedRect rRect = RotatedRect(Point2f(100,100), Size2f(100,50), 30); + + Point2f vertices[4]; + rRect.points(vertices); + for (int i = 0; i < 4; i++) + line(image, vertices[i], vertices[(i+1)%4], Scalar(0,255,0)); + + Rect brect = rRect.boundingRect(); + rectangle(image, brect, Scalar(255,0,0)); + + imshow("rectangles", image); + waitKey(0); +@endcode +![image](pics/rotatedrect.png) + +@sa CamShift, fitEllipse, minAreaRect, CvBox2D +*/ +class CV_EXPORTS RotatedRect +{ +public: + //! various constructors + RotatedRect(); + /** + @param center The rectangle mass center. + @param size Width and height of the rectangle. + @param angle The rotation angle in a clockwise direction. When the angle is 0, 90, 180, 270 etc., + the rectangle becomes an up-right rectangle. + */ + RotatedRect(const Point2f& center, const Size2f& size, float angle); + /** + Any 3 end points of the RotatedRect. They must be given in order (either clockwise or + anticlockwise). + */ + RotatedRect(const Point2f& point1, const Point2f& point2, const Point2f& point3); + + /** returns 4 vertices of the rectangle + @param pts The points array for storing rectangle vertices. + */ + void points(Point2f pts[]) const; + //! returns the minimal up-right rectangle containing the rotated rectangle + Rect boundingRect() const; + + Point2f center; //< the rectangle mass center + Size2f size; //< width and height of the rectangle + float angle; //< the rotation angle. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right rectangle. +}; + +template<> class DataType< RotatedRect > +{ +public: + typedef RotatedRect value_type; + typedef value_type work_type; + typedef float channel_type; + + enum { generic_type = 0, + depth = DataType::depth, + channels = (int)sizeof(value_type)/sizeof(channel_type), // 5 + fmt = DataType::fmt + ((channels - 1) << 8), + type = CV_MAKETYPE(depth, channels) + }; + + typedef Vec vec_type; +}; + + + +//////////////////////////////// Range ///////////////////////////////// + +/** @brief Template class specifying a continuous subsequence (slice) of a sequence. + +The class is used to specify a row or a column span in a matrix ( Mat ) and for many other purposes. +Range(a,b) is basically the same as a:b in Matlab or a..b in Python. As in Python, start is an +inclusive left boundary of the range and end is an exclusive right boundary of the range. Such a +half-opened interval is usually denoted as \f$[start,end)\f$ . + +The static method Range::all() returns a special variable that means "the whole sequence" or "the +whole range", just like " : " in Matlab or " ... " in Python. All the methods and functions in +OpenCV that take Range support this special Range::all() value. But, of course, in case of your own +custom processing, you will probably have to check and handle it explicitly: +@code + void my_function(..., const Range& r, ....) + { + if(r == Range::all()) { + // process all the data + } + else { + // process [r.start, r.end) + } + } +@endcode +*/ +class CV_EXPORTS Range +{ +public: + Range(); + Range(int _start, int _end); + int size() const; + bool empty() const; + static Range all(); + + int start, end; +}; + +template<> class DataType +{ +public: + typedef Range value_type; + typedef value_type work_type; + typedef int channel_type; + + enum { generic_type = 0, + depth = DataType::depth, + channels = 2, + fmt = DataType::fmt + ((channels - 1) << 8), + type = CV_MAKETYPE(depth, channels) + }; + + typedef Vec vec_type; +}; + + + +//////////////////////////////// Scalar_ /////////////////////////////// + +/** @brief Template class for a 4-element vector derived from Vec. + +Being derived from Vec\<_Tp, 4\> , Scalar_ and Scalar can be used just as typical 4-element +vectors. In addition, they can be converted to/from CvScalar . The type Scalar is widely used in +OpenCV to pass pixel values. +*/ +template class Scalar_ : public Vec<_Tp, 4> +{ +public: + //! various constructors + Scalar_(); + Scalar_(_Tp v0, _Tp v1, _Tp v2=0, _Tp v3=0); + Scalar_(_Tp v0); + + template + Scalar_(const Vec<_Tp2, cn>& v); + + //! returns a scalar with all elements set to v0 + static Scalar_<_Tp> all(_Tp v0); + + //! conversion to another data type + template operator Scalar_() const; + + //! per-element product + Scalar_<_Tp> mul(const Scalar_<_Tp>& a, double scale=1 ) const; + + // returns (v0, -v1, -v2, -v3) + Scalar_<_Tp> conj() const; + + // returns true iff v1 == v2 == v3 == 0 + bool isReal() const; +}; + +typedef Scalar_ Scalar; + +template class DataType< Scalar_<_Tp> > +{ +public: + typedef Scalar_<_Tp> value_type; + typedef Scalar_::work_type> work_type; + typedef _Tp channel_type; + + enum { generic_type = 0, + depth = DataType::depth, + channels = 4, + fmt = DataType::fmt + ((channels - 1) << 8), + type = CV_MAKETYPE(depth, channels) + }; + + typedef Vec vec_type; +}; + + + +/////////////////////////////// KeyPoint //////////////////////////////// + +/** @brief Data structure for salient point detectors. + +The class instance stores a keypoint, i.e. a point feature found by one of many available keypoint +detectors, such as Harris corner detector, cv::FAST, cv::StarDetector, cv::SURF, cv::SIFT, +cv::LDetector etc. + +The keypoint is characterized by the 2D position, scale (proportional to the diameter of the +neighborhood that needs to be taken into account), orientation and some other parameters. The +keypoint neighborhood is then analyzed by another algorithm that builds a descriptor (usually +represented as a feature vector). The keypoints representing the same object in different images +can then be matched using cv::KDTree or another method. +*/ +class CV_EXPORTS_W_SIMPLE KeyPoint +{ +public: + //! the default constructor + CV_WRAP KeyPoint(); + /** + @param _pt x & y coordinates of the keypoint + @param _size keypoint diameter + @param _angle keypoint orientation + @param _response keypoint detector response on the keypoint (that is, strength of the keypoint) + @param _octave pyramid octave in which the keypoint has been detected + @param _class_id object id + */ + KeyPoint(Point2f _pt, float _size, float _angle=-1, float _response=0, int _octave=0, int _class_id=-1); + /** + @param x x-coordinate of the keypoint + @param y y-coordinate of the keypoint + @param _size keypoint diameter + @param _angle keypoint orientation + @param _response keypoint detector response on the keypoint (that is, strength of the keypoint) + @param _octave pyramid octave in which the keypoint has been detected + @param _class_id object id + */ + CV_WRAP KeyPoint(float x, float y, float _size, float _angle=-1, float _response=0, int _octave=0, int _class_id=-1); + + size_t hash() const; + + /** + This method converts vector of keypoints to vector of points or the reverse, where each keypoint is + assigned the same size and the same orientation. + + @param keypoints Keypoints obtained from any feature detection algorithm like SIFT/SURF/ORB + @param points2f Array of (x,y) coordinates of each keypoint + @param keypointIndexes Array of indexes of keypoints to be converted to points. (Acts like a mask to + convert only specified keypoints) + */ + CV_WRAP static void convert(const std::vector& keypoints, + CV_OUT std::vector& points2f, + const std::vector& keypointIndexes=std::vector()); + /** @overload + @param points2f Array of (x,y) coordinates of each keypoint + @param keypoints Keypoints obtained from any feature detection algorithm like SIFT/SURF/ORB + @param size keypoint diameter + @param response keypoint detector response on the keypoint (that is, strength of the keypoint) + @param octave pyramid octave in which the keypoint has been detected + @param class_id object id + */ + CV_WRAP static void convert(const std::vector& points2f, + CV_OUT std::vector& keypoints, + float size=1, float response=1, int octave=0, int class_id=-1); + + /** + This method computes overlap for pair of keypoints. Overlap is the ratio between area of keypoint + regions' intersection and area of keypoint regions' union (considering keypoint region as circle). + If they don't overlap, we get zero. If they coincide at same location with same size, we get 1. + @param kp1 First keypoint + @param kp2 Second keypoint + */ + CV_WRAP static float overlap(const KeyPoint& kp1, const KeyPoint& kp2); + + CV_PROP_RW Point2f pt; //!< coordinates of the keypoints + CV_PROP_RW float size; //!< diameter of the meaningful keypoint neighborhood + CV_PROP_RW float angle; //!< computed orientation of the keypoint (-1 if not applicable); + //!< it's in [0,360) degrees and measured relative to + //!< image coordinate system, ie in clockwise. + CV_PROP_RW float response; //!< the response by which the most strong keypoints have been selected. Can be used for the further sorting or subsampling + CV_PROP_RW int octave; //!< octave (pyramid layer) from which the keypoint has been extracted + CV_PROP_RW int class_id; //!< object class (if the keypoints need to be clustered by an object they belong to) +}; + +template<> class DataType +{ +public: + typedef KeyPoint value_type; + typedef float work_type; + typedef float channel_type; + + enum { generic_type = 0, + depth = DataType::depth, + channels = (int)(sizeof(value_type)/sizeof(channel_type)), // 7 + fmt = DataType::fmt + ((channels - 1) << 8), + type = CV_MAKETYPE(depth, channels) + }; + + typedef Vec vec_type; +}; + + + +//////////////////////////////// DMatch ///////////////////////////////// + +/** @brief Class for matching keypoint descriptors + +query descriptor index, train descriptor index, train image index, and distance between +descriptors. +*/ +class CV_EXPORTS_W_SIMPLE DMatch +{ +public: + CV_WRAP DMatch(); + CV_WRAP DMatch(int _queryIdx, int _trainIdx, float _distance); + CV_WRAP DMatch(int _queryIdx, int _trainIdx, int _imgIdx, float _distance); + + CV_PROP_RW int queryIdx; // query descriptor index + CV_PROP_RW int trainIdx; // train descriptor index + CV_PROP_RW int imgIdx; // train image index + + CV_PROP_RW float distance; + + // less is better + bool operator<(const DMatch &m) const; +}; + +template<> class DataType +{ +public: + typedef DMatch value_type; + typedef int work_type; + typedef int channel_type; + + enum { generic_type = 0, + depth = DataType::depth, + channels = (int)(sizeof(value_type)/sizeof(channel_type)), // 4 + fmt = DataType::fmt + ((channels - 1) << 8), + type = CV_MAKETYPE(depth, channels) + }; + + typedef Vec vec_type; +}; + + + +///////////////////////////// TermCriteria ////////////////////////////// + +/** @brief The class defining termination criteria for iterative algorithms. + +You can initialize it by default constructor and then override any parameters, or the structure may +be fully initialized using the advanced variant of the constructor. +*/ +class CV_EXPORTS TermCriteria +{ +public: + /** + Criteria type, can be one of: COUNT, EPS or COUNT + EPS + */ + enum Type + { + COUNT=1, //!< the maximum number of iterations or elements to compute + MAX_ITER=COUNT, //!< ditto + EPS=2 //!< the desired accuracy or change in parameters at which the iterative algorithm stops + }; + + //! default constructor + TermCriteria(); + /** + @param type The type of termination criteria, one of TermCriteria::Type + @param maxCount The maximum number of iterations or elements to compute. + @param epsilon The desired accuracy or change in parameters at which the iterative algorithm stops. + */ + TermCriteria(int type, int maxCount, double epsilon); + + int type; //!< the type of termination criteria: COUNT, EPS or COUNT + EPS + int maxCount; // the maximum number of iterations/elements + double epsilon; // the desired accuracy +}; + + +//! @} core_basic + +///////////////////////// raster image moments ////////////////////////// + +//! @addtogroup imgproc_shape +//! @{ + +/** @brief struct returned by cv::moments + +The spatial moments \f$\texttt{Moments::m}_{ji}\f$ are computed as: + +\f[\texttt{m} _{ji}= \sum _{x,y} \left ( \texttt{array} (x,y) \cdot x^j \cdot y^i \right )\f] + +The central moments \f$\texttt{Moments::mu}_{ji}\f$ are computed as: + +\f[\texttt{mu} _{ji}= \sum _{x,y} \left ( \texttt{array} (x,y) \cdot (x - \bar{x} )^j \cdot (y - \bar{y} )^i \right )\f] + +where \f$(\bar{x}, \bar{y})\f$ is the mass center: + +\f[\bar{x} = \frac{\texttt{m}_{10}}{\texttt{m}_{00}} , \; \bar{y} = \frac{\texttt{m}_{01}}{\texttt{m}_{00}}\f] + +The normalized central moments \f$\texttt{Moments::nu}_{ij}\f$ are computed as: + +\f[\texttt{nu} _{ji}= \frac{\texttt{mu}_{ji}}{\texttt{m}_{00}^{(i+j)/2+1}} .\f] + +@note +\f$\texttt{mu}_{00}=\texttt{m}_{00}\f$, \f$\texttt{nu}_{00}=1\f$ +\f$\texttt{nu}_{10}=\texttt{mu}_{10}=\texttt{mu}_{01}=\texttt{mu}_{10}=0\f$ , hence the values are not +stored. + +The moments of a contour are defined in the same way but computed using the Green's formula (see +). So, due to a limited raster resolution, the moments +computed for a contour are slightly different from the moments computed for the same rasterized +contour. + +@note +Since the contour moments are computed using Green formula, you may get seemingly odd results for +contours with self-intersections, e.g. a zero area (m00) for butterfly-shaped contours. + */ +class CV_EXPORTS_W_MAP Moments +{ +public: + //! the default constructor + Moments(); + //! the full constructor + Moments(double m00, double m10, double m01, double m20, double m11, + double m02, double m30, double m21, double m12, double m03 ); + ////! the conversion from CvMoments + //Moments( const CvMoments& moments ); + ////! the conversion to CvMoments + //operator CvMoments() const; + + //! @name spatial moments + //! @{ + CV_PROP_RW double m00, m10, m01, m20, m11, m02, m30, m21, m12, m03; + //! @} + + //! @name central moments + //! @{ + CV_PROP_RW double mu20, mu11, mu02, mu30, mu21, mu12, mu03; + //! @} + + //! @name central normalized moments + //! @{ + CV_PROP_RW double nu20, nu11, nu02, nu30, nu21, nu12, nu03; + //! @} +}; + +template<> class DataType +{ +public: + typedef Moments value_type; + typedef double work_type; + typedef double channel_type; + + enum { generic_type = 0, + depth = DataType::depth, + channels = (int)(sizeof(value_type)/sizeof(channel_type)), // 24 + fmt = DataType::fmt + ((channels - 1) << 8), + type = CV_MAKETYPE(depth, channels) + }; + + typedef Vec vec_type; +}; + +//! @} imgproc_shape + +//! @cond IGNORED + +///////////////////////////////////////////////////////////////////////// +///////////////////////////// Implementation //////////////////////////// +///////////////////////////////////////////////////////////////////////// + +//////////////////////////////// Complex //////////////////////////////// + +template inline +Complex<_Tp>::Complex() + : re(0), im(0) {} + +template inline +Complex<_Tp>::Complex( _Tp _re, _Tp _im ) + : re(_re), im(_im) {} + +template template inline +Complex<_Tp>::operator Complex() const +{ + return Complex(saturate_cast(re), saturate_cast(im)); +} + +template inline +Complex<_Tp> Complex<_Tp>::conj() const +{ + return Complex<_Tp>(re, -im); +} + + +template static inline +bool operator == (const Complex<_Tp>& a, const Complex<_Tp>& b) +{ + return a.re == b.re && a.im == b.im; +} + +template static inline +bool operator != (const Complex<_Tp>& a, const Complex<_Tp>& b) +{ + return a.re != b.re || a.im != b.im; +} + +template static inline +Complex<_Tp> operator + (const Complex<_Tp>& a, const Complex<_Tp>& b) +{ + return Complex<_Tp>( a.re + b.re, a.im + b.im ); +} + +template static inline +Complex<_Tp>& operator += (Complex<_Tp>& a, const Complex<_Tp>& b) +{ + a.re += b.re; a.im += b.im; + return a; +} + +template static inline +Complex<_Tp> operator - (const Complex<_Tp>& a, const Complex<_Tp>& b) +{ + return Complex<_Tp>( a.re - b.re, a.im - b.im ); +} + +template static inline +Complex<_Tp>& operator -= (Complex<_Tp>& a, const Complex<_Tp>& b) +{ + a.re -= b.re; a.im -= b.im; + return a; +} + +template static inline +Complex<_Tp> operator - (const Complex<_Tp>& a) +{ + return Complex<_Tp>(-a.re, -a.im); +} + +template static inline +Complex<_Tp> operator * (const Complex<_Tp>& a, const Complex<_Tp>& b) +{ + return Complex<_Tp>( a.re*b.re - a.im*b.im, a.re*b.im + a.im*b.re ); +} + +template static inline +Complex<_Tp> operator * (const Complex<_Tp>& a, _Tp b) +{ + return Complex<_Tp>( a.re*b, a.im*b ); +} + +template static inline +Complex<_Tp> operator * (_Tp b, const Complex<_Tp>& a) +{ + return Complex<_Tp>( a.re*b, a.im*b ); +} + +template static inline +Complex<_Tp> operator + (const Complex<_Tp>& a, _Tp b) +{ + return Complex<_Tp>( a.re + b, a.im ); +} + +template static inline +Complex<_Tp> operator - (const Complex<_Tp>& a, _Tp b) +{ return Complex<_Tp>( a.re - b, a.im ); } + +template static inline +Complex<_Tp> operator + (_Tp b, const Complex<_Tp>& a) +{ + return Complex<_Tp>( a.re + b, a.im ); +} + +template static inline +Complex<_Tp> operator - (_Tp b, const Complex<_Tp>& a) +{ + return Complex<_Tp>( b - a.re, -a.im ); +} + +template static inline +Complex<_Tp>& operator += (Complex<_Tp>& a, _Tp b) +{ + a.re += b; return a; +} + +template static inline +Complex<_Tp>& operator -= (Complex<_Tp>& a, _Tp b) +{ + a.re -= b; return a; +} + +template static inline +Complex<_Tp>& operator *= (Complex<_Tp>& a, _Tp b) +{ + a.re *= b; a.im *= b; return a; +} + +template static inline +double abs(const Complex<_Tp>& a) +{ + return std::sqrt( (double)a.re*a.re + (double)a.im*a.im); +} + +template static inline +Complex<_Tp> operator / (const Complex<_Tp>& a, const Complex<_Tp>& b) +{ + double t = 1./((double)b.re*b.re + (double)b.im*b.im); + return Complex<_Tp>( (_Tp)((a.re*b.re + a.im*b.im)*t), + (_Tp)((-a.re*b.im + a.im*b.re)*t) ); +} + +template static inline +Complex<_Tp>& operator /= (Complex<_Tp>& a, const Complex<_Tp>& b) +{ + return (a = a / b); +} + +template static inline +Complex<_Tp> operator / (const Complex<_Tp>& a, _Tp b) +{ + _Tp t = (_Tp)1/b; + return Complex<_Tp>( a.re*t, a.im*t ); +} + +template static inline +Complex<_Tp> operator / (_Tp b, const Complex<_Tp>& a) +{ + return Complex<_Tp>(b)/a; +} + +template static inline +Complex<_Tp> operator /= (const Complex<_Tp>& a, _Tp b) +{ + _Tp t = (_Tp)1/b; + a.re *= t; a.im *= t; return a; +} + + + +//////////////////////////////// 2D Point /////////////////////////////// + +template inline +Point_<_Tp>::Point_() + : x(0), y(0) {} + +template inline +Point_<_Tp>::Point_(_Tp _x, _Tp _y) + : x(_x), y(_y) {} + +template inline +Point_<_Tp>::Point_(const Point_& pt) + : x(pt.x), y(pt.y) {} + +template inline +Point_<_Tp>::Point_(const Size_<_Tp>& sz) + : x(sz.width), y(sz.height) {} + +template inline +Point_<_Tp>::Point_(const Vec<_Tp,2>& v) + : x(v[0]), y(v[1]) {} + +template inline +Point_<_Tp>& Point_<_Tp>::operator = (const Point_& pt) +{ + x = pt.x; y = pt.y; + return *this; +} + +template template inline +Point_<_Tp>::operator Point_<_Tp2>() const +{ + return Point_<_Tp2>(saturate_cast<_Tp2>(x), saturate_cast<_Tp2>(y)); +} + +template inline +Point_<_Tp>::operator Vec<_Tp, 2>() const +{ + return Vec<_Tp, 2>(x, y); +} + +template inline +_Tp Point_<_Tp>::dot(const Point_& pt) const +{ + return saturate_cast<_Tp>(x*pt.x + y*pt.y); +} + +template inline +double Point_<_Tp>::ddot(const Point_& pt) const +{ + return (double)x*pt.x + (double)y*pt.y; +} + +template inline +double Point_<_Tp>::cross(const Point_& pt) const +{ + return (double)x*pt.y - (double)y*pt.x; +} + +template inline bool +Point_<_Tp>::inside( const Rect_<_Tp>& r ) const +{ + return r.contains(*this); +} + + +template static inline +Point_<_Tp>& operator += (Point_<_Tp>& a, const Point_<_Tp>& b) +{ + a.x += b.x; + a.y += b.y; + return a; +} + +template static inline +Point_<_Tp>& operator -= (Point_<_Tp>& a, const Point_<_Tp>& b) +{ + a.x -= b.x; + a.y -= b.y; + return a; +} + +template static inline +Point_<_Tp>& operator *= (Point_<_Tp>& a, int b) +{ + a.x = saturate_cast<_Tp>(a.x * b); + a.y = saturate_cast<_Tp>(a.y * b); + return a; +} + +template static inline +Point_<_Tp>& operator *= (Point_<_Tp>& a, float b) +{ + a.x = saturate_cast<_Tp>(a.x * b); + a.y = saturate_cast<_Tp>(a.y * b); + return a; +} + +template static inline +Point_<_Tp>& operator *= (Point_<_Tp>& a, double b) +{ + a.x = saturate_cast<_Tp>(a.x * b); + a.y = saturate_cast<_Tp>(a.y * b); + return a; +} + +template static inline +Point_<_Tp>& operator /= (Point_<_Tp>& a, int b) +{ + a.x = saturate_cast<_Tp>(a.x / b); + a.y = saturate_cast<_Tp>(a.y / b); + return a; +} + +template static inline +Point_<_Tp>& operator /= (Point_<_Tp>& a, float b) +{ + a.x = saturate_cast<_Tp>(a.x / b); + a.y = saturate_cast<_Tp>(a.y / b); + return a; +} + +template static inline +Point_<_Tp>& operator /= (Point_<_Tp>& a, double b) +{ + a.x = saturate_cast<_Tp>(a.x / b); + a.y = saturate_cast<_Tp>(a.y / b); + return a; +} + +template static inline +double norm(const Point_<_Tp>& pt) +{ + return std::sqrt((double)pt.x*pt.x + (double)pt.y*pt.y); +} + +template static inline +bool operator == (const Point_<_Tp>& a, const Point_<_Tp>& b) +{ + return a.x == b.x && a.y == b.y; +} + +template static inline +bool operator != (const Point_<_Tp>& a, const Point_<_Tp>& b) +{ + return a.x != b.x || a.y != b.y; +} + +template static inline +Point_<_Tp> operator + (const Point_<_Tp>& a, const Point_<_Tp>& b) +{ + return Point_<_Tp>( saturate_cast<_Tp>(a.x + b.x), saturate_cast<_Tp>(a.y + b.y) ); +} + +template static inline +Point_<_Tp> operator - (const Point_<_Tp>& a, const Point_<_Tp>& b) +{ + return Point_<_Tp>( saturate_cast<_Tp>(a.x - b.x), saturate_cast<_Tp>(a.y - b.y) ); +} + +template static inline +Point_<_Tp> operator - (const Point_<_Tp>& a) +{ + return Point_<_Tp>( saturate_cast<_Tp>(-a.x), saturate_cast<_Tp>(-a.y) ); +} + +template static inline +Point_<_Tp> operator * (const Point_<_Tp>& a, int b) +{ + return Point_<_Tp>( saturate_cast<_Tp>(a.x*b), saturate_cast<_Tp>(a.y*b) ); +} + +template static inline +Point_<_Tp> operator * (int a, const Point_<_Tp>& b) +{ + return Point_<_Tp>( saturate_cast<_Tp>(b.x*a), saturate_cast<_Tp>(b.y*a) ); +} + +template static inline +Point_<_Tp> operator * (const Point_<_Tp>& a, float b) +{ + return Point_<_Tp>( saturate_cast<_Tp>(a.x*b), saturate_cast<_Tp>(a.y*b) ); +} + +template static inline +Point_<_Tp> operator * (float a, const Point_<_Tp>& b) +{ + return Point_<_Tp>( saturate_cast<_Tp>(b.x*a), saturate_cast<_Tp>(b.y*a) ); +} + +template static inline +Point_<_Tp> operator * (const Point_<_Tp>& a, double b) +{ + return Point_<_Tp>( saturate_cast<_Tp>(a.x*b), saturate_cast<_Tp>(a.y*b) ); +} + +template static inline +Point_<_Tp> operator * (double a, const Point_<_Tp>& b) +{ + return Point_<_Tp>( saturate_cast<_Tp>(b.x*a), saturate_cast<_Tp>(b.y*a) ); +} + +template static inline +Point_<_Tp> operator * (const Matx<_Tp, 2, 2>& a, const Point_<_Tp>& b) +{ + Matx<_Tp, 2, 1> tmp = a * Vec<_Tp,2>(b.x, b.y); + return Point_<_Tp>(tmp.val[0], tmp.val[1]); +} + +template static inline +Point3_<_Tp> operator * (const Matx<_Tp, 3, 3>& a, const Point_<_Tp>& b) +{ + Matx<_Tp, 3, 1> tmp = a * Vec<_Tp,3>(b.x, b.y, 1); + return Point3_<_Tp>(tmp.val[0], tmp.val[1], tmp.val[2]); +} + +template static inline +Point_<_Tp> operator / (const Point_<_Tp>& a, int b) +{ + Point_<_Tp> tmp(a); + tmp /= b; + return tmp; +} + +template static inline +Point_<_Tp> operator / (const Point_<_Tp>& a, float b) +{ + Point_<_Tp> tmp(a); + tmp /= b; + return tmp; +} + +template static inline +Point_<_Tp> operator / (const Point_<_Tp>& a, double b) +{ + Point_<_Tp> tmp(a); + tmp /= b; + return tmp; +} + + + +//////////////////////////////// 3D Point /////////////////////////////// + +template inline +Point3_<_Tp>::Point3_() + : x(0), y(0), z(0) {} + +template inline +Point3_<_Tp>::Point3_(_Tp _x, _Tp _y, _Tp _z) + : x(_x), y(_y), z(_z) {} + +template inline +Point3_<_Tp>::Point3_(const Point3_& pt) + : x(pt.x), y(pt.y), z(pt.z) {} + +template inline +Point3_<_Tp>::Point3_(const Point_<_Tp>& pt) + : x(pt.x), y(pt.y), z(_Tp()) {} + +template inline +Point3_<_Tp>::Point3_(const Vec<_Tp, 3>& v) + : x(v[0]), y(v[1]), z(v[2]) {} + +template template inline +Point3_<_Tp>::operator Point3_<_Tp2>() const +{ + return Point3_<_Tp2>(saturate_cast<_Tp2>(x), saturate_cast<_Tp2>(y), saturate_cast<_Tp2>(z)); +} + +template inline +Point3_<_Tp>::operator Vec<_Tp, 3>() const +{ + return Vec<_Tp, 3>(x, y, z); +} + +template inline +Point3_<_Tp>& Point3_<_Tp>::operator = (const Point3_& pt) +{ + x = pt.x; y = pt.y; z = pt.z; + return *this; +} + +template inline +_Tp Point3_<_Tp>::dot(const Point3_& pt) const +{ + return saturate_cast<_Tp>(x*pt.x + y*pt.y + z*pt.z); +} + +template inline +double Point3_<_Tp>::ddot(const Point3_& pt) const +{ + return (double)x*pt.x + (double)y*pt.y + (double)z*pt.z; +} + +template inline +Point3_<_Tp> Point3_<_Tp>::cross(const Point3_<_Tp>& pt) const +{ + return Point3_<_Tp>(y*pt.z - z*pt.y, z*pt.x - x*pt.z, x*pt.y - y*pt.x); +} + + +template static inline +Point3_<_Tp>& operator += (Point3_<_Tp>& a, const Point3_<_Tp>& b) +{ + a.x += b.x; + a.y += b.y; + a.z += b.z; + return a; +} + +template static inline +Point3_<_Tp>& operator -= (Point3_<_Tp>& a, const Point3_<_Tp>& b) +{ + a.x -= b.x; + a.y -= b.y; + a.z -= b.z; + return a; +} + +template static inline +Point3_<_Tp>& operator *= (Point3_<_Tp>& a, int b) +{ + a.x = saturate_cast<_Tp>(a.x * b); + a.y = saturate_cast<_Tp>(a.y * b); + a.z = saturate_cast<_Tp>(a.z * b); + return a; +} + +template static inline +Point3_<_Tp>& operator *= (Point3_<_Tp>& a, float b) +{ + a.x = saturate_cast<_Tp>(a.x * b); + a.y = saturate_cast<_Tp>(a.y * b); + a.z = saturate_cast<_Tp>(a.z * b); + return a; +} + +template static inline +Point3_<_Tp>& operator *= (Point3_<_Tp>& a, double b) +{ + a.x = saturate_cast<_Tp>(a.x * b); + a.y = saturate_cast<_Tp>(a.y * b); + a.z = saturate_cast<_Tp>(a.z * b); + return a; +} + +template static inline +Point3_<_Tp>& operator /= (Point3_<_Tp>& a, int b) +{ + a.x = saturate_cast<_Tp>(a.x / b); + a.y = saturate_cast<_Tp>(a.y / b); + a.z = saturate_cast<_Tp>(a.z / b); + return a; +} + +template static inline +Point3_<_Tp>& operator /= (Point3_<_Tp>& a, float b) +{ + a.x = saturate_cast<_Tp>(a.x / b); + a.y = saturate_cast<_Tp>(a.y / b); + a.z = saturate_cast<_Tp>(a.z / b); + return a; +} + +template static inline +Point3_<_Tp>& operator /= (Point3_<_Tp>& a, double b) +{ + a.x = saturate_cast<_Tp>(a.x / b); + a.y = saturate_cast<_Tp>(a.y / b); + a.z = saturate_cast<_Tp>(a.z / b); + return a; +} + +template static inline +double norm(const Point3_<_Tp>& pt) +{ + return std::sqrt((double)pt.x*pt.x + (double)pt.y*pt.y + (double)pt.z*pt.z); +} + +template static inline +bool operator == (const Point3_<_Tp>& a, const Point3_<_Tp>& b) +{ + return a.x == b.x && a.y == b.y && a.z == b.z; +} + +template static inline +bool operator != (const Point3_<_Tp>& a, const Point3_<_Tp>& b) +{ + return a.x != b.x || a.y != b.y || a.z != b.z; +} + +template static inline +Point3_<_Tp> operator + (const Point3_<_Tp>& a, const Point3_<_Tp>& b) +{ + return Point3_<_Tp>( saturate_cast<_Tp>(a.x + b.x), saturate_cast<_Tp>(a.y + b.y), saturate_cast<_Tp>(a.z + b.z)); +} + +template static inline +Point3_<_Tp> operator - (const Point3_<_Tp>& a, const Point3_<_Tp>& b) +{ + return Point3_<_Tp>( saturate_cast<_Tp>(a.x - b.x), saturate_cast<_Tp>(a.y - b.y), saturate_cast<_Tp>(a.z - b.z)); +} + +template static inline +Point3_<_Tp> operator - (const Point3_<_Tp>& a) +{ + return Point3_<_Tp>( saturate_cast<_Tp>(-a.x), saturate_cast<_Tp>(-a.y), saturate_cast<_Tp>(-a.z) ); +} + +template static inline +Point3_<_Tp> operator * (const Point3_<_Tp>& a, int b) +{ + return Point3_<_Tp>( saturate_cast<_Tp>(a.x*b), saturate_cast<_Tp>(a.y*b), saturate_cast<_Tp>(a.z*b) ); +} + +template static inline +Point3_<_Tp> operator * (int a, const Point3_<_Tp>& b) +{ + return Point3_<_Tp>( saturate_cast<_Tp>(b.x * a), saturate_cast<_Tp>(b.y * a), saturate_cast<_Tp>(b.z * a) ); +} + +template static inline +Point3_<_Tp> operator * (const Point3_<_Tp>& a, float b) +{ + return Point3_<_Tp>( saturate_cast<_Tp>(a.x * b), saturate_cast<_Tp>(a.y * b), saturate_cast<_Tp>(a.z * b) ); +} + +template static inline +Point3_<_Tp> operator * (float a, const Point3_<_Tp>& b) +{ + return Point3_<_Tp>( saturate_cast<_Tp>(b.x * a), saturate_cast<_Tp>(b.y * a), saturate_cast<_Tp>(b.z * a) ); +} + +template static inline +Point3_<_Tp> operator * (const Point3_<_Tp>& a, double b) +{ + return Point3_<_Tp>( saturate_cast<_Tp>(a.x * b), saturate_cast<_Tp>(a.y * b), saturate_cast<_Tp>(a.z * b) ); +} + +template static inline +Point3_<_Tp> operator * (double a, const Point3_<_Tp>& b) +{ + return Point3_<_Tp>( saturate_cast<_Tp>(b.x * a), saturate_cast<_Tp>(b.y * a), saturate_cast<_Tp>(b.z * a) ); +} + +template static inline +Point3_<_Tp> operator * (const Matx<_Tp, 3, 3>& a, const Point3_<_Tp>& b) +{ + Matx<_Tp, 3, 1> tmp = a * Vec<_Tp,3>(b.x, b.y, b.z); + return Point3_<_Tp>(tmp.val[0], tmp.val[1], tmp.val[2]); +} + +template static inline +Matx<_Tp, 4, 1> operator * (const Matx<_Tp, 4, 4>& a, const Point3_<_Tp>& b) +{ + return a * Matx<_Tp, 4, 1>(b.x, b.y, b.z, 1); +} + +template static inline +Point3_<_Tp> operator / (const Point3_<_Tp>& a, int b) +{ + Point3_<_Tp> tmp(a); + tmp /= b; + return tmp; +} + +template static inline +Point3_<_Tp> operator / (const Point3_<_Tp>& a, float b) +{ + Point3_<_Tp> tmp(a); + tmp /= b; + return tmp; +} + +template static inline +Point3_<_Tp> operator / (const Point3_<_Tp>& a, double b) +{ + Point3_<_Tp> tmp(a); + tmp /= b; + return tmp; +} + + + +////////////////////////////////// Size ///////////////////////////////// + +template inline +Size_<_Tp>::Size_() + : width(0), height(0) {} + +template inline +Size_<_Tp>::Size_(_Tp _width, _Tp _height) + : width(_width), height(_height) {} + +template inline +Size_<_Tp>::Size_(const Size_& sz) + : width(sz.width), height(sz.height) {} + +template inline +Size_<_Tp>::Size_(const Point_<_Tp>& pt) + : width(pt.x), height(pt.y) {} + +template template inline +Size_<_Tp>::operator Size_<_Tp2>() const +{ + return Size_<_Tp2>(saturate_cast<_Tp2>(width), saturate_cast<_Tp2>(height)); +} + +template inline +Size_<_Tp>& Size_<_Tp>::operator = (const Size_<_Tp>& sz) +{ + width = sz.width; height = sz.height; + return *this; +} + +template inline +_Tp Size_<_Tp>::area() const +{ + return width * height; +} + +template static inline +Size_<_Tp>& operator *= (Size_<_Tp>& a, _Tp b) +{ + a.width *= b; + a.height *= b; + return a; +} + +template static inline +Size_<_Tp> operator * (const Size_<_Tp>& a, _Tp b) +{ + Size_<_Tp> tmp(a); + tmp *= b; + return tmp; +} + +template static inline +Size_<_Tp>& operator /= (Size_<_Tp>& a, _Tp b) +{ + a.width /= b; + a.height /= b; + return a; +} + +template static inline +Size_<_Tp> operator / (const Size_<_Tp>& a, _Tp b) +{ + Size_<_Tp> tmp(a); + tmp /= b; + return tmp; +} + +template static inline +Size_<_Tp>& operator += (Size_<_Tp>& a, const Size_<_Tp>& b) +{ + a.width += b.width; + a.height += b.height; + return a; +} + +template static inline +Size_<_Tp> operator + (const Size_<_Tp>& a, const Size_<_Tp>& b) +{ + Size_<_Tp> tmp(a); + tmp += b; + return tmp; +} + +template static inline +Size_<_Tp>& operator -= (Size_<_Tp>& a, const Size_<_Tp>& b) +{ + a.width -= b.width; + a.height -= b.height; + return a; +} + +template static inline +Size_<_Tp> operator - (const Size_<_Tp>& a, const Size_<_Tp>& b) +{ + Size_<_Tp> tmp(a); + tmp -= b; + return tmp; +} + +template static inline +bool operator == (const Size_<_Tp>& a, const Size_<_Tp>& b) +{ + return a.width == b.width && a.height == b.height; +} + +template static inline +bool operator != (const Size_<_Tp>& a, const Size_<_Tp>& b) +{ + return !(a == b); +} + + + +////////////////////////////////// Rect ///////////////////////////////// + +template inline +Rect_<_Tp>::Rect_() + : x(0), y(0), width(0), height(0) {} + +template inline +Rect_<_Tp>::Rect_(_Tp _x, _Tp _y, _Tp _width, _Tp _height) + : x(_x), y(_y), width(_width), height(_height) {} + +template inline +Rect_<_Tp>::Rect_(const Rect_<_Tp>& r) + : x(r.x), y(r.y), width(r.width), height(r.height) {} + +template inline +Rect_<_Tp>::Rect_(const Point_<_Tp>& org, const Size_<_Tp>& sz) + : x(org.x), y(org.y), width(sz.width), height(sz.height) {} + +template inline +Rect_<_Tp>::Rect_(const Point_<_Tp>& pt1, const Point_<_Tp>& pt2) +{ + x = std::min(pt1.x, pt2.x); + y = std::min(pt1.y, pt2.y); + width = std::max(pt1.x, pt2.x) - x; + height = std::max(pt1.y, pt2.y) - y; +} + +template inline +Rect_<_Tp>& Rect_<_Tp>::operator = ( const Rect_<_Tp>& r ) +{ + x = r.x; + y = r.y; + width = r.width; + height = r.height; + return *this; +} + +template inline +Point_<_Tp> Rect_<_Tp>::tl() const +{ + return Point_<_Tp>(x,y); +} + +template inline +Point_<_Tp> Rect_<_Tp>::br() const +{ + return Point_<_Tp>(x + width, y + height); +} + +template inline +Size_<_Tp> Rect_<_Tp>::size() const +{ + return Size_<_Tp>(width, height); +} + +template inline +_Tp Rect_<_Tp>::area() const +{ + return width * height; +} + +template template inline +Rect_<_Tp>::operator Rect_<_Tp2>() const +{ + return Rect_<_Tp2>(saturate_cast<_Tp2>(x), saturate_cast<_Tp2>(y), saturate_cast<_Tp2>(width), saturate_cast<_Tp2>(height)); +} + +template inline +bool Rect_<_Tp>::contains(const Point_<_Tp>& pt) const +{ + return x <= pt.x && pt.x < x + width && y <= pt.y && pt.y < y + height; +} + + +template static inline +Rect_<_Tp>& operator += ( Rect_<_Tp>& a, const Point_<_Tp>& b ) +{ + a.x += b.x; + a.y += b.y; + return a; +} + +template static inline +Rect_<_Tp>& operator -= ( Rect_<_Tp>& a, const Point_<_Tp>& b ) +{ + a.x -= b.x; + a.y -= b.y; + return a; +} + +template static inline +Rect_<_Tp>& operator += ( Rect_<_Tp>& a, const Size_<_Tp>& b ) +{ + a.width += b.width; + a.height += b.height; + return a; +} + +template static inline +Rect_<_Tp>& operator -= ( Rect_<_Tp>& a, const Size_<_Tp>& b ) +{ + a.width -= b.width; + a.height -= b.height; + return a; +} + +template static inline +Rect_<_Tp>& operator &= ( Rect_<_Tp>& a, const Rect_<_Tp>& b ) +{ + _Tp x1 = std::max(a.x, b.x); + _Tp y1 = std::max(a.y, b.y); + a.width = std::min(a.x + a.width, b.x + b.width) - x1; + a.height = std::min(a.y + a.height, b.y + b.height) - y1; + a.x = x1; + a.y = y1; + if( a.width <= 0 || a.height <= 0 ) + a = Rect(); + return a; +} + +template static inline +Rect_<_Tp>& operator |= ( Rect_<_Tp>& a, const Rect_<_Tp>& b ) +{ + _Tp x1 = std::min(a.x, b.x); + _Tp y1 = std::min(a.y, b.y); + a.width = std::max(a.x + a.width, b.x + b.width) - x1; + a.height = std::max(a.y + a.height, b.y + b.height) - y1; + a.x = x1; + a.y = y1; + return a; +} + +template static inline +bool operator == (const Rect_<_Tp>& a, const Rect_<_Tp>& b) +{ + return a.x == b.x && a.y == b.y && a.width == b.width && a.height == b.height; +} + +template static inline +bool operator != (const Rect_<_Tp>& a, const Rect_<_Tp>& b) +{ + return a.x != b.x || a.y != b.y || a.width != b.width || a.height != b.height; +} + +template static inline +Rect_<_Tp> operator + (const Rect_<_Tp>& a, const Point_<_Tp>& b) +{ + return Rect_<_Tp>( a.x + b.x, a.y + b.y, a.width, a.height ); +} + +template static inline +Rect_<_Tp> operator - (const Rect_<_Tp>& a, const Point_<_Tp>& b) +{ + return Rect_<_Tp>( a.x - b.x, a.y - b.y, a.width, a.height ); +} + +template static inline +Rect_<_Tp> operator + (const Rect_<_Tp>& a, const Size_<_Tp>& b) +{ + return Rect_<_Tp>( a.x, a.y, a.width + b.width, a.height + b.height ); +} + +template static inline +Rect_<_Tp> operator & (const Rect_<_Tp>& a, const Rect_<_Tp>& b) +{ + Rect_<_Tp> c = a; + return c &= b; +} + +template static inline +Rect_<_Tp> operator | (const Rect_<_Tp>& a, const Rect_<_Tp>& b) +{ + Rect_<_Tp> c = a; + return c |= b; +} + + + +////////////////////////////// RotatedRect ////////////////////////////// + +inline +RotatedRect::RotatedRect() + : center(), size(), angle(0) {} + +inline +RotatedRect::RotatedRect(const Point2f& _center, const Size2f& _size, float _angle) + : center(_center), size(_size), angle(_angle) {} + + + +///////////////////////////////// Range ///////////////////////////////// + +inline +Range::Range() + : start(0), end(0) {} + +inline +Range::Range(int _start, int _end) + : start(_start), end(_end) {} + +inline +int Range::size() const +{ + return end - start; +} + +inline +bool Range::empty() const +{ + return start == end; +} + +inline +Range Range::all() +{ + return Range(INT_MIN, INT_MAX); +} + + +static inline +bool operator == (const Range& r1, const Range& r2) +{ + return r1.start == r2.start && r1.end == r2.end; +} + +static inline +bool operator != (const Range& r1, const Range& r2) +{ + return !(r1 == r2); +} + +static inline +bool operator !(const Range& r) +{ + return r.start == r.end; +} + +static inline +Range operator & (const Range& r1, const Range& r2) +{ + Range r(std::max(r1.start, r2.start), std::min(r1.end, r2.end)); + r.end = std::max(r.end, r.start); + return r; +} + +static inline +Range& operator &= (Range& r1, const Range& r2) +{ + r1 = r1 & r2; + return r1; +} + +static inline +Range operator + (const Range& r1, int delta) +{ + return Range(r1.start + delta, r1.end + delta); +} + +static inline +Range operator + (int delta, const Range& r1) +{ + return Range(r1.start + delta, r1.end + delta); +} + +static inline +Range operator - (const Range& r1, int delta) +{ + return r1 + (-delta); +} + + + +///////////////////////////////// Scalar //////////////////////////////// + +template inline +Scalar_<_Tp>::Scalar_() +{ + this->val[0] = this->val[1] = this->val[2] = this->val[3] = 0; +} + +template inline +Scalar_<_Tp>::Scalar_(_Tp v0, _Tp v1, _Tp v2, _Tp v3) +{ + this->val[0] = v0; + this->val[1] = v1; + this->val[2] = v2; + this->val[3] = v3; +} + +template template inline +Scalar_<_Tp>::Scalar_(const Vec<_Tp2, cn>& v) +{ + int i; + for( i = 0; i < (cn < 4 ? cn : 4); i++ ) + this->val[i] = cv::saturate_cast<_Tp>(v.val[i]); + for( ; i < 4; i++ ) + this->val[i] = 0; +} + +template inline +Scalar_<_Tp>::Scalar_(_Tp v0) +{ + this->val[0] = v0; + this->val[1] = this->val[2] = this->val[3] = 0; +} + +template inline +Scalar_<_Tp> Scalar_<_Tp>::all(_Tp v0) +{ + return Scalar_<_Tp>(v0, v0, v0, v0); +} + + +template inline +Scalar_<_Tp> Scalar_<_Tp>::mul(const Scalar_<_Tp>& a, double scale ) const +{ + return Scalar_<_Tp>(saturate_cast<_Tp>(this->val[0] * a.val[0] * scale), + saturate_cast<_Tp>(this->val[1] * a.val[1] * scale), + saturate_cast<_Tp>(this->val[2] * a.val[2] * scale), + saturate_cast<_Tp>(this->val[3] * a.val[3] * scale)); +} + +template inline +Scalar_<_Tp> Scalar_<_Tp>::conj() const +{ + return Scalar_<_Tp>(saturate_cast<_Tp>( this->val[0]), + saturate_cast<_Tp>(-this->val[1]), + saturate_cast<_Tp>(-this->val[2]), + saturate_cast<_Tp>(-this->val[3])); +} + +template inline +bool Scalar_<_Tp>::isReal() const +{ + return this->val[1] == 0 && this->val[2] == 0 && this->val[3] == 0; +} + + +template template inline +Scalar_<_Tp>::operator Scalar_() const +{ + return Scalar_(saturate_cast(this->val[0]), + saturate_cast(this->val[1]), + saturate_cast(this->val[2]), + saturate_cast(this->val[3])); +} + + +template static inline +Scalar_<_Tp>& operator += (Scalar_<_Tp>& a, const Scalar_<_Tp>& b) +{ + a.val[0] += b.val[0]; + a.val[1] += b.val[1]; + a.val[2] += b.val[2]; + a.val[3] += b.val[3]; + return a; +} + +template static inline +Scalar_<_Tp>& operator -= (Scalar_<_Tp>& a, const Scalar_<_Tp>& b) +{ + a.val[0] -= b.val[0]; + a.val[1] -= b.val[1]; + a.val[2] -= b.val[2]; + a.val[3] -= b.val[3]; + return a; +} + +template static inline +Scalar_<_Tp>& operator *= ( Scalar_<_Tp>& a, _Tp v ) +{ + a.val[0] *= v; + a.val[1] *= v; + a.val[2] *= v; + a.val[3] *= v; + return a; +} + +template static inline +bool operator == ( const Scalar_<_Tp>& a, const Scalar_<_Tp>& b ) +{ + return a.val[0] == b.val[0] && a.val[1] == b.val[1] && + a.val[2] == b.val[2] && a.val[3] == b.val[3]; +} + +template static inline +bool operator != ( const Scalar_<_Tp>& a, const Scalar_<_Tp>& b ) +{ + return a.val[0] != b.val[0] || a.val[1] != b.val[1] || + a.val[2] != b.val[2] || a.val[3] != b.val[3]; +} + +template static inline +Scalar_<_Tp> operator + (const Scalar_<_Tp>& a, const Scalar_<_Tp>& b) +{ + return Scalar_<_Tp>(a.val[0] + b.val[0], + a.val[1] + b.val[1], + a.val[2] + b.val[2], + a.val[3] + b.val[3]); +} + +template static inline +Scalar_<_Tp> operator - (const Scalar_<_Tp>& a, const Scalar_<_Tp>& b) +{ + return Scalar_<_Tp>(saturate_cast<_Tp>(a.val[0] - b.val[0]), + saturate_cast<_Tp>(a.val[1] - b.val[1]), + saturate_cast<_Tp>(a.val[2] - b.val[2]), + saturate_cast<_Tp>(a.val[3] - b.val[3])); +} + +template static inline +Scalar_<_Tp> operator * (const Scalar_<_Tp>& a, _Tp alpha) +{ + return Scalar_<_Tp>(a.val[0] * alpha, + a.val[1] * alpha, + a.val[2] * alpha, + a.val[3] * alpha); +} + +template static inline +Scalar_<_Tp> operator * (_Tp alpha, const Scalar_<_Tp>& a) +{ + return a*alpha; +} + +template static inline +Scalar_<_Tp> operator - (const Scalar_<_Tp>& a) +{ + return Scalar_<_Tp>(saturate_cast<_Tp>(-a.val[0]), + saturate_cast<_Tp>(-a.val[1]), + saturate_cast<_Tp>(-a.val[2]), + saturate_cast<_Tp>(-a.val[3])); +} + + +template static inline +Scalar_<_Tp> operator * (const Scalar_<_Tp>& a, const Scalar_<_Tp>& b) +{ + return Scalar_<_Tp>(saturate_cast<_Tp>(a[0]*b[0] - a[1]*b[1] - a[2]*b[2] - a[3]*b[3]), + saturate_cast<_Tp>(a[0]*b[1] + a[1]*b[0] + a[2]*b[3] - a[3]*b[2]), + saturate_cast<_Tp>(a[0]*b[2] - a[1]*b[3] + a[2]*b[0] + a[3]*b[1]), + saturate_cast<_Tp>(a[0]*b[3] + a[1]*b[2] - a[2]*b[1] + a[3]*b[0])); +} + +template static inline +Scalar_<_Tp>& operator *= (Scalar_<_Tp>& a, const Scalar_<_Tp>& b) +{ + a = a * b; + return a; +} + +template static inline +Scalar_<_Tp> operator / (const Scalar_<_Tp>& a, _Tp alpha) +{ + return Scalar_<_Tp>(a.val[0] / alpha, + a.val[1] / alpha, + a.val[2] / alpha, + a.val[3] / alpha); +} + +template static inline +Scalar_ operator / (const Scalar_& a, float alpha) +{ + float s = 1 / alpha; + return Scalar_(a.val[0] * s, a.val[1] * s, a.val[2] * s, a.val[3] * s); +} + +template static inline +Scalar_ operator / (const Scalar_& a, double alpha) +{ + double s = 1 / alpha; + return Scalar_(a.val[0] * s, a.val[1] * s, a.val[2] * s, a.val[3] * s); +} + +template static inline +Scalar_<_Tp>& operator /= (Scalar_<_Tp>& a, _Tp alpha) +{ + a = a / alpha; + return a; +} + +template static inline +Scalar_<_Tp> operator / (_Tp a, const Scalar_<_Tp>& b) +{ + _Tp s = a / (b[0]*b[0] + b[1]*b[1] + b[2]*b[2] + b[3]*b[3]); + return b.conj() * s; +} + +template static inline +Scalar_<_Tp> operator / (const Scalar_<_Tp>& a, const Scalar_<_Tp>& b) +{ + return a * ((_Tp)1 / b); +} + +template static inline +Scalar_<_Tp>& operator /= (Scalar_<_Tp>& a, const Scalar_<_Tp>& b) +{ + a = a / b; + return a; +} + +template static inline +Scalar operator * (const Matx<_Tp, 4, 4>& a, const Scalar& b) +{ + Matx c((Matx)a, b, Matx_MatMulOp()); + return reinterpret_cast(c); +} + +template<> inline +Scalar operator * (const Matx& a, const Scalar& b) +{ + Matx c(a, b, Matx_MatMulOp()); + return reinterpret_cast(c); +} + + + +//////////////////////////////// KeyPoint /////////////////////////////// + +inline +KeyPoint::KeyPoint() + : pt(0,0), size(0), angle(-1), response(0), octave(0), class_id(-1) {} + +inline +KeyPoint::KeyPoint(Point2f _pt, float _size, float _angle, float _response, int _octave, int _class_id) + : pt(_pt), size(_size), angle(_angle), response(_response), octave(_octave), class_id(_class_id) {} + +inline +KeyPoint::KeyPoint(float x, float y, float _size, float _angle, float _response, int _octave, int _class_id) + : pt(x, y), size(_size), angle(_angle), response(_response), octave(_octave), class_id(_class_id) {} + + + +///////////////////////////////// DMatch //////////////////////////////// + +inline +DMatch::DMatch() + : queryIdx(-1), trainIdx(-1), imgIdx(-1), distance(FLT_MAX) {} + +inline +DMatch::DMatch(int _queryIdx, int _trainIdx, float _distance) + : queryIdx(_queryIdx), trainIdx(_trainIdx), imgIdx(-1), distance(_distance) {} + +inline +DMatch::DMatch(int _queryIdx, int _trainIdx, int _imgIdx, float _distance) + : queryIdx(_queryIdx), trainIdx(_trainIdx), imgIdx(_imgIdx), distance(_distance) {} + +inline +bool DMatch::operator < (const DMatch &m) const +{ + return distance < m.distance; +} + + + +////////////////////////////// TermCriteria ///////////////////////////// + +inline +TermCriteria::TermCriteria() + : type(0), maxCount(0), epsilon(0) {} + +inline +TermCriteria::TermCriteria(int _type, int _maxCount, double _epsilon) + : type(_type), maxCount(_maxCount), epsilon(_epsilon) {} + +//! @endcond + +} // cv + +#endif //__OPENCV_CORE_TYPES_HPP__ diff --git a/lib/opencv/include/opencv2/core/types_c.h b/lib/opencv/include/opencv2/core/types_c.h new file mode 100644 index 000000000..cb39587a9 --- /dev/null +++ b/lib/opencv/include/opencv2/core/types_c.h @@ -0,0 +1,1834 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_TYPES_H__ +#define __OPENCV_CORE_TYPES_H__ + +#ifdef HAVE_IPL +# ifndef __IPL_H__ +# if defined WIN32 || defined _WIN32 +# include +# else +# include +# endif +# endif +#elif defined __IPL_H__ +# define HAVE_IPL +#endif + +#include "opencv2/core/cvdef.h" + +#ifndef SKIP_INCLUDES +#include +#include +#include +#include +#endif // SKIP_INCLUDES + +#if defined WIN32 || defined _WIN32 +# define CV_CDECL __cdecl +# define CV_STDCALL __stdcall +#else +# define CV_CDECL +# define CV_STDCALL +#endif + +#ifndef CV_DEFAULT +# ifdef __cplusplus +# define CV_DEFAULT(val) = val +# else +# define CV_DEFAULT(val) +# endif +#endif + +#ifndef CV_EXTERN_C_FUNCPTR +# ifdef __cplusplus +# define CV_EXTERN_C_FUNCPTR(x) extern "C" { typedef x; } +# else +# define CV_EXTERN_C_FUNCPTR(x) typedef x +# endif +#endif + +#ifndef CVAPI +# define CVAPI(rettype) CV_EXTERN_C CV_EXPORTS rettype CV_CDECL +#endif + +#ifndef CV_IMPL +# define CV_IMPL CV_EXTERN_C +#endif + +#ifdef __cplusplus +# include "opencv2/core.hpp" +#endif + +/** @addtogroup core_c + @{ +*/ + +/** @brief This is the "metatype" used *only* as a function parameter. + +It denotes that the function accepts arrays of multiple types, such as IplImage*, CvMat* or even +CvSeq* sometimes. The particular array type is determined at runtime by analyzing the first 4 +bytes of the header. In C++ interface the role of CvArr is played by InputArray and OutputArray. + */ +typedef void CvArr; + +typedef int CVStatus; + +/** @see cv::Error::Code */ +enum { + CV_StsOk= 0, /**< everything is ok */ + CV_StsBackTrace= -1, /**< pseudo error for back trace */ + CV_StsError= -2, /**< unknown /unspecified error */ + CV_StsInternal= -3, /**< internal error (bad state) */ + CV_StsNoMem= -4, /**< insufficient memory */ + CV_StsBadArg= -5, /**< function arg/param is bad */ + CV_StsBadFunc= -6, /**< unsupported function */ + CV_StsNoConv= -7, /**< iter. didn't converge */ + CV_StsAutoTrace= -8, /**< tracing */ + CV_HeaderIsNull= -9, /**< image header is NULL */ + CV_BadImageSize= -10, /**< image size is invalid */ + CV_BadOffset= -11, /**< offset is invalid */ + CV_BadDataPtr= -12, /**/ + CV_BadStep= -13, /**/ + CV_BadModelOrChSeq= -14, /**/ + CV_BadNumChannels= -15, /**/ + CV_BadNumChannel1U= -16, /**/ + CV_BadDepth= -17, /**/ + CV_BadAlphaChannel= -18, /**/ + CV_BadOrder= -19, /**/ + CV_BadOrigin= -20, /**/ + CV_BadAlign= -21, /**/ + CV_BadCallBack= -22, /**/ + CV_BadTileSize= -23, /**/ + CV_BadCOI= -24, /**/ + CV_BadROISize= -25, /**/ + CV_MaskIsTiled= -26, /**/ + CV_StsNullPtr= -27, /**< null pointer */ + CV_StsVecLengthErr= -28, /**< incorrect vector length */ + CV_StsFilterStructContentErr= -29, /**< incorr. filter structure content */ + CV_StsKernelStructContentErr= -30, /**< incorr. transform kernel content */ + CV_StsFilterOffsetErr= -31, /**< incorrect filter offset value */ + CV_StsBadSize= -201, /**< the input/output structure size is incorrect */ + CV_StsDivByZero= -202, /**< division by zero */ + CV_StsInplaceNotSupported= -203, /**< in-place operation is not supported */ + CV_StsObjectNotFound= -204, /**< request can't be completed */ + CV_StsUnmatchedFormats= -205, /**< formats of input/output arrays differ */ + CV_StsBadFlag= -206, /**< flag is wrong or not supported */ + CV_StsBadPoint= -207, /**< bad CvPoint */ + CV_StsBadMask= -208, /**< bad format of mask (neither 8uC1 nor 8sC1)*/ + CV_StsUnmatchedSizes= -209, /**< sizes of input/output structures do not match */ + CV_StsUnsupportedFormat= -210, /**< the data format/type is not supported by the function*/ + CV_StsOutOfRange= -211, /**< some of parameters are out of range */ + CV_StsParseError= -212, /**< invalid syntax/structure of the parsed file */ + CV_StsNotImplemented= -213, /**< the requested function/feature is not implemented */ + CV_StsBadMemBlock= -214, /**< an allocated block has been corrupted */ + CV_StsAssert= -215, /**< assertion failed */ + CV_GpuNotSupported= -216, + CV_GpuApiCallError= -217, + CV_OpenGlNotSupported= -218, + CV_OpenGlApiCallError= -219, + CV_OpenCLApiCallError= -220, + CV_OpenCLDoubleNotSupported= -221, + CV_OpenCLInitError= -222, + CV_OpenCLNoAMDBlasFft= -223 +}; + +/****************************************************************************************\ +* Common macros and inline functions * +\****************************************************************************************/ + +#define CV_SWAP(a,b,t) ((t) = (a), (a) = (b), (b) = (t)) + +/** min & max without jumps */ +#define CV_IMIN(a, b) ((a) ^ (((a)^(b)) & (((a) < (b)) - 1))) + +#define CV_IMAX(a, b) ((a) ^ (((a)^(b)) & (((a) > (b)) - 1))) + +/** absolute value without jumps */ +#ifndef __cplusplus +# define CV_IABS(a) (((a) ^ ((a) < 0 ? -1 : 0)) - ((a) < 0 ? -1 : 0)) +#else +# define CV_IABS(a) abs(a) +#endif +#define CV_CMP(a,b) (((a) > (b)) - ((a) < (b))) +#define CV_SIGN(a) CV_CMP((a),0) + +#define cvInvSqrt(value) ((float)(1./sqrt(value))) +#define cvSqrt(value) ((float)sqrt(value)) + + +/*************** Random number generation *******************/ + +typedef uint64 CvRNG; + +#define CV_RNG_COEFF 4164903690U + +/** @brief Initializes a random number generator state. + +The function initializes a random number generator and returns the state. The pointer to the state +can be then passed to the cvRandInt, cvRandReal and cvRandArr functions. In the current +implementation a multiply-with-carry generator is used. +@param seed 64-bit value used to initiate a random sequence +@sa the C++ class RNG replaced CvRNG. + */ +CV_INLINE CvRNG cvRNG( int64 seed CV_DEFAULT(-1)) +{ + CvRNG rng = seed ? (uint64)seed : (uint64)(int64)-1; + return rng; +} + +/** @brief Returns a 32-bit unsigned integer and updates RNG. + +The function returns a uniformly-distributed random 32-bit unsigned integer and updates the RNG +state. It is similar to the rand() function from the C runtime library, except that OpenCV functions +always generates a 32-bit random number, regardless of the platform. +@param rng CvRNG state initialized by cvRNG. + */ +CV_INLINE unsigned cvRandInt( CvRNG* rng ) +{ + uint64 temp = *rng; + temp = (uint64)(unsigned)temp*CV_RNG_COEFF + (temp >> 32); + *rng = temp; + return (unsigned)temp; +} + +/** @brief Returns a floating-point random number and updates RNG. + +The function returns a uniformly-distributed random floating-point number between 0 and 1 (1 is not +included). +@param rng RNG state initialized by cvRNG + */ +CV_INLINE double cvRandReal( CvRNG* rng ) +{ + return cvRandInt(rng)*2.3283064365386962890625e-10 /* 2^-32 */; +} + +/****************************************************************************************\ +* Image type (IplImage) * +\****************************************************************************************/ + +#ifndef HAVE_IPL + +/* + * The following definitions (until #endif) + * is an extract from IPL headers. + * Copyright (c) 1995 Intel Corporation. + */ +#define IPL_DEPTH_SIGN 0x80000000 + +#define IPL_DEPTH_1U 1 +#define IPL_DEPTH_8U 8 +#define IPL_DEPTH_16U 16 +#define IPL_DEPTH_32F 32 + +#define IPL_DEPTH_8S (IPL_DEPTH_SIGN| 8) +#define IPL_DEPTH_16S (IPL_DEPTH_SIGN|16) +#define IPL_DEPTH_32S (IPL_DEPTH_SIGN|32) + +#define IPL_DATA_ORDER_PIXEL 0 +#define IPL_DATA_ORDER_PLANE 1 + +#define IPL_ORIGIN_TL 0 +#define IPL_ORIGIN_BL 1 + +#define IPL_ALIGN_4BYTES 4 +#define IPL_ALIGN_8BYTES 8 +#define IPL_ALIGN_16BYTES 16 +#define IPL_ALIGN_32BYTES 32 + +#define IPL_ALIGN_DWORD IPL_ALIGN_4BYTES +#define IPL_ALIGN_QWORD IPL_ALIGN_8BYTES + +#define IPL_BORDER_CONSTANT 0 +#define IPL_BORDER_REPLICATE 1 +#define IPL_BORDER_REFLECT 2 +#define IPL_BORDER_WRAP 3 + +/** The IplImage is taken from the Intel Image Processing Library, in which the format is native. OpenCV +only supports a subset of possible IplImage formats, as outlined in the parameter list above. + +In addition to the above restrictions, OpenCV handles ROIs differently. OpenCV functions require +that the image size or ROI size of all source and destination images match exactly. On the other +hand, the Intel Image Processing Library processes the area of intersection between the source and +destination images (or ROIs), allowing them to vary independently. +*/ +typedef struct +#ifdef __cplusplus + CV_EXPORTS +#endif +_IplImage +{ + int nSize; /**< sizeof(IplImage) */ + int ID; /**< version (=0)*/ + int nChannels; /**< Most of OpenCV functions support 1,2,3 or 4 channels */ + int alphaChannel; /**< Ignored by OpenCV */ + int depth; /**< Pixel depth in bits: IPL_DEPTH_8U, IPL_DEPTH_8S, IPL_DEPTH_16S, + IPL_DEPTH_32S, IPL_DEPTH_32F and IPL_DEPTH_64F are supported. */ + char colorModel[4]; /**< Ignored by OpenCV */ + char channelSeq[4]; /**< ditto */ + int dataOrder; /**< 0 - interleaved color channels, 1 - separate color channels. + cvCreateImage can only create interleaved images */ + int origin; /**< 0 - top-left origin, + 1 - bottom-left origin (Windows bitmaps style). */ + int align; /**< Alignment of image rows (4 or 8). + OpenCV ignores it and uses widthStep instead. */ + int width; /**< Image width in pixels. */ + int height; /**< Image height in pixels. */ + struct _IplROI *roi; /**< Image ROI. If NULL, the whole image is selected. */ + struct _IplImage *maskROI; /**< Must be NULL. */ + void *imageId; /**< " " */ + struct _IplTileInfo *tileInfo; /**< " " */ + int imageSize; /**< Image data size in bytes + (==image->height*image->widthStep + in case of interleaved data)*/ + char *imageData; /**< Pointer to aligned image data. */ + int widthStep; /**< Size of aligned image row in bytes. */ + int BorderMode[4]; /**< Ignored by OpenCV. */ + int BorderConst[4]; /**< Ditto. */ + char *imageDataOrigin; /**< Pointer to very origin of image data + (not necessarily aligned) - + needed for correct deallocation */ + +#ifdef __cplusplus + _IplImage() {} + _IplImage(const cv::Mat& m); +#endif +} +IplImage; + +typedef struct _IplTileInfo IplTileInfo; + +typedef struct _IplROI +{ + int coi; /**< 0 - no COI (all channels are selected), 1 - 0th channel is selected ...*/ + int xOffset; + int yOffset; + int width; + int height; +} +IplROI; + +typedef struct _IplConvKernel +{ + int nCols; + int nRows; + int anchorX; + int anchorY; + int *values; + int nShiftR; +} +IplConvKernel; + +typedef struct _IplConvKernelFP +{ + int nCols; + int nRows; + int anchorX; + int anchorY; + float *values; +} +IplConvKernelFP; + +#define IPL_IMAGE_HEADER 1 +#define IPL_IMAGE_DATA 2 +#define IPL_IMAGE_ROI 4 + +#endif/*HAVE_IPL*/ + +/** extra border mode */ +#define IPL_BORDER_REFLECT_101 4 +#define IPL_BORDER_TRANSPARENT 5 + +#define IPL_IMAGE_MAGIC_VAL ((int)sizeof(IplImage)) +#define CV_TYPE_NAME_IMAGE "opencv-image" + +#define CV_IS_IMAGE_HDR(img) \ + ((img) != NULL && ((const IplImage*)(img))->nSize == sizeof(IplImage)) + +#define CV_IS_IMAGE(img) \ + (CV_IS_IMAGE_HDR(img) && ((IplImage*)img)->imageData != NULL) + +/** for storing double-precision + floating point data in IplImage's */ +#define IPL_DEPTH_64F 64 + +/** get reference to pixel at (col,row), + for multi-channel images (col) should be multiplied by number of channels */ +#define CV_IMAGE_ELEM( image, elemtype, row, col ) \ + (((elemtype*)((image)->imageData + (image)->widthStep*(row)))[(col)]) + +/****************************************************************************************\ +* Matrix type (CvMat) * +\****************************************************************************************/ + +#define CV_AUTO_STEP 0x7fffffff +#define CV_WHOLE_ARR cvSlice( 0, 0x3fffffff ) + +#define CV_MAGIC_MASK 0xFFFF0000 +#define CV_MAT_MAGIC_VAL 0x42420000 +#define CV_TYPE_NAME_MAT "opencv-matrix" + +/** Matrix elements are stored row by row. Element (i, j) (i - 0-based row index, j - 0-based column +index) of a matrix can be retrieved or modified using CV_MAT_ELEM macro: + + uchar pixval = CV_MAT_ELEM(grayimg, uchar, i, j) + CV_MAT_ELEM(cameraMatrix, float, 0, 2) = image.width*0.5f; + +To access multiple-channel matrices, you can use +CV_MAT_ELEM(matrix, type, i, j\*nchannels + channel_idx). + +@deprecated CvMat is now obsolete; consider using Mat instead. + */ +typedef struct CvMat +{ + int type; + int step; + + /* for internal use only */ + int* refcount; + int hdr_refcount; + + union + { + uchar* ptr; + short* s; + int* i; + float* fl; + double* db; + } data; + +#ifdef __cplusplus + union + { + int rows; + int height; + }; + + union + { + int cols; + int width; + }; +#else + int rows; + int cols; +#endif + + +#ifdef __cplusplus + CvMat() {} + CvMat(const CvMat& m) { memcpy(this, &m, sizeof(CvMat));} + CvMat(const cv::Mat& m); +#endif + +} +CvMat; + + +#define CV_IS_MAT_HDR(mat) \ + ((mat) != NULL && \ + (((const CvMat*)(mat))->type & CV_MAGIC_MASK) == CV_MAT_MAGIC_VAL && \ + ((const CvMat*)(mat))->cols > 0 && ((const CvMat*)(mat))->rows > 0) + +#define CV_IS_MAT_HDR_Z(mat) \ + ((mat) != NULL && \ + (((const CvMat*)(mat))->type & CV_MAGIC_MASK) == CV_MAT_MAGIC_VAL && \ + ((const CvMat*)(mat))->cols >= 0 && ((const CvMat*)(mat))->rows >= 0) + +#define CV_IS_MAT(mat) \ + (CV_IS_MAT_HDR(mat) && ((const CvMat*)(mat))->data.ptr != NULL) + +#define CV_IS_MASK_ARR(mat) \ + (((mat)->type & (CV_MAT_TYPE_MASK & ~CV_8SC1)) == 0) + +#define CV_ARE_TYPES_EQ(mat1, mat2) \ + ((((mat1)->type ^ (mat2)->type) & CV_MAT_TYPE_MASK) == 0) + +#define CV_ARE_CNS_EQ(mat1, mat2) \ + ((((mat1)->type ^ (mat2)->type) & CV_MAT_CN_MASK) == 0) + +#define CV_ARE_DEPTHS_EQ(mat1, mat2) \ + ((((mat1)->type ^ (mat2)->type) & CV_MAT_DEPTH_MASK) == 0) + +#define CV_ARE_SIZES_EQ(mat1, mat2) \ + ((mat1)->rows == (mat2)->rows && (mat1)->cols == (mat2)->cols) + +#define CV_IS_MAT_CONST(mat) \ + (((mat)->rows|(mat)->cols) == 1) + +#define IPL2CV_DEPTH(depth) \ + ((((CV_8U)+(CV_16U<<4)+(CV_32F<<8)+(CV_64F<<16)+(CV_8S<<20)+ \ + (CV_16S<<24)+(CV_32S<<28)) >> ((((depth) & 0xF0) >> 2) + \ + (((depth) & IPL_DEPTH_SIGN) ? 20 : 0))) & 15) + +/** Inline constructor. No data is allocated internally!!! + * (Use together with cvCreateData, or use cvCreateMat instead to + * get a matrix with allocated data): + */ +CV_INLINE CvMat cvMat( int rows, int cols, int type, void* data CV_DEFAULT(NULL)) +{ + CvMat m; + + assert( (unsigned)CV_MAT_DEPTH(type) <= CV_64F ); + type = CV_MAT_TYPE(type); + m.type = CV_MAT_MAGIC_VAL | CV_MAT_CONT_FLAG | type; + m.cols = cols; + m.rows = rows; + m.step = m.cols*CV_ELEM_SIZE(type); + m.data.ptr = (uchar*)data; + m.refcount = NULL; + m.hdr_refcount = 0; + + return m; +} + +#ifdef __cplusplus +inline CvMat::CvMat(const cv::Mat& m) +{ + CV_DbgAssert(m.dims <= 2); + *this = cvMat(m.rows, m.dims == 1 ? 1 : m.cols, m.type(), m.data); + step = (int)m.step[0]; + type = (type & ~cv::Mat::CONTINUOUS_FLAG) | (m.flags & cv::Mat::CONTINUOUS_FLAG); +} +#endif + + +#define CV_MAT_ELEM_PTR_FAST( mat, row, col, pix_size ) \ + (assert( (unsigned)(row) < (unsigned)(mat).rows && \ + (unsigned)(col) < (unsigned)(mat).cols ), \ + (mat).data.ptr + (size_t)(mat).step*(row) + (pix_size)*(col)) + +#define CV_MAT_ELEM_PTR( mat, row, col ) \ + CV_MAT_ELEM_PTR_FAST( mat, row, col, CV_ELEM_SIZE((mat).type) ) + +#define CV_MAT_ELEM( mat, elemtype, row, col ) \ + (*(elemtype*)CV_MAT_ELEM_PTR_FAST( mat, row, col, sizeof(elemtype))) + +/** @brief Returns the particular element of single-channel floating-point matrix. + +The function is a fast replacement for cvGetReal2D in the case of single-channel floating-point +matrices. It is faster because it is inline, it does fewer checks for array type and array element +type, and it checks for the row and column ranges only in debug mode. +@param mat Input matrix +@param row The zero-based index of row +@param col The zero-based index of column + */ +CV_INLINE double cvmGet( const CvMat* mat, int row, int col ) +{ + int type; + + type = CV_MAT_TYPE(mat->type); + assert( (unsigned)row < (unsigned)mat->rows && + (unsigned)col < (unsigned)mat->cols ); + + if( type == CV_32FC1 ) + return ((float*)(void*)(mat->data.ptr + (size_t)mat->step*row))[col]; + else + { + assert( type == CV_64FC1 ); + return ((double*)(void*)(mat->data.ptr + (size_t)mat->step*row))[col]; + } +} + +/** @brief Sets a specific element of a single-channel floating-point matrix. + +The function is a fast replacement for cvSetReal2D in the case of single-channel floating-point +matrices. It is faster because it is inline, it does fewer checks for array type and array element +type, and it checks for the row and column ranges only in debug mode. +@param mat The matrix +@param row The zero-based index of row +@param col The zero-based index of column +@param value The new value of the matrix element + */ +CV_INLINE void cvmSet( CvMat* mat, int row, int col, double value ) +{ + int type; + type = CV_MAT_TYPE(mat->type); + assert( (unsigned)row < (unsigned)mat->rows && + (unsigned)col < (unsigned)mat->cols ); + + if( type == CV_32FC1 ) + ((float*)(void*)(mat->data.ptr + (size_t)mat->step*row))[col] = (float)value; + else + { + assert( type == CV_64FC1 ); + ((double*)(void*)(mat->data.ptr + (size_t)mat->step*row))[col] = value; + } +} + + +CV_INLINE int cvIplDepth( int type ) +{ + int depth = CV_MAT_DEPTH(type); + return CV_ELEM_SIZE1(depth)*8 | (depth == CV_8S || depth == CV_16S || + depth == CV_32S ? IPL_DEPTH_SIGN : 0); +} + + +/****************************************************************************************\ +* Multi-dimensional dense array (CvMatND) * +\****************************************************************************************/ + +#define CV_MATND_MAGIC_VAL 0x42430000 +#define CV_TYPE_NAME_MATND "opencv-nd-matrix" + +#define CV_MAX_DIM 32 +#define CV_MAX_DIM_HEAP 1024 + +/** + @deprecated consider using cv::Mat instead + */ +typedef struct +#ifdef __cplusplus + CV_EXPORTS +#endif +CvMatND +{ + int type; + int dims; + + int* refcount; + int hdr_refcount; + + union + { + uchar* ptr; + float* fl; + double* db; + int* i; + short* s; + } data; + + struct + { + int size; + int step; + } + dim[CV_MAX_DIM]; + +#ifdef __cplusplus + CvMatND() {} + CvMatND(const cv::Mat& m); +#endif +} +CvMatND; + +#define CV_IS_MATND_HDR(mat) \ + ((mat) != NULL && (((const CvMatND*)(mat))->type & CV_MAGIC_MASK) == CV_MATND_MAGIC_VAL) + +#define CV_IS_MATND(mat) \ + (CV_IS_MATND_HDR(mat) && ((const CvMatND*)(mat))->data.ptr != NULL) + + +/****************************************************************************************\ +* Multi-dimensional sparse array (CvSparseMat) * +\****************************************************************************************/ + +#define CV_SPARSE_MAT_MAGIC_VAL 0x42440000 +#define CV_TYPE_NAME_SPARSE_MAT "opencv-sparse-matrix" + +struct CvSet; + +typedef struct +#ifdef __cplusplus + CV_EXPORTS +#endif +CvSparseMat +{ + int type; + int dims; + int* refcount; + int hdr_refcount; + + struct CvSet* heap; + void** hashtable; + int hashsize; + int valoffset; + int idxoffset; + int size[CV_MAX_DIM]; + +#ifdef __cplusplus + void copyToSparseMat(cv::SparseMat& m) const; +#endif +} +CvSparseMat; + +#ifdef __cplusplus + CV_EXPORTS CvSparseMat* cvCreateSparseMat(const cv::SparseMat& m); +#endif + +#define CV_IS_SPARSE_MAT_HDR(mat) \ + ((mat) != NULL && \ + (((const CvSparseMat*)(mat))->type & CV_MAGIC_MASK) == CV_SPARSE_MAT_MAGIC_VAL) + +#define CV_IS_SPARSE_MAT(mat) \ + CV_IS_SPARSE_MAT_HDR(mat) + +/**************** iteration through a sparse array *****************/ + +typedef struct CvSparseNode +{ + unsigned hashval; + struct CvSparseNode* next; +} +CvSparseNode; + +typedef struct CvSparseMatIterator +{ + CvSparseMat* mat; + CvSparseNode* node; + int curidx; +} +CvSparseMatIterator; + +#define CV_NODE_VAL(mat,node) ((void*)((uchar*)(node) + (mat)->valoffset)) +#define CV_NODE_IDX(mat,node) ((int*)((uchar*)(node) + (mat)->idxoffset)) + +/****************************************************************************************\ +* Histogram * +\****************************************************************************************/ + +typedef int CvHistType; + +#define CV_HIST_MAGIC_VAL 0x42450000 +#define CV_HIST_UNIFORM_FLAG (1 << 10) + +/** indicates whether bin ranges are set already or not */ +#define CV_HIST_RANGES_FLAG (1 << 11) + +#define CV_HIST_ARRAY 0 +#define CV_HIST_SPARSE 1 +#define CV_HIST_TREE CV_HIST_SPARSE + +/** should be used as a parameter only, + it turns to CV_HIST_UNIFORM_FLAG of hist->type */ +#define CV_HIST_UNIFORM 1 + +typedef struct CvHistogram +{ + int type; + CvArr* bins; + float thresh[CV_MAX_DIM][2]; /**< For uniform histograms. */ + float** thresh2; /**< For non-uniform histograms. */ + CvMatND mat; /**< Embedded matrix header for array histograms. */ +} +CvHistogram; + +#define CV_IS_HIST( hist ) \ + ((hist) != NULL && \ + (((CvHistogram*)(hist))->type & CV_MAGIC_MASK) == CV_HIST_MAGIC_VAL && \ + (hist)->bins != NULL) + +#define CV_IS_UNIFORM_HIST( hist ) \ + (((hist)->type & CV_HIST_UNIFORM_FLAG) != 0) + +#define CV_IS_SPARSE_HIST( hist ) \ + CV_IS_SPARSE_MAT((hist)->bins) + +#define CV_HIST_HAS_RANGES( hist ) \ + (((hist)->type & CV_HIST_RANGES_FLAG) != 0) + +/****************************************************************************************\ +* Other supplementary data type definitions * +\****************************************************************************************/ + +/*************************************** CvRect *****************************************/ +/** @sa Rect_ */ +typedef struct CvRect +{ + int x; + int y; + int width; + int height; + +#ifdef __cplusplus + CvRect(int _x = 0, int _y = 0, int w = 0, int h = 0): x(_x), y(_y), width(w), height(h) {} + template + CvRect(const cv::Rect_<_Tp>& r): x(cv::saturate_cast(r.x)), y(cv::saturate_cast(r.y)), width(cv::saturate_cast(r.width)), height(cv::saturate_cast(r.height)) {} + template + operator cv::Rect_<_Tp>() const { return cv::Rect_<_Tp>((_Tp)x, (_Tp)y, (_Tp)width, (_Tp)height); } +#endif +} +CvRect; + +/** constructs CvRect structure. */ +CV_INLINE CvRect cvRect( int x, int y, int width, int height ) +{ + CvRect r; + + r.x = x; + r.y = y; + r.width = width; + r.height = height; + + return r; +} + + +CV_INLINE IplROI cvRectToROI( CvRect rect, int coi ) +{ + IplROI roi; + roi.xOffset = rect.x; + roi.yOffset = rect.y; + roi.width = rect.width; + roi.height = rect.height; + roi.coi = coi; + + return roi; +} + + +CV_INLINE CvRect cvROIToRect( IplROI roi ) +{ + return cvRect( roi.xOffset, roi.yOffset, roi.width, roi.height ); +} + +/*********************************** CvTermCriteria *************************************/ + +#define CV_TERMCRIT_ITER 1 +#define CV_TERMCRIT_NUMBER CV_TERMCRIT_ITER +#define CV_TERMCRIT_EPS 2 + +/** @sa TermCriteria + */ +typedef struct CvTermCriteria +{ + int type; /**< may be combination of + CV_TERMCRIT_ITER + CV_TERMCRIT_EPS */ + int max_iter; + double epsilon; + +#ifdef __cplusplus + CvTermCriteria(int _type = 0, int _iter = 0, double _eps = 0) : type(_type), max_iter(_iter), epsilon(_eps) {} + CvTermCriteria(const cv::TermCriteria& t) : type(t.type), max_iter(t.maxCount), epsilon(t.epsilon) {} + operator cv::TermCriteria() const { return cv::TermCriteria(type, max_iter, epsilon); } +#endif + +} +CvTermCriteria; + +CV_INLINE CvTermCriteria cvTermCriteria( int type, int max_iter, double epsilon ) +{ + CvTermCriteria t; + + t.type = type; + t.max_iter = max_iter; + t.epsilon = (float)epsilon; + + return t; +} + + +/******************************* CvPoint and variants ***********************************/ + +typedef struct CvPoint +{ + int x; + int y; + +#ifdef __cplusplus + CvPoint(int _x = 0, int _y = 0): x(_x), y(_y) {} + template + CvPoint(const cv::Point_<_Tp>& pt): x((int)pt.x), y((int)pt.y) {} + template + operator cv::Point_<_Tp>() const { return cv::Point_<_Tp>(cv::saturate_cast<_Tp>(x), cv::saturate_cast<_Tp>(y)); } +#endif +} +CvPoint; + +/** constructs CvPoint structure. */ +CV_INLINE CvPoint cvPoint( int x, int y ) +{ + CvPoint p; + + p.x = x; + p.y = y; + + return p; +} + + +typedef struct CvPoint2D32f +{ + float x; + float y; + +#ifdef __cplusplus + CvPoint2D32f(float _x = 0, float _y = 0): x(_x), y(_y) {} + template + CvPoint2D32f(const cv::Point_<_Tp>& pt): x((float)pt.x), y((float)pt.y) {} + template + operator cv::Point_<_Tp>() const { return cv::Point_<_Tp>(cv::saturate_cast<_Tp>(x), cv::saturate_cast<_Tp>(y)); } +#endif +} +CvPoint2D32f; + +/** constructs CvPoint2D32f structure. */ +CV_INLINE CvPoint2D32f cvPoint2D32f( double x, double y ) +{ + CvPoint2D32f p; + + p.x = (float)x; + p.y = (float)y; + + return p; +} + +/** converts CvPoint to CvPoint2D32f. */ +CV_INLINE CvPoint2D32f cvPointTo32f( CvPoint point ) +{ + return cvPoint2D32f( (float)point.x, (float)point.y ); +} + +/** converts CvPoint2D32f to CvPoint. */ +CV_INLINE CvPoint cvPointFrom32f( CvPoint2D32f point ) +{ + CvPoint ipt; + ipt.x = cvRound(point.x); + ipt.y = cvRound(point.y); + + return ipt; +} + + +typedef struct CvPoint3D32f +{ + float x; + float y; + float z; + +#ifdef __cplusplus + CvPoint3D32f(float _x = 0, float _y = 0, float _z = 0): x(_x), y(_y), z(_z) {} + template + CvPoint3D32f(const cv::Point3_<_Tp>& pt): x((float)pt.x), y((float)pt.y), z((float)pt.z) {} + template + operator cv::Point3_<_Tp>() const { return cv::Point3_<_Tp>(cv::saturate_cast<_Tp>(x), cv::saturate_cast<_Tp>(y), cv::saturate_cast<_Tp>(z)); } +#endif +} +CvPoint3D32f; + +/** constructs CvPoint3D32f structure. */ +CV_INLINE CvPoint3D32f cvPoint3D32f( double x, double y, double z ) +{ + CvPoint3D32f p; + + p.x = (float)x; + p.y = (float)y; + p.z = (float)z; + + return p; +} + + +typedef struct CvPoint2D64f +{ + double x; + double y; +} +CvPoint2D64f; + +/** constructs CvPoint2D64f structure.*/ +CV_INLINE CvPoint2D64f cvPoint2D64f( double x, double y ) +{ + CvPoint2D64f p; + + p.x = x; + p.y = y; + + return p; +} + + +typedef struct CvPoint3D64f +{ + double x; + double y; + double z; +} +CvPoint3D64f; + +/** constructs CvPoint3D64f structure. */ +CV_INLINE CvPoint3D64f cvPoint3D64f( double x, double y, double z ) +{ + CvPoint3D64f p; + + p.x = x; + p.y = y; + p.z = z; + + return p; +} + + +/******************************** CvSize's & CvBox **************************************/ + +typedef struct CvSize +{ + int width; + int height; + +#ifdef __cplusplus + CvSize(int w = 0, int h = 0): width(w), height(h) {} + template + CvSize(const cv::Size_<_Tp>& sz): width(cv::saturate_cast(sz.width)), height(cv::saturate_cast(sz.height)) {} + template + operator cv::Size_<_Tp>() const { return cv::Size_<_Tp>(cv::saturate_cast<_Tp>(width), cv::saturate_cast<_Tp>(height)); } +#endif +} +CvSize; + +/** constructs CvSize structure. */ +CV_INLINE CvSize cvSize( int width, int height ) +{ + CvSize s; + + s.width = width; + s.height = height; + + return s; +} + +typedef struct CvSize2D32f +{ + float width; + float height; + +#ifdef __cplusplus + CvSize2D32f(float w = 0, float h = 0): width(w), height(h) {} + template + CvSize2D32f(const cv::Size_<_Tp>& sz): width(cv::saturate_cast(sz.width)), height(cv::saturate_cast(sz.height)) {} + template + operator cv::Size_<_Tp>() const { return cv::Size_<_Tp>(cv::saturate_cast<_Tp>(width), cv::saturate_cast<_Tp>(height)); } +#endif +} +CvSize2D32f; + +/** constructs CvSize2D32f structure. */ +CV_INLINE CvSize2D32f cvSize2D32f( double width, double height ) +{ + CvSize2D32f s; + + s.width = (float)width; + s.height = (float)height; + + return s; +} + +/** @sa RotatedRect + */ +typedef struct CvBox2D +{ + CvPoint2D32f center; /**< Center of the box. */ + CvSize2D32f size; /**< Box width and length. */ + float angle; /**< Angle between the horizontal axis */ + /**< and the first side (i.e. length) in degrees */ + +#ifdef __cplusplus + CvBox2D(CvPoint2D32f c = CvPoint2D32f(), CvSize2D32f s = CvSize2D32f(), float a = 0) : center(c), size(s), angle(a) {} + CvBox2D(const cv::RotatedRect& rr) : center(rr.center), size(rr.size), angle(rr.angle) {} + operator cv::RotatedRect() const { return cv::RotatedRect(center, size, angle); } +#endif +} +CvBox2D; + + +/** Line iterator state: */ +typedef struct CvLineIterator +{ + /** Pointer to the current point: */ + uchar* ptr; + + /* Bresenham algorithm state: */ + int err; + int plus_delta; + int minus_delta; + int plus_step; + int minus_step; +} +CvLineIterator; + + + +/************************************* CvSlice ******************************************/ +#define CV_WHOLE_SEQ_END_INDEX 0x3fffffff +#define CV_WHOLE_SEQ cvSlice(0, CV_WHOLE_SEQ_END_INDEX) + +typedef struct CvSlice +{ + int start_index, end_index; + +#if defined(__cplusplus) && !defined(__CUDACC__) + CvSlice(int start = 0, int end = 0) : start_index(start), end_index(end) {} + CvSlice(const cv::Range& r) { *this = (r.start != INT_MIN && r.end != INT_MAX) ? CvSlice(r.start, r.end) : CvSlice(0, CV_WHOLE_SEQ_END_INDEX); } + operator cv::Range() const { return (start_index == 0 && end_index == CV_WHOLE_SEQ_END_INDEX ) ? cv::Range::all() : cv::Range(start_index, end_index); } +#endif +} +CvSlice; + +CV_INLINE CvSlice cvSlice( int start, int end ) +{ + CvSlice slice; + slice.start_index = start; + slice.end_index = end; + + return slice; +} + + + +/************************************* CvScalar *****************************************/ +/** @sa Scalar_ + */ +typedef struct CvScalar +{ + double val[4]; + +#ifdef __cplusplus + CvScalar() {} + CvScalar(double d0, double d1 = 0, double d2 = 0, double d3 = 0) { val[0] = d0; val[1] = d1; val[2] = d2; val[3] = d3; } + template + CvScalar(const cv::Scalar_<_Tp>& s) { val[0] = s.val[0]; val[1] = s.val[1]; val[2] = s.val[2]; val[3] = s.val[3]; } + template + operator cv::Scalar_<_Tp>() const { return cv::Scalar_<_Tp>(cv::saturate_cast<_Tp>(val[0]), cv::saturate_cast<_Tp>(val[1]), cv::saturate_cast<_Tp>(val[2]), cv::saturate_cast<_Tp>(val[3])); } + template + CvScalar(const cv::Vec<_Tp, cn>& v) + { + int i; + for( i = 0; i < (cn < 4 ? cn : 4); i++ ) val[i] = v.val[i]; + for( ; i < 4; i++ ) val[i] = 0; + } +#endif +} +CvScalar; + +CV_INLINE CvScalar cvScalar( double val0, double val1 CV_DEFAULT(0), + double val2 CV_DEFAULT(0), double val3 CV_DEFAULT(0)) +{ + CvScalar scalar; + scalar.val[0] = val0; scalar.val[1] = val1; + scalar.val[2] = val2; scalar.val[3] = val3; + return scalar; +} + + +CV_INLINE CvScalar cvRealScalar( double val0 ) +{ + CvScalar scalar; + scalar.val[0] = val0; + scalar.val[1] = scalar.val[2] = scalar.val[3] = 0; + return scalar; +} + +CV_INLINE CvScalar cvScalarAll( double val0123 ) +{ + CvScalar scalar; + scalar.val[0] = val0123; + scalar.val[1] = val0123; + scalar.val[2] = val0123; + scalar.val[3] = val0123; + return scalar; +} + +/****************************************************************************************\ +* Dynamic Data structures * +\****************************************************************************************/ + +/******************************** Memory storage ****************************************/ + +typedef struct CvMemBlock +{ + struct CvMemBlock* prev; + struct CvMemBlock* next; +} +CvMemBlock; + +#define CV_STORAGE_MAGIC_VAL 0x42890000 + +typedef struct CvMemStorage +{ + int signature; + CvMemBlock* bottom; /**< First allocated block. */ + CvMemBlock* top; /**< Current memory block - top of the stack. */ + struct CvMemStorage* parent; /**< We get new blocks from parent as needed. */ + int block_size; /**< Block size. */ + int free_space; /**< Remaining free space in current block. */ +} +CvMemStorage; + +#define CV_IS_STORAGE(storage) \ + ((storage) != NULL && \ + (((CvMemStorage*)(storage))->signature & CV_MAGIC_MASK) == CV_STORAGE_MAGIC_VAL) + + +typedef struct CvMemStoragePos +{ + CvMemBlock* top; + int free_space; +} +CvMemStoragePos; + + +/*********************************** Sequence *******************************************/ + +typedef struct CvSeqBlock +{ + struct CvSeqBlock* prev; /**< Previous sequence block. */ + struct CvSeqBlock* next; /**< Next sequence block. */ + int start_index; /**< Index of the first element in the block + */ + /**< sequence->first->start_index. */ + int count; /**< Number of elements in the block. */ + schar* data; /**< Pointer to the first element of the block. */ +} +CvSeqBlock; + + +#define CV_TREE_NODE_FIELDS(node_type) \ + int flags; /**< Miscellaneous flags. */ \ + int header_size; /**< Size of sequence header. */ \ + struct node_type* h_prev; /**< Previous sequence. */ \ + struct node_type* h_next; /**< Next sequence. */ \ + struct node_type* v_prev; /**< 2nd previous sequence. */ \ + struct node_type* v_next /**< 2nd next sequence. */ + +/** + Read/Write sequence. + Elements can be dynamically inserted to or deleted from the sequence. +*/ +#define CV_SEQUENCE_FIELDS() \ + CV_TREE_NODE_FIELDS(CvSeq); \ + int total; /**< Total number of elements. */ \ + int elem_size; /**< Size of sequence element in bytes. */ \ + schar* block_max; /**< Maximal bound of the last block. */ \ + schar* ptr; /**< Current write pointer. */ \ + int delta_elems; /**< Grow seq this many at a time. */ \ + CvMemStorage* storage; /**< Where the seq is stored. */ \ + CvSeqBlock* free_blocks; /**< Free blocks list. */ \ + CvSeqBlock* first; /**< Pointer to the first sequence block. */ + +typedef struct CvSeq +{ + CV_SEQUENCE_FIELDS() +} +CvSeq; + +#define CV_TYPE_NAME_SEQ "opencv-sequence" +#define CV_TYPE_NAME_SEQ_TREE "opencv-sequence-tree" + +/*************************************** Set ********************************************/ +/** @brief Set + Order is not preserved. There can be gaps between sequence elements. + After the element has been inserted it stays in the same place all the time. + The MSB(most-significant or sign bit) of the first field (flags) is 0 iff the element exists. +*/ +#define CV_SET_ELEM_FIELDS(elem_type) \ + int flags; \ + struct elem_type* next_free; + +typedef struct CvSetElem +{ + CV_SET_ELEM_FIELDS(CvSetElem) +} +CvSetElem; + +#define CV_SET_FIELDS() \ + CV_SEQUENCE_FIELDS() \ + CvSetElem* free_elems; \ + int active_count; + +typedef struct CvSet +{ + CV_SET_FIELDS() +} +CvSet; + + +#define CV_SET_ELEM_IDX_MASK ((1 << 26) - 1) +#define CV_SET_ELEM_FREE_FLAG (1 << (sizeof(int)*8-1)) + +/** Checks whether the element pointed by ptr belongs to a set or not */ +#define CV_IS_SET_ELEM( ptr ) (((CvSetElem*)(ptr))->flags >= 0) + +/************************************* Graph ********************************************/ + +/** @name Graph + +We represent a graph as a set of vertices. Vertices contain their adjacency lists (more exactly, +pointers to first incoming or outcoming edge (or 0 if isolated vertex)). Edges are stored in +another set. There is a singly-linked list of incoming/outcoming edges for each vertex. + +Each edge consists of: + +- Two pointers to the starting and ending vertices (vtx[0] and vtx[1] respectively). + + A graph may be oriented or not. In the latter case, edges between vertex i to vertex j are not +distinguished during search operations. + +- Two pointers to next edges for the starting and ending vertices, where next[0] points to the +next edge in the vtx[0] adjacency list and next[1] points to the next edge in the vtx[1] +adjacency list. + +@see CvGraphEdge, CvGraphVtx, CvGraphVtx2D, CvGraph +@{ +*/ +#define CV_GRAPH_EDGE_FIELDS() \ + int flags; \ + float weight; \ + struct CvGraphEdge* next[2]; \ + struct CvGraphVtx* vtx[2]; + + +#define CV_GRAPH_VERTEX_FIELDS() \ + int flags; \ + struct CvGraphEdge* first; + + +typedef struct CvGraphEdge +{ + CV_GRAPH_EDGE_FIELDS() +} +CvGraphEdge; + +typedef struct CvGraphVtx +{ + CV_GRAPH_VERTEX_FIELDS() +} +CvGraphVtx; + +typedef struct CvGraphVtx2D +{ + CV_GRAPH_VERTEX_FIELDS() + CvPoint2D32f* ptr; +} +CvGraphVtx2D; + +/** + Graph is "derived" from the set (this is set a of vertices) + and includes another set (edges) +*/ +#define CV_GRAPH_FIELDS() \ + CV_SET_FIELDS() \ + CvSet* edges; + +typedef struct CvGraph +{ + CV_GRAPH_FIELDS() +} +CvGraph; + +#define CV_TYPE_NAME_GRAPH "opencv-graph" + +/** @} */ + +/*********************************** Chain/Countour *************************************/ + +typedef struct CvChain +{ + CV_SEQUENCE_FIELDS() + CvPoint origin; +} +CvChain; + +#define CV_CONTOUR_FIELDS() \ + CV_SEQUENCE_FIELDS() \ + CvRect rect; \ + int color; \ + int reserved[3]; + +typedef struct CvContour +{ + CV_CONTOUR_FIELDS() +} +CvContour; + +typedef CvContour CvPoint2DSeq; + +/****************************************************************************************\ +* Sequence types * +\****************************************************************************************/ + +#define CV_SEQ_MAGIC_VAL 0x42990000 + +#define CV_IS_SEQ(seq) \ + ((seq) != NULL && (((CvSeq*)(seq))->flags & CV_MAGIC_MASK) == CV_SEQ_MAGIC_VAL) + +#define CV_SET_MAGIC_VAL 0x42980000 +#define CV_IS_SET(set) \ + ((set) != NULL && (((CvSeq*)(set))->flags & CV_MAGIC_MASK) == CV_SET_MAGIC_VAL) + +#define CV_SEQ_ELTYPE_BITS 12 +#define CV_SEQ_ELTYPE_MASK ((1 << CV_SEQ_ELTYPE_BITS) - 1) + +#define CV_SEQ_ELTYPE_POINT CV_32SC2 /**< (x,y) */ +#define CV_SEQ_ELTYPE_CODE CV_8UC1 /**< freeman code: 0..7 */ +#define CV_SEQ_ELTYPE_GENERIC 0 +#define CV_SEQ_ELTYPE_PTR CV_USRTYPE1 +#define CV_SEQ_ELTYPE_PPOINT CV_SEQ_ELTYPE_PTR /**< &(x,y) */ +#define CV_SEQ_ELTYPE_INDEX CV_32SC1 /**< #(x,y) */ +#define CV_SEQ_ELTYPE_GRAPH_EDGE 0 /**< &next_o, &next_d, &vtx_o, &vtx_d */ +#define CV_SEQ_ELTYPE_GRAPH_VERTEX 0 /**< first_edge, &(x,y) */ +#define CV_SEQ_ELTYPE_TRIAN_ATR 0 /**< vertex of the binary tree */ +#define CV_SEQ_ELTYPE_CONNECTED_COMP 0 /**< connected component */ +#define CV_SEQ_ELTYPE_POINT3D CV_32FC3 /**< (x,y,z) */ + +#define CV_SEQ_KIND_BITS 2 +#define CV_SEQ_KIND_MASK (((1 << CV_SEQ_KIND_BITS) - 1)<flags & CV_SEQ_ELTYPE_MASK) +#define CV_SEQ_KIND( seq ) ((seq)->flags & CV_SEQ_KIND_MASK ) + +/** flag checking */ +#define CV_IS_SEQ_INDEX( seq ) ((CV_SEQ_ELTYPE(seq) == CV_SEQ_ELTYPE_INDEX) && \ + (CV_SEQ_KIND(seq) == CV_SEQ_KIND_GENERIC)) + +#define CV_IS_SEQ_CURVE( seq ) (CV_SEQ_KIND(seq) == CV_SEQ_KIND_CURVE) +#define CV_IS_SEQ_CLOSED( seq ) (((seq)->flags & CV_SEQ_FLAG_CLOSED) != 0) +#define CV_IS_SEQ_CONVEX( seq ) 0 +#define CV_IS_SEQ_HOLE( seq ) (((seq)->flags & CV_SEQ_FLAG_HOLE) != 0) +#define CV_IS_SEQ_SIMPLE( seq ) 1 + +/** type checking macros */ +#define CV_IS_SEQ_POINT_SET( seq ) \ + ((CV_SEQ_ELTYPE(seq) == CV_32SC2 || CV_SEQ_ELTYPE(seq) == CV_32FC2)) + +#define CV_IS_SEQ_POINT_SUBSET( seq ) \ + (CV_IS_SEQ_INDEX( seq ) || CV_SEQ_ELTYPE(seq) == CV_SEQ_ELTYPE_PPOINT) + +#define CV_IS_SEQ_POLYLINE( seq ) \ + (CV_SEQ_KIND(seq) == CV_SEQ_KIND_CURVE && CV_IS_SEQ_POINT_SET(seq)) + +#define CV_IS_SEQ_POLYGON( seq ) \ + (CV_IS_SEQ_POLYLINE(seq) && CV_IS_SEQ_CLOSED(seq)) + +#define CV_IS_SEQ_CHAIN( seq ) \ + (CV_SEQ_KIND(seq) == CV_SEQ_KIND_CURVE && (seq)->elem_size == 1) + +#define CV_IS_SEQ_CONTOUR( seq ) \ + (CV_IS_SEQ_CLOSED(seq) && (CV_IS_SEQ_POLYLINE(seq) || CV_IS_SEQ_CHAIN(seq))) + +#define CV_IS_SEQ_CHAIN_CONTOUR( seq ) \ + (CV_IS_SEQ_CHAIN( seq ) && CV_IS_SEQ_CLOSED( seq )) + +#define CV_IS_SEQ_POLYGON_TREE( seq ) \ + (CV_SEQ_ELTYPE (seq) == CV_SEQ_ELTYPE_TRIAN_ATR && \ + CV_SEQ_KIND( seq ) == CV_SEQ_KIND_BIN_TREE ) + +#define CV_IS_GRAPH( seq ) \ + (CV_IS_SET(seq) && CV_SEQ_KIND((CvSet*)(seq)) == CV_SEQ_KIND_GRAPH) + +#define CV_IS_GRAPH_ORIENTED( seq ) \ + (((seq)->flags & CV_GRAPH_FLAG_ORIENTED) != 0) + +#define CV_IS_SUBDIV2D( seq ) \ + (CV_IS_SET(seq) && CV_SEQ_KIND((CvSet*)(seq)) == CV_SEQ_KIND_SUBDIV2D) + +/****************************************************************************************/ +/* Sequence writer & reader */ +/****************************************************************************************/ + +#define CV_SEQ_WRITER_FIELDS() \ + int header_size; \ + CvSeq* seq; /**< the sequence written */ \ + CvSeqBlock* block; /**< current block */ \ + schar* ptr; /**< pointer to free space */ \ + schar* block_min; /**< pointer to the beginning of block*/\ + schar* block_max; /**< pointer to the end of block */ + +typedef struct CvSeqWriter +{ + CV_SEQ_WRITER_FIELDS() +} +CvSeqWriter; + + +#define CV_SEQ_READER_FIELDS() \ + int header_size; \ + CvSeq* seq; /**< sequence, beign read */ \ + CvSeqBlock* block; /**< current block */ \ + schar* ptr; /**< pointer to element be read next */ \ + schar* block_min; /**< pointer to the beginning of block */\ + schar* block_max; /**< pointer to the end of block */ \ + int delta_index;/**< = seq->first->start_index */ \ + schar* prev_elem; /**< pointer to previous element */ + +typedef struct CvSeqReader +{ + CV_SEQ_READER_FIELDS() +} +CvSeqReader; + +/****************************************************************************************/ +/* Operations on sequences */ +/****************************************************************************************/ + +#define CV_SEQ_ELEM( seq, elem_type, index ) \ +/** assert gives some guarantee that parameter is valid */ \ +( assert(sizeof((seq)->first[0]) == sizeof(CvSeqBlock) && \ + (seq)->elem_size == sizeof(elem_type)), \ + (elem_type*)((seq)->first && (unsigned)index < \ + (unsigned)((seq)->first->count) ? \ + (seq)->first->data + (index) * sizeof(elem_type) : \ + cvGetSeqElem( (CvSeq*)(seq), (index) ))) +#define CV_GET_SEQ_ELEM( elem_type, seq, index ) CV_SEQ_ELEM( (seq), elem_type, (index) ) + +/** Add element to sequence: */ +#define CV_WRITE_SEQ_ELEM_VAR( elem_ptr, writer ) \ +{ \ + if( (writer).ptr >= (writer).block_max ) \ + { \ + cvCreateSeqBlock( &writer); \ + } \ + memcpy((writer).ptr, elem_ptr, (writer).seq->elem_size);\ + (writer).ptr += (writer).seq->elem_size; \ +} + +#define CV_WRITE_SEQ_ELEM( elem, writer ) \ +{ \ + assert( (writer).seq->elem_size == sizeof(elem)); \ + if( (writer).ptr >= (writer).block_max ) \ + { \ + cvCreateSeqBlock( &writer); \ + } \ + assert( (writer).ptr <= (writer).block_max - sizeof(elem));\ + memcpy((writer).ptr, &(elem), sizeof(elem)); \ + (writer).ptr += sizeof(elem); \ +} + + +/** Move reader position forward: */ +#define CV_NEXT_SEQ_ELEM( elem_size, reader ) \ +{ \ + if( ((reader).ptr += (elem_size)) >= (reader).block_max ) \ + { \ + cvChangeSeqBlock( &(reader), 1 ); \ + } \ +} + + +/** Move reader position backward: */ +#define CV_PREV_SEQ_ELEM( elem_size, reader ) \ +{ \ + if( ((reader).ptr -= (elem_size)) < (reader).block_min ) \ + { \ + cvChangeSeqBlock( &(reader), -1 ); \ + } \ +} + +/** Read element and move read position forward: */ +#define CV_READ_SEQ_ELEM( elem, reader ) \ +{ \ + assert( (reader).seq->elem_size == sizeof(elem)); \ + memcpy( &(elem), (reader).ptr, sizeof((elem))); \ + CV_NEXT_SEQ_ELEM( sizeof(elem), reader ) \ +} + +/** Read element and move read position backward: */ +#define CV_REV_READ_SEQ_ELEM( elem, reader ) \ +{ \ + assert( (reader).seq->elem_size == sizeof(elem)); \ + memcpy(&(elem), (reader).ptr, sizeof((elem))); \ + CV_PREV_SEQ_ELEM( sizeof(elem), reader ) \ +} + + +#define CV_READ_CHAIN_POINT( _pt, reader ) \ +{ \ + (_pt) = (reader).pt; \ + if( (reader).ptr ) \ + { \ + CV_READ_SEQ_ELEM( (reader).code, (reader)); \ + assert( ((reader).code & ~7) == 0 ); \ + (reader).pt.x += (reader).deltas[(int)(reader).code][0]; \ + (reader).pt.y += (reader).deltas[(int)(reader).code][1]; \ + } \ +} + +#define CV_CURRENT_POINT( reader ) (*((CvPoint*)((reader).ptr))) +#define CV_PREV_POINT( reader ) (*((CvPoint*)((reader).prev_elem))) + +#define CV_READ_EDGE( pt1, pt2, reader ) \ +{ \ + assert( sizeof(pt1) == sizeof(CvPoint) && \ + sizeof(pt2) == sizeof(CvPoint) && \ + reader.seq->elem_size == sizeof(CvPoint)); \ + (pt1) = CV_PREV_POINT( reader ); \ + (pt2) = CV_CURRENT_POINT( reader ); \ + (reader).prev_elem = (reader).ptr; \ + CV_NEXT_SEQ_ELEM( sizeof(CvPoint), (reader)); \ +} + +/************ Graph macros ************/ + +/** Return next graph edge for given vertex: */ +#define CV_NEXT_GRAPH_EDGE( edge, vertex ) \ + (assert((edge)->vtx[0] == (vertex) || (edge)->vtx[1] == (vertex)), \ + (edge)->next[(edge)->vtx[1] == (vertex)]) + + + +/****************************************************************************************\ +* Data structures for persistence (a.k.a serialization) functionality * +\****************************************************************************************/ + +/** "black box" file storage */ +typedef struct CvFileStorage CvFileStorage; + +/** Storage flags: */ +#define CV_STORAGE_READ 0 +#define CV_STORAGE_WRITE 1 +#define CV_STORAGE_WRITE_TEXT CV_STORAGE_WRITE +#define CV_STORAGE_WRITE_BINARY CV_STORAGE_WRITE +#define CV_STORAGE_APPEND 2 +#define CV_STORAGE_MEMORY 4 +#define CV_STORAGE_FORMAT_MASK (7<<3) +#define CV_STORAGE_FORMAT_AUTO 0 +#define CV_STORAGE_FORMAT_XML 8 +#define CV_STORAGE_FORMAT_YAML 16 + +/** @brief List of attributes. : + +In the current implementation, attributes are used to pass extra parameters when writing user +objects (see cvWrite). XML attributes inside tags are not supported, aside from the object type +specification (type_id attribute). +@see cvAttrList, cvAttrValue + */ +typedef struct CvAttrList +{ + const char** attr; /**< NULL-terminated array of (attribute_name,attribute_value) pairs. */ + struct CvAttrList* next; /**< Pointer to next chunk of the attributes list. */ +} +CvAttrList; + +/** initializes CvAttrList structure */ +CV_INLINE CvAttrList cvAttrList( const char** attr CV_DEFAULT(NULL), + CvAttrList* next CV_DEFAULT(NULL) ) +{ + CvAttrList l; + l.attr = attr; + l.next = next; + + return l; +} + +struct CvTypeInfo; + +#define CV_NODE_NONE 0 +#define CV_NODE_INT 1 +#define CV_NODE_INTEGER CV_NODE_INT +#define CV_NODE_REAL 2 +#define CV_NODE_FLOAT CV_NODE_REAL +#define CV_NODE_STR 3 +#define CV_NODE_STRING CV_NODE_STR +#define CV_NODE_REF 4 /**< not used */ +#define CV_NODE_SEQ 5 +#define CV_NODE_MAP 6 +#define CV_NODE_TYPE_MASK 7 + +#define CV_NODE_TYPE(flags) ((flags) & CV_NODE_TYPE_MASK) + +/** file node flags */ +#define CV_NODE_FLOW 8 /**= CV_NODE_SEQ) +#define CV_NODE_IS_FLOW(flags) (((flags) & CV_NODE_FLOW) != 0) +#define CV_NODE_IS_EMPTY(flags) (((flags) & CV_NODE_EMPTY) != 0) +#define CV_NODE_IS_USER(flags) (((flags) & CV_NODE_USER) != 0) +#define CV_NODE_HAS_NAME(flags) (((flags) & CV_NODE_NAMED) != 0) + +#define CV_NODE_SEQ_SIMPLE 256 +#define CV_NODE_SEQ_IS_SIMPLE(seq) (((seq)->flags & CV_NODE_SEQ_SIMPLE) != 0) + +typedef struct CvString +{ + int len; + char* ptr; +} +CvString; + +/** All the keys (names) of elements in the readed file storage + are stored in the hash to speed up the lookup operations: */ +typedef struct CvStringHashNode +{ + unsigned hashval; + CvString str; + struct CvStringHashNode* next; +} +CvStringHashNode; + +typedef struct CvGenericHash CvFileNodeHash; + +/** Basic element of the file storage - scalar or collection: */ +typedef struct CvFileNode +{ + int tag; + struct CvTypeInfo* info; /**< type information + (only for user-defined object, for others it is 0) */ + union + { + double f; /**< scalar floating-point number */ + int i; /**< scalar integer number */ + CvString str; /**< text string */ + CvSeq* seq; /**< sequence (ordered collection of file nodes) */ + CvFileNodeHash* map; /**< map (collection of named file nodes) */ + } data; +} +CvFileNode; + +#ifdef __cplusplus +extern "C" { +#endif +typedef int (CV_CDECL *CvIsInstanceFunc)( const void* struct_ptr ); +typedef void (CV_CDECL *CvReleaseFunc)( void** struct_dblptr ); +typedef void* (CV_CDECL *CvReadFunc)( CvFileStorage* storage, CvFileNode* node ); +typedef void (CV_CDECL *CvWriteFunc)( CvFileStorage* storage, const char* name, + const void* struct_ptr, CvAttrList attributes ); +typedef void* (CV_CDECL *CvCloneFunc)( const void* struct_ptr ); +#ifdef __cplusplus +} +#endif + +/** @brief Type information + +The structure contains information about one of the standard or user-defined types. Instances of the +type may or may not contain a pointer to the corresponding CvTypeInfo structure. In any case, there +is a way to find the type info structure for a given object using the cvTypeOf function. +Alternatively, type info can be found by type name using cvFindType, which is used when an object +is read from file storage. The user can register a new type with cvRegisterType that adds the type +information structure into the beginning of the type list. Thus, it is possible to create +specialized types from generic standard types and override the basic methods. + */ +typedef struct CvTypeInfo +{ + int flags; /**< not used */ + int header_size; /**< sizeof(CvTypeInfo) */ + struct CvTypeInfo* prev; /**< previous registered type in the list */ + struct CvTypeInfo* next; /**< next registered type in the list */ + const char* type_name; /**< type name, written to file storage */ + CvIsInstanceFunc is_instance; /**< checks if the passed object belongs to the type */ + CvReleaseFunc release; /**< releases object (memory etc.) */ + CvReadFunc read; /**< reads object from file storage */ + CvWriteFunc write; /**< writes object to file storage */ + CvCloneFunc clone; /**< creates a copy of the object */ +} +CvTypeInfo; + + +/**** System data types ******/ + +typedef struct CvPluginFuncInfo +{ + void** func_addr; + void* default_func_addr; + const char* func_names; + int search_modules; + int loaded_from; +} +CvPluginFuncInfo; + +typedef struct CvModuleInfo +{ + struct CvModuleInfo* next; + const char* name; + const char* version; + CvPluginFuncInfo* func_tab; +} +CvModuleInfo; + +/** @} */ + +#endif /*__OPENCV_CORE_TYPES_H__*/ + +/* End of file. */ diff --git a/lib/opencv/include/opencv2/core/utility.hpp b/lib/opencv/include/opencv2/core/utility.hpp new file mode 100644 index 000000000..b66ade5c1 --- /dev/null +++ b/lib/opencv/include/opencv2/core/utility.hpp @@ -0,0 +1,889 @@ +/*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. +// 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_UTILITY_H__ +#define __OPENCV_CORE_UTILITY_H__ + +#ifndef __cplusplus +# error utility.hpp header must be compiled as C++ +#endif + +#include "opencv2/core.hpp" + +namespace cv +{ + +#ifdef CV_COLLECT_IMPL_DATA +CV_EXPORTS void setImpl(int flags); // set implementation flags and reset storage arrays +CV_EXPORTS void addImpl(int flag, const char* func = 0); // add implementation and function name to storage arrays +// Get stored implementation flags and fucntions names arrays +// Each implementation entry correspond to function name entry, so you can find which implementation was executed in which fucntion +CV_EXPORTS int getImpl(std::vector &impl, std::vector &funName); + +CV_EXPORTS bool useCollection(); // return implementation collection state +CV_EXPORTS void setUseCollection(bool flag); // set implementation collection state + +#define CV_IMPL_PLAIN 0x01 // native CPU OpenCV implementation +#define CV_IMPL_OCL 0x02 // OpenCL implementation +#define CV_IMPL_IPP 0x04 // IPP implementation +#define CV_IMPL_MT 0x10 // multithreaded implementation + +#define CV_IMPL_ADD(impl) \ + if(cv::useCollection()) \ + { \ + cv::addImpl(impl, CV_Func); \ + } +#else +#define CV_IMPL_ADD(impl) +#endif + +//! @addtogroup core_utils +//! @{ + +/** @brief Automatically Allocated Buffer Class + + The class is used for temporary buffers in functions and methods. + If a temporary buffer is usually small (a few K's of memory), + but its size depends on the parameters, it makes sense to create a small + fixed-size array on stack and use it if it's large enough. If the required buffer size + is larger than the fixed size, another buffer of sufficient size is allocated dynamically + and released after the processing. Therefore, in typical cases, when the buffer size is small, + there is no overhead associated with malloc()/free(). + At the same time, there is no limit on the size of processed data. + + This is what AutoBuffer does. The template takes 2 parameters - type of the buffer elements and + the number of stack-allocated elements. Here is how the class is used: + + \code + void my_func(const cv::Mat& m) + { + cv::AutoBuffer buf; // create automatic buffer containing 1000 floats + + buf.allocate(m.rows); // if m.rows <= 1000, the pre-allocated buffer is used, + // otherwise the buffer of "m.rows" floats will be allocated + // dynamically and deallocated in cv::AutoBuffer destructor + ... + } + \endcode +*/ +template class AutoBuffer +{ +public: + typedef _Tp value_type; + + //! the default constructor + AutoBuffer(); + //! constructor taking the real buffer size + AutoBuffer(size_t _size); + + //! the copy constructor + AutoBuffer(const AutoBuffer<_Tp, fixed_size>& buf); + //! the assignment operator + AutoBuffer<_Tp, fixed_size>& operator = (const AutoBuffer<_Tp, fixed_size>& buf); + + //! destructor. calls deallocate() + ~AutoBuffer(); + + //! allocates the new buffer of size _size. if the _size is small enough, stack-allocated buffer is used + void allocate(size_t _size); + //! deallocates the buffer if it was dynamically allocated + void deallocate(); + //! resizes the buffer and preserves the content + void resize(size_t _size); + //! returns the current buffer size + size_t size() const; + //! returns pointer to the real buffer, stack-allocated or head-allocated + operator _Tp* (); + //! returns read-only pointer to the real buffer, stack-allocated or head-allocated + operator const _Tp* () const; + +protected: + //! pointer to the real buffer, can point to buf if the buffer is small enough + _Tp* ptr; + //! size of the real buffer + size_t sz; + //! pre-allocated buffer. At least 1 element to confirm C++ standard reqirements + _Tp buf[(fixed_size > 0) ? fixed_size : 1]; +}; + +/** @brief Sets/resets the break-on-error mode. + +When the break-on-error mode is set, the default error handler issues a hardware exception, which +can make debugging more convenient. + +\return the previous state + */ +CV_EXPORTS bool setBreakOnError(bool flag); + +extern "C" typedef int (*ErrorCallback)( int status, const char* func_name, + const char* err_msg, const char* file_name, + int line, void* userdata ); + + +/** @brief Sets the new error handler and the optional user data. + + The function sets the new error handler, called from cv::error(). + + \param errCallback the new error handler. If NULL, the default error handler is used. + \param userdata the optional user data pointer, passed to the callback. + \param prevUserdata the optional output parameter where the previous user data pointer is stored + + \return the previous error handler +*/ +CV_EXPORTS ErrorCallback redirectError( ErrorCallback errCallback, void* userdata=0, void** prevUserdata=0); + +/** @brief Returns a text string formatted using the printf-like expression. + +The function acts like sprintf but forms and returns an STL string. It can be used to form an error +message in the Exception constructor. +@param fmt printf-compatible formatting specifiers. + */ +CV_EXPORTS String format( const char* fmt, ... ); +CV_EXPORTS String tempfile( const char* suffix = 0); +CV_EXPORTS void glob(String pattern, std::vector& result, bool recursive = false); + +/** @brief OpenCV will try to set the number of threads for the next parallel region. + +If threads == 0, OpenCV will disable threading optimizations and run all it's functions +sequentially. Passing threads \< 0 will reset threads number to system default. This function must +be called outside of parallel region. + +OpenCV will try to run it's functions with specified threads number, but some behaviour differs from +framework: +- `TBB` – User-defined parallel constructions will run with the same threads number, if + another does not specified. If late on user creates own scheduler, OpenCV will be use it. +- `OpenMP` – No special defined behaviour. +- `Concurrency` – If threads == 1, OpenCV will disable threading optimizations and run it's + functions sequentially. +- `GCD` – Supports only values \<= 0. +- `C=` – No special defined behaviour. +@param nthreads Number of threads used by OpenCV. +@sa getNumThreads, getThreadNum + */ +CV_EXPORTS_W void setNumThreads(int nthreads); + +/** @brief Returns the number of threads used by OpenCV for parallel regions. + +Always returns 1 if OpenCV is built without threading support. + +The exact meaning of return value depends on the threading framework used by OpenCV library: +- `TBB` – The number of threads, that OpenCV will try to use for parallel regions. If there is + any tbb::thread_scheduler_init in user code conflicting with OpenCV, then function returns + default number of threads used by TBB library. +- `OpenMP` – An upper bound on the number of threads that could be used to form a new team. +- `Concurrency` – The number of threads, that OpenCV will try to use for parallel regions. +- `GCD` – Unsupported; returns the GCD thread pool limit (512) for compatibility. +- `C=` – The number of threads, that OpenCV will try to use for parallel regions, if before + called setNumThreads with threads \> 0, otherwise returns the number of logical CPUs, + available for the process. +@sa setNumThreads, getThreadNum + */ +CV_EXPORTS_W int getNumThreads(); + +/** @brief Returns the index of the currently executed thread within the current parallel region. Always +returns 0 if called outside of parallel region. + +The exact meaning of return value depends on the threading framework used by OpenCV library: +- `TBB` – Unsupported with current 4.1 TBB release. May be will be supported in future. +- `OpenMP` – The thread number, within the current team, of the calling thread. +- `Concurrency` – An ID for the virtual processor that the current context is executing on (0 + for master thread and unique number for others, but not necessary 1,2,3,...). +- `GCD` – System calling thread's ID. Never returns 0 inside parallel region. +- `C=` – The index of the current parallel task. +@sa setNumThreads, getNumThreads + */ +CV_EXPORTS_W int getThreadNum(); + +/** @brief Returns full configuration time cmake output. + +Returned value is raw cmake output including version control system revision, compiler version, +compiler flags, enabled modules and third party libraries, etc. Output format depends on target +architecture. + */ +CV_EXPORTS_W const String& getBuildInformation(); + +/** @brief Returns the number of ticks. + +The function returns the number of ticks after the certain event (for example, when the machine was +turned on). It can be used to initialize RNG or to measure a function execution time by reading the +tick count before and after the function call. See also the tick frequency. + */ +CV_EXPORTS_W int64 getTickCount(); + +/** @brief Returns the number of ticks per second. + +The function returns the number of ticks per second. That is, the following code computes the +execution time in seconds: +@code + double t = (double)getTickCount(); + // do something ... + t = ((double)getTickCount() - t)/getTickFrequency(); +@endcode + */ +CV_EXPORTS_W double getTickFrequency(); + +/** @brief Returns the number of CPU ticks. + +The function returns the current number of CPU ticks on some architectures (such as x86, x64, +PowerPC). On other platforms the function is equivalent to getTickCount. It can also be used for +very accurate time measurements, as well as for RNG initialization. Note that in case of multi-CPU +systems a thread, from which getCPUTickCount is called, can be suspended and resumed at another CPU +with its own counter. So, theoretically (and practically) the subsequent calls to the function do +not necessary return the monotonously increasing values. Also, since a modern CPU varies the CPU +frequency depending on the load, the number of CPU clocks spent in some code cannot be directly +converted to time units. Therefore, getTickCount is generally a preferable solution for measuring +execution time. + */ +CV_EXPORTS_W int64 getCPUTickCount(); + +/** @brief Returns true if the specified feature is supported by the host hardware. + +The function returns true if the host hardware supports the specified feature. When user calls +setUseOptimized(false), the subsequent calls to checkHardwareSupport() will return false until +setUseOptimized(true) is called. This way user can dynamically switch on and off the optimized code +in OpenCV. +@param feature The feature of interest, one of cv::CpuFeatures + */ +CV_EXPORTS_W bool checkHardwareSupport(int feature); + +/** @brief Returns the number of logical CPUs available for the process. + */ +CV_EXPORTS_W int getNumberOfCPUs(); + + +/** @brief Aligns a pointer to the specified number of bytes. + +The function returns the aligned pointer of the same type as the input pointer: +\f[\texttt{(_Tp*)(((size_t)ptr + n-1) & -n)}\f] +@param ptr Aligned pointer. +@param n Alignment size that must be a power of two. + */ +template static inline _Tp* alignPtr(_Tp* ptr, int n=(int)sizeof(_Tp)) +{ + return (_Tp*)(((size_t)ptr + n-1) & -n); +} + +/** @brief Aligns a buffer size to the specified number of bytes. + +The function returns the minimum number that is greater or equal to sz and is divisible by n : +\f[\texttt{(sz + n-1) & -n}\f] +@param sz Buffer size to align. +@param n Alignment size that must be a power of two. + */ +static inline size_t alignSize(size_t sz, int n) +{ + CV_DbgAssert((n & (n - 1)) == 0); // n is a power of 2 + return (sz + n-1) & -n; +} + +/** @brief Enables or disables the optimized code. + +The function can be used to dynamically turn on and off optimized code (code that uses SSE2, AVX, +and other instructions on the platforms that support it). It sets a global flag that is further +checked by OpenCV functions. Since the flag is not checked in the inner OpenCV loops, it is only +safe to call the function on the very top level in your application where you can be sure that no +other OpenCV function is currently executed. + +By default, the optimized code is enabled unless you disable it in CMake. The current status can be +retrieved using useOptimized. +@param onoff The boolean flag specifying whether the optimized code should be used (onoff=true) +or not (onoff=false). + */ +CV_EXPORTS_W void setUseOptimized(bool onoff); + +/** @brief Returns the status of optimized code usage. + +The function returns true if the optimized code is enabled. Otherwise, it returns false. + */ +CV_EXPORTS_W bool useOptimized(); + +static inline size_t getElemSize(int type) { return CV_ELEM_SIZE(type); } + +/////////////////////////////// Parallel Primitives ////////////////////////////////// + +/** @brief Base class for parallel data processors +*/ +class CV_EXPORTS ParallelLoopBody +{ +public: + virtual ~ParallelLoopBody(); + virtual void operator() (const Range& range) const = 0; +}; + +/** @brief Parallel data processor +*/ +CV_EXPORTS void parallel_for_(const Range& range, const ParallelLoopBody& body, double nstripes=-1.); + +/////////////////////////////// forEach method of cv::Mat //////////////////////////// +template inline +void Mat::forEach_impl(const Functor& operation) { + if (false) { + operation(*reinterpret_cast<_Tp*>(0), reinterpret_cast(NULL)); + // If your compiler fail in this line. + // Please check that your functor signature is + // (_Tp&, const int*) <- multidimential + // or (_Tp&, void*) <- in case of you don't need current idx. + } + + CV_Assert(this->total() / this->size[this->dims - 1] <= INT_MAX); + const int LINES = static_cast(this->total() / this->size[this->dims - 1]); + + class PixelOperationWrapper :public ParallelLoopBody + { + public: + PixelOperationWrapper(Mat_<_Tp>* const frame, const Functor& _operation) + : mat(frame), op(_operation) {}; + virtual ~PixelOperationWrapper(){}; + // ! Overloaded virtual operator + // convert range call to row call. + virtual void operator()(const Range &range) const { + const int DIMS = mat->dims; + const int COLS = mat->size[DIMS - 1]; + if (DIMS <= 2) { + for (int row = range.start; row < range.end; ++row) { + this->rowCall2(row, COLS); + } + } else { + std::vector idx(COLS); /// idx is modified in this->rowCall + idx[DIMS - 2] = range.start - 1; + + for (int line_num = range.start; line_num < range.end; ++line_num) { + idx[DIMS - 2]++; + for (int i = DIMS - 2; i >= 0; --i) { + if (idx[i] >= mat->size[i]) { + idx[i - 1] += idx[i] / mat->size[i]; + idx[i] %= mat->size[i]; + continue; // carry-over; + } + else { + break; + } + } + this->rowCall(&idx[0], COLS, DIMS); + } + } + }; + private: + Mat_<_Tp>* const mat; + const Functor op; + // ! Call operator for each elements in this row. + inline void rowCall(int* const idx, const int COLS, const int DIMS) const { + int &col = idx[DIMS - 1]; + col = 0; + _Tp* pixel = &(mat->template at<_Tp>(idx)); + + while (col < COLS) { + op(*pixel, const_cast(idx)); + pixel++; col++; + } + col = 0; + } + // ! Call operator for each elements in this row. 2d mat special version. + inline void rowCall2(const int row, const int COLS) const { + union Index{ + int body[2]; + operator const int*() const { + return reinterpret_cast(this); + } + int& operator[](const int i) { + return body[i]; + } + } idx = {{row, 0}}; + // Special union is needed to avoid + // "error: array subscript is above array bounds [-Werror=array-bounds]" + // when call the functor `op` such that access idx[3]. + + _Tp* pixel = &(mat->template at<_Tp>(idx)); + const _Tp* const pixel_end = pixel + COLS; + while(pixel < pixel_end) { + op(*pixel++, static_cast(idx)); + idx[1]++; + } + }; + PixelOperationWrapper& operator=(const PixelOperationWrapper &) { + CV_Assert(false); + // We can not remove this implementation because Visual Studio warning C4822. + return *this; + }; + }; + + parallel_for_(cv::Range(0, LINES), PixelOperationWrapper(reinterpret_cast*>(this), operation)); +} + +/////////////////////////// Synchronization Primitives /////////////////////////////// + +class CV_EXPORTS Mutex +{ +public: + Mutex(); + ~Mutex(); + Mutex(const Mutex& m); + Mutex& operator = (const Mutex& m); + + void lock(); + bool trylock(); + void unlock(); + + struct Impl; +protected: + Impl* impl; +}; + +class CV_EXPORTS AutoLock +{ +public: + AutoLock(Mutex& m) : mutex(&m) { mutex->lock(); } + ~AutoLock() { mutex->unlock(); } +protected: + Mutex* mutex; +private: + AutoLock(const AutoLock&); + AutoLock& operator = (const AutoLock&); +}; + +// TLS interface +class CV_EXPORTS TLSDataContainer +{ +protected: + TLSDataContainer(); + virtual ~TLSDataContainer(); + + void gatherData(std::vector &data) const; +#if OPENCV_ABI_COMPATIBILITY > 300 + void* getData() const; + void release(); + +private: +#else + void release(); + +public: + void* getData() const; +#endif + virtual void* createDataInstance() const = 0; + virtual void deleteDataInstance(void* pData) const = 0; + + int key_; +}; + +// Main TLS data class +template +class TLSData : protected TLSDataContainer +{ +public: + inline TLSData() {} + inline ~TLSData() { release(); } // Release key and delete associated data + inline T* get() const { return (T*)getData(); } // Get data assosiated with key + + // Get data from all threads + inline void gather(std::vector &data) const + { + std::vector &dataVoid = reinterpret_cast&>(data); + gatherData(dataVoid); + } + +private: + virtual void* createDataInstance() const {return new T;} // Wrapper to allocate data by template + virtual void deleteDataInstance(void* pData) const {delete (T*)pData;} // Wrapper to release data by template + + // Disable TLS copy operations + TLSData(TLSData &) {}; + TLSData& operator =(const TLSData &) {return *this;}; +}; + +/** @brief Designed for command line parsing + +The sample below demonstrates how to use CommandLineParser: +@code + CommandLineParser parser(argc, argv, keys); + parser.about("Application name v1.0.0"); + + if (parser.has("help")) + { + parser.printMessage(); + return 0; + } + + int N = parser.get("N"); + double fps = parser.get("fps"); + String path = parser.get("path"); + + use_time_stamp = parser.has("timestamp"); + + String img1 = parser.get(0); + String img2 = parser.get(1); + + int repeat = parser.get(2); + + if (!parser.check()) + { + parser.printErrors(); + return 0; + } +@endcode + +### Keys syntax + +The keys parameter is a string containing several blocks, each one is enclosed in curley braces and +describes one argument. Each argument contains three parts separated by the `|` symbol: + +-# argument names is a space-separated list of option synonyms (to mark argument as positional, prefix it with the `@` symbol) +-# default value will be used if the argument was not provided (can be empty) +-# help message (can be empty) + +For example: + +@code{.cpp} + const String keys = + "{help h usage ? | | print this message }" + "{@image1 | | image1 for compare }" + "{@image2 || image2 for compare }" + "{@repeat |1 | number }" + "{path |. | path to file }" + "{fps | -1.0 | fps for output video }" + "{N count |100 | count of objects }" + "{ts timestamp | | use time stamp }" + ; +} +@endcode + +Note that there are no default values for `help` and `timestamp` so we can check their presence using the `has()` method. +Arguments with default values are considered to be always present. Use the `get()` method in these cases to check their +actual value instead. + +String keys like `get("@image1")` return the empty string `""` by default - even with an empty default value. +Use the special `` default value to enforce that the returned string must not be empty. (like in `get("@image2")`) + +### Usage + +For the described keys: + +@code{.sh} + # Good call (3 positional parameters: image1, image2 and repeat; N is 200, ts is true) + $ ./app -N=200 1.png 2.jpg 19 -ts + + # Bad call + $ ./app -fps=aaa + ERRORS: + Parameter 'fps': can not convert: [aaa] to [double] +@endcode + */ +class CV_EXPORTS CommandLineParser +{ +public: + + /** @brief Constructor + + Initializes command line parser object + + @param argc number of command line arguments (from main()) + @param argv array of command line arguments (from main()) + @param keys string describing acceptable command line parameters (see class description for syntax) + */ + CommandLineParser(int argc, const char* const argv[], const String& keys); + + /** @brief Copy constructor */ + CommandLineParser(const CommandLineParser& parser); + + /** @brief Assignment operator */ + CommandLineParser& operator = (const CommandLineParser& parser); + + /** @brief Destructor */ + ~CommandLineParser(); + + /** @brief Returns application path + + This method returns the path to the executable from the command line (`argv[0]`). + + For example, if the application has been started with such command: + @code{.sh} + $ ./bin/my-executable + @endcode + this method will return `./bin`. + */ + String getPathToApplication() const; + + /** @brief Access arguments by name + + Returns argument converted to selected type. If the argument is not known or can not be + converted to selected type, the error flag is set (can be checked with @ref check). + + For example, define: + @code{.cpp} + String keys = "{N count||}"; + @endcode + + Call: + @code{.sh} + $ ./my-app -N=20 + # or + $ ./my-app --count=20 + @endcode + + Access: + @code{.cpp} + int N = parser.get("N"); + @endcode + + @param name name of the argument + @param space_delete remove spaces from the left and right of the string + @tparam T the argument will be converted to this type if possible + + @note You can access positional arguments by their `@`-prefixed name: + @code{.cpp} + parser.get("@image"); + @endcode + */ + template + T get(const String& name, bool space_delete = true) const + { + T val = T(); + getByName(name, space_delete, ParamType::type, (void*)&val); + return val; + } + + /** @brief Access positional arguments by index + + Returns argument converted to selected type. Indexes are counted from zero. + + For example, define: + @code{.cpp} + String keys = "{@arg1||}{@arg2||}" + @endcode + + Call: + @code{.sh} + ./my-app abc qwe + @endcode + + Access arguments: + @code{.cpp} + String val_1 = parser.get(0); // returns "abc", arg1 + String val_2 = parser.get(1); // returns "qwe", arg2 + @endcode + + @param index index of the argument + @param space_delete remove spaces from the left and right of the string + @tparam T the argument will be converted to this type if possible + */ + template + T get(int index, bool space_delete = true) const + { + T val = T(); + getByIndex(index, space_delete, ParamType::type, (void*)&val); + return val; + } + + /** @brief Check if field was provided in the command line + + @param name argument name to check + */ + bool has(const String& name) const; + + /** @brief Check for parsing errors + + Returns true if error occured while accessing the parameters (bad conversion, missing arguments, + etc.). Call @ref printErrors to print error messages list. + */ + bool check() const; + + /** @brief Set the about message + + The about message will be shown when @ref printMessage is called, right before arguments table. + */ + void about(const String& message); + + /** @brief Print help message + + This method will print standard help message containing the about message and arguments description. + + @sa about + */ + void printMessage() const; + + /** @brief Print list of errors occured + + @sa check + */ + void printErrors() const; + +protected: + void getByName(const String& name, bool space_delete, int type, void* dst) const; + void getByIndex(int index, bool space_delete, int type, void* dst) const; + + struct Impl; + Impl* impl; +}; + +//! @} core_utils + +//! @cond IGNORED + +/////////////////////////////// AutoBuffer implementation //////////////////////////////////////// + +template inline +AutoBuffer<_Tp, fixed_size>::AutoBuffer() +{ + ptr = buf; + sz = fixed_size; +} + +template inline +AutoBuffer<_Tp, fixed_size>::AutoBuffer(size_t _size) +{ + ptr = buf; + sz = fixed_size; + allocate(_size); +} + +template inline +AutoBuffer<_Tp, fixed_size>::AutoBuffer(const AutoBuffer<_Tp, fixed_size>& abuf ) +{ + ptr = buf; + sz = fixed_size; + allocate(abuf.size()); + for( size_t i = 0; i < sz; i++ ) + ptr[i] = abuf.ptr[i]; +} + +template inline AutoBuffer<_Tp, fixed_size>& +AutoBuffer<_Tp, fixed_size>::operator = (const AutoBuffer<_Tp, fixed_size>& abuf) +{ + if( this != &abuf ) + { + deallocate(); + allocate(abuf.size()); + for( size_t i = 0; i < sz; i++ ) + ptr[i] = abuf.ptr[i]; + } + return *this; +} + +template inline +AutoBuffer<_Tp, fixed_size>::~AutoBuffer() +{ deallocate(); } + +template inline void +AutoBuffer<_Tp, fixed_size>::allocate(size_t _size) +{ + if(_size <= sz) + { + sz = _size; + return; + } + deallocate(); + if(_size > fixed_size) + { + ptr = new _Tp[_size]; + sz = _size; + } +} + +template inline void +AutoBuffer<_Tp, fixed_size>::deallocate() +{ + if( ptr != buf ) + { + delete[] ptr; + ptr = buf; + sz = fixed_size; + } +} + +template inline void +AutoBuffer<_Tp, fixed_size>::resize(size_t _size) +{ + if(_size <= sz) + { + sz = _size; + return; + } + size_t i, prevsize = sz, minsize = MIN(prevsize, _size); + _Tp* prevptr = ptr; + + ptr = _size > fixed_size ? new _Tp[_size] : buf; + sz = _size; + + if( ptr != prevptr ) + for( i = 0; i < minsize; i++ ) + ptr[i] = prevptr[i]; + for( i = prevsize; i < _size; i++ ) + ptr[i] = _Tp(); + + if( prevptr != buf ) + delete[] prevptr; +} + +template inline size_t +AutoBuffer<_Tp, fixed_size>::size() const +{ return sz; } + +template inline +AutoBuffer<_Tp, fixed_size>::operator _Tp* () +{ return ptr; } + +template inline +AutoBuffer<_Tp, fixed_size>::operator const _Tp* () const +{ return ptr; } + +#ifndef OPENCV_NOSTL +template<> inline std::string CommandLineParser::get(int index, bool space_delete) const +{ + return get(index, space_delete); +} +template<> inline std::string CommandLineParser::get(const String& name, bool space_delete) const +{ + return get(name, space_delete); +} +#endif // OPENCV_NOSTL + +//! @endcond + +} //namespace cv + +#ifndef DISABLE_OPENCV_24_COMPATIBILITY +#include "opencv2/core/core_c.h" +#endif + +#endif //__OPENCV_CORE_UTILITY_H__ diff --git a/lib/opencv/include/opencv2/core/va_intel.hpp b/lib/opencv/include/opencv2/core/va_intel.hpp new file mode 100644 index 000000000..f4bb8a650 --- /dev/null +++ b/lib/opencv/include/opencv2/core/va_intel.hpp @@ -0,0 +1,77 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +// Copyright (C) 2015, Itseez, Inc., all rights reserved. +// Third party copyrights are property of their respective owners. + +#ifndef __OPENCV_CORE_VA_INTEL_HPP__ +#define __OPENCV_CORE_VA_INTEL_HPP__ + +#ifndef __cplusplus +# error va_intel.hpp header must be compiled as C++ +#endif + +#include "opencv2/core.hpp" +#include "ocl.hpp" + +#if defined(HAVE_VA) +# include "va/va.h" +#else // HAVE_VA +# if !defined(_VA_H_) + typedef void* VADisplay; + typedef unsigned int VASurfaceID; +# endif // !_VA_H_ +#endif // HAVE_VA + +namespace cv { namespace va_intel { + +/** @addtogroup core_va_intel +This section describes Intel VA-API/OpenCL (CL-VA) interoperability. + +To enable CL-VA interoperability support, configure OpenCV using CMake with WITH_VA_INTEL=ON . Currently VA-API is +supported on Linux only. You should also install Intel Media Server Studio (MSS) to use this feature. You may +have to specify the path(s) to MSS components for cmake in environment variables: VA_INTEL_MSDK_ROOT for Media SDK +(default is "/opt/intel/mediasdk"), and VA_INTEL_IOCL_ROOT for Intel OpenCL (default is "/opt/intel/opencl"). + +To use CL-VA interoperability you should first create VADisplay (libva), and then call initializeContextFromVA() +function to create OpenCL context and set up interoperability. +*/ +//! @{ + +/////////////////// CL-VA Interoperability Functions /////////////////// + +namespace ocl { +using namespace cv::ocl; + +// TODO static functions in the Context class +/** @brief Creates OpenCL context from VA. +@param display - VADisplay for which CL interop should be established. +@param tryInterop - try to set up for interoperability, if true; set up for use slow copy if false. +@return Returns reference to OpenCL Context + */ +CV_EXPORTS Context& initializeContextFromVA(VADisplay display, bool tryInterop = true); + +} // namespace cv::va_intel::ocl + +/** @brief Converts InputArray to VASurfaceID object. +@param display - VADisplay object. +@param src - source InputArray. +@param surface - destination VASurfaceID object. +@param size - size of image represented by VASurfaceID object. + */ +CV_EXPORTS void convertToVASurface(VADisplay display, InputArray src, VASurfaceID surface, Size size); + +/** @brief Converts VASurfaceID object to OutputArray. +@param display - VADisplay object. +@param surface - source VASurfaceID object. +@param size - size of image represented by VASurfaceID object. +@param dst - destination OutputArray. + */ +CV_EXPORTS void convertFromVASurface(VADisplay display, VASurfaceID surface, Size size, OutputArray dst); + +//! @} + +}} // namespace cv::va_intel + +#endif /* __OPENCV_CORE_VA_INTEL_HPP__ */ diff --git a/lib/opencv/include/opencv2/core/version.hpp b/lib/opencv/include/opencv2/core/version.hpp new file mode 100644 index 000000000..cf1442b5a --- /dev/null +++ b/lib/opencv/include/opencv2/core/version.hpp @@ -0,0 +1,71 @@ +/*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-2015, Intel Corporation, all rights reserved. +// Copyright (C) 2011-2013, NVIDIA Corporation, 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 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*/ + +/* + definition of the current version of OpenCV + Usefull to test in user programs +*/ + +#ifndef __OPENCV_VERSION_HPP__ +#define __OPENCV_VERSION_HPP__ + +#define CV_VERSION_MAJOR 3 +#define CV_VERSION_MINOR 1 +#define CV_VERSION_REVISION 0 +#define CV_VERSION_STATUS "" + +#define CVAUX_STR_EXP(__A) #__A +#define CVAUX_STR(__A) CVAUX_STR_EXP(__A) + +#define CVAUX_STRW_EXP(__A) L#__A +#define CVAUX_STRW(__A) CVAUX_STRW_EXP(__A) + +#define CV_VERSION CVAUX_STR(CV_VERSION_MAJOR) "." CVAUX_STR(CV_VERSION_MINOR) "." CVAUX_STR(CV_VERSION_REVISION) CV_VERSION_STATUS + +/* old style version constants*/ +#define CV_MAJOR_VERSION CV_VERSION_MAJOR +#define CV_MINOR_VERSION CV_VERSION_MINOR +#define CV_SUBMINOR_VERSION CV_VERSION_REVISION + +#endif diff --git a/lib/opencv/include/opencv2/core/wimage.hpp b/lib/opencv/include/opencv2/core/wimage.hpp new file mode 100644 index 000000000..ef9d39833 --- /dev/null +++ b/lib/opencv/include/opencv2/core/wimage.hpp @@ -0,0 +1,603 @@ +/*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 class WImage; +template class WImageBuffer; +template class WImageView; + +template class WImageC; +template class WImageBufferC; +template class WImageViewC; + +// Commonly used typedefs. +typedef WImage WImage_b; +typedef WImageView WImageView_b; +typedef WImageBuffer WImageBuffer_b; + +typedef WImageC WImage1_b; +typedef WImageViewC WImageView1_b; +typedef WImageBufferC WImageBuffer1_b; + +typedef WImageC WImage3_b; +typedef WImageViewC WImageView3_b; +typedef WImageBufferC WImageBuffer3_b; + +typedef WImage WImage_f; +typedef WImageView WImageView_f; +typedef WImageBuffer WImageBuffer_f; + +typedef WImageC WImage1_f; +typedef WImageViewC WImageView1_f; +typedef WImageBufferC WImageBuffer1_f; + +typedef WImageC WImage3_f; +typedef WImageViewC WImageView3_f; +typedef WImageBufferC WImageBuffer3_f; + +// There isn't a standard for signed and unsigned short so be more +// explicit in the typename for these cases. +typedef WImage WImage_16s; +typedef WImageView WImageView_16s; +typedef WImageBuffer WImageBuffer_16s; + +typedef WImageC WImage1_16s; +typedef WImageViewC WImageView1_16s; +typedef WImageBufferC WImageBuffer1_16s; + +typedef WImageC WImage3_16s; +typedef WImageViewC WImageView3_16s; +typedef WImageBufferC WImageBuffer3_16s; + +typedef WImage WImage_16u; +typedef WImageView WImageView_16u; +typedef WImageBuffer WImageBuffer_16u; + +typedef WImageC WImage1_16u; +typedef WImageViewC WImageView1_16u; +typedef WImageBufferC WImageBuffer1_16u; + +typedef WImageC WImage3_16u; +typedef WImageViewC WImageView3_16u; +typedef WImageBufferC 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 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 +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(image_->imageData); } + const T* ImageData() const { + return reinterpret_cast(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(image_->imageData + r*image_->widthStep); + } + + inline T* Row(int r) { + return reinterpret_cast(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(image_->imageData + r*image_->widthStep) + + c*Channels(); + } + + inline const T* operator() (int c, int r) const { + return reinterpret_cast(image_->imageData + r*image_->widthStep) + + c*Channels(); + } + + // Copy the contents from another image which is just a convenience to cvCopy + void CopyFrom(const WImage& 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 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 +class WImageC : public WImage +{ +public: + typedef typename WImage::BaseType BaseType; + enum { kChannels = C }; + + explicit WImageC(IplImage* img) : WImage(img) { + assert(!img || img->nChannels == Channels()); + } + + // Construct a view into a region of this image + WImageViewC 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& src) { + cvCopy(src.Ipl(), WImage::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::Depth()); + WImage::SetIpl(image); + } +}; + +/** Image class which owns the data, so it can be allocated and is always +freed. It cannot be copied but can be explicity cloned. +*/ +template +class WImageBuffer : public WImage +{ +public: + typedef typename WImage::BaseType BaseType; + + // Default constructor which creates an object that can be + WImageBuffer() : WImage(0) {} + + WImageBuffer(int width, int height, int nchannels) : WImage(0) { + Allocate(width, height, nchannels); + } + + // Constructor which takes ownership of a given IplImage so releases + // the image on destruction. + explicit WImageBuffer(IplImage* img) : WImage(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::SetIpl(img); + } + + // Clone an image which reallocates the image if of a different dimension. + void CloneFrom(const WImage& src) { + Allocate(src.Width(), src.Height(), src.Channels()); + CopyFrom(src); + } + + ~WImageBuffer() { + ReleaseImage(); + } + + // Release the image if it isn't null. + void ReleaseImage() { + if (WImage::image_) { + IplImage* image = WImage::image_; + cvReleaseImage(&image); + WImage::SetIpl(0); + } + } + + bool IsNull() const {return WImage::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 +class WImageBufferC : public WImageC +{ +public: + typedef typename WImage::BaseType BaseType; + enum { kChannels = C }; + + // Default constructor which creates an object that can be + WImageBufferC() : WImageC(0) {} + + WImageBufferC(int width, int height) : WImageC(0) { + Allocate(width, height); + } + + // Constructor which takes ownership of a given IplImage so releases + // the image on destruction. + explicit WImageBufferC(IplImage* img) : WImageC(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::SetIpl(img); + } + + // Clone an image which reallocates the image if of a different dimension. + void CloneFrom(const WImageC& src) { + Allocate(src.Width(), src.Height()); + CopyFrom(src); + } + + ~WImageBufferC() { + ReleaseImage(); + } + + // Release the image if it isn't null. + void ReleaseImage() { + if (WImage::image_) { + IplImage* image = WImage::image_; + cvReleaseImage(&image); + WImageC::SetIpl(0); + } + } + + bool IsNull() const {return WImage::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 class WImageView : public WImage +{ +public: + typedef typename WImage::BaseType BaseType; + + // Construct a subimage. No checks are done that the subimage lies + // completely inside the original image. + WImageView(WImage* 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(img) {} + + // Copy constructor + WImageView(const WImage& img) : WImage(0) { + header_ = *(img.Ipl()); + WImage::SetIpl(&header_); + } + + WImageView& operator=(const WImage& img) { + header_ = *(img.Ipl()); + WImage::SetIpl(&header_); + return *this; + } + +protected: + IplImage header_; +}; + + +template +class WImageViewC : public WImageC +{ +public: + typedef typename WImage::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* 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(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& img) : WImageC(0) { + header_ = *(img.Ipl()); + WImageC::SetIpl(&header_); + } + WImageViewC(const WImageViewC& img) : WImageC(0) { + header_ = *(img.Ipl()); + WImageC::SetIpl(&header_); + } + + WImageViewC& operator=(const WImageC& img) { + header_ = *(img.Ipl()); + WImageC::SetIpl(&header_); + return *this; + } + WImageViewC& operator=(const WImageViewC& img) { + header_ = *(img.Ipl()); + WImageC::SetIpl(&header_); + return *this; + } + +protected: + IplImage header_; +}; + + +// Specializations for depth +template<> +inline int WImage::Depth() const {return IPL_DEPTH_8U; } +template<> +inline int WImage::Depth() const {return IPL_DEPTH_8S; } +template<> +inline int WImage::Depth() const {return IPL_DEPTH_16S; } +template<> +inline int WImage::Depth() const {return IPL_DEPTH_16U; } +template<> +inline int WImage::Depth() const {return IPL_DEPTH_32S; } +template<> +inline int WImage::Depth() const {return IPL_DEPTH_32F; } +template<> +inline int WImage::Depth() const {return IPL_DEPTH_64F; } + +template inline WImage::~WImage() {} +template inline WImageC::~WImageC() {} + +template +inline void WImageBuffer::Allocate(int width, int height, int nchannels) +{ + if (IsNull() || WImage::Width() != width || + WImage::Height() != height || WImage::Channels() != nchannels) { + ReleaseImage(); + WImage::image_ = cvCreateImage(cvSize(width, height), + WImage::Depth(), nchannels); + } +} + +template +inline void WImageBufferC::Allocate(int width, int height) +{ + if (IsNull() || WImage::Width() != width || WImage::Height() != height) { + ReleaseImage(); + WImageC::SetIpl(cvCreateImage(cvSize(width, height),WImage::Depth(), C)); + } +} + +template +WImageView::WImageView(WImage* img, int c, int r, int width, int height) + : WImage(0) +{ + header_ = *(img->Ipl()); + header_.imageData = reinterpret_cast((*img)(c, r)); + header_.width = width; + header_.height = height; + WImage::SetIpl(&header_); +} + +template +WImageView::WImageView(T* data, int width, int height, int nchannels, int width_step) + : WImage(0) +{ + cvInitImageHeader(&header_, cvSize(width, height), WImage::Depth(), nchannels); + header_.imageData = reinterpret_cast(data); + if (width_step > 0) { + header_.widthStep = width_step; + } + WImage::SetIpl(&header_); +} + +template +WImageViewC::WImageViewC(WImageC* img, int c, int r, int width, int height) + : WImageC(0) +{ + header_ = *(img->Ipl()); + header_.imageData = reinterpret_cast((*img)(c, r)); + header_.width = width; + header_.height = height; + WImageC::SetIpl(&header_); +} + +template +WImageViewC::WImageViewC() : WImageC(0) { + cvInitImageHeader(&header_, cvSize(0, 0), WImage::Depth(), C); + header_.imageData = reinterpret_cast(0); + WImageC::SetIpl(&header_); +} + +template +WImageViewC::WImageViewC(T* data, int width, int height, int width_step) + : WImageC(0) +{ + cvInitImageHeader(&header_, cvSize(width, height), WImage::Depth(), C); + header_.imageData = reinterpret_cast(data); + if (width_step > 0) { + header_.widthStep = width_step; + } + WImageC::SetIpl(&header_); +} + +// Construct a view into a region of an image +template +WImageView WImage::View(int c, int r, int width, int height) { + return WImageView(this, c, r, width, height); +} + +template +WImageViewC WImageC::View(int c, int r, int width, int height) { + return WImageViewC(this, c, r, width, height); +} + +//! @} core + +} // end of namespace + +#endif // __cplusplus + +#endif diff --git a/lib/opencv/include/opencv2/cvconfig.h b/lib/opencv/include/opencv2/cvconfig.h new file mode 100644 index 000000000..da75317de --- /dev/null +++ b/lib/opencv/include/opencv2/cvconfig.h @@ -0,0 +1,196 @@ +/* OpenCV compiled as static or dynamic libs */ +#define BUILD_SHARED_LIBS + +/* Compile for 'real' NVIDIA GPU architectures */ +#define CUDA_ARCH_BIN "" + +/* Create PTX or BIN for 1.0 compute capability */ +/* #undef CUDA_ARCH_BIN_OR_PTX_10 */ + +/* NVIDIA GPU features are used */ +#define CUDA_ARCH_FEATURES "" + +/* Compile for 'virtual' NVIDIA PTX architectures */ +#define CUDA_ARCH_PTX "" + +/* AVFoundation video libraries */ +/* #undef HAVE_AVFOUNDATION */ + +/* V4L capturing support */ +/* #undef HAVE_CAMV4L */ + +/* V4L2 capturing support */ +/* #undef HAVE_CAMV4L2 */ + +/* Carbon windowing environment */ +/* #undef HAVE_CARBON */ + +/* AMD's Basic Linear Algebra Subprograms Library*/ +#define HAVE_CLAMDBLAS + +/* AMD's OpenCL Fast Fourier Transform Library*/ +#define HAVE_CLAMDFFT + +/* Clp support */ +/* #undef HAVE_CLP */ + +/* Cocoa API */ +/* #undef HAVE_COCOA */ + +/* C= */ +/* #undef HAVE_CSTRIPES */ + +/* NVidia Cuda Basic Linear Algebra Subprograms (BLAS) API*/ +/* #undef HAVE_CUBLAS */ + +/* NVidia Cuda Runtime API*/ +/* #undef HAVE_CUDA */ + +/* NVidia Cuda Fast Fourier Transform (FFT) API*/ +/* #undef HAVE_CUFFT */ + +/* IEEE1394 capturing support */ +/* #undef HAVE_DC1394 */ + +/* IEEE1394 capturing support - libdc1394 v2.x */ +/* #undef HAVE_DC1394_2 */ + +/* DirectX */ +#define HAVE_DIRECTX +#define HAVE_DIRECTX_NV12 +#define HAVE_D3D11 +#define HAVE_D3D10 +#define HAVE_D3D9 + +/* DirectShow Video Capture library */ +#define HAVE_DSHOW + +/* Eigen Matrix & Linear Algebra Library */ +/* #undef HAVE_EIGEN */ + +/* FFMpeg video library */ +#define HAVE_FFMPEG + +/* ffmpeg's libswscale */ +#define HAVE_FFMPEG_SWSCALE + +/* ffmpeg in Gentoo */ +#define HAVE_GENTOO_FFMPEG + +/* Geospatial Data Abstraction Library */ +/* #undef HAVE_GDAL */ + +/* GStreamer multimedia framework */ +/* #undef HAVE_GSTREAMER */ + +/* GTK+ 2.0 Thread support */ +/* #undef HAVE_GTHREAD */ + +/* GTK+ 2.x toolkit */ +/* #undef HAVE_GTK */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* Intel Perceptual Computing SDK library */ +/* #undef HAVE_INTELPERC */ + +/* Intel Integrated Performance Primitives */ +#define HAVE_IPP +#define HAVE_IPP_ICV_ONLY + +/* Intel IPP Async */ +/* #undef HAVE_IPP_A */ + +/* JPEG-2000 codec */ +#define HAVE_JASPER + +/* IJG JPEG codec */ +#define HAVE_JPEG + +/* libpng/png.h needs to be included */ +/* #undef HAVE_LIBPNG_PNG_H */ + +/* V4L/V4L2 capturing support via libv4l */ +/* #undef HAVE_LIBV4L */ + +/* Microsoft Media Foundation Capture library */ +/* #undef HAVE_MSMF */ + +/* NVidia Video Decoding API*/ +/* #undef HAVE_NVCUVID */ + +/* OpenCL Support */ +#define HAVE_OPENCL +/* #undef HAVE_OPENCL_STATIC */ +/* #undef HAVE_OPENCL_SVM */ + +/* OpenEXR codec */ +#define HAVE_OPENEXR + +/* OpenGL support*/ +/* #undef HAVE_OPENGL */ + +/* OpenNI library */ +/* #undef HAVE_OPENNI */ + +/* OpenNI library */ +/* #undef HAVE_OPENNI2 */ + +/* PNG codec */ +#define HAVE_PNG + +/* Posix threads (pthreads) */ +/* #undef HAVE_PTHREADS */ + +/* parallel_for with pthreads */ +/* #undef HAVE_PTHREADS_PF */ + +/* Qt support */ +/* #undef HAVE_QT */ + +/* Qt OpenGL support */ +/* #undef HAVE_QT_OPENGL */ + +/* QuickTime video libraries */ +/* #undef HAVE_QUICKTIME */ + +/* QTKit video libraries */ +/* #undef HAVE_QTKIT */ + +/* Intel Threading Building Blocks */ +/* #undef HAVE_TBB */ + +/* TIFF codec */ +#define HAVE_TIFF + +/* Unicap video capture library */ +/* #undef HAVE_UNICAP */ + +/* Video for Windows support */ +#define HAVE_VFW + +/* V4L2 capturing support in videoio.h */ +/* #undef HAVE_VIDEOIO */ + +/* Win32 UI */ +#define HAVE_WIN32UI + +/* XIMEA camera support */ +/* #undef HAVE_XIMEA */ + +/* Xine video library */ +/* #undef HAVE_XINE */ + +/* Define if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef WORDS_BIGENDIAN */ + +/* gPhoto2 library */ +/* #undef HAVE_GPHOTO2 */ + +/* VA library (libva) */ +/* #undef HAVE_VA */ + +/* Intel VA-API/OpenCL */ +/* #undef HAVE_VA_INTEL */ diff --git a/lib/opencv/include/opencv2/features2d.hpp b/lib/opencv/include/opencv2/features2d.hpp new file mode 100644 index 000000000..692d3d9fd --- /dev/null +++ b/lib/opencv/include/opencv2/features2d.hpp @@ -0,0 +1,1325 @@ +/*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_FEATURES_2D_HPP__ +#define __OPENCV_FEATURES_2D_HPP__ + +#include "opencv2/core.hpp" +#include "opencv2/flann/miniflann.hpp" + +/** + @defgroup features2d 2D Features Framework + @{ + @defgroup features2d_main Feature Detection and Description + @defgroup features2d_match Descriptor Matchers + +Matchers of keypoint descriptors in OpenCV have wrappers with a common interface that enables you to +easily switch between different algorithms solving the same problem. This section is devoted to +matching descriptors that are represented as vectors in a multidimensional space. All objects that +implement vector descriptor matchers inherit the DescriptorMatcher interface. + +@note + - An example explaining keypoint matching can be found at + opencv_source_code/samples/cpp/descriptor_extractor_matcher.cpp + - An example on descriptor matching evaluation can be found at + opencv_source_code/samples/cpp/detector_descriptor_matcher_evaluation.cpp + - An example on one to many image matching can be found at + opencv_source_code/samples/cpp/matching_to_many_images.cpp + + @defgroup features2d_draw Drawing Function of Keypoints and Matches + @defgroup features2d_category Object Categorization + +This section describes approaches based on local 2D features and used to categorize objects. + +@note + - A complete Bag-Of-Words sample can be found at + opencv_source_code/samples/cpp/bagofwords_classification.cpp + - (Python) An example using the features2D framework to perform object categorization can be + found at opencv_source_code/samples/python/find_obj.py + + @} + */ + +namespace cv +{ + +//! @addtogroup features2d +//! @{ + +// //! writes vector of keypoints to the file storage +// CV_EXPORTS void write(FileStorage& fs, const String& name, const std::vector& keypoints); +// //! reads vector of keypoints from the specified file storage node +// CV_EXPORTS void read(const FileNode& node, CV_OUT std::vector& keypoints); + +/** @brief A class filters a vector of keypoints. + + Because now it is difficult to provide a convenient interface for all usage scenarios of the + keypoints filter class, it has only several needed by now static methods. + */ +class CV_EXPORTS KeyPointsFilter +{ +public: + KeyPointsFilter(){} + + /* + * Remove keypoints within borderPixels of an image edge. + */ + static void runByImageBorder( std::vector& keypoints, Size imageSize, int borderSize ); + /* + * Remove keypoints of sizes out of range. + */ + static void runByKeypointSize( std::vector& keypoints, float minSize, + float maxSize=FLT_MAX ); + /* + * Remove keypoints from some image by mask for pixels of this image. + */ + static void runByPixelsMask( std::vector& keypoints, const Mat& mask ); + /* + * Remove duplicated keypoints. + */ + static void removeDuplicated( std::vector& keypoints ); + + /* + * Retain the specified number of the best keypoints (according to the response) + */ + static void retainBest( std::vector& keypoints, int npoints ); +}; + + +/************************************ Base Classes ************************************/ + +/** @brief Abstract base class for 2D image feature detectors and descriptor extractors +*/ +class CV_EXPORTS_W Feature2D : public virtual Algorithm +{ +public: + virtual ~Feature2D(); + + /** @brief Detects keypoints in an image (first variant) or image set (second variant). + + @param image Image. + @param keypoints The detected keypoints. In the second variant of the method keypoints[i] is a set + of keypoints detected in images[i] . + @param mask Mask specifying where to look for keypoints (optional). It must be a 8-bit integer + matrix with non-zero values in the region of interest. + */ + CV_WRAP virtual void detect( InputArray image, + CV_OUT std::vector& keypoints, + InputArray mask=noArray() ); + + /** @overload + @param images Image set. + @param keypoints The detected keypoints. In the second variant of the method keypoints[i] is a set + of keypoints detected in images[i] . + @param masks Masks for each input image specifying where to look for keypoints (optional). + masks[i] is a mask for images[i]. + */ + virtual void detect( InputArrayOfArrays images, + std::vector >& keypoints, + InputArrayOfArrays masks=noArray() ); + + /** @brief Computes the descriptors for a set of keypoints detected in an image (first variant) or image set + (second variant). + + @param image Image. + @param keypoints Input collection of keypoints. Keypoints for which a descriptor cannot be + computed are removed. Sometimes new keypoints can be added, for example: SIFT duplicates keypoint + with several dominant orientations (for each orientation). + @param descriptors Computed descriptors. In the second variant of the method descriptors[i] are + descriptors computed for a keypoints[i]. Row j is the keypoints (or keypoints[i]) is the + descriptor for keypoint j-th keypoint. + */ + CV_WRAP virtual void compute( InputArray image, + CV_OUT CV_IN_OUT std::vector& keypoints, + OutputArray descriptors ); + + /** @overload + + @param images Image set. + @param keypoints Input collection of keypoints. Keypoints for which a descriptor cannot be + computed are removed. Sometimes new keypoints can be added, for example: SIFT duplicates keypoint + with several dominant orientations (for each orientation). + @param descriptors Computed descriptors. In the second variant of the method descriptors[i] are + descriptors computed for a keypoints[i]. Row j is the keypoints (or keypoints[i]) is the + descriptor for keypoint j-th keypoint. + */ + virtual void compute( InputArrayOfArrays images, + std::vector >& keypoints, + OutputArrayOfArrays descriptors ); + + /** Detects keypoints and computes the descriptors */ + CV_WRAP virtual void detectAndCompute( InputArray image, InputArray mask, + CV_OUT std::vector& keypoints, + OutputArray descriptors, + bool useProvidedKeypoints=false ); + + CV_WRAP virtual int descriptorSize() const; + CV_WRAP virtual int descriptorType() const; + CV_WRAP virtual int defaultNorm() const; + + //! Return true if detector object is empty + CV_WRAP virtual bool empty() const; +}; + +/** Feature detectors in OpenCV have wrappers with a common interface that enables you to easily switch +between different algorithms solving the same problem. All objects that implement keypoint detectors +inherit the FeatureDetector interface. */ +typedef Feature2D FeatureDetector; + +/** Extractors of keypoint descriptors in OpenCV have wrappers with a common interface that enables you +to easily switch between different algorithms solving the same problem. This section is devoted to +computing descriptors represented as vectors in a multidimensional space. All objects that implement +the vector descriptor extractors inherit the DescriptorExtractor interface. + */ +typedef Feature2D DescriptorExtractor; + +//! @addtogroup features2d_main +//! @{ + +/** @brief Class implementing the BRISK keypoint detector and descriptor extractor, described in @cite LCS11 . + */ +class CV_EXPORTS_W BRISK : public Feature2D +{ +public: + /** @brief The BRISK constructor + + @param thresh AGAST detection threshold score. + @param octaves detection octaves. Use 0 to do single scale. + @param patternScale apply this scale to the pattern used for sampling the neighbourhood of a + keypoint. + */ + CV_WRAP static Ptr create(int thresh=30, int octaves=3, float patternScale=1.0f); + + /** @brief The BRISK constructor for a custom pattern + + @param radiusList defines the radii (in pixels) where the samples around a keypoint are taken (for + keypoint scale 1). + @param numberList defines the number of sampling points on the sampling circle. Must be the same + size as radiusList.. + @param dMax threshold for the short pairings used for descriptor formation (in pixels for keypoint + scale 1). + @param dMin threshold for the long pairings used for orientation determination (in pixels for + keypoint scale 1). + @param indexChange index remapping of the bits. */ + CV_WRAP static Ptr create(const std::vector &radiusList, const std::vector &numberList, + float dMax=5.85f, float dMin=8.2f, const std::vector& indexChange=std::vector()); +}; + +/** @brief Class implementing the ORB (*oriented BRIEF*) keypoint detector and descriptor extractor + +described in @cite RRKB11 . The algorithm uses FAST in pyramids to detect stable keypoints, selects +the strongest features using FAST or Harris response, finds their orientation using first-order +moments and computes the descriptors using BRIEF (where the coordinates of random point pairs (or +k-tuples) are rotated according to the measured orientation). + */ +class CV_EXPORTS_W ORB : public Feature2D +{ +public: + enum { kBytes = 32, HARRIS_SCORE=0, FAST_SCORE=1 }; + + /** @brief The ORB constructor + + @param nfeatures The maximum number of features to retain. + @param scaleFactor Pyramid decimation ratio, greater than 1. scaleFactor==2 means the classical + pyramid, where each next level has 4x less pixels than the previous, but such a big scale factor + will degrade feature matching scores dramatically. On the other hand, too close to 1 scale factor + will mean that to cover certain scale range you will need more pyramid levels and so the speed + will suffer. + @param nlevels The number of pyramid levels. The smallest level will have linear size equal to + input_image_linear_size/pow(scaleFactor, nlevels). + @param edgeThreshold This is size of the border where the features are not detected. It should + roughly match the patchSize parameter. + @param firstLevel It should be 0 in the current implementation. + @param WTA_K The number of points that produce each element of the oriented BRIEF descriptor. The + default value 2 means the BRIEF where we take a random point pair and compare their brightnesses, + so we get 0/1 response. Other possible values are 3 and 4. For example, 3 means that we take 3 + random points (of course, those point coordinates are random, but they are generated from the + pre-defined seed, so each element of BRIEF descriptor is computed deterministically from the pixel + rectangle), find point of maximum brightness and output index of the winner (0, 1 or 2). Such + output will occupy 2 bits, and therefore it will need a special variant of Hamming distance, + denoted as NORM_HAMMING2 (2 bits per bin). When WTA_K=4, we take 4 random points to compute each + bin (that will also occupy 2 bits with possible values 0, 1, 2 or 3). + @param scoreType The default HARRIS_SCORE means that Harris algorithm is used to rank features + (the score is written to KeyPoint::score and is used to retain best nfeatures features); + FAST_SCORE is alternative value of the parameter that produces slightly less stable keypoints, + but it is a little faster to compute. + @param patchSize size of the patch used by the oriented BRIEF descriptor. Of course, on smaller + pyramid layers the perceived image area covered by a feature will be larger. + @param fastThreshold + */ + CV_WRAP static Ptr create(int nfeatures=500, float scaleFactor=1.2f, int nlevels=8, int edgeThreshold=31, + int firstLevel=0, int WTA_K=2, int scoreType=ORB::HARRIS_SCORE, int patchSize=31, int fastThreshold=20); + + CV_WRAP virtual void setMaxFeatures(int maxFeatures) = 0; + CV_WRAP virtual int getMaxFeatures() const = 0; + + CV_WRAP virtual void setScaleFactor(double scaleFactor) = 0; + CV_WRAP virtual double getScaleFactor() const = 0; + + CV_WRAP virtual void setNLevels(int nlevels) = 0; + CV_WRAP virtual int getNLevels() const = 0; + + CV_WRAP virtual void setEdgeThreshold(int edgeThreshold) = 0; + CV_WRAP virtual int getEdgeThreshold() const = 0; + + CV_WRAP virtual void setFirstLevel(int firstLevel) = 0; + CV_WRAP virtual int getFirstLevel() const = 0; + + CV_WRAP virtual void setWTA_K(int wta_k) = 0; + CV_WRAP virtual int getWTA_K() const = 0; + + CV_WRAP virtual void setScoreType(int scoreType) = 0; + CV_WRAP virtual int getScoreType() const = 0; + + CV_WRAP virtual void setPatchSize(int patchSize) = 0; + CV_WRAP virtual int getPatchSize() const = 0; + + CV_WRAP virtual void setFastThreshold(int fastThreshold) = 0; + CV_WRAP virtual int getFastThreshold() const = 0; +}; + +/** @brief Maximally stable extremal region extractor + +The class encapsulates all the parameters of the %MSER extraction algorithm (see [wiki +article](http://en.wikipedia.org/wiki/Maximally_stable_extremal_regions)). + +- there are two different implementation of %MSER: one for grey image, one for color image + +- the grey image algorithm is taken from: @cite nister2008linear ; the paper claims to be faster +than union-find method; it actually get 1.5~2m/s on my centrino L7200 1.2GHz laptop. + +- the color image algorithm is taken from: @cite forssen2007maximally ; it should be much slower +than grey image method ( 3~4 times ); the chi_table.h file is taken directly from paper's source +code which is distributed under GPL. + +- (Python) A complete example showing the use of the %MSER detector can be found at samples/python/mser.py +*/ +class CV_EXPORTS_W MSER : public Feature2D +{ +public: + /** @brief Full consturctor for %MSER detector + + @param _delta it compares \f$(size_{i}-size_{i-delta})/size_{i-delta}\f$ + @param _min_area prune the area which smaller than minArea + @param _max_area prune the area which bigger than maxArea + @param _max_variation prune the area have simliar size to its children + @param _min_diversity for color image, trace back to cut off mser with diversity less than min_diversity + @param _max_evolution for color image, the evolution steps + @param _area_threshold for color image, the area threshold to cause re-initialize + @param _min_margin for color image, ignore too small margin + @param _edge_blur_size for color image, the aperture size for edge blur + */ + CV_WRAP static Ptr create( int _delta=5, int _min_area=60, int _max_area=14400, + double _max_variation=0.25, double _min_diversity=.2, + int _max_evolution=200, double _area_threshold=1.01, + double _min_margin=0.003, int _edge_blur_size=5 ); + + /** @brief Detect %MSER regions + + @param image input image (8UC1, 8UC3 or 8UC4) + @param msers resulting list of point sets + @param bboxes resulting bounding boxes + */ + CV_WRAP virtual void detectRegions( InputArray image, + CV_OUT std::vector >& msers, + std::vector& bboxes ) = 0; + + CV_WRAP virtual void setDelta(int delta) = 0; + CV_WRAP virtual int getDelta() const = 0; + + CV_WRAP virtual void setMinArea(int minArea) = 0; + CV_WRAP virtual int getMinArea() const = 0; + + CV_WRAP virtual void setMaxArea(int maxArea) = 0; + CV_WRAP virtual int getMaxArea() const = 0; + + CV_WRAP virtual void setPass2Only(bool f) = 0; + CV_WRAP virtual bool getPass2Only() const = 0; +}; + +/** @overload */ +CV_EXPORTS void FAST( InputArray image, CV_OUT std::vector& keypoints, + int threshold, bool nonmaxSuppression=true ); + +/** @brief Detects corners using the FAST algorithm + +@param image grayscale image where keypoints (corners) are detected. +@param keypoints keypoints detected on the image. +@param threshold threshold on difference between intensity of the central pixel and pixels of a +circle around this pixel. +@param nonmaxSuppression if true, non-maximum suppression is applied to detected corners +(keypoints). +@param type one of the three neighborhoods as defined in the paper: +FastFeatureDetector::TYPE_9_16, FastFeatureDetector::TYPE_7_12, +FastFeatureDetector::TYPE_5_8 + +Detects corners using the FAST algorithm by @cite Rosten06 . + +@note In Python API, types are given as cv2.FAST_FEATURE_DETECTOR_TYPE_5_8, +cv2.FAST_FEATURE_DETECTOR_TYPE_7_12 and cv2.FAST_FEATURE_DETECTOR_TYPE_9_16. For corner +detection, use cv2.FAST.detect() method. + */ +CV_EXPORTS void FAST( InputArray image, CV_OUT std::vector& keypoints, + int threshold, bool nonmaxSuppression, int type ); + +//! @} features2d_main + +//! @addtogroup features2d_main +//! @{ + +/** @brief Wrapping class for feature detection using the FAST method. : + */ +class CV_EXPORTS_W FastFeatureDetector : public Feature2D +{ +public: + enum + { + TYPE_5_8 = 0, TYPE_7_12 = 1, TYPE_9_16 = 2, + THRESHOLD = 10000, NONMAX_SUPPRESSION=10001, FAST_N=10002, + }; + + CV_WRAP static Ptr create( int threshold=10, + bool nonmaxSuppression=true, + int type=FastFeatureDetector::TYPE_9_16 ); + + CV_WRAP virtual void setThreshold(int threshold) = 0; + CV_WRAP virtual int getThreshold() const = 0; + + CV_WRAP virtual void setNonmaxSuppression(bool f) = 0; + CV_WRAP virtual bool getNonmaxSuppression() const = 0; + + CV_WRAP virtual void setType(int type) = 0; + CV_WRAP virtual int getType() const = 0; +}; + +/** @overload */ +CV_EXPORTS void AGAST( InputArray image, CV_OUT std::vector& keypoints, + int threshold, bool nonmaxSuppression=true ); + +/** @brief Detects corners using the AGAST algorithm + +@param image grayscale image where keypoints (corners) are detected. +@param keypoints keypoints detected on the image. +@param threshold threshold on difference between intensity of the central pixel and pixels of a +circle around this pixel. +@param nonmaxSuppression if true, non-maximum suppression is applied to detected corners +(keypoints). +@param type one of the four neighborhoods as defined in the paper: +AgastFeatureDetector::AGAST_5_8, AgastFeatureDetector::AGAST_7_12d, +AgastFeatureDetector::AGAST_7_12s, AgastFeatureDetector::OAST_9_16 + +For non-Intel platforms, there is a tree optimised variant of AGAST with same numerical results. +The 32-bit binary tree tables were generated automatically from original code using perl script. +The perl script and examples of tree generation are placed in features2d/doc folder. +Detects corners using the AGAST algorithm by @cite mair2010_agast . + + */ +CV_EXPORTS void AGAST( InputArray image, CV_OUT std::vector& keypoints, + int threshold, bool nonmaxSuppression, int type ); +//! @} features2d_main + +//! @addtogroup features2d_main +//! @{ + +/** @brief Wrapping class for feature detection using the AGAST method. : + */ +class CV_EXPORTS_W AgastFeatureDetector : public Feature2D +{ +public: + enum + { + AGAST_5_8 = 0, AGAST_7_12d = 1, AGAST_7_12s = 2, OAST_9_16 = 3, + THRESHOLD = 10000, NONMAX_SUPPRESSION = 10001, + }; + + CV_WRAP static Ptr create( int threshold=10, + bool nonmaxSuppression=true, + int type=AgastFeatureDetector::OAST_9_16 ); + + CV_WRAP virtual void setThreshold(int threshold) = 0; + CV_WRAP virtual int getThreshold() const = 0; + + CV_WRAP virtual void setNonmaxSuppression(bool f) = 0; + CV_WRAP virtual bool getNonmaxSuppression() const = 0; + + CV_WRAP virtual void setType(int type) = 0; + CV_WRAP virtual int getType() const = 0; +}; + +/** @brief Wrapping class for feature detection using the goodFeaturesToTrack function. : + */ +class CV_EXPORTS_W GFTTDetector : public Feature2D +{ +public: + CV_WRAP static Ptr create( int maxCorners=1000, double qualityLevel=0.01, double minDistance=1, + int blockSize=3, bool useHarrisDetector=false, double k=0.04 ); + CV_WRAP virtual void setMaxFeatures(int maxFeatures) = 0; + CV_WRAP virtual int getMaxFeatures() const = 0; + + CV_WRAP virtual void setQualityLevel(double qlevel) = 0; + CV_WRAP virtual double getQualityLevel() const = 0; + + CV_WRAP virtual void setMinDistance(double minDistance) = 0; + CV_WRAP virtual double getMinDistance() const = 0; + + CV_WRAP virtual void setBlockSize(int blockSize) = 0; + CV_WRAP virtual int getBlockSize() const = 0; + + CV_WRAP virtual void setHarrisDetector(bool val) = 0; + CV_WRAP virtual bool getHarrisDetector() const = 0; + + CV_WRAP virtual void setK(double k) = 0; + CV_WRAP virtual double getK() const = 0; +}; + +/** @brief Class for extracting blobs from an image. : + +The class implements a simple algorithm for extracting blobs from an image: + +1. Convert the source image to binary images by applying thresholding with several thresholds from + minThreshold (inclusive) to maxThreshold (exclusive) with distance thresholdStep between + neighboring thresholds. +2. Extract connected components from every binary image by findContours and calculate their + centers. +3. Group centers from several binary images by their coordinates. Close centers form one group that + corresponds to one blob, which is controlled by the minDistBetweenBlobs parameter. +4. From the groups, estimate final centers of blobs and their radiuses and return as locations and + sizes of keypoints. + +This class performs several filtrations of returned blobs. You should set filterBy\* to true/false +to turn on/off corresponding filtration. Available filtrations: + +- **By color**. This filter compares the intensity of a binary image at the center of a blob to +blobColor. If they differ, the blob is filtered out. Use blobColor = 0 to extract dark blobs +and blobColor = 255 to extract light blobs. +- **By area**. Extracted blobs have an area between minArea (inclusive) and maxArea (exclusive). +- **By circularity**. Extracted blobs have circularity +(\f$\frac{4*\pi*Area}{perimeter * perimeter}\f$) between minCircularity (inclusive) and +maxCircularity (exclusive). +- **By ratio of the minimum inertia to maximum inertia**. Extracted blobs have this ratio +between minInertiaRatio (inclusive) and maxInertiaRatio (exclusive). +- **By convexity**. Extracted blobs have convexity (area / area of blob convex hull) between +minConvexity (inclusive) and maxConvexity (exclusive). + +Default values of parameters are tuned to extract dark circular blobs. + */ +class CV_EXPORTS_W SimpleBlobDetector : public Feature2D +{ +public: + struct CV_EXPORTS_W_SIMPLE Params + { + CV_WRAP Params(); + CV_PROP_RW float thresholdStep; + CV_PROP_RW float minThreshold; + CV_PROP_RW float maxThreshold; + CV_PROP_RW size_t minRepeatability; + CV_PROP_RW float minDistBetweenBlobs; + + CV_PROP_RW bool filterByColor; + CV_PROP_RW uchar blobColor; + + CV_PROP_RW bool filterByArea; + CV_PROP_RW float minArea, maxArea; + + CV_PROP_RW bool filterByCircularity; + CV_PROP_RW float minCircularity, maxCircularity; + + CV_PROP_RW bool filterByInertia; + CV_PROP_RW float minInertiaRatio, maxInertiaRatio; + + CV_PROP_RW bool filterByConvexity; + CV_PROP_RW float minConvexity, maxConvexity; + + void read( const FileNode& fn ); + void write( FileStorage& fs ) const; + }; + + CV_WRAP static Ptr + create(const SimpleBlobDetector::Params ¶meters = SimpleBlobDetector::Params()); +}; + +//! @} features2d_main + +//! @addtogroup features2d_main +//! @{ + +/** @brief Class implementing the KAZE keypoint detector and descriptor extractor, described in @cite ABD12 . + +@note AKAZE descriptor can only be used with KAZE or AKAZE keypoints .. [ABD12] KAZE Features. Pablo +F. Alcantarilla, Adrien Bartoli and Andrew J. Davison. In European Conference on Computer Vision +(ECCV), Fiorenze, Italy, October 2012. +*/ +class CV_EXPORTS_W KAZE : public Feature2D +{ +public: + enum + { + DIFF_PM_G1 = 0, + DIFF_PM_G2 = 1, + DIFF_WEICKERT = 2, + DIFF_CHARBONNIER = 3 + }; + + /** @brief The KAZE constructor + + @param extended Set to enable extraction of extended (128-byte) descriptor. + @param upright Set to enable use of upright descriptors (non rotation-invariant). + @param threshold Detector response threshold to accept point + @param nOctaves Maximum octave evolution of the image + @param nOctaveLayers Default number of sublevels per scale level + @param diffusivity Diffusivity type. DIFF_PM_G1, DIFF_PM_G2, DIFF_WEICKERT or + DIFF_CHARBONNIER + */ + CV_WRAP static Ptr create(bool extended=false, bool upright=false, + float threshold = 0.001f, + int nOctaves = 4, int nOctaveLayers = 4, + int diffusivity = KAZE::DIFF_PM_G2); + + CV_WRAP virtual void setExtended(bool extended) = 0; + CV_WRAP virtual bool getExtended() const = 0; + + CV_WRAP virtual void setUpright(bool upright) = 0; + CV_WRAP virtual bool getUpright() const = 0; + + CV_WRAP virtual void setThreshold(double threshold) = 0; + CV_WRAP virtual double getThreshold() const = 0; + + CV_WRAP virtual void setNOctaves(int octaves) = 0; + CV_WRAP virtual int getNOctaves() const = 0; + + CV_WRAP virtual void setNOctaveLayers(int octaveLayers) = 0; + CV_WRAP virtual int getNOctaveLayers() const = 0; + + CV_WRAP virtual void setDiffusivity(int diff) = 0; + CV_WRAP virtual int getDiffusivity() const = 0; +}; + +/** @brief Class implementing the AKAZE keypoint detector and descriptor extractor, described in @cite ANB13 . : + +@note AKAZE descriptors can only be used with KAZE or AKAZE keypoints. Try to avoid using *extract* +and *detect* instead of *operator()* due to performance reasons. .. [ANB13] Fast Explicit Diffusion +for Accelerated Features in Nonlinear Scale Spaces. Pablo F. Alcantarilla, Jesús Nuevo and Adrien +Bartoli. In British Machine Vision Conference (BMVC), Bristol, UK, September 2013. + */ +class CV_EXPORTS_W AKAZE : public Feature2D +{ +public: + // AKAZE descriptor type + enum + { + DESCRIPTOR_KAZE_UPRIGHT = 2, ///< Upright descriptors, not invariant to rotation + DESCRIPTOR_KAZE = 3, + DESCRIPTOR_MLDB_UPRIGHT = 4, ///< Upright descriptors, not invariant to rotation + DESCRIPTOR_MLDB = 5 + }; + + /** @brief The AKAZE constructor + + @param descriptor_type Type of the extracted descriptor: DESCRIPTOR_KAZE, + DESCRIPTOR_KAZE_UPRIGHT, DESCRIPTOR_MLDB or DESCRIPTOR_MLDB_UPRIGHT. + @param descriptor_size Size of the descriptor in bits. 0 -\> Full size + @param descriptor_channels Number of channels in the descriptor (1, 2, 3) + @param threshold Detector response threshold to accept point + @param nOctaves Maximum octave evolution of the image + @param nOctaveLayers Default number of sublevels per scale level + @param diffusivity Diffusivity type. DIFF_PM_G1, DIFF_PM_G2, DIFF_WEICKERT or + DIFF_CHARBONNIER + */ + CV_WRAP static Ptr create(int descriptor_type=AKAZE::DESCRIPTOR_MLDB, + int descriptor_size = 0, int descriptor_channels = 3, + float threshold = 0.001f, int nOctaves = 4, + int nOctaveLayers = 4, int diffusivity = KAZE::DIFF_PM_G2); + + CV_WRAP virtual void setDescriptorType(int dtype) = 0; + CV_WRAP virtual int getDescriptorType() const = 0; + + CV_WRAP virtual void setDescriptorSize(int dsize) = 0; + CV_WRAP virtual int getDescriptorSize() const = 0; + + CV_WRAP virtual void setDescriptorChannels(int dch) = 0; + CV_WRAP virtual int getDescriptorChannels() const = 0; + + CV_WRAP virtual void setThreshold(double threshold) = 0; + CV_WRAP virtual double getThreshold() const = 0; + + CV_WRAP virtual void setNOctaves(int octaves) = 0; + CV_WRAP virtual int getNOctaves() const = 0; + + CV_WRAP virtual void setNOctaveLayers(int octaveLayers) = 0; + CV_WRAP virtual int getNOctaveLayers() const = 0; + + CV_WRAP virtual void setDiffusivity(int diff) = 0; + CV_WRAP virtual int getDiffusivity() const = 0; +}; + +//! @} features2d_main + +/****************************************************************************************\ +* Distance * +\****************************************************************************************/ + +template +struct CV_EXPORTS Accumulator +{ + typedef T Type; +}; + +template<> struct Accumulator { typedef float Type; }; +template<> struct Accumulator { typedef float Type; }; +template<> struct Accumulator { typedef float Type; }; +template<> struct Accumulator { typedef float Type; }; + +/* + * Squared Euclidean distance functor + */ +template +struct CV_EXPORTS SL2 +{ + enum { normType = NORM_L2SQR }; + typedef T ValueType; + typedef typename Accumulator::Type ResultType; + + ResultType operator()( const T* a, const T* b, int size ) const + { + return normL2Sqr(a, b, size); + } +}; + +/* + * Euclidean distance functor + */ +template +struct CV_EXPORTS L2 +{ + enum { normType = NORM_L2 }; + typedef T ValueType; + typedef typename Accumulator::Type ResultType; + + ResultType operator()( const T* a, const T* b, int size ) const + { + return (ResultType)std::sqrt((double)normL2Sqr(a, b, size)); + } +}; + +/* + * Manhattan distance (city block distance) functor + */ +template +struct CV_EXPORTS L1 +{ + enum { normType = NORM_L1 }; + typedef T ValueType; + typedef typename Accumulator::Type ResultType; + + ResultType operator()( const T* a, const T* b, int size ) const + { + return normL1(a, b, size); + } +}; + +/****************************************************************************************\ +* DescriptorMatcher * +\****************************************************************************************/ + +//! @addtogroup features2d_match +//! @{ + +/** @brief Abstract base class for matching keypoint descriptors. + +It has two groups of match methods: for matching descriptors of an image with another image or with +an image set. + */ +class CV_EXPORTS_W DescriptorMatcher : public Algorithm +{ +public: + virtual ~DescriptorMatcher(); + + /** @brief Adds descriptors to train a CPU(trainDescCollectionis) or GPU(utrainDescCollectionis) descriptor + collection. + + If the collection is not empty, the new descriptors are added to existing train descriptors. + + @param descriptors Descriptors to add. Each descriptors[i] is a set of descriptors from the same + train image. + */ + CV_WRAP virtual void add( InputArrayOfArrays descriptors ); + + /** @brief Returns a constant link to the train descriptor collection trainDescCollection . + */ + CV_WRAP const std::vector& getTrainDescriptors() const; + + /** @brief Clears the train descriptor collections. + */ + CV_WRAP virtual void clear(); + + /** @brief Returns true if there are no train descriptors in the both collections. + */ + CV_WRAP virtual bool empty() const; + + /** @brief Returns true if the descriptor matcher supports masking permissible matches. + */ + CV_WRAP virtual bool isMaskSupported() const = 0; + + /** @brief Trains a descriptor matcher + + Trains a descriptor matcher (for example, the flann index). In all methods to match, the method + train() is run every time before matching. Some descriptor matchers (for example, BruteForceMatcher) + have an empty implementation of this method. Other matchers really train their inner structures (for + example, FlannBasedMatcher trains flann::Index ). + */ + CV_WRAP virtual void train(); + + /** @brief Finds the best match for each descriptor from a query set. + + @param queryDescriptors Query set of descriptors. + @param trainDescriptors Train set of descriptors. This set is not added to the train descriptors + collection stored in the class object. + @param matches Matches. If a query descriptor is masked out in mask , no match is added for this + descriptor. So, matches size may be smaller than the query descriptors count. + @param mask Mask specifying permissible matches between an input query and train matrices of + descriptors. + + In the first variant of this method, the train descriptors are passed as an input argument. In the + second variant of the method, train descriptors collection that was set by DescriptorMatcher::add is + used. Optional mask (or masks) can be passed to specify which query and training descriptors can be + matched. Namely, queryDescriptors[i] can be matched with trainDescriptors[j] only if + mask.at\(i,j) is non-zero. + */ + CV_WRAP void match( InputArray queryDescriptors, InputArray trainDescriptors, + CV_OUT std::vector& matches, InputArray mask=noArray() ) const; + + /** @brief Finds the k best matches for each descriptor from a query set. + + @param queryDescriptors Query set of descriptors. + @param trainDescriptors Train set of descriptors. This set is not added to the train descriptors + collection stored in the class object. + @param mask Mask specifying permissible matches between an input query and train matrices of + descriptors. + @param matches Matches. Each matches[i] is k or less matches for the same query descriptor. + @param k Count of best matches found per each query descriptor or less if a query descriptor has + less than k possible matches in total. + @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is + false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, + the matches vector does not contain matches for fully masked-out query descriptors. + + These extended variants of DescriptorMatcher::match methods find several best matches for each query + descriptor. The matches are returned in the distance increasing order. See DescriptorMatcher::match + for the details about query and train descriptors. + */ + CV_WRAP void knnMatch( InputArray queryDescriptors, InputArray trainDescriptors, + CV_OUT std::vector >& matches, int k, + InputArray mask=noArray(), bool compactResult=false ) const; + + /** @brief For each query descriptor, finds the training descriptors not farther than the specified distance. + + @param queryDescriptors Query set of descriptors. + @param trainDescriptors Train set of descriptors. This set is not added to the train descriptors + collection stored in the class object. + @param matches Found matches. + @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is + false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, + the matches vector does not contain matches for fully masked-out query descriptors. + @param maxDistance Threshold for the distance between matched descriptors. Distance means here + metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured + in Pixels)! + @param mask Mask specifying permissible matches between an input query and train matrices of + descriptors. + + For each query descriptor, the methods find such training descriptors that the distance between the + query descriptor and the training descriptor is equal or smaller than maxDistance. Found matches are + returned in the distance increasing order. + */ + void radiusMatch( InputArray queryDescriptors, InputArray trainDescriptors, + std::vector >& matches, float maxDistance, + InputArray mask=noArray(), bool compactResult=false ) const; + + /** @overload + @param queryDescriptors Query set of descriptors. + @param matches Matches. If a query descriptor is masked out in mask , no match is added for this + descriptor. So, matches size may be smaller than the query descriptors count. + @param masks Set of masks. Each masks[i] specifies permissible matches between the input query + descriptors and stored train descriptors from the i-th image trainDescCollection[i]. + */ + CV_WRAP void match( InputArray queryDescriptors, CV_OUT std::vector& matches, + InputArrayOfArrays masks=noArray() ); + /** @overload + @param queryDescriptors Query set of descriptors. + @param matches Matches. Each matches[i] is k or less matches for the same query descriptor. + @param k Count of best matches found per each query descriptor or less if a query descriptor has + less than k possible matches in total. + @param masks Set of masks. Each masks[i] specifies permissible matches between the input query + descriptors and stored train descriptors from the i-th image trainDescCollection[i]. + @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is + false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, + the matches vector does not contain matches for fully masked-out query descriptors. + */ + CV_WRAP void knnMatch( InputArray queryDescriptors, CV_OUT std::vector >& matches, int k, + InputArrayOfArrays masks=noArray(), bool compactResult=false ); + /** @overload + @param queryDescriptors Query set of descriptors. + @param matches Found matches. + @param maxDistance Threshold for the distance between matched descriptors. Distance means here + metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured + in Pixels)! + @param masks Set of masks. Each masks[i] specifies permissible matches between the input query + descriptors and stored train descriptors from the i-th image trainDescCollection[i]. + @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is + false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, + the matches vector does not contain matches for fully masked-out query descriptors. + */ + void radiusMatch( InputArray queryDescriptors, std::vector >& matches, float maxDistance, + InputArrayOfArrays masks=noArray(), bool compactResult=false ); + + // Reads matcher object from a file node + virtual void read( const FileNode& ); + // Writes matcher object to a file storage + virtual void write( FileStorage& ) const; + + /** @brief Clones the matcher. + + @param emptyTrainData If emptyTrainData is false, the method creates a deep copy of the object, + that is, copies both parameters and train data. If emptyTrainData is true, the method creates an + object copy with the current parameters but with empty train data. + */ + virtual Ptr clone( bool emptyTrainData=false ) const = 0; + + /** @brief Creates a descriptor matcher of a given type with the default parameters (using default + constructor). + + @param descriptorMatcherType Descriptor matcher type. Now the following matcher types are + supported: + - `BruteForce` (it uses L2 ) + - `BruteForce-L1` + - `BruteForce-Hamming` + - `BruteForce-Hamming(2)` + - `FlannBased` + */ + CV_WRAP static Ptr create( const String& descriptorMatcherType ); +protected: + /** + * Class to work with descriptors from several images as with one merged matrix. + * It is used e.g. in FlannBasedMatcher. + */ + class CV_EXPORTS DescriptorCollection + { + public: + DescriptorCollection(); + DescriptorCollection( const DescriptorCollection& collection ); + virtual ~DescriptorCollection(); + + // Vector of matrices "descriptors" will be merged to one matrix "mergedDescriptors" here. + void set( const std::vector& descriptors ); + virtual void clear(); + + const Mat& getDescriptors() const; + const Mat getDescriptor( int imgIdx, int localDescIdx ) const; + const Mat getDescriptor( int globalDescIdx ) const; + void getLocalIdx( int globalDescIdx, int& imgIdx, int& localDescIdx ) const; + + int size() const; + + protected: + Mat mergedDescriptors; + std::vector startIdxs; + }; + + //! In fact the matching is implemented only by the following two methods. These methods suppose + //! that the class object has been trained already. Public match methods call these methods + //! after calling train(). + virtual void knnMatchImpl( InputArray queryDescriptors, std::vector >& matches, int k, + InputArrayOfArrays masks=noArray(), bool compactResult=false ) = 0; + virtual void radiusMatchImpl( InputArray queryDescriptors, std::vector >& matches, float maxDistance, + InputArrayOfArrays masks=noArray(), bool compactResult=false ) = 0; + + static bool isPossibleMatch( InputArray mask, int queryIdx, int trainIdx ); + static bool isMaskedOut( InputArrayOfArrays masks, int queryIdx ); + + static Mat clone_op( Mat m ) { return m.clone(); } + void checkMasks( InputArrayOfArrays masks, int queryDescriptorsCount ) const; + + //! Collection of descriptors from train images. + std::vector trainDescCollection; + std::vector utrainDescCollection; +}; + +/** @brief Brute-force descriptor matcher. + +For each descriptor in the first set, this matcher finds the closest descriptor in the second set +by trying each one. This descriptor matcher supports masking permissible matches of descriptor +sets. + */ +class CV_EXPORTS_W BFMatcher : public DescriptorMatcher +{ +public: + /** @brief Brute-force matcher constructor. + + @param normType One of NORM_L1, NORM_L2, NORM_HAMMING, NORM_HAMMING2. L1 and L2 norms are + preferable choices for SIFT and SURF descriptors, NORM_HAMMING should be used with ORB, BRISK and + BRIEF, NORM_HAMMING2 should be used with ORB when WTA_K==3 or 4 (see ORB::ORB constructor + description). + @param crossCheck If it is false, this is will be default BFMatcher behaviour when it finds the k + nearest neighbors for each query descriptor. If crossCheck==true, then the knnMatch() method with + k=1 will only return pairs (i,j) such that for i-th query descriptor the j-th descriptor in the + matcher's collection is the nearest and vice versa, i.e. the BFMatcher will only return consistent + pairs. Such technique usually produces best results with minimal number of outliers when there are + enough matches. This is alternative to the ratio test, used by D. Lowe in SIFT paper. + */ + CV_WRAP BFMatcher( int normType=NORM_L2, bool crossCheck=false ); + virtual ~BFMatcher() {} + + virtual bool isMaskSupported() const { return true; } + + virtual Ptr clone( bool emptyTrainData=false ) const; +protected: + virtual void knnMatchImpl( InputArray queryDescriptors, std::vector >& matches, int k, + InputArrayOfArrays masks=noArray(), bool compactResult=false ); + virtual void radiusMatchImpl( InputArray queryDescriptors, std::vector >& matches, float maxDistance, + InputArrayOfArrays masks=noArray(), bool compactResult=false ); + + int normType; + bool crossCheck; +}; + + +/** @brief Flann-based descriptor matcher. + +This matcher trains flann::Index_ on a train descriptor collection and calls its nearest search +methods to find the best matches. So, this matcher may be faster when matching a large train +collection than the brute force matcher. FlannBasedMatcher does not support masking permissible +matches of descriptor sets because flann::Index does not support this. : + */ +class CV_EXPORTS_W FlannBasedMatcher : public DescriptorMatcher +{ +public: + CV_WRAP FlannBasedMatcher( const Ptr& indexParams=makePtr(), + const Ptr& searchParams=makePtr() ); + + virtual void add( InputArrayOfArrays descriptors ); + virtual void clear(); + + // Reads matcher object from a file node + virtual void read( const FileNode& ); + // Writes matcher object to a file storage + virtual void write( FileStorage& ) const; + + virtual void train(); + virtual bool isMaskSupported() const; + + virtual Ptr clone( bool emptyTrainData=false ) const; +protected: + static void convertToDMatches( const DescriptorCollection& descriptors, + const Mat& indices, const Mat& distances, + std::vector >& matches ); + + virtual void knnMatchImpl( InputArray queryDescriptors, std::vector >& matches, int k, + InputArrayOfArrays masks=noArray(), bool compactResult=false ); + virtual void radiusMatchImpl( InputArray queryDescriptors, std::vector >& matches, float maxDistance, + InputArrayOfArrays masks=noArray(), bool compactResult=false ); + + Ptr indexParams; + Ptr searchParams; + Ptr flannIndex; + + DescriptorCollection mergedDescriptors; + int addedDescCount; +}; + +//! @} features2d_match + +/****************************************************************************************\ +* Drawing functions * +\****************************************************************************************/ + +//! @addtogroup features2d_draw +//! @{ + +struct CV_EXPORTS DrawMatchesFlags +{ + enum{ DEFAULT = 0, //!< Output image matrix will be created (Mat::create), + //!< i.e. existing memory of output image may be reused. + //!< Two source image, matches and single keypoints will be drawn. + //!< For each keypoint only the center point will be drawn (without + //!< the circle around keypoint with keypoint size and orientation). + DRAW_OVER_OUTIMG = 1, //!< Output image matrix will not be created (Mat::create). + //!< Matches will be drawn on existing content of output image. + NOT_DRAW_SINGLE_POINTS = 2, //!< Single keypoints will not be drawn. + DRAW_RICH_KEYPOINTS = 4 //!< For each keypoint the circle around keypoint with keypoint size and + //!< orientation will be drawn. + }; +}; + +/** @brief Draws keypoints. + +@param image Source image. +@param keypoints Keypoints from the source image. +@param outImage Output image. Its content depends on the flags value defining what is drawn in the +output image. See possible flags bit values below. +@param color Color of keypoints. +@param flags Flags setting drawing features. Possible flags bit values are defined by +DrawMatchesFlags. See details above in drawMatches . + +@note +For Python API, flags are modified as cv2.DRAW_MATCHES_FLAGS_DEFAULT, +cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS, cv2.DRAW_MATCHES_FLAGS_DRAW_OVER_OUTIMG, +cv2.DRAW_MATCHES_FLAGS_NOT_DRAW_SINGLE_POINTS + */ +CV_EXPORTS_W void drawKeypoints( InputArray image, const std::vector& keypoints, InputOutputArray outImage, + const Scalar& color=Scalar::all(-1), int flags=DrawMatchesFlags::DEFAULT ); + +/** @brief Draws the found matches of keypoints from two images. + +@param img1 First source image. +@param keypoints1 Keypoints from the first source image. +@param img2 Second source image. +@param keypoints2 Keypoints from the second source image. +@param matches1to2 Matches from the first image to the second one, which means that keypoints1[i] +has a corresponding point in keypoints2[matches[i]] . +@param outImg Output image. Its content depends on the flags value defining what is drawn in the +output image. See possible flags bit values below. +@param matchColor Color of matches (lines and connected keypoints). If matchColor==Scalar::all(-1) +, the color is generated randomly. +@param singlePointColor Color of single keypoints (circles), which means that keypoints do not +have the matches. If singlePointColor==Scalar::all(-1) , the color is generated randomly. +@param matchesMask Mask determining which matches are drawn. If the mask is empty, all matches are +drawn. +@param flags Flags setting drawing features. Possible flags bit values are defined by +DrawMatchesFlags. + +This function draws matches of keypoints from two images in the output image. Match is a line +connecting two keypoints (circles). See cv::DrawMatchesFlags. + */ +CV_EXPORTS_W void drawMatches( InputArray img1, const std::vector& keypoints1, + InputArray img2, const std::vector& keypoints2, + const std::vector& matches1to2, InputOutputArray outImg, + const Scalar& matchColor=Scalar::all(-1), const Scalar& singlePointColor=Scalar::all(-1), + const std::vector& matchesMask=std::vector(), int flags=DrawMatchesFlags::DEFAULT ); + +/** @overload */ +CV_EXPORTS_AS(drawMatchesKnn) void drawMatches( InputArray img1, const std::vector& keypoints1, + InputArray img2, const std::vector& keypoints2, + const std::vector >& matches1to2, InputOutputArray outImg, + const Scalar& matchColor=Scalar::all(-1), const Scalar& singlePointColor=Scalar::all(-1), + const std::vector >& matchesMask=std::vector >(), int flags=DrawMatchesFlags::DEFAULT ); + +//! @} features2d_draw + +/****************************************************************************************\ +* Functions to evaluate the feature detectors and [generic] descriptor extractors * +\****************************************************************************************/ + +CV_EXPORTS void evaluateFeatureDetector( const Mat& img1, const Mat& img2, const Mat& H1to2, + std::vector* keypoints1, std::vector* keypoints2, + float& repeatability, int& correspCount, + const Ptr& fdetector=Ptr() ); + +CV_EXPORTS void computeRecallPrecisionCurve( const std::vector >& matches1to2, + const std::vector >& correctMatches1to2Mask, + std::vector& recallPrecisionCurve ); + +CV_EXPORTS float getRecall( const std::vector& recallPrecisionCurve, float l_precision ); +CV_EXPORTS int getNearestPoint( const std::vector& recallPrecisionCurve, float l_precision ); + +/****************************************************************************************\ +* Bag of visual words * +\****************************************************************************************/ + +//! @addtogroup features2d_category +//! @{ + +/** @brief Abstract base class for training the *bag of visual words* vocabulary from a set of descriptors. + +For details, see, for example, *Visual Categorization with Bags of Keypoints* by Gabriella Csurka, +Christopher R. Dance, Lixin Fan, Jutta Willamowski, Cedric Bray, 2004. : + */ +class CV_EXPORTS_W BOWTrainer +{ +public: + BOWTrainer(); + virtual ~BOWTrainer(); + + /** @brief Adds descriptors to a training set. + + @param descriptors Descriptors to add to a training set. Each row of the descriptors matrix is a + descriptor. + + The training set is clustered using clustermethod to construct the vocabulary. + */ + CV_WRAP void add( const Mat& descriptors ); + + /** @brief Returns a training set of descriptors. + */ + CV_WRAP const std::vector& getDescriptors() const; + + /** @brief Returns the count of all descriptors stored in the training set. + */ + CV_WRAP int descriptorsCount() const; + + CV_WRAP virtual void clear(); + + /** @overload */ + CV_WRAP virtual Mat cluster() const = 0; + + /** @brief Clusters train descriptors. + + @param descriptors Descriptors to cluster. Each row of the descriptors matrix is a descriptor. + Descriptors are not added to the inner train descriptor set. + + The vocabulary consists of cluster centers. So, this method returns the vocabulary. In the first + variant of the method, train descriptors stored in the object are clustered. In the second variant, + input descriptors are clustered. + */ + CV_WRAP virtual Mat cluster( const Mat& descriptors ) const = 0; + +protected: + std::vector descriptors; + int size; +}; + +/** @brief kmeans -based class to train visual vocabulary using the *bag of visual words* approach. : + */ +class CV_EXPORTS_W BOWKMeansTrainer : public BOWTrainer +{ +public: + /** @brief The constructor. + + @see cv::kmeans + */ + CV_WRAP BOWKMeansTrainer( int clusterCount, const TermCriteria& termcrit=TermCriteria(), + int attempts=3, int flags=KMEANS_PP_CENTERS ); + virtual ~BOWKMeansTrainer(); + + // Returns trained vocabulary (i.e. cluster centers). + CV_WRAP virtual Mat cluster() const; + CV_WRAP virtual Mat cluster( const Mat& descriptors ) const; + +protected: + + int clusterCount; + TermCriteria termcrit; + int attempts; + int flags; +}; + +/** @brief Class to compute an image descriptor using the *bag of visual words*. + +Such a computation consists of the following steps: + +1. Compute descriptors for a given image and its keypoints set. +2. Find the nearest visual words from the vocabulary for each keypoint descriptor. +3. Compute the bag-of-words image descriptor as is a normalized histogram of vocabulary words +encountered in the image. The i-th bin of the histogram is a frequency of i-th word of the +vocabulary in the given image. + */ +class CV_EXPORTS_W BOWImgDescriptorExtractor +{ +public: + /** @brief The constructor. + + @param dextractor Descriptor extractor that is used to compute descriptors for an input image and + its keypoints. + @param dmatcher Descriptor matcher that is used to find the nearest word of the trained vocabulary + for each keypoint descriptor of the image. + */ + CV_WRAP BOWImgDescriptorExtractor( const Ptr& dextractor, + const Ptr& dmatcher ); + /** @overload */ + BOWImgDescriptorExtractor( const Ptr& dmatcher ); + virtual ~BOWImgDescriptorExtractor(); + + /** @brief Sets a visual vocabulary. + + @param vocabulary Vocabulary (can be trained using the inheritor of BOWTrainer ). Each row of the + vocabulary is a visual word (cluster center). + */ + CV_WRAP void setVocabulary( const Mat& vocabulary ); + + /** @brief Returns the set vocabulary. + */ + CV_WRAP const Mat& getVocabulary() const; + + /** @brief Computes an image descriptor using the set visual vocabulary. + + @param image Image, for which the descriptor is computed. + @param keypoints Keypoints detected in the input image. + @param imgDescriptor Computed output image descriptor. + @param pointIdxsOfClusters Indices of keypoints that belong to the cluster. This means that + pointIdxsOfClusters[i] are keypoint indices that belong to the i -th cluster (word of vocabulary) + returned if it is non-zero. + @param descriptors Descriptors of the image keypoints that are returned if they are non-zero. + */ + void compute( InputArray image, std::vector& keypoints, OutputArray imgDescriptor, + std::vector >* pointIdxsOfClusters=0, Mat* descriptors=0 ); + /** @overload + @param keypointDescriptors Computed descriptors to match with vocabulary. + @param imgDescriptor Computed output image descriptor. + @param pointIdxsOfClusters Indices of keypoints that belong to the cluster. This means that + pointIdxsOfClusters[i] are keypoint indices that belong to the i -th cluster (word of vocabulary) + returned if it is non-zero. + */ + void compute( InputArray keypointDescriptors, OutputArray imgDescriptor, + std::vector >* pointIdxsOfClusters=0 ); + // compute() is not constant because DescriptorMatcher::match is not constant + + CV_WRAP_AS(compute) void compute2( const Mat& image, std::vector& keypoints, CV_OUT Mat& imgDescriptor ) + { compute(image,keypoints,imgDescriptor); } + + /** @brief Returns an image descriptor size if the vocabulary is set. Otherwise, it returns 0. + */ + CV_WRAP int descriptorSize() const; + + /** @brief Returns an image descriptor type. + */ + CV_WRAP int descriptorType() const; + +protected: + Mat vocabulary; + Ptr dextractor; + Ptr dmatcher; +}; + +//! @} features2d_category + +//! @} features2d + +} /* namespace cv */ + +#endif diff --git a/lib/opencv/include/opencv2/features2d/features2d.hpp b/lib/opencv/include/opencv2/features2d/features2d.hpp new file mode 100644 index 000000000..e81df0ad0 --- /dev/null +++ b/lib/opencv/include/opencv2/features2d/features2d.hpp @@ -0,0 +1,48 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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*/ + +#ifdef __OPENCV_BUILD +#error this is a compatibility header which should not be used inside the OpenCV library +#endif + +#include "opencv2/features2d.hpp" diff --git a/lib/opencv/include/opencv2/flann.hpp b/lib/opencv/include/opencv2/flann.hpp new file mode 100644 index 000000000..4f92d57e3 --- /dev/null +++ b/lib/opencv/include/opencv2/flann.hpp @@ -0,0 +1,561 @@ +/*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_FLANN_HPP_ +#define _OPENCV_FLANN_HPP_ + +#include "opencv2/core.hpp" +#include "opencv2/flann/miniflann.hpp" +#include "opencv2/flann/flann_base.hpp" + +/** +@defgroup flann Clustering and Search in Multi-Dimensional Spaces + +This section documents OpenCV's interface to the FLANN library. FLANN (Fast Library for Approximate +Nearest Neighbors) is a library that contains a collection of algorithms optimized for fast nearest +neighbor search in large datasets and for high dimensional features. More information about FLANN +can be found in @cite Muja2009 . +*/ + +namespace cvflann +{ + CV_EXPORTS flann_distance_t flann_distance_type(); + FLANN_DEPRECATED CV_EXPORTS void set_distance_type(flann_distance_t distance_type, int order); +} + + +namespace cv +{ +namespace flann +{ + + +//! @addtogroup flann +//! @{ + +template struct CvType {}; +template <> struct CvType { static int type() { return CV_8U; } }; +template <> struct CvType { static int type() { return CV_8S; } }; +template <> struct CvType { static int type() { return CV_16U; } }; +template <> struct CvType { static int type() { return CV_16S; } }; +template <> struct CvType { static int type() { return CV_32S; } }; +template <> struct CvType { static int type() { return CV_32F; } }; +template <> struct CvType { static int type() { return CV_64F; } }; + + +// bring the flann parameters into this namespace +using ::cvflann::get_param; +using ::cvflann::print_params; + +// bring the flann distances into this namespace +using ::cvflann::L2_Simple; +using ::cvflann::L2; +using ::cvflann::L1; +using ::cvflann::MinkowskiDistance; +using ::cvflann::MaxDistance; +using ::cvflann::HammingLUT; +using ::cvflann::Hamming; +using ::cvflann::Hamming2; +using ::cvflann::HistIntersectionDistance; +using ::cvflann::HellingerDistance; +using ::cvflann::ChiSquareDistance; +using ::cvflann::KL_Divergence; + + +/** @brief The FLANN nearest neighbor index class. This class is templated with the type of elements for which +the index is built. + */ +template +class GenericIndex +{ +public: + typedef typename Distance::ElementType ElementType; + typedef typename Distance::ResultType DistanceType; + + /** @brief Constructs a nearest neighbor search index for a given dataset. + + @param features Matrix of containing the features(points) to index. The size of the matrix is + num_features x feature_dimensionality and the data type of the elements in the matrix must + coincide with the type of the index. + @param params Structure containing the index parameters. The type of index that will be + constructed depends on the type of this parameter. See the description. + @param distance + + The method constructs a fast search structure from a set of features using the specified algorithm + with specified parameters, as defined by params. params is a reference to one of the following class + IndexParams descendants: + + - **LinearIndexParams** When passing an object of this type, the index will perform a linear, + brute-force search. : + @code + struct LinearIndexParams : public IndexParams + { + }; + @endcode + - **KDTreeIndexParams** When passing an object of this type the index constructed will consist of + a set of randomized kd-trees which will be searched in parallel. : + @code + struct KDTreeIndexParams : public IndexParams + { + KDTreeIndexParams( int trees = 4 ); + }; + @endcode + - **KMeansIndexParams** When passing an object of this type the index constructed will be a + hierarchical k-means tree. : + @code + struct KMeansIndexParams : public IndexParams + { + KMeansIndexParams( + int branching = 32, + int iterations = 11, + flann_centers_init_t centers_init = CENTERS_RANDOM, + float cb_index = 0.2 ); + }; + @endcode + - **CompositeIndexParams** When using a parameters object of this type the index created + combines the randomized kd-trees and the hierarchical k-means tree. : + @code + struct CompositeIndexParams : public IndexParams + { + CompositeIndexParams( + int trees = 4, + int branching = 32, + int iterations = 11, + flann_centers_init_t centers_init = CENTERS_RANDOM, + float cb_index = 0.2 ); + }; + @endcode + - **LshIndexParams** When using a parameters object of this type the index created uses + multi-probe LSH (by Multi-Probe LSH: Efficient Indexing for High-Dimensional Similarity Search + by Qin Lv, William Josephson, Zhe Wang, Moses Charikar, Kai Li., Proceedings of the 33rd + International Conference on Very Large Data Bases (VLDB). Vienna, Austria. September 2007) : + @code + struct LshIndexParams : public IndexParams + { + LshIndexParams( + unsigned int table_number, + unsigned int key_size, + unsigned int multi_probe_level ); + }; + @endcode + - **AutotunedIndexParams** When passing an object of this type the index created is + automatically tuned to offer the best performance, by choosing the optimal index type + (randomized kd-trees, hierarchical kmeans, linear) and parameters for the dataset provided. : + @code + struct AutotunedIndexParams : public IndexParams + { + AutotunedIndexParams( + float target_precision = 0.9, + float build_weight = 0.01, + float memory_weight = 0, + float sample_fraction = 0.1 ); + }; + @endcode + - **SavedIndexParams** This object type is used for loading a previously saved index from the + disk. : + @code + struct SavedIndexParams : public IndexParams + { + SavedIndexParams( String filename ); + }; + @endcode + */ + GenericIndex(const Mat& features, const ::cvflann::IndexParams& params, Distance distance = Distance()); + + ~GenericIndex(); + + /** @brief Performs a K-nearest neighbor search for a given query point using the index. + + @param query The query point + @param indices Vector that will contain the indices of the K-nearest neighbors found. It must have + at least knn size. + @param dists Vector that will contain the distances to the K-nearest neighbors found. It must have + at least knn size. + @param knn Number of nearest neighbors to search for. + @param params SearchParams + */ + void knnSearch(const std::vector& query, std::vector& indices, + std::vector& dists, int knn, const ::cvflann::SearchParams& params); + void knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& params); + + int radiusSearch(const std::vector& query, std::vector& indices, + std::vector& dists, DistanceType radius, const ::cvflann::SearchParams& params); + int radiusSearch(const Mat& query, Mat& indices, Mat& dists, + DistanceType radius, const ::cvflann::SearchParams& params); + + void save(String filename) { nnIndex->save(filename); } + + int veclen() const { return nnIndex->veclen(); } + + int size() const { return nnIndex->size(); } + + ::cvflann::IndexParams getParameters() { return nnIndex->getParameters(); } + + FLANN_DEPRECATED const ::cvflann::IndexParams* getIndexParameters() { return nnIndex->getIndexParameters(); } + +private: + ::cvflann::Index* nnIndex; +}; + +//! @cond IGNORED + +#define FLANN_DISTANCE_CHECK \ + if ( ::cvflann::flann_distance_type() != cvflann::FLANN_DIST_L2) { \ + printf("[WARNING] You are using cv::flann::Index (or cv::flann::GenericIndex) and have also changed "\ + "the distance using cvflann::set_distance_type. This is no longer working as expected "\ + "(cv::flann::Index always uses L2). You should create the index templated on the distance, "\ + "for example for L1 distance use: GenericIndex< L1 > \n"); \ + } + + +template +GenericIndex::GenericIndex(const Mat& dataset, const ::cvflann::IndexParams& params, Distance distance) +{ + CV_Assert(dataset.type() == CvType::type()); + CV_Assert(dataset.isContinuous()); + ::cvflann::Matrix m_dataset((ElementType*)dataset.ptr(0), dataset.rows, dataset.cols); + + nnIndex = new ::cvflann::Index(m_dataset, params, distance); + + FLANN_DISTANCE_CHECK + + nnIndex->buildIndex(); +} + +template +GenericIndex::~GenericIndex() +{ + delete nnIndex; +} + +template +void GenericIndex::knnSearch(const std::vector& query, std::vector& indices, std::vector& dists, int knn, const ::cvflann::SearchParams& searchParams) +{ + ::cvflann::Matrix m_query((ElementType*)&query[0], 1, query.size()); + ::cvflann::Matrix m_indices(&indices[0], 1, indices.size()); + ::cvflann::Matrix m_dists(&dists[0], 1, dists.size()); + + FLANN_DISTANCE_CHECK + + nnIndex->knnSearch(m_query,m_indices,m_dists,knn,searchParams); +} + + +template +void GenericIndex::knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& searchParams) +{ + CV_Assert(queries.type() == CvType::type()); + CV_Assert(queries.isContinuous()); + ::cvflann::Matrix m_queries((ElementType*)queries.ptr(0), queries.rows, queries.cols); + + CV_Assert(indices.type() == CV_32S); + CV_Assert(indices.isContinuous()); + ::cvflann::Matrix m_indices((int*)indices.ptr(0), indices.rows, indices.cols); + + CV_Assert(dists.type() == CvType::type()); + CV_Assert(dists.isContinuous()); + ::cvflann::Matrix m_dists((DistanceType*)dists.ptr(0), dists.rows, dists.cols); + + FLANN_DISTANCE_CHECK + + nnIndex->knnSearch(m_queries,m_indices,m_dists,knn, searchParams); +} + +template +int GenericIndex::radiusSearch(const std::vector& query, std::vector& indices, std::vector& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams) +{ + ::cvflann::Matrix m_query((ElementType*)&query[0], 1, query.size()); + ::cvflann::Matrix m_indices(&indices[0], 1, indices.size()); + ::cvflann::Matrix m_dists(&dists[0], 1, dists.size()); + + FLANN_DISTANCE_CHECK + + return nnIndex->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); +} + +template +int GenericIndex::radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams) +{ + CV_Assert(query.type() == CvType::type()); + CV_Assert(query.isContinuous()); + ::cvflann::Matrix m_query((ElementType*)query.ptr(0), query.rows, query.cols); + + CV_Assert(indices.type() == CV_32S); + CV_Assert(indices.isContinuous()); + ::cvflann::Matrix m_indices((int*)indices.ptr(0), indices.rows, indices.cols); + + CV_Assert(dists.type() == CvType::type()); + CV_Assert(dists.isContinuous()); + ::cvflann::Matrix m_dists((DistanceType*)dists.ptr(0), dists.rows, dists.cols); + + FLANN_DISTANCE_CHECK + + return nnIndex->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); +} + +//! @endcond + +/** + * @deprecated Use GenericIndex class instead + */ +template +class +#ifndef _MSC_VER + FLANN_DEPRECATED +#endif + Index_ { +public: + typedef typename L2::ElementType ElementType; + typedef typename L2::ResultType DistanceType; + + Index_(const Mat& features, const ::cvflann::IndexParams& params); + + ~Index_(); + + void knnSearch(const std::vector& query, std::vector& indices, std::vector& dists, int knn, const ::cvflann::SearchParams& params); + void knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& params); + + int radiusSearch(const std::vector& query, std::vector& indices, std::vector& dists, DistanceType radius, const ::cvflann::SearchParams& params); + int radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& params); + + void save(String filename) + { + if (nnIndex_L1) nnIndex_L1->save(filename); + if (nnIndex_L2) nnIndex_L2->save(filename); + } + + int veclen() const + { + if (nnIndex_L1) return nnIndex_L1->veclen(); + if (nnIndex_L2) return nnIndex_L2->veclen(); + } + + int size() const + { + if (nnIndex_L1) return nnIndex_L1->size(); + if (nnIndex_L2) return nnIndex_L2->size(); + } + + ::cvflann::IndexParams getParameters() + { + if (nnIndex_L1) return nnIndex_L1->getParameters(); + if (nnIndex_L2) return nnIndex_L2->getParameters(); + + } + + FLANN_DEPRECATED const ::cvflann::IndexParams* getIndexParameters() + { + if (nnIndex_L1) return nnIndex_L1->getIndexParameters(); + if (nnIndex_L2) return nnIndex_L2->getIndexParameters(); + } + +private: + // providing backwards compatibility for L2 and L1 distances (most common) + ::cvflann::Index< L2 >* nnIndex_L2; + ::cvflann::Index< L1 >* nnIndex_L1; +}; + +#ifdef _MSC_VER +template +class FLANN_DEPRECATED Index_; +#endif + +//! @cond IGNORED + +template +Index_::Index_(const Mat& dataset, const ::cvflann::IndexParams& params) +{ + printf("[WARNING] The cv::flann::Index_ class is deperecated, use cv::flann::GenericIndex instead\n"); + + CV_Assert(dataset.type() == CvType::type()); + CV_Assert(dataset.isContinuous()); + ::cvflann::Matrix m_dataset((ElementType*)dataset.ptr(0), dataset.rows, dataset.cols); + + if ( ::cvflann::flann_distance_type() == cvflann::FLANN_DIST_L2 ) { + nnIndex_L1 = NULL; + nnIndex_L2 = new ::cvflann::Index< L2 >(m_dataset, params); + } + else if ( ::cvflann::flann_distance_type() == cvflann::FLANN_DIST_L1 ) { + nnIndex_L1 = new ::cvflann::Index< L1 >(m_dataset, params); + nnIndex_L2 = NULL; + } + else { + printf("[ERROR] cv::flann::Index_ only provides backwards compatibility for the L1 and L2 distances. " + "For other distance types you must use cv::flann::GenericIndex\n"); + CV_Assert(0); + } + if (nnIndex_L1) nnIndex_L1->buildIndex(); + if (nnIndex_L2) nnIndex_L2->buildIndex(); +} + +template +Index_::~Index_() +{ + if (nnIndex_L1) delete nnIndex_L1; + if (nnIndex_L2) delete nnIndex_L2; +} + +template +void Index_::knnSearch(const std::vector& query, std::vector& indices, std::vector& dists, int knn, const ::cvflann::SearchParams& searchParams) +{ + ::cvflann::Matrix m_query((ElementType*)&query[0], 1, query.size()); + ::cvflann::Matrix m_indices(&indices[0], 1, indices.size()); + ::cvflann::Matrix m_dists(&dists[0], 1, dists.size()); + + if (nnIndex_L1) nnIndex_L1->knnSearch(m_query,m_indices,m_dists,knn,searchParams); + if (nnIndex_L2) nnIndex_L2->knnSearch(m_query,m_indices,m_dists,knn,searchParams); +} + + +template +void Index_::knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& searchParams) +{ + CV_Assert(queries.type() == CvType::type()); + CV_Assert(queries.isContinuous()); + ::cvflann::Matrix m_queries((ElementType*)queries.ptr(0), queries.rows, queries.cols); + + CV_Assert(indices.type() == CV_32S); + CV_Assert(indices.isContinuous()); + ::cvflann::Matrix m_indices((int*)indices.ptr(0), indices.rows, indices.cols); + + CV_Assert(dists.type() == CvType::type()); + CV_Assert(dists.isContinuous()); + ::cvflann::Matrix m_dists((DistanceType*)dists.ptr(0), dists.rows, dists.cols); + + if (nnIndex_L1) nnIndex_L1->knnSearch(m_queries,m_indices,m_dists,knn, searchParams); + if (nnIndex_L2) nnIndex_L2->knnSearch(m_queries,m_indices,m_dists,knn, searchParams); +} + +template +int Index_::radiusSearch(const std::vector& query, std::vector& indices, std::vector& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams) +{ + ::cvflann::Matrix m_query((ElementType*)&query[0], 1, query.size()); + ::cvflann::Matrix m_indices(&indices[0], 1, indices.size()); + ::cvflann::Matrix m_dists(&dists[0], 1, dists.size()); + + if (nnIndex_L1) return nnIndex_L1->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); + if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); +} + +template +int Index_::radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams) +{ + CV_Assert(query.type() == CvType::type()); + CV_Assert(query.isContinuous()); + ::cvflann::Matrix m_query((ElementType*)query.ptr(0), query.rows, query.cols); + + CV_Assert(indices.type() == CV_32S); + CV_Assert(indices.isContinuous()); + ::cvflann::Matrix m_indices((int*)indices.ptr(0), indices.rows, indices.cols); + + CV_Assert(dists.type() == CvType::type()); + CV_Assert(dists.isContinuous()); + ::cvflann::Matrix m_dists((DistanceType*)dists.ptr(0), dists.rows, dists.cols); + + if (nnIndex_L1) return nnIndex_L1->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); + if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); +} + +//! @endcond + +/** @brief Clusters features using hierarchical k-means algorithm. + +@param features The points to be clustered. The matrix must have elements of type +Distance::ElementType. +@param centers The centers of the clusters obtained. The matrix must have type +Distance::ResultType. The number of rows in this matrix represents the number of clusters desired, +however, because of the way the cut in the hierarchical tree is chosen, the number of clusters +computed will be the highest number of the form (branching-1)\*k+1 that's lower than the number of +clusters desired, where branching is the tree's branching factor (see description of the +KMeansIndexParams). +@param params Parameters used in the construction of the hierarchical k-means tree. +@param d Distance to be used for clustering. + +The method clusters the given feature vectors by constructing a hierarchical k-means tree and +choosing a cut in the tree that minimizes the cluster's variance. It returns the number of clusters +found. + */ +template +int hierarchicalClustering(const Mat& features, Mat& centers, const ::cvflann::KMeansIndexParams& params, + Distance d = Distance()) +{ + typedef typename Distance::ElementType ElementType; + typedef typename Distance::ResultType DistanceType; + + CV_Assert(features.type() == CvType::type()); + CV_Assert(features.isContinuous()); + ::cvflann::Matrix m_features((ElementType*)features.ptr(0), features.rows, features.cols); + + CV_Assert(centers.type() == CvType::type()); + CV_Assert(centers.isContinuous()); + ::cvflann::Matrix m_centers((DistanceType*)centers.ptr(0), centers.rows, centers.cols); + + return ::cvflann::hierarchicalClustering(m_features, m_centers, params, d); +} + +/** @deprecated +*/ +template +FLANN_DEPRECATED int hierarchicalClustering(const Mat& features, Mat& centers, const ::cvflann::KMeansIndexParams& params) +{ + printf("[WARNING] cv::flann::hierarchicalClustering is deprecated, use " + "cv::flann::hierarchicalClustering instead\n"); + + if ( ::cvflann::flann_distance_type() == cvflann::FLANN_DIST_L2 ) { + return hierarchicalClustering< L2 >(features, centers, params); + } + else if ( ::cvflann::flann_distance_type() == cvflann::FLANN_DIST_L1 ) { + return hierarchicalClustering< L1 >(features, centers, params); + } + else { + printf("[ERROR] cv::flann::hierarchicalClustering only provides backwards " + "compatibility for the L1 and L2 distances. " + "For other distance types you must use cv::flann::hierarchicalClustering\n"); + CV_Assert(0); + } +} + +//! @} flann + +} } // namespace cv::flann + +#endif diff --git a/lib/opencv/include/opencv2/flann/all_indices.h b/lib/opencv/include/opencv2/flann/all_indices.h new file mode 100644 index 000000000..ff53fd84c --- /dev/null +++ b/lib/opencv/include/opencv2/flann/all_indices.h @@ -0,0 +1,155 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_ALL_INDICES_H_ +#define OPENCV_FLANN_ALL_INDICES_H_ + +#include "general.h" + +#include "nn_index.h" +#include "kdtree_index.h" +#include "kdtree_single_index.h" +#include "kmeans_index.h" +#include "composite_index.h" +#include "linear_index.h" +#include "hierarchical_clustering_index.h" +#include "lsh_index.h" +#include "autotuned_index.h" + + +namespace cvflann +{ + +template +struct index_creator +{ + static NNIndex* create(const Matrix& dataset, const IndexParams& params, const Distance& distance) + { + flann_algorithm_t index_type = get_param(params, "algorithm"); + + NNIndex* nnIndex; + switch (index_type) { + case FLANN_INDEX_LINEAR: + nnIndex = new LinearIndex(dataset, params, distance); + break; + case FLANN_INDEX_KDTREE_SINGLE: + nnIndex = new KDTreeSingleIndex(dataset, params, distance); + break; + case FLANN_INDEX_KDTREE: + nnIndex = new KDTreeIndex(dataset, params, distance); + break; + case FLANN_INDEX_KMEANS: + nnIndex = new KMeansIndex(dataset, params, distance); + break; + case FLANN_INDEX_COMPOSITE: + nnIndex = new CompositeIndex(dataset, params, distance); + break; + case FLANN_INDEX_AUTOTUNED: + nnIndex = new AutotunedIndex(dataset, params, distance); + break; + case FLANN_INDEX_HIERARCHICAL: + nnIndex = new HierarchicalClusteringIndex(dataset, params, distance); + break; + case FLANN_INDEX_LSH: + nnIndex = new LshIndex(dataset, params, distance); + break; + default: + throw FLANNException("Unknown index type"); + } + + return nnIndex; + } +}; + +template +struct index_creator +{ + static NNIndex* create(const Matrix& dataset, const IndexParams& params, const Distance& distance) + { + flann_algorithm_t index_type = get_param(params, "algorithm"); + + NNIndex* nnIndex; + switch (index_type) { + case FLANN_INDEX_LINEAR: + nnIndex = new LinearIndex(dataset, params, distance); + break; + case FLANN_INDEX_KMEANS: + nnIndex = new KMeansIndex(dataset, params, distance); + break; + case FLANN_INDEX_HIERARCHICAL: + nnIndex = new HierarchicalClusteringIndex(dataset, params, distance); + break; + case FLANN_INDEX_LSH: + nnIndex = new LshIndex(dataset, params, distance); + break; + default: + throw FLANNException("Unknown index type"); + } + + return nnIndex; + } +}; + +template +struct index_creator +{ + static NNIndex* create(const Matrix& dataset, const IndexParams& params, const Distance& distance) + { + flann_algorithm_t index_type = get_param(params, "algorithm"); + + NNIndex* nnIndex; + switch (index_type) { + case FLANN_INDEX_LINEAR: + nnIndex = new LinearIndex(dataset, params, distance); + break; + case FLANN_INDEX_HIERARCHICAL: + nnIndex = new HierarchicalClusteringIndex(dataset, params, distance); + break; + case FLANN_INDEX_LSH: + nnIndex = new LshIndex(dataset, params, distance); + break; + default: + throw FLANNException("Unknown index type"); + } + + return nnIndex; + } +}; + +template +NNIndex* create_index_by_type(const Matrix& dataset, const IndexParams& params, const Distance& distance) +{ + return index_creator::create(dataset, params,distance); +} + +} + +#endif /* OPENCV_FLANN_ALL_INDICES_H_ */ diff --git a/lib/opencv/include/opencv2/flann/allocator.h b/lib/opencv/include/opencv2/flann/allocator.h new file mode 100644 index 000000000..26091d0c7 --- /dev/null +++ b/lib/opencv/include/opencv2/flann/allocator.h @@ -0,0 +1,188 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_ALLOCATOR_H_ +#define OPENCV_FLANN_ALLOCATOR_H_ + +#include +#include + + +namespace cvflann +{ + +/** + * Allocates (using C's malloc) a generic type T. + * + * Params: + * count = number of instances to allocate. + * Returns: pointer (of type T*) to memory buffer + */ +template +T* allocate(size_t count = 1) +{ + T* mem = (T*) ::malloc(sizeof(T)*count); + return mem; +} + + +/** + * Pooled storage allocator + * + * The following routines allow for the efficient allocation of storage in + * small chunks from a specified pool. Rather than allowing each structure + * to be freed individually, an entire pool of storage is freed at once. + * This method has two advantages over just using malloc() and free(). First, + * it is far more efficient for allocating small objects, as there is + * no overhead for remembering all the information needed to free each + * object or consolidating fragmented memory. Second, the decision about + * how long to keep an object is made at the time of allocation, and there + * is no need to track down all the objects to free them. + * + */ + +const size_t WORDSIZE=16; +const size_t BLOCKSIZE=8192; + +class PooledAllocator +{ + /* We maintain memory alignment to word boundaries by requiring that all + allocations be in multiples of the machine wordsize. */ + /* Size of machine word in bytes. Must be power of 2. */ + /* Minimum number of bytes requested at a time from the system. Must be multiple of WORDSIZE. */ + + + int remaining; /* Number of bytes left in current block of storage. */ + void* base; /* Pointer to base of current block of storage. */ + void* loc; /* Current location in block to next allocate memory. */ + int blocksize; + + +public: + int usedMemory; + int wastedMemory; + + /** + Default constructor. Initializes a new pool. + */ + PooledAllocator(int blockSize = BLOCKSIZE) + { + blocksize = blockSize; + remaining = 0; + base = NULL; + + usedMemory = 0; + wastedMemory = 0; + } + + /** + * Destructor. Frees all the memory allocated in this pool. + */ + ~PooledAllocator() + { + void* prev; + + while (base != NULL) { + prev = *((void**) base); /* Get pointer to prev block. */ + ::free(base); + base = prev; + } + } + + /** + * Returns a pointer to a piece of new memory of the given size in bytes + * allocated from the pool. + */ + void* allocateMemory(int size) + { + int blockSize; + + /* Round size up to a multiple of wordsize. The following expression + only works for WORDSIZE that is a power of 2, by masking last bits of + incremented size to zero. + */ + size = (size + (WORDSIZE - 1)) & ~(WORDSIZE - 1); + + /* Check whether a new block must be allocated. Note that the first word + of a block is reserved for a pointer to the previous block. + */ + if (size > remaining) { + + wastedMemory += remaining; + + /* Allocate new storage. */ + blockSize = (size + sizeof(void*) + (WORDSIZE-1) > BLOCKSIZE) ? + size + sizeof(void*) + (WORDSIZE-1) : BLOCKSIZE; + + // use the standard C malloc to allocate memory + void* m = ::malloc(blockSize); + if (!m) { + fprintf(stderr,"Failed to allocate memory.\n"); + return NULL; + } + + /* Fill first word of new block with pointer to previous block. */ + ((void**) m)[0] = base; + base = m; + + int shift = 0; + //int shift = (WORDSIZE - ( (((size_t)m) + sizeof(void*)) & (WORDSIZE-1))) & (WORDSIZE-1); + + remaining = blockSize - sizeof(void*) - shift; + loc = ((char*)m + sizeof(void*) + shift); + } + void* rloc = loc; + loc = (char*)loc + size; + remaining -= size; + + usedMemory += size; + + return rloc; + } + + /** + * Allocates (using this pool) a generic type T. + * + * Params: + * count = number of instances to allocate. + * Returns: pointer (of type T*) to memory buffer + */ + template + T* allocate(size_t count = 1) + { + T* mem = (T*) this->allocateMemory((int)(sizeof(T)*count)); + return mem; + } + +}; + +} + +#endif //OPENCV_FLANN_ALLOCATOR_H_ diff --git a/lib/opencv/include/opencv2/flann/any.h b/lib/opencv/include/opencv2/flann/any.h new file mode 100644 index 000000000..8c2edaa7f --- /dev/null +++ b/lib/opencv/include/opencv2/flann/any.h @@ -0,0 +1,323 @@ +#ifndef OPENCV_FLANN_ANY_H_ +#define OPENCV_FLANN_ANY_H_ +/* + * (C) Copyright Christopher Diggins 2005-2011 + * (C) Copyright Pablo Aguilar 2005 + * (C) Copyright Kevlin Henney 2001 + * + * Distributed under the Boost Software License, Version 1.0. (See + * accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt + * + * Adapted for FLANN by Marius Muja + */ + +#include "defines.h" +#include +#include +#include + +namespace cvflann +{ + +namespace anyimpl +{ + +struct bad_any_cast +{ +}; + +struct empty_any +{ +}; + +inline std::ostream& operator <<(std::ostream& out, const empty_any&) +{ + out << "[empty_any]"; + return out; +} + +struct base_any_policy +{ + virtual void static_delete(void** x) = 0; + virtual void copy_from_value(void const* src, void** dest) = 0; + virtual void clone(void* const* src, void** dest) = 0; + virtual void move(void* const* src, void** dest) = 0; + virtual void* get_value(void** src) = 0; + virtual const void* get_value(void* const * src) = 0; + virtual ::size_t get_size() = 0; + virtual const std::type_info& type() = 0; + virtual void print(std::ostream& out, void* const* src) = 0; + virtual ~base_any_policy() {} +}; + +template +struct typed_base_any_policy : base_any_policy +{ + virtual ::size_t get_size() { return sizeof(T); } + virtual const std::type_info& type() { return typeid(T); } + +}; + +template +struct small_any_policy : typed_base_any_policy +{ + virtual void static_delete(void**) { } + virtual void copy_from_value(void const* src, void** dest) + { + new (dest) T(* reinterpret_cast(src)); + } + virtual void clone(void* const* src, void** dest) { *dest = *src; } + virtual void move(void* const* src, void** dest) { *dest = *src; } + virtual void* get_value(void** src) { return reinterpret_cast(src); } + virtual const void* get_value(void* const * src) { return reinterpret_cast(src); } + virtual void print(std::ostream& out, void* const* src) { out << *reinterpret_cast(src); } +}; + +template +struct big_any_policy : typed_base_any_policy +{ + virtual void static_delete(void** x) + { + if (* x) delete (* reinterpret_cast(x)); *x = NULL; + } + virtual void copy_from_value(void const* src, void** dest) + { + *dest = new T(*reinterpret_cast(src)); + } + virtual void clone(void* const* src, void** dest) + { + *dest = new T(**reinterpret_cast(src)); + } + virtual void move(void* const* src, void** dest) + { + (*reinterpret_cast(dest))->~T(); + **reinterpret_cast(dest) = **reinterpret_cast(src); + } + virtual void* get_value(void** src) { return *src; } + virtual const void* get_value(void* const * src) { return *src; } + virtual void print(std::ostream& out, void* const* src) { out << *reinterpret_cast(*src); } +}; + +template<> inline void big_any_policy::print(std::ostream& out, void* const* src) +{ + out << int(*reinterpret_cast(*src)); +} + +template<> inline void big_any_policy::print(std::ostream& out, void* const* src) +{ + out << int(*reinterpret_cast(*src)); +} + +template<> inline void big_any_policy::print(std::ostream& out, void* const* src) +{ + out << (*reinterpret_cast(*src)).c_str(); +} + +template +struct choose_policy +{ + typedef big_any_policy type; +}; + +template +struct choose_policy +{ + typedef small_any_policy type; +}; + +struct any; + +/// Choosing the policy for an any type is illegal, but should never happen. +/// This is designed to throw a compiler error. +template<> +struct choose_policy +{ + typedef void type; +}; + +/// Specializations for small types. +#define SMALL_POLICY(TYPE) \ + template<> \ + struct choose_policy { typedef small_any_policy type; \ + } + +SMALL_POLICY(signed char); +SMALL_POLICY(unsigned char); +SMALL_POLICY(signed short); +SMALL_POLICY(unsigned short); +SMALL_POLICY(signed int); +SMALL_POLICY(unsigned int); +SMALL_POLICY(signed long); +SMALL_POLICY(unsigned long); +SMALL_POLICY(float); +SMALL_POLICY(bool); + +#undef SMALL_POLICY + +template +class SinglePolicy +{ + SinglePolicy(); + SinglePolicy(const SinglePolicy& other); + SinglePolicy& operator=(const SinglePolicy& other); + +public: + static base_any_policy* get_policy(); + +private: + static typename choose_policy::type policy; +}; + +template +typename choose_policy::type SinglePolicy::policy; + +/// This function will return a different policy for each type. +template +inline base_any_policy* SinglePolicy::get_policy() { return &policy; } + +} // namespace anyimpl + +struct any +{ +private: + // fields + anyimpl::base_any_policy* policy; + void* object; + +public: + /// Initializing constructor. + template + any(const T& x) + : policy(anyimpl::SinglePolicy::get_policy()), object(NULL) + { + assign(x); + } + + /// Empty constructor. + any() + : policy(anyimpl::SinglePolicy::get_policy()), object(NULL) + { } + + /// Special initializing constructor for string literals. + any(const char* x) + : policy(anyimpl::SinglePolicy::get_policy()), object(NULL) + { + assign(x); + } + + /// Copy constructor. + any(const any& x) + : policy(anyimpl::SinglePolicy::get_policy()), object(NULL) + { + assign(x); + } + + /// Destructor. + ~any() + { + policy->static_delete(&object); + } + + /// Assignment function from another any. + any& assign(const any& x) + { + reset(); + policy = x.policy; + policy->clone(&x.object, &object); + return *this; + } + + /// Assignment function. + template + any& assign(const T& x) + { + reset(); + policy = anyimpl::SinglePolicy::get_policy(); + policy->copy_from_value(&x, &object); + return *this; + } + + /// Assignment operator. + template + any& operator=(const T& x) + { + return assign(x); + } + + /// Assignment operator, specialed for literal strings. + /// They have types like const char [6] which don't work as expected. + any& operator=(const char* x) + { + return assign(x); + } + + /// Utility functions + any& swap(any& x) + { + std::swap(policy, x.policy); + std::swap(object, x.object); + return *this; + } + + /// Cast operator. You can only cast to the original type. + template + T& cast() + { + if (policy->type() != typeid(T)) throw anyimpl::bad_any_cast(); + T* r = reinterpret_cast(policy->get_value(&object)); + return *r; + } + + /// Cast operator. You can only cast to the original type. + template + const T& cast() const + { + if (policy->type() != typeid(T)) throw anyimpl::bad_any_cast(); + const T* r = reinterpret_cast(policy->get_value(&object)); + return *r; + } + + /// Returns true if the any contains no value. + bool empty() const + { + return policy->type() == typeid(anyimpl::empty_any); + } + + /// Frees any allocated memory, and sets the value to NULL. + void reset() + { + policy->static_delete(&object); + policy = anyimpl::SinglePolicy::get_policy(); + } + + /// Returns true if the two types are the same. + bool compatible(const any& x) const + { + return policy->type() == x.policy->type(); + } + + /// Returns if the type is compatible with the policy + template + bool has_type() + { + return policy->type() == typeid(T); + } + + const std::type_info& type() const + { + return policy->type(); + } + + friend std::ostream& operator <<(std::ostream& out, const any& any_val); +}; + +inline std::ostream& operator <<(std::ostream& out, const any& any_val) +{ + any_val.policy->print(out,&any_val.object); + return out; +} + +} + +#endif // OPENCV_FLANN_ANY_H_ diff --git a/lib/opencv/include/opencv2/flann/autotuned_index.h b/lib/opencv/include/opencv2/flann/autotuned_index.h new file mode 100644 index 000000000..6ffb9297c --- /dev/null +++ b/lib/opencv/include/opencv2/flann/autotuned_index.h @@ -0,0 +1,588 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_AUTOTUNED_INDEX_H_ +#define OPENCV_FLANN_AUTOTUNED_INDEX_H_ + +#include "general.h" +#include "nn_index.h" +#include "ground_truth.h" +#include "index_testing.h" +#include "sampling.h" +#include "kdtree_index.h" +#include "kdtree_single_index.h" +#include "kmeans_index.h" +#include "composite_index.h" +#include "linear_index.h" +#include "logger.h" + +namespace cvflann +{ + +template +NNIndex* create_index_by_type(const Matrix& dataset, const IndexParams& params, const Distance& distance); + + +struct AutotunedIndexParams : public IndexParams +{ + AutotunedIndexParams(float target_precision = 0.8, float build_weight = 0.01, float memory_weight = 0, float sample_fraction = 0.1) + { + (*this)["algorithm"] = FLANN_INDEX_AUTOTUNED; + // precision desired (used for autotuning, -1 otherwise) + (*this)["target_precision"] = target_precision; + // build tree time weighting factor + (*this)["build_weight"] = build_weight; + // index memory weighting factor + (*this)["memory_weight"] = memory_weight; + // what fraction of the dataset to use for autotuning + (*this)["sample_fraction"] = sample_fraction; + } +}; + + +template +class AutotunedIndex : public NNIndex +{ +public: + typedef typename Distance::ElementType ElementType; + typedef typename Distance::ResultType DistanceType; + + AutotunedIndex(const Matrix& inputData, const IndexParams& params = AutotunedIndexParams(), Distance d = Distance()) : + dataset_(inputData), distance_(d) + { + target_precision_ = get_param(params, "target_precision",0.8f); + build_weight_ = get_param(params,"build_weight", 0.01f); + memory_weight_ = get_param(params, "memory_weight", 0.0f); + sample_fraction_ = get_param(params,"sample_fraction", 0.1f); + bestIndex_ = NULL; + } + + AutotunedIndex(const AutotunedIndex&); + AutotunedIndex& operator=(const AutotunedIndex&); + + virtual ~AutotunedIndex() + { + if (bestIndex_ != NULL) { + delete bestIndex_; + bestIndex_ = NULL; + } + } + + /** + * Method responsible with building the index. + */ + virtual void buildIndex() + { + std::ostringstream stream; + bestParams_ = estimateBuildParams(); + print_params(bestParams_, stream); + Logger::info("----------------------------------------------------\n"); + Logger::info("Autotuned parameters:\n"); + Logger::info("%s", stream.str().c_str()); + Logger::info("----------------------------------------------------\n"); + + bestIndex_ = create_index_by_type(dataset_, bestParams_, distance_); + bestIndex_->buildIndex(); + speedup_ = estimateSearchParams(bestSearchParams_); + stream.str(std::string()); + print_params(bestSearchParams_, stream); + Logger::info("----------------------------------------------------\n"); + Logger::info("Search parameters:\n"); + Logger::info("%s", stream.str().c_str()); + Logger::info("----------------------------------------------------\n"); + } + + /** + * Saves the index to a stream + */ + virtual void saveIndex(FILE* stream) + { + save_value(stream, (int)bestIndex_->getType()); + bestIndex_->saveIndex(stream); + save_value(stream, get_param(bestSearchParams_, "checks")); + } + + /** + * Loads the index from a stream + */ + virtual void loadIndex(FILE* stream) + { + int index_type; + + load_value(stream, index_type); + IndexParams params; + params["algorithm"] = (flann_algorithm_t)index_type; + bestIndex_ = create_index_by_type(dataset_, params, distance_); + bestIndex_->loadIndex(stream); + int checks; + load_value(stream, checks); + bestSearchParams_["checks"] = checks; + } + + /** + * Method that searches for nearest-neighbors + */ + virtual void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) + { + int checks = get_param(searchParams,"checks",FLANN_CHECKS_AUTOTUNED); + if (checks == FLANN_CHECKS_AUTOTUNED) { + bestIndex_->findNeighbors(result, vec, bestSearchParams_); + } + else { + bestIndex_->findNeighbors(result, vec, searchParams); + } + } + + + IndexParams getParameters() const + { + return bestIndex_->getParameters(); + } + + SearchParams getSearchParameters() const + { + return bestSearchParams_; + } + + float getSpeedup() const + { + return speedup_; + } + + + /** + * Number of features in this index. + */ + virtual size_t size() const + { + return bestIndex_->size(); + } + + /** + * The length of each vector in this index. + */ + virtual size_t veclen() const + { + return bestIndex_->veclen(); + } + + /** + * The amount of memory (in bytes) this index uses. + */ + virtual int usedMemory() const + { + return bestIndex_->usedMemory(); + } + + /** + * Algorithm name + */ + virtual flann_algorithm_t getType() const + { + return FLANN_INDEX_AUTOTUNED; + } + +private: + + struct CostData + { + float searchTimeCost; + float buildTimeCost; + float memoryCost; + float totalCost; + IndexParams params; + }; + + void evaluate_kmeans(CostData& cost) + { + StartStopTimer t; + int checks; + const int nn = 1; + + Logger::info("KMeansTree using params: max_iterations=%d, branching=%d\n", + get_param(cost.params,"iterations"), + get_param(cost.params,"branching")); + KMeansIndex kmeans(sampledDataset_, cost.params, distance_); + // measure index build time + t.start(); + kmeans.buildIndex(); + t.stop(); + float buildTime = (float)t.value; + + // measure search time + float searchTime = test_index_precision(kmeans, sampledDataset_, testDataset_, gt_matches_, target_precision_, checks, distance_, nn); + + float datasetMemory = float(sampledDataset_.rows * sampledDataset_.cols * sizeof(float)); + cost.memoryCost = (kmeans.usedMemory() + datasetMemory) / datasetMemory; + cost.searchTimeCost = searchTime; + cost.buildTimeCost = buildTime; + Logger::info("KMeansTree buildTime=%g, searchTime=%g, build_weight=%g\n", buildTime, searchTime, build_weight_); + } + + + void evaluate_kdtree(CostData& cost) + { + StartStopTimer t; + int checks; + const int nn = 1; + + Logger::info("KDTree using params: trees=%d\n", get_param(cost.params,"trees")); + KDTreeIndex kdtree(sampledDataset_, cost.params, distance_); + + t.start(); + kdtree.buildIndex(); + t.stop(); + float buildTime = (float)t.value; + + //measure search time + float searchTime = test_index_precision(kdtree, sampledDataset_, testDataset_, gt_matches_, target_precision_, checks, distance_, nn); + + float datasetMemory = float(sampledDataset_.rows * sampledDataset_.cols * sizeof(float)); + cost.memoryCost = (kdtree.usedMemory() + datasetMemory) / datasetMemory; + cost.searchTimeCost = searchTime; + cost.buildTimeCost = buildTime; + Logger::info("KDTree buildTime=%g, searchTime=%g\n", buildTime, searchTime); + } + + + // struct KMeansSimpleDownhillFunctor { + // + // Autotune& autotuner; + // KMeansSimpleDownhillFunctor(Autotune& autotuner_) : autotuner(autotuner_) {} + // + // float operator()(int* params) { + // + // float maxFloat = numeric_limits::max(); + // + // if (params[0]<2) return maxFloat; + // if (params[1]<0) return maxFloat; + // + // CostData c; + // c.params["algorithm"] = KMEANS; + // c.params["centers-init"] = CENTERS_RANDOM; + // c.params["branching"] = params[0]; + // c.params["max-iterations"] = params[1]; + // + // autotuner.evaluate_kmeans(c); + // + // return c.timeCost; + // + // } + // }; + // + // struct KDTreeSimpleDownhillFunctor { + // + // Autotune& autotuner; + // KDTreeSimpleDownhillFunctor(Autotune& autotuner_) : autotuner(autotuner_) {} + // + // float operator()(int* params) { + // float maxFloat = numeric_limits::max(); + // + // if (params[0]<1) return maxFloat; + // + // CostData c; + // c.params["algorithm"] = KDTREE; + // c.params["trees"] = params[0]; + // + // autotuner.evaluate_kdtree(c); + // + // return c.timeCost; + // + // } + // }; + + + + void optimizeKMeans(std::vector& costs) + { + Logger::info("KMEANS, Step 1: Exploring parameter space\n"); + + // explore kmeans parameters space using combinations of the parameters below + int maxIterations[] = { 1, 5, 10, 15 }; + int branchingFactors[] = { 16, 32, 64, 128, 256 }; + + int kmeansParamSpaceSize = FLANN_ARRAY_LEN(maxIterations) * FLANN_ARRAY_LEN(branchingFactors); + costs.reserve(costs.size() + kmeansParamSpaceSize); + + // evaluate kmeans for all parameter combinations + for (size_t i = 0; i < FLANN_ARRAY_LEN(maxIterations); ++i) { + for (size_t j = 0; j < FLANN_ARRAY_LEN(branchingFactors); ++j) { + CostData cost; + cost.params["algorithm"] = FLANN_INDEX_KMEANS; + cost.params["centers_init"] = FLANN_CENTERS_RANDOM; + cost.params["iterations"] = maxIterations[i]; + cost.params["branching"] = branchingFactors[j]; + + evaluate_kmeans(cost); + costs.push_back(cost); + } + } + + // Logger::info("KMEANS, Step 2: simplex-downhill optimization\n"); + // + // const int n = 2; + // // choose initial simplex points as the best parameters so far + // int kmeansNMPoints[n*(n+1)]; + // float kmeansVals[n+1]; + // for (int i=0;i& costs) + { + Logger::info("KD-TREE, Step 1: Exploring parameter space\n"); + + // explore kd-tree parameters space using the parameters below + int testTrees[] = { 1, 4, 8, 16, 32 }; + + // evaluate kdtree for all parameter combinations + for (size_t i = 0; i < FLANN_ARRAY_LEN(testTrees); ++i) { + CostData cost; + cost.params["algorithm"] = FLANN_INDEX_KDTREE; + cost.params["trees"] = testTrees[i]; + + evaluate_kdtree(cost); + costs.push_back(cost); + } + + // Logger::info("KD-TREE, Step 2: simplex-downhill optimization\n"); + // + // const int n = 1; + // // choose initial simplex points as the best parameters so far + // int kdtreeNMPoints[n*(n+1)]; + // float kdtreeVals[n+1]; + // for (int i=0;i costs; + + int sampleSize = int(sample_fraction_ * dataset_.rows); + int testSampleSize = std::min(sampleSize / 10, 1000); + + Logger::info("Entering autotuning, dataset size: %d, sampleSize: %d, testSampleSize: %d, target precision: %g\n", dataset_.rows, sampleSize, testSampleSize, target_precision_); + + // For a very small dataset, it makes no sense to build any fancy index, just + // use linear search + if (testSampleSize < 10) { + Logger::info("Choosing linear, dataset too small\n"); + return LinearIndexParams(); + } + + // We use a fraction of the original dataset to speedup the autotune algorithm + sampledDataset_ = random_sample(dataset_, sampleSize); + // We use a cross-validation approach, first we sample a testset from the dataset + testDataset_ = random_sample(sampledDataset_, testSampleSize, true); + + // We compute the ground truth using linear search + Logger::info("Computing ground truth... \n"); + gt_matches_ = Matrix(new int[testDataset_.rows], testDataset_.rows, 1); + StartStopTimer t; + t.start(); + compute_ground_truth(sampledDataset_, testDataset_, gt_matches_, 0, distance_); + t.stop(); + + CostData linear_cost; + linear_cost.searchTimeCost = (float)t.value; + linear_cost.buildTimeCost = 0; + linear_cost.memoryCost = 0; + linear_cost.params["algorithm"] = FLANN_INDEX_LINEAR; + + costs.push_back(linear_cost); + + // Start parameter autotune process + Logger::info("Autotuning parameters...\n"); + + optimizeKMeans(costs); + optimizeKDTree(costs); + + float bestTimeCost = costs[0].searchTimeCost; + for (size_t i = 0; i < costs.size(); ++i) { + float timeCost = costs[i].buildTimeCost * build_weight_ + costs[i].searchTimeCost; + if (timeCost < bestTimeCost) { + bestTimeCost = timeCost; + } + } + + float bestCost = costs[0].searchTimeCost / bestTimeCost; + IndexParams bestParams = costs[0].params; + if (bestTimeCost > 0) { + for (size_t i = 0; i < costs.size(); ++i) { + float crtCost = (costs[i].buildTimeCost * build_weight_ + costs[i].searchTimeCost) / bestTimeCost + + memory_weight_ * costs[i].memoryCost; + if (crtCost < bestCost) { + bestCost = crtCost; + bestParams = costs[i].params; + } + } + } + + delete[] gt_matches_.data; + delete[] testDataset_.data; + delete[] sampledDataset_.data; + + return bestParams; + } + + + + /** + * Estimates the search time parameters needed to get the desired precision. + * Precondition: the index is built + * Postcondition: the searchParams will have the optimum params set, also the speedup obtained over linear search. + */ + float estimateSearchParams(SearchParams& searchParams) + { + const int nn = 1; + const size_t SAMPLE_COUNT = 1000; + + assert(bestIndex_ != NULL); // must have a valid index + + float speedup = 0; + + int samples = (int)std::min(dataset_.rows / 10, SAMPLE_COUNT); + if (samples > 0) { + Matrix testDataset = random_sample(dataset_, samples); + + Logger::info("Computing ground truth\n"); + + // we need to compute the ground truth first + Matrix gt_matches(new int[testDataset.rows], testDataset.rows, 1); + StartStopTimer t; + t.start(); + compute_ground_truth(dataset_, testDataset, gt_matches, 1, distance_); + t.stop(); + float linear = (float)t.value; + + int checks; + Logger::info("Estimating number of checks\n"); + + float searchTime; + float cb_index; + if (bestIndex_->getType() == FLANN_INDEX_KMEANS) { + Logger::info("KMeans algorithm, estimating cluster border factor\n"); + KMeansIndex* kmeans = (KMeansIndex*)bestIndex_; + float bestSearchTime = -1; + float best_cb_index = -1; + int best_checks = -1; + for (cb_index = 0; cb_index < 1.1f; cb_index += 0.2f) { + kmeans->set_cb_index(cb_index); + searchTime = test_index_precision(*kmeans, dataset_, testDataset, gt_matches, target_precision_, checks, distance_, nn, 1); + if ((searchTime < bestSearchTime) || (bestSearchTime == -1)) { + bestSearchTime = searchTime; + best_cb_index = cb_index; + best_checks = checks; + } + } + searchTime = bestSearchTime; + cb_index = best_cb_index; + checks = best_checks; + + kmeans->set_cb_index(best_cb_index); + Logger::info("Optimum cb_index: %g\n", cb_index); + bestParams_["cb_index"] = cb_index; + } + else { + searchTime = test_index_precision(*bestIndex_, dataset_, testDataset, gt_matches, target_precision_, checks, distance_, nn, 1); + } + + Logger::info("Required number of checks: %d \n", checks); + searchParams["checks"] = checks; + + speedup = linear / searchTime; + + delete[] gt_matches.data; + delete[] testDataset.data; + } + + return speedup; + } + +private: + NNIndex* bestIndex_; + + IndexParams bestParams_; + SearchParams bestSearchParams_; + + Matrix sampledDataset_; + Matrix testDataset_; + Matrix gt_matches_; + + float speedup_; + + /** + * The dataset used by this index + */ + const Matrix dataset_; + + /** + * Index parameters + */ + float target_precision_; + float build_weight_; + float memory_weight_; + float sample_fraction_; + + Distance distance_; + + +}; +} + +#endif /* OPENCV_FLANN_AUTOTUNED_INDEX_H_ */ diff --git a/lib/opencv/include/opencv2/flann/composite_index.h b/lib/opencv/include/opencv2/flann/composite_index.h new file mode 100644 index 000000000..527ca1ad7 --- /dev/null +++ b/lib/opencv/include/opencv2/flann/composite_index.h @@ -0,0 +1,194 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_COMPOSITE_INDEX_H_ +#define OPENCV_FLANN_COMPOSITE_INDEX_H_ + +#include "general.h" +#include "nn_index.h" +#include "kdtree_index.h" +#include "kmeans_index.h" + +namespace cvflann +{ + +/** + * Index parameters for the CompositeIndex. + */ +struct CompositeIndexParams : public IndexParams +{ + CompositeIndexParams(int trees = 4, int branching = 32, int iterations = 11, + flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM, float cb_index = 0.2 ) + { + (*this)["algorithm"] = FLANN_INDEX_KMEANS; + // number of randomized trees to use (for kdtree) + (*this)["trees"] = trees; + // branching factor + (*this)["branching"] = branching; + // max iterations to perform in one kmeans clustering (kmeans tree) + (*this)["iterations"] = iterations; + // algorithm used for picking the initial cluster centers for kmeans tree + (*this)["centers_init"] = centers_init; + // cluster boundary index. Used when searching the kmeans tree + (*this)["cb_index"] = cb_index; + } +}; + + +/** + * This index builds a kd-tree index and a k-means index and performs nearest + * neighbour search both indexes. This gives a slight boost in search performance + * as some of the neighbours that are missed by one index are found by the other. + */ +template +class CompositeIndex : public NNIndex +{ +public: + typedef typename Distance::ElementType ElementType; + typedef typename Distance::ResultType DistanceType; + + /** + * Index constructor + * @param inputData dataset containing the points to index + * @param params Index parameters + * @param d Distance functor + * @return + */ + CompositeIndex(const Matrix& inputData, const IndexParams& params = CompositeIndexParams(), + Distance d = Distance()) : index_params_(params) + { + kdtree_index_ = new KDTreeIndex(inputData, params, d); + kmeans_index_ = new KMeansIndex(inputData, params, d); + + } + + CompositeIndex(const CompositeIndex&); + CompositeIndex& operator=(const CompositeIndex&); + + virtual ~CompositeIndex() + { + delete kdtree_index_; + delete kmeans_index_; + } + + /** + * @return The index type + */ + flann_algorithm_t getType() const + { + return FLANN_INDEX_COMPOSITE; + } + + /** + * @return Size of the index + */ + size_t size() const + { + return kdtree_index_->size(); + } + + /** + * \returns The dimensionality of the features in this index. + */ + size_t veclen() const + { + return kdtree_index_->veclen(); + } + + /** + * \returns The amount of memory (in bytes) used by the index. + */ + int usedMemory() const + { + return kmeans_index_->usedMemory() + kdtree_index_->usedMemory(); + } + + /** + * \brief Builds the index + */ + void buildIndex() + { + Logger::info("Building kmeans tree...\n"); + kmeans_index_->buildIndex(); + Logger::info("Building kdtree tree...\n"); + kdtree_index_->buildIndex(); + } + + /** + * \brief Saves the index to a stream + * \param stream The stream to save the index to + */ + void saveIndex(FILE* stream) + { + kmeans_index_->saveIndex(stream); + kdtree_index_->saveIndex(stream); + } + + /** + * \brief Loads the index from a stream + * \param stream The stream from which the index is loaded + */ + void loadIndex(FILE* stream) + { + kmeans_index_->loadIndex(stream); + kdtree_index_->loadIndex(stream); + } + + /** + * \returns The index parameters + */ + IndexParams getParameters() const + { + return index_params_; + } + + /** + * \brief Method that searches for nearest-neighbours + */ + void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) + { + kmeans_index_->findNeighbors(result, vec, searchParams); + kdtree_index_->findNeighbors(result, vec, searchParams); + } + +private: + /** The k-means index */ + KMeansIndex* kmeans_index_; + + /** The kd-tree index */ + KDTreeIndex* kdtree_index_; + + /** The index parameters */ + const IndexParams index_params_; +}; + +} + +#endif //OPENCV_FLANN_COMPOSITE_INDEX_H_ diff --git a/lib/opencv/include/opencv2/flann/config.h b/lib/opencv/include/opencv2/flann/config.h new file mode 100644 index 000000000..56832fd37 --- /dev/null +++ b/lib/opencv/include/opencv2/flann/config.h @@ -0,0 +1,38 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_CONFIG_H_ +#define OPENCV_FLANN_CONFIG_H_ + +#ifdef FLANN_VERSION_ +#undef FLANN_VERSION_ +#endif +#define FLANN_VERSION_ "1.6.10" + +#endif /* OPENCV_FLANN_CONFIG_H_ */ diff --git a/lib/opencv/include/opencv2/flann/defines.h b/lib/opencv/include/opencv2/flann/defines.h new file mode 100644 index 000000000..f0264f74e --- /dev/null +++ b/lib/opencv/include/opencv2/flann/defines.h @@ -0,0 +1,177 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_DEFINES_H_ +#define OPENCV_FLANN_DEFINES_H_ + +#include "config.h" + +#ifdef FLANN_EXPORT +#undef FLANN_EXPORT +#endif +#ifdef WIN32 +/* win32 dll export/import directives */ + #ifdef FLANN_EXPORTS + #define FLANN_EXPORT __declspec(dllexport) + #elif defined(FLANN_STATIC) + #define FLANN_EXPORT + #else + #define FLANN_EXPORT __declspec(dllimport) + #endif +#else +/* unix needs nothing */ + #define FLANN_EXPORT +#endif + + +#ifdef FLANN_DEPRECATED +#undef FLANN_DEPRECATED +#endif +#ifdef __GNUC__ +#define FLANN_DEPRECATED __attribute__ ((deprecated)) +#elif defined(_MSC_VER) +#define FLANN_DEPRECATED __declspec(deprecated) +#else +#pragma message("WARNING: You need to implement FLANN_DEPRECATED for this compiler") +#define FLANN_DEPRECATED +#endif + + +#undef FLANN_PLATFORM_32_BIT +#undef FLANN_PLATFORM_64_BIT +#if defined __amd64__ || defined __x86_64__ || defined _WIN64 || defined _M_X64 +#define FLANN_PLATFORM_64_BIT +#else +#define FLANN_PLATFORM_32_BIT +#endif + + +#undef FLANN_ARRAY_LEN +#define FLANN_ARRAY_LEN(a) (sizeof(a)/sizeof(a[0])) + +namespace cvflann { + +/* Nearest neighbour index algorithms */ +enum flann_algorithm_t +{ + FLANN_INDEX_LINEAR = 0, + FLANN_INDEX_KDTREE = 1, + FLANN_INDEX_KMEANS = 2, + FLANN_INDEX_COMPOSITE = 3, + FLANN_INDEX_KDTREE_SINGLE = 4, + FLANN_INDEX_HIERARCHICAL = 5, + FLANN_INDEX_LSH = 6, + FLANN_INDEX_SAVED = 254, + FLANN_INDEX_AUTOTUNED = 255, + + // deprecated constants, should use the FLANN_INDEX_* ones instead + LINEAR = 0, + KDTREE = 1, + KMEANS = 2, + COMPOSITE = 3, + KDTREE_SINGLE = 4, + SAVED = 254, + AUTOTUNED = 255 +}; + + + +enum flann_centers_init_t +{ + FLANN_CENTERS_RANDOM = 0, + FLANN_CENTERS_GONZALES = 1, + FLANN_CENTERS_KMEANSPP = 2, + FLANN_CENTERS_GROUPWISE = 3, + + // deprecated constants, should use the FLANN_CENTERS_* ones instead + CENTERS_RANDOM = 0, + CENTERS_GONZALES = 1, + CENTERS_KMEANSPP = 2 +}; + +enum flann_log_level_t +{ + FLANN_LOG_NONE = 0, + FLANN_LOG_FATAL = 1, + FLANN_LOG_ERROR = 2, + FLANN_LOG_WARN = 3, + FLANN_LOG_INFO = 4 +}; + +enum flann_distance_t +{ + FLANN_DIST_EUCLIDEAN = 1, + FLANN_DIST_L2 = 1, + FLANN_DIST_MANHATTAN = 2, + FLANN_DIST_L1 = 2, + FLANN_DIST_MINKOWSKI = 3, + FLANN_DIST_MAX = 4, + FLANN_DIST_HIST_INTERSECT = 5, + FLANN_DIST_HELLINGER = 6, + FLANN_DIST_CHI_SQUARE = 7, + FLANN_DIST_CS = 7, + FLANN_DIST_KULLBACK_LEIBLER = 8, + FLANN_DIST_KL = 8, + FLANN_DIST_HAMMING = 9, + + // deprecated constants, should use the FLANN_DIST_* ones instead + EUCLIDEAN = 1, + MANHATTAN = 2, + MINKOWSKI = 3, + MAX_DIST = 4, + HIST_INTERSECT = 5, + HELLINGER = 6, + CS = 7, + KL = 8, + KULLBACK_LEIBLER = 8 +}; + +enum flann_datatype_t +{ + FLANN_INT8 = 0, + FLANN_INT16 = 1, + FLANN_INT32 = 2, + FLANN_INT64 = 3, + FLANN_UINT8 = 4, + FLANN_UINT16 = 5, + FLANN_UINT32 = 6, + FLANN_UINT64 = 7, + FLANN_FLOAT32 = 8, + FLANN_FLOAT64 = 9 +}; + +enum +{ + FLANN_CHECKS_UNLIMITED = -1, + FLANN_CHECKS_AUTOTUNED = -2 +}; + +} + +#endif /* OPENCV_FLANN_DEFINES_H_ */ diff --git a/lib/opencv/include/opencv2/flann/dist.h b/lib/opencv/include/opencv2/flann/dist.h new file mode 100644 index 000000000..9dbe5278d --- /dev/null +++ b/lib/opencv/include/opencv2/flann/dist.h @@ -0,0 +1,905 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_DIST_H_ +#define OPENCV_FLANN_DIST_H_ + +#include +#include +#include +#ifdef _MSC_VER +typedef unsigned __int32 uint32_t; +typedef unsigned __int64 uint64_t; +#else +#include +#endif + +#include "defines.h" + +#if (defined WIN32 || defined _WIN32) && defined(_M_ARM) +# include +#endif + +#ifdef __ARM_NEON__ +# include "arm_neon.h" +#endif + +namespace cvflann +{ + +template +inline T abs(T x) { return (x<0) ? -x : x; } + +template<> +inline int abs(int x) { return ::abs(x); } + +template<> +inline float abs(float x) { return fabsf(x); } + +template<> +inline double abs(double x) { return fabs(x); } + +template +struct Accumulator { typedef T Type; }; +template<> +struct Accumulator { typedef float Type; }; +template<> +struct Accumulator { typedef float Type; }; +template<> +struct Accumulator { typedef float Type; }; +template<> +struct Accumulator { typedef float Type; }; +template<> +struct Accumulator { typedef float Type; }; +template<> +struct Accumulator { typedef float Type; }; + +#undef True +#undef False + +class True +{ +}; + +class False +{ +}; + + +/** + * Squared Euclidean distance functor. + * + * This is the simpler, unrolled version. This is preferable for + * very low dimensionality data (eg 3D points) + */ +template +struct L2_Simple +{ + typedef True is_kdtree_distance; + typedef True is_vector_space_distance; + + typedef T ElementType; + typedef typename Accumulator::Type ResultType; + + template + ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const + { + ResultType result = ResultType(); + ResultType diff; + for(size_t i = 0; i < size; ++i ) { + diff = *a++ - *b++; + result += diff*diff; + } + return result; + } + + template + inline ResultType accum_dist(const U& a, const V& b, int) const + { + return (a-b)*(a-b); + } +}; + + + +/** + * Squared Euclidean distance functor, optimized version + */ +template +struct L2 +{ + typedef True is_kdtree_distance; + typedef True is_vector_space_distance; + + typedef T ElementType; + typedef typename Accumulator::Type ResultType; + + /** + * Compute the squared Euclidean distance between two vectors. + * + * This is highly optimised, with loop unrolling, as it is one + * of the most expensive inner loops. + * + * The computation of squared root at the end is omitted for + * efficiency. + */ + template + ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const + { + ResultType result = ResultType(); + ResultType diff0, diff1, diff2, diff3; + Iterator1 last = a + size; + Iterator1 lastgroup = last - 3; + + /* Process 4 items with each loop for efficiency. */ + while (a < lastgroup) { + diff0 = (ResultType)(a[0] - b[0]); + diff1 = (ResultType)(a[1] - b[1]); + diff2 = (ResultType)(a[2] - b[2]); + diff3 = (ResultType)(a[3] - b[3]); + result += diff0 * diff0 + diff1 * diff1 + diff2 * diff2 + diff3 * diff3; + a += 4; + b += 4; + + if ((worst_dist>0)&&(result>worst_dist)) { + return result; + } + } + /* Process last 0-3 pixels. Not needed for standard vector lengths. */ + while (a < last) { + diff0 = (ResultType)(*a++ - *b++); + result += diff0 * diff0; + } + return result; + } + + /** + * Partial euclidean distance, using just one dimension. This is used by the + * kd-tree when computing partial distances while traversing the tree. + * + * Squared root is omitted for efficiency. + */ + template + inline ResultType accum_dist(const U& a, const V& b, int) const + { + return (a-b)*(a-b); + } +}; + + +/* + * Manhattan distance functor, optimized version + */ +template +struct L1 +{ + typedef True is_kdtree_distance; + typedef True is_vector_space_distance; + + typedef T ElementType; + typedef typename Accumulator::Type ResultType; + + /** + * Compute the Manhattan (L_1) distance between two vectors. + * + * This is highly optimised, with loop unrolling, as it is one + * of the most expensive inner loops. + */ + template + ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const + { + ResultType result = ResultType(); + ResultType diff0, diff1, diff2, diff3; + Iterator1 last = a + size; + Iterator1 lastgroup = last - 3; + + /* Process 4 items with each loop for efficiency. */ + while (a < lastgroup) { + diff0 = (ResultType)abs(a[0] - b[0]); + diff1 = (ResultType)abs(a[1] - b[1]); + diff2 = (ResultType)abs(a[2] - b[2]); + diff3 = (ResultType)abs(a[3] - b[3]); + result += diff0 + diff1 + diff2 + diff3; + a += 4; + b += 4; + + if ((worst_dist>0)&&(result>worst_dist)) { + return result; + } + } + /* Process last 0-3 pixels. Not needed for standard vector lengths. */ + while (a < last) { + diff0 = (ResultType)abs(*a++ - *b++); + result += diff0; + } + return result; + } + + /** + * Partial distance, used by the kd-tree. + */ + template + inline ResultType accum_dist(const U& a, const V& b, int) const + { + return abs(a-b); + } +}; + + + +template +struct MinkowskiDistance +{ + typedef True is_kdtree_distance; + typedef True is_vector_space_distance; + + typedef T ElementType; + typedef typename Accumulator::Type ResultType; + + int order; + + MinkowskiDistance(int order_) : order(order_) {} + + /** + * Compute the Minkowsky (L_p) distance between two vectors. + * + * This is highly optimised, with loop unrolling, as it is one + * of the most expensive inner loops. + * + * The computation of squared root at the end is omitted for + * efficiency. + */ + template + ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const + { + ResultType result = ResultType(); + ResultType diff0, diff1, diff2, diff3; + Iterator1 last = a + size; + Iterator1 lastgroup = last - 3; + + /* Process 4 items with each loop for efficiency. */ + while (a < lastgroup) { + diff0 = (ResultType)abs(a[0] - b[0]); + diff1 = (ResultType)abs(a[1] - b[1]); + diff2 = (ResultType)abs(a[2] - b[2]); + diff3 = (ResultType)abs(a[3] - b[3]); + result += pow(diff0,order) + pow(diff1,order) + pow(diff2,order) + pow(diff3,order); + a += 4; + b += 4; + + if ((worst_dist>0)&&(result>worst_dist)) { + return result; + } + } + /* Process last 0-3 pixels. Not needed for standard vector lengths. */ + while (a < last) { + diff0 = (ResultType)abs(*a++ - *b++); + result += pow(diff0,order); + } + return result; + } + + /** + * Partial distance, used by the kd-tree. + */ + template + inline ResultType accum_dist(const U& a, const V& b, int) const + { + return pow(static_cast(abs(a-b)),order); + } +}; + + + +template +struct MaxDistance +{ + typedef False is_kdtree_distance; + typedef True is_vector_space_distance; + + typedef T ElementType; + typedef typename Accumulator::Type ResultType; + + /** + * Compute the max distance (L_infinity) between two vectors. + * + * This distance is not a valid kdtree distance, it's not dimensionwise additive. + */ + template + ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const + { + ResultType result = ResultType(); + ResultType diff0, diff1, diff2, diff3; + Iterator1 last = a + size; + Iterator1 lastgroup = last - 3; + + /* Process 4 items with each loop for efficiency. */ + while (a < lastgroup) { + diff0 = abs(a[0] - b[0]); + diff1 = abs(a[1] - b[1]); + diff2 = abs(a[2] - b[2]); + diff3 = abs(a[3] - b[3]); + if (diff0>result) {result = diff0; } + if (diff1>result) {result = diff1; } + if (diff2>result) {result = diff2; } + if (diff3>result) {result = diff3; } + a += 4; + b += 4; + + if ((worst_dist>0)&&(result>worst_dist)) { + return result; + } + } + /* Process last 0-3 pixels. Not needed for standard vector lengths. */ + while (a < last) { + diff0 = abs(*a++ - *b++); + result = (diff0>result) ? diff0 : result; + } + return result; + } + + /* This distance functor is not dimension-wise additive, which + * makes it an invalid kd-tree distance, not implementing the accum_dist method */ + +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * Hamming distance functor - counts the bit differences between two strings - useful for the Brief descriptor + * bit count of A exclusive XOR'ed with B + */ +struct HammingLUT +{ + typedef False is_kdtree_distance; + typedef False is_vector_space_distance; + + typedef unsigned char ElementType; + typedef int ResultType; + + /** this will count the bits in a ^ b + */ + ResultType operator()(const unsigned char* a, const unsigned char* b, size_t size) const + { + static const uchar popCountTable[] = + { + 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 + }; + ResultType result = 0; + for (size_t i = 0; i < size; i++) { + result += popCountTable[a[i] ^ b[i]]; + } + return result; + } +}; + +/** + * Hamming distance functor (pop count between two binary vectors, i.e. xor them and count the number of bits set) + * That code was taken from brief.cpp in OpenCV + */ +template +struct Hamming +{ + typedef False is_kdtree_distance; + typedef False is_vector_space_distance; + + + typedef T ElementType; + typedef int ResultType; + + template + ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const + { + ResultType result = 0; +#ifdef __ARM_NEON__ + { + uint32x4_t bits = vmovq_n_u32(0); + for (size_t i = 0; i < size; i += 16) { + uint8x16_t A_vec = vld1q_u8 (a + i); + uint8x16_t B_vec = vld1q_u8 (b + i); + uint8x16_t AxorB = veorq_u8 (A_vec, B_vec); + uint8x16_t bitsSet = vcntq_u8 (AxorB); + uint16x8_t bitSet8 = vpaddlq_u8 (bitsSet); + uint32x4_t bitSet4 = vpaddlq_u16 (bitSet8); + bits = vaddq_u32(bits, bitSet4); + } + uint64x2_t bitSet2 = vpaddlq_u32 (bits); + result = vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),0); + result += vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),2); + } +#elif __GNUC__ + { + //for portability just use unsigned long -- and use the __builtin_popcountll (see docs for __builtin_popcountll) + typedef unsigned long long pop_t; + const size_t modulo = size % sizeof(pop_t); + const pop_t* a2 = reinterpret_cast (a); + const pop_t* b2 = reinterpret_cast (b); + const pop_t* a2_end = a2 + (size / sizeof(pop_t)); + + for (; a2 != a2_end; ++a2, ++b2) result += __builtin_popcountll((*a2) ^ (*b2)); + + if (modulo) { + //in the case where size is not dividable by sizeof(size_t) + //need to mask off the bits at the end + pop_t a_final = 0, b_final = 0; + memcpy(&a_final, a2, modulo); + memcpy(&b_final, b2, modulo); + result += __builtin_popcountll(a_final ^ b_final); + } + } +#else // NO NEON and NOT GNUC + typedef unsigned long long pop_t; + HammingLUT lut; + result = lut(reinterpret_cast (a), + reinterpret_cast (b), size * sizeof(pop_t)); +#endif + return result; + } +}; + +template +struct Hamming2 +{ + typedef False is_kdtree_distance; + typedef False is_vector_space_distance; + + typedef T ElementType; + typedef int ResultType; + + /** This is popcount_3() from: + * http://en.wikipedia.org/wiki/Hamming_weight */ + unsigned int popcnt32(uint32_t n) const + { + n -= ((n >> 1) & 0x55555555); + n = (n & 0x33333333) + ((n >> 2) & 0x33333333); + return (((n + (n >> 4))& 0xF0F0F0F)* 0x1010101) >> 24; + } + +#ifdef FLANN_PLATFORM_64_BIT + unsigned int popcnt64(uint64_t n) const + { + n -= ((n >> 1) & 0x5555555555555555); + n = (n & 0x3333333333333333) + ((n >> 2) & 0x3333333333333333); + return (((n + (n >> 4))& 0x0f0f0f0f0f0f0f0f)* 0x0101010101010101) >> 56; + } +#endif + + template + ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const + { +#ifdef FLANN_PLATFORM_64_BIT + const uint64_t* pa = reinterpret_cast(a); + const uint64_t* pb = reinterpret_cast(b); + ResultType result = 0; + size /= (sizeof(uint64_t)/sizeof(unsigned char)); + for(size_t i = 0; i < size; ++i ) { + result += popcnt64(*pa ^ *pb); + ++pa; + ++pb; + } +#else + const uint32_t* pa = reinterpret_cast(a); + const uint32_t* pb = reinterpret_cast(b); + ResultType result = 0; + size /= (sizeof(uint32_t)/sizeof(unsigned char)); + for(size_t i = 0; i < size; ++i ) { + result += popcnt32(*pa ^ *pb); + ++pa; + ++pb; + } +#endif + return result; + } +}; + + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +template +struct HistIntersectionDistance +{ + typedef True is_kdtree_distance; + typedef True is_vector_space_distance; + + typedef T ElementType; + typedef typename Accumulator::Type ResultType; + + /** + * Compute the histogram intersection distance + */ + template + ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const + { + ResultType result = ResultType(); + ResultType min0, min1, min2, min3; + Iterator1 last = a + size; + Iterator1 lastgroup = last - 3; + + /* Process 4 items with each loop for efficiency. */ + while (a < lastgroup) { + min0 = (ResultType)(a[0] < b[0] ? a[0] : b[0]); + min1 = (ResultType)(a[1] < b[1] ? a[1] : b[1]); + min2 = (ResultType)(a[2] < b[2] ? a[2] : b[2]); + min3 = (ResultType)(a[3] < b[3] ? a[3] : b[3]); + result += min0 + min1 + min2 + min3; + a += 4; + b += 4; + if ((worst_dist>0)&&(result>worst_dist)) { + return result; + } + } + /* Process last 0-3 pixels. Not needed for standard vector lengths. */ + while (a < last) { + min0 = (ResultType)(*a < *b ? *a : *b); + result += min0; + ++a; + ++b; + } + return result; + } + + /** + * Partial distance, used by the kd-tree. + */ + template + inline ResultType accum_dist(const U& a, const V& b, int) const + { + return a +struct HellingerDistance +{ + typedef True is_kdtree_distance; + typedef True is_vector_space_distance; + + typedef T ElementType; + typedef typename Accumulator::Type ResultType; + + /** + * Compute the Hellinger distance + */ + template + ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const + { + ResultType result = ResultType(); + ResultType diff0, diff1, diff2, diff3; + Iterator1 last = a + size; + Iterator1 lastgroup = last - 3; + + /* Process 4 items with each loop for efficiency. */ + while (a < lastgroup) { + diff0 = sqrt(static_cast(a[0])) - sqrt(static_cast(b[0])); + diff1 = sqrt(static_cast(a[1])) - sqrt(static_cast(b[1])); + diff2 = sqrt(static_cast(a[2])) - sqrt(static_cast(b[2])); + diff3 = sqrt(static_cast(a[3])) - sqrt(static_cast(b[3])); + result += diff0 * diff0 + diff1 * diff1 + diff2 * diff2 + diff3 * diff3; + a += 4; + b += 4; + } + while (a < last) { + diff0 = sqrt(static_cast(*a++)) - sqrt(static_cast(*b++)); + result += diff0 * diff0; + } + return result; + } + + /** + * Partial distance, used by the kd-tree. + */ + template + inline ResultType accum_dist(const U& a, const V& b, int) const + { + ResultType diff = sqrt(static_cast(a)) - sqrt(static_cast(b)); + return diff * diff; + } +}; + + +template +struct ChiSquareDistance +{ + typedef True is_kdtree_distance; + typedef True is_vector_space_distance; + + typedef T ElementType; + typedef typename Accumulator::Type ResultType; + + /** + * Compute the chi-square distance + */ + template + ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const + { + ResultType result = ResultType(); + ResultType sum, diff; + Iterator1 last = a + size; + + while (a < last) { + sum = (ResultType)(*a + *b); + if (sum>0) { + diff = (ResultType)(*a - *b); + result += diff*diff/sum; + } + ++a; + ++b; + + if ((worst_dist>0)&&(result>worst_dist)) { + return result; + } + } + return result; + } + + /** + * Partial distance, used by the kd-tree. + */ + template + inline ResultType accum_dist(const U& a, const V& b, int) const + { + ResultType result = ResultType(); + ResultType sum, diff; + + sum = (ResultType)(a+b); + if (sum>0) { + diff = (ResultType)(a-b); + result = diff*diff/sum; + } + return result; + } +}; + + +template +struct KL_Divergence +{ + typedef True is_kdtree_distance; + typedef True is_vector_space_distance; + + typedef T ElementType; + typedef typename Accumulator::Type ResultType; + + /** + * Compute the Kullback–Leibler divergence + */ + template + ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const + { + ResultType result = ResultType(); + Iterator1 last = a + size; + + while (a < last) { + if (* b != 0) { + ResultType ratio = (ResultType)(*a / *b); + if (ratio>0) { + result += *a * log(ratio); + } + } + ++a; + ++b; + + if ((worst_dist>0)&&(result>worst_dist)) { + return result; + } + } + return result; + } + + /** + * Partial distance, used by the kd-tree. + */ + template + inline ResultType accum_dist(const U& a, const V& b, int) const + { + ResultType result = ResultType(); + if( *b != 0 ) { + ResultType ratio = (ResultType)(a / b); + if (ratio>0) { + result = a * log(ratio); + } + } + return result; + } +}; + + + +/* + * This is a "zero iterator". It basically behaves like a zero filled + * array to all algorithms that use arrays as iterators (STL style). + * It's useful when there's a need to compute the distance between feature + * and origin it and allows for better compiler optimisation than using a + * zero-filled array. + */ +template +struct ZeroIterator +{ + + T operator*() + { + return 0; + } + + T operator[](int) + { + return 0; + } + + const ZeroIterator& operator ++() + { + return *this; + } + + ZeroIterator operator ++(int) + { + return *this; + } + + ZeroIterator& operator+=(int) + { + return *this; + } + +}; + + +/* + * Depending on processed distances, some of them are already squared (e.g. L2) + * and some are not (e.g.Hamming). In KMeans++ for instance we want to be sure + * we are working on ^2 distances, thus following templates to ensure that. + */ +template +struct squareDistance +{ + typedef typename Distance::ResultType ResultType; + ResultType operator()( ResultType dist ) { return dist*dist; } +}; + + +template +struct squareDistance, ElementType> +{ + typedef typename L2_Simple::ResultType ResultType; + ResultType operator()( ResultType dist ) { return dist; } +}; + +template +struct squareDistance, ElementType> +{ + typedef typename L2::ResultType ResultType; + ResultType operator()( ResultType dist ) { return dist; } +}; + + +template +struct squareDistance, ElementType> +{ + typedef typename MinkowskiDistance::ResultType ResultType; + ResultType operator()( ResultType dist ) { return dist; } +}; + +template +struct squareDistance, ElementType> +{ + typedef typename HellingerDistance::ResultType ResultType; + ResultType operator()( ResultType dist ) { return dist; } +}; + +template +struct squareDistance, ElementType> +{ + typedef typename ChiSquareDistance::ResultType ResultType; + ResultType operator()( ResultType dist ) { return dist; } +}; + + +template +typename Distance::ResultType ensureSquareDistance( typename Distance::ResultType dist ) +{ + typedef typename Distance::ElementType ElementType; + + squareDistance dummy; + return dummy( dist ); +} + + +/* + * ...and a template to ensure the user that he will process the normal distance, + * and not squared distance, without loosing processing time calling sqrt(ensureSquareDistance) + * that will result in doing actually sqrt(dist*dist) for L1 distance for instance. + */ +template +struct simpleDistance +{ + typedef typename Distance::ResultType ResultType; + ResultType operator()( ResultType dist ) { return dist; } +}; + + +template +struct simpleDistance, ElementType> +{ + typedef typename L2_Simple::ResultType ResultType; + ResultType operator()( ResultType dist ) { return sqrt(dist); } +}; + +template +struct simpleDistance, ElementType> +{ + typedef typename L2::ResultType ResultType; + ResultType operator()( ResultType dist ) { return sqrt(dist); } +}; + + +template +struct simpleDistance, ElementType> +{ + typedef typename MinkowskiDistance::ResultType ResultType; + ResultType operator()( ResultType dist ) { return sqrt(dist); } +}; + +template +struct simpleDistance, ElementType> +{ + typedef typename HellingerDistance::ResultType ResultType; + ResultType operator()( ResultType dist ) { return sqrt(dist); } +}; + +template +struct simpleDistance, ElementType> +{ + typedef typename ChiSquareDistance::ResultType ResultType; + ResultType operator()( ResultType dist ) { return sqrt(dist); } +}; + + +template +typename Distance::ResultType ensureSimpleDistance( typename Distance::ResultType dist ) +{ + typedef typename Distance::ElementType ElementType; + + simpleDistance dummy; + return dummy( dist ); +} + +} + +#endif //OPENCV_FLANN_DIST_H_ diff --git a/lib/opencv/include/opencv2/flann/dummy.h b/lib/opencv/include/opencv2/flann/dummy.h new file mode 100644 index 000000000..26bd3fa5d --- /dev/null +++ b/lib/opencv/include/opencv2/flann/dummy.h @@ -0,0 +1,16 @@ + +#ifndef OPENCV_FLANN_DUMMY_H_ +#define OPENCV_FLANN_DUMMY_H_ + +namespace cvflann +{ + +#if (defined WIN32 || defined _WIN32 || defined WINCE) && defined CVAPI_EXPORTS +__declspec(dllexport) +#endif +void dummyfunc(); + +} + + +#endif /* OPENCV_FLANN_DUMMY_H_ */ diff --git a/lib/opencv/include/opencv2/flann/dynamic_bitset.h b/lib/opencv/include/opencv2/flann/dynamic_bitset.h new file mode 100644 index 000000000..d795b5d6e --- /dev/null +++ b/lib/opencv/include/opencv2/flann/dynamic_bitset.h @@ -0,0 +1,159 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + *************************************************************************/ + +/*********************************************************************** + * Author: Vincent Rabaud + *************************************************************************/ + +#ifndef OPENCV_FLANN_DYNAMIC_BITSET_H_ +#define OPENCV_FLANN_DYNAMIC_BITSET_H_ + +#ifndef FLANN_USE_BOOST +# define FLANN_USE_BOOST 0 +#endif +//#define FLANN_USE_BOOST 1 +#if FLANN_USE_BOOST +#include +typedef boost::dynamic_bitset<> DynamicBitset; +#else + +#include + +#include "dist.h" + +namespace cvflann { + +/** Class re-implementing the boost version of it + * This helps not depending on boost, it also does not do the bound checks + * and has a way to reset a block for speed + */ +class DynamicBitset +{ +public: + /** default constructor + */ + DynamicBitset() + { + } + + /** only constructor we use in our code + * @param sz the size of the bitset (in bits) + */ + DynamicBitset(size_t sz) + { + resize(sz); + reset(); + } + + /** Sets all the bits to 0 + */ + void clear() + { + std::fill(bitset_.begin(), bitset_.end(), 0); + } + + /** @brief checks if the bitset is empty + * @return true if the bitset is empty + */ + bool empty() const + { + return bitset_.empty(); + } + + /** set all the bits to 0 + */ + void reset() + { + std::fill(bitset_.begin(), bitset_.end(), 0); + } + + /** @brief set one bit to 0 + * @param index + */ + void reset(size_t index) + { + bitset_[index / cell_bit_size_] &= ~(size_t(1) << (index % cell_bit_size_)); + } + + /** @brief sets a specific bit to 0, and more bits too + * This function is useful when resetting a given set of bits so that the + * whole bitset ends up being 0: if that's the case, we don't care about setting + * other bits to 0 + * @param index + */ + void reset_block(size_t index) + { + bitset_[index / cell_bit_size_] = 0; + } + + /** resize the bitset so that it contains at least sz bits + * @param sz + */ + void resize(size_t sz) + { + size_ = sz; + bitset_.resize(sz / cell_bit_size_ + 1); + } + + /** set a bit to true + * @param index the index of the bit to set to 1 + */ + void set(size_t index) + { + bitset_[index / cell_bit_size_] |= size_t(1) << (index % cell_bit_size_); + } + + /** gives the number of contained bits + */ + size_t size() const + { + return size_; + } + + /** check if a bit is set + * @param index the index of the bit to check + * @return true if the bit is set + */ + bool test(size_t index) const + { + return (bitset_[index / cell_bit_size_] & (size_t(1) << (index % cell_bit_size_))) != 0; + } + +private: + std::vector bitset_; + size_t size_; + static const unsigned int cell_bit_size_ = CHAR_BIT * sizeof(size_t); +}; + +} // namespace cvflann + +#endif + +#endif // OPENCV_FLANN_DYNAMIC_BITSET_H_ diff --git a/lib/opencv/include/opencv2/flann/flann.hpp b/lib/opencv/include/opencv2/flann/flann.hpp new file mode 100644 index 000000000..227683f97 --- /dev/null +++ b/lib/opencv/include/opencv2/flann/flann.hpp @@ -0,0 +1,48 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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*/ + +#ifdef __OPENCV_BUILD +#error this is a compatibility header which should not be used inside the OpenCV library +#endif + +#include "opencv2/flann.hpp" diff --git a/lib/opencv/include/opencv2/flann/flann_base.hpp b/lib/opencv/include/opencv2/flann/flann_base.hpp new file mode 100644 index 000000000..98c33cf6c --- /dev/null +++ b/lib/opencv/include/opencv2/flann/flann_base.hpp @@ -0,0 +1,290 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_BASE_HPP_ +#define OPENCV_FLANN_BASE_HPP_ + +#include +#include +#include + +#include "general.h" +#include "matrix.h" +#include "params.h" +#include "saving.h" + +#include "all_indices.h" + +namespace cvflann +{ + +/** + * Sets the log level used for all flann functions + * @param level Verbosity level + */ +inline void log_verbosity(int level) +{ + if (level >= 0) { + Logger::setLevel(level); + } +} + +/** + * (Deprecated) Index parameters for creating a saved index. + */ +struct SavedIndexParams : public IndexParams +{ + SavedIndexParams(cv::String filename) + { + (* this)["algorithm"] = FLANN_INDEX_SAVED; + (*this)["filename"] = filename; + } +}; + + +template +NNIndex* load_saved_index(const Matrix& dataset, const cv::String& filename, Distance distance) +{ + typedef typename Distance::ElementType ElementType; + + FILE* fin = fopen(filename.c_str(), "rb"); + if (fin == NULL) { + return NULL; + } + IndexHeader header = load_header(fin); + if (header.data_type != Datatype::type()) { + throw FLANNException("Datatype of saved index is different than of the one to be created."); + } + if ((size_t(header.rows) != dataset.rows)||(size_t(header.cols) != dataset.cols)) { + throw FLANNException("The index saved belongs to a different dataset"); + } + + IndexParams params; + params["algorithm"] = header.index_type; + NNIndex* nnIndex = create_index_by_type(dataset, params, distance); + nnIndex->loadIndex(fin); + fclose(fin); + + return nnIndex; +} + + +template +class Index : public NNIndex +{ +public: + typedef typename Distance::ElementType ElementType; + typedef typename Distance::ResultType DistanceType; + + Index(const Matrix& features, const IndexParams& params, Distance distance = Distance() ) + : index_params_(params) + { + flann_algorithm_t index_type = get_param(params,"algorithm"); + loaded_ = false; + + if (index_type == FLANN_INDEX_SAVED) { + nnIndex_ = load_saved_index(features, get_param(params,"filename"), distance); + loaded_ = true; + } + else { + nnIndex_ = create_index_by_type(features, params, distance); + } + } + + ~Index() + { + delete nnIndex_; + } + + /** + * Builds the index. + */ + void buildIndex() + { + if (!loaded_) { + nnIndex_->buildIndex(); + } + } + + void save(cv::String filename) + { + FILE* fout = fopen(filename.c_str(), "wb"); + if (fout == NULL) { + throw FLANNException("Cannot open file"); + } + save_header(fout, *nnIndex_); + saveIndex(fout); + fclose(fout); + } + + /** + * \brief Saves the index to a stream + * \param stream The stream to save the index to + */ + virtual void saveIndex(FILE* stream) + { + nnIndex_->saveIndex(stream); + } + + /** + * \brief Loads the index from a stream + * \param stream The stream from which the index is loaded + */ + virtual void loadIndex(FILE* stream) + { + nnIndex_->loadIndex(stream); + } + + /** + * \returns number of features in this index. + */ + size_t veclen() const + { + return nnIndex_->veclen(); + } + + /** + * \returns The dimensionality of the features in this index. + */ + size_t size() const + { + return nnIndex_->size(); + } + + /** + * \returns The index type (kdtree, kmeans,...) + */ + flann_algorithm_t getType() const + { + return nnIndex_->getType(); + } + + /** + * \returns The amount of memory (in bytes) used by the index. + */ + virtual int usedMemory() const + { + return nnIndex_->usedMemory(); + } + + + /** + * \returns The index parameters + */ + IndexParams getParameters() const + { + return nnIndex_->getParameters(); + } + + /** + * \brief Perform k-nearest neighbor search + * \param[in] queries The query points for which to find the nearest neighbors + * \param[out] indices The indices of the nearest neighbors found + * \param[out] dists Distances to the nearest neighbors found + * \param[in] knn Number of nearest neighbors to return + * \param[in] params Search parameters + */ + void knnSearch(const Matrix& queries, Matrix& indices, Matrix& dists, int knn, const SearchParams& params) + { + nnIndex_->knnSearch(queries, indices, dists, knn, params); + } + + /** + * \brief Perform radius search + * \param[in] query The query point + * \param[out] indices The indinces of the neighbors found within the given radius + * \param[out] dists The distances to the nearest neighbors found + * \param[in] radius The radius used for search + * \param[in] params Search parameters + * \returns Number of neighbors found + */ + int radiusSearch(const Matrix& query, Matrix& indices, Matrix& dists, float radius, const SearchParams& params) + { + return nnIndex_->radiusSearch(query, indices, dists, radius, params); + } + + /** + * \brief Method that searches for nearest-neighbours + */ + void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) + { + nnIndex_->findNeighbors(result, vec, searchParams); + } + + /** + * \brief Returns actual index + */ + FLANN_DEPRECATED NNIndex* getIndex() + { + return nnIndex_; + } + + /** + * \brief Returns index parameters. + * \deprecated use getParameters() instead. + */ + FLANN_DEPRECATED const IndexParams* getIndexParameters() + { + return &index_params_; + } + +private: + /** Pointer to actual index class */ + NNIndex* nnIndex_; + /** Indices if the index was loaded from a file */ + bool loaded_; + /** Parameters passed to the index */ + IndexParams index_params_; +}; + +/** + * Performs a hierarchical clustering of the points passed as argument and then takes a cut in the + * the clustering tree to return a flat clustering. + * @param[in] points Points to be clustered + * @param centers The computed cluster centres. Matrix should be preallocated and centers.rows is the + * number of clusters requested. + * @param params Clustering parameters (The same as for cvflann::KMeansIndex) + * @param d Distance to be used for clustering (eg: cvflann::L2) + * @return number of clusters computed (can be different than clusters.rows and is the highest number + * of the form (branching-1)*K+1 smaller than clusters.rows). + */ +template +int hierarchicalClustering(const Matrix& points, Matrix& centers, + const KMeansIndexParams& params, Distance d = Distance()) +{ + KMeansIndex kmeans(points, params, d); + kmeans.buildIndex(); + + int clusterNum = kmeans.getClusterCenters(centers); + return clusterNum; +} + +} +#endif /* OPENCV_FLANN_BASE_HPP_ */ diff --git a/lib/opencv/include/opencv2/flann/general.h b/lib/opencv/include/opencv2/flann/general.h new file mode 100644 index 000000000..9d5402a6f --- /dev/null +++ b/lib/opencv/include/opencv2/flann/general.h @@ -0,0 +1,50 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_GENERAL_H_ +#define OPENCV_FLANN_GENERAL_H_ + +#include "opencv2/core.hpp" + +namespace cvflann +{ + +class FLANNException : public cv::Exception +{ +public: + FLANNException(const char* message) : cv::Exception(0, message, "", __FILE__, __LINE__) { } + + FLANNException(const cv::String& message) : cv::Exception(0, message, "", __FILE__, __LINE__) { } +}; + +} + + +#endif /* OPENCV_FLANN_GENERAL_H_ */ diff --git a/lib/opencv/include/opencv2/flann/ground_truth.h b/lib/opencv/include/opencv2/flann/ground_truth.h new file mode 100644 index 000000000..fd8f3ae7f --- /dev/null +++ b/lib/opencv/include/opencv2/flann/ground_truth.h @@ -0,0 +1,94 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_GROUND_TRUTH_H_ +#define OPENCV_FLANN_GROUND_TRUTH_H_ + +#include "dist.h" +#include "matrix.h" + + +namespace cvflann +{ + +template +void find_nearest(const Matrix& dataset, typename Distance::ElementType* query, int* matches, int nn, + int skip = 0, Distance distance = Distance()) +{ + typedef typename Distance::ResultType DistanceType; + int n = nn + skip; + + std::vector match(n); + std::vector dists(n); + + dists[0] = distance(dataset[0], query, dataset.cols); + match[0] = 0; + int dcnt = 1; + + for (size_t i=1; i=1 && dists[j] +void compute_ground_truth(const Matrix& dataset, const Matrix& testset, Matrix& matches, + int skip=0, Distance d = Distance()) +{ + for (size_t i=0; i(dataset, testset[i], matches[i], (int)matches.cols, skip, d); + } +} + + +} + +#endif //OPENCV_FLANN_GROUND_TRUTH_H_ diff --git a/lib/opencv/include/opencv2/flann/hdf5.h b/lib/opencv/include/opencv2/flann/hdf5.h new file mode 100644 index 000000000..80d23b977 --- /dev/null +++ b/lib/opencv/include/opencv2/flann/hdf5.h @@ -0,0 +1,231 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_HDF5_H_ +#define OPENCV_FLANN_HDF5_H_ + +#include + +#include "matrix.h" + + +namespace cvflann +{ + +namespace +{ + +template +hid_t get_hdf5_type() +{ + throw FLANNException("Unsupported type for IO operations"); +} + +template<> +hid_t get_hdf5_type() { return H5T_NATIVE_CHAR; } +template<> +hid_t get_hdf5_type() { return H5T_NATIVE_UCHAR; } +template<> +hid_t get_hdf5_type() { return H5T_NATIVE_SHORT; } +template<> +hid_t get_hdf5_type() { return H5T_NATIVE_USHORT; } +template<> +hid_t get_hdf5_type() { return H5T_NATIVE_INT; } +template<> +hid_t get_hdf5_type() { return H5T_NATIVE_UINT; } +template<> +hid_t get_hdf5_type() { return H5T_NATIVE_LONG; } +template<> +hid_t get_hdf5_type() { return H5T_NATIVE_ULONG; } +template<> +hid_t get_hdf5_type() { return H5T_NATIVE_FLOAT; } +template<> +hid_t get_hdf5_type() { return H5T_NATIVE_DOUBLE; } +} + + +#define CHECK_ERROR(x,y) if ((x)<0) throw FLANNException((y)); + +template +void save_to_file(const cvflann::Matrix& dataset, const String& filename, const String& name) +{ + +#if H5Eset_auto_vers == 2 + H5Eset_auto( H5E_DEFAULT, NULL, NULL ); +#else + H5Eset_auto( NULL, NULL ); +#endif + + herr_t status; + hid_t file_id; + file_id = H5Fopen(filename.c_str(), H5F_ACC_RDWR, H5P_DEFAULT); + if (file_id < 0) { + file_id = H5Fcreate(filename.c_str(), H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT); + } + CHECK_ERROR(file_id,"Error creating hdf5 file."); + + hsize_t dimsf[2]; // dataset dimensions + dimsf[0] = dataset.rows; + dimsf[1] = dataset.cols; + + hid_t space_id = H5Screate_simple(2, dimsf, NULL); + hid_t memspace_id = H5Screate_simple(2, dimsf, NULL); + + hid_t dataset_id; +#if H5Dcreate_vers == 2 + dataset_id = H5Dcreate2(file_id, name.c_str(), get_hdf5_type(), space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); +#else + dataset_id = H5Dcreate(file_id, name.c_str(), get_hdf5_type(), space_id, H5P_DEFAULT); +#endif + + if (dataset_id<0) { +#if H5Dopen_vers == 2 + dataset_id = H5Dopen2(file_id, name.c_str(), H5P_DEFAULT); +#else + dataset_id = H5Dopen(file_id, name.c_str()); +#endif + } + CHECK_ERROR(dataset_id,"Error creating or opening dataset in file."); + + status = H5Dwrite(dataset_id, get_hdf5_type(), memspace_id, space_id, H5P_DEFAULT, dataset.data ); + CHECK_ERROR(status, "Error writing to dataset"); + + H5Sclose(memspace_id); + H5Sclose(space_id); + H5Dclose(dataset_id); + H5Fclose(file_id); + +} + + +template +void load_from_file(cvflann::Matrix& dataset, const String& filename, const String& name) +{ + herr_t status; + hid_t file_id = H5Fopen(filename.c_str(), H5F_ACC_RDWR, H5P_DEFAULT); + CHECK_ERROR(file_id,"Error opening hdf5 file."); + + hid_t dataset_id; +#if H5Dopen_vers == 2 + dataset_id = H5Dopen2(file_id, name.c_str(), H5P_DEFAULT); +#else + dataset_id = H5Dopen(file_id, name.c_str()); +#endif + CHECK_ERROR(dataset_id,"Error opening dataset in file."); + + hid_t space_id = H5Dget_space(dataset_id); + + hsize_t dims_out[2]; + H5Sget_simple_extent_dims(space_id, dims_out, NULL); + + dataset = cvflann::Matrix(new T[dims_out[0]*dims_out[1]], dims_out[0], dims_out[1]); + + status = H5Dread(dataset_id, get_hdf5_type(), H5S_ALL, H5S_ALL, H5P_DEFAULT, dataset[0]); + CHECK_ERROR(status, "Error reading dataset"); + + H5Sclose(space_id); + H5Dclose(dataset_id); + H5Fclose(file_id); +} + + +#ifdef HAVE_MPI + +namespace mpi +{ +/** + * Loads a the hyperslice corresponding to this processor from a hdf5 file. + * @param flann_dataset Dataset where the data is loaded + * @param filename HDF5 file name + * @param name Name of dataset inside file + */ +template +void load_from_file(cvflann::Matrix& dataset, const String& filename, const String& name) +{ + MPI_Comm comm = MPI_COMM_WORLD; + MPI_Info info = MPI_INFO_NULL; + + int mpi_size, mpi_rank; + MPI_Comm_size(comm, &mpi_size); + MPI_Comm_rank(comm, &mpi_rank); + + herr_t status; + + hid_t plist_id = H5Pcreate(H5P_FILE_ACCESS); + H5Pset_fapl_mpio(plist_id, comm, info); + hid_t file_id = H5Fopen(filename.c_str(), H5F_ACC_RDWR, plist_id); + CHECK_ERROR(file_id,"Error opening hdf5 file."); + H5Pclose(plist_id); + hid_t dataset_id; +#if H5Dopen_vers == 2 + dataset_id = H5Dopen2(file_id, name.c_str(), H5P_DEFAULT); +#else + dataset_id = H5Dopen(file_id, name.c_str()); +#endif + CHECK_ERROR(dataset_id,"Error opening dataset in file."); + + hid_t space_id = H5Dget_space(dataset_id); + hsize_t dims[2]; + H5Sget_simple_extent_dims(space_id, dims, NULL); + + hsize_t count[2]; + hsize_t offset[2]; + + hsize_t item_cnt = dims[0]/mpi_size+(dims[0]%mpi_size==0 ? 0 : 1); + hsize_t cnt = (mpi_rank(), memspace_id, space_id, plist_id, dataset.data); + CHECK_ERROR(status, "Error reading dataset"); + + H5Pclose(plist_id); + H5Sclose(space_id); + H5Sclose(memspace_id); + H5Dclose(dataset_id); + H5Fclose(file_id); +} +} +#endif // HAVE_MPI +} // namespace cvflann::mpi + +#endif /* OPENCV_FLANN_HDF5_H_ */ diff --git a/lib/opencv/include/opencv2/flann/heap.h b/lib/opencv/include/opencv2/flann/heap.h new file mode 100644 index 000000000..92a6ea614 --- /dev/null +++ b/lib/opencv/include/opencv2/flann/heap.h @@ -0,0 +1,165 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_HEAP_H_ +#define OPENCV_FLANN_HEAP_H_ + +#include +#include + +namespace cvflann +{ + +/** + * Priority Queue Implementation + * + * The priority queue is implemented with a heap. A heap is a complete + * (full) binary tree in which each parent is less than both of its + * children, but the order of the children is unspecified. + */ +template +class Heap +{ + + /** + * Storage array for the heap. + * Type T must be comparable. + */ + std::vector heap; + int length; + + /** + * Number of element in the heap + */ + int count; + + + +public: + /** + * Constructor. + * + * Params: + * sz = heap size + */ + + Heap(int sz) + { + length = sz; + heap.reserve(length); + count = 0; + } + + /** + * + * Returns: heap size + */ + int size() + { + return count; + } + + /** + * Tests if the heap is empty + * + * Returns: true is heap empty, false otherwise + */ + bool empty() + { + return size()==0; + } + + /** + * Clears the heap. + */ + void clear() + { + heap.clear(); + count = 0; + } + + struct CompareT + { + bool operator()(const T& t_1, const T& t_2) const + { + return t_2 < t_1; + } + }; + + /** + * Insert a new element in the heap. + * + * We select the next empty leaf node, and then keep moving any larger + * parents down until the right location is found to store this element. + * + * Params: + * value = the new element to be inserted in the heap + */ + void insert(T value) + { + /* If heap is full, then return without adding this element. */ + if (count == length) { + return; + } + + heap.push_back(value); + static CompareT compareT; + std::push_heap(heap.begin(), heap.end(), compareT); + ++count; + } + + + + /** + * Returns the node of minimum value from the heap (top of the heap). + * + * Params: + * value = out parameter used to return the min element + * Returns: false if heap empty + */ + bool popMin(T& value) + { + if (count == 0) { + return false; + } + + value = heap[0]; + static CompareT compareT; + std::pop_heap(heap.begin(), heap.end(), compareT); + heap.pop_back(); + --count; + + return true; /* Return old last node. */ + } +}; + +} + +#endif //OPENCV_FLANN_HEAP_H_ diff --git a/lib/opencv/include/opencv2/flann/hierarchical_clustering_index.h b/lib/opencv/include/opencv2/flann/hierarchical_clustering_index.h new file mode 100644 index 000000000..9d890d4d6 --- /dev/null +++ b/lib/opencv/include/opencv2/flann/hierarchical_clustering_index.h @@ -0,0 +1,848 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_HIERARCHICAL_CLUSTERING_INDEX_H_ +#define OPENCV_FLANN_HIERARCHICAL_CLUSTERING_INDEX_H_ + +#include +#include +#include +#include +#include + +#include "general.h" +#include "nn_index.h" +#include "dist.h" +#include "matrix.h" +#include "result_set.h" +#include "heap.h" +#include "allocator.h" +#include "random.h" +#include "saving.h" + + +namespace cvflann +{ + +struct HierarchicalClusteringIndexParams : public IndexParams +{ + HierarchicalClusteringIndexParams(int branching = 32, + flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM, + int trees = 4, int leaf_size = 100) + { + (*this)["algorithm"] = FLANN_INDEX_HIERARCHICAL; + // The branching factor used in the hierarchical clustering + (*this)["branching"] = branching; + // Algorithm used for picking the initial cluster centers + (*this)["centers_init"] = centers_init; + // number of parallel trees to build + (*this)["trees"] = trees; + // maximum leaf size + (*this)["leaf_size"] = leaf_size; + } +}; + + +/** + * Hierarchical index + * + * Contains a tree constructed through a hierarchical clustering + * and other information for indexing a set of points for nearest-neighbour matching. + */ +template +class HierarchicalClusteringIndex : public NNIndex +{ +public: + typedef typename Distance::ElementType ElementType; + typedef typename Distance::ResultType DistanceType; + +private: + + + typedef void (HierarchicalClusteringIndex::* centersAlgFunction)(int, int*, int, int*, int&); + + /** + * The function used for choosing the cluster centers. + */ + centersAlgFunction chooseCenters; + + + + /** + * Chooses the initial centers in the k-means clustering in a random manner. + * + * Params: + * k = number of centers + * vecs = the dataset of points + * indices = indices in the dataset + * indices_length = length of indices vector + * + */ + void chooseCentersRandom(int k, int* dsindices, int indices_length, int* centers, int& centers_length) + { + UniqueRandom r(indices_length); + + int index; + for (index=0; index=0 && rnd < n); + + centers[0] = dsindices[rnd]; + + int index; + for (index=1; indexbest_val) { + best_val = dist; + best_index = j; + } + } + if (best_index!=-1) { + centers[index] = dsindices[best_index]; + } + else { + break; + } + } + centers_length = index; + } + + + /** + * Chooses the initial centers in the k-means using the algorithm + * proposed in the KMeans++ paper: + * Arthur, David; Vassilvitskii, Sergei - k-means++: The Advantages of Careful Seeding + * + * Implementation of this function was converted from the one provided in Arthur's code. + * + * Params: + * k = number of centers + * vecs = the dataset of points + * indices = indices in the dataset + * Returns: + */ + void chooseCentersKMeanspp(int k, int* dsindices, int indices_length, int* centers, int& centers_length) + { + int n = indices_length; + + double currentPot = 0; + DistanceType* closestDistSq = new DistanceType[n]; + + // Choose one random center and set the closestDistSq values + int index = rand_int(n); + assert(index >=0 && index < n); + centers[0] = dsindices[index]; + + // Computing distance^2 will have the advantage of even higher probability further to pick new centers + // far from previous centers (and this complies to "k-means++: the advantages of careful seeding" article) + for (int i = 0; i < n; i++) { + closestDistSq[i] = distance(dataset[dsindices[i]], dataset[dsindices[index]], dataset.cols); + closestDistSq[i] = ensureSquareDistance( closestDistSq[i] ); + currentPot += closestDistSq[i]; + } + + + const int numLocalTries = 1; + + // Choose each center + int centerCount; + for (centerCount = 1; centerCount < k; centerCount++) { + + // Repeat several trials + double bestNewPot = -1; + int bestNewIndex = 0; + for (int localTrial = 0; localTrial < numLocalTries; localTrial++) { + + // Choose our center - have to be slightly careful to return a valid answer even accounting + // for possible rounding errors + double randVal = rand_double(currentPot); + for (index = 0; index < n-1; index++) { + if (randVal <= closestDistSq[index]) break; + else randVal -= closestDistSq[index]; + } + + // Compute the new potential + double newPot = 0; + for (int i = 0; i < n; i++) { + DistanceType dist = distance(dataset[dsindices[i]], dataset[dsindices[index]], dataset.cols); + newPot += std::min( ensureSquareDistance(dist), closestDistSq[i] ); + } + + // Store the best result + if ((bestNewPot < 0)||(newPot < bestNewPot)) { + bestNewPot = newPot; + bestNewIndex = index; + } + } + + // Add the appropriate center + centers[centerCount] = dsindices[bestNewIndex]; + currentPot = bestNewPot; + for (int i = 0; i < n; i++) { + DistanceType dist = distance(dataset[dsindices[i]], dataset[dsindices[bestNewIndex]], dataset.cols); + closestDistSq[i] = std::min( ensureSquareDistance(dist), closestDistSq[i] ); + } + } + + centers_length = centerCount; + + delete[] closestDistSq; + } + + + /** + * Chooses the initial centers in a way inspired by Gonzales (by Pierre-Emmanuel Viel): + * select the first point of the list as a candidate, then parse the points list. If another + * point is further than current candidate from the other centers, test if it is a good center + * of a local aggregation. If it is, replace current candidate by this point. And so on... + * + * Used with KMeansIndex that computes centers coordinates by averaging positions of clusters points, + * this doesn't make a real difference with previous methods. But used with HierarchicalClusteringIndex + * class that pick centers among existing points instead of computing the barycenters, there is a real + * improvement. + * + * Params: + * k = number of centers + * vecs = the dataset of points + * indices = indices in the dataset + * Returns: + */ + void GroupWiseCenterChooser(int k, int* dsindices, int indices_length, int* centers, int& centers_length) + { + const float kSpeedUpFactor = 1.3f; + + int n = indices_length; + + DistanceType* closestDistSq = new DistanceType[n]; + + // Choose one random center and set the closestDistSq values + int index = rand_int(n); + assert(index >=0 && index < n); + centers[0] = dsindices[index]; + + for (int i = 0; i < n; i++) { + closestDistSq[i] = distance(dataset[dsindices[i]], dataset[dsindices[index]], dataset.cols); + } + + + // Choose each center + int centerCount; + for (centerCount = 1; centerCount < k; centerCount++) { + + // Repeat several trials + double bestNewPot = -1; + int bestNewIndex = 0; + DistanceType furthest = 0; + for (index = 0; index < n; index++) { + + // We will test only the potential of the points further than current candidate + if( closestDistSq[index] > kSpeedUpFactor * (float)furthest ) { + + // Compute the new potential + double newPot = 0; + for (int i = 0; i < n; i++) { + newPot += std::min( distance(dataset[dsindices[i]], dataset[dsindices[index]], dataset.cols) + , closestDistSq[i] ); + } + + // Store the best result + if ((bestNewPot < 0)||(newPot <= bestNewPot)) { + bestNewPot = newPot; + bestNewIndex = index; + furthest = closestDistSq[index]; + } + } + } + + // Add the appropriate center + centers[centerCount] = dsindices[bestNewIndex]; + for (int i = 0; i < n; i++) { + closestDistSq[i] = std::min( distance(dataset[dsindices[i]], dataset[dsindices[bestNewIndex]], dataset.cols) + , closestDistSq[i] ); + } + } + + centers_length = centerCount; + + delete[] closestDistSq; + } + + +public: + + + /** + * Index constructor + * + * Params: + * inputData = dataset with the input features + * params = parameters passed to the hierarchical k-means algorithm + */ + HierarchicalClusteringIndex(const Matrix& inputData, const IndexParams& index_params = HierarchicalClusteringIndexParams(), + Distance d = Distance()) + : dataset(inputData), params(index_params), root(NULL), indices(NULL), distance(d) + { + memoryCounter = 0; + + size_ = dataset.rows; + veclen_ = dataset.cols; + + branching_ = get_param(params,"branching",32); + centers_init_ = get_param(params,"centers_init", FLANN_CENTERS_RANDOM); + trees_ = get_param(params,"trees",4); + leaf_size_ = get_param(params,"leaf_size",100); + + if (centers_init_==FLANN_CENTERS_RANDOM) { + chooseCenters = &HierarchicalClusteringIndex::chooseCentersRandom; + } + else if (centers_init_==FLANN_CENTERS_GONZALES) { + chooseCenters = &HierarchicalClusteringIndex::chooseCentersGonzales; + } + else if (centers_init_==FLANN_CENTERS_KMEANSPP) { + chooseCenters = &HierarchicalClusteringIndex::chooseCentersKMeanspp; + } + else if (centers_init_==FLANN_CENTERS_GROUPWISE) { + chooseCenters = &HierarchicalClusteringIndex::GroupWiseCenterChooser; + } + else { + throw FLANNException("Unknown algorithm for choosing initial centers."); + } + + trees_ = get_param(params,"trees",4); + root = new NodePtr[trees_]; + indices = new int*[trees_]; + + for (int i=0; i(); + computeClustering(root[i], indices[i], (int)size_, branching_,0); + } + } + + + flann_algorithm_t getType() const + { + return FLANN_INDEX_HIERARCHICAL; + } + + + void saveIndex(FILE* stream) + { + save_value(stream, branching_); + save_value(stream, trees_); + save_value(stream, centers_init_); + save_value(stream, leaf_size_); + save_value(stream, memoryCounter); + for (int i=0; i& result, const ElementType* vec, const SearchParams& searchParams) + { + + int maxChecks = get_param(searchParams,"checks",32); + + // Priority queue storing intermediate branches in the best-bin-first search + Heap* heap = new Heap((int)size_); + + std::vector checked(size_,false); + int checks = 0; + for (int i=0; ipopMin(branch) && (checks BranchSt; + + + + void save_tree(FILE* stream, NodePtr node, int num) + { + save_value(stream, *node); + if (node->childs==NULL) { + int indices_offset = (int)(node->indices - indices[num]); + save_value(stream, indices_offset); + } + else { + for(int i=0; ichilds[i], num); + } + } + } + + + void load_tree(FILE* stream, NodePtr& node, int num) + { + node = pool.allocate(); + load_value(stream, *node); + if (node->childs==NULL) { + int indices_offset; + load_value(stream, indices_offset); + node->indices = indices[num] + indices_offset; + } + else { + node->childs = pool.allocate(branching_); + for(int i=0; ichilds[i], num); + } + } + } + + + + + void computeLabels(int* dsindices, int indices_length, int* centers, int centers_length, int* labels, DistanceType& cost) + { + cost = 0; + for (int i=0; inew_dist) { + labels[i] = j; + dist = new_dist; + } + } + cost += dist; + } + } + + /** + * The method responsible with actually doing the recursive hierarchical + * clustering + * + * Params: + * node = the node to cluster + * indices = indices of the points belonging to the current node + * branching = the branching factor to use in the clustering + * + * TODO: for 1-sized clusters don't store a cluster center (it's the same as the single cluster point) + */ + void computeClustering(NodePtr node, int* dsindices, int indices_length, int branching, int level) + { + node->size = indices_length; + node->level = level; + + if (indices_length < leaf_size_) { // leaf node + node->indices = dsindices; + std::sort(node->indices,node->indices+indices_length); + node->childs = NULL; + return; + } + + std::vector centers(branching); + std::vector labels(indices_length); + + int centers_length; + (this->*chooseCenters)(branching, dsindices, indices_length, ¢ers[0], centers_length); + + if (centers_lengthindices = dsindices; + std::sort(node->indices,node->indices+indices_length); + node->childs = NULL; + return; + } + + + // assign points to clusters + DistanceType cost; + computeLabels(dsindices, indices_length, ¢ers[0], centers_length, &labels[0], cost); + + node->childs = pool.allocate(branching); + int start = 0; + int end = start; + for (int i=0; ichilds[i] = pool.allocate(); + node->childs[i]->pivot = centers[i]; + node->childs[i]->indices = NULL; + computeClustering(node->childs[i],dsindices+start, end-start, branching, level+1); + start=end; + } + } + + + + /** + * Performs one descent in the hierarchical k-means tree. The branches not + * visited are stored in a priority queue. + * + * Params: + * node = node to explore + * result = container for the k-nearest neighbors found + * vec = query points + * checks = how many points in the dataset have been checked so far + * maxChecks = maximum dataset points to checks + */ + + + void findNN(NodePtr node, ResultSet& result, const ElementType* vec, int& checks, int maxChecks, + Heap* heap, std::vector& checked) + { + if (node->childs==NULL) { + if (checks>=maxChecks) { + if (result.full()) return; + } + for (int i=0; isize; ++i) { + int index = node->indices[i]; + if (!checked[index]) { + DistanceType dist = distance(dataset[index], vec, veclen_); + result.addPoint(dist, index); + checked[index] = true; + ++checks; + } + } + } + else { + DistanceType* domain_distances = new DistanceType[branching_]; + int best_index = 0; + domain_distances[best_index] = distance(vec, dataset[node->childs[best_index]->pivot], veclen_); + for (int i=1; ichilds[i]->pivot], veclen_); + if (domain_distances[i]insert(BranchSt(node->childs[i],domain_distances[i])); + } + } + delete[] domain_distances; + findNN(node->childs[best_index],result,vec, checks, maxChecks, heap, checked); + } + } + +private: + + + /** + * The dataset used by this index + */ + const Matrix dataset; + + /** + * Parameters used by this index + */ + IndexParams params; + + + /** + * Number of features in the dataset. + */ + size_t size_; + + /** + * Length of each feature. + */ + size_t veclen_; + + /** + * The root node in the tree. + */ + NodePtr* root; + + /** + * Array of indices to vectors in the dataset. + */ + int** indices; + + + /** + * The distance + */ + Distance distance; + + /** + * Pooled memory allocator. + * + * Using a pooled memory allocator is more efficient + * than allocating memory directly when there is a large + * number small of memory allocations. + */ + PooledAllocator pool; + + /** + * Memory occupied by the index. + */ + int memoryCounter; + + /** index parameters */ + int branching_; + int trees_; + flann_centers_init_t centers_init_; + int leaf_size_; + + +}; + +} + +#endif /* OPENCV_FLANN_HIERARCHICAL_CLUSTERING_INDEX_H_ */ diff --git a/lib/opencv/include/opencv2/flann/index_testing.h b/lib/opencv/include/opencv2/flann/index_testing.h new file mode 100644 index 000000000..d76400409 --- /dev/null +++ b/lib/opencv/include/opencv2/flann/index_testing.h @@ -0,0 +1,318 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_INDEX_TESTING_H_ +#define OPENCV_FLANN_INDEX_TESTING_H_ + +#include +#include +#include + +#include "matrix.h" +#include "nn_index.h" +#include "result_set.h" +#include "logger.h" +#include "timer.h" + + +namespace cvflann +{ + +inline int countCorrectMatches(int* neighbors, int* groundTruth, int n) +{ + int count = 0; + for (int i=0; i +typename Distance::ResultType computeDistanceRaport(const Matrix& inputData, typename Distance::ElementType* target, + int* neighbors, int* groundTruth, int veclen, int n, const Distance& distance) +{ + typedef typename Distance::ResultType DistanceType; + + DistanceType ret = 0; + for (int i=0; i +float search_with_ground_truth(NNIndex& index, const Matrix& inputData, + const Matrix& testData, const Matrix& matches, int nn, int checks, + float& time, typename Distance::ResultType& dist, const Distance& distance, int skipMatches) +{ + typedef typename Distance::ResultType DistanceType; + + if (matches.cols resultSet(nn+skipMatches); + SearchParams searchParams(checks); + + std::vector indices(nn+skipMatches); + std::vector dists(nn+skipMatches); + int* neighbors = &indices[skipMatches]; + + int correct = 0; + DistanceType distR = 0; + StartStopTimer t; + int repeats = 0; + while (t.value<0.2) { + repeats++; + t.start(); + correct = 0; + distR = 0; + for (size_t i = 0; i < testData.rows; i++) { + resultSet.init(&indices[0], &dists[0]); + index.findNeighbors(resultSet, testData[i], searchParams); + + correct += countCorrectMatches(neighbors,matches[i], nn); + distR += computeDistanceRaport(inputData, testData[i], neighbors, matches[i], (int)testData.cols, nn, distance); + } + t.stop(); + } + time = float(t.value/repeats); + + float precicion = (float)correct/(nn*testData.rows); + + dist = distR/(testData.rows*nn); + + Logger::info("%8d %10.4g %10.5g %10.5g %10.5g\n", + checks, precicion, time, 1000.0 * time / testData.rows, dist); + + return precicion; +} + + +template +float test_index_checks(NNIndex& index, const Matrix& inputData, + const Matrix& testData, const Matrix& matches, + int checks, float& precision, const Distance& distance, int nn = 1, int skipMatches = 0) +{ + typedef typename Distance::ResultType DistanceType; + + Logger::info(" Nodes Precision(%) Time(s) Time/vec(ms) Mean dist\n"); + Logger::info("---------------------------------------------------------\n"); + + float time = 0; + DistanceType dist = 0; + precision = search_with_ground_truth(index, inputData, testData, matches, nn, checks, time, dist, distance, skipMatches); + + return time; +} + +template +float test_index_precision(NNIndex& index, const Matrix& inputData, + const Matrix& testData, const Matrix& matches, + float precision, int& checks, const Distance& distance, int nn = 1, int skipMatches = 0) +{ + typedef typename Distance::ResultType DistanceType; + const float SEARCH_EPS = 0.001f; + + Logger::info(" Nodes Precision(%) Time(s) Time/vec(ms) Mean dist\n"); + Logger::info("---------------------------------------------------------\n"); + + int c2 = 1; + float p2; + int c1 = 1; + //float p1; + float time; + DistanceType dist; + + p2 = search_with_ground_truth(index, inputData, testData, matches, nn, c2, time, dist, distance, skipMatches); + + if (p2>precision) { + Logger::info("Got as close as I can\n"); + checks = c2; + return time; + } + + while (p2SEARCH_EPS) { + Logger::info("Start linear estimation\n"); + // after we got to values in the vecinity of the desired precision + // use linear approximation get a better estimation + + cx = (c1+c2)/2; + realPrecision = search_with_ground_truth(index, inputData, testData, matches, nn, cx, time, dist, distance, skipMatches); + while (fabs(realPrecision-precision)>SEARCH_EPS) { + + if (realPrecision +void test_index_precisions(NNIndex& index, const Matrix& inputData, + const Matrix& testData, const Matrix& matches, + float* precisions, int precisions_length, const Distance& distance, int nn = 1, int skipMatches = 0, float maxTime = 0) +{ + typedef typename Distance::ResultType DistanceType; + + const float SEARCH_EPS = 0.001; + + // make sure precisions array is sorted + std::sort(precisions, precisions+precisions_length); + + int pindex = 0; + float precision = precisions[pindex]; + + Logger::info(" Nodes Precision(%) Time(s) Time/vec(ms) Mean dist\n"); + Logger::info("---------------------------------------------------------\n"); + + int c2 = 1; + float p2; + + int c1 = 1; + float p1; + + float time; + DistanceType dist; + + p2 = search_with_ground_truth(index, inputData, testData, matches, nn, c2, time, dist, distance, skipMatches); + + // if precision for 1 run down the tree is already + // better then some of the requested precisions, then + // skip those + while (precisions[pindex] 0)&&(time > maxTime)&&(p2SEARCH_EPS) { + Logger::info("Start linear estimation\n"); + // after we got to values in the vecinity of the desired precision + // use linear approximation get a better estimation + + cx = (c1+c2)/2; + realPrecision = search_with_ground_truth(index, inputData, testData, matches, nn, cx, time, dist, distance, skipMatches); + while (fabs(realPrecision-precision)>SEARCH_EPS) { + + if (realPrecision +#include +#include +#include + +#include "general.h" +#include "nn_index.h" +#include "dynamic_bitset.h" +#include "matrix.h" +#include "result_set.h" +#include "heap.h" +#include "allocator.h" +#include "random.h" +#include "saving.h" + + +namespace cvflann +{ + +struct KDTreeIndexParams : public IndexParams +{ + KDTreeIndexParams(int trees = 4) + { + (*this)["algorithm"] = FLANN_INDEX_KDTREE; + (*this)["trees"] = trees; + } +}; + + +/** + * Randomized kd-tree index + * + * Contains the k-d trees and other information for indexing a set of points + * for nearest-neighbor matching. + */ +template +class KDTreeIndex : public NNIndex +{ +public: + typedef typename Distance::ElementType ElementType; + typedef typename Distance::ResultType DistanceType; + + + /** + * KDTree constructor + * + * Params: + * inputData = dataset with the input features + * params = parameters passed to the kdtree algorithm + */ + KDTreeIndex(const Matrix& inputData, const IndexParams& params = KDTreeIndexParams(), + Distance d = Distance() ) : + dataset_(inputData), index_params_(params), distance_(d) + { + size_ = dataset_.rows; + veclen_ = dataset_.cols; + + trees_ = get_param(index_params_,"trees",4); + tree_roots_ = new NodePtr[trees_]; + + // Create a permutable array of indices to the input vectors. + vind_.resize(size_); + for (size_t i = 0; i < size_; ++i) { + vind_[i] = int(i); + } + + mean_ = new DistanceType[veclen_]; + var_ = new DistanceType[veclen_]; + } + + + KDTreeIndex(const KDTreeIndex&); + KDTreeIndex& operator=(const KDTreeIndex&); + + /** + * Standard destructor + */ + ~KDTreeIndex() + { + if (tree_roots_!=NULL) { + delete[] tree_roots_; + } + delete[] mean_; + delete[] var_; + } + + /** + * Builds the index + */ + void buildIndex() + { + /* Construct the randomized trees. */ + for (int i = 0; i < trees_; i++) { + /* Randomize the order of vectors to allow for unbiased sampling. */ + std::random_shuffle(vind_.begin(), vind_.end()); + tree_roots_[i] = divideTree(&vind_[0], int(size_) ); + } + } + + + flann_algorithm_t getType() const + { + return FLANN_INDEX_KDTREE; + } + + + void saveIndex(FILE* stream) + { + save_value(stream, trees_); + for (int i=0; i& result, const ElementType* vec, const SearchParams& searchParams) + { + int maxChecks = get_param(searchParams,"checks", 32); + float epsError = 1+get_param(searchParams,"eps",0.0f); + + if (maxChecks==FLANN_CHECKS_UNLIMITED) { + getExactNeighbors(result, vec, epsError); + } + else { + getNeighbors(result, vec, maxChecks, epsError); + } + } + + IndexParams getParameters() const + { + return index_params_; + } + +private: + + + /*--------------------- Internal Data Structures --------------------------*/ + struct Node + { + /** + * Dimension used for subdivision. + */ + int divfeat; + /** + * The values used for subdivision. + */ + DistanceType divval; + /** + * The child nodes. + */ + Node* child1, * child2; + }; + typedef Node* NodePtr; + typedef BranchStruct BranchSt; + typedef BranchSt* Branch; + + + + void save_tree(FILE* stream, NodePtr tree) + { + save_value(stream, *tree); + if (tree->child1!=NULL) { + save_tree(stream, tree->child1); + } + if (tree->child2!=NULL) { + save_tree(stream, tree->child2); + } + } + + + void load_tree(FILE* stream, NodePtr& tree) + { + tree = pool_.allocate(); + load_value(stream, *tree); + if (tree->child1!=NULL) { + load_tree(stream, tree->child1); + } + if (tree->child2!=NULL) { + load_tree(stream, tree->child2); + } + } + + + /** + * Create a tree node that subdivides the list of vecs from vind[first] + * to vind[last]. The routine is called recursively on each sublist. + * Place a pointer to this new tree node in the location pTree. + * + * Params: pTree = the new node to create + * first = index of the first vector + * last = index of the last vector + */ + NodePtr divideTree(int* ind, int count) + { + NodePtr node = pool_.allocate(); // allocate memory + + /* If too few exemplars remain, then make this a leaf node. */ + if ( count == 1) { + node->child1 = node->child2 = NULL; /* Mark as leaf node. */ + node->divfeat = *ind; /* Store index of this vec. */ + } + else { + int idx; + int cutfeat; + DistanceType cutval; + meanSplit(ind, count, idx, cutfeat, cutval); + + node->divfeat = cutfeat; + node->divval = cutval; + node->child1 = divideTree(ind, idx); + node->child2 = divideTree(ind+idx, count-idx); + } + + return node; + } + + + /** + * Choose which feature to use in order to subdivide this set of vectors. + * Make a random choice among those with the highest variance, and use + * its variance as the threshold value. + */ + void meanSplit(int* ind, int count, int& index, int& cutfeat, DistanceType& cutval) + { + memset(mean_,0,veclen_*sizeof(DistanceType)); + memset(var_,0,veclen_*sizeof(DistanceType)); + + /* Compute mean values. Only the first SAMPLE_MEAN values need to be + sampled to get a good estimate. + */ + int cnt = std::min((int)SAMPLE_MEAN+1, count); + for (int j = 0; j < cnt; ++j) { + ElementType* v = dataset_[ind[j]]; + for (size_t k=0; kcount/2) index = lim1; + else if (lim2 v[topind[num-1]])) { + /* Put this element at end of topind. */ + if (num < RAND_DIM) { + topind[num++] = i; /* Add to list. */ + } + else { + topind[num-1] = i; /* Replace last element. */ + } + /* Bubble end value down to right location by repeated swapping. */ + int j = num - 1; + while (j > 0 && v[topind[j]] > v[topind[j-1]]) { + std::swap(topind[j], topind[j-1]); + --j; + } + } + } + /* Select a random integer in range [0,num-1], and return that index. */ + int rnd = rand_int(num); + return (int)topind[rnd]; + } + + + /** + * Subdivide the list of points by a plane perpendicular on axe corresponding + * to the 'cutfeat' dimension at 'cutval' position. + * + * On return: + * dataset[ind[0..lim1-1]][cutfeat]cutval + */ + void planeSplit(int* ind, int count, int cutfeat, DistanceType cutval, int& lim1, int& lim2) + { + /* Move vector indices for left subtree to front of list. */ + int left = 0; + int right = count-1; + for (;; ) { + while (left<=right && dataset_[ind[left]][cutfeat]=cutval) --right; + if (left>right) break; + std::swap(ind[left], ind[right]); ++left; --right; + } + lim1 = left; + right = count-1; + for (;; ) { + while (left<=right && dataset_[ind[left]][cutfeat]<=cutval) ++left; + while (left<=right && dataset_[ind[right]][cutfeat]>cutval) --right; + if (left>right) break; + std::swap(ind[left], ind[right]); ++left; --right; + } + lim2 = left; + } + + /** + * Performs an exact nearest neighbor search. The exact search performs a full + * traversal of the tree. + */ + void getExactNeighbors(ResultSet& result, const ElementType* vec, float epsError) + { + // checkID -= 1; /* Set a different unique ID for each search. */ + + if (trees_ > 1) { + fprintf(stderr,"It doesn't make any sense to use more than one tree for exact search"); + } + if (trees_>0) { + searchLevelExact(result, vec, tree_roots_[0], 0.0, epsError); + } + assert(result.full()); + } + + /** + * Performs the approximate nearest-neighbor search. The search is approximate + * because the tree traversal is abandoned after a given number of descends in + * the tree. + */ + void getNeighbors(ResultSet& result, const ElementType* vec, int maxCheck, float epsError) + { + int i; + BranchSt branch; + + int checkCount = 0; + Heap* heap = new Heap((int)size_); + DynamicBitset checked(size_); + + /* Search once through each tree down to root. */ + for (i = 0; i < trees_; ++i) { + searchLevel(result, vec, tree_roots_[i], 0, checkCount, maxCheck, epsError, heap, checked); + } + + /* Keep searching other branches from heap until finished. */ + while ( heap->popMin(branch) && (checkCount < maxCheck || !result.full() )) { + searchLevel(result, vec, branch.node, branch.mindist, checkCount, maxCheck, epsError, heap, checked); + } + + delete heap; + + assert(result.full()); + } + + + /** + * Search starting from a given node of the tree. Based on any mismatches at + * higher levels, all exemplars below this level must have a distance of + * at least "mindistsq". + */ + void searchLevel(ResultSet& result_set, const ElementType* vec, NodePtr node, DistanceType mindist, int& checkCount, int maxCheck, + float epsError, Heap* heap, DynamicBitset& checked) + { + if (result_set.worstDist()child1 == NULL)&&(node->child2 == NULL)) { + /* Do not check same node more than once when searching multiple trees. + Once a vector is checked, we set its location in vind to the + current checkID. + */ + int index = node->divfeat; + if ( checked.test(index) || ((checkCount>=maxCheck)&& result_set.full()) ) return; + checked.set(index); + checkCount++; + + DistanceType dist = distance_(dataset_[index], vec, veclen_); + result_set.addPoint(dist,index); + + return; + } + + /* Which child branch should be taken first? */ + ElementType val = vec[node->divfeat]; + DistanceType diff = val - node->divval; + NodePtr bestChild = (diff < 0) ? node->child1 : node->child2; + NodePtr otherChild = (diff < 0) ? node->child2 : node->child1; + + /* Create a branch record for the branch not taken. Add distance + of this feature boundary (we don't attempt to correct for any + use of this feature in a parent node, which is unlikely to + happen and would have only a small effect). Don't bother + adding more branches to heap after halfway point, as cost of + adding exceeds their value. + */ + + DistanceType new_distsq = mindist + distance_.accum_dist(val, node->divval, node->divfeat); + // if (2 * checkCount < maxCheck || !result.full()) { + if ((new_distsq*epsError < result_set.worstDist())|| !result_set.full()) { + heap->insert( BranchSt(otherChild, new_distsq) ); + } + + /* Call recursively to search next level down. */ + searchLevel(result_set, vec, bestChild, mindist, checkCount, maxCheck, epsError, heap, checked); + } + + /** + * Performs an exact search in the tree starting from a node. + */ + void searchLevelExact(ResultSet& result_set, const ElementType* vec, const NodePtr node, DistanceType mindist, const float epsError) + { + /* If this is a leaf node, then do check and return. */ + if ((node->child1 == NULL)&&(node->child2 == NULL)) { + int index = node->divfeat; + DistanceType dist = distance_(dataset_[index], vec, veclen_); + result_set.addPoint(dist,index); + return; + } + + /* Which child branch should be taken first? */ + ElementType val = vec[node->divfeat]; + DistanceType diff = val - node->divval; + NodePtr bestChild = (diff < 0) ? node->child1 : node->child2; + NodePtr otherChild = (diff < 0) ? node->child2 : node->child1; + + /* Create a branch record for the branch not taken. Add distance + of this feature boundary (we don't attempt to correct for any + use of this feature in a parent node, which is unlikely to + happen and would have only a small effect). Don't bother + adding more branches to heap after halfway point, as cost of + adding exceeds their value. + */ + + DistanceType new_distsq = mindist + distance_.accum_dist(val, node->divval, node->divfeat); + + /* Call recursively to search next level down. */ + searchLevelExact(result_set, vec, bestChild, mindist, epsError); + + if (new_distsq*epsError<=result_set.worstDist()) { + searchLevelExact(result_set, vec, otherChild, new_distsq, epsError); + } + } + + +private: + + enum + { + /** + * To improve efficiency, only SAMPLE_MEAN random values are used to + * compute the mean and variance at each level when building a tree. + * A value of 100 seems to perform as well as using all values. + */ + SAMPLE_MEAN = 100, + /** + * Top random dimensions to consider + * + * When creating random trees, the dimension on which to subdivide is + * selected at random from among the top RAND_DIM dimensions with the + * highest variance. A value of 5 works well. + */ + RAND_DIM=5 + }; + + + /** + * Number of randomized trees that are used + */ + int trees_; + + /** + * Array of indices to vectors in the dataset. + */ + std::vector vind_; + + /** + * The dataset used by this index + */ + const Matrix dataset_; + + IndexParams index_params_; + + size_t size_; + size_t veclen_; + + + DistanceType* mean_; + DistanceType* var_; + + + /** + * Array of k-d trees used to find neighbours. + */ + NodePtr* tree_roots_; + + /** + * Pooled memory allocator. + * + * Using a pooled memory allocator is more efficient + * than allocating memory directly when there is a large + * number small of memory allocations. + */ + PooledAllocator pool_; + + Distance distance_; + + +}; // class KDTreeForest + +} + +#endif //OPENCV_FLANN_KDTREE_INDEX_H_ diff --git a/lib/opencv/include/opencv2/flann/kdtree_single_index.h b/lib/opencv/include/opencv2/flann/kdtree_single_index.h new file mode 100644 index 000000000..30488ad56 --- /dev/null +++ b/lib/opencv/include/opencv2/flann/kdtree_single_index.h @@ -0,0 +1,634 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_KDTREE_SINGLE_INDEX_H_ +#define OPENCV_FLANN_KDTREE_SINGLE_INDEX_H_ + +#include +#include +#include +#include + +#include "general.h" +#include "nn_index.h" +#include "matrix.h" +#include "result_set.h" +#include "heap.h" +#include "allocator.h" +#include "random.h" +#include "saving.h" + +namespace cvflann +{ + +struct KDTreeSingleIndexParams : public IndexParams +{ + KDTreeSingleIndexParams(int leaf_max_size = 10, bool reorder = true, int dim = -1) + { + (*this)["algorithm"] = FLANN_INDEX_KDTREE_SINGLE; + (*this)["leaf_max_size"] = leaf_max_size; + (*this)["reorder"] = reorder; + (*this)["dim"] = dim; + } +}; + + +/** + * Randomized kd-tree index + * + * Contains the k-d trees and other information for indexing a set of points + * for nearest-neighbor matching. + */ +template +class KDTreeSingleIndex : public NNIndex +{ +public: + typedef typename Distance::ElementType ElementType; + typedef typename Distance::ResultType DistanceType; + + + /** + * KDTree constructor + * + * Params: + * inputData = dataset with the input features + * params = parameters passed to the kdtree algorithm + */ + KDTreeSingleIndex(const Matrix& inputData, const IndexParams& params = KDTreeSingleIndexParams(), + Distance d = Distance() ) : + dataset_(inputData), index_params_(params), distance_(d) + { + size_ = dataset_.rows; + dim_ = dataset_.cols; + int dim_param = get_param(params,"dim",-1); + if (dim_param>0) dim_ = dim_param; + leaf_max_size_ = get_param(params,"leaf_max_size",10); + reorder_ = get_param(params,"reorder",true); + + // Create a permutable array of indices to the input vectors. + vind_.resize(size_); + for (size_t i = 0; i < size_; i++) { + vind_[i] = (int)i; + } + } + + KDTreeSingleIndex(const KDTreeSingleIndex&); + KDTreeSingleIndex& operator=(const KDTreeSingleIndex&); + + /** + * Standard destructor + */ + ~KDTreeSingleIndex() + { + if (reorder_) delete[] data_.data; + } + + /** + * Builds the index + */ + void buildIndex() + { + computeBoundingBox(root_bbox_); + root_node_ = divideTree(0, (int)size_, root_bbox_ ); // construct the tree + + if (reorder_) { + delete[] data_.data; + data_ = cvflann::Matrix(new ElementType[size_*dim_], size_, dim_); + for (size_t i=0; i& queries, Matrix& indices, Matrix& dists, int knn, const SearchParams& params) + { + assert(queries.cols == veclen()); + assert(indices.rows >= queries.rows); + assert(dists.rows >= queries.rows); + assert(int(indices.cols) >= knn); + assert(int(dists.cols) >= knn); + + KNNSimpleResultSet resultSet(knn); + for (size_t i = 0; i < queries.rows; i++) { + resultSet.init(indices[i], dists[i]); + findNeighbors(resultSet, queries[i], params); + } + } + + IndexParams getParameters() const + { + return index_params_; + } + + /** + * Find set of nearest neighbors to vec. Their indices are stored inside + * the result object. + * + * Params: + * result = the result object in which the indices of the nearest-neighbors are stored + * vec = the vector for which to search the nearest neighbors + * maxCheck = the maximum number of restarts (in a best-bin-first manner) + */ + void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) + { + float epsError = 1+get_param(searchParams,"eps",0.0f); + + std::vector dists(dim_,0); + DistanceType distsq = computeInitialDistances(vec, dists); + searchLevel(result, vec, root_node_, distsq, dists, epsError); + } + +private: + + + /*--------------------- Internal Data Structures --------------------------*/ + struct Node + { + /** + * Indices of points in leaf node + */ + int left, right; + /** + * Dimension used for subdivision. + */ + int divfeat; + /** + * The values used for subdivision. + */ + DistanceType divlow, divhigh; + /** + * The child nodes. + */ + Node* child1, * child2; + }; + typedef Node* NodePtr; + + + struct Interval + { + DistanceType low, high; + }; + + typedef std::vector BoundingBox; + + typedef BranchStruct BranchSt; + typedef BranchSt* Branch; + + + + + void save_tree(FILE* stream, NodePtr tree) + { + save_value(stream, *tree); + if (tree->child1!=NULL) { + save_tree(stream, tree->child1); + } + if (tree->child2!=NULL) { + save_tree(stream, tree->child2); + } + } + + + void load_tree(FILE* stream, NodePtr& tree) + { + tree = pool_.allocate(); + load_value(stream, *tree); + if (tree->child1!=NULL) { + load_tree(stream, tree->child1); + } + if (tree->child2!=NULL) { + load_tree(stream, tree->child2); + } + } + + + void computeBoundingBox(BoundingBox& bbox) + { + bbox.resize(dim_); + for (size_t i=0; ibbox[i].high) bbox[i].high = (DistanceType)dataset_[k][i]; + } + } + } + + + /** + * Create a tree node that subdivides the list of vecs from vind[first] + * to vind[last]. The routine is called recursively on each sublist. + * Place a pointer to this new tree node in the location pTree. + * + * Params: pTree = the new node to create + * first = index of the first vector + * last = index of the last vector + */ + NodePtr divideTree(int left, int right, BoundingBox& bbox) + { + NodePtr node = pool_.allocate(); // allocate memory + + /* If too few exemplars remain, then make this a leaf node. */ + if ( (right-left) <= leaf_max_size_) { + node->child1 = node->child2 = NULL; /* Mark as leaf node. */ + node->left = left; + node->right = right; + + // compute bounding-box of leaf points + for (size_t i=0; idataset_[vind_[k]][i]) bbox[i].low=(DistanceType)dataset_[vind_[k]][i]; + if (bbox[i].highdivfeat = cutfeat; + + BoundingBox left_bbox(bbox); + left_bbox[cutfeat].high = cutval; + node->child1 = divideTree(left, left+idx, left_bbox); + + BoundingBox right_bbox(bbox); + right_bbox[cutfeat].low = cutval; + node->child2 = divideTree(left+idx, right, right_bbox); + + node->divlow = left_bbox[cutfeat].high; + node->divhigh = right_bbox[cutfeat].low; + + for (size_t i=0; imax_elem) max_elem = val; + } + } + + void middleSplit(int* ind, int count, int& index, int& cutfeat, DistanceType& cutval, const BoundingBox& bbox) + { + // find the largest span from the approximate bounding box + ElementType max_span = bbox[0].high-bbox[0].low; + cutfeat = 0; + cutval = (bbox[0].high+bbox[0].low)/2; + for (size_t i=1; imax_span) { + max_span = span; + cutfeat = i; + cutval = (bbox[i].high+bbox[i].low)/2; + } + } + + // compute exact span on the found dimension + ElementType min_elem, max_elem; + computeMinMax(ind, count, cutfeat, min_elem, max_elem); + cutval = (min_elem+max_elem)/2; + max_span = max_elem - min_elem; + + // check if a dimension of a largest span exists + size_t k = cutfeat; + for (size_t i=0; imax_span) { + computeMinMax(ind, count, i, min_elem, max_elem); + span = max_elem - min_elem; + if (span>max_span) { + max_span = span; + cutfeat = i; + cutval = (min_elem+max_elem)/2; + } + } + } + int lim1, lim2; + planeSplit(ind, count, cutfeat, cutval, lim1, lim2); + + if (lim1>count/2) index = lim1; + else if (lim2max_span) { + max_span = span; + } + } + DistanceType max_spread = -1; + cutfeat = 0; + for (size_t i=0; i(DistanceType)((1-EPS)*max_span)) { + ElementType min_elem, max_elem; + computeMinMax(ind, count, cutfeat, min_elem, max_elem); + DistanceType spread = (DistanceType)(max_elem-min_elem); + if (spread>max_spread) { + cutfeat = (int)i; + max_spread = spread; + } + } + } + // split in the middle + DistanceType split_val = (bbox[cutfeat].low+bbox[cutfeat].high)/2; + ElementType min_elem, max_elem; + computeMinMax(ind, count, cutfeat, min_elem, max_elem); + + if (split_valmax_elem) cutval = (DistanceType)max_elem; + else cutval = split_val; + + int lim1, lim2; + planeSplit(ind, count, cutfeat, cutval, lim1, lim2); + + if (lim1>count/2) index = lim1; + else if (lim2cutval + */ + void planeSplit(int* ind, int count, int cutfeat, DistanceType cutval, int& lim1, int& lim2) + { + /* Move vector indices for left subtree to front of list. */ + int left = 0; + int right = count-1; + for (;; ) { + while (left<=right && dataset_[ind[left]][cutfeat]=cutval) --right; + if (left>right) break; + std::swap(ind[left], ind[right]); ++left; --right; + } + /* If either list is empty, it means that all remaining features + * are identical. Split in the middle to maintain a balanced tree. + */ + lim1 = left; + right = count-1; + for (;; ) { + while (left<=right && dataset_[ind[left]][cutfeat]<=cutval) ++left; + while (left<=right && dataset_[ind[right]][cutfeat]>cutval) --right; + if (left>right) break; + std::swap(ind[left], ind[right]); ++left; --right; + } + lim2 = left; + } + + DistanceType computeInitialDistances(const ElementType* vec, std::vector& dists) + { + DistanceType distsq = 0.0; + + for (size_t i = 0; i < dim_; ++i) { + if (vec[i] < root_bbox_[i].low) { + dists[i] = distance_.accum_dist(vec[i], root_bbox_[i].low, (int)i); + distsq += dists[i]; + } + if (vec[i] > root_bbox_[i].high) { + dists[i] = distance_.accum_dist(vec[i], root_bbox_[i].high, (int)i); + distsq += dists[i]; + } + } + + return distsq; + } + + /** + * Performs an exact search in the tree starting from a node. + */ + void searchLevel(ResultSet& result_set, const ElementType* vec, const NodePtr node, DistanceType mindistsq, + std::vector& dists, const float epsError) + { + /* If this is a leaf node, then do check and return. */ + if ((node->child1 == NULL)&&(node->child2 == NULL)) { + DistanceType worst_dist = result_set.worstDist(); + for (int i=node->left; iright; ++i) { + int index = reorder_ ? i : vind_[i]; + DistanceType dist = distance_(vec, data_[index], dim_, worst_dist); + if (distdivfeat; + ElementType val = vec[idx]; + DistanceType diff1 = val - node->divlow; + DistanceType diff2 = val - node->divhigh; + + NodePtr bestChild; + NodePtr otherChild; + DistanceType cut_dist; + if ((diff1+diff2)<0) { + bestChild = node->child1; + otherChild = node->child2; + cut_dist = distance_.accum_dist(val, node->divhigh, idx); + } + else { + bestChild = node->child2; + otherChild = node->child1; + cut_dist = distance_.accum_dist( val, node->divlow, idx); + } + + /* Call recursively to search next level down. */ + searchLevel(result_set, vec, bestChild, mindistsq, dists, epsError); + + DistanceType dst = dists[idx]; + mindistsq = mindistsq + cut_dist - dst; + dists[idx] = cut_dist; + if (mindistsq*epsError<=result_set.worstDist()) { + searchLevel(result_set, vec, otherChild, mindistsq, dists, epsError); + } + dists[idx] = dst; + } + +private: + + /** + * The dataset used by this index + */ + const Matrix dataset_; + + IndexParams index_params_; + + int leaf_max_size_; + bool reorder_; + + + /** + * Array of indices to vectors in the dataset. + */ + std::vector vind_; + + Matrix data_; + + size_t size_; + size_t dim_; + + /** + * Array of k-d trees used to find neighbours. + */ + NodePtr root_node_; + + BoundingBox root_bbox_; + + /** + * Pooled memory allocator. + * + * Using a pooled memory allocator is more efficient + * than allocating memory directly when there is a large + * number small of memory allocations. + */ + PooledAllocator pool_; + + Distance distance_; +}; // class KDTree + +} + +#endif //OPENCV_FLANN_KDTREE_SINGLE_INDEX_H_ diff --git a/lib/opencv/include/opencv2/flann/kmeans_index.h b/lib/opencv/include/opencv2/flann/kmeans_index.h new file mode 100644 index 000000000..226fc71f3 --- /dev/null +++ b/lib/opencv/include/opencv2/flann/kmeans_index.h @@ -0,0 +1,1169 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_KMEANS_INDEX_H_ +#define OPENCV_FLANN_KMEANS_INDEX_H_ + +#include +#include +#include +#include +#include + +#include "general.h" +#include "nn_index.h" +#include "dist.h" +#include "matrix.h" +#include "result_set.h" +#include "heap.h" +#include "allocator.h" +#include "random.h" +#include "saving.h" +#include "logger.h" + + +namespace cvflann +{ + +struct KMeansIndexParams : public IndexParams +{ + KMeansIndexParams(int branching = 32, int iterations = 11, + flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM, float cb_index = 0.2 ) + { + (*this)["algorithm"] = FLANN_INDEX_KMEANS; + // branching factor + (*this)["branching"] = branching; + // max iterations to perform in one kmeans clustering (kmeans tree) + (*this)["iterations"] = iterations; + // algorithm used for picking the initial cluster centers for kmeans tree + (*this)["centers_init"] = centers_init; + // cluster boundary index. Used when searching the kmeans tree + (*this)["cb_index"] = cb_index; + } +}; + + +/** + * Hierarchical kmeans index + * + * Contains a tree constructed through a hierarchical kmeans clustering + * and other information for indexing a set of points for nearest-neighbour matching. + */ +template +class KMeansIndex : public NNIndex +{ +public: + typedef typename Distance::ElementType ElementType; + typedef typename Distance::ResultType DistanceType; + + + + typedef void (KMeansIndex::* centersAlgFunction)(int, int*, int, int*, int&); + + /** + * The function used for choosing the cluster centers. + */ + centersAlgFunction chooseCenters; + + + + /** + * Chooses the initial centers in the k-means clustering in a random manner. + * + * Params: + * k = number of centers + * vecs = the dataset of points + * indices = indices in the dataset + * indices_length = length of indices vector + * + */ + void chooseCentersRandom(int k, int* indices, int indices_length, int* centers, int& centers_length) + { + UniqueRandom r(indices_length); + + int index; + for (index=0; index=0 && rnd < n); + + centers[0] = indices[rnd]; + + int index; + for (index=1; indexbest_val) { + best_val = dist; + best_index = j; + } + } + if (best_index!=-1) { + centers[index] = indices[best_index]; + } + else { + break; + } + } + centers_length = index; + } + + + /** + * Chooses the initial centers in the k-means using the algorithm + * proposed in the KMeans++ paper: + * Arthur, David; Vassilvitskii, Sergei - k-means++: The Advantages of Careful Seeding + * + * Implementation of this function was converted from the one provided in Arthur's code. + * + * Params: + * k = number of centers + * vecs = the dataset of points + * indices = indices in the dataset + * Returns: + */ + void chooseCentersKMeanspp(int k, int* indices, int indices_length, int* centers, int& centers_length) + { + int n = indices_length; + + double currentPot = 0; + DistanceType* closestDistSq = new DistanceType[n]; + + // Choose one random center and set the closestDistSq values + int index = rand_int(n); + assert(index >=0 && index < n); + centers[0] = indices[index]; + + for (int i = 0; i < n; i++) { + closestDistSq[i] = distance_(dataset_[indices[i]], dataset_[indices[index]], dataset_.cols); + closestDistSq[i] = ensureSquareDistance( closestDistSq[i] ); + currentPot += closestDistSq[i]; + } + + + const int numLocalTries = 1; + + // Choose each center + int centerCount; + for (centerCount = 1; centerCount < k; centerCount++) { + + // Repeat several trials + double bestNewPot = -1; + int bestNewIndex = -1; + for (int localTrial = 0; localTrial < numLocalTries; localTrial++) { + + // Choose our center - have to be slightly careful to return a valid answer even accounting + // for possible rounding errors + double randVal = rand_double(currentPot); + for (index = 0; index < n-1; index++) { + if (randVal <= closestDistSq[index]) break; + else randVal -= closestDistSq[index]; + } + + // Compute the new potential + double newPot = 0; + for (int i = 0; i < n; i++) { + DistanceType dist = distance_(dataset_[indices[i]], dataset_[indices[index]], dataset_.cols); + newPot += std::min( ensureSquareDistance(dist), closestDistSq[i] ); + } + + // Store the best result + if ((bestNewPot < 0)||(newPot < bestNewPot)) { + bestNewPot = newPot; + bestNewIndex = index; + } + } + + // Add the appropriate center + centers[centerCount] = indices[bestNewIndex]; + currentPot = bestNewPot; + for (int i = 0; i < n; i++) { + DistanceType dist = distance_(dataset_[indices[i]], dataset_[indices[bestNewIndex]], dataset_.cols); + closestDistSq[i] = std::min( ensureSquareDistance(dist), closestDistSq[i] ); + } + } + + centers_length = centerCount; + + delete[] closestDistSq; + } + + + +public: + + flann_algorithm_t getType() const + { + return FLANN_INDEX_KMEANS; + } + + class KMeansDistanceComputer : public cv::ParallelLoopBody + { + public: + KMeansDistanceComputer(Distance _distance, const Matrix& _dataset, + const int _branching, const int* _indices, const Matrix& _dcenters, const size_t _veclen, + int* _count, int* _belongs_to, std::vector& _radiuses, bool& _converged, cv::Mutex& _mtx) + : distance(_distance) + , dataset(_dataset) + , branching(_branching) + , indices(_indices) + , dcenters(_dcenters) + , veclen(_veclen) + , count(_count) + , belongs_to(_belongs_to) + , radiuses(_radiuses) + , converged(_converged) + , mtx(_mtx) + { + } + + void operator()(const cv::Range& range) const + { + const int begin = range.start; + const int end = range.end; + + for( int i = begin; inew_sq_dist) { + new_centroid = j; + sq_dist = new_sq_dist; + } + } + if (sq_dist > radiuses[new_centroid]) { + radiuses[new_centroid] = sq_dist; + } + if (new_centroid != belongs_to[i]) { + count[belongs_to[i]]--; + count[new_centroid]++; + belongs_to[i] = new_centroid; + mtx.lock(); + converged = false; + mtx.unlock(); + } + } + } + + private: + Distance distance; + const Matrix& dataset; + const int branching; + const int* indices; + const Matrix& dcenters; + const size_t veclen; + int* count; + int* belongs_to; + std::vector& radiuses; + bool& converged; + cv::Mutex& mtx; + KMeansDistanceComputer& operator=( const KMeansDistanceComputer & ) { return *this; } + }; + + /** + * Index constructor + * + * Params: + * inputData = dataset with the input features + * params = parameters passed to the hierarchical k-means algorithm + */ + KMeansIndex(const Matrix& inputData, const IndexParams& params = KMeansIndexParams(), + Distance d = Distance()) + : dataset_(inputData), index_params_(params), root_(NULL), indices_(NULL), distance_(d) + { + memoryCounter_ = 0; + + size_ = dataset_.rows; + veclen_ = dataset_.cols; + + branching_ = get_param(params,"branching",32); + iterations_ = get_param(params,"iterations",11); + if (iterations_<0) { + iterations_ = (std::numeric_limits::max)(); + } + centers_init_ = get_param(params,"centers_init",FLANN_CENTERS_RANDOM); + + if (centers_init_==FLANN_CENTERS_RANDOM) { + chooseCenters = &KMeansIndex::chooseCentersRandom; + } + else if (centers_init_==FLANN_CENTERS_GONZALES) { + chooseCenters = &KMeansIndex::chooseCentersGonzales; + } + else if (centers_init_==FLANN_CENTERS_KMEANSPP) { + chooseCenters = &KMeansIndex::chooseCentersKMeanspp; + } + else { + throw FLANNException("Unknown algorithm for choosing initial centers."); + } + cb_index_ = 0.4f; + + } + + + KMeansIndex(const KMeansIndex&); + KMeansIndex& operator=(const KMeansIndex&); + + + /** + * Index destructor. + * + * Release the memory used by the index. + */ + virtual ~KMeansIndex() + { + if (root_ != NULL) { + free_centers(root_); + } + if (indices_!=NULL) { + delete[] indices_; + } + } + + /** + * Returns size of index. + */ + size_t size() const + { + return size_; + } + + /** + * Returns the length of an index feature. + */ + size_t veclen() const + { + return veclen_; + } + + + void set_cb_index( float index) + { + cb_index_ = index; + } + + /** + * Computes the inde memory usage + * Returns: memory used by the index + */ + int usedMemory() const + { + return pool_.usedMemory+pool_.wastedMemory+memoryCounter_; + } + + /** + * Builds the index + */ + void buildIndex() + { + if (branching_<2) { + throw FLANNException("Branching factor must be at least 2"); + } + + indices_ = new int[size_]; + for (size_t i=0; i(); + std::memset(root_, 0, sizeof(KMeansNode)); + + computeNodeStatistics(root_, indices_, (int)size_); + computeClustering(root_, indices_, (int)size_, branching_,0); + } + + + void saveIndex(FILE* stream) + { + save_value(stream, branching_); + save_value(stream, iterations_); + save_value(stream, memoryCounter_); + save_value(stream, cb_index_); + save_value(stream, *indices_, (int)size_); + + save_tree(stream, root_); + } + + + void loadIndex(FILE* stream) + { + load_value(stream, branching_); + load_value(stream, iterations_); + load_value(stream, memoryCounter_); + load_value(stream, cb_index_); + if (indices_!=NULL) { + delete[] indices_; + } + indices_ = new int[size_]; + load_value(stream, *indices_, size_); + + if (root_!=NULL) { + free_centers(root_); + } + load_tree(stream, root_); + + index_params_["algorithm"] = getType(); + index_params_["branching"] = branching_; + index_params_["iterations"] = iterations_; + index_params_["centers_init"] = centers_init_; + index_params_["cb_index"] = cb_index_; + + } + + + /** + * Find set of nearest neighbors to vec. Their indices are stored inside + * the result object. + * + * Params: + * result = the result object in which the indices of the nearest-neighbors are stored + * vec = the vector for which to search the nearest neighbors + * searchParams = parameters that influence the search algorithm (checks, cb_index) + */ + void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) + { + + int maxChecks = get_param(searchParams,"checks",32); + + if (maxChecks==FLANN_CHECKS_UNLIMITED) { + findExactNN(root_, result, vec); + } + else { + // Priority queue storing intermediate branches in the best-bin-first search + Heap* heap = new Heap((int)size_); + + int checks = 0; + findNN(root_, result, vec, checks, maxChecks, heap); + + BranchSt branch; + while (heap->popMin(branch) && (checks& centers) + { + int numClusters = centers.rows; + if (numClusters<1) { + throw FLANNException("Number of clusters must be at least 1"); + } + + DistanceType variance; + KMeansNodePtr* clusters = new KMeansNodePtr[numClusters]; + + int clusterCount = getMinVarianceClusters(root_, clusters, numClusters, variance); + + Logger::info("Clusters requested: %d, returning %d\n",numClusters, clusterCount); + + for (int i=0; ipivot; + for (size_t j=0; j BranchSt; + + + + + void save_tree(FILE* stream, KMeansNodePtr node) + { + save_value(stream, *node); + save_value(stream, *(node->pivot), (int)veclen_); + if (node->childs==NULL) { + int indices_offset = (int)(node->indices - indices_); + save_value(stream, indices_offset); + } + else { + for(int i=0; ichilds[i]); + } + } + } + + + void load_tree(FILE* stream, KMeansNodePtr& node) + { + node = pool_.allocate(); + load_value(stream, *node); + node->pivot = new DistanceType[veclen_]; + load_value(stream, *(node->pivot), (int)veclen_); + if (node->childs==NULL) { + int indices_offset; + load_value(stream, indices_offset); + node->indices = indices_ + indices_offset; + } + else { + node->childs = pool_.allocate(branching_); + for(int i=0; ichilds[i]); + } + } + } + + + /** + * Helper function + */ + void free_centers(KMeansNodePtr node) + { + delete[] node->pivot; + if (node->childs!=NULL) { + for (int k=0; kchilds[k]); + } + } + } + + /** + * Computes the statistics of a node (mean, radius, variance). + * + * Params: + * node = the node to use + * indices = the indices of the points belonging to the node + */ + void computeNodeStatistics(KMeansNodePtr node, int* indices, int indices_length) + { + + DistanceType radius = 0; + DistanceType variance = 0; + DistanceType* mean = new DistanceType[veclen_]; + memoryCounter_ += int(veclen_*sizeof(DistanceType)); + + memset(mean,0,veclen_*sizeof(DistanceType)); + + for (size_t i=0; i(), veclen_); + } + for (size_t j=0; j(), veclen_); + + DistanceType tmp = 0; + for (int i=0; iradius) { + radius = tmp; + } + } + + node->variance = variance; + node->radius = radius; + node->pivot = mean; + } + + + /** + * The method responsible with actually doing the recursive hierarchical + * clustering + * + * Params: + * node = the node to cluster + * indices = indices of the points belonging to the current node + * branching = the branching factor to use in the clustering + * + * TODO: for 1-sized clusters don't store a cluster center (it's the same as the single cluster point) + */ + void computeClustering(KMeansNodePtr node, int* indices, int indices_length, int branching, int level) + { + node->size = indices_length; + node->level = level; + + if (indices_length < branching) { + node->indices = indices; + std::sort(node->indices,node->indices+indices_length); + node->childs = NULL; + return; + } + + cv::AutoBuffer centers_idx_buf(branching); + int* centers_idx = (int*)centers_idx_buf; + int centers_length; + (this->*chooseCenters)(branching, indices, indices_length, centers_idx, centers_length); + + if (centers_lengthindices = indices; + std::sort(node->indices,node->indices+indices_length); + node->childs = NULL; + return; + } + + + cv::AutoBuffer dcenters_buf(branching*veclen_); + Matrix dcenters((double*)dcenters_buf,branching,veclen_); + for (int i=0; i radiuses(branching); + cv::AutoBuffer count_buf(branching); + int* count = (int*)count_buf; + for (int i=0; i belongs_to_buf(indices_length); + int* belongs_to = (int*)belongs_to_buf; + for (int i=0; inew_sq_dist) { + belongs_to[i] = j; + sq_dist = new_sq_dist; + } + } + if (sq_dist>radiuses[belongs_to[i]]) { + radiuses[belongs_to[i]] = sq_dist; + } + count[belongs_to[i]]++; + } + + bool converged = false; + int iteration = 0; + while (!converged && iterationchilds = pool_.allocate(branching); + int start = 0; + int end = start; + for (int c=0; c(), veclen_); + variance += d; + mean_radius += sqrt(d); + std::swap(indices[i],indices[end]); + std::swap(belongs_to[i],belongs_to[end]); + end++; + } + } + variance /= s; + mean_radius /= s; + variance -= distance_(centers[c], ZeroIterator(), veclen_); + + node->childs[c] = pool_.allocate(); + std::memset(node->childs[c], 0, sizeof(KMeansNode)); + node->childs[c]->radius = radiuses[c]; + node->childs[c]->pivot = centers[c]; + node->childs[c]->variance = variance; + node->childs[c]->mean_radius = mean_radius; + computeClustering(node->childs[c],indices+start, end-start, branching, level+1); + start=end; + } + } + + + + /** + * Performs one descent in the hierarchical k-means tree. The branches not + * visited are stored in a priority queue. + * + * Params: + * node = node to explore + * result = container for the k-nearest neighbors found + * vec = query points + * checks = how many points in the dataset have been checked so far + * maxChecks = maximum dataset points to checks + */ + + + void findNN(KMeansNodePtr node, ResultSet& result, const ElementType* vec, int& checks, int maxChecks, + Heap* heap) + { + // Ignore those clusters that are too far away + { + DistanceType bsq = distance_(vec, node->pivot, veclen_); + DistanceType rsq = node->radius; + DistanceType wsq = result.worstDist(); + + DistanceType val = bsq-rsq-wsq; + DistanceType val2 = val*val-4*rsq*wsq; + + //if (val>0) { + if ((val>0)&&(val2>0)) { + return; + } + } + + if (node->childs==NULL) { + if (checks>=maxChecks) { + if (result.full()) return; + } + checks += node->size; + for (int i=0; isize; ++i) { + int index = node->indices[i]; + DistanceType dist = distance_(dataset_[index], vec, veclen_); + result.addPoint(dist, index); + } + } + else { + DistanceType* domain_distances = new DistanceType[branching_]; + int closest_center = exploreNodeBranches(node, vec, domain_distances, heap); + delete[] domain_distances; + findNN(node->childs[closest_center],result,vec, checks, maxChecks, heap); + } + } + + /** + * Helper function that computes the nearest childs of a node to a given query point. + * Params: + * node = the node + * q = the query point + * distances = array with the distances to each child node. + * Returns: + */ + int exploreNodeBranches(KMeansNodePtr node, const ElementType* q, DistanceType* domain_distances, Heap* heap) + { + + int best_index = 0; + domain_distances[best_index] = distance_(q, node->childs[best_index]->pivot, veclen_); + for (int i=1; ichilds[i]->pivot, veclen_); + if (domain_distances[i]childs[best_index]->pivot; + for (int i=0; ichilds[i]->variance; + + // float dist_to_border = getDistanceToBorder(node.childs[i].pivot,best_center,q); + // if (domain_distances[i]insert(BranchSt(node->childs[i],domain_distances[i])); + } + } + + return best_index; + } + + + /** + * Function the performs exact nearest neighbor search by traversing the entire tree. + */ + void findExactNN(KMeansNodePtr node, ResultSet& result, const ElementType* vec) + { + // Ignore those clusters that are too far away + { + DistanceType bsq = distance_(vec, node->pivot, veclen_); + DistanceType rsq = node->radius; + DistanceType wsq = result.worstDist(); + + DistanceType val = bsq-rsq-wsq; + DistanceType val2 = val*val-4*rsq*wsq; + + // if (val>0) { + if ((val>0)&&(val2>0)) { + return; + } + } + + + if (node->childs==NULL) { + for (int i=0; isize; ++i) { + int index = node->indices[i]; + DistanceType dist = distance_(dataset_[index], vec, veclen_); + result.addPoint(dist, index); + } + } + else { + int* sort_indices = new int[branching_]; + + getCenterOrdering(node, vec, sort_indices); + + for (int i=0; ichilds[sort_indices[i]],result,vec); + } + + delete[] sort_indices; + } + } + + + /** + * Helper function. + * + * I computes the order in which to traverse the child nodes of a particular node. + */ + void getCenterOrdering(KMeansNodePtr node, const ElementType* q, int* sort_indices) + { + DistanceType* domain_distances = new DistanceType[branching_]; + for (int i=0; ichilds[i]->pivot, veclen_); + + int j=0; + while (domain_distances[j]j; --k) { + domain_distances[k] = domain_distances[k-1]; + sort_indices[k] = sort_indices[k-1]; + } + domain_distances[j] = dist; + sort_indices[j] = i; + } + delete[] domain_distances; + } + + /** + * Method that computes the squared distance from the query point q + * from inside region with center c to the border between this + * region and the region with center p + */ + DistanceType getDistanceToBorder(DistanceType* p, DistanceType* c, DistanceType* q) + { + DistanceType sum = 0; + DistanceType sum2 = 0; + + for (int i=0; ivariance*root->size; + + while (clusterCount::max)(); + int splitIndex = -1; + + for (int i=0; ichilds != NULL) { + + DistanceType variance = meanVariance - clusters[i]->variance*clusters[i]->size; + + for (int j=0; jchilds[j]->variance*clusters[i]->childs[j]->size; + } + if (variance clusters_length) break; + + meanVariance = minVariance; + + // split node + KMeansNodePtr toSplit = clusters[splitIndex]; + clusters[splitIndex] = toSplit->childs[0]; + for (int i=1; ichilds[i]; + } + } + + varianceValue = meanVariance/root->size; + return clusterCount; + } + +private: + /** The branching factor used in the hierarchical k-means clustering */ + int branching_; + + /** Maximum number of iterations to use when performing k-means clustering */ + int iterations_; + + /** Algorithm for choosing the cluster centers */ + flann_centers_init_t centers_init_; + + /** + * Cluster border index. This is used in the tree search phase when determining + * the closest cluster to explore next. A zero value takes into account only + * the cluster centres, a value greater then zero also take into account the size + * of the cluster. + */ + float cb_index_; + + /** + * The dataset used by this index + */ + const Matrix dataset_; + + /** Index parameters */ + IndexParams index_params_; + + /** + * Number of features in the dataset. + */ + size_t size_; + + /** + * Length of each feature. + */ + size_t veclen_; + + /** + * The root node in the tree. + */ + KMeansNodePtr root_; + + /** + * Array of indices to vectors in the dataset. + */ + int* indices_; + + /** + * The distance + */ + Distance distance_; + + /** + * Pooled memory allocator. + */ + PooledAllocator pool_; + + /** + * Memory occupied by the index. + */ + int memoryCounter_; +}; + +} + +#endif //OPENCV_FLANN_KMEANS_INDEX_H_ diff --git a/lib/opencv/include/opencv2/flann/linear_index.h b/lib/opencv/include/opencv2/flann/linear_index.h new file mode 100644 index 000000000..5aa7a5cfa --- /dev/null +++ b/lib/opencv/include/opencv2/flann/linear_index.h @@ -0,0 +1,132 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_LINEAR_INDEX_H_ +#define OPENCV_FLANN_LINEAR_INDEX_H_ + +#include "general.h" +#include "nn_index.h" + +namespace cvflann +{ + +struct LinearIndexParams : public IndexParams +{ + LinearIndexParams() + { + (* this)["algorithm"] = FLANN_INDEX_LINEAR; + } +}; + +template +class LinearIndex : public NNIndex +{ +public: + + typedef typename Distance::ElementType ElementType; + typedef typename Distance::ResultType DistanceType; + + + LinearIndex(const Matrix& inputData, const IndexParams& params = LinearIndexParams(), + Distance d = Distance()) : + dataset_(inputData), index_params_(params), distance_(d) + { + } + + LinearIndex(const LinearIndex&); + LinearIndex& operator=(const LinearIndex&); + + flann_algorithm_t getType() const + { + return FLANN_INDEX_LINEAR; + } + + + size_t size() const + { + return dataset_.rows; + } + + size_t veclen() const + { + return dataset_.cols; + } + + + int usedMemory() const + { + return 0; + } + + void buildIndex() + { + /* nothing to do here for linear search */ + } + + void saveIndex(FILE*) + { + /* nothing to do here for linear search */ + } + + + void loadIndex(FILE*) + { + /* nothing to do here for linear search */ + + index_params_["algorithm"] = getType(); + } + + void findNeighbors(ResultSet& resultSet, const ElementType* vec, const SearchParams& /*searchParams*/) + { + ElementType* data = dataset_.data; + for (size_t i = 0; i < dataset_.rows; ++i, data += dataset_.cols) { + DistanceType dist = distance_(data, vec, dataset_.cols); + resultSet.addPoint(dist, (int)i); + } + } + + IndexParams getParameters() const + { + return index_params_; + } + +private: + /** The dataset */ + const Matrix dataset_; + /** Index parameters */ + IndexParams index_params_; + /** Index distance */ + Distance distance_; + +}; + +} + +#endif // OPENCV_FLANN_LINEAR_INDEX_H_ diff --git a/lib/opencv/include/opencv2/flann/logger.h b/lib/opencv/include/opencv2/flann/logger.h new file mode 100644 index 000000000..24f3fb698 --- /dev/null +++ b/lib/opencv/include/opencv2/flann/logger.h @@ -0,0 +1,130 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_LOGGER_H +#define OPENCV_FLANN_LOGGER_H + +#include +#include + +#include "defines.h" + + +namespace cvflann +{ + +class Logger +{ + Logger() : stream(stdout), logLevel(FLANN_LOG_WARN) {} + + ~Logger() + { + if ((stream!=NULL)&&(stream!=stdout)) { + fclose(stream); + } + } + + static Logger& instance() + { + static Logger logger; + return logger; + } + + void _setDestination(const char* name) + { + if (name==NULL) { + stream = stdout; + } + else { + stream = fopen(name,"w"); + if (stream == NULL) { + stream = stdout; + } + } + } + + int _log(int level, const char* fmt, va_list arglist) + { + if (level > logLevel ) return -1; + int ret = vfprintf(stream, fmt, arglist); + return ret; + } + +public: + /** + * Sets the logging level. All messages with lower priority will be ignored. + * @param level Logging level + */ + static void setLevel(int level) { instance().logLevel = level; } + + /** + * Sets the logging destination + * @param name Filename or NULL for console + */ + static void setDestination(const char* name) { instance()._setDestination(name); } + + /** + * Print log message + * @param level Log level + * @param fmt Message format + * @return + */ + static int log(int level, const char* fmt, ...) + { + va_list arglist; + va_start(arglist, fmt); + int ret = instance()._log(level,fmt,arglist); + va_end(arglist); + return ret; + } + +#define LOG_METHOD(NAME,LEVEL) \ + static int NAME(const char* fmt, ...) \ + { \ + va_list ap; \ + va_start(ap, fmt); \ + int ret = instance()._log(LEVEL, fmt, ap); \ + va_end(ap); \ + return ret; \ + } + + LOG_METHOD(fatal, FLANN_LOG_FATAL) + LOG_METHOD(error, FLANN_LOG_ERROR) + LOG_METHOD(warn, FLANN_LOG_WARN) + LOG_METHOD(info, FLANN_LOG_INFO) + +private: + FILE* stream; + int logLevel; +}; + +} + +#endif //OPENCV_FLANN_LOGGER_H diff --git a/lib/opencv/include/opencv2/flann/lsh_index.h b/lib/opencv/include/opencv2/flann/lsh_index.h new file mode 100644 index 000000000..4d4670ea5 --- /dev/null +++ b/lib/opencv/include/opencv2/flann/lsh_index.h @@ -0,0 +1,392 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + *************************************************************************/ + +/*********************************************************************** + * Author: Vincent Rabaud + *************************************************************************/ + +#ifndef OPENCV_FLANN_LSH_INDEX_H_ +#define OPENCV_FLANN_LSH_INDEX_H_ + +#include +#include +#include +#include +#include + +#include "general.h" +#include "nn_index.h" +#include "matrix.h" +#include "result_set.h" +#include "heap.h" +#include "lsh_table.h" +#include "allocator.h" +#include "random.h" +#include "saving.h" + +namespace cvflann +{ + +struct LshIndexParams : public IndexParams +{ + LshIndexParams(unsigned int table_number = 12, unsigned int key_size = 20, unsigned int multi_probe_level = 2) + { + (* this)["algorithm"] = FLANN_INDEX_LSH; + // The number of hash tables to use + (*this)["table_number"] = table_number; + // The length of the key in the hash tables + (*this)["key_size"] = key_size; + // Number of levels to use in multi-probe (0 for standard LSH) + (*this)["multi_probe_level"] = multi_probe_level; + } +}; + +/** + * Randomized kd-tree index + * + * Contains the k-d trees and other information for indexing a set of points + * for nearest-neighbor matching. + */ +template +class LshIndex : public NNIndex +{ +public: + typedef typename Distance::ElementType ElementType; + typedef typename Distance::ResultType DistanceType; + + /** Constructor + * @param input_data dataset with the input features + * @param params parameters passed to the LSH algorithm + * @param d the distance used + */ + LshIndex(const Matrix& input_data, const IndexParams& params = LshIndexParams(), + Distance d = Distance()) : + dataset_(input_data), index_params_(params), distance_(d) + { + // cv::flann::IndexParams sets integer params as 'int', so it is used with get_param + // in place of 'unsigned int' + table_number_ = (unsigned int)get_param(index_params_,"table_number",12); + key_size_ = (unsigned int)get_param(index_params_,"key_size",20); + multi_probe_level_ = (unsigned int)get_param(index_params_,"multi_probe_level",2); + + feature_size_ = (unsigned)dataset_.cols; + fill_xor_mask(0, key_size_, multi_probe_level_, xor_masks_); + } + + + LshIndex(const LshIndex&); + LshIndex& operator=(const LshIndex&); + + /** + * Builds the index + */ + void buildIndex() + { + tables_.resize(table_number_); + for (unsigned int i = 0; i < table_number_; ++i) { + lsh::LshTable& table = tables_[i]; + table = lsh::LshTable(feature_size_, key_size_); + + // Add the features to the table + table.add(dataset_); + } + } + + flann_algorithm_t getType() const + { + return FLANN_INDEX_LSH; + } + + + void saveIndex(FILE* stream) + { + save_value(stream,table_number_); + save_value(stream,key_size_); + save_value(stream,multi_probe_level_); + save_value(stream, dataset_); + } + + void loadIndex(FILE* stream) + { + load_value(stream, table_number_); + load_value(stream, key_size_); + load_value(stream, multi_probe_level_); + load_value(stream, dataset_); + // Building the index is so fast we can afford not storing it + buildIndex(); + + index_params_["algorithm"] = getType(); + index_params_["table_number"] = table_number_; + index_params_["key_size"] = key_size_; + index_params_["multi_probe_level"] = multi_probe_level_; + } + + /** + * Returns size of index. + */ + size_t size() const + { + return dataset_.rows; + } + + /** + * Returns the length of an index feature. + */ + size_t veclen() const + { + return feature_size_; + } + + /** + * Computes the index memory usage + * Returns: memory used by the index + */ + int usedMemory() const + { + return (int)(dataset_.rows * sizeof(int)); + } + + + IndexParams getParameters() const + { + return index_params_; + } + + /** + * \brief Perform k-nearest neighbor search + * \param[in] queries The query points for which to find the nearest neighbors + * \param[out] indices The indices of the nearest neighbors found + * \param[out] dists Distances to the nearest neighbors found + * \param[in] knn Number of nearest neighbors to return + * \param[in] params Search parameters + */ + virtual void knnSearch(const Matrix& queries, Matrix& indices, Matrix& dists, int knn, const SearchParams& params) + { + assert(queries.cols == veclen()); + assert(indices.rows >= queries.rows); + assert(dists.rows >= queries.rows); + assert(int(indices.cols) >= knn); + assert(int(dists.cols) >= knn); + + + KNNUniqueResultSet resultSet(knn); + for (size_t i = 0; i < queries.rows; i++) { + resultSet.clear(); + std::fill_n(indices[i], knn, -1); + std::fill_n(dists[i], knn, std::numeric_limits::max()); + findNeighbors(resultSet, queries[i], params); + if (get_param(params,"sorted",true)) resultSet.sortAndCopy(indices[i], dists[i], knn); + else resultSet.copy(indices[i], dists[i], knn); + } + } + + + /** + * Find set of nearest neighbors to vec. Their indices are stored inside + * the result object. + * + * Params: + * result = the result object in which the indices of the nearest-neighbors are stored + * vec = the vector for which to search the nearest neighbors + * maxCheck = the maximum number of restarts (in a best-bin-first manner) + */ + void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& /*searchParams*/) + { + getNeighbors(vec, result); + } + +private: + /** Defines the comparator on score and index + */ + typedef std::pair ScoreIndexPair; + struct SortScoreIndexPairOnSecond + { + bool operator()(const ScoreIndexPair& left, const ScoreIndexPair& right) const + { + return left.second < right.second; + } + }; + + /** Fills the different xor masks to use when getting the neighbors in multi-probe LSH + * @param key the key we build neighbors from + * @param lowest_index the lowest index of the bit set + * @param level the multi-probe level we are at + * @param xor_masks all the xor mask + */ + void fill_xor_mask(lsh::BucketKey key, int lowest_index, unsigned int level, + std::vector& xor_masks) + { + xor_masks.push_back(key); + if (level == 0) return; + for (int index = lowest_index - 1; index >= 0; --index) { + // Create a new key + lsh::BucketKey new_key = key | (1 << index); + fill_xor_mask(new_key, index, level - 1, xor_masks); + } + } + + /** Performs the approximate nearest-neighbor search. + * @param vec the feature to analyze + * @param do_radius flag indicating if we check the radius too + * @param radius the radius if it is a radius search + * @param do_k flag indicating if we limit the number of nn + * @param k_nn the number of nearest neighbors + * @param checked_average used for debugging + */ + void getNeighbors(const ElementType* vec, bool /*do_radius*/, float radius, bool do_k, unsigned int k_nn, + float& /*checked_average*/) + { + static std::vector score_index_heap; + + if (do_k) { + unsigned int worst_score = std::numeric_limits::max(); + typename std::vector >::const_iterator table = tables_.begin(); + typename std::vector >::const_iterator table_end = tables_.end(); + for (; table != table_end; ++table) { + size_t key = table->getKey(vec); + std::vector::const_iterator xor_mask = xor_masks_.begin(); + std::vector::const_iterator xor_mask_end = xor_masks_.end(); + for (; xor_mask != xor_mask_end; ++xor_mask) { + size_t sub_key = key ^ (*xor_mask); + const lsh::Bucket* bucket = table->getBucketFromKey(sub_key); + if (bucket == 0) continue; + + // Go over each descriptor index + std::vector::const_iterator training_index = bucket->begin(); + std::vector::const_iterator last_training_index = bucket->end(); + DistanceType hamming_distance; + + // Process the rest of the candidates + for (; training_index < last_training_index; ++training_index) { + hamming_distance = distance_(vec, dataset_[*training_index], dataset_.cols); + + if (hamming_distance < worst_score) { + // Insert the new element + score_index_heap.push_back(ScoreIndexPair(hamming_distance, training_index)); + std::push_heap(score_index_heap.begin(), score_index_heap.end()); + + if (score_index_heap.size() > (unsigned int)k_nn) { + // Remove the highest distance value as we have too many elements + std::pop_heap(score_index_heap.begin(), score_index_heap.end()); + score_index_heap.pop_back(); + // Keep track of the worst score + worst_score = score_index_heap.front().first; + } + } + } + } + } + } + else { + typename std::vector >::const_iterator table = tables_.begin(); + typename std::vector >::const_iterator table_end = tables_.end(); + for (; table != table_end; ++table) { + size_t key = table->getKey(vec); + std::vector::const_iterator xor_mask = xor_masks_.begin(); + std::vector::const_iterator xor_mask_end = xor_masks_.end(); + for (; xor_mask != xor_mask_end; ++xor_mask) { + size_t sub_key = key ^ (*xor_mask); + const lsh::Bucket* bucket = table->getBucketFromKey(sub_key); + if (bucket == 0) continue; + + // Go over each descriptor index + std::vector::const_iterator training_index = bucket->begin(); + std::vector::const_iterator last_training_index = bucket->end(); + DistanceType hamming_distance; + + // Process the rest of the candidates + for (; training_index < last_training_index; ++training_index) { + // Compute the Hamming distance + hamming_distance = distance_(vec, dataset_[*training_index], dataset_.cols); + if (hamming_distance < radius) score_index_heap.push_back(ScoreIndexPair(hamming_distance, training_index)); + } + } + } + } + } + + /** Performs the approximate nearest-neighbor search. + * This is a slower version than the above as it uses the ResultSet + * @param vec the feature to analyze + */ + void getNeighbors(const ElementType* vec, ResultSet& result) + { + typename std::vector >::const_iterator table = tables_.begin(); + typename std::vector >::const_iterator table_end = tables_.end(); + for (; table != table_end; ++table) { + size_t key = table->getKey(vec); + std::vector::const_iterator xor_mask = xor_masks_.begin(); + std::vector::const_iterator xor_mask_end = xor_masks_.end(); + for (; xor_mask != xor_mask_end; ++xor_mask) { + size_t sub_key = key ^ (*xor_mask); + const lsh::Bucket* bucket = table->getBucketFromKey((lsh::BucketKey)sub_key); + if (bucket == 0) continue; + + // Go over each descriptor index + std::vector::const_iterator training_index = bucket->begin(); + std::vector::const_iterator last_training_index = bucket->end(); + DistanceType hamming_distance; + + // Process the rest of the candidates + for (; training_index < last_training_index; ++training_index) { + // Compute the Hamming distance + hamming_distance = distance_(vec, dataset_[*training_index], (int)dataset_.cols); + result.addPoint(hamming_distance, *training_index); + } + } + } + } + + /** The different hash tables */ + std::vector > tables_; + + /** The data the LSH tables where built from */ + Matrix dataset_; + + /** The size of the features (as ElementType[]) */ + unsigned int feature_size_; + + IndexParams index_params_; + + /** table number */ + unsigned int table_number_; + /** key size */ + unsigned int key_size_; + /** How far should we look for neighbors in multi-probe LSH */ + unsigned int multi_probe_level_; + + /** The XOR masks to apply to a key to get the neighboring buckets */ + std::vector xor_masks_; + + Distance distance_; +}; +} + +#endif //OPENCV_FLANN_LSH_INDEX_H_ diff --git a/lib/opencv/include/opencv2/flann/lsh_table.h b/lib/opencv/include/opencv2/flann/lsh_table.h new file mode 100644 index 000000000..582dcdb2f --- /dev/null +++ b/lib/opencv/include/opencv2/flann/lsh_table.h @@ -0,0 +1,492 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + *************************************************************************/ + +/*********************************************************************** + * Author: Vincent Rabaud + *************************************************************************/ + +#ifndef OPENCV_FLANN_LSH_TABLE_H_ +#define OPENCV_FLANN_LSH_TABLE_H_ + +#include +#include +#include +#include +// TODO as soon as we use C++0x, use the code in USE_UNORDERED_MAP +#ifdef __GXX_EXPERIMENTAL_CXX0X__ +# define USE_UNORDERED_MAP 1 +#else +# define USE_UNORDERED_MAP 0 +#endif +#if USE_UNORDERED_MAP +#include +#else +#include +#endif +#include +#include + +#include "dynamic_bitset.h" +#include "matrix.h" + +namespace cvflann +{ + +namespace lsh +{ + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** What is stored in an LSH bucket + */ +typedef uint32_t FeatureIndex; +/** The id from which we can get a bucket back in an LSH table + */ +typedef unsigned int BucketKey; + +/** A bucket in an LSH table + */ +typedef std::vector Bucket; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** POD for stats about an LSH table + */ +struct LshStats +{ + std::vector bucket_sizes_; + size_t n_buckets_; + size_t bucket_size_mean_; + size_t bucket_size_median_; + size_t bucket_size_min_; + size_t bucket_size_max_; + size_t bucket_size_std_dev; + /** Each contained vector contains three value: beginning/end for interval, number of elements in the bin + */ + std::vector > size_histogram_; +}; + +/** Overload the << operator for LshStats + * @param out the streams + * @param stats the stats to display + * @return the streams + */ +inline std::ostream& operator <<(std::ostream& out, const LshStats& stats) +{ + int w = 20; + out << "Lsh Table Stats:\n" << std::setw(w) << std::setiosflags(std::ios::right) << "N buckets : " + << stats.n_buckets_ << "\n" << std::setw(w) << std::setiosflags(std::ios::right) << "mean size : " + << std::setiosflags(std::ios::left) << stats.bucket_size_mean_ << "\n" << std::setw(w) + << std::setiosflags(std::ios::right) << "median size : " << stats.bucket_size_median_ << "\n" << std::setw(w) + << std::setiosflags(std::ios::right) << "min size : " << std::setiosflags(std::ios::left) + << stats.bucket_size_min_ << "\n" << std::setw(w) << std::setiosflags(std::ios::right) << "max size : " + << std::setiosflags(std::ios::left) << stats.bucket_size_max_; + + // Display the histogram + out << std::endl << std::setw(w) << std::setiosflags(std::ios::right) << "histogram : " + << std::setiosflags(std::ios::left); + for (std::vector >::const_iterator iterator = stats.size_histogram_.begin(), end = + stats.size_histogram_.end(); iterator != end; ++iterator) out << (*iterator)[0] << "-" << (*iterator)[1] << ": " << (*iterator)[2] << ", "; + + return out; +} + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** Lsh hash table. As its key is a sub-feature, and as usually + * the size of it is pretty small, we keep it as a continuous memory array. + * The value is an index in the corpus of features (we keep it as an unsigned + * int for pure memory reasons, it could be a size_t) + */ +template +class LshTable +{ +public: + /** A container of all the feature indices. Optimized for space + */ +#if USE_UNORDERED_MAP + typedef std::unordered_map BucketsSpace; +#else + typedef std::map BucketsSpace; +#endif + + /** A container of all the feature indices. Optimized for speed + */ + typedef std::vector BucketsSpeed; + + /** Default constructor + */ + LshTable() + { + } + + /** Default constructor + * Create the mask and allocate the memory + * @param feature_size is the size of the feature (considered as a ElementType[]) + * @param key_size is the number of bits that are turned on in the feature + */ + LshTable(unsigned int feature_size, unsigned int key_size) + { + (void)feature_size; + (void)key_size; + std::cerr << "LSH is not implemented for that type" << std::endl; + assert(0); + } + + /** Add a feature to the table + * @param value the value to store for that feature + * @param feature the feature itself + */ + void add(unsigned int value, const ElementType* feature) + { + // Add the value to the corresponding bucket + BucketKey key = (lsh::BucketKey)getKey(feature); + + switch (speed_level_) { + case kArray: + // That means we get the buckets from an array + buckets_speed_[key].push_back(value); + break; + case kBitsetHash: + // That means we can check the bitset for the presence of a key + key_bitset_.set(key); + buckets_space_[key].push_back(value); + break; + case kHash: + { + // That means we have to check for the hash table for the presence of a key + buckets_space_[key].push_back(value); + break; + } + } + } + + /** Add a set of features to the table + * @param dataset the values to store + */ + void add(Matrix dataset) + { +#if USE_UNORDERED_MAP + buckets_space_.rehash((buckets_space_.size() + dataset.rows) * 1.2); +#endif + // Add the features to the table + for (unsigned int i = 0; i < dataset.rows; ++i) add(i, dataset[i]); + // Now that the table is full, optimize it for speed/space + optimize(); + } + + /** Get a bucket given the key + * @param key + * @return + */ + inline const Bucket* getBucketFromKey(BucketKey key) const + { + // Generate other buckets + switch (speed_level_) { + case kArray: + // That means we get the buckets from an array + return &buckets_speed_[key]; + break; + case kBitsetHash: + // That means we can check the bitset for the presence of a key + if (key_bitset_.test(key)) return &buckets_space_.find(key)->second; + else return 0; + break; + case kHash: + { + // That means we have to check for the hash table for the presence of a key + BucketsSpace::const_iterator bucket_it, bucket_end = buckets_space_.end(); + bucket_it = buckets_space_.find(key); + // Stop here if that bucket does not exist + if (bucket_it == bucket_end) return 0; + else return &bucket_it->second; + break; + } + } + return 0; + } + + /** Compute the sub-signature of a feature + */ + size_t getKey(const ElementType* /*feature*/) const + { + std::cerr << "LSH is not implemented for that type" << std::endl; + assert(0); + return 1; + } + + /** Get statistics about the table + * @return + */ + LshStats getStats() const; + +private: + /** defines the speed fo the implementation + * kArray uses a vector for storing data + * kBitsetHash uses a hash map but checks for the validity of a key with a bitset + * kHash uses a hash map only + */ + enum SpeedLevel + { + kArray, kBitsetHash, kHash + }; + + /** Initialize some variables + */ + void initialize(size_t key_size) + { + const size_t key_size_lower_bound = 1; + //a value (size_t(1) << key_size) must fit the size_t type so key_size has to be strictly less than size of size_t + const size_t key_size_upper_bound = std::min(sizeof(BucketKey) * CHAR_BIT + 1, sizeof(size_t) * CHAR_BIT); + if (key_size < key_size_lower_bound || key_size >= key_size_upper_bound) + { + CV_Error(cv::Error::StsBadArg, cv::format("Invalid key_size (=%d). Valid values for your system are %d <= key_size < %d.", (int)key_size, (int)key_size_lower_bound, (int)key_size_upper_bound)); + } + + speed_level_ = kHash; + key_size_ = (unsigned)key_size; + } + + /** Optimize the table for speed/space + */ + void optimize() + { + // If we are already using the fast storage, no need to do anything + if (speed_level_ == kArray) return; + + // Use an array if it will be more than half full + if (buckets_space_.size() > ((size_t(1) << key_size_) / 2)) { + speed_level_ = kArray; + // Fill the array version of it + buckets_speed_.resize(size_t(1) << key_size_); + for (BucketsSpace::const_iterator key_bucket = buckets_space_.begin(); key_bucket != buckets_space_.end(); ++key_bucket) buckets_speed_[key_bucket->first] = key_bucket->second; + + // Empty the hash table + buckets_space_.clear(); + return; + } + + // If the bitset is going to use less than 10% of the RAM of the hash map (at least 1 size_t for the key and two + // for the vector) or less than 512MB (key_size_ <= 30) + if (((std::max(buckets_space_.size(), buckets_speed_.size()) * CHAR_BIT * 3 * sizeof(BucketKey)) / 10 + >= (size_t(1) << key_size_)) || (key_size_ <= 32)) { + speed_level_ = kBitsetHash; + key_bitset_.resize(size_t(1) << key_size_); + key_bitset_.reset(); + // Try with the BucketsSpace + for (BucketsSpace::const_iterator key_bucket = buckets_space_.begin(); key_bucket != buckets_space_.end(); ++key_bucket) key_bitset_.set(key_bucket->first); + } + else { + speed_level_ = kHash; + key_bitset_.clear(); + } + } + + /** The vector of all the buckets if they are held for speed + */ + BucketsSpeed buckets_speed_; + + /** The hash table of all the buckets in case we cannot use the speed version + */ + BucketsSpace buckets_space_; + + /** What is used to store the data */ + SpeedLevel speed_level_; + + /** If the subkey is small enough, it will keep track of which subkeys are set through that bitset + * That is just a speedup so that we don't look in the hash table (which can be mush slower that checking a bitset) + */ + DynamicBitset key_bitset_; + + /** The size of the sub-signature in bits + */ + unsigned int key_size_; + + // Members only used for the unsigned char specialization + /** The mask to apply to a feature to get the hash key + * Only used in the unsigned char case + */ + std::vector mask_; +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Specialization for unsigned char + +template<> +inline LshTable::LshTable(unsigned int feature_size, unsigned int subsignature_size) +{ + initialize(subsignature_size); + // Allocate the mask + mask_ = std::vector((size_t)ceil((float)(feature_size * sizeof(char)) / (float)sizeof(size_t)), 0); + + // A bit brutal but fast to code + std::vector indices(feature_size * CHAR_BIT); + for (size_t i = 0; i < feature_size * CHAR_BIT; ++i) indices[i] = i; + std::random_shuffle(indices.begin(), indices.end()); + + // Generate a random set of order of subsignature_size_ bits + for (unsigned int i = 0; i < key_size_; ++i) { + size_t index = indices[i]; + + // Set that bit in the mask + size_t divisor = CHAR_BIT * sizeof(size_t); + size_t idx = index / divisor; //pick the right size_t index + mask_[idx] |= size_t(1) << (index % divisor); //use modulo to find the bit offset + } + + // Set to 1 if you want to display the mask for debug +#if 0 + { + size_t bcount = 0; + BOOST_FOREACH(size_t mask_block, mask_){ + out << std::setw(sizeof(size_t) * CHAR_BIT / 4) << std::setfill('0') << std::hex << mask_block + << std::endl; + bcount += __builtin_popcountll(mask_block); + } + out << "bit count : " << std::dec << bcount << std::endl; + out << "mask size : " << mask_.size() << std::endl; + return out; + } +#endif +} + +/** Return the Subsignature of a feature + * @param feature the feature to analyze + */ +template<> +inline size_t LshTable::getKey(const unsigned char* feature) const +{ + // no need to check if T is dividable by sizeof(size_t) like in the Hamming + // distance computation as we have a mask + const size_t* feature_block_ptr = reinterpret_cast ((const void*)feature); + + // Figure out the subsignature of the feature + // Given the feature ABCDEF, and the mask 001011, the output will be + // 000CEF + size_t subsignature = 0; + size_t bit_index = 1; + + for (std::vector::const_iterator pmask_block = mask_.begin(); pmask_block != mask_.end(); ++pmask_block) { + // get the mask and signature blocks + size_t feature_block = *feature_block_ptr; + size_t mask_block = *pmask_block; + while (mask_block) { + // Get the lowest set bit in the mask block + size_t lowest_bit = mask_block & (-(ptrdiff_t)mask_block); + // Add it to the current subsignature if necessary + subsignature += (feature_block & lowest_bit) ? bit_index : 0; + // Reset the bit in the mask block + mask_block ^= lowest_bit; + // increment the bit index for the subsignature + bit_index <<= 1; + } + // Check the next feature block + ++feature_block_ptr; + } + return subsignature; +} + +template<> +inline LshStats LshTable::getStats() const +{ + LshStats stats; + stats.bucket_size_mean_ = 0; + if ((buckets_speed_.empty()) && (buckets_space_.empty())) { + stats.n_buckets_ = 0; + stats.bucket_size_median_ = 0; + stats.bucket_size_min_ = 0; + stats.bucket_size_max_ = 0; + return stats; + } + + if (!buckets_speed_.empty()) { + for (BucketsSpeed::const_iterator pbucket = buckets_speed_.begin(); pbucket != buckets_speed_.end(); ++pbucket) { + stats.bucket_sizes_.push_back((lsh::FeatureIndex)pbucket->size()); + stats.bucket_size_mean_ += pbucket->size(); + } + stats.bucket_size_mean_ /= buckets_speed_.size(); + stats.n_buckets_ = buckets_speed_.size(); + } + else { + for (BucketsSpace::const_iterator x = buckets_space_.begin(); x != buckets_space_.end(); ++x) { + stats.bucket_sizes_.push_back((lsh::FeatureIndex)x->second.size()); + stats.bucket_size_mean_ += x->second.size(); + } + stats.bucket_size_mean_ /= buckets_space_.size(); + stats.n_buckets_ = buckets_space_.size(); + } + + std::sort(stats.bucket_sizes_.begin(), stats.bucket_sizes_.end()); + + // BOOST_FOREACH(int size, stats.bucket_sizes_) + // std::cout << size << " "; + // std::cout << std::endl; + stats.bucket_size_median_ = stats.bucket_sizes_[stats.bucket_sizes_.size() / 2]; + stats.bucket_size_min_ = stats.bucket_sizes_.front(); + stats.bucket_size_max_ = stats.bucket_sizes_.back(); + + // TODO compute mean and std + /*float mean, stddev; + stats.bucket_size_mean_ = mean; + stats.bucket_size_std_dev = stddev;*/ + + // Include a histogram of the buckets + unsigned int bin_start = 0; + unsigned int bin_end = 20; + bool is_new_bin = true; + for (std::vector::iterator iterator = stats.bucket_sizes_.begin(), end = stats.bucket_sizes_.end(); iterator + != end; ) + if (*iterator < bin_end) { + if (is_new_bin) { + stats.size_histogram_.push_back(std::vector(3, 0)); + stats.size_histogram_.back()[0] = bin_start; + stats.size_histogram_.back()[1] = bin_end - 1; + is_new_bin = false; + } + ++stats.size_histogram_.back()[2]; + ++iterator; + } + else { + bin_start += 20; + bin_end += 20; + is_new_bin = true; + } + + return stats; +} + +// End the two namespaces +} +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#endif /* OPENCV_FLANN_LSH_TABLE_H_ */ diff --git a/lib/opencv/include/opencv2/flann/matrix.h b/lib/opencv/include/opencv2/flann/matrix.h new file mode 100644 index 000000000..51b6c6352 --- /dev/null +++ b/lib/opencv/include/opencv2/flann/matrix.h @@ -0,0 +1,116 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_DATASET_H_ +#define OPENCV_FLANN_DATASET_H_ + +#include + +#include "general.h" + +namespace cvflann +{ + +/** + * Class that implements a simple rectangular matrix stored in a memory buffer and + * provides convenient matrix-like access using the [] operators. + */ +template +class Matrix +{ +public: + typedef T type; + + size_t rows; + size_t cols; + size_t stride; + T* data; + + Matrix() : rows(0), cols(0), stride(0), data(NULL) + { + } + + Matrix(T* data_, size_t rows_, size_t cols_, size_t stride_ = 0) : + rows(rows_), cols(cols_), stride(stride_), data(data_) + { + if (stride==0) stride = cols; + } + + /** + * Convenience function for deallocating the storage data. + */ + FLANN_DEPRECATED void free() + { + fprintf(stderr, "The cvflann::Matrix::free() method is deprecated " + "and it does not do any memory deallocation any more. You are" + "responsible for deallocating the matrix memory (by doing" + "'delete[] matrix.data' for example)"); + } + + /** + * Operator that return a (pointer to a) row of the data. + */ + T* operator[](size_t index) const + { + return data+index*stride; + } +}; + + +class UntypedMatrix +{ +public: + size_t rows; + size_t cols; + void* data; + flann_datatype_t type; + + UntypedMatrix(void* data_, long rows_, long cols_) : + rows(rows_), cols(cols_), data(data_) + { + } + + ~UntypedMatrix() + { + } + + + template + Matrix as() + { + return Matrix((T*)data, rows, cols); + } +}; + + + +} + +#endif //OPENCV_FLANN_DATASET_H_ diff --git a/lib/opencv/include/opencv2/flann/miniflann.hpp b/lib/opencv/include/opencv2/flann/miniflann.hpp new file mode 100644 index 000000000..02fa236d3 --- /dev/null +++ b/lib/opencv/include/opencv2/flann/miniflann.hpp @@ -0,0 +1,158 @@ +/*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_MINIFLANN_HPP_ +#define _OPENCV_MINIFLANN_HPP_ + +#include "opencv2/core.hpp" +#include "opencv2/flann/defines.h" + +namespace cv +{ + +namespace flann +{ + +struct CV_EXPORTS IndexParams +{ + IndexParams(); + ~IndexParams(); + + String getString(const String& key, const String& defaultVal=String()) const; + int getInt(const String& key, int defaultVal=-1) const; + double getDouble(const String& key, double defaultVal=-1) const; + + void setString(const String& key, const String& value); + void setInt(const String& key, int value); + void setDouble(const String& key, double value); + void setFloat(const String& key, float value); + void setBool(const String& key, bool value); + void setAlgorithm(int value); + + void getAll(std::vector& names, + std::vector& types, + std::vector& strValues, + std::vector& numValues) const; + + void* params; +}; + +struct CV_EXPORTS KDTreeIndexParams : public IndexParams +{ + KDTreeIndexParams(int trees=4); +}; + +struct CV_EXPORTS LinearIndexParams : public IndexParams +{ + LinearIndexParams(); +}; + +struct CV_EXPORTS CompositeIndexParams : public IndexParams +{ + CompositeIndexParams(int trees = 4, int branching = 32, int iterations = 11, + cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM, float cb_index = 0.2f ); +}; + +struct CV_EXPORTS AutotunedIndexParams : public IndexParams +{ + AutotunedIndexParams(float target_precision = 0.8f, float build_weight = 0.01f, + float memory_weight = 0, float sample_fraction = 0.1f); +}; + +struct CV_EXPORTS HierarchicalClusteringIndexParams : public IndexParams +{ + HierarchicalClusteringIndexParams(int branching = 32, + cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM, int trees = 4, int leaf_size = 100 ); +}; + +struct CV_EXPORTS KMeansIndexParams : public IndexParams +{ + KMeansIndexParams(int branching = 32, int iterations = 11, + cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM, float cb_index = 0.2f ); +}; + +struct CV_EXPORTS LshIndexParams : public IndexParams +{ + LshIndexParams(int table_number, int key_size, int multi_probe_level); +}; + +struct CV_EXPORTS SavedIndexParams : public IndexParams +{ + SavedIndexParams(const String& filename); +}; + +struct CV_EXPORTS SearchParams : public IndexParams +{ + SearchParams( int checks = 32, float eps = 0, bool sorted = true ); +}; + +class CV_EXPORTS_W Index +{ +public: + CV_WRAP Index(); + CV_WRAP Index(InputArray features, const IndexParams& params, cvflann::flann_distance_t distType=cvflann::FLANN_DIST_L2); + virtual ~Index(); + + CV_WRAP virtual void build(InputArray features, const IndexParams& params, cvflann::flann_distance_t distType=cvflann::FLANN_DIST_L2); + CV_WRAP virtual void knnSearch(InputArray query, OutputArray indices, + OutputArray dists, int knn, const SearchParams& params=SearchParams()); + + CV_WRAP virtual int radiusSearch(InputArray query, OutputArray indices, + OutputArray dists, double radius, int maxResults, + const SearchParams& params=SearchParams()); + + CV_WRAP virtual void save(const String& filename) const; + CV_WRAP virtual bool load(InputArray features, const String& filename); + CV_WRAP virtual void release(); + CV_WRAP cvflann::flann_distance_t getDistance() const; + CV_WRAP cvflann::flann_algorithm_t getAlgorithm() const; + +protected: + cvflann::flann_distance_t distType; + cvflann::flann_algorithm_t algo; + int featureType; + void* index; +}; + +} } // namespace cv::flann + +#endif diff --git a/lib/opencv/include/opencv2/flann/nn_index.h b/lib/opencv/include/opencv2/flann/nn_index.h new file mode 100644 index 000000000..381d4bc3c --- /dev/null +++ b/lib/opencv/include/opencv2/flann/nn_index.h @@ -0,0 +1,177 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_NNINDEX_H +#define OPENCV_FLANN_NNINDEX_H + +#include "general.h" +#include "matrix.h" +#include "result_set.h" +#include "params.h" + +namespace cvflann +{ + +/** + * Nearest-neighbour index base class + */ +template +class NNIndex +{ + typedef typename Distance::ElementType ElementType; + typedef typename Distance::ResultType DistanceType; + +public: + + virtual ~NNIndex() {} + + /** + * \brief Builds the index + */ + virtual void buildIndex() = 0; + + /** + * \brief Perform k-nearest neighbor search + * \param[in] queries The query points for which to find the nearest neighbors + * \param[out] indices The indices of the nearest neighbors found + * \param[out] dists Distances to the nearest neighbors found + * \param[in] knn Number of nearest neighbors to return + * \param[in] params Search parameters + */ + virtual void knnSearch(const Matrix& queries, Matrix& indices, Matrix& dists, int knn, const SearchParams& params) + { + assert(queries.cols == veclen()); + assert(indices.rows >= queries.rows); + assert(dists.rows >= queries.rows); + assert(int(indices.cols) >= knn); + assert(int(dists.cols) >= knn); + +#if 0 + KNNResultSet resultSet(knn); + for (size_t i = 0; i < queries.rows; i++) { + resultSet.init(indices[i], dists[i]); + findNeighbors(resultSet, queries[i], params); + } +#else + KNNUniqueResultSet resultSet(knn); + for (size_t i = 0; i < queries.rows; i++) { + resultSet.clear(); + findNeighbors(resultSet, queries[i], params); + if (get_param(params,"sorted",true)) resultSet.sortAndCopy(indices[i], dists[i], knn); + else resultSet.copy(indices[i], dists[i], knn); + } +#endif + } + + /** + * \brief Perform radius search + * \param[in] query The query point + * \param[out] indices The indinces of the neighbors found within the given radius + * \param[out] dists The distances to the nearest neighbors found + * \param[in] radius The radius used for search + * \param[in] params Search parameters + * \returns Number of neighbors found + */ + virtual int radiusSearch(const Matrix& query, Matrix& indices, Matrix& dists, float radius, const SearchParams& params) + { + if (query.rows != 1) { + fprintf(stderr, "I can only search one feature at a time for range search\n"); + return -1; + } + assert(query.cols == veclen()); + assert(indices.cols == dists.cols); + + int n = 0; + int* indices_ptr = NULL; + DistanceType* dists_ptr = NULL; + if (indices.cols > 0) { + n = (int)indices.cols; + indices_ptr = indices[0]; + dists_ptr = dists[0]; + } + + RadiusUniqueResultSet resultSet((DistanceType)radius); + resultSet.clear(); + findNeighbors(resultSet, query[0], params); + if (n>0) { + if (get_param(params,"sorted",true)) resultSet.sortAndCopy(indices_ptr, dists_ptr, n); + else resultSet.copy(indices_ptr, dists_ptr, n); + } + + return (int)resultSet.size(); + } + + /** + * \brief Saves the index to a stream + * \param stream The stream to save the index to + */ + virtual void saveIndex(FILE* stream) = 0; + + /** + * \brief Loads the index from a stream + * \param stream The stream from which the index is loaded + */ + virtual void loadIndex(FILE* stream) = 0; + + /** + * \returns number of features in this index. + */ + virtual size_t size() const = 0; + + /** + * \returns The dimensionality of the features in this index. + */ + virtual size_t veclen() const = 0; + + /** + * \returns The amount of memory (in bytes) used by the index. + */ + virtual int usedMemory() const = 0; + + /** + * \returns The index type (kdtree, kmeans,...) + */ + virtual flann_algorithm_t getType() const = 0; + + /** + * \returns The index parameters + */ + virtual IndexParams getParameters() const = 0; + + + /** + * \brief Method that searches for nearest-neighbours + */ + virtual void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) = 0; +}; + +} + +#endif //OPENCV_FLANN_NNINDEX_H diff --git a/lib/opencv/include/opencv2/flann/object_factory.h b/lib/opencv/include/opencv2/flann/object_factory.h new file mode 100644 index 000000000..7f971c5a3 --- /dev/null +++ b/lib/opencv/include/opencv2/flann/object_factory.h @@ -0,0 +1,91 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_OBJECT_FACTORY_H_ +#define OPENCV_FLANN_OBJECT_FACTORY_H_ + +#include + +namespace cvflann +{ + +class CreatorNotFound +{ +}; + +template +class ObjectFactory +{ + typedef ObjectFactory ThisClass; + typedef std::map ObjectRegistry; + + // singleton class, private constructor + ObjectFactory() {} + +public: + + bool subscribe(UniqueIdType id, ObjectCreator creator) + { + if (object_registry.find(id) != object_registry.end()) return false; + + object_registry[id] = creator; + return true; + } + + bool unregister(UniqueIdType id) + { + return object_registry.erase(id) == 1; + } + + ObjectCreator create(UniqueIdType id) + { + typename ObjectRegistry::const_iterator iter = object_registry.find(id); + + if (iter == object_registry.end()) { + throw CreatorNotFound(); + } + + return iter->second; + } + + static ThisClass& instance() + { + static ThisClass the_factory; + return the_factory; + } +private: + ObjectRegistry object_registry; +}; + +} + +#endif /* OPENCV_FLANN_OBJECT_FACTORY_H_ */ diff --git a/lib/opencv/include/opencv2/flann/params.h b/lib/opencv/include/opencv2/flann/params.h new file mode 100644 index 000000000..95ef4cd23 --- /dev/null +++ b/lib/opencv/include/opencv2/flann/params.h @@ -0,0 +1,99 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_PARAMS_H_ +#define OPENCV_FLANN_PARAMS_H_ + +#include "any.h" +#include "general.h" +#include +#include + + +namespace cvflann +{ + +typedef std::map IndexParams; + +struct SearchParams : public IndexParams +{ + SearchParams(int checks = 32, float eps = 0, bool sorted = true ) + { + // how many leafs to visit when searching for neighbours (-1 for unlimited) + (*this)["checks"] = checks; + // search for eps-approximate neighbours (default: 0) + (*this)["eps"] = eps; + // only for radius search, require neighbours sorted by distance (default: true) + (*this)["sorted"] = sorted; + } +}; + + +template +T get_param(const IndexParams& params, cv::String name, const T& default_value) +{ + IndexParams::const_iterator it = params.find(name); + if (it != params.end()) { + return it->second.cast(); + } + else { + return default_value; + } +} + +template +T get_param(const IndexParams& params, cv::String name) +{ + IndexParams::const_iterator it = params.find(name); + if (it != params.end()) { + return it->second.cast(); + } + else { + throw FLANNException(cv::String("Missing parameter '")+name+cv::String("' in the parameters given")); + } +} + +inline void print_params(const IndexParams& params, std::ostream& stream) +{ + IndexParams::const_iterator it; + + for(it=params.begin(); it!=params.end(); ++it) { + stream << it->first << " : " << it->second << std::endl; + } +} + +inline void print_params(const IndexParams& params) +{ + print_params(params, std::cout); +} + +} + + +#endif /* OPENCV_FLANN_PARAMS_H_ */ diff --git a/lib/opencv/include/opencv2/flann/random.h b/lib/opencv/include/opencv2/flann/random.h new file mode 100644 index 000000000..a3cf5ec53 --- /dev/null +++ b/lib/opencv/include/opencv2/flann/random.h @@ -0,0 +1,133 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_RANDOM_H +#define OPENCV_FLANN_RANDOM_H + +#include +#include +#include + +#include "general.h" + +namespace cvflann +{ + +/** + * Seeds the random number generator + * @param seed Random seed + */ +inline void seed_random(unsigned int seed) +{ + srand(seed); +} + +/* + * Generates a random double value. + */ +/** + * Generates a random double value. + * @param high Upper limit + * @param low Lower limit + * @return Random double value + */ +inline double rand_double(double high = 1.0, double low = 0) +{ + return low + ((high-low) * (std::rand() / (RAND_MAX + 1.0))); +} + +/** + * Generates a random integer value. + * @param high Upper limit + * @param low Lower limit + * @return Random integer value + */ +inline int rand_int(int high = RAND_MAX, int low = 0) +{ + return low + (int) ( double(high-low) * (std::rand() / (RAND_MAX + 1.0))); +} + +/** + * Random number generator that returns a distinct number from + * the [0,n) interval each time. + */ +class UniqueRandom +{ + std::vector vals_; + int size_; + int counter_; + +public: + /** + * Constructor. + * @param n Size of the interval from which to generate + * @return + */ + UniqueRandom(int n) + { + init(n); + } + + /** + * Initializes the number generator. + * @param n the size of the interval from which to generate random numbers. + */ + void init(int n) + { + // create and initialize an array of size n + vals_.resize(n); + size_ = n; + for (int i = 0; i < size_; ++i) vals_[i] = i; + + // shuffle the elements in the array + std::random_shuffle(vals_.begin(), vals_.end()); + + counter_ = 0; + } + + /** + * Return a distinct random integer in greater or equal to 0 and less + * than 'n' on each call. It should be called maximum 'n' times. + * Returns: a random integer + */ + int next() + { + if (counter_ == size_) { + return -1; + } + else { + return vals_[counter_++]; + } + } +}; + +} + +#endif //OPENCV_FLANN_RANDOM_H diff --git a/lib/opencv/include/opencv2/flann/result_set.h b/lib/opencv/include/opencv2/flann/result_set.h new file mode 100644 index 000000000..97500195a --- /dev/null +++ b/lib/opencv/include/opencv2/flann/result_set.h @@ -0,0 +1,543 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_RESULTSET_H +#define OPENCV_FLANN_RESULTSET_H + +#include +#include +#include +#include +#include +#include + +namespace cvflann +{ + +/* This record represents a branch point when finding neighbors in + the tree. It contains a record of the minimum distance to the query + point, as well as the node at which the search resumes. + */ + +template +struct BranchStruct +{ + T node; /* Tree node at which search resumes */ + DistanceType mindist; /* Minimum distance to query for all nodes below. */ + + BranchStruct() {} + BranchStruct(const T& aNode, DistanceType dist) : node(aNode), mindist(dist) {} + + bool operator<(const BranchStruct& rhs) const + { + return mindist +class ResultSet +{ +public: + virtual ~ResultSet() {} + + virtual bool full() const = 0; + + virtual void addPoint(DistanceType dist, int index) = 0; + + virtual DistanceType worstDist() const = 0; + +}; + +/** + * KNNSimpleResultSet does not ensure that the element it holds are unique. + * Is used in those cases where the nearest neighbour algorithm used does not + * attempt to insert the same element multiple times. + */ +template +class KNNSimpleResultSet : public ResultSet +{ + int* indices; + DistanceType* dists; + int capacity; + int count; + DistanceType worst_distance_; + +public: + KNNSimpleResultSet(int capacity_) : capacity(capacity_), count(0) + { + } + + void init(int* indices_, DistanceType* dists_) + { + indices = indices_; + dists = dists_; + count = 0; + worst_distance_ = (std::numeric_limits::max)(); + dists[capacity-1] = worst_distance_; + } + + size_t size() const + { + return count; + } + + bool full() const + { + return count == capacity; + } + + + void addPoint(DistanceType dist, int index) + { + if (dist >= worst_distance_) return; + int i; + for (i=count; i>0; --i) { +#ifdef FLANN_FIRST_MATCH + if ( (dists[i-1]>dist) || ((dist==dists[i-1])&&(indices[i-1]>index)) ) +#else + if (dists[i-1]>dist) +#endif + { + if (i +class KNNResultSet : public ResultSet +{ + int* indices; + DistanceType* dists; + int capacity; + int count; + DistanceType worst_distance_; + +public: + KNNResultSet(int capacity_) : capacity(capacity_), count(0) + { + } + + void init(int* indices_, DistanceType* dists_) + { + indices = indices_; + dists = dists_; + count = 0; + worst_distance_ = (std::numeric_limits::max)(); + dists[capacity-1] = worst_distance_; + } + + size_t size() const + { + return count; + } + + bool full() const + { + return count == capacity; + } + + + void addPoint(DistanceType dist, int index) + { + if (dist >= worst_distance_) return; + int i; + for (i = count; i > 0; --i) { +#ifdef FLANN_FIRST_MATCH + if ( (dists[i-1]<=dist) && ((dist!=dists[i-1])||(indices[i-1]<=index)) ) +#else + if (dists[i-1]<=dist) +#endif + { + // Check for duplicate indices + int j = i - 1; + while ((j >= 0) && (dists[j] == dist)) { + if (indices[j] == index) { + return; + } + --j; + } + break; + } + } + + if (count < capacity) ++count; + for (int j = count-1; j > i; --j) { + dists[j] = dists[j-1]; + indices[j] = indices[j-1]; + } + dists[i] = dist; + indices[i] = index; + worst_distance_ = dists[capacity-1]; + } + + DistanceType worstDist() const + { + return worst_distance_; + } +}; + + +/** + * A result-set class used when performing a radius based search. + */ +template +class RadiusResultSet : public ResultSet +{ + DistanceType radius; + int* indices; + DistanceType* dists; + size_t capacity; + size_t count; + +public: + RadiusResultSet(DistanceType radius_, int* indices_, DistanceType* dists_, int capacity_) : + radius(radius_), indices(indices_), dists(dists_), capacity(capacity_) + { + init(); + } + + ~RadiusResultSet() + { + } + + void init() + { + count = 0; + } + + size_t size() const + { + return count; + } + + bool full() const + { + return true; + } + + void addPoint(DistanceType dist, int index) + { + if (dist0)&&(count < capacity)) { + dists[count] = dist; + indices[count] = index; + } + count++; + } + } + + DistanceType worstDist() const + { + return radius; + } + +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** Class that holds the k NN neighbors + * Faster than KNNResultSet as it uses a binary heap and does not maintain two arrays + */ +template +class UniqueResultSet : public ResultSet +{ +public: + struct DistIndex + { + DistIndex(DistanceType dist, unsigned int index) : + dist_(dist), index_(index) + { + } + bool operator<(const DistIndex dist_index) const + { + return (dist_ < dist_index.dist_) || ((dist_ == dist_index.dist_) && index_ < dist_index.index_); + } + DistanceType dist_; + unsigned int index_; + }; + + /** Default cosntructor */ + UniqueResultSet() : + worst_distance_(std::numeric_limits::max()) + { + } + + /** Check the status of the set + * @return true if we have k NN + */ + inline bool full() const + { + return is_full_; + } + + /** Remove all elements in the set + */ + virtual void clear() = 0; + + /** Copy the set to two C arrays + * @param indices pointer to a C array of indices + * @param dist pointer to a C array of distances + * @param n_neighbors the number of neighbors to copy + */ + virtual void copy(int* indices, DistanceType* dist, int n_neighbors = -1) const + { + if (n_neighbors < 0) { + for (typename std::set::const_iterator dist_index = dist_indices_.begin(), dist_index_end = + dist_indices_.end(); dist_index != dist_index_end; ++dist_index, ++indices, ++dist) { + *indices = dist_index->index_; + *dist = dist_index->dist_; + } + } + else { + int i = 0; + for (typename std::set::const_iterator dist_index = dist_indices_.begin(), dist_index_end = + dist_indices_.end(); (dist_index != dist_index_end) && (i < n_neighbors); ++dist_index, ++indices, ++dist, ++i) { + *indices = dist_index->index_; + *dist = dist_index->dist_; + } + } + } + + /** Copy the set to two C arrays but sort it according to the distance first + * @param indices pointer to a C array of indices + * @param dist pointer to a C array of distances + * @param n_neighbors the number of neighbors to copy + */ + virtual void sortAndCopy(int* indices, DistanceType* dist, int n_neighbors = -1) const + { + copy(indices, dist, n_neighbors); + } + + /** The number of neighbors in the set + * @return + */ + size_t size() const + { + return dist_indices_.size(); + } + + /** The distance of the furthest neighbor + * If we don't have enough neighbors, it returns the max possible value + * @return + */ + inline DistanceType worstDist() const + { + return worst_distance_; + } +protected: + /** Flag to say if the set is full */ + bool is_full_; + + /** The worst distance found so far */ + DistanceType worst_distance_; + + /** The best candidates so far */ + std::set dist_indices_; +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** Class that holds the k NN neighbors + * Faster than KNNResultSet as it uses a binary heap and does not maintain two arrays + */ +template +class KNNUniqueResultSet : public UniqueResultSet +{ +public: + /** Constructor + * @param capacity the number of neighbors to store at max + */ + KNNUniqueResultSet(unsigned int capacity) : capacity_(capacity) + { + this->is_full_ = false; + this->clear(); + } + + /** Add a possible candidate to the best neighbors + * @param dist distance for that neighbor + * @param index index of that neighbor + */ + inline void addPoint(DistanceType dist, int index) + { + // Don't do anything if we are worse than the worst + if (dist >= worst_distance_) return; + dist_indices_.insert(DistIndex(dist, index)); + + if (is_full_) { + if (dist_indices_.size() > capacity_) { + dist_indices_.erase(*dist_indices_.rbegin()); + worst_distance_ = dist_indices_.rbegin()->dist_; + } + } + else if (dist_indices_.size() == capacity_) { + is_full_ = true; + worst_distance_ = dist_indices_.rbegin()->dist_; + } + } + + /** Remove all elements in the set + */ + void clear() + { + dist_indices_.clear(); + worst_distance_ = std::numeric_limits::max(); + is_full_ = false; + } + +protected: + typedef typename UniqueResultSet::DistIndex DistIndex; + using UniqueResultSet::is_full_; + using UniqueResultSet::worst_distance_; + using UniqueResultSet::dist_indices_; + + /** The number of neighbors to keep */ + unsigned int capacity_; +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** Class that holds the radius nearest neighbors + * It is more accurate than RadiusResult as it is not limited in the number of neighbors + */ +template +class RadiusUniqueResultSet : public UniqueResultSet +{ +public: + /** Constructor + * @param radius the maximum distance of a neighbor + */ + RadiusUniqueResultSet(DistanceType radius) : + radius_(radius) + { + is_full_ = true; + } + + /** Add a possible candidate to the best neighbors + * @param dist distance for that neighbor + * @param index index of that neighbor + */ + void addPoint(DistanceType dist, int index) + { + if (dist <= radius_) dist_indices_.insert(DistIndex(dist, index)); + } + + /** Remove all elements in the set + */ + inline void clear() + { + dist_indices_.clear(); + } + + + /** Check the status of the set + * @return alwys false + */ + inline bool full() const + { + return true; + } + + /** The distance of the furthest neighbor + * If we don't have enough neighbors, it returns the max possible value + * @return + */ + inline DistanceType worstDist() const + { + return radius_; + } +private: + typedef typename UniqueResultSet::DistIndex DistIndex; + using UniqueResultSet::dist_indices_; + using UniqueResultSet::is_full_; + + /** The furthest distance a neighbor can be */ + DistanceType radius_; +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** Class that holds the k NN neighbors within a radius distance + */ +template +class KNNRadiusUniqueResultSet : public KNNUniqueResultSet +{ +public: + /** Constructor + * @param capacity the number of neighbors to store at max + * @param radius the maximum distance of a neighbor + */ + KNNRadiusUniqueResultSet(unsigned int capacity, DistanceType radius) + { + this->capacity_ = capacity; + this->radius_ = radius; + this->dist_indices_.reserve(capacity_); + this->clear(); + } + + /** Remove all elements in the set + */ + void clear() + { + dist_indices_.clear(); + worst_distance_ = radius_; + is_full_ = false; + } +private: + using KNNUniqueResultSet::dist_indices_; + using KNNUniqueResultSet::is_full_; + using KNNUniqueResultSet::worst_distance_; + + /** The maximum number of neighbors to consider */ + unsigned int capacity_; + + /** The maximum distance of a neighbor */ + DistanceType radius_; +}; +} + +#endif //OPENCV_FLANN_RESULTSET_H diff --git a/lib/opencv/include/opencv2/flann/sampling.h b/lib/opencv/include/opencv2/flann/sampling.h new file mode 100644 index 000000000..396f177ae --- /dev/null +++ b/lib/opencv/include/opencv2/flann/sampling.h @@ -0,0 +1,81 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_SAMPLING_H_ +#define OPENCV_FLANN_SAMPLING_H_ + +#include "matrix.h" +#include "random.h" + +namespace cvflann +{ + +template +Matrix random_sample(Matrix& srcMatrix, long size, bool remove = false) +{ + Matrix newSet(new T[size * srcMatrix.cols], size,srcMatrix.cols); + + T* src,* dest; + for (long i=0; i +Matrix random_sample(const Matrix& srcMatrix, size_t size) +{ + UniqueRandom rand((int)srcMatrix.rows); + Matrix newSet(new T[size * srcMatrix.cols], size,srcMatrix.cols); + + T* src,* dest; + for (size_t i=0; i +#include + +#include "general.h" +#include "nn_index.h" + +#ifdef FLANN_SIGNATURE_ +#undef FLANN_SIGNATURE_ +#endif +#define FLANN_SIGNATURE_ "FLANN_INDEX" + +namespace cvflann +{ + +template +struct Datatype {}; +template<> +struct Datatype { static flann_datatype_t type() { return FLANN_INT8; } }; +template<> +struct Datatype { static flann_datatype_t type() { return FLANN_INT16; } }; +template<> +struct Datatype { static flann_datatype_t type() { return FLANN_INT32; } }; +template<> +struct Datatype { static flann_datatype_t type() { return FLANN_UINT8; } }; +template<> +struct Datatype { static flann_datatype_t type() { return FLANN_UINT16; } }; +template<> +struct Datatype { static flann_datatype_t type() { return FLANN_UINT32; } }; +template<> +struct Datatype { static flann_datatype_t type() { return FLANN_FLOAT32; } }; +template<> +struct Datatype { static flann_datatype_t type() { return FLANN_FLOAT64; } }; + + +/** + * Structure representing the index header. + */ +struct IndexHeader +{ + char signature[16]; + char version[16]; + flann_datatype_t data_type; + flann_algorithm_t index_type; + size_t rows; + size_t cols; +}; + +/** + * Saves index header to stream + * + * @param stream - Stream to save to + * @param index - The index to save + */ +template +void save_header(FILE* stream, const NNIndex& index) +{ + IndexHeader header; + memset(header.signature, 0, sizeof(header.signature)); + strcpy(header.signature, FLANN_SIGNATURE_); + memset(header.version, 0, sizeof(header.version)); + strcpy(header.version, FLANN_VERSION_); + header.data_type = Datatype::type(); + header.index_type = index.getType(); + header.rows = index.size(); + header.cols = index.veclen(); + + std::fwrite(&header, sizeof(header),1,stream); +} + + +/** + * + * @param stream - Stream to load from + * @return Index header + */ +inline IndexHeader load_header(FILE* stream) +{ + IndexHeader header; + size_t read_size = fread(&header,sizeof(header),1,stream); + + if (read_size!=(size_t)1) { + throw FLANNException("Invalid index file, cannot read"); + } + + if (strcmp(header.signature,FLANN_SIGNATURE_)!=0) { + throw FLANNException("Invalid index file, wrong signature"); + } + + return header; + +} + + +template +void save_value(FILE* stream, const T& value, size_t count = 1) +{ + fwrite(&value, sizeof(value),count, stream); +} + +template +void save_value(FILE* stream, const cvflann::Matrix& value) +{ + fwrite(&value, sizeof(value),1, stream); + fwrite(value.data, sizeof(T),value.rows*value.cols, stream); +} + +template +void save_value(FILE* stream, const std::vector& value) +{ + size_t size = value.size(); + fwrite(&size, sizeof(size_t), 1, stream); + fwrite(&value[0], sizeof(T), size, stream); +} + +template +void load_value(FILE* stream, T& value, size_t count = 1) +{ + size_t read_cnt = fread(&value, sizeof(value), count, stream); + if (read_cnt != count) { + throw FLANNException("Cannot read from file"); + } +} + +template +void load_value(FILE* stream, cvflann::Matrix& value) +{ + size_t read_cnt = fread(&value, sizeof(value), 1, stream); + if (read_cnt != 1) { + throw FLANNException("Cannot read from file"); + } + value.data = new T[value.rows*value.cols]; + read_cnt = fread(value.data, sizeof(T), value.rows*value.cols, stream); + if (read_cnt != (size_t)(value.rows*value.cols)) { + throw FLANNException("Cannot read from file"); + } +} + + +template +void load_value(FILE* stream, std::vector& value) +{ + size_t size; + size_t read_cnt = fread(&size, sizeof(size_t), 1, stream); + if (read_cnt!=1) { + throw FLANNException("Cannot read from file"); + } + value.resize(size); + read_cnt = fread(&value[0], sizeof(T), size, stream); + if (read_cnt != size) { + throw FLANNException("Cannot read from file"); + } +} + +} + +#endif /* OPENCV_FLANN_SAVING_H_ */ diff --git a/lib/opencv/include/opencv2/flann/simplex_downhill.h b/lib/opencv/include/opencv2/flann/simplex_downhill.h new file mode 100644 index 000000000..145901ab0 --- /dev/null +++ b/lib/opencv/include/opencv2/flann/simplex_downhill.h @@ -0,0 +1,186 @@ +/*********************************************************************** + * Software License Agreement (BSD License) + * + * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. + * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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_FLANN_SIMPLEX_DOWNHILL_H_ +#define OPENCV_FLANN_SIMPLEX_DOWNHILL_H_ + +namespace cvflann +{ + +/** + Adds val to array vals (and point to array points) and keeping the arrays sorted by vals. + */ +template +void addValue(int pos, float val, float* vals, T* point, T* points, int n) +{ + vals[pos] = val; + for (int i=0; i0 && vals[j] +float optimizeSimplexDownhill(T* points, int n, F func, float* vals = NULL ) +{ + const int MAX_ITERATIONS = 10; + + assert(n>0); + + T* p_o = new T[n]; + T* p_r = new T[n]; + T* p_e = new T[n]; + + int alpha = 1; + + int iterations = 0; + + bool ownVals = false; + if (vals == NULL) { + ownVals = true; + vals = new float[n+1]; + for (int i=0; i MAX_ITERATIONS) break; + + // compute average of simplex points (except the highest point) + for (int j=0; j=vals[0])&&(val_r=vals[n]) { + for (int i=0; i +#include "opencv2/core.hpp" +#include "opencv2/core/utility.hpp" + +namespace cvflann +{ + +/** + * A start-stop timer class. + * + * Can be used to time portions of code. + */ +class StartStopTimer +{ + int64 startTime; + +public: + /** + * Value of the timer. + */ + double value; + + + /** + * Constructor. + */ + StartStopTimer() + { + reset(); + } + + /** + * Starts the timer. + */ + void start() + { + startTime = cv::getTickCount(); + } + + /** + * Stops the timer and updates timer value. + */ + void stop() + { + int64 stopTime = cv::getTickCount(); + value += ( (double)stopTime - startTime) / cv::getTickFrequency(); + } + + /** + * Resets the timer value to 0. + */ + void reset() + { + value = 0; + } + +}; + +} + +#endif // FLANN_TIMER_H diff --git a/lib/opencv/include/opencv2/highgui.hpp b/lib/opencv/include/opencv2/highgui.hpp new file mode 100644 index 000000000..41bd8aff8 --- /dev/null +++ b/lib/opencv/include/opencv2/highgui.hpp @@ -0,0 +1,754 @@ +/*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_HIGHGUI_HPP__ +#define __OPENCV_HIGHGUI_HPP__ + +#include "opencv2/core.hpp" +#include "opencv2/imgcodecs.hpp" +#include "opencv2/videoio.hpp" + +/** +@defgroup highgui High-level GUI + +While OpenCV was designed for use in full-scale applications and can be used within functionally +rich UI frameworks (such as Qt\*, WinForms\*, or Cocoa\*) or without any UI at all, sometimes there +it is required to try functionality quickly and visualize the results. This is what the HighGUI +module has been designed for. + +It provides easy interface to: + +- Create and manipulate windows that can display images and "remember" their content (no need to + handle repaint events from OS). +- Add trackbars to the windows, handle simple mouse events as well as keyboard commands. + +@{ + @defgroup highgui_opengl OpenGL support + @defgroup highgui_qt Qt New Functions + + ![image](pics/qtgui.png) + + This figure explains new functionality implemented with Qt\* GUI. The new GUI provides a statusbar, + a toolbar, and a control panel. The control panel can have trackbars and buttonbars attached to it. + If you cannot see the control panel, press Ctrl+P or right-click any Qt window and select **Display + properties window**. + + - To attach a trackbar, the window name parameter must be NULL. + + - To attach a buttonbar, a button must be created. If the last bar attached to the control panel + is a buttonbar, the new button is added to the right of the last button. If the last bar + attached to the control panel is a trackbar, or the control panel is empty, a new buttonbar is + created. Then, a new button is attached to it. + + See below the example used to generate the figure: + @code + int main(int argc, char *argv[]) + { + + int value = 50; + int value2 = 0; + + + namedWindow("main1",WINDOW_NORMAL); + namedWindow("main2",WINDOW_AUTOSIZE | CV_GUI_NORMAL); + createTrackbar( "track1", "main1", &value, 255, NULL); + + String nameb1 = "button1"; + String nameb2 = "button2"; + + createButton(nameb1,callbackButton,&nameb1,QT_CHECKBOX,1); + createButton(nameb2,callbackButton,NULL,QT_CHECKBOX,0); + createTrackbar( "track2", NULL, &value2, 255, NULL); + createButton("button5",callbackButton1,NULL,QT_RADIOBOX,0); + createButton("button6",callbackButton2,NULL,QT_RADIOBOX,1); + + setMouseCallback( "main2",on_mouse,NULL ); + + Mat img1 = imread("files/flower.jpg"); + VideoCapture video; + video.open("files/hockey.avi"); + + Mat img2,img3; + + while( waitKey(33) != 27 ) + { + img1.convertTo(img2,-1,1,value); + video >> img3; + + imshow("main1",img2); + imshow("main2",img3); + } + + destroyAllWindows(); + + return 0; + } + @endcode + + + @defgroup highgui_winrt WinRT support + + This figure explains new functionality implemented with WinRT GUI. The new GUI provides an Image control, + and a slider panel. Slider panel holds trackbars attached to it. + + Sliders are attached below the image control. Every new slider is added below the previous one. + + See below the example used to generate the figure: + @code + void sample_app::MainPage::ShowWindow() + { + static cv::String windowName("sample"); + cv::winrt_initContainer(this->cvContainer); + cv::namedWindow(windowName); // not required + + cv::Mat image = cv::imread("Assets/sample.jpg"); + cv::Mat converted = cv::Mat(image.rows, image.cols, CV_8UC4); + cv::cvtColor(image, converted, COLOR_BGR2BGRA); + cv::imshow(windowName, converted); // this will create window if it hasn't been created before + + int state = 42; + cv::TrackbarCallback callback = [](int pos, void* userdata) + { + if (pos == 0) { + cv::destroyWindow(windowName); + } + }; + cv::TrackbarCallback callbackTwin = [](int pos, void* userdata) + { + if (pos >= 70) { + cv::destroyAllWindows(); + } + }; + cv::createTrackbar("Sample trackbar", windowName, &state, 100, callback); + cv::createTrackbar("Twin brother", windowName, &state, 100, callbackTwin); + } + @endcode + + @defgroup highgui_c C API +@} +*/ + +///////////////////////// graphical user interface ////////////////////////// +namespace cv +{ + +//! @addtogroup highgui +//! @{ + +//! Flags for cv::namedWindow +enum WindowFlags { + WINDOW_NORMAL = 0x00000000, //!< the user can resize the window (no constraint) / also use to switch a fullscreen window to a normal size. + WINDOW_AUTOSIZE = 0x00000001, //!< the user cannot resize the window, the size is constrainted by the image displayed. + WINDOW_OPENGL = 0x00001000, //!< window with opengl support. + + WINDOW_FULLSCREEN = 1, //!< change the window to fullscreen. + WINDOW_FREERATIO = 0x00000100, //!< the image expends as much as it can (no ratio constraint). + WINDOW_KEEPRATIO = 0x00000000 //!< the ratio of the image is respected. + }; + +//! Flags for cv::setWindowProperty / cv::getWindowProperty +enum WindowPropertyFlags { + WND_PROP_FULLSCREEN = 0, //!< fullscreen property (can be WINDOW_NORMAL or WINDOW_FULLSCREEN). + WND_PROP_AUTOSIZE = 1, //!< autosize property (can be WINDOW_NORMAL or WINDOW_AUTOSIZE). + WND_PROP_ASPECT_RATIO = 2, //!< window's aspect ration (can be set to WINDOW_FREERATIO or WINDOW_KEEPRATIO). + WND_PROP_OPENGL = 3 //!< opengl support. + }; + +//! Mouse Events see cv::MouseCallback +enum MouseEventTypes { + EVENT_MOUSEMOVE = 0, //!< indicates that the mouse pointer has moved over the window. + EVENT_LBUTTONDOWN = 1, //!< indicates that the left mouse button is pressed. + EVENT_RBUTTONDOWN = 2, //!< indicates that the right mouse button is pressed. + EVENT_MBUTTONDOWN = 3, //!< indicates that the middle mouse button is pressed. + EVENT_LBUTTONUP = 4, //!< indicates that left mouse button is released. + EVENT_RBUTTONUP = 5, //!< indicates that right mouse button is released. + EVENT_MBUTTONUP = 6, //!< indicates that middle mouse button is released. + EVENT_LBUTTONDBLCLK = 7, //!< indicates that left mouse button is double clicked. + EVENT_RBUTTONDBLCLK = 8, //!< indicates that right mouse button is double clicked. + EVENT_MBUTTONDBLCLK = 9, //!< indicates that middle mouse button is double clicked. + EVENT_MOUSEWHEEL = 10,//!< positive and negative values mean forward and backward scrolling, respectively. + EVENT_MOUSEHWHEEL = 11 //!< positive and negative values mean right and left scrolling, respectively. + }; + +//! Mouse Event Flags see cv::MouseCallback +enum MouseEventFlags { + EVENT_FLAG_LBUTTON = 1, //!< indicates that the left mouse button is down. + EVENT_FLAG_RBUTTON = 2, //!< indicates that the right mouse button is down. + EVENT_FLAG_MBUTTON = 4, //!< indicates that the middle mouse button is down. + EVENT_FLAG_CTRLKEY = 8, //!< indicates that CTRL Key is pressed. + EVENT_FLAG_SHIFTKEY = 16,//!< indicates that SHIFT Key is pressed. + EVENT_FLAG_ALTKEY = 32 //!< indicates that ALT Key is pressed. + }; + +//! Qt font weight +enum QtFontWeights { + QT_FONT_LIGHT = 25, //!< Weight of 25 + QT_FONT_NORMAL = 50, //!< Weight of 50 + QT_FONT_DEMIBOLD = 63, //!< Weight of 63 + QT_FONT_BOLD = 75, //!< Weight of 75 + QT_FONT_BLACK = 87 //!< Weight of 87 + }; + +//! Qt font style +enum QtFontStyles { + QT_STYLE_NORMAL = 0, //!< Normal font. + QT_STYLE_ITALIC = 1, //!< Italic font. + QT_STYLE_OBLIQUE = 2 //!< Oblique font. + }; + +//! Qt "button" type +enum QtButtonTypes { + QT_PUSH_BUTTON = 0, //!< Push button. + QT_CHECKBOX = 1, //!< Checkbox button. + QT_RADIOBOX = 2 //!< Radiobox button. + }; + +/** @brief Callback function for mouse events. see cv::setMouseCallback +@param event one of the cv::MouseEventTypes constants. +@param x The x-coordinate of the mouse event. +@param y The y-coordinate of the mouse event. +@param flags one of the cv::MouseEventFlags constants. +@param userdata The optional parameter. + */ +typedef void (*MouseCallback)(int event, int x, int y, int flags, void* userdata); + +/** @brief Callback function for Trackbar see cv::createTrackbar +@param pos current position of the specified trackbar. +@param userdata The optional parameter. + */ +typedef void (*TrackbarCallback)(int pos, void* userdata); + +/** @brief Callback function defined to be called every frame. See cv::setOpenGlDrawCallback +@param userdata The optional parameter. + */ +typedef void (*OpenGlDrawCallback)(void* userdata); + +/** @brief Callback function for a button created by cv::createButton +@param state current state of the button. It could be -1 for a push button, 0 or 1 for a check/radio box button. +@param userdata The optional parameter. + */ +typedef void (*ButtonCallback)(int state, void* userdata); + +/** @brief Creates a window. + +The function namedWindow creates a window that can be used as a placeholder for images and +trackbars. Created windows are referred to by their names. + +If a window with the same name already exists, the function does nothing. + +You can call cv::destroyWindow or cv::destroyAllWindows to close the window and de-allocate any associated +memory usage. For a simple program, you do not really have to call these functions because all the +resources and windows of the application are closed automatically by the operating system upon exit. + +@note + +Qt backend supports additional flags: + - **WINDOW_NORMAL or WINDOW_AUTOSIZE:** WINDOW_NORMAL enables you to resize the + window, whereas WINDOW_AUTOSIZE adjusts automatically the window size to fit the + displayed image (see imshow ), and you cannot change the window size manually. + - **WINDOW_FREERATIO or WINDOW_KEEPRATIO:** WINDOW_FREERATIO adjusts the image + with no respect to its ratio, whereas WINDOW_KEEPRATIO keeps the image ratio. + - **CV_GUI_NORMAL or CV_GUI_EXPANDED:** CV_GUI_NORMAL is the old way to draw the window + without statusbar and toolbar, whereas CV_GUI_EXPANDED is a new enhanced GUI. +By default, flags == WINDOW_AUTOSIZE | WINDOW_KEEPRATIO | CV_GUI_EXPANDED + +@param winname Name of the window in the window caption that may be used as a window identifier. +@param flags Flags of the window. The supported flags are: (cv::WindowFlags) + */ +CV_EXPORTS_W void namedWindow(const String& winname, int flags = WINDOW_AUTOSIZE); + +/** @brief Destroys the specified window. + +The function destroyWindow destroys the window with the given name. + +@param winname Name of the window to be destroyed. + */ +CV_EXPORTS_W void destroyWindow(const String& winname); + +/** @brief Destroys all of the HighGUI windows. + +The function destroyAllWindows destroys all of the opened HighGUI windows. + */ +CV_EXPORTS_W void destroyAllWindows(); + +CV_EXPORTS_W int startWindowThread(); + +/** @brief Waits for a pressed key. + +The function waitKey waits for a key event infinitely (when \f$\texttt{delay}\leq 0\f$ ) or for delay +milliseconds, when it is positive. Since the OS has a minimum time between switching threads, the +function will not wait exactly delay ms, it will wait at least delay ms, depending on what else is +running on your computer at that time. It returns the code of the pressed key or -1 if no key was +pressed before the specified time had elapsed. + +@note + +This function is the only method in HighGUI that can fetch and handle events, so it needs to be +called periodically for normal event processing unless HighGUI is used within an environment that +takes care of event processing. + +@note + +The function only works if there is at least one HighGUI window created and the window is active. +If there are several HighGUI windows, any of them can be active. + +@param delay Delay in milliseconds. 0 is the special value that means "forever". + */ +CV_EXPORTS_W int waitKey(int delay = 0); + +/** @brief Displays an image in the specified window. + +The function imshow displays an image in the specified window. If the window was created with the +cv::WINDOW_AUTOSIZE flag, the image is shown with its original size, however it is still limited by the screen resolution. +Otherwise, the image is scaled to fit the window. The function may scale the image, depending on its depth: + +- If the image is 8-bit unsigned, it is displayed as is. +- If the image is 16-bit unsigned or 32-bit integer, the pixels are divided by 256. That is, the + value range [0,255\*256] is mapped to [0,255]. +- If the image is 32-bit floating-point, the pixel values are multiplied by 255. That is, the + value range [0,1] is mapped to [0,255]. + +If window was created with OpenGL support, cv::imshow also support ogl::Buffer , ogl::Texture2D and +cuda::GpuMat as input. + +If the window was not created before this function, it is assumed creating a window with cv::WINDOW_AUTOSIZE. + +If you need to show an image that is bigger than the screen resolution, you will need to call namedWindow("", WINDOW_NORMAL) before the imshow. + +@note This function should be followed by cv::waitKey function which displays the image for specified +milliseconds. Otherwise, it won't display the image. For example, **waitKey(0)** will display the window +infinitely until any keypress (it is suitable for image display). **waitKey(25)** will display a frame +for 25 ms, after which display will be automatically closed. (If you put it in a loop to read +videos, it will display the video frame-by-frame) + +@note + +[__Windows Backend Only__] Pressing Ctrl+C will copy the image to the clipboard. + +[__Windows Backend Only__] Pressing Ctrl+S will show a dialog to save the image. + +@param winname Name of the window. +@param mat Image to be shown. + */ +CV_EXPORTS_W void imshow(const String& winname, InputArray mat); + +/** @brief Resizes window to the specified size + +@note + +- The specified window size is for the image area. Toolbars are not counted. +- Only windows created without cv::WINDOW_AUTOSIZE flag can be resized. + +@param winname Window name. +@param width The new window width. +@param height The new window height. + */ +CV_EXPORTS_W void resizeWindow(const String& winname, int width, int height); + +/** @brief Moves window to the specified position + +@param winname Name of the window. +@param x The new x-coordinate of the window. +@param y The new y-coordinate of the window. + */ +CV_EXPORTS_W void moveWindow(const String& winname, int x, int y); + +/** @brief Changes parameters of a window dynamically. + +The function setWindowProperty enables changing properties of a window. + +@param winname Name of the window. +@param prop_id Window property to edit. The supported operation flags are: (cv::WindowPropertyFlags) +@param prop_value New value of the window property. The supported flags are: (cv::WindowFlags) + */ +CV_EXPORTS_W void setWindowProperty(const String& winname, int prop_id, double prop_value); + +/** @brief Updates window title +@param winname Name of the window. +@param title New title. +*/ +CV_EXPORTS_W void setWindowTitle(const String& winname, const String& title); + +/** @brief Provides parameters of a window. + +The function getWindowProperty returns properties of a window. + +@param winname Name of the window. +@param prop_id Window property to retrieve. The following operation flags are available: (cv::WindowPropertyFlags) + +@sa setWindowProperty + */ +CV_EXPORTS_W double getWindowProperty(const String& winname, int prop_id); + +/** @brief Sets mouse handler for the specified window + +@param winname Name of the window. +@param onMouse Mouse callback. See OpenCV samples, such as +, on how to specify and +use the callback. +@param userdata The optional parameter passed to the callback. + */ +CV_EXPORTS void setMouseCallback(const String& winname, MouseCallback onMouse, void* userdata = 0); + +/** @brief Gets the mouse-wheel motion delta, when handling mouse-wheel events cv::EVENT_MOUSEWHEEL and +cv::EVENT_MOUSEHWHEEL. + +For regular mice with a scroll-wheel, delta will be a multiple of 120. The value 120 corresponds to +a one notch rotation of the wheel or the threshold for action to be taken and one such action should +occur for each delta. Some high-precision mice with higher-resolution freely-rotating wheels may +generate smaller values. + +For cv::EVENT_MOUSEWHEEL positive and negative values mean forward and backward scrolling, +respectively. For cv::EVENT_MOUSEHWHEEL, where available, positive and negative values mean right and +left scrolling, respectively. + +With the C API, the macro CV_GET_WHEEL_DELTA(flags) can be used alternatively. + +@note + +Mouse-wheel events are currently supported only on Windows. + +@param flags The mouse callback flags parameter. + */ +CV_EXPORTS int getMouseWheelDelta(int flags); + +/** @brief Creates a trackbar and attaches it to the specified window. + +The function createTrackbar creates a trackbar (a slider or range control) with the specified name +and range, assigns a variable value to be a position synchronized with the trackbar and specifies +the callback function onChange to be called on the trackbar position change. The created trackbar is +displayed in the specified window winname. + +@note + +[__Qt Backend Only__] winname can be empty (or NULL) if the trackbar should be attached to the +control panel. + +Clicking the label of each trackbar enables editing the trackbar values manually. + +@param trackbarname Name of the created trackbar. +@param winname Name of the window that will be used as a parent of the created trackbar. +@param value Optional pointer to an integer variable whose value reflects the position of the +slider. Upon creation, the slider position is defined by this variable. +@param count Maximal position of the slider. The minimal position is always 0. +@param onChange Pointer to the function to be called every time the slider changes position. This +function should be prototyped as void Foo(int,void\*); , where the first parameter is the trackbar +position and the second parameter is the user data (see the next parameter). If the callback is +the NULL pointer, no callbacks are called, but only value is updated. +@param userdata User data that is passed as is to the callback. It can be used to handle trackbar +events without using global variables. + */ +CV_EXPORTS int createTrackbar(const String& trackbarname, const String& winname, + int* value, int count, + TrackbarCallback onChange = 0, + void* userdata = 0); + +/** @brief Returns the trackbar position. + +The function returns the current position of the specified trackbar. + +@note + +[__Qt Backend Only__] winname can be empty (or NULL) if the trackbar is attached to the control +panel. + +@param trackbarname Name of the trackbar. +@param winname Name of the window that is the parent of the trackbar. + */ +CV_EXPORTS_W int getTrackbarPos(const String& trackbarname, const String& winname); + +/** @brief Sets the trackbar position. + +The function sets the position of the specified trackbar in the specified window. + +@note + +[__Qt Backend Only__] winname can be empty (or NULL) if the trackbar is attached to the control +panel. + +@param trackbarname Name of the trackbar. +@param winname Name of the window that is the parent of trackbar. +@param pos New position. + */ +CV_EXPORTS_W void setTrackbarPos(const String& trackbarname, const String& winname, int pos); + +/** @brief Sets the trackbar maximum position. + +The function sets the maximum position of the specified trackbar in the specified window. + +@note + +[__Qt Backend Only__] winname can be empty (or NULL) if the trackbar is attached to the control +panel. + +@param trackbarname Name of the trackbar. +@param winname Name of the window that is the parent of trackbar. +@param maxval New maximum position. + */ +CV_EXPORTS_W void setTrackbarMax(const String& trackbarname, const String& winname, int maxval); + +/** @brief Sets the trackbar minimum position. + +The function sets the minimum position of the specified trackbar in the specified window. + +@note + +[__Qt Backend Only__] winname can be empty (or NULL) if the trackbar is attached to the control +panel. + +@param trackbarname Name of the trackbar. +@param winname Name of the window that is the parent of trackbar. +@param minval New maximum position. + */ +CV_EXPORTS_W void setTrackbarMin(const String& trackbarname, const String& winname, int minval); + +//! @addtogroup highgui_opengl OpenGL support +//! @{ + +/** @brief Displays OpenGL 2D texture in the specified window. + +@param winname Name of the window. +@param tex OpenGL 2D texture data. + */ +CV_EXPORTS void imshow(const String& winname, const ogl::Texture2D& tex); + +/** @brief Sets a callback function to be called to draw on top of displayed image. + +The function setOpenGlDrawCallback can be used to draw 3D data on the window. See the example of +callback function below: +@code + void on_opengl(void* param) + { + glLoadIdentity(); + + glTranslated(0.0, 0.0, -1.0); + + glRotatef( 55, 1, 0, 0 ); + glRotatef( 45, 0, 1, 0 ); + glRotatef( 0, 0, 0, 1 ); + + static const int coords[6][4][3] = { + { { +1, -1, -1 }, { -1, -1, -1 }, { -1, +1, -1 }, { +1, +1, -1 } }, + { { +1, +1, -1 }, { -1, +1, -1 }, { -1, +1, +1 }, { +1, +1, +1 } }, + { { +1, -1, +1 }, { +1, -1, -1 }, { +1, +1, -1 }, { +1, +1, +1 } }, + { { -1, -1, -1 }, { -1, -1, +1 }, { -1, +1, +1 }, { -1, +1, -1 } }, + { { +1, -1, +1 }, { -1, -1, +1 }, { -1, -1, -1 }, { +1, -1, -1 } }, + { { -1, -1, +1 }, { +1, -1, +1 }, { +1, +1, +1 }, { -1, +1, +1 } } + }; + + for (int i = 0; i < 6; ++i) { + glColor3ub( i*20, 100+i*10, i*42 ); + glBegin(GL_QUADS); + for (int j = 0; j < 4; ++j) { + glVertex3d(0.2 * coords[i][j][0], 0.2 * coords[i][j][1], 0.2 * coords[i][j][2]); + } + glEnd(); + } + } +@endcode + +@param winname Name of the window. +@param onOpenGlDraw Pointer to the function to be called every frame. This function should be +prototyped as void Foo(void\*) . +@param userdata Pointer passed to the callback function.(__Optional__) + */ +CV_EXPORTS void setOpenGlDrawCallback(const String& winname, OpenGlDrawCallback onOpenGlDraw, void* userdata = 0); + +/** @brief Sets the specified window as current OpenGL context. + +@param winname Name of the window. + */ +CV_EXPORTS void setOpenGlContext(const String& winname); + +/** @brief Force window to redraw its context and call draw callback ( See cv::setOpenGlDrawCallback ). + +@param winname Name of the window. + */ +CV_EXPORTS void updateWindow(const String& winname); + +//! @} highgui_opengl + +//! @addtogroup highgui_qt +//! @{ + +/** @brief QtFont available only for Qt. See cv::fontQt + */ +struct QtFont +{ + const char* nameFont; //!< Name of the font + Scalar color; //!< Color of the font. Scalar(blue_component, green_component, red_component[, alpha_component]) + int font_face; //!< See cv::QtFontStyles + const int* ascii; //!< font data and metrics + const int* greek; + const int* cyrillic; + float hscale, vscale; + float shear; //!< slope coefficient: 0 - normal, >0 - italic + int thickness; //!< See cv::QtFontWeights + float dx; //!< horizontal interval between letters + int line_type; //!< PointSize +}; + +/** @brief Creates the font to draw a text on an image. + +The function fontQt creates a cv::QtFont object. This cv::QtFont is not compatible with putText . + +A basic usage of this function is the following: : +@code + QtFont font = fontQt("Times"); + addText( img1, "Hello World !", Point(50,50), font); +@endcode + +@param nameFont Name of the font. The name should match the name of a system font (such as +*Times*). If the font is not found, a default one is used. +@param pointSize Size of the font. If not specified, equal zero or negative, the point size of the +font is set to a system-dependent default value. Generally, this is 12 points. +@param color Color of the font in BGRA where A = 255 is fully transparent. Use the macro CV_RGB +for simplicity. +@param weight Font weight. Available operation flags are : cv::QtFontWeights You can also specify a positive integer for better control. +@param style Font style. Available operation flags are : cv::QtFontStyles +@param spacing Spacing between characters. It can be negative or positive. + */ +CV_EXPORTS QtFont fontQt(const String& nameFont, int pointSize = -1, + Scalar color = Scalar::all(0), int weight = QT_FONT_NORMAL, + int style = QT_STYLE_NORMAL, int spacing = 0); + +/** @brief Draws a text on the image. + +The function addText draws *text* on the image *img* using a specific font *font* (see example cv::fontQt +) + +@param img 8-bit 3-channel image where the text should be drawn. +@param text Text to write on an image. +@param org Point(x,y) where the text should start on an image. +@param font Font to use to draw a text. + */ +CV_EXPORTS void addText( const Mat& img, const String& text, Point org, const QtFont& font); + +/** @brief Displays a text on a window image as an overlay for a specified duration. + +The function displayOverlay displays useful information/tips on top of the window for a certain +amount of time *delayms*. The function does not modify the image, displayed in the window, that is, +after the specified delay the original content of the window is restored. + +@param winname Name of the window. +@param text Overlay text to write on a window image. +@param delayms The period (in milliseconds), during which the overlay text is displayed. If this +function is called before the previous overlay text timed out, the timer is restarted and the text +is updated. If this value is zero, the text never disappears. + */ +CV_EXPORTS void displayOverlay(const String& winname, const String& text, int delayms = 0); + +/** @brief Displays a text on the window statusbar during the specified period of time. + +The function displayStatusBar displays useful information/tips on top of the window for a certain +amount of time *delayms* . This information is displayed on the window statusbar (the window must be +created with the CV_GUI_EXPANDED flags). + +@param winname Name of the window. +@param text Text to write on the window statusbar. +@param delayms Duration (in milliseconds) to display the text. If this function is called before +the previous text timed out, the timer is restarted and the text is updated. If this value is +zero, the text never disappears. + */ +CV_EXPORTS void displayStatusBar(const String& winname, const String& text, int delayms = 0); + +/** @brief Saves parameters of the specified window. + +The function saveWindowParameters saves size, location, flags, trackbars value, zoom and panning +location of the window windowName. + +@param windowName Name of the window. + */ +CV_EXPORTS void saveWindowParameters(const String& windowName); + +/** @brief Loads parameters of the specified window. + +The function loadWindowParameters loads size, location, flags, trackbars value, zoom and panning +location of the window windowName. + +@param windowName Name of the window. + */ +CV_EXPORTS void loadWindowParameters(const String& windowName); + +CV_EXPORTS int startLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[]); + +CV_EXPORTS void stopLoop(); + +/** @brief Attaches a button to the control panel. + +The function createButton attaches a button to the control panel. Each button is added to a +buttonbar to the right of the last button. A new buttonbar is created if nothing was attached to the +control panel before, or if the last element attached to the control panel was a trackbar. + +See below various examples of the cv::createButton function call: : +@code + createButton(NULL,callbackButton);//create a push button "button 0", that will call callbackButton. + createButton("button2",callbackButton,NULL,QT_CHECKBOX,0); + createButton("button3",callbackButton,&value); + createButton("button5",callbackButton1,NULL,QT_RADIOBOX); + createButton("button6",callbackButton2,NULL,QT_PUSH_BUTTON,1); +@endcode + +@param bar_name Name of the button. +@param on_change Pointer to the function to be called every time the button changes its state. +This function should be prototyped as void Foo(int state,\*void); . *state* is the current state +of the button. It could be -1 for a push button, 0 or 1 for a check/radio box button. +@param userdata Pointer passed to the callback function. +@param type Optional type of the button. Available types are: (cv::QtButtonTypes) +@param initial_button_state Default state of the button. Use for checkbox and radiobox. Its +value could be 0 or 1. (__Optional__) +*/ +CV_EXPORTS int createButton( const String& bar_name, ButtonCallback on_change, + void* userdata = 0, int type = QT_PUSH_BUTTON, + bool initial_button_state = false); + +//! @} highgui_qt + +//! @} highgui + +} // cv + +#ifndef DISABLE_OPENCV_24_COMPATIBILITY +#include "opencv2/highgui/highgui_c.h" +#endif + +#endif diff --git a/lib/opencv/include/opencv2/highgui/highgui.hpp b/lib/opencv/include/opencv2/highgui/highgui.hpp new file mode 100644 index 000000000..160c9cf4a --- /dev/null +++ b/lib/opencv/include/opencv2/highgui/highgui.hpp @@ -0,0 +1,48 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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*/ + +#ifdef __OPENCV_BUILD +#error this is a compatibility header which should not be used inside the OpenCV library +#endif + +#include "opencv2/highgui.hpp" diff --git a/lib/opencv/include/opencv2/highgui/highgui_c.h b/lib/opencv/include/opencv2/highgui/highgui_c.h new file mode 100644 index 000000000..47fdb84a4 --- /dev/null +++ b/lib/opencv/include/opencv2/highgui/highgui_c.h @@ -0,0 +1,252 @@ +/*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_HIGHGUI_H__ +#define __OPENCV_HIGHGUI_H__ + +#include "opencv2/core/core_c.h" +#include "opencv2/imgproc/imgproc_c.h" +#include "opencv2/imgcodecs/imgcodecs_c.h" +#include "opencv2/videoio/videoio_c.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** @addtogroup highgui_c + @{ + */ + +/****************************************************************************************\ +* Basic GUI functions * +\****************************************************************************************/ +//YV +//-----------New for Qt +/* For font */ +enum { CV_FONT_LIGHT = 25,//QFont::Light, + CV_FONT_NORMAL = 50,//QFont::Normal, + CV_FONT_DEMIBOLD = 63,//QFont::DemiBold, + CV_FONT_BOLD = 75,//QFont::Bold, + CV_FONT_BLACK = 87 //QFont::Black +}; + +enum { CV_STYLE_NORMAL = 0,//QFont::StyleNormal, + CV_STYLE_ITALIC = 1,//QFont::StyleItalic, + CV_STYLE_OBLIQUE = 2 //QFont::StyleOblique +}; +/* ---------*/ + +//for color cvScalar(blue_component, green_component, red_component[, alpha_component]) +//and alpha= 0 <-> 0xFF (not transparent <-> transparent) +CVAPI(CvFont) cvFontQt(const char* nameFont, int pointSize CV_DEFAULT(-1), CvScalar color CV_DEFAULT(cvScalarAll(0)), int weight CV_DEFAULT(CV_FONT_NORMAL), int style CV_DEFAULT(CV_STYLE_NORMAL), int spacing CV_DEFAULT(0)); + +CVAPI(void) cvAddText(const CvArr* img, const char* text, CvPoint org, CvFont *arg2); + +CVAPI(void) cvDisplayOverlay(const char* name, const char* text, int delayms CV_DEFAULT(0)); +CVAPI(void) cvDisplayStatusBar(const char* name, const char* text, int delayms CV_DEFAULT(0)); + +CVAPI(void) cvSaveWindowParameters(const char* name); +CVAPI(void) cvLoadWindowParameters(const char* name); +CVAPI(int) cvStartLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[]); +CVAPI(void) cvStopLoop( void ); + +typedef void (CV_CDECL *CvButtonCallback)(int state, void* userdata); +enum {CV_PUSH_BUTTON = 0, CV_CHECKBOX = 1, CV_RADIOBOX = 2}; +CVAPI(int) cvCreateButton( const char* button_name CV_DEFAULT(NULL),CvButtonCallback on_change CV_DEFAULT(NULL), void* userdata CV_DEFAULT(NULL) , int button_type CV_DEFAULT(CV_PUSH_BUTTON), int initial_button_state CV_DEFAULT(0)); +//---------------------- + + +/* this function is used to set some external parameters in case of X Window */ +CVAPI(int) cvInitSystem( int argc, char** argv ); + +CVAPI(int) cvStartWindowThread( void ); + +// --------- YV --------- +enum +{ + //These 3 flags are used by cvSet/GetWindowProperty + CV_WND_PROP_FULLSCREEN = 0, //to change/get window's fullscreen property + CV_WND_PROP_AUTOSIZE = 1, //to change/get window's autosize property + CV_WND_PROP_ASPECTRATIO= 2, //to change/get window's aspectratio property + CV_WND_PROP_OPENGL = 3, //to change/get window's opengl support + + //These 2 flags are used by cvNamedWindow and cvSet/GetWindowProperty + CV_WINDOW_NORMAL = 0x00000000, //the user can resize the window (no constraint) / also use to switch a fullscreen window to a normal size + CV_WINDOW_AUTOSIZE = 0x00000001, //the user cannot resize the window, the size is constrainted by the image displayed + CV_WINDOW_OPENGL = 0x00001000, //window with opengl support + + //Those flags are only for Qt + CV_GUI_EXPANDED = 0x00000000, //status bar and tool bar + CV_GUI_NORMAL = 0x00000010, //old fashious way + + //These 3 flags are used by cvNamedWindow and cvSet/GetWindowProperty + CV_WINDOW_FULLSCREEN = 1,//change the window to fullscreen + CV_WINDOW_FREERATIO = 0x00000100,//the image expends as much as it can (no ratio constraint) + CV_WINDOW_KEEPRATIO = 0x00000000//the ration image is respected. +}; + +/* create window */ +CVAPI(int) cvNamedWindow( const char* name, int flags CV_DEFAULT(CV_WINDOW_AUTOSIZE) ); + +/* Set and Get Property of the window */ +CVAPI(void) cvSetWindowProperty(const char* name, int prop_id, double prop_value); +CVAPI(double) cvGetWindowProperty(const char* name, int prop_id); + +/* display image within window (highgui windows remember their content) */ +CVAPI(void) cvShowImage( const char* name, const CvArr* image ); + +/* resize/move window */ +CVAPI(void) cvResizeWindow( const char* name, int width, int height ); +CVAPI(void) cvMoveWindow( const char* name, int x, int y ); + + +/* destroy window and all the trackers associated with it */ +CVAPI(void) cvDestroyWindow( const char* name ); + +CVAPI(void) cvDestroyAllWindows(void); + +/* get native window handle (HWND in case of Win32 and Widget in case of X Window) */ +CVAPI(void*) cvGetWindowHandle( const char* name ); + +/* get name of highgui window given its native handle */ +CVAPI(const char*) cvGetWindowName( void* window_handle ); + + +typedef void (CV_CDECL *CvTrackbarCallback)(int pos); + +/* create trackbar and display it on top of given window, set callback */ +CVAPI(int) cvCreateTrackbar( const char* trackbar_name, const char* window_name, + int* value, int count, CvTrackbarCallback on_change CV_DEFAULT(NULL)); + +typedef void (CV_CDECL *CvTrackbarCallback2)(int pos, void* userdata); + +CVAPI(int) cvCreateTrackbar2( const char* trackbar_name, const char* window_name, + int* value, int count, CvTrackbarCallback2 on_change, + void* userdata CV_DEFAULT(0)); + +/* retrieve or set trackbar position */ +CVAPI(int) cvGetTrackbarPos( const char* trackbar_name, const char* window_name ); +CVAPI(void) cvSetTrackbarPos( const char* trackbar_name, const char* window_name, int pos ); +CVAPI(void) cvSetTrackbarMax(const char* trackbar_name, const char* window_name, int maxval); +CVAPI(void) cvSetTrackbarMin(const char* trackbar_name, const char* window_name, int minval); + +enum +{ + CV_EVENT_MOUSEMOVE =0, + CV_EVENT_LBUTTONDOWN =1, + CV_EVENT_RBUTTONDOWN =2, + CV_EVENT_MBUTTONDOWN =3, + CV_EVENT_LBUTTONUP =4, + CV_EVENT_RBUTTONUP =5, + CV_EVENT_MBUTTONUP =6, + CV_EVENT_LBUTTONDBLCLK =7, + CV_EVENT_RBUTTONDBLCLK =8, + CV_EVENT_MBUTTONDBLCLK =9, + CV_EVENT_MOUSEWHEEL =10, + CV_EVENT_MOUSEHWHEEL =11 +}; + +enum +{ + CV_EVENT_FLAG_LBUTTON =1, + CV_EVENT_FLAG_RBUTTON =2, + CV_EVENT_FLAG_MBUTTON =4, + CV_EVENT_FLAG_CTRLKEY =8, + CV_EVENT_FLAG_SHIFTKEY =16, + CV_EVENT_FLAG_ALTKEY =32 +}; + + +#define CV_GET_WHEEL_DELTA(flags) ((short)((flags >> 16) & 0xffff)) // upper 16 bits + +typedef void (CV_CDECL *CvMouseCallback )(int event, int x, int y, int flags, void* param); + +/* assign callback for mouse events */ +CVAPI(void) cvSetMouseCallback( const char* window_name, CvMouseCallback on_mouse, + void* param CV_DEFAULT(NULL)); + +/* wait for key event infinitely (delay<=0) or for "delay" milliseconds */ +CVAPI(int) cvWaitKey(int delay CV_DEFAULT(0)); + +// OpenGL support + +typedef void (CV_CDECL *CvOpenGlDrawCallback)(void* userdata); +CVAPI(void) cvSetOpenGlDrawCallback(const char* window_name, CvOpenGlDrawCallback callback, void* userdata CV_DEFAULT(NULL)); + +CVAPI(void) cvSetOpenGlContext(const char* window_name); +CVAPI(void) cvUpdateWindow(const char* window_name); + + +/****************************************************************************************\ + +* Obsolete functions/synonyms * +\****************************************************************************************/ + +#define cvAddSearchPath(path) +#define cvvInitSystem cvInitSystem +#define cvvNamedWindow cvNamedWindow +#define cvvShowImage cvShowImage +#define cvvResizeWindow cvResizeWindow +#define cvvDestroyWindow cvDestroyWindow +#define cvvCreateTrackbar cvCreateTrackbar +#define cvvAddSearchPath cvAddSearchPath +#define cvvWaitKey(name) cvWaitKey(0) +#define cvvWaitKeyEx(name,delay) cvWaitKey(delay) +#define HG_AUTOSIZE CV_WINDOW_AUTOSIZE +#define set_preprocess_func cvSetPreprocessFuncWin32 +#define set_postprocess_func cvSetPostprocessFuncWin32 + +#if defined WIN32 || defined _WIN32 + +CVAPI(void) cvSetPreprocessFuncWin32_(const void* callback); +CVAPI(void) cvSetPostprocessFuncWin32_(const void* callback); +#define cvSetPreprocessFuncWin32(callback) cvSetPreprocessFuncWin32_((const void*)(callback)) +#define cvSetPostprocessFuncWin32(callback) cvSetPostprocessFuncWin32_((const void*)(callback)) + +#endif + +/** @} highgui_c */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/lib/opencv/include/opencv2/imgcodecs.hpp b/lib/opencv/include/opencv2/imgcodecs.hpp new file mode 100644 index 000000000..ac0fd24ee --- /dev/null +++ b/lib/opencv/include/opencv2/imgcodecs.hpp @@ -0,0 +1,267 @@ +/*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_IMGCODECS_HPP__ +#define __OPENCV_IMGCODECS_HPP__ + +#include "opencv2/core.hpp" + +/** + @defgroup imgcodecs Image file reading and writing + @{ + @defgroup imgcodecs_c C API + @defgroup imgcodecs_ios iOS glue + @} +*/ + +//////////////////////////////// image codec //////////////////////////////// +namespace cv +{ + +//! @addtogroup imgcodecs +//! @{ + +//! Imread flags +enum ImreadModes { + IMREAD_UNCHANGED = -1, //!< If set, return the loaded image as is (with alpha channel, otherwise it gets cropped). + IMREAD_GRAYSCALE = 0, //!< If set, always convert image to the single channel grayscale image. + IMREAD_COLOR = 1, //!< If set, always convert image to the 3 channel BGR color image. + IMREAD_ANYDEPTH = 2, //!< If set, return 16-bit/32-bit image when the input has the corresponding depth, otherwise convert it to 8-bit. + IMREAD_ANYCOLOR = 4, //!< If set, the image is read in any possible color format. + IMREAD_LOAD_GDAL = 8, //!< If set, use the gdal driver for loading the image. + IMREAD_REDUCED_GRAYSCALE_2 = 16, //!< If set, always convert image to the single channel grayscale image and the image size reduced 1/2. + IMREAD_REDUCED_COLOR_2 = 17, //!< If set, always convert image to the 3 channel BGR color image and the image size reduced 1/2. + IMREAD_REDUCED_GRAYSCALE_4 = 32, //!< If set, always convert image to the single channel grayscale image and the image size reduced 1/4. + IMREAD_REDUCED_COLOR_4 = 33, //!< If set, always convert image to the 3 channel BGR color image and the image size reduced 1/4. + IMREAD_REDUCED_GRAYSCALE_8 = 64, //!< If set, always convert image to the single channel grayscale image and the image size reduced 1/8. + IMREAD_REDUCED_COLOR_8 = 65 //!< If set, always convert image to the 3 channel BGR color image and the image size reduced 1/8. + }; + +//! Imwrite flags +enum ImwriteFlags { + IMWRITE_JPEG_QUALITY = 1, //!< For JPEG, it can be a quality from 0 to 100 (the higher is the better). Default value is 95. + IMWRITE_JPEG_PROGRESSIVE = 2, //!< Enable JPEG features, 0 or 1, default is False. + IMWRITE_JPEG_OPTIMIZE = 3, //!< Enable JPEG features, 0 or 1, default is False. + IMWRITE_JPEG_RST_INTERVAL = 4, //!< JPEG restart interval, 0 - 65535, default is 0 - no restart. + IMWRITE_JPEG_LUMA_QUALITY = 5, //!< Separate luma quality level, 0 - 100, default is 0 - don't use. + IMWRITE_JPEG_CHROMA_QUALITY = 6, //!< Separate chroma quality level, 0 - 100, default is 0 - don't use. + IMWRITE_PNG_COMPRESSION = 16, //!< For PNG, it can be the compression level from 0 to 9. A higher value means a smaller size and longer compression time. Default value is 3. + IMWRITE_PNG_STRATEGY = 17, //!< One of cv::ImwritePNGFlags, default is IMWRITE_PNG_STRATEGY_DEFAULT. + IMWRITE_PNG_BILEVEL = 18, //!< Binary level PNG, 0 or 1, default is 0. + IMWRITE_PXM_BINARY = 32, //!< For PPM, PGM, or PBM, it can be a binary format flag, 0 or 1. Default value is 1. + IMWRITE_WEBP_QUALITY = 64 //!< For WEBP, it can be a quality from 1 to 100 (the higher is the better). By default (without any parameter) and for quality above 100 the lossless compression is used. + }; + +//! Imwrite PNG specific flags used to tune the compression algorithm. +/** These flags will be modify the way of PNG image compression and will be passed to the underlying zlib processing stage. + +- The effect of IMWRITE_PNG_STRATEGY_FILTERED is to force more Huffman coding and less string matching; it is somewhat intermediate between IMWRITE_PNG_STRATEGY_DEFAULT and IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY. +- IMWRITE_PNG_STRATEGY_RLE is designed to be almost as fast as IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY, but give better compression for PNG image data. +- The strategy parameter only affects the compression ratio but not the correctness of the compressed output even if it is not set appropriately. +- IMWRITE_PNG_STRATEGY_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications. +*/ +enum ImwritePNGFlags { + IMWRITE_PNG_STRATEGY_DEFAULT = 0, //!< Use this value for normal data. + IMWRITE_PNG_STRATEGY_FILTERED = 1, //!< Use this value for data produced by a filter (or predictor).Filtered data consists mostly of small values with a somewhat random distribution. In this case, the compression algorithm is tuned to compress them better. + IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY = 2, //!< Use this value to force Huffman encoding only (no string match). + IMWRITE_PNG_STRATEGY_RLE = 3, //!< Use this value to limit match distances to one (run-length encoding). + IMWRITE_PNG_STRATEGY_FIXED = 4 //!< Using this value prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications. + }; + +/** @brief Loads an image from a file. + +@anchor imread + +The function imread loads an image from the specified file and returns it. If the image cannot be +read (because of missing file, improper permissions, unsupported or invalid format), the function +returns an empty matrix ( Mat::data==NULL ). + +Currently, the following file formats are supported: + +- Windows bitmaps - \*.bmp, \*.dib (always supported) +- JPEG files - \*.jpeg, \*.jpg, \*.jpe (see the *Notes* section) +- JPEG 2000 files - \*.jp2 (see the *Notes* section) +- Portable Network Graphics - \*.png (see the *Notes* section) +- WebP - \*.webp (see the *Notes* section) +- Portable image format - \*.pbm, \*.pgm, \*.ppm \*.pxm, \*.pnm (always supported) +- Sun rasters - \*.sr, \*.ras (always supported) +- TIFF files - \*.tiff, \*.tif (see the *Notes* section) +- OpenEXR Image files - \*.exr (see the *Notes* section) +- Radiance HDR - \*.hdr, \*.pic (always supported) +- Raster and Vector geospatial data supported by Gdal (see the *Notes* section) + +@note + +- The function determines the type of an image by the content, not by the file extension. +- In the case of color images, the decoded images will have the channels stored in **B G R** order. +- On Microsoft Windows\* OS and MacOSX\*, the codecs shipped with an OpenCV image (libjpeg, + libpng, libtiff, and libjasper) are used by default. So, OpenCV can always read JPEGs, PNGs, + and TIFFs. On MacOSX, there is also an option to use native MacOSX image readers. But beware + that currently these native image loaders give images with different pixel values because of + the color management embedded into MacOSX. +- On Linux\*, BSD flavors and other Unix-like open-source operating systems, OpenCV looks for + codecs supplied with an OS image. Install the relevant packages (do not forget the development + files, for example, "libjpeg-dev", in Debian\* and Ubuntu\*) to get the codec support or turn + on the OPENCV_BUILD_3RDPARTY_LIBS flag in CMake. +- In the case you set *WITH_GDAL* flag to true in CMake and @ref IMREAD_LOAD_GDAL to load the image, + then [GDAL](http://www.gdal.org) driver will be used in order to decode the image by supporting + the following formats: [Raster](http://www.gdal.org/formats_list.html), + [Vector](http://www.gdal.org/ogr_formats.html). +@param filename Name of file to be loaded. +@param flags Flag that can take values of cv::ImreadModes +*/ +CV_EXPORTS_W Mat imread( const String& filename, int flags = IMREAD_COLOR ); + +/** @brief Loads a multi-page image from a file. + +The function imreadmulti loads a multi-page image from the specified file into a vector of Mat objects. +@param filename Name of file to be loaded. +@param flags Flag that can take values of cv::ImreadModes, default with cv::IMREAD_ANYCOLOR. +@param mats A vector of Mat objects holding each page, if more than one. +@sa cv::imread +*/ +CV_EXPORTS_W bool imreadmulti(const String& filename, std::vector& mats, int flags = IMREAD_ANYCOLOR); + +/** @brief Saves an image to a specified file. + +The function imwrite saves the image to the specified file. The image format is chosen based on the +filename extension (see cv::imread for the list of extensions). Only 8-bit (or 16-bit unsigned (CV_16U) +in case of PNG, JPEG 2000, and TIFF) single-channel or 3-channel (with 'BGR' channel order) images +can be saved using this function. If the format, depth or channel order is different, use +Mat::convertTo , and cv::cvtColor to convert it before saving. Or, use the universal FileStorage I/O +functions to save the image to XML or YAML format. + +It is possible to store PNG images with an alpha channel using this function. To do this, create +8-bit (or 16-bit) 4-channel image BGRA, where the alpha channel goes last. Fully transparent pixels +should have alpha set to 0, fully opaque pixels should have alpha set to 255/65535. + +The sample below shows how to create such a BGRA image and store to PNG file. It also demonstrates how to set custom +compression parameters : +@code + #include + + using namespace cv; + using namespace std; + + void createAlphaMat(Mat &mat) + { + CV_Assert(mat.channels() == 4); + for (int i = 0; i < mat.rows; ++i) { + for (int j = 0; j < mat.cols; ++j) { + Vec4b& bgra = mat.at(i, j); + bgra[0] = UCHAR_MAX; // Blue + bgra[1] = saturate_cast((float (mat.cols - j)) / ((float)mat.cols) * UCHAR_MAX); // Green + bgra[2] = saturate_cast((float (mat.rows - i)) / ((float)mat.rows) * UCHAR_MAX); // Red + bgra[3] = saturate_cast(0.5 * (bgra[1] + bgra[2])); // Alpha + } + } + } + + int main(int argv, char **argc) + { + // Create mat with alpha channel + Mat mat(480, 640, CV_8UC4); + createAlphaMat(mat); + + vector compression_params; + compression_params.push_back(IMWRITE_PNG_COMPRESSION); + compression_params.push_back(9); + + try { + imwrite("alpha.png", mat, compression_params); + } + catch (cv::Exception& ex) { + fprintf(stderr, "Exception converting image to PNG format: %s\n", ex.what()); + return 1; + } + + fprintf(stdout, "Saved PNG file with alpha data.\n"); + return 0; + } +@endcode +@param filename Name of the file. +@param img Image to be saved. +@param params Format-specific parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ... .) see cv::ImwriteFlags +*/ +CV_EXPORTS_W bool imwrite( const String& filename, InputArray img, + const std::vector& params = std::vector()); + +/** @brief Reads an image from a buffer in memory. + +The function imdecode reads an image from the specified buffer in the memory. If the buffer is too short or +contains invalid data, the function returns an empty matrix ( Mat::data==NULL ). + +See cv::imread for the list of supported formats and flags description. + +@note In the case of color images, the decoded images will have the channels stored in **B G R** order. +@param buf Input array or vector of bytes. +@param flags The same flags as in cv::imread, see cv::ImreadModes. +*/ +CV_EXPORTS_W Mat imdecode( InputArray buf, int flags ); + +/** @overload +@param buf +@param flags +@param dst The optional output placeholder for the decoded matrix. It can save the image +reallocations when the function is called repeatedly for images of the same size. +*/ +CV_EXPORTS Mat imdecode( InputArray buf, int flags, Mat* dst); + +/** @brief Encodes an image into a memory buffer. + +The function imencode compresses the image and stores it in the memory buffer that is resized to fit the +result. See cv::imwrite for the list of supported formats and flags description. + +@param ext File extension that defines the output format. +@param img Image to be written. +@param buf Output buffer resized to fit the compressed image. +@param params Format-specific parameters. See cv::imwrite and cv::ImwriteFlags. +*/ +CV_EXPORTS_W bool imencode( const String& ext, InputArray img, + CV_OUT std::vector& buf, + const std::vector& params = std::vector()); + +//! @} imgcodecs + +} // cv + +#endif //__OPENCV_IMGCODECS_HPP__ diff --git a/lib/opencv/include/opencv2/imgcodecs/imgcodecs.hpp b/lib/opencv/include/opencv2/imgcodecs/imgcodecs.hpp new file mode 100644 index 000000000..a3cd23264 --- /dev/null +++ b/lib/opencv/include/opencv2/imgcodecs/imgcodecs.hpp @@ -0,0 +1,48 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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*/ + +#ifdef __OPENCV_BUILD +#error this is a compatibility header which should not be used inside the OpenCV library +#endif + +#include "opencv2/imgcodecs.hpp" diff --git a/lib/opencv/include/opencv2/imgcodecs/imgcodecs_c.h b/lib/opencv/include/opencv2/imgcodecs/imgcodecs_c.h new file mode 100644 index 000000000..ad793cc94 --- /dev/null +++ b/lib/opencv/include/opencv2/imgcodecs/imgcodecs_c.h @@ -0,0 +1,137 @@ +/*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_IMGCODECS_H__ +#define __OPENCV_IMGCODECS_H__ + +#include "opencv2/core/core_c.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** @addtogroup imgcodecs_c + @{ + */ + +enum +{ +/* 8bit, color or not */ + CV_LOAD_IMAGE_UNCHANGED =-1, +/* 8bit, gray */ + CV_LOAD_IMAGE_GRAYSCALE =0, +/* ?, color */ + CV_LOAD_IMAGE_COLOR =1, +/* any depth, ? */ + CV_LOAD_IMAGE_ANYDEPTH =2, +/* ?, any color */ + CV_LOAD_IMAGE_ANYCOLOR =4 +}; + +/* load image from file + iscolor can be a combination of above flags where CV_LOAD_IMAGE_UNCHANGED + overrides the other flags + using CV_LOAD_IMAGE_ANYCOLOR alone is equivalent to CV_LOAD_IMAGE_UNCHANGED + unless CV_LOAD_IMAGE_ANYDEPTH is specified images are converted to 8bit +*/ +CVAPI(IplImage*) cvLoadImage( const char* filename, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR)); +CVAPI(CvMat*) cvLoadImageM( const char* filename, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR)); + +enum +{ + CV_IMWRITE_JPEG_QUALITY =1, + CV_IMWRITE_JPEG_PROGRESSIVE =2, + CV_IMWRITE_JPEG_OPTIMIZE =3, + CV_IMWRITE_JPEG_RST_INTERVAL =4, + CV_IMWRITE_JPEG_LUMA_QUALITY =5, + CV_IMWRITE_JPEG_CHROMA_QUALITY =6, + CV_IMWRITE_PNG_COMPRESSION =16, + CV_IMWRITE_PNG_STRATEGY =17, + CV_IMWRITE_PNG_BILEVEL =18, + CV_IMWRITE_PNG_STRATEGY_DEFAULT =0, + CV_IMWRITE_PNG_STRATEGY_FILTERED =1, + CV_IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY =2, + CV_IMWRITE_PNG_STRATEGY_RLE =3, + CV_IMWRITE_PNG_STRATEGY_FIXED =4, + CV_IMWRITE_PXM_BINARY =32, + CV_IMWRITE_WEBP_QUALITY =64 +}; + +/* save image to file */ +CVAPI(int) cvSaveImage( const char* filename, const CvArr* image, + const int* params CV_DEFAULT(0) ); + +/* decode image stored in the buffer */ +CVAPI(IplImage*) cvDecodeImage( const CvMat* buf, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR)); +CVAPI(CvMat*) cvDecodeImageM( const CvMat* buf, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR)); + +/* encode image and store the result as a byte vector (single-row 8uC1 matrix) */ +CVAPI(CvMat*) cvEncodeImage( const char* ext, const CvArr* image, + const int* params CV_DEFAULT(0) ); + +enum +{ + CV_CVTIMG_FLIP =1, + CV_CVTIMG_SWAP_RB =2 +}; + +/* utility function: convert one image to another with optional vertical flip */ +CVAPI(void) cvConvertImage( const CvArr* src, CvArr* dst, int flags CV_DEFAULT(0)); + +CVAPI(int) cvHaveImageReader(const char* filename); +CVAPI(int) cvHaveImageWriter(const char* filename); + + +/****************************************************************************************\ +* Obsolete functions/synonyms * +\****************************************************************************************/ + +#define cvvLoadImage(name) cvLoadImage((name),1) +#define cvvSaveImage cvSaveImage +#define cvvConvertImage cvConvertImage + +/** @} imgcodecs_c */ + +#ifdef __cplusplus +} +#endif + +#endif // __OPENCV_IMGCODECS_H__ diff --git a/lib/opencv/include/opencv2/imgcodecs/ios.h b/lib/opencv/include/opencv2/imgcodecs/ios.h new file mode 100644 index 000000000..fbd6371e5 --- /dev/null +++ b/lib/opencv/include/opencv2/imgcodecs/ios.h @@ -0,0 +1,57 @@ + +/*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*/ + +#import +#import +#import +#import +#include "opencv2/core/core.hpp" + +//! @addtogroup imgcodecs_ios +//! @{ + +UIImage* MatToUIImage(const cv::Mat& image); +void UIImageToMat(const UIImage* image, + cv::Mat& m, bool alphaExist = false); + +//! @} diff --git a/lib/opencv/include/opencv2/imgproc.hpp b/lib/opencv/include/opencv2/imgproc.hpp new file mode 100644 index 000000000..717dcf578 --- /dev/null +++ b/lib/opencv/include/opencv2/imgproc.hpp @@ -0,0 +1,4330 @@ +/*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_IMGPROC_HPP__ +#define __OPENCV_IMGPROC_HPP__ + +#include "opencv2/core.hpp" + +/** + @defgroup imgproc Image processing + @{ + @defgroup imgproc_filter Image Filtering + +Functions and classes described in this section are used to perform various linear or non-linear +filtering operations on 2D images (represented as Mat's). It means that for each pixel location +\f$(x,y)\f$ in the source image (normally, rectangular), its neighborhood is considered and used to +compute the response. In case of a linear filter, it is a weighted sum of pixel values. In case of +morphological operations, it is the minimum or maximum values, and so on. The computed response is +stored in the destination image at the same location \f$(x,y)\f$. It means that the output image +will be of the same size as the input image. Normally, the functions support multi-channel arrays, +in which case every channel is processed independently. Therefore, the output image will also have +the same number of channels as the input one. + +Another common feature of the functions and classes described in this section is that, unlike +simple arithmetic functions, they need to extrapolate values of some non-existing pixels. For +example, if you want to smooth an image using a Gaussian \f$3 \times 3\f$ filter, then, when +processing the left-most pixels in each row, you need pixels to the left of them, that is, outside +of the image. You can let these pixels be the same as the left-most image pixels ("replicated +border" extrapolation method), or assume that all the non-existing pixels are zeros ("constant +border" extrapolation method), and so on. OpenCV enables you to specify the extrapolation method. +For details, see cv::BorderTypes + +@anchor filter_depths +### Depth combinations +Input depth (src.depth()) | Output depth (ddepth) +--------------------------|---------------------- +CV_8U | -1/CV_16S/CV_32F/CV_64F +CV_16U/CV_16S | -1/CV_32F/CV_64F +CV_32F | -1/CV_32F/CV_64F +CV_64F | -1/CV_64F + +@note when ddepth=-1, the output image will have the same depth as the source. + + @defgroup imgproc_transform Geometric Image Transformations + +The functions in this section perform various geometrical transformations of 2D images. They do not +change the image content but deform the pixel grid and map this deformed grid to the destination +image. In fact, to avoid sampling artifacts, the mapping is done in the reverse order, from +destination to the source. That is, for each pixel \f$(x, y)\f$ of the destination image, the +functions compute coordinates of the corresponding "donor" pixel in the source image and copy the +pixel value: + +\f[\texttt{dst} (x,y)= \texttt{src} (f_x(x,y), f_y(x,y))\f] + +In case when you specify the forward mapping \f$\left: \texttt{src} \rightarrow +\texttt{dst}\f$, the OpenCV functions first compute the corresponding inverse mapping +\f$\left: \texttt{dst} \rightarrow \texttt{src}\f$ and then use the above formula. + +The actual implementations of the geometrical transformations, from the most generic remap and to +the simplest and the fastest resize, need to solve two main problems with the above formula: + +- Extrapolation of non-existing pixels. Similarly to the filtering functions described in the +previous section, for some \f$(x,y)\f$, either one of \f$f_x(x,y)\f$, or \f$f_y(x,y)\f$, or both +of them may fall outside of the image. In this case, an extrapolation method needs to be used. +OpenCV provides the same selection of extrapolation methods as in the filtering functions. In +addition, it provides the method BORDER_TRANSPARENT. This means that the corresponding pixels in +the destination image will not be modified at all. + +- Interpolation of pixel values. Usually \f$f_x(x,y)\f$ and \f$f_y(x,y)\f$ are floating-point +numbers. This means that \f$\left\f$ can be either an affine or perspective +transformation, or radial lens distortion correction, and so on. So, a pixel value at fractional +coordinates needs to be retrieved. In the simplest case, the coordinates can be just rounded to the +nearest integer coordinates and the corresponding pixel can be used. This is called a +nearest-neighbor interpolation. However, a better result can be achieved by using more +sophisticated [interpolation methods](http://en.wikipedia.org/wiki/Multivariate_interpolation) , +where a polynomial function is fit into some neighborhood of the computed pixel \f$(f_x(x,y), +f_y(x,y))\f$, and then the value of the polynomial at \f$(f_x(x,y), f_y(x,y))\f$ is taken as the +interpolated pixel value. In OpenCV, you can choose between several interpolation methods. See +resize for details. + + @defgroup imgproc_misc Miscellaneous Image Transformations + @defgroup imgproc_draw Drawing Functions + +Drawing functions work with matrices/images of arbitrary depth. The boundaries of the shapes can be +rendered with antialiasing (implemented only for 8-bit images for now). All the functions include +the parameter color that uses an RGB value (that may be constructed with the Scalar constructor ) +for color images and brightness for grayscale images. For color images, the channel ordering is +normally *Blue, Green, Red*. This is what imshow, imread, and imwrite expect. So, if you form a +color using the Scalar constructor, it should look like: + +\f[\texttt{Scalar} (blue \_ component, green \_ component, red \_ component[, alpha \_ component])\f] + +If you are using your own image rendering and I/O functions, you can use any channel ordering. The +drawing functions process each channel independently and do not depend on the channel order or even +on the used color space. The whole image can be converted from BGR to RGB or to a different color +space using cvtColor . + +If a drawn figure is partially or completely outside the image, the drawing functions clip it. Also, +many drawing functions can handle pixel coordinates specified with sub-pixel accuracy. This means +that the coordinates can be passed as fixed-point numbers encoded as integers. The number of +fractional bits is specified by the shift parameter and the real point coordinates are calculated as +\f$\texttt{Point}(x,y)\rightarrow\texttt{Point2f}(x*2^{-shift},y*2^{-shift})\f$ . This feature is +especially effective when rendering antialiased shapes. + +@note The functions do not support alpha-transparency when the target image is 4-channel. In this +case, the color[3] is simply copied to the repainted pixels. Thus, if you want to paint +semi-transparent shapes, you can paint them in a separate buffer and then blend it with the main +image. + + @defgroup imgproc_colormap ColorMaps in OpenCV + +The human perception isn't built for observing fine changes in grayscale images. Human eyes are more +sensitive to observing changes between colors, so you often need to recolor your grayscale images to +get a clue about them. OpenCV now comes with various colormaps to enhance the visualization in your +computer vision application. + +In OpenCV you only need applyColorMap to apply a colormap on a given image. The following sample +code reads the path to an image from command line, applies a Jet colormap on it and shows the +result: + +@code +#include +#include +#include +#include +using namespace cv; + +#include +using namespace std; + +int main(int argc, const char *argv[]) +{ + // We need an input image. (can be grayscale or color) + if (argc < 2) + { + cerr << "We need an image to process here. Please run: colorMap [path_to_image]" << endl; + return -1; + } + Mat img_in = imread(argv[1]); + if(img_in.empty()) + { + cerr << "Sample image (" << argv[1] << ") is empty. Please adjust your path, so it points to a valid input image!" << endl; + return -1; + } + // Holds the colormap version of the image: + Mat img_color; + // Apply the colormap: + applyColorMap(img_in, img_color, COLORMAP_JET); + // Show the result: + imshow("colorMap", img_color); + waitKey(0); + return 0; +} +@endcode + +@see cv::ColormapTypes + + @defgroup imgproc_hist Histograms + @defgroup imgproc_shape Structural Analysis and Shape Descriptors + @defgroup imgproc_motion Motion Analysis and Object Tracking + @defgroup imgproc_feature Feature Detection + @defgroup imgproc_object Object Detection + @defgroup imgproc_c C API + @} +*/ + +namespace cv +{ + +/** @addtogroup imgproc +@{ +*/ + +//! @addtogroup imgproc_filter +//! @{ + +//! type of morphological operation +enum MorphTypes{ + MORPH_ERODE = 0, //!< see cv::erode + MORPH_DILATE = 1, //!< see cv::dilate + MORPH_OPEN = 2, //!< an opening operation + //!< \f[\texttt{dst} = \mathrm{open} ( \texttt{src} , \texttt{element} )= \mathrm{dilate} ( \mathrm{erode} ( \texttt{src} , \texttt{element} ))\f] + MORPH_CLOSE = 3, //!< a closing operation + //!< \f[\texttt{dst} = \mathrm{close} ( \texttt{src} , \texttt{element} )= \mathrm{erode} ( \mathrm{dilate} ( \texttt{src} , \texttt{element} ))\f] + MORPH_GRADIENT = 4, //!< a morphological gradient + //!< \f[\texttt{dst} = \mathrm{morph\_grad} ( \texttt{src} , \texttt{element} )= \mathrm{dilate} ( \texttt{src} , \texttt{element} )- \mathrm{erode} ( \texttt{src} , \texttt{element} )\f] + MORPH_TOPHAT = 5, //!< "top hat" + //!< \f[\texttt{dst} = \mathrm{tophat} ( \texttt{src} , \texttt{element} )= \texttt{src} - \mathrm{open} ( \texttt{src} , \texttt{element} )\f] + MORPH_BLACKHAT = 6, //!< "black hat" + //!< \f[\texttt{dst} = \mathrm{blackhat} ( \texttt{src} , \texttt{element} )= \mathrm{close} ( \texttt{src} , \texttt{element} )- \texttt{src}\f] + MORPH_HITMISS = 7 //!< "hit and miss" + //!< .- Only supported for CV_8UC1 binary images. Tutorial can be found in [this page](http://opencv-code.com/tutorials/hit-or-miss-transform-in-opencv/) +}; + +//! shape of the structuring element +enum MorphShapes { + MORPH_RECT = 0, //!< a rectangular structuring element: \f[E_{ij}=1\f] + MORPH_CROSS = 1, //!< a cross-shaped structuring element: + //!< \f[E_{ij} = \fork{1}{if i=\texttt{anchor.y} or j=\texttt{anchor.x}}{0}{otherwise}\f] + MORPH_ELLIPSE = 2 //!< an elliptic structuring element, that is, a filled ellipse inscribed + //!< into the rectangle Rect(0, 0, esize.width, 0.esize.height) +}; + +//! @} imgproc_filter + +//! @addtogroup imgproc_transform +//! @{ + +//! interpolation algorithm +enum InterpolationFlags{ + /** nearest neighbor interpolation */ + INTER_NEAREST = 0, + /** bilinear interpolation */ + INTER_LINEAR = 1, + /** bicubic interpolation */ + INTER_CUBIC = 2, + /** resampling using pixel area relation. It may be a preferred method for image decimation, as + it gives moire'-free results. But when the image is zoomed, it is similar to the INTER_NEAREST + method. */ + INTER_AREA = 3, + /** Lanczos interpolation over 8x8 neighborhood */ + INTER_LANCZOS4 = 4, + /** mask for interpolation codes */ + INTER_MAX = 7, + /** flag, fills all of the destination image pixels. If some of them correspond to outliers in the + source image, they are set to zero */ + WARP_FILL_OUTLIERS = 8, + /** flag, inverse transformation + + For example, polar transforms: + - flag is __not__ set: \f$dst( \phi , \rho ) = src(x,y)\f$ + - flag is set: \f$dst(x,y) = src( \phi , \rho )\f$ + */ + WARP_INVERSE_MAP = 16 +}; + +enum InterpolationMasks { + INTER_BITS = 5, + INTER_BITS2 = INTER_BITS * 2, + INTER_TAB_SIZE = 1 << INTER_BITS, + INTER_TAB_SIZE2 = INTER_TAB_SIZE * INTER_TAB_SIZE + }; + +//! @} imgproc_transform + +//! @addtogroup imgproc_misc +//! @{ + +//! Distance types for Distance Transform and M-estimators +//! @see cv::distanceTransform, cv::fitLine +enum DistanceTypes { + DIST_USER = -1, //!< User defined distance + DIST_L1 = 1, //!< distance = |x1-x2| + |y1-y2| + DIST_L2 = 2, //!< the simple euclidean distance + DIST_C = 3, //!< distance = max(|x1-x2|,|y1-y2|) + DIST_L12 = 4, //!< L1-L2 metric: distance = 2(sqrt(1+x*x/2) - 1)) + DIST_FAIR = 5, //!< distance = c^2(|x|/c-log(1+|x|/c)), c = 1.3998 + DIST_WELSCH = 6, //!< distance = c^2/2(1-exp(-(x/c)^2)), c = 2.9846 + DIST_HUBER = 7 //!< distance = |x| \texttt{thresh}\)}{0}{otherwise}\f] + THRESH_BINARY_INV = 1, //!< \f[\texttt{dst} (x,y) = \fork{0}{if \(\texttt{src}(x,y) > \texttt{thresh}\)}{\texttt{maxval}}{otherwise}\f] + THRESH_TRUNC = 2, //!< \f[\texttt{dst} (x,y) = \fork{\texttt{threshold}}{if \(\texttt{src}(x,y) > \texttt{thresh}\)}{\texttt{src}(x,y)}{otherwise}\f] + THRESH_TOZERO = 3, //!< \f[\texttt{dst} (x,y) = \fork{\texttt{src}(x,y)}{if \(\texttt{src}(x,y) > \texttt{thresh}\)}{0}{otherwise}\f] + THRESH_TOZERO_INV = 4, //!< \f[\texttt{dst} (x,y) = \fork{0}{if \(\texttt{src}(x,y) > \texttt{thresh}\)}{\texttt{src}(x,y)}{otherwise}\f] + THRESH_MASK = 7, + THRESH_OTSU = 8, //!< flag, use Otsu algorithm to choose the optimal threshold value + THRESH_TRIANGLE = 16 //!< flag, use Triangle algorithm to choose the optimal threshold value +}; + +//! adaptive threshold algorithm +//! see cv::adaptiveThreshold +enum AdaptiveThresholdTypes { + /** the threshold value \f$T(x,y)\f$ is a mean of the \f$\texttt{blockSize} \times + \texttt{blockSize}\f$ neighborhood of \f$(x, y)\f$ minus C */ + ADAPTIVE_THRESH_MEAN_C = 0, + /** the threshold value \f$T(x, y)\f$ is a weighted sum (cross-correlation with a Gaussian + window) of the \f$\texttt{blockSize} \times \texttt{blockSize}\f$ neighborhood of \f$(x, y)\f$ + minus C . The default sigma (standard deviation) is used for the specified blockSize . See + cv::getGaussianKernel*/ + ADAPTIVE_THRESH_GAUSSIAN_C = 1 +}; + +//! cv::undistort mode +enum UndistortTypes { + PROJ_SPHERICAL_ORTHO = 0, + PROJ_SPHERICAL_EQRECT = 1 + }; + +//! class of the pixel in GrabCut algorithm +enum GrabCutClasses { + GC_BGD = 0, //!< an obvious background pixels + GC_FGD = 1, //!< an obvious foreground (object) pixel + GC_PR_BGD = 2, //!< a possible background pixel + GC_PR_FGD = 3 //!< a possible foreground pixel +}; + +//! GrabCut algorithm flags +enum GrabCutModes { + /** The function initializes the state and the mask using the provided rectangle. After that it + runs iterCount iterations of the algorithm. */ + GC_INIT_WITH_RECT = 0, + /** The function initializes the state using the provided mask. Note that GC_INIT_WITH_RECT + and GC_INIT_WITH_MASK can be combined. Then, all the pixels outside of the ROI are + automatically initialized with GC_BGD .*/ + GC_INIT_WITH_MASK = 1, + /** The value means that the algorithm should just resume. */ + GC_EVAL = 2 +}; + +//! distanceTransform algorithm flags +enum DistanceTransformLabelTypes { + /** each connected component of zeros in src (as well as all the non-zero pixels closest to the + connected component) will be assigned the same label */ + DIST_LABEL_CCOMP = 0, + /** each zero pixel (and all the non-zero pixels closest to it) gets its own label. */ + DIST_LABEL_PIXEL = 1 +}; + +//! floodfill algorithm flags +enum FloodFillFlags { + /** If set, the difference between the current pixel and seed pixel is considered. Otherwise, + the difference between neighbor pixels is considered (that is, the range is floating). */ + FLOODFILL_FIXED_RANGE = 1 << 16, + /** If set, the function does not change the image ( newVal is ignored), and only fills the + mask with the value specified in bits 8-16 of flags as described above. This option only make + sense in function variants that have the mask parameter. */ + FLOODFILL_MASK_ONLY = 1 << 17 +}; + +//! @} imgproc_misc + +//! @addtogroup imgproc_shape +//! @{ + +//! connected components algorithm output formats +enum ConnectedComponentsTypes { + CC_STAT_LEFT = 0, //!< The leftmost (x) coordinate which is the inclusive start of the bounding + //!< box in the horizontal direction. + CC_STAT_TOP = 1, //!< The topmost (y) coordinate which is the inclusive start of the bounding + //!< box in the vertical direction. + CC_STAT_WIDTH = 2, //!< The horizontal size of the bounding box + CC_STAT_HEIGHT = 3, //!< The vertical size of the bounding box + CC_STAT_AREA = 4, //!< The total area (in pixels) of the connected component + CC_STAT_MAX = 5 +}; + +//! mode of the contour retrieval algorithm +enum RetrievalModes { + /** retrieves only the extreme outer contours. It sets `hierarchy[i][2]=hierarchy[i][3]=-1` for + all the contours. */ + RETR_EXTERNAL = 0, + /** retrieves all of the contours without establishing any hierarchical relationships. */ + RETR_LIST = 1, + /** retrieves all of the contours and organizes them into a two-level hierarchy. At the top + level, there are external boundaries of the components. At the second level, there are + boundaries of the holes. If there is another contour inside a hole of a connected component, it + is still put at the top level. */ + RETR_CCOMP = 2, + /** retrieves all of the contours and reconstructs a full hierarchy of nested contours.*/ + RETR_TREE = 3, + RETR_FLOODFILL = 4 //!< +}; + +//! the contour approximation algorithm +enum ContourApproximationModes { + /** stores absolutely all the contour points. That is, any 2 subsequent points (x1,y1) and + (x2,y2) of the contour will be either horizontal, vertical or diagonal neighbors, that is, + max(abs(x1-x2),abs(y2-y1))==1. */ + CHAIN_APPROX_NONE = 1, + /** compresses horizontal, vertical, and diagonal segments and leaves only their end points. + For example, an up-right rectangular contour is encoded with 4 points. */ + CHAIN_APPROX_SIMPLE = 2, + /** applies one of the flavors of the Teh-Chin chain approximation algorithm @cite TehChin89 */ + CHAIN_APPROX_TC89_L1 = 3, + /** applies one of the flavors of the Teh-Chin chain approximation algorithm @cite TehChin89 */ + CHAIN_APPROX_TC89_KCOS = 4 +}; + +//! @} imgproc_shape + +//! Variants of a Hough transform +enum HoughModes { + + /** classical or standard Hough transform. Every line is represented by two floating-point + numbers \f$(\rho, \theta)\f$ , where \f$\rho\f$ is a distance between (0,0) point and the line, + and \f$\theta\f$ is the angle between x-axis and the normal to the line. Thus, the matrix must + be (the created sequence will be) of CV_32FC2 type */ + HOUGH_STANDARD = 0, + /** probabilistic Hough transform (more efficient in case if the picture contains a few long + linear segments). It returns line segments rather than the whole line. Each segment is + represented by starting and ending points, and the matrix must be (the created sequence will + be) of the CV_32SC4 type. */ + HOUGH_PROBABILISTIC = 1, + /** multi-scale variant of the classical Hough transform. The lines are encoded the same way as + HOUGH_STANDARD. */ + HOUGH_MULTI_SCALE = 2, + HOUGH_GRADIENT = 3 //!< basically *21HT*, described in @cite Yuen90 +}; + +//! Variants of Line Segment %Detector +//! @ingroup imgproc_feature +enum LineSegmentDetectorModes { + LSD_REFINE_NONE = 0, //!< No refinement applied + LSD_REFINE_STD = 1, //!< Standard refinement is applied. E.g. breaking arches into smaller straighter line approximations. + LSD_REFINE_ADV = 2 //!< Advanced refinement. Number of false alarms is calculated, lines are + //!< refined through increase of precision, decrement in size, etc. +}; + +/** Histogram comparison methods + @ingroup imgproc_hist +*/ +enum HistCompMethods { + /** Correlation + \f[d(H_1,H_2) = \frac{\sum_I (H_1(I) - \bar{H_1}) (H_2(I) - \bar{H_2})}{\sqrt{\sum_I(H_1(I) - \bar{H_1})^2 \sum_I(H_2(I) - \bar{H_2})^2}}\f] + where + \f[\bar{H_k} = \frac{1}{N} \sum _J H_k(J)\f] + and \f$N\f$ is a total number of histogram bins. */ + HISTCMP_CORREL = 0, + /** Chi-Square + \f[d(H_1,H_2) = \sum _I \frac{\left(H_1(I)-H_2(I)\right)^2}{H_1(I)}\f] */ + HISTCMP_CHISQR = 1, + /** Intersection + \f[d(H_1,H_2) = \sum _I \min (H_1(I), H_2(I))\f] */ + HISTCMP_INTERSECT = 2, + /** Bhattacharyya distance + (In fact, OpenCV computes Hellinger distance, which is related to Bhattacharyya coefficient.) + \f[d(H_1,H_2) = \sqrt{1 - \frac{1}{\sqrt{\bar{H_1} \bar{H_2} N^2}} \sum_I \sqrt{H_1(I) \cdot H_2(I)}}\f] */ + HISTCMP_BHATTACHARYYA = 3, + HISTCMP_HELLINGER = HISTCMP_BHATTACHARYYA, //!< Synonym for HISTCMP_BHATTACHARYYA + /** Alternative Chi-Square + \f[d(H_1,H_2) = 2 * \sum _I \frac{\left(H_1(I)-H_2(I)\right)^2}{H_1(I)+H_2(I)}\f] + This alternative formula is regularly used for texture comparison. See e.g. @cite Puzicha1997 */ + HISTCMP_CHISQR_ALT = 4, + /** Kullback-Leibler divergence + \f[d(H_1,H_2) = \sum _I H_1(I) \log \left(\frac{H_1(I)}{H_2(I)}\right)\f] */ + HISTCMP_KL_DIV = 5 +}; + +/** the color conversion code +@see @ref imgproc_color_conversions +@ingroup imgproc_misc + */ +enum ColorConversionCodes { + COLOR_BGR2BGRA = 0, //!< add alpha channel to RGB or BGR image + COLOR_RGB2RGBA = COLOR_BGR2BGRA, + + COLOR_BGRA2BGR = 1, //!< remove alpha channel from RGB or BGR image + COLOR_RGBA2RGB = COLOR_BGRA2BGR, + + COLOR_BGR2RGBA = 2, //!< convert between RGB and BGR color spaces (with or without alpha channel) + COLOR_RGB2BGRA = COLOR_BGR2RGBA, + + COLOR_RGBA2BGR = 3, + COLOR_BGRA2RGB = COLOR_RGBA2BGR, + + COLOR_BGR2RGB = 4, + COLOR_RGB2BGR = COLOR_BGR2RGB, + + COLOR_BGRA2RGBA = 5, + COLOR_RGBA2BGRA = COLOR_BGRA2RGBA, + + COLOR_BGR2GRAY = 6, //!< convert between RGB/BGR and grayscale, @ref color_convert_rgb_gray "color conversions" + COLOR_RGB2GRAY = 7, + COLOR_GRAY2BGR = 8, + COLOR_GRAY2RGB = COLOR_GRAY2BGR, + COLOR_GRAY2BGRA = 9, + COLOR_GRAY2RGBA = COLOR_GRAY2BGRA, + COLOR_BGRA2GRAY = 10, + COLOR_RGBA2GRAY = 11, + + COLOR_BGR2BGR565 = 12, //!< convert between RGB/BGR and BGR565 (16-bit images) + COLOR_RGB2BGR565 = 13, + COLOR_BGR5652BGR = 14, + COLOR_BGR5652RGB = 15, + COLOR_BGRA2BGR565 = 16, + COLOR_RGBA2BGR565 = 17, + COLOR_BGR5652BGRA = 18, + COLOR_BGR5652RGBA = 19, + + COLOR_GRAY2BGR565 = 20, //!< convert between grayscale to BGR565 (16-bit images) + COLOR_BGR5652GRAY = 21, + + COLOR_BGR2BGR555 = 22, //!< convert between RGB/BGR and BGR555 (16-bit images) + COLOR_RGB2BGR555 = 23, + COLOR_BGR5552BGR = 24, + COLOR_BGR5552RGB = 25, + COLOR_BGRA2BGR555 = 26, + COLOR_RGBA2BGR555 = 27, + COLOR_BGR5552BGRA = 28, + COLOR_BGR5552RGBA = 29, + + COLOR_GRAY2BGR555 = 30, //!< convert between grayscale and BGR555 (16-bit images) + COLOR_BGR5552GRAY = 31, + + COLOR_BGR2XYZ = 32, //!< convert RGB/BGR to CIE XYZ, @ref color_convert_rgb_xyz "color conversions" + COLOR_RGB2XYZ = 33, + COLOR_XYZ2BGR = 34, + COLOR_XYZ2RGB = 35, + + COLOR_BGR2YCrCb = 36, //!< convert RGB/BGR to luma-chroma (aka YCC), @ref color_convert_rgb_ycrcb "color conversions" + COLOR_RGB2YCrCb = 37, + COLOR_YCrCb2BGR = 38, + COLOR_YCrCb2RGB = 39, + + COLOR_BGR2HSV = 40, //!< convert RGB/BGR to HSV (hue saturation value), @ref color_convert_rgb_hsv "color conversions" + COLOR_RGB2HSV = 41, + + COLOR_BGR2Lab = 44, //!< convert RGB/BGR to CIE Lab, @ref color_convert_rgb_lab "color conversions" + COLOR_RGB2Lab = 45, + + COLOR_BGR2Luv = 50, //!< convert RGB/BGR to CIE Luv, @ref color_convert_rgb_luv "color conversions" + COLOR_RGB2Luv = 51, + COLOR_BGR2HLS = 52, //!< convert RGB/BGR to HLS (hue lightness saturation), @ref color_convert_rgb_hls "color conversions" + COLOR_RGB2HLS = 53, + + COLOR_HSV2BGR = 54, //!< backward conversions to RGB/BGR + COLOR_HSV2RGB = 55, + + COLOR_Lab2BGR = 56, + COLOR_Lab2RGB = 57, + COLOR_Luv2BGR = 58, + COLOR_Luv2RGB = 59, + COLOR_HLS2BGR = 60, + COLOR_HLS2RGB = 61, + + COLOR_BGR2HSV_FULL = 66, //!< + COLOR_RGB2HSV_FULL = 67, + COLOR_BGR2HLS_FULL = 68, + COLOR_RGB2HLS_FULL = 69, + + COLOR_HSV2BGR_FULL = 70, + COLOR_HSV2RGB_FULL = 71, + COLOR_HLS2BGR_FULL = 72, + COLOR_HLS2RGB_FULL = 73, + + COLOR_LBGR2Lab = 74, + COLOR_LRGB2Lab = 75, + COLOR_LBGR2Luv = 76, + COLOR_LRGB2Luv = 77, + + COLOR_Lab2LBGR = 78, + COLOR_Lab2LRGB = 79, + COLOR_Luv2LBGR = 80, + COLOR_Luv2LRGB = 81, + + COLOR_BGR2YUV = 82, //!< convert between RGB/BGR and YUV + COLOR_RGB2YUV = 83, + COLOR_YUV2BGR = 84, + COLOR_YUV2RGB = 85, + + //! YUV 4:2:0 family to RGB + COLOR_YUV2RGB_NV12 = 90, + COLOR_YUV2BGR_NV12 = 91, + COLOR_YUV2RGB_NV21 = 92, + COLOR_YUV2BGR_NV21 = 93, + COLOR_YUV420sp2RGB = COLOR_YUV2RGB_NV21, + COLOR_YUV420sp2BGR = COLOR_YUV2BGR_NV21, + + COLOR_YUV2RGBA_NV12 = 94, + COLOR_YUV2BGRA_NV12 = 95, + COLOR_YUV2RGBA_NV21 = 96, + COLOR_YUV2BGRA_NV21 = 97, + COLOR_YUV420sp2RGBA = COLOR_YUV2RGBA_NV21, + COLOR_YUV420sp2BGRA = COLOR_YUV2BGRA_NV21, + + COLOR_YUV2RGB_YV12 = 98, + COLOR_YUV2BGR_YV12 = 99, + COLOR_YUV2RGB_IYUV = 100, + COLOR_YUV2BGR_IYUV = 101, + COLOR_YUV2RGB_I420 = COLOR_YUV2RGB_IYUV, + COLOR_YUV2BGR_I420 = COLOR_YUV2BGR_IYUV, + COLOR_YUV420p2RGB = COLOR_YUV2RGB_YV12, + COLOR_YUV420p2BGR = COLOR_YUV2BGR_YV12, + + COLOR_YUV2RGBA_YV12 = 102, + COLOR_YUV2BGRA_YV12 = 103, + COLOR_YUV2RGBA_IYUV = 104, + COLOR_YUV2BGRA_IYUV = 105, + COLOR_YUV2RGBA_I420 = COLOR_YUV2RGBA_IYUV, + COLOR_YUV2BGRA_I420 = COLOR_YUV2BGRA_IYUV, + COLOR_YUV420p2RGBA = COLOR_YUV2RGBA_YV12, + COLOR_YUV420p2BGRA = COLOR_YUV2BGRA_YV12, + + COLOR_YUV2GRAY_420 = 106, + COLOR_YUV2GRAY_NV21 = COLOR_YUV2GRAY_420, + COLOR_YUV2GRAY_NV12 = COLOR_YUV2GRAY_420, + COLOR_YUV2GRAY_YV12 = COLOR_YUV2GRAY_420, + COLOR_YUV2GRAY_IYUV = COLOR_YUV2GRAY_420, + COLOR_YUV2GRAY_I420 = COLOR_YUV2GRAY_420, + COLOR_YUV420sp2GRAY = COLOR_YUV2GRAY_420, + COLOR_YUV420p2GRAY = COLOR_YUV2GRAY_420, + + //! YUV 4:2:2 family to RGB + COLOR_YUV2RGB_UYVY = 107, + COLOR_YUV2BGR_UYVY = 108, + //COLOR_YUV2RGB_VYUY = 109, + //COLOR_YUV2BGR_VYUY = 110, + COLOR_YUV2RGB_Y422 = COLOR_YUV2RGB_UYVY, + COLOR_YUV2BGR_Y422 = COLOR_YUV2BGR_UYVY, + COLOR_YUV2RGB_UYNV = COLOR_YUV2RGB_UYVY, + COLOR_YUV2BGR_UYNV = COLOR_YUV2BGR_UYVY, + + COLOR_YUV2RGBA_UYVY = 111, + COLOR_YUV2BGRA_UYVY = 112, + //COLOR_YUV2RGBA_VYUY = 113, + //COLOR_YUV2BGRA_VYUY = 114, + COLOR_YUV2RGBA_Y422 = COLOR_YUV2RGBA_UYVY, + COLOR_YUV2BGRA_Y422 = COLOR_YUV2BGRA_UYVY, + COLOR_YUV2RGBA_UYNV = COLOR_YUV2RGBA_UYVY, + COLOR_YUV2BGRA_UYNV = COLOR_YUV2BGRA_UYVY, + + COLOR_YUV2RGB_YUY2 = 115, + COLOR_YUV2BGR_YUY2 = 116, + COLOR_YUV2RGB_YVYU = 117, + COLOR_YUV2BGR_YVYU = 118, + COLOR_YUV2RGB_YUYV = COLOR_YUV2RGB_YUY2, + COLOR_YUV2BGR_YUYV = COLOR_YUV2BGR_YUY2, + COLOR_YUV2RGB_YUNV = COLOR_YUV2RGB_YUY2, + COLOR_YUV2BGR_YUNV = COLOR_YUV2BGR_YUY2, + + COLOR_YUV2RGBA_YUY2 = 119, + COLOR_YUV2BGRA_YUY2 = 120, + COLOR_YUV2RGBA_YVYU = 121, + COLOR_YUV2BGRA_YVYU = 122, + COLOR_YUV2RGBA_YUYV = COLOR_YUV2RGBA_YUY2, + COLOR_YUV2BGRA_YUYV = COLOR_YUV2BGRA_YUY2, + COLOR_YUV2RGBA_YUNV = COLOR_YUV2RGBA_YUY2, + COLOR_YUV2BGRA_YUNV = COLOR_YUV2BGRA_YUY2, + + COLOR_YUV2GRAY_UYVY = 123, + COLOR_YUV2GRAY_YUY2 = 124, + //CV_YUV2GRAY_VYUY = CV_YUV2GRAY_UYVY, + COLOR_YUV2GRAY_Y422 = COLOR_YUV2GRAY_UYVY, + COLOR_YUV2GRAY_UYNV = COLOR_YUV2GRAY_UYVY, + COLOR_YUV2GRAY_YVYU = COLOR_YUV2GRAY_YUY2, + COLOR_YUV2GRAY_YUYV = COLOR_YUV2GRAY_YUY2, + COLOR_YUV2GRAY_YUNV = COLOR_YUV2GRAY_YUY2, + + //! alpha premultiplication + COLOR_RGBA2mRGBA = 125, + COLOR_mRGBA2RGBA = 126, + + //! RGB to YUV 4:2:0 family + COLOR_RGB2YUV_I420 = 127, + COLOR_BGR2YUV_I420 = 128, + COLOR_RGB2YUV_IYUV = COLOR_RGB2YUV_I420, + COLOR_BGR2YUV_IYUV = COLOR_BGR2YUV_I420, + + COLOR_RGBA2YUV_I420 = 129, + COLOR_BGRA2YUV_I420 = 130, + COLOR_RGBA2YUV_IYUV = COLOR_RGBA2YUV_I420, + COLOR_BGRA2YUV_IYUV = COLOR_BGRA2YUV_I420, + COLOR_RGB2YUV_YV12 = 131, + COLOR_BGR2YUV_YV12 = 132, + COLOR_RGBA2YUV_YV12 = 133, + COLOR_BGRA2YUV_YV12 = 134, + + //! Demosaicing + COLOR_BayerBG2BGR = 46, + COLOR_BayerGB2BGR = 47, + COLOR_BayerRG2BGR = 48, + COLOR_BayerGR2BGR = 49, + + COLOR_BayerBG2RGB = COLOR_BayerRG2BGR, + COLOR_BayerGB2RGB = COLOR_BayerGR2BGR, + COLOR_BayerRG2RGB = COLOR_BayerBG2BGR, + COLOR_BayerGR2RGB = COLOR_BayerGB2BGR, + + COLOR_BayerBG2GRAY = 86, + COLOR_BayerGB2GRAY = 87, + COLOR_BayerRG2GRAY = 88, + COLOR_BayerGR2GRAY = 89, + + //! Demosaicing using Variable Number of Gradients + COLOR_BayerBG2BGR_VNG = 62, + COLOR_BayerGB2BGR_VNG = 63, + COLOR_BayerRG2BGR_VNG = 64, + COLOR_BayerGR2BGR_VNG = 65, + + COLOR_BayerBG2RGB_VNG = COLOR_BayerRG2BGR_VNG, + COLOR_BayerGB2RGB_VNG = COLOR_BayerGR2BGR_VNG, + COLOR_BayerRG2RGB_VNG = COLOR_BayerBG2BGR_VNG, + COLOR_BayerGR2RGB_VNG = COLOR_BayerGB2BGR_VNG, + + //! Edge-Aware Demosaicing + COLOR_BayerBG2BGR_EA = 135, + COLOR_BayerGB2BGR_EA = 136, + COLOR_BayerRG2BGR_EA = 137, + COLOR_BayerGR2BGR_EA = 138, + + COLOR_BayerBG2RGB_EA = COLOR_BayerRG2BGR_EA, + COLOR_BayerGB2RGB_EA = COLOR_BayerGR2BGR_EA, + COLOR_BayerRG2RGB_EA = COLOR_BayerBG2BGR_EA, + COLOR_BayerGR2RGB_EA = COLOR_BayerGB2BGR_EA, + + + COLOR_COLORCVT_MAX = 139 +}; + +/** types of intersection between rectangles +@ingroup imgproc_shape +*/ +enum RectanglesIntersectTypes { + INTERSECT_NONE = 0, //!< No intersection + INTERSECT_PARTIAL = 1, //!< There is a partial intersection + INTERSECT_FULL = 2 //!< One of the rectangle is fully enclosed in the other +}; + +//! finds arbitrary template in the grayscale image using Generalized Hough Transform +class CV_EXPORTS GeneralizedHough : public Algorithm +{ +public: + //! set template to search + virtual void setTemplate(InputArray templ, Point templCenter = Point(-1, -1)) = 0; + virtual void setTemplate(InputArray edges, InputArray dx, InputArray dy, Point templCenter = Point(-1, -1)) = 0; + + //! find template on image + virtual void detect(InputArray image, OutputArray positions, OutputArray votes = noArray()) = 0; + virtual void detect(InputArray edges, InputArray dx, InputArray dy, OutputArray positions, OutputArray votes = noArray()) = 0; + + //! Canny low threshold. + virtual void setCannyLowThresh(int cannyLowThresh) = 0; + virtual int getCannyLowThresh() const = 0; + + //! Canny high threshold. + virtual void setCannyHighThresh(int cannyHighThresh) = 0; + virtual int getCannyHighThresh() const = 0; + + //! Minimum distance between the centers of the detected objects. + virtual void setMinDist(double minDist) = 0; + virtual double getMinDist() const = 0; + + //! Inverse ratio of the accumulator resolution to the image resolution. + virtual void setDp(double dp) = 0; + virtual double getDp() const = 0; + + //! Maximal size of inner buffers. + virtual void setMaxBufferSize(int maxBufferSize) = 0; + virtual int getMaxBufferSize() const = 0; +}; + +//! Ballard, D.H. (1981). Generalizing the Hough transform to detect arbitrary shapes. Pattern Recognition 13 (2): 111-122. +//! Detects position only without traslation and rotation +class CV_EXPORTS GeneralizedHoughBallard : public GeneralizedHough +{ +public: + //! R-Table levels. + virtual void setLevels(int levels) = 0; + virtual int getLevels() const = 0; + + //! The accumulator threshold for the template centers at the detection stage. The smaller it is, the more false positions may be detected. + virtual void setVotesThreshold(int votesThreshold) = 0; + virtual int getVotesThreshold() const = 0; +}; + +//! Guil, N., González-Linares, J.M. and Zapata, E.L. (1999). Bidimensional shape detection using an invariant approach. Pattern Recognition 32 (6): 1025-1038. +//! Detects position, traslation and rotation +class CV_EXPORTS GeneralizedHoughGuil : public GeneralizedHough +{ +public: + //! Angle difference in degrees between two points in feature. + virtual void setXi(double xi) = 0; + virtual double getXi() const = 0; + + //! Feature table levels. + virtual void setLevels(int levels) = 0; + virtual int getLevels() const = 0; + + //! Maximal difference between angles that treated as equal. + virtual void setAngleEpsilon(double angleEpsilon) = 0; + virtual double getAngleEpsilon() const = 0; + + //! Minimal rotation angle to detect in degrees. + virtual void setMinAngle(double minAngle) = 0; + virtual double getMinAngle() const = 0; + + //! Maximal rotation angle to detect in degrees. + virtual void setMaxAngle(double maxAngle) = 0; + virtual double getMaxAngle() const = 0; + + //! Angle step in degrees. + virtual void setAngleStep(double angleStep) = 0; + virtual double getAngleStep() const = 0; + + //! Angle votes threshold. + virtual void setAngleThresh(int angleThresh) = 0; + virtual int getAngleThresh() const = 0; + + //! Minimal scale to detect. + virtual void setMinScale(double minScale) = 0; + virtual double getMinScale() const = 0; + + //! Maximal scale to detect. + virtual void setMaxScale(double maxScale) = 0; + virtual double getMaxScale() const = 0; + + //! Scale step. + virtual void setScaleStep(double scaleStep) = 0; + virtual double getScaleStep() const = 0; + + //! Scale votes threshold. + virtual void setScaleThresh(int scaleThresh) = 0; + virtual int getScaleThresh() const = 0; + + //! Position votes threshold. + virtual void setPosThresh(int posThresh) = 0; + virtual int getPosThresh() const = 0; +}; + + +class CV_EXPORTS_W CLAHE : public Algorithm +{ +public: + CV_WRAP virtual void apply(InputArray src, OutputArray dst) = 0; + + CV_WRAP virtual void setClipLimit(double clipLimit) = 0; + CV_WRAP virtual double getClipLimit() const = 0; + + CV_WRAP virtual void setTilesGridSize(Size tileGridSize) = 0; + CV_WRAP virtual Size getTilesGridSize() const = 0; + + CV_WRAP virtual void collectGarbage() = 0; +}; + + +class CV_EXPORTS_W Subdiv2D +{ +public: + enum { PTLOC_ERROR = -2, + PTLOC_OUTSIDE_RECT = -1, + PTLOC_INSIDE = 0, + PTLOC_VERTEX = 1, + PTLOC_ON_EDGE = 2 + }; + + enum { NEXT_AROUND_ORG = 0x00, + NEXT_AROUND_DST = 0x22, + PREV_AROUND_ORG = 0x11, + PREV_AROUND_DST = 0x33, + NEXT_AROUND_LEFT = 0x13, + NEXT_AROUND_RIGHT = 0x31, + PREV_AROUND_LEFT = 0x20, + PREV_AROUND_RIGHT = 0x02 + }; + + CV_WRAP Subdiv2D(); + CV_WRAP Subdiv2D(Rect rect); + CV_WRAP void initDelaunay(Rect rect); + + CV_WRAP int insert(Point2f pt); + CV_WRAP void insert(const std::vector& ptvec); + CV_WRAP int locate(Point2f pt, CV_OUT int& edge, CV_OUT int& vertex); + + CV_WRAP int findNearest(Point2f pt, CV_OUT Point2f* nearestPt = 0); + CV_WRAP void getEdgeList(CV_OUT std::vector& edgeList) const; + CV_WRAP void getTriangleList(CV_OUT std::vector& triangleList) const; + CV_WRAP void getVoronoiFacetList(const std::vector& idx, CV_OUT std::vector >& facetList, + CV_OUT std::vector& facetCenters); + + CV_WRAP Point2f getVertex(int vertex, CV_OUT int* firstEdge = 0) const; + + CV_WRAP int getEdge( int edge, int nextEdgeType ) const; + CV_WRAP int nextEdge(int edge) const; + CV_WRAP int rotateEdge(int edge, int rotate) const; + CV_WRAP int symEdge(int edge) const; + CV_WRAP int edgeOrg(int edge, CV_OUT Point2f* orgpt = 0) const; + CV_WRAP int edgeDst(int edge, CV_OUT Point2f* dstpt = 0) const; + +protected: + int newEdge(); + void deleteEdge(int edge); + int newPoint(Point2f pt, bool isvirtual, int firstEdge = 0); + void deletePoint(int vtx); + void setEdgePoints( int edge, int orgPt, int dstPt ); + void splice( int edgeA, int edgeB ); + int connectEdges( int edgeA, int edgeB ); + void swapEdges( int edge ); + int isRightOf(Point2f pt, int edge) const; + void calcVoronoi(); + void clearVoronoi(); + void checkSubdiv() const; + + struct CV_EXPORTS Vertex + { + Vertex(); + Vertex(Point2f pt, bool _isvirtual, int _firstEdge=0); + bool isvirtual() const; + bool isfree() const; + + int firstEdge; + int type; + Point2f pt; + }; + + struct CV_EXPORTS QuadEdge + { + QuadEdge(); + QuadEdge(int edgeidx); + bool isfree() const; + + int next[4]; + int pt[4]; + }; + + std::vector vtx; + std::vector qedges; + int freeQEdge; + int freePoint; + bool validGeometry; + + int recentEdge; + Point2f topLeft; + Point2f bottomRight; +}; + +//! @addtogroup imgproc_feature +//! @{ + +/** @example lsd_lines.cpp +An example using the LineSegmentDetector +*/ + +/** @brief Line segment detector class + +following the algorithm described at @cite Rafael12 . +*/ +class CV_EXPORTS_W LineSegmentDetector : public Algorithm +{ +public: + + /** @brief Finds lines in the input image. + + This is the output of the default parameters of the algorithm on the above shown image. + + ![image](pics/building_lsd.png) + + @param _image A grayscale (CV_8UC1) input image. If only a roi needs to be selected, use: + `lsd_ptr-\>detect(image(roi), lines, ...); lines += Scalar(roi.x, roi.y, roi.x, roi.y);` + @param _lines A vector of Vec4i or Vec4f elements specifying the beginning and ending point of a line. Where + Vec4i/Vec4f is (x1, y1, x2, y2), point 1 is the start, point 2 - end. Returned lines are strictly + oriented depending on the gradient. + @param width Vector of widths of the regions, where the lines are found. E.g. Width of line. + @param prec Vector of precisions with which the lines are found. + @param nfa Vector containing number of false alarms in the line region, with precision of 10%. The + bigger the value, logarithmically better the detection. + - -1 corresponds to 10 mean false alarms + - 0 corresponds to 1 mean false alarm + - 1 corresponds to 0.1 mean false alarms + This vector will be calculated only when the objects type is LSD_REFINE_ADV. + */ + CV_WRAP virtual void detect(InputArray _image, OutputArray _lines, + OutputArray width = noArray(), OutputArray prec = noArray(), + OutputArray nfa = noArray()) = 0; + + /** @brief Draws the line segments on a given image. + @param _image The image, where the liens will be drawn. Should be bigger or equal to the image, + where the lines were found. + @param lines A vector of the lines that needed to be drawn. + */ + CV_WRAP virtual void drawSegments(InputOutputArray _image, InputArray lines) = 0; + + /** @brief Draws two groups of lines in blue and red, counting the non overlapping (mismatching) pixels. + + @param size The size of the image, where lines1 and lines2 were found. + @param lines1 The first group of lines that needs to be drawn. It is visualized in blue color. + @param lines2 The second group of lines. They visualized in red color. + @param _image Optional image, where the lines will be drawn. The image should be color(3-channel) + in order for lines1 and lines2 to be drawn in the above mentioned colors. + */ + CV_WRAP virtual int compareSegments(const Size& size, InputArray lines1, InputArray lines2, InputOutputArray _image = noArray()) = 0; + + virtual ~LineSegmentDetector() { } +}; + +/** @brief Creates a smart pointer to a LineSegmentDetector object and initializes it. + +The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want +to edit those, as to tailor it for their own application. + +@param _refine The way found lines will be refined, see cv::LineSegmentDetectorModes +@param _scale The scale of the image that will be used to find the lines. Range (0..1]. +@param _sigma_scale Sigma for Gaussian filter. It is computed as sigma = _sigma_scale/_scale. +@param _quant Bound to the quantization error on the gradient norm. +@param _ang_th Gradient angle tolerance in degrees. +@param _log_eps Detection threshold: -log10(NFA) \> log_eps. Used only when advancent refinement +is chosen. +@param _density_th Minimal density of aligned region points in the enclosing rectangle. +@param _n_bins Number of bins in pseudo-ordering of gradient modulus. + */ +CV_EXPORTS_W Ptr createLineSegmentDetector( + int _refine = LSD_REFINE_STD, double _scale = 0.8, + double _sigma_scale = 0.6, double _quant = 2.0, double _ang_th = 22.5, + double _log_eps = 0, double _density_th = 0.7, int _n_bins = 1024); + +//! @} imgproc_feature + +//! @addtogroup imgproc_filter +//! @{ + +/** @brief Returns Gaussian filter coefficients. + +The function computes and returns the \f$\texttt{ksize} \times 1\f$ matrix of Gaussian filter +coefficients: + +\f[G_i= \alpha *e^{-(i-( \texttt{ksize} -1)/2)^2/(2* \texttt{sigma}^2)},\f] + +where \f$i=0..\texttt{ksize}-1\f$ and \f$\alpha\f$ is the scale factor chosen so that \f$\sum_i G_i=1\f$. + +Two of such generated kernels can be passed to sepFilter2D. Those functions automatically recognize +smoothing kernels (a symmetrical kernel with sum of weights equal to 1) and handle them accordingly. +You may also use the higher-level GaussianBlur. +@param ksize Aperture size. It should be odd ( \f$\texttt{ksize} \mod 2 = 1\f$ ) and positive. +@param sigma Gaussian standard deviation. If it is non-positive, it is computed from ksize as +`sigma = 0.3\*((ksize-1)\*0.5 - 1) + 0.8`. +@param ktype Type of filter coefficients. It can be CV_32F or CV_64F . +@sa sepFilter2D, getDerivKernels, getStructuringElement, GaussianBlur + */ +CV_EXPORTS_W Mat getGaussianKernel( int ksize, double sigma, int ktype = CV_64F ); + +/** @brief Returns filter coefficients for computing spatial image derivatives. + +The function computes and returns the filter coefficients for spatial image derivatives. When +`ksize=CV_SCHARR`, the Scharr \f$3 \times 3\f$ kernels are generated (see cv::Scharr). Otherwise, Sobel +kernels are generated (see cv::Sobel). The filters are normally passed to sepFilter2D or to + +@param kx Output matrix of row filter coefficients. It has the type ktype . +@param ky Output matrix of column filter coefficients. It has the type ktype . +@param dx Derivative order in respect of x. +@param dy Derivative order in respect of y. +@param ksize Aperture size. It can be CV_SCHARR, 1, 3, 5, or 7. +@param normalize Flag indicating whether to normalize (scale down) the filter coefficients or not. +Theoretically, the coefficients should have the denominator \f$=2^{ksize*2-dx-dy-2}\f$. If you are +going to filter floating-point images, you are likely to use the normalized kernels. But if you +compute derivatives of an 8-bit image, store the results in a 16-bit image, and wish to preserve +all the fractional bits, you may want to set normalize=false . +@param ktype Type of filter coefficients. It can be CV_32f or CV_64F . + */ +CV_EXPORTS_W void getDerivKernels( OutputArray kx, OutputArray ky, + int dx, int dy, int ksize, + bool normalize = false, int ktype = CV_32F ); + +/** @brief Returns Gabor filter coefficients. + +For more details about gabor filter equations and parameters, see: [Gabor +Filter](http://en.wikipedia.org/wiki/Gabor_filter). + +@param ksize Size of the filter returned. +@param sigma Standard deviation of the gaussian envelope. +@param theta Orientation of the normal to the parallel stripes of a Gabor function. +@param lambd Wavelength of the sinusoidal factor. +@param gamma Spatial aspect ratio. +@param psi Phase offset. +@param ktype Type of filter coefficients. It can be CV_32F or CV_64F . + */ +CV_EXPORTS_W Mat getGaborKernel( Size ksize, double sigma, double theta, double lambd, + double gamma, double psi = CV_PI*0.5, int ktype = CV_64F ); + +//! returns "magic" border value for erosion and dilation. It is automatically transformed to Scalar::all(-DBL_MAX) for dilation. +static inline Scalar morphologyDefaultBorderValue() { return Scalar::all(DBL_MAX); } + +/** @brief Returns a structuring element of the specified size and shape for morphological operations. + +The function constructs and returns the structuring element that can be further passed to cv::erode, +cv::dilate or cv::morphologyEx. But you can also construct an arbitrary binary mask yourself and use it as +the structuring element. + +@param shape Element shape that could be one of cv::MorphShapes +@param ksize Size of the structuring element. +@param anchor Anchor position within the element. The default value \f$(-1, -1)\f$ means that the +anchor is at the center. Note that only the shape of a cross-shaped element depends on the anchor +position. In other cases the anchor just regulates how much the result of the morphological +operation is shifted. + */ +CV_EXPORTS_W Mat getStructuringElement(int shape, Size ksize, Point anchor = Point(-1,-1)); + +/** @brief Blurs an image using the median filter. + +The function smoothes an image using the median filter with the \f$\texttt{ksize} \times +\texttt{ksize}\f$ aperture. Each channel of a multi-channel image is processed independently. +In-place operation is supported. + +@param src input 1-, 3-, or 4-channel image; when ksize is 3 or 5, the image depth should be +CV_8U, CV_16U, or CV_32F, for larger aperture sizes, it can only be CV_8U. +@param dst destination array of the same size and type as src. +@param ksize aperture linear size; it must be odd and greater than 1, for example: 3, 5, 7 ... +@sa bilateralFilter, blur, boxFilter, GaussianBlur + */ +CV_EXPORTS_W void medianBlur( InputArray src, OutputArray dst, int ksize ); + +/** @brief Blurs an image using a Gaussian filter. + +The function convolves the source image with the specified Gaussian kernel. In-place filtering is +supported. + +@param src input image; the image can have any number of channels, which are processed +independently, but the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F. +@param dst output image of the same size and type as src. +@param ksize Gaussian kernel size. ksize.width and ksize.height can differ but they both must be +positive and odd. Or, they can be zero's and then they are computed from sigma. +@param sigmaX Gaussian kernel standard deviation in X direction. +@param sigmaY Gaussian kernel standard deviation in Y direction; if sigmaY is zero, it is set to be +equal to sigmaX, if both sigmas are zeros, they are computed from ksize.width and ksize.height, +respectively (see cv::getGaussianKernel for details); to fully control the result regardless of +possible future modifications of all this semantics, it is recommended to specify all of ksize, +sigmaX, and sigmaY. +@param borderType pixel extrapolation method, see cv::BorderTypes + +@sa sepFilter2D, filter2D, blur, boxFilter, bilateralFilter, medianBlur + */ +CV_EXPORTS_W void GaussianBlur( InputArray src, OutputArray dst, Size ksize, + double sigmaX, double sigmaY = 0, + int borderType = BORDER_DEFAULT ); + +/** @brief Applies the bilateral filter to an image. + +The function applies bilateral filtering to the input image, as described in +http://www.dai.ed.ac.uk/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html +bilateralFilter can reduce unwanted noise very well while keeping edges fairly sharp. However, it is +very slow compared to most filters. + +_Sigma values_: For simplicity, you can set the 2 sigma values to be the same. If they are small (\< +10), the filter will not have much effect, whereas if they are large (\> 150), they will have a very +strong effect, making the image look "cartoonish". + +_Filter size_: Large filters (d \> 5) are very slow, so it is recommended to use d=5 for real-time +applications, and perhaps d=9 for offline applications that need heavy noise filtering. + +This filter does not work inplace. +@param src Source 8-bit or floating-point, 1-channel or 3-channel image. +@param dst Destination image of the same size and type as src . +@param d Diameter of each pixel neighborhood that is used during filtering. If it is non-positive, +it is computed from sigmaSpace. +@param sigmaColor Filter sigma in the color space. A larger value of the parameter means that +farther colors within the pixel neighborhood (see sigmaSpace) will be mixed together, resulting +in larger areas of semi-equal color. +@param sigmaSpace Filter sigma in the coordinate space. A larger value of the parameter means that +farther pixels will influence each other as long as their colors are close enough (see sigmaColor +). When d\>0, it specifies the neighborhood size regardless of sigmaSpace. Otherwise, d is +proportional to sigmaSpace. +@param borderType border mode used to extrapolate pixels outside of the image, see cv::BorderTypes + */ +CV_EXPORTS_W void bilateralFilter( InputArray src, OutputArray dst, int d, + double sigmaColor, double sigmaSpace, + int borderType = BORDER_DEFAULT ); + +/** @brief Blurs an image using the box filter. + +The function smoothes an image using the kernel: + +\f[\texttt{K} = \alpha \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \hdotsfor{6} \\ 1 & 1 & 1 & \cdots & 1 & 1 \end{bmatrix}\f] + +where + +\f[\alpha = \fork{\frac{1}{\texttt{ksize.width*ksize.height}}}{when \texttt{normalize=true}}{1}{otherwise}\f] + +Unnormalized box filter is useful for computing various integral characteristics over each pixel +neighborhood, such as covariance matrices of image derivatives (used in dense optical flow +algorithms, and so on). If you need to compute pixel sums over variable-size windows, use cv::integral. + +@param src input image. +@param dst output image of the same size and type as src. +@param ddepth the output image depth (-1 to use src.depth()). +@param ksize blurring kernel size. +@param anchor anchor point; default value Point(-1,-1) means that the anchor is at the kernel +center. +@param normalize flag, specifying whether the kernel is normalized by its area or not. +@param borderType border mode used to extrapolate pixels outside of the image, see cv::BorderTypes +@sa blur, bilateralFilter, GaussianBlur, medianBlur, integral + */ +CV_EXPORTS_W void boxFilter( InputArray src, OutputArray dst, int ddepth, + Size ksize, Point anchor = Point(-1,-1), + bool normalize = true, + int borderType = BORDER_DEFAULT ); + +/** @brief Calculates the normalized sum of squares of the pixel values overlapping the filter. + +For every pixel \f$ (x, y) \f$ in the source image, the function calculates the sum of squares of those neighboring +pixel values which overlap the filter placed over the pixel \f$ (x, y) \f$. + +The unnormalized square box filter can be useful in computing local image statistics such as the the local +variance and standard deviation around the neighborhood of a pixel. + +@param _src input image +@param _dst output image of the same size and type as _src +@param ddepth the output image depth (-1 to use src.depth()) +@param ksize kernel size +@param anchor kernel anchor point. The default value of Point(-1, -1) denotes that the anchor is at the kernel +center. +@param normalize flag, specifying whether the kernel is to be normalized by it's area or not. +@param borderType border mode used to extrapolate pixels outside of the image, see cv::BorderTypes +@sa boxFilter +*/ +CV_EXPORTS_W void sqrBoxFilter( InputArray _src, OutputArray _dst, int ddepth, + Size ksize, Point anchor = Point(-1, -1), + bool normalize = true, + int borderType = BORDER_DEFAULT ); + +/** @brief Blurs an image using the normalized box filter. + +The function smoothes an image using the kernel: + +\f[\texttt{K} = \frac{1}{\texttt{ksize.width*ksize.height}} \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \hdotsfor{6} \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \end{bmatrix}\f] + +The call `blur(src, dst, ksize, anchor, borderType)` is equivalent to `boxFilter(src, dst, src.type(), +anchor, true, borderType)`. + +@param src input image; it can have any number of channels, which are processed independently, but +the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F. +@param dst output image of the same size and type as src. +@param ksize blurring kernel size. +@param anchor anchor point; default value Point(-1,-1) means that the anchor is at the kernel +center. +@param borderType border mode used to extrapolate pixels outside of the image, see cv::BorderTypes +@sa boxFilter, bilateralFilter, GaussianBlur, medianBlur + */ +CV_EXPORTS_W void blur( InputArray src, OutputArray dst, + Size ksize, Point anchor = Point(-1,-1), + int borderType = BORDER_DEFAULT ); + +/** @brief Convolves an image with the kernel. + +The function applies an arbitrary linear filter to an image. In-place operation is supported. When +the aperture is partially outside the image, the function interpolates outlier pixel values +according to the specified border mode. + +The function does actually compute correlation, not the convolution: + +\f[\texttt{dst} (x,y) = \sum _{ \stackrel{0\leq x' < \texttt{kernel.cols},}{0\leq y' < \texttt{kernel.rows}} } \texttt{kernel} (x',y')* \texttt{src} (x+x'- \texttt{anchor.x} ,y+y'- \texttt{anchor.y} )\f] + +That is, the kernel is not mirrored around the anchor point. If you need a real convolution, flip +the kernel using cv::flip and set the new anchor to `(kernel.cols - anchor.x - 1, kernel.rows - +anchor.y - 1)`. + +The function uses the DFT-based algorithm in case of sufficiently large kernels (~`11 x 11` or +larger) and the direct algorithm for small kernels. + +@param src input image. +@param dst output image of the same size and the same number of channels as src. +@param ddepth desired depth of the destination image, see @ref filter_depths "combinations" +@param kernel convolution kernel (or rather a correlation kernel), a single-channel floating point +matrix; if you want to apply different kernels to different channels, split the image into +separate color planes using split and process them individually. +@param anchor anchor of the kernel that indicates the relative position of a filtered point within +the kernel; the anchor should lie within the kernel; default value (-1,-1) means that the anchor +is at the kernel center. +@param delta optional value added to the filtered pixels before storing them in dst. +@param borderType pixel extrapolation method, see cv::BorderTypes +@sa sepFilter2D, dft, matchTemplate + */ +CV_EXPORTS_W void filter2D( InputArray src, OutputArray dst, int ddepth, + InputArray kernel, Point anchor = Point(-1,-1), + double delta = 0, int borderType = BORDER_DEFAULT ); + +/** @brief Applies a separable linear filter to an image. + +The function applies a separable linear filter to the image. That is, first, every row of src is +filtered with the 1D kernel kernelX. Then, every column of the result is filtered with the 1D +kernel kernelY. The final result shifted by delta is stored in dst . + +@param src Source image. +@param dst Destination image of the same size and the same number of channels as src . +@param ddepth Destination image depth, see @ref filter_depths "combinations" +@param kernelX Coefficients for filtering each row. +@param kernelY Coefficients for filtering each column. +@param anchor Anchor position within the kernel. The default value \f$(-1,-1)\f$ means that the anchor +is at the kernel center. +@param delta Value added to the filtered results before storing them. +@param borderType Pixel extrapolation method, see cv::BorderTypes +@sa filter2D, Sobel, GaussianBlur, boxFilter, blur + */ +CV_EXPORTS_W void sepFilter2D( InputArray src, OutputArray dst, int ddepth, + InputArray kernelX, InputArray kernelY, + Point anchor = Point(-1,-1), + double delta = 0, int borderType = BORDER_DEFAULT ); + +/** @brief Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator. + +In all cases except one, the \f$\texttt{ksize} \times \texttt{ksize}\f$ separable kernel is used to +calculate the derivative. When \f$\texttt{ksize = 1}\f$, the \f$3 \times 1\f$ or \f$1 \times 3\f$ +kernel is used (that is, no Gaussian smoothing is done). `ksize = 1` can only be used for the first +or the second x- or y- derivatives. + +There is also the special value `ksize = CV_SCHARR (-1)` that corresponds to the \f$3\times3\f$ Scharr +filter that may give more accurate results than the \f$3\times3\f$ Sobel. The Scharr aperture is + +\f[\vecthreethree{-3}{0}{3}{-10}{0}{10}{-3}{0}{3}\f] + +for the x-derivative, or transposed for the y-derivative. + +The function calculates an image derivative by convolving the image with the appropriate kernel: + +\f[\texttt{dst} = \frac{\partial^{xorder+yorder} \texttt{src}}{\partial x^{xorder} \partial y^{yorder}}\f] + +The Sobel operators combine Gaussian smoothing and differentiation, so the result is more or less +resistant to the noise. Most often, the function is called with ( xorder = 1, yorder = 0, ksize = 3) +or ( xorder = 0, yorder = 1, ksize = 3) to calculate the first x- or y- image derivative. The first +case corresponds to a kernel of: + +\f[\vecthreethree{-1}{0}{1}{-2}{0}{2}{-1}{0}{1}\f] + +The second case corresponds to a kernel of: + +\f[\vecthreethree{-1}{-2}{-1}{0}{0}{0}{1}{2}{1}\f] + +@param src input image. +@param dst output image of the same size and the same number of channels as src . +@param ddepth output image depth, see @ref filter_depths "combinations"; in the case of + 8-bit input images it will result in truncated derivatives. +@param dx order of the derivative x. +@param dy order of the derivative y. +@param ksize size of the extended Sobel kernel; it must be 1, 3, 5, or 7. +@param scale optional scale factor for the computed derivative values; by default, no scaling is +applied (see cv::getDerivKernels for details). +@param delta optional delta value that is added to the results prior to storing them in dst. +@param borderType pixel extrapolation method, see cv::BorderTypes +@sa Scharr, Laplacian, sepFilter2D, filter2D, GaussianBlur, cartToPolar + */ +CV_EXPORTS_W void Sobel( InputArray src, OutputArray dst, int ddepth, + int dx, int dy, int ksize = 3, + double scale = 1, double delta = 0, + int borderType = BORDER_DEFAULT ); + +/** @brief Calculates the first order image derivative in both x and y using a Sobel operator + +Equivalent to calling: + +@code +Sobel( src, dx, CV_16SC1, 1, 0, 3 ); +Sobel( src, dy, CV_16SC1, 0, 1, 3 ); +@endcode + +@param src input image. +@param dx output image with first-order derivative in x. +@param dy output image with first-order derivative in y. +@param ksize size of Sobel kernel. It must be 3. +@param borderType pixel extrapolation method, see cv::BorderTypes + +@sa Sobel + */ + +CV_EXPORTS_W void spatialGradient( InputArray src, OutputArray dx, + OutputArray dy, int ksize = 3, + int borderType = BORDER_DEFAULT ); + +/** @brief Calculates the first x- or y- image derivative using Scharr operator. + +The function computes the first x- or y- spatial image derivative using the Scharr operator. The +call + +\f[\texttt{Scharr(src, dst, ddepth, dx, dy, scale, delta, borderType)}\f] + +is equivalent to + +\f[\texttt{Sobel(src, dst, ddepth, dx, dy, CV\_SCHARR, scale, delta, borderType)} .\f] + +@param src input image. +@param dst output image of the same size and the same number of channels as src. +@param ddepth output image depth, see @ref filter_depths "combinations" +@param dx order of the derivative x. +@param dy order of the derivative y. +@param scale optional scale factor for the computed derivative values; by default, no scaling is +applied (see getDerivKernels for details). +@param delta optional delta value that is added to the results prior to storing them in dst. +@param borderType pixel extrapolation method, see cv::BorderTypes +@sa cartToPolar + */ +CV_EXPORTS_W void Scharr( InputArray src, OutputArray dst, int ddepth, + int dx, int dy, double scale = 1, double delta = 0, + int borderType = BORDER_DEFAULT ); + +/** @example laplace.cpp + An example using Laplace transformations for edge detection +*/ + +/** @brief Calculates the Laplacian of an image. + +The function calculates the Laplacian of the source image by adding up the second x and y +derivatives calculated using the Sobel operator: + +\f[\texttt{dst} = \Delta \texttt{src} = \frac{\partial^2 \texttt{src}}{\partial x^2} + \frac{\partial^2 \texttt{src}}{\partial y^2}\f] + +This is done when `ksize > 1`. When `ksize == 1`, the Laplacian is computed by filtering the image +with the following \f$3 \times 3\f$ aperture: + +\f[\vecthreethree {0}{1}{0}{1}{-4}{1}{0}{1}{0}\f] + +@param src Source image. +@param dst Destination image of the same size and the same number of channels as src . +@param ddepth Desired depth of the destination image. +@param ksize Aperture size used to compute the second-derivative filters. See getDerivKernels for +details. The size must be positive and odd. +@param scale Optional scale factor for the computed Laplacian values. By default, no scaling is +applied. See getDerivKernels for details. +@param delta Optional delta value that is added to the results prior to storing them in dst . +@param borderType Pixel extrapolation method, see cv::BorderTypes +@sa Sobel, Scharr + */ +CV_EXPORTS_W void Laplacian( InputArray src, OutputArray dst, int ddepth, + int ksize = 1, double scale = 1, double delta = 0, + int borderType = BORDER_DEFAULT ); + +//! @} imgproc_filter + +//! @addtogroup imgproc_feature +//! @{ + +/** @example edge.cpp + An example on using the canny edge detector +*/ + +/** @brief Finds edges in an image using the Canny algorithm @cite Canny86 . + +The function finds edges in the input image image and marks them in the output map edges using the +Canny algorithm. The smallest value between threshold1 and threshold2 is used for edge linking. The +largest value is used to find initial segments of strong edges. See + + +@param image 8-bit input image. +@param edges output edge map; single channels 8-bit image, which has the same size as image . +@param threshold1 first threshold for the hysteresis procedure. +@param threshold2 second threshold for the hysteresis procedure. +@param apertureSize aperture size for the Sobel operator. +@param L2gradient a flag, indicating whether a more accurate \f$L_2\f$ norm +\f$=\sqrt{(dI/dx)^2 + (dI/dy)^2}\f$ should be used to calculate the image gradient magnitude ( +L2gradient=true ), or whether the default \f$L_1\f$ norm \f$=|dI/dx|+|dI/dy|\f$ is enough ( +L2gradient=false ). + */ +CV_EXPORTS_W void Canny( InputArray image, OutputArray edges, + double threshold1, double threshold2, + int apertureSize = 3, bool L2gradient = false ); + +/** @brief Calculates the minimal eigenvalue of gradient matrices for corner detection. + +The function is similar to cornerEigenValsAndVecs but it calculates and stores only the minimal +eigenvalue of the covariance matrix of derivatives, that is, \f$\min(\lambda_1, \lambda_2)\f$ in terms +of the formulae in the cornerEigenValsAndVecs description. + +@param src Input single-channel 8-bit or floating-point image. +@param dst Image to store the minimal eigenvalues. It has the type CV_32FC1 and the same size as +src . +@param blockSize Neighborhood size (see the details on cornerEigenValsAndVecs ). +@param ksize Aperture parameter for the Sobel operator. +@param borderType Pixel extrapolation method. See cv::BorderTypes. + */ +CV_EXPORTS_W void cornerMinEigenVal( InputArray src, OutputArray dst, + int blockSize, int ksize = 3, + int borderType = BORDER_DEFAULT ); + +/** @brief Harris corner detector. + +The function runs the Harris corner detector on the image. Similarly to cornerMinEigenVal and +cornerEigenValsAndVecs , for each pixel \f$(x, y)\f$ it calculates a \f$2\times2\f$ gradient covariance +matrix \f$M^{(x,y)}\f$ over a \f$\texttt{blockSize} \times \texttt{blockSize}\f$ neighborhood. Then, it +computes the following characteristic: + +\f[\texttt{dst} (x,y) = \mathrm{det} M^{(x,y)} - k \cdot \left ( \mathrm{tr} M^{(x,y)} \right )^2\f] + +Corners in the image can be found as the local maxima of this response map. + +@param src Input single-channel 8-bit or floating-point image. +@param dst Image to store the Harris detector responses. It has the type CV_32FC1 and the same +size as src . +@param blockSize Neighborhood size (see the details on cornerEigenValsAndVecs ). +@param ksize Aperture parameter for the Sobel operator. +@param k Harris detector free parameter. See the formula below. +@param borderType Pixel extrapolation method. See cv::BorderTypes. + */ +CV_EXPORTS_W void cornerHarris( InputArray src, OutputArray dst, int blockSize, + int ksize, double k, + int borderType = BORDER_DEFAULT ); + +/** @brief Calculates eigenvalues and eigenvectors of image blocks for corner detection. + +For every pixel \f$p\f$ , the function cornerEigenValsAndVecs considers a blockSize \f$\times\f$ blockSize +neighborhood \f$S(p)\f$ . It calculates the covariation matrix of derivatives over the neighborhood as: + +\f[M = \begin{bmatrix} \sum _{S(p)}(dI/dx)^2 & \sum _{S(p)}dI/dx dI/dy \\ \sum _{S(p)}dI/dx dI/dy & \sum _{S(p)}(dI/dy)^2 \end{bmatrix}\f] + +where the derivatives are computed using the Sobel operator. + +After that, it finds eigenvectors and eigenvalues of \f$M\f$ and stores them in the destination image as +\f$(\lambda_1, \lambda_2, x_1, y_1, x_2, y_2)\f$ where + +- \f$\lambda_1, \lambda_2\f$ are the non-sorted eigenvalues of \f$M\f$ +- \f$x_1, y_1\f$ are the eigenvectors corresponding to \f$\lambda_1\f$ +- \f$x_2, y_2\f$ are the eigenvectors corresponding to \f$\lambda_2\f$ + +The output of the function can be used for robust edge or corner detection. + +@param src Input single-channel 8-bit or floating-point image. +@param dst Image to store the results. It has the same size as src and the type CV_32FC(6) . +@param blockSize Neighborhood size (see details below). +@param ksize Aperture parameter for the Sobel operator. +@param borderType Pixel extrapolation method. See cv::BorderTypes. + +@sa cornerMinEigenVal, cornerHarris, preCornerDetect + */ +CV_EXPORTS_W void cornerEigenValsAndVecs( InputArray src, OutputArray dst, + int blockSize, int ksize, + int borderType = BORDER_DEFAULT ); + +/** @brief Calculates a feature map for corner detection. + +The function calculates the complex spatial derivative-based function of the source image + +\f[\texttt{dst} = (D_x \texttt{src} )^2 \cdot D_{yy} \texttt{src} + (D_y \texttt{src} )^2 \cdot D_{xx} \texttt{src} - 2 D_x \texttt{src} \cdot D_y \texttt{src} \cdot D_{xy} \texttt{src}\f] + +where \f$D_x\f$,\f$D_y\f$ are the first image derivatives, \f$D_{xx}\f$,\f$D_{yy}\f$ are the second image +derivatives, and \f$D_{xy}\f$ is the mixed derivative. + +The corners can be found as local maximums of the functions, as shown below: +@code + Mat corners, dilated_corners; + preCornerDetect(image, corners, 3); + // dilation with 3x3 rectangular structuring element + dilate(corners, dilated_corners, Mat(), 1); + Mat corner_mask = corners == dilated_corners; +@endcode + +@param src Source single-channel 8-bit of floating-point image. +@param dst Output image that has the type CV_32F and the same size as src . +@param ksize %Aperture size of the Sobel . +@param borderType Pixel extrapolation method. See cv::BorderTypes. + */ +CV_EXPORTS_W void preCornerDetect( InputArray src, OutputArray dst, int ksize, + int borderType = BORDER_DEFAULT ); + +/** @brief Refines the corner locations. + +The function iterates to find the sub-pixel accurate location of corners or radial saddle points, as +shown on the figure below. + +![image](pics/cornersubpix.png) + +Sub-pixel accurate corner locator is based on the observation that every vector from the center \f$q\f$ +to a point \f$p\f$ located within a neighborhood of \f$q\f$ is orthogonal to the image gradient at \f$p\f$ +subject to image and measurement noise. Consider the expression: + +\f[\epsilon _i = {DI_{p_i}}^T \cdot (q - p_i)\f] + +where \f${DI_{p_i}}\f$ is an image gradient at one of the points \f$p_i\f$ in a neighborhood of \f$q\f$ . The +value of \f$q\f$ is to be found so that \f$\epsilon_i\f$ is minimized. A system of equations may be set up +with \f$\epsilon_i\f$ set to zero: + +\f[\sum _i(DI_{p_i} \cdot {DI_{p_i}}^T) - \sum _i(DI_{p_i} \cdot {DI_{p_i}}^T \cdot p_i)\f] + +where the gradients are summed within a neighborhood ("search window") of \f$q\f$ . Calling the first +gradient term \f$G\f$ and the second gradient term \f$b\f$ gives: + +\f[q = G^{-1} \cdot b\f] + +The algorithm sets the center of the neighborhood window at this new center \f$q\f$ and then iterates +until the center stays within a set threshold. + +@param image Input image. +@param corners Initial coordinates of the input corners and refined coordinates provided for +output. +@param winSize Half of the side length of the search window. For example, if winSize=Size(5,5) , +then a \f$5*2+1 \times 5*2+1 = 11 \times 11\f$ search window is used. +@param zeroZone Half of the size of the dead region in the middle of the search zone over which +the summation in the formula below is not done. It is used sometimes to avoid possible +singularities of the autocorrelation matrix. The value of (-1,-1) indicates that there is no such +a size. +@param criteria Criteria for termination of the iterative process of corner refinement. That is, +the process of corner position refinement stops either after criteria.maxCount iterations or when +the corner position moves by less than criteria.epsilon on some iteration. + */ +CV_EXPORTS_W void cornerSubPix( InputArray image, InputOutputArray corners, + Size winSize, Size zeroZone, + TermCriteria criteria ); + +/** @brief Determines strong corners on an image. + +The function finds the most prominent corners in the image or in the specified image region, as +described in @cite Shi94 + +- Function calculates the corner quality measure at every source image pixel using the + cornerMinEigenVal or cornerHarris . +- Function performs a non-maximum suppression (the local maximums in *3 x 3* neighborhood are + retained). +- The corners with the minimal eigenvalue less than + \f$\texttt{qualityLevel} \cdot \max_{x,y} qualityMeasureMap(x,y)\f$ are rejected. +- The remaining corners are sorted by the quality measure in the descending order. +- Function throws away each corner for which there is a stronger corner at a distance less than + maxDistance. + +The function can be used to initialize a point-based tracker of an object. + +@note If the function is called with different values A and B of the parameter qualityLevel , and +A \> B, the vector of returned corners with qualityLevel=A will be the prefix of the output vector +with qualityLevel=B . + +@param image Input 8-bit or floating-point 32-bit, single-channel image. +@param corners Output vector of detected corners. +@param maxCorners Maximum number of corners to return. If there are more corners than are found, +the strongest of them is returned. +@param qualityLevel Parameter characterizing the minimal accepted quality of image corners. The +parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue +(see cornerMinEigenVal ) or the Harris function response (see cornerHarris ). The corners with the +quality measure less than the product are rejected. For example, if the best corner has the +quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure +less than 15 are rejected. +@param minDistance Minimum possible Euclidean distance between the returned corners. +@param mask Optional region of interest. If the image is not empty (it needs to have the type +CV_8UC1 and the same size as image ), it specifies the region in which the corners are detected. +@param blockSize Size of an average block for computing a derivative covariation matrix over each +pixel neighborhood. See cornerEigenValsAndVecs . +@param useHarrisDetector Parameter indicating whether to use a Harris detector (see cornerHarris) +or cornerMinEigenVal. +@param k Free parameter of the Harris detector. + +@sa cornerMinEigenVal, cornerHarris, calcOpticalFlowPyrLK, estimateRigidTransform, + */ +CV_EXPORTS_W void goodFeaturesToTrack( InputArray image, OutputArray corners, + int maxCorners, double qualityLevel, double minDistance, + InputArray mask = noArray(), int blockSize = 3, + bool useHarrisDetector = false, double k = 0.04 ); + +/** @example houghlines.cpp +An example using the Hough line detector +*/ + +/** @brief Finds lines in a binary image using the standard Hough transform. + +The function implements the standard or standard multi-scale Hough transform algorithm for line +detection. See for a good explanation of Hough +transform. + +@param image 8-bit, single-channel binary source image. The image may be modified by the function. +@param lines Output vector of lines. Each line is represented by a two-element vector +\f$(\rho, \theta)\f$ . \f$\rho\f$ is the distance from the coordinate origin \f$(0,0)\f$ (top-left corner of +the image). \f$\theta\f$ is the line rotation angle in radians ( +\f$0 \sim \textrm{vertical line}, \pi/2 \sim \textrm{horizontal line}\f$ ). +@param rho Distance resolution of the accumulator in pixels. +@param theta Angle resolution of the accumulator in radians. +@param threshold Accumulator threshold parameter. Only those lines are returned that get enough +votes ( \f$>\texttt{threshold}\f$ ). +@param srn For the multi-scale Hough transform, it is a divisor for the distance resolution rho . +The coarse accumulator distance resolution is rho and the accurate accumulator resolution is +rho/srn . If both srn=0 and stn=0 , the classical Hough transform is used. Otherwise, both these +parameters should be positive. +@param stn For the multi-scale Hough transform, it is a divisor for the distance resolution theta. +@param min_theta For standard and multi-scale Hough transform, minimum angle to check for lines. +Must fall between 0 and max_theta. +@param max_theta For standard and multi-scale Hough transform, maximum angle to check for lines. +Must fall between min_theta and CV_PI. + */ +CV_EXPORTS_W void HoughLines( InputArray image, OutputArray lines, + double rho, double theta, int threshold, + double srn = 0, double stn = 0, + double min_theta = 0, double max_theta = CV_PI ); + +/** @brief Finds line segments in a binary image using the probabilistic Hough transform. + +The function implements the probabilistic Hough transform algorithm for line detection, described +in @cite Matas00 + +See the line detection example below: + +@code + #include + #include + + using namespace cv; + using namespace std; + + int main(int argc, char** argv) + { + Mat src, dst, color_dst; + if( argc != 2 || !(src=imread(argv[1], 0)).data) + return -1; + + Canny( src, dst, 50, 200, 3 ); + cvtColor( dst, color_dst, COLOR_GRAY2BGR ); + + #if 0 + vector lines; + HoughLines( dst, lines, 1, CV_PI/180, 100 ); + + for( size_t i = 0; i < lines.size(); i++ ) + { + float rho = lines[i][0]; + float theta = lines[i][1]; + double a = cos(theta), b = sin(theta); + double x0 = a*rho, y0 = b*rho; + Point pt1(cvRound(x0 + 1000*(-b)), + cvRound(y0 + 1000*(a))); + Point pt2(cvRound(x0 - 1000*(-b)), + cvRound(y0 - 1000*(a))); + line( color_dst, pt1, pt2, Scalar(0,0,255), 3, 8 ); + } + #else + vector lines; + HoughLinesP( dst, lines, 1, CV_PI/180, 80, 30, 10 ); + for( size_t i = 0; i < lines.size(); i++ ) + { + line( color_dst, Point(lines[i][0], lines[i][1]), + Point(lines[i][2], lines[i][3]), Scalar(0,0,255), 3, 8 ); + } + #endif + namedWindow( "Source", 1 ); + imshow( "Source", src ); + + namedWindow( "Detected Lines", 1 ); + imshow( "Detected Lines", color_dst ); + + waitKey(0); + return 0; + } +@endcode +This is a sample picture the function parameters have been tuned for: + +![image](pics/building.jpg) + +And this is the output of the above program in case of the probabilistic Hough transform: + +![image](pics/houghp.png) + +@param image 8-bit, single-channel binary source image. The image may be modified by the function. +@param lines Output vector of lines. Each line is represented by a 4-element vector +\f$(x_1, y_1, x_2, y_2)\f$ , where \f$(x_1,y_1)\f$ and \f$(x_2, y_2)\f$ are the ending points of each detected +line segment. +@param rho Distance resolution of the accumulator in pixels. +@param theta Angle resolution of the accumulator in radians. +@param threshold Accumulator threshold parameter. Only those lines are returned that get enough +votes ( \f$>\texttt{threshold}\f$ ). +@param minLineLength Minimum line length. Line segments shorter than that are rejected. +@param maxLineGap Maximum allowed gap between points on the same line to link them. + +@sa LineSegmentDetector + */ +CV_EXPORTS_W void HoughLinesP( InputArray image, OutputArray lines, + double rho, double theta, int threshold, + double minLineLength = 0, double maxLineGap = 0 ); + +/** @example houghcircles.cpp +An example using the Hough circle detector +*/ + +/** @brief Finds circles in a grayscale image using the Hough transform. + +The function finds circles in a grayscale image using a modification of the Hough transform. + +Example: : +@code + #include + #include + #include + + using namespace cv; + using namespace std; + + int main(int argc, char** argv) + { + Mat img, gray; + if( argc != 2 || !(img=imread(argv[1], 1)).data) + return -1; + cvtColor(img, gray, COLOR_BGR2GRAY); + // smooth it, otherwise a lot of false circles may be detected + GaussianBlur( gray, gray, Size(9, 9), 2, 2 ); + vector circles; + HoughCircles(gray, circles, HOUGH_GRADIENT, + 2, gray.rows/4, 200, 100 ); + for( size_t i = 0; i < circles.size(); i++ ) + { + Point center(cvRound(circles[i][0]), cvRound(circles[i][1])); + int radius = cvRound(circles[i][2]); + // draw the circle center + circle( img, center, 3, Scalar(0,255,0), -1, 8, 0 ); + // draw the circle outline + circle( img, center, radius, Scalar(0,0,255), 3, 8, 0 ); + } + namedWindow( "circles", 1 ); + imshow( "circles", img ); + + waitKey(0); + return 0; + } +@endcode + +@note Usually the function detects the centers of circles well. However, it may fail to find correct +radii. You can assist to the function by specifying the radius range ( minRadius and maxRadius ) if +you know it. Or, you may ignore the returned radius, use only the center, and find the correct +radius using an additional procedure. + +@param image 8-bit, single-channel, grayscale input image. +@param circles Output vector of found circles. Each vector is encoded as a 3-element +floating-point vector \f$(x, y, radius)\f$ . +@param method Detection method, see cv::HoughModes. Currently, the only implemented method is HOUGH_GRADIENT +@param dp Inverse ratio of the accumulator resolution to the image resolution. For example, if +dp=1 , the accumulator has the same resolution as the input image. If dp=2 , the accumulator has +half as big width and height. +@param minDist Minimum distance between the centers of the detected circles. If the parameter is +too small, multiple neighbor circles may be falsely detected in addition to a true one. If it is +too large, some circles may be missed. +@param param1 First method-specific parameter. In case of CV_HOUGH_GRADIENT , it is the higher +threshold of the two passed to the Canny edge detector (the lower one is twice smaller). +@param param2 Second method-specific parameter. In case of CV_HOUGH_GRADIENT , it is the +accumulator threshold for the circle centers at the detection stage. The smaller it is, the more +false circles may be detected. Circles, corresponding to the larger accumulator values, will be +returned first. +@param minRadius Minimum circle radius. +@param maxRadius Maximum circle radius. + +@sa fitEllipse, minEnclosingCircle + */ +CV_EXPORTS_W void HoughCircles( InputArray image, OutputArray circles, + int method, double dp, double minDist, + double param1 = 100, double param2 = 100, + int minRadius = 0, int maxRadius = 0 ); + +//! @} imgproc_feature + +//! @addtogroup imgproc_filter +//! @{ + +/** @example morphology2.cpp + An example using the morphological operations +*/ + +/** @brief Erodes an image by using a specific structuring element. + +The function erodes the source image using the specified structuring element that determines the +shape of a pixel neighborhood over which the minimum is taken: + +\f[\texttt{dst} (x,y) = \min _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')\f] + +The function supports the in-place mode. Erosion can be applied several ( iterations ) times. In +case of multi-channel images, each channel is processed independently. + +@param src input image; the number of channels can be arbitrary, but the depth should be one of +CV_8U, CV_16U, CV_16S, CV_32F or CV_64F. +@param dst output image of the same size and type as src. +@param kernel structuring element used for erosion; if `element=Mat()`, a `3 x 3` rectangular +structuring element is used. Kernel can be created using getStructuringElement. +@param anchor position of the anchor within the element; default value (-1, -1) means that the +anchor is at the element center. +@param iterations number of times erosion is applied. +@param borderType pixel extrapolation method, see cv::BorderTypes +@param borderValue border value in case of a constant border +@sa dilate, morphologyEx, getStructuringElement + */ +CV_EXPORTS_W void erode( InputArray src, OutputArray dst, InputArray kernel, + Point anchor = Point(-1,-1), int iterations = 1, + int borderType = BORDER_CONSTANT, + const Scalar& borderValue = morphologyDefaultBorderValue() ); + +/** @brief Dilates an image by using a specific structuring element. + +The function dilates the source image using the specified structuring element that determines the +shape of a pixel neighborhood over which the maximum is taken: +\f[\texttt{dst} (x,y) = \max _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')\f] + +The function supports the in-place mode. Dilation can be applied several ( iterations ) times. In +case of multi-channel images, each channel is processed independently. + +@param src input image; the number of channels can be arbitrary, but the depth should be one of +CV_8U, CV_16U, CV_16S, CV_32F or CV_64F. +@param dst output image of the same size and type as src\`. +@param kernel structuring element used for dilation; if elemenat=Mat(), a 3 x 3 rectangular +structuring element is used. Kernel can be created using getStructuringElement +@param anchor position of the anchor within the element; default value (-1, -1) means that the +anchor is at the element center. +@param iterations number of times dilation is applied. +@param borderType pixel extrapolation method, see cv::BorderTypes +@param borderValue border value in case of a constant border +@sa erode, morphologyEx, getStructuringElement + */ +CV_EXPORTS_W void dilate( InputArray src, OutputArray dst, InputArray kernel, + Point anchor = Point(-1,-1), int iterations = 1, + int borderType = BORDER_CONSTANT, + const Scalar& borderValue = morphologyDefaultBorderValue() ); + +/** @brief Performs advanced morphological transformations. + +The function morphologyEx can perform advanced morphological transformations using an erosion and dilation as +basic operations. + +Any of the operations can be done in-place. In case of multi-channel images, each channel is +processed independently. + +@param src Source image. The number of channels can be arbitrary. The depth should be one of +CV_8U, CV_16U, CV_16S, CV_32F or CV_64F. +@param dst Destination image of the same size and type as source image. +@param op Type of a morphological operation, see cv::MorphTypes +@param kernel Structuring element. It can be created using cv::getStructuringElement. +@param anchor Anchor position with the kernel. Negative values mean that the anchor is at the +kernel center. +@param iterations Number of times erosion and dilation are applied. +@param borderType Pixel extrapolation method, see cv::BorderTypes +@param borderValue Border value in case of a constant border. The default value has a special +meaning. +@sa dilate, erode, getStructuringElement + */ +CV_EXPORTS_W void morphologyEx( InputArray src, OutputArray dst, + int op, InputArray kernel, + Point anchor = Point(-1,-1), int iterations = 1, + int borderType = BORDER_CONSTANT, + const Scalar& borderValue = morphologyDefaultBorderValue() ); + +//! @} imgproc_filter + +//! @addtogroup imgproc_transform +//! @{ + +/** @brief Resizes an image. + +The function resize resizes the image src down to or up to the specified size. Note that the +initial dst type or size are not taken into account. Instead, the size and type are derived from +the `src`,`dsize`,`fx`, and `fy`. If you want to resize src so that it fits the pre-created dst, +you may call the function as follows: +@code + // explicitly specify dsize=dst.size(); fx and fy will be computed from that. + resize(src, dst, dst.size(), 0, 0, interpolation); +@endcode +If you want to decimate the image by factor of 2 in each direction, you can call the function this +way: +@code + // specify fx and fy and let the function compute the destination image size. + resize(src, dst, Size(), 0.5, 0.5, interpolation); +@endcode +To shrink an image, it will generally look best with cv::INTER_AREA interpolation, whereas to +enlarge an image, it will generally look best with cv::INTER_CUBIC (slow) or cv::INTER_LINEAR +(faster but still looks OK). + +@param src input image. +@param dst output image; it has the size dsize (when it is non-zero) or the size computed from +src.size(), fx, and fy; the type of dst is the same as of src. +@param dsize output image size; if it equals zero, it is computed as: + \f[\texttt{dsize = Size(round(fx*src.cols), round(fy*src.rows))}\f] + Either dsize or both fx and fy must be non-zero. +@param fx scale factor along the horizontal axis; when it equals 0, it is computed as +\f[\texttt{(double)dsize.width/src.cols}\f] +@param fy scale factor along the vertical axis; when it equals 0, it is computed as +\f[\texttt{(double)dsize.height/src.rows}\f] +@param interpolation interpolation method, see cv::InterpolationFlags + +@sa warpAffine, warpPerspective, remap + */ +CV_EXPORTS_W void resize( InputArray src, OutputArray dst, + Size dsize, double fx = 0, double fy = 0, + int interpolation = INTER_LINEAR ); + +/** @brief Applies an affine transformation to an image. + +The function warpAffine transforms the source image using the specified matrix: + +\f[\texttt{dst} (x,y) = \texttt{src} ( \texttt{M} _{11} x + \texttt{M} _{12} y + \texttt{M} _{13}, \texttt{M} _{21} x + \texttt{M} _{22} y + \texttt{M} _{23})\f] + +when the flag WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted +with cv::invertAffineTransform and then put in the formula above instead of M. The function cannot +operate in-place. + +@param src input image. +@param dst output image that has the size dsize and the same type as src . +@param M \f$2\times 3\f$ transformation matrix. +@param dsize size of the output image. +@param flags combination of interpolation methods (see cv::InterpolationFlags) and the optional +flag WARP_INVERSE_MAP that means that M is the inverse transformation ( +\f$\texttt{dst}\rightarrow\texttt{src}\f$ ). +@param borderMode pixel extrapolation method (see cv::BorderTypes); when +borderMode=BORDER_TRANSPARENT, it means that the pixels in the destination image corresponding to +the "outliers" in the source image are not modified by the function. +@param borderValue value used in case of a constant border; by default, it is 0. + +@sa warpPerspective, resize, remap, getRectSubPix, transform + */ +CV_EXPORTS_W void warpAffine( InputArray src, OutputArray dst, + InputArray M, Size dsize, + int flags = INTER_LINEAR, + int borderMode = BORDER_CONSTANT, + const Scalar& borderValue = Scalar()); + +/** @brief Applies a perspective transformation to an image. + +The function warpPerspective transforms the source image using the specified matrix: + +\f[\texttt{dst} (x,y) = \texttt{src} \left ( \frac{M_{11} x + M_{12} y + M_{13}}{M_{31} x + M_{32} y + M_{33}} , + \frac{M_{21} x + M_{22} y + M_{23}}{M_{31} x + M_{32} y + M_{33}} \right )\f] + +when the flag WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with invert +and then put in the formula above instead of M. The function cannot operate in-place. + +@param src input image. +@param dst output image that has the size dsize and the same type as src . +@param M \f$3\times 3\f$ transformation matrix. +@param dsize size of the output image. +@param flags combination of interpolation methods (INTER_LINEAR or INTER_NEAREST) and the +optional flag WARP_INVERSE_MAP, that sets M as the inverse transformation ( +\f$\texttt{dst}\rightarrow\texttt{src}\f$ ). +@param borderMode pixel extrapolation method (BORDER_CONSTANT or BORDER_REPLICATE). +@param borderValue value used in case of a constant border; by default, it equals 0. + +@sa warpAffine, resize, remap, getRectSubPix, perspectiveTransform + */ +CV_EXPORTS_W void warpPerspective( InputArray src, OutputArray dst, + InputArray M, Size dsize, + int flags = INTER_LINEAR, + int borderMode = BORDER_CONSTANT, + const Scalar& borderValue = Scalar()); + +/** @brief Applies a generic geometrical transformation to an image. + +The function remap transforms the source image using the specified map: + +\f[\texttt{dst} (x,y) = \texttt{src} (map_x(x,y),map_y(x,y))\f] + +where values of pixels with non-integer coordinates are computed using one of available +interpolation methods. \f$map_x\f$ and \f$map_y\f$ can be encoded as separate floating-point maps +in \f$map_1\f$ and \f$map_2\f$ respectively, or interleaved floating-point maps of \f$(x,y)\f$ in +\f$map_1\f$, or fixed-point maps created by using convertMaps. The reason you might want to +convert from floating to fixed-point representations of a map is that they can yield much faster +(\~2x) remapping operations. In the converted case, \f$map_1\f$ contains pairs (cvFloor(x), +cvFloor(y)) and \f$map_2\f$ contains indices in a table of interpolation coefficients. + +This function cannot operate in-place. + +@param src Source image. +@param dst Destination image. It has the same size as map1 and the same type as src . +@param map1 The first map of either (x,y) points or just x values having the type CV_16SC2 , +CV_32FC1, or CV_32FC2. See convertMaps for details on converting a floating point +representation to fixed-point for speed. +@param map2 The second map of y values having the type CV_16UC1, CV_32FC1, or none (empty map +if map1 is (x,y) points), respectively. +@param interpolation Interpolation method (see cv::InterpolationFlags). The method INTER_AREA is +not supported by this function. +@param borderMode Pixel extrapolation method (see cv::BorderTypes). When +borderMode=BORDER_TRANSPARENT, it means that the pixels in the destination image that +corresponds to the "outliers" in the source image are not modified by the function. +@param borderValue Value used in case of a constant border. By default, it is 0. + */ +CV_EXPORTS_W void remap( InputArray src, OutputArray dst, + InputArray map1, InputArray map2, + int interpolation, int borderMode = BORDER_CONSTANT, + const Scalar& borderValue = Scalar()); + +/** @brief Converts image transformation maps from one representation to another. + +The function converts a pair of maps for remap from one representation to another. The following +options ( (map1.type(), map2.type()) \f$\rightarrow\f$ (dstmap1.type(), dstmap2.type()) ) are +supported: + +- \f$\texttt{(CV\_32FC1, CV\_32FC1)} \rightarrow \texttt{(CV\_16SC2, CV\_16UC1)}\f$. This is the +most frequently used conversion operation, in which the original floating-point maps (see remap ) +are converted to a more compact and much faster fixed-point representation. The first output array +contains the rounded coordinates and the second array (created only when nninterpolation=false ) +contains indices in the interpolation tables. + +- \f$\texttt{(CV\_32FC2)} \rightarrow \texttt{(CV\_16SC2, CV\_16UC1)}\f$. The same as above but +the original maps are stored in one 2-channel matrix. + +- Reverse conversion. Obviously, the reconstructed floating-point maps will not be exactly the same +as the originals. + +@param map1 The first input map of type CV_16SC2, CV_32FC1, or CV_32FC2 . +@param map2 The second input map of type CV_16UC1, CV_32FC1, or none (empty matrix), +respectively. +@param dstmap1 The first output map that has the type dstmap1type and the same size as src . +@param dstmap2 The second output map. +@param dstmap1type Type of the first output map that should be CV_16SC2, CV_32FC1, or +CV_32FC2 . +@param nninterpolation Flag indicating whether the fixed-point maps are used for the +nearest-neighbor or for a more complex interpolation. + +@sa remap, undistort, initUndistortRectifyMap + */ +CV_EXPORTS_W void convertMaps( InputArray map1, InputArray map2, + OutputArray dstmap1, OutputArray dstmap2, + int dstmap1type, bool nninterpolation = false ); + +/** @brief Calculates an affine matrix of 2D rotation. + +The function calculates the following matrix: + +\f[\begin{bmatrix} \alpha & \beta & (1- \alpha ) \cdot \texttt{center.x} - \beta \cdot \texttt{center.y} \\ - \beta & \alpha & \beta \cdot \texttt{center.x} + (1- \alpha ) \cdot \texttt{center.y} \end{bmatrix}\f] + +where + +\f[\begin{array}{l} \alpha = \texttt{scale} \cdot \cos \texttt{angle} , \\ \beta = \texttt{scale} \cdot \sin \texttt{angle} \end{array}\f] + +The transformation maps the rotation center to itself. If this is not the target, adjust the shift. + +@param center Center of the rotation in the source image. +@param angle Rotation angle in degrees. Positive values mean counter-clockwise rotation (the +coordinate origin is assumed to be the top-left corner). +@param scale Isotropic scale factor. + +@sa getAffineTransform, warpAffine, transform + */ +CV_EXPORTS_W Mat getRotationMatrix2D( Point2f center, double angle, double scale ); + +//! returns 3x3 perspective transformation for the corresponding 4 point pairs. +CV_EXPORTS Mat getPerspectiveTransform( const Point2f src[], const Point2f dst[] ); + +/** @brief Calculates an affine transform from three pairs of the corresponding points. + +The function calculates the \f$2 \times 3\f$ matrix of an affine transform so that: + +\f[\begin{bmatrix} x'_i \\ y'_i \end{bmatrix} = \texttt{map\_matrix} \cdot \begin{bmatrix} x_i \\ y_i \\ 1 \end{bmatrix}\f] + +where + +\f[dst(i)=(x'_i,y'_i), src(i)=(x_i, y_i), i=0,1,2\f] + +@param src Coordinates of triangle vertices in the source image. +@param dst Coordinates of the corresponding triangle vertices in the destination image. + +@sa warpAffine, transform + */ +CV_EXPORTS Mat getAffineTransform( const Point2f src[], const Point2f dst[] ); + +/** @brief Inverts an affine transformation. + +The function computes an inverse affine transformation represented by \f$2 \times 3\f$ matrix M: + +\f[\begin{bmatrix} a_{11} & a_{12} & b_1 \\ a_{21} & a_{22} & b_2 \end{bmatrix}\f] + +The result is also a \f$2 \times 3\f$ matrix of the same type as M. + +@param M Original affine transformation. +@param iM Output reverse affine transformation. + */ +CV_EXPORTS_W void invertAffineTransform( InputArray M, OutputArray iM ); + +/** @brief Calculates a perspective transform from four pairs of the corresponding points. + +The function calculates the \f$3 \times 3\f$ matrix of a perspective transform so that: + +\f[\begin{bmatrix} t_i x'_i \\ t_i y'_i \\ t_i \end{bmatrix} = \texttt{map\_matrix} \cdot \begin{bmatrix} x_i \\ y_i \\ 1 \end{bmatrix}\f] + +where + +\f[dst(i)=(x'_i,y'_i), src(i)=(x_i, y_i), i=0,1,2,3\f] + +@param src Coordinates of quadrangle vertices in the source image. +@param dst Coordinates of the corresponding quadrangle vertices in the destination image. + +@sa findHomography, warpPerspective, perspectiveTransform + */ +CV_EXPORTS_W Mat getPerspectiveTransform( InputArray src, InputArray dst ); + +CV_EXPORTS_W Mat getAffineTransform( InputArray src, InputArray dst ); + +/** @brief Retrieves a pixel rectangle from an image with sub-pixel accuracy. + +The function getRectSubPix extracts pixels from src: + +\f[dst(x, y) = src(x + \texttt{center.x} - ( \texttt{dst.cols} -1)*0.5, y + \texttt{center.y} - ( \texttt{dst.rows} -1)*0.5)\f] + +where the values of the pixels at non-integer coordinates are retrieved using bilinear +interpolation. Every channel of multi-channel images is processed independently. While the center of +the rectangle must be inside the image, parts of the rectangle may be outside. In this case, the +replication border mode (see cv::BorderTypes) is used to extrapolate the pixel values outside of +the image. + +@param image Source image. +@param patchSize Size of the extracted patch. +@param center Floating point coordinates of the center of the extracted rectangle within the +source image. The center must be inside the image. +@param patch Extracted patch that has the size patchSize and the same number of channels as src . +@param patchType Depth of the extracted pixels. By default, they have the same depth as src . + +@sa warpAffine, warpPerspective + */ +CV_EXPORTS_W void getRectSubPix( InputArray image, Size patchSize, + Point2f center, OutputArray patch, int patchType = -1 ); + +/** @example polar_transforms.cpp +An example using the cv::linearPolar and cv::logPolar operations +*/ + +/** @brief Remaps an image to log-polar space. + +transforms the source image using the following transformation: +\f[dst( \phi , \rho ) = src(x,y)\f] +where +\f[\rho = M \cdot \log{\sqrt{x^2 + y^2}} , \phi =atan(y/x)\f] + +The function emulates the human "foveal" vision and can be used for fast scale and +rotation-invariant template matching, for object tracking and so forth. The function can not operate +in-place. + +@param src Source image +@param dst Destination image +@param center The transformation center; where the output precision is maximal +@param M Magnitude scale parameter. +@param flags A combination of interpolation methods, see cv::InterpolationFlags + */ +CV_EXPORTS_W void logPolar( InputArray src, OutputArray dst, + Point2f center, double M, int flags ); + +/** @brief Remaps an image to polar space. + +transforms the source image using the following transformation: +\f[dst( \phi , \rho ) = src(x,y)\f] +where +\f[\rho = (src.width/maxRadius) \cdot \sqrt{x^2 + y^2} , \phi =atan(y/x)\f] + +The function can not operate in-place. + +@param src Source image +@param dst Destination image +@param center The transformation center; +@param maxRadius Inverse magnitude scale parameter +@param flags A combination of interpolation methods, see cv::InterpolationFlags + */ +CV_EXPORTS_W void linearPolar( InputArray src, OutputArray dst, + Point2f center, double maxRadius, int flags ); + +//! @} imgproc_transform + +//! @addtogroup imgproc_misc +//! @{ + +/** @overload */ +CV_EXPORTS_W void integral( InputArray src, OutputArray sum, int sdepth = -1 ); + +/** @overload */ +CV_EXPORTS_AS(integral2) void integral( InputArray src, OutputArray sum, + OutputArray sqsum, int sdepth = -1, int sqdepth = -1 ); + +/** @brief Calculates the integral of an image. + +The functions calculate one or more integral images for the source image as follows: + +\f[\texttt{sum} (X,Y) = \sum _{x + +Calculates the cross-power spectrum of two supplied source arrays. The arrays are padded if needed +with getOptimalDFTSize. + +The function performs the following equations: +- First it applies a Hanning window (see ) to each +image to remove possible edge effects. This window is cached until the array size changes to speed +up processing time. +- Next it computes the forward DFTs of each source array: +\f[\mathbf{G}_a = \mathcal{F}\{src_1\}, \; \mathbf{G}_b = \mathcal{F}\{src_2\}\f] +where \f$\mathcal{F}\f$ is the forward DFT. +- It then computes the cross-power spectrum of each frequency domain array: +\f[R = \frac{ \mathbf{G}_a \mathbf{G}_b^*}{|\mathbf{G}_a \mathbf{G}_b^*|}\f] +- Next the cross-correlation is converted back into the time domain via the inverse DFT: +\f[r = \mathcal{F}^{-1}\{R\}\f] +- Finally, it computes the peak location and computes a 5x5 weighted centroid around the peak to +achieve sub-pixel accuracy. +\f[(\Delta x, \Delta y) = \texttt{weightedCentroid} \{\arg \max_{(x, y)}\{r\}\}\f] +- If non-zero, the response parameter is computed as the sum of the elements of r within the 5x5 +centroid around the peak location. It is normalized to a maximum of 1 (meaning there is a single +peak) and will be smaller when there are multiple peaks. + +@param src1 Source floating point array (CV_32FC1 or CV_64FC1) +@param src2 Source floating point array (CV_32FC1 or CV_64FC1) +@param window Floating point array with windowing coefficients to reduce edge effects (optional). +@param response Signal power within the 5x5 centroid around the peak, between 0 and 1 (optional). +@returns detected phase shift (sub-pixel) between the two arrays. + +@sa dft, getOptimalDFTSize, idft, mulSpectrums createHanningWindow + */ +CV_EXPORTS_W Point2d phaseCorrelate(InputArray src1, InputArray src2, + InputArray window = noArray(), CV_OUT double* response = 0); + +/** @brief This function computes a Hanning window coefficients in two dimensions. + +See (http://en.wikipedia.org/wiki/Hann_function) and (http://en.wikipedia.org/wiki/Window_function) +for more information. + +An example is shown below: +@code + // create hanning window of size 100x100 and type CV_32F + Mat hann; + createHanningWindow(hann, Size(100, 100), CV_32F); +@endcode +@param dst Destination array to place Hann coefficients in +@param winSize The window size specifications +@param type Created array type + */ +CV_EXPORTS_W void createHanningWindow(OutputArray dst, Size winSize, int type); + +//! @} imgproc_motion + +//! @addtogroup imgproc_misc +//! @{ + +/** @brief Applies a fixed-level threshold to each array element. + +The function applies fixed-level thresholding to a single-channel array. The function is typically +used to get a bi-level (binary) image out of a grayscale image ( cv::compare could be also used for +this purpose) or for removing a noise, that is, filtering out pixels with too small or too large +values. There are several types of thresholding supported by the function. They are determined by +type parameter. + +Also, the special values cv::THRESH_OTSU or cv::THRESH_TRIANGLE may be combined with one of the +above values. In these cases, the function determines the optimal threshold value using the Otsu's +or Triangle algorithm and uses it instead of the specified thresh . The function returns the +computed threshold value. Currently, the Otsu's and Triangle methods are implemented only for 8-bit +images. + +@param src input array (single-channel, 8-bit or 32-bit floating point). +@param dst output array of the same size and type as src. +@param thresh threshold value. +@param maxval maximum value to use with the THRESH_BINARY and THRESH_BINARY_INV thresholding +types. +@param type thresholding type (see the cv::ThresholdTypes). + +@sa adaptiveThreshold, findContours, compare, min, max + */ +CV_EXPORTS_W double threshold( InputArray src, OutputArray dst, + double thresh, double maxval, int type ); + + +/** @brief Applies an adaptive threshold to an array. + +The function transforms a grayscale image to a binary image according to the formulae: +- **THRESH_BINARY** + \f[dst(x,y) = \fork{\texttt{maxValue}}{if \(src(x,y) > T(x,y)\)}{0}{otherwise}\f] +- **THRESH_BINARY_INV** + \f[dst(x,y) = \fork{0}{if \(src(x,y) > T(x,y)\)}{\texttt{maxValue}}{otherwise}\f] +where \f$T(x,y)\f$ is a threshold calculated individually for each pixel (see adaptiveMethod parameter). + +The function can process the image in-place. + +@param src Source 8-bit single-channel image. +@param dst Destination image of the same size and the same type as src. +@param maxValue Non-zero value assigned to the pixels for which the condition is satisfied +@param adaptiveMethod Adaptive thresholding algorithm to use, see cv::AdaptiveThresholdTypes +@param thresholdType Thresholding type that must be either THRESH_BINARY or THRESH_BINARY_INV, +see cv::ThresholdTypes. +@param blockSize Size of a pixel neighborhood that is used to calculate a threshold value for the +pixel: 3, 5, 7, and so on. +@param C Constant subtracted from the mean or weighted mean (see the details below). Normally, it +is positive but may be zero or negative as well. + +@sa threshold, blur, GaussianBlur + */ +CV_EXPORTS_W void adaptiveThreshold( InputArray src, OutputArray dst, + double maxValue, int adaptiveMethod, + int thresholdType, int blockSize, double C ); + +//! @} imgproc_misc + +//! @addtogroup imgproc_filter +//! @{ + +/** @brief Blurs an image and downsamples it. + +By default, size of the output image is computed as `Size((src.cols+1)/2, (src.rows+1)/2)`, but in +any case, the following conditions should be satisfied: + +\f[\begin{array}{l} | \texttt{dstsize.width} *2-src.cols| \leq 2 \\ | \texttt{dstsize.height} *2-src.rows| \leq 2 \end{array}\f] + +The function performs the downsampling step of the Gaussian pyramid construction. First, it +convolves the source image with the kernel: + +\f[\frac{1}{256} \begin{bmatrix} 1 & 4 & 6 & 4 & 1 \\ 4 & 16 & 24 & 16 & 4 \\ 6 & 24 & 36 & 24 & 6 \\ 4 & 16 & 24 & 16 & 4 \\ 1 & 4 & 6 & 4 & 1 \end{bmatrix}\f] + +Then, it downsamples the image by rejecting even rows and columns. + +@param src input image. +@param dst output image; it has the specified size and the same type as src. +@param dstsize size of the output image. +@param borderType Pixel extrapolation method, see cv::BorderTypes (BORDER_CONSTANT isn't supported) + */ +CV_EXPORTS_W void pyrDown( InputArray src, OutputArray dst, + const Size& dstsize = Size(), int borderType = BORDER_DEFAULT ); + +/** @brief Upsamples an image and then blurs it. + +By default, size of the output image is computed as `Size(src.cols\*2, (src.rows\*2)`, but in any +case, the following conditions should be satisfied: + +\f[\begin{array}{l} | \texttt{dstsize.width} -src.cols*2| \leq ( \texttt{dstsize.width} \mod 2) \\ | \texttt{dstsize.height} -src.rows*2| \leq ( \texttt{dstsize.height} \mod 2) \end{array}\f] + +The function performs the upsampling step of the Gaussian pyramid construction, though it can +actually be used to construct the Laplacian pyramid. First, it upsamples the source image by +injecting even zero rows and columns and then convolves the result with the same kernel as in +pyrDown multiplied by 4. + +@param src input image. +@param dst output image. It has the specified size and the same type as src . +@param dstsize size of the output image. +@param borderType Pixel extrapolation method, see cv::BorderTypes (only BORDER_DEFAULT is supported) + */ +CV_EXPORTS_W void pyrUp( InputArray src, OutputArray dst, + const Size& dstsize = Size(), int borderType = BORDER_DEFAULT ); + +/** @brief Constructs the Gaussian pyramid for an image. + +The function constructs a vector of images and builds the Gaussian pyramid by recursively applying +pyrDown to the previously built pyramid layers, starting from `dst[0]==src`. + +@param src Source image. Check pyrDown for the list of supported types. +@param dst Destination vector of maxlevel+1 images of the same type as src. dst[0] will be the +same as src. dst[1] is the next pyramid layer, a smoothed and down-sized src, and so on. +@param maxlevel 0-based index of the last (the smallest) pyramid layer. It must be non-negative. +@param borderType Pixel extrapolation method, see cv::BorderTypes (BORDER_CONSTANT isn't supported) + */ +CV_EXPORTS void buildPyramid( InputArray src, OutputArrayOfArrays dst, + int maxlevel, int borderType = BORDER_DEFAULT ); + +//! @} imgproc_filter + +//! @addtogroup imgproc_transform +//! @{ + +/** @brief Transforms an image to compensate for lens distortion. + +The function transforms an image to compensate radial and tangential lens distortion. + +The function is simply a combination of cv::initUndistortRectifyMap (with unity R ) and cv::remap +(with bilinear interpolation). See the former function for details of the transformation being +performed. + +Those pixels in the destination image, for which there is no correspondent pixels in the source +image, are filled with zeros (black color). + +A particular subset of the source image that will be visible in the corrected image can be regulated +by newCameraMatrix. You can use cv::getOptimalNewCameraMatrix to compute the appropriate +newCameraMatrix depending on your requirements. + +The camera matrix and the distortion parameters can be determined using cv::calibrateCamera. If +the resolution of images is different from the resolution used at the calibration stage, \f$f_x, +f_y, c_x\f$ and \f$c_y\f$ need to be scaled accordingly, while the distortion coefficients remain +the same. + +@param src Input (distorted) image. +@param dst Output (corrected) image that has the same size and type as src . +@param cameraMatrix Input camera matrix \f$A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ . +@param distCoeffs Input vector of distortion coefficients +\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ +of 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed. +@param newCameraMatrix Camera matrix of the distorted image. By default, it is the same as +cameraMatrix but you may additionally scale and shift the result by using a different matrix. + */ +CV_EXPORTS_W void undistort( InputArray src, OutputArray dst, + InputArray cameraMatrix, + InputArray distCoeffs, + InputArray newCameraMatrix = noArray() ); + +/** @brief Computes the undistortion and rectification transformation map. + +The function computes the joint undistortion and rectification transformation and represents the +result in the form of maps for remap. The undistorted image looks like original, as if it is +captured with a camera using the camera matrix =newCameraMatrix and zero distortion. In case of a +monocular camera, newCameraMatrix is usually equal to cameraMatrix, or it can be computed by +cv::getOptimalNewCameraMatrix for a better control over scaling. In case of a stereo camera, +newCameraMatrix is normally set to P1 or P2 computed by cv::stereoRectify . + +Also, this new camera is oriented differently in the coordinate space, according to R. That, for +example, helps to align two heads of a stereo camera so that the epipolar lines on both images +become horizontal and have the same y- coordinate (in case of a horizontally aligned stereo camera). + +The function actually builds the maps for the inverse mapping algorithm that is used by remap. That +is, for each pixel \f$(u, v)\f$ in the destination (corrected and rectified) image, the function +computes the corresponding coordinates in the source image (that is, in the original image from +camera). The following process is applied: +\f[ +\begin{array}{l} +x \leftarrow (u - {c'}_x)/{f'}_x \\ +y \leftarrow (v - {c'}_y)/{f'}_y \\ +{[X\,Y\,W]} ^T \leftarrow R^{-1}*[x \, y \, 1]^T \\ +x' \leftarrow X/W \\ +y' \leftarrow Y/W \\ +r^2 \leftarrow x'^2 + y'^2 \\ +x'' \leftarrow x' \frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6} ++ 2p_1 x' y' + p_2(r^2 + 2 x'^2) + s_1 r^2 + s_2 r^4\\ +y'' \leftarrow y' \frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6} ++ p_1 (r^2 + 2 y'^2) + 2 p_2 x' y' + s_3 r^2 + s_4 r^4 \\ +s\vecthree{x'''}{y'''}{1} = +\vecthreethree{R_{33}(\tau_x, \tau_y)}{0}{-R_{13}((\tau_x, \tau_y)} +{0}{R_{33}(\tau_x, \tau_y)}{-R_{23}(\tau_x, \tau_y)} +{0}{0}{1} R(\tau_x, \tau_y) \vecthree{x''}{y''}{1}\\ +map_x(u,v) \leftarrow x''' f_x + c_x \\ +map_y(u,v) \leftarrow y''' f_y + c_y +\end{array} +\f] +where \f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ +are the distortion coefficients. + +In case of a stereo camera, this function is called twice: once for each camera head, after +stereoRectify, which in its turn is called after cv::stereoCalibrate. But if the stereo camera +was not calibrated, it is still possible to compute the rectification transformations directly from +the fundamental matrix using cv::stereoRectifyUncalibrated. For each camera, the function computes +homography H as the rectification transformation in a pixel domain, not a rotation matrix R in 3D +space. R can be computed from H as +\f[\texttt{R} = \texttt{cameraMatrix} ^{-1} \cdot \texttt{H} \cdot \texttt{cameraMatrix}\f] +where cameraMatrix can be chosen arbitrarily. + +@param cameraMatrix Input camera matrix \f$A=\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ . +@param distCoeffs Input vector of distortion coefficients +\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ +of 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed. +@param R Optional rectification transformation in the object space (3x3 matrix). R1 or R2 , +computed by stereoRectify can be passed here. If the matrix is empty, the identity transformation +is assumed. In cvInitUndistortMap R assumed to be an identity matrix. +@param newCameraMatrix New camera matrix \f$A'=\vecthreethree{f_x'}{0}{c_x'}{0}{f_y'}{c_y'}{0}{0}{1}\f$. +@param size Undistorted image size. +@param m1type Type of the first output map that can be CV_32FC1 or CV_16SC2, see cv::convertMaps +@param map1 The first output map. +@param map2 The second output map. + */ +CV_EXPORTS_W void initUndistortRectifyMap( InputArray cameraMatrix, InputArray distCoeffs, + InputArray R, InputArray newCameraMatrix, + Size size, int m1type, OutputArray map1, OutputArray map2 ); + +//! initializes maps for cv::remap() for wide-angle +CV_EXPORTS_W float initWideAngleProjMap( InputArray cameraMatrix, InputArray distCoeffs, + Size imageSize, int destImageWidth, + int m1type, OutputArray map1, OutputArray map2, + int projType = PROJ_SPHERICAL_EQRECT, double alpha = 0); + +/** @brief Returns the default new camera matrix. + +The function returns the camera matrix that is either an exact copy of the input cameraMatrix (when +centerPrinicipalPoint=false ), or the modified one (when centerPrincipalPoint=true). + +In the latter case, the new camera matrix will be: + +\f[\begin{bmatrix} f_x && 0 && ( \texttt{imgSize.width} -1)*0.5 \\ 0 && f_y && ( \texttt{imgSize.height} -1)*0.5 \\ 0 && 0 && 1 \end{bmatrix} ,\f] + +where \f$f_x\f$ and \f$f_y\f$ are \f$(0,0)\f$ and \f$(1,1)\f$ elements of cameraMatrix, respectively. + +By default, the undistortion functions in OpenCV (see initUndistortRectifyMap, undistort) do not +move the principal point. However, when you work with stereo, it is important to move the principal +points in both views to the same y-coordinate (which is required by most of stereo correspondence +algorithms), and may be to the same x-coordinate too. So, you can form the new camera matrix for +each view where the principal points are located at the center. + +@param cameraMatrix Input camera matrix. +@param imgsize Camera view image size in pixels. +@param centerPrincipalPoint Location of the principal point in the new camera matrix. The +parameter indicates whether this location should be at the image center or not. + */ +CV_EXPORTS_W Mat getDefaultNewCameraMatrix( InputArray cameraMatrix, Size imgsize = Size(), + bool centerPrincipalPoint = false ); + +/** @brief Computes the ideal point coordinates from the observed point coordinates. + +The function is similar to cv::undistort and cv::initUndistortRectifyMap but it operates on a +sparse set of points instead of a raster image. Also the function performs a reverse transformation +to projectPoints. In case of a 3D object, it does not reconstruct its 3D coordinates, but for a +planar object, it does, up to a translation vector, if the proper R is specified. +@code + // (u,v) is the input point, (u', v') is the output point + // camera_matrix=[fx 0 cx; 0 fy cy; 0 0 1] + // P=[fx' 0 cx' tx; 0 fy' cy' ty; 0 0 1 tz] + x" = (u - cx)/fx + y" = (v - cy)/fy + (x',y') = undistort(x",y",dist_coeffs) + [X,Y,W]T = R*[x' y' 1]T + x = X/W, y = Y/W + // only performed if P=[fx' 0 cx' [tx]; 0 fy' cy' [ty]; 0 0 1 [tz]] is specified + u' = x*fx' + cx' + v' = y*fy' + cy', +@endcode +where cv::undistort is an approximate iterative algorithm that estimates the normalized original +point coordinates out of the normalized distorted point coordinates ("normalized" means that the +coordinates do not depend on the camera matrix). + +The function can be used for both a stereo camera head or a monocular camera (when R is empty). + +@param src Observed point coordinates, 1xN or Nx1 2-channel (CV_32FC2 or CV_64FC2). +@param dst Output ideal point coordinates after undistortion and reverse perspective +transformation. If matrix P is identity or omitted, dst will contain normalized point coordinates. +@param cameraMatrix Camera matrix \f$\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ . +@param distCoeffs Input vector of distortion coefficients +\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ +of 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed. +@param R Rectification transformation in the object space (3x3 matrix). R1 or R2 computed by +cv::stereoRectify can be passed here. If the matrix is empty, the identity transformation is used. +@param P New camera matrix (3x3) or new projection matrix (3x4). P1 or P2 computed by +cv::stereoRectify can be passed here. If the matrix is empty, the identity new camera matrix is used. + */ +CV_EXPORTS_W void undistortPoints( InputArray src, OutputArray dst, + InputArray cameraMatrix, InputArray distCoeffs, + InputArray R = noArray(), InputArray P = noArray()); + +//! @} imgproc_transform + +//! @addtogroup imgproc_hist +//! @{ + +/** @example demhist.cpp +An example for creating histograms of an image +*/ + +/** @brief Calculates a histogram of a set of arrays. + +The functions calcHist calculate the histogram of one or more arrays. The elements of a tuple used +to increment a histogram bin are taken from the corresponding input arrays at the same location. The +sample below shows how to compute a 2D Hue-Saturation histogram for a color image. : +@code + #include + #include + + using namespace cv; + + int main( int argc, char** argv ) + { + Mat src, hsv; + if( argc != 2 || !(src=imread(argv[1], 1)).data ) + return -1; + + cvtColor(src, hsv, COLOR_BGR2HSV); + + // Quantize the hue to 30 levels + // and the saturation to 32 levels + int hbins = 30, sbins = 32; + int histSize[] = {hbins, sbins}; + // hue varies from 0 to 179, see cvtColor + float hranges[] = { 0, 180 }; + // saturation varies from 0 (black-gray-white) to + // 255 (pure spectrum color) + float sranges[] = { 0, 256 }; + const float* ranges[] = { hranges, sranges }; + MatND hist; + // we compute the histogram from the 0-th and 1-st channels + int channels[] = {0, 1}; + + calcHist( &hsv, 1, channels, Mat(), // do not use mask + hist, 2, histSize, ranges, + true, // the histogram is uniform + false ); + double maxVal=0; + minMaxLoc(hist, 0, &maxVal, 0, 0); + + int scale = 10; + Mat histImg = Mat::zeros(sbins*scale, hbins*10, CV_8UC3); + + for( int h = 0; h < hbins; h++ ) + for( int s = 0; s < sbins; s++ ) + { + float binVal = hist.at(h, s); + int intensity = cvRound(binVal*255/maxVal); + rectangle( histImg, Point(h*scale, s*scale), + Point( (h+1)*scale - 1, (s+1)*scale - 1), + Scalar::all(intensity), + CV_FILLED ); + } + + namedWindow( "Source", 1 ); + imshow( "Source", src ); + + namedWindow( "H-S Histogram", 1 ); + imshow( "H-S Histogram", histImg ); + waitKey(); + } +@endcode + +@param images Source arrays. They all should have the same depth, CV_8U or CV_32F , and the same +size. Each of them can have an arbitrary number of channels. +@param nimages Number of source images. +@param channels List of the dims channels used to compute the histogram. The first array channels +are numerated from 0 to images[0].channels()-1 , the second array channels are counted from +images[0].channels() to images[0].channels() + images[1].channels()-1, and so on. +@param mask Optional mask. If the matrix is not empty, it must be an 8-bit array of the same size +as images[i] . The non-zero mask elements mark the array elements counted in the histogram. +@param hist Output histogram, which is a dense or sparse dims -dimensional array. +@param dims Histogram dimensionality that must be positive and not greater than CV_MAX_DIMS +(equal to 32 in the current OpenCV version). +@param histSize Array of histogram sizes in each dimension. +@param ranges Array of the dims arrays of the histogram bin boundaries in each dimension. When the +histogram is uniform ( uniform =true), then for each dimension i it is enough to specify the lower +(inclusive) boundary \f$L_0\f$ of the 0-th histogram bin and the upper (exclusive) boundary +\f$U_{\texttt{histSize}[i]-1}\f$ for the last histogram bin histSize[i]-1 . That is, in case of a +uniform histogram each of ranges[i] is an array of 2 elements. When the histogram is not uniform ( +uniform=false ), then each of ranges[i] contains histSize[i]+1 elements: +\f$L_0, U_0=L_1, U_1=L_2, ..., U_{\texttt{histSize[i]}-2}=L_{\texttt{histSize[i]}-1}, U_{\texttt{histSize[i]}-1}\f$ +. The array elements, that are not between \f$L_0\f$ and \f$U_{\texttt{histSize[i]}-1}\f$ , are not +counted in the histogram. +@param uniform Flag indicating whether the histogram is uniform or not (see above). +@param accumulate Accumulation flag. If it is set, the histogram is not cleared in the beginning +when it is allocated. This feature enables you to compute a single histogram from several sets of +arrays, or to update the histogram in time. +*/ +CV_EXPORTS void calcHist( const Mat* images, int nimages, + const int* channels, InputArray mask, + OutputArray hist, int dims, const int* histSize, + const float** ranges, bool uniform = true, bool accumulate = false ); + +/** @overload + +this variant uses cv::SparseMat for output +*/ +CV_EXPORTS void calcHist( const Mat* images, int nimages, + const int* channels, InputArray mask, + SparseMat& hist, int dims, + const int* histSize, const float** ranges, + bool uniform = true, bool accumulate = false ); + +/** @overload */ +CV_EXPORTS_W void calcHist( InputArrayOfArrays images, + const std::vector& channels, + InputArray mask, OutputArray hist, + const std::vector& histSize, + const std::vector& ranges, + bool accumulate = false ); + +/** @brief Calculates the back projection of a histogram. + +The functions calcBackProject calculate the back project of the histogram. That is, similarly to +cv::calcHist , at each location (x, y) the function collects the values from the selected channels +in the input images and finds the corresponding histogram bin. But instead of incrementing it, the +function reads the bin value, scales it by scale , and stores in backProject(x,y) . In terms of +statistics, the function computes probability of each element value in respect with the empirical +probability distribution represented by the histogram. See how, for example, you can find and track +a bright-colored object in a scene: + +- Before tracking, show the object to the camera so that it covers almost the whole frame. +Calculate a hue histogram. The histogram may have strong maximums, corresponding to the dominant +colors in the object. + +- When tracking, calculate a back projection of a hue plane of each input video frame using that +pre-computed histogram. Threshold the back projection to suppress weak colors. It may also make +sense to suppress pixels with non-sufficient color saturation and too dark or too bright pixels. + +- Find connected components in the resulting picture and choose, for example, the largest +component. + +This is an approximate algorithm of the CamShift color object tracker. + +@param images Source arrays. They all should have the same depth, CV_8U or CV_32F , and the same +size. Each of them can have an arbitrary number of channels. +@param nimages Number of source images. +@param channels The list of channels used to compute the back projection. The number of channels +must match the histogram dimensionality. The first array channels are numerated from 0 to +images[0].channels()-1 , the second array channels are counted from images[0].channels() to +images[0].channels() + images[1].channels()-1, and so on. +@param hist Input histogram that can be dense or sparse. +@param backProject Destination back projection array that is a single-channel array of the same +size and depth as images[0] . +@param ranges Array of arrays of the histogram bin boundaries in each dimension. See calcHist . +@param scale Optional scale factor for the output back projection. +@param uniform Flag indicating whether the histogram is uniform or not (see above). + +@sa cv::calcHist, cv::compareHist + */ +CV_EXPORTS void calcBackProject( const Mat* images, int nimages, + const int* channels, InputArray hist, + OutputArray backProject, const float** ranges, + double scale = 1, bool uniform = true ); + +/** @overload */ +CV_EXPORTS void calcBackProject( const Mat* images, int nimages, + const int* channels, const SparseMat& hist, + OutputArray backProject, const float** ranges, + double scale = 1, bool uniform = true ); + +/** @overload */ +CV_EXPORTS_W void calcBackProject( InputArrayOfArrays images, const std::vector& channels, + InputArray hist, OutputArray dst, + const std::vector& ranges, + double scale ); + +/** @brief Compares two histograms. + +The function compare two dense or two sparse histograms using the specified method. + +The function returns \f$d(H_1, H_2)\f$ . + +While the function works well with 1-, 2-, 3-dimensional dense histograms, it may not be suitable +for high-dimensional sparse histograms. In such histograms, because of aliasing and sampling +problems, the coordinates of non-zero histogram bins can slightly shift. To compare such histograms +or more general sparse configurations of weighted points, consider using the cv::EMD function. + +@param H1 First compared histogram. +@param H2 Second compared histogram of the same size as H1 . +@param method Comparison method, see cv::HistCompMethods + */ +CV_EXPORTS_W double compareHist( InputArray H1, InputArray H2, int method ); + +/** @overload */ +CV_EXPORTS double compareHist( const SparseMat& H1, const SparseMat& H2, int method ); + +/** @brief Equalizes the histogram of a grayscale image. + +The function equalizes the histogram of the input image using the following algorithm: + +- Calculate the histogram \f$H\f$ for src . +- Normalize the histogram so that the sum of histogram bins is 255. +- Compute the integral of the histogram: +\f[H'_i = \sum _{0 \le j < i} H(j)\f] +- Transform the image using \f$H'\f$ as a look-up table: \f$\texttt{dst}(x,y) = H'(\texttt{src}(x,y))\f$ + +The algorithm normalizes the brightness and increases the contrast of the image. + +@param src Source 8-bit single channel image. +@param dst Destination image of the same size and type as src . + */ +CV_EXPORTS_W void equalizeHist( InputArray src, OutputArray dst ); + +/** @brief Computes the "minimal work" distance between two weighted point configurations. + +The function computes the earth mover distance and/or a lower boundary of the distance between the +two weighted point configurations. One of the applications described in @cite RubnerSept98, +@cite Rubner2000 is multi-dimensional histogram comparison for image retrieval. EMD is a transportation +problem that is solved using some modification of a simplex algorithm, thus the complexity is +exponential in the worst case, though, on average it is much faster. In the case of a real metric +the lower boundary can be calculated even faster (using linear-time algorithm) and it can be used +to determine roughly whether the two signatures are far enough so that they cannot relate to the +same object. + +@param signature1 First signature, a \f$\texttt{size1}\times \texttt{dims}+1\f$ floating-point matrix. +Each row stores the point weight followed by the point coordinates. The matrix is allowed to have +a single column (weights only) if the user-defined cost matrix is used. +@param signature2 Second signature of the same format as signature1 , though the number of rows +may be different. The total weights may be different. In this case an extra "dummy" point is added +to either signature1 or signature2 . +@param distType Used metric. See cv::DistanceTypes. +@param cost User-defined \f$\texttt{size1}\times \texttt{size2}\f$ cost matrix. Also, if a cost matrix +is used, lower boundary lowerBound cannot be calculated because it needs a metric function. +@param lowerBound Optional input/output parameter: lower boundary of a distance between the two +signatures that is a distance between mass centers. The lower boundary may not be calculated if +the user-defined cost matrix is used, the total weights of point configurations are not equal, or +if the signatures consist of weights only (the signature matrices have a single column). You +**must** initialize \*lowerBound . If the calculated distance between mass centers is greater or +equal to \*lowerBound (it means that the signatures are far enough), the function does not +calculate EMD. In any case \*lowerBound is set to the calculated distance between mass centers on +return. Thus, if you want to calculate both distance between mass centers and EMD, \*lowerBound +should be set to 0. +@param flow Resultant \f$\texttt{size1} \times \texttt{size2}\f$ flow matrix: \f$\texttt{flow}_{i,j}\f$ is +a flow from \f$i\f$ -th point of signature1 to \f$j\f$ -th point of signature2 . + */ +CV_EXPORTS float EMD( InputArray signature1, InputArray signature2, + int distType, InputArray cost=noArray(), + float* lowerBound = 0, OutputArray flow = noArray() ); + +//! @} imgproc_hist + +/** @example watershed.cpp +An example using the watershed algorithm + */ + +/** @brief Performs a marker-based image segmentation using the watershed algorithm. + +The function implements one of the variants of watershed, non-parametric marker-based segmentation +algorithm, described in @cite Meyer92 . + +Before passing the image to the function, you have to roughly outline the desired regions in the +image markers with positive (\>0) indices. So, every region is represented as one or more connected +components with the pixel values 1, 2, 3, and so on. Such markers can be retrieved from a binary +mask using findContours and drawContours (see the watershed.cpp demo). The markers are "seeds" of +the future image regions. All the other pixels in markers , whose relation to the outlined regions +is not known and should be defined by the algorithm, should be set to 0's. In the function output, +each pixel in markers is set to a value of the "seed" components or to -1 at boundaries between the +regions. + +@note Any two neighbor connected components are not necessarily separated by a watershed boundary +(-1's pixels); for example, they can touch each other in the initial marker image passed to the +function. + +@param image Input 8-bit 3-channel image. +@param markers Input/output 32-bit single-channel image (map) of markers. It should have the same +size as image . + +@sa findContours + +@ingroup imgproc_misc + */ +CV_EXPORTS_W void watershed( InputArray image, InputOutputArray markers ); + +//! @addtogroup imgproc_filter +//! @{ + +/** @brief Performs initial step of meanshift segmentation of an image. + +The function implements the filtering stage of meanshift segmentation, that is, the output of the +function is the filtered "posterized" image with color gradients and fine-grain texture flattened. +At every pixel (X,Y) of the input image (or down-sized input image, see below) the function executes +meanshift iterations, that is, the pixel (X,Y) neighborhood in the joint space-color hyperspace is +considered: + +\f[(x,y): X- \texttt{sp} \le x \le X+ \texttt{sp} , Y- \texttt{sp} \le y \le Y+ \texttt{sp} , ||(R,G,B)-(r,g,b)|| \le \texttt{sr}\f] + +where (R,G,B) and (r,g,b) are the vectors of color components at (X,Y) and (x,y), respectively +(though, the algorithm does not depend on the color space used, so any 3-component color space can +be used instead). Over the neighborhood the average spatial value (X',Y') and average color vector +(R',G',B') are found and they act as the neighborhood center on the next iteration: + +\f[(X,Y)~(X',Y'), (R,G,B)~(R',G',B').\f] + +After the iterations over, the color components of the initial pixel (that is, the pixel from where +the iterations started) are set to the final value (average color at the last iteration): + +\f[I(X,Y) <- (R*,G*,B*)\f] + +When maxLevel \> 0, the gaussian pyramid of maxLevel+1 levels is built, and the above procedure is +run on the smallest layer first. After that, the results are propagated to the larger layer and the +iterations are run again only on those pixels where the layer colors differ by more than sr from the +lower-resolution layer of the pyramid. That makes boundaries of color regions sharper. Note that the +results will be actually different from the ones obtained by running the meanshift procedure on the +whole original image (i.e. when maxLevel==0). + +@param src The source 8-bit, 3-channel image. +@param dst The destination image of the same format and the same size as the source. +@param sp The spatial window radius. +@param sr The color window radius. +@param maxLevel Maximum level of the pyramid for the segmentation. +@param termcrit Termination criteria: when to stop meanshift iterations. + */ +CV_EXPORTS_W void pyrMeanShiftFiltering( InputArray src, OutputArray dst, + double sp, double sr, int maxLevel = 1, + TermCriteria termcrit=TermCriteria(TermCriteria::MAX_ITER+TermCriteria::EPS,5,1) ); + +//! @} + +//! @addtogroup imgproc_misc +//! @{ + +/** @example grabcut.cpp +An example using the GrabCut algorithm + */ + +/** @brief Runs the GrabCut algorithm. + +The function implements the [GrabCut image segmentation algorithm](http://en.wikipedia.org/wiki/GrabCut). + +@param img Input 8-bit 3-channel image. +@param mask Input/output 8-bit single-channel mask. The mask is initialized by the function when +mode is set to GC_INIT_WITH_RECT. Its elements may have one of the cv::GrabCutClasses. +@param rect ROI containing a segmented object. The pixels outside of the ROI are marked as +"obvious background". The parameter is only used when mode==GC_INIT_WITH_RECT . +@param bgdModel Temporary array for the background model. Do not modify it while you are +processing the same image. +@param fgdModel Temporary arrays for the foreground model. Do not modify it while you are +processing the same image. +@param iterCount Number of iterations the algorithm should make before returning the result. Note +that the result can be refined with further calls with mode==GC_INIT_WITH_MASK or +mode==GC_EVAL . +@param mode Operation mode that could be one of the cv::GrabCutModes + */ +CV_EXPORTS_W void grabCut( InputArray img, InputOutputArray mask, Rect rect, + InputOutputArray bgdModel, InputOutputArray fgdModel, + int iterCount, int mode = GC_EVAL ); + +/** @example distrans.cpp +An example on using the distance transform\ +*/ + + +/** @brief Calculates the distance to the closest zero pixel for each pixel of the source image. + +The functions distanceTransform calculate the approximate or precise distance from every binary +image pixel to the nearest zero pixel. For zero image pixels, the distance will obviously be zero. + +When maskSize == DIST_MASK_PRECISE and distanceType == DIST_L2 , the function runs the +algorithm described in @cite Felzenszwalb04 . This algorithm is parallelized with the TBB library. + +In other cases, the algorithm @cite Borgefors86 is used. This means that for a pixel the function +finds the shortest path to the nearest zero pixel consisting of basic shifts: horizontal, vertical, +diagonal, or knight's move (the latest is available for a \f$5\times 5\f$ mask). The overall +distance is calculated as a sum of these basic distances. Since the distance function should be +symmetric, all of the horizontal and vertical shifts must have the same cost (denoted as a ), all +the diagonal shifts must have the same cost (denoted as `b`), and all knight's moves must have the +same cost (denoted as `c`). For the cv::DIST_C and cv::DIST_L1 types, the distance is calculated +precisely, whereas for cv::DIST_L2 (Euclidean distance) the distance can be calculated only with a +relative error (a \f$5\times 5\f$ mask gives more accurate results). For `a`,`b`, and `c`, OpenCV +uses the values suggested in the original paper: +- DIST_L1: `a = 1, b = 2` +- DIST_L2: + - `3 x 3`: `a=0.955, b=1.3693` + - `5 x 5`: `a=1, b=1.4, c=2.1969` +- DIST_C: `a = 1, b = 1` + +Typically, for a fast, coarse distance estimation DIST_L2, a \f$3\times 3\f$ mask is used. For a +more accurate distance estimation DIST_L2, a \f$5\times 5\f$ mask or the precise algorithm is used. +Note that both the precise and the approximate algorithms are linear on the number of pixels. + +This variant of the function does not only compute the minimum distance for each pixel \f$(x, y)\f$ +but also identifies the nearest connected component consisting of zero pixels +(labelType==DIST_LABEL_CCOMP) or the nearest zero pixel (labelType==DIST_LABEL_PIXEL). Index of the +component/pixel is stored in `labels(x, y)`. When labelType==DIST_LABEL_CCOMP, the function +automatically finds connected components of zero pixels in the input image and marks them with +distinct labels. When labelType==DIST_LABEL_CCOMP, the function scans through the input image and +marks all the zero pixels with distinct labels. + +In this mode, the complexity is still linear. That is, the function provides a very fast way to +compute the Voronoi diagram for a binary image. Currently, the second variant can use only the +approximate distance transform algorithm, i.e. maskSize=DIST_MASK_PRECISE is not supported +yet. + +@param src 8-bit, single-channel (binary) source image. +@param dst Output image with calculated distances. It is a 8-bit or 32-bit floating-point, +single-channel image of the same size as src. +@param labels Output 2D array of labels (the discrete Voronoi diagram). It has the type +CV_32SC1 and the same size as src. +@param distanceType Type of distance, see cv::DistanceTypes +@param maskSize Size of the distance transform mask, see cv::DistanceTransformMasks. +DIST_MASK_PRECISE is not supported by this variant. In case of the DIST_L1 or DIST_C distance type, +the parameter is forced to 3 because a \f$3\times 3\f$ mask gives the same result as \f$5\times +5\f$ or any larger aperture. +@param labelType Type of the label array to build, see cv::DistanceTransformLabelTypes. + */ +CV_EXPORTS_AS(distanceTransformWithLabels) void distanceTransform( InputArray src, OutputArray dst, + OutputArray labels, int distanceType, int maskSize, + int labelType = DIST_LABEL_CCOMP ); + +/** @overload +@param src 8-bit, single-channel (binary) source image. +@param dst Output image with calculated distances. It is a 8-bit or 32-bit floating-point, +single-channel image of the same size as src . +@param distanceType Type of distance, see cv::DistanceTypes +@param maskSize Size of the distance transform mask, see cv::DistanceTransformMasks. In case of the +DIST_L1 or DIST_C distance type, the parameter is forced to 3 because a \f$3\times 3\f$ mask gives +the same result as \f$5\times 5\f$ or any larger aperture. +@param dstType Type of output image. It can be CV_8U or CV_32F. Type CV_8U can be used only for +the first variant of the function and distanceType == DIST_L1. +*/ +CV_EXPORTS_W void distanceTransform( InputArray src, OutputArray dst, + int distanceType, int maskSize, int dstType=CV_32F); + +/** @example ffilldemo.cpp + An example using the FloodFill technique +*/ + +/** @overload + +variant without `mask` parameter +*/ +CV_EXPORTS int floodFill( InputOutputArray image, + Point seedPoint, Scalar newVal, CV_OUT Rect* rect = 0, + Scalar loDiff = Scalar(), Scalar upDiff = Scalar(), + int flags = 4 ); + +/** @brief Fills a connected component with the given color. + +The functions floodFill fill a connected component starting from the seed point with the specified +color. The connectivity is determined by the color/brightness closeness of the neighbor pixels. The +pixel at \f$(x,y)\f$ is considered to belong to the repainted domain if: + +- in case of a grayscale image and floating range +\f[\texttt{src} (x',y')- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} (x',y')+ \texttt{upDiff}\f] + + +- in case of a grayscale image and fixed range +\f[\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)+ \texttt{upDiff}\f] + + +- in case of a color image and floating range +\f[\texttt{src} (x',y')_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} (x',y')_r+ \texttt{upDiff} _r,\f] +\f[\texttt{src} (x',y')_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} (x',y')_g+ \texttt{upDiff} _g\f] +and +\f[\texttt{src} (x',y')_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} (x',y')_b+ \texttt{upDiff} _b\f] + + +- in case of a color image and fixed range +\f[\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r+ \texttt{upDiff} _r,\f] +\f[\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g+ \texttt{upDiff} _g\f] +and +\f[\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b+ \texttt{upDiff} _b\f] + + +where \f$src(x',y')\f$ is the value of one of pixel neighbors that is already known to belong to the +component. That is, to be added to the connected component, a color/brightness of the pixel should +be close enough to: +- Color/brightness of one of its neighbors that already belong to the connected component in case +of a floating range. +- Color/brightness of the seed point in case of a fixed range. + +Use these functions to either mark a connected component with the specified color in-place, or build +a mask and then extract the contour, or copy the region to another image, and so on. + +@param image Input/output 1- or 3-channel, 8-bit, or floating-point image. It is modified by the +function unless the FLOODFILL_MASK_ONLY flag is set in the second variant of the function. See +the details below. +@param mask Operation mask that should be a single-channel 8-bit image, 2 pixels wider and 2 pixels +taller than image. Since this is both an input and output parameter, you must take responsibility +of initializing it. Flood-filling cannot go across non-zero pixels in the input mask. For example, +an edge detector output can be used as a mask to stop filling at edges. On output, pixels in the +mask corresponding to filled pixels in the image are set to 1 or to the a value specified in flags +as described below. It is therefore possible to use the same mask in multiple calls to the function +to make sure the filled areas do not overlap. +@param seedPoint Starting point. +@param newVal New value of the repainted domain pixels. +@param loDiff Maximal lower brightness/color difference between the currently observed pixel and +one of its neighbors belonging to the component, or a seed pixel being added to the component. +@param upDiff Maximal upper brightness/color difference between the currently observed pixel and +one of its neighbors belonging to the component, or a seed pixel being added to the component. +@param rect Optional output parameter set by the function to the minimum bounding rectangle of the +repainted domain. +@param flags Operation flags. The first 8 bits contain a connectivity value. The default value of +4 means that only the four nearest neighbor pixels (those that share an edge) are considered. A +connectivity value of 8 means that the eight nearest neighbor pixels (those that share a corner) +will be considered. The next 8 bits (8-16) contain a value between 1 and 255 with which to fill +the mask (the default value is 1). For example, 4 | ( 255 \<\< 8 ) will consider 4 nearest +neighbours and fill the mask with a value of 255. The following additional options occupy higher +bits and therefore may be further combined with the connectivity and mask fill values using +bit-wise or (|), see cv::FloodFillFlags. + +@note Since the mask is larger than the filled image, a pixel \f$(x, y)\f$ in image corresponds to the +pixel \f$(x+1, y+1)\f$ in the mask . + +@sa findContours + */ +CV_EXPORTS_W int floodFill( InputOutputArray image, InputOutputArray mask, + Point seedPoint, Scalar newVal, CV_OUT Rect* rect=0, + Scalar loDiff = Scalar(), Scalar upDiff = Scalar(), + int flags = 4 ); + +/** @brief Converts an image from one color space to another. + +The function converts an input image from one color space to another. In case of a transformation +to-from RGB color space, the order of the channels should be specified explicitly (RGB or BGR). Note +that the default color format in OpenCV is often referred to as RGB but it is actually BGR (the +bytes are reversed). So the first byte in a standard (24-bit) color image will be an 8-bit Blue +component, the second byte will be Green, and the third byte will be Red. The fourth, fifth, and +sixth bytes would then be the second pixel (Blue, then Green, then Red), and so on. + +The conventional ranges for R, G, and B channel values are: +- 0 to 255 for CV_8U images +- 0 to 65535 for CV_16U images +- 0 to 1 for CV_32F images + +In case of linear transformations, the range does not matter. But in case of a non-linear +transformation, an input RGB image should be normalized to the proper value range to get the correct +results, for example, for RGB \f$\rightarrow\f$ L\*u\*v\* transformation. For example, if you have a +32-bit floating-point image directly converted from an 8-bit image without any scaling, then it will +have the 0..255 value range instead of 0..1 assumed by the function. So, before calling cvtColor , +you need first to scale the image down: +@code + img *= 1./255; + cvtColor(img, img, COLOR_BGR2Luv); +@endcode +If you use cvtColor with 8-bit images, the conversion will have some information lost. For many +applications, this will not be noticeable but it is recommended to use 32-bit images in applications +that need the full range of colors or that convert an image before an operation and then convert +back. + +If conversion adds the alpha channel, its value will set to the maximum of corresponding channel +range: 255 for CV_8U, 65535 for CV_16U, 1 for CV_32F. + +@param src input image: 8-bit unsigned, 16-bit unsigned ( CV_16UC... ), or single-precision +floating-point. +@param dst output image of the same size and depth as src. +@param code color space conversion code (see cv::ColorConversionCodes). +@param dstCn number of channels in the destination image; if the parameter is 0, the number of the +channels is derived automatically from src and code. + +@see @ref imgproc_color_conversions + */ +CV_EXPORTS_W void cvtColor( InputArray src, OutputArray dst, int code, int dstCn = 0 ); + +//! @} imgproc_misc + +// main function for all demosaicing procceses +CV_EXPORTS_W void demosaicing(InputArray _src, OutputArray _dst, int code, int dcn = 0); + +//! @addtogroup imgproc_shape +//! @{ + +/** @brief Calculates all of the moments up to the third order of a polygon or rasterized shape. + +The function computes moments, up to the 3rd order, of a vector shape or a rasterized shape. The +results are returned in the structure cv::Moments. + +@param array Raster image (single-channel, 8-bit or floating-point 2D array) or an array ( +\f$1 \times N\f$ or \f$N \times 1\f$ ) of 2D points (Point or Point2f ). +@param binaryImage If it is true, all non-zero image pixels are treated as 1's. The parameter is +used for images only. +@returns moments. + +@sa contourArea, arcLength + */ +CV_EXPORTS_W Moments moments( InputArray array, bool binaryImage = false ); + +/** @brief Calculates seven Hu invariants. + +The function calculates seven Hu invariants (introduced in @cite Hu62; see also +) defined as: + +\f[\begin{array}{l} hu[0]= \eta _{20}+ \eta _{02} \\ hu[1]=( \eta _{20}- \eta _{02})^{2}+4 \eta _{11}^{2} \\ hu[2]=( \eta _{30}-3 \eta _{12})^{2}+ (3 \eta _{21}- \eta _{03})^{2} \\ hu[3]=( \eta _{30}+ \eta _{12})^{2}+ ( \eta _{21}+ \eta _{03})^{2} \\ hu[4]=( \eta _{30}-3 \eta _{12})( \eta _{30}+ \eta _{12})[( \eta _{30}+ \eta _{12})^{2}-3( \eta _{21}+ \eta _{03})^{2}]+(3 \eta _{21}- \eta _{03})( \eta _{21}+ \eta _{03})[3( \eta _{30}+ \eta _{12})^{2}-( \eta _{21}+ \eta _{03})^{2}] \\ hu[5]=( \eta _{20}- \eta _{02})[( \eta _{30}+ \eta _{12})^{2}- ( \eta _{21}+ \eta _{03})^{2}]+4 \eta _{11}( \eta _{30}+ \eta _{12})( \eta _{21}+ \eta _{03}) \\ hu[6]=(3 \eta _{21}- \eta _{03})( \eta _{21}+ \eta _{03})[3( \eta _{30}+ \eta _{12})^{2}-( \eta _{21}+ \eta _{03})^{2}]-( \eta _{30}-3 \eta _{12})( \eta _{21}+ \eta _{03})[3( \eta _{30}+ \eta _{12})^{2}-( \eta _{21}+ \eta _{03})^{2}] \\ \end{array}\f] + +where \f$\eta_{ji}\f$ stands for \f$\texttt{Moments::nu}_{ji}\f$ . + +These values are proved to be invariants to the image scale, rotation, and reflection except the +seventh one, whose sign is changed by reflection. This invariance is proved with the assumption of +infinite image resolution. In case of raster images, the computed Hu invariants for the original and +transformed images are a bit different. + +@param moments Input moments computed with moments . +@param hu Output Hu invariants. + +@sa matchShapes + */ +CV_EXPORTS void HuMoments( const Moments& moments, double hu[7] ); + +/** @overload */ +CV_EXPORTS_W void HuMoments( const Moments& m, OutputArray hu ); + +//! @} imgproc_shape + +//! @addtogroup imgproc_object +//! @{ + +//! type of the template matching operation +enum TemplateMatchModes { + TM_SQDIFF = 0, //!< \f[R(x,y)= \sum _{x',y'} (T(x',y')-I(x+x',y+y'))^2\f] + TM_SQDIFF_NORMED = 1, //!< \f[R(x,y)= \frac{\sum_{x',y'} (T(x',y')-I(x+x',y+y'))^2}{\sqrt{\sum_{x',y'}T(x',y')^2 \cdot \sum_{x',y'} I(x+x',y+y')^2}}\f] + TM_CCORR = 2, //!< \f[R(x,y)= \sum _{x',y'} (T(x',y') \cdot I(x+x',y+y'))\f] + TM_CCORR_NORMED = 3, //!< \f[R(x,y)= \frac{\sum_{x',y'} (T(x',y') \cdot I(x+x',y+y'))}{\sqrt{\sum_{x',y'}T(x',y')^2 \cdot \sum_{x',y'} I(x+x',y+y')^2}}\f] + TM_CCOEFF = 4, //!< \f[R(x,y)= \sum _{x',y'} (T'(x',y') \cdot I'(x+x',y+y'))\f] + //!< where + //!< \f[\begin{array}{l} T'(x',y')=T(x',y') - 1/(w \cdot h) \cdot \sum _{x'',y''} T(x'',y'') \\ I'(x+x',y+y')=I(x+x',y+y') - 1/(w \cdot h) \cdot \sum _{x'',y''} I(x+x'',y+y'') \end{array}\f] + TM_CCOEFF_NORMED = 5 //!< \f[R(x,y)= \frac{ \sum_{x',y'} (T'(x',y') \cdot I'(x+x',y+y')) }{ \sqrt{\sum_{x',y'}T'(x',y')^2 \cdot \sum_{x',y'} I'(x+x',y+y')^2} }\f] +}; + +/** @brief Compares a template against overlapped image regions. + +The function slides through image , compares the overlapped patches of size \f$w \times h\f$ against +templ using the specified method and stores the comparison results in result . Here are the formulae +for the available comparison methods ( \f$I\f$ denotes image, \f$T\f$ template, \f$R\f$ result ). The summation +is done over template and/or the image patch: \f$x' = 0...w-1, y' = 0...h-1\f$ + +After the function finishes the comparison, the best matches can be found as global minimums (when +TM_SQDIFF was used) or maximums (when TM_CCORR or TM_CCOEFF was used) using the +minMaxLoc function. In case of a color image, template summation in the numerator and each sum in +the denominator is done over all of the channels and separate mean values are used for each channel. +That is, the function can take a color template and a color image. The result will still be a +single-channel image, which is easier to analyze. + +@param image Image where the search is running. It must be 8-bit or 32-bit floating-point. +@param templ Searched template. It must be not greater than the source image and have the same +data type. +@param result Map of comparison results. It must be single-channel 32-bit floating-point. If image +is \f$W \times H\f$ and templ is \f$w \times h\f$ , then result is \f$(W-w+1) \times (H-h+1)\f$ . +@param method Parameter specifying the comparison method, see cv::TemplateMatchModes +@param mask Mask of searched template. It must have the same datatype and size with templ. It is +not set by default. + */ +CV_EXPORTS_W void matchTemplate( InputArray image, InputArray templ, + OutputArray result, int method, InputArray mask = noArray() ); + +//! @} + +//! @addtogroup imgproc_shape +//! @{ + +/** @brief computes the connected components labeled image of boolean image + +image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0 +represents the background label. ltype specifies the output label image type, an important +consideration based on the total number of labels or alternatively the total number of pixels in +the source image. + +@param image the 8-bit single-channel image to be labeled +@param labels destination labeled image +@param connectivity 8 or 4 for 8-way or 4-way connectivity respectively +@param ltype output image label type. Currently CV_32S and CV_16U are supported. + */ +CV_EXPORTS_W int connectedComponents(InputArray image, OutputArray labels, + int connectivity = 8, int ltype = CV_32S); + +/** @overload +@param image the 8-bit single-channel image to be labeled +@param labels destination labeled image +@param stats statistics output for each label, including the background label, see below for +available statistics. Statistics are accessed via stats(label, COLUMN) where COLUMN is one of +cv::ConnectedComponentsTypes. The data type is CV_32S. +@param centroids centroid output for each label, including the background label. Centroids are +accessed via centroids(label, 0) for x and centroids(label, 1) for y. The data type CV_64F. +@param connectivity 8 or 4 for 8-way or 4-way connectivity respectively +@param ltype output image label type. Currently CV_32S and CV_16U are supported. +*/ +CV_EXPORTS_W int connectedComponentsWithStats(InputArray image, OutputArray labels, + OutputArray stats, OutputArray centroids, + int connectivity = 8, int ltype = CV_32S); + + +/** @brief Finds contours in a binary image. + +The function retrieves contours from the binary image using the algorithm @cite Suzuki85 . The contours +are a useful tool for shape analysis and object detection and recognition. See squares.c in the +OpenCV sample directory. + +@note Source image is modified by this function. Also, the function does not take into account +1-pixel border of the image (it's filled with 0's and used for neighbor analysis in the algorithm), +therefore the contours touching the image border will be clipped. + +@param image Source, an 8-bit single-channel image. Non-zero pixels are treated as 1's. Zero +pixels remain 0's, so the image is treated as binary . You can use compare , inRange , threshold , +adaptiveThreshold , Canny , and others to create a binary image out of a grayscale or color one. +The function modifies the image while extracting the contours. If mode equals to RETR_CCOMP +or RETR_FLOODFILL, the input can also be a 32-bit integer image of labels (CV_32SC1). +@param contours Detected contours. Each contour is stored as a vector of points. +@param hierarchy Optional output vector, containing information about the image topology. It has +as many elements as the number of contours. For each i-th contour contours[i] , the elements +hierarchy[i][0] , hiearchy[i][1] , hiearchy[i][2] , and hiearchy[i][3] are set to 0-based indices +in contours of the next and previous contours at the same hierarchical level, the first child +contour and the parent contour, respectively. If for the contour i there are no next, previous, +parent, or nested contours, the corresponding elements of hierarchy[i] will be negative. +@param mode Contour retrieval mode, see cv::RetrievalModes +@param method Contour approximation method, see cv::ContourApproximationModes +@param offset Optional offset by which every contour point is shifted. This is useful if the +contours are extracted from the image ROI and then they should be analyzed in the whole image +context. + */ +CV_EXPORTS_W void findContours( InputOutputArray image, OutputArrayOfArrays contours, + OutputArray hierarchy, int mode, + int method, Point offset = Point()); + +/** @overload */ +CV_EXPORTS void findContours( InputOutputArray image, OutputArrayOfArrays contours, + int mode, int method, Point offset = Point()); + +/** @brief Approximates a polygonal curve(s) with the specified precision. + +The functions approxPolyDP approximate a curve or a polygon with another curve/polygon with less +vertices so that the distance between them is less or equal to the specified precision. It uses the +Douglas-Peucker algorithm + +@param curve Input vector of a 2D point stored in std::vector or Mat +@param approxCurve Result of the approximation. The type should match the type of the input curve. +@param epsilon Parameter specifying the approximation accuracy. This is the maximum distance +between the original curve and its approximation. +@param closed If true, the approximated curve is closed (its first and last vertices are +connected). Otherwise, it is not closed. + */ +CV_EXPORTS_W void approxPolyDP( InputArray curve, + OutputArray approxCurve, + double epsilon, bool closed ); + +/** @brief Calculates a contour perimeter or a curve length. + +The function computes a curve length or a closed contour perimeter. + +@param curve Input vector of 2D points, stored in std::vector or Mat. +@param closed Flag indicating whether the curve is closed or not. + */ +CV_EXPORTS_W double arcLength( InputArray curve, bool closed ); + +/** @brief Calculates the up-right bounding rectangle of a point set. + +The function calculates and returns the minimal up-right bounding rectangle for the specified point set. + +@param points Input 2D point set, stored in std::vector or Mat. + */ +CV_EXPORTS_W Rect boundingRect( InputArray points ); + +/** @brief Calculates a contour area. + +The function computes a contour area. Similarly to moments , the area is computed using the Green +formula. Thus, the returned area and the number of non-zero pixels, if you draw the contour using +drawContours or fillPoly , can be different. Also, the function will most certainly give a wrong +results for contours with self-intersections. + +Example: +@code + vector contour; + contour.push_back(Point2f(0, 0)); + contour.push_back(Point2f(10, 0)); + contour.push_back(Point2f(10, 10)); + contour.push_back(Point2f(5, 4)); + + double area0 = contourArea(contour); + vector approx; + approxPolyDP(contour, approx, 5, true); + double area1 = contourArea(approx); + + cout << "area0 =" << area0 << endl << + "area1 =" << area1 << endl << + "approx poly vertices" << approx.size() << endl; +@endcode +@param contour Input vector of 2D points (contour vertices), stored in std::vector or Mat. +@param oriented Oriented area flag. If it is true, the function returns a signed area value, +depending on the contour orientation (clockwise or counter-clockwise). Using this feature you can +determine orientation of a contour by taking the sign of an area. By default, the parameter is +false, which means that the absolute value is returned. + */ +CV_EXPORTS_W double contourArea( InputArray contour, bool oriented = false ); + +/** @brief Finds a rotated rectangle of the minimum area enclosing the input 2D point set. + +The function calculates and returns the minimum-area bounding rectangle (possibly rotated) for a +specified point set. See the OpenCV sample minarea.cpp . Developer should keep in mind that the +returned rotatedRect can contain negative indices when data is close to the containing Mat element +boundary. + +@param points Input vector of 2D points, stored in std::vector\<\> or Mat + */ +CV_EXPORTS_W RotatedRect minAreaRect( InputArray points ); + +/** @brief Finds the four vertices of a rotated rect. Useful to draw the rotated rectangle. + +The function finds the four vertices of a rotated rectangle. This function is useful to draw the +rectangle. In C++, instead of using this function, you can directly use box.points() method. Please +visit the [tutorial on bounding +rectangle](http://docs.opencv.org/doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.html#bounding-rects-circles) +for more information. + +@param box The input rotated rectangle. It may be the output of +@param points The output array of four vertices of rectangles. + */ +CV_EXPORTS_W void boxPoints(RotatedRect box, OutputArray points); + +/** @brief Finds a circle of the minimum area enclosing a 2D point set. + +The function finds the minimal enclosing circle of a 2D point set using an iterative algorithm. See +the OpenCV sample minarea.cpp . + +@param points Input vector of 2D points, stored in std::vector\<\> or Mat +@param center Output center of the circle. +@param radius Output radius of the circle. + */ +CV_EXPORTS_W void minEnclosingCircle( InputArray points, + CV_OUT Point2f& center, CV_OUT float& radius ); + +/** @example minarea.cpp + */ + +/** @brief Finds a triangle of minimum area enclosing a 2D point set and returns its area. + +The function finds a triangle of minimum area enclosing the given set of 2D points and returns its +area. The output for a given 2D point set is shown in the image below. 2D points are depicted in +*red* and the enclosing triangle in *yellow*. + +![Sample output of the minimum enclosing triangle function](pics/minenclosingtriangle.png) + +The implementation of the algorithm is based on O'Rourke's @cite ORourke86 and Klee and Laskowski's +@cite KleeLaskowski85 papers. O'Rourke provides a \f$\theta(n)\f$ algorithm for finding the minimal +enclosing triangle of a 2D convex polygon with n vertices. Since the minEnclosingTriangle function +takes a 2D point set as input an additional preprocessing step of computing the convex hull of the +2D point set is required. The complexity of the convexHull function is \f$O(n log(n))\f$ which is higher +than \f$\theta(n)\f$. Thus the overall complexity of the function is \f$O(n log(n))\f$. + +@param points Input vector of 2D points with depth CV_32S or CV_32F, stored in std::vector\<\> or Mat +@param triangle Output vector of three 2D points defining the vertices of the triangle. The depth +of the OutputArray must be CV_32F. + */ +CV_EXPORTS_W double minEnclosingTriangle( InputArray points, CV_OUT OutputArray triangle ); + +/** @brief Compares two shapes. + +The function compares two shapes. All three implemented methods use the Hu invariants (see cv::HuMoments) + +@param contour1 First contour or grayscale image. +@param contour2 Second contour or grayscale image. +@param method Comparison method, see ::ShapeMatchModes +@param parameter Method-specific parameter (not supported now). + */ +CV_EXPORTS_W double matchShapes( InputArray contour1, InputArray contour2, + int method, double parameter ); + +/** @example convexhull.cpp +An example using the convexHull functionality +*/ + +/** @brief Finds the convex hull of a point set. + +The functions find the convex hull of a 2D point set using the Sklansky's algorithm @cite Sklansky82 +that has *O(N logN)* complexity in the current implementation. See the OpenCV sample convexhull.cpp +that demonstrates the usage of different function variants. + +@param points Input 2D point set, stored in std::vector or Mat. +@param hull Output convex hull. It is either an integer vector of indices or vector of points. In +the first case, the hull elements are 0-based indices of the convex hull points in the original +array (since the set of convex hull points is a subset of the original point set). In the second +case, hull elements are the convex hull points themselves. +@param clockwise Orientation flag. If it is true, the output convex hull is oriented clockwise. +Otherwise, it is oriented counter-clockwise. The assumed coordinate system has its X axis pointing +to the right, and its Y axis pointing upwards. +@param returnPoints Operation flag. In case of a matrix, when the flag is true, the function +returns convex hull points. Otherwise, it returns indices of the convex hull points. When the +output array is std::vector, the flag is ignored, and the output depends on the type of the +vector: std::vector\ implies returnPoints=true, std::vector\ implies +returnPoints=false. + */ +CV_EXPORTS_W void convexHull( InputArray points, OutputArray hull, + bool clockwise = false, bool returnPoints = true ); + +/** @brief Finds the convexity defects of a contour. + +The figure below displays convexity defects of a hand contour: + +![image](pics/defects.png) + +@param contour Input contour. +@param convexhull Convex hull obtained using convexHull that should contain indices of the contour +points that make the hull. +@param convexityDefects The output vector of convexity defects. In C++ and the new Python/Java +interface each convexity defect is represented as 4-element integer vector (a.k.a. cv::Vec4i): +(start_index, end_index, farthest_pt_index, fixpt_depth), where indices are 0-based indices +in the original contour of the convexity defect beginning, end and the farthest point, and +fixpt_depth is fixed-point approximation (with 8 fractional bits) of the distance between the +farthest contour point and the hull. That is, to get the floating-point value of the depth will be +fixpt_depth/256.0. + */ +CV_EXPORTS_W void convexityDefects( InputArray contour, InputArray convexhull, OutputArray convexityDefects ); + +/** @brief Tests a contour convexity. + +The function tests whether the input contour is convex or not. The contour must be simple, that is, +without self-intersections. Otherwise, the function output is undefined. + +@param contour Input vector of 2D points, stored in std::vector\<\> or Mat + */ +CV_EXPORTS_W bool isContourConvex( InputArray contour ); + +//! finds intersection of two convex polygons +CV_EXPORTS_W float intersectConvexConvex( InputArray _p1, InputArray _p2, + OutputArray _p12, bool handleNested = true ); + +/** @example fitellipse.cpp + An example using the fitEllipse technique +*/ + +/** @brief Fits an ellipse around a set of 2D points. + +The function calculates the ellipse that fits (in a least-squares sense) a set of 2D points best of +all. It returns the rotated rectangle in which the ellipse is inscribed. The first algorithm described by @cite Fitzgibbon95 +is used. Developer should keep in mind that it is possible that the returned +ellipse/rotatedRect data contains negative indices, due to the data points being close to the +border of the containing Mat element. + +@param points Input 2D point set, stored in std::vector\<\> or Mat + */ +CV_EXPORTS_W RotatedRect fitEllipse( InputArray points ); + +/** @brief Fits a line to a 2D or 3D point set. + +The function fitLine fits a line to a 2D or 3D point set by minimizing \f$\sum_i \rho(r_i)\f$ where +\f$r_i\f$ is a distance between the \f$i^{th}\f$ point, the line and \f$\rho(r)\f$ is a distance function, one +of the following: +- DIST_L2 +\f[\rho (r) = r^2/2 \quad \text{(the simplest and the fastest least-squares method)}\f] +- DIST_L1 +\f[\rho (r) = r\f] +- DIST_L12 +\f[\rho (r) = 2 \cdot ( \sqrt{1 + \frac{r^2}{2}} - 1)\f] +- DIST_FAIR +\f[\rho \left (r \right ) = C^2 \cdot \left ( \frac{r}{C} - \log{\left(1 + \frac{r}{C}\right)} \right ) \quad \text{where} \quad C=1.3998\f] +- DIST_WELSCH +\f[\rho \left (r \right ) = \frac{C^2}{2} \cdot \left ( 1 - \exp{\left(-\left(\frac{r}{C}\right)^2\right)} \right ) \quad \text{where} \quad C=2.9846\f] +- DIST_HUBER +\f[\rho (r) = \fork{r^2/2}{if \(r < C\)}{C \cdot (r-C/2)}{otherwise} \quad \text{where} \quad C=1.345\f] + +The algorithm is based on the M-estimator ( ) technique +that iteratively fits the line using the weighted least-squares algorithm. After each iteration the +weights \f$w_i\f$ are adjusted to be inversely proportional to \f$\rho(r_i)\f$ . + +@param points Input vector of 2D or 3D points, stored in std::vector\<\> or Mat. +@param line Output line parameters. In case of 2D fitting, it should be a vector of 4 elements +(like Vec4f) - (vx, vy, x0, y0), where (vx, vy) is a normalized vector collinear to the line and +(x0, y0) is a point on the line. In case of 3D fitting, it should be a vector of 6 elements (like +Vec6f) - (vx, vy, vz, x0, y0, z0), where (vx, vy, vz) is a normalized vector collinear to the line +and (x0, y0, z0) is a point on the line. +@param distType Distance used by the M-estimator, see cv::DistanceTypes +@param param Numerical parameter ( C ) for some types of distances. If it is 0, an optimal value +is chosen. +@param reps Sufficient accuracy for the radius (distance between the coordinate origin and the line). +@param aeps Sufficient accuracy for the angle. 0.01 would be a good default value for reps and aeps. + */ +CV_EXPORTS_W void fitLine( InputArray points, OutputArray line, int distType, + double param, double reps, double aeps ); + +/** @brief Performs a point-in-contour test. + +The function determines whether the point is inside a contour, outside, or lies on an edge (or +coincides with a vertex). It returns positive (inside), negative (outside), or zero (on an edge) +value, correspondingly. When measureDist=false , the return value is +1, -1, and 0, respectively. +Otherwise, the return value is a signed distance between the point and the nearest contour edge. + +See below a sample output of the function where each image pixel is tested against the contour: + +![sample output](pics/pointpolygon.png) + +@param contour Input contour. +@param pt Point tested against the contour. +@param measureDist If true, the function estimates the signed distance from the point to the +nearest contour edge. Otherwise, the function only checks if the point is inside a contour or not. + */ +CV_EXPORTS_W double pointPolygonTest( InputArray contour, Point2f pt, bool measureDist ); + +/** @brief Finds out if there is any intersection between two rotated rectangles. + +If there is then the vertices of the interesecting region are returned as well. + +Below are some examples of intersection configurations. The hatched pattern indicates the +intersecting region and the red vertices are returned by the function. + +![intersection examples](pics/intersection.png) + +@param rect1 First rectangle +@param rect2 Second rectangle +@param intersectingRegion The output array of the verticies of the intersecting region. It returns +at most 8 vertices. Stored as std::vector\ or cv::Mat as Mx1 of type CV_32FC2. +@returns One of cv::RectanglesIntersectTypes + */ +CV_EXPORTS_W int rotatedRectangleIntersection( const RotatedRect& rect1, const RotatedRect& rect2, OutputArray intersectingRegion ); + +//! @} imgproc_shape + +CV_EXPORTS_W Ptr createCLAHE(double clipLimit = 40.0, Size tileGridSize = Size(8, 8)); + +//! Ballard, D.H. (1981). Generalizing the Hough transform to detect arbitrary shapes. Pattern Recognition 13 (2): 111-122. +//! Detects position only without traslation and rotation +CV_EXPORTS Ptr createGeneralizedHoughBallard(); + +//! Guil, N., González-Linares, J.M. and Zapata, E.L. (1999). Bidimensional shape detection using an invariant approach. Pattern Recognition 32 (6): 1025-1038. +//! Detects position, traslation and rotation +CV_EXPORTS Ptr createGeneralizedHoughGuil(); + +//! Performs linear blending of two images +CV_EXPORTS void blendLinear(InputArray src1, InputArray src2, InputArray weights1, InputArray weights2, OutputArray dst); + +//! @addtogroup imgproc_colormap +//! @{ + +//! GNU Octave/MATLAB equivalent colormaps +enum ColormapTypes +{ + COLORMAP_AUTUMN = 0, //!< ![autumn](pics/colormaps/colorscale_autumn.jpg) + COLORMAP_BONE = 1, //!< ![bone](pics/colormaps/colorscale_bone.jpg) + COLORMAP_JET = 2, //!< ![jet](pics/colormaps/colorscale_jet.jpg) + COLORMAP_WINTER = 3, //!< ![winter](pics/colormaps/colorscale_winter.jpg) + COLORMAP_RAINBOW = 4, //!< ![rainbow](pics/colormaps/colorscale_rainbow.jpg) + COLORMAP_OCEAN = 5, //!< ![ocean](pics/colormaps/colorscale_ocean.jpg) + COLORMAP_SUMMER = 6, //!< ![summer](pics/colormaps/colorscale_summer.jpg) + COLORMAP_SPRING = 7, //!< ![spring](pics/colormaps/colorscale_spring.jpg) + COLORMAP_COOL = 8, //!< ![cool](pics/colormaps/colorscale_cool.jpg) + COLORMAP_HSV = 9, //!< ![HSV](pics/colormaps/colorscale_hsv.jpg) + COLORMAP_PINK = 10, //!< ![pink](pics/colormaps/colorscale_pink.jpg) + COLORMAP_HOT = 11, //!< ![hot](pics/colormaps/colorscale_hot.jpg) + COLORMAP_PARULA = 12 //!< ![parula](pics/colormaps/colorscale_parula.jpg) +}; + +/** @brief Applies a GNU Octave/MATLAB equivalent colormap on a given image. + +@param src The source image, grayscale or colored does not matter. +@param dst The result is the colormapped source image. Note: Mat::create is called on dst. +@param colormap The colormap to apply, see cv::ColormapTypes + */ +CV_EXPORTS_W void applyColorMap(InputArray src, OutputArray dst, int colormap); + +//! @} imgproc_colormap + +//! @addtogroup imgproc_draw +//! @{ + +/** @brief Draws a line segment connecting two points. + +The function line draws the line segment between pt1 and pt2 points in the image. The line is +clipped by the image boundaries. For non-antialiased lines with integer coordinates, the 8-connected +or 4-connected Bresenham algorithm is used. Thick lines are drawn with rounding endings. Antialiased +lines are drawn using Gaussian filtering. + +@param img Image. +@param pt1 First point of the line segment. +@param pt2 Second point of the line segment. +@param color Line color. +@param thickness Line thickness. +@param lineType Type of the line, see cv::LineTypes. +@param shift Number of fractional bits in the point coordinates. + */ +CV_EXPORTS_W void line(InputOutputArray img, Point pt1, Point pt2, const Scalar& color, + int thickness = 1, int lineType = LINE_8, int shift = 0); + +/** @brief Draws a arrow segment pointing from the first point to the second one. + +The function arrowedLine draws an arrow between pt1 and pt2 points in the image. See also cv::line. + +@param img Image. +@param pt1 The point the arrow starts from. +@param pt2 The point the arrow points to. +@param color Line color. +@param thickness Line thickness. +@param line_type Type of the line, see cv::LineTypes +@param shift Number of fractional bits in the point coordinates. +@param tipLength The length of the arrow tip in relation to the arrow length + */ +CV_EXPORTS_W void arrowedLine(InputOutputArray img, Point pt1, Point pt2, const Scalar& color, + int thickness=1, int line_type=8, int shift=0, double tipLength=0.1); + +/** @brief Draws a simple, thick, or filled up-right rectangle. + +The function rectangle draws a rectangle outline or a filled rectangle whose two opposite corners +are pt1 and pt2. + +@param img Image. +@param pt1 Vertex of the rectangle. +@param pt2 Vertex of the rectangle opposite to pt1 . +@param color Rectangle color or brightness (grayscale image). +@param thickness Thickness of lines that make up the rectangle. Negative values, like CV_FILLED , +mean that the function has to draw a filled rectangle. +@param lineType Type of the line. See the line description. +@param shift Number of fractional bits in the point coordinates. + */ +CV_EXPORTS_W void rectangle(InputOutputArray img, Point pt1, Point pt2, + const Scalar& color, int thickness = 1, + int lineType = LINE_8, int shift = 0); + +/** @overload + +use `rec` parameter as alternative specification of the drawn rectangle: `r.tl() and +r.br()-Point(1,1)` are opposite corners +*/ +CV_EXPORTS void rectangle(CV_IN_OUT Mat& img, Rect rec, + const Scalar& color, int thickness = 1, + int lineType = LINE_8, int shift = 0); + +/** @brief Draws a circle. + +The function circle draws a simple or filled circle with a given center and radius. +@param img Image where the circle is drawn. +@param center Center of the circle. +@param radius Radius of the circle. +@param color Circle color. +@param thickness Thickness of the circle outline, if positive. Negative thickness means that a +filled circle is to be drawn. +@param lineType Type of the circle boundary. See the line description. +@param shift Number of fractional bits in the coordinates of the center and in the radius value. + */ +CV_EXPORTS_W void circle(InputOutputArray img, Point center, int radius, + const Scalar& color, int thickness = 1, + int lineType = LINE_8, int shift = 0); + +/** @brief Draws a simple or thick elliptic arc or fills an ellipse sector. + +The functions ellipse with less parameters draw an ellipse outline, a filled ellipse, an elliptic +arc, or a filled ellipse sector. A piecewise-linear curve is used to approximate the elliptic arc +boundary. If you need more control of the ellipse rendering, you can retrieve the curve using +ellipse2Poly and then render it with polylines or fill it with fillPoly . If you use the first +variant of the function and want to draw the whole ellipse, not an arc, pass startAngle=0 and +endAngle=360 . The figure below explains the meaning of the parameters. + +![Parameters of Elliptic Arc](pics/ellipse.png) + +@param img Image. +@param center Center of the ellipse. +@param axes Half of the size of the ellipse main axes. +@param angle Ellipse rotation angle in degrees. +@param startAngle Starting angle of the elliptic arc in degrees. +@param endAngle Ending angle of the elliptic arc in degrees. +@param color Ellipse color. +@param thickness Thickness of the ellipse arc outline, if positive. Otherwise, this indicates that +a filled ellipse sector is to be drawn. +@param lineType Type of the ellipse boundary. See the line description. +@param shift Number of fractional bits in the coordinates of the center and values of axes. + */ +CV_EXPORTS_W void ellipse(InputOutputArray img, Point center, Size axes, + double angle, double startAngle, double endAngle, + const Scalar& color, int thickness = 1, + int lineType = LINE_8, int shift = 0); + +/** @overload +@param img Image. +@param box Alternative ellipse representation via RotatedRect. This means that the function draws +an ellipse inscribed in the rotated rectangle. +@param color Ellipse color. +@param thickness Thickness of the ellipse arc outline, if positive. Otherwise, this indicates that +a filled ellipse sector is to be drawn. +@param lineType Type of the ellipse boundary. See the line description. +*/ +CV_EXPORTS_W void ellipse(InputOutputArray img, const RotatedRect& box, const Scalar& color, + int thickness = 1, int lineType = LINE_8); + +/* ----------------------------------------------------------------------------------------- */ +/* ADDING A SET OF PREDEFINED MARKERS WHICH COULD BE USED TO HIGHLIGHT POSITIONS IN AN IMAGE */ +/* ----------------------------------------------------------------------------------------- */ + +//! Possible set of marker types used for the cv::drawMarker function +enum MarkerTypes +{ + MARKER_CROSS = 0, //!< A crosshair marker shape + MARKER_TILTED_CROSS = 1, //!< A 45 degree tilted crosshair marker shape + MARKER_STAR = 2, //!< A star marker shape, combination of cross and tilted cross + MARKER_DIAMOND = 3, //!< A diamond marker shape + MARKER_SQUARE = 4, //!< A square marker shape + MARKER_TRIANGLE_UP = 5, //!< An upwards pointing triangle marker shape + MARKER_TRIANGLE_DOWN = 6 //!< A downwards pointing triangle marker shape +}; + +/** @brief Draws a marker on a predefined position in an image. + +The function drawMarker draws a marker on a given position in the image. For the moment several +marker types are supported, see cv::MarkerTypes for more information. + +@param img Image. +@param position The point where the crosshair is positioned. +@param markerType The specific type of marker you want to use, see cv::MarkerTypes +@param color Line color. +@param thickness Line thickness. +@param line_type Type of the line, see cv::LineTypes +@param markerSize The length of the marker axis [default = 20 pixels] + */ +CV_EXPORTS_W void drawMarker(CV_IN_OUT Mat& img, Point position, const Scalar& color, + int markerType = MARKER_CROSS, int markerSize=20, int thickness=1, + int line_type=8); + +/* ----------------------------------------------------------------------------------------- */ +/* END OF MARKER SECTION */ +/* ----------------------------------------------------------------------------------------- */ + +/** @overload */ +CV_EXPORTS void fillConvexPoly(Mat& img, const Point* pts, int npts, + const Scalar& color, int lineType = LINE_8, + int shift = 0); + +/** @brief Fills a convex polygon. + +The function fillConvexPoly draws a filled convex polygon. This function is much faster than the +function cv::fillPoly . It can fill not only convex polygons but any monotonic polygon without +self-intersections, that is, a polygon whose contour intersects every horizontal line (scan line) +twice at the most (though, its top-most and/or the bottom edge could be horizontal). + +@param img Image. +@param points Polygon vertices. +@param color Polygon color. +@param lineType Type of the polygon boundaries. See the line description. +@param shift Number of fractional bits in the vertex coordinates. + */ +CV_EXPORTS_W void fillConvexPoly(InputOutputArray img, InputArray points, + const Scalar& color, int lineType = LINE_8, + int shift = 0); + +/** @overload */ +CV_EXPORTS void fillPoly(Mat& img, const Point** pts, + const int* npts, int ncontours, + const Scalar& color, int lineType = LINE_8, int shift = 0, + Point offset = Point() ); + +/** @brief Fills the area bounded by one or more polygons. + +The function fillPoly fills an area bounded by several polygonal contours. The function can fill +complex areas, for example, areas with holes, contours with self-intersections (some of their +parts), and so forth. + +@param img Image. +@param pts Array of polygons where each polygon is represented as an array of points. +@param color Polygon color. +@param lineType Type of the polygon boundaries. See the line description. +@param shift Number of fractional bits in the vertex coordinates. +@param offset Optional offset of all points of the contours. + */ +CV_EXPORTS_W void fillPoly(InputOutputArray img, InputArrayOfArrays pts, + const Scalar& color, int lineType = LINE_8, int shift = 0, + Point offset = Point() ); + +/** @overload */ +CV_EXPORTS void polylines(Mat& img, const Point* const* pts, const int* npts, + int ncontours, bool isClosed, const Scalar& color, + int thickness = 1, int lineType = LINE_8, int shift = 0 ); + +/** @brief Draws several polygonal curves. + +@param img Image. +@param pts Array of polygonal curves. +@param isClosed Flag indicating whether the drawn polylines are closed or not. If they are closed, +the function draws a line from the last vertex of each curve to its first vertex. +@param color Polyline color. +@param thickness Thickness of the polyline edges. +@param lineType Type of the line segments. See the line description. +@param shift Number of fractional bits in the vertex coordinates. + +The function polylines draws one or more polygonal curves. + */ +CV_EXPORTS_W void polylines(InputOutputArray img, InputArrayOfArrays pts, + bool isClosed, const Scalar& color, + int thickness = 1, int lineType = LINE_8, int shift = 0 ); + +/** @example contours2.cpp + An example using the drawContour functionality +*/ + +/** @example segment_objects.cpp +An example using drawContours to clean up a background segmentation result + */ + +/** @brief Draws contours outlines or filled contours. + +The function draws contour outlines in the image if \f$\texttt{thickness} \ge 0\f$ or fills the area +bounded by the contours if \f$\texttt{thickness}<0\f$ . The example below shows how to retrieve +connected components from the binary image and label them: : +@code + #include "opencv2/imgproc.hpp" + #include "opencv2/highgui.hpp" + + using namespace cv; + using namespace std; + + int main( int argc, char** argv ) + { + Mat src; + // the first command-line parameter must be a filename of the binary + // (black-n-white) image + if( argc != 2 || !(src=imread(argv[1], 0)).data) + return -1; + + Mat dst = Mat::zeros(src.rows, src.cols, CV_8UC3); + + src = src > 1; + namedWindow( "Source", 1 ); + imshow( "Source", src ); + + vector > contours; + vector hierarchy; + + findContours( src, contours, hierarchy, + RETR_CCOMP, CHAIN_APPROX_SIMPLE ); + + // iterate through all the top-level contours, + // draw each connected component with its own random color + int idx = 0; + for( ; idx >= 0; idx = hierarchy[idx][0] ) + { + Scalar color( rand()&255, rand()&255, rand()&255 ); + drawContours( dst, contours, idx, color, FILLED, 8, hierarchy ); + } + + namedWindow( "Components", 1 ); + imshow( "Components", dst ); + waitKey(0); + } +@endcode + +@param image Destination image. +@param contours All the input contours. Each contour is stored as a point vector. +@param contourIdx Parameter indicating a contour to draw. If it is negative, all the contours are drawn. +@param color Color of the contours. +@param thickness Thickness of lines the contours are drawn with. If it is negative (for example, +thickness=CV_FILLED ), the contour interiors are drawn. +@param lineType Line connectivity. See cv::LineTypes. +@param hierarchy Optional information about hierarchy. It is only needed if you want to draw only +some of the contours (see maxLevel ). +@param maxLevel Maximal level for drawn contours. If it is 0, only the specified contour is drawn. +If it is 1, the function draws the contour(s) and all the nested contours. If it is 2, the function +draws the contours, all the nested contours, all the nested-to-nested contours, and so on. This +parameter is only taken into account when there is hierarchy available. +@param offset Optional contour shift parameter. Shift all the drawn contours by the specified +\f$\texttt{offset}=(dx,dy)\f$ . + */ +CV_EXPORTS_W void drawContours( InputOutputArray image, InputArrayOfArrays contours, + int contourIdx, const Scalar& color, + int thickness = 1, int lineType = LINE_8, + InputArray hierarchy = noArray(), + int maxLevel = INT_MAX, Point offset = Point() ); + +/** @brief Clips the line against the image rectangle. + +The functions clipLine calculate a part of the line segment that is entirely within the specified +rectangle. They return false if the line segment is completely outside the rectangle. Otherwise, +they return true . +@param imgSize Image size. The image rectangle is Rect(0, 0, imgSize.width, imgSize.height) . +@param pt1 First line point. +@param pt2 Second line point. + */ +CV_EXPORTS bool clipLine(Size imgSize, CV_IN_OUT Point& pt1, CV_IN_OUT Point& pt2); + +/** @overload +@param imgRect Image rectangle. +@param pt1 First line point. +@param pt2 Second line point. +*/ +CV_EXPORTS_W bool clipLine(Rect imgRect, CV_OUT CV_IN_OUT Point& pt1, CV_OUT CV_IN_OUT Point& pt2); + +/** @brief Approximates an elliptic arc with a polyline. + +The function ellipse2Poly computes the vertices of a polyline that approximates the specified +elliptic arc. It is used by cv::ellipse. + +@param center Center of the arc. +@param axes Half of the size of the ellipse main axes. See the ellipse for details. +@param angle Rotation angle of the ellipse in degrees. See the ellipse for details. +@param arcStart Starting angle of the elliptic arc in degrees. +@param arcEnd Ending angle of the elliptic arc in degrees. +@param delta Angle between the subsequent polyline vertices. It defines the approximation +accuracy. +@param pts Output vector of polyline vertices. + */ +CV_EXPORTS_W void ellipse2Poly( Point center, Size axes, int angle, + int arcStart, int arcEnd, int delta, + CV_OUT std::vector& pts ); + +/** @brief Draws a text string. + +The function putText renders the specified text string in the image. Symbols that cannot be rendered +using the specified font are replaced by question marks. See getTextSize for a text rendering code +example. + +@param img Image. +@param text Text string to be drawn. +@param org Bottom-left corner of the text string in the image. +@param fontFace Font type, see cv::HersheyFonts. +@param fontScale Font scale factor that is multiplied by the font-specific base size. +@param color Text color. +@param thickness Thickness of the lines used to draw a text. +@param lineType Line type. See the line for details. +@param bottomLeftOrigin When true, the image data origin is at the bottom-left corner. Otherwise, +it is at the top-left corner. + */ +CV_EXPORTS_W void putText( InputOutputArray img, const String& text, Point org, + int fontFace, double fontScale, Scalar color, + int thickness = 1, int lineType = LINE_8, + bool bottomLeftOrigin = false ); + +/** @brief Calculates the width and height of a text string. + +The function getTextSize calculates and returns the size of a box that contains the specified text. +That is, the following code renders some text, the tight box surrounding it, and the baseline: : +@code + String text = "Funny text inside the box"; + int fontFace = FONT_HERSHEY_SCRIPT_SIMPLEX; + double fontScale = 2; + int thickness = 3; + + Mat img(600, 800, CV_8UC3, Scalar::all(0)); + + int baseline=0; + Size textSize = getTextSize(text, fontFace, + fontScale, thickness, &baseline); + baseline += thickness; + + // center the text + Point textOrg((img.cols - textSize.width)/2, + (img.rows + textSize.height)/2); + + // draw the box + rectangle(img, textOrg + Point(0, baseline), + textOrg + Point(textSize.width, -textSize.height), + Scalar(0,0,255)); + // ... and the baseline first + line(img, textOrg + Point(0, thickness), + textOrg + Point(textSize.width, thickness), + Scalar(0, 0, 255)); + + // then put the text itself + putText(img, text, textOrg, fontFace, fontScale, + Scalar::all(255), thickness, 8); +@endcode + +@param text Input text string. +@param fontFace Font to use, see cv::HersheyFonts. +@param fontScale Font scale factor that is multiplied by the font-specific base size. +@param thickness Thickness of lines used to render the text. See putText for details. +@param[out] baseLine y-coordinate of the baseline relative to the bottom-most text +point. +@return The size of a box that contains the specified text. + +@see cv::putText + */ +CV_EXPORTS_W Size getTextSize(const String& text, int fontFace, + double fontScale, int thickness, + CV_OUT int* baseLine); + +/** @brief Line iterator + +The class is used to iterate over all the pixels on the raster line +segment connecting two specified points. + +The class LineIterator is used to get each pixel of a raster line. It +can be treated as versatile implementation of the Bresenham algorithm +where you can stop at each pixel and do some extra processing, for +example, grab pixel values along the line or draw a line with an effect +(for example, with XOR operation). + +The number of pixels along the line is stored in LineIterator::count. +The method LineIterator::pos returns the current position in the image: + +@code{.cpp} +// grabs pixels along the line (pt1, pt2) +// from 8-bit 3-channel image to the buffer +LineIterator it(img, pt1, pt2, 8); +LineIterator it2 = it; +vector buf(it.count); + +for(int i = 0; i < it.count; i++, ++it) + buf[i] = *(const Vec3b)*it; + +// alternative way of iterating through the line +for(int i = 0; i < it2.count; i++, ++it2) +{ + Vec3b val = img.at(it2.pos()); + CV_Assert(buf[i] == val); +} +@endcode +*/ +class CV_EXPORTS LineIterator +{ +public: + /** @brief intializes the iterator + + creates iterators for the line connecting pt1 and pt2 + the line will be clipped on the image boundaries + the line is 8-connected or 4-connected + If leftToRight=true, then the iteration is always done + from the left-most point to the right most, + not to depend on the ordering of pt1 and pt2 parameters + */ + LineIterator( const Mat& img, Point pt1, Point pt2, + int connectivity = 8, bool leftToRight = false ); + /** @brief returns pointer to the current pixel + */ + uchar* operator *(); + /** @brief prefix increment operator (++it). shifts iterator to the next pixel + */ + LineIterator& operator ++(); + /** @brief postfix increment operator (it++). shifts iterator to the next pixel + */ + LineIterator operator ++(int); + /** @brief returns coordinates of the current pixel + */ + Point pos() const; + + uchar* ptr; + const uchar* ptr0; + int step, elemSize; + int err, count; + int minusDelta, plusDelta; + int minusStep, plusStep; +}; + +//! @cond IGNORED + +// === LineIterator implementation === + +inline +uchar* LineIterator::operator *() +{ + return ptr; +} + +inline +LineIterator& LineIterator::operator ++() +{ + int mask = err < 0 ? -1 : 0; + err += minusDelta + (plusDelta & mask); + ptr += minusStep + (plusStep & mask); + return *this; +} + +inline +LineIterator LineIterator::operator ++(int) +{ + LineIterator it = *this; + ++(*this); + return it; +} + +inline +Point LineIterator::pos() const +{ + Point p; + p.y = (int)((ptr - ptr0)/step); + p.x = (int)(((ptr - ptr0) - p.y*step)/elemSize); + return p; +} + +//! @endcond + +//! @} imgproc_draw + +//! @} imgproc + +} // cv + +#ifndef DISABLE_OPENCV_24_COMPATIBILITY +#include "opencv2/imgproc/imgproc_c.h" +#endif + +#endif diff --git a/lib/opencv/include/opencv2/imgproc/detail/distortion_model.hpp b/lib/opencv/include/opencv2/imgproc/detail/distortion_model.hpp new file mode 100644 index 000000000..ca293040e --- /dev/null +++ b/lib/opencv/include/opencv2/imgproc/detail/distortion_model.hpp @@ -0,0 +1,123 @@ +/*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_IMGPROC_DETAIL_DISTORTION_MODEL_HPP__ +#define __OPENCV_IMGPROC_DETAIL_DISTORTION_MODEL_HPP__ + +//! @cond IGNORED + +namespace cv { namespace detail { +/** +Computes the matrix for the projection onto a tilted image sensor +\param tauX angular parameter rotation around x-axis +\param tauY angular parameter rotation around y-axis +\param matTilt if not NULL returns the matrix +\f[ +\vecthreethree{R_{33}(\tau_x, \tau_y)}{0}{-R_{13}((\tau_x, \tau_y)} +{0}{R_{33}(\tau_x, \tau_y)}{-R_{23}(\tau_x, \tau_y)} +{0}{0}{1} R(\tau_x, \tau_y) +\f] +where +\f[ +R(\tau_x, \tau_y) = +\vecthreethree{\cos(\tau_y)}{0}{-\sin(\tau_y)}{0}{1}{0}{\sin(\tau_y)}{0}{\cos(\tau_y)} +\vecthreethree{1}{0}{0}{0}{\cos(\tau_x)}{\sin(\tau_x)}{0}{-\sin(\tau_x)}{\cos(\tau_x)} = +\vecthreethree{\cos(\tau_y)}{\sin(\tau_y)\sin(\tau_x)}{-\sin(\tau_y)\cos(\tau_x)} +{0}{\cos(\tau_x)}{\sin(\tau_x)} +{\sin(\tau_y)}{-\cos(\tau_y)\sin(\tau_x)}{\cos(\tau_y)\cos(\tau_x)}. +\f] +\param dMatTiltdTauX if not NULL it returns the derivative of matTilt with +respect to \f$\tau_x\f$. +\param dMatTiltdTauY if not NULL it returns the derivative of matTilt with +respect to \f$\tau_y\f$. +\param invMatTilt if not NULL it returns the inverse of matTilt +**/ +template +void computeTiltProjectionMatrix(FLOAT tauX, + FLOAT tauY, + Matx* matTilt = 0, + Matx* dMatTiltdTauX = 0, + Matx* dMatTiltdTauY = 0, + Matx* invMatTilt = 0) +{ + FLOAT cTauX = cos(tauX); + FLOAT sTauX = sin(tauX); + FLOAT cTauY = cos(tauY); + FLOAT sTauY = sin(tauY); + Matx matRotX = Matx(1,0,0,0,cTauX,sTauX,0,-sTauX,cTauX); + Matx matRotY = Matx(cTauY,0,-sTauY,0,1,0,sTauY,0,cTauY); + Matx matRotXY = matRotY * matRotX; + Matx matProjZ = Matx(matRotXY(2,2),0,-matRotXY(0,2),0,matRotXY(2,2),-matRotXY(1,2),0,0,1); + if (matTilt) + { + // Matrix for trapezoidal distortion of tilted image sensor + *matTilt = matProjZ * matRotXY; + } + if (dMatTiltdTauX) + { + // Derivative with respect to tauX + Matx dMatRotXYdTauX = matRotY * Matx(0,0,0,0,-sTauX,cTauX,0,-cTauX,-sTauX); + Matx dMatProjZdTauX = Matx(dMatRotXYdTauX(2,2),0,-dMatRotXYdTauX(0,2), + 0,dMatRotXYdTauX(2,2),-dMatRotXYdTauX(1,2),0,0,0); + *dMatTiltdTauX = (matProjZ * dMatRotXYdTauX) + (dMatProjZdTauX * matRotXY); + } + if (dMatTiltdTauY) + { + // Derivative with respect to tauY + Matx dMatRotXYdTauY = Matx(-sTauY,0,-cTauY,0,0,0,cTauY,0,-sTauY) * matRotX; + Matx dMatProjZdTauY = Matx(dMatRotXYdTauY(2,2),0,-dMatRotXYdTauY(0,2), + 0,dMatRotXYdTauY(2,2),-dMatRotXYdTauY(1,2),0,0,0); + *dMatTiltdTauY = (matProjZ * dMatRotXYdTauY) + (dMatProjZdTauY * matRotXY); + } + if (invMatTilt) + { + FLOAT inv = 1./matRotXY(2,2); + Matx invMatProjZ = Matx(inv,0,inv*matRotXY(0,2),0,inv,inv*matRotXY(1,2),0,0,1); + *invMatTilt = matRotXY.t()*invMatProjZ; + } +} +}} // namespace detail, cv + + +//! @endcond + +#endif // __OPENCV_IMGPROC_DETAIL_DISTORTION_MODEL_HPP__ diff --git a/lib/opencv/include/opencv2/imgproc/imgproc.hpp b/lib/opencv/include/opencv2/imgproc/imgproc.hpp new file mode 100644 index 000000000..4175bd0bc --- /dev/null +++ b/lib/opencv/include/opencv2/imgproc/imgproc.hpp @@ -0,0 +1,48 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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*/ + +#ifdef __OPENCV_BUILD +#error this is a compatibility header which should not be used inside the OpenCV library +#endif + +#include "opencv2/imgproc.hpp" diff --git a/lib/opencv/include/opencv2/imgproc/imgproc_c.h b/lib/opencv/include/opencv2/imgproc/imgproc_c.h new file mode 100644 index 000000000..87518d72e --- /dev/null +++ b/lib/opencv/include/opencv2/imgproc/imgproc_c.h @@ -0,0 +1,1210 @@ +/*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_IMGPROC_IMGPROC_C_H__ +#define __OPENCV_IMGPROC_IMGPROC_C_H__ + +#include "opencv2/imgproc/types_c.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup imgproc_c +@{ +*/ + +/*********************** Background statistics accumulation *****************************/ + +/** @brief Adds image to accumulator +@see cv::accumulate +*/ +CVAPI(void) cvAcc( const CvArr* image, CvArr* sum, + const CvArr* mask CV_DEFAULT(NULL) ); + +/** @brief Adds squared image to accumulator +@see cv::accumulateSquare +*/ +CVAPI(void) cvSquareAcc( const CvArr* image, CvArr* sqsum, + const CvArr* mask CV_DEFAULT(NULL) ); + +/** @brief Adds a product of two images to accumulator +@see cv::accumulateProduct +*/ +CVAPI(void) cvMultiplyAcc( const CvArr* image1, const CvArr* image2, CvArr* acc, + const CvArr* mask CV_DEFAULT(NULL) ); + +/** @brief Adds image to accumulator with weights: acc = acc*(1-alpha) + image*alpha +@see cv::accumulateWeighted +*/ +CVAPI(void) cvRunningAvg( const CvArr* image, CvArr* acc, double alpha, + const CvArr* mask CV_DEFAULT(NULL) ); + +/****************************************************************************************\ +* Image Processing * +\****************************************************************************************/ + +/** Copies source 2D array inside of the larger destination array and + makes a border of the specified type (IPL_BORDER_*) around the copied area. */ +CVAPI(void) cvCopyMakeBorder( const CvArr* src, CvArr* dst, CvPoint offset, + int bordertype, CvScalar value CV_DEFAULT(cvScalarAll(0))); + +/** @brief Smooths the image in one of several ways. + +@param src The source image +@param dst The destination image +@param smoothtype Type of the smoothing, see SmoothMethod_c +@param size1 The first parameter of the smoothing operation, the aperture width. Must be a +positive odd number (1, 3, 5, ...) +@param size2 The second parameter of the smoothing operation, the aperture height. Ignored by +CV_MEDIAN and CV_BILATERAL methods. In the case of simple scaled/non-scaled and Gaussian blur if +size2 is zero, it is set to size1. Otherwise it must be a positive odd number. +@param sigma1 In the case of a Gaussian parameter this parameter may specify Gaussian \f$\sigma\f$ +(standard deviation). If it is zero, it is calculated from the kernel size: +\f[\sigma = 0.3 (n/2 - 1) + 0.8 \quad \text{where} \quad n= \begin{array}{l l} \mbox{\texttt{size1} for horizontal kernel} \\ \mbox{\texttt{size2} for vertical kernel} \end{array}\f] +Using standard sigma for small kernels ( \f$3\times 3\f$ to \f$7\times 7\f$ ) gives better speed. If +sigma1 is not zero, while size1 and size2 are zeros, the kernel size is calculated from the +sigma (to provide accurate enough operation). +@param sigma2 additional parameter for bilateral filtering + +@see cv::GaussianBlur, cv::blur, cv::medianBlur, cv::bilateralFilter. + */ +CVAPI(void) cvSmooth( const CvArr* src, CvArr* dst, + int smoothtype CV_DEFAULT(CV_GAUSSIAN), + int size1 CV_DEFAULT(3), + int size2 CV_DEFAULT(0), + double sigma1 CV_DEFAULT(0), + double sigma2 CV_DEFAULT(0)); + +/** @brief Convolves an image with the kernel. + +@param src input image. +@param dst output image of the same size and the same number of channels as src. +@param kernel convolution kernel (or rather a correlation kernel), a single-channel floating point +matrix; if you want to apply different kernels to different channels, split the image into +separate color planes using split and process them individually. +@param anchor anchor of the kernel that indicates the relative position of a filtered point within +the kernel; the anchor should lie within the kernel; default value (-1,-1) means that the anchor +is at the kernel center. + +@see cv::filter2D + */ +CVAPI(void) cvFilter2D( const CvArr* src, CvArr* dst, const CvMat* kernel, + CvPoint anchor CV_DEFAULT(cvPoint(-1,-1))); + +/** @brief Finds integral image: SUM(X,Y) = sum(x \texttt{hist1}(I)\)}{\frac{\texttt{hist2}(I) \cdot \texttt{scale}}{\texttt{hist1}(I)}}{if \(\texttt{hist1}(I) \ne 0\) and \(\texttt{hist2}(I) \le \texttt{hist1}(I)\)}\f] + +@param hist1 First histogram (the divisor). +@param hist2 Second histogram. +@param dst_hist Destination histogram. +@param scale Scale factor for the destination histogram. + */ +CVAPI(void) cvCalcProbDensity( const CvHistogram* hist1, const CvHistogram* hist2, + CvHistogram* dst_hist, double scale CV_DEFAULT(255) ); + +/** @brief equalizes histogram of 8-bit single-channel image +@see cv::equalizeHist +*/ +CVAPI(void) cvEqualizeHist( const CvArr* src, CvArr* dst ); + + +/** @brief Applies distance transform to binary image +@see cv::distanceTransform +*/ +CVAPI(void) cvDistTransform( const CvArr* src, CvArr* dst, + int distance_type CV_DEFAULT(CV_DIST_L2), + int mask_size CV_DEFAULT(3), + const float* mask CV_DEFAULT(NULL), + CvArr* labels CV_DEFAULT(NULL), + int labelType CV_DEFAULT(CV_DIST_LABEL_CCOMP)); + + +/** @brief Applies fixed-level threshold to grayscale image. + + This is a basic operation applied before retrieving contours +@see cv::threshold +*/ +CVAPI(double) cvThreshold( const CvArr* src, CvArr* dst, + double threshold, double max_value, + int threshold_type ); + +/** @brief Applies adaptive threshold to grayscale image. + + The two parameters for methods CV_ADAPTIVE_THRESH_MEAN_C and + CV_ADAPTIVE_THRESH_GAUSSIAN_C are: + neighborhood size (3, 5, 7 etc.), + and a constant subtracted from mean (...,-3,-2,-1,0,1,2,3,...) +@see cv::adaptiveThreshold +*/ +CVAPI(void) cvAdaptiveThreshold( const CvArr* src, CvArr* dst, double max_value, + int adaptive_method CV_DEFAULT(CV_ADAPTIVE_THRESH_MEAN_C), + int threshold_type CV_DEFAULT(CV_THRESH_BINARY), + int block_size CV_DEFAULT(3), + double param1 CV_DEFAULT(5)); + +/** @brief Fills the connected component until the color difference gets large enough +@see cv::floodFill +*/ +CVAPI(void) cvFloodFill( CvArr* image, CvPoint seed_point, + CvScalar new_val, CvScalar lo_diff CV_DEFAULT(cvScalarAll(0)), + CvScalar up_diff CV_DEFAULT(cvScalarAll(0)), + CvConnectedComp* comp CV_DEFAULT(NULL), + int flags CV_DEFAULT(4), + CvArr* mask CV_DEFAULT(NULL)); + +/****************************************************************************************\ +* Feature detection * +\****************************************************************************************/ + +/** @brief Runs canny edge detector +@see cv::Canny +*/ +CVAPI(void) cvCanny( const CvArr* image, CvArr* edges, double threshold1, + double threshold2, int aperture_size CV_DEFAULT(3) ); + +/** @brief Calculates constraint image for corner detection + + Dx^2 * Dyy + Dxx * Dy^2 - 2 * Dx * Dy * Dxy. + Applying threshold to the result gives coordinates of corners +@see cv::preCornerDetect +*/ +CVAPI(void) cvPreCornerDetect( const CvArr* image, CvArr* corners, + int aperture_size CV_DEFAULT(3) ); + +/** @brief Calculates eigen values and vectors of 2x2 + gradient covariation matrix at every image pixel +@see cv::cornerEigenValsAndVecs +*/ +CVAPI(void) cvCornerEigenValsAndVecs( const CvArr* image, CvArr* eigenvv, + int block_size, int aperture_size CV_DEFAULT(3) ); + +/** @brief Calculates minimal eigenvalue for 2x2 gradient covariation matrix at + every image pixel +@see cv::cornerMinEigenVal +*/ +CVAPI(void) cvCornerMinEigenVal( const CvArr* image, CvArr* eigenval, + int block_size, int aperture_size CV_DEFAULT(3) ); + +/** @brief Harris corner detector: + + Calculates det(M) - k*(trace(M)^2), where M is 2x2 gradient covariation matrix for each pixel +@see cv::cornerHarris +*/ +CVAPI(void) cvCornerHarris( const CvArr* image, CvArr* harris_response, + int block_size, int aperture_size CV_DEFAULT(3), + double k CV_DEFAULT(0.04) ); + +/** @brief Adjust corner position using some sort of gradient search +@see cv::cornerSubPix +*/ +CVAPI(void) cvFindCornerSubPix( const CvArr* image, CvPoint2D32f* corners, + int count, CvSize win, CvSize zero_zone, + CvTermCriteria criteria ); + +/** @brief Finds a sparse set of points within the selected region + that seem to be easy to track +@see cv::goodFeaturesToTrack +*/ +CVAPI(void) cvGoodFeaturesToTrack( const CvArr* image, CvArr* eig_image, + CvArr* temp_image, CvPoint2D32f* corners, + int* corner_count, double quality_level, + double min_distance, + const CvArr* mask CV_DEFAULT(NULL), + int block_size CV_DEFAULT(3), + int use_harris CV_DEFAULT(0), + double k CV_DEFAULT(0.04) ); + +/** @brief Finds lines on binary image using one of several methods. + + line_storage is either memory storage or 1 x _max number of lines_ CvMat, its + number of columns is changed by the function. + method is one of CV_HOUGH_*; + rho, theta and threshold are used for each of those methods; + param1 ~ line length, param2 ~ line gap - for probabilistic, + param1 ~ srn, param2 ~ stn - for multi-scale +@see cv::HoughLines +*/ +CVAPI(CvSeq*) cvHoughLines2( CvArr* image, void* line_storage, int method, + double rho, double theta, int threshold, + double param1 CV_DEFAULT(0), double param2 CV_DEFAULT(0), + double min_theta CV_DEFAULT(0), double max_theta CV_DEFAULT(CV_PI)); + +/** @brief Finds circles in the image +@see cv::HoughCircles +*/ +CVAPI(CvSeq*) cvHoughCircles( CvArr* image, void* circle_storage, + int method, double dp, double min_dist, + double param1 CV_DEFAULT(100), + double param2 CV_DEFAULT(100), + int min_radius CV_DEFAULT(0), + int max_radius CV_DEFAULT(0)); + +/** @brief Fits a line into set of 2d or 3d points in a robust way (M-estimator technique) +@see cv::fitLine +*/ +CVAPI(void) cvFitLine( const CvArr* points, int dist_type, double param, + double reps, double aeps, float* line ); + +/****************************************************************************************\ +* Drawing * +\****************************************************************************************/ + +/****************************************************************************************\ +* Drawing functions work with images/matrices of arbitrary type. * +* For color images the channel order is BGR[A] * +* Antialiasing is supported only for 8-bit image now. * +* All the functions include parameter color that means rgb value (that may be * +* constructed with CV_RGB macro) for color images and brightness * +* for grayscale images. * +* If a drawn figure is partially or completely outside of the image, it is clipped.* +\****************************************************************************************/ + +#define CV_RGB( r, g, b ) cvScalar( (b), (g), (r), 0 ) +#define CV_FILLED -1 + +#define CV_AA 16 + +/** @brief Draws 4-connected, 8-connected or antialiased line segment connecting two points +@see cv::line +*/ +CVAPI(void) cvLine( CvArr* img, CvPoint pt1, CvPoint pt2, + CvScalar color, int thickness CV_DEFAULT(1), + int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0) ); + +/** @brief Draws a rectangle given two opposite corners of the rectangle (pt1 & pt2) + + if thickness<0 (e.g. thickness == CV_FILLED), the filled box is drawn +@see cv::rectangle +*/ +CVAPI(void) cvRectangle( CvArr* img, CvPoint pt1, CvPoint pt2, + CvScalar color, int thickness CV_DEFAULT(1), + int line_type CV_DEFAULT(8), + int shift CV_DEFAULT(0)); + +/** @brief Draws a rectangle specified by a CvRect structure +@see cv::rectangle +*/ +CVAPI(void) cvRectangleR( CvArr* img, CvRect r, + CvScalar color, int thickness CV_DEFAULT(1), + int line_type CV_DEFAULT(8), + int shift CV_DEFAULT(0)); + + +/** @brief Draws a circle with specified center and radius. + + Thickness works in the same way as with cvRectangle +@see cv::circle +*/ +CVAPI(void) cvCircle( CvArr* img, CvPoint center, int radius, + CvScalar color, int thickness CV_DEFAULT(1), + int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0)); + +/** @brief Draws ellipse outline, filled ellipse, elliptic arc or filled elliptic sector + + depending on _thickness_, _start_angle_ and _end_angle_ parameters. The resultant figure + is rotated by _angle_. All the angles are in degrees +@see cv::ellipse +*/ +CVAPI(void) cvEllipse( CvArr* img, CvPoint center, CvSize axes, + double angle, double start_angle, double end_angle, + CvScalar color, int thickness CV_DEFAULT(1), + int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0)); + +CV_INLINE void cvEllipseBox( CvArr* img, CvBox2D box, CvScalar color, + int thickness CV_DEFAULT(1), + int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0) ) +{ + CvSize axes; + axes.width = cvRound(box.size.width*0.5); + axes.height = cvRound(box.size.height*0.5); + + cvEllipse( img, cvPointFrom32f( box.center ), axes, box.angle, + 0, 360, color, thickness, line_type, shift ); +} + +/** @brief Fills convex or monotonous polygon. +@see cv::fillConvexPoly +*/ +CVAPI(void) cvFillConvexPoly( CvArr* img, const CvPoint* pts, int npts, CvScalar color, + int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0)); + +/** @brief Fills an area bounded by one or more arbitrary polygons +@see cv::fillPoly +*/ +CVAPI(void) cvFillPoly( CvArr* img, CvPoint** pts, const int* npts, + int contours, CvScalar color, + int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0) ); + +/** @brief Draws one or more polygonal curves +@see cv::polylines +*/ +CVAPI(void) cvPolyLine( CvArr* img, CvPoint** pts, const int* npts, int contours, + int is_closed, CvScalar color, int thickness CV_DEFAULT(1), + int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0) ); + +#define cvDrawRect cvRectangle +#define cvDrawLine cvLine +#define cvDrawCircle cvCircle +#define cvDrawEllipse cvEllipse +#define cvDrawPolyLine cvPolyLine + +/** @brief Clips the line segment connecting *pt1 and *pt2 + by the rectangular window + + (0<=xptr will point to pt1 (or pt2, see left_to_right description) location in +the image. Returns the number of pixels on the line between the ending points. +@see cv::LineIterator +*/ +CVAPI(int) cvInitLineIterator( const CvArr* image, CvPoint pt1, CvPoint pt2, + CvLineIterator* line_iterator, + int connectivity CV_DEFAULT(8), + int left_to_right CV_DEFAULT(0)); + +#define CV_NEXT_LINE_POINT( line_iterator ) \ +{ \ + int _line_iterator_mask = (line_iterator).err < 0 ? -1 : 0; \ + (line_iterator).err += (line_iterator).minus_delta + \ + ((line_iterator).plus_delta & _line_iterator_mask); \ + (line_iterator).ptr += (line_iterator).minus_step + \ + ((line_iterator).plus_step & _line_iterator_mask); \ +} + + +#define CV_FONT_HERSHEY_SIMPLEX 0 +#define CV_FONT_HERSHEY_PLAIN 1 +#define CV_FONT_HERSHEY_DUPLEX 2 +#define CV_FONT_HERSHEY_COMPLEX 3 +#define CV_FONT_HERSHEY_TRIPLEX 4 +#define CV_FONT_HERSHEY_COMPLEX_SMALL 5 +#define CV_FONT_HERSHEY_SCRIPT_SIMPLEX 6 +#define CV_FONT_HERSHEY_SCRIPT_COMPLEX 7 + +#define CV_FONT_ITALIC 16 + +#define CV_FONT_VECTOR0 CV_FONT_HERSHEY_SIMPLEX + + +/** Font structure */ +typedef struct CvFont +{ + const char* nameFont; //Qt:nameFont + CvScalar color; //Qt:ColorFont -> cvScalar(blue_component, green_component, red_component[, alpha_component]) + int font_face; //Qt: bool italic /** =CV_FONT_* */ + const int* ascii; //!< font data and metrics + const int* greek; + const int* cyrillic; + float hscale, vscale; + float shear; //!< slope coefficient: 0 - normal, >0 - italic + int thickness; //!< Qt: weight /** letters thickness */ + float dx; //!< horizontal interval between letters + int line_type; //!< Qt: PointSize +} +CvFont; + +/** @brief Initializes font structure (OpenCV 1.x API). + +The function initializes the font structure that can be passed to text rendering functions. + +@param font Pointer to the font structure initialized by the function +@param font_face Font name identifier. See cv::HersheyFonts and corresponding old CV_* identifiers. +@param hscale Horizontal scale. If equal to 1.0f , the characters have the original width +depending on the font type. If equal to 0.5f , the characters are of half the original width. +@param vscale Vertical scale. If equal to 1.0f , the characters have the original height depending +on the font type. If equal to 0.5f , the characters are of half the original height. +@param shear Approximate tangent of the character slope relative to the vertical line. A zero +value means a non-italic font, 1.0f means about a 45 degree slope, etc. +@param thickness Thickness of the text strokes +@param line_type Type of the strokes, see line description + +@sa cvPutText + */ +CVAPI(void) cvInitFont( CvFont* font, int font_face, + double hscale, double vscale, + double shear CV_DEFAULT(0), + int thickness CV_DEFAULT(1), + int line_type CV_DEFAULT(8)); + +CV_INLINE CvFont cvFont( double scale, int thickness CV_DEFAULT(1) ) +{ + CvFont font; + cvInitFont( &font, CV_FONT_HERSHEY_PLAIN, scale, scale, 0, thickness, CV_AA ); + return font; +} + +/** @brief Renders text stroke with specified font and color at specified location. + CvFont should be initialized with cvInitFont +@see cvInitFont, cvGetTextSize, cvFont, cv::putText +*/ +CVAPI(void) cvPutText( CvArr* img, const char* text, CvPoint org, + const CvFont* font, CvScalar color ); + +/** @brief Calculates bounding box of text stroke (useful for alignment) +@see cv::getTextSize +*/ +CVAPI(void) cvGetTextSize( const char* text_string, const CvFont* font, + CvSize* text_size, int* baseline ); + +/** @brief Unpacks color value + +if arrtype is CV_8UC?, _color_ is treated as packed color value, otherwise the first channels +(depending on arrtype) of destination scalar are set to the same value = _color_ +*/ +CVAPI(CvScalar) cvColorToScalar( double packed_color, int arrtype ); + +/** @brief Returns the polygon points which make up the given ellipse. + +The ellipse is define by the box of size 'axes' rotated 'angle' around the 'center'. A partial +sweep of the ellipse arc can be done by spcifying arc_start and arc_end to be something other than +0 and 360, respectively. The input array 'pts' must be large enough to hold the result. The total +number of points stored into 'pts' is returned by this function. +@see cv::ellipse2Poly +*/ +CVAPI(int) cvEllipse2Poly( CvPoint center, CvSize axes, + int angle, int arc_start, int arc_end, CvPoint * pts, int delta ); + +/** @brief Draws contour outlines or filled interiors on the image +@see cv::drawContours +*/ +CVAPI(void) cvDrawContours( CvArr *img, CvSeq* contour, + CvScalar external_color, CvScalar hole_color, + int max_level, int thickness CV_DEFAULT(1), + int line_type CV_DEFAULT(8), + CvPoint offset CV_DEFAULT(cvPoint(0,0))); + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/lib/opencv/include/opencv2/imgproc/types_c.h b/lib/opencv/include/opencv2/imgproc/types_c.h new file mode 100644 index 000000000..5ecb46078 --- /dev/null +++ b/lib/opencv/include/opencv2/imgproc/types_c.h @@ -0,0 +1,626 @@ +/*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_IMGPROC_TYPES_C_H__ +#define __OPENCV_IMGPROC_TYPES_C_H__ + +#include "opencv2/core/core_c.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup imgproc_c + @{ +*/ + +/** Connected component structure */ +typedef struct CvConnectedComp +{ + double area; /** DBL_EPSILON ? 1./std::sqrt(am00) : 0; + } + operator cv::Moments() const + { + return cv::Moments(m00, m10, m01, m20, m11, m02, m30, m21, m12, m03); + } +#endif +} +CvMoments; + +/** Hu invariants */ +typedef struct CvHuMoments +{ + double hu1, hu2, hu3, hu4, hu5, hu6, hu7; /**< Hu invariants */ +} +CvHuMoments; + +/** Template matching methods */ +enum +{ + CV_TM_SQDIFF =0, + CV_TM_SQDIFF_NORMED =1, + CV_TM_CCORR =2, + CV_TM_CCORR_NORMED =3, + CV_TM_CCOEFF =4, + CV_TM_CCOEFF_NORMED =5 +}; + +typedef float (CV_CDECL * CvDistanceFunction)( const float* a, const float* b, void* user_param ); + +/** Contour retrieval modes */ +enum +{ + CV_RETR_EXTERNAL=0, + CV_RETR_LIST=1, + CV_RETR_CCOMP=2, + CV_RETR_TREE=3, + CV_RETR_FLOODFILL=4 +}; + +/** Contour approximation methods */ +enum +{ + CV_CHAIN_CODE=0, + CV_CHAIN_APPROX_NONE=1, + CV_CHAIN_APPROX_SIMPLE=2, + CV_CHAIN_APPROX_TC89_L1=3, + CV_CHAIN_APPROX_TC89_KCOS=4, + CV_LINK_RUNS=5 +}; + +/* +Internal structure that is used for sequential retrieving contours from the image. +It supports both hierarchical and plane variants of Suzuki algorithm. +*/ +typedef struct _CvContourScanner* CvContourScanner; + +/** Freeman chain reader state */ +typedef struct CvChainPtReader +{ + CV_SEQ_READER_FIELDS() + char code; + CvPoint pt; + schar deltas[8][2]; +} +CvChainPtReader; + +/** initializes 8-element array for fast access to 3x3 neighborhood of a pixel */ +#define CV_INIT_3X3_DELTAS( deltas, step, nch ) \ + ((deltas)[0] = (nch), (deltas)[1] = -(step) + (nch), \ + (deltas)[2] = -(step), (deltas)[3] = -(step) - (nch), \ + (deltas)[4] = -(nch), (deltas)[5] = (step) - (nch), \ + (deltas)[6] = (step), (deltas)[7] = (step) + (nch)) + + +/** Contour approximation algorithms */ +enum +{ + CV_POLY_APPROX_DP = 0 +}; + +/** @brief Shape matching methods + +\f$A\f$ denotes object1,\f$B\f$ denotes object2 + +\f$\begin{array}{l} m^A_i = \mathrm{sign} (h^A_i) \cdot \log{h^A_i} \\ m^B_i = \mathrm{sign} (h^B_i) \cdot \log{h^B_i} \end{array}\f$ + +and \f$h^A_i, h^B_i\f$ are the Hu moments of \f$A\f$ and \f$B\f$ , respectively. +*/ +enum ShapeMatchModes +{ + CV_CONTOURS_MATCH_I1 =1, //!< \f[I_1(A,B) = \sum _{i=1...7} \left | \frac{1}{m^A_i} - \frac{1}{m^B_i} \right |\f] + CV_CONTOURS_MATCH_I2 =2, //!< \f[I_2(A,B) = \sum _{i=1...7} \left | m^A_i - m^B_i \right |\f] + CV_CONTOURS_MATCH_I3 =3 //!< \f[I_3(A,B) = \max _{i=1...7} \frac{ \left| m^A_i - m^B_i \right| }{ \left| m^A_i \right| }\f] +}; + +/** Shape orientation */ +enum +{ + CV_CLOCKWISE =1, + CV_COUNTER_CLOCKWISE =2 +}; + + +/** Convexity defect */ +typedef struct CvConvexityDefect +{ + CvPoint* start; /**< point of the contour where the defect begins */ + CvPoint* end; /**< point of the contour where the defect ends */ + CvPoint* depth_point; /**< the farthest from the convex hull point within the defect */ + float depth; /**< distance between the farthest point and the convex hull */ +} CvConvexityDefect; + + +/** Histogram comparison methods */ +enum +{ + CV_COMP_CORREL =0, + CV_COMP_CHISQR =1, + CV_COMP_INTERSECT =2, + CV_COMP_BHATTACHARYYA =3, + CV_COMP_HELLINGER =CV_COMP_BHATTACHARYYA, + CV_COMP_CHISQR_ALT =4, + CV_COMP_KL_DIV =5 +}; + +/** Mask size for distance transform */ +enum +{ + CV_DIST_MASK_3 =3, + CV_DIST_MASK_5 =5, + CV_DIST_MASK_PRECISE =0 +}; + +/** Content of output label array: connected components or pixels */ +enum +{ + CV_DIST_LABEL_CCOMP = 0, + CV_DIST_LABEL_PIXEL = 1 +}; + +/** Distance types for Distance Transform and M-estimators */ +enum +{ + CV_DIST_USER =-1, /**< User defined distance */ + CV_DIST_L1 =1, /**< distance = |x1-x2| + |y1-y2| */ + CV_DIST_L2 =2, /**< the simple euclidean distance */ + CV_DIST_C =3, /**< distance = max(|x1-x2|,|y1-y2|) */ + CV_DIST_L12 =4, /**< L1-L2 metric: distance = 2(sqrt(1+x*x/2) - 1)) */ + CV_DIST_FAIR =5, /**< distance = c^2(|x|/c-log(1+|x|/c)), c = 1.3998 */ + CV_DIST_WELSCH =6, /**< distance = c^2/2(1-exp(-(x/c)^2)), c = 2.9846 */ + CV_DIST_HUBER =7 /**< distance = |x| threshold ? max_value : 0 */ + CV_THRESH_BINARY_INV =1, /**< value = value > threshold ? 0 : max_value */ + CV_THRESH_TRUNC =2, /**< value = value > threshold ? threshold : value */ + CV_THRESH_TOZERO =3, /**< value = value > threshold ? value : 0 */ + CV_THRESH_TOZERO_INV =4, /**< value = value > threshold ? 0 : value */ + CV_THRESH_MASK =7, + CV_THRESH_OTSU =8, /**< use Otsu algorithm to choose the optimal threshold value; + combine the flag with one of the above CV_THRESH_* values */ + CV_THRESH_TRIANGLE =16 /**< use Triangle algorithm to choose the optimal threshold value; + combine the flag with one of the above CV_THRESH_* values, but not + with CV_THRESH_OTSU */ +}; + +/** Adaptive threshold methods */ +enum +{ + CV_ADAPTIVE_THRESH_MEAN_C =0, + CV_ADAPTIVE_THRESH_GAUSSIAN_C =1 +}; + +/** FloodFill flags */ +enum +{ + CV_FLOODFILL_FIXED_RANGE =(1 << 16), + CV_FLOODFILL_MASK_ONLY =(1 << 17) +}; + + +/** Canny edge detector flags */ +enum +{ + CV_CANNY_L2_GRADIENT =(1 << 31) +}; + +/** Variants of a Hough transform */ +enum +{ + CV_HOUGH_STANDARD =0, + CV_HOUGH_PROBABILISTIC =1, + CV_HOUGH_MULTI_SCALE =2, + CV_HOUGH_GRADIENT =3 +}; + + +/* Fast search data structures */ +struct CvFeatureTree; +struct CvLSH; +struct CvLSHOperations; + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/lib/opencv/include/opencv2/ml.hpp b/lib/opencv/include/opencv2/ml.hpp new file mode 100644 index 000000000..862f3f950 --- /dev/null +++ b/lib/opencv/include/opencv2/ml.hpp @@ -0,0 +1,1505 @@ +/*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, Intel Corporation, all rights reserved. +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Copyright (C) 2014, 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_ML_HPP__ +#define __OPENCV_ML_HPP__ + +#ifdef __cplusplus +# include "opencv2/core.hpp" +#endif + +#ifdef __cplusplus + +#include +#include +#include + +/** + @defgroup ml Machine Learning + + The Machine Learning Library (MLL) is a set of classes and functions for statistical + classification, regression, and clustering of data. + + Most of the classification and regression algorithms are implemented as C++ classes. As the + algorithms have different sets of features (like an ability to handle missing measurements or + categorical input variables), there is a little common ground between the classes. This common + ground is defined by the class cv::ml::StatModel that all the other ML classes are derived from. + + See detailed overview here: @ref ml_intro. + */ + +namespace cv +{ + +namespace ml +{ + +//! @addtogroup ml +//! @{ + +/** @brief Variable types */ +enum VariableTypes +{ + VAR_NUMERICAL =0, //!< same as VAR_ORDERED + VAR_ORDERED =0, //!< ordered variables + VAR_CATEGORICAL =1 //!< categorical variables +}; + +/** @brief %Error types */ +enum ErrorTypes +{ + TEST_ERROR = 0, + TRAIN_ERROR = 1 +}; + +/** @brief Sample types */ +enum SampleTypes +{ + ROW_SAMPLE = 0, //!< each training sample is a row of samples + COL_SAMPLE = 1 //!< each training sample occupies a column of samples +}; + +/** @brief The structure represents the logarithmic grid range of statmodel parameters. + +It is used for optimizing statmodel accuracy by varying model parameters, the accuracy estimate +being computed by cross-validation. + */ +class CV_EXPORTS ParamGrid +{ +public: + /** @brief Default constructor */ + ParamGrid(); + /** @brief Constructor with parameters */ + ParamGrid(double _minVal, double _maxVal, double _logStep); + + double minVal; //!< Minimum value of the statmodel parameter. Default value is 0. + double maxVal; //!< Maximum value of the statmodel parameter. Default value is 0. + /** @brief Logarithmic step for iterating the statmodel parameter. + + The grid determines the following iteration sequence of the statmodel parameter values: + \f[(minVal, minVal*step, minVal*{step}^2, \dots, minVal*{logStep}^n),\f] + where \f$n\f$ is the maximal index satisfying + \f[\texttt{minVal} * \texttt{logStep} ^n < \texttt{maxVal}\f] + The grid is logarithmic, so logStep must always be greater then 1. Default value is 1. + */ + double logStep; +}; + +/** @brief Class encapsulating training data. + +Please note that the class only specifies the interface of training data, but not implementation. +All the statistical model classes in _ml_ module accepts Ptr\ as parameter. In other +words, you can create your own class derived from TrainData and pass smart pointer to the instance +of this class into StatModel::train. + +@sa @ref ml_intro_data + */ +class CV_EXPORTS_W TrainData +{ +public: + static inline float missingValue() { return FLT_MAX; } + virtual ~TrainData(); + + CV_WRAP virtual int getLayout() const = 0; + CV_WRAP virtual int getNTrainSamples() const = 0; + CV_WRAP virtual int getNTestSamples() const = 0; + CV_WRAP virtual int getNSamples() const = 0; + CV_WRAP virtual int getNVars() const = 0; + CV_WRAP virtual int getNAllVars() const = 0; + + CV_WRAP virtual void getSample(InputArray varIdx, int sidx, float* buf) const = 0; + CV_WRAP virtual Mat getSamples() const = 0; + CV_WRAP virtual Mat getMissing() const = 0; + + /** @brief Returns matrix of train samples + + @param layout The requested layout. If it's different from the initial one, the matrix is + transposed. See ml::SampleTypes. + @param compressSamples if true, the function returns only the training samples (specified by + sampleIdx) + @param compressVars if true, the function returns the shorter training samples, containing only + the active variables. + + In current implementation the function tries to avoid physical data copying and returns the + matrix stored inside TrainData (unless the transposition or compression is needed). + */ + CV_WRAP virtual Mat getTrainSamples(int layout=ROW_SAMPLE, + bool compressSamples=true, + bool compressVars=true) const = 0; + + /** @brief Returns the vector of responses + + The function returns ordered or the original categorical responses. Usually it's used in + regression algorithms. + */ + CV_WRAP virtual Mat getTrainResponses() const = 0; + + /** @brief Returns the vector of normalized categorical responses + + The function returns vector of responses. Each response is integer from `0` to `-1`. The actual label value can be retrieved then from the class label vector, see + TrainData::getClassLabels. + */ + CV_WRAP virtual Mat getTrainNormCatResponses() const = 0; + CV_WRAP virtual Mat getTestResponses() const = 0; + CV_WRAP virtual Mat getTestNormCatResponses() const = 0; + CV_WRAP virtual Mat getResponses() const = 0; + CV_WRAP virtual Mat getNormCatResponses() const = 0; + CV_WRAP virtual Mat getSampleWeights() const = 0; + CV_WRAP virtual Mat getTrainSampleWeights() const = 0; + CV_WRAP virtual Mat getTestSampleWeights() const = 0; + CV_WRAP virtual Mat getVarIdx() const = 0; + CV_WRAP virtual Mat getVarType() const = 0; + CV_WRAP virtual int getResponseType() const = 0; + CV_WRAP virtual Mat getTrainSampleIdx() const = 0; + CV_WRAP virtual Mat getTestSampleIdx() const = 0; + CV_WRAP virtual void getValues(int vi, InputArray sidx, float* values) const = 0; + virtual void getNormCatValues(int vi, InputArray sidx, int* values) const = 0; + CV_WRAP virtual Mat getDefaultSubstValues() const = 0; + + CV_WRAP virtual int getCatCount(int vi) const = 0; + + /** @brief Returns the vector of class labels + + The function returns vector of unique labels occurred in the responses. + */ + CV_WRAP virtual Mat getClassLabels() const = 0; + + CV_WRAP virtual Mat getCatOfs() const = 0; + CV_WRAP virtual Mat getCatMap() const = 0; + + /** @brief Splits the training data into the training and test parts + @sa TrainData::setTrainTestSplitRatio + */ + CV_WRAP virtual void setTrainTestSplit(int count, bool shuffle=true) = 0; + + /** @brief Splits the training data into the training and test parts + + The function selects a subset of specified relative size and then returns it as the training + set. If the function is not called, all the data is used for training. Please, note that for + each of TrainData::getTrain\* there is corresponding TrainData::getTest\*, so that the test + subset can be retrieved and processed as well. + @sa TrainData::setTrainTestSplit + */ + CV_WRAP virtual void setTrainTestSplitRatio(double ratio, bool shuffle=true) = 0; + CV_WRAP virtual void shuffleTrainTest() = 0; + + CV_WRAP static Mat getSubVector(const Mat& vec, const Mat& idx); + + /** @brief Reads the dataset from a .csv file and returns the ready-to-use training data. + + @param filename The input file name + @param headerLineCount The number of lines in the beginning to skip; besides the header, the + function also skips empty lines and lines staring with `#` + @param responseStartIdx Index of the first output variable. If -1, the function considers the + last variable as the response + @param responseEndIdx Index of the last output variable + 1. If -1, then there is single + response variable at responseStartIdx. + @param varTypeSpec The optional text string that specifies the variables' types. It has the + format `ord[n1-n2,n3,n4-n5,...]cat[n6,n7-n8,...]`. That is, variables from `n1 to n2` + (inclusive range), `n3`, `n4 to n5` ... are considered ordered and `n6`, `n7 to n8` ... are + considered as categorical. The range `[n1..n2] + [n3] + [n4..n5] + ... + [n6] + [n7..n8]` + should cover all the variables. If varTypeSpec is not specified, then algorithm uses the + following rules: + - all input variables are considered ordered by default. If some column contains has non- + numerical values, e.g. 'apple', 'pear', 'apple', 'apple', 'mango', the corresponding + variable is considered categorical. + - if there are several output variables, they are all considered as ordered. Error is + reported when non-numerical values are used. + - if there is a single output variable, then if its values are non-numerical or are all + integers, then it's considered categorical. Otherwise, it's considered ordered. + @param delimiter The character used to separate values in each line. + @param missch The character used to specify missing measurements. It should not be a digit. + Although it's a non-numerical value, it surely does not affect the decision of whether the + variable ordered or categorical. + @note If the dataset only contains input variables and no responses, use responseStartIdx = -2 + and responseEndIdx = 0. The output variables vector will just contain zeros. + */ + static Ptr loadFromCSV(const String& filename, + int headerLineCount, + int responseStartIdx=-1, + int responseEndIdx=-1, + const String& varTypeSpec=String(), + char delimiter=',', + char missch='?'); + + /** @brief Creates training data from in-memory arrays. + + @param samples matrix of samples. It should have CV_32F type. + @param layout see ml::SampleTypes. + @param responses matrix of responses. If the responses are scalar, they should be stored as a + single row or as a single column. The matrix should have type CV_32F or CV_32S (in the + former case the responses are considered as ordered by default; in the latter case - as + categorical) + @param varIdx vector specifying which variables to use for training. It can be an integer vector + (CV_32S) containing 0-based variable indices or byte vector (CV_8U) containing a mask of + active variables. + @param sampleIdx vector specifying which samples to use for training. It can be an integer + vector (CV_32S) containing 0-based sample indices or byte vector (CV_8U) containing a mask + of training samples. + @param sampleWeights optional vector with weights for each sample. It should have CV_32F type. + @param varType optional vector of type CV_8U and size ` + + `, containing types of each input and output variable. See + ml::VariableTypes. + */ + CV_WRAP static Ptr create(InputArray samples, int layout, InputArray responses, + InputArray varIdx=noArray(), InputArray sampleIdx=noArray(), + InputArray sampleWeights=noArray(), InputArray varType=noArray()); +}; + +/** @brief Base class for statistical models in OpenCV ML. + */ +class CV_EXPORTS_W StatModel : public Algorithm +{ +public: + /** Predict options */ + enum Flags { + UPDATE_MODEL = 1, + RAW_OUTPUT=1, //!< makes the method return the raw results (the sum), not the class label + COMPRESSED_INPUT=2, + PREPROCESSED_INPUT=4 + }; + + /** @brief Returns the number of variables in training samples */ + CV_WRAP virtual int getVarCount() const = 0; + + CV_WRAP virtual bool empty() const; + + /** @brief Returns true if the model is trained */ + CV_WRAP virtual bool isTrained() const = 0; + /** @brief Returns true if the model is classifier */ + CV_WRAP virtual bool isClassifier() const = 0; + + /** @brief Trains the statistical model + + @param trainData training data that can be loaded from file using TrainData::loadFromCSV or + created with TrainData::create. + @param flags optional flags, depending on the model. Some of the models can be updated with the + new training samples, not completely overwritten (such as NormalBayesClassifier or ANN_MLP). + */ + CV_WRAP virtual bool train( const Ptr& trainData, int flags=0 ); + + /** @brief Trains the statistical model + + @param samples training samples + @param layout See ml::SampleTypes. + @param responses vector of responses associated with the training samples. + */ + CV_WRAP virtual bool train( InputArray samples, int layout, InputArray responses ); + + /** @brief Computes error on the training or test dataset + + @param data the training data + @param test if true, the error is computed over the test subset of the data, otherwise it's + computed over the training subset of the data. Please note that if you loaded a completely + different dataset to evaluate already trained classifier, you will probably want not to set + the test subset at all with TrainData::setTrainTestSplitRatio and specify test=false, so + that the error is computed for the whole new set. Yes, this sounds a bit confusing. + @param resp the optional output responses. + + The method uses StatModel::predict to compute the error. For regression models the error is + computed as RMS, for classifiers - as a percent of missclassified samples (0%-100%). + */ + CV_WRAP virtual float calcError( const Ptr& data, bool test, OutputArray resp ) const; + + /** @brief Predicts response(s) for the provided sample(s) + + @param samples The input samples, floating-point matrix + @param results The optional output matrix of results. + @param flags The optional flags, model-dependent. See cv::ml::StatModel::Flags. + */ + CV_WRAP virtual float predict( InputArray samples, OutputArray results=noArray(), int flags=0 ) const = 0; + + /** @brief Create and train model with default parameters + + The class must implement static `create()` method with no parameters or with all default parameter values + */ + template static Ptr<_Tp> train(const Ptr& data, int flags=0) + { + Ptr<_Tp> model = _Tp::create(); + return !model.empty() && model->train(data, flags) ? model : Ptr<_Tp>(); + } +}; + +/****************************************************************************************\ +* Normal Bayes Classifier * +\****************************************************************************************/ + +/** @brief Bayes classifier for normally distributed data. + +@sa @ref ml_intro_bayes + */ +class CV_EXPORTS_W NormalBayesClassifier : public StatModel +{ +public: + /** @brief Predicts the response for sample(s). + + The method estimates the most probable classes for input vectors. Input vectors (one or more) + are stored as rows of the matrix inputs. In case of multiple input vectors, there should be one + output vector outputs. The predicted class for a single input vector is returned by the method. + The vector outputProbs contains the output probabilities corresponding to each element of + result. + */ + CV_WRAP virtual float predictProb( InputArray inputs, OutputArray outputs, + OutputArray outputProbs, int flags=0 ) const = 0; + + /** Creates empty model + Use StatModel::train to train the model after creation. */ + CV_WRAP static Ptr create(); +}; + +/****************************************************************************************\ +* K-Nearest Neighbour Classifier * +\****************************************************************************************/ + +/** @brief The class implements K-Nearest Neighbors model + +@sa @ref ml_intro_knn + */ +class CV_EXPORTS_W KNearest : public StatModel +{ +public: + + /** Default number of neighbors to use in predict method. */ + /** @see setDefaultK */ + CV_WRAP virtual int getDefaultK() const = 0; + /** @copybrief getDefaultK @see getDefaultK */ + CV_WRAP virtual void setDefaultK(int val) = 0; + + /** Whether classification or regression model should be trained. */ + /** @see setIsClassifier */ + CV_WRAP virtual bool getIsClassifier() const = 0; + /** @copybrief getIsClassifier @see getIsClassifier */ + CV_WRAP virtual void setIsClassifier(bool val) = 0; + + /** Parameter for KDTree implementation. */ + /** @see setEmax */ + CV_WRAP virtual int getEmax() const = 0; + /** @copybrief getEmax @see getEmax */ + CV_WRAP virtual void setEmax(int val) = 0; + + /** %Algorithm type, one of KNearest::Types. */ + /** @see setAlgorithmType */ + CV_WRAP virtual int getAlgorithmType() const = 0; + /** @copybrief getAlgorithmType @see getAlgorithmType */ + CV_WRAP virtual void setAlgorithmType(int val) = 0; + + /** @brief Finds the neighbors and predicts responses for input vectors. + + @param samples Input samples stored by rows. It is a single-precision floating-point matrix of + ` * k` size. + @param k Number of used nearest neighbors. Should be greater than 1. + @param results Vector with results of prediction (regression or classification) for each input + sample. It is a single-precision floating-point vector with `` elements. + @param neighborResponses Optional output values for corresponding neighbors. It is a single- + precision floating-point matrix of ` * k` size. + @param dist Optional output distances from the input vectors to the corresponding neighbors. It + is a single-precision floating-point matrix of ` * k` size. + + For each input vector (a row of the matrix samples), the method finds the k nearest neighbors. + In case of regression, the predicted result is a mean value of the particular vector's neighbor + responses. In case of classification, the class is determined by voting. + + For each input vector, the neighbors are sorted by their distances to the vector. + + In case of C++ interface you can use output pointers to empty matrices and the function will + allocate memory itself. + + If only a single input vector is passed, all output matrices are optional and the predicted + value is returned by the method. + + The function is parallelized with the TBB library. + */ + CV_WRAP virtual float findNearest( InputArray samples, int k, + OutputArray results, + OutputArray neighborResponses=noArray(), + OutputArray dist=noArray() ) const = 0; + + /** @brief Implementations of KNearest algorithm + */ + enum Types + { + BRUTE_FORCE=1, + KDTREE=2 + }; + + /** @brief Creates the empty model + + The static method creates empty %KNearest classifier. It should be then trained using StatModel::train method. + */ + CV_WRAP static Ptr create(); +}; + +/****************************************************************************************\ +* Support Vector Machines * +\****************************************************************************************/ + +/** @brief Support Vector Machines. + +@sa @ref ml_intro_svm + */ +class CV_EXPORTS_W SVM : public StatModel +{ +public: + + class CV_EXPORTS Kernel : public Algorithm + { + public: + virtual int getType() const = 0; + virtual void calc( int vcount, int n, const float* vecs, const float* another, float* results ) = 0; + }; + + /** Type of a %SVM formulation. + See SVM::Types. Default value is SVM::C_SVC. */ + /** @see setType */ + CV_WRAP virtual int getType() const = 0; + /** @copybrief getType @see getType */ + CV_WRAP virtual void setType(int val) = 0; + + /** Parameter \f$\gamma\f$ of a kernel function. + For SVM::POLY, SVM::RBF, SVM::SIGMOID or SVM::CHI2. Default value is 1. */ + /** @see setGamma */ + CV_WRAP virtual double getGamma() const = 0; + /** @copybrief getGamma @see getGamma */ + CV_WRAP virtual void setGamma(double val) = 0; + + /** Parameter _coef0_ of a kernel function. + For SVM::POLY or SVM::SIGMOID. Default value is 0.*/ + /** @see setCoef0 */ + CV_WRAP virtual double getCoef0() const = 0; + /** @copybrief getCoef0 @see getCoef0 */ + CV_WRAP virtual void setCoef0(double val) = 0; + + /** Parameter _degree_ of a kernel function. + For SVM::POLY. Default value is 0. */ + /** @see setDegree */ + CV_WRAP virtual double getDegree() const = 0; + /** @copybrief getDegree @see getDegree */ + CV_WRAP virtual void setDegree(double val) = 0; + + /** Parameter _C_ of a %SVM optimization problem. + For SVM::C_SVC, SVM::EPS_SVR or SVM::NU_SVR. Default value is 0. */ + /** @see setC */ + CV_WRAP virtual double getC() const = 0; + /** @copybrief getC @see getC */ + CV_WRAP virtual void setC(double val) = 0; + + /** Parameter \f$\nu\f$ of a %SVM optimization problem. + For SVM::NU_SVC, SVM::ONE_CLASS or SVM::NU_SVR. Default value is 0. */ + /** @see setNu */ + CV_WRAP virtual double getNu() const = 0; + /** @copybrief getNu @see getNu */ + CV_WRAP virtual void setNu(double val) = 0; + + /** Parameter \f$\epsilon\f$ of a %SVM optimization problem. + For SVM::EPS_SVR. Default value is 0. */ + /** @see setP */ + CV_WRAP virtual double getP() const = 0; + /** @copybrief getP @see getP */ + CV_WRAP virtual void setP(double val) = 0; + + /** Optional weights in the SVM::C_SVC problem, assigned to particular classes. + They are multiplied by _C_ so the parameter _C_ of class _i_ becomes `classWeights(i) * C`. Thus + these weights affect the misclassification penalty for different classes. The larger weight, + the larger penalty on misclassification of data from the corresponding class. Default value is + empty Mat. */ + /** @see setClassWeights */ + CV_WRAP virtual cv::Mat getClassWeights() const = 0; + /** @copybrief getClassWeights @see getClassWeights */ + CV_WRAP virtual void setClassWeights(const cv::Mat &val) = 0; + + /** Termination criteria of the iterative %SVM training procedure which solves a partial + case of constrained quadratic optimization problem. + You can specify tolerance and/or the maximum number of iterations. Default value is + `TermCriteria( TermCriteria::MAX_ITER + TermCriteria::EPS, 1000, FLT_EPSILON )`; */ + /** @see setTermCriteria */ + CV_WRAP virtual cv::TermCriteria getTermCriteria() const = 0; + /** @copybrief getTermCriteria @see getTermCriteria */ + CV_WRAP virtual void setTermCriteria(const cv::TermCriteria &val) = 0; + + /** Type of a %SVM kernel. + See SVM::KernelTypes. Default value is SVM::RBF. */ + CV_WRAP virtual int getKernelType() const = 0; + + /** Initialize with one of predefined kernels. + See SVM::KernelTypes. */ + CV_WRAP virtual void setKernel(int kernelType) = 0; + + /** Initialize with custom kernel. + See SVM::Kernel class for implementation details */ + virtual void setCustomKernel(const Ptr &_kernel) = 0; + + //! %SVM type + enum Types { + /** C-Support Vector Classification. n-class classification (n \f$\geq\f$ 2), allows + imperfect separation of classes with penalty multiplier C for outliers. */ + C_SVC=100, + /** \f$\nu\f$-Support Vector Classification. n-class classification with possible + imperfect separation. Parameter \f$\nu\f$ (in the range 0..1, the larger the value, the smoother + the decision boundary) is used instead of C. */ + NU_SVC=101, + /** Distribution Estimation (One-class %SVM). All the training data are from + the same class, %SVM builds a boundary that separates the class from the rest of the feature + space. */ + ONE_CLASS=102, + /** \f$\epsilon\f$-Support Vector Regression. The distance between feature vectors + from the training set and the fitting hyper-plane must be less than p. For outliers the + penalty multiplier C is used. */ + EPS_SVR=103, + /** \f$\nu\f$-Support Vector Regression. \f$\nu\f$ is used instead of p. + See @cite LibSVM for details. */ + NU_SVR=104 + }; + + /** @brief %SVM kernel type + + A comparison of different kernels on the following 2D test case with four classes. Four + SVM::C_SVC SVMs have been trained (one against rest) with auto_train. Evaluation on three + different kernels (SVM::CHI2, SVM::INTER, SVM::RBF). The color depicts the class with max score. + Bright means max-score \> 0, dark means max-score \< 0. + ![image](pics/SVM_Comparison.png) + */ + enum KernelTypes { + /** Returned by SVM::getKernelType in case when custom kernel has been set */ + CUSTOM=-1, + /** Linear kernel. No mapping is done, linear discrimination (or regression) is + done in the original feature space. It is the fastest option. \f$K(x_i, x_j) = x_i^T x_j\f$. */ + LINEAR=0, + /** Polynomial kernel: + \f$K(x_i, x_j) = (\gamma x_i^T x_j + coef0)^{degree}, \gamma > 0\f$. */ + POLY=1, + /** Radial basis function (RBF), a good choice in most cases. + \f$K(x_i, x_j) = e^{-\gamma ||x_i - x_j||^2}, \gamma > 0\f$. */ + RBF=2, + /** Sigmoid kernel: \f$K(x_i, x_j) = \tanh(\gamma x_i^T x_j + coef0)\f$. */ + SIGMOID=3, + /** Exponential Chi2 kernel, similar to the RBF kernel: + \f$K(x_i, x_j) = e^{-\gamma \chi^2(x_i,x_j)}, \chi^2(x_i,x_j) = (x_i-x_j)^2/(x_i+x_j), \gamma > 0\f$. */ + CHI2=4, + /** Histogram intersection kernel. A fast kernel. \f$K(x_i, x_j) = min(x_i,x_j)\f$. */ + INTER=5 + }; + + //! %SVM params type + enum ParamTypes { + C=0, + GAMMA=1, + P=2, + NU=3, + COEF=4, + DEGREE=5 + }; + + /** @brief Trains an %SVM with optimal parameters. + + @param data the training data that can be constructed using TrainData::create or + TrainData::loadFromCSV. + @param kFold Cross-validation parameter. The training set is divided into kFold subsets. One + subset is used to test the model, the others form the train set. So, the %SVM algorithm is + executed kFold times. + @param Cgrid grid for C + @param gammaGrid grid for gamma + @param pGrid grid for p + @param nuGrid grid for nu + @param coeffGrid grid for coeff + @param degreeGrid grid for degree + @param balanced If true and the problem is 2-class classification then the method creates more + balanced cross-validation subsets that is proportions between classes in subsets are close + to such proportion in the whole train dataset. + + The method trains the %SVM model automatically by choosing the optimal parameters C, gamma, p, + nu, coef0, degree. Parameters are considered optimal when the cross-validation + estimate of the test set error is minimal. + + If there is no need to optimize a parameter, the corresponding grid step should be set to any + value less than or equal to 1. For example, to avoid optimization in gamma, set `gammaGrid.step + = 0`, `gammaGrid.minVal`, `gamma_grid.maxVal` as arbitrary numbers. In this case, the value + `Gamma` is taken for gamma. + + And, finally, if the optimization in a parameter is required but the corresponding grid is + unknown, you may call the function SVM::getDefaultGrid. To generate a grid, for example, for + gamma, call `SVM::getDefaultGrid(SVM::GAMMA)`. + + This function works for the classification (SVM::C_SVC or SVM::NU_SVC) as well as for the + regression (SVM::EPS_SVR or SVM::NU_SVR). If it is SVM::ONE_CLASS, no optimization is made and + the usual %SVM with parameters specified in params is executed. + */ + virtual bool trainAuto( const Ptr& data, int kFold = 10, + ParamGrid Cgrid = SVM::getDefaultGrid(SVM::C), + ParamGrid gammaGrid = SVM::getDefaultGrid(SVM::GAMMA), + ParamGrid pGrid = SVM::getDefaultGrid(SVM::P), + ParamGrid nuGrid = SVM::getDefaultGrid(SVM::NU), + ParamGrid coeffGrid = SVM::getDefaultGrid(SVM::COEF), + ParamGrid degreeGrid = SVM::getDefaultGrid(SVM::DEGREE), + bool balanced=false) = 0; + + /** @brief Retrieves all the support vectors + + The method returns all the support vectors as a floating-point matrix, where support vectors are + stored as matrix rows. + */ + CV_WRAP virtual Mat getSupportVectors() const = 0; + + /** @brief Retrieves all the uncompressed support vectors of a linear %SVM + + The method returns all the uncompressed support vectors of a linear %SVM that the compressed + support vector, used for prediction, was derived from. They are returned in a floating-point + matrix, where the support vectors are stored as matrix rows. + */ + CV_WRAP Mat getUncompressedSupportVectors() const; + + /** @brief Retrieves the decision function + + @param i the index of the decision function. If the problem solved is regression, 1-class or + 2-class classification, then there will be just one decision function and the index should + always be 0. Otherwise, in the case of N-class classification, there will be \f$N(N-1)/2\f$ + decision functions. + @param alpha the optional output vector for weights, corresponding to different support vectors. + In the case of linear %SVM all the alpha's will be 1's. + @param svidx the optional output vector of indices of support vectors within the matrix of + support vectors (which can be retrieved by SVM::getSupportVectors). In the case of linear + %SVM each decision function consists of a single "compressed" support vector. + + The method returns rho parameter of the decision function, a scalar subtracted from the weighted + sum of kernel responses. + */ + CV_WRAP virtual double getDecisionFunction(int i, OutputArray alpha, OutputArray svidx) const = 0; + + /** @brief Generates a grid for %SVM parameters. + + @param param_id %SVM parameters IDs that must be one of the SVM::ParamTypes. The grid is + generated for the parameter with this ID. + + The function generates a grid for the specified parameter of the %SVM algorithm. The grid may be + passed to the function SVM::trainAuto. + */ + static ParamGrid getDefaultGrid( int param_id ); + + /** Creates empty model. + Use StatModel::train to train the model. Since %SVM has several parameters, you may want to + find the best parameters for your problem, it can be done with SVM::trainAuto. */ + CV_WRAP static Ptr create(); +}; + +/****************************************************************************************\ +* Expectation - Maximization * +\****************************************************************************************/ + +/** @brief The class implements the Expectation Maximization algorithm. + +@sa @ref ml_intro_em + */ +class CV_EXPORTS_W EM : public StatModel +{ +public: + //! Type of covariation matrices + enum Types { + /** A scaled identity matrix \f$\mu_k * I\f$. There is the only + parameter \f$\mu_k\f$ to be estimated for each matrix. The option may be used in special cases, + when the constraint is relevant, or as a first step in the optimization (for example in case + when the data is preprocessed with PCA). The results of such preliminary estimation may be + passed again to the optimization procedure, this time with + covMatType=EM::COV_MAT_DIAGONAL. */ + COV_MAT_SPHERICAL=0, + /** A diagonal matrix with positive diagonal elements. The number of + free parameters is d for each matrix. This is most commonly used option yielding good + estimation results. */ + COV_MAT_DIAGONAL=1, + /** A symmetric positively defined matrix. The number of free + parameters in each matrix is about \f$d^2/2\f$. It is not recommended to use this option, unless + there is pretty accurate initial estimation of the parameters and/or a huge number of + training samples. */ + COV_MAT_GENERIC=2, + COV_MAT_DEFAULT=COV_MAT_DIAGONAL + }; + + //! Default parameters + enum {DEFAULT_NCLUSTERS=5, DEFAULT_MAX_ITERS=100}; + + //! The initial step + enum {START_E_STEP=1, START_M_STEP=2, START_AUTO_STEP=0}; + + /** The number of mixture components in the Gaussian mixture model. + Default value of the parameter is EM::DEFAULT_NCLUSTERS=5. Some of %EM implementation could + determine the optimal number of mixtures within a specified value range, but that is not the + case in ML yet. */ + /** @see setClustersNumber */ + CV_WRAP virtual int getClustersNumber() const = 0; + /** @copybrief getClustersNumber @see getClustersNumber */ + CV_WRAP virtual void setClustersNumber(int val) = 0; + + /** Constraint on covariance matrices which defines type of matrices. + See EM::Types. */ + /** @see setCovarianceMatrixType */ + CV_WRAP virtual int getCovarianceMatrixType() const = 0; + /** @copybrief getCovarianceMatrixType @see getCovarianceMatrixType */ + CV_WRAP virtual void setCovarianceMatrixType(int val) = 0; + + /** The termination criteria of the %EM algorithm. + The %EM algorithm can be terminated by the number of iterations termCrit.maxCount (number of + M-steps) or when relative change of likelihood logarithm is less than termCrit.epsilon. Default + maximum number of iterations is EM::DEFAULT_MAX_ITERS=100. */ + /** @see setTermCriteria */ + CV_WRAP virtual TermCriteria getTermCriteria() const = 0; + /** @copybrief getTermCriteria @see getTermCriteria */ + CV_WRAP virtual void setTermCriteria(const TermCriteria &val) = 0; + + /** @brief Returns weights of the mixtures + + Returns vector with the number of elements equal to the number of mixtures. + */ + CV_WRAP virtual Mat getWeights() const = 0; + /** @brief Returns the cluster centers (means of the Gaussian mixture) + + Returns matrix with the number of rows equal to the number of mixtures and number of columns + equal to the space dimensionality. + */ + CV_WRAP virtual Mat getMeans() const = 0; + /** @brief Returns covariation matrices + + Returns vector of covariation matrices. Number of matrices is the number of gaussian mixtures, + each matrix is a square floating-point matrix NxN, where N is the space dimensionality. + */ + CV_WRAP virtual void getCovs(CV_OUT std::vector& covs) const = 0; + + /** @brief Returns a likelihood logarithm value and an index of the most probable mixture component + for the given sample. + + @param sample A sample for classification. It should be a one-channel matrix of + \f$1 \times dims\f$ or \f$dims \times 1\f$ size. + @param probs Optional output matrix that contains posterior probabilities of each component + given the sample. It has \f$1 \times nclusters\f$ size and CV_64FC1 type. + + The method returns a two-element double vector. Zero element is a likelihood logarithm value for + the sample. First element is an index of the most probable mixture component for the given + sample. + */ + CV_WRAP virtual Vec2d predict2(InputArray sample, OutputArray probs) const = 0; + + /** @brief Estimate the Gaussian mixture parameters from a samples set. + + This variation starts with Expectation step. Initial values of the model parameters will be + estimated by the k-means algorithm. + + Unlike many of the ML models, %EM is an unsupervised learning algorithm and it does not take + responses (class labels or function values) as input. Instead, it computes the *Maximum + Likelihood Estimate* of the Gaussian mixture parameters from an input sample set, stores all the + parameters inside the structure: \f$p_{i,k}\f$ in probs, \f$a_k\f$ in means , \f$S_k\f$ in + covs[k], \f$\pi_k\f$ in weights , and optionally computes the output "class label" for each + sample: \f$\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\f$ (indices of the most + probable mixture component for each sample). + + The trained model can be used further for prediction, just like any other classifier. The + trained model is similar to the NormalBayesClassifier. + + @param samples Samples from which the Gaussian mixture model will be estimated. It should be a + one-channel matrix, each row of which is a sample. If the matrix does not have CV_64F type + it will be converted to the inner matrix of such type for the further computing. + @param logLikelihoods The optional output matrix that contains a likelihood logarithm value for + each sample. It has \f$nsamples \times 1\f$ size and CV_64FC1 type. + @param labels The optional output "class label" for each sample: + \f$\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\f$ (indices of the most probable + mixture component for each sample). It has \f$nsamples \times 1\f$ size and CV_32SC1 type. + @param probs The optional output matrix that contains posterior probabilities of each Gaussian + mixture component given the each sample. It has \f$nsamples \times nclusters\f$ size and + CV_64FC1 type. + */ + CV_WRAP virtual bool trainEM(InputArray samples, + OutputArray logLikelihoods=noArray(), + OutputArray labels=noArray(), + OutputArray probs=noArray()) = 0; + + /** @brief Estimate the Gaussian mixture parameters from a samples set. + + This variation starts with Expectation step. You need to provide initial means \f$a_k\f$ of + mixture components. Optionally you can pass initial weights \f$\pi_k\f$ and covariance matrices + \f$S_k\f$ of mixture components. + + @param samples Samples from which the Gaussian mixture model will be estimated. It should be a + one-channel matrix, each row of which is a sample. If the matrix does not have CV_64F type + it will be converted to the inner matrix of such type for the further computing. + @param means0 Initial means \f$a_k\f$ of mixture components. It is a one-channel matrix of + \f$nclusters \times dims\f$ size. If the matrix does not have CV_64F type it will be + converted to the inner matrix of such type for the further computing. + @param covs0 The vector of initial covariance matrices \f$S_k\f$ of mixture components. Each of + covariance matrices is a one-channel matrix of \f$dims \times dims\f$ size. If the matrices + do not have CV_64F type they will be converted to the inner matrices of such type for the + further computing. + @param weights0 Initial weights \f$\pi_k\f$ of mixture components. It should be a one-channel + floating-point matrix with \f$1 \times nclusters\f$ or \f$nclusters \times 1\f$ size. + @param logLikelihoods The optional output matrix that contains a likelihood logarithm value for + each sample. It has \f$nsamples \times 1\f$ size and CV_64FC1 type. + @param labels The optional output "class label" for each sample: + \f$\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\f$ (indices of the most probable + mixture component for each sample). It has \f$nsamples \times 1\f$ size and CV_32SC1 type. + @param probs The optional output matrix that contains posterior probabilities of each Gaussian + mixture component given the each sample. It has \f$nsamples \times nclusters\f$ size and + CV_64FC1 type. + */ + CV_WRAP virtual bool trainE(InputArray samples, InputArray means0, + InputArray covs0=noArray(), + InputArray weights0=noArray(), + OutputArray logLikelihoods=noArray(), + OutputArray labels=noArray(), + OutputArray probs=noArray()) = 0; + + /** @brief Estimate the Gaussian mixture parameters from a samples set. + + This variation starts with Maximization step. You need to provide initial probabilities + \f$p_{i,k}\f$ to use this option. + + @param samples Samples from which the Gaussian mixture model will be estimated. It should be a + one-channel matrix, each row of which is a sample. If the matrix does not have CV_64F type + it will be converted to the inner matrix of such type for the further computing. + @param probs0 + @param logLikelihoods The optional output matrix that contains a likelihood logarithm value for + each sample. It has \f$nsamples \times 1\f$ size and CV_64FC1 type. + @param labels The optional output "class label" for each sample: + \f$\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\f$ (indices of the most probable + mixture component for each sample). It has \f$nsamples \times 1\f$ size and CV_32SC1 type. + @param probs The optional output matrix that contains posterior probabilities of each Gaussian + mixture component given the each sample. It has \f$nsamples \times nclusters\f$ size and + CV_64FC1 type. + */ + CV_WRAP virtual bool trainM(InputArray samples, InputArray probs0, + OutputArray logLikelihoods=noArray(), + OutputArray labels=noArray(), + OutputArray probs=noArray()) = 0; + + /** Creates empty %EM model. + The model should be trained then using StatModel::train(traindata, flags) method. Alternatively, you + can use one of the EM::train\* methods or load it from file using Algorithm::load\(filename). + */ + CV_WRAP static Ptr create(); +}; + +/****************************************************************************************\ +* Decision Tree * +\****************************************************************************************/ + +/** @brief The class represents a single decision tree or a collection of decision trees. + +The current public interface of the class allows user to train only a single decision tree, however +the class is capable of storing multiple decision trees and using them for prediction (by summing +responses or using a voting schemes), and the derived from DTrees classes (such as RTrees and Boost) +use this capability to implement decision tree ensembles. + +@sa @ref ml_intro_trees +*/ +class CV_EXPORTS_W DTrees : public StatModel +{ +public: + /** Predict options */ + enum Flags { PREDICT_AUTO=0, PREDICT_SUM=(1<<8), PREDICT_MAX_VOTE=(2<<8), PREDICT_MASK=(3<<8) }; + + /** Cluster possible values of a categorical variable into K\<=maxCategories clusters to + find a suboptimal split. + If a discrete variable, on which the training procedure tries to make a split, takes more than + maxCategories values, the precise best subset estimation may take a very long time because the + algorithm is exponential. Instead, many decision trees engines (including our implementation) + try to find sub-optimal split in this case by clustering all the samples into maxCategories + clusters that is some categories are merged together. The clustering is applied only in n \> + 2-class classification problems for categorical variables with N \> max_categories possible + values. In case of regression and 2-class classification the optimal split can be found + efficiently without employing clustering, thus the parameter is not used in these cases. + Default value is 10.*/ + /** @see setMaxCategories */ + CV_WRAP virtual int getMaxCategories() const = 0; + /** @copybrief getMaxCategories @see getMaxCategories */ + CV_WRAP virtual void setMaxCategories(int val) = 0; + + /** The maximum possible depth of the tree. + That is the training algorithms attempts to split a node while its depth is less than maxDepth. + The root node has zero depth. The actual depth may be smaller if the other termination criteria + are met (see the outline of the training procedure @ref ml_intro_trees "here"), and/or if the + tree is pruned. Default value is INT_MAX.*/ + /** @see setMaxDepth */ + CV_WRAP virtual int getMaxDepth() const = 0; + /** @copybrief getMaxDepth @see getMaxDepth */ + CV_WRAP virtual void setMaxDepth(int val) = 0; + + /** If the number of samples in a node is less than this parameter then the node will not be split. + + Default value is 10.*/ + /** @see setMinSampleCount */ + CV_WRAP virtual int getMinSampleCount() const = 0; + /** @copybrief getMinSampleCount @see getMinSampleCount */ + CV_WRAP virtual void setMinSampleCount(int val) = 0; + + /** If CVFolds \> 1 then algorithms prunes the built decision tree using K-fold + cross-validation procedure where K is equal to CVFolds. + Default value is 10.*/ + /** @see setCVFolds */ + CV_WRAP virtual int getCVFolds() const = 0; + /** @copybrief getCVFolds @see getCVFolds */ + CV_WRAP virtual void setCVFolds(int val) = 0; + + /** If true then surrogate splits will be built. + These splits allow to work with missing data and compute variable importance correctly. + Default value is false. + @note currently it's not implemented.*/ + /** @see setUseSurrogates */ + CV_WRAP virtual bool getUseSurrogates() const = 0; + /** @copybrief getUseSurrogates @see getUseSurrogates */ + CV_WRAP virtual void setUseSurrogates(bool val) = 0; + + /** If true then a pruning will be harsher. + This will make a tree more compact and more resistant to the training data noise but a bit less + accurate. Default value is true.*/ + /** @see setUse1SERule */ + CV_WRAP virtual bool getUse1SERule() const = 0; + /** @copybrief getUse1SERule @see getUse1SERule */ + CV_WRAP virtual void setUse1SERule(bool val) = 0; + + /** If true then pruned branches are physically removed from the tree. + Otherwise they are retained and it is possible to get results from the original unpruned (or + pruned less aggressively) tree. Default value is true.*/ + /** @see setTruncatePrunedTree */ + CV_WRAP virtual bool getTruncatePrunedTree() const = 0; + /** @copybrief getTruncatePrunedTree @see getTruncatePrunedTree */ + CV_WRAP virtual void setTruncatePrunedTree(bool val) = 0; + + /** Termination criteria for regression trees. + If all absolute differences between an estimated value in a node and values of train samples + in this node are less than this parameter then the node will not be split further. Default + value is 0.01f*/ + /** @see setRegressionAccuracy */ + CV_WRAP virtual float getRegressionAccuracy() const = 0; + /** @copybrief getRegressionAccuracy @see getRegressionAccuracy */ + CV_WRAP virtual void setRegressionAccuracy(float val) = 0; + + /** @brief The array of a priori class probabilities, sorted by the class label value. + + The parameter can be used to tune the decision tree preferences toward a certain class. For + example, if you want to detect some rare anomaly occurrence, the training base will likely + contain much more normal cases than anomalies, so a very good classification performance + will be achieved just by considering every case as normal. To avoid this, the priors can be + specified, where the anomaly probability is artificially increased (up to 0.5 or even + greater), so the weight of the misclassified anomalies becomes much bigger, and the tree is + adjusted properly. + + You can also think about this parameter as weights of prediction categories which determine + relative weights that you give to misclassification. That is, if the weight of the first + category is 1 and the weight of the second category is 10, then each mistake in predicting + the second category is equivalent to making 10 mistakes in predicting the first category. + Default value is empty Mat.*/ + /** @see setPriors */ + CV_WRAP virtual cv::Mat getPriors() const = 0; + /** @copybrief getPriors @see getPriors */ + CV_WRAP virtual void setPriors(const cv::Mat &val) = 0; + + /** @brief The class represents a decision tree node. + */ + class CV_EXPORTS Node + { + public: + Node(); + double value; //!< Value at the node: a class label in case of classification or estimated + //!< function value in case of regression. + int classIdx; //!< Class index normalized to 0..class_count-1 range and assigned to the + //!< node. It is used internally in classification trees and tree ensembles. + int parent; //!< Index of the parent node + int left; //!< Index of the left child node + int right; //!< Index of right child node + int defaultDir; //!< Default direction where to go (-1: left or +1: right). It helps in the + //!< case of missing values. + int split; //!< Index of the first split + }; + + /** @brief The class represents split in a decision tree. + */ + class CV_EXPORTS Split + { + public: + Split(); + int varIdx; //!< Index of variable on which the split is created. + bool inversed; //!< If true, then the inverse split rule is used (i.e. left and right + //!< branches are exchanged in the rule expressions below). + float quality; //!< The split quality, a positive number. It is used to choose the best split. + int next; //!< Index of the next split in the list of splits for the node + float c; /**< The threshold value in case of split on an ordered variable. + The rule is: + @code{.none} + if var_value < c + then next_node <- left + else next_node <- right + @endcode */ + int subsetOfs; /**< Offset of the bitset used by the split on a categorical variable. + The rule is: + @code{.none} + if bitset[var_value] == 1 + then next_node <- left + else next_node <- right + @endcode */ + }; + + /** @brief Returns indices of root nodes + */ + virtual const std::vector& getRoots() const = 0; + /** @brief Returns all the nodes + + all the node indices are indices in the returned vector + */ + virtual const std::vector& getNodes() const = 0; + /** @brief Returns all the splits + + all the split indices are indices in the returned vector + */ + virtual const std::vector& getSplits() const = 0; + /** @brief Returns all the bitsets for categorical splits + + Split::subsetOfs is an offset in the returned vector + */ + virtual const std::vector& getSubsets() const = 0; + + /** @brief Creates the empty model + + The static method creates empty decision tree with the specified parameters. It should be then + trained using train method (see StatModel::train). Alternatively, you can load the model from + file using Algorithm::load\(filename). + */ + CV_WRAP static Ptr create(); +}; + +/****************************************************************************************\ +* Random Trees Classifier * +\****************************************************************************************/ + +/** @brief The class implements the random forest predictor. + +@sa @ref ml_intro_rtrees + */ +class CV_EXPORTS_W RTrees : public DTrees +{ +public: + + /** If true then variable importance will be calculated and then it can be retrieved by RTrees::getVarImportance. + Default value is false.*/ + /** @see setCalculateVarImportance */ + CV_WRAP virtual bool getCalculateVarImportance() const = 0; + /** @copybrief getCalculateVarImportance @see getCalculateVarImportance */ + CV_WRAP virtual void setCalculateVarImportance(bool val) = 0; + + /** The size of the randomly selected subset of features at each tree node and that are used + to find the best split(s). + If you set it to 0 then the size will be set to the square root of the total number of + features. Default value is 0.*/ + /** @see setActiveVarCount */ + CV_WRAP virtual int getActiveVarCount() const = 0; + /** @copybrief getActiveVarCount @see getActiveVarCount */ + CV_WRAP virtual void setActiveVarCount(int val) = 0; + + /** The termination criteria that specifies when the training algorithm stops. + Either when the specified number of trees is trained and added to the ensemble or when + sufficient accuracy (measured as OOB error) is achieved. Typically the more trees you have the + better the accuracy. However, the improvement in accuracy generally diminishes and asymptotes + pass a certain number of trees. Also to keep in mind, the number of tree increases the + prediction time linearly. Default value is TermCriteria(TermCriteria::MAX_ITERS + + TermCriteria::EPS, 50, 0.1)*/ + /** @see setTermCriteria */ + CV_WRAP virtual TermCriteria getTermCriteria() const = 0; + /** @copybrief getTermCriteria @see getTermCriteria */ + CV_WRAP virtual void setTermCriteria(const TermCriteria &val) = 0; + + /** Returns the variable importance array. + The method returns the variable importance vector, computed at the training stage when + CalculateVarImportance is set to true. If this flag was set to false, the empty matrix is + returned. + */ + CV_WRAP virtual Mat getVarImportance() const = 0; + + /** Creates the empty model. + Use StatModel::train to train the model, StatModel::train to create and train the model, + Algorithm::load to load the pre-trained model. + */ + CV_WRAP static Ptr create(); +}; + +/****************************************************************************************\ +* Boosted tree classifier * +\****************************************************************************************/ + +/** @brief Boosted tree classifier derived from DTrees + +@sa @ref ml_intro_boost + */ +class CV_EXPORTS_W Boost : public DTrees +{ +public: + /** Type of the boosting algorithm. + See Boost::Types. Default value is Boost::REAL. */ + /** @see setBoostType */ + CV_WRAP virtual int getBoostType() const = 0; + /** @copybrief getBoostType @see getBoostType */ + CV_WRAP virtual void setBoostType(int val) = 0; + + /** The number of weak classifiers. + Default value is 100. */ + /** @see setWeakCount */ + CV_WRAP virtual int getWeakCount() const = 0; + /** @copybrief getWeakCount @see getWeakCount */ + CV_WRAP virtual void setWeakCount(int val) = 0; + + /** A threshold between 0 and 1 used to save computational time. + Samples with summary weight \f$\leq 1 - weight_trim_rate\f$ do not participate in the *next* + iteration of training. Set this parameter to 0 to turn off this functionality. Default value is 0.95.*/ + /** @see setWeightTrimRate */ + CV_WRAP virtual double getWeightTrimRate() const = 0; + /** @copybrief getWeightTrimRate @see getWeightTrimRate */ + CV_WRAP virtual void setWeightTrimRate(double val) = 0; + + /** Boosting type. + Gentle AdaBoost and Real AdaBoost are often the preferable choices. */ + enum Types { + DISCRETE=0, //!< Discrete AdaBoost. + REAL=1, //!< Real AdaBoost. It is a technique that utilizes confidence-rated predictions + //!< and works well with categorical data. + LOGIT=2, //!< LogitBoost. It can produce good regression fits. + GENTLE=3 //!< Gentle AdaBoost. It puts less weight on outlier data points and for that + //!(filename) to load the pre-trained model. */ + CV_WRAP static Ptr create(); +}; + +/****************************************************************************************\ +* Gradient Boosted Trees * +\****************************************************************************************/ + +/*class CV_EXPORTS_W GBTrees : public DTrees +{ +public: + struct CV_EXPORTS_W_MAP Params : public DTrees::Params + { + CV_PROP_RW int weakCount; + CV_PROP_RW int lossFunctionType; + CV_PROP_RW float subsamplePortion; + CV_PROP_RW float shrinkage; + + Params(); + Params( int lossFunctionType, int weakCount, float shrinkage, + float subsamplePortion, int maxDepth, bool useSurrogates ); + }; + + enum {SQUARED_LOSS=0, ABSOLUTE_LOSS, HUBER_LOSS=3, DEVIANCE_LOSS}; + + virtual void setK(int k) = 0; + + virtual float predictSerial( InputArray samples, + OutputArray weakResponses, int flags) const = 0; + + static Ptr create(const Params& p); +};*/ + +/****************************************************************************************\ +* Artificial Neural Networks (ANN) * +\****************************************************************************************/ + +/////////////////////////////////// Multi-Layer Perceptrons ////////////////////////////// + +/** @brief Artificial Neural Networks - Multi-Layer Perceptrons. + +Unlike many other models in ML that are constructed and trained at once, in the MLP model these +steps are separated. First, a network with the specified topology is created using the non-default +constructor or the method ANN_MLP::create. All the weights are set to zeros. Then, the network is +trained using a set of input and output vectors. The training procedure can be repeated more than +once, that is, the weights can be adjusted based on the new training data. + +Additional flags for StatModel::train are available: ANN_MLP::TrainFlags. + +@sa @ref ml_intro_ann + */ +class CV_EXPORTS_W ANN_MLP : public StatModel +{ +public: + /** Available training methods */ + enum TrainingMethods { + BACKPROP=0, //!< The back-propagation algorithm. + RPROP=1 //!< The RPROP algorithm. See @cite RPROP93 for details. + }; + + /** Sets training method and common parameters. + @param method Default value is ANN_MLP::RPROP. See ANN_MLP::TrainingMethods. + @param param1 passed to setRpropDW0 for ANN_MLP::RPROP and to setBackpropWeightScale for ANN_MLP::BACKPROP + @param param2 passed to setRpropDWMin for ANN_MLP::RPROP and to setBackpropMomentumScale for ANN_MLP::BACKPROP. + */ + CV_WRAP virtual void setTrainMethod(int method, double param1 = 0, double param2 = 0) = 0; + + /** Returns current training method */ + CV_WRAP virtual int getTrainMethod() const = 0; + + /** Initialize the activation function for each neuron. + Currently the default and the only fully supported activation function is ANN_MLP::SIGMOID_SYM. + @param type The type of activation function. See ANN_MLP::ActivationFunctions. + @param param1 The first parameter of the activation function, \f$\alpha\f$. Default value is 0. + @param param2 The second parameter of the activation function, \f$\beta\f$. Default value is 0. + */ + CV_WRAP virtual void setActivationFunction(int type, double param1 = 0, double param2 = 0) = 0; + + /** Integer vector specifying the number of neurons in each layer including the input and output layers. + The very first element specifies the number of elements in the input layer. + The last element - number of elements in the output layer. Default value is empty Mat. + @sa getLayerSizes */ + CV_WRAP virtual void setLayerSizes(InputArray _layer_sizes) = 0; + + /** Integer vector specifying the number of neurons in each layer including the input and output layers. + The very first element specifies the number of elements in the input layer. + The last element - number of elements in the output layer. + @sa setLayerSizes */ + CV_WRAP virtual cv::Mat getLayerSizes() const = 0; + + /** Termination criteria of the training algorithm. + You can specify the maximum number of iterations (maxCount) and/or how much the error could + change between the iterations to make the algorithm continue (epsilon). Default value is + TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 1000, 0.01).*/ + /** @see setTermCriteria */ + CV_WRAP virtual TermCriteria getTermCriteria() const = 0; + /** @copybrief getTermCriteria @see getTermCriteria */ + CV_WRAP virtual void setTermCriteria(TermCriteria val) = 0; + + /** BPROP: Strength of the weight gradient term. + The recommended value is about 0.1. Default value is 0.1.*/ + /** @see setBackpropWeightScale */ + CV_WRAP virtual double getBackpropWeightScale() const = 0; + /** @copybrief getBackpropWeightScale @see getBackpropWeightScale */ + CV_WRAP virtual void setBackpropWeightScale(double val) = 0; + + /** BPROP: Strength of the momentum term (the difference between weights on the 2 previous iterations). + This parameter provides some inertia to smooth the random fluctuations of the weights. It can + vary from 0 (the feature is disabled) to 1 and beyond. The value 0.1 or so is good enough. + Default value is 0.1.*/ + /** @see setBackpropMomentumScale */ + CV_WRAP virtual double getBackpropMomentumScale() const = 0; + /** @copybrief getBackpropMomentumScale @see getBackpropMomentumScale */ + CV_WRAP virtual void setBackpropMomentumScale(double val) = 0; + + /** RPROP: Initial value \f$\Delta_0\f$ of update-values \f$\Delta_{ij}\f$. + Default value is 0.1.*/ + /** @see setRpropDW0 */ + CV_WRAP virtual double getRpropDW0() const = 0; + /** @copybrief getRpropDW0 @see getRpropDW0 */ + CV_WRAP virtual void setRpropDW0(double val) = 0; + + /** RPROP: Increase factor \f$\eta^+\f$. + It must be \>1. Default value is 1.2.*/ + /** @see setRpropDWPlus */ + CV_WRAP virtual double getRpropDWPlus() const = 0; + /** @copybrief getRpropDWPlus @see getRpropDWPlus */ + CV_WRAP virtual void setRpropDWPlus(double val) = 0; + + /** RPROP: Decrease factor \f$\eta^-\f$. + It must be \<1. Default value is 0.5.*/ + /** @see setRpropDWMinus */ + CV_WRAP virtual double getRpropDWMinus() const = 0; + /** @copybrief getRpropDWMinus @see getRpropDWMinus */ + CV_WRAP virtual void setRpropDWMinus(double val) = 0; + + /** RPROP: Update-values lower limit \f$\Delta_{min}\f$. + It must be positive. Default value is FLT_EPSILON.*/ + /** @see setRpropDWMin */ + CV_WRAP virtual double getRpropDWMin() const = 0; + /** @copybrief getRpropDWMin @see getRpropDWMin */ + CV_WRAP virtual void setRpropDWMin(double val) = 0; + + /** RPROP: Update-values upper limit \f$\Delta_{max}\f$. + It must be \>1. Default value is 50.*/ + /** @see setRpropDWMax */ + CV_WRAP virtual double getRpropDWMax() const = 0; + /** @copybrief getRpropDWMax @see getRpropDWMax */ + CV_WRAP virtual void setRpropDWMax(double val) = 0; + + /** possible activation functions */ + enum ActivationFunctions { + /** Identity function: \f$f(x)=x\f$ */ + IDENTITY = 0, + /** Symmetrical sigmoid: \f$f(x)=\beta*(1-e^{-\alpha x})/(1+e^{-\alpha x}\f$ + @note + If you are using the default sigmoid activation function with the default parameter values + fparam1=0 and fparam2=0 then the function used is y = 1.7159\*tanh(2/3 \* x), so the output + will range from [-1.7159, 1.7159], instead of [0,1].*/ + SIGMOID_SYM = 1, + /** Gaussian function: \f$f(x)=\beta e^{-\alpha x*x}\f$ */ + GAUSSIAN = 2 + }; + + /** Train options */ + enum TrainFlags { + /** Update the network weights, rather than compute them from scratch. In the latter case + the weights are initialized using the Nguyen-Widrow algorithm. */ + UPDATE_WEIGHTS = 1, + /** Do not normalize the input vectors. If this flag is not set, the training algorithm + normalizes each input feature independently, shifting its mean value to 0 and making the + standard deviation equal to 1. If the network is assumed to be updated frequently, the new + training data could be much different from original one. In this case, you should take care + of proper normalization. */ + NO_INPUT_SCALE = 2, + /** Do not normalize the output vectors. If the flag is not set, the training algorithm + normalizes each output feature independently, by transforming it to the certain range + depending on the used activation function. */ + NO_OUTPUT_SCALE = 4 + }; + + CV_WRAP virtual Mat getWeights(int layerIdx) const = 0; + + /** @brief Creates empty model + + Use StatModel::train to train the model, Algorithm::load\(filename) to load the pre-trained model. + Note that the train method has optional flags: ANN_MLP::TrainFlags. + */ + CV_WRAP static Ptr create(); +}; + +/****************************************************************************************\ +* Logistic Regression * +\****************************************************************************************/ + +/** @brief Implements Logistic Regression classifier. + +@sa @ref ml_intro_lr + */ +class CV_EXPORTS_W LogisticRegression : public StatModel +{ +public: + + /** Learning rate. */ + /** @see setLearningRate */ + CV_WRAP virtual double getLearningRate() const = 0; + /** @copybrief getLearningRate @see getLearningRate */ + CV_WRAP virtual void setLearningRate(double val) = 0; + + /** Number of iterations. */ + /** @see setIterations */ + CV_WRAP virtual int getIterations() const = 0; + /** @copybrief getIterations @see getIterations */ + CV_WRAP virtual void setIterations(int val) = 0; + + /** Kind of regularization to be applied. See LogisticRegression::RegKinds. */ + /** @see setRegularization */ + CV_WRAP virtual int getRegularization() const = 0; + /** @copybrief getRegularization @see getRegularization */ + CV_WRAP virtual void setRegularization(int val) = 0; + + /** Kind of training method used. See LogisticRegression::Methods. */ + /** @see setTrainMethod */ + CV_WRAP virtual int getTrainMethod() const = 0; + /** @copybrief getTrainMethod @see getTrainMethod */ + CV_WRAP virtual void setTrainMethod(int val) = 0; + + /** Specifies the number of training samples taken in each step of Mini-Batch Gradient + Descent. Will only be used if using LogisticRegression::MINI_BATCH training algorithm. It + has to take values less than the total number of training samples. */ + /** @see setMiniBatchSize */ + CV_WRAP virtual int getMiniBatchSize() const = 0; + /** @copybrief getMiniBatchSize @see getMiniBatchSize */ + CV_WRAP virtual void setMiniBatchSize(int val) = 0; + + /** Termination criteria of the algorithm. */ + /** @see setTermCriteria */ + CV_WRAP virtual TermCriteria getTermCriteria() const = 0; + /** @copybrief getTermCriteria @see getTermCriteria */ + CV_WRAP virtual void setTermCriteria(TermCriteria val) = 0; + + //! Regularization kinds + enum RegKinds { + REG_DISABLE = -1, //!< Regularization disabled + REG_L1 = 0, //!< %L1 norm + REG_L2 = 1 //!< %L2 norm + }; + + //! Training methods + enum Methods { + BATCH = 0, + MINI_BATCH = 1 //!< Set MiniBatchSize to a positive integer when using this method. + }; + + /** @brief Predicts responses for input samples and returns a float type. + + @param samples The input data for the prediction algorithm. Matrix [m x n], where each row + contains variables (features) of one object being classified. Should have data type CV_32F. + @param results Predicted labels as a column matrix of type CV_32S. + @param flags Not used. + */ + CV_WRAP virtual float predict( InputArray samples, OutputArray results=noArray(), int flags=0 ) const = 0; + + /** @brief This function returns the trained paramters arranged across rows. + + For a two class classifcation problem, it returns a row matrix. It returns learnt paramters of + the Logistic Regression as a matrix of type CV_32F. + */ + CV_WRAP virtual Mat get_learnt_thetas() const = 0; + + /** @brief Creates empty model. + + Creates Logistic Regression model with parameters given. + */ + CV_WRAP static Ptr create(); +}; + +/****************************************************************************************\ +* Auxilary functions declarations * +\****************************************************************************************/ + +/** @brief Generates _sample_ from multivariate normal distribution + +@param mean an average row vector +@param cov symmetric covariation matrix +@param nsamples returned samples count +@param samples returned samples array +*/ +CV_EXPORTS void randMVNormal( InputArray mean, InputArray cov, int nsamples, OutputArray samples); + +/** @brief Creates test set */ +CV_EXPORTS void createConcentricSpheresTestSet( int nsamples, int nfeatures, int nclasses, + OutputArray samples, OutputArray responses); + +//! @} ml + +} +} + +#endif // __cplusplus +#endif // __OPENCV_ML_HPP__ + +/* End of file. */ diff --git a/lib/opencv/include/opencv2/ml/ml.hpp b/lib/opencv/include/opencv2/ml/ml.hpp new file mode 100644 index 000000000..f6f9cd8f8 --- /dev/null +++ b/lib/opencv/include/opencv2/ml/ml.hpp @@ -0,0 +1,48 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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*/ + +#ifdef __OPENCV_BUILD +#error this is a compatibility header which should not be used inside the OpenCV library +#endif + +#include "opencv2/ml.hpp" diff --git a/lib/opencv/include/opencv2/objdetect.hpp b/lib/opencv/include/opencv2/objdetect.hpp new file mode 100644 index 000000000..6587b3d77 --- /dev/null +++ b/lib/opencv/include/opencv2/objdetect.hpp @@ -0,0 +1,466 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_OBJDETECT_HPP__ +#define __OPENCV_OBJDETECT_HPP__ + +#include "opencv2/core.hpp" + +/** +@defgroup objdetect Object Detection + +Haar Feature-based Cascade Classifier for Object Detection +---------------------------------------------------------- + +The object detector described below has been initially proposed by Paul Viola @cite Viola01 and +improved by Rainer Lienhart @cite Lienhart02 . + +First, a classifier (namely a *cascade of boosted classifiers working with haar-like features*) is +trained with a few hundred sample views of a particular object (i.e., a face or a car), called +positive examples, that are scaled to the same size (say, 20x20), and negative examples - arbitrary +images of the same size. + +After a classifier is trained, it can be applied to a region of interest (of the same size as used +during the training) in an input image. The classifier outputs a "1" if the region is likely to show +the object (i.e., face/car), and "0" otherwise. To search for the object in the whole image one can +move the search window across the image and check every location using the classifier. The +classifier is designed so that it can be easily "resized" in order to be able to find the objects of +interest at different sizes, which is more efficient than resizing the image itself. So, to find an +object of an unknown size in the image the scan procedure should be done several times at different +scales. + +The word "cascade" in the classifier name means that the resultant classifier consists of several +simpler classifiers (*stages*) that are applied subsequently to a region of interest until at some +stage the candidate is rejected or all the stages are passed. The word "boosted" means that the +classifiers at every stage of the cascade are complex themselves and they are built out of basic +classifiers using one of four different boosting techniques (weighted voting). Currently Discrete +Adaboost, Real Adaboost, Gentle Adaboost and Logitboost are supported. The basic classifiers are +decision-tree classifiers with at least 2 leaves. Haar-like features are the input to the basic +classifiers, and are calculated as described below. The current algorithm uses the following +Haar-like features: + +![image](pics/haarfeatures.png) + +The feature used in a particular classifier is specified by its shape (1a, 2b etc.), position within +the region of interest and the scale (this scale is not the same as the scale used at the detection +stage, though these two scales are multiplied). For example, in the case of the third line feature +(2c) the response is calculated as the difference between the sum of image pixels under the +rectangle covering the whole feature (including the two white stripes and the black stripe in the +middle) and the sum of the image pixels under the black stripe multiplied by 3 in order to +compensate for the differences in the size of areas. The sums of pixel values over a rectangular +regions are calculated rapidly using integral images (see below and the integral description). + +To see the object detector at work, have a look at the facedetect demo: + + +The following reference is for the detection part only. There is a separate application called +opencv_traincascade that can train a cascade of boosted classifiers from a set of samples. + +@note In the new C++ interface it is also possible to use LBP (local binary pattern) features in +addition to Haar-like features. .. [Viola01] Paul Viola and Michael J. Jones. Rapid Object Detection +using a Boosted Cascade of Simple Features. IEEE CVPR, 2001. The paper is available online at + + +@{ + @defgroup objdetect_c C API +@} + */ + +typedef struct CvHaarClassifierCascade CvHaarClassifierCascade; + +namespace cv +{ + +//! @addtogroup objdetect +//! @{ + +///////////////////////////// Object Detection //////////////////////////// + +//! class for grouping object candidates, detected by Cascade Classifier, HOG etc. +//! instance of the class is to be passed to cv::partition (see cxoperations.hpp) +class CV_EXPORTS SimilarRects +{ +public: + SimilarRects(double _eps) : eps(_eps) {} + inline bool operator()(const Rect& r1, const Rect& r2) const + { + double delta = eps*(std::min(r1.width, r2.width) + std::min(r1.height, r2.height))*0.5; + return std::abs(r1.x - r2.x) <= delta && + std::abs(r1.y - r2.y) <= delta && + std::abs(r1.x + r1.width - r2.x - r2.width) <= delta && + std::abs(r1.y + r1.height - r2.y - r2.height) <= delta; + } + double eps; +}; + +/** @brief Groups the object candidate rectangles. + +@param rectList Input/output vector of rectangles. Output vector includes retained and grouped +rectangles. (The Python list is not modified in place.) +@param groupThreshold Minimum possible number of rectangles minus 1. The threshold is used in a +group of rectangles to retain it. +@param eps Relative difference between sides of the rectangles to merge them into a group. + +The function is a wrapper for the generic function partition . It clusters all the input rectangles +using the rectangle equivalence criteria that combines rectangles with similar sizes and similar +locations. The similarity is defined by eps. When eps=0 , no clustering is done at all. If +\f$\texttt{eps}\rightarrow +\inf\f$ , all the rectangles are put in one cluster. Then, the small +clusters containing less than or equal to groupThreshold rectangles are rejected. In each other +cluster, the average rectangle is computed and put into the output rectangle list. + */ +CV_EXPORTS void groupRectangles(std::vector& rectList, int groupThreshold, double eps = 0.2); +/** @overload */ +CV_EXPORTS_W void groupRectangles(CV_IN_OUT std::vector& rectList, CV_OUT std::vector& weights, + int groupThreshold, double eps = 0.2); +/** @overload */ +CV_EXPORTS void groupRectangles(std::vector& rectList, int groupThreshold, + double eps, std::vector* weights, std::vector* levelWeights ); +/** @overload */ +CV_EXPORTS void groupRectangles(std::vector& rectList, std::vector& rejectLevels, + std::vector& levelWeights, int groupThreshold, double eps = 0.2); +/** @overload */ +CV_EXPORTS void groupRectangles_meanshift(std::vector& rectList, std::vector& foundWeights, + std::vector& foundScales, + double detectThreshold = 0.0, Size winDetSize = Size(64, 128)); + +template<> CV_EXPORTS void DefaultDeleter::operator ()(CvHaarClassifierCascade* obj) const; + +enum { CASCADE_DO_CANNY_PRUNING = 1, + CASCADE_SCALE_IMAGE = 2, + CASCADE_FIND_BIGGEST_OBJECT = 4, + CASCADE_DO_ROUGH_SEARCH = 8 + }; + +class CV_EXPORTS_W BaseCascadeClassifier : public Algorithm +{ +public: + virtual ~BaseCascadeClassifier(); + virtual bool empty() const = 0; + virtual bool load( const String& filename ) = 0; + virtual void detectMultiScale( InputArray image, + CV_OUT std::vector& objects, + double scaleFactor, + int minNeighbors, int flags, + Size minSize, Size maxSize ) = 0; + + virtual void detectMultiScale( InputArray image, + CV_OUT std::vector& objects, + CV_OUT std::vector& numDetections, + double scaleFactor, + int minNeighbors, int flags, + Size minSize, Size maxSize ) = 0; + + virtual void detectMultiScale( InputArray image, + CV_OUT std::vector& objects, + CV_OUT std::vector& rejectLevels, + CV_OUT std::vector& levelWeights, + double scaleFactor, + int minNeighbors, int flags, + Size minSize, Size maxSize, + bool outputRejectLevels ) = 0; + + virtual bool isOldFormatCascade() const = 0; + virtual Size getOriginalWindowSize() const = 0; + virtual int getFeatureType() const = 0; + virtual void* getOldCascade() = 0; + + class CV_EXPORTS MaskGenerator + { + public: + virtual ~MaskGenerator() {} + virtual Mat generateMask(const Mat& src)=0; + virtual void initializeMask(const Mat& /*src*/) { } + }; + virtual void setMaskGenerator(const Ptr& maskGenerator) = 0; + virtual Ptr getMaskGenerator() = 0; +}; + +/** @brief Cascade classifier class for object detection. + */ +class CV_EXPORTS_W CascadeClassifier +{ +public: + CV_WRAP CascadeClassifier(); + /** @brief Loads a classifier from a file. + + @param filename Name of the file from which the classifier is loaded. + */ + CV_WRAP CascadeClassifier(const String& filename); + ~CascadeClassifier(); + /** @brief Checks whether the classifier has been loaded. + */ + CV_WRAP bool empty() const; + /** @brief Loads a classifier from a file. + + @param filename Name of the file from which the classifier is loaded. The file may contain an old + HAAR classifier trained by the haartraining application or a new cascade classifier trained by the + traincascade application. + */ + CV_WRAP bool load( const String& filename ); + /** @brief Reads a classifier from a FileStorage node. + + @note The file may contain a new cascade classifier (trained traincascade application) only. + */ + CV_WRAP bool read( const FileNode& node ); + + /** @brief Detects objects of different sizes in the input image. The detected objects are returned as a list + of rectangles. + + @param image Matrix of the type CV_8U containing an image where objects are detected. + @param objects Vector of rectangles where each rectangle contains the detected object, the + rectangles may be partially outside the original image. + @param scaleFactor Parameter specifying how much the image size is reduced at each image scale. + @param minNeighbors Parameter specifying how many neighbors each candidate rectangle should have + to retain it. + @param flags Parameter with the same meaning for an old cascade as in the function + cvHaarDetectObjects. It is not used for a new cascade. + @param minSize Minimum possible object size. Objects smaller than that are ignored. + @param maxSize Maximum possible object size. Objects larger than that are ignored. + + The function is parallelized with the TBB library. + + @note + - (Python) A face detection example using cascade classifiers can be found at + opencv_source_code/samples/python/facedetect.py + */ + CV_WRAP void detectMultiScale( InputArray image, + CV_OUT std::vector& objects, + double scaleFactor = 1.1, + int minNeighbors = 3, int flags = 0, + Size minSize = Size(), + Size maxSize = Size() ); + + /** @overload + @param image Matrix of the type CV_8U containing an image where objects are detected. + @param objects Vector of rectangles where each rectangle contains the detected object, the + rectangles may be partially outside the original image. + @param numDetections Vector of detection numbers for the corresponding objects. An object's number + of detections is the number of neighboring positively classified rectangles that were joined + together to form the object. + @param scaleFactor Parameter specifying how much the image size is reduced at each image scale. + @param minNeighbors Parameter specifying how many neighbors each candidate rectangle should have + to retain it. + @param flags Parameter with the same meaning for an old cascade as in the function + cvHaarDetectObjects. It is not used for a new cascade. + @param minSize Minimum possible object size. Objects smaller than that are ignored. + @param maxSize Maximum possible object size. Objects larger than that are ignored. + */ + CV_WRAP_AS(detectMultiScale2) void detectMultiScale( InputArray image, + CV_OUT std::vector& objects, + CV_OUT std::vector& numDetections, + double scaleFactor=1.1, + int minNeighbors=3, int flags=0, + Size minSize=Size(), + Size maxSize=Size() ); + + /** @overload + if `outputRejectLevels` is `true` returns `rejectLevels` and `levelWeights` + */ + CV_WRAP_AS(detectMultiScale3) void detectMultiScale( InputArray image, + CV_OUT std::vector& objects, + CV_OUT std::vector& rejectLevels, + CV_OUT std::vector& levelWeights, + double scaleFactor = 1.1, + int minNeighbors = 3, int flags = 0, + Size minSize = Size(), + Size maxSize = Size(), + bool outputRejectLevels = false ); + + CV_WRAP bool isOldFormatCascade() const; + CV_WRAP Size getOriginalWindowSize() const; + CV_WRAP int getFeatureType() const; + void* getOldCascade(); + + CV_WRAP static bool convert(const String& oldcascade, const String& newcascade); + + void setMaskGenerator(const Ptr& maskGenerator); + Ptr getMaskGenerator(); + + Ptr cc; +}; + +CV_EXPORTS Ptr createFaceDetectionMaskGenerator(); + +//////////////// HOG (Histogram-of-Oriented-Gradients) Descriptor and Object Detector ////////////// + +//! struct for detection region of interest (ROI) +struct DetectionROI +{ + //! scale(size) of the bounding box + double scale; + //! set of requrested locations to be evaluated + std::vector locations; + //! vector that will contain confidence values for each location + std::vector confidences; +}; + +struct CV_EXPORTS_W HOGDescriptor +{ +public: + enum { L2Hys = 0 + }; + enum { DEFAULT_NLEVELS = 64 + }; + + CV_WRAP HOGDescriptor() : winSize(64,128), blockSize(16,16), blockStride(8,8), + cellSize(8,8), nbins(9), derivAperture(1), winSigma(-1), + histogramNormType(HOGDescriptor::L2Hys), L2HysThreshold(0.2), gammaCorrection(true), + free_coef(-1.f), nlevels(HOGDescriptor::DEFAULT_NLEVELS), signedGradient(false) + {} + + CV_WRAP HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, + Size _cellSize, int _nbins, int _derivAperture=1, double _winSigma=-1, + int _histogramNormType=HOGDescriptor::L2Hys, + double _L2HysThreshold=0.2, bool _gammaCorrection=false, + int _nlevels=HOGDescriptor::DEFAULT_NLEVELS, bool _signedGradient=false) + : winSize(_winSize), blockSize(_blockSize), blockStride(_blockStride), cellSize(_cellSize), + nbins(_nbins), derivAperture(_derivAperture), winSigma(_winSigma), + histogramNormType(_histogramNormType), L2HysThreshold(_L2HysThreshold), + gammaCorrection(_gammaCorrection), free_coef(-1.f), nlevels(_nlevels), signedGradient(_signedGradient) + {} + + CV_WRAP HOGDescriptor(const String& filename) + { + load(filename); + } + + HOGDescriptor(const HOGDescriptor& d) + { + d.copyTo(*this); + } + + virtual ~HOGDescriptor() {} + + CV_WRAP size_t getDescriptorSize() const; + CV_WRAP bool checkDetectorSize() const; + CV_WRAP double getWinSigma() const; + + CV_WRAP virtual void setSVMDetector(InputArray _svmdetector); + + virtual bool read(FileNode& fn); + virtual void write(FileStorage& fs, const String& objname) const; + + CV_WRAP virtual bool load(const String& filename, const String& objname = String()); + CV_WRAP virtual void save(const String& filename, const String& objname = String()) const; + virtual void copyTo(HOGDescriptor& c) const; + + CV_WRAP virtual void compute(InputArray img, + CV_OUT std::vector& descriptors, + Size winStride = Size(), Size padding = Size(), + const std::vector& locations = std::vector()) const; + + //! with found weights output + CV_WRAP virtual void detect(const Mat& img, CV_OUT std::vector& foundLocations, + CV_OUT std::vector& weights, + double hitThreshold = 0, Size winStride = Size(), + Size padding = Size(), + const std::vector& searchLocations = std::vector()) const; + //! without found weights output + virtual void detect(const Mat& img, CV_OUT std::vector& foundLocations, + double hitThreshold = 0, Size winStride = Size(), + Size padding = Size(), + const std::vector& searchLocations=std::vector()) const; + + //! with result weights output + CV_WRAP virtual void detectMultiScale(InputArray img, CV_OUT std::vector& foundLocations, + CV_OUT std::vector& foundWeights, double hitThreshold = 0, + Size winStride = Size(), Size padding = Size(), double scale = 1.05, + double finalThreshold = 2.0,bool useMeanshiftGrouping = false) const; + //! without found weights output + virtual void detectMultiScale(InputArray img, CV_OUT std::vector& foundLocations, + double hitThreshold = 0, Size winStride = Size(), + Size padding = Size(), double scale = 1.05, + double finalThreshold = 2.0, bool useMeanshiftGrouping = false) const; + + CV_WRAP virtual void computeGradient(const Mat& img, CV_OUT Mat& grad, CV_OUT Mat& angleOfs, + Size paddingTL = Size(), Size paddingBR = Size()) const; + + CV_WRAP static std::vector getDefaultPeopleDetector(); + CV_WRAP static std::vector getDaimlerPeopleDetector(); + + CV_PROP Size winSize; + CV_PROP Size blockSize; + CV_PROP Size blockStride; + CV_PROP Size cellSize; + CV_PROP int nbins; + CV_PROP int derivAperture; + CV_PROP double winSigma; + CV_PROP int histogramNormType; + CV_PROP double L2HysThreshold; + CV_PROP bool gammaCorrection; + CV_PROP std::vector svmDetector; + UMat oclSvmDetector; + float free_coef; + CV_PROP int nlevels; + CV_PROP bool signedGradient; + + + //! evaluate specified ROI and return confidence value for each location + virtual void detectROI(const cv::Mat& img, const std::vector &locations, + CV_OUT std::vector& foundLocations, CV_OUT std::vector& confidences, + double hitThreshold = 0, cv::Size winStride = Size(), + cv::Size padding = Size()) const; + + //! evaluate specified ROI and return confidence value for each location in multiple scales + virtual void detectMultiScaleROI(const cv::Mat& img, + CV_OUT std::vector& foundLocations, + std::vector& locations, + double hitThreshold = 0, + int groupThreshold = 0) const; + + //! read/parse Dalal's alt model file + void readALTModel(String modelfile); + void groupRectangles(std::vector& rectList, std::vector& weights, int groupThreshold, double eps) const; +}; + +//! @} objdetect + +} + +#include "opencv2/objdetect/detection_based_tracker.hpp" + +#ifndef DISABLE_OPENCV_24_COMPATIBILITY +#include "opencv2/objdetect/objdetect_c.h" +#endif + +#endif diff --git a/lib/opencv/include/opencv2/objdetect/detection_based_tracker.hpp b/lib/opencv/include/opencv2/objdetect/detection_based_tracker.hpp new file mode 100644 index 000000000..1f5f1d367 --- /dev/null +++ b/lib/opencv/include/opencv2/objdetect/detection_based_tracker.hpp @@ -0,0 +1,225 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_OBJDETECT_DBT_HPP__ +#define __OPENCV_OBJDETECT_DBT_HPP__ + +// After this condition removal update blacklist for bindings: modules/python/common.cmake +#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(__ANDROID__) || \ + (defined(__cplusplus) && __cplusplus > 201103L) || (defined(_MSC_VER) && _MSC_VER >= 1700) + +#include + +namespace cv +{ + +//! @addtogroup objdetect +//! @{ + +class CV_EXPORTS DetectionBasedTracker +{ + public: + struct Parameters + { + int maxTrackLifetime; + int minDetectionPeriod; //the minimal time between run of the big object detector (on the whole frame) in ms (1000 mean 1 sec), default=0 + + Parameters(); + }; + + class IDetector + { + public: + IDetector(): + minObjSize(96, 96), + maxObjSize(INT_MAX, INT_MAX), + minNeighbours(2), + scaleFactor(1.1f) + {} + + virtual void detect(const cv::Mat& image, std::vector& objects) = 0; + + void setMinObjectSize(const cv::Size& min) + { + minObjSize = min; + } + void setMaxObjectSize(const cv::Size& max) + { + maxObjSize = max; + } + cv::Size getMinObjectSize() const + { + return minObjSize; + } + cv::Size getMaxObjectSize() const + { + return maxObjSize; + } + float getScaleFactor() + { + return scaleFactor; + } + void setScaleFactor(float value) + { + scaleFactor = value; + } + int getMinNeighbours() + { + return minNeighbours; + } + void setMinNeighbours(int value) + { + minNeighbours = value; + } + virtual ~IDetector() {} + + protected: + cv::Size minObjSize; + cv::Size maxObjSize; + int minNeighbours; + float scaleFactor; + }; + + DetectionBasedTracker(cv::Ptr mainDetector, cv::Ptr trackingDetector, const Parameters& params); + virtual ~DetectionBasedTracker(); + + virtual bool run(); + virtual void stop(); + virtual void resetTracking(); + + virtual void process(const cv::Mat& imageGray); + + bool setParameters(const Parameters& params); + const Parameters& getParameters() const; + + + typedef std::pair Object; + virtual void getObjects(std::vector& result) const; + virtual void getObjects(std::vector& result) const; + + enum ObjectStatus + { + DETECTED_NOT_SHOWN_YET, + DETECTED, + DETECTED_TEMPORARY_LOST, + WRONG_OBJECT + }; + struct ExtObject + { + int id; + cv::Rect location; + ObjectStatus status; + ExtObject(int _id, cv::Rect _location, ObjectStatus _status) + :id(_id), location(_location), status(_status) + { + } + }; + virtual void getObjects(std::vector& result) const; + + + virtual int addObject(const cv::Rect& location); //returns id of the new object + + protected: + class SeparateDetectionWork; + cv::Ptr separateDetectionWork; + friend void* workcycleObjectDetectorFunction(void* p); + + struct InnerParameters + { + int numLastPositionsToTrack; + int numStepsToWaitBeforeFirstShow; + int numStepsToTrackWithoutDetectingIfObjectHasNotBeenShown; + int numStepsToShowWithoutDetecting; + + float coeffTrackingWindowSize; + float coeffObjectSizeToTrack; + float coeffObjectSpeedUsingInPrediction; + + InnerParameters(); + }; + Parameters parameters; + InnerParameters innerParameters; + + struct TrackedObject + { + typedef std::vector PositionsVector; + + PositionsVector lastPositions; + + int numDetectedFrames; + int numFramesNotDetected; + int id; + + TrackedObject(const cv::Rect& rect):numDetectedFrames(1), numFramesNotDetected(0) + { + lastPositions.push_back(rect); + id=getNextId(); + }; + + static int getNextId() + { + static int _id=0; + return _id++; + } + }; + + int numTrackedSteps; + std::vector trackedObjects; + + std::vector weightsPositionsSmoothing; + std::vector weightsSizesSmoothing; + + cv::Ptr cascadeForTracking; + + void updateTrackedObjects(const std::vector& detectedObjects); + cv::Rect calcTrackedObjectPositionToShow(int i) const; + cv::Rect calcTrackedObjectPositionToShow(int i, ObjectStatus& status) const; + void detectInRegion(const cv::Mat& img, const cv::Rect& r, std::vector& detectedObjectsInRegions); +}; + +//! @} objdetect + +} //end of cv namespace +#endif + +#endif diff --git a/lib/opencv/include/opencv2/objdetect/objdetect.hpp b/lib/opencv/include/opencv2/objdetect/objdetect.hpp new file mode 100644 index 000000000..3ee284f42 --- /dev/null +++ b/lib/opencv/include/opencv2/objdetect/objdetect.hpp @@ -0,0 +1,48 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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*/ + +#ifdef __OPENCV_BUILD +#error this is a compatibility header which should not be used inside the OpenCV library +#endif + +#include "opencv2/objdetect.hpp" diff --git a/lib/opencv/include/opencv2/objdetect/objdetect_c.h b/lib/opencv/include/opencv2/objdetect/objdetect_c.h new file mode 100644 index 000000000..632a43862 --- /dev/null +++ b/lib/opencv/include/opencv2/objdetect/objdetect_c.h @@ -0,0 +1,165 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_OBJDETECT_C_H__ +#define __OPENCV_OBJDETECT_C_H__ + +#include "opencv2/core/core_c.h" + +#ifdef __cplusplus +#include +#include + +extern "C" { +#endif + +/** @addtogroup objdetect_c + @{ + */ + +/****************************************************************************************\ +* Haar-like Object Detection functions * +\****************************************************************************************/ + +#define CV_HAAR_MAGIC_VAL 0x42500000 +#define CV_TYPE_NAME_HAAR "opencv-haar-classifier" + +#define CV_IS_HAAR_CLASSIFIER( haar ) \ + ((haar) != NULL && \ + (((const CvHaarClassifierCascade*)(haar))->flags & CV_MAGIC_MASK)==CV_HAAR_MAGIC_VAL) + +#define CV_HAAR_FEATURE_MAX 3 + +typedef struct CvHaarFeature +{ + int tilted; + struct + { + CvRect r; + float weight; + } rect[CV_HAAR_FEATURE_MAX]; +} CvHaarFeature; + +typedef struct CvHaarClassifier +{ + int count; + CvHaarFeature* haar_feature; + float* threshold; + int* left; + int* right; + float* alpha; +} CvHaarClassifier; + +typedef struct CvHaarStageClassifier +{ + int count; + float threshold; + CvHaarClassifier* classifier; + + int next; + int child; + int parent; +} CvHaarStageClassifier; + +typedef struct CvHidHaarClassifierCascade CvHidHaarClassifierCascade; + +typedef struct CvHaarClassifierCascade +{ + int flags; + int count; + CvSize orig_window_size; + CvSize real_window_size; + double scale; + CvHaarStageClassifier* stage_classifier; + CvHidHaarClassifierCascade* hid_cascade; +} CvHaarClassifierCascade; + +typedef struct CvAvgComp +{ + CvRect rect; + int neighbors; +} CvAvgComp; + +/* Loads haar classifier cascade from a directory. + It is obsolete: convert your cascade to xml and use cvLoad instead */ +CVAPI(CvHaarClassifierCascade*) cvLoadHaarClassifierCascade( + const char* directory, CvSize orig_window_size); + +CVAPI(void) cvReleaseHaarClassifierCascade( CvHaarClassifierCascade** cascade ); + +#define CV_HAAR_DO_CANNY_PRUNING 1 +#define CV_HAAR_SCALE_IMAGE 2 +#define CV_HAAR_FIND_BIGGEST_OBJECT 4 +#define CV_HAAR_DO_ROUGH_SEARCH 8 + +CVAPI(CvSeq*) cvHaarDetectObjects( const CvArr* image, + CvHaarClassifierCascade* cascade, CvMemStorage* storage, + double scale_factor CV_DEFAULT(1.1), + int min_neighbors CV_DEFAULT(3), int flags CV_DEFAULT(0), + CvSize min_size CV_DEFAULT(cvSize(0,0)), CvSize max_size CV_DEFAULT(cvSize(0,0))); + +/* sets images for haar classifier cascade */ +CVAPI(void) cvSetImagesForHaarClassifierCascade( CvHaarClassifierCascade* cascade, + const CvArr* sum, const CvArr* sqsum, + const CvArr* tilted_sum, double scale ); + +/* runs the cascade on the specified window */ +CVAPI(int) cvRunHaarClassifierCascade( const CvHaarClassifierCascade* cascade, + CvPoint pt, int start_stage CV_DEFAULT(0)); + +/** @} objdetect_c */ + +#ifdef __cplusplus +} + +CV_EXPORTS CvSeq* cvHaarDetectObjectsForROC( const CvArr* image, + CvHaarClassifierCascade* cascade, CvMemStorage* storage, + std::vector& rejectLevels, std::vector& levelWeightds, + double scale_factor = 1.1, + int min_neighbors = 3, int flags = 0, + CvSize min_size = cvSize(0, 0), CvSize max_size = cvSize(0, 0), + bool outputRejectLevels = false ); + +#endif + +#endif /* __OPENCV_OBJDETECT_C_H__ */ diff --git a/lib/opencv/include/opencv2/opencv.hpp b/lib/opencv/include/opencv2/opencv.hpp new file mode 100644 index 000000000..fd9ca5898 --- /dev/null +++ b/lib/opencv/include/opencv2/opencv.hpp @@ -0,0 +1,58 @@ +/*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-2010, 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_ALL_HPP__ +#define __OPENCV_ALL_HPP__ + +#include "opencv2/core.hpp" +#include "opencv2/imgproc.hpp" +#include "opencv2/photo.hpp" +#include "opencv2/video.hpp" +#include "opencv2/features2d.hpp" +#include "opencv2/objdetect.hpp" +#include "opencv2/calib3d.hpp" +#include "opencv2/imgcodecs.hpp" +#include "opencv2/videoio.hpp" +#include "opencv2/highgui.hpp" +#include "opencv2/ml.hpp" + +#endif diff --git a/lib/opencv/include/opencv2/opencv_modules.hpp b/lib/opencv/include/opencv2/opencv_modules.hpp new file mode 100644 index 000000000..42dd90830 --- /dev/null +++ b/lib/opencv/include/opencv2/opencv_modules.hpp @@ -0,0 +1,27 @@ +/* + * ** File generated automatically, do not modify ** + * + * This file defines the list of modules available in current build configuration + * + * +*/ + +#define HAVE_OPENCV_CALIB3D +#define HAVE_OPENCV_CORE +#define HAVE_OPENCV_FEATURES2D +#define HAVE_OPENCV_FLANN +#define HAVE_OPENCV_HIGHGUI +#define HAVE_OPENCV_IMGCODECS +#define HAVE_OPENCV_IMGPROC +#define HAVE_OPENCV_ML +#define HAVE_OPENCV_OBJDETECT +#define HAVE_OPENCV_PHOTO +#define HAVE_OPENCV_SHAPE +#define HAVE_OPENCV_STITCHING +#define HAVE_OPENCV_SUPERRES +#define HAVE_OPENCV_VIDEO +#define HAVE_OPENCV_VIDEOIO +#define HAVE_OPENCV_VIDEOSTAB +#define HAVE_OPENCV_WORLD + + diff --git a/lib/opencv/include/opencv2/photo.hpp b/lib/opencv/include/opencv2/photo.hpp new file mode 100644 index 000000000..c093f6552 --- /dev/null +++ b/lib/opencv/include/opencv2/photo.hpp @@ -0,0 +1,870 @@ +/*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) 2008-2012, 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_PHOTO_HPP__ +#define __OPENCV_PHOTO_HPP__ + +#include "opencv2/core.hpp" +#include "opencv2/imgproc.hpp" + +/** +@defgroup photo Computational Photography +@{ + @defgroup photo_denoise Denoising + @defgroup photo_hdr HDR imaging + +This section describes high dynamic range imaging algorithms namely tonemapping, exposure alignment, +camera calibration with multiple exposures and exposure fusion. + + @defgroup photo_clone Seamless Cloning + @defgroup photo_render Non-Photorealistic Rendering + @defgroup photo_c C API +@} + */ + +namespace cv +{ + +//! @addtogroup photo +//! @{ + +//! the inpainting algorithm +enum +{ + INPAINT_NS = 0, // Navier-Stokes algorithm + INPAINT_TELEA = 1 // A. Telea algorithm +}; + +enum +{ + NORMAL_CLONE = 1, + MIXED_CLONE = 2, + MONOCHROME_TRANSFER = 3 +}; + +enum +{ + RECURS_FILTER = 1, + NORMCONV_FILTER = 2 +}; + +/** @brief Restores the selected region in an image using the region neighborhood. + +@param src Input 8-bit 1-channel or 3-channel image. +@param inpaintMask Inpainting mask, 8-bit 1-channel image. Non-zero pixels indicate the area that +needs to be inpainted. +@param dst Output image with the same size and type as src . +@param inpaintRadius Radius of a circular neighborhood of each point inpainted that is considered +by the algorithm. +@param flags Inpainting method that could be one of the following: +- **INPAINT_NS** Navier-Stokes based method [Navier01] +- **INPAINT_TELEA** Method by Alexandru Telea @cite Telea04 . + +The function reconstructs the selected image area from the pixel near the area boundary. The +function may be used to remove dust and scratches from a scanned photo, or to remove undesirable +objects from still images or video. See for more details. + +@note + - An example using the inpainting technique can be found at + opencv_source_code/samples/cpp/inpaint.cpp + - (Python) An example using the inpainting technique can be found at + opencv_source_code/samples/python/inpaint.py + */ +CV_EXPORTS_W void inpaint( InputArray src, InputArray inpaintMask, + OutputArray dst, double inpaintRadius, int flags ); + +//! @addtogroup photo_denoise +//! @{ + +/** @brief Perform image denoising using Non-local Means Denoising algorithm + with several computational +optimizations. Noise expected to be a gaussian white noise + +@param src Input 8-bit 1-channel, 2-channel, 3-channel or 4-channel image. +@param dst Output image with the same size and type as src . +@param templateWindowSize Size in pixels of the template patch that is used to compute weights. +Should be odd. Recommended value 7 pixels +@param searchWindowSize Size in pixels of the window that is used to compute weighted average for +given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater +denoising time. Recommended value 21 pixels +@param h Parameter regulating filter strength. Big h value perfectly removes noise but also +removes image details, smaller h value preserves details but also preserves some noise + +This function expected to be applied to grayscale images. For colored images look at +fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored +image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting +image to CIELAB colorspace and then separately denoise L and AB components with different h +parameter. + */ +CV_EXPORTS_W void fastNlMeansDenoising( InputArray src, OutputArray dst, float h = 3, + int templateWindowSize = 7, int searchWindowSize = 21); + +/** @brief Perform image denoising using Non-local Means Denoising algorithm + with several computational +optimizations. Noise expected to be a gaussian white noise + +@param src Input 8-bit or 16-bit (only with NORM_L1) 1-channel, +2-channel, 3-channel or 4-channel image. +@param dst Output image with the same size and type as src . +@param templateWindowSize Size in pixels of the template patch that is used to compute weights. +Should be odd. Recommended value 7 pixels +@param searchWindowSize Size in pixels of the window that is used to compute weighted average for +given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater +denoising time. Recommended value 21 pixels +@param h Array of parameters regulating filter strength, either one +parameter applied to all channels or one per channel in dst. Big h value +perfectly removes noise but also removes image details, smaller h +value preserves details but also preserves some noise +@param normType Type of norm used for weight calculation. Can be either NORM_L2 or NORM_L1 + +This function expected to be applied to grayscale images. For colored images look at +fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored +image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting +image to CIELAB colorspace and then separately denoise L and AB components with different h +parameter. + */ +CV_EXPORTS_W void fastNlMeansDenoising( InputArray src, OutputArray dst, + const std::vector& h, + int templateWindowSize = 7, int searchWindowSize = 21, + int normType = NORM_L2); + +/** @brief Modification of fastNlMeansDenoising function for colored images + +@param src Input 8-bit 3-channel image. +@param dst Output image with the same size and type as src . +@param templateWindowSize Size in pixels of the template patch that is used to compute weights. +Should be odd. Recommended value 7 pixels +@param searchWindowSize Size in pixels of the window that is used to compute weighted average for +given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater +denoising time. Recommended value 21 pixels +@param h Parameter regulating filter strength for luminance component. Bigger h value perfectly +removes noise but also removes image details, smaller h value preserves details but also preserves +some noise +@param hColor The same as h but for color components. For most images value equals 10 +will be enough to remove colored noise and do not distort colors + +The function converts image to CIELAB colorspace and then separately denoise L and AB components +with given h parameters using fastNlMeansDenoising function. + */ +CV_EXPORTS_W void fastNlMeansDenoisingColored( InputArray src, OutputArray dst, + float h = 3, float hColor = 3, + int templateWindowSize = 7, int searchWindowSize = 21); + +/** @brief Modification of fastNlMeansDenoising function for images sequence where consequtive images have been +captured in small period of time. For example video. This version of the function is for grayscale +images or for manual manipulation with colorspaces. For more details see + + +@param srcImgs Input 8-bit 1-channel, 2-channel, 3-channel or +4-channel images sequence. All images should have the same type and +size. +@param imgToDenoiseIndex Target image to denoise index in srcImgs sequence +@param temporalWindowSize Number of surrounding images to use for target image denoising. Should +be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to +imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise +srcImgs[imgToDenoiseIndex] image. +@param dst Output image with the same size and type as srcImgs images. +@param templateWindowSize Size in pixels of the template patch that is used to compute weights. +Should be odd. Recommended value 7 pixels +@param searchWindowSize Size in pixels of the window that is used to compute weighted average for +given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater +denoising time. Recommended value 21 pixels +@param h Parameter regulating filter strength. Bigger h value +perfectly removes noise but also removes image details, smaller h +value preserves details but also preserves some noise + */ +CV_EXPORTS_W void fastNlMeansDenoisingMulti( InputArrayOfArrays srcImgs, OutputArray dst, + int imgToDenoiseIndex, int temporalWindowSize, + float h = 3, int templateWindowSize = 7, int searchWindowSize = 21); + +/** @brief Modification of fastNlMeansDenoising function for images sequence where consequtive images have been +captured in small period of time. For example video. This version of the function is for grayscale +images or for manual manipulation with colorspaces. For more details see + + +@param srcImgs Input 8-bit or 16-bit (only with NORM_L1) 1-channel, +2-channel, 3-channel or 4-channel images sequence. All images should +have the same type and size. +@param imgToDenoiseIndex Target image to denoise index in srcImgs sequence +@param temporalWindowSize Number of surrounding images to use for target image denoising. Should +be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to +imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise +srcImgs[imgToDenoiseIndex] image. +@param dst Output image with the same size and type as srcImgs images. +@param templateWindowSize Size in pixels of the template patch that is used to compute weights. +Should be odd. Recommended value 7 pixels +@param searchWindowSize Size in pixels of the window that is used to compute weighted average for +given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater +denoising time. Recommended value 21 pixels +@param h Array of parameters regulating filter strength, either one +parameter applied to all channels or one per channel in dst. Big h value +perfectly removes noise but also removes image details, smaller h +value preserves details but also preserves some noise +@param normType Type of norm used for weight calculation. Can be either NORM_L2 or NORM_L1 + */ +CV_EXPORTS_W void fastNlMeansDenoisingMulti( InputArrayOfArrays srcImgs, OutputArray dst, + int imgToDenoiseIndex, int temporalWindowSize, + const std::vector& h, + int templateWindowSize = 7, int searchWindowSize = 21, + int normType = NORM_L2); + +/** @brief Modification of fastNlMeansDenoisingMulti function for colored images sequences + +@param srcImgs Input 8-bit 3-channel images sequence. All images should have the same type and +size. +@param imgToDenoiseIndex Target image to denoise index in srcImgs sequence +@param temporalWindowSize Number of surrounding images to use for target image denoising. Should +be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to +imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise +srcImgs[imgToDenoiseIndex] image. +@param dst Output image with the same size and type as srcImgs images. +@param templateWindowSize Size in pixels of the template patch that is used to compute weights. +Should be odd. Recommended value 7 pixels +@param searchWindowSize Size in pixels of the window that is used to compute weighted average for +given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater +denoising time. Recommended value 21 pixels +@param h Parameter regulating filter strength for luminance component. Bigger h value perfectly +removes noise but also removes image details, smaller h value preserves details but also preserves +some noise. +@param hColor The same as h but for color components. + +The function converts images to CIELAB colorspace and then separately denoise L and AB components +with given h parameters using fastNlMeansDenoisingMulti function. + */ +CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs, OutputArray dst, + int imgToDenoiseIndex, int temporalWindowSize, + float h = 3, float hColor = 3, + int templateWindowSize = 7, int searchWindowSize = 21); + +/** @brief Primal-dual algorithm is an algorithm for solving special types of variational problems (that is, +finding a function to minimize some functional). As the image denoising, in particular, may be seen +as the variational problem, primal-dual algorithm then can be used to perform denoising and this is +exactly what is implemented. + +It should be noted, that this implementation was taken from the July 2013 blog entry +@cite MA13 , which also contained (slightly more general) ready-to-use source code on Python. +Subsequently, that code was rewritten on C++ with the usage of openCV by Vadim Pisarevsky at the end +of July 2013 and finally it was slightly adapted by later authors. + +Although the thorough discussion and justification of the algorithm involved may be found in +@cite ChambolleEtAl, it might make sense to skim over it here, following @cite MA13 . To begin +with, we consider the 1-byte gray-level images as the functions from the rectangular domain of +pixels (it may be seen as set +\f$\left\{(x,y)\in\mathbb{N}\times\mathbb{N}\mid 1\leq x\leq n,\;1\leq y\leq m\right\}\f$ for some +\f$m,\;n\in\mathbb{N}\f$) into \f$\{0,1,\dots,255\}\f$. We shall denote the noised images as \f$f_i\f$ and with +this view, given some image \f$x\f$ of the same size, we may measure how bad it is by the formula + +\f[\left\|\left\|\nabla x\right\|\right\| + \lambda\sum_i\left\|\left\|x-f_i\right\|\right\|\f] + +\f$\|\|\cdot\|\|\f$ here denotes \f$L_2\f$-norm and as you see, the first addend states that we want our +image to be smooth (ideally, having zero gradient, thus being constant) and the second states that +we want our result to be close to the observations we've got. If we treat \f$x\f$ as a function, this is +exactly the functional what we seek to minimize and here the Primal-Dual algorithm comes into play. + +@param observations This array should contain one or more noised versions of the image that is to +be restored. +@param result Here the denoised image will be stored. There is no need to do pre-allocation of +storage space, as it will be automatically allocated, if necessary. +@param lambda Corresponds to \f$\lambda\f$ in the formulas above. As it is enlarged, the smooth +(blurred) images are treated more favorably than detailed (but maybe more noised) ones. Roughly +speaking, as it becomes smaller, the result will be more blur but more sever outliers will be +removed. +@param niters Number of iterations that the algorithm will run. Of course, as more iterations as +better, but it is hard to quantitatively refine this statement, so just use the default and +increase it if the results are poor. + */ +CV_EXPORTS_W void denoise_TVL1(const std::vector& observations,Mat& result, double lambda=1.0, int niters=30); + +//! @} photo_denoise + +//! @addtogroup photo_hdr +//! @{ + +enum { LDR_SIZE = 256 }; + +/** @brief Base class for tonemapping algorithms - tools that are used to map HDR image to 8-bit range. + */ +class CV_EXPORTS_W Tonemap : public Algorithm +{ +public: + /** @brief Tonemaps image + + @param src source image - 32-bit 3-channel Mat + @param dst destination image - 32-bit 3-channel Mat with values in [0, 1] range + */ + CV_WRAP virtual void process(InputArray src, OutputArray dst) = 0; + + CV_WRAP virtual float getGamma() const = 0; + CV_WRAP virtual void setGamma(float gamma) = 0; +}; + +/** @brief Creates simple linear mapper with gamma correction + +@param gamma positive value for gamma correction. Gamma value of 1.0 implies no correction, gamma +equal to 2.2f is suitable for most displays. +Generally gamma \> 1 brightens the image and gamma \< 1 darkens it. + */ +CV_EXPORTS_W Ptr createTonemap(float gamma = 1.0f); + +/** @brief Adaptive logarithmic mapping is a fast global tonemapping algorithm that scales the image in +logarithmic domain. + +Since it's a global operator the same function is applied to all the pixels, it is controlled by the +bias parameter. + +Optional saturation enhancement is possible as described in @cite FL02 . + +For more information see @cite DM03 . + */ +class CV_EXPORTS_W TonemapDrago : public Tonemap +{ +public: + + CV_WRAP virtual float getSaturation() const = 0; + CV_WRAP virtual void setSaturation(float saturation) = 0; + + CV_WRAP virtual float getBias() const = 0; + CV_WRAP virtual void setBias(float bias) = 0; +}; + +/** @brief Creates TonemapDrago object + +@param gamma gamma value for gamma correction. See createTonemap +@param saturation positive saturation enhancement value. 1.0 preserves saturation, values greater +than 1 increase saturation and values less than 1 decrease it. +@param bias value for bias function in [0, 1] range. Values from 0.7 to 0.9 usually give best +results, default value is 0.85. + */ +CV_EXPORTS_W Ptr createTonemapDrago(float gamma = 1.0f, float saturation = 1.0f, float bias = 0.85f); + +/** @brief This algorithm decomposes image into two layers: base layer and detail layer using bilateral filter +and compresses contrast of the base layer thus preserving all the details. + +This implementation uses regular bilateral filter from opencv. + +Saturation enhancement is possible as in ocvTonemapDrago. + +For more information see @cite DD02 . + */ +class CV_EXPORTS_W TonemapDurand : public Tonemap +{ +public: + + CV_WRAP virtual float getSaturation() const = 0; + CV_WRAP virtual void setSaturation(float saturation) = 0; + + CV_WRAP virtual float getContrast() const = 0; + CV_WRAP virtual void setContrast(float contrast) = 0; + + CV_WRAP virtual float getSigmaSpace() const = 0; + CV_WRAP virtual void setSigmaSpace(float sigma_space) = 0; + + CV_WRAP virtual float getSigmaColor() const = 0; + CV_WRAP virtual void setSigmaColor(float sigma_color) = 0; +}; + +/** @brief Creates TonemapDurand object + +@param gamma gamma value for gamma correction. See createTonemap +@param contrast resulting contrast on logarithmic scale, i. e. log(max / min), where max and min +are maximum and minimum luminance values of the resulting image. +@param saturation saturation enhancement value. See createTonemapDrago +@param sigma_space bilateral filter sigma in color space +@param sigma_color bilateral filter sigma in coordinate space + */ +CV_EXPORTS_W Ptr +createTonemapDurand(float gamma = 1.0f, float contrast = 4.0f, float saturation = 1.0f, float sigma_space = 2.0f, float sigma_color = 2.0f); + +/** @brief This is a global tonemapping operator that models human visual system. + +Mapping function is controlled by adaptation parameter, that is computed using light adaptation and +color adaptation. + +For more information see @cite RD05 . + */ +class CV_EXPORTS_W TonemapReinhard : public Tonemap +{ +public: + CV_WRAP virtual float getIntensity() const = 0; + CV_WRAP virtual void setIntensity(float intensity) = 0; + + CV_WRAP virtual float getLightAdaptation() const = 0; + CV_WRAP virtual void setLightAdaptation(float light_adapt) = 0; + + CV_WRAP virtual float getColorAdaptation() const = 0; + CV_WRAP virtual void setColorAdaptation(float color_adapt) = 0; +}; + +/** @brief Creates TonemapReinhard object + +@param gamma gamma value for gamma correction. See createTonemap +@param intensity result intensity in [-8, 8] range. Greater intensity produces brighter results. +@param light_adapt light adaptation in [0, 1] range. If 1 adaptation is based only on pixel +value, if 0 it's global, otherwise it's a weighted mean of this two cases. +@param color_adapt chromatic adaptation in [0, 1] range. If 1 channels are treated independently, +if 0 adaptation level is the same for each channel. + */ +CV_EXPORTS_W Ptr +createTonemapReinhard(float gamma = 1.0f, float intensity = 0.0f, float light_adapt = 1.0f, float color_adapt = 0.0f); + +/** @brief This algorithm transforms image to contrast using gradients on all levels of gaussian pyramid, +transforms contrast values to HVS response and scales the response. After this the image is +reconstructed from new contrast values. + +For more information see @cite MM06 . + */ +class CV_EXPORTS_W TonemapMantiuk : public Tonemap +{ +public: + CV_WRAP virtual float getScale() const = 0; + CV_WRAP virtual void setScale(float scale) = 0; + + CV_WRAP virtual float getSaturation() const = 0; + CV_WRAP virtual void setSaturation(float saturation) = 0; +}; + +/** @brief Creates TonemapMantiuk object + +@param gamma gamma value for gamma correction. See createTonemap +@param scale contrast scale factor. HVS response is multiplied by this parameter, thus compressing +dynamic range. Values from 0.6 to 0.9 produce best results. +@param saturation saturation enhancement value. See createTonemapDrago + */ +CV_EXPORTS_W Ptr +createTonemapMantiuk(float gamma = 1.0f, float scale = 0.7f, float saturation = 1.0f); + +/** @brief The base class for algorithms that align images of the same scene with different exposures + */ +class CV_EXPORTS_W AlignExposures : public Algorithm +{ +public: + /** @brief Aligns images + + @param src vector of input images + @param dst vector of aligned images + @param times vector of exposure time values for each image + @param response 256x1 matrix with inverse camera response function for each pixel value, it should + have the same number of channels as images. + */ + CV_WRAP virtual void process(InputArrayOfArrays src, std::vector& dst, + InputArray times, InputArray response) = 0; +}; + +/** @brief This algorithm converts images to median threshold bitmaps (1 for pixels brighter than median +luminance and 0 otherwise) and than aligns the resulting bitmaps using bit operations. + +It is invariant to exposure, so exposure values and camera response are not necessary. + +In this implementation new image regions are filled with zeros. + +For more information see @cite GW03 . + */ +class CV_EXPORTS_W AlignMTB : public AlignExposures +{ +public: + CV_WRAP virtual void process(InputArrayOfArrays src, std::vector& dst, + InputArray times, InputArray response) = 0; + + /** @brief Short version of process, that doesn't take extra arguments. + + @param src vector of input images + @param dst vector of aligned images + */ + CV_WRAP virtual void process(InputArrayOfArrays src, std::vector& dst) = 0; + + /** @brief Calculates shift between two images, i. e. how to shift the second image to correspond it with the + first. + + @param img0 first image + @param img1 second image + */ + CV_WRAP virtual Point calculateShift(InputArray img0, InputArray img1) = 0; + /** @brief Helper function, that shift Mat filling new regions with zeros. + + @param src input image + @param dst result image + @param shift shift value + */ + CV_WRAP virtual void shiftMat(InputArray src, OutputArray dst, const Point shift) = 0; + /** @brief Computes median threshold and exclude bitmaps of given image. + + @param img input image + @param tb median threshold bitmap + @param eb exclude bitmap + */ + CV_WRAP virtual void computeBitmaps(InputArray img, OutputArray tb, OutputArray eb) = 0; + + CV_WRAP virtual int getMaxBits() const = 0; + CV_WRAP virtual void setMaxBits(int max_bits) = 0; + + CV_WRAP virtual int getExcludeRange() const = 0; + CV_WRAP virtual void setExcludeRange(int exclude_range) = 0; + + CV_WRAP virtual bool getCut() const = 0; + CV_WRAP virtual void setCut(bool value) = 0; +}; + +/** @brief Creates AlignMTB object + +@param max_bits logarithm to the base 2 of maximal shift in each dimension. Values of 5 and 6 are +usually good enough (31 and 63 pixels shift respectively). +@param exclude_range range for exclusion bitmap that is constructed to suppress noise around the +median value. +@param cut if true cuts images, otherwise fills the new regions with zeros. + */ +CV_EXPORTS_W Ptr createAlignMTB(int max_bits = 6, int exclude_range = 4, bool cut = true); + +/** @brief The base class for camera response calibration algorithms. + */ +class CV_EXPORTS_W CalibrateCRF : public Algorithm +{ +public: + /** @brief Recovers inverse camera response. + + @param src vector of input images + @param dst 256x1 matrix with inverse camera response function + @param times vector of exposure time values for each image + */ + CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, InputArray times) = 0; +}; + +/** @brief Inverse camera response function is extracted for each brightness value by minimizing an objective +function as linear system. Objective function is constructed using pixel values on the same position +in all images, extra term is added to make the result smoother. + +For more information see @cite DM97 . + */ +class CV_EXPORTS_W CalibrateDebevec : public CalibrateCRF +{ +public: + CV_WRAP virtual float getLambda() const = 0; + CV_WRAP virtual void setLambda(float lambda) = 0; + + CV_WRAP virtual int getSamples() const = 0; + CV_WRAP virtual void setSamples(int samples) = 0; + + CV_WRAP virtual bool getRandom() const = 0; + CV_WRAP virtual void setRandom(bool random) = 0; +}; + +/** @brief Creates CalibrateDebevec object + +@param samples number of pixel locations to use +@param lambda smoothness term weight. Greater values produce smoother results, but can alter the +response. +@param random if true sample pixel locations are chosen at random, otherwise the form a +rectangular grid. + */ +CV_EXPORTS_W Ptr createCalibrateDebevec(int samples = 70, float lambda = 10.0f, bool random = false); + +/** @brief Inverse camera response function is extracted for each brightness value by minimizing an objective +function as linear system. This algorithm uses all image pixels. + +For more information see @cite RB99 . + */ +class CV_EXPORTS_W CalibrateRobertson : public CalibrateCRF +{ +public: + CV_WRAP virtual int getMaxIter() const = 0; + CV_WRAP virtual void setMaxIter(int max_iter) = 0; + + CV_WRAP virtual float getThreshold() const = 0; + CV_WRAP virtual void setThreshold(float threshold) = 0; + + CV_WRAP virtual Mat getRadiance() const = 0; +}; + +/** @brief Creates CalibrateRobertson object + +@param max_iter maximal number of Gauss-Seidel solver iterations. +@param threshold target difference between results of two successive steps of the minimization. + */ +CV_EXPORTS_W Ptr createCalibrateRobertson(int max_iter = 30, float threshold = 0.01f); + +/** @brief The base class algorithms that can merge exposure sequence to a single image. + */ +class CV_EXPORTS_W MergeExposures : public Algorithm +{ +public: + /** @brief Merges images. + + @param src vector of input images + @param dst result image + @param times vector of exposure time values for each image + @param response 256x1 matrix with inverse camera response function for each pixel value, it should + have the same number of channels as images. + */ + CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, + InputArray times, InputArray response) = 0; +}; + +/** @brief The resulting HDR image is calculated as weighted average of the exposures considering exposure +values and camera response. + +For more information see @cite DM97 . + */ +class CV_EXPORTS_W MergeDebevec : public MergeExposures +{ +public: + CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, + InputArray times, InputArray response) = 0; + CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, InputArray times) = 0; +}; + +/** @brief Creates MergeDebevec object + */ +CV_EXPORTS_W Ptr createMergeDebevec(); + +/** @brief Pixels are weighted using contrast, saturation and well-exposedness measures, than images are +combined using laplacian pyramids. + +The resulting image weight is constructed as weighted average of contrast, saturation and +well-exposedness measures. + +The resulting image doesn't require tonemapping and can be converted to 8-bit image by multiplying +by 255, but it's recommended to apply gamma correction and/or linear tonemapping. + +For more information see @cite MK07 . + */ +class CV_EXPORTS_W MergeMertens : public MergeExposures +{ +public: + CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, + InputArray times, InputArray response) = 0; + /** @brief Short version of process, that doesn't take extra arguments. + + @param src vector of input images + @param dst result image + */ + CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst) = 0; + + CV_WRAP virtual float getContrastWeight() const = 0; + CV_WRAP virtual void setContrastWeight(float contrast_weiht) = 0; + + CV_WRAP virtual float getSaturationWeight() const = 0; + CV_WRAP virtual void setSaturationWeight(float saturation_weight) = 0; + + CV_WRAP virtual float getExposureWeight() const = 0; + CV_WRAP virtual void setExposureWeight(float exposure_weight) = 0; +}; + +/** @brief Creates MergeMertens object + +@param contrast_weight contrast measure weight. See MergeMertens. +@param saturation_weight saturation measure weight +@param exposure_weight well-exposedness measure weight + */ +CV_EXPORTS_W Ptr +createMergeMertens(float contrast_weight = 1.0f, float saturation_weight = 1.0f, float exposure_weight = 0.0f); + +/** @brief The resulting HDR image is calculated as weighted average of the exposures considering exposure +values and camera response. + +For more information see @cite RB99 . + */ +class CV_EXPORTS_W MergeRobertson : public MergeExposures +{ +public: + CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, + InputArray times, InputArray response) = 0; + CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, InputArray times) = 0; +}; + +/** @brief Creates MergeRobertson object + */ +CV_EXPORTS_W Ptr createMergeRobertson(); + +//! @} photo_hdr + +/** @brief Transforms a color image to a grayscale image. It is a basic tool in digital printing, stylized +black-and-white photograph rendering, and in many single channel image processing applications +@cite CL12 . + +@param src Input 8-bit 3-channel image. +@param grayscale Output 8-bit 1-channel image. +@param color_boost Output 8-bit 3-channel image. + +This function is to be applied on color images. + */ +CV_EXPORTS_W void decolor( InputArray src, OutputArray grayscale, OutputArray color_boost); + +//! @addtogroup photo_clone +//! @{ + +/** @brief Image editing tasks concern either global changes (color/intensity corrections, filters, +deformations) or local changes concerned to a selection. Here we are interested in achieving local +changes, ones that are restricted to a region manually selected (ROI), in a seamless and effortless +manner. The extent of the changes ranges from slight distortions to complete replacement by novel +content @cite PM03 . + +@param src Input 8-bit 3-channel image. +@param dst Input 8-bit 3-channel image. +@param mask Input 8-bit 1 or 3-channel image. +@param p Point in dst image where object is placed. +@param blend Output image with the same size and type as dst. +@param flags Cloning method that could be one of the following: +- **NORMAL_CLONE** The power of the method is fully expressed when inserting objects with +complex outlines into a new background +- **MIXED_CLONE** The classic method, color-based selection and alpha masking might be time +consuming and often leaves an undesirable halo. Seamless cloning, even averaged with the +original image, is not effective. Mixed seamless cloning based on a loose selection proves +effective. +- **FEATURE_EXCHANGE** Feature exchange allows the user to easily replace certain features of +one object by alternative features. + */ +CV_EXPORTS_W void seamlessClone( InputArray src, InputArray dst, InputArray mask, Point p, + OutputArray blend, int flags); + +/** @brief Given an original color image, two differently colored versions of this image can be mixed +seamlessly. + +@param src Input 8-bit 3-channel image. +@param mask Input 8-bit 1 or 3-channel image. +@param dst Output image with the same size and type as src . +@param red_mul R-channel multiply factor. +@param green_mul G-channel multiply factor. +@param blue_mul B-channel multiply factor. + +Multiplication factor is between .5 to 2.5. + */ +CV_EXPORTS_W void colorChange(InputArray src, InputArray mask, OutputArray dst, float red_mul = 1.0f, + float green_mul = 1.0f, float blue_mul = 1.0f); + +/** @brief Applying an appropriate non-linear transformation to the gradient field inside the selection and +then integrating back with a Poisson solver, modifies locally the apparent illumination of an image. + +@param src Input 8-bit 3-channel image. +@param mask Input 8-bit 1 or 3-channel image. +@param dst Output image with the same size and type as src. +@param alpha Value ranges between 0-2. +@param beta Value ranges between 0-2. + +This is useful to highlight under-exposed foreground objects or to reduce specular reflections. + */ +CV_EXPORTS_W void illuminationChange(InputArray src, InputArray mask, OutputArray dst, + float alpha = 0.2f, float beta = 0.4f); + +/** @brief By retaining only the gradients at edge locations, before integrating with the Poisson solver, one +washes out the texture of the selected region, giving its contents a flat aspect. Here Canny Edge +Detector is used. + +@param src Input 8-bit 3-channel image. +@param mask Input 8-bit 1 or 3-channel image. +@param dst Output image with the same size and type as src. +@param low_threshold Range from 0 to 100. +@param high_threshold Value \> 100. +@param kernel_size The size of the Sobel kernel to be used. + +**NOTE:** + +The algorithm assumes that the color of the source image is close to that of the destination. This +assumption means that when the colors don't match, the source image color gets tinted toward the +color of the destination image. + */ +CV_EXPORTS_W void textureFlattening(InputArray src, InputArray mask, OutputArray dst, + float low_threshold = 30, float high_threshold = 45, + int kernel_size = 3); + +//! @} photo_clone + +//! @addtogroup photo_render +//! @{ + +/** @brief Filtering is the fundamental operation in image and video processing. Edge-preserving smoothing +filters are used in many different applications @cite EM11 . + +@param src Input 8-bit 3-channel image. +@param dst Output 8-bit 3-channel image. +@param flags Edge preserving filters: +- **RECURS_FILTER** = 1 +- **NORMCONV_FILTER** = 2 +@param sigma_s Range between 0 to 200. +@param sigma_r Range between 0 to 1. + */ +CV_EXPORTS_W void edgePreservingFilter(InputArray src, OutputArray dst, int flags = 1, + float sigma_s = 60, float sigma_r = 0.4f); + +/** @brief This filter enhances the details of a particular image. + +@param src Input 8-bit 3-channel image. +@param dst Output image with the same size and type as src. +@param sigma_s Range between 0 to 200. +@param sigma_r Range between 0 to 1. + */ +CV_EXPORTS_W void detailEnhance(InputArray src, OutputArray dst, float sigma_s = 10, + float sigma_r = 0.15f); + +/** @brief Pencil-like non-photorealistic line drawing + +@param src Input 8-bit 3-channel image. +@param dst1 Output 8-bit 1-channel image. +@param dst2 Output image with the same size and type as src. +@param sigma_s Range between 0 to 200. +@param sigma_r Range between 0 to 1. +@param shade_factor Range between 0 to 0.1. + */ +CV_EXPORTS_W void pencilSketch(InputArray src, OutputArray dst1, OutputArray dst2, + float sigma_s = 60, float sigma_r = 0.07f, float shade_factor = 0.02f); + +/** @brief Stylization aims to produce digital imagery with a wide variety of effects not focused on +photorealism. Edge-aware filters are ideal for stylization, as they can abstract regions of low +contrast while preserving, or enhancing, high-contrast features. + +@param src Input 8-bit 3-channel image. +@param dst Output image with the same size and type as src. +@param sigma_s Range between 0 to 200. +@param sigma_r Range between 0 to 1. + */ +CV_EXPORTS_W void stylization(InputArray src, OutputArray dst, float sigma_s = 60, + float sigma_r = 0.45f); + +//! @} photo_render + +//! @} photo + +} // cv + +#ifndef DISABLE_OPENCV_24_COMPATIBILITY +#include "opencv2/photo/photo_c.h" +#endif + +#endif diff --git a/lib/opencv/include/opencv2/photo/cuda.hpp b/lib/opencv/include/opencv2/photo/cuda.hpp new file mode 100644 index 000000000..aeac1fa86 --- /dev/null +++ b/lib/opencv/include/opencv2/photo/cuda.hpp @@ -0,0 +1,132 @@ +/*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) 2008-2012, 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_PHOTO_CUDA_HPP__ +#define __OPENCV_PHOTO_CUDA_HPP__ + +#include "opencv2/core/cuda.hpp" + +namespace cv { namespace cuda { + +//! @addtogroup photo_denoise +//! @{ + +/** @brief Performs pure non local means denoising without any simplification, and thus it is not fast. + +@param src Source image. Supports only CV_8UC1, CV_8UC2 and CV_8UC3. +@param dst Destination image. +@param h Filter sigma regulating filter strength for color. +@param search_window Size of search window. +@param block_size Size of block used for computing weights. +@param borderMode Border type. See borderInterpolate for details. BORDER_REFLECT101 , +BORDER_REPLICATE , BORDER_CONSTANT , BORDER_REFLECT and BORDER_WRAP are supported for now. +@param stream Stream for the asynchronous version. + +@sa + fastNlMeansDenoising + */ +CV_EXPORTS void nonLocalMeans(InputArray src, OutputArray dst, + float h, + int search_window = 21, + int block_size = 7, + int borderMode = BORDER_DEFAULT, + Stream& stream = Stream::Null()); + +/** @brief Perform image denoising using Non-local Means Denoising algorithm + with several computational +optimizations. Noise expected to be a gaussian white noise + +@param src Input 8-bit 1-channel, 2-channel or 3-channel image. +@param dst Output image with the same size and type as src . +@param h Parameter regulating filter strength. Big h value perfectly removes noise but also +removes image details, smaller h value preserves details but also preserves some noise +@param search_window Size in pixels of the window that is used to compute weighted average for +given pixel. Should be odd. Affect performance linearly: greater search_window - greater +denoising time. Recommended value 21 pixels +@param block_size Size in pixels of the template patch that is used to compute weights. Should be +odd. Recommended value 7 pixels +@param stream Stream for the asynchronous invocations. + +This function expected to be applied to grayscale images. For colored images look at +FastNonLocalMeansDenoising::labMethod. + +@sa + fastNlMeansDenoising + */ +CV_EXPORTS void fastNlMeansDenoising(InputArray src, OutputArray dst, + float h, + int search_window = 21, + int block_size = 7, + Stream& stream = Stream::Null()); + +/** @brief Modification of fastNlMeansDenoising function for colored images + +@param src Input 8-bit 3-channel image. +@param dst Output image with the same size and type as src . +@param h_luminance Parameter regulating filter strength. Big h value perfectly removes noise but +also removes image details, smaller h value preserves details but also preserves some noise +@param photo_render float The same as h but for color components. For most images value equals 10 will be +enough to remove colored noise and do not distort colors +@param search_window Size in pixels of the window that is used to compute weighted average for +given pixel. Should be odd. Affect performance linearly: greater search_window - greater +denoising time. Recommended value 21 pixels +@param block_size Size in pixels of the template patch that is used to compute weights. Should be +odd. Recommended value 7 pixels +@param stream Stream for the asynchronous invocations. + +The function converts image to CIELAB colorspace and then separately denoise L and AB components +with given h parameters using FastNonLocalMeansDenoising::simpleMethod function. + +@sa + fastNlMeansDenoisingColored + */ +CV_EXPORTS void fastNlMeansDenoisingColored(InputArray src, OutputArray dst, + float h_luminance, float photo_render, + int search_window = 21, + int block_size = 7, + Stream& stream = Stream::Null()); + +//! @} photo + +}} // namespace cv { namespace cuda { + +#endif /* __OPENCV_PHOTO_CUDA_HPP__ */ diff --git a/lib/opencv/include/opencv2/photo/photo.hpp b/lib/opencv/include/opencv2/photo/photo.hpp new file mode 100644 index 000000000..8af5e9f0f --- /dev/null +++ b/lib/opencv/include/opencv2/photo/photo.hpp @@ -0,0 +1,48 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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*/ + +#ifdef __OPENCV_BUILD +#error this is a compatibility header which should not be used inside the OpenCV library +#endif + +#include "opencv2/photo.hpp" diff --git a/lib/opencv/include/opencv2/photo/photo_c.h b/lib/opencv/include/opencv2/photo/photo_c.h new file mode 100644 index 000000000..07ca9b370 --- /dev/null +++ b/lib/opencv/include/opencv2/photo/photo_c.h @@ -0,0 +1,74 @@ +/*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) 2008-2012, 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_PHOTO_C_H__ +#define __OPENCV_PHOTO_C_H__ + +#include "opencv2/core/core_c.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup photo_c + @{ + */ + +/* Inpainting algorithms */ +enum InpaintingModes +{ + CV_INPAINT_NS =0, + CV_INPAINT_TELEA =1 +}; + + +/* Inpaints the selected region in the image */ +CVAPI(void) cvInpaint( const CvArr* src, const CvArr* inpaint_mask, + CvArr* dst, double inpaintRange, int flags ); + +/** @} */ + +#ifdef __cplusplus +} //extern "C" +#endif + +#endif //__OPENCV_PHOTO_C_H__ diff --git a/lib/opencv/include/opencv2/shape.hpp b/lib/opencv/include/opencv2/shape.hpp new file mode 100644 index 000000000..6999476a7 --- /dev/null +++ b/lib/opencv/include/opencv2/shape.hpp @@ -0,0 +1,57 @@ +/*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-2012, 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_SHAPE_HPP__ +#define __OPENCV_SHAPE_HPP__ + +#include "opencv2/shape/emdL1.hpp" +#include "opencv2/shape/shape_transformer.hpp" +#include "opencv2/shape/hist_cost.hpp" +#include "opencv2/shape/shape_distance.hpp" + +/** + @defgroup shape Shape Distance and Matching + */ + +#endif + +/* End of file. */ diff --git a/lib/opencv/include/opencv2/shape/emdL1.hpp b/lib/opencv/include/opencv2/shape/emdL1.hpp new file mode 100644 index 000000000..1dfa7581a --- /dev/null +++ b/lib/opencv/include/opencv2/shape/emdL1.hpp @@ -0,0 +1,72 @@ +/*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-2012, 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_EMD_L1_HPP__ +#define __OPENCV_EMD_L1_HPP__ + +#include "opencv2/core.hpp" + +namespace cv +{ +/****************************************************************************************\ +* EMDL1 Function * +\****************************************************************************************/ + +//! @addtogroup shape +//! @{ + +/** @brief Computes the "minimal work" distance between two weighted point configurations base on the papers +"EMD-L1: An efficient and Robust Algorithm for comparing histogram-based descriptors", by Haibin +Ling and Kazunori Okuda; and "The Earth Mover's Distance is the Mallows Distance: Some Insights from +Statistics", by Elizaveta Levina and Peter Bickel. + +@param signature1 First signature, a single column floating-point matrix. Each row is the value of +the histogram in each bin. +@param signature2 Second signature of the same format and size as signature1. + */ +CV_EXPORTS float EMDL1(InputArray signature1, InputArray signature2); + +//! @} + +}//namespace cv + +#endif diff --git a/lib/opencv/include/opencv2/shape/hist_cost.hpp b/lib/opencv/include/opencv2/shape/hist_cost.hpp new file mode 100644 index 000000000..15c0a87c7 --- /dev/null +++ b/lib/opencv/include/opencv2/shape/hist_cost.hpp @@ -0,0 +1,111 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_HIST_COST_HPP__ +#define __OPENCV_HIST_COST_HPP__ + +#include "opencv2/imgproc.hpp" + +namespace cv +{ + +//! @addtogroup shape +//! @{ + +/** @brief Abstract base class for histogram cost algorithms. + */ +class CV_EXPORTS_W HistogramCostExtractor : public Algorithm +{ +public: + CV_WRAP virtual void buildCostMatrix(InputArray descriptors1, InputArray descriptors2, OutputArray costMatrix) = 0; + + CV_WRAP virtual void setNDummies(int nDummies) = 0; + CV_WRAP virtual int getNDummies() const = 0; + + CV_WRAP virtual void setDefaultCost(float defaultCost) = 0; + CV_WRAP virtual float getDefaultCost() const = 0; +}; + +/** @brief A norm based cost extraction. : + */ +class CV_EXPORTS_W NormHistogramCostExtractor : public HistogramCostExtractor +{ +public: + CV_WRAP virtual void setNormFlag(int flag) = 0; + CV_WRAP virtual int getNormFlag() const = 0; +}; + +CV_EXPORTS_W Ptr + createNormHistogramCostExtractor(int flag=DIST_L2, int nDummies=25, float defaultCost=0.2f); + +/** @brief An EMD based cost extraction. : + */ +class CV_EXPORTS_W EMDHistogramCostExtractor : public HistogramCostExtractor +{ +public: + CV_WRAP virtual void setNormFlag(int flag) = 0; + CV_WRAP virtual int getNormFlag() const = 0; +}; + +CV_EXPORTS_W Ptr + createEMDHistogramCostExtractor(int flag=DIST_L2, int nDummies=25, float defaultCost=0.2f); + +/** @brief An Chi based cost extraction. : + */ +class CV_EXPORTS_W ChiHistogramCostExtractor : public HistogramCostExtractor +{}; + +CV_EXPORTS_W Ptr createChiHistogramCostExtractor(int nDummies=25, float defaultCost=0.2f); + +/** @brief An EMD-L1 based cost extraction. : + */ +class CV_EXPORTS_W EMDL1HistogramCostExtractor : public HistogramCostExtractor +{}; + +CV_EXPORTS_W Ptr + createEMDL1HistogramCostExtractor(int nDummies=25, float defaultCost=0.2f); + +//! @} + +} // cv +#endif diff --git a/lib/opencv/include/opencv2/shape/shape.hpp b/lib/opencv/include/opencv2/shape/shape.hpp new file mode 100644 index 000000000..5c4da3cef --- /dev/null +++ b/lib/opencv/include/opencv2/shape/shape.hpp @@ -0,0 +1,48 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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*/ + +#ifdef __OPENCV_BUILD +#error this is a compatibility header which should not be used inside the OpenCV library +#endif + +#include "opencv2/shape.hpp" diff --git a/lib/opencv/include/opencv2/shape/shape_distance.hpp b/lib/opencv/include/opencv2/shape/shape_distance.hpp new file mode 100644 index 000000000..4b0c3b5f6 --- /dev/null +++ b/lib/opencv/include/opencv2/shape/shape_distance.hpp @@ -0,0 +1,224 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_SHAPE_SHAPE_DISTANCE_HPP__ +#define __OPENCV_SHAPE_SHAPE_DISTANCE_HPP__ +#include "opencv2/core.hpp" +#include "opencv2/shape/hist_cost.hpp" +#include "opencv2/shape/shape_transformer.hpp" + +namespace cv +{ + +//! @addtogroup shape +//! @{ + +/** @brief Abstract base class for shape distance algorithms. + */ +class CV_EXPORTS_W ShapeDistanceExtractor : public Algorithm +{ +public: + /** @brief Compute the shape distance between two shapes defined by its contours. + + @param contour1 Contour defining first shape. + @param contour2 Contour defining second shape. + */ + CV_WRAP virtual float computeDistance(InputArray contour1, InputArray contour2) = 0; +}; + +/***********************************************************************************/ +/***********************************************************************************/ +/***********************************************************************************/ +/** @brief Implementation of the Shape Context descriptor and matching algorithm + +proposed by Belongie et al. in "Shape Matching and Object Recognition Using Shape Contexts" (PAMI +2002). This implementation is packaged in a generic scheme, in order to allow you the +implementation of the common variations of the original pipeline. +*/ +class CV_EXPORTS_W ShapeContextDistanceExtractor : public ShapeDistanceExtractor +{ +public: + /** @brief Establish the number of angular bins for the Shape Context Descriptor used in the shape matching + pipeline. + + @param nAngularBins The number of angular bins in the shape context descriptor. + */ + CV_WRAP virtual void setAngularBins(int nAngularBins) = 0; + CV_WRAP virtual int getAngularBins() const = 0; + + /** @brief Establish the number of radial bins for the Shape Context Descriptor used in the shape matching + pipeline. + + @param nRadialBins The number of radial bins in the shape context descriptor. + */ + CV_WRAP virtual void setRadialBins(int nRadialBins) = 0; + CV_WRAP virtual int getRadialBins() const = 0; + + /** @brief Set the inner radius of the shape context descriptor. + + @param innerRadius The value of the inner radius. + */ + CV_WRAP virtual void setInnerRadius(float innerRadius) = 0; + CV_WRAP virtual float getInnerRadius() const = 0; + + /** @brief Set the outer radius of the shape context descriptor. + + @param outerRadius The value of the outer radius. + */ + CV_WRAP virtual void setOuterRadius(float outerRadius) = 0; + CV_WRAP virtual float getOuterRadius() const = 0; + + CV_WRAP virtual void setRotationInvariant(bool rotationInvariant) = 0; + CV_WRAP virtual bool getRotationInvariant() const = 0; + + /** @brief Set the weight of the shape context distance in the final value of the shape distance. The shape + context distance between two shapes is defined as the symmetric sum of shape context matching costs + over best matching points. The final value of the shape distance is a user-defined linear + combination of the shape context distance, an image appearance distance, and a bending energy. + + @param shapeContextWeight The weight of the shape context distance in the final distance value. + */ + CV_WRAP virtual void setShapeContextWeight(float shapeContextWeight) = 0; + CV_WRAP virtual float getShapeContextWeight() const = 0; + + /** @brief Set the weight of the Image Appearance cost in the final value of the shape distance. The image + appearance cost is defined as the sum of squared brightness differences in Gaussian windows around + corresponding image points. The final value of the shape distance is a user-defined linear + combination of the shape context distance, an image appearance distance, and a bending energy. If + this value is set to a number different from 0, is mandatory to set the images that correspond to + each shape. + + @param imageAppearanceWeight The weight of the appearance cost in the final distance value. + */ + CV_WRAP virtual void setImageAppearanceWeight(float imageAppearanceWeight) = 0; + CV_WRAP virtual float getImageAppearanceWeight() const = 0; + + /** @brief Set the weight of the Bending Energy in the final value of the shape distance. The bending energy + definition depends on what transformation is being used to align the shapes. The final value of the + shape distance is a user-defined linear combination of the shape context distance, an image + appearance distance, and a bending energy. + + @param bendingEnergyWeight The weight of the Bending Energy in the final distance value. + */ + CV_WRAP virtual void setBendingEnergyWeight(float bendingEnergyWeight) = 0; + CV_WRAP virtual float getBendingEnergyWeight() const = 0; + + /** @brief Set the images that correspond to each shape. This images are used in the calculation of the Image + Appearance cost. + + @param image1 Image corresponding to the shape defined by contours1. + @param image2 Image corresponding to the shape defined by contours2. + */ + CV_WRAP virtual void setImages(InputArray image1, InputArray image2) = 0; + CV_WRAP virtual void getImages(OutputArray image1, OutputArray image2) const = 0; + + CV_WRAP virtual void setIterations(int iterations) = 0; + CV_WRAP virtual int getIterations() const = 0; + + /** @brief Set the algorithm used for building the shape context descriptor cost matrix. + + @param comparer Smart pointer to a HistogramCostExtractor, an algorithm that defines the cost + matrix between descriptors. + */ + CV_WRAP virtual void setCostExtractor(Ptr comparer) = 0; + CV_WRAP virtual Ptr getCostExtractor() const = 0; + + /** @brief Set the value of the standard deviation for the Gaussian window for the image appearance cost. + + @param sigma Standard Deviation. + */ + CV_WRAP virtual void setStdDev(float sigma) = 0; + CV_WRAP virtual float getStdDev() const = 0; + + /** @brief Set the algorithm used for aligning the shapes. + + @param transformer Smart pointer to a ShapeTransformer, an algorithm that defines the aligning + transformation. + */ + CV_WRAP virtual void setTransformAlgorithm(Ptr transformer) = 0; + CV_WRAP virtual Ptr getTransformAlgorithm() const = 0; +}; + +/* Complete constructor */ +CV_EXPORTS_W Ptr + createShapeContextDistanceExtractor(int nAngularBins=12, int nRadialBins=4, + float innerRadius=0.2f, float outerRadius=2, int iterations=3, + const Ptr &comparer = createChiHistogramCostExtractor(), + const Ptr &transformer = createThinPlateSplineShapeTransformer()); + +/***********************************************************************************/ +/***********************************************************************************/ +/***********************************************************************************/ +/** @brief A simple Hausdorff distance measure between shapes defined by contours + +according to the paper "Comparing Images using the Hausdorff distance." by D.P. Huttenlocher, G.A. +Klanderman, and W.J. Rucklidge. (PAMI 1993). : + */ +class CV_EXPORTS_W HausdorffDistanceExtractor : public ShapeDistanceExtractor +{ +public: + /** @brief Set the norm used to compute the Hausdorff value between two shapes. It can be L1 or L2 norm. + + @param distanceFlag Flag indicating which norm is used to compute the Hausdorff distance + (NORM_L1, NORM_L2). + */ + CV_WRAP virtual void setDistanceFlag(int distanceFlag) = 0; + CV_WRAP virtual int getDistanceFlag() const = 0; + + /** @brief This method sets the rank proportion (or fractional value) that establish the Kth ranked value of + the partial Hausdorff distance. Experimentally had been shown that 0.6 is a good value to compare + shapes. + + @param rankProportion fractional value (between 0 and 1). + */ + CV_WRAP virtual void setRankProportion(float rankProportion) = 0; + CV_WRAP virtual float getRankProportion() const = 0; +}; + +/* Constructor */ +CV_EXPORTS_W Ptr createHausdorffDistanceExtractor(int distanceFlag=cv::NORM_L2, float rankProp=0.6f); + +//! @} + +} // cv +#endif diff --git a/lib/opencv/include/opencv2/shape/shape_transformer.hpp b/lib/opencv/include/opencv2/shape/shape_transformer.hpp new file mode 100644 index 000000000..218061367 --- /dev/null +++ b/lib/opencv/include/opencv2/shape/shape_transformer.hpp @@ -0,0 +1,132 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_SHAPE_SHAPE_TRANSFORM_HPP__ +#define __OPENCV_SHAPE_SHAPE_TRANSFORM_HPP__ +#include +#include "opencv2/core.hpp" +#include "opencv2/imgproc.hpp" + +namespace cv +{ + +//! @addtogroup shape +//! @{ + +/** @brief Abstract base class for shape transformation algorithms. + */ +class CV_EXPORTS_W ShapeTransformer : public Algorithm +{ +public: + /** @brief Estimate the transformation parameters of the current transformer algorithm, based on point matches. + + @param transformingShape Contour defining first shape. + @param targetShape Contour defining second shape (Target). + @param matches Standard vector of Matches between points. + */ + CV_WRAP virtual void estimateTransformation(InputArray transformingShape, InputArray targetShape, + std::vector& matches) = 0; + + /** @brief Apply a transformation, given a pre-estimated transformation parameters. + + @param input Contour (set of points) to apply the transformation. + @param output Output contour. + */ + CV_WRAP virtual float applyTransformation(InputArray input, OutputArray output=noArray()) = 0; + + /** @brief Apply a transformation, given a pre-estimated transformation parameters, to an Image. + + @param transformingImage Input image. + @param output Output image. + @param flags Image interpolation method. + @param borderMode border style. + @param borderValue border value. + */ + CV_WRAP virtual void warpImage(InputArray transformingImage, OutputArray output, + int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT, + const Scalar& borderValue=Scalar()) const = 0; +}; + +/***********************************************************************************/ +/***********************************************************************************/ + +/** @brief Definition of the transformation + +ocupied in the paper "Principal Warps: Thin-Plate Splines and Decomposition of Deformations", by +F.L. Bookstein (PAMI 1989). : + */ +class CV_EXPORTS_W ThinPlateSplineShapeTransformer : public ShapeTransformer +{ +public: + /** @brief Set the regularization parameter for relaxing the exact interpolation requirements of the TPS + algorithm. + + @param beta value of the regularization parameter. + */ + CV_WRAP virtual void setRegularizationParameter(double beta) = 0; + CV_WRAP virtual double getRegularizationParameter() const = 0; +}; + +/** Complete constructor */ +CV_EXPORTS_W Ptr + createThinPlateSplineShapeTransformer(double regularizationParameter=0); + +/***********************************************************************************/ +/***********************************************************************************/ + +/** @brief Wrapper class for the OpenCV Affine Transformation algorithm. : + */ +class CV_EXPORTS_W AffineTransformer : public ShapeTransformer +{ +public: + CV_WRAP virtual void setFullAffine(bool fullAffine) = 0; + CV_WRAP virtual bool getFullAffine() const = 0; +}; + +/** Complete constructor */ +CV_EXPORTS_W Ptr createAffineTransformer(bool fullAffine); + +//! @} + +} // cv +#endif diff --git a/lib/opencv/include/opencv2/stitching.hpp b/lib/opencv/include/opencv2/stitching.hpp new file mode 100644 index 000000000..96cde1401 --- /dev/null +++ b/lib/opencv/include/opencv2/stitching.hpp @@ -0,0 +1,257 @@ +/*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_STITCHING_STITCHER_HPP__ +#define __OPENCV_STITCHING_STITCHER_HPP__ + +#include "opencv2/core.hpp" +#include "opencv2/features2d.hpp" +#include "opencv2/stitching/warpers.hpp" +#include "opencv2/stitching/detail/matchers.hpp" +#include "opencv2/stitching/detail/motion_estimators.hpp" +#include "opencv2/stitching/detail/exposure_compensate.hpp" +#include "opencv2/stitching/detail/seam_finders.hpp" +#include "opencv2/stitching/detail/blenders.hpp" +#include "opencv2/stitching/detail/camera.hpp" + +/** +@defgroup stitching Images stitching + +This figure illustrates the stitching module pipeline implemented in the Stitcher class. Using that +class it's possible to configure/remove some steps, i.e. adjust the stitching pipeline according to +the particular needs. All building blocks from the pipeline are available in the detail namespace, +one can combine and use them separately. + +The implemented stitching pipeline is very similar to the one proposed in @cite BL07 . + +![image](StitchingPipeline.jpg) + +@{ + @defgroup stitching_match Features Finding and Images Matching + @defgroup stitching_rotation Rotation Estimation + @defgroup stitching_autocalib Autocalibration + @defgroup stitching_warp Images Warping + @defgroup stitching_seam Seam Estimation + @defgroup stitching_exposure Exposure Compensation + @defgroup stitching_blend Image Blenders +@} + */ + +namespace cv { + +//! @addtogroup stitching +//! @{ + +/** @brief High level image stitcher. + +It's possible to use this class without being aware of the entire stitching pipeline. However, to +be able to achieve higher stitching stability and quality of the final images at least being +familiar with the theory is recommended. + +@note + - A basic example on image stitching can be found at + opencv_source_code/samples/cpp/stitching.cpp + - A detailed example on image stitching can be found at + opencv_source_code/samples/cpp/stitching_detailed.cpp + */ +class CV_EXPORTS_W Stitcher +{ +public: + enum { ORIG_RESOL = -1 }; + enum Status + { + OK = 0, + ERR_NEED_MORE_IMGS = 1, + ERR_HOMOGRAPHY_EST_FAIL = 2, + ERR_CAMERA_PARAMS_ADJUST_FAIL = 3 + }; + + // Stitcher() {} + /** @brief Creates a stitcher with the default parameters. + + @param try_use_gpu Flag indicating whether GPU should be used whenever it's possible. + @return Stitcher class instance. + */ + static Stitcher createDefault(bool try_use_gpu = false); + + CV_WRAP double registrationResol() const { return registr_resol_; } + CV_WRAP void setRegistrationResol(double resol_mpx) { registr_resol_ = resol_mpx; } + + CV_WRAP double seamEstimationResol() const { return seam_est_resol_; } + CV_WRAP void setSeamEstimationResol(double resol_mpx) { seam_est_resol_ = resol_mpx; } + + CV_WRAP double compositingResol() const { return compose_resol_; } + CV_WRAP void setCompositingResol(double resol_mpx) { compose_resol_ = resol_mpx; } + + CV_WRAP double panoConfidenceThresh() const { return conf_thresh_; } + CV_WRAP void setPanoConfidenceThresh(double conf_thresh) { conf_thresh_ = conf_thresh; } + + CV_WRAP bool waveCorrection() const { return do_wave_correct_; } + CV_WRAP void setWaveCorrection(bool flag) { do_wave_correct_ = flag; } + + detail::WaveCorrectKind waveCorrectKind() const { return wave_correct_kind_; } + void setWaveCorrectKind(detail::WaveCorrectKind kind) { wave_correct_kind_ = kind; } + + Ptr featuresFinder() { return features_finder_; } + const Ptr featuresFinder() const { return features_finder_; } + void setFeaturesFinder(Ptr features_finder) + { features_finder_ = features_finder; } + + Ptr featuresMatcher() { return features_matcher_; } + const Ptr featuresMatcher() const { return features_matcher_; } + void setFeaturesMatcher(Ptr features_matcher) + { features_matcher_ = features_matcher; } + + const cv::UMat& matchingMask() const { return matching_mask_; } + void setMatchingMask(const cv::UMat &mask) + { + CV_Assert(mask.type() == CV_8U && mask.cols == mask.rows); + matching_mask_ = mask.clone(); + } + + Ptr bundleAdjuster() { return bundle_adjuster_; } + const Ptr bundleAdjuster() const { return bundle_adjuster_; } + void setBundleAdjuster(Ptr bundle_adjuster) + { bundle_adjuster_ = bundle_adjuster; } + + Ptr warper() { return warper_; } + const Ptr warper() const { return warper_; } + void setWarper(Ptr creator) { warper_ = creator; } + + Ptr exposureCompensator() { return exposure_comp_; } + const Ptr exposureCompensator() const { return exposure_comp_; } + void setExposureCompensator(Ptr exposure_comp) + { exposure_comp_ = exposure_comp; } + + Ptr seamFinder() { return seam_finder_; } + const Ptr seamFinder() const { return seam_finder_; } + void setSeamFinder(Ptr seam_finder) { seam_finder_ = seam_finder; } + + Ptr blender() { return blender_; } + const Ptr blender() const { return blender_; } + void setBlender(Ptr b) { blender_ = b; } + + /** @overload */ + CV_WRAP Status estimateTransform(InputArrayOfArrays images); + /** @brief These functions try to match the given images and to estimate rotations of each camera. + + @note Use the functions only if you're aware of the stitching pipeline, otherwise use + Stitcher::stitch. + + @param images Input images. + @param rois Region of interest rectangles. + @return Status code. + */ + Status estimateTransform(InputArrayOfArrays images, const std::vector > &rois); + + /** @overload */ + CV_WRAP Status composePanorama(OutputArray pano); + /** @brief These functions try to compose the given images (or images stored internally from the other function + calls) into the final pano under the assumption that the image transformations were estimated + before. + + @note Use the functions only if you're aware of the stitching pipeline, otherwise use + Stitcher::stitch. + + @param images Input images. + @param pano Final pano. + @return Status code. + */ + Status composePanorama(InputArrayOfArrays images, OutputArray pano); + + /** @overload */ + CV_WRAP Status stitch(InputArrayOfArrays images, OutputArray pano); + /** @brief These functions try to stitch the given images. + + @param images Input images. + @param rois Region of interest rectangles. + @param pano Final pano. + @return Status code. + */ + Status stitch(InputArrayOfArrays images, const std::vector > &rois, OutputArray pano); + + std::vector component() const { return indices_; } + std::vector cameras() const { return cameras_; } + CV_WRAP double workScale() const { return work_scale_; } + +private: + //Stitcher() {} + + Status matchImages(); + Status estimateCameraParams(); + + double registr_resol_; + double seam_est_resol_; + double compose_resol_; + double conf_thresh_; + Ptr features_finder_; + Ptr features_matcher_; + cv::UMat matching_mask_; + Ptr bundle_adjuster_; + bool do_wave_correct_; + detail::WaveCorrectKind wave_correct_kind_; + Ptr warper_; + Ptr exposure_comp_; + Ptr seam_finder_; + Ptr blender_; + + std::vector imgs_; + std::vector > rois_; + std::vector full_img_sizes_; + std::vector features_; + std::vector pairwise_matches_; + std::vector seam_est_imgs_; + std::vector indices_; + std::vector cameras_; + double work_scale_; + double seam_scale_; + double seam_work_aspect_; + double warped_image_scale_; +}; + +CV_EXPORTS_W Ptr createStitcher(bool try_use_gpu = false); + +//! @} stitching + +} // namespace cv + +#endif // __OPENCV_STITCHING_STITCHER_HPP__ diff --git a/lib/opencv/include/opencv2/stitching/detail/autocalib.hpp b/lib/opencv/include/opencv2/stitching/detail/autocalib.hpp new file mode 100644 index 000000000..ccc0aa179 --- /dev/null +++ b/lib/opencv/include/opencv2/stitching/detail/autocalib.hpp @@ -0,0 +1,86 @@ +/*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_STITCHING_AUTOCALIB_HPP__ +#define __OPENCV_STITCHING_AUTOCALIB_HPP__ + +#include "opencv2/core.hpp" +#include "matchers.hpp" + +namespace cv { +namespace detail { + +//! @addtogroup stitching_autocalib +//! @{ + +/** @brief Tries to estimate focal lengths from the given homography under the assumption that the camera +undergoes rotations around its centre only. + +@param H Homography. +@param f0 Estimated focal length along X axis. +@param f1 Estimated focal length along Y axis. +@param f0_ok True, if f0 was estimated successfully, false otherwise. +@param f1_ok True, if f1 was estimated successfully, false otherwise. + +See "Construction of Panoramic Image Mosaics with Global and Local Alignment" +by Heung-Yeung Shum and Richard Szeliski. + */ +void CV_EXPORTS focalsFromHomography(const Mat &H, double &f0, double &f1, bool &f0_ok, bool &f1_ok); + +/** @brief Estimates focal lengths for each given camera. + +@param features Features of images. +@param pairwise_matches Matches between all image pairs. +@param focals Estimated focal lengths for each camera. + */ +void CV_EXPORTS estimateFocal(const std::vector &features, + const std::vector &pairwise_matches, + std::vector &focals); + +bool CV_EXPORTS calibrateRotatingCamera(const std::vector &Hs, Mat &K); + +//! @} stitching_autocalib + +} // namespace detail +} // namespace cv + +#endif // __OPENCV_STITCHING_AUTOCALIB_HPP__ diff --git a/lib/opencv/include/opencv2/stitching/detail/blenders.hpp b/lib/opencv/include/opencv2/stitching/detail/blenders.hpp new file mode 100644 index 000000000..0e607258a --- /dev/null +++ b/lib/opencv/include/opencv2/stitching/detail/blenders.hpp @@ -0,0 +1,163 @@ +/*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_STITCHING_BLENDERS_HPP__ +#define __OPENCV_STITCHING_BLENDERS_HPP__ + +#include "opencv2/core.hpp" + +namespace cv { +namespace detail { + +//! @addtogroup stitching_blend +//! @{ + +/** @brief Base class for all blenders. + +Simple blender which puts one image over another +*/ +class CV_EXPORTS Blender +{ +public: + virtual ~Blender() {} + + enum { NO, FEATHER, MULTI_BAND }; + static Ptr createDefault(int type, bool try_gpu = false); + + /** @brief Prepares the blender for blending. + + @param corners Source images top-left corners + @param sizes Source image sizes + */ + void prepare(const std::vector &corners, const std::vector &sizes); + /** @overload */ + virtual void prepare(Rect dst_roi); + /** @brief Processes the image. + + @param img Source image + @param mask Source image mask + @param tl Source image top-left corners + */ + virtual void feed(InputArray img, InputArray mask, Point tl); + /** @brief Blends and returns the final pano. + + @param dst Final pano + @param dst_mask Final pano mask + */ + virtual void blend(InputOutputArray dst, InputOutputArray dst_mask); + +protected: + UMat dst_, dst_mask_; + Rect dst_roi_; +}; + +/** @brief Simple blender which mixes images at its borders. + */ +class CV_EXPORTS FeatherBlender : public Blender +{ +public: + FeatherBlender(float sharpness = 0.02f); + + float sharpness() const { return sharpness_; } + void setSharpness(float val) { sharpness_ = val; } + + void prepare(Rect dst_roi); + void feed(InputArray img, InputArray mask, Point tl); + void blend(InputOutputArray dst, InputOutputArray dst_mask); + + //! Creates weight maps for fixed set of source images by their masks and top-left corners. + //! Final image can be obtained by simple weighting of the source images. + Rect createWeightMaps(const std::vector &masks, const std::vector &corners, + std::vector &weight_maps); + +private: + float sharpness_; + UMat weight_map_; + UMat dst_weight_map_; +}; + +inline FeatherBlender::FeatherBlender(float _sharpness) { setSharpness(_sharpness); } + +/** @brief Blender which uses multi-band blending algorithm (see @cite BA83). + */ +class CV_EXPORTS MultiBandBlender : public Blender +{ +public: + MultiBandBlender(int try_gpu = false, int num_bands = 5, int weight_type = CV_32F); + + int numBands() const { return actual_num_bands_; } + void setNumBands(int val) { actual_num_bands_ = val; } + + void prepare(Rect dst_roi); + void feed(InputArray img, InputArray mask, Point tl); + void blend(InputOutputArray dst, InputOutputArray dst_mask); + +private: + int actual_num_bands_, num_bands_; + std::vector dst_pyr_laplace_; + std::vector dst_band_weights_; + Rect dst_roi_final_; + bool can_use_gpu_; + int weight_type_; //CV_32F or CV_16S +}; + + +////////////////////////////////////////////////////////////////////////////// +// Auxiliary functions + +void CV_EXPORTS normalizeUsingWeightMap(InputArray weight, InputOutputArray src); + +void CV_EXPORTS createWeightMap(InputArray mask, float sharpness, InputOutputArray weight); + +void CV_EXPORTS createLaplacePyr(InputArray img, int num_levels, std::vector& pyr); +void CV_EXPORTS createLaplacePyrGpu(InputArray img, int num_levels, std::vector& pyr); + +// Restores source image +void CV_EXPORTS restoreImageFromLaplacePyr(std::vector& pyr); +void CV_EXPORTS restoreImageFromLaplacePyrGpu(std::vector& pyr); + +//! @} + +} // namespace detail +} // namespace cv + +#endif // __OPENCV_STITCHING_BLENDERS_HPP__ diff --git a/lib/opencv/include/opencv2/stitching/detail/camera.hpp b/lib/opencv/include/opencv2/stitching/detail/camera.hpp new file mode 100644 index 000000000..c231ba5ed --- /dev/null +++ b/lib/opencv/include/opencv2/stitching/detail/camera.hpp @@ -0,0 +1,78 @@ +/*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_STITCHING_CAMERA_HPP__ +#define __OPENCV_STITCHING_CAMERA_HPP__ + +#include "opencv2/core.hpp" + +namespace cv { +namespace detail { + +//! @addtogroup stitching +//! @{ + +/** @brief Describes camera parameters. + +@note Translation is assumed to be zero during the whole stitching pipeline. : + */ +struct CV_EXPORTS CameraParams +{ + CameraParams(); + CameraParams(const CameraParams& other); + const CameraParams& operator =(const CameraParams& other); + Mat K() const; + + double focal; // Focal length + double aspect; // Aspect ratio + double ppx; // Principal point X + double ppy; // Principal point Y + Mat R; // Rotation + Mat t; // Translation +}; + +//! @} + +} // namespace detail +} // namespace cv + +#endif // #ifndef __OPENCV_STITCHING_CAMERA_HPP__ diff --git a/lib/opencv/include/opencv2/stitching/detail/exposure_compensate.hpp b/lib/opencv/include/opencv2/stitching/detail/exposure_compensate.hpp new file mode 100644 index 000000000..ef64e1244 --- /dev/null +++ b/lib/opencv/include/opencv2/stitching/detail/exposure_compensate.hpp @@ -0,0 +1,132 @@ +/*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_STITCHING_EXPOSURE_COMPENSATE_HPP__ +#define __OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP__ + +#include "opencv2/core.hpp" + +namespace cv { +namespace detail { + +//! @addtogroup stitching_exposure +//! @{ + +/** @brief Base class for all exposure compensators. + */ +class CV_EXPORTS ExposureCompensator +{ +public: + virtual ~ExposureCompensator() {} + + enum { NO, GAIN, GAIN_BLOCKS }; + static Ptr createDefault(int type); + + /** + @param corners Source image top-left corners + @param images Source images + @param masks Image masks to update (second value in pair specifies the value which should be used + to detect where image is) + */ + void feed(const std::vector &corners, const std::vector &images, + const std::vector &masks); + /** @overload */ + virtual void feed(const std::vector &corners, const std::vector &images, + const std::vector > &masks) = 0; + /** @brief Compensate exposure in the specified image. + + @param index Image index + @param corner Image top-left corner + @param image Image to process + @param mask Image mask + */ + virtual void apply(int index, Point corner, InputOutputArray image, InputArray mask) = 0; +}; + +/** @brief Stub exposure compensator which does nothing. + */ +class CV_EXPORTS NoExposureCompensator : public ExposureCompensator +{ +public: + void feed(const std::vector &/*corners*/, const std::vector &/*images*/, + const std::vector > &/*masks*/) { } + void apply(int /*index*/, Point /*corner*/, InputOutputArray /*image*/, InputArray /*mask*/) { } +}; + +/** @brief Exposure compensator which tries to remove exposure related artifacts by adjusting image +intensities, see @cite BL07 and @cite WJ10 for details. + */ +class CV_EXPORTS GainCompensator : public ExposureCompensator +{ +public: + void feed(const std::vector &corners, const std::vector &images, + const std::vector > &masks); + void apply(int index, Point corner, InputOutputArray image, InputArray mask); + std::vector gains() const; + +private: + Mat_ gains_; +}; + +/** @brief Exposure compensator which tries to remove exposure related artifacts by adjusting image block +intensities, see @cite UES01 for details. + */ +class CV_EXPORTS BlocksGainCompensator : public ExposureCompensator +{ +public: + BlocksGainCompensator(int bl_width = 32, int bl_height = 32) + : bl_width_(bl_width), bl_height_(bl_height) {} + void feed(const std::vector &corners, const std::vector &images, + const std::vector > &masks); + void apply(int index, Point corner, InputOutputArray image, InputArray mask); + +private: + int bl_width_, bl_height_; + std::vector gain_maps_; +}; + +//! @} + +} // namespace detail +} // namespace cv + +#endif // __OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP__ diff --git a/lib/opencv/include/opencv2/stitching/detail/matchers.hpp b/lib/opencv/include/opencv2/stitching/detail/matchers.hpp new file mode 100644 index 000000000..8f34bd23a --- /dev/null +++ b/lib/opencv/include/opencv2/stitching/detail/matchers.hpp @@ -0,0 +1,275 @@ +/*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_STITCHING_MATCHERS_HPP__ +#define __OPENCV_STITCHING_MATCHERS_HPP__ + +#include "opencv2/core.hpp" +#include "opencv2/features2d.hpp" + +#include "opencv2/opencv_modules.hpp" + +#ifdef HAVE_OPENCV_XFEATURES2D +# include "opencv2/xfeatures2d/cuda.hpp" +#endif + +namespace cv { +namespace detail { + +//! @addtogroup stitching_match +//! @{ + +/** @brief Structure containing image keypoints and descriptors. */ +struct CV_EXPORTS ImageFeatures +{ + int img_idx; + Size img_size; + std::vector keypoints; + UMat descriptors; +}; + +/** @brief Feature finders base class */ +class CV_EXPORTS FeaturesFinder +{ +public: + virtual ~FeaturesFinder() {} + /** @overload */ + void operator ()(InputArray image, ImageFeatures &features); + /** @brief Finds features in the given image. + + @param image Source image + @param features Found features + @param rois Regions of interest + + @sa detail::ImageFeatures, Rect_ + */ + void operator ()(InputArray image, ImageFeatures &features, const std::vector &rois); + /** @brief Frees unused memory allocated before if there is any. */ + virtual void collectGarbage() {} + +protected: + /** @brief This method must implement features finding logic in order to make the wrappers + detail::FeaturesFinder::operator()_ work. + + @param image Source image + @param features Found features + + @sa detail::ImageFeatures */ + virtual void find(InputArray image, ImageFeatures &features) = 0; +}; + +/** @brief SURF features finder. + +@sa detail::FeaturesFinder, SURF +*/ +class CV_EXPORTS SurfFeaturesFinder : public FeaturesFinder +{ +public: + SurfFeaturesFinder(double hess_thresh = 300., int num_octaves = 3, int num_layers = 4, + int num_octaves_descr = /*4*/3, int num_layers_descr = /*2*/4); + +private: + void find(InputArray image, ImageFeatures &features); + + Ptr detector_; + Ptr extractor_; + Ptr surf; +}; + +/** @brief ORB features finder. : + +@sa detail::FeaturesFinder, ORB +*/ +class CV_EXPORTS OrbFeaturesFinder : public FeaturesFinder +{ +public: + OrbFeaturesFinder(Size _grid_size = Size(3,1), int nfeatures=1500, float scaleFactor=1.3f, int nlevels=5); + +private: + void find(InputArray image, ImageFeatures &features); + + Ptr orb; + Size grid_size; +}; + + +#ifdef HAVE_OPENCV_XFEATURES2D +class CV_EXPORTS SurfFeaturesFinderGpu : public FeaturesFinder +{ +public: + SurfFeaturesFinderGpu(double hess_thresh = 300., int num_octaves = 3, int num_layers = 4, + int num_octaves_descr = 4, int num_layers_descr = 2); + + void collectGarbage(); + +private: + void find(InputArray image, ImageFeatures &features); + + cuda::GpuMat image_; + cuda::GpuMat gray_image_; + cuda::SURF_CUDA surf_; + cuda::GpuMat keypoints_; + cuda::GpuMat descriptors_; + int num_octaves_, num_layers_; + int num_octaves_descr_, num_layers_descr_; +}; +#endif + +/** @brief Structure containing information about matches between two images. + +It's assumed that there is a homography between those images. +*/ +struct CV_EXPORTS MatchesInfo +{ + MatchesInfo(); + MatchesInfo(const MatchesInfo &other); + const MatchesInfo& operator =(const MatchesInfo &other); + + int src_img_idx, dst_img_idx; //!< Images indices (optional) + std::vector matches; + std::vector inliers_mask; //!< Geometrically consistent matches mask + int num_inliers; //!< Number of geometrically consistent matches + Mat H; //!< Estimated homography + double confidence; //!< Confidence two images are from the same panorama +}; + +/** @brief Feature matchers base class. */ +class CV_EXPORTS FeaturesMatcher +{ +public: + virtual ~FeaturesMatcher() {} + + /** @overload + @param features1 First image features + @param features2 Second image features + @param matches_info Found matches + */ + void operator ()(const ImageFeatures &features1, const ImageFeatures &features2, + MatchesInfo& matches_info) { match(features1, features2, matches_info); } + + /** @brief Performs images matching. + + @param features Features of the source images + @param pairwise_matches Found pairwise matches + @param mask Mask indicating which image pairs must be matched + + The function is parallelized with the TBB library. + + @sa detail::MatchesInfo + */ + void operator ()(const std::vector &features, std::vector &pairwise_matches, + const cv::UMat &mask = cv::UMat()); + + /** @return True, if it's possible to use the same matcher instance in parallel, false otherwise + */ + bool isThreadSafe() const { return is_thread_safe_; } + + /** @brief Frees unused memory allocated before if there is any. + */ + virtual void collectGarbage() {} + +protected: + FeaturesMatcher(bool is_thread_safe = false) : is_thread_safe_(is_thread_safe) {} + + /** @brief This method must implement matching logic in order to make the wrappers + detail::FeaturesMatcher::operator()_ work. + + @param features1 first image features + @param features2 second image features + @param matches_info found matches + */ + virtual void match(const ImageFeatures &features1, const ImageFeatures &features2, + MatchesInfo& matches_info) = 0; + + bool is_thread_safe_; +}; + +/** @brief Features matcher which finds two best matches for each feature and leaves the best one only if the +ratio between descriptor distances is greater than the threshold match_conf + +@sa detail::FeaturesMatcher + */ +class CV_EXPORTS BestOf2NearestMatcher : public FeaturesMatcher +{ +public: + /** @brief Constructs a "best of 2 nearest" matcher. + + @param try_use_gpu Should try to use GPU or not + @param match_conf Match distances ration threshold + @param num_matches_thresh1 Minimum number of matches required for the 2D projective transform + estimation used in the inliers classification step + @param num_matches_thresh2 Minimum number of matches required for the 2D projective transform + re-estimation on inliers + */ + BestOf2NearestMatcher(bool try_use_gpu = false, float match_conf = 0.3f, int num_matches_thresh1 = 6, + int num_matches_thresh2 = 6); + + void collectGarbage(); + +protected: + void match(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo &matches_info); + + int num_matches_thresh1_; + int num_matches_thresh2_; + Ptr impl_; +}; + +class CV_EXPORTS BestOf2NearestRangeMatcher : public BestOf2NearestMatcher +{ +public: + BestOf2NearestRangeMatcher(int range_width = 5, bool try_use_gpu = false, float match_conf = 0.3f, + int num_matches_thresh1 = 6, int num_matches_thresh2 = 6); + + void operator ()(const std::vector &features, std::vector &pairwise_matches, + const cv::UMat &mask = cv::UMat()); + + +protected: + int range_width_; +}; + +//! @} stitching_match + +} // namespace detail +} // namespace cv + +#endif // __OPENCV_STITCHING_MATCHERS_HPP__ diff --git a/lib/opencv/include/opencv2/stitching/detail/motion_estimators.hpp b/lib/opencv/include/opencv2/stitching/detail/motion_estimators.hpp new file mode 100644 index 000000000..2c86e6335 --- /dev/null +++ b/lib/opencv/include/opencv2/stitching/detail/motion_estimators.hpp @@ -0,0 +1,274 @@ +/*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_STITCHING_MOTION_ESTIMATORS_HPP__ +#define __OPENCV_STITCHING_MOTION_ESTIMATORS_HPP__ + +#include "opencv2/core.hpp" +#include "matchers.hpp" +#include "util.hpp" +#include "camera.hpp" + +namespace cv { +namespace detail { + +//! @addtogroup stitching_rotation +//! @{ + +/** @brief Rotation estimator base class. + +It takes features of all images, pairwise matches between all images and estimates rotations of all +cameras. + +@note The coordinate system origin is implementation-dependent, but you can always normalize the +rotations in respect to the first camera, for instance. : + */ +class CV_EXPORTS Estimator +{ +public: + virtual ~Estimator() {} + + /** @brief Estimates camera parameters. + + @param features Features of images + @param pairwise_matches Pairwise matches of images + @param cameras Estimated camera parameters + @return True in case of success, false otherwise + */ + bool operator ()(const std::vector &features, + const std::vector &pairwise_matches, + std::vector &cameras) + { return estimate(features, pairwise_matches, cameras); } + +protected: + /** @brief This method must implement camera parameters estimation logic in order to make the wrapper + detail::Estimator::operator()_ work. + + @param features Features of images + @param pairwise_matches Pairwise matches of images + @param cameras Estimated camera parameters + @return True in case of success, false otherwise + */ + virtual bool estimate(const std::vector &features, + const std::vector &pairwise_matches, + std::vector &cameras) = 0; +}; + +/** @brief Homography based rotation estimator. + */ +class CV_EXPORTS HomographyBasedEstimator : public Estimator +{ +public: + HomographyBasedEstimator(bool is_focals_estimated = false) + : is_focals_estimated_(is_focals_estimated) {} + +private: + virtual bool estimate(const std::vector &features, + const std::vector &pairwise_matches, + std::vector &cameras); + + bool is_focals_estimated_; +}; + +/** @brief Base class for all camera parameters refinement methods. + */ +class CV_EXPORTS BundleAdjusterBase : public Estimator +{ +public: + const Mat refinementMask() const { return refinement_mask_.clone(); } + void setRefinementMask(const Mat &mask) + { + CV_Assert(mask.type() == CV_8U && mask.size() == Size(3, 3)); + refinement_mask_ = mask.clone(); + } + + double confThresh() const { return conf_thresh_; } + void setConfThresh(double conf_thresh) { conf_thresh_ = conf_thresh; } + + TermCriteria termCriteria() { return term_criteria_; } + void setTermCriteria(const TermCriteria& term_criteria) { term_criteria_ = term_criteria; } + +protected: + /** @brief Construct a bundle adjuster base instance. + + @param num_params_per_cam Number of parameters per camera + @param num_errs_per_measurement Number of error terms (components) per match + */ + BundleAdjusterBase(int num_params_per_cam, int num_errs_per_measurement) + : num_params_per_cam_(num_params_per_cam), + num_errs_per_measurement_(num_errs_per_measurement) + { + setRefinementMask(Mat::ones(3, 3, CV_8U)); + setConfThresh(1.); + setTermCriteria(TermCriteria(TermCriteria::EPS + TermCriteria::COUNT, 1000, DBL_EPSILON)); + } + + // Runs bundle adjustment + virtual bool estimate(const std::vector &features, + const std::vector &pairwise_matches, + std::vector &cameras); + + /** @brief Sets initial camera parameter to refine. + + @param cameras Camera parameters + */ + virtual void setUpInitialCameraParams(const std::vector &cameras) = 0; + /** @brief Gets the refined camera parameters. + + @param cameras Refined camera parameters + */ + virtual void obtainRefinedCameraParams(std::vector &cameras) const = 0; + /** @brief Calculates error vector. + + @param err Error column-vector of length total_num_matches \* num_errs_per_measurement + */ + virtual void calcError(Mat &err) = 0; + /** @brief Calculates the cost function jacobian. + + @param jac Jacobian matrix of dimensions + (total_num_matches \* num_errs_per_measurement) x (num_images \* num_params_per_cam) + */ + virtual void calcJacobian(Mat &jac) = 0; + + // 3x3 8U mask, where 0 means don't refine respective parameter, != 0 means refine + Mat refinement_mask_; + + int num_images_; + int total_num_matches_; + + int num_params_per_cam_; + int num_errs_per_measurement_; + + const ImageFeatures *features_; + const MatchesInfo *pairwise_matches_; + + // Threshold to filter out poorly matched image pairs + double conf_thresh_; + + //Levenberg–Marquardt algorithm termination criteria + TermCriteria term_criteria_; + + // Camera parameters matrix (CV_64F) + Mat cam_params_; + + // Connected images pairs + std::vector > edges_; +}; + + +/** @brief Implementation of the camera parameters refinement algorithm which minimizes sum of the reprojection +error squares + +It can estimate focal length, aspect ratio, principal point. +You can affect only on them via the refinement mask. + */ +class CV_EXPORTS BundleAdjusterReproj : public BundleAdjusterBase +{ +public: + BundleAdjusterReproj() : BundleAdjusterBase(7, 2) {} + +private: + void setUpInitialCameraParams(const std::vector &cameras); + void obtainRefinedCameraParams(std::vector &cameras) const; + void calcError(Mat &err); + void calcJacobian(Mat &jac); + + Mat err1_, err2_; +}; + + +/** @brief Implementation of the camera parameters refinement algorithm which minimizes sum of the distances +between the rays passing through the camera center and a feature. : + +It can estimate focal length. It ignores the refinement mask for now. + */ +class CV_EXPORTS BundleAdjusterRay : public BundleAdjusterBase +{ +public: + BundleAdjusterRay() : BundleAdjusterBase(4, 3) {} + +private: + void setUpInitialCameraParams(const std::vector &cameras); + void obtainRefinedCameraParams(std::vector &cameras) const; + void calcError(Mat &err); + void calcJacobian(Mat &jac); + + Mat err1_, err2_; +}; + + +enum WaveCorrectKind +{ + WAVE_CORRECT_HORIZ, + WAVE_CORRECT_VERT +}; + +/** @brief Tries to make panorama more horizontal (or vertical). + +@param rmats Camera rotation matrices. +@param kind Correction kind, see detail::WaveCorrectKind. + */ +void CV_EXPORTS waveCorrect(std::vector &rmats, WaveCorrectKind kind); + + +////////////////////////////////////////////////////////////////////////////// +// Auxiliary functions + +// Returns matches graph representation in DOT language +String CV_EXPORTS matchesGraphAsString(std::vector &pathes, std::vector &pairwise_matches, + float conf_threshold); + +std::vector CV_EXPORTS leaveBiggestComponent( + std::vector &features, + std::vector &pairwise_matches, + float conf_threshold); + +void CV_EXPORTS findMaxSpanningTree( + int num_images, const std::vector &pairwise_matches, + Graph &span_tree, std::vector ¢ers); + +//! @} stitching_rotation + +} // namespace detail +} // namespace cv + +#endif // __OPENCV_STITCHING_MOTION_ESTIMATORS_HPP__ diff --git a/lib/opencv/include/opencv2/stitching/detail/seam_finders.hpp b/lib/opencv/include/opencv2/stitching/detail/seam_finders.hpp new file mode 100644 index 000000000..4ff22c40c --- /dev/null +++ b/lib/opencv/include/opencv2/stitching/detail/seam_finders.hpp @@ -0,0 +1,285 @@ +/*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_STITCHING_SEAM_FINDERS_HPP__ +#define __OPENCV_STITCHING_SEAM_FINDERS_HPP__ + +#include +#include "opencv2/core.hpp" +#include "opencv2/opencv_modules.hpp" + +namespace cv { +namespace detail { + +//! @addtogroup stitching_seam +//! @{ + +/** @brief Base class for a seam estimator. + */ +class CV_EXPORTS SeamFinder +{ +public: + virtual ~SeamFinder() {} + /** @brief Estimates seams. + + @param src Source images + @param corners Source image top-left corners + @param masks Source image masks to update + */ + virtual void find(const std::vector &src, const std::vector &corners, + std::vector &masks) = 0; +}; + +/** @brief Stub seam estimator which does nothing. + */ +class CV_EXPORTS NoSeamFinder : public SeamFinder +{ +public: + void find(const std::vector&, const std::vector&, std::vector&) {} +}; + +/** @brief Base class for all pairwise seam estimators. + */ +class CV_EXPORTS PairwiseSeamFinder : public SeamFinder +{ +public: + virtual void find(const std::vector &src, const std::vector &corners, + std::vector &masks); + +protected: + void run(); + /** @brief Resolves masks intersection of two specified images in the given ROI. + + @param first First image index + @param second Second image index + @param roi Region of interest + */ + virtual void findInPair(size_t first, size_t second, Rect roi) = 0; + + std::vector images_; + std::vector sizes_; + std::vector corners_; + std::vector masks_; +}; + +/** @brief Voronoi diagram-based seam estimator. + */ +class CV_EXPORTS VoronoiSeamFinder : public PairwiseSeamFinder +{ +public: + virtual void find(const std::vector &src, const std::vector &corners, + std::vector &masks); + virtual void find(const std::vector &size, const std::vector &corners, + std::vector &masks); +private: + void findInPair(size_t first, size_t second, Rect roi); +}; + + +class CV_EXPORTS DpSeamFinder : public SeamFinder +{ +public: + enum CostFunction { COLOR, COLOR_GRAD }; + + DpSeamFinder(CostFunction costFunc = COLOR); + + CostFunction costFunction() const { return costFunc_; } + void setCostFunction(CostFunction val) { costFunc_ = val; } + + virtual void find(const std::vector &src, const std::vector &corners, + std::vector &masks); + +private: + enum ComponentState + { + FIRST = 1, SECOND = 2, INTERS = 4, + INTERS_FIRST = INTERS | FIRST, + INTERS_SECOND = INTERS | SECOND + }; + + class ImagePairLess + { + public: + ImagePairLess(const std::vector &images, const std::vector &corners) + : src_(&images[0]), corners_(&corners[0]) {} + + bool operator() (const std::pair &l, const std::pair &r) const + { + Point c1 = corners_[l.first] + Point(src_[l.first].cols / 2, src_[l.first].rows / 2); + Point c2 = corners_[l.second] + Point(src_[l.second].cols / 2, src_[l.second].rows / 2); + int d1 = (c1 - c2).dot(c1 - c2); + + c1 = corners_[r.first] + Point(src_[r.first].cols / 2, src_[r.first].rows / 2); + c2 = corners_[r.second] + Point(src_[r.second].cols / 2, src_[r.second].rows / 2); + int d2 = (c1 - c2).dot(c1 - c2); + + return d1 < d2; + } + + private: + const Mat *src_; + const Point *corners_; + }; + + class ClosePoints + { + public: + ClosePoints(int minDist) : minDist_(minDist) {} + + bool operator() (const Point &p1, const Point &p2) const + { + int dist2 = (p1.x-p2.x) * (p1.x-p2.x) + (p1.y-p2.y) * (p1.y-p2.y); + return dist2 < minDist_ * minDist_; + } + + private: + int minDist_; + }; + + void process( + const Mat &image1, const Mat &image2, Point tl1, Point tl2, Mat &mask1, Mat &mask2); + + void findComponents(); + + void findEdges(); + + void resolveConflicts( + const Mat &image1, const Mat &image2, Point tl1, Point tl2, Mat &mask1, Mat &mask2); + + void computeGradients(const Mat &image1, const Mat &image2); + + bool hasOnlyOneNeighbor(int comp); + + bool closeToContour(int y, int x, const Mat_ &contourMask); + + bool getSeamTips(int comp1, int comp2, Point &p1, Point &p2); + + void computeCosts( + const Mat &image1, const Mat &image2, Point tl1, Point tl2, + int comp, Mat_ &costV, Mat_ &costH); + + bool estimateSeam( + const Mat &image1, const Mat &image2, Point tl1, Point tl2, int comp, + Point p1, Point p2, std::vector &seam, bool &isHorizontal); + + void updateLabelsUsingSeam( + int comp1, int comp2, const std::vector &seam, bool isHorizontalSeam); + + CostFunction costFunc_; + + // processing images pair data + Point unionTl_, unionBr_; + Size unionSize_; + Mat_ mask1_, mask2_; + Mat_ contour1mask_, contour2mask_; + Mat_ gradx1_, grady1_; + Mat_ gradx2_, grady2_; + + // components data + int ncomps_; + Mat_ labels_; + std::vector states_; + std::vector tls_, brs_; + std::vector > contours_; + std::set > edges_; +}; + +/** @brief Base class for all minimum graph-cut-based seam estimators. + */ +class CV_EXPORTS GraphCutSeamFinderBase +{ +public: + enum CostType { COST_COLOR, COST_COLOR_GRAD }; +}; + +/** @brief Minimum graph cut-based seam estimator. See details in @cite V03 . + */ +class CV_EXPORTS GraphCutSeamFinder : public GraphCutSeamFinderBase, public SeamFinder +{ +public: + GraphCutSeamFinder(int cost_type = COST_COLOR_GRAD, float terminal_cost = 10000.f, + float bad_region_penalty = 1000.f); + + ~GraphCutSeamFinder(); + + void find(const std::vector &src, const std::vector &corners, + std::vector &masks); + +private: + // To avoid GCGraph dependency + class Impl; + Ptr impl_; +}; + + +#ifdef HAVE_OPENCV_CUDALEGACY +class CV_EXPORTS GraphCutSeamFinderGpu : public GraphCutSeamFinderBase, public PairwiseSeamFinder +{ +public: + GraphCutSeamFinderGpu(int cost_type = COST_COLOR_GRAD, float terminal_cost = 10000.f, + float bad_region_penalty = 1000.f) + : cost_type_(cost_type), terminal_cost_(terminal_cost), + bad_region_penalty_(bad_region_penalty) {} + + void find(const std::vector &src, const std::vector &corners, + std::vector &masks); + void findInPair(size_t first, size_t second, Rect roi); + +private: + void setGraphWeightsColor(const cv::Mat &img1, const cv::Mat &img2, const cv::Mat &mask1, const cv::Mat &mask2, + cv::Mat &terminals, cv::Mat &leftT, cv::Mat &rightT, cv::Mat &top, cv::Mat &bottom); + void setGraphWeightsColorGrad(const cv::Mat &img1, const cv::Mat &img2, const cv::Mat &dx1, const cv::Mat &dx2, + const cv::Mat &dy1, const cv::Mat &dy2, const cv::Mat &mask1, const cv::Mat &mask2, + cv::Mat &terminals, cv::Mat &leftT, cv::Mat &rightT, cv::Mat &top, cv::Mat &bottom); + std::vector dx_, dy_; + int cost_type_; + float terminal_cost_; + float bad_region_penalty_; +}; +#endif + +//! @} + +} // namespace detail +} // namespace cv + +#endif // __OPENCV_STITCHING_SEAM_FINDERS_HPP__ diff --git a/lib/opencv/include/opencv2/stitching/detail/timelapsers.hpp b/lib/opencv/include/opencv2/stitching/detail/timelapsers.hpp new file mode 100644 index 000000000..d64c03c27 --- /dev/null +++ b/lib/opencv/include/opencv2/stitching/detail/timelapsers.hpp @@ -0,0 +1,91 @@ +/*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_STITCHING_TIMELAPSERS_HPP__ +#define __OPENCV_STITCHING_TIMELAPSERS_HPP__ + +#include "opencv2/core.hpp" + +namespace cv { +namespace detail { + +//! @addtogroup stitching +//! @{ + +// Base Timelapser class, takes a sequence of images, applies appropriate shift, stores result in dst_. + +class CV_EXPORTS Timelapser +{ +public: + + enum {AS_IS, CROP}; + + virtual ~Timelapser() {} + + static Ptr createDefault(int type); + + virtual void initialize(const std::vector &corners, const std::vector &sizes); + virtual void process(InputArray img, InputArray mask, Point tl); + virtual const UMat& getDst() {return dst_;} + +protected: + + virtual bool test_point(Point pt); + + UMat dst_; + Rect dst_roi_; +}; + + +class CV_EXPORTS TimelapserCrop : public Timelapser +{ +public: + virtual void initialize(const std::vector &corners, const std::vector &sizes); +}; + +//! @} + +} // namespace detail +} // namespace cv + +#endif // __OPENCV_STITCHING_TIMELAPSERS_HPP__ diff --git a/lib/opencv/include/opencv2/stitching/detail/util.hpp b/lib/opencv/include/opencv2/stitching/detail/util.hpp new file mode 100644 index 000000000..3845ba59e --- /dev/null +++ b/lib/opencv/include/opencv2/stitching/detail/util.hpp @@ -0,0 +1,171 @@ +/*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_STITCHING_UTIL_HPP__ +#define __OPENCV_STITCHING_UTIL_HPP__ + +#include +#include "opencv2/core.hpp" + +#ifndef ENABLE_LOG +#define ENABLE_LOG 0 +#endif + +// TODO remove LOG macros, add logging class +#if ENABLE_LOG +#ifdef ANDROID + #include + #include + #include + #define LOG_STITCHING_MSG(msg) \ + do { \ + Stringstream _os; \ + _os << msg; \ + __android_log_print(ANDROID_LOG_DEBUG, "STITCHING", "%s", _os.str().c_str()); \ + } while(0); +#else + #include + #define LOG_STITCHING_MSG(msg) for(;;) { std::cout << msg; std::cout.flush(); break; } +#endif +#else + #define LOG_STITCHING_MSG(msg) +#endif + +#define LOG_(_level, _msg) \ + for(;;) \ + { \ + using namespace std; \ + if ((_level) >= ::cv::detail::stitchingLogLevel()) \ + { \ + LOG_STITCHING_MSG(_msg); \ + } \ + break; \ + } + + +#define LOG(msg) LOG_(1, msg) +#define LOG_CHAT(msg) LOG_(0, msg) + +#define LOGLN(msg) LOG(msg << std::endl) +#define LOGLN_CHAT(msg) LOG_CHAT(msg << std::endl) + +//#if DEBUG_LOG_CHAT +// #define LOG_CHAT(msg) LOG(msg) +// #define LOGLN_CHAT(msg) LOGLN(msg) +//#else +// #define LOG_CHAT(msg) do{}while(0) +// #define LOGLN_CHAT(msg) do{}while(0) +//#endif + +namespace cv { +namespace detail { + +//! @addtogroup stitching +//! @{ + +class CV_EXPORTS DisjointSets +{ +public: + DisjointSets(int elem_count = 0) { createOneElemSets(elem_count); } + + void createOneElemSets(int elem_count); + int findSetByElem(int elem); + int mergeSets(int set1, int set2); + + std::vector parent; + std::vector size; + +private: + std::vector rank_; +}; + + +struct CV_EXPORTS GraphEdge +{ + GraphEdge(int from, int to, float weight); + bool operator <(const GraphEdge& other) const { return weight < other.weight; } + bool operator >(const GraphEdge& other) const { return weight > other.weight; } + + int from, to; + float weight; +}; + +inline GraphEdge::GraphEdge(int _from, int _to, float _weight) : from(_from), to(_to), weight(_weight) {} + + +class CV_EXPORTS Graph +{ +public: + Graph(int num_vertices = 0) { create(num_vertices); } + void create(int num_vertices) { edges_.assign(num_vertices, std::list()); } + int numVertices() const { return static_cast(edges_.size()); } + void addEdge(int from, int to, float weight); + template B forEach(B body) const; + template B walkBreadthFirst(int from, B body) const; + +private: + std::vector< std::list > edges_; +}; + + +////////////////////////////////////////////////////////////////////////////// +// Auxiliary functions + +CV_EXPORTS bool overlapRoi(Point tl1, Point tl2, Size sz1, Size sz2, Rect &roi); +CV_EXPORTS Rect resultRoi(const std::vector &corners, const std::vector &images); +CV_EXPORTS Rect resultRoi(const std::vector &corners, const std::vector &sizes); +CV_EXPORTS Rect resultRoiIntersection(const std::vector &corners, const std::vector &sizes); +CV_EXPORTS Point resultTl(const std::vector &corners); + +// Returns random 'count' element subset of the {0,1,...,size-1} set +CV_EXPORTS void selectRandomSubset(int count, int size, std::vector &subset); + +CV_EXPORTS int& stitchingLogLevel(); + +//! @} + +} // namespace detail +} // namespace cv + +#include "util_inl.hpp" + +#endif // __OPENCV_STITCHING_UTIL_HPP__ diff --git a/lib/opencv/include/opencv2/stitching/detail/util_inl.hpp b/lib/opencv/include/opencv2/stitching/detail/util_inl.hpp new file mode 100644 index 000000000..6ac6f8ecc --- /dev/null +++ b/lib/opencv/include/opencv2/stitching/detail/util_inl.hpp @@ -0,0 +1,131 @@ +/*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_STITCHING_UTIL_INL_HPP__ +#define __OPENCV_STITCHING_UTIL_INL_HPP__ + +#include +#include "opencv2/core.hpp" +#include "util.hpp" // Make your IDE see declarations + +//! @cond IGNORED + +namespace cv { +namespace detail { + +template +B Graph::forEach(B body) const +{ + for (int i = 0; i < numVertices(); ++i) + { + std::list::const_iterator edge = edges_[i].begin(); + for (; edge != edges_[i].end(); ++edge) + body(*edge); + } + return body; +} + + +template +B Graph::walkBreadthFirst(int from, B body) const +{ + std::vector was(numVertices(), false); + std::queue vertices; + + was[from] = true; + vertices.push(from); + + while (!vertices.empty()) + { + int vertex = vertices.front(); + vertices.pop(); + + std::list::const_iterator edge = edges_[vertex].begin(); + for (; edge != edges_[vertex].end(); ++edge) + { + if (!was[edge->to]) + { + body(*edge); + was[edge->to] = true; + vertices.push(edge->to); + } + } + } + + return body; +} + + +////////////////////////////////////////////////////////////////////////////// +// Some auxiliary math functions + +static inline +float normL2(const Point3f& a) +{ + return a.x * a.x + a.y * a.y + a.z * a.z; +} + + +static inline +float normL2(const Point3f& a, const Point3f& b) +{ + return normL2(a - b); +} + + +static inline +double normL2sq(const Mat &r) +{ + return r.dot(r); +} + + +static inline int sqr(int x) { return x * x; } +static inline float sqr(float x) { return x * x; } +static inline double sqr(double x) { return x * x; } + +} // namespace detail +} // namespace cv + +//! @endcond + +#endif // __OPENCV_STITCHING_UTIL_INL_HPP__ diff --git a/lib/opencv/include/opencv2/stitching/detail/warpers.hpp b/lib/opencv/include/opencv2/stitching/detail/warpers.hpp new file mode 100644 index 000000000..ee8e824cb --- /dev/null +++ b/lib/opencv/include/opencv2/stitching/detail/warpers.hpp @@ -0,0 +1,586 @@ + /*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_STITCHING_WARPERS_HPP__ +#define __OPENCV_STITCHING_WARPERS_HPP__ + +#include "opencv2/core.hpp" +#include "opencv2/core/cuda.hpp" +#include "opencv2/imgproc.hpp" +#include "opencv2/opencv_modules.hpp" + +namespace cv { +namespace detail { + +//! @addtogroup stitching_warp +//! @{ + +/** @brief Rotation-only model image warper interface. + */ +class CV_EXPORTS RotationWarper +{ +public: + virtual ~RotationWarper() {} + + /** @brief Projects the image point. + + @param pt Source point + @param K Camera intrinsic parameters + @param R Camera rotation matrix + @return Projected point + */ + virtual Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R) = 0; + + /** @brief Builds the projection maps according to the given camera data. + + @param src_size Source image size + @param K Camera intrinsic parameters + @param R Camera rotation matrix + @param xmap Projection map for the x axis + @param ymap Projection map for the y axis + @return Projected image minimum bounding box + */ + virtual Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) = 0; + + /** @brief Projects the image. + + @param src Source image + @param K Camera intrinsic parameters + @param R Camera rotation matrix + @param interp_mode Interpolation mode + @param border_mode Border extrapolation mode + @param dst Projected image + @return Project image top-left corner + */ + virtual Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, + OutputArray dst) = 0; + + /** @brief Projects the image backward. + + @param src Projected image + @param K Camera intrinsic parameters + @param R Camera rotation matrix + @param interp_mode Interpolation mode + @param border_mode Border extrapolation mode + @param dst_size Backward-projected image size + @param dst Backward-projected image + */ + virtual void warpBackward(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, + Size dst_size, OutputArray dst) = 0; + + /** + @param src_size Source image bounding box + @param K Camera intrinsic parameters + @param R Camera rotation matrix + @return Projected image minimum bounding box + */ + virtual Rect warpRoi(Size src_size, InputArray K, InputArray R) = 0; + + virtual float getScale() const { return 1.f; } + virtual void setScale(float) {} +}; + +/** @brief Base class for warping logic implementation. + */ +struct CV_EXPORTS ProjectorBase +{ + void setCameraParams(InputArray K = Mat::eye(3, 3, CV_32F), + InputArray R = Mat::eye(3, 3, CV_32F), + InputArray T = Mat::zeros(3, 1, CV_32F)); + + float scale; + float k[9]; + float rinv[9]; + float r_kinv[9]; + float k_rinv[9]; + float t[3]; +}; + +/** @brief Base class for rotation-based warper using a detail::ProjectorBase_ derived class. + */ +template +class CV_EXPORTS RotationWarperBase : public RotationWarper +{ +public: + Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R); + + Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap); + + Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, + OutputArray dst); + + void warpBackward(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, + Size dst_size, OutputArray dst); + + Rect warpRoi(Size src_size, InputArray K, InputArray R); + + float getScale() const { return projector_.scale; } + void setScale(float val) { projector_.scale = val; } + +protected: + + // Detects ROI of the destination image. It's correct for any projection. + virtual void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br); + + // Detects ROI of the destination image by walking over image border. + // Correctness for any projection isn't guaranteed. + void detectResultRoiByBorder(Size src_size, Point &dst_tl, Point &dst_br); + + P projector_; +}; + + +struct CV_EXPORTS PlaneProjector : ProjectorBase +{ + void mapForward(float x, float y, float &u, float &v); + void mapBackward(float u, float v, float &x, float &y); +}; + +/** @brief Warper that maps an image onto the z = 1 plane. + */ +class CV_EXPORTS PlaneWarper : public RotationWarperBase +{ +public: + /** @brief Construct an instance of the plane warper class. + + @param scale Projected image scale multiplier + */ + PlaneWarper(float scale = 1.f) { projector_.scale = scale; } + + Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R); + Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R, InputArray T); + + virtual Rect buildMaps(Size src_size, InputArray K, InputArray R, InputArray T, OutputArray xmap, OutputArray ymap); + Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap); + + Point warp(InputArray src, InputArray K, InputArray R, + int interp_mode, int border_mode, OutputArray dst); + virtual Point warp(InputArray src, InputArray K, InputArray R, InputArray T, int interp_mode, int border_mode, + OutputArray dst); + + Rect warpRoi(Size src_size, InputArray K, InputArray R); + Rect warpRoi(Size src_size, InputArray K, InputArray R, InputArray T); + +protected: + void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br); +}; + + +struct CV_EXPORTS SphericalProjector : ProjectorBase +{ + void mapForward(float x, float y, float &u, float &v); + void mapBackward(float u, float v, float &x, float &y); +}; + + +/** @brief Warper that maps an image onto the unit sphere located at the origin. + + Projects image onto unit sphere with origin at (0, 0, 0). + Poles are located at (0, -1, 0) and (0, 1, 0) points. +*/ +class CV_EXPORTS SphericalWarper : public RotationWarperBase +{ +public: + /** @brief Construct an instance of the spherical warper class. + + @param scale Projected image scale multiplier + */ + SphericalWarper(float scale) { projector_.scale = scale; } + + Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap); + Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, OutputArray dst); +protected: + void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br); +}; + + +struct CV_EXPORTS CylindricalProjector : ProjectorBase +{ + void mapForward(float x, float y, float &u, float &v); + void mapBackward(float u, float v, float &x, float &y); +}; + + +/** @brief Warper that maps an image onto the x\*x + z\*z = 1 cylinder. + */ +class CV_EXPORTS CylindricalWarper : public RotationWarperBase +{ +public: + /** @brief Construct an instance of the cylindrical warper class. + + @param scale Projected image scale multiplier + */ + CylindricalWarper(float scale) { projector_.scale = scale; } + + Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap); + Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, OutputArray dst); +protected: + void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) + { + RotationWarperBase::detectResultRoiByBorder(src_size, dst_tl, dst_br); + } +}; + + +struct CV_EXPORTS FisheyeProjector : ProjectorBase +{ + void mapForward(float x, float y, float &u, float &v); + void mapBackward(float u, float v, float &x, float &y); +}; + + +class CV_EXPORTS FisheyeWarper : public RotationWarperBase +{ +public: + FisheyeWarper(float scale) { projector_.scale = scale; } +}; + + +struct CV_EXPORTS StereographicProjector : ProjectorBase +{ + void mapForward(float x, float y, float &u, float &v); + void mapBackward(float u, float v, float &x, float &y); +}; + + +class CV_EXPORTS StereographicWarper : public RotationWarperBase +{ +public: + StereographicWarper(float scale) { projector_.scale = scale; } +}; + + +struct CV_EXPORTS CompressedRectilinearProjector : ProjectorBase +{ + float a, b; + + void mapForward(float x, float y, float &u, float &v); + void mapBackward(float u, float v, float &x, float &y); +}; + + +class CV_EXPORTS CompressedRectilinearWarper : public RotationWarperBase +{ +public: + CompressedRectilinearWarper(float scale, float A = 1, float B = 1) + { + projector_.a = A; + projector_.b = B; + projector_.scale = scale; + } +}; + + +struct CV_EXPORTS CompressedRectilinearPortraitProjector : ProjectorBase +{ + float a, b; + + void mapForward(float x, float y, float &u, float &v); + void mapBackward(float u, float v, float &x, float &y); +}; + + +class CV_EXPORTS CompressedRectilinearPortraitWarper : public RotationWarperBase +{ +public: + CompressedRectilinearPortraitWarper(float scale, float A = 1, float B = 1) + { + projector_.a = A; + projector_.b = B; + projector_.scale = scale; + } +}; + + +struct CV_EXPORTS PaniniProjector : ProjectorBase +{ + float a, b; + + void mapForward(float x, float y, float &u, float &v); + void mapBackward(float u, float v, float &x, float &y); +}; + + +class CV_EXPORTS PaniniWarper : public RotationWarperBase +{ +public: + PaniniWarper(float scale, float A = 1, float B = 1) + { + projector_.a = A; + projector_.b = B; + projector_.scale = scale; + } +}; + + +struct CV_EXPORTS PaniniPortraitProjector : ProjectorBase +{ + float a, b; + + void mapForward(float x, float y, float &u, float &v); + void mapBackward(float u, float v, float &x, float &y); +}; + + +class CV_EXPORTS PaniniPortraitWarper : public RotationWarperBase +{ +public: + PaniniPortraitWarper(float scale, float A = 1, float B = 1) + { + projector_.a = A; + projector_.b = B; + projector_.scale = scale; + } + +}; + + +struct CV_EXPORTS MercatorProjector : ProjectorBase +{ + void mapForward(float x, float y, float &u, float &v); + void mapBackward(float u, float v, float &x, float &y); +}; + + +class CV_EXPORTS MercatorWarper : public RotationWarperBase +{ +public: + MercatorWarper(float scale) { projector_.scale = scale; } +}; + + +struct CV_EXPORTS TransverseMercatorProjector : ProjectorBase +{ + void mapForward(float x, float y, float &u, float &v); + void mapBackward(float u, float v, float &x, float &y); +}; + + +class CV_EXPORTS TransverseMercatorWarper : public RotationWarperBase +{ +public: + TransverseMercatorWarper(float scale) { projector_.scale = scale; } +}; + + +class CV_EXPORTS PlaneWarperGpu : public PlaneWarper +{ +public: + PlaneWarperGpu(float scale = 1.f) : PlaneWarper(scale) {} + + Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) + { + Rect result = buildMaps(src_size, K, R, d_xmap_, d_ymap_); + d_xmap_.download(xmap); + d_ymap_.download(ymap); + return result; + } + + Rect buildMaps(Size src_size, InputArray K, InputArray R, InputArray T, OutputArray xmap, OutputArray ymap) + { + Rect result = buildMaps(src_size, K, R, T, d_xmap_, d_ymap_); + d_xmap_.download(xmap); + d_ymap_.download(ymap); + return result; + } + + Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, + OutputArray dst) + { + d_src_.upload(src); + Point result = warp(d_src_, K, R, interp_mode, border_mode, d_dst_); + d_dst_.download(dst); + return result; + } + + Point warp(InputArray src, InputArray K, InputArray R, InputArray T, int interp_mode, int border_mode, + OutputArray dst) + { + d_src_.upload(src); + Point result = warp(d_src_, K, R, T, interp_mode, border_mode, d_dst_); + d_dst_.download(dst); + return result; + } + + Rect buildMaps(Size src_size, InputArray K, InputArray R, cuda::GpuMat & xmap, cuda::GpuMat & ymap); + + Rect buildMaps(Size src_size, InputArray K, InputArray R, InputArray T, cuda::GpuMat & xmap, cuda::GpuMat & ymap); + + Point warp(const cuda::GpuMat & src, InputArray K, InputArray R, int interp_mode, int border_mode, + cuda::GpuMat & dst); + + Point warp(const cuda::GpuMat & src, InputArray K, InputArray R, InputArray T, int interp_mode, int border_mode, + cuda::GpuMat & dst); + +private: + cuda::GpuMat d_xmap_, d_ymap_, d_src_, d_dst_; +}; + + +class CV_EXPORTS SphericalWarperGpu : public SphericalWarper +{ +public: + SphericalWarperGpu(float scale) : SphericalWarper(scale) {} + + Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) + { + Rect result = buildMaps(src_size, K, R, d_xmap_, d_ymap_); + d_xmap_.download(xmap); + d_ymap_.download(ymap); + return result; + } + + Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, + OutputArray dst) + { + d_src_.upload(src); + Point result = warp(d_src_, K, R, interp_mode, border_mode, d_dst_); + d_dst_.download(dst); + return result; + } + + Rect buildMaps(Size src_size, InputArray K, InputArray R, cuda::GpuMat & xmap, cuda::GpuMat & ymap); + + Point warp(const cuda::GpuMat & src, InputArray K, InputArray R, int interp_mode, int border_mode, + cuda::GpuMat & dst); + +private: + cuda::GpuMat d_xmap_, d_ymap_, d_src_, d_dst_; +}; + + +class CV_EXPORTS CylindricalWarperGpu : public CylindricalWarper +{ +public: + CylindricalWarperGpu(float scale) : CylindricalWarper(scale) {} + + Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) + { + Rect result = buildMaps(src_size, K, R, d_xmap_, d_ymap_); + d_xmap_.download(xmap); + d_ymap_.download(ymap); + return result; + } + + Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, + OutputArray dst) + { + d_src_.upload(src); + Point result = warp(d_src_, K, R, interp_mode, border_mode, d_dst_); + d_dst_.download(dst); + return result; + } + + Rect buildMaps(Size src_size, InputArray K, InputArray R, cuda::GpuMat & xmap, cuda::GpuMat & ymap); + + Point warp(const cuda::GpuMat & src, InputArray K, InputArray R, int interp_mode, int border_mode, + cuda::GpuMat & dst); + +private: + cuda::GpuMat d_xmap_, d_ymap_, d_src_, d_dst_; +}; + + +struct SphericalPortraitProjector : ProjectorBase +{ + void mapForward(float x, float y, float &u, float &v); + void mapBackward(float u, float v, float &x, float &y); +}; + + +// Projects image onto unit sphere with origin at (0, 0, 0). +// Poles are located NOT at (0, -1, 0) and (0, 1, 0) points, BUT at (1, 0, 0) and (-1, 0, 0) points. +class CV_EXPORTS SphericalPortraitWarper : public RotationWarperBase +{ +public: + SphericalPortraitWarper(float scale) { projector_.scale = scale; } + +protected: + void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br); +}; + +struct CylindricalPortraitProjector : ProjectorBase +{ + void mapForward(float x, float y, float &u, float &v); + void mapBackward(float u, float v, float &x, float &y); +}; + + +class CV_EXPORTS CylindricalPortraitWarper : public RotationWarperBase +{ +public: + CylindricalPortraitWarper(float scale) { projector_.scale = scale; } + +protected: + void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) + { + RotationWarperBase::detectResultRoiByBorder(src_size, dst_tl, dst_br); + } +}; + +struct PlanePortraitProjector : ProjectorBase +{ + void mapForward(float x, float y, float &u, float &v); + void mapBackward(float u, float v, float &x, float &y); +}; + + +class CV_EXPORTS PlanePortraitWarper : public RotationWarperBase +{ +public: + PlanePortraitWarper(float scale) { projector_.scale = scale; } + +protected: + void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) + { + RotationWarperBase::detectResultRoiByBorder(src_size, dst_tl, dst_br); + } +}; + +//! @} stitching_warp + +} // namespace detail +} // namespace cv + +#include "warpers_inl.hpp" + +#endif // __OPENCV_STITCHING_WARPERS_HPP__ diff --git a/lib/opencv/include/opencv2/stitching/detail/warpers_inl.hpp b/lib/opencv/include/opencv2/stitching/detail/warpers_inl.hpp new file mode 100644 index 000000000..0416ecb5e --- /dev/null +++ b/lib/opencv/include/opencv2/stitching/detail/warpers_inl.hpp @@ -0,0 +1,774 @@ +/*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_STITCHING_WARPERS_INL_HPP__ +#define __OPENCV_STITCHING_WARPERS_INL_HPP__ + +#include "opencv2/core.hpp" +#include "warpers.hpp" // Make your IDE see declarations +#include + +//! @cond IGNORED + +namespace cv { +namespace detail { + +template +Point2f RotationWarperBase

::warpPoint(const Point2f &pt, InputArray K, InputArray R) +{ + projector_.setCameraParams(K, R); + Point2f uv; + projector_.mapForward(pt.x, pt.y, uv.x, uv.y); + return uv; +} + + +template +Rect RotationWarperBase

::buildMaps(Size src_size, InputArray K, InputArray R, OutputArray _xmap, OutputArray _ymap) +{ + projector_.setCameraParams(K, R); + + Point dst_tl, dst_br; + detectResultRoi(src_size, dst_tl, dst_br); + + _xmap.create(dst_br.y - dst_tl.y + 1, dst_br.x - dst_tl.x + 1, CV_32F); + _ymap.create(dst_br.y - dst_tl.y + 1, dst_br.x - dst_tl.x + 1, CV_32F); + + Mat xmap = _xmap.getMat(), ymap = _ymap.getMat(); + + float x, y; + for (int v = dst_tl.y; v <= dst_br.y; ++v) + { + for (int u = dst_tl.x; u <= dst_br.x; ++u) + { + projector_.mapBackward(static_cast(u), static_cast(v), x, y); + xmap.at(v - dst_tl.y, u - dst_tl.x) = x; + ymap.at(v - dst_tl.y, u - dst_tl.x) = y; + } + } + + return Rect(dst_tl, dst_br); +} + + +template +Point RotationWarperBase

::warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, + OutputArray dst) +{ + UMat xmap, ymap; + Rect dst_roi = buildMaps(src.size(), K, R, xmap, ymap); + + dst.create(dst_roi.height + 1, dst_roi.width + 1, src.type()); + remap(src, dst, xmap, ymap, interp_mode, border_mode); + + return dst_roi.tl(); +} + + +template +void RotationWarperBase

::warpBackward(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, + Size dst_size, OutputArray dst) +{ + projector_.setCameraParams(K, R); + + Point src_tl, src_br; + detectResultRoi(dst_size, src_tl, src_br); + + Size size = src.size(); + CV_Assert(src_br.x - src_tl.x + 1 == size.width && src_br.y - src_tl.y + 1 == size.height); + + Mat xmap(dst_size, CV_32F); + Mat ymap(dst_size, CV_32F); + + float u, v; + for (int y = 0; y < dst_size.height; ++y) + { + for (int x = 0; x < dst_size.width; ++x) + { + projector_.mapForward(static_cast(x), static_cast(y), u, v); + xmap.at(y, x) = u - src_tl.x; + ymap.at(y, x) = v - src_tl.y; + } + } + + dst.create(dst_size, src.type()); + remap(src, dst, xmap, ymap, interp_mode, border_mode); +} + + +template +Rect RotationWarperBase

::warpRoi(Size src_size, InputArray K, InputArray R) +{ + projector_.setCameraParams(K, R); + + Point dst_tl, dst_br; + detectResultRoi(src_size, dst_tl, dst_br); + + return Rect(dst_tl, Point(dst_br.x + 1, dst_br.y + 1)); +} + + +template +void RotationWarperBase

::detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) +{ + float tl_uf = std::numeric_limits::max(); + float tl_vf = std::numeric_limits::max(); + float br_uf = -std::numeric_limits::max(); + float br_vf = -std::numeric_limits::max(); + + float u, v; + for (int y = 0; y < src_size.height; ++y) + { + for (int x = 0; x < src_size.width; ++x) + { + projector_.mapForward(static_cast(x), static_cast(y), u, v); + tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v); + br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v); + } + } + + dst_tl.x = static_cast(tl_uf); + dst_tl.y = static_cast(tl_vf); + dst_br.x = static_cast(br_uf); + dst_br.y = static_cast(br_vf); +} + + +template +void RotationWarperBase

::detectResultRoiByBorder(Size src_size, Point &dst_tl, Point &dst_br) +{ + float tl_uf = std::numeric_limits::max(); + float tl_vf = std::numeric_limits::max(); + float br_uf = -std::numeric_limits::max(); + float br_vf = -std::numeric_limits::max(); + + float u, v; + for (float x = 0; x < src_size.width; ++x) + { + projector_.mapForward(static_cast(x), 0, u, v); + tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v); + br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v); + + projector_.mapForward(static_cast(x), static_cast(src_size.height - 1), u, v); + tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v); + br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v); + } + for (int y = 0; y < src_size.height; ++y) + { + projector_.mapForward(0, static_cast(y), u, v); + tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v); + br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v); + + projector_.mapForward(static_cast(src_size.width - 1), static_cast(y), u, v); + tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v); + br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v); + } + + dst_tl.x = static_cast(tl_uf); + dst_tl.y = static_cast(tl_vf); + dst_br.x = static_cast(br_uf); + dst_br.y = static_cast(br_vf); +} + + +inline +void PlaneProjector::mapForward(float x, float y, float &u, float &v) +{ + float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; + float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; + float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; + + x_ = t[0] + x_ / z_ * (1 - t[2]); + y_ = t[1] + y_ / z_ * (1 - t[2]); + + u = scale * x_; + v = scale * y_; +} + + +inline +void PlaneProjector::mapBackward(float u, float v, float &x, float &y) +{ + u = u / scale - t[0]; + v = v / scale - t[1]; + + float z; + x = k_rinv[0] * u + k_rinv[1] * v + k_rinv[2] * (1 - t[2]); + y = k_rinv[3] * u + k_rinv[4] * v + k_rinv[5] * (1 - t[2]); + z = k_rinv[6] * u + k_rinv[7] * v + k_rinv[8] * (1 - t[2]); + + x /= z; + y /= z; +} + + +inline +void SphericalProjector::mapForward(float x, float y, float &u, float &v) +{ + float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; + float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; + float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; + + u = scale * atan2f(x_, z_); + float w = y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_); + v = scale * (static_cast(CV_PI) - acosf(w == w ? w : 0)); +} + + +inline +void SphericalProjector::mapBackward(float u, float v, float &x, float &y) +{ + u /= scale; + v /= scale; + + float sinv = sinf(static_cast(CV_PI) - v); + float x_ = sinv * sinf(u); + float y_ = cosf(static_cast(CV_PI) - v); + float z_ = sinv * cosf(u); + + float z; + x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; + y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; + z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; + + if (z > 0) { x /= z; y /= z; } + else x = y = -1; +} + + +inline +void CylindricalProjector::mapForward(float x, float y, float &u, float &v) +{ + float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; + float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; + float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; + + u = scale * atan2f(x_, z_); + v = scale * y_ / sqrtf(x_ * x_ + z_ * z_); +} + + +inline +void CylindricalProjector::mapBackward(float u, float v, float &x, float &y) +{ + u /= scale; + v /= scale; + + float x_ = sinf(u); + float y_ = v; + float z_ = cosf(u); + + float z; + x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; + y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; + z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; + + if (z > 0) { x /= z; y /= z; } + else x = y = -1; +} + +inline +void FisheyeProjector::mapForward(float x, float y, float &u, float &v) +{ + float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; + float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; + float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; + + float u_ = atan2f(x_, z_); + float v_ = (float)CV_PI - acosf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_)); + + u = scale * v_ * cosf(u_); + v = scale * v_ * sinf(u_); +} + +inline +void FisheyeProjector::mapBackward(float u, float v, float &x, float &y) +{ + u /= scale; + v /= scale; + + float u_ = atan2f(v, u); + float v_ = sqrtf(u*u + v*v); + + float sinv = sinf((float)CV_PI - v_); + float x_ = sinv * sinf(u_); + float y_ = cosf((float)CV_PI - v_); + float z_ = sinv * cosf(u_); + + float z; + x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; + y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; + z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; + + if (z > 0) { x /= z; y /= z; } + else x = y = -1; +} + +inline +void StereographicProjector::mapForward(float x, float y, float &u, float &v) +{ + float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; + float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; + float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; + + float u_ = atan2f(x_, z_); + float v_ = (float)CV_PI - acosf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_)); + + float r = sinf(v_) / (1 - cosf(v_)); + + u = scale * r * cos(u_); + v = scale * r * sin(u_); +} + +inline +void StereographicProjector::mapBackward(float u, float v, float &x, float &y) +{ + u /= scale; + v /= scale; + + float u_ = atan2f(v, u); + float r = sqrtf(u*u + v*v); + float v_ = 2 * atanf(1.f / r); + + float sinv = sinf((float)CV_PI - v_); + float x_ = sinv * sinf(u_); + float y_ = cosf((float)CV_PI - v_); + float z_ = sinv * cosf(u_); + + float z; + x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; + y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; + z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; + + if (z > 0) { x /= z; y /= z; } + else x = y = -1; +} + +inline +void CompressedRectilinearProjector::mapForward(float x, float y, float &u, float &v) +{ + float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; + float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; + float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; + + float u_ = atan2f(x_, z_); + float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_)); + + u = scale * a * tanf(u_ / a); + v = scale * b * tanf(v_) / cosf(u_); +} + +inline +void CompressedRectilinearProjector::mapBackward(float u, float v, float &x, float &y) +{ + u /= scale; + v /= scale; + + float aatg = a * atanf(u / a); + float u_ = aatg; + float v_ = atanf(v * cosf(aatg) / b); + + float cosv = cosf(v_); + float x_ = cosv * sinf(u_); + float y_ = sinf(v_); + float z_ = cosv * cosf(u_); + + float z; + x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; + y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; + z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; + + if (z > 0) { x /= z; y /= z; } + else x = y = -1; +} + +inline +void CompressedRectilinearPortraitProjector::mapForward(float x, float y, float &u, float &v) +{ + float y_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; + float x_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; + float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; + + float u_ = atan2f(x_, z_); + float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_)); + + u = - scale * a * tanf(u_ / a); + v = scale * b * tanf(v_) / cosf(u_); +} + +inline +void CompressedRectilinearPortraitProjector::mapBackward(float u, float v, float &x, float &y) +{ + u /= - scale; + v /= scale; + + float aatg = a * atanf(u / a); + float u_ = aatg; + float v_ = atanf(v * cosf( aatg ) / b); + + float cosv = cosf(v_); + float y_ = cosv * sinf(u_); + float x_ = sinf(v_); + float z_ = cosv * cosf(u_); + + float z; + x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; + y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; + z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; + + if (z > 0) { x /= z; y /= z; } + else x = y = -1; +} + +inline +void PaniniProjector::mapForward(float x, float y, float &u, float &v) +{ + float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; + float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; + float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; + + float u_ = atan2f(x_, z_); + float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_)); + + float tg = a * tanf(u_ / a); + u = scale * tg; + + float sinu = sinf(u_); + if ( fabs(sinu) < 1E-7 ) + v = scale * b * tanf(v_); + else + v = scale * b * tg * tanf(v_) / sinu; +} + +inline +void PaniniProjector::mapBackward(float u, float v, float &x, float &y) +{ + u /= scale; + v /= scale; + + float lamda = a * atanf(u / a); + float u_ = lamda; + + float v_; + if ( fabs(lamda) > 1E-7) + v_ = atanf(v * sinf(lamda) / (b * a * tanf(lamda / a))); + else + v_ = atanf(v / b); + + float cosv = cosf(v_); + float x_ = cosv * sinf(u_); + float y_ = sinf(v_); + float z_ = cosv * cosf(u_); + + float z; + x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; + y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; + z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; + + if (z > 0) { x /= z; y /= z; } + else x = y = -1; +} + +inline +void PaniniPortraitProjector::mapForward(float x, float y, float &u, float &v) +{ + float y_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; + float x_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; + float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; + + float u_ = atan2f(x_, z_); + float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_)); + + float tg = a * tanf(u_ / a); + u = - scale * tg; + + float sinu = sinf( u_ ); + if ( fabs(sinu) < 1E-7 ) + v = scale * b * tanf(v_); + else + v = scale * b * tg * tanf(v_) / sinu; +} + +inline +void PaniniPortraitProjector::mapBackward(float u, float v, float &x, float &y) +{ + u /= - scale; + v /= scale; + + float lamda = a * atanf(u / a); + float u_ = lamda; + + float v_; + if ( fabs(lamda) > 1E-7) + v_ = atanf(v * sinf(lamda) / (b * a * tanf(lamda/a))); + else + v_ = atanf(v / b); + + float cosv = cosf(v_); + float y_ = cosv * sinf(u_); + float x_ = sinf(v_); + float z_ = cosv * cosf(u_); + + float z; + x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; + y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; + z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; + + if (z > 0) { x /= z; y /= z; } + else x = y = -1; +} + +inline +void MercatorProjector::mapForward(float x, float y, float &u, float &v) +{ + float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; + float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; + float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; + + float u_ = atan2f(x_, z_); + float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_)); + + u = scale * u_; + v = scale * logf( tanf( (float)(CV_PI/4) + v_/2 ) ); +} + +inline +void MercatorProjector::mapBackward(float u, float v, float &x, float &y) +{ + u /= scale; + v /= scale; + + float v_ = atanf( sinhf(v) ); + float u_ = u; + + float cosv = cosf(v_); + float x_ = cosv * sinf(u_); + float y_ = sinf(v_); + float z_ = cosv * cosf(u_); + + float z; + x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; + y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; + z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; + + if (z > 0) { x /= z; y /= z; } + else x = y = -1; +} + +inline +void TransverseMercatorProjector::mapForward(float x, float y, float &u, float &v) +{ + float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; + float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; + float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; + + float u_ = atan2f(x_, z_); + float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_)); + + float B = cosf(v_) * sinf(u_); + + u = scale / 2 * logf( (1+B) / (1-B) ); + v = scale * atan2f(tanf(v_), cosf(u_)); +} + +inline +void TransverseMercatorProjector::mapBackward(float u, float v, float &x, float &y) +{ + u /= scale; + v /= scale; + + float v_ = asinf( sinf(v) / coshf(u) ); + float u_ = atan2f( sinhf(u), cos(v) ); + + float cosv = cosf(v_); + float x_ = cosv * sinf(u_); + float y_ = sinf(v_); + float z_ = cosv * cosf(u_); + + float z; + x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; + y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; + z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; + + if (z > 0) { x /= z; y /= z; } + else x = y = -1; +} + +inline +void SphericalPortraitProjector::mapForward(float x, float y, float &u0, float &v0) +{ + float x0_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; + float y0_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; + float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; + + float x_ = y0_; + float y_ = x0_; + float u, v; + + u = scale * atan2f(x_, z_); + v = scale * (static_cast(CV_PI) - acosf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_))); + + u0 = -u;//v; + v0 = v;//u; +} + + +inline +void SphericalPortraitProjector::mapBackward(float u0, float v0, float &x, float &y) +{ + float u, v; + u = -u0;//v0; + v = v0;//u0; + + u /= scale; + v /= scale; + + float sinv = sinf(static_cast(CV_PI) - v); + float x0_ = sinv * sinf(u); + float y0_ = cosf(static_cast(CV_PI) - v); + float z_ = sinv * cosf(u); + + float x_ = y0_; + float y_ = x0_; + + float z; + x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; + y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; + z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; + + if (z > 0) { x /= z; y /= z; } + else x = y = -1; +} + +inline +void CylindricalPortraitProjector::mapForward(float x, float y, float &u0, float &v0) +{ + float x0_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; + float y0_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; + float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; + + float x_ = y0_; + float y_ = x0_; + float u, v; + + u = scale * atan2f(x_, z_); + v = scale * y_ / sqrtf(x_ * x_ + z_ * z_); + + u0 = -u;//v; + v0 = v;//u; +} + + +inline +void CylindricalPortraitProjector::mapBackward(float u0, float v0, float &x, float &y) +{ + float u, v; + u = -u0;//v0; + v = v0;//u0; + + u /= scale; + v /= scale; + + float x0_ = sinf(u); + float y0_ = v; + float z_ = cosf(u); + + float x_ = y0_; + float y_ = x0_; + + float z; + x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; + y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; + z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; + + if (z > 0) { x /= z; y /= z; } + else x = y = -1; +} + +inline +void PlanePortraitProjector::mapForward(float x, float y, float &u0, float &v0) +{ + float x0_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; + float y0_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; + float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; + + float x_ = y0_; + float y_ = x0_; + + x_ = t[0] + x_ / z_ * (1 - t[2]); + y_ = t[1] + y_ / z_ * (1 - t[2]); + + float u,v; + u = scale * x_; + v = scale * y_; + + u0 = -u; + v0 = v; +} + + +inline +void PlanePortraitProjector::mapBackward(float u0, float v0, float &x, float &y) +{ + float u, v; + u = -u0; + v = v0; + + u = u / scale - t[0]; + v = v / scale - t[1]; + + float z; + x = k_rinv[0] * v + k_rinv[1] * u + k_rinv[2] * (1 - t[2]); + y = k_rinv[3] * v + k_rinv[4] * u + k_rinv[5] * (1 - t[2]); + z = k_rinv[6] * v + k_rinv[7] * u + k_rinv[8] * (1 - t[2]); + + x /= z; + y /= z; +} + + +} // namespace detail +} // namespace cv + +//! @endcond + +#endif // __OPENCV_STITCHING_WARPERS_INL_HPP__ diff --git a/lib/opencv/include/opencv2/stitching/warpers.hpp b/lib/opencv/include/opencv2/stitching/warpers.hpp new file mode 100644 index 000000000..7e570d30c --- /dev/null +++ b/lib/opencv/include/opencv2/stitching/warpers.hpp @@ -0,0 +1,183 @@ +/*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_STITCHING_WARPER_CREATORS_HPP__ +#define __OPENCV_STITCHING_WARPER_CREATORS_HPP__ + +#include "opencv2/stitching/detail/warpers.hpp" + +namespace cv { + +//! @addtogroup stitching_warp +//! @{ + +/** @brief Image warper factories base class. + */ +class WarperCreator +{ +public: + virtual ~WarperCreator() {} + virtual Ptr create(float scale) const = 0; +}; + +/** @brief Plane warper factory class. + @sa detail::PlaneWarper + */ +class PlaneWarper : public WarperCreator +{ +public: + Ptr create(float scale) const { return makePtr(scale); } +}; + +/** @brief Cylindrical warper factory class. +@sa detail::CylindricalWarper +*/ +class CylindricalWarper: public WarperCreator +{ +public: + Ptr create(float scale) const { return makePtr(scale); } +}; + +/** @brief Spherical warper factory class */ +class SphericalWarper: public WarperCreator +{ +public: + Ptr create(float scale) const { return makePtr(scale); } +}; + +class FisheyeWarper : public WarperCreator +{ +public: + Ptr create(float scale) const { return makePtr(scale); } +}; + +class StereographicWarper: public WarperCreator +{ +public: + Ptr create(float scale) const { return makePtr(scale); } +}; + +class CompressedRectilinearWarper: public WarperCreator +{ + float a, b; +public: + CompressedRectilinearWarper(float A = 1, float B = 1) + { + a = A; b = B; + } + Ptr create(float scale) const { return makePtr(scale, a, b); } +}; + +class CompressedRectilinearPortraitWarper: public WarperCreator +{ + float a, b; +public: + CompressedRectilinearPortraitWarper(float A = 1, float B = 1) + { + a = A; b = B; + } + Ptr create(float scale) const { return makePtr(scale, a, b); } +}; + +class PaniniWarper: public WarperCreator +{ + float a, b; +public: + PaniniWarper(float A = 1, float B = 1) + { + a = A; b = B; + } + Ptr create(float scale) const { return makePtr(scale, a, b); } +}; + +class PaniniPortraitWarper: public WarperCreator +{ + float a, b; +public: + PaniniPortraitWarper(float A = 1, float B = 1) + { + a = A; b = B; + } + Ptr create(float scale) const { return makePtr(scale, a, b); } +}; + +class MercatorWarper: public WarperCreator +{ +public: + Ptr create(float scale) const { return makePtr(scale); } +}; + +class TransverseMercatorWarper: public WarperCreator +{ +public: + Ptr create(float scale) const { return makePtr(scale); } +}; + + + +#ifdef HAVE_OPENCV_CUDAWARPING +class PlaneWarperGpu: public WarperCreator +{ +public: + Ptr create(float scale) const { return makePtr(scale); } +}; + + +class CylindricalWarperGpu: public WarperCreator +{ +public: + Ptr create(float scale) const { return makePtr(scale); } +}; + + +class SphericalWarperGpu: public WarperCreator +{ +public: + Ptr create(float scale) const { return makePtr(scale); } +}; +#endif + +//! @} stitching_warp + +} // namespace cv + +#endif // __OPENCV_STITCHING_WARPER_CREATORS_HPP__ diff --git a/lib/opencv/include/opencv2/superres.hpp b/lib/opencv/include/opencv2/superres.hpp new file mode 100644 index 000000000..dec8e4eda --- /dev/null +++ b/lib/opencv/include/opencv2/superres.hpp @@ -0,0 +1,207 @@ +/*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_SUPERRES_HPP__ +#define __OPENCV_SUPERRES_HPP__ + +#include "opencv2/core.hpp" +#include "opencv2/superres/optical_flow.hpp" + +/** + @defgroup superres Super Resolution + +The Super Resolution module contains a set of functions and classes that can be used to solve the +problem of resolution enhancement. There are a few methods implemented, most of them are descibed in +the papers @cite Farsiu03 and @cite Mitzel09 . + + */ + +namespace cv +{ + namespace superres + { + +//! @addtogroup superres +//! @{ + + class CV_EXPORTS FrameSource + { + public: + virtual ~FrameSource(); + + virtual void nextFrame(OutputArray frame) = 0; + virtual void reset() = 0; + }; + + CV_EXPORTS Ptr createFrameSource_Empty(); + + CV_EXPORTS Ptr createFrameSource_Video(const String& fileName); + CV_EXPORTS Ptr createFrameSource_Video_CUDA(const String& fileName); + + CV_EXPORTS Ptr createFrameSource_Camera(int deviceId = 0); + + /** @brief Base class for Super Resolution algorithms. + + The class is only used to define the common interface for the whole family of Super Resolution + algorithms. + */ + class CV_EXPORTS SuperResolution : public cv::Algorithm, public FrameSource + { + public: + /** @brief Set input frame source for Super Resolution algorithm. + + @param frameSource Input frame source + */ + void setInput(const Ptr& frameSource); + + /** @brief Process next frame from input and return output result. + + @param frame Output result + */ + void nextFrame(OutputArray frame); + void reset(); + + /** @brief Clear all inner buffers. + */ + virtual void collectGarbage(); + + //! @brief Scale factor + /** @see setScale */ + virtual int getScale() const = 0; + /** @copybrief getScale @see getScale */ + virtual void setScale(int val) = 0; + + //! @brief Iterations count + /** @see setIterations */ + virtual int getIterations() const = 0; + /** @copybrief getIterations @see getIterations */ + virtual void setIterations(int val) = 0; + + //! @brief Asymptotic value of steepest descent method + /** @see setTau */ + virtual double getTau() const = 0; + /** @copybrief getTau @see getTau */ + virtual void setTau(double val) = 0; + + //! @brief Weight parameter to balance data term and smoothness term + /** @see setLabmda */ + virtual double getLabmda() const = 0; + /** @copybrief getLabmda @see getLabmda */ + virtual void setLabmda(double val) = 0; + + //! @brief Parameter of spacial distribution in Bilateral-TV + /** @see setAlpha */ + virtual double getAlpha() const = 0; + /** @copybrief getAlpha @see getAlpha */ + virtual void setAlpha(double val) = 0; + + //! @brief Kernel size of Bilateral-TV filter + /** @see setKernelSize */ + virtual int getKernelSize() const = 0; + /** @copybrief getKernelSize @see getKernelSize */ + virtual void setKernelSize(int val) = 0; + + //! @brief Gaussian blur kernel size + /** @see setBlurKernelSize */ + virtual int getBlurKernelSize() const = 0; + /** @copybrief getBlurKernelSize @see getBlurKernelSize */ + virtual void setBlurKernelSize(int val) = 0; + + //! @brief Gaussian blur sigma + /** @see setBlurSigma */ + virtual double getBlurSigma() const = 0; + /** @copybrief getBlurSigma @see getBlurSigma */ + virtual void setBlurSigma(double val) = 0; + + //! @brief Radius of the temporal search area + /** @see setTemporalAreaRadius */ + virtual int getTemporalAreaRadius() const = 0; + /** @copybrief getTemporalAreaRadius @see getTemporalAreaRadius */ + virtual void setTemporalAreaRadius(int val) = 0; + + //! @brief Dense optical flow algorithm + /** @see setOpticalFlow */ + virtual Ptr getOpticalFlow() const = 0; + /** @copybrief getOpticalFlow @see getOpticalFlow */ + virtual void setOpticalFlow(const Ptr &val) = 0; + + protected: + SuperResolution(); + + virtual void initImpl(Ptr& frameSource) = 0; + virtual void processImpl(Ptr& frameSource, OutputArray output) = 0; + + bool isUmat_; + + private: + Ptr frameSource_; + bool firstCall_; + }; + + /** @brief Create Bilateral TV-L1 Super Resolution. + + This class implements Super Resolution algorithm described in the papers @cite Farsiu03 and + @cite Mitzel09 . + + Here are important members of the class that control the algorithm, which you can set after + constructing the class instance: + + - **int scale** Scale factor. + - **int iterations** Iteration count. + - **double tau** Asymptotic value of steepest descent method. + - **double lambda** Weight parameter to balance data term and smoothness term. + - **double alpha** Parameter of spacial distribution in Bilateral-TV. + - **int btvKernelSize** Kernel size of Bilateral-TV filter. + - **int blurKernelSize** Gaussian blur kernel size. + - **double blurSigma** Gaussian blur sigma. + - **int temporalAreaRadius** Radius of the temporal search area. + - **Ptr\ opticalFlow** Dense optical flow algorithm. + */ + CV_EXPORTS Ptr createSuperResolution_BTVL1(); + CV_EXPORTS Ptr createSuperResolution_BTVL1_CUDA(); + +//! @} superres + + } +} + +#endif // __OPENCV_SUPERRES_HPP__ diff --git a/lib/opencv/include/opencv2/superres/optical_flow.hpp b/lib/opencv/include/opencv2/superres/optical_flow.hpp new file mode 100644 index 000000000..d2f29a39b --- /dev/null +++ b/lib/opencv/include/opencv2/superres/optical_flow.hpp @@ -0,0 +1,203 @@ +/*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_SUPERRES_OPTICAL_FLOW_HPP__ +#define __OPENCV_SUPERRES_OPTICAL_FLOW_HPP__ + +#include "opencv2/core.hpp" + +namespace cv +{ + namespace superres + { + +//! @addtogroup superres +//! @{ + + class CV_EXPORTS DenseOpticalFlowExt : public cv::Algorithm + { + public: + virtual void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2 = noArray()) = 0; + virtual void collectGarbage() = 0; + }; + + + class CV_EXPORTS FarnebackOpticalFlow : public virtual DenseOpticalFlowExt + { + public: + /** @see setPyrScale */ + virtual double getPyrScale() const = 0; + /** @copybrief getPyrScale @see getPyrScale */ + virtual void setPyrScale(double val) = 0; + /** @see setLevelsNumber */ + virtual int getLevelsNumber() const = 0; + /** @copybrief getLevelsNumber @see getLevelsNumber */ + virtual void setLevelsNumber(int val) = 0; + /** @see setWindowSize */ + virtual int getWindowSize() const = 0; + /** @copybrief getWindowSize @see getWindowSize */ + virtual void setWindowSize(int val) = 0; + /** @see setIterations */ + virtual int getIterations() const = 0; + /** @copybrief getIterations @see getIterations */ + virtual void setIterations(int val) = 0; + /** @see setPolyN */ + virtual int getPolyN() const = 0; + /** @copybrief getPolyN @see getPolyN */ + virtual void setPolyN(int val) = 0; + /** @see setPolySigma */ + virtual double getPolySigma() const = 0; + /** @copybrief getPolySigma @see getPolySigma */ + virtual void setPolySigma(double val) = 0; + /** @see setFlags */ + virtual int getFlags() const = 0; + /** @copybrief getFlags @see getFlags */ + virtual void setFlags(int val) = 0; + }; + CV_EXPORTS Ptr createOptFlow_Farneback(); + CV_EXPORTS Ptr createOptFlow_Farneback_CUDA(); + + +// CV_EXPORTS Ptr createOptFlow_Simple(); + + + class CV_EXPORTS DualTVL1OpticalFlow : public virtual DenseOpticalFlowExt + { + public: + /** @see setTau */ + virtual double getTau() const = 0; + /** @copybrief getTau @see getTau */ + virtual void setTau(double val) = 0; + /** @see setLambda */ + virtual double getLambda() const = 0; + /** @copybrief getLambda @see getLambda */ + virtual void setLambda(double val) = 0; + /** @see setTheta */ + virtual double getTheta() const = 0; + /** @copybrief getTheta @see getTheta */ + virtual void setTheta(double val) = 0; + /** @see setScalesNumber */ + virtual int getScalesNumber() const = 0; + /** @copybrief getScalesNumber @see getScalesNumber */ + virtual void setScalesNumber(int val) = 0; + /** @see setWarpingsNumber */ + virtual int getWarpingsNumber() const = 0; + /** @copybrief getWarpingsNumber @see getWarpingsNumber */ + virtual void setWarpingsNumber(int val) = 0; + /** @see setEpsilon */ + virtual double getEpsilon() const = 0; + /** @copybrief getEpsilon @see getEpsilon */ + virtual void setEpsilon(double val) = 0; + /** @see setIterations */ + virtual int getIterations() const = 0; + /** @copybrief getIterations @see getIterations */ + virtual void setIterations(int val) = 0; + /** @see setUseInitialFlow */ + virtual bool getUseInitialFlow() const = 0; + /** @copybrief getUseInitialFlow @see getUseInitialFlow */ + virtual void setUseInitialFlow(bool val) = 0; + }; + CV_EXPORTS Ptr createOptFlow_DualTVL1(); + CV_EXPORTS Ptr createOptFlow_DualTVL1_CUDA(); + + + class CV_EXPORTS BroxOpticalFlow : public virtual DenseOpticalFlowExt + { + public: + //! @brief Flow smoothness + /** @see setAlpha */ + virtual double getAlpha() const = 0; + /** @copybrief getAlpha @see getAlpha */ + virtual void setAlpha(double val) = 0; + //! @brief Gradient constancy importance + /** @see setGamma */ + virtual double getGamma() const = 0; + /** @copybrief getGamma @see getGamma */ + virtual void setGamma(double val) = 0; + //! @brief Pyramid scale factor + /** @see setScaleFactor */ + virtual double getScaleFactor() const = 0; + /** @copybrief getScaleFactor @see getScaleFactor */ + virtual void setScaleFactor(double val) = 0; + //! @brief Number of lagged non-linearity iterations (inner loop) + /** @see setInnerIterations */ + virtual int getInnerIterations() const = 0; + /** @copybrief getInnerIterations @see getInnerIterations */ + virtual void setInnerIterations(int val) = 0; + //! @brief Number of warping iterations (number of pyramid levels) + /** @see setOuterIterations */ + virtual int getOuterIterations() const = 0; + /** @copybrief getOuterIterations @see getOuterIterations */ + virtual void setOuterIterations(int val) = 0; + //! @brief Number of linear system solver iterations + /** @see setSolverIterations */ + virtual int getSolverIterations() const = 0; + /** @copybrief getSolverIterations @see getSolverIterations */ + virtual void setSolverIterations(int val) = 0; + }; + CV_EXPORTS Ptr createOptFlow_Brox_CUDA(); + + + class PyrLKOpticalFlow : public virtual DenseOpticalFlowExt + { + public: + /** @see setWindowSize */ + virtual int getWindowSize() const = 0; + /** @copybrief getWindowSize @see getWindowSize */ + virtual void setWindowSize(int val) = 0; + /** @see setMaxLevel */ + virtual int getMaxLevel() const = 0; + /** @copybrief getMaxLevel @see getMaxLevel */ + virtual void setMaxLevel(int val) = 0; + /** @see setIterations */ + virtual int getIterations() const = 0; + /** @copybrief getIterations @see getIterations */ + virtual void setIterations(int val) = 0; + }; + CV_EXPORTS Ptr createOptFlow_PyrLK_CUDA(); + +//! @} + + } +} + +#endif // __OPENCV_SUPERRES_OPTICAL_FLOW_HPP__ diff --git a/lib/opencv/include/opencv2/video.hpp b/lib/opencv/include/opencv2/video.hpp new file mode 100644 index 000000000..a5938154a --- /dev/null +++ b/lib/opencv/include/opencv2/video.hpp @@ -0,0 +1,63 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_VIDEO_HPP__ +#define __OPENCV_VIDEO_HPP__ + +/** + @defgroup video Video Analysis + @{ + @defgroup video_motion Motion Analysis + @defgroup video_track Object Tracking + @defgroup video_c C API + @} +*/ + +#include "opencv2/video/tracking.hpp" +#include "opencv2/video/background_segm.hpp" + +#ifndef DISABLE_OPENCV_24_COMPATIBILITY +#include "opencv2/video/tracking_c.h" +#endif + +#endif //__OPENCV_VIDEO_HPP__ diff --git a/lib/opencv/include/opencv2/video/background_segm.hpp b/lib/opencv/include/opencv2/video/background_segm.hpp new file mode 100644 index 000000000..dbeccbdc8 --- /dev/null +++ b/lib/opencv/include/opencv2/video/background_segm.hpp @@ -0,0 +1,306 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_BACKGROUND_SEGM_HPP__ +#define __OPENCV_BACKGROUND_SEGM_HPP__ + +#include "opencv2/core.hpp" + +namespace cv +{ + +//! @addtogroup video_motion +//! @{ + +/** @brief Base class for background/foreground segmentation. : + +The class is only used to define the common interface for the whole family of background/foreground +segmentation algorithms. + */ +class CV_EXPORTS_W BackgroundSubtractor : public Algorithm +{ +public: + /** @brief Computes a foreground mask. + + @param image Next video frame. + @param fgmask The output foreground mask as an 8-bit binary image. + @param learningRate The value between 0 and 1 that indicates how fast the background model is + learnt. Negative parameter value makes the algorithm to use some automatically chosen learning + rate. 0 means that the background model is not updated at all, 1 means that the background model + is completely reinitialized from the last frame. + */ + CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate=-1) = 0; + + /** @brief Computes a background image. + + @param backgroundImage The output background image. + + @note Sometimes the background image can be very blurry, as it contain the average background + statistics. + */ + CV_WRAP virtual void getBackgroundImage(OutputArray backgroundImage) const = 0; +}; + + +/** @brief Gaussian Mixture-based Background/Foreground Segmentation Algorithm. + +The class implements the Gaussian mixture model background subtraction described in @cite Zivkovic2004 +and @cite Zivkovic2006 . + */ +class CV_EXPORTS_W BackgroundSubtractorMOG2 : public BackgroundSubtractor +{ +public: + /** @brief Returns the number of last frames that affect the background model + */ + CV_WRAP virtual int getHistory() const = 0; + /** @brief Sets the number of last frames that affect the background model + */ + CV_WRAP virtual void setHistory(int history) = 0; + + /** @brief Returns the number of gaussian components in the background model + */ + CV_WRAP virtual int getNMixtures() const = 0; + /** @brief Sets the number of gaussian components in the background model. + + The model needs to be reinitalized to reserve memory. + */ + CV_WRAP virtual void setNMixtures(int nmixtures) = 0;//needs reinitialization! + + /** @brief Returns the "background ratio" parameter of the algorithm + + If a foreground pixel keeps semi-constant value for about backgroundRatio\*history frames, it's + considered background and added to the model as a center of a new component. It corresponds to TB + parameter in the paper. + */ + CV_WRAP virtual double getBackgroundRatio() const = 0; + /** @brief Sets the "background ratio" parameter of the algorithm + */ + CV_WRAP virtual void setBackgroundRatio(double ratio) = 0; + + /** @brief Returns the variance threshold for the pixel-model match + + The main threshold on the squared Mahalanobis distance to decide if the sample is well described by + the background model or not. Related to Cthr from the paper. + */ + CV_WRAP virtual double getVarThreshold() const = 0; + /** @brief Sets the variance threshold for the pixel-model match + */ + CV_WRAP virtual void setVarThreshold(double varThreshold) = 0; + + /** @brief Returns the variance threshold for the pixel-model match used for new mixture component generation + + Threshold for the squared Mahalanobis distance that helps decide when a sample is close to the + existing components (corresponds to Tg in the paper). If a pixel is not close to any component, it + is considered foreground or added as a new component. 3 sigma =\> Tg=3\*3=9 is default. A smaller Tg + value generates more components. A higher Tg value may result in a small number of components but + they can grow too large. + */ + CV_WRAP virtual double getVarThresholdGen() const = 0; + /** @brief Sets the variance threshold for the pixel-model match used for new mixture component generation + */ + CV_WRAP virtual void setVarThresholdGen(double varThresholdGen) = 0; + + /** @brief Returns the initial variance of each gaussian component + */ + CV_WRAP virtual double getVarInit() const = 0; + /** @brief Sets the initial variance of each gaussian component + */ + CV_WRAP virtual void setVarInit(double varInit) = 0; + + CV_WRAP virtual double getVarMin() const = 0; + CV_WRAP virtual void setVarMin(double varMin) = 0; + + CV_WRAP virtual double getVarMax() const = 0; + CV_WRAP virtual void setVarMax(double varMax) = 0; + + /** @brief Returns the complexity reduction threshold + + This parameter defines the number of samples needed to accept to prove the component exists. CT=0.05 + is a default value for all the samples. By setting CT=0 you get an algorithm very similar to the + standard Stauffer&Grimson algorithm. + */ + CV_WRAP virtual double getComplexityReductionThreshold() const = 0; + /** @brief Sets the complexity reduction threshold + */ + CV_WRAP virtual void setComplexityReductionThreshold(double ct) = 0; + + /** @brief Returns the shadow detection flag + + If true, the algorithm detects shadows and marks them. See createBackgroundSubtractorMOG2 for + details. + */ + CV_WRAP virtual bool getDetectShadows() const = 0; + /** @brief Enables or disables shadow detection + */ + CV_WRAP virtual void setDetectShadows(bool detectShadows) = 0; + + /** @brief Returns the shadow value + + Shadow value is the value used to mark shadows in the foreground mask. Default value is 127. Value 0 + in the mask always means background, 255 means foreground. + */ + CV_WRAP virtual int getShadowValue() const = 0; + /** @brief Sets the shadow value + */ + CV_WRAP virtual void setShadowValue(int value) = 0; + + /** @brief Returns the shadow threshold + + A shadow is detected if pixel is a darker version of the background. The shadow threshold (Tau in + the paper) is a threshold defining how much darker the shadow can be. Tau= 0.5 means that if a pixel + is more than twice darker then it is not shadow. See Prati, Mikic, Trivedi and Cucchiarra, + *Detecting Moving Shadows...*, IEEE PAMI,2003. + */ + CV_WRAP virtual double getShadowThreshold() const = 0; + /** @brief Sets the shadow threshold + */ + CV_WRAP virtual void setShadowThreshold(double threshold) = 0; +}; + +/** @brief Creates MOG2 Background Subtractor + +@param history Length of the history. +@param varThreshold Threshold on the squared Mahalanobis distance between the pixel and the model +to decide whether a pixel is well described by the background model. This parameter does not +affect the background update. +@param detectShadows If true, the algorithm will detect shadows and mark them. It decreases the +speed a bit, so if you do not need this feature, set the parameter to false. + */ +CV_EXPORTS_W Ptr + createBackgroundSubtractorMOG2(int history=500, double varThreshold=16, + bool detectShadows=true); + +/** @brief K-nearest neigbours - based Background/Foreground Segmentation Algorithm. + +The class implements the K-nearest neigbours background subtraction described in @cite Zivkovic2006 . +Very efficient if number of foreground pixels is low. + */ +class CV_EXPORTS_W BackgroundSubtractorKNN : public BackgroundSubtractor +{ +public: + /** @brief Returns the number of last frames that affect the background model + */ + CV_WRAP virtual int getHistory() const = 0; + /** @brief Sets the number of last frames that affect the background model + */ + CV_WRAP virtual void setHistory(int history) = 0; + + /** @brief Returns the number of data samples in the background model + */ + CV_WRAP virtual int getNSamples() const = 0; + /** @brief Sets the number of data samples in the background model. + + The model needs to be reinitalized to reserve memory. + */ + CV_WRAP virtual void setNSamples(int _nN) = 0;//needs reinitialization! + + /** @brief Returns the threshold on the squared distance between the pixel and the sample + + The threshold on the squared distance between the pixel and the sample to decide whether a pixel is + close to a data sample. + */ + CV_WRAP virtual double getDist2Threshold() const = 0; + /** @brief Sets the threshold on the squared distance + */ + CV_WRAP virtual void setDist2Threshold(double _dist2Threshold) = 0; + + /** @brief Returns the number of neighbours, the k in the kNN. + + K is the number of samples that need to be within dist2Threshold in order to decide that that + pixel is matching the kNN background model. + */ + CV_WRAP virtual int getkNNSamples() const = 0; + /** @brief Sets the k in the kNN. How many nearest neigbours need to match. + */ + CV_WRAP virtual void setkNNSamples(int _nkNN) = 0; + + /** @brief Returns the shadow detection flag + + If true, the algorithm detects shadows and marks them. See createBackgroundSubtractorKNN for + details. + */ + CV_WRAP virtual bool getDetectShadows() const = 0; + /** @brief Enables or disables shadow detection + */ + CV_WRAP virtual void setDetectShadows(bool detectShadows) = 0; + + /** @brief Returns the shadow value + + Shadow value is the value used to mark shadows in the foreground mask. Default value is 127. Value 0 + in the mask always means background, 255 means foreground. + */ + CV_WRAP virtual int getShadowValue() const = 0; + /** @brief Sets the shadow value + */ + CV_WRAP virtual void setShadowValue(int value) = 0; + + /** @brief Returns the shadow threshold + + A shadow is detected if pixel is a darker version of the background. The shadow threshold (Tau in + the paper) is a threshold defining how much darker the shadow can be. Tau= 0.5 means that if a pixel + is more than twice darker then it is not shadow. See Prati, Mikic, Trivedi and Cucchiarra, + *Detecting Moving Shadows...*, IEEE PAMI,2003. + */ + CV_WRAP virtual double getShadowThreshold() const = 0; + /** @brief Sets the shadow threshold + */ + CV_WRAP virtual void setShadowThreshold(double threshold) = 0; +}; + +/** @brief Creates KNN Background Subtractor + +@param history Length of the history. +@param dist2Threshold Threshold on the squared distance between the pixel and the sample to decide +whether a pixel is close to that sample. This parameter does not affect the background update. +@param detectShadows If true, the algorithm will detect shadows and mark them. It decreases the +speed a bit, so if you do not need this feature, set the parameter to false. + */ +CV_EXPORTS_W Ptr + createBackgroundSubtractorKNN(int history=500, double dist2Threshold=400.0, + bool detectShadows=true); + +//! @} video_motion + +} // cv + +#endif diff --git a/lib/opencv/include/opencv2/video/tracking.hpp b/lib/opencv/include/opencv2/video/tracking.hpp new file mode 100644 index 000000000..d6954fecc --- /dev/null +++ b/lib/opencv/include/opencv2/video/tracking.hpp @@ -0,0 +1,515 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_TRACKING_HPP__ +#define __OPENCV_TRACKING_HPP__ + +#include "opencv2/core.hpp" +#include "opencv2/imgproc.hpp" + +namespace cv +{ + +//! @addtogroup video_track +//! @{ + +enum { OPTFLOW_USE_INITIAL_FLOW = 4, + OPTFLOW_LK_GET_MIN_EIGENVALS = 8, + OPTFLOW_FARNEBACK_GAUSSIAN = 256 + }; + +/** @brief Finds an object center, size, and orientation. + +@param probImage Back projection of the object histogram. See calcBackProject. +@param window Initial search window. +@param criteria Stop criteria for the underlying meanShift. +returns +(in old interfaces) Number of iterations CAMSHIFT took to converge +The function implements the CAMSHIFT object tracking algorithm @cite Bradski98 . First, it finds an +object center using meanShift and then adjusts the window size and finds the optimal rotation. The +function returns the rotated rectangle structure that includes the object position, size, and +orientation. The next position of the search window can be obtained with RotatedRect::boundingRect() + +See the OpenCV sample camshiftdemo.c that tracks colored objects. + +@note +- (Python) A sample explaining the camshift tracking algorithm can be found at + opencv_source_code/samples/python/camshift.py + */ +CV_EXPORTS_W RotatedRect CamShift( InputArray probImage, CV_IN_OUT Rect& window, + TermCriteria criteria ); + +/** @brief Finds an object on a back projection image. + +@param probImage Back projection of the object histogram. See calcBackProject for details. +@param window Initial search window. +@param criteria Stop criteria for the iterative search algorithm. +returns +: Number of iterations CAMSHIFT took to converge. +The function implements the iterative object search algorithm. It takes the input back projection of +an object and the initial position. The mass center in window of the back projection image is +computed and the search window center shifts to the mass center. The procedure is repeated until the +specified number of iterations criteria.maxCount is done or until the window center shifts by less +than criteria.epsilon. The algorithm is used inside CamShift and, unlike CamShift , the search +window size or orientation do not change during the search. You can simply pass the output of +calcBackProject to this function. But better results can be obtained if you pre-filter the back +projection and remove the noise. For example, you can do this by retrieving connected components +with findContours , throwing away contours with small area ( contourArea ), and rendering the +remaining contours with drawContours. + +@note +- A mean-shift tracking sample can be found at opencv_source_code/samples/cpp/camshiftdemo.cpp + */ +CV_EXPORTS_W int meanShift( InputArray probImage, CV_IN_OUT Rect& window, TermCriteria criteria ); + +/** @brief Constructs the image pyramid which can be passed to calcOpticalFlowPyrLK. + +@param img 8-bit input image. +@param pyramid output pyramid. +@param winSize window size of optical flow algorithm. Must be not less than winSize argument of +calcOpticalFlowPyrLK. It is needed to calculate required padding for pyramid levels. +@param maxLevel 0-based maximal pyramid level number. +@param withDerivatives set to precompute gradients for the every pyramid level. If pyramid is +constructed without the gradients then calcOpticalFlowPyrLK will calculate them internally. +@param pyrBorder the border mode for pyramid layers. +@param derivBorder the border mode for gradients. +@param tryReuseInputImage put ROI of input image into the pyramid if possible. You can pass false +to force data copying. +@return number of levels in constructed pyramid. Can be less than maxLevel. + */ +CV_EXPORTS_W int buildOpticalFlowPyramid( InputArray img, OutputArrayOfArrays pyramid, + Size winSize, int maxLevel, bool withDerivatives = true, + int pyrBorder = BORDER_REFLECT_101, + int derivBorder = BORDER_CONSTANT, + bool tryReuseInputImage = true ); + +/** @brief Calculates an optical flow for a sparse feature set using the iterative Lucas-Kanade method with +pyramids. + +@param prevImg first 8-bit input image or pyramid constructed by buildOpticalFlowPyramid. +@param nextImg second input image or pyramid of the same size and the same type as prevImg. +@param prevPts vector of 2D points for which the flow needs to be found; point coordinates must be +single-precision floating-point numbers. +@param nextPts output vector of 2D points (with single-precision floating-point coordinates) +containing the calculated new positions of input features in the second image; when +OPTFLOW_USE_INITIAL_FLOW flag is passed, the vector must have the same size as in the input. +@param status output status vector (of unsigned chars); each element of the vector is set to 1 if +the flow for the corresponding features has been found, otherwise, it is set to 0. +@param err output vector of errors; each element of the vector is set to an error for the +corresponding feature, type of the error measure can be set in flags parameter; if the flow wasn't +found then the error is not defined (use the status parameter to find such cases). +@param winSize size of the search window at each pyramid level. +@param maxLevel 0-based maximal pyramid level number; if set to 0, pyramids are not used (single +level), if set to 1, two levels are used, and so on; if pyramids are passed to input then +algorithm will use as many levels as pyramids have but no more than maxLevel. +@param criteria parameter, specifying the termination criteria of the iterative search algorithm +(after the specified maximum number of iterations criteria.maxCount or when the search window +moves by less than criteria.epsilon. +@param flags operation flags: + - **OPTFLOW_USE_INITIAL_FLOW** uses initial estimations, stored in nextPts; if the flag is + not set, then prevPts is copied to nextPts and is considered the initial estimate. + - **OPTFLOW_LK_GET_MIN_EIGENVALS** use minimum eigen values as an error measure (see + minEigThreshold description); if the flag is not set, then L1 distance between patches + around the original and a moved point, divided by number of pixels in a window, is used as a + error measure. +@param minEigThreshold the algorithm calculates the minimum eigen value of a 2x2 normal matrix of +optical flow equations (this matrix is called a spatial gradient matrix in @cite Bouguet00), divided +by number of pixels in a window; if this value is less than minEigThreshold, then a corresponding +feature is filtered out and its flow is not processed, so it allows to remove bad points and get a +performance boost. + +The function implements a sparse iterative version of the Lucas-Kanade optical flow in pyramids. See +@cite Bouguet00 . The function is parallelized with the TBB library. + +@note + +- An example using the Lucas-Kanade optical flow algorithm can be found at + opencv_source_code/samples/cpp/lkdemo.cpp +- (Python) An example using the Lucas-Kanade optical flow algorithm can be found at + opencv_source_code/samples/python/lk_track.py +- (Python) An example using the Lucas-Kanade tracker for homography matching can be found at + opencv_source_code/samples/python/lk_homography.py + */ +CV_EXPORTS_W void calcOpticalFlowPyrLK( InputArray prevImg, InputArray nextImg, + InputArray prevPts, InputOutputArray nextPts, + OutputArray status, OutputArray err, + Size winSize = Size(21,21), int maxLevel = 3, + TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01), + int flags = 0, double minEigThreshold = 1e-4 ); + +/** @brief Computes a dense optical flow using the Gunnar Farneback's algorithm. + +@param prev first 8-bit single-channel input image. +@param next second input image of the same size and the same type as prev. +@param flow computed flow image that has the same size as prev and type CV_32FC2. +@param pyr_scale parameter, specifying the image scale (\<1) to build pyramids for each image; +pyr_scale=0.5 means a classical pyramid, where each next layer is twice smaller than the previous +one. +@param levels number of pyramid layers including the initial image; levels=1 means that no extra +layers are created and only the original images are used. +@param winsize averaging window size; larger values increase the algorithm robustness to image +noise and give more chances for fast motion detection, but yield more blurred motion field. +@param iterations number of iterations the algorithm does at each pyramid level. +@param poly_n size of the pixel neighborhood used to find polynomial expansion in each pixel; +larger values mean that the image will be approximated with smoother surfaces, yielding more +robust algorithm and more blurred motion field, typically poly_n =5 or 7. +@param poly_sigma standard deviation of the Gaussian that is used to smooth derivatives used as a +basis for the polynomial expansion; for poly_n=5, you can set poly_sigma=1.1, for poly_n=7, a +good value would be poly_sigma=1.5. +@param flags operation flags that can be a combination of the following: + - **OPTFLOW_USE_INITIAL_FLOW** uses the input flow as an initial flow approximation. + - **OPTFLOW_FARNEBACK_GAUSSIAN** uses the Gaussian \f$\texttt{winsize}\times\texttt{winsize}\f$ + filter instead of a box filter of the same size for optical flow estimation; usually, this + option gives z more accurate flow than with a box filter, at the cost of lower speed; + normally, winsize for a Gaussian window should be set to a larger value to achieve the same + level of robustness. + +The function finds an optical flow for each prev pixel using the @cite Farneback2003 algorithm so that + +\f[\texttt{prev} (y,x) \sim \texttt{next} ( y + \texttt{flow} (y,x)[1], x + \texttt{flow} (y,x)[0])\f] + +@note + +- An example using the optical flow algorithm described by Gunnar Farneback can be found at + opencv_source_code/samples/cpp/fback.cpp +- (Python) An example using the optical flow algorithm described by Gunnar Farneback can be + found at opencv_source_code/samples/python/opt_flow.py + */ +CV_EXPORTS_W void calcOpticalFlowFarneback( InputArray prev, InputArray next, InputOutputArray flow, + double pyr_scale, int levels, int winsize, + int iterations, int poly_n, double poly_sigma, + int flags ); + +/** @brief Computes an optimal affine transformation between two 2D point sets. + +@param src First input 2D point set stored in std::vector or Mat, or an image stored in Mat. +@param dst Second input 2D point set of the same size and the same type as A, or another image. +@param fullAffine If true, the function finds an optimal affine transformation with no additional +restrictions (6 degrees of freedom). Otherwise, the class of transformations to choose from is +limited to combinations of translation, rotation, and uniform scaling (5 degrees of freedom). + +The function finds an optimal affine transform *[A|b]* (a 2 x 3 floating-point matrix) that +approximates best the affine transformation between: + +* Two point sets +* Two raster images. In this case, the function first finds some features in the src image and + finds the corresponding features in dst image. After that, the problem is reduced to the first + case. +In case of point sets, the problem is formulated as follows: you need to find a 2x2 matrix *A* and +2x1 vector *b* so that: + +\f[[A^*|b^*] = arg \min _{[A|b]} \sum _i \| \texttt{dst}[i] - A { \texttt{src}[i]}^T - b \| ^2\f] +where src[i] and dst[i] are the i-th points in src and dst, respectively +\f$[A|b]\f$ can be either arbitrary (when fullAffine=true ) or have a form of +\f[\begin{bmatrix} a_{11} & a_{12} & b_1 \\ -a_{12} & a_{11} & b_2 \end{bmatrix}\f] +when fullAffine=false. + +@sa +getAffineTransform, getPerspectiveTransform, findHomography + */ +CV_EXPORTS_W Mat estimateRigidTransform( InputArray src, InputArray dst, bool fullAffine ); + + +enum +{ + MOTION_TRANSLATION = 0, + MOTION_EUCLIDEAN = 1, + MOTION_AFFINE = 2, + MOTION_HOMOGRAPHY = 3 +}; + +/** @brief Finds the geometric transform (warp) between two images in terms of the ECC criterion @cite EP08 . + +@param templateImage single-channel template image; CV_8U or CV_32F array. +@param inputImage single-channel input image which should be warped with the final warpMatrix in +order to provide an image similar to templateImage, same type as temlateImage. +@param warpMatrix floating-point \f$2\times 3\f$ or \f$3\times 3\f$ mapping matrix (warp). +@param motionType parameter, specifying the type of motion: + - **MOTION_TRANSLATION** sets a translational motion model; warpMatrix is \f$2\times 3\f$ with + the first \f$2\times 2\f$ part being the unity matrix and the rest two parameters being + estimated. + - **MOTION_EUCLIDEAN** sets a Euclidean (rigid) transformation as motion model; three + parameters are estimated; warpMatrix is \f$2\times 3\f$. + - **MOTION_AFFINE** sets an affine motion model (DEFAULT); six parameters are estimated; + warpMatrix is \f$2\times 3\f$. + - **MOTION_HOMOGRAPHY** sets a homography as a motion model; eight parameters are + estimated;\`warpMatrix\` is \f$3\times 3\f$. +@param criteria parameter, specifying the termination criteria of the ECC algorithm; +criteria.epsilon defines the threshold of the increment in the correlation coefficient between two +iterations (a negative criteria.epsilon makes criteria.maxcount the only termination criterion). +Default values are shown in the declaration above. +@param inputMask An optional mask to indicate valid values of inputImage. + +The function estimates the optimum transformation (warpMatrix) with respect to ECC criterion +(@cite EP08), that is + +\f[\texttt{warpMatrix} = \texttt{warpMatrix} = \arg\max_{W} \texttt{ECC}(\texttt{templateImage}(x,y),\texttt{inputImage}(x',y'))\f] + +where + +\f[\begin{bmatrix} x' \\ y' \end{bmatrix} = W \cdot \begin{bmatrix} x \\ y \\ 1 \end{bmatrix}\f] + +(the equation holds with homogeneous coordinates for homography). It returns the final enhanced +correlation coefficient, that is the correlation coefficient between the template image and the +final warped input image. When a \f$3\times 3\f$ matrix is given with motionType =0, 1 or 2, the third +row is ignored. + +Unlike findHomography and estimateRigidTransform, the function findTransformECC implements an +area-based alignment that builds on intensity similarities. In essence, the function updates the +initial transformation that roughly aligns the images. If this information is missing, the identity +warp (unity matrix) should be given as input. Note that if images undergo strong +displacements/rotations, an initial transformation that roughly aligns the images is necessary +(e.g., a simple euclidean/similarity transform that allows for the images showing the same image +content approximately). Use inverse warping in the second image to take an image close to the first +one, i.e. use the flag WARP_INVERSE_MAP with warpAffine or warpPerspective. See also the OpenCV +sample image_alignment.cpp that demonstrates the use of the function. Note that the function throws +an exception if algorithm does not converges. + +@sa +estimateRigidTransform, findHomography + */ +CV_EXPORTS_W double findTransformECC( InputArray templateImage, InputArray inputImage, + InputOutputArray warpMatrix, int motionType = MOTION_AFFINE, + TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 50, 0.001), + InputArray inputMask = noArray()); + +/** @brief Kalman filter class. + +The class implements a standard Kalman filter , +@cite Welch95 . However, you can modify transitionMatrix, controlMatrix, and measurementMatrix to get +an extended Kalman filter functionality. See the OpenCV sample kalman.cpp. + +@note + +- An example using the standard Kalman filter can be found at + opencv_source_code/samples/cpp/kalman.cpp + */ +class CV_EXPORTS_W KalmanFilter +{ +public: + /** @brief The constructors. + + @note In C API when CvKalman\* kalmanFilter structure is not needed anymore, it should be released + with cvReleaseKalman(&kalmanFilter) + */ + CV_WRAP KalmanFilter(); + /** @overload + @param dynamParams Dimensionality of the state. + @param measureParams Dimensionality of the measurement. + @param controlParams Dimensionality of the control vector. + @param type Type of the created matrices that should be CV_32F or CV_64F. + */ + CV_WRAP KalmanFilter( int dynamParams, int measureParams, int controlParams = 0, int type = CV_32F ); + + /** @brief Re-initializes Kalman filter. The previous content is destroyed. + + @param dynamParams Dimensionality of the state. + @param measureParams Dimensionality of the measurement. + @param controlParams Dimensionality of the control vector. + @param type Type of the created matrices that should be CV_32F or CV_64F. + */ + void init( int dynamParams, int measureParams, int controlParams = 0, int type = CV_32F ); + + /** @brief Computes a predicted state. + + @param control The optional input control + */ + CV_WRAP const Mat& predict( const Mat& control = Mat() ); + + /** @brief Updates the predicted state from the measurement. + + @param measurement The measured system parameters + */ + CV_WRAP const Mat& correct( const Mat& measurement ); + + CV_PROP_RW Mat statePre; //!< predicted state (x'(k)): x(k)=A*x(k-1)+B*u(k) + CV_PROP_RW Mat statePost; //!< corrected state (x(k)): x(k)=x'(k)+K(k)*(z(k)-H*x'(k)) + CV_PROP_RW Mat transitionMatrix; //!< state transition matrix (A) + CV_PROP_RW Mat controlMatrix; //!< control matrix (B) (not used if there is no control) + CV_PROP_RW Mat measurementMatrix; //!< measurement matrix (H) + CV_PROP_RW Mat processNoiseCov; //!< process noise covariance matrix (Q) + CV_PROP_RW Mat measurementNoiseCov;//!< measurement noise covariance matrix (R) + CV_PROP_RW Mat errorCovPre; //!< priori error estimate covariance matrix (P'(k)): P'(k)=A*P(k-1)*At + Q)*/ + CV_PROP_RW Mat gain; //!< Kalman gain matrix (K(k)): K(k)=P'(k)*Ht*inv(H*P'(k)*Ht+R) + CV_PROP_RW Mat errorCovPost; //!< posteriori error estimate covariance matrix (P(k)): P(k)=(I-K(k)*H)*P'(k) + + // temporary matrices + Mat temp1; + Mat temp2; + Mat temp3; + Mat temp4; + Mat temp5; +}; + + +class CV_EXPORTS_W DenseOpticalFlow : public Algorithm +{ +public: + /** @brief Calculates an optical flow. + + @param I0 first 8-bit single-channel input image. + @param I1 second input image of the same size and the same type as prev. + @param flow computed flow image that has the same size as prev and type CV_32FC2. + */ + CV_WRAP virtual void calc( InputArray I0, InputArray I1, InputOutputArray flow ) = 0; + /** @brief Releases all inner buffers. + */ + CV_WRAP virtual void collectGarbage() = 0; +}; + +/** @brief "Dual TV L1" Optical Flow Algorithm. + +The class implements the "Dual TV L1" optical flow algorithm described in @cite Zach2007 and +@cite Javier2012 . +Here are important members of the class that control the algorithm, which you can set after +constructing the class instance: + +- member double tau + Time step of the numerical scheme. + +- member double lambda + Weight parameter for the data term, attachment parameter. This is the most relevant + parameter, which determines the smoothness of the output. The smaller this parameter is, + the smoother the solutions we obtain. It depends on the range of motions of the images, so + its value should be adapted to each image sequence. + +- member double theta + Weight parameter for (u - v)\^2, tightness parameter. It serves as a link between the + attachment and the regularization terms. In theory, it should have a small value in order + to maintain both parts in correspondence. The method is stable for a large range of values + of this parameter. + +- member int nscales + Number of scales used to create the pyramid of images. + +- member int warps + Number of warpings per scale. Represents the number of times that I1(x+u0) and grad( + I1(x+u0) ) are computed per scale. This is a parameter that assures the stability of the + method. It also affects the running time, so it is a compromise between speed and + accuracy. + +- member double epsilon + Stopping criterion threshold used in the numerical scheme, which is a trade-off between + precision and running time. A small value will yield more accurate solutions at the + expense of a slower convergence. + +- member int iterations + Stopping criterion iterations number used in the numerical scheme. + +C. Zach, T. Pock and H. Bischof, "A Duality Based Approach for Realtime TV-L1 Optical Flow". +Javier Sanchez, Enric Meinhardt-Llopis and Gabriele Facciolo. "TV-L1 Optical Flow Estimation". +*/ +class CV_EXPORTS_W DualTVL1OpticalFlow : public DenseOpticalFlow +{ +public: + //! @brief Time step of the numerical scheme + /** @see setTau */ + virtual double getTau() const = 0; + /** @copybrief getTau @see getTau */ + virtual void setTau(double val) = 0; + //! @brief Weight parameter for the data term, attachment parameter + /** @see setLambda */ + virtual double getLambda() const = 0; + /** @copybrief getLambda @see getLambda */ + virtual void setLambda(double val) = 0; + //! @brief Weight parameter for (u - v)^2, tightness parameter + /** @see setTheta */ + virtual double getTheta() const = 0; + /** @copybrief getTheta @see getTheta */ + virtual void setTheta(double val) = 0; + //! @brief coefficient for additional illumination variation term + /** @see setGamma */ + virtual double getGamma() const = 0; + /** @copybrief getGamma @see getGamma */ + virtual void setGamma(double val) = 0; + //! @brief Number of scales used to create the pyramid of images + /** @see setScalesNumber */ + virtual int getScalesNumber() const = 0; + /** @copybrief getScalesNumber @see getScalesNumber */ + virtual void setScalesNumber(int val) = 0; + //! @brief Number of warpings per scale + /** @see setWarpingsNumber */ + virtual int getWarpingsNumber() const = 0; + /** @copybrief getWarpingsNumber @see getWarpingsNumber */ + virtual void setWarpingsNumber(int val) = 0; + //! @brief Stopping criterion threshold used in the numerical scheme, which is a trade-off between precision and running time + /** @see setEpsilon */ + virtual double getEpsilon() const = 0; + /** @copybrief getEpsilon @see getEpsilon */ + virtual void setEpsilon(double val) = 0; + //! @brief Inner iterations (between outlier filtering) used in the numerical scheme + /** @see setInnerIterations */ + virtual int getInnerIterations() const = 0; + /** @copybrief getInnerIterations @see getInnerIterations */ + virtual void setInnerIterations(int val) = 0; + //! @brief Outer iterations (number of inner loops) used in the numerical scheme + /** @see setOuterIterations */ + virtual int getOuterIterations() const = 0; + /** @copybrief getOuterIterations @see getOuterIterations */ + virtual void setOuterIterations(int val) = 0; + //! @brief Use initial flow + /** @see setUseInitialFlow */ + virtual bool getUseInitialFlow() const = 0; + /** @copybrief getUseInitialFlow @see getUseInitialFlow */ + virtual void setUseInitialFlow(bool val) = 0; + //! @brief Step between scales (<1) + /** @see setScaleStep */ + virtual double getScaleStep() const = 0; + /** @copybrief getScaleStep @see getScaleStep */ + virtual void setScaleStep(double val) = 0; + //! @brief Median filter kernel size (1 = no filter) (3 or 5) + /** @see setMedianFiltering */ + virtual int getMedianFiltering() const = 0; + /** @copybrief getMedianFiltering @see getMedianFiltering */ + virtual void setMedianFiltering(int val) = 0; +}; + +/** @brief Creates instance of cv::DenseOpticalFlow +*/ +CV_EXPORTS_W Ptr createOptFlow_DualTVL1(); + +//! @} video_track + +} // cv + +#endif diff --git a/lib/opencv/include/opencv2/video/tracking_c.h b/lib/opencv/include/opencv2/video/tracking_c.h new file mode 100644 index 000000000..b35535287 --- /dev/null +++ b/lib/opencv/include/opencv2/video/tracking_c.h @@ -0,0 +1,232 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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_TRACKING_C_H__ +#define __OPENCV_TRACKING_C_H__ + +#include "opencv2/imgproc/types_c.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup video_c + @{ +*/ + +/****************************************************************************************\ +* Motion Analysis * +\****************************************************************************************/ + +/************************************ optical flow ***************************************/ + +#define CV_LKFLOW_PYR_A_READY 1 +#define CV_LKFLOW_PYR_B_READY 2 +#define CV_LKFLOW_INITIAL_GUESSES 4 +#define CV_LKFLOW_GET_MIN_EIGENVALS 8 + +/* It is Lucas & Kanade method, modified to use pyramids. + Also it does several iterations to get optical flow for + every point at every pyramid level. + Calculates optical flow between two images for certain set of points (i.e. + it is a "sparse" optical flow, which is opposite to the previous 3 methods) */ +CVAPI(void) cvCalcOpticalFlowPyrLK( const CvArr* prev, const CvArr* curr, + CvArr* prev_pyr, CvArr* curr_pyr, + const CvPoint2D32f* prev_features, + CvPoint2D32f* curr_features, + int count, + CvSize win_size, + int level, + char* status, + float* track_error, + CvTermCriteria criteria, + int flags ); + + +/* Modification of a previous sparse optical flow algorithm to calculate + affine flow */ +CVAPI(void) cvCalcAffineFlowPyrLK( const CvArr* prev, const CvArr* curr, + CvArr* prev_pyr, CvArr* curr_pyr, + const CvPoint2D32f* prev_features, + CvPoint2D32f* curr_features, + float* matrices, int count, + CvSize win_size, int level, + char* status, float* track_error, + CvTermCriteria criteria, int flags ); + +/* Estimate rigid transformation between 2 images or 2 point sets */ +CVAPI(int) cvEstimateRigidTransform( const CvArr* A, const CvArr* B, + CvMat* M, int full_affine ); + +/* Estimate optical flow for each pixel using the two-frame G. Farneback algorithm */ +CVAPI(void) cvCalcOpticalFlowFarneback( const CvArr* prev, const CvArr* next, + CvArr* flow, double pyr_scale, int levels, + int winsize, int iterations, int poly_n, + double poly_sigma, int flags ); + +/********************************* motion templates *************************************/ + +/****************************************************************************************\ +* All the motion template functions work only with single channel images. * +* Silhouette image must have depth IPL_DEPTH_8U or IPL_DEPTH_8S * +* Motion history image must have depth IPL_DEPTH_32F, * +* Gradient mask - IPL_DEPTH_8U or IPL_DEPTH_8S, * +* Motion orientation image - IPL_DEPTH_32F * +* Segmentation mask - IPL_DEPTH_32F * +* All the angles are in degrees, all the times are in milliseconds * +\****************************************************************************************/ + +/* Updates motion history image given motion silhouette */ +CVAPI(void) cvUpdateMotionHistory( const CvArr* silhouette, CvArr* mhi, + double timestamp, double duration ); + +/* Calculates gradient of the motion history image and fills + a mask indicating where the gradient is valid */ +CVAPI(void) cvCalcMotionGradient( const CvArr* mhi, CvArr* mask, CvArr* orientation, + double delta1, double delta2, + int aperture_size CV_DEFAULT(3)); + +/* Calculates average motion direction within a selected motion region + (region can be selected by setting ROIs and/or by composing a valid gradient mask + with the region mask) */ +CVAPI(double) cvCalcGlobalOrientation( const CvArr* orientation, const CvArr* mask, + const CvArr* mhi, double timestamp, + double duration ); + +/* Splits a motion history image into a few parts corresponding to separate independent motions + (e.g. left hand, right hand) */ +CVAPI(CvSeq*) cvSegmentMotion( const CvArr* mhi, CvArr* seg_mask, + CvMemStorage* storage, + double timestamp, double seg_thresh ); + +/****************************************************************************************\ +* Tracking * +\****************************************************************************************/ + +/* Implements CAMSHIFT algorithm - determines object position, size and orientation + from the object histogram back project (extension of meanshift) */ +CVAPI(int) cvCamShift( const CvArr* prob_image, CvRect window, + CvTermCriteria criteria, CvConnectedComp* comp, + CvBox2D* box CV_DEFAULT(NULL) ); + +/* Implements MeanShift algorithm - determines object position + from the object histogram back project */ +CVAPI(int) cvMeanShift( const CvArr* prob_image, CvRect window, + CvTermCriteria criteria, CvConnectedComp* comp ); + +/* +standard Kalman filter (in G. Welch' and G. Bishop's notation): + + x(k)=A*x(k-1)+B*u(k)+w(k) p(w)~N(0,Q) + z(k)=H*x(k)+v(k), p(v)~N(0,R) +*/ +typedef struct CvKalman +{ + int MP; /* number of measurement vector dimensions */ + int DP; /* number of state vector dimensions */ + int CP; /* number of control vector dimensions */ + + /* backward compatibility fields */ +#if 1 + float* PosterState; /* =state_pre->data.fl */ + float* PriorState; /* =state_post->data.fl */ + float* DynamMatr; /* =transition_matrix->data.fl */ + float* MeasurementMatr; /* =measurement_matrix->data.fl */ + float* MNCovariance; /* =measurement_noise_cov->data.fl */ + float* PNCovariance; /* =process_noise_cov->data.fl */ + float* KalmGainMatr; /* =gain->data.fl */ + float* PriorErrorCovariance;/* =error_cov_pre->data.fl */ + float* PosterErrorCovariance;/* =error_cov_post->data.fl */ + float* Temp1; /* temp1->data.fl */ + float* Temp2; /* temp2->data.fl */ +#endif + + CvMat* state_pre; /* predicted state (x'(k)): + x(k)=A*x(k-1)+B*u(k) */ + CvMat* state_post; /* corrected state (x(k)): + x(k)=x'(k)+K(k)*(z(k)-H*x'(k)) */ + CvMat* transition_matrix; /* state transition matrix (A) */ + CvMat* control_matrix; /* control matrix (B) + (it is not used if there is no control)*/ + CvMat* measurement_matrix; /* measurement matrix (H) */ + CvMat* process_noise_cov; /* process noise covariance matrix (Q) */ + CvMat* measurement_noise_cov; /* measurement noise covariance matrix (R) */ + CvMat* error_cov_pre; /* priori error estimate covariance matrix (P'(k)): + P'(k)=A*P(k-1)*At + Q)*/ + CvMat* gain; /* Kalman gain matrix (K(k)): + K(k)=P'(k)*Ht*inv(H*P'(k)*Ht+R)*/ + CvMat* error_cov_post; /* posteriori error estimate covariance matrix (P(k)): + P(k)=(I-K(k)*H)*P'(k) */ + CvMat* temp1; /* temporary matrices */ + CvMat* temp2; + CvMat* temp3; + CvMat* temp4; + CvMat* temp5; +} CvKalman; + +/* Creates Kalman filter and sets A, B, Q, R and state to some initial values */ +CVAPI(CvKalman*) cvCreateKalman( int dynam_params, int measure_params, + int control_params CV_DEFAULT(0)); + +/* Releases Kalman filter state */ +CVAPI(void) cvReleaseKalman( CvKalman** kalman); + +/* Updates Kalman filter by time (predicts future state of the system) */ +CVAPI(const CvMat*) cvKalmanPredict( CvKalman* kalman, + const CvMat* control CV_DEFAULT(NULL)); + +/* Updates Kalman filter by measurement + (corrects state of the system and internal matrices) */ +CVAPI(const CvMat*) cvKalmanCorrect( CvKalman* kalman, const CvMat* measurement ); + +#define cvKalmanUpdateByTime cvKalmanPredict +#define cvKalmanUpdateByMeasurement cvKalmanCorrect + +/** @} video_c */ + +#ifdef __cplusplus +} // extern "C" +#endif + + +#endif // __OPENCV_TRACKING_C_H__ diff --git a/lib/opencv/include/opencv2/video/video.hpp b/lib/opencv/include/opencv2/video/video.hpp new file mode 100644 index 000000000..8267b85d5 --- /dev/null +++ b/lib/opencv/include/opencv2/video/video.hpp @@ -0,0 +1,48 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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*/ + +#ifdef __OPENCV_BUILD +#error this is a compatibility header which should not be used inside the OpenCV library +#endif + +#include "opencv2/video.hpp" diff --git a/lib/opencv/include/opencv2/videoio.hpp b/lib/opencv/include/opencv2/videoio.hpp new file mode 100644 index 000000000..ccd6c0637 --- /dev/null +++ b/lib/opencv/include/opencv2/videoio.hpp @@ -0,0 +1,680 @@ +/*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_VIDEOIO_HPP__ +#define __OPENCV_VIDEOIO_HPP__ + +#include "opencv2/core.hpp" + +/** + @defgroup videoio Media I/O + @{ + @defgroup videoio_c C API + @defgroup videoio_ios iOS glue + @defgroup videoio_winrt WinRT glue + @} +*/ + +////////////////////////////////// video io ///////////////////////////////// + +typedef struct CvCapture CvCapture; +typedef struct CvVideoWriter CvVideoWriter; + +namespace cv +{ + +//! @addtogroup videoio +//! @{ + +// Camera API +enum { CAP_ANY = 0, // autodetect + CAP_VFW = 200, // platform native + CAP_V4L = 200, + CAP_V4L2 = CAP_V4L, + CAP_FIREWARE = 300, // IEEE 1394 drivers + CAP_FIREWIRE = CAP_FIREWARE, + CAP_IEEE1394 = CAP_FIREWARE, + CAP_DC1394 = CAP_FIREWARE, + CAP_CMU1394 = CAP_FIREWARE, + CAP_QT = 500, // QuickTime + CAP_UNICAP = 600, // Unicap drivers + CAP_DSHOW = 700, // DirectShow (via videoInput) + CAP_PVAPI = 800, // PvAPI, Prosilica GigE SDK + CAP_OPENNI = 900, // OpenNI (for Kinect) + CAP_OPENNI_ASUS = 910, // OpenNI (for Asus Xtion) + CAP_ANDROID = 1000, // Android - not used + CAP_XIAPI = 1100, // XIMEA Camera API + CAP_AVFOUNDATION = 1200, // AVFoundation framework for iOS (OS X Lion will have the same API) + CAP_GIGANETIX = 1300, // Smartek Giganetix GigEVisionSDK + CAP_MSMF = 1400, // Microsoft Media Foundation (via videoInput) + CAP_WINRT = 1410, // Microsoft Windows Runtime using Media Foundation + CAP_INTELPERC = 1500, // Intel Perceptual Computing SDK + CAP_OPENNI2 = 1600, // OpenNI2 (for Kinect) + CAP_OPENNI2_ASUS = 1610, // OpenNI2 (for Asus Xtion and Occipital Structure sensors) + CAP_GPHOTO2 = 1700, // gPhoto2 connection + CAP_GSTREAMER = 1800, // GStreamer + CAP_FFMPEG = 1900, // FFMPEG + CAP_IMAGES = 2000 // OpenCV Image Sequence (e.g. img_%02d.jpg) + }; + +// generic properties (based on DC1394 properties) +enum { CAP_PROP_POS_MSEC =0, + CAP_PROP_POS_FRAMES =1, + CAP_PROP_POS_AVI_RATIO =2, + CAP_PROP_FRAME_WIDTH =3, + CAP_PROP_FRAME_HEIGHT =4, + CAP_PROP_FPS =5, + CAP_PROP_FOURCC =6, + CAP_PROP_FRAME_COUNT =7, + CAP_PROP_FORMAT =8, + CAP_PROP_MODE =9, + CAP_PROP_BRIGHTNESS =10, + CAP_PROP_CONTRAST =11, + CAP_PROP_SATURATION =12, + CAP_PROP_HUE =13, + CAP_PROP_GAIN =14, + CAP_PROP_EXPOSURE =15, + CAP_PROP_CONVERT_RGB =16, + CAP_PROP_WHITE_BALANCE_BLUE_U =17, + CAP_PROP_RECTIFICATION =18, + CAP_PROP_MONOCHROME =19, + CAP_PROP_SHARPNESS =20, + CAP_PROP_AUTO_EXPOSURE =21, // DC1394: exposure control done by camera, user can adjust refernce level using this feature + CAP_PROP_GAMMA =22, + CAP_PROP_TEMPERATURE =23, + CAP_PROP_TRIGGER =24, + CAP_PROP_TRIGGER_DELAY =25, + CAP_PROP_WHITE_BALANCE_RED_V =26, + CAP_PROP_ZOOM =27, + CAP_PROP_FOCUS =28, + CAP_PROP_GUID =29, + CAP_PROP_ISO_SPEED =30, + CAP_PROP_BACKLIGHT =32, + CAP_PROP_PAN =33, + CAP_PROP_TILT =34, + CAP_PROP_ROLL =35, + CAP_PROP_IRIS =36, + CAP_PROP_SETTINGS =37, + CAP_PROP_BUFFERSIZE =38, + CAP_PROP_AUTOFOCUS =39 + }; + + +// Generic camera output modes. +// Currently, these are supported through the libv4l interface only. +enum { CAP_MODE_BGR = 0, // BGR24 (default) + CAP_MODE_RGB = 1, // RGB24 + CAP_MODE_GRAY = 2, // Y8 + CAP_MODE_YUYV = 3 // YUYV + }; + + +// DC1394 only +// modes of the controlling registers (can be: auto, manual, auto single push, absolute Latter allowed with any other mode) +// every feature can have only one mode turned on at a time +enum { CAP_PROP_DC1394_OFF = -4, //turn the feature off (not controlled manually nor automatically) + CAP_PROP_DC1394_MODE_MANUAL = -3, //set automatically when a value of the feature is set by the user + CAP_PROP_DC1394_MODE_AUTO = -2, + CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO = -1, + CAP_PROP_DC1394_MAX = 31 + }; + + +// OpenNI map generators +enum { CAP_OPENNI_DEPTH_GENERATOR = 1 << 31, + CAP_OPENNI_IMAGE_GENERATOR = 1 << 30, + CAP_OPENNI_GENERATORS_MASK = CAP_OPENNI_DEPTH_GENERATOR + CAP_OPENNI_IMAGE_GENERATOR + }; + +// Properties of cameras available through OpenNI interfaces +enum { CAP_PROP_OPENNI_OUTPUT_MODE = 100, + CAP_PROP_OPENNI_FRAME_MAX_DEPTH = 101, // in mm + CAP_PROP_OPENNI_BASELINE = 102, // in mm + CAP_PROP_OPENNI_FOCAL_LENGTH = 103, // in pixels + CAP_PROP_OPENNI_REGISTRATION = 104, // flag that synchronizes the remapping depth map to image map + // by changing depth generator's view point (if the flag is "on") or + // sets this view point to its normal one (if the flag is "off"). + CAP_PROP_OPENNI_REGISTRATION_ON = CAP_PROP_OPENNI_REGISTRATION, + CAP_PROP_OPENNI_APPROX_FRAME_SYNC = 105, + CAP_PROP_OPENNI_MAX_BUFFER_SIZE = 106, + CAP_PROP_OPENNI_CIRCLE_BUFFER = 107, + CAP_PROP_OPENNI_MAX_TIME_DURATION = 108, + CAP_PROP_OPENNI_GENERATOR_PRESENT = 109, + CAP_PROP_OPENNI2_SYNC = 110, + CAP_PROP_OPENNI2_MIRROR = 111 + }; + +// OpenNI shortcats +enum { CAP_OPENNI_IMAGE_GENERATOR_PRESENT = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT, + CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_OUTPUT_MODE, + CAP_OPENNI_DEPTH_GENERATOR_BASELINE = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_BASELINE, + CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_FOCAL_LENGTH, + CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_REGISTRATION, + CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION + }; + +// OpenNI data given from depth generator +enum { CAP_OPENNI_DEPTH_MAP = 0, // Depth values in mm (CV_16UC1) + CAP_OPENNI_POINT_CLOUD_MAP = 1, // XYZ in meters (CV_32FC3) + CAP_OPENNI_DISPARITY_MAP = 2, // Disparity in pixels (CV_8UC1) + CAP_OPENNI_DISPARITY_MAP_32F = 3, // Disparity in pixels (CV_32FC1) + CAP_OPENNI_VALID_DEPTH_MASK = 4, // CV_8UC1 + + // Data given from RGB image generator + CAP_OPENNI_BGR_IMAGE = 5, + CAP_OPENNI_GRAY_IMAGE = 6 + }; + +// Supported output modes of OpenNI image generator +enum { CAP_OPENNI_VGA_30HZ = 0, + CAP_OPENNI_SXGA_15HZ = 1, + CAP_OPENNI_SXGA_30HZ = 2, + CAP_OPENNI_QVGA_30HZ = 3, + CAP_OPENNI_QVGA_60HZ = 4 + }; + + +// GStreamer +enum { CAP_PROP_GSTREAMER_QUEUE_LENGTH = 200 // default is 1 + }; + + +// PVAPI +enum { CAP_PROP_PVAPI_MULTICASTIP = 300, // ip for anable multicast master mode. 0 for disable multicast + CAP_PROP_PVAPI_FRAMESTARTTRIGGERMODE = 301, // FrameStartTriggerMode: Determines how a frame is initiated + CAP_PROP_PVAPI_DECIMATIONHORIZONTAL = 302, // Horizontal sub-sampling of the image + CAP_PROP_PVAPI_DECIMATIONVERTICAL = 303, // Vertical sub-sampling of the image + CAP_PROP_PVAPI_BINNINGX = 304, // Horizontal binning factor + CAP_PROP_PVAPI_BINNINGY = 305, // Vertical binning factor + CAP_PROP_PVAPI_PIXELFORMAT = 306 // Pixel format + }; + +// PVAPI: FrameStartTriggerMode +enum { CAP_PVAPI_FSTRIGMODE_FREERUN = 0, // Freerun + CAP_PVAPI_FSTRIGMODE_SYNCIN1 = 1, // SyncIn1 + CAP_PVAPI_FSTRIGMODE_SYNCIN2 = 2, // SyncIn2 + CAP_PVAPI_FSTRIGMODE_FIXEDRATE = 3, // FixedRate + CAP_PVAPI_FSTRIGMODE_SOFTWARE = 4 // Software + }; + +// PVAPI: DecimationHorizontal, DecimationVertical +enum { CAP_PVAPI_DECIMATION_OFF = 1, // Off + CAP_PVAPI_DECIMATION_2OUTOF4 = 2, // 2 out of 4 decimation + CAP_PVAPI_DECIMATION_2OUTOF8 = 4, // 2 out of 8 decimation + CAP_PVAPI_DECIMATION_2OUTOF16 = 8 // 2 out of 16 decimation + }; + +// PVAPI: PixelFormat +enum { CAP_PVAPI_PIXELFORMAT_MONO8 = 1, // Mono8 + CAP_PVAPI_PIXELFORMAT_MONO16 = 2, // Mono16 + CAP_PVAPI_PIXELFORMAT_BAYER8 = 3, // Bayer8 + CAP_PVAPI_PIXELFORMAT_BAYER16 = 4, // Bayer16 + CAP_PVAPI_PIXELFORMAT_RGB24 = 5, // Rgb24 + CAP_PVAPI_PIXELFORMAT_BGR24 = 6, // Bgr24 + CAP_PVAPI_PIXELFORMAT_RGBA32 = 7, // Rgba32 + CAP_PVAPI_PIXELFORMAT_BGRA32 = 8, // Bgra32 + }; + +// Properties of cameras available through XIMEA SDK interface +enum { CAP_PROP_XI_DOWNSAMPLING = 400, // Change image resolution by binning or skipping. + CAP_PROP_XI_DATA_FORMAT = 401, // Output data format. + CAP_PROP_XI_OFFSET_X = 402, // Horizontal offset from the origin to the area of interest (in pixels). + CAP_PROP_XI_OFFSET_Y = 403, // Vertical offset from the origin to the area of interest (in pixels). + CAP_PROP_XI_TRG_SOURCE = 404, // Defines source of trigger. + CAP_PROP_XI_TRG_SOFTWARE = 405, // Generates an internal trigger. PRM_TRG_SOURCE must be set to TRG_SOFTWARE. + CAP_PROP_XI_GPI_SELECTOR = 406, // Selects general purpose input + CAP_PROP_XI_GPI_MODE = 407, // Set general purpose input mode + CAP_PROP_XI_GPI_LEVEL = 408, // Get general purpose level + CAP_PROP_XI_GPO_SELECTOR = 409, // Selects general purpose output + CAP_PROP_XI_GPO_MODE = 410, // Set general purpose output mode + CAP_PROP_XI_LED_SELECTOR = 411, // Selects camera signalling LED + CAP_PROP_XI_LED_MODE = 412, // Define camera signalling LED functionality + CAP_PROP_XI_MANUAL_WB = 413, // Calculates White Balance(must be called during acquisition) + CAP_PROP_XI_AUTO_WB = 414, // Automatic white balance + CAP_PROP_XI_AEAG = 415, // Automatic exposure/gain + CAP_PROP_XI_EXP_PRIORITY = 416, // Exposure priority (0.5 - exposure 50%, gain 50%). + CAP_PROP_XI_AE_MAX_LIMIT = 417, // Maximum limit of exposure in AEAG procedure + CAP_PROP_XI_AG_MAX_LIMIT = 418, // Maximum limit of gain in AEAG procedure + CAP_PROP_XI_AEAG_LEVEL = 419, // Average intensity of output signal AEAG should achieve(in %) + CAP_PROP_XI_TIMEOUT = 420 // Image capture timeout in milliseconds + }; + +// Properties of cameras available through AVFOUNDATION interface +enum { CAP_PROP_IOS_DEVICE_FOCUS = 9001, + CAP_PROP_IOS_DEVICE_EXPOSURE = 9002, + CAP_PROP_IOS_DEVICE_FLASH = 9003, + CAP_PROP_IOS_DEVICE_WHITEBALANCE = 9004, + CAP_PROP_IOS_DEVICE_TORCH = 9005 + }; + + +// Properties of cameras available through Smartek Giganetix Ethernet Vision interface +/* --- Vladimir Litvinenko (litvinenko.vladimir@gmail.com) --- */ +enum { CAP_PROP_GIGA_FRAME_OFFSET_X = 10001, + CAP_PROP_GIGA_FRAME_OFFSET_Y = 10002, + CAP_PROP_GIGA_FRAME_WIDTH_MAX = 10003, + CAP_PROP_GIGA_FRAME_HEIGH_MAX = 10004, + CAP_PROP_GIGA_FRAME_SENS_WIDTH = 10005, + CAP_PROP_GIGA_FRAME_SENS_HEIGH = 10006 + }; + +enum { CAP_PROP_INTELPERC_PROFILE_COUNT = 11001, + CAP_PROP_INTELPERC_PROFILE_IDX = 11002, + CAP_PROP_INTELPERC_DEPTH_LOW_CONFIDENCE_VALUE = 11003, + CAP_PROP_INTELPERC_DEPTH_SATURATION_VALUE = 11004, + CAP_PROP_INTELPERC_DEPTH_CONFIDENCE_THRESHOLD = 11005, + CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_HORZ = 11006, + CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_VERT = 11007 + }; + +// Intel PerC streams +enum { CAP_INTELPERC_DEPTH_GENERATOR = 1 << 29, + CAP_INTELPERC_IMAGE_GENERATOR = 1 << 28, + CAP_INTELPERC_GENERATORS_MASK = CAP_INTELPERC_DEPTH_GENERATOR + CAP_INTELPERC_IMAGE_GENERATOR + }; + +enum { CAP_INTELPERC_DEPTH_MAP = 0, // Each pixel is a 16-bit integer. The value indicates the distance from an object to the camera's XY plane or the Cartesian depth. + CAP_INTELPERC_UVDEPTH_MAP = 1, // Each pixel contains two 32-bit floating point values in the range of 0-1, representing the mapping of depth coordinates to the color coordinates. + CAP_INTELPERC_IR_MAP = 2, // Each pixel is a 16-bit integer. The value indicates the intensity of the reflected laser beam. + CAP_INTELPERC_IMAGE = 3 + }; + +enum { VIDEOWRITER_PROP_QUALITY = 1, // Quality (0..100%) of the videostream encoded + VIDEOWRITER_PROP_FRAMEBYTES = 2, // (Read-only): Size of just encoded video frame + VIDEOWRITER_PROP_NSTRIPES = 3 // Number of stripes for parallel encoding. -1 for auto detection + }; + +// gPhoto2 properties, if propertyId is less than 0 then work on widget with that __additive inversed__ camera setting ID +// Get IDs by using CAP_PROP_GPHOTO2_WIDGET_ENUMERATE. +// @see CvCaptureCAM_GPHOTO2 for more info +enum { CAP_PROP_GPHOTO2_PREVIEW = 17001, // Capture only preview from liveview mode. + CAP_PROP_GPHOTO2_WIDGET_ENUMERATE = 17002, // Readonly, returns (const char *). + CAP_PROP_GPHOTO2_RELOAD_CONFIG = 17003, // Trigger, only by set. Reload camera settings. + CAP_PROP_GPHOTO2_RELOAD_ON_CHANGE = 17004, // Reload all settings on set. + CAP_PROP_GPHOTO2_COLLECT_MSGS = 17005, // Collect messages with details. + CAP_PROP_GPHOTO2_FLUSH_MSGS = 17006, // Readonly, returns (const char *). + CAP_PROP_SPEED = 17007, // Exposure speed. Can be readonly, depends on camera program. + CAP_PROP_APERTURE = 17008, // Aperture. Can be readonly, depends on camera program. + CAP_PROP_EXPOSUREPROGRAM = 17009, // Camera exposure program. + CAP_PROP_VIEWFINDER = 17010 // Enter liveview mode. + }; + +//enum { + +class IVideoCapture; + +/** @brief Class for video capturing from video files, image sequences or cameras. The class provides C++ API +for capturing video from cameras or for reading video files and image sequences. Here is how the +class can be used: : +@code + #include "opencv2/opencv.hpp" + + using namespace cv; + + int main(int, char**) + { + VideoCapture cap(0); // open the default camera + if(!cap.isOpened()) // check if we succeeded + return -1; + + Mat edges; + namedWindow("edges",1); + for(;;) + { + Mat frame; + cap >> frame; // get a new frame from camera + cvtColor(frame, edges, COLOR_BGR2GRAY); + GaussianBlur(edges, edges, Size(7,7), 1.5, 1.5); + Canny(edges, edges, 0, 30, 3); + imshow("edges", edges); + if(waitKey(30) >= 0) break; + } + // the camera will be deinitialized automatically in VideoCapture destructor + return 0; + } +@endcode +@note In C API the black-box structure CvCapture is used instead of VideoCapture. + +@note +- A basic sample on using the VideoCapture interface can be found at + opencv_source_code/samples/cpp/starter_video.cpp +- Another basic video processing sample can be found at + opencv_source_code/samples/cpp/video_dmtx.cpp +- (Python) A basic sample on using the VideoCapture interface can be found at + opencv_source_code/samples/python/video.py +- (Python) Another basic video processing sample can be found at + opencv_source_code/samples/python/video_dmtx.py +- (Python) A multi threaded video processing sample can be found at + opencv_source_code/samples/python/video_threaded.py + */ +class CV_EXPORTS_W VideoCapture +{ +public: + /** @brief + @note In C API, when you finished working with video, release CvCapture structure with + cvReleaseCapture(), or use Ptr\ that calls cvReleaseCapture() automatically in the + destructor. + */ + CV_WRAP VideoCapture(); + + /** @overload + @param filename name of the opened video file (eg. video.avi) or image sequence (eg. + img_%02d.jpg, which will read samples like img_00.jpg, img_01.jpg, img_02.jpg, ...) + */ + CV_WRAP VideoCapture(const String& filename); + + /** @overload + @param filename name of the opened video file (eg. video.avi) or image sequence (eg. + img_%02d.jpg, which will read samples like img_00.jpg, img_01.jpg, img_02.jpg, ...) + + @param apiPreference preferred Capture API to use. Can be used to enforce a specific reader + implementation if multiple are available: e.g. CAP_FFMPEG or CAP_IMAGES + */ + CV_WRAP VideoCapture(const String& filename, int apiPreference); + + /** @overload + @param index = camera_id + domain_offset (CAP_*). id of the video capturing device to open. If there is a single + camera connected, just pass 0. Advanced Usage: to open Camera 1 using the MS Media Foundation API: index = 1 + CAP_MSMF + */ + CV_WRAP VideoCapture(int index); + + virtual ~VideoCapture(); + + /** @brief Open video file or a capturing device for video capturing + + @param filename name of the opened video file (eg. video.avi) or image sequence (eg. + img_%02d.jpg, which will read samples like img_00.jpg, img_01.jpg, img_02.jpg, ...) + + The methods first call VideoCapture::release to close the already opened file or camera. + */ + CV_WRAP virtual bool open(const String& filename); + + /** @overload + @param index = camera_id + domain_offset (CAP_*). id of the video capturing device to open. If there is a single + camera connected, just pass 0. Advanced Usage: to open Camera 1 using the MS Media Foundation API: index = 1 + CAP_MSMF + */ + CV_WRAP virtual bool open(int index); + + /** @brief Returns true if video capturing has been initialized already. + + If the previous call to VideoCapture constructor or VideoCapture::open succeeded, the method returns + true. + */ + CV_WRAP virtual bool isOpened() const; + + /** @brief Closes video file or capturing device. + + The methods are automatically called by subsequent VideoCapture::open and by VideoCapture + destructor. + + The C function also deallocates memory and clears \*capture pointer. + */ + CV_WRAP virtual void release(); + + /** @brief Grabs the next frame from video file or capturing device. + + The methods/functions grab the next frame from video file or camera and return true (non-zero) in + the case of success. + + The primary use of the function is in multi-camera environments, especially when the cameras do not + have hardware synchronization. That is, you call VideoCapture::grab() for each camera and after that + call the slower method VideoCapture::retrieve() to decode and get frame from each camera. This way + the overhead on demosaicing or motion jpeg decompression etc. is eliminated and the retrieved frames + from different cameras will be closer in time. + + Also, when a connected camera is multi-head (for example, a stereo camera or a Kinect device), the + correct way of retrieving data from it is to call VideoCapture::grab first and then call + VideoCapture::retrieve one or more times with different values of the channel parameter. See + + */ + CV_WRAP virtual bool grab(); + + /** @brief Decodes and returns the grabbed video frame. + + The methods/functions decode and return the just grabbed frame. If no frames has been grabbed + (camera has been disconnected, or there are no more frames in video file), the methods return false + and the functions return NULL pointer. + + @note OpenCV 1.x functions cvRetrieveFrame and cv.RetrieveFrame return image stored inside the video + capturing structure. It is not allowed to modify or release the image! You can copy the frame using + :ocvcvCloneImage and then do whatever you want with the copy. + */ + CV_WRAP virtual bool retrieve(OutputArray image, int flag = 0); + virtual VideoCapture& operator >> (CV_OUT Mat& image); + virtual VideoCapture& operator >> (CV_OUT UMat& image); + + /** @brief Grabs, decodes and returns the next video frame. + + The methods/functions combine VideoCapture::grab and VideoCapture::retrieve in one call. This is the + most convenient method for reading video files or capturing data from decode and return the just + grabbed frame. If no frames has been grabbed (camera has been disconnected, or there are no more + frames in video file), the methods return false and the functions return NULL pointer. + + @note OpenCV 1.x functions cvRetrieveFrame and cv.RetrieveFrame return image stored inside the video + capturing structure. It is not allowed to modify or release the image! You can copy the frame using + :ocvcvCloneImage and then do whatever you want with the copy. + */ + CV_WRAP virtual bool read(OutputArray image); + + /** @brief Sets a property in the VideoCapture. + + @param propId Property identifier. It can be one of the following: + - **CAP_PROP_POS_MSEC** Current position of the video file in milliseconds. + - **CAP_PROP_POS_FRAMES** 0-based index of the frame to be decoded/captured next. + - **CAP_PROP_POS_AVI_RATIO** Relative position of the video file: 0 - start of the + film, 1 - end of the film. + - **CAP_PROP_FRAME_WIDTH** Width of the frames in the video stream. + - **CAP_PROP_FRAME_HEIGHT** Height of the frames in the video stream. + - **CAP_PROP_FPS** Frame rate. + - **CAP_PROP_FOURCC** 4-character code of codec. + - **CAP_PROP_FRAME_COUNT** Number of frames in the video file. + - **CAP_PROP_FORMAT** Format of the Mat objects returned by retrieve() . + - **CAP_PROP_MODE** Backend-specific value indicating the current capture mode. + - **CAP_PROP_BRIGHTNESS** Brightness of the image (only for cameras). + - **CAP_PROP_CONTRAST** Contrast of the image (only for cameras). + - **CAP_PROP_SATURATION** Saturation of the image (only for cameras). + - **CAP_PROP_HUE** Hue of the image (only for cameras). + - **CAP_PROP_GAIN** Gain of the image (only for cameras). + - **CAP_PROP_EXPOSURE** Exposure (only for cameras). + - **CAP_PROP_CONVERT_RGB** Boolean flags indicating whether images should be converted + to RGB. + - **CAP_PROP_WHITE_BALANCE** Currently unsupported + - **CAP_PROP_RECTIFICATION** Rectification flag for stereo cameras (note: only supported + by DC1394 v 2.x backend currently) + @param value Value of the property. + */ + CV_WRAP virtual bool set(int propId, double value); + + /** @brief Returns the specified VideoCapture property + + @param propId Property identifier. It can be one of the following: + - **CAP_PROP_POS_MSEC** Current position of the video file in milliseconds or video + capture timestamp. + - **CAP_PROP_POS_FRAMES** 0-based index of the frame to be decoded/captured next. + - **CAP_PROP_POS_AVI_RATIO** Relative position of the video file: 0 - start of the + film, 1 - end of the film. + - **CAP_PROP_FRAME_WIDTH** Width of the frames in the video stream. + - **CAP_PROP_FRAME_HEIGHT** Height of the frames in the video stream. + - **CAP_PROP_FPS** Frame rate. + - **CAP_PROP_FOURCC** 4-character code of codec. + - **CAP_PROP_FRAME_COUNT** Number of frames in the video file. + - **CAP_PROP_FORMAT** Format of the Mat objects returned by retrieve() . + - **CAP_PROP_MODE** Backend-specific value indicating the current capture mode. + - **CAP_PROP_BRIGHTNESS** Brightness of the image (only for cameras). + - **CAP_PROP_CONTRAST** Contrast of the image (only for cameras). + - **CAP_PROP_SATURATION** Saturation of the image (only for cameras). + - **CAP_PROP_HUE** Hue of the image (only for cameras). + - **CAP_PROP_GAIN** Gain of the image (only for cameras). + - **CAP_PROP_EXPOSURE** Exposure (only for cameras). + - **CAP_PROP_CONVERT_RGB** Boolean flags indicating whether images should be converted + to RGB. + - **CAP_PROP_WHITE_BALANCE** Currently not supported + - **CAP_PROP_RECTIFICATION** Rectification flag for stereo cameras (note: only supported + by DC1394 v 2.x backend currently) + + @note When querying a property that is not supported by the backend used by the VideoCapture + class, value 0 is returned. + */ + CV_WRAP virtual double get(int propId) const; + + /** @overload + + @param filename name of the opened video file (eg. video.avi) or image sequence (eg. + img_%02d.jpg, which will read samples like img_00.jpg, img_01.jpg, img_02.jpg, ...) + + @param apiPreference preferred Capture API to use. Can be used to enforce a specific reader + implementation if multiple are available: e.g. CAP_FFMPEG or CAP_IMAGES + + The methods first call VideoCapture::release to close the already opened file or camera. + */ + CV_WRAP virtual bool open(const String& filename, int apiPreference); + +protected: + Ptr cap; + Ptr icap; +}; + +class IVideoWriter; + +/** @brief Video writer class. + */ +class CV_EXPORTS_W VideoWriter +{ +public: + /** @brief VideoWriter constructors + + The constructors/functions initialize video writers. On Linux FFMPEG is used to write videos; on + Windows FFMPEG or VFW is used; on MacOSX QTKit is used. + */ + CV_WRAP VideoWriter(); + + /** @overload + @param filename Name of the output video file. + @param fourcc 4-character code of codec used to compress the frames. For example, + VideoWriter::fourcc('P','I','M','1') is a MPEG-1 codec, VideoWriter::fourcc('M','J','P','G') is a + motion-jpeg codec etc. List of codes can be obtained at [Video Codecs by + FOURCC](http://www.fourcc.org/codecs.php) page. FFMPEG backend with MP4 container natively uses + other values as fourcc code: see [ObjectType](http://www.mp4ra.org/codecs.html), + so you may receive a warning message from OpenCV about fourcc code conversion. + @param fps Framerate of the created video stream. + @param frameSize Size of the video frames. + @param isColor If it is not zero, the encoder will expect and encode color frames, otherwise it + will work with grayscale frames (the flag is currently supported on Windows only). + */ + CV_WRAP VideoWriter(const String& filename, int fourcc, double fps, + Size frameSize, bool isColor = true); + + virtual ~VideoWriter(); + + /** @brief Initializes or reinitializes video writer. + + The method opens video writer. Parameters are the same as in the constructor + VideoWriter::VideoWriter. + */ + CV_WRAP virtual bool open(const String& filename, int fourcc, double fps, + Size frameSize, bool isColor = true); + + /** @brief Returns true if video writer has been successfully initialized. + */ + CV_WRAP virtual bool isOpened() const; + + /** @brief Closes the video writer. + + The methods are automatically called by subsequent VideoWriter::open and by the VideoWriter + destructor. + */ + CV_WRAP virtual void release(); + virtual VideoWriter& operator << (const Mat& image); + + /** @brief Writes the next video frame + + @param image The written frame + + The functions/methods write the specified image to video file. It must have the same size as has + been specified when opening the video writer. + */ + CV_WRAP virtual void write(const Mat& image); + + /** @brief Sets a property in the VideoWriter. + + @param propId Property identifier. It can be one of the following: + - **VIDEOWRITER_PROP_QUALITY** Quality (0..100%) of the videostream encoded. Can be adjusted dynamically in some codecs. + - **VIDEOWRITER_PROP_NSTRIPES** Number of stripes for parallel encoding + @param value Value of the property. + */ + CV_WRAP virtual bool set(int propId, double value); + + /** @brief Returns the specified VideoWriter property + + @param propId Property identifier. It can be one of the following: + - **VIDEOWRITER_PROP_QUALITY** Current quality of the encoded videostream. + - **VIDEOWRITER_PROP_FRAMEBYTES** (Read-only) Size of just encoded video frame; note that the encoding order may be different from representation order. + - **VIDEOWRITER_PROP_NSTRIPES** Number of stripes for parallel encoding + + @note When querying a property that is not supported by the backend used by the VideoWriter + class, value 0 is returned. + */ + CV_WRAP virtual double get(int propId) const; + + /** @brief Concatenates 4 chars to a fourcc code + + This static method constructs the fourcc code of the codec to be used in the constructor + VideoWriter::VideoWriter or VideoWriter::open. + */ + CV_WRAP static int fourcc(char c1, char c2, char c3, char c4); + +protected: + Ptr writer; + Ptr iwriter; + + static Ptr create(const String& filename, int fourcc, double fps, + Size frameSize, bool isColor = true); +}; + +template<> CV_EXPORTS void DefaultDeleter::operator ()(CvCapture* obj) const; +template<> CV_EXPORTS void DefaultDeleter::operator ()(CvVideoWriter* obj) const; + +//! @} videoio + +} // cv + +#endif //__OPENCV_VIDEOIO_HPP__ diff --git a/lib/opencv/include/opencv2/videoio/cap_ios.h b/lib/opencv/include/opencv2/videoio/cap_ios.h new file mode 100644 index 000000000..1a9875b25 --- /dev/null +++ b/lib/opencv/include/opencv2/videoio/cap_ios.h @@ -0,0 +1,176 @@ +/* For iOS video I/O + * by Eduard Feicho on 29/07/12 + * Copyright 2012. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions 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. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "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 AUTHOR 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. + * + */ + +#import +#import +#import +#import +#include "opencv2/core.hpp" + +//! @addtogroup videoio_ios +//! @{ + +/////////////////////////////////////// CvAbstractCamera ///////////////////////////////////// + +@class CvAbstractCamera; + +@interface CvAbstractCamera : NSObject +{ + AVCaptureSession* captureSession; + AVCaptureConnection* videoCaptureConnection; + AVCaptureVideoPreviewLayer *captureVideoPreviewLayer; + + UIDeviceOrientation currentDeviceOrientation; + + BOOL cameraAvailable; + BOOL captureSessionLoaded; + BOOL running; + BOOL useAVCaptureVideoPreviewLayer; + + AVCaptureDevicePosition defaultAVCaptureDevicePosition; + AVCaptureVideoOrientation defaultAVCaptureVideoOrientation; + NSString *const defaultAVCaptureSessionPreset; + + int defaultFPS; + + UIView* parentView; + + int imageWidth; + int imageHeight; +} + +@property (nonatomic, retain) AVCaptureSession* captureSession; +@property (nonatomic, retain) AVCaptureConnection* videoCaptureConnection; + +@property (nonatomic, readonly) BOOL running; +@property (nonatomic, readonly) BOOL captureSessionLoaded; + +@property (nonatomic, assign) int defaultFPS; +@property (nonatomic, readonly) AVCaptureVideoPreviewLayer *captureVideoPreviewLayer; +@property (nonatomic, assign) AVCaptureDevicePosition defaultAVCaptureDevicePosition; +@property (nonatomic, assign) AVCaptureVideoOrientation defaultAVCaptureVideoOrientation; +@property (nonatomic, assign) BOOL useAVCaptureVideoPreviewLayer; +@property (nonatomic, strong) NSString *const defaultAVCaptureSessionPreset; + +@property (nonatomic, assign) int imageWidth; +@property (nonatomic, assign) int imageHeight; + +@property (nonatomic, retain) UIView* parentView; + +- (void)start; +- (void)stop; +- (void)switchCameras; + +- (id)initWithParentView:(UIView*)parent; + +- (void)createCaptureOutput; +- (void)createVideoPreviewLayer; +- (void)updateOrientation; + +- (void)lockFocus; +- (void)unlockFocus; +- (void)lockExposure; +- (void)unlockExposure; +- (void)lockBalance; +- (void)unlockBalance; + +@end + +///////////////////////////////// CvVideoCamera /////////////////////////////////////////// + +@class CvVideoCamera; + +@protocol CvVideoCameraDelegate + +#ifdef __cplusplus +// delegate method for processing image frames +- (void)processImage:(cv::Mat&)image; +#endif + +@end + +@interface CvVideoCamera : CvAbstractCamera +{ + AVCaptureVideoDataOutput *videoDataOutput; + + dispatch_queue_t videoDataOutputQueue; + CALayer *customPreviewLayer; + + BOOL grayscaleMode; + + BOOL recordVideo; + BOOL rotateVideo; + AVAssetWriterInput* recordAssetWriterInput; + AVAssetWriterInputPixelBufferAdaptor* recordPixelBufferAdaptor; + AVAssetWriter* recordAssetWriter; + + CMTime lastSampleTime; + +} + +@property (nonatomic, assign) id delegate; +@property (nonatomic, assign) BOOL grayscaleMode; + +@property (nonatomic, assign) BOOL recordVideo; +@property (nonatomic, assign) BOOL rotateVideo; +@property (nonatomic, retain) AVAssetWriterInput* recordAssetWriterInput; +@property (nonatomic, retain) AVAssetWriterInputPixelBufferAdaptor* recordPixelBufferAdaptor; +@property (nonatomic, retain) AVAssetWriter* recordAssetWriter; + +- (void)adjustLayoutToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation; +- (void)layoutPreviewLayer; +- (void)saveVideo; +- (NSURL *)videoFileURL; +- (NSString *)videoFileString; + + +@end + +///////////////////////////////// CvPhotoCamera /////////////////////////////////////////// + +@class CvPhotoCamera; + +@protocol CvPhotoCameraDelegate + +- (void)photoCamera:(CvPhotoCamera*)photoCamera capturedImage:(UIImage *)image; +- (void)photoCameraCancel:(CvPhotoCamera*)photoCamera; + +@end + +@interface CvPhotoCamera : CvAbstractCamera +{ + AVCaptureStillImageOutput *stillImageOutput; +} + +@property (nonatomic, assign) id delegate; + +- (void)takePicture; + +@end + +//! @} videoio_ios diff --git a/lib/opencv/include/opencv2/videoio/videoio.hpp b/lib/opencv/include/opencv2/videoio/videoio.hpp new file mode 100644 index 000000000..ec84cf7a6 --- /dev/null +++ b/lib/opencv/include/opencv2/videoio/videoio.hpp @@ -0,0 +1,48 @@ +/*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. +// Copyright (C) 2013, OpenCV Foundation, 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*/ + +#ifdef __OPENCV_BUILD +#error this is a compatibility header which should not be used inside the OpenCV library +#endif + +#include "opencv2/videoio.hpp" diff --git a/lib/opencv/include/opencv2/videoio/videoio_c.h b/lib/opencv/include/opencv2/videoio/videoio_c.h new file mode 100644 index 000000000..47f46fa76 --- /dev/null +++ b/lib/opencv/include/opencv2/videoio/videoio_c.h @@ -0,0 +1,533 @@ +/*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_VIDEOIO_H__ +#define __OPENCV_VIDEOIO_H__ + +#include "opencv2/core/core_c.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + @addtogroup videoio_c + @{ +*/ + +/****************************************************************************************\ +* Working with Video Files and Cameras * +\****************************************************************************************/ + +/* "black box" capture structure */ +typedef struct CvCapture CvCapture; + +/* start capturing frames from video file */ +CVAPI(CvCapture*) cvCreateFileCapture( const char* filename ); + +/* start capturing frames from video file. allows specifying a preferred API to use */ +CVAPI(CvCapture*) cvCreateFileCaptureWithPreference( const char* filename , int apiPreference); + +enum +{ + CV_CAP_ANY =0, // autodetect + + CV_CAP_MIL =100, // MIL proprietary drivers + + CV_CAP_VFW =200, // platform native + CV_CAP_V4L =200, + CV_CAP_V4L2 =200, + + CV_CAP_FIREWARE =300, // IEEE 1394 drivers + CV_CAP_FIREWIRE =300, + CV_CAP_IEEE1394 =300, + CV_CAP_DC1394 =300, + CV_CAP_CMU1394 =300, + + CV_CAP_STEREO =400, // TYZX proprietary drivers + CV_CAP_TYZX =400, + CV_TYZX_LEFT =400, + CV_TYZX_RIGHT =401, + CV_TYZX_COLOR =402, + CV_TYZX_Z =403, + + CV_CAP_QT =500, // QuickTime + + CV_CAP_UNICAP =600, // Unicap drivers + + CV_CAP_DSHOW =700, // DirectShow (via videoInput) + CV_CAP_MSMF =1400, // Microsoft Media Foundation (via videoInput) + + CV_CAP_PVAPI =800, // PvAPI, Prosilica GigE SDK + + CV_CAP_OPENNI =900, // OpenNI (for Kinect) + CV_CAP_OPENNI_ASUS =910, // OpenNI (for Asus Xtion) + + CV_CAP_ANDROID =1000, // Android - not used + CV_CAP_ANDROID_BACK =CV_CAP_ANDROID+99, // Android back camera - not used + CV_CAP_ANDROID_FRONT =CV_CAP_ANDROID+98, // Android front camera - not used + + CV_CAP_XIAPI =1100, // XIMEA Camera API + + CV_CAP_AVFOUNDATION = 1200, // AVFoundation framework for iOS (OS X Lion will have the same API) + + CV_CAP_GIGANETIX = 1300, // Smartek Giganetix GigEVisionSDK + + CV_CAP_INTELPERC = 1500, // Intel Perceptual Computing + + CV_CAP_OPENNI2 = 1600, // OpenNI2 (for Kinect) + CV_CAP_GPHOTO2 = 1700, + CV_CAP_GSTREAMER = 1800, // GStreamer + CV_CAP_FFMPEG = 1900, // FFMPEG + CV_CAP_IMAGES = 2000 // OpenCV Image Sequence (e.g. img_%02d.jpg) +}; + +/* start capturing frames from camera: index = camera_index + domain_offset (CV_CAP_*) */ +CVAPI(CvCapture*) cvCreateCameraCapture( int index ); + +/* grab a frame, return 1 on success, 0 on fail. + this function is thought to be fast */ +CVAPI(int) cvGrabFrame( CvCapture* capture ); + +/* get the frame grabbed with cvGrabFrame(..) + This function may apply some frame processing like + frame decompression, flipping etc. + !!!DO NOT RELEASE or MODIFY the retrieved frame!!! */ +CVAPI(IplImage*) cvRetrieveFrame( CvCapture* capture, int streamIdx CV_DEFAULT(0) ); + +/* Just a combination of cvGrabFrame and cvRetrieveFrame + !!!DO NOT RELEASE or MODIFY the retrieved frame!!! */ +CVAPI(IplImage*) cvQueryFrame( CvCapture* capture ); + +/* stop capturing/reading and free resources */ +CVAPI(void) cvReleaseCapture( CvCapture** capture ); + +enum +{ + // modes of the controlling registers (can be: auto, manual, auto single push, absolute Latter allowed with any other mode) + // every feature can have only one mode turned on at a time + CV_CAP_PROP_DC1394_OFF = -4, //turn the feature off (not controlled manually nor automatically) + CV_CAP_PROP_DC1394_MODE_MANUAL = -3, //set automatically when a value of the feature is set by the user + CV_CAP_PROP_DC1394_MODE_AUTO = -2, + CV_CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO = -1, + CV_CAP_PROP_POS_MSEC =0, + CV_CAP_PROP_POS_FRAMES =1, + CV_CAP_PROP_POS_AVI_RATIO =2, + CV_CAP_PROP_FRAME_WIDTH =3, + CV_CAP_PROP_FRAME_HEIGHT =4, + CV_CAP_PROP_FPS =5, + CV_CAP_PROP_FOURCC =6, + CV_CAP_PROP_FRAME_COUNT =7, + CV_CAP_PROP_FORMAT =8, + CV_CAP_PROP_MODE =9, + CV_CAP_PROP_BRIGHTNESS =10, + CV_CAP_PROP_CONTRAST =11, + CV_CAP_PROP_SATURATION =12, + CV_CAP_PROP_HUE =13, + CV_CAP_PROP_GAIN =14, + CV_CAP_PROP_EXPOSURE =15, + CV_CAP_PROP_CONVERT_RGB =16, + CV_CAP_PROP_WHITE_BALANCE_BLUE_U =17, + CV_CAP_PROP_RECTIFICATION =18, + CV_CAP_PROP_MONOCHROME =19, + CV_CAP_PROP_SHARPNESS =20, + CV_CAP_PROP_AUTO_EXPOSURE =21, // exposure control done by camera, + // user can adjust refernce level + // using this feature + CV_CAP_PROP_GAMMA =22, + CV_CAP_PROP_TEMPERATURE =23, + CV_CAP_PROP_TRIGGER =24, + CV_CAP_PROP_TRIGGER_DELAY =25, + CV_CAP_PROP_WHITE_BALANCE_RED_V =26, + CV_CAP_PROP_ZOOM =27, + CV_CAP_PROP_FOCUS =28, + CV_CAP_PROP_GUID =29, + CV_CAP_PROP_ISO_SPEED =30, + CV_CAP_PROP_MAX_DC1394 =31, + CV_CAP_PROP_BACKLIGHT =32, + CV_CAP_PROP_PAN =33, + CV_CAP_PROP_TILT =34, + CV_CAP_PROP_ROLL =35, + CV_CAP_PROP_IRIS =36, + CV_CAP_PROP_SETTINGS =37, + CV_CAP_PROP_BUFFERSIZE =38, + CV_CAP_PROP_AUTOFOCUS =39, + CV_CAP_PROP_SAR_NUM =40, + CV_CAP_PROP_SAR_DEN =41, + + CV_CAP_PROP_AUTOGRAB =1024, // property for videoio class CvCapture_Android only + CV_CAP_PROP_SUPPORTED_PREVIEW_SIZES_STRING=1025, // readonly, tricky property, returns cpnst char* indeed + CV_CAP_PROP_PREVIEW_FORMAT=1026, // readonly, tricky property, returns cpnst char* indeed + + // OpenNI map generators + CV_CAP_OPENNI_DEPTH_GENERATOR = 1 << 31, + CV_CAP_OPENNI_IMAGE_GENERATOR = 1 << 30, + CV_CAP_OPENNI_GENERATORS_MASK = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_OPENNI_IMAGE_GENERATOR, + + // Properties of cameras available through OpenNI interfaces + CV_CAP_PROP_OPENNI_OUTPUT_MODE = 100, + CV_CAP_PROP_OPENNI_FRAME_MAX_DEPTH = 101, // in mm + CV_CAP_PROP_OPENNI_BASELINE = 102, // in mm + CV_CAP_PROP_OPENNI_FOCAL_LENGTH = 103, // in pixels + CV_CAP_PROP_OPENNI_REGISTRATION = 104, // flag + CV_CAP_PROP_OPENNI_REGISTRATION_ON = CV_CAP_PROP_OPENNI_REGISTRATION, // flag that synchronizes the remapping depth map to image map + // by changing depth generator's view point (if the flag is "on") or + // sets this view point to its normal one (if the flag is "off"). + CV_CAP_PROP_OPENNI_APPROX_FRAME_SYNC = 105, + CV_CAP_PROP_OPENNI_MAX_BUFFER_SIZE = 106, + CV_CAP_PROP_OPENNI_CIRCLE_BUFFER = 107, + CV_CAP_PROP_OPENNI_MAX_TIME_DURATION = 108, + + CV_CAP_PROP_OPENNI_GENERATOR_PRESENT = 109, + CV_CAP_PROP_OPENNI2_SYNC = 110, + CV_CAP_PROP_OPENNI2_MIRROR = 111, + + CV_CAP_OPENNI_IMAGE_GENERATOR_PRESENT = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_GENERATOR_PRESENT, + CV_CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_OUTPUT_MODE, + CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_BASELINE, + CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_FOCAL_LENGTH, + CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_REGISTRATION, + CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION, + + // Properties of cameras available through GStreamer interface + CV_CAP_GSTREAMER_QUEUE_LENGTH = 200, // default is 1 + + // PVAPI + CV_CAP_PROP_PVAPI_MULTICASTIP = 300, // ip for anable multicast master mode. 0 for disable multicast + CV_CAP_PROP_PVAPI_FRAMESTARTTRIGGERMODE = 301, // FrameStartTriggerMode: Determines how a frame is initiated + CV_CAP_PROP_PVAPI_DECIMATIONHORIZONTAL = 302, // Horizontal sub-sampling of the image + CV_CAP_PROP_PVAPI_DECIMATIONVERTICAL = 303, // Vertical sub-sampling of the image + CV_CAP_PROP_PVAPI_BINNINGX = 304, // Horizontal binning factor + CV_CAP_PROP_PVAPI_BINNINGY = 305, // Vertical binning factor + CV_CAP_PROP_PVAPI_PIXELFORMAT = 306, // Pixel format + + // Properties of cameras available through XIMEA SDK interface + CV_CAP_PROP_XI_DOWNSAMPLING = 400, // Change image resolution by binning or skipping. + CV_CAP_PROP_XI_DATA_FORMAT = 401, // Output data format. + CV_CAP_PROP_XI_OFFSET_X = 402, // Horizontal offset from the origin to the area of interest (in pixels). + CV_CAP_PROP_XI_OFFSET_Y = 403, // Vertical offset from the origin to the area of interest (in pixels). + CV_CAP_PROP_XI_TRG_SOURCE = 404, // Defines source of trigger. + CV_CAP_PROP_XI_TRG_SOFTWARE = 405, // Generates an internal trigger. PRM_TRG_SOURCE must be set to TRG_SOFTWARE. + CV_CAP_PROP_XI_GPI_SELECTOR = 406, // Selects general purpose input + CV_CAP_PROP_XI_GPI_MODE = 407, // Set general purpose input mode + CV_CAP_PROP_XI_GPI_LEVEL = 408, // Get general purpose level + CV_CAP_PROP_XI_GPO_SELECTOR = 409, // Selects general purpose output + CV_CAP_PROP_XI_GPO_MODE = 410, // Set general purpose output mode + CV_CAP_PROP_XI_LED_SELECTOR = 411, // Selects camera signalling LED + CV_CAP_PROP_XI_LED_MODE = 412, // Define camera signalling LED functionality + CV_CAP_PROP_XI_MANUAL_WB = 413, // Calculates White Balance(must be called during acquisition) + CV_CAP_PROP_XI_AUTO_WB = 414, // Automatic white balance + CV_CAP_PROP_XI_AEAG = 415, // Automatic exposure/gain + CV_CAP_PROP_XI_EXP_PRIORITY = 416, // Exposure priority (0.5 - exposure 50%, gain 50%). + CV_CAP_PROP_XI_AE_MAX_LIMIT = 417, // Maximum limit of exposure in AEAG procedure + CV_CAP_PROP_XI_AG_MAX_LIMIT = 418, // Maximum limit of gain in AEAG procedure + CV_CAP_PROP_XI_AEAG_LEVEL = 419, // Average intensity of output signal AEAG should achieve(in %) + CV_CAP_PROP_XI_TIMEOUT = 420, // Image capture timeout in milliseconds + CV_CAP_PROP_XI_EXPOSURE = 421, // Exposure time in microseconds + CV_CAP_PROP_XI_EXPOSURE_BURST_COUNT = 422, // Sets the number of times of exposure in one frame. + CV_CAP_PROP_XI_GAIN_SELECTOR = 423, // Gain selector for parameter Gain allows to select different type of gains. + CV_CAP_PROP_XI_GAIN = 424, // Gain in dB + CV_CAP_PROP_XI_DOWNSAMPLING_TYPE = 426, // Change image downsampling type. + CV_CAP_PROP_XI_BINNING_SELECTOR = 427, // Binning engine selector. + CV_CAP_PROP_XI_BINNING_VERTICAL = 428, // Vertical Binning - number of vertical photo-sensitive cells to combine together. + CV_CAP_PROP_XI_BINNING_HORIZONTAL = 429, // Horizontal Binning - number of horizontal photo-sensitive cells to combine together. + CV_CAP_PROP_XI_BINNING_PATTERN = 430, // Binning pattern type. + CV_CAP_PROP_XI_DECIMATION_SELECTOR = 431, // Decimation engine selector. + CV_CAP_PROP_XI_DECIMATION_VERTICAL = 432, // Vertical Decimation - vertical sub-sampling of the image - reduces the vertical resolution of the image by the specified vertical decimation factor. + CV_CAP_PROP_XI_DECIMATION_HORIZONTAL = 433, // Horizontal Decimation - horizontal sub-sampling of the image - reduces the horizontal resolution of the image by the specified vertical decimation factor. + CV_CAP_PROP_XI_DECIMATION_PATTERN = 434, // Decimation pattern type. + CV_CAP_PROP_XI_IMAGE_DATA_FORMAT = 435, // Output data format. + CV_CAP_PROP_XI_SHUTTER_TYPE = 436, // Change sensor shutter type(CMOS sensor). + CV_CAP_PROP_XI_SENSOR_TAPS = 437, // Number of taps + CV_CAP_PROP_XI_AEAG_ROI_OFFSET_X = 439, // Automatic exposure/gain ROI offset X + CV_CAP_PROP_XI_AEAG_ROI_OFFSET_Y = 440, // Automatic exposure/gain ROI offset Y + CV_CAP_PROP_XI_AEAG_ROI_WIDTH = 441, // Automatic exposure/gain ROI Width + CV_CAP_PROP_XI_AEAG_ROI_HEIGHT = 442, // Automatic exposure/gain ROI Height + CV_CAP_PROP_XI_BPC = 445, // Correction of bad pixels + CV_CAP_PROP_XI_WB_KR = 448, // White balance red coefficient + CV_CAP_PROP_XI_WB_KG = 449, // White balance green coefficient + CV_CAP_PROP_XI_WB_KB = 450, // White balance blue coefficient + CV_CAP_PROP_XI_WIDTH = 451, // Width of the Image provided by the device (in pixels). + CV_CAP_PROP_XI_HEIGHT = 452, // Height of the Image provided by the device (in pixels). + CV_CAP_PROP_XI_LIMIT_BANDWIDTH = 459, // Set/get bandwidth(datarate)(in Megabits) + CV_CAP_PROP_XI_SENSOR_DATA_BIT_DEPTH = 460, // Sensor output data bit depth. + CV_CAP_PROP_XI_OUTPUT_DATA_BIT_DEPTH = 461, // Device output data bit depth. + CV_CAP_PROP_XI_IMAGE_DATA_BIT_DEPTH = 462, // bitdepth of data returned by function xiGetImage + CV_CAP_PROP_XI_OUTPUT_DATA_PACKING = 463, // Device output data packing (or grouping) enabled. Packing could be enabled if output_data_bit_depth > 8 and packing capability is available. + CV_CAP_PROP_XI_OUTPUT_DATA_PACKING_TYPE = 464, // Data packing type. Some cameras supports only specific packing type. + CV_CAP_PROP_XI_IS_COOLED = 465, // Returns 1 for cameras that support cooling. + CV_CAP_PROP_XI_COOLING = 466, // Start camera cooling. + CV_CAP_PROP_XI_TARGET_TEMP = 467, // Set sensor target temperature for cooling. + CV_CAP_PROP_XI_CHIP_TEMP = 468, // Camera sensor temperature + CV_CAP_PROP_XI_HOUS_TEMP = 469, // Camera housing tepmerature + CV_CAP_PROP_XI_CMS = 470, // Mode of color management system. + CV_CAP_PROP_XI_APPLY_CMS = 471, // Enable applying of CMS profiles to xiGetImage (see XI_PRM_INPUT_CMS_PROFILE, XI_PRM_OUTPUT_CMS_PROFILE). + CV_CAP_PROP_XI_IMAGE_IS_COLOR = 474, // Returns 1 for color cameras. + CV_CAP_PROP_XI_COLOR_FILTER_ARRAY = 475, // Returns color filter array type of RAW data. + CV_CAP_PROP_XI_GAMMAY = 476, // Luminosity gamma + CV_CAP_PROP_XI_GAMMAC = 477, // Chromaticity gamma + CV_CAP_PROP_XI_SHARPNESS = 478, // Sharpness Strenght + CV_CAP_PROP_XI_CC_MATRIX_00 = 479, // Color Correction Matrix element [0][0] + CV_CAP_PROP_XI_CC_MATRIX_01 = 480, // Color Correction Matrix element [0][1] + CV_CAP_PROP_XI_CC_MATRIX_02 = 481, // Color Correction Matrix element [0][2] + CV_CAP_PROP_XI_CC_MATRIX_03 = 482, // Color Correction Matrix element [0][3] + CV_CAP_PROP_XI_CC_MATRIX_10 = 483, // Color Correction Matrix element [1][0] + CV_CAP_PROP_XI_CC_MATRIX_11 = 484, // Color Correction Matrix element [1][1] + CV_CAP_PROP_XI_CC_MATRIX_12 = 485, // Color Correction Matrix element [1][2] + CV_CAP_PROP_XI_CC_MATRIX_13 = 486, // Color Correction Matrix element [1][3] + CV_CAP_PROP_XI_CC_MATRIX_20 = 487, // Color Correction Matrix element [2][0] + CV_CAP_PROP_XI_CC_MATRIX_21 = 488, // Color Correction Matrix element [2][1] + CV_CAP_PROP_XI_CC_MATRIX_22 = 489, // Color Correction Matrix element [2][2] + CV_CAP_PROP_XI_CC_MATRIX_23 = 490, // Color Correction Matrix element [2][3] + CV_CAP_PROP_XI_CC_MATRIX_30 = 491, // Color Correction Matrix element [3][0] + CV_CAP_PROP_XI_CC_MATRIX_31 = 492, // Color Correction Matrix element [3][1] + CV_CAP_PROP_XI_CC_MATRIX_32 = 493, // Color Correction Matrix element [3][2] + CV_CAP_PROP_XI_CC_MATRIX_33 = 494, // Color Correction Matrix element [3][3] + CV_CAP_PROP_XI_DEFAULT_CC_MATRIX = 495, // Set default Color Correction Matrix + CV_CAP_PROP_XI_TRG_SELECTOR = 498, // Selects the type of trigger. + CV_CAP_PROP_XI_ACQ_FRAME_BURST_COUNT = 499, // Sets number of frames acquired by burst. This burst is used only if trigger is set to FrameBurstStart + CV_CAP_PROP_XI_DEBOUNCE_EN = 507, // Enable/Disable debounce to selected GPI + CV_CAP_PROP_XI_DEBOUNCE_T0 = 508, // Debounce time (x * 10us) + CV_CAP_PROP_XI_DEBOUNCE_T1 = 509, // Debounce time (x * 10us) + CV_CAP_PROP_XI_DEBOUNCE_POL = 510, // Debounce polarity (pol = 1 t0 - falling edge, t1 - rising edge) + CV_CAP_PROP_XI_LENS_MODE = 511, // Status of lens control interface. This shall be set to XI_ON before any Lens operations. + CV_CAP_PROP_XI_LENS_APERTURE_VALUE = 512, // Current lens aperture value in stops. Examples: 2.8, 4, 5.6, 8, 11 + CV_CAP_PROP_XI_LENS_FOCUS_MOVEMENT_VALUE = 513, // Lens current focus movement value to be used by XI_PRM_LENS_FOCUS_MOVE in motor steps. + CV_CAP_PROP_XI_LENS_FOCUS_MOVE = 514, // Moves lens focus motor by steps set in XI_PRM_LENS_FOCUS_MOVEMENT_VALUE. + CV_CAP_PROP_XI_LENS_FOCUS_DISTANCE = 515, // Lens focus distance in cm. + CV_CAP_PROP_XI_LENS_FOCAL_LENGTH = 516, // Lens focal distance in mm. + CV_CAP_PROP_XI_LENS_FEATURE_SELECTOR = 517, // Selects the current feature which is accessible by XI_PRM_LENS_FEATURE. + CV_CAP_PROP_XI_LENS_FEATURE = 518, // Allows access to lens feature value currently selected by XI_PRM_LENS_FEATURE_SELECTOR. + CV_CAP_PROP_XI_DEVICE_MODEL_ID = 521, // Return device model id + CV_CAP_PROP_XI_DEVICE_SN = 522, // Return device serial number + CV_CAP_PROP_XI_IMAGE_DATA_FORMAT_RGB32_ALPHA = 529, // The alpha channel of RGB32 output image format. + CV_CAP_PROP_XI_IMAGE_PAYLOAD_SIZE = 530, // Buffer size in bytes sufficient for output image returned by xiGetImage + CV_CAP_PROP_XI_TRANSPORT_PIXEL_FORMAT = 531, // Current format of pixels on transport layer. + CV_CAP_PROP_XI_SENSOR_CLOCK_FREQ_HZ = 532, // Sensor clock frequency in Hz. + CV_CAP_PROP_XI_SENSOR_CLOCK_FREQ_INDEX = 533, // Sensor clock frequency index. Sensor with selected frequencies have possibility to set the frequency only by this index. + CV_CAP_PROP_XI_SENSOR_OUTPUT_CHANNEL_COUNT = 534, // Number of output channels from sensor used for data transfer. + CV_CAP_PROP_XI_FRAMERATE = 535, // Define framerate in Hz + CV_CAP_PROP_XI_COUNTER_SELECTOR = 536, // Select counter + CV_CAP_PROP_XI_COUNTER_VALUE = 537, // Counter status + CV_CAP_PROP_XI_ACQ_TIMING_MODE = 538, // Type of sensor frames timing. + CV_CAP_PROP_XI_AVAILABLE_BANDWIDTH = 539, // Calculate and return available interface bandwidth(int Megabits) + CV_CAP_PROP_XI_BUFFER_POLICY = 540, // Data move policy + CV_CAP_PROP_XI_LUT_EN = 541, // Activates LUT. + CV_CAP_PROP_XI_LUT_INDEX = 542, // Control the index (offset) of the coefficient to access in the LUT. + CV_CAP_PROP_XI_LUT_VALUE = 543, // Value at entry LUTIndex of the LUT + CV_CAP_PROP_XI_TRG_DELAY = 544, // Specifies the delay in microseconds (us) to apply after the trigger reception before activating it. + CV_CAP_PROP_XI_TS_RST_MODE = 545, // Defines how time stamp reset engine will be armed + CV_CAP_PROP_XI_TS_RST_SOURCE = 546, // Defines which source will be used for timestamp reset. Writing this parameter will trigger settings of engine (arming) + CV_CAP_PROP_XI_IS_DEVICE_EXIST = 547, // Returns 1 if camera connected and works properly. + CV_CAP_PROP_XI_ACQ_BUFFER_SIZE = 548, // Acquisition buffer size in buffer_size_unit. Default bytes. + CV_CAP_PROP_XI_ACQ_BUFFER_SIZE_UNIT = 549, // Acquisition buffer size unit in bytes. Default 1. E.g. Value 1024 means that buffer_size is in KiBytes + CV_CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_SIZE = 550, // Acquisition transport buffer size in bytes + CV_CAP_PROP_XI_BUFFERS_QUEUE_SIZE = 551, // Queue of field/frame buffers + CV_CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_COMMIT = 552, // Number of buffers to commit to low level + CV_CAP_PROP_XI_RECENT_FRAME = 553, // GetImage returns most recent frame + CV_CAP_PROP_XI_DEVICE_RESET = 554, // Resets the camera to default state. + CV_CAP_PROP_XI_COLUMN_FPN_CORRECTION = 555, // Correction of column FPN + CV_CAP_PROP_XI_SENSOR_MODE = 558, // Current sensor mode. Allows to select sensor mode by one integer. Setting of this parameter affects: image dimensions and downsampling. + CV_CAP_PROP_XI_HDR = 559, // Enable High Dynamic Range feature. + CV_CAP_PROP_XI_HDR_KNEEPOINT_COUNT = 560, // The number of kneepoints in the PWLR. + CV_CAP_PROP_XI_HDR_T1 = 561, // position of first kneepoint(in % of XI_PRM_EXPOSURE) + CV_CAP_PROP_XI_HDR_T2 = 562, // position of second kneepoint (in % of XI_PRM_EXPOSURE) + CV_CAP_PROP_XI_KNEEPOINT1 = 563, // value of first kneepoint (% of sensor saturation) + CV_CAP_PROP_XI_KNEEPOINT2 = 564, // value of second kneepoint (% of sensor saturation) + CV_CAP_PROP_XI_IMAGE_BLACK_LEVEL = 565, // Last image black level counts. Can be used for Offline processing to recall it. + CV_CAP_PROP_XI_HW_REVISION = 571, // Returns hardware revision number. + CV_CAP_PROP_XI_DEBUG_LEVEL = 572, // Set debug level + CV_CAP_PROP_XI_AUTO_BANDWIDTH_CALCULATION = 573, // Automatic bandwidth calculation, + CV_CAP_PROP_XI_FREE_FFS_SIZE = 581, // Size of free camera FFS. + CV_CAP_PROP_XI_USED_FFS_SIZE = 582, // Size of used camera FFS. + CV_CAP_PROP_XI_FFS_ACCESS_KEY = 583, // Setting of key enables file operations on some cameras. + CV_CAP_PROP_XI_SENSOR_FEATURE_SELECTOR = 585, // Selects the current feature which is accessible by XI_PRM_SENSOR_FEATURE_VALUE. + CV_CAP_PROP_XI_SENSOR_FEATURE_VALUE = 586, // Allows access to sensor feature value currently selected by XI_PRM_SENSOR_FEATURE_SELECTOR. + + // Properties for Android cameras + CV_CAP_PROP_ANDROID_FLASH_MODE = 8001, + CV_CAP_PROP_ANDROID_FOCUS_MODE = 8002, + CV_CAP_PROP_ANDROID_WHITE_BALANCE = 8003, + CV_CAP_PROP_ANDROID_ANTIBANDING = 8004, + CV_CAP_PROP_ANDROID_FOCAL_LENGTH = 8005, + CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_NEAR = 8006, + CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_OPTIMAL = 8007, + CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_FAR = 8008, + CV_CAP_PROP_ANDROID_EXPOSE_LOCK = 8009, + CV_CAP_PROP_ANDROID_WHITEBALANCE_LOCK = 8010, + + // Properties of cameras available through AVFOUNDATION interface + CV_CAP_PROP_IOS_DEVICE_FOCUS = 9001, + CV_CAP_PROP_IOS_DEVICE_EXPOSURE = 9002, + CV_CAP_PROP_IOS_DEVICE_FLASH = 9003, + CV_CAP_PROP_IOS_DEVICE_WHITEBALANCE = 9004, + CV_CAP_PROP_IOS_DEVICE_TORCH = 9005, + + // Properties of cameras available through Smartek Giganetix Ethernet Vision interface + /* --- Vladimir Litvinenko (litvinenko.vladimir@gmail.com) --- */ + CV_CAP_PROP_GIGA_FRAME_OFFSET_X = 10001, + CV_CAP_PROP_GIGA_FRAME_OFFSET_Y = 10002, + CV_CAP_PROP_GIGA_FRAME_WIDTH_MAX = 10003, + CV_CAP_PROP_GIGA_FRAME_HEIGH_MAX = 10004, + CV_CAP_PROP_GIGA_FRAME_SENS_WIDTH = 10005, + CV_CAP_PROP_GIGA_FRAME_SENS_HEIGH = 10006, + + CV_CAP_PROP_INTELPERC_PROFILE_COUNT = 11001, + CV_CAP_PROP_INTELPERC_PROFILE_IDX = 11002, + CV_CAP_PROP_INTELPERC_DEPTH_LOW_CONFIDENCE_VALUE = 11003, + CV_CAP_PROP_INTELPERC_DEPTH_SATURATION_VALUE = 11004, + CV_CAP_PROP_INTELPERC_DEPTH_CONFIDENCE_THRESHOLD = 11005, + CV_CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_HORZ = 11006, + CV_CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_VERT = 11007, + + // Intel PerC streams + CV_CAP_INTELPERC_DEPTH_GENERATOR = 1 << 29, + CV_CAP_INTELPERC_IMAGE_GENERATOR = 1 << 28, + CV_CAP_INTELPERC_GENERATORS_MASK = CV_CAP_INTELPERC_DEPTH_GENERATOR + CV_CAP_INTELPERC_IMAGE_GENERATOR +}; + +// Generic camera output modes. +// Currently, these are supported through the libv4l interface only. +enum +{ + CV_CAP_MODE_BGR = 0, // BGR24 (default) + CV_CAP_MODE_RGB = 1, // RGB24 + CV_CAP_MODE_GRAY = 2, // Y8 + CV_CAP_MODE_YUYV = 3 // YUYV +}; + +enum +{ + // Data given from depth generator. + CV_CAP_OPENNI_DEPTH_MAP = 0, // Depth values in mm (CV_16UC1) + CV_CAP_OPENNI_POINT_CLOUD_MAP = 1, // XYZ in meters (CV_32FC3) + CV_CAP_OPENNI_DISPARITY_MAP = 2, // Disparity in pixels (CV_8UC1) + CV_CAP_OPENNI_DISPARITY_MAP_32F = 3, // Disparity in pixels (CV_32FC1) + CV_CAP_OPENNI_VALID_DEPTH_MASK = 4, // CV_8UC1 + + // Data given from RGB image generator. + CV_CAP_OPENNI_BGR_IMAGE = 5, + CV_CAP_OPENNI_GRAY_IMAGE = 6 +}; + +// Supported output modes of OpenNI image generator +enum +{ + CV_CAP_OPENNI_VGA_30HZ = 0, + CV_CAP_OPENNI_SXGA_15HZ = 1, + CV_CAP_OPENNI_SXGA_30HZ = 2, + CV_CAP_OPENNI_QVGA_30HZ = 3, + CV_CAP_OPENNI_QVGA_60HZ = 4 +}; + +enum +{ + CV_CAP_INTELPERC_DEPTH_MAP = 0, // Each pixel is a 16-bit integer. The value indicates the distance from an object to the camera's XY plane or the Cartesian depth. + CV_CAP_INTELPERC_UVDEPTH_MAP = 1, // Each pixel contains two 32-bit floating point values in the range of 0-1, representing the mapping of depth coordinates to the color coordinates. + CV_CAP_INTELPERC_IR_MAP = 2, // Each pixel is a 16-bit integer. The value indicates the intensity of the reflected laser beam. + CV_CAP_INTELPERC_IMAGE = 3 +}; + +// gPhoto2 properties, if propertyId is less than 0 then work on widget with that __additive inversed__ camera setting ID +// Get IDs by using CAP_PROP_GPHOTO2_WIDGET_ENUMERATE. +// @see CvCaptureCAM_GPHOTO2 for more info +enum +{ + CV_CAP_PROP_GPHOTO2_PREVIEW = 17001, // Capture only preview from liveview mode. + CV_CAP_PROP_GPHOTO2_WIDGET_ENUMERATE = 17002, // Readonly, returns (const char *). + CV_CAP_PROP_GPHOTO2_RELOAD_CONFIG = 17003, // Trigger, only by set. Reload camera settings. + CV_CAP_PROP_GPHOTO2_RELOAD_ON_CHANGE = 17004, // Reload all settings on set. + CV_CAP_PROP_GPHOTO2_COLLECT_MSGS = 17005, // Collect messages with details. + CV_CAP_PROP_GPHOTO2_FLUSH_MSGS = 17006, // Readonly, returns (const char *). + CV_CAP_PROP_SPEED = 17007, // Exposure speed. Can be readonly, depends on camera program. + CV_CAP_PROP_APERTURE = 17008, // Aperture. Can be readonly, depends on camera program. + CV_CAP_PROP_EXPOSUREPROGRAM = 17009, // Camera exposure program. + CV_CAP_PROP_VIEWFINDER = 17010 // Enter liveview mode. +}; + +/* retrieve or set capture properties */ +CVAPI(double) cvGetCaptureProperty( CvCapture* capture, int property_id ); +CVAPI(int) cvSetCaptureProperty( CvCapture* capture, int property_id, double value ); + +// Return the type of the capturer (eg, CV_CAP_V4W, CV_CAP_UNICAP), which is unknown if created with CV_CAP_ANY +CVAPI(int) cvGetCaptureDomain( CvCapture* capture); + +/* "black box" video file writer structure */ +typedef struct CvVideoWriter CvVideoWriter; + +#define CV_FOURCC_MACRO(c1, c2, c3, c4) (((c1) & 255) + (((c2) & 255) << 8) + (((c3) & 255) << 16) + (((c4) & 255) << 24)) + +CV_INLINE int CV_FOURCC(char c1, char c2, char c3, char c4) +{ + return CV_FOURCC_MACRO(c1, c2, c3, c4); +} + +#define CV_FOURCC_PROMPT -1 /* Open Codec Selection Dialog (Windows only) */ +#define CV_FOURCC_DEFAULT CV_FOURCC('I', 'Y', 'U', 'V') /* Use default codec for specified filename (Linux only) */ + +/* initialize video file writer */ +CVAPI(CvVideoWriter*) cvCreateVideoWriter( const char* filename, int fourcc, + double fps, CvSize frame_size, + int is_color CV_DEFAULT(1)); + +/* write frame to video file */ +CVAPI(int) cvWriteFrame( CvVideoWriter* writer, const IplImage* image ); + +/* close video file writer */ +CVAPI(void) cvReleaseVideoWriter( CvVideoWriter** writer ); + +/****************************************************************************************\ +* Obsolete functions/synonyms * +\****************************************************************************************/ + +#define cvCaptureFromFile cvCreateFileCapture +#define cvCaptureFromCAM cvCreateCameraCapture +#define cvCaptureFromAVI cvCaptureFromFile +#define cvCreateAVIWriter cvCreateVideoWriter +#define cvWriteToAVI cvWriteFrame + +/** @} videoio_c */ + +#ifdef __cplusplus +} +#endif + +#endif //__OPENCV_VIDEOIO_H__ diff --git a/lib/opencv/include/opencv2/videostab.hpp b/lib/opencv/include/opencv2/videostab.hpp new file mode 100644 index 000000000..17b061f8d --- /dev/null +++ b/lib/opencv/include/opencv2/videostab.hpp @@ -0,0 +1,81 @@ +/*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-2011, 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_VIDEOSTAB_HPP__ +#define __OPENCV_VIDEOSTAB_HPP__ + +/** + @defgroup videostab Video Stabilization + +The video stabilization module contains a set of functions and classes that can be used to solve the +problem of video stabilization. There are a few methods implemented, most of them are descibed in +the papers @cite OF06 and @cite G11 . However, there are some extensions and deviations from the orginal +paper methods. + +### References + + 1. "Full-Frame Video Stabilization with Motion Inpainting" + Yasuyuki Matsushita, Eyal Ofek, Weina Ge, Xiaoou Tang, Senior Member, and Heung-Yeung Shum + 2. "Auto-Directed Video Stabilization with Robust L1 Optimal Camera Paths" + Matthias Grundmann, Vivek Kwatra, Irfan Essa + + @{ + @defgroup videostab_motion Global Motion Estimation + +The video stabilization module contains a set of functions and classes for global motion estimation +between point clouds or between images. In the last case features are extracted and matched +internally. For the sake of convenience the motion estimation functions are wrapped into classes. +Both the functions and the classes are available. + + @defgroup videostab_marching Fast Marching Method + +The Fast Marching Method @cite Telea04 is used in of the video stabilization routines to do motion and +color inpainting. The method is implemented is a flexible way and it's made public for other users. + + @} + +*/ + +#include "opencv2/videostab/stabilizer.hpp" +#include "opencv2/videostab/ring_buffer.hpp" + +#endif diff --git a/lib/opencv/include/opencv2/videostab/deblurring.hpp b/lib/opencv/include/opencv2/videostab/deblurring.hpp new file mode 100644 index 000000000..8028c1d81 --- /dev/null +++ b/lib/opencv/include/opencv2/videostab/deblurring.hpp @@ -0,0 +1,116 @@ +/*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-2011, 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_VIDEOSTAB_DEBLURRING_HPP__ +#define __OPENCV_VIDEOSTAB_DEBLURRING_HPP__ + +#include +#include "opencv2/core.hpp" + +namespace cv +{ +namespace videostab +{ + +//! @addtogroup videostab +//! @{ + +CV_EXPORTS float calcBlurriness(const Mat &frame); + +class CV_EXPORTS DeblurerBase +{ +public: + DeblurerBase() : radius_(0), frames_(0), motions_(0), blurrinessRates_(0) {} + + virtual ~DeblurerBase() {} + + virtual void setRadius(int val) { radius_ = val; } + virtual int radius() const { return radius_; } + + virtual void deblur(int idx, Mat &frame) = 0; + + + // data from stabilizer + + virtual void setFrames(const std::vector &val) { frames_ = &val; } + virtual const std::vector& frames() const { return *frames_; } + + virtual void setMotions(const std::vector &val) { motions_ = &val; } + virtual const std::vector& motions() const { return *motions_; } + + virtual void setBlurrinessRates(const std::vector &val) { blurrinessRates_ = &val; } + virtual const std::vector& blurrinessRates() const { return *blurrinessRates_; } + +protected: + int radius_; + const std::vector *frames_; + const std::vector *motions_; + const std::vector *blurrinessRates_; +}; + +class CV_EXPORTS NullDeblurer : public DeblurerBase +{ +public: + virtual void deblur(int /*idx*/, Mat &/*frame*/) {} +}; + +class CV_EXPORTS WeightingDeblurer : public DeblurerBase +{ +public: + WeightingDeblurer(); + + void setSensitivity(float val) { sensitivity_ = val; } + float sensitivity() const { return sensitivity_; } + + virtual void deblur(int idx, Mat &frame); + +private: + float sensitivity_; + Mat_ bSum_, gSum_, rSum_, wSum_; +}; + +//! @} + +} // namespace videostab +} // namespace cv + +#endif diff --git a/lib/opencv/include/opencv2/videostab/fast_marching.hpp b/lib/opencv/include/opencv2/videostab/fast_marching.hpp new file mode 100644 index 000000000..c0c7985a7 --- /dev/null +++ b/lib/opencv/include/opencv2/videostab/fast_marching.hpp @@ -0,0 +1,121 @@ +/*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-2011, 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_VIDEOSTAB_FAST_MARCHING_HPP__ +#define __OPENCV_VIDEOSTAB_FAST_MARCHING_HPP__ + +#include +#include +#include +#include "opencv2/core.hpp" + +namespace cv +{ +namespace videostab +{ + +//! @addtogroup videostab_marching +//! @{ + +/** @brief Describes the Fast Marching Method implementation. + + See http://iwi.eldoc.ub.rug.nl/FILES/root/2004/JGraphToolsTelea/2004JGraphToolsTelea.pdf + */ +class CV_EXPORTS FastMarchingMethod +{ +public: + FastMarchingMethod() : inf_(1e6f) {} + + /** @brief Template method that runs the Fast Marching Method. + + @param mask Image mask. 0 value indicates that the pixel value must be inpainted, 255 indicates + that the pixel value is known, other values aren't acceptable. + @param inpaint Inpainting functor that overloads void operator ()(int x, int y). + @return Inpainting functor. + */ + template + Inpaint run(const Mat &mask, Inpaint inpaint); + + /** + @return Distance map that's created during working of the method. + */ + Mat distanceMap() const { return dist_; } + +private: + enum { INSIDE = 0, BAND = 1, KNOWN = 255 }; + + struct DXY + { + float dist; + int x, y; + + DXY() : dist(0), x(0), y(0) {} + DXY(float _dist, int _x, int _y) : dist(_dist), x(_x), y(_y) {} + bool operator <(const DXY &dxy) const { return dist < dxy.dist; } + }; + + float solve(int x1, int y1, int x2, int y2) const; + int& indexOf(const DXY &dxy) { return index_(dxy.y, dxy.x); } + + void heapUp(int idx); + void heapDown(int idx); + void heapAdd(const DXY &dxy); + void heapRemoveMin(); + + float inf_; + + cv::Mat_ flag_; // flag map + cv::Mat_ dist_; // distance map + + cv::Mat_ index_; // index of point in the narrow band + std::vector narrowBand_; // narrow band heap + int size_; // narrow band size +}; + +//! @} + +} // namespace videostab +} // namespace cv + +#include "fast_marching_inl.hpp" + +#endif diff --git a/lib/opencv/include/opencv2/videostab/fast_marching_inl.hpp b/lib/opencv/include/opencv2/videostab/fast_marching_inl.hpp new file mode 100644 index 000000000..6388e6966 --- /dev/null +++ b/lib/opencv/include/opencv2/videostab/fast_marching_inl.hpp @@ -0,0 +1,165 @@ +/*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-2011, 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_VIDEOSTAB_FAST_MARCHING_INL_HPP__ +#define __OPENCV_VIDEOSTAB_FAST_MARCHING_INL_HPP__ + +#include "opencv2/videostab/fast_marching.hpp" + +namespace cv +{ +namespace videostab +{ + +template +Inpaint FastMarchingMethod::run(const cv::Mat &mask, Inpaint inpaint) +{ + using namespace cv; + + CV_Assert(mask.type() == CV_8U); + + static const int lut[4][2] = {{-1,0}, {0,-1}, {1,0}, {0,1}}; + + mask.copyTo(flag_); + flag_.create(mask.size()); + dist_.create(mask.size()); + index_.create(mask.size()); + narrowBand_.clear(); + size_ = 0; + + // init + for (int y = 0; y < flag_.rows; ++y) + { + for (int x = 0; x < flag_.cols; ++x) + { + if (flag_(y,x) == KNOWN) + dist_(y,x) = 0.f; + else + { + int n = 0; + int nunknown = 0; + + for (int i = 0; i < 4; ++i) + { + int xn = x + lut[i][0]; + int yn = y + lut[i][1]; + + if (xn >= 0 && xn < flag_.cols && yn >= 0 && yn < flag_.rows) + { + n++; + if (flag_(yn,xn) != KNOWN) + nunknown++; + } + } + + if (n>0 && nunknown == n) + { + dist_(y,x) = inf_; + flag_(y,x) = INSIDE; + } + else + { + dist_(y,x) = 0.f; + flag_(y,x) = BAND; + inpaint(x, y); + + narrowBand_.push_back(DXY(0.f,x,y)); + index_(y,x) = size_++; + } + } + } + } + + // make heap + for (int i = size_/2-1; i >= 0; --i) + heapDown(i); + + // main cycle + while (size_ > 0) + { + int x = narrowBand_[0].x; + int y = narrowBand_[0].y; + heapRemoveMin(); + + flag_(y,x) = KNOWN; + for (int n = 0; n < 4; ++n) + { + int xn = x + lut[n][0]; + int yn = y + lut[n][1]; + + if (xn >= 0 && xn < flag_.cols && yn >= 0 && yn < flag_.rows && flag_(yn,xn) != KNOWN) + { + dist_(yn,xn) = std::min(std::min(solve(xn-1, yn, xn, yn-1), solve(xn+1, yn, xn, yn-1)), + std::min(solve(xn-1, yn, xn, yn+1), solve(xn+1, yn, xn, yn+1))); + + if (flag_(yn,xn) == INSIDE) + { + flag_(yn,xn) = BAND; + inpaint(xn, yn); + heapAdd(DXY(dist_(yn,xn),xn,yn)); + } + else + { + int i = index_(yn,xn); + if (dist_(yn,xn) < narrowBand_[i].dist) + { + narrowBand_[i].dist = dist_(yn,xn); + heapUp(i); + } + // works better if it's commented out + /*else if (dist(yn,xn) > narrowBand[i].dist) + { + narrowBand[i].dist = dist(yn,xn); + heapDown(i); + }*/ + } + } + } + } + + return inpaint; +} + +} // namespace videostab +} // namespace cv + +#endif diff --git a/lib/opencv/include/opencv2/videostab/frame_source.hpp b/lib/opencv/include/opencv2/videostab/frame_source.hpp new file mode 100644 index 000000000..612fbdb30 --- /dev/null +++ b/lib/opencv/include/opencv2/videostab/frame_source.hpp @@ -0,0 +1,94 @@ +/*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-2011, 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_VIDEOSTAB_FRAME_SOURCE_HPP__ +#define __OPENCV_VIDEOSTAB_FRAME_SOURCE_HPP__ + +#include +#include "opencv2/core.hpp" + +namespace cv +{ +namespace videostab +{ + +//! @addtogroup videostab +//! @{ + +class CV_EXPORTS IFrameSource +{ +public: + virtual ~IFrameSource() {} + virtual void reset() = 0; + virtual Mat nextFrame() = 0; +}; + +class CV_EXPORTS NullFrameSource : public IFrameSource +{ +public: + virtual void reset() {} + virtual Mat nextFrame() { return Mat(); } +}; + +class CV_EXPORTS VideoFileSource : public IFrameSource +{ +public: + VideoFileSource(const String &path, bool volatileFrame = false); + + virtual void reset(); + virtual Mat nextFrame(); + + int width(); + int height(); + int count(); + double fps(); + +private: + Ptr impl; +}; + +//! @} + +} // namespace videostab +} // namespace cv + +#endif diff --git a/lib/opencv/include/opencv2/videostab/global_motion.hpp b/lib/opencv/include/opencv2/videostab/global_motion.hpp new file mode 100644 index 000000000..5d51e4234 --- /dev/null +++ b/lib/opencv/include/opencv2/videostab/global_motion.hpp @@ -0,0 +1,299 @@ +/*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-2011, 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_VIDEOSTAB_GLOBAL_MOTION_HPP__ +#define __OPENCV_VIDEOSTAB_GLOBAL_MOTION_HPP__ + +#include +#include +#include "opencv2/core.hpp" +#include "opencv2/features2d.hpp" +#include "opencv2/opencv_modules.hpp" +#include "opencv2/videostab/optical_flow.hpp" +#include "opencv2/videostab/motion_core.hpp" +#include "opencv2/videostab/outlier_rejection.hpp" + +#ifdef HAVE_OPENCV_CUDAIMGPROC +# include "opencv2/cudaimgproc.hpp" +#endif + +namespace cv +{ +namespace videostab +{ + +//! @addtogroup videostab_motion +//! @{ + +/** @brief Estimates best global motion between two 2D point clouds in the least-squares sense. + +@note Works in-place and changes input point arrays. + +@param points0 Source set of 2D points (32F). +@param points1 Destination set of 2D points (32F). +@param model Motion model (up to MM_AFFINE). +@param rmse Final root-mean-square error. +@return 3x3 2D transformation matrix (32F). + */ +CV_EXPORTS Mat estimateGlobalMotionLeastSquares( + InputOutputArray points0, InputOutputArray points1, int model = MM_AFFINE, + float *rmse = 0); + +/** @brief Estimates best global motion between two 2D point clouds robustly (using RANSAC method). + +@param points0 Source set of 2D points (32F). +@param points1 Destination set of 2D points (32F). +@param model Motion model. See cv::videostab::MotionModel. +@param params RANSAC method parameters. See videostab::RansacParams. +@param rmse Final root-mean-square error. +@param ninliers Final number of inliers. + */ +CV_EXPORTS Mat estimateGlobalMotionRansac( + InputArray points0, InputArray points1, int model = MM_AFFINE, + const RansacParams ¶ms = RansacParams::default2dMotion(MM_AFFINE), + float *rmse = 0, int *ninliers = 0); + +/** @brief Base class for all global motion estimation methods. + */ +class CV_EXPORTS MotionEstimatorBase +{ +public: + virtual ~MotionEstimatorBase() {} + + /** @brief Sets motion model. + + @param val Motion model. See cv::videostab::MotionModel. + */ + virtual void setMotionModel(MotionModel val) { motionModel_ = val; } + + /** + @return Motion model. See cv::videostab::MotionModel. + */ + virtual MotionModel motionModel() const { return motionModel_; } + + /** @brief Estimates global motion between two 2D point clouds. + + @param points0 Source set of 2D points (32F). + @param points1 Destination set of 2D points (32F). + @param ok Indicates whether motion was estimated successfully. + @return 3x3 2D transformation matrix (32F). + */ + virtual Mat estimate(InputArray points0, InputArray points1, bool *ok = 0) = 0; + +protected: + MotionEstimatorBase(MotionModel model) { setMotionModel(model); } + +private: + MotionModel motionModel_; +}; + +/** @brief Describes a robust RANSAC-based global 2D motion estimation method which minimizes L2 error. + */ +class CV_EXPORTS MotionEstimatorRansacL2 : public MotionEstimatorBase +{ +public: + MotionEstimatorRansacL2(MotionModel model = MM_AFFINE); + + void setRansacParams(const RansacParams &val) { ransacParams_ = val; } + RansacParams ransacParams() const { return ransacParams_; } + + void setMinInlierRatio(float val) { minInlierRatio_ = val; } + float minInlierRatio() const { return minInlierRatio_; } + + virtual Mat estimate(InputArray points0, InputArray points1, bool *ok = 0); + +private: + RansacParams ransacParams_; + float minInlierRatio_; +}; + +/** @brief Describes a global 2D motion estimation method which minimizes L1 error. + +@note To be able to use this method you must build OpenCV with CLP library support. : + */ +class CV_EXPORTS MotionEstimatorL1 : public MotionEstimatorBase +{ +public: + MotionEstimatorL1(MotionModel model = MM_AFFINE); + + virtual Mat estimate(InputArray points0, InputArray points1, bool *ok = 0); + +private: + std::vector obj_, collb_, colub_; + std::vector elems_, rowlb_, rowub_; + std::vector rows_, cols_; + + void set(int row, int col, double coef) + { + rows_.push_back(row); + cols_.push_back(col); + elems_.push_back(coef); + } +}; + +/** @brief Base class for global 2D motion estimation methods which take frames as input. + */ +class CV_EXPORTS ImageMotionEstimatorBase +{ +public: + virtual ~ImageMotionEstimatorBase() {} + + virtual void setMotionModel(MotionModel val) { motionModel_ = val; } + virtual MotionModel motionModel() const { return motionModel_; } + + virtual Mat estimate(const Mat &frame0, const Mat &frame1, bool *ok = 0) = 0; + +protected: + ImageMotionEstimatorBase(MotionModel model) { setMotionModel(model); } + +private: + MotionModel motionModel_; +}; + +class CV_EXPORTS FromFileMotionReader : public ImageMotionEstimatorBase +{ +public: + FromFileMotionReader(const String &path); + + virtual Mat estimate(const Mat &frame0, const Mat &frame1, bool *ok = 0); + +private: + std::ifstream file_; +}; + +class CV_EXPORTS ToFileMotionWriter : public ImageMotionEstimatorBase +{ +public: + ToFileMotionWriter(const String &path, Ptr estimator); + + virtual void setMotionModel(MotionModel val) { motionEstimator_->setMotionModel(val); } + virtual MotionModel motionModel() const { return motionEstimator_->motionModel(); } + + virtual Mat estimate(const Mat &frame0, const Mat &frame1, bool *ok = 0); + +private: + std::ofstream file_; + Ptr motionEstimator_; +}; + +/** @brief Describes a global 2D motion estimation method which uses keypoints detection and optical flow for +matching. + */ +class CV_EXPORTS KeypointBasedMotionEstimator : public ImageMotionEstimatorBase +{ +public: + KeypointBasedMotionEstimator(Ptr estimator); + + virtual void setMotionModel(MotionModel val) { motionEstimator_->setMotionModel(val); } + virtual MotionModel motionModel() const { return motionEstimator_->motionModel(); } + + void setDetector(Ptr val) { detector_ = val; } + Ptr detector() const { return detector_; } + + void setOpticalFlowEstimator(Ptr val) { optFlowEstimator_ = val; } + Ptr opticalFlowEstimator() const { return optFlowEstimator_; } + + void setOutlierRejector(Ptr val) { outlierRejector_ = val; } + Ptr outlierRejector() const { return outlierRejector_; } + + virtual Mat estimate(const Mat &frame0, const Mat &frame1, bool *ok = 0); + +private: + Ptr motionEstimator_; + Ptr detector_; + Ptr optFlowEstimator_; + Ptr outlierRejector_; + + std::vector status_; + std::vector keypointsPrev_; + std::vector pointsPrev_, points_; + std::vector pointsPrevGood_, pointsGood_; +}; + +#if defined(HAVE_OPENCV_CUDAIMGPROC) && defined(HAVE_OPENCV_CUDAOPTFLOW) + +class CV_EXPORTS KeypointBasedMotionEstimatorGpu : public ImageMotionEstimatorBase +{ +public: + KeypointBasedMotionEstimatorGpu(Ptr estimator); + + virtual void setMotionModel(MotionModel val) { motionEstimator_->setMotionModel(val); } + virtual MotionModel motionModel() const { return motionEstimator_->motionModel(); } + + void setOutlierRejector(Ptr val) { outlierRejector_ = val; } + Ptr outlierRejector() const { return outlierRejector_; } + + virtual Mat estimate(const Mat &frame0, const Mat &frame1, bool *ok = 0); + Mat estimate(const cuda::GpuMat &frame0, const cuda::GpuMat &frame1, bool *ok = 0); + +private: + Ptr motionEstimator_; + Ptr detector_; + SparsePyrLkOptFlowEstimatorGpu optFlowEstimator_; + Ptr outlierRejector_; + + cuda::GpuMat frame0_, grayFrame0_, frame1_; + cuda::GpuMat pointsPrev_, points_; + cuda::GpuMat status_; + + Mat hostPointsPrev_, hostPoints_; + std::vector hostPointsPrevTmp_, hostPointsTmp_; + std::vector rejectionStatus_; +}; + +#endif // defined(HAVE_OPENCV_CUDAIMGPROC) && defined(HAVE_OPENCV_CUDAOPTFLOW) + +/** @brief Computes motion between two frames assuming that all the intermediate motions are known. + +@param from Source frame index. +@param to Destination frame index. +@param motions Pair-wise motions. motions[i] denotes motion from the frame i to the frame i+1 +@return Motion from the frame from to the frame to. + */ +CV_EXPORTS Mat getMotion(int from, int to, const std::vector &motions); + +//! @} + +} // namespace videostab +} // namespace cv + +#endif diff --git a/lib/opencv/include/opencv2/videostab/inpainting.hpp b/lib/opencv/include/opencv2/videostab/inpainting.hpp new file mode 100644 index 000000000..844c68c7b --- /dev/null +++ b/lib/opencv/include/opencv2/videostab/inpainting.hpp @@ -0,0 +1,212 @@ +/*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-2011, 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_VIDEOSTAB_INPAINTINT_HPP__ +#define __OPENCV_VIDEOSTAB_INPAINTINT_HPP__ + +#include +#include "opencv2/core.hpp" +#include "opencv2/videostab/optical_flow.hpp" +#include "opencv2/videostab/fast_marching.hpp" +#include "opencv2/videostab/global_motion.hpp" +#include "opencv2/photo.hpp" + +namespace cv +{ +namespace videostab +{ + +//! @addtogroup videostab +//! @{ + +class CV_EXPORTS InpainterBase +{ +public: + InpainterBase() + : radius_(0), motionModel_(MM_UNKNOWN), frames_(0), motions_(0), + stabilizedFrames_(0), stabilizationMotions_(0) {} + + virtual ~InpainterBase() {} + + virtual void setRadius(int val) { radius_ = val; } + virtual int radius() const { return radius_; } + + virtual void setMotionModel(MotionModel val) { motionModel_ = val; } + virtual MotionModel motionModel() const { return motionModel_; } + + virtual void inpaint(int idx, Mat &frame, Mat &mask) = 0; + + + // data from stabilizer + + virtual void setFrames(const std::vector &val) { frames_ = &val; } + virtual const std::vector& frames() const { return *frames_; } + + virtual void setMotions(const std::vector &val) { motions_ = &val; } + virtual const std::vector& motions() const { return *motions_; } + + virtual void setStabilizedFrames(const std::vector &val) { stabilizedFrames_ = &val; } + virtual const std::vector& stabilizedFrames() const { return *stabilizedFrames_; } + + virtual void setStabilizationMotions(const std::vector &val) { stabilizationMotions_ = &val; } + virtual const std::vector& stabilizationMotions() const { return *stabilizationMotions_; } + +protected: + int radius_; + MotionModel motionModel_; + const std::vector *frames_; + const std::vector *motions_; + const std::vector *stabilizedFrames_; + const std::vector *stabilizationMotions_; +}; + +class CV_EXPORTS NullInpainter : public InpainterBase +{ +public: + virtual void inpaint(int /*idx*/, Mat &/*frame*/, Mat &/*mask*/) {} +}; + +class CV_EXPORTS InpaintingPipeline : public InpainterBase +{ +public: + void pushBack(Ptr inpainter) { inpainters_.push_back(inpainter); } + bool empty() const { return inpainters_.empty(); } + + virtual void setRadius(int val); + virtual void setMotionModel(MotionModel val); + virtual void setFrames(const std::vector &val); + virtual void setMotions(const std::vector &val); + virtual void setStabilizedFrames(const std::vector &val); + virtual void setStabilizationMotions(const std::vector &val); + + virtual void inpaint(int idx, Mat &frame, Mat &mask); + +private: + std::vector > inpainters_; +}; + +class CV_EXPORTS ConsistentMosaicInpainter : public InpainterBase +{ +public: + ConsistentMosaicInpainter(); + + void setStdevThresh(float val) { stdevThresh_ = val; } + float stdevThresh() const { return stdevThresh_; } + + virtual void inpaint(int idx, Mat &frame, Mat &mask); + +private: + float stdevThresh_; +}; + +class CV_EXPORTS MotionInpainter : public InpainterBase +{ +public: + MotionInpainter(); + + void setOptFlowEstimator(Ptr val) { optFlowEstimator_ = val; } + Ptr optFlowEstimator() const { return optFlowEstimator_; } + + void setFlowErrorThreshold(float val) { flowErrorThreshold_ = val; } + float flowErrorThreshold() const { return flowErrorThreshold_; } + + void setDistThreshold(float val) { distThresh_ = val; } + float distThresh() const { return distThresh_; } + + void setBorderMode(int val) { borderMode_ = val; } + int borderMode() const { return borderMode_; } + + virtual void inpaint(int idx, Mat &frame, Mat &mask); + +private: + FastMarchingMethod fmm_; + Ptr optFlowEstimator_; + float flowErrorThreshold_; + float distThresh_; + int borderMode_; + + Mat frame1_, transformedFrame1_; + Mat_ grayFrame_, transformedGrayFrame1_; + Mat_ mask1_, transformedMask1_; + Mat_ flowX_, flowY_, flowErrors_; + Mat_ flowMask_; +}; + +class CV_EXPORTS ColorAverageInpainter : public InpainterBase +{ +public: + virtual void inpaint(int idx, Mat &frame, Mat &mask); + +private: + FastMarchingMethod fmm_; +}; + +class CV_EXPORTS ColorInpainter : public InpainterBase +{ +public: + ColorInpainter(int method = INPAINT_TELEA, double radius = 2.); + + virtual void inpaint(int idx, Mat &frame, Mat &mask); + +private: + int method_; + double radius_; + Mat invMask_; +}; + +inline ColorInpainter::ColorInpainter(int _method, double _radius) + : method_(_method), radius_(_radius) {} + +CV_EXPORTS void calcFlowMask( + const Mat &flowX, const Mat &flowY, const Mat &errors, float maxError, + const Mat &mask0, const Mat &mask1, Mat &flowMask); + +CV_EXPORTS void completeFrameAccordingToFlow( + const Mat &flowMask, const Mat &flowX, const Mat &flowY, const Mat &frame1, const Mat &mask1, + float distThresh, Mat& frame0, Mat &mask0); + +//! @} + +} // namespace videostab +} // namespace cv + +#endif diff --git a/lib/opencv/include/opencv2/videostab/log.hpp b/lib/opencv/include/opencv2/videostab/log.hpp new file mode 100644 index 000000000..28625ed29 --- /dev/null +++ b/lib/opencv/include/opencv2/videostab/log.hpp @@ -0,0 +1,80 @@ +/*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-2011, 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_VIDEOSTAB_LOG_HPP__ +#define __OPENCV_VIDEOSTAB_LOG_HPP__ + +#include "opencv2/core.hpp" + +namespace cv +{ +namespace videostab +{ + +//! @addtogroup videostab +//! @{ + +class CV_EXPORTS ILog +{ +public: + virtual ~ILog() {} + virtual void print(const char *format, ...) = 0; +}; + +class CV_EXPORTS NullLog : public ILog +{ +public: + virtual void print(const char * /*format*/, ...) {} +}; + +class CV_EXPORTS LogToStdout : public ILog +{ +public: + virtual void print(const char *format, ...); +}; + +//! @} + +} // namespace videostab +} // namespace cv + +#endif diff --git a/lib/opencv/include/opencv2/videostab/motion_core.hpp b/lib/opencv/include/opencv2/videostab/motion_core.hpp new file mode 100644 index 000000000..17448e3c2 --- /dev/null +++ b/lib/opencv/include/opencv2/videostab/motion_core.hpp @@ -0,0 +1,129 @@ +/*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-2011, 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_VIDEOSTAB_MOTION_CORE_HPP__ +#define __OPENCV_VIDEOSTAB_MOTION_CORE_HPP__ + +#include +#include "opencv2/core.hpp" + +namespace cv +{ +namespace videostab +{ + +//! @addtogroup videostab_motion +//! @{ + +/** @brief Describes motion model between two point clouds. + */ +enum MotionModel +{ + MM_TRANSLATION = 0, + MM_TRANSLATION_AND_SCALE = 1, + MM_ROTATION = 2, + MM_RIGID = 3, + MM_SIMILARITY = 4, + MM_AFFINE = 5, + MM_HOMOGRAPHY = 6, + MM_UNKNOWN = 7 +}; + +/** @brief Describes RANSAC method parameters. + */ +struct CV_EXPORTS RansacParams +{ + int size; //!< subset size + float thresh; //!< max error to classify as inlier + float eps; //!< max outliers ratio + float prob; //!< probability of success + + RansacParams() : size(0), thresh(0), eps(0), prob(0) {} + /** @brief Constructor + @param size Subset size. + @param thresh Maximum re-projection error value to classify as inlier. + @param eps Maximum ratio of incorrect correspondences. + @param prob Required success probability. + */ + RansacParams(int size, float thresh, float eps, float prob); + + /** + @return Number of iterations that'll be performed by RANSAC method. + */ + int niters() const + { + return static_cast( + std::ceil(std::log(1 - prob) / std::log(1 - std::pow(1 - eps, size)))); + } + + /** + @param model Motion model. See cv::videostab::MotionModel. + @return Default RANSAC method parameters for the given motion model. + */ + static RansacParams default2dMotion(MotionModel model) + { + CV_Assert(model < MM_UNKNOWN); + if (model == MM_TRANSLATION) + return RansacParams(1, 0.5f, 0.5f, 0.99f); + if (model == MM_TRANSLATION_AND_SCALE) + return RansacParams(2, 0.5f, 0.5f, 0.99f); + if (model == MM_ROTATION) + return RansacParams(1, 0.5f, 0.5f, 0.99f); + if (model == MM_RIGID) + return RansacParams(2, 0.5f, 0.5f, 0.99f); + if (model == MM_SIMILARITY) + return RansacParams(2, 0.5f, 0.5f, 0.99f); + if (model == MM_AFFINE) + return RansacParams(3, 0.5f, 0.5f, 0.99f); + return RansacParams(4, 0.5f, 0.5f, 0.99f); + } +}; + +inline RansacParams::RansacParams(int _size, float _thresh, float _eps, float _prob) + : size(_size), thresh(_thresh), eps(_eps), prob(_prob) {} + +//! @} + +} // namespace videostab +} // namespace cv + +#endif diff --git a/lib/opencv/include/opencv2/videostab/motion_stabilizing.hpp b/lib/opencv/include/opencv2/videostab/motion_stabilizing.hpp new file mode 100644 index 000000000..3bdbfbd00 --- /dev/null +++ b/lib/opencv/include/opencv2/videostab/motion_stabilizing.hpp @@ -0,0 +1,174 @@ +/*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-2011, 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_VIDEOSTAB_MOTION_STABILIZING_HPP__ +#define __OPENCV_VIDEOSTAB_MOTION_STABILIZING_HPP__ + +#include +#include +#include "opencv2/core.hpp" +#include "opencv2/videostab/global_motion.hpp" + +namespace cv +{ +namespace videostab +{ + +//! @addtogroup videostab_motion +//! @{ + +class CV_EXPORTS IMotionStabilizer +{ +public: + virtual ~IMotionStabilizer() {} + + //! assumes that [0, size-1) is in or equals to [range.first, range.second) + virtual void stabilize( + int size, const std::vector &motions, std::pair range, + Mat *stabilizationMotions) = 0; +}; + +class CV_EXPORTS MotionStabilizationPipeline : public IMotionStabilizer +{ +public: + void pushBack(Ptr stabilizer) { stabilizers_.push_back(stabilizer); } + bool empty() const { return stabilizers_.empty(); } + + virtual void stabilize( + int size, const std::vector &motions, std::pair range, + Mat *stabilizationMotions); + +private: + std::vector > stabilizers_; +}; + +class CV_EXPORTS MotionFilterBase : public IMotionStabilizer +{ +public: + virtual ~MotionFilterBase() {} + + virtual Mat stabilize( + int idx, const std::vector &motions, std::pair range) = 0; + + virtual void stabilize( + int size, const std::vector &motions, std::pair range, + Mat *stabilizationMotions); +}; + +class CV_EXPORTS GaussianMotionFilter : public MotionFilterBase +{ +public: + GaussianMotionFilter(int radius = 15, float stdev = -1.f); + + void setParams(int radius, float stdev = -1.f); + int radius() const { return radius_; } + float stdev() const { return stdev_; } + + virtual Mat stabilize( + int idx, const std::vector &motions, std::pair range); + +private: + int radius_; + float stdev_; + std::vector weight_; +}; + +inline GaussianMotionFilter::GaussianMotionFilter(int _radius, float _stdev) { setParams(_radius, _stdev); } + +class CV_EXPORTS LpMotionStabilizer : public IMotionStabilizer +{ +public: + LpMotionStabilizer(MotionModel model = MM_SIMILARITY); + + void setMotionModel(MotionModel val) { model_ = val; } + MotionModel motionModel() const { return model_; } + + void setFrameSize(Size val) { frameSize_ = val; } + Size frameSize() const { return frameSize_; } + + void setTrimRatio(float val) { trimRatio_ = val; } + float trimRatio() const { return trimRatio_; } + + void setWeight1(float val) { w1_ = val; } + float weight1() const { return w1_; } + + void setWeight2(float val) { w2_ = val; } + float weight2() const { return w2_; } + + void setWeight3(float val) { w3_ = val; } + float weight3() const { return w3_; } + + void setWeight4(float val) { w4_ = val; } + float weight4() const { return w4_; } + + virtual void stabilize( + int size, const std::vector &motions, std::pair range, + Mat *stabilizationMotions); + +private: + MotionModel model_; + Size frameSize_; + float trimRatio_; + float w1_, w2_, w3_, w4_; + + std::vector obj_, collb_, colub_; + std::vector rows_, cols_; + std::vector elems_, rowlb_, rowub_; + + void set(int row, int col, double coef) + { + rows_.push_back(row); + cols_.push_back(col); + elems_.push_back(coef); + } +}; + +CV_EXPORTS Mat ensureInclusionConstraint(const Mat &M, Size size, float trimRatio); + +CV_EXPORTS float estimateOptimalTrimRatio(const Mat &M, Size size); + +//! @} + +} // namespace videostab +} // namespace + +#endif diff --git a/lib/opencv/include/opencv2/videostab/optical_flow.hpp b/lib/opencv/include/opencv2/videostab/optical_flow.hpp new file mode 100644 index 000000000..41d195354 --- /dev/null +++ b/lib/opencv/include/opencv2/videostab/optical_flow.hpp @@ -0,0 +1,150 @@ +/*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-2011, 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_VIDEOSTAB_OPTICAL_FLOW_HPP__ +#define __OPENCV_VIDEOSTAB_OPTICAL_FLOW_HPP__ + +#include "opencv2/core.hpp" +#include "opencv2/opencv_modules.hpp" + +#ifdef HAVE_OPENCV_CUDAOPTFLOW + #include "opencv2/cudaoptflow.hpp" +#endif + +namespace cv +{ +namespace videostab +{ + +//! @addtogroup videostab +//! @{ + +class CV_EXPORTS ISparseOptFlowEstimator +{ +public: + virtual ~ISparseOptFlowEstimator() {} + virtual void run( + InputArray frame0, InputArray frame1, InputArray points0, InputOutputArray points1, + OutputArray status, OutputArray errors) = 0; +}; + +class CV_EXPORTS IDenseOptFlowEstimator +{ +public: + virtual ~IDenseOptFlowEstimator() {} + virtual void run( + InputArray frame0, InputArray frame1, InputOutputArray flowX, InputOutputArray flowY, + OutputArray errors) = 0; +}; + +class CV_EXPORTS PyrLkOptFlowEstimatorBase +{ +public: + PyrLkOptFlowEstimatorBase() { setWinSize(Size(21, 21)); setMaxLevel(3); } + + virtual void setWinSize(Size val) { winSize_ = val; } + virtual Size winSize() const { return winSize_; } + + virtual void setMaxLevel(int val) { maxLevel_ = val; } + virtual int maxLevel() const { return maxLevel_; } + virtual ~PyrLkOptFlowEstimatorBase() {} + +protected: + Size winSize_; + int maxLevel_; +}; + +class CV_EXPORTS SparsePyrLkOptFlowEstimator + : public PyrLkOptFlowEstimatorBase, public ISparseOptFlowEstimator +{ +public: + virtual void run( + InputArray frame0, InputArray frame1, InputArray points0, InputOutputArray points1, + OutputArray status, OutputArray errors); +}; + +#ifdef HAVE_OPENCV_CUDAOPTFLOW + +class CV_EXPORTS SparsePyrLkOptFlowEstimatorGpu + : public PyrLkOptFlowEstimatorBase, public ISparseOptFlowEstimator +{ +public: + SparsePyrLkOptFlowEstimatorGpu(); + + virtual void run( + InputArray frame0, InputArray frame1, InputArray points0, InputOutputArray points1, + OutputArray status, OutputArray errors); + + void run(const cuda::GpuMat &frame0, const cuda::GpuMat &frame1, const cuda::GpuMat &points0, cuda::GpuMat &points1, + cuda::GpuMat &status, cuda::GpuMat &errors); + + void run(const cuda::GpuMat &frame0, const cuda::GpuMat &frame1, const cuda::GpuMat &points0, cuda::GpuMat &points1, + cuda::GpuMat &status); + +private: + Ptr optFlowEstimator_; + cuda::GpuMat frame0_, frame1_, points0_, points1_, status_, errors_; +}; + +class CV_EXPORTS DensePyrLkOptFlowEstimatorGpu + : public PyrLkOptFlowEstimatorBase, public IDenseOptFlowEstimator +{ +public: + DensePyrLkOptFlowEstimatorGpu(); + + virtual void run( + InputArray frame0, InputArray frame1, InputOutputArray flowX, InputOutputArray flowY, + OutputArray errors); + +private: + Ptr optFlowEstimator_; + cuda::GpuMat frame0_, frame1_, flowX_, flowY_, errors_; +}; + +#endif + +//! @} + +} // namespace videostab +} // namespace cv + +#endif diff --git a/lib/opencv/include/opencv2/videostab/outlier_rejection.hpp b/lib/opencv/include/opencv2/videostab/outlier_rejection.hpp new file mode 100644 index 000000000..9e40f854c --- /dev/null +++ b/lib/opencv/include/opencv2/videostab/outlier_rejection.hpp @@ -0,0 +1,101 @@ +/*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-2011, 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_VIDEOSTAB_OUTLIER_REJECTION_HPP__ +#define __OPENCV_VIDEOSTAB_OUTLIER_REJECTION_HPP__ + +#include +#include "opencv2/core.hpp" +#include "opencv2/videostab/motion_core.hpp" + +namespace cv +{ +namespace videostab +{ + +//! @addtogroup videostab +//! @{ + +class CV_EXPORTS IOutlierRejector +{ +public: + virtual ~IOutlierRejector() {} + + virtual void process( + Size frameSize, InputArray points0, InputArray points1, OutputArray mask) = 0; +}; + +class CV_EXPORTS NullOutlierRejector : public IOutlierRejector +{ +public: + virtual void process( + Size frameSize, InputArray points0, InputArray points1, OutputArray mask); +}; + +class CV_EXPORTS TranslationBasedLocalOutlierRejector : public IOutlierRejector +{ +public: + TranslationBasedLocalOutlierRejector(); + + void setCellSize(Size val) { cellSize_ = val; } + Size cellSize() const { return cellSize_; } + + void setRansacParams(RansacParams val) { ransacParams_ = val; } + RansacParams ransacParams() const { return ransacParams_; } + + virtual void process( + Size frameSize, InputArray points0, InputArray points1, OutputArray mask); + +private: + Size cellSize_; + RansacParams ransacParams_; + + typedef std::vector Cell; + std::vector grid_; +}; + +//! @} + +} // namespace videostab +} // namespace cv + +#endif diff --git a/lib/opencv/include/opencv2/videostab/ring_buffer.hpp b/lib/opencv/include/opencv2/videostab/ring_buffer.hpp new file mode 100644 index 000000000..7cc3f03e9 --- /dev/null +++ b/lib/opencv/include/opencv2/videostab/ring_buffer.hpp @@ -0,0 +1,72 @@ +/*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-2011, 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_VIDEOSTAB_RING_BUFFER_HPP__ +#define __OPENCV_VIDEOSTAB_RING_BUFFER_HPP__ + +#include +#include "opencv2/imgproc.hpp" + +namespace cv +{ +namespace videostab +{ + +//! @addtogroup videostab +//! @{ + +template inline T& at(int idx, std::vector &items) +{ + return items[cv::borderInterpolate(idx, static_cast(items.size()), cv::BORDER_WRAP)]; +} + +template inline const T& at(int idx, const std::vector &items) +{ + return items[cv::borderInterpolate(idx, static_cast(items.size()), cv::BORDER_WRAP)]; +} + +//! @} + +} // namespace videostab +} // namespace cv + +#endif diff --git a/lib/opencv/include/opencv2/videostab/stabilizer.hpp b/lib/opencv/include/opencv2/videostab/stabilizer.hpp new file mode 100644 index 000000000..c18d31416 --- /dev/null +++ b/lib/opencv/include/opencv2/videostab/stabilizer.hpp @@ -0,0 +1,200 @@ +/*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-2011, 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_VIDEOSTAB_STABILIZER_HPP__ +#define __OPENCV_VIDEOSTAB_STABILIZER_HPP__ + +#include +#include +#include "opencv2/core.hpp" +#include "opencv2/imgproc.hpp" +#include "opencv2/videostab/global_motion.hpp" +#include "opencv2/videostab/motion_stabilizing.hpp" +#include "opencv2/videostab/frame_source.hpp" +#include "opencv2/videostab/log.hpp" +#include "opencv2/videostab/inpainting.hpp" +#include "opencv2/videostab/deblurring.hpp" +#include "opencv2/videostab/wobble_suppression.hpp" + +namespace cv +{ +namespace videostab +{ + +//! @addtogroup videostab +//! @{ + +class CV_EXPORTS StabilizerBase +{ +public: + virtual ~StabilizerBase() {} + + void setLog(Ptr ilog) { log_ = ilog; } + Ptr log() const { return log_; } + + void setRadius(int val) { radius_ = val; } + int radius() const { return radius_; } + + void setFrameSource(Ptr val) { frameSource_ = val; } + Ptr frameSource() const { return frameSource_; } + + void setMotionEstimator(Ptr val) { motionEstimator_ = val; } + Ptr motionEstimator() const { return motionEstimator_; } + + void setDeblurer(Ptr val) { deblurer_ = val; } + Ptr deblurrer() const { return deblurer_; } + + void setTrimRatio(float val) { trimRatio_ = val; } + float trimRatio() const { return trimRatio_; } + + void setCorrectionForInclusion(bool val) { doCorrectionForInclusion_ = val; } + bool doCorrectionForInclusion() const { return doCorrectionForInclusion_; } + + void setBorderMode(int val) { borderMode_ = val; } + int borderMode() const { return borderMode_; } + + void setInpainter(Ptr val) { inpainter_ = val; } + Ptr inpainter() const { return inpainter_; } + +protected: + StabilizerBase(); + + void reset(); + Mat nextStabilizedFrame(); + bool doOneIteration(); + virtual void setUp(const Mat &firstFrame); + virtual Mat estimateMotion() = 0; + virtual Mat estimateStabilizationMotion() = 0; + void stabilizeFrame(); + virtual Mat postProcessFrame(const Mat &frame); + void logProcessingTime(); + + Ptr log_; + Ptr frameSource_; + Ptr motionEstimator_; + Ptr deblurer_; + Ptr inpainter_; + int radius_; + float trimRatio_; + bool doCorrectionForInclusion_; + int borderMode_; + + Size frameSize_; + Mat frameMask_; + int curPos_; + int curStabilizedPos_; + bool doDeblurring_; + Mat preProcessedFrame_; + bool doInpainting_; + Mat inpaintingMask_; + Mat finalFrame_; + std::vector frames_; + std::vector motions_; // motions_[i] is the motion from i-th to i+1-th frame + std::vector blurrinessRates_; + std::vector stabilizedFrames_; + std::vector stabilizedMasks_; + std::vector stabilizationMotions_; + clock_t processingStartTime_; +}; + +class CV_EXPORTS OnePassStabilizer : public StabilizerBase, public IFrameSource +{ +public: + OnePassStabilizer(); + + void setMotionFilter(Ptr val) { motionFilter_ = val; } + Ptr motionFilter() const { return motionFilter_; } + + virtual void reset(); + virtual Mat nextFrame() { return nextStabilizedFrame(); } + +protected: + virtual void setUp(const Mat &firstFrame); + virtual Mat estimateMotion(); + virtual Mat estimateStabilizationMotion(); + virtual Mat postProcessFrame(const Mat &frame); + + Ptr motionFilter_; +}; + +class CV_EXPORTS TwoPassStabilizer : public StabilizerBase, public IFrameSource +{ +public: + TwoPassStabilizer(); + + void setMotionStabilizer(Ptr val) { motionStabilizer_ = val; } + Ptr motionStabilizer() const { return motionStabilizer_; } + + void setWobbleSuppressor(Ptr val) { wobbleSuppressor_ = val; } + Ptr wobbleSuppressor() const { return wobbleSuppressor_; } + + void setEstimateTrimRatio(bool val) { mustEstTrimRatio_ = val; } + bool mustEstimateTrimaRatio() const { return mustEstTrimRatio_; } + + virtual void reset(); + virtual Mat nextFrame(); + +protected: + void runPrePassIfNecessary(); + + virtual void setUp(const Mat &firstFrame); + virtual Mat estimateMotion(); + virtual Mat estimateStabilizationMotion(); + virtual Mat postProcessFrame(const Mat &frame); + + Ptr motionStabilizer_; + Ptr wobbleSuppressor_; + bool mustEstTrimRatio_; + + int frameCount_; + bool isPrePassDone_; + bool doWobbleSuppression_; + std::vector motions2_; + Mat suppressedFrame_; +}; + +//! @} + +} // namespace videostab +} // namespace cv + +#endif diff --git a/lib/opencv/include/opencv2/videostab/wobble_suppression.hpp b/lib/opencv/include/opencv2/videostab/wobble_suppression.hpp new file mode 100644 index 000000000..3f0a9432b --- /dev/null +++ b/lib/opencv/include/opencv2/videostab/wobble_suppression.hpp @@ -0,0 +1,140 @@ +/*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-2011, 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_VIDEOSTAB_WOBBLE_SUPPRESSION_HPP__ +#define __OPENCV_VIDEOSTAB_WOBBLE_SUPPRESSION_HPP__ + +#include +#include "opencv2/core.hpp" +#include "opencv2/core/cuda.hpp" +#include "opencv2/videostab/global_motion.hpp" +#include "opencv2/videostab/log.hpp" + +namespace cv +{ +namespace videostab +{ + +//! @addtogroup videostab +//! @{ + +class CV_EXPORTS WobbleSuppressorBase +{ +public: + WobbleSuppressorBase(); + + virtual ~WobbleSuppressorBase() {} + + void setMotionEstimator(Ptr val) { motionEstimator_ = val; } + Ptr motionEstimator() const { return motionEstimator_; } + + virtual void suppress(int idx, const Mat &frame, Mat &result) = 0; + + + // data from stabilizer + + virtual void setFrameCount(int val) { frameCount_ = val; } + virtual int frameCount() const { return frameCount_; } + + virtual void setMotions(const std::vector &val) { motions_ = &val; } + virtual const std::vector& motions() const { return *motions_; } + + virtual void setMotions2(const std::vector &val) { motions2_ = &val; } + virtual const std::vector& motions2() const { return *motions2_; } + + virtual void setStabilizationMotions(const std::vector &val) { stabilizationMotions_ = &val; } + virtual const std::vector& stabilizationMotions() const { return *stabilizationMotions_; } + +protected: + Ptr motionEstimator_; + int frameCount_; + const std::vector *motions_; + const std::vector *motions2_; + const std::vector *stabilizationMotions_; +}; + +class CV_EXPORTS NullWobbleSuppressor : public WobbleSuppressorBase +{ +public: + virtual void suppress(int idx, const Mat &frame, Mat &result); +}; + +class CV_EXPORTS MoreAccurateMotionWobbleSuppressorBase : public WobbleSuppressorBase +{ +public: + virtual void setPeriod(int val) { period_ = val; } + virtual int period() const { return period_; } + +protected: + MoreAccurateMotionWobbleSuppressorBase() { setPeriod(30); } + + int period_; +}; + +class CV_EXPORTS MoreAccurateMotionWobbleSuppressor : public MoreAccurateMotionWobbleSuppressorBase +{ +public: + virtual void suppress(int idx, const Mat &frame, Mat &result); + +private: + Mat_ mapx_, mapy_; +}; + +#if defined(HAVE_OPENCV_CUDAWARPING) +class CV_EXPORTS MoreAccurateMotionWobbleSuppressorGpu : public MoreAccurateMotionWobbleSuppressorBase +{ +public: + void suppress(int idx, const cuda::GpuMat &frame, cuda::GpuMat &result); + virtual void suppress(int idx, const Mat &frame, Mat &result); + +private: + cuda::GpuMat frameDevice_, resultDevice_; + cuda::GpuMat mapx_, mapy_; +}; +#endif + +//! @} + +} // namespace videostab +} // namespace cv + +#endif diff --git a/lib/opencv/include/opencv2/world.hpp b/lib/opencv/include/opencv2/world.hpp new file mode 100644 index 000000000..2442f2c27 --- /dev/null +++ b/lib/opencv/include/opencv2/world.hpp @@ -0,0 +1,58 @@ +/*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-2010, 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_WORLD_HPP__ +#define __OPENCV_WORLD_HPP__ + +#include "opencv2/core.hpp" + +#ifdef __cplusplus +namespace cv +{ + +CV_EXPORTS_W bool initAll(); + +} + +#endif + +#endif diff --git a/lib/opencv/x64/vc12/bin/opencv_ffmpeg310_64.dll b/lib/opencv/x64/vc12/bin/opencv_ffmpeg310_64.dll new file mode 100644 index 000000000..040198c56 Binary files /dev/null and b/lib/opencv/x64/vc12/bin/opencv_ffmpeg310_64.dll differ diff --git a/lib/opencv/x64/vc12/bin/opencv_world310.dll b/lib/opencv/x64/vc12/bin/opencv_world310.dll new file mode 100644 index 000000000..67a2233f9 Binary files /dev/null and b/lib/opencv/x64/vc12/bin/opencv_world310.dll differ diff --git a/lib/opencv/x64/vc12/bin/opencv_world310d.dll b/lib/opencv/x64/vc12/bin/opencv_world310d.dll new file mode 100644 index 000000000..13347c1d1 Binary files /dev/null and b/lib/opencv/x64/vc12/bin/opencv_world310d.dll differ diff --git a/lib/opencv/x64/vc12/lib/opencv_world310.lib b/lib/opencv/x64/vc12/lib/opencv_world310.lib new file mode 100644 index 000000000..21ac051e3 Binary files /dev/null and b/lib/opencv/x64/vc12/lib/opencv_world310.lib differ diff --git a/lib/opencv/x64/vc12/lib/opencv_world310d.lib b/lib/opencv/x64/vc12/lib/opencv_world310d.lib new file mode 100644 index 000000000..c87c71cc8 Binary files /dev/null and b/lib/opencv/x64/vc12/lib/opencv_world310d.lib differ diff --git a/lib/opencv/x86/vc12/bin/OpenCvSharpExtern.dll b/lib/opencv/x86/vc12/bin/OpenCvSharpExtern.dll new file mode 100644 index 000000000..fa390ac2b Binary files /dev/null and b/lib/opencv/x86/vc12/bin/OpenCvSharpExtern.dll differ diff --git a/lib/opencv/x86/vc12/bin/msvcp120.dll b/lib/opencv/x86/vc12/bin/msvcp120.dll new file mode 100644 index 000000000..a237d2d77 Binary files /dev/null and b/lib/opencv/x86/vc12/bin/msvcp120.dll differ diff --git a/lib/opencv/x86/vc12/bin/msvcr120.dll b/lib/opencv/x86/vc12/bin/msvcr120.dll new file mode 100644 index 000000000..8c36149a6 Binary files /dev/null and b/lib/opencv/x86/vc12/bin/msvcr120.dll differ diff --git a/lib/opencv/x86/vc12/bin/opencv_ffmpeg310.dll b/lib/opencv/x86/vc12/bin/opencv_ffmpeg310.dll new file mode 100644 index 000000000..4abb8ca9f Binary files /dev/null and b/lib/opencv/x86/vc12/bin/opencv_ffmpeg310.dll differ diff --git a/lib/opencv/x86/vc12/bin/opencv_world310.dll b/lib/opencv/x86/vc12/bin/opencv_world310.dll new file mode 100644 index 000000000..f7fc9cd2f Binary files /dev/null and b/lib/opencv/x86/vc12/bin/opencv_world310.dll differ diff --git a/lib/opencv/x86/vc12/lib/opencv_world310.lib b/lib/opencv/x86/vc12/lib/opencv_world310.lib new file mode 100644 index 000000000..aa6e4aae5 Binary files /dev/null and b/lib/opencv/x86/vc12/lib/opencv_world310.lib differ diff --git a/lib/opencv/x86/vc12/staticlib/ippicvmt.lib b/lib/opencv/x86/vc12/staticlib/ippicvmt.lib new file mode 100644 index 000000000..d32c20105 Binary files /dev/null and b/lib/opencv/x86/vc12/staticlib/ippicvmt.lib differ diff --git a/lib/vc++/x64/msvcp110.dll b/lib/vc++/x64/msvcp110.dll new file mode 100644 index 000000000..7e278956d Binary files /dev/null and b/lib/vc++/x64/msvcp110.dll differ diff --git a/lib/vc++/x64/msvcp120.dll b/lib/vc++/x64/msvcp120.dll new file mode 100644 index 000000000..4ea1efa73 Binary files /dev/null and b/lib/vc++/x64/msvcp120.dll differ diff --git a/lib/vc++/x64/msvcr110.dll b/lib/vc++/x64/msvcr110.dll new file mode 100644 index 000000000..dd484a588 Binary files /dev/null and b/lib/vc++/x64/msvcr110.dll differ diff --git a/lib/vc++/x64/msvcr120.dll b/lib/vc++/x64/msvcr120.dll new file mode 100644 index 000000000..d711c9223 Binary files /dev/null and b/lib/vc++/x64/msvcr120.dll differ diff --git a/lib/vc++/x86/msvcp110.dll b/lib/vc++/x86/msvcp110.dll new file mode 100644 index 000000000..93fab5683 Binary files /dev/null and b/lib/vc++/x86/msvcp110.dll differ diff --git a/lib/vc++/x86/msvcp120.dll b/lib/vc++/x86/msvcp120.dll new file mode 100644 index 000000000..a237d2d77 Binary files /dev/null and b/lib/vc++/x86/msvcp120.dll differ diff --git a/lib/vc++/x86/msvcr110.dll b/lib/vc++/x86/msvcr110.dll new file mode 100644 index 000000000..1ce960d75 Binary files /dev/null and b/lib/vc++/x86/msvcr110.dll differ diff --git a/lib/vc++/x86/msvcr120.dll b/lib/vc++/x86/msvcr120.dll new file mode 100644 index 000000000..8c36149a6 Binary files /dev/null and b/lib/vc++/x86/msvcr120.dll differ diff --git a/nuget/OpenCvSharp3-AnyCPU.nupkg b/nuget/OpenCvSharp3-AnyCPU.nupkg new file mode 100644 index 000000000..8c1b381f7 Binary files /dev/null and b/nuget/OpenCvSharp3-AnyCPU.nupkg differ diff --git a/nuget/OpenCvSharp3-AnyCPU.nuspec b/nuget/OpenCvSharp3-AnyCPU.nuspec new file mode 100644 index 000000000..0c8f679ee --- /dev/null +++ b/nuget/OpenCvSharp3-AnyCPU.nuspec @@ -0,0 +1,74 @@ + + + + OpenCvSharp3-AnyCPU + 3.1.0.20160622 + OpenCvSharp3 + shimat + http://opensource.org/licenses/BSD-3-Clause + https://github.com/shimat/opencvsharp + https://raw.githubusercontent.com/shimat/opencvsharp/master/nuget/icon/mandrill-ico.png + false + OpenCV wrapper for .NET Framework +

OpenCV 3.x wrapper + - Fixed #210, #222 and #227 + Copyright 2008-2016 + Image Processing OpenCV Wrapper FFI + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nuget/OpenCvSharp3-AnyCPU.props b/nuget/OpenCvSharp3-AnyCPU.props new file mode 100644 index 000000000..f075e507b --- /dev/null +++ b/nuget/OpenCvSharp3-AnyCPU.props @@ -0,0 +1,49 @@ + + + $(MSBuildThisFileDirectory)\..\NativeDlls + + + + dll\x86\OpenCvSharpExtern.dll + PreserveNewest + + + dll\x86\msvcp120.dll + PreserveNewest + + + dll\x86\msvcr120.dll + PreserveNewest + + + dll\x86\opencv_world310.dll + PreserveNewest + + + dll\x86\opencv_ffmpeg310.dll + PreserveNewest + + + + + dll\x64\OpenCvSharpExtern.dll + PreserveNewest + + + dll\x64\msvcp120.dll + PreserveNewest + + + dll\x64\msvcr120.dll + PreserveNewest + + + dll\x64\opencv_world310.dll + PreserveNewest + + + dll\x64\opencv_ffmpeg310_64.dll + PreserveNewest + + + diff --git a/nuget/OpenCvSharp3-WithoutDll.nupkg b/nuget/OpenCvSharp3-WithoutDll.nupkg new file mode 100644 index 000000000..4fff8af9a Binary files /dev/null and b/nuget/OpenCvSharp3-WithoutDll.nupkg differ diff --git a/nuget/OpenCvSharp3-WithoutDll.nuspec b/nuget/OpenCvSharp3-WithoutDll.nuspec new file mode 100644 index 000000000..b5d478795 --- /dev/null +++ b/nuget/OpenCvSharp3-WithoutDll.nuspec @@ -0,0 +1,70 @@ + + + + OpenCvSharp3-WithoutDll + 3.1.0.20160622 + OpenCvSharp3 (without DLLs) + shimat + http://opensource.org/licenses/BSD-3-Clause + https://github.com/shimat/opencvsharp + https://raw.githubusercontent.com/shimat/opencvsharp/master/nuget/icon/mandrill-ico.png + false + OpenCV wrapper for .NET Framework + OpenCV 3.x wrapper + - Fixed #210, #222 and #227 + Copyright 2008-2016 + Image Processing OpenCV Wrapper FFI + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nuget/OpenCvSharp3-WithoutDll.props b/nuget/OpenCvSharp3-WithoutDll.props new file mode 100644 index 000000000..50367430c --- /dev/null +++ b/nuget/OpenCvSharp3-WithoutDll.props @@ -0,0 +1,33 @@ + + + $(MSBuildThisFileDirectory)\..\NativeDlls + + + + dll\x86\OpenCvSharpExtern.dll + PreserveNewest + + + dll\x86\msvcp120.dll + PreserveNewest + + + dll\x86\msvcr120.dll + PreserveNewest + + + + + dll\x64\msvcp120.dll + PreserveNewest + + + dll\x64\msvcr120.dll + PreserveNewest + + + dll\x64\OpenCvSharpExtern.dll + PreserveNewest + + + diff --git a/nuget/icon/Girl.jpg b/nuget/icon/Girl.jpg new file mode 100644 index 000000000..d0a0219b9 Binary files /dev/null and b/nuget/icon/Girl.jpg differ diff --git a/nuget/icon/Lenna.ico b/nuget/icon/Lenna.ico new file mode 100644 index 000000000..33132ced4 Binary files /dev/null and b/nuget/icon/Lenna.ico differ diff --git a/nuget/icon/lenna-icon.png b/nuget/icon/lenna-icon.png new file mode 100644 index 000000000..d658b0023 Binary files /dev/null and b/nuget/icon/lenna-icon.png differ diff --git a/nuget/icon/mandrill-ico.png b/nuget/icon/mandrill-ico.png new file mode 100644 index 000000000..fe55e528b Binary files /dev/null and b/nuget/icon/mandrill-ico.png differ diff --git a/nuget/old/OpenCvSharp-x64.nuspec b/nuget/old/OpenCvSharp-x64.nuspec new file mode 100644 index 000000000..fd0b32c36 --- /dev/null +++ b/nuget/old/OpenCvSharp-x64.nuspec @@ -0,0 +1,76 @@ + + + + OpenCvSharp-x64 + 2.4.8.20140510 + OpenCvSharp x64 + shimat + http://www.gnu.org/licenses/lgpl-3.0.en.html + https://github.com/shimat/opencvsharp + https://raw.githubusercontent.com/shimat/opencvsharp/master/nuget/icon/mandrill-ico.png + false + OpenCV wrapper for .NET Framework + - Fixed IplImage memory leak +- Upgraded C++ Compiler (vc100 -> vc110) +- Fixed crash bugs in x64 + Copyright 2008-2014 + Image Processing OpenCV Wrapper FFI + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nuget/old/OpenCvSharp-x86.nuspec b/nuget/old/OpenCvSharp-x86.nuspec new file mode 100644 index 000000000..825baecf8 --- /dev/null +++ b/nuget/old/OpenCvSharp-x86.nuspec @@ -0,0 +1,76 @@ + + + + OpenCvSharp-x86 + 2.4.8.20140510 + OpenCvSharp x86 + shimat + http://www.gnu.org/licenses/lgpl-3.0.en.html + https://github.com/shimat/opencvsharp + https://raw.githubusercontent.com/shimat/opencvsharp/master/nuget/icon/lenna-icon.png + false + OpenCV wrapper for .NET Framework + - Fixed IplImage memory leak +- Upgraded C++ Compiler (vc100 -> vc110) +- Fixed crash bugs in x64 + Copyright 2008-2014 + Image Processing OpenCV Wrapper FFI + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nuget/old/tools-x64/init.ps1 b/nuget/old/tools-x64/init.ps1 new file mode 100644 index 000000000..c766fb995 --- /dev/null +++ b/nuget/old/tools-x64/init.ps1 @@ -0,0 +1 @@ +param($installPath, $toolsPath, $package) \ No newline at end of file diff --git a/nuget/old/tools-x64/install.ps1 b/nuget/old/tools-x64/install.ps1 new file mode 100644 index 000000000..20e0cc377 --- /dev/null +++ b/nuget/old/tools-x64/install.ps1 @@ -0,0 +1,78 @@ +param($installPath, $toolsPath, $package, $project) + +$platform = "x64" + +# 指定したディレクトリを「新しい場合はコピー」にする +function MarkDirectoryAsCopy($item) +{ + $item.ProjectItems | ForEach-Object { MarkFileAsCopy($_) } +} +# 指定したファイルを「新しい場合はコピー」にする +function MarkFileAsCopy($item) +{ + Try + { + Write-Host Try set $item.Name + $item.Properties.Item("CopyToOutputDirectory").Value = 2 # copy if newer + } + Catch + { + Write-Host RecurseOn $item.Name + MarkDirectoryAsCopyToOutputRecursive($item) + } +} + +$copyFiles = @( + "msvcp110.dll"; + "msvcr110.dll"; + "OpenCvSharpExtern.dll"; + "opencv_calib3d248.dll"; + "opencv_contrib248.dll"; + "opencv_core248.dll"; + "opencv_features2d248.dll"; + "opencv_ffmpeg248_64.dll"; + "opencv_gpu248.dll"; + "opencv_flann248.dll"; + "opencv_highgui248.dll"; + "opencv_imgproc248.dll"; + "opencv_legacy248.dll"; + "opencv_ml248.dll"; + "opencv_nonfree248.dll"; + "opencv_objdetect248.dll"; + "opencv_ocl248.dll"; + "opencv_photo248.dll"; + "opencv_stitching248.dll"; + "opencv_superres248.dll"; + "opencv_video248.dll"; + "opencv_videostab248.dll"; +) +foreach ( $file in $copyFiles ) +{ + MarkFileAsCopy($project.ProjectItems.Item($file)) +} + + + +function HasPlatform($manager, $platformName) +{ + $platforms = [Array] $manager.PlatformNames + $index = [System.Array]::IndexOf($platforms, $platformName) + $index -ge 0 +} + +$manager = $project.ConfigurationManager +$configs = [Array] $manager.PlatformNames +$hasPlatform = HasPlatform $manager $platform +if(-not $hasPlatform) +{ + [void]$manager.AddPlatform($platform, "Any CPU", $true) +} + + + +#foreach ($config in $configs) +#{ +# [System.Windows.Forms.MessageBox]::Show(HasPlatform) +#} + + diff --git a/nuget/old/tools-x64/uninstall.ps1 b/nuget/old/tools-x64/uninstall.ps1 new file mode 100644 index 000000000..d25f55729 --- /dev/null +++ b/nuget/old/tools-x64/uninstall.ps1 @@ -0,0 +1 @@ +param($installPath, $toolsPath, $package, $project) \ No newline at end of file diff --git a/nuget/old/tools-x86/init.ps1 b/nuget/old/tools-x86/init.ps1 new file mode 100644 index 000000000..c766fb995 --- /dev/null +++ b/nuget/old/tools-x86/init.ps1 @@ -0,0 +1 @@ +param($installPath, $toolsPath, $package) \ No newline at end of file diff --git a/nuget/old/tools-x86/install.ps1 b/nuget/old/tools-x86/install.ps1 new file mode 100644 index 000000000..2a4492e70 --- /dev/null +++ b/nuget/old/tools-x86/install.ps1 @@ -0,0 +1,118 @@ +param($installPath, $toolsPath, $package, $project) + +# 指定したディレクトリを「新しい場合はコピー」にする +function MarkDirectoryAsCopy($item) +{ + $item.ProjectItems | ForEach-Object { MarkFileAsCopy($_) } +} +# 指定したファイルを「新しい場合はコピー」にする +function MarkFileAsCopy($item) +{ + Try + { + Write-Host Try set $item.Name + $item.Properties.Item("CopyToOutputDirectory").Value = 2 # copy if newer + } + Catch + { + Write-Host RecurseOn $item.Name + MarkDirectoryAsCopyToOutputRecursive($item) + } +} + +$platforms = @( + "x86"; + "x64"; +) +$copyFilesX86 = @( + "msvcp110.dll"; + "msvcr110.dll"; + "OpenCvSharpExtern.dll"; + "opencv_calib3d248.dll"; + "opencv_contrib248.dll"; + "opencv_core248.dll"; + "opencv_features2d248.dll"; + "opencv_ffmpeg248.dll"; + "opencv_gpu248.dll"; + "opencv_flann248.dll"; + "opencv_highgui248.dll"; + "opencv_imgproc248.dll"; + "opencv_legacy248.dll"; + "opencv_ml248.dll"; + "opencv_nonfree248.dll"; + "opencv_ocl248.dll"; + "opencv_objdetect248.dll"; + "opencv_photo248.dll"; + "opencv_stitching248.dll"; + "opencv_superres248.dll"; + "opencv_video248.dll"; + "opencv_videostab248.dll"; +) +$copyFilesX64 = @( + "msvcp110.dll"; + "msvcr110.dll"; + "OpenCvSharpExtern.dll"; + "opencv_calib3d248.dll"; + "opencv_contrib248.dll"; + "opencv_core248.dll"; + "opencv_features2d248.dll"; + "opencv_ffmpeg248_64.dll"; + "opencv_gpu248.dll"; + "opencv_flann248.dll"; + "opencv_highgui248.dll"; + "opencv_imgproc248.dll"; + "opencv_legacy248.dll"; + "opencv_ml248.dll"; + "opencv_nonfree248.dll"; + "opencv_ocl248.dll"; + "opencv_objdetect248.dll"; + "opencv_photo248.dll"; + "opencv_stitching248.dll"; + "opencv_superres248.dll"; + "opencv_video248.dll"; + "opencv_videostab248.dll"; +) + +# x86 +foreach ($file in $copyFilesX86) +{ + $dllDir = $project.ProjectItems.Item("dll") + $platFormDir = $dllDir.ProjectItems.Item("x86") + MarkFileAsCopy($platFormDir.ProjectItems.Item($file)) +} +# x64 +foreach ($file in $copyFilesX64) +{ + $dllDir = $project.ProjectItems.Item("dll") + $platFormDir = $dllDir.ProjectItems.Item("x64") + MarkFileAsCopy($platFormDir.ProjectItems.Item($file)) +} + + + +function HasPlatform($manager, $platformName) +{ + $myPlatforms = [Array] $manager.PlatformNames + $index = [System.Array]::IndexOf($myPlatforms, $platformName) + $index -ge 0 +} + +$manager = $project.ConfigurationManager +$configs = [Array] $manager.PlatformNames + +foreach ($p in $platforms) +{ + $hasPlatform = HasPlatform $manager $p + if(-not $hasPlatform) + { + [void]$manager.AddPlatform($p, "Any CPU", $true) + } +} + + +#foreach ($config in $configs) +#{ +# [System.Windows.Forms.MessageBox]::Show(HasPlatform) +#} + + diff --git a/nuget/old/tools-x86/uninstall.ps1 b/nuget/old/tools-x86/uninstall.ps1 new file mode 100644 index 000000000..d25f55729 --- /dev/null +++ b/nuget/old/tools-x86/uninstall.ps1 @@ -0,0 +1 @@ +param($installPath, $toolsPath, $package, $project) \ No newline at end of file diff --git a/nuget/packages.config b/nuget/packages.config new file mode 100644 index 000000000..6b8deb9c9 --- /dev/null +++ b/nuget/packages.config @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/nuget/tools/init.ps1 b/nuget/tools/init.ps1 new file mode 100644 index 000000000..c766fb995 --- /dev/null +++ b/nuget/tools/init.ps1 @@ -0,0 +1 @@ +param($installPath, $toolsPath, $package) \ No newline at end of file diff --git a/nuget/tools/install-AnyCPU.ps1 b/nuget/tools/install-AnyCPU.ps1 new file mode 100644 index 000000000..e62049c30 --- /dev/null +++ b/nuget/tools/install-AnyCPU.ps1 @@ -0,0 +1,118 @@ +param($installPath, $toolsPath, $package, $project) + +# 指定したディレクトリを「新しい場合はコピー」にする +function MarkDirectoryAsCopy($item) +{ + $item.ProjectItems | ForEach-Object { MarkFileAsCopy($_) } +} +# 指定したファイルを「新しい場合はコピー」にする +function MarkFileAsCopy($item) +{ + Try + { + Write-Host Try set $item.Name + $item.Properties.Item("CopyToOutputDirectory").Value = 2 # copy if newer + } + Catch + { + Write-Host RecurseOn $item.Name + MarkDirectoryAsCopyToOutputRecursive($item) + } +} + +$platforms = @( + "x86"; + "x64"; +) +$copyFilesX86 = @( + "msvcp110.dll"; + "msvcr110.dll"; + "OpenCvSharpExtern.dll"; + "opencv_calib3d249.dll"; + "opencv_contrib249.dll"; + "opencv_core249.dll"; + "opencv_features2d249.dll"; + "opencv_ffmpeg249.dll"; + "opencv_gpu249.dll"; + "opencv_flann249.dll"; + "opencv_highgui249.dll"; + "opencv_imgproc249.dll"; + "opencv_legacy249.dll"; + "opencv_ml249.dll"; + "opencv_nonfree249.dll"; + "opencv_ocl249.dll"; + "opencv_objdetect249.dll"; + "opencv_photo249.dll"; + "opencv_stitching249.dll"; + "opencv_superres249.dll"; + "opencv_video249.dll"; + "opencv_videostab249.dll"; +) +$copyFilesX64 = @( + "msvcp110.dll"; + "msvcr110.dll"; + "OpenCvSharpExtern.dll"; + "opencv_calib3d249.dll"; + "opencv_contrib249.dll"; + "opencv_core249.dll"; + "opencv_features2d249.dll"; + "opencv_ffmpeg249_64.dll"; + "opencv_gpu249.dll"; + "opencv_flann249.dll"; + "opencv_highgui249.dll"; + "opencv_imgproc249.dll"; + "opencv_legacy249.dll"; + "opencv_ml249.dll"; + "opencv_nonfree249.dll"; + "opencv_ocl249.dll"; + "opencv_objdetect249.dll"; + "opencv_photo249.dll"; + "opencv_stitching249.dll"; + "opencv_superres249.dll"; + "opencv_video249.dll"; + "opencv_videostab249.dll"; +) + +# x86 +foreach ($file in $copyFilesX86) +{ + $dllDir = $project.ProjectItems.Item("dll") + $platFormDir = $dllDir.ProjectItems.Item("x86") + MarkFileAsCopy($platFormDir.ProjectItems.Item($file)) +} +# x64 +foreach ($file in $copyFilesX64) +{ + $dllDir = $project.ProjectItems.Item("dll") + $platFormDir = $dllDir.ProjectItems.Item("x64") + MarkFileAsCopy($platFormDir.ProjectItems.Item($file)) +} + + + +function HasPlatform($manager, $platformName) +{ + $myPlatforms = [Array] $manager.PlatformNames + $index = [System.Array]::IndexOf($myPlatforms, $platformName) + $index -ge 0 +} + +$manager = $project.ConfigurationManager +$configs = [Array] $manager.PlatformNames + +foreach ($p in $platforms) +{ + $hasPlatform = HasPlatform $manager $p + if(-not $hasPlatform) + { + [void]$manager.AddPlatform($p, "Any CPU", $true) + } +} + + +#foreach ($config in $configs) +#{ +# [System.Windows.Forms.MessageBox]::Show(HasPlatform) +#} + + diff --git a/nuget/tools/install-WithoutDll.ps1 b/nuget/tools/install-WithoutDll.ps1 new file mode 100644 index 000000000..167ccb684 --- /dev/null +++ b/nuget/tools/install-WithoutDll.ps1 @@ -0,0 +1,25 @@ +param($installPath, $toolsPath, $package, $project) + +$platforms = @( + "x86"; + "x64"; +) + +function HasPlatform($manager, $platformName) +{ + $myPlatforms = [Array] $manager.PlatformNames + $index = [System.Array]::IndexOf($myPlatforms, $platformName) + $index -ge 0 +} + +$manager = $project.ConfigurationManager +$configs = [Array] $manager.PlatformNames + +foreach ($p in $platforms) +{ + $hasPlatform = HasPlatform $manager $p + if(-not $hasPlatform) + { + [void]$manager.AddPlatform($p, "Any CPU", $true) + } +} diff --git a/nuget/tools/uninstall.ps1 b/nuget/tools/uninstall.ps1 new file mode 100644 index 000000000..d25f55729 --- /dev/null +++ b/nuget/tools/uninstall.ps1 @@ -0,0 +1 @@ +param($installPath, $toolsPath, $package, $project) \ No newline at end of file diff --git a/sample/.nuget/NuGet.Config b/sample/.nuget/NuGet.Config new file mode 100644 index 000000000..67f8ea046 --- /dev/null +++ b/sample/.nuget/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/sample/.nuget/NuGet.exe b/sample/.nuget/NuGet.exe new file mode 100644 index 000000000..c41a0d0de Binary files /dev/null and b/sample/.nuget/NuGet.exe differ diff --git a/sample/.nuget/NuGet.targets b/sample/.nuget/NuGet.targets new file mode 100644 index 000000000..3f8c37b22 --- /dev/null +++ b/sample/.nuget/NuGet.targets @@ -0,0 +1,144 @@ + + + + $(MSBuildProjectDirectory)\..\ + + + false + + + false + + + true + + + false + + + + + + + + + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + + + + + $(SolutionDir).nuget + + + + $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config + $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config + + + + $(MSBuildProjectDirectory)\packages.config + $(PackagesProjectConfig) + + + + + $(NuGetToolsPath)\NuGet.exe + @(PackageSource) + + "$(NuGetExePath)" + mono --runtime=v4.0.30319 "$(NuGetExePath)" + + $(TargetDir.Trim('\\')) + + -RequireConsent + -NonInteractive + + "$(SolutionDir) " + "$(SolutionDir)" + + + $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir) + $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(BuildDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample/OpenCvSharpSamples.sln b/sample/OpenCvSharpSamples.sln new file mode 100644 index 000000000..487ecdfb6 --- /dev/null +++ b/sample/OpenCvSharpSamples.sln @@ -0,0 +1,102 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.24720.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamplesCS", "SamplesCS\SamplesCS.csproj", "{E4666B99-145A-436D-9540-2E4593A061A6}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "SamplesVB", "SamplesVB\SamplesVB.vbproj", "{4A14A20D-8E2A-4559-A038-F0204A22C283}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{E5CC1BCA-0DD8-4C43-A8CC-990F99E71E42}" + ProjectSection(SolutionItems) = preProject + .nuget\NuGet.Config = .nuget\NuGet.Config + .nuget\NuGet.exe = .nuget\NuGet.exe + .nuget\NuGet.targets = .nuget\NuGet.targets + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleBase", "SampleBase\SampleBase.csproj", "{2D245C04-0F27-458A-A185-16242A3F918C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release JP|Any CPU = Release JP|Any CPU + Release JP|Win32 = Release JP|Win32 + Release JP|x64 = Release JP|x64 + Release JP|x86 = Release JP|x86 + Release|Any CPU = Release|Any CPU + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E4666B99-145A-436D-9540-2E4593A061A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E4666B99-145A-436D-9540-2E4593A061A6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E4666B99-145A-436D-9540-2E4593A061A6}.Debug|Win32.ActiveCfg = Debug|x86 + {E4666B99-145A-436D-9540-2E4593A061A6}.Debug|Win32.Build.0 = Debug|x86 + {E4666B99-145A-436D-9540-2E4593A061A6}.Debug|x64.ActiveCfg = Debug|x86 + {E4666B99-145A-436D-9540-2E4593A061A6}.Debug|x86.ActiveCfg = Debug|x86 + {E4666B99-145A-436D-9540-2E4593A061A6}.Debug|x86.Build.0 = Debug|x86 + {E4666B99-145A-436D-9540-2E4593A061A6}.Release JP|Any CPU.ActiveCfg = Release|Any CPU + {E4666B99-145A-436D-9540-2E4593A061A6}.Release JP|Any CPU.Build.0 = Release|Any CPU + {E4666B99-145A-436D-9540-2E4593A061A6}.Release JP|Win32.ActiveCfg = Release|x86 + {E4666B99-145A-436D-9540-2E4593A061A6}.Release JP|Win32.Build.0 = Release|x86 + {E4666B99-145A-436D-9540-2E4593A061A6}.Release JP|x64.ActiveCfg = Release|Any CPU + {E4666B99-145A-436D-9540-2E4593A061A6}.Release JP|x86.ActiveCfg = Release|x86 + {E4666B99-145A-436D-9540-2E4593A061A6}.Release JP|x86.Build.0 = Release|x86 + {E4666B99-145A-436D-9540-2E4593A061A6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E4666B99-145A-436D-9540-2E4593A061A6}.Release|Any CPU.Build.0 = Release|Any CPU + {E4666B99-145A-436D-9540-2E4593A061A6}.Release|Win32.ActiveCfg = Release|x86 + {E4666B99-145A-436D-9540-2E4593A061A6}.Release|Win32.Build.0 = Release|x86 + {E4666B99-145A-436D-9540-2E4593A061A6}.Release|x64.ActiveCfg = Release|x64 + {E4666B99-145A-436D-9540-2E4593A061A6}.Release|x64.Build.0 = Release|x64 + {E4666B99-145A-436D-9540-2E4593A061A6}.Release|x86.ActiveCfg = Release|x86 + {E4666B99-145A-436D-9540-2E4593A061A6}.Release|x86.Build.0 = Release|x86 + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Debug|Win32.ActiveCfg = Debug|x86 + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Debug|Win32.Build.0 = Debug|x86 + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Debug|x64.ActiveCfg = Debug|x86 + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Debug|x86.ActiveCfg = Debug|x86 + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Debug|x86.Build.0 = Debug|x86 + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Release JP|Any CPU.ActiveCfg = Release|Any CPU + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Release JP|Any CPU.Build.0 = Release|Any CPU + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Release JP|Win32.ActiveCfg = Release|x86 + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Release JP|Win32.Build.0 = Release|x86 + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Release JP|x64.ActiveCfg = Release|Any CPU + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Release JP|x86.ActiveCfg = Release|x86 + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Release JP|x86.Build.0 = Release|x86 + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Release|Any CPU.Build.0 = Release|Any CPU + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Release|Win32.ActiveCfg = Release|x86 + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Release|Win32.Build.0 = Release|x86 + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Release|x64.ActiveCfg = Release|x64 + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Release|x64.Build.0 = Release|x64 + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Release|x86.ActiveCfg = Release|x86 + {4A14A20D-8E2A-4559-A038-F0204A22C283}.Release|x86.Build.0 = Release|x86 + {2D245C04-0F27-458A-A185-16242A3F918C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2D245C04-0F27-458A-A185-16242A3F918C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2D245C04-0F27-458A-A185-16242A3F918C}.Debug|Win32.ActiveCfg = Debug|Any CPU + {2D245C04-0F27-458A-A185-16242A3F918C}.Debug|x64.ActiveCfg = Debug|Any CPU + {2D245C04-0F27-458A-A185-16242A3F918C}.Debug|x86.ActiveCfg = Debug|Any CPU + {2D245C04-0F27-458A-A185-16242A3F918C}.Debug|x86.Build.0 = Debug|Any CPU + {2D245C04-0F27-458A-A185-16242A3F918C}.Release JP|Any CPU.ActiveCfg = Release|Any CPU + {2D245C04-0F27-458A-A185-16242A3F918C}.Release JP|Any CPU.Build.0 = Release|Any CPU + {2D245C04-0F27-458A-A185-16242A3F918C}.Release JP|Win32.ActiveCfg = Release|Any CPU + {2D245C04-0F27-458A-A185-16242A3F918C}.Release JP|x64.ActiveCfg = Release|Any CPU + {2D245C04-0F27-458A-A185-16242A3F918C}.Release JP|x86.ActiveCfg = Release|Any CPU + {2D245C04-0F27-458A-A185-16242A3F918C}.Release JP|x86.Build.0 = Release|Any CPU + {2D245C04-0F27-458A-A185-16242A3F918C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2D245C04-0F27-458A-A185-16242A3F918C}.Release|Any CPU.Build.0 = Release|Any CPU + {2D245C04-0F27-458A-A185-16242A3F918C}.Release|Win32.ActiveCfg = Release|Any CPU + {2D245C04-0F27-458A-A185-16242A3F918C}.Release|x64.ActiveCfg = Release|Any CPU + {2D245C04-0F27-458A-A185-16242A3F918C}.Release|x64.Build.0 = Release|Any CPU + {2D245C04-0F27-458A-A185-16242A3F918C}.Release|x86.ActiveCfg = Release|Any CPU + {2D245C04-0F27-458A-A185-16242A3F918C}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/sample/OpenCvSharpSamples.sln.DotSettings b/sample/OpenCvSharpSamples.sln.DotSettings new file mode 100644 index 000000000..999257d45 --- /dev/null +++ b/sample/OpenCvSharpSamples.sln.DotSettings @@ -0,0 +1,4 @@ + + HSV + SVM + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> \ No newline at end of file diff --git a/sample/SampleBase/Data/Image/16bit.png b/sample/SampleBase/Data/Image/16bit.png new file mode 100644 index 000000000..b7418398a Binary files /dev/null and b/sample/SampleBase/Data/Image/16bit.png differ diff --git a/sample/SampleBase/Data/Image/Balloon.png b/sample/SampleBase/Data/Image/Balloon.png new file mode 100644 index 000000000..1cc65e653 Binary files /dev/null and b/sample/SampleBase/Data/Image/Balloon.png differ diff --git a/sample/SampleBase/Data/Image/Calibration/00.JPG b/sample/SampleBase/Data/Image/Calibration/00.JPG new file mode 100644 index 000000000..995d0a8d1 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/00.JPG differ diff --git a/sample/SampleBase/Data/Image/Calibration/01.JPG b/sample/SampleBase/Data/Image/Calibration/01.JPG new file mode 100644 index 000000000..a36e40bd3 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/01.JPG differ diff --git a/sample/SampleBase/Data/Image/Calibration/02.JPG b/sample/SampleBase/Data/Image/Calibration/02.JPG new file mode 100644 index 000000000..b61c4226c Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/02.JPG differ diff --git a/sample/SampleBase/Data/Image/Calibration/left01.jpg b/sample/SampleBase/Data/Image/Calibration/left01.jpg new file mode 100644 index 000000000..6ade32006 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/left01.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/left02.jpg b/sample/SampleBase/Data/Image/Calibration/left02.jpg new file mode 100644 index 000000000..457820e90 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/left02.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/left03.jpg b/sample/SampleBase/Data/Image/Calibration/left03.jpg new file mode 100644 index 000000000..7f3990f4e Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/left03.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/left04.jpg b/sample/SampleBase/Data/Image/Calibration/left04.jpg new file mode 100644 index 000000000..3144a18f5 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/left04.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/left05.jpg b/sample/SampleBase/Data/Image/Calibration/left05.jpg new file mode 100644 index 000000000..7b5713180 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/left05.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/left06.jpg b/sample/SampleBase/Data/Image/Calibration/left06.jpg new file mode 100644 index 000000000..1c6a217cf Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/left06.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/left07.jpg b/sample/SampleBase/Data/Image/Calibration/left07.jpg new file mode 100644 index 000000000..46acbb9eb Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/left07.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/left08.jpg b/sample/SampleBase/Data/Image/Calibration/left08.jpg new file mode 100644 index 000000000..0fe764603 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/left08.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/left09.jpg b/sample/SampleBase/Data/Image/Calibration/left09.jpg new file mode 100644 index 000000000..5d17e9572 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/left09.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/left10.jpg b/sample/SampleBase/Data/Image/Calibration/left10.jpg new file mode 100644 index 000000000..1dec7c682 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/left10.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/left11.jpg b/sample/SampleBase/Data/Image/Calibration/left11.jpg new file mode 100644 index 000000000..7ca2a1476 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/left11.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/left12.jpg b/sample/SampleBase/Data/Image/Calibration/left12.jpg new file mode 100644 index 000000000..897955d77 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/left12.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/left13.jpg b/sample/SampleBase/Data/Image/Calibration/left13.jpg new file mode 100644 index 000000000..e2f060f2f Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/left13.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/right01.jpg b/sample/SampleBase/Data/Image/Calibration/right01.jpg new file mode 100644 index 000000000..4d6071b8b Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/right01.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/right02.jpg b/sample/SampleBase/Data/Image/Calibration/right02.jpg new file mode 100644 index 000000000..6c0fab094 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/right02.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/right03.jpg b/sample/SampleBase/Data/Image/Calibration/right03.jpg new file mode 100644 index 000000000..75027611d Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/right03.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/right04.jpg b/sample/SampleBase/Data/Image/Calibration/right04.jpg new file mode 100644 index 000000000..958973bc6 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/right04.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/right05.jpg b/sample/SampleBase/Data/Image/Calibration/right05.jpg new file mode 100644 index 000000000..926c82582 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/right05.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/right06.jpg b/sample/SampleBase/Data/Image/Calibration/right06.jpg new file mode 100644 index 000000000..69a7994f8 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/right06.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/right07.jpg b/sample/SampleBase/Data/Image/Calibration/right07.jpg new file mode 100644 index 000000000..9aff92bd4 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/right07.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/right08.jpg b/sample/SampleBase/Data/Image/Calibration/right08.jpg new file mode 100644 index 000000000..abb794a12 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/right08.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/right09.jpg b/sample/SampleBase/Data/Image/Calibration/right09.jpg new file mode 100644 index 000000000..a6dd6f992 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/right09.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/right10.jpg b/sample/SampleBase/Data/Image/Calibration/right10.jpg new file mode 100644 index 000000000..2decf1e76 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/right10.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/right11.jpg b/sample/SampleBase/Data/Image/Calibration/right11.jpg new file mode 100644 index 000000000..29b99bec3 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/right11.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/right12.jpg b/sample/SampleBase/Data/Image/Calibration/right12.jpg new file mode 100644 index 000000000..35b2d07f4 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/right12.jpg differ diff --git a/sample/SampleBase/Data/Image/Calibration/right13.jpg b/sample/SampleBase/Data/Image/Calibration/right13.jpg new file mode 100644 index 000000000..d504a46b9 Binary files /dev/null and b/sample/SampleBase/Data/Image/Calibration/right13.jpg differ diff --git a/sample/SampleBase/Data/Image/Girl.bmp b/sample/SampleBase/Data/Image/Girl.bmp new file mode 100644 index 000000000..a4db49337 Binary files /dev/null and b/sample/SampleBase/Data/Image/Girl.bmp differ diff --git a/sample/SampleBase/Data/Image/Mandrill.bmp b/sample/SampleBase/Data/Image/Mandrill.bmp new file mode 100644 index 000000000..74f1cb7f1 Binary files /dev/null and b/sample/SampleBase/Data/Image/Mandrill.bmp differ diff --git a/sample/SampleBase/Data/Image/Squares/pic1.png b/sample/SampleBase/Data/Image/Squares/pic1.png new file mode 100644 index 000000000..3e48aa4b8 Binary files /dev/null and b/sample/SampleBase/Data/Image/Squares/pic1.png differ diff --git a/sample/SampleBase/Data/Image/Squares/pic2.png b/sample/SampleBase/Data/Image/Squares/pic2.png new file mode 100644 index 000000000..068213f7c Binary files /dev/null and b/sample/SampleBase/Data/Image/Squares/pic2.png differ diff --git a/sample/SampleBase/Data/Image/Squares/pic3.png b/sample/SampleBase/Data/Image/Squares/pic3.png new file mode 100644 index 000000000..fe214f00f Binary files /dev/null and b/sample/SampleBase/Data/Image/Squares/pic3.png differ diff --git a/sample/SampleBase/Data/Image/Squares/pic4.png b/sample/SampleBase/Data/Image/Squares/pic4.png new file mode 100644 index 000000000..57b7a0d09 Binary files /dev/null and b/sample/SampleBase/Data/Image/Squares/pic4.png differ diff --git a/sample/SampleBase/Data/Image/Squares/pic5.png b/sample/SampleBase/Data/Image/Squares/pic5.png new file mode 100644 index 000000000..2e6bfa7cb Binary files /dev/null and b/sample/SampleBase/Data/Image/Squares/pic5.png differ diff --git a/sample/SampleBase/Data/Image/Squares/pic6.png b/sample/SampleBase/Data/Image/Squares/pic6.png new file mode 100644 index 000000000..5cd6ab06e Binary files /dev/null and b/sample/SampleBase/Data/Image/Squares/pic6.png differ diff --git a/sample/SampleBase/Data/Image/asahiyama.jpg b/sample/SampleBase/Data/Image/asahiyama.jpg new file mode 100644 index 000000000..fb2b6d4ff Binary files /dev/null and b/sample/SampleBase/Data/Image/asahiyama.jpg differ diff --git a/sample/SampleBase/Data/Image/binarization_sample.bmp b/sample/SampleBase/Data/Image/binarization_sample.bmp new file mode 100644 index 000000000..faac844ab Binary files /dev/null and b/sample/SampleBase/Data/Image/binarization_sample.bmp differ diff --git a/sample/SampleBase/Data/Image/box.png b/sample/SampleBase/Data/Image/box.png new file mode 100644 index 000000000..6f01082f7 Binary files /dev/null and b/sample/SampleBase/Data/Image/box.png differ diff --git a/sample/SampleBase/Data/Image/box_in_scene.png b/sample/SampleBase/Data/Image/box_in_scene.png new file mode 100644 index 000000000..cff246a3f Binary files /dev/null and b/sample/SampleBase/Data/Image/box_in_scene.png differ diff --git a/sample/SampleBase/Data/Image/cake.bmp b/sample/SampleBase/Data/Image/cake.bmp new file mode 100644 index 000000000..0ce960a47 Binary files /dev/null and b/sample/SampleBase/Data/Image/cake.bmp differ diff --git a/sample/SampleBase/Data/Image/cat.jpg b/sample/SampleBase/Data/Image/cat.jpg new file mode 100644 index 000000000..df4a907e5 Binary files /dev/null and b/sample/SampleBase/Data/Image/cat.jpg differ diff --git a/sample/SampleBase/Data/Image/fruits.jpg b/sample/SampleBase/Data/Image/fruits.jpg new file mode 100644 index 000000000..a89b84a58 Binary files /dev/null and b/sample/SampleBase/Data/Image/fruits.jpg differ diff --git a/sample/SampleBase/Data/Image/goryokaku.jpg b/sample/SampleBase/Data/Image/goryokaku.jpg new file mode 100644 index 000000000..32f181eda Binary files /dev/null and b/sample/SampleBase/Data/Image/goryokaku.jpg differ diff --git a/sample/SampleBase/Data/Image/hand_p.jpg b/sample/SampleBase/Data/Image/hand_p.jpg new file mode 100644 index 000000000..d9541426a Binary files /dev/null and b/sample/SampleBase/Data/Image/hand_p.jpg differ diff --git a/sample/SampleBase/Data/Image/lenna.png b/sample/SampleBase/Data/Image/lenna.png new file mode 100644 index 000000000..22c23ca43 Binary files /dev/null and b/sample/SampleBase/Data/Image/lenna.png differ diff --git a/sample/SampleBase/Data/Image/lenna511.png b/sample/SampleBase/Data/Image/lenna511.png new file mode 100644 index 000000000..a8c4bf681 Binary files /dev/null and b/sample/SampleBase/Data/Image/lenna511.png differ diff --git a/sample/SampleBase/Data/Image/maltese.jpg b/sample/SampleBase/Data/Image/maltese.jpg new file mode 100644 index 000000000..3532393f5 Binary files /dev/null and b/sample/SampleBase/Data/Image/maltese.jpg differ diff --git a/sample/SampleBase/Data/Image/match1.png b/sample/SampleBase/Data/Image/match1.png new file mode 100644 index 000000000..6f01082f7 Binary files /dev/null and b/sample/SampleBase/Data/Image/match1.png differ diff --git a/sample/SampleBase/Data/Image/match2.png b/sample/SampleBase/Data/Image/match2.png new file mode 100644 index 000000000..cff246a3f Binary files /dev/null and b/sample/SampleBase/Data/Image/match2.png differ diff --git a/sample/SampleBase/Data/Image/penguin1.png b/sample/SampleBase/Data/Image/penguin1.png new file mode 100644 index 000000000..0243fff04 Binary files /dev/null and b/sample/SampleBase/Data/Image/penguin1.png differ diff --git a/sample/SampleBase/Data/Image/penguin1b.png b/sample/SampleBase/Data/Image/penguin1b.png new file mode 100644 index 000000000..61868d013 Binary files /dev/null and b/sample/SampleBase/Data/Image/penguin1b.png differ diff --git a/sample/SampleBase/Data/Image/penguin2.png b/sample/SampleBase/Data/Image/penguin2.png new file mode 100644 index 000000000..cd712a9a2 Binary files /dev/null and b/sample/SampleBase/Data/Image/penguin2.png differ diff --git a/sample/SampleBase/Data/Image/shapes.png b/sample/SampleBase/Data/Image/shapes.png new file mode 100644 index 000000000..7b754adec Binary files /dev/null and b/sample/SampleBase/Data/Image/shapes.png differ diff --git a/sample/SampleBase/Data/Image/tsukuba_left.png b/sample/SampleBase/Data/Image/tsukuba_left.png new file mode 100644 index 000000000..25651ce75 Binary files /dev/null and b/sample/SampleBase/Data/Image/tsukuba_left.png differ diff --git a/sample/SampleBase/Data/Image/tsukuba_right.png b/sample/SampleBase/Data/Image/tsukuba_right.png new file mode 100644 index 000000000..5c45ccd2b Binary files /dev/null and b/sample/SampleBase/Data/Image/tsukuba_right.png differ diff --git a/sample/SampleBase/Data/Image/very_old_newspaper.png b/sample/SampleBase/Data/Image/very_old_newspaper.png new file mode 100644 index 000000000..f76c0fe0f Binary files /dev/null and b/sample/SampleBase/Data/Image/very_old_newspaper.png differ diff --git a/sample/SampleBase/Data/Image/walkman.jpg b/sample/SampleBase/Data/Image/walkman.jpg new file mode 100644 index 000000000..20f444679 Binary files /dev/null and b/sample/SampleBase/Data/Image/walkman.jpg differ diff --git a/sample/SampleBase/Data/Image/yalta.jpg b/sample/SampleBase/Data/Image/yalta.jpg new file mode 100644 index 000000000..47b865b17 Binary files /dev/null and b/sample/SampleBase/Data/Image/yalta.jpg differ diff --git a/sample/SampleBase/Data/Movie/bach.mp4 b/sample/SampleBase/Data/Movie/bach.mp4 new file mode 100644 index 000000000..91d384f34 Binary files /dev/null and b/sample/SampleBase/Data/Movie/bach.mp4 differ diff --git a/sample/SampleBase/Data/Movie/hara.flv b/sample/SampleBase/Data/Movie/hara.flv new file mode 100644 index 000000000..f75045801 Binary files /dev/null and b/sample/SampleBase/Data/Movie/hara.flv differ diff --git a/sample/SampleBase/Data/Text/agaricus-lepiota.data b/sample/SampleBase/Data/Text/agaricus-lepiota.data new file mode 100644 index 000000000..14fe8bbe7 --- /dev/null +++ b/sample/SampleBase/Data/Text/agaricus-lepiota.data @@ -0,0 +1,8124 @@ +p,x,s,n,t,p,f,c,n,k,e,e,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/sample/SampleBase/Data/Text/camera.xml @@ -0,0 +1,27 @@ + + + + 3 + 3 +
f
+ + 479.56344604 0. 307.93475342 0. 478.32070923 235.81101990 0. 0. 1.
+ + 1 + 3 +
f
+ + 3.07101631 0.23497446 0.44556716
+ + 1 + 3 +
f
+ + -74.40477753 74.23780060 291.24246216
+ + 1 + 4 +
f
+ + -0.23750813 0.13474102 8.73253666e-05 -3.74954601e-04
+
diff --git a/sample/SampleBase/Data/Text/cat.xml b/sample/SampleBase/Data/Text/cat.xml new file mode 100644 index 000000000..85fcf0908 Binary files /dev/null and b/sample/SampleBase/Data/Text/cat.xml differ diff --git a/sample/SampleBase/Data/Text/haarcascade_frontalface_alt.xml b/sample/SampleBase/Data/Text/haarcascade_frontalface_alt.xml new file mode 100644 index 000000000..5a6f27545 --- /dev/null +++ b/sample/SampleBase/Data/Text/haarcascade_frontalface_alt.xml @@ -0,0 +1,26161 @@ + + + + + 20 20 + + <_> + + + <_> + + <_> + + + + <_>3 7 14 4 -1. + <_>3 9 14 2 2. + 0 + 4.0141958743333817e-003 + 0.0337941907346249 + 0.8378106951713562 + <_> + + <_> + + + + <_>1 2 18 4 -1. + <_>7 2 6 4 3. + 0 + 0.0151513395830989 + 0.1514132022857666 + 0.7488812208175659 + <_> + + <_> + + + + <_>1 7 15 9 -1. + <_>1 10 15 3 3. + 0 + 4.2109931819140911e-003 + 0.0900492817163467 + 0.6374819874763489 + 0.8226894140243530 + -1 + -1 + <_> + + + <_> + + <_> + + + + <_>5 6 2 6 -1. + <_>5 9 2 3 2. + 0 + 1.6227109590545297e-003 + 0.0693085864186287 + 0.7110946178436279 + <_> + + <_> + + + + <_>7 5 6 3 -1. + <_>9 5 2 3 3. + 0 + 2.2906649392098188e-003 + 0.1795803010463715 + 0.6668692231178284 + <_> + + <_> + + + + <_>4 0 12 9 -1. + <_>4 3 12 3 3. + 0 + 5.0025708042085171e-003 + 0.1693672984838486 + 0.6554006934165955 + <_> + + <_> + + + + <_>6 9 10 8 -1. + <_>6 13 10 4 2. + 0 + 7.9659894108772278e-003 + 0.5866332054138184 + 0.0914145186543465 + <_> + + <_> + + + + <_>3 6 14 8 -1. + <_>3 10 14 4 2. + 0 + -3.5227010957896709e-003 + 0.1413166970014572 + 0.6031895875930786 + <_> + + <_> + + + + <_>14 1 6 10 -1. + <_>14 1 3 10 2. + 0 + 0.0366676896810532 + 0.3675672113895416 + 0.7920318245887756 + <_> + + <_> + + + + <_>7 8 5 12 -1. + <_>7 12 5 4 3. + 0 + 9.3361474573612213e-003 + 0.6161385774612427 + 0.2088509947061539 + <_> + + <_> + + + + <_>1 1 18 3 -1. + <_>7 1 6 3 3. + 0 + 8.6961314082145691e-003 + 0.2836230993270874 + 0.6360273957252502 + <_> + + <_> + + + + <_>1 8 17 2 -1. + <_>1 9 17 1 2. + 0 + 1.1488880263641477e-003 + 0.2223580926656723 + 0.5800700783729553 + <_> + + <_> + + + + <_>16 6 4 2 -1. + <_>16 7 4 1 2. + 0 + -2.1484689787030220e-003 + 0.2406464070081711 + 0.5787054896354675 + <_> + + <_> + + + + <_>5 17 2 2 -1. + <_>5 18 2 1 2. + 0 + 2.1219060290604830e-003 + 0.5559654831886292 + 0.1362237036228180 + <_> + + <_> + + + + <_>14 2 6 12 -1. + <_>14 2 3 12 2. + 0 + -0.0939491465687752 + 0.8502737283706665 + 0.4717740118503571 + <_> + + <_> + + + + <_>4 0 4 12 -1. + <_>4 0 2 6 2. + <_>6 6 2 6 2. + 0 + 1.3777789426967502e-003 + 0.5993673801422119 + 0.2834529876708984 + <_> + + <_> + + + + <_>2 11 18 8 -1. + <_>8 11 6 8 3. + 0 + 0.0730631574988365 + 0.4341886043548584 + 0.7060034275054932 + <_> + + <_> + + + + <_>5 7 10 2 -1. + <_>5 8 10 1 2. + 0 + 3.6767389974556863e-004 + 0.3027887940406799 + 0.6051574945449829 + <_> + + <_> + + + + <_>15 11 5 3 -1. + <_>15 12 5 1 3. + 0 + -6.0479710809886456e-003 + 0.1798433959484100 + 0.5675256848335266 + 6.9566087722778320 + 0 + -1 + <_> + + + <_> + + <_> + + + + <_>5 3 10 9 -1. + <_>5 6 10 3 3. + 0 + -0.0165106896311045 + 0.6644225120544434 + 0.1424857974052429 + <_> + + <_> + + + + <_>9 4 2 14 -1. + <_>9 11 2 7 2. + 0 + 2.7052499353885651e-003 + 0.6325352191925049 + 0.1288477033376694 + <_> + + <_> + + + + <_>3 5 4 12 -1. + <_>3 9 4 4 3. + 0 + 2.8069869149476290e-003 + 0.1240288019180298 + 0.6193193197250366 + <_> + + <_> + + + + <_>4 5 12 5 -1. + <_>8 5 4 5 3. + 0 + -1.5402400167658925e-003 + 0.1432143002748489 + 0.5670015811920166 + <_> + + <_> + + + + <_>5 6 10 8 -1. + <_>5 10 10 4 2. + 0 + -5.6386279175058007e-004 + 0.1657433062791824 + 0.5905207991600037 + <_> + + <_> + + + + <_>8 0 6 9 -1. + <_>8 3 6 3 3. + 0 + 1.9253729842603207e-003 + 0.2695507109165192 + 0.5738824009895325 + <_> + + <_> + + + + <_>9 12 1 8 -1. + <_>9 16 1 4 2. + 0 + -5.0214841030538082e-003 + 0.1893538981676102 + 0.5782774090766907 + <_> + + <_> + + + + <_>0 7 20 6 -1. + <_>0 9 20 2 3. + 0 + 2.6365420781075954e-003 + 0.2309329062700272 + 0.5695425868034363 + <_> + + <_> + + + + <_>7 0 6 17 -1. + <_>9 0 2 17 3. + 0 + -1.5127769438549876e-003 + 0.2759602069854736 + 0.5956642031669617 + <_> + + <_> + + + + <_>9 0 6 4 -1. + <_>11 0 2 4 3. + 0 + -0.0101574398577213 + 0.1732538044452667 + 0.5522047281265259 + <_> + + <_> + + + + <_>5 1 6 4 -1. + <_>7 1 2 4 3. + 0 + -0.0119536602869630 + 0.1339409947395325 + 0.5559014081954956 + <_> + + <_> + + + + <_>12 1 6 16 -1. + <_>14 1 2 16 3. + 0 + 4.8859491944313049e-003 + 0.3628703951835632 + 0.6188849210739136 + <_> + + <_> + + + + <_>0 5 18 8 -1. + <_>0 5 9 4 2. + <_>9 9 9 4 2. + 0 + -0.0801329165697098 + 0.0912110507488251 + 0.5475944876670837 + <_> + + <_> + + + + <_>8 15 10 4 -1. + <_>13 15 5 2 2. + <_>8 17 5 2 2. + 0 + 1.0643280111253262e-003 + 0.3715142905712128 + 0.5711399912834168 + <_> + + <_> + + + + <_>3 1 4 8 -1. + <_>3 1 2 4 2. + <_>5 5 2 4 2. + 0 + -1.3419450260698795e-003 + 0.5953313708305359 + 0.3318097889423370 + <_> + + <_> + + + + <_>3 6 14 10 -1. + <_>10 6 7 5 2. + <_>3 11 7 5 2. + 0 + -0.0546011403203011 + 0.1844065934419632 + 0.5602846145629883 + <_> + + <_> + + + + <_>2 1 6 16 -1. + <_>4 1 2 16 3. + 0 + 2.9071690514683723e-003 + 0.3594244122505188 + 0.6131715178489685 + <_> + + <_> + + + + <_>0 18 20 2 -1. + <_>0 19 20 1 2. + 0 + 7.4718717951327562e-004 + 0.5994353294372559 + 0.3459562957286835 + <_> + + <_> + + + + <_>8 13 4 3 -1. + <_>8 14 4 1 3. + 0 + 4.3013808317482471e-003 + 0.4172652065753937 + 0.6990845203399658 + <_> + + <_> + + + + <_>9 14 2 3 -1. + <_>9 15 2 1 3. + 0 + 4.5017572119832039e-003 + 0.4509715139865875 + 0.7801457047462463 + <_> + + <_> + + + + <_>0 12 9 6 -1. + <_>0 14 9 2 3. + 0 + 0.0241385009139776 + 0.5438212752342224 + 0.1319826990365982 + 9.4985427856445313 + 1 + -1 + <_> + + + <_> + + <_> + + + + <_>5 7 3 4 -1. + <_>5 9 3 2 2. + 0 + 1.9212230108678341e-003 + 0.1415266990661621 + 0.6199870705604553 + <_> + + <_> + + + + <_>9 3 2 16 -1. + <_>9 11 2 8 2. + 0 + -1.2748669541906565e-004 + 0.6191074252128601 + 0.1884928941726685 + <_> + + <_> + + + + <_>3 6 13 8 -1. + <_>3 10 13 4 2. + 0 + 5.1409931620582938e-004 + 0.1487396955490112 + 0.5857927799224854 + <_> + + <_> + + + + <_>12 3 8 2 -1. + <_>12 3 4 2 2. + 0 + 4.1878609918057919e-003 + 0.2746909856796265 + 0.6359239816665649 + <_> + + <_> + + + + <_>8 8 4 12 -1. + <_>8 12 4 4 3. + 0 + 5.1015717908740044e-003 + 0.5870851278305054 + 0.2175628989934921 + <_> + + <_> + + + + <_>11 3 8 6 -1. + <_>15 3 4 3 2. + <_>11 6 4 3 2. + 0 + -2.1448440384119749e-003 + 0.5880944728851318 + 0.2979590892791748 + <_> + + <_> + + + + <_>7 1 6 19 -1. + <_>9 1 2 19 3. + 0 + -2.8977119363844395e-003 + 0.2373327016830444 + 0.5876647233963013 + <_> + + <_> + + + + <_>9 0 6 4 -1. + <_>11 0 2 4 3. + 0 + -0.0216106791049242 + 0.1220654994249344 + 0.5194202065467835 + <_> + + <_> + + + + <_>3 1 9 3 -1. + <_>6 1 3 3 3. + 0 + -4.6299318782985210e-003 + 0.2631230950355530 + 0.5817409157752991 + <_> + + <_> + + + + <_>8 15 10 4 -1. + <_>13 15 5 2 2. + <_>8 17 5 2 2. + 0 + 5.9393711853772402e-004 + 0.3638620078563690 + 0.5698544979095459 + <_> + + <_> + + + + <_>0 3 6 10 -1. + <_>3 3 3 10 2. + 0 + 0.0538786612451077 + 0.4303531050682068 + 0.7559366226196289 + <_> + + <_> + + + + <_>3 4 15 15 -1. + <_>3 9 15 5 3. + 0 + 1.8887349870055914e-003 + 0.2122603058815002 + 0.5613427162170410 + <_> + + <_> + + + + <_>6 5 8 6 -1. + <_>6 7 8 2 3. + 0 + -2.3635339457541704e-003 + 0.5631849169731140 + 0.2642767131328583 + <_> + + <_> + + + + <_>4 4 12 10 -1. + <_>10 4 6 5 2. + <_>4 9 6 5 2. + 0 + 0.0240177996456623 + 0.5797107815742493 + 0.2751705944538117 + <_> + + <_> + + + + <_>6 4 4 4 -1. + <_>8 4 2 4 2. + 0 + 2.0543030404951423e-004 + 0.2705242037773132 + 0.5752568840980530 + <_> + + <_> + + + + <_>15 11 1 2 -1. + <_>15 12 1 1 2. + 0 + 8.4790197433903813e-004 + 0.5435624718666077 + 0.2334876954555512 + <_> + + <_> + + + + <_>3 11 2 2 -1. + <_>3 12 2 1 2. + 0 + 1.4091329649090767e-003 + 0.5319424867630005 + 0.2063155025243759 + <_> + + <_> + + + + <_>16 11 1 3 -1. + <_>16 12 1 1 3. + 0 + 1.4642629539594054e-003 + 0.5418980717658997 + 0.3068861067295075 + <_> + + <_> + + + + <_>3 15 6 4 -1. + <_>3 15 3 2 2. + <_>6 17 3 2 2. + 0 + 1.6352549428120255e-003 + 0.3695372939109802 + 0.6112868189811707 + <_> + + <_> + + + + <_>6 7 8 2 -1. + <_>6 8 8 1 2. + 0 + 8.3172752056270838e-004 + 0.3565036952495575 + 0.6025236248970032 + <_> + + <_> + + + + <_>3 11 1 3 -1. + <_>3 12 1 1 3. + 0 + -2.0998890977352858e-003 + 0.1913982033729553 + 0.5362827181816101 + <_> + + <_> + + + + <_>6 0 12 2 -1. + <_>6 1 12 1 2. + 0 + -7.4213981861248612e-004 + 0.3835555016994476 + 0.5529310107231140 + <_> + + <_> + + + + <_>9 14 2 3 -1. + <_>9 15 2 1 3. + 0 + 3.2655049581080675e-003 + 0.4312896132469177 + 0.7101895809173584 + <_> + + <_> + + + + <_>7 15 6 2 -1. + <_>7 16 6 1 2. + 0 + 8.9134991867467761e-004 + 0.3984830975532532 + 0.6391963958740234 + <_> + + <_> + + + + <_>0 5 4 6 -1. + <_>0 7 4 2 3. + 0 + -0.0152841797098517 + 0.2366732954978943 + 0.5433713793754578 + <_> + + <_> + + + + <_>4 12 12 2 -1. + <_>8 12 4 2 3. + 0 + 4.8381411470472813e-003 + 0.5817500948905945 + 0.3239189088344574 + <_> + + <_> + + + + <_>6 3 1 9 -1. + <_>6 6 1 3 3. + 0 + -9.1093179071322083e-004 + 0.5540593862533569 + 0.2911868989467621 + <_> + + <_> + + + + <_>10 17 3 2 -1. + <_>11 17 1 2 3. + 0 + -6.1275060288608074e-003 + 0.1775255054235458 + 0.5196629166603088 + <_> + + <_> + + + + <_>9 9 2 2 -1. + <_>9 10 2 1 2. + 0 + -4.4576259097084403e-004 + 0.3024170100688934 + 0.5533593893051148 + <_> + + <_> + + + + <_>7 6 6 4 -1. + <_>9 6 2 4 3. + 0 + 0.0226465407758951 + 0.4414930939674377 + 0.6975377202033997 + <_> + + <_> + + + + <_>7 17 3 2 -1. + <_>8 17 1 2 3. + 0 + -1.8804960418492556e-003 + 0.2791394889354706 + 0.5497952103614807 + <_> + + <_> + + + + <_>10 17 3 3 -1. + <_>11 17 1 3 3. + 0 + 7.0889107882976532e-003 + 0.5263199210166931 + 0.2385547012090683 + <_> + + <_> + + + + <_>8 12 3 2 -1. + <_>8 13 3 1 2. + 0 + 1.7318050377070904e-003 + 0.4319379031658173 + 0.6983600854873657 + <_> + + <_> + + + + <_>9 3 6 2 -1. + <_>11 3 2 2 3. + 0 + -6.8482700735330582e-003 + 0.3082042932510376 + 0.5390920042991638 + <_> + + <_> + + + + <_>3 11 14 4 -1. + <_>3 13 14 2 2. + 0 + -1.5062530110299122e-005 + 0.5521922111511231 + 0.3120366036891937 + <_> + + <_> + + + + <_>1 10 18 4 -1. + <_>10 10 9 2 2. + <_>1 12 9 2 2. + 0 + 0.0294755697250366 + 0.5401322841644287 + 0.1770603060722351 + <_> + + <_> + + + + <_>0 10 3 3 -1. + <_>0 11 3 1 3. + 0 + 8.1387329846620560e-003 + 0.5178617835044861 + 0.1211019009351730 + <_> + + <_> + + + + <_>9 1 6 6 -1. + <_>11 1 2 6 3. + 0 + 0.0209429506212473 + 0.5290294289588928 + 0.3311221897602081 + <_> + + <_> + + + + <_>8 7 3 6 -1. + <_>9 7 1 6 3. + 0 + -9.5665529370307922e-003 + 0.7471994161605835 + 0.4451968967914581 + 18.4129695892333980 + 2 + -1 + <_> + + + <_> + + <_> + + + + <_>1 0 18 9 -1. + <_>1 3 18 3 3. + 0 + -2.8206960996612906e-004 + 0.2064086049795151 + 0.6076732277870178 + <_> + + <_> + + + + <_>12 10 2 6 -1. + <_>12 13 2 3 2. + 0 + 1.6790600493550301e-003 + 0.5851997137069702 + 0.1255383938550949 + <_> + + <_> + + + + <_>0 5 19 8 -1. + <_>0 9 19 4 2. + 0 + 6.9827912375330925e-004 + 0.0940184295177460 + 0.5728961229324341 + <_> + + <_> + + + + <_>7 0 6 9 -1. + <_>9 0 2 9 3. + 0 + 7.8959012171253562e-004 + 0.1781987994909287 + 0.5694308876991272 + <_> + + <_> + + + + <_>5 3 6 1 -1. + <_>7 3 2 1 3. + 0 + -2.8560499195009470e-003 + 0.1638399064540863 + 0.5788664817810059 + <_> + + <_> + + + + <_>11 3 6 1 -1. + <_>13 3 2 1 3. + 0 + -3.8122469559311867e-003 + 0.2085440009832382 + 0.5508564710617065 + <_> + + <_> + + + + <_>5 10 4 6 -1. + <_>5 13 4 3 2. + 0 + 1.5896620461717248e-003 + 0.5702760815620422 + 0.1857215017080307 + <_> + + <_> + + + + <_>11 3 6 1 -1. + <_>13 3 2 1 3. + 0 + 0.0100783398374915 + 0.5116943120956421 + 0.2189770042896271 + <_> + + <_> + + + + <_>4 4 12 6 -1. + <_>4 6 12 2 3. + 0 + -0.0635263025760651 + 0.7131379842758179 + 0.4043813049793243 + <_> + + <_> + + + + <_>15 12 2 6 -1. + <_>15 14 2 2 3. + 0 + -9.1031491756439209e-003 + 0.2567181885242462 + 0.5463973283767700 + <_> + + <_> + + + + <_>9 3 2 2 -1. + <_>10 3 1 2 2. + 0 + -2.4035000242292881e-003 + 0.1700665950775147 + 0.5590974092483521 + <_> + + <_> + + + + <_>9 3 3 1 -1. + <_>10 3 1 1 3. + 0 + 1.5226360410451889e-003 + 0.5410556793212891 + 0.2619054019451141 + <_> + + <_> + + + + <_>1 1 4 14 -1. + <_>3 1 2 14 2. + 0 + 0.0179974399507046 + 0.3732436895370483 + 0.6535220742225647 + <_> + + <_> + + + + <_>9 0 4 4 -1. + <_>11 0 2 2 2. + <_>9 2 2 2 2. + 0 + -6.4538191072642803e-003 + 0.2626481950283051 + 0.5537446141242981 + <_> + + <_> + + + + <_>7 5 1 14 -1. + <_>7 12 1 7 2. + 0 + -0.0118807600811124 + 0.2003753930330277 + 0.5544745922088623 + <_> + + <_> + + + + <_>19 0 1 4 -1. + <_>19 2 1 2 2. + 0 + 1.2713660253211856e-003 + 0.5591902732849121 + 0.3031975924968720 + <_> + + <_> + + + + <_>5 5 6 4 -1. + <_>8 5 3 4 2. + 0 + 1.1376109905540943e-003 + 0.2730407118797302 + 0.5646508932113648 + <_> + + <_> + + + + <_>9 18 3 2 -1. + <_>10 18 1 2 3. + 0 + -4.2651998810470104e-003 + 0.1405909061431885 + 0.5461820960044861 + <_> + + <_> + + + + <_>8 18 3 2 -1. + <_>9 18 1 2 3. + 0 + -2.9602861031889915e-003 + 0.1795035004615784 + 0.5459290146827698 + <_> + + <_> + + + + <_>4 5 12 6 -1. + <_>4 7 12 2 3. + 0 + -8.8448226451873779e-003 + 0.5736783146858215 + 0.2809219956398010 + <_> + + <_> + + + + <_>3 12 2 6 -1. + <_>3 14 2 2 3. + 0 + -6.6430689767003059e-003 + 0.2370675951242447 + 0.5503826141357422 + <_> + + <_> + + + + <_>10 8 2 12 -1. + <_>10 12 2 4 3. + 0 + 3.9997808635234833e-003 + 0.5608199834823608 + 0.3304282128810883 + <_> + + <_> + + + + <_>7 18 3 2 -1. + <_>8 18 1 2 3. + 0 + -4.1221720166504383e-003 + 0.1640105992555618 + 0.5378993153572083 + <_> + + <_> + + + + <_>9 0 6 2 -1. + <_>11 0 2 2 3. + 0 + 0.0156249096617103 + 0.5227649211883545 + 0.2288603931665421 + <_> + + <_> + + + + <_>5 11 9 3 -1. + <_>5 12 9 1 3. + 0 + -0.0103564197197557 + 0.7016193866729736 + 0.4252927899360657 + <_> + + <_> + + + + <_>9 0 6 2 -1. + <_>11 0 2 2 3. + 0 + -8.7960809469223022e-003 + 0.2767347097396851 + 0.5355830192565918 + <_> + + <_> + + + + <_>1 1 18 5 -1. + <_>7 1 6 5 3. + 0 + 0.1622693985700607 + 0.4342240095138550 + 0.7442579269409180 + <_> + + <_> + + + + <_>8 0 4 4 -1. + <_>10 0 2 2 2. + <_>8 2 2 2 2. + 0 + 4.5542530715465546e-003 + 0.5726485848426819 + 0.2582125067710877 + <_> + + <_> + + + + <_>3 12 1 3 -1. + <_>3 13 1 1 3. + 0 + -2.1309209987521172e-003 + 0.2106848061084747 + 0.5361018776893616 + <_> + + <_> + + + + <_>8 14 5 3 -1. + <_>8 15 5 1 3. + 0 + -0.0132084200158715 + 0.7593790888786316 + 0.4552468061447144 + <_> + + <_> + + + + <_>5 4 10 12 -1. + <_>5 4 5 6 2. + <_>10 10 5 6 2. + 0 + -0.0659966766834259 + 0.1252475976943970 + 0.5344039797782898 + <_> + + <_> + + + + <_>9 6 9 12 -1. + <_>9 10 9 4 3. + 0 + 7.9142656177282333e-003 + 0.3315384089946747 + 0.5601043105125427 + <_> + + <_> + + + + <_>2 2 12 14 -1. + <_>2 2 6 7 2. + <_>8 9 6 7 2. + 0 + 0.0208942797034979 + 0.5506049990653992 + 0.2768838107585907 + 15.3241395950317380 + 3 + -1 + <_> + + + <_> + + <_> + + + + <_>4 7 12 2 -1. + <_>8 7 4 2 3. + 0 + 1.1961159761995077e-003 + 0.1762690991163254 + 0.6156241297721863 + <_> + + <_> + + + + <_>7 4 6 4 -1. + <_>7 6 6 2 2. + 0 + -1.8679830245673656e-003 + 0.6118106842041016 + 0.1832399964332581 + <_> + + <_> + + + + <_>4 5 11 8 -1. + <_>4 9 11 4 2. + 0 + -1.9579799845814705e-004 + 0.0990442633628845 + 0.5723816156387329 + <_> + + <_> + + + + <_>3 10 16 4 -1. + <_>3 12 16 2 2. + 0 + -8.0255657667294145e-004 + 0.5579879879951477 + 0.2377282977104187 + <_> + + <_> + + + + <_>0 0 16 2 -1. + <_>0 1 16 1 2. + 0 + -2.4510810617357492e-003 + 0.2231457978487015 + 0.5858935117721558 + <_> + + <_> + + + + <_>7 5 6 2 -1. + <_>9 5 2 2 3. + 0 + 5.0361850298941135e-004 + 0.2653993964195252 + 0.5794103741645813 + <_> + + <_> + + + + <_>3 2 6 10 -1. + <_>3 2 3 5 2. + <_>6 7 3 5 2. + 0 + 4.0293349884450436e-003 + 0.5803827047348023 + 0.2484865039587021 + <_> + + <_> + + + + <_>10 5 8 15 -1. + <_>10 10 8 5 3. + 0 + -0.0144517095759511 + 0.1830351948738098 + 0.5484204888343811 + <_> + + <_> + + + + <_>3 14 8 6 -1. + <_>3 14 4 3 2. + <_>7 17 4 3 2. + 0 + 2.0380979403853416e-003 + 0.3363558948040009 + 0.6051092743873596 + <_> + + <_> + + + + <_>14 2 2 2 -1. + <_>14 3 2 1 2. + 0 + -1.6155190533027053e-003 + 0.2286642044782639 + 0.5441246032714844 + <_> + + <_> + + + + <_>1 10 7 6 -1. + <_>1 13 7 3 2. + 0 + 3.3458340913057327e-003 + 0.5625913143157959 + 0.2392338067293167 + <_> + + <_> + + + + <_>15 4 4 3 -1. + <_>15 4 2 3 2. + 0 + 1.6379579901695251e-003 + 0.3906993865966797 + 0.5964621901512146 + <_> + + <_> + + + + <_>2 9 14 6 -1. + <_>2 9 7 3 2. + <_>9 12 7 3 2. + 0 + 0.0302512105554342 + 0.5248482227325440 + 0.1575746983289719 + <_> + + <_> + + + + <_>5 7 10 4 -1. + <_>5 9 10 2 2. + 0 + 0.0372519902884960 + 0.4194310903549194 + 0.6748418807983398 + <_> + + <_> + + + + <_>6 9 8 8 -1. + <_>6 9 4 4 2. + <_>10 13 4 4 2. + 0 + -0.0251097902655602 + 0.1882549971342087 + 0.5473451018333435 + <_> + + <_> + + + + <_>14 1 3 2 -1. + <_>14 2 3 1 2. + 0 + -5.3099058568477631e-003 + 0.1339973062276840 + 0.5227110981941223 + <_> + + <_> + + + + <_>1 4 4 2 -1. + <_>3 4 2 2 2. + 0 + 1.2086479691788554e-003 + 0.3762088119983673 + 0.6109635829925537 + <_> + + <_> + + + + <_>11 10 2 8 -1. + <_>11 14 2 4 2. + 0 + -0.0219076797366142 + 0.2663142979145050 + 0.5404006838798523 + <_> + + <_> + + + + <_>0 0 5 3 -1. + <_>0 1 5 1 3. + 0 + 5.4116579703986645e-003 + 0.5363578796386719 + 0.2232273072004318 + <_> + + <_> + + + + <_>2 5 18 8 -1. + <_>11 5 9 4 2. + <_>2 9 9 4 2. + 0 + 0.0699463263154030 + 0.5358232855796814 + 0.2453698068857193 + <_> + + <_> + + + + <_>6 6 1 6 -1. + <_>6 9 1 3 2. + 0 + 3.4520021290518343e-004 + 0.2409671992063522 + 0.5376930236816406 + <_> + + <_> + + + + <_>19 1 1 3 -1. + <_>19 2 1 1 3. + 0 + 1.2627709656953812e-003 + 0.5425856709480286 + 0.3155693113803864 + <_> + + <_> + + + + <_>7 6 6 6 -1. + <_>9 6 2 6 3. + 0 + 0.0227195098996162 + 0.4158405959606171 + 0.6597865223884583 + <_> + + <_> + + + + <_>19 1 1 3 -1. + <_>19 2 1 1 3. + 0 + -1.8111000536009669e-003 + 0.2811253070831299 + 0.5505244731903076 + <_> + + <_> + + + + <_>3 13 2 3 -1. + <_>3 14 2 1 3. + 0 + 3.3469670452177525e-003 + 0.5260028243064880 + 0.1891465038061142 + <_> + + <_> + + + + <_>8 4 8 12 -1. + <_>12 4 4 6 2. + <_>8 10 4 6 2. + 0 + 4.0791751234792173e-004 + 0.5673509240150452 + 0.3344210088253021 + <_> + + <_> + + + + <_>5 2 6 3 -1. + <_>7 2 2 3 3. + 0 + 0.0127347996458411 + 0.5343592166900635 + 0.2395612001419067 + <_> + + <_> + + + + <_>6 1 9 10 -1. + <_>6 6 9 5 2. + 0 + -7.3119727894663811e-003 + 0.6010890007019043 + 0.4022207856178284 + <_> + + <_> + + + + <_>0 4 6 12 -1. + <_>2 4 2 12 3. + 0 + -0.0569487512111664 + 0.8199151158332825 + 0.4543190896511078 + <_> + + <_> + + + + <_>15 13 2 3 -1. + <_>15 14 2 1 3. + 0 + -5.0116591155529022e-003 + 0.2200281023979187 + 0.5357710719108582 + <_> + + <_> + + + + <_>7 14 5 3 -1. + <_>7 15 5 1 3. + 0 + 6.0334368608891964e-003 + 0.4413081109523773 + 0.7181751132011414 + <_> + + <_> + + + + <_>15 13 3 3 -1. + <_>15 14 3 1 3. + 0 + 3.9437441155314445e-003 + 0.5478860735893250 + 0.2791733145713806 + <_> + + <_> + + + + <_>6 14 8 3 -1. + <_>6 15 8 1 3. + 0 + -3.6591119132936001e-003 + 0.6357867717742920 + 0.3989723920822144 + <_> + + <_> + + + + <_>15 13 3 3 -1. + <_>15 14 3 1 3. + 0 + -3.8456181064248085e-003 + 0.3493686020374298 + 0.5300664901733398 + <_> + + <_> + + + + <_>2 13 3 3 -1. + <_>2 14 3 1 3. + 0 + -7.1926261298358440e-003 + 0.1119614988565445 + 0.5229672789573669 + <_> + + <_> + + + + <_>4 7 12 12 -1. + <_>10 7 6 6 2. + <_>4 13 6 6 2. + 0 + -0.0527989417314529 + 0.2387102991342545 + 0.5453451275825501 + <_> + + <_> + + + + <_>9 7 2 6 -1. + <_>10 7 1 6 2. + 0 + -7.9537667334079742e-003 + 0.7586917877197266 + 0.4439376890659332 + <_> + + <_> + + + + <_>8 9 5 2 -1. + <_>8 10 5 1 2. + 0 + -2.7344180271029472e-003 + 0.2565476894378662 + 0.5489321947097778 + <_> + + <_> + + + + <_>8 6 3 4 -1. + <_>9 6 1 4 3. + 0 + -1.8507939530536532e-003 + 0.6734347939491272 + 0.4252474904060364 + <_> + + <_> + + + + <_>9 6 2 8 -1. + <_>9 10 2 4 2. + 0 + 0.0159189198166132 + 0.5488352775573731 + 0.2292661964893341 + <_> + + <_> + + + + <_>7 7 3 6 -1. + <_>8 7 1 6 3. + 0 + -1.2687679845839739e-003 + 0.6104331016540527 + 0.4022389948368073 + <_> + + <_> + + + + <_>11 3 3 3 -1. + <_>12 3 1 3 3. + 0 + 6.2883910723030567e-003 + 0.5310853123664856 + 0.1536193042993546 + <_> + + <_> + + + + <_>5 4 6 1 -1. + <_>7 4 2 1 3. + 0 + -6.2259892001748085e-003 + 0.1729111969470978 + 0.5241606235504150 + <_> + + <_> + + + + <_>5 6 10 3 -1. + <_>5 7 10 1 3. + 0 + -0.0121325999498367 + 0.6597759723663330 + 0.4325182139873505 + 21.0106391906738280 + 4 + -1 + <_> + + + <_> + + <_> + + + + <_>7 3 6 9 -1. + <_>7 6 6 3 3. + 0 + -3.9184908382594585e-003 + 0.6103435158729553 + 0.1469330936670303 + <_> + + <_> + + + + <_>6 7 9 1 -1. + <_>9 7 3 1 3. + 0 + 1.5971299726516008e-003 + 0.2632363140583038 + 0.5896466970443726 + <_> + + <_> + + + + <_>2 8 16 8 -1. + <_>2 12 16 4 2. + 0 + 0.0177801102399826 + 0.5872874259948731 + 0.1760361939668655 + <_> + + <_> + + + + <_>14 6 2 6 -1. + <_>14 9 2 3 2. + 0 + 6.5334769897162914e-004 + 0.1567801982164383 + 0.5596066117286682 + <_> + + <_> + + + + <_>1 5 6 15 -1. + <_>1 10 6 5 3. + 0 + -2.8353091329336166e-004 + 0.1913153976202011 + 0.5732036232948303 + <_> + + <_> + + + + <_>10 0 6 9 -1. + <_>10 3 6 3 3. + 0 + 1.6104689566418529e-003 + 0.2914913892745972 + 0.5623080730438232 + <_> + + <_> + + + + <_>6 6 7 14 -1. + <_>6 13 7 7 2. + 0 + -0.0977506190538406 + 0.1943476945161820 + 0.5648233294487000 + <_> + + <_> + + + + <_>13 7 3 6 -1. + <_>13 9 3 2 3. + 0 + 5.5182358482852578e-004 + 0.3134616911411285 + 0.5504639744758606 + <_> + + <_> + + + + <_>1 8 15 4 -1. + <_>6 8 5 4 3. + 0 + -0.0128582203760743 + 0.2536481916904450 + 0.5760142803192139 + <_> + + <_> + + + + <_>11 2 3 10 -1. + <_>11 7 3 5 2. + 0 + 4.1530239395797253e-003 + 0.5767722129821777 + 0.3659774065017700 + <_> + + <_> + + + + <_>3 7 4 6 -1. + <_>3 9 4 2 3. + 0 + 1.7092459602281451e-003 + 0.2843191027641296 + 0.5918939113616943 + <_> + + <_> + + + + <_>13 3 6 10 -1. + <_>15 3 2 10 3. + 0 + 7.5217359699308872e-003 + 0.4052427113056183 + 0.6183109283447266 + <_> + + <_> + + + + <_>5 7 8 10 -1. + <_>5 7 4 5 2. + <_>9 12 4 5 2. + 0 + 2.2479810286313295e-003 + 0.5783755183219910 + 0.3135401010513306 + <_> + + <_> + + + + <_>4 4 12 12 -1. + <_>10 4 6 6 2. + <_>4 10 6 6 2. + 0 + 0.0520062111318111 + 0.5541312098503113 + 0.1916636973619461 + <_> + + <_> + + + + <_>1 4 6 9 -1. + <_>3 4 2 9 3. + 0 + 0.0120855299755931 + 0.4032655954360962 + 0.6644591093063355 + <_> + + <_> + + + + <_>11 3 2 5 -1. + <_>11 3 1 5 2. + 0 + 1.4687820112158079e-005 + 0.3535977900028229 + 0.5709382891654968 + <_> + + <_> + + + + <_>7 3 2 5 -1. + <_>8 3 1 5 2. + 0 + 7.1395188570022583e-006 + 0.3037444949150085 + 0.5610269904136658 + <_> + + <_> + + + + <_>10 14 2 3 -1. + <_>10 15 2 1 3. + 0 + -4.6001640148460865e-003 + 0.7181087136268616 + 0.4580326080322266 + <_> + + <_> + + + + <_>5 12 6 2 -1. + <_>8 12 3 2 2. + 0 + 2.0058949012309313e-003 + 0.5621951818466187 + 0.2953684031963348 + <_> + + <_> + + + + <_>9 14 2 3 -1. + <_>9 15 2 1 3. + 0 + 4.5050270855426788e-003 + 0.4615387916564941 + 0.7619017958641052 + <_> + + <_> + + + + <_>4 11 12 6 -1. + <_>4 14 12 3 2. + 0 + 0.0117468303069472 + 0.5343837141990662 + 0.1772529035806656 + <_> + + <_> + + + + <_>11 11 5 9 -1. + <_>11 14 5 3 3. + 0 + -0.0583163388073444 + 0.1686245948076248 + 0.5340772271156311 + <_> + + <_> + + + + <_>6 15 3 2 -1. + <_>6 16 3 1 2. + 0 + 2.3629379575140774e-004 + 0.3792056143283844 + 0.6026803851127625 + <_> + + <_> + + + + <_>11 0 3 5 -1. + <_>12 0 1 5 3. + 0 + -7.8156180679798126e-003 + 0.1512867063283920 + 0.5324323773384094 + <_> + + <_> + + + + <_>5 5 6 7 -1. + <_>8 5 3 7 2. + 0 + -0.0108761601150036 + 0.2081822007894516 + 0.5319945216178894 + <_> + + <_> + + + + <_>13 0 1 9 -1. + <_>13 3 1 3 3. + 0 + -2.7745519764721394e-003 + 0.4098246991634369 + 0.5210328102111816 + <_> + + <_> + + + + <_>3 2 4 8 -1. + <_>3 2 2 4 2. + <_>5 6 2 4 2. + 0 + -7.8276381827890873e-004 + 0.5693274140357971 + 0.3478842079639435 + <_> + + <_> + + + + <_>13 12 4 6 -1. + <_>13 14 4 2 3. + 0 + 0.0138704096898437 + 0.5326750874519348 + 0.2257698029279709 + <_> + + <_> + + + + <_>3 12 4 6 -1. + <_>3 14 4 2 3. + 0 + -0.0236749108880758 + 0.1551305055618286 + 0.5200707912445068 + <_> + + <_> + + + + <_>13 11 3 4 -1. + <_>13 13 3 2 2. + 0 + -1.4879409718560055e-005 + 0.5500566959381104 + 0.3820176124572754 + <_> + + <_> + + + + <_>4 4 4 3 -1. + <_>4 5 4 1 3. + 0 + 3.6190641112625599e-003 + 0.4238683879375458 + 0.6639748215675354 + <_> + + <_> + + + + <_>7 5 11 8 -1. + <_>7 9 11 4 2. + 0 + -0.0198171101510525 + 0.2150038033723831 + 0.5382357835769653 + <_> + + <_> + + + + <_>7 8 3 4 -1. + <_>8 8 1 4 3. + 0 + -3.8154039066284895e-003 + 0.6675711274147034 + 0.4215297102928162 + <_> + + <_> + + + + <_>9 1 6 1 -1. + <_>11 1 2 1 3. + 0 + -4.9775829538702965e-003 + 0.2267289012670517 + 0.5386328101158142 + <_> + + <_> + + + + <_>5 5 3 3 -1. + <_>5 6 3 1 3. + 0 + 2.2441020701080561e-003 + 0.4308691024780273 + 0.6855735778808594 + <_> + + <_> + + + + <_>0 9 20 6 -1. + <_>10 9 10 3 2. + <_>0 12 10 3 2. + 0 + 0.0122824599966407 + 0.5836614966392517 + 0.3467479050159454 + <_> + + <_> + + + + <_>8 6 3 5 -1. + <_>9 6 1 5 3. + 0 + -2.8548699337989092e-003 + 0.7016944885253906 + 0.4311453998088837 + <_> + + <_> + + + + <_>11 0 1 3 -1. + <_>11 1 1 1 3. + 0 + -3.7875669077038765e-003 + 0.2895345091819763 + 0.5224946141242981 + <_> + + <_> + + + + <_>4 2 4 2 -1. + <_>4 3 4 1 2. + 0 + -1.2201230274513364e-003 + 0.2975570857524872 + 0.5481644868850708 + <_> + + <_> + + + + <_>12 6 4 3 -1. + <_>12 7 4 1 3. + 0 + 0.0101605998352170 + 0.4888817965984345 + 0.8182697892189026 + <_> + + <_> + + + + <_>5 0 6 4 -1. + <_>7 0 2 4 3. + 0 + -0.0161745697259903 + 0.1481492966413498 + 0.5239992737770081 + <_> + + <_> + + + + <_>9 7 3 8 -1. + <_>10 7 1 8 3. + 0 + 0.0192924607545137 + 0.4786309897899628 + 0.7378190755844116 + <_> + + <_> + + + + <_>9 7 2 2 -1. + <_>10 7 1 2 2. + 0 + -3.2479539513587952e-003 + 0.7374222874641419 + 0.4470643997192383 + <_> + + <_> + + + + <_>6 7 14 4 -1. + <_>13 7 7 2 2. + <_>6 9 7 2 2. + 0 + -9.3803480267524719e-003 + 0.3489154875278473 + 0.5537996292114258 + <_> + + <_> + + + + <_>0 5 3 6 -1. + <_>0 7 3 2 3. + 0 + -0.0126061299815774 + 0.2379686981439591 + 0.5315443277359009 + <_> + + <_> + + + + <_>13 11 3 4 -1. + <_>13 13 3 2 2. + 0 + -0.0256219301372766 + 0.1964688003063202 + 0.5138769745826721 + <_> + + <_> + + + + <_>4 11 3 4 -1. + <_>4 13 3 2 2. + 0 + -7.5741496402770281e-005 + 0.5590522885322571 + 0.3365853130817413 + <_> + + <_> + + + + <_>5 9 12 8 -1. + <_>11 9 6 4 2. + <_>5 13 6 4 2. + 0 + -0.0892108827829361 + 0.0634046569466591 + 0.5162634849548340 + <_> + + <_> + + + + <_>9 12 1 3 -1. + <_>9 13 1 1 3. + 0 + -2.7670480776578188e-003 + 0.7323467731475830 + 0.4490706026554108 + <_> + + <_> + + + + <_>10 15 2 4 -1. + <_>10 17 2 2 2. + 0 + 2.7152578695677221e-004 + 0.4114834964275360 + 0.5985518097877502 + 23.9187908172607420 + 5 + -1 + <_> + + + <_> + + <_> + + + + <_>7 7 6 1 -1. + <_>9 7 2 1 3. + 0 + 1.4786219689995050e-003 + 0.2663545012474060 + 0.6643316745758057 + <_> + + <_> + + + + <_>12 3 6 6 -1. + <_>15 3 3 3 2. + <_>12 6 3 3 2. + 0 + -1.8741659587249160e-003 + 0.6143848896026611 + 0.2518512904644013 + <_> + + <_> + + + + <_>0 4 10 6 -1. + <_>0 6 10 2 3. + 0 + -1.7151009524241090e-003 + 0.5766341090202332 + 0.2397463023662567 + <_> + + <_> + + + + <_>8 3 8 14 -1. + <_>12 3 4 7 2. + <_>8 10 4 7 2. + 0 + -1.8939269939437509e-003 + 0.5682045817375183 + 0.2529144883155823 + <_> + + <_> + + + + <_>4 4 7 15 -1. + <_>4 9 7 5 3. + 0 + -5.3006052039563656e-003 + 0.1640675961971283 + 0.5556079745292664 + <_> + + <_> + + + + <_>12 2 6 8 -1. + <_>15 2 3 4 2. + <_>12 6 3 4 2. + 0 + -0.0466625317931175 + 0.6123154163360596 + 0.4762830138206482 + <_> + + <_> + + + + <_>2 2 6 8 -1. + <_>2 2 3 4 2. + <_>5 6 3 4 2. + 0 + -7.9431332414969802e-004 + 0.5707858800888062 + 0.2839404046535492 + <_> + + <_> + + + + <_>2 13 18 7 -1. + <_>8 13 6 7 3. + 0 + 0.0148916700854898 + 0.4089672863483429 + 0.6006367206573486 + <_> + + <_> + + + + <_>4 3 8 14 -1. + <_>4 3 4 7 2. + <_>8 10 4 7 2. + 0 + -1.2046529445797205e-003 + 0.5712450742721558 + 0.2705289125442505 + <_> + + <_> + + + + <_>18 1 2 6 -1. + <_>18 3 2 2 3. + 0 + 6.0619381256401539e-003 + 0.5262504220008850 + 0.3262225985527039 + <_> + + <_> + + + + <_>9 11 2 3 -1. + <_>9 12 2 1 3. + 0 + -2.5286648888140917e-003 + 0.6853830814361572 + 0.4199256896972656 + <_> + + <_> + + + + <_>18 1 2 6 -1. + <_>18 3 2 2 3. + 0 + -5.9010218828916550e-003 + 0.3266282081604004 + 0.5434812903404236 + <_> + + <_> + + + + <_>0 1 2 6 -1. + <_>0 3 2 2 3. + 0 + 5.6702760048210621e-003 + 0.5468410849571228 + 0.2319003939628601 + <_> + + <_> + + + + <_>1 5 18 6 -1. + <_>1 7 18 2 3. + 0 + -3.0304100364446640e-003 + 0.5570667982101440 + 0.2708238065242767 + <_> + + <_> + + + + <_>0 2 6 7 -1. + <_>3 2 3 7 2. + 0 + 2.9803649522364140e-003 + 0.3700568974018097 + 0.5890625715255737 + <_> + + <_> + + + + <_>7 3 6 14 -1. + <_>7 10 6 7 2. + 0 + -0.0758405104279518 + 0.2140070050954819 + 0.5419948101043701 + <_> + + <_> + + + + <_>3 7 13 10 -1. + <_>3 12 13 5 2. + 0 + 0.0192625392228365 + 0.5526772141456604 + 0.2726590037345886 + <_> + + <_> + + + + <_>11 15 2 2 -1. + <_>11 16 2 1 2. + 0 + 1.8888259364757687e-004 + 0.3958011865615845 + 0.6017209887504578 + <_> + + <_> + + + + <_>2 11 16 4 -1. + <_>2 11 8 2 2. + <_>10 13 8 2 2. + 0 + 0.0293695498257875 + 0.5241373777389526 + 0.1435758024454117 + <_> + + <_> + + + + <_>13 7 6 4 -1. + <_>16 7 3 2 2. + <_>13 9 3 2 2. + 0 + 1.0417619487270713e-003 + 0.3385409116744995 + 0.5929983258247376 + <_> + + <_> + + + + <_>6 10 3 9 -1. + <_>6 13 3 3 3. + 0 + 2.6125640142709017e-003 + 0.5485377907752991 + 0.3021597862243652 + <_> + + <_> + + + + <_>14 6 1 6 -1. + <_>14 9 1 3 2. + 0 + 9.6977467183023691e-004 + 0.3375276029109955 + 0.5532032847404480 + <_> + + <_> + + + + <_>5 10 4 1 -1. + <_>7 10 2 1 2. + 0 + 5.9512659208849072e-004 + 0.5631743073463440 + 0.3359399139881134 + <_> + + <_> + + + + <_>3 8 15 5 -1. + <_>8 8 5 5 3. + 0 + -0.1015655994415283 + 0.0637350380420685 + 0.5230425000190735 + <_> + + <_> + + + + <_>1 6 5 4 -1. + <_>1 8 5 2 2. + 0 + 0.0361566990613937 + 0.5136963129043579 + 0.1029528975486755 + <_> + + <_> + + + + <_>3 1 17 6 -1. + <_>3 3 17 2 3. + 0 + 3.4624140243977308e-003 + 0.3879320025444031 + 0.5558289289474487 + <_> + + <_> + + + + <_>6 7 8 2 -1. + <_>10 7 4 2 2. + 0 + 0.0195549800992012 + 0.5250086784362793 + 0.1875859946012497 + <_> + + <_> + + + + <_>9 7 3 2 -1. + <_>10 7 1 2 3. + 0 + -2.3121440317481756e-003 + 0.6672028899192810 + 0.4679641127586365 + <_> + + <_> + + + + <_>8 7 3 2 -1. + <_>9 7 1 2 3. + 0 + -1.8605289515107870e-003 + 0.7163379192352295 + 0.4334670901298523 + <_> + + <_> + + + + <_>8 9 4 2 -1. + <_>8 10 4 1 2. + 0 + -9.4026362057775259e-004 + 0.3021360933780670 + 0.5650203227996826 + <_> + + <_> + + + + <_>8 8 4 3 -1. + <_>8 9 4 1 3. + 0 + -5.2418331615626812e-003 + 0.1820009052753449 + 0.5250256061553955 + <_> + + <_> + + + + <_>9 5 6 4 -1. + <_>9 5 3 4 2. + 0 + 1.1729019752237946e-004 + 0.3389188051223755 + 0.5445973277091980 + <_> + + <_> + + + + <_>8 13 4 3 -1. + <_>8 14 4 1 3. + 0 + 1.1878840159624815e-003 + 0.4085349142551422 + 0.6253563165664673 + <_> + + <_> + + + + <_>4 7 12 6 -1. + <_>10 7 6 3 2. + <_>4 10 6 3 2. + 0 + -0.0108813596889377 + 0.3378399014472961 + 0.5700082778930664 + <_> + + <_> + + + + <_>8 14 4 3 -1. + <_>8 15 4 1 3. + 0 + 1.7354859737679362e-003 + 0.4204635918140411 + 0.6523038744926453 + <_> + + <_> + + + + <_>9 7 3 3 -1. + <_>9 8 3 1 3. + 0 + -6.5119052305817604e-003 + 0.2595216035842896 + 0.5428143739700317 + <_> + + <_> + + + + <_>7 4 3 8 -1. + <_>8 4 1 8 3. + 0 + -1.2136430013924837e-003 + 0.6165143847465515 + 0.3977893888950348 + <_> + + <_> + + + + <_>10 0 3 6 -1. + <_>11 0 1 6 3. + 0 + -0.0103542404249310 + 0.1628028005361557 + 0.5219504833221436 + <_> + + <_> + + + + <_>6 3 4 8 -1. + <_>8 3 2 8 2. + 0 + 5.5858830455690622e-004 + 0.3199650943279266 + 0.5503574013710022 + <_> + + <_> + + + + <_>14 3 6 13 -1. + <_>14 3 3 13 2. + 0 + 0.0152996499091387 + 0.4103994071483612 + 0.6122388243675232 + <_> + + <_> + + + + <_>8 13 3 6 -1. + <_>8 16 3 3 2. + 0 + -0.0215882100164890 + 0.1034912988543510 + 0.5197384953498840 + <_> + + <_> + + + + <_>14 3 6 13 -1. + <_>14 3 3 13 2. + 0 + -0.1283462941646576 + 0.8493865132331848 + 0.4893102943897247 + <_> + + <_> + + + + <_>0 7 10 4 -1. + <_>0 7 5 2 2. + <_>5 9 5 2 2. + 0 + -2.2927189711481333e-003 + 0.3130157887935638 + 0.5471575260162354 + <_> + + <_> + + + + <_>14 3 6 13 -1. + <_>14 3 3 13 2. + 0 + 0.0799151062965393 + 0.4856320917606354 + 0.6073989272117615 + <_> + + <_> + + + + <_>0 3 6 13 -1. + <_>3 3 3 13 2. + 0 + -0.0794410929083824 + 0.8394674062728882 + 0.4624533057212830 + <_> + + <_> + + + + <_>9 1 4 1 -1. + <_>9 1 2 1 2. + 0 + -5.2800010889768600e-003 + 0.1881695985794067 + 0.5306698083877564 + <_> + + <_> + + + + <_>8 0 2 1 -1. + <_>9 0 1 1 2. + 0 + 1.0463109938427806e-003 + 0.5271229147911072 + 0.2583065927028656 + <_> + + <_> + + + + <_>10 16 4 4 -1. + <_>12 16 2 2 2. + <_>10 18 2 2 2. + 0 + 2.6317298761568964e-004 + 0.4235304892063141 + 0.5735440850257874 + <_> + + <_> + + + + <_>9 6 2 3 -1. + <_>10 6 1 3 2. + 0 + -3.6173160187900066e-003 + 0.6934396028518677 + 0.4495444893836975 + <_> + + <_> + + + + <_>4 5 12 2 -1. + <_>8 5 4 2 3. + 0 + 0.0114218797534704 + 0.5900921225547791 + 0.4138193130493164 + <_> + + <_> + + + + <_>8 7 3 5 -1. + <_>9 7 1 5 3. + 0 + -1.9963278900831938e-003 + 0.6466382741928101 + 0.4327239990234375 + 24.5278797149658200 + 6 + -1 + <_> + + + <_> + + <_> + + + + <_>6 4 8 6 -1. + <_>6 6 8 2 3. + 0 + -9.9691245704889297e-003 + 0.6142324209213257 + 0.2482212036848068 + <_> + + <_> + + + + <_>9 5 2 12 -1. + <_>9 11 2 6 2. + 0 + 7.3073059320449829e-004 + 0.5704951882362366 + 0.2321965992450714 + <_> + + <_> + + + + <_>4 6 6 8 -1. + <_>4 10 6 4 2. + 0 + 6.4045301405712962e-004 + 0.2112251967191696 + 0.5814933180809021 + <_> + + <_> + + + + <_>12 2 8 5 -1. + <_>12 2 4 5 2. + 0 + 4.5424019917845726e-003 + 0.2950482070446014 + 0.5866311788558960 + <_> + + <_> + + + + <_>0 8 18 3 -1. + <_>0 9 18 1 3. + 0 + 9.2477443104144186e-005 + 0.2990990877151489 + 0.5791326761245728 + <_> + + <_> + + + + <_>8 12 4 8 -1. + <_>8 16 4 4 2. + 0 + -8.6603146046400070e-003 + 0.2813029885292053 + 0.5635542273521423 + <_> + + <_> + + + + <_>0 2 8 5 -1. + <_>4 2 4 5 2. + 0 + 8.0515816807746887e-003 + 0.3535369038581848 + 0.6054757237434387 + <_> + + <_> + + + + <_>13 11 3 4 -1. + <_>13 13 3 2 2. + 0 + 4.3835240649059415e-004 + 0.5596532225608826 + 0.2731510996818543 + <_> + + <_> + + + + <_>5 11 6 1 -1. + <_>7 11 2 1 3. + 0 + -9.8168973636347800e-005 + 0.5978031754493713 + 0.3638561069965363 + <_> + + <_> + + + + <_>11 3 3 1 -1. + <_>12 3 1 1 3. + 0 + -1.1298790341243148e-003 + 0.2755252122879028 + 0.5432729125022888 + <_> + + <_> + + + + <_>7 13 5 3 -1. + <_>7 14 5 1 3. + 0 + 6.4356150105595589e-003 + 0.4305641949176788 + 0.7069833278656006 + <_> + + <_> + + + + <_>11 11 7 6 -1. + <_>11 14 7 3 2. + 0 + -0.0568293295800686 + 0.2495242953300476 + 0.5294997096061707 + <_> + + <_> + + + + <_>2 11 7 6 -1. + <_>2 14 7 3 2. + 0 + 4.0668169967830181e-003 + 0.5478553175926209 + 0.2497723996639252 + <_> + + <_> + + + + <_>12 14 2 6 -1. + <_>12 16 2 2 3. + 0 + 4.8164798499783501e-005 + 0.3938601016998291 + 0.5706356167793274 + <_> + + <_> + + + + <_>8 14 3 3 -1. + <_>8 15 3 1 3. + 0 + 6.1795017682015896e-003 + 0.4407606124877930 + 0.7394766807556152 + <_> + + <_> + + + + <_>11 0 3 5 -1. + <_>12 0 1 5 3. + 0 + 6.4985752105712891e-003 + 0.5445243120193481 + 0.2479152977466583 + <_> + + <_> + + + + <_>6 1 4 9 -1. + <_>8 1 2 9 2. + 0 + -1.0211090557277203e-003 + 0.2544766962528229 + 0.5338971018791199 + <_> + + <_> + + + + <_>10 3 6 1 -1. + <_>12 3 2 1 3. + 0 + -5.4247528314590454e-003 + 0.2718858122825623 + 0.5324069261550903 + <_> + + <_> + + + + <_>8 8 3 4 -1. + <_>8 10 3 2 2. + 0 + -1.0559899965301156e-003 + 0.3178288042545319 + 0.5534508824348450 + <_> + + <_> + + + + <_>8 12 4 2 -1. + <_>8 13 4 1 2. + 0 + 6.6465808777138591e-004 + 0.4284219145774841 + 0.6558194160461426 + <_> + + <_> + + + + <_>5 18 4 2 -1. + <_>5 19 4 1 2. + 0 + -2.7524109464138746e-004 + 0.5902860760688782 + 0.3810262978076935 + <_> + + <_> + + + + <_>2 1 18 6 -1. + <_>2 3 18 2 3. + 0 + 4.2293202131986618e-003 + 0.3816489875316620 + 0.5709385871887207 + <_> + + <_> + + + + <_>6 0 3 2 -1. + <_>7 0 1 2 3. + 0 + -3.2868210691958666e-003 + 0.1747743934392929 + 0.5259544253349304 + <_> + + <_> + + + + <_>13 8 6 2 -1. + <_>16 8 3 1 2. + <_>13 9 3 1 2. + 0 + 1.5611879643984139e-004 + 0.3601722121238709 + 0.5725612044334412 + <_> + + <_> + + + + <_>6 10 3 6 -1. + <_>6 13 3 3 2. + 0 + -7.3621381488919724e-006 + 0.5401858091354370 + 0.3044497072696686 + <_> + + <_> + + + + <_>0 13 20 4 -1. + <_>10 13 10 2 2. + <_>0 15 10 2 2. + 0 + -0.0147672500461340 + 0.3220770061016083 + 0.5573434829711914 + <_> + + <_> + + + + <_>7 7 6 5 -1. + <_>9 7 2 5 3. + 0 + 0.0244895908981562 + 0.4301528036594391 + 0.6518812775611877 + <_> + + <_> + + + + <_>11 0 2 2 -1. + <_>11 1 2 1 2. + 0 + -3.7652091123163700e-004 + 0.3564583063125610 + 0.5598236918449402 + <_> + + <_> + + + + <_>1 8 6 2 -1. + <_>1 8 3 1 2. + <_>4 9 3 1 2. + 0 + 7.3657688517414499e-006 + 0.3490782976150513 + 0.5561897754669190 + <_> + + <_> + + + + <_>0 2 20 2 -1. + <_>10 2 10 1 2. + <_>0 3 10 1 2. + 0 + -0.0150999398902059 + 0.1776272058486939 + 0.5335299968719482 + <_> + + <_> + + + + <_>7 14 5 3 -1. + <_>7 15 5 1 3. + 0 + -3.8316650316119194e-003 + 0.6149687767028809 + 0.4221394062042236 + <_> + + <_> + + + + <_>7 13 6 6 -1. + <_>10 13 3 3 2. + <_>7 16 3 3 2. + 0 + 0.0169254001230001 + 0.5413014888763428 + 0.2166585028171539 + <_> + + <_> + + + + <_>9 12 2 3 -1. + <_>9 13 2 1 3. + 0 + -3.0477850232273340e-003 + 0.6449490785598755 + 0.4354617893695831 + <_> + + <_> + + + + <_>16 11 1 6 -1. + <_>16 13 1 2 3. + 0 + 3.2140589319169521e-003 + 0.5400155186653137 + 0.3523217141628265 + <_> + + <_> + + + + <_>3 11 1 6 -1. + <_>3 13 1 2 3. + 0 + -4.0023201145231724e-003 + 0.2774524092674255 + 0.5338417291641235 + <_> + + <_> + + + + <_>4 4 14 12 -1. + <_>11 4 7 6 2. + <_>4 10 7 6 2. + 0 + 7.4182129465043545e-003 + 0.5676739215850830 + 0.3702817857265472 + <_> + + <_> + + + + <_>5 4 3 3 -1. + <_>5 5 3 1 3. + 0 + -8.8764587417244911e-003 + 0.7749221920967102 + 0.4583688974380493 + <_> + + <_> + + + + <_>12 3 3 3 -1. + <_>13 3 1 3 3. + 0 + 2.7311739977449179e-003 + 0.5338721871376038 + 0.3996661007404327 + <_> + + <_> + + + + <_>6 6 8 3 -1. + <_>6 7 8 1 3. + 0 + -2.5082379579544067e-003 + 0.5611963272094727 + 0.3777498900890350 + <_> + + <_> + + + + <_>12 3 3 3 -1. + <_>13 3 1 3 3. + 0 + -8.0541074275970459e-003 + 0.2915228903293610 + 0.5179182887077332 + <_> + + <_> + + + + <_>3 1 4 10 -1. + <_>3 1 2 5 2. + <_>5 6 2 5 2. + 0 + -9.7938813269138336e-004 + 0.5536432862281799 + 0.3700192868709564 + <_> + + <_> + + + + <_>5 7 10 2 -1. + <_>5 7 5 2 2. + 0 + -5.8745909482240677e-003 + 0.3754391074180603 + 0.5679376125335693 + <_> + + <_> + + + + <_>8 7 3 3 -1. + <_>9 7 1 3 3. + 0 + -4.4936719350516796e-003 + 0.7019699215888977 + 0.4480949938297272 + <_> + + <_> + + + + <_>15 12 2 3 -1. + <_>15 13 2 1 3. + 0 + -5.4389229044318199e-003 + 0.2310364991426468 + 0.5313386917114258 + <_> + + <_> + + + + <_>7 8 3 4 -1. + <_>8 8 1 4 3. + 0 + -7.5094640487805009e-004 + 0.5864868760108948 + 0.4129343032836914 + <_> + + <_> + + + + <_>13 4 1 12 -1. + <_>13 10 1 6 2. + 0 + 1.4528800420521293e-005 + 0.3732407093048096 + 0.5619621276855469 + <_> + + <_> + + + + <_>4 5 12 12 -1. + <_>4 5 6 6 2. + <_>10 11 6 6 2. + 0 + 0.0407580696046352 + 0.5312091112136841 + 0.2720521986484528 + <_> + + <_> + + + + <_>7 14 7 3 -1. + <_>7 15 7 1 3. + 0 + 6.6505931317806244e-003 + 0.4710015952587128 + 0.6693493723869324 + <_> + + <_> + + + + <_>3 12 2 3 -1. + <_>3 13 2 1 3. + 0 + 4.5759351924061775e-003 + 0.5167819261550903 + 0.1637275964021683 + <_> + + <_> + + + + <_>3 2 14 2 -1. + <_>10 2 7 1 2. + <_>3 3 7 1 2. + 0 + 6.5269311890006065e-003 + 0.5397608876228333 + 0.2938531935214996 + <_> + + <_> + + + + <_>0 1 3 10 -1. + <_>1 1 1 10 3. + 0 + -0.0136603796854615 + 0.7086488008499146 + 0.4532200098037720 + <_> + + <_> + + + + <_>9 0 6 5 -1. + <_>11 0 2 5 3. + 0 + 0.0273588690906763 + 0.5206481218338013 + 0.3589231967926025 + <_> + + <_> + + + + <_>5 7 6 2 -1. + <_>8 7 3 2 2. + 0 + 6.2197551596909761e-004 + 0.3507075905799866 + 0.5441123247146606 + <_> + + <_> + + + + <_>7 1 6 10 -1. + <_>7 6 6 5 2. + 0 + -3.3077080734074116e-003 + 0.5859522819519043 + 0.4024891853332520 + <_> + + <_> + + + + <_>1 1 18 3 -1. + <_>7 1 6 3 3. + 0 + -0.0106311095878482 + 0.6743267178535461 + 0.4422602951526642 + <_> + + <_> + + + + <_>16 3 3 6 -1. + <_>16 5 3 2 3. + 0 + 0.0194416493177414 + 0.5282716155052185 + 0.1797904968261719 + 27.1533508300781250 + 7 + -1 + <_> + + + <_> + + <_> + + + + <_>6 3 7 6 -1. + <_>6 6 7 3 2. + 0 + -5.5052167735993862e-003 + 0.5914731025695801 + 0.2626559138298035 + <_> + + <_> + + + + <_>4 7 12 2 -1. + <_>8 7 4 2 3. + 0 + 1.9562279339879751e-003 + 0.2312581986188889 + 0.5741627216339111 + <_> + + <_> + + + + <_>0 4 17 10 -1. + <_>0 9 17 5 2. + 0 + -8.8924784213304520e-003 + 0.1656530052423477 + 0.5626654028892517 + <_> + + <_> + + + + <_>3 4 15 16 -1. + <_>3 12 15 8 2. + 0 + 0.0836383774876595 + 0.5423449873924255 + 0.1957294940948486 + <_> + + <_> + + + + <_>7 15 6 4 -1. + <_>7 17 6 2 2. + 0 + 1.2282270472496748e-003 + 0.3417904078960419 + 0.5992503762245178 + <_> + + <_> + + + + <_>15 2 4 9 -1. + <_>15 2 2 9 2. + 0 + 5.7629169896245003e-003 + 0.3719581961631775 + 0.6079903841018677 + <_> + + <_> + + + + <_>2 3 3 2 -1. + <_>2 4 3 1 2. + 0 + -1.6417410224676132e-003 + 0.2577486038208008 + 0.5576915740966797 + <_> + + <_> + + + + <_>13 6 7 9 -1. + <_>13 9 7 3 3. + 0 + 3.4113149158656597e-003 + 0.2950749099254608 + 0.5514171719551086 + <_> + + <_> + + + + <_>8 11 4 3 -1. + <_>8 12 4 1 3. + 0 + -0.0110693201422691 + 0.7569358944892883 + 0.4477078914642334 + <_> + + <_> + + + + <_>0 2 20 6 -1. + <_>10 2 10 3 2. + <_>0 5 10 3 2. + 0 + 0.0348659716546535 + 0.5583708882331848 + 0.2669621109962463 + <_> + + <_> + + + + <_>3 2 6 10 -1. + <_>3 2 3 5 2. + <_>6 7 3 5 2. + 0 + 6.5701099811121821e-004 + 0.5627313256263733 + 0.2988890111446381 + <_> + + <_> + + + + <_>13 10 3 4 -1. + <_>13 12 3 2 2. + 0 + -0.0243391301482916 + 0.2771185040473938 + 0.5108863115310669 + <_> + + <_> + + + + <_>4 10 3 4 -1. + <_>4 12 3 2 2. + 0 + 5.9435202274471521e-004 + 0.5580651760101318 + 0.3120341897010803 + <_> + + <_> + + + + <_>7 5 6 3 -1. + <_>9 5 2 3 3. + 0 + 2.2971509024500847e-003 + 0.3330250084400177 + 0.5679075717926025 + <_> + + <_> + + + + <_>7 6 6 8 -1. + <_>7 10 6 4 2. + 0 + -3.7801829166710377e-003 + 0.2990534901618958 + 0.5344808101654053 + <_> + + <_> + + + + <_>0 11 20 6 -1. + <_>0 14 20 3 2. + 0 + -0.1342066973447800 + 0.1463858932256699 + 0.5392568111419678 + <_> + + <_> + + + + <_>4 13 4 6 -1. + <_>4 13 2 3 2. + <_>6 16 2 3 2. + 0 + 7.5224548345431685e-004 + 0.3746953904628754 + 0.5692734718322754 + <_> + + <_> + + + + <_>6 0 8 12 -1. + <_>10 0 4 6 2. + <_>6 6 4 6 2. + 0 + -0.0405455417931080 + 0.2754747867584229 + 0.5484297871589661 + <_> + + <_> + + + + <_>2 0 15 2 -1. + <_>2 1 15 1 2. + 0 + 1.2572970008477569e-003 + 0.3744584023952484 + 0.5756075978279114 + <_> + + <_> + + + + <_>9 12 2 3 -1. + <_>9 13 2 1 3. + 0 + -7.4249948374927044e-003 + 0.7513859272003174 + 0.4728231132030487 + <_> + + <_> + + + + <_>3 12 1 2 -1. + <_>3 13 1 1 2. + 0 + 5.0908129196614027e-004 + 0.5404896736145020 + 0.2932321131229401 + <_> + + <_> + + + + <_>9 11 2 3 -1. + <_>9 12 2 1 3. + 0 + -1.2808450264856219e-003 + 0.6169779896736145 + 0.4273349046707153 + <_> + + <_> + + + + <_>7 3 3 1 -1. + <_>8 3 1 1 3. + 0 + -1.8348860321566463e-003 + 0.2048496007919312 + 0.5206472277641296 + <_> + + <_> + + + + <_>17 7 3 6 -1. + <_>17 9 3 2 3. + 0 + 0.0274848695844412 + 0.5252984762191773 + 0.1675522029399872 + <_> + + <_> + + + + <_>7 2 3 2 -1. + <_>8 2 1 2 3. + 0 + 2.2372419480234385e-003 + 0.5267782807350159 + 0.2777658104896545 + <_> + + <_> + + + + <_>11 4 5 3 -1. + <_>11 5 5 1 3. + 0 + -8.8635291904211044e-003 + 0.6954557895660400 + 0.4812048971652985 + <_> + + <_> + + + + <_>4 4 5 3 -1. + <_>4 5 5 1 3. + 0 + 4.1753971017897129e-003 + 0.4291887879371643 + 0.6349195837974548 + <_> + + <_> + + + + <_>19 3 1 2 -1. + <_>19 4 1 1 2. + 0 + -1.7098189564421773e-003 + 0.2930536866188049 + 0.5361248850822449 + <_> + + <_> + + + + <_>5 5 4 3 -1. + <_>5 6 4 1 3. + 0 + 6.5328548662364483e-003 + 0.4495325088500977 + 0.7409694194793701 + <_> + + <_> + + + + <_>17 7 3 6 -1. + <_>17 9 3 2 3. + 0 + -9.5372907817363739e-003 + 0.3149119913578033 + 0.5416501760482788 + <_> + + <_> + + + + <_>0 7 3 6 -1. + <_>0 9 3 2 3. + 0 + 0.0253109894692898 + 0.5121892094612122 + 0.1311707943677902 + <_> + + <_> + + + + <_>14 2 6 9 -1. + <_>14 5 6 3 3. + 0 + 0.0364609695971012 + 0.5175911784172058 + 0.2591339945793152 + <_> + + <_> + + + + <_>0 4 5 6 -1. + <_>0 6 5 2 3. + 0 + 0.0208543296903372 + 0.5137140154838562 + 0.1582316011190414 + <_> + + <_> + + + + <_>10 5 6 2 -1. + <_>12 5 2 2 3. + 0 + -8.7207747856155038e-004 + 0.5574309825897217 + 0.4398978948593140 + <_> + + <_> + + + + <_>4 5 6 2 -1. + <_>6 5 2 2 3. + 0 + -1.5227000403683633e-005 + 0.5548940896987915 + 0.3708069920539856 + <_> + + <_> + + + + <_>8 1 4 6 -1. + <_>8 3 4 2 3. + 0 + -8.4316509310156107e-004 + 0.3387419879436493 + 0.5554211139678955 + <_> + + <_> + + + + <_>0 2 3 6 -1. + <_>0 4 3 2 3. + 0 + 3.6037859972566366e-003 + 0.5358061790466309 + 0.3411171138286591 + <_> + + <_> + + + + <_>6 6 8 3 -1. + <_>6 7 8 1 3. + 0 + -6.8057891912758350e-003 + 0.6125202775001526 + 0.4345862865447998 + <_> + + <_> + + + + <_>0 1 5 9 -1. + <_>0 4 5 3 3. + 0 + -0.0470216609537601 + 0.2358165979385376 + 0.5193738937377930 + <_> + + <_> + + + + <_>16 0 4 15 -1. + <_>16 0 2 15 2. + 0 + -0.0369541086256504 + 0.7323111295700073 + 0.4760943949222565 + <_> + + <_> + + + + <_>1 10 3 2 -1. + <_>1 11 3 1 2. + 0 + 1.0439479956403375e-003 + 0.5419455170631409 + 0.3411330878734589 + <_> + + <_> + + + + <_>14 4 1 10 -1. + <_>14 9 1 5 2. + 0 + -2.1050689974799752e-004 + 0.2821694016456604 + 0.5554947257041931 + <_> + + <_> + + + + <_>0 1 4 12 -1. + <_>2 1 2 12 2. + 0 + -0.0808315873146057 + 0.9129930138587952 + 0.4697434902191162 + <_> + + <_> + + + + <_>11 11 4 2 -1. + <_>11 11 2 2 2. + 0 + -3.6579059087671340e-004 + 0.6022670269012451 + 0.3978292942047119 + <_> + + <_> + + + + <_>5 11 4 2 -1. + <_>7 11 2 2 2. + 0 + -1.2545920617412776e-004 + 0.5613213181495667 + 0.3845539987087250 + <_> + + <_> + + + + <_>3 8 15 5 -1. + <_>8 8 5 5 3. + 0 + -0.0687864869832993 + 0.2261611968278885 + 0.5300496816635132 + <_> + + <_> + + + + <_>0 0 6 10 -1. + <_>3 0 3 10 2. + 0 + 0.0124157899990678 + 0.4075691998004913 + 0.5828812122344971 + <_> + + <_> + + + + <_>11 4 3 2 -1. + <_>12 4 1 2 3. + 0 + -4.7174817882478237e-003 + 0.2827253937721252 + 0.5267757773399353 + <_> + + <_> + + + + <_>8 12 3 8 -1. + <_>8 16 3 4 2. + 0 + 0.0381368584930897 + 0.5074741244316101 + 0.1023615971207619 + <_> + + <_> + + + + <_>8 14 5 3 -1. + <_>8 15 5 1 3. + 0 + -2.8168049175292253e-003 + 0.6169006824493408 + 0.4359692931175232 + <_> + + <_> + + + + <_>7 14 4 3 -1. + <_>7 15 4 1 3. + 0 + 8.1303603947162628e-003 + 0.4524433016777039 + 0.7606095075607300 + <_> + + <_> + + + + <_>11 4 3 2 -1. + <_>12 4 1 2 3. + 0 + 6.0056019574403763e-003 + 0.5240408778190613 + 0.1859712004661560 + <_> + + <_> + + + + <_>3 15 14 4 -1. + <_>3 15 7 2 2. + <_>10 17 7 2 2. + 0 + 0.0191393196582794 + 0.5209379196166992 + 0.2332071959972382 + <_> + + <_> + + + + <_>2 2 16 4 -1. + <_>10 2 8 2 2. + <_>2 4 8 2 2. + 0 + 0.0164457596838474 + 0.5450702905654907 + 0.3264234960079193 + <_> + + <_> + + + + <_>0 8 6 12 -1. + <_>3 8 3 12 2. + 0 + -0.0373568907380104 + 0.6999046802520752 + 0.4533241987228394 + <_> + + <_> + + + + <_>5 7 10 2 -1. + <_>5 7 5 2 2. + 0 + -0.0197279006242752 + 0.2653664946556091 + 0.5412809848785400 + <_> + + <_> + + + + <_>9 7 2 5 -1. + <_>10 7 1 5 2. + 0 + 6.6972579807043076e-003 + 0.4480566084384918 + 0.7138652205467224 + <_> + + <_> + + + + <_>13 7 6 4 -1. + <_>16 7 3 2 2. + <_>13 9 3 2 2. + 0 + 7.4457528535276651e-004 + 0.4231350123882294 + 0.5471320152282715 + <_> + + <_> + + + + <_>0 13 8 2 -1. + <_>0 14 8 1 2. + 0 + 1.1790640419349074e-003 + 0.5341702103614807 + 0.3130455017089844 + <_> + + <_> + + + + <_>13 7 6 4 -1. + <_>16 7 3 2 2. + <_>13 9 3 2 2. + 0 + 0.0349806100130081 + 0.5118659734725952 + 0.3430530130863190 + <_> + + <_> + + + + <_>1 7 6 4 -1. + <_>1 7 3 2 2. + <_>4 9 3 2 2. + 0 + 5.6859792675822973e-004 + 0.3532187044620514 + 0.5468639731407166 + <_> + + <_> + + + + <_>12 6 1 12 -1. + <_>12 12 1 6 2. + 0 + -0.0113406497985125 + 0.2842353880405426 + 0.5348700881004334 + <_> + + <_> + + + + <_>9 5 2 6 -1. + <_>10 5 1 6 2. + 0 + -6.6228108480572701e-003 + 0.6883640289306641 + 0.4492664933204651 + <_> + + <_> + + + + <_>14 12 2 3 -1. + <_>14 13 2 1 3. + 0 + -8.0160330981016159e-003 + 0.1709893941879273 + 0.5224308967590332 + <_> + + <_> + + + + <_>4 12 2 3 -1. + <_>4 13 2 1 3. + 0 + 1.4206819469109178e-003 + 0.5290846228599548 + 0.2993383109569550 + <_> + + <_> + + + + <_>8 12 4 3 -1. + <_>8 13 4 1 3. + 0 + -2.7801711112260818e-003 + 0.6498854160308838 + 0.4460499882698059 + <_> + + <_> + + + + <_>5 2 2 4 -1. + <_>5 2 1 2 2. + <_>6 4 1 2 2. + 0 + -1.4747589593753219e-003 + 0.3260438144207001 + 0.5388113260269165 + <_> + + <_> + + + + <_>5 5 11 3 -1. + <_>5 6 11 1 3. + 0 + -0.0238303393125534 + 0.7528941035270691 + 0.4801219999790192 + <_> + + <_> + + + + <_>7 6 4 12 -1. + <_>7 12 4 6 2. + 0 + 6.9369790144264698e-003 + 0.5335165858268738 + 0.3261427879333496 + <_> + + <_> + + + + <_>12 13 8 5 -1. + <_>12 13 4 5 2. + 0 + 8.2806255668401718e-003 + 0.4580394029617310 + 0.5737829804420471 + <_> + + <_> + + + + <_>7 6 1 12 -1. + <_>7 12 1 6 2. + 0 + -0.0104395002126694 + 0.2592320144176483 + 0.5233827829360962 + 34.5541114807128910 + 8 + -1 + <_> + + + <_> + + <_> + + + + <_>1 2 6 3 -1. + <_>4 2 3 3 2. + 0 + 7.2006587870419025e-003 + 0.3258886039257050 + 0.6849808096885681 + <_> + + <_> + + + + <_>9 5 6 10 -1. + <_>12 5 3 5 2. + <_>9 10 3 5 2. + 0 + -2.8593589086085558e-003 + 0.5838881134986877 + 0.2537829875946045 + <_> + + <_> + + + + <_>5 5 8 12 -1. + <_>5 5 4 6 2. + <_>9 11 4 6 2. + 0 + 6.8580528022721410e-004 + 0.5708081722259522 + 0.2812424004077911 + <_> + + <_> + + + + <_>0 7 20 6 -1. + <_>0 9 20 2 3. + 0 + 7.9580191522836685e-003 + 0.2501051127910614 + 0.5544260740280151 + <_> + + <_> + + + + <_>4 2 2 2 -1. + <_>4 3 2 1 2. + 0 + -1.2124150525778532e-003 + 0.2385368049144745 + 0.5433350205421448 + <_> + + <_> + + + + <_>4 18 12 2 -1. + <_>8 18 4 2 3. + 0 + 7.9426132142543793e-003 + 0.3955070972442627 + 0.6220757961273193 + <_> + + <_> + + + + <_>7 4 4 16 -1. + <_>7 12 4 8 2. + 0 + 2.4630590341985226e-003 + 0.5639708042144775 + 0.2992357909679413 + <_> + + <_> + + + + <_>7 6 7 8 -1. + <_>7 10 7 4 2. + 0 + -6.0396599583327770e-003 + 0.2186512947082520 + 0.5411676764488220 + <_> + + <_> + + + + <_>6 3 3 1 -1. + <_>7 3 1 1 3. + 0 + -1.2988339876756072e-003 + 0.2350706011056900 + 0.5364584922790527 + <_> + + <_> + + + + <_>11 15 2 4 -1. + <_>11 17 2 2 2. + 0 + 2.2299369447864592e-004 + 0.3804112970829010 + 0.5729606151580811 + <_> + + <_> + + + + <_>3 5 4 8 -1. + <_>3 9 4 4 2. + 0 + 1.4654280385002494e-003 + 0.2510167956352234 + 0.5258268713951111 + <_> + + <_> + + + + <_>7 1 6 12 -1. + <_>7 7 6 6 2. + 0 + -8.1210042117163539e-004 + 0.5992823839187622 + 0.3851158916950226 + <_> + + <_> + + + + <_>4 6 6 2 -1. + <_>6 6 2 2 3. + 0 + -1.3836020370945334e-003 + 0.5681396126747131 + 0.3636586964130402 + <_> + + <_> + + + + <_>16 4 4 6 -1. + <_>16 6 4 2 3. + 0 + -0.0279364492744207 + 0.1491317003965378 + 0.5377560257911682 + <_> + + <_> + + + + <_>3 3 5 2 -1. + <_>3 4 5 1 2. + 0 + -4.6919551095925272e-004 + 0.3692429959774017 + 0.5572484731674194 + <_> + + <_> + + + + <_>9 11 2 3 -1. + <_>9 12 2 1 3. + 0 + -4.9829659983515739e-003 + 0.6758509278297424 + 0.4532504081726074 + <_> + + <_> + + + + <_>2 16 4 2 -1. + <_>2 17 4 1 2. + 0 + 1.8815309740602970e-003 + 0.5368022918701172 + 0.2932539880275726 + <_> + + <_> + + + + <_>7 13 6 6 -1. + <_>10 13 3 3 2. + <_>7 16 3 3 2. + 0 + -0.0190675500780344 + 0.1649377048015595 + 0.5330067276954651 + <_> + + <_> + + + + <_>7 0 3 4 -1. + <_>8 0 1 4 3. + 0 + -4.6906559728085995e-003 + 0.1963925957679749 + 0.5119361877441406 + <_> + + <_> + + + + <_>8 15 4 3 -1. + <_>8 16 4 1 3. + 0 + 5.9777139686048031e-003 + 0.4671171903610230 + 0.7008398175239563 + <_> + + <_> + + + + <_>0 4 4 6 -1. + <_>0 6 4 2 3. + 0 + -0.0333031304180622 + 0.1155416965484619 + 0.5104162096977234 + <_> + + <_> + + + + <_>5 6 12 3 -1. + <_>9 6 4 3 3. + 0 + 0.0907441079616547 + 0.5149660110473633 + 0.1306173056364059 + <_> + + <_> + + + + <_>7 6 6 14 -1. + <_>9 6 2 14 3. + 0 + 9.3555898638442159e-004 + 0.3605481088161469 + 0.5439859032630920 + <_> + + <_> + + + + <_>9 7 3 3 -1. + <_>10 7 1 3 3. + 0 + 0.0149016501381993 + 0.4886212050914764 + 0.7687569856643677 + <_> + + <_> + + + + <_>6 12 2 4 -1. + <_>6 14 2 2 2. + 0 + 6.1594118596985936e-004 + 0.5356813073158264 + 0.3240939080715179 + <_> + + <_> + + + + <_>10 12 7 6 -1. + <_>10 14 7 2 3. + 0 + -0.0506709888577461 + 0.1848621964454651 + 0.5230404138565064 + <_> + + <_> + + + + <_>1 0 15 2 -1. + <_>1 1 15 1 2. + 0 + 6.8665749859064817e-004 + 0.3840579986572266 + 0.5517945885658264 + <_> + + <_> + + + + <_>14 0 6 6 -1. + <_>14 0 3 6 2. + 0 + 8.3712432533502579e-003 + 0.4288564026355743 + 0.6131753921508789 + <_> + + <_> + + + + <_>5 3 3 1 -1. + <_>6 3 1 1 3. + 0 + -1.2953069526702166e-003 + 0.2913674116134644 + 0.5280737876892090 + <_> + + <_> + + + + <_>14 0 6 6 -1. + <_>14 0 3 6 2. + 0 + -0.0419416800141335 + 0.7554799914360046 + 0.4856030941009522 + <_> + + <_> + + + + <_>0 3 20 10 -1. + <_>0 8 20 5 2. + 0 + -0.0235293805599213 + 0.2838279902935028 + 0.5256081223487854 + <_> + + <_> + + + + <_>14 0 6 6 -1. + <_>14 0 3 6 2. + 0 + 0.0408574491739273 + 0.4870935082435608 + 0.6277297139167786 + <_> + + <_> + + + + <_>0 0 6 6 -1. + <_>3 0 3 6 2. + 0 + -0.0254068691283464 + 0.7099707722663879 + 0.4575029015541077 + <_> + + <_> + + + + <_>19 15 1 2 -1. + <_>19 16 1 1 2. + 0 + -4.1415440500713885e-004 + 0.4030886888504028 + 0.5469412207603455 + <_> + + <_> + + + + <_>0 2 4 8 -1. + <_>2 2 2 8 2. + 0 + 0.0218241196125746 + 0.4502024054527283 + 0.6768701076507568 + <_> + + <_> + + + + <_>2 1 18 4 -1. + <_>11 1 9 2 2. + <_>2 3 9 2 2. + 0 + 0.0141140399500728 + 0.5442860722541809 + 0.3791700005531311 + <_> + + <_> + + + + <_>8 12 1 2 -1. + <_>8 13 1 1 2. + 0 + 6.7214590671937913e-005 + 0.4200463891029358 + 0.5873476266860962 + <_> + + <_> + + + + <_>5 2 10 6 -1. + <_>10 2 5 3 2. + <_>5 5 5 3 2. + 0 + -7.9417638480663300e-003 + 0.3792561888694763 + 0.5585265755653381 + <_> + + <_> + + + + <_>9 7 2 4 -1. + <_>10 7 1 4 2. + 0 + -7.2144409641623497e-003 + 0.7253103852272034 + 0.4603548943996429 + <_> + + <_> + + + + <_>9 7 3 3 -1. + <_>10 7 1 3 3. + 0 + 2.5817339774221182e-003 + 0.4693301916122437 + 0.5900238752365112 + <_> + + <_> + + + + <_>4 5 12 8 -1. + <_>8 5 4 8 3. + 0 + 0.1340931951999664 + 0.5149213075637817 + 0.1808844953775406 + <_> + + <_> + + + + <_>15 15 4 3 -1. + <_>15 16 4 1 3. + 0 + 2.2962710354477167e-003 + 0.5399743914604187 + 0.3717867136001587 + <_> + + <_> + + + + <_>8 18 3 1 -1. + <_>9 18 1 1 3. + 0 + -2.1575849968940020e-003 + 0.2408495992422104 + 0.5148863792419434 + <_> + + <_> + + + + <_>9 13 4 3 -1. + <_>9 14 4 1 3. + 0 + -4.9196188338100910e-003 + 0.6573588252067566 + 0.4738740026950836 + <_> + + <_> + + + + <_>7 13 4 3 -1. + <_>7 14 4 1 3. + 0 + 1.6267469618469477e-003 + 0.4192821979522705 + 0.6303114295005798 + <_> + + <_> + + + + <_>19 15 1 2 -1. + <_>19 16 1 1 2. + 0 + 3.3413388882763684e-004 + 0.5540298223495483 + 0.3702101111412048 + <_> + + <_> + + + + <_>0 15 8 4 -1. + <_>0 17 8 2 2. + 0 + -0.0266980808228254 + 0.1710917949676514 + 0.5101410746574402 + <_> + + <_> + + + + <_>9 3 6 4 -1. + <_>11 3 2 4 3. + 0 + -0.0305618792772293 + 0.1904218047857285 + 0.5168793797492981 + <_> + + <_> + + + + <_>8 14 4 3 -1. + <_>8 15 4 1 3. + 0 + 2.8511548880487680e-003 + 0.4447506964206696 + 0.6313853859901428 + <_> + + <_> + + + + <_>3 14 14 6 -1. + <_>3 16 14 2 3. + 0 + -0.0362114794552326 + 0.2490727007389069 + 0.5377349257469177 + <_> + + <_> + + + + <_>6 3 6 6 -1. + <_>6 6 6 3 2. + 0 + -2.4115189444273710e-003 + 0.5381243228912354 + 0.3664236962795258 + <_> + + <_> + + + + <_>5 11 10 6 -1. + <_>5 14 10 3 2. + 0 + -7.7253201743587852e-004 + 0.5530232191085815 + 0.3541550040245056 + <_> + + <_> + + + + <_>3 10 3 4 -1. + <_>4 10 1 4 3. + 0 + 2.9481729143299162e-004 + 0.4132699072360992 + 0.5667243003845215 + <_> + + <_> + + + + <_>13 9 2 2 -1. + <_>13 9 1 2 2. + 0 + -6.2334560789167881e-003 + 0.0987872332334518 + 0.5198668837547302 + <_> + + <_> + + + + <_>5 3 6 4 -1. + <_>7 3 2 4 3. + 0 + -0.0262747295200825 + 0.0911274924874306 + 0.5028107166290283 + <_> + + <_> + + + + <_>9 7 3 3 -1. + <_>10 7 1 3 3. + 0 + 5.3212260827422142e-003 + 0.4726648926734924 + 0.6222720742225647 + <_> + + <_> + + + + <_>2 12 2 3 -1. + <_>2 13 2 1 3. + 0 + -4.1129058226943016e-003 + 0.2157457023859024 + 0.5137804746627808 + <_> + + <_> + + + + <_>9 8 3 12 -1. + <_>9 12 3 4 3. + 0 + 3.2457809429615736e-003 + 0.5410770773887634 + 0.3721776902675629 + <_> + + <_> + + + + <_>3 14 4 6 -1. + <_>3 14 2 3 2. + <_>5 17 2 3 2. + 0 + -0.0163597092032433 + 0.7787874937057495 + 0.4685291945934296 + <_> + + <_> + + + + <_>16 15 2 2 -1. + <_>16 16 2 1 2. + 0 + 3.2166109303943813e-004 + 0.5478987097740173 + 0.4240373969078064 + <_> + + <_> + + + + <_>2 15 2 2 -1. + <_>2 16 2 1 2. + 0 + 6.4452440710738301e-004 + 0.5330560803413391 + 0.3501324951648712 + <_> + + <_> + + + + <_>8 12 4 3 -1. + <_>8 13 4 1 3. + 0 + -7.8909732401371002e-003 + 0.6923521161079407 + 0.4726569056510925 + <_> + + <_> + + + + <_>0 7 20 1 -1. + <_>10 7 10 1 2. + 0 + 0.0483362115919590 + 0.5055900216102600 + 0.0757492035627365 + <_> + + <_> + + + + <_>7 6 8 3 -1. + <_>7 6 4 3 2. + 0 + -7.5178127735853195e-004 + 0.3783741891384125 + 0.5538573861122131 + <_> + + <_> + + + + <_>5 7 8 2 -1. + <_>9 7 4 2 2. + 0 + -2.4953910615295172e-003 + 0.3081651031970978 + 0.5359612107276917 + <_> + + <_> + + + + <_>9 7 3 5 -1. + <_>10 7 1 5 3. + 0 + -2.2385010961443186e-003 + 0.6633958816528320 + 0.4649342894554138 + <_> + + <_> + + + + <_>8 7 3 5 -1. + <_>9 7 1 5 3. + 0 + -1.7988430336117744e-003 + 0.6596844792366028 + 0.4347187876701355 + <_> + + <_> + + + + <_>11 1 3 5 -1. + <_>12 1 1 5 3. + 0 + 8.7860915809869766e-003 + 0.5231832861900330 + 0.2315579950809479 + <_> + + <_> + + + + <_>6 2 3 6 -1. + <_>7 2 1 6 3. + 0 + 3.6715380847454071e-003 + 0.5204250216484070 + 0.2977376878261566 + <_> + + <_> + + + + <_>14 14 6 5 -1. + <_>14 14 3 5 2. + 0 + -0.0353364497423172 + 0.7238878011703491 + 0.4861505031585693 + <_> + + <_> + + + + <_>9 8 2 2 -1. + <_>9 9 2 1 2. + 0 + -6.9189240457490087e-004 + 0.3105022013187408 + 0.5229824781417847 + <_> + + <_> + + + + <_>10 7 1 3 -1. + <_>10 8 1 1 3. + 0 + -3.3946109469980001e-003 + 0.3138968050479889 + 0.5210173726081848 + <_> + + <_> + + + + <_>6 6 2 2 -1. + <_>6 6 1 1 2. + <_>7 7 1 1 2. + 0 + 9.8569283727556467e-004 + 0.4536580145359039 + 0.6585097908973694 + <_> + + <_> + + + + <_>2 11 18 4 -1. + <_>11 11 9 2 2. + <_>2 13 9 2 2. + 0 + -0.0501631014049053 + 0.1804454028606415 + 0.5198916792869568 + <_> + + <_> + + + + <_>6 6 2 2 -1. + <_>6 6 1 1 2. + <_>7 7 1 1 2. + 0 + -2.2367259953171015e-003 + 0.7255702018737793 + 0.4651359021663666 + <_> + + <_> + + + + <_>0 15 20 2 -1. + <_>0 16 20 1 2. + 0 + 7.4326287722215056e-004 + 0.4412921071052551 + 0.5898545980453491 + <_> + + <_> + + + + <_>4 14 2 3 -1. + <_>4 15 2 1 3. + 0 + -9.3485182151198387e-004 + 0.3500052988529205 + 0.5366017818450928 + <_> + + <_> + + + + <_>8 14 4 3 -1. + <_>8 15 4 1 3. + 0 + 0.0174979399889708 + 0.4912194907665253 + 0.8315284848213196 + <_> + + <_> + + + + <_>8 7 2 3 -1. + <_>8 8 2 1 3. + 0 + -1.5200000489130616e-003 + 0.3570275902748108 + 0.5370560288429260 + <_> + + <_> + + + + <_>9 10 2 3 -1. + <_>9 11 2 1 3. + 0 + 7.8003940870985389e-004 + 0.4353772103786469 + 0.5967335104942322 + 39.1072883605957030 + 9 + -1 + <_> + + + <_> + + <_> + + + + <_>5 4 10 4 -1. + <_>5 6 10 2 2. + 0 + -9.9945552647113800e-003 + 0.6162583231925964 + 0.3054533004760742 + <_> + + <_> + + + + <_>9 7 6 4 -1. + <_>12 7 3 2 2. + <_>9 9 3 2 2. + 0 + -1.1085229925811291e-003 + 0.5818294882774353 + 0.3155578076839447 + <_> + + <_> + + + + <_>4 7 3 6 -1. + <_>4 9 3 2 3. + 0 + 1.0364380432292819e-003 + 0.2552052140235901 + 0.5692911744117737 + <_> + + <_> + + + + <_>11 15 4 4 -1. + <_>13 15 2 2 2. + <_>11 17 2 2 2. + 0 + 6.8211311008781195e-004 + 0.3685089945793152 + 0.5934931039810181 + <_> + + <_> + + + + <_>7 8 4 2 -1. + <_>7 9 4 1 2. + 0 + -6.8057340104132891e-004 + 0.2332392036914825 + 0.5474792122840881 + <_> + + <_> + + + + <_>13 1 4 3 -1. + <_>13 1 2 3 2. + 0 + 2.6068789884448051e-004 + 0.3257457017898560 + 0.5667545795440674 + <_> + + <_> + + + + <_>5 15 4 4 -1. + <_>5 15 2 2 2. + <_>7 17 2 2 2. + 0 + 5.1607372006401420e-004 + 0.3744716942310333 + 0.5845472812652588 + <_> + + <_> + + + + <_>9 5 4 7 -1. + <_>9 5 2 7 2. + 0 + 8.5007521556690335e-004 + 0.3420371115207672 + 0.5522807240486145 + <_> + + <_> + + + + <_>5 6 8 3 -1. + <_>9 6 4 3 2. + 0 + -1.8607829697430134e-003 + 0.2804419994354248 + 0.5375424027442932 + <_> + + <_> + + + + <_>9 9 2 2 -1. + <_>9 10 2 1 2. + 0 + -1.5033970121294260e-003 + 0.2579050958156586 + 0.5498952269554138 + <_> + + <_> + + + + <_>7 15 5 3 -1. + <_>7 16 5 1 3. + 0 + 2.3478909861296415e-003 + 0.4175156056880951 + 0.6313710808753967 + <_> + + <_> + + + + <_>11 10 4 3 -1. + <_>11 10 2 3 2. + 0 + -2.8880240279249847e-004 + 0.5865169763565064 + 0.4052666127681732 + <_> + + <_> + + + + <_>6 9 8 10 -1. + <_>6 14 8 5 2. + 0 + 8.9405477046966553e-003 + 0.5211141109466553 + 0.2318654060363770 + <_> + + <_> + + + + <_>10 11 6 2 -1. + <_>10 11 3 2 2. + 0 + -0.0193277392536402 + 0.2753432989120483 + 0.5241525769233704 + <_> + + <_> + + + + <_>4 11 6 2 -1. + <_>7 11 3 2 2. + 0 + -2.0202060113660991e-004 + 0.5722978711128235 + 0.3677195906639099 + <_> + + <_> + + + + <_>11 3 8 1 -1. + <_>11 3 4 1 2. + 0 + 2.1179069299250841e-003 + 0.4466108083724976 + 0.5542430877685547 + <_> + + <_> + + + + <_>6 3 3 2 -1. + <_>7 3 1 2 3. + 0 + -1.7743760254234076e-003 + 0.2813253104686737 + 0.5300959944725037 + <_> + + <_> + + + + <_>14 5 6 5 -1. + <_>14 5 3 5 2. + 0 + 4.2234458960592747e-003 + 0.4399709999561310 + 0.5795428156852722 + <_> + + <_> + + + + <_>7 5 2 12 -1. + <_>7 11 2 6 2. + 0 + -0.0143752200528979 + 0.2981117963790894 + 0.5292059183120728 + <_> + + <_> + + + + <_>8 11 4 3 -1. + <_>8 12 4 1 3. + 0 + -0.0153491804376245 + 0.7705215215682983 + 0.4748171865940094 + <_> + + <_> + + + + <_>4 1 2 3 -1. + <_>5 1 1 3 2. + 0 + 1.5152279956964776e-005 + 0.3718844056129456 + 0.5576897263526917 + <_> + + <_> + + + + <_>18 3 2 6 -1. + <_>18 5 2 2 3. + 0 + -9.1293919831514359e-003 + 0.3615196049213409 + 0.5286766886711121 + <_> + + <_> + + + + <_>0 3 2 6 -1. + <_>0 5 2 2 3. + 0 + 2.2512159775942564e-003 + 0.5364704728126526 + 0.3486298024654388 + <_> + + <_> + + + + <_>9 12 2 3 -1. + <_>9 13 2 1 3. + 0 + -4.9696918576955795e-003 + 0.6927651762962341 + 0.4676836133003235 + <_> + + <_> + + + + <_>7 13 4 3 -1. + <_>7 14 4 1 3. + 0 + -0.0128290103748441 + 0.7712153792381287 + 0.4660735130310059 + <_> + + <_> + + + + <_>18 0 2 6 -1. + <_>18 2 2 2 3. + 0 + -9.3660065904259682e-003 + 0.3374983966350555 + 0.5351287722587585 + <_> + + <_> + + + + <_>0 0 2 6 -1. + <_>0 2 2 2 3. + 0 + 3.2452319283038378e-003 + 0.5325189828872681 + 0.3289610147476196 + <_> + + <_> + + + + <_>8 14 6 3 -1. + <_>8 15 6 1 3. + 0 + -0.0117235602810979 + 0.6837652921676636 + 0.4754300117492676 + <_> + + <_> + + + + <_>7 4 2 4 -1. + <_>8 4 1 4 2. + 0 + 2.9257940695970319e-005 + 0.3572087883949280 + 0.5360502004623413 + <_> + + <_> + + + + <_>8 5 4 6 -1. + <_>8 7 4 2 3. + 0 + -2.2244219508138485e-005 + 0.5541427135467529 + 0.3552064001560211 + <_> + + <_> + + + + <_>6 4 2 2 -1. + <_>7 4 1 2 2. + 0 + 5.0881509669125080e-003 + 0.5070844292640686 + 0.1256462037563324 + <_> + + <_> + + + + <_>3 14 14 4 -1. + <_>10 14 7 2 2. + <_>3 16 7 2 2. + 0 + 0.0274296794086695 + 0.5269560217857361 + 0.1625818014144898 + <_> + + <_> + + + + <_>6 15 6 2 -1. + <_>6 15 3 1 2. + <_>9 16 3 1 2. + 0 + -6.4142867922782898e-003 + 0.7145588994026184 + 0.4584197103977203 + <_> + + <_> + + + + <_>14 15 6 2 -1. + <_>14 16 6 1 2. + 0 + 3.3479959238320589e-003 + 0.5398612022399902 + 0.3494696915149689 + <_> + + <_> + + + + <_>2 12 12 8 -1. + <_>2 16 12 4 2. + 0 + -0.0826354920864105 + 0.2439192980527878 + 0.5160226225852966 + <_> + + <_> + + + + <_>7 7 7 2 -1. + <_>7 8 7 1 2. + 0 + 1.0261740535497665e-003 + 0.3886891901493073 + 0.5767908096313477 + <_> + + <_> + + + + <_>0 2 18 2 -1. + <_>0 3 18 1 2. + 0 + -1.6307090409100056e-003 + 0.3389458060264587 + 0.5347700715065002 + <_> + + <_> + + + + <_>9 6 2 5 -1. + <_>9 6 1 5 2. + 0 + 2.4546680506318808e-003 + 0.4601413905620575 + 0.6387246847152710 + <_> + + <_> + + + + <_>7 5 3 8 -1. + <_>8 5 1 8 3. + 0 + -9.9476519972085953e-004 + 0.5769879221916199 + 0.4120396077632904 + <_> + + <_> + + + + <_>9 6 3 4 -1. + <_>10 6 1 4 3. + 0 + 0.0154091902077198 + 0.4878709018230438 + 0.7089822292327881 + <_> + + <_> + + + + <_>4 13 3 2 -1. + <_>4 14 3 1 2. + 0 + 1.1784400558099151e-003 + 0.5263553261756897 + 0.2895244956016541 + <_> + + <_> + + + + <_>9 4 6 3 -1. + <_>11 4 2 3 3. + 0 + -0.0277019198983908 + 0.1498828977346420 + 0.5219606757164002 + <_> + + <_> + + + + <_>5 4 6 3 -1. + <_>7 4 2 3 3. + 0 + -0.0295053999871016 + 0.0248933192342520 + 0.4999816119670868 + <_> + + <_> + + + + <_>14 11 5 2 -1. + <_>14 12 5 1 2. + 0 + 4.5159430010244250e-004 + 0.5464622974395752 + 0.4029662907123566 + <_> + + <_> + + + + <_>1 2 6 9 -1. + <_>3 2 2 9 3. + 0 + 7.1772639639675617e-003 + 0.4271056950092316 + 0.5866296887397766 + <_> + + <_> + + + + <_>14 6 6 13 -1. + <_>14 6 3 13 2. + 0 + -0.0741820484399796 + 0.6874179244041443 + 0.4919027984142304 + <_> + + <_> + + + + <_>3 6 14 8 -1. + <_>3 6 7 4 2. + <_>10 10 7 4 2. + 0 + -0.0172541607171297 + 0.3370676040649414 + 0.5348739027976990 + <_> + + <_> + + + + <_>16 0 4 11 -1. + <_>16 0 2 11 2. + 0 + 0.0148515598848462 + 0.4626792967319489 + 0.6129904985427856 + <_> + + <_> + + + + <_>3 4 12 12 -1. + <_>3 4 6 6 2. + <_>9 10 6 6 2. + 0 + 0.0100020002573729 + 0.5346122980117798 + 0.3423453867435455 + <_> + + <_> + + + + <_>11 4 5 3 -1. + <_>11 5 5 1 3. + 0 + 2.0138120744377375e-003 + 0.4643830060958862 + 0.5824304223060608 + <_> + + <_> + + + + <_>4 11 4 2 -1. + <_>4 12 4 1 2. + 0 + 1.5135470312088728e-003 + 0.5196396112442017 + 0.2856149971485138 + <_> + + <_> + + + + <_>10 7 2 2 -1. + <_>10 7 1 2 2. + 0 + 3.1381431035697460e-003 + 0.4838162958621979 + 0.5958529710769653 + <_> + + <_> + + + + <_>8 7 2 2 -1. + <_>9 7 1 2 2. + 0 + -5.1450440660119057e-003 + 0.8920302987098694 + 0.4741412103176117 + <_> + + <_> + + + + <_>9 17 3 2 -1. + <_>10 17 1 2 3. + 0 + -4.4736708514392376e-003 + 0.2033942937850952 + 0.5337278842926025 + <_> + + <_> + + + + <_>5 6 3 3 -1. + <_>5 7 3 1 3. + 0 + 1.9628470763564110e-003 + 0.4571633934974670 + 0.6725863218307495 + <_> + + <_> + + + + <_>10 0 3 3 -1. + <_>11 0 1 3 3. + 0 + 5.4260450415313244e-003 + 0.5271108150482178 + 0.2845670878887177 + <_> + + <_> + + + + <_>5 6 6 2 -1. + <_>5 6 3 1 2. + <_>8 7 3 1 2. + 0 + 4.9611460417509079e-004 + 0.4138312935829163 + 0.5718597769737244 + <_> + + <_> + + + + <_>12 16 4 3 -1. + <_>12 17 4 1 3. + 0 + 9.3728788197040558e-003 + 0.5225151181221008 + 0.2804847061634064 + <_> + + <_> + + + + <_>3 12 3 2 -1. + <_>3 13 3 1 2. + 0 + 6.0500897234305739e-004 + 0.5236768722534180 + 0.3314523994922638 + <_> + + <_> + + + + <_>9 12 3 2 -1. + <_>9 13 3 1 2. + 0 + 5.6792551185935736e-004 + 0.4531059861183167 + 0.6276971101760864 + <_> + + <_> + + + + <_>1 11 16 4 -1. + <_>1 11 8 2 2. + <_>9 13 8 2 2. + 0 + 0.0246443394571543 + 0.5130851864814758 + 0.2017143964767456 + <_> + + <_> + + + + <_>12 4 3 3 -1. + <_>12 5 3 1 3. + 0 + -0.0102904504165053 + 0.7786595225334168 + 0.4876641035079956 + <_> + + <_> + + + + <_>4 4 5 3 -1. + <_>4 5 5 1 3. + 0 + 2.0629419013857841e-003 + 0.4288598895072937 + 0.5881264209747315 + <_> + + <_> + + + + <_>12 16 4 3 -1. + <_>12 17 4 1 3. + 0 + -5.0519481301307678e-003 + 0.3523977994918823 + 0.5286008715629578 + <_> + + <_> + + + + <_>5 4 3 3 -1. + <_>5 5 3 1 3. + 0 + -5.7692620903253555e-003 + 0.6841086149215698 + 0.4588094055652618 + <_> + + <_> + + + + <_>9 0 2 2 -1. + <_>9 1 2 1 2. + 0 + -4.5789941214025021e-004 + 0.3565520048141480 + 0.5485978126525879 + <_> + + <_> + + + + <_>8 9 4 2 -1. + <_>8 10 4 1 2. + 0 + -7.5918837683275342e-004 + 0.3368793129920960 + 0.5254197120666504 + <_> + + <_> + + + + <_>8 8 4 3 -1. + <_>8 9 4 1 3. + 0 + -1.7737259622663260e-003 + 0.3422161042690277 + 0.5454015135765076 + <_> + + <_> + + + + <_>0 13 6 3 -1. + <_>2 13 2 3 3. + 0 + -8.5610467940568924e-003 + 0.6533612012863159 + 0.4485856890678406 + <_> + + <_> + + + + <_>16 14 3 2 -1. + <_>16 15 3 1 2. + 0 + 1.7277270089834929e-003 + 0.5307580232620239 + 0.3925352990627289 + <_> + + <_> + + + + <_>1 18 18 2 -1. + <_>7 18 6 2 3. + 0 + -0.0281996093690395 + 0.6857458949089050 + 0.4588584005832672 + <_> + + <_> + + + + <_>16 14 3 2 -1. + <_>16 15 3 1 2. + 0 + -1.7781109781935811e-003 + 0.4037851095199585 + 0.5369856953620911 + <_> + + <_> + + + + <_>1 14 3 2 -1. + <_>1 15 3 1 2. + 0 + 3.3177141449414194e-004 + 0.5399798750877380 + 0.3705750107765198 + <_> + + <_> + + + + <_>7 14 6 3 -1. + <_>7 15 6 1 3. + 0 + 2.6385399978607893e-003 + 0.4665437042713165 + 0.6452730894088745 + <_> + + <_> + + + + <_>5 14 8 3 -1. + <_>5 15 8 1 3. + 0 + -2.1183069329708815e-003 + 0.5914781093597412 + 0.4064677059650421 + <_> + + <_> + + + + <_>10 6 4 14 -1. + <_>10 6 2 14 2. + 0 + -0.0147732896730304 + 0.3642038106918335 + 0.5294762849807739 + <_> + + <_> + + + + <_>6 6 4 14 -1. + <_>8 6 2 14 2. + 0 + -0.0168154407292604 + 0.2664231956005096 + 0.5144972801208496 + <_> + + <_> + + + + <_>13 5 2 3 -1. + <_>13 6 2 1 3. + 0 + -6.3370140269398689e-003 + 0.6779531240463257 + 0.4852097928524017 + <_> + + <_> + + + + <_>7 16 6 1 -1. + <_>9 16 2 1 3. + 0 + -4.4560048991115764e-005 + 0.5613964796066284 + 0.4153054058551788 + <_> + + <_> + + + + <_>9 12 3 3 -1. + <_>9 13 3 1 3. + 0 + -1.0240620467811823e-003 + 0.5964478254318237 + 0.4566304087638855 + <_> + + <_> + + + + <_>7 0 3 3 -1. + <_>8 0 1 3 3. + 0 + -2.3161689750850201e-003 + 0.2976115047931671 + 0.5188159942626953 + <_> + + <_> + + + + <_>4 0 16 18 -1. + <_>4 9 16 9 2. + 0 + 0.5321757197380066 + 0.5187839269638062 + 0.2202631980180740 + <_> + + <_> + + + + <_>1 1 16 14 -1. + <_>1 8 16 7 2. + 0 + -0.1664305031299591 + 0.1866022944450378 + 0.5060343146324158 + <_> + + <_> + + + + <_>3 9 15 4 -1. + <_>8 9 5 4 3. + 0 + 0.1125352978706360 + 0.5212125182151794 + 0.1185022965073586 + <_> + + <_> + + + + <_>6 12 7 3 -1. + <_>6 13 7 1 3. + 0 + 9.3046864494681358e-003 + 0.4589937031269074 + 0.6826149225234985 + <_> + + <_> + + + + <_>14 15 2 3 -1. + <_>14 16 2 1 3. + 0 + -4.6255099587142467e-003 + 0.3079940974712372 + 0.5225008726119995 + <_> + + <_> + + + + <_>2 3 16 14 -1. + <_>2 3 8 7 2. + <_>10 10 8 7 2. + 0 + -0.1111646965146065 + 0.2101044058799744 + 0.5080801844596863 + <_> + + <_> + + + + <_>16 2 4 18 -1. + <_>18 2 2 9 2. + <_>16 11 2 9 2. + 0 + -0.0108884396031499 + 0.5765355229377747 + 0.4790464043617249 + <_> + + <_> + + + + <_>4 15 2 3 -1. + <_>4 16 2 1 3. + 0 + 5.8564301580190659e-003 + 0.5065100193023682 + 0.1563598960638046 + <_> + + <_> + + + + <_>16 2 4 18 -1. + <_>18 2 2 9 2. + <_>16 11 2 9 2. + 0 + 0.0548543892800808 + 0.4966914951801300 + 0.7230510711669922 + <_> + + <_> + + + + <_>1 1 8 3 -1. + <_>1 2 8 1 3. + 0 + -0.0111973397433758 + 0.2194979041814804 + 0.5098798274993897 + <_> + + <_> + + + + <_>8 11 4 3 -1. + <_>8 12 4 1 3. + 0 + 4.4069071300327778e-003 + 0.4778401851654053 + 0.6770902872085571 + <_> + + <_> + + + + <_>5 11 5 9 -1. + <_>5 14 5 3 3. + 0 + -0.0636652931571007 + 0.1936362981796265 + 0.5081024169921875 + <_> + + <_> + + + + <_>16 0 4 11 -1. + <_>16 0 2 11 2. + 0 + -9.8081491887569427e-003 + 0.5999063253402710 + 0.4810341000556946 + <_> + + <_> + + + + <_>7 0 6 1 -1. + <_>9 0 2 1 3. + 0 + -2.1717099007219076e-003 + 0.3338333964347839 + 0.5235472917556763 + <_> + + <_> + + + + <_>16 3 3 7 -1. + <_>17 3 1 7 3. + 0 + -0.0133155202493072 + 0.6617069840431213 + 0.4919213056564331 + <_> + + <_> + + + + <_>1 3 3 7 -1. + <_>2 3 1 7 3. + 0 + 2.5442079640924931e-003 + 0.4488744139671326 + 0.6082184910774231 + <_> + + <_> + + + + <_>7 8 6 12 -1. + <_>7 12 6 4 3. + 0 + 0.0120378397405148 + 0.5409392118453980 + 0.3292432129383087 + <_> + + <_> + + + + <_>0 0 4 11 -1. + <_>2 0 2 11 2. + 0 + -0.0207010507583618 + 0.6819120049476624 + 0.4594995975494385 + <_> + + <_> + + + + <_>14 0 6 20 -1. + <_>14 0 3 20 2. + 0 + 0.0276082791388035 + 0.4630792140960693 + 0.5767282843589783 + <_> + + <_> + + + + <_>0 3 1 2 -1. + <_>0 4 1 1 2. + 0 + 1.2370620388537645e-003 + 0.5165379047393799 + 0.2635016143321991 + <_> + + <_> + + + + <_>5 5 10 8 -1. + <_>10 5 5 4 2. + <_>5 9 5 4 2. + 0 + -0.0376693382859230 + 0.2536393105983734 + 0.5278980135917664 + <_> + + <_> + + + + <_>4 7 12 4 -1. + <_>4 7 6 2 2. + <_>10 9 6 2 2. + 0 + -1.8057259730994701e-003 + 0.3985156118869782 + 0.5517500042915344 + 50.6104812622070310 + 10 + -1 + <_> + + + <_> + + <_> + + + + <_>2 1 6 4 -1. + <_>5 1 3 4 2. + 0 + 4.4299028813838959e-003 + 0.2891018092632294 + 0.6335226297378540 + <_> + + <_> + + + + <_>9 7 6 4 -1. + <_>12 7 3 2 2. + <_>9 9 3 2 2. + 0 + -2.3813319858163595e-003 + 0.6211789250373840 + 0.3477487862110138 + <_> + + <_> + + + + <_>5 6 2 6 -1. + <_>5 9 2 3 2. + 0 + 2.2915711160749197e-003 + 0.2254412025213242 + 0.5582118034362793 + <_> + + <_> + + + + <_>9 16 6 4 -1. + <_>12 16 3 2 2. + <_>9 18 3 2 2. + 0 + 9.9457940086722374e-004 + 0.3711710870265961 + 0.5930070877075195 + <_> + + <_> + + + + <_>9 4 2 12 -1. + <_>9 10 2 6 2. + 0 + 7.7164667891338468e-004 + 0.5651720166206360 + 0.3347995877265930 + <_> + + <_> + + + + <_>7 1 6 18 -1. + <_>9 1 2 18 3. + 0 + -1.1386410333216190e-003 + 0.3069126009941101 + 0.5508630871772766 + <_> + + <_> + + + + <_>4 12 12 2 -1. + <_>8 12 4 2 3. + 0 + -1.6403039626311511e-004 + 0.5762827992439270 + 0.3699047863483429 + <_> + + <_> + + + + <_>8 8 6 2 -1. + <_>8 9 6 1 2. + 0 + 2.9793529392918572e-005 + 0.2644244134426117 + 0.5437911152839661 + <_> + + <_> + + + + <_>8 0 3 6 -1. + <_>9 0 1 6 3. + 0 + 8.5774902254343033e-003 + 0.5051138997077942 + 0.1795724928379059 + <_> + + <_> + + + + <_>11 18 3 2 -1. + <_>11 19 3 1 2. + 0 + -2.6032689493149519e-004 + 0.5826969146728516 + 0.4446826875209808 + <_> + + <_> + + + + <_>1 1 17 4 -1. + <_>1 3 17 2 2. + 0 + -6.1404630541801453e-003 + 0.3113852143287659 + 0.5346971750259399 + <_> + + <_> + + + + <_>11 8 4 12 -1. + <_>11 8 2 12 2. + 0 + -0.0230869501829147 + 0.3277946114540100 + 0.5331197977066040 + <_> + + <_> + + + + <_>8 14 4 3 -1. + <_>8 15 4 1 3. + 0 + -0.0142436502501369 + 0.7381709814071655 + 0.4588063061237335 + <_> + + <_> + + + + <_>12 3 2 17 -1. + <_>12 3 1 17 2. + 0 + 0.0194871295243502 + 0.5256630778312683 + 0.2274471968412399 + <_> + + <_> + + + + <_>4 7 6 1 -1. + <_>6 7 2 1 3. + 0 + -9.6681108698248863e-004 + 0.5511230826377869 + 0.3815006911754608 + <_> + + <_> + + + + <_>18 3 2 3 -1. + <_>18 4 2 1 3. + 0 + 3.1474709976464510e-003 + 0.5425636768341065 + 0.2543726861476898 + <_> + + <_> + + + + <_>8 4 3 4 -1. + <_>8 6 3 2 2. + 0 + -1.8026070029009134e-004 + 0.5380191802978516 + 0.3406304121017456 + <_> + + <_> + + + + <_>4 5 12 10 -1. + <_>4 10 12 5 2. + 0 + -6.0266260989010334e-003 + 0.3035801947116852 + 0.5420572161674500 + <_> + + <_> + + + + <_>5 18 4 2 -1. + <_>7 18 2 2 2. + 0 + 4.4462960795499384e-004 + 0.3990997076034546 + 0.5660110116004944 + <_> + + <_> + + + + <_>17 2 3 6 -1. + <_>17 4 3 2 3. + 0 + 2.2609760053455830e-003 + 0.5562806725502014 + 0.3940688073635101 + <_> + + <_> + + + + <_>7 7 6 6 -1. + <_>9 7 2 6 3. + 0 + 0.0511330589652061 + 0.4609653949737549 + 0.7118561863899231 + <_> + + <_> + + + + <_>17 2 3 6 -1. + <_>17 4 3 2 3. + 0 + -0.0177863091230392 + 0.2316166013479233 + 0.5322144031524658 + <_> + + <_> + + + + <_>8 0 3 4 -1. + <_>9 0 1 4 3. + 0 + -4.9679628573358059e-003 + 0.2330771982669830 + 0.5122029185295105 + <_> + + <_> + + + + <_>9 14 2 3 -1. + <_>9 15 2 1 3. + 0 + 2.0667689386755228e-003 + 0.4657444059848785 + 0.6455488204956055 + <_> + + <_> + + + + <_>0 12 6 3 -1. + <_>0 13 6 1 3. + 0 + 7.4413768015801907e-003 + 0.5154392123222351 + 0.2361633926630020 + <_> + + <_> + + + + <_>8 14 4 3 -1. + <_>8 15 4 1 3. + 0 + -3.6277279723435640e-003 + 0.6219773292541504 + 0.4476661086082459 + <_> + + <_> + + + + <_>3 12 2 3 -1. + <_>3 13 2 1 3. + 0 + -5.3530759178102016e-003 + 0.1837355047464371 + 0.5102208256721497 + <_> + + <_> + + + + <_>5 6 12 7 -1. + <_>9 6 4 7 3. + 0 + 0.1453091949224472 + 0.5145987272262573 + 0.1535930931568146 + <_> + + <_> + + + + <_>0 2 3 6 -1. + <_>0 4 3 2 3. + 0 + 2.4394490756094456e-003 + 0.5343660116195679 + 0.3624661862850189 + <_> + + <_> + + + + <_>14 6 1 3 -1. + <_>14 7 1 1 3. + 0 + -3.1283390708267689e-003 + 0.6215007901191711 + 0.4845592081546783 + <_> + + <_> + + + + <_>2 0 3 14 -1. + <_>3 0 1 14 3. + 0 + 1.7940260004252195e-003 + 0.4299261868000031 + 0.5824198126792908 + <_> + + <_> + + + + <_>12 14 5 6 -1. + <_>12 16 5 2 3. + 0 + 0.0362538211047649 + 0.5260334014892578 + 0.1439467966556549 + <_> + + <_> + + + + <_>4 14 5 6 -1. + <_>4 16 5 2 3. + 0 + -5.1746722310781479e-003 + 0.3506538867950440 + 0.5287045240402222 + <_> + + <_> + + + + <_>11 10 2 2 -1. + <_>12 10 1 1 2. + <_>11 11 1 1 2. + 0 + 6.5383297624066472e-004 + 0.4809640944004059 + 0.6122040152549744 + <_> + + <_> + + + + <_>5 0 3 14 -1. + <_>6 0 1 14 3. + 0 + -0.0264802295714617 + 0.1139362007379532 + 0.5045586228370667 + <_> + + <_> + + + + <_>10 15 2 3 -1. + <_>10 16 2 1 3. + 0 + -3.0440660193562508e-003 + 0.6352095007896423 + 0.4794734120368958 + <_> + + <_> + + + + <_>0 2 2 3 -1. + <_>0 3 2 1 3. + 0 + 3.6993520334362984e-003 + 0.5131118297576904 + 0.2498510926961899 + <_> + + <_> + + + + <_>5 11 12 6 -1. + <_>5 14 12 3 2. + 0 + -3.6762931267730892e-004 + 0.5421394705772400 + 0.3709532022476196 + <_> + + <_> + + + + <_>6 11 3 9 -1. + <_>6 14 3 3 3. + 0 + -0.0413822606205940 + 0.1894959956407547 + 0.5081691741943359 + <_> + + <_> + + + + <_>11 10 2 2 -1. + <_>12 10 1 1 2. + <_>11 11 1 1 2. + 0 + -1.0532729793339968e-003 + 0.6454367041587830 + 0.4783608913421631 + <_> + + <_> + + + + <_>5 6 1 3 -1. + <_>5 7 1 1 3. + 0 + -2.1648600231856108e-003 + 0.6215031147003174 + 0.4499826133251190 + <_> + + <_> + + + + <_>4 9 13 3 -1. + <_>4 10 13 1 3. + 0 + -5.6747748749330640e-004 + 0.3712610900402069 + 0.5419334769248962 + <_> + + <_> + + + + <_>1 7 15 6 -1. + <_>6 7 5 6 3. + 0 + 0.1737584024667740 + 0.5023643970489502 + 0.1215742006897926 + <_> + + <_> + + + + <_>4 5 12 6 -1. + <_>8 5 4 6 3. + 0 + -2.9049699660390615e-003 + 0.3240267932415009 + 0.5381883978843689 + <_> + + <_> + + + + <_>8 10 4 3 -1. + <_>8 11 4 1 3. + 0 + 1.2299539521336555e-003 + 0.4165507853031158 + 0.5703486204147339 + <_> + + <_> + + + + <_>15 14 1 3 -1. + <_>15 15 1 1 3. + 0 + -5.4329237900674343e-004 + 0.3854042887687683 + 0.5547549128532410 + <_> + + <_> + + + + <_>1 11 5 3 -1. + <_>1 12 5 1 3. + 0 + -8.3297258242964745e-003 + 0.2204494029283524 + 0.5097082853317261 + <_> + + <_> + + + + <_>7 1 7 12 -1. + <_>7 7 7 6 2. + 0 + -1.0417630255687982e-004 + 0.5607066154479981 + 0.4303036034107208 + <_> + + <_> + + + + <_>0 1 6 10 -1. + <_>0 1 3 5 2. + <_>3 6 3 5 2. + 0 + 0.0312047004699707 + 0.4621657133102417 + 0.6982004046440125 + <_> + + <_> + + + + <_>16 1 4 3 -1. + <_>16 2 4 1 3. + 0 + 7.8943502157926559e-003 + 0.5269594192504883 + 0.2269068062305450 + <_> + + <_> + + + + <_>5 5 2 3 -1. + <_>5 6 2 1 3. + 0 + -4.3645310215651989e-003 + 0.6359223127365112 + 0.4537956118583679 + <_> + + <_> + + + + <_>12 2 3 5 -1. + <_>13 2 1 5 3. + 0 + 7.6793059706687927e-003 + 0.5274767875671387 + 0.2740483880043030 + <_> + + <_> + + + + <_>0 3 4 6 -1. + <_>0 5 4 2 3. + 0 + -0.0254311393946409 + 0.2038519978523254 + 0.5071732997894287 + <_> + + <_> + + + + <_>8 12 4 2 -1. + <_>8 13 4 1 2. + 0 + 8.2000601105391979e-004 + 0.4587455093860626 + 0.6119868159294128 + <_> + + <_> + + + + <_>8 18 3 1 -1. + <_>9 18 1 1 3. + 0 + 2.9284600168466568e-003 + 0.5071274042129517 + 0.2028204947710037 + <_> + + <_> + + + + <_>11 10 2 2 -1. + <_>12 10 1 1 2. + <_>11 11 1 1 2. + 0 + 4.5256470912136137e-005 + 0.4812104105949402 + 0.5430821776390076 + <_> + + <_> + + + + <_>7 10 2 2 -1. + <_>7 10 1 1 2. + <_>8 11 1 1 2. + 0 + 1.3158309739083052e-003 + 0.4625813961029053 + 0.6779323220252991 + <_> + + <_> + + + + <_>11 11 4 4 -1. + <_>11 13 4 2 2. + 0 + 1.5870389761403203e-003 + 0.5386291742324829 + 0.3431465029716492 + <_> + + <_> + + + + <_>8 12 3 8 -1. + <_>9 12 1 8 3. + 0 + -0.0215396601706743 + 0.0259425006806850 + 0.5003222823143005 + <_> + + <_> + + + + <_>13 0 6 3 -1. + <_>13 1 6 1 3. + 0 + 0.0143344802781940 + 0.5202844738960266 + 0.1590632945299149 + <_> + + <_> + + + + <_>8 8 3 4 -1. + <_>9 8 1 4 3. + 0 + -8.3881383761763573e-003 + 0.7282481193542481 + 0.4648044109344482 + <_> + + <_> + + + + <_>5 7 10 10 -1. + <_>10 7 5 5 2. + <_>5 12 5 5 2. + 0 + 9.1906841844320297e-003 + 0.5562356710433960 + 0.3923191130161285 + <_> + + <_> + + + + <_>3 18 8 2 -1. + <_>3 18 4 1 2. + <_>7 19 4 1 2. + 0 + -5.8453059755265713e-003 + 0.6803392767906189 + 0.4629127979278565 + <_> + + <_> + + + + <_>10 2 6 8 -1. + <_>12 2 2 8 3. + 0 + -0.0547077991068363 + 0.2561671137809753 + 0.5206125974655151 + <_> + + <_> + + + + <_>4 2 6 8 -1. + <_>6 2 2 8 3. + 0 + 9.1142775490880013e-003 + 0.5189620256423950 + 0.3053877055644989 + <_> + + <_> + + + + <_>11 0 3 7 -1. + <_>12 0 1 7 3. + 0 + -0.0155750000849366 + 0.1295074969530106 + 0.5169094800949097 + <_> + + <_> + + + + <_>7 11 2 1 -1. + <_>8 11 1 1 2. + 0 + -1.2050600344082341e-004 + 0.5735098123550415 + 0.4230825006961823 + <_> + + <_> + + + + <_>15 14 1 3 -1. + <_>15 15 1 1 3. + 0 + 1.2273970060050488e-003 + 0.5289878249168396 + 0.4079791903495789 + <_> + + <_> + + + + <_>7 15 2 2 -1. + <_>7 15 1 1 2. + <_>8 16 1 1 2. + 0 + -1.2186600361019373e-003 + 0.6575639843940735 + 0.4574409127235413 + <_> + + <_> + + + + <_>15 14 1 3 -1. + <_>15 15 1 1 3. + 0 + -3.3256649039685726e-003 + 0.3628047108650208 + 0.5195019841194153 + <_> + + <_> + + + + <_>6 0 3 7 -1. + <_>7 0 1 7 3. + 0 + -0.0132883097976446 + 0.1284265965223312 + 0.5043488740921021 + <_> + + <_> + + + + <_>18 1 2 7 -1. + <_>18 1 1 7 2. + 0 + -3.3839771058410406e-003 + 0.6292240023612976 + 0.4757505953311920 + <_> + + <_> + + + + <_>2 0 8 20 -1. + <_>2 10 8 10 2. + 0 + -0.2195422053337097 + 0.1487731933593750 + 0.5065013766288757 + <_> + + <_> + + + + <_>3 0 15 6 -1. + <_>3 2 15 2 3. + 0 + 4.9111708067357540e-003 + 0.4256102144718170 + 0.5665838718414307 + <_> + + <_> + + + + <_>4 3 12 2 -1. + <_>4 4 12 1 2. + 0 + -1.8744950648397207e-004 + 0.4004144072532654 + 0.5586857199668884 + <_> + + <_> + + + + <_>16 0 4 5 -1. + <_>16 0 2 5 2. + 0 + -5.2178641781210899e-003 + 0.6009116172790527 + 0.4812706112861633 + <_> + + <_> + + + + <_>7 0 3 4 -1. + <_>8 0 1 4 3. + 0 + -1.1111519997939467e-003 + 0.3514933884143829 + 0.5287089943885803 + <_> + + <_> + + + + <_>16 0 4 5 -1. + <_>16 0 2 5 2. + 0 + 4.4036400504410267e-003 + 0.4642275869846344 + 0.5924085974693298 + <_> + + <_> + + + + <_>1 7 6 13 -1. + <_>3 7 2 13 3. + 0 + 0.1229949966073036 + 0.5025529265403748 + 0.0691524818539619 + <_> + + <_> + + + + <_>16 0 4 5 -1. + <_>16 0 2 5 2. + 0 + -0.0123135102912784 + 0.5884591937065125 + 0.4934012889862061 + <_> + + <_> + + + + <_>0 0 4 5 -1. + <_>2 0 2 5 2. + 0 + 4.1471039876341820e-003 + 0.4372239112854004 + 0.5893477797508240 + <_> + + <_> + + + + <_>14 12 3 6 -1. + <_>14 14 3 2 3. + 0 + -3.5502649843692780e-003 + 0.4327551126480103 + 0.5396270155906677 + <_> + + <_> + + + + <_>3 12 3 6 -1. + <_>3 14 3 2 3. + 0 + -0.0192242693156004 + 0.1913134008646011 + 0.5068330764770508 + <_> + + <_> + + + + <_>16 1 4 3 -1. + <_>16 2 4 1 3. + 0 + 1.4395059552043676e-003 + 0.5308178067207336 + 0.4243533015251160 + <_> + + <_> + + + + <_>8 7 2 10 -1. + <_>8 7 1 5 2. + <_>9 12 1 5 2. + 0 + -6.7751999013125896e-003 + 0.6365395784378052 + 0.4540086090564728 + <_> + + <_> + + + + <_>11 11 4 4 -1. + <_>11 13 4 2 2. + 0 + 7.0119630545377731e-003 + 0.5189834237098694 + 0.3026199936866760 + <_> + + <_> + + + + <_>0 1 4 3 -1. + <_>0 2 4 1 3. + 0 + 5.4014651104807854e-003 + 0.5105062127113342 + 0.2557682991027832 + <_> + + <_> + + + + <_>13 4 1 3 -1. + <_>13 5 1 1 3. + 0 + 9.0274988906458020e-004 + 0.4696914851665497 + 0.5861827731132507 + <_> + + <_> + + + + <_>7 15 3 5 -1. + <_>8 15 1 5 3. + 0 + 0.0114744501188397 + 0.5053645968437195 + 0.1527177989482880 + <_> + + <_> + + + + <_>9 7 3 5 -1. + <_>10 7 1 5 3. + 0 + -6.7023430019617081e-003 + 0.6508980989456177 + 0.4890604019165039 + <_> + + <_> + + + + <_>8 7 3 5 -1. + <_>9 7 1 5 3. + 0 + -2.0462959073483944e-003 + 0.6241816878318787 + 0.4514600038528442 + <_> + + <_> + + + + <_>10 6 4 14 -1. + <_>10 6 2 14 2. + 0 + -9.9951568990945816e-003 + 0.3432781100273132 + 0.5400953888893127 + <_> + + <_> + + + + <_>0 5 5 6 -1. + <_>0 7 5 2 3. + 0 + -0.0357007086277008 + 0.1878059059381485 + 0.5074077844619751 + <_> + + <_> + + + + <_>9 5 6 4 -1. + <_>9 5 3 4 2. + 0 + 4.5584561303257942e-004 + 0.3805277049541473 + 0.5402569770812988 + <_> + + <_> + + + + <_>0 0 18 10 -1. + <_>6 0 6 10 3. + 0 + -0.0542606003582478 + 0.6843714714050293 + 0.4595097005367279 + <_> + + <_> + + + + <_>10 6 4 14 -1. + <_>10 6 2 14 2. + 0 + 6.0600461438298225e-003 + 0.5502905249595642 + 0.4500527977943420 + <_> + + <_> + + + + <_>6 6 4 14 -1. + <_>8 6 2 14 2. + 0 + -6.4791832119226456e-003 + 0.3368858098983765 + 0.5310757160186768 + <_> + + <_> + + + + <_>13 4 1 3 -1. + <_>13 5 1 1 3. + 0 + -1.4939469983801246e-003 + 0.6487640142440796 + 0.4756175875663757 + <_> + + <_> + + + + <_>5 1 2 3 -1. + <_>6 1 1 3 2. + 0 + 1.4610530342906713e-005 + 0.4034579098224640 + 0.5451064109802246 + <_> + + <_> + + + + <_>18 1 2 18 -1. + <_>19 1 1 9 2. + <_>18 10 1 9 2. + 0 + -7.2321938350796700e-003 + 0.6386873722076416 + 0.4824739992618561 + <_> + + <_> + + + + <_>2 1 4 3 -1. + <_>2 2 4 1 3. + 0 + -4.0645818226039410e-003 + 0.2986421883106232 + 0.5157335996627808 + <_> + + <_> + + + + <_>18 1 2 18 -1. + <_>19 1 1 9 2. + <_>18 10 1 9 2. + 0 + 0.0304630808532238 + 0.5022199749946594 + 0.7159956097602844 + <_> + + <_> + + + + <_>1 14 4 6 -1. + <_>1 14 2 3 2. + <_>3 17 2 3 2. + 0 + -8.0544911324977875e-003 + 0.6492452025413513 + 0.4619275033473969 + <_> + + <_> + + + + <_>10 11 7 6 -1. + <_>10 13 7 2 3. + 0 + 0.0395051389932632 + 0.5150570869445801 + 0.2450613975524902 + <_> + + <_> + + + + <_>0 10 6 10 -1. + <_>0 10 3 5 2. + <_>3 15 3 5 2. + 0 + 8.4530208259820938e-003 + 0.4573669135570526 + 0.6394037008285523 + <_> + + <_> + + + + <_>11 0 3 4 -1. + <_>12 0 1 4 3. + 0 + -1.1688120430335402e-003 + 0.3865512013435364 + 0.5483661293983460 + <_> + + <_> + + + + <_>5 10 5 6 -1. + <_>5 13 5 3 2. + 0 + 2.8070670086890459e-003 + 0.5128579139709473 + 0.2701480090618134 + <_> + + <_> + + + + <_>14 6 1 8 -1. + <_>14 10 1 4 2. + 0 + 4.7365209320560098e-004 + 0.4051581919193268 + 0.5387461185455322 + <_> + + <_> + + + + <_>1 7 18 6 -1. + <_>1 7 9 3 2. + <_>10 10 9 3 2. + 0 + 0.0117410803213716 + 0.5295950174331665 + 0.3719413876533508 + <_> + + <_> + + + + <_>9 7 2 2 -1. + <_>9 7 1 2 2. + 0 + 3.1833238899707794e-003 + 0.4789406955242157 + 0.6895126104354858 + <_> + + <_> + + + + <_>5 9 4 5 -1. + <_>7 9 2 5 2. + 0 + 7.0241501089185476e-004 + 0.5384489297866821 + 0.3918080925941467 + 54.6200714111328130 + 11 + -1 + <_> + + + <_> + + <_> + + + + <_>7 6 6 3 -1. + <_>9 6 2 3 3. + 0 + 0.0170599296689034 + 0.3948527872562408 + 0.7142534852027893 + <_> + + <_> + + + + <_>1 0 18 4 -1. + <_>7 0 6 4 3. + 0 + 0.0218408405780792 + 0.3370316028594971 + 0.6090016961097717 + <_> + + <_> + + + + <_>7 15 2 4 -1. + <_>7 17 2 2 2. + 0 + 2.4520049919374287e-004 + 0.3500576019287109 + 0.5987902283668518 + <_> + + <_> + + + + <_>1 0 19 9 -1. + <_>1 3 19 3 3. + 0 + 8.3272606134414673e-003 + 0.3267528116703033 + 0.5697240829467773 + <_> + + <_> + + + + <_>3 7 3 6 -1. + <_>3 9 3 2 3. + 0 + 5.7148298947140574e-004 + 0.3044599890708923 + 0.5531656742095947 + <_> + + <_> + + + + <_>13 7 4 4 -1. + <_>15 7 2 2 2. + <_>13 9 2 2 2. + 0 + 6.7373987985774875e-004 + 0.3650012016296387 + 0.5672631263732910 + <_> + + <_> + + + + <_>3 7 4 4 -1. + <_>3 7 2 2 2. + <_>5 9 2 2 2. + 0 + 3.4681590477703139e-005 + 0.3313541114330292 + 0.5388727188110352 + <_> + + <_> + + + + <_>9 6 10 8 -1. + <_>9 10 10 4 2. + 0 + -5.8563398197293282e-003 + 0.2697942852973938 + 0.5498778820037842 + <_> + + <_> + + + + <_>3 8 14 12 -1. + <_>3 14 14 6 2. + 0 + 8.5102273151278496e-003 + 0.5269358158111572 + 0.2762879133224487 + <_> + + <_> + + + + <_>6 5 10 12 -1. + <_>11 5 5 6 2. + <_>6 11 5 6 2. + 0 + -0.0698172077536583 + 0.2909603118896484 + 0.5259246826171875 + <_> + + <_> + + + + <_>9 11 2 3 -1. + <_>9 12 2 1 3. + 0 + -8.6113670840859413e-004 + 0.5892577171325684 + 0.4073697924613953 + <_> + + <_> + + + + <_>9 5 6 5 -1. + <_>9 5 3 5 2. + 0 + 9.7149249631911516e-004 + 0.3523564040660858 + 0.5415862202644348 + <_> + + <_> + + + + <_>9 4 2 4 -1. + <_>9 6 2 2 2. + 0 + -1.4727490452060010e-005 + 0.5423017740249634 + 0.3503156006336212 + <_> + + <_> + + + + <_>9 5 6 5 -1. + <_>9 5 3 5 2. + 0 + 0.0484202913939953 + 0.5193945765495300 + 0.3411195874214172 + <_> + + <_> + + + + <_>5 5 6 5 -1. + <_>8 5 3 5 2. + 0 + 1.3257140526548028e-003 + 0.3157769143581390 + 0.5335376262664795 + <_> + + <_> + + + + <_>11 2 6 1 -1. + <_>13 2 2 1 3. + 0 + 1.4922149603080470e-005 + 0.4451299905776978 + 0.5536553859710693 + <_> + + <_> + + + + <_>3 2 6 1 -1. + <_>5 2 2 1 3. + 0 + -2.7173398993909359e-003 + 0.3031741976737976 + 0.5248088836669922 + <_> + + <_> + + + + <_>13 5 2 3 -1. + <_>13 6 2 1 3. + 0 + 2.9219500720500946e-003 + 0.4781453013420105 + 0.6606041789054871 + <_> + + <_> + + + + <_>0 10 1 4 -1. + <_>0 12 1 2 2. + 0 + -1.9804988987743855e-003 + 0.3186308145523071 + 0.5287625193595886 + <_> + + <_> + + + + <_>13 5 2 3 -1. + <_>13 6 2 1 3. + 0 + -4.0012109093368053e-003 + 0.6413596868515015 + 0.4749928116798401 + <_> + + <_> + + + + <_>8 18 3 2 -1. + <_>9 18 1 2 3. + 0 + -4.3491991236805916e-003 + 0.1507498025894165 + 0.5098996758460999 + <_> + + <_> + + + + <_>6 15 9 2 -1. + <_>6 16 9 1 2. + 0 + 1.3490889687091112e-003 + 0.4316158890724182 + 0.5881167054176331 + <_> + + <_> + + + + <_>8 14 4 3 -1. + <_>8 15 4 1 3. + 0 + 0.0185970701277256 + 0.4735553860664368 + 0.9089794158935547 + <_> + + <_> + + + + <_>18 4 2 4 -1. + <_>18 6 2 2 2. + 0 + -1.8562379991635680e-003 + 0.3553189039230347 + 0.5577837228775024 + <_> + + <_> + + + + <_>5 5 2 3 -1. + <_>5 6 2 1 3. + 0 + 2.2940430790185928e-003 + 0.4500094950199127 + 0.6580877900123596 + <_> + + <_> + + + + <_>15 16 3 2 -1. + <_>15 17 3 1 2. + 0 + 2.9982850537635386e-004 + 0.5629242062568665 + 0.3975878953933716 + <_> + + <_> + + + + <_>0 0 3 9 -1. + <_>0 3 3 3 3. + 0 + 3.5455459728837013e-003 + 0.5381547212600708 + 0.3605485856533051 + <_> + + <_> + + + + <_>9 7 3 3 -1. + <_>9 8 3 1 3. + 0 + 9.6104722470045090e-003 + 0.5255997180938721 + 0.1796745955944061 + <_> + + <_> + + + + <_>8 7 3 3 -1. + <_>8 8 3 1 3. + 0 + -6.2783220782876015e-003 + 0.2272856980562210 + 0.5114030241966248 + <_> + + <_> + + + + <_>9 5 2 6 -1. + <_>9 5 1 6 2. + 0 + 3.4598479978740215e-003 + 0.4626308083534241 + 0.6608219146728516 + <_> + + <_> + + + + <_>8 6 3 4 -1. + <_>9 6 1 4 3. + 0 + -1.3112019514665008e-003 + 0.6317539811134338 + 0.4436857998371124 + <_> + + <_> + + + + <_>7 6 8 12 -1. + <_>11 6 4 6 2. + <_>7 12 4 6 2. + 0 + 2.6876179035753012e-003 + 0.5421109795570374 + 0.4054022133350372 + <_> + + <_> + + + + <_>5 6 8 12 -1. + <_>5 6 4 6 2. + <_>9 12 4 6 2. + 0 + 3.9118169806897640e-003 + 0.5358477830886841 + 0.3273454904556274 + <_> + + <_> + + + + <_>12 4 3 3 -1. + <_>12 5 3 1 3. + 0 + -0.0142064504325390 + 0.7793576717376709 + 0.4975781142711639 + <_> + + <_> + + + + <_>2 16 3 2 -1. + <_>2 17 3 1 2. + 0 + 7.1705528534948826e-004 + 0.5297319889068604 + 0.3560903966426849 + <_> + + <_> + + + + <_>12 4 3 3 -1. + <_>12 5 3 1 3. + 0 + 1.6635019565001130e-003 + 0.4678094089031220 + 0.5816481709480286 + <_> + + <_> + + + + <_>2 12 6 6 -1. + <_>2 14 6 2 3. + 0 + 3.3686188980937004e-003 + 0.5276734232902527 + 0.3446420133113861 + <_> + + <_> + + + + <_>7 13 6 3 -1. + <_>7 14 6 1 3. + 0 + 0.0127995302900672 + 0.4834679961204529 + 0.7472159266471863 + <_> + + <_> + + + + <_>6 14 6 3 -1. + <_>6 15 6 1 3. + 0 + 3.3901201095432043e-003 + 0.4511859118938446 + 0.6401721239089966 + <_> + + <_> + + + + <_>14 15 5 3 -1. + <_>14 16 5 1 3. + 0 + 4.7070779837667942e-003 + 0.5335658788681030 + 0.3555220961570740 + <_> + + <_> + + + + <_>5 4 3 3 -1. + <_>5 5 3 1 3. + 0 + 1.4819339849054813e-003 + 0.4250707030296326 + 0.5772724151611328 + <_> + + <_> + + + + <_>14 15 5 3 -1. + <_>14 16 5 1 3. + 0 + -6.9995759986341000e-003 + 0.3003320097923279 + 0.5292900204658508 + <_> + + <_> + + + + <_>5 3 6 2 -1. + <_>7 3 2 2 3. + 0 + 0.0159390103071928 + 0.5067319273948669 + 0.1675581932067871 + <_> + + <_> + + + + <_>8 15 4 3 -1. + <_>8 16 4 1 3. + 0 + 7.6377349905669689e-003 + 0.4795069992542267 + 0.7085601091384888 + <_> + + <_> + + + + <_>1 15 5 3 -1. + <_>1 16 5 1 3. + 0 + 6.7334040068089962e-003 + 0.5133113265037537 + 0.2162470072507858 + <_> + + <_> + + + + <_>8 13 4 6 -1. + <_>10 13 2 3 2. + <_>8 16 2 3 2. + 0 + -0.0128588099032640 + 0.1938841938972473 + 0.5251371860504150 + <_> + + <_> + + + + <_>7 8 3 3 -1. + <_>8 8 1 3 3. + 0 + -6.2270800117403269e-004 + 0.5686538219451904 + 0.4197868108749390 + <_> + + <_> + + + + <_>12 0 5 4 -1. + <_>12 2 5 2 2. + 0 + -5.2651681471616030e-004 + 0.4224168956279755 + 0.5429695844650269 + <_> + + <_> + + + + <_>0 2 20 2 -1. + <_>0 2 10 1 2. + <_>10 3 10 1 2. + 0 + 0.0110750999301672 + 0.5113775134086609 + 0.2514517903327942 + <_> + + <_> + + + + <_>1 0 18 4 -1. + <_>7 0 6 4 3. + 0 + -0.0367282517254353 + 0.7194662094116211 + 0.4849618971347809 + <_> + + <_> + + + + <_>4 3 6 1 -1. + <_>6 3 2 1 3. + 0 + -2.8207109426148236e-004 + 0.3840261995792389 + 0.5394446253776550 + <_> + + <_> + + + + <_>4 18 13 2 -1. + <_>4 19 13 1 2. + 0 + -2.7489690110087395e-003 + 0.5937088727951050 + 0.4569182097911835 + <_> + + <_> + + + + <_>2 10 3 6 -1. + <_>2 12 3 2 3. + 0 + 0.0100475195795298 + 0.5138576030731201 + 0.2802298069000244 + <_> + + <_> + + + + <_>14 12 6 8 -1. + <_>17 12 3 4 2. + <_>14 16 3 4 2. + 0 + -8.1497840583324432e-003 + 0.6090037226676941 + 0.4636121094226837 + <_> + + <_> + + + + <_>4 13 10 6 -1. + <_>4 13 5 3 2. + <_>9 16 5 3 2. + 0 + -6.8833888508379459e-003 + 0.3458611071109772 + 0.5254660248756409 + <_> + + <_> + + + + <_>14 12 1 2 -1. + <_>14 13 1 1 2. + 0 + -1.4039360394235700e-005 + 0.5693104267120361 + 0.4082083106040955 + <_> + + <_> + + + + <_>8 13 4 3 -1. + <_>8 14 4 1 3. + 0 + 1.5498419525101781e-003 + 0.4350537061691284 + 0.5806517004966736 + <_> + + <_> + + + + <_>14 12 2 2 -1. + <_>14 13 2 1 2. + 0 + -6.7841499112546444e-003 + 0.1468873023986816 + 0.5182775259017944 + <_> + + <_> + + + + <_>4 12 2 2 -1. + <_>4 13 2 1 2. + 0 + 2.1705629478674382e-004 + 0.5293524265289307 + 0.3456174135208130 + <_> + + <_> + + + + <_>8 12 9 2 -1. + <_>8 13 9 1 2. + 0 + 3.1198898795992136e-004 + 0.4652450978755951 + 0.5942413806915283 + <_> + + <_> + + + + <_>9 14 2 3 -1. + <_>9 15 2 1 3. + 0 + 5.4507530294358730e-003 + 0.4653508961200714 + 0.7024846076965332 + <_> + + <_> + + + + <_>11 10 3 6 -1. + <_>11 13 3 3 2. + 0 + -2.5818689027801156e-004 + 0.5497295260429382 + 0.3768967092037201 + <_> + + <_> + + + + <_>5 6 9 12 -1. + <_>5 12 9 6 2. + 0 + -0.0174425393342972 + 0.3919087946414948 + 0.5457497835159302 + <_> + + <_> + + + + <_>11 10 3 6 -1. + <_>11 13 3 3 2. + 0 + -0.0453435294330120 + 0.1631357073783875 + 0.5154908895492554 + <_> + + <_> + + + + <_>6 10 3 6 -1. + <_>6 13 3 3 2. + 0 + 1.9190689781680703e-003 + 0.5145897865295410 + 0.2791895866394043 + <_> + + <_> + + + + <_>5 4 11 3 -1. + <_>5 5 11 1 3. + 0 + -6.0177869163453579e-003 + 0.6517636179924011 + 0.4756332933902741 + <_> + + <_> + + + + <_>7 1 5 10 -1. + <_>7 6 5 5 2. + 0 + -4.0720738470554352e-003 + 0.5514652729034424 + 0.4092685878276825 + <_> + + <_> + + + + <_>2 8 18 2 -1. + <_>2 9 18 1 2. + 0 + 3.9855059003457427e-004 + 0.3165240883827210 + 0.5285550951957703 + <_> + + <_> + + + + <_>7 17 5 3 -1. + <_>7 18 5 1 3. + 0 + -6.5418570302426815e-003 + 0.6853377819061279 + 0.4652808904647827 + <_> + + <_> + + + + <_>5 9 12 1 -1. + <_>9 9 4 1 3. + 0 + 3.4845089539885521e-003 + 0.5484588146209717 + 0.4502759873867035 + <_> + + <_> + + + + <_>0 14 6 6 -1. + <_>0 14 3 3 2. + <_>3 17 3 3 2. + 0 + -0.0136967804282904 + 0.6395779848098755 + 0.4572555124759674 + <_> + + <_> + + + + <_>5 9 12 1 -1. + <_>9 9 4 1 3. + 0 + -0.0173471402376890 + 0.2751072943210602 + 0.5181614756584168 + <_> + + <_> + + + + <_>3 9 12 1 -1. + <_>7 9 4 1 3. + 0 + -4.0885428898036480e-003 + 0.3325636088848114 + 0.5194984078407288 + <_> + + <_> + + + + <_>14 10 6 7 -1. + <_>14 10 3 7 2. + 0 + -9.4687901437282562e-003 + 0.5942280888557434 + 0.4851819872856140 + <_> + + <_> + + + + <_>1 0 16 2 -1. + <_>1 1 16 1 2. + 0 + 1.7084840219467878e-003 + 0.4167110919952393 + 0.5519806146621704 + <_> + + <_> + + + + <_>10 9 10 9 -1. + <_>10 12 10 3 3. + 0 + 9.4809094443917274e-003 + 0.5433894991874695 + 0.4208514988422394 + <_> + + <_> + + + + <_>0 1 10 2 -1. + <_>5 1 5 2 2. + 0 + -4.7389650717377663e-003 + 0.6407189965248108 + 0.4560655057430267 + <_> + + <_> + + + + <_>17 3 2 3 -1. + <_>17 4 2 1 3. + 0 + 6.5761050209403038e-003 + 0.5214555263519287 + 0.2258227020502091 + <_> + + <_> + + + + <_>1 3 2 3 -1. + <_>1 4 2 1 3. + 0 + -2.1690549328923225e-003 + 0.3151527941226959 + 0.5156704783439636 + <_> + + <_> + + + + <_>9 7 3 6 -1. + <_>10 7 1 6 3. + 0 + 0.0146601703017950 + 0.4870837032794952 + 0.6689941287040710 + <_> + + <_> + + + + <_>6 5 4 3 -1. + <_>8 5 2 3 2. + 0 + 1.7231999663636088e-004 + 0.3569748997688294 + 0.5251078009605408 + <_> + + <_> + + + + <_>7 5 6 6 -1. + <_>9 5 2 6 3. + 0 + -0.0218037609010935 + 0.8825920820236206 + 0.4966329932212830 + <_> + + <_> + + + + <_>3 4 12 12 -1. + <_>3 4 6 6 2. + <_>9 10 6 6 2. + 0 + -0.0947361066937447 + 0.1446162015199661 + 0.5061113834381104 + <_> + + <_> + + + + <_>9 2 6 15 -1. + <_>11 2 2 15 3. + 0 + 5.5825551971793175e-003 + 0.5396478772163391 + 0.4238066077232361 + <_> + + <_> + + + + <_>2 2 6 17 -1. + <_>4 2 2 17 3. + 0 + 1.9517090404406190e-003 + 0.4170410931110382 + 0.5497786998748779 + <_> + + <_> + + + + <_>14 10 6 7 -1. + <_>14 10 3 7 2. + 0 + 0.0121499001979828 + 0.4698367118835449 + 0.5664274096488953 + <_> + + <_> + + + + <_>0 10 6 7 -1. + <_>3 10 3 7 2. + 0 + -7.5169620104134083e-003 + 0.6267772912979126 + 0.4463135898113251 + <_> + + <_> + + + + <_>9 2 6 15 -1. + <_>11 2 2 15 3. + 0 + -0.0716679096221924 + 0.3097011148929596 + 0.5221003293991089 + <_> + + <_> + + + + <_>5 2 6 15 -1. + <_>7 2 2 15 3. + 0 + -0.0882924199104309 + 0.0811238884925842 + 0.5006365180015564 + <_> + + <_> + + + + <_>17 9 3 6 -1. + <_>17 11 3 2 3. + 0 + 0.0310630798339844 + 0.5155503749847412 + 0.1282255947589874 + <_> + + <_> + + + + <_>6 7 6 6 -1. + <_>8 7 2 6 3. + 0 + 0.0466218404471874 + 0.4699777960777283 + 0.7363960742950440 + <_> + + <_> + + + + <_>1 10 18 6 -1. + <_>10 10 9 3 2. + <_>1 13 9 3 2. + 0 + -0.0121894897893071 + 0.3920530080795288 + 0.5518996715545654 + <_> + + <_> + + + + <_>0 9 10 9 -1. + <_>0 12 10 3 3. + 0 + 0.0130161102861166 + 0.5260658264160156 + 0.3685136139392853 + <_> + + <_> + + + + <_>8 15 4 3 -1. + <_>8 16 4 1 3. + 0 + -3.4952899441123009e-003 + 0.6339294910430908 + 0.4716280996799469 + <_> + + <_> + + + + <_>5 12 3 4 -1. + <_>5 14 3 2 2. + 0 + -4.4015039748046547e-005 + 0.5333027243614197 + 0.3776184916496277 + <_> + + <_> + + + + <_>3 3 16 12 -1. + <_>3 9 16 6 2. + 0 + -0.1096649020910263 + 0.1765342056751251 + 0.5198346972465515 + <_> + + <_> + + + + <_>1 1 12 12 -1. + <_>1 1 6 6 2. + <_>7 7 6 6 2. + 0 + -9.0279558207839727e-004 + 0.5324159860610962 + 0.3838908076286316 + <_> + + <_> + + + + <_>10 4 2 4 -1. + <_>11 4 1 2 2. + <_>10 6 1 2 2. + 0 + 7.1126641705632210e-004 + 0.4647929966449738 + 0.5755224227905273 + <_> + + <_> + + + + <_>0 9 10 2 -1. + <_>0 9 5 1 2. + <_>5 10 5 1 2. + 0 + -3.1250279862433672e-003 + 0.3236708939075470 + 0.5166770815849304 + <_> + + <_> + + + + <_>9 11 3 3 -1. + <_>9 12 3 1 3. + 0 + 2.4144679773598909e-003 + 0.4787439107894898 + 0.6459717750549316 + <_> + + <_> + + + + <_>3 12 9 2 -1. + <_>3 13 9 1 2. + 0 + 4.4391240226104856e-004 + 0.4409308135509491 + 0.6010255813598633 + <_> + + <_> + + + + <_>9 9 2 2 -1. + <_>9 10 2 1 2. + 0 + -2.2611189342569560e-004 + 0.4038113951683044 + 0.5493255853652954 + 50.1697311401367190 + 12 + -1 + <_> + + + <_> + + <_> + + + + <_>3 4 13 6 -1. + <_>3 6 13 2 3. + 0 + -0.0469012893736362 + 0.6600171923637390 + 0.3743801116943359 + <_> + + <_> + + + + <_>9 7 6 4 -1. + <_>12 7 3 2 2. + <_>9 9 3 2 2. + 0 + -1.4568349579349160e-003 + 0.5783991217613220 + 0.3437797129154205 + <_> + + <_> + + + + <_>1 0 6 8 -1. + <_>4 0 3 8 2. + 0 + 5.5598369799554348e-003 + 0.3622266948223114 + 0.5908216238021851 + <_> + + <_> + + + + <_>9 5 2 12 -1. + <_>9 11 2 6 2. + 0 + 7.3170487303286791e-004 + 0.5500419139862061 + 0.2873558104038239 + <_> + + <_> + + + + <_>4 4 3 10 -1. + <_>4 9 3 5 2. + 0 + 1.3318009441718459e-003 + 0.2673169970512390 + 0.5431019067764282 + <_> + + <_> + + + + <_>6 17 8 3 -1. + <_>6 18 8 1 3. + 0 + 2.4347059661522508e-004 + 0.3855027854442596 + 0.5741388797760010 + <_> + + <_> + + + + <_>0 5 10 6 -1. + <_>0 7 10 2 3. + 0 + -3.0512469820678234e-003 + 0.5503209829330444 + 0.3462845087051392 + <_> + + <_> + + + + <_>13 2 3 2 -1. + <_>13 3 3 1 2. + 0 + -6.8657199153676629e-004 + 0.3291221857070923 + 0.5429509282112122 + <_> + + <_> + + + + <_>7 5 4 5 -1. + <_>9 5 2 5 2. + 0 + 1.4668200165033340e-003 + 0.3588382005691528 + 0.5351811051368713 + <_> + + <_> + + + + <_>12 14 3 6 -1. + <_>12 16 3 2 3. + 0 + 3.2021870720200241e-004 + 0.4296841919422150 + 0.5700234174728394 + <_> + + <_> + + + + <_>1 11 8 2 -1. + <_>1 12 8 1 2. + 0 + 7.4122188379988074e-004 + 0.5282164812088013 + 0.3366870880126953 + <_> + + <_> + + + + <_>7 13 6 3 -1. + <_>7 14 6 1 3. + 0 + 3.8330298848450184e-003 + 0.4559567868709564 + 0.6257336139678955 + <_> + + <_> + + + + <_>0 5 3 6 -1. + <_>0 7 3 2 3. + 0 + -0.0154564399272203 + 0.2350116968154907 + 0.5129452943801880 + <_> + + <_> + + + + <_>13 2 3 2 -1. + <_>13 3 3 1 2. + 0 + 2.6796779129654169e-003 + 0.5329415202140808 + 0.4155062139034271 + <_> + + <_> + + + + <_>4 14 4 6 -1. + <_>4 14 2 3 2. + <_>6 17 2 3 2. + 0 + 2.8296569362282753e-003 + 0.4273087978363037 + 0.5804538130760193 + <_> + + <_> + + + + <_>13 2 3 2 -1. + <_>13 3 3 1 2. + 0 + -3.9444249123334885e-003 + 0.2912611961364746 + 0.5202686190605164 + <_> + + <_> + + + + <_>8 2 4 12 -1. + <_>8 6 4 4 3. + 0 + 2.7179559692740440e-003 + 0.5307688117027283 + 0.3585677146911621 + <_> + + <_> + + + + <_>14 0 6 8 -1. + <_>17 0 3 4 2. + <_>14 4 3 4 2. + 0 + 5.9077627956867218e-003 + 0.4703775048255920 + 0.5941585898399353 + <_> + + <_> + + + + <_>7 17 3 2 -1. + <_>8 17 1 2 3. + 0 + -4.2240349575877190e-003 + 0.2141567021608353 + 0.5088796019554138 + <_> + + <_> + + + + <_>8 12 4 2 -1. + <_>8 13 4 1 2. + 0 + 4.0725888684391975e-003 + 0.4766413867473602 + 0.6841061115264893 + <_> + + <_> + + + + <_>6 0 8 12 -1. + <_>6 0 4 6 2. + <_>10 6 4 6 2. + 0 + 0.0101495301350951 + 0.5360798835754395 + 0.3748497068881989 + <_> + + <_> + + + + <_>14 0 2 10 -1. + <_>15 0 1 5 2. + <_>14 5 1 5 2. + 0 + -1.8864999583456665e-004 + 0.5720130205154419 + 0.3853805065155029 + <_> + + <_> + + + + <_>5 3 8 6 -1. + <_>5 3 4 3 2. + <_>9 6 4 3 2. + 0 + -4.8864358104765415e-003 + 0.3693122863769531 + 0.5340958833694458 + <_> + + <_> + + + + <_>14 0 6 10 -1. + <_>17 0 3 5 2. + <_>14 5 3 5 2. + 0 + 0.0261584799736738 + 0.4962374866008759 + 0.6059989929199219 + <_> + + <_> + + + + <_>9 14 1 2 -1. + <_>9 15 1 1 2. + 0 + 4.8560759751126170e-004 + 0.4438945949077606 + 0.6012468934059143 + <_> + + <_> + + + + <_>15 10 4 3 -1. + <_>15 11 4 1 3. + 0 + 0.0112687097862363 + 0.5244250297546387 + 0.1840388029813767 + <_> + + <_> + + + + <_>8 14 2 3 -1. + <_>8 15 2 1 3. + 0 + -2.8114619199186563e-003 + 0.6060283780097961 + 0.4409897029399872 + <_> + + <_> + + + + <_>3 13 14 4 -1. + <_>10 13 7 2 2. + <_>3 15 7 2 2. + 0 + -5.6112729944288731e-003 + 0.3891170918941498 + 0.5589237213134766 + <_> + + <_> + + + + <_>1 10 4 3 -1. + <_>1 11 4 1 3. + 0 + 8.5680093616247177e-003 + 0.5069345831871033 + 0.2062619030475617 + <_> + + <_> + + + + <_>9 11 6 1 -1. + <_>11 11 2 1 3. + 0 + -3.8172779022715986e-004 + 0.5882201790809631 + 0.4192610979080200 + <_> + + <_> + + + + <_>5 11 6 1 -1. + <_>7 11 2 1 3. + 0 + -1.7680290329735726e-004 + 0.5533605813980103 + 0.4003368914127350 + <_> + + <_> + + + + <_>3 5 16 15 -1. + <_>3 10 16 5 3. + 0 + 6.5112537704408169e-003 + 0.3310146927833557 + 0.5444191098213196 + <_> + + <_> + + + + <_>6 12 4 2 -1. + <_>8 12 2 2 2. + 0 + -6.5948683186434209e-005 + 0.5433831810951233 + 0.3944905996322632 + <_> + + <_> + + + + <_>4 4 12 10 -1. + <_>10 4 6 5 2. + <_>4 9 6 5 2. + 0 + 6.9939051754772663e-003 + 0.5600358247756958 + 0.4192714095115662 + <_> + + <_> + + + + <_>8 6 3 4 -1. + <_>9 6 1 4 3. + 0 + -4.6744439750909805e-003 + 0.6685466766357422 + 0.4604960978031158 + <_> + + <_> + + + + <_>8 12 4 8 -1. + <_>10 12 2 4 2. + <_>8 16 2 4 2. + 0 + 0.0115898502990603 + 0.5357121229171753 + 0.2926830053329468 + <_> + + <_> + + + + <_>8 14 4 3 -1. + <_>8 15 4 1 3. + 0 + 0.0130078401416540 + 0.4679817855358124 + 0.7307463288307190 + <_> + + <_> + + + + <_>12 2 3 2 -1. + <_>13 2 1 2 3. + 0 + -1.1008579749614000e-003 + 0.3937501013278961 + 0.5415065288543701 + <_> + + <_> + + + + <_>8 15 3 2 -1. + <_>8 16 3 1 2. + 0 + 6.0472649056464434e-004 + 0.4242376089096069 + 0.5604041218757629 + <_> + + <_> + + + + <_>6 0 9 14 -1. + <_>9 0 3 14 3. + 0 + -0.0144948400557041 + 0.3631210029125214 + 0.5293182730674744 + <_> + + <_> + + + + <_>9 6 2 3 -1. + <_>10 6 1 3 2. + 0 + -5.3056948818266392e-003 + 0.6860452294349670 + 0.4621821045875549 + <_> + + <_> + + + + <_>10 8 2 3 -1. + <_>10 9 2 1 3. + 0 + -8.1829127157106996e-004 + 0.3944096863269806 + 0.5420439243316650 + <_> + + <_> + + + + <_>0 9 4 6 -1. + <_>0 11 4 2 3. + 0 + -0.0190775208175182 + 0.1962621957063675 + 0.5037891864776611 + <_> + + <_> + + + + <_>6 0 8 2 -1. + <_>6 1 8 1 2. + 0 + 3.5549470339901745e-004 + 0.4086259007453919 + 0.5613973140716553 + <_> + + <_> + + + + <_>6 14 7 3 -1. + <_>6 15 7 1 3. + 0 + 1.9679730758070946e-003 + 0.4489121139049530 + 0.5926123261451721 + <_> + + <_> + + + + <_>8 10 8 9 -1. + <_>8 13 8 3 3. + 0 + 6.9189141504466534e-003 + 0.5335925817489624 + 0.3728385865688324 + <_> + + <_> + + + + <_>5 2 3 2 -1. + <_>6 2 1 2 3. + 0 + 2.9872779268771410e-003 + 0.5111321210861206 + 0.2975643873214722 + <_> + + <_> + + + + <_>14 1 6 8 -1. + <_>17 1 3 4 2. + <_>14 5 3 4 2. + 0 + -6.2264618463814259e-003 + 0.5541489720344544 + 0.4824537932872772 + <_> + + <_> + + + + <_>0 1 6 8 -1. + <_>0 1 3 4 2. + <_>3 5 3 4 2. + 0 + 0.0133533002808690 + 0.4586423933506012 + 0.6414797902107239 + <_> + + <_> + + + + <_>1 2 18 6 -1. + <_>10 2 9 3 2. + <_>1 5 9 3 2. + 0 + 0.0335052385926247 + 0.5392425060272217 + 0.3429994881153107 + <_> + + <_> + + + + <_>9 3 2 1 -1. + <_>10 3 1 1 2. + 0 + -2.5294460356235504e-003 + 0.1703713983297348 + 0.5013315081596375 + <_> + + <_> + + + + <_>13 2 4 6 -1. + <_>15 2 2 3 2. + <_>13 5 2 3 2. + 0 + -1.2801629491150379e-003 + 0.5305461883544922 + 0.4697405099868774 + <_> + + <_> + + + + <_>5 4 3 3 -1. + <_>5 5 3 1 3. + 0 + 7.0687388069927692e-003 + 0.4615545868873596 + 0.6436504721641541 + <_> + + <_> + + + + <_>13 5 1 3 -1. + <_>13 6 1 1 3. + 0 + 9.6880499040707946e-004 + 0.4833599030971527 + 0.6043894290924072 + <_> + + <_> + + + + <_>2 16 5 3 -1. + <_>2 17 5 1 3. + 0 + 3.9647659286856651e-003 + 0.5187637209892273 + 0.3231816887855530 + <_> + + <_> + + + + <_>13 2 4 6 -1. + <_>15 2 2 3 2. + <_>13 5 2 3 2. + 0 + -0.0220577307045460 + 0.4079256951808929 + 0.5200980901718140 + <_> + + <_> + + + + <_>3 2 4 6 -1. + <_>3 2 2 3 2. + <_>5 5 2 3 2. + 0 + -6.6906312713399529e-004 + 0.5331609249114990 + 0.3815600872039795 + <_> + + <_> + + + + <_>13 5 1 2 -1. + <_>13 6 1 1 2. + 0 + -6.7009328631684184e-004 + 0.5655422210693359 + 0.4688901901245117 + <_> + + <_> + + + + <_>5 5 2 2 -1. + <_>5 6 2 1 2. + 0 + 7.4284552829340100e-004 + 0.4534381031990051 + 0.6287400126457214 + <_> + + <_> + + + + <_>13 9 2 2 -1. + <_>13 9 1 2 2. + 0 + 2.2227810695767403e-003 + 0.5350633263587952 + 0.3303655982017517 + <_> + + <_> + + + + <_>5 9 2 2 -1. + <_>6 9 1 2 2. + 0 + -5.4130521602928638e-003 + 0.1113687008619309 + 0.5005434751510620 + <_> + + <_> + + + + <_>13 17 3 2 -1. + <_>13 18 3 1 2. + 0 + -1.4520040167553816e-005 + 0.5628737807273865 + 0.4325133860111237 + <_> + + <_> + + + + <_>6 16 4 4 -1. + <_>6 16 2 2 2. + <_>8 18 2 2 2. + 0 + 2.3369169502984732e-004 + 0.4165835082530975 + 0.5447791218757629 + <_> + + <_> + + + + <_>9 16 2 3 -1. + <_>9 17 2 1 3. + 0 + 4.2894547805190086e-003 + 0.4860391020774841 + 0.6778649091720581 + <_> + + <_> + + + + <_>0 13 9 6 -1. + <_>0 15 9 2 3. + 0 + 5.9103150852024555e-003 + 0.5262305140495300 + 0.3612113893032074 + <_> + + <_> + + + + <_>9 14 2 6 -1. + <_>9 17 2 3 2. + 0 + 0.0129005396738648 + 0.5319377183914185 + 0.3250288069248200 + <_> + + <_> + + + + <_>9 15 2 3 -1. + <_>9 16 2 1 3. + 0 + 4.6982979401946068e-003 + 0.4618245065212250 + 0.6665925979614258 + <_> + + <_> + + + + <_>1 10 18 6 -1. + <_>1 12 18 2 3. + 0 + 0.0104398597031832 + 0.5505670905113220 + 0.3883604109287262 + <_> + + <_> + + + + <_>8 11 4 2 -1. + <_>8 12 4 1 2. + 0 + 3.0443191062659025e-003 + 0.4697853028774262 + 0.7301844954490662 + <_> + + <_> + + + + <_>7 9 6 2 -1. + <_>7 10 6 1 2. + 0 + -6.1593751888722181e-004 + 0.3830839097499847 + 0.5464984178543091 + <_> + + <_> + + + + <_>8 8 2 3 -1. + <_>8 9 2 1 3. + 0 + -3.4247159492224455e-003 + 0.2566300034523010 + 0.5089530944824219 + <_> + + <_> + + + + <_>17 5 3 4 -1. + <_>18 5 1 4 3. + 0 + -9.3538565561175346e-003 + 0.6469966173171997 + 0.4940795898437500 + <_> + + <_> + + + + <_>1 19 18 1 -1. + <_>7 19 6 1 3. + 0 + 0.0523389987647533 + 0.4745982885360718 + 0.7878770828247070 + <_> + + <_> + + + + <_>9 0 3 2 -1. + <_>10 0 1 2 3. + 0 + 3.5765620414167643e-003 + 0.5306664705276489 + 0.2748498022556305 + <_> + + <_> + + + + <_>1 8 1 6 -1. + <_>1 10 1 2 3. + 0 + 7.1555317845195532e-004 + 0.5413125753402710 + 0.4041908979415894 + <_> + + <_> + + + + <_>12 17 8 3 -1. + <_>12 17 4 3 2. + 0 + -0.0105166798457503 + 0.6158512234687805 + 0.4815283119678497 + <_> + + <_> + + + + <_>0 5 3 4 -1. + <_>1 5 1 4 3. + 0 + 7.7347927726805210e-003 + 0.4695805907249451 + 0.7028980851173401 + <_> + + <_> + + + + <_>9 7 2 3 -1. + <_>9 8 2 1 3. + 0 + -4.3226778507232666e-003 + 0.2849566042423248 + 0.5304684042930603 + <_> + + <_> + + + + <_>7 11 2 2 -1. + <_>7 11 1 1 2. + <_>8 12 1 1 2. + 0 + -2.5534399319440126e-003 + 0.7056984901428223 + 0.4688892066478729 + <_> + + <_> + + + + <_>11 3 2 5 -1. + <_>11 3 1 5 2. + 0 + 1.0268510231981054e-004 + 0.3902932107448578 + 0.5573464035987854 + <_> + + <_> + + + + <_>7 3 2 5 -1. + <_>8 3 1 5 2. + 0 + 7.1395188570022583e-006 + 0.3684231936931610 + 0.5263987779617310 + <_> + + <_> + + + + <_>15 13 2 3 -1. + <_>15 14 2 1 3. + 0 + -1.6711989883333445e-003 + 0.3849175870418549 + 0.5387271046638489 + <_> + + <_> + + + + <_>5 6 2 3 -1. + <_>5 7 2 1 3. + 0 + 4.9260449595749378e-003 + 0.4729771912097931 + 0.7447251081466675 + <_> + + <_> + + + + <_>4 19 15 1 -1. + <_>9 19 5 1 3. + 0 + 4.3908702209591866e-003 + 0.4809181094169617 + 0.5591921806335449 + <_> + + <_> + + + + <_>1 19 15 1 -1. + <_>6 19 5 1 3. + 0 + -0.0177936293184757 + 0.6903678178787231 + 0.4676927030086517 + <_> + + <_> + + + + <_>15 13 2 3 -1. + <_>15 14 2 1 3. + 0 + 2.0469669252634048e-003 + 0.5370690226554871 + 0.3308162093162537 + <_> + + <_> + + + + <_>5 0 4 15 -1. + <_>7 0 2 15 2. + 0 + 0.0298914890736341 + 0.5139865279197693 + 0.3309059143066406 + <_> + + <_> + + + + <_>9 6 2 5 -1. + <_>9 6 1 5 2. + 0 + 1.5494900289922953e-003 + 0.4660237133502960 + 0.6078342795372009 + <_> + + <_> + + + + <_>9 5 2 7 -1. + <_>10 5 1 7 2. + 0 + 1.4956969534978271e-003 + 0.4404835999011993 + 0.5863919854164124 + <_> + + <_> + + + + <_>16 11 3 3 -1. + <_>16 12 3 1 3. + 0 + 9.5885928021743894e-004 + 0.5435971021652222 + 0.4208523035049439 + <_> + + <_> + + + + <_>1 11 3 3 -1. + <_>1 12 3 1 3. + 0 + 4.9643701640889049e-004 + 0.5370578169822693 + 0.4000622034072876 + <_> + + <_> + + + + <_>6 6 8 3 -1. + <_>6 7 8 1 3. + 0 + -2.7280810754746199e-003 + 0.5659412741661072 + 0.4259642958641052 + <_> + + <_> + + + + <_>0 15 6 2 -1. + <_>0 16 6 1 2. + 0 + 2.3026480339467525e-003 + 0.5161657929420471 + 0.3350869119167328 + <_> + + <_> + + + + <_>1 0 18 6 -1. + <_>7 0 6 6 3. + 0 + 0.2515163123607636 + 0.4869661927223206 + 0.7147309780120850 + <_> + + <_> + + + + <_>6 0 3 4 -1. + <_>7 0 1 4 3. + 0 + -4.6328022144734859e-003 + 0.2727448940277100 + 0.5083789825439453 + <_> + + <_> + + + + <_>14 10 4 10 -1. + <_>16 10 2 5 2. + <_>14 15 2 5 2. + 0 + -0.0404344908893108 + 0.6851438879966736 + 0.5021767020225525 + <_> + + <_> + + + + <_>3 2 3 2 -1. + <_>4 2 1 2 3. + 0 + 1.4972220014897175e-005 + 0.4284465014934540 + 0.5522555112838745 + <_> + + <_> + + + + <_>11 2 2 2 -1. + <_>11 3 2 1 2. + 0 + -2.4050309730228037e-004 + 0.4226118922233582 + 0.5390074849128723 + <_> + + <_> + + + + <_>2 10 4 10 -1. + <_>2 10 2 5 2. + <_>4 15 2 5 2. + 0 + 0.0236578397452831 + 0.4744631946086884 + 0.7504366040229797 + <_> + + <_> + + + + <_>0 13 20 6 -1. + <_>10 13 10 3 2. + <_>0 16 10 3 2. + 0 + -8.1449104472994804e-003 + 0.4245058894157410 + 0.5538362860679627 + <_> + + <_> + + + + <_>0 5 2 15 -1. + <_>1 5 1 15 2. + 0 + -3.6992130335420370e-003 + 0.5952357053756714 + 0.4529713094234467 + <_> + + <_> + + + + <_>1 7 18 4 -1. + <_>10 7 9 2 2. + <_>1 9 9 2 2. + 0 + -6.7718601785600185e-003 + 0.4137794077396393 + 0.5473399758338928 + <_> + + <_> + + + + <_>0 0 2 17 -1. + <_>1 0 1 17 2. + 0 + 4.2669530957937241e-003 + 0.4484114944934845 + 0.5797994136810303 + <_> + + <_> + + + + <_>2 6 16 6 -1. + <_>10 6 8 3 2. + <_>2 9 8 3 2. + 0 + 1.7791989957913756e-003 + 0.5624858736991882 + 0.4432444870471954 + <_> + + <_> + + + + <_>8 14 1 3 -1. + <_>8 15 1 1 3. + 0 + 1.6774770338088274e-003 + 0.4637751877307892 + 0.6364241838455200 + <_> + + <_> + + + + <_>8 15 4 2 -1. + <_>8 16 4 1 2. + 0 + 1.1732629500329494e-003 + 0.4544503092765808 + 0.5914415717124939 + <_> + + <_> + + + + <_>5 2 8 2 -1. + <_>5 2 4 1 2. + <_>9 3 4 1 2. + 0 + 8.6998171173036098e-004 + 0.5334752798080444 + 0.3885917961597443 + <_> + + <_> + + + + <_>6 11 8 6 -1. + <_>6 14 8 3 2. + 0 + 7.6378340600058436e-004 + 0.5398585200309753 + 0.3744941949844360 + <_> + + <_> + + + + <_>9 13 2 2 -1. + <_>9 14 2 1 2. + 0 + 1.5684569370932877e-004 + 0.4317873120307922 + 0.5614616274833679 + <_> + + <_> + + + + <_>18 4 2 6 -1. + <_>18 6 2 2 3. + 0 + -0.0215113703161478 + 0.1785925030708313 + 0.5185542702674866 + <_> + + <_> + + + + <_>9 12 2 2 -1. + <_>9 13 2 1 2. + 0 + 1.3081369979772717e-004 + 0.4342499077320099 + 0.5682849884033203 + <_> + + <_> + + + + <_>18 4 2 6 -1. + <_>18 6 2 2 3. + 0 + 0.0219920407980680 + 0.5161716938018799 + 0.2379394024610519 + <_> + + <_> + + + + <_>9 13 1 3 -1. + <_>9 14 1 1 3. + 0 + -8.0136500764638186e-004 + 0.5986763238906860 + 0.4466426968574524 + <_> + + <_> + + + + <_>18 4 2 6 -1. + <_>18 6 2 2 3. + 0 + -8.2736099138855934e-003 + 0.4108217954635620 + 0.5251057147979736 + <_> + + <_> + + + + <_>0 4 2 6 -1. + <_>0 6 2 2 3. + 0 + 3.6831789184361696e-003 + 0.5173814296722412 + 0.3397518098354340 + <_> + + <_> + + + + <_>9 12 3 3 -1. + <_>9 13 3 1 3. + 0 + -7.9525681212544441e-003 + 0.6888983249664307 + 0.4845924079418182 + <_> + + <_> + + + + <_>3 13 2 3 -1. + <_>3 14 2 1 3. + 0 + 1.5382299898192286e-003 + 0.5178567171096802 + 0.3454113900661469 + <_> + + <_> + + + + <_>13 13 4 3 -1. + <_>13 14 4 1 3. + 0 + -0.0140435304492712 + 0.1678421050310135 + 0.5188667774200440 + <_> + + <_> + + + + <_>5 4 3 3 -1. + <_>5 5 3 1 3. + 0 + 1.4315890148282051e-003 + 0.4368256926536560 + 0.5655773878097534 + <_> + + <_> + + + + <_>5 2 10 6 -1. + <_>5 4 10 2 3. + 0 + -0.0340142287313938 + 0.7802296280860901 + 0.4959217011928558 + <_> + + <_> + + + + <_>3 13 4 3 -1. + <_>3 14 4 1 3. + 0 + -0.0120272999629378 + 0.1585101038217545 + 0.5032231807708740 + <_> + + <_> + + + + <_>3 7 15 5 -1. + <_>8 7 5 5 3. + 0 + 0.1331661939620972 + 0.5163304805755615 + 0.2755128145217896 + <_> + + <_> + + + + <_>3 7 12 2 -1. + <_>7 7 4 2 3. + 0 + -1.5221949433907866e-003 + 0.3728317916393280 + 0.5214552283287048 + <_> + + <_> + + + + <_>10 3 3 9 -1. + <_>11 3 1 9 3. + 0 + -9.3929271679371595e-004 + 0.5838379263877869 + 0.4511165022850037 + <_> + + <_> + + + + <_>8 6 4 6 -1. + <_>10 6 2 6 2. + 0 + 0.0277197398245335 + 0.4728286862373352 + 0.7331544756889343 + <_> + + <_> + + + + <_>9 7 4 3 -1. + <_>9 8 4 1 3. + 0 + 3.1030150130391121e-003 + 0.5302202105522156 + 0.4101563096046448 + <_> + + <_> + + + + <_>0 9 4 9 -1. + <_>2 9 2 9 2. + 0 + 0.0778612196445465 + 0.4998334050178528 + 0.1272961944341660 + <_> + + <_> + + + + <_>9 13 3 5 -1. + <_>10 13 1 5 3. + 0 + -0.0158549398183823 + 0.0508333593606949 + 0.5165656208992004 + <_> + + <_> + + + + <_>7 7 6 3 -1. + <_>9 7 2 3 3. + 0 + -4.9725300632417202e-003 + 0.6798133850097656 + 0.4684231877326965 + <_> + + <_> + + + + <_>9 7 3 5 -1. + <_>10 7 1 5 3. + 0 + -9.7676506265997887e-004 + 0.6010771989822388 + 0.4788931906223297 + <_> + + <_> + + + + <_>5 7 8 2 -1. + <_>9 7 4 2 2. + 0 + -2.4647710379213095e-003 + 0.3393397927284241 + 0.5220503807067871 + <_> + + <_> + + + + <_>5 9 12 2 -1. + <_>9 9 4 2 3. + 0 + -6.7937700077891350e-003 + 0.4365136921405792 + 0.5239663124084473 + <_> + + <_> + + + + <_>5 6 10 3 -1. + <_>10 6 5 3 2. + 0 + 0.0326080210506916 + 0.5052723884582520 + 0.2425214946269989 + <_> + + <_> + + + + <_>10 12 3 1 -1. + <_>11 12 1 1 3. + 0 + -5.8514421107247472e-004 + 0.5733973979949951 + 0.4758574068546295 + <_> + + <_> + + + + <_>0 1 11 15 -1. + <_>0 6 11 5 3. + 0 + -0.0296326000243425 + 0.3892289102077484 + 0.5263597965240479 + 66.6691207885742190 + 13 + -1 + <_> + + + <_> + + <_> + + + + <_>1 0 18 6 -1. + <_>7 0 6 6 3. + 0 + 0.0465508513152599 + 0.3276950120925903 + 0.6240522861480713 + <_> + + <_> + + + + <_>7 7 6 1 -1. + <_>9 7 2 1 3. + 0 + 7.9537127166986465e-003 + 0.4256485104560852 + 0.6942939162254334 + <_> + + <_> + + + + <_>5 16 6 4 -1. + <_>5 16 3 2 2. + <_>8 18 3 2 2. + 0 + 6.8221561377868056e-004 + 0.3711487054824829 + 0.5900732874870300 + <_> + + <_> + + + + <_>6 5 9 8 -1. + <_>6 9 9 4 2. + 0 + -1.9348249770700932e-004 + 0.2041133940219879 + 0.5300545096397400 + <_> + + <_> + + + + <_>5 10 2 6 -1. + <_>5 13 2 3 2. + 0 + -2.6710508973337710e-004 + 0.5416126251220703 + 0.3103179037570953 + <_> + + <_> + + + + <_>7 6 8 10 -1. + <_>11 6 4 5 2. + <_>7 11 4 5 2. + 0 + 2.7818060480058193e-003 + 0.5277832746505737 + 0.3467069864273071 + <_> + + <_> + + + + <_>5 6 8 10 -1. + <_>5 6 4 5 2. + <_>9 11 4 5 2. + 0 + -4.6779078547842801e-004 + 0.5308231115341187 + 0.3294492065906525 + <_> + + <_> + + + + <_>9 5 2 2 -1. + <_>9 6 2 1 2. + 0 + -3.0335160772665404e-005 + 0.5773872733116150 + 0.3852097094058991 + <_> + + <_> + + + + <_>5 12 8 2 -1. + <_>5 13 8 1 2. + 0 + 7.8038009814918041e-004 + 0.4317438900470734 + 0.6150057911872864 + <_> + + <_> + + + + <_>10 2 8 2 -1. + <_>10 3 8 1 2. + 0 + -4.2553851380944252e-003 + 0.2933903932571411 + 0.5324292778968811 + <_> + + <_> + + + + <_>4 0 2 10 -1. + <_>4 0 1 5 2. + <_>5 5 1 5 2. + 0 + -2.4735610350035131e-004 + 0.5468844771385193 + 0.3843030035495758 + <_> + + <_> + + + + <_>9 10 2 2 -1. + <_>9 11 2 1 2. + 0 + -1.4724259381182492e-004 + 0.4281542897224426 + 0.5755587220191956 + <_> + + <_> + + + + <_>2 8 15 3 -1. + <_>2 9 15 1 3. + 0 + 1.1864770203828812e-003 + 0.3747301101684570 + 0.5471466183662415 + <_> + + <_> + + + + <_>8 13 4 3 -1. + <_>8 14 4 1 3. + 0 + 2.3936580400913954e-003 + 0.4537783861160278 + 0.6111528873443604 + <_> + + <_> + + + + <_>7 2 3 2 -1. + <_>8 2 1 2 3. + 0 + -1.5390539774671197e-003 + 0.2971341907978058 + 0.5189538002014160 + <_> + + <_> + + + + <_>7 13 6 3 -1. + <_>7 14 6 1 3. + 0 + -7.1968790143728256e-003 + 0.6699066758155823 + 0.4726476967334747 + <_> + + <_> + + + + <_>9 9 2 2 -1. + <_>9 10 2 1 2. + 0 + -4.1499789222143590e-004 + 0.3384954035282135 + 0.5260317921638489 + <_> + + <_> + + + + <_>17 2 3 6 -1. + <_>17 4 3 2 3. + 0 + 4.4359830208122730e-003 + 0.5399122238159180 + 0.3920140862464905 + <_> + + <_> + + + + <_>1 5 3 4 -1. + <_>2 5 1 4 3. + 0 + 2.6606200262904167e-003 + 0.4482578039169312 + 0.6119617819786072 + <_> + + <_> + + + + <_>14 8 4 6 -1. + <_>14 10 4 2 3. + 0 + -1.5287200221791863e-003 + 0.3711237907409668 + 0.5340266227722168 + <_> + + <_> + + + + <_>1 4 3 8 -1. + <_>2 4 1 8 3. + 0 + -4.7397250309586525e-003 + 0.6031088232994080 + 0.4455145001411438 + <_> + + <_> + + + + <_>8 13 4 6 -1. + <_>8 16 4 3 2. + 0 + -0.0148291299119592 + 0.2838754057884216 + 0.5341861844062805 + <_> + + <_> + + + + <_>3 14 2 2 -1. + <_>3 15 2 1 2. + 0 + 9.2275557108223438e-004 + 0.5209547281265259 + 0.3361653983592987 + <_> + + <_> + + + + <_>14 8 4 6 -1. + <_>14 10 4 2 3. + 0 + 0.0835298076272011 + 0.5119969844818115 + 0.0811644494533539 + <_> + + <_> + + + + <_>2 8 4 6 -1. + <_>2 10 4 2 3. + 0 + -7.5633148662745953e-004 + 0.3317120075225830 + 0.5189831256866455 + <_> + + <_> + + + + <_>10 14 1 6 -1. + <_>10 17 1 3 2. + 0 + 9.8403859883546829e-003 + 0.5247598290443420 + 0.2334959059953690 + <_> + + <_> + + + + <_>7 5 3 6 -1. + <_>8 5 1 6 3. + 0 + -1.5953830443322659e-003 + 0.5750094056129456 + 0.4295622110366821 + <_> + + <_> + + + + <_>11 2 2 6 -1. + <_>12 2 1 3 2. + <_>11 5 1 3 2. + 0 + 3.4766020689858124e-005 + 0.4342445135116577 + 0.5564029216766357 + <_> + + <_> + + + + <_>6 6 6 5 -1. + <_>8 6 2 5 3. + 0 + 0.0298629105091095 + 0.4579147100448608 + 0.6579188108444214 + <_> + + <_> + + + + <_>17 1 3 6 -1. + <_>17 3 3 2 3. + 0 + 0.0113255903124809 + 0.5274311900138855 + 0.3673888146877289 + <_> + + <_> + + + + <_>8 7 3 5 -1. + <_>9 7 1 5 3. + 0 + -8.7828645482659340e-003 + 0.7100368738174439 + 0.4642167091369629 + <_> + + <_> + + + + <_>9 18 3 2 -1. + <_>10 18 1 2 3. + 0 + 4.3639959767460823e-003 + 0.5279216170310974 + 0.2705877125263214 + <_> + + <_> + + + + <_>8 18 3 2 -1. + <_>9 18 1 2 3. + 0 + 4.1804728098213673e-003 + 0.5072525143623352 + 0.2449083030223846 + <_> + + <_> + + + + <_>12 3 5 2 -1. + <_>12 4 5 1 2. + 0 + -4.5668511302210391e-004 + 0.4283105134963989 + 0.5548691153526306 + <_> + + <_> + + + + <_>7 1 5 12 -1. + <_>7 7 5 6 2. + 0 + -3.7140368949621916e-003 + 0.5519387722015381 + 0.4103653132915497 + <_> + + <_> + + + + <_>1 0 18 4 -1. + <_>7 0 6 4 3. + 0 + -0.0253042895346880 + 0.6867002248764038 + 0.4869889020919800 + <_> + + <_> + + + + <_>4 2 2 2 -1. + <_>4 3 2 1 2. + 0 + -3.4454080741852522e-004 + 0.3728874027729034 + 0.5287693142890930 + <_> + + <_> + + + + <_>11 14 4 2 -1. + <_>13 14 2 1 2. + <_>11 15 2 1 2. + 0 + -8.3935231668874621e-004 + 0.6060152053833008 + 0.4616062045097351 + <_> + + <_> + + + + <_>0 2 3 6 -1. + <_>0 4 3 2 3. + 0 + 0.0172800496220589 + 0.5049635767936707 + 0.1819823980331421 + <_> + + <_> + + + + <_>9 7 2 3 -1. + <_>9 8 2 1 3. + 0 + -6.3595077954232693e-003 + 0.1631239950656891 + 0.5232778787612915 + <_> + + <_> + + + + <_>5 5 1 3 -1. + <_>5 6 1 1 3. + 0 + 1.0298109846189618e-003 + 0.4463278055191040 + 0.6176549196243286 + <_> + + <_> + + + + <_>10 10 6 1 -1. + <_>10 10 3 1 2. + 0 + 1.0117109632119536e-003 + 0.5473384857177734 + 0.4300698935985565 + <_> + + <_> + + + + <_>4 10 6 1 -1. + <_>7 10 3 1 2. + 0 + -0.0103088002651930 + 0.1166985034942627 + 0.5000867247581482 + <_> + + <_> + + + + <_>9 17 3 3 -1. + <_>9 18 3 1 3. + 0 + 5.4682018235325813e-003 + 0.4769287109375000 + 0.6719213724136353 + <_> + + <_> + + + + <_>4 14 1 3 -1. + <_>4 15 1 1 3. + 0 + -9.1696460731327534e-004 + 0.3471089899539948 + 0.5178164839744568 + <_> + + <_> + + + + <_>12 5 3 3 -1. + <_>12 6 3 1 3. + 0 + 2.3922820109874010e-003 + 0.4785236120223999 + 0.6216310858726502 + <_> + + <_> + + + + <_>4 5 12 3 -1. + <_>4 6 12 1 3. + 0 + -7.5573818758130074e-003 + 0.5814796090126038 + 0.4410085082054138 + <_> + + <_> + + + + <_>9 8 2 3 -1. + <_>9 9 2 1 3. + 0 + -7.7024032361805439e-004 + 0.3878000080585480 + 0.5465722084045410 + <_> + + <_> + + + + <_>4 9 3 3 -1. + <_>5 9 1 3 3. + 0 + -8.7125990539789200e-003 + 0.1660051047801971 + 0.4995836019515991 + <_> + + <_> + + + + <_>6 0 9 17 -1. + <_>9 0 3 17 3. + 0 + -0.0103063201531768 + 0.4093391001224518 + 0.5274233818054199 + <_> + + <_> + + + + <_>9 12 1 3 -1. + <_>9 13 1 1 3. + 0 + -2.0940979011356831e-003 + 0.6206194758415222 + 0.4572280049324036 + <_> + + <_> + + + + <_>9 5 2 15 -1. + <_>9 10 2 5 3. + 0 + 6.8099051713943481e-003 + 0.5567759275436401 + 0.4155600070953369 + <_> + + <_> + + + + <_>8 14 2 3 -1. + <_>8 15 2 1 3. + 0 + -1.0746059706434608e-003 + 0.5638927817344666 + 0.4353024959564209 + <_> + + <_> + + + + <_>10 14 1 3 -1. + <_>10 15 1 1 3. + 0 + 2.1550289820879698e-003 + 0.4826265871524811 + 0.6749758124351502 + <_> + + <_> + + + + <_>7 1 6 5 -1. + <_>9 1 2 5 3. + 0 + 0.0317423194646835 + 0.5048379898071289 + 0.1883248984813690 + <_> + + <_> + + + + <_>0 0 20 2 -1. + <_>0 0 10 2 2. + 0 + -0.0783827230334282 + 0.2369548976421356 + 0.5260158181190491 + <_> + + <_> + + + + <_>2 13 5 3 -1. + <_>2 14 5 1 3. + 0 + 5.7415119372308254e-003 + 0.5048828721046448 + 0.2776469886302948 + <_> + + <_> + + + + <_>9 11 2 3 -1. + <_>9 12 2 1 3. + 0 + -2.9014600440859795e-003 + 0.6238604784011841 + 0.4693317115306854 + <_> + + <_> + + + + <_>2 5 9 15 -1. + <_>2 10 9 5 3. + 0 + -2.6427931152284145e-003 + 0.3314141929149628 + 0.5169777274131775 + <_> + + <_> + + + + <_>5 0 12 10 -1. + <_>11 0 6 5 2. + <_>5 5 6 5 2. + 0 + -0.1094966009259224 + 0.2380045056343079 + 0.5183441042900085 + <_> + + <_> + + + + <_>5 1 2 3 -1. + <_>6 1 1 3 2. + 0 + 7.4075913289561868e-005 + 0.4069635868072510 + 0.5362150073051453 + <_> + + <_> + + + + <_>10 7 6 1 -1. + <_>12 7 2 1 3. + 0 + -5.0593802006915212e-004 + 0.5506706237792969 + 0.4374594092369080 + <_> + + <_> + + + + <_>3 1 2 10 -1. + <_>3 1 1 5 2. + <_>4 6 1 5 2. + 0 + -8.2131777890026569e-004 + 0.5525709986686707 + 0.4209375977516174 + <_> + + <_> + + + + <_>13 7 2 1 -1. + <_>13 7 1 1 2. + 0 + -6.0276539443293586e-005 + 0.5455474853515625 + 0.4748266041278839 + <_> + + <_> + + + + <_>4 13 4 6 -1. + <_>4 15 4 2 3. + 0 + 6.8065142259001732e-003 + 0.5157995820045471 + 0.3424577116966248 + <_> + + <_> + + + + <_>13 7 2 1 -1. + <_>13 7 1 1 2. + 0 + 1.7202789895236492e-003 + 0.5013207793235779 + 0.6331263780593872 + <_> + + <_> + + + + <_>5 7 2 1 -1. + <_>6 7 1 1 2. + 0 + -1.3016929733566940e-004 + 0.5539718270301819 + 0.4226869940757752 + <_> + + <_> + + + + <_>2 12 18 4 -1. + <_>11 12 9 2 2. + <_>2 14 9 2 2. + 0 + -4.8016388900578022e-003 + 0.4425095021724701 + 0.5430780053138733 + <_> + + <_> + + + + <_>5 7 2 2 -1. + <_>5 7 1 1 2. + <_>6 8 1 1 2. + 0 + -2.5399310979992151e-003 + 0.7145782113075256 + 0.4697605073451996 + <_> + + <_> + + + + <_>16 3 4 2 -1. + <_>16 4 4 1 2. + 0 + -1.4278929447755218e-003 + 0.4070445001125336 + 0.5399605035781860 + <_> + + <_> + + + + <_>0 2 2 18 -1. + <_>0 2 1 9 2. + <_>1 11 1 9 2. + 0 + -0.0251425504684448 + 0.7884690761566162 + 0.4747352004051209 + <_> + + <_> + + + + <_>1 2 18 4 -1. + <_>10 2 9 2 2. + <_>1 4 9 2 2. + 0 + -3.8899609353393316e-003 + 0.4296191930770874 + 0.5577110052108765 + <_> + + <_> + + + + <_>9 14 1 3 -1. + <_>9 15 1 1 3. + 0 + 4.3947459198534489e-003 + 0.4693162143230438 + 0.7023944258689880 + <_> + + <_> + + + + <_>2 12 18 4 -1. + <_>11 12 9 2 2. + <_>2 14 9 2 2. + 0 + 0.0246784202754498 + 0.5242322087287903 + 0.3812510073184967 + <_> + + <_> + + + + <_>0 12 18 4 -1. + <_>0 12 9 2 2. + <_>9 14 9 2 2. + 0 + 0.0380476787686348 + 0.5011739730834961 + 0.1687828004360199 + <_> + + <_> + + + + <_>11 4 5 3 -1. + <_>11 5 5 1 3. + 0 + 7.9424865543842316e-003 + 0.4828582108020783 + 0.6369568109512329 + <_> + + <_> + + + + <_>6 4 7 3 -1. + <_>6 5 7 1 3. + 0 + -1.5110049862414598e-003 + 0.5906485915184021 + 0.4487667977809906 + <_> + + <_> + + + + <_>13 17 3 3 -1. + <_>13 18 3 1 3. + 0 + 6.4201741479337215e-003 + 0.5241097807884216 + 0.2990570068359375 + <_> + + <_> + + + + <_>8 1 3 4 -1. + <_>9 1 1 4 3. + 0 + -2.9802159406244755e-003 + 0.3041465878486633 + 0.5078489780426025 + <_> + + <_> + + + + <_>11 4 2 4 -1. + <_>11 4 1 4 2. + 0 + -7.4580078944563866e-004 + 0.4128139019012451 + 0.5256826281547546 + <_> + + <_> + + + + <_>0 17 9 3 -1. + <_>3 17 3 3 3. + 0 + -0.0104709500446916 + 0.5808395147323608 + 0.4494296014308929 + <_> + + <_> + + + + <_>11 0 2 8 -1. + <_>12 0 1 4 2. + <_>11 4 1 4 2. + 0 + 9.3369204550981522e-003 + 0.5246552824974060 + 0.2658948898315430 + <_> + + <_> + + + + <_>0 8 6 12 -1. + <_>0 8 3 6 2. + <_>3 14 3 6 2. + 0 + 0.0279369000345469 + 0.4674955010414124 + 0.7087256908416748 + <_> + + <_> + + + + <_>10 7 4 12 -1. + <_>10 13 4 6 2. + 0 + 7.4277678504586220e-003 + 0.5409486889839172 + 0.3758518099784851 + <_> + + <_> + + + + <_>5 3 8 14 -1. + <_>5 10 8 7 2. + 0 + -0.0235845092684031 + 0.3758639991283417 + 0.5238550901412964 + <_> + + <_> + + + + <_>14 10 6 1 -1. + <_>14 10 3 1 2. + 0 + 1.1452640173956752e-003 + 0.4329578876495361 + 0.5804247260093689 + <_> + + <_> + + + + <_>0 4 10 4 -1. + <_>0 6 10 2 2. + 0 + -4.3468660442158580e-004 + 0.5280618071556091 + 0.3873069882392883 + <_> + + <_> + + + + <_>10 0 5 8 -1. + <_>10 4 5 4 2. + 0 + 0.0106485402211547 + 0.4902113080024719 + 0.5681251883506775 + <_> + + <_> + + + + <_>8 1 4 8 -1. + <_>8 1 2 4 2. + <_>10 5 2 4 2. + 0 + -3.9418050437234342e-004 + 0.5570880174636841 + 0.4318251013755798 + <_> + + <_> + + + + <_>9 11 6 1 -1. + <_>11 11 2 1 3. + 0 + -1.3270479394122958e-004 + 0.5658439993858337 + 0.4343554973602295 + <_> + + <_> + + + + <_>8 9 3 4 -1. + <_>9 9 1 4 3. + 0 + -2.0125510636717081e-003 + 0.6056739091873169 + 0.4537523984909058 + <_> + + <_> + + + + <_>18 4 2 6 -1. + <_>18 6 2 2 3. + 0 + 2.4854319635778666e-003 + 0.5390477180480957 + 0.4138010144233704 + <_> + + <_> + + + + <_>8 8 3 4 -1. + <_>9 8 1 4 3. + 0 + 1.8237880431115627e-003 + 0.4354828894138336 + 0.5717188715934753 + <_> + + <_> + + + + <_>7 1 13 3 -1. + <_>7 2 13 1 3. + 0 + -0.0166566595435143 + 0.3010913133621216 + 0.5216122865676880 + <_> + + <_> + + + + <_>7 13 6 1 -1. + <_>9 13 2 1 3. + 0 + 8.0349558265879750e-004 + 0.5300151109695435 + 0.3818396925926209 + <_> + + <_> + + + + <_>12 11 3 6 -1. + <_>12 13 3 2 3. + 0 + 3.4170378930866718e-003 + 0.5328028798103333 + 0.4241400063037872 + <_> + + <_> + + + + <_>5 11 6 1 -1. + <_>7 11 2 1 3. + 0 + -3.6222729249857366e-004 + 0.5491728186607361 + 0.4186977148056030 + <_> + + <_> + + + + <_>1 4 18 10 -1. + <_>10 4 9 5 2. + <_>1 9 9 5 2. + 0 + -0.1163002029061317 + 0.1440722048282623 + 0.5226451158523560 + <_> + + <_> + + + + <_>8 6 4 9 -1. + <_>8 9 4 3 3. + 0 + -0.0146950101479888 + 0.7747725248336792 + 0.4715717136859894 + <_> + + <_> + + + + <_>8 6 4 3 -1. + <_>8 7 4 1 3. + 0 + 2.1972130052745342e-003 + 0.5355433821678162 + 0.3315644860267639 + <_> + + <_> + + + + <_>8 7 3 3 -1. + <_>9 7 1 3 3. + 0 + -4.6965209185145795e-004 + 0.5767235159873962 + 0.4458136856555939 + <_> + + <_> + + + + <_>14 15 4 3 -1. + <_>14 16 4 1 3. + 0 + 6.5144998952746391e-003 + 0.5215674042701721 + 0.3647888898849487 + <_> + + <_> + + + + <_>5 10 3 10 -1. + <_>6 10 1 10 3. + 0 + 0.0213000606745481 + 0.4994204938411713 + 0.1567950993776321 + <_> + + <_> + + + + <_>8 15 4 3 -1. + <_>8 16 4 1 3. + 0 + 3.1881409231573343e-003 + 0.4742200076580048 + 0.6287270188331604 + <_> + + <_> + + + + <_>0 8 1 6 -1. + <_>0 10 1 2 3. + 0 + 9.0019777417182922e-004 + 0.5347954034805298 + 0.3943752050399780 + <_> + + <_> + + + + <_>10 15 1 3 -1. + <_>10 16 1 1 3. + 0 + -5.1772277802228928e-003 + 0.6727191805839539 + 0.5013138055801392 + <_> + + <_> + + + + <_>2 15 4 3 -1. + <_>2 16 4 1 3. + 0 + -4.3764649890363216e-003 + 0.3106675148010254 + 0.5128793120384216 + <_> + + <_> + + + + <_>18 3 2 8 -1. + <_>19 3 1 4 2. + <_>18 7 1 4 2. + 0 + 2.6299960445612669e-003 + 0.4886310100555420 + 0.5755215883255005 + <_> + + <_> + + + + <_>0 3 2 8 -1. + <_>0 3 1 4 2. + <_>1 7 1 4 2. + 0 + -2.0458688959479332e-003 + 0.6025794148445129 + 0.4558076858520508 + <_> + + <_> + + + + <_>3 7 14 10 -1. + <_>10 7 7 5 2. + <_>3 12 7 5 2. + 0 + 0.0694827064871788 + 0.5240747928619385 + 0.2185259014368057 + <_> + + <_> + + + + <_>0 7 19 3 -1. + <_>0 8 19 1 3. + 0 + 0.0240489393472672 + 0.5011867284774780 + 0.2090622037649155 + <_> + + <_> + + + + <_>12 6 3 3 -1. + <_>12 7 3 1 3. + 0 + 3.1095340382307768e-003 + 0.4866712093353272 + 0.7108548283576965 + <_> + + <_> + + + + <_>0 6 1 3 -1. + <_>0 7 1 1 3. + 0 + -1.2503260513767600e-003 + 0.3407891094684601 + 0.5156195163726807 + <_> + + <_> + + + + <_>12 6 3 3 -1. + <_>12 7 3 1 3. + 0 + -1.0281190043315291e-003 + 0.5575572252273560 + 0.4439432024955750 + <_> + + <_> + + + + <_>5 6 3 3 -1. + <_>5 7 3 1 3. + 0 + -8.8893622159957886e-003 + 0.6402000784873962 + 0.4620442092418671 + <_> + + <_> + + + + <_>8 2 4 2 -1. + <_>8 3 4 1 2. + 0 + -6.1094801640138030e-004 + 0.3766441941261292 + 0.5448899865150452 + <_> + + <_> + + + + <_>6 3 4 12 -1. + <_>8 3 2 12 2. + 0 + -5.7686357758939266e-003 + 0.3318648934364319 + 0.5133677124977112 + <_> + + <_> + + + + <_>13 6 2 3 -1. + <_>13 7 2 1 3. + 0 + 1.8506490159779787e-003 + 0.4903570115566254 + 0.6406934857368469 + <_> + + <_> + + + + <_>0 10 20 4 -1. + <_>0 12 20 2 2. + 0 + -0.0997994691133499 + 0.1536051034927368 + 0.5015562176704407 + <_> + + <_> + + + + <_>2 0 17 14 -1. + <_>2 7 17 7 2. + 0 + -0.3512834906578064 + 0.0588231310248375 + 0.5174378752708435 + <_> + + <_> + + + + <_>0 0 6 10 -1. + <_>0 0 3 5 2. + <_>3 5 3 5 2. + 0 + -0.0452445708215237 + 0.6961488723754883 + 0.4677872955799103 + <_> + + <_> + + + + <_>14 6 6 4 -1. + <_>14 6 3 4 2. + 0 + 0.0714815780520439 + 0.5167986154556274 + 0.1038092970848084 + <_> + + <_> + + + + <_>0 6 6 4 -1. + <_>3 6 3 4 2. + 0 + 2.1895780228078365e-003 + 0.4273078143596649 + 0.5532060861587524 + <_> + + <_> + + + + <_>13 2 7 2 -1. + <_>13 3 7 1 2. + 0 + -5.9242651332169771e-004 + 0.4638943970203400 + 0.5276389122009277 + <_> + + <_> + + + + <_>0 2 7 2 -1. + <_>0 3 7 1 2. + 0 + 1.6788389766588807e-003 + 0.5301648974418640 + 0.3932034969329834 + <_> + + <_> + + + + <_>6 11 14 2 -1. + <_>13 11 7 1 2. + <_>6 12 7 1 2. + 0 + -2.2163488902151585e-003 + 0.5630694031715393 + 0.4757033884525299 + <_> + + <_> + + + + <_>8 5 2 2 -1. + <_>8 5 1 1 2. + <_>9 6 1 1 2. + 0 + 1.1568699846975505e-004 + 0.4307535886764526 + 0.5535702705383301 + <_> + + <_> + + + + <_>13 9 2 3 -1. + <_>13 9 1 3 2. + 0 + -7.2017288766801357e-003 + 0.1444882005453110 + 0.5193064212799072 + <_> + + <_> + + + + <_>1 1 3 12 -1. + <_>2 1 1 12 3. + 0 + 8.9081272017210722e-004 + 0.4384432137012482 + 0.5593621134757996 + <_> + + <_> + + + + <_>17 4 1 3 -1. + <_>17 5 1 1 3. + 0 + 1.9605009583756328e-004 + 0.5340415835380554 + 0.4705956876277924 + <_> + + <_> + + + + <_>2 4 1 3 -1. + <_>2 5 1 1 3. + 0 + 5.2022142335772514e-004 + 0.5213856101036072 + 0.3810079097747803 + <_> + + <_> + + + + <_>14 5 1 3 -1. + <_>14 6 1 1 3. + 0 + 9.4588572392240167e-004 + 0.4769414961338043 + 0.6130738854408264 + <_> + + <_> + + + + <_>7 16 2 3 -1. + <_>7 17 2 1 3. + 0 + 9.1698471806012094e-005 + 0.4245009124279022 + 0.5429363250732422 + <_> + + <_> + + + + <_>8 13 4 6 -1. + <_>10 13 2 3 2. + <_>8 16 2 3 2. + 0 + 2.1833200007677078e-003 + 0.5457730889320374 + 0.4191075861454010 + <_> + + <_> + + + + <_>5 5 1 3 -1. + <_>5 6 1 1 3. + 0 + -8.6039671441540122e-004 + 0.5764588713645935 + 0.4471659958362579 + <_> + + <_> + + + + <_>16 0 4 20 -1. + <_>16 0 2 20 2. + 0 + -0.0132362395524979 + 0.6372823119163513 + 0.4695009887218475 + <_> + + <_> + + + + <_>5 1 2 6 -1. + <_>5 1 1 3 2. + <_>6 4 1 3 2. + 0 + 4.3376701069064438e-004 + 0.5317873954772949 + 0.3945829868316650 + 67.6989212036132810 + 14 + -1 + <_> + + + <_> + + <_> + + + + <_>5 4 10 4 -1. + <_>5 6 10 2 2. + 0 + -0.0248471498489380 + 0.6555516719818115 + 0.3873311877250671 + <_> + + <_> + + + + <_>15 2 4 12 -1. + <_>15 2 2 12 2. + 0 + 6.1348611488938332e-003 + 0.3748072087764740 + 0.5973997712135315 + <_> + + <_> + + + + <_>7 6 4 12 -1. + <_>7 12 4 6 2. + 0 + 6.4498498104512691e-003 + 0.5425491929054260 + 0.2548811137676239 + <_> + + <_> + + + + <_>14 5 1 8 -1. + <_>14 9 1 4 2. + 0 + 6.3491211039945483e-004 + 0.2462442070245743 + 0.5387253761291504 + <_> + + <_> + + + + <_>1 4 14 10 -1. + <_>1 4 7 5 2. + <_>8 9 7 5 2. + 0 + 1.4023890253156424e-003 + 0.5594322085380554 + 0.3528657853603363 + <_> + + <_> + + + + <_>11 6 6 14 -1. + <_>14 6 3 7 2. + <_>11 13 3 7 2. + 0 + 3.0044000595808029e-004 + 0.3958503901958466 + 0.5765938162803650 + <_> + + <_> + + + + <_>3 6 6 14 -1. + <_>3 6 3 7 2. + <_>6 13 3 7 2. + 0 + 1.0042409849120304e-004 + 0.3698996901512146 + 0.5534998178482056 + <_> + + <_> + + + + <_>4 9 15 2 -1. + <_>9 9 5 2 3. + 0 + -5.0841490738093853e-003 + 0.3711090981960297 + 0.5547800064086914 + <_> + + <_> + + + + <_>7 14 6 3 -1. + <_>7 15 6 1 3. + 0 + -0.0195372607558966 + 0.7492755055427551 + 0.4579297006130219 + <_> + + <_> + + + + <_>6 3 14 4 -1. + <_>13 3 7 2 2. + <_>6 5 7 2 2. + 0 + -7.4532740654831287e-006 + 0.5649787187576294 + 0.3904069960117340 + <_> + + <_> + + + + <_>1 9 15 2 -1. + <_>6 9 5 2 3. + 0 + -3.6079459823668003e-003 + 0.3381088078022003 + 0.5267801284790039 + <_> + + <_> + + + + <_>6 11 8 9 -1. + <_>6 14 8 3 3. + 0 + 2.0697501022368670e-003 + 0.5519291162490845 + 0.3714388906955719 + <_> + + <_> + + + + <_>7 4 3 8 -1. + <_>8 4 1 8 3. + 0 + -4.6463840408250690e-004 + 0.5608214735984802 + 0.4113566875457764 + <_> + + <_> + + + + <_>14 6 2 6 -1. + <_>14 9 2 3 2. + 0 + 7.5490452582016587e-004 + 0.3559206128120422 + 0.5329356193542481 + <_> + + <_> + + + + <_>5 7 6 4 -1. + <_>5 7 3 2 2. + <_>8 9 3 2 2. + 0 + -9.8322238773107529e-004 + 0.5414795875549316 + 0.3763205111026764 + <_> + + <_> + + + + <_>1 1 18 19 -1. + <_>7 1 6 19 3. + 0 + -0.0199406407773495 + 0.6347903013229370 + 0.4705299139022827 + <_> + + <_> + + + + <_>1 2 6 5 -1. + <_>4 2 3 5 2. + 0 + 3.7680300883948803e-003 + 0.3913489878177643 + 0.5563716292381287 + <_> + + <_> + + + + <_>12 17 6 2 -1. + <_>12 18 6 1 2. + 0 + -9.4528505578637123e-003 + 0.2554892897605896 + 0.5215116739273071 + <_> + + <_> + + + + <_>2 17 6 2 -1. + <_>2 18 6 1 2. + 0 + 2.9560849070549011e-003 + 0.5174679160118103 + 0.3063920140266419 + <_> + + <_> + + + + <_>17 3 3 6 -1. + <_>17 5 3 2 3. + 0 + 9.1078737750649452e-003 + 0.5388448238372803 + 0.2885963022708893 + <_> + + <_> + + + + <_>8 17 3 3 -1. + <_>8 18 3 1 3. + 0 + 1.8219229532405734e-003 + 0.4336043000221252 + 0.5852196812629700 + <_> + + <_> + + + + <_>10 13 2 6 -1. + <_>10 16 2 3 2. + 0 + 0.0146887395530939 + 0.5287361741065979 + 0.2870005965232849 + <_> + + <_> + + + + <_>7 13 6 3 -1. + <_>7 14 6 1 3. + 0 + -0.0143879903480411 + 0.7019448876380920 + 0.4647370874881744 + <_> + + <_> + + + + <_>17 3 3 6 -1. + <_>17 5 3 2 3. + 0 + -0.0189866498112679 + 0.2986552119255066 + 0.5247011780738831 + <_> + + <_> + + + + <_>8 13 2 3 -1. + <_>8 14 2 1 3. + 0 + 1.1527639580890536e-003 + 0.4323473870754242 + 0.5931661725044251 + <_> + + <_> + + + + <_>9 3 6 2 -1. + <_>11 3 2 2 3. + 0 + 0.0109336702153087 + 0.5286864042282105 + 0.3130319118499756 + <_> + + <_> + + + + <_>0 3 3 6 -1. + <_>0 5 3 2 3. + 0 + -0.0149327302351594 + 0.2658419013023377 + 0.5084077119827271 + <_> + + <_> + + + + <_>8 5 4 6 -1. + <_>8 7 4 2 3. + 0 + -2.9970539617352188e-004 + 0.5463526844978333 + 0.3740724027156830 + <_> + + <_> + + + + <_>5 5 3 2 -1. + <_>5 6 3 1 2. + 0 + 4.1677621193230152e-003 + 0.4703496992588043 + 0.7435721755027771 + <_> + + <_> + + + + <_>10 1 3 4 -1. + <_>11 1 1 4 3. + 0 + -6.3905320130288601e-003 + 0.2069258987903595 + 0.5280538201332092 + <_> + + <_> + + + + <_>1 2 5 9 -1. + <_>1 5 5 3 3. + 0 + 4.5029609464108944e-003 + 0.5182648897171021 + 0.3483543097972870 + <_> + + <_> + + + + <_>13 6 2 3 -1. + <_>13 7 2 1 3. + 0 + -9.2040365561842918e-003 + 0.6803777217864990 + 0.4932360053062439 + <_> + + <_> + + + + <_>0 6 14 3 -1. + <_>7 6 7 3 2. + 0 + 0.0813272595405579 + 0.5058398842811585 + 0.2253051996231079 + <_> + + <_> + + + + <_>2 11 18 8 -1. + <_>2 15 18 4 2. + 0 + -0.1507928073406220 + 0.2963424921035767 + 0.5264679789543152 + <_> + + <_> + + + + <_>5 6 2 3 -1. + <_>5 7 2 1 3. + 0 + 3.3179009333252907e-003 + 0.4655495882034302 + 0.7072932124137878 + <_> + + <_> + + + + <_>10 6 4 2 -1. + <_>12 6 2 1 2. + <_>10 7 2 1 2. + 0 + 7.7402801252901554e-004 + 0.4780347943305969 + 0.5668237805366516 + <_> + + <_> + + + + <_>6 6 4 2 -1. + <_>6 6 2 1 2. + <_>8 7 2 1 2. + 0 + 6.8199541419744492e-004 + 0.4286996126174927 + 0.5722156763076782 + <_> + + <_> + + + + <_>10 1 3 4 -1. + <_>11 1 1 4 3. + 0 + 5.3671570494771004e-003 + 0.5299307107925415 + 0.3114621937274933 + <_> + + <_> + + + + <_>7 1 2 7 -1. + <_>8 1 1 7 2. + 0 + 9.7018666565418243e-005 + 0.3674638867378235 + 0.5269461870193481 + <_> + + <_> + + + + <_>4 2 15 14 -1. + <_>4 9 15 7 2. + 0 + -0.1253408938646317 + 0.2351492047309876 + 0.5245791077613831 + <_> + + <_> + + + + <_>8 7 3 2 -1. + <_>9 7 1 2 3. + 0 + -5.2516269497573376e-003 + 0.7115936875343323 + 0.4693767130374908 + <_> + + <_> + + + + <_>2 3 18 4 -1. + <_>11 3 9 2 2. + <_>2 5 9 2 2. + 0 + -7.8342109918594360e-003 + 0.4462651014328003 + 0.5409085750579834 + <_> + + <_> + + + + <_>9 7 2 2 -1. + <_>10 7 1 2 2. + 0 + -1.1310069821774960e-003 + 0.5945618748664856 + 0.4417662024497986 + <_> + + <_> + + + + <_>13 9 2 3 -1. + <_>13 9 1 3 2. + 0 + 1.7601120052859187e-003 + 0.5353249907493591 + 0.3973453044891357 + <_> + + <_> + + + + <_>5 2 6 2 -1. + <_>7 2 2 2 3. + 0 + -8.1581249833106995e-004 + 0.3760268092155457 + 0.5264726877212524 + <_> + + <_> + + + + <_>9 5 2 7 -1. + <_>9 5 1 7 2. + 0 + -3.8687589112669230e-003 + 0.6309912800788879 + 0.4749819934368134 + <_> + + <_> + + + + <_>5 9 2 3 -1. + <_>6 9 1 3 2. + 0 + 1.5207129763439298e-003 + 0.5230181813240051 + 0.3361223936080933 + <_> + + <_> + + + + <_>6 0 14 18 -1. + <_>6 9 14 9 2. + 0 + 0.5458673834800720 + 0.5167139768600464 + 0.1172635033726692 + <_> + + <_> + + + + <_>2 16 6 3 -1. + <_>2 17 6 1 3. + 0 + 0.0156501904129982 + 0.4979439079761505 + 0.1393294930458069 + <_> + + <_> + + + + <_>9 7 3 6 -1. + <_>10 7 1 6 3. + 0 + -0.0117318602278829 + 0.7129650712013245 + 0.4921196103096008 + <_> + + <_> + + + + <_>7 8 4 3 -1. + <_>7 9 4 1 3. + 0 + -6.1765122227370739e-003 + 0.2288102954626083 + 0.5049701929092407 + <_> + + <_> + + + + <_>7 12 6 3 -1. + <_>7 13 6 1 3. + 0 + 2.2457661107182503e-003 + 0.4632433950901032 + 0.6048725843429565 + <_> + + <_> + + + + <_>9 12 2 3 -1. + <_>9 13 2 1 3. + 0 + -5.1915869116783142e-003 + 0.6467421054840088 + 0.4602192938327789 + <_> + + <_> + + + + <_>7 12 6 2 -1. + <_>9 12 2 2 3. + 0 + -0.0238278806209564 + 0.1482000946998596 + 0.5226079225540161 + <_> + + <_> + + + + <_>5 11 4 6 -1. + <_>5 14 4 3 2. + 0 + 1.0284580057486892e-003 + 0.5135489106178284 + 0.3375957012176514 + <_> + + <_> + + + + <_>11 12 7 2 -1. + <_>11 13 7 1 2. + 0 + -0.0100788502022624 + 0.2740561068058014 + 0.5303567051887512 + <_> + + <_> + + + + <_>6 10 8 6 -1. + <_>6 10 4 3 2. + <_>10 13 4 3 2. + 0 + 2.6168930344283581e-003 + 0.5332670807838440 + 0.3972454071044922 + <_> + + <_> + + + + <_>11 10 3 4 -1. + <_>11 12 3 2 2. + 0 + 5.4385367548093200e-004 + 0.5365604162216187 + 0.4063411951065064 + <_> + + <_> + + + + <_>9 16 2 3 -1. + <_>9 17 2 1 3. + 0 + 5.3510512225329876e-003 + 0.4653759002685547 + 0.6889045834541321 + <_> + + <_> + + + + <_>13 3 1 9 -1. + <_>13 6 1 3 3. + 0 + -1.5274790348485112e-003 + 0.5449501276016235 + 0.3624723851680756 + <_> + + <_> + + + + <_>1 13 14 6 -1. + <_>1 15 14 2 3. + 0 + -0.0806244164705276 + 0.1656087040901184 + 0.5000287294387817 + <_> + + <_> + + + + <_>13 6 1 6 -1. + <_>13 9 1 3 2. + 0 + 0.0221920292824507 + 0.5132731199264526 + 0.2002808004617691 + <_> + + <_> + + + + <_>0 4 3 8 -1. + <_>1 4 1 8 3. + 0 + 7.3100631125271320e-003 + 0.4617947936058044 + 0.6366536021232605 + <_> + + <_> + + + + <_>18 0 2 18 -1. + <_>18 0 1 18 2. + 0 + -6.4063072204589844e-003 + 0.5916250944137573 + 0.4867860972881317 + <_> + + <_> + + + + <_>2 3 6 2 -1. + <_>2 4 6 1 2. + 0 + -7.6415040530264378e-004 + 0.3888409137725830 + 0.5315797924995422 + <_> + + <_> + + + + <_>9 0 8 6 -1. + <_>9 2 8 2 3. + 0 + 7.6734489994123578e-004 + 0.4159064888954163 + 0.5605279803276062 + <_> + + <_> + + + + <_>6 6 1 6 -1. + <_>6 9 1 3 2. + 0 + 6.1474501853808761e-004 + 0.3089022040367127 + 0.5120148062705994 + <_> + + <_> + + + + <_>14 8 6 3 -1. + <_>14 9 6 1 3. + 0 + -5.0105270929634571e-003 + 0.3972199857234955 + 0.5207306146621704 + <_> + + <_> + + + + <_>0 0 2 18 -1. + <_>1 0 1 18 2. + 0 + -8.6909132078289986e-003 + 0.6257408261299133 + 0.4608575999736786 + <_> + + <_> + + + + <_>1 18 18 2 -1. + <_>10 18 9 1 2. + <_>1 19 9 1 2. + 0 + -0.0163914598524570 + 0.2085209935903549 + 0.5242266058921814 + <_> + + <_> + + + + <_>3 15 2 2 -1. + <_>3 16 2 1 2. + 0 + 4.0973909199237823e-004 + 0.5222427248954773 + 0.3780320882797241 + <_> + + <_> + + + + <_>8 14 5 3 -1. + <_>8 15 5 1 3. + 0 + -2.5242289993911982e-003 + 0.5803927183151245 + 0.4611890017986298 + <_> + + <_> + + + + <_>8 14 2 3 -1. + <_>8 15 2 1 3. + 0 + 5.0945312250405550e-004 + 0.4401271939277649 + 0.5846015810966492 + <_> + + <_> + + + + <_>12 3 3 3 -1. + <_>13 3 1 3 3. + 0 + 1.9656419754028320e-003 + 0.5322325229644775 + 0.4184590876102448 + <_> + + <_> + + + + <_>7 5 6 2 -1. + <_>9 5 2 2 3. + 0 + 5.6298897834494710e-004 + 0.3741844892501831 + 0.5234565734863281 + <_> + + <_> + + + + <_>15 5 5 2 -1. + <_>15 6 5 1 2. + 0 + -6.7946797935292125e-004 + 0.4631041884422302 + 0.5356478095054627 + <_> + + <_> + + + + <_>0 5 5 2 -1. + <_>0 6 5 1 2. + 0 + 7.2856349870562553e-003 + 0.5044670104980469 + 0.2377564013004303 + <_> + + <_> + + + + <_>17 14 1 6 -1. + <_>17 17 1 3 2. + 0 + -0.0174594894051552 + 0.7289121150970459 + 0.5050435066223145 + <_> + + <_> + + + + <_>2 9 9 3 -1. + <_>5 9 3 3 3. + 0 + -0.0254217498004436 + 0.6667134761810303 + 0.4678100049495697 + <_> + + <_> + + + + <_>12 3 3 3 -1. + <_>13 3 1 3 3. + 0 + -1.5647639520466328e-003 + 0.4391759037971497 + 0.5323626995086670 + <_> + + <_> + + + + <_>0 0 4 18 -1. + <_>2 0 2 18 2. + 0 + 0.0114443600177765 + 0.4346440136432648 + 0.5680012106895447 + <_> + + <_> + + + + <_>17 6 1 3 -1. + <_>17 7 1 1 3. + 0 + -6.7352550104260445e-004 + 0.4477140903472900 + 0.5296812057495117 + <_> + + <_> + + + + <_>2 14 1 6 -1. + <_>2 17 1 3 2. + 0 + 9.3194209039211273e-003 + 0.4740200042724609 + 0.7462607026100159 + <_> + + <_> + + + + <_>19 8 1 2 -1. + <_>19 9 1 1 2. + 0 + 1.3328490604180843e-004 + 0.5365061759948731 + 0.4752134978771210 + <_> + + <_> + + + + <_>5 3 3 3 -1. + <_>6 3 1 3 3. + 0 + -7.8815799206495285e-003 + 0.1752219051122665 + 0.5015255212783814 + <_> + + <_> + + + + <_>9 16 2 3 -1. + <_>9 17 2 1 3. + 0 + -5.7985680177807808e-003 + 0.7271236777305603 + 0.4896200895309448 + <_> + + <_> + + + + <_>2 6 1 3 -1. + <_>2 7 1 1 3. + 0 + -3.8922499516047537e-004 + 0.4003908932209015 + 0.5344941020011902 + <_> + + <_> + + + + <_>12 4 8 2 -1. + <_>16 4 4 1 2. + <_>12 5 4 1 2. + 0 + -1.9288610201328993e-003 + 0.5605612993240356 + 0.4803955852985382 + <_> + + <_> + + + + <_>0 4 8 2 -1. + <_>0 4 4 1 2. + <_>4 5 4 1 2. + 0 + 8.4214154630899429e-003 + 0.4753246903419495 + 0.7623608708381653 + <_> + + <_> + + + + <_>2 16 18 4 -1. + <_>2 18 18 2 2. + 0 + 8.1655876711010933e-003 + 0.5393261909484863 + 0.4191643893718720 + <_> + + <_> + + + + <_>7 15 2 4 -1. + <_>7 17 2 2 2. + 0 + 4.8280550981871784e-004 + 0.4240800142288208 + 0.5399821996688843 + <_> + + <_> + + + + <_>4 0 14 3 -1. + <_>4 1 14 1 3. + 0 + -2.7186630759388208e-003 + 0.4244599938392639 + 0.5424923896789551 + <_> + + <_> + + + + <_>0 0 4 20 -1. + <_>2 0 2 20 2. + 0 + -0.0125072300434113 + 0.5895841717720032 + 0.4550411105155945 + <_> + + <_> + + + + <_>12 4 4 8 -1. + <_>14 4 2 4 2. + <_>12 8 2 4 2. + 0 + -0.0242865197360516 + 0.2647134959697723 + 0.5189179778099060 + <_> + + <_> + + + + <_>6 7 2 2 -1. + <_>6 7 1 1 2. + <_>7 8 1 1 2. + 0 + -2.9676330741494894e-003 + 0.7347682714462280 + 0.4749749898910523 + <_> + + <_> + + + + <_>10 6 2 3 -1. + <_>10 7 2 1 3. + 0 + -0.0125289997085929 + 0.2756049931049347 + 0.5177599787712097 + <_> + + <_> + + + + <_>8 7 3 2 -1. + <_>8 8 3 1 2. + 0 + -1.0104000102728605e-003 + 0.3510560989379883 + 0.5144724249839783 + <_> + + <_> + + + + <_>8 2 6 12 -1. + <_>8 8 6 6 2. + 0 + -2.1348530426621437e-003 + 0.5637925863265991 + 0.4667319953441620 + <_> + + <_> + + + + <_>4 0 11 12 -1. + <_>4 4 11 4 3. + 0 + 0.0195642597973347 + 0.4614573121070862 + 0.6137639880180359 + <_> + + <_> + + + + <_>14 9 6 11 -1. + <_>16 9 2 11 3. + 0 + -0.0971463471651077 + 0.2998378872871399 + 0.5193555951118469 + <_> + + <_> + + + + <_>0 14 4 3 -1. + <_>0 15 4 1 3. + 0 + 4.5014568604528904e-003 + 0.5077884793281555 + 0.3045755922794342 + <_> + + <_> + + + + <_>9 10 2 3 -1. + <_>9 11 2 1 3. + 0 + 6.3706971704959869e-003 + 0.4861018955707550 + 0.6887500882148743 + <_> + + <_> + + + + <_>5 11 3 2 -1. + <_>5 12 3 1 2. + 0 + -9.0721528977155685e-003 + 0.1673395931720734 + 0.5017563104629517 + <_> + + <_> + + + + <_>9 15 3 3 -1. + <_>10 15 1 3 3. + 0 + -5.3537208586931229e-003 + 0.2692756950855255 + 0.5242633223533630 + <_> + + <_> + + + + <_>8 8 3 4 -1. + <_>9 8 1 4 3. + 0 + -0.0109328404068947 + 0.7183864116668701 + 0.4736028909683228 + <_> + + <_> + + + + <_>9 15 3 3 -1. + <_>10 15 1 3 3. + 0 + 8.2356072962284088e-003 + 0.5223966836929321 + 0.2389862984418869 + <_> + + <_> + + + + <_>7 7 3 2 -1. + <_>8 7 1 2 3. + 0 + -1.0038160253316164e-003 + 0.5719355940818787 + 0.4433943033218384 + <_> + + <_> + + + + <_>2 10 16 4 -1. + <_>10 10 8 2 2. + <_>2 12 8 2 2. + 0 + 4.0859128348529339e-003 + 0.5472841858863831 + 0.4148836135864258 + <_> + + <_> + + + + <_>2 3 4 17 -1. + <_>4 3 2 17 2. + 0 + 0.1548541933298111 + 0.4973812103271484 + 0.0610615983605385 + <_> + + <_> + + + + <_>15 13 2 7 -1. + <_>15 13 1 7 2. + 0 + 2.0897459762636572e-004 + 0.4709174036979675 + 0.5423889160156250 + <_> + + <_> + + + + <_>2 2 6 1 -1. + <_>5 2 3 1 2. + 0 + 3.3316991175524890e-004 + 0.4089626967906952 + 0.5300992131233215 + <_> + + <_> + + + + <_>5 2 12 4 -1. + <_>9 2 4 4 3. + 0 + -0.0108134001493454 + 0.6104369759559631 + 0.4957334101200104 + <_> + + <_> + + + + <_>6 0 8 12 -1. + <_>6 0 4 6 2. + <_>10 6 4 6 2. + 0 + 0.0456560105085373 + 0.5069689154624939 + 0.2866660058498383 + <_> + + <_> + + + + <_>13 7 2 2 -1. + <_>14 7 1 1 2. + <_>13 8 1 1 2. + 0 + 1.2569549726322293e-003 + 0.4846917092800140 + 0.6318171024322510 + <_> + + <_> + + + + <_>0 12 20 6 -1. + <_>0 14 20 2 3. + 0 + -0.1201507002115250 + 0.0605261400341988 + 0.4980959892272949 + <_> + + <_> + + + + <_>14 7 2 3 -1. + <_>14 7 1 3 2. + 0 + -1.0533799650147557e-004 + 0.5363109707832336 + 0.4708042144775391 + <_> + + <_> + + + + <_>0 8 9 12 -1. + <_>3 8 3 12 3. + 0 + -0.2070319056510925 + 0.0596603304147720 + 0.4979098141193390 + <_> + + <_> + + + + <_>3 0 16 2 -1. + <_>3 0 8 2 2. + 0 + 1.2909180077258497e-004 + 0.4712977111339569 + 0.5377997756004334 + <_> + + <_> + + + + <_>6 15 3 3 -1. + <_>6 16 3 1 3. + 0 + 3.8818528992123902e-004 + 0.4363538026809692 + 0.5534191131591797 + <_> + + <_> + + + + <_>8 15 6 3 -1. + <_>8 16 6 1 3. + 0 + -2.9243610333651304e-003 + 0.5811185836791992 + 0.4825215935707092 + <_> + + <_> + + + + <_>0 10 1 6 -1. + <_>0 12 1 2 3. + 0 + 8.3882332546636462e-004 + 0.5311700105667114 + 0.4038138985633850 + <_> + + <_> + + + + <_>10 9 4 3 -1. + <_>10 10 4 1 3. + 0 + -1.9061550265178084e-003 + 0.3770701885223389 + 0.5260015130043030 + <_> + + <_> + + + + <_>9 15 2 3 -1. + <_>9 16 2 1 3. + 0 + 8.9514348655939102e-003 + 0.4766167998313904 + 0.7682183980941773 + <_> + + <_> + + + + <_>5 7 10 1 -1. + <_>5 7 5 1 2. + 0 + 0.0130834598094225 + 0.5264462828636169 + 0.3062222003936768 + <_> + + <_> + + + + <_>4 0 12 19 -1. + <_>10 0 6 19 2. + 0 + -0.2115933001041412 + 0.6737198233604431 + 0.4695810079574585 + <_> + + <_> + + + + <_>0 6 20 6 -1. + <_>10 6 10 3 2. + <_>0 9 10 3 2. + 0 + 3.1493250280618668e-003 + 0.5644835233688355 + 0.4386953115463257 + <_> + + <_> + + + + <_>3 6 2 2 -1. + <_>3 6 1 1 2. + <_>4 7 1 1 2. + 0 + 3.9754100725986063e-004 + 0.4526061117649078 + 0.5895630121231079 + <_> + + <_> + + + + <_>15 6 2 2 -1. + <_>16 6 1 1 2. + <_>15 7 1 1 2. + 0 + -1.3814480043947697e-003 + 0.6070582270622253 + 0.4942413866519928 + <_> + + <_> + + + + <_>3 6 2 2 -1. + <_>3 6 1 1 2. + <_>4 7 1 1 2. + 0 + -5.8122188784182072e-004 + 0.5998213291168213 + 0.4508252143859863 + <_> + + <_> + + + + <_>14 4 1 12 -1. + <_>14 10 1 6 2. + 0 + -2.3905329871922731e-003 + 0.4205588996410370 + 0.5223848223686218 + <_> + + <_> + + + + <_>2 5 16 10 -1. + <_>2 5 8 5 2. + <_>10 10 8 5 2. + 0 + 0.0272689294070005 + 0.5206447243690491 + 0.3563301861286163 + <_> + + <_> + + + + <_>9 17 3 2 -1. + <_>10 17 1 2 3. + 0 + -3.7658358924090862e-003 + 0.3144704103469849 + 0.5218814015388489 + <_> + + <_> + + + + <_>1 4 2 2 -1. + <_>1 5 2 1 2. + 0 + -1.4903489500284195e-003 + 0.3380196094512940 + 0.5124437212944031 + <_> + + <_> + + + + <_>5 0 15 5 -1. + <_>10 0 5 5 3. + 0 + -0.0174282304942608 + 0.5829960703849793 + 0.4919725954532623 + <_> + + <_> + + + + <_>0 0 15 5 -1. + <_>5 0 5 5 3. + 0 + -0.0152780301868916 + 0.6163144707679749 + 0.4617887139320374 + <_> + + <_> + + + + <_>11 2 2 17 -1. + <_>11 2 1 17 2. + 0 + 0.0319956094026566 + 0.5166357159614563 + 0.1712764054536820 + <_> + + <_> + + + + <_>7 2 2 17 -1. + <_>8 2 1 17 2. + 0 + -3.8256710395216942e-003 + 0.3408012092113495 + 0.5131387710571289 + <_> + + <_> + + + + <_>15 11 2 9 -1. + <_>15 11 1 9 2. + 0 + -8.5186436772346497e-003 + 0.6105518937110901 + 0.4997941851615906 + <_> + + <_> + + + + <_>3 11 2 9 -1. + <_>4 11 1 9 2. + 0 + 9.0641621500253677e-004 + 0.4327270984649658 + 0.5582311153411865 + <_> + + <_> + + + + <_>5 16 14 4 -1. + <_>5 16 7 4 2. + 0 + 0.0103448498994112 + 0.4855653047561646 + 0.5452420115470886 + 69.2298736572265630 + 15 + -1 + <_> + + + <_> + + <_> + + + + <_>1 4 18 1 -1. + <_>7 4 6 1 3. + 0 + 7.8981826081871986e-003 + 0.3332524895668030 + 0.5946462154388428 + <_> + + <_> + + + + <_>13 7 6 4 -1. + <_>16 7 3 2 2. + <_>13 9 3 2 2. + 0 + 1.6170160379260778e-003 + 0.3490641117095947 + 0.5577868819236755 + <_> + + <_> + + + + <_>9 8 2 12 -1. + <_>9 12 2 4 3. + 0 + -5.5449741194024682e-004 + 0.5542566180229187 + 0.3291530013084412 + <_> + + <_> + + + + <_>12 1 6 6 -1. + <_>12 3 6 2 3. + 0 + 1.5428980113938451e-003 + 0.3612579107284546 + 0.5545979142189026 + <_> + + <_> + + + + <_>5 2 6 6 -1. + <_>5 2 3 3 2. + <_>8 5 3 3 2. + 0 + -1.0329450014978647e-003 + 0.3530139029026032 + 0.5576140284538269 + <_> + + <_> + + + + <_>9 16 6 4 -1. + <_>12 16 3 2 2. + <_>9 18 3 2 2. + 0 + 7.7698158565908670e-004 + 0.3916778862476349 + 0.5645321011543274 + <_> + + <_> + + + + <_>1 2 18 3 -1. + <_>7 2 6 3 3. + 0 + 0.1432030051946640 + 0.4667482078075409 + 0.7023633122444153 + <_> + + <_> + + + + <_>7 4 9 10 -1. + <_>7 9 9 5 2. + 0 + -7.3866490274667740e-003 + 0.3073684871196747 + 0.5289257764816284 + <_> + + <_> + + + + <_>5 9 4 4 -1. + <_>7 9 2 4 2. + 0 + -6.2936742324382067e-004 + 0.5622118115425110 + 0.4037049114704132 + <_> + + <_> + + + + <_>11 10 3 6 -1. + <_>11 13 3 3 2. + 0 + 7.8893528552725911e-004 + 0.5267661213874817 + 0.3557874858379364 + <_> + + <_> + + + + <_>7 11 5 3 -1. + <_>7 12 5 1 3. + 0 + -0.0122280502691865 + 0.6668320894241333 + 0.4625549912452698 + <_> + + <_> + + + + <_>7 11 6 6 -1. + <_>10 11 3 3 2. + <_>7 14 3 3 2. + 0 + 3.5420239437371492e-003 + 0.5521438121795654 + 0.3869673013687134 + <_> + + <_> + + + + <_>0 0 10 9 -1. + <_>0 3 10 3 3. + 0 + -1.0585320414975286e-003 + 0.3628678023815155 + 0.5320926904678345 + <_> + + <_> + + + + <_>13 14 1 6 -1. + <_>13 16 1 2 3. + 0 + 1.4935660146875307e-005 + 0.4632444977760315 + 0.5363323092460632 + <_> + + <_> + + + + <_>0 2 3 6 -1. + <_>0 4 3 2 3. + 0 + 5.2537708543241024e-003 + 0.5132231712341309 + 0.3265708982944489 + <_> + + <_> + + + + <_>8 14 4 3 -1. + <_>8 15 4 1 3. + 0 + -8.2338023930788040e-003 + 0.6693689823150635 + 0.4774140119552612 + <_> + + <_> + + + + <_>6 14 1 6 -1. + <_>6 16 1 2 3. + 0 + 2.1866810129722580e-005 + 0.4053862094879150 + 0.5457931160926819 + <_> + + <_> + + + + <_>9 15 2 3 -1. + <_>9 16 2 1 3. + 0 + -3.8150229956954718e-003 + 0.6454995870590210 + 0.4793178141117096 + <_> + + <_> + + + + <_>6 4 3 3 -1. + <_>7 4 1 3 3. + 0 + 1.1105879675596952e-003 + 0.5270407199859619 + 0.3529678881168366 + <_> + + <_> + + + + <_>9 0 11 3 -1. + <_>9 1 11 1 3. + 0 + -5.7707689702510834e-003 + 0.3803547024726868 + 0.5352957844734192 + <_> + + <_> + + + + <_>0 6 20 3 -1. + <_>0 7 20 1 3. + 0 + -3.0158339068293571e-003 + 0.5339403152465820 + 0.3887133002281189 + <_> + + <_> + + + + <_>10 1 1 2 -1. + <_>10 2 1 1 2. + 0 + -8.5453689098358154e-004 + 0.3564616143703461 + 0.5273603796958923 + <_> + + <_> + + + + <_>9 6 2 6 -1. + <_>10 6 1 6 2. + 0 + 0.0110505102202296 + 0.4671907126903534 + 0.6849737763404846 + <_> + + <_> + + + + <_>5 8 12 1 -1. + <_>9 8 4 1 3. + 0 + 0.0426058396697044 + 0.5151473283767700 + 0.0702200904488564 + <_> + + <_> + + + + <_>3 8 12 1 -1. + <_>7 8 4 1 3. + 0 + -3.0781750101596117e-003 + 0.3041661083698273 + 0.5152602195739746 + <_> + + <_> + + + + <_>9 7 3 5 -1. + <_>10 7 1 5 3. + 0 + -5.4815728217363358e-003 + 0.6430295705795288 + 0.4897229969501495 + <_> + + <_> + + + + <_>3 9 6 2 -1. + <_>6 9 3 2 2. + 0 + 3.1881860923022032e-003 + 0.5307493209838867 + 0.3826209902763367 + <_> + + <_> + + + + <_>12 9 3 3 -1. + <_>12 10 3 1 3. + 0 + 3.5947180003859103e-004 + 0.4650047123432159 + 0.5421904921531677 + <_> + + <_> + + + + <_>7 0 6 1 -1. + <_>9 0 2 1 3. + 0 + -4.0705031715333462e-003 + 0.2849679887294769 + 0.5079116225242615 + <_> + + <_> + + + + <_>12 9 3 3 -1. + <_>12 10 3 1 3. + 0 + -0.0145941702648997 + 0.2971645891666412 + 0.5128461718559265 + <_> + + <_> + + + + <_>7 10 2 1 -1. + <_>8 10 1 1 2. + 0 + -1.1947689927183092e-004 + 0.5631098151206970 + 0.4343082010746002 + <_> + + <_> + + + + <_>6 4 9 13 -1. + <_>9 4 3 13 3. + 0 + -6.9344649091362953e-004 + 0.4403578042984009 + 0.5359959006309509 + <_> + + <_> + + + + <_>6 8 4 2 -1. + <_>6 9 4 1 2. + 0 + 1.4834799912932795e-005 + 0.3421008884906769 + 0.5164697766304016 + <_> + + <_> + + + + <_>16 2 4 6 -1. + <_>16 2 2 6 2. + 0 + 9.0296985581517220e-003 + 0.4639343023300171 + 0.6114075183868408 + <_> + + <_> + + + + <_>0 17 6 3 -1. + <_>0 18 6 1 3. + 0 + -8.0640818923711777e-003 + 0.2820158898830414 + 0.5075494050979614 + <_> + + <_> + + + + <_>10 10 3 10 -1. + <_>10 15 3 5 2. + 0 + 0.0260621197521687 + 0.5208905935287476 + 0.2688778042793274 + <_> + + <_> + + + + <_>8 7 3 5 -1. + <_>9 7 1 5 3. + 0 + 0.0173146594315767 + 0.4663713872432709 + 0.6738539934158325 + <_> + + <_> + + + + <_>10 4 4 3 -1. + <_>10 4 2 3 2. + 0 + 0.0226666405797005 + 0.5209349989891052 + 0.2212723940610886 + <_> + + <_> + + + + <_>8 4 3 8 -1. + <_>9 4 1 8 3. + 0 + -2.1965929772704840e-003 + 0.6063101291656494 + 0.4538190066814423 + <_> + + <_> + + + + <_>6 6 9 13 -1. + <_>9 6 3 13 3. + 0 + -9.5282476395368576e-003 + 0.4635204970836639 + 0.5247430801391602 + <_> + + <_> + + + + <_>6 0 8 12 -1. + <_>6 0 4 6 2. + <_>10 6 4 6 2. + 0 + 8.0943619832396507e-003 + 0.5289440155029297 + 0.3913882076740265 + <_> + + <_> + + + + <_>14 2 6 8 -1. + <_>16 2 2 8 3. + 0 + -0.0728773325681686 + 0.7752001881599426 + 0.4990234971046448 + <_> + + <_> + + + + <_>6 0 3 6 -1. + <_>7 0 1 6 3. + 0 + -6.9009521976113319e-003 + 0.2428039014339447 + 0.5048090219497681 + <_> + + <_> + + + + <_>14 2 6 8 -1. + <_>16 2 2 8 3. + 0 + -0.0113082397729158 + 0.5734364986419678 + 0.4842376112937927 + <_> + + <_> + + + + <_>0 5 6 6 -1. + <_>0 8 6 3 2. + 0 + 0.0596132017672062 + 0.5029836297035217 + 0.2524977028369904 + <_> + + <_> + + + + <_>9 12 6 2 -1. + <_>12 12 3 1 2. + <_>9 13 3 1 2. + 0 + -2.8624620754271746e-003 + 0.6073045134544373 + 0.4898459911346436 + <_> + + <_> + + + + <_>8 17 3 2 -1. + <_>9 17 1 2 3. + 0 + 4.4781449250876904e-003 + 0.5015289187431335 + 0.2220316976308823 + <_> + + <_> + + + + <_>11 6 2 2 -1. + <_>12 6 1 1 2. + <_>11 7 1 1 2. + 0 + -1.7513240454718471e-003 + 0.6614428758621216 + 0.4933868944644928 + <_> + + <_> + + + + <_>1 9 18 2 -1. + <_>7 9 6 2 3. + 0 + 0.0401634201407433 + 0.5180878043174744 + 0.3741044998168945 + <_> + + <_> + + + + <_>11 6 2 2 -1. + <_>12 6 1 1 2. + <_>11 7 1 1 2. + 0 + 3.4768949262797832e-004 + 0.4720416963100433 + 0.5818032026290894 + <_> + + <_> + + + + <_>3 4 12 8 -1. + <_>7 4 4 8 3. + 0 + 2.6551650371402502e-003 + 0.3805010914802551 + 0.5221335887908936 + <_> + + <_> + + + + <_>13 11 5 3 -1. + <_>13 12 5 1 3. + 0 + -8.7706279009580612e-003 + 0.2944166064262390 + 0.5231295228004456 + <_> + + <_> + + + + <_>9 10 2 3 -1. + <_>9 11 2 1 3. + 0 + -5.5122091434895992e-003 + 0.7346177101135254 + 0.4722816944122315 + <_> + + <_> + + + + <_>14 7 2 3 -1. + <_>14 7 1 3 2. + 0 + 6.8672042107209563e-004 + 0.5452876091003418 + 0.4242413043975830 + <_> + + <_> + + + + <_>5 4 1 3 -1. + <_>5 5 1 1 3. + 0 + 5.6019669864326715e-004 + 0.4398862123489380 + 0.5601285099983215 + <_> + + <_> + + + + <_>13 4 2 3 -1. + <_>13 5 2 1 3. + 0 + 2.4143769405782223e-003 + 0.4741686880588532 + 0.6136621832847595 + <_> + + <_> + + + + <_>5 4 2 3 -1. + <_>5 5 2 1 3. + 0 + -1.5680900542065501e-003 + 0.6044552922248840 + 0.4516409933567047 + <_> + + <_> + + + + <_>9 8 2 3 -1. + <_>9 9 2 1 3. + 0 + -3.6827491130679846e-003 + 0.2452459037303925 + 0.5294982194900513 + <_> + + <_> + + + + <_>8 9 2 2 -1. + <_>8 10 2 1 2. + 0 + -2.9409190756268799e-004 + 0.3732838034629822 + 0.5251451134681702 + <_> + + <_> + + + + <_>15 14 1 4 -1. + <_>15 16 1 2 2. + 0 + 4.2847759323194623e-004 + 0.5498809814453125 + 0.4065535068511963 + <_> + + <_> + + + + <_>3 12 2 2 -1. + <_>3 13 2 1 2. + 0 + -4.8817070201039314e-003 + 0.2139908969402313 + 0.4999957084655762 + <_> + + <_> + + + + <_>12 15 2 2 -1. + <_>13 15 1 1 2. + <_>12 16 1 1 2. + 0 + 2.7272020815871656e-004 + 0.4650287032127380 + 0.5813428759574890 + <_> + + <_> + + + + <_>9 13 2 2 -1. + <_>9 14 2 1 2. + 0 + 2.0947199664078653e-004 + 0.4387486875057221 + 0.5572792887687683 + <_> + + <_> + + + + <_>4 11 14 9 -1. + <_>4 14 14 3 3. + 0 + 0.0485011897981167 + 0.5244972705841065 + 0.3212889134883881 + <_> + + <_> + + + + <_>7 13 4 3 -1. + <_>7 14 4 1 3. + 0 + -4.5166411437094212e-003 + 0.6056813001632690 + 0.4545882046222687 + <_> + + <_> + + + + <_>15 14 1 4 -1. + <_>15 16 1 2 2. + 0 + -0.0122916800901294 + 0.2040929049253464 + 0.5152214169502258 + <_> + + <_> + + + + <_>4 14 1 4 -1. + <_>4 16 1 2 2. + 0 + 4.8549679922871292e-004 + 0.5237604975700378 + 0.3739503026008606 + <_> + + <_> + + + + <_>14 0 6 13 -1. + <_>16 0 2 13 3. + 0 + 0.0305560491979122 + 0.4960533976554871 + 0.5938246250152588 + <_> + + <_> + + + + <_>4 1 2 12 -1. + <_>4 1 1 6 2. + <_>5 7 1 6 2. + 0 + -1.5105320198927075e-004 + 0.5351303815841675 + 0.4145204126834869 + <_> + + <_> + + + + <_>11 14 6 6 -1. + <_>14 14 3 3 2. + <_>11 17 3 3 2. + 0 + 2.4937440175563097e-003 + 0.4693366885185242 + 0.5514941215515137 + <_> + + <_> + + + + <_>3 14 6 6 -1. + <_>3 14 3 3 2. + <_>6 17 3 3 2. + 0 + -0.0123821301385760 + 0.6791396737098694 + 0.4681667983531952 + <_> + + <_> + + + + <_>14 17 3 2 -1. + <_>14 18 3 1 2. + 0 + -5.1333461888134480e-003 + 0.3608739078044891 + 0.5229160189628601 + <_> + + <_> + + + + <_>3 17 3 2 -1. + <_>3 18 3 1 2. + 0 + 5.1919277757406235e-004 + 0.5300073027610779 + 0.3633613884449005 + <_> + + <_> + + + + <_>14 0 6 13 -1. + <_>16 0 2 13 3. + 0 + 0.1506042033433914 + 0.5157316923141480 + 0.2211782038211823 + <_> + + <_> + + + + <_>0 0 6 13 -1. + <_>2 0 2 13 3. + 0 + 7.7144149690866470e-003 + 0.4410496950149536 + 0.5776609182357788 + <_> + + <_> + + + + <_>10 10 7 6 -1. + <_>10 12 7 2 3. + 0 + 9.4443522393703461e-003 + 0.5401855111122131 + 0.3756650090217590 + <_> + + <_> + + + + <_>6 15 2 2 -1. + <_>6 15 1 1 2. + <_>7 16 1 1 2. + 0 + 2.5006249779835343e-004 + 0.4368270933628082 + 0.5607374906539917 + <_> + + <_> + + + + <_>6 11 8 6 -1. + <_>10 11 4 3 2. + <_>6 14 4 3 2. + 0 + -3.3077150583267212e-003 + 0.4244799017906189 + 0.5518230795860291 + <_> + + <_> + + + + <_>7 6 2 2 -1. + <_>7 6 1 1 2. + <_>8 7 1 1 2. + 0 + 7.4048910755664110e-004 + 0.4496962130069733 + 0.5900576710700989 + <_> + + <_> + + + + <_>2 2 16 6 -1. + <_>10 2 8 3 2. + <_>2 5 8 3 2. + 0 + 0.0440920516848564 + 0.5293493270874023 + 0.3156355023384094 + <_> + + <_> + + + + <_>5 4 3 3 -1. + <_>5 5 3 1 3. + 0 + 3.3639909233897924e-003 + 0.4483296871185303 + 0.5848662257194519 + <_> + + <_> + + + + <_>11 7 3 10 -1. + <_>11 12 3 5 2. + 0 + -3.9760079234838486e-003 + 0.4559507071971893 + 0.5483639240264893 + <_> + + <_> + + + + <_>6 7 3 10 -1. + <_>6 12 3 5 2. + 0 + 2.7716930489987135e-003 + 0.5341786146163940 + 0.3792484104633331 + <_> + + <_> + + + + <_>10 7 3 2 -1. + <_>11 7 1 2 3. + 0 + -2.4123019829858094e-004 + 0.5667188763618469 + 0.4576973021030426 + <_> + + <_> + + + + <_>8 12 4 2 -1. + <_>8 13 4 1 2. + 0 + 4.9425667384639382e-004 + 0.4421244859695435 + 0.5628787279129028 + <_> + + <_> + + + + <_>10 1 1 3 -1. + <_>10 2 1 1 3. + 0 + -3.8876468897797167e-004 + 0.4288370907306671 + 0.5391063094139099 + <_> + + <_> + + + + <_>1 2 4 18 -1. + <_>1 2 2 9 2. + <_>3 11 2 9 2. + 0 + -0.0500488989055157 + 0.6899513006210327 + 0.4703742861747742 + <_> + + <_> + + + + <_>12 4 4 12 -1. + <_>12 10 4 6 2. + 0 + -0.0366354808211327 + 0.2217779010534287 + 0.5191826224327087 + <_> + + <_> + + + + <_>0 0 1 6 -1. + <_>0 2 1 2 3. + 0 + 2.4273579474538565e-003 + 0.5136224031448364 + 0.3497397899627686 + <_> + + <_> + + + + <_>9 11 2 3 -1. + <_>9 12 2 1 3. + 0 + 1.9558030180633068e-003 + 0.4826192855834961 + 0.6408380866050720 + <_> + + <_> + + + + <_>8 7 4 3 -1. + <_>8 8 4 1 3. + 0 + -1.7494610510766506e-003 + 0.3922835886478424 + 0.5272685289382935 + <_> + + <_> + + + + <_>10 7 3 2 -1. + <_>11 7 1 2 3. + 0 + 0.0139550799503922 + 0.5078201889991760 + 0.8416504859924316 + <_> + + <_> + + + + <_>7 7 3 2 -1. + <_>8 7 1 2 3. + 0 + -2.1896739781368524e-004 + 0.5520489811897278 + 0.4314234852790833 + <_> + + <_> + + + + <_>9 4 6 1 -1. + <_>11 4 2 1 3. + 0 + -1.5131309628486633e-003 + 0.3934605121612549 + 0.5382571220397949 + <_> + + <_> + + + + <_>8 7 2 3 -1. + <_>9 7 1 3 2. + 0 + -4.3622800149023533e-003 + 0.7370628714561462 + 0.4736475944519043 + <_> + + <_> + + + + <_>12 7 8 6 -1. + <_>16 7 4 3 2. + <_>12 10 4 3 2. + 0 + 0.0651605874300003 + 0.5159279704093933 + 0.3281595110893250 + <_> + + <_> + + + + <_>0 7 8 6 -1. + <_>0 7 4 3 2. + <_>4 10 4 3 2. + 0 + -2.3567399475723505e-003 + 0.3672826886177063 + 0.5172886252403259 + <_> + + <_> + + + + <_>18 2 2 10 -1. + <_>19 2 1 5 2. + <_>18 7 1 5 2. + 0 + 0.0151466596871614 + 0.5031493902206421 + 0.6687604188919067 + <_> + + <_> + + + + <_>0 2 6 4 -1. + <_>3 2 3 4 2. + 0 + -0.0228509604930878 + 0.6767519712448120 + 0.4709596931934357 + <_> + + <_> + + + + <_>9 4 6 1 -1. + <_>11 4 2 1 3. + 0 + 4.8867650330066681e-003 + 0.5257998108863831 + 0.4059878885746002 + <_> + + <_> + + + + <_>7 15 2 2 -1. + <_>7 15 1 1 2. + <_>8 16 1 1 2. + 0 + 1.7619599821045995e-003 + 0.4696272909641266 + 0.6688278913497925 + <_> + + <_> + + + + <_>11 13 1 6 -1. + <_>11 16 1 3 2. + 0 + -1.2942519970238209e-003 + 0.4320712983608246 + 0.5344281792640686 + <_> + + <_> + + + + <_>8 13 1 6 -1. + <_>8 16 1 3 2. + 0 + 0.0109299495816231 + 0.4997706115245819 + 0.1637486070394516 + <_> + + <_> + + + + <_>14 3 2 1 -1. + <_>14 3 1 1 2. + 0 + 2.9958489903947338e-005 + 0.4282417893409729 + 0.5633224248886108 + <_> + + <_> + + + + <_>8 15 2 3 -1. + <_>8 16 2 1 3. + 0 + -6.5884361974895000e-003 + 0.6772121191024780 + 0.4700526893138886 + <_> + + <_> + + + + <_>12 15 7 4 -1. + <_>12 17 7 2 2. + 0 + 3.2527779694646597e-003 + 0.5313397049903870 + 0.4536148905754089 + <_> + + <_> + + + + <_>4 14 12 3 -1. + <_>4 15 12 1 3. + 0 + -4.0435739792883396e-003 + 0.5660061836242676 + 0.4413388967514038 + <_> + + <_> + + + + <_>10 3 3 2 -1. + <_>11 3 1 2 3. + 0 + -1.2523540062829852e-003 + 0.3731913864612579 + 0.5356451869010925 + <_> + + <_> + + + + <_>4 12 2 2 -1. + <_>4 13 2 1 2. + 0 + 1.9246719602961093e-004 + 0.5189986228942871 + 0.3738811016082764 + <_> + + <_> + + + + <_>10 11 4 6 -1. + <_>10 14 4 3 2. + 0 + -0.0385896712541580 + 0.2956373989582062 + 0.5188810825347900 + <_> + + <_> + + + + <_>7 13 2 2 -1. + <_>7 13 1 1 2. + <_>8 14 1 1 2. + 0 + 1.5489870565943420e-004 + 0.4347135126590729 + 0.5509533286094666 + <_> + + <_> + + + + <_>4 11 14 4 -1. + <_>11 11 7 2 2. + <_>4 13 7 2 2. + 0 + -0.0337638482451439 + 0.3230330049991608 + 0.5195475816726685 + <_> + + <_> + + + + <_>1 18 18 2 -1. + <_>7 18 6 2 3. + 0 + -8.2657067105174065e-003 + 0.5975489020347595 + 0.4552114009857178 + <_> + + <_> + + + + <_>11 18 2 2 -1. + <_>12 18 1 1 2. + <_>11 19 1 1 2. + 0 + 1.4481440302915871e-005 + 0.4745678007602692 + 0.5497426986694336 + <_> + + <_> + + + + <_>7 18 2 2 -1. + <_>7 18 1 1 2. + <_>8 19 1 1 2. + 0 + 1.4951299817766994e-005 + 0.4324473142623901 + 0.5480644106864929 + <_> + + <_> + + + + <_>12 18 8 2 -1. + <_>12 19 8 1 2. + 0 + -0.0187417995184660 + 0.1580052971839905 + 0.5178533196449280 + <_> + + <_> + + + + <_>7 14 6 2 -1. + <_>7 15 6 1 2. + 0 + 1.7572239739820361e-003 + 0.4517636895179749 + 0.5773764252662659 + <_> + + <_> + + + + <_>8 12 4 8 -1. + <_>10 12 2 4 2. + <_>8 16 2 4 2. + 0 + -3.1391119118779898e-003 + 0.4149647951126099 + 0.5460842251777649 + <_> + + <_> + + + + <_>4 9 3 3 -1. + <_>4 10 3 1 3. + 0 + 6.6656779381446540e-005 + 0.4039090871810913 + 0.5293084979057312 + <_> + + <_> + + + + <_>7 10 6 2 -1. + <_>9 10 2 2 3. + 0 + 6.7743421532213688e-003 + 0.4767651855945587 + 0.6121956110000610 + <_> + + <_> + + + + <_>5 0 4 15 -1. + <_>7 0 2 15 2. + 0 + -7.3868161998689175e-003 + 0.3586258888244629 + 0.5187280774116516 + <_> + + <_> + + + + <_>8 6 12 14 -1. + <_>12 6 4 14 3. + 0 + 0.0140409301966429 + 0.4712139964103699 + 0.5576155781745911 + <_> + + <_> + + + + <_>5 16 3 3 -1. + <_>5 17 3 1 3. + 0 + -5.5258329957723618e-003 + 0.2661027014255524 + 0.5039281249046326 + <_> + + <_> + + + + <_>8 1 12 19 -1. + <_>12 1 4 19 3. + 0 + 0.3868423998355866 + 0.5144339799880981 + 0.2525899112224579 + <_> + + <_> + + + + <_>3 0 3 2 -1. + <_>3 1 3 1 2. + 0 + 1.1459240340627730e-004 + 0.4284994900226593 + 0.5423371195793152 + <_> + + <_> + + + + <_>10 12 4 5 -1. + <_>10 12 2 5 2. + 0 + -0.0184675697237253 + 0.3885835111141205 + 0.5213062167167664 + <_> + + <_> + + + + <_>6 12 4 5 -1. + <_>8 12 2 5 2. + 0 + -4.5907011372037232e-004 + 0.5412563085556030 + 0.4235909879207611 + <_> + + <_> + + + + <_>11 11 2 2 -1. + <_>12 11 1 1 2. + <_>11 12 1 1 2. + 0 + 1.2527540093287826e-003 + 0.4899305105209351 + 0.6624091267585754 + <_> + + <_> + + + + <_>0 2 3 6 -1. + <_>0 4 3 2 3. + 0 + 1.4910609461367130e-003 + 0.5286778211593628 + 0.4040051996707916 + <_> + + <_> + + + + <_>11 11 2 2 -1. + <_>12 11 1 1 2. + <_>11 12 1 1 2. + 0 + -7.5435562757775187e-004 + 0.6032990217208862 + 0.4795120060443878 + <_> + + <_> + + + + <_>7 6 4 10 -1. + <_>7 11 4 5 2. + 0 + -6.9478838704526424e-003 + 0.4084401130676270 + 0.5373504161834717 + <_> + + <_> + + + + <_>11 11 2 2 -1. + <_>12 11 1 1 2. + <_>11 12 1 1 2. + 0 + 2.8092920547351241e-004 + 0.4846062958240509 + 0.5759382247924805 + <_> + + <_> + + + + <_>2 13 5 2 -1. + <_>2 14 5 1 2. + 0 + 9.6073717577382922e-004 + 0.5164741277694702 + 0.3554979860782623 + <_> + + <_> + + + + <_>11 11 2 2 -1. + <_>12 11 1 1 2. + <_>11 12 1 1 2. + 0 + -2.6883929967880249e-004 + 0.5677582025527954 + 0.4731765985488892 + <_> + + <_> + + + + <_>7 11 2 2 -1. + <_>7 11 1 1 2. + <_>8 12 1 1 2. + 0 + 2.1599370520561934e-003 + 0.4731487035751343 + 0.7070567011833191 + <_> + + <_> + + + + <_>14 13 3 3 -1. + <_>14 14 3 1 3. + 0 + 5.6235301308333874e-003 + 0.5240243077278137 + 0.2781791985034943 + <_> + + <_> + + + + <_>3 13 3 3 -1. + <_>3 14 3 1 3. + 0 + -5.0243991427123547e-003 + 0.2837013900279999 + 0.5062304139137268 + <_> + + <_> + + + + <_>9 14 2 3 -1. + <_>9 15 2 1 3. + 0 + -9.7611639648675919e-003 + 0.7400717735290527 + 0.4934569001197815 + <_> + + <_> + + + + <_>8 7 3 3 -1. + <_>8 8 3 1 3. + 0 + 4.1515100747346878e-003 + 0.5119131207466126 + 0.3407008051872253 + <_> + + <_> + + + + <_>13 5 3 3 -1. + <_>13 6 3 1 3. + 0 + 6.2465080991387367e-003 + 0.4923788011074066 + 0.6579058766365051 + <_> + + <_> + + + + <_>0 9 5 3 -1. + <_>0 10 5 1 3. + 0 + -7.0597478188574314e-003 + 0.2434711009263992 + 0.5032842159271240 + <_> + + <_> + + + + <_>13 5 3 3 -1. + <_>13 6 3 1 3. + 0 + -2.0587709732353687e-003 + 0.5900310873985291 + 0.4695087075233460 + <_> + + <_> + + + + <_>9 12 2 8 -1. + <_>9 12 1 4 2. + <_>10 16 1 4 2. + 0 + -2.4146060459315777e-003 + 0.3647317886352539 + 0.5189201831817627 + <_> + + <_> + + + + <_>11 7 2 2 -1. + <_>12 7 1 1 2. + <_>11 8 1 1 2. + 0 + -1.4817609917372465e-003 + 0.6034948229789734 + 0.4940128028392792 + <_> + + <_> + + + + <_>0 16 6 4 -1. + <_>3 16 3 4 2. + 0 + -6.3016400672495365e-003 + 0.5818989872932434 + 0.4560427963733673 + <_> + + <_> + + + + <_>10 6 2 3 -1. + <_>10 7 2 1 3. + 0 + 3.4763428848236799e-003 + 0.5217475891113281 + 0.3483993113040924 + <_> + + <_> + + + + <_>9 5 2 6 -1. + <_>9 7 2 2 3. + 0 + -0.0222508702427149 + 0.2360700070858002 + 0.5032082796096802 + <_> + + <_> + + + + <_>12 15 8 4 -1. + <_>12 15 4 4 2. + 0 + -0.0306125506758690 + 0.6499186754226685 + 0.4914919137954712 + <_> + + <_> + + + + <_>0 14 8 6 -1. + <_>4 14 4 6 2. + 0 + 0.0130574796348810 + 0.4413323104381561 + 0.5683764219284058 + <_> + + <_> + + + + <_>9 0 3 2 -1. + <_>10 0 1 2 3. + 0 + -6.0095742810517550e-004 + 0.4359731078147888 + 0.5333483219146729 + <_> + + <_> + + + + <_>4 15 4 2 -1. + <_>6 15 2 2 2. + 0 + -4.1514250915497541e-004 + 0.5504062771797180 + 0.4326060116291046 + <_> + + <_> + + + + <_>12 7 3 13 -1. + <_>13 7 1 13 3. + 0 + -0.0137762902304530 + 0.4064112901687622 + 0.5201548933982849 + <_> + + <_> + + + + <_>5 7 3 13 -1. + <_>6 7 1 13 3. + 0 + -0.0322965085506439 + 0.0473519712686539 + 0.4977194964885712 + <_> + + <_> + + + + <_>9 6 3 9 -1. + <_>9 9 3 3 3. + 0 + 0.0535569787025452 + 0.4881733059883118 + 0.6666939258575440 + <_> + + <_> + + + + <_>4 4 7 12 -1. + <_>4 10 7 6 2. + 0 + 8.1889545544981956e-003 + 0.5400037169456482 + 0.4240820109844208 + <_> + + <_> + + + + <_>12 12 2 2 -1. + <_>13 12 1 1 2. + <_>12 13 1 1 2. + 0 + 2.1055320394225419e-004 + 0.4802047908306122 + 0.5563852787017822 + <_> + + <_> + + + + <_>6 12 2 2 -1. + <_>6 12 1 1 2. + <_>7 13 1 1 2. + 0 + -2.4382730480283499e-003 + 0.7387793064117432 + 0.4773685038089752 + <_> + + <_> + + + + <_>8 9 4 2 -1. + <_>10 9 2 1 2. + <_>8 10 2 1 2. + 0 + 3.2835570164024830e-003 + 0.5288546085357666 + 0.3171291947364807 + <_> + + <_> + + + + <_>3 6 2 2 -1. + <_>3 6 1 1 2. + <_>4 7 1 1 2. + 0 + 2.3729570675641298e-003 + 0.4750812947750092 + 0.7060170769691467 + <_> + + <_> + + + + <_>16 6 3 2 -1. + <_>16 7 3 1 2. + 0 + -1.4541699783876538e-003 + 0.3811730146408081 + 0.5330739021301270 + 79.2490768432617190 + 16 + -1 + <_> + + + <_> + + <_> + + + + <_>0 7 19 4 -1. + <_>0 9 19 2 2. + 0 + 0.0557552389800549 + 0.4019156992435455 + 0.6806036829948425 + <_> + + <_> + + + + <_>10 2 10 1 -1. + <_>10 2 5 1 2. + 0 + 2.4730248842388391e-003 + 0.3351148962974548 + 0.5965719819068909 + <_> + + <_> + + + + <_>9 4 2 12 -1. + <_>9 10 2 6 2. + 0 + -3.5031698644161224e-004 + 0.5557708144187927 + 0.3482286930084229 + <_> + + <_> + + + + <_>12 18 4 1 -1. + <_>12 18 2 1 2. + 0 + 5.4167630150914192e-004 + 0.4260858893394470 + 0.5693380832672119 + <_> + + <_> + + + + <_>1 7 6 4 -1. + <_>1 7 3 2 2. + <_>4 9 3 2 2. + 0 + 7.7193678589537740e-004 + 0.3494240045547485 + 0.5433688759803772 + <_> + + <_> + + + + <_>12 0 6 13 -1. + <_>14 0 2 13 3. + 0 + -1.5999219613149762e-003 + 0.4028499126434326 + 0.5484359264373779 + <_> + + <_> + + + + <_>2 0 6 13 -1. + <_>4 0 2 13 3. + 0 + -1.1832080053864047e-004 + 0.3806901872158051 + 0.5425465106964111 + <_> + + <_> + + + + <_>10 5 8 8 -1. + <_>10 9 8 4 2. + 0 + 3.2909031142480671e-004 + 0.2620100080966950 + 0.5429521799087524 + <_> + + <_> + + + + <_>8 3 2 5 -1. + <_>9 3 1 5 2. + 0 + 2.9518108931370080e-004 + 0.3799768984317780 + 0.5399264097213745 + <_> + + <_> + + + + <_>8 4 9 1 -1. + <_>11 4 3 1 3. + 0 + 9.0466710389591753e-005 + 0.4433645009994507 + 0.5440226197242737 + <_> + + <_> + + + + <_>3 4 9 1 -1. + <_>6 4 3 1 3. + 0 + 1.5007190086180344e-005 + 0.3719654977321625 + 0.5409119725227356 + <_> + + <_> + + + + <_>1 0 18 10 -1. + <_>7 0 6 10 3. + 0 + 0.1393561065196991 + 0.5525395870208740 + 0.4479042887687683 + <_> + + <_> + + + + <_>7 17 5 3 -1. + <_>7 18 5 1 3. + 0 + 1.6461990308016539e-003 + 0.4264501035213471 + 0.5772169828414917 + <_> + + <_> + + + + <_>7 11 6 1 -1. + <_>9 11 2 1 3. + 0 + 4.9984431825578213e-004 + 0.4359526038169861 + 0.5685871243476868 + <_> + + <_> + + + + <_>2 2 3 2 -1. + <_>2 3 3 1 2. + 0 + -1.0971280280500650e-003 + 0.3390136957168579 + 0.5205408930778503 + <_> + + <_> + + + + <_>8 12 4 2 -1. + <_>8 13 4 1 2. + 0 + 6.6919892560690641e-004 + 0.4557456076145172 + 0.5980659723281860 + <_> + + <_> + + + + <_>6 10 3 6 -1. + <_>6 13 3 3 2. + 0 + 8.6471042595803738e-004 + 0.5134841203689575 + 0.2944033145904541 + <_> + + <_> + + + + <_>11 4 2 4 -1. + <_>11 4 1 4 2. + 0 + -2.7182599296793342e-004 + 0.3906578123569489 + 0.5377181172370911 + <_> + + <_> + + + + <_>7 4 2 4 -1. + <_>8 4 1 4 2. + 0 + 3.0249499104684219e-005 + 0.3679609894752502 + 0.5225688815116882 + <_> + + <_> + + + + <_>9 6 2 4 -1. + <_>9 6 1 4 2. + 0 + -8.5225896909832954e-003 + 0.7293102145195007 + 0.4892365038394928 + <_> + + <_> + + + + <_>6 13 8 3 -1. + <_>6 14 8 1 3. + 0 + 1.6705560265108943e-003 + 0.4345324933528900 + 0.5696138143539429 + <_> + + <_> + + + + <_>9 15 3 4 -1. + <_>10 15 1 4 3. + 0 + -7.1433838456869125e-003 + 0.2591280043125153 + 0.5225623846054077 + <_> + + <_> + + + + <_>9 2 2 17 -1. + <_>10 2 1 17 2. + 0 + -0.0163193698972464 + 0.6922279000282288 + 0.4651575982570648 + <_> + + <_> + + + + <_>7 0 6 1 -1. + <_>9 0 2 1 3. + 0 + 4.8034260980784893e-003 + 0.5352262854576111 + 0.3286302983760834 + <_> + + <_> + + + + <_>8 15 3 4 -1. + <_>9 15 1 4 3. + 0 + -7.5421929359436035e-003 + 0.2040544003248215 + 0.5034546256065369 + <_> + + <_> + + + + <_>7 13 7 3 -1. + <_>7 14 7 1 3. + 0 + -0.0143631100654602 + 0.6804888844490051 + 0.4889059066772461 + <_> + + <_> + + + + <_>8 16 3 3 -1. + <_>9 16 1 3 3. + 0 + 8.9063588529825211e-004 + 0.5310695767402649 + 0.3895480930805206 + <_> + + <_> + + + + <_>6 2 8 10 -1. + <_>6 7 8 5 2. + 0 + -4.4060191139578819e-003 + 0.5741562843322754 + 0.4372426867485046 + <_> + + <_> + + + + <_>2 5 8 8 -1. + <_>2 9 8 4 2. + 0 + -1.8862540309783071e-004 + 0.2831785976886749 + 0.5098205208778381 + <_> + + <_> + + + + <_>14 16 2 2 -1. + <_>14 17 2 1 2. + 0 + -3.7979281041771173e-003 + 0.3372507989406586 + 0.5246580243110657 + <_> + + <_> + + + + <_>4 16 2 2 -1. + <_>4 17 2 1 2. + 0 + 1.4627049677073956e-004 + 0.5306674242019653 + 0.3911710083484650 + <_> + + <_> + + + + <_>10 11 4 6 -1. + <_>10 14 4 3 2. + 0 + -4.9164638767251745e-005 + 0.5462496280670166 + 0.3942720890045166 + <_> + + <_> + + + + <_>6 11 4 6 -1. + <_>6 14 4 3 2. + 0 + -0.0335825011134148 + 0.2157824039459229 + 0.5048211812973023 + <_> + + <_> + + + + <_>10 14 1 3 -1. + <_>10 15 1 1 3. + 0 + -3.5339309833943844e-003 + 0.6465312242507935 + 0.4872696995735169 + <_> + + <_> + + + + <_>8 14 4 3 -1. + <_>8 15 4 1 3. + 0 + 5.0144111737608910e-003 + 0.4617668092250824 + 0.6248074769973755 + <_> + + <_> + + + + <_>10 0 4 6 -1. + <_>12 0 2 3 2. + <_>10 3 2 3 2. + 0 + 0.0188173707574606 + 0.5220689177513123 + 0.2000052034854889 + <_> + + <_> + + + + <_>0 3 20 2 -1. + <_>0 4 20 1 2. + 0 + -1.3434339780360460e-003 + 0.4014537930488586 + 0.5301619768142700 + <_> + + <_> + + + + <_>12 0 8 2 -1. + <_>16 0 4 1 2. + <_>12 1 4 1 2. + 0 + 1.7557960236445069e-003 + 0.4794039130210877 + 0.5653169751167297 + <_> + + <_> + + + + <_>2 12 10 8 -1. + <_>2 16 10 4 2. + 0 + -0.0956374630331993 + 0.2034195065498352 + 0.5006706714630127 + <_> + + <_> + + + + <_>17 7 2 10 -1. + <_>18 7 1 5 2. + <_>17 12 1 5 2. + 0 + -0.0222412291914225 + 0.7672473192214966 + 0.5046340227127075 + <_> + + <_> + + + + <_>1 7 2 10 -1. + <_>1 7 1 5 2. + <_>2 12 1 5 2. + 0 + -0.0155758196488023 + 0.7490342259407044 + 0.4755851030349731 + <_> + + <_> + + + + <_>15 10 3 6 -1. + <_>15 12 3 2 3. + 0 + 5.3599118255078793e-003 + 0.5365303754806519 + 0.4004670977592468 + <_> + + <_> + + + + <_>4 4 6 2 -1. + <_>6 4 2 2 3. + 0 + -0.0217634998261929 + 0.0740154981613159 + 0.4964174926280975 + <_> + + <_> + + + + <_>0 5 20 6 -1. + <_>0 7 20 2 3. + 0 + -0.1656159013509750 + 0.2859103083610535 + 0.5218086242675781 + <_> + + <_> + + + + <_>0 0 8 2 -1. + <_>0 0 4 1 2. + <_>4 1 4 1 2. + 0 + 1.6461320046801120e-004 + 0.4191615879535675 + 0.5380793213844299 + <_> + + <_> + + + + <_>1 0 18 4 -1. + <_>7 0 6 4 3. + 0 + -8.9077502489089966e-003 + 0.6273192763328552 + 0.4877404868602753 + <_> + + <_> + + + + <_>1 13 6 2 -1. + <_>1 14 6 1 2. + 0 + 8.6346449097618461e-004 + 0.5159940719604492 + 0.3671025931835175 + <_> + + <_> + + + + <_>10 8 3 4 -1. + <_>11 8 1 4 3. + 0 + -1.3751760125160217e-003 + 0.5884376764297485 + 0.4579083919525147 + <_> + + <_> + + + + <_>6 1 6 1 -1. + <_>8 1 2 1 3. + 0 + -1.4081239933148026e-003 + 0.3560509979724884 + 0.5139945149421692 + <_> + + <_> + + + + <_>8 14 4 3 -1. + <_>8 15 4 1 3. + 0 + -3.9342888630926609e-003 + 0.5994288921356201 + 0.4664272069931030 + <_> + + <_> + + + + <_>1 6 18 2 -1. + <_>10 6 9 2 2. + 0 + -0.0319669283926487 + 0.3345462083816528 + 0.5144183039665222 + <_> + + <_> + + + + <_>15 11 1 2 -1. + <_>15 12 1 1 2. + 0 + -1.5089280168467667e-005 + 0.5582656264305115 + 0.4414057135581970 + <_> + + <_> + + + + <_>6 5 1 2 -1. + <_>6 6 1 1 2. + 0 + 5.1994470413774252e-004 + 0.4623680114746094 + 0.6168993711471558 + <_> + + <_> + + + + <_>13 4 1 3 -1. + <_>13 5 1 1 3. + 0 + -3.4220460802316666e-003 + 0.6557074785232544 + 0.4974805116653442 + <_> + + <_> + + + + <_>2 15 1 2 -1. + <_>2 16 1 1 2. + 0 + 1.7723299970384687e-004 + 0.5269501805305481 + 0.3901908099651337 + <_> + + <_> + + + + <_>12 4 4 3 -1. + <_>12 5 4 1 3. + 0 + 1.5716759953647852e-003 + 0.4633373022079468 + 0.5790457725524902 + <_> + + <_> + + + + <_>0 0 7 3 -1. + <_>0 1 7 1 3. + 0 + -8.9041329920291901e-003 + 0.2689608037471771 + 0.5053591132164002 + <_> + + <_> + + + + <_>9 12 6 2 -1. + <_>9 12 3 2 2. + 0 + 4.0677518700249493e-004 + 0.5456603169441223 + 0.4329898953437805 + <_> + + <_> + + + + <_>5 4 2 3 -1. + <_>5 5 2 1 3. + 0 + 6.7604780197143555e-003 + 0.4648993909358978 + 0.6689761877059937 + <_> + + <_> + + + + <_>18 4 2 3 -1. + <_>18 5 2 1 3. + 0 + 2.9100088868290186e-003 + 0.5309703946113586 + 0.3377839922904968 + <_> + + <_> + + + + <_>3 0 8 6 -1. + <_>3 2 8 2 3. + 0 + 1.3885459629818797e-003 + 0.4074738919734955 + 0.5349133014678955 + <_> + + <_> + + + + <_>0 2 20 6 -1. + <_>10 2 10 3 2. + <_>0 5 10 3 2. + 0 + -0.0767642632126808 + 0.1992176026105881 + 0.5228242278099060 + <_> + + <_> + + + + <_>4 7 2 4 -1. + <_>5 7 1 4 2. + 0 + -2.2688310127705336e-004 + 0.5438501834869385 + 0.4253072142601013 + <_> + + <_> + + + + <_>3 10 15 2 -1. + <_>8 10 5 2 3. + 0 + -6.3094152137637138e-003 + 0.4259178936481476 + 0.5378909707069397 + <_> + + <_> + + + + <_>3 0 12 11 -1. + <_>9 0 6 11 2. + 0 + -0.1100727990269661 + 0.6904156804084778 + 0.4721749126911163 + <_> + + <_> + + + + <_>13 0 2 6 -1. + <_>13 0 1 6 2. + 0 + 2.8619659133255482e-004 + 0.4524914920330048 + 0.5548306107521057 + <_> + + <_> + + + + <_>0 19 2 1 -1. + <_>1 19 1 1 2. + 0 + 2.9425329557852820e-005 + 0.5370373725891113 + 0.4236463904380798 + <_> + + <_> + + + + <_>16 10 4 10 -1. + <_>18 10 2 5 2. + <_>16 15 2 5 2. + 0 + -0.0248865708708763 + 0.6423557996749878 + 0.4969303905963898 + <_> + + <_> + + + + <_>4 8 10 3 -1. + <_>4 9 10 1 3. + 0 + 0.0331488512456417 + 0.4988475143909454 + 0.1613811999559403 + <_> + + <_> + + + + <_>14 12 3 3 -1. + <_>14 13 3 1 3. + 0 + 7.8491691965609789e-004 + 0.5416026115417481 + 0.4223009049892426 + <_> + + <_> + + + + <_>0 10 4 10 -1. + <_>0 10 2 5 2. + <_>2 15 2 5 2. + 0 + 4.7087189741432667e-003 + 0.4576328992843628 + 0.6027557849884033 + <_> + + <_> + + + + <_>18 3 2 6 -1. + <_>18 5 2 2 3. + 0 + 2.4144479539245367e-003 + 0.5308973193168640 + 0.4422498941421509 + <_> + + <_> + + + + <_>6 6 1 3 -1. + <_>6 7 1 1 3. + 0 + 1.9523180089890957e-003 + 0.4705634117126465 + 0.6663324832916260 + <_> + + <_> + + + + <_>7 7 7 2 -1. + <_>7 8 7 1 2. + 0 + 1.3031980488449335e-003 + 0.4406126141548157 + 0.5526962280273438 + <_> + + <_> + + + + <_>0 3 2 6 -1. + <_>0 5 2 2 3. + 0 + 4.4735497795045376e-003 + 0.5129023790359497 + 0.3301498889923096 + <_> + + <_> + + + + <_>11 1 3 1 -1. + <_>12 1 1 1 3. + 0 + -2.6652868837118149e-003 + 0.3135471045970917 + 0.5175036191940308 + <_> + + <_> + + + + <_>5 0 2 6 -1. + <_>6 0 1 6 2. + 0 + 1.3666770246345550e-004 + 0.4119370877742767 + 0.5306876897811890 + <_> + + <_> + + + + <_>1 1 18 14 -1. + <_>7 1 6 14 3. + 0 + -0.0171264503151178 + 0.6177806258201599 + 0.4836578965187073 + <_> + + <_> + + + + <_>4 6 8 3 -1. + <_>8 6 4 3 2. + 0 + -2.6601430727168918e-004 + 0.3654330968856812 + 0.5169736742973328 + <_> + + <_> + + + + <_>9 12 6 2 -1. + <_>9 12 3 2 2. + 0 + -0.0229323804378510 + 0.3490915000438690 + 0.5163992047309876 + <_> + + <_> + + + + <_>5 12 6 2 -1. + <_>8 12 3 2 2. + 0 + 2.3316550068557262e-003 + 0.5166299939155579 + 0.3709389865398407 + <_> + + <_> + + + + <_>10 7 3 5 -1. + <_>11 7 1 5 3. + 0 + 0.0169256608933210 + 0.5014736056327820 + 0.8053988218307495 + <_> + + <_> + + + + <_>7 7 3 5 -1. + <_>8 7 1 5 3. + 0 + -8.9858826249837875e-003 + 0.6470788717269898 + 0.4657020866870880 + <_> + + <_> + + + + <_>13 0 3 10 -1. + <_>14 0 1 10 3. + 0 + -0.0118746999651194 + 0.3246378898620606 + 0.5258755087852478 + <_> + + <_> + + + + <_>4 11 3 2 -1. + <_>4 12 3 1 2. + 0 + 1.9350569345988333e-004 + 0.5191941857337952 + 0.3839643895626068 + <_> + + <_> + + + + <_>17 3 3 6 -1. + <_>18 3 1 6 3. + 0 + 5.8713490143418312e-003 + 0.4918133914470673 + 0.6187043190002441 + <_> + + <_> + + + + <_>1 8 18 10 -1. + <_>1 13 18 5 2. + 0 + -0.2483879029750824 + 0.1836802959442139 + 0.4988150000572205 + <_> + + <_> + + + + <_>13 0 3 10 -1. + <_>14 0 1 10 3. + 0 + 0.0122560001909733 + 0.5227053761482239 + 0.3632029891014099 + <_> + + <_> + + + + <_>9 14 2 3 -1. + <_>9 15 2 1 3. + 0 + 8.3990179700776935e-004 + 0.4490250051021576 + 0.5774148106575012 + <_> + + <_> + + + + <_>16 3 3 7 -1. + <_>17 3 1 7 3. + 0 + 2.5407369248569012e-003 + 0.4804787039756775 + 0.5858299136161804 + <_> + + <_> + + + + <_>4 0 3 10 -1. + <_>5 0 1 10 3. + 0 + -0.0148224299773574 + 0.2521049976348877 + 0.5023537278175354 + <_> + + <_> + + + + <_>16 3 3 7 -1. + <_>17 3 1 7 3. + 0 + -5.7973959483206272e-003 + 0.5996695756912231 + 0.4853715002536774 + <_> + + <_> + + + + <_>0 9 1 2 -1. + <_>0 10 1 1 2. + 0 + 7.2662148158997297e-004 + 0.5153716802597046 + 0.3671779930591583 + <_> + + <_> + + + + <_>18 1 2 10 -1. + <_>18 1 1 10 2. + 0 + -0.0172325801104307 + 0.6621719002723694 + 0.4994656145572662 + <_> + + <_> + + + + <_>0 1 2 10 -1. + <_>1 1 1 10 2. + 0 + 7.8624086454510689e-003 + 0.4633395075798035 + 0.6256101727485657 + <_> + + <_> + + + + <_>10 16 3 4 -1. + <_>11 16 1 4 3. + 0 + -4.7343620099127293e-003 + 0.3615573048591614 + 0.5281885266304016 + <_> + + <_> + + + + <_>2 8 3 3 -1. + <_>3 8 1 3 3. + 0 + 8.3048478700220585e-004 + 0.4442889094352722 + 0.5550957918167114 + <_> + + <_> + + + + <_>11 0 2 6 -1. + <_>12 0 1 3 2. + <_>11 3 1 3 2. + 0 + 7.6602199114859104e-003 + 0.5162935256958008 + 0.2613354921340942 + <_> + + <_> + + + + <_>7 0 2 6 -1. + <_>7 0 1 3 2. + <_>8 3 1 3 2. + 0 + -4.1048377752304077e-003 + 0.2789632081985474 + 0.5019031763076782 + <_> + + <_> + + + + <_>16 3 3 7 -1. + <_>17 3 1 7 3. + 0 + 4.8512578941881657e-003 + 0.4968984127044678 + 0.5661668181419373 + <_> + + <_> + + + + <_>1 3 3 7 -1. + <_>2 3 1 7 3. + 0 + 9.9896453320980072e-004 + 0.4445607960224152 + 0.5551813244819641 + <_> + + <_> + + + + <_>14 1 6 16 -1. + <_>16 1 2 16 3. + 0 + -0.2702363133430481 + 0.0293882098048925 + 0.5151314139366150 + <_> + + <_> + + + + <_>0 1 6 16 -1. + <_>2 1 2 16 3. + 0 + -0.0130906803533435 + 0.5699399709701538 + 0.4447459876537323 + <_> + + <_> + + + + <_>2 0 16 8 -1. + <_>10 0 8 4 2. + <_>2 4 8 4 2. + 0 + -9.4342790544033051e-003 + 0.4305466115474701 + 0.5487895011901856 + <_> + + <_> + + + + <_>6 8 5 3 -1. + <_>6 9 5 1 3. + 0 + -1.5482039889320731e-003 + 0.3680317103862763 + 0.5128080844879150 + <_> + + <_> + + + + <_>9 7 3 3 -1. + <_>10 7 1 3 3. + 0 + 5.3746132180094719e-003 + 0.4838916957378388 + 0.6101555824279785 + <_> + + <_> + + + + <_>8 8 4 3 -1. + <_>8 9 4 1 3. + 0 + 1.5786769799888134e-003 + 0.5325223207473755 + 0.4118548035621643 + <_> + + <_> + + + + <_>9 6 2 4 -1. + <_>9 6 1 4 2. + 0 + 3.6856050137430429e-003 + 0.4810948073863983 + 0.6252303123474121 + <_> + + <_> + + + + <_>0 7 15 1 -1. + <_>5 7 5 1 3. + 0 + 9.3887019902467728e-003 + 0.5200229883193970 + 0.3629410862922669 + <_> + + <_> + + + + <_>8 2 7 9 -1. + <_>8 5 7 3 3. + 0 + 0.0127926301211119 + 0.4961709976196289 + 0.6738016009330750 + <_> + + <_> + + + + <_>1 7 16 4 -1. + <_>1 7 8 2 2. + <_>9 9 8 2 2. + 0 + -3.3661040943115950e-003 + 0.4060279130935669 + 0.5283598899841309 + <_> + + <_> + + + + <_>6 12 8 2 -1. + <_>6 13 8 1 2. + 0 + 3.9771420415490866e-004 + 0.4674113988876343 + 0.5900775194168091 + <_> + + <_> + + + + <_>8 11 3 3 -1. + <_>8 12 3 1 3. + 0 + 1.4868030557408929e-003 + 0.4519116878509522 + 0.6082053780555725 + <_> + + <_> + + + + <_>4 5 14 10 -1. + <_>11 5 7 5 2. + <_>4 10 7 5 2. + 0 + -0.0886867493391037 + 0.2807899117469788 + 0.5180991888046265 + <_> + + <_> + + + + <_>4 12 3 2 -1. + <_>4 13 3 1 2. + 0 + -7.4296112870797515e-005 + 0.5295584201812744 + 0.4087625145912170 + <_> + + <_> + + + + <_>9 11 6 1 -1. + <_>11 11 2 1 3. + 0 + -1.4932939848222304e-005 + 0.5461400151252747 + 0.4538542926311493 + <_> + + <_> + + + + <_>4 9 7 6 -1. + <_>4 11 7 2 3. + 0 + 5.9162238612771034e-003 + 0.5329161286354065 + 0.4192134141921997 + <_> + + <_> + + + + <_>7 10 6 3 -1. + <_>7 11 6 1 3. + 0 + 1.1141640134155750e-003 + 0.4512017965316773 + 0.5706217288970947 + <_> + + <_> + + + + <_>9 11 2 2 -1. + <_>9 12 2 1 2. + 0 + 8.9249362645205110e-005 + 0.4577805995941162 + 0.5897638201713562 + <_> + + <_> + + + + <_>0 5 20 6 -1. + <_>0 7 20 2 3. + 0 + 2.5319510605186224e-003 + 0.5299603939056397 + 0.3357639014720917 + <_> + + <_> + + + + <_>6 4 6 1 -1. + <_>8 4 2 1 3. + 0 + 0.0124262003228068 + 0.4959059059619904 + 0.1346601992845535 + <_> + + <_> + + + + <_>9 11 6 1 -1. + <_>11 11 2 1 3. + 0 + 0.0283357501029968 + 0.5117079019546509 + 6.1043637106195092e-004 + <_> + + <_> + + + + <_>5 11 6 1 -1. + <_>7 11 2 1 3. + 0 + 6.6165882162749767e-003 + 0.4736349880695343 + 0.7011628150939941 + <_> + + <_> + + + + <_>10 16 3 4 -1. + <_>11 16 1 4 3. + 0 + 8.0468766391277313e-003 + 0.5216417908668518 + 0.3282819986343384 + <_> + + <_> + + + + <_>8 7 3 3 -1. + <_>9 7 1 3 3. + 0 + -1.1193980462849140e-003 + 0.5809860825538635 + 0.4563739001750946 + <_> + + <_> + + + + <_>2 12 16 8 -1. + <_>2 16 16 4 2. + 0 + 0.0132775902748108 + 0.5398362278938294 + 0.4103901088237763 + <_> + + <_> + + + + <_>0 15 15 2 -1. + <_>0 16 15 1 2. + 0 + 4.8794739996083081e-004 + 0.4249286055564880 + 0.5410590767860413 + <_> + + <_> + + + + <_>15 4 5 6 -1. + <_>15 6 5 2 3. + 0 + 0.0112431701272726 + 0.5269963741302490 + 0.3438215851783752 + <_> + + <_> + + + + <_>9 5 2 4 -1. + <_>10 5 1 4 2. + 0 + -8.9896668214350939e-004 + 0.5633075833320618 + 0.4456613063812256 + <_> + + <_> + + + + <_>8 10 9 6 -1. + <_>8 12 9 2 3. + 0 + 6.6677159629762173e-003 + 0.5312889218330383 + 0.4362679123878479 + <_> + + <_> + + + + <_>2 19 15 1 -1. + <_>7 19 5 1 3. + 0 + 0.0289472993463278 + 0.4701794981956482 + 0.6575797796249390 + <_> + + <_> + + + + <_>10 16 3 4 -1. + <_>11 16 1 4 3. + 0 + -0.0234000496566296 + 0. + 0.5137398838996887 + <_> + + <_> + + + + <_>0 15 20 4 -1. + <_>0 17 20 2 2. + 0 + -0.0891170501708984 + 0.0237452797591686 + 0.4942430853843689 + <_> + + <_> + + + + <_>10 16 3 4 -1. + <_>11 16 1 4 3. + 0 + -0.0140546001493931 + 0.3127323091030121 + 0.5117511153221130 + <_> + + <_> + + + + <_>7 16 3 4 -1. + <_>8 16 1 4 3. + 0 + 8.1239398568868637e-003 + 0.5009049177169800 + 0.2520025968551636 + <_> + + <_> + + + + <_>9 16 3 3 -1. + <_>9 17 3 1 3. + 0 + -4.9964650534093380e-003 + 0.6387143731117249 + 0.4927811920642853 + <_> + + <_> + + + + <_>8 11 4 6 -1. + <_>8 14 4 3 2. + 0 + 3.1253970228135586e-003 + 0.5136849880218506 + 0.3680452108383179 + <_> + + <_> + + + + <_>9 6 2 12 -1. + <_>9 10 2 4 3. + 0 + 6.7669642157852650e-003 + 0.5509843826293945 + 0.4363631904125214 + <_> + + <_> + + + + <_>8 17 4 3 -1. + <_>8 18 4 1 3. + 0 + -2.3711440153419971e-003 + 0.6162335276603699 + 0.4586946964263916 + <_> + + <_> + + + + <_>9 18 8 2 -1. + <_>13 18 4 1 2. + <_>9 19 4 1 2. + 0 + -5.3522791713476181e-003 + 0.6185457706451416 + 0.4920490980148315 + <_> + + <_> + + + + <_>1 18 8 2 -1. + <_>1 19 8 1 2. + 0 + -0.0159688591957092 + 0.1382617950439453 + 0.4983252882957459 + <_> + + <_> + + + + <_>13 5 6 15 -1. + <_>15 5 2 15 3. + 0 + 4.7676060348749161e-003 + 0.4688057899475098 + 0.5490046143531799 + <_> + + <_> + + + + <_>9 8 2 2 -1. + <_>9 9 2 1 2. + 0 + -2.4714691098779440e-003 + 0.2368514984846115 + 0.5003952980041504 + <_> + + <_> + + + + <_>9 5 2 3 -1. + <_>9 5 1 3 2. + 0 + -7.1033788844943047e-004 + 0.5856394171714783 + 0.4721533060073853 + <_> + + <_> + + + + <_>1 5 6 15 -1. + <_>3 5 2 15 3. + 0 + -0.1411755979061127 + 0.0869000628590584 + 0.4961591064929962 + <_> + + <_> + + + + <_>4 1 14 8 -1. + <_>11 1 7 4 2. + <_>4 5 7 4 2. + 0 + 0.1065180972218514 + 0.5138837099075317 + 0.1741005033254623 + <_> + + <_> + + + + <_>2 4 4 16 -1. + <_>2 4 2 8 2. + <_>4 12 2 8 2. + 0 + -0.0527447499334812 + 0.7353636026382446 + 0.4772881865501404 + <_> + + <_> + + + + <_>12 4 3 12 -1. + <_>12 10 3 6 2. + 0 + -4.7431760467588902e-003 + 0.3884406089782715 + 0.5292701721191406 + <_> + + <_> + + + + <_>4 5 10 12 -1. + <_>4 5 5 6 2. + <_>9 11 5 6 2. + 0 + 9.9676765967160463e-004 + 0.5223492980003357 + 0.4003424048423767 + <_> + + <_> + + + + <_>9 14 2 3 -1. + <_>9 15 2 1 3. + 0 + 8.0284131690859795e-003 + 0.4959106147289276 + 0.7212964296340942 + <_> + + <_> + + + + <_>5 4 2 3 -1. + <_>5 5 2 1 3. + 0 + 8.6025858763605356e-004 + 0.4444884061813355 + 0.5538476109504700 + <_> + + <_> + + + + <_>12 2 4 10 -1. + <_>14 2 2 5 2. + <_>12 7 2 5 2. + 0 + 9.3191501218825579e-004 + 0.5398371219635010 + 0.4163244068622589 + <_> + + <_> + + + + <_>6 4 7 3 -1. + <_>6 5 7 1 3. + 0 + -2.5082060601562262e-003 + 0.5854265093803406 + 0.4562500119209290 + <_> + + <_> + + + + <_>2 0 18 2 -1. + <_>11 0 9 1 2. + <_>2 1 9 1 2. + 0 + -2.1378761157393456e-003 + 0.4608069062232971 + 0.5280259251594544 + <_> + + <_> + + + + <_>0 0 18 2 -1. + <_>0 0 9 1 2. + <_>9 1 9 1 2. + 0 + -2.1546049974858761e-003 + 0.3791126906871796 + 0.5255997180938721 + <_> + + <_> + + + + <_>13 13 4 6 -1. + <_>15 13 2 3 2. + <_>13 16 2 3 2. + 0 + -7.6214009895920753e-003 + 0.5998609066009522 + 0.4952073991298676 + <_> + + <_> + + + + <_>3 13 4 6 -1. + <_>3 13 2 3 2. + <_>5 16 2 3 2. + 0 + 2.2055360022932291e-003 + 0.4484206140041351 + 0.5588530898094177 + <_> + + <_> + + + + <_>10 12 2 6 -1. + <_>10 15 2 3 2. + 0 + 1.2586950324475765e-003 + 0.5450747013092041 + 0.4423840939998627 + <_> + + <_> + + + + <_>5 9 10 10 -1. + <_>5 9 5 5 2. + <_>10 14 5 5 2. + 0 + -5.0926720723509789e-003 + 0.4118275046348572 + 0.5263035893440247 + <_> + + <_> + + + + <_>11 4 4 2 -1. + <_>13 4 2 1 2. + <_>11 5 2 1 2. + 0 + -2.5095739401876926e-003 + 0.5787907838821411 + 0.4998494982719421 + <_> + + <_> + + + + <_>7 12 6 8 -1. + <_>10 12 3 8 2. + 0 + -0.0773275569081306 + 0.8397865891456604 + 0.4811120033264160 + <_> + + <_> + + + + <_>12 2 4 10 -1. + <_>14 2 2 5 2. + <_>12 7 2 5 2. + 0 + -0.0414858199656010 + 0.2408611029386520 + 0.5176993012428284 + <_> + + <_> + + + + <_>8 11 2 1 -1. + <_>9 11 1 1 2. + 0 + 1.0355669655837119e-004 + 0.4355360865592957 + 0.5417054295539856 + <_> + + <_> + + + + <_>10 5 1 12 -1. + <_>10 9 1 4 3. + 0 + 1.3255809899419546e-003 + 0.5453971028327942 + 0.4894095063209534 + <_> + + <_> + + + + <_>0 11 6 9 -1. + <_>3 11 3 9 2. + 0 + -8.0598732456564903e-003 + 0.5771024227142334 + 0.4577918946743012 + <_> + + <_> + + + + <_>12 2 4 10 -1. + <_>14 2 2 5 2. + <_>12 7 2 5 2. + 0 + 0.0190586205571890 + 0.5169867873191834 + 0.3400475084781647 + <_> + + <_> + + + + <_>4 2 4 10 -1. + <_>4 2 2 5 2. + <_>6 7 2 5 2. + 0 + -0.0350578911602497 + 0.2203243970870972 + 0.5000503063201904 + <_> + + <_> + + + + <_>11 4 4 2 -1. + <_>13 4 2 1 2. + <_>11 5 2 1 2. + 0 + 5.7296059094369411e-003 + 0.5043408274650574 + 0.6597570776939392 + <_> + + <_> + + + + <_>0 14 6 3 -1. + <_>0 15 6 1 3. + 0 + -0.0116483299061656 + 0.2186284959316254 + 0.4996652901172638 + <_> + + <_> + + + + <_>11 4 4 2 -1. + <_>13 4 2 1 2. + <_>11 5 2 1 2. + 0 + 1.4544479781761765e-003 + 0.5007681846618652 + 0.5503727793693543 + <_> + + <_> + + + + <_>6 1 3 2 -1. + <_>7 1 1 2 3. + 0 + -2.5030909455381334e-004 + 0.4129841029644013 + 0.5241670012474060 + <_> + + <_> + + + + <_>11 4 4 2 -1. + <_>13 4 2 1 2. + <_>11 5 2 1 2. + 0 + -8.2907272735610604e-004 + 0.5412868261337280 + 0.4974496066570282 + <_> + + <_> + + + + <_>5 4 4 2 -1. + <_>5 4 2 1 2. + <_>7 5 2 1 2. + 0 + 1.0862209601327777e-003 + 0.4605529904365540 + 0.5879228711128235 + <_> + + <_> + + + + <_>13 0 2 12 -1. + <_>14 0 1 6 2. + <_>13 6 1 6 2. + 0 + 2.0000500080641359e-004 + 0.5278854966163635 + 0.4705209136009216 + <_> + + <_> + + + + <_>6 0 3 10 -1. + <_>7 0 1 10 3. + 0 + 2.9212920926511288e-003 + 0.5129609704017639 + 0.3755536973476410 + <_> + + <_> + + + + <_>3 0 17 8 -1. + <_>3 4 17 4 2. + 0 + 0.0253874007612467 + 0.4822691977024078 + 0.5790768265724182 + <_> + + <_> + + + + <_>0 4 20 4 -1. + <_>0 6 20 2 2. + 0 + -3.1968469265848398e-003 + 0.5248395204544067 + 0.3962840139865875 + 87.6960296630859380 + 17 + -1 + <_> + + + <_> + + <_> + + + + <_>0 3 8 2 -1. + <_>4 3 4 2 2. + 0 + 5.8031738735735416e-003 + 0.3498983979225159 + 0.5961983203887940 + <_> + + <_> + + + + <_>8 11 4 3 -1. + <_>8 12 4 1 3. + 0 + -9.0003069490194321e-003 + 0.6816636919975281 + 0.4478552043437958 + <_> + + <_> + + + + <_>5 7 6 4 -1. + <_>5 7 3 2 2. + <_>8 9 3 2 2. + 0 + -1.1549659539014101e-003 + 0.5585706233978272 + 0.3578251004219055 + <_> + + <_> + + + + <_>8 3 4 9 -1. + <_>8 6 4 3 3. + 0 + -1.1069850297644734e-003 + 0.5365036129951477 + 0.3050428032875061 + <_> + + <_> + + + + <_>8 15 1 4 -1. + <_>8 17 1 2 2. + 0 + 1.0308309720130637e-004 + 0.3639095127582550 + 0.5344635844230652 + <_> + + <_> + + + + <_>4 5 12 7 -1. + <_>8 5 4 7 3. + 0 + -5.0984839908778667e-003 + 0.2859157025814056 + 0.5504264831542969 + <_> + + <_> + + + + <_>4 2 4 10 -1. + <_>4 2 2 5 2. + <_>6 7 2 5 2. + 0 + 8.2572200335562229e-004 + 0.5236523747444153 + 0.3476041853427887 + <_> + + <_> + + + + <_>3 0 17 2 -1. + <_>3 1 17 1 2. + 0 + 9.9783325567841530e-003 + 0.4750322103500366 + 0.6219646930694580 + <_> + + <_> + + + + <_>2 2 16 15 -1. + <_>2 7 16 5 3. + 0 + -0.0374025292694569 + 0.3343375921249390 + 0.5278062820434570 + <_> + + <_> + + + + <_>15 2 5 2 -1. + <_>15 3 5 1 2. + 0 + 4.8548257909715176e-003 + 0.5192180871963501 + 0.3700444102287293 + <_> + + <_> + + + + <_>9 3 2 2 -1. + <_>10 3 1 2 2. + 0 + -1.8664470408111811e-003 + 0.2929843962192535 + 0.5091944932937622 + <_> + + <_> + + + + <_>4 5 16 15 -1. + <_>4 10 16 5 3. + 0 + 0.0168888904154301 + 0.3686845898628235 + 0.5431225895881653 + <_> + + <_> + + + + <_>7 13 5 6 -1. + <_>7 16 5 3 2. + 0 + -5.8372621424496174e-003 + 0.3632183969020844 + 0.5221335887908936 + <_> + + <_> + + + + <_>10 7 3 2 -1. + <_>11 7 1 2 3. + 0 + -1.4713739510625601e-003 + 0.5870683789253235 + 0.4700650870800018 + <_> + + <_> + + + + <_>8 3 3 1 -1. + <_>9 3 1 1 3. + 0 + -1.1522950371727347e-003 + 0.3195894956588745 + 0.5140954256057739 + <_> + + <_> + + + + <_>9 16 3 3 -1. + <_>9 17 3 1 3. + 0 + -4.2560300789773464e-003 + 0.6301859021186829 + 0.4814921021461487 + <_> + + <_> + + + + <_>0 2 5 2 -1. + <_>0 3 5 1 2. + 0 + -6.7378291860222816e-003 + 0.1977048069238663 + 0.5025808215141296 + <_> + + <_> + + + + <_>12 5 4 3 -1. + <_>12 6 4 1 3. + 0 + 0.0113826701417565 + 0.4954132139682770 + 0.6867045760154724 + <_> + + <_> + + + + <_>1 7 12 1 -1. + <_>5 7 4 1 3. + 0 + 5.1794708706438541e-003 + 0.5164427757263184 + 0.3350647985935211 + <_> + + <_> + + + + <_>7 5 6 14 -1. + <_>7 12 6 7 2. + 0 + -0.1174378991127014 + 0.2315246015787125 + 0.5234413743019104 + <_> + + <_> + + + + <_>0 0 8 10 -1. + <_>0 0 4 5 2. + <_>4 5 4 5 2. + 0 + 0.0287034492939711 + 0.4664297103881836 + 0.6722521185874939 + <_> + + <_> + + + + <_>9 1 3 2 -1. + <_>10 1 1 2 3. + 0 + 4.8231030814349651e-003 + 0.5220875144004822 + 0.2723532915115356 + <_> + + <_> + + + + <_>8 1 3 2 -1. + <_>9 1 1 2 3. + 0 + 2.6798530016094446e-003 + 0.5079277157783508 + 0.2906948924064636 + <_> + + <_> + + + + <_>12 4 3 3 -1. + <_>12 5 3 1 3. + 0 + 8.0504082143306732e-003 + 0.4885950982570648 + 0.6395021080970764 + <_> + + <_> + + + + <_>7 4 6 16 -1. + <_>7 12 6 8 2. + 0 + 4.8054959625005722e-003 + 0.5197256803512573 + 0.3656663894653320 + <_> + + <_> + + + + <_>12 4 3 3 -1. + <_>12 5 3 1 3. + 0 + -2.2420159075409174e-003 + 0.6153467893600464 + 0.4763701856136322 + <_> + + <_> + + + + <_>2 3 2 6 -1. + <_>2 5 2 2 3. + 0 + -0.0137577103450894 + 0.2637344896793366 + 0.5030903220176697 + <_> + + <_> + + + + <_>14 2 6 9 -1. + <_>14 5 6 3 3. + 0 + -0.1033829972147942 + 0.2287521958351135 + 0.5182461142539978 + <_> + + <_> + + + + <_>5 4 3 3 -1. + <_>5 5 3 1 3. + 0 + -9.4432085752487183e-003 + 0.6953303813934326 + 0.4694949090480804 + <_> + + <_> + + + + <_>9 17 3 2 -1. + <_>10 17 1 2 3. + 0 + 8.0271181650459766e-004 + 0.5450655221939087 + 0.4268783926963806 + <_> + + <_> + + + + <_>5 5 2 3 -1. + <_>5 6 2 1 3. + 0 + -4.1945669800043106e-003 + 0.6091387867927551 + 0.4571642875671387 + <_> + + <_> + + + + <_>13 11 3 6 -1. + <_>13 13 3 2 3. + 0 + 0.0109422104433179 + 0.5241063237190247 + 0.3284547030925751 + <_> + + <_> + + + + <_>3 14 2 6 -1. + <_>3 17 2 3 2. + 0 + -5.7841069065034389e-004 + 0.5387929081916809 + 0.4179368913173676 + <_> + + <_> + + + + <_>14 3 6 2 -1. + <_>14 4 6 1 2. + 0 + -2.0888620056211948e-003 + 0.4292691051959992 + 0.5301715731620789 + <_> + + <_> + + + + <_>0 8 16 2 -1. + <_>0 9 16 1 2. + 0 + 3.2383969519287348e-003 + 0.3792347908020020 + 0.5220744013786316 + <_> + + <_> + + + + <_>14 3 6 2 -1. + <_>14 4 6 1 2. + 0 + 4.9075027927756310e-003 + 0.5237283110618591 + 0.4126757979393005 + <_> + + <_> + + + + <_>0 0 5 6 -1. + <_>0 2 5 2 3. + 0 + -0.0322779417037964 + 0.1947655975818634 + 0.4994502067565918 + <_> + + <_> + + + + <_>12 5 4 3 -1. + <_>12 6 4 1 3. + 0 + -8.9711230248212814e-003 + 0.6011285185813904 + 0.4929032027721405 + <_> + + <_> + + + + <_>4 11 3 6 -1. + <_>4 13 3 2 3. + 0 + 0.0153210898861289 + 0.5009753704071045 + 0.2039822041988373 + <_> + + <_> + + + + <_>12 5 4 3 -1. + <_>12 6 4 1 3. + 0 + 2.0855569746345282e-003 + 0.4862189888954163 + 0.5721694827079773 + <_> + + <_> + + + + <_>9 5 1 3 -1. + <_>9 6 1 1 3. + 0 + 5.0615021027624607e-003 + 0.5000218749046326 + 0.1801805943250656 + <_> + + <_> + + + + <_>12 5 4 3 -1. + <_>12 6 4 1 3. + 0 + -3.7174751050770283e-003 + 0.5530117154121399 + 0.4897592961788178 + <_> + + <_> + + + + <_>6 6 8 12 -1. + <_>6 12 8 6 2. + 0 + -0.0121705001220107 + 0.4178605973720551 + 0.5383723974227905 + <_> + + <_> + + + + <_>12 5 4 3 -1. + <_>12 6 4 1 3. + 0 + 4.6248398721218109e-003 + 0.4997169971466065 + 0.5761327147483826 + <_> + + <_> + + + + <_>5 12 9 2 -1. + <_>8 12 3 2 3. + 0 + -2.1040429419372231e-004 + 0.5331807136535645 + 0.4097681045532227 + <_> + + <_> + + + + <_>12 5 4 3 -1. + <_>12 6 4 1 3. + 0 + -0.0146417804062366 + 0.5755925178527832 + 0.5051776170730591 + <_> + + <_> + + + + <_>4 5 4 3 -1. + <_>4 6 4 1 3. + 0 + 3.3199489116668701e-003 + 0.4576976895332336 + 0.6031805872917175 + <_> + + <_> + + + + <_>6 6 9 2 -1. + <_>9 6 3 2 3. + 0 + 3.7236879579722881e-003 + 0.4380396902561188 + 0.5415883064270020 + <_> + + <_> + + + + <_>4 11 1 3 -1. + <_>4 12 1 1 3. + 0 + 8.2951161311939359e-004 + 0.5163031816482544 + 0.3702219128608704 + <_> + + <_> + + + + <_>14 12 6 6 -1. + <_>14 12 3 6 2. + 0 + -0.0114084901288152 + 0.6072946786880493 + 0.4862565100193024 + <_> + + <_> + + + + <_>7 0 3 7 -1. + <_>8 0 1 7 3. + 0 + -4.5320121571421623e-003 + 0.3292475938796997 + 0.5088962912559509 + <_> + + <_> + + + + <_>9 8 3 3 -1. + <_>10 8 1 3 3. + 0 + 5.1276017911732197e-003 + 0.4829767942428589 + 0.6122708916664124 + <_> + + <_> + + + + <_>8 8 3 3 -1. + <_>9 8 1 3 3. + 0 + 9.8583158105611801e-003 + 0.4660679996013641 + 0.6556177139282227 + <_> + + <_> + + + + <_>5 10 11 3 -1. + <_>5 11 11 1 3. + 0 + 0.0369859188795090 + 0.5204849243164063 + 0.1690472066402435 + <_> + + <_> + + + + <_>5 7 10 1 -1. + <_>10 7 5 1 2. + 0 + 4.6491161920130253e-003 + 0.5167322158813477 + 0.3725225031375885 + <_> + + <_> + + + + <_>9 7 3 2 -1. + <_>10 7 1 2 3. + 0 + -4.2664702050387859e-003 + 0.6406493186950684 + 0.4987342953681946 + <_> + + <_> + + + + <_>8 7 3 2 -1. + <_>9 7 1 2 3. + 0 + -4.7956590424291790e-004 + 0.5897293090820313 + 0.4464873969554901 + <_> + + <_> + + + + <_>11 9 4 2 -1. + <_>11 9 2 2 2. + 0 + 3.6827160511165857e-003 + 0.5441560745239258 + 0.3472662866115570 + <_> + + <_> + + + + <_>5 9 4 2 -1. + <_>7 9 2 2 2. + 0 + -0.0100598800927401 + 0.2143162935972214 + 0.5004829764366150 + <_> + + <_> + + + + <_>14 10 2 4 -1. + <_>14 12 2 2 2. + 0 + -3.0361840617842972e-004 + 0.5386424064636231 + 0.4590323865413666 + <_> + + <_> + + + + <_>7 7 3 2 -1. + <_>8 7 1 2 3. + 0 + -1.4545479789376259e-003 + 0.5751184225082398 + 0.4497095048427582 + <_> + + <_> + + + + <_>14 17 6 3 -1. + <_>14 18 6 1 3. + 0 + 1.6515209572389722e-003 + 0.5421937704086304 + 0.4238520860671997 + <_> + + <_> + + + + <_>4 5 12 12 -1. + <_>4 5 6 6 2. + <_>10 11 6 6 2. + 0 + -7.8468639403581619e-003 + 0.4077920913696289 + 0.5258157253265381 + <_> + + <_> + + + + <_>6 9 8 8 -1. + <_>10 9 4 4 2. + <_>6 13 4 4 2. + 0 + -5.1259850151836872e-003 + 0.4229275882244110 + 0.5479453206062317 + <_> + + <_> + + + + <_>0 4 15 4 -1. + <_>5 4 5 4 3. + 0 + -0.0368909612298012 + 0.6596375703811646 + 0.4674678146839142 + <_> + + <_> + + + + <_>13 2 4 1 -1. + <_>13 2 2 1 2. + 0 + 2.4035639944486320e-004 + 0.4251135885715485 + 0.5573202967643738 + <_> + + <_> + + + + <_>4 12 2 2 -1. + <_>4 13 2 1 2. + 0 + -1.5150169929256663e-005 + 0.5259246826171875 + 0.4074114859104157 + <_> + + <_> + + + + <_>8 13 4 3 -1. + <_>8 14 4 1 3. + 0 + 2.2108471021056175e-003 + 0.4671722948551178 + 0.5886352062225342 + <_> + + <_> + + + + <_>9 13 2 3 -1. + <_>9 14 2 1 3. + 0 + -1.1568620102480054e-003 + 0.5711066126823425 + 0.4487161934375763 + <_> + + <_> + + + + <_>13 11 2 3 -1. + <_>13 12 2 1 3. + 0 + 4.9996292218565941e-003 + 0.5264198184013367 + 0.2898327112197876 + <_> + + <_> + + + + <_>7 12 4 4 -1. + <_>7 12 2 2 2. + <_>9 14 2 2 2. + 0 + -1.4656189596280456e-003 + 0.3891738057136536 + 0.5197871923446655 + <_> + + <_> + + + + <_>10 11 2 2 -1. + <_>11 11 1 1 2. + <_>10 12 1 1 2. + 0 + -1.1975039960816503e-003 + 0.5795872807502747 + 0.4927955865859985 + <_> + + <_> + + + + <_>8 17 3 2 -1. + <_>9 17 1 2 3. + 0 + -4.4954330660402775e-003 + 0.2377603054046631 + 0.5012555122375488 + <_> + + <_> + + + + <_>10 11 2 2 -1. + <_>11 11 1 1 2. + <_>10 12 1 1 2. + 0 + 1.4997160178609192e-004 + 0.4876626133918762 + 0.5617607831954956 + <_> + + <_> + + + + <_>0 17 6 3 -1. + <_>0 18 6 1 3. + 0 + 2.6391509454697371e-003 + 0.5168088078498840 + 0.3765509128570557 + <_> + + <_> + + + + <_>10 11 2 2 -1. + <_>11 11 1 1 2. + <_>10 12 1 1 2. + 0 + -2.9368131072260439e-004 + 0.5446649193763733 + 0.4874630868434906 + <_> + + <_> + + + + <_>8 11 2 2 -1. + <_>8 11 1 1 2. + <_>9 12 1 1 2. + 0 + 1.4211760135367513e-003 + 0.4687897861003876 + 0.6691331863403320 + <_> + + <_> + + + + <_>12 5 8 4 -1. + <_>12 5 4 4 2. + 0 + 0.0794276371598244 + 0.5193443894386292 + 0.2732945978641510 + <_> + + <_> + + + + <_>0 5 8 4 -1. + <_>4 5 4 4 2. + 0 + 0.0799375027418137 + 0.4971731007099152 + 0.1782083958387375 + <_> + + <_> + + + + <_>13 2 4 1 -1. + <_>13 2 2 1 2. + 0 + 0.0110892597585917 + 0.5165994763374329 + 0.3209475874900818 + <_> + + <_> + + + + <_>3 2 4 1 -1. + <_>5 2 2 1 2. + 0 + 1.6560709627810866e-004 + 0.4058471918106079 + 0.5307276248931885 + <_> + + <_> + + + + <_>10 0 4 2 -1. + <_>12 0 2 1 2. + <_>10 1 2 1 2. + 0 + -5.3354292176663876e-003 + 0.3445056974887848 + 0.5158129930496216 + <_> + + <_> + + + + <_>7 12 3 1 -1. + <_>8 12 1 1 3. + 0 + 1.1287260567769408e-003 + 0.4594863057136536 + 0.6075533032417297 + <_> + + <_> + + + + <_>8 11 4 8 -1. + <_>10 11 2 4 2. + <_>8 15 2 4 2. + 0 + -0.0219692196696997 + 0.1680400967597961 + 0.5228595733642578 + <_> + + <_> + + + + <_>9 9 2 2 -1. + <_>9 10 2 1 2. + 0 + -2.1775320055894554e-004 + 0.3861596882343292 + 0.5215672850608826 + <_> + + <_> + + + + <_>3 18 15 2 -1. + <_>3 19 15 1 2. + 0 + 2.0200149447191507e-004 + 0.5517979264259338 + 0.4363039135932922 + <_> + + <_> + + + + <_>2 6 2 12 -1. + <_>2 6 1 6 2. + <_>3 12 1 6 2. + 0 + -0.0217331498861313 + 0.7999460101127625 + 0.4789851009845734 + <_> + + <_> + + + + <_>9 8 2 3 -1. + <_>9 9 2 1 3. + 0 + -8.4399932529777288e-004 + 0.4085975885391235 + 0.5374773144721985 + <_> + + <_> + + + + <_>7 10 3 2 -1. + <_>8 10 1 2 3. + 0 + -4.3895249837078154e-004 + 0.5470405220985413 + 0.4366143047809601 + <_> + + <_> + + + + <_>11 11 3 1 -1. + <_>12 11 1 1 3. + 0 + 1.5092400135472417e-003 + 0.4988996982574463 + 0.5842149257659912 + <_> + + <_> + + + + <_>6 11 3 1 -1. + <_>7 11 1 1 3. + 0 + -3.5547839943319559e-003 + 0.6753690242767334 + 0.4721005856990814 + <_> + + <_> + + + + <_>9 2 4 2 -1. + <_>11 2 2 1 2. + <_>9 3 2 1 2. + 0 + 4.8191400128416717e-004 + 0.5415853857994080 + 0.4357109069824219 + <_> + + <_> + + + + <_>4 12 2 3 -1. + <_>4 13 2 1 3. + 0 + -6.0264398343861103e-003 + 0.2258509993553162 + 0.4991880953311920 + <_> + + <_> + + + + <_>2 1 18 3 -1. + <_>8 1 6 3 3. + 0 + -0.0116681400686502 + 0.6256554722785950 + 0.4927498996257782 + <_> + + <_> + + + + <_>5 1 4 14 -1. + <_>7 1 2 14 2. + 0 + -2.8718370012938976e-003 + 0.3947784900665283 + 0.5245801806449890 + <_> + + <_> + + + + <_>8 16 12 3 -1. + <_>8 16 6 3 2. + 0 + 0.0170511696487665 + 0.4752511084079742 + 0.5794224143028259 + <_> + + <_> + + + + <_>1 17 18 3 -1. + <_>7 17 6 3 3. + 0 + -0.0133520802482963 + 0.6041104793548584 + 0.4544535875320435 + <_> + + <_> + + + + <_>9 14 2 6 -1. + <_>9 17 2 3 2. + 0 + -3.9301801007241011e-004 + 0.4258275926113129 + 0.5544905066490173 + <_> + + <_> + + + + <_>9 12 1 8 -1. + <_>9 16 1 4 2. + 0 + 3.0483349692076445e-003 + 0.5233420133590698 + 0.3780272901058197 + <_> + + <_> + + + + <_>9 14 2 3 -1. + <_>9 15 2 1 3. + 0 + -4.3579288758337498e-003 + 0.6371889114379883 + 0.4838674068450928 + <_> + + <_> + + + + <_>9 6 2 12 -1. + <_>9 10 2 4 3. + 0 + 5.6661018170416355e-003 + 0.5374705791473389 + 0.4163666069507599 + <_> + + <_> + + + + <_>12 9 3 3 -1. + <_>12 10 3 1 3. + 0 + 6.0677339206449687e-005 + 0.4638795852661133 + 0.5311625003814697 + <_> + + <_> + + + + <_>0 1 4 8 -1. + <_>2 1 2 8 2. + 0 + 0.0367381609976292 + 0.4688656032085419 + 0.6466524004936218 + <_> + + <_> + + + + <_>9 1 6 2 -1. + <_>12 1 3 1 2. + <_>9 2 3 1 2. + 0 + 8.6528137326240540e-003 + 0.5204318761825562 + 0.2188657969236374 + <_> + + <_> + + + + <_>1 3 12 14 -1. + <_>1 10 12 7 2. + 0 + -0.1537135988473892 + 0.1630371958017349 + 0.4958840012550354 + <_> + + <_> + + + + <_>8 12 4 2 -1. + <_>10 12 2 1 2. + <_>8 13 2 1 2. + 0 + -4.1560421232134104e-004 + 0.5774459242820740 + 0.4696458876132965 + <_> + + <_> + + + + <_>1 9 10 2 -1. + <_>1 9 5 1 2. + <_>6 10 5 1 2. + 0 + -1.2640169588848948e-003 + 0.3977175951004028 + 0.5217198133468628 + <_> + + <_> + + + + <_>8 15 4 3 -1. + <_>8 16 4 1 3. + 0 + -3.5473341122269630e-003 + 0.6046528220176697 + 0.4808315038681030 + <_> + + <_> + + + + <_>6 8 8 3 -1. + <_>6 9 8 1 3. + 0 + 3.0019069527043030e-005 + 0.3996723890304565 + 0.5228201150894165 + <_> + + <_> + + + + <_>9 15 5 3 -1. + <_>9 16 5 1 3. + 0 + 1.3113019522279501e-003 + 0.4712158143520355 + 0.5765997767448425 + <_> + + <_> + + + + <_>8 7 4 3 -1. + <_>8 8 4 1 3. + 0 + -1.3374709524214268e-003 + 0.4109584987163544 + 0.5253170132637024 + <_> + + <_> + + + + <_>7 7 6 2 -1. + <_>7 8 6 1 2. + 0 + 0.0208767093718052 + 0.5202993750572205 + 0.1757981926202774 + <_> + + <_> + + + + <_>5 7 8 2 -1. + <_>5 7 4 1 2. + <_>9 8 4 1 2. + 0 + -7.5497948564589024e-003 + 0.6566609740257263 + 0.4694975018501282 + <_> + + <_> + + + + <_>12 9 3 3 -1. + <_>12 10 3 1 3. + 0 + 0.0241885501891375 + 0.5128673911094666 + 0.3370220959186554 + <_> + + <_> + + + + <_>4 7 4 2 -1. + <_>4 8 4 1 2. + 0 + -2.9358828905969858e-003 + 0.6580786705017090 + 0.4694541096687317 + <_> + + <_> + + + + <_>14 2 6 9 -1. + <_>14 5 6 3 3. + 0 + 0.0575579293072224 + 0.5146445035934448 + 0.2775259912014008 + <_> + + <_> + + + + <_>4 9 3 3 -1. + <_>5 9 1 3 3. + 0 + -1.1343370424583554e-003 + 0.3836601972579956 + 0.5192667245864868 + <_> + + <_> + + + + <_>12 9 3 3 -1. + <_>12 10 3 1 3. + 0 + 0.0168169997632504 + 0.5085592865943909 + 0.6177260875701904 + <_> + + <_> + + + + <_>0 2 6 9 -1. + <_>0 5 6 3 3. + 0 + 5.0535178743302822e-003 + 0.5138763189315796 + 0.3684791922569275 + <_> + + <_> + + + + <_>17 3 3 6 -1. + <_>18 3 1 6 3. + 0 + -4.5874710194766521e-003 + 0.5989655256271362 + 0.4835202097892761 + <_> + + <_> + + + + <_>0 3 3 6 -1. + <_>1 3 1 6 3. + 0 + 1.6882460331544280e-003 + 0.4509486854076386 + 0.5723056793212891 + <_> + + <_> + + + + <_>17 14 1 2 -1. + <_>17 15 1 1 2. + 0 + -1.6554000321775675e-003 + 0.3496770858764648 + 0.5243319272994995 + <_> + + <_> + + + + <_>4 9 4 3 -1. + <_>6 9 2 3 2. + 0 + -0.0193738006055355 + 0.1120536997914314 + 0.4968712925910950 + <_> + + <_> + + + + <_>12 9 3 3 -1. + <_>12 10 3 1 3. + 0 + 0.0103744501248002 + 0.5148196816444397 + 0.4395213127136231 + <_> + + <_> + + + + <_>5 9 3 3 -1. + <_>5 10 3 1 3. + 0 + 1.4973050565458834e-004 + 0.4084999859333038 + 0.5269886851310730 + <_> + + <_> + + + + <_>9 5 6 8 -1. + <_>12 5 3 4 2. + <_>9 9 3 4 2. + 0 + -0.0429819300770760 + 0.6394104957580566 + 0.5018504261970520 + <_> + + <_> + + + + <_>5 5 6 8 -1. + <_>5 5 3 4 2. + <_>8 9 3 4 2. + 0 + 8.3065936341881752e-003 + 0.4707553982734680 + 0.6698353290557861 + <_> + + <_> + + + + <_>16 1 4 6 -1. + <_>16 4 4 3 2. + 0 + -4.1285790503025055e-003 + 0.4541369080543518 + 0.5323647260665894 + <_> + + <_> + + + + <_>1 0 6 20 -1. + <_>3 0 2 20 3. + 0 + 1.7399420030415058e-003 + 0.4333961904048920 + 0.5439866185188294 + <_> + + <_> + + + + <_>12 11 3 2 -1. + <_>13 11 1 2 3. + 0 + 1.1739750334527344e-004 + 0.4579687118530273 + 0.5543426275253296 + <_> + + <_> + + + + <_>5 11 3 2 -1. + <_>6 11 1 2 3. + 0 + 1.8585780344437808e-004 + 0.4324643909931183 + 0.5426754951477051 + <_> + + <_> + + + + <_>9 4 6 1 -1. + <_>11 4 2 1 3. + 0 + 5.5587692186236382e-003 + 0.5257220864295960 + 0.3550611138343811 + <_> + + <_> + + + + <_>0 0 8 3 -1. + <_>4 0 4 3 2. + 0 + -7.9851560294628143e-003 + 0.6043018102645874 + 0.4630635976791382 + <_> + + <_> + + + + <_>15 0 2 5 -1. + <_>15 0 1 5 2. + 0 + 6.0594122624024749e-004 + 0.4598254859447479 + 0.5533195137977600 + <_> + + <_> + + + + <_>4 1 3 2 -1. + <_>5 1 1 2 3. + 0 + -2.2983040253166109e-004 + 0.4130752086639404 + 0.5322461128234863 + <_> + + <_> + + + + <_>7 0 6 15 -1. + <_>9 0 2 15 3. + 0 + 4.3740210821852088e-004 + 0.4043039977550507 + 0.5409289002418518 + <_> + + <_> + + + + <_>6 11 3 1 -1. + <_>7 11 1 1 3. + 0 + 2.9482020181603730e-004 + 0.4494963884353638 + 0.5628852248191834 + <_> + + <_> + + + + <_>12 0 3 4 -1. + <_>13 0 1 4 3. + 0 + 0.0103126596659422 + 0.5177510976791382 + 0.2704316973686218 + <_> + + <_> + + + + <_>5 4 6 1 -1. + <_>7 4 2 1 3. + 0 + -7.7241109684109688e-003 + 0.1988019049167633 + 0.4980553984642029 + <_> + + <_> + + + + <_>12 7 3 2 -1. + <_>12 8 3 1 2. + 0 + -4.6797208487987518e-003 + 0.6644750237464905 + 0.5018296241760254 + <_> + + <_> + + + + <_>0 1 4 6 -1. + <_>0 4 4 3 2. + 0 + -5.0755459815263748e-003 + 0.3898304998874664 + 0.5185269117355347 + <_> + + <_> + + + + <_>12 7 3 2 -1. + <_>12 8 3 1 2. + 0 + 2.2479740437120199e-003 + 0.4801808893680573 + 0.5660336017608643 + <_> + + <_> + + + + <_>2 16 3 3 -1. + <_>2 17 3 1 3. + 0 + 8.3327008178457618e-004 + 0.5210919976234436 + 0.3957188129425049 + <_> + + <_> + + + + <_>13 8 6 10 -1. + <_>16 8 3 5 2. + <_>13 13 3 5 2. + 0 + -0.0412793308496475 + 0.6154541969299316 + 0.5007054209709168 + <_> + + <_> + + + + <_>0 9 5 2 -1. + <_>0 10 5 1 2. + 0 + -5.0930189900100231e-004 + 0.3975942134857178 + 0.5228403806686401 + <_> + + <_> + + + + <_>12 11 2 2 -1. + <_>13 11 1 1 2. + <_>12 12 1 1 2. + 0 + 1.2568780221045017e-003 + 0.4979138076305389 + 0.5939183235168457 + <_> + + <_> + + + + <_>3 15 3 3 -1. + <_>3 16 3 1 3. + 0 + 8.0048497766256332e-003 + 0.4984497129917145 + 0.1633366048336029 + <_> + + <_> + + + + <_>12 7 3 2 -1. + <_>12 8 3 1 2. + 0 + -1.1879300000146031e-003 + 0.5904964804649353 + 0.4942624866962433 + <_> + + <_> + + + + <_>5 7 3 2 -1. + <_>5 8 3 1 2. + 0 + 6.1948952497914433e-004 + 0.4199557900428772 + 0.5328726172447205 + <_> + + <_> + + + + <_>9 5 9 9 -1. + <_>9 8 9 3 3. + 0 + 6.6829859279096127e-003 + 0.5418602824211121 + 0.4905889034271240 + <_> + + <_> + + + + <_>5 0 3 7 -1. + <_>6 0 1 7 3. + 0 + -3.7062340416014194e-003 + 0.3725939095020294 + 0.5138000249862671 + <_> + + <_> + + + + <_>5 2 12 5 -1. + <_>9 2 4 5 3. + 0 + -0.0397394113242626 + 0.6478961110115051 + 0.5050346851348877 + <_> + + <_> + + + + <_>6 11 2 2 -1. + <_>6 11 1 1 2. + <_>7 12 1 1 2. + 0 + 1.4085009461268783e-003 + 0.4682339131832123 + 0.6377884149551392 + <_> + + <_> + + + + <_>15 15 3 2 -1. + <_>15 16 3 1 2. + 0 + 3.9322688826359808e-004 + 0.5458530187606812 + 0.4150482118129730 + <_> + + <_> + + + + <_>2 15 3 2 -1. + <_>2 16 3 1 2. + 0 + -1.8979819724336267e-003 + 0.3690159916877747 + 0.5149704217910767 + <_> + + <_> + + + + <_>14 12 6 8 -1. + <_>17 12 3 4 2. + <_>14 16 3 4 2. + 0 + -0.0139704402536154 + 0.6050562858581543 + 0.4811357855796814 + <_> + + <_> + + + + <_>2 8 15 6 -1. + <_>7 8 5 6 3. + 0 + -0.1010081991553307 + 0.2017080038785934 + 0.4992361962795258 + <_> + + <_> + + + + <_>2 2 18 17 -1. + <_>8 2 6 17 3. + 0 + -0.0173469204455614 + 0.5713148713111877 + 0.4899486005306244 + <_> + + <_> + + + + <_>5 1 4 1 -1. + <_>7 1 2 1 2. + 0 + 1.5619759506080300e-004 + 0.4215388894081116 + 0.5392642021179199 + <_> + + <_> + + + + <_>5 2 12 5 -1. + <_>9 2 4 5 3. + 0 + 0.1343892961740494 + 0.5136151909828186 + 0.3767612874507904 + <_> + + <_> + + + + <_>3 2 12 5 -1. + <_>7 2 4 5 3. + 0 + -0.0245822407305241 + 0.7027357816696167 + 0.4747906923294067 + <_> + + <_> + + + + <_>4 9 12 4 -1. + <_>10 9 6 2 2. + <_>4 11 6 2 2. + 0 + -3.8553720805794001e-003 + 0.4317409098148346 + 0.5427716970443726 + <_> + + <_> + + + + <_>5 15 6 2 -1. + <_>5 15 3 1 2. + <_>8 16 3 1 2. + 0 + -2.3165249731391668e-003 + 0.5942698717117310 + 0.4618647992610931 + <_> + + <_> + + + + <_>10 14 2 3 -1. + <_>10 15 2 1 3. + 0 + -4.8518120311200619e-003 + 0.6191568970680237 + 0.4884895086288452 + <_> + + <_> + + + + <_>0 13 20 2 -1. + <_>0 13 10 1 2. + <_>10 14 10 1 2. + 0 + 2.4699938949197531e-003 + 0.5256664752960205 + 0.4017199873924255 + <_> + + <_> + + + + <_>4 9 12 8 -1. + <_>10 9 6 4 2. + <_>4 13 6 4 2. + 0 + 0.0454969592392445 + 0.5237867832183838 + 0.2685773968696594 + <_> + + <_> + + + + <_>8 13 3 6 -1. + <_>8 16 3 3 2. + 0 + -0.0203195996582508 + 0.2130445986986160 + 0.4979738891124725 + <_> + + <_> + + + + <_>10 12 2 2 -1. + <_>10 13 2 1 2. + 0 + 2.6994998916052282e-004 + 0.4814041852951050 + 0.5543122291564941 + <_> + + <_> + + + + <_>9 12 2 2 -1. + <_>9 12 1 1 2. + <_>10 13 1 1 2. + 0 + -1.8232699949294329e-003 + 0.6482579708099365 + 0.4709989130496979 + <_> + + <_> + + + + <_>4 11 14 4 -1. + <_>11 11 7 2 2. + <_>4 13 7 2 2. + 0 + -6.3015790656208992e-003 + 0.4581927955150604 + 0.5306236147880554 + <_> + + <_> + + + + <_>8 5 4 2 -1. + <_>8 6 4 1 2. + 0 + -2.4139499873854220e-004 + 0.5232086777687073 + 0.4051763117313385 + <_> + + <_> + + + + <_>10 10 6 3 -1. + <_>12 10 2 3 3. + 0 + -1.0330369696021080e-003 + 0.5556201934814453 + 0.4789193868637085 + <_> + + <_> + + + + <_>2 14 1 2 -1. + <_>2 15 1 1 2. + 0 + 1.8041160365100950e-004 + 0.5229442715644836 + 0.4011810123920441 + <_> + + <_> + + + + <_>13 8 6 12 -1. + <_>16 8 3 6 2. + <_>13 14 3 6 2. + 0 + -0.0614078603684902 + 0.6298682093620300 + 0.5010703206062317 + <_> + + <_> + + + + <_>1 8 6 12 -1. + <_>1 8 3 6 2. + <_>4 14 3 6 2. + 0 + -0.0695439130067825 + 0.7228280901908875 + 0.4773184061050415 + <_> + + <_> + + + + <_>10 0 6 10 -1. + <_>12 0 2 10 3. + 0 + -0.0705426633358002 + 0.2269513010978699 + 0.5182529091835022 + <_> + + <_> + + + + <_>5 11 8 4 -1. + <_>5 11 4 2 2. + <_>9 13 4 2 2. + 0 + 2.4423799477517605e-003 + 0.5237097144126892 + 0.4098151028156281 + <_> + + <_> + + + + <_>10 16 8 4 -1. + <_>14 16 4 2 2. + <_>10 18 4 2 2. + 0 + 1.5494349645450711e-003 + 0.4773750901222229 + 0.5468043088912964 + <_> + + <_> + + + + <_>7 7 6 6 -1. + <_>9 7 2 6 3. + 0 + -0.0239142198115587 + 0.7146975994110107 + 0.4783824980258942 + <_> + + <_> + + + + <_>10 2 4 10 -1. + <_>10 2 2 10 2. + 0 + -0.0124536901712418 + 0.2635296881198883 + 0.5241122841835022 + <_> + + <_> + + + + <_>6 1 4 9 -1. + <_>8 1 2 9 2. + 0 + -2.0760179904755205e-004 + 0.3623757064342499 + 0.5113608837127686 + <_> + + <_> + + + + <_>12 19 2 1 -1. + <_>12 19 1 1 2. + 0 + 2.9781080229440704e-005 + 0.4705932140350342 + 0.5432801842689514 + 90.2533493041992190 + 18 + -1 + <_> + + + <_> + + <_> + + + + <_>1 2 4 9 -1. + <_>3 2 2 9 2. + 0 + 0.0117727499455214 + 0.3860518932342529 + 0.6421167254447937 + <_> + + <_> + + + + <_>7 5 6 4 -1. + <_>9 5 2 4 3. + 0 + 0.0270375702530146 + 0.4385654926300049 + 0.6754038929939270 + <_> + + <_> + + + + <_>9 4 2 4 -1. + <_>9 6 2 2 2. + 0 + -3.6419500247575343e-005 + 0.5487101078033447 + 0.3423315882682800 + <_> + + <_> + + + + <_>14 5 2 8 -1. + <_>14 9 2 4 2. + 0 + 1.9995409529656172e-003 + 0.3230532109737396 + 0.5400317907333374 + <_> + + <_> + + + + <_>7 6 5 12 -1. + <_>7 12 5 6 2. + 0 + 4.5278300531208515e-003 + 0.5091639757156372 + 0.2935043871402741 + <_> + + <_> + + + + <_>14 6 2 6 -1. + <_>14 9 2 3 2. + 0 + 4.7890920541249216e-004 + 0.4178153872489929 + 0.5344064235687256 + <_> + + <_> + + + + <_>4 6 2 6 -1. + <_>4 9 2 3 2. + 0 + 1.1720920447260141e-003 + 0.2899182140827179 + 0.5132070779800415 + <_> + + <_> + + + + <_>8 15 10 4 -1. + <_>13 15 5 2 2. + <_>8 17 5 2 2. + 0 + 9.5305702416226268e-004 + 0.4280124902725220 + 0.5560845136642456 + <_> + + <_> + + + + <_>6 18 2 2 -1. + <_>7 18 1 2 2. + 0 + 1.5099150004971307e-005 + 0.4044871926307678 + 0.5404760241508484 + <_> + + <_> + + + + <_>11 3 6 2 -1. + <_>11 4 6 1 2. + 0 + -6.0817901976406574e-004 + 0.4271768927574158 + 0.5503466129302979 + <_> + + <_> + + + + <_>2 0 16 6 -1. + <_>2 2 16 2 3. + 0 + 3.3224520739167929e-003 + 0.3962723910808563 + 0.5369734764099121 + <_> + + <_> + + + + <_>11 3 6 2 -1. + <_>11 4 6 1 2. + 0 + -1.1037490330636501e-003 + 0.4727177917957306 + 0.5237749814987183 + <_> + + <_> + + + + <_>4 11 10 3 -1. + <_>4 12 10 1 3. + 0 + -1.4350269921123981e-003 + 0.5603008270263672 + 0.4223509132862091 + <_> + + <_> + + + + <_>11 3 6 2 -1. + <_>11 4 6 1 2. + 0 + 2.0767399109899998e-003 + 0.5225917100906372 + 0.4732725918292999 + <_> + + <_> + + + + <_>3 3 6 2 -1. + <_>3 4 6 1 2. + 0 + -1.6412809782195836e-004 + 0.3999075889587402 + 0.5432739853858948 + <_> + + <_> + + + + <_>16 0 4 7 -1. + <_>16 0 2 7 2. + 0 + 8.8302437216043472e-003 + 0.4678385853767395 + 0.6027327179908752 + <_> + + <_> + + + + <_>0 14 9 6 -1. + <_>0 16 9 2 3. + 0 + -0.0105520701035857 + 0.3493967056274414 + 0.5213974714279175 + <_> + + <_> + + + + <_>9 16 3 3 -1. + <_>9 17 3 1 3. + 0 + -2.2731600329279900e-003 + 0.6185818910598755 + 0.4749062955379486 + <_> + + <_> + + + + <_>4 6 6 2 -1. + <_>6 6 2 2 3. + 0 + -8.4786332445219159e-004 + 0.5285341143608093 + 0.3843482136726379 + <_> + + <_> + + + + <_>15 11 1 3 -1. + <_>15 12 1 1 3. + 0 + 1.2081359745934606e-003 + 0.5360640883445740 + 0.3447335958480835 + <_> + + <_> + + + + <_>5 5 2 3 -1. + <_>5 6 2 1 3. + 0 + 2.6512730401009321e-003 + 0.4558292031288147 + 0.6193962097167969 + <_> + + <_> + + + + <_>10 9 2 2 -1. + <_>10 10 2 1 2. + 0 + -1.1012479662895203e-003 + 0.3680230081081390 + 0.5327628254890442 + <_> + + <_> + + + + <_>3 1 4 3 -1. + <_>5 1 2 3 2. + 0 + 4.9561518244445324e-004 + 0.3960595130920410 + 0.5274940729141235 + <_> + + <_> + + + + <_>16 0 4 7 -1. + <_>16 0 2 7 2. + 0 + -0.0439017713069916 + 0.7020444869995117 + 0.4992839097976685 + <_> + + <_> + + + + <_>0 0 20 1 -1. + <_>10 0 10 1 2. + 0 + 0.0346903502941132 + 0.5049164295196533 + 0.2766602933406830 + <_> + + <_> + + + + <_>15 11 1 3 -1. + <_>15 12 1 1 3. + 0 + -2.7442190330475569e-003 + 0.2672632932662964 + 0.5274971127510071 + <_> + + <_> + + + + <_>0 4 3 4 -1. + <_>1 4 1 4 3. + 0 + 3.3316588960587978e-003 + 0.4579482972621918 + 0.6001101732254028 + <_> + + <_> + + + + <_>16 3 3 6 -1. + <_>16 5 3 2 3. + 0 + -0.0200445707887411 + 0.3171594142913818 + 0.5235717892646790 + <_> + + <_> + + + + <_>1 3 3 6 -1. + <_>1 5 3 2 3. + 0 + 1.3492030557245016e-003 + 0.5265362858772278 + 0.4034324884414673 + <_> + + <_> + + + + <_>6 2 12 6 -1. + <_>12 2 6 3 2. + <_>6 5 6 3 2. + 0 + 2.9702018946409225e-003 + 0.5332456827163696 + 0.4571984112262726 + <_> + + <_> + + + + <_>8 10 4 3 -1. + <_>8 11 4 1 3. + 0 + 6.3039981760084629e-003 + 0.4593310952186585 + 0.6034635901451111 + <_> + + <_> + + + + <_>4 2 14 6 -1. + <_>11 2 7 3 2. + <_>4 5 7 3 2. + 0 + -0.0129365902394056 + 0.4437963962554932 + 0.5372971296310425 + <_> + + <_> + + + + <_>9 11 2 3 -1. + <_>9 12 2 1 3. + 0 + 4.0148729458451271e-003 + 0.4680323898792267 + 0.6437833905220032 + <_> + + <_> + + + + <_>15 13 2 3 -1. + <_>15 14 2 1 3. + 0 + -2.6401679497212172e-003 + 0.3709631860256195 + 0.5314332842826843 + <_> + + <_> + + + + <_>8 12 4 3 -1. + <_>8 13 4 1 3. + 0 + 0.0139184398576617 + 0.4723555147647858 + 0.7130808830261231 + <_> + + <_> + + + + <_>15 11 1 3 -1. + <_>15 12 1 1 3. + 0 + -4.5087869511917233e-004 + 0.4492394030094147 + 0.5370404124259949 + <_> + + <_> + + + + <_>7 13 5 2 -1. + <_>7 14 5 1 2. + 0 + 2.5384349282830954e-004 + 0.4406864047050476 + 0.5514402985572815 + <_> + + <_> + + + + <_>7 12 6 3 -1. + <_>7 13 6 1 3. + 0 + 2.2710000630468130e-003 + 0.4682416915893555 + 0.5967984199523926 + <_> + + <_> + + + + <_>5 11 4 4 -1. + <_>5 13 4 2 2. + 0 + 2.4120779708027840e-003 + 0.5079392194747925 + 0.3018598854541779 + <_> + + <_> + + + + <_>11 4 3 3 -1. + <_>12 4 1 3 3. + 0 + -3.6025670851813629e-005 + 0.5601037144660950 + 0.4471096992492676 + <_> + + <_> + + + + <_>6 4 3 3 -1. + <_>7 4 1 3 3. + 0 + -7.4905529618263245e-003 + 0.2207535058259964 + 0.4989944100379944 + <_> + + <_> + + + + <_>16 5 3 6 -1. + <_>17 5 1 6 3. + 0 + -0.0175131205469370 + 0.6531215906143189 + 0.5017648935317993 + <_> + + <_> + + + + <_>3 6 12 7 -1. + <_>7 6 4 7 3. + 0 + 0.1428163051605225 + 0.4967963099479675 + 0.1482062041759491 + <_> + + <_> + + + + <_>16 5 3 6 -1. + <_>17 5 1 6 3. + 0 + 5.5345268920063972e-003 + 0.4898946881294251 + 0.5954223871231079 + <_> + + <_> + + + + <_>3 13 2 3 -1. + <_>3 14 2 1 3. + 0 + -9.6323591424152255e-004 + 0.3927116990089417 + 0.5196074247360230 + <_> + + <_> + + + + <_>16 5 3 6 -1. + <_>17 5 1 6 3. + 0 + -2.0370010752230883e-003 + 0.5613325238227844 + 0.4884858131408691 + <_> + + <_> + + + + <_>1 5 3 6 -1. + <_>2 5 1 6 3. + 0 + 1.6614829655736685e-003 + 0.4472880065441132 + 0.5578880906105042 + <_> + + <_> + + + + <_>1 9 18 1 -1. + <_>7 9 6 1 3. + 0 + -3.1188090797513723e-003 + 0.3840532898902893 + 0.5397477746009827 + <_> + + <_> + + + + <_>0 9 8 7 -1. + <_>4 9 4 7 2. + 0 + -6.4000617712736130e-003 + 0.5843983888626099 + 0.4533218145370483 + <_> + + <_> + + + + <_>12 11 8 2 -1. + <_>12 12 8 1 2. + 0 + 3.1319601112045348e-004 + 0.5439221858978272 + 0.4234727919101715 + <_> + + <_> + + + + <_>0 11 8 2 -1. + <_>0 12 8 1 2. + 0 + -0.0182220991700888 + 0.1288464963436127 + 0.4958404898643494 + <_> + + <_> + + + + <_>9 13 2 3 -1. + <_>9 14 2 1 3. + 0 + 8.7969247251749039e-003 + 0.4951297938823700 + 0.7153480052947998 + <_> + + <_> + + + + <_>4 10 12 4 -1. + <_>4 10 6 2 2. + <_>10 12 6 2 2. + 0 + -4.2395070195198059e-003 + 0.3946599960327148 + 0.5194936990737915 + <_> + + <_> + + + + <_>9 3 3 7 -1. + <_>10 3 1 7 3. + 0 + 9.7086271271109581e-003 + 0.4897503852844238 + 0.6064900159835815 + <_> + + <_> + + + + <_>7 2 3 5 -1. + <_>8 2 1 5 3. + 0 + -3.9934171363711357e-003 + 0.3245440125465393 + 0.5060828924179077 + <_> + + <_> + + + + <_>9 12 4 6 -1. + <_>11 12 2 3 2. + <_>9 15 2 3 2. + 0 + -0.0167850591242313 + 0.1581953018903732 + 0.5203778743743897 + <_> + + <_> + + + + <_>8 7 3 6 -1. + <_>9 7 1 6 3. + 0 + 0.0182720907032490 + 0.4680935144424439 + 0.6626979112625122 + <_> + + <_> + + + + <_>15 4 4 2 -1. + <_>15 5 4 1 2. + 0 + 5.6872838176786900e-003 + 0.5211697816848755 + 0.3512184917926788 + <_> + + <_> + + + + <_>8 7 3 3 -1. + <_>9 7 1 3 3. + 0 + -1.0739039862528443e-003 + 0.5768386125564575 + 0.4529845118522644 + <_> + + <_> + + + + <_>14 2 6 4 -1. + <_>14 4 6 2 2. + 0 + -3.7093870341777802e-003 + 0.4507763087749481 + 0.5313581228256226 + <_> + + <_> + + + + <_>7 16 6 1 -1. + <_>9 16 2 1 3. + 0 + -2.1110709349159151e-004 + 0.5460820198059082 + 0.4333376884460449 + <_> + + <_> + + + + <_>15 13 2 3 -1. + <_>15 14 2 1 3. + 0 + 1.0670139454305172e-003 + 0.5371856093406677 + 0.4078390896320343 + <_> + + <_> + + + + <_>8 7 3 10 -1. + <_>9 7 1 10 3. + 0 + 3.5943021066486835e-003 + 0.4471287131309509 + 0.5643836259841919 + <_> + + <_> + + + + <_>11 10 2 6 -1. + <_>11 12 2 2 3. + 0 + -5.1776031032204628e-003 + 0.4499393105506897 + 0.5280330181121826 + <_> + + <_> + + + + <_>6 10 4 1 -1. + <_>8 10 2 1 2. + 0 + -2.5414369883947074e-004 + 0.5516173243522644 + 0.4407708048820496 + <_> + + <_> + + + + <_>10 9 2 2 -1. + <_>10 10 2 1 2. + 0 + 6.3522560521960258e-003 + 0.5194190144538879 + 0.2465227991342545 + <_> + + <_> + + + + <_>8 9 2 2 -1. + <_>8 10 2 1 2. + 0 + -4.4205080484971404e-004 + 0.3830705881118774 + 0.5139682292938232 + <_> + + <_> + + + + <_>12 7 2 2 -1. + <_>13 7 1 1 2. + <_>12 8 1 1 2. + 0 + 7.4488727841526270e-004 + 0.4891090989112854 + 0.5974786877632141 + <_> + + <_> + + + + <_>5 7 2 2 -1. + <_>5 7 1 1 2. + <_>6 8 1 1 2. + 0 + -3.5116379149258137e-003 + 0.7413681745529175 + 0.4768764972686768 + <_> + + <_> + + + + <_>13 0 3 14 -1. + <_>14 0 1 14 3. + 0 + -0.0125409103929996 + 0.3648819029331207 + 0.5252826809883118 + <_> + + <_> + + + + <_>4 0 3 14 -1. + <_>5 0 1 14 3. + 0 + 9.4931852072477341e-003 + 0.5100492835044861 + 0.3629586994647980 + <_> + + <_> + + + + <_>13 4 3 14 -1. + <_>14 4 1 14 3. + 0 + 0.0129611501470208 + 0.5232442021369934 + 0.4333561062812805 + <_> + + <_> + + + + <_>9 14 2 3 -1. + <_>9 15 2 1 3. + 0 + 4.7209449112415314e-003 + 0.4648149013519287 + 0.6331052780151367 + <_> + + <_> + + + + <_>8 14 4 3 -1. + <_>8 15 4 1 3. + 0 + -2.3119079414755106e-003 + 0.5930309891700745 + 0.4531058073043823 + <_> + + <_> + + + + <_>4 2 3 16 -1. + <_>5 2 1 16 3. + 0 + -2.8262299019843340e-003 + 0.3870477974414825 + 0.5257101058959961 + <_> + + <_> + + + + <_>7 2 8 10 -1. + <_>7 7 8 5 2. + 0 + -1.4311339473351836e-003 + 0.5522503256797791 + 0.4561854898929596 + <_> + + <_> + + + + <_>6 14 7 3 -1. + <_>6 15 7 1 3. + 0 + 1.9378310535103083e-003 + 0.4546220898628235 + 0.5736966729164124 + <_> + + <_> + + + + <_>9 2 10 12 -1. + <_>14 2 5 6 2. + <_>9 8 5 6 2. + 0 + 2.6343559147790074e-004 + 0.5345739126205444 + 0.4571875035762787 + <_> + + <_> + + + + <_>6 7 8 2 -1. + <_>6 8 8 1 2. + 0 + 7.8257522545754910e-004 + 0.3967815935611725 + 0.5220187902450562 + <_> + + <_> + + + + <_>8 13 4 6 -1. + <_>8 16 4 3 2. + 0 + -0.0195504408329725 + 0.2829642891883850 + 0.5243508219718933 + <_> + + <_> + + + + <_>6 6 1 3 -1. + <_>6 7 1 1 3. + 0 + 4.3914958951063454e-004 + 0.4590066969394684 + 0.5899090170860291 + <_> + + <_> + + + + <_>16 2 4 6 -1. + <_>16 4 4 2 3. + 0 + 0.0214520003646612 + 0.5231410861015320 + 0.2855378985404968 + <_> + + <_> + + + + <_>6 6 4 2 -1. + <_>6 6 2 1 2. + <_>8 7 2 1 2. + 0 + 5.8973580598831177e-004 + 0.4397256970405579 + 0.5506421923637390 + <_> + + <_> + + + + <_>16 2 4 6 -1. + <_>16 4 4 2 3. + 0 + -0.0261576101183891 + 0.3135079145431519 + 0.5189175009727478 + <_> + + <_> + + + + <_>0 2 4 6 -1. + <_>0 4 4 2 3. + 0 + -0.0139598604291677 + 0.3213272988796234 + 0.5040717720985413 + <_> + + <_> + + + + <_>9 6 2 6 -1. + <_>9 6 1 6 2. + 0 + -6.3699018210172653e-003 + 0.6387544870376587 + 0.4849506914615631 + <_> + + <_> + + + + <_>3 4 6 10 -1. + <_>3 9 6 5 2. + 0 + -8.5613820701837540e-003 + 0.2759132087230682 + 0.5032019019126892 + <_> + + <_> + + + + <_>9 5 2 6 -1. + <_>9 5 1 6 2. + 0 + 9.6622901037335396e-004 + 0.4685640931129456 + 0.5834879279136658 + <_> + + <_> + + + + <_>3 13 2 3 -1. + <_>3 14 2 1 3. + 0 + 7.6550268568098545e-004 + 0.5175207257270813 + 0.3896422088146210 + <_> + + <_> + + + + <_>13 13 3 2 -1. + <_>13 14 3 1 2. + 0 + -8.1833340227603912e-003 + 0.2069136947393417 + 0.5208122134208679 + <_> + + <_> + + + + <_>2 16 10 4 -1. + <_>2 16 5 2 2. + <_>7 18 5 2 2. + 0 + -9.3976939097046852e-003 + 0.6134091019630432 + 0.4641222953796387 + <_> + + <_> + + + + <_>5 6 10 6 -1. + <_>10 6 5 3 2. + <_>5 9 5 3 2. + 0 + 4.8028980381786823e-003 + 0.5454108119010925 + 0.4395219981670380 + <_> + + <_> + + + + <_>7 14 1 3 -1. + <_>7 15 1 1 3. + 0 + -3.5680569708347321e-003 + 0.6344485282897949 + 0.4681093990802765 + <_> + + <_> + + + + <_>14 16 6 3 -1. + <_>14 17 6 1 3. + 0 + 4.0733120404183865e-003 + 0.5292683243751526 + 0.4015620052814484 + <_> + + <_> + + + + <_>5 4 3 3 -1. + <_>5 5 3 1 3. + 0 + 1.2568129459396005e-003 + 0.4392988085746765 + 0.5452824831008911 + <_> + + <_> + + + + <_>7 4 10 3 -1. + <_>7 5 10 1 3. + 0 + -2.9065010603517294e-003 + 0.5898832082748413 + 0.4863379895687103 + <_> + + <_> + + + + <_>0 4 5 4 -1. + <_>0 6 5 2 2. + 0 + -2.4409340694546700e-003 + 0.4069364964962006 + 0.5247421860694885 + <_> + + <_> + + + + <_>13 11 3 9 -1. + <_>13 14 3 3 3. + 0 + 0.0248307008296251 + 0.5182725787162781 + 0.3682524859905243 + <_> + + <_> + + + + <_>4 11 3 9 -1. + <_>4 14 3 3 3. + 0 + -0.0488540083169937 + 0.1307577937841415 + 0.4961281120777130 + <_> + + <_> + + + + <_>9 7 2 1 -1. + <_>9 7 1 1 2. + 0 + -1.6110379947349429e-003 + 0.6421005725860596 + 0.4872662127017975 + <_> + + <_> + + + + <_>5 0 6 17 -1. + <_>7 0 2 17 3. + 0 + -0.0970094799995422 + 0.0477693490684032 + 0.4950988888740540 + <_> + + <_> + + + + <_>10 3 6 3 -1. + <_>10 3 3 3 2. + 0 + 1.1209240183234215e-003 + 0.4616267085075378 + 0.5354745984077454 + <_> + + <_> + + + + <_>2 2 15 4 -1. + <_>7 2 5 4 3. + 0 + -1.3064090162515640e-003 + 0.6261854171752930 + 0.4638805985450745 + <_> + + <_> + + + + <_>8 2 8 2 -1. + <_>12 2 4 1 2. + <_>8 3 4 1 2. + 0 + 4.5771620352752507e-004 + 0.5384417772293091 + 0.4646640121936798 + <_> + + <_> + + + + <_>8 1 3 6 -1. + <_>8 3 3 2 3. + 0 + -6.3149951165542006e-004 + 0.3804047107696533 + 0.5130257010459900 + <_> + + <_> + + + + <_>9 17 2 2 -1. + <_>9 18 2 1 2. + 0 + 1.4505970466416329e-004 + 0.4554310142993927 + 0.5664461851119995 + <_> + + <_> + + + + <_>0 0 2 14 -1. + <_>1 0 1 14 2. + 0 + -0.0164745505899191 + 0.6596958041191101 + 0.4715859889984131 + <_> + + <_> + + + + <_>12 0 7 3 -1. + <_>12 1 7 1 3. + 0 + 0.0133695797994733 + 0.5195466279983521 + 0.3035964965820313 + <_> + + <_> + + + + <_>1 14 1 2 -1. + <_>1 15 1 1 2. + 0 + 1.0271780047332868e-004 + 0.5229176282882690 + 0.4107066094875336 + <_> + + <_> + + + + <_>14 12 2 8 -1. + <_>15 12 1 4 2. + <_>14 16 1 4 2. + 0 + -5.5311559699475765e-003 + 0.6352887749671936 + 0.4960907101631165 + <_> + + <_> + + + + <_>1 0 7 3 -1. + <_>1 1 7 1 3. + 0 + -2.6187049224972725e-003 + 0.3824546039104462 + 0.5140984058380127 + <_> + + <_> + + + + <_>14 12 2 8 -1. + <_>15 12 1 4 2. + <_>14 16 1 4 2. + 0 + 5.0834268331527710e-003 + 0.4950439929962158 + 0.6220818758010864 + <_> + + <_> + + + + <_>6 0 8 12 -1. + <_>6 0 4 6 2. + <_>10 6 4 6 2. + 0 + 0.0798181593418121 + 0.4952335953712463 + 0.1322475969791412 + <_> + + <_> + + + + <_>6 1 8 9 -1. + <_>6 4 8 3 3. + 0 + -0.0992265865206718 + 0.7542728781700134 + 0.5008416771888733 + <_> + + <_> + + + + <_>5 2 2 2 -1. + <_>5 3 2 1 2. + 0 + -6.5174017800018191e-004 + 0.3699302971363068 + 0.5130121111869812 + <_> + + <_> + + + + <_>13 14 6 6 -1. + <_>16 14 3 3 2. + <_>13 17 3 3 2. + 0 + -0.0189968496561050 + 0.6689178943634033 + 0.4921202957630158 + <_> + + <_> + + + + <_>0 17 20 2 -1. + <_>0 17 10 1 2. + <_>10 18 10 1 2. + 0 + 0.0173468999564648 + 0.4983300864696503 + 0.1859198063611984 + <_> + + <_> + + + + <_>10 3 2 6 -1. + <_>11 3 1 3 2. + <_>10 6 1 3 2. + 0 + 5.5082101607695222e-004 + 0.4574424028396606 + 0.5522121787071228 + <_> + + <_> + + + + <_>5 12 6 2 -1. + <_>8 12 3 2 2. + 0 + 2.0056050270795822e-003 + 0.5131744742393494 + 0.3856469988822937 + <_> + + <_> + + + + <_>10 7 6 13 -1. + <_>10 7 3 13 2. + 0 + -7.7688191086053848e-003 + 0.4361700117588043 + 0.5434309244155884 + <_> + + <_> + + + + <_>5 15 10 5 -1. + <_>10 15 5 5 2. + 0 + 0.0508782789111137 + 0.4682720899581909 + 0.6840639710426331 + <_> + + <_> + + + + <_>10 4 4 10 -1. + <_>10 4 2 10 2. + 0 + -2.2901780903339386e-003 + 0.4329245090484619 + 0.5306099057197571 + <_> + + <_> + + + + <_>5 7 2 1 -1. + <_>6 7 1 1 2. + 0 + -1.5715380141045898e-004 + 0.5370057225227356 + 0.4378164112567902 + <_> + + <_> + + + + <_>10 3 6 7 -1. + <_>10 3 3 7 2. + 0 + 0.1051924005150795 + 0.5137274265289307 + 0.0673614665865898 + <_> + + <_> + + + + <_>4 3 6 7 -1. + <_>7 3 3 7 2. + 0 + 2.7198919560760260e-003 + 0.4112060964107513 + 0.5255665183067322 + <_> + + <_> + + + + <_>1 7 18 5 -1. + <_>7 7 6 5 3. + 0 + 0.0483377799391747 + 0.5404623746871948 + 0.4438967108726502 + <_> + + <_> + + + + <_>3 17 4 3 -1. + <_>5 17 2 3 2. + 0 + 9.5703761326149106e-004 + 0.4355969130992889 + 0.5399510860443115 + <_> + + <_> + + + + <_>8 14 12 6 -1. + <_>14 14 6 3 2. + <_>8 17 6 3 2. + 0 + -0.0253712590783834 + 0.5995175242424011 + 0.5031024813652039 + <_> + + <_> + + + + <_>0 13 20 4 -1. + <_>0 13 10 2 2. + <_>10 15 10 2 2. + 0 + 0.0524579510092735 + 0.4950287938117981 + 0.1398351043462753 + <_> + + <_> + + + + <_>4 5 14 2 -1. + <_>11 5 7 1 2. + <_>4 6 7 1 2. + 0 + -0.0123656298965216 + 0.6397299170494080 + 0.4964106082916260 + <_> + + <_> + + + + <_>1 2 10 12 -1. + <_>1 2 5 6 2. + <_>6 8 5 6 2. + 0 + -0.1458971947431564 + 0.1001669988036156 + 0.4946322143077850 + <_> + + <_> + + + + <_>6 1 14 3 -1. + <_>6 2 14 1 3. + 0 + -0.0159086007624865 + 0.3312329947948456 + 0.5208340883255005 + <_> + + <_> + + + + <_>8 16 2 3 -1. + <_>8 17 2 1 3. + 0 + 3.9486068999394774e-004 + 0.4406363964080811 + 0.5426102876663208 + <_> + + <_> + + + + <_>9 17 3 2 -1. + <_>10 17 1 2 3. + 0 + -5.2454001270234585e-003 + 0.2799589931964874 + 0.5189967155456543 + <_> + + <_> + + + + <_>5 15 4 2 -1. + <_>5 15 2 1 2. + <_>7 16 2 1 2. + 0 + -5.0421799533069134e-003 + 0.6987580060958862 + 0.4752142131328583 + <_> + + <_> + + + + <_>10 15 1 3 -1. + <_>10 16 1 1 3. + 0 + 2.9812189750373363e-003 + 0.4983288943767548 + 0.6307479739189148 + <_> + + <_> + + + + <_>8 16 4 4 -1. + <_>8 16 2 2 2. + <_>10 18 2 2 2. + 0 + -7.2884308174252510e-003 + 0.2982333004474640 + 0.5026869773864746 + <_> + + <_> + + + + <_>6 11 8 6 -1. + <_>6 14 8 3 2. + 0 + 1.5094350092113018e-003 + 0.5308442115783691 + 0.3832970857620239 + <_> + + <_> + + + + <_>2 13 5 2 -1. + <_>2 14 5 1 2. + 0 + -9.3340799212455750e-003 + 0.2037964016199112 + 0.4969817101955414 + <_> + + <_> + + + + <_>13 14 6 6 -1. + <_>16 14 3 3 2. + <_>13 17 3 3 2. + 0 + 0.0286671407520771 + 0.5025696754455566 + 0.6928027272224426 + <_> + + <_> + + + + <_>1 9 18 4 -1. + <_>7 9 6 4 3. + 0 + 0.1701968014240265 + 0.4960052967071533 + 0.1476442962884903 + <_> + + <_> + + + + <_>13 14 6 6 -1. + <_>16 14 3 3 2. + <_>13 17 3 3 2. + 0 + -3.2614478841423988e-003 + 0.5603063702583313 + 0.4826056063175201 + <_> + + <_> + + + + <_>0 2 1 6 -1. + <_>0 4 1 2 3. + 0 + 5.5769277969375253e-004 + 0.5205562114715576 + 0.4129633009433746 + <_> + + <_> + + + + <_>5 0 15 20 -1. + <_>5 10 15 10 2. + 0 + 0.3625833988189697 + 0.5221652984619141 + 0.3768612146377564 + <_> + + <_> + + + + <_>1 14 6 6 -1. + <_>1 14 3 3 2. + <_>4 17 3 3 2. + 0 + -0.0116151301190257 + 0.6022682785987854 + 0.4637489914894104 + <_> + + <_> + + + + <_>8 14 4 6 -1. + <_>10 14 2 3 2. + <_>8 17 2 3 2. + 0 + -4.0795197710394859e-003 + 0.4070447087287903 + 0.5337479114532471 + <_> + + <_> + + + + <_>7 11 2 1 -1. + <_>8 11 1 1 2. + 0 + 5.7204300537705421e-004 + 0.4601835012435913 + 0.5900393128395081 + <_> + + <_> + + + + <_>9 17 3 2 -1. + <_>10 17 1 2 3. + 0 + 6.7543348995968699e-004 + 0.5398252010345459 + 0.4345428943634033 + <_> + + <_> + + + + <_>8 17 3 2 -1. + <_>9 17 1 2 3. + 0 + 6.3295697327703238e-004 + 0.5201563239097595 + 0.4051358997821808 + <_> + + <_> + + + + <_>12 14 4 6 -1. + <_>14 14 2 3 2. + <_>12 17 2 3 2. + 0 + 1.2435320531949401e-003 + 0.4642387926578522 + 0.5547441244125366 + <_> + + <_> + + + + <_>4 14 4 6 -1. + <_>4 14 2 3 2. + <_>6 17 2 3 2. + 0 + -4.7363857738673687e-003 + 0.6198567152023315 + 0.4672552049160004 + <_> + + <_> + + + + <_>13 14 2 6 -1. + <_>14 14 1 3 2. + <_>13 17 1 3 2. + 0 + -6.4658462069928646e-003 + 0.6837332844734192 + 0.5019000768661499 + <_> + + <_> + + + + <_>5 14 2 6 -1. + <_>5 14 1 3 2. + <_>6 17 1 3 2. + 0 + 3.5017321351915598e-004 + 0.4344803094863892 + 0.5363622903823853 + <_> + + <_> + + + + <_>7 0 6 12 -1. + <_>7 4 6 4 3. + 0 + 1.5754920605104417e-004 + 0.4760079085826874 + 0.5732020735740662 + <_> + + <_> + + + + <_>0 7 12 2 -1. + <_>4 7 4 2 3. + 0 + 9.9774366244673729e-003 + 0.5090985894203186 + 0.3635039925575256 + <_> + + <_> + + + + <_>10 3 3 13 -1. + <_>11 3 1 13 3. + 0 + -4.1464529931545258e-004 + 0.5570064783096314 + 0.4593802094459534 + <_> + + <_> + + + + <_>7 3 3 13 -1. + <_>8 3 1 13 3. + 0 + -3.5888899583369493e-004 + 0.5356845855712891 + 0.4339134991168976 + <_> + + <_> + + + + <_>10 8 6 3 -1. + <_>10 9 6 1 3. + 0 + 4.0463250479660928e-004 + 0.4439803063869476 + 0.5436776876449585 + <_> + + <_> + + + + <_>3 11 3 2 -1. + <_>4 11 1 2 3. + 0 + -8.2184787606820464e-004 + 0.4042294919490814 + 0.5176299214363098 + <_> + + <_> + + + + <_>13 12 6 8 -1. + <_>16 12 3 4 2. + <_>13 16 3 4 2. + 0 + 5.9467419050633907e-003 + 0.4927651882171631 + 0.5633779764175415 + <_> + + <_> + + + + <_>7 6 6 5 -1. + <_>9 6 2 5 3. + 0 + -0.0217533893883228 + 0.8006293773651123 + 0.4800840914249420 + <_> + + <_> + + + + <_>17 11 2 7 -1. + <_>17 11 1 7 2. + 0 + -0.0145403798669577 + 0.3946054875850678 + 0.5182222723960877 + <_> + + <_> + + + + <_>3 13 8 2 -1. + <_>7 13 4 2 2. + 0 + -0.0405107699334621 + 0.0213249903172255 + 0.4935792982578278 + <_> + + <_> + + + + <_>6 9 8 3 -1. + <_>6 10 8 1 3. + 0 + -5.8458268176764250e-004 + 0.4012795984745026 + 0.5314025282859802 + <_> + + <_> + + + + <_>4 3 4 3 -1. + <_>4 4 4 1 3. + 0 + 5.5151800625026226e-003 + 0.4642418920993805 + 0.5896260738372803 + <_> + + <_> + + + + <_>11 3 4 3 -1. + <_>11 4 4 1 3. + 0 + -6.0626221820712090e-003 + 0.6502159237861633 + 0.5016477704048157 + <_> + + <_> + + + + <_>1 4 17 12 -1. + <_>1 8 17 4 3. + 0 + 0.0945358425378799 + 0.5264708995819092 + 0.4126827120780945 + <_> + + <_> + + + + <_>11 3 4 3 -1. + <_>11 4 4 1 3. + 0 + 4.7315051779150963e-003 + 0.4879199862480164 + 0.5892447829246521 + <_> + + <_> + + + + <_>4 8 6 3 -1. + <_>4 9 6 1 3. + 0 + -5.2571471314877272e-004 + 0.3917280137538910 + 0.5189412832260132 + <_> + + <_> + + + + <_>12 3 5 3 -1. + <_>12 4 5 1 3. + 0 + -2.5464049540460110e-003 + 0.5837599039077759 + 0.4985705912113190 + <_> + + <_> + + + + <_>1 11 2 7 -1. + <_>2 11 1 7 2. + 0 + -0.0260756891220808 + 0.1261983960866928 + 0.4955821931362152 + <_> + + <_> + + + + <_>15 12 2 8 -1. + <_>16 12 1 4 2. + <_>15 16 1 4 2. + 0 + -5.4779709316790104e-003 + 0.5722513794898987 + 0.5010265707969666 + <_> + + <_> + + + + <_>4 8 11 3 -1. + <_>4 9 11 1 3. + 0 + 5.1337741315364838e-003 + 0.5273262262344360 + 0.4226376116275787 + <_> + + <_> + + + + <_>9 13 6 2 -1. + <_>12 13 3 1 2. + <_>9 14 3 1 2. + 0 + 4.7944980906322598e-004 + 0.4450066983699799 + 0.5819587111473084 + <_> + + <_> + + + + <_>6 13 4 3 -1. + <_>6 14 4 1 3. + 0 + -2.1114079281687737e-003 + 0.5757653117179871 + 0.4511714875698090 + <_> + + <_> + + + + <_>9 12 3 3 -1. + <_>10 12 1 3 3. + 0 + -0.0131799904629588 + 0.1884381026029587 + 0.5160734057426453 + <_> + + <_> + + + + <_>5 3 3 3 -1. + <_>5 4 3 1 3. + 0 + -4.7968099825084209e-003 + 0.6589789986610413 + 0.4736118912696838 + <_> + + <_> + + + + <_>9 4 2 3 -1. + <_>9 5 2 1 3. + 0 + 6.7483168095350266e-003 + 0.5259429812431335 + 0.3356395065784454 + <_> + + <_> + + + + <_>0 2 16 3 -1. + <_>0 3 16 1 3. + 0 + 1.4623369788751006e-003 + 0.5355271100997925 + 0.4264092147350311 + <_> + + <_> + + + + <_>15 12 2 8 -1. + <_>16 12 1 4 2. + <_>15 16 1 4 2. + 0 + 4.7645159065723419e-003 + 0.5034406781196594 + 0.5786827802658081 + <_> + + <_> + + + + <_>3 12 2 8 -1. + <_>3 12 1 4 2. + <_>4 16 1 4 2. + 0 + 6.8066660314798355e-003 + 0.4756605029106140 + 0.6677829027175903 + <_> + + <_> + + + + <_>14 13 3 6 -1. + <_>14 15 3 2 3. + 0 + 3.6608621012419462e-003 + 0.5369611978530884 + 0.4311546981334686 + <_> + + <_> + + + + <_>3 13 3 6 -1. + <_>3 15 3 2 3. + 0 + 0.0214496403932571 + 0.4968641996383667 + 0.1888816058635712 + <_> + + <_> + + + + <_>6 5 10 2 -1. + <_>11 5 5 1 2. + <_>6 6 5 1 2. + 0 + 4.1678901761770248e-003 + 0.4930733144283295 + 0.5815368890762329 + <_> + + <_> + + + + <_>2 14 14 6 -1. + <_>2 17 14 3 2. + 0 + 8.6467564105987549e-003 + 0.5205205082893372 + 0.4132595062255859 + <_> + + <_> + + + + <_>10 14 1 3 -1. + <_>10 15 1 1 3. + 0 + -3.6114078829996288e-004 + 0.5483555197715759 + 0.4800927937030792 + <_> + + <_> + + + + <_>4 16 2 2 -1. + <_>4 16 1 1 2. + <_>5 17 1 1 2. + 0 + 1.0808729566633701e-003 + 0.4689902067184448 + 0.6041421294212341 + <_> + + <_> + + + + <_>10 6 2 3 -1. + <_>10 7 2 1 3. + 0 + 5.7719959877431393e-003 + 0.5171142220497131 + 0.3053277134895325 + <_> + + <_> + + + + <_>0 17 20 2 -1. + <_>0 17 10 1 2. + <_>10 18 10 1 2. + 0 + 1.5720770461484790e-003 + 0.5219978094100952 + 0.4178803861141205 + <_> + + <_> + + + + <_>13 6 1 3 -1. + <_>13 7 1 1 3. + 0 + -1.9307859474793077e-003 + 0.5860369801521301 + 0.4812920093536377 + <_> + + <_> + + + + <_>8 13 3 2 -1. + <_>9 13 1 2 3. + 0 + -7.8926272690296173e-003 + 0.1749276965856552 + 0.4971733987331390 + <_> + + <_> + + + + <_>12 2 3 3 -1. + <_>13 2 1 3 3. + 0 + -2.2224679123610258e-003 + 0.4342589080333710 + 0.5212848186492920 + <_> + + <_> + + + + <_>3 18 2 2 -1. + <_>3 18 1 1 2. + <_>4 19 1 1 2. + 0 + 1.9011989934369922e-003 + 0.4765186905860901 + 0.6892055273056030 + <_> + + <_> + + + + <_>9 16 3 4 -1. + <_>10 16 1 4 3. + 0 + 2.7576119173318148e-003 + 0.5262191295623779 + 0.4337486028671265 + <_> + + <_> + + + + <_>6 6 1 3 -1. + <_>6 7 1 1 3. + 0 + 5.1787449046969414e-003 + 0.4804069101810455 + 0.7843729257583618 + <_> + + <_> + + + + <_>13 1 5 2 -1. + <_>13 2 5 1 2. + 0 + -9.0273341629654169e-004 + 0.4120846986770630 + 0.5353423953056335 + <_> + + <_> + + + + <_>7 14 6 2 -1. + <_>7 14 3 1 2. + <_>10 15 3 1 2. + 0 + 5.1797959022223949e-003 + 0.4740372896194458 + 0.6425960063934326 + <_> + + <_> + + + + <_>11 3 3 4 -1. + <_>12 3 1 4 3. + 0 + -0.0101140001788735 + 0.2468792051076889 + 0.5175017714500427 + <_> + + <_> + + + + <_>1 13 12 6 -1. + <_>5 13 4 6 3. + 0 + -0.0186170600354671 + 0.5756294131278992 + 0.4628978967666626 + <_> + + <_> + + + + <_>14 11 5 2 -1. + <_>14 12 5 1 2. + 0 + 5.9225959703326225e-003 + 0.5169625878334045 + 0.3214271068572998 + <_> + + <_> + + + + <_>2 15 14 4 -1. + <_>2 15 7 2 2. + <_>9 17 7 2 2. + 0 + -6.2945079989731312e-003 + 0.3872014880180359 + 0.5141636729240418 + <_> + + <_> + + + + <_>3 7 14 2 -1. + <_>10 7 7 1 2. + <_>3 8 7 1 2. + 0 + 6.5353019163012505e-003 + 0.4853048920631409 + 0.6310489773750305 + <_> + + <_> + + + + <_>1 11 4 2 -1. + <_>1 12 4 1 2. + 0 + 1.0878399480134249e-003 + 0.5117315053939819 + 0.3723258972167969 + <_> + + <_> + + + + <_>14 0 6 14 -1. + <_>16 0 2 14 3. + 0 + -0.0225422400981188 + 0.5692740082740784 + 0.4887112975120544 + <_> + + <_> + + + + <_>4 11 1 3 -1. + <_>4 12 1 1 3. + 0 + -3.0065660830587149e-003 + 0.2556012868881226 + 0.5003992915153503 + <_> + + <_> + + + + <_>14 0 6 14 -1. + <_>16 0 2 14 3. + 0 + 7.4741272255778313e-003 + 0.4810872972011566 + 0.5675926804542542 + <_> + + <_> + + + + <_>1 10 3 7 -1. + <_>2 10 1 7 3. + 0 + 0.0261623207479715 + 0.4971194863319397 + 0.1777237057685852 + <_> + + <_> + + + + <_>8 12 9 2 -1. + <_>8 13 9 1 2. + 0 + 9.4352738233283162e-004 + 0.4940010905265808 + 0.5491250753402710 + <_> + + <_> + + + + <_>0 6 20 1 -1. + <_>10 6 10 1 2. + 0 + 0.0333632417023182 + 0.5007612109184265 + 0.2790724039077759 + <_> + + <_> + + + + <_>8 4 4 4 -1. + <_>8 4 2 4 2. + 0 + -0.0151186501607299 + 0.7059578895568848 + 0.4973031878471375 + <_> + + <_> + + + + <_>0 0 2 2 -1. + <_>0 1 2 1 2. + 0 + 9.8648946732282639e-004 + 0.5128620266914368 + 0.3776761889457703 + 104.7491989135742200 + 19 + -1 + <_> + + + <_> + + <_> + + + + <_>5 3 10 9 -1. + <_>5 6 10 3 3. + 0 + -0.0951507985591888 + 0.6470757126808167 + 0.4017286896705627 + <_> + + <_> + + + + <_>15 2 4 10 -1. + <_>15 2 2 10 2. + 0 + 6.2702340073883533e-003 + 0.3999822139739990 + 0.5746449232101440 + <_> + + <_> + + + + <_>8 2 2 7 -1. + <_>9 2 1 7 2. + 0 + 3.0018089455552399e-004 + 0.3558770120143890 + 0.5538809895515442 + <_> + + <_> + + + + <_>7 4 12 1 -1. + <_>11 4 4 1 3. + 0 + 1.1757409665733576e-003 + 0.4256534874439240 + 0.5382617712020874 + <_> + + <_> + + + + <_>3 4 9 1 -1. + <_>6 4 3 1 3. + 0 + 4.4235268433112651e-005 + 0.3682908117771149 + 0.5589926838874817 + <_> + + <_> + + + + <_>15 10 1 4 -1. + <_>15 12 1 2 2. + 0 + -2.9936920327600092e-005 + 0.5452470183372498 + 0.4020367860794067 + <_> + + <_> + + + + <_>4 10 6 4 -1. + <_>7 10 3 4 2. + 0 + 3.0073199886828661e-003 + 0.5239058136940002 + 0.3317843973636627 + <_> + + <_> + + + + <_>15 9 1 6 -1. + <_>15 12 1 3 2. + 0 + -0.0105138896033168 + 0.4320689141750336 + 0.5307983756065369 + <_> + + <_> + + + + <_>7 17 6 3 -1. + <_>7 18 6 1 3. + 0 + 8.3476826548576355e-003 + 0.4504637122154236 + 0.6453298926353455 + <_> + + <_> + + + + <_>14 3 2 16 -1. + <_>15 3 1 8 2. + <_>14 11 1 8 2. + 0 + -3.1492270063608885e-003 + 0.4313425123691559 + 0.5370525121688843 + <_> + + <_> + + + + <_>4 9 1 6 -1. + <_>4 12 1 3 2. + 0 + -1.4435649973165710e-005 + 0.5326603055000305 + 0.3817971944808960 + <_> + + <_> + + + + <_>12 1 5 2 -1. + <_>12 2 5 1 2. + 0 + -4.2855090578086674e-004 + 0.4305163919925690 + 0.5382009744644165 + <_> + + <_> + + + + <_>6 18 4 2 -1. + <_>6 18 2 1 2. + <_>8 19 2 1 2. + 0 + 1.5062429883982986e-004 + 0.4235970973968506 + 0.5544965267181397 + <_> + + <_> + + + + <_>2 4 16 10 -1. + <_>10 4 8 5 2. + <_>2 9 8 5 2. + 0 + 0.0715598315000534 + 0.5303059816360474 + 0.2678802907466888 + <_> + + <_> + + + + <_>6 5 1 10 -1. + <_>6 10 1 5 2. + 0 + 8.4095180500298738e-004 + 0.3557108938694000 + 0.5205433964729309 + <_> + + <_> + + + + <_>4 8 15 2 -1. + <_>9 8 5 2 3. + 0 + 0.0629865005612373 + 0.5225362777709961 + 0.2861376106739044 + <_> + + <_> + + + + <_>1 8 15 2 -1. + <_>6 8 5 2 3. + 0 + -3.3798629883676767e-003 + 0.3624185919761658 + 0.5201697945594788 + <_> + + <_> + + + + <_>9 5 3 6 -1. + <_>9 7 3 2 3. + 0 + -1.1810739670181647e-004 + 0.5474476814270020 + 0.3959893882274628 + <_> + + <_> + + + + <_>5 7 8 2 -1. + <_>9 7 4 2 2. + 0 + -5.4505601292476058e-004 + 0.3740422129631043 + 0.5215715765953064 + <_> + + <_> + + + + <_>9 11 2 3 -1. + <_>9 12 2 1 3. + 0 + -1.8454910023137927e-003 + 0.5893052220344544 + 0.4584448933601379 + <_> + + <_> + + + + <_>1 0 16 3 -1. + <_>1 1 16 1 3. + 0 + -4.3832371011376381e-004 + 0.4084582030773163 + 0.5385351181030273 + <_> + + <_> + + + + <_>11 2 7 2 -1. + <_>11 3 7 1 2. + 0 + -2.4000830017030239e-003 + 0.3777455091476440 + 0.5293580293655396 + <_> + + <_> + + + + <_>5 1 10 18 -1. + <_>5 7 10 6 3. + 0 + -0.0987957417964935 + 0.2963612079620361 + 0.5070089101791382 + <_> + + <_> + + + + <_>17 4 3 2 -1. + <_>18 4 1 2 3. + 0 + 3.1798239797353745e-003 + 0.4877632856369019 + 0.6726443767547607 + <_> + + <_> + + + + <_>8 13 1 3 -1. + <_>8 14 1 1 3. + 0 + 3.2406419632025063e-004 + 0.4366911053657532 + 0.5561109781265259 + <_> + + <_> + + + + <_>3 14 14 6 -1. + <_>3 16 14 2 3. + 0 + -0.0325472503900528 + 0.3128157854080200 + 0.5308616161346436 + <_> + + <_> + + + + <_>0 2 3 4 -1. + <_>1 2 1 4 3. + 0 + -7.7561130747199059e-003 + 0.6560224890708923 + 0.4639872014522553 + <_> + + <_> + + + + <_>12 1 5 2 -1. + <_>12 2 5 1 2. + 0 + 0.0160272493958473 + 0.5172680020332336 + 0.3141897916793823 + <_> + + <_> + + + + <_>3 1 5 2 -1. + <_>3 2 5 1 2. + 0 + 7.1002350523485802e-006 + 0.4084446132183075 + 0.5336294770240784 + <_> + + <_> + + + + <_>10 13 2 3 -1. + <_>10 14 2 1 3. + 0 + 7.3422808200120926e-003 + 0.4966922104358673 + 0.6603465080261231 + <_> + + <_> + + + + <_>8 13 2 3 -1. + <_>8 14 2 1 3. + 0 + -1.6970280557870865e-003 + 0.5908237099647522 + 0.4500182867050171 + <_> + + <_> + + + + <_>14 12 2 3 -1. + <_>14 13 2 1 3. + 0 + 2.4118260480463505e-003 + 0.5315160751342773 + 0.3599720895290375 + <_> + + <_> + + + + <_>7 2 2 3 -1. + <_>7 3 2 1 3. + 0 + -5.5300937965512276e-003 + 0.2334040999412537 + 0.4996814131736755 + <_> + + <_> + + + + <_>5 6 10 4 -1. + <_>10 6 5 2 2. + <_>5 8 5 2 2. + 0 + -2.6478730142116547e-003 + 0.5880935788154602 + 0.4684734046459198 + <_> + + <_> + + + + <_>9 13 1 6 -1. + <_>9 16 1 3 2. + 0 + 0.0112956296652555 + 0.4983777105808258 + 0.1884590983390808 + <_> + + <_> + + + + <_>10 12 2 2 -1. + <_>11 12 1 1 2. + <_>10 13 1 1 2. + 0 + -6.6952878842130303e-004 + 0.5872138142585754 + 0.4799019992351532 + <_> + + <_> + + + + <_>4 12 2 3 -1. + <_>4 13 2 1 3. + 0 + 1.4410680159926414e-003 + 0.5131189227104187 + 0.3501011133193970 + <_> + + <_> + + + + <_>14 4 6 6 -1. + <_>14 6 6 2 3. + 0 + 2.4637870956212282e-003 + 0.5339372158050537 + 0.4117639064788818 + <_> + + <_> + + + + <_>8 17 2 3 -1. + <_>8 18 2 1 3. + 0 + 3.3114518737420440e-004 + 0.4313383102416992 + 0.5398246049880981 + <_> + + <_> + + + + <_>16 4 4 6 -1. + <_>16 6 4 2 3. + 0 + -0.0335572697222233 + 0.2675336897373200 + 0.5179154872894287 + <_> + + <_> + + + + <_>0 4 4 6 -1. + <_>0 6 4 2 3. + 0 + 0.0185394193977118 + 0.4973869919776917 + 0.2317177057266235 + <_> + + <_> + + + + <_>14 6 2 3 -1. + <_>14 6 1 3 2. + 0 + -2.9698139405809343e-004 + 0.5529708266258240 + 0.4643664062023163 + <_> + + <_> + + + + <_>4 9 8 1 -1. + <_>8 9 4 1 2. + 0 + -4.5577259152196348e-004 + 0.5629584193229675 + 0.4469191133975983 + <_> + + <_> + + + + <_>8 12 4 3 -1. + <_>8 13 4 1 3. + 0 + -0.0101589802652597 + 0.6706212759017944 + 0.4925918877124786 + <_> + + <_> + + + + <_>5 12 10 6 -1. + <_>5 14 10 2 3. + 0 + -2.2413829356082715e-005 + 0.5239421725273132 + 0.3912901878356934 + <_> + + <_> + + + + <_>11 12 1 2 -1. + <_>11 13 1 1 2. + 0 + 7.2034963523037732e-005 + 0.4799438118934631 + 0.5501788854598999 + <_> + + <_> + + + + <_>8 15 4 2 -1. + <_>8 16 4 1 2. + 0 + -6.9267209619283676e-003 + 0.6930009722709656 + 0.4698084890842438 + <_> + + <_> + + + + <_>6 9 8 8 -1. + <_>10 9 4 4 2. + <_>6 13 4 4 2. + 0 + -7.6997838914394379e-003 + 0.4099623858928680 + 0.5480883121490479 + <_> + + <_> + + + + <_>7 12 4 6 -1. + <_>7 12 2 3 2. + <_>9 15 2 3 2. + 0 + -7.3130549862980843e-003 + 0.3283475935459137 + 0.5057886242866516 + <_> + + <_> + + + + <_>10 11 3 1 -1. + <_>11 11 1 1 3. + 0 + 1.9650589674711227e-003 + 0.4978047013282776 + 0.6398249864578247 + <_> + + <_> + + + + <_>9 7 2 10 -1. + <_>9 7 1 5 2. + <_>10 12 1 5 2. + 0 + 7.1647600270807743e-003 + 0.4661160111427307 + 0.6222137212753296 + <_> + + <_> + + + + <_>8 0 6 6 -1. + <_>10 0 2 6 3. + 0 + -0.0240786392241716 + 0.2334644943475723 + 0.5222162008285523 + <_> + + <_> + + + + <_>3 11 2 6 -1. + <_>3 13 2 2 3. + 0 + -0.0210279691964388 + 0.1183653995394707 + 0.4938226044178009 + <_> + + <_> + + + + <_>16 12 1 2 -1. + <_>16 13 1 1 2. + 0 + 3.6017020465806127e-004 + 0.5325019955635071 + 0.4116711020469666 + <_> + + <_> + + + + <_>1 14 6 6 -1. + <_>1 14 3 3 2. + <_>4 17 3 3 2. + 0 + -0.0172197297215462 + 0.6278762221336365 + 0.4664269089698792 + <_> + + <_> + + + + <_>13 1 3 6 -1. + <_>14 1 1 6 3. + 0 + -7.8672142699360847e-003 + 0.3403415083885193 + 0.5249736905097961 + <_> + + <_> + + + + <_>8 8 2 2 -1. + <_>8 9 2 1 2. + 0 + -4.4777389848604798e-004 + 0.3610411882400513 + 0.5086259245872498 + <_> + + <_> + + + + <_>9 9 3 3 -1. + <_>10 9 1 3 3. + 0 + 5.5486010387539864e-003 + 0.4884265959262848 + 0.6203498244285584 + <_> + + <_> + + + + <_>8 7 3 3 -1. + <_>8 8 3 1 3. + 0 + -6.9461148232221603e-003 + 0.2625930011272430 + 0.5011097192764282 + <_> + + <_> + + + + <_>14 0 2 3 -1. + <_>14 0 1 3 2. + 0 + 1.3569870498031378e-004 + 0.4340794980525971 + 0.5628312230110169 + <_> + + <_> + + + + <_>1 0 18 9 -1. + <_>7 0 6 9 3. + 0 + -0.0458802506327629 + 0.6507998704910278 + 0.4696274995803833 + <_> + + <_> + + + + <_>11 5 4 15 -1. + <_>11 5 2 15 2. + 0 + -0.0215825606137514 + 0.3826502859592438 + 0.5287616848945618 + <_> + + <_> + + + + <_>5 5 4 15 -1. + <_>7 5 2 15 2. + 0 + -0.0202095396816731 + 0.3233368098735809 + 0.5074477195739746 + <_> + + <_> + + + + <_>14 0 2 3 -1. + <_>14 0 1 3 2. + 0 + 5.8496710844337940e-003 + 0.5177603960037231 + 0.4489670991897583 + <_> + + <_> + + + + <_>4 0 2 3 -1. + <_>5 0 1 3 2. + 0 + -5.7476379879517481e-005 + 0.4020850956439972 + 0.5246363878250122 + <_> + + <_> + + + + <_>11 12 2 2 -1. + <_>12 12 1 1 2. + <_>11 13 1 1 2. + 0 + -1.1513100471347570e-003 + 0.6315072178840637 + 0.4905154109001160 + <_> + + <_> + + + + <_>7 12 2 2 -1. + <_>7 12 1 1 2. + <_>8 13 1 1 2. + 0 + 1.9862831104546785e-003 + 0.4702459871768951 + 0.6497151255607605 + <_> + + <_> + + + + <_>12 0 3 4 -1. + <_>13 0 1 4 3. + 0 + -5.2719512023031712e-003 + 0.3650383949279785 + 0.5227652788162231 + <_> + + <_> + + + + <_>4 11 3 3 -1. + <_>4 12 3 1 3. + 0 + 1.2662699446082115e-003 + 0.5166100859642029 + 0.3877618014812470 + <_> + + <_> + + + + <_>12 7 4 2 -1. + <_>12 8 4 1 2. + 0 + -6.2919440679252148e-003 + 0.7375894188880920 + 0.5023847818374634 + <_> + + <_> + + + + <_>8 10 3 2 -1. + <_>9 10 1 2 3. + 0 + 6.7360111279413104e-004 + 0.4423226118087769 + 0.5495585799217224 + <_> + + <_> + + + + <_>9 9 3 2 -1. + <_>10 9 1 2 3. + 0 + -1.0523450328037143e-003 + 0.5976396203041077 + 0.4859583079814911 + <_> + + <_> + + + + <_>8 9 3 2 -1. + <_>9 9 1 2 3. + 0 + -4.4216238893568516e-004 + 0.5955939292907715 + 0.4398930966854096 + <_> + + <_> + + + + <_>12 0 3 4 -1. + <_>13 0 1 4 3. + 0 + 1.1747940443456173e-003 + 0.5349888205528259 + 0.4605058133602142 + <_> + + <_> + + + + <_>5 0 3 4 -1. + <_>6 0 1 4 3. + 0 + 5.2457437850534916e-003 + 0.5049191117286682 + 0.2941577136516571 + <_> + + <_> + + + + <_>4 14 12 4 -1. + <_>10 14 6 2 2. + <_>4 16 6 2 2. + 0 + -0.0245397202670574 + 0.2550177872180939 + 0.5218586921691895 + <_> + + <_> + + + + <_>8 13 2 3 -1. + <_>8 14 2 1 3. + 0 + 7.3793041519820690e-004 + 0.4424861073493958 + 0.5490816235542297 + <_> + + <_> + + + + <_>10 10 3 8 -1. + <_>10 14 3 4 2. + 0 + 1.4233799884095788e-003 + 0.5319514274597168 + 0.4081355929374695 + <_> + + <_> + + + + <_>8 10 4 8 -1. + <_>8 10 2 4 2. + <_>10 14 2 4 2. + 0 + -2.4149110540747643e-003 + 0.4087659120559692 + 0.5238950252532959 + <_> + + <_> + + + + <_>10 8 3 1 -1. + <_>11 8 1 1 3. + 0 + -1.2165299849584699e-003 + 0.5674579143524170 + 0.4908052980899811 + <_> + + <_> + + + + <_>9 12 1 6 -1. + <_>9 15 1 3 2. + 0 + -1.2438809499144554e-003 + 0.4129425883293152 + 0.5256118178367615 + <_> + + <_> + + + + <_>10 8 3 1 -1. + <_>11 8 1 1 3. + 0 + 6.1942739412188530e-003 + 0.5060194134712219 + 0.7313653230667114 + <_> + + <_> + + + + <_>7 8 3 1 -1. + <_>8 8 1 1 3. + 0 + -1.6607169527560472e-003 + 0.5979632139205933 + 0.4596369862556458 + <_> + + <_> + + + + <_>5 2 15 14 -1. + <_>5 9 15 7 2. + 0 + -0.0273162592202425 + 0.4174365103244782 + 0.5308842062950134 + <_> + + <_> + + + + <_>2 1 2 10 -1. + <_>2 1 1 5 2. + <_>3 6 1 5 2. + 0 + -1.5845570014789701e-003 + 0.5615804791450501 + 0.4519486129283905 + <_> + + <_> + + + + <_>14 14 2 3 -1. + <_>14 15 2 1 3. + 0 + -1.5514739789068699e-003 + 0.4076187014579773 + 0.5360785126686096 + <_> + + <_> + + + + <_>2 7 3 3 -1. + <_>3 7 1 3 3. + 0 + 3.8446558755822480e-004 + 0.4347293972969055 + 0.5430442094802856 + <_> + + <_> + + + + <_>17 4 3 3 -1. + <_>17 5 3 1 3. + 0 + -0.0146722598001361 + 0.1659304946660996 + 0.5146093964576721 + <_> + + <_> + + + + <_>0 4 3 3 -1. + <_>0 5 3 1 3. + 0 + 8.1608882173895836e-003 + 0.4961819052696228 + 0.1884745955467224 + <_> + + <_> + + + + <_>13 5 6 2 -1. + <_>16 5 3 1 2. + <_>13 6 3 1 2. + 0 + 1.1121659772470593e-003 + 0.4868263900279999 + 0.6093816161155701 + <_> + + <_> + + + + <_>4 19 12 1 -1. + <_>8 19 4 1 3. + 0 + -7.2603770531713963e-003 + 0.6284325122833252 + 0.4690375924110413 + <_> + + <_> + + + + <_>12 12 2 4 -1. + <_>12 14 2 2 2. + 0 + -2.4046430189628154e-004 + 0.5575000047683716 + 0.4046044051647186 + <_> + + <_> + + + + <_>3 15 1 3 -1. + <_>3 16 1 1 3. + 0 + -2.3348190006799996e-004 + 0.4115762114524841 + 0.5252848267555237 + <_> + + <_> + + + + <_>11 16 6 4 -1. + <_>11 16 3 4 2. + 0 + 5.5736480280756950e-003 + 0.4730072915554047 + 0.5690100789070129 + <_> + + <_> + + + + <_>2 10 3 10 -1. + <_>3 10 1 10 3. + 0 + 0.0306237693876028 + 0.4971886873245239 + 0.1740095019340515 + <_> + + <_> + + + + <_>12 8 2 4 -1. + <_>12 8 1 4 2. + 0 + 9.2074798885732889e-004 + 0.5372117757797241 + 0.4354872107505798 + <_> + + <_> + + + + <_>6 8 2 4 -1. + <_>7 8 1 4 2. + 0 + -4.3550739064812660e-005 + 0.5366883873939514 + 0.4347316920757294 + <_> + + <_> + + + + <_>10 14 2 3 -1. + <_>10 14 1 3 2. + 0 + -6.6452710889279842e-003 + 0.3435518145561218 + 0.5160533189773560 + <_> + + <_> + + + + <_>5 1 10 3 -1. + <_>10 1 5 3 2. + 0 + 0.0432219989597797 + 0.4766792058944702 + 0.7293652892112732 + <_> + + <_> + + + + <_>10 7 3 2 -1. + <_>11 7 1 2 3. + 0 + 2.2331769578158855e-003 + 0.5029315948486328 + 0.5633171200752258 + <_> + + <_> + + + + <_>5 6 9 2 -1. + <_>8 6 3 2 3. + 0 + 3.1829739455133677e-003 + 0.4016092121601105 + 0.5192136764526367 + <_> + + <_> + + + + <_>9 8 2 2 -1. + <_>9 9 2 1 2. + 0 + -1.8027749320026487e-004 + 0.4088315963745117 + 0.5417919754981995 + <_> + + <_> + + + + <_>2 11 16 6 -1. + <_>2 11 8 3 2. + <_>10 14 8 3 2. + 0 + -5.2934689447283745e-003 + 0.4075677096843720 + 0.5243561863899231 + <_> + + <_> + + + + <_>12 7 2 2 -1. + <_>13 7 1 1 2. + <_>12 8 1 1 2. + 0 + 1.2750959722325206e-003 + 0.4913282990455627 + 0.6387010812759399 + <_> + + <_> + + + + <_>9 5 2 3 -1. + <_>9 6 2 1 3. + 0 + 4.3385322205722332e-003 + 0.5031672120094299 + 0.2947346866130829 + <_> + + <_> + + + + <_>9 7 3 2 -1. + <_>10 7 1 2 3. + 0 + 8.5250744596123695e-003 + 0.4949789047241211 + 0.6308869123458862 + <_> + + <_> + + + + <_>5 1 8 12 -1. + <_>5 7 8 6 2. + 0 + -9.4266352243721485e-004 + 0.5328366756439209 + 0.4285649955272675 + <_> + + <_> + + + + <_>13 5 2 2 -1. + <_>13 6 2 1 2. + 0 + 1.3609660090878606e-003 + 0.4991525113582611 + 0.5941501259803772 + <_> + + <_> + + + + <_>5 5 2 2 -1. + <_>5 6 2 1 2. + 0 + 4.4782509212382138e-004 + 0.4573504030704498 + 0.5854480862617493 + <_> + + <_> + + + + <_>12 4 3 3 -1. + <_>12 5 3 1 3. + 0 + 1.3360050506889820e-003 + 0.4604358971118927 + 0.5849052071571350 + <_> + + <_> + + + + <_>4 14 2 3 -1. + <_>4 15 2 1 3. + 0 + -6.0967548051849008e-004 + 0.3969388902187347 + 0.5229423046112061 + <_> + + <_> + + + + <_>12 4 3 3 -1. + <_>12 5 3 1 3. + 0 + -2.3656780831515789e-003 + 0.5808320045471191 + 0.4898357093334198 + <_> + + <_> + + + + <_>5 4 3 3 -1. + <_>5 5 3 1 3. + 0 + 1.0734340175986290e-003 + 0.4351210892200470 + 0.5470039248466492 + <_> + + <_> + + + + <_>9 14 2 6 -1. + <_>10 14 1 3 2. + <_>9 17 1 3 2. + 0 + 2.1923359017819166e-003 + 0.5355060100555420 + 0.3842903971672058 + <_> + + <_> + + + + <_>8 14 3 2 -1. + <_>9 14 1 2 3. + 0 + 5.4968618787825108e-003 + 0.5018138885498047 + 0.2827191948890686 + <_> + + <_> + + + + <_>9 5 6 6 -1. + <_>11 5 2 6 3. + 0 + -0.0753688216209412 + 0.1225076019763947 + 0.5148826837539673 + <_> + + <_> + + + + <_>5 5 6 6 -1. + <_>7 5 2 6 3. + 0 + 0.0251344703137875 + 0.4731766879558563 + 0.7025446295738220 + <_> + + <_> + + + + <_>13 13 1 2 -1. + <_>13 14 1 1 2. + 0 + -2.9358599931583740e-005 + 0.5430532097816467 + 0.4656086862087250 + <_> + + <_> + + + + <_>0 2 10 2 -1. + <_>0 3 10 1 2. + 0 + -5.8355910005047917e-004 + 0.4031040072441101 + 0.5190119743347168 + <_> + + <_> + + + + <_>13 13 1 2 -1. + <_>13 14 1 1 2. + 0 + -2.6639450807124376e-003 + 0.4308126866817474 + 0.5161771178245544 + <_> + + <_> + + + + <_>5 7 2 2 -1. + <_>5 7 1 1 2. + <_>6 8 1 1 2. + 0 + -1.3804089976474643e-003 + 0.6219829916954041 + 0.4695515930652618 + <_> + + <_> + + + + <_>13 5 2 7 -1. + <_>13 5 1 7 2. + 0 + 1.2313219485804439e-003 + 0.5379363894462585 + 0.4425831139087677 + <_> + + <_> + + + + <_>6 13 1 2 -1. + <_>6 14 1 1 2. + 0 + -1.4644179827882908e-005 + 0.5281640291213989 + 0.4222503006458283 + <_> + + <_> + + + + <_>11 0 3 7 -1. + <_>12 0 1 7 3. + 0 + -0.0128188095986843 + 0.2582092881202698 + 0.5179932713508606 + <_> + + <_> + + + + <_>0 3 2 16 -1. + <_>0 3 1 8 2. + <_>1 11 1 8 2. + 0 + 0.0228521898388863 + 0.4778693020343781 + 0.7609264254570007 + <_> + + <_> + + + + <_>11 0 3 7 -1. + <_>12 0 1 7 3. + 0 + 8.2305970136076212e-004 + 0.5340992212295532 + 0.4671724140644074 + <_> + + <_> + + + + <_>6 0 3 7 -1. + <_>7 0 1 7 3. + 0 + 0.0127701200544834 + 0.4965761005878449 + 0.1472366005182266 + <_> + + <_> + + + + <_>11 16 8 4 -1. + <_>11 16 4 4 2. + 0 + -0.0500515103340149 + 0.6414994001388550 + 0.5016592144966126 + <_> + + <_> + + + + <_>1 16 8 4 -1. + <_>5 16 4 4 2. + 0 + 0.0157752707600594 + 0.4522320032119751 + 0.5685362219810486 + <_> + + <_> + + + + <_>13 5 2 7 -1. + <_>13 5 1 7 2. + 0 + -0.0185016207396984 + 0.2764748930931091 + 0.5137959122657776 + <_> + + <_> + + + + <_>5 5 2 7 -1. + <_>6 5 1 7 2. + 0 + 2.4626250378787518e-003 + 0.5141941905021668 + 0.3795408010482788 + <_> + + <_> + + + + <_>18 6 2 14 -1. + <_>18 13 2 7 2. + 0 + 0.0629161670804024 + 0.5060648918151856 + 0.6580433845520020 + <_> + + <_> + + + + <_>6 10 3 4 -1. + <_>6 12 3 2 2. + 0 + -2.1648500478477217e-005 + 0.5195388197898865 + 0.4019886851310730 + <_> + + <_> + + + + <_>14 7 1 2 -1. + <_>14 8 1 1 2. + 0 + 2.1180990152060986e-003 + 0.4962365031242371 + 0.5954458713531494 + <_> + + <_> + + + + <_>0 1 18 6 -1. + <_>0 1 9 3 2. + <_>9 4 9 3 2. + 0 + -0.0166348908096552 + 0.3757933080196381 + 0.5175446867942810 + <_> + + <_> + + + + <_>14 7 1 2 -1. + <_>14 8 1 1 2. + 0 + -2.8899470344185829e-003 + 0.6624013781547546 + 0.5057178735733032 + <_> + + <_> + + + + <_>0 6 2 14 -1. + <_>0 13 2 7 2. + 0 + 0.0767832621932030 + 0.4795796871185303 + 0.8047714829444885 + <_> + + <_> + + + + <_>17 0 3 12 -1. + <_>18 0 1 12 3. + 0 + 3.9170677773654461e-003 + 0.4937882125377655 + 0.5719941854476929 + <_> + + <_> + + + + <_>0 6 18 3 -1. + <_>0 7 18 1 3. + 0 + -0.0726706013083458 + 0.0538945607841015 + 0.4943903982639313 + <_> + + <_> + + + + <_>6 0 14 16 -1. + <_>6 8 14 8 2. + 0 + 0.5403950214385986 + 0.5129774212837219 + 0.1143338978290558 + <_> + + <_> + + + + <_>0 0 3 12 -1. + <_>1 0 1 12 3. + 0 + 2.9510019812732935e-003 + 0.4528343975543976 + 0.5698574185371399 + <_> + + <_> + + + + <_>13 0 3 7 -1. + <_>14 0 1 7 3. + 0 + 3.4508369863033295e-003 + 0.5357726812362671 + 0.4218730926513672 + <_> + + <_> + + + + <_>5 7 1 2 -1. + <_>5 8 1 1 2. + 0 + -4.2077939724549651e-004 + 0.5916172862052918 + 0.4637925922870636 + <_> + + <_> + + + + <_>14 4 6 6 -1. + <_>14 6 6 2 3. + 0 + 3.3051050268113613e-003 + 0.5273385047912598 + 0.4382042884826660 + <_> + + <_> + + + + <_>5 7 7 2 -1. + <_>5 8 7 1 2. + 0 + 4.7735060798004270e-004 + 0.4046528041362763 + 0.5181884765625000 + <_> + + <_> + + + + <_>8 6 6 9 -1. + <_>8 9 6 3 3. + 0 + -0.0259285103529692 + 0.7452235817909241 + 0.5089386105537415 + <_> + + <_> + + + + <_>5 4 6 1 -1. + <_>7 4 2 1 3. + 0 + -2.9729790985584259e-003 + 0.3295435905456543 + 0.5058795213699341 + <_> + + <_> + + + + <_>13 0 6 4 -1. + <_>16 0 3 2 2. + <_>13 2 3 2 2. + 0 + 5.8508329093456268e-003 + 0.4857144057750702 + 0.5793024897575378 + <_> + + <_> + + + + <_>1 2 18 12 -1. + <_>1 6 18 4 3. + 0 + -0.0459675192832947 + 0.4312731027603149 + 0.5380653142929077 + <_> + + <_> + + + + <_>3 2 17 12 -1. + <_>3 6 17 4 3. + 0 + 0.1558596044778824 + 0.5196170210838318 + 0.1684713959693909 + <_> + + <_> + + + + <_>5 14 7 3 -1. + <_>5 15 7 1 3. + 0 + 0.0151648297905922 + 0.4735757112503052 + 0.6735026836395264 + <_> + + <_> + + + + <_>10 14 1 3 -1. + <_>10 15 1 1 3. + 0 + -1.0604249546304345e-003 + 0.5822926759719849 + 0.4775702953338623 + <_> + + <_> + + + + <_>3 14 3 3 -1. + <_>3 15 3 1 3. + 0 + 6.6476291976869106e-003 + 0.4999198913574219 + 0.2319535017013550 + <_> + + <_> + + + + <_>14 4 6 6 -1. + <_>14 6 6 2 3. + 0 + -0.0122311301529408 + 0.4750893115997315 + 0.5262982249259949 + <_> + + <_> + + + + <_>0 4 6 6 -1. + <_>0 6 6 2 3. + 0 + 5.6528882123529911e-003 + 0.5069767832756043 + 0.3561818897724152 + <_> + + <_> + + + + <_>12 5 4 3 -1. + <_>12 6 4 1 3. + 0 + 1.2977829901501536e-003 + 0.4875693917274475 + 0.5619062781333923 + <_> + + <_> + + + + <_>4 5 4 3 -1. + <_>4 6 4 1 3. + 0 + 0.0107815898954868 + 0.4750770032405853 + 0.6782308220863342 + <_> + + <_> + + + + <_>18 0 2 6 -1. + <_>18 2 2 2 3. + 0 + 2.8654779307544231e-003 + 0.5305461883544922 + 0.4290736019611359 + <_> + + <_> + + + + <_>8 1 4 9 -1. + <_>10 1 2 9 2. + 0 + 2.8663428965955973e-003 + 0.4518479108810425 + 0.5539351105690002 + <_> + + <_> + + + + <_>6 6 8 2 -1. + <_>6 6 4 2 2. + 0 + -5.1983320154249668e-003 + 0.4149119853973389 + 0.5434188842773438 + <_> + + <_> + + + + <_>6 5 4 2 -1. + <_>6 5 2 1 2. + <_>8 6 2 1 2. + 0 + 5.3739990107715130e-003 + 0.4717896878719330 + 0.6507657170295715 + <_> + + <_> + + + + <_>10 5 2 3 -1. + <_>10 6 2 1 3. + 0 + -0.0146415298804641 + 0.2172164022922516 + 0.5161777138710022 + <_> + + <_> + + + + <_>9 5 1 3 -1. + <_>9 6 1 1 3. + 0 + -1.5042580344015732e-005 + 0.5337383747100830 + 0.4298836886882782 + <_> + + <_> + + + + <_>9 10 2 2 -1. + <_>9 11 2 1 2. + 0 + -1.1875660129589960e-004 + 0.4604594111442566 + 0.5582447052001953 + <_> + + <_> + + + + <_>0 8 4 3 -1. + <_>0 9 4 1 3. + 0 + 0.0169955305755138 + 0.4945895075798035 + 0.0738800764083862 + <_> + + <_> + + + + <_>6 0 8 6 -1. + <_>6 3 8 3 2. + 0 + -0.0350959412753582 + 0.7005509138107300 + 0.4977591037750244 + <_> + + <_> + + + + <_>1 0 6 4 -1. + <_>1 0 3 2 2. + <_>4 2 3 2 2. + 0 + 2.4217350874096155e-003 + 0.4466265141963959 + 0.5477694272994995 + <_> + + <_> + + + + <_>13 0 3 7 -1. + <_>14 0 1 7 3. + 0 + -9.6340337768197060e-004 + 0.4714098870754242 + 0.5313338041305542 + <_> + + <_> + + + + <_>9 16 2 2 -1. + <_>9 17 2 1 2. + 0 + 1.6391130338888615e-004 + 0.4331546127796173 + 0.5342242121696472 + <_> + + <_> + + + + <_>11 4 6 10 -1. + <_>11 9 6 5 2. + 0 + -0.0211414601653814 + 0.2644700109958649 + 0.5204498767852783 + <_> + + <_> + + + + <_>0 10 19 2 -1. + <_>0 11 19 1 2. + 0 + 8.7775202700868249e-004 + 0.5208349823951721 + 0.4152742922306061 + <_> + + <_> + + + + <_>9 5 8 9 -1. + <_>9 8 8 3 3. + 0 + -0.0279439203441143 + 0.6344125270843506 + 0.5018811821937561 + <_> + + <_> + + + + <_>4 0 3 7 -1. + <_>5 0 1 7 3. + 0 + 6.7297378554940224e-003 + 0.5050438046455383 + 0.3500863909721375 + <_> + + <_> + + + + <_>8 6 4 12 -1. + <_>10 6 2 6 2. + <_>8 12 2 6 2. + 0 + 0.0232810396701097 + 0.4966318011283875 + 0.6968677043914795 + <_> + + <_> + + + + <_>0 2 6 4 -1. + <_>0 4 6 2 2. + 0 + -0.0116449799388647 + 0.3300260007381439 + 0.5049629807472229 + <_> + + <_> + + + + <_>8 15 4 3 -1. + <_>8 16 4 1 3. + 0 + 0.0157643090933561 + 0.4991598129272461 + 0.7321153879165649 + <_> + + <_> + + + + <_>8 0 3 7 -1. + <_>9 0 1 7 3. + 0 + -1.3611479662358761e-003 + 0.3911735117435455 + 0.5160670876502991 + <_> + + <_> + + + + <_>9 5 3 4 -1. + <_>10 5 1 4 3. + 0 + -8.1522337859496474e-004 + 0.5628911256790161 + 0.4949719011783600 + <_> + + <_> + + + + <_>8 5 3 4 -1. + <_>9 5 1 4 3. + 0 + -6.0066272271797061e-004 + 0.5853595137596130 + 0.4550595879554749 + <_> + + <_> + + + + <_>7 6 6 1 -1. + <_>9 6 2 1 3. + 0 + 4.9715518252924085e-004 + 0.4271470010280609 + 0.5443599224090576 + <_> + + <_> + + + + <_>7 14 4 4 -1. + <_>7 14 2 2 2. + <_>9 16 2 2 2. + 0 + 2.3475370835512877e-003 + 0.5143110752105713 + 0.3887656927108765 + <_> + + <_> + + + + <_>13 14 4 6 -1. + <_>15 14 2 3 2. + <_>13 17 2 3 2. + 0 + -8.9261569082736969e-003 + 0.6044502258300781 + 0.4971720874309540 + <_> + + <_> + + + + <_>7 8 1 8 -1. + <_>7 12 1 4 2. + 0 + -0.0139199104160070 + 0.2583160996437073 + 0.5000367760658264 + <_> + + <_> + + + + <_>16 0 2 8 -1. + <_>17 0 1 4 2. + <_>16 4 1 4 2. + 0 + 1.0209949687123299e-003 + 0.4857374131679535 + 0.5560358166694641 + <_> + + <_> + + + + <_>2 0 2 8 -1. + <_>2 0 1 4 2. + <_>3 4 1 4 2. + 0 + -2.7441629208624363e-003 + 0.5936884880065918 + 0.4645777046680450 + <_> + + <_> + + + + <_>6 1 14 3 -1. + <_>6 2 14 1 3. + 0 + -0.0162001308053732 + 0.3163014948368073 + 0.5193495154380798 + <_> + + <_> + + + + <_>7 9 3 10 -1. + <_>7 14 3 5 2. + 0 + 4.3331980705261230e-003 + 0.5061224102973938 + 0.3458878993988037 + <_> + + <_> + + + + <_>9 14 2 2 -1. + <_>9 15 2 1 2. + 0 + 5.8497930876910686e-004 + 0.4779017865657806 + 0.5870177745819092 + <_> + + <_> + + + + <_>7 7 6 8 -1. + <_>7 11 6 4 2. + 0 + -2.2466450463980436e-003 + 0.4297851026058197 + 0.5374773144721985 + <_> + + <_> + + + + <_>9 7 3 6 -1. + <_>9 10 3 3 2. + 0 + 2.3146099410951138e-003 + 0.5438671708106995 + 0.4640969932079315 + <_> + + <_> + + + + <_>7 13 3 3 -1. + <_>7 14 3 1 3. + 0 + 8.7679121643304825e-003 + 0.4726893007755280 + 0.6771789789199829 + <_> + + <_> + + + + <_>9 9 2 2 -1. + <_>9 10 2 1 2. + 0 + -2.2448020172305405e-004 + 0.4229173064231873 + 0.5428048968315125 + <_> + + <_> + + + + <_>0 1 18 2 -1. + <_>6 1 6 2 3. + 0 + -7.4336021207273006e-003 + 0.6098880767822266 + 0.4683673977851868 + <_> + + <_> + + + + <_>7 1 6 14 -1. + <_>7 8 6 7 2. + 0 + -2.3189240600913763e-003 + 0.5689436793327332 + 0.4424242079257965 + <_> + + <_> + + + + <_>1 9 18 1 -1. + <_>7 9 6 1 3. + 0 + -2.1042178850620985e-003 + 0.3762221038341522 + 0.5187087059020996 + <_> + + <_> + + + + <_>9 7 2 2 -1. + <_>9 7 1 2 2. + 0 + 4.6034841216169298e-004 + 0.4699405133724213 + 0.5771207213401794 + <_> + + <_> + + + + <_>9 3 2 9 -1. + <_>10 3 1 9 2. + 0 + 1.0547629790380597e-003 + 0.4465216994285584 + 0.5601701736450195 + <_> + + <_> + + + + <_>18 14 2 3 -1. + <_>18 15 2 1 3. + 0 + 8.7148818420246243e-004 + 0.5449805259704590 + 0.3914709091186523 + <_> + + <_> + + + + <_>7 11 3 1 -1. + <_>8 11 1 1 3. + 0 + 3.3364820410497487e-004 + 0.4564009010791779 + 0.5645738840103149 + <_> + + <_> + + + + <_>10 8 3 4 -1. + <_>11 8 1 4 3. + 0 + -1.4853250468149781e-003 + 0.5747377872467041 + 0.4692778885364533 + <_> + + <_> + + + + <_>7 14 3 6 -1. + <_>8 14 1 6 3. + 0 + 3.0251620337367058e-003 + 0.5166196823120117 + 0.3762814104557037 + <_> + + <_> + + + + <_>10 8 3 4 -1. + <_>11 8 1 4 3. + 0 + 5.0280741415917873e-003 + 0.5002111792564392 + 0.6151527166366577 + <_> + + <_> + + + + <_>7 8 3 4 -1. + <_>8 8 1 4 3. + 0 + -5.8164511574432254e-004 + 0.5394598245620728 + 0.4390751123428345 + <_> + + <_> + + + + <_>7 9 6 9 -1. + <_>7 12 6 3 3. + 0 + 0.0451415292918682 + 0.5188326835632324 + 0.2063035964965820 + <_> + + <_> + + + + <_>0 14 2 3 -1. + <_>0 15 2 1 3. + 0 + -1.0795620037242770e-003 + 0.3904685080051422 + 0.5137907266616821 + <_> + + <_> + + + + <_>11 12 1 2 -1. + <_>11 13 1 1 2. + 0 + 1.5995999274309725e-004 + 0.4895322918891907 + 0.5427504181861877 + <_> + + <_> + + + + <_>4 3 8 3 -1. + <_>8 3 4 3 2. + 0 + -0.0193592701107264 + 0.6975228786468506 + 0.4773507118225098 + <_> + + <_> + + + + <_>0 4 20 6 -1. + <_>0 4 10 6 2. + 0 + 0.2072550952434540 + 0.5233635902404785 + 0.3034991919994354 + <_> + + <_> + + + + <_>9 14 1 3 -1. + <_>9 15 1 1 3. + 0 + -4.1953290929086506e-004 + 0.5419396758079529 + 0.4460186064243317 + <_> + + <_> + + + + <_>8 14 4 3 -1. + <_>8 15 4 1 3. + 0 + 2.2582069505006075e-003 + 0.4815764129161835 + 0.6027408838272095 + <_> + + <_> + + + + <_>0 15 14 4 -1. + <_>0 17 14 2 2. + 0 + -6.7811207845807076e-003 + 0.3980278968811035 + 0.5183305740356445 + <_> + + <_> + + + + <_>1 14 18 6 -1. + <_>1 17 18 3 2. + 0 + 0.0111543098464608 + 0.5431231856346130 + 0.4188759922981262 + <_> + + <_> + + + + <_>0 0 10 6 -1. + <_>0 0 5 3 2. + <_>5 3 5 3 2. + 0 + 0.0431624315679073 + 0.4738228023052216 + 0.6522961258888245 + 105.7611007690429700 + 20 + -1 + diff --git a/sample/SampleBase/Data/Text/haarcascade_frontalface_default.xml b/sample/SampleBase/Data/Text/haarcascade_frontalface_default.xml new file mode 100644 index 000000000..8dff079da --- /dev/null +++ b/sample/SampleBase/Data/Text/haarcascade_frontalface_default.xml @@ -0,0 +1,35712 @@ + + + + + 24 24 + + <_> + + + <_> + + <_> + + + + <_>6 4 12 9 -1. + <_>6 7 12 3 3. + 0 + -0.0315119996666908 + 2.0875380039215088 + -2.2172100543975830 + <_> + + <_> + + + + <_>6 4 12 7 -1. + <_>10 4 4 7 3. + 0 + 0.0123960003256798 + -1.8633940219879150 + 1.3272049427032471 + <_> + + <_> + + + + <_>3 9 18 9 -1. + <_>3 12 18 3 3. + 0 + 0.0219279993325472 + -1.5105249881744385 + 1.0625729560852051 + <_> + + <_> + + + + <_>8 18 9 6 -1. + <_>8 20 9 2 3. + 0 + 5.7529998011887074e-003 + -0.8746389746665955 + 1.1760339736938477 + <_> + + <_> + + + + <_>3 5 4 19 -1. + <_>5 5 2 19 2. + 0 + 0.0150140002369881 + -0.7794569730758667 + 1.2608419656753540 + <_> + + <_> + + + + <_>6 5 12 16 -1. + <_>6 13 12 8 2. + 0 + 0.0993710011243820 + 0.5575129985809326 + -1.8743000030517578 + <_> + + <_> + + + + <_>5 8 12 6 -1. + <_>5 11 12 3 2. + 0 + 2.7340000960975885e-003 + -1.6911929845809937 + 0.4400970041751862 + <_> + + <_> + + + + <_>11 14 4 10 -1. + <_>11 19 4 5 2. + 0 + -0.0188590008765459 + -1.4769539833068848 + 0.4435009956359863 + <_> + + <_> + + + + <_>4 0 7 6 -1. + <_>4 3 7 3 2. + 0 + 5.9739998541772366e-003 + -0.8590919971466065 + 0.8525559902191162 + -5.0425500869750977 + -1 + -1 + <_> + + + <_> + + <_> + + + + <_>6 6 12 6 -1. + <_>6 8 12 2 3. + 0 + -0.0211100000888109 + 1.2435649633407593 + -1.5713009834289551 + <_> + + <_> + + + + <_>6 4 12 7 -1. + <_>10 4 4 7 3. + 0 + 0.0203559994697571 + -1.6204780340194702 + 1.1817760467529297 + <_> + + <_> + + + + <_>1 8 19 12 -1. + <_>1 12 19 4 3. + 0 + 0.0213089995086193 + -1.9415930509567261 + 0.7006909847259522 + <_> + + <_> + + + + <_>0 2 24 3 -1. + <_>8 2 8 3 3. + 0 + 0.0916600003838539 + -0.5567010045051575 + 1.7284419536590576 + <_> + + <_> + + + + <_>9 9 6 15 -1. + <_>9 14 6 5 3. + 0 + 0.0362880006432533 + 0.2676379978656769 + -2.1831810474395752 + <_> + + <_> + + + + <_>5 6 14 10 -1. + <_>5 11 14 5 2. + 0 + -0.0191099997609854 + -2.6730210781097412 + 0.4567080140113831 + <_> + + <_> + + + + <_>5 0 14 9 -1. + <_>5 3 14 3 3. + 0 + 8.2539999857544899e-003 + -1.0852910280227661 + 0.5356420278549194 + <_> + + <_> + + + + <_>13 11 9 6 -1. + <_>16 11 3 6 3. + 0 + 0.0183550007641315 + -0.3520019948482513 + 0.9333919882774353 + <_> + + <_> + + + + <_>7 5 6 10 -1. + <_>9 5 2 10 3. + 0 + -7.0569999516010284e-003 + 0.9278209805488586 + -0.6634989976882935 + <_> + + <_> + + + + <_>10 8 6 10 -1. + <_>12 8 2 10 3. + 0 + -9.8770000040531158e-003 + 1.1577470302581787 + -0.2977479994297028 + <_> + + <_> + + + + <_>2 5 4 9 -1. + <_>4 5 2 9 2. + 0 + 0.0158140007406473 + -0.4196060001850128 + 1.3576040267944336 + <_> + + <_> + + + + <_>18 0 6 11 -1. + <_>20 0 2 11 3. + 0 + -0.0207000002264977 + 1.4590020179748535 + -0.1973939985036850 + <_> + + <_> + + + + <_>0 6 24 13 -1. + <_>8 6 8 13 3. + 0 + -0.1376080065965653 + 1.1186759471893311 + -0.5291550159454346 + <_> + + <_> + + + + <_>9 6 6 9 -1. + <_>11 6 2 9 3. + 0 + 0.0143189998343587 + -0.3512719869613648 + 1.1440860033035278 + <_> + + <_> + + + + <_>7 18 10 6 -1. + <_>7 20 10 2 3. + 0 + 0.0102530000731349 + -0.6085060238838196 + 0.7709850072860718 + <_> + + <_> + + + + <_>5 7 14 12 -1. + <_>5 13 14 6 2. + 0 + 0.0915080010890961 + 0.3881779909133911 + -1.5122940540313721 + -4.9842400550842285 + 0 + -1 + <_> + + + <_> + + <_> + + + + <_>0 3 24 3 -1. + <_>8 3 8 3 3. + 0 + 0.0697470009326935 + -1.0130879878997803 + 1.4687349796295166 + <_> + + <_> + + + + <_>5 8 15 6 -1. + <_>5 11 15 3 2. + 0 + 0.0315029993653297 + -1.6463639736175537 + 1.0000629425048828 + <_> + + <_> + + + + <_>9 6 5 14 -1. + <_>9 13 5 7 2. + 0 + 0.0142609998583794 + 0.4648030102252960 + -1.5959889888763428 + <_> + + <_> + + + + <_>9 5 6 10 -1. + <_>11 5 2 10 3. + 0 + 0.0144530003890395 + -0.6551190018653870 + 0.8302180171012878 + <_> + + <_> + + + + <_>6 6 3 12 -1. + <_>6 12 3 6 2. + 0 + -3.0509999487549067e-003 + -1.3982310295104980 + 0.4255059957504273 + <_> + + <_> + + + + <_>3 21 18 3 -1. + <_>9 21 6 3 3. + 0 + 0.0327229984104633 + -0.5070260167121887 + 1.0526109933853149 + <_> + + <_> + + + + <_>5 6 13 6 -1. + <_>5 8 13 2 3. + 0 + -7.2960001416504383e-003 + 0.3635689914226532 + -1.3464889526367187 + <_> + + <_> + + + + <_>18 1 6 15 -1. + <_>18 1 3 15 2. + 0 + 0.0504250004887581 + -0.3046140074729919 + 1.4504129886627197 + <_> + + <_> + + + + <_>1 1 6 15 -1. + <_>4 1 3 15 2. + 0 + 0.0468790009617805 + -0.4028620123863220 + 1.2145609855651855 + <_> + + <_> + + + + <_>0 8 24 15 -1. + <_>8 8 8 15 3. + 0 + -0.0693589970469475 + 1.0539360046386719 + -0.4571970105171204 + <_> + + <_> + + + + <_>5 6 14 12 -1. + <_>5 6 7 6 2. + <_>12 12 7 6 2. + 0 + -0.0490339994430542 + -1.6253089904785156 + 0.1537899971008301 + <_> + + <_> + + + + <_>2 12 21 12 -1. + <_>2 16 21 4 3. + 0 + 0.0848279967904091 + 0.2840299904346466 + -1.5662059783935547 + <_> + + <_> + + + + <_>8 1 4 10 -1. + <_>10 1 2 10 2. + 0 + -1.7229999648407102e-003 + -1.0147459506988525 + 0.2329480051994324 + <_> + + <_> + + + + <_>2 13 20 10 -1. + <_>2 13 10 10 2. + 0 + 0.1156219989061356 + -0.1673289984464645 + 1.2804069519042969 + <_> + + <_> + + + + <_>0 1 6 13 -1. + <_>2 1 2 13 3. + 0 + -0.0512799993157387 + 1.5162390470504761 + -0.3027110099792481 + <_> + + <_> + + + + <_>20 2 4 13 -1. + <_>20 2 2 13 2. + 0 + -0.0427069999277592 + 1.7631920576095581 + -0.0518320016562939 + <_> + + <_> + + + + <_>0 5 22 19 -1. + <_>11 5 11 19 2. + 0 + 0.3717809915542603 + -0.3138920068740845 + 1.5357979536056519 + <_> + + <_> + + + + <_>18 4 6 9 -1. + <_>20 4 2 9 3. + 0 + 0.0194129999727011 + -0.1001759991049767 + 0.9365540146827698 + <_> + + <_> + + + + <_>0 3 6 11 -1. + <_>2 3 2 11 3. + 0 + 0.0174390003085136 + -0.4037989974021912 + 0.9629300236701965 + <_> + + <_> + + + + <_>12 1 4 9 -1. + <_>12 1 2 9 2. + 0 + 0.0396389998495579 + 0.1703909933567047 + -2.9602990150451660 + <_> + + <_> + + + + <_>0 6 19 3 -1. + <_>0 7 19 1 3. + 0 + -9.1469995677471161e-003 + 0.8878679871559143 + -0.4381870031356812 + <_> + + <_> + + + + <_>12 1 4 9 -1. + <_>12 1 2 9 2. + 0 + 1.7219999572262168e-003 + -0.3721860051155090 + 0.4001890122890472 + <_> + + <_> + + + + <_>8 1 4 9 -1. + <_>10 1 2 9 2. + 0 + 0.0302310008555651 + 0.0659240037202835 + -2.6469180583953857 + <_> + + <_> + + + + <_>5 5 14 14 -1. + <_>12 5 7 7 2. + <_>5 12 7 7 2. + 0 + -0.0787959992885590 + -1.7491459846496582 + 0.2847529947757721 + <_> + + <_> + + + + <_>1 10 18 2 -1. + <_>1 11 18 1 2. + 0 + 2.1110000088810921e-003 + -0.9390810132026672 + 0.2320519983768463 + <_> + + <_> + + + + <_>17 13 4 11 -1. + <_>17 13 2 11 2. + 0 + 0.0270910002291203 + -0.0526640005409718 + 1.0756820440292358 + <_> + + <_> + + + + <_>0 4 6 9 -1. + <_>0 7 6 3 3. + 0 + -0.0449649989604950 + -1.8294479846954346 + 0.0995619967579842 + -4.6551899909973145 + 1 + -1 + <_> + + + <_> + + <_> + + + + <_>6 4 12 9 -1. + <_>6 7 12 3 3. + 0 + -0.0657010003924370 + 1.1558510065078735 + -1.0716359615325928 + <_> + + <_> + + + + <_>6 5 12 6 -1. + <_>10 5 4 6 3. + 0 + 0.0158399995416403 + -1.5634720325469971 + 0.7687709927558899 + <_> + + <_> + + + + <_>0 1 24 5 -1. + <_>8 1 8 5 3. + 0 + 0.1457089930772781 + -0.5745009779930115 + 1.3808720111846924 + <_> + + <_> + + + + <_>4 10 18 6 -1. + <_>4 12 18 2 3. + 0 + 6.1389999464154243e-003 + -1.4570560455322266 + 0.5161030292510986 + <_> + + <_> + + + + <_>2 17 12 6 -1. + <_>2 17 6 3 2. + <_>8 20 6 3 2. + 0 + 6.7179999314248562e-003 + -0.8353360295295715 + 0.5852220058441162 + <_> + + <_> + + + + <_>19 3 4 13 -1. + <_>19 3 2 13 2. + 0 + 0.0185180008411407 + -0.3131209909915924 + 1.1696679592132568 + <_> + + <_> + + + + <_>1 3 4 13 -1. + <_>3 3 2 13 2. + 0 + 0.0199580006301403 + -0.4344260096549988 + 0.9544690251350403 + <_> + + <_> + + + + <_>0 1 24 23 -1. + <_>8 1 8 23 3. + 0 + -0.2775500118732452 + 1.4906179904937744 + -0.1381590068340302 + <_> + + <_> + + + + <_>1 7 8 12 -1. + <_>1 11 8 4 3. + 0 + 9.1859996318817139e-003 + -0.9636150002479553 + 0.2766549885272980 + <_> + + <_> + + + + <_>14 7 3 14 -1. + <_>14 14 3 7 2. + 0 + -0.0377379991114140 + -2.4464108943939209 + 0.2361959964036942 + <_> + + <_> + + + + <_>3 12 16 6 -1. + <_>3 12 8 3 2. + <_>11 15 8 3 2. + 0 + 0.0184630006551743 + 0.1753920018672943 + -1.3423130512237549 + <_> + + <_> + + + + <_>6 6 12 6 -1. + <_>6 8 12 2 3. + 0 + -0.0111149996519089 + 0.4871079921722412 + -0.8985189795494080 + <_> + + <_> + + + + <_>8 7 6 12 -1. + <_>8 13 6 6 2. + 0 + 0.0339279994368553 + 0.1787420064210892 + -1.6342279911041260 + <_> + + <_> + + + + <_>15 15 9 6 -1. + <_>15 17 9 2 3. + 0 + -0.0356490015983582 + -1.9607399702072144 + 0.1810249984264374 + <_> + + <_> + + + + <_>1 17 18 3 -1. + <_>1 18 18 1 3. + 0 + -0.0114380000159144 + 0.9901069998741150 + -0.3810319900512695 + <_> + + <_> + + + + <_>4 4 16 12 -1. + <_>4 10 16 6 2. + 0 + -0.0652360022068024 + -2.5794160366058350 + 0.2475360035896301 + <_> + + <_> + + + + <_>0 1 4 20 -1. + <_>2 1 2 20 2. + 0 + -0.0422720015048981 + 1.4411840438842773 + -0.2950829863548279 + <_> + + <_> + + + + <_>3 0 18 2 -1. + <_>3 1 18 1 2. + 0 + 1.9219999667257071e-003 + -0.4960860013961792 + 0.6317359805107117 + <_> + + <_> + + + + <_>1 5 20 14 -1. + <_>1 5 10 7 2. + <_>11 12 10 7 2. + 0 + -0.1292179971933365 + -2.3314270973205566 + 0.0544969998300076 + <_> + + <_> + + + + <_>5 8 14 12 -1. + <_>5 12 14 4 3. + 0 + 0.0229310002177954 + -0.8444709777832031 + 0.3873809874057770 + <_> + + <_> + + + + <_>3 14 7 9 -1. + <_>3 17 7 3 3. + 0 + -0.0341200008988380 + -1.4431500434875488 + 0.0984229966998100 + <_> + + <_> + + + + <_>14 15 9 6 -1. + <_>14 17 9 2 3. + 0 + 0.0262230001389980 + 0.1822309941053391 + -1.2586519718170166 + <_> + + <_> + + + + <_>1 15 9 6 -1. + <_>1 17 9 2 3. + 0 + 0.0222369991242886 + 0.0698079988360405 + -2.3820950984954834 + <_> + + <_> + + + + <_>11 6 8 10 -1. + <_>15 6 4 5 2. + <_>11 11 4 5 2. + 0 + -5.8240001089870930e-003 + 0.3933250010013580 + -0.2754279971122742 + <_> + + <_> + + + + <_>5 5 14 14 -1. + <_>5 5 7 7 2. + <_>12 12 7 7 2. + 0 + 0.0436530001461506 + 0.1483269929885864 + -1.1368780136108398 + <_> + + <_> + + + + <_>6 0 12 5 -1. + <_>10 0 4 5 3. + 0 + 0.0572669990360737 + 0.2462809979915619 + -1.2687400579452515 + <_> + + <_> + + + + <_>9 0 6 9 -1. + <_>9 3 6 3 3. + 0 + 2.3409998975694180e-003 + -0.7544890046119690 + 0.2716380059719086 + <_> + + <_> + + + + <_>9 6 6 9 -1. + <_>11 6 2 9 3. + 0 + 0.0129960002377629 + -0.3639490008354187 + 0.7095919847488403 + <_> + + <_> + + + + <_>7 0 6 9 -1. + <_>9 0 2 9 3. + 0 + -0.0265170000493526 + -2.3221859931945801 + 0.0357440002262592 + <_> + + <_> + + + + <_>10 6 6 9 -1. + <_>12 6 2 9 3. + 0 + -5.8400002308189869e-003 + 0.4219430088996887 + -0.0481849983334541 + <_> + + <_> + + + + <_>8 6 6 9 -1. + <_>10 6 2 9 3. + 0 + -0.0165689997375011 + 1.1099940538406372 + -0.3484970033168793 + <_> + + <_> + + + + <_>3 8 18 4 -1. + <_>9 8 6 4 3. + 0 + -0.0681570023298264 + -3.3269989490509033 + 0.2129900008440018 + -4.4531588554382324 + 2 + -1 + <_> + + + <_> + + <_> + + + + <_>6 0 12 9 -1. + <_>6 3 12 3 3. + 0 + 0.0399740003049374 + -1.2173449993133545 + 1.0826710462570190 + <_> + + <_> + + + + <_>0 0 24 6 -1. + <_>8 0 8 6 3. + 0 + 0.1881950050592423 + -0.4828940033912659 + 1.4045250415802002 + <_> + + <_> + + + + <_>4 7 16 12 -1. + <_>4 11 16 4 3. + 0 + 0.0780270025134087 + -1.0782150030136108 + 0.7404029965400696 + <_> + + <_> + + + + <_>11 6 6 6 -1. + <_>11 6 3 6 2. + 0 + 1.1899999663000926e-004 + -1.2019979953765869 + 0.3774920105934143 + <_> + + <_> + + + + <_>0 20 24 3 -1. + <_>8 20 8 3 3. + 0 + 0.0850569978356361 + -0.4393909871578217 + 1.2647340297698975 + <_> + + <_> + + + + <_>11 6 4 9 -1. + <_>11 6 2 9 2. + 0 + 8.9720003306865692e-003 + -0.1844049990177155 + 0.4572640061378479 + <_> + + <_> + + + + <_>4 13 15 4 -1. + <_>9 13 5 4 3. + 0 + 8.8120000436902046e-003 + 0.3039669990539551 + -0.9599109888076782 + <_> + + <_> + + + + <_>11 6 4 9 -1. + <_>11 6 2 9 2. + 0 + -0.0235079992562532 + 1.2487529516220093 + 0.0462279990315437 + <_> + + <_> + + + + <_>9 6 4 9 -1. + <_>11 6 2 9 2. + 0 + 7.0039997808635235e-003 + -0.5944210290908814 + 0.5396329760551453 + <_> + + <_> + + + + <_>9 12 6 12 -1. + <_>9 18 6 6 2. + 0 + 0.0338519997894764 + 0.2849609851837158 + -1.4895249605178833 + <_> + + <_> + + + + <_>1 22 18 2 -1. + <_>1 23 18 1 2. + 0 + -3.2530000898987055e-003 + 0.4812079966068268 + -0.5271239876747131 + <_> + + <_> + + + + <_>10 7 4 10 -1. + <_>10 12 4 5 2. + 0 + 0.0290970001369715 + 0.2674390077590942 + -1.6007850170135498 + <_> + + <_> + + + + <_>6 7 8 10 -1. + <_>6 12 8 5 2. + 0 + -8.4790000692009926e-003 + -1.3107639551162720 + 0.1524309962987900 + <_> + + <_> + + + + <_>7 6 10 6 -1. + <_>7 8 10 2 3. + 0 + -0.0107950000092387 + 0.4561359882354736 + -0.7205089926719666 + <_> + + <_> + + + + <_>0 14 10 4 -1. + <_>0 16 10 2 2. + 0 + -0.0246200002729893 + -1.7320619821548462 + 0.0683630034327507 + <_> + + <_> + + + + <_>6 18 18 2 -1. + <_>6 19 18 1 2. + 0 + 3.7380000576376915e-003 + -0.1930329948663712 + 0.6824349761009216 + <_> + + <_> + + + + <_>1 1 22 3 -1. + <_>1 2 22 1 3. + 0 + -0.0122640002518892 + -1.6095290184020996 + 0.0752680003643036 + <_> + + <_> + + + + <_>6 16 18 3 -1. + <_>6 17 18 1 3. + 0 + -4.8670000396668911e-003 + 0.7428650259971619 + -0.2151020020246506 + <_> + + <_> + + + + <_>2 4 6 15 -1. + <_>5 4 3 15 2. + 0 + 0.0767259970307350 + -0.2683509886264801 + 1.3094140291213989 + <_> + + <_> + + + + <_>20 4 4 10 -1. + <_>20 4 2 10 2. + 0 + 0.0285780001431704 + -0.0587930008769035 + 1.2196329832077026 + <_> + + <_> + + + + <_>0 4 4 10 -1. + <_>2 4 2 10 2. + 0 + 0.0196940004825592 + -0.3514289855957031 + 0.8492699861526489 + <_> + + <_> + + + + <_>2 16 20 6 -1. + <_>12 16 10 3 2. + <_>2 19 10 3 2. + 0 + -0.0290939994156361 + -1.0507299900054932 + 0.2980630099773407 + <_> + + <_> + + + + <_>0 12 8 9 -1. + <_>4 12 4 9 2. + 0 + -0.0291440002620220 + 0.8254780173301697 + -0.3268719911575317 + <_> + + <_> + + + + <_>12 0 6 9 -1. + <_>14 0 2 9 3. + 0 + 0.0197410006076097 + 0.2045260071754456 + -0.8376020193099976 + <_> + + <_> + + + + <_>5 10 6 6 -1. + <_>8 10 3 6 2. + 0 + 4.3299999088048935e-003 + 0.2057790011167526 + -0.6682980060577393 + <_> + + <_> + + + + <_>11 8 12 6 -1. + <_>17 8 6 3 2. + <_>11 11 6 3 2. + 0 + -0.0355009995400906 + -1.2969900369644165 + 0.1389749944210053 + <_> + + <_> + + + + <_>0 8 12 6 -1. + <_>0 8 6 3 2. + <_>6 11 6 3 2. + 0 + -0.0161729995161295 + -1.3110569715499878 + 0.0757519975304604 + <_> + + <_> + + + + <_>12 0 6 9 -1. + <_>14 0 2 9 3. + 0 + -0.0221510007977486 + -1.0524389743804932 + 0.1924110054969788 + <_> + + <_> + + + + <_>6 0 6 9 -1. + <_>8 0 2 9 3. + 0 + -0.0227070003747940 + -1.3735309839248657 + 0.0667809993028641 + <_> + + <_> + + + + <_>8 14 9 6 -1. + <_>8 16 9 2 3. + 0 + 0.0166079998016357 + -0.0371359996497631 + 0.7784640192985535 + <_> + + <_> + + + + <_>0 16 9 6 -1. + <_>0 18 9 2 3. + 0 + -0.0133090000599623 + -0.9985070228576660 + 0.1224810034036636 + <_> + + <_> + + + + <_>10 8 6 10 -1. + <_>12 8 2 10 3. + 0 + -0.0337320007383823 + 1.4461359977722168 + 0.0131519995629787 + <_> + + <_> + + + + <_>3 19 12 3 -1. + <_>9 19 6 3 2. + 0 + 0.0169350001960993 + -0.3712129890918732 + 0.5284219980239868 + <_> + + <_> + + + + <_>2 10 20 2 -1. + <_>2 11 20 1 2. + 0 + 3.3259999472647905e-003 + -0.5756850242614746 + 0.3926190137863159 + <_> + + <_> + + + + <_>2 9 18 12 -1. + <_>2 9 9 6 2. + <_>11 15 9 6 2. + 0 + 0.0836440026760101 + 0.0161160007119179 + -2.1173279285430908 + <_> + + <_> + + + + <_>3 0 18 24 -1. + <_>3 0 9 24 2. + 0 + 0.2578519880771637 + -0.0816090032458305 + 0.9878249764442444 + <_> + + <_> + + + + <_>5 6 14 10 -1. + <_>5 6 7 5 2. + <_>12 11 7 5 2. + 0 + -0.0365669988095760 + -1.1512110233306885 + 0.0964590013027191 + <_> + + <_> + + + + <_>9 5 10 12 -1. + <_>14 5 5 6 2. + <_>9 11 5 6 2. + 0 + -0.0164459999650717 + 0.3731549978256226 + -0.1458539962768555 + <_> + + <_> + + + + <_>4 5 12 12 -1. + <_>4 5 6 6 2. + <_>10 11 6 6 2. + 0 + -3.7519999314099550e-003 + 0.2617929875850678 + -0.5815669894218445 + <_> + + <_> + + + + <_>4 14 18 3 -1. + <_>4 15 18 1 3. + 0 + -6.3660000450909138e-003 + 0.7547739744186401 + -0.1705520004034042 + <_> + + <_> + + + + <_>6 13 8 8 -1. + <_>6 17 8 4 2. + 0 + -3.8499999791383743e-003 + 0.2265399992465973 + -0.6387640237808228 + <_> + + <_> + + + + <_>3 16 18 6 -1. + <_>3 19 18 3 2. + 0 + -0.0454940013587475 + -1.2640299797058105 + 0.2526069879531860 + <_> + + <_> + + + + <_>0 0 6 6 -1. + <_>3 0 3 6 2. + 0 + -0.0239410009235144 + 0.8706840276718140 + -0.2710469961166382 + <_> + + <_> + + + + <_>6 6 12 18 -1. + <_>10 6 4 18 3. + 0 + -0.0775580033659935 + -1.3901610374450684 + 0.2361229956150055 + <_> + + <_> + + + + <_>6 1 4 14 -1. + <_>8 1 2 14 2. + 0 + 0.0236140005290508 + 0.0661400035023689 + -1.2645419836044312 + <_> + + <_> + + + + <_>3 2 19 2 -1. + <_>3 3 19 1 2. + 0 + -2.5750000495463610e-003 + -0.5384169816970825 + 0.3037909865379334 + <_> + + <_> + + + + <_>1 8 22 13 -1. + <_>12 8 11 13 2. + 0 + 0.1201080009341240 + -0.3534300029277802 + 0.5286620259284973 + <_> + + <_> + + + + <_>8 9 11 4 -1. + <_>8 11 11 2 2. + 0 + 2.2899999748915434e-003 + -0.5870199799537659 + 0.2406100034713745 + <_> + + <_> + + + + <_>0 12 15 10 -1. + <_>5 12 5 10 3. + 0 + 0.0697169974446297 + -0.3334890007972717 + 0.5191630125045776 + <_> + + <_> + + + + <_>12 16 12 6 -1. + <_>16 16 4 6 3. + 0 + -0.0466700010001659 + 0.6979539990425110 + -0.0148959998041391 + <_> + + <_> + + + + <_>0 16 12 6 -1. + <_>4 16 4 6 3. + 0 + -0.0501290000975132 + 0.8614619970321655 + -0.2598600089550018 + <_> + + <_> + + + + <_>19 1 5 12 -1. + <_>19 5 5 4 3. + 0 + 0.0301479995250702 + 0.1933279931545258 + -0.5913109779357910 + -4.3864588737487793 + 3 + -1 + <_> + + + <_> + + <_> + + + + <_>0 2 24 4 -1. + <_>8 2 8 4 3. + 0 + 0.0910850018262863 + -0.8923310041427612 + 1.0434230566024780 + <_> + + <_> + + + + <_>6 8 12 4 -1. + <_>6 10 12 2 2. + 0 + 0.0128189995884895 + -1.2597670555114746 + 0.5531709790229797 + <_> + + <_> + + + + <_>7 5 9 6 -1. + <_>10 5 3 6 3. + 0 + 0.0159319993108511 + -0.8625440001487732 + 0.6373180150985718 + <_> + + <_> + + + + <_>9 17 6 6 -1. + <_>9 20 6 3 2. + 0 + 2.2780001163482666e-003 + -0.7463920116424561 + 0.5315560102462769 + <_> + + <_> + + + + <_>0 7 22 15 -1. + <_>0 12 22 5 3. + 0 + 0.0318409986793995 + -1.2650489807128906 + 0.3615390062332153 + <_> + + <_> + + + + <_>4 1 17 9 -1. + <_>4 4 17 3 3. + 0 + 2.6960000395774841e-003 + -0.9829040169715881 + 0.3601300120353699 + <_> + + <_> + + + + <_>7 5 6 10 -1. + <_>9 5 2 10 3. + 0 + -0.0120550002902746 + 0.6406840085983276 + -0.5012500286102295 + <_> + + <_> + + + + <_>18 1 6 8 -1. + <_>18 1 3 8 2. + 0 + 0.0213249996304512 + -0.2403499931097031 + 0.8544800281524658 + <_> + + <_> + + + + <_>0 1 6 7 -1. + <_>3 1 3 7 2. + 0 + 0.0304860007017851 + -0.3427360057830811 + 1.1428849697113037 + <_> + + <_> + + + + <_>18 0 6 22 -1. + <_>18 0 3 22 2. + 0 + -0.0450799986720085 + 1.0976949930191040 + -0.1797460019588471 + <_> + + <_> + + + + <_>0 0 6 22 -1. + <_>3 0 3 22 2. + 0 + -0.0717009976506233 + 1.5735000371932983 + -0.3143349885940552 + <_> + + <_> + + + + <_>16 7 8 16 -1. + <_>16 7 4 16 2. + 0 + 0.0592180006206036 + -0.2758240103721619 + 1.0448570251464844 + <_> + + <_> + + + + <_>2 10 19 6 -1. + <_>2 12 19 2 3. + 0 + 6.7010000348091125e-003 + -1.0974019765853882 + 0.1980119943618774 + <_> + + <_> + + + + <_>9 9 6 12 -1. + <_>9 13 6 4 3. + 0 + 0.0410469993948936 + 0.3054769933223724 + -1.3287999629974365 + <_> + + <_> + + + + <_>2 15 17 6 -1. + <_>2 17 17 2 3. + 0 + -8.5499999113380909e-004 + 0.2580710053443909 + -0.7005289793014526 + <_> + + <_> + + + + <_>14 7 3 14 -1. + <_>14 14 3 7 2. + 0 + -0.0303600002080202 + -1.2306419610977173 + 0.2260939925909042 + <_> + + <_> + + + + <_>5 6 8 10 -1. + <_>5 6 4 5 2. + <_>9 11 4 5 2. + 0 + -0.0129300002008677 + 0.4075860083103180 + -0.5123450160026550 + <_> + + <_> + + + + <_>15 8 9 11 -1. + <_>18 8 3 11 3. + 0 + 0.0373679995536804 + -0.0947550013661385 + 0.6176509857177734 + <_> + + <_> + + + + <_>0 8 9 11 -1. + <_>3 8 3 11 3. + 0 + 0.0244340002536774 + -0.4110060036182404 + 0.4763050079345703 + <_> + + <_> + + + + <_>8 6 10 18 -1. + <_>8 15 10 9 2. + 0 + 0.0570079982280731 + 0.2524929940700531 + -0.6866980195045471 + <_> + + <_> + + + + <_>7 7 3 14 -1. + <_>7 14 3 7 2. + 0 + -0.0163139998912811 + -0.9392840266227722 + 0.1144810020923615 + <_> + + <_> + + + + <_>0 14 24 8 -1. + <_>8 14 8 8 3. + 0 + -0.1764889955520630 + 1.2451089620590210 + -0.0565190017223358 + <_> + + <_> + + + + <_>1 10 18 14 -1. + <_>10 10 9 14 2. + 0 + 0.1761460006237030 + -0.3252820074558258 + 0.8279150128364563 + <_> + + <_> + + + + <_>14 12 6 6 -1. + <_>14 15 6 3 2. + 0 + -7.3910001665353775e-003 + 0.3478370010852814 + -0.1792909950017929 + <_> + + <_> + + + + <_>7 0 10 16 -1. + <_>7 0 5 8 2. + <_>12 8 5 8 2. + 0 + 0.0608909986913204 + 0.0550980009138584 + -1.5480779409408569 + <_> + + <_> + + + + <_>10 0 9 6 -1. + <_>13 0 3 6 3. + 0 + -0.0291230008006096 + -1.0255639553070068 + 0.2410690039396286 + <_> + + <_> + + + + <_>4 3 16 4 -1. + <_>12 3 8 4 2. + 0 + -0.0456489995121956 + 1.0301599502563477 + -0.3167209923267365 + <_> + + <_> + + + + <_>10 0 9 6 -1. + <_>13 0 3 6 3. + 0 + 0.0373330004513264 + 0.2162059992551804 + -0.8258990049362183 + <_> + + <_> + + + + <_>1 1 20 4 -1. + <_>1 1 10 2 2. + <_>11 3 10 2 2. + 0 + -0.0244110003113747 + -1.5957959890365601 + 0.0511390008032322 + <_> + + <_> + + + + <_>10 0 9 6 -1. + <_>13 0 3 6 3. + 0 + -0.0598069988191128 + -1.0312290191650391 + 0.1309230029582977 + <_> + + <_> + + + + <_>5 0 9 6 -1. + <_>8 0 3 6 3. + 0 + -0.0301060006022453 + -1.4781630039215088 + 0.0372119992971420 + <_> + + <_> + + + + <_>8 18 10 6 -1. + <_>8 20 10 2 3. + 0 + 7.4209999293088913e-003 + -0.2402410060167313 + 0.4933399856090546 + <_> + + <_> + + + + <_>6 3 6 9 -1. + <_>8 3 2 9 3. + 0 + -2.1909999195486307e-003 + 0.2894150018692017 + -0.5725960135459900 + <_> + + <_> + + + + <_>7 3 12 6 -1. + <_>7 5 12 2 3. + 0 + 0.0208609998226166 + -0.2314839959144592 + 0.6376590132713318 + <_> + + <_> + + + + <_>0 10 18 3 -1. + <_>0 11 18 1 3. + 0 + -6.6990000195801258e-003 + -1.2107750177383423 + 0.0640180036425591 + <_> + + <_> + + + + <_>1 10 22 3 -1. + <_>1 11 22 1 3. + 0 + 0.0187580008059740 + 0.2446130067110062 + -0.9978669881820679 + <_> + + <_> + + + + <_>5 11 8 8 -1. + <_>9 11 4 8 2. + 0 + -0.0443230010569096 + -1.3699189424514771 + 0.0360519997775555 + <_> + + <_> + + + + <_>12 11 6 6 -1. + <_>12 11 3 6 2. + 0 + 0.0228599999099970 + 0.2128839939832687 + -1.0397620201110840 + <_> + + <_> + + + + <_>6 11 6 6 -1. + <_>9 11 3 6 2. + 0 + -9.8600005730986595e-004 + 0.3244360089302063 + -0.5429180264472961 + <_> + + <_> + + + + <_>7 10 11 6 -1. + <_>7 12 11 2 3. + 0 + 0.0172390006482601 + -0.2832390069961548 + 0.4446820020675659 + <_> + + <_> + + + + <_>0 13 24 4 -1. + <_>0 13 12 2 2. + <_>12 15 12 2 2. + 0 + -0.0345310010015965 + -2.3107020854949951 + -3.1399999279528856e-003 + <_> + + <_> + + + + <_>2 4 22 12 -1. + <_>13 4 11 6 2. + <_>2 10 11 6 2. + 0 + 0.0670069977641106 + 0.2871569991111755 + -0.6448100209236145 + <_> + + <_> + + + + <_>2 0 20 17 -1. + <_>12 0 10 17 2. + 0 + 0.2377689927816391 + -0.2717480063438416 + 0.8021910190582275 + <_> + + <_> + + + + <_>14 0 2 24 -1. + <_>14 0 1 24 2. + 0 + -0.0129030002281070 + -1.5317620038986206 + 0.2142360061407089 + <_> + + <_> + + + + <_>8 0 2 24 -1. + <_>9 0 1 24 2. + 0 + 0.0105149997398257 + 0.0770379975438118 + -1.0581140518188477 + <_> + + <_> + + + + <_>14 1 2 22 -1. + <_>14 1 1 22 2. + 0 + 0.0169690009206533 + 0.1430670022964478 + -0.8582839965820313 + <_> + + <_> + + + + <_>8 1 2 22 -1. + <_>9 1 1 22 2. + 0 + -7.2460002265870571e-003 + -1.1020129919052124 + 0.0649069994688034 + <_> + + <_> + + + + <_>17 6 3 18 -1. + <_>18 6 1 18 3. + 0 + 0.0105569995939732 + 0.0139640001580119 + 0.6360149979591370 + <_> + + <_> + + + + <_>6 14 9 6 -1. + <_>6 16 9 2 3. + 0 + 6.1380001716315746e-003 + -0.3454590141773224 + 0.5629680156707764 + <_> + + <_> + + + + <_>13 14 9 4 -1. + <_>13 16 9 2 2. + 0 + 0.0131580000743270 + 0.1992730051279068 + -1.5040320158004761 + <_> + + <_> + + + + <_>3 18 18 3 -1. + <_>3 19 18 1 3. + 0 + 3.1310000922530890e-003 + -0.4090369939804077 + 0.3779639899730682 + <_> + + <_> + + + + <_>9 4 8 18 -1. + <_>13 4 4 9 2. + <_>9 13 4 9 2. + 0 + -0.1092069968581200 + -2.2227079868316650 + 0.1217819973826408 + <_> + + <_> + + + + <_>0 17 18 3 -1. + <_>0 18 18 1 3. + 0 + 8.1820003688335419e-003 + -0.2865200042724609 + 0.6789079904556274 + -4.1299300193786621 + 4 + -1 + <_> + + + <_> + + <_> + + + + <_>0 2 12 4 -1. + <_>6 2 6 4 2. + 0 + 0.0313469991087914 + -0.8888459801673889 + 0.9493680000305176 + <_> + + <_> + + + + <_>6 8 14 6 -1. + <_>6 11 14 3 2. + 0 + 0.0319180004298687 + -1.1146880388259888 + 0.4888899922370911 + <_> + + <_> + + + + <_>7 5 6 6 -1. + <_>10 5 3 6 2. + 0 + 6.5939999185502529e-003 + -1.0097689628601074 + 0.4972380101680756 + <_> + + <_> + + + + <_>10 5 6 16 -1. + <_>10 13 6 8 2. + 0 + 0.0261480007320642 + 0.2599129974842072 + -1.2537480592727661 + <_> + + <_> + + + + <_>1 4 9 16 -1. + <_>4 4 3 16 3. + 0 + 0.0128450002521276 + -0.5713859796524048 + 0.5965949892997742 + <_> + + <_> + + + + <_>5 0 18 9 -1. + <_>5 3 18 3 3. + 0 + 0.0263449996709824 + -0.5520319938659668 + 0.3021740019321442 + <_> + + <_> + + + + <_>9 15 5 8 -1. + <_>9 19 5 4 2. + 0 + -0.0150830000638962 + -1.2871240377426147 + 0.2235420048236847 + <_> + + <_> + + + + <_>20 0 4 9 -1. + <_>20 0 2 9 2. + 0 + -0.0388870015740395 + 1.7425049543380737 + -0.0997470021247864 + <_> + + <_> + + + + <_>2 0 18 3 -1. + <_>2 1 18 1 3. + 0 + -5.7029998861253262e-003 + -1.0523240566253662 + 0.1836259961128235 + <_> + + <_> + + + + <_>5 22 19 2 -1. + <_>5 23 19 1 2. + 0 + -1.4860000228509307e-003 + 0.5678420066833496 + -0.4674200117588043 + <_> + + <_> + + + + <_>0 0 4 9 -1. + <_>2 0 2 9 2. + 0 + -0.0284860003739595 + 1.3082909584045410 + -0.2646090090274811 + <_> + + <_> + + + + <_>5 6 19 18 -1. + <_>5 12 19 6 3. + 0 + 0.0662249997258186 + -0.4621070027351379 + 0.4174959957599640 + <_> + + <_> + + + + <_>0 1 6 9 -1. + <_>2 1 2 9 3. + 0 + 8.8569996878504753e-003 + -0.4147489964962006 + 0.5920479893684387 + <_> + + <_> + + + + <_>6 5 14 12 -1. + <_>13 5 7 6 2. + <_>6 11 7 6 2. + 0 + 0.0113559998571873 + 0.3610309958457947 + -0.4578120112419128 + <_> + + <_> + + + + <_>0 1 20 2 -1. + <_>0 2 20 1 2. + 0 + -2.7679998893290758e-003 + -0.8923889994621277 + 0.1419900059700012 + <_> + + <_> + + + + <_>1 2 22 3 -1. + <_>1 3 22 1 3. + 0 + 0.0112469997256994 + 0.2935340106487274 + -0.9733060002326965 + <_> + + <_> + + + + <_>2 8 7 9 -1. + <_>2 11 7 3 3. + 0 + 7.1970000863075256e-003 + -0.7933490276336670 + 0.1831340044736862 + <_> + + <_> + + + + <_>2 12 22 4 -1. + <_>13 12 11 2 2. + <_>2 14 11 2 2. + 0 + 0.0317689999938011 + 0.1552309989929199 + -1.3245639801025391 + <_> + + <_> + + + + <_>0 12 22 4 -1. + <_>0 12 11 2 2. + <_>11 14 11 2 2. + 0 + 0.0251739993691444 + 0.0342149995267391 + -2.0948131084442139 + <_> + + <_> + + + + <_>9 7 6 11 -1. + <_>11 7 2 11 3. + 0 + 7.5360001064836979e-003 + -0.3945060074329376 + 0.5133399963378906 + <_> + + <_> + + + + <_>7 1 9 6 -1. + <_>10 1 3 6 3. + 0 + 0.0328730009496212 + 0.0883729979395866 + -1.2814120054244995 + <_> + + <_> + + + + <_>11 2 4 10 -1. + <_>11 7 4 5 2. + 0 + -2.7379998937249184e-003 + 0.5528650283813477 + -0.4638499915599823 + <_> + + <_> + + + + <_>6 4 12 12 -1. + <_>6 10 12 6 2. + 0 + -0.0380750000476837 + -1.8497270345687866 + 0.0459440015256405 + <_> + + <_> + + + + <_>18 1 6 15 -1. + <_>18 6 6 5 3. + 0 + -0.0389840006828308 + -0.4822370111942291 + 0.3476060032844544 + <_> + + <_> + + + + <_>3 15 18 3 -1. + <_>3 16 18 1 3. + 0 + 2.8029999230057001e-003 + -0.4515469968318939 + 0.4280630052089691 + <_> + + <_> + + + + <_>18 5 6 9 -1. + <_>18 8 6 3 3. + 0 + -0.0541459992527962 + -0.8452079892158508 + 0.1667490005493164 + <_> + + <_> + + + + <_>1 5 16 6 -1. + <_>1 5 8 3 2. + <_>9 8 8 3 2. + 0 + -8.3280000835657120e-003 + 0.3534829914569855 + -0.4716320037841797 + <_> + + <_> + + + + <_>11 0 6 9 -1. + <_>13 0 2 9 3. + 0 + 0.0337780006229877 + 0.1846310049295425 + -1.6686669588088989 + <_> + + <_> + + + + <_>0 4 24 14 -1. + <_>0 4 12 7 2. + <_>12 11 12 7 2. + 0 + -0.1123809963464737 + -1.2521569728851318 + 0.0359920002520084 + <_> + + <_> + + + + <_>13 0 4 13 -1. + <_>13 0 2 13 2. + 0 + -0.0104080000892282 + -0.8162040114402771 + 0.2342859953641892 + <_> + + <_> + + + + <_>7 0 4 13 -1. + <_>9 0 2 13 2. + 0 + -4.9439999274909496e-003 + -0.9258469939231873 + 0.1003480032086372 + <_> + + <_> + + + + <_>11 6 6 9 -1. + <_>13 6 2 9 3. + 0 + -9.3029998242855072e-003 + 0.5649930238723755 + -0.1888190060853958 + <_> + + <_> + + + + <_>8 7 6 9 -1. + <_>10 7 2 9 3. + 0 + -0.0117499995976686 + 0.8030239939689636 + -0.3827700018882752 + <_> + + <_> + + + + <_>13 17 9 6 -1. + <_>13 19 9 2 3. + 0 + -0.0232170000672340 + -0.8492699861526489 + 0.1967120021581650 + <_> + + <_> + + + + <_>2 18 14 6 -1. + <_>2 18 7 3 2. + <_>9 21 7 3 2. + 0 + 0.0168660003691912 + -0.4059189856052399 + 0.5069530010223389 + <_> + + <_> + + + + <_>3 18 18 4 -1. + <_>12 18 9 2 2. + <_>3 20 9 2 2. + 0 + -0.0240310002118349 + -1.5297520160675049 + 0.2334499955177307 + <_> + + <_> + + + + <_>0 20 15 4 -1. + <_>5 20 5 4 3. + 0 + -0.0369459986686707 + 0.6300770044326782 + -0.3178040087223053 + <_> + + <_> + + + + <_>9 15 15 9 -1. + <_>14 15 5 9 3. + 0 + -0.0615639984607697 + 0.5862789750099182 + -0.0121079999953508 + <_> + + <_> + + + + <_>4 4 16 4 -1. + <_>4 6 16 2 2. + 0 + 0.0216610003262758 + -0.2562370002269745 + 1.0409849882125854 + <_> + + <_> + + + + <_>7 6 10 6 -1. + <_>7 8 10 2 3. + 0 + -3.6710000131279230e-003 + 0.2917110025882721 + -0.8328729867935181 + <_> + + <_> + + + + <_>0 14 15 10 -1. + <_>5 14 5 10 3. + 0 + 0.0448490008711815 + -0.3963319957256317 + 0.4566200077533722 + <_> + + <_> + + + + <_>7 9 10 14 -1. + <_>12 9 5 7 2. + <_>7 16 5 7 2. + 0 + 0.0571950003504753 + 0.2102389931678772 + -1.5004800558090210 + <_> + + <_> + + + + <_>7 6 6 9 -1. + <_>9 6 2 9 3. + 0 + -0.0113420002162457 + 0.4407129883766174 + -0.3865379989147186 + <_> + + <_> + + + + <_>3 6 18 3 -1. + <_>3 7 18 1 3. + 0 + -0.0120040001347661 + 0.9395459890365601 + -0.1058949977159500 + <_> + + <_> + + + + <_>0 10 18 3 -1. + <_>0 11 18 1 3. + 0 + 0.0225159991532564 + 9.4480002298951149e-003 + -1.6799509525299072 + <_> + + <_> + + + + <_>3 16 18 4 -1. + <_>12 16 9 2 2. + <_>3 18 9 2 2. + 0 + -0.0198090001940727 + -1.0133639574050903 + 0.2414660006761551 + <_> + + <_> + + + + <_>4 6 14 6 -1. + <_>4 6 7 3 2. + <_>11 9 7 3 2. + 0 + 0.0158910006284714 + -0.3750759959220886 + 0.4661409854888916 + <_> + + <_> + + + + <_>13 0 2 18 -1. + <_>13 0 1 18 2. + 0 + -9.1420002281665802e-003 + -0.8048409819602966 + 0.1781699955463409 + <_> + + <_> + + + + <_>9 0 2 18 -1. + <_>10 0 1 18 2. + 0 + -4.4740000739693642e-003 + -1.0562069416046143 + 0.0733050033450127 + <_> + + <_> + + + + <_>5 7 15 10 -1. + <_>10 7 5 10 3. + 0 + 0.1274250000715256 + 0.2016559988260269 + -1.5467929840087891 + <_> + + <_> + + + + <_>1 20 21 4 -1. + <_>8 20 7 4 3. + 0 + 0.0477030016481876 + -0.3793779909610748 + 0.3788599967956543 + <_> + + <_> + + + + <_>10 5 5 18 -1. + <_>10 14 5 9 2. + 0 + 0.0536080002784729 + 0.2122049927711487 + -1.2399710416793823 + <_> + + <_> + + + + <_>0 2 24 6 -1. + <_>0 2 12 3 2. + <_>12 5 12 3 2. + 0 + -0.0396809987723827 + -1.0257550477981567 + 0.0512829981744289 + <_> + + <_> + + + + <_>1 1 22 8 -1. + <_>12 1 11 4 2. + <_>1 5 11 4 2. + 0 + -0.0673270002007484 + -1.0304750204086304 + 0.2300529927015305 + <_> + + <_> + + + + <_>4 0 15 9 -1. + <_>4 3 15 3 3. + 0 + 0.1333760023117065 + -0.2086900025606155 + 1.2272510528564453 + <_> + + <_> + + + + <_>0 0 24 19 -1. + <_>8 0 8 19 3. + 0 + -0.2091930061578751 + 0.8792989850044251 + -0.0442549996078014 + <_> + + <_> + + + + <_>2 21 18 3 -1. + <_>11 21 9 3 2. + 0 + -0.0655890032649040 + 1.0443429946899414 + -0.2168209999799728 + <_> + + <_> + + + + <_>9 7 10 4 -1. + <_>9 7 5 4 2. + 0 + 0.0618829987943172 + 0.1379819959402084 + -1.9009059667587280 + <_> + + <_> + + + + <_>5 7 10 4 -1. + <_>10 7 5 4 2. + 0 + -0.0255789998918772 + -1.6607600450515747 + 5.8439997956156731e-003 + <_> + + <_> + + + + <_>17 8 6 16 -1. + <_>20 8 3 8 2. + <_>17 16 3 8 2. + 0 + -0.0348270013928413 + 0.7994040250778198 + -0.0824069976806641 + <_> + + <_> + + + + <_>1 15 20 4 -1. + <_>1 15 10 2 2. + <_>11 17 10 2 2. + 0 + -0.0182099994271994 + -0.9607399702072144 + 0.0663200020790100 + <_> + + <_> + + + + <_>14 15 10 6 -1. + <_>14 17 10 2 3. + 0 + 0.0150709999725223 + 0.1989939957857132 + -0.7643300294876099 + -4.0218091011047363 + 5 + -1 + <_> + + + <_> + + <_> + + + + <_>3 0 16 9 -1. + <_>3 3 16 3 3. + 0 + 0.0463249981403351 + -1.0362670421600342 + 0.8220149874687195 + <_> + + <_> + + + + <_>15 6 7 15 -1. + <_>15 11 7 5 3. + 0 + 0.0154069997370243 + -1.2327589988708496 + 0.2964769899845123 + <_> + + <_> + + + + <_>9 1 6 13 -1. + <_>11 1 2 13 3. + 0 + 0.0128089999780059 + -0.7585229873657227 + 0.5798550248146057 + <_> + + <_> + + + + <_>17 2 6 14 -1. + <_>17 2 3 14 2. + 0 + 0.0491509996354580 + -0.3898389935493469 + 0.8968030214309692 + <_> + + <_> + + + + <_>3 14 12 10 -1. + <_>3 14 6 5 2. + <_>9 19 6 5 2. + 0 + 0.0126210004091263 + -0.7179930210113525 + 0.5044090151786804 + <_> + + <_> + + + + <_>7 6 10 6 -1. + <_>7 8 10 2 3. + 0 + -0.0187689997255802 + 0.5514760017395020 + -0.7055540084838867 + <_> + + <_> + + + + <_>1 2 6 14 -1. + <_>4 2 3 14 2. + 0 + 0.0419650003314018 + -0.4478209912776947 + 0.7098550200462341 + <_> + + <_> + + + + <_>10 4 5 12 -1. + <_>10 8 5 4 3. + 0 + -0.0514019988477230 + -1.0932120084762573 + 0.2670190036296845 + <_> + + <_> + + + + <_>0 17 24 5 -1. + <_>8 17 8 5 3. + 0 + -0.0709609985351563 + 0.8361840248107910 + -0.3831810057163239 + <_> + + <_> + + + + <_>15 7 5 12 -1. + <_>15 11 5 4 3. + 0 + 0.0167459994554520 + -0.2573310136795044 + 0.2596650123596191 + <_> + + <_> + + + + <_>3 1 6 12 -1. + <_>3 1 3 6 2. + <_>6 7 3 6 2. + 0 + -6.2400000169873238e-003 + 0.3163149952888489 + -0.5879690051078796 + <_> + + <_> + + + + <_>12 13 6 6 -1. + <_>12 16 6 3 2. + 0 + -0.0393979996442795 + -1.0491210222244263 + 0.1682240068912506 + <_> + + <_> + + + + <_>6 13 6 6 -1. + <_>6 16 6 3 2. + 0 + 0. + 0.1614419966936112 + -0.8787689805030823 + <_> + + <_> + + + + <_>14 6 3 16 -1. + <_>14 14 3 8 2. + 0 + -0.0223079994320869 + -0.6905350089073181 + 0.2360700070858002 + <_> + + <_> + + + + <_>1 12 13 6 -1. + <_>1 14 13 2 3. + 0 + 1.8919999711215496e-003 + 0.2498919963836670 + -0.5658329725265503 + <_> + + <_> + + + + <_>13 1 4 9 -1. + <_>13 1 2 9 2. + 0 + 1.0730000212788582e-003 + -0.5041580200195313 + 0.3837450146675110 + <_> + + <_> + + + + <_>7 0 9 6 -1. + <_>10 0 3 6 3. + 0 + 0.0392309986054897 + 0.0426190011203289 + -1.3875889778137207 + <_> + + <_> + + + + <_>12 2 6 9 -1. + <_>12 2 3 9 2. + 0 + 0.0622380003333092 + 0.1411940008401871 + -1.0688860416412354 + <_> + + <_> + + + + <_>6 2 6 9 -1. + <_>9 2 3 9 2. + 0 + 2.1399999968707561e-003 + -0.8962240219116211 + 0.1979639977216721 + <_> + + <_> + + + + <_>6 18 12 6 -1. + <_>6 20 12 2 3. + 0 + 9.1800000518560410e-004 + -0.4533729851245880 + 0.4353269934654236 + <_> + + <_> + + + + <_>7 6 6 9 -1. + <_>9 6 2 9 3. + 0 + -6.9169998168945313e-003 + 0.3382279872894287 + -0.4479300081729889 + <_> + + <_> + + + + <_>7 7 12 3 -1. + <_>7 7 6 3 2. + 0 + -0.0238669998943806 + -0.7890859842300415 + 0.2251179963350296 + <_> + + <_> + + + + <_>8 3 8 21 -1. + <_>8 10 8 7 3. + 0 + -0.1026280000805855 + -2.2831439971923828 + -5.3960001096129417e-003 + <_> + + <_> + + + + <_>7 4 10 12 -1. + <_>7 8 10 4 3. + 0 + -9.5239998772740364e-003 + 0.3934670090675354 + -0.5224220156669617 + <_> + + <_> + + + + <_>0 1 6 9 -1. + <_>0 4 6 3 3. + 0 + 0.0398770011961460 + 0.0327990017831326 + -1.5079489946365356 + <_> + + <_> + + + + <_>15 2 2 20 -1. + <_>15 2 1 20 2. + 0 + -0.0131449997425079 + -1.0839990377426147 + 0.1848240047693253 + <_> + + <_> + + + + <_>0 3 6 9 -1. + <_>0 6 6 3 3. + 0 + -0.0505909994244576 + -1.8822289705276489 + -2.2199999075382948e-003 + <_> + + <_> + + + + <_>15 3 2 21 -1. + <_>15 3 1 21 2. + 0 + 0.0249170009046793 + 0.1459340006113052 + -2.2196519374847412 + <_> + + <_> + + + + <_>7 0 2 23 -1. + <_>8 0 1 23 2. + 0 + -7.6370001770555973e-003 + -1.0164569616317749 + 0.0587970018386841 + <_> + + <_> + + + + <_>15 8 9 4 -1. + <_>15 10 9 2 2. + 0 + 0.0429119989275932 + 0.1544300019741058 + -1.1843889951705933 + <_> + + <_> + + + + <_>0 8 9 4 -1. + <_>0 10 9 2 2. + 0 + 2.3000000510364771e-004 + -0.7730579972267151 + 0.1218990013003349 + <_> + + <_> + + + + <_>8 14 9 6 -1. + <_>8 16 9 2 3. + 0 + 9.0929996222257614e-003 + -0.1145009994506836 + 0.7109130024909973 + <_> + + <_> + + + + <_>0 14 9 6 -1. + <_>0 16 9 2 3. + 0 + 0.0111450003460050 + 0.0700009986758232 + -1.0534820556640625 + <_> + + <_> + + + + <_>3 10 18 4 -1. + <_>9 10 6 4 3. + 0 + -0.0524530000984669 + -1.7594360113143921 + 0.1952379941940308 + <_> + + <_> + + + + <_>0 0 24 19 -1. + <_>8 0 8 19 3. + 0 + -0.2302069962024689 + 0.9584029912948608 + -0.2504569888114929 + <_> + + <_> + + + + <_>9 1 8 12 -1. + <_>9 7 8 6 2. + 0 + -0.0163659993559122 + 0.4673190116882324 + -0.2110839933156967 + <_> + + <_> + + + + <_>10 6 4 10 -1. + <_>12 6 2 10 2. + 0 + -0.0172080006450415 + 0.7083569765090942 + -0.2801829874515533 + <_> + + <_> + + + + <_>7 9 10 12 -1. + <_>12 9 5 6 2. + <_>7 15 5 6 2. + 0 + -0.0366480015218258 + -1.1013339757919312 + 0.2434110045433044 + <_> + + <_> + + + + <_>5 0 3 19 -1. + <_>6 0 1 19 3. + 0 + -0.0103049995377660 + -1.0933129787445068 + 0.0562589988112450 + <_> + + <_> + + + + <_>14 0 6 10 -1. + <_>16 0 2 10 3. + 0 + -0.0137130003422499 + -0.2643809914588928 + 0.1982100009918213 + <_> + + <_> + + + + <_>2 0 6 12 -1. + <_>2 0 3 6 2. + <_>5 6 3 6 2. + 0 + 0.0293080005794764 + -0.2214239984750748 + 1.0525950193405151 + <_> + + <_> + + + + <_>0 11 24 2 -1. + <_>0 12 24 1 2. + 0 + 0.0240770000964403 + 0.1848569959402084 + -1.7203969955444336 + <_> + + <_> + + + + <_>4 9 13 4 -1. + <_>4 11 13 2 2. + 0 + 6.1280000954866409e-003 + -0.9272149801254273 + 0.0587529987096787 + <_> + + <_> + + + + <_>9 8 6 9 -1. + <_>9 11 6 3 3. + 0 + -0.0223779994994402 + 1.9646559953689575 + 0.0277859997004271 + <_> + + <_> + + + + <_>0 12 16 4 -1. + <_>0 14 16 2 2. + 0 + -7.0440000854432583e-003 + 0.2142760008573532 + -0.4840759932994843 + <_> + + <_> + + + + <_>18 12 6 9 -1. + <_>18 15 6 3 3. + 0 + -0.0406030006706715 + -1.1754349470138550 + 0.1606120020151138 + <_> + + <_> + + + + <_>0 12 6 9 -1. + <_>0 15 6 3 3. + 0 + -0.0244660004973412 + -1.1239900588989258 + 0.0411100015044212 + <_> + + <_> + + + + <_>8 7 10 4 -1. + <_>8 7 5 4 2. + 0 + 2.5309999473392963e-003 + -0.1716970056295395 + 0.3217880129814148 + <_> + + <_> + + + + <_>8 7 6 9 -1. + <_>10 7 2 9 3. + 0 + -0.0195889994502068 + 0.8272020220756531 + -0.2637670040130615 + <_> + + <_> + + + + <_>11 0 6 9 -1. + <_>13 0 2 9 3. + 0 + -0.0296359993517399 + -1.1524770259857178 + 0.1499930024147034 + <_> + + <_> + + + + <_>7 0 6 9 -1. + <_>9 0 2 9 3. + 0 + -0.0150300003588200 + -1.0491830110549927 + 0.0401609987020493 + <_> + + <_> + + + + <_>12 3 6 15 -1. + <_>14 3 2 15 3. + 0 + -0.0607150010764599 + -1.0903840065002441 + 0.1533080041408539 + <_> + + <_> + + + + <_>6 3 6 15 -1. + <_>8 3 2 15 3. + 0 + -0.0127900000661612 + 0.4224860072135925 + -0.4239920079708099 + <_> + + <_> + + + + <_>15 2 9 4 -1. + <_>15 4 9 2 2. + 0 + -0.0202479995787144 + -0.9186699986457825 + 0.1848569959402084 + <_> + + <_> + + + + <_>5 10 6 7 -1. + <_>8 10 3 7 2. + 0 + -0.0306839998811483 + -1.5958670377731323 + 2.5760000571608543e-003 + <_> + + <_> + + + + <_>9 14 6 10 -1. + <_>9 19 6 5 2. + 0 + -0.0207180008292198 + -0.6629999876022339 + 0.3103719949722290 + <_> + + <_> + + + + <_>7 13 5 8 -1. + <_>7 17 5 4 2. + 0 + -1.7290000105276704e-003 + 0.1918340027332306 + -0.6508499979972839 + <_> + + <_> + + + + <_>14 5 3 16 -1. + <_>14 13 3 8 2. + 0 + -0.0313940010964870 + -0.6364300251007080 + 0.1540839970111847 + <_> + + <_> + + + + <_>2 17 18 3 -1. + <_>2 18 18 1 3. + 0 + 0.0190030001103878 + -0.1891939938068390 + 1.5294510126113892 + <_> + + <_> + + + + <_>5 18 19 3 -1. + <_>5 19 19 1 3. + 0 + 6.1769997701048851e-003 + -0.1059790030121803 + 0.6485959887504578 + <_> + + <_> + + + + <_>9 0 6 9 -1. + <_>11 0 2 9 3. + 0 + -0.0101659996435046 + -1.0802700519561768 + 0.0371760018169880 + <_> + + <_> + + + + <_>12 4 3 18 -1. + <_>13 4 1 18 3. + 0 + -1.4169999631121755e-003 + 0.3415749967098236 + -0.0977379977703094 + <_> + + <_> + + + + <_>9 4 3 18 -1. + <_>10 4 1 18 3. + 0 + -4.0799998678267002e-003 + 0.4762459993362427 + -0.3436630070209503 + <_> + + <_> + + + + <_>3 3 18 9 -1. + <_>9 3 6 9 3. + 0 + -0.0440969988703728 + 0.9763429760932922 + -0.0191730000078678 + <_> + + <_> + + + + <_>6 1 6 14 -1. + <_>8 1 2 14 3. + 0 + -0.0606699995696545 + -2.1752851009368896 + -0.0289259999990463 + <_> + + <_> + + + + <_>12 16 9 6 -1. + <_>12 19 9 3 2. + 0 + -0.0329319983720779 + -0.6438310146331787 + 0.1649409979581833 + <_> + + <_> + + + + <_>1 3 20 16 -1. + <_>1 3 10 8 2. + <_>11 11 10 8 2. + 0 + -0.1472280025482178 + -1.4745830297470093 + 2.5839998852461576e-003 + <_> + + <_> + + + + <_>12 5 6 12 -1. + <_>15 5 3 6 2. + <_>12 11 3 6 2. + 0 + -0.0119300000369549 + 0.4244140088558197 + -0.1771260052919388 + <_> + + <_> + + + + <_>1 2 22 16 -1. + <_>1 2 11 8 2. + <_>12 10 11 8 2. + 0 + 0.1451790034770966 + 0.0254449993371964 + -1.2779400348663330 + <_> + + <_> + + + + <_>10 14 5 10 -1. + <_>10 19 5 5 2. + 0 + 0.0514479987323284 + 0.1567839980125427 + -1.5188430547714233 + <_> + + <_> + + + + <_>3 21 18 3 -1. + <_>3 22 18 1 3. + 0 + 3.1479999888688326e-003 + -0.4042440056800842 + 0.3242970108985901 + <_> + + <_> + + + + <_>10 14 6 10 -1. + <_>12 14 2 10 3. + 0 + -0.0436000004410744 + -1.9932260513305664 + 0.1501860022544861 + -3.8832089900970459 + 6 + -1 + <_> + + + <_> + + <_> + + + + <_>0 2 24 4 -1. + <_>8 2 8 4 3. + 0 + 0.1289959996938705 + -0.6216199994087219 + 1.1116520166397095 + <_> + + <_> + + + + <_>6 4 12 9 -1. + <_>6 7 12 3 3. + 0 + -0.0912619978189468 + 1.0143059492111206 + -0.6133520007133484 + <_> + + <_> + + + + <_>6 6 12 5 -1. + <_>10 6 4 5 3. + 0 + 0.0142719997093081 + -1.0261659622192383 + 0.3977999985218048 + <_> + + <_> + + + + <_>5 8 14 12 -1. + <_>5 12 14 4 3. + 0 + 0.0328899994492531 + -1.1386079788208008 + 0.2869080007076263 + <_> + + <_> + + + + <_>4 14 8 10 -1. + <_>4 14 4 5 2. + <_>8 19 4 5 2. + 0 + 0.0125900004059076 + -0.5664560198783875 + 0.4517239928245544 + <_> + + <_> + + + + <_>11 6 5 14 -1. + <_>11 13 5 7 2. + 0 + 0.0146610001102090 + 0.3050599992275238 + -0.6812959909439087 + <_> + + <_> + + + + <_>7 6 3 16 -1. + <_>7 14 3 8 2. + 0 + -0.0335559993982315 + -1.7208939790725708 + 0.0614390000700951 + <_> + + <_> + + + + <_>3 7 18 8 -1. + <_>9 7 6 8 3. + 0 + 0.1425269991159439 + 0.2319220006465912 + -1.7297149896621704 + <_> + + <_> + + + + <_>2 3 20 2 -1. + <_>2 4 20 1 2. + 0 + -6.2079997733235359e-003 + -1.2163300514221191 + 0.1216019988059998 + <_> + + <_> + + + + <_>3 12 19 6 -1. + <_>3 14 19 2 3. + 0 + 0.0181789994239807 + 0.3255369961261749 + -0.8100399971008301 + <_> + + <_> + + + + <_>8 6 6 9 -1. + <_>10 6 2 9 3. + 0 + 0.0250369999557734 + -0.3169879913330078 + 0.6736140251159668 + <_> + + <_> + + + + <_>16 6 6 14 -1. + <_>16 6 3 14 2. + 0 + 0.0465609990060329 + -0.1108980029821396 + 0.8408250212669373 + <_> + + <_> + + + + <_>7 9 6 12 -1. + <_>9 9 2 12 3. + 0 + -8.9999996125698090e-003 + 0.3957450091838837 + -0.4762459993362427 + <_> + + <_> + + + + <_>18 6 6 18 -1. + <_>21 6 3 9 2. + <_>18 15 3 9 2. + 0 + 0.0408059991896153 + -1.8000000272877514e-004 + 0.9457070231437683 + <_> + + <_> + + + + <_>0 6 6 18 -1. + <_>0 6 3 9 2. + <_>3 15 3 9 2. + 0 + -0.0342219993472099 + 0.7520629763603210 + -0.3153150081634522 + <_> + + <_> + + + + <_>18 2 6 9 -1. + <_>18 5 6 3 3. + 0 + -0.0397160016000271 + -0.8313959836959839 + 0.1774439960718155 + <_> + + <_> + + + + <_>3 18 15 6 -1. + <_>3 20 15 2 3. + 0 + 2.5170000735670328e-003 + -0.5937799811363220 + 0.2465700060129166 + <_> + + <_> + + + + <_>18 2 6 9 -1. + <_>18 5 6 3 3. + 0 + 0.0274289995431900 + 0.1599839925765991 + -0.4278199970722199 + <_> + + <_> + + + + <_>0 2 6 9 -1. + <_>0 5 6 3 3. + 0 + 0.0349860005080700 + 0.0350559987127781 + -1.5988600254058838 + <_> + + <_> + + + + <_>5 10 18 2 -1. + <_>5 11 18 1 2. + 0 + 4.4970000162720680e-003 + -0.5203430056571960 + 0.3782829940319061 + <_> + + <_> + + + + <_>6 0 12 6 -1. + <_>6 2 12 2 3. + 0 + 2.7699999045580626e-003 + -0.5318260192871094 + 0.2495100051164627 + <_> + + <_> + + + + <_>10 0 6 9 -1. + <_>12 0 2 9 3. + 0 + 0.0351740010082722 + 0.1998340040445328 + -1.4446129798889160 + <_> + + <_> + + + + <_>8 0 6 9 -1. + <_>10 0 2 9 3. + 0 + 0.0259709991514683 + 0.0444269999861717 + -1.3622980117797852 + <_> + + <_> + + + + <_>15 12 9 6 -1. + <_>15 14 9 2 3. + 0 + -0.0157839991152287 + -0.9102039933204651 + 0.2719030082225800 + <_> + + <_> + + + + <_>3 6 13 6 -1. + <_>3 8 13 2 3. + 0 + -7.5880000367760658e-003 + 0.0920649990439415 + -0.8162890076637268 + <_> + + <_> + + + + <_>15 12 9 6 -1. + <_>15 14 9 2 3. + 0 + 0.0207540001720190 + 0.2118570059537888 + -0.7472900152206421 + <_> + + <_> + + + + <_>2 5 6 15 -1. + <_>5 5 3 15 2. + 0 + 0.0598290003836155 + -0.2730109989643097 + 0.8092330098152161 + <_> + + <_> + + + + <_>8 8 9 6 -1. + <_>11 8 3 6 3. + 0 + 0.0390390008687973 + -0.1043229997158051 + 0.8622620105743408 + <_> + + <_> + + + + <_>8 6 3 14 -1. + <_>8 13 3 7 2. + 0 + 0.0216659996658564 + 0.0627090036869049 + -0.9889429807662964 + <_> + + <_> + + + + <_>15 12 9 6 -1. + <_>15 14 9 2 3. + 0 + -0.0274969991296530 + -0.9269099831581116 + 0.1558630019426346 + <_> + + <_> + + + + <_>4 12 10 4 -1. + <_>9 12 5 4 2. + 0 + 0.0104620000347495 + 0.1341809928417206 + -0.7038639783859253 + <_> + + <_> + + + + <_>13 1 4 19 -1. + <_>13 1 2 19 2. + 0 + 0.0248709991574287 + 0.1970670074224472 + -0.4026330113410950 + <_> + + <_> + + + + <_>7 1 4 19 -1. + <_>9 1 2 19 2. + 0 + -0.0160360001027584 + -1.1409829854965210 + 0.0739979967474937 + <_> + + <_> + + + + <_>18 9 6 9 -1. + <_>18 12 6 3 3. + 0 + 0.0486270003020763 + 0.1699039936065674 + -0.7215219736099243 + <_> + + <_> + + + + <_>1 21 18 3 -1. + <_>1 22 18 1 3. + 0 + 1.2619999470189214e-003 + -0.4738979935646057 + 0.2625499963760376 + <_> + + <_> + + + + <_>14 13 10 9 -1. + <_>14 16 10 3 3. + 0 + -0.0880350023508072 + -2.1606519222259521 + 0.1455480009317398 + <_> + + <_> + + + + <_>1 13 22 4 -1. + <_>1 13 11 2 2. + <_>12 15 11 2 2. + 0 + 0.0183569993823767 + 0.0447509996592999 + -1.0766370296478271 + <_> + + <_> + + + + <_>4 6 16 6 -1. + <_>12 6 8 3 2. + <_>4 9 8 3 2. + 0 + 0.0352750010788441 + -0.0329190008342266 + 1.2153890132904053 + <_> + + <_> + + + + <_>1 0 18 22 -1. + <_>1 0 9 11 2. + <_>10 11 9 11 2. + 0 + -0.2039290070533752 + -1.3187999725341797 + 0.0155039997771382 + <_> + + <_> + + + + <_>10 7 8 14 -1. + <_>14 7 4 7 2. + <_>10 14 4 7 2. + 0 + -0.0166190005838871 + 0.3685019910335541 + -0.1528369933366776 + <_> + + <_> + + + + <_>0 4 6 20 -1. + <_>0 4 3 10 2. + <_>3 14 3 10 2. + 0 + 0.0377390012145042 + -0.2572779953479767 + 0.7065529823303223 + <_> + + <_> + + + + <_>15 0 6 9 -1. + <_>17 0 2 9 3. + 0 + 2.2720000706613064e-003 + -0.0776029974222183 + 0.3336780071258545 + <_> + + <_> + + + + <_>3 0 6 9 -1. + <_>5 0 2 9 3. + 0 + -0.0148029997944832 + -0.7852479815483093 + 0.0769340023398399 + <_> + + <_> + + + + <_>15 12 6 12 -1. + <_>18 12 3 6 2. + <_>15 18 3 6 2. + 0 + -0.0483190007507801 + 1.7022320032119751 + 0.0497220009565353 + <_> + + <_> + + + + <_>3 12 6 12 -1. + <_>3 12 3 6 2. + <_>6 18 3 6 2. + 0 + -0.0295390002429485 + 0.7767069935798645 + -0.2453429996967316 + <_> + + <_> + + + + <_>15 12 9 6 -1. + <_>15 14 9 2 3. + 0 + -0.0461690016090870 + -1.4922779798507690 + 0.1234000027179718 + <_> + + <_> + + + + <_>0 12 9 6 -1. + <_>0 14 9 2 3. + 0 + -0.0280649997293949 + -2.1345369815826416 + -0.0257970001548529 + <_> + + <_> + + + + <_>4 14 19 3 -1. + <_>4 15 19 1 3. + 0 + -5.7339998893439770e-003 + 0.5698260068893433 + -0.1205660030245781 + <_> + + <_> + + + + <_>2 13 19 3 -1. + <_>2 14 19 1 3. + 0 + -0.0101110003888607 + 0.6791139841079712 + -0.2663800120353699 + <_> + + <_> + + + + <_>14 15 10 6 -1. + <_>14 17 10 2 3. + 0 + 0.0113599998876452 + 0.2478979974985123 + -0.6449300050735474 + <_> + + <_> + + + + <_>6 0 10 12 -1. + <_>6 0 5 6 2. + <_>11 6 5 6 2. + 0 + 0.0518090017139912 + 0.0147160002961755 + -1.2395579814910889 + <_> + + <_> + + + + <_>17 1 6 12 -1. + <_>20 1 3 6 2. + <_>17 7 3 6 2. + 0 + 0.0332919992506504 + -8.2559995353221893e-003 + 1.0168470144271851 + <_> + + <_> + + + + <_>1 1 6 12 -1. + <_>1 1 3 6 2. + <_>4 7 3 6 2. + 0 + -0.0144940000027418 + 0.4506680071353912 + -0.3625099956989288 + <_> + + <_> + + + + <_>16 14 6 9 -1. + <_>16 17 6 3 3. + 0 + -0.0342219993472099 + -0.9529250264167786 + 0.2068459987640381 + <_> + + <_> + + + + <_>7 3 9 12 -1. + <_>7 9 9 6 2. + 0 + -0.0806540027260780 + -2.0139501094818115 + -0.0230849999934435 + <_> + + <_> + + + + <_>12 1 4 12 -1. + <_>12 7 4 6 2. + 0 + -8.9399999706074595e-004 + 0.3957200050354004 + -0.2935130000114441 + <_> + + <_> + + + + <_>4 0 14 8 -1. + <_>4 4 14 4 2. + 0 + 0.0971620008349419 + -0.2498030066490173 + 1.0859220027923584 + <_> + + <_> + + + + <_>10 6 6 9 -1. + <_>12 6 2 9 3. + 0 + 0.0366140007972717 + -0.0578440017998219 + 1.2162159681320190 + <_> + + <_> + + + + <_>2 10 18 3 -1. + <_>8 10 6 3 3. + 0 + 0.0516939982771873 + 0.0430629998445511 + -1.0636160373687744 + <_> + + <_> + + + + <_>15 15 9 6 -1. + <_>15 17 9 2 3. + 0 + -0.0245570000261068 + -0.4894680082798004 + 0.1718290001153946 + <_> + + <_> + + + + <_>0 1 21 23 -1. + <_>7 1 7 23 3. + 0 + 0.3273679912090302 + -0.2968859970569611 + 0.5179830193519592 + <_> + + <_> + + + + <_>6 9 17 4 -1. + <_>6 11 17 2 2. + 0 + 7.6959999278187752e-003 + -0.5980589985847473 + 0.2480320036411285 + <_> + + <_> + + + + <_>1 0 11 18 -1. + <_>1 6 11 6 3. + 0 + 0.1617220044136047 + -0.0296139996498823 + -2.3162529468536377 + <_> + + <_> + + + + <_>6 15 13 6 -1. + <_>6 17 13 2 3. + 0 + -4.7889999113976955e-003 + 0.3745790123939514 + -0.3277919888496399 + <_> + + <_> + + + + <_>0 15 9 6 -1. + <_>0 17 9 2 3. + 0 + -0.0184029992669821 + -0.9969270229339600 + 0.0729480013251305 + <_> + + <_> + + + + <_>8 7 15 4 -1. + <_>13 7 5 4 3. + 0 + 0.0776650011539459 + 0.1417569965124130 + -1.7238730192184448 + <_> + + <_> + + + + <_>9 12 6 9 -1. + <_>9 15 6 3 3. + 0 + 0.0189210008829832 + -0.2127310037612915 + 1.0165189504623413 + <_> + + <_> + + + + <_>6 8 18 3 -1. + <_>12 8 6 3 3. + 0 + -0.0793979987502098 + -1.3164349794387817 + 0.1498199999332428 + <_> + + <_> + + + + <_>0 14 24 4 -1. + <_>8 14 8 4 3. + 0 + -0.0680370032787323 + 0.4942199885845184 + -0.2909100055694580 + <_> + + <_> + + + + <_>16 10 3 12 -1. + <_>16 16 3 6 2. + 0 + -6.1010001227259636e-003 + 0.4243049919605255 + -0.3389930129051209 + <_> + + <_> + + + + <_>0 3 24 3 -1. + <_>0 4 24 1 3. + 0 + 0.0319270007312298 + -0.0310469996184111 + -2.3459999561309814 + <_> + + <_> + + + + <_>14 17 10 6 -1. + <_>14 19 10 2 3. + 0 + -0.0298439990729094 + -0.7898960113525391 + 0.1541769951581955 + <_> + + <_> + + + + <_>1 13 18 3 -1. + <_>7 13 6 3 3. + 0 + -0.0805419981479645 + -2.2509229183197021 + -0.0309069994837046 + <_> + + <_> + + + + <_>5 0 18 9 -1. + <_>5 3 18 3 3. + 0 + 3.8109999150037766e-003 + -0.2557730078697205 + 0.2378550022840500 + <_> + + <_> + + + + <_>4 3 16 9 -1. + <_>4 6 16 3 3. + 0 + 0.0336470007896423 + -0.2254139930009842 + 0.9230740070343018 + <_> + + <_> + + + + <_>16 5 3 12 -1. + <_>16 11 3 6 2. + 0 + 8.2809999585151672e-003 + -0.2889620065689087 + 0.3104619979858398 + <_> + + <_> + + + + <_>0 7 18 4 -1. + <_>6 7 6 4 3. + 0 + 0.1010439991950989 + -0.0348640009760857 + -2.7102620601654053 + <_> + + <_> + + + + <_>10 6 6 9 -1. + <_>12 6 2 9 3. + 0 + -0.0100090000778437 + 0.5971540212631226 + -0.0338310003280640 + <_> + + <_> + + + + <_>9 8 6 10 -1. + <_>11 8 2 10 3. + 0 + 7.1919998154044151e-003 + -0.4773800075054169 + 0.2268600016832352 + <_> + + <_> + + + + <_>9 15 6 9 -1. + <_>11 15 2 9 3. + 0 + 0.0249690003693104 + 0.2287770062685013 + -1.0435529947280884 + <_> + + <_> + + + + <_>3 1 18 21 -1. + <_>12 1 9 21 2. + 0 + 0.2790800034999847 + -0.2581810057163239 + 0.7678049802780151 + <_> + + <_> + + + + <_>6 8 12 7 -1. + <_>6 8 6 7 2. + 0 + -0.0442130006849766 + -0.5979800224304199 + 0.2803989946842194 + <_> + + <_> + + + + <_>8 5 6 9 -1. + <_>10 5 2 9 3. + 0 + -0.0141369998455048 + 0.7098730206489563 + -0.2564519941806793 + -3.8424909114837646 + 7 + -1 + <_> + + + <_> + + <_> + + + + <_>0 2 24 4 -1. + <_>8 2 8 4 3. + 0 + 0.1377120018005371 + -0.5587059855461121 + 1.0953769683837891 + <_> + + <_> + + + + <_>14 7 5 12 -1. + <_>14 11 5 4 3. + 0 + 0.0344609990715981 + -0.7117189764976502 + 0.5289959907531738 + <_> + + <_> + + + + <_>5 7 5 12 -1. + <_>5 11 5 4 3. + 0 + 0.0185800008475780 + -1.1157519817352295 + 0.4059399962425232 + <_> + + <_> + + + + <_>9 6 6 9 -1. + <_>11 6 2 9 3. + 0 + 0.0250419992953539 + -0.4089249968528748 + 0.7412999868392944 + <_> + + <_> + + + + <_>0 1 6 17 -1. + <_>3 1 3 17 2. + 0 + 0.0571790002286434 + -0.3805429935455322 + 0.7364770174026489 + <_> + + <_> + + + + <_>3 1 19 9 -1. + <_>3 4 19 3 3. + 0 + 0.0149320000782609 + -0.6994550228118897 + 0.3795099854469299 + <_> + + <_> + + + + <_>3 18 12 6 -1. + <_>3 18 6 3 2. + <_>9 21 6 3 2. + 0 + 8.8900001719594002e-003 + -0.5455859899520874 + 0.3633249998092651 + <_> + + <_> + + + + <_>20 4 4 19 -1. + <_>20 4 2 19 2. + 0 + 0.0304359998553991 + -0.1012459993362427 + 0.7958589792251587 + <_> + + <_> + + + + <_>0 16 10 7 -1. + <_>5 16 5 7 2. + 0 + -0.0441600009799004 + 0.8441089987754822 + -0.3297640085220337 + <_> + + <_> + + + + <_>8 7 10 12 -1. + <_>13 7 5 6 2. + <_>8 13 5 6 2. + 0 + 0.0184610001742840 + 0.2632659971714020 + -0.9673650264739990 + <_> + + <_> + + + + <_>6 7 10 12 -1. + <_>6 7 5 6 2. + <_>11 13 5 6 2. + 0 + 0.0106149995699525 + 0.1525190025568008 + -1.0589870214462280 + <_> + + <_> + + + + <_>9 2 9 6 -1. + <_>12 2 3 6 3. + 0 + -0.0459740012884140 + -1.9918340444564819 + 0.1362909972667694 + <_> + + <_> + + + + <_>1 20 21 4 -1. + <_>8 20 7 4 3. + 0 + 0.0829000025987625 + -0.3203719854354858 + 0.6030420064926148 + <_> + + <_> + + + + <_>9 12 9 6 -1. + <_>9 14 9 2 3. + 0 + -8.9130001142621040e-003 + 0.5958660244941711 + -0.2113959938287735 + <_> + + <_> + + + + <_>7 2 9 6 -1. + <_>10 2 3 6 3. + 0 + 0.0428140014410019 + 0.0229250006377697 + -1.4679330587387085 + <_> + + <_> + + + + <_>13 0 4 14 -1. + <_>13 0 2 14 2. + 0 + -8.7139997631311417e-003 + -0.4398950040340424 + 0.2043969929218292 + <_> + + <_> + + + + <_>7 0 4 14 -1. + <_>9 0 2 14 2. + 0 + -4.3390002101659775e-003 + -0.8906679749488831 + 0.1046999990940094 + <_> + + <_> + + + + <_>14 15 9 6 -1. + <_>14 17 9 2 3. + 0 + 8.0749997869133949e-003 + 0.2116419970989227 + -0.4023160040378571 + <_> + + <_> + + + + <_>2 8 18 5 -1. + <_>8 8 6 5 3. + 0 + 0.0967390015721321 + 0.0133199999108911 + -1.6085360050201416 + <_> + + <_> + + + + <_>18 3 6 11 -1. + <_>20 3 2 11 3. + 0 + -0.0305369999259710 + 1.0063740015029907 + -0.1341329962015152 + <_> + + <_> + + + + <_>6 5 11 14 -1. + <_>6 12 11 7 2. + 0 + -0.0608559995889664 + -1.4689979553222656 + 9.4240000471472740e-003 + <_> + + <_> + + + + <_>18 4 6 9 -1. + <_>18 7 6 3 3. + 0 + -0.0381620004773140 + -0.8163639903068543 + 0.2617120146751404 + <_> + + <_> + + + + <_>7 6 9 6 -1. + <_>7 8 9 2 3. + 0 + -9.6960002556443214e-003 + 0.1156169995665550 + -0.7169319987297058 + <_> + + <_> + + + + <_>18 4 6 9 -1. + <_>18 7 6 3 3. + 0 + 0.0489029996097088 + 0.1305049955844879 + -1.6448370218276978 + <_> + + <_> + + + + <_>0 4 6 9 -1. + <_>0 7 6 3 3. + 0 + -0.0416119992733002 + -1.1795840263366699 + 0.0250170007348061 + <_> + + <_> + + + + <_>9 4 9 4 -1. + <_>9 6 9 2 2. + 0 + -0.0201880000531673 + 0.6318820118904114 + -0.1049040034413338 + <_> + + <_> + + + + <_>0 22 19 2 -1. + <_>0 23 19 1 2. + 0 + -9.7900000400841236e-004 + 0.1850779950618744 + -0.5356590151786804 + <_> + + <_> + + + + <_>17 14 6 9 -1. + <_>17 17 6 3 3. + 0 + -0.0336220003664494 + -0.9312760233879089 + 0.2007150053977966 + <_> + + <_> + + + + <_>1 14 6 9 -1. + <_>1 17 6 3 3. + 0 + 0.0194559991359711 + 0.0380290001630783 + -1.0112210512161255 + <_> + + <_> + + + + <_>14 11 4 9 -1. + <_>14 11 2 9 2. + 0 + -3.1800000579096377e-004 + 0.3645769953727722 + -0.2761090099811554 + <_> + + <_> + + + + <_>6 11 4 9 -1. + <_>8 11 2 9 2. + 0 + -3.8899999344721437e-004 + 0.1966589987277985 + -0.5341050028800964 + <_> + + <_> + + + + <_>3 9 18 7 -1. + <_>9 9 6 7 3. + 0 + -0.0934960022568703 + -1.6772350072860718 + 0.2072709947824478 + <_> + + <_> + + + + <_>9 12 6 10 -1. + <_>9 17 6 5 2. + 0 + -0.0778779983520508 + -3.0760629177093506 + -0.0358039997518063 + <_> + + <_> + + + + <_>12 0 6 9 -1. + <_>14 0 2 9 3. + 0 + 0.0169479995965958 + 0.2144739925861359 + -0.7137629985809326 + <_> + + <_> + + + + <_>6 0 6 9 -1. + <_>8 0 2 9 3. + 0 + -0.0214590001851320 + -1.1468060016632080 + 0.0158559996634722 + <_> + + <_> + + + + <_>6 17 18 3 -1. + <_>6 18 18 1 3. + 0 + -0.0128659997135401 + 0.8381239771842957 + -0.0659440010786057 + <_> + + <_> + + + + <_>1 17 18 3 -1. + <_>1 18 18 1 3. + 0 + 7.8220004215836525e-003 + -0.2802680134773254 + 0.7937690019607544 + <_> + + <_> + + + + <_>10 6 11 12 -1. + <_>10 12 11 6 2. + 0 + 0.1029440015554428 + 0.1783230006694794 + -0.6841220259666443 + <_> + + <_> + + + + <_>5 6 14 6 -1. + <_>5 6 7 3 2. + <_>12 9 7 3 2. + 0 + -0.0374879986047745 + 0.9618999958038330 + -0.2173559963703156 + <_> + + <_> + + + + <_>5 4 15 4 -1. + <_>5 6 15 2 2. + 0 + 0.0255059991031885 + 0.0101039996370673 + 1.2461110353469849 + <_> + + <_> + + + + <_>0 0 22 2 -1. + <_>0 1 22 1 2. + 0 + 6.6700001480057836e-004 + -0.5348820090293884 + 0.1474629938602448 + <_> + + <_> + + + + <_>0 0 24 24 -1. + <_>8 0 8 24 3. + 0 + -0.2886790037155151 + 0.8217279911041260 + -0.0149480002000928 + <_> + + <_> + + + + <_>1 15 18 4 -1. + <_>10 15 9 4 2. + 0 + 0.0912949964404106 + -0.1960539966821671 + 1.0803170204162598 + <_> + + <_> + + + + <_>6 8 12 9 -1. + <_>6 11 12 3 3. + 0 + 0.1205660030245781 + -0.0238489992916584 + 1.1392610073089600 + <_> + + <_> + + + + <_>4 12 7 12 -1. + <_>4 16 7 4 3. + 0 + -0.0737750008702278 + -1.3583840131759644 + -4.2039998807013035e-003 + <_> + + <_> + + + + <_>1 2 22 6 -1. + <_>12 2 11 3 2. + <_>1 5 11 3 2. + 0 + -0.0331280007958412 + -0.6448320150375366 + 0.2414219975471497 + <_> + + <_> + + + + <_>5 20 14 3 -1. + <_>12 20 7 3 2. + 0 + -0.0439370013773441 + 0.8428540229797363 + -0.2062480002641678 + <_> + + <_> + + + + <_>0 0 24 16 -1. + <_>12 0 12 8 2. + <_>0 8 12 8 2. + 0 + 0.1811019927263260 + 0.1921209990978241 + -1.2222139835357666 + <_> + + <_> + + + + <_>3 13 18 4 -1. + <_>3 13 9 2 2. + <_>12 15 9 2 2. + 0 + -0.0118509996682405 + -0.7267739772796631 + 0.0526879988610744 + <_> + + <_> + + + + <_>2 10 22 2 -1. + <_>2 11 22 1 2. + 0 + 4.5920000411570072e-003 + -0.3630520105361939 + 0.2922379970550537 + <_> + + <_> + + + + <_>6 3 11 8 -1. + <_>6 7 11 4 2. + 0 + 7.0620002225041389e-003 + 0.0581160001456738 + -0.6716160178184509 + <_> + + <_> + + + + <_>14 5 6 6 -1. + <_>14 8 6 3 2. + 0 + -0.0237150005996227 + 0.4714210033416748 + 0.0185800008475780 + <_> + + <_> + + + + <_>0 7 24 6 -1. + <_>0 9 24 2 3. + 0 + -0.0671719983220100 + -1.1331889629364014 + 0.0237809997051954 + <_> + + <_> + + + + <_>14 0 10 10 -1. + <_>19 0 5 5 2. + <_>14 5 5 5 2. + 0 + -0.0653100013732910 + 0.9825350046157837 + 0.0283620003610849 + <_> + + <_> + + + + <_>0 0 10 10 -1. + <_>0 0 5 5 2. + <_>5 5 5 5 2. + 0 + 0.0227910000830889 + -0.2821370065212250 + 0.5899339914321899 + <_> + + <_> + + + + <_>0 1 24 4 -1. + <_>12 1 12 2 2. + <_>0 3 12 2 2. + 0 + -0.0190379992127419 + -0.6371150016784668 + 0.2651459872722626 + <_> + + <_> + + + + <_>0 17 18 3 -1. + <_>0 18 18 1 3. + 0 + -6.8689999170601368e-003 + 0.3748730123043060 + -0.3323209881782532 + <_> + + <_> + + + + <_>5 15 16 6 -1. + <_>13 15 8 3 2. + <_>5 18 8 3 2. + 0 + -0.0401460006833076 + -1.3048729896545410 + 0.1572429984807968 + <_> + + <_> + + + + <_>3 15 16 6 -1. + <_>3 15 8 3 2. + <_>11 18 8 3 2. + 0 + -0.0405309982597828 + -2.0458049774169922 + -0.0269259996712208 + <_> + + <_> + + + + <_>6 16 18 3 -1. + <_>6 17 18 1 3. + 0 + -0.0122539997100830 + 0.7764940261840820 + -0.0429710000753403 + <_> + + <_> + + + + <_>0 13 21 10 -1. + <_>0 18 21 5 2. + 0 + -0.0272199995815754 + 0.1742440015077591 + -0.4460090100765228 + <_> + + <_> + + + + <_>13 0 6 24 -1. + <_>15 0 2 24 3. + 0 + -0.0883660018444061 + -1.5036419630050659 + 0.1428990066051483 + <_> + + <_> + + + + <_>7 4 6 11 -1. + <_>9 4 2 11 3. + 0 + -7.9159997403621674e-003 + 0.2866669893264771 + -0.3792369961738586 + <_> + + <_> + + + + <_>9 5 9 6 -1. + <_>12 5 3 6 3. + 0 + -0.0419600009918213 + 1.3846950531005859 + 0.0650269985198975 + <_> + + <_> + + + + <_>1 4 2 20 -1. + <_>1 14 2 10 2. + 0 + 0.0456629991531372 + -0.2245229929685593 + 0.7952100038528442 + <_> + + <_> + + + + <_>13 0 6 24 -1. + <_>15 0 2 24 3. + 0 + -0.1409060060977936 + -1.5879319906234741 + 0.1135900020599365 + <_> + + <_> + + + + <_>5 0 6 24 -1. + <_>7 0 2 24 3. + 0 + -0.0592160001397133 + -1.1945960521697998 + -7.1640000678598881e-003 + <_> + + <_> + + + + <_>16 7 6 14 -1. + <_>19 7 3 7 2. + <_>16 14 3 7 2. + 0 + 4.3390002101659775e-003 + -0.1552869975566864 + 0.4066449999809265 + <_> + + <_> + + + + <_>4 7 4 12 -1. + <_>6 7 2 12 2. + 0 + -2.0369999110698700e-003 + 0.2592790126800537 + -0.3836829960346222 + <_> + + <_> + + + + <_>0 5 24 14 -1. + <_>8 5 8 14 3. + 0 + 0.2751649916172028 + -0.0884979963302612 + 0.7678750157356262 + <_> + + <_> + + + + <_>5 13 10 6 -1. + <_>5 15 10 2 3. + 0 + -0.0266019999980927 + 0.7502449750900269 + -0.2262199968099594 + <_> + + <_> + + + + <_>12 0 6 9 -1. + <_>14 0 2 9 3. + 0 + 0.0409060008823872 + 0.1215860024094582 + -1.4566910266876221 + <_> + + <_> + + + + <_>2 7 6 14 -1. + <_>2 7 3 7 2. + <_>5 14 3 7 2. + 0 + 5.5320002138614655e-003 + -0.3661150038242340 + 0.2596859931945801 + <_> + + <_> + + + + <_>15 2 9 15 -1. + <_>18 2 3 15 3. + 0 + 0.0318790003657341 + -0.0750190019607544 + 0.4848479926586151 + <_> + + <_> + + + + <_>0 2 6 9 -1. + <_>2 2 2 9 3. + 0 + -0.0414820015430450 + 0.7822039723396301 + -0.2199220061302185 + <_> + + <_> + + + + <_>12 2 10 14 -1. + <_>17 2 5 7 2. + <_>12 9 5 7 2. + 0 + -0.0961309969425201 + -0.8945630192756653 + 0.1468070000410080 + <_> + + <_> + + + + <_>11 6 2 18 -1. + <_>12 6 1 18 2. + 0 + -0.0115689998492599 + 0.8271409869194031 + -0.2027560025453568 + <_> + + <_> + + + + <_>9 5 15 6 -1. + <_>14 5 5 6 3. + 0 + 0.0183129999786615 + 0.0163679998368025 + 0.2730680108070374 + <_> + + <_> + + + + <_>8 6 6 10 -1. + <_>10 6 2 10 3. + 0 + -0.0341660007834435 + 1.1307320594787598 + -0.1881089955568314 + <_> + + <_> + + + + <_>12 0 6 9 -1. + <_>14 0 2 9 3. + 0 + -0.0244769994169474 + -0.5779129862785339 + 0.1581249982118607 + <_> + + <_> + + + + <_>3 3 9 7 -1. + <_>6 3 3 7 3. + 0 + 0.0489570014178753 + -0.0225649997591972 + -1.6373280286788940 + <_> + + <_> + + + + <_>6 7 14 3 -1. + <_>6 7 7 3 2. + 0 + -0.0207029990851879 + -0.5451210141181946 + 0.2408699989318848 + <_> + + <_> + + + + <_>7 7 8 6 -1. + <_>11 7 4 6 2. + 0 + -0.0230020005255938 + -1.2236540317535400 + -7.3440000414848328e-003 + <_> + + <_> + + + + <_>12 7 7 12 -1. + <_>12 13 7 6 2. + 0 + 0.0645850002765656 + 0.1469559967517853 + -0.4496749937534332 + <_> + + <_> + + + + <_>10 6 4 18 -1. + <_>10 6 2 9 2. + <_>12 15 2 9 2. + 0 + 0.0126660000532866 + -0.2787390053272247 + 0.4387660026550293 + <_> + + <_> + + + + <_>16 14 6 9 -1. + <_>16 17 6 3 3. + 0 + -0.0120029998943210 + -0.2428909987211227 + 0.2535009980201721 + <_> + + <_> + + + + <_>4 0 6 13 -1. + <_>6 0 2 13 3. + 0 + -0.0264439992606640 + -0.8586480021476746 + 0.0260259993374348 + <_> + + <_> + + + + <_>2 2 21 3 -1. + <_>9 2 7 3 3. + 0 + -0.0255479998886585 + 0.6928790211677551 + -2.1160000469535589e-003 + <_> + + <_> + + + + <_>5 4 5 12 -1. + <_>5 8 5 4 3. + 0 + 0.0391150005161762 + -0.1658910065889359 + 1.5209139585494995 + <_> + + <_> + + + + <_>10 3 4 10 -1. + <_>10 8 4 5 2. + 0 + -6.0330000706017017e-003 + 0.4385690093040466 + -0.2161370068788528 + <_> + + <_> + + + + <_>8 4 5 8 -1. + <_>8 8 5 4 2. + 0 + -0.0339369997382164 + -0.9799839854240418 + 0.0221330001950264 + -3.6478610038757324 + 8 + -1 + <_> + + + <_> + + <_> + + + + <_>6 0 11 9 -1. + <_>6 3 11 3 3. + 0 + 0.0406729988753796 + -0.9047470092773438 + 0.6441059708595276 + <_> + + <_> + + + + <_>6 6 12 5 -1. + <_>10 6 4 5 3. + 0 + 0.0256099998950958 + -0.7921699881553650 + 0.5748999714851379 + <_> + + <_> + + + + <_>0 0 24 5 -1. + <_>8 0 8 5 3. + 0 + 0.1995950043201447 + -0.3009960055351257 + 1.3143850564956665 + <_> + + <_> + + + + <_>1 10 23 6 -1. + <_>1 12 23 2 3. + 0 + 0.0124049996957183 + -0.8988299965858460 + 0.2920579910278320 + <_> + + <_> + + + + <_>3 21 18 3 -1. + <_>9 21 6 3 3. + 0 + 0.0392079986631870 + -0.4195519983768463 + 0.5346329808235169 + <_> + + <_> + + + + <_>3 6 21 6 -1. + <_>3 8 21 2 3. + 0 + -0.0308439992368221 + 0.4579339921474457 + -0.4462909996509552 + <_> + + <_> + + + + <_>0 5 6 12 -1. + <_>2 5 2 12 3. + 0 + -0.0355230011045933 + 0.9131050109863281 + -0.2737320065498352 + <_> + + <_> + + + + <_>10 2 4 15 -1. + <_>10 7 4 5 3. + 0 + -0.0616500005125999 + -1.4697799682617187 + 0.2036409974098206 + <_> + + <_> + + + + <_>8 7 8 10 -1. + <_>8 12 8 5 2. + 0 + -0.0117399999871850 + -1.0482879877090454 + 0.0678019970655441 + <_> + + <_> + + + + <_>5 7 15 12 -1. + <_>10 7 5 12 3. + 0 + 0.0669339969754219 + 0.2927449941635132 + -0.5228289961814880 + <_> + + <_> + + + + <_>0 17 10 6 -1. + <_>0 19 10 2 3. + 0 + -0.0206310003995895 + -1.2855139970779419 + 0.0445509999990463 + <_> + + <_> + + + + <_>14 18 9 6 -1. + <_>14 20 9 2 3. + 0 + -0.0223570000380278 + -0.8575379848480225 + 0.1843400001525879 + <_> + + <_> + + + + <_>9 6 6 16 -1. + <_>9 14 6 8 2. + 0 + 1.1500000255182385e-003 + 0.1640550047159195 + -0.6912500262260437 + <_> + + <_> + + + + <_>14 18 9 6 -1. + <_>14 20 9 2 3. + 0 + 0.0358729995787144 + 0.1575649976730347 + -0.8426259756088257 + <_> + + <_> + + + + <_>1 18 9 6 -1. + <_>1 20 9 2 3. + 0 + 0.0306599996984005 + 0.0216370001435280 + -1.3634690046310425 + <_> + + <_> + + + + <_>15 9 9 6 -1. + <_>15 11 9 2 3. + 0 + 5.5559999309480190e-003 + -0.1673700064420700 + 0.2588840126991272 + <_> + + <_> + + + + <_>0 9 9 6 -1. + <_>0 11 9 2 3. + 0 + -6.1160000041127205e-003 + -0.9727180004119873 + 0.0661000013351440 + <_> + + <_> + + + + <_>17 3 6 9 -1. + <_>19 3 2 9 3. + 0 + -0.0303169991821051 + 0.9847419857978821 + -0.0164480004459620 + <_> + + <_> + + + + <_>2 17 18 3 -1. + <_>2 18 18 1 3. + 0 + -9.7200004383921623e-003 + 0.4760470092296600 + -0.3251670002937317 + <_> + + <_> + + + + <_>3 15 21 6 -1. + <_>3 17 21 2 3. + 0 + -0.0571269989013672 + -0.9592069983482361 + 0.1993820071220398 + <_> + + <_> + + + + <_>9 17 6 6 -1. + <_>9 20 6 3 2. + 0 + 4.0059997700154781e-003 + -0.5261250138282776 + 0.2242870032787323 + <_> + + <_> + + + + <_>18 3 6 9 -1. + <_>18 6 6 3 3. + 0 + 0.0337340012192726 + 0.1707009971141815 + -1.0737580060958862 + <_> + + <_> + + + + <_>0 3 6 9 -1. + <_>0 6 6 3 3. + 0 + -0.0346419997513294 + -1.1343129873275757 + 0.0365400016307831 + <_> + + <_> + + + + <_>4 0 16 10 -1. + <_>12 0 8 5 2. + <_>4 5 8 5 2. + 0 + 0.0469230003654957 + 0.2583230137825012 + -0.7153580188751221 + <_> + + <_> + + + + <_>2 0 10 16 -1. + <_>2 0 5 8 2. + <_>7 8 5 8 2. + 0 + -8.7660001590847969e-003 + 0.1964090019464493 + -0.5335509777069092 + <_> + + <_> + + + + <_>14 0 10 5 -1. + <_>14 0 5 5 2. + 0 + 0.0656279996037483 + -0.0511949993669987 + 0.9761070013046265 + <_> + + <_> + + + + <_>0 0 10 5 -1. + <_>5 0 5 5 2. + 0 + -0.0441650003194809 + 1.0631920099258423 + -0.2346259951591492 + <_> + + <_> + + + + <_>18 3 6 10 -1. + <_>18 3 3 10 2. + 0 + 0.0173049997538328 + -0.1858289986848831 + 0.4588989913463593 + <_> + + <_> + + + + <_>5 11 12 6 -1. + <_>5 11 6 3 2. + <_>11 14 6 3 2. + 0 + 0.0331359989941120 + -0.0293819997459650 + -2.6651329994201660 + <_> + + <_> + + + + <_>21 0 3 18 -1. + <_>22 0 1 18 3. + 0 + -0.0210299994796515 + 0.9997990131378174 + 0.0249370001256466 + <_> + + <_> + + + + <_>6 0 6 9 -1. + <_>8 0 2 9 3. + 0 + 0.0297839995473623 + -0.0296059995889664 + -2.1695868968963623 + <_> + + <_> + + + + <_>8 8 9 7 -1. + <_>11 8 3 7 3. + 0 + 0.0552919991314411 + -7.5599999399855733e-004 + 0.7465199828147888 + <_> + + <_> + + + + <_>7 12 8 10 -1. + <_>7 12 4 5 2. + <_>11 17 4 5 2. + 0 + -0.0335979983210564 + -1.5274159908294678 + 0.0110600003972650 + <_> + + <_> + + + + <_>21 0 3 18 -1. + <_>22 0 1 18 3. + 0 + 0.0196029990911484 + 0.0335749983787537 + 0.9952620267868042 + <_> + + <_> + + + + <_>10 6 4 9 -1. + <_>12 6 2 9 2. + 0 + -0.0207870006561279 + 0.7661290168762207 + -0.2467080056667328 + <_> + + <_> + + + + <_>15 0 9 6 -1. + <_>15 2 9 2 3. + 0 + 0.0325360000133514 + 0.1626340001821518 + -0.6113430261611939 + <_> + + <_> + + + + <_>0 2 24 3 -1. + <_>0 3 24 1 3. + 0 + -0.0107880001887679 + -0.9783970117568970 + 0.0289699994027615 + <_> + + <_> + + + + <_>11 7 6 9 -1. + <_>13 7 2 9 3. + 0 + -9.9560003727674484e-003 + 0.4614579975605011 + -0.1351049989461899 + <_> + + <_> + + + + <_>7 6 6 10 -1. + <_>9 6 2 10 3. + 0 + -3.7489999085664749e-003 + 0.2545819878578186 + -0.5195559859275818 + <_> + + <_> + + + + <_>12 1 6 12 -1. + <_>14 1 2 12 3. + 0 + -0.0417799986898899 + -0.8056510090827942 + 0.1520850062370300 + <_> + + <_> + + + + <_>6 4 12 12 -1. + <_>6 10 12 6 2. + 0 + -0.0342210009694099 + -1.3137799501419067 + -3.5800000187009573e-003 + <_> + + <_> + + + + <_>14 3 2 21 -1. + <_>14 3 1 21 2. + 0 + 0.0101300003007054 + 0.2017579972743988 + -0.6133959889411926 + <_> + + <_> + + + + <_>6 1 12 8 -1. + <_>6 5 12 4 2. + 0 + -0.0898490026593208 + 0.9763280153274536 + -0.2088479995727539 + <_> + + <_> + + + + <_>3 0 18 8 -1. + <_>3 4 18 4 2. + 0 + 0.0260979998856783 + -0.1880799978971481 + 0.4770579934120178 + <_> + + <_> + + + + <_>3 0 18 3 -1. + <_>3 1 18 1 3. + 0 + -3.7539999466389418e-003 + -0.6798040270805359 + 0.1128880009055138 + <_> + + <_> + + + + <_>0 13 24 4 -1. + <_>12 13 12 2 2. + <_>0 15 12 2 2. + 0 + 0.0319730006158352 + 0.1895170062780380 + -1.4967479705810547 + <_> + + <_> + + + + <_>10 5 4 9 -1. + <_>12 5 2 9 2. + 0 + 0.0193329993635416 + -0.2360990047454834 + 0.8132050037384033 + <_> + + <_> + + + + <_>11 1 6 9 -1. + <_>13 1 2 9 3. + 0 + 1.9490000559017062e-003 + 0.2483039945363998 + -0.0692119970917702 + <_> + + <_> + + + + <_>6 2 6 22 -1. + <_>8 2 2 22 3. + 0 + -0.0441469997167587 + -1.0418920516967773 + 0.0480530001223087 + <_> + + <_> + + + + <_>16 10 8 14 -1. + <_>20 10 4 7 2. + <_>16 17 4 7 2. + 0 + -0.0446819998323917 + 0.5134630203247070 + -7.3799998499453068e-003 + <_> + + <_> + + + + <_>3 4 16 15 -1. + <_>3 9 16 5 3. + 0 + -0.1075749993324280 + 1.6202019453048706 + -0.1866759955883026 + <_> + + <_> + + + + <_>16 10 8 14 -1. + <_>20 10 4 7 2. + <_>16 17 4 7 2. + 0 + -0.1284680068492889 + 2.9869480133056641 + 0.0954279974102974 + <_> + + <_> + + + + <_>0 10 8 14 -1. + <_>0 10 4 7 2. + <_>4 17 4 7 2. + 0 + -0.0447579994797707 + 0.6040530204772949 + -0.2705869972705841 + <_> + + <_> + + + + <_>10 14 11 6 -1. + <_>10 17 11 3 2. + 0 + -0.0439909994602203 + -0.6179050207138062 + 0.1599719971418381 + <_> + + <_> + + + + <_>0 7 24 9 -1. + <_>8 7 8 9 3. + 0 + -0.1226899996399880 + 0.6632720232009888 + -0.2363699972629547 + <_> + + <_> + + + + <_>13 1 4 16 -1. + <_>13 1 2 16 2. + 0 + -0.0199829991906881 + -1.1228660345077515 + 0.1961670070886612 + <_> + + <_> + + + + <_>7 1 4 16 -1. + <_>9 1 2 16 2. + 0 + -0.0155279999598861 + -1.0770269632339478 + 0.0206930004060268 + <_> + + <_> + + + + <_>5 5 16 8 -1. + <_>13 5 8 4 2. + <_>5 9 8 4 2. + 0 + -0.0489710010588169 + 0.8116829991340637 + -0.0172520000487566 + <_> + + <_> + + + + <_>0 9 6 9 -1. + <_>0 12 6 3 3. + 0 + 0.0559759996831417 + -0.0225290004163980 + -1.7356760501861572 + <_> + + <_> + + + + <_>6 16 18 3 -1. + <_>6 17 18 1 3. + 0 + -9.8580000922083855e-003 + 0.6788139939308167 + -0.0581800006330013 + <_> + + <_> + + + + <_>3 12 6 9 -1. + <_>3 15 6 3 3. + 0 + 0.0134810004383326 + 0.0578479990363121 + -0.7725530266761780 + <_> + + <_> + + + + <_>8 14 9 6 -1. + <_>8 16 9 2 3. + 0 + 6.5609999001026154e-003 + -0.1314689964056015 + 0.6705579757690430 + <_> + + <_> + + + + <_>2 13 8 10 -1. + <_>2 13 4 5 2. + <_>6 18 4 5 2. + 0 + 7.1149999275803566e-003 + -0.3788059949874878 + 0.3097899854183197 + <_> + + <_> + + + + <_>15 5 3 18 -1. + <_>15 11 3 6 3. + 0 + 4.8159998841583729e-003 + -0.5847039818763733 + 0.2560209929943085 + <_> + + <_> + + + + <_>3 5 18 3 -1. + <_>3 6 18 1 3. + 0 + 9.5319999381899834e-003 + -0.3021700084209442 + 0.4125329852104187 + <_> + + <_> + + + + <_>17 5 6 11 -1. + <_>19 5 2 11 3. + 0 + -0.0274749994277954 + 0.5915470123291016 + 0.0179639998823404 + <_> + + <_> + + + + <_>1 5 6 11 -1. + <_>3 5 2 11 3. + 0 + -0.0395199991762638 + 0.9691349864006043 + -0.2102030068635941 + <_> + + <_> + + + + <_>19 1 4 9 -1. + <_>19 1 2 9 2. + 0 + -0.0306589994579554 + 0.9115589857101440 + 0.0405500009655952 + <_> + + <_> + + + + <_>1 1 4 9 -1. + <_>3 1 2 9 2. + 0 + -1.4680000022053719e-003 + -0.6048979759216309 + 0.1696089953184128 + <_> + + <_> + + + + <_>4 15 18 9 -1. + <_>4 15 9 9 2. + 0 + 0.1907760053873062 + 0.0435150004923344 + 0.8189290165901184 + <_> + + <_> + + + + <_>6 9 12 4 -1. + <_>6 11 12 2 2. + 0 + 5.1790000870823860e-003 + -0.9361730217933655 + 0.0249370001256466 + <_> + + <_> + + + + <_>15 2 9 6 -1. + <_>15 4 9 2 3. + 0 + 0.0241260007023811 + 0.1817550063133240 + -0.3418590128421783 + <_> + + <_> + + + + <_>0 2 9 6 -1. + <_>0 4 9 2 3. + 0 + -0.0263839997351170 + -1.2912579774856567 + -3.4280000254511833e-003 + <_> + + <_> + + + + <_>15 0 6 17 -1. + <_>17 0 2 17 3. + 0 + 5.4139997810125351e-003 + -0.0462919995188713 + 0.2526960074901581 + <_> + + <_> + + + + <_>3 0 6 17 -1. + <_>5 0 2 17 3. + 0 + 0.0542160011827946 + -0.0128480000421405 + -1.4304540157318115 + <_> + + <_> + + + + <_>8 17 9 4 -1. + <_>8 19 9 2 2. + 0 + 2.3799999326001853e-004 + -0.2667669951915741 + 0.3358829915523529 + <_> + + <_> + + + + <_>6 5 3 18 -1. + <_>6 11 3 6 3. + 0 + 0.0152169996872544 + -0.5136730074882507 + 0.1300510019063950 + <_> + + <_> + + + + <_>5 2 14 12 -1. + <_>5 8 14 6 2. + 0 + 0.0170079991221428 + 0.4157589972019196 + -0.3124119937419891 + <_> + + <_> + + + + <_>10 2 3 12 -1. + <_>10 8 3 6 2. + 0 + 0.0304969996213913 + -0.2482099980115891 + 0.7082849740982056 + <_> + + <_> + + + + <_>10 7 14 15 -1. + <_>10 12 14 5 3. + 0 + 6.5430002287030220e-003 + -0.2263700067996979 + 0.1918459981679916 + <_> + + <_> + + + + <_>0 7 14 15 -1. + <_>0 12 14 5 3. + 0 + 0.1416399925947189 + 0.0652270019054413 + -0.8880950212478638 + <_> + + <_> + + + + <_>15 0 9 6 -1. + <_>15 2 9 2 3. + 0 + 0.0193380005657673 + 0.1889120042324066 + -0.2739770114421845 + <_> + + <_> + + + + <_>0 0 9 6 -1. + <_>0 2 9 2 3. + 0 + -0.0173240005970001 + -0.9486669898033142 + 0.0241969991475344 + <_> + + <_> + + + + <_>12 6 6 14 -1. + <_>14 6 2 14 3. + 0 + -6.2069999985396862e-003 + 0.3693839907646179 + -0.1749490052461624 + <_> + + <_> + + + + <_>9 7 6 9 -1. + <_>11 7 2 9 3. + 0 + -0.0161090008914471 + 0.9615949988365173 + -0.2000530064105988 + <_> + + <_> + + + + <_>12 6 6 15 -1. + <_>14 6 2 15 3. + 0 + -0.1012250036001205 + -3.0699110031127930 + 0.1136379987001419 + <_> + + <_> + + + + <_>6 6 6 15 -1. + <_>8 6 2 15 3. + 0 + -7.5509999878704548e-003 + 0.2292100042104721 + -0.4564509987831116 + <_> + + <_> + + + + <_>15 3 8 9 -1. + <_>15 3 4 9 2. + 0 + 0.0442479997873306 + -3.1599999056197703e-004 + 0.3922530114650726 + <_> + + <_> + + + + <_>0 0 9 21 -1. + <_>3 0 3 21 3. + 0 + -0.1163600012660027 + 0.9523370265960693 + -0.2020159959793091 + <_> + + <_> + + + + <_>11 9 8 12 -1. + <_>11 13 8 4 3. + 0 + 4.7360002063214779e-003 + -0.0991770029067993 + 0.2037049978971481 + <_> + + <_> + + + + <_>6 7 10 12 -1. + <_>6 7 5 6 2. + <_>11 13 5 6 2. + 0 + 0.0224590003490448 + 8.7280003353953362e-003 + -1.0217070579528809 + <_> + + <_> + + + + <_>10 6 4 18 -1. + <_>12 6 2 9 2. + <_>10 15 2 9 2. + 0 + -0.0121090002357960 + 0.6481260061264038 + -0.0901490002870560 + <_> + + <_> + + + + <_>0 0 6 9 -1. + <_>0 3 6 3 3. + 0 + 0.0561200007796288 + -0.0367599986493587 + -1.9275590181350708 + <_> + + <_> + + + + <_>3 14 18 3 -1. + <_>3 15 18 1 3. + 0 + -8.7379999458789825e-003 + 0.6926130056381226 + -0.0683749988675117 + <_> + + <_> + + + + <_>3 14 8 10 -1. + <_>3 14 4 5 2. + <_>7 19 4 5 2. + 0 + 6.6399998031556606e-003 + -0.4056980013847351 + 0.1862570047378540 + <_> + + <_> + + + + <_>0 12 24 4 -1. + <_>12 12 12 2 2. + <_>0 14 12 2 2. + 0 + -0.0181319992989302 + -0.6451820135116577 + 0.2197639942169190 + <_> + + <_> + + + + <_>0 2 3 20 -1. + <_>1 2 1 20 3. + 0 + -0.0227189995348454 + 0.9777619838714600 + -0.1865430027246475 + <_> + + <_> + + + + <_>12 16 10 8 -1. + <_>17 16 5 4 2. + <_>12 20 5 4 2. + 0 + 0.0127050001174212 + -0.1054660007357597 + 0.3740409910678864 + <_> + + <_> + + + + <_>2 16 10 8 -1. + <_>2 16 5 4 2. + <_>7 20 5 4 2. + 0 + -0.0136829996481538 + 0.6106410026550293 + -0.2688109874725342 + -3.8700489997863770 + 9 + -1 + <_> + + + <_> + + <_> + + + + <_>7 0 10 9 -1. + <_>7 3 10 3 3. + 0 + 0.0313579998910427 + -1.0183910131454468 + 0.5752859711647034 + <_> + + <_> + + + + <_>0 0 24 3 -1. + <_>8 0 8 3 3. + 0 + 0.0930500030517578 + -0.4129750132560730 + 1.0091199874877930 + <_> + + <_> + + + + <_>3 8 15 4 -1. + <_>3 10 15 2 2. + 0 + 0.0259499996900558 + -0.5858790278434753 + 0.5660619735717773 + <_> + + <_> + + + + <_>6 5 12 6 -1. + <_>10 5 4 6 3. + 0 + 0.0164720006287098 + -0.9285749793052673 + 0.3092449903488159 + <_> + + <_> + + + + <_>5 13 14 6 -1. + <_>5 16 14 3 2. + 0 + -1.8779999809339643e-003 + 0.1195100024342537 + -1.1180130243301392 + <_> + + <_> + + + + <_>11 14 4 10 -1. + <_>11 19 4 5 2. + 0 + -9.0129999443888664e-003 + -0.5784950256347656 + 0.3315440118312836 + <_> + + <_> + + + + <_>0 6 6 7 -1. + <_>3 6 3 7 2. + 0 + 0.0225479993969202 + -0.3832510113716126 + 0.5246220231056213 + <_> + + <_> + + + + <_>18 0 6 6 -1. + <_>18 0 3 6 2. + 0 + -0.0377800017595291 + 1.1790670156478882 + -0.0341669991612434 + <_> + + <_> + + + + <_>3 1 18 3 -1. + <_>3 2 18 1 3. + 0 + -5.3799999877810478e-003 + -0.8626589775085449 + 0.1186790019273758 + <_> + + <_> + + + + <_>9 6 14 18 -1. + <_>9 12 14 6 3. + 0 + -0.0238930005580187 + -0.7495059967041016 + 0.2101140022277832 + <_> + + <_> + + + + <_>0 0 6 6 -1. + <_>3 0 3 6 2. + 0 + -0.0265219993889332 + 0.9212859869003296 + -0.2825280129909515 + <_> + + <_> + + + + <_>13 11 6 6 -1. + <_>13 11 3 6 2. + 0 + 0.0122800003737211 + 0.2666279971599579 + -0.7001360058784485 + <_> + + <_> + + + + <_>0 20 24 3 -1. + <_>8 20 8 3 3. + 0 + 0.0965949967503548 + -0.2845399975776672 + 0.7316899895668030 + <_> + + <_> + + + + <_>13 11 6 7 -1. + <_>13 11 3 7 2. + 0 + -0.0274149999022484 + -0.6149269938468933 + 0.1557620018720627 + <_> + + <_> + + + + <_>4 12 10 6 -1. + <_>4 14 10 2 3. + 0 + -0.0157670006155968 + 0.5755119919776917 + -0.3436219990253449 + <_> + + <_> + + + + <_>13 11 6 6 -1. + <_>13 11 3 6 2. + 0 + -2.1100000012665987e-003 + 0.3259969949722290 + -0.1300829946994782 + <_> + + <_> + + + + <_>5 11 6 7 -1. + <_>8 11 3 7 2. + 0 + 0.0120069999247789 + 0.0893229991197586 + -0.9602559804916382 + <_> + + <_> + + + + <_>7 4 11 12 -1. + <_>7 8 11 4 3. + 0 + -0.0154219996184111 + 0.3444949984550476 + -0.4671199917793274 + <_> + + <_> + + + + <_>6 15 10 4 -1. + <_>6 17 10 2 2. + 0 + -4.1579999960958958e-003 + 0.2369630038738251 + -0.5256329774856567 + <_> + + <_> + + + + <_>14 0 6 9 -1. + <_>16 0 2 9 3. + 0 + -0.0211859997361898 + -0.7426769733428955 + 0.2170200049877167 + <_> + + <_> + + + + <_>4 0 6 9 -1. + <_>6 0 2 9 3. + 0 + -0.0170770008116961 + -0.9047179818153381 + 0.0660120025277138 + <_> + + <_> + + + + <_>11 2 4 15 -1. + <_>11 7 4 5 3. + 0 + -0.0408499985933304 + -0.3444660007953644 + 0.2150370031595230 + <_> + + <_> + + + + <_>0 0 20 3 -1. + <_>0 1 20 1 3. + 0 + -8.1930002197623253e-003 + -0.9338859915733337 + 0.0504710003733635 + <_> + + <_> + + + + <_>13 18 10 6 -1. + <_>13 20 10 2 3. + 0 + -0.0192380007356405 + -0.5320370197296143 + 0.1724060028791428 + <_> + + <_> + + + + <_>2 7 6 11 -1. + <_>5 7 3 11 2. + 0 + -0.0441920012235641 + 0.9207500219345093 + -0.2214850038290024 + <_> + + <_> + + + + <_>10 14 10 9 -1. + <_>10 17 10 3 3. + 0 + -0.0623920001089573 + -0.7105380296707153 + 0.1832389980554581 + <_> + + <_> + + + + <_>8 2 4 9 -1. + <_>10 2 2 9 2. + 0 + -1.0079999919980764e-003 + -0.8706309795379639 + 0.0553300008177757 + <_> + + <_> + + + + <_>14 3 10 4 -1. + <_>14 3 5 4 2. + 0 + 0.0238700006157160 + -0.2285420000553131 + 0.5241559743881226 + <_> + + <_> + + + + <_>6 6 12 6 -1. + <_>6 6 6 3 2. + <_>12 9 6 3 2. + 0 + 0.0213910005986691 + -0.3032589852809906 + 0.5586060285568237 + <_> + + <_> + + + + <_>8 8 8 10 -1. + <_>12 8 4 5 2. + <_>8 13 4 5 2. + 0 + 0.0202549993991852 + 0.2690150141716003 + -0.7026180028915405 + <_> + + <_> + + + + <_>7 4 4 16 -1. + <_>7 12 4 8 2. + 0 + -0.0287720002233982 + -1.1835030317306519 + 0.0465120002627373 + <_> + + <_> + + + + <_>8 8 9 4 -1. + <_>8 10 9 2 2. + 0 + 3.4199999645352364e-003 + -0.5465210080146790 + 0.2596249878406525 + <_> + + <_> + + + + <_>5 2 14 9 -1. + <_>5 5 14 3 3. + 0 + 0.0569830015301704 + -0.2698290050029755 + 0.5817070007324219 + <_> + + <_> + + + + <_>3 16 19 8 -1. + <_>3 20 19 4 2. + 0 + -0.0938920006155968 + -0.9104639887809753 + 0.1967770010232925 + <_> + + <_> + + + + <_>0 0 10 8 -1. + <_>5 0 5 8 2. + 0 + 0.0176999997347593 + -0.4400329887866974 + 0.2134950011968613 + <_> + + <_> + + + + <_>5 2 16 18 -1. + <_>5 2 8 18 2. + 0 + 0.2284419983625412 + 0.0236050002276897 + 0.7717159986495972 + <_> + + <_> + + + + <_>0 11 24 11 -1. + <_>8 11 8 11 3. + 0 + -0.1828750073909760 + 0.7922859787940979 + -0.2464479953050613 + <_> + + <_> + + + + <_>3 3 18 5 -1. + <_>3 3 9 5 2. + 0 + -0.0698919966816902 + 0.8026779890060425 + -0.0360720008611679 + <_> + + <_> + + + + <_>1 16 18 3 -1. + <_>1 17 18 1 3. + 0 + 0.0152970002964139 + -0.2007230073213577 + 1.1030600070953369 + <_> + + <_> + + + + <_>5 17 18 3 -1. + <_>5 18 18 1 3. + 0 + 6.7500001750886440e-003 + -0.0459679998457432 + 0.7209450006484985 + <_> + + <_> + + + + <_>1 13 9 6 -1. + <_>1 15 9 2 3. + 0 + -0.0159830003976822 + -0.9035720229148865 + 0.0449879989027977 + <_> + + <_> + + + + <_>1 9 23 10 -1. + <_>1 14 23 5 2. + 0 + 0.0130880000069737 + 0.3529709875583649 + -0.3771060109138489 + <_> + + <_> + + + + <_>3 7 18 3 -1. + <_>3 8 18 1 3. + 0 + 0.0130610000342131 + -0.1958359926939011 + 1.1198940277099609 + <_> + + <_> + + + + <_>6 8 12 3 -1. + <_>6 8 6 3 2. + 0 + -0.0399070009589195 + -1.3998429775238037 + 0.1914509981870651 + <_> + + <_> + + + + <_>6 2 3 22 -1. + <_>7 2 1 22 3. + 0 + 0.0150269996374846 + 2.3600000422447920e-003 + -1.1611249446868896 + <_> + + <_> + + + + <_>14 17 10 6 -1. + <_>14 19 10 2 3. + 0 + -0.0205179993063211 + -0.4890809953212738 + 0.1674340069293976 + <_> + + <_> + + + + <_>1 18 10 6 -1. + <_>1 20 10 2 3. + 0 + -0.0223590005189180 + -1.2202980518341064 + -0.0119759999215603 + <_> + + <_> + + + + <_>11 3 6 12 -1. + <_>13 3 2 12 3. + 0 + -7.9150004312396049e-003 + 0.3722809851169586 + -0.0850630030035973 + <_> + + <_> + + + + <_>10 6 4 9 -1. + <_>12 6 2 9 2. + 0 + 0.0152580002322793 + -0.2941260039806366 + 0.5940639972686768 + <_> + + <_> + + + + <_>11 0 6 9 -1. + <_>13 0 2 9 3. + 0 + -0.0316659994423389 + -1.4395569562911987 + 0.1357879936695099 + <_> + + <_> + + + + <_>7 0 6 9 -1. + <_>9 0 2 9 3. + 0 + -0.0307739991694689 + -2.2545371055603027 + -0.0339710004627705 + <_> + + <_> + + + + <_>12 10 9 6 -1. + <_>15 10 3 6 3. + 0 + -0.0154830003157258 + 0.3770070075988770 + 0.0158479996025562 + <_> + + <_> + + + + <_>2 11 6 9 -1. + <_>5 11 3 9 2. + 0 + 0.0351670011878014 + -0.2944610118865967 + 0.5315909981727600 + <_> + + <_> + + + + <_>14 5 3 19 -1. + <_>15 5 1 19 3. + 0 + -0.0179060008376837 + -0.9978820085525513 + 0.1623599976301193 + <_> + + <_> + + + + <_>6 6 9 6 -1. + <_>6 8 9 2 3. + 0 + -3.1799999997019768e-003 + 0.0476570017635822 + -0.7524989843368530 + <_> + + <_> + + + + <_>14 5 3 19 -1. + <_>15 5 1 19 3. + 0 + 0.0157200004905462 + 0.1487379968166351 + -0.6537539958953857 + <_> + + <_> + + + + <_>0 3 6 9 -1. + <_>0 6 6 3 3. + 0 + 0.0298640001565218 + -0.0149520002305508 + -1.2275190353393555 + <_> + + <_> + + + + <_>5 21 18 3 -1. + <_>5 22 18 1 3. + 0 + 2.9899999499320984e-003 + -0.1426369994878769 + 0.4327279925346375 + <_> + + <_> + + + + <_>1 10 18 4 -1. + <_>7 10 6 4 3. + 0 + 0.0847499966621399 + -0.0192809998989105 + -1.1946409940719604 + <_> + + <_> + + + + <_>13 4 8 10 -1. + <_>17 4 4 5 2. + <_>13 9 4 5 2. + 0 + -0.0587249994277954 + -1.7328219413757324 + 0.1437470018863678 + <_> + + <_> + + + + <_>7 8 9 6 -1. + <_>10 8 3 6 3. + 0 + 0.0447559989988804 + -0.2414059937000275 + 0.5401999950408936 + <_> + + <_> + + + + <_>12 9 9 8 -1. + <_>15 9 3 8 3. + 0 + 0.0403690002858639 + 5.7680001482367516e-003 + 0.5657809972763062 + <_> + + <_> + + + + <_>0 6 5 12 -1. + <_>0 10 5 4 3. + 0 + 0.0377359986305237 + 0.0381809994578362 + -0.7937039732933044 + <_> + + <_> + + + + <_>7 6 14 6 -1. + <_>14 6 7 3 2. + <_>7 9 7 3 2. + 0 + 0.0607529990375042 + 0.0764530003070831 + 1.4813209772109985 + <_> + + <_> + + + + <_>7 5 3 19 -1. + <_>8 5 1 19 3. + 0 + -0.0198320001363754 + -1.6971720457077026 + -0.0273700002580881 + <_> + + <_> + + + + <_>8 4 15 20 -1. + <_>13 4 5 20 3. + 0 + -0.1659269928932190 + 0.6297600269317627 + 0.0317629985511303 + <_> + + <_> + + + + <_>1 4 15 20 -1. + <_>6 4 5 20 3. + 0 + 0.0690149962902069 + -0.3346320092678070 + 0.3007670044898987 + <_> + + <_> + + + + <_>13 10 6 6 -1. + <_>13 10 3 6 2. + 0 + 0.0113580003380775 + 0.2274149954319000 + -0.3822470009326935 + <_> + + <_> + + + + <_>5 10 6 6 -1. + <_>8 10 3 6 2. + 0 + 1.7000000225380063e-003 + 0.1922380030155182 + -0.5273510217666626 + <_> + + <_> + + + + <_>14 2 6 14 -1. + <_>17 2 3 7 2. + <_>14 9 3 7 2. + 0 + 0.0797690004110336 + 0.0914919972419739 + 2.1049048900604248 + <_> + + <_> + + + + <_>4 2 6 14 -1. + <_>4 2 3 7 2. + <_>7 9 3 7 2. + 0 + -0.0571440011262894 + -1.7452130317687988 + -0.0409100018441677 + <_> + + <_> + + + + <_>12 4 6 7 -1. + <_>12 4 3 7 2. + 0 + 7.3830001056194305e-003 + -0.2421479970216751 + 0.3557780086994171 + <_> + + <_> + + + + <_>9 4 6 9 -1. + <_>11 4 2 9 3. + 0 + -0.0180409997701645 + 1.1779999732971191 + -0.1767670065164566 + <_> + + <_> + + + + <_>11 4 8 10 -1. + <_>11 4 4 10 2. + 0 + 0.0945030003786087 + 0.1393609941005707 + -1.2993700504302979 + <_> + + <_> + + + + <_>5 4 8 10 -1. + <_>9 4 4 10 2. + 0 + 5.4210000671446323e-003 + -0.5460860133171082 + 0.1391640007495880 + <_> + + <_> + + + + <_>8 18 10 6 -1. + <_>8 20 10 2 3. + 0 + 7.0290002040565014e-003 + -0.2159720063209534 + 0.3925809860229492 + <_> + + <_> + + + + <_>1 18 21 6 -1. + <_>1 20 21 2 3. + 0 + 0.0345159992575645 + 0.0631889998912811 + -0.7210810184478760 + <_> + + <_> + + + + <_>9 2 12 6 -1. + <_>9 2 6 6 2. + 0 + -0.0519249998033047 + 0.6866760253906250 + 0.0632729977369308 + <_> + + <_> + + + + <_>3 2 12 6 -1. + <_>9 2 6 6 2. + 0 + -0.0691620036959648 + 1.7411810159683228 + -0.1661929935216904 + <_> + + <_> + + + + <_>12 5 12 6 -1. + <_>18 5 6 3 2. + <_>12 8 6 3 2. + 0 + -5.5229999125003815e-003 + 0.3069469928741455 + -0.1666290014982224 + <_> + + <_> + + + + <_>8 8 6 9 -1. + <_>8 11 6 3 3. + 0 + 0.0685999989509583 + -0.2140540033578873 + 0.7318500280380249 + <_> + + <_> + + + + <_>2 7 20 6 -1. + <_>2 9 20 2 3. + 0 + -0.0670389980077744 + -0.7936059832572937 + 0.2052579969167709 + <_> + + <_> + + + + <_>0 5 12 6 -1. + <_>0 5 6 3 2. + <_>6 8 6 3 2. + 0 + -0.0210050009191036 + 0.3734439909458160 + -0.2961860001087189 + <_> + + <_> + + + + <_>14 14 8 10 -1. + <_>18 14 4 5 2. + <_>14 19 4 5 2. + 0 + 0.0202789995819330 + -0.0152000002563000 + 0.4055530130863190 + <_> + + <_> + + + + <_>2 14 8 10 -1. + <_>2 14 4 5 2. + <_>6 19 4 5 2. + 0 + -0.0471079982817173 + 1.2116849422454834 + -0.1746429949998856 + <_> + + <_> + + + + <_>2 11 20 13 -1. + <_>2 11 10 13 2. + 0 + 0.1876849979162216 + -0.0229090005159378 + 0.6964579820632935 + <_> + + <_> + + + + <_>6 9 12 5 -1. + <_>12 9 6 5 2. + 0 + -0.0432289987802505 + -1.0602480173110962 + -5.5599998449906707e-004 + <_> + + <_> + + + + <_>5 6 16 6 -1. + <_>13 6 8 3 2. + <_>5 9 8 3 2. + 0 + 0.0200040005147457 + -0.0327510014176369 + 0.5380510091781616 + <_> + + <_> + + + + <_>1 19 9 4 -1. + <_>1 21 9 2 2. + 0 + 8.0880001187324524e-003 + 0.0375480018556118 + -0.7476890087127686 + <_> + + <_> + + + + <_>7 5 12 5 -1. + <_>11 5 4 5 3. + 0 + 0.0271010007709265 + -0.0817900002002716 + 0.3338710069656372 + <_> + + <_> + + + + <_>3 5 14 12 -1. + <_>3 5 7 6 2. + <_>10 11 7 6 2. + 0 + -0.0917460024356842 + -1.9213509559631348 + -0.0389529988169670 + <_> + + <_> + + + + <_>9 4 9 6 -1. + <_>12 4 3 6 3. + 0 + -0.0124549996107817 + 0.4836060106754303 + 0.0181680005043745 + <_> + + <_> + + + + <_>2 6 19 3 -1. + <_>2 7 19 1 3. + 0 + 0.0146490000188351 + -0.1990669965744019 + 0.7281540036201477 + <_> + + <_> + + + + <_>18 10 6 9 -1. + <_>18 13 6 3 3. + 0 + 0.0291019994765520 + 0.1987109929323196 + -0.4921680092811585 + <_> + + <_> + + + + <_>3 7 18 2 -1. + <_>3 8 18 1 2. + 0 + 8.7799998000264168e-003 + -0.1949959993362427 + 0.7731739878654480 + <_> + + <_> + + + + <_>20 2 4 18 -1. + <_>22 2 2 9 2. + <_>20 11 2 9 2. + 0 + -0.0547400005161762 + 1.8087190389633179 + 0.0683230012655258 + <_> + + <_> + + + + <_>2 18 20 3 -1. + <_>2 19 20 1 3. + 0 + -0.0147980004549026 + 0.7806490063667297 + -0.1870959997177124 + <_> + + <_> + + + + <_>1 9 22 3 -1. + <_>1 10 22 1 3. + 0 + 0.0250129997730255 + 0.1528529971837997 + -1.6021020412445068 + <_> + + <_> + + + + <_>0 2 4 18 -1. + <_>0 2 2 9 2. + <_>2 11 2 9 2. + 0 + 0.0465480014681816 + -0.1673820018768311 + 1.1902060508728027 + <_> + + <_> + + + + <_>19 0 4 23 -1. + <_>19 0 2 23 2. + 0 + 0.0176240000873804 + -0.1028549969196320 + 0.3917590081691742 + <_> + + <_> + + + + <_>0 3 6 19 -1. + <_>3 3 3 19 2. + 0 + 0.1631959974765778 + -0.0356240011751652 + -1.6098170280456543 + <_> + + <_> + + + + <_>18 2 6 9 -1. + <_>20 2 2 9 3. + 0 + 0.0131379999220371 + -0.0563590005040169 + 0.5415890216827393 + <_> + + <_> + + + + <_>0 5 10 6 -1. + <_>0 7 10 2 3. + 0 + -0.0156650003045797 + 0.2806310057640076 + -0.3170860111713409 + <_> + + <_> + + + + <_>7 0 12 12 -1. + <_>13 0 6 6 2. + <_>7 6 6 6 2. + 0 + 0.0805540010333061 + 0.1264040023088455 + -1.0297529697418213 + <_> + + <_> + + + + <_>0 3 24 6 -1. + <_>0 3 12 3 2. + <_>12 6 12 3 2. + 0 + 0.0353639982640743 + 0.0207529999315739 + -0.7910559773445129 + <_> + + <_> + + + + <_>10 14 4 10 -1. + <_>10 19 4 5 2. + 0 + 0.0329869985580444 + 0.1905709952116013 + -0.8383989930152893 + <_> + + <_> + + + + <_>8 9 4 15 -1. + <_>8 14 4 5 3. + 0 + 0.0121950004249811 + 0.0737290009856224 + -0.6278070211410523 + <_> + + <_> + + + + <_>4 11 17 6 -1. + <_>4 14 17 3 2. + 0 + 0.0430659987032413 + 0.0473849996924400 + 1.5712939500808716 + <_> + + <_> + + + + <_>2 5 18 8 -1. + <_>2 5 9 4 2. + <_>11 9 9 4 2. + 0 + 0.0303269997239113 + -0.2731460034847260 + 0.3857200145721436 + <_> + + <_> + + + + <_>7 6 14 6 -1. + <_>14 6 7 3 2. + <_>7 9 7 3 2. + 0 + 0.0354930013418198 + 0.0545939989387989 + 0.5258340239524841 + <_> + + <_> + + + + <_>3 6 14 6 -1. + <_>3 6 7 3 2. + <_>10 9 7 3 2. + 0 + -0.0145969996228814 + 0.3815259933471680 + -0.2833240032196045 + <_> + + <_> + + + + <_>16 5 3 18 -1. + <_>17 5 1 18 3. + 0 + 0.0126069998368621 + 0.1545509994029999 + -0.3050149977207184 + <_> + + <_> + + + + <_>5 5 3 18 -1. + <_>6 5 1 18 3. + 0 + 0.0101720001548529 + 0.0236370004713535 + -0.8721789717674255 + <_> + + <_> + + + + <_>10 10 14 4 -1. + <_>10 12 14 2 2. + 0 + 0.0288430005311966 + 0.1609099954366684 + -0.2027759999036789 + <_> + + <_> + + + + <_>4 10 9 4 -1. + <_>4 12 9 2 2. + 0 + 5.5100000463426113e-004 + -0.6154540181159973 + 0.0809359997510910 + -3.7160909175872803 + 10 + -1 + <_> + + + <_> + + <_> + + + + <_>2 0 18 9 -1. + <_>2 3 18 3 3. + 0 + 0.0483440011739731 + -0.8490459918975830 + 0.5697439908981323 + <_> + + <_> + + + + <_>6 3 12 8 -1. + <_>10 3 4 8 3. + 0 + 0.0324600003659725 + -0.8141729831695557 + 0.4478169977664948 + <_> + + <_> + + + + <_>1 1 8 5 -1. + <_>5 1 4 5 2. + 0 + 0.0333399996161461 + -0.3642379939556122 + 0.6793739795684815 + <_> + + <_> + + + + <_>12 7 7 8 -1. + <_>12 11 7 4 2. + 0 + 6.4019998535513878e-003 + -1.1885459423065186 + 0.1923869997262955 + <_> + + <_> + + + + <_>0 12 22 4 -1. + <_>0 14 22 2 2. + 0 + -5.6889997795224190e-003 + 0.3308529853820801 + -0.7133409976959229 + <_> + + <_> + + + + <_>15 6 4 15 -1. + <_>15 11 4 5 3. + 0 + 0.0126980002969503 + -0.5099080204963684 + 0.1137629970908165 + <_> + + <_> + + + + <_>5 7 7 8 -1. + <_>5 11 7 4 2. + 0 + 6.0549997724592686e-003 + -1.0470550060272217 + 0.2022259980440140 + <_> + + <_> + + + + <_>8 18 9 4 -1. + <_>8 20 9 2 2. + 0 + 2.6420000940561295e-003 + -0.5055940151214600 + 0.3644120097160339 + <_> + + <_> + + + + <_>1 2 22 4 -1. + <_>1 4 22 2 2. + 0 + -0.0169259998947382 + -0.9954190254211426 + 0.1260219961404800 + <_> + + <_> + + + + <_>17 3 6 17 -1. + <_>19 3 2 17 3. + 0 + 0.0282359998673201 + -0.0941379964351654 + 0.5778040289878845 + <_> + + <_> + + + + <_>8 2 8 18 -1. + <_>8 11 8 9 2. + 0 + 0.0104289995506406 + 0.2327290028333664 + -0.5256969928741455 + <_> + + <_> + + + + <_>17 0 6 12 -1. + <_>20 0 3 6 2. + <_>17 6 3 6 2. + 0 + 9.8860003054141998e-003 + -0.1031629964709282 + 0.4765760004520416 + <_> + + <_> + + + + <_>7 0 6 9 -1. + <_>9 0 2 9 3. + 0 + 0.0260150004178286 + -1.0920000495389104e-003 + -1.5581729412078857 + <_> + + <_> + + + + <_>15 5 9 12 -1. + <_>15 11 9 6 2. + 0 + -0.0255379993468523 + -0.6545140147209168 + 0.1884319931268692 + <_> + + <_> + + + + <_>2 22 18 2 -1. + <_>2 23 18 1 2. + 0 + -3.5310001112520695e-003 + 0.2814059853553772 + -0.4457530081272125 + <_> + + <_> + + + + <_>10 10 12 6 -1. + <_>16 10 6 3 2. + <_>10 13 6 3 2. + 0 + 9.2449998483061790e-003 + 0.1561200022697449 + -0.2137099951505661 + <_> + + <_> + + + + <_>0 1 4 11 -1. + <_>2 1 2 11 2. + 0 + 0.0210309997200966 + -0.2917029857635498 + 0.5223410129547119 + <_> + + <_> + + + + <_>20 0 4 10 -1. + <_>20 0 2 10 2. + 0 + -0.0510630011558533 + 1.3661290407180786 + 0.0304659996181726 + <_> + + <_> + + + + <_>1 3 6 17 -1. + <_>3 3 2 17 3. + 0 + -0.0623300001025200 + 1.2207020521163940 + -0.2243440002202988 + <_> + + <_> + + + + <_>15 15 9 6 -1. + <_>15 17 9 2 3. + 0 + -0.0329630002379417 + -0.8201680183410645 + 0.1453189998865128 + <_> + + <_> + + + + <_>0 13 8 9 -1. + <_>0 16 8 3 3. + 0 + -0.0374180004000664 + -1.2218099832534790 + 0.0194489993155003 + <_> + + <_> + + + + <_>16 8 6 12 -1. + <_>16 12 6 4 3. + 0 + 0.1240279972553253 + 0.1208230033516884 + -0.9872930049896240 + <_> + + <_> + + + + <_>2 8 6 12 -1. + <_>2 12 6 4 3. + 0 + -8.9229997247457504e-003 + -1.1688489913940430 + 0.0211050007492304 + <_> + + <_> + + + + <_>10 2 4 15 -1. + <_>10 7 4 5 3. + 0 + -0.0598799996078014 + -1.0689330101013184 + 0.1986020058393478 + <_> + + <_> + + + + <_>1 5 19 3 -1. + <_>1 6 19 1 3. + 0 + 6.2620001845061779e-003 + -0.3622959852218628 + 0.3800080120563507 + <_> + + <_> + + + + <_>11 8 9 7 -1. + <_>14 8 3 7 3. + 0 + -0.0176730006933212 + 0.4909409880638123 + -0.1460669934749603 + <_> + + <_> + + + + <_>3 8 12 9 -1. + <_>3 11 12 3 3. + 0 + 0.0175790004432201 + 0.5872809886932373 + -0.2777439951896668 + <_> + + <_> + + + + <_>3 6 18 3 -1. + <_>3 7 18 1 3. + 0 + 5.1560001447796822e-003 + -0.0751949995756149 + 0.6019309759140015 + <_> + + <_> + + + + <_>10 0 4 12 -1. + <_>10 6 4 6 2. + 0 + -0.0105999996885657 + 0.2763740122318268 + -0.3779430091381073 + <_> + + <_> + + + + <_>3 9 18 14 -1. + <_>3 9 9 14 2. + 0 + 0.2088409960269928 + -5.3599998354911804e-003 + 1.0317809581756592 + <_> + + <_> + + + + <_>0 0 4 9 -1. + <_>2 0 2 9 2. + 0 + -0.0264129992574453 + 0.8233640193939209 + -0.2248059958219528 + <_> + + <_> + + + + <_>12 5 4 18 -1. + <_>12 5 2 18 2. + 0 + 0.0588920004665852 + 0.1309829950332642 + -1.1853699684143066 + <_> + + <_> + + + + <_>8 5 4 18 -1. + <_>10 5 2 18 2. + 0 + -0.0115790003910661 + -0.9066780209541321 + 0.0441269986331463 + <_> + + <_> + + + + <_>10 5 6 10 -1. + <_>12 5 2 10 3. + 0 + 0.0459880009293556 + 0.0101439999416471 + 1.0740900039672852 + <_> + + <_> + + + + <_>9 4 4 11 -1. + <_>11 4 2 11 2. + 0 + -0.0228380002081394 + 1.7791990041732788 + -0.1731549948453903 + <_> + + <_> + + + + <_>4 16 18 3 -1. + <_>4 17 18 1 3. + 0 + -8.1709995865821838e-003 + 0.5738630294799805 + -0.0741060003638268 + <_> + + <_> + + + + <_>0 16 20 3 -1. + <_>0 17 20 1 3. + 0 + 3.5359999164938927e-003 + -0.3207289874553680 + 0.4018250107765198 + <_> + + <_> + + + + <_>9 9 6 12 -1. + <_>9 13 6 4 3. + 0 + 0.0494449995458126 + 0.1928800046443939 + -1.2166700363159180 + <_> + + <_> + + + + <_>8 13 8 8 -1. + <_>8 17 8 4 2. + 0 + 3.5139999818056822e-003 + 0.0695680007338524 + -0.7132369875907898 + <_> + + <_> + + + + <_>13 10 3 12 -1. + <_>13 16 3 6 2. + 0 + -0.0309960003942251 + -0.3886219859123230 + 0.1809879988431931 + <_> + + <_> + + + + <_>5 9 14 14 -1. + <_>5 9 7 7 2. + <_>12 16 7 7 2. + 0 + 0.0864529982209206 + -0.0257929991930723 + -1.5453219413757324 + <_> + + <_> + + + + <_>0 0 24 10 -1. + <_>12 0 12 5 2. + <_>0 5 12 5 2. + 0 + -0.1365260034799576 + -1.9199420213699341 + 0.1661330014467239 + <_> + + <_> + + + + <_>1 11 18 2 -1. + <_>1 12 18 1 2. + 0 + -5.7689999230206013e-003 + -1.2822589874267578 + -0.0159079991281033 + <_> + + <_> + + + + <_>19 5 5 12 -1. + <_>19 9 5 4 3. + 0 + -0.0178999993950129 + -0.4040989875793457 + 0.2359160035848618 + <_> + + <_> + + + + <_>0 5 5 12 -1. + <_>0 9 5 4 3. + 0 + -0.0199699997901917 + -0.7289190292358398 + 0.0562350004911423 + <_> + + <_> + + + + <_>16 6 8 18 -1. + <_>20 6 4 9 2. + <_>16 15 4 9 2. + 0 + -0.0574930012226105 + 0.5783079862594605 + -0.0157960001379251 + <_> + + <_> + + + + <_>0 6 8 18 -1. + <_>0 6 4 9 2. + <_>4 15 4 9 2. + 0 + -0.0830560028553009 + 0.9151160120964050 + -0.2112140059471130 + <_> + + <_> + + + + <_>12 5 12 12 -1. + <_>18 5 6 6 2. + <_>12 11 6 6 2. + 0 + -0.0537710003554821 + -0.5193129777908325 + 0.1857600063085556 + <_> + + <_> + + + + <_>7 6 6 9 -1. + <_>9 6 2 9 3. + 0 + -8.3670001477003098e-003 + 0.2410970032215118 + -0.3964860141277313 + <_> + + <_> + + + + <_>9 13 6 11 -1. + <_>11 13 2 11 3. + 0 + 0.0554069988429546 + 0.1677120029926300 + -2.5664970874786377 + <_> + + <_> + + + + <_>0 5 12 12 -1. + <_>0 5 6 6 2. + <_>6 11 6 6 2. + 0 + -0.0671809986233711 + -1.3658570051193237 + -0.0142320003360510 + <_> + + <_> + + + + <_>1 2 23 3 -1. + <_>1 3 23 1 3. + 0 + -0.0239000003784895 + -1.7084569931030273 + 0.1650779992341995 + <_> + + <_> + + + + <_>1 15 19 3 -1. + <_>1 16 19 1 3. + 0 + 5.5949999950826168e-003 + -0.3137399852275848 + 0.3283790051937103 + <_> + + <_> + + + + <_>13 17 11 4 -1. + <_>13 19 11 2 2. + 0 + 0.0212949998676777 + 0.1495340019464493 + -0.4857980012893677 + <_> + + <_> + + + + <_>0 13 8 5 -1. + <_>4 13 4 5 2. + 0 + -0.0246130004525185 + 0.7434639930725098 + -0.2230519950389862 + <_> + + <_> + + + + <_>12 10 10 4 -1. + <_>12 10 5 4 2. + 0 + -0.0196260008960962 + -0.4091829955577850 + 0.1889320015907288 + <_> + + <_> + + + + <_>4 6 9 9 -1. + <_>4 9 9 3 3. + 0 + -0.0532660000026226 + 0.8138160109519959 + -0.2085369974374771 + <_> + + <_> + + + + <_>15 14 9 6 -1. + <_>15 16 9 2 3. + 0 + 7.1290000341832638e-003 + 0.3299610018730164 + -0.5993739962577820 + <_> + + <_> + + + + <_>1 12 9 6 -1. + <_>1 14 9 2 3. + 0 + -0.0224869996309280 + -1.2551610469818115 + -0.0204130001366138 + <_> + + <_> + + + + <_>3 10 20 8 -1. + <_>13 10 10 4 2. + <_>3 14 10 4 2. + 0 + -0.0823109969496727 + 1.3821430206298828 + 0.0593089982867241 + <_> + + <_> + + + + <_>2 0 9 18 -1. + <_>5 0 3 18 3. + 0 + 0.1309700012207031 + -0.0358439981937408 + -1.5396369695663452 + <_> + + <_> + + + + <_>13 11 9 10 -1. + <_>16 11 3 10 3. + 0 + 0.0142930001020432 + -0.1847520023584366 + 0.3745500147342682 + <_> + + <_> + + + + <_>1 2 8 5 -1. + <_>5 2 4 5 2. + 0 + 6.3479999080300331e-003 + -0.4490109980106354 + 0.1387699991464615 + <_> + + <_> + + + + <_>3 4 21 6 -1. + <_>10 4 7 6 3. + 0 + -0.0460550002753735 + 0.6783260107040405 + -0.0170719996094704 + <_> + + <_> + + + + <_>7 0 10 14 -1. + <_>7 0 5 7 2. + <_>12 7 5 7 2. + 0 + 0.0576939992606640 + -0.0119559997692704 + -1.2261159420013428 + <_> + + <_> + + + + <_>12 17 12 4 -1. + <_>12 19 12 2 2. + 0 + -6.0609998181462288e-003 + 0.3395859897136688 + 6.2800000887364149e-004 + <_> + + <_> + + + + <_>0 6 23 4 -1. + <_>0 8 23 2 2. + 0 + -0.0521630011498928 + -1.0621069669723511 + -0.0137799996882677 + <_> + + <_> + + + + <_>13 10 8 10 -1. + <_>17 10 4 5 2. + <_>13 15 4 5 2. + 0 + 0.0465729981660843 + 0.1453880071640015 + -1.2384550571441650 + <_> + + <_> + + + + <_>0 16 18 3 -1. + <_>0 17 18 1 3. + 0 + 7.5309998355805874e-003 + -0.2446770071983337 + 0.5137709975242615 + <_> + + <_> + + + + <_>15 16 9 4 -1. + <_>15 18 9 2 2. + 0 + 0.0216150004416704 + 0.1307259947061539 + -0.7099679708480835 + <_> + + <_> + + + + <_>0 16 9 4 -1. + <_>0 18 9 2 2. + 0 + -0.0178640000522137 + -1.0474660396575928 + 4.9599999329075217e-004 + <_> + + <_> + + + + <_>13 11 6 6 -1. + <_>13 11 3 6 2. + 0 + -0.0371950007975101 + -1.5126730203628540 + 0.1480139940977097 + <_> + + <_> + + + + <_>5 11 6 6 -1. + <_>8 11 3 6 2. + 0 + -3.1100001069717109e-004 + 0.1397150009870529 + -0.4686749875545502 + <_> + + <_> + + + + <_>0 3 24 6 -1. + <_>12 3 12 3 2. + <_>0 6 12 3 2. + 0 + 0.0250429995357990 + 0.2863200008869171 + -0.4179469943046570 + <_> + + <_> + + + + <_>2 4 18 3 -1. + <_>2 5 18 1 3. + 0 + 9.3449996784329414e-003 + -0.2733620107173920 + 0.4344469904899597 + <_> + + <_> + + + + <_>0 0 24 4 -1. + <_>12 0 12 2 2. + <_>0 2 12 2 2. + 0 + 0.0323639996349812 + 0.1843889951705933 + -0.9501929879188538 + <_> + + <_> + + + + <_>1 16 18 3 -1. + <_>1 17 18 1 3. + 0 + -6.2299999408423901e-003 + 0.3258199989795685 + -0.3081560134887695 + <_> + + <_> + + + + <_>15 15 9 6 -1. + <_>15 17 9 2 3. + 0 + 0.0514889992773533 + 0.1141600012779236 + -1.9795479774475098 + <_> + + <_> + + + + <_>0 15 9 6 -1. + <_>0 17 9 2 3. + 0 + -0.0264490004628897 + -1.1067299842834473 + -8.5519999265670776e-003 + <_> + + <_> + + + + <_>6 17 18 3 -1. + <_>6 18 18 1 3. + 0 + -0.0154200000688434 + 0.8013870120048523 + -0.0320350006222725 + <_> + + <_> + + + + <_>8 8 6 10 -1. + <_>10 8 2 10 3. + 0 + 0.0194569993764162 + -0.2644949853420258 + 0.3875389993190765 + <_> + + <_> + + + + <_>10 6 6 9 -1. + <_>12 6 2 9 3. + 0 + 0.0336209982633591 + 0.0160520002245903 + 0.5884090065956116 + <_> + + <_> + + + + <_>8 8 5 8 -1. + <_>8 12 5 4 2. + 0 + 0.0289060007780790 + 0.0152160003781319 + -0.9472360014915466 + <_> + + <_> + + + + <_>12 8 6 8 -1. + <_>12 12 6 4 2. + 0 + 2.0300000323913991e-004 + -0.3076600134372711 + 0.2123589962720871 + <_> + + <_> + + + + <_>6 5 6 11 -1. + <_>8 5 2 11 3. + 0 + -0.0491419993340969 + -1.6058609485626221 + -0.0310949999839067 + <_> + + <_> + + + + <_>13 6 8 9 -1. + <_>13 9 8 3 3. + 0 + 0.0764259994029999 + 0.0747589990496635 + 1.1639410257339478 + <_> + + <_> + + + + <_>1 7 21 6 -1. + <_>1 9 21 2 3. + 0 + 0.0238979998975992 + -6.4320000819861889e-003 + -1.1150749921798706 + <_> + + <_> + + + + <_>15 5 3 12 -1. + <_>15 11 3 6 2. + 0 + 3.8970001041889191e-003 + -0.2410569936037064 + 0.2085890024900436 + <_> + + <_> + + + + <_>6 9 11 12 -1. + <_>6 13 11 4 3. + 0 + -0.0894450023770332 + 1.9157789945602417 + -0.1572110056877136 + <_> + + <_> + + + + <_>13 8 10 8 -1. + <_>18 8 5 4 2. + <_>13 12 5 4 2. + 0 + -0.0150089999660850 + -0.2517409920692444 + 0.1817989945411682 + <_> + + <_> + + + + <_>5 8 12 3 -1. + <_>11 8 6 3 2. + 0 + -0.0111459996551275 + -0.6934949755668640 + 0.0449279993772507 + <_> + + <_> + + + + <_>6 11 18 4 -1. + <_>12 11 6 4 3. + 0 + 0.0945789963006973 + 0.1810210049152374 + -0.7497860193252564 + <_> + + <_> + + + + <_>0 0 22 22 -1. + <_>0 11 22 11 2. + 0 + 0.5503889918327332 + -0.0309740006923676 + -1.6746139526367188 + <_> + + <_> + + + + <_>11 2 6 8 -1. + <_>11 6 6 4 2. + 0 + 0.0413810014724731 + 0.0639100000262260 + 0.7656120061874390 + <_> + + <_> + + + + <_>9 0 6 9 -1. + <_>11 0 2 9 3. + 0 + 0.0247719995677471 + 0.0113800000399351 + -0.8855940103530884 + <_> + + <_> + + + + <_>10 0 6 9 -1. + <_>12 0 2 9 3. + 0 + 0.0509990006685257 + 0.1489029973745346 + -2.4634211063385010 + <_> + + <_> + + + + <_>8 3 6 14 -1. + <_>8 3 3 7 2. + <_>11 10 3 7 2. + 0 + -0.0168939996510744 + 0.3887099921703339 + -0.2988030016422272 + <_> + + <_> + + + + <_>3 10 18 8 -1. + <_>9 10 6 8 3. + 0 + -0.1216230019927025 + -1.5542800426483154 + 0.1630080044269562 + <_> + + <_> + + + + <_>10 0 3 14 -1. + <_>10 7 3 7 2. + 0 + -3.6049999762326479e-003 + 0.2184280008077622 + -0.3731209933757782 + <_> + + <_> + + + + <_>4 3 16 20 -1. + <_>4 13 16 10 2. + 0 + 0.1157540008425713 + -0.0470610000193119 + 0.5940369963645935 + <_> + + <_> + + + + <_>9 4 6 10 -1. + <_>11 4 2 10 3. + 0 + 0.0369039997458458 + -0.2550860047340393 + 0.5539730191230774 + <_> + + <_> + + + + <_>5 0 16 4 -1. + <_>5 2 16 2 2. + 0 + 0.0114839999005198 + -0.1812949925661087 + 0.4068279862403870 + <_> + + <_> + + + + <_>2 5 18 4 -1. + <_>8 5 6 4 3. + 0 + -0.0202339999377728 + 0.5431119799613953 + -0.2382239997386932 + <_> + + <_> + + + + <_>13 0 6 9 -1. + <_>15 0 2 9 3. + 0 + -0.0287650004029274 + -0.6917229890823364 + 0.1594330072402954 + <_> + + <_> + + + + <_>8 4 8 5 -1. + <_>12 4 4 5 2. + 0 + -5.8320001699030399e-003 + 0.2944779992103577 + -0.3400599956512451 + <_> + + <_> + + + + <_>12 10 10 4 -1. + <_>12 10 5 4 2. + 0 + -0.0554689988493919 + 0.9220079779624939 + 0.0940930023789406 + <_> + + <_> + + + + <_>2 10 10 4 -1. + <_>7 10 5 4 2. + 0 + -0.0148010002449155 + -0.7953969836235046 + 0.0315219983458519 + <_> + + <_> + + + + <_>7 11 12 5 -1. + <_>11 11 4 5 3. + 0 + -7.0940000005066395e-003 + 0.3309600055217743 + -0.0508869998157024 + <_> + + <_> + + + + <_>3 10 8 10 -1. + <_>3 10 4 5 2. + <_>7 15 4 5 2. + 0 + -0.0451240018010139 + -1.3719749450683594 + -0.0214089993387461 + <_> + + <_> + + + + <_>11 12 9 8 -1. + <_>14 12 3 8 3. + 0 + 0.0643770024180412 + 0.0639019981026649 + 0.9147830009460449 + <_> + + <_> + + + + <_>0 21 24 3 -1. + <_>8 21 8 3 3. + 0 + -0.0147270001471043 + 0.3605059981346130 + -0.2861450016498566 + <_> + + <_> + + + + <_>3 20 18 4 -1. + <_>9 20 6 4 3. + 0 + 0.0450070016086102 + -0.1561969965696335 + 0.5316029787063599 + <_> + + <_> + + + + <_>1 15 9 6 -1. + <_>1 17 9 2 3. + 0 + -1.1330000124871731e-003 + 0.1342290043830872 + -0.4435890018939972 + <_> + + <_> + + + + <_>11 17 10 4 -1. + <_>11 19 10 2 2. + 0 + 0.0494510009884834 + 0.1057180017232895 + -2.5589139461517334 + <_> + + <_> + + + + <_>9 12 4 12 -1. + <_>9 18 4 6 2. + 0 + 0.0291029997169971 + -0.0100880004465580 + -1.1073939800262451 + <_> + + <_> + + + + <_>9 6 9 6 -1. + <_>12 6 3 6 3. + 0 + 0.0347860008478165 + -2.7719999197870493e-003 + 0.5670099854469299 + <_> + + <_> + + + + <_>1 13 6 9 -1. + <_>1 16 6 3 3. + 0 + -6.1309998854994774e-003 + -0.4688940048217773 + 0.1263639926910400 + <_> + + <_> + + + + <_>6 16 12 4 -1. + <_>6 18 12 2 2. + 0 + 0.0155250001698732 + -8.4279999136924744e-003 + 0.8746920228004456 + <_> + + <_> + + + + <_>1 5 20 3 -1. + <_>1 6 20 1 3. + 0 + 2.9249999206513166e-003 + -0.3443430066108704 + 0.2085160017013550 + <_> + + <_> + + + + <_>8 1 9 9 -1. + <_>8 4 9 3 3. + 0 + -0.0535710006952286 + 1.4982949495315552 + 0.0573280006647110 + <_> + + <_> + + + + <_>2 19 9 4 -1. + <_>2 21 9 2 2. + 0 + -0.0192179996520281 + -0.9923409819602966 + -9.3919998034834862e-003 + <_> + + <_> + + + + <_>11 1 4 18 -1. + <_>11 7 4 6 3. + 0 + -0.0552829988300800 + -0.5768229961395264 + 0.1686059981584549 + <_> + + <_> + + + + <_>7 2 8 12 -1. + <_>7 2 4 6 2. + <_>11 8 4 6 2. + 0 + 0.0563360005617142 + -0.0337750017642975 + -1.3889650106430054 + <_> + + <_> + + + + <_>11 10 9 8 -1. + <_>14 10 3 8 3. + 0 + -0.0238240007311106 + 0.4018209874629974 + 1.8360000103712082e-003 + <_> + + <_> + + + + <_>5 11 12 5 -1. + <_>9 11 4 5 3. + 0 + 1.7810000572353601e-003 + 0.1814599931240082 + -0.4174340069293976 + <_> + + <_> + + + + <_>11 9 9 6 -1. + <_>14 9 3 6 3. + 0 + -0.0376890003681183 + 0.5468310117721558 + 0.0182199999690056 + <_> + + <_> + + + + <_>5 10 6 9 -1. + <_>7 10 2 9 3. + 0 + -0.0241449996829033 + 0.6835209727287293 + -0.1965020000934601 + -3.5645289421081543 + 11 + -1 + <_> + + + <_> + + <_> + + + + <_>4 7 5 12 -1. + <_>4 11 5 4 3. + 0 + 0.0274449996650219 + -0.8998420238494873 + 0.5187649726867676 + <_> + + <_> + + + + <_>2 0 21 6 -1. + <_>9 0 7 6 3. + 0 + 0.1155410036444664 + -0.5652440190315247 + 0.7055130004882813 + <_> + + <_> + + + + <_>7 6 10 6 -1. + <_>7 8 10 2 3. + 0 + -0.0222970005124807 + 0.3607999980449677 + -0.6686459779739380 + <_> + + <_> + + + + <_>9 0 6 15 -1. + <_>11 0 2 15 3. + 0 + 0.0133250001817942 + -0.5557339787483215 + 0.3578999936580658 + <_> + + <_> + + + + <_>2 2 18 2 -1. + <_>2 3 18 1 2. + 0 + -3.8060001097619534e-003 + -1.0713000297546387 + 0.1885000020265579 + <_> + + <_> + + + + <_>8 17 8 6 -1. + <_>8 20 8 3 2. + 0 + -2.6819999329745770e-003 + -0.7158430218696594 + 0.2634449899196625 + <_> + + <_> + + + + <_>3 0 18 2 -1. + <_>3 1 18 1 2. + 0 + 3.3819999080151320e-003 + -0.4693079888820648 + 0.2665840089321137 + <_> + + <_> + + + + <_>8 0 9 6 -1. + <_>11 0 3 6 3. + 0 + 0.0376430004835129 + 0.2109870016574860 + -1.0804339647293091 + <_> + + <_> + + + + <_>0 17 18 3 -1. + <_>0 18 18 1 3. + 0 + -0.0138619998469949 + 0.6691200137138367 + -0.2794280052185059 + <_> + + <_> + + + + <_>6 7 12 5 -1. + <_>10 7 4 5 3. + 0 + -2.7350001037120819e-003 + -0.9533230066299439 + 0.2405129969120026 + <_> + + <_> + + + + <_>0 3 6 9 -1. + <_>2 3 2 9 3. + 0 + -0.0383369997143745 + 0.8143280148506165 + -0.2491939961910248 + <_> + + <_> + + + + <_>20 2 4 9 -1. + <_>20 2 2 9 2. + 0 + -0.0346979983150959 + 1.2330100536346436 + 6.8600000813603401e-003 + <_> + + <_> + + + + <_>0 2 4 9 -1. + <_>2 2 2 9 2. + 0 + 0.0233609993010759 + -0.3079470098018646 + 0.7071449756622315 + <_> + + <_> + + + + <_>0 1 24 4 -1. + <_>12 1 12 2 2. + <_>0 3 12 2 2. + 0 + 0.0350579991936684 + 0.2120590060949326 + -1.4399830102920532 + <_> + + <_> + + + + <_>0 16 9 6 -1. + <_>0 18 9 2 3. + 0 + -0.0132569996640086 + -0.9026070237159729 + 0.0486100018024445 + <_> + + <_> + + + + <_>14 13 9 6 -1. + <_>14 15 9 2 3. + 0 + 0.0127400001510978 + 0.2265519946813583 + -0.4464380145072937 + <_> + + <_> + + + + <_>0 15 19 3 -1. + <_>0 16 19 1 3. + 0 + 3.6400000099092722e-003 + -0.3981789946556091 + 0.3466539978981018 + <_> + + <_> + + + + <_>1 5 22 12 -1. + <_>12 5 11 6 2. + <_>1 11 11 6 2. + 0 + 0.1006470024585724 + 0.1838359981775284 + -1.3410769701004028 + <_> + + <_> + + + + <_>5 13 6 6 -1. + <_>8 13 3 6 2. + 0 + 0. + 0.1553640067577362 + -0.5158249735832214 + <_> + + <_> + + + + <_>4 2 20 3 -1. + <_>4 3 20 1 3. + 0 + 0.0117089999839664 + 0.2165140062570572 + -0.7270519733428955 + <_> + + <_> + + + + <_>8 14 6 10 -1. + <_>10 14 2 10 3. + 0 + -0.0359649993479252 + -1.4789500236511230 + -0.0243170000612736 + <_> + + <_> + + + + <_>6 12 16 6 -1. + <_>14 12 8 3 2. + <_>6 15 8 3 2. + 0 + -0.0212360005825758 + -0.1684409976005554 + 0.1952659934759140 + <_> + + <_> + + + + <_>2 13 8 9 -1. + <_>2 16 8 3 3. + 0 + 0.0148740001022816 + 0.0373359993100166 + -0.8755729794502258 + <_> + + <_> + + + + <_>11 8 6 14 -1. + <_>14 8 3 7 2. + <_>11 15 3 7 2. + 0 + -5.1409997977316380e-003 + 0.3346650004386902 + -0.2410970032215118 + <_> + + <_> + + + + <_>2 12 16 6 -1. + <_>2 12 8 3 2. + <_>10 15 8 3 2. + 0 + 0.0234500002115965 + 5.5320002138614655e-003 + -1.2509720325469971 + <_> + + <_> + + + + <_>5 16 16 8 -1. + <_>5 20 16 4 2. + 0 + -0.0250620003789663 + 0.4521239995956421 + -0.0844699963927269 + <_> + + <_> + + + + <_>9 1 4 12 -1. + <_>9 7 4 6 2. + 0 + -7.7400001464411616e-004 + 0.1524990051984787 + -0.4848650097846985 + <_> + + <_> + + + + <_>8 2 8 10 -1. + <_>12 2 4 5 2. + <_>8 7 4 5 2. + 0 + -0.0404839999973774 + -1.3024920225143433 + 0.1798350065946579 + <_> + + <_> + + + + <_>6 6 12 6 -1. + <_>6 6 6 3 2. + <_>12 9 6 3 2. + 0 + 0.0281709991395473 + -0.2441090047359467 + 0.6227110028266907 + <_> + + <_> + + + + <_>10 7 6 9 -1. + <_>12 7 2 9 3. + 0 + 0.0456929989159107 + 0.0281220003962517 + 0.9239439964294434 + <_> + + <_> + + + + <_>0 0 8 12 -1. + <_>0 0 4 6 2. + <_>4 6 4 6 2. + 0 + 0.0397070012986660 + -0.2233279943466187 + 0.7767400145530701 + <_> + + <_> + + + + <_>18 8 6 9 -1. + <_>18 11 6 3 3. + 0 + 0.0505170002579689 + 0.2031999975442886 + -1.0895930528640747 + <_> + + <_> + + + + <_>2 12 6 6 -1. + <_>5 12 3 6 2. + 0 + -0.0172669999301434 + 0.6859840154647827 + -0.2330449968576431 + <_> + + <_> + + + + <_>3 21 21 3 -1. + <_>10 21 7 3 3. + 0 + 0.0801860019564629 + -0.0102920001372695 + 0.6188110113143921 + <_> + + <_> + + + + <_>2 0 16 6 -1. + <_>2 3 16 3 2. + 0 + 0.0976760014891624 + -0.2007029950618744 + 1.0088349580764771 + <_> + + <_> + + + + <_>13 6 7 6 -1. + <_>13 9 7 3 2. + 0 + -0.0155720002949238 + 0.4761529862880707 + 0.0456239990890026 + <_> + + <_> + + + + <_>6 4 4 14 -1. + <_>6 11 4 7 2. + 0 + -0.0153050003573298 + -1.1077369451522827 + 4.5239999890327454e-003 + <_> + + <_> + + + + <_>9 7 6 9 -1. + <_>11 7 2 9 3. + 0 + -0.0164850000292063 + 1.0152939558029175 + 0.0163279995322227 + <_> + + <_> + + + + <_>7 8 6 14 -1. + <_>7 8 3 7 2. + <_>10 15 3 7 2. + 0 + -0.0261419992893934 + 0.4172329902648926 + -0.2864550054073334 + <_> + + <_> + + + + <_>18 8 4 16 -1. + <_>18 16 4 8 2. + 0 + 8.8679995387792587e-003 + 0.2140499949455261 + -0.1677280068397522 + <_> + + <_> + + + + <_>9 14 6 10 -1. + <_>11 14 2 10 3. + 0 + -0.0268869996070862 + -1.1564220190048218 + -0.0103240003809333 + <_> + + <_> + + + + <_>6 11 12 5 -1. + <_>10 11 4 5 3. + 0 + 7.7789998613297939e-003 + 0.3535949885845184 + -0.2961130142211914 + <_> + + <_> + + + + <_>0 12 23 3 -1. + <_>0 13 23 1 3. + 0 + -0.0159740000963211 + -1.5374109745025635 + -0.0299580004066229 + <_> + + <_> + + + + <_>13 0 6 12 -1. + <_>15 0 2 12 3. + 0 + 0.0208669994026423 + 0.2024410068988800 + -0.7127019762992859 + <_> + + <_> + + + + <_>0 10 12 5 -1. + <_>4 10 4 5 3. + 0 + 0.0854820013046265 + -0.0259329993277788 + -1.5156569480895996 + <_> + + <_> + + + + <_>13 2 10 4 -1. + <_>13 4 10 2 2. + 0 + 0.0238729994744062 + 0.1680340021848679 + -0.3880620002746582 + <_> + + <_> + + + + <_>5 0 6 12 -1. + <_>7 0 2 12 3. + 0 + -0.0391050018370152 + -1.1958349943161011 + -0.0203610006719828 + <_> + + <_> + + + + <_>11 6 9 6 -1. + <_>14 6 3 6 3. + 0 + -0.0779469981789589 + -1.0898950099945068 + 0.1453029960393906 + <_> + + <_> + + + + <_>4 6 9 6 -1. + <_>7 6 3 6 3. + 0 + -0.0168760009109974 + 0.2804970145225525 + -0.4133630096912384 + <_> + + <_> + + + + <_>6 11 18 13 -1. + <_>12 11 6 13 3. + 0 + 0.1187560036778450 + -0.0434909984469414 + 0.4126369953155518 + <_> + + <_> + + + + <_>0 11 18 13 -1. + <_>6 11 6 13 3. + 0 + 0.1562419980764389 + -0.2642959952354431 + 0.5512779951095581 + <_> + + <_> + + + + <_>12 16 12 6 -1. + <_>16 16 4 6 3. + 0 + -0.0459080003201962 + 0.6018919944763184 + 0.0189210008829832 + <_> + + <_> + + + + <_>0 6 21 3 -1. + <_>0 7 21 1 3. + 0 + -0.0103099998086691 + 0.3815299868583679 + -0.2950789928436279 + <_> + + <_> + + + + <_>12 16 12 6 -1. + <_>16 16 4 6 3. + 0 + 0.0957690030336380 + 0.1324650049209595 + -0.4626680016517639 + <_> + + <_> + + + + <_>5 7 6 14 -1. + <_>5 14 6 7 2. + 0 + 0.0136869996786118 + 0.1173869967460632 + -0.5166410207748413 + <_> + + <_> + + + + <_>5 10 19 2 -1. + <_>5 11 19 1 2. + 0 + 2.3990001063793898e-003 + -0.3400759994983673 + 0.2095350027084351 + <_> + + <_> + + + + <_>5 4 14 4 -1. + <_>5 6 14 2 2. + 0 + 0.0332649983465672 + -0.1705279946327210 + 1.4366799592971802 + <_> + + <_> + + + + <_>3 18 18 4 -1. + <_>9 18 6 4 3. + 0 + -0.0332060009241104 + 0.6129570007324219 + -0.0415499992668629 + <_> + + <_> + + + + <_>7 0 4 9 -1. + <_>9 0 2 9 2. + 0 + 2.7979998849332333e-003 + -0.4855430126190186 + 0.1337269991636276 + <_> + + <_> + + + + <_>13 3 11 4 -1. + <_>13 5 11 2 2. + 0 + -0.0657920017838478 + -4.0257668495178223 + 0.1087670028209686 + <_> + + <_> + + + + <_>2 0 9 6 -1. + <_>5 0 3 6 3. + 0 + 2.1430000197142363e-003 + -0.3917999863624573 + 0.2242709994316101 + <_> + + <_> + + + + <_>19 1 4 23 -1. + <_>19 1 2 23 2. + 0 + 0.0223639998584986 + -0.0864299982786179 + 0.3778519928455353 + <_> + + <_> + + + + <_>1 1 4 23 -1. + <_>3 1 2 23 2. + 0 + -0.0574100017547607 + 1.1454069614410400 + -0.1973659992218018 + <_> + + <_> + + + + <_>5 16 18 3 -1. + <_>5 17 18 1 3. + 0 + 6.6550001502037048e-003 + -0.0211050007492304 + 0.5845339894294739 + <_> + + <_> + + + + <_>0 3 11 4 -1. + <_>0 5 11 2 2. + 0 + 0.0123269995674491 + 0.0378170013427734 + -0.6698700189590454 + <_> + + <_> + + + + <_>2 16 20 3 -1. + <_>2 17 20 1 3. + 0 + -8.1869997084140778e-003 + 0.5636600255966187 + -0.0768779963254929 + <_> + + <_> + + + + <_>5 3 13 4 -1. + <_>5 5 13 2 2. + 0 + 0.0366810001432896 + -0.1734330058097839 + 1.1670149564743042 + <_> + + <_> + + + + <_>1 9 22 15 -1. + <_>1 9 11 15 2. + 0 + -0.4022040069103241 + 1.2640819549560547 + 0.0433989986777306 + <_> + + <_> + + + + <_>3 4 14 3 -1. + <_>10 4 7 3 2. + 0 + -0.0221260003745556 + 0.6697810292243958 + -0.2160529941320419 + <_> + + <_> + + + + <_>8 7 10 4 -1. + <_>8 7 5 4 2. + 0 + -0.0131569998338819 + -0.4119859933853149 + 0.2021500021219254 + <_> + + <_> + + + + <_>6 7 10 4 -1. + <_>11 7 5 4 2. + 0 + -0.0128600001335144 + -0.9158269762992859 + 0.0392329990863800 + <_> + + <_> + + + + <_>10 4 6 9 -1. + <_>12 4 2 9 3. + 0 + 0.0216279998421669 + 3.8719999138265848e-003 + 0.3566820025444031 + <_> + + <_> + + + + <_>1 12 9 6 -1. + <_>4 12 3 6 3. + 0 + 0.0118960002437234 + -0.3730390071868897 + 0.1923509985208511 + <_> + + <_> + + + + <_>8 3 8 10 -1. + <_>12 3 4 5 2. + <_>8 8 4 5 2. + 0 + -0.0195489991456270 + -0.4237489998340607 + 0.2442959994077683 + <_> + + <_> + + + + <_>3 6 16 6 -1. + <_>3 6 8 3 2. + <_>11 9 8 3 2. + 0 + 0.0644449964165688 + -0.1655890047550201 + 1.2697030305862427 + <_> + + <_> + + + + <_>5 6 14 6 -1. + <_>5 9 14 3 2. + 0 + 0.1089849993586540 + 0.1489430069923401 + -2.1534640789031982 + <_> + + <_> + + + + <_>4 3 9 6 -1. + <_>4 5 9 2 3. + 0 + -0.0340779982507229 + 1.3779460191726685 + -0.1619849950075150 + <_> + + <_> + + + + <_>6 3 18 2 -1. + <_>6 4 18 1 2. + 0 + -3.7489999085664749e-003 + -0.3382860124111176 + 0.2115290015935898 + <_> + + <_> + + + + <_>7 6 9 6 -1. + <_>10 6 3 6 3. + 0 + -0.0109719997271895 + 0.7651789784431458 + -0.1969259977340698 + <_> + + <_> + + + + <_>0 1 24 3 -1. + <_>0 2 24 1 3. + 0 + -0.0114850001409650 + -0.6927120089530945 + 0.2165710031986237 + <_> + + <_> + + + + <_>0 17 10 6 -1. + <_>0 19 10 2 3. + 0 + 0.0259840004146099 + -0.0119839999824762 + -0.9969729781150818 + <_> + + <_> + + + + <_>3 18 18 3 -1. + <_>3 19 18 1 3. + 0 + 4.2159999720752239e-003 + -0.1020570024847984 + 0.4888440072536469 + <_> + + <_> + + + + <_>2 5 6 16 -1. + <_>2 5 3 8 2. + <_>5 13 3 8 2. + 0 + -0.0476970002055168 + 1.0666010379791260 + -0.1757629960775375 + <_> + + <_> + + + + <_>7 6 11 6 -1. + <_>7 8 11 2 3. + 0 + 4.0300001273863018e-004 + 0.1852480024099350 + -0.7479000091552734 + <_> + + <_> + + + + <_>5 2 12 22 -1. + <_>5 13 12 11 2. + 0 + 0.1153960004448891 + -0.2201970070600510 + 0.5450999736785889 + <_> + + <_> + + + + <_>10 7 4 10 -1. + <_>10 12 4 5 2. + 0 + 0.0160210002213717 + 0.2548750042915344 + -0.5074009895324707 + <_> + + <_> + + + + <_>9 0 4 18 -1. + <_>9 6 4 6 3. + 0 + 0.0566320009529591 + -0.0112560000270605 + -0.9596809744834900 + <_> + + <_> + + + + <_>18 8 6 9 -1. + <_>18 11 6 3 3. + 0 + -0.0107260001823306 + -0.2854470014572144 + 0.1699479967355728 + <_> + + <_> + + + + <_>4 7 15 10 -1. + <_>9 7 5 10 3. + 0 + 0.1242000013589859 + -0.0361399985849857 + -1.3132710456848145 + <_> + + <_> + + + + <_>10 5 6 9 -1. + <_>12 5 2 9 3. + 0 + -5.3799999877810478e-003 + 0.3309270143508911 + 0.0133079998195171 + <_> + + <_> + + + + <_>9 9 6 10 -1. + <_>11 9 2 10 3. + 0 + 0.0119080003350973 + -0.3483029901981354 + 0.2404190003871918 + <_> + + <_> + + + + <_>11 14 6 10 -1. + <_>13 14 2 10 3. + 0 + -0.0430079996585846 + -1.4390469789505005 + 0.1559959948062897 + <_> + + <_> + + + + <_>7 14 6 10 -1. + <_>9 14 2 10 3. + 0 + -0.0331499986350536 + -1.1805850267410278 + -0.0123479999601841 + <_> + + <_> + + + + <_>4 8 16 9 -1. + <_>4 11 16 3 3. + 0 + -0.0213419999927282 + 2.2119441032409668 + 0.0627370029687881 + <_> + + <_> + + + + <_>2 11 20 3 -1. + <_>2 12 20 1 3. + 0 + -0.0122189996764064 + -1.8709750175476074 + -0.0454999990761280 + <_> + + <_> + + + + <_>13 0 4 13 -1. + <_>13 0 2 13 2. + 0 + -0.0168609991669655 + -0.7691270112991333 + 0.1533000022172928 + <_> + + <_> + + + + <_>7 0 4 13 -1. + <_>9 0 2 13 2. + 0 + -2.4999999441206455e-003 + -0.6298739910125732 + 0.0516000017523766 + <_> + + <_> + + + + <_>3 1 18 7 -1. + <_>9 1 6 7 3. + 0 + -0.0450379997491837 + 0.8542889952659607 + 6.2600001692771912e-003 + <_> + + <_> + + + + <_>1 11 6 9 -1. + <_>1 14 6 3 3. + 0 + 0.0390579998493195 + -0.0324589982628822 + -1.3325669765472412 + <_> + + <_> + + + + <_>8 18 9 6 -1. + <_>8 20 9 2 3. + 0 + 6.6720000468194485e-003 + -0.1942359954118729 + 0.3732869923114777 + <_> + + <_> + + + + <_>3 9 15 6 -1. + <_>3 11 15 2 3. + 0 + -0.0163610000163317 + 2.0605869293212891 + -0.1504269987344742 + <_> + + <_> + + + + <_>5 10 19 2 -1. + <_>5 11 19 1 2. + 0 + 6.1719999648630619e-003 + -0.1161099970340729 + 0.2545540034770966 + <_> + + <_> + + + + <_>8 6 7 16 -1. + <_>8 14 7 8 2. + 0 + 0.0457220003008842 + -0.0163400005549192 + -1.0449140071868896 + <_> + + <_> + + + + <_>9 14 9 6 -1. + <_>9 16 9 2 3. + 0 + 4.1209999471902847e-003 + -0.0419979989528656 + 0.3968099951744080 + <_> + + <_> + + + + <_>0 7 8 12 -1. + <_>0 11 8 4 3. + 0 + -1.7800000205170363e-004 + -0.6642259955406189 + 0.0334430001676083 + <_> + + <_> + + + + <_>6 4 18 3 -1. + <_>6 5 18 1 3. + 0 + 7.1109998971223831e-003 + -0.0582319982349873 + 0.3785730004310608 + <_> + + <_> + + + + <_>0 16 12 6 -1. + <_>4 16 4 6 3. + 0 + -0.0498640015721321 + 0.6101940274238586 + -0.2100570052862167 + <_> + + <_> + + + + <_>13 13 9 4 -1. + <_>13 15 9 2 2. + 0 + -0.0250119995325804 + -0.5710009932518005 + 0.1784839928150177 + <_> + + <_> + + + + <_>5 8 14 14 -1. + <_>5 8 7 7 2. + <_>12 15 7 7 2. + 0 + 0.0309399999678135 + 0.0563630014657974 + -0.6473100185394287 + <_> + + <_> + + + + <_>1 16 22 6 -1. + <_>12 16 11 3 2. + <_>1 19 11 3 2. + 0 + 0.0462710000574589 + 0.1748239994049072 + -0.9890940189361572 + <_> + + <_> + + + + <_>9 0 6 9 -1. + <_>11 0 2 9 3. + 0 + -3.1870000530034304e-003 + -0.6680480241775513 + 0.0322670005261898 + <_> + + <_> + + + + <_>9 5 10 10 -1. + <_>14 5 5 5 2. + <_>9 10 5 5 2. + 0 + -0.0243519991636276 + 0.2944490015506744 + -1.3599999947473407e-003 + <_> + + <_> + + + + <_>5 5 10 10 -1. + <_>5 5 5 5 2. + <_>10 10 5 5 2. + 0 + 0.0119740003719926 + -0.2834509909152985 + 0.4717119932174683 + <_> + + <_> + + + + <_>4 6 16 6 -1. + <_>12 6 8 3 2. + <_>4 9 8 3 2. + 0 + 0.0130700003355742 + -0.1083460003137589 + 0.5719329714775085 + <_> + + <_> + + + + <_>0 7 6 9 -1. + <_>0 10 6 3 3. + 0 + 0.0591630004346371 + -0.0509390011429787 + -1.9059720039367676 + <_> + + <_> + + + + <_>16 10 8 14 -1. + <_>20 10 4 7 2. + <_>16 17 4 7 2. + 0 + -0.0410949997603893 + 0.4510459899902344 + -9.7599998116493225e-003 + <_> + + <_> + + + + <_>9 12 6 12 -1. + <_>9 18 6 6 2. + 0 + -0.0839890018105507 + -2.0349199771881104 + -0.0510190017521381 + <_> + + <_> + + + + <_>8 10 8 12 -1. + <_>12 10 4 6 2. + <_>8 16 4 6 2. + 0 + 0.0446190014481544 + 0.1704110056161881 + -1.2278720140457153 + <_> + + <_> + + + + <_>8 0 4 9 -1. + <_>10 0 2 9 2. + 0 + 0.0244190003722906 + -0.0217969994992018 + -1.0822949409484863 + <_> + + <_> + + + + <_>10 4 8 16 -1. + <_>14 4 4 8 2. + <_>10 12 4 8 2. + 0 + -4.3870001100003719e-003 + 0.3046669960021973 + -0.3706659972667694 + <_> + + <_> + + + + <_>7 10 10 6 -1. + <_>7 12 10 2 3. + 0 + 0.0246079992502928 + -0.3116950094699860 + 0.2365729957818985 + <_> + + <_> + + + + <_>5 6 14 14 -1. + <_>12 6 7 7 2. + <_>5 13 7 7 2. + 0 + -0.0851820036768913 + -1.7982350587844849 + 0.1525429934263229 + <_> + + <_> + + + + <_>2 11 20 2 -1. + <_>2 12 20 1 2. + 0 + 0.0218449998646975 + -0.0518880002200603 + -1.9017189741134644 + <_> + + <_> + + + + <_>18 8 4 16 -1. + <_>18 16 4 8 2. + 0 + -0.0168290007859468 + 0.2102590054273605 + 0.0216569993644953 + <_> + + <_> + + + + <_>1 11 12 10 -1. + <_>1 11 6 5 2. + <_>7 16 6 5 2. + 0 + 0.0325479991734028 + -0.2029259949922562 + 0.6094400286674500 + <_> + + <_> + + + + <_>6 9 12 4 -1. + <_>6 11 12 2 2. + 0 + 2.4709999561309814e-003 + -0.9537119865417481 + 0.1856839954853058 + <_> + + <_> + + + + <_>9 12 6 7 -1. + <_>12 12 3 7 2. + 0 + 0.0554159991443157 + -0.1440529972314835 + 2.1506340503692627 + <_> + + <_> + + + + <_>10 4 8 16 -1. + <_>14 4 4 8 2. + <_>10 12 4 8 2. + 0 + -0.1063549965620041 + -1.0911970138549805 + 0.1322800070047379 + <_> + + <_> + + + + <_>6 4 8 16 -1. + <_>6 4 4 8 2. + <_>10 12 4 8 2. + 0 + -7.9889995977282524e-003 + 0.1025340035557747 + -0.5174490213394165 + <_> + + <_> + + + + <_>8 9 9 6 -1. + <_>11 9 3 6 3. + 0 + 0.0755679979920387 + 0.0589650012552738 + 1.2354209423065186 + <_> + + <_> + + + + <_>1 5 16 12 -1. + <_>1 5 8 6 2. + <_>9 11 8 6 2. + 0 + -0.0928059965372086 + -1.3431650400161743 + -0.0344629995524883 + <_> + + <_> + + + + <_>9 9 6 8 -1. + <_>9 9 3 8 2. + 0 + 0.0494319982826710 + 0.0496019981801510 + 1.6054730415344238 + <_> + + <_> + + + + <_>6 0 3 18 -1. + <_>7 0 1 18 3. + 0 + -0.0117729995399714 + -1.0261050462722778 + -4.1559999808669090e-003 + <_> + + <_> + + + + <_>17 9 5 14 -1. + <_>17 16 5 7 2. + 0 + 0.0858860015869141 + 0.0846429988741875 + 0.9522079825401306 + <_> + + <_> + + + + <_>2 9 5 14 -1. + <_>2 16 5 7 2. + 0 + 0.0810310021042824 + -0.1468710005283356 + 1.9359990358352661 + -3.7025990486145020 + 12 + -1 + <_> + + + <_> + + <_> + + + + <_>7 4 10 6 -1. + <_>7 7 10 3 2. + 0 + -0.0338409990072250 + 0.6588950157165527 + -0.6975529789924622 + <_> + + <_> + + + + <_>1 3 23 18 -1. + <_>1 9 23 6 3. + 0 + 0.0154100004583597 + -0.9072840213775635 + 0.3047859966754913 + <_> + + <_> + + + + <_>1 1 21 3 -1. + <_>8 1 7 3 3. + 0 + 0.0549059994518757 + -0.4977479875087738 + 0.5713260173797607 + <_> + + <_> + + + + <_>9 6 6 9 -1. + <_>11 6 2 9 3. + 0 + 0.0213900003582239 + -0.4256519973278046 + 0.5809680223464966 + <_> + + <_> + + + + <_>3 18 12 6 -1. + <_>3 18 6 3 2. + <_>9 21 6 3 2. + 0 + 7.8849997371435165e-003 + -0.4790599942207336 + 0.4301649928092957 + <_> + + <_> + + + + <_>16 8 8 16 -1. + <_>20 8 4 8 2. + <_>16 16 4 8 2. + 0 + -0.0375449992716312 + 0.5086159706115723 + -0.1998589932918549 + <_> + + <_> + + + + <_>0 19 24 4 -1. + <_>8 19 8 4 3. + 0 + 0.1592579931020737 + -0.2326360046863556 + 1.0993319749832153 + <_> + + <_> + + + + <_>16 8 8 16 -1. + <_>20 8 4 8 2. + <_>16 16 4 8 2. + 0 + -0.0689399987459183 + 0.4056900143623352 + 0.0568550005555153 + <_> + + <_> + + + + <_>0 8 8 16 -1. + <_>0 8 4 8 2. + <_>4 16 4 8 2. + 0 + -0.0336950011551380 + 0.4513280093669891 + -0.3333280086517334 + <_> + + <_> + + + + <_>8 12 8 10 -1. + <_>8 17 8 5 2. + 0 + -0.0633149966597557 + -0.8501570224761963 + 0.2234169989824295 + <_> + + <_> + + + + <_>5 7 5 8 -1. + <_>5 11 5 4 2. + 0 + 7.3699997738003731e-003 + -0.9308220148086548 + 0.0592169985175133 + <_> + + <_> + + + + <_>4 1 19 2 -1. + <_>4 2 19 1 2. + 0 + -9.5969997346401215e-003 + -1.2794899940490723 + 0.1844729930162430 + <_> + + <_> + + + + <_>0 12 24 9 -1. + <_>8 12 8 9 3. + 0 + -0.1306799948215485 + 0.5842689871788025 + -0.2600719928741455 + <_> + + <_> + + + + <_>6 0 13 8 -1. + <_>6 4 13 4 2. + 0 + 0.0574029982089996 + -0.0537890009582043 + 0.7117559909820557 + <_> + + <_> + + + + <_>0 0 24 3 -1. + <_>0 1 24 1 3. + 0 + -7.2340001352131367e-003 + -0.8696219921112061 + 0.0752149969339371 + <_> + + <_> + + + + <_>20 3 4 11 -1. + <_>20 3 2 11 2. + 0 + 0.0310989990830421 + -0.0750069990754128 + 0.9078159928321838 + <_> + + <_> + + + + <_>8 6 6 9 -1. + <_>10 6 2 9 3. + 0 + 0.0358540005981922 + -0.2479549944400787 + 0.7227209806442261 + <_> + + <_> + + + + <_>6 11 12 8 -1. + <_>12 11 6 4 2. + <_>6 15 6 4 2. + 0 + -0.0315349996089935 + -1.1238329410552979 + 0.2098830044269562 + <_> + + <_> + + + + <_>0 8 12 6 -1. + <_>0 8 6 3 2. + <_>6 11 6 3 2. + 0 + -0.0194370001554489 + -1.4499390125274658 + -0.0151000004261732 + <_> + + <_> + + + + <_>6 17 18 3 -1. + <_>6 18 18 1 3. + 0 + -7.2420001961290836e-003 + 0.5386490225791931 + -0.1137539967894554 + <_> + + <_> + + + + <_>0 14 9 6 -1. + <_>0 16 9 2 3. + 0 + 8.1639997661113739e-003 + 0.0668890029191971 + -0.7687289714813232 + <_> + + <_> + + + + <_>20 3 4 9 -1. + <_>20 3 2 9 2. + 0 + -0.0436530001461506 + 1.1413530111312866 + 0.0402170009911060 + <_> + + <_> + + + + <_>0 3 4 9 -1. + <_>2 3 2 9 2. + 0 + 0.0265699997544289 + -0.2471909970045090 + 0.5929509997367859 + <_> + + <_> + + + + <_>15 0 9 19 -1. + <_>18 0 3 19 3. + 0 + 0.0322169996798038 + -0.0400249995291233 + 0.3268800079822540 + <_> + + <_> + + + + <_>0 0 9 19 -1. + <_>3 0 3 19 3. + 0 + -0.0722360014915466 + 0.5872939825057983 + -0.2539600133895874 + <_> + + <_> + + + + <_>13 11 6 8 -1. + <_>13 11 3 8 2. + 0 + 0.0314249992370605 + 0.1531510055065155 + -0.5604209899902344 + <_> + + <_> + + + + <_>5 11 6 8 -1. + <_>8 11 3 8 2. + 0 + -4.7699999413453043e-004 + 0.1695889979600906 + -0.5262669920921326 + <_> + + <_> + + + + <_>5 11 19 3 -1. + <_>5 12 19 1 3. + 0 + 2.7189999818801880e-003 + -0.1494459956884384 + 0.2965869903564453 + <_> + + <_> + + + + <_>3 20 18 4 -1. + <_>9 20 6 4 3. + 0 + 0.0328750014305115 + -0.3994350135326386 + 0.2515659928321838 + <_> + + <_> + + + + <_>6 6 16 6 -1. + <_>6 8 16 2 3. + 0 + -0.0145530002191663 + 0.2797259986400604 + -0.4720380008220673 + <_> + + <_> + + + + <_>6 0 9 6 -1. + <_>9 0 3 6 3. + 0 + 0.0380179993808270 + -2.9200001154094934e-003 + -1.1300059556961060 + <_> + + <_> + + + + <_>10 3 4 14 -1. + <_>10 10 4 7 2. + 0 + 2.8659999370574951e-003 + 0.4111180007457733 + -0.2622080147266388 + <_> + + <_> + + + + <_>1 5 15 12 -1. + <_>1 11 15 6 2. + 0 + -0.0416069999337196 + -1.4293819665908813 + -0.0191329997032881 + <_> + + <_> + + + + <_>11 12 8 5 -1. + <_>11 12 4 5 2. + 0 + -0.0248029995709658 + -0.2501359879970551 + 0.1597869992256165 + <_> + + <_> + + + + <_>5 0 6 9 -1. + <_>7 0 2 9 3. + 0 + 0.0100980000570416 + 0.0437389984726906 + -0.6998609900474548 + <_> + + <_> + + + + <_>12 0 6 9 -1. + <_>14 0 2 9 3. + 0 + -0.0209470000118017 + -0.9413779973983765 + 0.2320400029420853 + <_> + + <_> + + + + <_>5 5 12 8 -1. + <_>5 5 6 4 2. + <_>11 9 6 4 2. + 0 + 0.0224580001085997 + -0.2718580067157745 + 0.4531919956207275 + <_> + + <_> + + + + <_>13 12 11 6 -1. + <_>13 14 11 2 3. + 0 + -0.0371109992265701 + -1.0314660072326660 + 0.1442179977893829 + <_> + + <_> + + + + <_>0 13 21 3 -1. + <_>0 14 21 1 3. + 0 + -0.0106480000540614 + 0.6310700178146362 + -0.2552079856395721 + <_> + + <_> + + + + <_>8 1 8 12 -1. + <_>12 1 4 6 2. + <_>8 7 4 6 2. + 0 + 0.0554229989647865 + 0.1620659977197647 + -1.7722640037536621 + <_> + + <_> + + + + <_>1 0 6 12 -1. + <_>1 0 3 6 2. + <_>4 6 3 6 2. + 0 + 0.0216019991785288 + -0.2501609921455383 + 0.5411980152130127 + <_> + + <_> + + + + <_>2 2 21 2 -1. + <_>2 3 21 1 2. + 0 + 8.7000000348780304e-005 + -0.2900890111923218 + 0.3350799977779388 + <_> + + <_> + + + + <_>2 2 19 3 -1. + <_>2 3 19 1 3. + 0 + 0.0144060002639890 + -7.8840004280209541e-003 + -1.1677219867706299 + <_> + + <_> + + + + <_>17 10 6 14 -1. + <_>20 10 3 7 2. + <_>17 17 3 7 2. + 0 + 0.1077739968895912 + 0.1129200011491776 + -2.4940319061279297 + <_> + + <_> + + + + <_>1 10 6 14 -1. + <_>1 10 3 7 2. + <_>4 17 3 7 2. + 0 + 0.0359439998865128 + -0.1948059946298599 + 0.9575750231742859 + <_> + + <_> + + + + <_>7 6 14 14 -1. + <_>14 6 7 7 2. + <_>7 13 7 7 2. + 0 + -3.9510000497102737e-003 + 0.3092780113220215 + -0.2553020119667053 + <_> + + <_> + + + + <_>0 12 9 6 -1. + <_>0 14 9 2 3. + 0 + 0.0209420006722212 + -7.6319999061524868e-003 + -1.0086350440979004 + <_> + + <_> + + + + <_>15 14 8 9 -1. + <_>15 17 8 3 3. + 0 + -0.0298779997974634 + -0.4602769911289215 + 0.1950719952583313 + <_> + + <_> + + + + <_>1 1 22 4 -1. + <_>1 1 11 2 2. + <_>12 3 11 2 2. + 0 + 0.0259719993919134 + -0.0121879996731877 + -1.0035500526428223 + <_> + + <_> + + + + <_>9 11 9 6 -1. + <_>9 13 9 2 3. + 0 + 0.0106030004099011 + -0.0759690031409264 + 0.4166989922523499 + <_> + + <_> + + + + <_>0 15 18 3 -1. + <_>0 16 18 1 3. + 0 + 8.5819996893405914e-003 + -0.2664859890937805 + 0.3911150097846985 + <_> + + <_> + + + + <_>16 14 7 9 -1. + <_>16 17 7 3 3. + 0 + 0.0212709996849298 + 0.1827390044927597 + -0.3605229854583740 + <_> + + <_> + + + + <_>4 3 16 4 -1. + <_>12 3 8 4 2. + 0 + 0.0745180025696754 + -0.1893839985132217 + 0.9265800118446350 + <_> + + <_> + + + + <_>7 6 12 5 -1. + <_>7 6 6 5 2. + 0 + 4.6569998376071453e-003 + -0.1450619995594025 + 0.3329460024833679 + <_> + + <_> + + + + <_>9 6 4 9 -1. + <_>11 6 2 9 2. + 0 + 1.7119999974966049e-003 + -0.5246400237083435 + 0.0898799970746040 + <_> + + <_> + + + + <_>12 1 4 10 -1. + <_>12 1 2 10 2. + 0 + 9.8500004969537258e-004 + -0.3838199973106384 + 0.2439299970865250 + <_> + + <_> + + + + <_>8 1 4 10 -1. + <_>10 1 2 10 2. + 0 + 0.0282339993864298 + -5.7879998348653316e-003 + -1.2617139816284180 + <_> + + <_> + + + + <_>15 15 6 9 -1. + <_>15 18 6 3 3. + 0 + -0.0326780006289482 + -0.5795329809188843 + 0.1695529967546463 + <_> + + <_> + + + + <_>3 15 6 9 -1. + <_>3 18 6 3 3. + 0 + 0.0225360002368689 + 0.0222810003906488 + -0.8786960244178772 + <_> + + <_> + + + + <_>15 1 3 19 -1. + <_>16 1 1 19 3. + 0 + -0.0216579996049404 + -0.6510850191116333 + 0.1296689957380295 + <_> + + <_> + + + + <_>1 3 6 9 -1. + <_>3 3 2 9 3. + 0 + 7.6799998059868813e-003 + -0.3396520018577576 + 0.2201330065727234 + <_> + + <_> + + + + <_>15 0 3 19 -1. + <_>16 0 1 19 3. + 0 + 0.0145920002833009 + 0.1507730036973953 + -0.5045239925384522 + <_> + + <_> + + + + <_>6 3 12 4 -1. + <_>12 3 6 4 2. + 0 + 0.0278680007904768 + -0.2504529953002930 + 0.4574199914932251 + <_> + + <_> + + + + <_>10 5 4 9 -1. + <_>10 5 2 9 2. + 0 + 5.6940000504255295e-003 + -0.1094850003719330 + 0.5575780272483826 + <_> + + <_> + + + + <_>6 0 3 19 -1. + <_>7 0 1 19 3. + 0 + -0.0100029995664954 + -0.9736629724502564 + 0.0184679999947548 + <_> + + <_> + + + + <_>11 1 3 12 -1. + <_>11 7 3 6 2. + 0 + -4.0719998069107533e-003 + 0.3822219967842102 + -0.1692110002040863 + <_> + + <_> + + + + <_>6 7 10 5 -1. + <_>11 7 5 5 2. + 0 + -0.0225939992815256 + -1.0391089916229248 + 5.1839998923242092e-003 + <_> + + <_> + + + + <_>11 3 3 18 -1. + <_>12 3 1 18 3. + 0 + -0.0395799987018108 + -5.5109229087829590 + 0.1116399988532066 + <_> + + <_> + + + + <_>9 3 6 12 -1. + <_>11 3 2 12 3. + 0 + -0.0175379998981953 + 0.9548580050468445 + -0.1858450025320053 + <_> + + <_> + + + + <_>3 7 19 3 -1. + <_>3 8 19 1 3. + 0 + 9.0300003066658974e-003 + 0.0104360003024340 + 0.8211479783058167 + <_> + + <_> + + + + <_>2 7 18 3 -1. + <_>2 8 18 1 3. + 0 + -7.9539995640516281e-003 + 0.2263289988040924 + -0.3456819951534271 + <_> + + <_> + + + + <_>3 13 18 4 -1. + <_>12 13 9 2 2. + <_>3 15 9 2 2. + 0 + 0.0270910002291203 + 0.1643009930849075 + -1.3926379680633545 + <_> + + <_> + + + + <_>3 5 6 9 -1. + <_>5 5 2 9 3. + 0 + -0.0206259991973639 + -0.8636609911918640 + 2.3880000226199627e-003 + <_> + + <_> + + + + <_>4 1 20 4 -1. + <_>14 1 10 2 2. + <_>4 3 10 2 2. + 0 + -0.0719899982213974 + -2.8192629814147949 + 0.1157049983739853 + <_> + + <_> + + + + <_>0 1 20 4 -1. + <_>0 1 10 2 2. + <_>10 3 10 2 2. + 0 + -0.0269649997353554 + -1.2946130037307739 + -0.0246610008180141 + <_> + + <_> + + + + <_>10 15 6 6 -1. + <_>10 15 3 6 2. + 0 + -0.0473779998719692 + -0.8130639791488648 + 0.1183139979839325 + <_> + + <_> + + + + <_>0 2 24 8 -1. + <_>8 2 8 8 3. + 0 + -0.1089560016989708 + 0.6593790054321289 + -0.2084390074014664 + <_> + + <_> + + + + <_>5 5 18 3 -1. + <_>5 6 18 1 3. + 0 + 0.0135740004479885 + 7.4240001849830151e-003 + 0.5315219759941101 + <_> + + <_> + + + + <_>8 15 6 6 -1. + <_>11 15 3 6 2. + 0 + -6.6920001991093159e-003 + 0.3065580129623413 + -0.3108429908752441 + <_> + + <_> + + + + <_>11 12 8 5 -1. + <_>11 12 4 5 2. + 0 + -3.9070001803338528e-003 + 0.2557649910449982 + -0.0529320016503334 + <_> + + <_> + + + + <_>5 12 8 5 -1. + <_>9 12 4 5 2. + 0 + -0.0376130007207394 + -1.4350049495697021 + -0.0154480002820492 + <_> + + <_> + + + + <_>5 0 14 6 -1. + <_>5 2 14 2 3. + 0 + 8.6329998448491096e-003 + -0.1688439995050430 + 0.4212490022182465 + <_> + + <_> + + + + <_>10 2 4 15 -1. + <_>10 7 4 5 3. + 0 + -0.0320970006287098 + -0.6497939825057983 + 0.0411100015044212 + <_> + + <_> + + + + <_>10 7 5 12 -1. + <_>10 11 5 4 3. + 0 + 0.0584959983825684 + -0.0529639981687069 + 0.6336830258369446 + <_> + + <_> + + + + <_>7 9 8 14 -1. + <_>7 9 4 7 2. + <_>11 16 4 7 2. + 0 + -0.0409019999206066 + -0.9210109710693359 + 9.0640000998973846e-003 + <_> + + <_> + + + + <_>1 5 22 6 -1. + <_>12 5 11 3 2. + <_>1 8 11 3 2. + 0 + -0.0199250001460314 + 0.5375999808311462 + -0.0629969984292984 + <_> + + <_> + + + + <_>0 5 6 6 -1. + <_>0 8 6 3 2. + 0 + -4.6020001173019409e-003 + -0.5433350205421448 + 0.0841049998998642 + <_> + + <_> + + + + <_>12 17 9 4 -1. + <_>12 19 9 2 2. + 0 + 0.0168249998241663 + 0.1556369960308075 + -0.4017120003700256 + <_> + + <_> + + + + <_>2 18 19 3 -1. + <_>2 19 19 1 3. + 0 + 9.4790002331137657e-003 + -0.2424529939889908 + 0.5150949954986572 + <_> + + <_> + + + + <_>12 17 9 4 -1. + <_>12 19 9 2 2. + 0 + -0.0195349995046854 + -0.5111839771270752 + 0.1383199989795685 + <_> + + <_> + + + + <_>1 17 18 3 -1. + <_>1 18 18 1 3. + 0 + 0.0107460003346205 + -0.2185499966144562 + 0.6282870173454285 + <_> + + <_> + + + + <_>12 17 9 4 -1. + <_>12 19 9 2 2. + 0 + 0.0379270017147064 + 0.1164029985666275 + -2.7301959991455078 + <_> + + <_> + + + + <_>0 0 24 3 -1. + <_>0 1 24 1 3. + 0 + 0.0163909997791052 + -0.0146359996870160 + -1.0797250270843506 + <_> + + <_> + + + + <_>5 0 14 4 -1. + <_>5 2 14 2 2. + 0 + -0.0197850000113249 + 1.2166420221328735 + 0.0332750007510185 + <_> + + <_> + + + + <_>6 14 9 6 -1. + <_>6 16 9 2 3. + 0 + 0.0110670002177358 + -0.2538830041885376 + 0.4403859972953796 + <_> + + <_> + + + + <_>14 13 6 9 -1. + <_>14 16 6 3 3. + 0 + 5.2479999139904976e-003 + 0.2249680012464523 + -0.2421649992465973 + <_> + + <_> + + + + <_>5 20 13 4 -1. + <_>5 22 13 2 2. + 0 + -0.0111419996246696 + 0.2501809895038605 + -0.3081150054931641 + <_> + + <_> + + + + <_>9 9 6 12 -1. + <_>9 13 6 4 3. + 0 + -0.0106669999659061 + -0.3272910118103027 + 0.2616829872131348 + <_> + + <_> + + + + <_>1 10 21 3 -1. + <_>8 10 7 3 3. + 0 + 0.1054529994726181 + -0.0557500012218952 + -1.9605729579925537 + <_> + + <_> + + + + <_>8 8 9 6 -1. + <_>11 8 3 6 3. + 0 + 0.0548279993236065 + -1.9519999623298645e-003 + 0.7386609911918640 + <_> + + <_> + + + + <_>3 10 9 7 -1. + <_>6 10 3 7 3. + 0 + 0.0177609995007515 + -0.3064720034599304 + 0.2634699940681458 + <_> + + <_> + + + + <_>12 10 10 8 -1. + <_>17 10 5 4 2. + <_>12 14 5 4 2. + 0 + -0.0311859995126724 + -0.2460090070962906 + 0.1708219945430756 + <_> + + <_> + + + + <_>0 15 24 3 -1. + <_>8 15 8 3 3. + 0 + -0.0572960004210472 + 0.4703350067138672 + -0.2604829967021942 + <_> + + <_> + + + + <_>8 5 9 6 -1. + <_>8 7 9 2 3. + 0 + -0.0113120004534721 + 0.3862890005111694 + -0.2881700098514557 + <_> + + <_> + + + + <_>4 13 6 9 -1. + <_>4 16 6 3 3. + 0 + 0.0305920001119375 + -0.0488260015845299 + -1.7638969421386719 + <_> + + <_> + + + + <_>12 17 9 4 -1. + <_>12 19 9 2 2. + 0 + 1.8489999929443002e-003 + 0.2109989970922470 + -0.0259409993886948 + <_> + + <_> + + + + <_>9 12 6 6 -1. + <_>9 15 6 3 2. + 0 + 0.0114190001040697 + -0.1682959944009781 + 1.0278660058975220 + <_> + + <_> + + + + <_>9 9 14 10 -1. + <_>16 9 7 5 2. + <_>9 14 7 5 2. + 0 + 0.0814030021429062 + 0.1153199970722199 + -1.2482399940490723 + <_> + + <_> + + + + <_>1 9 14 10 -1. + <_>1 9 7 5 2. + <_>8 14 7 5 2. + 0 + 0.0534959994256496 + -0.0463039986789227 + -1.7165969610214233 + <_> + + <_> + + + + <_>8 7 9 17 -1. + <_>11 7 3 17 3. + 0 + -0.0239480007439852 + -0.4024659991264343 + 0.2056210041046143 + <_> + + <_> + + + + <_>3 4 6 20 -1. + <_>3 4 3 10 2. + <_>6 14 3 10 2. + 0 + 6.7690000869333744e-003 + -0.3315230011940002 + 0.2068340033292770 + <_> + + <_> + + + + <_>7 8 10 4 -1. + <_>7 8 5 4 2. + 0 + -0.0323439985513687 + -0.7263280153274536 + 0.2007350027561188 + <_> + + <_> + + + + <_>10 7 4 9 -1. + <_>12 7 2 9 2. + 0 + 0.0378630012273788 + -0.1563100069761276 + 1.6697460412979126 + <_> + + <_> + + + + <_>10 15 6 9 -1. + <_>12 15 2 9 3. + 0 + 0.0154400002211332 + 0.1948740035295487 + -0.3538419902324677 + <_> + + <_> + + + + <_>3 8 6 16 -1. + <_>3 8 3 8 2. + <_>6 16 3 8 2. + 0 + -0.0443760007619858 + 0.8209360241889954 + -0.1819359958171845 + <_> + + <_> + + + + <_>12 17 9 4 -1. + <_>12 19 9 2 2. + 0 + -0.0231020003557205 + -0.4304409921169281 + 0.1237540021538734 + <_> + + <_> + + + + <_>3 17 9 4 -1. + <_>3 19 9 2 2. + 0 + 0.0194000005722046 + -0.0297260005027056 + -1.1597590446472168 + <_> + + <_> + + + + <_>10 1 9 6 -1. + <_>13 1 3 6 3. + 0 + 0.1038570031523705 + 0.1114989966154099 + -4.6835222244262695 + <_> + + <_> + + + + <_>5 7 4 10 -1. + <_>5 12 4 5 2. + 0 + -0.0189640000462532 + 2.1773819923400879 + -0.1454440057277679 + <_> + + <_> + + + + <_>7 5 12 6 -1. + <_>11 5 4 6 3. + 0 + 0.0387509986758232 + -0.0494460016489029 + 0.3401829898357391 + <_> + + <_> + + + + <_>6 4 9 8 -1. + <_>9 4 3 8 3. + 0 + 0.0227669999003410 + -0.3280299901962280 + 0.3053140044212341 + <_> + + <_> + + + + <_>12 16 10 8 -1. + <_>17 16 5 4 2. + <_>12 20 5 4 2. + 0 + -0.0313570015132427 + 1.1520819664001465 + 0.0273059997707605 + <_> + + <_> + + + + <_>2 16 10 8 -1. + <_>2 16 5 4 2. + <_>7 20 5 4 2. + 0 + 9.6909999847412109e-003 + -0.3879950046539307 + 0.2151259928941727 + <_> + + <_> + + + + <_>0 0 24 4 -1. + <_>12 0 12 2 2. + <_>0 2 12 2 2. + 0 + -0.0492849983274937 + -1.6774909496307373 + 0.1577419936656952 + <_> + + <_> + + + + <_>0 6 9 6 -1. + <_>0 8 9 2 3. + 0 + -0.0395109988749027 + -0.9764789938926697 + -0.0105520002543926 + <_> + + <_> + + + + <_>0 4 24 6 -1. + <_>12 4 12 3 2. + <_>0 7 12 3 2. + 0 + 0.0479979999363422 + 0.2084390074014664 + -0.6899279952049255 + <_> + + <_> + + + + <_>5 0 11 4 -1. + <_>5 2 11 2 2. + 0 + 0.0514229983091354 + -0.1666530072689056 + 1.2149239778518677 + <_> + + <_> + + + + <_>1 1 22 4 -1. + <_>12 1 11 2 2. + <_>1 3 11 2 2. + 0 + 0.0142799997702241 + 0.2362769991159439 + -0.4139679968357086 + <_> + + <_> + + + + <_>9 6 6 18 -1. + <_>9 15 6 9 2. + 0 + -0.0916119962930679 + -0.9283090233802795 + -0.0183450002223253 + <_> + + <_> + + + + <_>2 9 20 4 -1. + <_>2 11 20 2 2. + 0 + 6.5080001950263977e-003 + -0.7364720106124878 + 0.1949709951877594 + <_> + + <_> + + + + <_>5 2 14 14 -1. + <_>5 9 14 7 2. + 0 + 0.0357230007648468 + 0.1419779956340790 + -0.4208930134773254 + <_> + + <_> + + + + <_>4 2 16 6 -1. + <_>4 5 16 3 2. + 0 + 0.0506380014121532 + 0.0116440001875162 + 0.7848659753799439 + <_> + + <_> + + + + <_>2 3 19 3 -1. + <_>2 4 19 1 3. + 0 + -0.0146139999851584 + -1.1909500360488892 + -0.0351280011236668 + <_> + + <_> + + + + <_>7 1 10 4 -1. + <_>7 3 10 2 2. + 0 + -0.0386629998683929 + 2.4314730167388916 + 0.0656479969620705 + <_> + + <_> + + + + <_>0 9 4 15 -1. + <_>0 14 4 5 3. + 0 + -0.0403469987213612 + 0.7175530195236206 + -0.1910829991102219 + <_> + + <_> + + + + <_>2 10 21 3 -1. + <_>2 11 21 1 3. + 0 + 0.0239020008593798 + 0.1564619988203049 + -0.7929480075836182 + -3.4265899658203125 + 13 + -1 + <_> + + + <_> + + <_> + + + + <_>3 0 6 6 -1. + <_>6 0 3 6 2. + 0 + 8.5640000179409981e-003 + -0.8145070075988770 + 0.5887529850006104 + <_> + + <_> + + + + <_>6 4 14 9 -1. + <_>6 7 14 3 3. + 0 + -0.1329260021448135 + 0.9321339726448059 + -0.2936730086803436 + <_> + + <_> + + + + <_>9 1 6 9 -1. + <_>11 1 2 9 3. + 0 + 9.8400004208087921e-003 + -0.5646290183067322 + 0.4164769947528839 + <_> + + <_> + + + + <_>15 8 9 9 -1. + <_>15 11 9 3 3. + 0 + 5.0889998674392700e-003 + -0.7923280000686646 + 0.1697500050067902 + <_> + + <_> + + + + <_>8 0 4 21 -1. + <_>8 7 4 7 3. + 0 + -0.0610390007495880 + -1.4169000387191772 + 0.0250209998339415 + <_> + + <_> + + + + <_>3 22 19 2 -1. + <_>3 23 19 1 2. + 0 + -4.6599999768659472e-004 + 0.3798249959945679 + -0.4156709909439087 + <_> + + <_> + + + + <_>2 15 20 3 -1. + <_>2 16 20 1 3. + 0 + 3.3889999613165855e-003 + -0.4076859951019287 + 0.3554849922657013 + <_> + + <_> + + + + <_>19 0 4 13 -1. + <_>19 0 2 13 2. + 0 + 0.0210069995373487 + -0.2408010065555573 + 0.8611270189285278 + <_> + + <_> + + + + <_>1 7 8 8 -1. + <_>1 11 8 4 2. + 0 + 7.5559997931122780e-003 + -0.8746719956398010 + 0.0985720008611679 + <_> + + <_> + + + + <_>14 14 6 9 -1. + <_>14 17 6 3 3. + 0 + 0.0247799996286631 + 0.1556620001792908 + -0.6922979950904846 + <_> + + <_> + + + + <_>4 14 6 9 -1. + <_>4 17 6 3 3. + 0 + -0.0356200002133846 + -1.1472270488739014 + 0.0363599993288517 + <_> + + <_> + + + + <_>14 5 4 10 -1. + <_>14 5 2 10 2. + 0 + 0.0198100004345179 + 0.1551620066165924 + -0.6952009797096252 + <_> + + <_> + + + + <_>6 5 4 10 -1. + <_>8 5 2 10 2. + 0 + 0.0150199998170137 + 0.0419900007545948 + -0.9662280082702637 + <_> + + <_> + + + + <_>14 5 6 6 -1. + <_>14 8 6 3 2. + 0 + -0.0231379996985197 + 0.4339689910411835 + 2.4160000029951334e-003 + <_> + + <_> + + + + <_>4 5 6 6 -1. + <_>4 8 6 3 2. + 0 + -0.0187430009245873 + 0.4348109960556030 + -0.3252249956130981 + <_> + + <_> + + + + <_>0 2 24 21 -1. + <_>8 2 8 21 3. + 0 + 0.4508000016212463 + -0.0945739969611168 + 0.7242130041122437 + <_> + + <_> + + + + <_>1 2 6 13 -1. + <_>3 2 2 13 3. + 0 + 0.0118549996986985 + -0.3813309967517853 + 0.3009839951992035 + <_> + + <_> + + + + <_>20 0 4 21 -1. + <_>20 0 2 21 2. + 0 + -0.0248300004750490 + 0.8930060267448425 + -0.1029589995741844 + <_> + + <_> + + + + <_>0 4 4 20 -1. + <_>2 4 2 20 2. + 0 + -0.0447430014610291 + 0.8628029823303223 + -0.2171649932861328 + <_> + + <_> + + + + <_>8 16 9 6 -1. + <_>8 18 9 2 3. + 0 + -0.0146000003442168 + 0.6006940007209778 + -0.1590629965066910 + <_> + + <_> + + + + <_>7 0 6 9 -1. + <_>9 0 2 9 3. + 0 + -0.0245270002633333 + -1.5872869491577148 + -0.0218170005828142 + <_> + + <_> + + + + <_>16 12 7 9 -1. + <_>16 15 7 3 3. + 0 + 0.0230240002274513 + 0.1685339957475662 + -0.3810690045356751 + <_> + + <_> + + + + <_>5 21 14 3 -1. + <_>12 21 7 3 2. + 0 + -0.0249170009046793 + 0.5081089735031128 + -0.2727989852428436 + <_> + + <_> + + + + <_>11 5 6 9 -1. + <_>11 5 3 9 2. + 0 + 1.0130000300705433e-003 + -0.4313879907131195 + 0.2643809914588928 + <_> + + <_> + + + + <_>10 5 4 10 -1. + <_>12 5 2 10 2. + 0 + 0.0156030002981424 + -0.3162420094013214 + 0.5571590065956116 + <_> + + <_> + + + + <_>10 6 6 9 -1. + <_>12 6 2 9 3. + 0 + -0.0266859997063875 + 1.0553920269012451 + 0.0290740001946688 + <_> + + <_> + + + + <_>7 5 6 9 -1. + <_>10 5 3 9 2. + 0 + 1.3940000208094716e-003 + -0.7187380194664002 + 0.0653909966349602 + <_> + + <_> + + + + <_>14 14 10 4 -1. + <_>14 16 10 2 2. + 0 + -6.4799998654052615e-004 + 0.2488439977169037 + -0.2097820043563843 + <_> + + <_> + + + + <_>5 5 14 14 -1. + <_>5 5 7 7 2. + <_>12 12 7 7 2. + 0 + -0.0318880006670952 + -0.6884449720382690 + 0.0635899975895882 + <_> + + <_> + + + + <_>12 8 12 6 -1. + <_>18 8 6 3 2. + <_>12 11 6 3 2. + 0 + -4.9290000461041927e-003 + -0.5915250182151794 + 0.2794359922409058 + <_> + + <_> + + + + <_>6 6 12 12 -1. + <_>6 6 6 6 2. + <_>12 12 6 6 2. + 0 + 0.0311680007725954 + 0.0452239997684956 + -0.8863919973373413 + <_> + + <_> + + + + <_>11 13 6 10 -1. + <_>13 13 2 10 3. + 0 + -0.0336630009114742 + -0.6159020066261292 + 0.1574929952621460 + <_> + + <_> + + + + <_>1 10 20 8 -1. + <_>1 10 10 4 2. + <_>11 14 10 4 2. + 0 + 0.0119669996201992 + -0.3060669898986816 + 0.4229330122470856 + <_> + + <_> + + + + <_>15 13 9 6 -1. + <_>15 15 9 2 3. + 0 + -0.0346800014376640 + -1.3734940290451050 + 0.1590870022773743 + <_> + + <_> + + + + <_>9 0 6 9 -1. + <_>9 3 6 3 3. + 0 + 9.9290004000067711e-003 + -0.5586019754409790 + 0.1211920008063316 + <_> + + <_> + + + + <_>10 1 5 14 -1. + <_>10 8 5 7 2. + 0 + 0.0595749989151955 + 4.9720001406967640e-003 + 0.8205540180206299 + <_> + + <_> + + + + <_>3 4 16 6 -1. + <_>3 6 16 2 3. + 0 + -0.0654280036687851 + 1.5651429891586304 + -0.1681749969720841 + <_> + + <_> + + + + <_>16 3 8 9 -1. + <_>16 6 8 3 3. + 0 + -0.0928959995508194 + -1.5794529914855957 + 0.1466179937124252 + <_> + + <_> + + + + <_>7 13 6 10 -1. + <_>9 13 2 10 3. + 0 + -0.0411840006709099 + -1.5518720149993896 + -0.0299699995666742 + <_> + + <_> + + + + <_>15 13 9 6 -1. + <_>15 15 9 2 3. + 0 + 0.0214479994028807 + 0.1719630062580109 + -0.6934319734573364 + <_> + + <_> + + + + <_>0 13 9 6 -1. + <_>0 15 9 2 3. + 0 + -0.0255699995905161 + -1.3061310052871704 + -0.0243369992822409 + <_> + + <_> + + + + <_>13 16 9 6 -1. + <_>13 18 9 2 3. + 0 + -0.0412009991705418 + -1.3821059465408325 + 0.1480180025100708 + <_> + + <_> + + + + <_>2 16 9 6 -1. + <_>2 18 9 2 3. + 0 + -0.0176689997315407 + -0.7088999748229981 + 0.0365240015089512 + <_> + + <_> + + + + <_>5 16 18 3 -1. + <_>5 17 18 1 3. + 0 + 9.0060001239180565e-003 + -0.0409139990806580 + 0.8037310242652893 + <_> + + <_> + + + + <_>1 16 18 3 -1. + <_>1 17 18 1 3. + 0 + -0.0116529995575547 + 0.5754680037498474 + -0.2499170005321503 + <_> + + <_> + + + + <_>5 0 18 3 -1. + <_>5 1 18 1 3. + 0 + -7.4780001305043697e-003 + -0.4928089976310730 + 0.1981090009212494 + <_> + + <_> + + + + <_>1 1 19 2 -1. + <_>1 2 19 1 2. + 0 + 8.5499999113380909e-004 + -0.4885810017585754 + 0.1356309950351715 + <_> + + <_> + + + + <_>14 2 6 11 -1. + <_>16 2 2 11 3. + 0 + -0.0305380001664162 + -0.6027839779853821 + 0.1852200031280518 + <_> + + <_> + + + + <_>4 15 15 6 -1. + <_>9 15 5 6 3. + 0 + -0.0188469998538494 + 0.2356559932231903 + -0.3513630032539368 + <_> + + <_> + + + + <_>14 2 6 11 -1. + <_>16 2 2 11 3. + 0 + -8.1129996106028557e-003 + -0.0813049972057343 + 0.2106959968805313 + <_> + + <_> + + + + <_>4 2 6 11 -1. + <_>6 2 2 11 3. + 0 + -0.0348300002515316 + -1.2065670490264893 + -0.0142519995570183 + <_> + + <_> + + + + <_>18 2 6 9 -1. + <_>18 5 6 3 3. + 0 + 0.0190210007131100 + 0.2334990054368973 + -0.4566490054130554 + <_> + + <_> + + + + <_>1 2 22 4 -1. + <_>1 2 11 2 2. + <_>12 4 11 2 2. + 0 + -0.0190040003508329 + -0.8107579946517944 + 0.0131400004029274 + <_> + + <_> + + + + <_>2 0 21 12 -1. + <_>9 0 7 12 3. + 0 + -0.0890579968690872 + 0.6154239773750305 + 0.0329830013215542 + <_> + + <_> + + + + <_>0 12 18 3 -1. + <_>0 13 18 1 3. + 0 + 6.8620000965893269e-003 + -0.2958309948444367 + 0.2700369954109192 + <_> + + <_> + + + + <_>12 2 6 9 -1. + <_>14 2 2 9 3. + 0 + -0.0282409992069006 + -0.6110270023345947 + 0.1735749989748001 + <_> + + <_> + + + + <_>3 10 18 3 -1. + <_>3 11 18 1 3. + 0 + -3.2099999953061342e-004 + -0.5332289934158325 + 0.0685390010476112 + <_> + + <_> + + + + <_>16 3 8 9 -1. + <_>16 6 8 3 3. + 0 + -0.1082910001277924 + -1.2879559993743896 + 0.1180170029401779 + <_> + + <_> + + + + <_>3 7 18 3 -1. + <_>3 8 18 1 3. + 0 + 0.0158789996057749 + -0.1707260012626648 + 1.1103910207748413 + <_> + + <_> + + + + <_>9 11 6 9 -1. + <_>11 11 2 9 3. + 0 + 8.6859995499253273e-003 + -0.1099509969353676 + 0.4601050019264221 + <_> + + <_> + + + + <_>9 8 6 9 -1. + <_>11 8 2 9 3. + 0 + -0.0252349991351366 + 1.0220669507980347 + -0.1869429945945740 + <_> + + <_> + + + + <_>15 0 2 18 -1. + <_>15 0 1 18 2. + 0 + -0.0135089997202158 + -0.7831659913063049 + 0.1420260071754456 + <_> + + <_> + + + + <_>7 0 2 18 -1. + <_>8 0 1 18 2. + 0 + -7.7149998396635056e-003 + -0.8806070089340210 + 0.0110600003972650 + <_> + + <_> + + + + <_>17 3 7 9 -1. + <_>17 6 7 3 3. + 0 + 0.0715800002217293 + 0.1136939972639084 + -1.1032789945602417 + <_> + + <_> + + + + <_>3 18 9 6 -1. + <_>3 20 9 2 3. + 0 + -0.0135540002956986 + -0.8109650015830994 + 3.4080001059919596e-003 + <_> + + <_> + + + + <_>3 18 21 3 -1. + <_>3 19 21 1 3. + 0 + 2.9450000729411840e-003 + -0.0728799998760223 + 0.3499810099601746 + <_> + + <_> + + + + <_>0 3 7 9 -1. + <_>0 6 7 3 3. + 0 + -0.0508330017328262 + -1.2868590354919434 + -0.0288420002907515 + <_> + + <_> + + + + <_>2 7 22 3 -1. + <_>2 8 22 1 3. + 0 + -8.7989997118711472e-003 + 0.4761359989643097 + -0.1469040066003799 + <_> + + <_> + + + + <_>0 3 24 16 -1. + <_>0 3 12 8 2. + <_>12 11 12 8 2. + 0 + 0.2142439931631088 + -0.0597020015120506 + -2.4802260398864746 + <_> + + <_> + + + + <_>13 17 9 4 -1. + <_>13 19 9 2 2. + 0 + 0.0139629999175668 + 0.1742029935121536 + -0.4391100108623505 + <_> + + <_> + + + + <_>5 5 12 8 -1. + <_>5 5 6 4 2. + <_>11 9 6 4 2. + 0 + 0.0425020009279251 + -0.1996529996395111 + 0.7065479755401611 + <_> + + <_> + + + + <_>5 6 14 6 -1. + <_>12 6 7 3 2. + <_>5 9 7 3 2. + 0 + 0.0198279991745949 + -0.0691360011696815 + 0.6164339780807495 + <_> + + <_> + + + + <_>5 16 14 6 -1. + <_>5 16 7 3 2. + <_>12 19 7 3 2. + 0 + -0.0335600003600121 + -1.2740780115127563 + -0.0256730001419783 + <_> + + <_> + + + + <_>18 2 6 9 -1. + <_>18 5 6 3 3. + 0 + 0.0635429993271828 + 0.1240350008010864 + -1.0776289701461792 + <_> + + <_> + + + + <_>0 2 6 9 -1. + <_>0 5 6 3 3. + 0 + 0.0219330005347729 + 0.0149520002305508 + -0.7102349996566773 + <_> + + <_> + + + + <_>3 4 20 10 -1. + <_>13 4 10 5 2. + <_>3 9 10 5 2. + 0 + -0.0784249976277351 + 0.6203399896621704 + 0.0336109995841980 + <_> + + <_> + + + + <_>2 13 9 8 -1. + <_>5 13 3 8 3. + 0 + 0.0143900001421571 + -0.3632459938526154 + 0.1730830073356628 + <_> + + <_> + + + + <_>2 1 21 15 -1. + <_>9 1 7 15 3. + 0 + -0.0673099979758263 + 0.5237410068511963 + 0.0127999996766448 + <_> + + <_> + + + + <_>5 12 14 8 -1. + <_>12 12 7 8 2. + 0 + 0.1304749995470047 + -0.1712249964475632 + 1.1235200166702271 + <_> + + <_> + + + + <_>6 7 12 4 -1. + <_>6 7 6 4 2. + 0 + -0.0462459996342659 + -1.1908329725265503 + 0.1742559969425201 + <_> + + <_> + + + + <_>6 5 9 6 -1. + <_>9 5 3 6 3. + 0 + -0.0298420004546642 + 0.8393059968948364 + -0.1806419938802719 + <_> + + <_> + + + + <_>13 11 6 6 -1. + <_>13 11 3 6 2. + 0 + -3.8099999073892832e-004 + 0.3553279936313629 + -0.2384230047464371 + <_> + + <_> + + + + <_>5 11 6 6 -1. + <_>8 11 3 6 2. + 0 + -0.0223789997398853 + -0.8794389963150024 + -7.8399997437372804e-004 + <_> + + <_> + + + + <_>6 4 18 2 -1. + <_>6 5 18 1 2. + 0 + -1.5569999814033508e-003 + -0.1425330042839050 + 0.2587620019912720 + <_> + + <_> + + + + <_>0 2 6 11 -1. + <_>2 2 2 11 3. + 0 + 0.0120130004361272 + -0.2901549935340881 + 0.2605110108852387 + <_> + + <_> + + + + <_>18 0 6 15 -1. + <_>20 0 2 15 3. + 0 + 0.0243849996477365 + -0.0314389988780022 + 0.5869590044021606 + <_> + + <_> + + + + <_>0 0 6 13 -1. + <_>2 0 2 13 3. + 0 + -0.0471809990704060 + 0.6943010091781616 + -0.2181610018014908 + <_> + + <_> + + + + <_>12 0 6 9 -1. + <_>14 0 2 9 3. + 0 + -0.0248939990997314 + -0.6459929943084717 + 0.1561159938573837 + <_> + + <_> + + + + <_>6 0 6 9 -1. + <_>8 0 2 9 3. + 0 + 0.0219449996948242 + -0.0277420002967119 + -1.1346880197525024 + <_> + + <_> + + + + <_>0 2 24 4 -1. + <_>8 2 8 4 3. + 0 + 0.1880989968776703 + -0.0100760003551841 + 1.2429029941558838 + <_> + + <_> + + + + <_>3 13 18 4 -1. + <_>12 13 9 4 2. + 0 + -0.0778720006346703 + 0.8500800132751465 + -0.1901549994945526 + <_> + + <_> + + + + <_>9 7 10 4 -1. + <_>9 7 5 4 2. + 0 + -0.0487690009176731 + -2.0763080120086670 + 0.1217940002679825 + <_> + + <_> + + + + <_>5 8 12 3 -1. + <_>11 8 6 3 2. + 0 + -0.0171150006353855 + -0.8568729758262634 + 7.8760003671050072e-003 + <_> + + <_> + + + + <_>4 14 19 3 -1. + <_>4 15 19 1 3. + 0 + -2.7499999850988388e-003 + 0.3864549994468689 + -0.1139149963855743 + <_> + + <_> + + + + <_>10 0 4 20 -1. + <_>10 10 4 10 2. + 0 + -0.0987939983606339 + -1.7233899831771851 + -0.0560630001127720 + <_> + + <_> + + + + <_>8 15 9 6 -1. + <_>8 17 9 2 3. + 0 + -0.0219369996339083 + 0.5474939942359924 + -0.0424819998443127 + <_> + + <_> + + + + <_>2 9 15 4 -1. + <_>7 9 5 4 3. + 0 + 0.0610969997942448 + -0.0389450006186962 + -1.0807880163192749 + <_> + + <_> + + + + <_>8 4 12 7 -1. + <_>12 4 4 7 3. + 0 + -0.0245639998465776 + 0.5831109881401062 + -9.7599998116493225e-004 + <_> + + <_> + + + + <_>0 10 6 9 -1. + <_>0 13 6 3 3. + 0 + 0.0337520018219948 + -0.0137959998100996 + -0.8473029732704163 + <_> + + <_> + + + + <_>18 5 6 9 -1. + <_>18 8 6 3 3. + 0 + 0.0381990000605583 + 0.1511429995298386 + -0.7947340011596680 + <_> + + <_> + + + + <_>0 18 16 6 -1. + <_>0 18 8 3 2. + <_>8 21 8 3 2. + 0 + -0.0201179999858141 + 0.5157909989356995 + -0.2144539952278137 + <_> + + <_> + + + + <_>9 18 14 6 -1. + <_>16 18 7 3 2. + <_>9 21 7 3 2. + 0 + 0.0247349999845028 + -0.0221050009131432 + 0.4291769862174988 + <_> + + <_> + + + + <_>1 20 20 4 -1. + <_>1 20 10 2 2. + <_>11 22 10 2 2. + 0 + -0.0243570003658533 + -0.8620129823684692 + -3.6760000512003899e-003 + <_> + + <_> + + + + <_>2 8 20 6 -1. + <_>12 8 10 3 2. + <_>2 11 10 3 2. + 0 + -0.0264420006424189 + -0.4539749920368195 + 0.2246280014514923 + <_> + + <_> + + + + <_>7 8 6 9 -1. + <_>9 8 2 9 3. + 0 + -3.4429999068379402e-003 + 0.1307300031185150 + -0.3862270116806030 + <_> + + <_> + + + + <_>8 5 12 8 -1. + <_>12 5 4 8 3. + 0 + 0.1070170029997826 + 0.1315860003232956 + -0.7930690050125122 + <_> + + <_> + + + + <_>4 5 12 8 -1. + <_>8 5 4 8 3. + 0 + 0.0451529994606972 + -0.2529680132865906 + 0.4067240059375763 + <_> + + <_> + + + + <_>10 6 6 9 -1. + <_>12 6 2 9 3. + 0 + 0.0443499982357025 + 0.0226130001246929 + 0.7961810231208801 + <_> + + <_> + + + + <_>2 0 6 16 -1. + <_>4 0 2 16 3. + 0 + 1.0839999886229634e-003 + -0.3915840089321137 + 0.1163910031318665 + <_> + + <_> + + + + <_>15 4 6 12 -1. + <_>15 8 6 4 3. + 0 + 0.0714330002665520 + 0.0824669972062111 + 1.2530590295791626 + <_> + + <_> + + + + <_>3 4 6 12 -1. + <_>3 8 6 4 3. + 0 + 0.0358380004763603 + -0.1820330023765564 + 0.7707870006561279 + <_> + + <_> + + + + <_>15 12 9 6 -1. + <_>15 14 9 2 3. + 0 + -0.0208390001207590 + -0.6174439787864685 + 0.1589139997959137 + <_> + + <_> + + + + <_>4 0 15 22 -1. + <_>4 11 15 11 2. + 0 + 0.4252580106258392 + -0.0489780008792877 + -1.8422030210494995 + <_> + + <_> + + + + <_>15 12 9 6 -1. + <_>15 14 9 2 3. + 0 + 0.0114080002531409 + 0.1791819930076599 + -0.1538349986076355 + <_> + + <_> + + + + <_>0 12 9 6 -1. + <_>0 14 9 2 3. + 0 + -0.0153649998828769 + -0.8401650190353394 + -1.0280000278726220e-003 + <_> + + <_> + + + + <_>15 15 9 6 -1. + <_>15 17 9 2 3. + 0 + -0.0152120003476739 + -0.1899569928646088 + 0.1713099926710129 + <_> + + <_> + + + + <_>0 15 9 6 -1. + <_>0 17 9 2 3. + 0 + -0.0189720001071692 + -0.7954199910163879 + 6.6800001077353954e-003 + <_> + + <_> + + + + <_>10 0 8 10 -1. + <_>14 0 4 5 2. + <_>10 5 4 5 2. + 0 + -3.3330000005662441e-003 + -0.2353080064058304 + 0.2473009973764420 + <_> + + <_> + + + + <_>1 0 4 16 -1. + <_>3 0 2 16 2. + 0 + 0.0932480022311211 + -0.0547580011188984 + -1.8324300050735474 + <_> + + <_> + + + + <_>7 6 10 6 -1. + <_>7 8 10 2 3. + 0 + -0.0125550003722310 + 0.2638520002365112 + -0.3852640092372894 + <_> + + <_> + + + + <_>10 12 4 10 -1. + <_>10 17 4 5 2. + 0 + -0.0270700007677078 + -0.6692979931831360 + 0.0203409995883703 + <_> + + <_> + + + + <_>8 4 10 6 -1. + <_>8 6 10 2 3. + 0 + -0.0236770007759333 + 0.6726530194282532 + -0.0143440002575517 + <_> + + <_> + + + + <_>3 22 18 2 -1. + <_>12 22 9 2 2. + 0 + -0.0142750004306436 + 0.3018639981746674 + -0.2851440012454987 + <_> + + <_> + + + + <_>7 7 11 6 -1. + <_>7 9 11 2 3. + 0 + 0.0280969999730587 + 0.1476600021123886 + -1.4078520536422729 + <_> + + <_> + + + + <_>0 0 12 10 -1. + <_>0 0 6 5 2. + <_>6 5 6 5 2. + 0 + 0.0508400015532970 + -0.1861360073089600 + 0.7995300292968750 + <_> + + <_> + + + + <_>10 1 12 6 -1. + <_>16 1 6 3 2. + <_>10 4 6 3 2. + 0 + 0.0115059996023774 + 0.1911839991807938 + -0.0850350037217140 + <_> + + <_> + + + + <_>7 16 9 4 -1. + <_>7 18 9 2 2. + 0 + -0.0146610001102090 + 0.4523929953575134 + -0.2220519930124283 + <_> + + <_> + + + + <_>5 7 15 16 -1. + <_>10 7 5 16 3. + 0 + 0.2284249961376190 + 0.1348839998245239 + -1.2894610166549683 + <_> + + <_> + + + + <_>5 10 12 13 -1. + <_>11 10 6 13 2. + 0 + 0.1110690012574196 + -0.2075379937887192 + 0.5456159710884094 + <_> + + <_> + + + + <_>6 2 12 6 -1. + <_>12 2 6 3 2. + <_>6 5 6 3 2. + 0 + 3.2450000289827585e-003 + 0.3205370008945465 + -0.1640350073575974 + <_> + + <_> + + + + <_>3 9 12 9 -1. + <_>3 12 12 3 3. + 0 + 0.0853099972009659 + -0.2021050006151199 + 0.5329679846763611 + <_> + + <_> + + + + <_>16 2 8 6 -1. + <_>16 5 8 3 2. + 0 + 0.0220480002462864 + 0.1569859981536865 + -0.1701409965753555 + <_> + + <_> + + + + <_>0 2 8 6 -1. + <_>0 5 8 3 2. + 0 + -0.0156769994646311 + -0.6286349892616272 + 0.0407619997859001 + <_> + + <_> + + + + <_>0 3 24 11 -1. + <_>0 3 12 11 2. + 0 + 0.3311290144920349 + 0.1660930067300797 + -1.0326379537582397 + <_> + + <_> + + + + <_>0 13 8 10 -1. + <_>0 13 4 5 2. + <_>4 18 4 5 2. + 0 + 8.8470000773668289e-003 + -0.2507619857788086 + 0.3166059851646423 + <_> + + <_> + + + + <_>10 14 4 10 -1. + <_>10 19 4 5 2. + 0 + 0.0460800006985664 + 0.1535210013389587 + -1.6333500146865845 + <_> + + <_> + + + + <_>10 2 4 21 -1. + <_>10 9 4 7 3. + 0 + -0.0377030000090599 + 0.5687379837036133 + -0.2010259926319122 + -3.5125269889831543 + 14 + -1 + <_> + + + <_> + + <_> + + + + <_>4 4 15 9 -1. + <_>4 7 15 3 3. + 0 + -0.0818089991807938 + 0.5712479948997498 + -0.6743879914283752 + <_> + + <_> + + + + <_>0 1 24 6 -1. + <_>8 1 8 6 3. + 0 + 0.2176119983196259 + -0.3861019909381867 + 0.9034399986267090 + <_> + + <_> + + + + <_>9 6 5 16 -1. + <_>9 14 5 8 2. + 0 + 0.0148780001327395 + 0.2224159985780716 + -1.2779350280761719 + <_> + + <_> + + + + <_>3 21 18 3 -1. + <_>9 21 6 3 3. + 0 + 0.0524349994957447 + -0.2869040071964264 + 0.7574229836463928 + <_> + + <_> + + + + <_>6 5 3 12 -1. + <_>6 11 3 6 2. + 0 + 9.1429995372891426e-003 + -0.6488040089607239 + 0.2226880043745041 + <_> + + <_> + + + + <_>11 6 4 9 -1. + <_>11 6 2 9 2. + 0 + 7.9169999808073044e-003 + -0.2925359904766083 + 0.3103019893169403 + <_> + + <_> + + + + <_>5 6 9 8 -1. + <_>8 6 3 8 3. + 0 + -0.0260840002447367 + 0.4553270041942596 + -0.3850060105323792 + <_> + + <_> + + + + <_>4 3 20 2 -1. + <_>4 4 20 1 2. + 0 + -2.9400000348687172e-003 + -0.5126439929008484 + 0.2743229866027832 + <_> + + <_> + + + + <_>2 10 18 3 -1. + <_>8 10 6 3 3. + 0 + 0.0571300014853477 + 0.0157880000770092 + -1.2133100032806396 + <_> + + <_> + + + + <_>7 15 10 6 -1. + <_>7 17 10 2 3. + 0 + -6.1309998854994774e-003 + 0.3917460143566132 + -0.3086679875850678 + <_> + + <_> + + + + <_>1 4 4 18 -1. + <_>1 4 2 9 2. + <_>3 13 2 9 2. + 0 + -0.0404050014913082 + 1.1901949644088745 + -0.2034710049629211 + <_> + + <_> + + + + <_>13 0 6 9 -1. + <_>15 0 2 9 3. + 0 + -0.0202970001846552 + -0.6823949813842773 + 0.2045869976282120 + <_> + + <_> + + + + <_>5 0 6 9 -1. + <_>7 0 2 9 3. + 0 + -0.0171889998018742 + -0.8493989706039429 + 0.0384330004453659 + <_> + + <_> + + + + <_>11 0 6 9 -1. + <_>13 0 2 9 3. + 0 + -0.0242159999907017 + -1.1039420366287231 + 0.1597509980201721 + <_> + + <_> + + + + <_>6 7 9 6 -1. + <_>9 7 3 6 3. + 0 + 0.0568690001964569 + -0.1959529966115952 + 1.1806850433349609 + <_> + + <_> + + + + <_>3 0 18 2 -1. + <_>3 1 18 1 2. + 0 + 3.6199999158270657e-004 + -0.4084779918193817 + 0.3293859958648682 + <_> + + <_> + + + + <_>0 10 20 4 -1. + <_>0 10 10 2 2. + <_>10 12 10 2 2. + 0 + 9.9790003150701523e-003 + -0.2967300117015839 + 0.4154790043830872 + <_> + + <_> + + + + <_>10 2 4 12 -1. + <_>10 8 4 6 2. + 0 + -0.0526250004768372 + -1.3069299459457397 + 0.1786260008811951 + <_> + + <_> + + + + <_>6 5 6 12 -1. + <_>6 5 3 6 2. + <_>9 11 3 6 2. + 0 + -0.0137489996850491 + 0.2366580069065094 + -0.4453659951686859 + <_> + + <_> + + + + <_>6 0 18 22 -1. + <_>15 0 9 11 2. + <_>6 11 9 11 2. + 0 + -0.0305170007050037 + 0.2901830077171326 + -0.1121010035276413 + <_> + + <_> + + + + <_>0 0 18 22 -1. + <_>0 0 9 11 2. + <_>9 11 9 11 2. + 0 + -0.3003750145435333 + -2.4237680435180664 + -0.0428309999406338 + <_> + + <_> + + + + <_>18 2 6 11 -1. + <_>20 2 2 11 3. + 0 + -0.0359909981489182 + 0.8820649981498718 + -0.0470129996538162 + <_> + + <_> + + + + <_>0 2 6 11 -1. + <_>2 2 2 11 3. + 0 + -0.0551120005548000 + 0.8011900186538696 + -0.2049099951982498 + <_> + + <_> + + + + <_>11 0 6 9 -1. + <_>13 0 2 9 3. + 0 + 0.0337620005011559 + 0.1461759954690933 + -1.1349489688873291 + <_> + + <_> + + + + <_>0 0 20 3 -1. + <_>0 1 20 1 3. + 0 + -8.2710003480315208e-003 + -0.8160489797592163 + 0.0189880002290010 + <_> + + <_> + + + + <_>2 2 20 2 -1. + <_>2 3 20 1 2. + 0 + -5.4399999789893627e-003 + -0.7098090052604675 + 0.2234369963407517 + <_> + + <_> + + + + <_>1 10 18 2 -1. + <_>1 11 18 1 2. + 0 + 3.1059999018907547e-003 + -0.7280859947204590 + 0.0402249991893768 + <_> + + <_> + + + + <_>18 7 6 9 -1. + <_>18 10 6 3 3. + 0 + 0.0536519996821880 + 0.1717090010643005 + -1.1163710355758667 + <_> + + <_> + + + + <_>0 0 22 9 -1. + <_>0 3 22 3 3. + 0 + -0.1254139989614487 + 2.7680370807647705 + -0.1461150050163269 + <_> + + <_> + + + + <_>17 3 6 9 -1. + <_>17 6 6 3 3. + 0 + 0.0925420001149178 + 0.1160980015993118 + -3.9635529518127441 + <_> + + <_> + + + + <_>0 7 6 9 -1. + <_>0 10 6 3 3. + 0 + 0.0385139994323254 + -7.6399999670684338e-003 + -0.9878090023994446 + <_> + + <_> + + + + <_>0 6 24 6 -1. + <_>0 8 24 2 3. + 0 + -2.0200000144541264e-003 + 0.2305999994277954 + -0.7497029900550842 + <_> + + <_> + + + + <_>0 2 6 10 -1. + <_>2 2 2 10 3. + 0 + 9.7599998116493225e-003 + -0.3113799989223480 + 0.3028779923915863 + <_> + + <_> + + + + <_>10 6 6 9 -1. + <_>12 6 2 9 3. + 0 + 0.0240950006991625 + -0.0495299994945526 + 0.5269010066986084 + <_> + + <_> + + + + <_>7 0 6 9 -1. + <_>9 0 2 9 3. + 0 + -0.0179820004850626 + -1.1610640287399292 + -5.7000000961124897e-003 + <_> + + <_> + + + + <_>15 0 6 9 -1. + <_>17 0 2 9 3. + 0 + -0.0105550000444055 + -0.2718909978866577 + 0.2359769940376282 + <_> + + <_> + + + + <_>3 0 6 9 -1. + <_>5 0 2 9 3. + 0 + -7.2889998555183411e-003 + -0.5421910285949707 + 0.0819140002131462 + <_> + + <_> + + + + <_>15 17 9 6 -1. + <_>15 19 9 2 3. + 0 + 0.0239390004426241 + 0.1797579973936081 + -0.6704949736595154 + <_> + + <_> + + + + <_>0 17 18 3 -1. + <_>0 18 18 1 3. + 0 + -0.0183659996837378 + 0.6266430020332336 + -0.2097010016441345 + <_> + + <_> + + + + <_>15 14 9 6 -1. + <_>15 16 9 2 3. + 0 + 0.0157159995287657 + 0.2419369965791702 + -1.0444309711456299 + <_> + + <_> + + + + <_>0 15 23 6 -1. + <_>0 17 23 2 3. + 0 + -0.0488040000200272 + -0.9406059980392456 + -3.7519999314099550e-003 + <_> + + <_> + + + + <_>5 15 18 3 -1. + <_>5 16 18 1 3. + 0 + 6.7130001261830330e-003 + -0.0754320025444031 + 0.6157529950141907 + <_> + + <_> + + + + <_>0 14 9 6 -1. + <_>0 16 9 2 3. + 0 + 9.7770001739263535e-003 + 0.0392850004136562 + -0.8481029868125916 + <_> + + <_> + + + + <_>9 8 8 10 -1. + <_>13 8 4 5 2. + <_>9 13 4 5 2. + 0 + 0.0147449998185039 + 0.1696899980306625 + -0.5090640187263489 + <_> + + <_> + + + + <_>3 7 15 6 -1. + <_>8 7 5 6 3. + 0 + 0.0970790013670921 + -0.0331030003726482 + -1.2706379890441895 + <_> + + <_> + + + + <_>9 8 8 10 -1. + <_>13 8 4 5 2. + <_>9 13 4 5 2. + 0 + 0.0482859984040260 + 0.0943299978971481 + 2.7203190326690674 + <_> + + <_> + + + + <_>5 0 6 12 -1. + <_>8 0 3 12 2. + 0 + 9.7810002043843269e-003 + -0.3953340053558350 + 0.1536380052566528 + <_> + + <_> + + + + <_>9 8 8 10 -1. + <_>13 8 4 5 2. + <_>9 13 4 5 2. + 0 + -0.0398939996957779 + -0.2276740074157715 + 0.1391399949789047 + <_> + + <_> + + + + <_>8 5 6 9 -1. + <_>10 5 2 9 3. + 0 + 0.0228480007499456 + -0.2739199995994568 + 0.3419950008392334 + <_> + + <_> + + + + <_>10 6 4 18 -1. + <_>12 6 2 9 2. + <_>10 15 2 9 2. + 0 + 6.7179999314248562e-003 + -0.1087429970502853 + 0.4812540113925934 + <_> + + <_> + + + + <_>5 7 12 4 -1. + <_>11 7 6 4 2. + 0 + 0.0595999993383884 + -0.0495220012962818 + -2.0117089748382568 + <_> + + <_> + + + + <_>9 8 8 10 -1. + <_>13 8 4 5 2. + <_>9 13 4 5 2. + 0 + 6.9340001791715622e-003 + 0.1503749936819077 + -0.1127189993858337 + <_> + + <_> + + + + <_>7 8 8 10 -1. + <_>7 8 4 5 2. + <_>11 13 4 5 2. + 0 + 0.0157570000737906 + -0.0208850000053644 + -1.1651979684829712 + <_> + + <_> + + + + <_>11 10 6 14 -1. + <_>14 10 3 7 2. + <_>11 17 3 7 2. + 0 + -0.0496900007128716 + -0.8021349906921387 + 0.1437229961156845 + <_> + + <_> + + + + <_>9 5 6 19 -1. + <_>12 5 3 19 2. + 0 + 0.0523470006883144 + -0.2083670049905777 + 0.6167759895324707 + <_> + + <_> + + + + <_>6 12 12 6 -1. + <_>12 12 6 3 2. + <_>6 15 6 3 2. + 0 + 0.0224309992045164 + 0.2030590027570725 + -0.7532619833946228 + <_> + + <_> + + + + <_>1 9 18 6 -1. + <_>1 9 9 3 2. + <_>10 12 9 3 2. + 0 + 0.0411420017480850 + -0.1811819970607758 + 1.0033359527587891 + <_> + + <_> + + + + <_>16 14 8 10 -1. + <_>20 14 4 5 2. + <_>16 19 4 5 2. + 0 + -0.0216320008039474 + 0.4999899864196777 + -0.0346629992127419 + <_> + + <_> + + + + <_>0 9 22 8 -1. + <_>0 9 11 4 2. + <_>11 13 11 4 2. + 0 + -0.0828080028295517 + 1.1711900234222412 + -0.1843360066413879 + <_> + + <_> + + + + <_>8 18 12 6 -1. + <_>14 18 6 3 2. + <_>8 21 6 3 2. + 0 + 8.5060000419616699e-003 + -0.0632250010967255 + 0.2902489900588989 + <_> + + <_> + + + + <_>0 6 20 18 -1. + <_>0 6 10 9 2. + <_>10 15 10 9 2. + 0 + 0.0789050012826920 + -0.2327450066804886 + 0.5969579815864563 + <_> + + <_> + + + + <_>3 6 20 12 -1. + <_>13 6 10 6 2. + <_>3 12 10 6 2. + 0 + -0.0902070030570030 + -0.8221189975738525 + 0.1777220070362091 + <_> + + <_> + + + + <_>0 16 10 8 -1. + <_>0 16 5 4 2. + <_>5 20 5 4 2. + 0 + -0.0292690005153418 + 0.6086069941520691 + -0.2146890014410019 + <_> + + <_> + + + + <_>6 16 18 3 -1. + <_>6 17 18 1 3. + 0 + 6.9499998353421688e-003 + -0.0426659993827343 + 0.6051210165023804 + <_> + + <_> + + + + <_>0 11 19 3 -1. + <_>0 12 19 1 3. + 0 + -8.0629996955394745e-003 + -1.1508270502090454 + -0.0272860005497932 + <_> + + <_> + + + + <_>14 6 6 9 -1. + <_>14 9 6 3 3. + 0 + 0.0195959992706776 + -9.1880001127719879e-003 + 0.5685780048370361 + <_> + + <_> + + + + <_>1 7 22 4 -1. + <_>1 7 11 2 2. + <_>12 9 11 2 2. + 0 + -0.0148849999532104 + 0.3765879869461060 + -0.2714950144290924 + <_> + + <_> + + + + <_>13 6 7 12 -1. + <_>13 10 7 4 3. + 0 + 0.0252170003950596 + -0.0999910011887550 + 0.2466470003128052 + <_> + + <_> + + + + <_>4 7 11 9 -1. + <_>4 10 11 3 3. + 0 + -0.0158559996634722 + 0.6682670116424561 + -0.2061470001935959 + <_> + + <_> + + + + <_>12 10 10 8 -1. + <_>17 10 5 4 2. + <_>12 14 5 4 2. + 0 + 0.0294410008937120 + 0.1583220064640045 + -0.7606089711189270 + <_> + + <_> + + + + <_>2 12 9 7 -1. + <_>5 12 3 7 3. + 0 + -8.5279997438192368e-003 + 0.3821229934692383 + -0.2540780007839203 + <_> + + <_> + + + + <_>16 14 6 9 -1. + <_>16 17 6 3 3. + 0 + 0.0244219992309809 + 0.1510509997606278 + -0.2875289916992188 + <_> + + <_> + + + + <_>3 12 6 12 -1. + <_>3 16 6 4 3. + 0 + -0.0338869988918304 + -0.6800280213356018 + 0.0343270003795624 + <_> + + <_> + + + + <_>14 13 6 6 -1. + <_>14 16 6 3 2. + 0 + -2.0810000132769346e-003 + 0.2541390061378479 + -0.2685909867286682 + <_> + + <_> + + + + <_>8 0 6 9 -1. + <_>10 0 2 9 3. + 0 + 0.0303589999675751 + -0.0308420006185770 + -1.1476809978485107 + <_> + + <_> + + + + <_>9 1 6 23 -1. + <_>11 1 2 23 3. + 0 + 4.0210001170635223e-003 + -0.3525379896163940 + 0.2986809909343720 + <_> + + <_> + + + + <_>0 16 9 6 -1. + <_>0 18 9 2 3. + 0 + 0.0276810005307198 + -0.0381489992141724 + -1.3262039422988892 + <_> + + <_> + + + + <_>4 17 18 3 -1. + <_>4 18 18 1 3. + 0 + 7.9039996489882469e-003 + -0.0237370003014803 + 0.7050300240516663 + <_> + + <_> + + + + <_>5 2 13 14 -1. + <_>5 9 13 7 2. + 0 + 0.0440310016274452 + 0.1067489981651306 + -0.4526120126247406 + <_> + + <_> + + + + <_>15 0 8 12 -1. + <_>19 0 4 6 2. + <_>15 6 4 6 2. + 0 + -0.0323709994554520 + 0.4667490124702454 + -0.0615469999611378 + <_> + + <_> + + + + <_>0 0 8 12 -1. + <_>0 0 4 6 2. + <_>4 6 4 6 2. + 0 + 0.0209330003708601 + -0.2844789922237396 + 0.4384559988975525 + <_> + + <_> + + + + <_>8 2 8 7 -1. + <_>8 2 4 7 2. + 0 + 0.0252279993146658 + -0.0225370004773140 + 0.7038909792900085 + <_> + + <_> + + + + <_>1 1 6 9 -1. + <_>3 1 2 9 3. + 0 + 6.5520000644028187e-003 + -0.3255490064620972 + 0.2402369976043701 + <_> + + <_> + + + + <_>14 8 6 12 -1. + <_>17 8 3 6 2. + <_>14 14 3 6 2. + 0 + -0.0585579983890057 + -1.2227720022201538 + 0.1166879981756210 + <_> + + <_> + + + + <_>4 8 6 12 -1. + <_>4 8 3 6 2. + <_>7 14 3 6 2. + 0 + 0.0318999998271465 + -0.0193050000816584 + -1.0973169803619385 + <_> + + <_> + + + + <_>16 5 5 15 -1. + <_>16 10 5 5 3. + 0 + -0.0304450001567602 + 0.6558250188827515 + 0.0750909969210625 + <_> + + <_> + + + + <_>3 5 5 15 -1. + <_>3 10 5 5 3. + 0 + 0.0149330003187060 + -0.5215579867362976 + 0.1152309998869896 + <_> + + <_> + + + + <_>18 4 6 9 -1. + <_>18 7 6 3 3. + 0 + -0.0490080006420612 + -0.7830399870872498 + 0.1665720045566559 + <_> + + <_> + + + + <_>1 7 6 15 -1. + <_>1 12 6 5 3. + 0 + 0.0831589996814728 + -2.6879999786615372e-003 + -0.8528230190277100 + <_> + + <_> + + + + <_>11 15 12 8 -1. + <_>17 15 6 4 2. + <_>11 19 6 4 2. + 0 + 0.0239029992371798 + -0.0510109998285770 + 0.4199909865856171 + <_> + + <_> + + + + <_>0 2 24 4 -1. + <_>0 2 12 2 2. + <_>12 4 12 2 2. + 0 + 0.0164289996027946 + 0.0192329995334148 + -0.6504909992218018 + <_> + + <_> + + + + <_>15 1 2 19 -1. + <_>15 1 1 19 2. + 0 + -0.0118380002677441 + -0.6240980029106140 + 0.1541119962930679 + <_> + + <_> + + + + <_>7 1 2 19 -1. + <_>8 1 1 19 2. + 0 + -1.6799999866634607e-004 + 0.1758919954299927 + -0.3433870077133179 + <_> + + <_> + + + + <_>22 1 2 20 -1. + <_>22 1 1 20 2. + 0 + 0.0191939994692802 + 0.0434189997613430 + 0.7906919717788696 + <_> + + <_> + + + + <_>0 1 2 20 -1. + <_>1 1 1 20 2. + 0 + -0.0100320000201464 + 0.4564889967441559 + -0.2249480038881302 + <_> + + <_> + + + + <_>18 11 6 12 -1. + <_>20 11 2 12 3. + 0 + -0.0140040004625916 + 0.3357099890708923 + -4.8799999058246613e-003 + <_> + + <_> + + + + <_>0 11 6 12 -1. + <_>2 11 2 12 3. + 0 + -0.1031989976763725 + -2.3378000259399414 + -0.0589330010116100 + <_> + + <_> + + + + <_>3 6 18 14 -1. + <_>3 13 18 7 2. + 0 + -0.0956970006227493 + -0.6615390181541443 + 0.2009859979152679 + <_> + + <_> + + + + <_>6 10 7 8 -1. + <_>6 14 7 4 2. + 0 + -0.0414809994399548 + 0.4593920111656189 + -0.2231409996747971 + <_> + + <_> + + + + <_>7 9 12 12 -1. + <_>7 13 12 4 3. + 0 + 2.4099999573081732e-003 + -0.2689859867095947 + 0.2492299973964691 + <_> + + <_> + + + + <_>2 18 18 5 -1. + <_>11 18 9 5 2. + 0 + 0.1072499975562096 + -0.1864019930362701 + 0.7276980280876160 + <_> + + <_> + + + + <_>4 21 20 3 -1. + <_>4 22 20 1 3. + 0 + 3.1870000530034304e-003 + -0.0246089994907379 + 0.2864390015602112 + <_> + + <_> + + + + <_>9 12 6 12 -1. + <_>9 12 3 6 2. + <_>12 18 3 6 2. + 0 + 0.0291670002043247 + -0.0346830002963543 + -1.1162580251693726 + <_> + + <_> + + + + <_>4 6 18 3 -1. + <_>4 7 18 1 3. + 0 + 0.0112870000302792 + 6.3760001212358475e-003 + 0.6663209795951843 + <_> + + <_> + + + + <_>3 6 18 3 -1. + <_>3 7 18 1 3. + 0 + -0.0120010003447533 + 0.4242010116577148 + -0.2627980113029480 + <_> + + <_> + + + + <_>18 4 6 9 -1. + <_>18 7 6 3 3. + 0 + -0.0126959998160601 + -0.0219570007175207 + 0.1893679946660996 + <_> + + <_> + + + + <_>2 12 9 6 -1. + <_>2 14 9 2 3. + 0 + 0.0245970003306866 + -0.0349639989435673 + -1.0989320278167725 + <_> + + <_> + + + + <_>4 14 18 4 -1. + <_>13 14 9 2 2. + <_>4 16 9 2 2. + 0 + 0.0459530018270016 + 0.1110979989171028 + -2.9306049346923828 + <_> + + <_> + + + + <_>7 7 6 14 -1. + <_>7 7 3 7 2. + <_>10 14 3 7 2. + 0 + -0.0272410009056330 + 0.2910169959068298 + -0.2740789949893951 + <_> + + <_> + + + + <_>7 13 12 6 -1. + <_>13 13 6 3 2. + <_>7 16 6 3 2. + 0 + 0.0400639995932579 + 0.1187790036201477 + -0.6280180215835571 + <_> + + <_> + + + + <_>6 7 12 9 -1. + <_>10 7 4 9 3. + 0 + 0.0230550002306700 + 0.1481380015611649 + -0.3700749874114990 + <_> + + <_> + + + + <_>12 12 6 6 -1. + <_>12 12 3 6 2. + 0 + -0.0237370003014803 + -0.5372480154037476 + 0.1935819983482361 + <_> + + <_> + + + + <_>0 2 4 10 -1. + <_>0 7 4 5 2. + 0 + 0.0775220021605492 + -0.0601940006017685 + -1.9489669799804688 + <_> + + <_> + + + + <_>8 0 9 6 -1. + <_>11 0 3 6 3. + 0 + -0.0133450003340840 + -0.4522959887981415 + 0.1874150037765503 + <_> + + <_> + + + + <_>2 9 12 6 -1. + <_>2 12 12 3 2. + 0 + -0.0217199996113777 + 1.2144249677658081 + -0.1536580026149750 + <_> + + <_> + + + + <_>13 10 6 9 -1. + <_>13 13 6 3 3. + 0 + -0.0714749991893768 + -2.3047130107879639 + 0.1099990010261536 + <_> + + <_> + + + + <_>5 10 6 9 -1. + <_>5 13 6 3 3. + 0 + -5.4999999701976776e-003 + -0.7185519933700562 + 0.0201009996235371 + <_> + + <_> + + + + <_>9 15 9 6 -1. + <_>9 17 9 2 3. + 0 + 0.0267409998923540 + 0.0735450014472008 + 0.9878600239753723 + <_> + + <_> + + + + <_>5 16 12 6 -1. + <_>5 19 12 3 2. + 0 + -0.0394079983234406 + -1.2227380275726318 + -0.0435069985687733 + <_> + + <_> + + + + <_>3 2 20 3 -1. + <_>3 3 20 1 3. + 0 + 0.0258889999240637 + 0.1340930014848709 + -1.1770780086517334 + <_> + + <_> + + + + <_>2 5 12 6 -1. + <_>6 5 4 6 3. + 0 + 0.0489250011742115 + -0.0308100003749132 + -0.9347950220108032 + <_> + + <_> + + + + <_>11 0 3 24 -1. + <_>12 0 1 24 3. + 0 + 0.0368929989635944 + 0.1333370059728622 + -1.4998290538787842 + <_> + + <_> + + + + <_>3 16 15 4 -1. + <_>8 16 5 4 3. + 0 + 0.0789299979805946 + -0.1453880071640015 + 1.5631790161132813 + <_> + + <_> + + + + <_>9 12 6 12 -1. + <_>9 18 6 6 2. + 0 + 0.0290060006082058 + 0.1938370019197464 + -0.6764280200004578 + <_> + + <_> + + + + <_>1 15 12 8 -1. + <_>1 15 6 4 2. + <_>7 19 6 4 2. + 0 + 6.3089998438954353e-003 + -0.3746539950370789 + 0.1085750013589859 + <_> + + <_> + + + + <_>15 10 8 14 -1. + <_>19 10 4 7 2. + <_>15 17 4 7 2. + 0 + -0.0658309981226921 + 0.8105940222740173 + 0.0302019994705915 + <_> + + <_> + + + + <_>1 9 8 14 -1. + <_>1 9 4 7 2. + <_>5 16 4 7 2. + 0 + -0.0689650028944016 + 0.8377259969711304 + -0.1714099943637848 + <_> + + <_> + + + + <_>9 11 9 10 -1. + <_>9 16 9 5 2. + 0 + -0.1166910007596016 + -0.9464719891548157 + 0.1312319934368134 + <_> + + <_> + + + + <_>6 7 12 6 -1. + <_>6 9 12 2 3. + 0 + -1.3060000492259860e-003 + 0.0460079982876778 + -0.5201159715652466 + <_> + + <_> + + + + <_>10 15 6 9 -1. + <_>12 15 2 9 3. + 0 + -0.0445589981973171 + -1.9423669576644897 + 0.1320070028305054 + <_> + + <_> + + + + <_>7 8 9 7 -1. + <_>10 8 3 7 3. + 0 + 0.0510330013930798 + -0.2148099988698959 + 0.4867390096187592 + <_> + + <_> + + + + <_>10 4 8 10 -1. + <_>14 4 4 5 2. + <_>10 9 4 5 2. + 0 + -0.0315780006349087 + 0.5998979806900024 + 7.9159997403621674e-003 + <_> + + <_> + + + + <_>4 6 6 9 -1. + <_>4 9 6 3 3. + 0 + 0.0210200008004904 + -0.2206950038671494 + 0.5404620170593262 + <_> + + <_> + + + + <_>0 6 24 12 -1. + <_>8 6 8 12 3. + 0 + -0.1382420063018799 + 0.6295750141143799 + -0.0217129997909069 + <_> + + <_> + + + + <_>3 7 6 14 -1. + <_>6 7 3 14 2. + 0 + 0.0522289983928204 + -0.2336090058088303 + 0.4976080060005188 + <_> + + <_> + + + + <_>19 8 5 8 -1. + <_>19 12 5 4 2. + 0 + 0.0258840005844831 + 0.1804199963808060 + -0.2203920036554337 + <_> + + <_> + + + + <_>0 8 5 8 -1. + <_>0 12 5 4 2. + 0 + -0.0121389999985695 + -0.6973189711570740 + 0.0157120004296303 + <_> + + <_> + + + + <_>17 3 6 6 -1. + <_>17 6 6 3 2. + 0 + -0.0242379996925592 + 0.3459329903125763 + 0.0714699998497963 + <_> + + <_> + + + + <_>1 3 6 6 -1. + <_>1 6 6 3 2. + 0 + -0.0252720005810261 + -0.8758329749107361 + -9.8240002989768982e-003 + <_> + + <_> + + + + <_>18 2 6 9 -1. + <_>18 5 6 3 3. + 0 + 0.0125970002263784 + 0.2364999949932098 + -0.2873120009899139 + <_> + + <_> + + + + <_>0 2 6 9 -1. + <_>0 5 6 3 3. + 0 + 0.0573309995234013 + -0.0615309998393059 + -2.2326040267944336 + <_> + + <_> + + + + <_>3 3 18 6 -1. + <_>3 5 18 2 3. + 0 + 0.0166710000485182 + -0.1985010057687759 + 0.4081070125102997 + <_> + + <_> + + + + <_>2 3 9 6 -1. + <_>2 5 9 2 3. + 0 + -0.0228189993649721 + 0.9648759961128235 + -0.2024569958448410 + <_> + + <_> + + + + <_>9 3 10 8 -1. + <_>14 3 5 4 2. + <_>9 7 5 4 2. + 0 + 3.7000001611886546e-005 + -0.0589089989662170 + 0.2705540060997009 + <_> + + <_> + + + + <_>5 3 10 8 -1. + <_>5 3 5 4 2. + <_>10 7 5 4 2. + 0 + -7.6700001955032349e-003 + -0.4531710147857666 + 0.0896280035376549 + <_> + + <_> + + + + <_>10 11 6 12 -1. + <_>10 11 3 12 2. + 0 + 0.0940859988331795 + 0.1160459965467453 + -1.0951169729232788 + <_> + + <_> + + + + <_>8 11 6 11 -1. + <_>11 11 3 11 2. + 0 + -0.0622670017182827 + 1.8096530437469482 + -0.1477320045232773 + <_> + + <_> + + + + <_>7 8 10 4 -1. + <_>7 8 5 4 2. + 0 + 0.0174160003662109 + 0.2306820005178452 + -0.4241760075092316 + <_> + + <_> + + + + <_>9 6 6 7 -1. + <_>12 6 3 7 2. + 0 + -0.0220660008490086 + 0.4927029907703400 + -0.2063090056180954 + <_> + + <_> + + + + <_>5 18 18 3 -1. + <_>5 19 18 1 3. + 0 + -0.0104040000587702 + 0.6092429757118225 + 0.0281300004571676 + <_> + + <_> + + + + <_>8 4 6 9 -1. + <_>10 4 2 9 3. + 0 + -9.3670003116130829e-003 + 0.4017120003700256 + -0.2168170064687729 + <_> + + <_> + + + + <_>8 1 9 7 -1. + <_>11 1 3 7 3. + 0 + -0.0290399994701147 + -0.8487650156021118 + 0.1424680054187775 + <_> + + <_> + + + + <_>6 11 6 6 -1. + <_>9 11 3 6 2. + 0 + -0.0210619997233152 + -0.7919830083847046 + -0.0125959999859333 + <_> + + <_> + + + + <_>14 12 4 11 -1. + <_>14 12 2 11 2. + 0 + -0.0370009988546371 + -0.6748890280723572 + 0.1283040046691895 + <_> + + <_> + + + + <_>6 12 4 11 -1. + <_>8 12 2 11 2. + 0 + 0.0107359997928143 + 0.0367799997329712 + -0.6339300274848938 + <_> + + <_> + + + + <_>8 0 12 18 -1. + <_>12 0 4 18 3. + 0 + 0.1636759936809540 + 0.1380389928817749 + -0.4718900024890900 + <_> + + <_> + + + + <_>2 12 10 5 -1. + <_>7 12 5 5 2. + 0 + 0.0949179977178574 + -0.1385570019483566 + 1.9492419958114624 + <_> + + <_> + + + + <_>2 20 22 3 -1. + <_>2 21 22 1 3. + 0 + 0.0352619998157024 + 0.1372189968824387 + -2.1186530590057373 + <_> + + <_> + + + + <_>0 4 2 20 -1. + <_>1 4 1 20 2. + 0 + 0.0128110004588962 + -0.2000810056924820 + 0.4950779974460602 + -3.5939640998840332 + 15 + -1 + <_> + + + <_> + + <_> + + + + <_>0 2 24 4 -1. + <_>8 2 8 4 3. + 0 + 0.1390440016984940 + -0.4658119976520538 + 0.7643160223960877 + <_> + + <_> + + + + <_>7 8 10 4 -1. + <_>7 10 10 2 2. + 0 + 0.0119169997051358 + -0.9439899921417236 + 0.3972629904747009 + <_> + + <_> + + + + <_>6 7 8 10 -1. + <_>6 7 4 5 2. + <_>10 12 4 5 2. + 0 + -0.0100069995969534 + 0.3271879851818085 + -0.6336740255355835 + <_> + + <_> + + + + <_>14 0 6 14 -1. + <_>17 0 3 7 2. + <_>14 7 3 7 2. + 0 + -6.0479999519884586e-003 + 0.2742789983749390 + -0.5744699835777283 + <_> + + <_> + + + + <_>4 11 5 8 -1. + <_>4 15 5 4 2. + 0 + -1.2489999644458294e-003 + 0.2362930029630661 + -0.6859350204467773 + <_> + + <_> + + + + <_>2 0 20 9 -1. + <_>2 3 20 3 3. + 0 + 0.0323820002377033 + -0.5763019919395447 + 0.2749269902706146 + <_> + + <_> + + + + <_>6 7 12 8 -1. + <_>6 7 6 4 2. + <_>12 11 6 4 2. + 0 + -0.0139579996466637 + -0.6106150150299072 + 0.2454160004854202 + <_> + + <_> + + + + <_>9 17 6 6 -1. + <_>9 20 6 3 2. + 0 + 1.1159999994561076e-003 + -0.5653910040855408 + 0.2717930078506470 + <_> + + <_> + + + + <_>7 10 10 4 -1. + <_>7 12 10 2 2. + 0 + 2.7000000045518391e-005 + -0.8023599982261658 + 0.1150910034775734 + <_> + + <_> + + + + <_>6 5 12 9 -1. + <_>10 5 4 9 3. + 0 + -2.5700000696815550e-004 + -0.8120589852333069 + 0.2384469956159592 + <_> + + <_> + + + + <_>5 11 6 8 -1. + <_>8 11 3 8 2. + 0 + 4.0460000745952129e-003 + 0.1390960067510605 + -0.6616320013999939 + <_> + + <_> + + + + <_>18 4 4 17 -1. + <_>18 4 2 17 2. + 0 + 0.0143560003489256 + -0.1648519933223724 + 0.4190169870853424 + <_> + + <_> + + + + <_>0 0 6 6 -1. + <_>3 0 3 6 2. + 0 + -0.0553749985992908 + 1.4425870180130005 + -0.1882019937038422 + <_> + + <_> + + + + <_>18 4 4 17 -1. + <_>18 4 2 17 2. + 0 + 0.0935949981212616 + 0.1354829967021942 + -0.9163609743118286 + <_> + + <_> + + + + <_>2 4 4 17 -1. + <_>4 4 2 17 2. + 0 + 0.0266249999403954 + -0.3374829888343811 + 0.3923360109329224 + <_> + + <_> + + + + <_>5 18 19 3 -1. + <_>5 19 19 1 3. + 0 + 3.7469998933374882e-003 + -0.1161540001630783 + 0.4439930021762848 + <_> + + <_> + + + + <_>11 0 2 18 -1. + <_>11 9 2 9 2. + 0 + -0.0318860001862049 + -0.9949830174446106 + 1.6120000509545207e-003 + <_> + + <_> + + + + <_>15 4 2 18 -1. + <_>15 13 2 9 2. + 0 + -0.0226000007241964 + -0.4806739985942841 + 0.1700730025768280 + <_> + + <_> + + + + <_>7 4 2 18 -1. + <_>7 13 2 9 2. + 0 + 0.0252020005136728 + 0.0355800017714500 + -0.8021540045738220 + <_> + + <_> + + + + <_>7 11 10 8 -1. + <_>12 11 5 4 2. + <_>7 15 5 4 2. + 0 + -0.0310369990766048 + -1.0895340442657471 + 0.1808190047740936 + <_> + + <_> + + + + <_>10 6 4 9 -1. + <_>12 6 2 9 2. + 0 + -0.0264759995043278 + 0.9567120075225830 + -0.2104939967393875 + <_> + + <_> + + + + <_>10 0 6 9 -1. + <_>12 0 2 9 3. + 0 + -0.0138539997860789 + -1.0370320081710815 + 0.2216670066118240 + <_> + + <_> + + + + <_>2 9 16 8 -1. + <_>2 9 8 4 2. + <_>10 13 8 4 2. + 0 + -0.0629250034689903 + 0.9019939899444580 + -0.1908529996871948 + <_> + + <_> + + + + <_>14 15 6 9 -1. + <_>14 18 6 3 3. + 0 + -0.0447509996592999 + -1.0119110345840454 + 0.1469119936227799 + <_> + + <_> + + + + <_>8 7 6 9 -1. + <_>10 7 2 9 3. + 0 + -0.0204280000180006 + 0.6162449717521668 + -0.2355269938707352 + <_> + + <_> + + + + <_>14 15 6 9 -1. + <_>14 18 6 3 3. + 0 + -8.0329999327659607e-003 + -0.0832799971103668 + 0.2172870039939880 + <_> + + <_> + + + + <_>3 12 12 6 -1. + <_>3 14 12 2 3. + 0 + 8.7280003353953362e-003 + 0.0654589980840683 + -0.6031870245933533 + <_> + + <_> + + + + <_>14 12 9 6 -1. + <_>14 14 9 2 3. + 0 + -0.0272020008414984 + -0.9344739913940430 + 0.1527000069618225 + <_> + + <_> + + + + <_>1 12 9 6 -1. + <_>1 14 9 2 3. + 0 + -0.0164710003882647 + -0.8417710065841675 + 0.0133320000022650 + <_> + + <_> + + + + <_>3 7 18 3 -1. + <_>3 8 18 1 3. + 0 + -0.0137440003454685 + 0.6056720018386841 + -0.0920210033655167 + <_> + + <_> + + + + <_>1 7 22 6 -1. + <_>1 9 22 2 3. + 0 + 0.0291649997234344 + -0.0281140003353357 + -1.4014569520950317 + <_> + + <_> + + + + <_>18 4 6 6 -1. + <_>18 7 6 3 2. + 0 + 0.0374570004642010 + 0.1308059990406036 + -0.4938249886035919 + <_> + + <_> + + + + <_>0 4 6 6 -1. + <_>0 7 6 3 2. + 0 + -0.0250700004398823 + -1.1289390325546265 + -0.0146000003442168 + <_> + + <_> + + + + <_>5 11 16 6 -1. + <_>5 14 16 3 2. + 0 + -0.0638120025396347 + 0.7587159872055054 + -1.8200000049546361e-003 + <_> + + <_> + + + + <_>6 16 9 4 -1. + <_>6 18 9 2 2. + 0 + -9.3900002539157867e-003 + 0.2993640005588532 + -0.2948780059814453 + <_> + + <_> + + + + <_>14 15 6 9 -1. + <_>14 18 6 3 3. + 0 + -7.6000002445653081e-004 + 0.0197250004857779 + 0.1999389976263046 + <_> + + <_> + + + + <_>4 15 6 9 -1. + <_>4 18 6 3 3. + 0 + -0.0217409990727901 + -0.8524789810180664 + 0.0491699986159801 + <_> + + <_> + + + + <_>15 1 6 23 -1. + <_>17 1 2 23 3. + 0 + -0.0178699996322393 + -0.0599859990179539 + 0.1522250026464462 + <_> + + <_> + + + + <_>0 21 24 3 -1. + <_>8 21 8 3 3. + 0 + -0.0248310007154942 + 0.3560340106487274 + -0.2625989913940430 + <_> + + <_> + + + + <_>0 20 24 4 -1. + <_>8 20 8 4 3. + 0 + 0.1571550071239471 + 1.5599999460391700e-004 + 1.0428730249404907 + <_> + + <_> + + + + <_>3 1 6 23 -1. + <_>5 1 2 23 3. + 0 + 0.0690269991755486 + -0.0330069996416569 + -1.1796669960021973 + <_> + + <_> + + + + <_>3 17 18 3 -1. + <_>3 18 18 1 3. + 0 + -0.0110219996422529 + 0.5898770093917847 + -0.0576479993760586 + <_> + + <_> + + + + <_>0 16 18 3 -1. + <_>0 17 18 1 3. + 0 + -0.0138349998742342 + 0.5950279831886292 + -0.2441859990358353 + <_> + + <_> + + + + <_>1 16 22 4 -1. + <_>12 16 11 2 2. + <_>1 18 11 2 2. + 0 + -0.0309410002082586 + -1.1723799705505371 + 0.1690700054168701 + <_> + + <_> + + + + <_>0 16 9 6 -1. + <_>0 18 9 2 3. + 0 + 0.0212580002844334 + -0.0189009997993708 + -1.0684759616851807 + <_> + + <_> + + + + <_>2 10 21 3 -1. + <_>9 10 7 3 3. + 0 + 0.0930799990892410 + 0.1630560010671616 + -1.3375270366668701 + <_> + + <_> + + + + <_>2 18 12 6 -1. + <_>2 18 6 3 2. + <_>8 21 6 3 2. + 0 + 0.0296359993517399 + -0.2252479940652847 + 0.4540010094642639 + <_> + + <_> + + + + <_>0 5 24 4 -1. + <_>0 7 24 2 2. + 0 + -1.2199999764561653e-004 + 0.2740910053253174 + -0.3737139999866486 + <_> + + <_> + + + + <_>10 2 4 15 -1. + <_>10 7 4 5 3. + 0 + -0.0420980006456375 + -0.7582880258560181 + 0.0171370003372431 + <_> + + <_> + + + + <_>10 7 6 12 -1. + <_>10 13 6 6 2. + 0 + -0.0225050002336502 + -0.2275930047035217 + 0.2369869947433472 + <_> + + <_> + + + + <_>6 6 6 9 -1. + <_>8 6 2 9 3. + 0 + -0.0128629999235272 + 0.1925240010023117 + -0.3212710022926331 + <_> + + <_> + + + + <_>11 0 6 9 -1. + <_>13 0 2 9 3. + 0 + 0.0278600007295609 + 0.1672369986772537 + -1.0209059715270996 + <_> + + <_> + + + + <_>9 7 6 9 -1. + <_>11 7 2 9 3. + 0 + -0.0278079994022846 + 1.2824759483337402 + -0.1722529977560043 + <_> + + <_> + + + + <_>2 1 20 3 -1. + <_>2 2 20 1 3. + 0 + -6.1630001291632652e-003 + -0.5407289862632752 + 0.2388570010662079 + <_> + + <_> + + + + <_>1 18 12 6 -1. + <_>1 18 6 3 2. + <_>7 21 6 3 2. + 0 + -0.0204360000789166 + 0.6335539817810059 + -0.2109059989452362 + <_> + + <_> + + + + <_>13 2 4 13 -1. + <_>13 2 2 13 2. + 0 + -0.0123079996556044 + -0.4977819919586182 + 0.1740259975194931 + <_> + + <_> + + + + <_>6 7 12 4 -1. + <_>12 7 6 4 2. + 0 + -0.0404939986765385 + -1.1848740577697754 + -0.0338909998536110 + <_> + + <_> + + + + <_>10 1 4 13 -1. + <_>10 1 2 13 2. + 0 + 0.0296570006757975 + 0.0217409990727901 + 1.0069919824600220 + <_> + + <_> + + + + <_>6 0 3 18 -1. + <_>7 0 1 18 3. + 0 + 6.8379999138414860e-003 + 0.0292179994285107 + -0.5990629792213440 + <_> + + <_> + + + + <_>14 3 10 5 -1. + <_>14 3 5 5 2. + 0 + 0.0161649994552135 + -0.2100079953670502 + 0.3763729929924011 + <_> + + <_> + + + + <_>6 15 12 8 -1. + <_>10 15 4 8 3. + 0 + 0.0501930005848408 + 2.5319999549537897e-003 + -0.7166820168495178 + <_> + + <_> + + + + <_>9 10 6 9 -1. + <_>11 10 2 9 3. + 0 + 1.9680000841617584e-003 + -0.2192140072584152 + 0.3229869902133942 + <_> + + <_> + + + + <_>8 3 4 9 -1. + <_>10 3 2 9 2. + 0 + 0.0249799992889166 + -9.6840001642704010e-003 + -0.7757290005683899 + <_> + + <_> + + + + <_>17 0 6 14 -1. + <_>20 0 3 7 2. + <_>17 7 3 7 2. + 0 + -0.0158099997788668 + 0.4463750123977661 + -0.0617600008845329 + <_> + + <_> + + + + <_>1 0 6 14 -1. + <_>1 0 3 7 2. + <_>4 7 3 7 2. + 0 + 0.0372069999575615 + -0.2049539983272553 + 0.5772219896316528 + <_> + + <_> + + + + <_>14 0 6 16 -1. + <_>17 0 3 8 2. + <_>14 8 3 8 2. + 0 + -0.0792649984359741 + -0.7674540281295776 + 0.1255040019750595 + <_> + + <_> + + + + <_>7 4 4 10 -1. + <_>9 4 2 10 2. + 0 + -0.0171520002186298 + -1.4121830463409424 + -0.0517040006816387 + <_> + + <_> + + + + <_>3 17 18 6 -1. + <_>12 17 9 3 2. + <_>3 20 9 3 2. + 0 + 0.0327400006353855 + 0.1933400034904480 + -0.6363369822502136 + <_> + + <_> + + + + <_>1 20 22 4 -1. + <_>12 20 11 4 2. + 0 + -0.1175699979066849 + 0.8432540297508240 + -0.1801860034465790 + <_> + + <_> + + + + <_>14 3 10 5 -1. + <_>14 3 5 5 2. + 0 + 0.1205720007419586 + 0.1253000050783157 + -2.1213600635528564 + <_> + + <_> + + + + <_>0 3 10 5 -1. + <_>5 3 5 5 2. + 0 + 4.2779999785125256e-003 + -0.4660440087318420 + 0.0896439999341965 + <_> + + <_> + + + + <_>12 6 12 16 -1. + <_>16 6 4 16 3. + 0 + -0.0725449994206429 + 0.5182650089263916 + 0.0168239995837212 + <_> + + <_> + + + + <_>0 6 12 16 -1. + <_>4 6 4 16 3. + 0 + 0.1771059930324554 + -0.0309100002050400 + -1.1046639680862427 + <_> + + <_> + + + + <_>10 9 5 15 -1. + <_>10 14 5 5 3. + 0 + 8.4229996427893639e-003 + 0.2444580048322678 + -0.3861309885978699 + <_> + + <_> + + + + <_>1 18 21 2 -1. + <_>1 19 21 1 2. + 0 + -0.0130350003018975 + 0.9800440073013306 + -0.1701650023460388 + <_> + + <_> + + + + <_>15 0 9 6 -1. + <_>15 2 9 2 3. + 0 + 0.0189120005816221 + 0.2024849951267242 + -0.3854590058326721 + <_> + + <_> + + + + <_>6 1 12 4 -1. + <_>12 1 6 4 2. + 0 + 0.0214479994028807 + -0.2571719884872437 + 0.3518120050430298 + <_> + + <_> + + + + <_>6 0 12 12 -1. + <_>12 0 6 6 2. + <_>6 6 6 6 2. + 0 + 0.0633570030331612 + 0.1699479967355728 + -0.9138380289077759 + <_> + + <_> + + + + <_>8 10 8 12 -1. + <_>8 10 4 6 2. + <_>12 16 4 6 2. + 0 + -0.0324359983205795 + -0.8568159937858582 + -0.0216809995472431 + <_> + + <_> + + + + <_>14 16 10 8 -1. + <_>19 16 5 4 2. + <_>14 20 5 4 2. + 0 + -0.0235649999231100 + 0.5611559748649597 + -2.2400000307243317e-004 + <_> + + <_> + + + + <_>0 16 10 8 -1. + <_>0 16 5 4 2. + <_>5 20 5 4 2. + 0 + 0.0187890008091927 + -0.2545979917049408 + 0.3451290130615234 + <_> + + <_> + + + + <_>10 12 12 5 -1. + <_>14 12 4 5 3. + 0 + 0.0310420002788305 + 7.5719999149441719e-003 + 0.3480019867420197 + <_> + + <_> + + + + <_>6 16 10 8 -1. + <_>6 16 5 4 2. + <_>11 20 5 4 2. + 0 + -0.0112269995734096 + -0.6021980047225952 + 0.0428149998188019 + <_> + + <_> + + + + <_>7 6 12 6 -1. + <_>13 6 6 3 2. + <_>7 9 6 3 2. + 0 + -0.0128459995612502 + 0.4202040135860443 + -0.0538010001182556 + <_> + + <_> + + + + <_>9 6 4 18 -1. + <_>9 6 2 9 2. + <_>11 15 2 9 2. + 0 + -0.0127919996157289 + 0.2272450029850006 + -0.3239800035953522 + <_> + + <_> + + + + <_>10 9 6 14 -1. + <_>13 9 3 7 2. + <_>10 16 3 7 2. + 0 + 0.0686519965529442 + 0.0935320034623146 + 10. + <_> + + <_> + + + + <_>8 9 6 14 -1. + <_>8 9 3 7 2. + <_>11 16 3 7 2. + 0 + 5.2789999172091484e-003 + -0.2692629992961884 + 0.3330320119857788 + <_> + + <_> + + + + <_>7 4 11 12 -1. + <_>7 10 11 6 2. + 0 + -0.0387790016829968 + -0.7236530184745789 + 0.1780650019645691 + <_> + + <_> + + + + <_>4 8 6 16 -1. + <_>4 8 3 8 2. + <_>7 16 3 8 2. + 0 + 6.1820000410079956e-003 + -0.3511939942836762 + 0.1658630073070526 + <_> + + <_> + + + + <_>17 3 4 21 -1. + <_>17 10 4 7 3. + 0 + 0.1751520037651062 + 0.1162310019135475 + -1.5419290065765381 + <_> + + <_> + + + + <_>3 3 4 21 -1. + <_>3 10 4 7 3. + 0 + 0.1162799969315529 + -9.1479998081922531e-003 + -0.9984260201454163 + <_> + + <_> + + + + <_>10 1 8 18 -1. + <_>14 1 4 9 2. + <_>10 10 4 9 2. + 0 + -0.0229640007019043 + 0.2056539952754974 + 0.0154320001602173 + <_> + + <_> + + + + <_>2 5 16 8 -1. + <_>2 5 8 4 2. + <_>10 9 8 4 2. + 0 + -0.0514100007712841 + 0.5807240009307861 + -0.2011840045452118 + <_> + + <_> + + + + <_>3 6 18 12 -1. + <_>3 10 18 4 3. + 0 + 0.2247419953346252 + 0.0187289994210005 + 1.0829299688339233 + <_> + + <_> + + + + <_>4 10 16 12 -1. + <_>4 14 16 4 3. + 0 + 9.4860000535845757e-003 + -0.3317129909992218 + 0.1990299969911575 + <_> + + <_> + + + + <_>15 4 8 20 -1. + <_>19 4 4 10 2. + <_>15 14 4 10 2. + 0 + -0.1184630021452904 + 1.3711010217666626 + 0.0689269974827766 + <_> + + <_> + + + + <_>7 2 9 6 -1. + <_>10 2 3 6 3. + 0 + 0.0378109999001026 + -9.3600002583116293e-004 + -0.8399699926376343 + <_> + + <_> + + + + <_>15 4 8 20 -1. + <_>19 4 4 10 2. + <_>15 14 4 10 2. + 0 + 0.0222020000219345 + -0.0119639998301864 + 0.3667399883270264 + <_> + + <_> + + + + <_>1 4 8 20 -1. + <_>1 4 4 10 2. + <_>5 14 4 10 2. + 0 + -0.0363660007715225 + 0.3786650002002716 + -0.2771480083465576 + <_> + + <_> + + + + <_>11 8 8 14 -1. + <_>15 8 4 7 2. + <_>11 15 4 7 2. + 0 + -0.1318469941616058 + -2.7481179237365723 + 0.1066690012812614 + <_> + + <_> + + + + <_>5 8 8 14 -1. + <_>5 8 4 7 2. + <_>9 15 4 7 2. + 0 + -0.0416559986770153 + 0.4752430021762848 + -0.2324980050325394 + <_> + + <_> + + + + <_>10 13 5 8 -1. + <_>10 17 5 4 2. + 0 + -0.0331519991159439 + -0.5792940258979797 + 0.1743440032005310 + <_> + + <_> + + + + <_>4 13 7 9 -1. + <_>4 16 7 3 3. + 0 + 0.0157699994742870 + -0.0112840002402663 + -0.8370140194892883 + <_> + + <_> + + + + <_>0 13 24 10 -1. + <_>0 18 24 5 2. + 0 + -0.0393630005419254 + 0.3482159972190857 + -0.1745540052652359 + <_> + + <_> + + + + <_>4 2 8 11 -1. + <_>8 2 4 11 2. + 0 + -0.0678490027785301 + 1.4225699901580811 + -0.1476559937000275 + <_> + + <_> + + + + <_>10 2 8 16 -1. + <_>14 2 4 8 2. + <_>10 10 4 8 2. + 0 + -0.0267750006169081 + 0.2394700050354004 + 0.0132719995453954 + <_> + + <_> + + + + <_>0 2 24 6 -1. + <_>0 2 12 3 2. + <_>12 5 12 3 2. + 0 + 0.0399190001189709 + -8.9999996125698090e-003 + -0.7593889832496643 + <_> + + <_> + + + + <_>6 0 12 9 -1. + <_>6 3 12 3 3. + 0 + 0.1006560027599335 + -0.0186850000172853 + 0.7624530196189880 + <_> + + <_> + + + + <_>1 2 12 12 -1. + <_>1 2 6 6 2. + <_>7 8 6 6 2. + 0 + -0.0810220018029213 + -0.9043909907341003 + -8.5880002006888390e-003 + <_> + + <_> + + + + <_>18 5 6 9 -1. + <_>18 8 6 3 3. + 0 + -0.0212580002844334 + -0.2131959944963455 + 0.2191970050334930 + <_> + + <_> + + + + <_>4 3 8 10 -1. + <_>4 3 4 5 2. + <_>8 8 4 5 2. + 0 + -0.0106309996917844 + 0.1959809958934784 + -0.3576810061931610 + <_> + + <_> + + + + <_>6 21 18 3 -1. + <_>6 22 18 1 3. + 0 + 8.1300002057105303e-004 + -0.0927949994802475 + 0.2614589929580689 + <_> + + <_> + + + + <_>1 10 18 2 -1. + <_>1 11 18 1 2. + 0 + 3.4650000743567944e-003 + -0.5533609986305237 + 0.0273860003799200 + <_> + + <_> + + + + <_>1 10 22 3 -1. + <_>1 11 22 1 3. + 0 + 0.0188359990715981 + 0.1844609975814819 + -0.6693429946899414 + <_> + + <_> + + + + <_>2 8 12 9 -1. + <_>2 11 12 3 3. + 0 + -0.0256319995969534 + 1.9382879734039307 + -0.1470890045166016 + <_> + + <_> + + + + <_>12 8 12 6 -1. + <_>18 8 6 3 2. + <_>12 11 6 3 2. + 0 + -4.0939999744296074e-003 + -0.2645159959793091 + 0.2073320001363754 + <_> + + <_> + + + + <_>0 8 12 6 -1. + <_>0 8 6 3 2. + <_>6 11 6 3 2. + 0 + -8.9199998183175921e-004 + -0.5503159761428833 + 0.0503749996423721 + <_> + + <_> + + + + <_>10 15 6 9 -1. + <_>12 15 2 9 3. + 0 + -0.0495180003345013 + -2.5615389347076416 + 0.1314170062541962 + <_> + + <_> + + + + <_>7 13 9 6 -1. + <_>7 15 9 2 3. + 0 + 0.0116809997707605 + -0.2481980025768280 + 0.3998270034790039 + <_> + + <_> + + + + <_>9 8 7 12 -1. + <_>9 14 7 6 2. + 0 + 0.0345639996230602 + 0.1617880016565323 + -0.7141889929771423 + <_> + + <_> + + + + <_>4 13 9 6 -1. + <_>7 13 3 6 3. + 0 + -8.2909995689988136e-003 + 0.2218009978532791 + -0.2918170094490051 + <_> + + <_> + + + + <_>6 15 18 4 -1. + <_>12 15 6 4 3. + 0 + -0.0223580002784729 + 0.3104409873485565 + -2.7280000504106283e-003 + <_> + + <_> + + + + <_>5 4 4 16 -1. + <_>7 4 2 16 2. + 0 + -0.0308010000735521 + -0.9567270278930664 + -8.3400001749396324e-003 + <_> + + <_> + + + + <_>10 15 6 9 -1. + <_>12 15 2 9 3. + 0 + 0.0437790006399155 + 0.1255690008401871 + -1.1759619712829590 + <_> + + <_> + + + + <_>8 15 6 9 -1. + <_>10 15 2 9 3. + 0 + 0.0430460013449192 + -0.0588769987225533 + -1.8568470478057861 + <_> + + <_> + + + + <_>9 11 12 10 -1. + <_>15 11 6 5 2. + <_>9 16 6 5 2. + 0 + 0.0271889995783567 + 0.0428580008447170 + 0.3903670012950897 + <_> + + <_> + + + + <_>3 6 14 6 -1. + <_>3 8 14 2 3. + 0 + 9.4149997457861900e-003 + -0.0435670018196106 + -1.1094470024108887 + <_> + + <_> + + + + <_>4 2 17 8 -1. + <_>4 6 17 4 2. + 0 + 0.0943119972944260 + 0.0402569994330406 + 0.9844229817390442 + <_> + + <_> + + + + <_>6 2 12 21 -1. + <_>6 9 12 7 3. + 0 + 0.1702509969472885 + 0.0295100007206202 + -0.6950929760932922 + <_> + + <_> + + + + <_>8 1 9 9 -1. + <_>8 4 9 3 3. + 0 + -0.0471480004489422 + 1.0338569879531860 + 0.0676020011305809 + <_> + + <_> + + + + <_>0 7 24 3 -1. + <_>12 7 12 3 2. + 0 + 0.1118630021810532 + -0.0686829984188080 + -2.4985830783843994 + <_> + + <_> + + + + <_>11 6 9 10 -1. + <_>11 11 9 5 2. + 0 + -0.0143539998680353 + -0.5948190093040466 + 0.1500169932842255 + <_> + + <_> + + + + <_>2 11 18 3 -1. + <_>2 12 18 1 3. + 0 + 0.0340240001678467 + -0.0648230016231537 + -2.1382639408111572 + <_> + + <_> + + + + <_>8 16 9 4 -1. + <_>8 18 9 2 2. + 0 + 0.0216019991785288 + 0.0553099997341633 + 0.7829290032386780 + <_> + + <_> + + + + <_>0 0 9 6 -1. + <_>0 2 9 2 3. + 0 + 0.0217719990760088 + -7.1279997937381268e-003 + -0.7214810252189636 + <_> + + <_> + + + + <_>0 11 24 6 -1. + <_>0 13 24 2 3. + 0 + 0.0824169963598251 + 0.1460949927568436 + -1.3636670112609863 + <_> + + <_> + + + + <_>2 9 20 6 -1. + <_>2 12 20 3 2. + 0 + 0.0846719965338707 + -0.1778469979763031 + 0.7285770177841187 + <_> + + <_> + + + + <_>4 5 16 12 -1. + <_>12 5 8 6 2. + <_>4 11 8 6 2. + 0 + -0.0551280006766319 + -0.5940240025520325 + 0.1935780048370361 + <_> + + <_> + + + + <_>10 2 4 15 -1. + <_>10 7 4 5 3. + 0 + -0.0648230016231537 + -1.0783840417861938 + -0.0407340005040169 + <_> + + <_> + + + + <_>7 3 10 4 -1. + <_>7 5 10 2 2. + 0 + -0.0227690003812313 + 0.7790020108222961 + 3.4960000775754452e-003 + <_> + + <_> + + + + <_>9 15 6 8 -1. + <_>9 19 6 4 2. + 0 + 0.0547560006380081 + -0.0656839981675148 + -1.8188409805297852 + <_> + + <_> + + + + <_>17 0 7 10 -1. + <_>17 5 7 5 2. + 0 + -8.9000001025851816e-005 + -0.0178919993340969 + 0.2076829969882965 + <_> + + <_> + + + + <_>0 0 7 10 -1. + <_>0 5 7 5 2. + 0 + 0.0983619987964630 + -0.0559469982981682 + -1.4153920412063599 + <_> + + <_> + + + + <_>16 1 6 12 -1. + <_>19 1 3 6 2. + <_>16 7 3 6 2. + 0 + -7.0930002257227898e-003 + 0.3413529992103577 + -0.1208989992737770 + <_> + + <_> + + + + <_>1 0 19 8 -1. + <_>1 4 19 4 2. + 0 + 0.0502780005335808 + -0.2628670036792755 + 0.2579729855060577 + <_> + + <_> + + + + <_>12 2 9 4 -1. + <_>12 4 9 2 2. + 0 + -5.7870000600814819e-003 + -0.1317860037088394 + 0.1735019981861115 + <_> + + <_> + + + + <_>3 2 9 4 -1. + <_>3 4 9 2 2. + 0 + 0.0139739997684956 + 0.0285180006176233 + -0.6115220189094544 + <_> + + <_> + + + + <_>12 2 10 6 -1. + <_>12 4 10 2 3. + 0 + 0.0214499998837709 + 0.0261819995939732 + 0.3030659854412079 + <_> + + <_> + + + + <_>3 4 18 2 -1. + <_>12 4 9 2 2. + 0 + -0.0292140003293753 + 0.4494059979915619 + -0.2280309945344925 + <_> + + <_> + + + + <_>12 1 4 9 -1. + <_>12 1 2 9 2. + 0 + 4.8099999548867345e-004 + -0.1987999975681305 + 0.2074449956417084 + <_> + + <_> + + + + <_>8 1 4 9 -1. + <_>10 1 2 9 2. + 0 + 1.7109999898821115e-003 + -0.5403720140457153 + 0.0678659975528717 + <_> + + <_> + + + + <_>10 5 8 10 -1. + <_>14 5 4 5 2. + <_>10 10 4 5 2. + 0 + 8.6660003289580345e-003 + -0.0131280003115535 + 0.5229790210723877 + <_> + + <_> + + + + <_>6 4 12 13 -1. + <_>10 4 4 13 3. + 0 + 0.0636579990386963 + 0.0682990029454231 + -0.4923509955406189 + <_> + + <_> + + + + <_>13 5 6 6 -1. + <_>13 5 3 6 2. + 0 + -0.0279680006206036 + 0.6818389892578125 + 0.0787810012698174 + <_> + + <_> + + + + <_>1 5 12 3 -1. + <_>7 5 6 3 2. + 0 + 0.0489539988338947 + -0.2062239944934845 + 0.5038809776306152 + -3.3933560848236084 + 16 + -1 + <_> + + + <_> + + <_> + + + + <_>7 5 10 6 -1. + <_>7 7 10 2 3. + 0 + -0.0293129999190569 + 0.7128469944000244 + -0.5823069810867310 + <_> + + <_> + + + + <_>2 0 21 5 -1. + <_>9 0 7 5 3. + 0 + 0.1241509988903999 + -0.3686349987983704 + 0.6006720066070557 + <_> + + <_> + + + + <_>0 8 9 9 -1. + <_>0 11 9 3 3. + 0 + 7.9349996522068977e-003 + -0.8600829839706421 + 0.2172469943761826 + <_> + + <_> + + + + <_>9 6 6 9 -1. + <_>11 6 2 9 3. + 0 + 0.0303659997880459 + -0.2718699872493744 + 0.6124789714813232 + <_> + + <_> + + + + <_>0 3 6 7 -1. + <_>3 3 3 7 2. + 0 + 0.0252180006355047 + -0.3474830090999603 + 0.5042769908905029 + <_> + + <_> + + + + <_>9 18 12 6 -1. + <_>15 18 6 3 2. + <_>9 21 6 3 2. + 0 + 0.0100140003487468 + -0.3189899921417236 + 0.4137679934501648 + <_> + + <_> + + + + <_>2 8 20 6 -1. + <_>2 8 10 3 2. + <_>12 11 10 3 2. + 0 + -0.0167750008404255 + -0.6904810070991516 + 0.0948309972882271 + <_> + + <_> + + + + <_>13 2 10 4 -1. + <_>13 4 10 2 2. + 0 + -2.6950000319629908e-003 + -0.2082979977130890 + 0.2373719960451126 + <_> + + <_> + + + + <_>4 5 5 18 -1. + <_>4 11 5 6 3. + 0 + 0.0422579981386662 + -0.4936670064926148 + 0.1817059963941574 + <_> + + <_> + + + + <_>20 4 4 9 -1. + <_>20 4 2 9 2. + 0 + -0.0485050007700920 + 1.3429640531539917 + 0.0397690013051033 + <_> + + <_> + + + + <_>8 6 8 14 -1. + <_>8 13 8 7 2. + 0 + 0.0289929993450642 + 0.0464960001409054 + -0.8164349794387817 + <_> + + <_> + + + + <_>0 1 24 6 -1. + <_>12 1 12 3 2. + <_>0 4 12 3 2. + 0 + -0.0400890000164509 + -0.7119780182838440 + 0.2255389988422394 + <_> + + <_> + + + + <_>0 4 4 9 -1. + <_>2 4 2 9 2. + 0 + -0.0410219989717007 + 1.0057929754257202 + -0.1969020068645477 + <_> + + <_> + + + + <_>3 6 18 3 -1. + <_>3 7 18 1 3. + 0 + 0.0118380002677441 + -0.0126000000163913 + 0.8076710104942322 + <_> + + <_> + + + + <_>3 17 16 6 -1. + <_>3 19 16 2 3. + 0 + -0.0213280003517866 + -0.8202390074729919 + 0.0205249991267920 + <_> + + <_> + + + + <_>13 6 6 9 -1. + <_>13 9 6 3 3. + 0 + -0.0239049997180700 + 0.5421050190925598 + -0.0747670009732246 + <_> + + <_> + + + + <_>5 6 14 6 -1. + <_>5 6 7 3 2. + <_>12 9 7 3 2. + 0 + 0.0180089995265007 + -0.3382770121097565 + 0.4235860109329224 + <_> + + <_> + + + + <_>13 5 8 10 -1. + <_>17 5 4 5 2. + <_>13 10 4 5 2. + 0 + -0.0436140000820160 + -1.1983489990234375 + 0.1556620001792908 + <_> + + <_> + + + + <_>2 2 20 3 -1. + <_>2 3 20 1 3. + 0 + -9.2449998483061790e-003 + -0.8902999758720398 + 0.0110039999708533 + <_> + + <_> + + + + <_>9 2 9 6 -1. + <_>12 2 3 6 3. + 0 + 0.0474850013852119 + 0.1666409969329834 + -0.9076449871063232 + <_> + + <_> + + + + <_>8 6 6 9 -1. + <_>10 6 2 9 3. + 0 + -0.0142339998856187 + 0.6269519925117493 + -0.2579120099544525 + <_> + + <_> + + + + <_>12 3 4 11 -1. + <_>12 3 2 11 2. + 0 + 3.8010000716894865e-003 + -0.2822999954223633 + 0.2662459909915924 + <_> + + <_> + + + + <_>8 3 4 11 -1. + <_>10 3 2 11 2. + 0 + 3.4330000635236502e-003 + -0.6377199888229370 + 0.0984229966998100 + <_> + + <_> + + + + <_>8 3 8 10 -1. + <_>12 3 4 5 2. + <_>8 8 4 5 2. + 0 + -0.0292210001498461 + -0.7676990032196045 + 0.2263450026512146 + <_> + + <_> + + + + <_>11 1 2 18 -1. + <_>12 1 1 18 2. + 0 + -6.4949998632073402e-003 + 0.4560010135173798 + -0.2652890086174011 + <_> + + <_> + + + + <_>9 2 9 6 -1. + <_>12 2 3 6 3. + 0 + -0.0300340000540018 + -0.7655109763145447 + 0.1400929987430573 + <_> + + <_> + + + + <_>0 2 19 3 -1. + <_>0 3 19 1 3. + 0 + 7.8360000625252724e-003 + 0.0467559993267059 + -0.7235620021820068 + <_> + + <_> + + + + <_>9 14 9 6 -1. + <_>9 16 9 2 3. + 0 + 8.8550001382827759e-003 + -0.0491419993340969 + 0.5147269964218140 + <_> + + <_> + + + + <_>1 8 18 5 -1. + <_>7 8 6 5 3. + 0 + 0.0959739983081818 + -0.0200689993798733 + -1.0850950479507446 + <_> + + <_> + + + + <_>12 0 6 9 -1. + <_>14 0 2 9 3. + 0 + -0.0328769981861115 + -0.9587529897689819 + 0.1454360038042069 + <_> + + <_> + + + + <_>6 0 6 9 -1. + <_>8 0 2 9 3. + 0 + -0.0133840003982186 + -0.7001360058784485 + 0.0291579999029636 + <_> + + <_> + + + + <_>13 6 4 15 -1. + <_>13 11 4 5 3. + 0 + 0.0152359995990992 + -0.2823570072650909 + 0.2536799907684326 + <_> + + <_> + + + + <_>1 5 18 3 -1. + <_>1 6 18 1 3. + 0 + 0.0120540000498295 + -0.2530339956283569 + 0.4652670025825501 + <_> + + <_> + + + + <_>9 7 14 6 -1. + <_>9 9 14 2 3. + 0 + -0.0762950032949448 + -0.6991580128669739 + 0.1321720033884049 + <_> + + <_> + + + + <_>2 16 18 3 -1. + <_>2 17 18 1 3. + 0 + -0.0120400004088879 + 0.4589459896087647 + -0.2385649979114533 + <_> + + <_> + + + + <_>15 17 9 6 -1. + <_>15 19 9 2 3. + 0 + 0.0219160001724958 + 0.1826860010623932 + -0.6162970066070557 + <_> + + <_> + + + + <_>0 8 12 6 -1. + <_>0 8 6 3 2. + <_>6 11 6 3 2. + 0 + -2.7330000884830952e-003 + -0.6325790286064148 + 0.0342190004885197 + <_> + + <_> + + + + <_>9 13 7 8 -1. + <_>9 17 7 4 2. + 0 + -0.0486520007252693 + -1.0297729969024658 + 0.1738650053739548 + <_> + + <_> + + + + <_>2 17 20 3 -1. + <_>2 18 20 1 3. + 0 + -0.0104639995843172 + 0.3475730121135712 + -0.2746410071849823 + <_> + + <_> + + + + <_>15 17 9 6 -1. + <_>15 19 9 2 3. + 0 + -6.6550001502037048e-003 + -0.2898029983043671 + 0.2403790056705475 + <_> + + <_> + + + + <_>4 0 15 4 -1. + <_>4 2 15 2 2. + 0 + 8.5469996556639671e-003 + -0.4434050023555756 + 0.1426739990711212 + <_> + + <_> + + + + <_>17 2 6 6 -1. + <_>17 5 6 3 2. + 0 + 0.0199139993637800 + 0.1774040013551712 + -0.2409629970788956 + <_> + + <_> + + + + <_>0 3 6 9 -1. + <_>0 6 6 3 3. + 0 + 0.0220129992812872 + -0.0108120003715158 + -0.9469079971313477 + <_> + + <_> + + + + <_>15 17 9 6 -1. + <_>15 19 9 2 3. + 0 + -0.0521790012717247 + 1.6547499895095825 + 0.0964870005846024 + <_> + + <_> + + + + <_>0 17 9 6 -1. + <_>0 19 9 2 3. + 0 + 0.0196989998221397 + -6.7560002207756042e-003 + -0.8631150126457214 + <_> + + <_> + + + + <_>9 18 12 6 -1. + <_>15 18 6 3 2. + <_>9 21 6 3 2. + 0 + 0.0230400003492832 + -2.3519999813288450e-003 + 0.3853130042552948 + <_> + + <_> + + + + <_>3 15 6 9 -1. + <_>3 18 6 3 3. + 0 + -0.0150380004197359 + -0.6190569996833801 + 0.0310779996216297 + <_> + + <_> + + + + <_>16 13 8 10 -1. + <_>20 13 4 5 2. + <_>16 18 4 5 2. + 0 + -0.0499560013413429 + 0.7065749764442444 + 0.0478809997439384 + <_> + + <_> + + + + <_>0 14 24 4 -1. + <_>8 14 8 4 3. + 0 + -0.0692699998617172 + 0.3921290040016174 + -0.2384800016880035 + <_> + + <_> + + + + <_>13 18 6 6 -1. + <_>13 18 3 6 2. + 0 + 4.7399997711181641e-003 + -0.0243090000003576 + 0.2538630068302155 + <_> + + <_> + + + + <_>0 13 8 10 -1. + <_>0 13 4 5 2. + <_>4 18 4 5 2. + 0 + -0.0339239984750748 + 0.4693039953708649 + -0.2332189977169037 + <_> + + <_> + + + + <_>0 14 24 6 -1. + <_>0 17 24 3 2. + 0 + -0.0162310004234314 + 0.3231920003890991 + -0.2054560035467148 + <_> + + <_> + + + + <_>5 2 12 8 -1. + <_>5 2 6 4 2. + <_>11 6 6 4 2. + 0 + -0.0501930005848408 + -1.2277870178222656 + -0.0407980009913445 + <_> + + <_> + + + + <_>8 9 9 6 -1. + <_>11 9 3 6 3. + 0 + 0.0569440014660358 + 0.0451840013265610 + 0.6019750237464905 + <_> + + <_> + + + + <_>4 3 16 4 -1. + <_>4 5 16 2 2. + 0 + 0.0409369990229607 + -0.1677280068397522 + 0.8981930017471314 + <_> + + <_> + + + + <_>10 2 4 10 -1. + <_>10 7 4 5 2. + 0 + -3.0839999672025442e-003 + 0.3371619880199432 + -0.2724080085754395 + <_> + + <_> + + + + <_>8 4 5 8 -1. + <_>8 8 5 4 2. + 0 + -0.0326000005006790 + -0.8544650077819824 + 0.0196649990975857 + <_> + + <_> + + + + <_>11 5 9 12 -1. + <_>11 9 9 4 3. + 0 + 0.0984809994697571 + 0.0547420009970665 + 0.6382730007171631 + <_> + + <_> + + + + <_>4 5 9 12 -1. + <_>4 9 9 4 3. + 0 + -0.0381850004196167 + 0.5227469801902771 + -0.2338480055332184 + <_> + + <_> + + + + <_>14 6 6 9 -1. + <_>14 9 6 3 3. + 0 + -0.0459170006215572 + 0.6282920241355896 + 0.0328590013086796 + <_> + + <_> + + + + <_>2 4 20 12 -1. + <_>2 8 20 4 3. + 0 + -0.1195549964904785 + -0.6157270073890686 + 0.0346800014376640 + <_> + + <_> + + + + <_>4 4 17 16 -1. + <_>4 12 17 8 2. + 0 + -0.1204439997673035 + -0.8438000082969666 + 0.1653070002794266 + <_> + + <_> + + + + <_>8 7 7 6 -1. + <_>8 10 7 3 2. + 0 + 0.0706190019845963 + -0.0632610023021698 + -1.9863929748535156 + <_> + + <_> + + + + <_>1 9 23 2 -1. + <_>1 10 23 1 2. + 0 + 8.4889996796846390e-003 + -0.1766339987516403 + 0.3801119923591614 + <_> + + <_> + + + + <_>7 0 6 9 -1. + <_>9 0 2 9 3. + 0 + 0.0227109994739294 + -0.0276059992611408 + -0.9192140102386475 + <_> + + <_> + + + + <_>13 3 4 9 -1. + <_>13 3 2 9 2. + 0 + 4.9700000090524554e-004 + -0.2429320067167282 + 0.2287890017032623 + <_> + + <_> + + + + <_>8 1 6 13 -1. + <_>10 1 2 13 3. + 0 + 0.0346519984304905 + -0.2370599955320358 + 0.5401099920272827 + <_> + + <_> + + + + <_>4 22 18 2 -1. + <_>4 23 18 1 2. + 0 + -4.4700000435113907e-003 + 0.3907899856567383 + -0.1269380003213882 + <_> + + <_> + + + + <_>3 10 9 6 -1. + <_>6 10 3 6 3. + 0 + 0.0236430000513792 + -0.2666369974613190 + 0.3231259882450104 + <_> + + <_> + + + + <_>14 0 2 24 -1. + <_>14 0 1 24 2. + 0 + 0.0128130000084639 + 0.1754080057144165 + -0.6078799962997437 + <_> + + <_> + + + + <_>8 0 2 24 -1. + <_>9 0 1 24 2. + 0 + -0.0112509997561574 + -1.0852589607238770 + -0.0280460007488728 + <_> + + <_> + + + + <_>3 2 18 10 -1. + <_>9 2 6 10 3. + 0 + -0.0415350012481213 + 0.7188739776611328 + 0.0279820002615452 + <_> + + <_> + + + + <_>4 13 15 6 -1. + <_>9 13 5 6 3. + 0 + -0.0934709981083870 + -1.1906319856643677 + -0.0448109991848469 + <_> + + <_> + + + + <_>3 21 18 3 -1. + <_>9 21 6 3 3. + 0 + -0.0272499993443489 + 0.6294249892234802 + 9.5039997249841690e-003 + <_> + + <_> + + + + <_>9 1 4 11 -1. + <_>11 1 2 11 2. + 0 + -0.0217599999159575 + 1.3233649730682373 + -0.1502700001001358 + <_> + + <_> + + + + <_>9 7 10 4 -1. + <_>9 7 5 4 2. + 0 + -9.6890004351735115e-003 + -0.3394710123538971 + 0.1708579957485199 + <_> + + <_> + + + + <_>7 0 10 18 -1. + <_>12 0 5 18 2. + 0 + 0.0693959966301918 + -0.2565779983997345 + 0.4765209853649139 + <_> + + <_> + + + + <_>12 1 6 16 -1. + <_>14 1 2 16 3. + 0 + 0.0312089994549751 + 0.1415400058031082 + -0.3494200110435486 + <_> + + <_> + + + + <_>6 1 6 16 -1. + <_>8 1 2 16 3. + 0 + -0.0497270002961159 + -1.1675560474395752 + -0.0407579988241196 + <_> + + <_> + + + + <_>18 2 6 6 -1. + <_>18 5 6 3 2. + 0 + -0.0203019995242357 + -0.3948639929294586 + 0.1581490039825440 + <_> + + <_> + + + + <_>3 5 18 2 -1. + <_>3 6 18 1 2. + 0 + -0.0153670003637671 + 0.4930000007152557 + -0.2009209990501404 + <_> + + <_> + + + + <_>18 2 6 6 -1. + <_>18 5 6 3 2. + 0 + -0.0507350005209446 + 1.8736059665679932 + 0.0867300033569336 + <_> + + <_> + + + + <_>0 2 6 6 -1. + <_>0 5 6 3 2. + 0 + -0.0207260008901358 + -0.8893839716911316 + -7.3199998587369919e-003 + <_> + + <_> + + + + <_>13 11 11 6 -1. + <_>13 13 11 2 3. + 0 + -0.0309939999133348 + -1.1664899587631226 + 0.1427460014820099 + <_> + + <_> + + + + <_>5 7 10 4 -1. + <_>10 7 5 4 2. + 0 + -4.4269999489188194e-003 + -0.6681510210037231 + 4.4120000675320625e-003 + <_> + + <_> + + + + <_>11 9 10 7 -1. + <_>11 9 5 7 2. + 0 + -0.0457439981400967 + -0.4795520007610321 + 0.1512199938297272 + <_> + + <_> + + + + <_>3 9 10 7 -1. + <_>8 9 5 7 2. + 0 + 0.0166989993304014 + 0.1204859986901283 + -0.4523589909076691 + <_> + + <_> + + + + <_>16 4 6 6 -1. + <_>16 4 3 6 2. + 0 + 3.2210000790655613e-003 + -0.0776150003075600 + 0.2784659862518311 + <_> + + <_> + + + + <_>5 6 10 8 -1. + <_>5 6 5 4 2. + <_>10 10 5 4 2. + 0 + 0.0244340002536774 + -0.1998710036277771 + 0.6725370287895203 + <_> + + <_> + + + + <_>7 21 16 3 -1. + <_>7 21 8 3 2. + 0 + -0.0796779990196228 + 0.9222239851951599 + 0.0925579965114594 + <_> + + <_> + + + + <_>1 21 16 3 -1. + <_>9 21 8 3 2. + 0 + 0.0445300005376339 + -0.2669050097465515 + 0.3332050144672394 + <_> + + <_> + + + + <_>2 5 22 14 -1. + <_>13 5 11 7 2. + <_>2 12 11 7 2. + 0 + -0.1252830028533936 + -0.5425310134887695 + 0.1397629976272583 + <_> + + <_> + + + + <_>3 10 8 10 -1. + <_>3 10 4 5 2. + <_>7 15 4 5 2. + 0 + 0.0179719999432564 + 0.0182199999690056 + -0.6804850101470947 + <_> + + <_> + + + + <_>17 0 6 12 -1. + <_>20 0 3 6 2. + <_>17 6 3 6 2. + 0 + 0.0191840007901192 + -0.0125839998945594 + 0.5412669777870178 + <_> + + <_> + + + + <_>5 2 6 18 -1. + <_>7 2 2 18 3. + 0 + 0.0400240011513233 + -0.1763879954814911 + 0.7881039977073669 + <_> + + <_> + + + + <_>13 0 6 9 -1. + <_>15 0 2 9 3. + 0 + 0.0135589996352792 + 0.2073760032653809 + -0.4774430096149445 + <_> + + <_> + + + + <_>0 12 7 9 -1. + <_>0 15 7 3 3. + 0 + 0.0162209998816252 + 0.0230769999325275 + -0.6118209958076477 + <_> + + <_> + + + + <_>15 13 8 10 -1. + <_>19 13 4 5 2. + <_>15 18 4 5 2. + 0 + 0.0112290000542998 + -0.0177280008792877 + 0.4176419973373413 + <_> + + <_> + + + + <_>1 0 6 12 -1. + <_>1 0 3 6 2. + <_>4 6 3 6 2. + 0 + 0.0391930006444454 + -0.1894849985837936 + 0.7401930093765259 + <_> + + <_> + + + + <_>12 1 3 12 -1. + <_>12 7 3 6 2. + 0 + -9.5539996400475502e-003 + 0.4094710052013397 + -0.1350889950990677 + <_> + + <_> + + + + <_>1 13 8 10 -1. + <_>1 13 4 5 2. + <_>5 18 4 5 2. + 0 + 0.0278789997100830 + -0.2035070061683655 + 0.6162539720535278 + <_> + + <_> + + + + <_>3 21 19 2 -1. + <_>3 22 19 1 2. + 0 + -0.0236009992659092 + -1.6967060565948486 + 0.1463319957256317 + <_> + + <_> + + + + <_>6 3 4 13 -1. + <_>8 3 2 13 2. + 0 + 0.0269300006330013 + -0.0304019991308451 + -1.0909470319747925 + <_> + + <_> + + + + <_>5 10 18 3 -1. + <_>5 11 18 1 3. + 0 + 2.8999999631196260e-004 + -0.2007600069046021 + 0.2231409996747971 + <_> + + <_> + + + + <_>9 3 5 12 -1. + <_>9 7 5 4 3. + 0 + -0.0411249995231628 + -0.4524219930171967 + 0.0573920011520386 + <_> + + <_> + + + + <_>11 2 4 15 -1. + <_>11 7 4 5 3. + 0 + 6.6789998672902584e-003 + 0.2382490038871765 + -0.2126210033893585 + <_> + + <_> + + + + <_>4 1 16 4 -1. + <_>4 3 16 2 2. + 0 + 0.0478649996221066 + -0.1819480061531067 + 0.6191840171813965 + <_> + + <_> + + + + <_>6 0 18 3 -1. + <_>6 1 18 1 3. + 0 + -3.1679999083280563e-003 + -0.2739320099353790 + 0.2501730024814606 + <_> + + <_> + + + + <_>5 1 10 8 -1. + <_>5 1 5 4 2. + <_>10 5 5 4 2. + 0 + -8.6230002343654633e-003 + -0.4628030061721802 + 0.0423979982733727 + <_> + + <_> + + + + <_>11 18 12 6 -1. + <_>17 18 6 3 2. + <_>11 21 6 3 2. + 0 + -7.4350000359117985e-003 + 0.4179680049419403 + -1.7079999670386314e-003 + <_> + + <_> + + + + <_>5 15 12 3 -1. + <_>11 15 6 3 2. + 0 + -1.8769999733194709e-003 + 0.1460230052471161 + -0.3372110128402710 + <_> + + <_> + + + + <_>1 10 22 4 -1. + <_>1 10 11 4 2. + 0 + -0.0862260013818741 + 0.7514340281486511 + 0.0107119996100664 + <_> + + <_> + + + + <_>7 9 9 6 -1. + <_>10 9 3 6 3. + 0 + 0.0468339994549751 + -0.1911959946155548 + 0.4841490089893341 + <_> + + <_> + + + + <_>6 11 12 5 -1. + <_>10 11 4 5 3. + 0 + -9.2000002041459084e-005 + 0.3522039949893951 + -0.1733330041170120 + <_> + + <_> + + + + <_>6 7 10 7 -1. + <_>11 7 5 7 2. + 0 + -0.0163439996540546 + -0.6439769864082336 + 9.0680001303553581e-003 + <_> + + <_> + + + + <_>11 2 8 10 -1. + <_>11 2 4 10 2. + 0 + 0.0457039996981621 + 0.0182160008698702 + 0.3197079896926880 + <_> + + <_> + + + + <_>5 2 8 10 -1. + <_>9 2 4 10 2. + 0 + -0.0273829996585846 + 1.0564049482345581 + -0.1727640032768250 + <_> + + <_> + + + + <_>6 4 18 6 -1. + <_>15 4 9 3 2. + <_>6 7 9 3 2. + 0 + -0.0276020001620054 + 0.2971549928188324 + -9.4600003212690353e-003 + <_> + + <_> + + + + <_>0 5 10 9 -1. + <_>0 8 10 3 3. + 0 + 7.6939999125897884e-003 + -0.2166029959917069 + 0.4738520085811615 + <_> + + <_> + + + + <_>2 7 21 6 -1. + <_>2 9 21 2 3. + 0 + -7.0500001311302185e-004 + 0.2404879927635193 + -0.2677600085735321 + <_> + + <_> + + + + <_>0 4 22 16 -1. + <_>0 4 11 8 2. + <_>11 12 11 8 2. + 0 + 0.1105419993400574 + -0.0335390008985996 + -1.0233880281448364 + <_> + + <_> + + + + <_>9 0 6 22 -1. + <_>9 11 6 11 2. + 0 + 0.0687659978866577 + -4.3239998631179333e-003 + 0.5715339779853821 + <_> + + <_> + + + + <_>9 1 3 12 -1. + <_>9 7 3 6 2. + 0 + 1.7999999690800905e-003 + 0.0775749981403351 + -0.4209269881248474 + <_> + + <_> + + + + <_>12 0 12 18 -1. + <_>18 0 6 9 2. + <_>12 9 6 9 2. + 0 + 0.1923200041055679 + 0.0820219963788986 + 2.8810169696807861 + <_> + + <_> + + + + <_>0 0 12 18 -1. + <_>0 0 6 9 2. + <_>6 9 6 9 2. + 0 + 0.1574209928512573 + -0.1370819956064224 + 2.0890059471130371 + <_> + + <_> + + + + <_>1 1 22 4 -1. + <_>12 1 11 2 2. + <_>1 3 11 2 2. + 0 + -0.0493870005011559 + -1.8610910177230835 + 0.1433209925889969 + <_> + + <_> + + + + <_>3 0 18 4 -1. + <_>3 2 18 2 2. + 0 + 0.0519290007650852 + -0.1873700022697449 + 0.5423160195350647 + <_> + + <_> + + + + <_>2 5 22 6 -1. + <_>2 7 22 2 3. + 0 + 0.0499650016427040 + 0.1417530030012131 + -1.5625779628753662 + <_> + + <_> + + + + <_>5 0 6 9 -1. + <_>5 3 6 3 3. + 0 + -0.0426330007612705 + 1.6059479713439941 + -0.1471289992332459 + <_> + + <_> + + + + <_>10 14 6 9 -1. + <_>12 14 2 9 3. + 0 + -0.0375539995729923 + -0.8097490072250366 + 0.1325699985027313 + <_> + + <_> + + + + <_>8 14 6 9 -1. + <_>10 14 2 9 3. + 0 + -0.0371749997138977 + -1.3945020437240601 + -0.0570550002157688 + <_> + + <_> + + + + <_>5 18 18 3 -1. + <_>5 19 18 1 3. + 0 + 0.0139459995552897 + 0.0334270000457764 + 0.5747479796409607 + <_> + + <_> + + + + <_>6 0 6 13 -1. + <_>9 0 3 13 2. + 0 + -4.4800000614486635e-004 + -0.5532749891281128 + 0.0219529997557402 + <_> + + <_> + + + + <_>7 4 12 4 -1. + <_>7 4 6 4 2. + 0 + 0.0319930016994476 + 0.0203409995883703 + 0.3745920062065125 + <_> + + <_> + + + + <_>5 2 12 6 -1. + <_>9 2 4 6 3. + 0 + -4.2799999937415123e-003 + 0.4442870020866394 + -0.2299969941377640 + <_> + + <_> + + + + <_>4 1 18 3 -1. + <_>4 2 18 1 3. + 0 + 9.8550003021955490e-003 + 0.1831579953432083 + -0.4096499979496002 + <_> + + <_> + + + + <_>0 8 6 12 -1. + <_>0 12 6 4 3. + 0 + 0.0933569967746735 + -0.0636610016226768 + -1.6929290294647217 + <_> + + <_> + + + + <_>9 15 6 9 -1. + <_>11 15 2 9 3. + 0 + 0.0172099992632866 + 0.2015389949083328 + -0.4606109857559204 + <_> + + <_> + + + + <_>9 10 6 13 -1. + <_>11 10 2 13 3. + 0 + 8.4319999441504478e-003 + -0.3200399875640869 + 0.1531219929456711 + <_> + + <_> + + + + <_>6 17 18 2 -1. + <_>6 18 18 1 2. + 0 + -0.0140549996867776 + 0.8688240051269531 + 0.0325750000774860 + <_> + + <_> + + + + <_>9 4 6 9 -1. + <_>11 4 2 9 3. + 0 + -7.7180000953376293e-003 + 0.6368669867515564 + -0.1842550039291382 + <_> + + <_> + + + + <_>10 0 6 9 -1. + <_>12 0 2 9 3. + 0 + 0.0280050002038479 + 0.1735749989748001 + -0.4788359999656677 + <_> + + <_> + + + + <_>5 6 10 8 -1. + <_>5 6 5 4 2. + <_>10 10 5 4 2. + 0 + -0.0188849996775389 + 0.2410160005092621 + -0.2654759883880615 + <_> + + <_> + + + + <_>14 9 5 8 -1. + <_>14 13 5 4 2. + 0 + -0.0185850001871586 + 0.5423250198364258 + 0.0536330007016659 + <_> + + <_> + + + + <_>5 9 5 8 -1. + <_>5 13 5 4 2. + 0 + -0.0364370010793209 + 2.3908898830413818 + -0.1363469958305359 + <_> + + <_> + + + + <_>14 11 9 6 -1. + <_>14 13 9 2 3. + 0 + 0.0324550010263920 + 0.1591069996356964 + -0.6758149862289429 + <_> + + <_> + + + + <_>0 2 23 15 -1. + <_>0 7 23 5 3. + 0 + 0.0597819983959198 + -2.3479999508708715e-003 + -0.7305369973182678 + <_> + + <_> + + + + <_>16 0 8 12 -1. + <_>16 6 8 6 2. + 0 + 9.8209995776414871e-003 + -0.1144409999251366 + 0.3057030141353607 + <_> + + <_> + + + + <_>4 15 6 9 -1. + <_>4 18 6 3 3. + 0 + -0.0351639986038208 + -1.0511469841003418 + -0.0331030003726482 + <_> + + <_> + + + + <_>8 18 9 4 -1. + <_>8 20 9 2 2. + 0 + 2.7429999317973852e-003 + -0.2013539969921112 + 0.3275409936904907 + <_> + + <_> + + + + <_>0 17 18 3 -1. + <_>0 18 18 1 3. + 0 + 8.1059997901320457e-003 + -0.2138350009918213 + 0.4336209893226624 + <_> + + <_> + + + + <_>13 11 11 6 -1. + <_>13 13 11 2 3. + 0 + 0.0889429971575737 + 0.1094089969992638 + -4.7609338760375977 + <_> + + <_> + + + + <_>0 11 11 6 -1. + <_>0 13 11 2 3. + 0 + -0.0300549995154142 + -1.7169300317764282 + -0.0609190016984940 + <_> + + <_> + + + + <_>0 9 24 6 -1. + <_>12 9 12 3 2. + <_>0 12 12 3 2. + 0 + -0.0217349994927645 + 0.6477890014648438 + -0.0328309983015060 + <_> + + <_> + + + + <_>6 16 8 8 -1. + <_>6 20 8 4 2. + 0 + 0.0376489982008934 + -0.0100600002333522 + -0.7656909823417664 + <_> + + <_> + + + + <_>10 16 14 6 -1. + <_>10 18 14 2 3. + 0 + 2.7189999818801880e-003 + 0.1988890022039414 + -0.0824790000915527 + <_> + + <_> + + + + <_>1 1 21 3 -1. + <_>1 2 21 1 3. + 0 + -0.0105480002239347 + -0.8661360144615173 + -0.0259860008955002 + <_> + + <_> + + + + <_>0 2 24 3 -1. + <_>0 2 12 3 2. + 0 + 0.1296630054712296 + 0.1391199976205826 + -2.2271950244903564 + <_> + + <_> + + + + <_>2 15 8 5 -1. + <_>6 15 4 5 2. + 0 + -0.0176769997924566 + 0.3396770060062408 + -0.2398959994316101 + <_> + + <_> + + + + <_>2 11 21 3 -1. + <_>9 11 7 3 3. + 0 + -0.0770519971847534 + -2.5017969608306885 + 0.1284199953079224 + <_> + + <_> + + + + <_>1 18 12 6 -1. + <_>1 18 6 3 2. + <_>7 21 6 3 2. + 0 + -0.0192300006747246 + 0.5064120292663574 + -0.1975159943103790 + <_> + + <_> + + + + <_>10 14 4 10 -1. + <_>10 19 4 5 2. + 0 + -0.0512229986488819 + -2.9333369731903076 + 0.1385850012302399 + <_> + + <_> + + + + <_>7 7 4 10 -1. + <_>7 12 4 5 2. + 0 + 2.0830000285059214e-003 + -0.6004359722137451 + 0.0297180004417896 + <_> + + <_> + + + + <_>9 8 6 12 -1. + <_>9 12 6 4 3. + 0 + 0.0254180002957582 + 0.3391579985618591 + -0.1439200043678284 + <_> + + <_> + + + + <_>7 1 9 6 -1. + <_>10 1 3 6 3. + 0 + -0.0239059999585152 + -1.1082680225372314 + -0.0473770014941692 + <_> + + <_> + + + + <_>3 14 19 2 -1. + <_>3 15 19 1 2. + 0 + -6.3740001060068607e-003 + 0.4453369975090027 + -0.0670529976487160 + <_> + + <_> + + + + <_>7 7 10 10 -1. + <_>7 7 5 5 2. + <_>12 12 5 5 2. + 0 + -0.0376989990472794 + -1.0406579971313477 + -0.0417900010943413 + <_> + + <_> + + + + <_>3 12 18 12 -1. + <_>3 12 9 12 2. + 0 + 0.2165510058403015 + 0.0338630005717278 + 0.8201730251312256 + <_> + + <_> + + + + <_>8 0 6 12 -1. + <_>10 0 2 12 3. + 0 + -0.0134009998291731 + 0.5290349721908569 + -0.1913300007581711 + -3.2396929264068604 + 17 + -1 + <_> + + + <_> + + <_> + + + + <_>3 0 17 9 -1. + <_>3 3 17 3 3. + 0 + 0.0712689980864525 + -0.5363119840621948 + 0.6071529984474182 + <_> + + <_> + + + + <_>6 0 12 11 -1. + <_>10 0 4 11 3. + 0 + 0.0561110004782677 + -0.5014160275459290 + 0.4397610127925873 + <_> + + <_> + + + + <_>1 0 6 13 -1. + <_>4 0 3 13 2. + 0 + 0.0404639989137650 + -0.3292219936847687 + 0.5483469963073731 + <_> + + <_> + + + + <_>5 8 16 6 -1. + <_>5 11 16 3 2. + 0 + 0.0631550028920174 + -0.3170169889926910 + 0.4615299999713898 + <_> + + <_> + + + + <_>8 8 5 12 -1. + <_>8 14 5 6 2. + 0 + 0.0103209996595979 + 0.1069499999284744 + -0.9824389815330505 + <_> + + <_> + + + + <_>3 21 18 3 -1. + <_>9 21 6 3 3. + 0 + 0.0626069977879524 + -0.1432970017194748 + 0.7109500169754028 + <_> + + <_> + + + + <_>0 0 6 6 -1. + <_>3 0 3 6 2. + 0 + -0.0394160002470016 + 0.9438019990921021 + -0.2157209962606430 + <_> + + <_> + + + + <_>2 0 20 3 -1. + <_>2 1 20 1 3. + 0 + -5.3960001096129417e-003 + -0.5461199879646301 + 0.2530379891395569 + <_> + + <_> + + + + <_>4 6 15 10 -1. + <_>9 6 5 10 3. + 0 + 0.1077319979667664 + 0.0124960001558065 + -1.0809199810028076 + <_> + + <_> + + + + <_>9 6 6 9 -1. + <_>11 6 2 9 3. + 0 + 0.0169820003211498 + -0.3153640031814575 + 0.5123999714851379 + <_> + + <_> + + + + <_>9 0 6 9 -1. + <_>11 0 2 9 3. + 0 + 0.0312169995158911 + -4.5199999585747719e-003 + -1.2443480491638184 + <_> + + <_> + + + + <_>14 0 6 9 -1. + <_>16 0 2 9 3. + 0 + -0.0231069996953011 + -0.7649289965629578 + 0.2064059972763062 + <_> + + <_> + + + + <_>7 16 9 6 -1. + <_>7 18 9 2 3. + 0 + -0.0112039996311069 + 0.2409269958734512 + -0.3514209985733032 + <_> + + <_> + + + + <_>14 0 6 9 -1. + <_>16 0 2 9 3. + 0 + -4.7479998320341110e-003 + -0.0970079973340034 + 0.2063809931278229 + <_> + + <_> + + + + <_>4 0 6 9 -1. + <_>6 0 2 9 3. + 0 + -0.0173589996993542 + -0.7902029752731323 + 0.0218529999256134 + <_> + + <_> + + + + <_>17 1 6 16 -1. + <_>19 1 2 16 3. + 0 + 0.0188519991934299 + -0.1039460003376007 + 0.5484420061111450 + <_> + + <_> + + + + <_>1 1 6 16 -1. + <_>3 1 2 16 3. + 0 + 7.2249998338520527e-003 + -0.4040940105915070 + 0.2676379978656769 + <_> + + <_> + + + + <_>14 13 6 9 -1. + <_>14 16 6 3 3. + 0 + 0.0189159996807575 + 0.2050800025463104 + -1.0206340551376343 + <_> + + <_> + + + + <_>0 0 6 9 -1. + <_>0 3 6 3 3. + 0 + 0.0311569999903440 + 1.2400000123307109e-003 + -0.8729349970817566 + <_> + + <_> + + + + <_>9 5 6 6 -1. + <_>9 5 3 6 2. + 0 + 0.0209519993513823 + -5.5559999309480190e-003 + 0.8035619854927063 + <_> + + <_> + + + + <_>3 10 9 6 -1. + <_>6 10 3 6 3. + 0 + 0.0112910000607371 + -0.3647840023040772 + 0.2276789993047714 + <_> + + <_> + + + + <_>14 7 3 16 -1. + <_>14 15 3 8 2. + 0 + -0.0570110008120537 + -1.4295619726181030 + 0.1432200074195862 + <_> + + <_> + + + + <_>4 10 14 12 -1. + <_>4 10 7 6 2. + <_>11 16 7 6 2. + 0 + 0.0721940025687218 + -0.0418500006198883 + -1.9111829996109009 + <_> + + <_> + + + + <_>7 6 12 6 -1. + <_>7 8 12 2 3. + 0 + -0.0198740009218454 + 0.2642549872398377 + -0.3261770009994507 + <_> + + <_> + + + + <_>7 2 4 20 -1. + <_>9 2 2 20 2. + 0 + -0.0166929997503757 + -0.8390780091285706 + 4.0799999260343611e-004 + <_> + + <_> + + + + <_>14 13 6 9 -1. + <_>14 16 6 3 3. + 0 + -0.0398349985480309 + -0.4885849952697754 + 0.1643610000610352 + <_> + + <_> + + + + <_>10 6 4 9 -1. + <_>12 6 2 9 2. + 0 + 0.0270099993795156 + -0.1886249929666519 + 0.8341940045356751 + <_> + + <_> + + + + <_>14 13 6 9 -1. + <_>14 16 6 3 3. + 0 + -3.9420002140104771e-003 + 0.2323150038719177 + -0.0723600015044212 + <_> + + <_> + + + + <_>5 20 14 4 -1. + <_>5 22 14 2 2. + 0 + 0.0228330008685589 + -0.0358840003609657 + -1.1549400091171265 + <_> + + <_> + + + + <_>4 4 16 12 -1. + <_>4 10 16 6 2. + 0 + -0.0688880011439323 + -1.7837309837341309 + 0.1515900045633316 + <_> + + <_> + + + + <_>9 6 6 9 -1. + <_>11 6 2 9 3. + 0 + 0.0430970005691051 + -0.2160809934139252 + 0.5062410235404968 + <_> + + <_> + + + + <_>3 0 21 4 -1. + <_>3 2 21 2 2. + 0 + 8.6239995434880257e-003 + -0.1779559999704361 + 0.2895790040493012 + <_> + + <_> + + + + <_>4 13 6 9 -1. + <_>4 16 6 3 3. + 0 + 0.0145610002800822 + -0.0114080002531409 + -0.8940200209617615 + <_> + + <_> + + + + <_>16 16 5 8 -1. + <_>16 20 5 4 2. + 0 + -0.0115010002627969 + 0.3017199933528900 + -0.0436590015888214 + <_> + + <_> + + + + <_>4 0 16 16 -1. + <_>4 0 8 8 2. + <_>12 8 8 8 2. + 0 + -0.1097149997949600 + -0.9514709711074829 + -0.0199730005115271 + <_> + + <_> + + + + <_>6 6 14 6 -1. + <_>13 6 7 3 2. + <_>6 9 7 3 2. + 0 + 0.0452280007302761 + 0.0331109985709190 + 0.9661980271339417 + <_> + + <_> + + + + <_>10 5 4 15 -1. + <_>10 10 4 5 3. + 0 + -0.0270479992032051 + 0.9796360135078430 + -0.1726190000772476 + <_> + + <_> + + + + <_>9 15 12 8 -1. + <_>15 15 6 4 2. + <_>9 19 6 4 2. + 0 + 0.0180309992283583 + -0.0208010002970696 + 0.2738589942455292 + <_> + + <_> + + + + <_>6 7 12 4 -1. + <_>12 7 6 4 2. + 0 + 0.0505249984562397 + -0.0568029992282391 + -1.7775089740753174 + <_> + + <_> + + + + <_>5 6 14 6 -1. + <_>12 6 7 3 2. + <_>5 9 7 3 2. + 0 + -0.0299239996820688 + 0.6532920002937317 + -0.0235370006412268 + <_> + + <_> + + + + <_>3 6 18 10 -1. + <_>3 6 9 5 2. + <_>12 11 9 5 2. + 0 + 0.0380580015480518 + 0.0263170003890991 + -0.7066569924354553 + <_> + + <_> + + + + <_>6 0 18 21 -1. + <_>12 0 6 21 3. + 0 + 0.1856389939785004 + -5.6039998307824135e-003 + 0.3287369906902313 + <_> + + <_> + + + + <_>0 0 24 21 -1. + <_>8 0 8 21 3. + 0 + -4.0670000016689301e-003 + 0.3420479893684387 + -0.3017159998416901 + <_> + + <_> + + + + <_>6 18 18 3 -1. + <_>6 19 18 1 3. + 0 + 0.0101089999079704 + -7.3600001633167267e-003 + 0.5798159837722778 + <_> + + <_> + + + + <_>0 15 9 6 -1. + <_>0 17 9 2 3. + 0 + -0.0115670002996922 + -0.5272219777107239 + 0.0464479997754097 + <_> + + <_> + + + + <_>4 3 19 2 -1. + <_>4 4 19 1 2. + 0 + -6.5649999305605888e-003 + -0.5852910280227661 + 0.1910189986228943 + <_> + + <_> + + + + <_>0 3 24 2 -1. + <_>0 4 24 1 2. + 0 + 0.0105820000171661 + 0.0210730005055666 + -0.6889259815216065 + <_> + + <_> + + + + <_>15 14 9 4 -1. + <_>15 16 9 2 2. + 0 + -0.0203040000051260 + -0.3640069961547852 + 0.1533879935741425 + <_> + + <_> + + + + <_>0 14 9 4 -1. + <_>0 16 9 2 2. + 0 + 2.3529999889433384e-003 + 0.0361640006303787 + -0.5982509851455689 + <_> + + <_> + + + + <_>6 15 18 2 -1. + <_>6 16 18 1 2. + 0 + -1.4690000098198652e-003 + -0.1470769941806793 + 0.3750799894332886 + <_> + + <_> + + + + <_>3 17 18 3 -1. + <_>3 18 18 1 3. + 0 + 8.6449999362230301e-003 + -0.2170850038528442 + 0.5193679928779602 + <_> + + <_> + + + + <_>12 0 3 23 -1. + <_>13 0 1 23 3. + 0 + -0.0243260003626347 + -1.0846769809722900 + 0.1408479958772659 + <_> + + <_> + + + + <_>6 0 8 6 -1. + <_>6 3 8 3 2. + 0 + 0.0744189992547035 + -0.1551380008459091 + 1.1822769641876221 + <_> + + <_> + + + + <_>6 16 18 3 -1. + <_>6 17 18 1 3. + 0 + 0.0170779991894960 + 0.0442310012876987 + 0.9156110286712647 + <_> + + <_> + + + + <_>9 0 3 23 -1. + <_>10 0 1 23 3. + 0 + -0.0245779994875193 + -1.5504100322723389 + -0.0547459982335567 + <_> + + <_> + + + + <_>10 7 4 10 -1. + <_>10 12 4 5 2. + 0 + 0.0302050001919270 + 0.1666280031204224 + -1.0001239776611328 + <_> + + <_> + + + + <_>7 8 10 12 -1. + <_>7 12 10 4 3. + 0 + 0.0121360002085567 + -0.7707909941673279 + -4.8639997839927673e-003 + <_> + + <_> + + + + <_>14 9 6 14 -1. + <_>17 9 3 7 2. + <_>14 16 3 7 2. + 0 + 0.0867170020937920 + 0.1106169968843460 + -1.6857999563217163 + <_> + + <_> + + + + <_>2 0 10 9 -1. + <_>2 3 10 3 3. + 0 + -0.0423090010881424 + 1.1075930595397949 + -0.1543859988451004 + <_> + + <_> + + + + <_>11 1 5 12 -1. + <_>11 7 5 6 2. + 0 + -2.6420000940561295e-003 + 0.2745189964771271 + -0.1845619976520538 + <_> + + <_> + + + + <_>1 4 12 10 -1. + <_>1 4 6 5 2. + <_>7 9 6 5 2. + 0 + -0.0566620007157326 + -0.8062559962272644 + -0.0169280003756285 + <_> + + <_> + + + + <_>15 1 9 4 -1. + <_>15 3 9 2 2. + 0 + 0.0234750006347895 + 0.1418769955635071 + -0.2550089955329895 + <_> + + <_> + + + + <_>1 2 8 10 -1. + <_>1 2 4 5 2. + <_>5 7 4 5 2. + 0 + -0.0208030007779598 + 0.1982630044221878 + -0.3117119967937470 + <_> + + <_> + + + + <_>10 1 5 12 -1. + <_>10 5 5 4 3. + 0 + 7.2599998675286770e-003 + -0.0505909994244576 + 0.4192380011081696 + <_> + + <_> + + + + <_>4 0 14 24 -1. + <_>11 0 7 24 2. + 0 + 0.3416000008583069 + -0.1667490005493164 + 0.9274860024452210 + <_> + + <_> + + + + <_>7 17 10 4 -1. + <_>7 19 10 2 2. + 0 + 6.2029999680817127e-003 + -0.1262589991092682 + 0.4044530093669891 + <_> + + <_> + + + + <_>10 14 4 10 -1. + <_>10 19 4 5 2. + 0 + 0.0326920002698898 + -0.0326349996030331 + -0.9893980026245117 + <_> + + <_> + + + + <_>13 15 6 9 -1. + <_>15 15 2 9 3. + 0 + 2.1100000594742596e-004 + -0.0645340010523796 + 0.2547369897365570 + <_> + + <_> + + + + <_>3 21 18 3 -1. + <_>3 22 18 1 3. + 0 + 7.2100001852959394e-004 + -0.3661859929561615 + 0.1197310015559197 + <_> + + <_> + + + + <_>13 15 6 9 -1. + <_>15 15 2 9 3. + 0 + 0.0544909983873367 + 0.1207349970936775 + -1.0291390419006348 + <_> + + <_> + + + + <_>5 15 6 9 -1. + <_>7 15 2 9 3. + 0 + -0.0101410001516342 + -0.5217720270156860 + 0.0337349995970726 + <_> + + <_> + + + + <_>10 6 4 18 -1. + <_>12 6 2 9 2. + <_>10 15 2 9 2. + 0 + -0.0188159998506308 + 0.6518179774284363 + 1.3399999588727951e-003 + <_> + + <_> + + + + <_>7 3 6 11 -1. + <_>9 3 2 11 3. + 0 + -5.3480002097785473e-003 + 0.1737069934606552 + -0.3413200080394745 + <_> + + <_> + + + + <_>15 1 9 4 -1. + <_>15 3 9 2 2. + 0 + -0.0108470004051924 + -0.1969989985227585 + 0.1504549980163574 + <_> + + <_> + + + + <_>5 4 14 8 -1. + <_>5 8 14 4 2. + 0 + -0.0499260015785694 + -0.5088850259780884 + 0.0307620000094175 + <_> + + <_> + + + + <_>8 1 15 9 -1. + <_>8 4 15 3 3. + 0 + 0.0121600003913045 + -0.0692519992589951 + 0.1874549984931946 + <_> + + <_> + + + + <_>7 2 8 10 -1. + <_>7 2 4 5 2. + <_>11 7 4 5 2. + 0 + -2.2189998999238014e-003 + -0.4084909856319428 + 0.0799549967050552 + <_> + + <_> + + + + <_>12 2 6 12 -1. + <_>12 2 3 12 2. + 0 + 3.1580000650137663e-003 + -0.2112459987401962 + 0.2236640006303787 + <_> + + <_> + + + + <_>6 2 6 12 -1. + <_>9 2 3 12 2. + 0 + 4.1439998894929886e-003 + -0.4990029931068420 + 0.0629170015454292 + <_> + + <_> + + + + <_>7 7 12 4 -1. + <_>7 7 6 4 2. + 0 + -7.3730000294744968e-003 + -0.2055329978466034 + 0.2209669947624207 + <_> + + <_> + + + + <_>6 3 12 10 -1. + <_>10 3 4 10 3. + 0 + 0.0518120005726814 + 0.1809680014848709 + -0.4349580109119415 + <_> + + <_> + + + + <_>5 6 16 6 -1. + <_>13 6 8 3 2. + <_>5 9 8 3 2. + 0 + 0.0183400008827448 + 0.0152000002563000 + 0.3799169957637787 + <_> + + <_> + + + + <_>3 1 18 9 -1. + <_>9 1 6 9 3. + 0 + 0.1749079972505570 + -0.2092079967260361 + 0.4001300036907196 + <_> + + <_> + + + + <_>3 8 18 5 -1. + <_>9 8 6 5 3. + 0 + 0.0539939999580383 + 0.2475160062313080 + -0.2671290040016174 + <_> + + <_> + + + + <_>0 0 24 22 -1. + <_>0 0 12 11 2. + <_>12 11 12 11 2. + 0 + -0.3203319907188416 + -1.9094380140304565 + -0.0669609978795052 + <_> + + <_> + + + + <_>14 16 9 6 -1. + <_>14 18 9 2 3. + 0 + -0.0270600002259016 + -0.7137129902839661 + 0.1590459942817688 + <_> + + <_> + + + + <_>0 16 24 8 -1. + <_>0 20 24 4 2. + 0 + 0.0774639993906021 + -0.1697019934654236 + 0.7755299806594849 + <_> + + <_> + + + + <_>1 19 22 4 -1. + <_>12 19 11 2 2. + <_>1 21 11 2 2. + 0 + 0.0237719994038343 + 0.1902189999818802 + -0.6016209721565247 + <_> + + <_> + + + + <_>1 16 9 6 -1. + <_>1 18 9 2 3. + 0 + 0.0115010002627969 + 7.7039999887347221e-003 + -0.6173030138015747 + <_> + + <_> + + + + <_>7 8 10 4 -1. + <_>7 8 5 4 2. + 0 + 0.0326160006225109 + 0.1715919971466065 + -0.7097820043563843 + <_> + + <_> + + + + <_>9 15 6 9 -1. + <_>11 15 2 9 3. + 0 + -0.0443830005824566 + -2.2606229782104492 + -0.0732769966125488 + <_> + + <_> + + + + <_>10 18 12 6 -1. + <_>16 18 6 3 2. + <_>10 21 6 3 2. + 0 + -0.0584760010242462 + 2.4087750911712646 + 0.0830919966101646 + <_> + + <_> + + + + <_>2 18 12 6 -1. + <_>2 18 6 3 2. + <_>8 21 6 3 2. + 0 + 0.0193039998412132 + -0.2708230018615723 + 0.2736999988555908 + <_> + + <_> + + + + <_>8 3 16 9 -1. + <_>8 6 16 3 3. + 0 + -0.0447059981524944 + 0.3135559856891632 + -0.0624920018017292 + <_> + + <_> + + + + <_>0 5 10 6 -1. + <_>0 7 10 2 3. + 0 + -0.0603349991142750 + -1.4515119791030884 + -0.0587610006332397 + <_> + + <_> + + + + <_>5 5 18 3 -1. + <_>5 6 18 1 3. + 0 + 0.0116670001298189 + -0.0180849991738796 + 0.5047969818115234 + <_> + + <_> + + + + <_>2 6 9 6 -1. + <_>2 9 9 3 2. + 0 + 0.0280099995434284 + -0.2330289930105209 + 0.3070870041847229 + <_> + + <_> + + + + <_>14 2 10 9 -1. + <_>14 5 10 3 3. + 0 + 0.0653970018029213 + 0.1413590013980866 + -0.5001090168952942 + <_> + + <_> + + + + <_>3 6 18 3 -1. + <_>3 7 18 1 3. + 0 + 9.6239997074007988e-003 + -0.2205460071563721 + 0.3919120132923126 + <_> + + <_> + + + + <_>9 2 15 6 -1. + <_>9 4 15 2 3. + 0 + 2.5510000996291637e-003 + -0.1138150021433830 + 0.2003230005502701 + <_> + + <_> + + + + <_>4 8 15 6 -1. + <_>4 10 15 2 3. + 0 + 0.0318470001220703 + 0.0254769995808601 + -0.5332639813423157 + <_> + + <_> + + + + <_>0 5 24 4 -1. + <_>12 5 12 2 2. + <_>0 7 12 2 2. + 0 + 0.0330550000071526 + 0.1780769973993301 + -0.6279389858245850 + <_> + + <_> + + + + <_>7 8 6 12 -1. + <_>9 8 2 12 3. + 0 + 0.0476009994745255 + -0.1474789977073669 + 1.4204180240631104 + <_> + + <_> + + + + <_>11 0 6 9 -1. + <_>13 0 2 9 3. + 0 + -0.0195719990879297 + -0.5269349813461304 + 0.1583860069513321 + <_> + + <_> + + + + <_>0 12 6 12 -1. + <_>0 12 3 6 2. + <_>3 18 3 6 2. + 0 + -0.0547300018370152 + 0.8823159933090210 + -0.1662780046463013 + <_> + + <_> + + + + <_>14 12 10 6 -1. + <_>14 14 10 2 3. + 0 + -0.0226860009133816 + -0.4838689863681793 + 0.1500010043382645 + <_> + + <_> + + + + <_>2 7 18 9 -1. + <_>2 10 18 3 3. + 0 + 0.1071320027112961 + -0.2133619934320450 + 0.4233390092849731 + <_> + + <_> + + + + <_>11 14 10 9 -1. + <_>11 17 10 3 3. + 0 + -0.0363800004124641 + -0.0741980001330376 + 0.1458940058946610 + <_> + + <_> + + + + <_>7 6 10 8 -1. + <_>7 6 5 4 2. + <_>12 10 5 4 2. + 0 + 0.0139359999448061 + -0.2491160035133362 + 0.2677119970321655 + <_> + + <_> + + + + <_>6 6 14 6 -1. + <_>13 6 7 3 2. + <_>6 9 7 3 2. + 0 + 0.0209919996559620 + 8.7959999218583107e-003 + 0.4306499958038330 + <_> + + <_> + + + + <_>4 13 9 7 -1. + <_>7 13 3 7 3. + 0 + 0.0491189993917942 + -0.1759199947118759 + 0.6928290128707886 + <_> + + <_> + + + + <_>14 10 6 12 -1. + <_>17 10 3 6 2. + <_>14 16 3 6 2. + 0 + 0.0363159999251366 + 0.1314529925584793 + -0.3359729945659638 + <_> + + <_> + + + + <_>4 10 6 12 -1. + <_>4 10 3 6 2. + <_>7 16 3 6 2. + 0 + 0.0412280000746250 + -0.0456920005381107 + -1.3515930175781250 + <_> + + <_> + + + + <_>13 9 8 6 -1. + <_>13 9 4 6 2. + 0 + 0.0156720001250505 + 0.1754409968852997 + -0.0605500005185604 + <_> + + <_> + + + + <_>8 3 4 14 -1. + <_>10 3 2 14 2. + 0 + -0.0162860006093979 + -1.1308189630508423 + -0.0395330004394054 + <_> + + <_> + + + + <_>17 0 3 18 -1. + <_>18 0 1 18 3. + 0 + -3.0229999683797359e-003 + -0.2245430052280426 + 0.2362809926271439 + <_> + + <_> + + + + <_>4 12 16 12 -1. + <_>12 12 8 12 2. + 0 + -0.1378629952669144 + 0.4537689983844757 + -0.2109870016574860 + <_> + + <_> + + + + <_>15 0 6 14 -1. + <_>17 0 2 14 3. + 0 + -9.6760001033544540e-003 + -0.1510509997606278 + 0.2078170031309128 + <_> + + <_> + + + + <_>3 0 6 14 -1. + <_>5 0 2 14 3. + 0 + -0.0248399991542101 + -0.6835029721260071 + -8.0040004104375839e-003 + <_> + + <_> + + + + <_>12 2 12 20 -1. + <_>16 2 4 20 3. + 0 + -0.1396439969539642 + 0.6501129865646362 + 0.0465440005064011 + <_> + + <_> + + + + <_>0 2 12 20 -1. + <_>4 2 4 20 3. + 0 + -0.0821539983153343 + 0.4488719999790192 + -0.2359199970960617 + <_> + + <_> + + + + <_>16 0 6 17 -1. + <_>18 0 2 17 3. + 0 + 3.8449999410659075e-003 + -0.0881730020046234 + 0.2734679877758026 + <_> + + <_> + + + + <_>2 0 6 17 -1. + <_>4 0 2 17 3. + 0 + -6.6579999402165413e-003 + -0.4686659872531891 + 0.0770019963383675 + <_> + + <_> + + + + <_>15 6 9 6 -1. + <_>15 8 9 2 3. + 0 + -0.0158980004489422 + 0.2926839888095856 + -0.0219410005956888 + <_> + + <_> + + + + <_>0 6 9 6 -1. + <_>0 8 9 2 3. + 0 + -0.0509460009634495 + -1.2093789577484131 + -0.0421099998056889 + <_> + + <_> + + + + <_>18 1 6 13 -1. + <_>20 1 2 13 3. + 0 + 0.0168379992246628 + -0.0455959998071194 + 0.5018069744110107 + <_> + + <_> + + + + <_>0 1 6 13 -1. + <_>2 1 2 13 3. + 0 + 0.0159189999103546 + -0.2690429985523224 + 0.2651630043983460 + <_> + + <_> + + + + <_>16 0 4 9 -1. + <_>16 0 2 9 2. + 0 + 3.6309999413788319e-003 + -0.1304610073566437 + 0.3180710077285767 + <_> + + <_> + + + + <_>5 10 12 7 -1. + <_>9 10 4 7 3. + 0 + -0.0861449986696243 + 1.9443659782409668 + -0.1397829949855804 + <_> + + <_> + + + + <_>12 9 12 6 -1. + <_>12 11 12 2 3. + 0 + 0.0331409983336926 + 0.1526679992675781 + -0.0308660008013248 + <_> + + <_> + + + + <_>0 9 12 6 -1. + <_>0 11 12 2 3. + 0 + -3.9679999463260174e-003 + -0.7120230197906494 + -0.0138440001755953 + <_> + + <_> + + + + <_>5 7 14 9 -1. + <_>5 10 14 3 3. + 0 + -0.0240080002695322 + 0.9200779795646668 + 0.0467239990830421 + <_> + + <_> + + + + <_>0 15 20 3 -1. + <_>0 16 20 1 3. + 0 + 8.7320003658533096e-003 + -0.2256730049848557 + 0.3193179965019226 + <_> + + <_> + + + + <_>8 10 8 10 -1. + <_>12 10 4 5 2. + <_>8 15 4 5 2. + 0 + -0.0277869999408722 + -0.7233710289001465 + 0.1701859980821610 + <_> + + <_> + + + + <_>5 4 13 9 -1. + <_>5 7 13 3 3. + 0 + -0.1945530027151108 + 1.2461860179901123 + -0.1473619937896729 + <_> + + <_> + + + + <_>10 2 6 18 -1. + <_>10 8 6 6 3. + 0 + -0.1086969971656799 + -1.4465179443359375 + 0.1214530020952225 + <_> + + <_> + + + + <_>6 0 6 9 -1. + <_>8 0 2 9 3. + 0 + -0.0194949992001057 + -0.7815309762954712 + -0.0237329993396997 + <_> + + <_> + + + + <_>6 9 12 4 -1. + <_>6 11 12 2 2. + 0 + 3.0650000553578138e-003 + -0.8547139763832092 + 0.1668699979782105 + <_> + + <_> + + + + <_>3 2 15 12 -1. + <_>3 6 15 4 3. + 0 + 0.0591939985752106 + -0.1485369950532913 + 1.1273469924926758 + <_> + + <_> + + + + <_>12 0 12 5 -1. + <_>16 0 4 5 3. + 0 + -0.0542079992592335 + 0.5472699999809265 + 0.0355239994823933 + <_> + + <_> + + + + <_>0 15 18 3 -1. + <_>6 15 6 3 3. + 0 + -0.0393249988555908 + 0.3664259910583496 + -0.2054399996995926 + <_> + + <_> + + + + <_>0 14 24 5 -1. + <_>8 14 8 5 3. + 0 + 0.0822789967060089 + -0.0350079983472824 + 0.5399420261383057 + <_> + + <_> + + + + <_>5 1 3 18 -1. + <_>6 1 1 18 3. + 0 + -7.4479999020695686e-003 + -0.6153749823570252 + -3.5319998860359192e-003 + <_> + + <_> + + + + <_>10 0 4 14 -1. + <_>10 0 2 14 2. + 0 + 7.3770000599324703e-003 + -0.0655910000205040 + 0.4196139872074127 + <_> + + <_> + + + + <_>9 3 4 9 -1. + <_>11 3 2 9 2. + 0 + 7.0779998786747456e-003 + -0.3412950038909912 + 0.1253679990768433 + <_> + + <_> + + + + <_>8 2 12 6 -1. + <_>14 2 6 3 2. + <_>8 5 6 3 2. + 0 + -0.0155819999054074 + -0.3024039864540100 + 0.2151100039482117 + <_> + + <_> + + + + <_>0 4 17 4 -1. + <_>0 6 17 2 2. + 0 + -2.7399999089539051e-003 + 0.0765530019998550 + -0.4106050133705139 + <_> + + <_> + + + + <_>16 16 5 8 -1. + <_>16 20 5 4 2. + 0 + -0.0706000030040741 + -0.9735620021820068 + 0.1124180033802986 + <_> + + <_> + + + + <_>3 16 5 8 -1. + <_>3 20 5 4 2. + 0 + -0.0117060001939535 + 0.1856070011854172 + -0.2975519895553589 + <_> + + <_> + + + + <_>6 18 18 2 -1. + <_>6 19 18 1 2. + 0 + 7.1499997284263372e-004 + -0.0596500001847744 + 0.2482469975948334 + <_> + + <_> + + + + <_>0 0 12 5 -1. + <_>4 0 4 5 3. + 0 + -0.0368660017848015 + 0.3275170028209686 + -0.2305960059165955 + <_> + + <_> + + + + <_>14 3 6 12 -1. + <_>17 3 3 6 2. + <_>14 9 3 6 2. + 0 + -0.0325269997119904 + -0.2932029962539673 + 0.1542769968509674 + <_> + + <_> + + + + <_>0 12 6 12 -1. + <_>2 12 2 12 3. + 0 + -0.0748139992356300 + -1.2143570184707642 + -0.0522440001368523 + <_> + + <_> + + + + <_>2 3 21 3 -1. + <_>2 4 21 1 3. + 0 + 0.0414699986577034 + 0.1306249946355820 + -2.3274369239807129 + <_> + + <_> + + + + <_>4 3 6 12 -1. + <_>4 3 3 6 2. + <_>7 9 3 6 2. + 0 + -0.0288800001144409 + -0.6607459783554077 + -9.0960003435611725e-003 + <_> + + <_> + + + + <_>12 8 12 6 -1. + <_>18 8 6 3 2. + <_>12 11 6 3 2. + 0 + 0.0463819988071918 + 0.1663019955158234 + -0.6694949865341187 + <_> + + <_> + + + + <_>0 15 16 9 -1. + <_>8 15 8 9 2. + 0 + 0.2542499899864197 + -0.0546419993042946 + -1.2676080465316772 + <_> + + <_> + + + + <_>6 13 18 5 -1. + <_>6 13 9 5 2. + 0 + 2.4000001139938831e-003 + 0.2027679979801178 + 0.0146679999306798 + <_> + + <_> + + + + <_>1 6 15 6 -1. + <_>6 6 5 6 3. + 0 + -0.0828059986233711 + -0.7871360182762146 + -0.0244689993560314 + <_> + + <_> + + + + <_>11 9 9 6 -1. + <_>14 9 3 6 3. + 0 + -0.0114380000159144 + 0.2862339913845062 + -0.0308940000832081 + <_> + + <_> + + + + <_>3 0 15 11 -1. + <_>8 0 5 11 3. + 0 + -0.1291339993476868 + 1.7292929887771606 + -0.1429390013217926 + <_> + + <_> + + + + <_>15 3 3 18 -1. + <_>15 9 3 6 3. + 0 + 0.0385529994964600 + 0.0192329995334148 + 0.3773260116577148 + <_> + + <_> + + + + <_>6 3 3 18 -1. + <_>6 9 3 6 3. + 0 + 0.1019140034914017 + -0.0745339989662170 + -3.3868899345397949 + <_> + + <_> + + + + <_>9 5 10 8 -1. + <_>14 5 5 4 2. + <_>9 9 5 4 2. + 0 + -0.0190680008381605 + 0.3181410133838654 + 0.0192610006779432 + <_> + + <_> + + + + <_>4 4 16 8 -1. + <_>4 4 8 4 2. + <_>12 8 8 4 2. + 0 + -0.0607750006020069 + 0.7693629860877991 + -0.1764400005340576 + <_> + + <_> + + + + <_>7 7 12 3 -1. + <_>7 7 6 3 2. + 0 + 0.0246799997985363 + 0.1839649975299835 + -0.3086880147457123 + <_> + + <_> + + + + <_>5 0 9 13 -1. + <_>8 0 3 13 3. + 0 + 0.0267590004950762 + -0.2345490008592606 + 0.3305659890174866 + <_> + + <_> + + + + <_>11 0 6 9 -1. + <_>13 0 2 9 3. + 0 + 0.0149699999019504 + 0.1721359938383102 + -0.1824889928102493 + <_> + + <_> + + + + <_>7 0 6 9 -1. + <_>9 0 2 9 3. + 0 + 0.0261429995298386 + -0.0464639998972416 + -1.1318379640579224 + <_> + + <_> + + + + <_>8 1 10 9 -1. + <_>8 4 10 3 3. + 0 + -0.0375120006501675 + 0.8040400147438049 + 0.0696600005030632 + <_> + + <_> + + + + <_>0 2 18 2 -1. + <_>0 3 18 1 2. + 0 + -5.3229997865855694e-003 + -0.8188440203666687 + -0.0182249993085861 + <_> + + <_> + + + + <_>10 13 14 6 -1. + <_>17 13 7 3 2. + <_>10 16 7 3 2. + 0 + 0.0178130008280277 + 0.1495780050754547 + -0.1866720020771027 + <_> + + <_> + + + + <_>0 13 14 6 -1. + <_>0 13 7 3 2. + <_>7 16 7 3 2. + 0 + -0.0340100005269051 + -0.7285230159759522 + -0.0166159998625517 + <_> + + <_> + + + + <_>20 2 3 21 -1. + <_>21 2 1 21 3. + 0 + -0.0159530006349087 + 0.5694400072097778 + 0.0138320000842214 + <_> + + <_> + + + + <_>0 9 5 12 -1. + <_>0 13 5 4 3. + 0 + 0.0197439994663000 + 0.0405250005424023 + -0.4177339971065521 + <_> + + <_> + + + + <_>12 6 12 6 -1. + <_>12 8 12 2 3. + 0 + -0.1037480011582375 + -1.9825149774551392 + 0.1196020022034645 + <_> + + <_> + + + + <_>1 8 20 3 -1. + <_>1 9 20 1 3. + 0 + -0.0192850008606911 + 0.5023059844970703 + -0.1974589973688126 + <_> + + <_> + + + + <_>5 7 19 3 -1. + <_>5 8 19 1 3. + 0 + -0.0127800004556775 + 0.4019500017166138 + -0.0269579999148846 + <_> + + <_> + + + + <_>1 12 9 6 -1. + <_>1 14 9 2 3. + 0 + -0.0163529999554157 + -0.7660880088806152 + -0.0242090001702309 + <_> + + <_> + + + + <_>6 10 14 12 -1. + <_>6 14 14 4 3. + 0 + -0.1276369988918304 + 0.8657850027084351 + 0.0642059966921806 + <_> + + <_> + + + + <_>5 6 14 18 -1. + <_>5 12 14 6 3. + 0 + 0.0190689992159605 + -0.5592979788780212 + -1.6880000475794077e-003 + <_> + + <_> + + + + <_>11 12 9 7 -1. + <_>14 12 3 7 3. + 0 + 0.0324809998273849 + 0.0407220013439655 + 0.4892509877681732 + <_> + + <_> + + + + <_>1 15 18 4 -1. + <_>1 17 18 2 2. + 0 + 9.4849998131394386e-003 + -0.1923190057277679 + 0.5113970041275024 + <_> + + <_> + + + + <_>11 14 6 9 -1. + <_>11 17 6 3 3. + 0 + 5.0470000132918358e-003 + 0.1870680004358292 + -0.1611360013484955 + <_> + + <_> + + + + <_>0 8 18 4 -1. + <_>0 8 9 2 2. + <_>9 10 9 2 2. + 0 + 0.0412679985165596 + -0.0488179996609688 + -1.1326299905776978 + <_> + + <_> + + + + <_>3 10 20 6 -1. + <_>13 10 10 3 2. + <_>3 13 10 3 2. + 0 + -0.0763589963316917 + 1.4169390201568604 + 0.0873199999332428 + <_> + + <_> + + + + <_>1 10 20 6 -1. + <_>1 10 10 3 2. + <_>11 13 10 3 2. + 0 + -0.0728349983692169 + 1.3189860582351685 + -0.1481910049915314 + <_> + + <_> + + + + <_>0 9 24 2 -1. + <_>0 9 12 2 2. + 0 + 0.0595769993960857 + 0.0483769997954369 + 0.8561180233955383 + <_> + + <_> + + + + <_>1 12 20 8 -1. + <_>1 12 10 4 2. + <_>11 16 10 4 2. + 0 + 0.0202639997005463 + -0.2104409933090210 + 0.3385899960994721 + <_> + + <_> + + + + <_>11 12 9 7 -1. + <_>14 12 3 7 3. + 0 + -0.0803010016679764 + -1.2464400529861450 + 0.1185709983110428 + <_> + + <_> + + + + <_>4 12 9 7 -1. + <_>7 12 3 7 3. + 0 + -0.0178350005298853 + 0.2578229904174805 + -0.2456479966640472 + <_> + + <_> + + + + <_>12 12 8 5 -1. + <_>12 12 4 5 2. + 0 + 0.0114310001954436 + 0.2294979989528656 + -0.2949759960174561 + <_> + + <_> + + + + <_>4 12 8 5 -1. + <_>8 12 4 5 2. + 0 + -0.0255410000681877 + -0.8625299930572510 + -7.0400000549852848e-004 + <_> + + <_> + + + + <_>13 10 4 10 -1. + <_>13 10 2 10 2. + 0 + -7.6899997657164931e-004 + 0.3151139914989471 + -0.1434900015592575 + <_> + + <_> + + + + <_>1 15 20 2 -1. + <_>11 15 10 2 2. + 0 + -0.0144539996981621 + 0.2514849901199341 + -0.2823289930820465 + <_> + + <_> + + + + <_>9 10 6 6 -1. + <_>9 10 3 6 2. + 0 + 8.6730001494288445e-003 + 0.2660140097141266 + -0.2819080054759979 + -3.2103500366210937 + 18 + -1 + <_> + + + <_> + + <_> + + + + <_>0 1 21 3 -1. + <_>7 1 7 3 3. + 0 + 0.0547089986503124 + -0.5414429903030396 + 0.6104300022125244 + <_> + + <_> + + + + <_>6 4 13 9 -1. + <_>6 7 13 3 3. + 0 + -0.1083879992365837 + 0.7173990011215210 + -0.4119609892368317 + <_> + + <_> + + + + <_>6 5 12 5 -1. + <_>10 5 4 5 3. + 0 + 0.0229969993233681 + -0.5826979875564575 + 0.2964560091495514 + <_> + + <_> + + + + <_>10 10 10 6 -1. + <_>10 12 10 2 3. + 0 + 2.7540000155568123e-003 + -0.7424389719963074 + 0.1418330073356628 + <_> + + <_> + + + + <_>6 12 5 8 -1. + <_>6 16 5 4 2. + 0 + -2.1520000882446766e-003 + 0.1787990033626556 + -0.6854860186576843 + <_> + + <_> + + + + <_>13 0 6 9 -1. + <_>15 0 2 9 3. + 0 + -0.0225590001791716 + -1.0775549411773682 + 0.1238899976015091 + <_> + + <_> + + + + <_>2 10 18 6 -1. + <_>8 10 6 6 3. + 0 + 0.0830250009894371 + 0.0245009995996952 + -1.0251879692077637 + <_> + + <_> + + + + <_>11 2 9 4 -1. + <_>11 4 9 2 2. + 0 + -6.6740000620484352e-003 + -0.4528310000896454 + 0.2123019993305206 + <_> + + <_> + + + + <_>1 20 21 3 -1. + <_>8 20 7 3 3. + 0 + 0.0764850005507469 + -0.2697269916534424 + 0.4858019948005676 + <_> + + <_> + + + + <_>1 10 22 2 -1. + <_>1 11 22 1 2. + 0 + 5.4910001344978809e-003 + -0.4887120127677918 + 0.3161639869213104 + <_> + + <_> + + + + <_>0 17 18 3 -1. + <_>0 18 18 1 3. + 0 + -0.0104149999096990 + 0.4151290059089661 + -0.3004480004310608 + <_> + + <_> + + + + <_>13 0 6 9 -1. + <_>15 0 2 9 3. + 0 + 0.0276079997420311 + 0.1620379984378815 + -0.9986850023269653 + <_> + + <_> + + + + <_>5 0 6 9 -1. + <_>7 0 2 9 3. + 0 + -0.0232720002532005 + -1.1024399995803833 + 0.0211249999701977 + <_> + + <_> + + + + <_>18 2 6 20 -1. + <_>20 2 2 20 3. + 0 + -0.0556199997663498 + 0.6503310203552246 + -0.0279380008578300 + <_> + + <_> + + + + <_>0 2 6 20 -1. + <_>2 2 2 20 3. + 0 + -0.0406319983303547 + 0.4211730062961578 + -0.2676379978656769 + <_> + + <_> + + + + <_>11 7 6 14 -1. + <_>14 7 3 7 2. + <_>11 14 3 7 2. + 0 + -7.3560001328587532e-003 + 0.3527779877185822 + -0.3785400092601776 + <_> + + <_> + + + + <_>0 1 4 9 -1. + <_>2 1 2 9 2. + 0 + 0.0170070007443428 + -0.2918950021266937 + 0.4105379879474640 + <_> + + <_> + + + + <_>12 14 9 4 -1. + <_>12 16 9 2 2. + 0 + -0.0370340012013912 + -1.3216309547424316 + 0.1296650022268295 + <_> + + <_> + + + + <_>1 13 9 4 -1. + <_>1 15 9 2 2. + 0 + -0.0196330007165670 + -0.8770229816436768 + 1.0799999581649899e-003 + <_> + + <_> + + + + <_>7 6 15 6 -1. + <_>7 8 15 2 3. + 0 + -0.0235469993203878 + 0.2610610127449036 + -0.2148140072822571 + <_> + + <_> + + + + <_>8 2 3 18 -1. + <_>8 8 3 6 3. + 0 + -0.0433529987931252 + -0.9908969998359680 + -9.9560003727674484e-003 + <_> + + <_> + + + + <_>6 6 12 6 -1. + <_>12 6 6 3 2. + <_>6 9 6 3 2. + 0 + -0.0221839994192123 + 0.6345440149307251 + -0.0565470010042191 + <_> + + <_> + + + + <_>2 19 20 4 -1. + <_>2 19 10 2 2. + <_>12 21 10 2 2. + 0 + 0.0165309999138117 + 0.0246649999171495 + -0.7332680225372315 + <_> + + <_> + + + + <_>14 15 6 9 -1. + <_>14 18 6 3 3. + 0 + -0.0327440015971661 + -0.5629720091819763 + 0.1664029955863953 + <_> + + <_> + + + + <_>3 5 18 14 -1. + <_>3 5 9 7 2. + <_>12 12 9 7 2. + 0 + 0.0714159980416298 + -3.0000001424923539e-004 + -0.9328640103340149 + <_> + + <_> + + + + <_>15 6 4 18 -1. + <_>17 6 2 9 2. + <_>15 15 2 9 2. + 0 + 8.0999999772757292e-004 + -0.0953800007700920 + 0.2518469989299774 + <_> + + <_> + + + + <_>5 6 4 18 -1. + <_>5 6 2 9 2. + <_>7 15 2 9 2. + 0 + -8.4090000018477440e-003 + -0.6549680233001709 + 0.0673009976744652 + <_> + + <_> + + + + <_>11 0 6 9 -1. + <_>13 0 2 9 3. + 0 + -0.0172540005296469 + -0.4649299979209900 + 0.1607089936733246 + <_> + + <_> + + + + <_>7 0 6 9 -1. + <_>9 0 2 9 3. + 0 + -0.0186410006135702 + -1.0594010353088379 + -0.0196170005947351 + <_> + + <_> + + + + <_>11 5 6 9 -1. + <_>13 5 2 9 3. + 0 + -9.1979997232556343e-003 + 0.5071619749069214 + -0.1533920019865036 + <_> + + <_> + + + + <_>9 5 6 6 -1. + <_>12 5 3 6 2. + 0 + 0.0185380000621080 + -0.3049820065498352 + 0.7350620031356812 + <_> + + <_> + + + + <_>4 1 16 6 -1. + <_>12 1 8 3 2. + <_>4 4 8 3 2. + 0 + -0.0503350012004375 + -1.1140480041503906 + 0.1800010055303574 + <_> + + <_> + + + + <_>9 13 6 11 -1. + <_>11 13 2 11 3. + 0 + -0.0235290005803108 + -0.8690789937973023 + -0.0124599998816848 + <_> + + <_> + + + + <_>17 1 6 12 -1. + <_>20 1 3 6 2. + <_>17 7 3 6 2. + 0 + -0.0271000005304813 + 0.6594290137290955 + -0.0353239998221397 + <_> + + <_> + + + + <_>1 17 18 3 -1. + <_>1 18 18 1 3. + 0 + 6.5879998728632927e-003 + -0.2295340001583099 + 0.4242509901523590 + <_> + + <_> + + + + <_>7 13 10 8 -1. + <_>7 17 10 4 2. + 0 + 0.0233600009232759 + 0.1835619956254959 + -0.9858729839324951 + <_> + + <_> + + + + <_>6 18 10 6 -1. + <_>6 20 10 2 3. + 0 + 0.0129469996318221 + -0.3314740061759949 + 0.2132319957017899 + <_> + + <_> + + + + <_>9 14 9 4 -1. + <_>9 16 9 2 2. + 0 + -6.6559999249875546e-003 + -0.1195140033960342 + 0.2975279986858368 + <_> + + <_> + + + + <_>1 1 6 12 -1. + <_>1 1 3 6 2. + <_>4 7 3 6 2. + 0 + -0.0225709993392229 + 0.3849940001964569 + -0.2443449944257736 + <_> + + <_> + + + + <_>19 4 5 12 -1. + <_>19 8 5 4 3. + 0 + -0.0638139992952347 + -0.8938350081443787 + 0.1421750038862228 + <_> + + <_> + + + + <_>0 0 8 8 -1. + <_>4 0 4 8 2. + 0 + -0.0499450005590916 + 0.5386440157890320 + -0.2048529982566834 + <_> + + <_> + + + + <_>3 5 19 3 -1. + <_>3 6 19 1 3. + 0 + 6.8319998681545258e-003 + -0.0566789992153645 + 0.3997099995613098 + <_> + + <_> + + + + <_>1 5 12 6 -1. + <_>1 5 6 3 2. + <_>7 8 6 3 2. + 0 + -0.0558359995484352 + -1.5239470005035400 + -0.0511830002069473 + <_> + + <_> + + + + <_>2 1 21 8 -1. + <_>9 1 7 8 3. + 0 + 0.3195700049400330 + 0.0745740011334419 + 1.2447799444198608 + <_> + + <_> + + + + <_>4 1 16 8 -1. + <_>4 5 16 4 2. + 0 + 0.0809559971094131 + -0.1966550052165985 + 0.5988969802856445 + <_> + + <_> + + + + <_>6 0 18 3 -1. + <_>6 1 18 1 3. + 0 + -0.0149119999259710 + -0.6402059793472290 + 0.1580760031938553 + <_> + + <_> + + + + <_>4 4 10 14 -1. + <_>4 11 10 7 2. + 0 + 0.0467090010643005 + 0.0852390006184578 + -0.4548720121383667 + <_> + + <_> + + + + <_>15 6 4 10 -1. + <_>15 11 4 5 2. + 0 + 6.0539999976754189e-003 + -0.4318400025367737 + 0.2245260030031204 + <_> + + <_> + + + + <_>3 18 18 3 -1. + <_>9 18 6 3 3. + 0 + -0.0343759991228580 + 0.4020250141620636 + -0.2390359938144684 + <_> + + <_> + + + + <_>8 18 12 6 -1. + <_>12 18 4 6 3. + 0 + -0.0349240005016327 + 0.5287010073661804 + 0.0397090017795563 + <_> + + <_> + + + + <_>3 15 6 9 -1. + <_>6 15 3 9 2. + 0 + 3.0030000489205122e-003 + -0.3875429928302765 + 0.1419260054826737 + <_> + + <_> + + + + <_>15 7 6 8 -1. + <_>15 11 6 4 2. + 0 + -0.0141329998150468 + 0.8752840161323547 + 0.0855079963803291 + <_> + + <_> + + + + <_>3 7 6 8 -1. + <_>3 11 6 4 2. + 0 + -6.7940000444650650e-003 + -1.1649219989776611 + -0.0339430011808872 + <_> + + <_> + + + + <_>5 9 18 6 -1. + <_>14 9 9 3 2. + <_>5 12 9 3 2. + 0 + -0.0528860017657280 + 1.0930680036544800 + 0.0511870011687279 + <_> + + <_> + + + + <_>1 13 12 6 -1. + <_>1 15 12 2 3. + 0 + -2.1079999860376120e-003 + 0.1369619965553284 + -0.3384999930858612 + <_> + + <_> + + + + <_>14 15 10 6 -1. + <_>14 17 10 2 3. + 0 + 0.0183530002832413 + 0.1366160064935684 + -0.4077779948711395 + <_> + + <_> + + + + <_>0 15 10 6 -1. + <_>0 17 10 2 3. + 0 + 0.0126719996333122 + -0.0149360001087189 + -0.8170750141143799 + <_> + + <_> + + + + <_>15 13 6 9 -1. + <_>15 16 6 3 3. + 0 + 0.0129249999299645 + 0.1762509942054749 + -0.3249169886112213 + <_> + + <_> + + + + <_>3 13 6 9 -1. + <_>3 16 6 3 3. + 0 + -0.0179210007190704 + -0.5274540185928345 + 0.0444430001080036 + <_> + + <_> + + + + <_>9 5 8 8 -1. + <_>9 5 4 8 2. + 0 + 1.9160000374540687e-003 + -0.1097859963774681 + 0.2206750065088272 + <_> + + <_> + + + + <_>1 18 12 6 -1. + <_>1 18 6 3 2. + <_>7 21 6 3 2. + 0 + -0.0146979996934533 + 0.3906779885292053 + -0.2222499996423721 + <_> + + <_> + + + + <_>13 19 10 4 -1. + <_>13 21 10 2 2. + 0 + -0.0149729996919632 + -0.2545090019702911 + 0.1779000014066696 + <_> + + <_> + + + + <_>1 19 10 4 -1. + <_>1 21 10 2 2. + 0 + 0.0146369999274611 + -0.0251250006258488 + -0.8712130188941956 + <_> + + <_> + + + + <_>6 19 18 3 -1. + <_>6 20 18 1 3. + 0 + -0.0109740002080798 + 0.7908279895782471 + 0.0201210007071495 + <_> + + <_> + + + + <_>8 14 4 10 -1. + <_>8 19 4 5 2. + 0 + -9.1599998995661736e-003 + -0.4790689945220947 + 0.0522320009768009 + <_> + + <_> + + + + <_>0 0 24 6 -1. + <_>0 2 24 2 3. + 0 + 4.6179997734725475e-003 + -0.1724459975957871 + 0.3452779948711395 + <_> + + <_> + + + + <_>0 1 6 9 -1. + <_>0 4 6 3 3. + 0 + 0.0234769992530346 + 3.7760001141577959e-003 + -0.6533370018005371 + <_> + + <_> + + + + <_>4 9 20 6 -1. + <_>14 9 10 3 2. + <_>4 12 10 3 2. + 0 + 0.0317669995129108 + 0.0163640007376671 + 0.5872370004653931 + <_> + + <_> + + + + <_>1 15 19 8 -1. + <_>1 19 19 4 2. + 0 + -0.0184199996292591 + 0.1999389976263046 + -0.3205649852752686 + <_> + + <_> + + + + <_>14 0 10 6 -1. + <_>14 2 10 2 3. + 0 + 0.0195439998060465 + 0.1845020055770874 + -0.2379360049962997 + <_> + + <_> + + + + <_>1 10 21 14 -1. + <_>8 10 7 14 3. + 0 + 0.4115949869155884 + -0.0603820011019707 + -1.6072119474411011 + <_> + + <_> + + + + <_>10 10 8 8 -1. + <_>10 10 4 8 2. + 0 + -0.0415959991514683 + -0.3275620043277741 + 0.1505800038576126 + <_> + + <_> + + + + <_>6 8 10 4 -1. + <_>11 8 5 4 2. + 0 + -0.0103359995409846 + -0.6239439845085144 + 0.0131120001897216 + <_> + + <_> + + + + <_>10 5 4 9 -1. + <_>10 5 2 9 2. + 0 + 0.0123929996043444 + -0.0331149995326996 + 0.5557990074157715 + <_> + + <_> + + + + <_>7 5 6 10 -1. + <_>9 5 2 10 3. + 0 + -8.7270000949501991e-003 + 0.1988320052623749 + -0.3763560056686401 + <_> + + <_> + + + + <_>14 4 4 13 -1. + <_>14 4 2 13 2. + 0 + 0.0162950009107590 + 0.2037300020456314 + -0.4280079901218414 + <_> + + <_> + + + + <_>6 4 4 13 -1. + <_>8 4 2 13 2. + 0 + -0.0104839997366071 + -0.5684700012207031 + 0.0441990010440350 + <_> + + <_> + + + + <_>8 7 9 6 -1. + <_>11 7 3 6 3. + 0 + -0.0124319996684790 + 0.7464190125465393 + 0.0436789989471436 + <_> + + <_> + + + + <_>3 6 16 6 -1. + <_>3 6 8 3 2. + <_>11 9 8 3 2. + 0 + -0.0503749996423721 + 0.8509010076522827 + -0.1777379959821701 + <_> + + <_> + + + + <_>5 4 16 14 -1. + <_>13 4 8 7 2. + <_>5 11 8 7 2. + 0 + 0.0495480000972748 + 0.1678490042686462 + -0.2987749874591827 + <_> + + <_> + + + + <_>0 0 24 4 -1. + <_>0 0 12 2 2. + <_>12 2 12 2 2. + 0 + -0.0410850010812283 + -1.3302919864654541 + -0.0491820015013218 + <_> + + <_> + + + + <_>9 1 9 6 -1. + <_>12 1 3 6 3. + 0 + 1.0069999843835831e-003 + -0.0605389997363091 + 0.1848320066928864 + <_> + + <_> + + + + <_>4 1 14 4 -1. + <_>11 1 7 4 2. + 0 + -0.0501429997384548 + 0.7644770145416260 + -0.1835699975490570 + <_> + + <_> + + + + <_>10 14 7 9 -1. + <_>10 17 7 3 3. + 0 + -8.7879998609423637e-003 + 0.2265599966049194 + -0.0631569996476173 + <_> + + <_> + + + + <_>8 3 8 10 -1. + <_>8 3 4 5 2. + <_>12 8 4 5 2. + 0 + -0.0501709990203381 + -1.5899070501327515 + -0.0612550005316734 + <_> + + <_> + + + + <_>7 3 12 5 -1. + <_>11 3 4 5 3. + 0 + 0.1021609976887703 + 0.1207180023193359 + -1.4120110273361206 + <_> + + <_> + + + + <_>8 2 4 13 -1. + <_>10 2 2 13 2. + 0 + -0.0143729997798800 + -1.3116970062255859 + -0.0519360005855560 + <_> + + <_> + + + + <_>11 2 3 19 -1. + <_>12 2 1 19 3. + 0 + 0.0102819995954633 + -2.1639999467879534e-003 + 0.4424720108509064 + <_> + + <_> + + + + <_>7 7 9 6 -1. + <_>10 7 3 6 3. + 0 + -0.0118140000849962 + 0.6537809967994690 + -0.1872369945049286 + <_> + + <_> + + + + <_>4 22 20 2 -1. + <_>4 22 10 2 2. + 0 + 0.0721149966120720 + 0.0718469992280006 + 0.8149629831314087 + <_> + + <_> + + + + <_>0 16 24 4 -1. + <_>0 16 12 2 2. + <_>12 18 12 2 2. + 0 + -0.0190019998699427 + -0.6742720007896423 + -4.3200000072829425e-004 + <_> + + <_> + + + + <_>7 3 12 5 -1. + <_>11 3 4 5 3. + 0 + -4.6990001574158669e-003 + 0.3331150114536285 + 0.0557940006256104 + <_> + + <_> + + + + <_>1 10 8 14 -1. + <_>1 10 4 7 2. + <_>5 17 4 7 2. + 0 + -0.0581570006906986 + 0.4557229876518250 + -0.2030510008335114 + <_> + + <_> + + + + <_>11 16 6 6 -1. + <_>11 19 6 3 2. + 0 + 1.1360000353306532e-003 + -0.0446869991719723 + 0.2268189936876297 + <_> + + <_> + + + + <_>6 0 10 24 -1. + <_>6 0 5 12 2. + <_>11 12 5 12 2. + 0 + -0.0494149997830391 + 0.2669459879398346 + -0.2611699998378754 + <_> + + <_> + + + + <_>7 5 14 14 -1. + <_>14 5 7 7 2. + <_>7 12 7 7 2. + 0 + -0.1191380023956299 + -0.8301799893379211 + 0.1324850022792816 + <_> + + <_> + + + + <_>7 8 10 8 -1. + <_>7 8 5 4 2. + <_>12 12 5 4 2. + 0 + -0.0183039996773005 + -0.6749920248985291 + 0.0170920006930828 + <_> + + <_> + + + + <_>9 1 9 6 -1. + <_>12 1 3 6 3. + 0 + -7.9199997708201408e-003 + -0.0722870007157326 + 0.1442580074071884 + <_> + + <_> + + + + <_>0 6 24 3 -1. + <_>12 6 12 3 2. + 0 + 0.0519259981811047 + 0.0309219993650913 + -0.5586060285568237 + <_> + + <_> + + + + <_>7 3 12 5 -1. + <_>11 3 4 5 3. + 0 + 0.0667240023612976 + 0.1366640031337738 + -0.2941100001335144 + <_> + + <_> + + + + <_>1 13 22 4 -1. + <_>1 13 11 2 2. + <_>12 15 11 2 2. + 0 + -0.0137780001387000 + -0.5944390296936035 + 0.0153000000864267 + <_> + + <_> + + + + <_>9 12 12 6 -1. + <_>9 14 12 2 3. + 0 + -0.0177609995007515 + 0.4049650132656097 + -3.3559999428689480e-003 + <_> + + <_> + + + + <_>0 5 9 6 -1. + <_>0 7 9 2 3. + 0 + -0.0422349981963634 + -1.0897940397262573 + -0.0402249991893768 + <_> + + <_> + + + + <_>1 5 23 6 -1. + <_>1 7 23 2 3. + 0 + -0.0135249998420477 + 0.2892189919948578 + -0.2519479990005493 + <_> + + <_> + + + + <_>1 6 19 12 -1. + <_>1 10 19 4 3. + 0 + -0.0111060002818704 + 0.6531280279159546 + -0.1805370002985001 + <_> + + <_> + + + + <_>9 1 6 21 -1. + <_>9 8 6 7 3. + 0 + -0.1228459998965263 + -1.9570649862289429 + 0.1481540054082871 + <_> + + <_> + + + + <_>3 19 18 3 -1. + <_>9 19 6 3 3. + 0 + 0.0477159991860390 + -0.2287559956312180 + 0.3423370122909546 + <_> + + <_> + + + + <_>9 14 6 9 -1. + <_>11 14 2 9 3. + 0 + 0.0318170003592968 + 0.1597629934549332 + -1.0091969966888428 + <_> + + <_> + + + + <_>9 6 4 12 -1. + <_>11 6 2 12 2. + 0 + 4.2570000514388084e-003 + -0.3888129889965057 + 0.0842100009322166 + <_> + + <_> + + + + <_>16 0 6 9 -1. + <_>18 0 2 9 3. + 0 + -0.0613729991018772 + 1.7152810096740723 + 0.0593249984085560 + <_> + + <_> + + + + <_>2 0 6 9 -1. + <_>4 0 2 9 3. + 0 + -2.7030000928789377e-003 + -0.3816170096397400 + 0.0851270034909248 + <_> + + <_> + + + + <_>13 1 4 22 -1. + <_>15 1 2 11 2. + <_>13 12 2 11 2. + 0 + -0.0685440003871918 + -3.0925889015197754 + 0.1178800016641617 + <_> + + <_> + + + + <_>1 8 8 12 -1. + <_>1 14 8 6 2. + 0 + 0.1037250012159348 + -0.1376930028200150 + 1.9009410142898560 + <_> + + <_> + + + + <_>14 7 7 9 -1. + <_>14 10 7 3 3. + 0 + 0.0157990008592606 + -0.0626600012183189 + 0.2591769993305206 + <_> + + <_> + + + + <_>3 12 18 4 -1. + <_>3 12 9 2 2. + <_>12 14 9 2 2. + 0 + -9.8040001466870308e-003 + -0.5629159808158875 + 0.0439230017364025 + <_> + + <_> + + + + <_>13 1 4 22 -1. + <_>15 1 2 11 2. + <_>13 12 2 11 2. + 0 + -9.0229995548725128e-003 + 0.2528710067272186 + -0.0412259995937347 + <_> + + <_> + + + + <_>7 1 4 22 -1. + <_>7 1 2 11 2. + <_>9 12 2 11 2. + 0 + -0.0637549981474876 + -2.6178569793701172 + -0.0740059986710548 + <_> + + <_> + + + + <_>4 7 20 4 -1. + <_>14 7 10 2 2. + <_>4 9 10 2 2. + 0 + 0.0389549992978573 + 0.0590329989790916 + 0.8594560027122498 + <_> + + <_> + + + + <_>9 10 6 7 -1. + <_>12 10 3 7 2. + 0 + -0.0398029983043671 + 0.9360049962997437 + -0.1563940048217773 + <_> + + <_> + + + + <_>7 7 10 4 -1. + <_>7 7 5 4 2. + 0 + 0.0503019988536835 + 0.1372590065002441 + -2.5549728870391846 + <_> + + <_> + + + + <_>0 3 4 15 -1. + <_>0 8 4 5 3. + 0 + 0.0462500005960464 + -0.0139640001580119 + -0.7102620005607605 + <_> + + <_> + + + + <_>15 0 8 12 -1. + <_>19 0 4 6 2. + <_>15 6 4 6 2. + 0 + 0.0621960014104843 + 0.0595260001718998 + 1.6509100198745728 + <_> + + <_> + + + + <_>1 0 8 12 -1. + <_>1 0 4 6 2. + <_>5 6 4 6 2. + 0 + -0.0647760033607483 + 0.7136899828910828 + -0.1727000027894974 + <_> + + <_> + + + + <_>14 5 6 16 -1. + <_>16 5 2 16 3. + 0 + 0.0275229997932911 + 0.1463160067796707 + -0.0814289972186089 + <_> + + <_> + + + + <_>4 5 6 16 -1. + <_>6 5 2 16 3. + 0 + 3.9900001138448715e-004 + -0.3714450001716614 + 0.1015269979834557 + <_> + + <_> + + + + <_>15 0 6 16 -1. + <_>17 0 2 16 3. + 0 + -4.3299999088048935e-003 + -0.2375629991292954 + 0.2679840028285980 + <_> + + <_> + + + + <_>3 0 6 16 -1. + <_>5 0 2 16 3. + 0 + 0.0472970008850098 + -0.0276820007711649 + -0.8491029739379883 + <_> + + <_> + + + + <_>0 2 24 3 -1. + <_>0 3 24 1 3. + 0 + 0.0125089995563030 + 0.1873019933700562 + -0.5600110292434692 + <_> + + <_> + + + + <_>7 1 10 4 -1. + <_>7 3 10 2 2. + 0 + 0.0458990000188351 + -0.1560119986534119 + 0.9707300066947937 + <_> + + <_> + + + + <_>1 0 23 8 -1. + <_>1 4 23 4 2. + 0 + 0.1985339969396591 + 0.1489550024271011 + -1.1015529632568359 + <_> + + <_> + + + + <_>1 17 19 3 -1. + <_>1 18 19 1 3. + 0 + 0.0166749991476536 + -0.1661529988050461 + 0.8221099972724915 + <_> + + <_> + + + + <_>6 18 18 2 -1. + <_>6 19 18 1 2. + 0 + 1.9829999655485153e-003 + -0.0712499991059303 + 0.2881090044975281 + <_> + + <_> + + + + <_>1 17 9 6 -1. + <_>1 19 9 2 3. + 0 + 0.0224479995667934 + -0.0209810007363558 + -0.7841650247573853 + <_> + + <_> + + + + <_>15 15 6 9 -1. + <_>15 18 6 3 3. + 0 + -0.0139130000025034 + -0.1816579997539520 + 0.2049179971218109 + <_> + + <_> + + + + <_>3 15 6 9 -1. + <_>3 18 6 3 3. + 0 + -7.7659999951720238e-003 + -0.4559589922428131 + 0.0635769963264465 + <_> + + <_> + + + + <_>4 14 20 6 -1. + <_>4 17 20 3 2. + 0 + -0.0132090002298355 + 0.2663230001926422 + -0.1779599934816361 + <_> + + <_> + + + + <_>0 10 6 14 -1. + <_>0 10 3 7 2. + <_>3 17 3 7 2. + 0 + 0.0490529984235764 + -0.1547680050134659 + 1.1069979667663574 + <_> + + <_> + + + + <_>6 18 18 3 -1. + <_>6 19 18 1 3. + 0 + 0.0202639997005463 + 0.0689150020480156 + 0.6986749768257141 + <_> + + <_> + + + + <_>4 12 9 7 -1. + <_>7 12 3 7 3. + 0 + -0.0168280005455017 + 0.2760719954967499 + -0.2513920068740845 + <_> + + <_> + + + + <_>6 10 18 5 -1. + <_>12 10 6 5 3. + 0 + -0.1693949997425079 + -3.0767529010772705 + 0.1161750033497810 + <_> + + <_> + + + + <_>0 10 18 5 -1. + <_>6 10 6 5 3. + 0 + -0.1133610010147095 + -1.4639229774475098 + -0.0514470003545284 + <_> + + <_> + + + + <_>3 2 18 9 -1. + <_>9 2 6 9 3. + 0 + -0.0776859968900681 + 0.8843020200729370 + 0.0433069989085197 + <_> + + <_> + + + + <_>4 6 10 10 -1. + <_>4 6 5 5 2. + <_>9 11 5 5 2. + 0 + -0.0155680002644658 + 0.1367249935865402 + -0.3450550138950348 + <_> + + <_> + + + + <_>20 14 4 9 -1. + <_>20 14 2 9 2. + 0 + -0.0660189986228943 + -1.0300110578536987 + 0.1160139963030815 + <_> + + <_> + + + + <_>0 14 4 9 -1. + <_>2 14 2 9 2. + 0 + 8.3699999377131462e-003 + 0.0764290019869804 + -0.4400250017642975 + <_> + + <_> + + + + <_>11 1 4 20 -1. + <_>13 1 2 10 2. + <_>11 11 2 10 2. + 0 + 0.0354029983282089 + 0.1197950020432472 + -0.7266830205917358 + <_> + + <_> + + + + <_>6 21 12 3 -1. + <_>12 21 6 3 2. + 0 + -0.0390510000288486 + 0.6737530231475830 + -0.1819600015878677 + <_> + + <_> + + + + <_>11 1 4 20 -1. + <_>13 1 2 10 2. + <_>11 11 2 10 2. + 0 + -9.7899995744228363e-003 + 0.2126459926366806 + 0.0367560014128685 + <_> + + <_> + + + + <_>1 16 10 8 -1. + <_>1 16 5 4 2. + <_>6 20 5 4 2. + 0 + -0.0230470001697540 + 0.4474219977855682 + -0.2098670005798340 + <_> + + <_> + + + + <_>11 1 4 20 -1. + <_>13 1 2 10 2. + <_>11 11 2 10 2. + 0 + 3.1169999856501818e-003 + 0.0375440008938313 + 0.2780820131301880 + <_> + + <_> + + + + <_>1 0 3 19 -1. + <_>2 0 1 19 3. + 0 + 0.0131360003724694 + -0.1984239965677261 + 0.5433570146560669 + <_> + + <_> + + + + <_>11 1 4 20 -1. + <_>13 1 2 10 2. + <_>11 11 2 10 2. + 0 + 0.0147820003330708 + 0.1353060007095337 + -0.1115360036492348 + <_> + + <_> + + + + <_>0 1 6 9 -1. + <_>2 1 2 9 3. + 0 + -0.0601390004158020 + 0.8403930068016052 + -0.1671160012483597 + <_> + + <_> + + + + <_>3 7 19 4 -1. + <_>3 9 19 2 2. + 0 + 0.0519989989697933 + 0.1737200021743774 + -0.7854760289192200 + <_> + + <_> + + + + <_>7 14 9 6 -1. + <_>7 16 9 2 3. + 0 + 0.0247920006513596 + -0.1773920059204102 + 0.6675260066986084 + <_> + + <_> + + + + <_>17 1 7 6 -1. + <_>17 4 7 3 2. + 0 + -0.0120149999856949 + -0.1426369994878769 + 0.1607050001621246 + <_> + + <_> + + + + <_>5 0 14 8 -1. + <_>5 4 14 4 2. + 0 + -0.0986559987068176 + 1.0429769754409790 + -0.1577019989490509 + <_> + + <_> + + + + <_>16 1 8 6 -1. + <_>16 4 8 3 2. + 0 + 0.1175829991698265 + 0.1095570027828217 + -4.4920377731323242 + <_> + + <_> + + + + <_>0 1 8 6 -1. + <_>0 4 8 3 2. + 0 + -0.0189229995012283 + -0.7854340076446533 + 0.0129840001463890 + <_> + + <_> + + + + <_>6 0 18 4 -1. + <_>15 0 9 2 2. + <_>6 2 9 2 2. + 0 + -0.0283909998834133 + -0.6056990027427673 + 0.1290349960327148 + <_> + + <_> + + + + <_>0 14 9 6 -1. + <_>0 16 9 2 3. + 0 + 0.0131829995661974 + -0.0144159998744726 + -0.7321050167083740 + <_> + + <_> + + + + <_>3 7 18 8 -1. + <_>9 7 6 8 3. + 0 + -0.1165300011634827 + -2.0442469120025635 + 0.1405310034751892 + <_> + + <_> + + + + <_>2 11 6 9 -1. + <_>4 11 2 9 3. + 0 + -3.8880000356584787e-003 + -0.4186159968376160 + 0.0787049978971481 + <_> + + <_> + + + + <_>10 5 6 9 -1. + <_>12 5 2 9 3. + 0 + 0.0312290005385876 + 0.0246329996734858 + 0.4187040030956268 + <_> + + <_> + + + + <_>10 6 4 18 -1. + <_>10 6 2 9 2. + <_>12 15 2 9 2. + 0 + 0.0251989997923374 + -0.1755779981613159 + 0.6471059918403626 + <_> + + <_> + + + + <_>11 1 4 20 -1. + <_>13 1 2 10 2. + <_>11 11 2 10 2. + 0 + -0.0281240008771420 + -0.2200559973716736 + 0.1412100046873093 + <_> + + <_> + + + + <_>9 1 4 20 -1. + <_>9 1 2 10 2. + <_>11 11 2 10 2. + 0 + 0.0364990010857582 + -0.0684269964694977 + -2.3410849571228027 + <_> + + <_> + + + + <_>5 9 18 6 -1. + <_>14 9 9 3 2. + <_>5 12 9 3 2. + 0 + -0.0722929984331131 + 1.2898750305175781 + 0.0848750025033951 + <_> + + <_> + + + + <_>6 4 6 9 -1. + <_>8 4 2 9 3. + 0 + -0.0416710004210472 + -1.1630970239639282 + -0.0537529997527599 + <_> + + <_> + + + + <_>10 16 8 6 -1. + <_>10 16 4 6 2. + 0 + 0.0477030016481876 + 0.0701010003685951 + 0.7367650270462036 + <_> + + <_> + + + + <_>0 0 18 8 -1. + <_>0 0 9 4 2. + <_>9 4 9 4 2. + 0 + 0.0657930001616478 + -0.1775529980659485 + 0.6978049874305725 + <_> + + <_> + + + + <_>6 5 14 12 -1. + <_>13 5 7 6 2. + <_>6 11 7 6 2. + 0 + 0.0139049999415874 + 0.2193679958581924 + -0.2039079964160919 + <_> + + <_> + + + + <_>4 3 15 7 -1. + <_>9 3 5 7 3. + 0 + -0.0277309995144606 + 0.6186789870262146 + -0.1780409961938858 + <_> + + <_> + + + + <_>14 12 10 6 -1. + <_>14 14 10 2 3. + 0 + -0.0158799998462200 + -0.4648410081863403 + 0.1882860064506531 + <_> + + <_> + + + + <_>0 11 4 10 -1. + <_>0 16 4 5 2. + 0 + 0.0741280019283295 + -0.1285810023546219 + 3.2792479991912842 + <_> + + <_> + + + + <_>1 10 22 3 -1. + <_>1 11 22 1 3. + 0 + -8.9000002481043339e-004 + -0.3011760115623474 + 0.2381879985332489 + <_> + + <_> + + + + <_>8 9 6 10 -1. + <_>10 9 2 10 3. + 0 + 0.0179650001227856 + -0.2228499948978424 + 0.2995400130748749 + <_> + + <_> + + + + <_>13 2 6 12 -1. + <_>16 2 3 6 2. + <_>13 8 3 6 2. + 0 + -2.5380000006407499e-003 + 0.2506439983844757 + -0.1366560012102127 + <_> + + <_> + + + + <_>10 6 4 18 -1. + <_>10 6 2 9 2. + <_>12 15 2 9 2. + 0 + -9.0680001303553581e-003 + 0.2901749908924103 + -0.2892970144748688 + <_> + + <_> + + + + <_>7 8 10 16 -1. + <_>12 8 5 8 2. + <_>7 16 5 8 2. + 0 + 0.0491699986159801 + 0.1915639936923981 + -0.6832870244979858 + <_> + + <_> + + + + <_>8 1 8 12 -1. + <_>8 1 4 6 2. + <_>12 7 4 6 2. + 0 + -0.0306809991598129 + -0.7567700147628784 + -0.0132799996063113 + <_> + + <_> + + + + <_>7 1 12 14 -1. + <_>13 1 6 7 2. + <_>7 8 6 7 2. + 0 + 0.1001740023493767 + 0.0844539999961853 + 1.0888710021972656 + <_> + + <_> + + + + <_>2 14 12 6 -1. + <_>2 16 12 2 3. + 0 + 3.1950001139193773e-003 + -0.2691940069198608 + 0.1953790038824081 + <_> + + <_> + + + + <_>11 16 6 6 -1. + <_>11 19 6 3 2. + 0 + 0.0355030000209808 + 0.1363230049610138 + -0.5691720247268677 + <_> + + <_> + + + + <_>7 16 6 6 -1. + <_>7 19 6 3 2. + 0 + 4.5900000259280205e-004 + -0.4044399857521057 + 0.1407479941844940 + <_> + + <_> + + + + <_>13 4 4 10 -1. + <_>13 4 2 10 2. + 0 + 0.0252589993178844 + 0.1624320000410080 + -0.5574179887771606 + <_> + + <_> + + + + <_>0 19 19 3 -1. + <_>0 20 19 1 3. + 0 + -5.1549999043345451e-003 + 0.3113259971141815 + -0.2275609970092773 + <_> + + <_> + + + + <_>12 8 6 8 -1. + <_>12 12 6 4 2. + 0 + 1.5869999770075083e-003 + -0.2686769962310791 + 0.1956540048122406 + <_> + + <_> + + + + <_>8 1 8 22 -1. + <_>8 12 8 11 2. + 0 + -0.0162049997597933 + 0.1548649966716766 + -0.3405779898166657 + <_> + + <_> + + + + <_>12 8 6 8 -1. + <_>12 12 6 4 2. + 0 + -0.0296240001916885 + 1.1466799974441528 + 0.0905579999089241 + <_> + + <_> + + + + <_>6 8 6 8 -1. + <_>6 12 6 4 2. + 0 + -1.5930000226944685e-003 + -0.7125750184059143 + -7.0400000549852848e-004 + <_> + + <_> + + + + <_>14 5 6 9 -1. + <_>14 8 6 3 3. + 0 + -0.0540190003812313 + 0.4153749942779541 + 0.0272460002452135 + <_> + + <_> + + + + <_>0 6 24 4 -1. + <_>0 8 24 2 2. + 0 + -0.0662110000848770 + -1.3340090513229370 + -0.0473529994487762 + <_> + + <_> + + + + <_>14 12 10 6 -1. + <_>14 14 10 2 3. + 0 + 0.0279409997165203 + 0.1444630026817322 + -0.5151839852333069 + <_> + + <_> + + + + <_>0 12 10 6 -1. + <_>0 14 10 2 3. + 0 + 0.0289570000022650 + -0.0499660000205040 + -1.1929039955139160 + <_> + + <_> + + + + <_>4 6 19 3 -1. + <_>4 7 19 1 3. + 0 + -0.0204249992966652 + 0.6388130187988281 + 0.0381410010159016 + <_> + + <_> + + + + <_>1 6 19 3 -1. + <_>1 7 19 1 3. + 0 + 0.0124169997870922 + -0.2154700011014938 + 0.4947769939899445 + -3.2772979736328125 + 19 + -1 + <_> + + + <_> + + <_> + + + + <_>4 0 16 9 -1. + <_>4 3 16 3 3. + 0 + 0.0432740002870560 + -0.8049439787864685 + 0.3989729881286621 + <_> + + <_> + + + + <_>0 1 24 5 -1. + <_>8 1 8 5 3. + 0 + 0.1861550062894821 + -0.3165529966354370 + 0.6887729763984680 + <_> + + <_> + + + + <_>3 6 6 15 -1. + <_>3 11 6 5 3. + 0 + 0.0318609997630119 + -0.6426619887351990 + 0.2555089890956879 + <_> + + <_> + + + + <_>9 6 6 9 -1. + <_>11 6 2 9 3. + 0 + 0.0140220001339912 + -0.4592660069465637 + 0.3117119967937470 + <_> + + <_> + + + + <_>0 17 18 3 -1. + <_>0 18 18 1 3. + 0 + -6.3029997982084751e-003 + 0.4602690041065216 + -0.2743850052356720 + <_> + + <_> + + + + <_>6 22 18 2 -1. + <_>6 23 18 1 2. + 0 + -5.4310001432895660e-003 + 0.3660860061645508 + -0.2720580101013184 + <_> + + <_> + + + + <_>2 12 6 9 -1. + <_>2 15 6 3 3. + 0 + 0.0168229993432760 + 0.0234769992530346 + -0.8844379782676697 + <_> + + <_> + + + + <_>18 12 6 9 -1. + <_>18 15 6 3 3. + 0 + 0.0260390006005764 + 0.1748879998922348 + -0.5456470251083374 + <_> + + <_> + + + + <_>0 12 6 9 -1. + <_>0 15 6 3 3. + 0 + -0.0267200004309416 + -0.9639649987220764 + 0.0235249996185303 + <_> + + <_> + + + + <_>11 14 4 10 -1. + <_>11 19 4 5 2. + 0 + -0.0170419998466969 + -0.7084879875183106 + 0.2146809995174408 + <_> + + <_> + + + + <_>9 6 6 16 -1. + <_>9 14 6 8 2. + 0 + 5.9569999575614929e-003 + 0.0736010000109673 + -0.6822559833526611 + <_> + + <_> + + + + <_>7 7 10 10 -1. + <_>7 12 10 5 2. + 0 + -2.8679999522864819e-003 + -0.7493500113487244 + 0.2380339950323105 + <_> + + <_> + + + + <_>1 3 6 13 -1. + <_>3 3 2 13 3. + 0 + -0.0437749996781349 + 0.6832330226898193 + -0.2138029932975769 + <_> + + <_> + + + + <_>18 1 6 13 -1. + <_>18 1 3 13 2. + 0 + 0.0516330003738403 + -0.1256649941205978 + 0.6752380132675171 + <_> + + <_> + + + + <_>5 1 6 9 -1. + <_>7 1 2 9 3. + 0 + 8.1780003383755684e-003 + 0.0706899985671043 + -0.8066589832305908 + <_> + + <_> + + + + <_>18 2 6 11 -1. + <_>18 2 3 11 2. + 0 + -0.0528419986367226 + 0.9543390274047852 + 0.0165480002760887 + <_> + + <_> + + + + <_>0 2 6 11 -1. + <_>3 2 3 11 2. + 0 + 0.0525839999318123 + -0.2841440141201019 + 0.4712980091571808 + <_> + + <_> + + + + <_>9 12 15 6 -1. + <_>9 14 15 2 3. + 0 + -0.0126590002328157 + 0.3844540119171143 + -0.0622880011796951 + <_> + + <_> + + + + <_>2 2 20 3 -1. + <_>2 3 20 1 3. + 0 + 0.0116940001025796 + 5.6000000768108293e-005 + -1.0173139572143555 + <_> + + <_> + + + + <_>10 6 4 9 -1. + <_>10 6 2 9 2. + 0 + -0.0239189993590117 + 0.8492130041122437 + 5.7399999350309372e-003 + <_> + + <_> + + + + <_>5 6 12 14 -1. + <_>5 6 6 7 2. + <_>11 13 6 7 2. + 0 + -0.0616739988327026 + -0.9257140159606934 + -1.7679999582469463e-003 + <_> + + <_> + + + + <_>9 0 6 9 -1. + <_>11 0 2 9 3. + 0 + -1.8279999494552612e-003 + -0.5437229871749878 + 0.2493239939212799 + <_> + + <_> + + + + <_>7 0 9 6 -1. + <_>10 0 3 6 3. + 0 + 0.0352579988539219 + -7.3719997890293598e-003 + -0.9396399855613709 + <_> + + <_> + + + + <_>10 6 6 9 -1. + <_>12 6 2 9 3. + 0 + -0.0184380002319813 + 0.7213670015335083 + 0.0104919997975230 + <_> + + <_> + + + + <_>4 1 12 20 -1. + <_>4 1 6 10 2. + <_>10 11 6 10 2. + 0 + -0.0383890010416508 + 0.1927260011434555 + -0.3583210110664368 + <_> + + <_> + + + + <_>6 7 18 3 -1. + <_>6 7 9 3 2. + 0 + 0.0997209995985031 + 0.1135419979691505 + -1.6304190158843994 + <_> + + <_> + + + + <_>0 7 18 3 -1. + <_>9 7 9 3 2. + 0 + 0.0844620019197464 + -0.0534209981560707 + -1.6981120109558105 + <_> + + <_> + + + + <_>3 20 18 3 -1. + <_>9 20 6 3 3. + 0 + 0.0402700006961823 + -0.1078319996595383 + 0.5192660093307495 + <_> + + <_> + + + + <_>9 6 6 9 -1. + <_>11 6 2 9 3. + 0 + 0.0589359998703003 + -0.1805370002985001 + 0.9511979818344116 + <_> + + <_> + + + + <_>6 2 12 15 -1. + <_>10 2 4 15 3. + 0 + 0.1495700031518936 + 0.1678529977798462 + -1.1591869592666626 + <_> + + <_> + + + + <_>2 3 18 3 -1. + <_>2 4 18 1 3. + 0 + 6.9399998756125569e-004 + 0.2049140036106110 + -0.3311820030212402 + <_> + + <_> + + + + <_>19 4 4 18 -1. + <_>21 4 2 9 2. + <_>19 13 2 9 2. + 0 + -0.0333690010011196 + 0.9346809983253479 + -2.9639999847859144e-003 + <_> + + <_> + + + + <_>0 1 19 3 -1. + <_>0 2 19 1 3. + 0 + 9.3759996816515923e-003 + 3.7000000011175871e-003 + -0.7754979729652405 + <_> + + <_> + + + + <_>5 0 15 4 -1. + <_>5 2 15 2 2. + 0 + 0.0431939996778965 + -2.2040000185370445e-003 + 0.7458969950675964 + <_> + + <_> + + + + <_>5 2 14 5 -1. + <_>12 2 7 5 2. + 0 + -0.0675550028681755 + 0.7229210138320923 + -0.1840420067310333 + <_> + + <_> + + + + <_>1 2 22 14 -1. + <_>1 2 11 14 2. + 0 + -0.3116860091686249 + 1.0014270544052124 + 0.0340030007064343 + <_> + + <_> + + + + <_>8 15 6 9 -1. + <_>10 15 2 9 3. + 0 + 0.0297439992427826 + -0.0463560000061989 + -1.2781809568405151 + <_> + + <_> + + + + <_>6 17 18 3 -1. + <_>6 18 18 1 3. + 0 + 0.0107370000332594 + 0.0148120000958443 + 0.6664999723434448 + <_> + + <_> + + + + <_>9 6 3 18 -1. + <_>9 12 3 6 3. + 0 + -0.0288410000503063 + -0.9422259926795960 + -0.0207969993352890 + <_> + + <_> + + + + <_>2 0 20 3 -1. + <_>2 1 20 1 3. + 0 + -5.7649998925626278e-003 + -0.4354189932346344 + 0.2338600009679794 + <_> + + <_> + + + + <_>5 4 5 12 -1. + <_>5 8 5 4 3. + 0 + 0.0284109991043806 + -0.1761579960584641 + 0.8576530218124390 + <_> + + <_> + + + + <_>8 6 12 5 -1. + <_>12 6 4 5 3. + 0 + -0.0290079992264509 + 0.5797809958457947 + 0.0285659991204739 + <_> + + <_> + + + + <_>9 12 6 12 -1. + <_>9 12 3 6 2. + <_>12 18 3 6 2. + 0 + 0.0249659996479750 + -0.0227290000766516 + -0.9677309989929199 + <_> + + <_> + + + + <_>14 14 8 10 -1. + <_>18 14 4 5 2. + <_>14 19 4 5 2. + 0 + 0.0120360003784299 + -0.1421470046043396 + 0.5168799757957459 + <_> + + <_> + + + + <_>2 14 8 10 -1. + <_>2 14 4 5 2. + <_>6 19 4 5 2. + 0 + -0.0425140000879765 + 0.9727380275726318 + -0.1811980009078980 + <_> + + <_> + + + + <_>10 18 12 6 -1. + <_>16 18 6 3 2. + <_>10 21 6 3 2. + 0 + 0.0102760000154376 + -0.0830999985337257 + 0.3176279962062836 + <_> + + <_> + + + + <_>1 3 6 9 -1. + <_>1 6 6 3 3. + 0 + -0.0691919997334480 + -2.0668580532073975 + -0.0601739995181561 + <_> + + <_> + + + + <_>11 3 3 20 -1. + <_>12 3 1 20 3. + 0 + -4.6769999898970127e-003 + 0.4413180053234100 + 0.0232090000063181 + <_> + + <_> + + + + <_>4 6 14 6 -1. + <_>4 6 7 3 2. + <_>11 9 7 3 2. + 0 + -0.0139239998534322 + 0.2860670089721680 + -0.2915270030498505 + <_> + + <_> + + + + <_>6 5 12 13 -1. + <_>10 5 4 13 3. + 0 + -0.0153339998796582 + -0.5741450190544128 + 0.2306330054998398 + <_> + + <_> + + + + <_>5 4 4 15 -1. + <_>5 9 4 5 3. + 0 + -0.0102390004321933 + 0.3447920083999634 + -0.2608039975166321 + <_> + + <_> + + + + <_>9 16 15 4 -1. + <_>14 16 5 4 3. + 0 + -0.0509889982640743 + 0.5615410208702087 + 0.0612189993262291 + <_> + + <_> + + + + <_>7 8 6 14 -1. + <_>7 8 3 7 2. + <_>10 15 3 7 2. + 0 + 0.0306899994611740 + -0.1477279961109161 + 1.6378489732742310 + <_> + + <_> + + + + <_>7 6 10 6 -1. + <_>7 8 10 2 3. + 0 + -0.0112239997833967 + 0.2400619983673096 + -0.4486489892005920 + <_> + + <_> + + + + <_>2 5 18 3 -1. + <_>2 6 18 1 3. + 0 + -6.2899999320507050e-003 + 0.4311949908733368 + -0.2380899935960770 + <_> + + <_> + + + + <_>5 1 15 8 -1. + <_>5 5 15 4 2. + 0 + 0.0785909965634346 + 0.0198650006204844 + 0.8085380196571350 + <_> + + <_> + + + + <_>7 1 8 18 -1. + <_>7 10 8 9 2. + 0 + -0.0101789999753237 + 0.1819320023059845 + -0.3287779986858368 + <_> + + <_> + + + + <_>0 10 24 3 -1. + <_>0 11 24 1 3. + 0 + 0.0312270000576973 + 0.1497389972209930 + -1.4180339574813843 + <_> + + <_> + + + + <_>0 2 6 13 -1. + <_>2 2 2 13 3. + 0 + 0.0401969999074936 + -0.1976049989461899 + 0.5850819945335388 + <_> + + <_> + + + + <_>16 0 8 10 -1. + <_>20 0 4 5 2. + <_>16 5 4 5 2. + 0 + 0.0161380004137754 + 5.0000002374872565e-004 + 0.3905000090599060 + <_> + + <_> + + + + <_>5 1 10 9 -1. + <_>5 4 10 3 3. + 0 + -0.0455190017819405 + 1.2646820545196533 + -0.1563259959220886 + <_> + + <_> + + + + <_>5 6 18 3 -1. + <_>5 7 18 1 3. + 0 + -0.0181300006806850 + 0.6514850258827210 + 0.0102359997108579 + <_> + + <_> + + + + <_>0 1 24 3 -1. + <_>0 2 24 1 3. + 0 + -0.0140019999817014 + -1.0344820022583008 + -0.0321829989552498 + <_> + + <_> + + + + <_>11 4 6 11 -1. + <_>13 4 2 11 3. + 0 + -0.0388160012662411 + -0.4787429869174957 + 0.1629070043563843 + <_> + + <_> + + + + <_>0 0 8 10 -1. + <_>0 0 4 5 2. + <_>4 5 4 5 2. + 0 + 0.0316560007631779 + -0.2098339945077896 + 0.5457590222358704 + <_> + + <_> + + + + <_>4 16 18 3 -1. + <_>4 17 18 1 3. + 0 + -0.0108399996533990 + 0.5189880132675171 + -0.0150800002738833 + <_> + + <_> + + + + <_>2 16 18 3 -1. + <_>2 17 18 1 3. + 0 + 0.0120329996570945 + -0.2110760062932968 + 0.7593700289726257 + <_> + + <_> + + + + <_>3 0 18 10 -1. + <_>12 0 9 5 2. + <_>3 5 9 5 2. + 0 + 0.0707729980349541 + 0.1804880052804947 + -0.7404850125312805 + <_> + + <_> + + + + <_>2 3 20 21 -1. + <_>12 3 10 21 2. + 0 + 0.5313979983329773 + -0.1449169963598251 + 1.5360039472579956 + <_> + + <_> + + + + <_>6 7 14 3 -1. + <_>6 7 7 3 2. + 0 + -0.0147740002721548 + -0.2815369963645935 + 0.2040729969739914 + <_> + + <_> + + + + <_>0 9 12 6 -1. + <_>0 9 6 3 2. + <_>6 12 6 3 2. + 0 + -2.2410000674426556e-003 + -0.4487630128860474 + 0.0539890006184578 + <_> + + <_> + + + + <_>3 14 21 4 -1. + <_>10 14 7 4 3. + 0 + 0.0499680005013943 + 0.0415140017867088 + 0.2941710054874420 + <_> + + <_> + + + + <_>0 14 21 4 -1. + <_>7 14 7 4 3. + 0 + -0.0477019995450974 + 0.3967429995536804 + -0.2830179929733276 + <_> + + <_> + + + + <_>5 21 18 3 -1. + <_>11 21 6 3 3. + 0 + -0.0913110002875328 + 2.1994259357452393 + 0.0879649966955185 + <_> + + <_> + + + + <_>1 21 18 3 -1. + <_>7 21 6 3 3. + 0 + 0.0380700007081032 + -0.2802560031414032 + 0.2515619993209839 + <_> + + <_> + + + + <_>19 4 4 18 -1. + <_>21 4 2 9 2. + <_>19 13 2 9 2. + 0 + -0.0155389998108149 + 0.3415749967098236 + 0.0179249998182058 + <_> + + <_> + + + + <_>3 7 18 3 -1. + <_>3 8 18 1 3. + 0 + -0.0154459998011589 + 0.2868019938468933 + -0.2513589859008789 + <_> + + <_> + + + + <_>19 4 4 18 -1. + <_>21 4 2 9 2. + <_>19 13 2 9 2. + 0 + -0.0573880001902580 + 0.6383000016212463 + 0.0885979980230331 + <_> + + <_> + + + + <_>7 15 10 6 -1. + <_>7 17 10 2 3. + 0 + -5.9440000914037228e-003 + 0.0790169984102249 + -0.4077489972114563 + <_> + + <_> + + + + <_>9 13 11 9 -1. + <_>9 16 11 3 3. + 0 + -0.0699689984321594 + -0.4464420080184937 + 0.1721960008144379 + <_> + + <_> + + + + <_>0 6 4 10 -1. + <_>0 11 4 5 2. + 0 + -0.0250649992376566 + -0.9827020168304443 + -0.0353880003094673 + <_> + + <_> + + + + <_>15 16 9 6 -1. + <_>15 18 9 2 3. + 0 + 0.0172160007059574 + 0.2270590066909790 + -0.8055009841918945 + <_> + + <_> + + + + <_>1 5 4 18 -1. + <_>1 5 2 9 2. + <_>3 14 2 9 2. + 0 + -0.0442790016531944 + 0.8395199775695801 + -0.1742960065603256 + <_> + + <_> + + + + <_>9 8 8 10 -1. + <_>13 8 4 5 2. + <_>9 13 4 5 2. + 0 + 0.0439889989793301 + 0.1155719980597496 + -1.9666889905929565 + <_> + + <_> + + + + <_>7 8 8 10 -1. + <_>7 8 4 5 2. + <_>11 13 4 5 2. + 0 + 0.0159070007503033 + -0.0375760011374950 + -1.0311100482940674 + <_> + + <_> + + + + <_>9 8 12 5 -1. + <_>13 8 4 5 3. + 0 + -0.0927549973130226 + -1.3530019521713257 + 0.1214129999279976 + <_> + + <_> + + + + <_>7 8 9 7 -1. + <_>10 8 3 7 3. + 0 + 0.0710370019078255 + -0.1768430024385452 + 0.7448520064353943 + <_> + + <_> + + + + <_>9 8 12 5 -1. + <_>13 8 4 5 3. + 0 + 0.0577620007097721 + 0.1283559948205948 + -0.4444420039653778 + <_> + + <_> + + + + <_>7 6 9 7 -1. + <_>10 6 3 7 3. + 0 + -0.0164320003241301 + 0.8015270233154297 + -0.1749169975519180 + <_> + + <_> + + + + <_>9 8 12 5 -1. + <_>13 8 4 5 3. + 0 + 0.0239390004426241 + 0.1614499986171722 + -0.1236450001597405 + <_> + + <_> + + + + <_>10 5 4 18 -1. + <_>10 11 4 6 3. + 0 + 0.0126360002905130 + 0.1541199982166290 + -0.3329379856586456 + <_> + + <_> + + + + <_>5 5 14 12 -1. + <_>5 11 14 6 2. + 0 + -0.0543479993939400 + -1.8400700092315674 + 0.1483599990606308 + <_> + + <_> + + + + <_>0 1 11 4 -1. + <_>0 3 11 2 2. + 0 + -0.0132619999349117 + -0.8083879947662354 + -0.0277260001748800 + <_> + + <_> + + + + <_>9 10 6 10 -1. + <_>11 10 2 10 3. + 0 + 6.1340001411736012e-003 + -0.1378500014543533 + 0.3285849988460541 + <_> + + <_> + + + + <_>2 17 11 6 -1. + <_>2 19 11 2 3. + 0 + 0.0289910007268190 + -0.0255169998854399 + -0.8338720202445984 + <_> + + <_> + + + + <_>15 16 9 6 -1. + <_>15 18 9 2 3. + 0 + -0.0219860002398491 + -0.7373999953269959 + 0.1788710057735443 + <_> + + <_> + + + + <_>1 10 18 2 -1. + <_>1 11 18 1 2. + 0 + 5.3269998170435429e-003 + -0.4544929862022400 + 0.0687910020351410 + <_> + + <_> + + + + <_>6 4 12 13 -1. + <_>10 4 4 13 3. + 0 + 0.0860479995608330 + 0.2100850045681000 + -0.3780890107154846 + <_> + + <_> + + + + <_>0 18 18 3 -1. + <_>0 19 18 1 3. + 0 + -8.5549997165799141e-003 + 0.4013499915599823 + -0.2107409983873367 + <_> + + <_> + + + + <_>6 18 18 3 -1. + <_>6 19 18 1 3. + 0 + 6.7790001630783081e-003 + -0.0216489993035793 + 0.4542149901390076 + <_> + + <_> + + + + <_>0 16 9 6 -1. + <_>0 18 9 2 3. + 0 + -6.3959998078644276e-003 + -0.4981859922409058 + 0.0759079977869987 + <_> + + <_> + + + + <_>13 15 9 6 -1. + <_>13 17 9 2 3. + 0 + 8.9469999074935913e-003 + 0.1785770058631897 + -0.2845489978790283 + <_> + + <_> + + + + <_>2 15 9 6 -1. + <_>2 17 9 2 3. + 0 + 3.2589999027550220e-003 + 0.0466249994933605 + -0.5520629882812500 + <_> + + <_> + + + + <_>13 1 6 16 -1. + <_>13 1 3 16 2. + 0 + 0.0414769984781742 + 0.1755049973726273 + -0.2070399969816208 + <_> + + <_> + + + + <_>5 1 6 16 -1. + <_>8 1 3 16 2. + 0 + -6.7449999041855335e-003 + -0.4639259874820709 + 0.0693039968609810 + <_> + + <_> + + + + <_>11 5 6 10 -1. + <_>13 5 2 10 3. + 0 + 0.0305649992078543 + 0.0517349988222122 + 0.7555050253868103 + <_> + + <_> + + + + <_>7 5 6 10 -1. + <_>9 5 2 10 3. + 0 + -7.4780001305043697e-003 + 0.1489389985799789 + -0.3190680146217346 + <_> + + <_> + + + + <_>10 0 6 24 -1. + <_>12 0 2 24 3. + 0 + 0.0890889987349510 + 0.1373880058526993 + -1.1379710435867310 + <_> + + <_> + + + + <_>3 4 4 20 -1. + <_>3 4 2 10 2. + <_>5 14 2 10 2. + 0 + 7.3230001144111156e-003 + -0.2882919907569885 + 0.1908860057592392 + <_> + + <_> + + + + <_>14 0 6 9 -1. + <_>16 0 2 9 3. + 0 + -0.0182050000876188 + -0.3017860054969788 + 0.1679580062627792 + <_> + + <_> + + + + <_>4 0 6 9 -1. + <_>6 0 2 9 3. + 0 + -0.0258280001580715 + -0.9813799858093262 + -0.0198609996587038 + <_> + + <_> + + + + <_>4 5 18 5 -1. + <_>10 5 6 5 3. + 0 + 0.1093619987368584 + 0.0487900003790855 + 0.5311830043792725 + <_> + + <_> + + + + <_>5 6 6 9 -1. + <_>7 6 2 9 3. + 0 + -0.0114249996840954 + 0.2370599955320358 + -0.2792530059814453 + <_> + + <_> + + + + <_>7 2 15 8 -1. + <_>12 2 5 8 3. + 0 + -0.0575659982860088 + 0.4725539982318878 + 0.0651710033416748 + <_> + + <_> + + + + <_>2 2 15 8 -1. + <_>7 2 5 8 3. + 0 + 0.1027830019593239 + -0.2076510041952133 + 0.5094770193099976 + <_> + + <_> + + + + <_>10 0 4 9 -1. + <_>10 0 2 9 2. + 0 + 0.0270419996231794 + 0.1642120033502579 + -1.4508620500564575 + <_> + + <_> + + + + <_>3 4 6 12 -1. + <_>3 4 3 6 2. + <_>6 10 3 6 2. + 0 + -0.0136350002139807 + -0.5654389858245850 + 0.0237889997661114 + <_> + + <_> + + + + <_>16 0 8 18 -1. + <_>16 0 4 18 2. + 0 + -0.3215819895267487 + -3.5602829456329346 + 0.1180130019783974 + <_> + + <_> + + + + <_>0 0 8 18 -1. + <_>4 0 4 18 2. + 0 + 0.2045810073614121 + -0.0370160005986691 + -1.0225499868392944 + <_> + + <_> + + + + <_>0 7 24 6 -1. + <_>0 9 24 2 3. + 0 + -0.0703470036387444 + -0.5649189949035645 + 0.1852519959211350 + <_> + + <_> + + + + <_>4 7 14 3 -1. + <_>11 7 7 3 2. + 0 + 0.0378310009837151 + -0.0299019999802113 + -0.8292149901390076 + <_> + + <_> + + + + <_>10 8 8 15 -1. + <_>10 8 4 15 2. + 0 + -0.0702980011701584 + -0.5317230224609375 + 0.1443019956350327 + <_> + + <_> + + + + <_>7 0 10 14 -1. + <_>12 0 5 14 2. + 0 + 0.0632210001349449 + -0.2204120010137558 + 0.4795219898223877 + <_> + + <_> + + + + <_>13 10 8 10 -1. + <_>17 10 4 5 2. + <_>13 15 4 5 2. + 0 + 0.0363930016756058 + 0.1422269940376282 + -0.6119390130043030 + <_> + + <_> + + + + <_>3 0 4 9 -1. + <_>5 0 2 9 2. + 0 + 4.0099998004734516e-003 + -0.3456079959869385 + 0.1173869967460632 + <_> + + <_> + + + + <_>16 1 6 8 -1. + <_>16 1 3 8 2. + 0 + -0.0491060018539429 + 0.9598410129547119 + 0.0649349987506866 + <_> + + <_> + + + + <_>2 1 6 8 -1. + <_>5 1 3 8 2. + 0 + -0.0715830028057098 + 1.7385669946670532 + -0.1425289958715439 + <_> + + <_> + + + + <_>3 6 18 12 -1. + <_>3 10 18 4 3. + 0 + -0.0380089990794659 + 1.3872820138931274 + 0.0661880001425743 + <_> + + <_> + + + + <_>4 12 16 4 -1. + <_>4 14 16 2 2. + 0 + -3.1570000573992729e-003 + 0.0536770001053810 + -0.5404800176620483 + <_> + + <_> + + + + <_>4 9 16 15 -1. + <_>4 14 16 5 3. + 0 + 0.0194589998573065 + -0.0936200022697449 + 0.3913100063800812 + <_> + + <_> + + + + <_>3 10 8 10 -1. + <_>3 10 4 5 2. + <_>7 15 4 5 2. + 0 + 0.0112939998507500 + 0.0372239984571934 + -0.5425180196762085 + <_> + + <_> + + + + <_>8 18 16 6 -1. + <_>16 18 8 3 2. + <_>8 21 8 3 2. + 0 + -0.0334950014948845 + 0.9530789852142334 + 0.0376969985663891 + <_> + + <_> + + + + <_>2 16 12 5 -1. + <_>6 16 4 5 3. + 0 + 0.0920350030064583 + -0.1348839998245239 + 2.2897069454193115 + <_> + + <_> + + + + <_>14 14 9 4 -1. + <_>14 16 9 2 2. + 0 + 3.7529999390244484e-003 + 0.2282419949769974 + -0.5998370051383972 + <_> + + <_> + + + + <_>7 14 9 6 -1. + <_>7 16 9 2 3. + 0 + 0.0128480000421405 + -0.2200520038604736 + 0.3722189962863922 + <_> + + <_> + + + + <_>4 10 16 12 -1. + <_>4 14 16 4 3. + 0 + -0.1431619971990585 + 1.2855789661407471 + 0.0472370013594627 + <_> + + <_> + + + + <_>0 13 19 6 -1. + <_>0 15 19 2 3. + 0 + -0.0968799963593483 + -3.9550929069519043 + -0.0729039981961250 + <_> + + <_> + + + + <_>10 13 9 6 -1. + <_>10 15 9 2 3. + 0 + -8.8459998369216919e-003 + 0.3767499923706055 + -0.0464840009808540 + <_> + + <_> + + + + <_>5 0 3 23 -1. + <_>6 0 1 23 3. + 0 + 0.0159000009298325 + -0.0244570001959801 + -0.8003479838371277 + <_> + + <_> + + + + <_>0 8 24 6 -1. + <_>0 10 24 2 3. + 0 + 0.0703720003366470 + 0.1701900064945221 + -0.6306899785995483 + <_> + + <_> + + + + <_>0 5 5 12 -1. + <_>0 9 5 4 3. + 0 + -0.0379539988934994 + -0.9366719722747803 + -0.0412140004336834 + <_> + + <_> + + + + <_>3 0 19 18 -1. + <_>3 9 19 9 2. + 0 + 0.5159789919853210 + 0.1308059990406036 + -1.5802290439605713 + <_> + + <_> + + + + <_>9 11 6 12 -1. + <_>9 11 3 6 2. + <_>12 17 3 6 2. + 0 + -0.0328430011868477 + -1.1441620588302612 + -0.0491739995777607 + <_> + + <_> + + + + <_>0 5 24 8 -1. + <_>12 5 12 4 2. + <_>0 9 12 4 2. + 0 + -0.0363570004701614 + 0.4960640072822571 + -0.0344589985907078 + <_> + + <_> + + + + <_>6 18 9 4 -1. + <_>6 20 9 2 2. + 0 + 6.8080001510679722e-003 + -0.3099780082702637 + 0.1705480068922043 + <_> + + <_> + + + + <_>8 8 10 6 -1. + <_>8 10 10 2 3. + 0 + -0.0161140002310276 + -0.3790459930896759 + 0.1607899963855743 + <_> + + <_> + + + + <_>2 7 20 3 -1. + <_>2 8 20 1 3. + 0 + 8.4530003368854523e-003 + -0.1865549981594086 + 0.5636770129203796 + <_> + + <_> + + + + <_>12 0 7 20 -1. + <_>12 10 7 10 2. + 0 + -0.1375239938497543 + -0.5898990035057068 + 0.1174950003623962 + <_> + + <_> + + + + <_>5 0 7 20 -1. + <_>5 10 7 10 2. + 0 + 0.1768800020217896 + -0.1542489975690842 + 0.9291110038757324 + <_> + + <_> + + + + <_>14 2 2 18 -1. + <_>14 11 2 9 2. + 0 + 7.9309996217489243e-003 + 0.3219070136547089 + -0.1639260053634644 + <_> + + <_> + + + + <_>5 8 10 12 -1. + <_>10 8 5 12 2. + 0 + 0.1097180023789406 + -0.1587650030851364 + 1.0186259746551514 + <_> + + <_> + + + + <_>6 9 12 8 -1. + <_>12 9 6 4 2. + <_>6 13 6 4 2. + 0 + -0.0302930008620024 + 0.7558730244636536 + 0.0317949987947941 + <_> + + <_> + + + + <_>7 7 3 14 -1. + <_>7 14 3 7 2. + 0 + -0.0231180004775524 + -0.8845149874687195 + -9.5039997249841690e-003 + <_> + + <_> + + + + <_>11 2 12 16 -1. + <_>17 2 6 8 2. + <_>11 10 6 8 2. + 0 + -3.0900000128895044e-003 + 0.2383829951286316 + -0.1160620003938675 + <_> + + <_> + + + + <_>7 0 6 9 -1. + <_>9 0 2 9 3. + 0 + -0.0333920009434223 + -1.8738139867782593 + -0.0685029998421669 + <_> + + <_> + + + + <_>13 14 9 4 -1. + <_>13 16 9 2 2. + 0 + 0.0131900003179908 + 0.1291989982128143 + -0.6751220226287842 + <_> + + <_> + + + + <_>0 12 22 4 -1. + <_>0 12 11 2 2. + <_>11 14 11 2 2. + 0 + 0.0146610001102090 + -0.0248290002346039 + -0.7439680099487305 + <_> + + <_> + + + + <_>1 12 22 6 -1. + <_>12 12 11 3 2. + <_>1 15 11 3 2. + 0 + -0.0132480002939701 + 0.4682019948959351 + -0.0241650007665157 + <_> + + <_> + + + + <_>6 6 9 6 -1. + <_>9 6 3 6 3. + 0 + -0.0162189994007349 + 0.4008379876613617 + -0.2125570029020309 + <_> + + <_> + + + + <_>10 0 4 9 -1. + <_>10 0 2 9 2. + 0 + -0.0290520004928112 + -1.5650019645690918 + 0.1437589973211289 + <_> + + <_> + + + + <_>3 8 18 7 -1. + <_>9 8 6 7 3. + 0 + -0.1015319973230362 + -1.9220689535140991 + -0.0695599988102913 + <_> + + <_> + + + + <_>0 6 24 6 -1. + <_>0 8 24 2 3. + 0 + 0.0377539992332459 + 0.1339679956436157 + -2.2639141082763672 + <_> + + <_> + + + + <_>0 11 24 10 -1. + <_>8 11 8 10 3. + 0 + -0.2855559885501862 + 1.0215270519256592 + -0.1523219943046570 + <_> + + <_> + + + + <_>3 3 18 21 -1. + <_>9 3 6 21 3. + 0 + 0.1536069959402084 + -0.0974090024828911 + 0.4166240096092224 + <_> + + <_> + + + + <_>7 12 4 10 -1. + <_>9 12 2 10 2. + 0 + -2.1199999901000410e-004 + 0.1127189993858337 + -0.4165399968624115 + <_> + + <_> + + + + <_>10 16 10 8 -1. + <_>15 16 5 4 2. + <_>10 20 5 4 2. + 0 + -0.0205979999154806 + 0.6054049730300903 + 0.0624679997563362 + <_> + + <_> + + + + <_>8 6 6 9 -1. + <_>10 6 2 9 3. + 0 + 0.0373539999127388 + -0.1891900002956390 + 0.4646469950675964 + <_> + + <_> + + + + <_>12 10 6 12 -1. + <_>15 10 3 6 2. + <_>12 16 3 6 2. + 0 + 0.0572750009596348 + 0.1156530007719994 + -1.3213009834289551 + <_> + + <_> + + + + <_>6 10 6 12 -1. + <_>6 10 3 6 2. + <_>9 16 3 6 2. + 0 + 5.1029999740421772e-003 + -0.2806150019168854 + 0.1931339949369431 + <_> + + <_> + + + + <_>16 12 6 12 -1. + <_>19 12 3 6 2. + <_>16 18 3 6 2. + 0 + -0.0546449981629848 + 0.7242850065231323 + 0.0754479989409447 + <_> + + <_> + + + + <_>2 12 6 12 -1. + <_>2 12 3 6 2. + <_>5 18 3 6 2. + 0 + 0.0253490004688501 + -0.1948180049657822 + 0.4603280127048492 + <_> + + <_> + + + + <_>10 15 6 9 -1. + <_>12 15 2 9 3. + 0 + 0.0243110004812479 + 0.1556410044431686 + -0.4991390109062195 + <_> + + <_> + + + + <_>8 15 6 9 -1. + <_>10 15 2 9 3. + 0 + 0.0359620004892349 + -0.0585730001330376 + -1.5418399572372437 + <_> + + <_> + + + + <_>14 20 10 4 -1. + <_>14 20 5 4 2. + 0 + -0.1000069975852966 + -1.6100039482116699 + 0.1145050004124641 + <_> + + <_> + + + + <_>0 20 10 4 -1. + <_>5 20 5 4 2. + 0 + 0.0844359993934631 + -0.0614069998264313 + -1.4673349857330322 + <_> + + <_> + + + + <_>11 17 9 6 -1. + <_>11 19 9 2 3. + 0 + 0.0159479994326830 + 0.1628790050745010 + -0.1102640032768250 + <_> + + <_> + + + + <_>3 2 14 4 -1. + <_>3 4 14 2 2. + 0 + 0.0338240005075932 + -0.1793269962072372 + 0.5721840262413025 + <_> + + <_> + + + + <_>10 1 10 4 -1. + <_>10 3 10 2 2. + 0 + -0.0619960017502308 + 4.6511812210083008 + 0.0945340022444725 + <_> + + <_> + + + + <_>0 15 10 4 -1. + <_>5 15 5 4 2. + 0 + 0.0698769986629486 + -0.1698590070009232 + 0.8702899813652039 + <_> + + <_> + + + + <_>19 2 3 19 -1. + <_>20 2 1 19 3. + 0 + -0.0279169995337725 + 0.9104250073432922 + 0.0568270012736321 + <_> + + <_> + + + + <_>4 12 9 8 -1. + <_>7 12 3 8 3. + 0 + -0.0127640003338456 + 0.2206670045852661 + -0.2776910066604614 + -3.3196411132812500 + 20 + -1 + <_> + + + <_> + + <_> + + + + <_>4 7 5 12 -1. + <_>4 11 5 4 3. + 0 + 0.0216620005667210 + -0.8986889719963074 + 0.2943629920482636 + <_> + + <_> + + + + <_>0 1 24 3 -1. + <_>8 1 8 3 3. + 0 + 0.1004450023174286 + -0.3765920102596283 + 0.6089100241661072 + <_> + + <_> + + + + <_>6 8 12 4 -1. + <_>6 10 12 2 2. + 0 + 0.0260039996355772 + -0.3812850117683411 + 0.3921740055084229 + <_> + + <_> + + + + <_>19 3 4 10 -1. + <_>19 3 2 10 2. + 0 + 0.0284410007297993 + -0.1818230003118515 + 0.5892720222473145 + <_> + + <_> + + + + <_>0 6 9 6 -1. + <_>3 6 3 6 3. + 0 + 0.0386120006442070 + -0.2239959985017777 + 0.6377999782562256 + <_> + + <_> + + + + <_>18 0 6 22 -1. + <_>20 0 2 22 3. + 0 + -0.0465949997305870 + 0.7081220149993897 + -0.1466619968414307 + <_> + + <_> + + + + <_>0 0 6 22 -1. + <_>2 0 2 22 3. + 0 + -0.0427919998764992 + 0.4768039882183075 + -0.2923319935798645 + <_> + + <_> + + + + <_>5 15 19 3 -1. + <_>5 16 19 1 3. + 0 + 3.7960000336170197e-003 + -0.1851029992103577 + 0.5262669920921326 + <_> + + <_> + + + + <_>10 7 4 15 -1. + <_>10 12 4 5 3. + 0 + 0.0423489995300770 + 0.0392449982464314 + -0.8919770121574402 + <_> + + <_> + + + + <_>9 6 6 9 -1. + <_>11 6 2 9 3. + 0 + 0.0195989999920130 + -0.2335840016603470 + 0.4414649903774262 + <_> + + <_> + + + + <_>0 21 18 3 -1. + <_>0 22 18 1 3. + 0 + 8.7400001939386129e-004 + -0.4606359899044037 + 0.1768960058689117 + <_> + + <_> + + + + <_>7 3 10 15 -1. + <_>7 8 10 5 3. + 0 + -4.3629999272525311e-003 + 0.3349319994449616 + -0.2989340126514435 + <_> + + <_> + + + + <_>1 7 18 3 -1. + <_>1 8 18 1 3. + 0 + 0.0169730000197887 + -0.1640869975090027 + 1.5993679761886597 + <_> + + <_> + + + + <_>8 2 9 6 -1. + <_>11 2 3 6 3. + 0 + 0.0360639989376068 + 0.2260169982910156 + -0.5318610072135925 + <_> + + <_> + + + + <_>0 10 24 14 -1. + <_>0 17 24 7 2. + 0 + -0.0708649978041649 + 0.1522050052881241 + -0.4191460013389587 + <_> + + <_> + + + + <_>13 9 8 10 -1. + <_>17 9 4 5 2. + <_>13 14 4 5 2. + 0 + -0.0630759969353676 + -1.4874019622802734 + 0.1295370012521744 + <_> + + <_> + + + + <_>10 5 4 9 -1. + <_>12 5 2 9 2. + 0 + 0.0296700000762939 + -0.1914590001106262 + 0.9818490147590637 + <_> + + <_> + + + + <_>13 9 8 10 -1. + <_>17 9 4 5 2. + <_>13 14 4 5 2. + 0 + 0.0378739982843399 + 0.1345950067043304 + -0.5631629824638367 + <_> + + <_> + + + + <_>7 11 10 10 -1. + <_>7 11 5 5 2. + <_>12 16 5 5 2. + 0 + -0.0332890003919601 + -1.0828030109405518 + -0.0115040000528097 + <_> + + <_> + + + + <_>4 13 18 4 -1. + <_>13 13 9 2 2. + <_>4 15 9 2 2. + 0 + -0.0316089987754822 + -0.5922449827194214 + 0.1339479982852936 + <_> + + <_> + + + + <_>0 0 19 2 -1. + <_>0 1 19 1 2. + 0 + 1.0740000288933516e-003 + -0.4918580055236816 + 0.0944460034370422 + <_> + + <_> + + + + <_>0 18 24 6 -1. + <_>8 18 8 6 3. + 0 + -0.0715560019016266 + 0.5971019864082336 + -0.0395530015230179 + <_> + + <_> + + + + <_>6 4 8 16 -1. + <_>6 12 8 8 2. + 0 + -0.0811700001358986 + -1.1817820072174072 + -0.0282540004700422 + <_> + + <_> + + + + <_>7 8 10 4 -1. + <_>7 10 10 2 2. + 0 + 4.4860001653432846e-003 + -0.6102809906005859 + 0.2261909991502762 + <_> + + <_> + + + + <_>0 3 6 9 -1. + <_>0 6 6 3 3. + 0 + -0.0421760007739067 + -1.1435619592666626 + -0.0290019996464252 + <_> + + <_> + + + + <_>13 15 7 9 -1. + <_>13 18 7 3 3. + 0 + -0.0656400024890900 + -1.6470279693603516 + 0.1281030029058456 + <_> + + <_> + + + + <_>3 18 12 6 -1. + <_>3 18 6 3 2. + <_>9 21 6 3 2. + 0 + 0.0181889999657869 + -0.3114939928054810 + 0.2573960125446320 + <_> + + <_> + + + + <_>12 14 6 9 -1. + <_>12 17 6 3 3. + 0 + -0.0515200011432171 + -0.6920689940452576 + 0.1527079939842224 + <_> + + <_> + + + + <_>2 15 15 8 -1. + <_>2 19 15 4 2. + 0 + -0.0471509993076324 + -0.7186830043792725 + 2.6879999786615372e-003 + <_> + + <_> + + + + <_>9 6 6 16 -1. + <_>9 14 6 8 2. + 0 + 0.0174889992922544 + 0.2237119972705841 + -0.5538179874420166 + <_> + + <_> + + + + <_>6 6 7 12 -1. + <_>6 10 7 4 3. + 0 + -0.0252640005201101 + 1.0319819450378418 + -0.1749649941921234 + <_> + + <_> + + + + <_>14 6 6 9 -1. + <_>14 9 6 3 3. + 0 + -0.0407450012862682 + 0.4496159851551056 + 0.0393490009009838 + <_> + + <_> + + + + <_>5 14 6 9 -1. + <_>5 17 6 3 3. + 0 + -0.0376669988036156 + -0.8547570109367371 + -0.0124639999121428 + <_> + + <_> + + + + <_>10 8 6 9 -1. + <_>12 8 2 9 3. + 0 + -0.0134110003709793 + 0.5784559845924377 + -0.0174679998308420 + <_> + + <_> + + + + <_>6 6 4 18 -1. + <_>6 6 2 9 2. + <_>8 15 2 9 2. + 0 + -7.8999997640494257e-005 + -0.3774920105934143 + 0.1396179944276810 + <_> + + <_> + + + + <_>14 9 6 12 -1. + <_>17 9 3 6 2. + <_>14 15 3 6 2. + 0 + -0.0114150000736117 + -0.2618660032749176 + 0.2371249943971634 + <_> + + <_> + + + + <_>4 9 6 12 -1. + <_>4 9 3 6 2. + <_>7 15 3 6 2. + 0 + 0.0372000001370907 + -0.0286260005086660 + -1.2945239543914795 + <_> + + <_> + + + + <_>14 15 9 6 -1. + <_>14 17 9 2 3. + 0 + 3.4050000831484795e-003 + 0.2053139954805374 + -0.1874749958515167 + <_> + + <_> + + + + <_>0 20 18 4 -1. + <_>0 20 9 2 2. + <_>9 22 9 2 2. + 0 + -0.0224830005317926 + 0.6702719926834106 + -0.1959400027990341 + <_> + + <_> + + + + <_>13 18 9 6 -1. + <_>13 20 9 2 3. + 0 + 0.0232749991118908 + 0.1740539968013763 + -0.3274630010128021 + <_> + + <_> + + + + <_>2 18 9 6 -1. + <_>2 20 9 2 3. + 0 + -0.0139170000329614 + -0.8395429849624634 + -6.3760001212358475e-003 + <_> + + <_> + + + + <_>6 16 18 3 -1. + <_>6 17 18 1 3. + 0 + 7.5429999269545078e-003 + -0.0341949984431267 + 0.5899819731712341 + <_> + + <_> + + + + <_>0 16 18 3 -1. + <_>0 17 18 1 3. + 0 + -0.0115390000864863 + 0.4214279949665070 + -0.2351049929857254 + <_> + + <_> + + + + <_>19 2 4 22 -1. + <_>21 2 2 11 2. + <_>19 13 2 11 2. + 0 + 0.0525019988417625 + 0.0693039968609810 + 0.7322649955749512 + <_> + + <_> + + + + <_>1 2 4 22 -1. + <_>1 2 2 11 2. + <_>3 13 2 11 2. + 0 + 0.0527159981429577 + -0.1568810045719147 + 1.0907289981842041 + <_> + + <_> + + + + <_>15 0 2 24 -1. + <_>15 0 1 24 2. + 0 + -0.0117260003462434 + -0.7093430161476135 + 0.1682880073785782 + <_> + + <_> + + + + <_>3 20 16 4 -1. + <_>11 20 8 4 2. + 0 + 0.0959459990262985 + -0.1619289964437485 + 1.0072519779205322 + <_> + + <_> + + + + <_>11 6 4 18 -1. + <_>13 6 2 9 2. + <_>11 15 2 9 2. + 0 + -0.0158719997853041 + 0.3900839984416962 + -0.0537770017981529 + <_> + + <_> + + + + <_>7 9 10 14 -1. + <_>7 9 5 7 2. + <_>12 16 5 7 2. + 0 + 0.0348180010914803 + 0.0171799995005131 + -0.9394180178642273 + <_> + + <_> + + + + <_>14 6 6 9 -1. + <_>14 9 6 3 3. + 0 + 0.0347919985651970 + 0.0504629984498024 + 0.5446569919586182 + <_> + + <_> + + + + <_>3 6 7 9 -1. + <_>3 9 7 3 3. + 0 + 0.0162840001285076 + -0.2698130011558533 + 0.4036529958248138 + <_> + + <_> + + + + <_>20 4 4 20 -1. + <_>22 4 2 10 2. + <_>20 14 2 10 2. + 0 + -0.0443190000951290 + 0.8439999818801880 + 0.0328829996287823 + <_> + + <_> + + + + <_>7 6 6 9 -1. + <_>7 9 6 3 3. + 0 + -5.5689997971057892e-003 + 0.1530939936637878 + -0.3495979905128479 + <_> + + <_> + + + + <_>7 0 10 14 -1. + <_>12 0 5 7 2. + <_>7 7 5 7 2. + 0 + -0.0658420026302338 + -0.9271119832992554 + 0.1680099964141846 + <_> + + <_> + + + + <_>2 1 18 6 -1. + <_>11 1 9 6 2. + 0 + -0.0733370035886765 + 0.5161449909210205 + -0.2023600041866303 + <_> + + <_> + + + + <_>15 0 2 24 -1. + <_>15 0 1 24 2. + 0 + 0.0164500009268522 + 0.1395059973001480 + -0.4930129945278168 + <_> + + <_> + + + + <_>7 0 2 24 -1. + <_>8 0 1 24 2. + 0 + -9.2630004510283470e-003 + -0.9010199904441834 + -0.0161160007119179 + <_> + + <_> + + + + <_>13 12 6 7 -1. + <_>13 12 3 7 2. + 0 + 5.9139998629689217e-003 + 0.1985819935798645 + -0.1673129945993424 + <_> + + <_> + + + + <_>5 12 6 7 -1. + <_>8 12 3 7 2. + 0 + -8.4699998842552304e-004 + 0.0940050035715103 + -0.4157089889049530 + <_> + + <_> + + + + <_>3 5 18 19 -1. + <_>9 5 6 19 3. + 0 + 0.2053290009498596 + -0.0600220002233982 + 0.7099360227584839 + <_> + + <_> + + + + <_>5 6 9 6 -1. + <_>8 6 3 6 3. + 0 + -0.0168830007314682 + 0.2439219951629639 + -0.3055180013179779 + <_> + + <_> + + + + <_>9 5 9 6 -1. + <_>12 5 3 6 3. + 0 + -0.0191110000014305 + 0.6122990250587463 + 0.0242529995739460 + <_> + + <_> + + + + <_>3 16 10 8 -1. + <_>3 16 5 4 2. + <_>8 20 5 4 2. + 0 + -0.0259629990905523 + 0.9076499938964844 + -0.1672209948301315 + <_> + + <_> + + + + <_>19 8 5 15 -1. + <_>19 13 5 5 3. + 0 + -0.0217620003968477 + -0.3138470053672791 + 0.2013459950685501 + <_> + + <_> + + + + <_>0 8 5 15 -1. + <_>0 13 5 5 3. + 0 + -0.0241199992597103 + -0.6658840179443359 + 7.4559999629855156e-003 + <_> + + <_> + + + + <_>20 4 4 20 -1. + <_>22 4 2 10 2. + <_>20 14 2 10 2. + 0 + 0.0471299998462200 + 0.0595339983701706 + 0.8780450224876404 + <_> + + <_> + + + + <_>0 4 4 20 -1. + <_>0 4 2 10 2. + <_>2 14 2 10 2. + 0 + -0.0459849983453751 + 0.8006799817085266 + -0.1725230067968369 + <_> + + <_> + + + + <_>7 7 10 4 -1. + <_>7 7 5 4 2. + 0 + 0.0265079997479916 + 0.1877409964799881 + -0.6085060238838196 + <_> + + <_> + + + + <_>4 19 14 4 -1. + <_>11 19 7 4 2. + 0 + -0.0486150011420250 + 0.5864409804344177 + -0.1942770034074783 + <_> + + <_> + + + + <_>10 11 12 3 -1. + <_>10 11 6 3 2. + 0 + -0.0185620002448559 + -0.2558790147304535 + 0.1632619947195053 + <_> + + <_> + + + + <_>0 1 24 3 -1. + <_>0 2 24 1 3. + 0 + 0.0126780001446605 + -0.0142280003055930 + -0.7673810124397278 + <_> + + <_> + + + + <_>7 2 14 20 -1. + <_>14 2 7 10 2. + <_>7 12 7 10 2. + 0 + -1.1919999960809946e-003 + 0.2049500048160553 + -0.1140429973602295 + <_> + + <_> + + + + <_>0 13 6 9 -1. + <_>2 13 2 9 3. + 0 + -0.0490889996290207 + -1.0740849971771240 + -0.0389409996569157 + <_> + + <_> + + + + <_>13 0 4 19 -1. + <_>13 0 2 19 2. + 0 + -0.0174369998276234 + -0.5797380208969116 + 0.1858450025320053 + <_> + + <_> + + + + <_>1 11 14 3 -1. + <_>8 11 7 3 2. + 0 + -0.0147700002416968 + -0.6615030169487000 + 5.3119999356567860e-003 + <_> + + <_> + + + + <_>7 1 16 20 -1. + <_>15 1 8 10 2. + <_>7 11 8 10 2. + 0 + -0.2290520071983337 + -0.4830510020256043 + 0.1232639998197556 + <_> + + <_> + + + + <_>0 10 21 9 -1. + <_>7 10 7 9 3. + 0 + -0.1270709931850433 + 0.5745260119438171 + -0.1942040026187897 + <_> + + <_> + + + + <_>6 19 15 5 -1. + <_>11 19 5 5 3. + 0 + 0.0103390002623200 + -0.0546419993042946 + 0.2450180053710938 + <_> + + <_> + + + + <_>8 10 6 6 -1. + <_>11 10 3 6 2. + 0 + 6.9010001607239246e-003 + 0.1218060031533241 + -0.3879739940166473 + <_> + + <_> + + + + <_>7 1 16 20 -1. + <_>15 1 8 10 2. + <_>7 11 8 10 2. + 0 + 0.2902539968490601 + 0.1096619963645935 + -30. + <_> + + <_> + + + + <_>1 1 16 20 -1. + <_>1 1 8 10 2. + <_>9 11 8 10 2. + 0 + -0.2380499988794327 + -1.7352679967880249 + -0.0638099983334541 + <_> + + <_> + + + + <_>16 4 3 12 -1. + <_>16 10 3 6 2. + 0 + 0.0624810010194778 + 0.1352300047874451 + -0.7030109763145447 + <_> + + <_> + + + + <_>5 4 3 12 -1. + <_>5 10 3 6 2. + 0 + 4.7109997831285000e-003 + -0.4698410034179688 + 0.0603419989347458 + <_> + + <_> + + + + <_>7 6 10 8 -1. + <_>12 6 5 4 2. + <_>7 10 5 4 2. + 0 + -0.0278159994632006 + 0.6980760097503662 + 1.3719999697059393e-003 + <_> + + <_> + + + + <_>4 9 6 6 -1. + <_>4 12 6 3 2. + 0 + -0.0170200001448393 + 1.6870440244674683 + -0.1431480050086975 + <_> + + <_> + + + + <_>6 5 12 4 -1. + <_>6 7 12 2 2. + 0 + -0.0497549995779991 + 0.7949770092964172 + 7.7199999941512942e-004 + <_> + + <_> + + + + <_>9 2 5 15 -1. + <_>9 7 5 5 3. + 0 + -0.0747329965233803 + -1.0132360458374023 + -0.0193889997899532 + <_> + + <_> + + + + <_>15 0 9 6 -1. + <_>15 2 9 2 3. + 0 + 0.0320090018212795 + 0.1441210061311722 + -0.4213910102844238 + <_> + + <_> + + + + <_>6 0 11 10 -1. + <_>6 5 11 5 2. + 0 + -0.0944639965891838 + 0.5068259835243225 + -0.2047889977693558 + <_> + + <_> + + + + <_>12 7 4 12 -1. + <_>12 13 4 6 2. + 0 + -0.0154269998893142 + -0.1581130027770996 + 0.1780689954757690 + <_> + + <_> + + + + <_>7 2 9 4 -1. + <_>7 4 9 2 2. + 0 + -4.0540001355111599e-003 + -0.5436670184135437 + 0.0312350001186132 + <_> + + <_> + + + + <_>6 0 13 6 -1. + <_>6 2 13 2 3. + 0 + 3.0080000869929790e-003 + -0.1737679988145828 + 0.3044170141220093 + <_> + + <_> + + + + <_>10 6 4 18 -1. + <_>10 6 2 9 2. + <_>12 15 2 9 2. + 0 + -0.0100919995456934 + 0.2510380148887634 + -0.2622410058975220 + <_> + + <_> + + + + <_>10 8 6 9 -1. + <_>12 8 2 9 3. + 0 + -0.0388180017471313 + 0.9322670102119446 + 0.0726599991321564 + <_> + + <_> + + + + <_>3 18 10 6 -1. + <_>3 20 10 2 3. + 0 + 0.0346519984304905 + -0.0339349992573261 + -0.8570790290832520 + <_> + + <_> + + + + <_>4 14 20 3 -1. + <_>4 15 20 1 3. + 0 + -4.6729999594390392e-003 + 0.3496930003166199 + -0.0485179983079433 + <_> + + <_> + + + + <_>2 15 9 6 -1. + <_>2 17 9 2 3. + 0 + 6.8499997723847628e-004 + 0.0665730014443398 + -0.4497379958629608 + <_> + + <_> + + + + <_>13 0 4 19 -1. + <_>13 0 2 19 2. + 0 + 0.0353170000016689 + 0.1427579969167709 + -0.4672639966011047 + <_> + + <_> + + + + <_>7 0 4 19 -1. + <_>9 0 2 19 2. + 0 + -0.0235699992626905 + -1.0286079645156860 + -0.0452880002558231 + <_> + + <_> + + + + <_>1 4 22 2 -1. + <_>1 5 22 1 2. + 0 + -1.9109999993816018e-003 + -0.1965219974517822 + 0.2866100072860718 + <_> + + <_> + + + + <_>0 0 9 6 -1. + <_>0 2 9 2 3. + 0 + -0.0166590008884668 + -0.7753220200538635 + -8.3280000835657120e-003 + <_> + + <_> + + + + <_>0 0 24 18 -1. + <_>0 9 24 9 2. + 0 + 0.6606220006942749 + 0.1323249936103821 + -3.5266680717468262 + <_> + + <_> + + + + <_>3 2 16 8 -1. + <_>3 6 16 4 2. + 0 + 0.1097059994935989 + -0.1554719954729080 + 1.4674140214920044 + <_> + + <_> + + + + <_>3 6 18 6 -1. + <_>3 8 18 2 3. + 0 + 0.0135009996592999 + 0.1523340046405792 + -1.3020930290222168 + <_> + + <_> + + + + <_>3 1 6 10 -1. + <_>5 1 2 10 3. + 0 + -0.0228719990700483 + -0.7132599949836731 + -8.7040001526474953e-003 + <_> + + <_> + + + + <_>13 0 9 6 -1. + <_>16 0 3 6 3. + 0 + -0.0818210020661354 + 1.1127580404281616 + 0.0832199975848198 + <_> + + <_> + + + + <_>2 0 9 6 -1. + <_>5 0 3 6 3. + 0 + -0.0527280010282993 + 0.9316509962081909 + -0.1710399985313416 + <_> + + <_> + + + + <_>10 2 4 15 -1. + <_>10 7 4 5 3. + 0 + -0.0252420008182526 + -0.1973379999399185 + 0.2535940110683441 + <_> + + <_> + + + + <_>6 0 7 10 -1. + <_>6 5 7 5 2. + 0 + -0.0438189990818501 + 0.4181520044803619 + -0.2458550035953522 + <_> + + <_> + + + + <_>2 2 20 4 -1. + <_>12 2 10 2 2. + <_>2 4 10 2 2. + 0 + -0.0181889999657869 + -0.5174319744110107 + 0.2017419934272766 + <_> + + <_> + + + + <_>2 11 19 3 -1. + <_>2 12 19 1 3. + 0 + 0.0234660003334284 + -0.0430710017681122 + -1.0636579990386963 + <_> + + <_> + + + + <_>10 8 6 9 -1. + <_>12 8 2 9 3. + 0 + 0.0342160016298294 + 0.0537809990346432 + 0.4970720112323761 + <_> + + <_> + + + + <_>8 8 6 9 -1. + <_>10 8 2 9 3. + 0 + 0.0256929993629456 + -0.2380010038614273 + 0.4165149927139282 + <_> + + <_> + + + + <_>13 8 4 9 -1. + <_>13 8 2 9 2. + 0 + -0.0265650004148483 + -0.8857480287551880 + 0.1336590051651001 + <_> + + <_> + + + + <_>3 11 9 9 -1. + <_>6 11 3 9 3. + 0 + 0.0609420016407967 + -0.2066970020532608 + 0.5830900073051453 + <_> + + <_> + + + + <_>3 9 18 5 -1. + <_>9 9 6 5 3. + 0 + 0.1447450071573257 + 0.1328230053186417 + -3.1449348926544189 + <_> + + <_> + + + + <_>2 4 2 20 -1. + <_>2 14 2 10 2. + 0 + 0.0534109994769096 + -0.1732520014047623 + 0.6919069886207581 + <_> + + <_> + + + + <_>14 17 8 6 -1. + <_>14 20 8 3 2. + 0 + 0.0114080002531409 + 0.0548220016062260 + 0.3024039864540100 + <_> + + <_> + + + + <_>3 21 18 2 -1. + <_>3 22 18 1 2. + 0 + -2.3179999552667141e-003 + 0.1582089960575104 + -0.3197320103645325 + <_> + + <_> + + + + <_>5 4 15 6 -1. + <_>10 4 5 6 3. + 0 + -0.0296950004994869 + 0.7127479910850525 + 0.0581360012292862 + <_> + + <_> + + + + <_>2 15 12 6 -1. + <_>2 17 12 2 3. + 0 + 0.0272499993443489 + -0.1575410068035126 + 0.9214379787445068 + <_> + + <_> + + + + <_>17 8 6 9 -1. + <_>17 11 6 3 3. + 0 + -3.6200000904500484e-003 + -0.3454839885234833 + 0.2022099941968918 + <_> + + <_> + + + + <_>2 12 20 4 -1. + <_>2 12 10 2 2. + <_>12 14 10 2 2. + 0 + -0.0125789996236563 + -0.5565029978752136 + 0.0203889999538660 + <_> + + <_> + + + + <_>0 17 24 6 -1. + <_>0 19 24 2 3. + 0 + -0.0888490006327629 + -3.6100010871887207 + 0.1316419988870621 + <_> + + <_> + + + + <_>7 16 9 4 -1. + <_>7 18 9 2 2. + 0 + -0.0192569997161627 + 0.5190899968147278 + -0.1928430050611496 + <_> + + <_> + + + + <_>15 1 4 22 -1. + <_>17 1 2 11 2. + <_>15 12 2 11 2. + 0 + -0.0166669990867376 + -0.0874999985098839 + 0.1581249982118607 + <_> + + <_> + + + + <_>5 1 4 22 -1. + <_>5 1 2 11 2. + <_>7 12 2 11 2. + 0 + 0.0129319997504354 + 0.0274059996008873 + -0.5512390136718750 + <_> + + <_> + + + + <_>11 13 8 9 -1. + <_>11 16 8 3 3. + 0 + -0.0134319998323917 + 0.2345779985189438 + -0.0432350002229214 + <_> + + <_> + + + + <_>6 1 6 9 -1. + <_>8 1 2 9 3. + 0 + 0.0188100002706051 + -0.0396809987723827 + -0.9437329769134522 + <_> + + <_> + + + + <_>11 4 3 18 -1. + <_>11 10 3 6 3. + 0 + -6.4349998719990253e-003 + 0.4570370018482208 + -4.0520001202821732e-003 + <_> + + <_> + + + + <_>5 8 12 6 -1. + <_>5 8 6 3 2. + <_>11 11 6 3 2. + 0 + -0.0242490004748106 + -0.7624800205230713 + -0.0198570005595684 + <_> + + <_> + + + + <_>15 7 5 8 -1. + <_>15 11 5 4 2. + 0 + -0.0296679995954037 + -3.7412509918212891 + 0.1125060021877289 + <_> + + <_> + + + + <_>4 7 5 8 -1. + <_>4 11 5 4 2. + 0 + 5.1150000654160976e-003 + -0.6378179788589478 + 0.0112239997833967 + <_> + + <_> + + + + <_>12 6 6 12 -1. + <_>15 6 3 6 2. + <_>12 12 3 6 2. + 0 + -5.7819997891783714e-003 + 0.1937440037727356 + -0.0820420011878014 + <_> + + <_> + + + + <_>6 6 6 12 -1. + <_>6 6 3 6 2. + <_>9 12 3 6 2. + 0 + 0.0166069995611906 + -0.1619209945201874 + 1.1334990262985229 + <_> + + <_> + + + + <_>5 9 14 8 -1. + <_>12 9 7 4 2. + <_>5 13 7 4 2. + 0 + 0.0382280014455318 + 0.0211050007492304 + 0.7626420259475708 + <_> + + <_> + + + + <_>9 1 3 14 -1. + <_>9 8 3 7 2. + 0 + -0.0570940002799034 + -1.6974929571151733 + -0.0597620010375977 + <_> + + <_> + + + + <_>12 6 6 12 -1. + <_>12 10 6 4 3. + 0 + -0.0538830012083054 + 1.1850190162658691 + 0.0909669995307922 + <_> + + <_> + + + + <_>4 5 4 18 -1. + <_>4 5 2 9 2. + <_>6 14 2 9 2. + 0 + -2.6110000908374786e-003 + -0.4094119966030121 + 0.0838209986686707 + <_> + + <_> + + + + <_>4 6 16 18 -1. + <_>4 12 16 6 3. + 0 + 0.2971439957618713 + 0.1552989929914475 + -1.0995409488677979 + <_> + + <_> + + + + <_>5 4 7 20 -1. + <_>5 14 7 10 2. + 0 + -0.0890630036592484 + 0.4894720017910004 + -0.2004120051860809 + <_> + + <_> + + + + <_>14 8 8 12 -1. + <_>14 14 8 6 2. + 0 + -0.0561930015683174 + -0.2458139955997467 + 0.1436550021171570 + <_> + + <_> + + + + <_>9 10 6 14 -1. + <_>9 10 3 7 2. + <_>12 17 3 7 2. + 0 + 0.0370049998164177 + -0.0481689982116222 + -1.2310709953308105 + <_> + + <_> + + + + <_>9 5 9 6 -1. + <_>12 5 3 6 3. + 0 + -8.4840003401041031e-003 + 0.4337260127067566 + 0.0137799996882677 + <_> + + <_> + + + + <_>9 4 3 18 -1. + <_>10 4 1 18 3. + 0 + -2.4379999376833439e-003 + 0.1894969940185547 + -0.3229419887065888 + <_> + + <_> + + + + <_>1 4 22 14 -1. + <_>12 4 11 7 2. + <_>1 11 11 7 2. + 0 + -0.0716399997472763 + -0.4397900104522705 + 0.2273019999265671 + <_> + + <_> + + + + <_>2 7 18 2 -1. + <_>2 8 18 1 2. + 0 + 5.2260002121329308e-003 + -0.2054840028285980 + 0.5093330144882202 + <_> + + <_> + + + + <_>12 6 6 12 -1. + <_>12 10 6 4 3. + 0 + -6.1360001564025879e-003 + 0.3115719854831696 + 0.0706809982657433 + <_> + + <_> + + + + <_>6 5 9 7 -1. + <_>9 5 3 7 3. + 0 + 0.0155950002372265 + -0.3093479871749878 + 0.1562770009040833 + <_> + + <_> + + + + <_>12 7 4 12 -1. + <_>12 13 4 6 2. + 0 + 0.0259959995746613 + 0.1382160037755966 + -0.1761659979820252 + <_> + + <_> + + + + <_>8 7 4 12 -1. + <_>8 13 4 6 2. + 0 + -0.0120850000530481 + -0.5107020139694214 + 0.0584409981966019 + <_> + + <_> + + + + <_>7 2 10 22 -1. + <_>7 13 10 11 2. + 0 + -0.0678360015153885 + 0.4775710105895996 + -0.0714460015296936 + <_> + + <_> + + + + <_>0 1 3 20 -1. + <_>1 1 1 20 3. + 0 + -0.0147150000557303 + 0.4523890018463135 + -0.1986140012741089 + <_> + + <_> + + + + <_>4 13 18 4 -1. + <_>13 13 9 2 2. + <_>4 15 9 2 2. + 0 + 0.0251189991831779 + 0.1295489966869354 + -0.8626639842987061 + <_> + + <_> + + + + <_>2 13 18 4 -1. + <_>2 13 9 2 2. + <_>11 15 9 2 2. + 0 + 0.0188260003924370 + -0.0415700003504753 + -1.1354700326919556 + <_> + + <_> + + + + <_>15 15 9 6 -1. + <_>15 17 9 2 3. + 0 + -0.0212639998644590 + -0.3473800122737885 + 0.1577949970960617 + <_> + + <_> + + + + <_>0 15 9 6 -1. + <_>0 17 9 2 3. + 0 + 9.4609996303915977e-003 + 4.8639997839927673e-003 + -0.6165480017662048 + <_> + + <_> + + + + <_>6 0 18 24 -1. + <_>15 0 9 12 2. + <_>6 12 9 12 2. + 0 + 0.2295770049095154 + 0.0813729986548424 + 0.6984140276908875 + <_> + + <_> + + + + <_>6 6 6 12 -1. + <_>6 10 6 4 3. + 0 + -0.0380619987845421 + 1.1616369485855103 + -0.1497669965028763 + <_> + + <_> + + + + <_>8 7 10 4 -1. + <_>8 9 10 2 2. + 0 + -0.0134849995374680 + -0.3203639984130859 + 0.1736509948968887 + <_> + + <_> + + + + <_>1 9 18 6 -1. + <_>1 9 9 3 2. + <_>10 12 9 3 2. + 0 + 0.0362389981746674 + -0.1815849989652634 + 0.6195669770240784 + <_> + + <_> + + + + <_>6 6 18 3 -1. + <_>6 7 18 1 3. + 0 + 6.7210001870989799e-003 + 7.9600000753998756e-004 + 0.4244140088558197 + <_> + + <_> + + + + <_>7 7 9 8 -1. + <_>10 7 3 8 3. + 0 + 0.0965259969234467 + -0.1469680070877075 + 1.2525680065155029 + <_> + + <_> + + + + <_>10 12 6 12 -1. + <_>12 12 2 12 3. + 0 + -0.0356569997966290 + -0.3978169858455658 + 0.1419139951467514 + <_> + + <_> + + + + <_>3 14 18 3 -1. + <_>3 15 18 1 3. + 0 + 0.0107720000669360 + -0.1819400042295456 + 0.5976219773292542 + <_> + + <_> + + + + <_>15 17 9 7 -1. + <_>18 17 3 7 3. + 0 + 0.0792799964547157 + 0.1464249938726425 + -0.7883689999580383 + <_> + + <_> + + + + <_>1 12 10 6 -1. + <_>1 14 10 2 3. + 0 + 0.0328410007059574 + -0.0624080002307892 + -1.4227490425109863 + <_> + + <_> + + + + <_>15 17 9 7 -1. + <_>18 17 3 7 3. + 0 + -0.0277810003608465 + 0.3403309881687164 + 0.0306700002402067 + <_> + + <_> + + + + <_>10 3 3 19 -1. + <_>11 3 1 19 3. + 0 + -4.0339999832212925e-003 + 0.3108470141887665 + -0.2259570062160492 + <_> + + <_> + + + + <_>15 17 9 7 -1. + <_>18 17 3 7 3. + 0 + 7.4260002002120018e-003 + -0.0389369986951351 + 0.3170210123062134 + <_> + + <_> + + + + <_>6 1 11 9 -1. + <_>6 4 11 3 3. + 0 + 0.1121399998664856 + -0.1757829934358597 + 0.6505659818649292 + <_> + + <_> + + + + <_>15 17 9 7 -1. + <_>18 17 3 7 3. + 0 + -0.1187810003757477 + -1.0092990398406982 + 0.1106970012187958 + <_> + + <_> + + + + <_>6 5 11 6 -1. + <_>6 8 11 3 2. + 0 + -0.0415849983692169 + -0.5380640029907227 + 0.0199050009250641 + <_> + + <_> + + + + <_>16 7 8 5 -1. + <_>16 7 4 5 2. + 0 + -0.0279660001397133 + 0.4814319908618927 + 0.0335909985005856 + <_> + + <_> + + + + <_>2 4 20 19 -1. + <_>12 4 10 19 2. + 0 + -0.1250640004873276 + 0.2635219991207123 + -0.2573789954185486 + <_> + + <_> + + + + <_>2 1 21 6 -1. + <_>9 1 7 6 3. + 0 + 0.2366690039634705 + 0.0365080013871193 + 0.9065560102462769 + <_> + + <_> + + + + <_>6 5 12 14 -1. + <_>6 5 6 7 2. + <_>12 12 6 7 2. + 0 + -0.0294759999960661 + -0.6004880070686340 + 9.5880003646016121e-003 + <_> + + <_> + + + + <_>9 0 6 9 -1. + <_>11 0 2 9 3. + 0 + 0.0377929992973804 + 0.1550620049238205 + -0.9573349952697754 + <_> + + <_> + + + + <_>2 11 8 5 -1. + <_>6 11 4 5 2. + 0 + 0.0720440000295639 + -0.1452589929103851 + 1.3676730394363403 + <_> + + <_> + + + + <_>16 7 8 5 -1. + <_>16 7 4 5 2. + 0 + 9.7759999334812164e-003 + 0.0129159996286035 + 0.2164089977741242 + <_> + + <_> + + + + <_>0 7 8 5 -1. + <_>4 7 4 5 2. + 0 + 0.0521540008485317 + -0.0163599997758865 + -0.8835629820823669 + <_> + + <_> + + + + <_>15 17 9 7 -1. + <_>18 17 3 7 3. + 0 + -0.0437909997999668 + 0.3582960069179535 + 0.0651310011744499 + <_> + + <_> + + + + <_>8 6 8 10 -1. + <_>8 6 4 5 2. + <_>12 11 4 5 2. + 0 + -0.0383789986371994 + 1.1961040496826172 + -0.1497150063514710 + <_> + + <_> + + + + <_>15 15 9 9 -1. + <_>18 15 3 9 3. + 0 + -0.0988389998674393 + -0.6183400154113770 + 0.1278620064258575 + <_> + + <_> + + + + <_>0 15 9 9 -1. + <_>3 15 3 9 3. + 0 + -0.1219070032238960 + -1.8276120424270630 + -0.0648629963397980 + <_> + + <_> + + + + <_>12 10 9 7 -1. + <_>15 10 3 7 3. + 0 + -0.1198170036077499 + -30. + 0.1132330000400543 + <_> + + <_> + + + + <_>3 10 9 7 -1. + <_>6 10 3 7 3. + 0 + 0.0309100002050400 + -0.2393400073051453 + 0.3633289933204651 + <_> + + <_> + + + + <_>13 15 10 8 -1. + <_>18 15 5 4 2. + <_>13 19 5 4 2. + 0 + 0.0108009995892644 + -0.0351400002837181 + 0.2770789861679077 + <_> + + <_> + + + + <_>0 1 6 12 -1. + <_>0 1 3 6 2. + <_>3 7 3 6 2. + 0 + 0.0568449981510639 + -0.1552429944276810 + 1.0802700519561768 + <_> + + <_> + + + + <_>10 0 6 12 -1. + <_>13 0 3 6 2. + <_>10 6 3 6 2. + 0 + 1.0280000278726220e-003 + -0.0612029992043972 + 0.2050800025463104 + <_> + + <_> + + + + <_>7 0 10 12 -1. + <_>7 0 5 6 2. + <_>12 6 5 6 2. + 0 + -0.0282739996910095 + -0.6477800011634827 + 0.0239170007407665 + <_> + + <_> + + + + <_>4 1 16 8 -1. + <_>4 1 8 8 2. + 0 + -0.1601359993219376 + 1.0892050266265869 + 0.0583890005946159 + <_> + + <_> + + + + <_>0 21 19 3 -1. + <_>0 22 19 1 3. + 0 + 4.9629998393356800e-003 + -0.2580629885196686 + 0.2083459943532944 + <_> + + <_> + + + + <_>6 9 18 4 -1. + <_>15 9 9 2 2. + <_>6 11 9 2 2. + 0 + 0.0469370000064373 + 0.1388629972934723 + -1.5662620067596436 + <_> + + <_> + + + + <_>3 4 9 6 -1. + <_>3 6 9 2 3. + 0 + 0.0242860000580549 + -0.2072830051183701 + 0.5243099927902222 + <_> + + <_> + + + + <_>9 1 6 15 -1. + <_>9 6 6 5 3. + 0 + 0.0702020004391670 + 0.1479689925909042 + -1.3095090389251709 + <_> + + <_> + + + + <_>5 9 6 6 -1. + <_>8 9 3 6 2. + 0 + 9.8120002076029778e-003 + 0.0279060006141663 + -0.5086460113525391 + <_> + + <_> + + + + <_>5 1 14 9 -1. + <_>5 4 14 3 3. + 0 + -0.0562009997665882 + 1.2618130445480347 + 0.0638019964098930 + <_> + + <_> + + + + <_>3 0 8 20 -1. + <_>3 0 4 10 2. + <_>7 10 4 10 2. + 0 + 0.1098280027508736 + -0.1285009980201721 + 3.0776169300079346 + -3.2573320865631104 + 21 + -1 + <_> + + + <_> + + <_> + + + + <_>5 0 7 9 -1. + <_>5 3 7 3 3. + 0 + 0.0209100004285574 + -0.6855940222740173 + 0.3898429870605469 + <_> + + <_> + + + + <_>6 6 12 5 -1. + <_>10 6 4 5 3. + 0 + 0.0350320003926754 + -0.4772439897060394 + 0.4502719938755035 + <_> + + <_> + + + + <_>0 1 8 14 -1. + <_>4 1 4 14 2. + 0 + 0.0397990010678768 + -0.4701110124588013 + 0.4270249903202057 + <_> + + <_> + + + + <_>2 12 22 4 -1. + <_>2 14 22 2 2. + 0 + -4.8409998416900635e-003 + 0.2561430037021637 + -0.6655629873275757 + <_> + + <_> + + + + <_>8 17 6 6 -1. + <_>8 20 6 3 2. + 0 + 2.3439999204128981e-003 + -0.4808349907398224 + 0.2801379859447479 + <_> + + <_> + + + + <_>18 1 6 7 -1. + <_>18 1 3 7 2. + 0 + 0.0253129992634058 + -0.2394820004701614 + 0.4419179856777191 + <_> + + <_> + + + + <_>0 0 6 6 -1. + <_>3 0 3 6 2. + 0 + -0.0321930013597012 + 0.7608669996261597 + -0.2505910098552704 + <_> + + <_> + + + + <_>4 6 17 18 -1. + <_>4 12 17 6 3. + 0 + 0.0754090026021004 + -0.3497459888458252 + 0.3438029885292053 + <_> + + <_> + + + + <_>6 0 12 6 -1. + <_>6 0 6 3 2. + <_>12 3 6 3 2. + 0 + -0.0184690002351999 + -0.7908560037612915 + 0.0347880013287067 + <_> + + <_> + + + + <_>4 7 18 4 -1. + <_>13 7 9 2 2. + <_>4 9 9 2 2. + 0 + -0.0128020001575351 + 0.4710780084133148 + -0.0600060001015663 + <_> + + <_> + + + + <_>4 12 10 6 -1. + <_>4 14 10 2 3. + 0 + -0.0265980008989573 + 0.6711609959602356 + -0.2425750046968460 + <_> + + <_> + + + + <_>7 9 10 12 -1. + <_>12 9 5 6 2. + <_>7 15 5 6 2. + 0 + 0.0219889990985394 + 0.2471749931573868 + -0.4830169975757599 + <_> + + <_> + + + + <_>0 1 24 3 -1. + <_>8 1 8 3 3. + 0 + 0.1465409994125366 + -0.2150409966707230 + 0.7205590009689331 + <_> + + <_> + + + + <_>13 11 6 6 -1. + <_>13 11 3 6 2. + 0 + 3.5310001112520695e-003 + 0.2793099880218506 + -0.3433989882469177 + <_> + + <_> + + + + <_>5 11 6 6 -1. + <_>8 11 3 6 2. + 0 + 9.4010001048445702e-003 + 0.0558619983494282 + -0.8214359879493713 + <_> + + <_> + + + + <_>3 10 19 3 -1. + <_>3 11 19 1 3. + 0 + -8.6390003561973572e-003 + -0.9962059855461121 + 0.1887499988079071 + <_> + + <_> + + + + <_>0 2 6 9 -1. + <_>0 5 6 3 3. + 0 + -0.0391930006444454 + -1.1945559978485107 + -0.0291980002075434 + <_> + + <_> + + + + <_>14 16 10 6 -1. + <_>14 18 10 2 3. + 0 + 0.0248550008982420 + 0.1498759984970093 + -0.5413780212402344 + <_> + + <_> + + + + <_>0 16 10 6 -1. + <_>0 18 10 2 3. + 0 + -0.0349950008094311 + -1.4210180044174194 + -0.0423140004277229 + <_> + + <_> + + + + <_>14 13 9 6 -1. + <_>14 15 9 2 3. + 0 + -0.0183789990842342 + -0.2824259996414185 + 0.1558180004358292 + <_> + + <_> + + + + <_>0 16 18 3 -1. + <_>0 17 18 1 3. + 0 + -0.0135920001193881 + 0.4731709957122803 + -0.2193720042705536 + <_> + + <_> + + + + <_>6 16 18 3 -1. + <_>6 17 18 1 3. + 0 + 6.2629999592900276e-003 + -0.0597140006721020 + 0.6062589883804321 + <_> + + <_> + + + + <_>0 18 9 6 -1. + <_>0 20 9 2 3. + 0 + -0.0184780005365610 + -0.8564720153808594 + -0.0137839997187257 + <_> + + <_> + + + + <_>14 13 9 6 -1. + <_>14 15 9 2 3. + 0 + 0.0142360003665090 + 0.1665479987859726 + -0.2771399915218353 + <_> + + <_> + + + + <_>6 2 6 9 -1. + <_>8 2 2 9 3. + 0 + -0.0325470007956028 + -1.1728240251541138 + -0.0401850007474422 + <_> + + <_> + + + + <_>15 8 4 12 -1. + <_>15 8 2 12 2. + 0 + -2.6410000864416361e-003 + 0.2651430070400238 + -0.0563430003821850 + <_> + + <_> + + + + <_>8 13 8 8 -1. + <_>8 17 8 4 2. + 0 + -8.7799999164417386e-004 + 0.0365560017526150 + -0.5507519841194153 + <_> + + <_> + + + + <_>4 20 18 3 -1. + <_>10 20 6 3 3. + 0 + 0.0473719984292984 + -0.0426140017807484 + 0.4819490015506744 + <_> + + <_> + + + + <_>5 8 4 12 -1. + <_>7 8 2 12 2. + 0 + -7.0790001191198826e-003 + 0.2869899868965149 + -0.3292300105094910 + <_> + + <_> + + + + <_>7 7 12 3 -1. + <_>7 7 6 3 2. + 0 + -0.0431459993124008 + -1.4065419435501099 + 0.1283639967441559 + <_> + + <_> + + + + <_>10 6 4 9 -1. + <_>12 6 2 9 2. + 0 + 0.0205920003354549 + -0.2143529951572418 + 0.5398179888725281 + <_> + + <_> + + + + <_>5 20 18 3 -1. + <_>11 20 6 3 3. + 0 + -0.0223670005798340 + 0.3371829986572266 + 0.0452120006084442 + <_> + + <_> + + + + <_>1 20 18 3 -1. + <_>7 20 6 3 3. + 0 + 0.0500399991869926 + -0.2512170076370239 + 0.4175049960613251 + <_> + + <_> + + + + <_>18 1 6 20 -1. + <_>21 1 3 10 2. + <_>18 11 3 10 2. + 0 + 0.0617949999868870 + 0.0400849990546703 + 0.6877980232238770 + <_> + + <_> + + + + <_>0 1 6 20 -1. + <_>0 1 3 10 2. + <_>3 11 3 10 2. + 0 + -0.0418619997799397 + 0.5302739739418030 + -0.2290199995040894 + <_> + + <_> + + + + <_>13 3 4 18 -1. + <_>15 3 2 9 2. + <_>13 12 2 9 2. + 0 + -3.1959998887032270e-003 + 0.2516149878501892 + -0.2151460051536560 + <_> + + <_> + + + + <_>0 2 6 12 -1. + <_>0 6 6 4 3. + 0 + 0.0242550000548363 + 7.2320001199841499e-003 + -0.7251909971237183 + <_> + + <_> + + + + <_>12 9 12 6 -1. + <_>18 9 6 3 2. + <_>12 12 6 3 2. + 0 + -0.0173039995133877 + -0.4995819926261902 + 0.1839450001716614 + <_> + + <_> + + + + <_>7 3 4 18 -1. + <_>7 3 2 9 2. + <_>9 12 2 9 2. + 0 + -4.1470001451671124e-003 + 0.0852119997143745 + -0.4636470079421997 + <_> + + <_> + + + + <_>14 0 6 9 -1. + <_>16 0 2 9 3. + 0 + -0.0143699999898672 + -0.5225890278816223 + 0.2389259934425354 + <_> + + <_> + + + + <_>0 9 12 6 -1. + <_>0 9 6 3 2. + <_>6 12 6 3 2. + 0 + -9.0399999171495438e-003 + -0.6325039863586426 + 0.0325510017573833 + <_> + + <_> + + + + <_>14 4 8 20 -1. + <_>18 4 4 10 2. + <_>14 14 4 10 2. + 0 + -0.1237310022115707 + 1.2856210470199585 + 0.0765450000762939 + <_> + + <_> + + + + <_>2 4 8 20 -1. + <_>2 4 4 10 2. + <_>6 14 4 10 2. + 0 + -0.0822219997644424 + 0.8320819735527039 + -0.1859059929847717 + <_> + + <_> + + + + <_>14 13 9 6 -1. + <_>14 15 9 2 3. + 0 + 0.0656590014696121 + 0.1129880025982857 + -30. + <_> + + <_> + + + + <_>1 13 9 6 -1. + <_>1 15 9 2 3. + 0 + -0.0315829999744892 + -1.3485900163650513 + -0.0470970012247562 + <_> + + <_> + + + + <_>3 15 18 3 -1. + <_>9 15 6 3 3. + 0 + -0.0796360000967979 + -1.3533639907836914 + 0.1566880047321320 + <_> + + <_> + + + + <_>5 13 9 6 -1. + <_>5 15 9 2 3. + 0 + -0.0188800003379583 + 0.4030030071735382 + -0.2514890134334564 + <_> + + <_> + + + + <_>5 0 18 3 -1. + <_>5 1 18 1 3. + 0 + -5.0149997696280479e-003 + -0.2628709971904755 + 0.1858250051736832 + <_> + + <_> + + + + <_>8 2 6 7 -1. + <_>11 2 3 7 2. + 0 + -0.0122180003672838 + 0.5869240164756775 + -0.1942770034074783 + <_> + + <_> + + + + <_>9 1 9 6 -1. + <_>12 1 3 6 3. + 0 + 1.2710000155493617e-003 + -0.1668899953365326 + 0.2300689965486527 + <_> + + <_> + + + + <_>6 1 9 6 -1. + <_>9 1 3 6 3. + 0 + 0.0297439992427826 + 0.0125200003385544 + -0.6672359704971314 + <_> + + <_> + + + + <_>5 6 14 6 -1. + <_>12 6 7 3 2. + <_>5 9 7 3 2. + 0 + 0.0281750001013279 + -0.0170600004494190 + 0.6457939743995667 + <_> + + <_> + + + + <_>8 2 6 13 -1. + <_>10 2 2 13 3. + 0 + 0.0303450003266335 + -0.2417870014905930 + 0.3487890064716339 + <_> + + <_> + + + + <_>6 11 12 6 -1. + <_>12 11 6 3 2. + <_>6 14 6 3 2. + 0 + -0.0173259992152452 + -0.5359939932823181 + 0.2099599987268448 + <_> + + <_> + + + + <_>3 1 18 15 -1. + <_>9 1 6 15 3. + 0 + -0.0841780006885529 + 0.7509329915046692 + -0.1759320050477982 + <_> + + <_> + + + + <_>13 0 6 7 -1. + <_>13 0 3 7 2. + 0 + 7.4950000271201134e-003 + -0.1618809998035431 + 0.3065750002861023 + <_> + + <_> + + + + <_>3 3 16 6 -1. + <_>3 6 16 3 2. + 0 + 0.0564949996769428 + -0.1731880009174347 + 1.0016150474548340 + <_> + + <_> + + + + <_>12 1 3 12 -1. + <_>12 7 3 6 2. + 0 + -5.2939997985959053e-003 + 0.2341759949922562 + -0.0653470009565353 + <_> + + <_> + + + + <_>7 7 6 9 -1. + <_>9 7 2 9 3. + 0 + -0.0149450004100800 + 0.2501890063285828 + -0.3059119880199432 + <_> + + <_> + + + + <_>13 0 4 24 -1. + <_>13 0 2 24 2. + 0 + 0.0549190007150173 + 0.1312199980020523 + -0.9376509785652161 + <_> + + <_> + + + + <_>7 0 4 24 -1. + <_>9 0 2 24 2. + 0 + -0.0197219997644424 + -0.8397849798202515 + -0.0234730001538992 + <_> + + <_> + + + + <_>11 9 5 12 -1. + <_>11 13 5 4 3. + 0 + -0.0671589970588684 + 2.3586840629577637 + 0.0829709991812706 + <_> + + <_> + + + + <_>7 15 9 6 -1. + <_>7 17 9 2 3. + 0 + -0.0143259996548295 + 0.1881449967622757 + -0.3122160136699677 + <_> + + <_> + + + + <_>5 7 18 6 -1. + <_>5 9 18 2 3. + 0 + 0.0298410002142191 + 0.1482509970664978 + -0.8468170166015625 + <_> + + <_> + + + + <_>8 9 5 12 -1. + <_>8 13 5 4 3. + 0 + 0.0518830008804798 + -0.0437310002744198 + -1.3366169929504395 + <_> + + <_> + + + + <_>4 17 17 6 -1. + <_>4 19 17 2 3. + 0 + 0.0411270000040531 + 0.1766009926795960 + -0.6090409755706787 + <_> + + <_> + + + + <_>0 3 18 14 -1. + <_>0 3 9 7 2. + <_>9 10 9 7 2. + 0 + -0.1286509931087494 + -0.9870100021362305 + -0.0377850010991097 + <_> + + <_> + + + + <_>0 1 24 2 -1. + <_>0 2 24 1 2. + 0 + 2.4170000106096268e-003 + -0.1611959934234619 + 0.3267570137977600 + <_> + + <_> + + + + <_>0 15 18 3 -1. + <_>0 16 18 1 3. + 0 + 7.7030002139508724e-003 + -0.2384150028228760 + 0.2931939959526062 + <_> + + <_> + + + + <_>9 0 6 9 -1. + <_>11 0 2 9 3. + 0 + 0.0455200001597404 + 0.1442459970712662 + -1.5010160207748413 + <_> + + <_> + + + + <_>3 3 14 12 -1. + <_>3 9 14 6 2. + 0 + -0.0787009969353676 + -1.0394560098648071 + -0.0453759990632534 + <_> + + <_> + + + + <_>12 1 3 12 -1. + <_>12 7 3 6 2. + 0 + 7.8619997948408127e-003 + 0.1963360011577606 + -0.1447239965200424 + <_> + + <_> + + + + <_>8 0 6 9 -1. + <_>10 0 2 9 3. + 0 + -0.0134589998051524 + -0.9063469767570496 + -0.0380490012466908 + <_> + + <_> + + + + <_>10 6 6 10 -1. + <_>12 6 2 10 3. + 0 + 0.0288270004093647 + -0.0294739995151758 + 0.6005839705467224 + <_> + + <_> + + + + <_>5 0 6 9 -1. + <_>7 0 2 9 3. + 0 + -0.0273659992963076 + -0.9980400204658508 + -0.0386530011892319 + <_> + + <_> + + + + <_>2 0 21 7 -1. + <_>9 0 7 7 3. + 0 + -0.0729179978370667 + 0.7336149811744690 + 0.0574400015175343 + <_> + + <_> + + + + <_>6 11 12 5 -1. + <_>10 11 4 5 3. + 0 + -0.0139889996498823 + 0.2789260149002075 + -0.2651630043983460 + <_> + + <_> + + + + <_>8 7 9 8 -1. + <_>11 7 3 8 3. + 0 + 0.0432429984211922 + 4.7760000452399254e-003 + 0.3592590093612671 + <_> + + <_> + + + + <_>9 6 6 18 -1. + <_>9 6 3 9 2. + <_>12 15 3 9 2. + 0 + 0.0295330006629229 + -0.2008399963378906 + 0.5120289921760559 + <_> + + <_> + + + + <_>15 14 8 10 -1. + <_>19 14 4 5 2. + <_>15 19 4 5 2. + 0 + -0.0318970009684563 + 0.6472169756889343 + -1.3760000001639128e-003 + <_> + + <_> + + + + <_>1 14 8 10 -1. + <_>1 14 4 5 2. + <_>5 19 4 5 2. + 0 + 0.0378689989447594 + -0.1836380064487457 + 0.6134309768676758 + <_> + + <_> + + + + <_>11 0 8 10 -1. + <_>15 0 4 5 2. + <_>11 5 4 5 2. + 0 + -0.0224179998040199 + -0.2918789982795715 + 0.1819480061531067 + <_> + + <_> + + + + <_>5 0 8 10 -1. + <_>5 0 4 5 2. + <_>9 5 4 5 2. + 0 + 0.0589589998126030 + -0.0664519965648651 + -1.9290030002593994 + <_> + + <_> + + + + <_>6 1 12 5 -1. + <_>6 1 6 5 2. + 0 + 0.0312229990959167 + -0.0127320000901818 + 0.6156079769134522 + <_> + + <_> + + + + <_>1 12 18 2 -1. + <_>10 12 9 2 2. + 0 + 0.0374849997460842 + -0.2085690051317215 + 0.4436399936676025 + <_> + + <_> + + + + <_>2 8 20 6 -1. + <_>12 8 10 3 2. + <_>2 11 10 3 2. + 0 + -0.0209660008549690 + -0.3571279942989349 + 0.2425220012664795 + <_> + + <_> + + + + <_>7 6 9 7 -1. + <_>10 6 3 7 3. + 0 + -0.0254779998213053 + 1.0846560001373291 + -0.1505440026521683 + <_> + + <_> + + + + <_>10 5 8 16 -1. + <_>14 5 4 8 2. + <_>10 13 4 8 2. + 0 + -7.2570000775158405e-003 + 0.2130260020494461 + -0.1830819994211197 + <_> + + <_> + + + + <_>3 9 16 8 -1. + <_>3 9 8 4 2. + <_>11 13 8 4 2. + 0 + -0.0509830005466938 + 0.5173680186271668 + -0.1883309930562973 + <_> + + <_> + + + + <_>7 8 10 4 -1. + <_>7 8 5 4 2. + 0 + -0.0206400007009506 + -0.4403020143508911 + 0.2274599969387054 + <_> + + <_> + + + + <_>7 12 10 8 -1. + <_>7 12 5 4 2. + <_>12 16 5 4 2. + 0 + 0.0106729995459318 + 0.0350599996745586 + -0.5166500210762024 + <_> + + <_> + + + + <_>9 19 15 4 -1. + <_>14 19 5 4 3. + 0 + 0.0318959988653660 + 0.0132280001416802 + 0.3491519987583160 + <_> + + <_> + + + + <_>1 0 18 9 -1. + <_>7 0 6 9 3. + 0 + -0.0238249991089106 + 0.3411880135536194 + -0.2151020020246506 + <_> + + <_> + + + + <_>13 4 10 8 -1. + <_>18 4 5 4 2. + <_>13 8 5 4 2. + 0 + -6.0680001042783260e-003 + 0.3293739855289459 + -0.2852379977703095 + <_> + + <_> + + + + <_>3 16 18 4 -1. + <_>9 16 6 4 3. + 0 + 0.0238819997757673 + -0.2533380091190338 + 0.2629610002040863 + <_> + + <_> + + + + <_>8 7 10 12 -1. + <_>13 7 5 6 2. + <_>8 13 5 6 2. + 0 + 0.0279660001397133 + 0.1404909938573837 + -0.4988709986209869 + <_> + + <_> + + + + <_>6 7 10 12 -1. + <_>6 7 5 6 2. + <_>11 13 5 6 2. + 0 + 0.0146030001342297 + -0.0153959998860955 + -0.7695800065994263 + <_> + + <_> + + + + <_>4 6 18 7 -1. + <_>10 6 6 7 3. + 0 + 0.1087239980697632 + 0.1906960010528565 + -0.3239310085773468 + <_> + + <_> + + + + <_>0 17 18 3 -1. + <_>0 18 18 1 3. + 0 + -0.0140380002558231 + 0.3492470085620880 + -0.2235870063304901 + <_> + + <_> + + + + <_>3 17 18 3 -1. + <_>3 18 18 1 3. + 0 + 4.0440000593662262e-003 + -0.0383290015161037 + 0.5117729902267456 + <_> + + <_> + + + + <_>2 4 6 10 -1. + <_>4 4 2 10 3. + 0 + -4.9769999459385872e-003 + -0.4288829863071442 + 0.0491739995777607 + <_> + + <_> + + + + <_>16 0 8 24 -1. + <_>16 0 4 24 2. + 0 + -0.0851830020546913 + 0.6662459969520569 + 7.8079998493194580e-003 + <_> + + <_> + + + + <_>4 0 8 15 -1. + <_>8 0 4 15 2. + 0 + 2.1559998858720064e-003 + -0.4913519918918610 + 0.0695559978485107 + <_> + + <_> + + + + <_>16 0 8 24 -1. + <_>16 0 4 24 2. + 0 + 0.3638449907302856 + 0.1299709975719452 + -1.8949509859085083 + <_> + + <_> + + + + <_>1 4 18 9 -1. + <_>7 4 6 9 3. + 0 + 0.2208250015974045 + -0.0572119988501072 + -1.4281120300292969 + <_> + + <_> + + + + <_>15 12 9 6 -1. + <_>15 14 9 2 3. + 0 + -0.0161400008946657 + -0.5758939981460571 + 0.1806250065565109 + <_> + + <_> + + + + <_>3 9 18 6 -1. + <_>3 9 9 3 2. + <_>12 12 9 3 2. + 0 + -0.0483300015330315 + 0.9730849862098694 + -0.1651300042867661 + <_> + + <_> + + + + <_>18 5 6 9 -1. + <_>18 8 6 3 3. + 0 + 0.0175299998372793 + 0.1793269962072372 + -0.2794890105724335 + <_> + + <_> + + + + <_>0 5 6 9 -1. + <_>0 8 6 3 3. + 0 + -0.0343099981546402 + -0.8107249736785889 + -0.0165960006415844 + <_> + + <_> + + + + <_>4 7 18 4 -1. + <_>13 7 9 2 2. + <_>4 9 9 2 2. + 0 + -4.5830002054572105e-003 + 0.2790899872779846 + -7.4519999325275421e-003 + <_> + + <_> + + + + <_>2 1 12 20 -1. + <_>2 1 6 10 2. + <_>8 11 6 10 2. + 0 + 0.1289640069007874 + -0.1350850015878677 + 2.5411539077758789 + <_> + + <_> + + + + <_>17 0 6 23 -1. + <_>17 0 3 23 2. + 0 + 0.0303610004484653 + -0.0684190019965172 + 0.2873409986495972 + <_> + + <_> + + + + <_>1 6 2 18 -1. + <_>1 15 2 9 2. + 0 + 0.0440860018134117 + -0.1813589930534363 + 0.6541320085525513 + <_> + + <_> + + + + <_>8 8 10 6 -1. + <_>8 10 10 2 3. + 0 + 3.0159999150782824e-003 + -0.1569049954414368 + 0.2696380019187927 + <_> + + <_> + + + + <_>0 6 20 6 -1. + <_>0 6 10 3 2. + <_>10 9 10 3 2. + 0 + -0.0263369996100664 + 0.2917560040950775 + -0.2527410089969635 + <_> + + <_> + + + + <_>11 12 12 5 -1. + <_>15 12 4 5 3. + 0 + -0.0278660003095865 + 0.4438750147819519 + 0.0550380013883114 + <_> + + <_> + + + + <_>0 4 3 19 -1. + <_>1 4 1 19 3. + 0 + 0.0117250001057982 + -0.1934649944305420 + 0.4665670096874237 + <_> + + <_> + + + + <_>19 1 3 18 -1. + <_>20 1 1 18 3. + 0 + 1.5689999563619494e-003 + -8.2360003143548965e-003 + 0.2570089995861054 + <_> + + <_> + + + + <_>2 1 3 18 -1. + <_>3 1 1 18 3. + 0 + -3.5550000611692667e-003 + -0.4243089854717255 + 0.0711740031838417 + <_> + + <_> + + + + <_>3 10 18 3 -1. + <_>9 10 6 3 3. + 0 + -0.0316950008273125 + -0.8539350032806397 + 0.1691620051860809 + <_> + + <_> + + + + <_>4 4 10 9 -1. + <_>9 4 5 9 2. + 0 + -0.0320970006287098 + 0.8378490209579468 + -0.1759729981422424 + <_> + + <_> + + + + <_>7 13 14 7 -1. + <_>7 13 7 7 2. + 0 + 0.1554419994354248 + 0.0995500013232231 + 2.3873300552368164 + <_> + + <_> + + + + <_>3 13 14 7 -1. + <_>10 13 7 7 2. + 0 + 0.0880459994077683 + -0.1872529983520508 + 0.6238430142402649 + <_> + + <_> + + + + <_>8 15 9 6 -1. + <_>11 15 3 6 3. + 0 + -1.6720000421628356e-003 + 0.2500869929790497 + -0.0651189982891083 + <_> + + <_> + + + + <_>4 14 8 10 -1. + <_>4 14 4 5 2. + <_>8 19 4 5 2. + 0 + 9.3409996479749680e-003 + -0.3537890017032623 + 0.1071500033140183 + <_> + + <_> + + + + <_>10 14 4 10 -1. + <_>10 19 4 5 2. + 0 + 0.0371380001306534 + 0.1638700067996979 + -0.9171839952468872 + <_> + + <_> + + + + <_>3 8 5 16 -1. + <_>3 16 5 8 2. + 0 + 0.0801839977502823 + -0.1481299996376038 + 1.4895190000534058 + <_> + + <_> + + + + <_>15 10 9 6 -1. + <_>15 12 9 2 3. + 0 + -7.9100002767518163e-004 + -0.2132689952850342 + 0.1967640072107315 + <_> + + <_> + + + + <_>0 10 9 6 -1. + <_>0 12 9 2 3. + 0 + -5.0400001928210258e-003 + -0.7131869792938232 + 1.8240000354126096e-003 + <_> + + <_> + + + + <_>6 7 12 9 -1. + <_>6 10 12 3 3. + 0 + 0.1196239963173866 + 0.0330989994108677 + 1.0441709756851196 + <_> + + <_> + + + + <_>9 10 5 8 -1. + <_>9 14 5 4 2. + 0 + -4.5280000194907188e-003 + -0.2730849981307983 + 0.2722980082035065 + <_> + + <_> + + + + <_>12 1 3 12 -1. + <_>12 7 3 6 2. + 0 + -0.0296390000730753 + 0.3622579872608185 + 0.0567950010299683 + <_> + + <_> + + + + <_>8 15 6 9 -1. + <_>10 15 2 9 3. + 0 + 0.0266500003635883 + -0.0480410009622574 + -0.9672350287437439 + <_> + + <_> + + + + <_>16 6 7 6 -1. + <_>16 9 7 3 2. + 0 + 0.0444220006465912 + 0.1305290013551712 + -0.3507730066776276 + <_> + + <_> + + + + <_>8 1 4 22 -1. + <_>10 1 2 22 2. + 0 + -0.0243599992245436 + -1.0766899585723877 + -0.0512229986488819 + <_> + + <_> + + + + <_>6 6 14 3 -1. + <_>6 6 7 3 2. + 0 + 0.0197349991649389 + 0.0262380000203848 + 0.2807050049304962 + <_> + + <_> + + + + <_>0 18 19 3 -1. + <_>0 19 19 1 3. + 0 + 5.4930001497268677e-003 + -0.2611129879951477 + 0.2101140022277832 + <_> + + <_> + + + + <_>17 0 6 24 -1. + <_>17 0 3 24 2. + 0 + -0.2320030033588409 + -1.7748440504074097 + 0.1148260012269020 + <_> + + <_> + + + + <_>0 13 15 6 -1. + <_>5 13 5 6 3. + 0 + -0.0256140008568764 + 0.2990080118179321 + -0.2250249981880188 + <_> + + <_> + + + + <_>9 6 10 14 -1. + <_>14 6 5 7 2. + <_>9 13 5 7 2. + 0 + -6.4949998632073402e-003 + 0.1956380009651184 + -0.0997629985213280 + <_> + + <_> + + + + <_>1 6 8 10 -1. + <_>1 6 4 5 2. + <_>5 11 4 5 2. + 0 + 3.9840000681579113e-003 + -0.4302150011062622 + 0.0812610015273094 + <_> + + <_> + + + + <_>7 6 12 5 -1. + <_>7 6 6 5 2. + 0 + -0.0358130000531673 + -0.5098739862442017 + 0.1634590029716492 + <_> + + <_> + + + + <_>7 7 9 6 -1. + <_>10 7 3 6 3. + 0 + -0.0141690000891685 + 0.7797809839248657 + -0.1747629940509796 + <_> + + <_> + + + + <_>7 8 14 14 -1. + <_>14 8 7 7 2. + <_>7 15 7 7 2. + 0 + -0.1264210045337677 + -0.6304789781570435 + 0.1272830069065094 + <_> + + <_> + + + + <_>3 8 14 14 -1. + <_>3 8 7 7 2. + <_>10 15 7 7 2. + 0 + 0.0686779990792274 + -0.0464479997754097 + -1.1128979921340942 + <_> + + <_> + + + + <_>9 8 13 4 -1. + <_>9 10 13 2 2. + 0 + 0.0858649984002113 + 0.1183540001511574 + -4.8235158920288086 + <_> + + <_> + + + + <_>3 2 6 12 -1. + <_>3 2 3 6 2. + <_>6 8 3 6 2. + 0 + 0.0155119998380542 + -0.0174679998308420 + -0.6369339823722839 + <_> + + <_> + + + + <_>6 10 17 6 -1. + <_>6 13 17 3 2. + 0 + 0.0810910016298294 + 0.0861330032348633 + 2.4559431076049805 + <_> + + <_> + + + + <_>1 10 17 6 -1. + <_>1 13 17 3 2. + 0 + 0.0184950008988380 + 0.0402290001511574 + -0.5085819959640503 + <_> + + <_> + + + + <_>16 7 8 9 -1. + <_>16 10 8 3 3. + 0 + -0.0863209962844849 + -1.9006760120391846 + 0.1101910024881363 + <_> + + <_> + + + + <_>0 7 8 9 -1. + <_>0 10 8 3 3. + 0 + 0.0723550021648407 + -0.0621119998395443 + -1.4165179729461670 + <_> + + <_> + + + + <_>0 9 24 10 -1. + <_>12 9 12 5 2. + <_>0 14 12 5 2. + 0 + -0.0781790018081665 + 0.8884930014610291 + 0.0423699989914894 + <_> + + <_> + + + + <_>3 2 15 8 -1. + <_>8 2 5 8 3. + 0 + 0.0966819971799850 + -0.2209420055150986 + 0.3357509970664978 + <_> + + <_> + + + + <_>4 2 18 8 -1. + <_>10 2 6 8 3. + 0 + -0.0398759990930557 + 0.5780479907989502 + 0.0453479997813702 + <_> + + <_> + + + + <_>0 1 18 4 -1. + <_>0 1 9 2 2. + <_>9 3 9 2 2. + 0 + -9.5349997282028198e-003 + -0.5417569875717163 + 3.2399999909102917e-003 + <_> + + <_> + + + + <_>20 2 3 18 -1. + <_>21 2 1 18 3. + 0 + 4.0600000647827983e-004 + -0.0815490037202835 + 0.3583790063858032 + <_> + + <_> + + + + <_>1 3 3 19 -1. + <_>2 3 1 19 3. + 0 + 0.0121079999953508 + -0.2028039991855621 + 0.4376800060272217 + <_> + + <_> + + + + <_>18 8 6 16 -1. + <_>20 8 2 16 3. + 0 + -0.0208739992231131 + 0.4146989881992340 + -0.0455680005252361 + <_> + + <_> + + + + <_>0 8 6 16 -1. + <_>2 8 2 16 3. + 0 + 0.0578880012035370 + -0.0290099997073412 + -0.9182230234146118 + <_> + + <_> + + + + <_>8 18 11 6 -1. + <_>8 20 11 2 3. + 0 + 1.3200000103097409e-004 + -0.1177240014076233 + 0.2000000029802322 + <_> + + <_> + + + + <_>4 6 12 5 -1. + <_>8 6 4 5 3. + 0 + -0.0171370003372431 + 0.3300479948520660 + -0.2305520027875900 + <_> + + <_> + + + + <_>7 6 12 5 -1. + <_>11 6 4 5 3. + 0 + 0.0306550003588200 + -0.0215450003743172 + 0.2687819898128510 + <_> + + <_> + + + + <_>6 3 9 6 -1. + <_>9 3 3 6 3. + 0 + -7.8699999721720815e-004 + -0.4410069882869721 + 0.0491579994559288 + <_> + + <_> + + + + <_>7 6 12 5 -1. + <_>7 6 6 5 2. + 0 + 0.0880369991064072 + 0.1178200021386147 + -2.8293309211730957 + <_> + + <_> + + + + <_>9 8 6 7 -1. + <_>12 8 3 7 2. + 0 + -0.0390289984643459 + 0.9177719950675964 + -0.1582739949226379 + <_> + + <_> + + + + <_>8 2 9 6 -1. + <_>11 2 3 6 3. + 0 + 0.0801059976220131 + 0.1128920018672943 + -1.9937280416488647 + <_> + + <_> + + + + <_>8 14 6 9 -1. + <_>8 17 6 3 3. + 0 + 0.0395389981567860 + -0.1435739994049072 + 1.3085240125656128 + <_> + + <_> + + + + <_>8 2 9 6 -1. + <_>11 2 3 6 3. + 0 + 0.0206840001046658 + 0.2004809975624085 + -0.0441869981586933 + <_> + + <_> + + + + <_>4 3 16 20 -1. + <_>4 3 8 10 2. + <_>12 13 8 10 2. + 0 + -0.0670379996299744 + 0.3261860013008118 + -0.2055040001869202 + <_> + + <_> + + + + <_>7 6 10 12 -1. + <_>12 6 5 6 2. + <_>7 12 5 6 2. + 0 + 0.0468150004744530 + 0.1582529991865158 + -0.9553509950637817 + <_> + + <_> + + + + <_>0 2 7 12 -1. + <_>0 6 7 4 3. + 0 + 0.0784439966082573 + -0.0746510028839111 + -2.1161499023437500 + <_> + + <_> + + + + <_>12 17 11 6 -1. + <_>12 19 11 2 3. + 0 + 0.0663800016045570 + 0.1164190024137497 + -1.6113519668579102 + <_> + + <_> + + + + <_>4 7 12 8 -1. + <_>4 7 6 4 2. + <_>10 11 6 4 2. + 0 + 0.0300539992749691 + -0.1656260043382645 + 0.7002540230751038 + <_> + + <_> + + + + <_>8 11 8 10 -1. + <_>12 11 4 5 2. + <_>8 16 4 5 2. + 0 + 0.0171199999749660 + 0.2262769937515259 + -0.4011499881744385 + <_> + + <_> + + + + <_>9 1 4 9 -1. + <_>11 1 2 9 2. + 0 + 0.0200730003416538 + -0.1938969939947128 + 0.4442029893398285 + <_> + + <_> + + + + <_>14 0 3 22 -1. + <_>15 0 1 22 3. + 0 + 0.0331019982695580 + 0.1163749992847443 + -1.5771679878234863 + <_> + + <_> + + + + <_>7 0 3 22 -1. + <_>8 0 1 22 3. + 0 + -0.0148820001631975 + -0.8968030214309692 + -0.0420100018382072 + <_> + + <_> + + + + <_>4 7 18 4 -1. + <_>13 7 9 2 2. + <_>4 9 9 2 2. + 0 + -0.0102810002863407 + 0.3560299873352051 + -0.0131240002810955 + <_> + + <_> + + + + <_>10 2 4 15 -1. + <_>10 7 4 5 3. + 0 + -0.0286950003355742 + -0.4603959918022156 + 0.0268019996583462 + <_> + + <_> + + + + <_>12 1 3 12 -1. + <_>12 7 3 6 2. + 0 + -4.7189998440444469e-003 + 0.2378879934549332 + -0.0655189976096153 + <_> + + <_> + + + + <_>0 0 18 13 -1. + <_>9 0 9 13 2. + 0 + 0.3220160007476807 + -0.0284899994730949 + -0.8423460125923157 + <_> + + <_> + + + + <_>16 0 3 24 -1. + <_>17 0 1 24 3. + 0 + -0.0170450005680323 + -0.5093880295753479 + 0.1605760008096695 + <_> + + <_> + + + + <_>5 0 3 24 -1. + <_>6 0 1 24 3. + 0 + -7.3469998314976692e-003 + -0.5415499806404114 + 4.7320001758635044e-003 + <_> + + <_> + + + + <_>10 15 5 8 -1. + <_>10 19 5 4 2. + 0 + -0.0300019998103380 + -0.8878579735755920 + 0.1362179964780808 + <_> + + <_> + + + + <_>2 18 18 2 -1. + <_>2 19 18 1 2. + 0 + -0.0112929996103048 + 0.8061519861221314 + -0.1615950018167496 + <_> + + <_> + + + + <_>2 8 20 3 -1. + <_>2 9 20 1 3. + 0 + 4.7749998047947884e-003 + 0.0129680000245571 + 0.5507990121841431 + <_> + + <_> + + + + <_>7 6 9 6 -1. + <_>7 8 9 2 3. + 0 + 5.0710001960396767e-003 + -0.0457280017435551 + -1.0766259431838989 + <_> + + <_> + + + + <_>3 2 19 10 -1. + <_>3 7 19 5 2. + 0 + 0.1934410035610199 + 0.0712620019912720 + 1.1694519519805908 + <_> + + <_> + + + + <_>2 7 19 3 -1. + <_>2 8 19 1 3. + 0 + 5.3750001825392246e-003 + -0.1973620057106018 + 0.3820689916610718 + <_> + + <_> + + + + <_>15 6 9 4 -1. + <_>15 8 9 2 2. + 0 + -0.0682760030031204 + -5.4372339248657227 + 0.1115190014243126 + <_> + + <_> + + + + <_>2 2 18 8 -1. + <_>8 2 6 8 3. + 0 + -0.0349330008029938 + 0.4479340016841888 + -0.1865790039300919 + <_> + + <_> + + + + <_>10 9 14 4 -1. + <_>10 9 7 4 2. + 0 + 5.1219998858869076e-003 + -0.0148719996213913 + 0.1841389983892441 + <_> + + <_> + + + + <_>4 4 6 16 -1. + <_>7 4 3 16 2. + 0 + 0.0953119993209839 + -0.1511709988117218 + 0.9499149918556213 + <_> + + <_> + + + + <_>15 8 9 16 -1. + <_>18 8 3 16 3. + 0 + -0.0628490000963211 + 0.4647360146045685 + 0.0384050011634827 + <_> + + <_> + + + + <_>0 8 9 16 -1. + <_>3 8 3 16 3. + 0 + -0.1704069972038269 + -1.6499999761581421 + -0.0632369965314865 + <_> + + <_> + + + + <_>18 0 6 14 -1. + <_>20 0 2 14 3. + 0 + 0.0105839995667338 + -0.0383489988744259 + 0.4191380143165588 + <_> + + <_> + + + + <_>0 0 6 14 -1. + <_>2 0 2 14 3. + 0 + -0.0415790006518364 + 0.3446190059185028 + -0.2118770033121109 + <_> + + <_> + + + + <_>15 0 6 22 -1. + <_>17 0 2 22 3. + 0 + 0.1271860003471375 + 0.1239819973707199 + -2.1254889965057373 + <_> + + <_> + + + + <_>3 0 6 22 -1. + <_>5 0 2 22 3. + 0 + 0.0825570002198219 + -0.0620240010321140 + -1.4875819683074951 + <_> + + <_> + + + + <_>12 2 12 20 -1. + <_>16 2 4 20 3. + 0 + 0.0852930024266243 + 0.0170879997313023 + 0.3207660019397736 + <_> + + <_> + + + + <_>0 2 12 20 -1. + <_>4 2 4 20 3. + 0 + 0.0555440001189709 + -0.2741400003433228 + 0.1897639930248261 + <_> + + <_> + + + + <_>11 6 4 9 -1. + <_>11 6 2 9 2. + 0 + 4.5650000683963299e-003 + -0.1792020052671433 + 0.2796730101108551 + <_> + + <_> + + + + <_>9 0 6 16 -1. + <_>12 0 3 16 2. + 0 + 0.0129979997873306 + -0.3229750096797943 + 0.2694180011749268 + <_> + + <_> + + + + <_>12 1 3 12 -1. + <_>12 7 3 6 2. + 0 + 0.0578919984400272 + 0.1264439970254898 + -0.6071349978446960 + <_> + + <_> + + + + <_>3 4 18 6 -1. + <_>3 4 9 3 2. + <_>12 7 9 3 2. + 0 + -0.0228240005671978 + -0.4968209862709045 + 0.0223769992589951 + <_> + + <_> + + + + <_>5 5 16 8 -1. + <_>13 5 8 4 2. + <_>5 9 8 4 2. + 0 + 0.0483120009303093 + 0.0436070002615452 + 0.4853779971599579 + <_> + + <_> + + + + <_>0 13 10 6 -1. + <_>0 15 10 2 3. + 0 + 0.0257140006870031 + -0.0429509989917278 + -0.9302350282669067 + <_> + + <_> + + + + <_>8 14 9 6 -1. + <_>8 16 9 2 3. + 0 + 6.9269998930394650e-003 + -2.9680000152438879e-003 + 0.3429630100727081 + <_> + + <_> + + + + <_>6 2 9 6 -1. + <_>9 2 3 6 3. + 0 + -0.0344469994306564 + -1.5299769639968872 + -0.0610149987041950 + <_> + + <_> + + + + <_>14 1 10 8 -1. + <_>19 1 5 4 2. + <_>14 5 5 4 2. + 0 + 0.0293879993259907 + 0.0375959984958172 + 0.6417239904403687 + <_> + + <_> + + + + <_>9 1 3 12 -1. + <_>9 7 3 6 2. + 0 + -2.4319998919963837e-003 + 0.0990889966487885 + -0.3968810141086578 + -3.3703000545501709 + 22 + -1 + <_> + + + <_> + + <_> + + + + <_>6 4 12 9 -1. + <_>6 7 12 3 3. + 0 + -0.0959440022706985 + 0.6241909861564636 + -0.4587520062923431 + <_> + + <_> + + + + <_>6 5 12 6 -1. + <_>10 5 4 6 3. + 0 + 0.0168340001255274 + -0.9307280182838440 + 0.2156360000371933 + <_> + + <_> + + + + <_>1 1 8 5 -1. + <_>5 1 4 5 2. + 0 + 0.0260499995201826 + -0.4053229987621307 + 0.4225659966468811 + <_> + + <_> + + + + <_>12 12 6 8 -1. + <_>12 16 6 4 2. + 0 + 3.6500001442618668e-004 + 0.0952880010008812 + -0.6329810023307800 + <_> + + <_> + + + + <_>3 12 12 6 -1. + <_>3 14 12 2 3. + 0 + -6.6940002143383026e-003 + 0.3724380135536194 + -0.3033240139484406 + <_> + + <_> + + + + <_>9 18 12 6 -1. + <_>15 18 6 3 2. + <_>9 21 6 3 2. + 0 + 0.0188740007579327 + -0.2335720062255859 + 0.4033069908618927 + <_> + + <_> + + + + <_>4 13 6 6 -1. + <_>4 16 6 3 2. + 0 + -1.6300000424962491e-004 + 0.0428869985044003 + -0.7779679894447327 + <_> + + <_> + + + + <_>11 3 7 18 -1. + <_>11 12 7 9 2. + 0 + -0.0762590020895004 + -0.4962849915027618 + 0.1633539944887161 + <_> + + <_> + + + + <_>3 9 18 3 -1. + <_>9 9 6 3 3. + 0 + 0.0501490011811256 + 0.0327470004558563 + -0.8004789948463440 + <_> + + <_> + + + + <_>5 3 19 2 -1. + <_>5 4 19 1 2. + 0 + -2.9239999130368233e-003 + -0.5000280141830444 + 0.2548060119152069 + <_> + + <_> + + + + <_>4 2 12 6 -1. + <_>4 2 6 3 2. + <_>10 5 6 3 2. + 0 + 0.0162439998239279 + 0.0389130003750324 + -0.7072489857673645 + <_> + + <_> + + + + <_>9 6 6 9 -1. + <_>11 6 2 9 3. + 0 + 0.0378119982779026 + -0.0662679970264435 + 0.7386879920959473 + <_> + + <_> + + + + <_>8 6 6 9 -1. + <_>10 6 2 9 3. + 0 + -0.0123199997469783 + 0.4869639873504639 + -0.2448559999465942 + <_> + + <_> + + + + <_>16 9 5 15 -1. + <_>16 14 5 5 3. + 0 + 0.0580039992928505 + 0.1345909982919693 + -0.1323210000991821 + <_> + + <_> + + + + <_>3 9 5 15 -1. + <_>3 14 5 5 3. + 0 + 4.8630000092089176e-003 + -0.4417290091514587 + 0.1400559991598129 + <_> + + <_> + + + + <_>6 6 14 6 -1. + <_>13 6 7 3 2. + <_>6 9 7 3 2. + 0 + 0.0456909984350204 + 0.0312179997563362 + 0.8981829881668091 + <_> + + <_> + + + + <_>8 6 3 14 -1. + <_>8 13 3 7 2. + 0 + 0.0213210005313158 + 0.0120080001652241 + -0.8606619834899902 + <_> + + <_> + + + + <_>0 16 24 5 -1. + <_>8 16 8 5 3. + 0 + 0.1567910015583038 + 0.0140559999272227 + 0.8533290028572083 + <_> + + <_> + + + + <_>0 20 20 3 -1. + <_>10 20 10 3 2. + 0 + -0.0103289997205138 + 0.2902280092239380 + -0.2947880029678345 + <_> + + <_> + + + + <_>5 10 18 2 -1. + <_>5 11 18 1 2. + 0 + 2.4290001019835472e-003 + -0.4043990075588226 + 0.1940020024776459 + <_> + + <_> + + + + <_>0 6 6 10 -1. + <_>2 6 2 10 3. + 0 + -0.0233389995992184 + 0.3294520080089569 + -0.2571269869804382 + <_> + + <_> + + + + <_>2 1 20 3 -1. + <_>2 2 20 1 3. + 0 + -6.8970001302659512e-003 + -0.5335299968719482 + 0.2163520008325577 + <_> + + <_> + + + + <_>9 13 6 11 -1. + <_>11 13 2 11 3. + 0 + -0.0344030000269413 + -1.4425489902496338 + -0.0446829982101917 + <_> + + <_> + + + + <_>9 15 6 8 -1. + <_>9 19 6 4 2. + 0 + -0.0212350003421307 + -0.7901750206947327 + 0.1908410042524338 + <_> + + <_> + + + + <_>9 12 6 9 -1. + <_>9 15 6 3 3. + 0 + 2.0620001014322042e-003 + -0.2693119943141937 + 0.3148800134658814 + <_> + + <_> + + + + <_>5 11 18 2 -1. + <_>5 12 18 1 2. + 0 + -4.2190002277493477e-003 + -0.5446439981460571 + 0.1657460033893585 + <_> + + <_> + + + + <_>2 6 15 6 -1. + <_>2 8 15 2 3. + 0 + -0.0143349999561906 + 0.0221050009131432 + -0.6234250068664551 + <_> + + <_> + + + + <_>6 0 18 3 -1. + <_>6 1 18 1 3. + 0 + -8.2120001316070557e-003 + -0.4988499879837036 + 0.1923709958791733 + <_> + + <_> + + + + <_>5 0 3 18 -1. + <_>6 0 1 18 3. + 0 + -9.3350000679492950e-003 + -0.7913119792938232 + -0.0141439996659756 + <_> + + <_> + + + + <_>18 3 6 10 -1. + <_>20 3 2 10 3. + 0 + -0.0379379987716675 + 0.7984129786491394 + -0.0337990000844002 + <_> + + <_> + + + + <_>0 3 6 10 -1. + <_>2 3 2 10 3. + 0 + 4.7059999778866768e-003 + -0.3316340148448944 + 0.2072629928588867 + <_> + + <_> + + + + <_>10 5 8 9 -1. + <_>10 5 4 9 2. + 0 + -4.4499998912215233e-003 + -0.2725630104541779 + 0.1840219944715500 + <_> + + <_> + + + + <_>6 5 8 9 -1. + <_>10 5 4 9 2. + 0 + 5.2189999260008335e-003 + -0.5309600234031677 + 0.0526079982519150 + <_> + + <_> + + + + <_>3 2 20 3 -1. + <_>3 3 20 1 3. + 0 + -9.5399999991059303e-003 + -0.5648540258407593 + 0.1926939934492111 + <_> + + <_> + + + + <_>5 2 13 4 -1. + <_>5 4 13 2 2. + 0 + 0.0449699983000755 + -0.1741150021553040 + 0.9538260102272034 + <_> + + <_> + + + + <_>17 0 7 14 -1. + <_>17 7 7 7 2. + 0 + 0.0142090003937483 + -0.0919490009546280 + 0.2483610063791275 + <_> + + <_> + + + + <_>0 0 7 14 -1. + <_>0 7 7 7 2. + 0 + 0.1638019979000092 + -0.0584970004856586 + -1.6404409408569336 + <_> + + <_> + + + + <_>9 11 10 6 -1. + <_>9 11 5 6 2. + 0 + 2.5579999200999737e-003 + 0.2344799935817719 + -0.0927340015769005 + <_> + + <_> + + + + <_>5 11 10 6 -1. + <_>10 11 5 6 2. + 0 + -3.8499999791383743e-003 + 0.1788070052862167 + -0.3584409952163696 + <_> + + <_> + + + + <_>11 6 3 18 -1. + <_>11 12 3 6 3. + 0 + -0.0252219997346401 + -0.4290300011634827 + 0.2024450004100800 + <_> + + <_> + + + + <_>0 16 18 3 -1. + <_>0 17 18 1 3. + 0 + -0.0194150004535913 + 0.5801630020141602 + -0.1880639940500259 + <_> + + <_> + + + + <_>6 16 18 3 -1. + <_>6 17 18 1 3. + 0 + 0.0144199999049306 + 0.0328469984233379 + 0.8198050260543823 + <_> + + <_> + + + + <_>4 6 9 10 -1. + <_>4 11 9 5 2. + 0 + 0.0515829995274544 + 0.0691760033369064 + -0.4586629867553711 + <_> + + <_> + + + + <_>9 7 15 4 -1. + <_>9 9 15 2 2. + 0 + -0.0379600003361702 + -1.2553000450134277 + 0.1433289945125580 + <_> + + <_> + + + + <_>5 6 12 6 -1. + <_>5 6 6 3 2. + <_>11 9 6 3 2. + 0 + -0.0295609999448061 + 0.5315179824829102 + -0.2059649974107742 + <_> + + <_> + + + + <_>6 1 12 9 -1. + <_>6 4 12 3 3. + 0 + -0.0391109995543957 + 1.1658719778060913 + 0.0538970008492470 + <_> + + <_> + + + + <_>7 9 6 12 -1. + <_>7 9 3 6 2. + <_>10 15 3 6 2. + 0 + -0.0291590001434088 + 0.3930760025978088 + -0.2218450009822846 + <_> + + <_> + + + + <_>11 5 13 6 -1. + <_>11 7 13 2 3. + 0 + -0.0836170017719269 + -0.7374449968338013 + 0.1426820009946823 + <_> + + <_> + + + + <_>1 11 22 13 -1. + <_>12 11 11 13 2. + 0 + 0.4200400114059448 + -0.1427740007638931 + 1.7894840240478516 + <_> + + <_> + + + + <_>18 8 6 6 -1. + <_>18 11 6 3 2. + 0 + 0.0600050017237663 + 0.1197670027613640 + -1.8886189460754395 + <_> + + <_> + + + + <_>0 8 6 6 -1. + <_>0 11 6 3 2. + 0 + -0.0189810004085302 + -1.4148449897766113 + -0.0565229989588261 + <_> + + <_> + + + + <_>0 6 24 3 -1. + <_>0 7 24 1 3. + 0 + -6.0049998573958874e-003 + 0.4417079985141754 + -0.1020080000162125 + <_> + + <_> + + + + <_>0 5 10 6 -1. + <_>0 7 10 2 3. + 0 + -0.0582140013575554 + -1.3918470144271851 + -0.0482689999043942 + <_> + + <_> + + + + <_>6 7 18 3 -1. + <_>6 8 18 1 3. + 0 + -0.0122710000723600 + 0.5131769776344299 + -0.0936969965696335 + <_> + + <_> + + + + <_>0 0 10 6 -1. + <_>0 2 10 2 3. + 0 + 0.0465859994292259 + -0.0574840009212494 + -1.4283169507980347 + <_> + + <_> + + + + <_>19 0 3 19 -1. + <_>20 0 1 19 3. + 0 + 1.2110000243410468e-003 + -0.0808919966220856 + 0.3233320116996765 + <_> + + <_> + + + + <_>4 6 12 16 -1. + <_>4 6 6 8 2. + <_>10 14 6 8 2. + 0 + -0.0886420011520386 + -0.8644909858703613 + -0.0331469997763634 + <_> + + <_> + + + + <_>19 6 4 18 -1. + <_>21 6 2 9 2. + <_>19 15 2 9 2. + 0 + -0.0231849998235703 + 0.5216220021247864 + -0.0161680001765490 + <_> + + <_> + + + + <_>1 6 4 18 -1. + <_>1 6 2 9 2. + <_>3 15 2 9 2. + 0 + 0.0430900007486343 + -0.1615380048751831 + 1.0915000438690186 + <_> + + <_> + + + + <_>3 21 18 3 -1. + <_>3 22 18 1 3. + 0 + 2.0599999697878957e-004 + -0.1709149926900864 + 0.3123669922351837 + <_> + + <_> + + + + <_>0 19 9 4 -1. + <_>0 21 9 2 2. + 0 + 8.9159999042749405e-003 + -6.7039998248219490e-003 + -0.6881039738655090 + <_> + + <_> + + + + <_>12 18 12 6 -1. + <_>18 18 6 3 2. + <_>12 21 6 3 2. + 0 + -0.0177529994398355 + 0.6329280138015747 + -4.2360001243650913e-003 + <_> + + <_> + + + + <_>7 18 9 4 -1. + <_>7 20 9 2 2. + 0 + 6.2299999408423901e-003 + -0.3363719880580902 + 0.1279059946537018 + <_> + + <_> + + + + <_>12 16 10 8 -1. + <_>17 16 5 4 2. + <_>12 20 5 4 2. + 0 + 0.0227700006216764 + -0.0347039997577667 + 0.3914180099964142 + <_> + + <_> + + + + <_>2 16 10 8 -1. + <_>2 16 5 4 2. + <_>7 20 5 4 2. + 0 + -0.0215349998325109 + 0.6476510167121887 + -0.2009779959917069 + <_> + + <_> + + + + <_>14 0 10 12 -1. + <_>19 0 5 6 2. + <_>14 6 5 6 2. + 0 + 0.0617589987814426 + 0.0542970001697540 + 0.9070010185241699 + <_> + + <_> + + + + <_>0 0 10 12 -1. + <_>0 0 5 6 2. + <_>5 6 5 6 2. + 0 + -0.0780699998140335 + 0.6552339792251587 + -0.1975439935922623 + <_> + + <_> + + + + <_>15 14 9 6 -1. + <_>15 16 9 2 3. + 0 + 0.0113150002434850 + 0.1938530057668686 + -0.5170729756355286 + <_> + + <_> + + + + <_>0 14 9 6 -1. + <_>0 16 9 2 3. + 0 + -0.0255900006741285 + -0.9309650063514710 + -0.0315469987690449 + <_> + + <_> + + + + <_>14 14 10 6 -1. + <_>14 16 10 2 3. + 0 + -0.0380589999258518 + -0.6832690238952637 + 0.1270910054445267 + <_> + + <_> + + + + <_>0 14 10 6 -1. + <_>0 16 10 2 3. + 0 + 9.7970003262162209e-003 + 0.0155239999294281 + -0.6334789991378784 + <_> + + <_> + + + + <_>5 18 18 2 -1. + <_>5 19 18 1 2. + 0 + -0.0138419996947050 + 1.0060529708862305 + 0.0628129988908768 + <_> + + <_> + + + + <_>0 18 18 3 -1. + <_>0 19 18 1 3. + 0 + 8.3459997549653053e-003 + -0.2338320016860962 + 0.3098269999027252 + <_> + + <_> + + + + <_>3 5 18 12 -1. + <_>12 5 9 6 2. + <_>3 11 9 6 2. + 0 + -0.0714399963617325 + -0.7250540256500244 + 0.1714829951524735 + <_> + + <_> + + + + <_>5 3 7 9 -1. + <_>5 6 7 3 3. + 0 + 0.0100060002878308 + -0.2207199931144714 + 0.3526619970798492 + <_> + + <_> + + + + <_>4 0 19 15 -1. + <_>4 5 19 5 3. + 0 + 0.1100530028343201 + 0.1666200011968613 + -0.7431899905204773 + <_> + + <_> + + + + <_>3 0 16 4 -1. + <_>3 2 16 2 2. + 0 + 0.0353109985589981 + -0.2398270070552826 + 0.4143599867820740 + <_> + + <_> + + + + <_>4 12 16 12 -1. + <_>4 12 8 12 2. + 0 + -0.1117469966411591 + 0.5104539990425110 + 2.2319999989122152e-003 + <_> + + <_> + + + + <_>4 3 12 15 -1. + <_>10 3 6 15 2. + 0 + -0.1136780008673668 + 0.9047520160675049 + -0.1661529988050461 + <_> + + <_> + + + + <_>16 4 2 19 -1. + <_>16 4 1 19 2. + 0 + 0.0166679993271828 + 0.1402450054883957 + -0.5217850208282471 + <_> + + <_> + + + + <_>6 4 2 19 -1. + <_>7 4 1 19 2. + 0 + -8.0340001732110977e-003 + -0.6617839932441711 + 3.7640000227838755e-003 + <_> + + <_> + + + + <_>13 14 8 10 -1. + <_>17 14 4 5 2. + <_>13 19 4 5 2. + 0 + -0.0330969989299774 + 0.8018590211868286 + 0.0593850016593933 + <_> + + <_> + + + + <_>3 14 8 10 -1. + <_>3 14 4 5 2. + <_>7 19 4 5 2. + 0 + 0.0125479996204376 + -0.3354550004005432 + 0.1457860022783279 + <_> + + <_> + + + + <_>12 6 3 18 -1. + <_>12 12 3 6 3. + 0 + -0.0420739986002445 + -0.5550910234451294 + 0.1326660066843033 + <_> + + <_> + + + + <_>5 11 12 6 -1. + <_>5 11 6 3 2. + <_>11 14 6 3 2. + 0 + 0.0252219997346401 + -0.0616319999098778 + -1.3678770065307617 + <_> + + <_> + + + + <_>10 5 8 10 -1. + <_>14 5 4 5 2. + <_>10 10 4 5 2. + 0 + -0.0242689996957779 + 0.3418509960174561 + -7.4160001240670681e-003 + <_> + + <_> + + + + <_>6 4 12 10 -1. + <_>6 4 6 5 2. + <_>12 9 6 5 2. + 0 + -0.0122800003737211 + 0.2774580121040344 + -0.3103390038013458 + <_> + + <_> + + + + <_>6 8 18 10 -1. + <_>15 8 9 5 2. + <_>6 13 9 5 2. + 0 + -0.1137709990143776 + 1.1719540357589722 + 0.0836810022592545 + <_> + + <_> + + + + <_>0 8 18 10 -1. + <_>0 8 9 5 2. + <_>9 13 9 5 2. + 0 + -0.0847719982266426 + 0.8169479966163635 + -0.1783750057220459 + <_> + + <_> + + + + <_>12 6 3 18 -1. + <_>12 12 3 6 3. + 0 + -0.0245520006865263 + -0.1862729936838150 + 0.1434009969234467 + <_> + + <_> + + + + <_>0 14 18 3 -1. + <_>0 15 18 1 3. + 0 + -9.0269995853304863e-003 + 0.3265919983386993 + -0.2354129999876022 + <_> + + <_> + + + + <_>12 6 3 18 -1. + <_>12 12 3 6 3. + 0 + 0.0111779998987913 + 0.1976120024919510 + -0.0217010006308556 + <_> + + <_> + + + + <_>9 6 3 18 -1. + <_>9 12 3 6 3. + 0 + -0.0293669998645782 + -0.9341480135917664 + -0.0217049997299910 + <_> + + <_> + + + + <_>6 14 18 3 -1. + <_>6 15 18 1 3. + 0 + 6.3640000298619270e-003 + 0.0255730003118515 + 0.4641279876232147 + <_> + + <_> + + + + <_>0 5 18 3 -1. + <_>0 6 18 1 3. + 0 + 0.0140260001644492 + -0.2122859954833984 + 0.4007880091667175 + <_> + + <_> + + + + <_>2 5 22 3 -1. + <_>2 6 22 1 3. + 0 + -0.0133419996127486 + 0.7420269846916199 + 0.0290019996464252 + <_> + + <_> + + + + <_>0 0 21 10 -1. + <_>7 0 7 10 3. + 0 + 0.2842279970645905 + -0.1924359947443008 + 0.4363119900226593 + <_> + + <_> + + + + <_>6 3 18 17 -1. + <_>12 3 6 17 3. + 0 + -0.2372400015592575 + 0.6973639726638794 + 0.0693079978227615 + <_> + + <_> + + + + <_>0 3 18 17 -1. + <_>6 3 6 17 3. + 0 + -0.1116970032453537 + 0.3914720118045807 + -0.2092200070619583 + <_> + + <_> + + + + <_>0 12 24 11 -1. + <_>8 12 8 11 3. + 0 + 0.1278750002384186 + -0.0725559964776039 + 0.3608820140361786 + <_> + + <_> + + + + <_>4 10 16 6 -1. + <_>4 13 16 3 2. + 0 + -0.0629009976983070 + 0.9542499780654907 + -0.1540279984474182 + <_> + + <_> + + + + <_>12 8 6 8 -1. + <_>12 12 6 4 2. + 0 + 0.0174390003085136 + -0.0511349998414516 + 0.2775030136108398 + <_> + + <_> + + + + <_>6 14 8 7 -1. + <_>10 14 4 7 2. + 0 + 1.2319999514147639e-003 + 0.0756279975175858 + -0.3645609915256500 + <_> + + <_> + + + + <_>15 10 6 14 -1. + <_>18 10 3 7 2. + <_>15 17 3 7 2. + 0 + 0.0274950005114079 + 0.0518440008163452 + 0.4156259894371033 + <_> + + <_> + + + + <_>3 10 6 14 -1. + <_>3 10 3 7 2. + <_>6 17 3 7 2. + 0 + -0.0435439981520176 + 0.7196999788284302 + -0.1713220030069351 + <_> + + <_> + + + + <_>6 12 18 2 -1. + <_>6 13 18 1 2. + 0 + 0.0110259996727109 + 0.1435460001230240 + -0.6540300250053406 + <_> + + <_> + + + + <_>5 8 10 6 -1. + <_>5 10 10 2 3. + 0 + 0.0208659991621971 + 0.0400890000164509 + -0.4574329853057861 + <_> + + <_> + + + + <_>12 11 9 4 -1. + <_>12 13 9 2 2. + 0 + -0.0223040003329515 + 0.5385500192642212 + 0.0716629996895790 + <_> + + <_> + + + + <_>0 11 9 6 -1. + <_>0 13 9 2 3. + 0 + 0.0324920006096363 + -0.0459919981658459 + -1.0047069787979126 + <_> + + <_> + + + + <_>11 2 3 18 -1. + <_>12 2 1 18 3. + 0 + 0.0122699998319149 + 0.0343349985778332 + 0.4243179857730866 + <_> + + <_> + + + + <_>10 2 3 18 -1. + <_>11 2 1 18 3. + 0 + 8.3820000290870667e-003 + -0.2585060000419617 + 0.2626349925994873 + <_> + + <_> + + + + <_>9 12 6 10 -1. + <_>11 12 2 10 3. + 0 + 0.0373539999127388 + 0.1569249927997589 + -1.0429090261459351 + <_> + + <_> + + + + <_>1 10 6 9 -1. + <_>1 13 6 3 3. + 0 + -0.0141110001131892 + -0.7317770123481751 + -0.0202769991010427 + <_> + + <_> + + + + <_>6 9 16 6 -1. + <_>14 9 8 3 2. + <_>6 12 8 3 2. + 0 + 0.0570669993758202 + 0.0833600014448166 + 1.5661499500274658 + <_> + + <_> + + + + <_>1 8 9 6 -1. + <_>1 10 9 2 3. + 0 + 4.9680001102387905e-003 + -0.3531819880008698 + 0.1469839960336685 + <_> + + <_> + + + + <_>7 7 16 6 -1. + <_>7 9 16 2 3. + 0 + -0.0244929995387793 + 0.2832590043544769 + -3.4640000667423010e-003 + <_> + + <_> + + + + <_>0 0 18 3 -1. + <_>0 1 18 1 3. + 0 + -0.0112549997866154 + -0.8401749730110169 + -0.0362519994378090 + <_> + + <_> + + + + <_>10 0 6 9 -1. + <_>12 0 2 9 3. + 0 + 0.0345330014824867 + 0.1499850004911423 + -0.8736709952354431 + <_> + + <_> + + + + <_>9 5 6 6 -1. + <_>12 5 3 6 2. + 0 + 0.0243030004203320 + -0.1878750026226044 + 0.5948399901390076 + <_> + + <_> + + + + <_>10 6 4 18 -1. + <_>12 6 2 9 2. + <_>10 15 2 9 2. + 0 + -7.8790001571178436e-003 + 0.4431569874286652 + -0.0565709993243217 + <_> + + <_> + + + + <_>8 0 6 9 -1. + <_>10 0 2 9 3. + 0 + 0.0351420007646084 + -0.0564949996769428 + -1.3617190122604370 + <_> + + <_> + + + + <_>9 1 6 9 -1. + <_>9 4 6 3 3. + 0 + 4.6259998343884945e-003 + -0.3116169869899750 + 0.2544769942760468 + <_> + + <_> + + + + <_>1 0 18 9 -1. + <_>1 3 18 3 3. + 0 + -0.0831310003995895 + 1.6424349546432495 + -0.1442939937114716 + <_> + + <_> + + + + <_>0 3 24 3 -1. + <_>0 4 24 1 3. + 0 + -0.0140159996226430 + -0.7781950235366821 + 0.1717330068349838 + <_> + + <_> + + + + <_>6 14 9 4 -1. + <_>6 16 9 2 2. + 0 + 1.2450000504031777e-003 + -0.2319139987230301 + 0.2852790057659149 + <_> + + <_> + + + + <_>8 9 8 10 -1. + <_>12 9 4 5 2. + <_>8 14 4 5 2. + 0 + -0.0168030001223087 + -0.3596509993076325 + 0.2041299939155579 + <_> + + <_> + + + + <_>5 2 13 9 -1. + <_>5 5 13 3 3. + 0 + -0.0767479985952377 + 0.7805050015449524 + -0.1561280041933060 + <_> + + <_> + + + + <_>4 4 16 9 -1. + <_>4 7 16 3 3. + 0 + -0.2367199957370758 + 1.1813700199127197 + 0.0781119987368584 + <_> + + <_> + + + + <_>4 4 14 9 -1. + <_>4 7 14 3 3. + 0 + -0.1005740016698837 + -0.4710409939289093 + 0.0791729986667633 + <_> + + <_> + + + + <_>8 5 9 6 -1. + <_>8 7 9 2 3. + 0 + 1.3239999534562230e-003 + 0.2226269990205765 + -0.3709979951381683 + <_> + + <_> + + + + <_>1 7 16 6 -1. + <_>1 9 16 2 3. + 0 + 0.0221529994159937 + -0.0386490002274513 + -0.9227499961853027 + <_> + + <_> + + + + <_>10 5 13 9 -1. + <_>10 8 13 3 3. + 0 + -0.1124619990587235 + 0.4189960062503815 + 0.0804110020399094 + <_> + + <_> + + + + <_>1 5 13 9 -1. + <_>1 8 13 3 3. + 0 + 0.0164810009300709 + -0.1675669997930527 + 0.7184240221977234 + <_> + + <_> + + + + <_>0 4 24 6 -1. + <_>12 4 12 3 2. + <_>0 7 12 3 2. + 0 + 0.0681139975786209 + 0.1571989953517914 + -0.8768110275268555 + <_> + + <_> + + + + <_>1 14 10 9 -1. + <_>1 17 10 3 3. + 0 + 0.0160119999200106 + -4.1600000113248825e-003 + -0.5932779908180237 + <_> + + <_> + + + + <_>5 17 18 3 -1. + <_>5 18 18 1 3. + 0 + 4.6640001237392426e-003 + -0.0301539991050959 + 0.4834530055522919 + <_> + + <_> + + + + <_>0 16 18 3 -1. + <_>0 17 18 1 3. + 0 + 6.7579997703433037e-003 + -0.2266740053892136 + 0.3366230130195618 + <_> + + <_> + + + + <_>9 17 9 6 -1. + <_>9 19 9 2 3. + 0 + 4.7289999201893806e-003 + -0.0603739991784096 + 0.3145810067653656 + <_> + + <_> + + + + <_>1 20 22 4 -1. + <_>1 20 11 2 2. + <_>12 22 11 2 2. + 0 + 2.5869999080896378e-003 + -0.2987259924411774 + 0.1778749972581863 + <_> + + <_> + + + + <_>8 14 8 6 -1. + <_>8 17 8 3 2. + 0 + 2.8989999555051327e-003 + 0.2189020067453384 + -0.2956709861755371 + <_> + + <_> + + + + <_>8 6 8 15 -1. + <_>8 11 8 5 3. + 0 + -0.0300539992749691 + 1.2150429487228394 + -0.1435499936342239 + <_> + + <_> + + + + <_>5 4 18 3 -1. + <_>5 5 18 1 3. + 0 + 0.0141810001805425 + 0.0124519998207688 + 0.5549010038375855 + <_> + + <_> + + + + <_>9 3 5 10 -1. + <_>9 8 5 5 2. + 0 + -0.0605270005762577 + -1.4933999776840210 + -0.0652270019054413 + <_> + + <_> + + + + <_>6 8 12 3 -1. + <_>6 8 6 3 2. + 0 + -0.0198829993605614 + -0.3852640092372894 + 0.1976120024919510 + <_> + + <_> + + + + <_>2 6 18 6 -1. + <_>2 6 9 3 2. + <_>11 9 9 3 2. + 0 + 0.0312189999967813 + -0.2128120064735413 + 0.2944650053977966 + <_> + + <_> + + + + <_>10 6 4 18 -1. + <_>12 6 2 9 2. + <_>10 15 2 9 2. + 0 + 0.0182719994336367 + 9.7200000891461968e-004 + 0.6681420207023621 + <_> + + <_> + + + + <_>7 5 6 6 -1. + <_>10 5 3 6 2. + 0 + 1.1089999461546540e-003 + -0.6246790289878845 + -1.6599999507889152e-003 + <_> + + <_> + + + + <_>14 5 2 18 -1. + <_>14 14 2 9 2. + 0 + -0.0367139987647533 + -0.4233390092849731 + 0.1208470016717911 + <_> + + <_> + + + + <_>8 5 2 18 -1. + <_>8 14 2 9 2. + 0 + 0.0120440004393458 + 0.0258820001035929 + -0.5073239803314209 + <_> + + <_> + + + + <_>9 2 10 6 -1. + <_>9 2 5 6 2. + 0 + 0.0747490003705025 + 0.1318469941616058 + -0.2173960059881210 + <_> + + <_> + + + + <_>3 1 18 12 -1. + <_>12 1 9 12 2. + 0 + -0.2347320020198822 + 1.1775610446929932 + -0.1511469930410385 + <_> + + <_> + + + + <_>5 2 17 22 -1. + <_>5 13 17 11 2. + 0 + 0.1409649997949600 + 0.0339910015463829 + 0.3992309868335724 + <_> + + <_> + + + + <_>4 0 12 6 -1. + <_>4 2 12 2 3. + 0 + 6.1789997853338718e-003 + -0.3180670142173767 + 0.1168169975280762 + <_> + + <_> + + + + <_>6 9 16 6 -1. + <_>14 9 8 3 2. + <_>6 12 8 3 2. + 0 + -0.0572169981896877 + 0.8439909815788269 + 0.0838890001177788 + <_> + + <_> + + + + <_>9 0 5 18 -1. + <_>9 9 5 9 2. + 0 + -0.0552270002663136 + 0.3688830137252808 + -0.1891340017318726 + <_> + + <_> + + + + <_>12 0 6 9 -1. + <_>14 0 2 9 3. + 0 + -0.0215830001980066 + -0.5216180086135864 + 0.1577260047197342 + <_> + + <_> + + + + <_>6 0 6 9 -1. + <_>8 0 2 9 3. + 0 + 0.0257479995489120 + -0.0599219985306263 + -1.0674990415573120 + <_> + + <_> + + + + <_>9 1 6 12 -1. + <_>11 1 2 12 3. + 0 + -0.0130989998579025 + 0.7895839810371399 + 0.0520999990403652 + <_> + + <_> + + + + <_>5 9 13 4 -1. + <_>5 11 13 2 2. + 0 + 2.2799998987466097e-003 + -1.1704430580139160 + -0.0593569986522198 + <_> + + <_> + + + + <_>5 8 19 3 -1. + <_>5 9 19 1 3. + 0 + 8.8060004636645317e-003 + 0.0417179986834526 + 0.6635259985923767 + <_> + + <_> + + + + <_>9 9 6 8 -1. + <_>9 13 6 4 2. + 0 + -8.9699998497962952e-003 + -0.3586269915103912 + 0.0604580007493496 + <_> + + <_> + + + + <_>11 9 4 15 -1. + <_>11 14 4 5 3. + 0 + 4.0230001322925091e-003 + 0.2097939997911453 + -0.2480600029230118 + <_> + + <_> + + + + <_>2 0 6 14 -1. + <_>2 0 3 7 2. + <_>5 7 3 7 2. + 0 + 0.0250170007348061 + -0.1879590004682541 + 0.3954710066318512 + <_> + + <_> + + + + <_>15 1 6 14 -1. + <_>18 1 3 7 2. + <_>15 8 3 7 2. + 0 + -5.9009999968111515e-003 + 0.2566390037536621 + -0.0949190035462379 + <_> + + <_> + + + + <_>3 1 6 14 -1. + <_>3 1 3 7 2. + <_>6 8 3 7 2. + 0 + 4.3850000947713852e-003 + 0.0331390015780926 + -0.4607540071010590 + <_> + + <_> + + + + <_>3 20 18 4 -1. + <_>12 20 9 2 2. + <_>3 22 9 2 2. + 0 + -0.0337719991803169 + -0.9888160228729248 + 0.1463689953088760 + <_> + + <_> + + + + <_>5 0 4 20 -1. + <_>5 0 2 10 2. + <_>7 10 2 10 2. + 0 + 0.0445230007171631 + -0.1328669935464859 + 1.5796790122985840 + <_> + + <_> + + + + <_>16 8 8 12 -1. + <_>20 8 4 6 2. + <_>16 14 4 6 2. + 0 + -0.0409290008246899 + 0.3387709856033325 + 0.0749709978699684 + <_> + + <_> + + + + <_>0 8 8 12 -1. + <_>0 8 4 6 2. + <_>4 14 4 6 2. + 0 + 0.0393519997596741 + -0.1832789927721024 + 0.4698069989681244 + <_> + + <_> + + + + <_>13 13 10 8 -1. + <_>18 13 5 4 2. + <_>13 17 5 4 2. + 0 + -0.0703229978680611 + -0.9832270145416260 + 0.1180810034275055 + <_> + + <_> + + + + <_>1 13 10 8 -1. + <_>1 13 5 4 2. + <_>6 17 5 4 2. + 0 + 0.0357430018484592 + -0.0330509990453720 + -0.8361089825630188 + <_> + + <_> + + + + <_>15 8 4 15 -1. + <_>15 13 4 5 3. + 0 + -0.0429619997739792 + 1.1670809984207153 + 0.0806920006871223 + <_> + + <_> + + + + <_>5 8 4 15 -1. + <_>5 13 4 5 3. + 0 + -0.0210079997777939 + 0.6386979818344116 + -0.1762630045413971 + <_> + + <_> + + + + <_>6 11 16 12 -1. + <_>6 15 16 4 3. + 0 + -0.1574220061302185 + -0.2330249994993210 + 0.1251749992370606 + <_> + + <_> + + + + <_>2 11 16 12 -1. + <_>2 15 16 4 3. + 0 + 7.8659998252987862e-003 + -0.2203799933195114 + 0.2719680070877075 + <_> + + <_> + + + + <_>14 12 7 9 -1. + <_>14 15 7 3 3. + 0 + 0.0236220005899668 + 0.1612730026245117 + -0.4332900047302246 + <_> + + <_> + + + + <_>10 1 3 21 -1. + <_>10 8 3 7 3. + 0 + 0.0746920034289360 + -0.1699199974536896 + 0.5888490080833435 + <_> + + <_> + + + + <_>13 11 9 4 -1. + <_>13 13 9 2 2. + 0 + -6.4799998654052615e-004 + 0.2584289908409119 + -0.0359119996428490 + <_> + + <_> + + + + <_>3 10 17 9 -1. + <_>3 13 17 3 3. + 0 + -0.0162909999489784 + -0.7676439881324768 + -0.0204729996621609 + <_> + + <_> + + + + <_>13 8 8 15 -1. + <_>13 13 8 5 3. + 0 + -0.0331339985132217 + -0.2718009948730469 + 0.1432570070028305 + <_> + + <_> + + + + <_>3 8 8 15 -1. + <_>3 13 8 5 3. + 0 + 0.0487979985773563 + 0.0764089971780777 + -0.4144519865512848 + <_> + + <_> + + + + <_>11 14 10 8 -1. + <_>16 14 5 4 2. + <_>11 18 5 4 2. + 0 + 2.2869999520480633e-003 + -0.0386289991438389 + 0.2075379937887192 + <_> + + <_> + + + + <_>0 18 22 6 -1. + <_>0 18 11 3 2. + <_>11 21 11 3 2. + 0 + 0.0453040003776550 + -0.1777790039777756 + 0.6346139907836914 + <_> + + <_> + + + + <_>0 16 24 4 -1. + <_>0 16 12 4 2. + 0 + 0.1070580035448074 + 0.1897229999303818 + -0.5123620033264160 + <_> + + <_> + + + + <_>6 20 12 3 -1. + <_>12 20 6 3 2. + 0 + -0.0405250005424023 + 0.7061499953269959 + -0.1780329942703247 + <_> + + <_> + + + + <_>18 12 6 12 -1. + <_>21 12 3 6 2. + <_>18 18 3 6 2. + 0 + 0.0319689996540546 + 0.0681499987840652 + 0.6873310208320618 + <_> + + <_> + + + + <_>0 12 6 12 -1. + <_>0 12 3 6 2. + <_>3 18 3 6 2. + 0 + -0.0576170012354851 + 0.7517049908638001 + -0.1576499938964844 + <_> + + <_> + + + + <_>15 17 9 6 -1. + <_>15 19 9 2 3. + 0 + 0.0135939996689558 + 0.1941190063953400 + -0.2456189990043640 + <_> + + <_> + + + + <_>1 6 22 10 -1. + <_>1 6 11 5 2. + <_>12 11 11 5 2. + 0 + 0.0713960006833076 + -0.0468810014426708 + -0.8819829821586609 + <_> + + <_> + + + + <_>15 17 9 6 -1. + <_>15 19 9 2 3. + 0 + -0.0148959998041391 + -0.4453240036964417 + 0.1767989993095398 + <_> + + <_> + + + + <_>0 18 18 2 -1. + <_>0 19 18 1 2. + 0 + -0.0100260004401207 + 0.6512269973754883 + -0.1670999974012375 + <_> + + <_> + + + + <_>3 15 19 3 -1. + <_>3 16 19 1 3. + 0 + 3.7589999847114086e-003 + -0.0583010017871857 + 0.3448329865932465 + <_> + + <_> + + + + <_>0 13 18 3 -1. + <_>0 14 18 1 3. + 0 + 0.0162630006670952 + -0.1558150053024292 + 0.8643270134925842 + <_> + + <_> + + + + <_>15 17 9 6 -1. + <_>15 19 9 2 3. + 0 + -0.0401760004460812 + -0.6102859973907471 + 0.1179639995098114 + <_> + + <_> + + + + <_>0 17 9 6 -1. + <_>0 19 9 2 3. + 0 + 0.0270809996873140 + -0.0496019981801510 + -0.8999000191688538 + <_> + + <_> + + + + <_>12 17 9 6 -1. + <_>12 19 9 2 3. + 0 + 0.0524200014770031 + 0.1129719987511635 + -1.0833640098571777 + <_> + + <_> + + + + <_>3 17 9 6 -1. + <_>3 19 9 2 3. + 0 + -0.0191600006073713 + -0.7988010048866272 + -0.0340790003538132 + <_> + + <_> + + + + <_>16 2 3 20 -1. + <_>17 2 1 20 3. + 0 + -3.7730000913143158e-003 + -0.1912409961223602 + 0.2153519988059998 + <_> + + <_> + + + + <_>0 13 24 8 -1. + <_>0 17 24 4 2. + 0 + 0.0757620036602020 + -0.1342169940471649 + 1.6807060241699219 + <_> + + <_> + + + + <_>9 1 6 22 -1. + <_>12 1 3 11 2. + <_>9 12 3 11 2. + 0 + -0.0221730004996061 + 0.4860099852085114 + 3.6160000599920750e-003 + -2.9928278923034668 + 23 + -1 + diff --git a/sample/SampleBase/Data/Text/lbpcascade_frontalface.xml b/sample/SampleBase/Data/Text/lbpcascade_frontalface.xml new file mode 100644 index 000000000..fc7648ef5 --- /dev/null +++ b/sample/SampleBase/Data/Text/lbpcascade_frontalface.xml @@ -0,0 +1,1505 @@ + + + + + BOOST + LBP + 24 + 24 + + GAB + 0.9950000047683716 + 0.5000000000000000 + 0.9500000000000000 + 1 + 100 + + 256 + 20 + + + <_> + 3 + -0.7520892024040222 + + + <_> + + 0 -1 46 -67130709 -21569 -1426120013 -1275125205 -21585 + -16385 587145899 -24005 + + -0.6543210148811340 0.8888888955116272 + + <_> + + 0 -1 13 -163512766 -769593758 -10027009 -262145 -514457854 + -193593353 -524289 -1 + + -0.7739216089248657 0.7278633713722229 + + <_> + + 0 -1 2 -363936790 -893203669 -1337948010 -136907894 + 1088782736 -134217726 -741544961 -1590337 + + -0.7068563103675842 0.6761534214019775 + + <_> + 4 + -0.4872078299522400 + + + <_> + + 0 -1 84 2147483647 1946124287 -536870913 2147450879 + 738132490 1061101567 243204619 2147446655 + + -0.8083735704421997 0.7685696482658386 + + <_> + + 0 -1 21 2147483647 263176079 1879048191 254749487 1879048191 + -134252545 -268435457 801111999 + + -0.7698410153388977 0.6592915654182434 + + <_> + + 0 -1 106 -98110272 1610939566 -285484400 -850010381 + -189334372 -1671954433 -571026695 -262145 + + -0.7506558895111084 0.5444605946540833 + + <_> + + 0 -1 48 -798690576 -131075 1095771153 -237144073 -65569 -1 + -216727745 -69206049 + + -0.7775990366935730 0.5465461611747742 + + <_> + 4 + -1.1592328548431396 + + + <_> + + 0 -1 47 -21585 -20549 -100818262 -738254174 -20561 -36865 + -151016790 -134238549 + + -0.5601882934570313 0.7743113040924072 + + <_> + + 0 -1 12 -286003217 183435247 -268994614 -421330945 + -402686081 1090387966 -286785545 -402653185 + + -0.6124526262283325 0.6978127956390381 + + <_> + + 0 -1 26 -50347012 970882927 -50463492 -1253377 -134218251 + -50364513 -33619992 -172490753 + + -0.6114496588706970 0.6537628173828125 + + <_> + + 0 -1 8 -273 -135266321 1877977738 -2088243418 -134217987 + 2146926575 -18910642 1095231247 + + -0.6854077577590942 0.5403239130973816 + + <_> + 5 + -0.7562355995178223 + + + <_> + + 0 -1 96 -1273 1870659519 -20971602 -67633153 -134250731 + 2004875127 -250 -150995969 + + -0.4051094949245453 0.7584033608436585 + + <_> + + 0 -1 33 -868162224 -76810262 -4262145 -257 1465211989 + -268959873 -2656269 -524289 + + -0.7388162612915039 0.5340843200683594 + + <_> + + 0 -1 57 -12817 -49 -541103378 -152950 -38993 -20481 -1153876 + -72478976 + + -0.6582943797111511 0.5339496731758118 + + <_> + + 0 -1 125 -269484161 -452984961 -319816180 -1594032130 -2111 + -990117891 -488975296 -520947741 + + -0.5981323719024658 0.5323504805564880 + + <_> + + 0 -1 53 557787431 670265215 -1342193665 -1075892225 + 1998528318 1056964607 -33570977 -1 + + -0.6498787999153137 0.4913350641727448 + + <_> + 5 + -0.8085358142852783 + + + <_> + + 0 -1 60 -536873708 880195381 -16842788 -20971521 -176687276 + -168427659 -16777260 -33554626 + + -0.5278195738792419 0.6946372389793396 + + <_> + + 0 -1 7 -1 -62981529 -1090591130 805330978 -8388827 -41945787 + -39577 -531118985 + + -0.5206505060195923 0.6329920291900635 + + <_> + + 0 -1 98 -725287348 1347747543 -852489 -16809993 1489881036 + -167903241 -1 -1 + + -0.7516061067581177 0.4232024252414703 + + <_> + + 0 -1 44 -32777 1006582562 -65 935312171 -8388609 -1078198273 + -1 733886267 + + -0.7639313936233521 0.4123568832874298 + + <_> + + 0 -1 24 -85474705 2138828511 -1036436754 817625855 + 1123369029 -58796809 -1013468481 -194513409 + + -0.5123769044876099 0.5791834592819214 + + <_> + 5 + -0.5549971461296082 + + + <_> + + 0 -1 42 -17409 -20481 -268457797 -134239493 -17473 -1 -21829 + -21846 + + -0.3763174116611481 0.7298233509063721 + + <_> + + 0 -1 6 -805310737 -2098262358 -269504725 682502698 + 2147483519 1740574719 -1090519233 -268472385 + + -0.5352765917778015 0.5659480094909668 + + <_> + + 0 -1 61 -67109678 -6145 -8 -87884584 -20481 -1073762305 + -50856216 -16849696 + + -0.5678374171257019 0.4961479902267456 + + <_> + + 0 -1 123 -138428633 1002418167 -1359008245 -1908670465 + -1346685918 910098423 -1359010520 -1346371657 + + -0.5706262588500977 0.4572288393974304 + + <_> + + 0 -1 9 -89138513 -4196353 1256531674 -1330665426 1216308261 + -36190633 33498198 -151796633 + + -0.5344601869583130 0.4672054052352905 + + <_> + 5 + -0.8776460289955139 + + + <_> + + 0 -1 105 1073769576 206601725 -34013449 -33554433 -789514004 + -101384321 -690225153 -264193 + + -0.7700348496437073 0.5943940877914429 + + <_> + + 0 -1 30 -1432340997 -823623681 -49153 -34291724 -269484035 + -1342767105 -1078198273 -1277955 + + -0.5043668746948242 0.6151274442672730 + + <_> + + 0 -1 35 -1067385040 -195758209 -436748425 -134217731 + -50855988 -129 -1 -1 + + -0.6808040738105774 0.4667325913906097 + + <_> + + 0 -1 119 832534325 -34111555 -26050561 -423659521 -268468364 + 2105014143 -2114244 -17367185 + + -0.4927591383457184 0.5401885509490967 + + <_> + + 0 -1 82 -1089439888 -1080524865 2143059967 -1114121 + -1140949004 -3 -2361356 -739516 + + -0.6445107460021973 0.4227822124958038 + + <_> + 6 + -1.1139287948608398 + + + <_> + + 0 -1 52 -1074071553 -1074003969 -1 -1280135430 -5324817 -1 + -335548482 582134442 + + -0.5307556986808777 0.6258179545402527 + + <_> + + 0 -1 99 -706937396 -705364068 -540016724 -570495027 + -570630659 -587857963 -33628164 -35848193 + + -0.5227634310722351 0.5049746036529541 + + <_> + + 0 -1 18 -2035630093 42119158 -268503053 -1671444 261017599 + 1325432815 1954394111 -805306449 + + -0.4983572661876679 0.5106441378593445 + + <_> + + 0 -1 111 -282529488 -1558073088 1426018736 -170526448 + -546832487 -5113037 -34243375 -570427929 + + -0.4990860521793366 0.5060507059097290 + + <_> + + 0 -1 92 1016332500 -606301707 915094269 -1080086049 + -1837027144 -1361600280 2147318747 1067975613 + + -0.5695009231567383 0.4460467398166657 + + <_> + + 0 -1 51 -656420166 -15413034 -141599534 -603435836 + 1505950458 -787556946 -79823438 -1326199134 + + -0.6590405106544495 0.3616424500942230 + + <_> + 7 + -0.8243625760078430 + + + <_> + + 0 -1 28 -901591776 -201916417 -262 -67371009 -143312112 + -524289 -41943178 -1 + + -0.4972776770591736 0.6027074456214905 + + <_> + + 0 -1 112 -4507851 -411340929 -268437513 -67502145 -17350859 + -32901 -71344315 -29377 + + -0.4383158981800079 0.5966237187385559 + + <_> + + 0 -1 69 -75894785 -117379438 -239063587 -12538500 1485072126 + 2076233213 2123118847 801906927 + + -0.6386105418205261 0.3977999985218048 + + <_> + + 0 -1 19 -823480413 786628589 -16876049 -1364262914 242165211 + 1315930109 -696268833 -455082829 + + -0.5512794256210327 0.4282079637050629 + + <_> + + 0 -1 73 -521411968 6746762 -1396236286 -2038436114 + -185612509 57669627 -143132877 -1041235973 + + -0.6418755054473877 0.3549866080284119 + + <_> + + 0 -1 126 -478153869 1076028979 -1645895615 1365298272 + -557859073 -339771473 1442574528 -1058802061 + + -0.4841901361942291 0.4668019413948059 + + <_> + + 0 -1 45 -246350404 -1650402048 -1610612745 -788400696 + 1467604861 -2787397 1476263935 -4481349 + + -0.5855734348297119 0.3879135847091675 + + <_> + 7 + -1.2237116098403931 + + + <_> + + 0 -1 114 -24819 1572863935 -16809993 -67108865 2146778388 + 1433927541 -268608444 -34865205 + + -0.2518476545810700 0.7088654041290283 + + <_> + + 0 -1 97 -1841359 -134271049 -32769 -5767369 -1116675 -2185 + -8231 -33603327 + + -0.4303432404994965 0.5283288359642029 + + <_> + + 0 -1 25 -1359507589 -1360593090 -1073778729 -269553812 + -809512977 1744707583 -41959433 -134758978 + + -0.4259553551673889 0.5440809130668640 + + <_> + + 0 -1 34 729753407 -134270989 -1140907329 -235200777 + 658456383 2147467263 -1140900929 -16385 + + -0.5605589151382446 0.4220733344554901 + + <_> + + 0 -1 134 -310380553 -420675595 -193005472 -353568129 + 1205338070 -990380036 887604324 -420544526 + + -0.5192656517028809 0.4399855434894562 + + <_> + + 0 -1 16 -1427119361 1978920959 -287119734 -487068946 + 114759245 -540578051 -707510259 -671660453 + + -0.5013077259063721 0.4570254683494568 + + <_> + + 0 -1 74 -738463762 -889949281 -328301948 -121832450 + -1142658284 -1863576559 2146417353 -263185 + + -0.4631414115428925 0.4790246188640595 + + <_> + 7 + -0.5544230937957764 + + + <_> + + 0 -1 113 -76228780 -65538 -1 -67174401 -148007 -33 -221796 + -272842924 + + -0.3949716091156006 0.6082032322883606 + + <_> + + 0 -1 110 369147696 -1625232112 2138570036 -1189900 790708019 + -1212613127 799948719 -4456483 + + -0.4855885505676270 0.4785369932651520 + + <_> + + 0 -1 37 784215839 -290015241 536832799 -402984963 + -1342414991 -838864897 -176769 -268456129 + + -0.4620285332202911 0.4989669024944305 + + <_> + + 0 -1 41 -486418688 -171915327 -340294900 -21938 -519766032 + -772751172 -73096060 -585322623 + + -0.6420643329620361 0.3624351918697357 + + <_> + + 0 -1 117 -33554953 -475332625 -1423463824 -2077230421 + -4849669 -2080505925 -219032928 -1071915349 + + -0.4820112884044647 0.4632140696048737 + + <_> + + 0 -1 65 -834130468 -134217476 -1349314083 -1073803559 + -619913764 -1449131844 -1386890321 -1979118423 + + -0.4465552568435669 0.5061788558959961 + + <_> + + 0 -1 56 -285249779 1912569855 -16530 -1731022870 -1161904146 + -1342177297 -268439634 -1464078708 + + -0.5190586447715759 0.4441480338573456 + + <_> + 7 + -0.7161560654640198 + + + <_> + + 0 -1 20 1246232575 1078001186 -10027057 60102 -277348353 + -43646987 -1210581153 1195769615 + + -0.4323809444904327 0.5663768053054810 + + <_> + + 0 -1 15 -778583572 -612921106 -578775890 -4036478 + -1946580497 -1164766570 -1986687009 -12103599 + + -0.4588732719421387 0.4547033011913300 + + <_> + + 0 -1 129 -1073759445 2013231743 -1363169553 -1082459201 + -1414286549 868185983 -1356133589 -1077936257 + + -0.5218553543090820 0.4111092388629913 + + <_> + + 0 -1 102 -84148365 -2093417722 -1204850272 564290299 + -67121221 -1342177350 -1309195902 -776734797 + + -0.4920000731945038 0.4326725304126740 + + <_> + + 0 -1 88 -25694458 67104495 -290216278 -168563037 2083877442 + 1702788383 -144191964 -234882162 + + -0.4494568109512329 0.4448510706424713 + + <_> + + 0 -1 59 -857980836 904682741 -1612267521 232279415 + 1550862252 -574825221 -357380888 -4579409 + + -0.5180826783180237 0.3888972699642181 + + <_> + + 0 -1 27 -98549440 -137838400 494928389 -246013630 939541351 + -1196072350 -620603549 2137216273 + + -0.6081240773200989 0.3333222270011902 + + <_> + 8 + -0.6743940711021423 + + + <_> + + 0 -1 29 -150995201 2071191945 -1302151626 536934335 + -1059008937 914128709 1147328110 -268369925 + + -0.1790193915367127 0.6605972051620483 + + <_> + + 0 -1 128 -134509479 1610575703 -1342177289 1861484541 + -1107833788 1577058173 -333558568 -136319041 + + -0.3681024610996246 0.5139749646186829 + + <_> + + 0 -1 70 -1 1060154476 -1090984524 -630918524 -539492875 + 779616255 -839568424 -321 + + -0.3217232525348663 0.6171553134918213 + + <_> + + 0 -1 4 -269562385 -285029906 -791084350 -17923776 235286671 + 1275504943 1344390399 -966276889 + + -0.4373284578323364 0.4358185231685638 + + <_> + + 0 -1 76 17825984 -747628419 595427229 1474759671 575672208 + -1684005538 872217086 -1155858277 + + -0.4404836893081665 0.4601220190525055 + + <_> + + 0 -1 124 -336593039 1873735591 -822231622 -355795238 + -470820869 -1997537409 -1057132384 -1015285005 + + -0.4294152259826660 0.4452161788940430 + + <_> + + 0 -1 54 -834212130 -593694721 -322142257 -364892500 + -951029539 -302125121 -1615106053 -79249765 + + -0.3973052501678467 0.4854526817798615 + + <_> + + 0 -1 95 1342144479 2147431935 -33554561 -47873 -855685912 -1 + 1988052447 536827383 + + -0.7054683566093445 0.2697997391223908 + + <_> + 9 + -1.2042298316955566 + + + <_> + + 0 -1 39 1431368960 -183437936 -537002499 -137497097 + 1560590321 -84611081 -2097193 -513 + + -0.5905947685241699 0.5101932883262634 + + <_> + + 0 -1 120 -1645259691 2105491231 2130706431 1458995007 + -8567536 -42483883 -33780003 -21004417 + + -0.4449204802513123 0.4490709304809570 + + <_> + + 0 -1 89 -612381022 -505806938 -362027516 -452985106 + 275854917 1920431639 -12600561 -134221825 + + -0.4693818688392639 0.4061094820499420 + + <_> + + 0 -1 14 -805573153 -161 -554172679 -530519488 -16779441 + 2000682871 -33604275 -150997129 + + -0.3600351214408875 0.5056326985359192 + + <_> + + 0 -1 67 6192 435166195 1467449341 2046691505 -1608493775 + -4755729 -1083162625 -71365637 + + -0.4459891915321350 0.4132415652275085 + + <_> + + 0 -1 86 -41689215 -3281034 1853357967 -420712635 -415924289 + -270209208 -1088293113 -825311232 + + -0.4466069042682648 0.4135067760944367 + + <_> + + 0 -1 80 -117391116 -42203396 2080374461 -188709 -542008165 + -356831940 -1091125345 -1073796897 + + -0.3394956290721893 0.5658645033836365 + + <_> + + 0 -1 75 -276830049 1378714472 -1342181951 757272098 + 1073740607 -282199241 -415761549 170896931 + + -0.5346512198448181 0.3584479391574860 + + <_> + + 0 -1 55 -796075825 -123166849 2113667055 -217530421 + -1107432194 -16385 -806359809 -391188771 + + -0.4379335641860962 0.4123645126819611 + + <_> + 10 + -0.8402050137519836 + + + <_> + + 0 -1 71 -890246622 15525883 -487690486 47116238 -1212319899 + -1291847681 -68159890 -469829921 + + -0.2670986354351044 0.6014143228530884 + + <_> + + 0 -1 31 -1361180685 -1898008841 -1090588811 -285410071 + -1074016265 -840443905 2147221487 -262145 + + -0.4149844348430634 0.4670888185501099 + + <_> + + 0 -1 40 1426190596 1899364271 2142731795 -142607505 + -508232452 -21563393 -41960001 -65 + + -0.4985891580581665 0.3719584941864014 + + <_> + + 0 -1 109 -201337965 10543906 -236498096 -746195597 + 1974565825 -15204415 921907633 -190058309 + + -0.4568729996681213 0.3965812027454376 + + <_> + + 0 -1 130 -595026732 -656401928 -268649235 -571490699 + -440600392 -133131 -358810952 -2004088646 + + -0.4770836830139160 0.3862601518630981 + + <_> + + 0 -1 66 941674740 -1107882114 1332789109 -67691015 + -1360463693 -1556612430 -609108546 733546933 + + -0.4877715110778809 0.3778986334800720 + + <_> + + 0 -1 49 -17114945 -240061474 1552871558 -82775604 -932393844 + -1308544889 -532635478 -99042357 + + -0.3721654713153839 0.4994400143623352 + + <_> + + 0 -1 133 -655906006 1405502603 -939205164 1884929228 + -498859222 559417357 -1928559445 -286264385 + + -0.3934195041656494 0.4769641458988190 + + <_> + + 0 -1 0 -335837777 1860677295 -90 -1946186226 931096183 + 251612987 2013265917 -671232197 + + -0.4323300719261169 0.4342164099216461 + + <_> + + 0 -1 103 37769424 -137772680 374692301 2002666345 -536176194 + -1644484728 807009019 1069089930 + + -0.4993278682231903 0.3665378093719482 + + <_> + 9 + -1.1974394321441650 + + + <_> + + 0 -1 43 -5505 2147462911 2143265466 -4511070 -16450 -257 + -201348440 -71333206 + + -0.3310225307941437 0.5624626278877258 + + <_> + + 0 -1 90 -136842268 -499330741 2015250980 -87107126 + -641665744 -788524639 -1147864792 -134892563 + + -0.5266560912132263 0.3704403042793274 + + <_> + + 0 -1 104 -146800880 -1780368555 2111170033 -140904684 + -16777551 -1946681885 -1646463595 -839131947 + + -0.4171888828277588 0.4540435671806335 + + <_> + + 0 -1 85 -832054034 -981663763 -301990281 -578814081 + -932319000 -1997406723 -33555201 -69206017 + + -0.4556705355644226 0.3704262077808380 + + <_> + + 0 -1 24 -118492417 -1209026825 1119023838 -1334313353 + 1112948738 -297319313 1378887291 -139469193 + + -0.4182529747486115 0.4267231225967407 + + <_> + + 0 -1 78 -1714382628 -2353704 -112094959 -549613092 + -1567058760 -1718550464 -342315012 -1074972227 + + -0.3625369668006897 0.4684656262397766 + + <_> + + 0 -1 5 -85219702 316836394 -33279 1904970288 2117267315 + -260901769 -621461759 -88607770 + + -0.4742925167083740 0.3689507246017456 + + <_> + + 0 -1 11 -294654041 -353603585 -1641159686 -50331921 + -2080899877 1145569279 -143132713 -152044037 + + -0.3666271567344666 0.4580127298831940 + + <_> + + 0 -1 32 1887453658 -638545712 -1877976819 -34320972 + -1071067983 -661345416 -583338277 1060190561 + + -0.4567637443542481 0.3894708156585693 + + <_> + 9 + -0.5733128190040588 + + + <_> + + 0 -1 122 -994063296 1088745462 -318837116 -319881377 + 1102566613 1165490103 -121679694 -134744129 + + -0.4055117964744568 0.5487945079803467 + + <_> + + 0 -1 68 -285233233 -538992907 1811935199 -369234005 -529 + -20593 -20505 -1561401854 + + -0.3787897229194641 0.4532003402709961 + + <_> + + 0 -1 58 -1335245632 1968917183 1940861695 536816369 + -1226071367 -570908176 457026619 1000020667 + + -0.4258328974246979 0.4202791750431061 + + <_> + + 0 -1 94 -1360318719 -1979797897 -50435249 -18646473 + -608879292 -805306691 -269304244 -17840167 + + -0.4561023116111755 0.4002747833728790 + + <_> + + 0 -1 87 2062765935 -16449 -1275080721 -16406 45764335 + -1090552065 -772846337 -570464322 + + -0.4314672648906708 0.4086346626281738 + + <_> + + 0 -1 127 -536896021 1080817663 -738234288 -965478709 + -2082767969 1290855887 1993822934 -990381609 + + -0.4174543321132660 0.4249868988990784 + + <_> + + 0 -1 3 -818943025 168730891 -293610428 -79249354 669224671 + 621166734 1086506807 1473768907 + + -0.4321364760398865 0.4090838730335236 + + <_> + + 0 -1 79 -68895696 -67107736 -1414315879 -841676168 + -619843344 -1180610531 -1081990469 1043203389 + + -0.5018386244773865 0.3702533841133118 + + <_> + + 0 -1 116 -54002134 -543485719 -2124882422 -1437445858 + -115617074 -1195787391 -1096024366 -2140472445 + + -0.5037505626678467 0.3564981222152710 + + <_> + 9 + -0.4892596900463104 + + + <_> + + 0 -1 132 -67113211 2003808111 1862135111 846461923 -2752 + 2002237273 -273154752 1937223539 + + -0.2448196411132813 0.5689709186553955 + + <_> + + 0 -1 62 1179423888 -78064940 -611839555 -539167899 + -1289358360 -1650810108 -892540499 -1432827684 + + -0.4633283913135529 0.3587929606437683 + + <_> + + 0 -1 23 -285212705 -78450761 -656212031 -264050110 -27787425 + -1334349961 -547662981 -135796924 + + -0.3731099069118500 0.4290455579757690 + + <_> + + 0 -1 77 341863476 403702016 -550588417 1600194541 + -1080690735 951127993 -1388580949 -1153717473 + + -0.3658909499645233 0.4556473195552826 + + <_> + + 0 -1 22 -586880702 -204831512 -100644596 -39319550 + -1191150794 705692513 457203315 -75806957 + + -0.5214384198188782 0.3221037387847900 + + <_> + + 0 -1 72 -416546870 545911370 -673716192 -775559454 + -264113598 139424 -183369982 -204474641 + + -0.4289036989212036 0.4004956185817719 + + <_> + + 0 -1 50 -1026505020 -589692154 -1740499937 -1563770497 + 1348491006 -60710713 -1109853489 -633909413 + + -0.4621542394161224 0.3832748532295227 + + <_> + + 0 -1 108 -1448872304 -477895040 -1778390608 -772418127 + -1789923416 -1612057181 -805306693 -1415842113 + + -0.3711548447608948 0.4612701535224915 + + <_> + + 0 -1 92 407905424 -582449988 52654751 -1294472 -285103725 + -74633006 1871559083 1057955850 + + -0.5180652141571045 0.3205870389938355 + + <_> + 10 + -0.5911940932273865 + + + <_> + + 0 -1 81 4112 -1259563825 -846671428 -100902460 1838164148 + -74153752 -90653988 -1074263896 + + -0.2592592537403107 0.5873016119003296 + + <_> + + 0 -1 1 -285216785 -823206977 -1085589 -1081346 1207959293 + 1157103471 2097133565 -2097169 + + -0.3801195919513702 0.4718827307224274 + + <_> + + 0 -1 121 -12465 -536875169 2147478367 2130706303 -37765492 + -866124467 -318782328 -1392509185 + + -0.3509117066860199 0.5094807147979736 + + <_> + + 0 -1 38 2147449663 -20741 -16794757 1945873146 -16710 -1 + -8406341 -67663041 + + -0.4068757295608521 0.4130136370658875 + + <_> + + 0 -1 17 -155191713 866117231 1651407483 548272812 -479201468 + -447742449 1354229504 -261884429 + + -0.4557141065597534 0.3539792001247406 + + <_> + + 0 -1 100 -225319378 -251682065 -492783986 -792341777 + -1287261695 1393643841 -11274182 -213909521 + + -0.4117803275585175 0.4118592441082001 + + <_> + + 0 -1 63 -382220122 -2002072729 -51404800 -371201558 + -923011069 -2135301457 -2066104743 -1042557441 + + -0.4008397758007050 0.4034757018089294 + + <_> + + 0 -1 101 -627353764 -48295149 1581203952 -436258614 + -105268268 -1435893445 -638126888 -1061107126 + + -0.5694189667701721 0.2964762747287750 + + <_> + + 0 -1 118 -8399181 1058107691 -621022752 -251003468 -12582915 + -574619739 -994397789 -1648362021 + + -0.3195341229438782 0.5294018983840942 + + <_> + + 0 -1 92 -348343812 -1078389516 1717960437 364735981 + -1783841602 -4883137 -457572354 -1076950384 + + -0.3365339040756226 0.5067458748817444 + + <_> + 10 + -0.7612916231155396 + + + <_> + + 0 -1 10 -1976661318 -287957604 -1659497122 -782068 43591089 + -453637880 1435470000 -1077438561 + + -0.4204545319080353 0.5165745615959168 + + <_> + + 0 -1 131 -67110925 14874979 -142633168 -1338923040 + 2046713291 -2067933195 1473503712 -789579837 + + -0.3762553930282593 0.4075302779674530 + + <_> + + 0 -1 83 -272814301 -1577073 -1118685 -305156120 -1052289 + -1073813756 -538971154 -355523038 + + -0.4253497421741486 0.3728055357933044 + + <_> + + 0 -1 135 -2233 -214486242 -538514758 573747007 -159390971 + 1994225489 -973738098 -203424005 + + -0.3601998090744019 0.4563256204128265 + + <_> + + 0 -1 115 -261031688 -1330369299 -641860609 1029570301 + -1306461192 -1196149518 -1529767778 683139823 + + -0.4034293889999390 0.4160816967487335 + + <_> + + 0 -1 64 -572993608 -34042628 -417865 -111109 -1433365268 + -19869715 -1920939864 -1279457063 + + -0.3620899617671967 0.4594142735004425 + + <_> + + 0 -1 36 -626275097 -615256993 1651946018 805366393 + 2016559730 -430780849 -799868165 -16580645 + + -0.3903816640377045 0.4381459355354309 + + <_> + + 0 -1 93 1354797300 -1090957603 1976418270 -1342502178 + -1851873892 -1194637077 -1153521668 -1108399474 + + -0.3591445386409760 0.4624078869819641 + + <_> + + 0 -1 91 68157712 1211368313 -304759523 1063017136 798797750 + -275513546 648167355 -1145357350 + + -0.4297670423984528 0.4023293554782867 + + <_> + + 0 -1 107 -546318240 -1628569602 -163577944 -537002306 + -545456389 -1325465645 -380446736 -1058473386 + + -0.5727006793022156 0.2995934784412384 + + <_> + + 0 0 3 5 + <_> + + 0 0 4 2 + <_> + + 0 0 6 3 + <_> + + 0 1 2 3 + <_> + + 0 1 3 3 + <_> + + 0 1 3 7 + <_> + + 0 4 3 3 + <_> + + 0 11 3 4 + <_> + + 0 12 8 4 + <_> + + 0 14 4 3 + <_> + + 1 0 5 3 + <_> + + 1 1 2 2 + <_> + + 1 3 3 1 + <_> + + 1 7 4 4 + <_> + + 1 12 2 2 + <_> + + 1 13 4 1 + <_> + + 1 14 4 3 + <_> + + 1 17 3 2 + <_> + + 2 0 2 3 + <_> + + 2 1 2 2 + <_> + + 2 2 4 6 + <_> + + 2 3 4 4 + <_> + + 2 7 2 1 + <_> + + 2 11 2 3 + <_> + + 2 17 3 2 + <_> + + 3 0 2 2 + <_> + + 3 1 7 3 + <_> + + 3 7 2 1 + <_> + + 3 7 2 4 + <_> + + 3 18 2 2 + <_> + + 4 0 2 3 + <_> + + 4 3 2 1 + <_> + + 4 6 2 1 + <_> + + 4 6 2 5 + <_> + + 4 7 5 2 + <_> + + 4 8 4 3 + <_> + + 4 18 2 2 + <_> + + 5 0 2 2 + <_> + + 5 3 4 4 + <_> + + 5 6 2 5 + <_> + + 5 9 2 2 + <_> + + 5 10 2 2 + <_> + + 6 3 4 4 + <_> + + 6 4 4 3 + <_> + + 6 5 2 3 + <_> + + 6 5 2 5 + <_> + + 6 5 4 3 + <_> + + 6 6 4 2 + <_> + + 6 6 4 4 + <_> + + 6 18 1 2 + <_> + + 6 21 2 1 + <_> + + 7 0 3 7 + <_> + + 7 4 2 3 + <_> + + 7 9 5 1 + <_> + + 7 21 2 1 + <_> + + 8 0 1 4 + <_> + + 8 5 2 2 + <_> + + 8 5 3 2 + <_> + + 8 17 3 1 + <_> + + 8 18 1 2 + <_> + + 9 0 5 3 + <_> + + 9 2 2 6 + <_> + + 9 5 1 1 + <_> + + 9 11 1 1 + <_> + + 9 16 1 1 + <_> + + 9 16 2 1 + <_> + + 9 17 1 1 + <_> + + 9 18 1 1 + <_> + + 10 5 1 2 + <_> + + 10 5 3 3 + <_> + + 10 7 1 5 + <_> + + 10 8 1 1 + <_> + + 10 9 1 1 + <_> + + 10 10 1 1 + <_> + + 10 10 1 2 + <_> + + 10 14 3 3 + <_> + + 10 15 1 1 + <_> + + 10 15 2 1 + <_> + + 10 16 1 1 + <_> + + 10 16 2 1 + <_> + + 10 17 1 1 + <_> + + 10 21 1 1 + <_> + + 11 3 2 2 + <_> + + 11 5 1 2 + <_> + + 11 5 3 3 + <_> + + 11 5 4 6 + <_> + + 11 6 1 1 + <_> + + 11 7 2 2 + <_> + + 11 8 1 2 + <_> + + 11 10 1 1 + <_> + + 11 10 1 2 + <_> + + 11 15 1 1 + <_> + + 11 17 1 1 + <_> + + 11 18 1 1 + <_> + + 12 0 2 2 + <_> + + 12 1 2 5 + <_> + + 12 2 4 1 + <_> + + 12 3 1 3 + <_> + + 12 7 3 4 + <_> + + 12 10 3 2 + <_> + + 12 11 1 1 + <_> + + 12 12 3 2 + <_> + + 12 14 4 3 + <_> + + 12 17 1 1 + <_> + + 12 21 2 1 + <_> + + 13 6 2 5 + <_> + + 13 7 3 5 + <_> + + 13 11 3 2 + <_> + + 13 17 2 2 + <_> + + 13 17 3 2 + <_> + + 13 18 1 2 + <_> + + 13 18 2 2 + <_> + + 14 0 2 2 + <_> + + 14 1 1 3 + <_> + + 14 2 3 2 + <_> + + 14 7 2 1 + <_> + + 14 13 2 1 + <_> + + 14 13 3 3 + <_> + + 14 17 2 2 + <_> + + 15 0 2 2 + <_> + + 15 0 2 3 + <_> + + 15 4 3 2 + <_> + + 15 4 3 6 + <_> + + 15 6 3 2 + <_> + + 15 11 3 4 + <_> + + 15 13 3 2 + <_> + + 15 17 2 2 + <_> + + 15 17 3 2 + <_> + + 16 1 2 3 + <_> + + 16 3 2 4 + <_> + + 16 6 1 1 + <_> + + 16 16 2 2 + <_> + + 17 1 2 2 + <_> + + 17 1 2 5 + <_> + + 17 12 2 2 + <_> + + 18 0 2 2 + diff --git a/sample/SampleBase/Data/Text/letter-recognition.data b/sample/SampleBase/Data/Text/letter-recognition.data new file mode 100644 index 000000000..4dfa6f01a --- /dev/null +++ b/sample/SampleBase/Data/Text/letter-recognition.data @@ -0,0 +1,20000 @@ +T,2,8,3,5,1,8,13,0,6,6,10,8,0,8,0,8 +I,5,12,3,7,2,10,5,5,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,2,3,3,2,2,7,7,5,5,7,5,6,2,7,4,8 +S,6,12,6,7,3,6,8,3,6,13,7,7,2,9,3,7 +Y,3,9,5,6,3,7,9,1,6,6,11,8,2,11,2,7 +V,7,10,5,5,2,6,11,5,4,11,9,4,4,11,3,10 +S,2,0,2,1,1,8,7,4,6,5,6,8,0,8,7,8 +M,5,6,8,4,5,9,6,2,4,9,5,7,8,6,2,8 +O,9,15,6,8,5,5,7,7,4,10,7,10,5,9,5,8 +L,3,7,3,5,1,0,1,6,6,0,0,6,0,8,0,8 +D,6,9,8,8,8,7,6,5,7,7,5,9,6,5,10,3 +P,2,1,3,2,1,4,10,3,5,10,8,5,0,9,3,7 +W,3,8,5,6,5,11,11,2,2,5,8,7,7,12,1,7 +O,4,3,5,4,2,7,6,8,8,6,5,7,3,8,4,8 +E,4,9,5,6,3,5,9,2,10,10,8,9,2,8,5,5 +J,2,11,3,8,2,15,4,4,5,13,1,8,0,7,0,8 +T,5,8,7,7,7,7,9,4,8,7,7,8,3,10,8,6 +D,2,2,3,3,2,7,7,7,6,6,6,4,2,8,3,7 +C,7,10,8,8,4,4,8,6,9,12,9,13,2,9,3,7 +T,6,9,6,7,5,6,11,3,7,11,9,5,2,12,2,4 +S,2,3,4,2,1,8,7,2,6,10,6,8,1,9,5,8 +A,4,9,6,6,2,9,5,3,1,8,1,8,2,7,2,8 diff --git a/sample/SampleBase/FilePath.cs b/sample/SampleBase/FilePath.cs new file mode 100644 index 000000000..96c8f8092 --- /dev/null +++ b/sample/SampleBase/FilePath.cs @@ -0,0 +1,64 @@ +namespace SampleBase +{ + /// + /// Paths + /// + public static class FilePath + { + public static class Image + { + public const string Lenna = "Data/Image/lenna.png"; + public const string Lenna511 = "Data/Image/lenna511.png"; + public const string Girl = "Data/Image/Girl.bmp"; + public const string Mandrill = "Data/Image/Mandrill.bmp"; + public const string Goryokaku = "Data/Image/goryokaku.jpg"; + public const string Maltese = "Data/Image/maltese.jpg"; + public const string Cake = "Data/Image/cake.bmp"; + public const string Fruits = "Data/Image/fruits.jpg"; + public const string Penguin1 = "Data/Image/penguin1.png"; + public const string Penguin1b = "Data/Image/penguin1b.png"; + public const string Penguin2 = "Data/Image/penguin2.png"; + public const string Distortion = "Data/Image/Calibration/01.jpg"; + public const string Calibration = "Data/Image/Calibration/{0:D2}.jpg"; + public const string SurfBox = "Data/Image/box.png"; + public const string SurfBoxinscene = "Data/Image/box_in_scene.png"; + public const string TsukubaLeft = "Data/Image/tsukuba_left.png"; + public const string TsukubaRight = "Data/Image/tsukuba_right.png"; + public const string Square1 = "Data/Image/Squares/pic1.png"; + public const string Square2 = "Data/Image/Squares/pic2.png"; + public const string Square3 = "Data/Image/Squares/pic3.png"; + public const string Square4 = "Data/Image/Squares/pic4.png"; + public const string Square5 = "Data/Image/Squares/pic5.png"; + public const string Square6 = "Data/Image/Squares/pic6.png"; + public const string Shapes = "Data/Image/shapes.png"; + public const string Yalta = "Data/Image/yalta.jpg"; + public const string Depth16Bit = "Data/Image/16bit.png"; + public const string Hand = "Data/Image/hand_p.jpg"; + public const string Asahiyama = "Data/Image/asahiyama.jpg"; + public const string Balloon = "Data/Image/Balloon.png"; + public const string Newspaper = "Data/Image/very_old_newspaper.png"; + public const string Binarization = "Data/Image/binarization_sample.bmp"; + public const string Walkman = "Data/Image/walkman.jpg"; + public const string Cat = "Data/Image/cat.jpg"; + public const string Match1 = "Data/Image/match1.png"; + public const string Match2 = "Data/Image/match2.png"; + } + + public static class Text + { + public const string Camera = "Data/Text/camera.xml"; + public const string HaarCascade = "Data/Text/haarcascade_frontalface_default.xml"; + public const string HaarCascadeAlt = "Data/Text/haarcascade_frontalface_alt.xml"; + public const string LatentSvmCat = "Data/Text/cat.xml"; + public const string Mushroom = "Data/Text/agaricus-lepiota.data"; + public const string LetterRecog = "Data/Text/letter-recognition.data"; + public const string LbpCascade = "Data/Text/lbpcascade_frontalface.xml"; + } + + public static class Movie + { + public const string Hara = "Data/Movie/hara.flv"; + public const string Bach = "Data/Movie/bach.mp4"; + } + } +} diff --git a/sample/SampleBase/MyProcess.cs b/sample/SampleBase/MyProcess.cs new file mode 100644 index 000000000..11a5e2874 --- /dev/null +++ b/sample/SampleBase/MyProcess.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; + +namespace SampleBase +{ + /// + /// + /// + public static class MyProcess + { + /// + /// 物理メモリ使用量 + /// + /// + public static long WorkingSet64 + { + get + { + using (var proc = GetCurrentProcess()) + { + return proc.WorkingSet64; + } + } + } + + /// + /// 仮想メモリ使用量 + /// + /// + public static long VirtualMemorySize64 + { + get + { + using (var proc = GetCurrentProcess()) + { + return proc.VirtualMemorySize64; + } + } + } + + /// + /// 物理メモリ最大使用量 + /// + /// + public static long PeakPagedMemorySize64 + { + get + { + using (var proc = GetCurrentProcess()) + { + return proc.PeakPagedMemorySize64; + } + } + } + + /// + /// 仮想メモリ最大使用量 + /// + /// + public static long PeakVirtualMemorySize64 + { + get + { + using (var proc = GetCurrentProcess()) + { + return proc.PeakVirtualMemorySize64; + } + } + } + + private static Process GetCurrentProcess() + { + var proc = Process.GetCurrentProcess(); + proc.Refresh(); + return proc; + } + } +} diff --git a/sample/SampleBase/Properties/AssemblyInfo.cs b/sample/SampleBase/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..2538ee590 --- /dev/null +++ b/sample/SampleBase/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 +// アセンブリに関連付けられている情報を変更するには、 +// これらの属性値を変更してください。 +[assembly: AssemblyTitle("SampleBase")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SampleBase")] +[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから +// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 +// その型の ComVisible 属性を true に設定してください。 +[assembly: ComVisible(false)] + +// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です +[assembly: Guid("108cc3b2-b998-413e-81c3-6db426d10f6b")] + +// アセンブリのバージョン情報は、以下の 4 つの値で構成されています: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を +// 既定値にすることができます: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/sample/SampleBase/SampleBase.csproj b/sample/SampleBase/SampleBase.csproj new file mode 100644 index 000000000..7187f502b --- /dev/null +++ b/sample/SampleBase/SampleBase.csproj @@ -0,0 +1,348 @@ + + + + + + Debug + AnyCPU + {2D245C04-0F27-458A-A185-16242A3F918C} + Library + Properties + SampleBase + SampleBase + v4.5.2 + 512 + ..\ + true + + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + MinimumRecommendedRules.ruleset + false + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + prompt + MinimumRecommendedRules.ruleset + false + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + false + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + false + + + + ..\packages\OpenCvSharp3-AnyCPU.3.1.0.20160622\lib\net45\OpenCvSharp.dll + True + + + ..\packages\OpenCvSharp3-AnyCPU.3.1.0.20160622\lib\net45\OpenCvSharp.Blob.dll + True + + + ..\packages\OpenCvSharp3-AnyCPU.3.1.0.20160622\lib\net45\OpenCvSharp.Extensions.dll + True + + + ..\packages\OpenCvSharp3-AnyCPU.3.1.0.20160622\lib\net45\OpenCvSharp.UserInterface.dll + True + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + + + + このプロジェクトは、このコンピューターにはない NuGet パッケージを参照しています。これらをダウンロードするには、NuGet パッケージの復元を有効にしてください。詳細については、http://go.microsoft.com/fwlink/?LinkID=322105 を参照してください。不足しているファイルは {0} です。 + + + + + + \ No newline at end of file diff --git a/sample/SampleBase/packages.config b/sample/SampleBase/packages.config new file mode 100644 index 000000000..0101987de --- /dev/null +++ b/sample/SampleBase/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/sample/SamplesCS/ISample.cs b/sample/SamplesCS/ISample.cs new file mode 100644 index 000000000..ce85d1821 --- /dev/null +++ b/sample/SamplesCS/ISample.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace SamplesCS +{ + interface ISample + { + void Run(); + } +} diff --git a/sample/SamplesCS/Program.cs b/sample/SamplesCS/Program.cs new file mode 100644 index 000000000..45ad74a38 --- /dev/null +++ b/sample/SamplesCS/Program.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using OpenCvSharp; + +namespace SamplesCS +{ + class Program + { + [STAThread] + static void Main(string[] args) + { + ISample sample = + //new BgSubtractorMOG(); + //new BinarizerSample(); + //new BRISKSample(); + //new ClaheSample(); + //new ConnectedComponentsSample(); + //new DFT(); + //new FaceDetection(); + //new FASTSample(); + //new FlannSample(); + //new FREAKSample(); + //new HistSample(); + //new HOGSample(); + //new HoughLinesSample(); + //new KAZESample2(); + new KAZESample(); + //new MatOperations(); + //new MatToBitmap(); + //new MDS(); + //new MSERSample(); + //new NormalArrayOperations(); + //new PhotoMethods(); + //new MergeSplitSample(); + //new MorphologySample(); + //new PixelAccess(); + //new SeamlessClone(); + //new SiftSurfSample(); + //new SolveEquation(); + //new StarDetectorSample(); + //new Stitching(); + //new Subdiv2DSample(); + //new SuperResolutionSample(); + //new SVMSample(); + //new VideoWriterSample(); + //new VideoCaptureSample(); + + sample.Run(); + } + } +} diff --git a/sample/SamplesCS/Properties/AssemblyInfo.cs b/sample/SamplesCS/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..f23a93574 --- /dev/null +++ b/sample/SamplesCS/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 +// アセンブリに関連付けられている情報を変更するには、 +// これらの属性値を変更してください。 +[assembly: AssemblyTitle("SamplesCS")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SamplesCS")] +[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから +// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 +// その型の ComVisible 属性を true に設定してください。 +[assembly: ComVisible(false)] + +// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です +[assembly: Guid("1cdbab84-a43e-474c-a4c7-92b150c538a4")] + +// アセンブリのバージョン情報は、以下の 4 つの値で構成されています: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を +// 既定値にすることができます: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/sample/SamplesCS/Samples/BRISKSample.cs b/sample/SamplesCS/Samples/BRISKSample.cs new file mode 100644 index 000000000..b29fe7622 --- /dev/null +++ b/sample/SamplesCS/Samples/BRISKSample.cs @@ -0,0 +1,43 @@ +using OpenCvSharp; +using SampleBase; + +namespace SamplesCS +{ + /// + /// Retrieves keypoints using the BRISK algorithm. + /// + class BRISKSample : ISample + { + public void Run() + { + var gray = new Mat(FilePath.Image.Lenna, ImreadModes.GrayScale); + var dst = new Mat(FilePath.Image.Lenna, ImreadModes.Color); + + BRISK brisk = BRISK.Create(); + KeyPoint[] keypoints = brisk.Detect(gray); + + if (keypoints != null) + { + var color = new Scalar(0, 255, 0); + foreach (KeyPoint kpt in keypoints) + { + float r = kpt.Size / 2; + Cv2.Circle(dst, kpt.Pt, (int)r, color); + Cv2.Line(dst, + new Point2f(kpt.Pt.X + r, kpt.Pt.Y + r), + new Point2f(kpt.Pt.X - r, kpt.Pt.Y - r), + color); + Cv2.Line(dst, + new Point2f(kpt.Pt.X - r, kpt.Pt.Y + r), + new Point2f(kpt.Pt.X + r, kpt.Pt.Y - r), + color); + } + } + + using (new Window("BRISK features", dst)) + { + Cv2.WaitKey(); + } + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/BgSubtractorMOG.cs b/sample/SamplesCS/Samples/BgSubtractorMOG.cs new file mode 100644 index 000000000..a20a39574 --- /dev/null +++ b/sample/SamplesCS/Samples/BgSubtractorMOG.cs @@ -0,0 +1,35 @@ +using OpenCvSharp; +using SampleBase; + +namespace SamplesCS +{ + /// + /// + /// +// ReSharper disable once InconsistentNaming + class BgSubtractorMOG : ISample + { + public void Run() + { + using (var capture = new VideoCapture(FilePath.Movie.Bach)) + using (var mog = BackgroundSubtractorMOG.Create()) + using (var windowSrc = new Window("src")) + using (var windowDst = new Window("dst")) + { + var frame = new Mat(); + var fg = new Mat(); + while (true) + { + capture.Read(frame); + if(frame.Empty()) + break; + mog.Apply(frame, fg, 0.01); + + windowSrc.Image = frame; + windowDst.Image = fg; + Cv2.WaitKey(50); + } + } + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/BinarizerSample.cs b/sample/SamplesCS/Samples/BinarizerSample.cs new file mode 100644 index 000000000..e3962583c --- /dev/null +++ b/sample/SamplesCS/Samples/BinarizerSample.cs @@ -0,0 +1,53 @@ +using System; +using System.Diagnostics; +using OpenCvSharp; +using OpenCvSharp.Extensions; +using SampleBase; + +namespace SamplesCS +{ + internal class BinarizerSample : ISample + { + public void Run() + { + using (var src = Cv2.ImRead(FilePath.Image.Binarization, ImreadModes.GrayScale)) + using (var niblack = new Mat()) + using (var sauvola = new Mat()) + using (var bernsen = new Mat()) + using (var nick = new Mat()) + { + int kernelSize = 51; + + var sw = new Stopwatch(); + sw.Start(); + Binarizer.Niblack(src, niblack, kernelSize, -0.2); + sw.Stop(); + Console.WriteLine($"Niblack {sw.ElapsedMilliseconds} ms"); + + sw.Restart(); + Binarizer.Sauvola(src, sauvola, kernelSize, 0.1, 64); + sw.Stop(); + Console.WriteLine($"Sauvola {sw.ElapsedMilliseconds} ms"); + + sw.Restart(); + Binarizer.Bernsen(src, bernsen, kernelSize, 50, 200); + sw.Stop(); + Console.WriteLine($"Bernsen {sw.ElapsedMilliseconds} ms"); + + sw.Restart(); + Binarizer.Nick(src, nick, kernelSize, -0.14); + sw.Stop(); + Console.WriteLine($"Nick {sw.ElapsedMilliseconds} ms"); + + using (new Window("src", WindowMode.AutoSize, src)) + using (new Window("Niblack", WindowMode.AutoSize, niblack)) + using (new Window("Sauvola", WindowMode.AutoSize, sauvola)) + using (new Window("Bernsen", WindowMode.AutoSize, bernsen)) + using (new Window("Nick", WindowMode.AutoSize, nick)) + { + Cv2.WaitKey(); + } + } + } + } +} diff --git a/sample/SamplesCS/Samples/ClaheSample.cs b/sample/SamplesCS/Samples/ClaheSample.cs new file mode 100644 index 000000000..85c84190d --- /dev/null +++ b/sample/SamplesCS/Samples/ClaheSample.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using OpenCvSharp; +using SampleBase; + +namespace SamplesCS +{ + class ClaheSample : ISample + { + public void Run() + { + Mat src = new Mat(FilePath.Image.TsukubaLeft, ImreadModes.GrayScale); + Mat dst1 = new Mat(); + Mat dst2 = new Mat(); + Mat dst3 = new Mat(); + + using (CLAHE clahe = Cv2.CreateCLAHE()) + { + clahe.ClipLimit = 20; + clahe.Apply(src, dst1); + clahe.ClipLimit = 40; + clahe.Apply(src, dst2); + clahe.TilesGridSize = new Size(4, 4); + clahe.Apply(src, dst3); + } + + Window.ShowImages( + new[]{src, dst1, dst2, dst3}, + new[]{"src", "dst clip20", "dst clip40", "dst tile4x4"}); + } + } +} diff --git a/sample/SamplesCS/Samples/ConnectedComponentsSample.cs b/sample/SamplesCS/Samples/ConnectedComponentsSample.cs new file mode 100644 index 000000000..e61653aa9 --- /dev/null +++ b/sample/SamplesCS/Samples/ConnectedComponentsSample.cs @@ -0,0 +1,47 @@ +using System.Linq; +using OpenCvSharp; + +namespace SamplesCS +{ + /// + /// + /// + class ConnectedComponentsSample : ISample + { + public void Run() + { + Mat src = new Mat("Data/Image/shapes.png", ImreadModes.Color); + Mat gray = src.CvtColor(ColorConversionCodes.BGR2GRAY); + Mat binary = gray.Threshold(0, 255, ThresholdTypes.Otsu | ThresholdTypes.Binary); + Mat labelView = src.EmptyClone(); + Mat rectView = binary.CvtColor(ColorConversionCodes.GRAY2BGR); + + ConnectedComponents cc = Cv2.ConnectedComponentsEx(binary); + if (cc.LabelCount <= 1) + return; + + // draw labels + cc.RenderBlobs(labelView); + + // draw bonding boxes except background + foreach (var blob in cc.Blobs.Skip(1)) + { + rectView.Rectangle(blob.Rect, Scalar.Red); + } + + // filter maximum blob + var maxBlob = cc.GetLargestBlob(); + var filtered = new Mat(); + cc.FilterByBlob(src, filtered, maxBlob); + + using (new Window("src", src)) + using (new Window("binary", binary)) + using (new Window("labels", labelView)) + using (new Window("bonding boxes", rectView)) + using (new Window("maximum blob", filtered)) + { + Cv2.WaitKey(); + } + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/DFT.cs b/sample/SamplesCS/Samples/DFT.cs new file mode 100644 index 000000000..9ce6ddc0f --- /dev/null +++ b/sample/SamplesCS/Samples/DFT.cs @@ -0,0 +1,86 @@ +using System; +using OpenCvSharp; +using SampleBase; + +namespace SamplesCS +{ + /// + /// DFT, inverse DFT + /// http://stackoverflow.com/questions/19761526/how-to-do-inverse-dft-in-opencv + /// +// ReSharper disable once InconsistentNaming + class DFT : ISample + { + public void Run() + { + Mat img = Cv2.ImRead(FilePath.Image.Lenna, ImreadModes.GrayScale); + + // expand input image to optimal size + Mat padded = new Mat(); + int m = Cv2.GetOptimalDFTSize(img.Rows); + int n = Cv2.GetOptimalDFTSize(img.Cols); // on the border add zero values + Cv2.CopyMakeBorder(img, padded, 0, m - img.Rows, 0, n - img.Cols, BorderTypes.Constant, Scalar.All(0)); + + // Add to the expanded another plane with zeros + Mat paddedF32 = new Mat(); + padded.ConvertTo(paddedF32, MatType.CV_32F); + Mat[] planes = { paddedF32, Mat.Zeros(padded.Size(), MatType.CV_32F) }; + Mat complex = new Mat(); + Cv2.Merge(planes, complex); + + // this way the result may fit in the source matrix + Mat dft = new Mat(); + Cv2.Dft(complex, dft); + + // compute the magnitude and switch to logarithmic scale + // => log(1 + sqrt(Re(DFT(I))^2 + Im(DFT(I))^2)) + Mat[] dftPlanes; + Cv2.Split(dft, out dftPlanes); // planes[0] = Re(DFT(I), planes[1] = Im(DFT(I)) + + // planes[0] = magnitude + Mat magnitude = new Mat(); + Cv2.Magnitude(dftPlanes[0], dftPlanes[1], magnitude); + + magnitude += Scalar.All(1); // switch to logarithmic scale + Cv2.Log(magnitude, magnitude); + + // crop the spectrum, if it has an odd number of rows or columns + Mat spectrum = magnitude[ + new Rect(0, 0, magnitude.Cols & -2, magnitude.Rows & -2)]; + + // rearrange the quadrants of Fourier image so that the origin is at the image center + int cx = spectrum.Cols / 2; + int cy = spectrum.Rows / 2; + + Mat q0 = new Mat(spectrum, new Rect(0, 0, cx, cy)); // Top-Left - Create a ROI per quadrant + Mat q1 = new Mat(spectrum, new Rect(cx, 0, cx, cy)); // Top-Right + Mat q2 = new Mat(spectrum, new Rect(0, cy, cx, cy)); // Bottom-Left + Mat q3 = new Mat(spectrum, new Rect(cx, cy, cx, cy)); // Bottom-Right + + // swap quadrants (Top-Left with Bottom-Right) + Mat tmp = new Mat(); + q0.CopyTo(tmp); + q3.CopyTo(q0); + tmp.CopyTo(q3); + + // swap quadrant (Top-Right with Bottom-Left) + q1.CopyTo(tmp); + q2.CopyTo(q1); + tmp.CopyTo(q2); + + // Transform the matrix with float values into a + Cv2.Normalize(spectrum, spectrum, 0, 1, NormTypes.MinMax); + + // Show the result + Cv2.ImShow("Input Image" , img); + Cv2.ImShow("Spectrum Magnitude", spectrum); + + // calculating the idft + Mat inverseTransform = new Mat(); + Cv2.Dft(dft, inverseTransform, DftFlags.Inverse | DftFlags.RealOutput); + Cv2.Normalize(inverseTransform, inverseTransform, 0, 1, NormTypes.MinMax); + Cv2.ImShow("Reconstructed by Inverse DFT", inverseTransform); + Cv2.WaitKey(); + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/FASTSample.cs b/sample/SamplesCS/Samples/FASTSample.cs new file mode 100644 index 000000000..274434a2a --- /dev/null +++ b/sample/SamplesCS/Samples/FASTSample.cs @@ -0,0 +1,32 @@ +using OpenCvSharp; +using SampleBase; + +namespace SamplesCS +{ + /// + /// cv::FAST + /// + class FASTSample : ISample + { + public void Run() + { + using (Mat imgSrc = new Mat(FilePath.Image.Lenna, ImreadModes.Color)) + using (Mat imgGray = new Mat()) + using (Mat imgDst = imgSrc.Clone()) + { + Cv2.CvtColor(imgSrc, imgGray, ColorConversionCodes.BGR2GRAY, 0); + + KeyPoint[] keypoints = Cv2.FAST(imgGray, 50, true); + + foreach (KeyPoint kp in keypoints) + { + imgDst.Circle(kp.Pt, 3, Scalar.Red, -1, LineTypes.AntiAlias, 0); + } + + Cv2.ImShow("FAST", imgDst); + Cv2.WaitKey(0); + Cv2.DestroyAllWindows(); + } + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/FREAKSample.cs b/sample/SamplesCS/Samples/FREAKSample.cs new file mode 100644 index 000000000..33b5e4ee2 --- /dev/null +++ b/sample/SamplesCS/Samples/FREAKSample.cs @@ -0,0 +1,50 @@ +using OpenCvSharp; +using OpenCvSharp.XFeatures2D; +using SampleBase; + +namespace SamplesCS +{ + /// + /// Retrieves keypoints using the FREAK algorithm. + /// + class FREAKSample : ISample + { + public void Run() + { + var gray = new Mat(FilePath.Image.Lenna, ImreadModes.GrayScale); + var dst = new Mat(FilePath.Image.Lenna, ImreadModes.Color); + + // ORB + var orb = ORB.Create(1000); + KeyPoint[] keypoints = orb.Detect(gray); + + // FREAK + FREAK freak = FREAK.Create(); + Mat freakDescriptors = new Mat(); + freak.Compute(gray, ref keypoints, freakDescriptors); + + if (keypoints != null) + { + var color = new Scalar(0, 255, 0); + foreach (KeyPoint kpt in keypoints) + { + float r = kpt.Size / 2; + Cv2.Circle(dst, kpt.Pt, (int)r, color); + Cv2.Line(dst, + new Point2f(kpt.Pt.X + r, kpt.Pt.Y + r), + new Point2f(kpt.Pt.X - r, kpt.Pt.Y - r), + color); + Cv2.Line(dst, + new Point2f(kpt.Pt.X - r, kpt.Pt.Y + r), + new Point2f(kpt.Pt.X + r, kpt.Pt.Y - r), + color); + } + } + + using (new Window("FREAK", dst)) + { + Cv2.WaitKey(); + } + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/FaceDetection.cs b/sample/SamplesCS/Samples/FaceDetection.cs new file mode 100644 index 000000000..d623695dc --- /dev/null +++ b/sample/SamplesCS/Samples/FaceDetection.cs @@ -0,0 +1,66 @@ +using OpenCvSharp; +using SampleBase; + +namespace SamplesCS +{ + /// + /// Human face detection + /// http://docs.opencv.org/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.html + /// + class FaceDetection : ISample + { + public void Run() + { + // Load the cascades + var haarCascade = new CascadeClassifier(FilePath.Text.HaarCascade); + var lbpCascade = new CascadeClassifier(FilePath.Text.LbpCascade); + + // Detect faces + Mat haarResult = DetectFace(haarCascade); + Mat lbpResult = DetectFace(lbpCascade); + + Cv2.ImShow("Faces by Haar", haarResult); + Cv2.ImShow("Faces by LBP", lbpResult); + Cv2.WaitKey(0); + Cv2.DestroyAllWindows(); + } + + /// + /// + /// + /// + /// + private Mat DetectFace(CascadeClassifier cascade) + { + Mat result; + + using (var src = new Mat(FilePath.Image.Yalta, ImreadModes.Color)) + using (var gray = new Mat()) + { + result = src.Clone(); + Cv2.CvtColor(src, gray, ColorConversionCodes.BGR2GRAY); + + // Detect faces + Rect[] faces = cascade.DetectMultiScale( + gray, 1.08, 2, HaarDetectionType.ScaleImage, new Size(30, 30)); + + // Render all detected faces + foreach (Rect face in faces) + { + var center = new Point + { + X = (int)(face.X + face.Width * 0.5), + Y = (int)(face.Y + face.Height * 0.5) + }; + var axes = new Size + { + Width = (int)(face.Width * 0.5), + Height = (int)(face.Height * 0.5) + }; + Cv2.Ellipse(result, center, axes, 0, 0, 360, new Scalar(255, 0, 255), 4); + } + } + return result; + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/FlannSample.cs b/sample/SamplesCS/Samples/FlannSample.cs new file mode 100644 index 000000000..f763385e8 --- /dev/null +++ b/sample/SamplesCS/Samples/FlannSample.cs @@ -0,0 +1,58 @@ +using System; +using OpenCvSharp; +using OpenCvSharp.Flann; + +namespace SamplesCS +{ + /// + /// cv::flann + /// + class FlannSample : ISample + { + public void Run() + { + Console.WriteLine("===== FlannTest ====="); + + // creates data set + using (var features = new Mat(10000, 2, MatType.CV_32FC1)) + { + var rand = new Random(); + for (int i = 0; i < features.Rows; i++) + { + features.Set(i, 0, rand.Next(10000)); + features.Set(i, 1, rand.Next(10000)); + } + + // query + var queryPoint = new Point2f(7777, 7777); + var queries = new Mat(1, 2, MatType.CV_32FC1); + queries.Set(0, 0, queryPoint.X); + queries.Set(0, 1, queryPoint.Y); + Console.WriteLine("query:({0}, {1})", queryPoint.X, queryPoint.Y); + Console.WriteLine("-----"); + + // knnSearch + using (var nnIndex = new Index(features, new KDTreeIndexParams(4))) + { + const int Knn = 1; + int[] indices; + float[] dists; + nnIndex.KnnSearch(queries, out indices, out dists, Knn, new SearchParams(32)); + + for (int i = 0; i < Knn; i++) + { + int index = indices[i]; + float dist = dists[i]; + var pt = new Point2f(features.Get(index, 0), features.Get(index, 1)); + Console.Write("No.{0}\t", i); + Console.Write("index:{0}", index); + Console.Write(" distance:{0}", dist); + Console.Write(" data:({0}, {1})", pt.X, pt.Y); + Console.WriteLine(); + } + } + } + Console.Read(); + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/HOGSample.cs b/sample/SamplesCS/Samples/HOGSample.cs new file mode 100644 index 000000000..a0f600e08 --- /dev/null +++ b/sample/SamplesCS/Samples/HOGSample.cs @@ -0,0 +1,59 @@ +using System; +using System.Diagnostics; +using OpenCvSharp; +using SampleBase; + +namespace SamplesCS +{ + /// + /// samples/c/peopledetect.c + /// + internal class HOGSample : ISample + { + public HOGSample() + { + } + + public void Run() + { + var img = Cv2.ImRead(FilePath.Image.Asahiyama, ImreadModes.Color); + + var hog = new HOGDescriptor(); + hog.SetSVMDetector(HOGDescriptor.GetDefaultPeopleDetector()); + + bool b = hog.CheckDetectorSize(); + Console.WriteLine("CheckDetectorSize: {0}", b); + + var watch = Stopwatch.StartNew(); + + // run the detector with default parameters. to get a higher hit-rate + // (and more false alarms, respectively), decrease the hitThreshold and + // groupThreshold (set groupThreshold to 0 to turn off the grouping completely). + Rect[] found = hog.DetectMultiScale(img, 0, new Size(8, 8), new Size(24, 16), 1.05, 2); + + watch.Stop(); + Console.WriteLine("Detection time = {0}ms", watch.ElapsedMilliseconds); + Console.WriteLine("{0} region(s) found", found.Length); + + foreach (Rect rect in found) + { + // the HOG detector returns slightly larger rectangles than the real objects. + // so we slightly shrink the rectangles to get a nicer output. + var r = new Rect + { + X = rect.X + (int)Math.Round(rect.Width * 0.1), + Y = rect.Y + (int)Math.Round(rect.Height * 0.1), + Width = (int)Math.Round(rect.Width * 0.8), + Height = (int)Math.Round(rect.Height * 0.8) + }; + img.Rectangle(r.TopLeft, r.BottomRight, Scalar.Red, 3); + } + + using (var window = new Window("people detector", WindowMode.Normal, img)) + { + window.SetProperty(WindowProperty.Fullscreen, 1); + Cv2.WaitKey(0); + } + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/HistSample.cs b/sample/SamplesCS/Samples/HistSample.cs new file mode 100644 index 000000000..298cd2e98 --- /dev/null +++ b/sample/SamplesCS/Samples/HistSample.cs @@ -0,0 +1,58 @@ +using System; +using OpenCvSharp; +using SampleBase; + +namespace SamplesCS +{ + /// + /// Histogram sample + /// http://book.mynavi.jp/support/pc/opencv2/c3/opencv_img.html + /// + class HistSample : ISample + { + public void Run() + { + Mat src = Cv2.ImRead(FilePath.Image.Lenna, ImreadModes.GrayScale); + + // Histogram view + const int Width = 260, Height = 200; + Mat render = new Mat(new Size(Width, Height), MatType.CV_8UC3, Scalar.All(255)); + + // Calculate histogram + Mat hist = new Mat(); + int[] hdims = {256}; // Histogram size for each dimension + Rangef[] ranges = { new Rangef(0,256), }; // min/max + Cv2.CalcHist( + new Mat[]{src}, + new int[]{0}, + null, + hist, + 1, + hdims, + ranges); + + // Get the max value of histogram + double minVal, maxVal; + Cv2.MinMaxLoc(hist, out minVal, out maxVal); + + Scalar color = Scalar.All(100); + // Scales and draws histogram + hist = hist * (maxVal != 0 ? Height / maxVal : 0.0); + for (int j = 0; j < hdims[0]; ++j) + { + int binW = (int)((double)Width / hdims[0]); + render.Rectangle( + new Point(j * binW, render.Rows), + new Point((j + 1) * binW, render.Rows - (int)(hist.Get(j))), + color, + -1); + } + + using (new Window("Image", WindowMode.AutoSize | WindowMode.FreeRatio, src)) + using (new Window("Histogram", WindowMode.AutoSize | WindowMode.FreeRatio, render)) + { + Cv2.WaitKey(); + } + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/HoughLinesSample.cs b/sample/SamplesCS/Samples/HoughLinesSample.cs new file mode 100644 index 000000000..cd00aa836 --- /dev/null +++ b/sample/SamplesCS/Samples/HoughLinesSample.cs @@ -0,0 +1,65 @@ +using System; +using OpenCvSharp; +using SampleBase; + +namespace SamplesCS +{ + /// + /// Hough Transform Sample / ハフ変換による直線検出 + /// + /// http://opencv.jp/sample/special_transforms.html#hough_line + class HoughLinesSample : ISample + { + public void Run() + { + SampleCpp(); + } + + /// + /// sample of new C++ style wrapper + /// + private void SampleCpp() + { + // (1) Load the image + using (Mat imgGray = new Mat(FilePath.Image.Goryokaku, ImreadModes.GrayScale)) + using (Mat imgStd = new Mat(FilePath.Image.Goryokaku, ImreadModes.Color)) + using (Mat imgProb = imgStd.Clone()) + { + // Preprocess + Cv2.Canny(imgGray, imgGray, 50, 200, 3, false); + + // (3) Run Standard Hough Transform + LineSegmentPolar[] segStd = Cv2.HoughLines(imgGray, 1, Math.PI / 180, 50, 0, 0); + int limit = Math.Min(segStd.Length, 10); + for (int i = 0; i < limit; i++ ) + { + // Draws result lines + float rho = segStd[i].Rho; + float theta = segStd[i].Theta; + double a = Math.Cos(theta); + double b = Math.Sin(theta); + double x0 = a * rho; + double y0 = b * rho; + Point pt1 = new Point { X = (int)Math.Round(x0 + 1000 * (-b)), Y = (int)Math.Round(y0 + 1000 * (a)) }; + Point pt2 = new Point { X = (int)Math.Round(x0 - 1000 * (-b)), Y = (int)Math.Round(y0 - 1000 * (a)) }; + imgStd.Line(pt1, pt2, Scalar.Red, 3, LineTypes.AntiAlias, 0); + } + + // (4) Run Probabilistic Hough Transform + LineSegmentPoint[] segProb = Cv2.HoughLinesP(imgGray, 1, Math.PI / 180, 50, 50, 10); + foreach (LineSegmentPoint s in segProb) + { + imgProb.Line(s.P1, s.P2, Scalar.Red, 3, LineTypes.AntiAlias, 0); + } + + // (5) Show results + using (new Window("Hough_line_standard", WindowMode.AutoSize, imgStd)) + using (new Window("Hough_line_probabilistic", WindowMode.AutoSize, imgProb)) + { + Window.WaitKey(0); + } + } + } + + } +} diff --git a/sample/SamplesCS/Samples/KAZESample.cs b/sample/SamplesCS/Samples/KAZESample.cs new file mode 100644 index 000000000..cf6f485d7 --- /dev/null +++ b/sample/SamplesCS/Samples/KAZESample.cs @@ -0,0 +1,47 @@ +using System; +using System.Diagnostics; +using OpenCvSharp; +using SampleBase; + +namespace SamplesCS +{ + /// + /// Retrieves keypoints using the KAZE and AKAZE algorithm. + /// + internal class KAZESample : ISample + { + public void Run() + { + var gray = new Mat(FilePath.Image.Lenna, ImreadModes.GrayScale); + var kaze = KAZE.Create(); + var akaze = AKAZE.Create(); + + var kazeDescriptors = new Mat(); + var akazeDescriptors = new Mat(); + KeyPoint[] kazeKeyPoints = null, akazeKeyPoints = null; + var kazeTime = MeasureTime(() => + kaze.DetectAndCompute(gray, null, out kazeKeyPoints, kazeDescriptors)); + var akazeTime = MeasureTime(() => + akaze.DetectAndCompute(gray, null, out akazeKeyPoints, akazeDescriptors)); + + var dstKaze = new Mat(); + var dstAkaze = new Mat(); + Cv2.DrawKeypoints(gray, kazeKeyPoints, dstKaze); + Cv2.DrawKeypoints(gray, akazeKeyPoints, dstAkaze); + + using (new Window(String.Format("KAZE [{0:F2}ms]", kazeTime.TotalMilliseconds), dstKaze)) + using (new Window(String.Format("AKAZE [{0:F2}ms]", akazeTime.TotalMilliseconds), dstAkaze)) + { + Cv2.WaitKey(); + } + } + + private TimeSpan MeasureTime(Action action) + { + var watch = Stopwatch.StartNew(); + action(); + watch.Stop(); + return watch.Elapsed; + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/KAZESample2.cs b/sample/SamplesCS/Samples/KAZESample2.cs new file mode 100644 index 000000000..1b0b2d234 --- /dev/null +++ b/sample/SamplesCS/Samples/KAZESample2.cs @@ -0,0 +1,243 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using OpenCvSharp; +using SampleBase; + +namespace SamplesCS +{ + /// + /// https://github.com/shimat/opencvsharp/issues/176 + /// +// ReSharper disable once InconsistentNaming + class KAZESample2 : ISample + { + public static Point2d Point2fToPoint2d(Point2f pf) + { + return new Point2d(((int) pf.X), ((int) pf.Y)); + } + + public void Run() + { + using (var img1 = new Mat(FilePath.Image.SurfBox)) + using (var img2 = new Mat(FilePath.Image.SurfBoxinscene)) + using (var descriptors1 = new Mat()) + using (var descriptors2 = new Mat()) + using (var matcher = new BFMatcher(NormTypes.L2SQR)) + using (var kaze = KAZE.Create()) + { + KeyPoint[] keypoints1, keypoints2; + kaze.DetectAndCompute(img1, null, out keypoints1, descriptors1); + kaze.DetectAndCompute(img2, null, out keypoints2, descriptors2); + + DMatch[][] matches = matcher.KnnMatch(descriptors1, descriptors2, 2); + using (Mat mask = new Mat(matches.Length, 1, MatType.CV_8U)) + { + mask.SetTo(new Scalar(255)); + int nonZero = Cv2.CountNonZero(mask); + VoteForUniqueness(matches, mask); + nonZero = Cv2.CountNonZero(mask); + nonZero = VoteForSizeAndOrientation(keypoints2, keypoints1, matches, mask, 1.5f, 20); + + List obj = new List(); + List scene = new List(); + List goodMatchesList = new List(); + //iterate through the mask only pulling out nonzero items because they're matches + for (int i = 0; i < mask.Rows; i++) + { + MatIndexer maskIndexer = mask.GetGenericIndexer(); + if (maskIndexer[i] > 0) + { + obj.Add(keypoints1[matches[i][0].QueryIdx].Pt); + scene.Add(keypoints2[matches[i][0].TrainIdx].Pt); + goodMatchesList.Add(matches[i][0]); + } + } + + List objPts = obj.ConvertAll(Point2fToPoint2d); + List scenePts = scene.ConvertAll(Point2fToPoint2d); + if (nonZero >= 4) + { + Mat homography = Cv2.FindHomography(objPts, scenePts, HomographyMethods.Ransac, 1.5, mask); + nonZero = Cv2.CountNonZero(mask); + + if (homography != null) + { + Point2f[] objCorners = { new Point2f(0, 0), + new Point2f(img1.Cols, 0), + new Point2f(img1.Cols, img1.Rows), + new Point2f(0, img1.Rows) }; + + Point2d[] sceneCorners = MyPerspectiveTransform3(objCorners, homography); + + //This is a good concat horizontal + using (Mat img3 = new Mat(Math.Max(img1.Height, img2.Height), img2.Width + img1.Width, MatType.CV_8UC3)) + using (Mat left = new Mat(img3, new Rect(0, 0, img1.Width, img1.Height))) + using (Mat right = new Mat(img3, new Rect(img1.Width, 0, img2.Width, img2.Height))) + { + img1.CopyTo(left); + img2.CopyTo(right); + + byte[] maskBytes = new byte[mask.Rows * mask.Cols]; + mask.GetArray(0, 0, maskBytes); + Cv2.DrawMatches(img1, keypoints1, img2, keypoints2, goodMatchesList, img3, Scalar.All(-1), Scalar.All(-1), maskBytes, DrawMatchesFlags.NotDrawSinglePoints); + + List> listOfListOfPoint2D = new List>(); + List listOfPoint2D = new List(); + listOfPoint2D.Add(new Point(sceneCorners[0].X + img1.Cols, sceneCorners[0].Y)); + listOfPoint2D.Add(new Point(sceneCorners[1].X + img1.Cols, sceneCorners[1].Y)); + listOfPoint2D.Add(new Point(sceneCorners[2].X + img1.Cols, sceneCorners[2].Y)); + listOfPoint2D.Add(new Point(sceneCorners[3].X + img1.Cols, sceneCorners[3].Y)); + listOfListOfPoint2D.Add(listOfPoint2D); + img3.Polylines(listOfListOfPoint2D, true, Scalar.LimeGreen, 2); + + //This works too + //Cv2.Line(img3, scene_corners[0] + new Point2d(img1.Cols, 0), scene_corners[1] + new Point2d(img1.Cols, 0), Scalar.LimeGreen); + //Cv2.Line(img3, scene_corners[1] + new Point2d(img1.Cols, 0), scene_corners[2] + new Point2d(img1.Cols, 0), Scalar.LimeGreen); + //Cv2.Line(img3, scene_corners[2] + new Point2d(img1.Cols, 0), scene_corners[3] + new Point2d(img1.Cols, 0), Scalar.LimeGreen); + //Cv2.Line(img3, scene_corners[3] + new Point2d(img1.Cols, 0), scene_corners[0] + new Point2d(img1.Cols, 0), Scalar.LimeGreen); + + img3.SaveImage("Kaze_Output.png"); + Window.ShowImages(img3); + } + } + } + } + } + } + + // to avoid opencvsharp's bug + static Point2d[] MyPerspectiveTransform1(Point2f[] yourData, Mat transformationMatrix) + { + using (Mat src = new Mat(yourData.Length, 1, MatType.CV_32FC2, yourData)) + using (Mat dst = new Mat()) + { + Cv2.PerspectiveTransform(src, dst, transformationMatrix); + Point2f[] dstArray = new Point2f[dst.Rows * dst.Cols]; + dst.GetArray(0, 0, dstArray); + Point2d[] result = Array.ConvertAll(dstArray, Point2fToPoint2d); + return result; + } + } + + // fixed FromArray behavior + static Point2d[] MyPerspectiveTransform2(Point2f[] yourData, Mat transformationMatrix) + { + using (MatOfPoint2f s = MatOfPoint2f.FromArray(yourData)) + using (MatOfPoint2f d = new MatOfPoint2f()) + { + Cv2.PerspectiveTransform(s, d, transformationMatrix); + Point2f[] f = d.ToArray(); + return f.Select(Point2fToPoint2d).ToArray(); + } + } + + // new API + static Point2d[] MyPerspectiveTransform3(Point2f[] yourData, Mat transformationMatrix) + { + Point2f[] ret = Cv2.PerspectiveTransform(yourData, transformationMatrix); + return ret.Select(Point2fToPoint2d).ToArray(); + } + + static int VoteForSizeAndOrientation(KeyPoint[] modelKeyPoints, KeyPoint[] observedKeyPoints, DMatch[][] matches, Mat mask, float scaleIncrement, int rotationBins) + { + int idx = 0; + int nonZeroCount = 0; + byte[] maskMat = new byte[mask.Rows]; + GCHandle maskHandle = GCHandle.Alloc(maskMat, GCHandleType.Pinned); + using (Mat m = new Mat(mask.Rows, 1, MatType.CV_8U, maskHandle.AddrOfPinnedObject())) + { + mask.CopyTo(m); + List logScale = new List(); + List rotations = new List(); + double s, maxS, minS, r; + maxS = -1.0e-10f; minS = 1.0e10f; + + //if you get an exception here, it's because you're passing in the model and observed keypoints backwards. Just switch the order. + for (int i = 0; i < maskMat.Length; i++) + { + if (maskMat[i] > 0) + { + KeyPoint observedKeyPoint = observedKeyPoints[i]; + KeyPoint modelKeyPoint = modelKeyPoints[matches[i][0].TrainIdx]; + s = Math.Log10(observedKeyPoint.Size / modelKeyPoint.Size); + logScale.Add((float)s); + maxS = s > maxS ? s : maxS; + minS = s < minS ? s : minS; + + r = observedKeyPoint.Angle - modelKeyPoint.Angle; + r = r < 0.0f ? r + 360.0f : r; + rotations.Add((float)r); + } + } + + int scaleBinSize = (int)Math.Ceiling((maxS - minS) / Math.Log10(scaleIncrement)); + if (scaleBinSize < 2) + scaleBinSize = 2; + float[] scaleRanges = { (float)minS, (float)(minS + scaleBinSize + Math.Log10(scaleIncrement)) }; + + using (MatOfFloat scalesMat = new MatOfFloat(rows: logScale.Count, cols: 1, data: logScale.ToArray())) + using (MatOfFloat rotationsMat = new MatOfFloat(rows: rotations.Count, cols: 1, data: rotations.ToArray())) + using (MatOfFloat flagsMat = new MatOfFloat(logScale.Count, 1)) + using (Mat hist = new Mat()) + { + flagsMat.SetTo(new Scalar(0.0f)); + float[] flagsMatFloat1 = flagsMat.ToArray(); + + int[] histSize = { scaleBinSize, rotationBins }; + float[] rotationRanges = { 0.0f, 360.0f }; + int[] channels = { 0, 1 }; + Rangef[] ranges = { new Rangef(scaleRanges[0], scaleRanges[1]), new Rangef(rotations.Min(), rotations.Max()) }; + double minVal, maxVal; + + Mat[] arrs = { scalesMat, rotationsMat }; + Cv2.CalcHist(arrs, channels, null, hist, 2, histSize, ranges); + Cv2.MinMaxLoc(hist, out minVal, out maxVal); + + Cv2.Threshold(hist, hist, maxVal * 0.5, 0, ThresholdTypes.Tozero); + Cv2.CalcBackProject(arrs, channels, hist, flagsMat, ranges); + + MatIndexer flagsMatIndexer = flagsMat.GetIndexer(); + + for (int i = 0; i < maskMat.Length; i++) + { + if (maskMat[i] > 0) + { + if (flagsMatIndexer[idx++] != 0.0f) + { + nonZeroCount++; + } + else + maskMat[i] = 0; + } + } + m.CopyTo(mask); + } + } + maskHandle.Free(); + + return nonZeroCount; + } + + private static void VoteForUniqueness(DMatch[][] matches, Mat mask, float uniqnessThreshold = 0.80f) + { + byte[] maskData = new byte[matches.Length]; + GCHandle maskHandle = GCHandle.Alloc(maskData, GCHandleType.Pinned); + using (Mat m = new Mat(matches.Length, 1, MatType.CV_8U, maskHandle.AddrOfPinnedObject())) + { + mask.CopyTo(m); + for (int i = 0; i < matches.Length; i++) + { + //This is also known as NNDR Nearest Neighbor Distance Ratio + if ((matches[i][0].Distance / matches[i][1].Distance) <= uniqnessThreshold) + maskData[i] = 255; + else + maskData[i] = 0; + } + m.CopyTo(mask); + } + maskHandle.Free(); + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/MDS.cs b/sample/SamplesCS/Samples/MDS.cs new file mode 100644 index 000000000..b569022a9 --- /dev/null +++ b/sample/SamplesCS/Samples/MDS.cs @@ -0,0 +1,157 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using OpenCvSharp; + +namespace SamplesCS +{ + /// + /// Multidimensional Scaling (多次元尺度構成法) + /// for C++ cv::Mat testing + /// + class MDS : ISample + { + /// + /// Distance among 10 American cities + /// + /// + /// * The linear distance between Atlanta and Chicago is 587km. + /// + static readonly double[,] CityDistance = + { + /*Atlanta*/ {0, 587, 1212, 701, 1936, 604, 748, 2139, 2182, 543}, + /*Chicago*/ {587, 0, 920, 940, 1745, 1188, 713, 1858, 1737, 597}, + /*Denver*/ {1212, 920, 0, 879, 831, 1726, 1631, 949, 1021, 1494}, + /*Houston*/ {701, 940, 879, 0, 1734, 968, 1420, 1645, 1891, 1220}, + /*Los Angeles*/ {1936, 1745, 831, 1734, 0, 2339, 2451, 347, 959, 2300}, + /*Miami*/ {604, 1188, 1726, 968, 2339, 0, 1092, 2594, 2734, 923}, + /*New York*/ {748, 713, 1631, 1420, 2451, 1092, 0, 2571, 2408, 205}, + /*San Francisco*/ {2139, 1858, 949, 1645, 347, 2594, 2571, 0, 678, 2442}, + /*Seattle*/ {2182, 1737, 1021, 1891, 959, 2734, 2408, 678, 0, 2329}, + /*Washington D.C.*/ {543, 597, 1494, 1220, 2300, 923, 205, 2442, 2329, 0} + }; + /// + /// City names + /// + static readonly string[] CityNames = + { + "Atlanta","Chicago","Denver","Houston","Los Angeles","Miami","New York","San Francisco","Seattle","Washington D.C." + }; + + + /// + /// Classical Multidimensional Scaling + /// + public void Run() + { + // creates distance matrix + int size = CityDistance.GetLength(0); + Mat t = new Mat(size, size, MatType.CV_64FC1, CityDistance); + // adds Torgerson's additive constant to t + double torgarson = Torgerson(t); + t += torgarson; + // squares all elements of t + t = t.Mul(t); + + // centering matrix G + Mat g = CenteringMatrix(size); + // calculates inner product matrix B + Mat b = g * t * g.T() * -0.5; + // calculates eigenvalues and eigenvectors of B + Mat values = new Mat(); + Mat vectors = new Mat(); + Cv2.Eigen(b, values, vectors); + for (int r = 0; r < values.Rows; r++) + { + if (values.Get(r) < 0) + values.Set(r, 0); + } + + //Console.WriteLine(values.Dump()); + + // multiplies sqrt(eigenvalue) by eigenvector + Mat result = vectors.RowRange(0, 2); + { + var at = result.GetGenericIndexer(); + for (int r = 0; r < result.Rows; r++) + { + for (int c = 0; c < result.Cols; c++) + { + at[r, c] *= Math.Sqrt(values.Get(r)); + } + } + } + + // scaling + Cv2.Normalize(result, result, 0, 800, NormTypes.MinMax); + + // opens a window + using (Mat img = Mat.Zeros(600, 800, MatType.CV_8UC3)) + using (Window window = new Window("City Location Estimation")) + { + var at = result.GetGenericIndexer(); + for (int c = 0; c < size; c++) + { + double x = at[0, c]; + double y = at[1, c]; + x = x * 0.7 + img.Width * 0.1; + y = y * 0.7 + img.Height * 0.1; + img.Circle((int)x, (int)y, 5, Scalar.Red, -1); + Point textPos = new Point(x + 5, y + 10); + img.PutText(CityNames[c], textPos, HersheyFonts.HersheySimplex, 0.5, Scalar.White); + } + window.Image = img; + Cv2.WaitKey(); + } + } + + /// + /// Returns Torgerson's additive constant + /// + /// + /// + private double Torgerson(Mat mat) + { + if (mat == null) + throw new ArgumentNullException(); + if (mat.Rows != mat.Cols) + throw new ArgumentException(); + + int n = mat.Rows; + // Additive constant in case of negative value + double min, max; + Cv2.MinMaxLoc(-mat, out min, out max); + double c2 = max; + // Additive constant from triangular inequality + double c1 = 0; + + var at = mat.GetGenericIndexer(); + for (int i = 0; i < n; i++) + { + for (int j = 0; j < n; j++) + { + for (int k = 0; k < n; k++) + { + double v = at[i, k] - at[i, j] - at[j, k]; + if (v > c1) + { + c1 = v; + } + } + } + } + return Math.Max(Math.Max(c1, c2), 0); + } + + /// + /// Returns centering matrix + /// + /// Size of matrix + /// + private Mat CenteringMatrix(int n) + { + return (Mat.Eye(n, n, MatType.CV_64FC1) - 1.0 / n); + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/MSERSample.cs b/sample/SamplesCS/Samples/MSERSample.cs new file mode 100644 index 000000000..05c4a2fda --- /dev/null +++ b/sample/SamplesCS/Samples/MSERSample.cs @@ -0,0 +1,51 @@ +using OpenCvSharp; +using SampleBase; + +namespace SamplesCS +{ + /// + /// Maximally Stable Extremal Regions + /// + class MSERSample : ISample + { + public void Run() + { + using (Mat src = new Mat(FilePath.Image.Distortion, ImreadModes.Color)) + using (Mat gray = new Mat()) + using (Mat dst = src.Clone()) + { + Cv2.CvtColor(src, gray, ColorConversionCodes.BGR2GRAY); + + CppStyleMSER(gray, dst); // C++ style + + using (new Window("MSER src", src)) + using (new Window("MSER gray", gray)) + using (new Window("MSER dst", dst)) + { + Cv2.WaitKey(); + } + } + } + + /// + /// Extracts MSER by C++-style code (cv::MSER) + /// + /// + /// + private void CppStyleMSER(Mat gray, Mat dst) + { + MSER mser = MSER.Create(); + Point[][] contours; + Rect[] bboxes; + mser.DetectRegions(gray, out contours, out bboxes); + foreach (Point[] pts in contours) + { + Scalar color = Scalar.RandomColor(); + foreach (Point p in pts) + { + dst.Circle(p, 1, color); + } + } + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/MatOperations.cs b/sample/SamplesCS/Samples/MatOperations.cs new file mode 100644 index 000000000..b1a50e55b --- /dev/null +++ b/sample/SamplesCS/Samples/MatOperations.cs @@ -0,0 +1,105 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using OpenCvSharp; +using SampleBase; + +namespace SamplesCS +{ + /// + /// + /// + class MatOperations : ISample + { + public void Run() + { + SubMat(); + RowColRangeOperation(); + RowColOperation(); + } + + /// + /// Submatrix operations + /// + private void SubMat() + { + Mat src = Cv2.ImRead(FilePath.Image.Lenna); + + // Assign small image to mat + Mat small = new Mat(); + Cv2.Resize(src, small, new Size(100, 100)); + src[10, 110, 10, 110] = small; + src[370, 470, 400, 500] = small.T(); + // ↑ This is same as the following: + //small.T().CopyTo(src[370, 470, 400, 500]); + + // Get partial mat (similar to cvSetImageROI) + Mat part = src[200, 400, 200, 360]; + // Invert partial pixel values + Cv2.BitwiseNot(part, part); + + // Fill the region (50..100, 100..150) with color (128, 0, 0) + part = src.SubMat(50, 100, 400, 450); + part.SetTo(128); + + using (new Window("SubMat", src)) + { + Cv2.WaitKey(); + } + } + + /// + /// Submatrix operations + /// + private void RowColRangeOperation() + { + Mat src = Cv2.ImRead(FilePath.Image.Lenna); + + Cv2.GaussianBlur( + src.RowRange(100, 200), + src.RowRange(200, 300), + new Size(7, 7), 20); + + Cv2.GaussianBlur( + src.ColRange(200, 300), + src.ColRange(100, 200), + new Size(7, 7), 20); + + using (new Window("RowColRangeOperation", src)) + { + Cv2.WaitKey(); + } + } + + /// + /// Submatrix expression operations + /// + private void RowColOperation() + { + Mat src = Cv2.ImRead(FilePath.Image.Lenna); + + Random rand = new Random(); + for (int i = 0; i < 200; i++) + { + int c1 = rand.Next(100, 400); + int c2 = rand.Next(100, 400); + Mat temp = src.Row[c1]; + src.Row[c1] = src.Row[c2]; + src.Row[c2] = temp; + } + + src.Col[0, 50] = ~src.Col[450, 500]; + + // set constant value (not recommended) + src.Row[450,460] = src.Row[450,460] * 0 + new Scalar(0,0,255); + // recommended way + //src.RowRange(450, 460).SetTo(new Scalar(0, 0, 255)); + + using (new Window("RowColOperation", src)) + { + Cv2.WaitKey(); + } + } + + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/MatToBitmap.cs b/sample/SamplesCS/Samples/MatToBitmap.cs new file mode 100644 index 000000000..005bd76a2 --- /dev/null +++ b/sample/SamplesCS/Samples/MatToBitmap.cs @@ -0,0 +1,105 @@ +using System; +using System.Diagnostics; +using System.Drawing; +using OpenCvSharp; +using System.Windows.Forms; +using OpenCvSharp.Extensions; +using SampleBase; + +namespace SamplesCS +{ + /// + /// + /// + class MatToBitmap : ISample + { + public void Run() + { + ToMat(); + ToMatGrayScale(); + ToBitmap(); + ToBitmapGrayScale(); + } + + public void ToBitmap() + { + Mat img = new Mat(FilePath.Image.Lenna511, ImreadModes.Color); // width % 4 != 0 + + Bitmap bitmap = BitmapConverter.ToBitmap(img); + // Bitmap bitmap = img.ToBitmap(); + + using (var form = new Form()) + using (var pb = new PictureBox()) + { + pb.Image = bitmap; + var size = new System.Drawing.Size(bitmap.Width, bitmap.Height); + pb.ClientSize = size; + form.ClientSize = size; + form.Controls.Add(pb); + form.KeyPreview = true; + form.KeyDown += (sender, args) => + { + if (args.KeyCode.HasFlag(Keys.Enter)) + ((Form)sender).Close(); + }; + form.Text = "Mat to Bitmap Test"; + + form.ShowDialog(); + } + } + + public void ToBitmapGrayScale() + { + Mat img = new Mat(FilePath.Image.Lenna511, ImreadModes.GrayScale); // width % 4 != 0 + + Bitmap bitmap = BitmapConverter.ToBitmap(img); + // Bitmap bitmap = img.ToBitmap(); + + using (var form = new Form()) + using (var pb = new PictureBox()) + { + pb.Image = bitmap; + var size = new System.Drawing.Size(bitmap.Width, bitmap.Height); + pb.ClientSize = size; + form.ClientSize = size; + form.Controls.Add(pb); + form.KeyPreview = true; + form.KeyDown += (sender, args) => + { + if (args.KeyCode.HasFlag(Keys.Enter)) + ((Form)sender).Close(); + }; + form.Text = "Grayscale Mat to Bitmap Test"; + + form.ShowDialog(); + } + } + + public void ToMat() + { + Bitmap bitmap = new Bitmap(FilePath.Image.Lenna511); // width % 4 != 0 + + Mat converted = BitmapConverter.ToMat(bitmap); + //Mat converted = Mat.FromBitmap(bitmap); + + using (new Window("Bitmap to Mat test", converted)) + { + Cv2.WaitKey(); + } + } + + public void ToMatGrayScale() + { + Mat img = new Mat(FilePath.Image.Lenna511, ImreadModes.GrayScale); + Bitmap bitmap = img.ToBitmap(); + + Mat converted = BitmapConverter.ToMat(bitmap); + //Mat converted = Mat.FromBitmap(bitmap); + + using (new Window("Grayscale Bitmap to Mat test", converted)) + { + Cv2.WaitKey(); + } + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/MergeSplitSample.cs b/sample/SamplesCS/Samples/MergeSplitSample.cs new file mode 100644 index 000000000..322c5ebab --- /dev/null +++ b/sample/SamplesCS/Samples/MergeSplitSample.cs @@ -0,0 +1,61 @@ +using OpenCvSharp; +using SampleBase; + +namespace SamplesCS +{ + /// + /// + /// + class MergeSplitSample : ISample + { + public void Run() + { + // Split/Merge Test + { + Mat src = new Mat(FilePath.Image.Lenna, ImreadModes.Color); + + // Split each plane + Mat[] planes; + Cv2.Split(src, out planes); + + Cv2.ImShow("planes 0", planes[0]); + Cv2.ImShow("planes 1", planes[1]); + Cv2.ImShow("planes 2", planes[2]); + Cv2.WaitKey(); + Cv2.DestroyAllWindows(); + + // Invert G plane + Cv2.BitwiseNot(planes[1], planes[1]); + + // Merge + Mat merged = new Mat(); + Cv2.Merge(planes, merged); + + Cv2.ImShow("src", src); + Cv2.ImShow("merged", merged); + Cv2.WaitKey(); + Cv2.DestroyAllWindows(); + } + + // MixChannels Test + { + Mat rgba = new Mat(300, 300, MatType.CV_8UC4, new Scalar(50, 100, 150, 200)); + Mat bgr = new Mat(rgba.Rows, rgba.Cols, MatType.CV_8UC3); + Mat alpha = new Mat(rgba.Rows, rgba.Cols, MatType.CV_8UC1); + + Mat[] input = { rgba }; + Mat[] output = { bgr, alpha }; + // rgba[0] -> bgr[2], rgba[1] -> bgr[1], + // rgba[2] -> bgr[0], rgba[3] -> alpha[0] + int[] fromTo = { 0, 2, 1, 1, 2, 0, 3, 3 }; + Cv2.MixChannels(input, output, fromTo); + + Cv2.ImShow("rgba", rgba); + Cv2.ImShow("bgr", bgr); + Cv2.ImShow("alpha", alpha); + Cv2.WaitKey(); + Cv2.DestroyAllWindows(); + } + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/MorphologySample.cs b/sample/SamplesCS/Samples/MorphologySample.cs new file mode 100644 index 000000000..eee433691 --- /dev/null +++ b/sample/SamplesCS/Samples/MorphologySample.cs @@ -0,0 +1,35 @@ +using OpenCvSharp; +using SampleBase; + +namespace SamplesCS +{ + /// + /// + /// + class MorphologySample : ISample + { + public void Run() + { + Mat gray = new Mat(FilePath.Image.Lenna, ImreadModes.GrayScale); + Mat binary = new Mat(); + Mat dilate1 = new Mat(); + Mat dilate2 = new Mat(); + byte[] kernelValues = {0, 1, 0, 1, 1, 1, 0, 1, 0}; // cross (+) + Mat kernel = new Mat(3, 3, MatType.CV_8UC1, kernelValues); + + // Binarize + Cv2.Threshold(gray, binary, 0, 255, ThresholdTypes.Otsu); + + // empty kernel + Cv2.Dilate(binary, dilate1, null); + // + kernel + Cv2.Dilate(binary, dilate2, kernel); + + Cv2.ImShow("binary", binary); + Cv2.ImShow("dilate (kernel = null)", dilate1); + Cv2.ImShow("dilate (kernel = +)", dilate2); + Cv2.WaitKey(0); + Cv2.DestroyAllWindows(); + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/NormalArrayOperations.cs b/sample/SamplesCS/Samples/NormalArrayOperations.cs new file mode 100644 index 000000000..f2f61510a --- /dev/null +++ b/sample/SamplesCS/Samples/NormalArrayOperations.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using OpenCvSharp; + +namespace SamplesCS +{ + /// + /// + /// + class NormalArrayOperations : ISample + { + public void Run() + { + Threshold1(); + Threshold2(); + Threshold3(); + + Console.Read(); + } + + /// + /// Run thresholding to byte array + /// + private void Threshold1() + { + const int T = 3; + const int Max = 5; + + byte[] input = {1, 2, 3, 4, 5, }; + List output = new List(); + + Cv2.Threshold(InputArray.Create(input), OutputArray.Create(output), + T, Max, ThresholdTypes.Binary); + + Console.WriteLine("Threshold: {0}", T); + Console.WriteLine("input: {0}", String.Join(",", input)); + Console.WriteLine("output: {0}", String.Join(",", output)); + } + + /// + /// Run thresholding to short array + /// + private void Threshold2() + { + const int T = 150; + const int Max = 250; + + short[] input = { 50, 100, 150, 200, 250, }; + List output = new List(); + + Cv2.Threshold(InputArray.Create(input), OutputArray.Create(output), + T, Max, ThresholdTypes.Binary); + + Console.WriteLine("Threshold: {0}", T); + Console.WriteLine("input: {0}", String.Join(",", input)); + Console.WriteLine("output: {0}", String.Join(",", output)); + } + + /// + /// Run thresholding to struct array + /// + private void Threshold3() + { + const double T = 2000; + const double Max = 5000; + + // threshold does not support Point (int) + Point2f[] input = { + new Point2f(1000, 1500), + new Point2f(2000, 2001), + new Point2f(500, 5000), + }; + List output = new List(); + + Cv2.Threshold(InputArray.Create(input), OutputArray.Create(output), + T, Max, ThresholdTypes.Binary); + + Console.WriteLine("Threshold: {0}", T); + Console.WriteLine("input: {0}", String.Join(",", input)); + Console.WriteLine("output: {0}", String.Join(",", output)); + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/PhotoMethods.cs b/sample/SamplesCS/Samples/PhotoMethods.cs new file mode 100644 index 000000000..ee6865e9a --- /dev/null +++ b/sample/SamplesCS/Samples/PhotoMethods.cs @@ -0,0 +1,40 @@ +using OpenCvSharp; +using SampleBase; + +namespace SamplesCS +{ + /// + /// sample of photo module methods + /// + class PhotoMethods : ISample + { + public void Run() + { + Mat src = new Mat(FilePath.Image.Fruits, ImreadModes.Color); + + Mat normconv = new Mat(), recursFildered = new Mat(); + Cv2.EdgePreservingFilter(src, normconv, EdgePreservingMethods.NormconvFilter); + Cv2.EdgePreservingFilter(src, recursFildered, EdgePreservingMethods.RecursFilter); + + Mat detailEnhance = new Mat(); + Cv2.DetailEnhance(src, detailEnhance); + + Mat pencil1 = new Mat(), pencil2 = new Mat(); + Cv2.PencilSketch(src, pencil1, pencil2); + + Mat stylized = new Mat(); + Cv2.Stylization(src, stylized); + + using (new Window("src", src)) + using (new Window("edgePreservingFilter - NormconvFilter", normconv)) + using (new Window("edgePreservingFilter - RecursFilter", recursFildered)) + using (new Window("detailEnhance", detailEnhance)) + using (new Window("pencilSketch grayscale", pencil1)) + using (new Window("pencilSketch color", pencil2)) + using (new Window("stylized", stylized)) + { + Cv2.WaitKey(); + } + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/PixelAccess.cs b/sample/SamplesCS/Samples/PixelAccess.cs new file mode 100644 index 000000000..06d51a47f --- /dev/null +++ b/sample/SamplesCS/Samples/PixelAccess.cs @@ -0,0 +1,105 @@ +using System; +using System.Diagnostics; +using OpenCvSharp; +using SampleBase; + +namespace SamplesCS +{ + /// + /// Swaps B for R + /// + class PixelAccess : ISample + { + public void Run() + { + Console.WriteLine("Get/Set: {0}ms", MeasureTime(GetSet)); + Console.WriteLine("GenericIndexer: {0}ms", MeasureTime(GenericIndexer)); + Console.WriteLine("TypeSpecificMat: {0}ms", MeasureTime(TypeSpecificMat)); + Console.Read(); + } + + /// + /// Slow + /// + private void GetSet() + { + using (Mat mat = new Mat(FilePath.Image.Lenna, ImreadModes.Color)) + { + for (int y = 0; y < mat.Height; y++) + { + for (int x = 0; x < mat.Width; x++) + { + Vec3b color = mat.Get(y, x); + Swap(ref color.Item0, ref color.Item2); + mat.Set(y, x, color); + } + } + //Cv2.ImShow("Slow", mat); + //Cv2.WaitKey(0); + //Cv2.DestroyAllWindows(); + } + } + + /// + /// Reasonably fast + /// + private void GenericIndexer() + { + using (Mat mat = new Mat(FilePath.Image.Lenna, ImreadModes.Color)) + { + var indexer = mat.GetGenericIndexer(); + for (int y = 0; y < mat.Height; y++) + { + for (int x = 0; x < mat.Width; x++) + { + Vec3b color = indexer[y, x]; + Swap(ref color.Item0, ref color.Item2); + indexer[y, x] = color; + } + } + //Cv2.ImShow("GenericIndexer", mat); + //Cv2.WaitKey(0); + //Cv2.DestroyAllWindows(); + } + } + + /// + /// Faster + /// + private void TypeSpecificMat() + { + using (Mat mat = new Mat(FilePath.Image.Lenna, ImreadModes.Color)) + { + MatOfByte3 mat3 = new MatOfByte3(mat); + var indexer = mat3.GetIndexer(); + for (int y = 0; y < mat.Height; y++) + { + for (int x = 0; x < mat.Width; x++) + { + Vec3b color = indexer[y, x]; + Swap(ref color.Item0, ref color.Item2); + indexer[y, x] = color; + } + } + //Cv2.ImShow("TypeSpecificMat", mat); + //Cv2.WaitKey(0); + //Cv2.DestroyAllWindows(); + } + } + + private static void Swap(ref T a, ref T b) + { + T temp = b; + b = a; + a = temp; + } + + private static long MeasureTime(Action action) + { + Stopwatch watch = Stopwatch.StartNew(); + action(); + watch.Stop(); + return watch.ElapsedMilliseconds; + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/SVMSample.cs b/sample/SamplesCS/Samples/SVMSample.cs new file mode 100644 index 000000000..6fa049531 --- /dev/null +++ b/sample/SamplesCS/Samples/SVMSample.cs @@ -0,0 +1,97 @@ +using System; +using OpenCvSharp; +using OpenCvSharp.ML; + +namespace SamplesCS +{ + /// + /// Support Vector Machine + /// + /// http://opencv.jp/sample/svm.html#svm + internal class SVMSample : ISample + { + private static double f(double x) + { + return x + 50 * Math.Sin(x / 15.0); + } + + public void Run() + { + // Training data + var points = new Point2f[500]; + var responses = new int[points.Length]; + var rand = new Random(); + for (int i = 0; i < responses.Length; i++) + { + float x = rand.Next(0, 300); + float y = rand.Next(0, 300); + points[i] = new Point2f(x, y); + responses[i] = (y > f(x)) ? 1 : 2; + } + + // Show training data and f(x) + using (Mat pointsPlot = Mat.Zeros(300, 300, MatType.CV_8UC3)) + { + for (int i = 0; i < points.Length; i++) + { + int x = (int)points[i].X; + int y = (int)(300 - points[i].Y); + int res = responses[i]; + Scalar color = (res == 1) ? Scalar.Red : Scalar.GreenYellow; + pointsPlot.Circle(x, y, 2, color, -1); + } + // f(x) + for (int x = 1; x < 300; x++) + { + int y1 = (int)(300 - f(x - 1)); + int y2 = (int)(300 - f(x)); + pointsPlot.Line(x - 1, y1, x, y2, Scalar.LightBlue, 1); + } + Window.ShowImages(pointsPlot); + } + + // Train + var dataMat = new Mat(points.Length, 2, MatType.CV_32FC1, points); + var resMat = new Mat(responses.Length, 1, MatType.CV_32SC1, responses); + using (var svm = SVM.Create()) + { + // normalize data + dataMat /= 300.0; + + // SVM parameters + svm.Type = SVM.Types.CSvc; + svm.KernelType = SVM.KernelTypes.Rbf; + svm.TermCriteria = TermCriteria.Both(1000, 0.000001); + svm.Degree = 100.0; + svm.Gamma = 100.0; + svm.Coef0 = 1.0; + svm.C = 1.0; + svm.Nu = 0.5; + svm.P = 0.1; + + svm.Train(dataMat, SampleTypes.RowSample, resMat); + + // Predict for each 300x300 pixel + using (Mat retPlot = Mat.Zeros(300, 300, MatType.CV_8UC3)) + { + for (int x = 0; x < 300; x++) + { + for (int y = 0; y < 300; y++) + { + float[] sample = {x / 300f, y / 300f}; + var sampleMat = new Mat(1, 2, MatType.CV_32FC1, sample); + int ret = (int)svm.Predict(sampleMat); + var plotRect = new Rect(x, 300 - y, 1, 1); + if (ret == 1) + retPlot.Rectangle(plotRect, Scalar.Red); + else if (ret == 2) + retPlot.Rectangle(plotRect, Scalar.GreenYellow); + } + } + Window.ShowImages(retPlot); + } + } + } + + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/SeamlessClone.cs b/sample/SamplesCS/Samples/SeamlessClone.cs new file mode 100644 index 000000000..883b2beb0 --- /dev/null +++ b/sample/SamplesCS/Samples/SeamlessClone.cs @@ -0,0 +1,44 @@ +using OpenCvSharp; +using SampleBase; + +namespace SamplesCS +{ + /// + /// cv::seamlessClone + /// + class SeamlessClone : ISample + { + public void Run() + { + Mat src = new Mat(FilePath.Image.Girl, ImreadModes.Color); + Mat dst = new Mat(FilePath.Image.Lenna, ImreadModes.Color); + Mat src0 = src.Resize(dst.Size(), 0, 0, InterpolationFlags.Lanczos4); + Mat mask = Mat.Zeros(src0.Size(), MatType.CV_8UC3); + + mask.Circle(200, 200, 100, Scalar.White, -1); + + Mat blend1 = new Mat(); + Mat blend2 = new Mat(); + Mat blend3 = new Mat(); + Cv2.SeamlessClone( + src0, dst, mask, new Point(260, 270), blend1, + SeamlessCloneMethods.NormalClone); + Cv2.SeamlessClone( + src0, dst, mask, new Point(260, 270), blend2, + SeamlessCloneMethods.MonochromeTransfer); + Cv2.SeamlessClone( + src0, dst, mask, new Point(260, 270), blend3, + SeamlessCloneMethods.MixedClone); + + using (new Window("src", src0)) + using (new Window("dst", dst)) + using (new Window("mask", mask)) + using (new Window("blend NormalClone", blend1)) + using (new Window("blend MonochromeTransfer", blend2)) + using (new Window("blend MixedClone", blend3)) + { + Cv2.WaitKey(); + } + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/SiftSurfSample.cs b/sample/SamplesCS/Samples/SiftSurfSample.cs new file mode 100644 index 000000000..eadfa994d --- /dev/null +++ b/sample/SamplesCS/Samples/SiftSurfSample.cs @@ -0,0 +1,95 @@ +using OpenCvSharp; +using OpenCvSharp.XFeatures2D; +using SampleBase; + +namespace SamplesCS +{ + /// + /// SIFT and SURF sample + /// http://www.prism.gatech.edu/~ahuaman3/docs/OpenCV_Docs/tutorials/nonfree_1/nonfree_1.html + /// + class SiftSurfSample : ISample + { + public void Run() + { + var src1 = new Mat(FilePath.Image.Match1, ImreadModes.Color); + var src2 = new Mat(FilePath.Image.Match2, ImreadModes.Color); + + MatchBySift(src1, src2); + MatchBySurf(src1, src2); + } + + private void MatchBySift(Mat src1, Mat src2) + { + var gray1 = new Mat(); + var gray2 = new Mat(); + + Cv2.CvtColor(src1, gray1, ColorConversionCodes.BGR2GRAY); + Cv2.CvtColor(src2, gray2, ColorConversionCodes.BGR2GRAY); + + var sift = SIFT.Create(); + + // Detect the keypoints and generate their descriptors using SIFT + KeyPoint[] keypoints1, keypoints2; + var descriptors1 = new MatOfFloat(); + var descriptors2 = new MatOfFloat(); + sift.Compute(gray1, null, out keypoints1, descriptors1); + sift.Compute(gray2, null, out keypoints2, descriptors2); + + // Match descriptor vectors + var bfMatcher = new BFMatcher(NormTypes.L2, false); + var flannMatcher = new FlannBasedMatcher(); + DMatch[] bfMatches = bfMatcher.Match(descriptors1, descriptors2); + DMatch[] flannMatches = flannMatcher.Match(descriptors1, descriptors2); + + // Draw matches + var bfView = new Mat(); + Cv2.DrawMatches(gray1, keypoints1, gray2, keypoints2, bfMatches, bfView); + var flannView = new Mat(); + Cv2.DrawMatches(gray1, keypoints1, gray2, keypoints2, flannMatches, flannView); + + using (new Window("SIFT matching (by BFMather)", WindowMode.AutoSize, bfView)) + using (new Window("SIFT matching (by FlannBasedMatcher)", WindowMode.AutoSize, flannView)) + { + Cv2.WaitKey(); + } + } + + private void MatchBySurf(Mat src1, Mat src2) + { + var gray1 = new Mat(); + var gray2 = new Mat(); + + Cv2.CvtColor(src1, gray1, ColorConversionCodes.BGR2GRAY); + Cv2.CvtColor(src2, gray2, ColorConversionCodes.BGR2GRAY); + + var surf = SURF.Create(500, 4, 2, true); + + // Detect the keypoints and generate their descriptors using SURF + KeyPoint[] keypoints1, keypoints2; + var descriptors1 = new MatOfFloat(); + var descriptors2 = new MatOfFloat(); + surf.Compute(gray1, null, out keypoints1, descriptors1); + surf.Compute(gray2, null, out keypoints2, descriptors2); + + // Match descriptor vectors + var bfMatcher = new BFMatcher(NormTypes.L2, false); + var flannMatcher = new FlannBasedMatcher(); + DMatch[] bfMatches = bfMatcher.Match(descriptors1, descriptors2); + DMatch[] flannMatches = flannMatcher.Match(descriptors1, descriptors2); + + // Draw matches + var bfView = new Mat(); + Cv2.DrawMatches(gray1, keypoints1, gray2, keypoints2, bfMatches, bfView); + var flannView = new Mat(); + Cv2.DrawMatches(gray1, keypoints1, gray2, keypoints2, flannMatches, flannView); + + using (new Window("SURF matching (by BFMather)", WindowMode.AutoSize, bfView)) + using (new Window("SURF matching (by FlannBasedMatcher)", WindowMode.AutoSize, flannView)) + { + Cv2.WaitKey(); + } + } + + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/SolveEquation.cs b/sample/SamplesCS/Samples/SolveEquation.cs new file mode 100644 index 000000000..3dbcb0b19 --- /dev/null +++ b/sample/SamplesCS/Samples/SolveEquation.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using OpenCvSharp; + +namespace SamplesCS +{ + /// + /// + /// + class SolveEquation : ISample + { + public void Run() + { + ByMat(); + ByNormalArray(); + + Console.Read(); + } + + /// + /// Solve equation AX = Y + /// + private void ByMat() + { + // x + y = 10 + // 2x + 3y = 26 + // (x=4, y=6) + + double[,] av = {{1, 1}, + {2, 3}}; + double[] yv = {10, 26}; + + Mat a = new Mat(2, 2, MatType.CV_64FC1, av); + Mat y = new Mat(2, 1, MatType.CV_64FC1, yv); + Mat x = new Mat(); + + Cv2.Solve(a, y, x, DecompTypes.LU); + + Console.WriteLine("ByMat:"); + Console.WriteLine("X1 = {0}, X2 = {1}", x.At(0), x.At(1)); + } + + /// + /// Solve equation AX = Y + /// + private void ByNormalArray() + { + // x + y = 10 + // 2x + 3y = 26 + // (x=4, y=6) + + double[,] a = {{1, 1}, + {2, 3}}; + + double[] y = { 10, 26 }; + + List x = new List(); + + Cv2.Solve( + InputArray.Create(a), InputArray.Create(y), + OutputArray.Create(x), + DecompTypes.LU); + + Console.WriteLine("ByNormalArray:"); + Console.WriteLine("X1 = {0}, X2 = {1}", x[0], x[1]); + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/StarDetectorSample.cs b/sample/SamplesCS/Samples/StarDetectorSample.cs new file mode 100644 index 000000000..68861c88c --- /dev/null +++ b/sample/SamplesCS/Samples/StarDetectorSample.cs @@ -0,0 +1,44 @@ +using OpenCvSharp; +using OpenCvSharp.XFeatures2D; +using SampleBase; + +namespace SamplesCS +{ + /// + /// Retrieves keypoints using the StarDetector algorithm. + /// + class StarDetectorSample : ISample + { + public void Run() + { + var dst = new Mat(FilePath.Image.Lenna, ImreadModes.Color); + var gray = new Mat(FilePath.Image.Lenna, ImreadModes.GrayScale); + + StarDetector detector = StarDetector.Create(45); + KeyPoint[] keypoints = detector.Detect(gray); + + if (keypoints != null) + { + var color = new Scalar(0, 255, 0); + foreach (KeyPoint kpt in keypoints) + { + float r = kpt.Size / 2; + Cv2.Circle(dst, kpt.Pt, (int)r, color); + Cv2.Line(dst, + new Point2f(kpt.Pt.X + r, kpt.Pt.Y + r), + new Point2f(kpt.Pt.X - r, kpt.Pt.Y - r), + color); + Cv2.Line(dst, + new Point2f(kpt.Pt.X - r, kpt.Pt.Y + r), + new Point2f(kpt.Pt.X + r, kpt.Pt.Y - r), + color); + } + } + + using (new Window("StarDetector features", dst)) + { + Cv2.WaitKey(); + } + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/Stitching.cs b/sample/SamplesCS/Samples/Stitching.cs new file mode 100644 index 000000000..ffd953431 --- /dev/null +++ b/sample/SamplesCS/Samples/Stitching.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp; + +namespace SamplesCS +{ + class Stitching : ISample + { + private static Mat[] SelectStitchingImages(int width, int height, int count) + { + Mat source = new Mat(@"Data\Image\lenna.png", ImreadModes.Color); + Mat result = source.Clone(); + + var rand = new Random(); + var mats = new List(); + for (int i = 0; i < count; i++) + { + int x1 = rand.Next(source.Cols - width); + int y1 = rand.Next(source.Rows - height); + int x2 = x1 + width; + int y2 = y1 + height; + + result.Line(new Point(x1, y1), new Point(x1, y2), new Scalar(0, 0, 255)); + result.Line(new Point(x1, y2), new Point(x2, y2), new Scalar(0, 0, 255)); + result.Line(new Point(x2, y2), new Point(x2, y1), new Scalar(0, 0, 255)); + result.Line(new Point(x2, y1), new Point(x1, y1), new Scalar(0, 0, 255)); + + Mat m = source[new Rect(x1, y1, width, height)]; + mats.Add(m.Clone()); + } + + using (new Window(result)) + { + Cv2.WaitKey(); + } + + return mats.ToArray(); + } + + public void Run() + { + Mat[] images = SelectStitchingImages(200, 200, 10); + + var stitcher = Stitcher.Create(false); + + Mat pano = new Mat(); + + Console.Write("Stitching start..."); + // TODO: does not work?? + var status = stitcher.Stitch(images, pano); + Console.WriteLine(" finish (status:{0})", status); + + Window.ShowImages(pano); + + foreach (Mat image in images) + { + image.Dispose(); + } + } + } +} diff --git a/sample/SamplesCS/Samples/Subdiv2DSample.cs b/sample/SamplesCS/Samples/Subdiv2DSample.cs new file mode 100644 index 000000000..3af7f761b --- /dev/null +++ b/sample/SamplesCS/Samples/Subdiv2DSample.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using OpenCvSharp; + +namespace SamplesCS +{ + /// + /// cv::Subdiv2D test + /// + class Subdiv2DSample : ISample + { + public void Run() + { + const int Size = 600; + + // Creates random point list + var rand = new Random(); + var points = Enumerable.Range(0, 100).Select(_ => + new Point2f(rand.Next(0, Size), rand.Next(0, Size))).ToArray(); + + Mat img = Mat.Zeros(Size, Size, MatType.CV_8UC3); + foreach (var p in points) + { + img.Circle(p, 4, Scalar.Red, -1); + } + + // Initializes Subdiv2D + var subdiv = new Subdiv2D(); + subdiv.InitDelaunay(new Rect(0, 0, Size, Size)); + subdiv.Insert(points); + + // Draws voronoi diagram + Point2f[][] facetList; + Point2f[] facetCenters; + subdiv.GetVoronoiFacetList(null, out facetList, out facetCenters); + + var vonoroi = img.Clone(); + foreach (var list in facetList) + { + var before = list.Last(); + foreach (var p in list) + { + vonoroi.Line(before, p, new Scalar(64, 255, 128), 1); + before = p; + } + } + + // Draws delaunay diagram + Vec4f[] edgeList = subdiv.GetEdgeList(); + var delaunay = img.Clone(); + foreach (var edge in edgeList) + { + var p1 = new Point(edge.Item0, edge.Item1); + var p2 = new Point(edge.Item2, edge.Item3); + delaunay.Line(p1, p2, new Scalar(64, 255, 128), 1); + } + + Cv2.ImShow("voronoi", vonoroi); + Cv2.ImShow("delaunay", delaunay); + Cv2.WaitKey(); + Cv2.DestroyAllWindows(); + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/SuperResolutionSample.cs b/sample/SamplesCS/Samples/SuperResolutionSample.cs new file mode 100644 index 000000000..82938ec74 --- /dev/null +++ b/sample/SamplesCS/Samples/SuperResolutionSample.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using OpenCvSharp; + +namespace SamplesCS +{ + /// + /// + /// + class SuperResolutionSample : ISample + { + public void Run() + { + var capture = new VideoCapture(); + capture.Set(CaptureProperty.FrameWidth, 640); + capture.Set(CaptureProperty.FrameHeight, 480); + capture.Open(-1); + if (!capture.IsOpened()) + throw new Exception("capture initialization failed"); + + var fs = FrameSource.CreateCameraSource(-1); + var sr = SuperResolution.CreateBTVL1(); + sr.SetInput(fs); + + using (var normalWindow = new Window("normal")) + using (var srWindow = new Window("super resolution")) + { + var normalFrame = new Mat(); + var srFrame = new Mat(); + while (true) + { + capture.Read(normalFrame); + sr.NextFrame(srFrame); + if (normalFrame.Empty() || srFrame.Empty()) + break; + normalWindow.ShowImage(normalFrame); + srWindow.ShowImage(srFrame); + Cv2.WaitKey(100); + } + } + } + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/VideoCaptureSample.cs b/sample/SamplesCS/Samples/VideoCaptureSample.cs new file mode 100644 index 000000000..5107f4ff1 --- /dev/null +++ b/sample/SamplesCS/Samples/VideoCaptureSample.cs @@ -0,0 +1,39 @@ +using System; +using System.Runtime.InteropServices; +using OpenCvSharp; +using SampleBase; + +namespace SamplesCS +{ + /// + /// + /// + class VideoCaptureSample : ISample + { + public void Run() + { + // Opens MP4 file (ffmpeg is probably needed) + var capture = new VideoCapture(FilePath.Movie.Bach); + + int sleepTime = (int)Math.Round(1000 / capture.Fps); + + using (var window = new Window("capture")) + { + // Frame image buffer + Mat image = new Mat(); + + // When the movie playback reaches end, Mat.data becomes NULL. + while (true) + { + capture.Read(image); // same as cvQueryFrame + if(image.Empty()) + break; + + window.ShowImage(image); + Cv2.WaitKey(sleepTime); + } + } + } + + } +} \ No newline at end of file diff --git a/sample/SamplesCS/Samples/VideoWriterSample.cs b/sample/SamplesCS/Samples/VideoWriterSample.cs new file mode 100644 index 000000000..3d6c0d0c4 --- /dev/null +++ b/sample/SamplesCS/Samples/VideoWriterSample.cs @@ -0,0 +1,68 @@ +using System; +using OpenCvSharp; +using SampleBase; + +namespace SamplesCS +{ + /// + /// + /// + class VideoWriterSample : ISample + { + public void Run() + { + const string OutVideoFile = "out.avi"; + + // Opens MP4 file (ffmpeg is probably needed) + VideoCapture capture = new VideoCapture(FilePath.Movie.Bach); + + // Read movie frames and write them to VideoWriter + Size dsize = new Size(640, 480); + using (VideoWriter writer = new VideoWriter(OutVideoFile, -1, capture.Fps, dsize)) + { + Console.WriteLine("Converting each movie frames..."); + Mat frame = new Mat(); + while(true) + { + // Read image + capture.Read(frame); + if(frame.Empty()) + break; + + Console.CursorLeft = 0; + Console.Write("{0} / {1}", capture.PosFrames, capture.FrameCount); + + // grayscale -> canny -> resize + Mat gray = new Mat(); + Mat canny = new Mat(); + Mat dst = new Mat(); + Cv2.CvtColor(frame, gray, ColorConversionCodes.BGR2GRAY); + Cv2.Canny(gray, canny, 100, 180); + Cv2.Resize(canny, dst, dsize, 0, 0, InterpolationFlags.Linear); + // Write mat to VideoWriter + writer.Write(dst); + } + Console.WriteLine(); + } + + // Watch result movie + using (VideoCapture capture2 = new VideoCapture(OutVideoFile)) + using (Window window = new Window("result")) + { + int sleepTime = (int)(1000 / capture.Fps); + + Mat frame = new Mat(); + while (true) + { + capture2.Read(frame); + if(frame.Empty()) + break; + + window.ShowImage(frame); + Cv2.WaitKey(sleepTime); + } + } + } + + } +} \ No newline at end of file diff --git a/sample/SamplesCS/SamplesCS.csproj b/sample/SamplesCS/SamplesCS.csproj new file mode 100644 index 000000000..c386ddfe4 --- /dev/null +++ b/sample/SamplesCS/SamplesCS.csproj @@ -0,0 +1,183 @@ + + + + + + Debug + AnyCPU + {E4666B99-145A-436D-9540-2E4593A061A6} + Exe + Properties + SamplesCS + SamplesCS + v4.5.2 + 512 + ..\ + true + + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + false + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + false + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + MinimumRecommendedRules.ruleset + true + false + + + bin\x86\Release\ + TRACE + false + full + x86 + prompt + MinimumRecommendedRules.ruleset + true + false + true + + + true + bin\x64\Debug\ + DEBUG;TRACE + true + full + x64 + prompt + MinimumRecommendedRules.ruleset + false + + + bin\x64\Release\ + TRACE + true + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + false + + + + ..\packages\OpenCvSharp3-AnyCPU.3.1.0.20160622\lib\net45\OpenCvSharp.dll + True + + + ..\packages\OpenCvSharp3-AnyCPU.3.1.0.20160622\lib\net45\OpenCvSharp.Blob.dll + True + + + ..\packages\OpenCvSharp3-AnyCPU.3.1.0.20160622\lib\net45\OpenCvSharp.Extensions.dll + True + + + ..\packages\OpenCvSharp3-AnyCPU.3.1.0.20160622\lib\net45\OpenCvSharp.UserInterface.dll + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {2d245c04-0f27-458a-a185-16242a3f918c} + SampleBase + + + + + + + + + + + このプロジェクトは、このコンピューターにはない NuGet パッケージを参照しています。これらをダウンロードするには、NuGet パッケージの復元を有効にしてください。詳細については、http://go.microsoft.com/fwlink/?LinkID=322105 を参照してください。不足しているファイルは {0} です。 + + + + + + \ No newline at end of file diff --git a/sample/SamplesCS/app.config b/sample/SamplesCS/app.config new file mode 100644 index 000000000..ff9950103 --- /dev/null +++ b/sample/SamplesCS/app.config @@ -0,0 +1,3 @@ + + + diff --git a/sample/SamplesCS/packages.config b/sample/SamplesCS/packages.config new file mode 100644 index 000000000..0101987de --- /dev/null +++ b/sample/SamplesCS/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/sample/SamplesVB/My Project/Application.Designer.vb b/sample/SamplesVB/My Project/Application.Designer.vb new file mode 100644 index 000000000..8effad9c4 --- /dev/null +++ b/sample/SamplesVB/My Project/Application.Designer.vb @@ -0,0 +1,13 @@ +'------------------------------------------------------------------------------ +' +' このコードはツールによって生成されました。 +' ランタイム バージョン:4.0.30319.42000 +' +' このファイルへの変更は、以下の状況下で不正な動作の原因になったり、 +' コードが再生成されるときに損失したりします。 +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + diff --git a/sample/SamplesVB/My Project/Application.myapp b/sample/SamplesVB/My Project/Application.myapp new file mode 100644 index 000000000..e62f1a533 --- /dev/null +++ b/sample/SamplesVB/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + false + false + 0 + true + 0 + 2 + true + diff --git a/sample/SamplesVB/My Project/AssemblyInfo.vb b/sample/SamplesVB/My Project/AssemblyInfo.vb new file mode 100644 index 000000000..e01d1938f --- /dev/null +++ b/sample/SamplesVB/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 +' アセンブリに関連付けられている情報を変更するには、 +' これらの属性値を変更してください。 + +' アセンブリ属性の値を確認します。 + + + + + + + + + + +'このプロジェクトが COM に公開される場合、次の GUID がタイプ ライブラリの ID になります。 + + +' アセンブリのバージョン情報は、以下の 4 つの値で構成されています: +' +' Major Version +' Minor Version +' Build Number +' Revision +' +' すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を +' 既定値にすることができます: +' + + + diff --git a/sample/SamplesVB/My Project/Resources.Designer.vb b/sample/SamplesVB/My Project/Resources.Designer.vb new file mode 100644 index 000000000..ff4296e87 --- /dev/null +++ b/sample/SamplesVB/My Project/Resources.Designer.vb @@ -0,0 +1,63 @@ +'------------------------------------------------------------------------------ +' +' このコードはツールによって生成されました。 +' ランタイム バージョン:4.0.30319.42000 +' +' このファイルへの変更は、以下の状況下で不正な動作の原因になったり、 +' コードが再生成されるときに損失したりします。 +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Imports System + +Namespace My.Resources + + 'このクラスは StronglyTypedResourceBuilder クラスが ResGen + 'または Visual Studio のようなツールを使用して自動生成されました。 + 'メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に + 'ResGen を実行し直すか、または VS プロジェクトをビルドし直します。 + ''' + ''' ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。 + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' このクラスで使用されているキャッシュされた ResourceManager インスタンスを返します。 + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("SamplesVB.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' 厳密に型指定されたこのリソース クラスを使用して、すべての検索リソースに対し、 + ''' 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。 + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/sample/SamplesVB/My Project/Resources.resx b/sample/SamplesVB/My Project/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/sample/SamplesVB/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/sample/SamplesVB/My Project/Settings.Designer.vb b/sample/SamplesVB/My Project/Settings.Designer.vb new file mode 100644 index 000000000..b6cb3e4f2 --- /dev/null +++ b/sample/SamplesVB/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' このコードはツールによって生成されました。 +' ランタイム バージョン:4.0.30319.42000 +' +' このファイルへの変更は、以下の状況下で不正な動作の原因になったり、 +' コードが再生成されるときに損失したりします。 +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) + +#Region "My.Settings 自動保存機能" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.SamplesVB.My.MySettings + Get + Return Global.SamplesVB.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/sample/SamplesVB/My Project/Settings.settings b/sample/SamplesVB/My Project/Settings.settings new file mode 100644 index 000000000..85b890b3c --- /dev/null +++ b/sample/SamplesVB/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/sample/SamplesVB/Program.vb b/sample/SamplesVB/Program.vb new file mode 100644 index 000000000..dd9542cdb --- /dev/null +++ b/sample/SamplesVB/Program.vb @@ -0,0 +1,20 @@ +Imports System +Imports System.Collections.Generic +Imports System.Diagnostics +Imports System.Linq +Imports System.Runtime.InteropServices +Imports System.Text + +Imports OpenCvSharp + +Friend NotInheritable Class Program + + Shared Sub Main() + FASTSample.Start() + FlannSample.Start() + HOGSample.Start() + HoughLinesSample.Start() + StarDetectorSample.Start() + End Sub + +End Class diff --git a/sample/SamplesVB/Samples/FASTSample.vb b/sample/SamplesVB/Samples/FASTSample.vb new file mode 100644 index 000000000..b1484adbd --- /dev/null +++ b/sample/SamplesVB/Samples/FASTSample.vb @@ -0,0 +1,30 @@ +Imports System +Imports System.Collections.Generic +Imports System.Linq +Imports System.Text +Imports OpenCvSharp +Imports SampleBase + +''' +''' cv::FAST +''' +Friend Module FASTSample + Public Sub Start() + Using imgSrc As New Mat(FilePath.Image.Lenna, ImreadModes.Color), _ + imgGray As New Mat(imgSrc.Size, MatType.CV_8UC1), _ + imgDst As Mat = imgSrc.Clone() + Cv2.CvtColor(imgSrc, imgGray, ColorConversionCodes.BGR2GRAY, 0) + + Dim keypoints() = Cv2.FAST(imgGray, 50, True) + + For Each kp As KeyPoint In keypoints + imgDst.Circle(kp.Pt, 3, Scalar.Red, -1, LineTypes.AntiAlias, 0) + Next kp + + Cv2.ImShow("FAST", imgDst) + Cv2.WaitKey(0) + Cv2.DestroyAllWindows() + End Using + End Sub +End Module +' End Namespace diff --git a/sample/SamplesVB/Samples/FlannSample.vb b/sample/SamplesVB/Samples/FlannSample.vb new file mode 100644 index 000000000..dca9256f9 --- /dev/null +++ b/sample/SamplesVB/Samples/FlannSample.vb @@ -0,0 +1,53 @@ +Imports System +Imports System.Collections.Generic +Imports System.Linq +Imports System.Text +Imports OpenCvSharp + +' Namespace OpenCvSharpSamplesVB +''' +''' cv::flann +''' +Friend Module FlannSample + Public Sub Start() + Console.WriteLine(Environment.NewLine & String.Format(("===== FlannTest ====="))) + + ' creates data set + Using features As New Mat(10000, 2, MatType.CV_32FC1) + Dim rand As New Random() + For i As Integer = 0 To features.Rows - 1 + features.Set(Of Single)(i, 0, rand.Next(10000)) + features.Set(Of Single)(i, 1, rand.Next(10000)) + Next i + + ' query + Dim queryPoint As New Point2f(7777, 7777) + Dim queries As New Mat(1, 2, MatType.CV_32FC1) + queries.Set(Of Single)(0, 0, queryPoint.X) + queries.Set(Of Single)(0, 1, queryPoint.Y) + Console.WriteLine(Environment.NewLine & String.Format("query:({0}, {1})", queryPoint.X, queryPoint.Y)) + Console.WriteLine(Environment.NewLine & String.Format("-----")) + + ' knnSearch + Using nnIndex As New Flann.Index(features, New Flann.KDTreeIndexParams(4)) + Dim knn As Integer = 1 + Dim indices() As Integer + Dim dists() As Single + nnIndex.KnnSearch(queries, indices, dists, knn, New Flann.SearchParams(32)) + + For i As Integer = 0 To knn - 1 + Dim index As Integer = indices(i) + Dim dist As Single = dists(i) + Dim pt As New Point2f(features.Get(Of Single)(index, 0), features.Get(Of Single)(index, 1)) + Console.WriteLine(Environment.NewLine & String.Format("No.{0}" & vbTab, i)) + Console.WriteLine(Environment.NewLine & String.Format("index:{0}", index)) + Console.WriteLine(Environment.NewLine & String.Format(" distance:{0}", dist)) + Console.WriteLine(Environment.NewLine & String.Format(" data:({0}, {1})", pt.X, pt.Y)) + Console.WriteLine(Environment.NewLine & " ") + Next i + 'Console.Read() + End Using + End Using + End Sub +End Module +' End Namespace diff --git a/sample/SamplesVB/Samples/HOGSample.vb b/sample/SamplesVB/Samples/HOGSample.vb new file mode 100644 index 000000000..f29df9c61 --- /dev/null +++ b/sample/SamplesVB/Samples/HOGSample.vb @@ -0,0 +1,53 @@ +Imports System +Imports System.Collections.Generic +Imports System.Diagnostics +Imports System.Linq +Imports System.Text +Imports OpenCvSharp +Imports SampleBase +'using GPU = OpenCvSharp.Gpu; + +' Namespace OpenCvSharpSamplesVB +''' +''' samples/c/peopledetect.c +''' +Friend Module HOGSample + Public Sub Start() + Dim img As Mat = Cv2.ImRead(FilePath.Image.Asahiyama, ImreadModes.Color) + + Dim hog As New HOGDescriptor() + hog.SetSVMDetector(HOGDescriptor.GetDefaultPeopleDetector()) + + Dim b As Boolean = hog.CheckDetectorSize() + b.ToString() + + Dim watch As Stopwatch = Stopwatch.StartNew() + + ' run the detector with default parameters. to get a higher hit-rate + ' (and more false alarms, respectively), decrease the hitThreshold and + ' groupThreshold (set groupThreshold to 0 to turn off the grouping completely). + Dim found() As Rect = hog.DetectMultiScale(img, 0, New Size(8, 8), New Size(24, 16), 1.05, 2) + + watch.Stop() + Console.WriteLine(Environment.NewLine & String.Format("Detection time = {0}ms", watch.ElapsedMilliseconds)) + Console.WriteLine(Environment.NewLine & String.Format("{0} region(s) found", found.Length)) + + For Each rect As Rect In found + ' the HOG detector returns slightly larger rectangles than the real objects. + ' so we slightly shrink the rectangles to get a nicer output. + Dim r As Rect = New Rect With { + .X = rect.X + CInt(Math.Truncate(Math.Round(rect.Width * 0.1))), + .Y = rect.Y + CInt(Math.Truncate(Math.Round(rect.Height * 0.1))), + .Width = CInt(Math.Truncate(Math.Round(rect.Width * 0.8))), + .Height = CInt(Math.Truncate(Math.Round(rect.Height * 0.8))) + } + img.Rectangle(r.TopLeft, r.BottomRight, Scalar.Red, 3, LineTypes.Link8, 0) + Next rect + + Using window As New Window("people detector", WindowMode.Normal, img) + window.SetProperty(WindowProperty.Fullscreen, 1) + Cv2.WaitKey(0) + End Using + End Sub +End Module +' End Namespace diff --git a/sample/SamplesVB/Samples/HoughLinesSample.vb b/sample/SamplesVB/Samples/HoughLinesSample.vb new file mode 100644 index 000000000..0c982bedf --- /dev/null +++ b/sample/SamplesVB/Samples/HoughLinesSample.vb @@ -0,0 +1,57 @@ +Imports System +Imports System.Collections.Generic +Imports System.Linq +Imports System.Runtime.InteropServices +Imports System.Text +Imports OpenCvSharp + +' Namespace OpenCvSharpSamplesVB +Imports SampleBase + +''' +''' ハフ変換による直線検出 +''' +''' http://opencv.jp/sample/special_transforms.html#hough_line +Friend Module HoughLinesSample + Public Sub Start() + + ' (1)画像の読み込み + Using imgGray As New Mat(FilePath.Image.Goryokaku, ImreadModes.GrayScale), _ + imgStd As New Mat(FilePath.Image.Goryokaku, ImreadModes.Color), _ + imgProb As Mat = imgStd.Clone() + ' Preprocess + Cv2.Canny(imgGray, imgGray, 50, 200, 3, False) + + ' (3)標準的ハフ変換による線の検出と検出した線の描画 + Dim segStd() As LineSegmentPolar = Cv2.HoughLines(imgGray, 1, Math.PI / 180, 50, 0, 0) + Dim limit As Integer = Math.Min(segStd.Length, 10) + For i As Integer = 0 To limit - 1 + Dim rho As Single = segStd(i).Rho + Dim theta As Single = segStd(i).Theta + + Dim a As Double = Math.Cos(theta) + Dim b As Double = Math.Sin(theta) + Dim x0 As Double = a * rho + Dim y0 As Double = b * rho + Dim pt1 As Point = New Point With {.X = Math.Round(x0 + 1000 * (-b)), .Y = Math.Round(y0 + 1000 * (a))} + Dim pt2 As Point = New Point With {.X = Math.Round(x0 - 1000 * (-b)), .Y = Math.Round(y0 - 1000 * (a))} + imgStd.Line(pt1, pt2, New Scalar(0, 0, 255), 3, LineTypes.AntiAlias, 0) + Next i + + ' (4)確率的ハフ変換による線分の検出と検出した線分の描画 + Dim segProb() As LineSegmentPoint = Cv2.HoughLinesP(imgGray, 1, Math.PI / 180, 50, 50, 10) + For Each s As LineSegmentPoint In segProb + imgProb.Line(s.P1, s.P2, New Scalar(0, 0, 255), 3, LineTypes.AntiAlias, 0) + Next s + + + ' (5)検出結果表示用のウィンドウを確保し表示する + Using TempCvWindow As Window = New Window("Hough_line_standard", WindowMode.AutoSize, imgStd), _ + TempCvWindowProb As Window = New Window("Hough_line_probabilistic", WindowMode.AutoSize, imgProb) + Window.WaitKey(0) + End Using + End Using + End Sub + +End Module +' End Namespace diff --git a/sample/SamplesVB/Samples/StarDetectorSample.vb b/sample/SamplesVB/Samples/StarDetectorSample.vb new file mode 100644 index 000000000..34525d60e --- /dev/null +++ b/sample/SamplesVB/Samples/StarDetectorSample.vb @@ -0,0 +1,49 @@ +Imports System +Imports OpenCvSharp + +' Namespace OpenCvSharpSamplesVB +Imports SampleBase + +''' +''' Retrieves keypoints using the StarDetector algorithm. +''' +Friend Module StarDetectorSample + Public Sub Start() + Using src As New Mat(FilePath.Image.Lenna, ImreadModes.GrayScale), + dst As New Mat() + Cv2.CvtColor(src, dst, ColorConversionCodes.GRAY2BGR) + + CppStyleStarDetector(src, dst) ' C++-style + + Using w1 As New Window("img", src), + w2 As New Window("features", dst) + Cv2.WaitKey() + End Using + End Using + End Sub + + ''' + ''' Extracts keypoints by C++-style code (cv::StarDetector) + ''' + ''' + ''' + Private Sub CppStyleStarDetector(ByVal src As Mat, ByVal dst As Mat) + Dim detector As OpenCvSharp.XFeatures2D.StarDetector = OpenCvSharp.XFeatures2D.StarDetector.Create() + Dim keypoints() As KeyPoint + Dim descriptors As Mat + detector.Compute(src, keypoints, descriptors) + + If keypoints IsNot Nothing Then + For Each kpt As KeyPoint In keypoints + Dim r As Single = kpt.Size / 2 + Dim a = kpt.Pt + + Cv2.Circle(dst, kpt.Pt, CInt(Math.Truncate(r)), New Scalar(0, 255, 0), 1, LineTypes.Link8, 0) + Cv2.Line(dst, New Point(kpt.Pt.X + r, kpt.Pt.Y + r), New Point(kpt.Pt.X - r, kpt.Pt.Y - r), New Scalar(0, 255, 0), 1, LineTypes.Link8, 0) + Cv2.Line(dst, New Point(kpt.Pt.X - r, kpt.Pt.Y + r), New Point(kpt.Pt.X + r, kpt.Pt.Y - r), New Scalar(0, 255, 0), 1, LineTypes.Link8, 0) + Next kpt + End If + + End Sub +End Module +' End Namespace diff --git a/sample/SamplesVB/SamplesVB.vbproj b/sample/SamplesVB/SamplesVB.vbproj new file mode 100644 index 000000000..507c3327f --- /dev/null +++ b/sample/SamplesVB/SamplesVB.vbproj @@ -0,0 +1,245 @@ + + + + + + Debug + AnyCPU + {4A14A20D-8E2A-4559-A038-F0204A22C283} + Exe + SamplesVB.Program + SamplesVB + SamplesVB + 512 + Console + v4.5.2 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + ..\ + true + + + + + + AnyCPU + true + full + true + true + bin\Debug\ + SamplesVB.xml + 41999,42016,42017,42018,42019,42020,42021,42022,42030,42032,42036,42104,42108,42109 + false + + + AnyCPU + pdbonly + false + true + true + bin\Release\ + SamplesVB.xml + 41999,42016,42017,42018,42019,42020,42021,42022,42030,42032,42036,42104,42108,42109 + false + + + On + + + Binary + + + Off + + + On + + + true + true + true + bin\x86\Debug\ + SamplesVB.xml + 41999,42016,42017,42018,42019,42020,42021,42022,42030,42032,42036,42104,42108,42109 + full + x86 + MinimumRecommendedRules.ruleset + false + + + true + bin\x86\Release\ + SamplesVB.xml + true + 41999,42016,42017,42018,42019,42020,42021,42022,42030,42032,42036,42104,42108,42109 + pdbonly + x86 + MinimumRecommendedRules.ruleset + false + + + true + true + true + bin\x64\Debug\ + SamplesVB.xml + 41999,42016,42017,42018,42019,42020,42021,42022,42030,42032,42036,42104,42108,42109 + full + x64 + MinimumRecommendedRules.ruleset + false + + + true + bin\x64\Release\ + SamplesVB.xml + true + 41999,42016,42017,42018,42019,42020,42021,42022,42030,42032,42036,42104,42108,42109 + pdbonly + x64 + MinimumRecommendedRules.ruleset + false + + + + ..\packages\OpenCvSharp3-AnyCPU.3.1.0.20160622\lib\net45\OpenCvSharp.dll + True + + + ..\packages\OpenCvSharp3-AnyCPU.3.1.0.20160622\lib\net45\OpenCvSharp.Blob.dll + True + + + ..\packages\OpenCvSharp3-AnyCPU.3.1.0.20160622\lib\net45\OpenCvSharp.Extensions.dll + True + + + ..\packages\OpenCvSharp3-AnyCPU.3.1.0.20160622\lib\net45\OpenCvSharp.UserInterface.dll + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + + + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + False + Microsoft .NET Framework 4 %28x86 および x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows インストーラー 4.5 + + true + + + + + {2d245c04-0f27-458a-a185-16242a3f918c} + SampleBase + + + + + + + このプロジェクトは、このコンピューターにはない NuGet パッケージを参照しています。これらをダウンロードするには、NuGet パッケージの復元を有効にしてください。詳細については、http://go.microsoft.com/fwlink/?LinkID=322105 を参照してください。不足しているファイルは {0} です。 + + + + + + \ No newline at end of file diff --git a/sample/SamplesVB/app.config b/sample/SamplesVB/app.config new file mode 100644 index 000000000..b975b1a0e --- /dev/null +++ b/sample/SamplesVB/app.config @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample/SamplesVB/packages.config b/sample/SamplesVB/packages.config new file mode 100644 index 000000000..0101987de --- /dev/null +++ b/sample/SamplesVB/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/.nuget/packages.config b/src/.nuget/packages.config new file mode 100644 index 000000000..6b8deb9c9 --- /dev/null +++ b/src/.nuget/packages.config @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 000000000..82da00e02 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.4) + +project(OpenCvSharpExtern) + +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") + +add_subdirectory(OpenCvSharpExtern) diff --git a/src/OpenCvSharp 3.x.sln b/src/OpenCvSharp 3.x.sln new file mode 100644 index 000000000..fe65e6bda --- /dev/null +++ b/src/OpenCvSharp 3.x.sln @@ -0,0 +1,394 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.24720.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenCvSharp.UserInterface", "OpenCvSharp.UserInterface\OpenCvSharp.UserInterface.csproj", "{DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenCvSharp.Extensions", "OpenCvSharp.Extensions\OpenCvSharp.Extensions.csproj", "{F1110C7B-46B1-4504-871E-135B57F9DE67}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenCvSharp.Blob", "OpenCvSharp.Blob\OpenCvSharp.Blob.csproj", "{383AE960-7F56-47A4-BFF2-B2B81B6A49B5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenCvSharp", "OpenCvSharp\OpenCvSharp.csproj", "{524CC7B4-75B9-4925-9DA4-3DACD40F4814}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenCvSharp.ReleaseMaker", "OpenCvSharp.ReleaseMaker\OpenCvSharp.ReleaseMaker.csproj", "{E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenCvSharpExtern", "OpenCvSharpExtern\OpenCvSharpExtern.vcxproj", "{8E7279F8-F801-4672-B42F-1ED2C68B16A4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenCvSharp.NUnitTest", "OpenCvSharp.NUnitTest\OpenCvSharp.NUnitTest.csproj", "{76A4E76B-0A98-411D-92E9-5527B31EBA3C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenCvSharp.Sandbox", "OpenCvSharp.Sandbox\OpenCvSharp.Sandbox.csproj", "{C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenCvSharp.SandboxCpp", "OpenCvSharp.SandboxCpp\OpenCvSharp.SandboxCpp.vcxproj", "{8516D7EB-E716-4BC1-92DB-751E6BF13AE1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenCvSharp.DebuggerVisualizers2012", "OpenCvSharp.DebuggerVisualizers2012\OpenCvSharp.DebuggerVisualizers2012.csproj", "{AA55EAAD-B9D6-4516-8E29-2039DAABC668}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenCvSharp.DebuggerVisualizers2013", "OpenCvSharp.DebuggerVisualizers2013\OpenCvSharp.DebuggerVisualizers2013.csproj", "{C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenCvSharp.DebuggerVisualizers2010", "OpenCvSharp.DebuggerVisualizers2010\OpenCvSharp.DebuggerVisualizers2010.csproj", "{B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenCvSharp.DebuggerVisualizers2015", "OpenCvSharp.DebuggerVisualizers2015\OpenCvSharp.DebuggerVisualizers2015.csproj", "{63E48A18-8194-40EF-8BB1-4681EA2C5C01}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + Release-JP|Any CPU = Release-JP|Any CPU + Release-JP|Win32 = Release-JP|Win32 + Release-JP|x64 = Release-JP|x64 + Release-JP|x86 = Release-JP|x86 + Release-Static|Any CPU = Release-Static|Any CPU + Release-Static|Win32 = Release-Static|Win32 + Release-Static|x64 = Release-Static|x64 + Release-Static|x86 = Release-Static|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Debug|Win32.ActiveCfg = Debug|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Debug|x64.ActiveCfg = Debug|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Debug|x64.Build.0 = Debug|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Debug|x86.ActiveCfg = Debug|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Debug|x86.Build.0 = Debug|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Release|Any CPU.Build.0 = Release|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Release|Win32.ActiveCfg = Release|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Release|x64.ActiveCfg = Release|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Release|x64.Build.0 = Release|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Release|x86.ActiveCfg = Release|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Release|x86.Build.0 = Release|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Release-JP|Any CPU.ActiveCfg = Release JP|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Release-JP|Any CPU.Build.0 = Release JP|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Release-JP|Win32.ActiveCfg = Release JP|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Release-JP|x64.ActiveCfg = Release JP|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Release-JP|x64.Build.0 = Release JP|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Release-JP|x86.ActiveCfg = Release JP|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Release-JP|x86.Build.0 = Release JP|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Release-Static|Any CPU.ActiveCfg = Release|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Release-Static|Any CPU.Build.0 = Release|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Release-Static|Win32.ActiveCfg = Release|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Release-Static|x64.ActiveCfg = Release|Any CPU + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F}.Release-Static|x86.ActiveCfg = Release|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Debug|Win32.ActiveCfg = Debug|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Debug|x64.ActiveCfg = Debug|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Debug|x64.Build.0 = Debug|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Debug|x86.ActiveCfg = Debug|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Debug|x86.Build.0 = Debug|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Release|Any CPU.Build.0 = Release|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Release|Win32.ActiveCfg = Release|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Release|x64.ActiveCfg = Release|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Release|x64.Build.0 = Release|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Release|x86.ActiveCfg = Release|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Release|x86.Build.0 = Release|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Release-JP|Any CPU.ActiveCfg = Release JP|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Release-JP|Any CPU.Build.0 = Release JP|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Release-JP|Win32.ActiveCfg = Release JP|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Release-JP|x64.ActiveCfg = Release JP|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Release-JP|x64.Build.0 = Release JP|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Release-JP|x86.ActiveCfg = Release JP|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Release-JP|x86.Build.0 = Release JP|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Release-Static|Any CPU.ActiveCfg = Release|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Release-Static|Any CPU.Build.0 = Release|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Release-Static|Win32.ActiveCfg = Release|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Release-Static|x64.ActiveCfg = Release|Any CPU + {F1110C7B-46B1-4504-871E-135B57F9DE67}.Release-Static|x86.ActiveCfg = Release|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Debug|Win32.ActiveCfg = Debug|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Debug|x64.ActiveCfg = Debug|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Debug|x64.Build.0 = Debug|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Debug|x86.ActiveCfg = Debug|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Debug|x86.Build.0 = Debug|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Release|Any CPU.Build.0 = Release|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Release|Win32.ActiveCfg = Release|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Release|x64.ActiveCfg = Release|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Release|x64.Build.0 = Release|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Release|x86.ActiveCfg = Release|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Release|x86.Build.0 = Release|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Release-JP|Any CPU.ActiveCfg = Release JP|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Release-JP|Any CPU.Build.0 = Release JP|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Release-JP|Win32.ActiveCfg = Release JP|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Release-JP|x64.ActiveCfg = Release JP|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Release-JP|x64.Build.0 = Release JP|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Release-JP|x86.ActiveCfg = Release JP|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Release-JP|x86.Build.0 = Release JP|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Release-Static|Any CPU.ActiveCfg = Release|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Release-Static|Any CPU.Build.0 = Release|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Release-Static|Win32.ActiveCfg = Release|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Release-Static|x64.ActiveCfg = Release|Any CPU + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5}.Release-Static|x86.ActiveCfg = Release|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Debug|Any CPU.Build.0 = Debug|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Debug|Win32.ActiveCfg = Debug|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Debug|x64.ActiveCfg = Debug|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Debug|x64.Build.0 = Debug|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Debug|x86.ActiveCfg = Debug|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Debug|x86.Build.0 = Debug|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Release|Any CPU.ActiveCfg = Release|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Release|Any CPU.Build.0 = Release|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Release|Win32.ActiveCfg = Release|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Release|x64.ActiveCfg = Release|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Release|x64.Build.0 = Release|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Release|x86.ActiveCfg = Release|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Release|x86.Build.0 = Release|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Release-JP|Any CPU.ActiveCfg = Release JP|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Release-JP|Any CPU.Build.0 = Release JP|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Release-JP|Win32.ActiveCfg = Release JP|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Release-JP|x64.ActiveCfg = Release JP|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Release-JP|x64.Build.0 = Release JP|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Release-JP|x86.ActiveCfg = Release JP|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Release-JP|x86.Build.0 = Release JP|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Release-Static|Any CPU.ActiveCfg = Release|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Release-Static|Any CPU.Build.0 = Release|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Release-Static|Win32.ActiveCfg = Release|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Release-Static|x64.ActiveCfg = Release|Any CPU + {524CC7B4-75B9-4925-9DA4-3DACD40F4814}.Release-Static|x86.ActiveCfg = Release|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Debug|Win32.ActiveCfg = Debug|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Debug|x64.ActiveCfg = Debug|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Debug|x64.Build.0 = Debug|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Debug|x86.ActiveCfg = Debug|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Debug|x86.Build.0 = Debug|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Release|Any CPU.Build.0 = Release|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Release|Win32.ActiveCfg = Release|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Release|x64.ActiveCfg = Release|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Release|x64.Build.0 = Release|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Release|x86.ActiveCfg = Release|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Release|x86.Build.0 = Release|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Release-JP|Any CPU.ActiveCfg = Release|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Release-JP|Any CPU.Build.0 = Release|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Release-JP|Win32.ActiveCfg = Release|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Release-JP|x64.ActiveCfg = Release|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Release-JP|x64.Build.0 = Release|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Release-JP|x86.ActiveCfg = Release|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Release-JP|x86.Build.0 = Release|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Release-Static|Any CPU.ActiveCfg = Release|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Release-Static|Any CPU.Build.0 = Release|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Release-Static|Win32.ActiveCfg = Release|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Release-Static|x64.ActiveCfg = Release|Any CPU + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23}.Release-Static|x86.ActiveCfg = Release|Any CPU + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Debug|Win32.ActiveCfg = Debug|Win32 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Debug|Win32.Build.0 = Debug|Win32 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Debug|x64.ActiveCfg = Debug|x64 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Debug|x86.ActiveCfg = Debug|Win32 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Debug|x86.Build.0 = Debug|Win32 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Release|Any CPU.ActiveCfg = Release|Win32 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Release|Win32.ActiveCfg = Release|Win32 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Release|Win32.Build.0 = Release|Win32 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Release|x64.ActiveCfg = Release|x64 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Release|x64.Build.0 = Release|x64 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Release|x86.ActiveCfg = Release|Win32 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Release|x86.Build.0 = Release|Win32 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Release-JP|Any CPU.ActiveCfg = Release|Win32 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Release-JP|Win32.ActiveCfg = Release|x64 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Release-JP|x64.ActiveCfg = Release|x64 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Release-JP|x64.Build.0 = Release|x64 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Release-JP|x86.ActiveCfg = Release|Win32 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Release-JP|x86.Build.0 = Release|Win32 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Release-Static|Win32.Build.0 = Release-Static|Win32 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Release-Static|x64.ActiveCfg = Release-Static|x64 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Release-Static|x64.Build.0 = Release-Static|x64 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Release-Static|x86.ActiveCfg = Release-Static|Win32 + {8E7279F8-F801-4672-B42F-1ED2C68B16A4}.Release-Static|x86.Build.0 = Release-Static|Win32 + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Debug|Win32.ActiveCfg = Debug|Any CPU + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Debug|x64.ActiveCfg = Debug|Any CPU + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Debug|x86.ActiveCfg = Debug|Any CPU + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Release|Any CPU.Build.0 = Release|Any CPU + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Release|Win32.ActiveCfg = Release|Any CPU + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Release|x64.ActiveCfg = Release|x64 + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Release|x64.Build.0 = Release|x64 + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Release|x86.ActiveCfg = Release|x86 + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Release|x86.Build.0 = Release|x86 + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Release-JP|Any CPU.ActiveCfg = Release|Any CPU + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Release-JP|Any CPU.Build.0 = Release|Any CPU + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Release-JP|Win32.ActiveCfg = Release|Any CPU + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Release-JP|x64.ActiveCfg = Release|Any CPU + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Release-JP|x86.ActiveCfg = Release|x86 + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Release-Static|Any CPU.ActiveCfg = Release|Any CPU + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Release-Static|Any CPU.Build.0 = Release|Any CPU + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Release-Static|Win32.ActiveCfg = Release|x86 + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Release-Static|Win32.Build.0 = Release|x86 + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Release-Static|x64.ActiveCfg = Release|Any CPU + {76A4E76B-0A98-411D-92E9-5527B31EBA3C}.Release-Static|x86.ActiveCfg = Release|x86 + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Debug|Win32.ActiveCfg = Debug|Any CPU + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Debug|x64.ActiveCfg = Debug|x64 + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Debug|x64.Build.0 = Debug|x64 + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Debug|x86.ActiveCfg = Debug|x86 + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Debug|x86.Build.0 = Debug|x86 + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release|Any CPU.Build.0 = Release|Any CPU + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release|Win32.ActiveCfg = Release|Any CPU + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release|x64.ActiveCfg = Release|x64 + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release|x64.Build.0 = Release|x64 + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release|x86.ActiveCfg = Release|x86 + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release|x86.Build.0 = Release|x86 + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release-JP|Any CPU.ActiveCfg = Release|Any CPU + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release-JP|Any CPU.Build.0 = Release|Any CPU + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release-JP|Win32.ActiveCfg = Release|Any CPU + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release-JP|x64.ActiveCfg = Release|x64 + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release-JP|x64.Build.0 = Release|x64 + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release-JP|x86.ActiveCfg = Release JP|x86 + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release-JP|x86.Build.0 = Release JP|x86 + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release-Static|Any CPU.ActiveCfg = Release JP|Any CPU + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release-Static|Any CPU.Build.0 = Release JP|Any CPU + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release-Static|Win32.ActiveCfg = Release|x86 + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release-Static|Win32.Build.0 = Release|x86 + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release-Static|x64.ActiveCfg = Release JP|x64 + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release-Static|x64.Build.0 = Release JP|x64 + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5}.Release-Static|x86.ActiveCfg = Release|x86 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Debug|Win32.ActiveCfg = Debug|Win32 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Debug|Win32.Build.0 = Debug|Win32 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Debug|x64.ActiveCfg = Debug|x64 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Debug|x64.Build.0 = Debug|x64 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Debug|x86.ActiveCfg = Debug|Win32 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Release|Any CPU.ActiveCfg = Release|Win32 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Release|Win32.ActiveCfg = Release|Win32 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Release|Win32.Build.0 = Release|Win32 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Release|x64.ActiveCfg = Release|x64 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Release|x64.Build.0 = Release|x64 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Release|x86.ActiveCfg = Release|Win32 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Release-JP|Any CPU.ActiveCfg = Release|Win32 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Release-JP|Win32.ActiveCfg = Release|Win32 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Release-JP|Win32.Build.0 = Release|Win32 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Release-JP|x64.ActiveCfg = Release|Win32 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Release-JP|x86.ActiveCfg = Release|Win32 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Release-JP|x86.Build.0 = Release|Win32 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Release-Static|Any CPU.ActiveCfg = Release|Win32 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Release-Static|Win32.ActiveCfg = Release|Win32 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Release-Static|Win32.Build.0 = Release|Win32 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Release-Static|x64.ActiveCfg = Release|x64 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Release-Static|x64.Build.0 = Release|x64 + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1}.Release-Static|x86.ActiveCfg = Release|Win32 + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Debug|Win32.ActiveCfg = Debug|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Debug|x64.ActiveCfg = Debug|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Debug|x64.Build.0 = Debug|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Debug|x86.ActiveCfg = Debug|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Release|Any CPU.Build.0 = Release|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Release|Win32.ActiveCfg = Release|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Release|x64.ActiveCfg = Release|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Release|x64.Build.0 = Release|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Release|x86.ActiveCfg = Release|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Release|x86.Build.0 = Release|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Release-JP|Any CPU.ActiveCfg = Release|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Release-JP|Any CPU.Build.0 = Release|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Release-JP|Win32.ActiveCfg = Release|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Release-JP|x64.ActiveCfg = Release|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Release-JP|x64.Build.0 = Release|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Release-JP|x86.ActiveCfg = Release|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Release-JP|x86.Build.0 = Release|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Release-Static|Any CPU.ActiveCfg = Release|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Release-Static|Any CPU.Build.0 = Release|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Release-Static|Win32.ActiveCfg = Release|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Release-Static|x64.ActiveCfg = Release|Any CPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668}.Release-Static|x86.ActiveCfg = Release|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Debug|Win32.ActiveCfg = Debug|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Debug|x64.ActiveCfg = Debug|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Debug|x64.Build.0 = Debug|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Debug|x86.ActiveCfg = Debug|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Release|Any CPU.Build.0 = Release|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Release|Win32.ActiveCfg = Release|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Release|x64.ActiveCfg = Release|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Release|x64.Build.0 = Release|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Release|x86.ActiveCfg = Release|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Release|x86.Build.0 = Release|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Release-JP|Any CPU.ActiveCfg = Release|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Release-JP|Any CPU.Build.0 = Release|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Release-JP|Win32.ActiveCfg = Release|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Release-JP|x64.ActiveCfg = Release|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Release-JP|x64.Build.0 = Release|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Release-JP|x86.ActiveCfg = Release|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Release-JP|x86.Build.0 = Release|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Release-Static|Any CPU.ActiveCfg = Release|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Release-Static|Any CPU.Build.0 = Release|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Release-Static|Win32.ActiveCfg = Release|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Release-Static|x64.ActiveCfg = Release|Any CPU + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F}.Release-Static|x86.ActiveCfg = Release|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Debug|Win32.ActiveCfg = Debug|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Debug|x64.ActiveCfg = Debug|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Debug|x64.Build.0 = Debug|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Debug|x86.ActiveCfg = Debug|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Release|Any CPU.Build.0 = Release|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Release|Win32.ActiveCfg = Release|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Release|x64.ActiveCfg = Release|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Release|x64.Build.0 = Release|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Release|x86.ActiveCfg = Release|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Release|x86.Build.0 = Release|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Release-JP|Any CPU.ActiveCfg = Release|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Release-JP|Any CPU.Build.0 = Release|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Release-JP|Win32.ActiveCfg = Release|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Release-JP|x64.ActiveCfg = Release|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Release-JP|x64.Build.0 = Release|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Release-JP|x86.ActiveCfg = Release|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Release-JP|x86.Build.0 = Release|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Release-Static|Any CPU.ActiveCfg = Release|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Release-Static|Any CPU.Build.0 = Release|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Release-Static|Win32.ActiveCfg = Release|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Release-Static|x64.ActiveCfg = Release|Any CPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A}.Release-Static|x86.ActiveCfg = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Debug|Any CPU.Build.0 = Debug|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Debug|Win32.ActiveCfg = Debug|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Debug|Win32.Build.0 = Debug|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Debug|x64.ActiveCfg = Debug|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Debug|x64.Build.0 = Debug|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Debug|x86.ActiveCfg = Debug|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Debug|x86.Build.0 = Debug|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release|Any CPU.ActiveCfg = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release|Any CPU.Build.0 = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release|Win32.ActiveCfg = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release|Win32.Build.0 = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release|x64.ActiveCfg = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release|x64.Build.0 = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release|x86.ActiveCfg = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release|x86.Build.0 = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release-JP|Any CPU.ActiveCfg = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release-JP|Any CPU.Build.0 = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release-JP|Win32.ActiveCfg = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release-JP|Win32.Build.0 = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release-JP|x64.ActiveCfg = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release-JP|x64.Build.0 = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release-JP|x86.ActiveCfg = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release-JP|x86.Build.0 = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release-Static|Any CPU.ActiveCfg = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release-Static|Any CPU.Build.0 = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release-Static|Win32.ActiveCfg = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release-Static|Win32.Build.0 = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release-Static|x64.ActiveCfg = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release-Static|x64.Build.0 = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release-Static|x86.ActiveCfg = Release|Any CPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01}.Release-Static|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/src/OpenCvSharp 3.x.sln.DotSettings b/src/OpenCvSharp 3.x.sln.DotSettings new file mode 100644 index 000000000..0149d6987 --- /dev/null +++ b/src/OpenCvSharp 3.x.sln.DotSettings @@ -0,0 +1,17 @@ + + SUGGESTION + HINT + HINT + DO_NOT_SHOW + AKAZE + CLAHE + DFT + HOG + LUT + ORB + PCA + RNG + ROI + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> \ No newline at end of file diff --git a/src/OpenCvSharp.Blob/BlobRenderer.cs b/src/OpenCvSharp.Blob/BlobRenderer.cs new file mode 100644 index 000000000..a5e96f234 --- /dev/null +++ b/src/OpenCvSharp.Blob/BlobRenderer.cs @@ -0,0 +1,207 @@ +using System; +using System.Collections.Generic; +using System.Text; + +// Copyright (C) 2007 by Cristóbal Carnero Liñán +// grendel.ccl@gmail.com +// +// This file is part of cvBlob. +// +// cvBlob is free software: you can redistribute it and/or modify +// it under the terms of the Lesser GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// cvBlob is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// Lesser GNU General Public License for more details. +// +// You should have received a copy of the Lesser GNU General Public License +// along with cvBlob. If not, see . + +namespace OpenCvSharp.Blob +{ + /// + /// + /// + internal static class BlobRenderer + { + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static unsafe void PerformOne(LabelData labels, CvBlob blob, Mat imgSrc, Mat imgDst, + RenderBlobsMode mode, Scalar color, double alpha) + { + if (labels == null) + throw new ArgumentNullException("labels"); + if (blob == null) + throw new ArgumentNullException("blob"); + if (imgSrc == null) + throw new ArgumentNullException("imgSrc"); + if (imgDst == null) + throw new ArgumentNullException("imgDst"); + if (imgDst.Type() != MatType.CV_8UC3) + throw new ArgumentException("'img' must be a 3-channel U8 image."); + + if ((mode & RenderBlobsMode.Color) == RenderBlobsMode.Color) + { + var pSrc = imgSrc.GetGenericIndexer(); + var pDst = imgDst.GetGenericIndexer(); + + for (int r = blob.MinY; r < blob.MaxY; r++) + { + for (int c = blob.MinX; c < blob.MaxX; c++) + { + if (labels[r, c] == blob.Label) + { + byte v0 = (byte) ((1.0 - alpha)*pSrc[r, c].Item0 + alpha*color.Val0); + byte v1 = (byte) ((1.0 - alpha)*pSrc[r, c].Item1 + alpha*color.Val1); + byte v2 = (byte) ((1.0 - alpha)*pSrc[r, c].Item2 + alpha*color.Val2); + pDst[r, c] = new Vec3b(v0, v1, v2); + } + } + } + } + + if (mode != RenderBlobsMode.None) + { + if ((mode & RenderBlobsMode.BoundingBox) == RenderBlobsMode.BoundingBox) + { + Cv2.Rectangle( + imgDst, + new Point(blob.MinX, blob.MinY), + new Point(blob.MaxX, blob.MaxY), + new Scalar(255, 0, 0)); + } + if ((mode & RenderBlobsMode.Angle) == RenderBlobsMode.Angle) + { + double angle = blob.Angle(); + double lengthLine = Math.Max(blob.MaxX - blob.MinX, blob.MaxY - blob.MinY) / 2.0; + double x1 = blob.Centroid.X - lengthLine * Math.Cos(angle); + double y1 = blob.Centroid.Y - lengthLine * Math.Sin(angle); + double x2 = blob.Centroid.X + lengthLine * Math.Cos(angle); + double y2 = blob.Centroid.Y + lengthLine * Math.Sin(angle); + Cv2.Line(imgDst, new Point((int)x1, (int)y1), new Point((int)x2, (int)y2), + new Scalar(0, 255, 0)); + } + if ((mode & RenderBlobsMode.Centroid) == RenderBlobsMode.Centroid) + { + Cv2.Line(imgDst, + new Point((int)blob.Centroid.X - 3, (int)blob.Centroid.Y), + new Point((int)blob.Centroid.X + 3, (int)blob.Centroid.Y), + new Scalar(255, 0, 0)); + Cv2.Line(imgDst, + new Point((int)blob.Centroid.X, (int)blob.Centroid.Y - 3), + new Point((int)blob.Centroid.X, (int)blob.Centroid.Y + 3), + new Scalar(255, 0, 0)); + } + } + } + + /// + /// + /// + /// + /// + /// + /// + /// + public static void PerformMany(CvBlobs blobs, Mat imgSrc, Mat imgDst, RenderBlobsMode mode, double alpha) + { + if (blobs == null) + throw new ArgumentNullException("blobs"); + if (imgSrc == null) + throw new ArgumentNullException("imgSrc"); + if (imgDst == null) + throw new ArgumentNullException("imgDst"); + if (imgDst.Type() != MatType.CV_8UC3) + throw new ArgumentException("'img' must be a 3-channel U8 image."); + + var palette = new Dictionary(); + if ((mode & RenderBlobsMode.Color) == RenderBlobsMode.Color) + { + int colorCount = 0; + foreach (var kv in blobs) + { + double r, g, b; + Hsv2Rgb((colorCount*77) % 360, 0.5, 1.0, out r, out g, out b); + colorCount++; + palette[kv.Key] = new Scalar(b, g, r); + } + } + + foreach (var kv in blobs) + { + Scalar color = default (Scalar); + if (palette.ContainsKey(kv.Key)) + color = palette[kv.Key]; + PerformOne(blobs.Labels, kv.Value, imgSrc, imgDst, mode, color, alpha); + } + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + private static void Hsv2Rgb(double h, double s, double v, out double r, out double g, out double b) + { + double hh = h / 60.0; + int hf = (int)Math.Floor(hh); + int hi = ((int)hh) % 6; + double f = hh - hf; + + double p = v * (1.0 - s); + double q = v * (1.0 - f * s); + double t = v * (1.0 - (1.0 - f) * s); + + switch (hi) + { + case 0: + r = 255.0 * v; + g = 255.0 * t; + b = 255.0 * p; + break; + case 1: + r = 255.0 * q; + g = 255.0 * v; + b = 255.0 * p; + break; + case 2: + r = 255.0 * p; + g = 255.0 * v; + b = 255.0 * t; + break; + case 3: + r = 255.0 * p; + g = 255.0 * q; + b = 255.0 * v; + break; + case 4: + r = 255.0 * t; + g = 255.0 * p; + b = 255.0 * v; + break; + case 5: + r = 255.0 * v; + g = 255.0 * p; + b = 255.0 * q; + break; + default: + throw new Exception(); + } + } + } +} diff --git a/src/OpenCvSharp.Blob/CvBlob.cs b/src/OpenCvSharp.Blob/CvBlob.cs new file mode 100644 index 000000000..0ce648c77 --- /dev/null +++ b/src/OpenCvSharp.Blob/CvBlob.cs @@ -0,0 +1,301 @@ +using System; +using System.Collections.Generic; + +namespace OpenCvSharp.Blob +{ + /// + /// Struct that contain information about one blob. + /// + [Serializable] + public class CvBlob : ICloneable + { + #region Init + + /// + /// Constructor + /// + public CvBlob() + { + Contour = new CvContourChainCode(); + InternalContours = new List(); + } + + /// + /// + /// + /// + /// + /// + internal CvBlob(int label, int x, int y) : this() + { + Label = label; + Area = 1; + MinX = x; + MaxX = x; + MinY = y; + MaxY = y; + M10 = x; + M01 = y; + M11 = x*y; + M20 = x*x; + M02 = y*y; + } + + #endregion + + #region Properties + + /// + /// Label assigned to the blob + /// + public int Label { get; set; } + + /// + /// Area (moment 00) + /// + public int Area { get; set; } + + /// + /// Area (moment 00) + /// + public int M00 + { + get { return Area; } + set { Area = value; } + } + + /// + /// X min + /// + public int MinX { get; set; } + + /// + /// X max + /// + public int MaxX { get; set; } + + /// + /// Y min + /// + public int MinY { get; set; } + + /// + /// Y max + /// + public int MaxY { get; set; } + + /// + /// CvRect(MinX, MinY, MaxX - MinX, MaxY - MinY) + /// + public Rect Rect + { + get { return new Rect(MinX, MinY, MaxX - MinX + 1, MaxY - MinY + 1); } + set + { + MinX = value.Left; + MinY = value.Top; + MaxX = value.Right; + MaxY = value.Bottom; + } + } + + /// + /// Centroid + /// + public Point2d Centroid { get; internal set; } + + /// + /// Moment 10 + /// + public double M10 { get; set; } + + /// + /// Moment 01 + /// + public double M01 { get; set; } + + /// + /// Moment 11 + /// + public double M11 { get; set; } + + /// + /// Moment 20 + /// + public double M20 { get; set; } + + /// + /// Moment 02 + /// + public double M02 { get; set; } + + /// + /// True if central moments are being calculated + /// + public bool CentralMoments { get; set; } + + /// + /// Central moment 11 + /// + public double U11 { get; internal set; } + + /// + /// Central moment 20 + /// + public double U20 { get; internal set; } + + /// + /// Central moment 02 + /// + public double U02 { get; internal set; } + + /// + /// Normalized central moment 11. + /// + public double N11 { get; internal set; } + + /// + /// Normalized central moment 20. + /// + public double N20 { get; internal set; } + + /// + /// Normalized central moment 02. + /// + public double N02 { get; internal set; } + + /// + /// Hu moment 1. + /// + public double P1 { get; set; } + + /// + /// Hu moment 2. + /// + public double P2 { get; set; } + + /// + /// Contour + /// + public CvContourChainCode Contour { get; internal set; } + + /// + /// Internal contours + /// + public List InternalContours { get; internal set; } + + #endregion + + #region Methods + + /// + /// Calculates angle orientation of a blob. + /// This function uses central moments so cvCentralMoments should have been called before for this blob. (cvAngle) + /// + /// Angle orientation in radians. + public double Angle() + { + return 0.5*Math.Atan2(2.0*U11, (U20 - U02)); + } + + + /// + /// Calculates centroid. + /// Centroid will be returned and stored in the blob structure. (cvCentroid) + /// + /// Centroid. + public Point2d CalcCentroid() + { + Centroid = new Point2d(M10 / Area, M01 / Area); + return Centroid; + } + + /// + /// Save the image of a blob to a file. + /// The function uses an image (that can be the original pre-processed image or a processed one, or even the result of cvRenderBlobs, for example) and a blob structure. + /// Then the function saves a copy of the part of the image where the blob is. + /// + /// Name of the file. + /// Image. + public void SaveImage(string fileName, Mat img) + { + if (String.IsNullOrEmpty(fileName)) + throw new ArgumentNullException("fileName"); + if (img == null) + throw new ArgumentNullException("img"); + + using (var subMat = img.SubMat(Rect)) + { + subMat.SaveImage(fileName); + } + } + + /// + /// Set central/hu moments and centroid value from moment values (M**) + /// + public void SetMoments() + { + // 重心 + Centroid = new Point2d(M10/Area, M01/Area); + // 各モーメント + U11 = M11 - (M10*M01)/M00; + U20 = M20 - (M10*M10)/M00; + U02 = M02 - (M01*M01)/M00; + + double m00Pow2 = M00*M00; + N11 = U11/m00Pow2; + N20 = U20/m00Pow2; + N02 = U02/m00Pow2; + + P1 = N20 + N02; + double nn = N20 - N02; + P2 = nn*nn + 4.0*(N11*N11); + } + + #endregion + + #region ICloneable + + /// + /// + /// + /// + public CvBlob Clone() + { + return new CvBlob + { + Area = Area, + CentralMoments = CentralMoments, + Centroid = Centroid, + Contour = Contour.Clone(), + InternalContours = new List(InternalContours), + Label = Label, + M00 = M00, + M01 = M01, + M02 = M02, + M10 = M10, + M11 = M11, + M20 = M20, + MaxX = MaxX, + MaxY = MaxY, + MinX = MinX, + MinY = MinY, + N02 = N02, + N11 = N11, + N20 = N20, + P1 = P1, + P2 = P2, + U02 = U02, + U11 = U11, + U20 = U20, + }; + } + + object ICloneable.Clone() + { + return Clone(); + } + + #endregion + } +} diff --git a/src/OpenCvSharp.Blob/CvBlobConst.cs b/src/OpenCvSharp.Blob/CvBlobConst.cs new file mode 100644 index 000000000..02d6bbebb --- /dev/null +++ b/src/OpenCvSharp.Blob/CvBlobConst.cs @@ -0,0 +1,133 @@ +using System; + +namespace OpenCvSharp.Blob +{ + /// + /// Constants which are defined by cvblob + /// + public static class CvBlobConst + { + // ReSharper disable InconsistentNaming + + #region RenderBlobsMode + + /// + /// Render each blog with a different color. + /// + + public const ushort CV_BLOB_RENDER_COLOR = 0x0001; + + /// + /// Render centroid. + /// + public const ushort CV_BLOB_RENDER_CENTROID = 0x0002; + + /// + /// Render bounding box. + /// + public const ushort CV_BLOB_RENDER_BOUNDING_BOX = 0x0004; + + /// + /// Render angle. + /// + public const ushort CV_BLOB_RENDER_ANGLE = 0x0008; + + /// + /// Print blob data to log out. + /// + public const ushort CV_BLOB_RENDER_TO_LOG = 0x0010; + + /// + /// Print blob data to std out. + /// + public const ushort CV_BLOB_RENDER_TO_STD = 0x0020; + + #endregion + + #region CvChainCode + + /// + /// Up. + /// + public const byte CV_CHAINCODE_UP = 0; + + /// + /// Up and right. + /// + public const byte CV_CHAINCODE_UP_RIGHT = 1; + + /// + /// Right. + /// + public const byte CV_CHAINCODE_RIGHT = 2; + + /// + /// Down and right. + /// + public const byte CV_CHAINCODE_DOWN_RIGHT = 3; + + /// + /// Down. + /// + public const byte CV_CHAINCODE_DOWN = 4; + + /// + /// Down and left. + /// + public const byte CV_CHAINCODE_DOWN_LEFT = 5; + + /// + /// Left. + /// + public const byte CV_CHAINCODE_LEFT = 6; + + /// + /// Up and left. + /// + public const byte CV_CHAINCODE_UP_LEFT = 7; + + /// + /// Move vectors of chain codes. + /// + public static readonly sbyte[][] ChainCodeMoves = new sbyte[][] + { + new sbyte[] {0, -1}, + new sbyte[] {1, -1}, + new sbyte[] {1, 0}, + new sbyte[] {1, 1}, + new sbyte[] {0, 1}, + new sbyte[] {-1, 1}, + new sbyte[] {-1, 0}, + new sbyte[] {-1, -1} + }; + + #endregion + + #region RenderTracksMode + + // ReSharper disable InconsistentNaming + /// + /// Print the ID of each track in the image. + /// + public const ushort CV_TRACK_RENDER_ID = 0x0001; + + /// + /// Draw bounding box of each track in the image. \see cvRenderTracks + /// + public const ushort CV_TRACK_RENDER_BOUNDING_BOX = 0x0002; + + /// + /// Print track info to log out. + /// + public const ushort CV_TRACK_RENDER_TO_LOG = 0x0010; + + /// + /// Print track info to log out. + /// + public const ushort CV_TRACK_RENDER_TO_STD = 0x0020; + + // ReSharper restore InconsistentNaming + + #endregion + } +} diff --git a/src/OpenCvSharp.Blob/CvBlobLib.cs b/src/OpenCvSharp.Blob/CvBlobLib.cs new file mode 100644 index 000000000..fd192ea90 --- /dev/null +++ b/src/OpenCvSharp.Blob/CvBlobLib.cs @@ -0,0 +1,512 @@ +using System; + +//#pragma warning disable 1591 + +namespace OpenCvSharp.Blob +{ + /// + /// Functions of cvblob library + /// + public static class CvBlobLib + { + /// + /// Calculates angle orientation of a blob. + /// This function uses central moments so cvCentralMoments should have been called before for this blob. (cvAngle) + /// + /// Blob. + /// Angle orientation in radians. + public static double CalcAngle(CvBlob blob) + { + if (blob == null) + throw new ArgumentNullException("blob"); + return blob.Angle(); + } + + /// + /// Calculates centroid. + /// Centroid will be returned and stored in the blob structure. (cvCentroid) + /// + /// Blob whose centroid will be calculated. + /// Centroid. + public static Point2d CalcCentroid(CvBlob blob) + { + if (blob == null) + throw new ArgumentNullException("blob"); + return blob.CalcCentroid(); + } + + /// + /// Calculates area of a polygonal contour. + /// + /// Contour (polygon type). + /// Area of the contour. + public static double ContourPolygonArea(CvContourPolygon polygon) + { + if (polygon == null) + throw new ArgumentNullException("polygon"); + return polygon.Area(); + } + + /// + /// Calculates the circularity of a polygon (compactness measure). + /// + /// Contour (polygon type). + /// Circularity: a non-negative value, where 0 correspond with a circumference. + public static double ContourPolygonCircularity(CvContourPolygon polygon) + { + if (polygon == null) + throw new ArgumentNullException("polygon"); + return polygon.Circularity(); + } + + /// + /// Calculates perimeter of a chain code contour. + /// + /// Contour (polygon type). + /// Perimeter of the contour. + public static double ContourPolygonPerimeter(CvContourPolygon polygon) + { + if (polygon == null) + throw new ArgumentNullException("polygon"); + return polygon.Perimeter(); + } + + /// + /// Calculates perimeter of a chain code contour. + /// + /// Contour (chain code type). + /// Perimeter of the contour. + public static double ContourChainCodePerimeter(CvContourChainCode cc) + { + if (cc == null) + throw new ArgumentNullException("cc"); + return cc.Perimeter(); + } + + /// + /// Convert a chain code contour to a polygon. + /// + /// Chain code contour. + /// A polygon. + public static CvContourPolygon ConvertChainCodesToPolygon(CvContourChainCode cc) + { + if (cc == null) + throw new ArgumentNullException("cc"); + return cc.ConvertToPolygon(); + } + + /// + /// Filter blobs by area. + /// Those blobs whose areas are not in range will be erased from the input list of blobs. (cvFilterByArea) + /// + /// List of blobs. + /// Minimun area. + /// Maximun area. + public static void FilterByArea(CvBlobs blobs, int minArea, int maxArea) + { + if (blobs == null) + throw new ArgumentNullException("blobs"); + blobs.FilterByArea(minArea, maxArea); + } + + /// + /// Filter blobs by label. + /// Delete all blobs except those with label l. + /// + /// List of blobs. + /// Label to leave. + public static void FilterByLabel(CvBlobs blobs, int label) + { + if (blobs == null) + throw new ArgumentNullException("blobs"); + blobs.FilterByLabel(label); + } + + /// + /// Draw a binary image with the blobs that have been given. (cvFilterLabels) + /// + /// List of blobs to be drawn. + /// Output binary image (depth=IPL_DEPTH_8U and nchannels=1). + public static void FilterLabels(CvBlobs blobs, Mat imgOut) + { + if (blobs == null) + throw new ArgumentNullException("blobs"); + blobs.FilterLabels(imgOut); + } + + /// + /// Get the label value from a labeled image. + /// + /// Blob data. + /// X coordenate. + /// Y coordenate. + /// Label value. + public static int GetLabel(CvBlobs blobs, int x, int y) + { + if (blobs == null) + throw new ArgumentNullException("blobs"); + return blobs.GetLabel(x, y); + } + + /// + /// Find greater blob. (cvGreaterBlob) + /// + /// List of blobs. + /// The greater blob. + public static CvBlob GreaterBlob(CvBlobs blobs) + { + if (blobs == null) + throw new ArgumentNullException("blobs"); + return blobs.GreaterBlob(); + } + + /// + /// Find the largest blob. (cvLargestBlob) + /// + /// List of blobs. + /// The largest blob. + public static CvBlob LargestBlob(CvBlobs blobs) + { + if (blobs == null) + throw new ArgumentNullException("blobs"); + return blobs.LargestBlob(); + } + + /// + /// Label the connected parts of a binary image. (cvLabel) + /// + /// Input binary image (depth=IPL_DEPTH_8U and num. channels=1). + /// List of blobs. + /// Number of pixels that has been labeled. + public static int Label(Mat img, CvBlobs blobs) + { + if (img == null) + throw new ArgumentNullException("img"); + if (blobs == null) + throw new ArgumentNullException("blobs"); + + return blobs.Label(img); + } + + /// + /// Calculates mean color of a blob in an image. + /// + /// Blob list + /// The target blob + /// Original image. + /// Average color. + public static Scalar BlobMeanColor(CvBlobs blobs, CvBlob targetBlob, Mat originalImage) + { + if (blobs == null) + throw new ArgumentNullException("blobs"); + return blobs.BlobMeanColor(targetBlob, originalImage); + } + + /// + /// Calculates convex hull of a contour. + /// Uses the Melkman Algorithm. Code based on the version in http://w3.impa.br/~rdcastan/Cgeometry/. + /// + /// Contour (polygon type). + /// Convex hull. + public static CvContourPolygon PolygonContourConvexHull(CvContourPolygon polygon) + { + if (polygon == null) + throw new ArgumentNullException("polygon"); + return polygon.ContourConvexHull(); + } + + /// + /// Draws or prints information about a blob. + /// + /// Label data. + /// Blob. + /// Input image (depth=IPL_DEPTH_8U and num. channels=3). + /// Output image (depth=IPL_DEPTH_8U and num. channels=3). + public static void RenderBlob(LabelData labels, CvBlob blob, Mat imgSource, Mat imgDest) + { + RenderBlob(labels, blob, imgSource, imgDest, (RenderBlobsMode) 0x000f, Scalar.White, 1.0); + } + + /// + /// Draws or prints information about a blob. + /// + /// Label data. + /// Blob. + /// Input image (depth=IPL_DEPTH_8U and num. channels=3). + /// Output image (depth=IPL_DEPTH_8U and num. channels=3). + /// Render mode. By default is CV_BLOB_RENDER_COLOR|CV_BLOB_RENDER_CENTROID|CV_BLOB_RENDER_BOUNDING_BOX|CV_BLOB_RENDER_ANGLE. + public static void RenderBlob(LabelData labels, CvBlob blob, Mat imgSource, Mat imgDest, + RenderBlobsMode mode) + { + RenderBlob(labels, blob, imgSource, imgDest, mode, Scalar.White, 1.0); + } + + /// + /// Draws or prints information about a blob. + /// + /// Label data. + /// Blob. + /// Input image (depth=IPL_DEPTH_8U and num. channels=3). + /// Output image (depth=IPL_DEPTH_8U and num. channels=3). + /// Render mode. By default is CV_BLOB_RENDER_COLOR|CV_BLOB_RENDER_CENTROID|CV_BLOB_RENDER_BOUNDING_BOX|CV_BLOB_RENDER_ANGLE. + /// Color to render (if CV_BLOB_RENDER_COLOR is used). + /// If mode CV_BLOB_RENDER_COLOR is used. 1.0 indicates opaque and 0.0 translucent (1.0 by default). + public static void RenderBlob(LabelData labels, CvBlob blob, Mat imgSource, Mat imgDest, + RenderBlobsMode mode, Scalar color, double alpha = 1.0) + { + if (labels == null) + throw new ArgumentNullException("labels"); + if (blob == null) + throw new ArgumentNullException("blob"); + if (imgSource == null) + throw new ArgumentNullException("imgSource"); + if (imgDest == null) + throw new ArgumentNullException("imgDest"); + + BlobRenderer.PerformOne(labels, blob, imgSource, imgDest, mode, color, alpha); + } + + /// + /// Draws or prints information about blobs. (cvRenderBlobs) + /// + /// List of blobs. + /// Input image (depth=IPL_DEPTH_8U and num. channels=3). + /// Output image (depth=IPL_DEPTH_8U and num. channels=3). + public static void RenderBlobs(CvBlobs blobs, Mat imgSource, Mat imgDest) + { + RenderBlobs(blobs, imgSource, imgDest, (RenderBlobsMode) 0x000f, 1.0); + } + + /// + /// Draws or prints information about blobs. (cvRenderBlobs) + /// + /// List of blobs. + /// Input image (depth=IPL_DEPTH_8U and num. channels=3). + /// Output image (depth=IPL_DEPTH_8U and num. channels=3). + /// Render mode. By default is CV_BLOB_RENDER_COLOR|CV_BLOB_RENDER_CENTROID|CV_BLOB_RENDER_BOUNDING_BOX|CV_BLOB_RENDER_ANGLE. + /// If mode CV_BLOB_RENDER_COLOR is used. 1.0 indicates opaque and 0.0 translucent (1.0 by default). + public static void RenderBlobs(CvBlobs blobs, Mat imgSource, Mat imgDest, RenderBlobsMode mode, + double alpha = 1.0) + { + if (blobs == null) + throw new ArgumentNullException("blobs"); + if (imgSource == null) + throw new ArgumentNullException("imgSource"); + if (imgDest == null) + throw new ArgumentNullException("imgDest"); + + BlobRenderer.PerformMany(blobs, imgSource, imgDest, mode, alpha); + } + + /// + /// Draw a contour. + /// + /// Chain code contour. + /// Image to draw on. + public static void RenderContourChainCode(CvContourChainCode contour, Mat img) + { + if (contour == null) + throw new ArgumentNullException("contour"); + contour.Render(img); + } + + /// + /// Draw a contour. + /// + /// Chain code contour. + /// Image to draw on. + /// Color to draw (default, white). + public static void RenderContourChainCode(CvContourChainCode contour, Mat img, Scalar color) + { + if (contour == null) + throw new ArgumentNullException("contour"); + contour.Render(img, color); + } + + /// + /// Draw a polygon. + /// + /// Polygon contour. + /// Image to draw on. + public static void RenderContourPolygon(CvContourPolygon contour, Mat img) + { + if (contour == null) + throw new ArgumentNullException("contour"); + contour.Render(img); + } + + /// + /// Draw a polygon. + /// + /// Polygon contour. + /// Image to draw on. + /// Color to draw (default, white). + public static void RenderContourPolygon(CvContourPolygon contour, Mat img, Scalar color) + { + if (contour == null) + throw new ArgumentNullException("contour"); + contour.Render(img, color); + } + + /// + /// Prints tracks information. + /// + /// List of tracks. + /// Input image (depth=IPL_DEPTH_8U and num. channels=3). + /// Output image (depth=IPL_DEPTH_8U and num. channels=3). + public static void RenderTracks(CvTracks tracks, Mat imgSource, Mat imgDest) + { + if (tracks == null) + throw new ArgumentNullException("tracks"); + tracks.Render(imgSource, imgDest); + } + + /// + /// Prints tracks information. + /// + /// List of tracks. + /// Input image (depth=IPL_DEPTH_8U and num. channels=3). + /// Output image (depth=IPL_DEPTH_8U and num. channels=3). + /// Render mode. By default is CV_TRACK_RENDER_ID. + public static void RenderTracks(CvTracks tracks, Mat imgSource, Mat imgDest, RenderTracksMode mode) + { + if (tracks == null) + throw new ArgumentNullException("tracks"); + tracks.Render(imgSource, imgDest, mode); + } + + /// + /// Prints tracks information. + /// + /// List of tracks. + /// Input image (depth=IPL_DEPTH_8U and num. channels=3). + /// Output image (depth=IPL_DEPTH_8U and num. channels=3). + /// Render mode. By default is CV_TRACK_RENDER_ID. + /// + /// + /// + /// + public static void RenderTracks(CvTracks tracks, Mat imgSource, Mat imgDest, RenderTracksMode mode, + Scalar textColor, HersheyFonts fontFace = HersheyFonts.HersheySimplex, double fontScale = 1d, int thickness = 1) + { + if (tracks == null) + throw new ArgumentNullException("tracks"); + tracks.Render(imgSource, imgDest, mode, textColor, fontFace, fontScale, thickness); + } + + /// + /// Save the image of a blob to a file. + /// The function uses an image (that can be the original pre-processed image or a processed one, or even the result of cvRenderBlobs, for example) and a blob structure. + /// Then the function saves a copy of the part of the image where the blob is. + /// + /// Name of the file. + /// Image. + /// Blob. + public static void SaveImageBlob(string fileName, Mat img, CvBlob blob) + { + if (String.IsNullOrEmpty(fileName)) + throw new ArgumentNullException("fileName"); + if (blob == null) + throw new ArgumentNullException("blob"); + blob.SaveImage(fileName, img); + } + + /// + /// Simplify a polygon reducing the number of vertex according the distance "delta". + /// Uses a version of the Ramer-Douglas-Peucker algorithm (http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm). + /// + /// Contour (polygon type). + /// A simplify version of the original polygon. + public static CvContourPolygon SimplifyPolygon(CvContourPolygon polygon) + { + return polygon.Simplify(); + } + + /// + /// Simplify a polygon reducing the number of vertex according the distance "delta". + /// Uses a version of the Ramer-Douglas-Peucker algorithm (http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm). + /// + /// Contour (polygon type). + /// Minimun distance. + /// A simplify version of the original polygon. + public static CvContourPolygon SimplifyPolygon(CvContourPolygon polygon, double delta) + { + if (polygon == null) + throw new ArgumentNullException("polygon"); + return polygon.Simplify(delta); + } + + /// + /// Updates list of tracks based on current blobs. + /// + /// List of blobs. + /// List of tracks. + /// Max distance to determine when a track and a blob match. + /// Max number of frames a track can be inactive. + public static void UpdateTracks(CvBlobs blobs, CvTracks tracks, double thDistance, int thInactive) + { + if (blobs == null) + throw new ArgumentNullException("blobs"); + blobs.UpdateTracks(tracks, thDistance, thInactive); + } + + /// + /// Updates list of tracks based on current blobs. + /// + /// List of blobs. + /// List of tracks. + /// Max distance to determine when a track and a blob match. + /// Max number of frames a track can be inactive. + /// If a track becomes inactive but it has been active less than thActive frames, the track will be deleted. + /// + /// Tracking based on: + /// A. Senior, A. Hampapur, Y-L Tian, L. Brown, S. Pankanti, R. Bolle. Appearance Models for + /// Occlusion Handling. Second International workshop on Performance Evaluation of Tracking and + /// Surveillance Systems & CVPR'01. December, 2001. + /// (http://www.research.ibm.com/peoplevision/PETS2001.pdf) + /// + public static void UpdateTracks(CvBlobs blobs, CvTracks tracks, double thDistance, int thInactive, int thActive) + { + if (blobs == null) + throw new ArgumentNullException("blobs"); + blobs.UpdateTracks(tracks, thDistance, thInactive, thActive); + } + + /// + /// Write a contour to a CSV (Comma-separated values) file. + /// + /// Polygon contour. + /// File name. + public static void WriteContourPolygonCsv(CvContourPolygon polygon, string filename) + { + if (polygon == null) + throw new ArgumentNullException("polygon"); + polygon.WriteAsCsv(filename); + } + + /// + /// Write a contour to a SVG file. + /// + /// Polygon contour. + /// File name. + public static void WriteContourPolygonSvg(CvContourPolygon polygon, string fileName) + { + polygon.WriteAsSvg(fileName); + } + + /// + /// Write a contour to a SVG file. + /// + /// Polygon contour. + /// File name. + /// Stroke color (black by default). + /// Fill color (white by default). + public static void WriteContourPolygonSvg(CvContourPolygon polygon, string fileName, + Scalar stroke, Scalar fill) + { + if (polygon == null) + throw new ArgumentNullException("polygon"); + polygon.WriteAsSvg(fileName, stroke, fill); + } + } +} diff --git a/src/OpenCvSharp.Blob/CvBlobs.cs b/src/OpenCvSharp.Blob/CvBlobs.cs new file mode 100644 index 000000000..72546f42a --- /dev/null +++ b/src/OpenCvSharp.Blob/CvBlobs.cs @@ -0,0 +1,714 @@ +using System; +using System.Collections.Generic; +using System.Text; + +// Copyright (C) 2007 by Cristóbal Carnero Liñán +// grendel.ccl@gmail.com +// +// This file is part of cvBlob. +// +// cvBlob is free software: you can redistribute it and/or modify +// it under the terms of the Lesser GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// cvBlob is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// Lesser GNU General Public License for more details. +// +// You should have received a copy of the Lesser GNU General Public License +// along with cvBlob. If not, see . + +namespace OpenCvSharp.Blob +{ + /// + /// Blob set + /// + public class CvBlobs : Dictionary, ICloneable + { + /// + /// Label values + /// + public LabelData Labels { get; set; } + + /// + /// Constructor (init only) + /// + public CvBlobs() + { + } + + /// + /// Constructor (copy) + /// + public CvBlobs(IEnumerable> blobData, int[,] labelData) + { + foreach (KeyValuePair pair in blobData) + { + Add(pair.Key, pair.Value); + } + Labels = new LabelData(labelData); + } + + /// + /// Constructor (copy) + /// + public CvBlobs(IEnumerable> blobData, LabelData labelData) + : this(blobData, labelData.Values) + { + } + + /// + /// Constructor (init and cvLabel) + /// + /// Input binary image (depth=IPL_DEPTH_8U and nchannels=1). + public CvBlobs(Mat img) + { + if (img == null) + throw new ArgumentNullException("img"); + if (img.IsDisposed) + throw new ArgumentException("img is disposed"); + if (img.Type() != MatType.CV_8UC1) + throw new ArgumentException("img.Depth == BitDepth.U8 && img.NChannels == 1"); + + Label(img); + } + + #region Methods + + #region BlobMeanColor + + /// + /// Calculates mean color of a blob in an image. (cvBlobMeanColor) + /// + /// The target blob + /// Original image. + public Scalar BlobMeanColor(CvBlob targetBlob, Mat originalImage) + { + if (targetBlob == null) + throw new ArgumentNullException("targetBlob"); + if (originalImage == null) + throw new ArgumentNullException("originalImage"); + if (originalImage.Type() != MatType.CV_8UC3) + throw new ArgumentException("imgOut.Depth != BitDepth.U8 || imgOut.NChannels != 3"); + if (Labels == null) + throw new ArgumentException("blobs.Labels == null"); + + int width = originalImage.Cols; + int height = originalImage.Rows; + int mb = 0; + int mg = 0; + int mr = 0; + + var indexer = originalImage.GetGenericIndexer(); + for (int r = 0; r < height; r++) + { + for (int c = 0; c < width; c++) + { + if (Labels[r, c] == targetBlob.Label) + { + var v = indexer[r, c]; + mb += v.Item0; + mg += v.Item1; + mr += v.Item2; + } + } + } + + GC.KeepAlive(originalImage); + + int pixels = targetBlob.Area; + return new Scalar((byte) (mb/pixels), (byte) (mg/pixels), (byte) (mr/pixels)); + } + + #endregion + + #region FilterByArea + + /// + /// Filter blobs by area. + /// Those blobs whose areas are not in range will be erased from the input list of blobs. (cvFilterByArea) + /// + /// Minimun area. + /// Maximun area. + public void FilterByArea(int minArea, int maxArea) + { + int[] keys = new int[Count]; + Keys.CopyTo(keys, 0); + + foreach (int key in keys) + { + int area = this[key].Area; + if (area < minArea || area > maxArea) + { + Remove(key); + } + } + } + + #endregion + + #region FilterByLabel + + /// + /// Filter blobs by label. + /// Delete all blobs except those with label l. + /// + /// Label to leave. + public void FilterByLabel(int label) + { + int[] keys = new int[Count]; + Keys.CopyTo(keys, 0); + + foreach (int key in keys) + { + if (this[key].Label != label) + { + Remove(key); + } + } + } + + #endregion + + #region FilterLabels + + /// + /// Draw a binary image with the blobs that have been given. (cvFilterLabels) + /// + /// Output binary image (depth=IPL_DEPTH_8U and nchannels=1). + public void FilterLabels(Mat imgOut) + { + if (imgOut == null) + throw new ArgumentNullException("imgOut"); + if (imgOut.Type() != MatType.CV_8UC1) + throw new ArgumentException("imgOut.Depth != BitDepth.U8 || imgOut.NChannels != 1"); + if (Labels == null) + throw new ArgumentException("blobs.Labels == null"); + + Size size = Labels.Size; + int w = size.Width; + int h = size.Height; + var indexer = imgOut.GetGenericIndexer(); + + for (int r = 0; r < h; r++) + { + for (int c = 0; c < w; c++) + { + int label = Labels[r, c]; + if (label != 0) + { + if (ContainsKey(label)) + indexer[r, c] = 0xff; + else + indexer[r, c] = 0x00; + } + else + { + indexer[r, c] = 0x00; + } + } + } + } + + #endregion + + #region GreaterBlob + + /// + /// Find greater blob. (cvGreaterBlob) + /// + /// The greater blob. + public CvBlob GreaterBlob() + { + return LargestBlob(); + } + + /// + /// Find the largest blob. (cvGreaterBlob) + /// + /// The largest blob. + public CvBlob LargestBlob() + { + if (Count == 0) + return null; + + var list = new List>(this); + // 降順ソート + list.Sort((kv1, kv2) => + { + CvBlob b1 = kv1.Value; + CvBlob b2 = kv2.Value; + if (b1 == null) + return -1; + if (b2 == null) + return 1; + return b2.Area - b1.Area; + }); + return list[0].Value; + } + + #endregion + + #region GetLabel + + /// + /// Label the connected parts of a binary image. (cvLabel) + /// + /// + /// + /// Number of pixels that has been labeled. + public int GetLabel(int x, int y) + { + return Labels[y, x]; + } + + #endregion + + #region Label + + /// + /// Label the connected parts of a binary image. (cvLabel) + /// + /// Input binary image (depth=IPL_DEPTH_8U and num. channels=1). + /// Number of pixels that has been labeled. + public int Label(Mat img) + { + if (img == null) + throw new ArgumentNullException("img"); + + Labels = new LabelData(img.Height, img.Width); + return Labeller.Perform(img, this); + } + + #endregion + + #region RenderBlobs + + /// + /// Draws or prints information about blobs. (cvRenderBlobs) + /// + /// Input image (depth=IPL_DEPTH_8U and num. channels=3). + /// Output image (depth=IPL_DEPTH_8U and num. channels=3). + public void RenderBlobs(Mat imgSource, Mat imgDest) + { + CvBlobLib.RenderBlobs(this, imgSource, imgDest); + } + + /// + /// Draws or prints information about blobs. (cvRenderBlobs) + /// + /// Input image (depth=IPL_DEPTH_8U and num. channels=3). + /// Output image (depth=IPL_DEPTH_8U and num. channels=3). + /// Render mode. By default is CV_BLOB_RENDER_COLOR|CV_BLOB_RENDER_CENTROID|CV_BLOB_RENDER_BOUNDING_BOX|CV_BLOB_RENDER_ANGLE. + public void RenderBlobs(Mat imgSource, Mat imgDest, RenderBlobsMode mode) + { + CvBlobLib.RenderBlobs(this, imgSource, imgDest, mode); + } + + /// + /// Draws or prints information about blobs. (cvRenderBlobs) + /// + /// Input image (depth=IPL_DEPTH_8U and num. channels=3). + /// Output image (depth=IPL_DEPTH_8U and num. channels=3). + /// Render mode. By default is CV_BLOB_RENDER_COLOR|CV_BLOB_RENDER_CENTROID|CV_BLOB_RENDER_BOUNDING_BOX|CV_BLOB_RENDER_ANGLE. + /// If mode CV_BLOB_RENDER_COLOR is used. 1.0 indicates opaque and 0.0 translucent (1.0 by default). + public void RenderBlobs(Mat imgSource, Mat imgDest, RenderBlobsMode mode, Double alpha) + { + CvBlobLib.RenderBlobs(this, imgSource, imgDest, mode, alpha); + } + + #endregion + + #region UpdateTracks + + /// + /// Updates list of tracks based on current blobs. + /// + /// List of tracks. + /// Max distance to determine when a track and a blob match. + /// Max number of frames a track can be inactive. + /// + /// Tracking based on: + /// A. Senior, A. Hampapur, Y-L Tian, L. Brown, S. Pankanti, R. Bolle. Appearance Models for + /// Occlusion Handling. Second International workshop on Performance Evaluation of Tracking and + /// Surveillance Systems & CVPR'01. December, 2001. + /// (http://www.research.ibm.com/peoplevision/PETS2001.pdf) + /// + public void UpdateTracks(CvTracks tracks, double thDistance, int thInactive) + { + UpdateTracks(tracks, thDistance, thInactive, 0); + } + + /// + /// Updates list of tracks based on current blobs. + /// + /// List of tracks. + /// Max distance to determine when a track and a blob match. + /// Max number of frames a track can be inactive. + /// If a track becomes inactive but it has been active less than thActive frames, the track will be deleted. + /// + /// Tracking based on: + /// A. Senior, A. Hampapur, Y-L Tian, L. Brown, S. Pankanti, R. Bolle. Appearance Models for + /// Occlusion Handling. Second International workshop on Performance Evaluation of Tracking and + /// Surveillance Systems & CVPR'01. December, 2001. + /// (http://www.research.ibm.com/peoplevision/PETS2001.pdf) + /// + public void UpdateTracks(CvTracks tracks, double thDistance, int thInactive, int thActive) + { + if (tracks == null) + throw new ArgumentNullException("tracks"); + + int nBlobs = this.Count; + int nTracks = tracks.Count; + + if (nBlobs == 0) + return; + + // Proximity matrix: + // Last row/column is for ID/label. + // Last-1 "/" is for accumulation. + var close = new ProximityMatrix(nBlobs, nTracks); + + // Initialization: + int i = 0; + foreach (CvBlob blob in Values) + { + close.AB[i] = 0; + close.IB[i] = blob.Label; + i++; + } + + int maxTrackId = 0; + int j = 0; + foreach (CvTrack track in tracks.Values) + { + close.AT[j] = 0; + close.IT[j] = track.Id; + if (track.Id > maxTrackId) + maxTrackId = track.Id; + j++; + } + + // Proximity matrix calculation and "used blob" list initialization: + for (i = 0; i < nBlobs; i++) + { + for (j = 0; j < nTracks; j++) + { + int ib = close.IB[i]; + int it = close.IT[j]; + CvBlob b = this[ib]; + CvTrack t = tracks[it]; + close[i, j] = (DistantBlobTrack(b, t) < thDistance) ? 1 : 0; + if (close[i, j] < thDistance) + { + close.AB[i]++; + close.AT[j]++; + } + } + } + + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Detect inactive tracks + for (j = 0; j < nTracks; j++) + { + int c = close[nBlobs, j]; + if (c == 0) + { + //cout << "Inactive track: " << j << endl; + + // Inactive track. + CvTrack track = tracks[j]; + track.Inactive++; + track.Label = 0; + } + } + + // Detect new tracks + for (i = 0; i < nBlobs; i++) + { + int c = close.AB[i]; + if (c == 0) + { + //cout << "Blob (new track): " << maxTrackID+1 << endl; + //cout << *B(i) << endl; + + // New track. + maxTrackId++; + int ib = close.IB[i]; + CvBlob blob = this[ib]; + CvTrack track = new CvTrack + { + Id = maxTrackId, + Label = blob.Label, + MinX = blob.MinX, + MinY = blob.MinY, + MaxX = blob.MaxX, + MaxY = blob.MaxY, + Centroid = blob.Centroid, + LifeTime = 0, + Active = 0, + Inactive = 0, + }; + tracks[maxTrackId] = track; + //maxTrackId++; + } + } + + // Clustering + for (j = 0; j < nTracks; j++) + { + int c = close.AT[j]; + if (c != 0) + { + var tt = new List(); + var bb = new List(); + + int it = close.IT[j]; + tt.Add(tracks[it]); + + GetClusterForTrack(j, close, nBlobs, nTracks, this, tracks, bb, tt); + + // Select track + CvTrack track = null; + int area = 0; + foreach (CvTrack t in tt) + { + int a = (t.MaxX - t.MinX)*(t.MaxY - t.MinY); + if (a > area) + { + area = a; + track = t; + } + } + + // Select blob + CvBlob blob = null; + area = 0; + foreach (CvBlob b in Values) + { + if (b.Area > area) + { + area = b.Area; + blob = b; + } + } + + if (blob == null || track == null) + //throw new Exception(); + continue; + + // Update track + track.Label = blob.Label; + track.Centroid = blob.Centroid; + track.MinX = blob.MinX; + track.MinY = blob.MinY; + track.MaxX = blob.MaxX; + track.MaxY = blob.MaxY; + if (track.Inactive != 0) + track.Active = 0; + track.Inactive = 0; + + // Others to inactive + foreach (CvTrack t in tt) + { + if (t != track) + { + //cout << "Inactive: track=" << t->id << endl; + t.Inactive++; + t.Label = 0; + } + } + } + } + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + int[] trackKeys = new int[tracks.Count]; + tracks.Keys.CopyTo(trackKeys, 0); + foreach (int tkey in trackKeys) + { + CvTrack t = tracks[tkey]; + if ((t.Inactive >= thInactive) || + ((t.Inactive != 0) && (thActive != 0) && (t.Active < thActive))) + { + tracks.Remove(tkey); + } + else + { + t.LifeTime++; + if (t.Inactive == 0) + t.Active++; + } + } + } + + private double DistantBlobTrack(CvBlob b, CvTrack t) + { + double d1; + if (b.Centroid.X < t.MinX) + { + if (b.Centroid.Y < t.MinY) + d1 = Math.Max(t.MinX - b.Centroid.X, t.MinY - b.Centroid.Y); + else if (b.Centroid.Y > t.MaxY) + d1 = Math.Max(t.MinX - b.Centroid.X, b.Centroid.Y - t.MaxY); + else // if (t.MinY < b.Centroid.Y)&&(b.Centroid.Y < t.MaxY) + d1 = t.MinX - b.Centroid.X; + } + else if (b.Centroid.X > t.MaxX) + { + if (b.Centroid.Y < t.MinY) + d1 = Math.Max(b.Centroid.X - t.MaxX, t.MinY - b.Centroid.Y); + else if (b.Centroid.Y > t.MaxY) + d1 = Math.Max(b.Centroid.X - t.MaxX, b.Centroid.Y - t.MaxY); + else + d1 = b.Centroid.X - t.MaxX; + } + else // if (t.MinX =< b.Centroid.X) && (b.Centroid.X =< t.MaxX) + { + if (b.Centroid.Y < t.MinY) + d1 = t.MinY - b.Centroid.Y; + else if (b.Centroid.Y > t.MaxY) + d1 = b.Centroid.Y - t.MaxY; + else + return 0.0; + } + + double d2; + if (t.Centroid.X < b.MinX) + { + if (t.Centroid.Y < b.MinY) + d2 = Math.Max(b.MinX - t.Centroid.X, b.MinY - t.Centroid.Y); + else if (t.Centroid.Y > b.MaxY) + d2 = Math.Max(b.MinX - t.Centroid.X, t.Centroid.Y - b.MaxY); + else // if (b.MinY < t.Centroid.Y)&&(t.Centroid.Y < b.MaxY) + d2 = b.MinX - t.Centroid.X; + } + else if (t.Centroid.X > b.MaxX) + { + if (t.Centroid.Y < b.MinY) + d2 = Math.Max(t.Centroid.X - b.MaxX, b.MinY - t.Centroid.Y); + else if (t.Centroid.Y > b.MaxY) + d2 = Math.Max(t.Centroid.X - b.MaxX, t.Centroid.Y - b.MaxY); + else + d2 = t.Centroid.X - b.MaxX; + } + else // if (b.MinX =< t.Centroid.X) && (t.Centroid.X =< b.MaxX) + { + if (t.Centroid.Y < b.MinY) + d2 = b.MinY - t.Centroid.Y; + else if (t.Centroid.Y > b.MaxY) + d2 = t.Centroid.Y - b.MaxY; + else + return 0.0; + } + + return Math.Min(d1, d2); + } + + private static void GetClusterForBlob(int blobPos, ProximityMatrix close, + int nBlobs, int nTracks, CvBlobs blobs, CvTracks tracks, + List bb, List tt) + { + retry: + var retryList = new List(); + + for (int j = 0; j < nTracks; j++) + { + if (close[blobPos, j] != 0) + { + int it = close.IT[j]; + tt.Add(tracks[it]); + + int c = close.AT[j]; + + close[blobPos, j] = 0; + close.AB[blobPos]--; + close.AT[j]--; + + if (c > 1) + { + retryList.Add(j); + //GetClusterForTrack(j, close, nBlobs, nTracks, blobs, tracks, bb, tt); + } + } + } + + if (retryList.Count > 0) + { + foreach (int j in retryList) + { + GetClusterForTrack(j, close, nBlobs, nTracks, blobs, tracks, bb, tt); + } + goto retry; + } + } + + private static void GetClusterForTrack(int trackPos, ProximityMatrix close, + int nBlobs, int nTracks, CvBlobs blobs, + CvTracks tracks, List bb, List tt) + { + retry: + var retryList = new List(); + + for (int i = 0; i < nBlobs; i++) + { + if (close[i, trackPos] != 0) + { + int ib = close.IB[i]; + bb.Add(blobs[ib]); + + int c = close.AB[i]; + + close[i, trackPos] = 0; + close.AB[i]--; + close.AT[trackPos]--; + + if (c > 1) + { + retryList.Add(i); + //GetClusterForBlob(i, close, nBlobs, nTracks, blobs, tracks, bb, tt); + } + } + } + + if (retryList.Count > 0) + { + foreach (int i in retryList) + { + GetClusterForBlob(i, close, nBlobs, nTracks, blobs, tracks, bb, tt); + } + goto retry; + } + } + + #endregion + + #endregion + + #region ICloneable + + /// + /// + /// + /// + public CvBlobs Clone() + { + var newBlobs = new CvBlobs(); + foreach (KeyValuePair pair in this) + { + newBlobs.Add(pair.Key, pair.Value); + } + newBlobs.Labels = Labels.Clone(); + + return newBlobs; + } + + object ICloneable.Clone() + { + return Clone(); + } + + #endregion + } +} diff --git a/src/OpenCvSharp.Blob/CvChainCode.cs b/src/OpenCvSharp.Blob/CvChainCode.cs new file mode 100644 index 000000000..f020817b7 --- /dev/null +++ b/src/OpenCvSharp.Blob/CvChainCode.cs @@ -0,0 +1,44 @@ + +#pragma warning disable 1591 + +namespace OpenCvSharp.Blob +{ + /// + /// Chain code (direction) + /// + public enum CvChainCode : byte + { + /// + /// Up. + /// + Up = CvBlobConst.CV_CHAINCODE_UP, + /// + /// Up and right. + /// + UpRight = CvBlobConst.CV_CHAINCODE_UP_RIGHT, + /// + /// Right. + /// + Right = CvBlobConst.CV_CHAINCODE_RIGHT, + /// + /// Down and right. + /// + DownRight = CvBlobConst.CV_CHAINCODE_DOWN_RIGHT, + /// + /// Down. + /// + Down = CvBlobConst.CV_CHAINCODE_DOWN, + /// + /// Down and left. + /// + DownLeft = CvBlobConst.CV_CHAINCODE_DOWN_LEFT, + /// + /// Left. + /// + Left = CvBlobConst.CV_CHAINCODE_LEFT, + /// + /// Up and left. + /// + UpLeft = CvBlobConst.CV_CHAINCODE_UP_LEFT, + } +} \ No newline at end of file diff --git a/src/OpenCvSharp.Blob/CvContourChainCode.cs b/src/OpenCvSharp.Blob/CvContourChainCode.cs new file mode 100644 index 000000000..7c43d9b44 --- /dev/null +++ b/src/OpenCvSharp.Blob/CvContourChainCode.cs @@ -0,0 +1,148 @@ +// Copyright (C) 2007 by Cristóbal Carnero Liñán +// grendel.ccl@gmail.com +// +// This file is part of cvBlob. +// +// cvBlob is free software: you can redistribute it and/or modify +// it under the terms of the Lesser GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// cvBlob is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// Lesser GNU General Public License for more details. +// +// You should have received a copy of the Lesser GNU General Public License +// along with cvBlob. If not, see . + +using System; +using System.Collections.Generic; + +namespace OpenCvSharp.Blob +{ + /// + /// + /// + public class CvContourChainCode : ICloneable + { + /// + /// Point where contour begin. + /// + public Point StartingPoint { get; set; } + + /// + /// Polygon description based on chain codes. + /// + public List ChainCode { get; set; } + + /// + /// + /// + public CvContourChainCode() + { + StartingPoint = default(Point); + ChainCode = new List(); + } + + /// + /// Convert a chain code contour to a polygon. + /// + /// A polygon. + public CvContourPolygon ConvertToPolygon() + { + CvContourPolygon contour = new CvContourPolygon(); + + int x = StartingPoint.X; + int y = StartingPoint.Y; + contour.Add(new Point(x, y)); + + if (ChainCode.Count > 0) + { + CvChainCode lastCode = ChainCode[0]; + x += CvBlobConst.ChainCodeMoves[(int) ChainCode[0]][0]; + y += CvBlobConst.ChainCodeMoves[(int) ChainCode[0]][1]; + for (int i = 1; i < ChainCode.Count; i++) + { + if (lastCode != ChainCode[i]) + { + contour.Add(new Point(x, y)); + lastCode = ChainCode[i]; + } + x += CvBlobConst.ChainCodeMoves[(int) ChainCode[i]][0]; + y += CvBlobConst.ChainCodeMoves[(int) ChainCode[i]][1]; + } + } + + return contour; + } + + /// + /// Calculates perimeter of a polygonal contour. + /// + /// Perimeter of the contour. + public double Perimeter() + { + double perimeter = 0.0; + foreach (CvChainCode cc in ChainCode) + { + int type = (int) cc; + if (type%2 != 0) + perimeter += Math.Sqrt(1.0 + 1.0); + else + perimeter += 1.0; + } + return perimeter; + } + + /// + /// Draw a contour. + /// + /// Image to draw on. + public void Render(Mat img) + { + Render(img, new Scalar(255, 255, 255)); + } + + /// + /// Draw a contour. + /// + /// Image to draw on. + /// Color to draw (default, white). + public void Render(Mat img, Scalar color) + { + if (img == null) + throw new ArgumentNullException("img"); + if (img.Type() != MatType.CV_8UC3) + throw new ArgumentException("Invalid img format (U8 3-channels)"); + + var indexer = img.GetGenericIndexer(); + int x = StartingPoint.X; + int y = StartingPoint.Y; + foreach (CvChainCode cc in ChainCode) + { + indexer[y, x] = new Vec3b((byte) color.Val0, (byte) color.Val1, (byte) color.Val2); + x += CvBlobConst.ChainCodeMoves[(int) cc][0]; + y += CvBlobConst.ChainCodeMoves[(int) cc][1]; + } + } + + /// + /// + /// + /// + public CvContourChainCode Clone() + { + return new CvContourChainCode + { + ChainCode = new List(ChainCode), + StartingPoint = StartingPoint, + }; + } + + object ICloneable.Clone() + { + return Clone(); + } + } +} diff --git a/src/OpenCvSharp.Blob/CvContourPolygon.cs b/src/OpenCvSharp.Blob/CvContourPolygon.cs new file mode 100644 index 000000000..a90772634 --- /dev/null +++ b/src/OpenCvSharp.Blob/CvContourPolygon.cs @@ -0,0 +1,423 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +// Copyright (C) 2007 by Cristóbal Carnero Liñán +// grendel.ccl@gmail.com +// +// This file is part of cvBlob. +// +// cvBlob is free software: you can redistribute it and/or modify +// it under the terms of the Lesser GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// cvBlob is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// Lesser GNU General Public License for more details. +// +// You should have received a copy of the Lesser GNU General Public License +// along with cvBlob. If not, see . + +namespace OpenCvSharp.Blob +{ + /// + /// Polygon based contour. + /// + public class CvContourPolygon : List + { + /// + /// + /// + public CvContourPolygon() + { + } + + /// + /// + /// + /// + public CvContourPolygon(IEnumerable list) + : base(list) + { + } + + /// + /// Converts this to CSV string + /// + /// + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + foreach (Point p in this) + { + sb.AppendFormat("{0},{1}", p.X, p.Y).AppendLine(); + } + return sb.ToString(); + } + + #region Area + + /// + /// Calculates area of a polygonal contour. + /// + /// Area of the contour. + public double Area() + { + if (Count <= 2) + return 1.0; + + Point lastPoint = this[Count - 1]; + double area = 0.0; + foreach (Point point in this) + { + area += lastPoint.X*point.Y - lastPoint.Y*point.X; + lastPoint = point; + } + return area*0.5; + } + + #endregion + + #region Circularity + + /// + /// Calculates the circularity of a polygon (compactness measure). + /// + /// Circularity: a non-negative value, where 0 correspond with a circumference. + public double Circularity() + { + double l = Perimeter(); + double c = (l*l/Area()) - 4.0*Math.PI; + + if (c >= 0.0) + return c; + // This could happen if the blob it's only a pixel: the perimeter will be 0. Another solution would be to force "cvContourPolygonPerimeter" to be 1 or greater. + return 0.0; + } + + #endregion + + #region ContourConvexHull + + /// + /// Calculates convex hull of a contour. + /// Uses the Melkman Algorithm. Code based on the version in http://w3.impa.br/~rdcastan/Cgeometry/. + /// + /// Convex hull. + public CvContourPolygon ContourConvexHull() + { + if (Count <= 3) + return new CvContourPolygon(this); + + var dq = new List(); // instead of std::deq... + + if (CrossProductPoints(this[0], this[1], this[2]) > 0) + { + dq.Add(this[0]); + dq.Add(this[1]); + } + else + { + dq.Add(this[1]); + dq.Add(this[0]); + } + + dq.Add(this[2]); + dq.Insert(0, this[2]); + + for (int i = 3; i < Count; i++) + { + int s = dq.Count; + + if ((CrossProductPoints(this[i], dq[0], dq[1]) >= 0) && + (CrossProductPoints(dq[s - 2], dq[s - 1], this[i]) >= 0)) + continue; // TODO Optimize. + + while (CrossProductPoints(dq[s - 2], dq[s - 1], this[i]) < 0) + { + dq.RemoveAt(dq.Count - 1); + s = dq.Count; + } + + dq.Add(this[i]); + + while (CrossProductPoints(this[i], dq[0], dq[1]) < 0) + dq.RemoveAt(0); + + dq.Insert(0, this[i]); + } + + return new CvContourPolygon(dq); + } + + private static double CrossProductPoints(Point a, Point b, Point c) + { + double abx = b.X - a.X; + double aby = b.Y - a.Y; + double acx = c.X - a.X; + double acy = c.Y - a.Y; + return abx*acy - aby*acx; + } + + #endregion + + #region ContourPolygonPerimeter + + /// + /// Calculates perimeter of a chain code contour. + /// + /// Perimeter of the contour. + public double Perimeter() + { + double perimeter = DistancePointPoint(this[Count - 1], this[0]); + for (int i = 0; i < Count - 1; i++) + { + perimeter += DistancePointPoint(this[i], this[i + 1]); + } + return perimeter; + } + + private static double DistancePointPoint(Point a, Point b) + { + double abx = a.X - b.X; + double aby = a.Y - b.Y; + return Math.Sqrt(abx*abx + aby*aby); + } + + #endregion + + #region Render + + /// + /// Draw a polygon. + /// + /// Image to draw on. + public void Render(Mat img) + { + Render(img, new Scalar(255, 255, 255)); + } + + /// + /// Draw a polygon. + /// + /// Image to draw on. + /// Color to draw (default, white). + public void Render(Mat img, Scalar color) + { + if (img == null) + throw new ArgumentNullException("img"); + if (img.Type() != MatType.CV_8UC3) + throw new ArgumentException("Invalid img format (U8 3-channels)"); + + if (Count == 0) + return; + + int fx = this[Count - 1].X; + int fy = this[Count - 1].Y; + foreach (Point p in this) + { + Cv2.Line(img, fx, fy, p.X, p.Y, color); + fx = p.X; + fy = p.Y; + } + } + + #endregion + + #region SimplifyPolygon + + /// + /// Simplify a polygon reducing the number of vertex according the distance "delta". + /// Uses a version of the Ramer-Douglas-Peucker algorithm (http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm). + /// + /// A simplify version of the original polygon. + public CvContourPolygon Simplify() + { + return Simplify(1.0); + } + + /// + /// Simplify a polygon reducing the number of vertex according the distance "delta". + /// Uses a version of the Ramer-Douglas-Peucker algorithm (http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm). + /// + /// Minimun distance. + /// A simplify version of the original polygon. + public CvContourPolygon Simplify(double delta) + { + double furtherDistance = 0.0; + int furtherIndex = 0; + + if (Count == 0) + return new CvContourPolygon(); + + for (int i = 1; i < Count; i++) + { + double d = DistancePointPoint(this[i], this[0]); + if (d > furtherDistance) + { + furtherDistance = d; + furtherIndex = i; + } + } + + if (furtherDistance < delta) + { + CvContourPolygon result = new CvContourPolygon(); + result.Add(this[0]); + return result; + } + else + { + bool[] pnUseFlag = new bool[Count]; + for (int i = 1; i < Count; i++) + pnUseFlag[i] = false; + + pnUseFlag[0] = pnUseFlag[furtherIndex] = true; + + SimplifyPolygonRecursive(this, 0, furtherIndex, pnUseFlag, delta); + SimplifyPolygonRecursive(this, furtherIndex, -1, pnUseFlag, delta); + + CvContourPolygon result = new CvContourPolygon(); + + for (int i = 0; i < Count; i++) + { + if (pnUseFlag[i]) + result.Add(this[i]); + } + return result; + } + } + + private static void SimplifyPolygonRecursive(CvContourPolygon p, int i1, int i2, bool[] pnUseFlag, double delta) + { + int endIndex = (i2 < 0) ? p.Count : i2; + + if (Math.Abs(i1 - endIndex) <= 1) + return; + + Point firstPoint = p[i1]; + Point lastPoint = (i2 < 0) ? p[0] : p[i2]; + + double furtherDistance = 0.0; + int furtherIndex = 0; + + for (int i = i1 + 1; i < endIndex; i++) + { + double d = DistanceLinePoint(firstPoint, lastPoint, p[i]); + + if ((d >= delta) && (d > furtherDistance)) + { + furtherDistance = d; + furtherIndex = i; + } + } + + if (furtherIndex > 0) + { + pnUseFlag[furtherIndex] = true; + + SimplifyPolygonRecursive(p, i1, furtherIndex, pnUseFlag, delta); + SimplifyPolygonRecursive(p, furtherIndex, i2, pnUseFlag, delta); + } + } + + private static double DistanceLinePoint(Point a, Point b, Point c, bool isSegment = true) + { + if (isSegment) + { + double dot1 = DotProductPoints(a, b, c); + if (dot1 > 0) return DistancePointPoint(b, c); + + double dot2 = DotProductPoints(b, a, c); + if (dot2 > 0) return DistancePointPoint(a, c); + } + return Math.Abs(CrossProductPoints(a, b, c)/DistancePointPoint(a, b)); + } + + private static double DotProductPoints(Point a, Point b, Point c) + { + double abx = b.X - a.X; + double aby = b.Y - a.Y; + double bcx = c.X - b.X; + double bcy = c.Y - b.Y; + return abx*bcx + aby*bcy; + } + + #endregion + + #region WriteAsCsv + + /// + /// Write a contour to a CSV (Comma-separated values) file. + /// + /// File name. + public void WriteAsCsv(string fileName) + { + using (StreamWriter writer = new StreamWriter(fileName, false)) + { + writer.Write(ToString()); + } + } + + #endregion + + #region WriteAsSvg + + /// + /// Write a contour to a SVG file. + /// + /// File name + public void WriteAsSvg(string fileName) + { + WriteAsSvg(fileName, Scalar.Black, Scalar.White); + } + + /// + /// Write a contour to a SVG file. + /// + /// File name + /// Stroke color + /// Fill color + public void WriteAsSvg(string fileName, Scalar stroke, Scalar fill) + { + int minx = Int32.MaxValue; + int miny = Int32.MaxValue; + int maxx = Int32.MinValue; + int maxy = Int32.MinValue; + + var buffer = new StringBuilder(); + foreach (Point p in this) + { + if (p.X > maxx) + maxx = p.X; + if (p.X < minx) + minx = p.X; + if (p.Y > maxy) + maxy = p.Y; + if (p.Y < miny) + miny = p.Y; + buffer.AppendFormat("{0},{1} ", p.X, p.Y); + } + + using (var writer = new StreamWriter(fileName, false)) + { + writer.WriteLine(""); + writer.WriteLine( + ""); + writer.WriteLine( + "", + maxx - minx, maxy - miny, minx, miny, maxx, maxy); + writer.WriteLine( + "", + fill.Val0, fill.Val1, fill.Val2, stroke.Val0, stroke.Val1, stroke.Val2, buffer); + writer.WriteLine(""); + } + } + + #endregion + } +} diff --git a/src/OpenCvSharp.Blob/CvTrack.cs b/src/OpenCvSharp.Blob/CvTrack.cs new file mode 100644 index 000000000..04fd0b242 --- /dev/null +++ b/src/OpenCvSharp.Blob/CvTrack.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.Text; + +// Copyright (C) 2007 by Cristóbal Carnero Liñán +// grendel.ccl@gmail.com +// +// This file is part of cvBlob. +// +// cvBlob is free software: you can redistribute it and/or modify +// it under the terms of the Lesser GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// cvBlob is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// Lesser GNU General Public License for more details. +// +// You should have received a copy of the Lesser GNU General Public License +// along with cvBlob. If not, see . + +namespace OpenCvSharp.Blob +{ + /// + /// Struct that contain information about one track. + /// + public class CvTrack + { + /// + /// Track identification number. + /// + public int Id { get; set; } + + /// + /// Label assigned to the blob related to this track. + /// + public int Label { get; set; } + + /// + /// X min. + /// + public int MinX { get; set; } + /// + /// X max. + /// + public int MaxX { get; set; } + /// + /// Y min. + /// + public int MinY { get; set; } + /// + /// Y max. + /// + public int MaxY { get; set; } + + /// + /// Centroid. + /// + public Point2d Centroid { get; set; } + + /// + /// Indicates how much frames the object has been in scene. + /// + public int LifeTime { get; set; } + /// + /// Indicates number of frames that has been active from last inactive period. + /// + public int Active { get; set; } + /// + /// Indicates number of frames that has been missing. + /// + public int Inactive { get; set; } + } +} diff --git a/src/OpenCvSharp.Blob/CvTracks.cs b/src/OpenCvSharp.Blob/CvTracks.cs new file mode 100644 index 000000000..592d80850 --- /dev/null +++ b/src/OpenCvSharp.Blob/CvTracks.cs @@ -0,0 +1,146 @@ +using System; +using System.Collections.Generic; +using System.Text; + +// Copyright (C) 2007 by Cristóbal Carnero Liñán +// grendel.ccl@gmail.com +// +// This file is part of cvBlob. +// +// cvBlob is free software: you can redistribute it and/or modify +// it under the terms of the Lesser GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// cvBlob is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// Lesser GNU General Public License for more details. +// +// You should have received a copy of the Lesser GNU General Public License +// along with cvBlob. If not, see . + +namespace OpenCvSharp.Blob +{ + /// + /// + /// + public class CvTracks : Dictionary + { + /// + /// + /// + public CvTracks() + { + } + + #region Render + + /// + /// Prints tracks information. + /// + /// Input image (depth=IPL_DEPTH_8U and num. channels=3). + /// Output image (depth=IPL_DEPTH_8U and num. channels=3). + public void Render(Mat imgSource, Mat imgDest) + { + Render(imgSource, imgDest, RenderTracksMode.Id, Scalar.Green); + } + + /// + /// Prints tracks information. + /// + /// Input image (depth=IPL_DEPTH_8U and num. channels=3). + /// Output image (depth=IPL_DEPTH_8U and num. channels=3). + /// Render mode. By default is CV_TRACK_RENDER_ID. + public void Render(Mat imgSource, Mat imgDest, RenderTracksMode mode) + { + Render(imgSource, imgDest, mode, Scalar.Green); + } + + /// + /// Prints tracks information. + /// + /// Input image (depth=IPL_DEPTH_8U and num. channels=3). + /// Output image (depth=IPL_DEPTH_8U and num. channels=3). + /// Render mode. By default is CV_TRACK_RENDER_ID. + /// + /// + /// + /// + public void Render(Mat imgSource, Mat imgDest, RenderTracksMode mode, Scalar textColor, + HersheyFonts fontFace = HersheyFonts.HersheySimplex, double fontScale = 1d, int thickness = 1) + { + if (imgSource == null) + throw new ArgumentNullException("imgSource"); + if (imgDest == null) + throw new ArgumentNullException("imgDest"); + if (imgDest.Type() != MatType.CV_8UC3) + throw new ArgumentException("imgDest.Depth != U8 || imgDest.NChannels != 3"); + + if (mode != RenderTracksMode.None) + { + foreach (KeyValuePair kv in this) + { + int key = kv.Key; + CvTrack value = kv.Value; + + if ((mode & RenderTracksMode.Id) == RenderTracksMode.Id) + { + if (value.Inactive == 0) + { + Cv2.PutText(imgDest, key.ToString(), value.Centroid, + fontFace, fontScale, textColor, thickness); + } + } + if ((mode & RenderTracksMode.BoundingBox) == RenderTracksMode.BoundingBox) + { + if (value.Inactive > 0) + Cv2.Rectangle( + imgDest, + new Point(value.MinX, value.MinY), + new Point(value.MaxX - 1, value.MaxY - 1), + new Scalar(50, 0, 0)); + else + Cv2.Rectangle( + imgDest, + new Point(value.MinX, value.MinY), + new Point(value.MaxX - 1, value.MaxY - 1), + new Scalar(255, 0, 0)); + } + } + } + } + + #endregion + + #region ToString + + /// + /// + /// + /// + public override string ToString() + { + StringBuilder builder = new StringBuilder(); + foreach (KeyValuePair kv in this) + { + CvTrack value = kv.Value; + + builder.AppendFormat("Track {0}", value).AppendLine(); + if (value.Inactive > 0) + builder.AppendFormat(" - Inactive for {0} frames", value.Inactive).AppendLine(); + else + builder.AppendFormat(" - Associated with blobs {0}", value.Label).AppendLine(); + builder.AppendFormat(" - Lifetime {0}", value.LifeTime).AppendLine(); + builder.AppendFormat(" - Active {0}", value.Active).AppendLine(); + builder.AppendFormat(" - Bounding box: ({0},{1}) - ({2}, {3})", + value.MinX, value.MinY, value.MaxX, value.MaxY).AppendLine(); + builder.AppendFormat(" - Centroid: ({0}, {1})", value.Centroid.X, value.Centroid.Y).AppendLine(); + builder.AppendLine(); + } + return builder.ToString(); + } + + #endregion + } +} \ No newline at end of file diff --git a/src/OpenCvSharp.Blob/Key.snk b/src/OpenCvSharp.Blob/Key.snk new file mode 100644 index 000000000..a1e033087 Binary files /dev/null and b/src/OpenCvSharp.Blob/Key.snk differ diff --git a/src/OpenCvSharp.Blob/LabelData.cs b/src/OpenCvSharp.Blob/LabelData.cs new file mode 100644 index 000000000..69b7ee6bf --- /dev/null +++ b/src/OpenCvSharp.Blob/LabelData.cs @@ -0,0 +1,145 @@ +using System; + +namespace OpenCvSharp.Blob +{ + /// + /// Label values for each pixel + /// + public class LabelData : ICloneable + { + private Size size; + private int[,] values; + + /// + /// Label value + /// + public int[,] Values + { + get { return values; } + } + + /// + /// Image sizw + /// + public Size Size + { + get { return size; } + } + + /// + /// Row length + /// + public int Rows + { + get { return Values.GetLength(0); } + } + + /// + /// Column Length + /// + public int Cols + { + get { return Values.GetLength(1); } + } + + /// + /// + /// + /// + /// + public LabelData(int rows, int cols) + { + values = new int[rows, cols]; + size = new Size(cols, rows); + } + + /// + /// + /// + /// + public LabelData(int[,] values) + { + values = (int[,]) values.Clone(); + size.Height = values.GetLength(0); + size.Width = values.GetLength(1); + } + + /// + /// + /// + /// + /// + public LabelData(int[,] values, Rect roi) + { + values = (int[,]) values.Clone(); + } + + /// + /// + /// + /// + /// + /// + public int RawGetLabel(int row, int col) + { + return Values[row, col]; + } + + /// + /// + /// + /// + /// + /// + public void RawSetLabel(int row, int col, int value) + { + Values[row, col] = value; + } + + /// + /// + /// + /// + /// + /// + public int this[int row, int col] + { + get { return Values[row, col]; } + set { Values[row, col] = value; } + } + + /// + /// + /// + public void DebugShow() + { + using (Mat img = Mat.Zeros(Rows, Cols, MatType.CV_8UC1)) + { + var indexer = img.GetGenericIndexer(); + for (int r = 0; r < Rows; r++) + { + for (int c = 0; c < Cols; c++) + { + if (Values[r, c] != 0) + indexer[r, c] = 255; + } + } + Window.ShowImages(img); + } + } + + /// + /// Returns deep copied instance of this + /// + /// + public LabelData Clone() + { + return new LabelData((int[,]) Values.Clone()); + } + + object ICloneable.Clone() + { + return Clone(); + } + } +} diff --git a/src/OpenCvSharp.Blob/Labeller.cs b/src/OpenCvSharp.Blob/Labeller.cs new file mode 100644 index 000000000..c7ca28221 --- /dev/null +++ b/src/OpenCvSharp.Blob/Labeller.cs @@ -0,0 +1,360 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.InteropServices; +using System.Text; + +// Copyright (C) 2007 by Cristóbal Carnero Liñán +// grendel.ccl@gmail.com +// +// This file is part of cvBlob. +// +// cvBlob is free software: you can redistribute it and/or modify +// it under the terms of the Lesser GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// cvBlob is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// Lesser GNU General Public License for more details. +// +// You should have received a copy of the Lesser GNU General Public License +// along with cvBlob. If not, see . + +namespace OpenCvSharp.Blob +{ + /// + /// + /// + internal static class Labeller + { + private static readonly int[,,] MovesE = new int[4, 3, 4] + { + { + {-1, -1, 3, CvBlobConst.CV_CHAINCODE_UP_LEFT}, {0, -1, 0, CvBlobConst.CV_CHAINCODE_UP}, + {1, -1, 0, CvBlobConst.CV_CHAINCODE_UP_RIGHT} + }, + { + {1, -1, 0, CvBlobConst.CV_CHAINCODE_UP_RIGHT}, {1, 0, 1, CvBlobConst.CV_CHAINCODE_RIGHT}, + {1, 1, 1, CvBlobConst.CV_CHAINCODE_DOWN_RIGHT} + }, + { + {1, 1, 1, CvBlobConst.CV_CHAINCODE_DOWN_RIGHT}, {0, 1, 2, CvBlobConst.CV_CHAINCODE_DOWN}, + {-1, 1, 2, CvBlobConst.CV_CHAINCODE_DOWN_LEFT} + }, + { + {-1, 1, 2, CvBlobConst.CV_CHAINCODE_DOWN_LEFT}, {-1, 0, 3, CvBlobConst.CV_CHAINCODE_LEFT}, + {-1, -1, 3, CvBlobConst.CV_CHAINCODE_UP_LEFT} + } + }; + + private static readonly int[,,] MovesI = new int[4, 3, 4] + { + { + {1, -1, 3, CvBlobConst.CV_CHAINCODE_UP_RIGHT}, {0, -1, 0, CvBlobConst.CV_CHAINCODE_UP}, + {-1, -1, 0, CvBlobConst.CV_CHAINCODE_UP_LEFT} + }, + { + {-1, -1, 0, CvBlobConst.CV_CHAINCODE_UP_LEFT}, {-1, 0, 1, CvBlobConst.CV_CHAINCODE_LEFT}, + {-1, 1, 1, CvBlobConst.CV_CHAINCODE_DOWN_LEFT} + }, + { + {-1, 1, 1, CvBlobConst.CV_CHAINCODE_DOWN_LEFT}, {0, 1, 2, CvBlobConst.CV_CHAINCODE_DOWN}, + {1, 1, 2, CvBlobConst.CV_CHAINCODE_DOWN_RIGHT} + }, + { + {1, 1, 2, CvBlobConst.CV_CHAINCODE_DOWN_RIGHT}, {1, 0, 3, CvBlobConst.CV_CHAINCODE_RIGHT}, + {1, -1, 3, CvBlobConst.CV_CHAINCODE_UP_RIGHT} + } + }; + + /// + /// Value of invalid pixel. + /// -1 == uint.MaxValue + /// + private const int MarkerValue = -1; + + /// + /// + /// + /// + /// + /// + public static int Perform(Mat img, CvBlobs blobs) + { + if (img == null) + throw new ArgumentNullException("img"); + if (blobs == null) + throw new ArgumentNullException("blobs"); + if (img.Type() != MatType.CV_8UC1) + throw new ArgumentException("'img' must be a 1-channel U8 image."); + + LabelData labels = blobs.Labels; + if (labels == null) + throw new ArgumentException(""); + //if(labels.GetLength(0) != h || labels.GetLength(1) != w) + if (labels.Rows != img.Height || labels.Cols != img.Width) + throw new ArgumentException("img.Size != labels' size"); + + int numPixels = 0; + blobs.Clear(); + + int w = img.Cols; + int h = img.Rows; + int step = (int)img.Step(); + byte[] imgIn; + unsafe + { + byte* imgInPtr = (byte*)img.Data; + if ((long) h * step > Int32.MaxValue) + throw new ArgumentException("Too big image (image data > 2^31)"); + int length = h * step; + imgIn = new byte[length]; + Marshal.Copy(new IntPtr(imgInPtr), imgIn, 0, imgIn.Length); + } + int label = 0; + int lastLabel = 0; + CvBlob lastBlob = null; + + + for (int y = 0; y < h; y++) + { + for (int x = 0; x < w; x++) + { + if (imgIn[x + y * step] == 0) + continue; + + bool labeled = labels[y, x] != 0; + if (!labeled && ((y == 0) || (imgIn[x + (y - 1) * step] == 0))) + { + labeled = true; + + // Label contour. + label++; + if (label == MarkerValue) + throw new Exception(); + + labels[y, x] = label; + numPixels++; + + // XXX This is not necessary at all. I only do this for consistency. + if (y > 0) + labels[y - 1, x] = MarkerValue; + + CvBlob blob = new CvBlob(label, x, y); + blobs.Add(label, blob); + lastLabel = label; + lastBlob = blob; + + blob.Contour.StartingPoint = new Point(x, y); + int direction = 1; + int xx = x; + int yy = y; + bool contourEnd = false; + + do + { + for (int numAttempts = 0; numAttempts < 3; numAttempts++) + { + bool found = false; + for (int i = 0; i < 3; i++) + { + int nx = xx + MovesE[direction, i, 0]; + int ny = yy + MovesE[direction, i, 1]; + if ((nx < w) && (nx >= 0) && (ny < h) && (ny >= 0)) + { + if (imgIn[nx + ny * step] != 0) + { + found = true; + blob.Contour.ChainCode.Add((CvChainCode)MovesE[direction, i, 3]); + xx = nx; + yy = ny; + direction = MovesE[direction, i, 2]; + break; + } + labels[ny, nx] = MarkerValue; + } + } + + if (!found) + direction = (direction + 1) % 4; + else + { + if (labels[yy, xx] != label) + { + labels[yy, xx] = label; + numPixels++; + + if (xx < blob.MinX) + blob.MinX = xx; + else if (xx > blob.MaxX) + blob.MaxX = xx; + if (yy < blob.MinY) + blob.MinY = yy; + else if (yy > blob.MaxY) + blob.MaxY = yy; + + blob.Area++; + blob.M10 += xx; + blob.M01 += yy; + blob.M11 += xx * yy; + blob.M20 += xx * xx; + blob.M02 += yy * yy; + } + break; + } + + contourEnd = ((xx == x) && (yy == y) && (direction == 1)); + if (contourEnd) + break; + } + } while (!contourEnd); + + } + + if ((y + 1 < h) && (imgIn[x + (y + 1) * step] == 0) && (labels[y + 1, x] == 0)) + { + labeled = true; + + // Label internal contour + int l; + CvBlob blob; + + if (labels[y, x] == 0) + { + l = labels[y, x - 1]; + labels[y, x] = l; + numPixels++; + + if (l == lastLabel) + blob = lastBlob; + else + { + blob = blobs[l]; + lastLabel = l; + lastBlob = blob; + } + if (blob == null) + throw new Exception(); + blob.Area++; + blob.M10 += x; + blob.M01 += y; + blob.M11 += x * y; + blob.M20 += x * x; + blob.M02 += y * y; + } + else + { + l = labels[y, x]; + if (l == lastLabel) + blob = lastBlob; + else + { + blob = blobs[l]; + lastLabel = l; + lastBlob = blob; + } + } + + if (blob == null) + throw new Exception(); + + // XXX This is not necessary (I believe). I only do this for consistency. + labels[y + 1, x] = MarkerValue; + var contour = new CvContourChainCode + { + StartingPoint = new Point(x, y) + }; + + int direction = 3; + int xx = x; + int yy = y; + + do + { + for (int numAttempts = 0; numAttempts < 3; numAttempts++) + { + bool found = false; + + for (int i = 0; i < 3; i++) + { + int nx = xx + MovesI[direction, i, 0]; + int ny = yy + MovesI[direction, i, 1]; + if (imgIn[nx + ny * step] != 0) + { + found = true; + contour.ChainCode.Add((CvChainCode)MovesI[direction, i, 3]); + xx = nx; + yy = ny; + direction = MovesI[direction, i, 2]; + break; + } + labels[ny, nx] = MarkerValue; + } + + if (!found) + direction = (direction + 1) % 4; + else + { + if (labels[yy, xx] == 0) + { + labels[yy, xx] = l; + numPixels++; + + blob.Area++; + blob.M10 += xx; + blob.M01 += yy; + blob.M11 += xx * yy; + blob.M20 += xx * xx; + blob.M02 += yy * yy; + } + break; + } + } + } while (!(xx == x && yy == y)); + + blob.InternalContours.Add(contour); + } + + //else if (!imageOut(x, y)) + if (!labeled) + { + // Internal pixel + int l = labels[y, x - 1]; + labels[y, x] = l; + numPixels++; + + CvBlob blob; + if (l == lastLabel) + blob = lastBlob; + else + { + blob = blobs[l]; + lastLabel = l; + lastBlob = blob; + } + if (blob == null) + throw new Exception(); + blob.Area++; + blob.M10 += x; + blob.M01 += y; + blob.M11 += x * y; + blob.M20 += x * x; + blob.M02 += y * y; + } + } + } + + + foreach (var kv in blobs) + { + kv.Value.SetMoments(); + } + + GC.KeepAlive(img); + + return numPixels; + } + } +} diff --git a/src/OpenCvSharp.Blob/OpenCvSharp.Blob.csproj b/src/OpenCvSharp.Blob/OpenCvSharp.Blob.csproj new file mode 100644 index 000000000..803b2a38b --- /dev/null +++ b/src/OpenCvSharp.Blob/OpenCvSharp.Blob.csproj @@ -0,0 +1,102 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {383AE960-7F56-47A4-BFF2-B2B81B6A49B5} + Library + Properties + OpenCvSharp.Blob + OpenCvSharp.Blob + v2.0 + 512 + + + 3.5 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + bin\Release\OpenCvSharp.Blob.XML + + + bin\Release JP\ + true + true + bin\Release JP\OpenCvSharp.Blob.XML + + + true + + + Key.snk + + + + + + + + + + + + + + + + + + + + + + Always + + + + + + + + + PreserveNewest + + + + + {524cc7b4-75b9-4925-9da4-3dacd40f4814} + OpenCvSharp + + + + + + + + + \ No newline at end of file diff --git a/src/OpenCvSharp.Blob/OpenCvSharp.Blob.dll.config b/src/OpenCvSharp.Blob/OpenCvSharp.Blob.dll.config new file mode 100644 index 000000000..095f0d9e2 --- /dev/null +++ b/src/OpenCvSharp.Blob/OpenCvSharp.Blob.dll.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/OpenCvSharp.Blob/Properties/AssemblyInfo.cs b/src/OpenCvSharp.Blob/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..098cf84db --- /dev/null +++ b/src/OpenCvSharp.Blob/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 +// アセンブリに関連付けられている情報を変更するには、 +// これらの属性値を変更してください。 +[assembly: AssemblyTitle("OpenCvSharp.Blob")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OpenCvSharp.Blob")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから +// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 +// その型の ComVisible 属性を true に設定してください。 +[assembly: ComVisible(false)] + +// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です +[assembly: Guid("edeaf40e-4bc9-4a8b-94b7-0ee20209198f")] + +// アセンブリのバージョン情報は、以下の 4 つの値で構成されています: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を +// 既定値にすることができます: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/OpenCvSharp.Blob/ProximityMatrix.cs b/src/OpenCvSharp.Blob/ProximityMatrix.cs new file mode 100644 index 000000000..686eda344 --- /dev/null +++ b/src/OpenCvSharp.Blob/ProximityMatrix.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp.Blob +{ + internal class ProximityMatrix + { + private readonly int[] close; + private readonly int nBlobs; + private readonly int nTtacks; + + public ProximityMatrix(int nBlobs, int nTracks) + { + this.nBlobs = nBlobs; + this.nTtacks = nTracks; + this.close = new int[(nBlobs + 2) * (nTracks + 2)]; + AB = new ABIndexer(this); + AT = new ATIndexer(this); + IB = new IBIndexer(this); + IT = new ITIndexer(this); + } + + public int this[int blob, int track] + { + get + { + return close[((blob) + (track) * (nBlobs + 2))]; + } + set + { + close[((blob) + (track) * (nBlobs + 2))] = value; + } + } + + #region Indexer + public abstract class Indexer + { + protected ProximityMatrix matrix; + protected Indexer(ProximityMatrix matrix) + { + this.matrix = matrix; + } + public abstract int this[int index] { get; set; } + } + public class ABIndexer : Indexer + { + internal ABIndexer(ProximityMatrix matrix) + : base(matrix) + { + } + public override int this[int label] + { + get { return matrix[label, matrix.nTtacks]; } + set { matrix[label, matrix.nTtacks] = value; } + } + } + public class ATIndexer : Indexer + { + internal ATIndexer(ProximityMatrix matrix) + : base(matrix) + { + } + public override int this[int id] + { + get { return matrix[matrix.nBlobs, id]; } + set { matrix[matrix.nBlobs, id] = value; } + } + } + public class IBIndexer : Indexer + { + internal IBIndexer(ProximityMatrix matrix) + : base(matrix) + { + } + public override int this[int label] + { + get { return matrix[label, matrix.nTtacks + 1]; } + set { matrix[label, matrix.nTtacks + 1] = value; } + } + } + public class ITIndexer : Indexer + { + internal ITIndexer(ProximityMatrix matrix) + : base(matrix) + { + } + public override int this[int id] + { + get { return matrix[matrix.nBlobs + 1, id]; } + set { matrix[matrix.nBlobs + 1, id] = value; } + } + } + + public ABIndexer AB { get; private set; } + public ATIndexer AT { get; private set; } + public IBIndexer IB { get; private set; } + public ITIndexer IT { get; private set; } + #endregion + } +} diff --git a/src/OpenCvSharp.Blob/ReadMe.txt b/src/OpenCvSharp.Blob/ReadMe.txt new file mode 100644 index 000000000..0c8268a9d --- /dev/null +++ b/src/OpenCvSharp.Blob/ReadMe.txt @@ -0,0 +1,3 @@ +This project "OpenCvSharp.Blob" is a wrapper of cvblob (http://code.google.com/p/cvblob/). + +cvblob and OpenCvSharp are licensed using the LGPL (http://www.gnu.org/licenses/lgpl.html). diff --git a/src/OpenCvSharp.Blob/RenderBlobsMode.cs b/src/OpenCvSharp.Blob/RenderBlobsMode.cs new file mode 100644 index 000000000..5425fd4e9 --- /dev/null +++ b/src/OpenCvSharp.Blob/RenderBlobsMode.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp.Blob +{ + /// + /// Render mode of cvRenderBlobs + /// + [Flags] + public enum RenderBlobsMode : ushort + { + /// + /// No flags (=0) + /// + None = 0, + + /// + /// Render each blog with a different color. + /// [CV_BLOB_RENDER_COLOR] + /// + Color = CvBlobConst.CV_BLOB_RENDER_COLOR, + + /// + /// Render centroid. + /// CV_BLOB_RENDER_CENTROID] + /// + Centroid = CvBlobConst.CV_BLOB_RENDER_CENTROID, + + /// + /// Render bounding box. + /// [CV_BLOB_RENDER_BOUNDING_BOX] + /// + BoundingBox = CvBlobConst.CV_BLOB_RENDER_BOUNDING_BOX, + + /// + /// Render angle. + /// [CV_BLOB_RENDER_ANGLE] + /// + Angle = CvBlobConst.CV_BLOB_RENDER_ANGLE, + + /// + /// Print blob data to log out. + /// [CV_BLOB_RENDER_TO_LOG] + /// + ToLog = CvBlobConst.CV_BLOB_RENDER_TO_LOG, + + /// + /// Print blob data to std out. + /// [CV_BLOB_RENDER_TO_STD] + /// + ToStd = CvBlobConst.CV_BLOB_RENDER_TO_STD, + } +} diff --git a/src/OpenCvSharp.Blob/RenderTracksMode.cs b/src/OpenCvSharp.Blob/RenderTracksMode.cs new file mode 100644 index 000000000..67fb9357b --- /dev/null +++ b/src/OpenCvSharp.Blob/RenderTracksMode.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp.Blob +{ + /// + /// Render mode of cvRenderTracks + /// + [Flags] + public enum RenderTracksMode : ushort + { + /// + /// No flags + /// [0] + /// + None = 0, + + /// + /// Print the ID of each track in the image. + /// [CV_TRACK_RENDER_ID] + /// + Id = CvBlobConst.CV_TRACK_RENDER_ID, + + /// + /// Draw bounding box of each track in the image. \see cvRenderTracks + /// [CV_TRACK_RENDER_BOUNDING_BOX] + /// + BoundingBox = CvBlobConst.CV_TRACK_RENDER_BOUNDING_BOX, + } +} diff --git a/src/OpenCvSharp.DebuggerVisualizers2010/ImageViewer.Designer.cs b/src/OpenCvSharp.DebuggerVisualizers2010/ImageViewer.Designer.cs new file mode 100644 index 000000000..35deb5435 --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2010/ImageViewer.Designer.cs @@ -0,0 +1,69 @@ +namespace OpenCvSharp.DebuggerVisualizers2010 +{ + partial class ImageViewer + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.pictureBox = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); + this.SuspendLayout(); + // + // pictureBox + // + this.pictureBox.BackColor = System.Drawing.Color.Black; + this.pictureBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.pictureBox.Location = new System.Drawing.Point(0, 0); + this.pictureBox.Name = "pictureBox"; + this.pictureBox.Size = new System.Drawing.Size(384, 263); + this.pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox.TabIndex = 0; + this.pictureBox.TabStop = false; + // + // ImageViewer + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(384, 263); + this.Controls.Add(this.pictureBox); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ImageViewer"; + this.Text = "ImageViewer"; + ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.PictureBox pictureBox; + + + } +} \ No newline at end of file diff --git a/src/OpenCvSharp.DebuggerVisualizers2010/ImageViewer.cs b/src/OpenCvSharp.DebuggerVisualizers2010/ImageViewer.cs new file mode 100644 index 000000000..ca7186a3a --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2010/ImageViewer.cs @@ -0,0 +1,66 @@ +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace OpenCvSharp.DebuggerVisualizers2010 +{ + /// + /// Matを表示するビューア + /// + public partial class ImageViewer : Form + { + private readonly Bitmap bitmap; + + /// + /// + /// + public ImageViewer() + { + InitializeComponent(); + } + + /// + /// + /// + /// + public ImageViewer(MatProxy proxy) + : this() + { + bitmap = new Bitmap(proxy.CreateBitmapStream()); + } + + /// + /// + /// + /// + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + + SetClientSize(new System.Drawing.Size(bitmap.Width, bitmap.Height)); + pictureBox.Image = bitmap; + } + + /// + /// ClientSizeを画面からはみ出ない大きさに調整して設定する. + /// + /// + private void SetClientSize(System.Drawing.Size size) + { + var screenSize = Screen.PrimaryScreen.Bounds.Size; + if (size.Width > screenSize.Width) + { + double ratio = (double) screenSize.Width/size.Width; + size.Width = Convert.ToInt32(size.Width*ratio); + size.Height = Convert.ToInt32(size.Height*ratio); + } + if (size.Height > screenSize.Height) + { + double ratio = (double) screenSize.Height/size.Height; + size.Width = Convert.ToInt32(size.Width*ratio); + size.Height = Convert.ToInt32(size.Height*ratio); + } + ClientSize = size; + } + } +} diff --git a/src/OpenCvSharp.DebuggerVisualizers2010/ImageViewer.resx b/src/OpenCvSharp.DebuggerVisualizers2010/ImageViewer.resx new file mode 100644 index 000000000..19dc0dd8b --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2010/ImageViewer.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/OpenCvSharp.DebuggerVisualizers2010/Key.snk b/src/OpenCvSharp.DebuggerVisualizers2010/Key.snk new file mode 100644 index 000000000..370daac05 Binary files /dev/null and b/src/OpenCvSharp.DebuggerVisualizers2010/Key.snk differ diff --git a/src/OpenCvSharp.DebuggerVisualizers2010/MatDebuggerVisualizer.cs b/src/OpenCvSharp.DebuggerVisualizers2010/MatDebuggerVisualizer.cs new file mode 100644 index 000000000..e34141793 --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2010/MatDebuggerVisualizer.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text; +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; +using Microsoft.VisualStudio.DebuggerVisualizers; + +namespace OpenCvSharp.DebuggerVisualizers2010 +{ + /// + /// ビジュアライザでの視覚化処理 + /// + public class MatDebuggerVisualizer : DialogDebuggerVisualizer + { + protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) + { + // MatProxyが送られてくるはず + using (var proxy = objectProvider.GetObject() as MatProxy) + { + if (proxy == null) + { + throw new ArgumentException(); + } + // Formに表示 + using (var form = new ImageViewer(proxy)) + { + windowService.ShowDialog(form); + } + } + } + } + + /// + /// シリアライズ処理 + /// + public class MatObjectSource : VisualizerObjectSource + { + public override void GetData(object target, Stream outgoingData) + { + var bf = new BinaryFormatter(); + bf.Serialize(outgoingData, new MatProxy((Mat)target)); + } + } +} diff --git a/src/OpenCvSharp.DebuggerVisualizers2010/OpenCvSharp.DebuggerVisualizers2010.csproj b/src/OpenCvSharp.DebuggerVisualizers2010/OpenCvSharp.DebuggerVisualizers2010.csproj new file mode 100644 index 000000000..b18ad6280 --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2010/OpenCvSharp.DebuggerVisualizers2010.csproj @@ -0,0 +1,78 @@ + + + + + Debug + AnyCPU + {B760EBB0-4EC9-4904-9449-DF9FC6FE4E2A} + Library + Properties + OpenCvSharp.DebuggerVisualizers2010 + OpenCvSharp.DebuggerVisualizers + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + + + Key.snk + + + + + + + + + + + + Form + + + ImageViewer.cs + + + + + + + ImageViewer.cs + + + + + + + + {524cc7b4-75b9-4925-9da4-3dacd40f4814} + OpenCvSharp + + + + + \ No newline at end of file diff --git a/src/OpenCvSharp.DebuggerVisualizers2010/Properties/AssemblyInfo.cs b/src/OpenCvSharp.DebuggerVisualizers2010/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..29534ba15 --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2010/Properties/AssemblyInfo.cs @@ -0,0 +1,46 @@ +using System.Diagnostics; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 +// アセンブリに関連付けられている情報を変更するには、 +// これらの属性値を変更してください。 +[assembly: AssemblyTitle("OpenCvSharp.DebuggerVisualizers2010")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OpenCvSharp.DebuggerVisualizers2010")] +[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから +// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 +// その型の ComVisible 属性を true に設定してください。 +[assembly: ComVisible(false)] + +// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です +[assembly: Guid("7303d66b-f227-427b-957f-22892057d5df")] + +// アセンブリのバージョン情報は、以下の 4 つの値で構成されています: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を +// 既定値にすることができます: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] + + +// OpenCvSharp objects' debugger visualizer +[assembly: DebuggerVisualizer( + typeof(OpenCvSharp.DebuggerVisualizers2010.MatDebuggerVisualizer), + typeof(OpenCvSharp.DebuggerVisualizers2010.MatObjectSource), + Target = typeof(OpenCvSharp.Mat), + Description = "Mat View Visualizer" +)] \ No newline at end of file diff --git a/src/OpenCvSharp.DebuggerVisualizers2012/ImageViewer.Designer.cs b/src/OpenCvSharp.DebuggerVisualizers2012/ImageViewer.Designer.cs new file mode 100644 index 000000000..76197e374 --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2012/ImageViewer.Designer.cs @@ -0,0 +1,69 @@ +namespace OpenCvSharp.DebuggerVisualizers2012 +{ + partial class ImageViewer + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.pictureBox = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); + this.SuspendLayout(); + // + // pictureBox + // + this.pictureBox.BackColor = System.Drawing.Color.Black; + this.pictureBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.pictureBox.Location = new System.Drawing.Point(0, 0); + this.pictureBox.Name = "pictureBox"; + this.pictureBox.Size = new System.Drawing.Size(384, 263); + this.pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox.TabIndex = 0; + this.pictureBox.TabStop = false; + // + // ImageViewer + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(384, 263); + this.Controls.Add(this.pictureBox); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ImageViewer"; + this.Text = "ImageViewer"; + ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.PictureBox pictureBox; + + + } +} \ No newline at end of file diff --git a/src/OpenCvSharp.DebuggerVisualizers2012/ImageViewer.cs b/src/OpenCvSharp.DebuggerVisualizers2012/ImageViewer.cs new file mode 100644 index 000000000..8e7ed2602 --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2012/ImageViewer.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace OpenCvSharp.DebuggerVisualizers2012 +{ + /// + /// IplImageを表示するビューア + /// + public partial class ImageViewer : Form + { + private readonly Bitmap bitmap; + + /// + /// + /// + public ImageViewer() + { + InitializeComponent(); + } + + /// + /// + /// + /// + public ImageViewer(MatProxy proxy) + : this() + { + bitmap = new Bitmap(proxy.CreateBitmapStream()); + } + + /// + /// + /// + /// + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + + SetClientSize(new System.Drawing.Size(bitmap.Width, bitmap.Height)); + pictureBox.Image = bitmap; + } + + /// + /// ClientSizeを画面からはみ出ない大きさに調整して設定する. + /// + /// + private void SetClientSize(System.Drawing.Size size) + { + var screenSize = Screen.PrimaryScreen.Bounds.Size; + if (size.Width > screenSize.Width) + { + double ratio = (double) screenSize.Width/size.Width; + size.Width = Convert.ToInt32(size.Width*ratio); + size.Height = Convert.ToInt32(size.Height*ratio); + } + if (size.Height > screenSize.Height) + { + double ratio = (double) screenSize.Height/size.Height; + size.Width = Convert.ToInt32(size.Width*ratio); + size.Height = Convert.ToInt32(size.Height*ratio); + } + ClientSize = size; + } + } +} diff --git a/src/OpenCvSharp.DebuggerVisualizers2012/ImageViewer.resx b/src/OpenCvSharp.DebuggerVisualizers2012/ImageViewer.resx new file mode 100644 index 000000000..19dc0dd8b --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2012/ImageViewer.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/OpenCvSharp.DebuggerVisualizers2012/Key.snk b/src/OpenCvSharp.DebuggerVisualizers2012/Key.snk new file mode 100644 index 000000000..4ec932c07 Binary files /dev/null and b/src/OpenCvSharp.DebuggerVisualizers2012/Key.snk differ diff --git a/src/OpenCvSharp.DebuggerVisualizers2012/MatDebuggerVisualizer.cs b/src/OpenCvSharp.DebuggerVisualizers2012/MatDebuggerVisualizer.cs new file mode 100644 index 000000000..e6cd617ee --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2012/MatDebuggerVisualizer.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text; +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; +using Microsoft.VisualStudio.DebuggerVisualizers; + +namespace OpenCvSharp.DebuggerVisualizers2012 +{ + /// + /// ビジュアライザでの視覚化処理 + /// + public class MatDebuggerVisualizer : DialogDebuggerVisualizer + { + protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) + { + // MatProxyが送られてくるはず + using (var proxy = objectProvider.GetObject() as MatProxy) + { + if (proxy == null) + { + throw new ArgumentException(); + } + // Formに表示 + using (var form = new ImageViewer(proxy)) + { + windowService.ShowDialog(form); + } + } + } + } + + /// + /// シリアライズ処理 + /// + public class MatObjectSource : VisualizerObjectSource + { + public override void GetData(object target, Stream outgoingData) + { + var bf = new BinaryFormatter(); + bf.Serialize(outgoingData, new MatProxy((Mat)target)); + } + } +} diff --git a/src/OpenCvSharp.DebuggerVisualizers2012/OpenCvSharp.DebuggerVisualizers2012.csproj b/src/OpenCvSharp.DebuggerVisualizers2012/OpenCvSharp.DebuggerVisualizers2012.csproj new file mode 100644 index 000000000..98fce43ed --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2012/OpenCvSharp.DebuggerVisualizers2012.csproj @@ -0,0 +1,78 @@ + + + + + Debug + AnyCPU + {AA55EAAD-B9D6-4516-8E29-2039DAABC668} + Library + Properties + OpenCvSharp.DebuggerVisualizers2012 + OpenCvSharp.DebuggerVisualizers + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + + + Key.snk + + + + + + + + + + + + Form + + + ImageViewer.cs + + + + + + + ImageViewer.cs + + + + + {524cc7b4-75b9-4925-9da4-3dacd40f4814} + OpenCvSharp + + + + + + + + \ No newline at end of file diff --git a/src/OpenCvSharp.DebuggerVisualizers2012/Properties/AssemblyInfo.cs b/src/OpenCvSharp.DebuggerVisualizers2012/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..e1687fae0 --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2012/Properties/AssemblyInfo.cs @@ -0,0 +1,46 @@ +using System.Diagnostics; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 +// アセンブリに関連付けられている情報を変更するには、 +// これらの属性値を変更してください。 +[assembly: AssemblyTitle("OpenCvSharp.DebuggerVisualizers2012")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OpenCvSharp.DebuggerVisualizers2012")] +[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから +// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 +// その型の ComVisible 属性を true に設定してください。 +[assembly: ComVisible(false)] + +// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です +[assembly: Guid("bb5521c5-d920-41a9-9cf1-35ad17fe68b1")] + +// アセンブリのバージョン情報は、以下の 4 つの値で構成されています: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を +// 既定値にすることができます: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] + + +// OpenCvSharp objects' debugger visualizer +[assembly: DebuggerVisualizer( + typeof(OpenCvSharp.DebuggerVisualizers2012.MatDebuggerVisualizer), + typeof(OpenCvSharp.DebuggerVisualizers2012.MatObjectSource), + Target = typeof(OpenCvSharp.Mat), + Description = "Mat View Visualizer" +)] \ No newline at end of file diff --git a/src/OpenCvSharp.DebuggerVisualizers2013/ImageViewer.Designer.cs b/src/OpenCvSharp.DebuggerVisualizers2013/ImageViewer.Designer.cs new file mode 100644 index 000000000..65bf029bc --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2013/ImageViewer.Designer.cs @@ -0,0 +1,69 @@ +namespace OpenCvSharp.DebuggerVisualizers2013 +{ + partial class ImageViewer + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.pictureBox = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); + this.SuspendLayout(); + // + // pictureBox + // + this.pictureBox.BackColor = System.Drawing.Color.Black; + this.pictureBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.pictureBox.Location = new System.Drawing.Point(0, 0); + this.pictureBox.Name = "pictureBox"; + this.pictureBox.Size = new System.Drawing.Size(384, 263); + this.pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox.TabIndex = 0; + this.pictureBox.TabStop = false; + // + // ImageViewer + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(384, 263); + this.Controls.Add(this.pictureBox); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ImageViewer"; + this.Text = "ImageViewer"; + ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.PictureBox pictureBox; + + + } +} \ No newline at end of file diff --git a/src/OpenCvSharp.DebuggerVisualizers2013/ImageViewer.cs b/src/OpenCvSharp.DebuggerVisualizers2013/ImageViewer.cs new file mode 100644 index 000000000..4bc1efd5f --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2013/ImageViewer.cs @@ -0,0 +1,66 @@ +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace OpenCvSharp.DebuggerVisualizers2013 +{ + /// + /// IplImageを表示するビューア + /// + public partial class ImageViewer : Form + { + private readonly Bitmap bitmap; + + /// + /// + /// + public ImageViewer() + { + InitializeComponent(); + } + + /// + /// + /// + /// + public ImageViewer(MatProxy proxy) + : this() + { + bitmap = new Bitmap(proxy.CreateBitmapStream()); + } + + /// + /// + /// + /// + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + + SetClientSize(new System.Drawing.Size(bitmap.Width, bitmap.Height)); + pictureBox.Image = bitmap; + } + + /// + /// ClientSizeを画面からはみ出ない大きさに調整して設定する. + /// + /// + private void SetClientSize(System.Drawing.Size size) + { + var screenSize = Screen.PrimaryScreen.Bounds.Size; + if (size.Width > screenSize.Width) + { + double ratio = (double) screenSize.Width/size.Width; + size.Width = Convert.ToInt32(size.Width*ratio); + size.Height = Convert.ToInt32(size.Height*ratio); + } + if (size.Height > screenSize.Height) + { + double ratio = (double) screenSize.Height/size.Height; + size.Width = Convert.ToInt32(size.Width*ratio); + size.Height = Convert.ToInt32(size.Height*ratio); + } + ClientSize = size; + } + } +} diff --git a/src/OpenCvSharp.DebuggerVisualizers2013/ImageViewer.resx b/src/OpenCvSharp.DebuggerVisualizers2013/ImageViewer.resx new file mode 100644 index 000000000..19dc0dd8b --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2013/ImageViewer.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/OpenCvSharp.DebuggerVisualizers2013/Key.pfx b/src/OpenCvSharp.DebuggerVisualizers2013/Key.pfx new file mode 100644 index 000000000..ed08e397a Binary files /dev/null and b/src/OpenCvSharp.DebuggerVisualizers2013/Key.pfx differ diff --git a/src/OpenCvSharp.DebuggerVisualizers2013/Key.snk b/src/OpenCvSharp.DebuggerVisualizers2013/Key.snk new file mode 100644 index 000000000..a1e033087 Binary files /dev/null and b/src/OpenCvSharp.DebuggerVisualizers2013/Key.snk differ diff --git a/src/OpenCvSharp.DebuggerVisualizers2013/MatDebuggerVisualizer.cs b/src/OpenCvSharp.DebuggerVisualizers2013/MatDebuggerVisualizer.cs new file mode 100644 index 000000000..d9fd048e4 --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2013/MatDebuggerVisualizer.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text; +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; +using Microsoft.VisualStudio.DebuggerVisualizers; + +namespace OpenCvSharp.DebuggerVisualizers2013 +{ + /// + /// ビジュアライザでの視覚化処理 + /// + public class MatDebuggerVisualizer : DialogDebuggerVisualizer + { + protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) + { + // MatProxyが送られてくるはず + using (var proxy = objectProvider.GetObject() as MatProxy) + { + if (proxy == null) + { + throw new ArgumentException(); + } + // Formに表示 + using (var form = new ImageViewer(proxy)) + { + windowService.ShowDialog(form); + } + } + } + } + + + + /// + /// シリアライズ処理 + /// + public class MatObjectSource : VisualizerObjectSource + { + public override void GetData(object target, Stream outgoingData) + { + var bf = new BinaryFormatter(); + bf.Serialize(outgoingData, new MatProxy((Mat)target)); + } + } +} diff --git a/src/OpenCvSharp.DebuggerVisualizers2013/OpenCvSharp.DebuggerVisualizers2013.csproj b/src/OpenCvSharp.DebuggerVisualizers2013/OpenCvSharp.DebuggerVisualizers2013.csproj new file mode 100644 index 000000000..6848c0f3c --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2013/OpenCvSharp.DebuggerVisualizers2013.csproj @@ -0,0 +1,88 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {C8D2EAD7-DAA4-48DC-B32F-2602F4F04A2F} + Library + Properties + OpenCvSharp.DebuggerVisualizers2013 + OpenCvSharp.DebuggerVisualizers + v2.0 + 512 + + + 3.5 + + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + + + Key.snk + + + + + + + + + + Form + + + ImageViewer.cs + + + + + + + ImageViewer.cs + Designer + + + + + + + + {524cc7b4-75b9-4925-9da4-3dacd40f4814} + OpenCvSharp + + + + + + + + + \ No newline at end of file diff --git a/src/OpenCvSharp.DebuggerVisualizers2013/Properties/AssemblyInfo.cs b/src/OpenCvSharp.DebuggerVisualizers2013/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..bd8dc7299 --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2013/Properties/AssemblyInfo.cs @@ -0,0 +1,47 @@ +using System.Diagnostics; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 +// アセンブリに関連付けられている情報を変更するには、 +// これらの属性値を変更してください。 +[assembly: AssemblyTitle("OpenCvSharp.DebuggerVisualizers2013")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OpenCvSharp.DebuggerVisualizers2013")] +[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから +// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 +// その型の ComVisible 属性を true に設定してください。 +[assembly: ComVisible(false)] + +// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です +[assembly: Guid("90eccbf4-9121-40cd-975f-185933e0f65a")] + +// アセンブリのバージョン情報は、以下の 4 つの値で構成されています: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を +// 既定値にすることができます: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] + + +// OpenCvSharp objects' debugger visualizer + +[assembly: DebuggerVisualizer( + typeof(OpenCvSharp.DebuggerVisualizers2013.MatDebuggerVisualizer), + typeof(OpenCvSharp.DebuggerVisualizers2013.MatObjectSource), + Target = typeof(OpenCvSharp.Mat), + Description = "Mat View Visualizer" +)] diff --git a/src/OpenCvSharp.DebuggerVisualizers2015/ImageViewer.Designer.cs b/src/OpenCvSharp.DebuggerVisualizers2015/ImageViewer.Designer.cs new file mode 100644 index 000000000..da0b271c7 --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2015/ImageViewer.Designer.cs @@ -0,0 +1,69 @@ +namespace OpenCvSharp.DebuggerVisualizers2015 +{ + partial class ImageViewer + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.pictureBox = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); + this.SuspendLayout(); + // + // pictureBox + // + this.pictureBox.BackColor = System.Drawing.Color.Black; + this.pictureBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.pictureBox.Location = new System.Drawing.Point(0, 0); + this.pictureBox.Name = "pictureBox"; + this.pictureBox.Size = new System.Drawing.Size(384, 263); + this.pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox.TabIndex = 0; + this.pictureBox.TabStop = false; + // + // ImageViewer + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(384, 263); + this.Controls.Add(this.pictureBox); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ImageViewer"; + this.Text = "ImageViewer"; + ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.PictureBox pictureBox; + + + } +} \ No newline at end of file diff --git a/src/OpenCvSharp.DebuggerVisualizers2015/ImageViewer.cs b/src/OpenCvSharp.DebuggerVisualizers2015/ImageViewer.cs new file mode 100644 index 000000000..c58d5b7fe --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2015/ImageViewer.cs @@ -0,0 +1,66 @@ +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace OpenCvSharp.DebuggerVisualizers2015 +{ + /// + /// IplImageを表示するビューア + /// + public partial class ImageViewer : Form + { + private readonly Bitmap bitmap; + + /// + /// + /// + public ImageViewer() + { + InitializeComponent(); + } + + /// + /// + /// + /// + public ImageViewer(MatProxy proxy) + : this() + { + bitmap = new Bitmap(proxy.CreateBitmapStream()); + } + + /// + /// + /// + /// + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + + SetClientSize(new System.Drawing.Size(bitmap.Width, bitmap.Height)); + pictureBox.Image = bitmap; + } + + /// + /// ClientSizeを画面からはみ出ない大きさに調整して設定する. + /// + /// + private void SetClientSize(System.Drawing.Size size) + { + var screenSize = Screen.PrimaryScreen.Bounds.Size; + if (size.Width > screenSize.Width) + { + double ratio = (double) screenSize.Width/size.Width; + size.Width = Convert.ToInt32(size.Width*ratio); + size.Height = Convert.ToInt32(size.Height*ratio); + } + if (size.Height > screenSize.Height) + { + double ratio = (double) screenSize.Height/size.Height; + size.Width = Convert.ToInt32(size.Width*ratio); + size.Height = Convert.ToInt32(size.Height*ratio); + } + ClientSize = size; + } + } +} diff --git a/src/OpenCvSharp.DebuggerVisualizers2015/ImageViewer.resx b/src/OpenCvSharp.DebuggerVisualizers2015/ImageViewer.resx new file mode 100644 index 000000000..19dc0dd8b --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2015/ImageViewer.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/OpenCvSharp.DebuggerVisualizers2015/Key.snk b/src/OpenCvSharp.DebuggerVisualizers2015/Key.snk new file mode 100644 index 000000000..a1e033087 Binary files /dev/null and b/src/OpenCvSharp.DebuggerVisualizers2015/Key.snk differ diff --git a/src/OpenCvSharp.DebuggerVisualizers2015/MatDebuggerVisualizer.cs b/src/OpenCvSharp.DebuggerVisualizers2015/MatDebuggerVisualizer.cs new file mode 100644 index 000000000..81e3277ba --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2015/MatDebuggerVisualizer.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text; +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; +using Microsoft.VisualStudio.DebuggerVisualizers; + +namespace OpenCvSharp.DebuggerVisualizers2015 +{ + /// + /// ビジュアライザでの視覚化処理 + /// + public class MatDebuggerVisualizer : DialogDebuggerVisualizer + { + protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) + { + // MatProxyが送られてくるはず + using (var proxy = objectProvider.GetObject() as MatProxy) + { + if (proxy == null) + { + throw new ArgumentException(); + } + // Formに表示 + using (var form = new ImageViewer(proxy)) + { + windowService.ShowDialog(form); + } + } + } + } + + /// + /// シリアライズ処理 + /// + public class MatObjectSource : VisualizerObjectSource + { + public override void GetData(object target, Stream outgoingData) + { + var bf = new BinaryFormatter(); + bf.Serialize(outgoingData, new MatProxy((Mat)target)); + } + } +} diff --git a/src/OpenCvSharp.DebuggerVisualizers2015/OpenCvSharp.DebuggerVisualizers2015.csproj b/src/OpenCvSharp.DebuggerVisualizers2015/OpenCvSharp.DebuggerVisualizers2015.csproj new file mode 100644 index 000000000..e1a3eb28b --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2015/OpenCvSharp.DebuggerVisualizers2015.csproj @@ -0,0 +1,79 @@ + + + + + Debug + AnyCPU + {63E48A18-8194-40EF-8BB1-4681EA2C5C01} + Library + Properties + OpenCvSharp.DebuggerVisualizers2015 + OpenCvSharp.DebuggerVisualizers + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + + + Key.snk + + + + + + + + + + + + Form + + + ImageViewer.cs + + + + + + + + + + ImageViewer.cs + Designer + + + + + {524cc7b4-75b9-4925-9da4-3dacd40f4814} + OpenCvSharp + + + + + \ No newline at end of file diff --git a/src/OpenCvSharp.DebuggerVisualizers2015/Properties/AssemblyInfo.cs b/src/OpenCvSharp.DebuggerVisualizers2015/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..9efe6a759 --- /dev/null +++ b/src/OpenCvSharp.DebuggerVisualizers2015/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 +// アセンブリに関連付けられている情報を変更するには、 +// これらの属性値を変更してください。 +[assembly: AssemblyTitle("OpenCvSharp.DebuggerVisualizers2015")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OpenCvSharp.DebuggerVisualizers2015")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから +// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 +// その型の ComVisible 属性を true に設定してください。 +[assembly: ComVisible(false)] + +// このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります +[assembly: Guid("63e48a18-8194-40ef-8bb1-4681ea2c5c01")] + +// アセンブリのバージョン情報は次の 4 つの値で構成されています: +// +// メジャー バージョン +// マイナー バージョン +// ビルド番号 +// Revision +// +// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を +// 既定値にすることができます: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/OpenCvSharp.Extensions/Binarizer.cs b/src/OpenCvSharp.Extensions/Binarizer.cs new file mode 100644 index 000000000..d2b495bee --- /dev/null +++ b/src/OpenCvSharp.Extensions/Binarizer.cs @@ -0,0 +1,383 @@ +using System; + +namespace OpenCvSharp.Extensions +{ +#if LANG_JP + /// + /// 様々な二値化手法を集めたクラス (OpenCVの関数ではなく, OpenCvSharpが独自に実装したものである. 出来は保証しない.) + /// +#else + /// + /// Various binarization methods (ATTENTION : The methods of this class is not implemented in OpenCV) + /// +#endif + public static class Binarizer + { +#if LANG_JP + /// + /// Niblackの手法による二値化処理を行う。 + /// + /// 入力画像 + /// 出力画像 + /// 局所領域のサイズ + /// 係数 +#else + /// + /// Binarizes by Niblack's method (This is faster but memory-hogging) + /// + /// Input image + /// Output image + /// Window size + /// Adequate coefficient +#endif + public static void Niblack(Mat src, Mat dst, int kernelSize, double k) + { + if (src == null) + throw new ArgumentNullException(nameof(src)); + if (dst == null) + throw new ArgumentNullException(nameof(dst)); + + // グレースケールのみ + if (src.Type() != MatType.CV_8UC1) + throw new ArgumentException("src must be gray scale image"); + + // サイズのチェック + if (kernelSize < 3) + throw new ArgumentOutOfRangeException(nameof(kernelSize), "size must be 3 and above"); + if (kernelSize % 2 == 0) + throw new ArgumentOutOfRangeException(nameof(kernelSize), "size must be odd number"); + + int borderSize = kernelSize / 2; + int width = src.Width; + int height = src.Height; + dst.Create(src.Size(), src.Type()); + + using (var tempMat = new Mat(height + (borderSize * 2), width + (borderSize * 2), src.Type())) + using (var sumMat = new Mat()) + using (var sqSumMat = new Mat()) + { + Cv2.CopyMakeBorder(src, tempMat, borderSize, borderSize, borderSize, borderSize, BorderTypes.Replicate, Scalar.All(0)); + Cv2.Integral(tempMat, sumMat, sqSumMat, MatType.CV_64FC1); + + using (var tSrcMat = new MatOfByte(src)) + using (var tDstMat = new MatOfByte(dst)) + using (var tSumMat = new MatOfDouble(sumMat)) + using (var tSqSumMat = new MatOfDouble(sqSumMat)) + { + var tSrc = tSrcMat.GetIndexer(); + var tDst = tDstMat.GetIndexer(); + var tSum = tSumMat.GetIndexer(); + var tSqSum = tSqSumMat.GetIndexer(); + + int ylim = height + borderSize; + int xlim = width + borderSize; + int kernelPixels = kernelSize * kernelSize; + for (int y = borderSize; y < ylim; y++) + { + for (int x = borderSize; x < xlim; x++) + { + int x1 = x - borderSize; + int y1 = y - borderSize; + int x2 = x + borderSize + 1; + int y2 = y + borderSize + 1; + double sum = tSum[y2, x2] - tSum[y2, x1] - tSum[y1, x2] + tSum[y1, x1]; + double sqsum = tSqSum[y2, x2] - tSqSum[y2, x1] - tSqSum[y1, x2] + tSqSum[y1, x1]; + double mean = sum / kernelPixels; + double var = (sqsum / kernelPixels) - (mean * mean); + if (var < 0.0) var = 0.0; + double stddev = Math.Sqrt(var); + + double threshold = mean + k * stddev; + if (tSrc[y - borderSize, x - borderSize] < threshold) + tDst[y - borderSize, x - borderSize] = 0; + else + tDst[y - borderSize, x - borderSize] = 255; + } + } + } + } + } + +#if LANG_JP + /// + /// Sauvolaの手法による二値化処理を行う。 + /// + /// 入力画像 + /// 出力画像 + /// 局所領域のサイズ + /// 係数 + /// 係数 +#else + /// + /// Binarizes by Sauvola's method (This is faster but memory-hogging) + /// + /// Input image + /// Output image + /// Window size + /// Adequate coefficient + /// Adequate coefficient +#endif + public static void Sauvola(Mat src, Mat dst, int kernelSize, double k, double r) + { + if (src == null) + throw new ArgumentNullException(nameof(src)); + if (dst == null) + throw new ArgumentNullException(nameof(dst)); + + // グレースケールのみ + if (src.Type() != MatType.CV_8UC1) + throw new ArgumentException("src must be gray scale image"); + + // サイズのチェック + if (kernelSize < 3) + throw new ArgumentOutOfRangeException(nameof(kernelSize), "size must be 3 and above"); + if (kernelSize % 2 == 0) + throw new ArgumentOutOfRangeException(nameof(kernelSize), "size must be odd number"); + if (Math.Abs(r) < 1e-9f) + throw new ArgumentOutOfRangeException(nameof(r), "r == 0"); + + int borderSize = kernelSize / 2; + int width = src.Width; + int height = src.Height; + dst.Create(src.Size(), src.Type()); + + using (var tempMat = new Mat(height + (borderSize * 2), width + (borderSize * 2), src.Type())) + using (var sumMat = new Mat()) + using (var sqSumMat = new Mat()) + { + Cv2.CopyMakeBorder(src, tempMat, borderSize, borderSize, borderSize, borderSize, BorderTypes.Replicate, Scalar.All(0)); + Cv2.Integral(tempMat, sumMat, sqSumMat, MatType.CV_64FC1); + + using (var tSrcMat = new MatOfByte(src)) + using (var tDstMat = new MatOfByte(dst)) + using (var tSumMat = new MatOfDouble(sumMat)) + using (var tSqSumMat = new MatOfDouble(sqSumMat)) + { + var tSrc = tSrcMat.GetIndexer(); + var tDst = tDstMat.GetIndexer(); + var tSum = tSumMat.GetIndexer(); + var tSqSum = tSqSumMat.GetIndexer(); + + int ylim = height + borderSize; + int xlim = width + borderSize; + int kernelPixels = kernelSize * kernelSize; + for (int y = borderSize; y < ylim; y++) + { + for (int x = borderSize; x < xlim; x++) + { + int x1 = x - borderSize; + int y1 = y - borderSize; + int x2 = x + borderSize + 1; + int y2 = y + borderSize + 1; + double sum = tSum[y2, x2] - tSum[y2, x1] - tSum[y1, x2] + tSum[y1, x1]; + double sqsum = tSqSum[y2, x2] - tSqSum[y2, x1] - tSqSum[y1, x2] + tSqSum[y1, x1]; + double mean = sum / kernelPixels; + double var = (sqsum / kernelPixels) - (mean * mean); + if (var < 0.0) var = 0.0; + double stddev = Math.Sqrt(var); + + double threshold = mean * (1 + k * (stddev / r - 1)); + if (tSrc[y - borderSize, x - borderSize] < threshold) + tDst[y - borderSize, x - borderSize] = 0; + else + tDst[y - borderSize, x - borderSize] = 255; + } + } + } + } + } + + +#if LANG_JP + /// + /// Bernsenの手法による二値化処理を行う。 + /// + /// 入力画像 + /// 出力画像 + /// 局所領域のサイズ + /// この数値以下のコントラストの領域は背景領域とみなす + /// 背景領域と見なされた領域に適用する閾値(背景領域以外では、適応的に閾値を求める) +#else + /// + /// Binarizes by Bernsen's method + /// + /// Input image + /// Output image + /// Window size + /// Adequate coefficient + /// Adequate coefficient +#endif + public static void Bernsen(Mat src, Mat dst, int kernelSize, byte constrastMin, byte bgThreshold) + { + if (src == null) + throw new ArgumentNullException(nameof(src)); + if (dst == null) + throw new ArgumentNullException(nameof(dst)); + + // グレースケールのみ + if (src.Type() != MatType.CV_8UC1) + throw new ArgumentException("src must be gray scale image"); + + // サイズのチェック + if (kernelSize < 3) + throw new ArgumentOutOfRangeException(nameof(kernelSize), "size must be 3 and above"); + if (kernelSize % 2 == 0) + throw new ArgumentOutOfRangeException(nameof(kernelSize), "size must be odd number"); + + int width = src.Width; + int height = src.Height; + dst.Create(src.Size(), src.Type()); + + using (var tSrcMat = new MatOfByte(src)) + using (var tDstMat = new MatOfByte(dst)) + { + var tSrc = tSrcMat.GetIndexer(); + var tDst = tDstMat.GetIndexer(); + + for (int y = 0; y < height; y++) + { + for (int x = 0; x < width; x++) + { + byte min, max; + MinMax(src, x, y, kernelSize, out min, out max); + + int contrast = max - min; + byte threshold; + if (contrast < constrastMin) + threshold = bgThreshold; + else + threshold = (byte)((max + min) / 2); + + if (tSrc[y, x] <= threshold) + tDst[y, x] = 0; + else + tDst[y, x] = 255; + } + } + } + + } + +#if LANG_JP + /// + /// Nickの手法による二値化処理を行う。 + /// + /// 入力画像 + /// 出力画像 + /// 局所領域のサイズ + /// 係数 +#else + /// + /// Binarizes by Nick's method + /// + /// Input image + /// Output image + /// Window size + /// Adequate coefficient +#endif + public static void Nick(Mat src, Mat dst, int kernelSize, double k) + { + if (src == null) + throw new ArgumentNullException(nameof(src)); + if (dst == null) + throw new ArgumentNullException(nameof(dst)); + + // グレースケールのみ + if (src.Type() != MatType.CV_8UC1) + throw new ArgumentException("src must be gray scale image"); + + // サイズのチェック + if (kernelSize < 3) + throw new ArgumentOutOfRangeException(nameof(kernelSize), "size must be 3 and above"); + if (kernelSize % 2 == 0) + throw new ArgumentOutOfRangeException(nameof(kernelSize), "size must be odd number"); + + int borderSize = kernelSize / 2; + int width = src.Width; + int height = src.Height; + dst.Create(src.Size(), src.Type()); + + using (var tempMat = new Mat(height + (borderSize * 2), width + (borderSize * 2), src.Type())) + using (var sumMat = new Mat()) + using (var sqSumMat = new Mat()) + { + Cv2.CopyMakeBorder(src, tempMat, borderSize, borderSize, borderSize, borderSize, BorderTypes.Replicate, Scalar.All(0)); + Cv2.Integral(tempMat, sumMat, sqSumMat, MatType.CV_64FC1); + + using (var tSrcMat = new MatOfByte(src)) + using (var tDstMat = new MatOfByte(dst)) + using (var tSumMat = new MatOfDouble(sumMat)) + using (var tSqSumMat = new MatOfDouble(sqSumMat)) + { + var tSrc = tSrcMat.GetIndexer(); + var tDst = tDstMat.GetIndexer(); + var tSum = tSumMat.GetIndexer(); + var tSqSum = tSqSumMat.GetIndexer(); + + int ylim = height + borderSize; + int xlim = width + borderSize; + int kernelPixels = kernelSize * kernelSize; + for (int y = borderSize; y < ylim; y++) + { + for (int x = borderSize; x < xlim; x++) + { + int x1 = x - borderSize; + int y1 = y - borderSize; + int x2 = x + borderSize + 1; + int y2 = y + borderSize + 1; + double sum = tSum[y2, x2] - tSum[y2, x1] - tSum[y1, x2] + tSum[y1, x1]; + double sqsum = tSqSum[y2, x2] - tSqSum[y2, x1] - tSqSum[y1, x2] + tSqSum[y1, x1]; + double mean = sum / kernelPixels; + double term = (sqsum - mean * mean) / kernelPixels; + if (term < 0.0) term = 0.0; + term = Math.Sqrt(term); + + double threshold = mean + k * term; + if (tSrc[y - borderSize, x - borderSize] < threshold) + tDst[y - borderSize, x - borderSize] = 0; + else + tDst[y - borderSize, x - borderSize] = 255; + } + } + } + } + } + + /// + /// 注目画素の周辺画素の最大値と最小値を求める + /// + /// 画像の画素データ + /// x座標 + /// y座標 + /// 周辺画素の探索サイズ。奇数でなければならない + /// 出力される最小値 + /// 出力される最大値 + private static void MinMax(Mat img, int x, int y, int size, out byte min, out byte max) + { + int size2 = size / 2; + min = byte.MaxValue; + max = byte.MinValue; + int xs = Math.Max(x - size2, 0); + int xe = Math.Min(x + size2, img.Width); + int ys = Math.Max(y - size2, 0); + int ye = Math.Min(y + size2, img.Height); + + using (var tImg = new MatOfByte(img)) + { + var indexer = tImg.GetIndexer(); + + for (int xx = xs; xx < xe; xx++) + { + for (int yy = ys; yy < ye; yy++) + { + byte v = indexer[yy, xx]; + if (max < v) + max = v; + else if (min > v) + min = v; + } + } + } + } + } +} diff --git a/src/OpenCvSharp.Extensions/BitmapConverter.cs b/src/OpenCvSharp.Extensions/BitmapConverter.cs new file mode 100644 index 000000000..a952f5549 --- /dev/null +++ b/src/OpenCvSharp.Extensions/BitmapConverter.cs @@ -0,0 +1,429 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Imaging; +using OpenCvSharp.Util; + +namespace OpenCvSharp.Extensions +{ +#if LANG_JP + /// + /// System.Drawing.BitmapとMatの相互変換メソッドを提供するクラス + /// +#else + /// + /// static class which provides conversion between System.Drawing.Bitmap and Mat + /// +#endif + public static class BitmapConverter + { + #region ToMat +#if LANG_JP + /// + /// System.Drawing.BitmapからOpenCVのMatへ変換して返す. + /// + /// 変換するSystem.Drawing.Bitmap + /// 変換結果のMat +#else + /// + /// Converts System.Drawing.Bitmap to Mat + /// + /// System.Drawing.Bitmap object to be converted + /// A Mat object which is converted from System.Drawing.Bitmap +#endif + public static Mat ToMat(this Bitmap src) + { + if (src == null) + throw new ArgumentNullException("src"); + + int w = src.Width; + int h = src.Height; + int channels; + switch (src.PixelFormat) + { + case PixelFormat.Format24bppRgb: + case PixelFormat.Format32bppRgb: + channels = 3; break; + case PixelFormat.Format32bppArgb: + case PixelFormat.Format32bppPArgb: + channels = 4; break; + case PixelFormat.Format8bppIndexed: + case PixelFormat.Format1bppIndexed: + channels = 1; break; + default: + throw new NotImplementedException(); + } + + Mat dst = new Mat(h, w, MatType.CV_8UC(channels)); + ToMat(src, dst); + return dst; + } + +#if LANG_JP + /// + /// System.Drawing.BitmapからOpenCVのMatへ変換して返す. + /// + /// 変換するSystem.Drawing.Bitmap + /// 変換結果を格納するMat +#else + /// + /// Converts System.Drawing.Bitmap to Mat + /// + /// System.Drawing.Bitmap object to be converted + /// A Mat object which is converted from System.Drawing.Bitmap +#endif + public static unsafe void ToMat(this Bitmap src, Mat dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (dst.IsDisposed) + throw new ArgumentException("The specified dst is disposed.", "dst"); + if (dst.Depth() != MatType.CV_8U) + throw new NotSupportedException("Mat depth != CV_8U"); + if (dst.Dims() != 2) + throw new NotSupportedException("Mat dims != 2"); + if (src.Width != dst.Width || src.Height != dst.Height) + throw new ArgumentException("src.Size != dst.Size"); + + int w = src.Width; + int h = src.Height; + Rectangle rect = new Rectangle(0, 0, w, h); + BitmapData bd = null; + try + { + bd = src.LockBits(rect, ImageLockMode.ReadOnly, src.PixelFormat); + + byte* p = (byte*)bd.Scan0.ToPointer(); + int sstep = bd.Stride; + int offset = sstep - (w / 8); + uint dstep = (uint)dst.Step(); + IntPtr dstData = dst.Data; + byte* dstPtr = (byte*)dstData.ToPointer(); + + bool submat = dst.IsSubmatrix(); + bool continuous = dst.IsContinuous(); + + switch (src.PixelFormat) + { + case PixelFormat.Format1bppIndexed: + { + if (dst.Channels() != 1) + throw new ArgumentException("Invalid nChannels"); + if (submat) + throw new NotImplementedException("submatrix not supported"); + + int x = 0; + int y; + int bytePos; + byte b; + int i; + for (y = 0; y < h; y++) + { + // 横は必ず4byte幅に切り上げられる。 + // この行の各バイトを調べていく + for (bytePos = 0; bytePos < sstep; bytePos++) + { + if (x < w) + { + // 現在の位置のバイトからそれぞれのビット8つを取り出す + b = p[bytePos]; + for (i = 0; i < 8; i++) + { + if (x >= w) + { + break; + } + // IplImageは8bit/pixel + dstPtr[dstep * y + x] = ((b & 0x80) == 0x80) ? (byte)255 : (byte)0; + b <<= 1; + x++; + } + } + } + // 次の行へ + x = 0; + p += sstep; + } + } + break; + + case PixelFormat.Format8bppIndexed: + case PixelFormat.Format24bppRgb: + { + if (src.PixelFormat == PixelFormat.Format8bppIndexed) + if (dst.Channels() != 1) + throw new ArgumentException("Invalid nChannels"); + if (src.PixelFormat == PixelFormat.Format24bppRgb) + if (dst.Channels() != 3) + throw new ArgumentException("Invalid nChannels"); + + // ステップが同じで連続なら、一気にコピー + if (dstep == sstep && !submat && continuous) + { + uint length = (uint)(dst.DataEnd.ToInt64() - dstData.ToInt64()); + Utility.CopyMemory(dstData, bd.Scan0, length); + } + else + { + // 各行ごとにdstの行バイト幅コピー + byte* sp = (byte*)bd.Scan0; + byte* dp = (byte*)dst.Data; + for (int y = 0; y < h; y++) + { + Utility.CopyMemory(dp, sp, dstep); + sp += sstep; + dp += dstep; + } + } + } + break; + + case PixelFormat.Format32bppRgb: + case PixelFormat.Format32bppArgb: + case PixelFormat.Format32bppPArgb: + { + switch (dst.Channels()) + { + case 4: + if (!submat && continuous) + { + uint length = (uint)(dst.DataEnd.ToInt64() - dstData.ToInt64()); + Utility.CopyMemory(dstData, bd.Scan0, length); + } + else + { + byte* sp = (byte*)bd.Scan0; + byte* dp = (byte*)dst.Data; + for (int y = 0; y < h; y++) + { + Utility.CopyMemory(dp, sp, dstep); + sp += sstep; + dp += dstep; + } + } + break; + case 3: + for (int y = 0; y < h; y++) + { + for (int x = 0; x < w; x++) + { + dstPtr[y * dstep + x * 3 + 0] = p[y * sstep + x * 4 + 0]; + dstPtr[y * dstep + x * 3 + 1] = p[y * sstep + x * 4 + 1]; + dstPtr[y * dstep + x * 3 + 2] = p[y * sstep + x * 4 + 2]; + } + } + break; + default: + throw new ArgumentException("Invalid nChannels"); + } + } + break; + } + } + finally + { + if(bd != null) + src.UnlockBits(bd); + } + } + #endregion + + #region ToBitmap +#if LANG_JP + /// + /// OpenCVのMatをSystem.Drawing.Bitmapに変換する + /// + /// 変換するMat + /// System.Drawing.Bitmap +#else + /// + /// Converts Mat to System.Drawing.Bitmap + /// + /// Mat + /// +#endif + public static Bitmap ToBitmap(this Mat src) + { + if (src == null) + { + throw new ArgumentNullException("src"); + } + + PixelFormat pf; + switch (src.Channels()) + { + case 1: + pf = PixelFormat.Format8bppIndexed; break; + case 3: + pf = PixelFormat.Format24bppRgb; break; + case 4: + pf = PixelFormat.Format32bppArgb; break; + default: + throw new ArgumentException("Number of channels must be 1, 3 or 4.", "src"); + } + return ToBitmap(src, pf); + } +#if LANG_JP + /// + /// OpenCVのMatをSystem.Drawing.Bitmapに変換する + /// + /// 変換するMat + /// ピクセル深度 + /// System.Drawing.Bitmap +#else + /// + /// Converts Mat to System.Drawing.Bitmap + /// + /// Mat + /// Pixel Depth + /// +#endif + public static Bitmap ToBitmap(this Mat src, PixelFormat pf) + { + if (src == null) + throw new ArgumentNullException("src"); + src.ThrowIfDisposed(); + + Bitmap bitmap = new Bitmap(src.Width, src.Height, pf); + ToBitmap(src, bitmap); + return bitmap; + } + +#if LANG_JP + /// + /// OpenCVのMatを指定した出力先にSystem.Drawing.Bitmapとして変換する + /// + /// 変換するMat + /// 出力先のSystem.Drawing.Bitmap + /// Author: shimat, Gummo (ROI support) +#else + /// + /// Converts Mat to System.Drawing.Bitmap + /// + /// Mat + /// Mat + /// Author: shimat, Gummo (ROI support) +#endif + public static unsafe void ToBitmap(this Mat src, Bitmap dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (src.IsDisposed) + throw new ArgumentException("The image is disposed.", "src"); + if (src.Depth() != MatType.CV_8U) + throw new ArgumentException("Depth of the image must be CV_8U"); + //if (src.IsSubmatrix()) + // throw new ArgumentException("Submatrix is not supported"); + if (src.Width != dst.Width || src.Height != dst.Height) + throw new ArgumentException(""); + + PixelFormat pf = dst.PixelFormat; + + // 1プレーン用の場合、グレースケールのパレット情報を生成する + if (pf == PixelFormat.Format8bppIndexed) + { + ColorPalette plt = dst.Palette; + for (int x = 0; x < 256; x++) + { + plt.Entries[x] = Color.FromArgb(x, x, x); + } + dst.Palette = plt; + } + + int w = src.Width; + int h = src.Height; + Rectangle rect = new Rectangle(0, 0, w, h); + BitmapData bd = null; + + bool submat = src.IsSubmatrix(); + bool continuous = src.IsContinuous(); + + try + { + bd = dst.LockBits(rect, ImageLockMode.WriteOnly, pf); + + IntPtr srcData = src.Data; + byte* pSrc = (byte*)(srcData.ToPointer()); + byte* pDst = (byte*)(bd.Scan0.ToPointer()); + int ch = src.Channels(); + int sstep = (int)src.Step(); + int dstep = ((src.Width * ch) + 3) / 4 * 4; // 4の倍数に揃える + int stride = bd.Stride; + + switch (pf) + { + case PixelFormat.Format1bppIndexed: + { + if (submat) + throw new NotImplementedException("submatrix not supported"); + + // BitmapDataは4byte幅だが、IplImageは1byte幅 + // 手作業で移し替える + //int offset = stride - (w / 8); + int x = 0; + int y; + int bytePos; + byte mask; + byte b = 0; + int i; + for (y = 0; y < h; y++) + { + for (bytePos = 0; bytePos < stride; bytePos++) + { + if (x < w) + { + for (i = 0; i < 8; i++) + { + mask = (byte)(0x80 >> i); + if (x < w && pSrc[sstep * y + x] == 0) + b &= (byte)(mask ^ 0xff); + else + b |= mask; + + x++; + } + pDst[bytePos] = b; + } + } + x = 0; + pDst += stride; + } + break; + } + + case PixelFormat.Format8bppIndexed: + case PixelFormat.Format24bppRgb: + case PixelFormat.Format32bppArgb: + if (sstep == dstep && !submat && continuous) + { + uint imageSize = (uint)(src.DataEnd.ToInt64() - src.Data.ToInt64()); + Utility.CopyMemory(pDst, pSrc, imageSize); + } + else + { + for (int y = 0; y < h; y++) + { + long offsetSrc = (y * sstep); + long offsetDst = (y * dstep); + // 一列ごとにコピー + Utility.CopyMemory(pDst + offsetDst, pSrc + offsetSrc, w * ch); + } + } + break; + + default: + throw new NotImplementedException(); + } + } + finally + { + dst.UnlockBits(bd); + } + } + #endregion + } +} diff --git a/src/OpenCvSharp.Extensions/BitmapSourceConverter.cs b/src/OpenCvSharp.Extensions/BitmapSourceConverter.cs new file mode 100644 index 000000000..3d65c6196 --- /dev/null +++ b/src/OpenCvSharp.Extensions/BitmapSourceConverter.cs @@ -0,0 +1,295 @@ +using System; +using System.Drawing; +using System.Runtime.InteropServices; +using System.Windows; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Interop; + +namespace OpenCvSharp.Extensions +{ +#if LANG_JP + /// + /// System.Windows.Media.Imaging.WriteableBitmapとOpenCVのIplImageとの間の相互変換メソッドを提供するクラス + /// +#else + /// + /// Static class which provides conversion between System.Windows.Media.Imaging.BitmapSource and IplImage + /// +#endif + public static class BitmapSourceConverter + { + /// + /// Delete a GDI object + /// + /// The poniter to the GDI object to be deleted + /// + [DllImport("gdi32")] + private static extern int DeleteObject(IntPtr hObject); + +#if LANG_JP + /// + /// MatをBitmapSourceに変換する. + /// + /// 変換するIplImage + /// WPFのBitmapSource +#else + /// + /// Converts Mat to BitmapSource. + /// + /// Input IplImage + /// BitmapSource +#endif + public static BitmapSource ToBitmapSource( + this Mat src) + { + return src.ToWriteableBitmap(); + } + +#if LANG_JP + /// + /// MatをBitmapSourceに変換する. + /// + /// 変換するIplImage + /// + /// + /// + /// + /// WPFのBitmapSource +#else + /// + /// Converts Mat to BitmapSource. + /// + /// Input IplImage + /// + /// + /// + /// + /// BitmapSource +#endif + public static BitmapSource ToBitmapSource( + this Mat src, + int horizontalResolution, + int verticalResolution, + PixelFormat pixelFormat, + BitmapPalette palette) + { + return src.ToWriteableBitmap(horizontalResolution, verticalResolution, pixelFormat, palette); + } + +#if LANG_JP + /// + /// System.Drawing.BitmapをBitmapSourceに変換する. + /// + /// 変換するBitmap + /// WPFのBitmapSource +#else + /// + /// Converts System.Drawing.Bitmap to BitmapSource. + /// + /// Input System.Drawing.Bitmap + /// BitmapSource +#endif + public static BitmapSource ToBitmapSource(this Bitmap src) + { + if (src == null) + throw new ArgumentNullException("src"); + + IntPtr hBitmap = IntPtr.Zero; + try + { + hBitmap = src.GetHbitmap(); + BitmapSource bs = Imaging.CreateBitmapSourceFromHBitmap( + hBitmap, + IntPtr.Zero, + Int32Rect.Empty, + BitmapSizeOptions.FromEmptyOptions()); + return bs; + } + finally + { + if (hBitmap != IntPtr.Zero) + { + DeleteObject(hBitmap); + } + } + } + + #region ToMat +#if LANG_JP + /// + /// BitmapSourceをMatに変換する + /// + /// 変換するBitmapSource + /// OpenCvSharpで扱えるMat +#else + /// + /// Converts BitmapSource to Mat + /// + /// Input BitmapSource + /// IplImage +#endif + public static Mat ToMat(this BitmapSource src) + { + if (src == null) + { + throw new ArgumentNullException("src"); + } + + int w = src.PixelWidth; + int h = src.PixelHeight; + MatType type = WriteableBitmapConverter.GetOptimumType(src.Format); + Mat dst = new Mat(h, w, type); + ToMat(src, dst); + return dst; + } +#if LANG_JP + /// + /// BitmapSourceをMatに変換する. + /// + /// 変換するBitmapSource + /// 出力先のMat +#else + /// + /// Converts BitmapSource to Mat + /// + /// Input BitmapSource + /// Output Mat +#endif + public static void ToMat(this BitmapSource src, Mat dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (src.PixelWidth != dst.Width || src.PixelHeight != dst.Height) + throw new ArgumentException("size of src must be equal to size of dst"); + if (dst.Dims() > 2) + throw new ArgumentException("Mat dimensions must be 2"); + + int w = src.PixelWidth; + int h = src.PixelHeight; + int bpp = src.Format.BitsPerPixel; + int channels = WriteableBitmapConverter.GetOptimumChannels(src.Format); + if (dst.Channels() != channels) + { + throw new ArgumentException("nChannels of dst is invalid", "dst"); + } + + bool submat = dst.IsSubmatrix(); + bool continuous = dst.IsContinuous(); + + unsafe + { + byte* p = (byte*)(dst.Data); + long step = dst.Step(); + + // 1bppは手作業でコピー + if (bpp == 1) + { + if (submat) + throw new NotImplementedException("submatrix not supported"); + + // BitmapImageのデータを配列にコピー + // 要素1つに横8ピクセル分のデータが入っている。 + int stride = (w / 8) + 1; + byte[] pixels = new byte[h * stride]; + src.CopyPixels(pixels, stride, 0); + int x = 0; + for (int y = 0; y < h; y++) + { + int offset = y * stride; + // この行の各バイトを調べていく + for (int bytePos = 0; bytePos < stride; bytePos++) + { + if (x < w) + { + // 現在の位置のバイトからそれぞれのビット8つを取り出す + byte b = pixels[offset + bytePos]; + for (int i = 0; i < 8; i++) + { + if (x >= w) + { + break; + } + p[step * y + x] = ((b & 0x80) == 0x80) ? (byte)255 : (byte)0; + b <<= 1; + x++; + } + } + } + // 次の行へ + x = 0; + } + + } + // 8bpp + /*else if (bpp == 8) + { + int stride = w; + byte[] pixels = new byte[h * stride]; + src.CopyPixels(pixels, stride, 0); + for (int y = 0; y < h; y++) + { + for (int x = 0; x < w; x++) + { + p[step * y + x] = pixels[y * stride + x]; + } + } + }*/ + // 24bpp, 32bpp, ... + else + { + int stride = w * ((bpp + 7) / 8); + if (!submat && continuous) + { + long imageSize = dst.DataEnd.ToInt64() - dst.Data.ToInt64(); + if (imageSize < 0) + throw new OpenCvSharpException("The mat has invalid data pointer"); + if (imageSize > Int32.MaxValue) + throw new OpenCvSharpException("Too big mat data"); + src.CopyPixels(Int32Rect.Empty, dst.Data, (int)imageSize, stride); + } + else + { + // 高さ1pxの矩形ごと(≒1行ごと)にコピー + var roi = new Int32Rect { X = 0, Y = 0, Width = w, Height = 1 }; + IntPtr dstData = dst.Data; + for (int y = 0; y < h; y++) + { + roi.Y = y; + src.CopyPixels(roi, dstData, stride, stride); + dstData = new IntPtr(dstData.ToInt64() + stride); + } + } + } + + } + } + +#if LANG_JP + /// + /// System.Windows.Media.Imaging.BitmapSource から Mat へピクセルデータをコピーする + /// + /// + /// + /// +#else + /// + /// Copies pixel data from System.Windows.Media.Imaging.BitmapSource to IplImage instance + /// + /// + /// + /// +#endif + public static void CopyFrom(this Mat mat, BitmapSource wb) + { + if (wb == null) + throw new ArgumentNullException("wb"); + + ToMat(wb, mat); + } + + #endregion + } +} diff --git a/src/OpenCvSharp.Extensions/CvExtensions.cs b/src/OpenCvSharp.Extensions/CvExtensions.cs new file mode 100644 index 000000000..b39bbd897 --- /dev/null +++ b/src/OpenCvSharp.Extensions/CvExtensions.cs @@ -0,0 +1,318 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +//using System.Threading.Tasks; + +#pragma warning disable 1591 + +namespace OpenCvSharp.Extensions +{ +#if LANG_JP + /// + /// + /// +#else + /// + /// + /// +#endif + public static class CvExtensions + { + #region HoughLinesProbabilisticEx +#if LANG_JP + /// + /// 検出する線分の角度を指定できる確率的ハフ変換 + /// + /// 入力画像 + /// 距離解像度(1ピクセル当たりの単位) + /// 角度解像度(ラジアン単位) + /// 閾値パラメータ.対応する投票数がthresholdより大きい場合のみ,抽出された線が返される. + /// 最小の線の長さ + /// 同一線上に存在する線分として扱う,二つの線分の最大の間隔. + /// 検出する線分の角度の範囲の最小値 [0 <= θ <= π] + /// 検出する線分の角度の範囲の最大値 [0 <= θ <= π] + /// +#else + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// +#endif + public static LineSegmentPoint[] HoughLinesProbabilisticEx(this Mat img, double rho, double theta, int threshold, double minLineLength, double maxLineGap, + double thetaMin = 0, double thetaMax = Math.PI) + { + if (img == null) + throw new ArgumentNullException("img"); + if (img.Type() != MatType.CV_8UC1) + throw new ArgumentException("The source matrix must be 8-bit, single-channel image."); + if (rho <= 0) + throw new ArgumentOutOfRangeException("rho"); + if (theta <= 0) + throw new ArgumentOutOfRangeException("theta"); + if (threshold <= 0) + throw new ArgumentOutOfRangeException("threshold"); + if (minLineLength <= 0) + throw new ArgumentOutOfRangeException("minLineLength"); + if (thetaMax < thetaMin) + throw new ArgumentException(); + if (thetaMax > Math.PI) + throw new ArgumentOutOfRangeException("thetaMax", "thetaMax <= pi"); + if (thetaMin < 0) + throw new ArgumentOutOfRangeException("thetaMin", "thetaMin >= 0"); + + unsafe + { + // 画像パラメータの収集 + byte* data = (byte*)img.DataStart; + int width = img.Cols; + int height = img.Rows; + int step = (int)img.Step(); + + + // sin, cosのLUTを作っておく + double numAngleAll = Math.PI / theta; + int angleMin = (int)Math.Round(numAngleAll * (thetaMin / Math.PI)); //(int)Math.Round(thetaMin * 180 / Cv.PI); + int angleMax = (int)Math.Round(numAngleAll * (thetaMax / Math.PI)); + int numAngle = angleMax - angleMin; + int numRho = (int)Math.Round(((width + height) * 2 + 1) / rho); + double[] sin = new double[angleMax]; // 大きめに作成。angleMinより手前の要素は使わない + double[] cos = new double[angleMax]; + { + double rad = thetaMin; + double irho = 1 / rho; + for (int t = angleMin; t < angleMax; t++, rad += theta) + { + sin[t] = Math.Sin(rad * irho); + cos[t] = Math.Cos(rad * irho); + } + } + + // 1. 非0の点を収集 + Point[] points = new Point[Cv2.CountNonZero(img)]; + bool[] mask = new bool[width * height]; + int i = 0; + for (int y = 0; y < height; y++) + { + byte* p = data + y * step; + int offset = y * width; + for (int x = 0; x < width; x++) + { + if (p[x] != 0) + { + mask[offset + x] = true; + points[i++] = new Point(x, y); + } + else + { + mask[offset + x] = false; + } + } + } + + // ランダムな順に並び変え + Shuffle(points); + + // 2. 画素をランダムに選択し処理 + var accum = new int[numAngle * numRho]; + var result = new List(); + for (int count = 0; count < points.Length; count++) + { + Point pt = points[count]; + + // 画素データが更新されているのは除外 + if (!mask[pt.Y * width + pt.X]) + continue; + + // 2.1 [θ,ρ]空間で投票し、投票値が最大値となるθを求める + int maxR = threshold - 1; + int maxT = 0; + fixed (int* paccum = accum) + { + int* adata = paccum; + for (int t = angleMin; t < angleMax; t++, adata += numRho) + { + int r = (int)Math.Round(pt.X * cos[t] + pt.Y * sin[t]); + r += (numRho - 1) / 2; + int val = ++adata[r]; + if (maxR < val) + { + maxR = val; + maxT = t; + } + } + } + + if (maxR < threshold) + continue; + + // 2.2 追尾用の増分値 (dx0,dy0) の設定 + double a = -sin[maxT]; + double b = cos[maxT]; + int x0 = pt.X; + int y0 = pt.Y; + int dx0, dy0; + bool xflag; + const int shift = 16; + if (Math.Abs(a) > Math.Abs(b)) + { + xflag = true; + dx0 = a > 0 ? 1 : -1; + dy0 = (int)Math.Round(b * (1 << shift) / Math.Abs(a)); + y0 = (y0 << shift) + (1 << (shift - 1)); + } + else + { + xflag = false; + dy0 = b > 0 ? 1 : -1; + dx0 = (int)Math.Round(a * (1 << shift) / Math.Abs(b)); + x0 = (x0 << shift) + (1 << (shift - 1)); + } + + // 2.3 線分画素を両端方向に追尾し、線分を抽出 + Point[] lineEnd = { new Point(), new Point() }; + for (int k = 0; k < 2; k++) + { + int gap = 0; + int x = x0, y = y0, dx = dx0, dy = dy0; + + if (k > 0) + { + dx = -dx; + dy = -dy; + } + + // walk along the line using fixed-point arithmetics, + // stop at the image border or in case of too big gap + for (; ; x += dx, y += dy) + { + int x1, y1; + + if (xflag) + { + x1 = x; + y1 = y >> shift; + } + else + { + x1 = x >> shift; + y1 = y; + } + + if (x1 < 0 || x1 >= width || y1 < 0 || y1 >= height) + break; + + // for each non-zero point: + // update line end, + // clear the mask element + // reset the gap + if (mask[y1 * width + x1]) + { + gap = 0; + lineEnd[k].X = x1; + lineEnd[k].Y = y1; + } + else if (++gap > maxLineGap) + break; + } + } + + // lineLengthより長いものを線分候補とする + bool goodLine = Math.Abs(lineEnd[1].X - lineEnd[0].X) >= minLineLength || + Math.Abs(lineEnd[1].Y - lineEnd[0].Y) >= minLineLength; + + // 2.4 追尾した画素を削除し、次回以降は処理されないようにする + //if (processOnce) + { + for (int k = 0; k < 2; k++) + { + int x = x0, y = y0, dx = dx0, dy = dy0; + + if (k > 0) + { + dx = -dx; + dy = -dy; + } + + // walk along the line using fixed-point arithmetics, + // stop at the image border or in case of too big gap + for (; ; x += dx, y += dy) + { + int x1, y1; + + if (xflag) + { + x1 = x; + y1 = y >> shift; + } + else + { + x1 = x >> shift; + y1 = y; + } + + // for each non-zero point: + // update line end, + // clear the mask element + // reset the gap + if (mask[y1 * width + x1]) + { + if (goodLine) + { + fixed (int* paccum = accum) + { + int* adata = paccum; + for (int t = angleMin; t < angleMax; t++, adata += numRho) + { + int r = (int)Math.Round(x1 * cos[t] + y1 * sin[t]); + r += (numRho - 1) / 2; + adata[r]--; + } + } + } + mask[y1 * width + x1] = false; + } + + if (y1 == lineEnd[k].Y && x1 == lineEnd[k].X) + break; + } + } + } + + if (goodLine) + { + result.Add(new LineSegmentPoint(lineEnd[0], lineEnd[1])); + } + } + + return result.ToArray(); + } + } + + private static void Shuffle(IList list) + { + var rand = new Random(); + for (int i = list.Count; i > 1; i--) + { + int j = rand.Next(i); + Swap(list, j, i - 1); + } + } + private static void Swap(IList list, int i1, int i2) + { + T temp = list[i1]; + list[i1] = list[i2]; + list[i2] = temp; + } + #endregion + } +} diff --git a/src/OpenCvSharp.Extensions/Key.snk b/src/OpenCvSharp.Extensions/Key.snk new file mode 100644 index 000000000..a1e033087 Binary files /dev/null and b/src/OpenCvSharp.Extensions/Key.snk differ diff --git a/src/OpenCvSharp.Extensions/MyParallel.cs b/src/OpenCvSharp.Extensions/MyParallel.cs new file mode 100644 index 000000000..235d22930 --- /dev/null +++ b/src/OpenCvSharp.Extensions/MyParallel.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; + +namespace OpenCvSharp.Extensions +{ + /// + /// Task Parallel Library for .NET 2.0 + /// + internal static class MyParallel + { + /// + /// Number of Threads + /// + private static readonly int NumThread = Environment.ProcessorCount; + + /// + /// Executes a for loop in which iterations may run in parallel. + /// + /// The start index, inclusive. + /// The end index, exclusive. + /// The delegate that is invoked once per iteration. + public static void For(int fromInclusive, int toExclusive, Action body) + { + Thread[] threads = new Thread[NumThread]; + for (int i = 0; i < NumThread; i++) + { + threads[i] = new Thread(delegate(object arg) + { + ForRange range = (ForRange)arg; + for (int j = range.Start; j < range.End; j++) + { + body(j); + } + }); + } + for (int i = 0; i < NumThread; i++) + threads[i].Start(new ForRange(fromInclusive, toExclusive, i)); + for (int i = 0; i < NumThread; i++) + threads[i].Join(); + } + + private struct ForRange + { + public int Start; + public int End; + + public ForRange(int fromInclusive, int toExclusive, int threadID) + { + Start = DividingPoint(fromInclusive, toExclusive, threadID); + End = DividingPoint(fromInclusive, toExclusive, threadID + 1); + } + + private static int DividingPoint(int fromInclusive, int toExclusive, int threadID) + { + return fromInclusive + (toExclusive - fromInclusive) * threadID / NumThread; + } + } + } +} \ No newline at end of file diff --git a/src/OpenCvSharp.Extensions/OpenCvSharp.Extensions.csproj b/src/OpenCvSharp.Extensions/OpenCvSharp.Extensions.csproj new file mode 100644 index 000000000..7df774a9c --- /dev/null +++ b/src/OpenCvSharp.Extensions/OpenCvSharp.Extensions.csproj @@ -0,0 +1,99 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {F1110C7B-46B1-4504-871E-135B57F9DE67} + Library + Properties + OpenCvSharp.Extensions + OpenCvSharp.Extensions + v3.5 + 512 + + + 3.5 + + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + bin\Release\OpenCvSharp.Extensions.XML + + + bin\Release JP\ + TRACE + true + pdbonly + AnyCPU + prompt + true + bin\Release JP\OpenCvSharp.Extensions.XML + + + true + + + Key.snk + + + + 3.0 + + + + + 3.0 + + + + + + + + + + + + + + + + + + {524cc7b4-75b9-4925-9da4-3dacd40f4814} + OpenCvSharp + + + + + + + + + \ No newline at end of file diff --git a/src/OpenCvSharp.Extensions/Platform.cs b/src/OpenCvSharp.Extensions/Platform.cs new file mode 100644 index 000000000..03d3228c0 --- /dev/null +++ b/src/OpenCvSharp.Extensions/Platform.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Text; + +#pragma warning disable 1591 + +namespace OpenCvSharp.Extensions +{ + /// + /// + /// + internal enum OS + { + Windows, + Unix + } + + /// + /// + /// + internal enum Runtime + { + DotNet, + Mono + } + + /// + /// Provides information for the platform which the user is using + /// + internal static class Platform + { + /// + /// OS type + /// + public static readonly OS OS; + /// + /// Runtime type + /// + public static readonly Runtime Runtime; + + static Platform() + { + int p = (int)Environment.OSVersion.Platform; + OS = ((p == 4) || (p == 6) || (p == 128)) ? OS.Unix : OS.Windows; + + Runtime = (Type.GetType("Mono.Runtime") == null) ? Runtime.Mono : Runtime.DotNet; + } + } +} diff --git a/src/OpenCvSharp.Extensions/Properties/AssemblyInfo.cs b/src/OpenCvSharp.Extensions/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..0bf650a75 --- /dev/null +++ b/src/OpenCvSharp.Extensions/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 +// アセンブリに関連付けられている情報を変更するには、 +// これらの属性値を変更してください。 +[assembly: AssemblyTitle("OpenCvSharp.Extensions")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OpenCvSharp.Extensions")] +[assembly: AssemblyCopyright("Copyright © 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから +// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 +// その型の ComVisible 属性を true に設定してください。 +[assembly: ComVisible(false)] + +// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です +[assembly: Guid("3aace9d7-122c-49c7-8268-530cac659d32")] + +// アセンブリのバージョン情報は、以下の 4 つの値で構成されています: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を +// 既定値にすることができます: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/OpenCvSharp.Extensions/WriteableBitmapConverter.cs b/src/OpenCvSharp.Extensions/WriteableBitmapConverter.cs new file mode 100644 index 000000000..ac0d19566 --- /dev/null +++ b/src/OpenCvSharp.Extensions/WriteableBitmapConverter.cs @@ -0,0 +1,334 @@ +using System; +using System.Collections.Generic; +using System.Windows; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using OpenCvSharp.Util; + +namespace OpenCvSharp.Extensions +{ + /// + /// Static class which provides conversion between System.Windows.Media.Imaging.WriteableBitmap and IplImage + /// + public static class WriteableBitmapConverter + { + private static readonly Dictionary optimumChannels; + private static readonly Dictionary optimumTypes; + + static WriteableBitmapConverter() + { + optimumChannels = new Dictionary(); + optimumChannels[PixelFormats.Indexed1] = + optimumChannels[PixelFormats.Indexed8] = + optimumChannels[PixelFormats.Gray2] = + optimumChannels[PixelFormats.Gray4] = + optimumChannels[PixelFormats.Gray8] = + optimumChannels[PixelFormats.Gray16] = + optimumChannels[PixelFormats.Gray32Float] = + optimumChannels[PixelFormats.Indexed1] = + optimumChannels[PixelFormats.Indexed2] = + optimumChannels[PixelFormats.Indexed4] = + optimumChannels[PixelFormats.Indexed8] = + optimumChannels[PixelFormats.BlackWhite] = 1; + optimumChannels[PixelFormats.Bgr24] = + optimumChannels[PixelFormats.Bgr555] = + optimumChannels[PixelFormats.Bgr565] = + optimumChannels[PixelFormats.Rgb24] = + optimumChannels[PixelFormats.Rgb48] = + optimumChannels[PixelFormats.Rgb128Float] = 3; + optimumChannels[PixelFormats.Bgr32] = + optimumChannels[PixelFormats.Bgra32] = + optimumChannels[PixelFormats.Cmyk32] = + optimumChannels[PixelFormats.Pbgra32] = + optimumChannels[PixelFormats.Prgba64] = + optimumChannels[PixelFormats.Prgba128Float] = + optimumChannels[PixelFormats.Rgba64] = + optimumChannels[PixelFormats.Rgba128Float] = 4; + + optimumTypes = new Dictionary(); + optimumTypes[PixelFormats.Indexed1] = + optimumTypes[PixelFormats.Indexed8] = + optimumTypes[PixelFormats.Gray2] = + optimumTypes[PixelFormats.Gray4] = + optimumTypes[PixelFormats.Gray8] = + optimumTypes[PixelFormats.Indexed1] = + optimumTypes[PixelFormats.Indexed2] = + optimumTypes[PixelFormats.Indexed4] = + optimumTypes[PixelFormats.Indexed8] = + optimumTypes[PixelFormats.BlackWhite] = MatType.CV_8UC1; + optimumTypes[PixelFormats.Gray16] = MatType.CV_16UC1; + optimumTypes[PixelFormats.Rgb48] = MatType.CV_16UC3; + optimumTypes[PixelFormats.Rgba64] = MatType.CV_16UC4; + optimumTypes[PixelFormats.Pbgra32] = + optimumTypes[PixelFormats.Prgba64] = MatType.CV_32SC4; + optimumTypes[PixelFormats.Gray32Float] = MatType.CV_32FC1; + optimumTypes[PixelFormats.Rgb128Float] = MatType.CV_32FC3; + optimumTypes[PixelFormats.Prgba128Float] = + optimumTypes[PixelFormats.Rgba128Float] = MatType.CV_32FC4; + optimumTypes[PixelFormats.Bgr24] = + optimumTypes[PixelFormats.Rgb24] = + optimumTypes[PixelFormats.Bgr555] = + optimumTypes[PixelFormats.Bgr565] = MatType.CV_8UC3; + optimumTypes[PixelFormats.Bgr32] = + optimumTypes[PixelFormats.Bgra32] = + optimumTypes[PixelFormats.Cmyk32] = MatType.CV_8UC4; + } + + /// + /// 指定したPixelFormatに適合するIplImageのチャンネル数を返す + /// + /// + /// + internal static int GetOptimumChannels(PixelFormat f) + { + try + { + return optimumChannels[f]; + } + catch (KeyNotFoundException) + { + throw new ArgumentException("Not supported PixelFormat"); + } + } + + /// + /// 指定したPixelFormatに適合するMatTypeを返す + /// + /// + /// + internal static MatType GetOptimumType(PixelFormat f) + { + try + { + return optimumTypes[f]; + } + catch (KeyNotFoundException) + { + throw new ArgumentException("Not supported PixelFormat"); + } + } + + /// + /// 指定したIplImageのビット深度・チャンネル数に適合するPixelFormatを返す + /// + /// + /// + private static PixelFormat GetOptimumPixelFormats(MatType type) + { + if (type == MatType.CV_8UC1 || type == MatType.CV_8SC1) + return PixelFormats.Gray8; + if (type == MatType.CV_8UC3 || type == MatType.CV_8SC3) + return PixelFormats.Bgr24; + if (type == MatType.CV_8UC4 || type == MatType.CV_8SC4) + return PixelFormats.Bgra32; + + if (type == MatType.CV_16UC1 || type == MatType.CV_16SC1) + return PixelFormats.Gray16; + if (type == MatType.CV_16UC3 || type == MatType.CV_16SC3) + return PixelFormats.Rgb48; + if (type == MatType.CV_16UC4 || type == MatType.CV_16SC4) + return PixelFormats.Rgba64; + + if (type == MatType.CV_32SC4) + return PixelFormats.Prgba64; + + if (type == MatType.CV_32FC1) + return PixelFormats.Gray32Float; + if (type == MatType.CV_32FC3) + return PixelFormats.Rgb128Float; + if (type == MatType.CV_32FC4) + return PixelFormats.Rgba128Float; + + throw new ArgumentOutOfRangeException("type", "Not supported MatType"); + } + + #region ToWriteableBitmap +#if LANG_JP + /// + /// MatをWriteableBitmapに変換する. 引数はWriteableBitmapのコンストラクタに相当する. + /// + /// 変換するMat + /// ビットマップの水平ドット/インチ (dpi) + /// ビットマップの垂直ドット/インチ (dpi) + /// ビットマップの PixelFormat + /// ビットマップの BitmapPalette + /// WPFのWriteableBitmap +#else + /// + /// Converts Mat to WriteableBitmap. + /// The arguments of this method corresponds the consructor of WriteableBitmap. + /// + /// Input Mat + /// Horizontal dots per inch + /// Vertical dots per inch + /// Pixel format of output WriteableBitmap + /// Bitmap pallette + /// WriteableBitmap +#endif + public static WriteableBitmap ToWriteableBitmap(this Mat src, double dpiX, double dpiY, PixelFormat pf, BitmapPalette bp) + { + if (src == null) + throw new ArgumentNullException("src"); + + var wb = new WriteableBitmap(src.Width, src.Height, dpiX, dpiY, pf, bp); + ToWriteableBitmap(src, wb); + return wb; + } +#if LANG_JP + /// + /// MatをWriteableBitmapに変換する (dpi=96, BitmapPalette=null) + /// + /// 変換するMat + /// ビットマップの PixelFormat + /// WPFのWriteableBitmap +#else + /// + /// Converts Mat to WriteableBitmap (dpi=96, BitmapPalette=null) + /// + /// Input Mat + /// Pixel format of output WriteableBitmap + /// WriteableBitmap +#endif + public static WriteableBitmap ToWriteableBitmap(this Mat src, PixelFormat pf) + { + return ToWriteableBitmap(src, 96, 96, pf, null); + } +#if LANG_JP + /// + /// MatをWriteableBitmapに変換する (dpi=96, BitmapPalette=null) + /// + /// 変換するMat + /// WPFのWriteableBitmap +#else + /// + /// Converts Mat to WriteableBitmap (dpi=96, BitmapPalette=null) + /// + /// Input Mat + /// WriteableBitmap +#endif + public static WriteableBitmap ToWriteableBitmap(this Mat src) + { + PixelFormat pf = GetOptimumPixelFormats(src.Type()); + return ToWriteableBitmap(src, 96, 96, pf, null); + } + +#if LANG_JP + /// + /// MatをWriteableBitmapに変換する. + /// 返却値を新たに生成せず引数で指定したWriteableBitmapに格納するので、メモリ効率が良い。 + /// + /// 変換するMat + /// 変換結果を設定するWriteableBitmap +#else + /// + /// Converts Mat to WriteableBitmap. + /// This method is more efficient because new instance of WriteableBitmap is not allocated. + /// + /// Input Mat + /// Output WriteableBitmap +#endif + public static void ToWriteableBitmap(Mat src, WriteableBitmap dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (src.Width != dst.PixelWidth || src.Height != dst.PixelHeight) + throw new ArgumentException("size of src must be equal to size of dst"); + //if (src.Depth != BitDepth.U8) + //throw new ArgumentException("bit depth of src must be BitDepth.U8", "src"); + if (src.Dims() > 2) + throw new ArgumentException("Mat dimensions must be 2"); + + int w = src.Width; + int h = src.Height; + int bpp = dst.Format.BitsPerPixel; + + int channels = GetOptimumChannels(dst.Format); + if (src.Channels() != channels) + { + throw new ArgumentException("channels of dst != channels of PixelFormat", "dst"); + } + + bool submat = src.IsSubmatrix(); + bool continuous = src.IsContinuous(); + unsafe + { + byte* pSrc = (byte*)(src.Data); + int sstep = (int)src.Step(); + + if (bpp == 1) + { + if (submat) + throw new NotImplementedException("submatrix not supported"); + + // 手作業で移し替える + int stride = w / 8 + 1; + if (stride < 2) + stride = 2; + + byte[] pixels = new byte[h * stride]; + + for (int x = 0, y = 0; y < h; y++) + { + int offset = y * stride; + for (int bytePos = 0; bytePos < stride; bytePos++) + { + if (x < w) + { + byte b = 0; + // 現在の位置から横8ピクセル分、ビットがそれぞれ立っているか調べ、1つのbyteにまとめる + for (int i = 0; i < 8; i++) + { + b <<= 1; + if (x < w && pSrc[sstep * y + x] != 0) + { + b |= 1; + } + x++; + } + pixels[offset + bytePos] = b; + } + } + x = 0; + } + dst.WritePixels(new Int32Rect(0, 0, w, h), pixels, stride, 0); + return; + } + + // 一気にコピー + if (!submat && continuous) + { + long imageSize = src.DataEnd.ToInt64() - src.Data.ToInt64(); + if (imageSize < 0) + throw new OpenCvSharpException("The mat has invalid data pointer"); + if (imageSize > Int32.MaxValue) + throw new OpenCvSharpException("Too big mat data"); + dst.WritePixels(new Int32Rect(0, 0, w, h), src.Data, (int)imageSize, sstep); + return; + } + + // 一列ごとにコピー + try + { + dst.Lock(); + + int dstep = dst.BackBufferStride; + byte* pDst = (byte*)dst.BackBuffer; + + for (int y = 0; y < h; y++) + { + long offsetSrc = (y * sstep); + long offsetDst = (y * dstep); + Utility.CopyMemory(pDst + offsetDst, pSrc + offsetSrc, w * channels); + } + } + finally + { + dst.Unlock(); + } + } + } + #endregion + } +} diff --git a/src/OpenCvSharp.NUnitTest/Image/Blob/shapes1.png b/src/OpenCvSharp.NUnitTest/Image/Blob/shapes1.png new file mode 100644 index 000000000..7b754adec Binary files /dev/null and b/src/OpenCvSharp.NUnitTest/Image/Blob/shapes1.png differ diff --git a/src/OpenCvSharp.NUnitTest/Image/Blob/shapes2.png b/src/OpenCvSharp.NUnitTest/Image/Blob/shapes2.png new file mode 100644 index 000000000..d6dcda62b Binary files /dev/null and b/src/OpenCvSharp.NUnitTest/Image/Blob/shapes2.png differ diff --git a/src/OpenCvSharp.NUnitTest/Image/Blob/shapes3.png b/src/OpenCvSharp.NUnitTest/Image/Blob/shapes3.png new file mode 100644 index 000000000..159a49681 Binary files /dev/null and b/src/OpenCvSharp.NUnitTest/Image/Blob/shapes3.png differ diff --git a/src/OpenCvSharp.NUnitTest/InvokeTest.cs b/src/OpenCvSharp.NUnitTest/InvokeTest.cs new file mode 100644 index 000000000..976b48876 --- /dev/null +++ b/src/OpenCvSharp.NUnitTest/InvokeTest.cs @@ -0,0 +1,101 @@ +using System; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using NUnit.Core; +using NUnit.Framework; +using OpenCvSharp; + +namespace OpenCvSharp.NUnitTest +{ + [TestFixture] + public class InvokeTest + { + [Test] + public void ExistsAllEntryPoints() + { + var type = typeof (NativeMethods); + var methods = type.GetMethods(BindingFlags.Public | BindingFlags.Static); + + foreach (var method in methods) + { + var parameters = method.GetParameters(); + var values = new object[parameters.Length]; + + for (int i = 0; i < parameters.Length; i++) + { + var paramType = parameters[i].ParameterType; + if (paramType == typeof (string)) + values[i] = ""; + else + values[i] = Activator.CreateInstance(parameters[i].ParameterType); + } + + /* + var task = Task.Factory.StartNew( + () => + { + try + { + Console.WriteLine(method.Name); + method.Invoke(null, values); + } + catch (Exception e) + { + Console.WriteLine("Caught one (inside):" + e.GetType().Name); + } + }); + try + { + task.Wait(1000); + } + catch (AggregateException ae) + { + // Assume we know what's going on with this particular exception. + // Rethrow anything else. AggregateException.Handle provides + // another way to express this. See later example. + foreach (var e in ae.InnerExceptions) + { + if (e is TargetInvocationException) + { + Console.WriteLine("After:" + e.GetType().Name + e.StackTrace); + } + else + { + throw; + } + } + } + */ + + ///* TODO + try + { + method.Invoke(null, values); + } + catch (AccessViolationException ex) + { + ex.ToString(); + } + catch (TargetInvocationException ex) + { + ex.ToString(); + } + catch (MissingMethodException ex) + { + Assert.Fail(ex.ToString()); + } + catch (Exception ex) + { + ex.ToString(); + } + //*/ + } + + } + } +} + diff --git a/src/OpenCvSharp.NUnitTest/OpenCvSharp.NUnitTest.csproj b/src/OpenCvSharp.NUnitTest/OpenCvSharp.NUnitTest.csproj new file mode 100644 index 000000000..763a9a106 --- /dev/null +++ b/src/OpenCvSharp.NUnitTest/OpenCvSharp.NUnitTest.csproj @@ -0,0 +1,152 @@ + + + + + Debug + AnyCPU + {76A4E76B-0A98-411D-92E9-5527B31EBA3C} + Library + Properties + OpenCvSharp.NUnitTest + OpenCvSharp.NUnitTest + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + MinimumRecommendedRules.ruleset + true + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + prompt + MinimumRecommendedRules.ruleset + true + + + true + bin\x64\Debug\ + DEBUG;TRACE + true + full + x64 + prompt + MinimumRecommendedRules.ruleset + + + bin\x64\Release\ + TRACE + true + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + + + + ..\packages\NUnitTestAdapter.1.0\lib\nunit.core.dll + False + + + ..\packages\NUnitTestAdapter.1.0\lib\nunit.core.interfaces.dll + False + + + ..\packages\NUnit.2.6.3\lib\nunit.framework.dll + + + ..\packages\NUnitTestAdapter.1.0\lib\nunit.util.dll + False + + + ..\packages\NUnitTestAdapter.1.0\lib\NUnit.VisualStudio.TestAdapter.dll + False + + + + + + + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + Always + + + Always + + + Always + + + + + {524cc7b4-75b9-4925-9da4-3dacd40f4814} + OpenCvSharp + + + + + \ No newline at end of file diff --git a/src/OpenCvSharp.NUnitTest/Properties/AssemblyInfo.cs b/src/OpenCvSharp.NUnitTest/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..da724d09b --- /dev/null +++ b/src/OpenCvSharp.NUnitTest/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 +// アセンブリに関連付けられている情報を変更するには、 +// これらの属性値を変更してください。 +[assembly: AssemblyTitle("OpenCvSharp.NUnitTest")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OpenCvSharp.NUnitTest")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから +// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 +// その型の ComVisible 属性を true に設定してください。 +[assembly: ComVisible(false)] + +// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です +[assembly: Guid("17dd7d17-213c-4d86-a2e4-a46ab00b36e3")] + +// アセンブリのバージョン情報は、以下の 4 つの値で構成されています: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を +// 既定値にすることができます: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/OpenCvSharp.NUnitTest/dll/x64/OpenCvSharpExtern.dll b/src/OpenCvSharp.NUnitTest/dll/x64/OpenCvSharpExtern.dll new file mode 100644 index 000000000..1574851c0 Binary files /dev/null and b/src/OpenCvSharp.NUnitTest/dll/x64/OpenCvSharpExtern.dll differ diff --git a/src/OpenCvSharp.NUnitTest/dll/x64/opencv_ffmpeg300_64.dll b/src/OpenCvSharp.NUnitTest/dll/x64/opencv_ffmpeg300_64.dll new file mode 100644 index 000000000..37236e542 Binary files /dev/null and b/src/OpenCvSharp.NUnitTest/dll/x64/opencv_ffmpeg300_64.dll differ diff --git a/src/OpenCvSharp.NUnitTest/dll/x64/opencv_world300.dll b/src/OpenCvSharp.NUnitTest/dll/x64/opencv_world300.dll new file mode 100644 index 000000000..ffddb13b8 Binary files /dev/null and b/src/OpenCvSharp.NUnitTest/dll/x64/opencv_world300.dll differ diff --git a/src/OpenCvSharp.NUnitTest/dll/x86/OpenCvSharpExtern.dll b/src/OpenCvSharp.NUnitTest/dll/x86/OpenCvSharpExtern.dll new file mode 100644 index 000000000..d6504c20a Binary files /dev/null and b/src/OpenCvSharp.NUnitTest/dll/x86/OpenCvSharpExtern.dll differ diff --git a/src/OpenCvSharp.NUnitTest/dll/x86/opencv_ffmpeg300.dll b/src/OpenCvSharp.NUnitTest/dll/x86/opencv_ffmpeg300.dll new file mode 100644 index 000000000..b1e70df6a Binary files /dev/null and b/src/OpenCvSharp.NUnitTest/dll/x86/opencv_ffmpeg300.dll differ diff --git a/src/OpenCvSharp.NUnitTest/dll/x86/opencv_world300.dll b/src/OpenCvSharp.NUnitTest/dll/x86/opencv_world300.dll new file mode 100644 index 000000000..b0b5169ed Binary files /dev/null and b/src/OpenCvSharp.NUnitTest/dll/x86/opencv_world300.dll differ diff --git a/src/OpenCvSharp.NUnitTest/packages.config b/src/OpenCvSharp.NUnitTest/packages.config new file mode 100644 index 000000000..fd33d576f --- /dev/null +++ b/src/OpenCvSharp.NUnitTest/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/OpenCvSharp.ReleaseMaker/Ionic.Zip.dll b/src/OpenCvSharp.ReleaseMaker/Ionic.Zip.dll new file mode 100644 index 000000000..7b11577fa Binary files /dev/null and b/src/OpenCvSharp.ReleaseMaker/Ionic.Zip.dll differ diff --git a/src/OpenCvSharp.ReleaseMaker/MainForm.Designer.cs b/src/OpenCvSharp.ReleaseMaker/MainForm.Designer.cs new file mode 100644 index 000000000..78c7e20d4 --- /dev/null +++ b/src/OpenCvSharp.ReleaseMaker/MainForm.Designer.cs @@ -0,0 +1,203 @@ +namespace OpenCvSharp.ReleaseMaker +{ + partial class MainForm + { + /// + /// 必要なデザイナ変数です。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 使用中のリソースをすべてクリーンアップします。 + /// + /// マネージ リソースが破棄される場合 true、破棄されない場合は false です。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows フォーム デザイナで生成されたコード + + /// + /// デザイナ サポートに必要なメソッドです。このメソッドの内容を + /// コード エディタで変更しないでください。 + /// + private void InitializeComponent() + { + this.textBox_Src = new System.Windows.Forms.TextBox(); + this.label_Src = new System.Windows.Forms.Label(); + this.menuStrip = new System.Windows.Forms.MenuStrip(); + this.toolStripMenuItem_File = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem_Exit = new System.Windows.Forms.ToolStripMenuItem(); + this.button_Src = new System.Windows.Forms.Button(); + this.button_Dst = new System.Windows.Forms.Button(); + this.label_Dst = new System.Windows.Forms.Label(); + this.textBox_Dst = new System.Windows.Forms.TextBox(); + this.button_Make = new System.Windows.Forms.Button(); + this.folderBrowserDialog_Src = new System.Windows.Forms.FolderBrowserDialog(); + this.folderBrowserDialog_Dst = new System.Windows.Forms.FolderBrowserDialog(); + this.label_Version = new System.Windows.Forms.Label(); + this.textBox_Version = new System.Windows.Forms.TextBox(); + this.menuStrip.SuspendLayout(); + this.SuspendLayout(); + // + // textBox_Src + // + this.textBox_Src.Location = new System.Drawing.Point(64, 47); + this.textBox_Src.Name = "textBox_Src"; + this.textBox_Src.Size = new System.Drawing.Size(377, 19); + this.textBox_Src.TabIndex = 0; + // + // label_Src + // + this.label_Src.AutoSize = true; + this.label_Src.Location = new System.Drawing.Point(12, 50); + this.label_Src.Name = "label_Src"; + this.label_Src.Size = new System.Drawing.Size(24, 12); + this.label_Src.TabIndex = 1; + this.label_Src.Text = "Src:"; + // + // menuStrip + // + this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripMenuItem_File}); + this.menuStrip.Location = new System.Drawing.Point(0, 0); + this.menuStrip.Name = "menuStrip"; + this.menuStrip.Size = new System.Drawing.Size(494, 24); + this.menuStrip.TabIndex = 3; + this.menuStrip.Text = "menuStrip1"; + // + // toolStripMenuItem_File + // + this.toolStripMenuItem_File.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripMenuItem_Exit}); + this.toolStripMenuItem_File.Name = "toolStripMenuItem_File"; + this.toolStripMenuItem_File.Size = new System.Drawing.Size(51, 20); + this.toolStripMenuItem_File.Text = "File(&F)"; + // + // toolStripMenuItem_Exit + // + this.toolStripMenuItem_Exit.Name = "toolStripMenuItem_Exit"; + this.toolStripMenuItem_Exit.Size = new System.Drawing.Size(108, 22); + this.toolStripMenuItem_Exit.Text = "Exit(&X)"; + this.toolStripMenuItem_Exit.Click += new System.EventHandler(this.toolStripMenuItem_Exit_Click); + // + // button_Src + // + this.button_Src.Location = new System.Drawing.Point(447, 43); + this.button_Src.Name = "button_Src"; + this.button_Src.Size = new System.Drawing.Size(35, 23); + this.button_Src.TabIndex = 4; + this.button_Src.Text = "..."; + this.button_Src.UseVisualStyleBackColor = true; + this.button_Src.Click += new System.EventHandler(this.button_Src_Click); + // + // button_Dst + // + this.button_Dst.Location = new System.Drawing.Point(447, 75); + this.button_Dst.Name = "button_Dst"; + this.button_Dst.Size = new System.Drawing.Size(35, 23); + this.button_Dst.TabIndex = 5; + this.button_Dst.Text = "..."; + this.button_Dst.UseVisualStyleBackColor = true; + this.button_Dst.Click += new System.EventHandler(this.button_Dst_Click); + // + // label_Dst + // + this.label_Dst.AutoSize = true; + this.label_Dst.Location = new System.Drawing.Point(11, 80); + this.label_Dst.Name = "label_Dst"; + this.label_Dst.Size = new System.Drawing.Size(25, 12); + this.label_Dst.TabIndex = 6; + this.label_Dst.Text = "Dst:"; + // + // textBox_Dst + // + this.textBox_Dst.Location = new System.Drawing.Point(64, 77); + this.textBox_Dst.Name = "textBox_Dst"; + this.textBox_Dst.Size = new System.Drawing.Size(377, 19); + this.textBox_Dst.TabIndex = 7; + // + // button_Make + // + this.button_Make.Location = new System.Drawing.Point(140, 145); + this.button_Make.Name = "button_Make"; + this.button_Make.Size = new System.Drawing.Size(232, 51); + this.button_Make.TabIndex = 8; + this.button_Make.Text = "Make"; + this.button_Make.UseVisualStyleBackColor = true; + this.button_Make.Click += new System.EventHandler(this.button_Make_Click); + // + // folderBrowserDialog_Src + // + this.folderBrowserDialog_Src.ShowNewFolderButton = false; + // + // label_Version + // + this.label_Version.AutoSize = true; + this.label_Version.Location = new System.Drawing.Point(12, 110); + this.label_Version.Name = "label_Version"; + this.label_Version.Size = new System.Drawing.Size(46, 12); + this.label_Version.TabIndex = 9; + this.label_Version.Text = "Version:"; + // + // textBox_Version + // + this.textBox_Version.Location = new System.Drawing.Point(64, 107); + this.textBox_Version.Name = "textBox_Version"; + this.textBox_Version.Size = new System.Drawing.Size(50, 19); + this.textBox_Version.TabIndex = 10; + this.textBox_Version.Text = "3.1.0"; + // + // MainForm + // + this.AcceptButton = this.button_Make; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(494, 213); + this.Controls.Add(this.textBox_Version); + this.Controls.Add(this.label_Version); + this.Controls.Add(this.button_Make); + this.Controls.Add(this.textBox_Dst); + this.Controls.Add(this.label_Dst); + this.Controls.Add(this.button_Dst); + this.Controls.Add(this.button_Src); + this.Controls.Add(this.menuStrip); + this.Controls.Add(this.label_Src); + this.Controls.Add(this.textBox_Src); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MainMenuStrip = this.menuStrip; + this.MaximizeBox = false; + this.Name = "MainForm"; + this.Text = "OpenCvSharp.ReleaseMaker"; + this.Load += new System.EventHandler(this.MainForm_Load); + this.menuStrip.ResumeLayout(false); + this.menuStrip.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox textBox_Src; + private System.Windows.Forms.Label label_Src; + private System.Windows.Forms.MenuStrip menuStrip; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem_File; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem_Exit; + private System.Windows.Forms.Button button_Src; + private System.Windows.Forms.Button button_Dst; + private System.Windows.Forms.Label label_Dst; + private System.Windows.Forms.TextBox textBox_Dst; + private System.Windows.Forms.Button button_Make; + private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog_Src; + private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog_Dst; + private System.Windows.Forms.Label label_Version; + private System.Windows.Forms.TextBox textBox_Version; + } +} + diff --git a/src/OpenCvSharp.ReleaseMaker/MainForm.cs b/src/OpenCvSharp.ReleaseMaker/MainForm.cs new file mode 100644 index 000000000..672a13dc7 --- /dev/null +++ b/src/OpenCvSharp.ReleaseMaker/MainForm.cs @@ -0,0 +1,303 @@ +using System; +using System.Windows.Forms; +using System.IO; +using System.Linq; +using Ionic.Zip; + +namespace OpenCvSharp.ReleaseMaker +{ + /// + /// + /// + public partial class MainForm : Form + { + /// + /// 2012 / 2013 + /// + private const string VisualStudioVersion = "2015"; + + private static readonly string[] dllFiles = { + @"OpenCvSharp\bin\Release\OpenCvSharp.dll", + @"OpenCvSharp\bin\Release\OpenCvSharp.dll.config", + @"OpenCvSharp.Blob\bin\Release\OpenCvSharp.Blob.dll", + @"OpenCvSharp.Blob\bin\Release\OpenCvSharp.Blob.dll.config", + @"OpenCvSharp.Extensions\bin\Release\OpenCvSharp.Extensions.dll", + @"OpenCvSharp.UserInterface\bin\Release\OpenCvSharp.UserInterface.dll", + }; + + private static readonly string debuggerVisualizerPath = + @"OpenCvSharp.DebuggerVisualizers{0}\bin\Release\OpenCvSharp.DebuggerVisualizers.dll"; + + private static readonly string[] debuggerVisualizerVersions = + { + "2010", "2012", "2013", "2015", + }; + + private static readonly string[] xmlFiles = { + @"OpenCvSharp\bin\{0}\OpenCvSharp.xml", + @"OpenCvSharp.Blob\bin\{0}\OpenCvSharp.Blob.xml", + @"OpenCvSharp.Extensions\bin\{0}\OpenCvSharp.Extensions.xml", + @"OpenCvSharp.UserInterface\bin\{0}\OpenCvSharp.UserInterface.xml", + }; + + private static readonly string[] platforms = { + "x86", + "x64" + }; + private static readonly string[] languages = { + "Release", + "Release JP" + }; + + private static readonly string[] ignoredExt = { + ".pdb", + ".bak", + ".user", + ".suo", + }; + private static readonly string[] ignoredDir = { + ".svn", + ".git", + "bin", + "obj", + }; + + /// + /// Constructor + /// + public MainForm() + { + InitializeComponent(); + } + + /// + /// OnLoad + /// + /// + /// + private void MainForm_Load(object sender, EventArgs e) + { + textBox_Src.Text = Path.Combine( + Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), + @"Visual Studio " + VisualStudioVersion + @"\Projects\OpenCvSharp"); + textBox_Dst.Text = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); + } + + /// + /// Exit + /// + /// + /// + private void toolStripMenuItem_Exit_Click(object sender, EventArgs e) + { + Application.Exit(); + } + + /// + /// Src + /// + /// + /// + private void button_Src_Click(object sender, EventArgs e) + { + folderBrowserDialog_Src.SelectedPath = textBox_Src.Text; + if (folderBrowserDialog_Src.ShowDialog(this) == DialogResult.OK) + { + textBox_Src.Text = folderBrowserDialog_Src.SelectedPath; + } + } + + /// + /// Dst + /// + /// + /// + private void button_Dst_Click(object sender, EventArgs e) + { + folderBrowserDialog_Dst.SelectedPath = textBox_Dst.Text; + if (folderBrowserDialog_Dst.ShowDialog(this) == DialogResult.OK) + { + textBox_Dst.Text = folderBrowserDialog_Dst.SelectedPath; + } + } + + /// + /// Make + /// + /// + /// + private void button_Make_Click(object sender, EventArgs e) + { + Button b = (Button)sender; + b.Enabled = false; + + MakeBinaryPackage(textBox_Src.Text, textBox_Dst.Text, textBox_Version.Text); + MakeSamplePackage(textBox_Src.Text, textBox_Dst.Text, textBox_Version.Text); + MessageBox.Show(@"Packages created successfully."); + + b.Enabled = true; + } + + /// + /// バイナリのzipパッケージを作成 + /// + /// + /// + /// + private void MakeBinaryPackage(string dir, string dirDst, string opencvVersion) + { + string dirSrc = Path.Combine(dir, "src"); + + foreach (string pf in platforms) + { + using (ZipFile zf = new ZipFile()) + { + // DLLを選択 + foreach (string f in dllFiles) + { + string dll = Path.Combine(dirSrc, f); + ZipEntry e = zf.AddFile(dll); + e.FileName = Path.GetFileName(dll); + } + + // XMLドキュメントコメントを選択 + foreach (string lang in languages) + { + foreach (string f in xmlFiles) + { + string xml = Path.Combine(dirSrc, String.Format(f, lang)); + ZipEntry e = zf.AddFile(xml); + string lg = lang.Contains("JP") ? "Japanese" : "English"; + e.FileName = Path.Combine("XmlDoc-" + lg, Path.GetFileName(xml)); + } + } + + // OpenCvSharpExtern.dllを選択 + { + string pfExtern = (pf == "x86") ? "Win32" : "x64"; + { + string externDir = Path.Combine(dirSrc, Path.Combine("Release", pfExtern)); + string externFile = Path.Combine(externDir, "OpenCvSharpExtern.dll"); + ZipEntry e = zf.AddFile(externFile); + e.FileName = Path.GetFileName(externFile); + } + } + + // Debugger Visualizerを選択 + foreach (string version in debuggerVisualizerVersions) + { + string dllFileName = Path.Combine(dirSrc, String.Format(debuggerVisualizerPath, version)); + string zipFileName = Path.Combine( + "DebuggerVisualizers", version, Path.GetFileName(debuggerVisualizerPath)); + ZipEntry e = zf.AddFile(dllFileName); + e.FileName = zipFileName; + } + + // テキストを選択 + { + ZipEntry e1 = zf.AddFile(Path.Combine(dir, "LICENSE.txt")); + e1.FileName = Path.GetFileName("LICENSE.txt"); + ZipEntry e2 = zf.AddFile(Path.Combine(dir, "README.md")); + e2.FileName = Path.GetFileName("README.md"); + } + + string dst = Path.Combine( + dirDst, GetBinaryDstDirName(pf, opencvVersion)) + ".zip"; + zf.Save(dst); + } + } + } + + /// + /// Sampleのzipアーカイブを作成 + /// + /// + /// + /// + private void MakeSamplePackage(string dirSrc, string dirDst, string version) + { + dirSrc = Path.Combine(dirSrc, "sample"); + dirDst = Path.Combine(dirDst, GetSampleDstDirName(version)); + + CopyDirectory(dirSrc, dirDst); + + using (var zf = new ZipFile()) + { + zf.AddDirectory(dirDst); + zf.Save(dirDst + ".zip"); + } + + Directory.Delete(dirDst, true); + } + + private string GetBinaryDstDirName(string pf, string version) + { + string date = DateTime.Now.ToString("yyyyMMdd"); + return string.Format("OpenCvSharp-{0}-{1}-{2}", version, pf, date); + } + private string GetSampleDstDirName(string version) + { + string date = DateTime.Now.ToString("yyyyMMdd"); + return string.Format("Sample-{0}-{1}", version, date); + } + + /// + /// ディレクトリの作成(既存のディレクトリがあれば削除してから) + /// + /// + private void CreateDirectory(string path) + { + if (Directory.Exists(path)) + { + Directory.Delete(path, true); + } + Directory.CreateDirectory(path); + } + + /// + /// ディレクトリをコピーする。 + /// .svn bin obj は除外。 + /// + /// コピーするディレクトリ + /// コピー先のディレクトリ + /// http://dobon.net/vb/dotnet/file/copyfolder.html から拝借 + private static void CopyDirectory( + string sourceDirName, string destDirName) + { + // コピー先のディレクトリがあれば削除 + if (Directory.Exists(destDirName)) + { + Directory.Delete(destDirName, true); + } + + // コピー先のディレクトリを作る + Directory.CreateDirectory(destDirName); + File.SetAttributes(destDirName, File.GetAttributes(sourceDirName)); + + // コピー先のディレクトリ名の末尾に"\"をつける + if (destDirName[destDirName.Length - 1] != Path.DirectorySeparatorChar) + { + destDirName = destDirName + Path.DirectorySeparatorChar; + } + + // コピー元のディレクトリにあるファイルをコピー + var files = from f in Directory.GetFiles(sourceDirName) + where !ignoredExt.Contains(Path.GetExtension(f)?.ToLower()) && Path.GetFileName(f) != "OpenCvSharp.DebuggerVisualizers.dll" + select f; + foreach (string file in files) + { + File.Copy(file, destDirName + Path.GetFileName(file), true); + } + + // コピー元のディレクトリにあるディレクトリについて、再帰的に呼び出す + var dirs = from d in Directory.GetDirectories(sourceDirName) + where !ignoredDir.Contains(Path.GetFileName(d)) + select d; + foreach (string dir in dirs) + { + CopyDirectory(dir, destDirName + Path.GetFileName(dir)); + } + } + + } +} diff --git a/src/OpenCvSharp.ReleaseMaker/MainForm.resx b/src/OpenCvSharp.ReleaseMaker/MainForm.resx new file mode 100644 index 000000000..ca2228f4a --- /dev/null +++ b/src/OpenCvSharp.ReleaseMaker/MainForm.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 16, 14 + + + 130, 14 + + + 330, 14 + + \ No newline at end of file diff --git a/src/OpenCvSharp.ReleaseMaker/OpenCvSharp.ReleaseMaker.csproj b/src/OpenCvSharp.ReleaseMaker/OpenCvSharp.ReleaseMaker.csproj new file mode 100644 index 000000000..1cd424dfb --- /dev/null +++ b/src/OpenCvSharp.ReleaseMaker/OpenCvSharp.ReleaseMaker.csproj @@ -0,0 +1,93 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {E2C8C528-B7C7-40AF-BB7F-1147A41E2E23} + WinExe + Properties + OpenCvSharp.ReleaseMaker + OpenCvSharp.ReleaseMaker + v4.0 + 512 + + + 3.5 + + Client + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + 3.5 + + + + + + + + Form + + + MainForm.cs + + + + + MainForm.cs + Designer + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + \ No newline at end of file diff --git a/src/OpenCvSharp.ReleaseMaker/Program.cs b/src/OpenCvSharp.ReleaseMaker/Program.cs new file mode 100644 index 000000000..f58f00238 --- /dev/null +++ b/src/OpenCvSharp.ReleaseMaker/Program.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace OpenCvSharp.ReleaseMaker +{ + static class Program + { + /// + /// アプリケーションのメイン エントリ ポイントです。 + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); + } + } +} diff --git a/src/OpenCvSharp.ReleaseMaker/Properties/AssemblyInfo.cs b/src/OpenCvSharp.ReleaseMaker/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..de458310c --- /dev/null +++ b/src/OpenCvSharp.ReleaseMaker/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 +// アセンブリに関連付けられている情報を変更するには、 +// これらの属性値を変更してください。 +[assembly: AssemblyTitle("OpenCvSharp.ReleaseMaker")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OpenCvSharp.ReleaseMaker")] +[assembly: AssemblyCopyright("Copyright © 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから +// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 +// その型の ComVisible 属性を true に設定してください。 +[assembly: ComVisible(false)] + +// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です +[assembly: Guid("4af74c3c-4d5c-44e6-9175-af009d755dec")] + +// アセンブリのバージョン情報は、以下の 4 つの値で構成されています: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を +// 既定値にすることができます: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/OpenCvSharp.ReleaseMaker/Properties/Resources.Designer.cs b/src/OpenCvSharp.ReleaseMaker/Properties/Resources.Designer.cs new file mode 100644 index 000000000..f134f0f84 --- /dev/null +++ b/src/OpenCvSharp.ReleaseMaker/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// このコードはツールによって生成されました。 +// ランタイム バージョン:4.0.30319.34014 +// +// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、 +// コードが再生成されるときに損失したりします。 +// +//------------------------------------------------------------------------------ + +namespace OpenCvSharp.ReleaseMaker.Properties { + using System; + + + /// + /// ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。 + /// + // このクラスは StronglyTypedResourceBuilder クラスが ResGen + // または Visual Studio のようなツールを使用して自動生成されました。 + // メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に + // ResGen を実行し直すか、または VS プロジェクトをビルドし直します。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// このクラスで使用されているキャッシュされた ResourceManager インスタンスを返します。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenCvSharp.ReleaseMaker.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 厳密に型指定されたこのリソース クラスを使用して、すべての検索リソースに対し、 + /// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/src/OpenCvSharp.ReleaseMaker/Properties/Resources.resx b/src/OpenCvSharp.ReleaseMaker/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/src/OpenCvSharp.ReleaseMaker/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/OpenCvSharp.ReleaseMaker/Properties/Settings.Designer.cs b/src/OpenCvSharp.ReleaseMaker/Properties/Settings.Designer.cs new file mode 100644 index 000000000..98cd7154f --- /dev/null +++ b/src/OpenCvSharp.ReleaseMaker/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// このコードはツールによって生成されました。 +// ランタイム バージョン:4.0.30319.34014 +// +// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、 +// コードが再生成されるときに損失したりします。 +// +//------------------------------------------------------------------------------ + +namespace OpenCvSharp.ReleaseMaker.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/src/OpenCvSharp.ReleaseMaker/Properties/Settings.settings b/src/OpenCvSharp.ReleaseMaker/Properties/Settings.settings new file mode 100644 index 000000000..39645652a --- /dev/null +++ b/src/OpenCvSharp.ReleaseMaker/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/OpenCvSharp.ReleaseMaker/app.config b/src/OpenCvSharp.ReleaseMaker/app.config new file mode 100644 index 000000000..e2a5a1876 --- /dev/null +++ b/src/OpenCvSharp.ReleaseMaker/app.config @@ -0,0 +1,3 @@ + + + diff --git a/src/OpenCvSharp.Sandbox/MyProcess.cs b/src/OpenCvSharp.Sandbox/MyProcess.cs new file mode 100644 index 000000000..740932679 --- /dev/null +++ b/src/OpenCvSharp.Sandbox/MyProcess.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; + +namespace OpenCvSharp.Sandbox +{ + /// + /// + /// + public static class MyProcess + { + /// + /// 物理メモリ使用量 + /// + /// + public static long WorkingSet64 + { + get + { + using (var proc = GetCurrentProcess()) + { + return proc.WorkingSet64; + } + } + } + + /// + /// 仮想メモリ使用量 + /// + /// + public static long VirtualMemorySize64 + { + get + { + using (var proc = GetCurrentProcess()) + { + return proc.VirtualMemorySize64; + } + } + } + + /// + /// 物理メモリ最大使用量 + /// + /// + public static long PeakPagedMemorySize64 + { + get + { + using (var proc = GetCurrentProcess()) + { + return proc.PeakPagedMemorySize64; + } + } + } + + /// + /// 仮想メモリ最大使用量 + /// + /// + public static long PeakVirtualMemorySize64 + { + get + { + using (var proc = GetCurrentProcess()) + { + return proc.PeakVirtualMemorySize64; + } + } + } + + private static Process GetCurrentProcess() + { + var proc = Process.GetCurrentProcess(); + proc.Refresh(); + return proc; + } + } +} diff --git a/src/OpenCvSharp.Sandbox/OpenCvSharp.Sandbox.csproj b/src/OpenCvSharp.Sandbox/OpenCvSharp.Sandbox.csproj new file mode 100644 index 000000000..055abcb06 --- /dev/null +++ b/src/OpenCvSharp.Sandbox/OpenCvSharp.Sandbox.csproj @@ -0,0 +1,194 @@ + + + + + Debug + AnyCPU + {C76C33E0-6F2E-49DF-ABD2-02053CB4CCB5} + Exe + Properties + OpenCvSharp.Sandbox + OpenCvSharp.Sandbox + v4.0 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + MinimumRecommendedRules.ruleset + true + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + prompt + MinimumRecommendedRules.ruleset + true + + + bin\Release JP\ + TRACE + true + pdbonly + AnyCPU + prompt + MinimumRecommendedRules.ruleset + + + bin\x86\Release JP\ + TRACE + true + pdbonly + x86 + prompt + MinimumRecommendedRules.ruleset + true + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + true + + + bin\x64\Release JP\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + + + + + + + + + + + + + + + + + + + + + + + {383ae960-7f56-47a4-bff2-b2b81b6a49b5} + OpenCvSharp.Blob + + + {524cc7b4-75b9-4925-9da4-3dacd40f4814} + OpenCvSharp + + + {f1110c7b-46b1-4504-871e-135b57f9de67} + OpenCvSharp.Extensions + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + Always + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + + \ No newline at end of file diff --git a/src/OpenCvSharp.Sandbox/Program.cs b/src/OpenCvSharp.Sandbox/Program.cs new file mode 100644 index 000000000..507f7e303 --- /dev/null +++ b/src/OpenCvSharp.Sandbox/Program.cs @@ -0,0 +1,448 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Drawing; +using System.Linq; +using OpenCvSharp.Blob; +using OpenCvSharp.Gpu; +using OpenCvSharp.Extensions; + +namespace OpenCvSharp.Sandbox +{ + /// + /// Simple codes for debugging + /// + internal class Program + { + [STAThread] + private static void Main(string[] args) + { + CvBlobsSample(); + //HDR(); + //ConvertImageSample(); + //VideoCaptureSample(); + //MatchTemplateSample(); + //BackgroundSubtractorSample(); + //MatForEach(); + //LineSegmentDetectorSample(); + //LineIterator(); + //Feature(); + //Blob(); + + Console.WriteLine("Press any key to exit"); + Console.Read(); + } + + private static void HDR() + { + var hdr = CalibrateDebevec.Create(); + + Mat[] images = new Mat[3]; + images[0] = Cv2.ImRead(@"data\lenna.png", ImreadModes.AnyColor); + images[1] = Cv2.ImRead(@"data\lenna.png", ImreadModes.AnyColor); + images[2] = Cv2.ImRead(@"data\lenna.png", ImreadModes.AnyColor); + + float[] speeds = new float[3]; + speeds[0] = 1; + speeds[1] = 1; + speeds[2] = 1; + + Mat dst = new Mat(); + + hdr.Process(images, dst, speeds); + + dst.ToString(); + + for (int i = 0; i < Math.Max(dst.Rows, dst.Cols); i++) + { + Console.WriteLine(dst.At(i)); + } + } + + private static void CvBlobsSample() + { + var src = new Mat("data/shapes.png", ImreadModes.GrayScale); + var bin = src.Threshold(0, 255, ThresholdTypes.Otsu); + var view = bin.CvtColor(ColorConversionCodes.GRAY2BGR); + + var blobs = new CvBlobs(bin); + blobs.RenderBlobs(bin, view, RenderBlobsMode.Angle | RenderBlobsMode.BoundingBox | RenderBlobsMode.Color); + Window.ShowImages(bin, view); + } + + private static void ConvertImageSample() + { + var m = new Mat(100, 100, MatType.CV_32FC1); + var rand = new Random(); + + var indexer = m.GetGenericIndexer(); + for (int r = 0; r < m.Rows; r++) + { + for (int c = 0; c < m.Cols; c++) + { + indexer[r, c] = (float)rand.NextDouble(); + } + } + + //Window.ShowImages(m); + + var conv = new Mat(); + Cv2.ConvertImage(m, conv); + + conv.SaveImage(@"C:\temp\float.png"); + } + + private static void VideoCaptureSample() + { + var cap = new VideoCapture(0); + + if (!cap.IsOpened()) + { + Console.WriteLine("Can't use camera."); + return; + } + + var frame = new Mat(); + + using (var window = new Window("window")) + { + while (true) + { + cap.Read(frame); + window.ShowImage(frame); + int key = Cv2.WaitKey(50); + if (key == 'b') + break; + } + } + } + + private static void MatchTemplateSample() + { + var src = new Mat(@"data\mt_src.png"); + var template = new Mat(@"data\template.png"); + var mask = new Mat(@"data\mask.png"); + var result = new Mat(); + Cv2.MatchTemplate(src, template, result, TemplateMatchModes.CCorrNormed, mask); + + double minVal, maxVal; + Point minLoc, maxLoc; + Cv2.MinMaxLoc(result, out minVal, out maxVal, out minLoc, out maxLoc); + + var view = src.Clone(); + view.Rectangle(maxLoc, new Point(maxLoc.X + template.Width, maxLoc.Y + template.Height), Scalar.Red, 2); + + Console.WriteLine(maxVal); + Window.ShowImages(view); + } + + private static void BackgroundSubtractorSample() + { + var mog = BackgroundSubtractorMOG2.Create(); + var mask = new Mat(); + var colorImage = Cv2.ImRead(@"data\shapes.png"); + + mog.Apply(colorImage, mask); + Window.ShowImages(mask); + } + + private static void MatForEach() + { + var img = new Mat("data/lenna.png", ImreadModes.Color); + + var watch = Stopwatch.StartNew(); + unsafe + { + img.ForEachAsVec3b((value, position) => + { + value->Item0 = (byte)(255 - value->Item0); + value->Item1 = (byte)(255 - value->Item1); + value->Item2 = (byte)(255 - value->Item2); + }); + } + watch.Stop(); + + Console.WriteLine("{0}ms", watch.ElapsedMilliseconds); + Window.ShowImages(img); + + watch.Restart(); + + var indexer = img.GetGenericIndexer(); + int w = img.Width, h = img.Height; + for (int y = 0; y < h; y++) + { + for (int x = 0; x < w; x++) + { + Vec3b v = indexer[y, x]; + v.Item0 = (byte)(255 - v.Item0); + v.Item1 = (byte)(255 - v.Item1); + v.Item2 = (byte)(255 - v.Item2); + indexer[y, x] = v; + } + } + + watch.Stop(); + Console.WriteLine("{0}ms", watch.ElapsedMilliseconds); + Window.ShowImages(img); + } + + private static void LineSegmentDetectorSample() + { + var img = new Mat("data/shapes.png", ImreadModes.GrayScale); + var lines = new Mat(); + var view = img.Clone(); + + var detector = LineSegmentDetector.Create(); + detector.Detect(img, lines); + detector.DrawSegments(view, lines); + + Window.ShowImages(view); + } + + private static void LineIterator() + { + var img = new Mat("data/lenna.png", ImreadModes.Color); + var pt1 = new Point(100, 100); + var pt2 = new Point(300, 300); + var iterator = new LineIterator(img, pt1, pt2, PixelConnectivity.Connectivity8); + + // invert color + foreach (var pixel in iterator) + { + Vec3b value = pixel.GetValue(); + value.Item0 = (byte)~value.Item0; + value.Item1 = (byte)~value.Item1; + value.Item2 = (byte)~value.Item2; + pixel.SetValue(value); + } + + // re-enumeration works fine + foreach (var pixel in iterator) + { + Vec3b value = pixel.GetValue(); + Console.WriteLine("{0} = ({1},{2},{3})", pixel.Pos, value.Item0, value.Item1, value.Item2); + } + + Window.ShowImages(img); + } + + private static void Feature() + { + Mat img = new Mat("data/lenna.png", ImreadModes.GrayScale); + KAZE kaze = KAZE.Create(); + + + KeyPoint[] keyPoints; + Mat descriptors = new Mat(); + kaze.DetectAndCompute(img, null, out keyPoints, descriptors); + + Mat dst = new Mat(); + Cv2.DrawKeypoints(img, keyPoints, dst); + Window.ShowImages(dst); + } + + private static void Blob() + { + Mat src = new Mat("data/shapes.png", ImreadModes.Color); + Mat gray = src.CvtColor(ColorConversionCodes.BGR2GRAY); + Mat binary = gray.Threshold(0, 255, ThresholdTypes.Otsu | ThresholdTypes.Binary); + Mat labelView = new Mat(); + Mat rectView = binary.CvtColor(ColorConversionCodes.GRAY2BGR); + + ConnectedComponents cc = Cv2.ConnectedComponentsEx(binary); + if (cc.LabelCount <= 1) + return; + + // draw labels + /* + Scalar[] colors = cc.Blobs.Select(_ => Scalar.RandomColor()).ToArray(); + int height = cc.Labels.GetLength(0); + int width = cc.Labels.GetLength(1); + var labelViewIndexer = labelView.GetGenericIndexer(); + for (int y = 0; y < height; y++) + { + for (int x = 0; x < width; x++) + { + int labelValue = cc.Labels[y, x]; + labelViewIndexer[y, x] = colors[labelValue].ToVec3b(); + } + } + */ + cc.RenderBlobs(labelView); + + // draw bonding boxes except background + foreach (var blob in cc.Blobs.Skip(1)) + { + rectView.Rectangle(blob.Rect, Scalar.Red); + } + + // filter maximum blob + ConnectedComponents.Blob maxBlob = cc.GetLargestBlob(); + //cc.Blobs.Skip(1).OrderByDescending(b => b.Area).First(); + Mat filtered = new Mat(); + cc.FilterByBlob(src, filtered, maxBlob); + + using (new Window("src", src)) + using (new Window("binary", binary)) + using (new Window("labels", labelView)) + using (new Window("bonding boxes", rectView)) + using (new Window("maximum blob", filtered)) + { + Cv2.WaitKey(); + } + } + + private static void Clahe() + { + Mat src = new Mat("data/tsukuba_left.png", ImreadModes.GrayScale); + Mat dst20 = new Mat(); + Mat dst40 = new Mat(); + Mat dst44 = new Mat(); + + using (CLAHE clahe = Cv2.CreateCLAHE()) + { + clahe.ClipLimit = 20; + clahe.Apply(src, dst20); + clahe.ClipLimit = 40; + clahe.Apply(src, dst40); + clahe.TilesGridSize = new Size(4, 4); + clahe.Apply(src, dst44); + } + + Window.ShowImages(src, dst20, dst40, dst44); + } + + /* + private static void Surf() + { + Mat src = new Mat("data/match1.png"); + Mat src2 = new Mat("data/match2.png"); + //Detect the keypoints and generate their descriptors using SURF + SURF surf = SURF.Create(500, 4, 2, true); + KeyPoint[] keypoints1, keypoints2; + MatOfFloat descriptors1 = new MatOfFloat(); + MatOfFloat descriptors2 = new MatOfFloat(); + surf.Compute(src, null, out keypoints1, descriptors1); + surf.Compute(src2, null, out keypoints2, descriptors2); + // Matching descriptor vectors with a brute force matcher + BFMatcher matcher = new BFMatcher(NormType.L2, false); + DMatch[] matches = matcher.Match(descriptors1, descriptors2);//例外が発生する箇所 + Mat view = new Mat(); + Cv2.DrawMatches(src, keypoints1, src2, keypoints2, matches, view); + + Window.ShowImages(view); + }*/ + + private static Mat[] StitchingPreprocess(int width, int height, int count) + { + Mat source = new Mat(@"C:\Penguins.jpg", ImreadModes.Color); + Mat result = source.Clone(); + + var rand = new Random(); + var mats = new List(); + for (int i = 0; i < count; i++) + { + int x1 = rand.Next(source.Cols - width); + int y1 = rand.Next(source.Rows - height); + int x2 = x1 + width; + int y2 = y1 + height; + + result.Line(new Point(x1, y1), new Point(x1, y2), new Scalar(0, 0, 255)); + result.Line(new Point(x1, y2), new Point(x2, y2), new Scalar(0, 0, 255)); + result.Line(new Point(x2, y2), new Point(x2, y1), new Scalar(0, 0, 255)); + result.Line(new Point(x2, y1), new Point(x1, y1), new Scalar(0, 0, 255)); + + Mat m = source[new Rect(x1, y1, width, height)]; + mats.Add(m.Clone()); + //string outFile = String.Format(@"C:\temp\stitching\{0:D3}.png", i); + //m.SaveImage(outFile); + } + + result.SaveImage(@"C:\temp\parts.png"); + using (new Window(result)) + { + Cv2.WaitKey(); + } + + return mats.ToArray(); + } + + private static void Stitching(Mat[] images) + { + var stitcher = Stitcher.Create(false); + + Mat pano = new Mat(); + + Console.Write("Stitching 処理開始..."); + var status = stitcher.Stitch(images, pano); + Console.WriteLine(" 完了 {0}", status); + + pano.SaveImage(@"C:\temp\pano.png"); + Window.ShowImages(pano); + + foreach (Mat image in images) + { + image.Dispose(); + } + } + + static string AspectRatioAsString(float f) + { + bool carryon = true; + int index = 0; + double roundedUpValue = 0; + while (carryon) + { + index++; + float upper = index * f; + + roundedUpValue = Math.Ceiling(upper); + + if (roundedUpValue - upper <= (double)0.1 || index > 20) + { + carryon = false; + } + } + + return roundedUpValue + ":" + index; + } + + private static void Run() + { + var dm = DescriptorMatcher.Create("BruteForce"); + dm.Clear(); + + var src = new Mat("data/lenna.png"); + var rand = new Random(); + var memory = new List(100); + + var a1 = new Mat(src, Rect.FromLTRB(0, 0, 30, 40)); + var a2 = new Mat(src, Rect.FromLTRB(0, 0, 30, 40)); + var a3 = new Mat(src, Rect.FromLTRB(0, 0, 30, 40)); + a3.ToString(); + + for (long i = 0; ; i++) + { + for (int j = 0; j < 200; j++) + { + int c1 = rand.Next(100, 400); + int c2 = rand.Next(100, 400); + Mat temp = src.Row[c1]; + src.Row[c1] = src.Row[c2]; + src.Row[c2] = temp; + } + + memory.Add(MyProcess.WorkingSet64); + if (memory.Count >= 100) + { + double average = memory.Average(); + Console.WriteLine("{0:F3}MB", average / 1024.0 / 1024.0); + memory.Clear(); + GC.Collect(); + } + } + + } + + } +} diff --git a/src/OpenCvSharp.Sandbox/Program.cs.bak b/src/OpenCvSharp.Sandbox/Program.cs.bak new file mode 100644 index 000000000..e124e05c2 --- /dev/null +++ b/src/OpenCvSharp.Sandbox/Program.cs.bak @@ -0,0 +1,421 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Drawing; +using System.Linq; +using OpenCvSharp.Blob; +using OpenCvSharp.Gpu; +using OpenCvSharp.Extensions; + +namespace OpenCvSharp.Sandbox +{ + /// + /// Simple codes for debugging + /// + internal class Program + { + [STAThread] + private static void Main(string[] args) + { + CvBlobsSample(); + //ConvertImageSample(); + //VideoCaptureSample(); + //MatchTemplateSample(); + //BackgroundSubtractorSample(); + //MatForEach(); + //LineSegmentDetectorSample(); + //LineIterator(); + //Feature(); + //Blob(); + + Console.WriteLine("Press any key to exit"); + Console.Read(); + } + + private static void CvBlobsSample() + { + var src = new Mat("data/shapes.png", ImreadModes.GrayScale); + var bin = src.Threshold(0, 255, ThresholdTypes.Otsu); + var view = bin.CvtColor(ColorConversionCodes.GRAY2BGR); + + var blobs = new CvBlobs(bin); + blobs.RenderBlobs(bin, view, RenderBlobsMode.Angle | RenderBlobsMode.BoundingBox | RenderBlobsMode.Color); + Window.ShowImages(bin, view); + } + + private static void ConvertImageSample() + { + var m = new Mat(100, 100, MatType.CV_32FC1); + var rand = new Random(); + + var indexer = m.GetGenericIndexer(); + for (int r = 0; r < m.Rows; r++) + { + for (int c = 0; c < m.Cols; c++) + { + indexer[r, c] = (float)rand.NextDouble(); + } + } + + //Window.ShowImages(m); + + var conv = new Mat(); + Cv2.ConvertImage(m, conv); + + conv.SaveImage(@"C:\temp\float.png"); + } + + private static void VideoCaptureSample() + { + var cap = new VideoCapture(0); + + if (!cap.IsOpened()) + { + Console.WriteLine("Can't use camera."); + return; + } + + var frame = new Mat(); + + using (var window = new Window("window")) + { + while (true) + { + cap.Read(frame); + window.ShowImage(frame); + int key = Cv2.WaitKey(50); + if (key == 'b') + break; + } + } + } + + private static void MatchTemplateSample() + { + var src = new Mat(@"data\mt_src.png"); + var template = new Mat(@"data\template.png"); + var mask = new Mat(@"data\mask.png"); + var result = new Mat(); + Cv2.MatchTemplate(src, template, result, TemplateMatchModes.CCorrNormed, mask); + + double minVal, maxVal; + Point minLoc, maxLoc; + Cv2.MinMaxLoc(result, out minVal, out maxVal, out minLoc, out maxLoc); + + var view = src.Clone(); + view.Rectangle(maxLoc, new Point(maxLoc.X + template.Width, maxLoc.Y + template.Height), Scalar.Red, 2); + + Console.WriteLine(maxVal); + Window.ShowImages(view); + } + + private static void BackgroundSubtractorSample() + { + var mog = BackgroundSubtractorMOG2.Create(); + var mask = new Mat(); + var colorImage = Cv2.ImRead(@"data\shapes.png"); + + mog.Apply(colorImage, mask); + Window.ShowImages(mask); + } + + private static void MatForEach() + { + var img = new Mat("data/lenna.png", ImreadModes.Color); + + var watch = Stopwatch.StartNew(); + unsafe + { + img.ForEachAsVec3b((value, position) => + { + value->Item0 = (byte)(255 - value->Item0); + value->Item1 = (byte)(255 - value->Item1); + value->Item2 = (byte)(255 - value->Item2); + }); + } + watch.Stop(); + + Console.WriteLine("{0}ms", watch.ElapsedMilliseconds); + Window.ShowImages(img); + + watch.Restart(); + + var indexer = img.GetGenericIndexer(); + int w = img.Width, h = img.Height; + for (int y = 0; y < h; y++) + { + for (int x = 0; x < w; x++) + { + Vec3b v = indexer[y, x]; + v.Item0 = (byte)(255 - v.Item0); + v.Item1 = (byte)(255 - v.Item1); + v.Item2 = (byte)(255 - v.Item2); + indexer[y, x] = v; + } + } + + watch.Stop(); + Console.WriteLine("{0}ms", watch.ElapsedMilliseconds); + Window.ShowImages(img); + } + + private static void LineSegmentDetectorSample() + { + var img = new Mat("data/shapes.png", ImreadModes.GrayScale); + var lines = new Mat(); + var view = img.Clone(); + + var detector = LineSegmentDetector.Create(); + detector.Detect(img, lines); + detector.DrawSegments(view, lines); + + Window.ShowImages(view); + } + + private static void LineIterator() + { + var img = new Mat("data/lenna.png", ImreadModes.Color); + var pt1 = new Point(100, 100); + var pt2 = new Point(300, 300); + var iterator = new LineIterator(img, pt1, pt2, PixelConnectivity.Connectivity8); + + // invert color + foreach (var pixel in iterator) + { + Vec3b value = pixel.GetValue(); + value.Item0 = (byte)~value.Item0; + value.Item1 = (byte)~value.Item1; + value.Item2 = (byte)~value.Item2; + pixel.SetValue(value); + } + + // re-enumeration works fine + foreach (var pixel in iterator) + { + Vec3b value = pixel.GetValue(); + Console.WriteLine("{0} = ({1},{2},{3})", pixel.Pos, value.Item0, value.Item1, value.Item2); + } + + Window.ShowImages(img); + } + + private static void Feature() + { + Mat img = new Mat("data/lenna.png", ImreadModes.GrayScale); + KAZE kaze = KAZE.Create(); + + + KeyPoint[] keyPoints; + Mat descriptors = new Mat(); + kaze.DetectAndCompute(img, null, out keyPoints, descriptors); + + Mat dst = new Mat(); + Cv2.DrawKeypoints(img, keyPoints, dst); + Window.ShowImages(dst); + } + + private static void Blob() + { + Mat src = new Mat("data/shapes.png", ImreadModes.Color); + Mat gray = src.CvtColor(ColorConversionCodes.BGR2GRAY); + Mat binary = gray.Threshold(0, 255, ThresholdTypes.Otsu | ThresholdTypes.Binary); + Mat labelView = new Mat(); + Mat rectView = binary.CvtColor(ColorConversionCodes.GRAY2BGR); + + ConnectedComponents cc = Cv2.ConnectedComponentsEx(binary); + if (cc.LabelCount <= 1) + return; + + // draw labels + /* + Scalar[] colors = cc.Blobs.Select(_ => Scalar.RandomColor()).ToArray(); + int height = cc.Labels.GetLength(0); + int width = cc.Labels.GetLength(1); + var labelViewIndexer = labelView.GetGenericIndexer(); + for (int y = 0; y < height; y++) + { + for (int x = 0; x < width; x++) + { + int labelValue = cc.Labels[y, x]; + labelViewIndexer[y, x] = colors[labelValue].ToVec3b(); + } + } + */ + cc.RenderBlobs(labelView); + + // draw bonding boxes except background + foreach (var blob in cc.Blobs.Skip(1)) + { + rectView.Rectangle(blob.Rect, Scalar.Red); + } + + // filter maximum blob + ConnectedComponents.Blob maxBlob = cc.GetLargestBlob(); + //cc.Blobs.Skip(1).OrderByDescending(b => b.Area).First(); + Mat filtered = new Mat(); + cc.FilterByBlob(src, filtered, maxBlob); + + using (new Window("src", src)) + using (new Window("binary", binary)) + using (new Window("labels", labelView)) + using (new Window("bonding boxes", rectView)) + using (new Window("maximum blob", filtered)) + { + Cv2.WaitKey(); + } + } + + private static void Clahe() + { + Mat src = new Mat("data/tsukuba_left.png", ImreadModes.GrayScale); + Mat dst20 = new Mat(); + Mat dst40 = new Mat(); + Mat dst44 = new Mat(); + + using (CLAHE clahe = Cv2.CreateCLAHE()) + { + clahe.ClipLimit = 20; + clahe.Apply(src, dst20); + clahe.ClipLimit = 40; + clahe.Apply(src, dst40); + clahe.TilesGridSize = new Size(4, 4); + clahe.Apply(src, dst44); + } + + Window.ShowImages(src, dst20, dst40, dst44); + } + + /* + private static void Surf() + { + Mat src = new Mat("data/match1.png"); + Mat src2 = new Mat("data/match2.png"); + //Detect the keypoints and generate their descriptors using SURF + SURF surf = SURF.Create(500, 4, 2, true); + KeyPoint[] keypoints1, keypoints2; + MatOfFloat descriptors1 = new MatOfFloat(); + MatOfFloat descriptors2 = new MatOfFloat(); + surf.Compute(src, null, out keypoints1, descriptors1); + surf.Compute(src2, null, out keypoints2, descriptors2); + // Matching descriptor vectors with a brute force matcher + BFMatcher matcher = new BFMatcher(NormType.L2, false); + DMatch[] matches = matcher.Match(descriptors1, descriptors2);//例外が発生する箇所 + Mat view = new Mat(); + Cv2.DrawMatches(src, keypoints1, src2, keypoints2, matches, view); + + Window.ShowImages(view); + }*/ + + private static Mat[] StitchingPreprocess(int width, int height, int count) + { + Mat source = new Mat(@"C:\Penguins.jpg", ImreadModes.Color); + Mat result = source.Clone(); + + var rand = new Random(); + var mats = new List(); + for (int i = 0; i < count; i++) + { + int x1 = rand.Next(source.Cols - width); + int y1 = rand.Next(source.Rows - height); + int x2 = x1 + width; + int y2 = y1 + height; + + result.Line(new Point(x1, y1), new Point(x1, y2), new Scalar(0, 0, 255)); + result.Line(new Point(x1, y2), new Point(x2, y2), new Scalar(0, 0, 255)); + result.Line(new Point(x2, y2), new Point(x2, y1), new Scalar(0, 0, 255)); + result.Line(new Point(x2, y1), new Point(x1, y1), new Scalar(0, 0, 255)); + + Mat m = source[new Rect(x1, y1, width, height)]; + mats.Add(m.Clone()); + //string outFile = String.Format(@"C:\temp\stitching\{0:D3}.png", i); + //m.SaveImage(outFile); + } + + result.SaveImage(@"C:\temp\parts.png"); + using (new Window(result)) + { + Cv2.WaitKey(); + } + + return mats.ToArray(); + } + + private static void Stitching(Mat[] images) + { + var stitcher = Stitcher.Create(false); + + Mat pano = new Mat(); + + Console.Write("Stitching 処理開始..."); + var status = stitcher.Stitch(images, pano); + Console.WriteLine(" 完了 {0}", status); + + pano.SaveImage(@"C:\temp\pano.png"); + Window.ShowImages(pano); + + foreach (Mat image in images) + { + image.Dispose(); + } + } + + static string AspectRatioAsString(float f) + { + bool carryon = true; + int index = 0; + double roundedUpValue = 0; + while (carryon) + { + index++; + float upper = index * f; + + roundedUpValue = Math.Ceiling(upper); + + if (roundedUpValue - upper <= (double)0.1 || index > 20) + { + carryon = false; + } + } + + return roundedUpValue + ":" + index; + } + + private static void Run() + { + var dm = DescriptorMatcher.Create("BruteForce"); + dm.Clear(); + + var src = new Mat("data/lenna.png"); + var rand = new Random(); + var memory = new List(100); + + var a1 = new Mat(src, Rect.FromLTRB(0, 0, 30, 40)); + var a2 = new Mat(src, Rect.FromLTRB(0, 0, 30, 40)); + var a3 = new Mat(src, Rect.FromLTRB(0, 0, 30, 40)); + a3.ToString(); + + for (long i = 0; ; i++) + { + for (int j = 0; j < 200; j++) + { + int c1 = rand.Next(100, 400); + int c2 = rand.Next(100, 400); + Mat temp = src.Row[c1]; + src.Row[c1] = src.Row[c2]; + src.Row[c2] = temp; + } + + memory.Add(MyProcess.WorkingSet64); + if (memory.Count >= 100) + { + double average = memory.Average(); + Console.WriteLine("{0:F3}MB", average / 1024.0 / 1024.0); + memory.Clear(); + GC.Collect(); + } + } + + } + + } +} diff --git a/src/OpenCvSharp.Sandbox/Properties/AssemblyInfo.cs b/src/OpenCvSharp.Sandbox/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..eaa916248 --- /dev/null +++ b/src/OpenCvSharp.Sandbox/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 +// アセンブリに関連付けられている情報を変更するには、 +// これらの属性値を変更してください。 +[assembly: AssemblyTitle("OpenCvSharp.Sandbox")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OpenCvSharp.Sandbox")] +[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから +// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 +// その型の ComVisible 属性を true に設定してください。 +[assembly: ComVisible(false)] + +// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です +[assembly: Guid("5be604f4-67cd-4c92-a5f8-fbe3944237a3")] + +// アセンブリのバージョン情報は、以下の 4 つの値で構成されています: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を +// 既定値にすることができます: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/OpenCvSharp.Sandbox/app.config b/src/OpenCvSharp.Sandbox/app.config new file mode 100644 index 000000000..884f9844f --- /dev/null +++ b/src/OpenCvSharp.Sandbox/app.config @@ -0,0 +1,3 @@ + + + diff --git a/src/OpenCvSharp.Sandbox/data/bach.mp4 b/src/OpenCvSharp.Sandbox/data/bach.mp4 new file mode 100644 index 000000000..91d384f34 Binary files /dev/null and b/src/OpenCvSharp.Sandbox/data/bach.mp4 differ diff --git a/src/OpenCvSharp.Sandbox/data/lenna.png b/src/OpenCvSharp.Sandbox/data/lenna.png new file mode 100644 index 000000000..59ef68aab Binary files /dev/null and b/src/OpenCvSharp.Sandbox/data/lenna.png differ diff --git a/src/OpenCvSharp.Sandbox/data/lenna511.png b/src/OpenCvSharp.Sandbox/data/lenna511.png new file mode 100644 index 000000000..a8c4bf681 Binary files /dev/null and b/src/OpenCvSharp.Sandbox/data/lenna511.png differ diff --git a/src/OpenCvSharp.Sandbox/data/mask.png b/src/OpenCvSharp.Sandbox/data/mask.png new file mode 100644 index 000000000..111bd63ae Binary files /dev/null and b/src/OpenCvSharp.Sandbox/data/mask.png differ diff --git a/src/OpenCvSharp.Sandbox/data/match1.png b/src/OpenCvSharp.Sandbox/data/match1.png new file mode 100644 index 000000000..6f01082f7 Binary files /dev/null and b/src/OpenCvSharp.Sandbox/data/match1.png differ diff --git a/src/OpenCvSharp.Sandbox/data/match2.png b/src/OpenCvSharp.Sandbox/data/match2.png new file mode 100644 index 000000000..cff246a3f Binary files /dev/null and b/src/OpenCvSharp.Sandbox/data/match2.png differ diff --git a/src/OpenCvSharp.Sandbox/data/mt_src.png b/src/OpenCvSharp.Sandbox/data/mt_src.png new file mode 100644 index 000000000..f79bba96e Binary files /dev/null and b/src/OpenCvSharp.Sandbox/data/mt_src.png differ diff --git a/src/OpenCvSharp.Sandbox/data/shapes.png b/src/OpenCvSharp.Sandbox/data/shapes.png new file mode 100644 index 000000000..7b754adec Binary files /dev/null and b/src/OpenCvSharp.Sandbox/data/shapes.png differ diff --git a/src/OpenCvSharp.Sandbox/data/template.png b/src/OpenCvSharp.Sandbox/data/template.png new file mode 100644 index 000000000..d41018ef2 Binary files /dev/null and b/src/OpenCvSharp.Sandbox/data/template.png differ diff --git a/src/OpenCvSharp.Sandbox/data/tsukuba_left.png b/src/OpenCvSharp.Sandbox/data/tsukuba_left.png new file mode 100644 index 000000000..25651ce75 Binary files /dev/null and b/src/OpenCvSharp.Sandbox/data/tsukuba_left.png differ diff --git a/src/OpenCvSharp.Sandbox/dll/x64/OpenCvSharpExtern.dll b/src/OpenCvSharp.Sandbox/dll/x64/OpenCvSharpExtern.dll new file mode 100644 index 000000000..7c63d2b4a Binary files /dev/null and b/src/OpenCvSharp.Sandbox/dll/x64/OpenCvSharpExtern.dll differ diff --git a/src/OpenCvSharp.Sandbox/dll/x64/opencv_ffmpeg310_64.dll b/src/OpenCvSharp.Sandbox/dll/x64/opencv_ffmpeg310_64.dll new file mode 100644 index 000000000..040198c56 Binary files /dev/null and b/src/OpenCvSharp.Sandbox/dll/x64/opencv_ffmpeg310_64.dll differ diff --git a/src/OpenCvSharp.Sandbox/dll/x64/opencv_world310.dll b/src/OpenCvSharp.Sandbox/dll/x64/opencv_world310.dll new file mode 100644 index 000000000..67a2233f9 Binary files /dev/null and b/src/OpenCvSharp.Sandbox/dll/x64/opencv_world310.dll differ diff --git a/src/OpenCvSharp.Sandbox/dll/x86/opencv_ffmpeg310.dll b/src/OpenCvSharp.Sandbox/dll/x86/opencv_ffmpeg310.dll new file mode 100644 index 000000000..4abb8ca9f Binary files /dev/null and b/src/OpenCvSharp.Sandbox/dll/x86/opencv_ffmpeg310.dll differ diff --git a/src/OpenCvSharp.Sandbox/dll/x86/opencv_world310.dll b/src/OpenCvSharp.Sandbox/dll/x86/opencv_world310.dll new file mode 100644 index 000000000..f7fc9cd2f Binary files /dev/null and b/src/OpenCvSharp.Sandbox/dll/x86/opencv_world310.dll differ diff --git a/src/OpenCvSharp.SandboxCpp/AssemblyInfo.cpp b/src/OpenCvSharp.SandboxCpp/AssemblyInfo.cpp new file mode 100644 index 000000000..b796247ba --- /dev/null +++ b/src/OpenCvSharp.SandboxCpp/AssemblyInfo.cpp @@ -0,0 +1,40 @@ +#include "stdafx.h" + +using namespace System; +using namespace System::Reflection; +using namespace System::Runtime::CompilerServices; +using namespace System::Runtime::InteropServices; +using namespace System::Security::Permissions; + +// +// AZuɊւʏ͈ȉ̑ZbgƂĐ䂳܂B +// AZuɊ֘AtĂύXɂ́A +// ̑lύXĂB +// +[assembly:AssemblyTitleAttribute("OpenCvSharp.SandboxCpp")]; +[assembly:AssemblyDescriptionAttribute("")]; +[assembly:AssemblyConfigurationAttribute("")]; +[assembly:AssemblyCompanyAttribute("")]; +[assembly:AssemblyProductAttribute("OpenCvSharp.SandboxCpp")]; +[assembly:AssemblyCopyrightAttribute("Copyright (c) 2014")]; +[assembly:AssemblyTrademarkAttribute("")]; +[assembly:AssemblyCultureAttribute("")]; + +// +// AZũo[ẂAȉ 4 ‚̒lō\Ă܂: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// ׂĂ̒lw肷邩Â悤 '*' gărWуrhԍ +// lɂ邱Ƃł܂: + +[assembly:AssemblyVersionAttribute("1.0.*")]; + +[assembly:ComVisible(false)]; + +[assembly:CLSCompliantAttribute(true)]; + +[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)]; diff --git a/src/OpenCvSharp.SandboxCpp/OpenCvSharp.SandboxCpp.vcxproj b/src/OpenCvSharp.SandboxCpp/OpenCvSharp.SandboxCpp.vcxproj new file mode 100644 index 000000000..75b2c63aa --- /dev/null +++ b/src/OpenCvSharp.SandboxCpp/OpenCvSharp.SandboxCpp.vcxproj @@ -0,0 +1,174 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {8516D7EB-E716-4BC1-92DB-751E6BF13AE1} + v4.0 + ManagedCProj + OpenCvSharpSandboxCpp + OpenCvSharp.SandboxCpp + + + + Application + true + v110 + true + Unicode + + + Application + true + v110 + true + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + true + + + false + $(SolutionDir)..\lib\opencv\x86\vc12\lib;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib;$(LibraryPath) + $(SolutionDir)$(Configuration)\$(PlatformName)\ + $(SolutionDir)..\lib\opencv\include;$(IncludePath) + + + false + $(SolutionDir)..\lib\opencv\x64\vc12\lib;$(LibraryPath) + $(SolutionDir)$(Configuration)\$(PlatformName)\ + $(SolutionDir)..\lib\opencv\include;$(IncludePath) + + + + Level3 + Disabled + WIN32;_DEBUG;%(PreprocessorDefinitions) + Use + + + true + opencv_calib3d249d.lib;opencv_contrib249d.lib;opencv_core249d.lib;opencv_features2d249d.lib;opencv_flann249d.lib;opencv_highgui249d.lib;opencv_imgproc249d.lib;opencv_legacy249d.lib;opencv_ml249d.lib;opencv_nonfree249d.lib;opencv_objdetect249d.lib;opencv_photo249d.lib;opencv_stitching249d.lib;opencv_superres249d.lib;opencv_video249d.lib;opencv_videostab249d.lib;%(AdditionalDependencies) + Console + + + + + Level3 + Disabled + WIN32;_DEBUG;%(PreprocessorDefinitions) + Use + + + true + opencv_calib3d249d.lib;opencv_contrib249d.lib;opencv_core249d.lib;opencv_features2d249d.lib;opencv_flann249d.lib;opencv_highgui249d.lib;opencv_imgproc249d.lib;opencv_legacy249d.lib;opencv_ml249d.lib;opencv_nonfree249d.lib;opencv_objdetect249d.lib;opencv_photo249d.lib;opencv_stitching249d.lib;opencv_superres249d.lib;opencv_video249d.lib;opencv_videostab249d.lib;%(AdditionalDependencies) + Console + + + + + Level3 + WIN32;NDEBUG;%(PreprocessorDefinitions) + Use + + + true + opencv_world310.lib;%(AdditionalDependencies) + Console + + + + + Level3 + WIN32;NDEBUG;%(PreprocessorDefinitions) + Use + + + true + opencv_world310.lib;%(AdditionalDependencies) + Console + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + + + + \ No newline at end of file diff --git a/src/OpenCvSharp.SandboxCpp/OpenCvSharp.SandboxCpp.vcxproj.filters b/src/OpenCvSharp.SandboxCpp/OpenCvSharp.SandboxCpp.vcxproj.filters new file mode 100644 index 000000000..bd4ae10fa --- /dev/null +++ b/src/OpenCvSharp.SandboxCpp/OpenCvSharp.SandboxCpp.vcxproj.filters @@ -0,0 +1,49 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + ヘッダー ファイル + + + ヘッダー ファイル + + + + + リソース ファイル + + + + + ソース ファイル + + + ソース ファイル + + + ソース ファイル + + + + + リソース ファイル + + + \ No newline at end of file diff --git a/src/OpenCvSharp.SandboxCpp/ReadMe.txt b/src/OpenCvSharp.SandboxCpp/ReadMe.txt new file mode 100644 index 000000000..fbb236760 --- /dev/null +++ b/src/OpenCvSharp.SandboxCpp/ReadMe.txt @@ -0,0 +1,26 @@ +======================================================================== + アプリケーション: Sansan.RD.SandboxCpp プロジェクトの概要 +======================================================================== + +この Sansan.RD.SandboxCpp アプリケーションは、AppWizard により作成されました。 + +このファイルには、Sansan.RD.SandboxCpp アプリケーションを構成する各ファイルの内容の概要が含まれています。 + +Sansan.RD.SandboxCpp.vcxproj + これは、アプリケーション ウィザードを使用して生成された VC++ プロジェクトのメイン プロジェクト ファイルです。ファイルを生成した Visual C++ のバージョンに関する情報と、アプリケーション ウィザードで選択されたプラットフォーム、構成、およびプロジェクト機能に関する情報が含まれています。 + +Sansan.RD.SandboxCpp.vcxproj.filters + これは、アプリケーション ウィザードで生成された VC++ プロジェクトのフィルター ファイルです。このファイルには、プロジェクト内のファイルとフィルターとの間の関連付けに関する情報が含まれています。この関連付けは、特定のノードで同様の拡張子を持つファイルのグループ化を示すために IDE で使用されます (たとえば、".cpp" ファイルは "ソース ファイル" フィルターに関連付けられています)。 + +Sansan.RD.SandboxCpp.cpp + これは、メインのアプリケーション ソース ファイルです。 + +AssemblyInfo.cpp + アセンブリ メタデータを変更するカスタム属性が含まれています。 + +///////////////////////////////////////////////////////////////////////////// +その他のメモ : + +AppWizard では "TODO:" を使用して、ユーザーが追加またはカスタマイズする必要のあるソース コードを示します。 + +///////////////////////////////////////////////////////////////////////////// diff --git a/src/OpenCvSharp.SandboxCpp/app.ico b/src/OpenCvSharp.SandboxCpp/app.ico new file mode 100644 index 000000000..301942f60 Binary files /dev/null and b/src/OpenCvSharp.SandboxCpp/app.ico differ diff --git a/src/OpenCvSharp.SandboxCpp/app.rc b/src/OpenCvSharp.SandboxCpp/app.rc new file mode 100644 index 000000000..e8f258de7 Binary files /dev/null and b/src/OpenCvSharp.SandboxCpp/app.rc differ diff --git a/src/OpenCvSharp.SandboxCpp/main.cpp b/src/OpenCvSharp.SandboxCpp/main.cpp new file mode 100644 index 000000000..8f15af58b --- /dev/null +++ b/src/OpenCvSharp.SandboxCpp/main.cpp @@ -0,0 +1,80 @@ +#include "stdafx.h" + +using namespace System; + +void captureTest() +{ + /* + cv::VideoCapture capture("C:\\temp\\stitching\\%03d.png"); + + if(!capture.isOpened()) + throw cv::Exception(0, "not opened", "hoge", "fuga", __LINE__); + + cv::namedWindow("window"); + while(true) + { + cv::Mat frame; + capture >> frame; + if(frame.empty()) + break; + + cv::imshow("window", frame); + cv::waitKey(); + }*/ + + auto capture = cvCreateFileCapture("C:\\temp\\stitching\\%03d.png"); + if(capture == nullptr) + throw cv::Exception(0, "not opened", "hoge", "fuga", __LINE__); + + cvNamedWindow("window"); + while(true) + { + IplImage *frame = cvQueryFrame(capture); + cvShowImage("window", frame); + cvWaitKey(); + } +} + +void part(const cv::Mat &src, std::vector &parts, int partsCount, cv::Size partSize) +{ + parts.resize(partsCount); + + cv::Mat disp = src.clone(); + + cv::RNG rng(std::time(nullptr)); + for (int i = 0; i < partsCount; i++) + { + int x = rng.uniform(0, src.cols - partSize.width); + int y = rng.uniform(0, src.rows - partSize.height); + cv::Rect rect(x, y, partSize.width, partSize.height); + + cv::Mat m = src(rect); + parts[i] = m.clone(); + + cv::rectangle(disp, rect, cv::Scalar(0, 0, 255)); + } + + cv::imwrite("C:\\temp\\disp.png", disp); + cv::imshow("disp", disp); + cv::waitKey(); + cv::destroyAllWindows(); +} + +int main(int argc, char *argv[]) +{ + ///* + cv::Mat src = cv::imread("C:\\test.png", cv::IMREAD_COLOR); + + cv::imshow("src", src); + cv::waitKey(); + cv::destroyAllWindows(); + //*/ + + //captureTest(); + + return 0; +} + + + + diff --git a/src/OpenCvSharp.SandboxCpp/resource.h b/src/OpenCvSharp.SandboxCpp/resource.h new file mode 100644 index 000000000..d5ac7c42a --- /dev/null +++ b/src/OpenCvSharp.SandboxCpp/resource.h @@ -0,0 +1,3 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by app.rc diff --git a/src/OpenCvSharp.SandboxCpp/stdafx.cpp b/src/OpenCvSharp.SandboxCpp/stdafx.cpp new file mode 100644 index 000000000..a979c2996 --- /dev/null +++ b/src/OpenCvSharp.SandboxCpp/stdafx.cpp @@ -0,0 +1,7 @@ +// stdafx.cpp : WCN[h Sansan.RD.SandboxCpp.pch ݂̂ +// ܂ރ\[X t@ĆAvRpCς݃wb_[ɂȂ܂B +// stdafx.obj ɂ̓vRpCς݌^񂪊܂܂܂B + +#include "stdafx.h" + + diff --git a/src/OpenCvSharp.SandboxCpp/stdafx.h b/src/OpenCvSharp.SandboxCpp/stdafx.h new file mode 100644 index 000000000..b6633a144 --- /dev/null +++ b/src/OpenCvSharp.SandboxCpp/stdafx.h @@ -0,0 +1,14 @@ +// stdafx.h : W̃VXe CN[h t@C̃CN[h t@CA܂ +// QƉ񐔂A‚܂ύXȂAvWFNgp̃CN[h t@C +// Lq܂B +// + +#pragma once + +// TODO: vOɕKvȒljwb_[ŎQƂĂB + +#include + +#include +//#include +//#include \ No newline at end of file diff --git a/src/OpenCvSharp.UserInterface/CvWindowEx.Designer.cs b/src/OpenCvSharp.UserInterface/CvWindowEx.Designer.cs new file mode 100644 index 000000000..148d05d35 --- /dev/null +++ b/src/OpenCvSharp.UserInterface/CvWindowEx.Designer.cs @@ -0,0 +1,75 @@ +namespace OpenCvSharp.UserInterface +{ + partial class CvWindowEx + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this._panelTrackbar = new System.Windows.Forms.Panel(); + this._pictureBox = new OpenCvSharp.UserInterface.PictureBoxIpl(); + ((System.ComponentModel.ISupportInitialize)(this._pictureBox)).BeginInit(); + this.SuspendLayout(); + // + // _panelTrackbar + // + this._panelTrackbar.Dock = System.Windows.Forms.DockStyle.Top; + this._panelTrackbar.Location = new System.Drawing.Point(0, 0); + this._panelTrackbar.Name = "_panelTrackbar"; + this._panelTrackbar.Size = new System.Drawing.Size(584, 0); + this._panelTrackbar.TabIndex = 0; + // + // _pictureBox + // + this._pictureBox.Dock = System.Windows.Forms.DockStyle.Fill; + this._pictureBox.Location = new System.Drawing.Point(0, 0); + this._pictureBox.Name = "_pictureBox"; + this._pictureBox.Size = new System.Drawing.Size(584, 443); + this._pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this._pictureBox.TabIndex = 2; + this._pictureBox.TabStop = false; + // + // CvWindowEx + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(584, 443); + this.Controls.Add(this._pictureBox); + this.Controls.Add(this._panelTrackbar); + this.KeyPreview = true; + this.Name = "CvWindowEx"; + this.Text = "CvWindowEx"; + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CvWindowEx_KeyDown); + ((System.ComponentModel.ISupportInitialize)(this._pictureBox)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel _panelTrackbar; + private PictureBoxIpl _pictureBox; + } +} \ No newline at end of file diff --git a/src/OpenCvSharp.UserInterface/CvWindowEx.cs b/src/OpenCvSharp.UserInterface/CvWindowEx.cs new file mode 100644 index 000000000..1dd087353 --- /dev/null +++ b/src/OpenCvSharp.UserInterface/CvWindowEx.cs @@ -0,0 +1,399 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Drawing; +using System.Threading; +using System.Windows.Forms; + +namespace OpenCvSharp.UserInterface +{ +#if LANG_JP + /// + /// highguiを用いない、System.Windows.FormsによるCvWindowの実装 + /// +#else + /// + /// Original CvWindow implementation without highgui + /// +#endif + public partial class CvWindowEx : Form, IDisposable + { + #region Fields + private List pressedKeys; + private static readonly List windows; + #endregion + + #region Initialization and dispose + /// + /// static constructor + /// + static CvWindowEx() + { + windows = new List(); + } + +#if LANG_JP + /// + /// 既定の初期化 + /// +#else + /// + /// Default Constructor + /// +#endif + public CvWindowEx() + { + InitializeComponent(); + pressedKeys = null; + _pictureBox.Image = null; + this.Show(); + windows.Add(this); + } +#if LANG_JP + /// + /// 初期化 + /// + /// +#else + /// + /// Constructor + /// + /// +#endif + public CvWindowEx(Mat image) : this() + { + Image = image; + } +#if LANG_JP + /// + /// 初期化 + /// + /// +#else + /// + /// Constructor + /// + /// +#endif + public CvWindowEx(PictureBoxSizeMode sizeMode) + : this() + { + _pictureBox.SizeMode = sizeMode; + } +#if LANG_JP + /// + /// 初期化 + /// + /// + /// +#else + /// + /// Constructor + /// + /// + /// +#endif + public CvWindowEx(Mat image, PictureBoxSizeMode sizeMode) + : this() + { + Image = image; + _pictureBox.SizeMode = sizeMode; + } + +#if LANG_JP + /// + /// リソースの解放 + /// +#else + /// + /// Finalizer + /// +#endif + public new void Dispose() + { + base.Dispose(); + windows.Remove(this); + } + #endregion + + #region Event handlers + private void CvWindowEx_KeyDown(object sender, KeyEventArgs e) + { + if (pressedKeys != null) + { + pressedKeys.Add(e.KeyCode); + } + } + #endregion + + #region Properties +#if LANG_JP + /// + /// 表示するIplImageを取得・設定する + /// +#else + /// + /// Gets or sets an image to be shown + /// +#endif + public Mat Image + { + get { return _pictureBox.ImageIpl; } + set + { + if (value != null) + { + Size size = value.Size(); + size.Height += _panelTrackbar.ClientSize.Height; + SetClientSize(new System.Drawing.Size(size.Width, size.Height)); + } + _pictureBox.ImageIpl = value; + } + } +#if LANG_JP + /// + /// 画像を表示しているPictureBoxコントロールを取得する + /// +#else + /// + /// Gets Picturebox control + /// +#endif + public PictureBox PictureBox + { + get + { + return _pictureBox; + } + } +#if LANG_JP + /// + /// CreateTrackbarで作成したトラックバーのリストを取得する + /// +#else + /// + /// Gets all created trackbars + /// +#endif + public TrackbarWithLabel[] Trackbars + { + get + { + TrackbarWithLabel[] result = new TrackbarWithLabel[_panelTrackbar.Controls.Count]; + _panelTrackbar.Controls.CopyTo(result, 0); + return result; + } + } + #endregion + + #region Public methods +#if LANG_JP + /// + /// 指定したIplImageを表示する + /// + /// +#else + /// + /// Shows the image in this window + /// + /// Image to be shown. +#endif + public void ShowImage(Mat image) + { + Image = image; + } +#if LANG_JP + /// + /// ウィンドウにトラックバーを作成し、作成したトラックバーを返す + /// + /// トラックバーの名前 + /// スライダの初期位置 + /// スライダの最大値.最小値は常に 0. + /// スライダの位置が変更されるたびに呼び出されるデリゲート + /// +#else + /// + /// Creates the trackbar and attaches it to this window + /// + /// Name of created trackbar. + /// The position of the slider + /// Maximal position of the slider. Minimal position is always 0. + /// the function to be called every time the slider changes the position. This function should be prototyped as void Foo(int); + /// +#endif + public TrackbarWithLabel CreateTrackbar(string name, int value, int count, CvTrackbarCallback onChange) + { + var t = new TrackbarWithLabel(name, value, count, 0); + t.Dock = DockStyle.Top; + t.Trackbar.ValueChanged += (o, e) => + { + int pos = ((TrackBar)o).Value; + onChange(pos); + }; + SetClientSize(new System.Drawing.Size(ClientSize.Width, ClientSize.Height + t.Height)); + _panelTrackbar.Height += t.Height; + _panelTrackbar.Controls.Add(t); + return t; + } + +#if LANG_JP + /// + /// 何かキーが押されるまで待機する. + /// +#else + /// + /// Waits for a pressed key + /// +#endif + public static Keys WaitKey() + { + return WaitKey(0); + } +#if LANG_JP + /// + /// 何かキーが押されるまで待機する. + /// + /// 押されたキーのキーコード +#else + /// + /// Waits for a pressed key + /// + /// Key code +#endif + public static Keys WaitKey(int delay) + { + Keys result = Keys.None; + Stopwatch watch = Stopwatch.StartNew(); + + foreach (CvWindowEx w in windows) + { + w.StartKeyCheck(); + } + while (!ClosedAllWindows() && (delay <= 0 || watch.ElapsedMilliseconds < delay)) + { + Application.DoEvents(); + Thread.Sleep(1); + foreach (CvWindowEx w in windows) + { + if (!w.Created) + { + continue; + } + Keys key = w.GetPressedKey(); + if (key != Keys.None) + { + result = key; + goto END_WHILE; + } + } + } + END_WHILE: + foreach (CvWindowEx w in windows) + { + w.EndKeyCheck(); + } + + return result; + } + +#if LANG_JP + /// + /// 引数に指定した画像をそれぞれ別のウィンドウで表示し、キー入力待ち状態にする。 + /// + /// 表示させる画像。任意の個数を指定できる。 +#else + /// + /// + /// + /// +#endif + static public void ShowImages(params Mat[] images) + { + if (images == null) + { + throw new ArgumentNullException("images"); + } + if (images.Length == 0) + { + return; + } + var windows = new List(); + foreach (Mat img in images) + { + windows.Add(new CvWindowEx(img)); + } + WaitKey(); + foreach (CvWindowEx w in windows) + { + w.Close(); + } + } + #endregion + + #region Private Methods + /// + /// + /// + private void StartKeyCheck() + { + pressedKeys = new List(); + } + /// + /// + /// + private void EndKeyCheck() + { + pressedKeys = null; + } + /// + /// + /// + /// + private static bool ClosedAllWindows() + { + foreach (CvWindowEx w in windows) + { + if (w.Created) + { + return false; + } + } + return true; + } + /// + /// + /// + /// + private Keys GetPressedKey() + { + if (pressedKeys == null || pressedKeys.Count == 0) + return Keys.None; + else + return pressedKeys[0]; + } + + /// + /// ClientSizeを画面からはみ出ない大きさに調整して設定する. + /// + /// + private void SetClientSize(System.Drawing.Size size) + { + var screenSize = Screen.PrimaryScreen.Bounds.Size; + if (size.Width > screenSize.Width) + { + double ratio = (double)screenSize.Width / size.Width; + size.Width = Convert.ToInt32(size.Width * ratio); + size.Height = Convert.ToInt32(size.Height * ratio); + } + if (size.Height > screenSize.Height) + { + double ratio = (double)screenSize.Height / size.Height; + size.Width = Convert.ToInt32(size.Width * ratio); + size.Height = Convert.ToInt32(size.Height * ratio); + } + ClientSize = new System.Drawing.Size(size.Width, size.Height); + } + #endregion + + } +} \ No newline at end of file diff --git a/src/OpenCvSharp.UserInterface/CvWindowEx.resx b/src/OpenCvSharp.UserInterface/CvWindowEx.resx new file mode 100644 index 000000000..19dc0dd8b --- /dev/null +++ b/src/OpenCvSharp.UserInterface/CvWindowEx.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/OpenCvSharp.UserInterface/Key.snk b/src/OpenCvSharp.UserInterface/Key.snk new file mode 100644 index 000000000..a1e033087 Binary files /dev/null and b/src/OpenCvSharp.UserInterface/Key.snk differ diff --git a/src/OpenCvSharp.UserInterface/OpenCvSharp.UserInterface.csproj b/src/OpenCvSharp.UserInterface/OpenCvSharp.UserInterface.csproj new file mode 100644 index 000000000..b40e3d178 --- /dev/null +++ b/src/OpenCvSharp.UserInterface/OpenCvSharp.UserInterface.csproj @@ -0,0 +1,116 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {DB12E2F1-1A50-4D12-A92F-4C3D705ECC1F} + Library + Properties + OpenCvSharp.UserInterface + OpenCvSharp.UserInterface + v3.5 + 512 + + + 3.5 + + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + bin\Release\OpenCvSharp.UserInterface.XML + + + bin\Release JP\ + TRACE + true + pdbonly + AnyCPU + prompt + bin\Release JP\OpenCvSharp.UserInterface.XML + + + true + + + Key.snk + + + + + + + + + Form + + + CvWindowEx.cs + + + Component + + + + UserControl + + + TrackbarWithLabel.cs + + + + + CvWindowEx.cs + Designer + + + TrackbarWithLabel.cs + Designer + + + + + + + + + + + {524cc7b4-75b9-4925-9da4-3dacd40f4814} + OpenCvSharp + + + {f1110c7b-46b1-4504-871e-135b57f9de67} + OpenCvSharp.Extensions + + + + + + + + + \ No newline at end of file diff --git a/src/OpenCvSharp.UserInterface/PictureBoxIpl.cs b/src/OpenCvSharp.UserInterface/PictureBoxIpl.cs new file mode 100644 index 000000000..f24955557 --- /dev/null +++ b/src/OpenCvSharp.UserInterface/PictureBoxIpl.cs @@ -0,0 +1,134 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using OpenCvSharp.Extensions; + +namespace OpenCvSharp.UserInterface +{ +#if LANG_JP + /// + /// IplImageの表示をサポートしたPictureBox + /// +#else + /// + /// PictureBox control which supports IplImage + /// +#endif + public class PictureBoxIpl : PictureBox + { + private Mat imageIpl; + + +#if LANG_JP + /// + /// 初期化 + /// +#else + /// + /// Constructor + /// +#endif + public PictureBoxIpl() : base() + { + imageIpl = null; + } + + +#if LANG_JP + /// + /// 表示するIplImageを取得・設定する + /// + [Description("表示するIplImageを取得・設定する")] +#else + /// + /// Gets or sets the IplImage instance to be shown + /// + [Description("Gets or sets the IplImage instance to be shown")] +#endif + [Browsable(false)] + [Category()] + [DefaultValue(null)] + public Mat ImageIpl + { + get { return imageIpl; } + set + { + if (value != null && value.IsDisposed) + { + throw new ArgumentException("the image is disposed.", "value"); + } + + imageIpl = value; + if (Image != null) + { + Image.Dispose(); + } + if (value == null) + { + Image = null; + } + else + { + Image = BitmapConverter.ToBitmap(value); + } + } + } + +#if LANG_JP + /// + /// 表示されているIplImageを更新する + /// +#else + /// + /// Refreshes the shown image + /// +#endif + public void RefreshIplImage() + { + if (ImageIpl == null) + { + return; + } + if (Image.Width != ImageIpl.Width || Image.Height != ImageIpl.Height) + { + Image = BitmapConverter.ToBitmap(ImageIpl); + } + else + { + BitmapConverter.ToBitmap(ImageIpl, (Bitmap)Image); + } + } + +#if LANG_JP + /// + /// 表示されているIplImageを更新する + /// + /// +#else + /// + /// Refreshes the shown image + /// + /// +#endif + public void RefreshIplImage(Mat img) + { + if (img == null || Image == null) + { + ImageIpl = img; + } + else if (Image.Width != img.Width || Image.Height != img.Height) + { + ImageIpl = img; + } + else + { + imageIpl = img; + BitmapConverter.ToBitmap(img, (Bitmap)Image); + } + Refresh(); + } + } +} diff --git a/src/OpenCvSharp.UserInterface/Properties/AssemblyInfo.cs b/src/OpenCvSharp.UserInterface/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..daba88180 --- /dev/null +++ b/src/OpenCvSharp.UserInterface/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 +// アセンブリに関連付けられている情報を変更するには、 +// これらの属性値を変更してください。 +[assembly: AssemblyTitle("OpenCvSharp.UserInterface")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OpenCvSharp.UserInterface")] +[assembly: AssemblyCopyright("Copyright © 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから +// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 +// その型の ComVisible 属性を true に設定してください。 +[assembly: ComVisible(false)] + +// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です +[assembly: Guid("39816929-dfba-491e-8182-e36f0e15746d")] + +// アセンブリのバージョン情報は、以下の 4 つの値で構成されています: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を +// 既定値にすることができます: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/OpenCvSharp.UserInterface/ReadMe.txt b/src/OpenCvSharp.UserInterface/ReadMe.txt new file mode 100644 index 000000000..09fbe223b --- /dev/null +++ b/src/OpenCvSharp.UserInterface/ReadMe.txt @@ -0,0 +1 @@ +This library is licensed using the LGPL (http://www.gnu.org/licenses/lgpl.html). diff --git a/src/OpenCvSharp.UserInterface/TrackbarWithLabel.Designer.cs b/src/OpenCvSharp.UserInterface/TrackbarWithLabel.Designer.cs new file mode 100644 index 000000000..bf15899cd --- /dev/null +++ b/src/OpenCvSharp.UserInterface/TrackbarWithLabel.Designer.cs @@ -0,0 +1,102 @@ +namespace OpenCvSharp.UserInterface +{ + partial class TrackbarWithLabel + { + /// + /// 必要なデザイナ変数です。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 使用中のリソースをすべてクリーンアップします。 + /// + /// マネージ リソースが破棄される場合 true、破棄されない場合は false です。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region コンポーネント デザイナで生成されたコード + + /// + /// デザイナ サポートに必要なメソッドです。このメソッドの内容を + /// コード エディタで変更しないでください。 + /// + private void InitializeComponent() + { + this._trackBar = new System.Windows.Forms.TrackBar(); + this._label = new System.Windows.Forms.Label(); + this._splitContainer = new System.Windows.Forms.SplitContainer(); + ((System.ComponentModel.ISupportInitialize)(this._trackBar)).BeginInit(); + this._splitContainer.Panel1.SuspendLayout(); + this._splitContainer.Panel2.SuspendLayout(); + this._splitContainer.SuspendLayout(); + this.SuspendLayout(); + // + // _trackBar + // + this._trackBar.Dock = System.Windows.Forms.DockStyle.Fill; + this._trackBar.Location = new System.Drawing.Point(0, 0); + this._trackBar.Name = "_trackBar"; + this._trackBar.Size = new System.Drawing.Size(403, 49); + this._trackBar.TabIndex = 0; + this._trackBar.TickStyle = System.Windows.Forms.TickStyle.Both; + this._trackBar.ValueChanged += new System.EventHandler(this._trackBar_ValueChanged); + // + // _label + // + this._label.Dock = System.Windows.Forms.DockStyle.Fill; + this._label.Font = new System.Drawing.Font("MS UI Gothic", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128))); + this._label.Location = new System.Drawing.Point(0, 0); + this._label.Name = "_label"; + this._label.Size = new System.Drawing.Size(139, 49); + this._label.TabIndex = 1; + this._label.Text = "Label"; + this._label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // _splitContainer + // + this._splitContainer.Dock = System.Windows.Forms.DockStyle.Fill; + this._splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this._splitContainer.Location = new System.Drawing.Point(0, 0); + this._splitContainer.Name = "_splitContainer"; + // + // _splitContainer.Panel1 + // + this._splitContainer.Panel1.Controls.Add(this._label); + this._splitContainer.Panel1MinSize = 100; + // + // _splitContainer.Panel2 + // + this._splitContainer.Panel2.Controls.Add(this._trackBar); + this._splitContainer.Size = new System.Drawing.Size(546, 49); + this._splitContainer.SplitterDistance = 139; + this._splitContainer.TabIndex = 2; + // + // TrackbarWithLabel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this._splitContainer); + this.Name = "TrackbarWithLabel"; + this.Size = new System.Drawing.Size(546, 49); + ((System.ComponentModel.ISupportInitialize)(this._trackBar)).EndInit(); + this._splitContainer.Panel1.ResumeLayout(false); + this._splitContainer.Panel2.ResumeLayout(false); + this._splitContainer.Panel2.PerformLayout(); + this._splitContainer.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TrackBar _trackBar; + private System.Windows.Forms.Label _label; + private System.Windows.Forms.SplitContainer _splitContainer; + } +} diff --git a/src/OpenCvSharp.UserInterface/TrackbarWithLabel.cs b/src/OpenCvSharp.UserInterface/TrackbarWithLabel.cs new file mode 100644 index 000000000..7f5fc8f73 --- /dev/null +++ b/src/OpenCvSharp.UserInterface/TrackbarWithLabel.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace OpenCvSharp.UserInterface +{ +#if LANG_JP + /// + /// ラベルがセットになったトラックバー + /// +#else + /// + /// A Trackbar come with label + /// +#endif + public partial class TrackbarWithLabel : UserControl + { + private string _labelText; + + /// + /// Constructor + /// + public TrackbarWithLabel() + { + InitializeComponent(); + } + /// + /// Constructor + /// + /// + /// + /// + /// + public TrackbarWithLabel(string labelText, int pos, int max, int min) : this() + { + _labelText = labelText; + _trackBar.Maximum = max; + _trackBar.Minimum = min; + _trackBar.Value = pos; + _trackBar.TickFrequency = (max - min) / 10; + SetLabelText(); + } + +#if LANG_JP + /// + /// TrackBarコントロール + /// +#else + /// + /// TrackBar control + /// +#endif + public TrackBar Trackbar + { + get { return _trackBar; } + } +#if LANG_JP + /// + /// Labelコントロール + /// +#else + /// + /// Label control + /// +#endif + public Label Label + { + get { return _label; } + } + + /// + /// + /// + private void SetLabelText() + { + string text = string.Format("{0} : {1}", _labelText, _trackBar.Value); + _label.Text = text; + } + + /// + /// + /// + /// + /// + private void _trackBar_ValueChanged(object sender, EventArgs e) + { + SetLabelText(); + } + } +} diff --git a/src/OpenCvSharp.UserInterface/TrackbarWithLabel.resx b/src/OpenCvSharp.UserInterface/TrackbarWithLabel.resx new file mode 100644 index 000000000..19dc0dd8b --- /dev/null +++ b/src/OpenCvSharp.UserInterface/TrackbarWithLabel.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/OpenCvSharp/Cv2/Cv2.cs b/src/OpenCvSharp/Cv2/Cv2.cs new file mode 100644 index 000000000..34c4ae32e --- /dev/null +++ b/src/OpenCvSharp/Cv2/Cv2.cs @@ -0,0 +1,32 @@ +using System; + +// ReSharper disable InconsistentNaming + +namespace OpenCvSharp +{ + /// + /// OpenCV Functions of C++ I/F (cv::xxx) + /// + public static partial class Cv2 + { + /// + /// The ratio of a circle's circumference to its diameter + /// + public const double PI = 3.1415926535897932384626433832795; + + /// + /// + /// + public const double LOG2 = 0.69314718055994530941723212145818; + + /// + /// 引数がnullの時はIntPtr.Zeroに変換する + /// + /// + /// + internal static IntPtr ToPtr(ICvPtrHolder obj) + { + return (obj == null) ? IntPtr.Zero : obj.CvPtr; + } + } +} diff --git a/src/OpenCvSharp/Cv2/Cv2_calib3d.cs b/src/OpenCvSharp/Cv2/Cv2_calib3d.cs new file mode 100644 index 000000000..7f187e949 --- /dev/null +++ b/src/OpenCvSharp/Cv2/Cv2_calib3d.cs @@ -0,0 +1,2557 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + using FeatureDetector = Feature2D; + + static partial class Cv2 + { + #region Rodrigues + /// + /// converts rotation vector to rotation matrix or vice versa using Rodrigues transformation + /// + /// Input rotation vector (3x1 or 1x3) or rotation matrix (3x3). + /// Output rotation matrix (3x3) or rotation vector (3x1 or 1x3), respectively. + /// Optional output Jacobian matrix, 3x9 or 9x3, which is a matrix of partial derivatives of the output array components with respect to the input array components. + public static void Rodrigues(InputArray src, OutputArray dst, OutputArray jacobian = null) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.calib3d_Rodrigues(src.CvPtr, dst.CvPtr, ToPtr(jacobian)); + dst.Fix(); + if (jacobian != null) + jacobian.Fix(); + } + + /// + /// converts rotation vector to rotation matrix using Rodrigues transformation + /// + /// Input rotation vector (3x1). + /// Output rotation matrix (3x3). + /// Optional output Jacobian matrix, 3x9, which is a matrix of partial derivatives of the output array components with respect to the input array components. + public static void Rodrigues(double[] vector, out double[,] matrix, out double[,] jacobian) + { + if (vector == null) + throw new ArgumentNullException("vector"); + if (vector.Length != 3) + throw new ArgumentException("vector.Length != 3"); + + using (var vectorM = new Mat(3, 1, MatType.CV_64FC1, vector)) + using (var matrixM = new MatOfDouble()) + using (var jacobianM = new MatOfDouble()) + { + NativeMethods.calib3d_Rodrigues_VecToMat(vectorM.CvPtr, matrixM.CvPtr, jacobianM.CvPtr); + matrix = matrixM.ToRectangularArray(); + jacobian = jacobianM.ToRectangularArray(); + } + } + /// + /// converts rotation vector to rotation matrix using Rodrigues transformation + /// + /// Input rotation vector (3x1). + /// Output rotation matrix (3x3). + public static void Rodrigues(double[] vector, out double[,] matrix) + { + double[,] jacobian; + Rodrigues(vector, out matrix, out jacobian); + } + + /// + /// converts rotation matrix to rotation vector using Rodrigues transformation + /// + /// Input rotation matrix (3x3). + /// Output rotation vector (3x1). + /// Optional output Jacobian matrix, 3x9, which is a matrix of partial derivatives of the output array components with respect to the input array components. + public static void Rodrigues(double[,] matrix, out double[] vector, out double[,] jacobian) + { + if (matrix == null) + throw new ArgumentNullException("matrix"); + if (matrix.GetLength(0) != 3 || matrix.GetLength(1) != 3) + throw new ArgumentException("matrix must be double[3,3]"); + + using (var matrixM = new Mat(3, 3, MatType.CV_64FC1, matrix)) + using (var vectorM = new MatOfDouble()) + using (var jacobianM = new MatOfDouble()) + { + NativeMethods.calib3d_Rodrigues_MatToVec(matrixM.CvPtr, vectorM.CvPtr, jacobianM.CvPtr); + vector = vectorM.ToArray(); + jacobian = jacobianM.ToRectangularArray(); + } + } + /// + /// converts rotation matrix to rotation vector using Rodrigues transformation + /// + /// Input rotation matrix (3x3). + /// Output rotation vector (3x1). + public static void Rodrigues(double[,] matrix, out double[] vector) + { + double[,] jacobian; + Rodrigues(matrix, out vector, out jacobian); + } + #endregion + #region FindHomography + /// + /// computes the best-fit perspective transformation mapping srcPoints to dstPoints. + /// + /// Coordinates of the points in the original plane, a matrix of the type CV_32FC2 + /// Coordinates of the points in the target plane, a matrix of the type CV_32FC2 + /// Method used to computed a homography matrix. + /// Maximum allowed reprojection error to treat a point pair as an inlier (used in the RANSAC method only) + /// Optional output mask set by a robust method ( CV_RANSAC or CV_LMEDS ). Note that the input mask values are ignored. + /// + public static Mat FindHomography(InputArray srcPoints, InputArray dstPoints, + HomographyMethods method = HomographyMethods.None, double ransacReprojThreshold = 3, + OutputArray mask = null) + { + if (srcPoints == null) + throw new ArgumentNullException("srcPoints"); + if (dstPoints == null) + throw new ArgumentNullException("dstPoints"); + srcPoints.ThrowIfDisposed(); + dstPoints.ThrowIfDisposed(); + + IntPtr mat = NativeMethods.calib3d_findHomography_InputArray(srcPoints.CvPtr, dstPoints.CvPtr, (int)method, + ransacReprojThreshold, ToPtr(mask)); + + if (mask != null) + mask.Fix(); + return new Mat(mat); + } + /// + /// computes the best-fit perspective transformation mapping srcPoints to dstPoints. + /// + /// Coordinates of the points in the original plane + /// Coordinates of the points in the target plane + /// Method used to computed a homography matrix. + /// Maximum allowed reprojection error to treat a point pair as an inlier (used in the RANSAC method only) + /// Optional output mask set by a robust method ( CV_RANSAC or CV_LMEDS ). Note that the input mask values are ignored. + /// + public static Mat FindHomography(IEnumerable srcPoints, IEnumerable dstPoints, + HomographyMethods method = HomographyMethods.None, double ransacReprojThreshold = 3, + OutputArray mask = null) + { + if (srcPoints == null) + throw new ArgumentNullException("srcPoints"); + if (dstPoints == null) + throw new ArgumentNullException("dstPoints"); + + Point2d[] srcPointsArray = EnumerableEx.ToArray(srcPoints); + Point2d[] dstPointsArray = EnumerableEx.ToArray(dstPoints); + + IntPtr mat = NativeMethods.calib3d_findHomography_vector(srcPointsArray, srcPointsArray.Length, + dstPointsArray, dstPointsArray.Length, (int)method, ransacReprojThreshold, ToPtr(mask)); + + if (mask != null) + mask.Fix(); + return new Mat(mat); + } + #endregion + #region RQDecomp3x3 + /// + /// Computes RQ decomposition of 3x3 matrix + /// + /// 3x3 input matrix. + /// Output 3x3 upper-triangular matrix. + /// Output 3x3 orthogonal matrix. + /// Optional output 3x3 rotation matrix around x-axis. + /// Optional output 3x3 rotation matrix around y-axis. + /// Optional output 3x3 rotation matrix around z-axis. + /// + public static Vec3d RQDecomp3x3(InputArray src, OutputArray mtxR, OutputArray mtxQ, + OutputArray qx = null, OutputArray qy = null, OutputArray qz = null) + { + if (src == null) + throw new ArgumentNullException("src"); + if (mtxR == null) + throw new ArgumentNullException("mtxR"); + if (mtxQ == null) + throw new ArgumentNullException("mtxQ"); + src.ThrowIfDisposed(); + mtxR.ThrowIfNotReady(); + mtxQ.ThrowIfNotReady(); + Vec3d ret; + NativeMethods.calib3d_RQDecomp3x3_InputArray(src.CvPtr, mtxR.CvPtr, mtxQ.CvPtr, + ToPtr(qx), ToPtr(qy), ToPtr(qz), out ret); + if (qx != null) + qx.Fix(); + if (qy != null) + qy.Fix(); + if (qz != null) + qz.Fix(); + return ret; + } + + /// + /// Computes RQ decomposition of 3x3 matrix + /// + /// 3x3 input matrix. + /// Output 3x3 upper-triangular matrix. + /// Output 3x3 orthogonal matrix. + /// + public static Vec3d RQDecomp3x3(double[,] src, out double[,] mtxR, out double[,] mtxQ) + { + double[,] qx, qy, qz; + return RQDecomp3x3(src, out mtxR, out mtxQ, out qx, out qy, out qz); + } + /// + /// Computes RQ decomposition of 3x3 matrix + /// + /// 3x3 input matrix. + /// Output 3x3 upper-triangular matrix. + /// Output 3x3 orthogonal matrix. + /// Optional output 3x3 rotation matrix around x-axis. + /// Optional output 3x3 rotation matrix around y-axis. + /// Optional output 3x3 rotation matrix around z-axis. + /// + public static Vec3d RQDecomp3x3(double[,] src, out double[,] mtxR, out double[,] mtxQ, + out double[,] qx, out double[,] qy, out double[,] qz) + { + if (src == null) + throw new ArgumentNullException("src"); + if (src.GetLength(0) != 3 || src.GetLength(1) != 3) + throw new ArgumentException("src must be double[3,3]"); + + using (var srcM = new Mat(3, 3, MatType.CV_64FC1)) + using (var mtxRM = new MatOfDouble()) + using (var mtxQM = new MatOfDouble()) + using (var qxM = new MatOfDouble()) + using (var qyM = new MatOfDouble()) + using (var qzM = new MatOfDouble()) + { + Vec3d ret; + NativeMethods.calib3d_RQDecomp3x3_Mat(srcM.CvPtr, + mtxRM.CvPtr, mtxQM.CvPtr, qxM.CvPtr, qyM.CvPtr, qzM.CvPtr, + out ret); + mtxR = mtxRM.ToRectangularArray(); + mtxQ = mtxQM.ToRectangularArray(); + qx = qxM.ToRectangularArray(); + qy = qyM.ToRectangularArray(); + qz = qzM.ToRectangularArray(); + return ret; + } + } + #endregion + #region DecomposeProjectionMatrix + /// + /// Decomposes the projection matrix into camera matrix and the rotation martix and the translation vector + /// + /// 3x4 input projection matrix P. + /// Output 3x3 camera matrix K. + /// Output 3x3 external rotation matrix R. + /// Output 4x1 translation vector T. + /// Optional 3x3 rotation matrix around x-axis. + /// Optional 3x3 rotation matrix around y-axis. + /// Optional 3x3 rotation matrix around z-axis. + /// ptional three-element vector containing three Euler angles of rotation in degrees. + public static void DecomposeProjectionMatrix(InputArray projMatrix, + OutputArray cameraMatrix, + OutputArray rotMatrix, + OutputArray transVect, + OutputArray rotMatrixX = null, + OutputArray rotMatrixY = null, + OutputArray rotMatrixZ = null, + OutputArray eulerAngles = null) + { + if (projMatrix == null) + throw new ArgumentNullException("projMatrix"); + if (cameraMatrix == null) + throw new ArgumentNullException("cameraMatrix"); + if (rotMatrix == null) + throw new ArgumentNullException("rotMatrix"); + projMatrix.ThrowIfDisposed(); + cameraMatrix.ThrowIfNotReady(); + rotMatrix.ThrowIfNotReady(); + transVect.ThrowIfNotReady(); + + NativeMethods.calib3d_decomposeProjectionMatrix_InputArray( + projMatrix.CvPtr, cameraMatrix.CvPtr, rotMatrix.CvPtr, transVect.CvPtr, + ToPtr(rotMatrixX), ToPtr(rotMatrixY), ToPtr(rotMatrixZ), ToPtr(eulerAngles)); + + cameraMatrix.Fix(); + rotMatrix.Fix(); + transVect.Fix(); + if (rotMatrixX != null) + rotMatrixX.Fix(); + if (rotMatrixY != null) + rotMatrixY.Fix(); + if (rotMatrixZ != null) + rotMatrixZ.Fix(); + if (eulerAngles != null) + eulerAngles.Fix(); + } + + /// + /// Decomposes the projection matrix into camera matrix and the rotation martix and the translation vector + /// + /// 3x4 input projection matrix P. + /// Output 3x3 camera matrix K. + /// Output 3x3 external rotation matrix R. + /// Output 4x1 translation vector T. + /// Optional 3x3 rotation matrix around x-axis. + /// Optional 3x3 rotation matrix around y-axis. + /// Optional 3x3 rotation matrix around z-axis. + /// ptional three-element vector containing three Euler angles of rotation in degrees. + public static void DecomposeProjectionMatrix(double[,] projMatrix, + out double[,] cameraMatrix, + out double[,] rotMatrix, + out double[] transVect, + out double[,] rotMatrixX, + out double[,] rotMatrixY, + out double[,] rotMatrixZ, + out double[] eulerAngles) + { + if (projMatrix == null) + throw new ArgumentNullException("projMatrix"); + int dim0 = projMatrix.GetLength(0); + int dim1 = projMatrix.GetLength(1); + if (!((dim0 == 3 && dim1 == 4) || (dim0 == 4 && dim1 == 3))) + throw new ArgumentException("projMatrix must be double[3,4] or double[4,3]"); + + using (var projMatrixM = new Mat(3, 4, MatType.CV_64FC1, projMatrix)) + using (var cameraMatrixM = new MatOfDouble()) + using (var rotMatrixM = new MatOfDouble()) + using (var transVectM = new MatOfDouble()) + using (var rotMatrixXM = new MatOfDouble()) + using (var rotMatrixYM = new MatOfDouble()) + using (var rotMatrixZM = new MatOfDouble()) + using (var eulerAnglesM = new MatOfDouble()) + { + NativeMethods.calib3d_decomposeProjectionMatrix_Mat( + projMatrixM.CvPtr, + cameraMatrixM.CvPtr, rotMatrixM.CvPtr, transVectM.CvPtr, + rotMatrixXM.CvPtr, rotMatrixYM.CvPtr, rotMatrixZM.CvPtr, + eulerAnglesM.CvPtr); + + cameraMatrix = cameraMatrixM.ToRectangularArray(); + rotMatrix = rotMatrixM.ToRectangularArray(); + transVect = transVectM.ToArray(); + rotMatrixX = rotMatrixXM.ToRectangularArray(); + rotMatrixY = rotMatrixYM.ToRectangularArray(); + rotMatrixZ = rotMatrixZM.ToRectangularArray(); + eulerAngles = eulerAnglesM.ToArray(); + } + } + /// + /// Decomposes the projection matrix into camera matrix and the rotation martix and the translation vector + /// + /// 3x4 input projection matrix P. + /// Output 3x3 camera matrix K. + /// Output 3x3 external rotation matrix R. + /// Output 4x1 translation vector T. + public static void DecomposeProjectionMatrix(double[,] projMatrix, + out double[,] cameraMatrix, + out double[,] rotMatrix, + out double[] transVect) + { + double[,] rotMatrixX, rotMatrixY, rotMatrixZ; + double[] eulerAngles; + DecomposeProjectionMatrix(projMatrix, out cameraMatrix, out rotMatrix, out transVect, + out rotMatrixX, out rotMatrixY, out rotMatrixZ, out eulerAngles); + } + #endregion + #region MatMulDeriv + + /// + /// computes derivatives of the matrix product w.r.t each of the multiplied matrix coefficients + /// + /// First multiplied matrix. + /// Second multiplied matrix. + /// First output derivative matrix d(A*B)/dA of size A.rows*B.cols X A.rows*A.cols . + /// Second output derivative matrix d(A*B)/dB of size A.rows*B.cols X B.rows*B.cols . + public static void MatMulDeriv(InputArray a, InputArray b, + OutputArray dABdA, + OutputArray dABdB) + { + if (a == null) + throw new ArgumentNullException("a"); + if (b == null) + throw new ArgumentNullException("b"); + if (dABdA == null) + throw new ArgumentNullException("dABdA"); + if (dABdB == null) + throw new ArgumentNullException("dABdB"); + a.ThrowIfDisposed(); + b.ThrowIfDisposed(); + dABdA.ThrowIfNotReady(); + dABdB.ThrowIfNotReady(); + NativeMethods.calib3d_matMulDeriv(a.CvPtr, b.CvPtr, dABdA.CvPtr, dABdB.CvPtr); + dABdA.Fix(); + dABdB.Fix(); + } + #endregion + #region ComposeRT + /// + /// composes 2 [R|t] transformations together. Also computes the derivatives of the result w.r.t the arguments + /// + /// First rotation vector. + /// First translation vector. + /// Second rotation vector. + /// Second translation vector. + /// Output rotation vector of the superposition. + /// Output translation vector of the superposition. + /// Optional output derivatives of rvec3 or tvec3 with regard to rvec1, rvec2, tvec1 and tvec2, respectively. + /// Optional output derivatives of rvec3 or tvec3 with regard to rvec1, rvec2, tvec1 and tvec2, respectively. + /// Optional output derivatives of rvec3 or tvec3 with regard to rvec1, rvec2, tvec1 and tvec2, respectively. + /// Optional output derivatives of rvec3 or tvec3 with regard to rvec1, rvec2, tvec1 and tvec2, respectively. + /// Optional output derivatives of rvec3 or tvec3 with regard to rvec1, rvec2, tvec1 and tvec2, respectively. + /// Optional output derivatives of rvec3 or tvec3 with regard to rvec1, rvec2, tvec1 and tvec2, respectively. + /// Optional output derivatives of rvec3 or tvec3 with regard to rvec1, rvec2, tvec1 and tvec2, respectively. + /// Optional output derivatives of rvec3 or tvec3 with regard to rvec1, rvec2, tvec1 and tvec2, respectively. + public static void ComposeRT(InputArray rvec1, InputArray tvec1, + InputArray rvec2, InputArray tvec2, + OutputArray rvec3, OutputArray tvec3, + OutputArray dr3dr1 = null, OutputArray dr3dt1 = null, + OutputArray dr3dr2 = null, OutputArray dr3dt2 = null, + OutputArray dt3dr1 = null, OutputArray dt3dt1 = null, + OutputArray dt3dr2 = null, OutputArray dt3dt2 = null) + { + if (rvec1 == null) + throw new ArgumentNullException("rvec1"); + if (tvec1 == null) + throw new ArgumentNullException("tvec1"); + if (rvec2 == null) + throw new ArgumentNullException("rvec2"); + if (tvec2 == null) + throw new ArgumentNullException("tvec2"); + rvec1.ThrowIfDisposed(); + tvec1.ThrowIfDisposed(); + rvec2.ThrowIfDisposed(); + tvec2.ThrowIfDisposed(); + rvec3.ThrowIfNotReady(); + tvec3.ThrowIfNotReady(); + NativeMethods.calib3d_composeRT_InputArray(rvec1.CvPtr, tvec1.CvPtr, rvec2.CvPtr, tvec2.CvPtr, + rvec3.CvPtr, tvec3.CvPtr, + ToPtr(dr3dr1), ToPtr(dr3dt1), ToPtr(dr3dr2), ToPtr(dr3dt2), + ToPtr(dt3dr1), ToPtr(dt3dt1), ToPtr(dt3dr2), ToPtr(dt3dt2)); + } + + /// + /// composes 2 [R|t] transformations together. Also computes the derivatives of the result w.r.t the arguments + /// + /// First rotation vector. + /// First translation vector. + /// Second rotation vector. + /// Second translation vector. + /// Output rotation vector of the superposition. + /// Output translation vector of the superposition. + /// Optional output derivatives of rvec3 or tvec3 with regard to rvec1, rvec2, tvec1 and tvec2, respectively. + /// Optional output derivatives of rvec3 or tvec3 with regard to rvec1, rvec2, tvec1 and tvec2, respectively. + /// Optional output derivatives of rvec3 or tvec3 with regard to rvec1, rvec2, tvec1 and tvec2, respectively. + /// Optional output derivatives of rvec3 or tvec3 with regard to rvec1, rvec2, tvec1 and tvec2, respectively. + /// Optional output derivatives of rvec3 or tvec3 with regard to rvec1, rvec2, tvec1 and tvec2, respectively. + /// Optional output derivatives of rvec3 or tvec3 with regard to rvec1, rvec2, tvec1 and tvec2, respectively. + /// Optional output derivatives of rvec3 or tvec3 with regard to rvec1, rvec2, tvec1 and tvec2, respectively. + /// Optional output derivatives of rvec3 or tvec3 with regard to rvec1, rvec2, tvec1 and tvec2, respectively. + public static void ComposeRT(double[] rvec1, double[] tvec1, + double[] rvec2, double[] tvec2, + out double[] rvec3, out double[] tvec3, + out double[,] dr3dr1, out double[,] dr3dt1, + out double[,] dr3dr2, out double[,] dr3dt2, + out double[,] dt3dr1, out double[,] dt3dt1, + out double[,] dt3dr2, out double[,] dt3dt2) + { + if (rvec1 == null) + throw new ArgumentNullException("rvec1"); + if (tvec1 == null) + throw new ArgumentNullException("tvec1"); + if (rvec2 == null) + throw new ArgumentNullException("rvec2"); + if (tvec2 == null) + throw new ArgumentNullException("tvec2"); + + using (var rvec1M = new Mat(3, 1, MatType.CV_64FC1, rvec1)) + using (var tvec1M = new Mat(3, 1, MatType.CV_64FC1, tvec1)) + using (var rvec2M = new Mat(3, 1, MatType.CV_64FC1, rvec2)) + using (var tvec2M = new Mat(3, 1, MatType.CV_64FC1, tvec2)) + using (var rvec3M = new MatOfDouble()) + using (var tvec3M = new MatOfDouble()) + using (var dr3dr1M = new MatOfDouble()) + using (var dr3dt1M = new MatOfDouble()) + using (var dr3dr2M = new MatOfDouble()) + using (var dr3dt2M = new MatOfDouble()) + using (var dt3dr1M = new MatOfDouble()) + using (var dt3dt1M = new MatOfDouble()) + using (var dt3dr2M = new MatOfDouble()) + using (var dt3dt2M = new MatOfDouble()) + { + NativeMethods.calib3d_composeRT_Mat(rvec1M.CvPtr, tvec1M.CvPtr, rvec2M.CvPtr, tvec2M.CvPtr, + rvec3M.CvPtr, tvec3M.CvPtr, + dr3dr1M.CvPtr, dr3dt1M.CvPtr, dr3dr2M.CvPtr, dr3dt2M.CvPtr, + dt3dr1M.CvPtr, dt3dt1M.CvPtr, dt3dr2M.CvPtr, dt3dt2M.CvPtr); + rvec3 = rvec3M.ToArray(); + tvec3 = tvec3M.ToArray(); + dr3dr1 = dr3dr1M.ToRectangularArray(); + dr3dt1 = dr3dt1M.ToRectangularArray(); + dr3dr2 = dr3dr2M.ToRectangularArray(); + dr3dt2 = dr3dt2M.ToRectangularArray(); + dt3dr1 = dt3dr1M.ToRectangularArray(); + dt3dt1 = dt3dt1M.ToRectangularArray(); + dt3dr2 = dt3dr2M.ToRectangularArray(); + dt3dt2 = dt3dt2M.ToRectangularArray(); + } + } + + /// + /// composes 2 [R|t] transformations together. Also computes the derivatives of the result w.r.t the arguments + /// + /// First rotation vector. + /// First translation vector. + /// Second rotation vector. + /// Second translation vector. + /// Output rotation vector of the superposition. + /// Output translation vector of the superposition. + public static void ComposeRT(double[] rvec1, double[] tvec1, + double[] rvec2, double[] tvec2, + out double[] rvec3, out double[] tvec3) + { + double[,] dr3dr1, dr3dt1, + dr3dr2, dr3dt2, + dt3dr1, dt3dt1, + dt3dr2, dt3dt2; + ComposeRT(rvec1, tvec2, rvec2, tvec2, out rvec3, out tvec3, + out dr3dr1, out dr3dt1, out dr3dr2, out dr3dt2, + out dt3dr1, out dt3dt1, out dt3dr2, out dt3dt2); + } + + #endregion + #region ProjectPoints + /// + /// projects points from the model coordinate space to the image coordinates. + /// Also computes derivatives of the image coordinates w.r.t the intrinsic + /// and extrinsic camera parameters + /// + /// Array of object points, 3xN/Nx3 1-channel or + /// 1xN/Nx1 3-channel, where N is the number of points in the view. + /// Rotation vector (3x1). + /// Translation vector (3x1). + /// Camera matrix (3x3) + /// Input vector of distortion coefficients + /// (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. + /// If the vector is null, the zero distortion coefficients are assumed. + /// Output array of image points, 2xN/Nx2 1-channel + /// or 1xN/Nx1 2-channel + /// Optional output 2Nx(10 + numDistCoeffs) jacobian matrix + /// of derivatives of image points with respect to components of the rotation vector, + /// translation vector, focal lengths, coordinates of the principal point and + /// the distortion coefficients. In the old interface different components of + /// the jacobian are returned via different output parameters. + /// Optional “fixed aspect ratio” parameter. + /// If the parameter is not 0, the function assumes that the aspect ratio (fx/fy) + /// is fixed and correspondingly adjusts the jacobian matrix. + public static void ProjectPoints(InputArray objectPoints, + InputArray rvec, InputArray tvec, + InputArray cameraMatrix, InputArray distCoeffs, + OutputArray imagePoints, + OutputArray jacobian = null, + double aspectRatio = 0) + { + if (objectPoints == null) + throw new ArgumentNullException("objectPoints"); + if (rvec == null) + throw new ArgumentNullException("rvec"); + if (tvec == null) + throw new ArgumentNullException("tvec"); + if (cameraMatrix == null) + throw new ArgumentNullException("cameraMatrix"); + if (imagePoints == null) + throw new ArgumentNullException("imagePoints"); + objectPoints.ThrowIfDisposed(); + rvec.ThrowIfDisposed(); + tvec.ThrowIfDisposed(); + cameraMatrix.ThrowIfDisposed(); + imagePoints.ThrowIfNotReady(); + + NativeMethods.calib3d_projectPoints_InputArray(objectPoints.CvPtr, + rvec.CvPtr, tvec.CvPtr, cameraMatrix.CvPtr, ToPtr(distCoeffs), + imagePoints.CvPtr, ToPtr(jacobian), aspectRatio); + } + /// + /// projects points from the model coordinate space to the image coordinates. + /// Also computes derivatives of the image coordinates w.r.t the intrinsic + /// and extrinsic camera parameters + /// + /// Array of object points, 3xN/Nx3 1-channel or + /// 1xN/Nx1 3-channel, where N is the number of points in the view. + /// Rotation vector (3x1). + /// Translation vector (3x1). + /// Camera matrix (3x3) + /// Input vector of distortion coefficients + /// (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. + /// If the vector is null, the zero distortion coefficients are assumed. + /// Output array of image points, 2xN/Nx2 1-channel + /// or 1xN/Nx1 2-channel + /// Optional output 2Nx(10 + numDistCoeffs) jacobian matrix + /// of derivatives of image points with respect to components of the rotation vector, + /// translation vector, focal lengths, coordinates of the principal point and + /// the distortion coefficients. In the old interface different components of + /// the jacobian are returned via different output parameters. + /// Optional “fixed aspect ratio” parameter. + /// If the parameter is not 0, the function assumes that the aspect ratio (fx/fy) + /// is fixed and correspondingly adjusts the jacobian matrix. + public static void ProjectPoints(IEnumerable objectPoints, + double[] rvec, double[] tvec, + double[,] cameraMatrix, double[] distCoeffs, + out Point2d[] imagePoints, + out double[,] jacobian, + double aspectRatio = 0) + { + if (objectPoints == null) + throw new ArgumentNullException("objectPoints"); + if (rvec == null) + throw new ArgumentNullException("rvec"); + if (rvec.Length != 3) + throw new ArgumentException("rvec.Length != 3"); + if (tvec == null) + throw new ArgumentNullException("tvec"); + if (tvec.Length != 3) + throw new ArgumentException("tvec.Length != 3"); + if (cameraMatrix == null) + throw new ArgumentNullException("cameraMatrix"); + if (cameraMatrix.GetLength(0) != 3 || cameraMatrix.GetLength(1) != 3) + throw new ArgumentException("cameraMatrix must be double[3,3]"); + + Point3d[] objectPointsArray = EnumerableEx.ToArray(objectPoints); + using (var objectPointsM = new Mat(objectPointsArray.Length, 1, MatType.CV_64FC3, objectPointsArray)) + using (var rvecM = new Mat(3, 1, MatType.CV_64FC1, rvec)) + using (var tvecM = new Mat(3, 1, MatType.CV_64FC1, tvec)) + using (var cameraMatrixM = new Mat(3, 3, MatType.CV_64FC1, cameraMatrix)) + using (var imagePointsM = new MatOfPoint2d()) + { + var distCoeffsM = new Mat(); + if (distCoeffs != null) + distCoeffsM = new Mat(distCoeffs.Length, 1, MatType.CV_64FC1, distCoeffs); + var jacobianM = new MatOfDouble(); + + NativeMethods.calib3d_projectPoints_Mat(objectPointsM.CvPtr, + rvecM.CvPtr, tvecM.CvPtr, cameraMatrixM.CvPtr, distCoeffsM.CvPtr, + imagePointsM.CvPtr, jacobianM.CvPtr, aspectRatio); + + imagePoints = imagePointsM.ToArray(); + jacobian = jacobianM.ToRectangularArray(); + } + } + #endregion + #region SolvePnP + + /// + /// Finds an object pose from 3D-2D point correspondences. + /// + /// Array of object points in the object coordinate space, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel, + /// where N is the number of points. vector<Point3f> can be also passed here. + /// Array of corresponding image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, + /// where N is the number of points. vector<Point2f> can be also passed here. + /// Input camera matrix + /// Input vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. + /// If the vector is null, the zero distortion coefficients are assumed. + /// Output rotation vector that, together with tvec , brings points from the model coordinate system to the + /// camera coordinate system. + /// Output translation vector. + /// If true, the function uses the provided rvec and tvec values as initial approximations of + /// the rotation and translation vectors, respectively, and further optimizes them. + /// Method for solving a PnP problem: + public static void SolvePnP( + InputArray objectPoints, + InputArray imagePoints, + InputArray cameraMatrix, + InputArray distCoeffs, + OutputArray rvec, OutputArray tvec, + bool useExtrinsicGuess = false, + SolvePnPFlags flags = SolvePnPFlags.Iterative) + { + if (objectPoints == null) + throw new ArgumentNullException("objectPoints"); + if (imagePoints == null) + throw new ArgumentNullException("imagePoints"); + if (cameraMatrix == null) + throw new ArgumentNullException("cameraMatrix"); + if (rvec == null) + throw new ArgumentNullException("rvec"); + if (tvec == null) + throw new ArgumentNullException("tvec"); + objectPoints.ThrowIfDisposed(); + imagePoints.ThrowIfDisposed(); + cameraMatrix.ThrowIfDisposed(); + distCoeffs.ThrowIfDisposed(); + rvec.ThrowIfDisposed(); + tvec.ThrowIfDisposed(); + IntPtr distCoeffsPtr = ToPtr(distCoeffs); + NativeMethods.calib3d_solvePnP_InputArray( + objectPoints.CvPtr, imagePoints.CvPtr, cameraMatrix.CvPtr, distCoeffsPtr, + rvec.CvPtr, tvec.CvPtr, useExtrinsicGuess ? 1 : 0, (int)flags); + rvec.Fix(); + tvec.Fix(); + } + + /// + /// Finds an object pose from 3D-2D point correspondences. + /// + /// Array of object points in the object coordinate space, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel, + /// where N is the number of points. vector<Point3f> can be also passed here. + /// Array of corresponding image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, + /// where N is the number of points. vector<Point2f> can be also passed here. + /// Input camera matrix + /// Input vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. + /// If the vector is null, the zero distortion coefficients are assumed. + /// Output rotation vector that, together with tvec , brings points from the model coordinate system to the + /// camera coordinate system. + /// Output translation vector. + /// If true, the function uses the provided rvec and tvec values as initial approximations of + /// the rotation and translation vectors, respectively, and further optimizes them. + /// Method for solving a PnP problem: + public static void SolvePnP( + IEnumerable objectPoints, + IEnumerable imagePoints, + double[,] cameraMatrix, + IEnumerable distCoeffs, + out double[] rvec, out double[] tvec, + bool useExtrinsicGuess = false, + SolvePnPFlags flags = SolvePnPFlags.Iterative) + { + if (objectPoints == null) + throw new ArgumentNullException("objectPoints"); + if (imagePoints == null) + throw new ArgumentNullException("imagePoints"); + if (cameraMatrix == null) + throw new ArgumentNullException("cameraMatrix"); + if (cameraMatrix.GetLength(0) != 3 || cameraMatrix.GetLength(1) != 3) + throw new ArgumentException(""); + + Point3f[] objectPointsArray = EnumerableEx.ToArray(objectPoints); + Point2f[] imagePointsArray = EnumerableEx.ToArray(imagePoints); + double[] distCoeffsArray = EnumerableEx.ToArray(distCoeffs); + int distCoeffsLength = (distCoeffs == null) ? 0 : distCoeffsArray.Length; + rvec = new double[3]; + tvec = new double[3]; + + NativeMethods.calib3d_solvePnP_vector( + objectPointsArray, objectPointsArray.Length, + imagePointsArray, imagePointsArray.Length, + cameraMatrix, distCoeffsArray, distCoeffsLength, + rvec, tvec, useExtrinsicGuess ? 1 : 0, (int)flags); + } + #endregion + #region SolvePnPRansac + /// + /// computes the camera pose from a few 3D points and the corresponding projections. The outliers are possible. + /// + /// Array of object points in the object coordinate space, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel, + /// where N is the number of points. List<Point3f> can be also passed here. + /// Array of corresponding image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, where N is the number of points. + /// List<Point2f> can be also passed here. + /// Input 3x3 camera matrix + /// Input vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. + /// If the vector is null, the zero distortion coefficients are assumed. + /// Output rotation vector that, together with tvec , brings points from the model coordinate system + /// to the camera coordinate system. + /// Output translation vector. + /// If true, the function uses the provided rvec and tvec values as initial approximations + /// of the rotation and translation vectors, respectively, and further optimizes them. + /// Number of iterations. + /// Inlier threshold value used by the RANSAC procedure. + /// The parameter value is the maximum allowed distance between the observed and computed point projections to consider it an inlier. + /// Number of inliers. If the algorithm at some stage finds more inliers than minInliersCount , it finishes. + /// Output vector that contains indices of inliers in objectPoints and imagePoints . + /// Method for solving a PnP problem + public static void SolvePnPRansac( + InputArray objectPoints, + InputArray imagePoints, + InputArray cameraMatrix, + InputArray distCoeffs, + OutputArray rvec, + OutputArray tvec, + bool useExtrinsicGuess = false, + int iterationsCount = 100, + float reprojectionError = 8.0f, + int minInliersCount = 100, + OutputArray inliers = null, + SolvePnPFlags flags = SolvePnPFlags.Iterative) + { + if (objectPoints == null) + throw new ArgumentNullException("objectPoints"); + if (imagePoints == null) + throw new ArgumentNullException("imagePoints"); + if (cameraMatrix == null) + throw new ArgumentNullException("cameraMatrix"); + if (rvec == null) + throw new ArgumentNullException("rvec"); + if (tvec == null) + throw new ArgumentNullException("tvec"); + objectPoints.ThrowIfDisposed(); + imagePoints.ThrowIfDisposed(); + cameraMatrix.ThrowIfDisposed(); + distCoeffs.ThrowIfDisposed(); + rvec.ThrowIfDisposed(); + tvec.ThrowIfDisposed(); + IntPtr distCoeffsPtr = ToPtr(distCoeffs); + + NativeMethods.calib3d_solvePnPRansac_InputArray( + objectPoints.CvPtr, imagePoints.CvPtr, cameraMatrix.CvPtr, distCoeffsPtr, + rvec.CvPtr, tvec.CvPtr, useExtrinsicGuess ? 1 : 0, iterationsCount, + reprojectionError, minInliersCount, ToPtr(inliers), (int)flags); + + rvec.Fix(); + tvec.Fix(); + if (inliers != null) + inliers.Fix(); + } + + /// + /// computes the camera pose from a few 3D points and the corresponding projections. The outliers are possible. + /// + /// Array of object points in the object coordinate space, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel, + /// where N is the number of points. List<Point3f> can be also passed here. + /// Array of corresponding image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, where N is the number of points. + /// List<Point2f> can be also passed here. + /// Input 3x3 camera matrix + /// Input vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. + /// If the vector is null, the zero distortion coefficients are assumed. + /// Output rotation vector that, together with tvec , brings points from the model coordinate system + /// to the camera coordinate system. + /// Output translation vector. + public static void SolvePnPRansac( + IEnumerable objectPoints, + IEnumerable imagePoints, + double[,] cameraMatrix, + IEnumerable distCoeffs, + out double[] rvec, out double[] tvec) + { + int[] inliers; + SolvePnPRansac(objectPoints, imagePoints, cameraMatrix, distCoeffs, out rvec, out tvec, out inliers); + } + /// + /// computes the camera pose from a few 3D points and the corresponding projections. The outliers are possible. + /// + /// Array of object points in the object coordinate space, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel, + /// where N is the number of points. List<Point3f> can be also passed here. + /// Array of corresponding image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, where N is the number of points. + /// List<Point2f> can be also passed here. + /// Input 3x3 camera matrix + /// Input vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. + /// If the vector is null, the zero distortion coefficients are assumed. + /// Output rotation vector that, together with tvec , brings points from the model coordinate system + /// to the camera coordinate system. + /// Output translation vector. + /// If true, the function uses the provided rvec and tvec values as initial approximations + /// of the rotation and translation vectors, respectively, and further optimizes them. + /// Number of iterations. + /// Inlier threshold value used by the RANSAC procedure. + /// The parameter value is the maximum allowed distance between the observed and computed point projections to consider it an inlier. + /// Number of inliers. If the algorithm at some stage finds more inliers than minInliersCount , it finishes. + /// Output vector that contains indices of inliers in objectPoints and imagePoints . + /// Method for solving a PnP problem + public static void SolvePnPRansac( + IEnumerable objectPoints, + IEnumerable imagePoints, + double[,] cameraMatrix, + IEnumerable distCoeffs, + out double[] rvec, out double[] tvec, + out int[] inliers, + bool useExtrinsicGuess = false, + int iterationsCount = 100, + float reprojectionError = 8.0f, + int minInliersCount = 100, + SolvePnPFlags flags = SolvePnPFlags.Iterative) + { + if (objectPoints == null) + throw new ArgumentNullException("objectPoints"); + if (imagePoints == null) + throw new ArgumentNullException("imagePoints"); + if (cameraMatrix == null) + throw new ArgumentNullException("cameraMatrix"); + + if (cameraMatrix.GetLength(0) != 3 || cameraMatrix.GetLength(1) != 3) + throw new ArgumentException(""); + + Point3f[] objectPointsArray = EnumerableEx.ToArray(objectPoints); + Point2f[] imagePointsArray = EnumerableEx.ToArray(imagePoints); + double[] distCoeffsArray = EnumerableEx.ToArray(distCoeffs); + int distCoeffsLength = (distCoeffs == null) ? 0 : distCoeffsArray.Length; + rvec = new double[3]; + tvec = new double[3]; + + using (var inliersVec = new VectorOfInt32()) + { + NativeMethods.calib3d_solvePnPRansac_vector( + objectPointsArray, objectPointsArray.Length, + imagePointsArray, imagePointsArray.Length, + cameraMatrix, distCoeffsArray, distCoeffsLength, + rvec, tvec, useExtrinsicGuess ? 1 : 0, iterationsCount, + reprojectionError, minInliersCount, inliersVec.CvPtr, (int)flags); + inliers = inliersVec.ToArray(); + } + } + #endregion + #region InitCameraMatrix2D + /// + /// initializes camera matrix from a few 3D points and the corresponding projections. + /// + /// Vector of vectors (vector<vector<Point3d>>) of the calibration pattern points in the calibration pattern coordinate space. In the old interface all the per-view vectors are concatenated. + /// Vector of vectors (vector<vector<Point2d>>) of the projections of the calibration pattern points. In the old interface all the per-view vectors are concatenated. + /// Image size in pixels used to initialize the principal point. + /// If it is zero or negative, both f_x and f_y are estimated independently. Otherwise, f_x = f_y * aspectRatio . + /// + public static Mat InitCameraMatrix2D( + IEnumerable objectPoints, + IEnumerable imagePoints, + Size imageSize, + double aspectRatio = 1.0) + { + if (objectPoints == null) + throw new ArgumentNullException("objectPoints"); + if (imagePoints == null) + throw new ArgumentNullException("imagePoints"); + + IntPtr[] objectPointsPtrs = EnumerableEx.SelectPtrs(objectPoints); + IntPtr[] imagePointsPtrs = EnumerableEx.SelectPtrs(imagePoints); + + IntPtr matPtr = NativeMethods.calib3d_initCameraMatrix2D_Mat(objectPointsPtrs, objectPointsPtrs.Length, + imagePointsPtrs, imagePointsPtrs.Length, imageSize, aspectRatio); + return new Mat(matPtr); + } + /// + /// initializes camera matrix from a few 3D points and the corresponding projections. + /// + /// Vector of vectors of the calibration pattern points in the calibration pattern coordinate space. In the old interface all the per-view vectors are concatenated. + /// Vector of vectors of the projections of the calibration pattern points. In the old interface all the per-view vectors are concatenated. + /// Image size in pixels used to initialize the principal point. + /// If it is zero or negative, both f_x and f_y are estimated independently. Otherwise, f_x = f_y * aspectRatio . + /// + public static Mat InitCameraMatrix2D( + IEnumerable> objectPoints, + IEnumerable> imagePoints, + Size imageSize, + double aspectRatio = 1.0) + { + if (objectPoints == null) + throw new ArgumentNullException("objectPoints"); + if (imagePoints == null) + throw new ArgumentNullException("imagePoints"); + + using (var opArray = new ArrayAddress2(objectPoints)) + using (var ipArray = new ArrayAddress2(imagePoints)) + { + IntPtr matPtr = NativeMethods.calib3d_initCameraMatrix2D_array( + opArray, opArray.Dim1Length, opArray.Dim2Lengths, + ipArray, ipArray.Dim1Length, ipArray.Dim2Lengths, + imageSize, aspectRatio); + return new Mat(matPtr); + } + } + #endregion + #region FindChessboardCorners + /// + /// Finds the positions of internal corners of the chessboard. + /// + /// Source chessboard view. It must be an 8-bit grayscale or color image. + /// Number of inner corners per a chessboard row and column + /// ( patternSize = Size(points_per_row,points_per_colum) = Size(columns, rows) ). + /// Output array of detected corners. + /// Various operation flags that can be zero or a combination of the ChessboardFlag values + /// The function returns true if all of the corners are found and they are placed in a certain order (row by row, left to right in every row). + /// Otherwise, if the function fails to find all the corners or reorder them, it returns false. + public static bool FindChessboardCorners( + InputArray image, + Size patternSize, + OutputArray corners, + ChessboardFlags flags = ChessboardFlags.AdaptiveThresh | ChessboardFlags.NormalizeImage) + { + if (image == null) + throw new ArgumentNullException("image"); + if (corners == null) + throw new ArgumentNullException("corners"); + image.ThrowIfDisposed(); + corners.ThrowIfNotReady(); + + int ret = NativeMethods.calib3d_findChessboardCorners_InputArray( + image.CvPtr, patternSize, corners.CvPtr, (int)flags); + corners.Fix(); + return ret != 0; + } + /// + /// Finds the positions of internal corners of the chessboard. + /// + /// Source chessboard view. It must be an 8-bit grayscale or color image. + /// Number of inner corners per a chessboard row and column + /// ( patternSize = Size(points_per_row,points_per_colum) = Size(columns, rows) ). + /// Output array of detected corners. + /// Various operation flags that can be zero or a combination of the ChessboardFlag values + /// The function returns true if all of the corners are found and they are placed in a certain order (row by row, left to right in every row). + /// Otherwise, if the function fails to find all the corners or reorder them, it returns false. + public static bool FindChessboardCorners( + InputArray image, + Size patternSize, + out Point2f[] corners, + ChessboardFlags flags = ChessboardFlags.AdaptiveThresh | ChessboardFlags.NormalizeImage) + { + if (image == null) + throw new ArgumentNullException("image"); + image.ThrowIfDisposed(); + + using (var cornersVec = new VectorOfPoint2f()) + { + int ret = NativeMethods.calib3d_findChessboardCorners_vector( + image.CvPtr, patternSize, cornersVec.CvPtr, (int)flags); + corners = cornersVec.ToArray(); + return ret != 0; + } + } + #endregion + #region Find4QuadCornerSubpix + /// + /// finds subpixel-accurate positions of the chessboard corners + /// + /// + /// + /// + /// + public static bool Find4QuadCornerSubpix(InputArray img, InputOutputArray corners, Size regionSize) + { + if (img == null) + throw new ArgumentNullException("img"); + if (corners == null) + throw new ArgumentNullException("corners"); + img.ThrowIfDisposed(); + corners.ThrowIfNotReady(); + + int ret = NativeMethods.calib3d_find4QuadCornerSubpix_InputArray( + img.CvPtr, corners.CvPtr, regionSize); + corners.Fix(); + return ret != 0; + } + /// + /// finds subpixel-accurate positions of the chessboard corners + /// + /// + /// + /// + /// + public static bool Find4QuadCornerSubpix(InputArray img, [In, Out] Point2f[] corners, Size regionSize) + { + if (img == null) + throw new ArgumentNullException("img"); + if (corners == null) + throw new ArgumentNullException("corners"); + img.ThrowIfDisposed(); + + using (var cornersVec = new VectorOfPoint2f(corners)) + { + int ret = NativeMethods.calib3d_find4QuadCornerSubpix_vector( + img.CvPtr, cornersVec.CvPtr, regionSize); + + Point2f[] newCorners = cornersVec.ToArray(); + for (int i = 0; i < corners.Length; i++) + { + corners[i] = newCorners[i]; + } + + return ret != 0; + } + } + #endregion + #region DrawChessboardCorners + /// + /// Renders the detected chessboard corners. + /// + /// Destination image. It must be an 8-bit color image. + /// Number of inner corners per a chessboard row and column (patternSize = cv::Size(points_per_row,points_per_column)). + /// Array of detected corners, the output of findChessboardCorners. + /// Parameter indicating whether the complete board was found or not. The return value of findChessboardCorners() should be passed here. + public static void DrawChessboardCorners(InputOutputArray image, Size patternSize, + InputArray corners, bool patternWasFound) + { + if (image == null) + throw new ArgumentNullException("image"); + if (corners == null) + throw new ArgumentNullException("corners"); + image.ThrowIfNotReady(); + corners.ThrowIfDisposed(); + + NativeMethods.calib3d_drawChessboardCorners_InputArray( + image.CvPtr, patternSize, corners.CvPtr, patternWasFound ? 1 : 0); + image.Fix(); + } + /// + /// Renders the detected chessboard corners. + /// + /// Destination image. It must be an 8-bit color image. + /// Number of inner corners per a chessboard row and column (patternSize = cv::Size(points_per_row,points_per_column)). + /// Array of detected corners, the output of findChessboardCorners. + /// Parameter indicating whether the complete board was found or not. The return value of findChessboardCorners() should be passed here. + public static void DrawChessboardCorners(InputOutputArray image, Size patternSize, + IEnumerable corners, bool patternWasFound) + { + if (image == null) + throw new ArgumentNullException("image"); + if (corners == null) + throw new ArgumentNullException("corners"); + image.ThrowIfNotReady(); + + Point2f[] cornersArray = EnumerableEx.ToArray(corners); + NativeMethods.calib3d_drawChessboardCorners_array( + image.CvPtr, patternSize, cornersArray, cornersArray.Length, + patternWasFound ? 1 : 0); + image.Fix(); + } + #endregion + #region FindCirclesGrid + /// + /// Finds centers in the grid of circles. + /// + /// grid view of input circles; it must be an 8-bit grayscale or color image. + /// number of circles per row and column ( patternSize = Size(points_per_row, points_per_colum) ). + /// output array of detected centers. + /// various operation flags that can be one of the FindCirclesGridFlag values + /// feature detector that finds blobs like dark circles on light background. + /// + public static bool FindCirclesGrid( + InputArray image, + Size patternSize, + OutputArray centers, + FindCirclesGridFlags flags = FindCirclesGridFlags.SymmetricGrid, + FeatureDetector blobDetector = null) + { + if (image == null) + throw new ArgumentNullException("image"); + if (centers == null) + throw new ArgumentNullException("centers"); + image.ThrowIfDisposed(); + centers.ThrowIfNotReady(); + + int ret = NativeMethods.calib3d_findCirclesGrid_InputArray( + image.CvPtr, patternSize, centers.CvPtr, (int)flags, ToPtr(blobDetector)); + centers.Fix(); + return ret != 0; + } + /// + /// Finds centers in the grid of circles. + /// + /// grid view of input circles; it must be an 8-bit grayscale or color image. + /// number of circles per row and column ( patternSize = Size(points_per_row, points_per_colum) ). + /// output array of detected centers. + /// various operation flags that can be one of the FindCirclesGridFlag values + /// feature detector that finds blobs like dark circles on light background. + /// + public static bool FindCirclesGrid( + InputArray image, + Size patternSize, + out Point2f[] centers, + FindCirclesGridFlags flags = FindCirclesGridFlags.SymmetricGrid, + FeatureDetector blobDetector = null) + { + if (image == null) + throw new ArgumentNullException("image"); + image.ThrowIfDisposed(); + + using (var centersVec = new VectorOfPoint2f()) + { + int ret = NativeMethods.calib3d_findCirclesGrid_vector( + image.CvPtr, patternSize, centersVec.CvPtr, (int)flags, ToPtr(blobDetector)); + centers = centersVec.ToArray(); + return ret != 0; + } + } + #endregion + #region CalibrateCamera + /// + /// finds intrinsic and extrinsic camera parameters from several fews of a known calibration pattern. + /// + /// In the new interface it is a vector of vectors of calibration pattern points in the calibration pattern coordinate space. + /// The outer vector contains as many elements as the number of the pattern views. If the same calibration pattern is shown in each view and + /// it is fully visible, all the vectors will be the same. Although, it is possible to use partially occluded patterns, or even different patterns + /// in different views. Then, the vectors will be different. The points are 3D, but since they are in a pattern coordinate system, then, + /// if the rig is planar, it may make sense to put the model to a XY coordinate plane so that Z-coordinate of each input object point is 0. + /// In the old interface all the vectors of object points from different views are concatenated together. + /// In the new interface it is a vector of vectors of the projections of calibration pattern points. + /// imagePoints.Count() and objectPoints.Count() and imagePoints[i].Count() must be equal to objectPoints[i].Count() for each i. + /// Size of the image used only to initialize the intrinsic camera matrix. + /// Output 3x3 floating-point camera matrix. + /// If CV_CALIB_USE_INTRINSIC_GUESS and/or CV_CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be + /// initialized before calling the function. + /// Output vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. + /// Output vector of rotation vectors (see Rodrigues() ) estimated for each pattern view. That is, each k-th rotation vector + /// together with the corresponding k-th translation vector (see the next output parameter description) brings the calibration pattern + /// from the model coordinate space (in which object points are specified) to the world coordinate space, that is, a real position of the + /// calibration pattern in the k-th pattern view (k=0.. M -1) + /// Output vector of translation vectors estimated for each pattern view. + /// Different flags that may be zero or a combination of the CalibrationFlag values + /// Termination criteria for the iterative optimization algorithm. + /// + public static double CalibrateCamera( + IEnumerable objectPoints, + IEnumerable imagePoints, + Size imageSize, + InputOutputArray cameraMatrix, + InputOutputArray distCoeffs, + out Mat[] rvecs, + out Mat[] tvecs, + CalibrationFlags flags = CalibrationFlags.None, + TermCriteria? criteria = null) + { + if (objectPoints == null) + throw new ArgumentNullException("objectPoints"); + if (objectPoints == null) + throw new ArgumentNullException("objectPoints"); + if (cameraMatrix == null) + throw new ArgumentNullException("cameraMatrix"); + if (distCoeffs == null) + throw new ArgumentNullException("distCoeffs"); + cameraMatrix.ThrowIfNotReady(); + distCoeffs.ThrowIfNotReady(); + + TermCriteria criteria0 = criteria.GetValueOrDefault( + new TermCriteria(CriteriaType.Count | CriteriaType.Eps, 30, Double.Epsilon)); + + IntPtr[] objectPointsPtrs = EnumerableEx.SelectPtrs(objectPoints); + IntPtr[] imagePointsPtrs = EnumerableEx.SelectPtrs(imagePoints); + + double ret; + using (var rvecsVec = new VectorOfMat()) + using (var tvecsVec = new VectorOfMat()) + { + ret = NativeMethods.calib3d_calibrateCamera_InputArray( + objectPointsPtrs, objectPointsPtrs.Length, + imagePointsPtrs, objectPointsPtrs.Length, + imageSize, cameraMatrix.CvPtr, distCoeffs.CvPtr, + rvecsVec.CvPtr, tvecsVec.CvPtr, (int)flags, criteria0); + rvecs = rvecsVec.ToArray(); + tvecs = tvecsVec.ToArray(); + } + + cameraMatrix.Fix(); + distCoeffs.Fix(); + return ret; + } + + /// + /// finds intrinsic and extrinsic camera parameters from several fews of a known calibration pattern. + /// + /// In the new interface it is a vector of vectors of calibration pattern points in the calibration pattern coordinate space. + /// The outer vector contains as many elements as the number of the pattern views. If the same calibration pattern is shown in each view and + /// it is fully visible, all the vectors will be the same. Although, it is possible to use partially occluded patterns, or even different patterns + /// in different views. Then, the vectors will be different. The points are 3D, but since they are in a pattern coordinate system, then, + /// if the rig is planar, it may make sense to put the model to a XY coordinate plane so that Z-coordinate of each input object point is 0. + /// In the old interface all the vectors of object points from different views are concatenated together. + /// In the new interface it is a vector of vectors of the projections of calibration pattern points. + /// imagePoints.Count() and objectPoints.Count() and imagePoints[i].Count() must be equal to objectPoints[i].Count() for each i. + /// Size of the image used only to initialize the intrinsic camera matrix. + /// Output 3x3 floating-point camera matrix. + /// If CV_CALIB_USE_INTRINSIC_GUESS and/or CV_CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be + /// initialized before calling the function. + /// Output vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. + /// Output vector of rotation vectors (see Rodrigues() ) estimated for each pattern view. That is, each k-th rotation vector + /// together with the corresponding k-th translation vector (see the next output parameter description) brings the calibration pattern + /// from the model coordinate space (in which object points are specified) to the world coordinate space, that is, a real position of the + /// calibration pattern in the k-th pattern view (k=0.. M -1) + /// Output vector of translation vectors estimated for each pattern view. + /// Different flags that may be zero or a combination of the CalibrationFlag values + /// Termination criteria for the iterative optimization algorithm. + /// + public static double CalibrateCamera( + IEnumerable> objectPoints, + IEnumerable> imagePoints, + Size imageSize, + double[,] cameraMatrix, + double[] distCoeffs, + out Vec3d[] rvecs, + out Vec3d[] tvecs, + CalibrationFlags flags = CalibrationFlags.None, + TermCriteria? criteria = null) + { + if (objectPoints == null) + throw new ArgumentNullException("objectPoints"); + if (objectPoints == null) + throw new ArgumentNullException("objectPoints"); + if (cameraMatrix == null) + throw new ArgumentNullException("cameraMatrix"); + if (distCoeffs == null) + throw new ArgumentNullException("distCoeffs"); + + TermCriteria criteria0 = criteria.GetValueOrDefault( + new TermCriteria(CriteriaType.Count | CriteriaType.Eps, 30, Double.Epsilon)); + + using (var op = new ArrayAddress2(objectPoints)) + using (var ip = new ArrayAddress2(imagePoints)) + using (var rvecsVec = new VectorOfMat()) + using (var tvecsVec = new VectorOfMat()) + { + double ret = NativeMethods.calib3d_calibrateCamera_vector( + op.Pointer, op.Dim1Length, op.Dim2Lengths, + ip.Pointer, ip.Dim1Length, ip.Dim2Lengths, + imageSize, cameraMatrix, distCoeffs, distCoeffs.Length, + rvecsVec.CvPtr, tvecsVec.CvPtr, (int)flags, criteria0); + Mat[] rvecsM = rvecsVec.ToArray(); + Mat[] tvecsM = tvecsVec.ToArray(); + rvecs = EnumerableEx.SelectToArray(rvecsM, m => m.Get(0)); + tvecs = EnumerableEx.SelectToArray(tvecsM, m => m.Get(0)); + return ret; + } + } + #endregion + #region CalibrationMatrixValues + /// + /// computes several useful camera characteristics from the camera matrix, camera frame resolution and the physical sensor size. + /// + /// Input camera matrix that can be estimated by calibrateCamera() or stereoCalibrate() . + /// Input image size in pixels. + /// Physical width of the sensor. + /// Physical height of the sensor. + /// Output field of view in degrees along the horizontal sensor axis. + /// Output field of view in degrees along the vertical sensor axis. + /// Focal length of the lens in mm. + /// Principal point in pixels. + /// fy / fx + public static void CalibrationMatrixValues( + InputArray cameraMatrix, Size imageSize, + double apertureWidth, double apertureHeight, + out double fovx, out double fovy, out double focalLength, + out Point2d principalPoint, out double aspectRatio) + { + if (cameraMatrix == null) + throw new ArgumentNullException("cameraMatrix"); + cameraMatrix.ThrowIfDisposed(); + + NativeMethods.calib3d_calibrationMatrixValues_InputArray(cameraMatrix.CvPtr, + imageSize, apertureWidth, apertureHeight, out fovx, out fovy, out focalLength, + out principalPoint, out aspectRatio); + } + /// + /// computes several useful camera characteristics from the camera matrix, camera frame resolution and the physical sensor size. + /// + /// Input camera matrix that can be estimated by calibrateCamera() or stereoCalibrate() . + /// Input image size in pixels. + /// Physical width of the sensor. + /// Physical height of the sensor. + /// Output field of view in degrees along the horizontal sensor axis. + /// Output field of view in degrees along the vertical sensor axis. + /// Focal length of the lens in mm. + /// Principal point in pixels. + /// fy / fx + public static void CalibrationMatrixValues( + double[,] cameraMatrix, Size imageSize, + double apertureWidth, double apertureHeight, + out double fovx, out double fovy, out double focalLength, + out Point2d principalPoint, out double aspectRatio) + { + if (cameraMatrix == null) + throw new ArgumentNullException("cameraMatrix"); + if (cameraMatrix.GetLength(0) != 3 || cameraMatrix.GetLength(1) != 3) + throw new ArgumentException("cameraMatrix must be 3x3"); + + NativeMethods.calib3d_calibrationMatrixValues_array(cameraMatrix, + imageSize, apertureWidth, apertureHeight, out fovx, out fovy, out focalLength, + out principalPoint, out aspectRatio); + } + #endregion + #region StereoCalibrate + + /// + /// finds intrinsic and extrinsic parameters of a stereo camera + /// + /// Vector of vectors of the calibration pattern points. + /// Vector of vectors of the projections of the calibration pattern points, observed by the first camera. + /// Vector of vectors of the projections of the calibration pattern points, observed by the second camera. + /// Input/output first camera matrix + /// Input/output vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. + /// The output vector length depends on the flags. + /// Input/output second camera matrix. The parameter is similar to cameraMatrix1 . + /// Input/output lens distortion coefficients for the second camera. The parameter is similar to distCoeffs1 . + /// Size of the image used only to initialize intrinsic camera matrix. + /// Output rotation matrix between the 1st and the 2nd camera coordinate systems. + /// Output translation vector between the coordinate systems of the cameras. + /// Output essential matrix. + /// Output fundamental matrix. + /// Termination criteria for the iterative optimization algorithm. + /// Different flags that may be zero or a combination of the CalibrationFlag values + /// + public static double StereoCalibrate(IEnumerable objectPoints, + IEnumerable imagePoints1, + IEnumerable imagePoints2, + InputOutputArray cameraMatrix1, InputOutputArray distCoeffs1, + InputOutputArray cameraMatrix2, InputOutputArray distCoeffs2, + Size imageSize, OutputArray R, + OutputArray T, OutputArray E, OutputArray F, + CalibrationFlags flags = CalibrationFlags.FixIntrinsic, + TermCriteria? criteria = null) + { + if (objectPoints == null) + throw new ArgumentNullException("objectPoints"); + if (imagePoints1 == null) + throw new ArgumentNullException("imagePoints1"); + if (imagePoints2 == null) + throw new ArgumentNullException("imagePoints2"); + if (cameraMatrix1 == null) + throw new ArgumentNullException("cameraMatrix1"); + if (distCoeffs1 == null) + throw new ArgumentNullException("distCoeffs1"); + if (cameraMatrix2 == null) + throw new ArgumentNullException("cameraMatrix2"); + if (distCoeffs2 == null) + throw new ArgumentNullException("distCoeffs2"); + cameraMatrix1.ThrowIfDisposed(); + distCoeffs1.ThrowIfDisposed(); + cameraMatrix2.ThrowIfDisposed(); + distCoeffs2.ThrowIfDisposed(); + cameraMatrix1.ThrowIfNotReady(); + cameraMatrix2.ThrowIfNotReady(); + distCoeffs1.ThrowIfNotReady(); + distCoeffs2.ThrowIfNotReady(); + + IntPtr[] opPtrs = EnumerableEx.SelectPtrs(objectPoints); + IntPtr[] ip1Ptrs = EnumerableEx.SelectPtrs(imagePoints1); + IntPtr[] ip2Ptrs = EnumerableEx.SelectPtrs(imagePoints2); + + TermCriteria criteria0 = criteria.GetValueOrDefault( + new TermCriteria(CriteriaType.Count | CriteriaType.Eps, 30, 1e-6)); + + double result = + NativeMethods.calib3d_stereoCalibrate_InputArray( + opPtrs, opPtrs.Length, + ip1Ptrs, ip1Ptrs.Length, ip2Ptrs, ip2Ptrs.Length, + cameraMatrix1.CvPtr, distCoeffs1.CvPtr, + cameraMatrix2.CvPtr, distCoeffs2.CvPtr, + imageSize, ToPtr(R), ToPtr(T), ToPtr(E), ToPtr(F), + (int)flags, criteria0); + + cameraMatrix1.Fix(); + distCoeffs1.Fix(); + cameraMatrix2.Fix(); + distCoeffs2.Fix(); + if (R != null) + R.Fix(); + if (T != null) + T.Fix(); + if (E != null) + E.Fix(); + if (F != null) + F.Fix(); + + return result; + } + + /// + /// finds intrinsic and extrinsic parameters of a stereo camera + /// + /// Vector of vectors of the calibration pattern points. + /// Vector of vectors of the projections of the calibration pattern points, observed by the first camera. + /// Vector of vectors of the projections of the calibration pattern points, observed by the second camera. + /// Input/output first camera matrix + /// Input/output vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. + /// The output vector length depends on the flags. + /// Input/output second camera matrix. The parameter is similar to cameraMatrix1 . + /// Input/output lens distortion coefficients for the second camera. The parameter is similar to distCoeffs1 . + /// Size of the image used only to initialize intrinsic camera matrix. + /// Output rotation matrix between the 1st and the 2nd camera coordinate systems. + /// Output translation vector between the coordinate systems of the cameras. + /// Output essential matrix. + /// Output fundamental matrix. + /// Termination criteria for the iterative optimization algorithm. + /// Different flags that may be zero or a combination of the CalibrationFlag values + /// + public static double StereoCalibrate(IEnumerable> objectPoints, + IEnumerable> imagePoints1, + IEnumerable> imagePoints2, + double[,] cameraMatrix1, double[] distCoeffs1, + double[,] cameraMatrix2, double[] distCoeffs2, + Size imageSize, OutputArray R, + OutputArray T, OutputArray E, OutputArray F, + CalibrationFlags flags = CalibrationFlags.FixIntrinsic, + TermCriteria? criteria = null) + { + if (objectPoints == null) + throw new ArgumentNullException("objectPoints"); + if (imagePoints1 == null) + throw new ArgumentNullException("imagePoints1"); + if (imagePoints2 == null) + throw new ArgumentNullException("imagePoints2"); + if (cameraMatrix1 == null) + throw new ArgumentNullException("cameraMatrix1"); + if (distCoeffs1 == null) + throw new ArgumentNullException("distCoeffs1"); + if (cameraMatrix2 == null) + throw new ArgumentNullException("cameraMatrix2"); + if (distCoeffs2 == null) + throw new ArgumentNullException("distCoeffs2"); + + TermCriteria criteria0 = criteria.GetValueOrDefault( + new TermCriteria(CriteriaType.Count | CriteriaType.Eps, 30, 1e-6)); + + using (var op = new ArrayAddress2(objectPoints)) + using (var ip1 = new ArrayAddress2(imagePoints1)) + using (var ip2 = new ArrayAddress2(imagePoints2)) + { + return NativeMethods.calib3d_stereoCalibrate_array( + op.Pointer, op.Dim1Length, op.Dim2Lengths, + ip1.Pointer, ip1.Dim1Length, ip1.Dim2Lengths, + ip2.Pointer, ip2.Dim1Length, ip2.Dim2Lengths, + cameraMatrix1, distCoeffs1, distCoeffs1.Length, + cameraMatrix2, distCoeffs2, distCoeffs2.Length, + imageSize, ToPtr(R), ToPtr(T), ToPtr(E), ToPtr(F), + (int)flags, criteria0); + } + } + + #endregion + #region StereoRectify + + /// + /// computes the rectification transformation for a stereo camera from its intrinsic and extrinsic parameters + /// + /// First camera matrix. + /// First camera distortion parameters. + /// Second camera matrix. + /// Second camera distortion parameters. + /// Size of the image used for stereo calibration. + /// Rotation matrix between the coordinate systems of the first and the second cameras. + /// Translation vector between coordinate systems of the cameras. + /// Output 3x3 rectification transform (rotation matrix) for the first camera. + /// Output 3x3 rectification transform (rotation matrix) for the second camera. + /// Output 3x4 projection matrix in the new (rectified) coordinate systems for the first camera. + /// Output 3x4 projection matrix in the new (rectified) coordinate systems for the second camera. + /// Output 4x4 disparity-to-depth mapping matrix (see reprojectImageTo3D() ). + /// Operation flags that may be zero or CV_CALIB_ZERO_DISPARITY. + /// If the flag is set, the function makes the principal points of each camera have the same pixel coordinates in the rectified views. + /// And if the flag is not set, the function may still shift the images in the horizontal or vertical direction (depending on the orientation of epipolar lines) to maximize the useful image area. + /// Free scaling parameter. + /// If it is -1 or absent, the function performs the default scaling. Otherwise, the parameter should be between 0 and 1. + /// alpha=0 means that the rectified images are zoomed and shifted so that only valid pixels are visible (no black areas after rectification). + /// alpha=1 means that the rectified image is decimated and shifted so that all the pixels from the original images from the cameras are retained + /// in the rectified images (no source image pixels are lost). Obviously, any intermediate value yields an intermediate result between those two extreme cases. + /// New image resolution after rectification. The same size should be passed to initUndistortRectifyMap(). When (0,0) is passed (default), it is set to the original imageSize . + /// Setting it to larger value can help you preserve details in the original image, especially when there is a big radial distortion. + public static void StereoRectify(InputArray cameraMatrix1, InputArray distCoeffs1, + InputArray cameraMatrix2, InputArray distCoeffs2, + Size imageSize, InputArray R, InputArray T, + OutputArray R1, OutputArray R2, + OutputArray P1, OutputArray P2, + OutputArray Q, + StereoRectificationFlags flags = StereoRectificationFlags.ZeroDisparity, + double alpha = -1, Size? newImageSize = null) + { + Size newImageSize0 = newImageSize.GetValueOrDefault(new Size(0, 0)); + Rect validPixROI1, validPixROI2; + StereoRectify(cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, + imageSize, R, T, R1, R2, P1, P2, Q, flags, alpha, newImageSize0, + out validPixROI1, out validPixROI2); + } + /// + /// computes the rectification transformation for a stereo camera from its intrinsic and extrinsic parameters + /// + /// First camera matrix. + /// First camera distortion parameters. + /// Second camera matrix. + /// Second camera distortion parameters. + /// Size of the image used for stereo calibration. + /// Rotation matrix between the coordinate systems of the first and the second cameras. + /// Translation vector between coordinate systems of the cameras. + /// Output 3x3 rectification transform (rotation matrix) for the first camera. + /// Output 3x3 rectification transform (rotation matrix) for the second camera. + /// Output 3x4 projection matrix in the new (rectified) coordinate systems for the first camera. + /// Output 3x4 projection matrix in the new (rectified) coordinate systems for the second camera. + /// Output 4x4 disparity-to-depth mapping matrix (see reprojectImageTo3D() ). + /// Operation flags that may be zero or CV_CALIB_ZERO_DISPARITY. + /// If the flag is set, the function makes the principal points of each camera have the same pixel coordinates in the rectified views. + /// And if the flag is not set, the function may still shift the images in the horizontal or vertical direction (depending on the orientation of epipolar lines) to maximize the useful image area. + /// Free scaling parameter. + /// If it is -1 or absent, the function performs the default scaling. Otherwise, the parameter should be between 0 and 1. + /// alpha=0 means that the rectified images are zoomed and shifted so that only valid pixels are visible (no black areas after rectification). + /// alpha=1 means that the rectified image is decimated and shifted so that all the pixels from the original images from the cameras are retained + /// in the rectified images (no source image pixels are lost). Obviously, any intermediate value yields an intermediate result between those two extreme cases. + /// New image resolution after rectification. The same size should be passed to initUndistortRectifyMap(). When (0,0) is passed (default), it is set to the original imageSize . + /// Setting it to larger value can help you preserve details in the original image, especially when there is a big radial distortion. + /// Optional output rectangles inside the rectified images where all the pixels are valid. If alpha=0 , the ROIs cover the whole images. + /// Otherwise, they are likely to be smaller. + /// Optional output rectangles inside the rectified images where all the pixels are valid. If alpha=0 , the ROIs cover the whole images. + /// Otherwise, they are likely to be smaller. + public static void StereoRectify(InputArray cameraMatrix1, InputArray distCoeffs1, + InputArray cameraMatrix2, InputArray distCoeffs2, + Size imageSize, InputArray R, InputArray T, + OutputArray R1, OutputArray R2, + OutputArray P1, OutputArray P2, + OutputArray Q, StereoRectificationFlags flags, + double alpha, Size newImageSize, + out Rect validPixROI1, out Rect validPixROI2) + { + if (cameraMatrix1 == null) + throw new ArgumentNullException("cameraMatrix1"); + if (distCoeffs1 == null) + throw new ArgumentNullException("distCoeffs1"); + if (cameraMatrix2 == null) + throw new ArgumentNullException("cameraMatrix2"); + if (distCoeffs2 == null) + throw new ArgumentNullException("distCoeffs2"); + if (R == null) + throw new ArgumentNullException("R"); + if (T == null) + throw new ArgumentNullException("T"); + if (R1 == null) + throw new ArgumentNullException("R1"); + if (R2 == null) + throw new ArgumentNullException("R2"); + if (P1 == null) + throw new ArgumentNullException("P1"); + if (P2 == null) + throw new ArgumentNullException("P2"); + if (Q == null) + throw new ArgumentNullException("Q"); + cameraMatrix1.ThrowIfDisposed(); + distCoeffs1.ThrowIfDisposed(); + cameraMatrix2.ThrowIfDisposed(); + distCoeffs2.ThrowIfDisposed(); + R.ThrowIfDisposed(); + T.ThrowIfDisposed(); + R1.ThrowIfNotReady(); + R2.ThrowIfNotReady(); + P1.ThrowIfNotReady(); + P2.ThrowIfNotReady(); + Q.ThrowIfNotReady(); + + NativeMethods.calib3d_stereoRectify_InputArray( + cameraMatrix1.CvPtr, distCoeffs1.CvPtr, + cameraMatrix2.CvPtr, distCoeffs2.CvPtr, + imageSize, R.CvPtr, T.CvPtr, + R1.CvPtr, R2.CvPtr, P1.CvPtr, P2.CvPtr, Q.CvPtr, + (int)flags, alpha, newImageSize, out validPixROI1, out validPixROI2); + + R1.Fix(); + R2.Fix(); + P1.Fix(); + P2.Fix(); + Q.Fix(); + } + + + /// + /// computes the rectification transformation for a stereo camera from its intrinsic and extrinsic parameters + /// + /// First camera matrix. + /// First camera distortion parameters. + /// Second camera matrix. + /// Second camera distortion parameters. + /// Size of the image used for stereo calibration. + /// Rotation matrix between the coordinate systems of the first and the second cameras. + /// Translation vector between coordinate systems of the cameras. + /// Output 3x3 rectification transform (rotation matrix) for the first camera. + /// Output 3x3 rectification transform (rotation matrix) for the second camera. + /// Output 3x4 projection matrix in the new (rectified) coordinate systems for the first camera. + /// Output 3x4 projection matrix in the new (rectified) coordinate systems for the second camera. + /// Output 4x4 disparity-to-depth mapping matrix (see reprojectImageTo3D() ). + /// Operation flags that may be zero or CV_CALIB_ZERO_DISPARITY. + /// If the flag is set, the function makes the principal points of each camera have the same pixel coordinates in the rectified views. + /// And if the flag is not set, the function may still shift the images in the horizontal or vertical direction (depending on the orientation of epipolar lines) to maximize the useful image area. + /// Free scaling parameter. + /// If it is -1 or absent, the function performs the default scaling. Otherwise, the parameter should be between 0 and 1. + /// alpha=0 means that the rectified images are zoomed and shifted so that only valid pixels are visible (no black areas after rectification). + /// alpha=1 means that the rectified image is decimated and shifted so that all the pixels from the original images from the cameras are retained + /// in the rectified images (no source image pixels are lost). Obviously, any intermediate value yields an intermediate result between those two extreme cases. + /// New image resolution after rectification. The same size should be passed to initUndistortRectifyMap(). When (0,0) is passed (default), it is set to the original imageSize . + /// Setting it to larger value can help you preserve details in the original image, especially when there is a big radial distortion. + public static void StereoRectify(double[,] cameraMatrix1, double[] distCoeffs1, + double[,] cameraMatrix2, double[] distCoeffs2, + Size imageSize, double[,] R, double[] T, + out double[,] R1, out double[,] R2, + out double[,] P1, out double[,] P2, + out double[,] Q, + StereoRectificationFlags flags = StereoRectificationFlags.ZeroDisparity, + double alpha = -1, Size? newImageSize = null) + { + Size newImageSize0 = newImageSize.GetValueOrDefault(new Size(0, 0)); + Rect validPixROI1, validPixROI2; + StereoRectify( + cameraMatrix1, distCoeffs1, + cameraMatrix2, distCoeffs2, + imageSize, R, T, + out R1, out R2, out P1, out P2, out Q, + flags, alpha, newImageSize0, out validPixROI1, out validPixROI2); + } + + /// + /// computes the rectification transformation for a stereo camera from its intrinsic and extrinsic parameters + /// + /// First camera matrix. + /// First camera distortion parameters. + /// Second camera matrix. + /// Second camera distortion parameters. + /// Size of the image used for stereo calibration. + /// Rotation matrix between the coordinate systems of the first and the second cameras. + /// Translation vector between coordinate systems of the cameras. + /// Output 3x3 rectification transform (rotation matrix) for the first camera. + /// Output 3x3 rectification transform (rotation matrix) for the second camera. + /// Output 3x4 projection matrix in the new (rectified) coordinate systems for the first camera. + /// Output 3x4 projection matrix in the new (rectified) coordinate systems for the second camera. + /// Output 4x4 disparity-to-depth mapping matrix (see reprojectImageTo3D() ). + /// Operation flags that may be zero or CV_CALIB_ZERO_DISPARITY. + /// If the flag is set, the function makes the principal points of each camera have the same pixel coordinates in the rectified views. + /// And if the flag is not set, the function may still shift the images in the horizontal or vertical direction (depending on the orientation of epipolar lines) to maximize the useful image area. + /// Free scaling parameter. + /// If it is -1 or absent, the function performs the default scaling. Otherwise, the parameter should be between 0 and 1. + /// alpha=0 means that the rectified images are zoomed and shifted so that only valid pixels are visible (no black areas after rectification). + /// alpha=1 means that the rectified image is decimated and shifted so that all the pixels from the original images from the cameras are retained + /// in the rectified images (no source image pixels are lost). Obviously, any intermediate value yields an intermediate result between those two extreme cases. + /// New image resolution after rectification. The same size should be passed to initUndistortRectifyMap(). When (0,0) is passed (default), it is set to the original imageSize . + /// Setting it to larger value can help you preserve details in the original image, especially when there is a big radial distortion. + /// Optional output rectangles inside the rectified images where all the pixels are valid. If alpha=0 , the ROIs cover the whole images. + /// Otherwise, they are likely to be smaller. + /// Optional output rectangles inside the rectified images where all the pixels are valid. If alpha=0 , the ROIs cover the whole images. + /// Otherwise, they are likely to be smaller. + public static void StereoRectify(double[,] cameraMatrix1, double[] distCoeffs1, + double[,] cameraMatrix2, double[] distCoeffs2, + Size imageSize, double[,] R, double[] T, + out double[,] R1, out double[,] R2, + out double[,] P1, out double[,] P2, + out double[,] Q, StereoRectificationFlags flags, + double alpha, Size newImageSize, + out Rect validPixROI1, out Rect validPixROI2) + { + if (cameraMatrix1 == null) + throw new ArgumentNullException("cameraMatrix1"); + if (distCoeffs1 == null) + throw new ArgumentNullException("distCoeffs1"); + if (cameraMatrix2 == null) + throw new ArgumentNullException("cameraMatrix2"); + if (distCoeffs2 == null) + throw new ArgumentNullException("distCoeffs2"); + if (R == null) + throw new ArgumentNullException("R"); + if (T == null) + throw new ArgumentNullException("T"); + + R1 = new double[3, 3]; + R2 = new double[3, 3]; + P1 = new double[3, 4]; + P2 = new double[3, 4]; + Q = new double[4, 4]; + NativeMethods.calib3d_stereoRectify_array( + cameraMatrix1, distCoeffs1, distCoeffs1.Length, + cameraMatrix2, distCoeffs2, distCoeffs2.Length, + imageSize, R, T, + R1, R2, P1, P2, Q, + (int)flags, alpha, newImageSize, out validPixROI1, out validPixROI2); + } + + + #endregion + #region StereoRectifyUncalibrated + + /// + /// computes the rectification transformation for an uncalibrated stereo camera (zero distortion is assumed) + /// + /// Array of feature points in the first image. + /// The corresponding points in the second image. + /// The same formats as in findFundamentalMat() are supported. + /// Input fundamental matrix. It can be computed from the same set + /// of point pairs using findFundamentalMat() . + /// Size of the image. + /// Output rectification homography matrix for the first image. + /// Output rectification homography matrix for the second image. + /// Optional threshold used to filter out the outliers. + /// If the parameter is greater than zero, all the point pairs that do not comply + /// with the epipolar geometry (that is, the points for which |points2[i]^T * F * points1[i]| > threshold ) + /// are rejected prior to computing the homographies. Otherwise, all the points are considered inliers. + /// + public static bool StereoRectifyUncalibrated(InputArray points1, InputArray points2, + InputArray F, Size imgSize, + OutputArray H1, OutputArray H2, + double threshold = 5) + { + if (points1 == null) + throw new ArgumentNullException("points1"); + if (points2 == null) + throw new ArgumentNullException("points2"); + if (F == null) + throw new ArgumentNullException("F"); + if (H1 == null) + throw new ArgumentNullException("H1"); + if (H2 == null) + throw new ArgumentNullException("H2"); + points1.ThrowIfDisposed(); + points2.ThrowIfDisposed(); + F.ThrowIfDisposed(); + H1.ThrowIfNotReady(); + H2.ThrowIfNotReady(); + + int ret = NativeMethods.calib3d_stereoRectifyUncalibrated_InputArray( + points1.CvPtr, points2.CvPtr, F.CvPtr, imgSize, H1.CvPtr, H2.CvPtr, threshold); + H1.Fix(); + H2.Fix(); + return ret != 0; + } + + /// + /// computes the rectification transformation for an uncalibrated stereo camera (zero distortion is assumed) + /// + /// Array of feature points in the first image. + /// The corresponding points in the second image. + /// The same formats as in findFundamentalMat() are supported. + /// Input fundamental matrix. It can be computed from the same set + /// of point pairs using findFundamentalMat() . + /// Size of the image. + /// Output rectification homography matrix for the first image. + /// Output rectification homography matrix for the second image. + /// Optional threshold used to filter out the outliers. + /// If the parameter is greater than zero, all the point pairs that do not comply + /// with the epipolar geometry (that is, the points for which |points2[i]^T * F * points1[i]| > threshold ) + /// are rejected prior to computing the homographies. Otherwise, all the points are considered inliers. + /// + public static bool StereoRectifyUncalibrated(IEnumerable points1, + IEnumerable points2, + double[,] F, Size imgSize, + out double[,] H1, out double[,] H2, + double threshold = 5 + ) + { + if (points1 == null) + throw new ArgumentNullException("points1"); + if (points2 == null) + throw new ArgumentNullException("points2"); + if (F == null) + throw new ArgumentNullException("F"); + if (F.GetLength(0) != 3 || F.GetLength(1) != 3) + throw new ArgumentException("F != double[3,3]"); + + Point2d[] points1Array = EnumerableEx.ToArray(points1); + Point2d[] points2Array = EnumerableEx.ToArray(points2); + + H1 = new double[3, 3]; + H2 = new double[3, 3]; + + int ret = NativeMethods.calib3d_stereoRectifyUncalibrated_array( + points1Array, points1Array.Length, + points2Array, points2Array.Length, + F, imgSize, H1, H2, threshold); + return ret != 0; + } + + #endregion + #region Rectify3Collinear + /// + /// computes the rectification transformations for 3-head camera, where all the heads are on the same line. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static float Rectify3Collinear(InputArray cameraMatrix1, InputArray distCoeffs1, + InputArray cameraMatrix2, InputArray distCoeffs2, + InputArray cameraMatrix3, InputArray distCoeffs3, + IEnumerable imgpt1, IEnumerable imgpt3, + Size imageSize, InputArray R12, InputArray T12, + InputArray R13, InputArray T13, + OutputArray R1, OutputArray R2, OutputArray R3, + OutputArray P1, OutputArray P2, OutputArray P3, + OutputArray Q, double alpha, Size newImgSize, + out Rect roi1, out Rect roi2, StereoRectificationFlags flags) + { + if (cameraMatrix1 == null) + throw new ArgumentNullException("cameraMatrix1"); + if (distCoeffs1 == null) + throw new ArgumentNullException("distCoeffs1"); + if (cameraMatrix2 == null) + throw new ArgumentNullException("cameraMatrix2"); + if (distCoeffs2 == null) + throw new ArgumentNullException("distCoeffs2"); + if (cameraMatrix3 == null) + throw new ArgumentNullException("cameraMatrix3"); + if (distCoeffs3 == null) + throw new ArgumentNullException("distCoeffs3"); + if (imgpt1 == null) + throw new ArgumentNullException("imgpt1"); + if (imgpt3 == null) + throw new ArgumentNullException("imgpt3"); + if (R12 == null) + throw new ArgumentNullException("R12"); + if (T12 == null) + throw new ArgumentNullException("T12"); + if (R13 == null) + throw new ArgumentNullException("R13"); + if (T13 == null) + throw new ArgumentNullException("T13"); + if (R1 == null) + throw new ArgumentNullException("R1"); + if (R2 == null) + throw new ArgumentNullException("R2"); + if (R3 == null) + throw new ArgumentNullException("R3"); + if (P1 == null) + throw new ArgumentNullException("P1"); + if (P2 == null) + throw new ArgumentNullException("P2"); + if (P3 == null) + throw new ArgumentNullException("P3"); + if (Q == null) + throw new ArgumentNullException("Q"); + cameraMatrix1.ThrowIfDisposed(); + distCoeffs1.ThrowIfDisposed(); + cameraMatrix2.ThrowIfDisposed(); + distCoeffs2.ThrowIfDisposed(); + cameraMatrix3.ThrowIfDisposed(); + distCoeffs3.ThrowIfDisposed(); + R12.ThrowIfDisposed(); + T12.ThrowIfDisposed(); + R13.ThrowIfDisposed(); + T13.ThrowIfDisposed(); + R1.ThrowIfNotReady(); + R2.ThrowIfNotReady(); + R3.ThrowIfNotReady(); + P1.ThrowIfNotReady(); + P2.ThrowIfNotReady(); + P3.ThrowIfNotReady(); + Q.ThrowIfNotReady(); + + IntPtr[] imgpt1Ptrs = EnumerableEx.SelectPtrs(imgpt1); + IntPtr[] imgpt3Ptrs = EnumerableEx.SelectPtrs(imgpt3); + float ret = NativeMethods.calib3d_rectify3Collinear_InputArray( + cameraMatrix1.CvPtr, distCoeffs1.CvPtr, + cameraMatrix2.CvPtr, distCoeffs2.CvPtr, + cameraMatrix3.CvPtr, distCoeffs3.CvPtr, + imgpt1Ptrs, imgpt1Ptrs.Length, imgpt3Ptrs, imgpt3Ptrs.Length, + imageSize, R12.CvPtr, T12.CvPtr, R13.CvPtr, T13.CvPtr, + R1.CvPtr, R2.CvPtr, R3.CvPtr, P1.CvPtr, P2.CvPtr, P3.CvPtr, + Q.CvPtr, alpha, newImgSize, out roi1, out roi2, (int)flags); + R1.Fix(); + R2.Fix(); + R3.Fix(); + P1.Fix(); + P2.Fix(); + P3.Fix(); + Q.Fix(); + return ret; + } + #endregion + #region GetOptimalNewCameraMatrix + + /// + /// Returns the new camera matrix based on the free scaling parameter. + /// + /// Input camera matrix. + /// Input vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. + /// If the array is null, the zero distortion coefficients are assumed. + /// Original image size. + /// Free scaling parameter between 0 (when all the pixels in the undistorted image are valid) + /// and 1 (when all the source image pixels are retained in the undistorted image). + /// Image size after rectification. By default,it is set to imageSize . + /// Optional output rectangle that outlines all-good-pixels region in the undistorted image. See roi1, roi2 description in stereoRectify() . + /// Optional flag that indicates whether in the new camera matrix the principal point + /// should be at the image center or not. By default, the principal point is chosen to best fit a + /// subset of the source image (determined by alpha) to the corrected image. + /// optimal new camera matrix + public static Mat GetOptimalNewCameraMatrix(InputArray cameraMatrix, InputArray distCoeffs, + Size imageSize, double alpha, Size newImgSize, + out Rect validPixROI, bool centerPrincipalPoint = false) + { + if (cameraMatrix == null) + throw new ArgumentNullException(); + cameraMatrix.ThrowIfDisposed(); + + IntPtr mat = NativeMethods.calib3d_getOptimalNewCameraMatrix_InputArray( + cameraMatrix.CvPtr, ToPtr(distCoeffs), imageSize, alpha, newImgSize, + out validPixROI, centerPrincipalPoint ? 1 : 0); + return new Mat(mat); + } + /// + /// Returns the new camera matrix based on the free scaling parameter. + /// + /// Input camera matrix. + /// Input vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. + /// If the array is null, the zero distortion coefficients are assumed. + /// Original image size. + /// Free scaling parameter between 0 (when all the pixels in the undistorted image are valid) + /// and 1 (when all the source image pixels are retained in the undistorted image). + /// Image size after rectification. By default,it is set to imageSize . + /// Optional output rectangle that outlines all-good-pixels region in the undistorted image. See roi1, roi2 description in stereoRectify() . + /// Optional flag that indicates whether in the new camera matrix the principal point + /// should be at the image center or not. By default, the principal point is chosen to best fit a + /// subset of the source image (determined by alpha) to the corrected image. + /// optimal new camera matrix + public static double[,] GetOptimalNewCameraMatrix(double[,] cameraMatrix, double[] distCoeffs, + Size imageSize, double alpha, Size newImgSize, + out Rect validPixROI, bool centerPrincipalPoint = false) + { + if (cameraMatrix == null) + throw new ArgumentNullException(); + + var newCameraMatrix = new double[3, 3]; + NativeMethods.calib3d_getOptimalNewCameraMatrix_array( + cameraMatrix, distCoeffs, distCoeffs.Length, + imageSize, alpha, newImgSize, + out validPixROI, centerPrincipalPoint ? 1 : 0, + newCameraMatrix); + return newCameraMatrix; + } + #endregion + #region ConvertPointsHomogeneous + /// + /// converts point coordinates from normal pixel coordinates to homogeneous coordinates ((x,y)->(x,y,1)) + /// + /// Input vector of N-dimensional points. + /// Output vector of N+1-dimensional points. + public static void ConvertPointsToHomogeneous(InputArray src, OutputArray dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.calib3d_convertPointsToHomogeneous_InputArray(src.CvPtr, dst.CvPtr); + dst.Fix(); + } + /// + /// converts point coordinates from normal pixel coordinates to homogeneous coordinates ((x,y)->(x,y,1)) + /// + /// Input vector of N-dimensional points. + /// Output vector of N+1-dimensional points. + public static Vec3f[] ConvertPointsToHomogeneous(IEnumerable src) + { + if (src == null) + throw new ArgumentNullException("src"); + + Vec2f[] srcA = EnumerableEx.ToArray(src); + Vec3f[] dstA = new Vec3f[srcA.Length]; + NativeMethods.calib3d_convertPointsToHomogeneous_array1(srcA, dstA, srcA.Length); + return dstA; + } + /// + /// converts point coordinates from normal pixel coordinates to homogeneous coordinates ((x,y)->(x,y,1)) + /// + /// Input vector of N-dimensional points. + /// Output vector of N+1-dimensional points. + public static Vec4f[] ConvertPointsToHomogeneous(IEnumerable src) + { + if (src == null) + throw new ArgumentNullException("src"); + + Vec3f[] srcA = EnumerableEx.ToArray(src); + Vec4f[] dstA = new Vec4f[srcA.Length]; + NativeMethods.calib3d_convertPointsToHomogeneous_array2(srcA, dstA, srcA.Length); + return dstA; + } + + /// + /// converts point coordinates from homogeneous to normal pixel coordinates ((x,y,z)->(x/z, y/z)) + /// + /// Input vector of N-dimensional points. + /// Output vector of N-1-dimensional points. + public static void ConvertPointsFromHomogeneous(InputArray src, OutputArray dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.calib3d_convertPointsFromHomogeneous_InputArray(src.CvPtr, dst.CvPtr); + dst.Fix(); + } + /// + /// converts point coordinates from homogeneous to normal pixel coordinates ((x,y,z)->(x/z, y/z)) + /// + /// Input vector of N-dimensional points. + /// Output vector of N-1-dimensional points. + public static Vec2f[] ConvertPointsFromHomogeneous(IEnumerable src) + { + if (src == null) + throw new ArgumentNullException("src"); + + Vec3f[] srcA = EnumerableEx.ToArray(src); + Vec2f[] dstA = new Vec2f[srcA.Length]; + NativeMethods.calib3d_convertPointsFromHomogeneous_array1(srcA, dstA, srcA.Length); + return dstA; + } + /// + /// converts point coordinates from homogeneous to normal pixel coordinates ((x,y,z)->(x/z, y/z)) + /// + /// Input vector of N-dimensional points. + /// Output vector of N-1-dimensional points. + public static Vec3f[] ConvertPointsFromHomogeneous(IEnumerable src) + { + if (src == null) + throw new ArgumentNullException("src"); + + Vec4f[] srcA = EnumerableEx.ToArray(src); + Vec3f[] dstA = new Vec3f[srcA.Length]; + NativeMethods.calib3d_convertPointsFromHomogeneous_array2(srcA, dstA, srcA.Length); + return dstA; + } + + /// + /// Converts points to/from homogeneous coordinates. + /// + /// Input array or vector of 2D, 3D, or 4D points. + /// Output vector of 2D, 3D, or 4D points. + public static void ConvertPointsHomogeneous(InputArray src, OutputArray dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.calib3d_convertPointsHomogeneous(src.CvPtr, dst.CvPtr); + dst.Fix(); + } + #endregion + #region FindFundamentalMat + /// + /// Calculates a fundamental matrix from the corresponding points in two images. + /// + /// Array of N points from the first image. + /// The point coordinates should be floating-point (single or double precision). + /// Array of the second image points of the same size and format as points1 . + /// Method for computing a fundamental matrix. + /// Parameter used for RANSAC. + /// It is the maximum distance from a point to an epipolar line in pixels, beyond which the point is + /// considered an outlier and is not used for computing the final fundamental matrix. It can be set to + /// something like 1-3, depending on the accuracy of the point localization, image resolution, and the image noise. + /// Parameter used for the RANSAC or LMedS methods only. + /// It specifies a desirable level of confidence (probability) that the estimated matrix is correct. + /// Output array of N elements, every element of which is set to 0 for outliers and + /// to 1 for the other points. The array is computed only in the RANSAC and LMedS methods. For other methods, it is set to all 1’s. + /// fundamental matrix + public static Mat FindFundamentalMat( + InputArray points1, InputArray points2, + FundamentalMatMethod method = FundamentalMatMethod.Ransac, + double param1 = 3.0, double param2 = 0.99, + OutputArray mask = null) + { + if (points1 == null) + throw new ArgumentNullException("points1"); + if (points2 == null) + throw new ArgumentNullException("points2"); + points1.ThrowIfDisposed(); + points2.ThrowIfDisposed(); + + IntPtr mat = NativeMethods.calib3d_findFundamentalMat_InputArray( + points1.CvPtr, points2.CvPtr, (int)method, + param1, param2, ToPtr(mask)); + if (mask != null) + mask.Fix(); + return new Mat(mat); + } + /// + /// Calculates a fundamental matrix from the corresponding points in two images. + /// + /// Array of N points from the first image. + /// The point coordinates should be floating-point (single or double precision). + /// Array of the second image points of the same size and format as points1 . + /// Method for computing a fundamental matrix. + /// Parameter used for RANSAC. + /// It is the maximum distance from a point to an epipolar line in pixels, beyond which the point is + /// considered an outlier and is not used for computing the final fundamental matrix. It can be set to + /// something like 1-3, depending on the accuracy of the point localization, image resolution, and the image noise. + /// Parameter used for the RANSAC or LMedS methods only. + /// It specifies a desirable level of confidence (probability) that the estimated matrix is correct. + /// Output array of N elements, every element of which is set to 0 for outliers and + /// to 1 for the other points. The array is computed only in the RANSAC and LMedS methods. For other methods, it is set to all 1’s. + /// fundamental matrix + public static Mat FindFundamentalMat( + IEnumerable points1, IEnumerable points2, + FundamentalMatMethod method = FundamentalMatMethod.Ransac, + double param1 = 3.0, double param2 = 0.99, + OutputArray mask = null) + { + if (points1 == null) + throw new ArgumentNullException("points1"); + if (points2 == null) + throw new ArgumentNullException("points2"); + + Point2d[] points1Array = EnumerableEx.ToArray(points1); + Point2d[] points2Array = EnumerableEx.ToArray(points2); + + IntPtr mat = NativeMethods.calib3d_findFundamentalMat_array( + points1Array, points1Array.Length, + points2Array, points2Array.Length, (int)method, + param1, param2, ToPtr(mask)); + if (mask != null) + mask.Fix(); + return new Mat(mat); + } + #endregion + #region ComputeCorrespondEpilines + /// + /// For points in an image of a stereo pair, computes the corresponding epilines in the other image. + /// + /// Input points. N \times 1 or 1 x N matrix of type CV_32FC2 or CV_64FC2. + /// Index of the image (1 or 2) that contains the points . + /// Fundamental matrix that can be estimated using findFundamentalMat() or stereoRectify() . + /// Output vector of the epipolar lines corresponding to the points in the other image. + /// Each line ax + by + c=0 is encoded by 3 numbers (a, b, c) . + public static void ComputeCorrespondEpilines(InputArray points, + int whichImage, + InputArray F, + OutputArray lines) + { + if (points == null) + throw new ArgumentNullException("points"); + if (F == null) + throw new ArgumentNullException("F"); + if (lines == null) + throw new ArgumentNullException("lines"); + points.ThrowIfDisposed(); + F.ThrowIfDisposed(); + lines.ThrowIfNotReady(); + + NativeMethods.calib3d_computeCorrespondEpilines_InputArray( + points.CvPtr, whichImage, F.CvPtr, lines.CvPtr); + lines.Fix(); + } + /// + /// For points in an image of a stereo pair, computes the corresponding epilines in the other image. + /// + /// Input points. N \times 1 or 1 x N matrix of type CV_32FC2 or CV_64FC2. + /// Index of the image (1 or 2) that contains the points . + /// Fundamental matrix that can be estimated using findFundamentalMat() or stereoRectify() . + /// Output vector of the epipolar lines corresponding to the points in the other image. + /// Each line ax + by + c=0 is encoded by 3 numbers (a, b, c) . + public static Point3f[] ComputeCorrespondEpilines(IEnumerable points, + int whichImage, double[,] F) + { + if (points == null) + throw new ArgumentNullException("points"); + if (F == null) + throw new ArgumentNullException("F"); + if (F.GetLength(0) != 3 && F.GetLength(1) != 3) + throw new ArgumentException("F != double[3,3]"); + + Point2d[] pointsArray = EnumerableEx.ToArray(points); + Point3f[] lines = new Point3f[pointsArray.Length]; + + NativeMethods.calib3d_computeCorrespondEpilines_array2d( + pointsArray, pointsArray.Length, + whichImage, F, lines); + + return lines; + } + /// + /// For points in an image of a stereo pair, computes the corresponding epilines in the other image. + /// + /// Input points. N \times 1 or 1 x N matrix of type CV_32FC2 or CV_64FC2. + /// Index of the image (1 or 2) that contains the points . + /// Fundamental matrix that can be estimated using findFundamentalMat() or stereoRectify() . + /// Output vector of the epipolar lines corresponding to the points in the other image. + /// Each line ax + by + c=0 is encoded by 3 numbers (a, b, c) . + public static Point3f[] ComputeCorrespondEpilines(IEnumerable points, + int whichImage, double[,] F) + { + if (points == null) + throw new ArgumentNullException("points"); + if (F == null) + throw new ArgumentNullException("F"); + if (F.GetLength(0) != 3 && F.GetLength(1) != 3) + throw new ArgumentException("F != double[3,3]"); + + Point3d[] pointsArray = EnumerableEx.ToArray(points); + Point3f[] lines = new Point3f[pointsArray.Length]; + + NativeMethods.calib3d_computeCorrespondEpilines_array3d( + pointsArray, pointsArray.Length, + whichImage, F, lines); + + return lines; + } + #endregion + #region TriangulatePoints + /// + /// Reconstructs points by triangulation. + /// + /// 3x4 projection matrix of the first camera. + /// 3x4 projection matrix of the second camera. + /// 2xN array of feature points in the first image. In case of c++ version + /// it can be also a vector of feature points or two-channel matrix of size 1xN or Nx1. + /// 2xN array of corresponding points in the second image. In case of c++ version + /// it can be also a vector of feature points or two-channel matrix of size 1xN or Nx1. + /// 4xN array of reconstructed points in homogeneous coordinates. + public static void TriangulatePoints( + InputArray projMatr1, InputArray projMatr2, + InputArray projPoints1, InputArray projPoints2, + OutputArray points4D) + { + if (projMatr1 == null) + throw new ArgumentNullException("projMatr1"); + if (projMatr2 == null) + throw new ArgumentNullException("projMatr2"); + if (projPoints1 == null) + throw new ArgumentNullException("projPoints1"); + if (projPoints2 == null) + throw new ArgumentNullException("projPoints2"); + if (points4D == null) + throw new ArgumentNullException("points4D"); + projMatr1.ThrowIfDisposed(); + projMatr2.ThrowIfDisposed(); + projPoints1.ThrowIfDisposed(); + projPoints2.ThrowIfDisposed(); + points4D.ThrowIfNotReady(); + + NativeMethods.calib3d_triangulatePoints_InputArray( + projMatr1.CvPtr, projMatr2.CvPtr, + projPoints1.CvPtr, projPoints2.CvPtr, points4D.CvPtr); + + points4D.Fix(); + } + /// + /// Reconstructs points by triangulation. + /// + /// 3x4 projection matrix of the first camera. + /// 3x4 projection matrix of the second camera. + /// 2xN array of feature points in the first image. In case of c++ version + /// it can be also a vector of feature points or two-channel matrix of size 1xN or Nx1. + /// 2xN array of corresponding points in the second image. In case of c++ version + /// it can be also a vector of feature points or two-channel matrix of size 1xN or Nx1. + /// 4xN array of reconstructed points in homogeneous coordinates. + public static Vec4d[] TriangulatePoints( + double[,] projMatr1, double[,] projMatr2, + IEnumerable projPoints1, IEnumerable projPoints2) + { + if (projMatr1 == null) + throw new ArgumentNullException("projMatr1"); + if (projMatr2 == null) + throw new ArgumentNullException("projMatr2"); + if (projPoints1 == null) + throw new ArgumentNullException("projPoints1"); + if (projPoints2 == null) + throw new ArgumentNullException("projPoints2"); + if (projMatr1.GetLength(0) != 3 && projMatr1.GetLength(1) != 4) + throw new ArgumentException("projMatr1 != double[3,4]"); + if (projMatr2.GetLength(0) != 3 && projMatr2.GetLength(1) != 4) + throw new ArgumentException("projMatr2 != double[3,4]"); + + Point2d[] projPoints1Array = EnumerableEx.ToArray(projPoints1); + Point2d[] projPoints2Array = EnumerableEx.ToArray(projPoints2); + var points4D = new Vec4d[projPoints1Array.Length]; + + NativeMethods.calib3d_triangulatePoints_array( + projMatr1, projMatr2, + projPoints1Array, projPoints1Array.Length, + projPoints2Array, projPoints2Array.Length, + points4D); + + return points4D; + } + #endregion + #region CorrectMatches + /// + /// Refines coordinates of corresponding points. + /// + /// 3x3 fundamental matrix. + /// 1xN array containing the first set of points. + /// 1xN array containing the second set of points. + /// The optimized points1. + /// The optimized points2. + public static void CorrectMatches( + InputArray F, InputArray points1, InputArray points2, + OutputArray newPoints1, OutputArray newPoints2) + { + if (F == null) + throw new ArgumentNullException("F"); + if (points1 == null) + throw new ArgumentNullException("points1"); + if (points2 == null) + throw new ArgumentNullException("points2"); + if (newPoints1 == null) + throw new ArgumentNullException("newPoints1"); + if (newPoints2 == null) + throw new ArgumentNullException("newPoints2"); + F.ThrowIfDisposed(); + points1.ThrowIfDisposed(); + points2.ThrowIfDisposed(); + newPoints1.ThrowIfNotReady(); + newPoints2.ThrowIfNotReady(); + + NativeMethods.calib3d_correctMatches_InputArray( + F.CvPtr, points1.CvPtr, points2.CvPtr, + newPoints1.CvPtr, newPoints2.CvPtr); + + newPoints1.Fix(); + newPoints2.Fix(); + } + /// + /// Refines coordinates of corresponding points. + /// + /// 3x3 fundamental matrix. + /// 1xN array containing the first set of points. + /// 1xN array containing the second set of points. + /// The optimized points1. + /// The optimized points2. + public static void CorrectMatches( + double[,] F, IEnumerable points1, IEnumerable points2, + out Point2d[] newPoints1, out Point2d[] newPoints2) + { + if (F == null) + throw new ArgumentNullException("F"); + if (points1 == null) + throw new ArgumentNullException("points1"); + if (points2 == null) + throw new ArgumentNullException("points2"); + + Point2d[] points1Array = EnumerableEx.ToArray(points1); + Point2d[] points2Array = EnumerableEx.ToArray(points2); + newPoints1 = new Point2d[points1Array.Length]; + newPoints2 = new Point2d[points2Array.Length]; + + NativeMethods.calib3d_correctMatches_array( + F, points1Array, points1Array.Length, + points2Array, points2Array.Length, + newPoints1, newPoints2); + } + #endregion + + /// + /// filters off speckles (small regions of incorrectly computed disparity) + /// + /// The input 16-bit signed disparity image + /// The disparity value used to paint-off the speckles + /// The maximum speckle size to consider it a speckle. Larger blobs are not affected by the algorithm + /// Maximum difference between neighbor disparity pixels to put them into the same blob. + /// Note that since StereoBM, StereoSGBM and may be other algorithms return a fixed-point disparity map, where disparity values + /// are multiplied by 16, this scale factor should be taken into account when specifying this parameter value. + /// The optional temporary buffer to avoid memory allocation within the function. + public static void FilterSpeckles(InputOutputArray img, double newVal, int maxSpeckleSize, double maxDiff, + InputOutputArray buf = null) + { + if (img == null) + throw new ArgumentNullException("img"); + img.ThrowIfNotReady(); + + NativeMethods.calib3d_filterSpeckles(img.CvPtr, newVal, maxSpeckleSize, maxDiff, ToPtr(buf)); + img.Fix(); + } + + /// + /// computes valid disparity ROI from the valid ROIs of the rectified images (that are returned by cv::stereoRectify()) + /// + /// + /// + /// + /// + /// + /// + public static Rect GetValidDisparityROI(Rect roi1, Rect roi2, + int minDisparity, int numberOfDisparities, int SADWindowSize) + { + return NativeMethods.calib3d_getValidDisparityROI( + roi1, roi2, minDisparity, numberOfDisparities, SADWindowSize); + } + + /// + /// validates disparity using the left-right check. The matrix "cost" should be computed by the stereo correspondence algorithm + /// + /// + /// + /// + /// + /// + public static void ValidateDisparity(InputOutputArray disparity, InputArray cost, + int minDisparity, int numberOfDisparities, int disp12MaxDisp = 1) + { + if (disparity == null) + throw new ArgumentNullException("disparity"); + if (cost == null) + throw new ArgumentNullException("cost"); + disparity.ThrowIfNotReady(); + cost.ThrowIfDisposed(); + + NativeMethods.calib3d_validateDisparity( + disparity.CvPtr, cost.CvPtr, minDisparity, numberOfDisparities, disp12MaxDisp); + disparity.Fix(); + } + + /// + /// reprojects disparity image to 3D: (x,y,d)->(X,Y,Z) using the matrix Q returned by cv::stereoRectify + /// + /// Input single-channel 8-bit unsigned, 16-bit signed, 32-bit signed or 32-bit floating-point disparity image. + /// Output 3-channel floating-point image of the same size as disparity. + /// Each element of _3dImage(x,y) contains 3D coordinates of the point (x,y) computed from the disparity map. + /// 4 x 4 perspective transformation matrix that can be obtained with stereoRectify(). + /// Indicates, whether the function should handle missing values (i.e. points where the disparity was not computed). + /// If handleMissingValues=true, then pixels with the minimal disparity that corresponds to the outliers (see StereoBM::operator() ) are + /// transformed to 3D points with a very large Z value (currently set to 10000). + /// he optional output array depth. If it is -1, the output image will have CV_32F depth. + /// ddepth can also be set to CV_16S, CV_32S or CV_32F. + public static void ReprojectImageTo3D(InputArray disparity, + OutputArray _3dImage, InputArray Q, + bool handleMissingValues = false, int ddepth = -1) + { + if (disparity == null) + throw new ArgumentNullException("disparity"); + if (_3dImage == null) + throw new ArgumentNullException("_3dImage"); + if (Q == null) + throw new ArgumentNullException("Q"); + disparity.ThrowIfDisposed(); + _3dImage.ThrowIfNotReady(); + Q.ThrowIfDisposed(); + + NativeMethods.calib3d_reprojectImageTo3D( + disparity.CvPtr, _3dImage.CvPtr, Q.CvPtr, handleMissingValues ? 1 : 0, ddepth); + + _3dImage.Fix(); + } + + /// + /// Computes an optimal affine transformation between two 3D point sets. + /// + /// First input 3D point set. + /// Second input 3D point set. + /// Output 3D affine transformation matrix 3 x 4 . + /// Output vector indicating which points are inliers. + /// Maximum reprojection error in the RANSAC algorithm to consider a point as an inlier. + /// Confidence level, between 0 and 1, for the estimated transformation. + /// Anything between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation significantly. + /// Values lower than 0.8-0.9 can result in an incorrectly estimated transformation. + /// + public static int EstimateAffine3D(InputArray src, InputArray dst, + OutputArray outVal, OutputArray inliers, + double ransacThreshold = 3, double confidence = 0.99) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (outVal == null) + throw new ArgumentNullException("outVal"); + if (inliers == null) + throw new ArgumentNullException("inliers"); + src.ThrowIfDisposed(); + dst.ThrowIfDisposed(); + outVal.ThrowIfNotReady(); + inliers.ThrowIfNotReady(); + + int ret = NativeMethods.calib3d_estimateAffine3D( + src.CvPtr, dst.CvPtr, outVal.CvPtr, inliers.CvPtr, ransacThreshold, confidence); + + outVal.Fix(); + inliers.Fix(); + return ret; + } + } +} diff --git a/src/OpenCvSharp/Cv2/Cv2_contrib.cs b/src/OpenCvSharp/Cv2/Cv2_contrib.cs new file mode 100644 index 000000000..a4d5c809d --- /dev/null +++ b/src/OpenCvSharp/Cv2/Cv2_contrib.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using OpenCvSharp.Utilities; + +namespace OpenCvSharp.CPlusPlus +{ + static partial class Cv2 + { +#if LANG_JP + /// + /// + /// + /// +#else + /// + /// + /// + /// +#endif + public static bool InitModule_Contrib() + { + return NativeMethods.contrib_initModule_contrib() != 0; + } + + /// + /// + /// + /// + /// + /// + public static void ApplyColorMap(InputArray src, OutputArray dst, ColorMapMode colormap) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.contrib_applyColorMap(src.CvPtr, dst.CvPtr, (int)colormap); + dst.Fix(); + } + } +} diff --git a/src/OpenCvSharp/Cv2/Cv2_core.cs b/src/OpenCvSharp/Cv2/Cv2_core.cs new file mode 100644 index 000000000..cdf465b80 --- /dev/null +++ b/src/OpenCvSharp/Cv2/Cv2_core.cs @@ -0,0 +1,2744 @@ +using System; +using System.Collections.Generic; +using System.Text; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + static partial class Cv2 + { + #region Miscellaneous + + /// + /// + /// + /// + public static void SetNumThreads(int nthreads) + { + NativeMethods.core_setNumThreads(nthreads); + } + + /// + /// + /// + /// + public static int GetNumThreads() + { + return NativeMethods.core_getNumThreads(); + } + /// + /// + /// + /// + public static int GetThreadNum() + { + return NativeMethods.core_getThreadNum(); + } + + /// + /// + /// + /// + public static string GetBuildInformation() + { + StringBuilder buf = new StringBuilder(1 << 16); + NativeMethods.core_getBuildInformation(buf, (uint)buf.Capacity); + return buf.ToString(); + } + + /// + /// + /// + /// + public static long GetTickCount() + { + return NativeMethods.core_getTickCount(); + } + + /// + /// + /// + /// + public static double GetTickFrequency() + { + return NativeMethods.core_getTickFrequency(); + } + + /// + /// + /// + /// + public static long GetCpuTickCount() + { + return NativeMethods.core_getCPUTickCount(); + } + + /// + /// + /// + /// + /// + public static bool CheckHardwareSupport(CpuFeatures feature) + { + return NativeMethods.core_checkHardwareSupport((int)feature) != 0; + } + + /// + /// + /// + /// + public static int GetNumberOfCpus() + { + return NativeMethods.core_getNumberOfCPUs(); + } + + /// + /// + /// + /// + /// + public static IntPtr FastMalloc(long bufSize) + { + return NativeMethods.core_fastMalloc(new IntPtr(bufSize)); + } + + /// + /// + /// + /// + public static void FastFree(IntPtr ptr) + { + NativeMethods.core_fastFree(ptr); + } + + /// + /// Turns on/off available optimization. + /// The function turns on or off the optimized code in OpenCV. Some optimization can not be enabled + /// or disabled, but, for example, most of SSE code in OpenCV can be temporarily turned on or off this way. + /// + /// + public static void SetUseOptimized(bool onoff) + { + NativeMethods.core_setUseOptimized(onoff ? 1 : 0); + } + + /// + /// Returns the current optimization status. + /// The function returns the current optimization status, which is controlled by cv::setUseOptimized(). + /// + /// + public static bool UseOptimized() + { + return NativeMethods.core_useOptimized() != 0; + } + + /// + /// Aligns buffer size by the certain number of bytes + /// This small inline function aligns a buffer size by + /// the certian number of bytes by enlarging it. + /// + /// + /// + /// + public static int AlignSize(int sz, int n) + { + bool assert = ((n & (n - 1)) == 0); // n is a power of 2 + if(!assert) + throw new ArgumentException(); + return (sz + n - 1) & -n; + } + + #endregion + + #region Abs + /// + /// Computes absolute value of each matrix element + /// + /// matrix + /// + public static MatExpr Abs(Mat src) + { + if (src == null) + throw new ArgumentNullException("src"); + src.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_abs_Mat(src.CvPtr); + GC.KeepAlive(src); + return new MatExpr(retPtr); + } + /// + /// Computes absolute value of each matrix element + /// + /// matrix expression + /// + public static MatExpr Abs(MatExpr src) + { + if (src == null) + throw new ArgumentNullException("src"); + src.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_abs_MatExpr(src.CvPtr); + GC.KeepAlive(src); + return new MatExpr(retPtr); + } + #endregion + #region Add +#if LANG_JP + /// + /// 2つの配列同士,あるいは配列とスカラの 要素毎の和を求めます. + /// + /// 1番目の入力配列 + /// src1 と同じサイズ,同じ型である2番目の入力配列 + /// src1 と同じサイズ,同じ型の出力配列. + /// 8ビット,シングルチャンネル配列のオプションの処理マスク.出力配列内の変更される要素を表します. [既定値はnull] + /// +#else + /// + /// Computes the per-element sum of two arrays or an array and a scalar. + /// + /// The first source array + /// The second source array. It must have the same size and same type as src1 + /// The destination array; it will have the same size and same type as src1 + /// The optional operation mask, 8-bit single channel array; specifies elements of the destination array to be changed. [By default this is null] + /// +#endif + public static void Add(InputArray src1, InputArray src2, OutputArray dst, InputArray mask = null, int dtype = -1) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_add(src1.CvPtr, src2.CvPtr, dst.CvPtr, ToPtr(mask), dtype); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + dst.Fix(); + } + #endregion + #region Subtract +#if LANG_JP + /// + /// 2つの配列同士,あるいは配列とスカラの 要素毎の差を求めます. + /// + /// 1番目の入力配列 + /// src1 と同じサイズ,同じ型である2番目の入力配列 + /// src1 と同じサイズ,同じ型の出力配列. + /// オプション.8ビット,シングルチャンネル配列の処理マスク.出力配列内の変更される要素を表します. [既定値はnull] + /// +#else + /// + /// Calculates per-element difference between two arrays or array and a scalar + /// + /// The first source array + /// The second source array. It must have the same size and same type as src1 + /// The destination array; it will have the same size and same type as src1 + /// The optional operation mask, 8-bit single channel array; specifies elements of the destination array to be changed. [By default this is null] + /// +#endif + public static void Subtract(InputArray src1, InputArray src2, OutputArray dst, InputArray mask = null, int dtype = -1) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_subtract(src1.CvPtr, src2.CvPtr, dst.CvPtr, ToPtr(mask), dtype); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + dst.Fix(); + } + #endregion + #region Multiply +#if LANG_JP + /// + /// 2つの配列同士の,要素毎のスケーリングされた積を求めます. + /// + /// 1番目の入力配列 + /// src1 と同じサイズ,同じ型である2番目の入力配列 + /// src1 と同じサイズ,同じ型の出力配列 + /// オプションであるスケールファクタ. [既定値は1] + /// +#else + /// + /// Calculates the per-element scaled product of two arrays + /// + /// The first source array + /// The second source array of the same size and the same type as src1 + /// The destination array; will have the same size and the same type as src1 + /// The optional scale factor. [By default this is 1] + /// +#endif + public static void Multiply(InputArray src1, InputArray src2, OutputArray dst, double scale = 1, int dtype = -1) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_multiply(src1.CvPtr, src2.CvPtr, dst.CvPtr, scale, dtype); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + dst.Fix(); + + } + #endregion + #region Divide +#if LANG_JP + /// + /// 2つの配列同士,あるいは配列とスカラの 要素毎の商を求めます. + /// + /// 1番目の入力配列 + /// src1 と同じサイズ,同じ型である2番目の入力配列 + /// src2 と同じサイズ,同じ型である出力配列 + /// スケールファクタ [既定値は1] + /// +#else + /// + /// Performs per-element division of two arrays or a scalar by an array. + /// + /// The first source array + /// The second source array; should have the same size and same type as src1 + /// The destination array; will have the same size and same type as src2 + /// Scale factor [By default this is 1] + /// +#endif + public static void Divide(InputArray src1, InputArray src2, OutputArray dst, double scale = 1, int dtype = -1) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_divide(src1.CvPtr, src2.CvPtr, dst.CvPtr, scale, dtype); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + dst.Fix(); + } +#if LANG_JP + /// + /// 2つの配列同士,あるいは配列とスカラの 要素毎の商を求めます. + /// + /// スケールファクタ + /// 1番目の入力配列 + /// src2 と同じサイズ,同じ型である出力配列 + /// +#else + /// + /// Performs per-element division of two arrays or a scalar by an array. + /// + /// Scale factor + /// The first source array + /// The destination array; will have the same size and same type as src2 + /// +#endif + public static void Divide(double scale, InputArray src2, OutputArray dst, int dtype = -1) + { + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dst == null) + throw new ArgumentNullException("dst"); + src2.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_divide(scale, src2.CvPtr, dst.CvPtr, dtype); + GC.KeepAlive(src2); + dst.Fix(); + } + #endregion + #region ScaleAdd + /// + /// adds scaled array to another one (dst = alpha*src1 + src2) + /// + /// + /// + /// + /// + public static void ScaleAdd(InputArray src1, double alpha, InputArray src2, OutputArray dst) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_scaleAdd(src1.CvPtr, alpha, src2.CvPtr, dst.CvPtr); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + dst.Fix(); + } + #endregion + #region AddWeighted + /// + /// computes weighted sum of two arrays (dst = alpha*src1 + beta*src2 + gamma) + /// + /// + /// + /// + /// + /// + /// + /// + public static void AddWeighted(InputArray src1, double alpha, InputArray src2, + double beta, double gamma, OutputArray dst, int dtype = -1) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_addWeighted(src1.CvPtr, alpha, src2.CvPtr, beta, gamma, dst.CvPtr, dtype); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + dst.Fix(); + } + #endregion + + #region ConvertScaleAbs +#if LANG_JP + /// + /// スケーリング後,絶対値を計算し,結果を結果を 8 ビットに変換します. + /// + /// 入力配列 + /// 出力配列 + /// オプションのスケールファクタ. [既定値は1] + /// スケーリングされた値に加えられるオプション値. [既定値は0] +#else + /// + /// Scales, computes absolute values and converts the result to 8-bit. + /// + /// The source array + /// The destination array + /// The optional scale factor. [By default this is 1] + /// The optional delta added to the scaled values. [By default this is 0] +#endif + public static void ConvertScaleAbs(InputArray src, OutputArray dst, double alpha = 1, double beta = 0) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_convertScaleAbs(src.CvPtr, dst.CvPtr, alpha, beta); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region LUT + /// + /// transforms array of numbers using a lookup table: dst(i)=lut(src(i)) + /// + /// Source array of 8-bit elements + /// Look-up table of 256 elements. + /// In the case of multi-channel source array, the table should either have + /// a single channel (in this case the same table is used for all channels) + /// or the same number of channels as in the source array + /// Destination array; + /// will have the same size and the same number of channels as src, + /// and the same depth as lut + /// + public static void LUT(InputArray src, InputArray lut, OutputArray dst, int interpolation = 0) + { + if (src == null) + throw new ArgumentNullException("src"); + if (lut == null) + throw new ArgumentNullException("lut"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + lut.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_LUT(src.CvPtr, lut.CvPtr, dst.CvPtr); + GC.KeepAlive(src); + GC.KeepAlive(lut); + dst.Fix(); + } + /// + /// transforms array of numbers using a lookup table: dst(i)=lut(src(i)) + /// + /// Source array of 8-bit elements + /// Look-up table of 256 elements. + /// In the case of multi-channel source array, the table should either have + /// a single channel (in this case the same table is used for all channels) + /// or the same number of channels as in the source array + /// Destination array; + /// will have the same size and the same number of channels as src, + /// and the same depth as lut + /// + public static void LUT(InputArray src, byte[] lut, OutputArray dst, int interpolation = 0) + { + if (lut == null) + throw new ArgumentNullException("lut"); + if (lut.Length != 256) + throw new ArgumentException("lut.Length != 256"); + using (Mat lutMat = new Mat(256, 1, MatType.CV_8UC1, lut)) + { + LUT(src, lutMat, dst, interpolation); + } + } + #endregion + #region Sum + /// + /// computes sum of array elements + /// + /// The source array; must have 1 to 4 channels + /// + public static Scalar Sum(InputArray src) + { + if (src == null) + throw new ArgumentNullException("src"); + src.ThrowIfDisposed(); + var ret = NativeMethods.core_sum(src.CvPtr); + GC.KeepAlive(src); + return ret; + } + #endregion + #region CountNonZero + /// + /// computes the number of nonzero array elements + /// + /// Single-channel array + /// number of non-zero elements in mtx + public static int CountNonZero(InputArray mtx) + { + if (mtx == null) + throw new ArgumentNullException("mtx"); + mtx.ThrowIfDisposed(); + var ret = NativeMethods.core_countNonZero(mtx.CvPtr); + return ret; + GC.KeepAlive(mtx); + } + #endregion + #region FindNonZero + /// + /// returns the list of locations of non-zero pixels + /// + /// + /// + public static void FindNonZero(InputArray src, OutputArray idx) + { + if (src == null) + throw new ArgumentNullException("src"); + if (idx == null) + throw new ArgumentNullException("idx"); + src.ThrowIfDisposed(); + idx.ThrowIfNotReady(); + NativeMethods.core_findNonZero(src.CvPtr, idx.CvPtr); + GC.KeepAlive(src); + idx.Fix(); + } + #endregion + #region Mean + /// + /// computes mean value of selected array elements + /// + /// The source array; it should have 1 to 4 channels + /// (so that the result can be stored in Scalar) + /// The optional operation mask + /// + public static Scalar Mean(InputArray src, InputArray mask = null) + { + if (src == null) + throw new ArgumentNullException("src"); + src.ThrowIfDisposed(); + var ret = NativeMethods.core_mean(src.CvPtr, ToPtr(mask)); + GC.KeepAlive(src); + GC.KeepAlive(mask); + return ret; + } + #endregion + #region MeanStdDev + /// + /// computes mean value and standard deviation of all or selected array elements + /// + /// The source array; it should have 1 to 4 channels + /// (so that the results can be stored in Scalar's) + /// The output parameter: computed mean value + /// The output parameter: computed standard deviation + /// The optional operation mask + public static void MeanStdDev( + InputArray src, OutputArray mean, OutputArray stddev, InputArray mask = null) + { + if (src == null) + throw new ArgumentNullException("src"); + if (mean == null) + throw new ArgumentNullException("mean"); + if (stddev == null) + throw new ArgumentNullException("stddev"); + src.ThrowIfDisposed(); + mean.ThrowIfNotReady(); + stddev.ThrowIfNotReady(); + + NativeMethods.core_meanStdDev_OutputArray(src.CvPtr, mean.CvPtr, stddev.CvPtr, ToPtr(mask)); + + mean.Fix(); + stddev.Fix(); + GC.KeepAlive(src); + GC.KeepAlive(mask); + } + + /// + /// computes mean value and standard deviation of all or selected array elements + /// + /// The source array; it should have 1 to 4 channels + /// (so that the results can be stored in Scalar's) + /// The output parameter: computed mean value + /// The output parameter: computed standard deviation + /// The optional operation mask + public static void MeanStdDev( + InputArray src, out Scalar mean, out Scalar stddev, InputArray mask = null) + { + if (src == null) + throw new ArgumentNullException("src"); + + src.ThrowIfDisposed(); + + NativeMethods.core_meanStdDev_Scalar(src.CvPtr, out mean, out stddev, ToPtr(mask)); + + GC.KeepAlive(src); + GC.KeepAlive(mask); + } + #endregion + #region Norm + /// + /// Calculates absolute array norm, absolute difference norm, or relative difference norm. + /// + /// The first source array + /// Type of the norm + /// The optional operation mask + /// + public static double Norm(InputArray src1, + NormTypes normType = NormTypes.L2, InputArray mask = null) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + src1.ThrowIfDisposed(); + var ret = NativeMethods.core_norm(src1.CvPtr, (int)normType, ToPtr(mask)); + GC.KeepAlive(src1); + GC.KeepAlive(mask); + return ret; + } + /// + /// computes norm of selected part of the difference between two arrays + /// + /// The first source array + /// The second source array of the same size and the same type as src1 + /// Type of the norm + /// The optional operation mask + /// + public static double Norm(InputArray src1, InputArray src2, + NormTypes normType = NormTypes.L2, InputArray mask = null) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + var ret = NativeMethods.core_norm(src1.CvPtr, src2.CvPtr, (int)normType, ToPtr(mask)); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + GC.KeepAlive(mask); + return ret; + } + #endregion + #region BatchDistance + /// + /// naive nearest neighbor finder + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static void BatchDistance(InputArray src1, InputArray src2, + OutputArray dist, int dtype, OutputArray nidx, + NormTypes normType = NormTypes.L2, + int k = 0, InputArray mask = null, + int update = 0, bool crosscheck = false) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dist == null) + throw new ArgumentNullException("dist"); + if (nidx == null) + throw new ArgumentNullException("nidx"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + dist.ThrowIfNotReady(); + nidx.ThrowIfNotReady(); + NativeMethods.core_batchDistance(src1.CvPtr, src2.CvPtr, dist.CvPtr, dtype, nidx.CvPtr, + (int)normType, k, ToPtr(mask), update, crosscheck ? 1 : 0); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + dist.Fix(); + nidx.Fix(); + } + #endregion + #region Normalize + /// + /// scales and shifts array elements so that either the specified norm (alpha) + /// or the minimum (alpha) and maximum (beta) array values get the specified values + /// + /// The source array + /// The destination array; will have the same size as src + /// The norm value to normalize to or the lower range boundary + /// in the case of range normalization + /// The upper range boundary in the case of range normalization; + /// not used for norm normalization + /// The normalization type + /// When the parameter is negative, + /// the destination array will have the same type as src, + /// otherwise it will have the same number of channels as src and the depth =CV_MAT_DEPTH(rtype) + /// The optional operation mask + public static void Normalize( InputArray src, InputOutputArray dst, double alpha=1, double beta=0, + NormTypes normType=NormTypes.L2, int dtype=-1, InputArray mask=null) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_normalize(src.CvPtr, dst.CvPtr, alpha, beta, (int)normType, dtype, ToPtr(mask)); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region MinMaxLoc + /// + /// finds global minimum and maximum array elements and returns their values and their locations + /// + /// The source single-channel array + /// Pointer to returned minimum value + /// Pointer to returned maximum value + public static void MinMaxLoc(InputArray src, out double minVal, out double maxVal) + { + if (src == null) + throw new ArgumentNullException("src"); + src.ThrowIfDisposed(); + NativeMethods.core_minMaxLoc(src.CvPtr, out minVal, out maxVal); + GC.KeepAlive(src); + } + + /// + /// finds global minimum and maximum array elements and returns their values and their locations + /// + /// The source single-channel array + /// Pointer to returned minimum location + /// Pointer to returned maximum location + public static void MinMaxLoc(InputArray src, out Point minLoc, out Point maxLoc) + { + double minVal, maxVal; + MinMaxLoc(src, out minVal, out maxVal, out minLoc, out maxLoc); + } + + /// + /// finds global minimum and maximum array elements and returns their values and their locations + /// + /// The source single-channel array + /// Pointer to returned minimum value + /// Pointer to returned maximum value + /// Pointer to returned minimum location + /// Pointer to returned maximum location + /// The optional mask used to select a sub-array + public static void MinMaxLoc(InputArray src, out double minVal, out double maxVal, + out Point minLoc, out Point maxLoc, InputArray mask = null) + { + if (src == null) + throw new ArgumentNullException("src"); + src.ThrowIfDisposed(); + + NativeMethods.core_minMaxLoc(src.CvPtr, out minVal, out maxVal, out minLoc, out maxLoc, ToPtr(mask)); + GC.KeepAlive(src); + } + + #endregion + #region MinMaxIdx + /// + /// finds global minimum and maximum array elements and returns their values and their locations + /// + /// The source single-channel array + /// Pointer to returned minimum value + /// Pointer to returned maximum value + public static void MinMaxIdx(InputArray src, out double minVal, out double maxVal) + { + if (src == null) + throw new ArgumentNullException("src"); + src.ThrowIfDisposed(); + NativeMethods.core_minMaxIdx(src.CvPtr, out minVal, out maxVal); + GC.KeepAlive(src); + } + + /// + /// finds global minimum and maximum array elements and returns their values and their locations + /// + /// The source single-channel array + /// + /// + public static void MinMaxIdx(InputArray src, out int minIdx, out int maxIdx) + { + double minVal, maxVal; + MinMaxIdx(src, out minVal, out maxVal, out minIdx, out maxIdx, null); + } + + /// + /// finds global minimum and maximum array elements and returns their values and their locations + /// + /// The source single-channel array + /// Pointer to returned minimum value + /// Pointer to returned maximum value + /// + /// + /// + public static void MinMaxIdx(InputArray src, out double minVal, out double maxVal, + out int minIdx, out int maxIdx, InputArray mask = null) + { + if (src == null) + throw new ArgumentNullException("src"); + src.ThrowIfDisposed(); + NativeMethods.core_minMaxIdx(src.CvPtr, out minVal, out maxVal, out minIdx, out maxIdx, ToPtr(mask)); + GC.KeepAlive(src); + } + #endregion + #region Reduce + /// + /// transforms 2D matrix to 1D row or column vector by taking sum, minimum, maximum or mean value over all the rows + /// + /// The source 2D matrix + /// The destination vector. + /// Its size and type is defined by dim and dtype parameters + /// The dimension index along which the matrix is reduced. + /// 0 means that the matrix is reduced to a single row and 1 means that the matrix is reduced to a single column + /// + /// When it is negative, the destination vector will have + /// the same type as the source matrix, otherwise, its type will be CV_MAKE_TYPE(CV_MAT_DEPTH(dtype), mtx.channels()) + public static void Reduce(InputArray src, OutputArray dst, ReduceDimension dim, ReduceTypes rtype, int dtype) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_reduce(src.CvPtr, dst.CvPtr, (int)dim, (int)rtype, dtype); + dst.Fix(); + GC.KeepAlive(src); + } + #endregion + #region Merge + /// + /// makes multi-channel array out of several single-channel arrays + /// + /// + /// + public static void Merge(Mat[] mv, Mat dst) + { + if (mv == null) + throw new ArgumentNullException("mv"); + if (mv.Length == 0) + throw new ArgumentException("mv.Length == 0"); + if (dst == null) + throw new ArgumentNullException("dst"); + foreach (Mat m in mv) + { + if(m == null) + throw new ArgumentException("mv contains null element"); + m.ThrowIfDisposed(); + } + dst.ThrowIfDisposed(); + + var mvPtr = new IntPtr[mv.Length]; + for (int i = 0; i < mv.Length; i++) + { + mvPtr[i] = mv[i].CvPtr; + } + NativeMethods.core_merge(mvPtr, (uint)mvPtr.Length, dst.CvPtr); + GC.KeepAlive(mv); + GC.KeepAlive(dst); + } + #endregion + #region Split + /// + /// Copies each plane of a multi-channel array to a dedicated array + /// + /// The source multi-channel array + /// The destination array or vector of arrays; + /// The number of arrays must match mtx.channels() . + /// The arrays themselves will be reallocated if needed + public static void Split(Mat src, out Mat[] mv) + { + if (src == null) + throw new ArgumentNullException("src"); + src.ThrowIfDisposed(); + + IntPtr mvPtr; + NativeMethods.core_split(src.CvPtr, out mvPtr); + + using (var vec = new VectorOfMat(mvPtr)) + { + mv = vec.ToArray(); + } + GC.KeepAlive(src); + } + /// + /// Copies each plane of a multi-channel array to a dedicated array + /// + /// The source multi-channel array + /// The number of arrays must match mtx.channels() . + /// The arrays themselves will be reallocated if needed + public static Mat[] Split(Mat src) + { + Mat[] mv; + Split(src, out mv); + return mv; + } + #endregion + #region MixChannels + /// + /// copies selected channels from the input arrays to the selected channels of the output arrays + /// + /// + /// + /// + public static void MixChannels(Mat[] src, Mat[] dst, int[] fromTo) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (fromTo == null) + throw new ArgumentNullException("fromTo"); + if (src.Length == 0) + throw new ArgumentException("src.Length == 0"); + if (dst.Length == 0) + throw new ArgumentException("dst.Length == 0"); + if (fromTo.Length == 0 || fromTo.Length % 2 != 0) + throw new ArgumentException("fromTo.Length == 0"); + IntPtr[] srcPtr = new IntPtr[src.Length]; + IntPtr[] dstPtr = new IntPtr[dst.Length]; + for (int i = 0; i < src.Length; i++) + { + src[i].ThrowIfDisposed(); + srcPtr[i] = src[i].CvPtr; + } + for (int i = 0; i < dst.Length; i++) + { + dst[i].ThrowIfDisposed(); + dstPtr[i] = dst[i].CvPtr; + } + NativeMethods.core_mixChannels(srcPtr, (uint)src.Length, dstPtr, (uint)dst.Length, + fromTo, (uint)(fromTo.Length / 2)); + + GC.KeepAlive(src); + GC.KeepAlive(dst); + } + #endregion + #region ExtractChannel + /// + /// extracts a single channel from src (coi is 0-based index) + /// + /// + /// + /// + public static void ExtractChannel(InputArray src, OutputArray dst, int coi) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_extractChannel(src.CvPtr, dst.CvPtr, coi); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region InsertChannel + /// + /// inserts a single channel to dst (coi is 0-based index) + /// + /// + /// + /// + public static void InsertChannel(InputArray src, InputOutputArray dst, int coi) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_insertChannel(src.CvPtr, dst.CvPtr, coi); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region Flip + /// + /// reverses the order of the rows, columns or both in a matrix + /// + /// The source array + /// The destination array; will have the same size and same type as src + /// Specifies how to flip the array: + /// 0 means flipping around the x-axis, positive (e.g., 1) means flipping around y-axis, + /// and negative (e.g., -1) means flipping around both axes. See also the discussion below for the formulas. + public static void Flip(InputArray src, OutputArray dst, FlipMode flipCode) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_flip(src.CvPtr, dst.CvPtr, (int)flipCode); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region Repeat + /// + /// replicates the input matrix the specified number of times in the horizontal and/or vertical direction + /// + /// The source array to replicate + /// How many times the src is repeated along the vertical axis + /// How many times the src is repeated along the horizontal axis + /// The destination array; will have the same type as src + public static void Repeat(InputArray src, int ny, int nx, OutputArray dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_repeat(src.CvPtr, ny, nx, dst.CvPtr); + GC.KeepAlive(src); + dst.Fix(); + } + /// + /// replicates the input matrix the specified number of times in the horizontal and/or vertical direction + /// + /// The source array to replicate + /// How many times the src is repeated along the vertical axis + /// How many times the src is repeated along the horizontal axis + /// + public static Mat Repeat(Mat src, int ny, int nx) + { + if (src == null) + throw new ArgumentNullException("src"); + src.ThrowIfDisposed(); + IntPtr matPtr = NativeMethods.core_repeat(src.CvPtr, ny, nx); + GC.KeepAlive(src); + return new Mat(matPtr); + } + #endregion + #region HConcat + /// + /// + /// + /// + /// + public static void HConcat(Mat[] src, OutputArray dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (src.Length == 0) + throw new ArgumentException("src.Length == 0"); + IntPtr[] srcPtr = new IntPtr[src.Length]; + for (int i = 0; i < src.Length; i++) + { + src[i].ThrowIfDisposed(); + srcPtr[i] = src[i].CvPtr; + } + NativeMethods.core_hconcat(srcPtr, (uint)src.Length, dst.CvPtr); + GC.KeepAlive(src); + dst.Fix(); + } + /// + /// + /// + /// + /// + /// + public static void HConcat(InputArray src1, InputArray src2, OutputArray dst) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_hconcat(src1.CvPtr, src2.CvPtr, dst.CvPtr); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + dst.Fix(); + } + #endregion + #region VConcat + /// + /// + /// + /// + /// + public static void VConcat(Mat[] src, OutputArray dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (src.Length == 0) + throw new ArgumentException("src.Length == 0"); + IntPtr[] srcPtr = new IntPtr[src.Length]; + for (int i = 0; i < src.Length; i++) + { + src[i].ThrowIfDisposed(); + srcPtr[i] = src[i].CvPtr; + } + NativeMethods.core_vconcat(srcPtr, (uint)src.Length, dst.CvPtr); + GC.KeepAlive(src); + dst.Fix(); + } + /// + /// + /// + /// + /// + /// + public static void VConcat(InputArray src1, InputArray src2, OutputArray dst) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_vconcat(src1.CvPtr, src2.CvPtr, dst.CvPtr); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + dst.Fix(); + } + #endregion + #region BitwiseAnd + /// + /// computes bitwise conjunction of the two arrays (dst = src1 & src2) + /// + /// + /// + /// + /// + public static void BitwiseAnd(InputArray src1, InputArray src2, OutputArray dst, InputArray mask = null) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_bitwise_and(src1.CvPtr, src2.CvPtr, dst.CvPtr, ToPtr(mask)); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + dst.Fix(); + } + #endregion + #region BitwiseOr + /// + /// computes bitwise disjunction of the two arrays (dst = src1 | src2) + /// + /// + /// + /// + /// + public static void BitwiseOr(InputArray src1, InputArray src2, OutputArray dst, InputArray mask = null) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_bitwise_or(src1.CvPtr, src2.CvPtr, dst.CvPtr, ToPtr(mask)); + dst.Fix(); + } + #endregion + #region BitwiseXor + /// + /// computes bitwise exclusive-or of the two arrays (dst = src1 ^ src2) + /// + /// + /// + /// + /// + public static void BitwiseXor(InputArray src1, InputArray src2, OutputArray dst, InputArray mask = null) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_bitwise_xor(src1.CvPtr, src2.CvPtr, dst.CvPtr, ToPtr(mask)); + dst.Fix(); + } + #endregion + #region BitwiseNot + /// + /// inverts each bit of array (dst = ~src) + /// + /// + /// + /// + public static void BitwiseNot(InputArray src, OutputArray dst, InputArray mask = null) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_bitwise_not(src.CvPtr, dst.CvPtr, ToPtr(mask)); + dst.Fix(); + } + #endregion + #region Absdiff + /// + /// computes element-wise absolute difference of two arrays (dst = abs(src1 - src2)) + /// + /// + /// + /// + public static void Absdiff(InputArray src1, InputArray src2, OutputArray dst) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_absdiff(src1.CvPtr, src2.CvPtr, dst.CvPtr); + dst.Fix(); + } + #endregion + #region InRange + /// + /// set mask elements for those array elements which are within the element-specific bounding box (dst = lowerb <= src && src < upperb) + /// + /// The first source array + /// The inclusive lower boundary array of the same size and type as src + /// The exclusive upper boundary array of the same size and type as src + /// The destination array, will have the same size as src and CV_8U type + public static void InRange(InputArray src, InputArray lowerb, InputArray upperb, OutputArray dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (lowerb == null) + throw new ArgumentNullException("lowerb"); + if (upperb == null) + throw new ArgumentNullException("upperb"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + lowerb.ThrowIfDisposed(); + upperb.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_inRange(src.CvPtr, lowerb.CvPtr, upperb.CvPtr, dst.CvPtr); + dst.Fix(); + } + + /// + /// set mask elements for those array elements which are within the element-specific bounding box (dst = lowerb <= src && src < upperb) + /// + /// The first source array + /// The inclusive lower boundary array of the same size and type as src + /// The exclusive upper boundary array of the same size and type as src + /// The destination array, will have the same size as src and CV_8U type + public static void InRange(InputArray src, Scalar lowerb, Scalar upperb, OutputArray dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_inRange(src.CvPtr, lowerb, upperb, dst.CvPtr); + dst.Fix(); + } + #endregion + #region Compare + /// + /// Performs the per-element comparison of two arrays or an array and scalar value. + /// + /// first input array or a scalar; when it is an array, it must have a single channel. + /// second input array or a scalar; when it is an array, it must have a single channel. + /// output array of type ref CV_8U that has the same size and the same number of channels as the input arrays. + /// a flag, that specifies correspondence between the arrays (cv::CmpTypes) + public static void Compare(InputArray src1, InputArray src2, OutputArray dst, CmpTypes cmpop) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_compare(src1.CvPtr, src2.CvPtr, dst.CvPtr, (int)cmpop); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + dst.Fix(); + } + #endregion + #region Min + /// + /// computes per-element minimum of two arrays (dst = min(src1, src2)) + /// + /// + /// + /// + public static void Min(InputArray src1, InputArray src2, OutputArray dst) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_min1(src1.CvPtr, src2.CvPtr, dst.CvPtr); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + dst.Fix(); + } + /// + /// computes per-element minimum of two arrays (dst = min(src1, src2)) + /// + /// + /// + /// + public static void Min(Mat src1, Mat src2, Mat dst) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + dst.ThrowIfDisposed(); + NativeMethods.core_min_MatMat(src1.CvPtr, src2.CvPtr, dst.CvPtr); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + GC.KeepAlive(dst); + } + /// + /// computes per-element minimum of array and scalar (dst = min(src1, src2)) + /// + /// + /// + /// + public static void Min(Mat src1, double src2, Mat dst) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + dst.ThrowIfDisposed(); + NativeMethods.core_min_MatDouble(src1.CvPtr, src2, dst.CvPtr); + GC.KeepAlive(src1); + GC.KeepAlive(dst); + } + #endregion + #region Max + /// + /// computes per-element maximum of two arrays (dst = max(src1, src2)) + /// + /// + /// + /// + public static void Max(InputArray src1, InputArray src2, OutputArray dst) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_max1(src1.CvPtr, src2.CvPtr, dst.CvPtr); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + dst.Fix(); + } + /// + /// computes per-element maximum of two arrays (dst = max(src1, src2)) + /// + /// + /// + /// + public static void Max(Mat src1, Mat src2, Mat dst) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + dst.ThrowIfDisposed(); + NativeMethods.core_max_MatMat(src1.CvPtr, src2.CvPtr, dst.CvPtr); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + GC.KeepAlive(dst); + } + /// + /// computes per-element maximum of array and scalar (dst = max(src1, src2)) + /// + /// + /// + /// + public static void Max(Mat src1, double src2, Mat dst) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + dst.ThrowIfDisposed(); + NativeMethods.core_max_MatDouble(src1.CvPtr, src2, dst.CvPtr); + GC.KeepAlive(src1); + GC.KeepAlive(dst); + } + #endregion + #region Sqrt + /// + /// computes square root of each matrix element (dst = src**0.5) + /// + /// The source floating-point array + /// The destination array; will have the same size and the same type as src + public static void Sqrt(InputArray src, OutputArray dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_sqrt(src.CvPtr, dst.CvPtr); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region Pow + /// + /// raises the input matrix elements to the specified power (b = a**power) + /// + /// The source array + /// The exponent of power + /// The destination array; will have the same size and the same type as src + public static void Pow(InputArray src, double power, OutputArray dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_pow_Mat(src.CvPtr, power, dst.CvPtr); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region Exp + /// + /// computes exponent of each matrix element (dst = e**src) + /// + /// The source array + /// The destination array; will have the same size and same type as src + public static void Exp(InputArray src, OutputArray dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_exp_Mat(src.CvPtr, dst.CvPtr); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region Log + /// + /// computes natural logarithm of absolute value of each matrix element: dst = log(abs(src)) + /// + /// The source array + /// The destination array; will have the same size and same type as src + public static void Log(InputArray src, OutputArray dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_log_Mat(src.CvPtr, dst.CvPtr); + GC.KeepAlive(src); + dst.Fix(); + } + + #endregion + #region CubeRoot + /// + /// computes cube root of the argument + /// + /// + /// + public static float CubeRoot(float val) + { + return NativeMethods.core_cubeRoot(val); + } + #endregion + #region FastAtan2 + /// + /// computes the angle in degrees (0..360) of the vector (x,y) + /// + /// + /// + /// + public static float FastAtan2(float y, float x) + { + return NativeMethods.core_fastAtan2(y, x); + } + #endregion + #region PolarToCart + /// + /// converts polar coordinates to Cartesian + /// + /// + /// + /// + /// + /// + public static void PolarToCart(InputArray magnitude, InputArray angle, + OutputArray x, OutputArray y, bool angleInDegrees = false) + { + if (magnitude == null) + throw new ArgumentNullException("magnitude"); + if (angle == null) + throw new ArgumentNullException("angle"); + if (x == null) + throw new ArgumentNullException("x"); + if (y == null) + throw new ArgumentNullException("y"); + magnitude.ThrowIfDisposed(); + angle.ThrowIfDisposed(); + x.ThrowIfNotReady(); + y.ThrowIfNotReady(); + NativeMethods.core_polarToCart(magnitude.CvPtr, angle.CvPtr, x.CvPtr, y.CvPtr, angleInDegrees ? 1 : 0); + GC.KeepAlive(magnitude); + GC.KeepAlive(angle); + x.Fix(); + y.Fix(); + } + #endregion + #region CartToPolar + /// + /// converts Cartesian coordinates to polar + /// + /// + /// + /// + /// + /// + public static void CartToPolar(InputArray x, InputArray y, + OutputArray magnitude, OutputArray angle, bool angleInDegrees = false) + { + if (x == null) + throw new ArgumentNullException("x"); + if (y == null) + throw new ArgumentNullException("y"); + if (magnitude == null) + throw new ArgumentNullException("magnitude"); + if (angle == null) + throw new ArgumentNullException("angle"); + x.ThrowIfDisposed(); + y.ThrowIfDisposed(); + magnitude.ThrowIfNotReady(); + angle.ThrowIfNotReady(); + NativeMethods.core_cartToPolar(x.CvPtr, y.CvPtr, magnitude.CvPtr, angle.CvPtr, angleInDegrees ? 1 : 0); + GC.KeepAlive(x); + GC.KeepAlive(y); + magnitude.Fix(); + angle.Fix(); + } + #endregion + #region Phase + /// + /// computes angle (angle(i)) of each (x(i), y(i)) vector + /// + /// + /// + /// + /// + public static void Phase(InputArray x, InputArray y, OutputArray angle, bool angleInDegrees = false) + { + if (x == null) + throw new ArgumentNullException("x"); + if (y == null) + throw new ArgumentNullException("y"); + if (angle == null) + throw new ArgumentNullException("angle"); + x.ThrowIfDisposed(); + y.ThrowIfDisposed(); + angle.ThrowIfNotReady(); + NativeMethods.core_phase(x.CvPtr, y.CvPtr, angle.CvPtr, angleInDegrees ? 1 : 0); + GC.KeepAlive(x); + GC.KeepAlive(y); + angle.Fix(); + } + #endregion + #region Magnitude + /// + /// computes magnitude (magnitude(i)) of each (x(i), y(i)) vector + /// + /// + /// + /// + public static void Magnitude(InputArray x, InputArray y, OutputArray magnitude) + { + if (x == null) + throw new ArgumentNullException("x"); + if (y == null) + throw new ArgumentNullException("y"); + if (magnitude == null) + throw new ArgumentNullException("magnitude"); + x.ThrowIfDisposed(); + y.ThrowIfDisposed(); + magnitude.ThrowIfNotReady(); + NativeMethods.core_magnitude_Mat(x.CvPtr, y.CvPtr, magnitude.CvPtr); + GC.KeepAlive(x); + GC.KeepAlive(y); + magnitude.Fix(); + } + #endregion + #region CheckRange + /// + /// checks that each matrix element is within the specified range. + /// + /// The array to check + /// The flag indicating whether the functions quietly + /// return false when the array elements are out of range, + /// or they throw an exception. + /// + public static bool CheckRange(InputArray src, bool quiet = true) + { + Point pos; + return CheckRange(src, quiet, out pos); + } + /// + /// checks that each matrix element is within the specified range. + /// + /// The array to check + /// The flag indicating whether the functions quietly + /// return false when the array elements are out of range, + /// or they throw an exception. + /// The optional output parameter, where the position of + /// the first outlier is stored. + /// The inclusive lower boundary of valid values range + /// The exclusive upper boundary of valid values range + /// + public static bool CheckRange(InputArray src, bool quiet, out Point pos, + double minVal = double.MinValue, double maxVal = double.MaxValue) + { + if (src == null) + throw new ArgumentNullException("src"); + src.ThrowIfDisposed(); + + int ret = NativeMethods.core_checkRange(src.CvPtr, quiet ? 1 : 0, out pos, minVal, maxVal); + GC.KeepAlive(src); + return ret != 0; + } + #endregion + #region PatchNaNs + /// + /// converts NaN's to the given number + /// + /// + /// + public static void PatchNaNs(InputOutputArray a, double val = 0) + { + if (a == null) + throw new ArgumentNullException("a"); + a.ThrowIfNotReady(); + NativeMethods.core_patchNaNs(a.CvPtr, val); + GC.KeepAlive(a); + } + #endregion + #region Gemm + /// + /// implements generalized matrix product algorithm GEMM from BLAS + /// + /// + /// + /// + /// + /// + /// + /// + public static void Gemm(InputArray src1, InputArray src2, double alpha, + InputArray src3, double gamma, OutputArray dst, GemmFlags flags = GemmFlags.None) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (src3 == null) + throw new ArgumentNullException("src3"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + src3.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_gemm(src1.CvPtr, src2.CvPtr, alpha, src3.CvPtr, gamma, dst.CvPtr, (int)flags); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + GC.KeepAlive(src3); + dst.Fix(); + } + #endregion + #region MulTransposed + /// + /// multiplies matrix by its transposition from the left or from the right + /// + /// The source matrix + /// The destination square matrix + /// Specifies the multiplication ordering; see the description below + /// The optional delta matrix, subtracted from src before the + /// multiplication. When the matrix is empty ( delta=Mat() ), it’s assumed to be + /// zero, i.e. nothing is subtracted, otherwise if it has the same size as src, + /// then it’s simply subtracted, otherwise it is "repeated" to cover the full src + /// and then subtracted. Type of the delta matrix, when it's not empty, must be the + /// same as the type of created destination matrix, see the rtype description + /// The optional scale factor for the matrix product + /// When it’s negative, the destination matrix will have the + /// same type as src . Otherwise, it will have type=CV_MAT_DEPTH(rtype), + /// which should be either CV_32F or CV_64F + public static void MulTransposed(InputArray src, OutputArray dst, bool aTa, + InputArray delta = null, double scale = 1, int dtype = -1) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_mulTransposed(src.CvPtr, dst.CvPtr, aTa ? 1 : 0 , ToPtr(delta), scale, dtype); + GC.KeepAlive(src); + GC.KeepAlive(delta); + dst.Fix(); + } + #endregion + #region Transpose + /// + /// transposes the matrix + /// + /// The source array + /// The destination array of the same type as src + public static void Transpose(InputArray src, OutputArray dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_transpose(src.CvPtr, dst.CvPtr); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region Transform + /// + /// performs affine transformation of each element of multi-channel input matrix + /// + /// The source array; must have as many channels (1 to 4) as mtx.cols or mtx.cols-1 + /// The destination array; will have the same size and depth as src and as many channels as mtx.rows + /// The transformation matrix + public static void Transform(InputArray src, OutputArray dst, InputArray m) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (m == null) + throw new ArgumentNullException("m"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + m.ThrowIfDisposed(); + NativeMethods.core_transform(src.CvPtr, dst.CvPtr, m.CvPtr); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region PerspectiveTransform + + /// + /// performs perspective transformation of each element of multi-channel input matrix + /// + /// The source two-channel or three-channel floating-point array; + /// each element is 2D/3D vector to be transformed + /// The destination array; it will have the same size and same type as src + /// 3x3 or 4x4 transformation matrix + public static void PerspectiveTransform(InputArray src, OutputArray dst, InputArray m) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (m == null) + throw new ArgumentNullException("m"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + m.ThrowIfDisposed(); + NativeMethods.core_perspectiveTransform(src.CvPtr, dst.CvPtr, m.CvPtr); + GC.KeepAlive(src); + dst.Fix(); + } + + /// + /// performs perspective transformation of each element of multi-channel input matrix + /// + /// The source two-channel or three-channel floating-point array; + /// each element is 2D/3D vector to be transformed + /// 3x3 or 4x4 transformation matrix + /// The destination array; it will have the same size and same type as src + public static Point2f[] PerspectiveTransform(IEnumerable src, Mat m) + { + if (src == null) + throw new ArgumentNullException("src"); + if (m == null) + throw new ArgumentNullException("m"); + + using (var srcMat = MatOfPoint2f.FromArray(src)) + using (var dstMat = new MatOfPoint2f()) + { + NativeMethods.core_perspectiveTransform_Mat(srcMat.CvPtr, dstMat.CvPtr, m.CvPtr); + return dstMat.ToArray(); + } + } + + /// + /// performs perspective transformation of each element of multi-channel input matrix + /// + /// The source two-channel or three-channel floating-point array; + /// each element is 2D/3D vector to be transformed + /// 3x3 or 4x4 transformation matrix + /// The destination array; it will have the same size and same type as src + public static Point2d[] PerspectiveTransform(IEnumerable src, Mat m) + { + if (src == null) + throw new ArgumentNullException("src"); + if (m == null) + throw new ArgumentNullException("m"); + + using (var srcMat = MatOfPoint2d.FromArray(src)) + using (var dstMat = new MatOfPoint2d()) + { + NativeMethods.core_perspectiveTransform_Mat(srcMat.CvPtr, dstMat.CvPtr, m.CvPtr); + return dstMat.ToArray(); + } + } + + /// + /// performs perspective transformation of each element of multi-channel input matrix + /// + /// The source two-channel or three-channel floating-point array; + /// each element is 2D/3D vector to be transformed + /// 3x3 or 4x4 transformation matrix + /// The destination array; it will have the same size and same type as src + public static Point3f[] PerspectiveTransform(IEnumerable src, Mat m) + { + if (src == null) + throw new ArgumentNullException("src"); + if (m == null) + throw new ArgumentNullException("m"); + + using (var srcMat = MatOfPoint3f.FromArray(src)) + using (var dstMat = new MatOfPoint3f()) + { + NativeMethods.core_perspectiveTransform_Mat(srcMat.CvPtr, dstMat.CvPtr, m.CvPtr); + return dstMat.ToArray(); + } + } + + /// + /// performs perspective transformation of each element of multi-channel input matrix + /// + /// The source two-channel or three-channel floating-point array; + /// each element is 2D/3D vector to be transformed + /// 3x3 or 4x4 transformation matrix + /// The destination array; it will have the same size and same type as src + public static Point3d[] PerspectiveTransform(IEnumerable src, Mat m) + { + if (src == null) + throw new ArgumentNullException("src"); + if (m == null) + throw new ArgumentNullException("m"); + + using (var srcMat = MatOfPoint3d.FromArray(src)) + using (var dstMat = new MatOfPoint3d()) + { + NativeMethods.core_perspectiveTransform_Mat(srcMat.CvPtr, dstMat.CvPtr, m.CvPtr); + return dstMat.ToArray(); + } + } + + #endregion + #region CompleteSymm + /// + /// extends the symmetrical matrix from the lower half or from the upper half + /// + /// Input-output floating-point square matrix + /// If true, the lower half is copied to the upper half, + /// otherwise the upper half is copied to the lower half + public static void CompleteSymm(InputOutputArray mtx, bool lowerToUpper = false) + { + if (mtx == null) + throw new ArgumentNullException("mtx"); + mtx.ThrowIfNotReady(); + NativeMethods.core_completeSymm(mtx.CvPtr, lowerToUpper ? 1 : 0); + mtx.Fix(); + } + #endregion + #region SetIdentity + /// + /// initializes scaled identity matrix + /// + /// The matrix to initialize (not necessarily square) + /// The value to assign to the diagonal elements + public static void SetIdentity(InputOutputArray mtx, Scalar? s = null) + { + if (mtx == null) + throw new ArgumentNullException("mtx"); + mtx.ThrowIfNotReady(); + Scalar s0 = s.GetValueOrDefault(new Scalar(1)); + NativeMethods.core_setIdentity(mtx.CvPtr, s0); + mtx.Fix(); + } + #endregion + #region Determinant + /// + /// computes determinant of a square matrix + /// + /// The input matrix; must have CV_32FC1 or CV_64FC1 type and square size + /// determinant of the specified matrix. + public static double Determinant(InputArray mtx) + { + if (mtx == null) + throw new ArgumentNullException("mtx"); + mtx.ThrowIfDisposed(); + var ret = NativeMethods.core_determinant(mtx.CvPtr); + GC.KeepAlive(mtx); + return ret; + } + #endregion + #region Trace + /// + /// computes trace of a matrix + /// + /// The source matrix + /// + public static Scalar Trace(InputArray mtx) + { + if (mtx == null) + throw new ArgumentNullException("mtx"); + mtx.ThrowIfDisposed(); + var ret = NativeMethods.core_trace(mtx.CvPtr); + GC.KeepAlive(mtx); + return ret; + } + #endregion + #region Invert + /// + /// computes inverse or pseudo-inverse matrix + /// + /// The source floating-point MxN matrix + /// The destination matrix; will have NxM size and the same type as src + /// The inversion method + /// + public static double Invert(InputArray src, OutputArray dst, + DecompTypes flags = DecompTypes.LU) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + double ret = NativeMethods.core_invert(src.CvPtr, dst.CvPtr, (int)flags); + GC.KeepAlive(src); + dst.Fix(); + return ret; + } + #endregion + #region Solve + /// + /// solves linear system or a least-square problem + /// + /// + /// + /// + /// + /// + public static bool Solve(InputArray src1, InputArray src2, OutputArray dst, + DecompTypes flags = DecompTypes.LU) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + int ret = NativeMethods.core_solve(src1.CvPtr, src2.CvPtr, dst.CvPtr, (int)flags); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + dst.Fix(); + return ret != 0; + } + #endregion + #region Sort + /// + /// sorts independently each matrix row or each matrix column + /// + /// The source single-channel array + /// The destination array of the same size and the same type as src + /// The operation flags, a combination of the SortFlag values + public static void Sort(InputArray src, OutputArray dst, SortFlags flags) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_sort(src.CvPtr, dst.CvPtr, (int)flags); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region SortIdx + /// + /// sorts independently each matrix row or each matrix column + /// + /// The source single-channel array + /// The destination integer array of the same size as src + /// The operation flags, a combination of SortFlag values + public static void SortIdx(InputArray src, OutputArray dst, SortFlags flags) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_sortIdx(src.CvPtr, dst.CvPtr, (int)flags); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region SolveCubic + /// + /// finds real roots of a cubic polynomial + /// + /// The equation coefficients, an array of 3 or 4 elements + /// The destination array of real roots which will have 1 or 3 elements + /// + public static int SolveCubic(InputArray coeffs, OutputArray roots) + { + if (coeffs == null) + throw new ArgumentNullException("coeffs"); + if (roots == null) + throw new ArgumentNullException("roots"); + coeffs.ThrowIfDisposed(); + roots.ThrowIfNotReady(); + int ret = NativeMethods.core_solveCubic(coeffs.CvPtr, roots.CvPtr); + GC.KeepAlive(coeffs); + roots.Fix(); + return ret; + } + #endregion + #region SolvePoly + /// + /// finds real and complex roots of a polynomial + /// + /// The array of polynomial coefficients + /// The destination (complex) array of roots + /// The maximum number of iterations the algorithm does + /// + public static double SolvePoly(InputArray coeffs, OutputArray roots, int maxIters = 300) + { + if (coeffs == null) + throw new ArgumentNullException("coeffs"); + if (roots == null) + throw new ArgumentNullException("roots"); + coeffs.ThrowIfDisposed(); + roots.ThrowIfNotReady(); + double ret = NativeMethods.core_solvePoly(coeffs.CvPtr, roots.CvPtr, maxIters); + GC.KeepAlive(coeffs); + roots.Fix(); + return ret; + } + #endregion + #region Eigen + + /// + /// Computes eigenvalues and eigenvectors of a symmetric matrix. + /// + /// The input matrix; must have CV_32FC1 or CV_64FC1 type, + /// square size and be symmetric: src^T == src + /// The output vector of eigenvalues of the same type as src; + /// The eigenvalues are stored in the descending order. + /// The output matrix of eigenvectors; + /// It will have the same size and the same type as src; The eigenvectors are stored + /// as subsequent matrix rows, in the same order as the corresponding eigenvalues + /// + public static bool Eigen(InputArray src, OutputArray eigenvalues, OutputArray eigenvectors) + { + if (src == null) + throw new ArgumentNullException("src"); + if (eigenvalues == null) + throw new ArgumentNullException("eigenvalues"); + if (eigenvectors == null) + throw new ArgumentNullException("eigenvectors"); + src.ThrowIfDisposed(); + eigenvalues.ThrowIfNotReady(); + eigenvectors.ThrowIfNotReady(); + int ret = NativeMethods.core_eigen(src.CvPtr, eigenvalues.CvPtr, eigenvectors.CvPtr); + eigenvalues.Fix(); + eigenvectors.Fix(); + GC.KeepAlive(src); + return ret != 0; + } + #endregion + #region CalcCovarMatrix + /// + /// computes covariation matrix of a set of samples + /// + /// + /// + /// + /// + public static void CalcCovarMatrix(Mat[] samples, Mat covar, Mat mean, CovarFlags flags) + { + CalcCovarMatrix(samples, covar, mean, flags, MatType.CV_64F); + } + + /// + /// computes covariation matrix of a set of samples + /// + /// + /// + /// + /// + /// + public static void CalcCovarMatrix(Mat[] samples, Mat covar, Mat mean, + CovarFlags flags, MatType ctype) + { + if (samples == null) + throw new ArgumentNullException("samples"); + if (covar == null) + throw new ArgumentNullException("covar"); + if (mean == null) + throw new ArgumentNullException("mean"); + covar.ThrowIfDisposed(); + mean.ThrowIfDisposed(); + IntPtr[] samplesPtr = EnumerableEx.SelectPtrs(samples); + NativeMethods.core_calcCovarMatrix_Mat(samplesPtr, samples.Length, covar.CvPtr, mean.CvPtr, (int)flags, ctype); + GC.KeepAlive(samples); + GC.KeepAlive(covar); + GC.KeepAlive(mean); + } + + /// + /// computes covariation matrix of a set of samples + /// + /// + /// + /// + /// + public static void CalcCovarMatrix(InputArray samples, OutputArray covar, + InputOutputArray mean, CovarFlags flags) + { + CalcCovarMatrix(samples, covar, mean, flags, MatType.CV_64F); + } + + /// + /// computes covariation matrix of a set of samples + /// + /// + /// + /// + /// + /// + public static void CalcCovarMatrix(InputArray samples, OutputArray covar, + InputOutputArray mean, CovarFlags flags, MatType ctype) + { + if (samples == null) + throw new ArgumentNullException("samples"); + if (covar == null) + throw new ArgumentNullException("covar"); + if (mean == null) + throw new ArgumentNullException("mean"); + samples.ThrowIfDisposed(); + covar.ThrowIfNotReady(); + mean.ThrowIfNotReady(); + NativeMethods.core_calcCovarMatrix_InputArray(samples.CvPtr, covar.CvPtr, mean.CvPtr, (int)flags, ctype); + GC.KeepAlive(samples); + covar.Fix(); + mean.Fix(); + } + #endregion + + #region PCA + /// + /// PCA of the supplied dataset. + /// + /// input samples stored as the matrix rows or as the matrix columns. + /// optional mean value; if the matrix is empty (noArray()), the mean is computed from the data. + /// + /// maximum number of components that PCA should + /// retain; by default, all the components are retained. + public static void PCACompute(InputArray data, InputOutputArray mean, + OutputArray eigenvectors, int maxComponents = 0) + { + if (data == null) + throw new ArgumentNullException("data"); + if (mean == null) + throw new ArgumentNullException("mean"); + if (eigenvectors == null) + throw new ArgumentNullException("eigenvectors"); + data.ThrowIfDisposed(); + mean.ThrowIfNotReady(); + eigenvectors.ThrowIfNotReady(); + NativeMethods.core_PCACompute(data.CvPtr, mean.CvPtr, eigenvectors.CvPtr, maxComponents); + GC.KeepAlive(data); + mean.Fix(); + eigenvectors.Fix(); + } + /// + /// + /// + /// + /// + /// + /// + public static void PCAComputeVar(InputArray data, InputOutputArray mean, + OutputArray eigenvectors, double retainedVariance) + { + if (data == null) + throw new ArgumentNullException("data"); + if (mean == null) + throw new ArgumentNullException("mean"); + if (eigenvectors == null) + throw new ArgumentNullException("eigenvectors"); + data.ThrowIfDisposed(); + mean.ThrowIfNotReady(); + eigenvectors.ThrowIfNotReady(); + NativeMethods.core_PCAComputeVar(data.CvPtr, mean.CvPtr, eigenvectors.CvPtr, retainedVariance); + GC.KeepAlive(data); + mean.Fix(); + eigenvectors.Fix(); + } + /// + /// + /// + /// + /// + /// + /// + public static void PCAProject(InputArray data, InputArray mean, + InputArray eigenvectors, OutputArray result) + { + if (data == null) + throw new ArgumentNullException("data"); + if (mean == null) + throw new ArgumentNullException("mean"); + if (eigenvectors == null) + throw new ArgumentNullException("eigenvectors"); + if (result == null) + throw new ArgumentNullException("result"); + data.ThrowIfDisposed(); + mean.ThrowIfDisposed(); + eigenvectors.ThrowIfDisposed(); + result.ThrowIfNotReady(); + NativeMethods.core_PCAProject(data.CvPtr, mean.CvPtr, eigenvectors.CvPtr, result.CvPtr); + GC.KeepAlive(data); + GC.KeepAlive(mean); + result.Fix(); + } + /// + /// + /// + /// + /// + /// + /// + public static void PCABackProject(InputArray data, InputArray mean, + InputArray eigenvectors, OutputArray result) + { + if (data == null) + throw new ArgumentNullException("data"); + if (mean == null) + throw new ArgumentNullException("mean"); + if (eigenvectors == null) + throw new ArgumentNullException("eigenvectors"); + if (result == null) + throw new ArgumentNullException("result"); + data.ThrowIfDisposed(); + mean.ThrowIfDisposed(); + eigenvectors.ThrowIfDisposed(); + result.ThrowIfNotReady(); + NativeMethods.core_PCABackProject(data.CvPtr, mean.CvPtr, eigenvectors.CvPtr, result.CvPtr); + GC.KeepAlive(data); + GC.KeepAlive(mean); + GC.KeepAlive(eigenvectors); + result.Fix(); + } + #endregion + #region SVD + /// + /// computes SVD of src + /// + /// + /// + /// + /// + /// +// ReSharper disable once InconsistentNaming + public static void SVDecomp(InputArray src, OutputArray w, + OutputArray u, OutputArray vt, SVD.Flags flags = SVD.Flags.None) + { + if (src == null) + throw new ArgumentNullException("src"); + if (w == null) + throw new ArgumentNullException("w"); + if (u == null) + throw new ArgumentNullException("u"); + if (vt == null) + throw new ArgumentNullException("vt"); + src.ThrowIfDisposed(); + w.ThrowIfNotReady(); + u.ThrowIfNotReady(); + vt.ThrowIfNotReady(); + NativeMethods.core_SVDecomp(src.CvPtr, w.CvPtr, u.CvPtr, vt.CvPtr, (int)flags); + w.Fix(); + u.Fix(); + vt.Fix(); + } + + /// + /// performs back substitution for the previously computed SVD + /// + /// + /// + /// + /// + /// +// ReSharper disable once InconsistentNaming + public static void SVBackSubst(InputArray w, InputArray u, InputArray vt, + InputArray rhs, OutputArray dst) + { + if (w == null) + throw new ArgumentNullException("w"); + if (u == null) + throw new ArgumentNullException("u"); + if (vt == null) + throw new ArgumentNullException("vt"); + if (rhs == null) + throw new ArgumentNullException("rhs"); + if (dst == null) + throw new ArgumentNullException("dst"); + w.ThrowIfDisposed(); + u.ThrowIfDisposed(); + vt.ThrowIfDisposed(); + rhs.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_SVBackSubst(w.CvPtr, u.CvPtr, vt.CvPtr, rhs.CvPtr, dst.CvPtr); + dst.Fix(); + } + #endregion + + #region Mahalanobis/Mahalonobis + /// + /// + /// + /// + /// + /// + /// + public static double Mahalanobis(InputArray v1, InputArray v2, InputArray icovar) + { + if (v1 == null) + throw new ArgumentNullException("v1"); + if (v2 == null) + throw new ArgumentNullException("v2"); + if (icovar == null) + throw new ArgumentNullException("icovar"); + v1.ThrowIfDisposed(); + v2.ThrowIfDisposed(); + icovar.ThrowIfDisposed(); + return NativeMethods.core_Mahalanobis(v1.CvPtr, v2.CvPtr, icovar.CvPtr); + } + /// + /// computes Mahalanobis distance between two vectors: sqrt((v1-v2)'*icovar*(v1-v2)), where icovar is the inverse covariation matrix + /// + /// + /// + /// + /// + public static double Mahalonobis(InputArray v1, InputArray v2, InputArray icovar) + { + return Mahalanobis(v1, v2, icovar); + } + #endregion + #region Dft/Idft + /// + /// Performs a forward Discrete Fourier transform of 1D or 2D floating-point array. + /// + /// The source array, real or complex + /// The destination array, which size and type depends on the flags + /// Transformation flags, a combination of the DftFlag2 values + /// When the parameter != 0, the function assumes that + /// only the first nonzeroRows rows of the input array ( DFT_INVERSE is not set) + /// or only the first nonzeroRows of the output array ( DFT_INVERSE is set) contain non-zeros, + /// thus the function can handle the rest of the rows more efficiently and + /// thus save some time. This technique is very useful for computing array cross-correlation + /// or convolution using DFT + public static void Dft(InputArray src, OutputArray dst, DftFlags flags = DftFlags.None, int nonzeroRows = 0) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_dft(src.CvPtr, dst.CvPtr, (int)flags, nonzeroRows); + GC.KeepAlive(src); + dst.Fix(); + } + + /// + /// Performs an inverse Discrete Fourier transform of 1D or 2D floating-point array. + /// + /// The source array, real or complex + /// The destination array, which size and type depends on the flags + /// Transformation flags, a combination of the DftFlag2 values + /// When the parameter != 0, the function assumes that + /// only the first nonzeroRows rows of the input array ( DFT_INVERSE is not set) + /// or only the first nonzeroRows of the output array ( DFT_INVERSE is set) contain non-zeros, + /// thus the function can handle the rest of the rows more efficiently and + /// thus save some time. This technique is very useful for computing array cross-correlation + /// or convolution using DFT + public static void Idft(InputArray src, OutputArray dst, DftFlags flags = DftFlags.None, int nonzeroRows = 0) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_idft(src.CvPtr, dst.CvPtr, (int)flags, nonzeroRows); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region Dct/Idct + /// + /// Performs forward or inverse 1D or 2D Discrete Cosine Transformation + /// + /// The source floating-point array + /// The destination array; will have the same size and same type as src + /// Transformation flags, a combination of DctFlag2 values + public static void Dct(InputArray src, OutputArray dst, DctFlags flags = DctFlags.None) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_dct(src.CvPtr, dst.CvPtr, (int)flags); + GC.KeepAlive(src); + dst.Fix(); + } + + /// + /// Performs inverse 1D or 2D Discrete Cosine Transformation + /// + /// The source floating-point array + /// The destination array; will have the same size and same type as src + /// Transformation flags, a combination of DctFlag2 values + public static void Idct(InputArray src, OutputArray dst, DctFlags flags = DctFlags.None) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_idct(src.CvPtr, dst.CvPtr, (int)flags); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region MulSpectrums + /// + /// computes element-wise product of the two Fourier spectrums. The second spectrum can optionally be conjugated before the multiplication + /// + /// + /// + /// + /// + /// + public static void MulSpectrums( + InputArray a, InputArray b, OutputArray c, + DftFlags flags, bool conjB = false) + { + if (a == null) + throw new ArgumentNullException("a"); + if (b == null) + throw new ArgumentNullException("b"); + if (c == null) + throw new ArgumentNullException("c"); + a.ThrowIfDisposed(); + b.ThrowIfDisposed(); + c.ThrowIfNotReady(); + NativeMethods.core_mulSpectrums(a.CvPtr, b.CvPtr, c.CvPtr, (int)flags, conjB ? 1 : 0); + GC.KeepAlive(a); + GC.KeepAlive(b); + c.Fix(); + } + #endregion + #region GetOptimalDFTSize + /// + /// computes the minimal vector size vecsize1 >= vecsize so that the dft() of the vector of length vecsize1 can be computed efficiently + /// + /// + /// + public static int GetOptimalDFTSize(int vecsize) + { + return NativeMethods.core_getOptimalDFTSize(vecsize); + } + #endregion + #region Kmeans + /// + /// clusters the input data using k-Means algorithm + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static double Kmeans(InputArray data, int k, InputOutputArray bestLabels, + TermCriteria criteria, int attempts, KMeansFlags flags, OutputArray centers = null) + { + if (data == null) + throw new ArgumentNullException("data"); + if (bestLabels == null) + throw new ArgumentNullException("bestLabels"); + data.ThrowIfDisposed(); + bestLabels.ThrowIfDisposed(); + double ret = NativeMethods.core_kmeans(data.CvPtr, k, bestLabels.CvPtr, criteria, attempts, (int)flags, ToPtr(centers)); + bestLabels.Fix(); + if(centers != null) + centers.Fix(); + GC.KeepAlive(data); + return ret; + } + #endregion + #region TheRNG + /// + /// returns the thread-local Random number generator + /// + /// + public static RNG TheRNG() + { + ulong state = NativeMethods.core_theRNG(); + return new RNG(state); + } + #endregion + #region Randu + /// + /// fills array with uniformly-distributed random numbers from the range [low, high) + /// + /// The output array of random numbers. + /// The array must be pre-allocated and have 1 to 4 channels + /// The inclusive lower boundary of the generated random numbers + /// The exclusive upper boundary of the generated random numbers + public static void Randu(InputOutputArray dst, InputArray low, InputArray high) + { + if (dst == null) + throw new ArgumentNullException("dst"); + if (low == null) + throw new ArgumentNullException("low"); + if (high == null) + throw new ArgumentNullException("high"); + dst.ThrowIfNotReady(); + low.ThrowIfDisposed(); + high.ThrowIfDisposed(); + NativeMethods.core_randu_InputArray(dst.CvPtr, low.CvPtr, high.CvPtr); + GC.KeepAlive(low); + GC.KeepAlive(high); + dst.Fix(); + } + + /// + /// fills array with uniformly-distributed random numbers from the range [low, high) + /// + /// The output array of random numbers. + /// The array must be pre-allocated and have 1 to 4 channels + /// The inclusive lower boundary of the generated random numbers + /// The exclusive upper boundary of the generated random numbers + public static void Randu(InputOutputArray dst, Scalar low, Scalar high) + { + if (dst == null) + throw new ArgumentNullException("dst"); + dst.ThrowIfNotReady(); + NativeMethods.core_randu_Scalar(dst.CvPtr, low, high); + GC.KeepAlive(low); + GC.KeepAlive(high); + dst.Fix(); + } + #endregion + #region Randn + /// + /// fills array with normally-distributed random numbers with the specified mean and the standard deviation + /// + /// The output array of random numbers. + /// The array must be pre-allocated and have 1 to 4 channels + /// The mean value (expectation) of the generated random numbers + /// The standard deviation of the generated random numbers + public static void Randn(InputOutputArray dst, InputArray mean, InputArray stddev) + { + if (dst == null) + throw new ArgumentNullException("dst"); + if (mean == null) + throw new ArgumentNullException("mean"); + if (stddev == null) + throw new ArgumentNullException("stddev"); + dst.ThrowIfNotReady(); + mean.ThrowIfDisposed(); + stddev.ThrowIfDisposed(); + NativeMethods.core_randn_InputArray(dst.CvPtr, mean.CvPtr, stddev.CvPtr); + GC.KeepAlive(mean); + GC.KeepAlive(stddev); + dst.Fix(); + } + + /// + /// fills array with normally-distributed random numbers with the specified mean and the standard deviation + /// + /// The output array of random numbers. + /// The array must be pre-allocated and have 1 to 4 channels + /// The mean value (expectation) of the generated random numbers + /// The standard deviation of the generated random numbers + public static void Randn(InputOutputArray dst, Scalar mean, Scalar stddev) + { + if (dst == null) + throw new ArgumentNullException("dst"); + dst.ThrowIfNotReady(); + NativeMethods.core_randn_Scalar(dst.CvPtr, mean, stddev); + dst.Fix(); + } + #endregion + #region RandShuffle + /// + /// shuffles the input array elements + /// + /// The input/output numerical 1D array + /// The scale factor that determines the number of random swap operations. + /// The optional random number generator used for shuffling. + /// If it is null, theRng() is used instead. + public static void RandShuffle(InputOutputArray dst, double iterFactor, RNG rng = null) + { + if (dst == null) + throw new ArgumentNullException("dst"); + dst.ThrowIfNotReady(); + + if (rng == null) + { + NativeMethods.core_randShuffle(dst.CvPtr, iterFactor, IntPtr.Zero); + } + else + { + ulong state = rng.State; + NativeMethods.core_randShuffle(dst.CvPtr, iterFactor, ref state); + rng.State = state; + } + dst.Fix(); + } + #endregion + } +} diff --git a/src/OpenCvSharp/Cv2/Cv2_cuda.cs b/src/OpenCvSharp/Cv2/Cv2_cuda.cs new file mode 100644 index 000000000..f08caa4cc --- /dev/null +++ b/src/OpenCvSharp/Cv2/Cv2_cuda.cs @@ -0,0 +1,227 @@ +using System; +using System.Collections.Generic; + +namespace OpenCvSharp.Gpu +{ + /// + /// Functions of OpenCV GPU module + /// + public static class Cv2Gpu + { + #region Hardware + +#if LANG_JP + /// + /// CUDAを利用可能なデバイスの個数を返します. + /// 最初のGPU関数呼び出しよりも前に利用しなければいけません. + /// OpenCVがGPUサポートなしでコンパイルされていれば,この関数は0を返します. + /// + /// +#else + /// + /// Returns the number of installed CUDA-enabled devices. + /// Use this function before any other GPU functions calls. + /// If OpenCV is compiled without GPU support, this function returns 0. + /// + /// +#endif + public static int GetCudaEnabledDeviceCount() + { + return NativeMethods.cuda_getCudaEnabledDeviceCount(); + } + +#if LANG_JP + /// + /// 現在のデバイスインデックスを返します. + /// これは,SetDevice によって設定された,またはデフォルトで初期化されたデバイスです. + /// + /// +#else + /// + /// Returns the current device index set by SetDevice() or initialized by default. + /// + /// +#endif + public static int GetDevice() + { + ThrowIfGpuNotAvailable(); + return NativeMethods.cuda_getDevice(); + } + +#if LANG_JP + /// + /// 現在のスレッドでデバイスを設定し,それを初期化します. + /// この関数呼び出しを省略することもできますが,その場合, + /// 最初に GPU が利用される際にデフォルトデバイスが初期化されます. + /// + /// 0からはじまる,GPUデバイスのインデックス. + /// +#else + /// + /// Sets a device and initializes it for the current thread. + /// + /// System index of a GPU device starting with 0. + /// +#endif + public static int SetDevice(int device) + { + ThrowIfGpuNotAvailable(); + return NativeMethods.cuda_getDevice(); + } + + /// + /// Explicitly destroys and cleans up all resources associated with the current device in the current process. + /// Any subsequent API call to this device will reinitialize the device. + /// + public static void ResetDevice() + { + ThrowIfGpuNotAvailable(); + NativeMethods.cuda_resetDevice(); + } + + /// + /// + /// + /// + public static void PrintCudaDeviceInfo(int device) + { + ThrowIfGpuNotAvailable(); + NativeMethods.cuda_printCudaDeviceInfo(device); + } + + /// + /// + /// + /// + public static void PrintShortCudaDeviceInfo(int device) + { + ThrowIfGpuNotAvailable(); + NativeMethods.cuda_printShortCudaDeviceInfo(device); + } + + #endregion + + #region CudaMem + + /// + /// Page-locks the matrix m memory and maps it for the device(s) + /// + /// + public static void RegisterPageLocked(Mat m) + { + ThrowIfGpuNotAvailable(); + if (m == null) + throw new ArgumentNullException("m"); + NativeMethods.cuda_registerPageLocked(m.CvPtr); + } + + /// + /// Unmaps the memory of matrix m, and makes it pageable again. + /// + /// + public static void UnregisterPageLocked(Mat m) + { + ThrowIfGpuNotAvailable(); + if (m == null) + throw new ArgumentNullException("m"); + NativeMethods.cuda_unregisterPageLocked(m.CvPtr); + } + + #endregion + + #region GpuMat + + /// + /// Creates continuous GPU matrix + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Array type. + /// + public static void CreateContinuous(int rows, int cols, MatType type, GpuMat m) + { + ThrowIfGpuNotAvailable(); + if (m == null) + throw new ArgumentNullException("m"); + NativeMethods.cuda_createContinuous1(rows, cols, type, m.CvPtr); + } + + /// + /// Creates continuous GPU matrix + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Array type. + /// + public static GpuMat CreateContinuous(int rows, int cols, MatType type) + { + ThrowIfGpuNotAvailable(); + IntPtr ret = NativeMethods.cuda_createContinuous2(rows, cols, type); + return new GpuMat(ret); + } + + /// + /// Creates continuous GPU matrix + /// + /// Number of rows and columns in a 2D array. + /// Array type. + /// + public static void CreateContinuous(Size size, MatType type, GpuMat m) + { + ThrowIfGpuNotAvailable(); + CreateContinuous(size.Height, size.Width, type, m); + } + + /// + /// Creates continuous GPU matrix + /// + /// Number of rows and columns in a 2D array. + /// Array type. + /// + public static GpuMat CreateContinuous(Size size, MatType type) + { + ThrowIfGpuNotAvailable(); + return CreateContinuous(size.Height, size.Width, type); + } + + /// + /// Ensures that size of the given matrix is not less than (rows, cols) size + /// and matrix type is match specified one too + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Array type. + /// + public static void EnsureSizeIsEnough(int rows, int cols, MatType type, GpuMat m) + { + ThrowIfGpuNotAvailable(); + if (m == null) + throw new ArgumentNullException("m"); + NativeMethods.cuda_ensureSizeIsEnough(rows, cols, type, m.CvPtr); + } + + /// + /// Ensures that size of the given matrix is not less than (rows, cols) size + /// and matrix type is match specified one too + /// + /// Number of rows and columns in a 2D array. + /// Array type. + /// + public static void EnsureSizeIsEnough(Size size, MatType type, GpuMat m) + { + ThrowIfGpuNotAvailable(); + EnsureSizeIsEnough(size.Height, size.Width, type, m); + } + + #endregion + + /// + /// + /// + public static void ThrowIfGpuNotAvailable() + { + if (GetCudaEnabledDeviceCount() < 1) + throw new OpenCvSharpException("GPU module cannot be used."); + } + } +} diff --git a/src/OpenCvSharp/Cv2/Cv2_face.cs b/src/OpenCvSharp/Cv2/Cv2_face.cs new file mode 100644 index 000000000..482c71b89 --- /dev/null +++ b/src/OpenCvSharp/Cv2/Cv2_face.cs @@ -0,0 +1,10 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + static partial class Cv2 + { + } +} diff --git a/src/OpenCvSharp/Cv2/Cv2_features2d.cs b/src/OpenCvSharp/Cv2/Cv2_features2d.cs new file mode 100644 index 000000000..a7a0801b9 --- /dev/null +++ b/src/OpenCvSharp/Cv2/Cv2_features2d.cs @@ -0,0 +1,330 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +// ReSharper disable InconsistentNaming + +namespace OpenCvSharp +{ + static partial class Cv2 + { + /// + /// Detects corners using the FAST algorithm + /// + /// grayscale image where keypoints (corners) are detected. + /// threshold on difference between intensity of the central pixel + /// and pixels of a circle around this pixel. + /// if true, non-maximum suppression is applied to + /// detected corners (keypoints). + /// keypoints detected on the image. + public static KeyPoint[] FAST(InputArray image, int threshold, bool nonmaxSupression = true) + { + if (image == null) + throw new ArgumentNullException("image"); + image.ThrowIfDisposed(); + + using (var kp = new VectorOfKeyPoint()) + { + NativeMethods.features2d_FAST1(image.CvPtr, kp.CvPtr, threshold, nonmaxSupression ? 1 : 0); + GC.KeepAlive(image); + return kp.ToArray(); + } + } + + /// + /// Detects corners using the FAST algorithm + /// + /// grayscale image where keypoints (corners) are detected. + /// threshold on difference between intensity of the central pixel + /// and pixels of a circle around this pixel. + /// if true, non-maximum suppression is applied to + /// detected corners (keypoints). + /// one of the three neighborhoods as defined in the paper + /// keypoints detected on the image. + public static KeyPoint[] FAST(InputArray image, int threshold, bool nonmaxSupression, FASTType type) + { + if (image == null) + throw new ArgumentNullException("image"); + image.ThrowIfDisposed(); + + using (var kp = new VectorOfKeyPoint()) + { + NativeMethods.features2d_FAST2(image.CvPtr, kp.CvPtr, threshold, nonmaxSupression ? 1 : 0, (int)type); + GC.KeepAlive(image); + return kp.ToArray(); + } + } + + /// + /// Detects corners using the AGAST algorithm + /// + /// grayscale image where keypoints (corners) are detected. + /// threshold on difference between intensity of the central pixel + /// and pixels of a circle around this pixel. + /// if true, non-maximum suppression is applied to + /// detected corners (keypoints). + /// one of the four neighborhoods as defined in the paper + /// keypoints detected on the image. + public static KeyPoint[] AGAST(InputArray image, int threshold, bool nonmaxSuppression, AGASTType type) + { + if (image == null) + throw new ArgumentNullException("image"); + image.ThrowIfDisposed(); + + using (var vector = new VectorOfKeyPoint()) + { + NativeMethods.features2d_AGAST(image.CvPtr, vector.CvPtr, threshold, nonmaxSuppression ? 1 : 0, + (int) type); + GC.KeepAlive(image); + return vector.ToArray(); + } + } + + /// + /// Draw keypoints. + /// + /// + /// + /// + /// + /// + public static void DrawKeypoints(Mat image, IEnumerable keypoints, Mat outImage, + Scalar? color = null, DrawMatchesFlags flags = DrawMatchesFlags.Default) + { + if (image == null) + throw new ArgumentNullException("image"); + if (outImage == null) + throw new ArgumentNullException("outImage"); + if (keypoints == null) + throw new ArgumentNullException("keypoints"); + image.ThrowIfDisposed(); + outImage.ThrowIfDisposed(); + + KeyPoint[] keypointsArray = EnumerableEx.ToArray(keypoints); + Scalar color0 = color.GetValueOrDefault(Scalar.All(-1)); + NativeMethods.features2d_drawKeypoints(image.CvPtr, keypointsArray, keypointsArray.Length, + outImage.CvPtr, color0, (int)flags); + } + + /// + /// Draws matches of keypints from two images on output image. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static void DrawMatches(Mat img1, IEnumerable keypoints1, + Mat img2, IEnumerable keypoints2, + IEnumerable matches1To2, Mat outImg, + Scalar? matchColor = null, Scalar? singlePointColor = null, + IEnumerable matchesMask = null, DrawMatchesFlags flags = DrawMatchesFlags.Default) + { + if (img1 == null) + throw new ArgumentNullException("img1"); + if (img2 == null) + throw new ArgumentNullException("img2"); + if (outImg == null) + throw new ArgumentNullException("outImg"); + if (keypoints1 == null) + throw new ArgumentNullException("keypoints1"); + if (keypoints2 == null) + throw new ArgumentNullException("keypoints2"); + if (matches1To2 == null) + throw new ArgumentNullException("matches1To2"); + img1.ThrowIfDisposed(); + img2.ThrowIfDisposed(); + outImg.ThrowIfDisposed(); + + KeyPoint[] keypoints1Array = EnumerableEx.ToArray(keypoints1); + KeyPoint[] keypoints2Array = EnumerableEx.ToArray(keypoints2); + DMatch[] matches1To2Array = EnumerableEx.ToArray(matches1To2); + Scalar matchColor0 = matchColor.GetValueOrDefault(Scalar.All(-1)); + Scalar singlePointColor0 = singlePointColor.GetValueOrDefault(Scalar.All(-1)); + + byte[] matchesMaskArray = null; + int matchesMaskLength = 0; + if (matchesMask != null) + { + matchesMaskArray = EnumerableEx.ToArray(matchesMask); + matchesMaskLength = matchesMaskArray.Length; + } + + NativeMethods.features2d_drawMatches1(img1.CvPtr, keypoints1Array, keypoints1Array.Length, + img2.CvPtr, keypoints2Array, keypoints2Array.Length, + matches1To2Array, matches1To2Array.Length, outImg.CvPtr, + matchColor0, singlePointColor0, matchesMaskArray, matchesMaskLength, (int)flags); + } + + /// + /// Draws matches of keypints from two images on output image. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static void DrawMatches(Mat img1, IEnumerable keypoints1, + Mat img2, IEnumerable keypoints2, + IEnumerable> matches1To2, Mat outImg, + Scalar? matchColor = null, Scalar? singlePointColor = null, + IEnumerable> matchesMask = null, + DrawMatchesFlags flags = DrawMatchesFlags.Default) + { + if (img1 == null) + throw new ArgumentNullException("img1"); + if (img2 == null) + throw new ArgumentNullException("img2"); + if (outImg == null) + throw new ArgumentNullException("outImg"); + if (keypoints1 == null) + throw new ArgumentNullException("keypoints1"); + if (keypoints2 == null) + throw new ArgumentNullException("keypoints2"); + if (matches1To2 == null) + throw new ArgumentNullException("matches1To2"); + img1.ThrowIfDisposed(); + img2.ThrowIfDisposed(); + outImg.ThrowIfDisposed(); + + KeyPoint[] keypoints1Array = EnumerableEx.ToArray(keypoints1); + KeyPoint[] keypoints2Array = EnumerableEx.ToArray(keypoints2); + DMatch[][] matches1To2Array = EnumerableEx.SelectToArray(matches1To2, EnumerableEx.ToArray); + int matches1To2Size1 = matches1To2Array.Length; + int[] matches1To2Size2 = EnumerableEx.SelectToArray(matches1To2Array, dm => dm.Length); + Scalar matchColor0 = matchColor.GetValueOrDefault(Scalar.All(-1)); + Scalar singlePointColor0 = singlePointColor.GetValueOrDefault(Scalar.All(-1)); + + using (var matches1To2Ptr = new ArrayAddress2(matches1To2Array)) + { + if (matchesMask == null) + { + NativeMethods.features2d_drawMatches2(img1.CvPtr, keypoints1Array, keypoints1Array.Length, + img2.CvPtr, keypoints2Array, keypoints2Array.Length, + matches1To2Ptr, matches1To2Size1, matches1To2Size2, + outImg.CvPtr, matchColor0, singlePointColor0, + null, 0, null, (int)flags); + } + else + { + byte[][] matchesMaskArray = EnumerableEx.SelectToArray(matchesMask, EnumerableEx.ToArray); + int matchesMaskSize1 = matches1To2Array.Length; + int[] matchesMaskSize2 = EnumerableEx.SelectToArray(matchesMaskArray, dm => dm.Length); + using (var matchesMaskPtr = new ArrayAddress2(matchesMaskArray)) + { + NativeMethods.features2d_drawMatches2(img1.CvPtr, keypoints1Array, keypoints1Array.Length, + img2.CvPtr, keypoints2Array, keypoints2Array.Length, + matches1To2Ptr.Pointer, matches1To2Size1, matches1To2Size2, + outImg.CvPtr, matchColor0, singlePointColor0, + matchesMaskPtr, matchesMaskSize1, matchesMaskSize2, (int)flags); + } + } + } + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static void EvaluateFeatureDetector( + Mat img1, Mat img2, Mat H1to2, + ref KeyPoint[] keypoints1, ref KeyPoint[] keypoints2, + out float repeatability, out int correspCount) + { + if (img1 == null) + throw new ArgumentNullException("img1"); + if (img2 == null) + throw new ArgumentNullException("img2"); + if (H1to2 == null) + throw new ArgumentNullException("H1to2"); + if (keypoints1 == null) + throw new ArgumentNullException("keypoints1"); + if (keypoints2 == null) + throw new ArgumentNullException("keypoints2"); + + using (var keypoints1Vec = new VectorOfKeyPoint(keypoints1)) + using (var keypoints2Vec = new VectorOfKeyPoint(keypoints2)) + { + NativeMethods.features2d_evaluateFeatureDetector( + img1.CvPtr, img2.CvPtr, H1to2.CvPtr, + keypoints1Vec.CvPtr, keypoints2Vec.CvPtr, + out repeatability, out correspCount); + keypoints1 = keypoints1Vec.ToArray(); + keypoints2 = keypoints2Vec.ToArray(); + } + } + + /// + /// + /// + /// + /// + /// recallPrecisionCurve + public static Point2f[] ComputeRecallPrecisionCurve( + DMatch[][] matches1to2, byte[][] correctMatches1to2Mask) + { + if (matches1to2 == null) + throw new ArgumentNullException("matches1to2"); + if (correctMatches1to2Mask == null) + throw new ArgumentNullException("correctMatches1to2Mask"); + + using (var dm = new ArrayAddress2(matches1to2)) + using (var cm = new ArrayAddress2(correctMatches1to2Mask)) + using (var recall = new VectorOfPoint2f()) + { + NativeMethods.features2d_computeRecallPrecisionCurve( + dm.Pointer, dm.Dim1Length, dm.Dim2Lengths, + cm.Pointer, cm.Dim1Length, cm.Dim2Lengths, + recall.CvPtr); + return recall.ToArray(); + } + } + + /// + /// + /// + /// + /// + /// + public static float GetRecall( + IEnumerable recallPrecisionCurve, float lPrecision) + { + if (recallPrecisionCurve == null) + throw new ArgumentNullException("recallPrecisionCurve"); + + var array = EnumerableEx.ToArray(recallPrecisionCurve); + return NativeMethods.features2d_getRecall(array, array.Length, lPrecision); + } + + /// + /// + /// + /// + /// + /// + public static int GetNearestPoint( + IEnumerable recallPrecisionCurve, float lPrecision) + { + if (recallPrecisionCurve == null) + throw new ArgumentNullException("recallPrecisionCurve"); + var array = EnumerableEx.ToArray(recallPrecisionCurve); + return NativeMethods.features2d_getNearestPoint(array, array.Length, lPrecision); + } + } +} diff --git a/src/OpenCvSharp/Cv2/Cv2_highgui.cs b/src/OpenCvSharp/Cv2/Cv2_highgui.cs new file mode 100644 index 000000000..84c113f56 --- /dev/null +++ b/src/OpenCvSharp/Cv2/Cv2_highgui.cs @@ -0,0 +1,199 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + static partial class Cv2 + { + /// + /// Creates a window. + /// + /// Name of the window in the window caption that may be used as a window identifier. + public static void NamedWindow(string winname) + { + NamedWindow(winname, WindowMode.Normal); + } + + /// + /// Creates a window. + /// + /// Name of the window in the window caption that may be used as a window identifier. + /// + /// Flags of the window. Currently the only supported flag is CV WINDOW AUTOSIZE. If this is set, + /// the window size is automatically adjusted to fit the displayed image (see imshow ), and the user can not change the window size manually. + /// + public static void NamedWindow(string winname, WindowMode flags) + { + if (string.IsNullOrEmpty(winname)) + throw new ArgumentNullException("winname"); + try + { + NativeMethods.highgui_namedWindow(winname, (int) flags); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + + /// + /// + /// + /// + public static void DestroyWindow(string winName) + { + if (String.IsNullOrEmpty("winName")) + throw new ArgumentNullException("winName"); + NativeMethods.highgui_destroyWindow(winName); + } + + /// + /// + /// + public static void DestroyAllWindows() + { + NativeMethods.highgui_destroyAllWindows(); + } + + /// + /// Displays the image in the specified window + /// + /// Name of the window. + /// Image to be shown. + public static void ImShow(string winname, Mat mat) + { + if (string.IsNullOrEmpty(winname)) + throw new ArgumentNullException("winname"); + if (mat == null) + throw new ArgumentNullException("mat"); + try + { + NativeMethods.highgui_imshow(winname, mat.CvPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + + /// + /// + /// + /// + public static int StartWindowThread() + { + return NativeMethods.highgui_startWindowThread(); + } + + /// + /// Waits for a pressed key. + /// + /// Delay in milliseconds. 0 is the special value that means ”forever” + /// Returns the code of the pressed key or -1 if no key was pressed before the specified time had elapsed. + public static int WaitKey(int delay = 0) + { + try + { + return NativeMethods.highgui_waitKey(delay); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + + /// + /// Resizes window to the specified size + /// + /// Window name + /// The new window width + /// The new window height + public static void ResizeWindow(string winName, int width, int height) + { + if (String.IsNullOrEmpty(winName)) + throw new ArgumentNullException("winName"); + NativeMethods.highgui_resizeWindow(winName, width, height); + } + + /// + /// Moves window to the specified position + /// + /// Window name + /// The new x-coordinate of the window + /// The new y-coordinate of the window + public static void MoveWindow(string winName, int x, int y) + { + if (String.IsNullOrEmpty(winName)) + throw new ArgumentNullException("winName"); + NativeMethods.highgui_moveWindow(winName, x, y); + } + + /// + /// Changes parameters of a window dynamically. + /// + /// Name of the window. + /// Window property to retrieve. + /// New value of the window property. + public static void SetWindowProperty(string winName, WindowProperty propId, double propValue) + { + if (String.IsNullOrEmpty(winName)) + throw new ArgumentNullException("winName"); + NativeMethods.highgui_setWindowProperty(winName, (int) propId, propValue); + } + + /// + /// Updates window title + /// + /// + /// + public static void SetWindowTitle(string winname, string title) + { + if (String.IsNullOrEmpty(winname)) + throw new ArgumentNullException("winname"); + if (String.IsNullOrEmpty(title)) + throw new ArgumentNullException("title"); + NativeMethods.highgui_setWindowTitle(winname, title); + } + + /// + /// Provides parameters of a window. + /// + /// Name of the window. + /// Window property to retrieve. + /// + public static double GetWindowProperty(string winName, WindowProperty propId) + { + if (String.IsNullOrEmpty(winName)) + throw new ArgumentNullException("winName"); + return NativeMethods.highgui_getWindowProperty(winName, (int) propId); + } + +#if LANG_JP + /// + /// 指定されたウィンドウ内で発生するマウスイベントに対するコールバック関数を設定する + /// + /// ウィンドウの名前 + /// 指定されたウィンドウ内でマウスイベントが発生するたびに呼ばれるデリゲート +#else + /// + /// Sets the callback function for mouse events occuting within the specified window. + /// + /// Name of the window. + /// Reference to the function to be called every time mouse event occurs in the specified window. +#endif + public static void SetMouseCallback(string windowName, CvMouseCallback onMouse) + { + if (string.IsNullOrEmpty(windowName)) + throw new ArgumentNullException("windowName"); + if (onMouse == null) + throw new ArgumentNullException("onMouse"); + + Window window = Window.GetWindowByName(windowName); + if (window != null) + { + window.OnMouseCallback += onMouse; + } + } + } +} diff --git a/src/OpenCvSharp/Cv2/Cv2_imgcodecs.cs b/src/OpenCvSharp/Cv2/Cv2_imgcodecs.cs new file mode 100644 index 000000000..1e1d1cdcd --- /dev/null +++ b/src/OpenCvSharp/Cv2/Cv2_imgcodecs.cs @@ -0,0 +1,224 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + static partial class Cv2 + { + /// + /// Loads an image from a file. + /// + /// Name of file to be loaded. + /// Specifies color type of the loaded image + /// + public static Mat ImRead(string fileName, ImreadModes flags = ImreadModes.Color) + { + return new Mat(fileName, flags); + } + + /// + /// Loads a multi-page image from a file. + /// + /// Name of file to be loaded. + /// A vector of Mat objects holding each page, if more than one. + /// Flag that can take values of @ref cv::ImreadModes, default with IMREAD_ANYCOLOR. + /// + public static bool ImReadMulti(string filename, out Mat[] mats, ImreadModes flags = ImreadModes.AnyColor) + { + if (filename == null) + throw new ArgumentNullException("filename"); + + using (var matsVec = new VectorOfMat()) + { + int ret = NativeMethods.imgcodecs_imreadmulti(filename, matsVec.CvPtr, (int) flags); + mats = matsVec.ToArray(); + return ret != 0; + } + } + + /// + /// Saves an image to a specified file. + /// + /// Name of the file. + /// Image to be saved. + /// Format-specific save parameters encoded as pairs + /// + public static bool ImWrite(string fileName, Mat img, int[] prms = null) + { + if (string.IsNullOrEmpty(fileName)) + throw new ArgumentNullException("fileName"); + if (img == null) + throw new ArgumentNullException("img"); + if (prms == null) + prms = new int[0]; + + return NativeMethods.imgcodecs_imwrite(fileName, img.CvPtr, prms, prms.Length) != 0; + } + + /// + /// Saves an image to a specified file. + /// + /// Name of the file. + /// Image to be saved. + /// Format-specific save parameters encoded as pairs + /// + public static bool ImWrite(string fileName, Mat img, params ImageEncodingParam[] prms) + { + if (prms != null) + { + List p = new List(); + foreach (ImageEncodingParam item in prms) + { + p.Add((int) item.EncodingId); + p.Add(item.Value); + } + return ImWrite(fileName, img, p.ToArray()); + } + + return ImWrite(fileName, img, (int[]) null); + } + + /// + /// Reads image from the specified buffer in memory. + /// + /// The input array of vector of bytes. + /// The same flags as in imread + /// + public static Mat ImDecode(Mat buf, ImreadModes flags) + { + if (buf == null) + throw new ArgumentNullException("buf"); + buf.ThrowIfDisposed(); + IntPtr matPtr = NativeMethods.imgcodecs_imdecode_Mat(buf.CvPtr, (int) flags); + GC.KeepAlive(buf); + return new Mat(matPtr); + } + + /// + /// Reads image from the specified buffer in memory. + /// + /// The input array of vector of bytes. + /// The same flags as in imread + /// + public static Mat ImDecode(InputArray buf, ImreadModes flags) + { + if (buf == null) + throw new ArgumentNullException("buf"); + buf.ThrowIfDisposed(); + IntPtr matPtr = NativeMethods.imgcodecs_imdecode_InputArray(buf.CvPtr, (int) flags); + GC.KeepAlive(buf); + return new Mat(matPtr); + } + + /// + /// Reads image from the specified buffer in memory. + /// + /// The input array of vector of bytes. + /// The same flags as in imread + /// + public static Mat ImDecode(byte[] buf, ImreadModes flags) + { + if (buf == null) + throw new ArgumentNullException("buf"); + IntPtr matPtr = NativeMethods.imgcodecs_imdecode_vector( + buf, new IntPtr(buf.LongLength), (int) flags); + return new Mat(matPtr); + } + + /// + /// Compresses the image and stores it in the memory buffer + /// + /// The file extension that defines the output format + /// The image to be written + /// Output buffer resized to fit the compressed image. + /// Format-specific parameters. + public static bool ImEncode(string ext, InputArray img, out byte[] buf, int[] prms = null) + { + if (string.IsNullOrEmpty(ext)) + throw new ArgumentNullException("ext"); + if (img == null) + throw new ArgumentNullException("img"); + if (prms == null) + prms = new int[0]; + img.ThrowIfDisposed(); + using (VectorOfByte bufVec = new VectorOfByte()) + { + int ret = NativeMethods.imgcodecs_imencode_vector(ext, img.CvPtr, bufVec.CvPtr, prms, prms.Length); + buf = bufVec.ToArray(); + return ret != 0; + } + } + + /// + /// Compresses the image and stores it in the memory buffer + /// + /// The file extension that defines the output format + /// The image to be written + /// Output buffer resized to fit the compressed image. + /// Format-specific parameters. + public static void ImEncode(string ext, InputArray img, out byte[] buf, params ImageEncodingParam[] prms) + { + if (prms != null) + { + List p = new List(); + foreach (ImageEncodingParam item in prms) + { + p.Add((int) item.EncodingId); + p.Add(item.Value); + } + ImEncode(ext, img, out buf, p.ToArray()); + } + else + { + ImEncode(ext, img, out buf, (int[]) null); + } + } + + /// + /// utility function: convert one image to another with optional vertical flip + /// + /// + /// + /// + public static void ConvertImage(Mat src, Mat dst, ConvertImageModes flags = ConvertImageModes.None) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfDisposed(); + + dst.Create(src.Size(), MatType.CV_8UC3); + NativeMethods.imgcodecs_cvConvertImage_Mat(src.CvPtr, dst.CvPtr, (int)flags); + + GC.KeepAlive(src); + GC.KeepAlive(dst); + } + + /// + /// + /// + /// + /// + public static bool HaveImageReader(string fileName) + { + if (fileName == null) + throw new ArgumentNullException("fileName"); + return NativeMethods.imgcodecs_cvHaveImageReader(fileName) != 0; + } + + /// + /// + /// + /// + /// + public static bool HaveImageWriter(string fileName) + { + if (fileName == null) + throw new ArgumentNullException("fileName"); + return NativeMethods.imgcodecs_cvHaveImageWriter(fileName) != 0; + } + } +} diff --git a/src/OpenCvSharp/Cv2/Cv2_imgproc.cs b/src/OpenCvSharp/Cv2/Cv2_imgproc.cs new file mode 100644 index 000000000..33f0273c9 --- /dev/null +++ b/src/OpenCvSharp/Cv2/Cv2_imgproc.cs @@ -0,0 +1,4610 @@ +using System; +using System.Collections.Generic; + +using OpenCvSharp.Util; + +// ReSharper disable InconsistentNaming + +namespace OpenCvSharp +{ + static partial class Cv2 + { + /// + /// Returns Gaussian filter coefficients. + /// + /// Aperture size. It should be odd and positive. + /// Gaussian standard deviation. + /// If it is non-positive, it is computed from ksize as `sigma = 0.3*((ksize-1)*0.5 - 1) + 0.8`. + /// Type of filter coefficients. It can be CV_32F or CV_64F. + /// + public static Mat GetGaussianKernel(int ksize, double sigma, MatType? ktype = null) + { + var ktype0 = ktype.GetValueOrDefault(MatType.CV_64F); + var ret = NativeMethods.imgproc_getGaussianKernel(ksize, sigma, ktype0); + if (ret == IntPtr.Zero) + return null; + return new Mat(ret); + } + + /// + /// Returns filter coefficients for computing spatial image derivatives. + /// + /// Output matrix of row filter coefficients. It has the type ktype. + /// Output matrix of column filter coefficients. It has the type ktype. + /// Derivative order in respect of x. + /// Derivative order in respect of y. + /// Aperture size. It can be CV_SCHARR, 1, 3, 5, or 7. + /// Flag indicating whether to normalize (scale down) the filter coefficients or not. + /// Theoretically, the coefficients should have the denominator \f$=2^{ksize*2-dx-dy-2}\f$. + /// If you are going to filter floating-point images, you are likely to use the normalized kernels. + /// But if you compute derivatives of an 8-bit image, store the results in a 16-bit image, + /// and wish to preserve all the fractional bits, you may want to set normalize = false. + /// Type of filter coefficients. It can be CV_32f or CV_64F. + public static void GetDerivKernels( + OutputArray kx, OutputArray ky, int dx, int dy, int ksize, + bool normalize = false, MatType? ktype = null) + { + if (kx == null) + throw new ArgumentNullException(nameof(kx)); + if (ky == null) + throw new ArgumentNullException(nameof(ky)); + kx.ThrowIfNotReady(); + ky.ThrowIfNotReady(); + + var ktype0 = ktype.GetValueOrDefault(MatType.CV_32F); + NativeMethods.imgproc_getDerivKernels( + kx.CvPtr, ky.CvPtr, dx, dy, ksize, normalize ? 1 : 0, ktype0); + + kx.Fix(); + ky.Fix(); + } + + #region GetGaborKernel + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static Mat GetGaborKernel(Size ksize, double sigma, double theta, double lambd, double gamma, double psi, int ktype) + { + IntPtr matPtr = NativeMethods.imgproc_getGaborKernel(ksize, sigma, theta, lambd, gamma, psi, ktype); + return new Mat(matPtr); + } + #endregion + #region GetStructuringElement + /// + /// + /// + /// + /// + /// + public static Mat GetStructuringElement(MorphShapes shape, Size ksize) + { + return GetStructuringElement(shape, ksize, new Point(-1, -1)); + } + /// + /// + /// + /// + /// + /// + /// + public static Mat GetStructuringElement(MorphShapes shape, Size ksize, Point anchor) + { + IntPtr matPtr = NativeMethods.imgproc_getStructuringElement((int)shape, ksize, anchor); + return new Mat(matPtr); + } + #endregion + #region CopyMakeBorder + /// + /// Forms a border around the image + /// + /// The source image + /// The destination image; will have the same type as src and + /// the size Size(src.cols+left+right, src.rows+top+bottom) + /// Specify how much pixels in each direction from the source image rectangle one needs to extrapolate + /// Specify how much pixels in each direction from the source image rectangle one needs to extrapolate + /// Specify how much pixels in each direction from the source image rectangle one needs to extrapolate + /// Specify how much pixels in each direction from the source image rectangle one needs to extrapolate + /// The border type + /// The border value if borderType == Constant + public static void CopyMakeBorder(InputArray src, OutputArray dst, int top, int bottom, int left, int right, BorderTypes borderType, Scalar? value = null) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + Scalar value0 = value.GetValueOrDefault(new Scalar()); + NativeMethods.imgproc_copyMakeBorder(src.CvPtr, dst.CvPtr, top, bottom, left, right, (int)borderType, value0); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region MedianBlur + /// + /// Smoothes image using median filter + /// + /// The source 1-, 3- or 4-channel image. + /// When ksize is 3 or 5, the image depth should be CV_8U , CV_16U or CV_32F. + /// For larger aperture sizes it can only be CV_8U + /// The destination array; will have the same size and the same type as src + /// The aperture linear size. It must be odd and more than 1, i.e. 3, 5, 7 ... + public static void MedianBlur(InputArray src, OutputArray dst, int ksize) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.imgproc_medianBlur(src.CvPtr, dst.CvPtr, ksize); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region GaussianBlur + /// + /// Blurs an image using a Gaussian filter. + /// + /// input image; the image can have any number of channels, which are processed independently, + /// but the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F. + /// output image of the same size and type as src. + /// Gaussian kernel size. ksize.width and ksize.height can differ but they both must be positive and odd. + /// Or, they can be zero’s and then they are computed from sigma* . + /// Gaussian kernel standard deviation in X direction. + /// Gaussian kernel standard deviation in Y direction; if sigmaY is zero, it is set to be equal to sigmaX, + /// if both sigmas are zeros, they are computed from ksize.width and ksize.height, + /// respectively (see getGaussianKernel() for details); to fully control the result + /// regardless of possible future modifications of all this semantics, it is recommended to specify all of ksize, sigmaX, and sigmaY. + /// pixel extrapolation method + public static void GaussianBlur(InputArray src, OutputArray dst, Size ksize, double sigmaX, + double sigmaY = 0, BorderTypes borderType = BorderTypes.Default) + { + if (src == null) + throw new ArgumentNullException(nameof(src)); + if (dst == null) + throw new ArgumentNullException(nameof(dst)); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.imgproc_GaussianBlur(src.CvPtr, dst.CvPtr, ksize, sigmaX, sigmaY, (int)borderType); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region BilateralFilter + /// + /// Applies bilateral filter to the image + /// + /// The source 8-bit or floating-point, 1-channel or 3-channel image + /// The destination image; will have the same size and the same type as src + /// The diameter of each pixel neighborhood, that is used during filtering. + /// If it is non-positive, it's computed from sigmaSpace + /// Filter sigma in the color space. + /// Larger value of the parameter means that farther colors within the pixel neighborhood + /// will be mixed together, resulting in larger areas of semi-equal color + /// Filter sigma in the coordinate space. + /// Larger value of the parameter means that farther pixels will influence each other + /// (as long as their colors are close enough; see sigmaColor). Then d>0 , it specifies + /// the neighborhood size regardless of sigmaSpace, otherwise d is proportional to sigmaSpace + /// + public static void BilateralFilter(InputArray src, OutputArray dst, int d, double sigmaColor, + double sigmaSpace, BorderTypes borderType = BorderTypes.Default) + { + if (src == null) + throw new ArgumentNullException(nameof(src)); + if (dst == null) + throw new ArgumentNullException(nameof(dst)); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.imgproc_bilateralFilter(src.CvPtr, dst.CvPtr, d, sigmaColor, sigmaSpace, (int)borderType); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region AdaptiveBilateralFilter + /* + /// + /// Applies the adaptive bilateral filter to an image. + /// + /// The source image + /// The destination image; will have the same size and the same type as src + /// The kernel size. This is the neighborhood where the local variance will be calculated, + /// and where pixels will contribute (in a weighted manner). + /// Filter sigma in the coordinate space. + /// Larger value of the parameter means that farther pixels will influence each other + /// (as long as their colors are close enough; see sigmaColor). Then d>0, it specifies the neighborhood + /// size regardless of sigmaSpace, otherwise d is proportional to sigmaSpace. + /// Maximum allowed sigma color (will clamp the value calculated in the + /// ksize neighborhood. Larger value of the parameter means that more dissimilar pixels will + /// influence each other (as long as their colors are close enough; see sigmaColor). + /// Then d>0, it specifies the neighborhood size regardless of sigmaSpace, otherwise d is proportional to sigmaSpace. + /// The anchor point. The default value Point(-1,-1) means that the anchor is at the kernel center + /// Pixel extrapolation method. + public static void AdaptiveBilateralFilter(InputArray src, OutputArray dst, Size ksize, + double sigmaSpace, double maxSigmaColor = 20.0, Point? anchor = null, BorderType borderType = BorderType.Default) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + Point anchor0 = anchor.GetValueOrDefault(new Point(-1, -1)); + NativeMethods.imgproc_adaptiveBilateralFilter(src.CvPtr, dst.CvPtr, ksize, + sigmaSpace, maxSigmaColor, anchor0, (int)borderType); + dst.Fix(); + } + */ + #endregion + #region BoxFilter + /// + /// Smoothes image using box filter + /// + /// The source image + /// The destination image; will have the same size and the same type as src + /// + /// The smoothing kernel size + /// The anchor point. The default value Point(-1,-1) means that the anchor is at the kernel center + /// Indicates, whether the kernel is normalized by its area or not + /// The border mode used to extrapolate pixels outside of the image + public static void BoxFilter( + InputArray src, OutputArray dst, MatType ddepth, + Size ksize, Point? anchor = null, bool normalize = true, + BorderTypes borderType = BorderTypes.Default) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + Point anchor0 = anchor.GetValueOrDefault(new Point(-1, -1)); + NativeMethods.imgproc_boxFilter(src.CvPtr, dst.CvPtr, ddepth, ksize, anchor0, normalize ? 1 : 0, (int)borderType); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region Blur + /// + /// Smoothes image using normalized box filter + /// + /// The source image + /// The destination image; will have the same size and the same type as src + /// The smoothing kernel size + /// The anchor point. The default value Point(-1,-1) means that the anchor is at the kernel center + /// The border mode used to extrapolate pixels outside of the image + public static void Blur( + InputArray src, OutputArray dst, Size ksize, + Point? anchor = null, BorderTypes borderType = BorderTypes.Default) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + Point anchor0 = anchor.GetValueOrDefault(new Point(-1, -1)); + NativeMethods.imgproc_blur(src.CvPtr, dst.CvPtr, ksize, anchor0, (int)borderType); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region Filter2D + /// + /// Convolves an image with the kernel + /// + /// The source image + /// The destination image. It will have the same size and the same number of channels as src + /// The desired depth of the destination image. If it is negative, it will be the same as src.depth() + /// Convolution kernel (or rather a correlation kernel), + /// a single-channel floating point matrix. If you want to apply different kernels to + /// different channels, split the image into separate color planes using split() and process them individually + /// The anchor of the kernel that indicates the relative position of + /// a filtered point within the kernel. The anchor should lie within the kernel. + /// The special default value (-1,-1) means that the anchor is at the kernel center + /// The optional value added to the filtered pixels before storing them in dst + /// The pixel extrapolation method + public static void Filter2D( + InputArray src, OutputArray dst, MatType ddepth, + InputArray kernel, Point? anchor = null, double delta = 0, + BorderTypes borderType = BorderTypes.Default) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (kernel == null) + throw new ArgumentNullException("kernel"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + kernel.ThrowIfDisposed(); + Point anchor0 = anchor.GetValueOrDefault(new Point(-1, -1)); + NativeMethods.imgproc_filter2D(src.CvPtr, dst.CvPtr, ddepth, kernel.CvPtr, + anchor0, delta, (int)borderType); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region SepFilter2D + /// + /// Applies separable linear filter to an image + /// + /// The source image + /// The destination image; will have the same size and the same number of channels as src + /// The destination image depth + /// The coefficients for filtering each row + /// The coefficients for filtering each column + /// The anchor position within the kernel; The default value (-1, 1) means that the anchor is at the kernel center + /// The value added to the filtered results before storing them + /// The pixel extrapolation method + public static void SepFilter2D( + InputArray src, OutputArray dst, MatType ddepth, InputArray kernelX, InputArray kernelY, + Point? anchor = null, double delta = 0, + BorderTypes borderType = BorderTypes.Default) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (kernelX == null) + throw new ArgumentNullException("kernelX"); + if (kernelY == null) + throw new ArgumentNullException("kernelY"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + kernelX.ThrowIfDisposed(); + kernelY.ThrowIfDisposed(); + Point anchor0 = anchor.GetValueOrDefault(new Point(-1, -1)); + NativeMethods.imgproc_sepFilter2D(src.CvPtr, dst.CvPtr, ddepth, + kernelX.CvPtr, kernelY.CvPtr, anchor0, delta, (int)borderType); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region Sobel + /// + /// Calculates the first, second, third or mixed image derivatives using an extended Sobel operator + /// + /// The source image + /// The destination image; will have the same size and the same number of channels as src + /// The destination image depth + /// Order of the derivative x + /// Order of the derivative y + /// Size of the extended Sobel kernel, must be 1, 3, 5 or 7 + /// The optional scale factor for the computed derivative values (by default, no scaling is applied + /// The optional delta value, added to the results prior to storing them in dst + /// The pixel extrapolation method + public static void Sobel( + InputArray src, OutputArray dst, MatType ddepth, int xorder, int yorder, + int ksize = 3, double scale = 1, double delta = 0, + BorderTypes borderType = BorderTypes.Default) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.imgproc_Sobel(src.CvPtr, dst.CvPtr, ddepth, xorder, yorder, + ksize, scale, delta, (int)borderType); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region Scharr + /// + /// Calculates the first x- or y- image derivative using Scharr operator + /// + /// The source image + /// The destination image; will have the same size and the same number of channels as src + /// The destination image depth + /// Order of the derivative x + /// Order of the derivative y + /// The optional scale factor for the computed derivative values (by default, no scaling is applie + /// The optional delta value, added to the results prior to storing them in dst + /// The pixel extrapolation method + public static void Scharr( + InputArray src, OutputArray dst, MatType ddepth, int xorder, int yorder, + double scale = 1, double delta = 0, BorderTypes borderType = BorderTypes.Default) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.imgproc_Scharr(src.CvPtr, dst.CvPtr, ddepth, xorder, yorder, + scale, delta, (int)borderType); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region Laplacian + /// + /// Calculates the Laplacian of an image + /// + /// Source image + /// Destination image; will have the same size and the same number of channels as src + /// The desired depth of the destination image + /// The aperture size used to compute the second-derivative filters + /// The optional scale factor for the computed Laplacian values (by default, no scaling is applied + /// The optional delta value, added to the results prior to storing them in dst + /// The pixel extrapolation method + public static void Laplacian( + InputArray src, OutputArray dst, MatType ddepth, + int ksize = 1, double scale = 1, double delta = 0, + BorderTypes borderType = BorderTypes.Default) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.imgproc_Laplacian(src.CvPtr, dst.CvPtr, ddepth, ksize, scale, delta, (int)borderType); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region Canny +#if LANG_JP + /// + /// Cannyアルゴリズムを用いて,画像のエッジを検出します. + /// + /// 8ビット,シングルチャンネルの入力画像 + /// 出力されるエッジのマップ. image と同じサイズ,同じ型 + /// ヒステリシスが存在する処理の,1番目の閾値 + /// ヒステリシスが存在する処理の,2番目の閾値 + /// Sobelオペレータのアパーチャサイズ [既定値はApertureSize.Size3] + /// 画像勾配の強度を求めるために,より精度の高い L2ノルムを利用するか,L1ノルムで十分(false)かを指定します. [既定値はfalse] +#else + /// + /// Finds edges in an image using Canny algorithm. + /// + /// Single-channel 8-bit input image + /// The output edge map. It will have the same size and the same type as image + /// The first threshold for the hysteresis procedure + /// The second threshold for the hysteresis procedure + /// Aperture size for the Sobel operator [By default this is ApertureSize.Size3] + /// Indicates, whether the more accurate L2 norm should be used to compute the image gradient magnitude (true), or a faster default L1 norm is enough (false). [By default this is false] +#endif + public static void Canny(InputArray src, OutputArray edges, + double threshold1, double threshold2, int apertureSize = 3, bool L2gradient = false) + { + if (src == null) + throw new ArgumentNullException("src"); + if (edges == null) + throw new ArgumentNullException("edges"); + src.ThrowIfDisposed(); + edges.ThrowIfNotReady(); + NativeMethods.imgproc_Canny(src.CvPtr, edges.CvPtr, threshold1, threshold2, apertureSize, L2gradient ? 1 : 0); + GC.KeepAlive(src); + edges.Fix(); + } + #endregion + #region CornerEigenValsAndVecs + /// + /// computes both eigenvalues and the eigenvectors of 2x2 derivative covariation matrix at each pixel. The output is stored as 6-channel matrix. + /// + /// + /// + /// + /// + /// + public static void CornerEigenValsAndVecs( + InputArray src, OutputArray dst, int blockSize, int ksize, + BorderTypes borderType = BorderTypes.Default) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.imgproc_cornerEigenValsAndVecs(src.CvPtr, dst.CvPtr, blockSize, ksize, (int)borderType); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region PreCornerDetect + /// + /// computes another complex cornerness criteria at each pixel + /// + /// + /// + /// + /// + public static void PreCornerDetect( + InputArray src, OutputArray dst, int ksize, BorderTypes borderType = BorderTypes.Default) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.imgproc_preCornerDetect(src.CvPtr, dst.CvPtr, ksize, (int)borderType); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region CornerSubPix + /// + /// adjusts the corner locations with sub-pixel accuracy to maximize the certain cornerness criteria + /// + /// Input image. + /// Initial coordinates of the input corners and refined coordinates provided for output. + /// Half of the side length of the search window. + /// Half of the size of the dead region in the middle of the search zone + /// over which the summation in the formula below is not done. It is used sometimes to avoid possible singularities + /// of the autocorrelation matrix. The value of (-1,-1) indicates that there is no such a size. + /// Criteria for termination of the iterative process of corner refinement. + /// That is, the process of corner position refinement stops either after criteria.maxCount iterations + /// or when the corner position moves by less than criteria.epsilon on some iteration. + /// + public static Point2f[] CornerSubPix(InputArray image, IEnumerable inputCorners, + Size winSize, Size zeroZone, TermCriteria criteria) + { + if (image == null) + throw new ArgumentNullException("image"); + if (inputCorners == null) + throw new ArgumentNullException("inputCorners"); + image.ThrowIfDisposed(); + + var inputCornersSrc = EnumerableEx.ToArray(inputCorners); + var inputCornersCopy = new Point2f[inputCornersSrc.Length]; + Array.Copy(inputCornersSrc, inputCornersCopy, inputCornersSrc.Length); + using (var vector = new VectorOfPoint2f(inputCornersCopy)) + { + NativeMethods.imgproc_cornerSubPix(image.CvPtr, vector.CvPtr, winSize, zeroZone, criteria); + GC.KeepAlive(image); + return vector.ToArray(); + } + } + #endregion + #region GoodFeaturesToTrack + /// + /// finds the strong enough corners where the cornerMinEigenVal() or cornerHarris() report the local maxima + /// + /// Input 8-bit or floating-point 32-bit, single-channel image. + /// Maximum number of corners to return. If there are more corners than are found, + /// the strongest of them is returned. + /// Parameter characterizing the minimal accepted quality of image corners. + /// The parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue + /// or the Harris function response (see cornerHarris() ). The corners with the quality measure less than + /// the product are rejected. For example, if the best corner has the quality measure = 1500, and the qualityLevel=0.01, + /// then all the corners with the quality measure less than 15 are rejected. + /// Minimum possible Euclidean distance between the returned corners. + /// Optional region of interest. If the image is not empty + /// (it needs to have the type CV_8UC1 and the same size as image ), it specifies the region + /// in which the corners are detected. + /// Size of an average block for computing a derivative covariation matrix over each pixel neighborhood. + /// Parameter indicating whether to use a Harris detector + /// Free parameter of the Harris detector. + /// Output vector of detected corners. + public static Point2f[] GoodFeaturesToTrack(InputArray src, + int maxCorners, double qualityLevel, double minDistance, + InputArray mask, int blockSize, bool useHarrisDetector, double k) + { + if (src == null) + throw new ArgumentNullException("src"); + src.ThrowIfDisposed(); + + using (var vector = new VectorOfPoint2f()) + { + IntPtr maskPtr = ToPtr(mask); + NativeMethods.imgproc_goodFeaturesToTrack(src.CvPtr, vector.CvPtr, maxCorners, qualityLevel, + minDistance, maskPtr, blockSize, useHarrisDetector ? 0 : 1, k); + GC.KeepAlive(src); + return vector.ToArray(); + } + } + #endregion + #region HoughLines +#if LANG_JP + /// + /// 標準ハフ変換を用いて,2値画像から直線を検出します. + /// + /// 8ビット,シングルチャンネルの2値入力画像.この画像は関数により書き換えられる可能性があります + /// ピクセル単位で表される投票空間の距離分解能 + /// ラジアン単位で表される投票空間の角度分解能 + /// 投票の閾値パラメータ.十分な票( > threshold )を得た直線のみが出力されます + /// マルチスケールハフ変換において,距離分解能 rho の除数となる値.[既定値は0] + /// マルチスケールハフ変換において,角度分解能 theta の除数となる値. [既定値は0] + /// 検出された直線.各直線は,2要素のベクトル (rho, theta) で表現されます. + /// rho は原点(画像の左上コーナー)からの距離, theta はラジアン単位で表される直線の回転角度です +#else + /// + /// Finds lines in a binary image using standard Hough transform. + /// + /// The 8-bit, single-channel, binary source image. The image may be modified by the function + /// Distance resolution of the accumulator in pixels + /// Angle resolution of the accumulator in radians + /// The accumulator threshold parameter. Only those lines are returned that get enough votes ( > threshold ) + /// For the multi-scale Hough transform it is the divisor for the distance resolution rho. [By default this is 0] + /// For the multi-scale Hough transform it is the divisor for the distance resolution theta. [By default this is 0] + /// The output vector of lines. Each line is represented by a two-element vector (rho, theta) . + /// rho is the distance from the coordinate origin (0,0) (top-left corner of the image) and theta is the line rotation angle in radians +#endif + public static LineSegmentPolar[] HoughLines( + InputArray image, double rho, double theta, int threshold, + double srn = 0, double stn = 0) + { + if (image == null) + throw new ArgumentNullException("image"); + + using (var vec = new VectorOfVec2f()) + { + NativeMethods.imgproc_HoughLines(image.CvPtr, vec.CvPtr, rho, theta, threshold, srn, stn); + GC.KeepAlive(image); + return vec.ToArray(); + } + } + #endregion + #region HoughLinesP +#if LANG_JP + /// + /// 確率的ハフ変換を利用して,2値画像から線分を検出します. + /// + /// 8ビット,シングルチャンネルの2値入力画像.この画像は関数により書き換えられる可能性があります + /// ピクセル単位で表される投票空間の距離分解能 + /// ラジアン単位で表される投票空間の角度分解能 + /// 投票の閾値パラメータ.十分な票( > threshold )を得た直線のみが出力されます + /// 最小の線分長.これより短い線分は棄却されます. [既定値は0] + /// 2点が同一線分上にあると見なす場合に許容される最大距離. [既定値は0] + /// 検出された線分.各線分は,4要素のベクトル (x1, y1, x2, y2) で表現されます. +#else + /// + /// Finds lines segments in a binary image using probabilistic Hough transform. + /// + /// + /// Distance resolution of the accumulator in pixels + /// Angle resolution of the accumulator in radians + /// The accumulator threshold parameter. Only those lines are returned that get enough votes ( > threshold ) + /// The minimum line length. Line segments shorter than that will be rejected. [By default this is 0] + /// The maximum allowed gap between points on the same line to link them. [By default this is 0] + /// The output lines. Each line is represented by a 4-element vector (x1, y1, x2, y2) +#endif + public static LineSegmentPoint[] HoughLinesP( + InputArray image, double rho, double theta, int threshold, + double minLineLength = 0, double maxLineGap = 0) + { + if (image == null) + throw new ArgumentNullException("image"); + image.ThrowIfDisposed(); + using (var vec = new VectorOfVec4i()) + { + NativeMethods.imgproc_HoughLinesP(image.CvPtr, vec.CvPtr, rho, theta, threshold, minLineLength, maxLineGap); + GC.KeepAlive(image); + return vec.ToArray(); + } + } + #endregion + #region HoughCircles +#if LANG_JP + /// + /// ハフ変換を用いて,グレースケール画像から円を検出します. + /// + /// 8ビット,シングルチャンネル,グレースケールの入力画像> + /// 現在のところ,HoughCirclesMethod.Gradient メソッドのみが実装されている. + /// 画像分解能に対する投票分解能の比率の逆数. + /// 検出される円の中心同士の最小距離. + /// 手法依存の1番目のパラメータ.[既定値は100] + /// 手法依存の2番目のパラメータ.[既定値は100] + /// 円の半径の最小値 [既定値は0] + /// 円の半径の最大値 [既定値は0] + /// 検出された円.各ベクトルは,3要素の浮動小数点型ベクトル (x, y, radius) としてエンコードされます +#else + /// + /// Finds circles in a grayscale image using a Hough transform. + /// + /// The 8-bit, single-channel, grayscale input image + /// Currently, the only implemented method is HoughCirclesMethod.Gradient + /// The inverse ratio of the accumulator resolution to the image resolution. + /// Minimum distance between the centers of the detected circles. + /// The first method-specific parameter. [By default this is 100] + /// The second method-specific parameter. [By default this is 100] + /// Minimum circle radius. [By default this is 0] + /// Maximum circle radius. [By default this is 0] + /// The output vector found circles. Each vector is encoded as 3-element floating-point vector (x, y, radius) +#endif + public static CircleSegment[] HoughCircles( + InputArray image, HoughMethods method, double dp, double minDist, + double param1 = 100, double param2 = 100, int minRadius = 0, int maxRadius = 0) + { + if (image == null) + throw new ArgumentNullException("image"); + image.ThrowIfDisposed(); + using (var vec = new VectorOfVec3f()) + { + NativeMethods.imgproc_HoughCircles(image.CvPtr, vec.CvPtr, (int)method, dp, minDist, param1, param2, minRadius, maxRadius); + GC.KeepAlive(image); + return vec.ToArray(); + } + } + #endregion + #region MorphologyDefaultBorderValue + /// + /// Default borderValue for Dilate/Erode + /// + /// + public static Scalar MorphologyDefaultBorderValue() + { + return Scalar.All(double.MaxValue); + } + #endregion + #region Dilate +#if LANG_JP + /// + /// 指定の構造要素を用いて画像の膨張を行います. + /// + /// 入力画像 + /// src と同じサイズ,同じ型の出力画像 + /// 膨張に用いられる構造要素. element=new Mat() の場合, 3x3 の矩形構造要素が用いられます + /// 構造要素内のアンカー位置.デフォルト値の (-1, -1) は,アンカーが構造要素の中心にあることを意味します + /// 膨張が行われる回数. [既定値は1] + /// ピクセル外挿手法.[既定値はBorderType.Constant] + /// 定数境界モードで利用されるピクセル値.デフォルト値は特別な意味を持ちます.[既定値はCvCpp.MorphologyDefaultBorderValue()] +#else + /// + /// Dilates an image by using a specific structuring element. + /// + /// The source image + /// The destination image. It will have the same size and the same type as src + /// The structuring element used for dilation. If element=new Mat() , a 3x3 rectangular structuring element is used + /// Position of the anchor within the element. The default value (-1, -1) means that the anchor is at the element center + /// The number of times dilation is applied. [By default this is 1] + /// The pixel extrapolation method. [By default this is BorderType.Constant] + /// The border value in case of a constant border. The default value has a special meaning. [By default this is CvCpp.MorphologyDefaultBorderValue()] +#endif + public static void Dilate( + InputArray src, OutputArray dst, InputArray element, + Point? anchor = null, int iterations = 1, + BorderTypes borderType = BorderTypes.Constant, Scalar? borderValue = null) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + + Point anchor0 = anchor.GetValueOrDefault(new Point(-1, -1)); + Scalar borderValue0 = borderValue.GetValueOrDefault(MorphologyDefaultBorderValue()); + IntPtr elementPtr = ToPtr(element); + NativeMethods.imgproc_dilate(src.CvPtr, dst.CvPtr, elementPtr, anchor0, iterations, (int)borderType, borderValue0); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region Erode +#if LANG_JP + /// + /// 指定の構造要素を用いて画像の収縮を行います. + /// + /// 入力画像 + /// src と同じサイズ,同じ型の出力画像 + /// 収縮に用いられる構造要素. element=new Mat() の場合, 3x3 の矩形の構造要素が用いられます + /// 構造要素内のアンカー位置.デフォルト値の (-1, -1) は,アンカーが構造要素の中心にあることを意味します + /// 収縮が行われる回数. [既定値は1] + /// ピクセル外挿手法.[既定値はBorderType.Constant] + /// 定数境界モードで利用されるピクセル値.デフォルト値は特別な意味を持ちます.[既定値はCvCpp.MorphologyDefaultBorderValue()] +#else + /// + /// Erodes an image by using a specific structuring element. + /// + /// The source image + /// The destination image. It will have the same size and the same type as src + /// The structuring element used for dilation. If element=new Mat(), a 3x3 rectangular structuring element is used + /// Position of the anchor within the element. The default value (-1, -1) means that the anchor is at the element center + /// The number of times erosion is applied + /// The pixel extrapolation method + /// The border value in case of a constant border. The default value has a special meaning. [By default this is CvCpp.MorphologyDefaultBorderValue()] +#endif + public static void Erode( + InputArray src, OutputArray dst, InputArray element, + Point? anchor = null, int iterations = 1, + BorderTypes borderType = BorderTypes.Constant, Scalar? borderValue = null) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + + Point anchor0 = anchor.GetValueOrDefault(new Point(-1, -1)); + Scalar borderValue0 = borderValue.GetValueOrDefault(MorphologyDefaultBorderValue()); + IntPtr elementPtr = ToPtr(element); + NativeMethods.imgproc_erode(src.CvPtr, dst.CvPtr, elementPtr, anchor0, iterations, (int)borderType, borderValue0); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region MorphologyEx +#if LANG_JP + /// + /// 高度なモルフォロジー変換を行います. + /// + /// 入力画像 + /// src と同じサイズ,同じ型の出力画像 + /// モルフォロジー演算の種類 + /// 構造要素 + /// 構造要素内のアンカー位置.デフォルト値の (-1, -1) は,アンカーが構造要素の中心にあることを意味します. + /// 収縮と膨張が適用される回数. [既定値は1] + /// ピクセル外挿手法. [既定値はBorderType.Constant] + /// 定数境界モードで利用されるピクセル値.デフォルト値は特別な意味を持ちます. [既定値は CvCpp.MorphologyDefaultBorderValue()] +#else + /// + /// Performs advanced morphological transformations + /// + /// Source image + /// Destination image. It will have the same size and the same type as src + /// Type of morphological operation + /// Structuring element + /// Position of the anchor within the element. The default value (-1, -1) means that the anchor is at the element center + /// Number of times erosion and dilation are applied. [By default this is 1] + /// The pixel extrapolation method. [By default this is BorderType.Constant] + /// The border value in case of a constant border. The default value has a special meaning. [By default this is CvCpp.MorphologyDefaultBorderValue()] +#endif + public static void MorphologyEx( + InputArray src, OutputArray dst, MorphTypes op, InputArray element, + Point? anchor = null, int iterations = 1, + BorderTypes borderType = BorderTypes.Constant, Scalar? borderValue = null) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + + Point anchor0 = anchor.GetValueOrDefault(new Point(-1, -1)); + Scalar borderValue0 = borderValue.GetValueOrDefault(MorphologyDefaultBorderValue()); + IntPtr elementPtr = ToPtr(element); + NativeMethods.imgproc_morphologyEx(src.CvPtr, dst.CvPtr, (int)op, elementPtr, anchor0, iterations, (int)borderType, borderValue0); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region Resize + /// + /// Resizes an image. + /// + /// input image. + /// output image; it has the size dsize (when it is non-zero) or the size computed + /// from src.size(), fx, and fy; the type of dst is the same as of src. + /// output image size; if it equals zero, it is computed as: + /// dsize = Size(round(fx*src.cols), round(fy*src.rows)) + /// Either dsize or both fx and fy must be non-zero. + /// scale factor along the horizontal axis; when it equals 0, + /// it is computed as: (double)dsize.width/src.cols + /// scale factor along the vertical axis; when it equals 0, + /// it is computed as: (double)dsize.height/src.rows + /// interpolation method + public static void Resize(InputArray src, OutputArray dst, Size dsize, + double fx = 0, double fy = 0, InterpolationFlags interpolation = InterpolationFlags.Linear) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.imgproc_resize(src.CvPtr, dst.CvPtr, dsize, fx, fy, (int)interpolation); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region WarpAffine + /// + /// Applies an affine transformation to an image. + /// + /// input image. + /// output image that has the size dsize and the same type as src. + /// 2x3 transformation matrix. + /// size of the output image. + /// combination of interpolation methods and the optional flag + /// WARP_INVERSE_MAP that means that M is the inverse transformation (dst -> src) . + /// pixel extrapolation method; when borderMode=BORDER_TRANSPARENT, + /// it means that the pixels in the destination image corresponding to the "outliers" + /// in the source image are not modified by the function. + /// value used in case of a constant border; by default, it is 0. + public static void WarpAffine( + InputArray src, OutputArray dst, InputArray m, Size dsize, + InterpolationFlags flags = InterpolationFlags.Linear, + BorderTypes borderMode = BorderTypes.Constant, Scalar? borderValue = null) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (m == null) + throw new ArgumentNullException("m"); + src.ThrowIfDisposed(); + dst.ThrowIfDisposed(); + m.ThrowIfDisposed(); + Scalar borderValue0 = borderValue.GetValueOrDefault(Scalar.All(0)); + NativeMethods.imgproc_warpAffine(src.CvPtr, dst.CvPtr, m.CvPtr, dsize, (int)flags, (int)borderMode, borderValue0); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region WarpPerspective +#if LANG_JP + /// + /// 画像の透視変換を行います. + /// + /// 入力画像 + /// サイズが dsize で src と同じタイプの出力画像 + /// 3x3 の変換行列 + /// 出力画像のサイズ + /// 補間手法 + /// ピクセル外挿手法. + /// borderMode=BORDER_TRANSPARENT の場合,入力画像中の「はずれ値」に対応する + /// 出力画像中のピクセルが,この関数では変更されないことを意味します + /// 定数境界モードで利用されるピクセル値. +#else + /// + /// Applies a perspective transformation to an image. + /// + /// input image. + /// output image that has the size dsize and the same type as src. + /// 3x3 transformation matrix. + /// size of the output image. + /// combination of interpolation methods (INTER_LINEAR or INTER_NEAREST) + /// and the optional flag WARP_INVERSE_MAP, that sets M as the inverse transformation (dst -> src). + /// pixel extrapolation method (BORDER_CONSTANT or BORDER_REPLICATE). + /// value used in case of a constant border; by default, it equals 0. +#endif + public static void WarpPerspective( + InputArray src, OutputArray dst, InputArray m, Size dsize, + InterpolationFlags flags = InterpolationFlags.Linear, + BorderTypes borderMode = BorderTypes.Constant, + Scalar? borderValue = null) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (m == null) + throw new ArgumentNullException("m"); + src.ThrowIfDisposed(); + dst.ThrowIfDisposed(); + m.ThrowIfDisposed(); + Scalar borderValue0 = borderValue.GetValueOrDefault(Scalar.All(0)); + NativeMethods.imgproc_warpPerspective_MisInputArray( + src.CvPtr, dst.CvPtr, m.CvPtr, dsize, (int)flags, (int)borderMode, borderValue0); + GC.KeepAlive(src); + dst.Fix(); + } + +#if LANG_JP + /// + /// 画像の透視変換を行います. + /// + /// 入力画像 + /// サイズが dsize で src と同じタイプの出力画像 + /// 3x3 の変換行列 + /// 出力画像のサイズ + /// 補間手法 + /// ピクセル外挿手法. + /// borderMode=BORDER_TRANSPARENT の場合,入力画像中の「はずれ値」に対応する + /// 出力画像中のピクセルが,この関数では変更されないことを意味します + /// 定数境界モードで利用されるピクセル値. +#else + /// + /// Applies a perspective transformation to an image. + /// + /// input image. + /// output image that has the size dsize and the same type as src. + /// 3x3 transformation matrix. + /// size of the output image. + /// combination of interpolation methods (INTER_LINEAR or INTER_NEAREST) + /// and the optional flag WARP_INVERSE_MAP, that sets M as the inverse transformation (dst -> src). + /// pixel extrapolation method (BORDER_CONSTANT or BORDER_REPLICATE). + /// value used in case of a constant border; by default, it equals 0. +#endif + public static void WarpPerspective( + InputArray src, OutputArray dst, float[,] m, Size dsize, + InterpolationFlags flags = InterpolationFlags.Linear, + BorderTypes borderMode = BorderTypes.Constant, + Scalar? borderValue = null) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (m == null) + throw new ArgumentNullException("m"); + src.ThrowIfDisposed(); + dst.ThrowIfDisposed(); + Scalar borderValue0 = borderValue.GetValueOrDefault(Scalar.All(0)); + int mRow = m.GetLength(0); + int mCol = m.GetLength(1); + NativeMethods.imgproc_warpPerspective_MisArray( + src.CvPtr, dst.CvPtr, m, mRow, mCol, dsize, (int)flags, (int)borderMode, borderValue0); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region Remap + /// + /// Applies a generic geometrical transformation to an image. + /// + /// Source image. + /// Destination image. It has the same size as map1 and the same type as src + /// The first map of either (x,y) points or just x values having the type CV_16SC2, CV_32FC1, or CV_32FC2. + /// The second map of y values having the type CV_16UC1, CV_32FC1, or none (empty map if map1 is (x,y) points), respectively. + /// Interpolation method. The method INTER_AREA is not supported by this function. + /// Pixel extrapolation method. When borderMode=BORDER_TRANSPARENT, + /// it means that the pixels in the destination image that corresponds to the "outliers" in + /// the source image are not modified by the function. + /// Value used in case of a constant border. By default, it is 0. + public static void Remap( + InputArray src, OutputArray dst, InputArray map1, InputArray map2, + InterpolationFlags interpolation = InterpolationFlags.Linear, + BorderTypes borderMode = BorderTypes.Constant, Scalar? borderValue = null) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (map1 == null) + throw new ArgumentNullException("map1"); + if (map2 == null) + throw new ArgumentNullException("map2"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + map1.ThrowIfDisposed(); + map2.ThrowIfDisposed(); + Scalar borderValue0 = borderValue.GetValueOrDefault(Scalar.All(0)); + NativeMethods.imgproc_remap(src.CvPtr, dst.CvPtr, map1.CvPtr, map2.CvPtr, (int)interpolation, (int)borderMode, borderValue0); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region ConvertMaps + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static void ConvertMaps(InputArray map1, InputArray map2, OutputArray dstmap1, OutputArray dstmap2, MatType dstmap1Type, bool nnInterpolation = false) + { + if (map1 == null) + throw new ArgumentNullException("map1"); + if (map2 == null) + throw new ArgumentNullException("map2"); + if (dstmap1 == null) + throw new ArgumentNullException("dstmap1"); + if (dstmap2 == null) + throw new ArgumentNullException("dstmap2"); + map1.ThrowIfDisposed(); + map2.ThrowIfDisposed(); + dstmap1.ThrowIfDisposed(); + dstmap2.ThrowIfDisposed(); + NativeMethods.imgproc_convertMaps(map1.CvPtr, map2.CvPtr, dstmap1.CvPtr, dstmap2.CvPtr, dstmap1Type, nnInterpolation ? 1 : 0); + GC.KeepAlive(map1); + GC.KeepAlive(map2); + dstmap1.Fix(); + dstmap2.Fix(); + } + #endregion + + #region GetRotationMatrix2D + /// + /// + /// + /// + /// + /// + /// + public static Mat GetRotationMatrix2D(Point2f center, double angle, double scale) + { + IntPtr ret = NativeMethods.imgproc_getRotationMatrix2D(center, angle, scale); + return new Mat(ret); + + } + #endregion + #region InvertAffineTransform + /// + /// Inverts an affine transformation. + /// + /// Original affine transformation. + /// Output reverse affine transformation. + public static void InvertAffineTransform(InputArray m, OutputArray im) + { + if (m == null) + throw new ArgumentNullException("m"); + if (im == null) + throw new ArgumentNullException("im"); + m.ThrowIfDisposed(); + im.ThrowIfNotReady(); + NativeMethods.imgproc_invertAffineTransform(m.CvPtr, im.CvPtr); + GC.KeepAlive(m); + im.Fix(); + } + #endregion + #region GetPerspectiveTransform + /// + /// + /// + /// + /// + /// + public static Mat GetPerspectiveTransform(IEnumerable src, IEnumerable dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + Point2f[] srcArray = EnumerableEx.ToArray(src); + Point2f[] dstArray = EnumerableEx.ToArray(dst); + IntPtr ret = NativeMethods.imgproc_getPerspectiveTransform1(srcArray, dstArray); + return new Mat(ret); + } + /// + /// + /// + /// + /// + /// + public static Mat GetPerspectiveTransform(InputArray src, InputArray dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfDisposed(); + IntPtr ret = NativeMethods.imgproc_getPerspectiveTransform2(src.CvPtr, dst.CvPtr); + GC.KeepAlive(src); + GC.KeepAlive(dst); + return new Mat(ret); + } + #endregion + #region GetAffineTransform + /// + /// + /// + /// + /// + /// + public static Mat GetAffineTransform(IEnumerable src, IEnumerable dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + Point2f[] srcArray = EnumerableEx.ToArray(src); + Point2f[] dstArray = EnumerableEx.ToArray(dst); + IntPtr ret = NativeMethods.imgproc_getAffineTransform1(srcArray, dstArray); + return new Mat(ret); + } + + /// + /// + /// + /// + /// + /// + public static Mat GetAffineTransform(InputArray src, InputArray dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfDisposed(); + IntPtr ret = NativeMethods.imgproc_getAffineTransform2(src.CvPtr, dst.CvPtr); + GC.KeepAlive(src); + GC.KeepAlive(dst); + return new Mat(ret); + } + #endregion + + #region GetRectSubPix + /// + /// Retrieves a pixel rectangle from an image with sub-pixel accuracy. + /// + /// Source image. + /// Size of the extracted patch. + /// Floating point coordinates of the center of the extracted rectangle + /// within the source image. The center must be inside the image. + /// Extracted patch that has the size patchSize and the same number of channels as src . + /// Depth of the extracted pixels. By default, they have the same depth as src. + public static void GetRectSubPix(InputArray image, Size patchSize, Point2f center, + OutputArray patch, int patchType = -1) + { + if (image == null) + throw new ArgumentNullException(nameof(image)); + if (patch == null) + throw new ArgumentNullException(nameof(patch)); + image.ThrowIfDisposed(); + patch.ThrowIfNotReady(); + NativeMethods.imgproc_getRectSubPix(image.CvPtr, patchSize, center, patch.CvPtr, patchType); + GC.KeepAlive(image); + patch.Fix(); + } + #endregion + + /// + /// Remaps an image to log-polar space. + /// + /// Source image + /// Destination image + /// The transformation center; where the output precision is maximal + /// Magnitude scale parameter. + /// A combination of interpolation methods, see cv::InterpolationFlags + public static void LogPolar( + InputArray src, OutputArray dst, + Point2f center, double m, InterpolationFlags flags) + { + if (src == null) + throw new ArgumentNullException(nameof(src)); + if (dst == null) + throw new ArgumentNullException(nameof(dst)); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + + NativeMethods.imgproc_logPolar(src.CvPtr, dst.CvPtr, center, m, (int)flags); + + GC.KeepAlive(src); + dst.Fix(); + } + + /// + /// Remaps an image to polar space. + /// + /// Source image + /// Destination image + /// The transformation center + /// Inverse magnitude scale parameter + /// A combination of interpolation methods, see cv::InterpolationFlags + public static void LinearPolar( + InputArray src, OutputArray dst, + Point2f center, double maxRadius, InterpolationFlags flags) + { + if (src == null) + throw new ArgumentNullException(nameof(src)); + if (dst == null) + throw new ArgumentNullException(nameof(dst)); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + + NativeMethods.imgproc_linearPolar(src.CvPtr, dst.CvPtr, center, maxRadius, (int)flags); + + GC.KeepAlive(src); + dst.Fix(); + } + + #region Integral + /// + /// + /// + /// + /// + /// + public static void Integral(InputArray src, OutputArray sum, int sdepth = -1) + { + if (src == null) + throw new ArgumentNullException("src"); + if (sum == null) + throw new ArgumentNullException("sum"); + src.ThrowIfDisposed(); + sum.ThrowIfNotReady(); + NativeMethods.imgproc_integral1(src.CvPtr, sum.CvPtr, sdepth); + GC.KeepAlive(src); + sum.Fix(); + } + /// + /// + /// + /// + /// + /// + /// + public static void Integral(InputArray src, OutputArray sum, OutputArray sqsum, int sdepth = -1) + { + if (src == null) + throw new ArgumentNullException("src"); + if (sum == null) + throw new ArgumentNullException("sum"); + if (sqsum == null) + throw new ArgumentNullException("sqsum"); + src.ThrowIfDisposed(); + sum.ThrowIfNotReady(); + sqsum.ThrowIfNotReady(); + NativeMethods.imgproc_integral2(src.CvPtr, sum.CvPtr, sqsum.CvPtr, sdepth); + GC.KeepAlive(src); + sum.Fix(); + sqsum.Fix(); + } + /// + /// + /// + /// + /// + /// + /// + /// + public static void Integral(InputArray src, OutputArray sum, OutputArray sqsum, OutputArray tilted, int sdepth = -1) + { + if (src == null) + throw new ArgumentNullException("src"); + if (sum == null) + throw new ArgumentNullException("sum"); + if (sqsum == null) + throw new ArgumentNullException("sqsum"); + if (tilted == null) + throw new ArgumentNullException("tilted"); + src.ThrowIfDisposed(); + sum.ThrowIfNotReady(); + sqsum.ThrowIfNotReady(); + tilted.ThrowIfNotReady(); + NativeMethods.imgproc_integral3(src.CvPtr, sum.CvPtr, sqsum.CvPtr, tilted.CvPtr, sdepth); + GC.KeepAlive(src); + sum.Fix(); + sqsum.Fix(); + tilted.Fix(); + } + #endregion + #region Accumulate* + /// + /// Adds an image to the accumulator. + /// + /// Input image as 1- or 3-channel, 8-bit or 32-bit floating point. + /// Accumulator image with the same number of channels as input image, 32-bit or 64-bit floating-point. + /// Optional operation mask. + public static void Accumulate(InputArray src, InputOutputArray dst, InputArray mask) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.imgproc_accumulate(src.CvPtr, dst.CvPtr, ToPtr(mask)); + GC.KeepAlive(src); + dst.Fix(); + } + /// + /// Adds the square of a source image to the accumulator. + /// + /// Input image as 1- or 3-channel, 8-bit or 32-bit floating point. + /// Accumulator image with the same number of channels as input image, 32-bit or 64-bit floating-point. + /// Optional operation mask. + public static void AccumulateSquare(InputArray src, InputOutputArray dst, InputArray mask) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.imgproc_accumulateSquare(src.CvPtr, dst.CvPtr, ToPtr(mask)); + GC.KeepAlive(src); + dst.Fix(); + } + /// + /// Adds the per-element product of two input images to the accumulator. + /// + /// First input image, 1- or 3-channel, 8-bit or 32-bit floating point. + /// Second input image of the same type and the same size as src1 + /// Accumulator with the same number of channels as input images, 32-bit or 64-bit floating-point. + /// Optional operation mask. + public static void AccumulateProduct(InputArray src1, InputArray src2, InputOutputArray dst, InputArray mask) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (dst == null) + throw new ArgumentNullException("dst"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.imgproc_accumulateProduct(src1.CvPtr, src2.CvPtr, dst.CvPtr, ToPtr(mask)); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + dst.Fix(); + } + /// + /// Updates a running average. + /// + /// Input image as 1- or 3-channel, 8-bit or 32-bit floating point. + /// Accumulator image with the same number of channels as input image, 32-bit or 64-bit floating-point. + /// Weight of the input image. + /// Optional operation mask. + public static void AccumulateWeighted(InputArray src, InputOutputArray dst, double alpha, InputArray mask) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.imgproc_accumulateWeighted(src.CvPtr, dst.CvPtr, alpha, ToPtr(mask)); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region PSNR + /// + /// + /// + /// + /// + /// +// ReSharper disable once InconsistentNaming + public static double PSNR(InputArray src1, InputArray src2) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + var ret = NativeMethods.imgproc_PSNR(src1.CvPtr, src2.CvPtr); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + return ret; + } + #endregion + #region PhaseCorrelate + /// + /// + /// + /// + /// + /// + /// + public static Point2d PhaseCorrelate(InputArray src1, InputArray src2, + InputArray window = null) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + var ret = NativeMethods.imgproc_phaseCorrelate(src1.CvPtr, src2.CvPtr, ToPtr(window)); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + return ret; + } + #endregion + #region PhaseCorrelateRes + /// + /// + /// + /// + /// + /// + /// + public static Point2d PhaseCorrelateRes(InputArray src1, InputArray src2, InputArray window) + { + double response; + return PhaseCorrelateRes(src1, src2, window, out response); + } + /// + /// + /// + /// + /// + /// + /// + /// + public static Point2d PhaseCorrelateRes(InputArray src1, InputArray src2, + InputArray window, out double response) + { + if (src1 == null) + throw new ArgumentNullException("src1"); + if (src2 == null) + throw new ArgumentNullException("src2"); + if (window == null) + throw new ArgumentNullException("src2"); + src1.ThrowIfDisposed(); + src2.ThrowIfDisposed(); + window.ThrowIfDisposed(); + var ret = NativeMethods.imgproc_phaseCorrelateRes(src1.CvPtr, src2.CvPtr, window.CvPtr, out response); + GC.KeepAlive(src1); + GC.KeepAlive(src2); + GC.KeepAlive(window); + return ret; + } + #endregion + #region CreateHanningWindow + /// + /// Computes a Hanning window coefficients in two dimensions. + /// + /// Destination array to place Hann coefficients in + /// The window size specifications + /// Created array type + public static void CreateHanningWindow(InputOutputArray dst, Size winSize, MatType type) + { + if (dst == null) + throw new ArgumentNullException("dst"); + dst.ThrowIfNotReady(); + NativeMethods.imgproc_createHanningWindow(dst.CvPtr, winSize, type); + dst.Fix(); + } + #endregion + #region Threshold + /// + /// Applies a fixed-level threshold to each array element. + /// + /// input array (single-channel, 8-bit or 32-bit floating point). + /// output array of the same size and type as src. + /// threshold value. + /// maximum value to use with the THRESH_BINARY and THRESH_BINARY_INV thresholding types. + /// thresholding type (see the details below). + /// the computed threshold value when type == OTSU + public static double Threshold(InputArray src, OutputArray dst, double thresh, double maxval, ThresholdTypes type) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + double ret = NativeMethods.imgproc_threshold(src.CvPtr, dst.CvPtr, thresh, maxval, (int)type); + GC.KeepAlive(src); + dst.Fix(); + return ret; + } + #endregion + #region AdaptiveThreshold + /// + /// Applies an adaptive threshold to an array. + /// + /// Source 8-bit single-channel image. + /// Destination image of the same size and the same type as src . + /// Non-zero value assigned to the pixels for which the condition is satisfied. See the details below. + /// Adaptive thresholding algorithm to use, ADAPTIVE_THRESH_MEAN_C or ADAPTIVE_THRESH_GAUSSIAN_C . + /// Thresholding type that must be either THRESH_BINARY or THRESH_BINARY_INV . + /// Size of a pixel neighborhood that is used to calculate a threshold value for the pixel: 3, 5, 7, and so on. + /// Constant subtracted from the mean or weighted mean (see the details below). + /// Normally, it is positive but may be zero or negative as well. + public static void AdaptiveThreshold(InputArray src, OutputArray dst, + double maxValue, AdaptiveThresholdTypes adaptiveMethod, ThresholdTypes thresholdType, int blockSize, double c) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.imgproc_adaptiveThreshold(src.CvPtr, dst.CvPtr, maxValue, (int)adaptiveMethod, (int)thresholdType, blockSize, c); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region PyrDown/Up + /// + /// Blurs an image and downsamples it. + /// + /// input image. + /// output image; it has the specified size and the same type as src. + /// size of the output image; by default, it is computed as Size((src.cols+1)/2 + /// + public static void PyrDown(InputArray src, OutputArray dst, + Size? dstSize = null, BorderTypes borderType = BorderTypes.Default) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + Size dstSize0 = dstSize.GetValueOrDefault(new Size()); + NativeMethods.imgproc_pyrDown(src.CvPtr, dst.CvPtr, dstSize0, (int)borderType); + GC.KeepAlive(src); + dst.Fix(); + } + /// + /// Upsamples an image and then blurs it. + /// + /// input image. + /// output image. It has the specified size and the same type as src. + /// size of the output image; by default, it is computed as Size(src.cols*2, (src.rows*2) + /// + public static void PyrUp(InputArray src, OutputArray dst, + Size? dstSize = null, BorderTypes borderType = BorderTypes.Default) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + Size dstSize0 = dstSize.GetValueOrDefault(new Size()); + NativeMethods.imgproc_pyrUp(src.CvPtr, dst.CvPtr, dstSize0, (int)borderType); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region Undistort + /// + /// corrects lens distortion for the given camera matrix and distortion coefficients + /// + /// Input (distorted) image. + /// Output (corrected) image that has the same size and type as src . + /// Input camera matrix + /// Input vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, + /// or 8 elements. If the vector is null, the zero distortion coefficients are assumed. + /// Camera matrix of the distorted image. + /// By default, it is the same as cameraMatrix but you may additionally scale + /// and shift the result by using a different matrix. + public static void Undistort(InputArray src, OutputArray dst, + InputArray cameraMatrix, + InputArray distCoeffs, + InputArray newCameraMatrix = null) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (cameraMatrix == null) + throw new ArgumentNullException("cameraMatrix"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + cameraMatrix.ThrowIfDisposed(); + NativeMethods.imgproc_undistort(src.CvPtr, dst.CvPtr, cameraMatrix.CvPtr, + ToPtr(distCoeffs), ToPtr(newCameraMatrix)); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region InitUndistortRectifyMap + /// + /// initializes maps for cv::remap() to correct lens distortion and optionally rectify the image + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static void InitUndistortRectifyMap( + InputArray cameraMatrix, InputArray distCoeffs, + InputArray r, InputArray newCameraMatrix, + Size size, MatType m1Type, OutputArray map1, OutputArray map2) + { + if (cameraMatrix == null) + throw new ArgumentNullException("cameraMatrix"); + if (distCoeffs == null) + throw new ArgumentNullException("distCoeffs"); + if (r == null) + throw new ArgumentNullException("r"); + if (newCameraMatrix == null) + throw new ArgumentNullException("newCameraMatrix"); + if (map1 == null) + throw new ArgumentNullException("map1"); + if (map2 == null) + throw new ArgumentNullException("map2"); + cameraMatrix.ThrowIfDisposed(); + distCoeffs.ThrowIfDisposed(); + r.ThrowIfDisposed(); + newCameraMatrix.ThrowIfDisposed(); + map1.ThrowIfNotReady(); + map2.ThrowIfNotReady(); + NativeMethods.imgproc_initUndistortRectifyMap( + cameraMatrix.CvPtr, distCoeffs.CvPtr, r.CvPtr, newCameraMatrix.CvPtr, size, m1Type, map1.CvPtr, map2.CvPtr); + GC.KeepAlive(cameraMatrix); + GC.KeepAlive(distCoeffs); + GC.KeepAlive(r); + GC.KeepAlive(newCameraMatrix); + map1.Fix(); + map2.Fix(); + } + #endregion + #region InitWideAngleProjMap + /// + /// initializes maps for cv::remap() for wide-angle + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static float InitWideAngleProjMap( + InputArray cameraMatrix, InputArray distCoeffs, + Size imageSize, int destImageWidth, MatType m1Type, + OutputArray map1, OutputArray map2, + ProjectionType projType, double alpha = 0) + { + if (cameraMatrix == null) + throw new ArgumentNullException("cameraMatrix"); + if (distCoeffs == null) + throw new ArgumentNullException("distCoeffs"); + if (map1 == null) + throw new ArgumentNullException("map1"); + if (map2 == null) + throw new ArgumentNullException("map2"); + cameraMatrix.ThrowIfDisposed(); + distCoeffs.ThrowIfDisposed(); + map1.ThrowIfNotReady(); + map2.ThrowIfNotReady(); + float ret = NativeMethods.imgproc_initWideAngleProjMap(cameraMatrix.CvPtr, distCoeffs.CvPtr, imageSize, + destImageWidth, m1Type, map1.CvPtr, map2.CvPtr, (int)projType, alpha); + GC.KeepAlive(cameraMatrix); + GC.KeepAlive(distCoeffs); + map1.Fix(); + map2.Fix(); + return ret; + } + #endregion + #region GetDefaultNewCameraMatrix + /// + /// returns the default new camera matrix (by default it is the same as cameraMatrix unless centerPricipalPoint=true) + /// + /// Input camera matrix. + /// Camera view image size in pixels. + /// Location of the principal point in the new camera matrix. + /// The parameter indicates whether this location should be at the image center or not. + /// the camera matrix that is either an exact copy of the input cameraMatrix + /// (when centerPrinicipalPoint=false), or the modified one (when centerPrincipalPoint=true). + public static Mat GetDefaultNewCameraMatrix( + InputArray cameraMatrix, Size? imgSize = null, bool centerPrincipalPoint = false) + { + if (cameraMatrix == null) + throw new ArgumentNullException("cameraMatrix"); + cameraMatrix.ThrowIfDisposed(); + Size imgSize0 = imgSize.GetValueOrDefault(new Size()); + IntPtr matPtr = NativeMethods.imgproc_getDefaultNewCameraMatrix(cameraMatrix.CvPtr, imgSize0, centerPrincipalPoint ? 1 : 0); + GC.KeepAlive(cameraMatrix); + return new Mat(matPtr); + } + #endregion + #region UndistortPoints + /// + /// Computes the ideal point coordinates from the observed point coordinates. + /// + /// Observed point coordinates, 1xN or Nx1 2-channel (CV_32FC2 or CV_64FC2). + /// Output ideal point coordinates after undistortion and reverse perspective transformation. + /// If matrix P is identity or omitted, dst will contain normalized point coordinates. + /// Camera matrix + /// Input vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. + /// If the vector is null, the zero distortion coefficients are assumed. + /// Rectification transformation in the object space (3x3 matrix). + /// R1 or R2 computed by stereoRectify() can be passed here. + /// If the matrix is empty, the identity transformation is used. + /// New camera matrix (3x3) or new projection matrix (3x4). + /// P1 or P2 computed by stereoRectify() can be passed here. If the matrix is empty, + /// the identity new camera matrix is used. + public static void UndistortPoints( + InputArray src, OutputArray dst, + InputArray cameraMatrix, InputArray distCoeffs, + InputArray r = null, InputArray p = null) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (cameraMatrix == null) + throw new ArgumentNullException("cameraMatrix"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + cameraMatrix.ThrowIfDisposed(); + NativeMethods.imgproc_undistortPoints(src.CvPtr, dst.CvPtr, cameraMatrix.CvPtr, + ToPtr(distCoeffs), ToPtr(r), ToPtr(p)); + GC.KeepAlive(src); + GC.KeepAlive(cameraMatrix); + GC.KeepAlive(r); + GC.KeepAlive(p); + dst.Fix(); + } + #endregion + #region CalcHist + /// + /// computes the joint dense histogram for a set of images. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static void CalcHist(Mat[] images, + int[] channels, InputArray mask, + OutputArray hist, int dims, int[] histSize, + Rangef[] ranges, bool uniform = true, bool accumulate = false) + { + if (ranges == null) + throw new ArgumentNullException("ranges"); + float[][] rangesFloat = EnumerableEx.SelectToArray( + ranges, r => new [] {r.Start, r.End}); + CalcHist(images, channels, mask, hist, dims, + histSize, rangesFloat, uniform, accumulate); + } + + /// + /// computes the joint dense histogram for a set of images. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static void CalcHist(Mat[] images, + int[] channels, InputArray mask, + OutputArray hist, int dims, int[] histSize, + float[][] ranges, bool uniform = true, bool accumulate = false) + { + if (images == null) + throw new ArgumentNullException("images"); + if (channels == null) + throw new ArgumentNullException("channels"); + if (hist == null) + throw new ArgumentNullException("hist"); + if (histSize == null) + throw new ArgumentNullException("histSize"); + if (ranges == null) + throw new ArgumentNullException("ranges"); + hist.ThrowIfNotReady(); + + IntPtr[] imagesPtr = EnumerableEx.SelectPtrs(images); + using (var rangesPtr = new ArrayAddress2(ranges)) + { + NativeMethods.imgproc_calcHist1(imagesPtr, images.Length, channels, ToPtr(mask), hist.CvPtr, + dims, histSize, rangesPtr, uniform ? 1 : 0, accumulate ? 1 : 0); + } + GC.KeepAlive(images); + GC.KeepAlive(mask); + hist.Fix(); + } + #endregion + #region CalcBackProject + /// + /// computes the joint dense histogram for a set of images. + /// + /// + /// + /// + /// + /// + /// + public static void CalcBackProject(Mat[] images, + int[] channels, InputArray hist, OutputArray backProject, + Rangef[] ranges, bool uniform = true) + { + if (images == null) + throw new ArgumentNullException("images"); + if (channels == null) + throw new ArgumentNullException("channels"); + if (hist == null) + throw new ArgumentNullException("hist"); + if (backProject == null) + throw new ArgumentNullException("backProject"); + if (ranges == null) + throw new ArgumentNullException("ranges"); + hist.ThrowIfDisposed(); + backProject.ThrowIfNotReady(); + + IntPtr[] imagesPtr = EnumerableEx.SelectPtrs(images); + float[][] rangesFloat = EnumerableEx.SelectToArray( + ranges, r => new [] {r.Start, r.End}); + using (var rangesPtr = new ArrayAddress2(rangesFloat)) + { + NativeMethods.imgproc_calcBackProject(imagesPtr, images.Length, channels, hist.CvPtr, + backProject.CvPtr, rangesPtr, uniform ? 1 : 0); + } + GC.KeepAlive(images); + GC.KeepAlive(hist); + backProject.Fix(); + } + #endregion + #region CompareHist + /// + /// compares two histograms stored in dense arrays + /// + /// The first compared histogram + /// The second compared histogram of the same size as h1 + /// The comparison method + /// + public static double CompareHist(InputArray h1, InputArray h2, HistCompMethods method) + { + if (h1 == null) + throw new ArgumentNullException("h1"); + if (h2 == null) + throw new ArgumentNullException("h2"); + h1.ThrowIfDisposed(); + h2.ThrowIfDisposed(); + var ret = NativeMethods.imgproc_compareHist1(h1.CvPtr, h2.CvPtr, (int)method); + GC.KeepAlive(h1); + GC.KeepAlive(h2); + return ret; + } + #endregion + #region EqualizeHist + /// + /// normalizes the grayscale image brightness and contrast by normalizing its histogram + /// + /// The source 8-bit single channel image + /// The destination image; will have the same size and the same type as src + public static void EqualizeHist(InputArray src, OutputArray dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.imgproc_equalizeHist(src.CvPtr, dst.CvPtr); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region CreateCLAHE + /// + /// Creates a predefined CLAHE object + /// + /// + /// + /// + public static CLAHE CreateCLAHE(double clipLimit = 40.0, Size? tileGridSize = null) + { + return CLAHE.Create(clipLimit, tileGridSize); + } + #endregion + #region EMD + /// + /// + /// + /// + /// + /// + /// + + public static float EMD(InputArray signature1, InputArray signature2, DistanceTypes distType) + { + float lowerBound; + return EMD(signature1, signature1, distType, null, out lowerBound, null); + } + /// + /// + /// + /// + /// + /// + /// + /// + public static float EMD(InputArray signature1, InputArray signature2, + DistanceTypes distType, InputArray cost) + { + float lowerBound; + return EMD(signature1, signature1, distType, cost, out lowerBound, null); + } + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static float EMD(InputArray signature1, InputArray signature2, + DistanceTypes distType, InputArray cost, out float lowerBound) + { + return EMD(signature1, signature1, distType, cost, out lowerBound, null); + } + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static float EMD(InputArray signature1, InputArray signature2, + DistanceTypes distType, InputArray cost, out float lowerBound, OutputArray flow) + { + if (signature1 == null) + throw new ArgumentNullException("signature1"); + if (signature2 == null) + throw new ArgumentNullException("signature2"); + signature1.ThrowIfDisposed(); + signature2.ThrowIfDisposed(); + float ret = NativeMethods.imgproc_EMD(signature1.CvPtr, signature2.CvPtr, (int)distType, ToPtr(cost), out lowerBound, ToPtr(flow)); + GC.KeepAlive(signature1); + GC.KeepAlive(signature2); + GC.KeepAlive(cost); + if(flow != null) + flow.Fix(); + return ret; + } + #endregion + #region Watershed + /// + /// Performs a marker-based image segmentation using the watershed algorithm. + /// + /// Input 8-bit 3-channel image. + /// Input/output 32-bit single-channel image (map) of markers. + /// It should have the same size as image. + public static void Watershed(InputArray image, InputOutputArray markers) + { + if (image == null) + throw new ArgumentNullException("image"); + if (markers == null) + throw new ArgumentNullException("markers"); + image.ThrowIfDisposed(); + markers.ThrowIfNotReady(); + NativeMethods.imgproc_watershed(image.CvPtr, markers.CvPtr); + GC.KeepAlive(image); + markers.Fix(); + } + #endregion + #region PyrMeanShiftFiltering + /// + /// Performs initial step of meanshift segmentation of an image. + /// + /// The source 8-bit, 3-channel image. + /// The destination image of the same format and the same size as the source. + /// The spatial window radius. + /// The color window radius. + /// Maximum level of the pyramid for the segmentation. + /// Termination criteria: when to stop meanshift iterations. + public static void PyrMeanShiftFiltering(InputArray src, OutputArray dst, + double sp, double sr, int maxLevel = 1, TermCriteria? termcrit = null) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + TermCriteria termcrit0 = termcrit.GetValueOrDefault( + new TermCriteria(CriteriaType.Count | CriteriaType.Eps, 5, 1)); + NativeMethods.imgproc_pyrMeanShiftFiltering(src.CvPtr, dst.CvPtr, sp, sr, maxLevel, termcrit0); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region GrabCut + /// + /// Segments the image using GrabCut algorithm + /// + /// Input 8-bit 3-channel image. + /// Input/output 8-bit single-channel mask. + /// The mask is initialized by the function when mode is set to GC_INIT_WITH_RECT. + /// Its elements may have Cv2.GC_BGD / Cv2.GC_FGD / Cv2.GC_PR_BGD / Cv2.GC_PR_FGD + /// ROI containing a segmented object. The pixels outside of the ROI are + /// marked as "obvious background". The parameter is only used when mode==GC_INIT_WITH_RECT. + /// Temporary array for the background model. Do not modify it while you are processing the same image. + /// Temporary arrays for the foreground model. Do not modify it while you are processing the same image. + /// Number of iterations the algorithm should make before returning the result. + /// Note that the result can be refined with further calls with mode==GC_INIT_WITH_MASK or mode==GC_EVAL . + /// Operation mode that could be one of GrabCutFlag value. + public static void GrabCut(InputArray img, InputOutputArray mask, Rect rect, + InputOutputArray bgdModel, InputOutputArray fgdModel, + int iterCount, GrabCutModes mode) + { + if (img == null) + throw new ArgumentNullException("img"); + if (mask == null) + throw new ArgumentNullException("mask"); + if (bgdModel == null) + throw new ArgumentNullException("bgdModel"); + if (fgdModel == null) + throw new ArgumentNullException("fgdModel"); + img.ThrowIfDisposed(); + mask.ThrowIfNotReady(); + bgdModel.ThrowIfNotReady(); + fgdModel.ThrowIfNotReady(); + NativeMethods.imgproc_grabCut(img.CvPtr, mask.CvPtr, rect, + bgdModel.CvPtr, fgdModel.CvPtr, iterCount, (int)mode); + GC.KeepAlive(img); + mask.Fix(); + bgdModel.Fix(); + fgdModel.Fix(); + } + #endregion + #region DistanceTransform + /// + /// builds the discrete Voronoi diagram + /// + /// + /// + /// + /// + /// + /// + public static void DistanceTransformWithLabels(InputArray src, + OutputArray dst, + OutputArray labels, + DistanceTypes distanceType, + DistanceMaskSize maskSize, + DistanceTransformLabelTypes labelType = DistanceTransformLabelTypes.CComp) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (labels == null) + throw new ArgumentNullException("labels"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + labels.ThrowIfNotReady(); + NativeMethods.imgproc_distanceTransformWithLabels( + src.CvPtr, dst.CvPtr, labels.CvPtr, (int)distanceType, (int)maskSize, (int)labelType); + GC.KeepAlive(src); + dst.Fix(); + labels.Fix(); + } + + /// + /// computes the distance transform map + /// + /// + /// + /// + /// + public static void DistanceTransform(InputArray src, + OutputArray dst, + DistanceTypes distanceType, + DistanceMaskSize maskSize) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.imgproc_distanceTransform( + src.CvPtr, dst.CvPtr, (int)distanceType, (int)maskSize); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region FloodFill + /// + /// Fills a connected component with the given color. + /// + /// Input/output 1- or 3-channel, 8-bit, or floating-point image. + /// It is modified by the function unless the FLOODFILL_MASK_ONLY flag is set in the + /// second variant of the function. See the details below. + /// Starting point. + /// New value of the repainted domain pixels. + /// + public static int FloodFill(InputOutputArray image, Point seedPoint, Scalar newVal) + { + Rect rect; + return FloodFill(image, seedPoint, newVal, out rect); + } + /// + /// Fills a connected component with the given color. + /// + /// Input/output 1- or 3-channel, 8-bit, or floating-point image. + /// It is modified by the function unless the FLOODFILL_MASK_ONLY flag is set in the + /// second variant of the function. See the details below. + /// Starting point. + /// New value of the repainted domain pixels. + /// Optional output parameter set by the function to the + /// minimum bounding rectangle of the repainted domain. + /// Maximal lower brightness/color difference between the currently + /// observed pixel and one of its neighbors belonging to the component, or a seed pixel + /// being added to the component. + /// Maximal upper brightness/color difference between the currently + /// observed pixel and one of its neighbors belonging to the component, or a seed pixel + /// being added to the component. + /// Operation flags. Lower bits contain a connectivity value, + /// 4 (default) or 8, used within the function. Connectivity determines which + /// neighbors of a pixel are considered. + /// + public static int FloodFill(InputOutputArray image, + Point seedPoint, Scalar newVal, out Rect rect, + Scalar? loDiff = null, Scalar? upDiff = null, + FloodFillFlags flags = FloodFillFlags.Link4) + { + if (image == null) + throw new ArgumentNullException("image"); + image.ThrowIfNotReady(); + Scalar loDiff0 = loDiff.GetValueOrDefault(new Scalar()); + Scalar upDiff0 = upDiff.GetValueOrDefault(new Scalar()); + int ret = NativeMethods.imgproc_floodFill(image.CvPtr, seedPoint, newVal, out rect, + loDiff0, upDiff0, (int)flags); + image.Fix(); + return ret; + } + + /// + /// Fills a connected component with the given color. + /// + /// Input/output 1- or 3-channel, 8-bit, or floating-point image. + /// It is modified by the function unless the FLOODFILL_MASK_ONLY flag is set in the + /// second variant of the function. See the details below. + /// (For the second function only) Operation mask that should be a single-channel 8-bit image, + /// 2 pixels wider and 2 pixels taller. The function uses and updates the mask, so you take responsibility of + /// initializing the mask content. Flood-filling cannot go across non-zero pixels in the mask. For example, + /// an edge detector output can be used as a mask to stop filling at edges. It is possible to use the same mask + /// in multiple calls to the function to make sure the filled area does not overlap. + /// Starting point. + /// New value of the repainted domain pixels. + /// + public static int FloodFill(InputOutputArray image, InputOutputArray mask, + Point seedPoint, Scalar newVal) + { + Rect rect; + return FloodFill(image, mask, seedPoint, newVal, out rect); + } + + /// + /// Fills a connected component with the given color. + /// + /// Input/output 1- or 3-channel, 8-bit, or floating-point image. + /// It is modified by the function unless the FLOODFILL_MASK_ONLY flag is set in the + /// second variant of the function. See the details below. + /// (For the second function only) Operation mask that should be a single-channel 8-bit image, + /// 2 pixels wider and 2 pixels taller. The function uses and updates the mask, so you take responsibility of + /// initializing the mask content. Flood-filling cannot go across non-zero pixels in the mask. For example, + /// an edge detector output can be used as a mask to stop filling at edges. It is possible to use the same mask + /// in multiple calls to the function to make sure the filled area does not overlap. + /// Starting point. + /// New value of the repainted domain pixels. + /// Optional output parameter set by the function to the + /// minimum bounding rectangle of the repainted domain. + /// Maximal lower brightness/color difference between the currently + /// observed pixel and one of its neighbors belonging to the component, or a seed pixel + /// being added to the component. + /// Maximal upper brightness/color difference between the currently + /// observed pixel and one of its neighbors belonging to the component, or a seed pixel + /// being added to the component. + /// Operation flags. Lower bits contain a connectivity value, + /// 4 (default) or 8, used within the function. Connectivity determines which + /// neighbors of a pixel are considered. + /// + public static int FloodFill(InputOutputArray image, InputOutputArray mask, + Point seedPoint, Scalar newVal, out Rect rect, + Scalar? loDiff = null, Scalar? upDiff = null, + FloodFillFlags flags = FloodFillFlags.Link4) + { + if (image == null) + throw new ArgumentNullException("image"); + if (mask == null) + throw new ArgumentNullException("mask"); + image.ThrowIfNotReady(); + mask.ThrowIfNotReady(); + Scalar loDiff0 = loDiff.GetValueOrDefault(new Scalar()); + Scalar upDiff0 = upDiff.GetValueOrDefault(new Scalar()); + int ret = NativeMethods.imgproc_floodFill(image.CvPtr, mask.CvPtr, seedPoint, + newVal, out rect, loDiff0, upDiff0, (int)flags); + image.Fix(); + mask.Fix(); + return ret; + } + #endregion + #region CvtColor +#if LANG_JP + /// + /// 画像の色空間を変換します. + /// + /// 8ビット符号なし整数型,16ビット符号なし整数型,または単精度浮動小数型の入力画像 + /// src と同じサイズ,同じタイプの出力画像 + /// 色空間の変換コード. + /// 出力画像のチャンネル数.この値が 0 の場合,チャンネル数は src と code から自動的に求められます +#else + /// + /// Converts image from one color space to another + /// + /// The source image, 8-bit unsigned, 16-bit unsigned or single-precision floating-point + /// The destination image; will have the same size and the same depth as src + /// The color space conversion code + /// The number of channels in the destination image; if the parameter is 0, the number of the channels will be derived automatically from src and the code +#endif + public static void CvtColor(InputArray src, OutputArray dst, ColorConversionCodes code, int dstCn = 0) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + + NativeMethods.imgproc_cvtColor(src.CvPtr, dst.CvPtr, (int)code, dstCn); + GC.KeepAlive(src); + dst.Fix(); + } + #endregion + #region Moments + /// + /// Calculates all of the moments + /// up to the third order of a polygon or rasterized shape. + /// + /// A raster image (single-channel, 8-bit or floating-point + /// 2D array) or an array ( 1xN or Nx1 ) of 2D points ( Point or Point2f ) + /// If it is true, then all the non-zero image pixels are treated as 1’s + /// + public static Moments Moments(InputArray array, bool binaryImage = false) + { + return new Moments(array, binaryImage); + } + + /// + /// Calculates all of the moments + /// up to the third order of a polygon or rasterized shape. + /// + /// A raster image (8-bit) 2D array + /// If it is true, then all the non-zero image pixels are treated as 1’s + /// + public static Moments Moments(byte[,] array, bool binaryImage = false) + { + return new Moments(array, binaryImage); + } + + /// + /// Calculates all of the moments + /// up to the third order of a polygon or rasterized shape. + /// + /// A raster image (floating-point) 2D array + /// If it is true, then all the non-zero image pixels are treated as 1’s + /// + public static Moments Moments(float[,] array, bool binaryImage = false) + { + return new Moments(array, binaryImage); + } + + /// + /// Calculates all of the moments + /// up to the third order of a polygon or rasterized shape. + /// + /// Array of 2D points + /// If it is true, then all the non-zero image pixels are treated as 1’s + /// + public static Moments Moments(IEnumerable array, bool binaryImage = false) + { + return new Moments(array, binaryImage); + } + + /// + /// Calculates all of the moments + /// up to the third order of a polygon or rasterized shape. + /// + /// Array of 2D points + /// If it is true, then all the non-zero image pixels are treated as 1’s + /// + public static Moments Moments(IEnumerable array, bool binaryImage = false) + { + return new Moments(array, binaryImage); + } + + #endregion + #region MatchTemplate + /// + /// Computes the proximity map for the raster template and the image where the template is searched for + /// + /// Image where the search is running; should be 8-bit or 32-bit floating-point + /// Searched template; must be not greater than the source image and have the same data type + /// A map of comparison results; will be single-channel 32-bit floating-point. + /// If image is WxH and templ is wxh then result will be (W-w+1) x (H-h+1). + /// Specifies the comparison method + /// Mask of searched template. It must have the same datatype and size with templ. It is not set by default. + public static void MatchTemplate( + InputArray image, + InputArray templ, + OutputArray result, + TemplateMatchModes method, + InputArray mask = null) + { + if (image == null) + throw new ArgumentNullException("image"); + if (templ == null) + throw new ArgumentNullException("templ"); + if (result == null) + throw new ArgumentNullException("result"); + image.ThrowIfDisposed(); + templ.ThrowIfDisposed(); + result.ThrowIfNotReady(); + if (mask != null) + mask.ThrowIfDisposed(); + NativeMethods.imgproc_matchTemplate(image.CvPtr, templ.CvPtr, result.CvPtr, (int)method, ToPtr(mask)); + GC.KeepAlive(image); + GC.KeepAlive(templ); + result.Fix(); + GC.KeepAlive(mask); + } + #endregion + #region ConnectedComponents + + /// + /// computes the connected components labeled image of boolean image. + /// image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0 + /// represents the background label. ltype specifies the output label image type, an important + /// consideration based on the total number of labels or alternatively the total number of + /// pixels in the source image. + /// + /// the image to be labeled + /// destination labeled image + /// 8 or 4 for 8-way or 4-way connectivity respectively + /// The number of labels + public static int ConnectedComponents(InputArray image, OutputArray labels, + PixelConnectivity connectivity = PixelConnectivity.Connectivity8) + { + return ConnectedComponents(image, labels, connectivity, MatType.CV_32S); + } + + /// + /// computes the connected components labeled image of boolean image. + /// image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0 + /// represents the background label. ltype specifies the output label image type, an important + /// consideration based on the total number of labels or alternatively the total number of + /// pixels in the source image. + /// + /// the image to be labeled + /// destination labeled image + /// 8 or 4 for 8-way or 4-way connectivity respectively + /// output image label type. Currently CV_32S and CV_16U are supported. + /// The number of labels + public static int ConnectedComponents(InputArray image, OutputArray labels, + PixelConnectivity connectivity, MatType ltype) + { + if (image == null) + throw new ArgumentNullException("image"); + if (labels == null) + throw new ArgumentNullException("labels"); + image.ThrowIfDisposed(); + labels.ThrowIfNotReady(); + + int result = NativeMethods.imgproc_connectedComponents( + image.CvPtr, labels.CvPtr, (int)connectivity, ltype); + + GC.KeepAlive(image); + labels.Fix(); + return result; + } + + /// + /// computes the connected components labeled image of boolean image. + /// image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0 + /// represents the background label. ltype specifies the output label image type, an important + /// consideration based on the total number of labels or alternatively the total number of + /// pixels in the source image. + /// + /// the image to be labeled + /// destination labeled rectangular array + /// 8 or 4 for 8-way or 4-way connectivity respectively + /// The number of labels + public static int ConnectedComponents(InputArray image, out int[,] labels, PixelConnectivity connectivity) + { + using (var labelsMat = new MatOfInt()) + { + int result = ConnectedComponents(image, labelsMat, connectivity, MatType.CV_32S); + labels = labelsMat.ToRectangularArray(); + return result; + } + } + + #endregion + #region ConnectedComponentsWithStats + + /// + /// computes the connected components labeled image of boolean image. + /// image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0 + /// represents the background label. ltype specifies the output label image type, an important + /// consideration based on the total number of labels or alternatively the total number of + /// pixels in the source image. + /// + /// the image to be labeled + /// destination labeled image + /// statistics output for each label, including the background label, + /// see below for available statistics. Statistics are accessed via stats(label, COLUMN) + /// where COLUMN is one of cv::ConnectedComponentsTypes + /// floating point centroid (x,y) output for each label, + /// including the background label + /// 8 or 4 for 8-way or 4-way connectivity respectively + /// + public static int ConnectedComponentsWithStats( + InputArray image, OutputArray labels, + OutputArray stats, OutputArray centroids, + PixelConnectivity connectivity = PixelConnectivity.Connectivity8) + { + return ConnectedComponentsWithStats(image, labels, stats, centroids, connectivity, MatType.CV_32S); + } + + /// + /// computes the connected components labeled image of boolean image. + /// image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0 + /// represents the background label. ltype specifies the output label image type, an important + /// consideration based on the total number of labels or alternatively the total number of + /// pixels in the source image. + /// + /// the image to be labeled + /// destination labeled image + /// statistics output for each label, including the background label, + /// see below for available statistics. Statistics are accessed via stats(label, COLUMN) + /// where COLUMN is one of cv::ConnectedComponentsTypes + /// floating point centroid (x,y) output for each label, + /// including the background label + /// 8 or 4 for 8-way or 4-way connectivity respectively + /// output image label type. Currently CV_32S and CV_16U are supported. + /// + public static int ConnectedComponentsWithStats( + InputArray image, OutputArray labels, + OutputArray stats, OutputArray centroids, + PixelConnectivity connectivity, + MatType ltype) + { + if (image == null) + throw new ArgumentNullException("image"); + if (labels == null) + throw new ArgumentNullException("labels"); + if (stats == null) + throw new ArgumentNullException("stats"); + if (centroids == null) + throw new ArgumentNullException("centroids"); + image.ThrowIfDisposed(); + labels.ThrowIfNotReady(); + stats.ThrowIfNotReady(); + centroids.ThrowIfNotReady(); + + int result = NativeMethods.imgproc_connectedComponentsWithStats( + image.CvPtr, labels.CvPtr, stats.CvPtr, centroids.CvPtr, (int) connectivity, ltype); + + GC.KeepAlive(image); + labels.Fix(); + stats.Fix(); + centroids.Fix(); + return result; + } + + #endregion + #region ConnectedComponentsEx + + /// + /// computes the connected components labeled image of boolean image. + /// image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0 + /// represents the background label. ltype specifies the output label image type, an important + /// consideration based on the total number of labels or alternatively the total number of + /// pixels in the source image. + /// + /// the image to be labeled + /// 8 or 4 for 8-way or 4-way connectivity respectively + /// + public static ConnectedComponents ConnectedComponentsEx( + InputArray image, PixelConnectivity connectivity = PixelConnectivity.Connectivity8) + { + using (var labelsMat = new MatOfInt()) + using (var statsMat = new MatOfInt()) + using (var centroidsMat = new MatOfDouble()) + { + int nLabels = ConnectedComponentsWithStats( + image, labelsMat, statsMat, centroidsMat, connectivity, MatType.CV_32S); + var labels = labelsMat.ToRectangularArray(); + var stats = statsMat.ToRectangularArray(); + var centroids = centroidsMat.ToRectangularArray(); + + var blobs = new ConnectedComponents.Blob[nLabels]; + for (int i = 0; i < nLabels; i++) + { + blobs[i] = new ConnectedComponents.Blob + { + Label = i, + Left = stats[i, 0], + Top = stats[i, 1], + Width = stats[i, 2], + Height = stats[i, 3], + Area = stats[i, 4], + Centroid = new Point2d(centroids[i, 0], centroids[i, 1]), + }; + } + return new ConnectedComponents(blobs, labels, nLabels); + } + } + + #endregion + #region FindContours +#if LANG_JP + /// + /// 2値画像中の輪郭を検出します. + /// + /// 入力画像,8ビット,シングルチャンネル.0以外のピクセルは 1として,0のピクセルは0のまま扱われます. + /// また,この関数は,輪郭抽出処理中に入力画像 image の中身を書き換えます. + /// 検出された輪郭.各輪郭は,点のベクトルとして格納されます. + /// 画像のトポロジーに関する情報を含む出力ベクトル.これは,輪郭数と同じ数の要素を持ちます.各輪郭 contours[i] に対して, + /// 要素 hierarchy[i]のメンバにはそれぞれ,同じ階層レベルに存在する前後の輪郭,最初の子輪郭,および親輪郭の + /// contours インデックス(0 基準)がセットされます.また,輪郭 i において,前後,親,子の輪郭が存在しない場合, + /// それに対応する hierarchy[i] の要素は,負の値になります. + /// 輪郭抽出モード + /// 輪郭の近似手法 + /// オプションのオフセット.各輪郭点はこの値の分だけシフトします.これは,ROIの中で抽出された輪郭を,画像全体に対して位置づけて解析する場合に役立ちます. +#else + /// + /// Finds contours in a binary image. + /// + /// Source, an 8-bit single-channel image. Non-zero pixels are treated as 1’s. + /// Zero pixels remain 0’s, so the image is treated as binary. + /// The function modifies the image while extracting the contours. + /// Detected contours. Each contour is stored as a vector of points. + /// Optional output vector, containing information about the image topology. + /// It has as many elements as the number of contours. For each i-th contour contours[i], + /// the members of the elements hierarchy[i] are set to 0-based indices in contours of the next + /// and previous contours at the same hierarchical level, the first child contour and the parent contour, respectively. + /// If for the contour i there are no next, previous, parent, or nested contours, the corresponding elements of hierarchy[i] will be negative. + /// Contour retrieval mode + /// Contour approximation method + /// Optional offset by which every contour point is shifted. + /// This is useful if the contours are extracted from the image ROI and then they should be analyzed in the whole image context. +#endif + public static void FindContours(InputOutputArray image, out Point[][] contours, + out HierarchyIndex[] hierarchy, RetrievalModes mode, ContourApproximationModes method, Point? offset = null) + { + if (image == null) + throw new ArgumentNullException("image"); + image.ThrowIfNotReady(); + + Point offset0 = offset.GetValueOrDefault(new Point()); + IntPtr contoursPtr, hierarchyPtr; + NativeMethods.imgproc_findContours1_vector(image.CvPtr, out contoursPtr, out hierarchyPtr, (int)mode, (int)method, offset0); + + using (var contoursVec = new VectorOfVectorPoint(contoursPtr)) + using (var hierarchyVec = new VectorOfVec4i(hierarchyPtr)) + { + contours = contoursVec.ToArray(); + Vec4i[] hierarchyOrg = hierarchyVec.ToArray(); + hierarchy = EnumerableEx.SelectToArray(hierarchyOrg, HierarchyIndex.FromVec4i); + } + image.Fix(); + } +#if LANG_JP + /// + /// 2値画像中の輪郭を検出します. + /// + /// 入力画像,8ビット,シングルチャンネル.0以外のピクセルは 1として,0のピクセルは0のまま扱われます. + /// また,この関数は,輪郭抽出処理中に入力画像 image の中身を書き換えます. + /// 検出された輪郭.各輪郭は,点のベクトルとして格納されます. + /// 画像のトポロジーに関する情報を含む出力ベクトル.これは,輪郭数と同じ数の要素を持ちます.各輪郭 contours[i] に対して, + /// 要素 hierarchy[i]のメンバにはそれぞれ,同じ階層レベルに存在する前後の輪郭,最初の子輪郭,および親輪郭の + /// contours インデックス(0 基準)がセットされます.また,輪郭 i において,前後,親,子の輪郭が存在しない場合, + /// それに対応する hierarchy[i] の要素は,負の値になります. + /// 輪郭抽出モード + /// 輪郭の近似手法 + /// オプションのオフセット.各輪郭点はこの値の分だけシフトします.これは,ROIの中で抽出された輪郭を,画像全体に対して位置づけて解析する場合に役立ちます. +#else + /// + /// Finds contours in a binary image. + /// + /// Source, an 8-bit single-channel image. Non-zero pixels are treated as 1’s. + /// Zero pixels remain 0’s, so the image is treated as binary. + /// The function modifies the image while extracting the contours. + /// Detected contours. Each contour is stored as a vector of points. + /// Optional output vector, containing information about the image topology. + /// It has as many elements as the number of contours. For each i-th contour contours[i], + /// the members of the elements hierarchy[i] are set to 0-based indices in contours of the next + /// and previous contours at the same hierarchical level, the first child contour and the parent contour, respectively. + /// If for the contour i there are no next, previous, parent, or nested contours, the corresponding elements of hierarchy[i] will be negative. + /// Contour retrieval mode + /// Contour approximation method + /// Optional offset by which every contour point is shifted. + /// This is useful if the contours are extracted from the image ROI and then they should be analyzed in the whole image context. +#endif + public static void FindContours(InputOutputArray image, out Mat[] contours, + OutputArray hierarchy, RetrievalModes mode, ContourApproximationModes method, Point? offset = null) + { + if (image == null) + throw new ArgumentNullException("image"); + if (hierarchy == null) + throw new ArgumentNullException("hierarchy"); + image.ThrowIfNotReady(); + hierarchy.ThrowIfNotReady(); + + Point offset0 = offset.GetValueOrDefault(new Point()); + IntPtr contoursPtr; + NativeMethods.imgproc_findContours1_OutputArray(image.CvPtr, out contoursPtr, hierarchy.CvPtr, (int)mode, (int)method, offset0); + + using (var contoursVec = new VectorOfMat(contoursPtr)) + { + contours = contoursVec.ToArray(); + } + image.Fix(); + hierarchy.Fix(); + } + +#if LANG_JP + /// + /// 2値画像中の輪郭を検出します. + /// + /// 入力画像,8ビット,シングルチャンネル.0以外のピクセルは 1として,0のピクセルは0のまま扱われます. + /// また,この関数は,輪郭抽出処理中に入力画像 image の中身を書き換えます. + /// 輪郭抽出モード + /// 輪郭の近似手法 + /// オプションのオフセット.各輪郭点はこの値の分だけシフトします.これは,ROIの中で抽出された輪郭を,画像全体に対して位置づけて解析する場合に役立ちます. + /// 検出された輪郭.各輪郭は,点のベクトルとして格納されます. +#else + /// + /// Finds contours in a binary image. + /// + /// Source, an 8-bit single-channel image. Non-zero pixels are treated as 1’s. + /// Zero pixels remain 0’s, so the image is treated as binary. + /// The function modifies the image while extracting the contours. + /// Contour retrieval mode + /// Contour approximation method + /// Optional offset by which every contour point is shifted. + /// This is useful if the contours are extracted from the image ROI and then they should be analyzed in the whole image context. + /// Detected contours. Each contour is stored as a vector of points. +#endif + public static Point[][] FindContoursAsArray(InputOutputArray image, + RetrievalModes mode, ContourApproximationModes method, Point? offset = null) + { + if (image == null) + throw new ArgumentNullException("image"); + image.ThrowIfNotReady(); + + Point offset0 = offset.GetValueOrDefault(new Point()); + IntPtr contoursPtr; + NativeMethods.imgproc_findContours2_vector(image.CvPtr, out contoursPtr, (int)mode, (int)method, offset0); + image.Fix(); + + using (var contoursVec = new VectorOfVectorPoint(contoursPtr)) + { + return contoursVec.ToArray(); + } + } +#if LANG_JP + /// + /// 2値画像中の輪郭を検出します. + /// + /// 入力画像,8ビット,シングルチャンネル.0以外のピクセルは 1として,0のピクセルは0のまま扱われます. + /// また,この関数は,輪郭抽出処理中に入力画像 image の中身を書き換えます. + /// 輪郭抽出モード + /// 輪郭の近似手法 + /// オプションのオフセット.各輪郭点はこの値の分だけシフトします.これは,ROIの中で抽出された輪郭を,画像全体に対して位置づけて解析する場合に役立ちます. + /// 検出された輪郭.各輪郭は,点のベクトルとして格納されます. +#else + /// + /// Finds contours in a binary image. + /// + /// Source, an 8-bit single-channel image. Non-zero pixels are treated as 1’s. + /// Zero pixels remain 0’s, so the image is treated as binary. + /// The function modifies the image while extracting the contours. + /// Contour retrieval mode + /// Contour approximation method + /// Optional offset by which every contour point is shifted. + /// This is useful if the contours are extracted from the image ROI and then they should be analyzed in the whole image context. + /// Detected contours. Each contour is stored as a vector of points. +#endif + public static MatOfPoint[] FindContoursAsMat(InputOutputArray image, + RetrievalModes mode, ContourApproximationModes method, Point? offset = null) + { + if (image == null) + throw new ArgumentNullException("image"); + image.ThrowIfNotReady(); + + Point offset0 = offset.GetValueOrDefault(new Point()); + IntPtr contoursPtr; + NativeMethods.imgproc_findContours2_OutputArray(image.CvPtr, out contoursPtr, (int)mode, (int)method, offset0); + image.Fix(); + + using (var contoursVec = new VectorOfMat(contoursPtr)) + { + return contoursVec.ToArray(); + } + } + #endregion + #region ApproxPolyDP + + /// + /// Approximates contour or a curve using Douglas-Peucker algorithm + /// + /// The polygon or curve to approximate. + /// Must be 1 x N or N x 1 matrix of type CV_32SC2 or CV_32FC2. + /// The result of the approximation; + /// The type should match the type of the input curve + /// Specifies the approximation accuracy. + /// This is the maximum distance between the original curve and its approximation. + /// The result of the approximation; + /// The type should match the type of the input curve + public static void ApproxPolyDP(InputArray curve, OutputArray approxCurve, double epsilon, bool closed) + { + if (curve == null) + throw new ArgumentNullException("curve"); + if (approxCurve == null) + throw new ArgumentNullException("approxCurve"); + curve.ThrowIfDisposed(); + approxCurve.ThrowIfNotReady(); + NativeMethods.imgproc_approxPolyDP_InputArray(curve.CvPtr, approxCurve.CvPtr, epsilon, closed ? 1 : 0); + GC.KeepAlive(curve); + approxCurve.Fix(); + } + /// + /// Approximates contour or a curve using Douglas-Peucker algorithm + /// + /// The polygon or curve to approximate. + /// Specifies the approximation accuracy. + /// This is the maximum distance between the original curve and its approximation. + /// The result of the approximation; + /// The type should match the type of the input curve + /// The result of the approximation; + /// The type should match the type of the input curve + public static Point[] ApproxPolyDP(IEnumerable curve, double epsilon, bool closed) + { + if(curve == null) + throw new ArgumentNullException("curve"); + Point[] curveArray = EnumerableEx.ToArray(curve); + IntPtr approxCurvePtr; + NativeMethods.imgproc_approxPolyDP_Point(curveArray, curveArray.Length, out approxCurvePtr, epsilon, closed ? 1 : 0); + using (var approxCurveVec = new VectorOfPoint(approxCurvePtr)) + { + return approxCurveVec.ToArray(); + } + } + /// + /// Approximates contour or a curve using Douglas-Peucker algorithm + /// + /// The polygon or curve to approximate. + /// Specifies the approximation accuracy. + /// This is the maximum distance between the original curve and its approximation. + /// If true, the approximated curve is closed + /// (i.e. its first and last vertices are connected), otherwise it’s not + /// The result of the approximation; + /// The type should match the type of the input curve + public static Point2f[] ApproxPolyDP(IEnumerable curve, double epsilon, bool closed) + { + if (curve == null) + throw new ArgumentNullException("curve"); + Point2f[] curveArray = EnumerableEx.ToArray(curve); + IntPtr approxCurvePtr; + NativeMethods.imgproc_approxPolyDP_Point2f(curveArray, curveArray.Length, out approxCurvePtr, epsilon, closed ? 1 : 0); + using (var approxCurveVec = new VectorOfPoint2f(approxCurvePtr)) + { + return approxCurveVec.ToArray(); + } + } + #endregion + #region ArcLength + /// + /// Calculates a contour perimeter or a curve length. + /// + /// The input vector of 2D points, represented by CV_32SC2 or CV_32FC2 matrix. + /// Indicates, whether the curve is closed or not. + /// + public static double ArcLength(InputArray curve, bool closed) + { + if (curve == null) + throw new ArgumentNullException("curve"); + curve.ThrowIfDisposed(); + var ret = NativeMethods.imgproc_arcLength_InputArray(curve.CvPtr, closed ? 1 : 0); + GC.KeepAlive(curve); + return ret; + } + + /// + /// Calculates a contour perimeter or a curve length. + /// + /// The input vector of 2D points. + /// Indicates, whether the curve is closed or not. + /// + public static double ArcLength(IEnumerable curve, bool closed) + { + if (curve == null) + throw new ArgumentNullException("curve"); + Point[] curveArray = EnumerableEx.ToArray(curve); + return NativeMethods.imgproc_arcLength_Point(curveArray, curveArray.Length, closed ? 1 : 0); + } + + /// + /// Calculates a contour perimeter or a curve length. + /// + /// The input vector of 2D points. + /// Indicates, whether the curve is closed or not. + /// + public static double ArcLength(IEnumerable curve, bool closed) + { + if (curve == null) + throw new ArgumentNullException("curve"); + Point2f[] curveArray = EnumerableEx.ToArray(curve); + return NativeMethods.imgproc_arcLength_Point2f(curveArray, curveArray.Length, closed ? 1 : 0); + } + #endregion + #region BoundingRect + /// + /// Calculates the up-right bounding rectangle of a point set. + /// + /// The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix. + /// Minimal up-right bounding rectangle for the specified point set. + public static Rect BoundingRect(InputArray curve) + { + if (curve == null) + throw new ArgumentNullException("curve"); + curve.ThrowIfDisposed(); + var ret = NativeMethods.imgproc_boundingRect_InputArray(curve.CvPtr); + GC.KeepAlive(curve); + return ret; + } + + /// + /// Calculates the up-right bounding rectangle of a point set. + /// + /// The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix. + /// Minimal up-right bounding rectangle for the specified point set. + public static Rect BoundingRect(IEnumerable curve) + { + if (curve == null) + throw new ArgumentNullException("curve"); + Point[] curveArray = EnumerableEx.ToArray(curve); + return NativeMethods.imgproc_boundingRect_Point(curveArray, curveArray.Length); + } + + /// + /// Calculates the up-right bounding rectangle of a point set. + /// + /// The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix. + /// Minimal up-right bounding rectangle for the specified point set. + public static Rect BoundingRect(IEnumerable curve) + { + if (curve == null) + throw new ArgumentNullException("curve"); + Point2f[] curveArray = EnumerableEx.ToArray(curve); + return NativeMethods.imgproc_boundingRect_Point2f(curveArray, curveArray.Length); + } + #endregion + #region ContourArea + /// + /// Calculates the contour area + /// + /// The contour vertices, represented by CV_32SC2 or CV_32FC2 matrix + /// + /// + public static double ContourArea(InputArray contour, bool oriented = false) + { + if (contour == null) + throw new ArgumentNullException("contour"); + contour.ThrowIfDisposed(); + var ret = NativeMethods.imgproc_contourArea_InputArray(contour.CvPtr, oriented ? 1 : 0); + GC.KeepAlive(contour); + return ret; + } + /// + /// Calculates the contour area + /// + /// The contour vertices, represented by CV_32SC2 or CV_32FC2 matrix + /// + /// + public static double ContourArea(IEnumerable contour, bool oriented = false) + { + if (contour == null) + throw new ArgumentNullException("contour"); + Point[] contourArray = EnumerableEx.ToArray(contour); + return NativeMethods.imgproc_contourArea_Point(contourArray, contourArray.Length, oriented ? 1 : 0); + } + /// + /// Calculates the contour area + /// + /// The contour vertices, represented by CV_32SC2 or CV_32FC2 matrix + /// + /// + public static double ContourArea(IEnumerable contour, bool oriented = false) + { + if (contour == null) + throw new ArgumentNullException("contour"); + Point2f[] contourArray = EnumerableEx.ToArray(contour); + return NativeMethods.imgproc_contourArea_Point2f(contourArray, contourArray.Length, oriented ? 1 : 0); + } + #endregion + #region MinAreaRect + /// + /// Finds the minimum area rotated rectangle enclosing a 2D point set. + /// + /// The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix. + /// + public static RotatedRect MinAreaRect(InputArray points) + { + if (points == null) + throw new ArgumentNullException("points"); + points.ThrowIfDisposed(); + var ret = NativeMethods.imgproc_minAreaRect_InputArray(points.CvPtr); + GC.KeepAlive(points); + return ret; + } + /// + /// Finds the minimum area rotated rectangle enclosing a 2D point set. + /// + /// The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix. + /// + public static RotatedRect MinAreaRect(IEnumerable points) + { + if (points == null) + throw new ArgumentNullException("points"); + Point[] pointsArray = EnumerableEx.ToArray(points); + return NativeMethods.imgproc_minAreaRect_Point(pointsArray, pointsArray.Length); + } + /// + /// Finds the minimum area rotated rectangle enclosing a 2D point set. + /// + /// The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix. + /// + public static RotatedRect MinAreaRect(IEnumerable points) + { + if (points == null) + throw new ArgumentNullException("points"); + Point2f[] pointsArray = EnumerableEx.ToArray(points); + return NativeMethods.imgproc_minAreaRect_Point2f(pointsArray, pointsArray.Length); + } + #endregion + #region MinEnclosingCircle + /// + /// Finds the minimum area circle enclosing a 2D point set. + /// + /// The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix. + /// The output center of the circle + /// The output radius of the circle + public static void MinEnclosingCircle(InputArray points, out Point2f center, out float radius) + { + if (points == null) + throw new ArgumentNullException("points"); + points.ThrowIfDisposed(); + NativeMethods.imgproc_minEnclosingCircle_InputArray(points.CvPtr, out center, out radius); + GC.KeepAlive(points); + } + + /// + /// Finds the minimum area circle enclosing a 2D point set. + /// + /// The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix. + /// The output center of the circle + /// The output radius of the circle + public static void MinEnclosingCircle(IEnumerable points, out Point2f center, out float radius) + { + if (points == null) + throw new ArgumentNullException("points"); + Point[] pointsArray = EnumerableEx.ToArray(points); + NativeMethods.imgproc_minEnclosingCircle_Point(pointsArray, pointsArray.Length, out center, out radius); + } + + /// + /// Finds the minimum area circle enclosing a 2D point set. + /// + /// The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix. + /// The output center of the circle + /// The output radius of the circle + public static void MinEnclosingCircle(IEnumerable points, out Point2f center, out float radius) + { + if (points == null) + throw new ArgumentNullException("points"); + Point2f[] pointsArray = EnumerableEx.ToArray(points); + NativeMethods.imgproc_minEnclosingCircle_Point2f(pointsArray, pointsArray.Length, out center, out radius); + } + #endregion + #region MatchShapes + /// + /// matches two contours using one of the available algorithms + /// + /// + /// + /// + /// + /// + public static double MatchShapes(InputArray contour1, InputArray contour2, ShapeMatchModes method, double parameter = 0) + { + if (contour1 == null) + throw new ArgumentNullException("contour1"); + if (contour2 == null) + throw new ArgumentNullException("contour2"); + var ret = NativeMethods.imgproc_matchShapes_InputArray(contour1.CvPtr, contour2.CvPtr, (int)method, parameter); + GC.KeepAlive(contour1); + GC.KeepAlive(contour2); + return ret; + } + /// + /// matches two contours using one of the available algorithms + /// + /// + /// + /// + /// + /// + public static double MatchShapes(IEnumerable contour1, IEnumerable contour2, + ShapeMatchModes method, double parameter = 0) + { + if (contour1 == null) + throw new ArgumentNullException("contour1"); + if (contour2 == null) + throw new ArgumentNullException("contour2"); + Point[] contour1Array = EnumerableEx.ToArray(contour1); + Point[] contour2Array = EnumerableEx.ToArray(contour2); + return NativeMethods.imgproc_matchShapes_Point(contour1Array, contour1Array.Length, + contour2Array, contour2Array.Length, (int)method, parameter); + } + #endregion + #region ConvexHull + /// + /// Computes convex hull for a set of 2D points. + /// + /// The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix + /// The output convex hull. It is either a vector of points that form the + /// hull (must have the same type as the input points), or a vector of 0-based point + /// indices of the hull points in the original array (since the set of convex hull + /// points is a subset of the original point set). + /// If true, the output convex hull will be oriented clockwise, + /// otherwise it will be oriented counter-clockwise. Here, the usual screen coordinate + /// system is assumed - the origin is at the top-left corner, x axis is oriented to the right, + /// and y axis is oriented downwards. + /// + public static void ConvexHull(InputArray points, OutputArray hull, bool clockwise = false, bool returnPoints = true) + { + if (points == null) + throw new ArgumentNullException("points"); + if (hull == null) + throw new ArgumentNullException("hull"); + points.ThrowIfDisposed(); + hull.ThrowIfNotReady(); + NativeMethods.imgproc_convexHull_InputArray(points.CvPtr, hull.CvPtr, clockwise ? 1 : 0, returnPoints ? 1 : 0); + GC.KeepAlive(points); + hull.Fix(); + } + + /// + /// Computes convex hull for a set of 2D points. + /// + /// The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix + /// If true, the output convex hull will be oriented clockwise, + /// otherwise it will be oriented counter-clockwise. Here, the usual screen coordinate + /// system is assumed - the origin is at the top-left corner, x axis is oriented to the right, + /// and y axis is oriented downwards. + /// The output convex hull. It is a vector of points that form + /// the hull (must have the same type as the input points). + public static Point[] ConvexHull(IEnumerable points, bool clockwise = false) + { + if (points == null) + throw new ArgumentNullException("points"); + Point[] pointsArray = EnumerableEx.ToArray(points); + IntPtr hullPtr; + NativeMethods.imgproc_convexHull_Point_ReturnsPoints(pointsArray, pointsArray.Length, out hullPtr, clockwise ? 1 : 0); + using (var hullVec = new VectorOfPoint(hullPtr)) + { + return hullVec.ToArray(); + } + } + + /// + /// Computes convex hull for a set of 2D points. + /// + /// The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix + /// If true, the output convex hull will be oriented clockwise, + /// otherwise it will be oriented counter-clockwise. Here, the usual screen coordinate + /// system is assumed - the origin is at the top-left corner, x axis is oriented to the right, + /// and y axis is oriented downwards. + /// The output convex hull. It is a vector of points that form + /// the hull (must have the same type as the input points). + public static Point2f[] ConvexHull(IEnumerable points, bool clockwise = false) + { + if (points == null) + throw new ArgumentNullException("points"); + Point2f[] pointsArray = EnumerableEx.ToArray(points); + IntPtr hullPtr; + NativeMethods.imgproc_convexHull_Point2f_ReturnsPoints(pointsArray, pointsArray.Length, out hullPtr, + clockwise ? 1 : 0); + using (var hullVec = new VectorOfPoint2f(hullPtr)) + { + return hullVec.ToArray(); + } + } + + /// + /// Computes convex hull for a set of 2D points. + /// + /// The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix + /// If true, the output convex hull will be oriented clockwise, + /// otherwise it will be oriented counter-clockwise. Here, the usual screen coordinate + /// system is assumed - the origin is at the top-left corner, x axis is oriented to the right, + /// and y axis is oriented downwards. + /// The output convex hull. It is a vector of 0-based point indices of the + /// hull points in the original array (since the set of convex hull points is a subset of the original point set). + public static int[] ConvexHullIndices(IEnumerable points, bool clockwise = false) + { + if (points == null) + throw new ArgumentNullException("points"); + Point[] pointsArray = EnumerableEx.ToArray(points); + IntPtr hullPtr; + NativeMethods.imgproc_convexHull_Point_ReturnsIndices(pointsArray, pointsArray.Length, out hullPtr, clockwise ? 1 : 0); + using (var hullVec = new VectorOfInt32(hullPtr)) + { + return hullVec.ToArray(); + } + } + + /// + /// Computes convex hull for a set of 2D points. + /// + /// The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix + /// If true, the output convex hull will be oriented clockwise, + /// otherwise it will be oriented counter-clockwise. Here, the usual screen coordinate + /// system is assumed - the origin is at the top-left corner, x axis is oriented to the right, + /// and y axis is oriented downwards. + /// The output convex hull. It is a vector of 0-based point indices of the + /// hull points in the original array (since the set of convex hull points is a subset of the original point set). + public static int[] ConvexHullIndices(IEnumerable points, bool clockwise = false) + { + if (points == null) + throw new ArgumentNullException("points"); + Point2f[] pointsArray = EnumerableEx.ToArray(points); + IntPtr hullPtr; + NativeMethods.imgproc_convexHull_Point2f_ReturnsIndices(pointsArray, pointsArray.Length, out hullPtr, clockwise ? 1 : 0); + using (var hullVec = new VectorOfInt32(hullPtr)) + { + return hullVec.ToArray(); + } + } + #endregion + #region ConvexityDefects + + /// + /// Computes the contour convexity defects + /// + /// Input contour. + /// Convex hull obtained using convexHull() that + /// should contain indices of the contour points that make the hull. + /// + /// The output vector of convexity defects. + /// Each convexity defect is represented as 4-element integer vector + /// (a.k.a. cv::Vec4i): (start_index, end_index, farthest_pt_index, fixpt_depth), + /// where indices are 0-based indices in the original contour of the convexity defect beginning, + /// end and the farthest point, and fixpt_depth is fixed-point approximation + /// (with 8 fractional bits) of the distance between the farthest contour point and the hull. + /// That is, to get the floating-point value of the depth will be fixpt_depth/256.0. + /// + public static void ConvexityDefects(InputArray contour, InputArray convexHull, OutputArray convexityDefects) + { + if (contour == null) + throw new ArgumentNullException("contour"); + if (convexHull == null) + throw new ArgumentNullException("convexHull"); + if (convexityDefects == null) + throw new ArgumentNullException("convexityDefects"); + contour.ThrowIfDisposed(); + convexHull.ThrowIfDisposed(); + convexityDefects.ThrowIfNotReady(); + NativeMethods.imgproc_convexityDefects_InputArray(contour.CvPtr, convexHull.CvPtr, convexityDefects.CvPtr); + GC.KeepAlive(contour); + GC.KeepAlive(convexHull); + convexityDefects.Fix(); + } + + /// + /// Computes the contour convexity defects + /// + /// Input contour. + /// Convex hull obtained using convexHull() that + /// should contain indices of the contour points that make the hull. + /// The output vector of convexity defects. + /// Each convexity defect is represented as 4-element integer vector + /// (a.k.a. cv::Vec4i): (start_index, end_index, farthest_pt_index, fixpt_depth), + /// where indices are 0-based indices in the original contour of the convexity defect beginning, + /// end and the farthest point, and fixpt_depth is fixed-point approximation + /// (with 8 fractional bits) of the distance between the farthest contour point and the hull. + /// That is, to get the floating-point value of the depth will be fixpt_depth/256.0. + public static Vec4i[] ConvexityDefects(IEnumerable contour, IEnumerable convexHull) + { + if (contour == null) + throw new ArgumentNullException("contour"); + if (convexHull == null) + throw new ArgumentNullException("convexHull"); + Point[] contourArray = EnumerableEx.ToArray(contour); + int[] convexHullArray = EnumerableEx.ToArray(convexHull); + IntPtr convexityDefectsPtr; + NativeMethods.imgproc_convexityDefects_Point(contourArray, contourArray.Length, + convexHullArray, convexHullArray.Length, out convexityDefectsPtr); + + using (var convexityDefects = new VectorOfVec4i(convexityDefectsPtr)) + { + return convexityDefects.ToArray(); + } + } + + /// + /// Computes the contour convexity defects + /// + /// Input contour. + /// Convex hull obtained using convexHull() that + /// should contain indices of the contour points that make the hull. + /// The output vector of convexity defects. + /// Each convexity defect is represented as 4-element integer vector + /// (a.k.a. cv::Vec4i): (start_index, end_index, farthest_pt_index, fixpt_depth), + /// where indices are 0-based indices in the original contour of the convexity defect beginning, + /// end and the farthest point, and fixpt_depth is fixed-point approximation + /// (with 8 fractional bits) of the distance between the farthest contour point and the hull. + /// That is, to get the floating-point value of the depth will be fixpt_depth/256.0. + public static Vec4i[] ConvexityDefects(IEnumerable contour, IEnumerable convexHull) + { + if (contour == null) + throw new ArgumentNullException("contour"); + if (convexHull == null) + throw new ArgumentNullException("convexHull"); + Point2f[] contourArray = EnumerableEx.ToArray(contour); + int[] convexHullArray = EnumerableEx.ToArray(convexHull); + IntPtr convexityDefectsPtr; + NativeMethods.imgproc_convexityDefects_Point2f(contourArray, contourArray.Length, + convexHullArray, convexHullArray.Length, out convexityDefectsPtr); + + using (var convexityDefects = new VectorOfVec4i(convexityDefectsPtr)) + { + return convexityDefects.ToArray(); + } + } + #endregion + #region IsContourConvex + /// + /// returns true if the contour is convex. + /// Does not support contours with self-intersection + /// + /// Input vector of 2D points + /// + public static bool IsContourConvex(InputArray contour) + { + if (contour == null) + throw new ArgumentNullException("contour"); + contour.ThrowIfDisposed(); + int ret = NativeMethods.imgproc_isContourConvex_InputArray(contour.CvPtr); + GC.KeepAlive(contour); + return ret != 0; + } + /// + /// returns true if the contour is convex. + /// Does not support contours with self-intersection + /// + /// Input vector of 2D points + /// + public static bool IsContourConvex(IEnumerable contour) + { + if (contour == null) + throw new ArgumentNullException("contour"); + Point[] contourArray = EnumerableEx.ToArray(contour); + int ret = NativeMethods.imgproc_isContourConvex_Point(contourArray, contourArray.Length); + return ret != 0; + } + /// + /// returns true if the contour is convex. D + /// oes not support contours with self-intersection + /// + /// Input vector of 2D points + /// + public static bool IsContourConvex(IEnumerable contour) + { + if (contour == null) + throw new ArgumentNullException("contour"); + Point2f[] contourArray = EnumerableEx.ToArray(contour); + int ret = NativeMethods.imgproc_isContourConvex_Point2f(contourArray, contourArray.Length); + return ret != 0; + } + #endregion + #region IntersectConvexConvex + /// + /// finds intersection of two convex polygons + /// + /// + /// + /// + /// + /// + public static float IntersectConvexConvex(InputArray p1, InputArray p2, OutputArray p12, bool handleNested = true) + { + if (p1 == null) + throw new ArgumentNullException("p1"); + if (p2 == null) + throw new ArgumentNullException("p2"); + if (p12 == null) + throw new ArgumentNullException("p12"); + p1.ThrowIfDisposed(); + p2.ThrowIfDisposed(); + p12.ThrowIfNotReady(); + float ret = NativeMethods.imgproc_intersectConvexConvex_InputArray(p1.CvPtr, p2.CvPtr, p12.CvPtr, handleNested ? 1 : 0); + GC.KeepAlive(p1); + GC.KeepAlive(p2); + p12.Fix(); + return ret; + } + /// + /// finds intersection of two convex polygons + /// + /// + /// + /// + /// + /// + public static float IntersectConvexConvex(IEnumerable p1, IEnumerable p2, + out Point[] p12, bool handleNested = true) + { + if (p1 == null) + throw new ArgumentNullException("p1"); + if (p2 == null) + throw new ArgumentNullException("p2"); + Point[] p1Array = EnumerableEx.ToArray(p1); + Point[] p2Array = EnumerableEx.ToArray(p2); + IntPtr p12Ptr; + float ret = NativeMethods.imgproc_intersectConvexConvex_Point(p1Array, p1Array.Length, p2Array, p2Array.Length, + out p12Ptr, handleNested ? 1 : 0); + + using (var p12Vec = new VectorOfPoint(p12Ptr)) + { + p12 = p12Vec.ToArray(); + } + + return ret; + } + /// + /// finds intersection of two convex polygons + /// + /// + /// + /// + /// + /// + public static float IntersectConvexConvex(IEnumerable p1, IEnumerable p2, + out Point2f[] p12, bool handleNested = true) + { + if (p1 == null) + throw new ArgumentNullException("p1"); + if (p2 == null) + throw new ArgumentNullException("p2"); + Point2f[] p1Array = EnumerableEx.ToArray(p1); + Point2f[] p2Array = EnumerableEx.ToArray(p2); + IntPtr p12Ptr; + float ret = NativeMethods.imgproc_intersectConvexConvex_Point2f(p1Array, p1Array.Length, p2Array, p2Array.Length, + out p12Ptr, handleNested ? 1 : 0); + + using (var p12Vec = new VectorOfPoint2f(p12Ptr)) + { + p12 = p12Vec.ToArray(); + } + + return ret; + } + #endregion + #region FitEllipse + /// + /// Fits ellipse to the set of 2D points. + /// + /// Input 2D point set + /// + public static RotatedRect FitEllipse(InputArray points) + { + if (points == null) + throw new ArgumentNullException("points"); + points.ThrowIfDisposed(); + var ret = NativeMethods.imgproc_fitEllipse_InputArray(points.CvPtr); + GC.KeepAlive(points); + return ret; + } + /// + /// Fits ellipse to the set of 2D points. + /// + /// Input 2D point set + /// + public static RotatedRect FitEllipse(IEnumerable points) + { + if (points == null) + throw new ArgumentNullException("points"); + Point[] pointsArray = EnumerableEx.ToArray(points); + return NativeMethods.imgproc_fitEllipse_Point(pointsArray, pointsArray.Length); + } + /// + /// Fits ellipse to the set of 2D points. + /// + /// Input 2D point set + /// + public static RotatedRect FitEllipse(IEnumerable points) + { + if (points == null) + throw new ArgumentNullException("points"); + Point2f[] pointsArray = EnumerableEx.ToArray(points); + return NativeMethods.imgproc_fitEllipse_Point2f(pointsArray, pointsArray.Length); + } + #endregion + #region FitLine + + /// + /// Fits line to the set of 2D points using M-estimator algorithm + /// + /// Input vector of 2D or 3D points + /// Output line parameters. + /// In case of 2D fitting, it should be a vector of 4 elements + /// (like Vec4f) - (vx, vy, x0, y0), where (vx, vy) is a normalized vector + /// collinear to the line and (x0, y0) is a point on the line. + /// In case of 3D fitting, it should be a vector of 6 elements + /// (like Vec6f) - (vx, vy, vz, x0, y0, z0), where (vx, vy, vz) is a + /// normalized vector collinear to the line and (x0, y0, z0) is a point on the line. + /// Distance used by the M-estimator + /// Numerical parameter ( C ) for some types of distances. + /// If it is 0, an optimal value is chosen. + /// Sufficient accuracy for the radius + /// (distance between the coordinate origin and the line). + /// Sufficient accuracy for the angle. + /// 0.01 would be a good default value for reps and aeps. + public static void FitLine(InputArray points, OutputArray line, DistanceTypes distType, + double param, double reps, double aeps) + { + if (points == null) + throw new ArgumentNullException("points"); + if (line == null) + throw new ArgumentNullException("line"); + points.ThrowIfDisposed(); + line.ThrowIfNotReady(); + NativeMethods.imgproc_fitLine_InputArray(points.CvPtr, line.CvPtr, (int)distType, param, reps, aeps); + GC.KeepAlive(points); + line.Fix(); + } + + /// + /// Fits line to the set of 2D points using M-estimator algorithm + /// + /// Input vector of 2D or 3D points + /// Distance used by the M-estimator + /// Numerical parameter ( C ) for some types of distances. + /// If it is 0, an optimal value is chosen. + /// Sufficient accuracy for the radius + /// (distance between the coordinate origin and the line). + /// Sufficient accuracy for the angle. + /// 0.01 would be a good default value for reps and aeps. + /// Output line parameters. + public static Line2D FitLine(IEnumerable points, DistanceTypes distType, + double param, double reps, double aeps) + { + if (points == null) + throw new ArgumentNullException("points"); + Point[] pointsArray = EnumerableEx.ToArray(points); + float[] line = new float[4]; + NativeMethods.imgproc_fitLine_Point(pointsArray, pointsArray.Length, line, (int)distType, param, reps, aeps); + return new Line2D(line); + } + + /// + /// Fits line to the set of 2D points using M-estimator algorithm + /// + /// Input vector of 2D or 3D points + /// Distance used by the M-estimator + /// Numerical parameter ( C ) for some types of distances. + /// If it is 0, an optimal value is chosen. + /// Sufficient accuracy for the radius + /// (distance between the coordinate origin and the line). + /// Sufficient accuracy for the angle. + /// 0.01 would be a good default value for reps and aeps. + /// Output line parameters. + public static Line2D FitLine(IEnumerable points, DistanceTypes distType, + double param, double reps, double aeps) + { + if (points == null) + throw new ArgumentNullException("points"); + Point2f[] pointsArray = EnumerableEx.ToArray(points); + float[] line = new float[4]; + NativeMethods.imgproc_fitLine_Point2f(pointsArray, pointsArray.Length, line, (int)distType, param, reps, aeps); + return new Line2D(line); + } + + /// + /// Fits line to the set of 3D points using M-estimator algorithm + /// + /// Input vector of 2D or 3D points + /// Distance used by the M-estimator + /// Numerical parameter ( C ) for some types of distances. + /// If it is 0, an optimal value is chosen. + /// Sufficient accuracy for the radius + /// (distance between the coordinate origin and the line). + /// Sufficient accuracy for the angle. + /// 0.01 would be a good default value for reps and aeps. + /// Output line parameters. + public static Line3D FitLine(IEnumerable points, DistanceTypes distType, + double param, double reps, double aeps) + { + if (points == null) + throw new ArgumentNullException("points"); + Point3i[] pointsArray = EnumerableEx.ToArray(points); + float[] line = new float[6]; + NativeMethods.imgproc_fitLine_Point3i(pointsArray, pointsArray.Length, line, (int)distType, param, reps, aeps); + return new Line3D(line); + } + + /// + /// Fits line to the set of 3D points using M-estimator algorithm + /// + /// Input vector of 2D or 3D points + /// Distance used by the M-estimator + /// Numerical parameter ( C ) for some types of distances. + /// If it is 0, an optimal value is chosen. + /// Sufficient accuracy for the radius + /// (distance between the coordinate origin and the line). + /// Sufficient accuracy for the angle. + /// 0.01 would be a good default value for reps and aeps. + /// Output line parameters. + public static Line3D FitLine(IEnumerable points, DistanceTypes distType, + double param, double reps, double aeps) + { + if (points == null) + throw new ArgumentNullException("points"); + Point3f[] pointsArray = EnumerableEx.ToArray(points); + float[] line = new float[6]; + NativeMethods.imgproc_fitLine_Point3f(pointsArray, pointsArray.Length, line, (int)distType, param, reps, aeps); + return new Line3D(line); + } + #endregion + #region PointPolygonTest + /// + /// Checks if the point is inside the contour. Optionally computes the signed distance from the point to the contour boundary + /// + /// + /// + /// + /// + public static double PointPolygonTest(InputArray contour, Point2f pt, bool measureDist) + { + if (contour == null) + throw new ArgumentNullException("contour"); + contour.ThrowIfDisposed(); + var ret = NativeMethods.imgproc_pointPolygonTest_InputArray(contour.CvPtr, pt, measureDist ? 1 : 0); + GC.KeepAlive(contour); + return ret; + } + + /// + /// Checks if the point is inside the contour. Optionally computes the signed distance from the point to the contour boundary + /// + /// + /// + /// + /// + public static double PointPolygonTest(IEnumerable contour, Point2f pt, bool measureDist) + { + if (contour == null) + throw new ArgumentNullException("contour"); + Point[] contourArray = EnumerableEx.ToArray(contour); + return NativeMethods.imgproc_pointPolygonTest_Point(contourArray, contourArray.Length, pt, measureDist ? 1 : 0); + } + + /// + /// Checks if the point is inside the contour. + /// Optionally computes the signed distance from the point to the contour boundary. + /// + /// Input contour. + /// Point tested against the contour. + /// If true, the function estimates the signed distance + /// from the point to the nearest contour edge. Otherwise, the function only checks + /// if the point is inside a contour or not. + /// Positive (inside), negative (outside), or zero (on an edge) value. + public static double PointPolygonTest(IEnumerable contour, Point2f pt, bool measureDist) + { + if (contour == null) + throw new ArgumentNullException("contour"); + Point2f[] contourArray = EnumerableEx.ToArray(contour); + return NativeMethods.imgproc_pointPolygonTest_Point2f(contourArray, contourArray.Length, pt, measureDist ? 1 : 0); + } + #endregion + + #region RotatedRectangleIntersection + + /// + /// Finds out if there is any intersection between two rotated rectangles. + /// If there is then the vertices of the interesecting region are returned as well. + /// Below are some examples of intersection configurations. + /// The hatched pattern indicates the intersecting region and the red + /// vertices are returned by the function. + /// + /// First rectangle + /// Second rectangle + /// + /// The output array of the verticies of the intersecting region. + /// It returns at most 8 vertices. + /// Stored as std::vector<cv::Point2f> or cv::Mat as Mx1 of type CV_32FC2. + /// + public static RectanglesIntersectTypes RotatedRectangleIntersection( + RotatedRect rect1, RotatedRect rect2, OutputArray intersectingRegion) + { + if (intersectingRegion == null) + throw new ArgumentNullException("intersectingRegion"); + intersectingRegion.ThrowIfNotReady(); + + int ret = NativeMethods.imgproc_rotatedRectangleIntersection_OutputArray( + rect1, rect2, intersectingRegion.CvPtr); + + intersectingRegion.Fix(); + + return (RectanglesIntersectTypes)ret; + } + + /// + /// Finds out if there is any intersection between two rotated rectangles. + /// If there is then the vertices of the interesecting region are returned as well. + /// Below are some examples of intersection configurations. + /// The hatched pattern indicates the intersecting region and the red + /// vertices are returned by the function. + /// + /// First rectangle + /// Second rectangle + /// + /// The output array of the verticies of the intersecting region. + /// It returns at most 8 vertices. + /// + public static RectanglesIntersectTypes RotatedRectangleIntersection( + RotatedRect rect1, RotatedRect rect2, out Point2f[] intersectingRegion) + { + using (var intersectingRegionVec = new VectorOfPoint2f()) + { + int ret = NativeMethods.imgproc_rotatedRectangleIntersection_OutputArray( + rect1, rect2, intersectingRegionVec.CvPtr); + intersectingRegion = intersectingRegionVec.ToArray(); + return (RectanglesIntersectTypes) ret; + } + } + + #endregion + + /// + /// Applies a GNU Octave/MATLAB equivalent colormap on a given image. + /// + /// + /// + /// + public static void ApplyColorMap(InputArray src, OutputArray dst, ColormapTypes colormap) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.imgproc_applyColorMap(src.CvPtr, dst.CvPtr, (int)colormap); + GC.KeepAlive(src); + dst.Fix(); + } + + #region Drawing + #region Line +#if LANG_JP + /// + /// 2点を結ぶ線分を画像上に描画する. + /// + /// 画像 + /// 線分の1番目の端点x + /// 線分の1番目の端点y + /// 線分の2番目の端点x + /// 線分の2番目の端点y + /// 線分の色 + /// 線分の太さ. [既定値は1] + /// 線分の種類. [既定値はLineType.Link8] + /// 座標の小数点以下の桁を表すビット数. [既定値は0] +#else + /// + /// Draws a line segment connecting two points + /// + /// The image. + /// First point's x-coordinate of the line segment. + /// First point's y-coordinate of the line segment. + /// Second point's x-coordinate of the line segment. + /// Second point's y-coordinate of the line segment. + /// Line color. + /// Line thickness. [By default this is 1] + /// Type of the line. [By default this is LineType.Link8] + /// Number of fractional bits in the point coordinates. [By default this is 0] +#endif + public static void Line(InputOutputArray img, int pt1X, int pt1Y, int pt2X, int pt2Y, Scalar color, + int thickness = 1, LineTypes lineType = LineTypes.Link8, int shift = 0) + { + Line(img, new Point(pt1X, pt1Y), new Point(pt2X, pt2Y), color, thickness, lineType, shift); + } + +#if LANG_JP + /// + /// 2点を結ぶ線分を画像上に描画する. + /// + /// 画像 + /// 線分の1番目の端点 + /// 線分の2番目の端点 + /// 線分の色 + /// 線分の太さ. [既定値は1] + /// 線分の種類. [既定値はLineType.Link8] + /// 座標の小数点以下の桁を表すビット数. [既定値は0] +#else + /// + /// Draws a line segment connecting two points + /// + /// The image. + /// First point of the line segment. + /// Second point of the line segment. + /// Line color. + /// Line thickness. [By default this is 1] + /// Type of the line. [By default this is LineType.Link8] + /// Number of fractional bits in the point coordinates. [By default this is 0] +#endif + public static void Line( + InputOutputArray img, Point pt1, Point pt2, Scalar color, int thickness = 1, + LineTypes lineType = LineTypes.Link8, int shift = 0) + { + if (img == null) + throw new ArgumentNullException("img"); + img.ThrowIfNotReady(); + NativeMethods.imgproc_line(img.CvPtr, pt1, pt2, color, thickness, (int)lineType, shift); + img.Fix(); + } + #endregion + + /// + /// Draws a arrow segment pointing from the first point to the second one. + /// The function arrowedLine draws an arrow between pt1 and pt2 points in the image. + /// See also cv::line. + /// + /// Image. + /// The point the arrow starts from. + /// The point the arrow points to. + /// Line color. + /// Line thickness. + /// Type of the line, see cv::LineTypes + /// Number of fractional bits in the point coordinates. + /// The length of the arrow tip in relation to the arrow length + public static void ArrowedLine( + InputOutputArray img, + Point pt1, Point pt2, + Scalar color, + int thickness = 1, + LineTypes lineType = LineTypes.Link8, + int shift = 0, + double tipLength = 0.1) + { + if (img == null) + throw new ArgumentNullException("img"); + img.ThrowIfNotReady(); + + NativeMethods.imgproc_arrowedLine( + img.CvPtr, pt1, pt2, color, thickness, (int)lineType, shift, tipLength); + + img.Fix(); + } + + #region Rectangle +#if LANG_JP + /// + /// 枠のみ,もしくは塗りつぶされた矩形を描画する + /// + /// 画像 + /// 矩形の一つの頂点 + /// 矩形の反対側の頂点 + /// 線の色(RGB),もしくは輝度(グレースケール画像). + /// 矩形を描く線の太さ.負の値を指定した場合は塗りつぶされる. [既定値は1] + /// 線の種類. [既定値はLineType.Link8] + /// 座標の小数点以下の桁を表すビット数. [既定値は0] +#else + /// + /// Draws simple, thick or filled rectangle + /// + /// Image. + /// One of the rectangle vertices. + /// Opposite rectangle vertex. + /// Line color (RGB) or brightness (grayscale image). + /// Thickness of lines that make up the rectangle. Negative values make the function to draw a filled rectangle. [By default this is 1] + /// Type of the line, see cvLine description. [By default this is LineType.Link8] + /// Number of fractional bits in the point coordinates. [By default this is 0] +#endif + public static void Rectangle( + InputOutputArray img, Point pt1, Point pt2, Scalar color, int thickness = 1, + LineTypes lineType = LineTypes.Link8, int shift = 0) + { + if (img == null) + throw new ArgumentNullException("img"); + NativeMethods.imgproc_rectangle_InputOutputArray(img.CvPtr, pt1, pt2, color, thickness, (int)lineType, shift); + img.Fix(); + } + +#if LANG_JP + /// + /// 枠のみ,もしくは塗りつぶされた矩形を描画する + /// + /// 画像 + /// 矩形 + /// 線の色(RGB),もしくは輝度(グレースケール画像). + /// 矩形を描く線の太さ.負の値を指定した場合は塗りつぶされる. [既定値は1] + /// 線の種類. [既定値はLineType.Link8] + /// 座標の小数点以下の桁を表すビット数. [既定値は0] +#else + /// + /// Draws simple, thick or filled rectangle + /// + /// Image. + /// Rectangle. + /// Line color (RGB) or brightness (grayscale image). + /// Thickness of lines that make up the rectangle. Negative values make the function to draw a filled rectangle. [By default this is 1] + /// Type of the line, see cvLine description. [By default this is LineType.Link8] + /// Number of fractional bits in the point coordinates. [By default this is 0] +#endif + public static void Rectangle( + InputOutputArray img, Rect rect, Scalar color, int thickness = 1, + LineTypes lineType = LineTypes.Link8, int shift = 0) + { + if (img == null) + throw new ArgumentNullException("img"); + NativeMethods.imgproc_rectangle_InputOutputArray(img.CvPtr, rect.TopLeft, rect.BottomRight, color, thickness, (int)lineType, shift); + img.Fix(); + } + +#if LANG_JP + /// + /// 枠のみ,もしくは塗りつぶされた矩形を描画する + /// + /// 画像 + /// 矩形の一つの頂点 + /// 矩形の反対側の頂点 + /// 線の色(RGB),もしくは輝度(グレースケール画像). + /// 矩形を描く線の太さ.負の値を指定した場合は塗りつぶされる. [既定値は1] + /// 線の種類. [既定値はLineType.Link8] + /// 座標の小数点以下の桁を表すビット数. [既定値は0] +#else + /// + /// Draws simple, thick or filled rectangle + /// + /// Image. + /// One of the rectangle vertices. + /// Opposite rectangle vertex. + /// Line color (RGB) or brightness (grayscale image). + /// Thickness of lines that make up the rectangle. Negative values make the function to draw a filled rectangle. [By default this is 1] + /// Type of the line, see cvLine description. [By default this is LineType.Link8] + /// Number of fractional bits in the point coordinates. [By default this is 0] +#endif + public static void Rectangle( + Mat img, Point pt1, Point pt2, Scalar color, int thickness = 1, + LineTypes lineType = LineTypes.Link8, int shift = 0) + { + if (img == null) + throw new ArgumentNullException("img"); + Rect rect = Rect.FromLTRB(pt1.X, pt1.Y, pt2.X, pt2.Y); + NativeMethods.imgproc_rectangle_Mat(img.CvPtr, rect, color, thickness, (int)lineType, shift); + GC.KeepAlive(img); + } + +#if LANG_JP + /// + /// 枠のみ,もしくは塗りつぶされた矩形を描画する + /// + /// 画像 + /// 矩形 + /// 線の色(RGB),もしくは輝度(グレースケール画像). + /// 矩形を描く線の太さ.負の値を指定した場合は塗りつぶされる. [既定値は1] + /// 線の種類. [既定値はLineType.Link8] + /// 座標の小数点以下の桁を表すビット数. [既定値は0] +#else + /// + /// Draws simple, thick or filled rectangle + /// + /// Image. + /// Rectangle. + /// Line color (RGB) or brightness (grayscale image). + /// Thickness of lines that make up the rectangle. Negative values make the function to draw a filled rectangle. [By default this is 1] + /// Type of the line, see cvLine description. [By default this is LineType.Link8] + /// Number of fractional bits in the point coordinates. [By default this is 0] +#endif + public static void Rectangle( + Mat img, Rect rect, Scalar color, int thickness = 1, LineTypes lineType = LineTypes.Link8, int shift = 0) + { + if (img == null) + throw new ArgumentNullException("img"); + NativeMethods.imgproc_rectangle_Mat(img.CvPtr, rect, color, thickness, (int)lineType, shift); + GC.KeepAlive(img); + } + + #endregion + #region Circle +#if LANG_JP + /// + /// 円を描画する + /// + /// 画像 + /// 円の中心のx座標 + /// 円の中心のy座標 + /// 円の半径 + /// 円の色 + /// 線の幅.負の値を指定した場合は塗りつぶされる.[既定値は1] + /// 線の種類. [既定値はLineType.Link8] + /// 中心座標と半径の小数点以下の桁を表すビット数. [既定値は0] +#else + /// + /// Draws a circle + /// + /// Image where the circle is drawn. + /// X-coordinate of the center of the circle. + /// Y-coordinate of the center of the circle. + /// Radius of the circle. + /// Circle color. + /// Thickness of the circle outline if positive, otherwise indicates that a filled circle has to be drawn. [By default this is 1] + /// Type of the circle boundary. [By default this is LineType.Link8] + /// Number of fractional bits in the center coordinates and radius value. [By default this is 0] +#endif + public static void Circle(InputOutputArray img, int centerX, int centerY, int radius, Scalar color, + int thickness = 1, LineTypes lineType = LineTypes.Link8, int shift = 0) + { + Circle(img, new Point(centerX, centerY), radius, color, thickness, lineType, shift); + } + +#if LANG_JP + /// + /// 円を描画する + /// + /// 画像 + /// 円の中心 + /// 円の半径 + /// 円の色 + /// 線の幅.負の値を指定した場合は塗りつぶされる.[既定値は1] + /// 線の種類. [既定値はLineType.Link8] + /// 中心座標と半径の小数点以下の桁を表すビット数. [既定値は0] +#else + /// + /// Draws a circle + /// + /// Image where the circle is drawn. + /// Center of the circle. + /// Radius of the circle. + /// Circle color. + /// Thickness of the circle outline if positive, otherwise indicates that a filled circle has to be drawn. [By default this is 1] + /// Type of the circle boundary. [By default this is LineType.Link8] + /// Number of fractional bits in the center coordinates and radius value. [By default this is 0] +#endif + public static void Circle(InputOutputArray img, Point center, int radius, Scalar color, + int thickness = 1, LineTypes lineType = LineTypes.Link8, int shift = 0) + { + if (img == null) + throw new ArgumentNullException("img"); + img.ThrowIfDisposed(); + NativeMethods.imgproc_circle(img.CvPtr, center, radius, color, thickness, (int)lineType, shift); + img.Fix(); + } + #endregion + #region Ellipse +#if LANG_JP + /// + /// 枠だけの楕円,楕円弧,もしくは塗りつぶされた扇形の楕円を描画する + /// + /// 楕円が描画される画像 + /// 楕円の中心 + /// 楕円の軸の長さ + /// 回転角度 + /// 楕円弧の開始角度 + /// 楕円弧の終了角度 + /// 楕円の色 + /// 楕円弧の線の幅 [既定値は1] + /// 楕円弧の線の種類 [既定値はLineType.Link8] + /// 中心座標と軸の長さの小数点以下の桁を表すビット数 [既定値は0] +#else + /// + /// Draws simple or thick elliptic arc or fills ellipse sector + /// + /// Image. + /// Center of the ellipse. + /// Length of the ellipse axes. + /// Rotation angle. + /// Starting angle of the elliptic arc. + /// Ending angle of the elliptic arc. + /// Ellipse color. + /// Thickness of the ellipse arc. [By default this is 1] + /// Type of the ellipse boundary. [By default this is LineType.Link8] + /// Number of fractional bits in the center coordinates and axes' values. [By default this is 0] +#endif + public static void Ellipse( + InputOutputArray img, Point center, Size axes, double angle, double startAngle, double endAngle, Scalar color, + int thickness = 1, LineTypes lineType = LineTypes.Link8, int shift = 0) + { + if (img == null) + throw new ArgumentNullException("img"); + img.ThrowIfNotReady(); + NativeMethods.imgproc_ellipse1(img.CvPtr, center, axes, angle, startAngle, endAngle, color, thickness, (int)lineType, shift); + img.Fix(); + } + +#if LANG_JP + /// + /// 枠だけの楕円,もしくは塗りつぶされた楕円を描画する + /// + /// 楕円が描かれる画像. + /// 描画したい楕円を囲む矩形領域. + /// 楕円の色. + /// 楕円境界線の幅.[既定値は1] + /// 楕円境界線の種類.[既定値はLineType.Link8] +#else + /// + /// Draws simple or thick elliptic arc or fills ellipse sector + /// + /// Image. + /// The enclosing box of the ellipse drawn + /// Ellipse color. + /// Thickness of the ellipse boundary. [By default this is 1] + /// Type of the ellipse boundary. [By default this is LineType.Link8] +#endif + public static void Ellipse(InputOutputArray img, RotatedRect box, Scalar color, + int thickness = 1, LineTypes lineType = LineTypes.Link8) + { + if (img == null) + throw new ArgumentNullException("img"); + img.ThrowIfDisposed(); + NativeMethods.imgproc_ellipse2(img.CvPtr, box, color, thickness, (int)lineType); + img.Fix(); + } + #endregion + #region FillConvexPoly +#if LANG_JP + /// + /// 塗りつぶされた凸ポリゴンを描きます. + /// + /// 画像 + /// ポリゴンの頂点. + /// ポリゴンの色. + /// ポリゴンの枠線の種類, + /// ポリゴンの頂点座標において,小数点以下の桁を表すビット数. +#else + /// + /// Fills a convex polygon. + /// + /// Image + /// The polygon vertices + /// Polygon color + /// Type of the polygon boundaries + /// The number of fractional bits in the vertex coordinates +#endif + public static void FillConvexPoly(Mat img, IEnumerable pts, Scalar color, + LineTypes lineType = LineTypes.Link8, int shift = 0) + { + if (img == null) + throw new ArgumentNullException("img"); + img.ThrowIfDisposed(); + + Point[] ptsArray = EnumerableEx.ToArray(pts); + NativeMethods.imgproc_fillConvexPoly_Mat(img.CvPtr, ptsArray, ptsArray.Length, color, (int)lineType, shift); + GC.KeepAlive(img); + } + +#if LANG_JP + /// + /// 塗りつぶされた凸ポリゴンを描きます. + /// + /// 画像 + /// ポリゴンの頂点. + /// ポリゴンの色. + /// ポリゴンの枠線の種類, + /// ポリゴンの頂点座標において,小数点以下の桁を表すビット数. +#else + /// + /// Fills a convex polygon. + /// + /// Image + /// The polygon vertices + /// Polygon color + /// Type of the polygon boundaries + /// The number of fractional bits in the vertex coordinates +#endif + public static void FillConvexPoly(InputOutputArray img, InputArray pts, Scalar color, + LineTypes lineType = LineTypes.Link8, int shift = 0) + { + if (img == null) + throw new ArgumentNullException("img"); + if (pts == null) + throw new ArgumentNullException("pts"); + img.ThrowIfDisposed(); + pts.ThrowIfDisposed(); + + NativeMethods.imgproc_fillConvexPoly_InputOutputArray( + img.CvPtr, pts.CvPtr, color, (int)lineType, shift); + GC.KeepAlive(img); + GC.KeepAlive(pts); + } + #endregion + #region FillPoly +#if LANG_JP + /// + /// 1つ,または複数のポリゴンで区切られた領域を塗りつぶします. + /// + /// 画像 + /// ポリゴンの配列.各要素は,点の配列で表現されます. + /// ポリゴンの色. + /// ポリゴンの枠線の種類, + /// ポリゴンの頂点座標において,小数点以下の桁を表すビット数. + /// +#else + /// + /// Fills the area bounded by one or more polygons + /// + /// Image + /// Array of polygons, each represented as an array of points + /// Polygon color + /// Type of the polygon boundaries + /// The number of fractional bits in the vertex coordinates + /// +#endif + public static void FillPoly( + Mat img, IEnumerable> pts, Scalar color, + LineTypes lineType = LineTypes.Link8, int shift = 0, Point? offset = null) + { + if (img == null) + throw new ArgumentNullException("img"); + img.ThrowIfDisposed(); + Point offset0 = offset.GetValueOrDefault(new Point()); + + List ptsList = new List(); + List nptsList = new List(); + foreach (IEnumerable pts1 in pts) + { + Point[] pts1Arr = EnumerableEx.ToArray(pts1); + ptsList.Add(pts1Arr); + nptsList.Add(pts1Arr.Length); + } + Point[][] ptsArr = ptsList.ToArray(); + int[] npts = nptsList.ToArray(); + int ncontours = ptsArr.Length; + using (var ptsPtr = new ArrayAddress2(ptsArr)) + { + NativeMethods.imgproc_fillPoly_Mat( + img.CvPtr, ptsPtr.Pointer, npts, ncontours, color, (int)lineType, shift, offset0); + } + } + +#if LANG_JP + /// + /// 1つ,または複数のポリゴンで区切られた領域を塗りつぶします. + /// + /// 画像 + /// ポリゴンの配列.各要素は,点の配列で表現されます. + /// ポリゴンの色. + /// ポリゴンの枠線の種類, + /// ポリゴンの頂点座標において,小数点以下の桁を表すビット数. + /// +#else + /// + /// Fills the area bounded by one or more polygons + /// + /// Image + /// Array of polygons, each represented as an array of points + /// Polygon color + /// Type of the polygon boundaries + /// The number of fractional bits in the vertex coordinates + /// +#endif + public static void FillPoly( + InputOutputArray img, InputArray pts, Scalar color, + LineTypes lineType = LineTypes.Link8, int shift = 0, Point? offset = null) + { + if (img == null) + throw new ArgumentNullException("img"); + if (pts == null) + throw new ArgumentNullException("pts"); + img.ThrowIfDisposed(); + pts.ThrowIfDisposed(); + Point offset0 = offset.GetValueOrDefault(new Point()); + + NativeMethods.imgproc_fillPoly_InputOutputArray( + img.CvPtr, pts.CvPtr, color, (int)lineType, shift, offset0); + + GC.KeepAlive(pts); + img.Fix(); + } + #endregion + #region Polylines + /// + /// draws one or more polygonal curves + /// + /// + /// + /// + /// + /// + /// + /// + public static void Polylines( + Mat img, IEnumerable> pts, bool isClosed, Scalar color, + int thickness = 1, LineTypes lineType = LineTypes.Link8, int shift = 0) + { + if (img == null) + throw new ArgumentNullException("img"); + img.ThrowIfDisposed(); + + List ptsList = new List(); + List nptsList = new List(); + foreach (IEnumerable pts1 in pts) + { + Point[] pts1Arr = EnumerableEx.ToArray(pts1); + ptsList.Add(pts1Arr); + nptsList.Add(pts1Arr.Length); + } + Point[][] ptsArr = ptsList.ToArray(); + int[] npts = nptsList.ToArray(); + int ncontours = ptsArr.Length; + using (ArrayAddress2 ptsPtr = new ArrayAddress2(ptsArr)) + { + NativeMethods.imgproc_polylines_Mat( + img.CvPtr, ptsPtr.Pointer, npts, ncontours, isClosed ? 1 : 0, color, thickness, (int)lineType, shift); + } + } + + /// + /// draws one or more polygonal curves + /// + /// + /// + /// + /// + /// + /// + /// + public static void Polylines( + InputOutputArray img, InputArray pts, bool isClosed, Scalar color, + int thickness = 1, LineTypes lineType = LineTypes.Link8, int shift = 0) + { + if (img == null) + throw new ArgumentNullException("img"); + if (pts == null) + throw new ArgumentNullException("pts"); + img.ThrowIfDisposed(); + pts.ThrowIfDisposed(); + + NativeMethods.imgproc_polylines_InputOutputArray( + img.CvPtr, pts.CvPtr, isClosed ? 1 : 0, color, thickness, (int)lineType, shift); + + img.Fix(); + GC.KeepAlive(pts); + } + + #endregion + + #region DrawContours +#if LANG_JP + /// + /// 輪郭線,または内側が塗りつぶされた輪郭を描きます. + /// + /// 出力画像 + /// 入力される全輪郭.各輪郭は,点のベクトルとして格納されています. + /// 描かれる輪郭を示します.これが負値の場合,すべての輪郭が描画されます. + /// 輪郭の色. + /// 輪郭線の太さ.これが負値の場合(例えば thickness=CV_FILLED ),輪郭の内側が塗りつぶされます. + /// 線の連結性 + /// 階層に関するオプションの情報.これは,特定の輪郭だけを描画したい場合にのみ必要になります. + /// 描画される輪郭の最大レベル.0ならば,指定された輪郭のみが描画されます. + /// 1ならば,指定された輪郭と,それに入れ子になったすべての輪郭が描画されます.2ならば,指定された輪郭と, + /// それに入れ子になったすべての輪郭,さらにそれに入れ子になったすべての輪郭が描画されます.このパラメータは, + /// hierarchy が有効な場合のみ考慮されます. + /// 輪郭をシフトするオプションパラメータ.指定された offset = (dx,dy) だけ,すべての描画輪郭がシフトされます. +#else + /// + /// draws contours in the image + /// + /// Destination image. + /// All the input contours. Each contour is stored as a point vector. + /// Parameter indicating a contour to draw. If it is negative, all the contours are drawn. + /// Color of the contours. + /// Thickness of lines the contours are drawn with. If it is negative (for example, thickness=CV_FILLED ), + /// the contour interiors are drawn. + /// Line connectivity. + /// Optional information about hierarchy. It is only needed if you want to draw only some of the contours + /// Maximal level for drawn contours. If it is 0, only the specified contour is drawn. + /// If it is 1, the function draws the contour(s) and all the nested contours. If it is 2, the function draws the contours, + /// all the nested contours, all the nested-to-nested contours, and so on. This parameter is only taken into account + /// when there is hierarchy available. + /// Optional contour shift parameter. Shift all the drawn contours by the specified offset = (dx, dy) +#endif + public static void DrawContours( + InputOutputArray image, + IEnumerable> contours, + int contourIdx, + Scalar color, + int thickness = 1, + LineTypes lineType = LineTypes.Link8, + IEnumerable hierarchy = null, + int maxLevel = Int32.MaxValue, + Point? offset = null) + { + if (image == null) + throw new ArgumentNullException("image"); + if (contours == null) + throw new ArgumentNullException("contours"); + image.ThrowIfNotReady(); + + Point offset0 = offset.GetValueOrDefault(new Point()); + Point[][] contoursArray = EnumerableEx.SelectToArray(contours, EnumerableEx.ToArray); + int[] contourSize2 = EnumerableEx.SelectToArray(contoursArray, pts => pts.Length); + using (var contoursPtr = new ArrayAddress2(contoursArray)) + { + if (hierarchy == null) + { + NativeMethods.imgproc_drawContours_vector(image.CvPtr, contoursPtr.Pointer, contoursArray.Length, contourSize2, + contourIdx, color, thickness, (int)lineType, IntPtr.Zero, 0, maxLevel, offset0); + } + else + { + Vec4i[] hiearchyVecs = EnumerableEx.SelectToArray(hierarchy, hi => hi.ToVec4i()); + NativeMethods.imgproc_drawContours_vector(image.CvPtr, contoursPtr.Pointer, contoursArray.Length, contourSize2, + contourIdx, color, thickness, (int)lineType, hiearchyVecs, hiearchyVecs.Length, maxLevel, offset0); + } + } + + image.Fix(); + } +#if LANG_JP + /// + /// 輪郭線,または内側が塗りつぶされた輪郭を描きます. + /// + /// 出力画像 + /// 入力される全輪郭.各輪郭は,点のベクトルとして格納されています. + /// 描かれる輪郭を示します.これが負値の場合,すべての輪郭が描画されます. + /// 輪郭の色. + /// 輪郭線の太さ.これが負値の場合(例えば thickness=CV_FILLED ),輪郭の内側が塗りつぶされます. + /// 線の連結性 + /// 階層に関するオプションの情報.これは,特定の輪郭だけを描画したい場合にのみ必要になります. + /// 描画される輪郭の最大レベル.0ならば,指定された輪郭のみが描画されます. + /// 1ならば,指定された輪郭と,それに入れ子になったすべての輪郭が描画されます.2ならば,指定された輪郭と, + /// それに入れ子になったすべての輪郭,さらにそれに入れ子になったすべての輪郭が描画されます.このパラメータは, + /// hierarchy が有効な場合のみ考慮されます. + /// 輪郭をシフトするオプションパラメータ.指定された offset = (dx,dy) だけ,すべての描画輪郭がシフトされます. +#else + /// + /// draws contours in the image + /// + /// Destination image. + /// All the input contours. Each contour is stored as a point vector. + /// Parameter indicating a contour to draw. If it is negative, all the contours are drawn. + /// Color of the contours. + /// Thickness of lines the contours are drawn with. If it is negative (for example, thickness=CV_FILLED ), + /// the contour interiors are drawn. + /// Line connectivity. + /// Optional information about hierarchy. It is only needed if you want to draw only some of the contours + /// Maximal level for drawn contours. If it is 0, only the specified contour is drawn. + /// If it is 1, the function draws the contour(s) and all the nested contours. If it is 2, the function draws the contours, + /// all the nested contours, all the nested-to-nested contours, and so on. This parameter is only taken into account + /// when there is hierarchy available. + /// Optional contour shift parameter. Shift all the drawn contours by the specified offset = (dx, dy) +#endif + public static void DrawContours( + InputOutputArray image, + IEnumerable contours, + int contourIdx, + Scalar color, + int thickness = 1, + LineTypes lineType = LineTypes.Link8, + Mat hierarchy = null, + int maxLevel = Int32.MaxValue, + Point? offset = null) + { + if (image == null) + throw new ArgumentNullException("image"); + if (contours == null) + throw new ArgumentNullException("contours"); + image.ThrowIfNotReady(); + + Point offset0 = offset.GetValueOrDefault(new Point()); + IntPtr[] contoursPtr = EnumerableEx.SelectPtrs(contours); + NativeMethods.imgproc_drawContours_InputArray(image.CvPtr, contoursPtr, contoursPtr.Length, + contourIdx, color, thickness, (int)lineType, ToPtr(hierarchy), maxLevel, offset0); + image.Fix(); + } + #endregion + + #region ClipLine +#if LANG_JP + /// + /// 線分が画像矩形内に収まるように切り詰めます. + /// + /// 画像サイズ. + /// 線分の1番目の端点. + /// 線分の2番目の端点. + /// +#else + /// + /// Clips the line against the image rectangle + /// + /// The image size + /// The first line point + /// The second line point + /// +#endif + public static bool ClipLine(Size imgSize, ref Point pt1, ref Point pt2) + { + return NativeMethods.imgproc_clipLine1(imgSize, ref pt1, ref pt2) != 0; + } +#if LANG_JP + /// + /// 線分が画像矩形内に収まるように切り詰めます. + /// + /// 画像矩形. + /// 線分の1番目の端点. + /// 線分の2番目の端点. + /// +#else + /// + /// Clips the line against the image rectangle + /// + /// sThe image rectangle + /// The first line point + /// The second line point + /// +#endif + public static bool ClipLine(Rect imgRect, ref Point pt1, ref Point pt2) + { + return NativeMethods.imgproc_clipLine2(imgRect, ref pt1, ref pt2) != 0; + } + #endregion + + /// + /// Approximates an elliptic arc with a polyline. + /// The function ellipse2Poly computes the vertices of a polyline that + /// approximates the specified elliptic arc. It is used by cv::ellipse. + /// + /// Center of the arc. + /// Half of the size of the ellipse main axes. See the ellipse for details. + /// Rotation angle of the ellipse in degrees. See the ellipse for details. + /// Starting angle of the elliptic arc in degrees. + /// Ending angle of the elliptic arc in degrees. + /// Angle between the subsequent polyline vertices. It defines the approximation + /// Output vector of polyline vertices. + public static Point[] Ellipse2Poly(Point center, Size axes, int angle, + int arcStart, int arcEnd, int delta) + { + using (var vec = new VectorOfPoint()) + { + NativeMethods.imgproc_ellipse2Poly(center, axes, angle, arcStart, arcEnd, delta, vec.CvPtr); + return vec.ToArray(); + } + } + + /// + /// renders text string in the image + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static void PutText(InputOutputArray img, string text, Point org, + HersheyFonts fontFace, double fontScale, Scalar color, + int thickness = 1, LineTypes lineType = LineTypes.Link8, bool bottomLeftOrigin = false) + { + if (img == null) + throw new ArgumentNullException("img"); + if (String.IsNullOrEmpty(text)) + throw new ArgumentNullException(text); + img.ThrowIfDisposed(); + NativeMethods.core_putText(img.CvPtr, text, org, (int)fontFace, fontScale, color, + thickness, (int)lineType, bottomLeftOrigin ? 1 : 0); + img.Fix(); + } + + /// + /// returns bounding box of the text string + /// + /// + /// + /// + /// + /// + /// + public static Size GetTextSize(string text, HersheyFonts fontFace, + double fontScale, int thickness, out int baseLine) + { + if (String.IsNullOrEmpty(text)) + throw new ArgumentNullException(text); + return NativeMethods.core_getTextSize(text, (int)fontFace, fontScale, thickness, out baseLine); + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Cv2/Cv2_ml.cs b/src/OpenCvSharp/Cv2/Cv2_ml.cs new file mode 100644 index 000000000..e0e58f043 --- /dev/null +++ b/src/OpenCvSharp/Cv2/Cv2_ml.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + static partial class Cv2 + { + } +} diff --git a/src/OpenCvSharp/Cv2/Cv2_objdetect.cs b/src/OpenCvSharp/Cv2/Cv2_objdetect.cs new file mode 100644 index 000000000..be91caf3f --- /dev/null +++ b/src/OpenCvSharp/Cv2/Cv2_objdetect.cs @@ -0,0 +1,138 @@ +using System; +using System.Collections.Generic; + +namespace OpenCvSharp +{ + static partial class Cv2 + { + /// + /// Groups the object candidate rectangles. + /// + /// Input/output vector of rectangles. Output vector includes retained and grouped rectangles. + /// Minimum possible number of rectangles minus 1. The threshold is used in a group of rectangles to retain it. + /// + public static void GroupRectangles(IList rectList, int groupThreshold, double eps = 0.2) + { + if (rectList == null) + throw new ArgumentNullException("rectList"); + + using (var rectListVec = new VectorOfRect(rectList)) + { + NativeMethods.objdetect_groupRectangles1(rectListVec.CvPtr, groupThreshold, eps); + ClearAndAddRange(rectList, rectListVec.ToArray()); + } + } + + /// + /// Groups the object candidate rectangles. + /// + /// Input/output vector of rectangles. Output vector includes retained and grouped rectangles. + /// + /// Minimum possible number of rectangles minus 1. The threshold is used in a group of rectangles to retain it. + /// Relative difference between sides of the rectangles to merge them into a group. + public static void GroupRectangles(IList rectList, out int[] weights, int groupThreshold, double eps = 0.2) + { + if (rectList == null) + throw new ArgumentNullException("rectList"); + + using (var rectListVec = new VectorOfRect(rectList)) + using (var weightsVec = new VectorOfInt32()) + { + NativeMethods.objdetect_groupRectangles2(rectListVec.CvPtr, weightsVec.CvPtr, groupThreshold, eps); + ClearAndAddRange(rectList, rectListVec.ToArray()); + weights = weightsVec.ToArray(); + } + } + + /// + /// Groups the object candidate rectangles. + /// + /// + /// + /// + /// + /// + public static void GroupRectangles(IList rectList, int groupThreshold, double eps, out int[] weights, out double[] levelWeights) + { + if (rectList == null) + throw new ArgumentNullException("rectList"); + + using (var rectListVec = new VectorOfRect(rectList)) + using (var weightsVec = new VectorOfInt32()) + using (var levelWeightsVec = new VectorOfDouble()) + { + NativeMethods.objdetect_groupRectangles3(rectListVec.CvPtr, groupThreshold, eps, weightsVec.CvPtr, levelWeightsVec.CvPtr); + ClearAndAddRange(rectList, rectListVec.ToArray()); + weights = weightsVec.ToArray(); + levelWeights = levelWeightsVec.ToArray(); + } + } + + /// + /// Groups the object candidate rectangles. + /// + /// + /// + /// + /// + /// + public static void GroupRectangles(IList rectList, out int[] rejectLevels, out double[] levelWeights, int groupThreshold, double eps = 0.2) + { + if (rectList == null) + throw new ArgumentNullException("rectList"); + + using (var rectListVec = new VectorOfRect(rectList)) + using (var rejectLevelsVec = new VectorOfInt32()) + using (var levelWeightsVec = new VectorOfDouble()) + { + NativeMethods.objdetect_groupRectangles4(rectListVec.CvPtr, rejectLevelsVec.CvPtr, levelWeightsVec.CvPtr, groupThreshold, eps); + ClearAndAddRange(rectList, rectListVec.ToArray()); + rejectLevels = rejectLevelsVec.ToArray(); + levelWeights = levelWeightsVec.ToArray(); + } + } + + /// + /// + /// + /// + /// + /// + /// + /// + public static void GroupRectanglesMeanshift(IList rectList, out double[] foundWeights, + out double[] foundScales, double detectThreshold = 0.0, Size? winDetSize = null) + { + if (rectList == null) + throw new ArgumentNullException("rectList"); + + Size winDetSize0 = winDetSize.GetValueOrDefault(new Size(64, 128)); + + using (var rectListVec = new VectorOfRect(rectList)) + using (var foundWeightsVec = new VectorOfDouble()) + using (var foundScalesVec = new VectorOfDouble()) + { + NativeMethods.objdetect_groupRectangles_meanshift( + rectListVec.CvPtr, foundWeightsVec.CvPtr, foundScalesVec.CvPtr, detectThreshold, winDetSize0); + ClearAndAddRange(rectList, rectListVec.ToArray()); + foundWeights = foundWeightsVec.ToArray(); + foundScales = foundScalesVec.ToArray(); + } + } + + /// + /// IListの要素にvaluesを設定する + /// + /// + /// + /// + private static void ClearAndAddRange(IList list, IEnumerable values) + { + list.Clear(); + foreach (T t in values) + { + list.Add(t); + } + } + } +} diff --git a/src/OpenCvSharp/Cv2/Cv2_optflow.cs b/src/OpenCvSharp/Cv2/Cv2_optflow.cs new file mode 100644 index 000000000..32a9a3dd4 --- /dev/null +++ b/src/OpenCvSharp/Cv2/Cv2_optflow.cs @@ -0,0 +1,211 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + static partial class Cv2 + { + /// + /// Updates motion history image using the current silhouette + /// + /// Silhouette mask that has non-zero pixels where the motion occurs. + /// Motion history image that is updated by the function (single-channel, 32-bit floating-point). + /// Current time in milliseconds or other units. + /// Maximal duration of the motion track in the same units as timestamp . + public static void UpdateMotionHistory( + InputArray silhouette, InputOutputArray mhi, + double timestamp, double duration) + { + if (silhouette == null) + throw new ArgumentNullException("silhouette"); + if (mhi == null) + throw new ArgumentNullException("mhi"); + silhouette.ThrowIfDisposed(); + mhi.ThrowIfNotReady(); + NativeMethods.optflow_motempl_updateMotionHistory( + silhouette.CvPtr, mhi.CvPtr, timestamp, duration); + mhi.Fix(); + } + + /// + /// Computes the motion gradient orientation image from the motion history image + /// + /// Motion history single-channel floating-point image. + /// Output mask image that has the type CV_8UC1 and the same size as mhi. + /// Its non-zero elements mark pixels where the motion gradient data is correct. + /// Output motion gradient orientation image that has the same type and the same size as mhi. + /// Each pixel of the image is a motion orientation, from 0 to 360 degrees. + /// Minimal (or maximal) allowed difference between mhi values within a pixel neighborhood. + /// Maximal (or minimal) allowed difference between mhi values within a pixel neighborhood. + /// That is, the function finds the minimum ( m(x,y) ) and maximum ( M(x,y) ) mhi values over 3x3 neighborhood of each pixel + /// and marks the motion orientation at (x, y) as valid only if: + /// min(delta1, delta2) <= M(x,y)-m(x,y) <= max(delta1, delta2). + /// + public static void CalcMotionGradient( + InputArray mhi, OutputArray mask, OutputArray orientation, + double delta1, double delta2, int apertureSize = 3) + { + if (mhi == null) + throw new ArgumentNullException("mhi"); + if (mask == null) + throw new ArgumentNullException("mask"); + if (orientation == null) + throw new ArgumentNullException("orientation"); + mhi.ThrowIfDisposed(); + mask.ThrowIfNotReady(); + orientation.ThrowIfNotReady(); + + NativeMethods.optflow_motempl_calcMotionGradient( + mhi.CvPtr, mask.CvPtr, orientation.CvPtr, delta1, delta2, apertureSize); + + mask.Fix(); + orientation.Fix(); + } + + /// + /// Computes the global orientation of the selected motion history image part + /// + /// Motion gradient orientation image calculated by the function CalcMotionGradient() . + /// Mask image. It may be a conjunction of a valid gradient mask, also calculated by CalcMotionGradient() , + /// and the mask of a region whose direction needs to be calculated. + /// Motion history image calculated by UpdateMotionHistory() . + /// Timestamp passed to UpdateMotionHistory() . + /// Maximum duration of a motion track in milliseconds, passed to UpdateMotionHistory() . + /// + public static double CalcGlobalOrientation( + InputArray orientation, InputArray mask, InputArray mhi, + double timestamp, double duration) + { + if (orientation == null) + throw new ArgumentNullException("orientation"); + if (mask == null) + throw new ArgumentNullException("mask"); + if (mhi == null) + throw new ArgumentNullException("mhi"); + orientation.ThrowIfDisposed(); + mask.ThrowIfDisposed(); + mhi.ThrowIfDisposed(); + + return NativeMethods.optflow_motempl_calcGlobalOrientation( + orientation.CvPtr, mask.CvPtr, mhi.CvPtr, timestamp, duration); + } + + /// + /// Splits a motion history image into a few parts corresponding to separate independent motions + /// (for example, left hand, right hand). + /// + /// Motion history image. + /// Image where the found mask should be stored, single-channel, 32-bit floating-point. + /// Vector containing ROIs of motion connected components. + /// Current time in milliseconds or other units. + /// Segmentation threshold that is recommended to be equal to the interval between motion history “steps” or greater. + public static void SegmentMotion( + InputArray mhi, OutputArray segmask, + out Rect[] boundingRects, + double timestamp, double segThresh) + { + if (mhi == null) + throw new ArgumentNullException("mhi"); + if (segmask == null) + throw new ArgumentNullException("segmask"); + mhi.ThrowIfDisposed(); + segmask.ThrowIfNotReady(); + + using (var br = new VectorOfRect()) + { + NativeMethods.optflow_motempl_segmentMotion( + mhi.CvPtr, segmask.CvPtr, br.CvPtr, timestamp, segThresh); + boundingRects = br.ToArray(); + } + segmask.Fix(); + } + + /// + /// computes dense optical flow using Simple Flow algorithm + /// + /// First 8-bit 3-channel image. + /// Second 8-bit 3-channel image + /// Estimated flow + /// Number of layers + /// Size of block through which we sum up when calculate cost function for pixel + /// maximal flow that we search at each level + public static void CalcOpticalFlowSF( + Mat from, + Mat to, + Mat flow, + int layers, + int averagingBlockSize, + int maxFlow) + { + if (from == null) + throw new ArgumentNullException("from"); + if (to == null) + throw new ArgumentNullException("to"); + if (flow == null) + throw new ArgumentNullException("flow"); + from.ThrowIfDisposed(); + to.ThrowIfDisposed(); + flow.ThrowIfDisposed(); + + NativeMethods.optflow_calcOpticalFlowSF1( + from.CvPtr, to.CvPtr, flow.CvPtr, + layers, averagingBlockSize, maxFlow); + } + + /// + /// computes dense optical flow using Simple Flow algorithm + /// + /// First 8-bit 3-channel image. + /// Second 8-bit 3-channel image + /// Estimated flow + /// Number of layers + /// Size of block through which we sum up when calculate cost function for pixel + /// maximal flow that we search at each level + /// vector smooth spatial sigma parameter + /// vector smooth color sigma parameter + /// window size for postprocess cross bilateral filter + /// spatial sigma for postprocess cross bilateralf filter + /// color sigma for postprocess cross bilateral filter + /// threshold for detecting occlusions + /// window size for bilateral upscale operation + /// spatial sigma for bilateral upscale operation + /// color sigma for bilateral upscale operation + /// threshold to detect point with irregular flow - where flow should be recalculated after upscale + public static void calcOpticalFlowSF( + Mat from, + Mat to, + Mat flow, + int layers, + int averagingBlockSize, + int maxFlow, + double sigmaDist, + double sigmaColor, + int postprocessWindow, + double sigmaDistFix, + double sigmaColorFix, + double occThr, + int upscaleAveragingRadius, + double upscaleSigmaDist, + double upscaleSigmaColor, + double speedUpThr) + { + if (from == null) + throw new ArgumentNullException("from"); + if (to == null) + throw new ArgumentNullException("to"); + if (flow == null) + throw new ArgumentNullException("flow"); + from.ThrowIfDisposed(); + to.ThrowIfDisposed(); + flow.ThrowIfDisposed(); + + NativeMethods.optflow_calcOpticalFlowSF2( + from.CvPtr, to.CvPtr, flow.CvPtr, + layers, averagingBlockSize, maxFlow, + sigmaDist, sigmaColor, postprocessWindow, sigmaDistFix, + sigmaColorFix, occThr, upscaleAveragingRadius, + upscaleSigmaDist, upscaleSigmaColor, speedUpThr); + } + } +} diff --git a/src/OpenCvSharp/Cv2/Cv2_photo.cs b/src/OpenCvSharp/Cv2/Cv2_photo.cs new file mode 100644 index 000000000..d83eee8c2 --- /dev/null +++ b/src/OpenCvSharp/Cv2/Cv2_photo.cs @@ -0,0 +1,517 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + static partial class Cv2 + { + #region Inpaint + /// + /// restores the damaged image areas using one of the available intpainting algorithms + /// + /// + /// + /// + /// + /// + public static void Inpaint(InputArray src, InputArray inpaintMask, + OutputArray dst, double inpaintRadius, InpaintMethod flags) + { + if (src == null) + throw new ArgumentNullException("src"); + if (inpaintMask == null) + throw new ArgumentNullException("inpaintMask"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + inpaintMask.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.photo_inpaint(src.CvPtr, inpaintMask.CvPtr, dst.CvPtr, inpaintRadius, (int)flags); + dst.Fix(); + } + #endregion + + #region FastNlMeansDenoising + /// + /// Perform image denoising using Non-local Means Denoising algorithm + /// with several computational optimizations. Noise expected to be a gaussian white noise + /// + /// Input 8-bit 1-channel, 2-channel or 3-channel image. + /// Output image with the same size and type as src . + /// + /// Parameter regulating filter strength. Big h value perfectly removes noise but also removes image details, + /// smaller h value preserves details but also preserves some noise + /// + /// Size in pixels of the template patch that is used to compute weights. Should be odd. Recommended value 7 pixels + /// + /// Size in pixels of the window that is used to compute weighted average for given pixel. + /// Should be odd. Affect performance linearly: greater searchWindowsSize - greater denoising time. Recommended value 21 pixels + public static void FastNlMeansDenoising(InputArray src, OutputArray dst, float h = 3, + int templateWindowSize = 7, int searchWindowSize = 21) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.photo_fastNlMeansDenoising(src.CvPtr, dst.CvPtr, h, templateWindowSize, searchWindowSize); + dst.Fix(); + } + #endregion + #region FastNlMeansDenoisingColored + + /// + /// Modification of fastNlMeansDenoising function for colored images + /// + /// Input 8-bit 3-channel image. + /// Output image with the same size and type as src. + /// Parameter regulating filter strength for luminance component. + /// Bigger h value perfectly removes noise but also removes image details, smaller h value preserves details but also preserves some noise + /// The same as h but for color components. For most images value equals 10 will be enought + /// to remove colored noise and do not distort colors + /// + /// Size in pixels of the template patch that is used to compute weights. Should be odd. Recommended value 7 pixels + /// + /// Size in pixels of the window that is used to compute weighted average for given pixel. Should be odd. + /// Affect performance linearly: greater searchWindowsSize - greater denoising time. Recommended value 21 pixels + public static void FastNlMeansDenoisingColored(InputArray src, OutputArray dst, + float h = 3, float hColor = 3, + int templateWindowSize = 7, int searchWindowSize = 21) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.photo_fastNlMeansDenoisingColored(src.CvPtr, dst.CvPtr, h, hColor, templateWindowSize, searchWindowSize); + dst.Fix(); + } + #endregion + #region FastNlMeansDenoisingMulti + /// + /// Modification of fastNlMeansDenoising function for images sequence where consequtive images have been captured + /// in small period of time. For example video. This version of the function is for grayscale images or for manual manipulation with colorspaces. + /// + /// Input 8-bit 1-channel, 2-channel or 3-channel images sequence. All images should have the same type and size. + /// Output image with the same size and type as srcImgs images. + /// Target image to denoise index in srcImgs sequence + /// Number of surrounding images to use for target image denoising. + /// Should be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to imgToDenoiseIndex - temporalWindowSize / 2 + /// from srcImgs will be used to denoise srcImgs[imgToDenoiseIndex] image. + /// Parameter regulating filter strength for luminance component. Bigger h value perfectly removes noise but also removes image details, + /// smaller h value preserves details but also preserves some noise + /// Size in pixels of the template patch that is used to compute weights. Should be odd. Recommended value 7 pixels + /// Size in pixels of the window that is used to compute weighted average for given pixel. + /// Should be odd. Affect performance linearly: greater searchWindowsSize - greater denoising time. Recommended value 21 pixels + public static void FastNlMeansDenoisingMulti(IEnumerable srcImgs, OutputArray dst, + int imgToDenoiseIndex, int temporalWindowSize, + float h = 3, int templateWindowSize = 7, int searchWindowSize = 21) + { + if (srcImgs == null) + throw new ArgumentNullException("srcImgs"); + if (dst == null) + throw new ArgumentNullException("dst"); + dst.ThrowIfNotReady(); + IntPtr[] srcImgPtrs = EnumerableEx.SelectPtrs(srcImgs); + + NativeMethods.photo_fastNlMeansDenoisingMulti(srcImgPtrs, srcImgPtrs.Length, dst.CvPtr, imgToDenoiseIndex, + templateWindowSize, h, templateWindowSize, searchWindowSize); + dst.Fix(); + } + /// + /// Modification of fastNlMeansDenoising function for images sequence where consequtive images have been captured + /// in small period of time. For example video. This version of the function is for grayscale images or for manual manipulation with colorspaces. + /// + /// Input 8-bit 1-channel, 2-channel or 3-channel images sequence. All images should have the same type and size. + /// Output image with the same size and type as srcImgs images. + /// Target image to denoise index in srcImgs sequence + /// Number of surrounding images to use for target image denoising. + /// Should be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to imgToDenoiseIndex - temporalWindowSize / 2 + /// from srcImgs will be used to denoise srcImgs[imgToDenoiseIndex] image. + /// Parameter regulating filter strength for luminance component. Bigger h value perfectly removes noise but also removes image details, + /// smaller h value preserves details but also preserves some noise + /// Size in pixels of the template patch that is used to compute weights. Should be odd. Recommended value 7 pixels + /// Size in pixels of the window that is used to compute weighted average for given pixel. + /// Should be odd. Affect performance linearly: greater searchWindowsSize - greater denoising time. Recommended value 21 pixels + public static void FastNlMeansDenoisingMulti(IEnumerable srcImgs, OutputArray dst, + int imgToDenoiseIndex, int temporalWindowSize, + float h = 3, int templateWindowSize = 7, int searchWindowSize = 21) + { + IEnumerable srcImgsAsArrays = EnumerableEx.Select(srcImgs, m => new InputArray(m)); + FastNlMeansDenoisingMulti(srcImgsAsArrays, dst, imgToDenoiseIndex, templateWindowSize, + h, templateWindowSize, searchWindowSize); + } + #endregion + #region FastNlMeansDenoisingColoredMulti + /// + /// Modification of fastNlMeansDenoisingMulti function for colored images sequences + /// + /// Input 8-bit 3-channel images sequence. All images should have the same type and size. + /// Output image with the same size and type as srcImgs images. + /// Target image to denoise index in srcImgs sequence + /// Number of surrounding images to use for target image denoising. Should be odd. + /// Images from imgToDenoiseIndex - temporalWindowSize / 2 to imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs + /// will be used to denoise srcImgs[imgToDenoiseIndex] image. + /// Parameter regulating filter strength for luminance component. Bigger h value perfectly removes noise + /// but also removes image details, smaller h value preserves details but also preserves some noise. + /// The same as h but for color components. + /// Size in pixels of the template patch that is used to compute weights. Should be odd. Recommended value 7 pixels + /// Size in pixels of the window that is used to compute weighted average for given pixel. + /// Should be odd. Affect performance linearly: greater searchWindowsSize - greater denoising time. Recommended value 21 pixels + public static void FastNlMeansDenoisingColoredMulti(IEnumerable srcImgs, OutputArray dst, + int imgToDenoiseIndex, int temporalWindowSize, float h = 3, float hColor = 3, + int templateWindowSize = 7, int searchWindowSize = 21) + { + if (srcImgs == null) + throw new ArgumentNullException("srcImgs"); + if (dst == null) + throw new ArgumentNullException("dst"); + dst.ThrowIfNotReady(); + IntPtr[] srcImgPtrs = EnumerableEx.SelectPtrs(srcImgs); + + NativeMethods.photo_fastNlMeansDenoisingColoredMulti(srcImgPtrs, srcImgPtrs.Length, dst.CvPtr, imgToDenoiseIndex, + templateWindowSize, h, hColor, templateWindowSize, searchWindowSize); + dst.Fix(); + } + /// + /// Modification of fastNlMeansDenoisingMulti function for colored images sequences + /// + /// Input 8-bit 3-channel images sequence. All images should have the same type and size. + /// Output image with the same size and type as srcImgs images. + /// Target image to denoise index in srcImgs sequence + /// Number of surrounding images to use for target image denoising. Should be odd. + /// Images from imgToDenoiseIndex - temporalWindowSize / 2 to imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs + /// will be used to denoise srcImgs[imgToDenoiseIndex] image. + /// Parameter regulating filter strength for luminance component. Bigger h value perfectly removes noise + /// but also removes image details, smaller h value preserves details but also preserves some noise. + /// The same as h but for color components. + /// Size in pixels of the template patch that is used to compute weights. Should be odd. Recommended value 7 pixels + /// Size in pixels of the window that is used to compute weighted average for given pixel. + /// Should be odd. Affect performance linearly: greater searchWindowsSize - greater denoising time. Recommended value 21 pixels + public static void FastNlMeansDenoisingColoredMulti(IEnumerable srcImgs, OutputArray dst, + int imgToDenoiseIndex, int temporalWindowSize, float h = 3, float hColor = 3, + int templateWindowSize = 7, int searchWindowSize = 21) + { + IEnumerable srcImgsAsArrays = EnumerableEx.Select(srcImgs, m => new InputArray(m)); + FastNlMeansDenoisingColoredMulti(srcImgsAsArrays, dst, imgToDenoiseIndex, templateWindowSize, + h, hColor, templateWindowSize, searchWindowSize); + } + #endregion + + /// + /// Primal-dual algorithm is an algorithm for solving special types of variational problems + /// (that is, finding a function to minimize some functional). As the image denoising, + /// in particular, may be seen as the variational problem, primal-dual algorithm then + /// can be used to perform denoising and this is exactly what is implemented. + /// + /// This array should contain one or more noised versions + /// of the image that is to be restored. + /// Here the denoised image will be stored. There is no need to + /// do pre-allocation of storage space, as it will be automatically allocated, if necessary. + /// Corresponds to \f$\lambda\f$ in the formulas above. + /// As it is enlarged, the smooth (blurred) images are treated more favorably than + /// detailed (but maybe more noised) ones. Roughly speaking, as it becomes smaller, + /// the result will be more blur but more sever outliers will be removed. + /// Number of iterations that the algorithm will run. + /// Of course, as more iterations as better, but it is hard to quantitatively + /// refine this statement, so just use the default and increase it if the results are poor. +// ReSharper disable once InconsistentNaming + public static void DenoiseTVL1( + IEnumerable observations, Mat result, double lambda = 1.0, int niters = 30) + { + if (observations == null) + throw new ArgumentNullException("observations"); + if (result == null) + throw new ArgumentNullException("result"); + + IntPtr[] observationsPtrs = EnumerableEx.SelectPtrs(observations); + NativeMethods.photo_denoise_TVL1(observationsPtrs, observationsPtrs.Length, result.CvPtr, lambda, niters); + GC.KeepAlive(observations); + GC.KeepAlive(result); + } + + /// + /// Transforms a color image to a grayscale image. It is a basic tool in digital + /// printing, stylized black-and-white photograph rendering, and in many single + /// channel image processing applications @cite CL12 . + /// + /// Input 8-bit 3-channel image. + /// Output 8-bit 1-channel image. + /// Output 8-bit 3-channel image. + public static void Decolor( + InputArray src, OutputArray grayscale, OutputArray colorBoost) + { + if (src == null) + throw new ArgumentNullException("src"); + if (grayscale == null) + throw new ArgumentNullException("grayscale"); + if (colorBoost == null) + throw new ArgumentNullException("colorBoost"); + src.ThrowIfDisposed(); + grayscale.ThrowIfNotReady(); + colorBoost.ThrowIfNotReady(); + NativeMethods.photo_decolor(src.CvPtr, grayscale.CvPtr, colorBoost.CvPtr); + GC.KeepAlive(src); + grayscale.Fix(); + colorBoost.Fix(); + } + + /// + /// Image editing tasks concern either global changes (color/intensity corrections, + /// filters, deformations) or local changes concerned to a selection. Here we are + /// interested in achieving local changes, ones that are restricted to a region + /// manually selected (ROI), in a seamless and effortless manner. The extent of + /// the changes ranges from slight distortions to complete replacement by novel + /// content @cite PM03 . + /// + /// Input 8-bit 3-channel image. + /// Input 8-bit 3-channel image. + /// Input 8-bit 1 or 3-channel image. + /// Point in dst image where object is placed. + /// Output image with the same size and type as dst. + /// Cloning method + public static void SeamlessClone( + InputArray src, InputArray dst, InputArray mask, Point p, + OutputArray blend, SeamlessCloneMethods flags) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (blend == null) + throw new ArgumentNullException("blend"); + src.ThrowIfDisposed(); + dst.ThrowIfDisposed(); + if (mask != null) + mask.ThrowIfDisposed(); + blend.ThrowIfNotReady(); + + NativeMethods.photo_seamlessClone( + src.CvPtr, dst.CvPtr, ToPtr(mask), p, blend.CvPtr, (int)flags); + + GC.KeepAlive(src); + GC.KeepAlive(dst); + GC.KeepAlive(mask); + blend.Fix(); + } + + /// + /// Given an original color image, two differently colored versions of this + /// image can be mixed seamlessly. Multiplication factor is between 0.5 to 2.5. + /// + /// Input 8-bit 3-channel image. + /// Input 8-bit 1 or 3-channel image. + /// Output image with the same size and type as src. + /// R-channel multiply factor. + /// G-channel multiply factor. + /// B-channel multiply factor. + public static void ColorChange( + InputArray src, InputArray mask, OutputArray dst, + float redMul = 1.0f, float greenMul = 1.0f, float blueMul = 1.0f) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + if (mask != null) + mask.ThrowIfDisposed(); + + NativeMethods.photo_colorChange( + src.CvPtr, ToPtr(mask), dst.CvPtr, redMul, greenMul, blueMul); + + GC.KeepAlive(src); + GC.KeepAlive(mask); + dst.Fix(); + } + + /// + /// Applying an appropriate non-linear transformation to the gradient field inside + /// the selection and then integrating back with a Poisson solver, modifies locally + /// the apparent illumination of an image. + /// + /// Input 8-bit 3-channel image. + /// Input 8-bit 1 or 3-channel image. + /// Output image with the same size and type as src. + /// Value ranges between 0-2. + /// Value ranges between 0-2. + /// + /// This is useful to highlight under-exposed foreground objects or to reduce specular reflections. + /// + public static void IlluminationChange( + InputArray src, InputArray mask, OutputArray dst, + float alpha = 0.2f, float beta = 0.4f) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + if (mask != null) + mask.ThrowIfDisposed(); + + NativeMethods.photo_illuminationChange( + src.CvPtr, ToPtr(mask), dst.CvPtr, alpha, beta); + + GC.KeepAlive(src); + GC.KeepAlive(mask); + dst.Fix(); + } + + /// + /// By retaining only the gradients at edge locations, before integrating with the + /// Poisson solver, one washes out the texture of the selected region, giving its + /// contents a flat aspect. Here Canny Edge Detector is used. + /// + /// Input 8-bit 3-channel image. + /// Input 8-bit 1 or 3-channel image. + /// Output image with the same size and type as src. + /// Range from 0 to 100. + /// Value > 100. + /// The size of the Sobel kernel to be used. + public static void TextureFlattening( + InputArray src, InputArray mask, OutputArray dst, + float lowThreshold = 30, float highThreshold = 45, + int kernelSize = 3) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + if (mask != null) + mask.ThrowIfDisposed(); + + NativeMethods.photo_textureFlattening( + src.CvPtr, ToPtr(mask), dst.CvPtr, lowThreshold, highThreshold, kernelSize); + + GC.KeepAlive(src); + GC.KeepAlive(mask); + dst.Fix(); + } + + /// + /// Filtering is the fundamental operation in image and video processing. + /// Edge-preserving smoothing filters are used in many different applications @cite EM11 . + /// + /// Input 8-bit 3-channel image. + /// Output 8-bit 3-channel image. + /// Edge preserving filters + /// Range between 0 to 200. + /// Range between 0 to 1. + public static void EdgePreservingFilter( + InputArray src, OutputArray dst, + EdgePreservingMethods flags = EdgePreservingMethods.RecursFilter, + float sigmaS = 60, float sigmaR = 0.4f) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + + NativeMethods.photo_edgePreservingFilter( + src.CvPtr, dst.CvPtr, (int)flags, sigmaS, sigmaR); + + GC.KeepAlive(src); + dst.Fix(); + } + + /// + /// This filter enhances the details of a particular image. + /// + /// Input 8-bit 3-channel image. + /// Output image with the same size and type as src. + /// Range between 0 to 200. + /// Range between 0 to 1. + public static void DetailEnhance( + InputArray src, OutputArray dst, + float sigmaS = 10, float sigmaR = 0.15f) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + + NativeMethods.photo_detailEnhance( + src.CvPtr, dst.CvPtr, sigmaS, sigmaR); + + GC.KeepAlive(src); + dst.Fix(); + } + + /// + /// Pencil-like non-photorealistic line drawing + /// + /// Input 8-bit 3-channel image. + /// Output 8-bit 1-channel image. + /// Output image with the same size and type as src. + /// Range between 0 to 200. + /// Range between 0 to 1. + /// Range between 0 to 0.1. + public static void PencilSketch( + InputArray src, OutputArray dst1, OutputArray dst2, + float sigmaS = 60, float sigmaR = 0.07f, float shadeFactor = 0.02f) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst1 == null) + throw new ArgumentNullException("dst1"); + if (dst2 == null) + throw new ArgumentNullException("dst2"); + + src.ThrowIfDisposed(); + dst1.ThrowIfNotReady(); + dst2.ThrowIfNotReady(); + + NativeMethods.photo_pencilSketch( + src.CvPtr, dst1.CvPtr, dst2.CvPtr, sigmaS, sigmaR, shadeFactor); + + GC.KeepAlive(src); + dst1.Fix(); + dst2.Fix(); + } + + /// + /// Stylization aims to produce digital imagery with a wide variety of effects + /// not focused on photorealism. Edge-aware filters are ideal for stylization, + /// as they can abstract regions of low contrast while preserving, or enhancing, + /// high-contrast features. + /// + /// Input 8-bit 3-channel image. + /// Output image with the same size and type as src. + /// Range between 0 to 200. + /// Range between 0 to 1. + public static void Stylization( + InputArray src, OutputArray dst, + float sigmaS = 60, float sigmaR = 0.45f) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + + NativeMethods.photo_stylization( + src.CvPtr, dst.CvPtr, sigmaS, sigmaR); + + GC.KeepAlive(src); + dst.Fix(); + } + } +} diff --git a/src/OpenCvSharp/Cv2/Cv2_superres.cs b/src/OpenCvSharp/Cv2/Cv2_superres.cs new file mode 100644 index 000000000..bb6986b5a --- /dev/null +++ b/src/OpenCvSharp/Cv2/Cv2_superres.cs @@ -0,0 +1,174 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + static partial class Cv2 + { + /// + /// + /// + /// + public static FrameSource CreateFrameSource_Empty() + { + return FrameSource.CreateEmptySource(); + } + + /// + /// + /// + /// + /// + public static FrameSource CreateFrameSource_Video(string fileName) + { + return FrameSource.CreateVideoSource(fileName); + } + + /// + /// + /// + /// + /// + public static FrameSource CreateFrameSource_Video_CUDA(string fileName) + { + return FrameSource.CreateVideoSourceCuda(fileName); + } + + /// + /// + /// + /// + /// + public static FrameSource CreateFrameSource_Camera(int deviceId) + { + return FrameSource.CreateCameraSource(deviceId); + } + + + /// + /// Create Bilateral TV-L1 Super Resolution. + /// + /// + public static SuperResolution CreateSuperResolution_BTVL1() + { + return SuperResolution.CreateBTVL1(); + } + + /// + /// Create Bilateral TV-L1 Super Resolution. + /// + /// + public static SuperResolution CreateSuperResolution_BTVL1_CUDA() + { + return SuperResolution.CreateBTVL1_CUDA(); + } + + /// + /// Create Bilateral TV-L1 Super Resolution. + /// + /// + public static SuperResolution CreateSuperResolution_BTVL1_OCL() + { + throw new NotImplementedException(); + //return SuperResolution.CreateBTVL1_OCL(); + } + + + + /// + /// + /// + /// + public static DenseOpticalFlowExt CreateOptFlow_Farneback() + { + return DenseOpticalFlowExt.CreateFarneback(); + } + + /// + /// + /// + /// + public static DenseOpticalFlowExt CreateOptFlow_Farneback_GPU() + { + return DenseOpticalFlowExt.CreateFarneback_CUDA(); + } + + /// + /// + /// + /// + public static DenseOpticalFlowExt CreateOptFlow_Farneback_OCL() + { + throw new NotImplementedException(); + //return DenseOpticalFlowExt.CreateFarneback_OCL(); + } + + /// + /// + /// + /// + public static DenseOpticalFlowExt CreateOptFlow_Simple() + { + return DenseOpticalFlowExt.CreateSimple(); + } + + /// + /// + /// + /// + public static DenseOpticalFlowExt CreateOptFlow_DualTVL1Ex() + { + return DenseOpticalFlowExt.CreateDualTVL1(); + } + + /// + /// + /// + /// + public static DenseOpticalFlowExt CreateOptFlow_DualTVL1_GPU() + { + //throw new NotImplementedException(); + return DenseOpticalFlowExt.CreateDualTVL1_CUDA(); + } + + /// + /// + /// + /// + public static DenseOpticalFlowExt CreateOptFlow_DualTVL1_OCL() + { + //throw new NotImplementedException(); + return DenseOpticalFlowExt.CreateDualTVL1_OCL(); + } + + /// + /// + /// + /// + public static DenseOpticalFlowExt CreateOptFlow_Brox_GPU() + { + return DenseOpticalFlowExt.CreateBrox_CUDA(); + } + + /// + /// + /// + /// + public static DenseOpticalFlowExt CreateOptFlow_PyrLK_GPU() + { + //throw new NotImplementedException(); + return DenseOpticalFlowExt.CreatePyrLK_CUDA(); + } + + /// + /// + /// + /// + public static DenseOpticalFlowExt CreateOptFlow_PyrLK_OCL() + { + //throw new NotImplementedException(); + return DenseOpticalFlowExt.CreatePyrLK_OCL(); + } + } +} diff --git a/src/OpenCvSharp/Cv2/Cv2_video.cs b/src/OpenCvSharp/Cv2/Cv2_video.cs new file mode 100644 index 000000000..9745814ff --- /dev/null +++ b/src/OpenCvSharp/Cv2/Cv2_video.cs @@ -0,0 +1,309 @@ +using System; +using System.Collections.Generic; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + static partial class Cv2 + { + /// + /// Finds an object center, size, and orientation. + /// + /// Back projection of the object histogram. + /// Initial search window. + /// Stop criteria for the underlying MeanShift() . + /// + public static RotatedRect CamShift( + InputArray probImage, ref Rect window, TermCriteria criteria) + { + if (probImage == null) + throw new ArgumentNullException("probImage"); + probImage.ThrowIfDisposed(); + + RotatedRect result = NativeMethods.video_CamShift( + probImage.CvPtr, ref window, criteria); + return result; + } + + /// + /// Finds an object on a back projection image. + /// + /// Back projection of the object histogram. + /// Initial search window. + /// Stop criteria for the iterative search algorithm. + /// Number of iterations CAMSHIFT took to converge. + public static int MeanShift( + InputArray probImage, ref Rect window, TermCriteria criteria) + { + if (probImage == null) + throw new ArgumentNullException("probImage"); + probImage.ThrowIfDisposed(); + + int result = NativeMethods.video_meanShift( + probImage.CvPtr, ref window, criteria); + return result; + } + + /// + /// Constructs a pyramid which can be used as input for calcOpticalFlowPyrLK + /// + /// 8-bit input image. + /// output pyramid. + /// window size of optical flow algorithm. + /// Must be not less than winSize argument of calcOpticalFlowPyrLK(). + /// It is needed to calculate required padding for pyramid levels. + /// 0-based maximal pyramid level number. + /// set to precompute gradients for the every pyramid level. + /// If pyramid is constructed without the gradients then calcOpticalFlowPyrLK() will + /// calculate them internally. + /// the border mode for pyramid layers. + /// the border mode for gradients. + /// put ROI of input image into the pyramid if possible. + /// You can pass false to force data copying. + /// number of levels in constructed pyramid. Can be less than maxLevel. + public static int BuildOpticalFlowPyramid( + InputArray img, OutputArray pyramid, + Size winSize, int maxLevel, + bool withDerivatives = true, + BorderTypes pyrBorder = BorderTypes.Reflect101, + BorderTypes derivBorder = BorderTypes.Constant, + bool tryReuseInputImage = true) + { + if (img == null) + throw new ArgumentNullException("img"); + if (pyramid == null) + throw new ArgumentNullException("pyramid"); + img.ThrowIfDisposed(); + pyramid.ThrowIfNotReady(); + + int result = NativeMethods.video_buildOpticalFlowPyramid1( + img.CvPtr, pyramid.CvPtr, winSize, maxLevel, withDerivatives ? 1 : 0, + (int)pyrBorder, (int)derivBorder, tryReuseInputImage ? 1 : 0); + pyramid.Fix(); + return result; + } + + /// + /// Constructs a pyramid which can be used as input for calcOpticalFlowPyrLK + /// + /// 8-bit input image. + /// output pyramid. + /// window size of optical flow algorithm. + /// Must be not less than winSize argument of calcOpticalFlowPyrLK(). + /// It is needed to calculate required padding for pyramid levels. + /// 0-based maximal pyramid level number. + /// set to precompute gradients for the every pyramid level. + /// If pyramid is constructed without the gradients then calcOpticalFlowPyrLK() will + /// calculate them internally. + /// the border mode for pyramid layers. + /// the border mode for gradients. + /// put ROI of input image into the pyramid if possible. + /// You can pass false to force data copying. + /// number of levels in constructed pyramid. Can be less than maxLevel. + public static int BuildOpticalFlowPyramid( + InputArray img, out Mat[] pyramid, + Size winSize, int maxLevel, + bool withDerivatives = true, + BorderTypes pyrBorder = BorderTypes.Reflect101, + BorderTypes derivBorder = BorderTypes.Constant, + bool tryReuseInputImage = true) + { + if (img == null) + throw new ArgumentNullException("img"); + img.ThrowIfDisposed(); + + using (var pyramidVec = new VectorOfMat()) + { + int result = NativeMethods.video_buildOpticalFlowPyramid2( + img.CvPtr, pyramidVec.CvPtr, winSize, maxLevel, withDerivatives ? 1 : 0, + (int) pyrBorder, (int) derivBorder, tryReuseInputImage ? 1 : 0); + pyramid = pyramidVec.ToArray(); + return result; + } + } + + /// + /// computes sparse optical flow using multi-scale Lucas-Kanade algorithm + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static void CalcOpticalFlowPyrLK( + InputArray prevImg, InputArray nextImg, + InputArray prevPts, InputOutputArray nextPts, + OutputArray status, OutputArray err, + Size? winSize = null, + int maxLevel = 3, + TermCriteria? criteria = null, + OpticalFlowFlags flags = OpticalFlowFlags.None, + double minEigThreshold = 1e-4) + { + if (prevImg == null) + throw new ArgumentNullException("prevImg"); + if (nextImg == null) + throw new ArgumentNullException("nextImg"); + if (prevPts == null) + throw new ArgumentNullException("prevPts"); + if (nextPts == null) + throw new ArgumentNullException("nextPts"); + if (status == null) + throw new ArgumentNullException("status"); + if (err == null) + throw new ArgumentNullException("err"); + prevImg.ThrowIfDisposed(); + nextImg.ThrowIfDisposed(); + prevPts.ThrowIfDisposed(); + nextPts.ThrowIfNotReady(); + status.ThrowIfNotReady(); + err.ThrowIfNotReady(); + + Size winSize0 = winSize.GetValueOrDefault(new Size(21, 21)); + TermCriteria criteria0 = criteria.GetValueOrDefault( + TermCriteria.Both(30, 0.01)); + + NativeMethods.video_calcOpticalFlowPyrLK_InputArray( + prevImg.CvPtr, nextImg.CvPtr, prevPts.CvPtr, nextPts.CvPtr, + status.CvPtr, err.CvPtr, winSize0,maxLevel, + criteria0, (int)flags, minEigThreshold); + + nextPts.Fix(); + status.Fix(); + err.Fix(); + } + /// + /// computes sparse optical flow using multi-scale Lucas-Kanade algorithm + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static void CalcOpticalFlowPyrLK( + InputArray prevImg, InputArray nextImg, + Point2f[] prevPts, ref Point2f[] nextPts, + out byte[] status, out float[] err, + Size? winSize = null, + int maxLevel = 3, + TermCriteria? criteria = null, + OpticalFlowFlags flags = OpticalFlowFlags.None, + double minEigThreshold = 1e-4) + { + if (prevImg == null) + throw new ArgumentNullException("prevImg"); + if (nextImg == null) + throw new ArgumentNullException("nextImg"); + if (prevPts == null) + throw new ArgumentNullException("prevPts"); + if (nextPts == null) + throw new ArgumentNullException("nextPts"); + prevImg.ThrowIfDisposed(); + nextImg.ThrowIfDisposed(); + + Size winSize0 = winSize.GetValueOrDefault(new Size(21, 21)); + TermCriteria criteria0 = criteria.GetValueOrDefault( + TermCriteria.Both(30, 0.01)); + + using (var nextPtsVec = new VectorOfPoint2f()) + using (var statusVec = new VectorOfByte()) + using (var errVec = new VectorOfFloat()) + { + NativeMethods.video_calcOpticalFlowPyrLK_vector( + prevImg.CvPtr, nextImg.CvPtr, prevPts, prevPts.Length, + nextPtsVec.CvPtr, statusVec.CvPtr, errVec.CvPtr, + winSize0, maxLevel, criteria0, (int)flags, minEigThreshold); + nextPts = nextPtsVec.ToArray(); + status = statusVec.ToArray(); + err = errVec.ToArray(); + } + } + + /// + /// Computes a dense optical flow using the Gunnar Farneback's algorithm. + /// + /// first 8-bit single-channel input image. + /// second input image of the same size and the same type as prev. + /// computed flow image that has the same size as prev and type CV_32FC2. + /// parameter, specifying the image scale (<1) to build pyramids for each image; + /// pyrScale=0.5 means a classical pyramid, where each next layer is twice smaller than the previous one. + /// number of pyramid layers including the initial image; + /// levels=1 means that no extra layers are created and only the original images are used. + /// averaging window size; larger values increase the algorithm robustness to + /// image noise and give more chances for fast motion detection, but yield more blurred motion field. + /// number of iterations the algorithm does at each pyramid level. + /// size of the pixel neighborhood used to find polynomial expansion in each pixel; + /// larger values mean that the image will be approximated with smoother surfaces, + /// yielding more robust algorithm and more blurred motion field, typically poly_n =5 or 7. + /// standard deviation of the Gaussian that is used to smooth derivatives used as + /// a basis for the polynomial expansion; for polyN=5, you can set polySigma=1.1, + /// for polyN=7, a good value would be polySigma=1.5. + /// operation flags that can be a combination of OPTFLOW_USE_INITIAL_FLOW and/or OPTFLOW_FARNEBACK_GAUSSIAN + public static void CalcOpticalFlowFarneback(InputArray prev, InputArray next, + InputOutputArray flow, double pyrScale, int levels, int winsize, + int iterations, int polyN, double polySigma, OpticalFlowFlags flags) + { + if (prev == null) + throw new ArgumentNullException("prev"); + if (next == null) + throw new ArgumentNullException("next"); + if (flow == null) + throw new ArgumentNullException("flow"); + prev.ThrowIfDisposed(); + next.ThrowIfDisposed(); + flow.ThrowIfNotReady(); + + NativeMethods.video_calcOpticalFlowFarneback(prev.CvPtr, next.CvPtr, + flow.CvPtr, pyrScale, levels, winsize, iterations, polyN, polySigma, + (int)flags); + + flow.Fix(); + } + + /// + /// Estimates the best-fit Euqcidean, similarity, affine or perspective transformation + /// that maps one 2D point set to another or one image to another. + /// + /// First input 2D point set stored in std::vector or Mat, or an image stored in Mat. + /// Second input 2D point set of the same size and the same type as A, or another image. + /// If true, the function finds an optimal affine transformation with no additional restrictions (6 degrees of freedom). + /// Otherwise, the class of transformations to choose from is limited to combinations of translation, rotation, and uniform scaling (5 degrees of freedom). + /// + public static Mat EstimateRigidTransform( + InputArray src, InputArray dst, bool fullAffine) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfDisposed(); + + IntPtr result = NativeMethods.video_estimateRigidTransform( + src.CvPtr, dst.CvPtr, fullAffine ? 1 : 0); + return new Mat(result); + } + + /// + /// Implementation of the Zach, Pock and Bischof Dual TV-L1 Optical Flow method + /// + /// + public static DenseOpticalFlow CreateOptFlow_DualTVL1() + { + return DenseOpticalFlow.CreateOptFlow_DualTVL1(); + } + } +} diff --git a/src/OpenCvSharp/Cv2/Cv2_xfeatures2d.cs b/src/OpenCvSharp/Cv2/Cv2_xfeatures2d.cs new file mode 100644 index 000000000..e0e58f043 --- /dev/null +++ b/src/OpenCvSharp/Cv2/Cv2_xfeatures2d.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + static partial class Cv2 + { + } +} diff --git a/src/OpenCvSharp/CvObject.cs b/src/OpenCvSharp/CvObject.cs new file mode 100644 index 000000000..bfead5583 --- /dev/null +++ b/src/OpenCvSharp/CvObject.cs @@ -0,0 +1,64 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// OpenCVのネイティブポインタをもったクラスの基本クラス + /// +#else + /// + /// A class which has a pointer of OpenCV structure + /// +#endif + public abstract class CvObject : ICvPtrHolder + { + /// + /// Data pointer + /// + protected IntPtr ptr; + +#if LANG_JP + /// + /// + /// +#else + /// + /// Default constructor + /// +#endif + protected CvObject() + { + } + +#if LANG_JP + /// + /// + /// + /// +#else + /// + /// + /// + /// +#endif + protected CvObject(IntPtr ptr) + { + this.ptr = ptr; + } + +#if LANG_JP + /// + /// OpenCVの構造体へのネイティブポインタ + /// +#else + /// + /// Native pointer of OpenCV structure + /// +#endif + public IntPtr CvPtr + { + get { return ptr; } + } + } +} diff --git a/src/OpenCvSharp/Delegate/CvErrorCallback.cs b/src/OpenCvSharp/Delegate/CvErrorCallback.cs new file mode 100644 index 000000000..d6194624f --- /dev/null +++ b/src/OpenCvSharp/Delegate/CvErrorCallback.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// エラーハンドラ + /// + /// エラーステータス + /// エラーが発生したOpenCVの関数名 + /// エラーについての追加情報/診断結果 + /// エラーが発生したファイル名 + /// エラーが発生した行番号 + /// +#else + /// + /// Error Handler + /// + /// The numeric code for error status + /// The source file name where error is encountered + /// A description of the error + /// The source file name where error is encountered + /// The line number in the souce where error is encountered + /// Pointer to the user data. Ignored by the standard handlers +#endif + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int CvErrorCallback( + [MarshalAs(UnmanagedType.I4)] ErrorCode status, + [MarshalAs(UnmanagedType.LPStr)] string funcName, + [MarshalAs(UnmanagedType.LPStr)] string errMsg, + [MarshalAs(UnmanagedType.LPStr)] string fileName, + int line, + IntPtr userdata + ); +} diff --git a/src/OpenCvSharp/Delegate/CvMouseCallback.cs b/src/OpenCvSharp/Delegate/CvMouseCallback.cs new file mode 100644 index 000000000..6df91fc07 --- /dev/null +++ b/src/OpenCvSharp/Delegate/CvMouseCallback.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cvSetMouseCallbackで指定する、HighGUIウィンドウでマウスイベントが発生したときのイベント処理を行うデリゲート + /// + /// CV_EVENT_ であらわされるフラグのうちのひとつ + /// 画像内でのマウスポインタのx座標 + /// 画像内でのマウスポインタのy座標 + /// CV_EVENT_FLAGであらわされるフラグの論理和 +#else + /// + /// Delegate to be called every time mouse event occurs in the specified window. + /// + /// one of CV_EVENT_ + /// x-coordinates of mouse pointer in image coordinates + /// y-coordinates of mouse pointer in image coordinates + /// a combination of CV_EVENT_FLAG +#endif + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void CvMouseCallback( + MouseEvent @event, + Int32 x, + Int32 y, + MouseEvent flags/*, + void* param <- うまくいかん + */ + ); +} diff --git a/src/OpenCvSharp/Delegate/CvTrackbarCallback.cs b/src/OpenCvSharp/Delegate/CvTrackbarCallback.cs new file mode 100644 index 000000000..f869af088 --- /dev/null +++ b/src/OpenCvSharp/Delegate/CvTrackbarCallback.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// CvTrackbarが操作されたときのイベント処理を行うデリゲート + /// +#else + /// + /// Delegate to be called every time the slider changes the position. + /// + /// +#endif + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void CvTrackbarCallback(int pos); + + + + + +#if LANG_JP + /// + /// CvTrackbarが操作されたときのイベント処理を行うデリゲート + /// + /// + /// +#else + /// + /// Delegate to be called every time the slider changes the position. + /// + /// + /// +#endif + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void CvTrackbarCallback2(int pos, object userdata); + + /// + /// + /// + /// + /// + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void CvTrackbarCallback2Native(int pos, IntPtr userdata); +} diff --git a/src/OpenCvSharp/Delegate/MatForeachFunction.cs b/src/OpenCvSharp/Delegate/MatForeachFunction.cs new file mode 100644 index 000000000..8fe898384 --- /dev/null +++ b/src/OpenCvSharp/Delegate/MatForeachFunction.cs @@ -0,0 +1,83 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ +#pragma warning disable 1591 +// ReSharper disable InconsistentNaming + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionByte(byte* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionVec2b(Vec2b* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionVec3b(Vec3b* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionVec4b(Vec4b* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionVec6b(Vec6b* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionInt16(short* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionVec2s(Vec2s* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionVec3s(Vec3s* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionVec4s(Vec4s* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionVec6s(Vec6s* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionInt32(int* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionVec2i(Vec2i* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionVec3i(Vec3i* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionVec4i(Vec4i* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionVec6i(Vec6i* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionFloat(float* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionVec2f(Vec2f* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionVec3f(Vec3f* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionVec4f(Vec4f* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionVec6f(Vec6f* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionDouble(double* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionVec2d(Vec2d* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionVec3d(Vec3d* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionVec4d(Vec4d* value, int* position); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void MatForeachFunctionVec6d(Vec6d* value, int* position); +} diff --git a/src/OpenCvSharp/DisposableCvObject.cs b/src/OpenCvSharp/DisposableCvObject.cs new file mode 100644 index 000000000..6c93c4ea8 --- /dev/null +++ b/src/OpenCvSharp/DisposableCvObject.cs @@ -0,0 +1,147 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// リソースを解放すべきOpenCVのクラスに継承させる基本クラス + /// +#else + /// + /// DisposableObject + ICvPtrHolder + /// +#endif + abstract public class DisposableCvObject : DisposableObject, ICvPtrHolder + { + /// + /// Data pointer + /// + protected IntPtr ptr; + + /// + /// Track whether Dispose has been called + /// + private bool disposed; + + #region Init and Dispose +#if LANG_JP + /// + /// + /// +#else + /// + /// Default constructor + /// +#endif + protected DisposableCvObject() + : this(true) + { + } + +#if LANG_JP + /// + /// + /// + /// +#else + /// + /// + /// + /// +#endif + protected DisposableCvObject(IntPtr ptr) + : this(ptr, true) + { + } + +#if LANG_JP + /// + /// + /// + /// +#else + /// + /// + /// + /// +#endif + protected DisposableCvObject(bool isEnabledDispose) + : this(IntPtr.Zero, isEnabledDispose) + { + } + +#if LANG_JP + /// + /// + /// + /// + /// +#else + /// + /// + /// + /// + /// +#endif + protected DisposableCvObject(IntPtr ptr, bool isEnabledDispose) + : base(isEnabledDispose) + { + this.ptr = ptr; + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + +#if LANG_JP + /// + /// OpenCVの構造体へのネイティブポインタ + /// +#else + /// + /// Native pointer of OpenCV structure + /// +#endif + public IntPtr CvPtr + { + get + { + ThrowIfDisposed(); + return ptr; + } + } + } +} diff --git a/src/OpenCvSharp/DisposableObject.cs b/src/OpenCvSharp/DisposableObject.cs new file mode 100644 index 000000000..14f5e6929 --- /dev/null +++ b/src/OpenCvSharp/DisposableObject.cs @@ -0,0 +1,273 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// 解放処理を行うクラスが継承するための基本クラス + /// +#else + /// + /// Represents a class which manages its own memory. + /// +#endif + abstract public class DisposableObject : IDisposable + { + #region Init and Dispossal +#if LANG_JP + /// + /// デフォルトコンストラクタ + /// +#else + /// + /// Default constructor + /// +#endif + protected DisposableObject() + : this(true) + { + } +#if LANG_JP + /// + /// 解放の可否を指定して初期化 + /// + /// GCで解放するならtrue +#else + /// + /// Constructor + /// + /// true if you permit disposing this class by GC +#endif + protected DisposableObject(bool isEnabledDispose) + { + IsDisposed = false; + IsEnabledDispose = isEnabledDispose; + AllocatedMemory = IntPtr.Zero; + AllocatedMemorySize = 0; + } + +#if LANG_JP + /// + /// リソースの解放 + /// +#else + /// + /// Releases the resources + /// +#endif + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected virtual void Dispose(bool disposing) + { + if (!IsDisposed) + { + // releases managed resources + if (disposing) + { + } + + // releases unmanaged resources + if (dataHandle.IsAllocated) + { + dataHandle.Free(); + } + if (AllocatedMemorySize > 0) + { + GC.RemoveMemoryPressure(AllocatedMemorySize); + AllocatedMemorySize = 0; + } + if (AllocatedMemory != IntPtr.Zero) + { + Marshal.FreeHGlobal(AllocatedMemory); + AllocatedMemory = IntPtr.Zero; + } + + IsDisposed = true; + } + } + +#if LANG_JP + /// + /// デストラクタ + /// +#else + /// + /// Destructor + /// +#endif + ~DisposableObject() + { + Dispose(false); + } + #endregion + + #region Properties +#if LANG_JP + /// + /// リソースが解放済みかどうかを取得する + /// +#else + /// + /// Gets a value indicating whether this instance has been disposed. + /// +#endif + public bool IsDisposed { get; protected set; } +#if LANG_JP + /// + /// 解放処理を許可するかどうかを取得・設定する. falseならばDisposeは何もしない. + /// 通常はユーザはこのフラグを変更してはならない. CvCapture.QueryFrameで取得したIplImageのように, + /// 解放処理をするとエラーとなるオブジェクトの場合に自動的にこのフラグがfalseとなる。 + /// +#else + /// + /// Gets or sets a value indicating whether you permit disposing this instance. + /// +#endif + public bool IsEnabledDispose { get; set; } + + /// + /// Gets or sets a handle which allocates using cvSetData. + /// + protected GCHandle dataHandle; + +#if LANG_JP + /// + /// cvCreateXXX といった関数がなく自前で構造体の分のメモリを確保する場合、 + /// そのアドレスを入れておく場所 + /// +#else + /// + /// Gets or sets a memory address allocated by AllocMemory. + /// +#endif + protected IntPtr AllocatedMemory { get; set; } +#if LANG_JP + /// + /// AllocatedMemoryに確保されているメモリのサイズ + /// +#else + /// + /// Gets or sets the byte length of the allocated memory + /// +#endif + protected long AllocatedMemorySize { get; set; } + #endregion + + #region Methods +#if LANG_JP + /// + /// cvSetDataで割り当てる配列データをGCHandleでピン止めする + /// + /// +#else + /// + /// Pins the object to be allocated by cvSetData. + /// + /// + /// +#endif + protected internal GCHandle AllocGCHandle(object obj) + { + if (obj == null) + throw new ArgumentNullException("obj"); + + if (dataHandle.IsAllocated) + dataHandle.Free(); + dataHandle = GCHandle.Alloc(obj, GCHandleType.Pinned); + return dataHandle; + } +#if LANG_JP + /// + /// 指定したサイズの量のメモリを割り当てる。 + /// Dispose時に解放する + /// + /// 割り当てたメモリ +#else + /// + /// Allocates the specified size of memory. + /// + /// + /// +#endif + protected IntPtr AllocMemory(int size) + { + if (size <= 0) + throw new ArgumentOutOfRangeException("size"); + + if (AllocatedMemory != IntPtr.Zero) + Marshal.FreeHGlobal(AllocatedMemory); + AllocatedMemory = Marshal.AllocHGlobal(size); + NotifyMemoryPressure(size); + return AllocatedMemory; + } +#if LANG_JP + /// + /// アンマネージメモリを確保したメモリサイズを通知する。 + /// + /// 実際に確保するならAllocMemoryのほうを使う。 + /// 確保はcvCreateXXXがやってくれるという場合はこっちを使う + /// + /// +#else + /// + /// Notifies the allocated size of memory. + /// + /// +#endif + protected void NotifyMemoryPressure(long size) + { + // マルチスレッド動作時にロックがかかるらしい。いったん廃止 + if (!IsEnabledDispose) + return; + if (size == 0) + return; + if (size <= 0) + throw new ArgumentOutOfRangeException("size"); + + if (AllocatedMemorySize > 0) + GC.RemoveMemoryPressure(AllocatedMemorySize); + + AllocatedMemorySize = size; + GC.AddMemoryPressure(size); + } + +#if LANG_JP + /// + /// このオブジェクトが解放済みの場合はObjectDisposedExceptionを投げる + /// +#else + /// + /// If this object is disposed, then ObjectDisposedException is thrown. + /// +#endif + public void ThrowIfDisposed() + { + if (IsDisposed) + throw new ObjectDisposedException(GetType().FullName); + } + #endregion + } +} diff --git a/src/OpenCvSharp/ICvPtrHolder.cs b/src/OpenCvSharp/ICvPtrHolder.cs new file mode 100644 index 000000000..fe8bcb45f --- /dev/null +++ b/src/OpenCvSharp/ICvPtrHolder.cs @@ -0,0 +1,22 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// OpenCVのネイティブデータポインタを持つことを示すインターフェイス + /// +#else + /// + /// Represents a OpenCV-based class which has a native pointer. + /// +#endif + public interface ICvPtrHolder + { + /// + /// Unmanaged OpenCV data pointer + /// + IntPtr CvPtr { get; } + + } +} diff --git a/src/OpenCvSharp/Key.snk b/src/OpenCvSharp/Key.snk new file mode 100644 index 000000000..a1e033087 Binary files /dev/null and b/src/OpenCvSharp/Key.snk differ diff --git a/src/OpenCvSharp/MatProxy.cs b/src/OpenCvSharp/MatProxy.cs new file mode 100644 index 000000000..0980a8072 --- /dev/null +++ b/src/OpenCvSharp/MatProxy.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// DebuggrVisualizerにおいて、シリアライズ不可能なクラスをやり取りするために使うプロキシ。 + /// 送る際に、このProxyに表示に必要なシリアライズ可能なデータを詰めて送り、受信側で復元する。 + /// + [Serializable] + public class MatProxy : IDisposable + { + /// + /// 画像をエンコードしたデータ + /// + public byte[] ImageData { get; private set; } + + /// + /// 初期化 + /// + /// + public MatProxy(Mat image) + { + using (var converted = new Mat()) + { + Cv2.ConvertImage(image, converted); + ImageData = converted.ToBytes(".png"); + } + } + + /// + /// リソースの解放 + /// + public void Dispose() + { + ImageData = null; + } + + /// + /// ImageDataをストリームにして返す + /// + /// + public Stream CreateBitmapStream() + { + if (ImageData == null) + throw new Exception("ImageData == null"); + return new MemoryStream(ImageData); + } + } +} diff --git a/src/OpenCvSharp/OpenCVException.cs b/src/OpenCvSharp/OpenCVException.cs new file mode 100644 index 000000000..c94ca758e --- /dev/null +++ b/src/OpenCvSharp/OpenCVException.cs @@ -0,0 +1,98 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// OpenCVから投げられる例外 + /// +#else + /// + /// The default exception to be thrown by OpenCV + /// +#endif + public class OpenCVException : ApplicationException + { + #region Properties +#if LANG_JP + /// + /// エラーステータス + /// +#else + /// + /// The numeric code for error status + /// +#endif + public ErrorCode Status { get; set; } +#if LANG_JP + /// + /// エラーが発生したOpenCVの関数名. + /// +#else + /// + /// The source file name where error is encountered + /// +#endif + public string FuncName { get; set; } +#if LANG_JP + /// + /// エラーについての追加情報/診断結果 + /// +#else + /// + /// A description of the error + /// +#endif + public string ErrMsg { get; set; } +#if LANG_JP + /// + /// エラーが発生したファイル名 + /// +#else + /// + /// The source file name where error is encountered + /// +#endif + public string FileName { get; set; } +#if LANG_JP + /// + /// エラーが発生した行番号 + /// +#else + /// + /// The line number in the souce where error is encountered + /// +#endif + public int Line { get; set; } + #endregion + +#if LANG_JP + /// + /// 初期化 + /// + /// エラーステータス + /// エラーが発生した関数名 + /// エラーについての追加情報/診断結果 + /// エラーが発生したファイル名 + /// エラーが発生した行番号 +#else + /// + /// Constructor + /// + /// The numeric code for error status + /// The source file name where error is encountered + /// A description of the error + /// The source file name where error is encountered + /// The line number in the souce where error is encountered +#endif + public OpenCVException(ErrorCode status, string funcName, string errMsg, string fileName, int line) + : base(errMsg) + { + Status = status; + FuncName = funcName; + ErrMsg = errMsg; + FileName = fileName; + Line = line; + } + } +} diff --git a/src/OpenCvSharp/OpenCvSharp.csproj b/src/OpenCvSharp/OpenCvSharp.csproj new file mode 100644 index 000000000..2c5f1d3d3 --- /dev/null +++ b/src/OpenCvSharp/OpenCvSharp.csproj @@ -0,0 +1,494 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {524CC7B4-75B9-4925-9DA4-3DACD40F4814} + Library + Properties + OpenCvSharp + OpenCvSharp + v2.0 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + bin\Release\OpenCvSharp.xml + + + + + bin\Release JP\ + TRACE;LANG_JP + true + pdbonly + AnyCPU + prompt + true + bin\Release JP\OpenCvSharp.xml + + + true + + + Key.snk + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows インストーラー 3.1 + true + + + + + + PreserveNewest + + + + + + + + + + + \ No newline at end of file diff --git a/src/OpenCvSharp/OpenCvSharp.dll.config b/src/OpenCvSharp/OpenCvSharp.dll.config new file mode 100644 index 000000000..095f0d9e2 --- /dev/null +++ b/src/OpenCvSharp/OpenCvSharp.dll.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/OpenCvSharp/OpenCvSharpException.cs b/src/OpenCvSharp/OpenCvSharpException.cs new file mode 100644 index 000000000..120c48901 --- /dev/null +++ b/src/OpenCvSharp/OpenCvSharpException.cs @@ -0,0 +1,48 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// OpenCvSharpから投げられる例外 + /// +#else + /// + /// The exception that is thrown by OpenCvSharp. + /// +#endif + public class OpenCvSharpException : ApplicationException + { + /// + /// + /// + public OpenCvSharpException() + : base() + { + } + /// + /// + /// + /// + public OpenCvSharpException(string message) + : base(message) + { } + /// + /// + /// + /// + /// + public OpenCvSharpException(string messageFormat, params object[] args) + : base(string.Format(messageFormat, args)) + { } + /// + /// + /// + /// + /// + public OpenCvSharpException(string message, Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/src/OpenCvSharp/PInvoke/NativeMethods.cs b/src/OpenCvSharp/PInvoke/NativeMethods.cs new file mode 100644 index 000000000..72e4dff0b --- /dev/null +++ b/src/OpenCvSharp/PInvoke/NativeMethods.cs @@ -0,0 +1,207 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Security; +using System.Security.Permissions; +using OpenCvSharp.Util; + +// ReSharper disable InconsistentNaming +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + /// + /// P/Invoke methods of OpenCV 2.x C++ interface + /// + [SuppressUnmanagedCodeSecurity] + public static partial class NativeMethods + { + /// + /// Is tried P/Invoke once + /// + private static bool tried = false; + + public const string DllMsvcr = "msvcr120"; + public const string DllMsvcp = "msvcp120"; + + public const string DllExtern = "OpenCvSharpExtern"; + + public const string Version = "310"; + + private static readonly string[] RuntimeDllNames = + { + DllMsvcr, + DllMsvcp, + }; + + private static readonly string[] OpenCVDllNames = + { + "opencv_world", + }; + + public const string DllFfmpegX86 = "opencv_ffmpeg" + Version; + public const string DllFfmpegX64 = DllFfmpegX86 + "_64"; + + /// + /// Static constructor + /// + [SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)] + static NativeMethods() + { + LoadLibraries(WindowsLibraryLoader.Instance.AdditionalPaths); + + // call cv to enable redirecting + TryPInvoke(); + } + + /// + /// Load DLL files dynamically using Win32 LoadLibrary + /// + /// + public static void LoadLibraries(IEnumerable additionalPaths = null) + { + if (IsUnix()) + return; + + string[] ap = EnumerableEx.ToArray(additionalPaths); + List runtimePaths = new List (ap); + runtimePaths.Add(Environment.GetFolderPath(Environment.SpecialFolder.System)); + + foreach (string dll in RuntimeDllNames) + { + WindowsLibraryLoader.Instance.LoadLibrary(dll, runtimePaths); + } + foreach (string dll in OpenCVDllNames) + { + WindowsLibraryLoader.Instance.LoadLibrary(dll + Version, ap); + } + + // calib3d, contrib, core, features2d, flann, highgui, imgproc, legacy, + // ml, nonfree, objdetect, photo, superres, video, videostab + WindowsLibraryLoader.Instance.LoadLibrary(DllExtern, ap); + + // Redirection of error occurred in native library + IntPtr zero = IntPtr.Zero; + IntPtr current = redirectError(ErrorHandlerThrowException, zero, ref zero); + if (current != IntPtr.Zero) + { + ErrorHandlerDefault = (CvErrorCallback)Marshal.GetDelegateForFunctionPointer( + current, + typeof(CvErrorCallback) + ); + } + else + { + ErrorHandlerDefault = null; + } + } + + /// + /// Checks whether PInvoke functions can be called + /// + private static void TryPInvoke() + { + if (tried) + return; + tried = true; + + try + { + core_Mat_sizeof(); + } + catch (DllNotFoundException e) + { + var exception = PInvokeHelper.CreateException(e); + try{Console.WriteLine(exception.Message);} + catch{} + try{Debug.WriteLine(exception.Message);} + catch{} + throw exception; + } + catch (BadImageFormatException e) + { + var exception = PInvokeHelper.CreateException(e); + try { Console.WriteLine(exception.Message); } + catch { } + try { Debug.WriteLine(exception.Message); } + catch { } + throw exception; + } + catch (Exception e) + { + Exception ex = e.InnerException ?? e; + try{ Console.WriteLine(ex.Message); } + catch{} + try{ Debug.WriteLine(ex.Message); } + catch{} + throw; + } + } + + /// + /// Returns whether the OS is Windows or not + /// + /// + public static bool IsWindows() + { + return !IsUnix(); + } + + /// + /// Returns whether the OS is *nix or not + /// + /// + public static bool IsUnix() + { + var p = Environment.OSVersion.Platform; + return (p == PlatformID.Unix || + p == PlatformID.MacOSX || + (int)p == 128); + } + + /// + /// Returns whether the runtime is Mono or not + /// + /// + public static bool IsMono() + { + return (Type.GetType("Mono.Runtime") != null); + } + + #region Error redirection + /// + /// Custom error handler to be thrown by OpenCV + /// + public static readonly CvErrorCallback ErrorHandlerThrowException = + delegate(ErrorCode status, string funcName, string errMsg, string fileName, int line, IntPtr userdata) + { + try + { + //cvSetErrStatus(CvStatus.StsOk); + return 0; + } + finally + { + + throw new OpenCVException(status, funcName, errMsg, fileName, line); + } + }; + + /// + /// Custom error handler to ignore all OpenCV errors + /// + public static readonly CvErrorCallback ErrorHandlerIgnorance = + delegate(ErrorCode status, string funcName, string errMsg, string fileName, int line, IntPtr userdata) + { + //cvSetErrStatus(CvStatus.StsOk); + return 0; + }; + + /// + /// Default error handler + /// + public static CvErrorCallback ErrorHandlerDefault; + #endregion + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/NativeMethods_bgsegm.cs b/src/OpenCvSharp/PInvoke/NativeMethods_bgsegm.cs new file mode 100644 index 000000000..2c47b6e2a --- /dev/null +++ b/src/OpenCvSharp/PInvoke/NativeMethods_bgsegm.cs @@ -0,0 +1,122 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + #region BackgroundSubtractorMOG + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr bgsegm_createBackgroundSubtractorMOG( + int history, int nmixtures, double backgroundRatio, double noiseSigma); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void bgsegm_Ptr_BackgroundSubtractorMOG_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr bgsegm_Ptr_BackgroundSubtractorMOG_get(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int bgsegm_BackgroundSubtractorMOG_getHistory(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void bgsegm_BackgroundSubtractorMOG_setHistory(IntPtr ptr, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int bgsegm_BackgroundSubtractorMOG_getNMixtures(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void bgsegm_BackgroundSubtractorMOG_setNMixtures(IntPtr ptr, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double bgsegm_BackgroundSubtractorMOG_getBackgroundRatio(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void bgsegm_BackgroundSubtractorMOG_setBackgroundRatio(IntPtr ptr, double value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double bgsegm_BackgroundSubtractorMOG_getNoiseSigma(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void bgsegm_BackgroundSubtractorMOG_setNoiseSigma(IntPtr ptr, double value); + + #endregion + + #region BackgroundSubtractorGMG + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr bgsegm_createBackgroundSubtractorGMG( + int initializationFrames, double decisionThreshold); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void bgsegm_Ptr_BackgroundSubtractorGMG_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr bgsegm_Ptr_BackgroundSubtractorGMG_get(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int bgsegm_BackgroundSubtractorGMG_getMaxFeatures(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void bgsegm_BackgroundSubtractorGMG_setMaxFeatures(IntPtr ptr, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double bgsegm_BackgroundSubtractorGMG_getDefaultLearningRate(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void bgsegm_BackgroundSubtractorGMG_setDefaultLearningRate(IntPtr ptr, double value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int bgsegm_BackgroundSubtractorGMG_getNumFrames(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void bgsegm_BackgroundSubtractorGMG_setNumFrames(IntPtr ptr, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int bgsegm_BackgroundSubtractorGMG_getQuantizationLevels(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void bgsegm_BackgroundSubtractorGMG_setQuantizationLevels(IntPtr ptr, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double bgsegm_BackgroundSubtractorGMG_getBackgroundPrior(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void bgsegm_BackgroundSubtractorGMG_setBackgroundPrior(IntPtr ptr, double value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int bgsegm_BackgroundSubtractorGMG_getSmoothingRadius(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void bgsegm_BackgroundSubtractorGMG_setSmoothingRadius(IntPtr ptr, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double bgsegm_BackgroundSubtractorGMG_getDecisionThreshold(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void bgsegm_BackgroundSubtractorGMG_setDecisionThreshold(IntPtr ptr, double value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int bgsegm_BackgroundSubtractorGMG_getUpdateBackgroundModel(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void bgsegm_BackgroundSubtractorGMG_setUpdateBackgroundModel(IntPtr ptr, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double bgsegm_BackgroundSubtractorGMG_getMinVal(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void bgsegm_BackgroundSubtractorGMG_setMinVal(IntPtr ptr, double value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double bgsegm_BackgroundSubtractorGMG_getMaxVal(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void bgsegm_BackgroundSubtractorGMG_setMaxVal(IntPtr ptr, double value); + + #endregion + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/NativeMethods_contrib.cs b/src/OpenCvSharp/PInvoke/NativeMethods_contrib.cs new file mode 100644 index 000000000..70cc056ff --- /dev/null +++ b/src/OpenCvSharp/PInvoke/NativeMethods_contrib.cs @@ -0,0 +1,70 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp.CPlusPlus +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int contrib_initModule_contrib(); + + #region CvAdaptiveSkinDetector + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr contrib_CvAdaptiveSkinDetector_new(int samplingDivider, int morphingMethod); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void contrib_CvAdaptiveSkinDetector_delete(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void contrib_CvAdaptiveSkinDetector_process(IntPtr self, IntPtr inputBgrImage, IntPtr outputHueMask); + #endregion + + #region FaceRecognizer + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void contrib_FaceRecognizer_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void contrib_FaceRecognizer_train( + IntPtr obj, IntPtr[] src, int srcLength, int[] labels, int labelsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void contrib_FaceRecognizer_update( + IntPtr obj, IntPtr[] src, int srcLength, int[] labels, int labelsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int contrib_FaceRecognizer_predict1(IntPtr obj, IntPtr src); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void contrib_FaceRecognizer_predict2( + IntPtr obj, IntPtr src, out int label, out double confidence); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void contrib_FaceRecognizer_save1(IntPtr obj, string filename); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void contrib_FaceRecognizer_load1(IntPtr obj, string filename); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void contrib_FaceRecognizer_save2(IntPtr obj, IntPtr fs); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void contrib_FaceRecognizer_load2(IntPtr obj, IntPtr fs); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr contrib_FaceRecognizer_info(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr contrib_createEigenFaceRecognizer( + int numComponents, double threshold); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr contrib_createFisherFaceRecognizer( + int numComponents, double threshold); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr contrib_createLBPHFaceRecognizer( + int radius, int neighbors, int gridX, int gridY, double threshold); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr contrib_Ptr_FaceRecognizer_obj(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void contrib_Ptr_FaceRecognizer_delete(IntPtr obj); + + #endregion + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void contrib_applyColorMap(IntPtr src, IntPtr dst, int colormap); + + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/NativeMethods_face.cs b/src/OpenCvSharp/PInvoke/NativeMethods_face.cs new file mode 100644 index 000000000..ca03ab08a --- /dev/null +++ b/src/OpenCvSharp/PInvoke/NativeMethods_face.cs @@ -0,0 +1,50 @@ + +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void face_FaceRecognizer_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void face_FaceRecognizer_train( + IntPtr obj, IntPtr[] src, int srcLength, int[] labels, int labelsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void face_FaceRecognizer_update( + IntPtr obj, IntPtr[] src, int srcLength, int[] labels, int labelsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int face_FaceRecognizer_predict1(IntPtr obj, IntPtr src); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void face_FaceRecognizer_predict2( + IntPtr obj, IntPtr src, out int label, out double confidence); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void face_FaceRecognizer_save1(IntPtr obj, string filename); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void face_FaceRecognizer_load1(IntPtr obj, string filename); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void face_FaceRecognizer_save2(IntPtr obj, IntPtr fs); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void face_FaceRecognizer_load2(IntPtr obj, IntPtr fs); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr face_FaceRecognizer_info(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr face_createEigenFaceRecognizer( + int numComponents, double threshold); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr face_createFisherFaceRecognizer( + int numComponents, double threshold); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr face_createLBPHFaceRecognizer( + int radius, int neighbors, int gridX, int gridY, double threshold); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr face_Ptr_FaceRecognizer_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void face_Ptr_FaceRecognizer_delete(IntPtr obj); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/NativeMethods_flann.cs b/src/OpenCvSharp/PInvoke/NativeMethods_flann.cs new file mode 100644 index 000000000..ab4d39d39 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/NativeMethods_flann.cs @@ -0,0 +1,142 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using OpenCvSharp.Flann; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + #region Index + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr flann_Index_new(IntPtr features, IntPtr @params, int distType); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void flann_Index_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void flann_Index_knnSearch1(IntPtr obj, [In] float[] queries, int queriesLength, [Out] int[] indices, [Out] float[] dists, int knn, IntPtr @params); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void flann_Index_knnSearch2(IntPtr obj, IntPtr queries, IntPtr indices, IntPtr dists, int knn, IntPtr @params); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void flann_Index_knnSearch3(IntPtr obj, IntPtr queries, [Out] int[] indices, [Out] float[] dists, int knn, IntPtr @params); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void flann_Index_radiusSearch1(IntPtr obj, [In] float[] queries, int queriesLength, [Out] int[] indices, int indicesLength, [Out] float[] dists, int dists_length, float radius, int maxResults, IntPtr @params); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void flann_Index_radiusSearch2(IntPtr obj, IntPtr queries, IntPtr indices, IntPtr dists, float radius, int maxResults, IntPtr @params); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void flann_Index_radiusSearch3(IntPtr obj, IntPtr queries, [Out] int[] indices, int indicesLength, [Out] float[] dists, int distsLength, float radius, int maxResults, IntPtr @params); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void flann_Index_save(IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string filename); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern int flann_Index_veclen(IntPtr obj); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern int flann_Index_size(IntPtr obj); + #endregion + #region IndexParams + #region IndexParams + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr flann_IndexParams_new(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void flann_IndexParams_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void flann_IndexParams_getString(IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string key, [MarshalAs(UnmanagedType.LPStr)] string defaultVal, [MarshalAs(UnmanagedType.LPStr)] StringBuilder result); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern int flann_IndexParams_getInt(IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string key, int defaultVal); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern double flann_IndexParams_getDouble(IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string key, double defaultVal); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void flann_IndexParams_setString(IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string key, [MarshalAs(UnmanagedType.LPStr)] string value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void flann_IndexParams_setInt(IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string key, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void flann_IndexParams_setDouble(IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string key, double value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void flann_IndexParams_setFloat(IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string key, float value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void flann_IndexParams_setBool(IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string key, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void flann_IndexParams_setAlgorithm(IntPtr obj, int value); + #endregion + #region LinearIndexParams + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr flann_LinearIndexParams_new(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void flann_LinearIndexParams_delete(IntPtr obj); + #endregion + #region KDTreeIndexParams + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr flann_KDTreeIndexParams_new(int trees); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void flann_KDTreeIndexParams_delete(IntPtr obj); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern unsafe int* flann_KDTreeIndexParams_trees(IntPtr obj); + #endregion + #region KMeansIndexParams + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr flann_KMeansIndexParams_new( + int branching, int iterations, [MarshalAs(UnmanagedType.I4)] FlannCentersInit centers_init, float cb_index); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void flann_KMeansIndexParams_delete(IntPtr obj); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern unsafe int* flann_KMeansIndexParams_branching(IntPtr obj); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern unsafe int* flann_KMeansIndexParams_iterations(IntPtr obj); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern unsafe FlannCentersInit* flann_KMeansIndexParams_centers_init(IntPtr obj); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern unsafe float* flann_KMeansIndexParams_cb_index(IntPtr obj); + #endregion + #region CompositeIndexParams + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr flann_CompositeIndexParams_new(int trees, int branching, int iterations, FlannCentersInit centers_init, float cb_index); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void flann_CompositeIndexParams_delete(IntPtr obj); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern unsafe int* flann_CompositeIndexParams_trees(IntPtr obj); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern unsafe int* flann_CompositeIndexParams_branching(IntPtr obj); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern unsafe int* flann_CompositeIndexParams_iterations(IntPtr obj); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern unsafe FlannCentersInit* flann_CompositeIndexParams_centers_init(IntPtr obj); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern unsafe float* flann_CompositeIndexParams_cb_index(IntPtr obj); + #endregion + #region AutotunedIndexParams + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr flann_AutotunedIndexParams_new(float targetPrecision, float build_weight, float memory_weight, float sample_fraction); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void flann_AutotunedIndexParams_delete(IntPtr obj); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern unsafe float* flann_AutotunedIndexParams_target_precision(IntPtr obj); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern unsafe float* flann_AutotunedIndexParams_build_weight(IntPtr obj); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern unsafe float* flann_AutotunedIndexParams_memory_weight(IntPtr obj); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern unsafe float* flann_AutotunedIndexParams_sample_fraction(IntPtr obj); + #endregion + #region SavedIndexParams + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern IntPtr flann_SavedIndexParams_new([MarshalAs(UnmanagedType.LPStr)] string filename); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void flann_SavedIndexParams_delete(IntPtr obj); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //[return: MarshalAs(UnmanagedType.LPStr)] + //public static extern string flann_SavedIndexParams_filename_get(IntPtr obj); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern void flann_SavedIndexParams_filename_set(IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string filename); + #endregion + #region SearchParams + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr flann_SearchParams_new(int checks, float eps, int sorted); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void flann_SearchParams_delete(IntPtr obj); + #endregion + + #endregion + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern int flann_hierarchicalClustering(IntPtr features, IntPtr centers, IntPtr @params); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/NativeMethods_highgui.cs b/src/OpenCvSharp/PInvoke/NativeMethods_highgui.cs new file mode 100644 index 000000000..3ea711445 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/NativeMethods_highgui.cs @@ -0,0 +1,50 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void highgui_namedWindow([MarshalAs(UnmanagedType.LPStr)] string winname, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void highgui_destroyWindow([MarshalAs(UnmanagedType.LPStr)] string winName); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void highgui_destroyAllWindows(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void highgui_imshow([MarshalAs(UnmanagedType.LPStr)] string winname, IntPtr mat); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int highgui_startWindowThread(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int highgui_waitKey(int delay); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void highgui_resizeWindow([MarshalAs(UnmanagedType.LPStr)] string winName, int width, int height); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void highgui_moveWindow([MarshalAs(UnmanagedType.LPStr)] string winName, int x, int y); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void highgui_setWindowProperty([MarshalAs(UnmanagedType.LPStr)] string winName, int propId, double propValue); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void highgui_setWindowTitle([MarshalAs(UnmanagedType.LPStr)] string winname, [MarshalAs(UnmanagedType.LPStr)] string title); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern double highgui_getWindowProperty([MarshalAs(UnmanagedType.LPStr)] string winName, int propId); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void highgui_setMouseCallback(string winName, [MarshalAs(UnmanagedType.FunctionPtr)] CvMouseCallback onMouse, IntPtr userData); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern int highgui_createTrackbar([MarshalAs(UnmanagedType.LPStr)] string trackbarName, [MarshalAs(UnmanagedType.LPStr)] string winName, + ref int value, int count, IntPtr onChange, IntPtr userData); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern int highgui_getTrackbarPos([MarshalAs(UnmanagedType.LPStr)] string trackbarName, [MarshalAs(UnmanagedType.LPStr)] string winName); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void highgui_setTrackbarPos(string trackbarName, string winName, int pos); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern int highgui_createButton(string barName, IntPtr onChange, IntPtr userdata, int type, int initialButtonState); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/NativeMethods_imgcodecs.cs b/src/OpenCvSharp/PInvoke/NativeMethods_imgcodecs.cs new file mode 100644 index 000000000..0032c67ed --- /dev/null +++ b/src/OpenCvSharp/PInvoke/NativeMethods_imgcodecs.cs @@ -0,0 +1,44 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern IntPtr imgcodecs_imread(string filename, int flags); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern int imgcodecs_imreadmulti([MarshalAs(UnmanagedType.LPStr)] string filename, IntPtr mats, int flags); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern int imgcodecs_imwrite([MarshalAs(UnmanagedType.LPStr)] string filename, IntPtr img, [In] int[] @params, int paramsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgcodecs_imdecode_Mat(IntPtr buf, int flags); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgcodecs_imdecode_vector(byte[] buf, IntPtr bufLength, int flags); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgcodecs_imdecode_InputArray(IntPtr buf, int flags); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern int imgcodecs_imencode_vector([MarshalAs(UnmanagedType.LPStr)] string ext, IntPtr img, IntPtr buf, [In] int[] @params, int paramsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void imgcodecs_cvConvertImage_CvArr(IntPtr src, IntPtr dst, int flags); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void imgcodecs_cvConvertImage_Mat(IntPtr src, IntPtr dst, int flags); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern int imgcodecs_cvHaveImageReader([MarshalAs(UnmanagedType.LPStr)] string fileName); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern int imgcodecs_cvHaveImageWriter([MarshalAs(UnmanagedType.LPStr)] string fileName); + + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/NativeMethods_objdetect.cs b/src/OpenCvSharp/PInvoke/NativeMethods_objdetect.cs new file mode 100644 index 000000000..15d4d2817 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/NativeMethods_objdetect.cs @@ -0,0 +1,205 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 +// ReSharper disable InconsistentNaming + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + #region LatendSvmDetector + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr objdetect_LatentSvmDetector_new(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_LatentSvmDetector_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_LatentSvmDetector_clear(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int objdetect_LatentSvmDetector_empty(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int objdetect_LatentSvmDetector_load(IntPtr obj, + IntPtr[] fileNames, int fileNamesLength, + IntPtr[] classNames, int classNamesLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_LatentSvmDetector_detect( + IntPtr obj, IntPtr image, IntPtr objectDetections, + float overlapThreshold, int numThreads); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_LatentSvmDetector_getClassNames(IntPtr obj, IntPtr outValues); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr objdetect_LatentSvmDetector_getClassCount(IntPtr obj); + + #endregion + + #region CascadeClassfier + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr objdetect_CascadeClassifier_new(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern IntPtr objdetect_CascadeClassifier_newFromFile([MarshalAs(UnmanagedType.LPStr)] string fileName); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_CascadeClassifier_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int objdetect_CascadeClassifier_empty(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern int objdetect_CascadeClassifier_load(IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string fileName); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_CascadeClassifier_detectMultiScale1( + IntPtr obj, IntPtr image, IntPtr objects, + double scaleFactor, int minNeighbors, int flags, Size minSize, Size maxSize); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_CascadeClassifier_detectMultiScale2( + IntPtr obj, IntPtr image, IntPtr objects, + IntPtr rejectLevels, IntPtr levelWeights, + double scaleFactor, int minNeighbors, int flags, + Size minSize, Size maxSize, int outputRejectLevels); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int objdetect_CascadeClassifier_isOldFormatCascade(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Size objdetect_CascadeClassifier_getOriginalWindowSize(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int objdetect_CascadeClassifier_getFeatureType(IntPtr obj); + + #endregion + + #region HOGDescriptor + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int objdetect_HOGDescriptor_sizeof(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr objdetect_HOGDescriptor_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr objdetect_HOGDescriptor_new2(Size winSize, Size blockSize, Size blockStride, Size cellSize, + int nbins, int derivAperture, double winSigma, [MarshalAs(UnmanagedType.I4)] HistogramNormType histogramNormType, + double l2HysThreshold, int gammaCorrection, int nlevels); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern IntPtr objdetect_HOGDescriptor_new3([MarshalAs(UnmanagedType.LPStr)] string fileName); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_HOGDescriptor_delete(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr objdetect_HOGDescriptor_getDescriptorSize(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int objdetect_HOGDescriptor_checkDetectorSize(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double objdetect_HOGDescriptor_getWinSigma(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_HOGDescriptor_setSVMDetector(IntPtr self, IntPtr svmdetector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool objdetect_HOGDescriptor_load(IntPtr self, [MarshalAs(UnmanagedType.LPStr)] string filename, [MarshalAs(UnmanagedType.LPStr)] string objname); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void objdetect_HOGDescriptor_save(IntPtr self, [MarshalAs(UnmanagedType.LPStr)] string filename, [MarshalAs(UnmanagedType.LPStr)] string objname); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_HOGDescriptor_compute( + IntPtr self, IntPtr img, IntPtr descriptors, + Size winStride, Size padding, [In] Point[] locations, int locationsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, + EntryPoint = "objdetect_HOGDescriptor_detect1")] + public static extern void objdetect_HOGDescriptor_detect( + IntPtr self, IntPtr img, IntPtr foundLocations, + double hitThreshold, Size winStride, Size padding, [In] Point[] searchLocations, int searchLocationsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, + EntryPoint = "objdetect_HOGDescriptor_detect2")] + public static extern void objdetect_HOGDescriptor_detect( + IntPtr self, IntPtr img, IntPtr foundLocations, IntPtr weights, + double hitThreshold, Size winStride, Size padding, [In] Point[] searchLocations, int searchLocationsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "objdetect_HOGDescriptor_detectMultiScale1")] + public static extern void objdetect_HOGDescriptor_detectMultiScale( + IntPtr self, IntPtr img, IntPtr foundLocations, + double hitThreshold, Size winStride, Size padding, double scale, int groupThreshold); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, + EntryPoint = "objdetect_HOGDescriptor_detectMultiScale2")] + public static extern void objdetect_HOGDescriptor_detectMultiScale( + IntPtr self, IntPtr img, IntPtr foundLocations, IntPtr foundWeights, + double hitThreshold, Size winStride, Size padding, double scale, int groupThreshold); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_HOGDescriptor_computeGradient( + IntPtr self, IntPtr img, IntPtr grad, IntPtr angleOfs, Size paddingTL, Size paddingBR); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_HOGDescriptor_detectROI( + IntPtr obj, IntPtr img, + Point[] locations, int locationsLength, + IntPtr foundLocations, IntPtr confidences, + double hitThreshold, Size winStride, Size padding); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_HOGDescriptor_detectMultiScaleROI( + IntPtr obj, IntPtr img, IntPtr foundLocations, + IntPtr roiScales, IntPtr roiLocations, IntPtr roiConfidences, + double hitThreshold, int groupThreshold); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void objdetect_HOGDescriptor_readALTModel(IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string modelfile); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_HOGDescriptor_groupRectangles(IntPtr obj, + IntPtr rectList, IntPtr weights, int groupThreshold, double eps); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Size objdetect_HOGDescriptor_winSize_get(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Size objdetect_HOGDescriptor_blockSize_get(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Size objdetect_HOGDescriptor_blockStride_get(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Size objdetect_HOGDescriptor_cellSize_get(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int objdetect_HOGDescriptor_nbins_get(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int objdetect_HOGDescriptor_derivAperture_get(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double objdetect_HOGDescriptor_winSigma_get(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int objdetect_HOGDescriptor_histogramNormType_get(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double objdetect_HOGDescriptor_L2HysThreshold_get(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int objdetect_HOGDescriptor_gammaCorrection_get(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int objdetect_HOGDescriptor_nlevels_get(IntPtr self); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_HOGDescriptor_winSize_set(IntPtr self, Size value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_HOGDescriptor_blockSize_set(IntPtr self, Size value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_HOGDescriptor_blockStride_set(IntPtr self, Size value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_HOGDescriptor_cellSize_set(IntPtr self, Size value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_HOGDescriptor_nbins_set(IntPtr self, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_HOGDescriptor_derivAperture_set(IntPtr self, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_HOGDescriptor_winSigma_set(IntPtr self, double value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_HOGDescriptor_histogramNormType_set(IntPtr self, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_HOGDescriptor_L2HysThreshold_set(IntPtr self, double value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_HOGDescriptor_gammaCorrection_set(IntPtr self, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_HOGDescriptor_nlevels_set(IntPtr self, int value); + #endregion + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_groupRectangles1(IntPtr rectList, int groupThreshold, double eps); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_groupRectangles2(IntPtr rectList, IntPtr weights, int groupThreshold, double eps); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_groupRectangles3( + IntPtr rectList, int groupThreshold, double eps, IntPtr weights, IntPtr levelWeights); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_groupRectangles4( + IntPtr rectList, IntPtr rejectLevels, IntPtr levelWeights, int groupThreshold, double eps); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void objdetect_groupRectangles_meanshift( + IntPtr rectList, IntPtr foundWeights, IntPtr foundScales, double detectThreshold, Size winDetSize); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/NativeMethods_optflow.cs b/src/OpenCvSharp/PInvoke/NativeMethods_optflow.cs new file mode 100644 index 000000000..fbbd33cca --- /dev/null +++ b/src/OpenCvSharp/PInvoke/NativeMethods_optflow.cs @@ -0,0 +1,58 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void optflow_motempl_updateMotionHistory( + IntPtr silhouette, IntPtr mhi, + double timestamp, double duration); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void optflow_motempl_calcMotionGradient( + IntPtr mhi, IntPtr mask, IntPtr orientation, + double delta1, double delta2, int apertureSize); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double optflow_motempl_calcGlobalOrientation( + IntPtr orientation, IntPtr mask, + IntPtr mhi, double timestamp, double duration); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void optflow_motempl_segmentMotion( + IntPtr mhi, IntPtr segmask, IntPtr boundingRects, + double timestamp, double segThresh); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void optflow_calcOpticalFlowSF1( + IntPtr from, + IntPtr to, + IntPtr flow, + int layers, + int averagingBlockSize, + int maxFlow); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void optflow_calcOpticalFlowSF2( + IntPtr from, + IntPtr to, + IntPtr flow, + int layers, + int averagingBlockSize, + int maxFlow, + double sigmaDist, + double sigmaColor, + int postprocessWindow, + double sigmaDistFix, + double sigmaColorFix, + double occThr, + int upscaleAveragingRadius, + double upscaleSigmaDist, + double upscaleSigmaColor, + double speedUpThr); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/NativeMethods_stdvector.cs b/src/OpenCvSharp/PInvoke/NativeMethods_stdvector.cs new file mode 100644 index 000000000..4a1d122f2 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/NativeMethods_stdvector.cs @@ -0,0 +1,407 @@ +using System; +using System.Runtime.InteropServices; +using OpenCvSharp.ML; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + #region uchar + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_uchar_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_uchar_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_uchar_new3([In] byte[] data, IntPtr dataLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_uchar_getSize(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_uchar_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_vector_uchar_copy(IntPtr vector, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_uchar_delete(IntPtr vector); + #endregion + #region int + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_int32_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_int32_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_int32_new3([In] int[] data, IntPtr dataLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_int32_getSize(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_int32_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_int32_delete(IntPtr vector); + #endregion + #region float + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_float_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_float_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_float_new3([In] float[] data, IntPtr dataLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_float_getSize(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_float_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_float_delete(IntPtr vector); + #endregion + #region double + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_double_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_double_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_double_new3([In] double[] data, IntPtr dataLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_double_getSize(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_double_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_double_delete(IntPtr vector); + #endregion + #region cv::Vec2f + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec2f_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec2f_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec2f_new3([In] Vec2f[] data, IntPtr dataLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec2f_getSize(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec2f_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_Vec2f_delete(IntPtr vector); + #endregion + #region cv::Vec3f + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec3f_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec3f_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec3f_new3([In] Vec3f[] data, IntPtr dataLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec3f_getSize(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec3f_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_Vec3f_delete(IntPtr vector); + #endregion + #region cv::Vec4f + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec4f_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec4f_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec4f_new3([In] Vec4f[] data, IntPtr dataLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec4f_getSize(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec4f_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_Vec4f_delete(IntPtr vector); + #endregion + #region cv::Vec4i + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec4i_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec4i_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec4i_new3([In] Vec4i[] data, IntPtr dataLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec4i_getSize(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec4i_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_Vec4i_delete(IntPtr vector); + #endregion + #region cv::Vec6f + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec6f_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec6f_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec6f_new3([In] Vec6f[] data, IntPtr dataLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec6f_getSize(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec6f_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_Vec6f_delete(IntPtr vector); + #endregion + #region cv::Vec6d + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec6d_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec6d_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec6d_new3([In] Vec6d[] data, IntPtr dataLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec6d_getSize(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Vec6d_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_Vec6d_delete(IntPtr vector); + #endregion + #region cv::Point2i + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Point2i_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Point2i_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Point2i_new3([In] Point[] data, IntPtr dataLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Point2i_getSize(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Point2i_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_Point2i_delete(IntPtr vector); + #endregion + #region cv::Point2f + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Point2f_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Point2f_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Point2f_new3([In] Point2f[] data, IntPtr dataLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Point2f_getSize(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Point2f_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_Point2f_delete(IntPtr vector); + #endregion + #region cv::Point3f + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Point3f_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Point3f_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Point3f_new3([In] Point3f[] data, IntPtr dataLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Point3f_getSize(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Point3f_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_Point3f_delete(IntPtr vector); + #endregion + #region cv::Rect + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Rect_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Rect_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Rect_new3([In] Rect[] data, IntPtr dataLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Rect_getSize(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Rect_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_Rect_delete(IntPtr vector); + #endregion + #region cv::KeyPoint + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_KeyPoint_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_KeyPoint_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_KeyPoint_new3([In]KeyPoint[] data, IntPtr dataLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_KeyPoint_getSize(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_KeyPoint_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_KeyPoint_delete(IntPtr vector); + #endregion + #region cv::KeyPoint + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_DMatch_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_DMatch_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_DMatch_new3([In] DMatch[] data, IntPtr dataLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_DMatch_getSize(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_DMatch_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_DMatch_delete(IntPtr vector); + #endregion + #region vector + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_float_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_float_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_float_getSize1(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_vector_float_getSize2(IntPtr vector, [In, Out] IntPtr[] size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_float_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_vector_float_copy(IntPtr vec, IntPtr[] dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_vector_float_delete(IntPtr vector); + #endregion + #region vector + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_double_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_double_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_double_getSize1(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_vector_double_getSize2(IntPtr vector, [In, Out] IntPtr[] size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_double_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_vector_double_copy(IntPtr vec, IntPtr[] dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_vector_double_delete(IntPtr vector); + #endregion + #region vector + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_KeyPoint_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_KeyPoint_new2(IntPtr size); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_KeyPoint_new3( + IntPtr[] values, int size1, int[] size2); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_KeyPoint_getSize1(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_vector_KeyPoint_getSize2(IntPtr vector, [In, Out] IntPtr[] size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_KeyPoint_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_vector_KeyPoint_copy(IntPtr vec, IntPtr[] dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_vector_KeyPoint_delete(IntPtr vector); + #endregion + #region vector + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_DMatch_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_DMatch_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_DMatch_getSize1(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_vector_DMatch_getSize2(IntPtr vector, [In, Out] IntPtr[] size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_DMatch_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_vector_DMatch_copy(IntPtr vec, IntPtr[] dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_vector_DMatch_delete(IntPtr vector); + #endregion + #region vector + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_Point_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_Point_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_Point_getSize1(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_vector_Point_getSize2(IntPtr vector, [In, Out] IntPtr[] size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_Point_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_vector_Point_copy(IntPtr vec, IntPtr[] dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_vector_Point_delete(IntPtr vector); + #endregion + #region vector + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_Point2f_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_Point2f_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_Point2f_getSize1(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_vector_Point2f_getSize2(IntPtr vector, [In, Out] IntPtr[] size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_vector_Point2f_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_vector_Point2f_copy(IntPtr vec, IntPtr[] dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_vector_Point2f_delete(IntPtr vector); + #endregion + #region vector + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_string_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_string_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_string_getSize(IntPtr vec); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_string_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe sbyte* vector_string_elemAt(IntPtr vector, int i); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_string_delete(IntPtr vector); + #endregion + #region cv::Mat + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Mat_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Mat_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Mat_new3(IntPtr data, IntPtr dataLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Mat_getSize(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_Mat_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_Mat_delete(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_Mat_assignToArray(IntPtr vector, [MarshalAs(UnmanagedType.LPArray)] IntPtr[] arr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_Mat_addref(IntPtr vector); + + #endregion + + #region cv::ml::DTrees::Node + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_DTrees_Node_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_DTrees_Node_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_DTrees_Node_new3([In]DTrees.Node[] data, IntPtr dataLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_DTrees_Node_getSize(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_DTrees_Node_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_DTrees_Node_delete(IntPtr vector); + + #endregion + + #region cv::ml::DTrees::Split + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_DTrees_Split_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_DTrees_Split_new2(IntPtr size); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_DTrees_Split_new3([In]DTrees.Split[] data, IntPtr dataLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_DTrees_Split_getSize(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr vector_DTrees_Split_getPointer(IntPtr vector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void vector_DTrees_Split_delete(IntPtr vector); + + #endregion + + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/NativeMethods_stitching.cs b/src/OpenCvSharp/PInvoke/NativeMethods_stitching.cs new file mode 100644 index 000000000..5917b84ae --- /dev/null +++ b/src/OpenCvSharp/PInvoke/NativeMethods_stitching.cs @@ -0,0 +1,91 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr stitching_createStitcher(int try_use_cpu); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void stitching_Ptr_Stitcher_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr stitching_Ptr_Stitcher_get(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double stitching_Stitcher_registrationResol(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void stitching_Stitcher_setRegistrationResol(IntPtr obj, double resolMpx); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double stitching_Stitcher_seamEstimationResol(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void stitching_Stitcher_setSeamEstimationResol(IntPtr obj, double resolMpx); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double stitching_Stitcher_compositingResol(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void stitching_Stitcher_setCompositingResol(IntPtr obj, double resolMpx); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double stitching_Stitcher_panoConfidenceThresh(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void stitching_Stitcher_setPanoConfidenceThresh(IntPtr obj, double confThresh); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int stitching_Stitcher_waveCorrection(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void stitching_Stitcher_setWaveCorrection(IntPtr obj, int flag); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int stitching_Stitcher_waveCorrectKind(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void stitching_Stitcher_setWaveCorrectKind(IntPtr obj, int kind); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int stitching_Stitcher_estimateTransform_InputArray1( + IntPtr obj, IntPtr images); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int stitching_Stitcher_estimateTransform_InputArray2( + IntPtr obj, IntPtr images, + IntPtr[] rois, int roisSize1, int[] roisSize2); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int stitching_Stitcher_estimateTransform_MatArray1( + IntPtr obj, IntPtr[] images, int imagesSize); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int stitching_Stitcher_estimateTransform_MatArray2( + IntPtr obj, IntPtr[] images, int imagesSize, + IntPtr[] rois, int roisSize1, int[] roisSize2); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int stitching_Stitcher_composePanorama1( + IntPtr obj, IntPtr pano); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int stitching_Stitcher_composePanorama2_InputArray( + IntPtr obj, IntPtr images, IntPtr pano); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int stitching_Stitcher_composePanorama2_MatArray( + IntPtr obj, IntPtr[] images, int imagesSize, IntPtr pano); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int stitching_Stitcher_stitch1_InputArray( + IntPtr obj, IntPtr images, IntPtr pano); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int stitching_Stitcher_stitch1_MatArray( + IntPtr obj, IntPtr[] images, int imagesSize, IntPtr pano); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int stitching_Stitcher_stitch2_InputArray( + IntPtr obj, IntPtr images, + IntPtr[] rois, int roisSize1, int[] roisSize2, + IntPtr pano); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int stitching_Stitcher_stitch2_MatArray( + IntPtr obj, IntPtr[] images, int imagesSize, + IntPtr[] rois, int roisSize1, int[] roisSize2, + IntPtr pano); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void stitching_Stitcher_component(IntPtr obj, out IntPtr pointer, out int length); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double stitching_Stitcher_workScale(IntPtr obj); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/NativeMethods_superres.cs b/src/OpenCvSharp/PInvoke/NativeMethods_superres.cs new file mode 100644 index 000000000..710b930bb --- /dev/null +++ b/src/OpenCvSharp/PInvoke/NativeMethods_superres.cs @@ -0,0 +1,93 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + // TODO + + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void superres_FrameSource_nextFrame(IntPtr obj, IntPtr frame); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void superres_FrameSource_reset(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr superres_createFrameSource_Empty(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern IntPtr superres_createFrameSource_Video( + [MarshalAs(UnmanagedType.LPStr)] string fileName); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern IntPtr superres_createFrameSource_Video_CUDA( + [MarshalAs(UnmanagedType.LPStr)] string fileName); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr superres_createFrameSource_Camera(int deviceId); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr superres_Ptr_FrameSource_get(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void superres_Ptr_FrameSource_delete(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void superres_SuperResolution_setInput(IntPtr obj, IntPtr frameSource); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void superres_SuperResolution_nextFrame(IntPtr obj, IntPtr frame); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void superres_SuperResolution_reset(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void superres_SuperResolution_collectGarbage(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr superres_SuperResolution_info(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr superres_createSuperResolution_BTVL1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr superres_createSuperResolution_BTVL1_CUDA(); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern IntPtr superres_createSuperResolution_BTVL1_OCL(); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr superres_Ptr_SuperResolution_get(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void superres_Ptr_SuperResolution_delete(IntPtr ptr); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void superres_DenseOpticalFlowExt_calc( + IntPtr obj, IntPtr frame0, IntPtr frame1, IntPtr flow1, IntPtr flow2); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void superres_DenseOpticalFlowExt_collectGarbage(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr superres_DenseOpticalFlowExt_info(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr superres_Ptr_DenseOpticalFlowExt_get(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void superres_Ptr_DenseOpticalFlowExt_delete(IntPtr ptr); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr superres_createOptFlow_Farneback(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr superres_createOptFlow_Farneback_CUDA(); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern IntPtr superres_createOptFlow_Farneback_OCL(); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern IntPtr superres_createOptFlow_Simple(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr superres_createOptFlow_DualTVL1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr superres_createOptFlow_DualTVL1_CUDA(); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern IntPtr superres_createOptFlow_DualTVL1_OCL(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr superres_createOptFlow_Brox_CUDA(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr superres_createOptFlow_PyrLK_CUDA(); + //[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + //public static extern IntPtr superres_createOptFlow_PyrLK_OCL(); + + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/NativeMethods_videoio.cs b/src/OpenCvSharp/PInvoke/NativeMethods_videoio.cs new file mode 100644 index 000000000..fabb55b91 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/NativeMethods_videoio.cs @@ -0,0 +1,97 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + // VideoCapture + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr videoio_VideoCapture_new1(); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr videoio_VideoCapture_new2([MarshalAs(UnmanagedType.LPStr)] string filename); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr videoio_VideoCapture_new3(int device); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void videoio_VideoCapture_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int videoio_VideoCapture_open1(IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string filename); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int videoio_VideoCapture_open2(IntPtr obj, int device); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int videoio_VideoCapture_isOpened(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void videoio_VideoCapture_release(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int videoio_VideoCapture_grab(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int videoio_VideoCapture_retrieve(IntPtr obj, IntPtr image, int flag); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void videoio_VideoCapture_operatorRightShift_Mat(IntPtr obj, IntPtr image); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void videoio_VideoCapture_operatorRightShift_UMat(IntPtr obj, IntPtr image); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int videoio_VideoCapture_read(IntPtr obj, IntPtr image); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int videoio_VideoCapture_set(IntPtr obj, int propId, double value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double videoio_VideoCapture_get(IntPtr obj, int propId); + + + // VideoWriter + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr videoio_VideoWriter_new1(); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr videoio_VideoWriter_new2( + [MarshalAs(UnmanagedType.LPStr)] string filename, int fourcc, double fps, + Size frameSize, int isColor); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void videoio_VideoWriter_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int videoio_VideoWriter_open( + IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string filename, + int fourcc, double fps, Size frameSize, int isColor); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int videoio_VideoWriter_isOpened(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void videoio_VideoWriter_release(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void videoio_VideoWriter_OperatorLeftShift(IntPtr obj, IntPtr image); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void videoio_VideoWriter_write(IntPtr obj, IntPtr image); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int videoio_VideoWriter_set(IntPtr obj, int propId, double value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double videoio_VideoWriter_get(IntPtr obj, int propId); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int videoio_VideoWriter_fourcc(byte c1, byte c2, byte c3, byte c4); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/NativeMethods_xfeatures2d.cs b/src/OpenCvSharp/PInvoke/NativeMethods_xfeatures2d.cs new file mode 100644 index 000000000..00ec94d92 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/NativeMethods_xfeatures2d.cs @@ -0,0 +1,119 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + // ReSharper disable InconsistentNaming + + // BriefDescriptorExtractor + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr xfeatures2d_BriefDescriptorExtractor_create(int bytes); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void xfeatures2d_Ptr_BriefDescriptorExtractor_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void xfeatures2d_BriefDescriptorExtractor_read(IntPtr obj, IntPtr fn); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void xfeatures2d_BriefDescriptorExtractor_write(IntPtr obj, IntPtr fs); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int xfeatures2d_BriefDescriptorExtractor_descriptorSize(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int xfeatures2d_BriefDescriptorExtractor_descriptorType(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr xfeatures2d_BriefDescriptorExtractor_info(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr xfeatures2d_Ptr_BriefDescriptorExtractor_get(IntPtr ptr); + + // FREAK + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr xfeatures2d_FREAK_create(int orientationNormalized, + int scaleNormalized, float patternScale, int nOctaves, + int[] selectedPairs, int selectedPairsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void xfeatures2d_Ptr_FREAK_delete(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr xfeatures2d_FREAK_info(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr xfeatures2d_Ptr_FREAK_get(IntPtr ptr); + + // StarDetector + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr xfeatures2d_StarDetector_create( + int maxSize, int responseThreshold, + int lineThresholdProjected, int lineThresholdBinarized, int suppressNonmaxSize); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void xfeatures2d_Ptr_StarDetector_delete(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr xfeatures2d_StarDetector_info(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr xfeatures2d_Ptr_StarDetector_get(IntPtr ptr); + + // DenseFeatureDetector + /* + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr xfeatures2d_DenseFeatureDetector_new( + float initFeatureScale, int featureScaleLevels, float featureScaleMul, + int initXyStep, int initImgBound, int varyXyStepWithScale, int varyImgBoundWithScale); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void xfeatures2d_DenseFeatureDetector_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr xfeatures2d_DenseFeatureDetector_info(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr xfeatures2d_Ptr_DenseFeatureDetector_get(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void xfeatures2d_Ptr_DenseFeatureDetector_delete(IntPtr ptr); + */ + + // SURF + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr xfeatures2d_SURF_create( + double hessianThreshold, int nOctaves, + int nOctaveLayers, int extended, int upright); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void xfeatures2d_Ptr_SURF_delete(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr xfeatures2d_Ptr_SURF_get(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr xfeatures2d_SURF_info(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double xfeatures2d_SURF_getHessianThreshold(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int xfeatures2d_SURF_getNOctaves(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int xfeatures2d_SURF_getNOctaveLayers(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int xfeatures2d_SURF_getExtended(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int xfeatures2d_SURF_getUpright(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void xfeatures2d_SURF_setHessianThreshold(IntPtr obj, double value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void xfeatures2d_SURF_setNOctaves(IntPtr obj, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void xfeatures2d_SURF_setNOctaveLayers(IntPtr obj, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void xfeatures2d_SURF_setExtended(IntPtr obj, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void xfeatures2d_SURF_setUpright(IntPtr obj, int value); + + // SIFT + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr xfeatures2d_SIFT_create(int nfeatures, int nOctaveLayers, + double contrastThreshold, double edgeThreshold, double sigma); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void xfeatures2d_Ptr_SIFT_delete(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr xfeatures2d_Ptr_SIFT_get(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr xfeatures2d_SIFT_info(IntPtr obj); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/Win32API.cs b/src/OpenCvSharp/PInvoke/Win32API.cs new file mode 100644 index 000000000..dca751981 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/Win32API.cs @@ -0,0 +1,229 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + /// + /// Win32API Wrapper + /// + public static class Win32Api + { + #region Constants + public const int DIB_RGB_COLORS = 0; /* color table in RGBs */ + public const int DIB_PAL_COLORS = 1; /* color table in palette indices */ + + public const int BI_RGB = 0; + public const int BI_RLE8 = 1; + public const int BI_RLE4 = 2; + public const int BI_BITFIELDS = 3; + public const int BI_JPEG = 4; + public const int BI_PNG = 5; + + public const int BLACKONWHITE = 1; + public const int WHITEONBLACK = 2; + public const int COLORONCOLOR = 3; + public const int HALFTONE = 4; + public const int MAXSTRETCHBLTMODE = 4; + + /* Ternary raster operations */ + public const uint SRCCOPY = (uint)0x00CC0020; /* dest = source */ + public const uint SRCPAINT = (uint)0x00EE0086; /* dest = source OR dest */ + public const uint SRCAND = (uint)0x008800C6; /* dest = source AND dest */ + public const uint SRCINVERT = (uint)0x00660046; /* dest = source XOR dest */ + public const uint SRCERASE = (uint)0x00440328; /* dest = source AND (NOT dest ) */ + public const uint NOTSRCCOPY = (uint)0x00330008; /* dest = (NOT source) */ + public const uint NOTSRCERASE = (uint)0x001100A6; /* dest = (NOT src) AND (NOT dest) */ + public const uint MERGECOPY = (uint)0x00C000CA; /* dest = (source AND pattern) */ + public const uint MERGEPAINT = (uint)0x00BB0226; /* dest = (NOT source) OR dest */ + public const uint PATCOPY = (uint)0x00F00021; /* dest = pattern */ + public const uint PATPAINT = (uint)0x00FB0A09; /* dest = DPSnoo */ + public const uint PATINVERT = (uint)0x005A0049; /* dest = pattern XOR dest */ + public const uint DSTINVERT = (uint)0x00550009; /* dest = (NOT dest) */ + public const uint BLACKNESS = (uint)0x00000042; /* dest = BLACK */ + public const uint WHITENESS = (uint)0x00FF0062; /* dest = WHITE */ + public const uint NOMIRRORBITMAP = (uint)0x80000000; /* Do not Mirror the bitmap in this call */ + public const uint CAPTUREBLT = (uint)0x40000000; /* Include layered windows */ + #endregion + + #region Structures + public enum ColorTableType : int + { + Rgb = 0, + Palette = 1, + } + [StructLayout(LayoutKind.Sequential)] + public struct ICONINFO + { + public bool IsIcon; + public int HotSpotX; + public int HotSoptY; + public IntPtr MaskHbitmap; + public IntPtr ColorHbitmap; + } + [StructLayout(LayoutKind.Sequential)] + public struct BITMAPINFOHEADER + { + public UInt32 Size; + public Int32 Width; + public Int32 Height; + public UInt16 Planes; + public UInt16 BitCount; + public UInt32 Compression; + public UInt32 SizeImage; + public Int32 XPelsPerMeter; + public Int32 YPelsPerMeter; + public UInt32 ClrUsed; + public UInt32 ClrImportant; + }; + + [StructLayout(LayoutKind.Sequential)] + public struct RGBQUAD + { + public Byte Blue; + public Byte Green; + public Byte Red; + public Byte Reserved; + }; + + [StructLayout(LayoutKind.Sequential)] + public struct BITMAPINFO + { + public BITMAPINFOHEADER Header; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] + public RGBQUAD[] Colors; + }; + #endregion + + #region DllImport + #region kernel32 + [DllImport("kernel32")] + public static extern IntPtr LoadLibrary(string lpFileName); + [DllImport("kernel32")] + public static extern IntPtr GetProcAddress(IntPtr hModule, string lpProcName); + [DllImport("kernel32")] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool FreeLibrary(IntPtr hLibModule); + #endregion + #region gdi32 +#if LANG_JP + /// + /// + /// + /// デバイスコンテキストのハンドル + /// 転送先長方形の左上隅の x 座標 + /// 転送先長方形の左上隅の y 座標 + /// 転送元長方形の幅 + /// 転送元長方形の高さ + /// 転送元長方形の左下隅の x 座標 + /// 転送元長方形の左下隅の y 座標 + /// 配列内の最初の走査行 + /// 走査行の数 + /// DIB ビットからなる配列 + /// ビットマップ情報 + /// RGB 値またはパレットインデックス + /// +#else + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// +#endif + [DllImport("gdi32")] + public static extern int SetDIBitsToDevice(IntPtr hdc, Int32 XDest, Int32 YDest, UInt32 dwWidth, UInt32 dwHeight, Int32 XSrc, Int32 YSrc, UInt32 uStartScan, UInt32 cScanLines, IntPtr lpvBits, ref BITMAPINFO lpbmi, UInt32 fuColorUse); + [DllImport("gdi32")] + public static extern int SetDIBitsToDevice(IntPtr hdc, Int32 XDest, Int32 YDest, UInt32 dwWidth, UInt32 dwHeight, Int32 XSrc, Int32 YSrc, UInt32 uStartScan, UInt32 cScanLines, IntPtr lpvBits, IntPtr lpbmi, UInt32 fuColorUse); + [DllImport("gdi32", SetLastError = true)] + public static extern int GetDIBColorTable(IntPtr dc, int index, int entries, [In, Out] RGBQUAD[] colors); + [DllImport("gdi32", SetLastError = true)] + public static extern int GetDIBits(IntPtr dc, IntPtr bmp, int startScan, int scanLineCount, [In, Out] byte[] data, IntPtr info, ColorTableType usage); + [DllImport("gdi32", SetLastError = true)] + public static extern IntPtr CreateCompatibleDC(IntPtr hdc); + [DllImport("user32", SetLastError = true)] + public static extern bool GetIconInfo(IntPtr icon, out ICONINFO info); + [DllImport("user32", SetLastError = true)] + public static extern IntPtr GetDC(IntPtr window); + [DllImport("user32", SetLastError = true)] + public static extern bool ReleaseDC(IntPtr window, IntPtr dc); + [DllImport("gdi32", SetLastError = true)] + public static extern IntPtr SelectObject(IntPtr hdc, IntPtr obj); + [DllImport("gdi32", SetLastError = true)] + public static extern bool DeleteObject(IntPtr handle); + [DllImport("gdi32", SetLastError = true)] + public static extern bool DeleteDC(IntPtr hdc); +#if LANG_JP + /// + /// 指定されたデバイスコンテキストのビットマップ伸縮モードを設定します + /// + /// デバイスコンテキストのハンドル + /// ビットマップの伸縮モード + /// +#else + /// + /// + /// + /// + /// + /// +#endif + [DllImport("gdi32", SetLastError = true)] + public static extern int SetStretchBltMode(IntPtr hdc, int iStretchMode); +#if LANG_JP + /// + /// 指定されたデバイス独立ビットマップ(DIB)内の長方形ピクセルの色データを、指定された長方形へコピーします。 + /// コピー先長方形がコピー元長方形より大きい場合、この関数はコピー先長方形に合わせて、色データの行と列を拡大します。 + /// コピー先長方形がコピー元長方形より小さい場合、この関数は指定されたラスタオペレーションを使って、行と列を縮小します。 + /// + /// デバイスコンテキストのハンドル + /// コピー先長方形の左上隅の x 座標 + /// コピー先長方形の左上隅の y 座標 + /// コピー先長方形の幅 + /// コピー先長方形の高さ + /// コピー元長方形の左上隅の x 座標 + /// コピー元長方形の左上隅の x 座標 + /// コピー元長方形の幅 + /// コピー元長方形の高さ + /// ビットマップのビット + /// ビットマップのデータ + /// データの種類 + /// ラスタオペレーションコード + /// +#else + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// +#endif + [DllImport("gdi32", SetLastError = true)] + public static extern int StretchDIBits(IntPtr hdc, Int32 XDest, Int32 YDest, Int32 nDestWidth, Int32 nDestHeight, Int32 XSrc, Int32 YSrc, Int32 nSrcWidth, Int32 nSrcHeight, IntPtr lpBits, ref BITMAPINFO lpBitsInfo, UInt32 iUsage, UInt32 dwRop); + #endregion + #endregion + } + +} diff --git a/src/OpenCvSharp/PInvoke/calib3d/NativeMethods_calib3d.cs b/src/OpenCvSharp/PInvoke/calib3d/NativeMethods_calib3d.cs new file mode 100644 index 000000000..e64ab5fd8 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/calib3d/NativeMethods_calib3d.cs @@ -0,0 +1,332 @@ + +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_Rodrigues(IntPtr src, IntPtr dst, IntPtr jacobian); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_Rodrigues_VecToMat(IntPtr vector, IntPtr matrix, IntPtr jacobian); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_Rodrigues_MatToVec(IntPtr vector, IntPtr matrix, IntPtr jacobian); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr calib3d_findHomography_InputArray(IntPtr srcPoints, IntPtr dstPoints, + int method, double ransacReprojThreshold, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr calib3d_findHomography_vector(Point2d[] srcPoints, int srcPointsLength, + Point2d[] dstPoints, int dstPointsLength, int method, double ransacReprojThreshold, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_RQDecomp3x3_InputArray(IntPtr src, IntPtr mtxR, + IntPtr mtxQ, IntPtr qx, IntPtr qy, IntPtr qz, out Vec3d outVal); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_RQDecomp3x3_Mat(IntPtr src, IntPtr mtxR, IntPtr mtxQ, + IntPtr qx, IntPtr qy, IntPtr qz, out Vec3d outVal); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_decomposeProjectionMatrix_InputArray(IntPtr projMatrix, + IntPtr cameraMatrix, IntPtr rotMatrix, IntPtr transVect, IntPtr rotMatrixX, + IntPtr rotMatrixY, IntPtr rotMatrixZ, IntPtr eulerAngles); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_decomposeProjectionMatrix_Mat(IntPtr projMatrix, + IntPtr cameraMatrix, IntPtr rotMatrix, IntPtr transVect, IntPtr rotMatrixX, + IntPtr rotMatrixY, IntPtr rotMatrixZ, IntPtr eulerAngles); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_matMulDeriv(IntPtr a, IntPtr b, + IntPtr dABdA, IntPtr dABdB); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_composeRT_InputArray(IntPtr rvec1, IntPtr tvec1, + IntPtr rvec2, IntPtr tvec2, + IntPtr rvec3, IntPtr tvec3, + IntPtr dr3dr1, IntPtr dr3dt1, + IntPtr dr3dr2, IntPtr dr3dt2, + IntPtr dt3dr1, IntPtr dt3dt1, + IntPtr dt3dr2, IntPtr dt3dt2); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_composeRT_Mat(IntPtr rvec1, IntPtr tvec1, + IntPtr rvec2, IntPtr tvec2, + IntPtr rvec3, IntPtr tvec3, + IntPtr dr3dr1, IntPtr dr3dt1, + IntPtr dr3dr2, IntPtr dr3dt2, + IntPtr dt3dr1, IntPtr dt3dt1, + IntPtr dt3dr2, IntPtr dt3dt2); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_projectPoints_InputArray(IntPtr objectPoints, + IntPtr rvec, IntPtr tvec, + IntPtr cameraMatrix, IntPtr distCoeffs, + IntPtr imagePoints, IntPtr jacobian, + double aspectRatio); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_projectPoints_Mat(IntPtr objectPoints, + IntPtr rvec, IntPtr tvec, + IntPtr cameraMatrix, IntPtr distCoeffs, + IntPtr imagePoints, IntPtr jacobian, + double aspectRatio); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_solvePnP_InputArray(IntPtr selfectPoints, IntPtr imagePoints, IntPtr cameraMatrix, + IntPtr distCoeffs, IntPtr rvec, IntPtr tvec, int useExtrinsicGuess, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_solvePnP_vector(Point3f[] objectPoints, int objectPointsLength, + Point2f[] imagePoints, int imagePointsLength, + double[,] cameraMatrix, double[] distCoeffs, int distCoeffsLength, + [Out] double[] rvec, [Out] double[] tvec, int useExtrinsicGuess, int flags); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_solvePnPRansac_InputArray(IntPtr objectPoints, IntPtr imagePoints, + IntPtr cameraMatrix, IntPtr distCoeffs, IntPtr rvec, IntPtr tvec, + int useExtrinsicGuess, int iterationsCount, float reprojectionError, int minInliersCount, + IntPtr inliers, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_solvePnPRansac_vector(Point3f[] objectPoints, int objectPointsLength, + Point2f[] imagePoints, int imagePointsLength, double[,] cameraMatrix, double[] distCoeffs, int distCoeffsLength, + [Out] double[] rvec, [Out] double[] tvec, int useExtrinsicGuess, int iterationsCount, float reprojectionError, + int minInliersCount, IntPtr inliers, int flags); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr calib3d_initCameraMatrix2D_Mat(IntPtr[] objectPoints, int objectPointsLength, + IntPtr[] imagePoints, int imagePointsLength, + Size imageSize, double aspectRatio); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr calib3d_initCameraMatrix2D_array(IntPtr[] objectPoints, int opSize1, int[] opSize2, + IntPtr[] imagePoints, int ipSize1, int[] ipSize2, + Size imageSize, double aspectRatio); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_findChessboardCorners_InputArray(IntPtr image, Size patternSize, + IntPtr corners, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_findChessboardCorners_vector(IntPtr image, Size patternSize, + IntPtr corners, int flags); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_find4QuadCornerSubpix_InputArray(IntPtr img, IntPtr corners, Size regionSize); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_find4QuadCornerSubpix_vector(IntPtr img, IntPtr corners, Size regionSize); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_drawChessboardCorners_InputArray(IntPtr image, Size patternSize, + IntPtr corners, int patternWasFound); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_drawChessboardCorners_array(IntPtr image, Size patternSize, + Point2f[] corners, int cornersLength, int patternWasFound); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_findCirclesGrid_InputArray(IntPtr image, Size patternSize, + IntPtr centers, int flags, IntPtr blobDetector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_findCirclesGrid_vector(IntPtr image, Size patternSize, + IntPtr centers, int flags, IntPtr blobDetector); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double calib3d_calibrateCamera_InputArray( + IntPtr[] objectPoints, int objectPointsSize, + IntPtr[] imagePoints, int imagePointsSize, + Size imageSize, + IntPtr cameraMatrix,IntPtr distCoeffs, + IntPtr rvecs, IntPtr tvecs, + int flags, TermCriteria criteria); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double calib3d_calibrateCamera_vector( + IntPtr[] objectPoints, int opSize1, int[] opSize2, + IntPtr[] imagePoints, int ipSize1, int[] ipSize2, + Size imageSize, + [In, Out] double[,] cameraMatrix, + [In, Out] double[] distCoeffs, int distCoeffsSize, + IntPtr rvecs, IntPtr tvecs, + int flags, TermCriteria criteria); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_calibrationMatrixValues_InputArray( + IntPtr cameraMatrix, + Size imageSize, double apertureWidth, double apertureHeight, out double fovx, out double fovy, + out double focalLength, out Point2d principalPoint, out double aspectRatio); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_calibrationMatrixValues_array( + double[,] cameraMatrix, Size imageSize, + double apertureWidth, double apertureHeight, out double fovx, out double fovy, out double focalLength, + out Point2d principalPoint, out double aspectRatio); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double calib3d_stereoCalibrate_InputArray( + IntPtr[] objectPoints, int opSize, + IntPtr[] imagePoints1, int ip1Size, + IntPtr[] imagePoints2, int ip2Size, + IntPtr cameraMatrix1, + IntPtr distCoeffs1, + IntPtr cameraMatrix2, + IntPtr distCoeffs2, + Size imageSize, + IntPtr R, IntPtr T, + IntPtr E, IntPtr F, + int flags, TermCriteria criteria); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double calib3d_stereoCalibrate_array( + IntPtr[] objectPoints, int opSize1, int[] opSizes2, + IntPtr[] imagePoints1, int ip1Size1, int[] ip1Sizes2, + IntPtr[] imagePoints2, int ip2Size1, int[] ip2Sizes2, + [In, Out] double[,] cameraMatrix1, + [In, Out] double[] distCoeffs1, int dc1Size, + [In, Out] double[,] cameraMatrix2, + [In, Out] double[] distCoeffs2, int dc2Size, + Size imageSize, + IntPtr R, IntPtr T, + IntPtr E, IntPtr F, + int flags, TermCriteria criteria); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_stereoRectify_InputArray( + IntPtr cameraMatrix1, IntPtr distCoeffs1, + IntPtr cameraMatrix2, IntPtr distCoeffs2, + Size imageSize, IntPtr R, IntPtr T, + IntPtr R1, IntPtr R2, + IntPtr P1, IntPtr P2, + IntPtr Q, int flags, + double alpha, Size newImageSize, + out Rect validPixROI1, out Rect validPixROI2); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_stereoRectify_array( + double[,] cameraMatrix1, + double[] distCoeffs1, int dc1Size, + double[,] cameraMatrix2, + double[] distCoeffs2, int dc2Size, + Size imageSize, + double[,] R, double[] T, + double[,] R1, double[,] R2, double[,] P1, double[,] P2, + double[,] Q, int flags, double alpha, Size newImageSize, + out Rect validPixROI1, out Rect validPixROI2); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_stereoRectifyUncalibrated_InputArray( + IntPtr points1, IntPtr points2, + IntPtr F, Size imgSize, + IntPtr H1, IntPtr H2, + double threshold); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_stereoRectifyUncalibrated_array( + Point2d[] points1, int points1Size, + Point2d[] points2, int points2Size, + [In] double[,] F, Size imgSize, + [In, Out] double[,] H1, [In, Out] double[,] H2, + double threshold); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float calib3d_rectify3Collinear_InputArray( + IntPtr cameraMatrix1, IntPtr distCoeffs1, + IntPtr cameraMatrix2, IntPtr distCoeffs2, + IntPtr cameraMatrix3, IntPtr distCoeffs3, + IntPtr[] imgpt1, int imgpt1Size, + IntPtr[] imgpt3, int imgpt3Size, + Size imageSize, IntPtr R12, IntPtr T12, + IntPtr R13, IntPtr T13, + IntPtr R1, IntPtr R2, IntPtr R3, + IntPtr P1, IntPtr P2, IntPtr P3, + IntPtr Q, double alpha, Size newImgSize, + out Rect roi1, out Rect roi2, int flags); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr calib3d_getOptimalNewCameraMatrix_InputArray( + IntPtr cameraMatrix, IntPtr distCoeffs, + Size imageSize, double alpha, Size newImgSize, + out Rect validPixROI, int centerPrincipalPoint); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_getOptimalNewCameraMatrix_array( + [In] double[,] cameraMatrix, + [In] double[] distCoeffs, int distCoeffsSize, + Size imageSize, double alpha, Size newImgSize, + out Rect validPixROI, int centerPrincipalPoint, + [In, Out] double[,] outValues); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_convertPointsToHomogeneous_InputArray( + IntPtr src, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_convertPointsToHomogeneous_array1( + [In] Vec2f[] src, [In, Out] Vec3f[] dst, int length); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_convertPointsToHomogeneous_array2( + [In] Vec3f[] src, [In, Out] Vec4f[] dst, int length); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_convertPointsFromHomogeneous_InputArray( + IntPtr src, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_convertPointsFromHomogeneous_array1( + [In] Vec3f[] src, [In, Out] Vec2f[] dst, int length); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_convertPointsFromHomogeneous_array2( + [In] Vec4f[] src, [In, Out] Vec3f[] dst, int length); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_convertPointsHomogeneous( + IntPtr src, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr calib3d_findFundamentalMat_InputArray( + IntPtr points1, IntPtr points2, + int method, double param1, double param2, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr calib3d_findFundamentalMat_array( + Point2d[] points1, int points1Size, + Point2d[] points2, int points2Size, + int method, double param1, double param2, IntPtr mask); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_computeCorrespondEpilines_InputArray( + IntPtr points, int whichImage, IntPtr F, IntPtr lines); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_computeCorrespondEpilines_array2d( + [In] Point2d[] points, int pointsSize, + int whichImage, double[,] F, [In, Out] Point3f[] lines); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_computeCorrespondEpilines_array3d( + [In] Point3d[] points, int pointsSize, + int whichImage, double[,] F, [In, Out] Point3f[] lines); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_triangulatePoints_InputArray( + IntPtr projMatr1, IntPtr projMatr2, + IntPtr projPoints1, IntPtr projPoints2, + IntPtr points4D); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_triangulatePoints_array( + [In] double[,] projMatr1, [In] double[,] projMatr2, + [In] Point2d[] projPoints1, int projPoints1Size, + [In] Point2d[] projPoints2, int projPoints2Size, + [In, Out] Vec4d[] points4D); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_correctMatches_InputArray( + IntPtr F, IntPtr points1, IntPtr points2, + IntPtr newPoints1, IntPtr newPoints2); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_correctMatches_array( + double[,] F, Point2d[] points1, int points1Size, + Point2d[] points2, int points2Size, + Point2d[] newPoints1, Point2d[] newPoints2); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_filterSpeckles(IntPtr img, double newVal, int maxSpeckleSize, + double maxDiff, IntPtr buf); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Rect calib3d_getValidDisparityROI(Rect roi1, Rect roi2, + int minDisparity, int numberOfDisparities, int SADWindowSize); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_validateDisparity(IntPtr disparity, IntPtr cost, + int minDisparity, int numberOfDisparities, int disp12MaxDisp); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_reprojectImageTo3D(IntPtr disparity, IntPtr _3dImage, + IntPtr Q, int handleMissingValues, int ddepth); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_estimateAffine3D(IntPtr src, IntPtr dst, + IntPtr outVal, IntPtr inliers, double ransacThreshold, double confidence); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/calib3d/NativeMethods_calib3d_StereoMatcher.cs b/src/OpenCvSharp/PInvoke/calib3d/NativeMethods_calib3d_StereoMatcher.cs new file mode 100644 index 000000000..8f4ce6e4b --- /dev/null +++ b/src/OpenCvSharp/PInvoke/calib3d/NativeMethods_calib3d_StereoMatcher.cs @@ -0,0 +1,169 @@ + +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + static partial class NativeMethods + { + #region StereoMatcher + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_StereoMatcher_compute( + IntPtr obj, IntPtr left, IntPtr right, IntPtr disparity); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr calib3d_Ptr_StereoMatcher_info(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_StereoMatcher_getMinDisparity(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_StereoMatcher_setMinDisparity(IntPtr obj, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_StereoMatcher_getNumDisparities(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_StereoMatcher_setNumDisparities(IntPtr obj, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_StereoMatcher_getBlockSize(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_StereoMatcher_setBlockSize(IntPtr obj, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_StereoMatcher_getSpeckleWindowSize(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_StereoMatcher_setSpeckleWindowSize(IntPtr obj, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_StereoMatcher_getSpeckleRange(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_StereoMatcher_setSpeckleRange(IntPtr obj, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_StereoMatcher_getDisp12MaxDiff(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_StereoMatcher_setDisp12MaxDiff(IntPtr obj, int value); + + #endregion + + #region StereoBM + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_Ptr_StereoBM_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr calib3d_StereoBM_create(int numDisparities, int blockSize); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr calib3d_Ptr_StereoBM_info(IntPtr obj); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_StereoBM_getPreFilterType(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_StereoBM_setPreFilterType(IntPtr obj, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_StereoBM_getPreFilterSize(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_StereoBM_setPreFilterSize(IntPtr obj, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_StereoBM_getPreFilterCap(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_StereoBM_setPreFilterCap(IntPtr obj, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_StereoBM_getTextureThreshold(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_StereoBM_setTextureThreshold(IntPtr obj, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_StereoBM_getUniquenessRatio(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_StereoBM_setUniquenessRatio(IntPtr obj, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_StereoBM_getSmallerBlockSize(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_StereoBM_setSmallerBlockSize(IntPtr obj, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Rect calib3d_StereoBM_getROI1(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_StereoBM_setROI1(IntPtr obj, Rect value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Rect calib3d_StereoBM_getROI2(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_StereoBM_setROI2(IntPtr obj, Rect value); + + #endregion + + #region StereoSGBM + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_Ptr_StereoSGBM_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr calib3d_StereoSGBM_create( + int minDisparity, int numDisparities, int blockSize, + int P1, int P2, int disp12MaxDiff, + int preFilterCap, int uniquenessRatio, + int speckleWindowSize, int speckleRange, int mode); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr calib3d_Ptr_StereoSGBM_info(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_StereoSGBM_getPreFilterCap(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_StereoSGBM_setPreFilterCap(IntPtr obj, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_StereoSGBM_getUniquenessRatio(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_StereoSGBM_setUniquenessRatio(IntPtr obj, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_StereoSGBM_getP1(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_StereoSGBM_setP1(IntPtr obj, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_StereoSGBM_getP2(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_StereoSGBM_setP2(IntPtr obj, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int calib3d_StereoSGBM_getMode(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void calib3d_StereoSGBM_setMode(IntPtr obj, int value); + + #endregion + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/core/NativeMethods_core.cs b/src/OpenCvSharp/PInvoke/core/NativeMethods_core.cs new file mode 100644 index 000000000..6b8e00a85 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/core/NativeMethods_core.cs @@ -0,0 +1,295 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + #region Miscellaneous + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_setNumThreads(int nthreads); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_getNumThreads(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_getThreadNum(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void core_getBuildInformation([MarshalAs(UnmanagedType.LPStr)] StringBuilder buf, uint maxLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern long core_getTickCount(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double core_getTickFrequency(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern long core_getCPUTickCount(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_checkHardwareSupport(int feature); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_getNumberOfCPUs(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_fastMalloc(IntPtr bufSize); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_fastFree(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_setUseOptimized(int onoff); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_useOptimized(); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr redirectError(CvErrorCallback errCallback, IntPtr userdata, ref IntPtr prevUserdata); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_cvarrToMat(IntPtr arr, int copyData, int allowND, int coiMode); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_extractImageCOI(IntPtr arr, IntPtr coiimg, int coi); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_insertImageCOI(IntPtr coiimg, IntPtr arr, int coi); + #endregion + + #region Array Operations + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_add(IntPtr src1, IntPtr src2, IntPtr dst, IntPtr mask, int dtype); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_subtract(IntPtr src1, IntPtr src2, IntPtr dst, IntPtr mask, int dtype); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_multiply(IntPtr src1, IntPtr src2, IntPtr dst, double scale, int dtype); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_divide1")] + public static extern void core_divide(double scale, IntPtr src2, IntPtr dst, int dtype); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_divide2")] + public static extern void core_divide(IntPtr src1, IntPtr src2, IntPtr dst, double scale, int dtype); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_scaleAdd(IntPtr src1, double alpha, IntPtr src2,IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_addWeighted(IntPtr src1, double alpha, IntPtr src2, + double beta, double gamma, IntPtr dst, int dtype); + + #endregion + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_convertScaleAbs(IntPtr src, IntPtr dst, double alpha, double beta); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_LUT(IntPtr src, IntPtr lut, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Scalar core_sum(IntPtr src); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_countNonZero(IntPtr src); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_findNonZero(IntPtr src, IntPtr idx); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Scalar core_mean(IntPtr src, IntPtr mask); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_meanStdDev_OutputArray( + IntPtr src, IntPtr mean, IntPtr stddev, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_meanStdDev_Scalar( + IntPtr src, out Scalar mean, out Scalar stddev, IntPtr mask); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_norm1")] + public static extern double core_norm(IntPtr src1, int normType, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_norm2")] + public static extern double core_norm(IntPtr src1, IntPtr src2, + int normType, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_batchDistance(IntPtr src1, IntPtr src2, + IntPtr dist, int dtype, IntPtr nidx, + int normType, int k, IntPtr mask, + int update, int crosscheck); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_normalize(IntPtr src, IntPtr dst, double alpha, double beta, + int normType, int dtype, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_minMaxLoc1")] + public static extern void core_minMaxLoc(IntPtr src, out double minVal, out double maxVal); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_minMaxLoc2")] + public static extern void core_minMaxLoc(IntPtr src, out double minVal, out double maxVal, + out Point minLoc, out Point maxLoc, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_minMaxIdx1")] + public static extern void core_minMaxIdx(IntPtr src, out double minVal, out double maxVal); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_minMaxIdx2")] + public static extern void core_minMaxIdx(IntPtr src, out double minVal, out double maxVal, + out int minIdx, out int maxIdx, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_reduce(IntPtr src, IntPtr dst, int dim, int rtype, int dtype); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_merge([MarshalAs(UnmanagedType.LPArray)] IntPtr[] mv, uint count, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_split(IntPtr src, out IntPtr mv); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_mixChannels(IntPtr[] src, uint nsrcs, + IntPtr[] dst, uint ndsts, int[] fromTo, uint npairs); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_extractChannel(IntPtr src, IntPtr dst, int coi); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_insertChannel(IntPtr src, IntPtr dst, int coi); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_flip(IntPtr src, IntPtr dst, int flipCode); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_repeat1")] + public static extern void core_repeat(IntPtr src, int ny, int nx, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_repeat2")] + public static extern IntPtr core_repeat(IntPtr src, int ny, int nx); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_hconcat1")] + public static extern void core_hconcat([MarshalAs(UnmanagedType.LPArray)] IntPtr[] src, uint nsrc, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_hconcat2")] + public static extern void core_hconcat(IntPtr src1, IntPtr src2, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_vconcat1")] + public static extern void core_vconcat([MarshalAs(UnmanagedType.LPArray)] IntPtr[] src, uint nsrc, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_vconcat2")] + public static extern void core_vconcat(IntPtr src1, IntPtr src2, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_bitwise_and(IntPtr src1, IntPtr src2, IntPtr dst, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_bitwise_or(IntPtr src1, IntPtr src2, IntPtr dst, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_bitwise_xor(IntPtr src1, IntPtr src2, IntPtr dst, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_bitwise_not(IntPtr src, IntPtr dst, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_absdiff(IntPtr src1, IntPtr src2, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_inRange_InputArray")] + public static extern void core_inRange(IntPtr src, IntPtr lowerb, IntPtr upperb, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_inRange_Scalar")] + public static extern void core_inRange(IntPtr src, Scalar lowerb, Scalar upperb, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_compare(IntPtr src1, IntPtr src2, IntPtr dst, int cmpop); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_min1(IntPtr src1, IntPtr src2, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_max1(IntPtr src1, IntPtr src2, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_min_MatMat(IntPtr src1, IntPtr src2, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_min_MatDouble(IntPtr src1, double src2, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_max_MatMat(IntPtr src1, IntPtr src2, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_max_MatDouble(IntPtr src1, double src2, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_sqrt(IntPtr src, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_pow_Mat(IntPtr src, double power, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_exp_Mat(IntPtr src, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_log_Mat(IntPtr src, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float core_cubeRoot(float val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float core_fastAtan2(float y, float x); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_polarToCart(IntPtr magnitude, IntPtr angle, IntPtr x, IntPtr y, int angleInDegrees); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_cartToPolar(IntPtr x, IntPtr y, IntPtr magnitude, IntPtr angle, int angleInDegrees); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_phase(IntPtr x, IntPtr y, IntPtr angle, int angleInDegrees); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_magnitude_Mat(IntPtr x, IntPtr y, IntPtr magnitude); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_checkRange(IntPtr a, int quiet, out Point pos, double minVal, double maxVal); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_patchNaNs(IntPtr a, double val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_gemm(IntPtr src1, IntPtr src2, double alpha, IntPtr src3, double gamma, IntPtr dst, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_mulTransposed(IntPtr src, IntPtr dst, int aTa, IntPtr delta, double scale, int dtype); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_transpose(IntPtr src, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_transform(IntPtr src, IntPtr dst, IntPtr m); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_perspectiveTransform(IntPtr src, IntPtr dst, IntPtr m); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_perspectiveTransform_Mat(IntPtr src, IntPtr dst, IntPtr m); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_perspectiveTransform_Point2f(IntPtr src, int srcLength, IntPtr dst, int dstLength, IntPtr m); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_perspectiveTransform_Point2d(IntPtr src, int srcLength, IntPtr dst, int dstLength, IntPtr m); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_perspectiveTransform_Point3f(IntPtr src, int srcLength, IntPtr dst, int dstLength, IntPtr m); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_perspectiveTransform_Point3d(IntPtr src, int srcLength, IntPtr dst, int dstLength, IntPtr m); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_completeSymm(IntPtr mtx, int lowerToUpper); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_setIdentity(IntPtr mtx, Scalar s); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double core_determinant(IntPtr mtx); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Scalar core_trace(IntPtr mtx); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double core_invert(IntPtr src, IntPtr dst, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_solve(IntPtr src1, IntPtr src2, IntPtr dst, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_sort(IntPtr src, IntPtr dst, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_sortIdx(IntPtr src, IntPtr dst, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_solveCubic(IntPtr coeffs, IntPtr roots); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double core_solvePoly(IntPtr coeffs, IntPtr roots, int maxIters); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_eigen(IntPtr src, IntPtr eigenvalues, IntPtr eigenvectors); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_calcCovarMatrix_Mat([MarshalAs(UnmanagedType.LPArray)] IntPtr[] samples, + int nsamples, IntPtr covar, IntPtr mean, int flags, int ctype); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_calcCovarMatrix_InputArray(IntPtr samples, IntPtr covar, + IntPtr mean, int flags, int ctype); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_PCACompute(IntPtr data, IntPtr mean, IntPtr eigenvectors, int maxComponents); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_PCAComputeVar(IntPtr data, IntPtr mean, IntPtr eigenvectors, double retainedVariance); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_PCAProject(IntPtr data, IntPtr mean, IntPtr eigenvectors, IntPtr result); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_PCABackProject(IntPtr data, IntPtr mean, IntPtr eigenvectors, IntPtr result); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_SVDecomp(IntPtr src, IntPtr w, IntPtr u, IntPtr vt, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_SVBackSubst(IntPtr w, IntPtr u, IntPtr vt, IntPtr rhs, IntPtr dst); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double core_Mahalanobis(IntPtr v1, IntPtr v2, IntPtr icovar); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_dft(IntPtr src, IntPtr dst, int flags, int nonzeroRows); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_idft(IntPtr src, IntPtr dst, int flags, int nonzeroRows); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_dct(IntPtr src, IntPtr dst, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_idct(IntPtr src, IntPtr dst, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_mulSpectrums(IntPtr a, IntPtr b, IntPtr c, int flags, int conjB); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_getOptimalDFTSize(int vecsize); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double core_kmeans(IntPtr data, int k, IntPtr bestLabels, + TermCriteria criteria, int attempts, int flags, IntPtr centers); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong core_theRNG(); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_randu_InputArray(IntPtr dst, IntPtr low, IntPtr high); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_randu_Scalar(IntPtr dst, Scalar low, Scalar high); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_randn_InputArray(IntPtr dst, IntPtr mean, IntPtr stddev); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_randn_Scalar(IntPtr dst, Scalar mean, Scalar stddev); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_randShuffle(IntPtr dst, double iterFactor, ref ulong rng); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_randShuffle(IntPtr dst, double iterFactor, IntPtr rng); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/core/NativeMethods_core_Algorithm.cs b/src/OpenCvSharp/PInvoke/core/NativeMethods_core_Algorithm.cs new file mode 100644 index 000000000..ab0745a33 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/core/NativeMethods_core_Algorithm.cs @@ -0,0 +1,27 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Algorithm_write(IntPtr obj, IntPtr fs); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Algorithm_read(IntPtr obj, IntPtr fn); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Algorithm_empty(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Algorithm_save(IntPtr obj, string filename); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Algorithm_getDefaultName( + IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] StringBuilder buf, int bufLength); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/core/NativeMethods_core_Classes.cs b/src/OpenCvSharp/PInvoke/core/NativeMethods_core_Classes.cs new file mode 100644 index 000000000..67acb2e1d --- /dev/null +++ b/src/OpenCvSharp/PInvoke/core/NativeMethods_core_Classes.cs @@ -0,0 +1,290 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + #region Algorithm + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Algorithm_new(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Algorithm_delete(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void core_Algorithm_name(IntPtr self, [MarshalAs(UnmanagedType.LPStr)] StringBuilder buf, int bufLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Ptr_Algorithm_new(IntPtr rawPtr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Ptr_Algorithm_delete(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Ptr_Algorithm_get(IntPtr ptr); + + #endregion + + #region InputArray / OutputArray + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_InputArray_new_byMat(IntPtr mat); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_InputArray_new_byMatExpr(IntPtr mat); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_InputArray_new_byScalar(Scalar val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_InputArray_new_byDouble(double val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_InputArray_new_byGpuMat(IntPtr mat); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_InputArray_new_byVectorOfMat(IntPtr vector); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_InputArray_delete(IntPtr ia); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_OutputArray_new_byMat(IntPtr mat); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_OutputArray_new_byGpuMat(IntPtr mat); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_OutputArray_new_byScalar(Scalar val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_OutputArray_new_byVectorOfMat(IntPtr vector); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_OutputArray_delete(IntPtr oa); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_InputArray_kind(IntPtr ia); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_OutputArray_getMat(IntPtr oa); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Scalar core_OutputArray_getScalar(IntPtr oa); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_OutputArray_getVectorOfMat(IntPtr oa, IntPtr vector); + + #endregion + + #region FileStorage + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_FileStorage_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_FileStorage_new2( + [MarshalAs(UnmanagedType.LPStr)] string source, + int flags, [MarshalAs(UnmanagedType.LPStr)] string encoding); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_FileStorage_newFromLegacy(IntPtr fs); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_FileStorage_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_FileStorage_open( + IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string filename, + int flags, [MarshalAs(UnmanagedType.LPStr)] string encoding); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_FileStorage_isOpened(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_FileStorage_release(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_FileStorage_releaseAndGetString( + IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] StringBuilder buf, int bufLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_FileStorage_getFirstTopLevelNode(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_FileStorage_root(IntPtr obj, int streamIdx); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_FileStorage_indexer( + IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string nodeName); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_FileStorage_toLegacy(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_FileStorage_writeRaw( + IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string fmt, IntPtr vec, IntPtr len); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_FileStorage_writeObj( + IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string name, IntPtr value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_FileStorage_getDefaultObjectName( + [MarshalAs(UnmanagedType.LPStr)] string filename, + [MarshalAs(UnmanagedType.LPStr)] StringBuilder buf, int bufLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe sbyte* core_FileStorage_elname(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_FileStorage_structs(IntPtr obj, out IntPtr resultLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_FileStorage_state(IntPtr obj); + + #endregion + + #region FileNode + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_FileNode_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_FileNode_new2(IntPtr fs, IntPtr node); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_FileNode_new3(IntPtr node); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_FileNode_delete(IntPtr node); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_FileNode_operatorThis_byString( + IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string nodeName); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_FileNode_operatorThis_byInt(IntPtr obj, int i); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_FileNode_type(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_FileNode_empty(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_FileNode_isNone(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_FileNode_isSeq(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_FileNode_isMap(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_FileNode_isInt(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_FileNode_isReal(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_FileNode_isString(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_FileNode_isNamed(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_FileNode_name( + IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] StringBuilder buf, int bufLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_FileNode_size(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_FileNode_toInt(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float core_FileNode_toFloat(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double core_FileNode_toDouble(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_FileNode_toString( + IntPtr obj, StringBuilder buf, int bufLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_FileNode_readRaw( + IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string fmt, IntPtr vec, IntPtr len); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_FileNode_readObj(IntPtr obj); + + #endregion + + #region PCA + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_PCA_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_PCA_new2(IntPtr data, IntPtr mean, int flags, + int maxComponents); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_PCA_new3(IntPtr data, IntPtr mean, int flags, + double retainedVariance); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_PCA_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_PCA_operatorThis(IntPtr obj, IntPtr data, IntPtr mean, + int flags, int maxComponents); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_PCA_computeVar(IntPtr obj, IntPtr data, IntPtr mean, + int flags, double retainedVariance); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_PCA_project1")] + public static extern IntPtr core_PCA_project(IntPtr obj, IntPtr vec); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_PCA_project2")] + public static extern void core_PCA_project(IntPtr obj, IntPtr vec, IntPtr result); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_PCA_backProject1")] + public static extern IntPtr core_PCA_backProject(IntPtr obj, IntPtr vec); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_PCA_backProject2")] + public static extern void core_PCA_backProject(IntPtr obj, IntPtr vec, IntPtr result); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_PCA_eigenvectors(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_PCA_eigenvalues(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_PCA_mean(IntPtr obj); + #endregion + + #region RNG + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_RNG_new1")] + public static extern ulong core_RNG_new(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_RNG_new2")] + public static extern ulong core_RNG_new(ulong state); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern uint core_RNG_next(ulong state); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern byte core_RNG_operator_uchar(ulong state); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern sbyte core_RNG_operator_schar(ulong state); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern ushort core_RNG_operator_ushort(ulong state); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern short core_RNG_operator_short(ulong state); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern uint core_RNG_operator_uint(ulong state); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_RNG_operatorThis1")] + public static extern uint core_RNG_operatorThis(ulong state, uint n); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_RNG_operatorThis2")] + public static extern uint core_RNG_operatorThis(ulong state); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_RNG_operator_int(ulong state); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float core_RNG_operator_float(ulong state); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double core_RNG_operator_double(ulong state); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_RNG_uniform_int")] + public static extern int core_RNG_uniform(ulong state, int a, int b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_RNG_uniform_float")] + public static extern float core_RNG_uniform(ulong state, float a, float b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_RNG_uniform_double")] + public static extern double core_RNG_uniform(ulong state, double a, double b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_RNG_fill(ulong state, IntPtr mat, int distType, IntPtr a, IntPtr b, int saturateRange); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double core_RNG_gaussian(ulong state, double sigma); + #endregion + + #region SVD + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_SVD_new1")] + public static extern IntPtr core_SVD_new(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_SVD_new2")] + public static extern IntPtr core_SVD_new(IntPtr src, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_SVD_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_SVD_operatorThis(IntPtr obj, IntPtr src, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_SVD_backSubst(IntPtr obj, IntPtr rhs, IntPtr dst); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_SVD_static_compute1")] + public static extern void core_SVD_static_compute(IntPtr src, IntPtr w, IntPtr u, IntPtr vt, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_SVD_static_compute2")] + public static extern void core_SVD_static_compute(IntPtr src, IntPtr w, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_SVD_static_backSubst(IntPtr w, IntPtr u, IntPtr vt, IntPtr rhs, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_SVD_static_solveZ(IntPtr src, IntPtr dst); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SVD_u(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SVD_w(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SVD_vt(IntPtr obj); + #endregion + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/core/NativeMethods_core_Mat.cs b/src/OpenCvSharp/PInvoke/core/NativeMethods_core_Mat.cs new file mode 100644 index 000000000..180aa8496 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/core/NativeMethods_core_Mat.cs @@ -0,0 +1,723 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong core_Mat_sizeof(); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_new2(int rows, int cols, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_new3(int rows, int cols, int type, Scalar scalar); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_new4(IntPtr mat, Range rowRange, Range colRange); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_new5(IntPtr mat, Range rowRange); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_new6(IntPtr mat, [MarshalAs(UnmanagedType.LPArray)] Range[] rowRange); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_new7(IntPtr mat, Rect roi); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_new8(int rows, int cols, int type, IntPtr data, IntPtr step); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_new9(int ndims, [MarshalAs(UnmanagedType.LPArray)] int[] sizes, + int type, IntPtr data, [MarshalAs(UnmanagedType.LPArray)] IntPtr[] steps); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_new9(int ndims, [MarshalAs(UnmanagedType.LPArray)] int[] sizes, + int type, IntPtr data, IntPtr steps); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_new10(int ndims, [MarshalAs(UnmanagedType.LPArray)] int[] sizes, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_new11(int ndims, [MarshalAs(UnmanagedType.LPArray)] int[] sizes, int type, Scalar s); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_new_FromIplImage(IntPtr img, int copyData); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_new_FromCvMat(IntPtr mat, int copyData); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_release(IntPtr mat); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_delete(IntPtr mat); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_adjustROI(IntPtr nativeObj, int dtop, int dbottom, int dleft, int dright); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_assignTo1(IntPtr self, IntPtr m); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_assignTo2(IntPtr self, IntPtr m, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_channels(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_checkVector1(IntPtr self, int elemChannels); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_checkVector2(IntPtr self, int elemChannels, int depth); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_checkVector3(IntPtr self, int elemChannels, int depth, int requireContinuous); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_clone(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_col_toMat(IntPtr self, int x); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_col_toMatExpr(IntPtr self, int x); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_cols(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_colRange_toMat(IntPtr self, int startCol, int endCol); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_colRange_toMatExpr(IntPtr self, int startCol, int endCol); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_dims(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_convertTo(IntPtr self, IntPtr m, int rtype, double alpha, double beta); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_copyTo(IntPtr self, IntPtr m, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_Mat_create1")] + public static extern void core_Mat_create(IntPtr self, int rows, int cols, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_Mat_create2")] + public static extern void core_Mat_create(IntPtr self, int ndims, + [MarshalAs(UnmanagedType.LPArray)] int[] sizes, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_cross(IntPtr self, IntPtr m); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe byte* core_Mat_data(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_datastart(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_dataend(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_datalimit(IntPtr self); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_depth(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_Mat_diag1")] + public static extern IntPtr core_Mat_diag(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_Mat_diag2")] + public static extern IntPtr core_Mat_diag(IntPtr self, int d); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double core_Mat_dot(IntPtr self, IntPtr m); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong core_Mat_elemSize(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong core_Mat_elemSize1(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_empty(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_eye(int rows, int cols, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_inv1(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_inv2(IntPtr self, int method); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_isContinuous(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_isSubmatrix(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_locateROI(IntPtr self, out Size wholeSize, out Point ofs); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_mul1(IntPtr self, IntPtr m); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_mul2(IntPtr self, IntPtr m, double scale); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_ones1(int rows, int cols, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_ones2(int ndims, [MarshalAs(UnmanagedType.LPArray)] int[] sz, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_reshape1(IntPtr self, int cn); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_reshape2(IntPtr self, int cn, int rows); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_reshape3(IntPtr self, int cn, int newndims, [MarshalAs(UnmanagedType.LPArray)] int[] newsz); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_rows(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_row_toMat(IntPtr self, int y); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_row_toMatExpr(IntPtr self, int y); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_rowRange_toMat(IntPtr self, int startRow, int endRow); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_rowRange_toMatExpr(IntPtr self, int startRow, int endRow); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_setTo_Scalar(IntPtr self, Scalar value, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_setTo_InputArray(IntPtr self, IntPtr value, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Size core_Mat_size(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_sizeAt(IntPtr self, int i); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_Mat_step11")] + public static extern ulong core_Mat_step1(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_Mat_step12")] + public static extern ulong core_Mat_step1(IntPtr self, int i); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern long core_Mat_step(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong core_Mat_stepAt(IntPtr self, int i); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_subMat1(IntPtr self, int rowStart, int rowEnd, int colStart, int colEnd); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_subMa2t(IntPtr self, int nRanges, Range[] ranges); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_t(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong core_Mat_total(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_type(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_zeros1(int rows, int cols, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_zeros2(int ndims, [MarshalAs(UnmanagedType.LPArray)] int[] sz, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern unsafe sbyte* core_Mat_dump(IntPtr self, [MarshalAs(UnmanagedType.LPStr)] string format); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe void core_Mat_dump_delete(sbyte* buf); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_ptr1d(IntPtr self, int i0); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_ptr2d(IntPtr self, int i0, int i1); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_ptr3d(IntPtr self, int i0, int i1, int i2); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_ptrnd(IntPtr self, [MarshalAs(UnmanagedType.LPArray)] int[] idx); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_assignment_FromMat(IntPtr self, IntPtr newMat); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_assignment_FromMatExpr(IntPtr self, IntPtr newMatExpr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_assignment_FromScalar(IntPtr self, Scalar scalar); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_IplImage(IntPtr self, IntPtr outImage); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_IplImage_alignment(IntPtr self, out IntPtr outImage); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_CvMat(IntPtr self, IntPtr outMat); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorUnaryMinus(IntPtr mat); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorAdd_MatMat(IntPtr a, IntPtr b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorAdd_MatScalar(IntPtr a, Scalar s); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorAdd_ScalarMat(Scalar s, IntPtr a); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorMinus_Mat(IntPtr a); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorSubtract_MatMat(IntPtr a, IntPtr b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorSubtract_MatScalar(IntPtr a, Scalar s); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorSubtract_ScalarMat(Scalar s, IntPtr a); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorMultiply_MatMat(IntPtr a, IntPtr b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorMultiply_MatDouble(IntPtr a, double s); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorMultiply_DoubleMat(double s, IntPtr a); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorDivide_MatMat(IntPtr a, IntPtr b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorDivide_MatDouble(IntPtr a, double s); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorDivide_DoubleMat(double s, IntPtr a); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorAnd_MatMat(IntPtr a, IntPtr b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorAnd_MatDouble(IntPtr a, double s); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorAnd_DoubleMat(double s, IntPtr a); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorOr_MatMat(IntPtr a, IntPtr b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorOr_MatDouble(IntPtr a, double s); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorOr_DoubleMat(double s, IntPtr a); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorXor_MatMat(IntPtr a, IntPtr b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorXor_MatDouble(IntPtr a, double s); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorXor_DoubleMat(double s, IntPtr a); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorNot(IntPtr a); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorLT_MatMat(IntPtr a, IntPtr b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorLT_DoubleMat(double a, IntPtr b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorLT_MatDouble(IntPtr a, double b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorLE_MatMat(IntPtr a, IntPtr b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorLE_DoubleMat(double a, IntPtr b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorLE_MatDouble(IntPtr a, double b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorGT_MatMat(IntPtr a, IntPtr b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorGT_DoubleMat(double a, IntPtr b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorGT_MatDouble(IntPtr a, double b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorGE_MatMat(IntPtr a, IntPtr b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorGE_DoubleMat(double a, IntPtr b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorGE_MatDouble(IntPtr a, double b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorEQ_MatMat(IntPtr a, IntPtr b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorEQ_DoubleMat(double a, IntPtr b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorEQ_MatDouble(IntPtr a, double b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorNE_MatMat(IntPtr a, IntPtr b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorNE_DoubleMat(double a, IntPtr b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_Mat_operatorNE_MatDouble(IntPtr a, double b); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_abs_Mat(IntPtr e); + + #region nSet + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetB(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetB(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] byte[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetS(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] short[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetS(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] short[,] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetS(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] ushort[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetS(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] ushort[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetI(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] int[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetI(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] int[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetF(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] float[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetF(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] float[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetD(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] double[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetD(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] double[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetVec3b(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Vec3b[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetVec3b(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Vec3b[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetVec3d(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Vec3d[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetVec3d(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Vec3d[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetVec4f(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Vec4f[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetVec4f(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Vec4f[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetVec6f(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Vec6f[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetVec6f(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Vec6f[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetVec4i(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Vec4i[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetVec4i(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Vec4i[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetPoint(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Point[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetPoint(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Point[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetPoint2f(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Point2f[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetPoint2f(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Point2f[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetPoint2d(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Point2d[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetPoint2d(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Point2d[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetPoint3i(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Point3i[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetPoint3i(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Point3i[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetPoint3f(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Point3f[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetPoint3f(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Point3f[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetPoint3d(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Point3d[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetPoint3d(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Point3d[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetRect(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Rect[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nSetRect(IntPtr obj, int row, int col, + [In, MarshalAs(UnmanagedType.LPArray)] Rect[,] vals, int valsLength); + #endregion + + #region nGet + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetB(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] byte[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetB(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] byte[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetS(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] short[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetS(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] short[,] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetS(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] ushort[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetS(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] ushort[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetI(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] int[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetI(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] int[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetF(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] float[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetF(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] float[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetD(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] double[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetD(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] double[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetVec3b(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Vec3b[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetVec3b(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Vec3b[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetVec3d(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Vec3d[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetVec3d(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Vec3d[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetVec4f(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Vec4f[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetVec4f(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Vec4f[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetVec6f(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Vec6f[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetVec6f(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Vec6f[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetVec4i(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Vec4i[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetVec4i(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Vec4i[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetPoint(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Point[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetPoint(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Point[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetPoint2f(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Point2f[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetPoint2f(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Point2f[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetPoint2d(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Point2d[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetPoint2d(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Point2d[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetPoint3i(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Point3i[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetPoint3i(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Point3i[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetPoint3f(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Point3f[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetPoint3f(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Point3f[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetPoint3d(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Point3d[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetPoint3d(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Point3d[,] vals, int valsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetRect(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Rect[] vals, int valsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_Mat_nGetRect(IntPtr obj, int row, int col, + [In, Out, MarshalAs(UnmanagedType.LPArray)] Rect[,] vals, int valsLength); + #endregion + + #region push_back + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Mat(IntPtr self, IntPtr m); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_char(IntPtr self, sbyte v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_uchar(IntPtr self, byte v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_short(IntPtr self, short v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_ushort(IntPtr self, ushort v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_int(IntPtr self, int v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_float(IntPtr self, float v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_double(IntPtr self, double v); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec2b(IntPtr self, Vec2b v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec3b(IntPtr self, Vec3b v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec4b(IntPtr self, Vec4b v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec6b(IntPtr self, Vec6b v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec2s(IntPtr self, Vec2s v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec3s(IntPtr self, Vec3s v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec4s(IntPtr self, Vec4s v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec6s(IntPtr self, Vec6s v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec2w(IntPtr self, Vec2w v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec3w(IntPtr self, Vec3w v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec4w(IntPtr self, Vec4w v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec6w(IntPtr self, Vec6w v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec2i(IntPtr self, Vec2i v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec3i(IntPtr self, Vec3i v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec4i(IntPtr self, Vec4i v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec6i(IntPtr self, Vec6i v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec2f(IntPtr self, Vec2f v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec3f(IntPtr self, Vec3f v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec4f(IntPtr self, Vec4f v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec6f(IntPtr self, Vec6f v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec2d(IntPtr self, Vec2d v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec3d(IntPtr self, Vec3d v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Vec6d(IntPtr self, Vec6d v); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Point(IntPtr self, Point v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Point2f(IntPtr self, Point2f v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Point2d(IntPtr self, Point2d v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Point3i(IntPtr self, Point3i v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Point3f(IntPtr self, Point3f v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Point3d(IntPtr self, Point3d v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Size(IntPtr self, Size v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Size2f(IntPtr self, Size2f v); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_push_back_Rect(IntPtr self, Rect v); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_reserve(IntPtr obj, IntPtr sz); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_resize1(IntPtr obj, IntPtr sz); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_resize2(IntPtr obj, IntPtr sz, Scalar s); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_pop_back(IntPtr obj, IntPtr nelems); + #endregion + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_uchar(IntPtr m, MatForeachFunctionByte proc); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_Vec2b(IntPtr m, MatForeachFunctionVec2b proc); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_Vec3b(IntPtr m, MatForeachFunctionVec3b proc); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_Vec4b(IntPtr m, MatForeachFunctionVec4b proc); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_Vec6b(IntPtr m, MatForeachFunctionVec6b proc); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_short(IntPtr m, MatForeachFunctionInt16 proc); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_Vec2s(IntPtr m, MatForeachFunctionVec2s proc); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_Vec3s(IntPtr m, MatForeachFunctionVec3s proc); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_Vec4s(IntPtr m, MatForeachFunctionVec4s proc); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_Vec6s(IntPtr m, MatForeachFunctionVec6s proc); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_int(IntPtr m, MatForeachFunctionInt32 proc); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_Vec2i(IntPtr m, MatForeachFunctionVec2i proc); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_Vec3i(IntPtr m, MatForeachFunctionVec3i proc); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_Vec4i(IntPtr m, MatForeachFunctionVec4i proc); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_Vec6i(IntPtr m, MatForeachFunctionVec6i proc); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_float(IntPtr m, MatForeachFunctionFloat proc); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_Vec2f(IntPtr m, MatForeachFunctionVec2f proc); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_Vec3f(IntPtr m, MatForeachFunctionVec3f proc); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_Vec4f(IntPtr m, MatForeachFunctionVec4f proc); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_Vec6f(IntPtr m, MatForeachFunctionVec6f proc); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_double(IntPtr m, MatForeachFunctionDouble proc); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_Vec2d(IntPtr m, MatForeachFunctionVec2d proc); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_Vec3d(IntPtr m, MatForeachFunctionVec3d proc); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_Vec4d(IntPtr m, MatForeachFunctionVec4d proc); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_Mat_forEach_Vec6d(IntPtr m, MatForeachFunctionVec6d proc); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/core/NativeMethods_core_MatExpr.cs b/src/OpenCvSharp/PInvoke/core/NativeMethods_core_MatExpr.cs new file mode 100644 index 000000000..ee92044ee --- /dev/null +++ b/src/OpenCvSharp/PInvoke/core/NativeMethods_core_MatExpr.cs @@ -0,0 +1,98 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_MatExpr_new1")] + public static extern IntPtr core_MatExpr_new(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_MatExpr_new2")] + public static extern IntPtr core_MatExpr_new(IntPtr mat); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_MatExpr_delete(IntPtr expr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_MatExpr_toMat(IntPtr expr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorUnaryMinus_MatExpr(IntPtr e); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorUnaryNot_MatExpr(IntPtr e); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorAdd_MatExprMat(IntPtr e, IntPtr m); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorAdd_MatMatExpr(IntPtr m, IntPtr e); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorAdd_MatExprScalar(IntPtr e, Scalar s); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorAdd_ScalarMatExpr(Scalar s, IntPtr e); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorAdd_MatExprMatExpr(IntPtr e1, IntPtr e2); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorSubtract_MatExprMat(IntPtr e, IntPtr m); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorSubtract_MatMatExpr(IntPtr m, IntPtr e); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorSubtract_MatExprScalar(IntPtr e, Scalar s); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorSubtract_ScalarMatExpr(Scalar s, IntPtr e); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorSubtract_MatExprMatExpr(IntPtr e1, IntPtr e2); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorMultiply_MatExprMat(IntPtr e, IntPtr m); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorMultiply_MatMatExpr(IntPtr m, IntPtr e); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorMultiply_MatExprDouble(IntPtr e, double s); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorMultiply_DoubleMatExpr(double s, IntPtr e); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorMultiply_MatExprMatExpr(IntPtr e1, IntPtr e2); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorDivide_MatExprMat(IntPtr e, IntPtr m); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorDivide_MatMatExpr(IntPtr m, IntPtr e); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorDivide_MatExprDouble(IntPtr e, double s); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorDivide_DoubleMatExpr(double s, IntPtr e); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_operatorDivide_MatExprMatExpr(IntPtr e1, IntPtr e2); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_MatExpr_row(IntPtr self, int y); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_MatExpr_col(IntPtr self, int x); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_MatExpr_diag1")] + public static extern IntPtr core_MatExpr_diag(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_MatExpr_diag2")] + public static extern IntPtr core_MatExpr_diag(IntPtr self, int d); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_MatExpr_submat(IntPtr self, int rowStart, int rowEnd, int colStart, int colEnd); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_MatExpr_cross(IntPtr self, IntPtr m); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double core_MatExpr_dot(IntPtr self, IntPtr m); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_MatExpr_t(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_MatExpr_inv1")] + public static extern IntPtr core_MatExpr_inv(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "core_MatExpr_inv2")] + public static extern IntPtr core_MatExpr_inv(IntPtr self, int method); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_MatExpr_mul_toMatExpr(IntPtr self, IntPtr e, double scale); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_MatExpr_mul_toMat(IntPtr self, IntPtr m, double scale); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Size core_MatExpr_size(IntPtr self); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_MatExpr_type(IntPtr self); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_abs_MatExpr(IntPtr e); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/core/NativeMethods_core_SparseMat.cs b/src/OpenCvSharp/PInvoke/core/NativeMethods_core_SparseMat.cs new file mode 100644 index 000000000..bf8bd5595 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/core/NativeMethods_core_SparseMat.cs @@ -0,0 +1,107 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong core_SparseMat_sizeof(); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SparseMat_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SparseMat_new2(int dims, int[] sizes, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SparseMat_new3(IntPtr m); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_SparseMat_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_SparseMat_operatorAssign_SparseMat(IntPtr obj, IntPtr m); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_SparseMat_operatorAssign_Mat(IntPtr obj, IntPtr m); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SparseMat_clone(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_SparseMat_copyTo_SparseMat(IntPtr obj, IntPtr m); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_SparseMat_copyTo_Mat(IntPtr obj, IntPtr m); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_SparseMat_convertTo_SparseMat(IntPtr obj, IntPtr m, + int rtype, double alpha); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_SparseMat_convertTo_Mat(IntPtr obj, IntPtr m, int rtype, + double alpha, double beta); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_SparseMat_assignTo(IntPtr obj, IntPtr m, int type); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_SparseMat_create(IntPtr obj, int dims, int[] sizes, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_SparseMat_clear(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_SparseMat_addref(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void core_SparseMat_release(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_SparseMat_elemSize(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_SparseMat_elemSize1(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_SparseMat_type(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_SparseMat_depth(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_SparseMat_channels(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SparseMat_size1(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_SparseMat_size2(IntPtr obj, int i); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int core_SparseMat_dims(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SparseMat_nzcount(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SparseMat_hash_1d(IntPtr obj, int i0); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SparseMat_hash_2d(IntPtr obj, int i0, int i1); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SparseMat_hash_3d(IntPtr obj, int i0, int i1, int i2); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SparseMat_hash_nd(IntPtr obj, int[] idx); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SparseMat_ptr_1d(IntPtr obj, int i0, + int createMissing, ref ulong hashval); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SparseMat_ptr_1d(IntPtr obj, int i0, + int createMissing, IntPtr hashval); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SparseMat_ptr_2d(IntPtr obj, int i0, int i1, + int createMissing, ref ulong hashval); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SparseMat_ptr_2d(IntPtr obj, int i0, int i1, + int createMissing, IntPtr hashval); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SparseMat_ptr_3d(IntPtr obj, int i0, int i1, int i2, + int createMissing, ref ulong hashval); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SparseMat_ptr_3d(IntPtr obj, int i0, int i1, int i2, + int createMissing, IntPtr hashval); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SparseMat_ptr_nd(IntPtr obj, int[] idx, + int createMissing, ref ulong hashval); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr core_SparseMat_ptr_nd(IntPtr obj, int[] idx, + int createMissing, IntPtr hashval); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/cuda/NativeMethods_cuda.cs b/src/OpenCvSharp/PInvoke/cuda/NativeMethods_cuda.cs new file mode 100644 index 000000000..463731de0 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/cuda/NativeMethods_cuda.cs @@ -0,0 +1,338 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + static partial class NativeMethods + { + #region Device + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_getCudaEnabledDeviceCount(); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_setDevice(int device); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_getDevice(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_resetDevice(); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_deviceSupports(int feature_set); + + // TargetArchs + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_TargetArchs_builtWith(int feature_set); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_TargetArchs_has(int major, int minor); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_TargetArchs_hasPtx(int major, int minor); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_TargetArchs_hasBin(int major, int minor); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_TargetArchs_hasEqualOrLessPtx(int major, int minor); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_TargetArchs_hasEqualOrGreater(int major, int minor); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_TargetArchs_hasEqualOrGreaterPtx(int major, int minor); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_TargetArchs_hasEqualOrGreaterBin(int major, int minor); + + // DeviceInfo + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_DeviceInfo_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_DeviceInfo_new2(int deviceId); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_DeviceInfo_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)] + public static extern void cuda_DeviceInfo_name( + IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] StringBuilder buf, int bufLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_DeviceInfo_majorVersion(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_DeviceInfo_minorVersion(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_DeviceInfo_multiProcessorCount(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong cuda_DeviceInfo_sharedMemPerBlock(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_DeviceInfo_queryMemory( + IntPtr obj, out ulong totalMemory, out ulong freeMemory); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong cuda_DeviceInfo_freeMemory(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong cuda_DeviceInfo_totalMemory(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_DeviceInfo_supports(IntPtr obj, int featureSet); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_DeviceInfo_isCompatible(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_DeviceInfo_deviceID(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_DeviceInfo_canMapHostMemory(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_printCudaDeviceInfo(int device); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_printShortCudaDeviceInfo(int device); + #endregion + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_registerPageLocked(IntPtr m); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_unregisterPageLocked(IntPtr m); + + #region Stream + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_Stream_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_Stream_new2(IntPtr s); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_Stream_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_Stream_opAssign(IntPtr left, IntPtr right); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_Stream_queryIfComplete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_Stream_waitForCompletion(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_Stream_enqueueDownload_CudaMem(IntPtr obj, IntPtr src, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_Stream_enqueueDownload_Mat(IntPtr obj, IntPtr src, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_Stream_enqueueUpload_CudaMem(IntPtr obj, IntPtr src, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_Stream_enqueueUpload_Mat(IntPtr obj, IntPtr src, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_Stream_enqueueCopy(IntPtr obj, IntPtr src, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_Stream_enqueueMemSet(IntPtr obj, IntPtr src, Scalar val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_Stream_enqueueMemSet_WithMask(IntPtr obj, IntPtr src, Scalar val, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_Stream_enqueueConvert( + IntPtr obj, IntPtr src, IntPtr dst, int dtype, double a, double b); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_Stream_enqueueHostCallback( + IntPtr obj, IntPtr callback, IntPtr userData); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_Stream_Null(); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_Stream_bool(IntPtr obj); + + #endregion + + #region CascadeClassifier_GPU + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_CascadeClassifier_GPU_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_CascadeClassifier_GPU_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_CascadeClassifier_GPU_new2(string filename); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_CascadeClassifier_GPU_empty(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_CascadeClassifier_GPU_load(IntPtr obj, string filename); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_CascadeClassifier_GPU_release(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_CascadeClassifier_GPU_detectMultiScale1(IntPtr obj, + IntPtr image, IntPtr objectsBuf, double scaleFactor, int minNeighbors, Size minSize); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_CascadeClassifier_GPU_detectMultiScale2(IntPtr obj, + IntPtr image, IntPtr objectsBuf, Size maxObjectSize, Size minSize, double scaleFactor, + int minNeighbors); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_CascadeClassifier_GPU_findLargestObject_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_CascadeClassifier_GPU_findLargestObject_set(IntPtr obj, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_CascadeClassifier_GPU_visualizeInPlace_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_CascadeClassifier_GPU_visualizeInPlace_set(IntPtr obj, int value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Size cuda_CascadeClassifier_GPU_getClassifierSize(IntPtr obj); + + #endregion + + #region HogDescriptor + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int HOGDescriptor_sizeof(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr HOGDescriptor_new(Size win_size, Size block_size, Size block_stride, Size cell_size, + int nbins, double winSigma, double threshold_L2Hys, bool gamma_correction, int nlevels); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void HOGDescriptor_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong HOGDescriptor_getDescriptorSize(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong HOGDescriptor_getBlockHistogramSize(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int HOGDescriptor_checkDetectorSize(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double HOGDescriptor_getWinSigma(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void HOGDescriptor_setSVMDetector(IntPtr obj, IntPtr svmdetector); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void HOGDescriptor_detect(IntPtr obj, IntPtr img, IntPtr found_locations, double hit_threshold, Size win_stride, Size padding); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void HOGDescriptor_detectMultiScale(IntPtr obj, IntPtr img, IntPtr found_locations, + double hit_threshold, Size win_stride, Size padding, double scale, int group_threshold); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void HOGDescriptor_getDescriptors(IntPtr obj, IntPtr img, Size win_stride, IntPtr descriptors, [MarshalAs(UnmanagedType.I4)] Gpu.DescriptorFormat descr_format); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Size HOGDescriptor_win_size_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Size HOGDescriptor_block_size_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Size HOGDescriptor_block_stride_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Size HOGDescriptor_cell_size_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int HOGDescriptor_nbins_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double HOGDescriptor_win_sigma_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double HOGDescriptor_threshold_L2hys_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int HOGDescriptor_nlevels_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int HOGDescriptor_gamma_correction_get(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void HOGDescriptor_win_size_set(IntPtr obj, Size value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void HOGDescriptor_block_size_set(IntPtr obj, Size value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void HOGDescriptor_block_stride_set(IntPtr obj, Size value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void HOGDescriptor_cell_size_set(IntPtr obj, Size value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void HOGDescriptor_nbins_set(IntPtr obj, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void HOGDescriptor_win_sigma_set(IntPtr obj, double value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void HOGDescriptor_threshold_L2hys_set(IntPtr obj, double value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void HOGDescriptor_nlevels_set(IntPtr obj, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void HOGDescriptor_gamma_correction_set(IntPtr obj, int value); + #endregion + + #region MOG_GPU + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_MOG_GPU_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_MOG_GPU_new(int nmixtures); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_MOG_GPU_initialize( + IntPtr obj, Size frameSize, int frameType); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_MOG_GPU_operator( + IntPtr obj, IntPtr frame, IntPtr fgmask, float learningRate, IntPtr stream); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_MOG_GPU_getBackgroundImage( + IntPtr obj, IntPtr backgroundImage, IntPtr stream); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_MOG_GPU_release(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe int* cuda_MOG_GPU_history(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe float* cuda_MOG_GPU_varThreshold(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe float* cuda_MOG_GPU_backgroundRatio(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe float* cuda_MOG_GPU_noiseSigma(IntPtr obj); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_MOG2_GPU_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_MOG2_GPU_new(int nmixtures); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_MOG2_GPU_initialize( + IntPtr obj, Size frameSize, int frameType); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_MOG2_GPU_operator( + IntPtr obj, IntPtr frame, IntPtr fgmask, float learningRate, IntPtr stream); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_MOG2_GPU_getBackgroundImage( + IntPtr obj, IntPtr backgroundImage, IntPtr stream); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_MOG2_GPU_release(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe int* cuda_MOG2_GPU_history(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe float* cuda_MOG2_GPU_varThreshold(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe float* cuda_MOG2_GPU_backgroundRatio(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe float* cuda_MOG2_GPU_varThresholdGen(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe float* cuda_MOG2_GPU_fVarInit(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe float* cuda_MOG2_GPU_fVarMin(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe float* cuda_MOG2_GPU_fVarMax(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe float* cuda_MOG2_GPU_fCT(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_MOG2_GPU_bShadowDetection_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_MOG2_GPU_bShadowDetection_set(IntPtr obj, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe byte* cuda_MOG2_GPU_nShadowDetection(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe float* cuda_MOG2_GPU_fTau(IntPtr obj); + + #endregion + + #region StereoBM_GPU + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_StereoBM_GPU_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_StereoBM_GPU_new2(int preset, int ndisparities, int winSize); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_StereoBM_GPU_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_StereoBM_GPU_run1(IntPtr obj, IntPtr left, IntPtr right, IntPtr disparity); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_StereoBM_GPU_run2(IntPtr obj, IntPtr left, IntPtr right, IntPtr disparity, IntPtr stream); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_StereoBM_GPU_checkIfGpuCallReasonable(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe int* cuda_StereoBM_GPU_preset(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe int* cuda_StereoBM_GPU_ndisp(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe int* cuda_StereoBM_GPU_winSize(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe float* cuda_StereoBM_GPU_avergeTexThreshold(IntPtr obj); + #endregion + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/cuda/NativeMethods_cuda_GpuMat.cs b/src/OpenCvSharp/PInvoke/cuda/NativeMethods_cuda_GpuMat.cs new file mode 100644 index 000000000..be2a66254 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/cuda/NativeMethods_cuda_GpuMat.cs @@ -0,0 +1,151 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + static partial class NativeMethods + { + #region Init & Disposal + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_GpuMat_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_new2(int rows, int cols, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_new3(int rows, int cols, int type, IntPtr data, ulong step); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_new4(IntPtr mat); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_new5(IntPtr gpumat); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_new6(Size size, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_new7(Size size, int type, IntPtr data, ulong step); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_new8(int rows, int cols, int type, Scalar s); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_new9(IntPtr m, Range rowRange, Range colRange); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_new10(IntPtr m, Rect roi); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_new11(Size size, int type, Scalar s); + + #endregion + + #region Operators + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_opToMat(IntPtr src); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_opToGpuMat(IntPtr src); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_GpuMat_opAssign(IntPtr left, IntPtr right); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_opRange1(IntPtr src, Rect roi); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_opRange2(IntPtr src, Range rowRange, Range colRange); + + #endregion + + #region Fields + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_GpuMat_flags(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_GpuMat_rows(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_GpuMat_cols(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong cuda_GpuMat_step(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe byte* cuda_GpuMat_data(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_refcount(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_datastart(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_dataend(IntPtr obj); + #endregion + + #region Methods + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_GpuMat_upload(IntPtr obj, IntPtr mat); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_GpuMat_download(IntPtr obj, IntPtr mat); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_row(IntPtr obj, int y); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_col(IntPtr obj, int x); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_rowRange(IntPtr obj, int startrow, int endrow); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_colRange(IntPtr obj, int startcol, int endcol); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_clone(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_GpuMat_copyTo1(IntPtr obj, IntPtr m); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_GpuMat_copyTo2(IntPtr obj, IntPtr m, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_GpuMat_convertTo(IntPtr obj, IntPtr m, int rtype, double alpha, double beta); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_GpuMat_assignTo(IntPtr obj, IntPtr m, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_setTo(IntPtr obj, Scalar s, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_reshape(IntPtr obj, int cn, int rows); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_GpuMat_create1(IntPtr obj, int rows, int cols, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_GpuMat_create2(IntPtr obj, Size size, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_GpuMat_release(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_GpuMat_swap(IntPtr obj, IntPtr mat); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_GpuMat_locateROI(IntPtr obj, out Size wholeSize, out Point ofs); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_GpuMat_adjustROI(IntPtr obj, int dtop, int dbottom, int dleft, int drightt); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_GpuMat_isContinuous(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong cuda_GpuMat_elemSize(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong cuda_GpuMat_elemSize1(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_GpuMat_type(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_GpuMat_depth(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_GpuMat_channels(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong cuda_GpuMat_step1(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Size cuda_GpuMat_size(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int cuda_GpuMat_empty(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern unsafe byte* cuda_GpuMat_ptr(IntPtr obj, int y); + #endregion + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_createContinuous1( + int rows, int cols, int type, IntPtr gm); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr cuda_createContinuous2( + int rows, int cols, int type); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void cuda_ensureSizeIsEnough( + int rows, int cols, int type, IntPtr m); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d.cs b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d.cs new file mode 100644 index 000000000..728c43450 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d.cs @@ -0,0 +1,65 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + // ReSharper disable InconsistentNaming + + // DenseFeatureDetector + /* + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_DenseFeatureDetector_new( + float initFeatureScale, int featureScaleLevels, float featureScaleMul, + int initXyStep, int initImgBound, int varyXyStepWithScale, int varyImgBoundWithScale); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_DenseFeatureDetector_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_DenseFeatureDetector_info(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_Ptr_DenseFeatureDetector_get(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Ptr_DenseFeatureDetector_delete(IntPtr ptr); + */ + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_drawKeypoints(IntPtr image, KeyPoint[] keypoints, int keypointsLength, + IntPtr outImage, Scalar color, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_drawMatches1(IntPtr img1, KeyPoint[] keypoints1, int keypoints1Length, + IntPtr img2, KeyPoint[] keypoints2, int keypoints2Length, + DMatch[] matches1to2, int matches1to2Length, IntPtr outImg, + Scalar matchColor, Scalar singlePointColor, + byte[] matchesMask, int matchesMaskLength, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_drawMatches2(IntPtr img1, KeyPoint[] keypoints1, int keypoints1Length, + IntPtr img2, KeyPoint[] keypoints2, int keypoints2Length, + IntPtr[] matches1to2, int matches1to2Size1, int[] matches1to2Size2, + IntPtr outImg, Scalar matchColor, Scalar singlePointColor, + IntPtr[] matchesMask, int matchesMaskSize1, int[] matchesMaskSize2, int flags); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_evaluateFeatureDetector( + IntPtr img1, IntPtr img2, IntPtr H1to2, + IntPtr keypoints1, IntPtr keypoints2, + out float repeatability, out int correspCount); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_computeRecallPrecisionCurve( + IntPtr[] matches1to2, int matches1to2Size1, int[] matches1to2Size2, + IntPtr[] correctMatches1to2Mask, int correctMatches1to2MaskSize1, int[] correctMatches1to2MaskSize2, + IntPtr recallPrecisionCurve); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float features2d_getRecall( + Point2f[] recallPrecisionCurve, int recallPrecisionCurveSize, float l_precision); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_getNearestPoint( + Point2f[] recallPrecisionCurve, int recallPrecisionCurveSize, float l_precision); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_AKAZE.cs b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_AKAZE.cs new file mode 100644 index 000000000..003f36b11 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_AKAZE.cs @@ -0,0 +1,58 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + // ReSharper disable InconsistentNaming + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_AKAZE_create( + int descriptor_type, int descriptor_size, int descriptor_channels, + float threshold, int nOctaves, int nOctaveLayers, int diffusivity); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Ptr_AKAZE_delete(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_Ptr_AKAZE_get(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_AKAZE_setDescriptorType(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_AKAZE_getDescriptorType(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_AKAZE_setDescriptorSize(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_AKAZE_getDescriptorSize(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_AKAZE_setDescriptorChannels(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_AKAZE_getDescriptorChannels(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_AKAZE_setThreshold(IntPtr obj, double val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double features2d_AKAZE_getThreshold(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_AKAZE_setNOctaves(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_AKAZE_getNOctaves(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_AKAZE_setNOctaveLayers(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_AKAZE_getNOctaveLayers(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_AKAZE_setDiffusivity(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_AKAZE_getDiffusivity(IntPtr obj); + } +} diff --git a/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_AgastFeatureDetector.cs b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_AgastFeatureDetector.cs new file mode 100644 index 000000000..00b503db8 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_AgastFeatureDetector.cs @@ -0,0 +1,41 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + // ReSharper disable InconsistentNaming + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_AGAST(IntPtr image, IntPtr keypoints, + int threshold, int nonmaxSuppression, int type); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_AgastFeatureDetector_create( + int threshold, int nonmaxSuppression, int type); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Ptr_AgastFeatureDetector_delete(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_Ptr_AgastFeatureDetector_get(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_AgastFeatureDetector_setThreshold(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_AgastFeatureDetector_getThreshold(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_AgastFeatureDetector_setNonmaxSuppression(IntPtr obj,int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_AgastFeatureDetector_getNonmaxSuppression(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_AgastFeatureDetector_setType(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_AgastFeatureDetector_getType(IntPtr obj); + } +} diff --git a/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_BRISK.cs b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_BRISK.cs new file mode 100644 index 000000000..fe333588d --- /dev/null +++ b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_BRISK.cs @@ -0,0 +1,28 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + // ReSharper disable InconsistentNaming + + // BRISK + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_BRISK_create1(int thresh, int octaves, float patternScale); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_BRISK_create2( + float[] radiusList, int radiusListLength, int[] numberList, int numberListLength, + float dMax, float dMin, + int[] indexChange, int indexChangeLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Ptr_BRISK_delete(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_Ptr_BRISK_get(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_BRISK_info(IntPtr obj); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_DescriptorExtractor.cs b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_DescriptorExtractor.cs new file mode 100644 index 000000000..3bdb43ce6 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_DescriptorExtractor.cs @@ -0,0 +1,37 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + // DescriptorExtractor + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_DescriptorExtractor_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_DescriptorExtractor_compute1( + IntPtr obj, IntPtr image, IntPtr keypoint, IntPtr descriptors); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_DescriptorExtractor_compute2( + IntPtr obj, IntPtr[] images, int imagesSize, IntPtr keypoints, + IntPtr[] descriptors, int descriptorsSize); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_DescriptorExtractor_descriptorSize(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_DescriptorExtractor_descriptorType(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_DescriptorExtractor_empty(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_DescriptorExtractor_info(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_DescriptorExtractor_create( + [MarshalAs(UnmanagedType.LPStr)] string descriptorExtractorType); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_Ptr_DescriptorExtractor_get(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Ptr_DescriptorExtractor_delete(IntPtr ptr); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_DescriptorMatcher.cs b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_DescriptorMatcher.cs new file mode 100644 index 000000000..8354ba020 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_DescriptorMatcher.cs @@ -0,0 +1,102 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + // DescriptorMatcher + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_DescriptorMatcher_add(IntPtr obj, IntPtr[] descriptors, + int descriptorLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_DescriptorMatcher_getTrainDescriptors(IntPtr obj, + IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_DescriptorMatcher_clear(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_DescriptorMatcher_empty(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_DescriptorMatcher_isMaskSupported(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_DescriptorMatcher_train(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_DescriptorMatcher_match1(IntPtr obj, + IntPtr queryDescriptors, IntPtr trainDescriptors, IntPtr matches, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_DescriptorMatcher_knnMatch1(IntPtr obj, + IntPtr queryDescriptors, IntPtr trainDescriptors, IntPtr matches, int k, + IntPtr mask, int compactResult); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_DescriptorMatcher_radiusMatch1(IntPtr obj, + IntPtr queryDescriptors,IntPtr trainDescriptors, IntPtr matches, float maxDistance, + IntPtr mask, int compactResult); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_DescriptorMatcher_match2( + IntPtr obj, IntPtr queryDescriptors, IntPtr matches, + IntPtr[] masks, int masksSize); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_DescriptorMatcher_knnMatch2( + IntPtr obj, IntPtr queryDescriptors, IntPtr matches, + int k, IntPtr[] masks, int masksSize, int compactResult); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_DescriptorMatcher_radiusMatch2( + IntPtr obj, IntPtr queryDescriptors, IntPtr matches, + float maxDistance, IntPtr[] masks, int masksSize, int compactResult); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern IntPtr features2d_DescriptorMatcher_create([MarshalAs(UnmanagedType.LPStr)] string descriptorMatcherType); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_DescriptorMatcher_info(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_Ptr_DescriptorMatcher_get(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Ptr_DescriptorMatcher_delete(IntPtr ptr); + + // BFMatcher + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_BFMatcher_new(int normType, int crossCheck); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_BFMatcher_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_BFMatcher_isMaskSupported(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_BFMatcher_info(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_Ptr_BFMatcher_get(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Ptr_BFMatcher_delete(IntPtr ptr); + + // FlannBasedMatcher + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_FlannBasedMatcher_new( + IntPtr indexParams, IntPtr searchParams); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_FlannBasedMatcher_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_FlannBasedMatcher_add( + IntPtr obj, IntPtr[] descriptors, int descriptorsSize); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_FlannBasedMatcher_clear(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_FlannBasedMatcher_train(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_FlannBasedMatcher_isMaskSupported(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_FlannBasedMatcher_info(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_Ptr_FlannBasedMatcher_get(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Ptr_FlannBasedMatcher_delete(IntPtr ptr); + + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_FastFeatureDetector.cs b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_FastFeatureDetector.cs new file mode 100644 index 000000000..4d66e3779 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_FastFeatureDetector.cs @@ -0,0 +1,40 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + // ReSharper disable InconsistentNaming + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_FAST1(IntPtr image, IntPtr keypoints, int threshold, int nonmaxSupression); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_FAST2(IntPtr image, IntPtr keypoints, int threshold, int nonmaxSupression, int type); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_FastFeatureDetector_create(int threshold, int nonmaxSuppression); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Ptr_FastFeatureDetector_delete(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_FastFeatureDetector_info(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_Ptr_FastFeatureDetector_get(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_FastFeatureDetector_setThreshold(IntPtr obj, int threshold); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_FastFeatureDetector_getThreshold(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_FastFeatureDetector_setNonmaxSuppression(IntPtr obj, int f); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_FastFeatureDetector_getNonmaxSuppression(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_FastFeatureDetector_setType(IntPtr obj, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_FastFeatureDetector_getType(IntPtr obj); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_Feature2D.cs b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_Feature2D.cs new file mode 100644 index 000000000..db1444e2f --- /dev/null +++ b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_Feature2D.cs @@ -0,0 +1,45 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + // ReSharper disable InconsistentNaming + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_Ptr_Feature2D_get(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Ptr_Feature2D_delete(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Feature2D_detect_Mat1(IntPtr detector, IntPtr image, IntPtr keypoints, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Feature2D_detect_Mat2(IntPtr detector, IntPtr[] images, int imageLength, IntPtr keypoints, IntPtr[] mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Feature2D_detect_InputArray(IntPtr detector, IntPtr image, IntPtr keypoints, IntPtr mask); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Feature2D_compute1(IntPtr obj, IntPtr image, IntPtr keypoints, IntPtr descriptors); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Feature2D_compute2( + IntPtr detector, IntPtr[] images, int imageLength, + IntPtr keypoints, IntPtr[] descriptors, int descriptorsLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Feature2D_detectAndCompute( + IntPtr detector, IntPtr image, IntPtr mask, + IntPtr keypoints, IntPtr descriptors, int useProvidedKeypoints); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_Feature2D_descriptorSize(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_Feature2D_descriptorType(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_Feature2D_defaultNorm(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_Feature2D_empty(IntPtr obj); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_GFTTDetector.cs b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_GFTTDetector.cs new file mode 100644 index 000000000..319e9c0e7 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_GFTTDetector.cs @@ -0,0 +1,50 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + // ReSharper disable InconsistentNaming + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_GFTTDetector_create(int maxCorners, double qualityLevel, + double minDistance, int blockSize, int useHarrisDetector, double k); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_GFTTDetector_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_GFTTDetector_info(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_Ptr_GFTTDetector_get(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Ptr_GFTTDetector_delete(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_GFTTDetector_setMaxFeatures(IntPtr obj, int maxFeatures); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_GFTTDetector_getMaxFeatures(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_GFTTDetector_setQualityLevel(IntPtr obj, double qlevel); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double features2d_GFTTDetector_getQualityLevel(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_GFTTDetector_setMinDistance(IntPtr obj, double minDistance); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double features2d_GFTTDetector_getMinDistance(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_GFTTDetector_setBlockSize(IntPtr obj, int blockSize); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_GFTTDetector_getBlockSize(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_GFTTDetector_setHarrisDetector(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_GFTTDetector_getHarrisDetector(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_GFTTDetector_setK(IntPtr obj, double k); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double features2d_GFTTDetector_getK(IntPtr obj); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_KAZE.cs b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_KAZE.cs new file mode 100644 index 000000000..2f5319049 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_KAZE.cs @@ -0,0 +1,55 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + // ReSharper disable InconsistentNaming + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_KAZE_create(bool extended, bool upright, float threshold, + int nOctaves, int nOctaveLayers, int diffusivity); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Ptr_KAZE_delete(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_KAZE_info(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_Ptr_KAZE_get(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_KAZE_setDiffusivity(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_KAZE_getDiffusivity(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_KAZE_setExtended(IntPtr obj, bool val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern bool features2d_KAZE_getExtended(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_KAZE_setNOctaveLayers(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_KAZE_getNOctaveLayers(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_KAZE_setNOctaves(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_KAZE_getNOctaves(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_KAZE_setThreshold(IntPtr obj, double val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double features2d_KAZE_getThreshold(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_KAZE_setUpright(IntPtr obj, bool val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern bool features2d_KAZE_getUpright(IntPtr obj); + } +} diff --git a/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_KeyPointsFilter.cs b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_KeyPointsFilter.cs new file mode 100644 index 000000000..007755a8e --- /dev/null +++ b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_KeyPointsFilter.cs @@ -0,0 +1,32 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + // ReSharper disable InconsistentNaming + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_KeyPointsFilter_runByImageBorder( + IntPtr keypoints, Size imageSize, int borderSize); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_KeyPointsFilter_runByKeypointSize( + IntPtr keypoints, float minSize, float maxSize); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_KeyPointsFilter_runByPixelsMask( + IntPtr keypoints, IntPtr mask); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_KeyPointsFilter_removeDuplicated( + IntPtr keypoints); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_KeyPointsFilter_retainBest( + IntPtr keypoints, int npoints); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_MSER.cs b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_MSER.cs new file mode 100644 index 000000000..c07aad665 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_MSER.cs @@ -0,0 +1,49 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + // ReSharper disable InconsistentNaming + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_MSER_create(int delta, int minArea, int maxArea, + double maxVariation, double minDiversity, int maxEvolution, + double areaThreshold, double minMargin, int edgeBlurSize); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Ptr_MSER_delete(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_MSER_detect(IntPtr obj, IntPtr image, out IntPtr msers, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_MSER_info(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_Ptr_MSER_get(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_MSER_detectRegions( + IntPtr obj, IntPtr image, + IntPtr msers, + IntPtr bboxes); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_MSER_setDelta(IntPtr obj, int delta); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_MSER_getDelta(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_MSER_setMinArea(IntPtr obj, int minArea); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_MSER_getMinArea(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_MSER_setMaxArea(IntPtr obj, int maxArea); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_MSER_getMaxArea(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_MSER_setPass2Only(IntPtr obj, int f); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_MSER_getPass2Only(IntPtr obj); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_ORB.cs b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_ORB.cs new file mode 100644 index 000000000..db7f72e09 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_ORB.cs @@ -0,0 +1,71 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + // ReSharper disable InconsistentNaming + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_ORB_create(int nFeatures, float scaleFactor, int nlevels, + int edgeThreshold, + int firstLevel, int wtaK, int scoreType, int patchSize); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Ptr_ORB_delete(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_ORB_info(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_Ptr_ORB_get(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_ORB_setMaxFeatures(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_ORB_getMaxFeatures(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_ORB_setScaleFactor(IntPtr obj, double val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double features2d_ORB_getScaleFactor(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_ORB_setNLevels(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_ORB_getNLevels(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_ORB_setEdgeThreshold(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_ORB_getEdgeThreshold(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_ORB_setFirstLevel(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_ORB_getFirstLevel(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_ORB_setWTA_K(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_ORB_getWTA_K(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_ORB_setScoreType(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_ORB_getScoreType(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_ORB_setPatchSize(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_ORB_getPatchSize(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_ORB_setFastThreshold(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int features2d_ORB_getFastThreshold(IntPtr obj); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_SimpleBlobDetector.cs b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_SimpleBlobDetector.cs new file mode 100644 index 000000000..981f27f5c --- /dev/null +++ b/src/OpenCvSharp/PInvoke/features2d/NativeMethods_features2d_SimpleBlobDetector.cs @@ -0,0 +1,20 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + // ReSharper disable InconsistentNaming + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_SimpleBlobDetector_create( + ref SimpleBlobDetector.WParams parameters); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr features2d_Ptr_SimpleBlobDetector_get(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void features2d_Ptr_SimpleBlobDetector_delete(IntPtr ptr); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/imgproc/NativeMethods_imgproc.cs b/src/OpenCvSharp/PInvoke/imgproc/NativeMethods_imgproc.cs new file mode 100644 index 000000000..a8bcd8eae --- /dev/null +++ b/src/OpenCvSharp/PInvoke/imgproc/NativeMethods_imgproc.cs @@ -0,0 +1,459 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_getGaussianKernel( + int ksize, double sigma, int ktype); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_getDerivKernels( + IntPtr kx, IntPtr ky,int dx, int dy, int ksize, int normalize, int ktype); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_getGaborKernel(Size ksize, double sigma, double theta, double lambd, double gamma, double psi, int ktype); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_getStructuringElement(int shape, Size ksize, Point anchor); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_copyMakeBorder(IntPtr src, IntPtr dst, int top, int bottom, int left, + int right, int borderType, Scalar value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_medianBlur(IntPtr src, IntPtr dst, int ksize); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GaussianBlur(IntPtr src, IntPtr dst, Size ksize, double sigmaX, + double sigmaY, int borderType); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_bilateralFilter(IntPtr src, IntPtr dst, int d, double sigmaColor, + double sigmaSpace, int borderType); + + /* + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_adaptiveBilateralFilter(IntPtr src, IntPtr dst, Size ksize, + double sigmaSpace, double maxSigmaColor, CvPoint anchor, int borderType); + */ + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_boxFilter(IntPtr src, IntPtr dst, int ddepth, Size ksize, Point anchor, + int normalize, int borderType); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_blur(IntPtr src, IntPtr dst, Size ksize, Point anchor, int borderType); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_filter2D(IntPtr src, IntPtr dst, int ddepth, IntPtr kernel, Point anchor, double delta, int borderType); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_sepFilter2D(IntPtr src, IntPtr dst, int ddepth, IntPtr kernelX, IntPtr kernelY, Point anchor, double delta, int borderType); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_Sobel(IntPtr src, IntPtr dst, int ddepth, + int dx, int dy, int ksize, double scale, double delta, int borderType); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_Scharr(IntPtr src, IntPtr dst, int ddepth, + int dx, int dy, double scale, double delta, int borderType); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_Laplacian(IntPtr src, IntPtr dst, int ddepth, + int ksize, double scale, double delta, int borderType); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_Canny(IntPtr src, IntPtr edges, + double threshold1, double threshold2, int apertureSize, int L2gradient); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_cornerEigenValsAndVecs(IntPtr src, IntPtr dst,int blockSize, int ksize, int borderType); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_preCornerDetect(IntPtr src, IntPtr dst, int ksize, int borderType); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_cornerSubPix(IntPtr image, IntPtr corners, + Size winSize, Size zeroZone, TermCriteria criteria); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_goodFeaturesToTrack(IntPtr src, IntPtr corners, + int maxCorners, double qualityLevel, double minDistance, IntPtr mask, int blockSize, int useHarrisDetector, double k); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_HoughLines(IntPtr src, IntPtr lines, + double rho, double theta, int threshold, double srn, double stn); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_HoughLinesP(IntPtr src, IntPtr lines, + double rho, double theta, int threshold, double minLineLength, double maxLineG); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_HoughCircles(IntPtr src, IntPtr circles, + int method, double dp, double minDist, double param1, double param2, int minRadius, int maxRadius); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_erode(IntPtr src, IntPtr dst, IntPtr kernel, Point anchor, int iterations, int borderType, Scalar borderValue); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_dilate(IntPtr src, IntPtr dst, IntPtr kernel, Point anchor, int iterations, int borderType, Scalar borderValue); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_morphologyEx(IntPtr src, IntPtr dst, int op, IntPtr kernel, Point anchor, int iterations, int borderType, Scalar borderValue); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_resize(IntPtr src, IntPtr dst, Size dsize, double fx, double fy, int interpolation); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_warpAffine(IntPtr src, IntPtr dst, IntPtr m, Size dsize, int flags, int borderMode, Scalar borderValue); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_warpPerspective_MisInputArray( + IntPtr src, IntPtr dst, IntPtr m, Size dsize, int flags, int borderMode, Scalar borderValue); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_warpPerspective_MisArray( + IntPtr src, IntPtr dst, [MarshalAs(UnmanagedType.LPArray)] float[,] m, int mRow, int mCol, + Size dsize, int flags, int borderMode, Scalar borderValue); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_remap(IntPtr src, IntPtr dst, IntPtr map1, IntPtr map2, int interpolation, int borderMode, Scalar borderValue); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_convertMaps(IntPtr map1, IntPtr map2, IntPtr dstmap1, IntPtr dstmap2, int dstmap1Type, int nninterpolation); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_getRotationMatrix2D(Point2f center, double angle, double scale); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_invertAffineTransform(IntPtr m, IntPtr im); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_getPerspectiveTransform1(Point2f[] src, Point2f[] dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_getPerspectiveTransform2(IntPtr src, IntPtr dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_getAffineTransform1(Point2f[] src, Point2f[] dst); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_getAffineTransform2(IntPtr src, IntPtr dst); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_getRectSubPix(IntPtr image, Size patchSize, Point2f center, IntPtr patch, int patchType); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_logPolar( + IntPtr src, IntPtr dst, Point2f center, double m, int flags); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_linearPolar( + IntPtr src, IntPtr dst, Point2f center, double maxRadius, int flags); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_integral1(IntPtr src, IntPtr sum, int sdepth); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_integral2(IntPtr src, IntPtr sum, IntPtr sqsum, int sdepth); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_integral3(IntPtr src, IntPtr sum, IntPtr sqsum, IntPtr tilted, int sdepth); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_accumulate(IntPtr src, IntPtr dst, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_accumulateSquare(IntPtr src, IntPtr dst, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_accumulateProduct(IntPtr src1, IntPtr src2, IntPtr dst, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_accumulateWeighted(IntPtr src, IntPtr dst, double alpha, IntPtr mask); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_PSNR(IntPtr src1, IntPtr src2); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Point2d imgproc_phaseCorrelate(IntPtr src1, IntPtr src2, IntPtr window); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Point2d imgproc_phaseCorrelateRes(IntPtr src1, IntPtr src2, IntPtr window, out double response); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_createHanningWindow(IntPtr dst, Size winSize, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_threshold(IntPtr src, IntPtr dst, double thresh, double maxval, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_adaptiveThreshold(IntPtr src, IntPtr dst, + double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double c); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_pyrDown(IntPtr src, IntPtr dst, Size dstsize, int borderType); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_pyrUp(IntPtr src, IntPtr dst, Size dstsize, int borderType); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_undistort(IntPtr src, IntPtr dst, + IntPtr cameraMatrix, IntPtr distCoeffs, IntPtr newCameraMatrix); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_initUndistortRectifyMap(IntPtr cameraMatrix,IntPtr distCoeffs, + IntPtr r, IntPtr newCameraMatrix, Size size, int m1Type, IntPtr map1, IntPtr map2); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float imgproc_initWideAngleProjMap(IntPtr cameraMatrix, IntPtr distCoeffs, + Size imageSize, int destImageWidth, int m1Type, IntPtr map1, IntPtr map2, + int projType, double alpha); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_getDefaultNewCameraMatrix(IntPtr cameraMatrix, Size imgSize, + int centerPrincipalPoint); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_undistortPoints(IntPtr src, IntPtr dst, + IntPtr cameraMatrix, IntPtr distCoeffs, IntPtr r, IntPtr p); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_calcHist1(IntPtr[] images, int nimages, + int[] channels, IntPtr mask, IntPtr hist, int dims, int[] histSize, + IntPtr[] ranges, int uniform, int accumulate); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_calcBackProject(IntPtr[] images, int nimages, + int[] channels, IntPtr hist, IntPtr backProject, + IntPtr[] ranges, int uniform); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_compareHist1(IntPtr h1, IntPtr h2, int method); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_equalizeHist(IntPtr src, IntPtr dst); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float imgproc_EMD(IntPtr signature1, IntPtr signature2, + int distType, IntPtr cost, out float lowerBound, IntPtr flow); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_watershed(IntPtr image, IntPtr markers); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_pyrMeanShiftFiltering(IntPtr src, IntPtr dst, + double sp, double sr, int maxLevel, TermCriteria termcrit); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_grabCut(IntPtr img, IntPtr mask, Rect rect, + IntPtr bgdModel, IntPtr fgdModel, + int iterCount, int mode); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_distanceTransformWithLabels(IntPtr src, IntPtr dst, IntPtr labels, + int distanceType, int maskSize, int labelType); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_distanceTransform(IntPtr src, IntPtr dst, + int distanceType, int maskSize); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "imgproc_floodFill1")] + public static extern int imgproc_floodFill(IntPtr image, + Point seedPoint, Scalar newVal, out Rect rect, + Scalar loDiff, Scalar upDiff, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "imgproc_floodFill2")] + public static extern int imgproc_floodFill(IntPtr image, IntPtr mask, + Point seedPoint, Scalar newVal, out Rect rect, + Scalar loDiff, Scalar upDiff, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_cvtColor(IntPtr src, IntPtr dst, int code, int dstCn); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Moments.NativeStruct imgproc_moments(IntPtr arr, int binaryImage); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_matchTemplate( + IntPtr image, IntPtr templ, IntPtr result, int method, IntPtr mask); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_connectedComponents( + IntPtr image, IntPtr labels, int connectivity, int ltype); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_connectedComponentsWithStats( + IntPtr image, IntPtr labels, IntPtr stats, IntPtr centroids, int connectivity, int ltype); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_findContours1_vector(IntPtr image, out IntPtr contours, + out IntPtr hierarchy, int mode, int method, Point offset); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_findContours1_OutputArray(IntPtr image, out IntPtr contours, + IntPtr hierarchy, int mode, int method, Point offset); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_findContours2_vector(IntPtr image, out IntPtr contours, + int mode, int method, Point offset); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_findContours2_OutputArray(IntPtr image, out IntPtr contours, + int mode, int method, Point offset); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_drawContours_vector(IntPtr image, + IntPtr[] contours, int contoursSize1, int[] contoursSize2, + int contourIdx, Scalar color, int thickness, int lineType, + Vec4i[] hierarchy, int hiearchyLength, int maxLevel, Point offset); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_drawContours_vector(IntPtr image, + IntPtr[] contours, int contoursSize1, int[] contoursSize2, + int contourIdx, Scalar color, int thickness, int lineType, + IntPtr hierarchy, int hiearchyLength, int maxLevel, Point offset); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_drawContours_InputArray(IntPtr image, + IntPtr[] contours, int contoursLength, + int contourIdx, Scalar color, int thickness, int lineType, + IntPtr hierarchy, int maxLevel, Point offset); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_approxPolyDP_InputArray(IntPtr curve, IntPtr approxCurve, + double epsilon, int closed); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_approxPolyDP_Point(Point[] curve, int curveLength, + out IntPtr approxCurve, double epsilon, int closed); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_approxPolyDP_Point2f(Point2f[] curve, int curveLength, + out IntPtr approxCurve, double epsilon, int closed); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_arcLength_InputArray(IntPtr curve, int closed); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_arcLength_Point(Point[] curve, int curveLength, int closed); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_arcLength_Point2f(Point2f[] curve, int curveLength, int closed); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Rect imgproc_boundingRect_InputArray(IntPtr curve); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Rect imgproc_boundingRect_Point(Point[] curve, int curveLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Rect imgproc_boundingRect_Point2f(Point2f[] curve, int curveLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_contourArea_InputArray(IntPtr contour, int oriented); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_contourArea_Point(Point[] contour, int contourLength, int oriented); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_contourArea_Point2f(Point2f[] contour, int contourLength, int oriented); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern RotatedRect imgproc_minAreaRect_InputArray(IntPtr points); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern RotatedRect imgproc_minAreaRect_Point(Point[] points, int pointsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern RotatedRect imgproc_minAreaRect_Point2f(Point2f[] points, int pointsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_minEnclosingCircle_InputArray(IntPtr points, out Point2f center, out float radius); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_minEnclosingCircle_Point(Point[] points, int pointsLength, + out Point2f center, out float radius); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_minEnclosingCircle_Point2f(Point2f[] points, int pointsLength, + out Point2f center, out float radius); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_matchShapes_InputArray(IntPtr contour1, IntPtr contour2, + int method, double parameter); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_matchShapes_Point(Point[] contour1, int contour1Length, + Point[] contour2, int contour2Length, int method, double parameter); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_convexHull_InputArray(IntPtr points, IntPtr hull, + int clockwise, int returnPoints); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_convexHull_Point_ReturnsPoints(Point[] points, int pointsLength, + out IntPtr hull, int clockwise); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_convexHull_Point2f_ReturnsPoints(Point2f[] points, int pointsLength, + out IntPtr hull, int clockwise); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_convexHull_Point_ReturnsIndices(Point[] points, int pointsLength, + out IntPtr hull, int clockwise); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_convexHull_Point2f_ReturnsIndices(Point2f[] points, int pointsLength, + out IntPtr hull, int clockwise); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_convexityDefects_InputArray(IntPtr contour, IntPtr convexHull, + IntPtr convexityDefects); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_convexityDefects_Point(Point[] contour, int contourLength, int[] convexHull, + int convexHullLength, out IntPtr convexityDefects); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_convexityDefects_Point2f(Point2f[] contour, int contourLength, + int[] convexHull, int convexHullLength, out IntPtr convexityDefects); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_isContourConvex_InputArray(IntPtr contour); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_isContourConvex_Point(Point[] contour, int contourLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_isContourConvex_Point2f(Point2f[] contour, int contourLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float imgproc_intersectConvexConvex_InputArray(IntPtr p1, IntPtr p2, + IntPtr p12, int handleNested); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float imgproc_intersectConvexConvex_Point(Point[] p1, int p1Length, Point[] p2, + int p2Length,out IntPtr p12, int handleNested); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float imgproc_intersectConvexConvex_Point2f(Point2f[] p1, int p1Length, Point2f[] p2, + int p2Length,out IntPtr p12, int handleNested); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern RotatedRect imgproc_fitEllipse_InputArray(IntPtr points); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern RotatedRect imgproc_fitEllipse_Point(Point[] points, int pointsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern RotatedRect imgproc_fitEllipse_Point2f(Point2f[] points, int pointsLength); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_fitLine_InputArray(IntPtr points, IntPtr line, + int distType, double param, double reps, double aeps); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_fitLine_Point(Point[] points, int pointsLength, [In, Out] float[] line, int distType, + double param, double reps, double aeps); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_fitLine_Point2f(Point2f[] points, int pointsLength, [In, Out] float[] line, + int distType,double param, double reps, double aeps); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_fitLine_Point3i(Point3i[] points, int pointsLength, [In, Out] float[] line, + int distType,double param, double reps, double aeps); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_fitLine_Point3f(Point3f[] points, int pointsLength, [In, Out] float[] line, + int distType,double param, double reps, double aeps); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_pointPolygonTest_InputArray(IntPtr contour, Point2f pt, int measureDist); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_pointPolygonTest_Point(Point[] contour, int contourLength, Point2f pt, + int measureDist); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_pointPolygonTest_Point2f(Point2f[] contour, int contourLength, + Point2f pt, int measureDist); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_rotatedRectangleIntersection_OutputArray( + RotatedRect rect1, RotatedRect rect2, IntPtr intersectingRegion); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_rotatedRectangleIntersection_vector( + RotatedRect rect1, RotatedRect rect2, IntPtr intersectingRegion); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_applyColorMap(IntPtr src, IntPtr dst, int colormap); + + + #region Drawing + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_line( + IntPtr img, Point pt1, Point pt2, Scalar color, int thickness, int lineType, int shift); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_arrowedLine( + IntPtr img, Point pt1, Point pt2, Scalar color, int thickness, int lineType, int shift, double tipLength); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_rectangle_InputOutputArray( + IntPtr img, Point pt1, Point pt2, Scalar color, int thickness, int lineType, int shift); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_rectangle_Mat( + IntPtr img, Rect rect, Scalar color, int thickness, int lineType, int shift); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_circle(IntPtr img, Point center, int radius, Scalar color, int thickness, int lineType, int shift); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_ellipse1(IntPtr img, Point center, Size axes, + double angle, double startAngle, double endAngle, Scalar color, int thickness, int lineType, int shift); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_ellipse2(IntPtr img, RotatedRect box, Scalar color, int thickness, int lineType); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_fillConvexPoly_Mat( + IntPtr img, Point[] pts, int npts, Scalar color, int lineType, int shift); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_fillConvexPoly_InputOutputArray( + IntPtr img, IntPtr points, Scalar color, int lineType, int shift); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_fillPoly_Mat( + IntPtr img, IntPtr[] pts, int[] npts, int ncontours, + Scalar color, int lineType, int shift, Point offset); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_fillPoly_InputOutputArray( + IntPtr img, IntPtr pts, Scalar color, int lineType, int shift, Point offset); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_polylines_Mat( + IntPtr img, IntPtr[] pts, int[] npts, + int ncontours, int isClosed, Scalar color, int thickness, int lineType, int shift); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_polylines_InputOutputArray( + IntPtr img, IntPtr pts, int isClosed, Scalar color, int thickness, int lineType, int shift); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_clipLine1(Size imgSize, ref Point pt1, ref Point pt2); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_clipLine2(Rect imgRect, ref Point pt1, ref Point pt2); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_ellipse2Poly( + Point center, Size axes, int angle, int arcStart, int arcEnd, int delta, IntPtr pts); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern void core_putText(IntPtr img, [MarshalAs(UnmanagedType.LPStr)] string text, Point org, + int fontFace, double fontScale, Scalar color, + int thickness, int lineType, int bottomLeftOrigin); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern Size core_getTextSize([MarshalAs(UnmanagedType.LPStr)] string text, int fontFace, + double fontScale, int thickness, out int baseLine); + + #endregion + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/imgproc/NativeMethods_imgproc_CLAHE.cs b/src/OpenCvSharp/PInvoke/imgproc/NativeMethods_imgproc_CLAHE.cs new file mode 100644 index 000000000..42c58c999 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/imgproc/NativeMethods_imgproc_CLAHE.cs @@ -0,0 +1,41 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_createCLAHE(double clipLimit, Size tileGridSize); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_Ptr_CLAHE_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_Ptr_CLAHE_get(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_CLAHE_info(IntPtr obj); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_CLAHE_apply(IntPtr obj, IntPtr src, IntPtr dst); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_CLAHE_setClipLimit(IntPtr obj, double clipLimit); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_CLAHE_getClipLimit(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_CLAHE_setTilesGridSize(IntPtr obj, Size tileGridSize); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Size imgproc_CLAHE_getTilesGridSize(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_CLAHE_collectGarbage(IntPtr obj); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/imgproc/NativeMethods_imgproc_GeneralizedHough.cs b/src/OpenCvSharp/PInvoke/imgproc/NativeMethods_imgproc_GeneralizedHough.cs new file mode 100644 index 000000000..61c8569ff --- /dev/null +++ b/src/OpenCvSharp/PInvoke/imgproc/NativeMethods_imgproc_GeneralizedHough.cs @@ -0,0 +1,185 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + // GeneralizedHough + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHough_setTemplate1( + IntPtr obj, IntPtr templ, Point templCenter); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHough_setTemplate2( + IntPtr obj, IntPtr edges, IntPtr dx, IntPtr dy, Point templCenter); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHough_detect1( + IntPtr obj, IntPtr image, IntPtr positions, IntPtr votes); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHough_detect2( + IntPtr obj, IntPtr edges, IntPtr dx, IntPtr dy, IntPtr positions, IntPtr votes); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHough_setCannyLowThresh(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_GeneralizedHough_getCannyLowThresh(IntPtr obj); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHough_setCannyHighThresh(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_GeneralizedHough_getCannyHighThresh(IntPtr obj); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHough_setMinDist(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_GeneralizedHough_getMinDist(IntPtr obj); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHough_setDp(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_GeneralizedHough_getDp(IntPtr obj); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHough_setMaxBufferSize(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_GeneralizedHough_getMaxBufferSize(IntPtr obj); + + + + // GeneralizedHoughBallard + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_createGeneralizedHoughBallard(); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_Ptr_GeneralizedHoughBallard_get(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_Ptr_GeneralizedHoughBallard_delete(IntPtr obj); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHoughBallard_setLevels(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_GeneralizedHoughBallard_getLevels(IntPtr obj); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHoughBallard_setVotesThreshold(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_GeneralizedHoughBallard_getVotesThreshold(IntPtr obj); + + + + // GeneralizedHoughGuil + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_createGeneralizedHoughGuil(); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_Ptr_GeneralizedHoughGuil_get(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_Ptr_GeneralizedHoughGuil_delete(IntPtr obj); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHoughGuil_setXi(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_GeneralizedHoughGuil_getXi(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHoughGuil_setLevels(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_GeneralizedHoughGuil_getLevels(IntPtr obj); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHoughGuil_setAngleEpsilon(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_GeneralizedHoughGuil_getAngleEpsilon(IntPtr obj); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHoughGuil_setMinAngle(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_GeneralizedHoughGuil_getMinAngle(IntPtr obj); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHoughGuil_setMaxAngle(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_GeneralizedHoughGuil_getMaxAngle(IntPtr obj); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHoughGuil_setAngleStep(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_GeneralizedHoughGuil_getAngleStep(IntPtr obj); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHoughGuil_setAngleThresh(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_GeneralizedHoughGuil_getAngleThresh(IntPtr obj); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHoughGuil_setMinScale(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_GeneralizedHoughGuil_getMinScale(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHoughGuil_setMaxScale(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_GeneralizedHoughGuil_getMaxScale(IntPtr obj); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHoughGuil_setScaleStep(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double imgproc_GeneralizedHoughGuil_getScaleStep(IntPtr obj); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHoughGuil_setScaleThresh(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_GeneralizedHoughGuil_getScaleThresh(IntPtr obj); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_GeneralizedHoughGuil_setPosThresh(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_GeneralizedHoughGuil_getPosThresh(IntPtr obj); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/imgproc/NativeMethods_imgproc_LineIterator.cs b/src/OpenCvSharp/PInvoke/imgproc/NativeMethods_imgproc_LineIterator.cs new file mode 100644 index 000000000..d4a281746 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/imgproc/NativeMethods_imgproc_LineIterator.cs @@ -0,0 +1,74 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_LineIterator_new( + IntPtr img, Point pt1, Point pt2, int connectivity, int leftToRight); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_LineIterator_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_LineIterator_operatorEntity(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_LineIterator_operatorPP(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Point imgproc_LineIterator_pos(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_LineIterator_ptr_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_LineIterator_ptr_set(IntPtr obj, IntPtr val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_LineIterator_ptr0_get(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_LineIterator_step_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_LineIterator_step_set(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_LineIterator_elemSize_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_LineIterator_elemSize_set(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_LineIterator_err_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_LineIterator_err_set(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_LineIterator_count_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_LineIterator_count_set(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_LineIterator_minusDelta_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_LineIterator_minusDelta_set(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_LineIterator_plusDelta_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_LineIterator_plusDelta_set(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_LineIterator_minusStep_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_LineIterator_minusStep_set(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_LineIterator_plusStep_get(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_LineIterator_plusStep_set(IntPtr obj, int val); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/imgproc/NativeMethods_imgproc_LineSegmentDetector.cs b/src/OpenCvSharp/PInvoke/imgproc/NativeMethods_imgproc_LineSegmentDetector.cs new file mode 100644 index 000000000..bce704036 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/imgproc/NativeMethods_imgproc_LineSegmentDetector.cs @@ -0,0 +1,33 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 +// ReSharper disable InconsistentNaming + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_LineSegmentDetector_detect(IntPtr obj, IntPtr image, IntPtr lines, + IntPtr width, IntPtr prec, IntPtr nfa); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_LineSegmentDetector_drawSegments(IntPtr obj, IntPtr image, IntPtr lines); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_LineSegmentDetector_compareSegments(IntPtr obj, Size size, + IntPtr lines1, IntPtr lines2, IntPtr image); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_createLineSegmentDetector( + int refine, double scale, double sigma_scale, double quant, double ang_th, + double log_eps, double density_th, int n_bins); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_Ptr_LineSegmentDetector_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr imgproc_Ptr_LineSegmentDetector_get(IntPtr obj); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/imgproc/NativeMethods_imgproc_Subdiv2D.cs b/src/OpenCvSharp/PInvoke/imgproc/NativeMethods_imgproc_Subdiv2D.cs new file mode 100644 index 000000000..44c0ff622 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/imgproc/NativeMethods_imgproc_Subdiv2D.cs @@ -0,0 +1,52 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "imgproc_Subdiv2D_new1")] + public static extern IntPtr imgproc_Subdiv2D_new(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "imgproc_Subdiv2D_new2")] + public static extern IntPtr imgproc_Subdiv2D_new(Rect rect); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_Subdiv2D_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_Subdiv2D_initDelaunay(IntPtr obj, Rect rect); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "imgproc_Subdiv2D_insert1")] + public static extern int imgproc_Subdiv2D_insert(IntPtr obj, Point2f pt); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, EntryPoint = "imgproc_Subdiv2D_insert2")] + public static extern void imgproc_Subdiv2D_insert(IntPtr obj, [MarshalAs(UnmanagedType.LPArray)] Point2f[] ptArray, int length); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_Subdiv2D_locate(IntPtr obj, Point2f pt, out int edge, out int vertex); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_Subdiv2D_findNearest(IntPtr obj, Point2f pt, out Point2f nearestPt); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_Subdiv2D_getEdgeList(IntPtr obj, out IntPtr edgeList); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_Subdiv2D_getTriangleList(IntPtr obj, out IntPtr triangleList); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_Subdiv2D_getVoronoiFacetList(IntPtr obj, [MarshalAs(UnmanagedType.LPArray)] int[] idx, int idxCount, + out IntPtr facetList, out IntPtr facetCenters); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void imgproc_Subdiv2D_getVoronoiFacetList(IntPtr obj, IntPtr idx, int idxCount, + out IntPtr facetList, out IntPtr facetCenters); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Point2f imgproc_Subdiv2D_getVertex(IntPtr obj, int vertex, out int firstEdge); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_Subdiv2D_getEdge(IntPtr obj, int edge, int nextEdgeType); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_Subdiv2D_nextEdge(IntPtr obj, int edge); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_Subdiv2D_rotateEdge(IntPtr obj, int edge, int rotate); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_Subdiv2D_symEdge(IntPtr obj, int edge); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_Subdiv2D_edgeOrg(IntPtr obj, int edge, out Point2f orgpt); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int imgproc_Subdiv2D_edgeDst(IntPtr obj, int edge, out Point2f dstpt); + + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml.cs b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml.cs new file mode 100644 index 000000000..8176f7fbf --- /dev/null +++ b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml.cs @@ -0,0 +1,11 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_ANN_MLP.cs b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_ANN_MLP.cs new file mode 100644 index 000000000..17bd6d2ab --- /dev/null +++ b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_ANN_MLP.cs @@ -0,0 +1,74 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_ANN_MLP_setTrainMethod(IntPtr obj, int method, double param1, double param2); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_ANN_MLP_getTrainMethod(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_ANN_MLP_setActivationFunction(IntPtr obj, int type, double param1, double param2); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_ANN_MLP_setLayerSizes(IntPtr obj, IntPtr layerSizes); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_ANN_MLP_getLayerSizes(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern TermCriteria ml_ANN_MLP_getTermCriteria(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_ANN_MLP_setTermCriteria(IntPtr obj, TermCriteria val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double ml_ANN_MLP_getBackpropWeightScale(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_ANN_MLP_setBackpropWeightScale(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double ml_ANN_MLP_getBackpropMomentumScale(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_ANN_MLP_setBackpropMomentumScale(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double ml_ANN_MLP_getRpropDW0(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_ANN_MLP_setRpropDW0(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double ml_ANN_MLP_getRpropDWPlus(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_ANN_MLP_setRpropDWPlus(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double ml_ANN_MLP_getRpropDWMinus(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_ANN_MLP_setRpropDWMinus(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double ml_ANN_MLP_getRpropDWMin(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_ANN_MLP_setRpropDWMin(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double ml_ANN_MLP_getRpropDWMax(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_ANN_MLP_setRpropDWMax(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_ANN_MLP_getWeights(IntPtr obj, int layerIdx); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_ANN_MLP_create(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_Ptr_ANN_MLP_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_Ptr_ANN_MLP_get(IntPtr obj); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_Boost.cs b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_Boost.cs new file mode 100644 index 000000000..6c6d610e8 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_Boost.cs @@ -0,0 +1,34 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_Boost_getBoostType(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_Boost_setBoostType(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_Boost_getWeakCount(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_Boost_setWeakCount(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double ml_Boost_getWeightTrimRate(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_Boost_setWeightTrimRate(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_Boost_create(); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_Ptr_Boost_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_Ptr_Boost_get(IntPtr obj); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_DTrees.cs b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_DTrees.cs new file mode 100644 index 000000000..bc4bfea6b --- /dev/null +++ b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_DTrees.cs @@ -0,0 +1,74 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_DTrees_getMaxCategories(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_DTrees_setMaxCategories(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_DTrees_getMaxDepth(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_DTrees_setMaxDepth(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_DTrees_getMinSampleCount(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_DTrees_setMinSampleCount(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_DTrees_getCVFolds(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_DTrees_setCVFolds(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_DTrees_getUseSurrogates(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_DTrees_setUseSurrogates(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_DTrees_getUse1SERule(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_DTrees_setUse1SERule(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_DTrees_getTruncatePrunedTree(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_DTrees_setTruncatePrunedTree(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float ml_DTrees_getRegressionAccuracy(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_DTrees_setRegressionAccuracy(IntPtr obj, float val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_DTrees_getPriors(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_DTrees_setPriors(IntPtr obj, IntPtr val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_DTrees_getRoots(IntPtr obj, IntPtr result); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_DTrees_getNodes(IntPtr obj, IntPtr result); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_DTrees_getSplits(IntPtr obj, IntPtr result); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_DTrees_getSubsets(IntPtr obj, IntPtr result); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_DTrees_create(); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_Ptr_DTrees_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_Ptr_DTrees_get(IntPtr obj); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_EM.cs b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_EM.cs new file mode 100644 index 000000000..01c82bd98 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_EM.cs @@ -0,0 +1,54 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_EM_getClustersNumber(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_EM_setClustersNumber(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_EM_getCovarianceMatrixType(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_EM_setCovarianceMatrixType(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern TermCriteria ml_EM_getTermCriteria(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_EM_setTermCriteria(IntPtr obj, TermCriteria val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_EM_getWeights(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_EM_getMeans(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_EM_getCovs(IntPtr obj, IntPtr covs); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern Vec2d ml_EM_predict2(IntPtr model, IntPtr sample, IntPtr probs); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_EM_trainEM( + IntPtr obj, IntPtr samples, IntPtr logLikelihoods, IntPtr labels, IntPtr probs); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_EM_trainE( + IntPtr model, IntPtr samples, IntPtr means0, IntPtr covs0, IntPtr weights0, + IntPtr logLikelihoods, IntPtr labels, IntPtr probs); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_EM_trainM( + IntPtr model, IntPtr samples, IntPtr probs0, IntPtr logLikelihoods, + IntPtr labels, IntPtr probs); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_EM_create(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_Ptr_EM_get(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_Ptr_EM_delete(IntPtr ptr); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_KNearest.cs b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_KNearest.cs new file mode 100644 index 000000000..8ea2f64d5 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_KNearest.cs @@ -0,0 +1,43 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_KNearest_getDefaultK(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_KNearest_setDefaultK(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_KNearest_getIsClassifier(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_KNearest_setIsClassifier(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_KNearest_getEmax(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_KNearest_setEmax(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_KNearest_getAlgorithmType(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_KNearest_setAlgorithmType(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float ml_KNearest_findNearest(IntPtr samples, int k, + IntPtr results, IntPtr neighborResponses, IntPtr dist); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_KNearest_create(); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_Ptr_KNearest_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_Ptr_KNearest_get(IntPtr obj); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_LogisticRegression.cs b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_LogisticRegression.cs new file mode 100644 index 000000000..a52b21c06 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_LogisticRegression.cs @@ -0,0 +1,54 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double ml_LogisticRegression_getLearningRate(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_LogisticRegression_setLearningRate(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_LogisticRegression_getIterations(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_LogisticRegression_setIterations(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_LogisticRegression_getRegularization(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_LogisticRegression_setRegularization(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_LogisticRegression_getTrainMethod(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_LogisticRegression_setTrainMethod(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_LogisticRegression_getMiniBatchSize(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_LogisticRegression_setMiniBatchSize(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern TermCriteria ml_LogisticRegression_getTermCriteria(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_LogisticRegression_setTermCriteria(IntPtr obj, TermCriteria val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float ml_LogisticRegression_predict( + IntPtr obj, IntPtr samples, IntPtr results, int flags); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_LogisticRegression_get_learnt_thetas(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_LogisticRegression_create(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_Ptr_LogisticRegression_delete(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_Ptr_LogisticRegression_get(IntPtr obj); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_NormalBayesClassifier.cs b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_NormalBayesClassifier.cs new file mode 100644 index 000000000..9dc9083de --- /dev/null +++ b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_NormalBayesClassifier.cs @@ -0,0 +1,24 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float ml_NormalBayesClassifier_predictProb( + IntPtr obj, IntPtr inputs, + IntPtr samples, IntPtr outputProbs, int flags); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_NormalBayesClassifier_create(); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_Ptr_NormalBayesClassifier_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_Ptr_NormalBayesClassifier_get(IntPtr obj); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_RTrees.cs b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_RTrees.cs new file mode 100644 index 000000000..3c3e4c3ad --- /dev/null +++ b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_RTrees.cs @@ -0,0 +1,37 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_RTrees_getCalculateVarImportance(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_RTrees_setCalculateVarImportance(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_RTrees_getActiveVarCount(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_RTrees_setActiveVarCount(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern TermCriteria ml_RTrees_getTermCriteria(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_RTrees_setTermCriteria(IntPtr obj, TermCriteria val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_RTrees_getVarImportance(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_RTrees_create(); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_Ptr_RTrees_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_Ptr_RTrees_get(IntPtr obj); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_SVM.cs b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_SVM.cs new file mode 100644 index 000000000..2ee2d040e --- /dev/null +++ b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_SVM.cs @@ -0,0 +1,80 @@ +using System; +using System.Runtime.InteropServices; +using OpenCvSharp.ML; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_SVM_getType(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_SVM_setType(IntPtr obj, int val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double ml_SVM_getGamma(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_SVM_setGamma(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double ml_SVM_getCoef0(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_SVM_setCoef0(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double ml_SVM_getDegree(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_SVM_setDegree(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double ml_SVM_getC(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_SVM_setC(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double ml_SVM_getP(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_SVM_setP(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double ml_SVM_getNu(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_SVM_setNu(IntPtr obj, double val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_SVM_getClassWeights(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_SVM_setClassWeights(IntPtr obj, IntPtr val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern TermCriteria ml_SVM_getTermCriteria(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_SVM_setTermCriteria(IntPtr obj, TermCriteria val); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_SVM_getKernelType(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_SVM_setKernel(IntPtr obj, int kernelType); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_SVM_getSupportVectors(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double ml_SVM_getDecisionFunction( + IntPtr obj, int i, IntPtr alpha, IntPtr svidx); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern ParamGrid ml_SVM_getDefaultGrid(int paramId); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_SVM_create(); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_Ptr_SVM_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ml_Ptr_SVM_get(IntPtr obj); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_StatModel.cs b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_StatModel.cs new file mode 100644 index 000000000..5dcc76d7e --- /dev/null +++ b/src/OpenCvSharp/PInvoke/ml/NativeMethods_ml_StatModel.cs @@ -0,0 +1,44 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_StatModel_clear(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_StatModel_getVarCount(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_StatModel_empty(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_StatModel_isTrained(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_StatModel_isClassifier(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_StatModel_train1( + IntPtr obj, IntPtr trainData, int flags); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int ml_StatModel_train2( + IntPtr obj, IntPtr samples, int layout, IntPtr responses); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float ml_StatModel_calcError( + IntPtr obj, IntPtr data, int test, IntPtr resp); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float ml_StatModel_predict( + IntPtr obj, IntPtr samples, IntPtr results, int flags); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void ml_StatModel_save(IntPtr obj, string filename); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/photo/NativeMethods_photo.cs b/src/OpenCvSharp/PInvoke/photo/NativeMethods_photo.cs new file mode 100644 index 000000000..756dd50db --- /dev/null +++ b/src/OpenCvSharp/PInvoke/photo/NativeMethods_photo.cs @@ -0,0 +1,76 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 +// ReSharper disable InconsistentNaming + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void photo_inpaint(IntPtr src, IntPtr inpaintMask, + IntPtr dst, double inpaintRadius, int flags); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void photo_fastNlMeansDenoising(IntPtr src, IntPtr dst, float h, + int templateWindowSize, int searchWindowSize); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void photo_fastNlMeansDenoisingColored(IntPtr src, IntPtr dst, + float h, float hColor, int templateWindowSize, int searchWindowSize); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void photo_fastNlMeansDenoisingMulti(IntPtr[] srcImgs, int srcImgsLength, + IntPtr dst, int imgToDenoiseIndex, int temporalWindowSize, + float h, int templateWindowSize, int searchWindowSize); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void photo_fastNlMeansDenoisingColoredMulti(IntPtr[] srcImgs, int srcImgsLength, + IntPtr dst, int imgToDenoiseIndex, int temporalWindowSize, + float h, float hColor, int templateWindowSize, int searchWindowSize); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void photo_denoise_TVL1( + IntPtr[] observations, int observationsSize, IntPtr result, double lambda, int niters); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void photo_decolor( + IntPtr src, IntPtr grayscale, IntPtr color_boost); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void photo_seamlessClone( + IntPtr src, IntPtr dst, IntPtr mask, Point p, IntPtr blend, int flags); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void photo_colorChange( + IntPtr src, IntPtr mask, IntPtr dst, float red_mul, float green_mul, float blue_mul); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void photo_illuminationChange( + IntPtr src, IntPtr mask, IntPtr dst, float alpha, float beta); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void photo_textureFlattening( + IntPtr src, IntPtr mask, IntPtr dst, + float low_threshold, float high_threshold, int kernel_size); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void photo_edgePreservingFilter( + IntPtr src, IntPtr dst, int flags, float sigma_s, float sigma_r); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void photo_detailEnhance( + IntPtr src, IntPtr dst, float sigma_s, float sigma_r); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void photo_pencilSketch( + IntPtr src, IntPtr dst1, IntPtr dst2, + float sigma_s, float sigma_r, float shade_factor); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void photo_stylization( + IntPtr src, IntPtr dst, float sigma_s, float sigma_r); + + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/photo/NativeMethods_photo_HDR.cs b/src/OpenCvSharp/PInvoke/photo/NativeMethods_photo_HDR.cs new file mode 100644 index 000000000..e53c43cbf --- /dev/null +++ b/src/OpenCvSharp/PInvoke/photo/NativeMethods_photo_HDR.cs @@ -0,0 +1,33 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 +// ReSharper disable InconsistentNaming + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr photo_createCalibrateDebevec(int samples, float lambda, int random); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr photo_createCalibrateRobertson(int maxIter, float threshold); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void photo_Ptr_CalibrateDebevec_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void photo_Ptr_CalibrateRobertson_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr photo_Ptr_CalibrateDebevec_get(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr photo_Ptr_CalibrateRobertson_get(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void photo_CalibrateCRF_process( + IntPtr obj, IntPtr[] srcImgs, int srcImgsLength, IntPtr dst, [In, MarshalAs(UnmanagedType.LPArray)] float[] times); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/shape/NativeMethods_shape_ShapeDistanceExtractor.cs b/src/OpenCvSharp/PInvoke/shape/NativeMethods_shape_ShapeDistanceExtractor.cs new file mode 100644 index 000000000..d13b6f462 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/shape/NativeMethods_shape_ShapeDistanceExtractor.cs @@ -0,0 +1,108 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + // ShapeDistanceExtractor + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float shape_ShapeDistanceExtractor_computeDistance( + IntPtr obj, IntPtr contour1, IntPtr contour2); + + // ShapeContextDistanceExtractor + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void shape_Ptr_ShapeContextDistanceExtractor_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr shape_Ptr_ShapeContextDistanceExtractor_get(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void shape_ShapeContextDistanceExtractor_setAngularBins(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int shape_ShapeContextDistanceExtractor_getAngularBins(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void shape_ShapeContextDistanceExtractor_setRadialBins(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int shape_ShapeContextDistanceExtractor_getRadialBins(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void shape_ShapeContextDistanceExtractor_setInnerRadius(IntPtr obj, float val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float shape_ShapeContextDistanceExtractor_getInnerRadius(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void shape_ShapeContextDistanceExtractor_setOuterRadius(IntPtr obj, float val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float shape_ShapeContextDistanceExtractor_getOuterRadius(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void shape_ShapeContextDistanceExtractor_setRotationInvariant(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int shape_ShapeContextDistanceExtractor_getRotationInvariant(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void shape_ShapeContextDistanceExtractor_setShapeContextWeight(IntPtr obj, float val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float shape_ShapeContextDistanceExtractor_getShapeContextWeight(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void shape_ShapeContextDistanceExtractor_setImageAppearanceWeight(IntPtr obj, float val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float shape_ShapeContextDistanceExtractor_getImageAppearanceWeight(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void shape_ShapeContextDistanceExtractor_setBendingEnergyWeight(IntPtr obj, float val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float shape_ShapeContextDistanceExtractor_getBendingEnergyWeight(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void shape_ShapeContextDistanceExtractor_setImages(IntPtr obj, IntPtr image1, IntPtr image2); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void shape_ShapeContextDistanceExtractor_getImages(IntPtr obj, IntPtr image1, IntPtr image2); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void shape_ShapeContextDistanceExtractor_setIterations(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int shape_ShapeContextDistanceExtractor_getIterations(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void shape_ShapeContextDistanceExtractor_setStdDev(IntPtr obj, float val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float shape_ShapeContextDistanceExtractor_getStdDev(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr shape_createShapeContextDistanceExtractor( + int nAngularBins, int nRadialBins, + float innerRadius, float outerRadius, int iterations /*, + const Ptr &comparer = createChiHistogramCostExtractor(), + const Ptr &transformer = createThinPlateSplineShapeTransformer()*/); + + + // HausdorffDistanceExtractor + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void shape_Ptr_HausdorffDistanceExtractor_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr shape_Ptr_HausdorffDistanceExtractor_get(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void shape_HausdorffDistanceExtractor_setDistanceFlag(IntPtr obj, int val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int shape_HausdorffDistanceExtractor_getDistanceFlag(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void shape_HausdorffDistanceExtractor_setRankProportion(IntPtr obj, float val); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern float shape_HausdorffDistanceExtractor_getRankProportion(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr shape_createHausdorffDistanceExtractor(int distanceFlag, float rankProp); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/video/NativeMethods_video.cs b/src/OpenCvSharp/PInvoke/video/NativeMethods_video.cs new file mode 100644 index 000000000..31e02dc34 --- /dev/null +++ b/src/OpenCvSharp/PInvoke/video/NativeMethods_video.cs @@ -0,0 +1,107 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern RotatedRect video_CamShift( + IntPtr probImage, ref Rect window, TermCriteria criteria); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int video_meanShift( + IntPtr probImage, ref Rect window, TermCriteria criteria); + + // Kalman filter + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_KalmanFilter_new1(); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_KalmanFilter_new2(int dynamParams, int measureParams, int controlParams, + int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_KalmanFilter_init(IntPtr obj, int dynamParams, int measureParams, + int controlParams, int type); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_KalmanFilter_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_KalmanFilter_predict(IntPtr obj, IntPtr control); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_KalmanFilter_correct(IntPtr obj, IntPtr measurement); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_KalmanFilter_statePre(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_KalmanFilter_statePost(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_KalmanFilter_transitionMatrix(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_KalmanFilter_controlMatrix(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_KalmanFilter_measurementMatrix(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_KalmanFilter_processNoiseCov(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_KalmanFilter_measurementNoiseCov(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_KalmanFilter_errorCovPre(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_KalmanFilter_gain(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_KalmanFilter_errorCovPost(IntPtr obj); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int video_buildOpticalFlowPyramid1( + IntPtr img, IntPtr pyramid, + Size winSize, int maxLevel, int withDerivatives, + int pyrBorder, int derivBorder, int tryReuseInputImage); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int video_buildOpticalFlowPyramid2( + IntPtr img, IntPtr pyramidVec, + Size winSize, int maxLevel, int withDerivatives, + int pyrBorder, int derivBorder, int tryReuseInputImage); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_calcOpticalFlowPyrLK_InputArray( + IntPtr prevImg, IntPtr nextImg, + IntPtr prevPts, IntPtr nextPts, + IntPtr status, IntPtr err, + Size winSize, int maxLevel, TermCriteria criteria, + int flags, double minEigThreshold); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_calcOpticalFlowPyrLK_vector( + IntPtr prevImg, IntPtr nextImg, + Point2f[] prevPts, int prevPtsSize, + IntPtr nextPts, IntPtr status, IntPtr err, + Size winSize, int maxLevel, TermCriteria criteria, + int flags, double minEigThreshold); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_calcOpticalFlowFarneback( + IntPtr prev, IntPtr next, + IntPtr flow, double pyrScale, int levels, int winSize, + int iterations, int polyN, double polySigma, int flags); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_estimateRigidTransform( + IntPtr src, IntPtr dst, int fullAffine); + + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_DenseOpticalFlow_calc( + IntPtr obj, IntPtr i0, IntPtr i1, IntPtr flow); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_DenseOpticalFlow_collectGarbage(IntPtr obj); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_DenseOpticalFlow_info(IntPtr obj); + + // TODO + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_createOptFlow_DualTVL1(); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_Ptr_DenseOpticalFlow_get(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_Ptr_DenseOpticalFlow_delete(IntPtr ptr); + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/PInvoke/video/NativeMethods_video_BackgroundSubtractor.cs b/src/OpenCvSharp/PInvoke/video/NativeMethods_video_BackgroundSubtractor.cs new file mode 100644 index 000000000..5bb0766ad --- /dev/null +++ b/src/OpenCvSharp/PInvoke/video/NativeMethods_video_BackgroundSubtractor.cs @@ -0,0 +1,128 @@ +using System; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + static partial class NativeMethods + { + #region BackgroundSubtractor + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractor_getBackgroundImage(IntPtr self, IntPtr backgroundImage); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractor_apply(IntPtr self, IntPtr image, IntPtr fgmask, double learningRate); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_Ptr_BackgroundSubtractor_delete(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_Ptr_BackgroundSubtractor_get(IntPtr ptr); + + #endregion + + #region BackgroundSubtractorMOG2 + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_createBackgroundSubtractorMOG2( + int history, double varThreshold, int detectShadows); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_Ptr_BackgroundSubtractorMOG2_delete(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_Ptr_BackgroundSubtractorMOG2_get(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int video_BackgroundSubtractorMOG2_getHistory(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractorMOG2_setHistory(IntPtr ptr, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int video_BackgroundSubtractorMOG2_getNMixtures(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractorMOG2_setNMixtures(IntPtr ptr, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double video_BackgroundSubtractorMOG2_getBackgroundRatio(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractorMOG2_setBackgroundRatio(IntPtr ptr, double value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double video_BackgroundSubtractorMOG2_getVarThreshold(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractorMOG2_setVarThreshold(IntPtr ptr, double value); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double video_BackgroundSubtractorMOG2_getVarThresholdGen(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractorMOG2_setVarThresholdGen(IntPtr ptr, double value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double video_BackgroundSubtractorMOG2_getVarInit(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractorMOG2_setVarInit(IntPtr ptr, double value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double video_BackgroundSubtractorMOG2_getVarMin(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractorMOG2_setVarMin(IntPtr ptr, double value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double video_BackgroundSubtractorMOG2_getVarMax(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractorMOG2_setVarMax(IntPtr ptr, double value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double video_BackgroundSubtractorMOG2_getComplexityReductionThreshold(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractorMOG2_setComplexityReductionThreshold(IntPtr ptr, double value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int video_BackgroundSubtractorMOG2_getDetectShadows(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractorMOG2_setDetectShadows(IntPtr ptr, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int video_BackgroundSubtractorMOG2_getShadowValue(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractorMOG2_setShadowValue(IntPtr ptr, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double video_BackgroundSubtractorMOG2_getShadowThreshold(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractorMOG2_setShadowThreshold(IntPtr ptr, double value); + + #endregion + + #region BackgroundSubtractorKNN + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_createBackgroundSubtractorKNN( + int history, double dist2Threshold, int detectShadows); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_Ptr_BackgroundSubtractorKNN_delete(IntPtr obj); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr video_Ptr_BackgroundSubtractorKNN_get(IntPtr ptr); + + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int video_BackgroundSubtractorKNN_getHistory(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractorKNN_setHistory(IntPtr ptr, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int video_BackgroundSubtractorKNN_getNSamples(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractorKNN_setNSamples(IntPtr ptr, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int video_BackgroundSubtractorKNN_getDist2Threshold(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractorKNN_setDist2Threshold(IntPtr ptr, double value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int video_BackgroundSubtractorKNN_getkNNSamples(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractorKNN_setkNNSamples(IntPtr ptr, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int video_BackgroundSubtractorKNN_getDetectShadows(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractorKNN_setDetectShadows(IntPtr ptr, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern int video_BackgroundSubtractorKNN_getShadowValue(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractorKNN_setShadowValue(IntPtr ptr, int value); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern double video_BackgroundSubtractorKNN_getShadowThreshold(IntPtr ptr); + [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl)] + public static extern void video_BackgroundSubtractorKNN_setShadowThreshold(IntPtr ptr, double value); + + #endregion + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/Properties/AssemblyInfo.cs b/src/OpenCvSharp/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..ff6ca9fff --- /dev/null +++ b/src/OpenCvSharp/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 +// アセンブリに関連付けられている情報を変更するには、 +// これらの属性値を変更してください。 +[assembly: AssemblyTitle("OpenCvSharp")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OpenCvSharp")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから +// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 +// その型の ComVisible 属性を true に設定してください。 +[assembly: ComVisible(false)] + +// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です +[assembly: Guid("ff17a8c6-d8bd-40a4-8bda-709a5a2204e3")] + +// アセンブリのバージョン情報は、以下の 4 つの値で構成されています: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を +// 既定値にすることができます: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/OpenCvSharp/Util/ArrayAddress.cs b/src/OpenCvSharp/Util/ArrayAddress.cs new file mode 100644 index 000000000..1e02db0a9 --- /dev/null +++ b/src/OpenCvSharp/Util/ArrayAddress.cs @@ -0,0 +1,247 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 +// ReSharper disable InconsistentNaming + +namespace OpenCvSharp.Util +{ + /// + /// + /// + /// + public class ArrayAddress1 : DisposableObject + { + protected Array array; + protected GCHandle gch; + protected object original; + private bool disposed; + + /// + /// + /// + /// + public ArrayAddress1(T[] array) + { + if (array == null) + throw new ArgumentNullException(); + this.array = array; + this.gch = GCHandle.Alloc(array, GCHandleType.Pinned); + } + + /// + /// + /// + /// + public ArrayAddress1(IEnumerable enumerable) + : this(EnumerableEx.ToArray(enumerable)) + { + original = enumerable; + } + + /// + /// + /// + /// + public ArrayAddress1(T[,] array) + { + if (array == null) + throw new ArgumentNullException(); + this.array = array; + this.gch = GCHandle.Alloc(array, GCHandleType.Pinned); + } + + /// + /// + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + if (gch.IsAllocated) + { + gch.Free(); + } + original = null; + disposed = true; + base.Dispose(disposing); + } + } + + /// + /// + /// + public IntPtr Pointer + { + get { return gch.AddrOfPinnedObject(); } + } + + /// + /// + /// + /// + /// + public static implicit operator IntPtr(ArrayAddress1 self) + { + return self.Pointer; + } + + /// + /// + /// + public int Length + { + get { return array.Length; } + } + } + + /// + /// Class to get address of specified jagged array + /// + /// + public class ArrayAddress2 : DisposableObject + where T : struct + { + private bool disposed; + protected T[][] array; + protected GCHandle[] gch; + protected IntPtr[] ptr; + protected object original; + + /// + /// + /// + public ArrayAddress2() + { + } + + /// + /// + /// + /// + public ArrayAddress2(T[][] array) + { + Initialize(array); + } + + /// + /// + /// + /// + public ArrayAddress2(IEnumerable> enumerable) + { + if (enumerable == null) + throw new ArgumentNullException("enumerable"); + original = enumerable; + + var list = new List(); + foreach (IEnumerable e in enumerable) + { + if (e == null) + throw new ArgumentException("enumerable contains null"); + list.Add(new List(e).ToArray()); + } + + Initialize(list.ToArray()); + } + + protected void Initialize(T[][] target) + { + if (target == null) + throw new ArgumentNullException("target"); + array = target; + + // T[][]をIntPtr[]に変換する + ptr = new IntPtr[array.Length]; + gch = new GCHandle[array.Length]; + for (int i = 0; i < array.Length; i++) + { + T[] elem = array[i]; + if (elem == null || elem.Length == 0) + { + throw new ArgumentException(string.Format("array[{0}] is not valid array object.", i)); + } + // メモリ確保 + gch[i] = GCHandle.Alloc(elem, GCHandleType.Pinned); + ptr[i] = gch[i].AddrOfPinnedObject(); + } + } + + /// + /// + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + foreach (GCHandle h in gch) + { + if (h.IsAllocated) + { + h.Free(); + } + } + disposed = true; + base.Dispose(disposing); + } + } + +#if LANG_JP + /// + /// ポインタを得る + /// + /// +#else + /// + /// + /// +#endif + public IntPtr[] Pointer + { + get { return ptr; } + } + +#if LANG_JP + /// + /// ポインタへの暗黙のキャスト + /// + /// + /// +#else + /// + /// + /// + /// + /// +#endif + public static implicit operator IntPtr[](ArrayAddress2 self) + { + return self.Pointer; + } + + /// + /// + /// + public int Dim1Length + { + get { return array.Length; } + } + + /// + /// + /// + public int[] Dim2Lengths + { + get + { + var lengths = new int[array.Length]; + for (int i = 0; i < array.Length; i++) + { + lengths[i] = array[i].Length; + } + return lengths; + } + } + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/Util/DynamicInvoker.cs b/src/OpenCvSharp/Util/DynamicInvoker.cs new file mode 100644 index 000000000..3cff8b624 --- /dev/null +++ b/src/OpenCvSharp/Util/DynamicInvoker.cs @@ -0,0 +1,138 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp.Util +{ +#if LANG_JP + /// + /// 動的にアンマネージのアセンブリにある関数を呼び出すためのクラス + /// + /// 実行させたい関数の定義に合わせたデリゲート +#else + /// + /// + /// + /// +#endif + public class DynamicInvoker : DisposableObject + { +#if LANG_JP + /// + /// 読み込むライブラリの名前 + /// +#else + /// + /// Name of library to be loaded + /// +#endif + public string DllName { get; private set; } +#if LANG_JP + /// + /// 呼び出す関数の名前 + /// +#else + /// + /// Name of function to be called + /// +#endif + public string FunctionName { get; private set; } +#if LANG_JP + /// + /// LoadLibraryで得られたポインタ + /// +#else + /// + /// Pointer which retrieved by LoadLibrary + /// +#endif + public IntPtr PtrLib { get; private set; } +#if LANG_JP + /// + /// GetProcAddressで得られたポインタ + /// +#else + /// + /// Pointer which retrieved by GetProcAddress + /// +#endif + public IntPtr PtrProc { get; private set; } +#if LANG_JP + /// + /// 呼び出す関数ポインタをデリゲートに変換したものを取得する + /// +#else + /// + /// Delegate which is converted from function pointer + /// +#endif + public T Call { get; private set; } + + private bool disposed; + +#if LANG_JP + /// + /// 初期化 + /// + /// ライブラリの名前 + /// 関数の名前 +#else + /// + /// Constructor + /// + /// Name of library + /// Name of function +#endif + public DynamicInvoker(string dllName, string functionName) + { + if (Platform.OS == OS.Unix) + { + throw new PlatformNotSupportedException("This method is for only Windows"); + } + + if (!typeof(T).IsSubclassOf(typeof(Delegate))) + throw new OpenCvSharpException("The type argument must be Delegate."); + if (string.IsNullOrEmpty(dllName)) + throw new ArgumentNullException("dllName"); + if (string.IsNullOrEmpty(functionName)) + throw new ArgumentNullException("functionName"); + + PtrLib = Win32Api.LoadLibrary(dllName); + if (PtrLib == IntPtr.Zero) + throw new OpenCvSharpException("Failed to load \"{0}\".", dllName); + PtrProc = Win32Api.GetProcAddress(PtrLib, functionName); + if (PtrProc == IntPtr.Zero) + throw new OpenCvSharpException("Failed to get address of function \"{0}\".", functionName); + + DllName = dllName; + FunctionName = functionName; + IsDisposed = false; + + Call = (T)(object)Marshal.GetDelegateForFunctionPointer(PtrProc, typeof(T)); + } + +#if LANG_JP + /// + /// リソースの解放 + /// +#else + /// + /// Releases resources + /// + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + // Dispose of any managed resources of the derived class here. + if (disposing) + { + } + base.Dispose(disposing); + // Dispose of any unmanaged resources of the derived class here. + Win32Api.FreeLibrary(PtrLib); + disposed = true; + } + } + } +} diff --git a/src/OpenCvSharp/Util/EnumerableEx.cs b/src/OpenCvSharp/Util/EnumerableEx.cs new file mode 100644 index 000000000..25f02ae96 --- /dev/null +++ b/src/OpenCvSharp/Util/EnumerableEx.cs @@ -0,0 +1,279 @@ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace OpenCvSharp.Util +{ + internal delegate TResult Func(T1 t1); + + /// + /// IEnumerable<T> extension methods for .NET Framework 2.0 + /// + internal static class EnumerableEx + { + /// + /// Enumerable.Select + /// + /// + /// + /// + /// + /// + public static IEnumerable Select( + IEnumerable enumerable, Func selector) + { + if (enumerable == null) + throw new ArgumentNullException("enumerable"); + if (selector == null) + throw new ArgumentNullException("selector"); + foreach (TSource elem in enumerable) + { + yield return selector(elem); + } + } + + /// + /// Enumerable.Select -> ToArray + /// + /// + /// + /// + /// + /// + public static TResult[] SelectToArray( + IEnumerable enumerable, Func selector) + { + return ToArray(Select(enumerable, selector)); + } + + /// + /// Enumerable.Select -> ToArray + /// + /// + /// + /// + /// + /// + public static TResult[] SelectToArray( + IEnumerable enumerable, Func selector) + { + var result = new List(); + foreach (TSource source in enumerable) + { + result.Add(selector(source)); + } + return result.ToArray(); + } + + /// + /// Enumerable.Select -> ToArray + /// + /// + /// + public static IntPtr[] SelectPtrs(IEnumerable enumerable) + { + return SelectToArray(enumerable, delegate(Mat obj) + { + if (obj == null) + throw new ArgumentException("enumerable contains null"); + obj.ThrowIfDisposed(); + return obj.CvPtr; + }); + } + + /// + /// Enumerable.Select -> ToArray + /// + /// + /// + public static IntPtr[] SelectPtrs(IEnumerable enumerable) + { + return SelectToArray(enumerable, delegate(InputArray obj) + { + if (obj == null) + throw new ArgumentException("enumerable contains null"); + obj.ThrowIfDisposed(); + return obj.CvPtr; + }); + } + + /// + /// Enumerable.Where + /// + /// + /// + /// + /// + public static IEnumerable Where( + IEnumerable enumerable, Func predicate) + { + if (enumerable == null) + throw new ArgumentNullException("enumerable"); + if (predicate == null) + throw new ArgumentNullException("predicate"); + foreach (TSource elem in enumerable) + { + if (predicate(elem)) + yield return elem; + } + } + + /// + /// Enumerable.Where -> ToArray + /// + /// + /// + /// + /// + public static TSource[] WhereToArray( + IEnumerable enumerable, Func predicate) + { + return ToArray(Where(enumerable, predicate)); + } + + /// + /// Enumerable.ToArray + /// + /// + /// + /// + public static TSource[] ToArray(IEnumerable enumerable) + { + if (enumerable == null) + return null; + var arr = enumerable as TSource[]; + if (arr != null) + return arr; + return new List(enumerable).ToArray(); + } + + /// + /// Enumerable.Any + /// + /// + /// + /// + /// + public static bool Any( + IEnumerable enumerable, Func predicate) + { + if (enumerable == null) + throw new ArgumentNullException("enumerable"); + foreach (TSource elem in enumerable) + { + if (predicate(elem)) + return true; + } + return false; + } + + /// + /// Enumerable.Any + /// + /// + /// + /// + public static bool AnyNull(IEnumerable enumerable) + where TSource : class + { + if (enumerable == null) + throw new ArgumentNullException("enumerable"); + if (typeof (TSource).IsValueType) + return false; + + foreach (TSource elem in enumerable) + { + if (elem == null) + return true; + } + return false; + } + + /// + /// Enumerable.All + /// + /// + /// + /// + /// + public static bool All( + IEnumerable enumerable, Func predicate) + { + if (enumerable == null) + throw new ArgumentNullException("enumerable"); + foreach (TSource elem in enumerable) + { + if (!predicate(elem)) + return false; + } + return true; + } + + /// + /// Enumerable.Count + /// + /// + /// + /// + /// + public static int Count( + IEnumerable enumerable, Func predicate) + { + if (enumerable == null) + throw new ArgumentNullException("enumerable"); + + int count = 0; + foreach (TSource elem in enumerable) + { + if (predicate(elem)) + count++; + } + return count; + } + + /// + /// Enumerable.Count + /// + /// + /// + /// + public static int Count(IEnumerable enumerable) + { + if (enumerable == null) + throw new ArgumentNullException("enumerable"); + + TSource[] array = enumerable as TSource[]; + if (array != null) + return array.Length; + + ICollection collection = enumerable as ICollection; + if (collection != null) + return collection.Count; + + int count = 0; + foreach (TSource elem in enumerable) + { + count++; + } + return count; + } + + /// + /// + /// + /// + /// + /// + public static bool IsEmpty(IEnumerable enumerable) + { + if (enumerable == null) + throw new ArgumentNullException("enumerable"); + + foreach (TSource elem in enumerable) + { + return false; + } + return true; + } + } +} diff --git a/src/OpenCvSharp/Util/PInvokeHelper.cs b/src/OpenCvSharp/Util/PInvokeHelper.cs new file mode 100644 index 000000000..689697af1 --- /dev/null +++ b/src/OpenCvSharp/Util/PInvokeHelper.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp.Util +{ + /// + /// + /// + public static class PInvokeHelper + { +#if LANG_JP + /// + /// PInvokeが正常に行えるかチェックする + /// +#else + /// + /// Checks whether PInvoke functions can be called + /// +#endif + public static void TryPInvoke() + { + try + { + NativeMethods.core_Mat_sizeof(); + } + catch (DllNotFoundException e) + { + DllImportError(e); + } + catch (BadImageFormatException e) + { + DllImportError(e); + } + } + + /// + /// DllImportの際にDllNotFoundExceptionかBadImageFormatExceptionが発生した際に呼び出されるメソッド。 + /// エラーメッセージを表示して解決策をユーザに示す。 + /// + /// + public static void DllImportError(Exception ex) + { + throw CreateException(ex); + } + + /// + /// + /// + /// + public static OpenCvSharpException CreateException(Exception ex) + { + StringBuilder message = new StringBuilder(); + if (System.Globalization.CultureInfo.CurrentCulture.Name.Contains("ja")) + { + message.AppendFormat("{0}\n", ex.Message); + message.Append("*** P/Invokeが原因で例外が発生しました。***\n") + .Append("以下の項目を確認して下さい。\n") + .Append("(1) OpenCVのDLLが実行ファイルと同じ場所に置かれていますか? またはパスが正しく通っていますか?\n") + .Append("(2) Visual C++ Redistributable Packageをインストールしましたか?\n") + .Append("(3) OpenCVのDLLやOpenCvSharpの対象プラットフォーム(x86またはx64)と、プロジェクトのプラットフォーム設定が合っていますか?\n") + .Append("\n") + .Append(ex.ToString()); + } + else + { + message.AppendFormat("{0}\n", ex.Message); + message.Append("*** An exception has occurred because of P/Invoke. ***\n") + .Append("Please check the following:\n") + .Append("(1) OpenCV's DLL files exist in the same directory as the executable file.\n") + .Append("(2) Visual C++ Redistributable Package has been installed.\n") + .Append("(3) The target platform(x86/x64) of OpenCV's DLL files and OpenCvSharp is the same as your project's.\n") + .Append("\n") + .Append(ex.ToString()); + } + return new OpenCvSharpException(message.ToString(), ex); + } + } +} diff --git a/src/OpenCvSharp/Util/Platform.cs b/src/OpenCvSharp/Util/Platform.cs new file mode 100644 index 000000000..91eda6762 --- /dev/null +++ b/src/OpenCvSharp/Util/Platform.cs @@ -0,0 +1,40 @@ +using System; + +#pragma warning disable 1591 + +namespace OpenCvSharp.Util +{ + internal enum OS + { + Windows, + Unix + } + internal enum Runtime + { + DotNet, + Mono + } + + /// + /// Provides information for the platform which the user is using + /// + internal static class Platform + { + /// + /// OS type + /// + public static readonly OS OS; + /// + /// Runtime type + /// + public static readonly Runtime Runtime; + + static Platform() + { + int p = (int)Environment.OSVersion.Platform; + OS = ((p == 4) || (p == 6) || (p == 128)) ? OS.Unix : OS.Windows; + + Runtime = (Type.GetType("Mono.Runtime") == null) ? Runtime.Mono : Runtime.DotNet; + } + } +} diff --git a/src/OpenCvSharp/Util/PlatformUtil.cs b/src/OpenCvSharp/Util/PlatformUtil.cs new file mode 100644 index 000000000..6a19e0075 --- /dev/null +++ b/src/OpenCvSharp/Util/PlatformUtil.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp +{ + internal static class PlatformUtil + { + public static long AlignSize(long sz, int n) + { + return (sz + n - 1) & -n; + } + + public static long TruncateForX86(long value) + { + if (IntPtr.Size == 4) + return (long)((int)value); + else + return value; + } + } +} diff --git a/src/OpenCvSharp/Util/ScopedGCHandle.cs b/src/OpenCvSharp/Util/ScopedGCHandle.cs new file mode 100644 index 000000000..2ac28e9ea --- /dev/null +++ b/src/OpenCvSharp/Util/ScopedGCHandle.cs @@ -0,0 +1,320 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp.Util +{ +#if LANG_JP + /// + /// IDisposableを実装したGCHandle + /// +#else + /// + /// Original GCHandle that implement IDisposable + /// +#endif + public class ScopedGCHandle : IDisposable + { + private GCHandle handle; + private bool disposed; + + #region Init and Disposal +#if LANG_JP + /// + /// 指定したオブジェクトに System.Runtime.InteropServices.GCHandleType.Normal ハンドルを割り当てます + /// + /// GCの対象からはずすオブジェクト +#else + /// + /// + /// + /// +#endif + public ScopedGCHandle(object value) + { + if (value != null) + { + handle = GCHandle.Alloc(value); + } + disposed = false; + } +#if LANG_JP + /// + /// 指定したオブジェクトに指定した型のハンドルを割り当てます + /// + /// GCの対象からはずすオブジェクト + /// 作成する System.Runtime.InteropServices.GCHandle の型を示す、System.Runtime.InteropServices.GCHandleType 値の 1 つ +#else + /// + /// + /// + /// + /// +#endif + public ScopedGCHandle(object value, GCHandleType type) + { + if (value != null) + { + handle = GCHandle.Alloc(value, type); + } + disposed = false; + } +#if LANG_JP + /// + /// GCHandleから初期化 + /// + /// +#else + /// + /// + /// + /// +#endif + private ScopedGCHandle(GCHandle handle) + { + this.handle = handle; + disposed = false; + } + +#if LANG_JP + /// + /// 指定したオブジェクトに System.Runtime.InteropServices.GCHandleType.Normal ハンドルを割り当てます + /// + /// System.Runtime.InteropServices.GCHandle を使用するオブジェクト + /// オブジェクトをガベージ コレクションから保護する新しい System.Runtime.InteropServices.GCHandle。 + /// System.Runtime.InteropServices.GCHandle は、不要になったときに System.Runtime.InteropServices.GCHandle.Free() で解放する必要があります。 + /// 非プリミティブ (blittable でない) メンバを持つインスタンスは固定できません +#else + /// + /// + /// + /// + /// +#endif + public static ScopedGCHandle Alloc(object value) + { + return new ScopedGCHandle(value); + } +#if LANG_JP + /// + /// 指定したオブジェクトに指定した型のハンドルを割り当てます + /// + /// System.Runtime.InteropServices.GCHandle を使用するオブジェクト + /// 作成する System.Runtime.InteropServices.GCHandle の型を示す、System.Runtime.InteropServices.GCHandleType 値の 1 つ + /// オブジェクトをガベージ コレクションから保護する新しい System.Runtime.InteropServices.GCHandle。 + /// System.Runtime.InteropServices.GCHandle は、不要になったときに System.Runtime.InteropServices.GCHandle.Free() で解放する必要があります。 + /// 非プリミティブ (blittable でない) メンバを持つインスタンスは固定できません +#else + /// + /// + /// + /// + /// + /// +#endif + public static ScopedGCHandle Alloc(object value, GCHandleType type) + { + return new ScopedGCHandle(value, type); + } + +#if LANG_JP + /// + /// GCHandle.Freeによりリソースの解放を行う + /// +#else + /// + /// + /// +#endif + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + /// + /// + /// + /// + protected virtual void Dispose(bool disposing) + { + if (!disposed) + { + if (disposing) + { + } + // Release managed resources. + if (handle.IsAllocated) + { + handle.Free(); + } + disposed = true; + } + } + /// + /// Destructor + /// + ~ScopedGCHandle() + { + Dispose(false); + } + #endregion + + #region Static methods +#if LANG_JP + /// + /// マネージ オブジェクトを識別するハンドルから作成された新しい System.Runtime.InteropServices.GCHandle オブジェクトを返します + /// + /// System.Runtime.InteropServices.GCHandle オブジェクトの作成元のマネージ オブジェクトを識別する System.IntPtr ハンドル + /// value パラメータの値が System.IntPtr.Zero です + /// 値パラメータに対応する新しい System.Runtime.InteropServices.GCHandle オブジェクト +#else + /// + /// + /// + /// + /// +#endif + public static ScopedGCHandle FromIntPtr(IntPtr value) + { + return new ScopedGCHandle(GCHandle.FromIntPtr(value)); + } +#if LANG_JP + /// + /// System.Runtime.InteropServices.GCHandle オブジェクトの内部整数表現を返します + /// + /// 内部整数表現の取得元の System.Runtime.InteropServices.GCHandle オブジェクト + /// System.Runtime.InteropServices.GCHandle オブジェクトを表す System.IntPtr オブジェクト +#else + /// + /// + /// + /// + /// +#endif + public static IntPtr ToIntPtr(ScopedGCHandle value) + { + return GCHandle.ToIntPtr(value.Handle); + } + #endregion + + #region Properties +#if LANG_JP + /// + /// 内部で保持するGCHandle + /// +#else + /// + /// + /// +#endif + public GCHandle Handle + { + get { return handle; } + } +#if LANG_JP + /// + /// ハンドルが割り当てられているかどうかを示す値を取得します + /// +#else + /// + /// + /// +#endif + public bool IsAllocated + { + get { return handle.IsAllocated; } + } +#if LANG_JP + /// + /// ハンドルが表すオブジェクトを取得または設定します + /// +#else + /// + /// + /// +#endif + public object Target + { + get { return handle.Target; } + set { handle.Target = value; } + } + #endregion + + #region Methods +#if LANG_JP + /// + /// System.Runtime.InteropServices.GCHandleType.Pinned ハンドル内のオブジェクトのアドレスを取得します + /// + /// System.IntPtr としての Pinned オブジェクトのアドレス +#else + /// + /// + /// + /// +#endif + public IntPtr AddrOfPinnedObject() + { + return handle.AddrOfPinnedObject(); + } +#if LANG_JP + /// + /// 指定した System.Runtime.InteropServices.GCHandle オブジェクトが、現在の System.Runtime.InteropServices.GCHandle オブジェクトと等しいかどうかを判断します + /// + /// 現在の System.Runtime.InteropServices.GCHandle オブジェクトと比較する System.Runtime.InteropServices.GCHandle オブジェクト + /// +#else + /// + /// + /// + /// + /// +#endif + public override bool Equals(object obj) + { + return handle.Equals(obj); + } +#if LANG_JP + /// + /// System.Runtime.InteropServices.GCHandle を解放します + /// +#else + /// + /// + /// +#endif + public void Free() + { + handle.Free(); + } +#if LANG_JP + /// + /// 現在の System.Runtime.InteropServices.GCHandle オブジェクトの識別子を返します + /// + /// 現在の System.Runtime.InteropServices.GCHandle オブジェクトの識別子 +#else + /// + /// + /// + /// +#endif + public override int GetHashCode() + { + return handle.GetHashCode(); + } +#if LANG_JP + /// + /// 文字列形式を返す + /// + /// +#else + /// + /// + /// + /// +#endif + public override string ToString() + { + return handle.ToString(); + } + #endregion + } +} diff --git a/src/OpenCvSharp/Util/StringArrayAddress.cs b/src/OpenCvSharp/Util/StringArrayAddress.cs new file mode 100644 index 000000000..97210b3a3 --- /dev/null +++ b/src/OpenCvSharp/Util/StringArrayAddress.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp.Util +{ + /// + /// Class to get address of string array + /// + public class StringArrayAddress : ArrayAddress2 + { + /// + /// + /// + /// + public StringArrayAddress(string[] stringArray) + { + var byteList = new List(); + for (int i = 0; i < stringArray.Length; i++) + { + byteList.Add(Encoding.ASCII.GetBytes(stringArray[i])); + } + Initialize(byteList.ToArray()); + } + /// + /// + /// + /// + public StringArrayAddress(IEnumerable enumerable) + : this(EnumerableEx.ToArray(enumerable)) + { + } + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/Util/StructurePointer.cs b/src/OpenCvSharp/Util/StructurePointer.cs new file mode 100644 index 000000000..29d424092 --- /dev/null +++ b/src/OpenCvSharp/Util/StructurePointer.cs @@ -0,0 +1,220 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp.Util +{ +#if LANG_JP + /// + /// 構造体とポインタの変換やメモリの解放を自動的にやってくれるクラス + /// +#else + /// + /// Class that converts structure into pointer and cleans up resources automatically + /// +#endif + public class StructurePointer : IDisposable + { +#if LANG_JP + /// + /// 実体ポインタ + /// +#else + /// + /// Pointer + /// +#endif + + public IntPtr Ptr { get; protected set; } +#if LANG_JP + /// + /// 初期化の際に渡された構造体オブジェクト + /// +#else + /// + /// Structure + /// +#endif + public object SrcObj { get; protected set; } +#if LANG_JP + /// + /// 確保したメモリのバイトサイズ + /// +#else + /// + /// Size of allocated memory + /// +#endif + public int Size { get; protected set; } + +#if LANG_JP + /// + /// 構造体からポインタを作って初期化 + /// + /// +#else + /// + /// + /// + /// +#endif + public StructurePointer(object obj) + { + if (obj == null) + { + throw new ArgumentNullException("obj"); + } + SrcObj = obj; + Size = Marshal.SizeOf(obj.GetType()); + Ptr = Marshal.AllocHGlobal(Size); + Marshal.StructureToPtr(obj, Ptr, false); + } +#if LANG_JP + /// + /// デフォルトの初期化 + /// +#else + /// + /// + /// +#endif + public StructurePointer() + { + SrcObj = null; + Size = 0; + Ptr = IntPtr.Zero; + } + +#if LANG_JP + /// + /// IntPtrへの暗黙の変換 + /// + /// + /// +#else + /// + /// + /// + /// + /// +#endif + public static implicit operator IntPtr(StructurePointer self) + { + return self.Ptr; + } + +#if LANG_JP + /// + /// ポインタから構造体に変換して返す + /// + /// +#else + /// + /// + /// + /// +#endif + public virtual object ToStructure() + { + return Marshal.PtrToStructure(Ptr, SrcObj.GetType()); + } + +#if LANG_JP + /// + /// 後始末 + /// +#else + /// + /// Clean up resources to be used + /// +#endif + public virtual void Dispose() + { + if (Ptr != IntPtr.Zero) + { + Marshal.FreeHGlobal(Ptr); + } + } + } + +#if LANG_JP + /// + /// 構造体とポインタの変換やメモリの解放を自動的にやってくれるクラス (ジェネリック版) + /// + /// +#else + /// + /// Class that converts structure into pointer and cleans up resources automatically (generic version) + /// + /// +#endif + public class StructurePointer : StructurePointer + { +#if LANG_JP + /// + /// 指定した構造体オブジェクトをポインタに変換して初期化 + /// + /// +#else + /// + /// + /// + /// +#endif + public StructurePointer(T obj) + { + SrcObj = obj; + Size = Marshal.SizeOf(typeof(T)); + Ptr = Marshal.AllocHGlobal(Size); + Marshal.StructureToPtr(obj, Ptr, false); + } +#if LANG_JP + /// + /// T型のバイトサイズのポインタを生成して初期化 + /// +#else + /// + /// + /// +#endif + public StructurePointer() + { + SrcObj = default(T); + Size = Marshal.SizeOf(typeof(T)); + Ptr = Marshal.AllocHGlobal(Size); + } + +#if LANG_JP + /// + /// IntPtrへの暗黙の変換 + /// + /// + /// +#else + /// + /// + /// + /// + /// +#endif + public static implicit operator IntPtr(StructurePointer self) + { + return self.Ptr; + } + +#if LANG_JP + /// + /// ポインタから構造体に変換して返す + /// + /// +#else + /// + /// + /// + /// +#endif + public new T ToStructure() + { + return (T)Marshal.PtrToStructure(Ptr, typeof(T)); + } + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/Util/TimeMeasurer.cs b/src/OpenCvSharp/Util/TimeMeasurer.cs new file mode 100644 index 000000000..b3dbb8dca --- /dev/null +++ b/src/OpenCvSharp/Util/TimeMeasurer.cs @@ -0,0 +1,29 @@ +using System; +using System.Diagnostics; + +namespace OpenCvSharp.Util +{ + /// + /// Substitute of System.Action + /// + public delegate void Action(); + + /// + /// + /// + public static class TimeMeasurer + { + /// + /// + /// + /// + /// + public static TimeSpan Measure(Action action) + { + Stopwatch watch = Stopwatch.StartNew(); + action(); + watch.Stop(); + return watch.Elapsed; + } + } +} diff --git a/src/OpenCvSharp/Util/Utility.cs b/src/OpenCvSharp/Util/Utility.cs new file mode 100644 index 000000000..b246f10c4 --- /dev/null +++ b/src/OpenCvSharp/Util/Utility.cs @@ -0,0 +1,261 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Runtime.InteropServices; + +#pragma warning disable 1591 + +namespace OpenCvSharp.Util +{ + /// + /// + /// + public static class Utility + { + #region CopyMemory +#if LANG_JP + /// + /// 指定されたメモリブロックの内容を、他の場所へコピーします。 + /// + /// + /// + /// + /// + /// Yanesdk.NET (http://yanesdkdotnet.sourceforge.jp/) の Screen2DGl.cs から借用させて頂きました。 + /// +#else + /// + /// + /// + /// + /// + /// +#endif + public static unsafe void CopyMemory(void* outDest, void* inSrc, uint inNumOfBytes) + { + // 転送先をuint幅にalignする + const uint align = sizeof(uint) - 1; + uint offset = (uint)outDest & align; + // ↑ポインタは32bitとは限らないので本来このキャストはuintではダメだが、 + // 今は下位2bitだけあればいいのでこれでOK。 + if (offset != 0) + offset = align - offset; + offset = Math.Min(offset, inNumOfBytes); + + // 先頭の余り部分をbyteでちまちまコピー + byte* srcBytes = (byte*)inSrc; + byte* dstBytes = (byte*)outDest; + for (uint i = 0; i < offset; i++) + dstBytes[i] = srcBytes[i]; + + // uintで一気に転送 + uint* dst = (uint*)((byte*)outDest + offset); + uint* src = (uint*)((byte*)inSrc + offset); + uint numOfUInt = (inNumOfBytes - offset) / sizeof(uint); + for (uint i = 0; i < numOfUInt; i++) + dst[i] = src[i]; + + // 末尾の余り部分をbyteでちまちまコピー + for (uint i = offset + numOfUInt * sizeof(uint); i < inNumOfBytes; i++) + dstBytes[i] = srcBytes[i]; + } + public static unsafe void CopyMemory(void* outDest, void* inSrc, int inNumOfBytes) + { + CopyMemory(outDest, inSrc, (uint)inNumOfBytes); + } + public static unsafe void CopyMemory(IntPtr outDest, IntPtr inSrc, uint inNumOfBytes) + { + CopyMemory(outDest.ToPointer(), inSrc.ToPointer(), inNumOfBytes); + } + public static unsafe void CopyMemory(IntPtr outDest, IntPtr inSrc, int inNumOfBytes) + { + CopyMemory(outDest.ToPointer(), inSrc.ToPointer(), (uint)inNumOfBytes); + } + //[DllImport("kernel32")] + //public static unsafe extern void CopyMemory(void* outDest, void* inSrc, [MarshalAs(UnmanagedType.U4)] int inNumOfBytes); + //[DllImport("kernel32")] + //public static extern void CopyMemory(IntPtr outDest, IntPtr inSrc, [MarshalAs(UnmanagedType.U4)] int inNumOfBytes); + #endregion + + #region ZeroMemory +#if LANG_JP + /// + /// 指定されたメモリブロックの内容を、他の場所へコピーします。 + /// + /// + /// + /// + /// Yanesdk.NET (http://yanesdkdotnet.sourceforge.jp/) の Screen2DGl.cs から借用させて頂きました。 + /// +#else + /// + /// + /// + /// + /// +#endif + public static unsafe void ZeroMemory(void* outDest, uint inNumOfBytes) + { + // 転送先をuint幅にalignする + const uint align = sizeof(uint) - 1; + uint offset = (uint)outDest & align; + // ↑ポインタは32bitとは限らないので本来このキャストはuintではダメだが、 + // 今は下位2bitだけあればいいのでこれでOK。 + if (offset != 0) + offset = align - offset; + offset = Math.Min(offset, inNumOfBytes); + + // 先頭の余り部分をbyteでちまちまコピー + byte* dstBytes = (byte*)outDest; + for (uint i = 0; i < offset; i++) + dstBytes[i] = 0; + + // uintで一気に転送 + uint* dst = (uint*)((byte*)outDest + offset); + uint numOfUInt = (inNumOfBytes - offset) / sizeof(uint); + for (uint i = 0; i < numOfUInt; i++) + dst[i] = 0; + + // 末尾の余り部分をbyteでちまちまコピー + for (uint i = offset + numOfUInt * sizeof(uint); i < inNumOfBytes; i++) + dstBytes[i] = 0; + } + public static unsafe void ZeroMemory(void* outDest, int inNumOfBytes) + { + ZeroMemory(outDest, (uint)inNumOfBytes); + } + public static unsafe void ZeroMemory(IntPtr outDest, uint inNumOfBytes) + { + ZeroMemory(outDest.ToPointer(), inNumOfBytes); + } + public static unsafe void ZeroMemory(IntPtr outDest, int inNumOfBytes) + { + ZeroMemory(outDest.ToPointer(), (uint)inNumOfBytes); + } + #endregion + + #region Type casing +#if LANG_JP + /// + /// void*からT型のオブジェクトに変換を試みる. + /// TがOpenCVのオブジェクトの場合は、IntPtrを取るコンストラクタ呼び出しを試みる. + /// + /// オブジェクトの型. プリミティブ型か、OpenCVのオブジェクト(ICvObject). + /// 変換するポインタ + /// T型に変換した結果 +#else + /// + /// + /// + /// + /// + /// +#endif + public static T Cast(IntPtr p) + { + Type t = typeof(T); + // OpenCVのオブジェクトであることを期待してポインタからのオブジェクト生成を試みる. + ConstructorInfo info = t.GetConstructor(new Type[] { typeof(IntPtr), typeof(bool) }); + if (info != null) + { + return (T)info.Invoke(new object[] { p, false }); + } + else + { + info = t.GetConstructor(new Type[] { typeof(IntPtr) }); + if (info == null) + { + throw new OpenCvSharpException("{0} is invalid type for this method. Value type or OpenCV's class are valid.", t.Name); + } + return (T)info.Invoke(new object[] { p }); + } + } +#if LANG_JP + /// + /// ポインタから構造体にキャストを試みる + /// + /// + /// + /// +#else + /// + /// + /// + /// + /// + /// +#endif + public static T ToObject(IntPtr ptr) where T : struct + { + Type t = typeof(T); + // IntPtrはそのまま返す + if (t == typeof(IntPtr)) + { + return (T)(object)ptr; + } + + return (T)Marshal.PtrToStructure(ptr, typeof(T)); + } + +#if LANG_JP + /// + /// testとtargetが同じ型かどうかチェック + /// + /// source type + /// generic type + /// +#else + /// + /// + /// + /// + /// + /// +#endif + private static bool CheckType(Type test, Type target) + { + while (test != typeof(object)) + { + if (test.IsGenericType) + { + Type g = test.GetGenericTypeDefinition(); + if (target == g) + { + return true; + } + } + test = test.BaseType; + } + return false; + } + + /// + /// + /// + /// + /// + public static int SizeOf(Type t) + { + if (t.IsValueType) + { + return Marshal.SizeOf(t); + } + else + { + /* + FieldInfo info = t.GetField("SizeOf", BindingFlags.Static | BindingFlags.Public); + if (info != null) + { + return (int)info.GetValue(null); + } + else + { + throw new OpenCvSharpException("Not defined sizeof({0}) operation", t.Name); + } + */ + return IntPtr.Size; + } + } + #endregion + } +} diff --git a/src/OpenCvSharp/Util/WindowsLibraryLoader.cs b/src/OpenCvSharp/Util/WindowsLibraryLoader.cs new file mode 100644 index 000000000..78a00d06d --- /dev/null +++ b/src/OpenCvSharp/Util/WindowsLibraryLoader.cs @@ -0,0 +1,358 @@ +#define Net20 + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Text; + +namespace OpenCvSharp.Util +{ + /// + /// Handles loading embedded dlls into memory, based on http://stackoverflow.com/questions/666799/embedding-unmanaged-dll-into-a-managed-c-sharp-dll. + /// + /// This code is based on https://github.com/charlesw/tesseract + public sealed class WindowsLibraryLoader + { + #region Singleton pattern + + private static readonly WindowsLibraryLoader instance = new WindowsLibraryLoader(); + + /// + /// + /// + public static WindowsLibraryLoader Instance { get { return instance; } } + + #endregion + + /// + /// The default base directory name to copy the assemblies too. + /// + private const string ProcessorArchitecture = "PROCESSOR_ARCHITECTURE"; + private const string DllFileExtension = ".dll"; + private const string DllDirectory = "dll"; + + private readonly List loadedAssemblies = new List(); + + /// + /// Map processor + /// + private readonly Dictionary processorArchitecturePlatforms = + new Dictionary(StringComparer.OrdinalIgnoreCase) + { + {"x86", "x86"}, + {"AMD64", "x64"}, + {"IA64", "Itanium"}, + {"ARM", "WinCE"} + }; + + /// + /// Used as a sanity check for the returned processor architecture to double check the returned value. + /// + private readonly Dictionary processorArchitectureAddressWidthPlatforms = + new Dictionary(StringComparer.OrdinalIgnoreCase) + { + {"x86", 4}, + {"AMD64", 8}, + {"IA64", 8}, + {"ARM", 4} + }; + + /// + /// Additional user-defined DLL paths + /// + public List AdditionalPaths { get; private set; } + + private readonly object syncLock = new object(); + + /// + /// constructor + /// + private WindowsLibraryLoader() + { + AdditionalPaths = new List(); + } + + /// + /// + /// + /// + /// + public bool IsLibraryLoaded(string dllName) + { + lock (syncLock) + { + return loadedAssemblies.Contains(dllName); + } + } + + /// + /// + /// + /// + public bool IsCurrentPlatformSupported() + { + return Environment.OSVersion.Platform == PlatformID.Win32NT || + Environment.OSVersion.Platform == PlatformID.Win32Windows; + } + + /// + /// + /// + /// + /// + public void LoadLibrary(string dllName, IEnumerable additionalPaths = null) + { + if (!IsCurrentPlatformSupported()) + { + return; + } + + if (additionalPaths == null) + additionalPaths = new string[0]; + + try + { + lock (syncLock) + { + if (loadedAssemblies.Contains(dllName)) + { + return; + } + + var processArch = GetProcessArchitecture(); + IntPtr dllHandle; + string baseDirectory; + + // Try loading from user-defined paths + foreach (string path in additionalPaths) + { + // baseDirectory = Path.GetFullPath(path); + dllHandle = LoadLibraryRaw(dllName, path); + if (dllHandle != IntPtr.Zero) return; + } + + // Try loading from executing assembly domain + var executingAssembly = Assembly.GetExecutingAssembly(); + baseDirectory = Path.GetDirectoryName(executingAssembly.Location); + dllHandle = LoadLibraryInternal(dllName, baseDirectory, processArch); + if (dllHandle != IntPtr.Zero) return; + + // Fallback to current app domain + baseDirectory = Path.GetFullPath(AppDomain.CurrentDomain.BaseDirectory); + dllHandle = LoadLibraryInternal(dllName, baseDirectory, processArch); + if (dllHandle != IntPtr.Zero) return; + + // Finally try the working directory + baseDirectory = Path.GetFullPath(Environment.CurrentDirectory); + dllHandle = LoadLibraryInternal(dllName, baseDirectory, processArch); + if (dllHandle != IntPtr.Zero) return; + + // ASP.NET hack, requires an active context +#if false + if (HttpContext.Current != null) + { + var server = HttpContext.Current.Server; + baseDirectory = Path.GetFullPath(server.MapPath("bin")); + dllHandle = LoadLibraryInternal(dllName, baseDirectory, processArch); + if (dllHandle != IntPtr.Zero) return; + } +#endif + StringBuilder errorMessage = new StringBuilder(); + errorMessage.AppendFormat("Failed to find dll \"{0}\", for processor architecture {1}.", dllName, + processArch.Architecture); + if (processArch.HasWarnings) + { + // include process detection warnings + errorMessage.AppendFormat("\r\nWarnings: \r\n{0}", processArch.WarningText()); + } + throw new Exception(errorMessage.ToString()); + } + } + catch (Exception e) + { + Debug.WriteLine(e.Message); + } + } + + /// + /// Get's the current process architecture while keeping track of any assumptions or possible errors. + /// + /// + private ProcessArchitectureInfo GetProcessArchitecture() + { + // BUGBUG: Will this always be reliable? + string processArchitecture = Environment.GetEnvironmentVariable(ProcessorArchitecture); + var processInfo = new ProcessArchitectureInfo(); + if (!String.IsNullOrEmpty(processArchitecture)) + { + // Sanity check + processInfo.Architecture = processArchitecture; + } + else + { + processInfo.AddWarning("Failed to detect processor architecture, falling back to x86."); + + processInfo.Architecture = (IntPtr.Size == 8) ? "x64" : "x86"; + } + + var addressWidth = processorArchitectureAddressWidthPlatforms[processInfo.Architecture]; + if (addressWidth != IntPtr.Size) + { + if (String.Equals(processInfo.Architecture, "AMD64", StringComparison.OrdinalIgnoreCase) && IntPtr.Size == 4) + { + // fall back to x86 if detected x64 but has an address width of 32 bits. + processInfo.Architecture = "x86"; + processInfo.AddWarning("Expected the detected processing architecture of {0} to have an address width of {1} Bytes but was {2} Bytes, falling back to x86.", processInfo.Architecture, addressWidth, IntPtr.Size); + } + else + { + // no fallback possible + processInfo.AddWarning("Expected the detected processing architecture of {0} to have an address width of {1} Bytes but was {2} Bytes.", processInfo.Architecture, addressWidth, IntPtr.Size); + + } + } + + return processInfo; + } + + private IntPtr LoadLibraryInternal(string dllName, string baseDirectory, ProcessArchitectureInfo processArchInfo) + { + //IntPtr libraryHandle = IntPtr.Zero; + var platformName = GetPlatformName(processArchInfo.Architecture); + var expectedDllDirectory = Path.Combine( + Path.Combine(baseDirectory, DllDirectory), platformName); + //var fileName = FixUpDllFileName(Path.Combine(expectedDllDirectory, dllName)); + + return LoadLibraryRaw(dllName, expectedDllDirectory); + } + + private IntPtr LoadLibraryRaw(string dllName, string baseDirectory) + { + IntPtr libraryHandle = IntPtr.Zero; + var fileName = FixUpDllFileName(Path.Combine(baseDirectory, dllName)); + + if (File.Exists(fileName)) + { + // Attempt to load dll + try + { + // Show where we're trying to load the file from + Debug.WriteLine(String.Format( + "Trying to load native library \"{0}\"...", + fileName)); + + libraryHandle = Win32LoadLibrary(fileName); + if (libraryHandle != IntPtr.Zero) + { + // library has been loaded + Debug.WriteLine(String.Format( + "Successfully loaded native library \"{0}\".", + fileName)); + loadedAssemblies.Add(dllName); + } + else + { + Debug.WriteLine(String.Format( + "Failed to load native library \"{0}\".\r\nCheck windows event log.", + fileName)); + } + } + catch (Exception e) + { + var lastError = Marshal.GetLastWin32Error(); + Debug.WriteLine(String.Format( + "Failed to load native library \"{0}\".\r\nLast Error:{1}\r\nCheck inner exception and\\or windows event log.\r\nInner Exception: {2}", + fileName, lastError, e)); + } + } + else + { + Debug.WriteLine(String.Format(CultureInfo.CurrentCulture, + "The native library \"{0}\" does not exist.", + fileName)); + } + + return libraryHandle; + } + + /// + /// Determines if the dynamic link library file name requires a suffix + /// and adds it if necessary. + /// + private string FixUpDllFileName(string fileName) + { + if (!String.IsNullOrEmpty(fileName)) + { + PlatformID platformId = Environment.OSVersion.Platform; + + if ((platformId == PlatformID.Win32S) || + (platformId == PlatformID.Win32Windows) || + (platformId == PlatformID.Win32NT) || + (platformId == PlatformID.WinCE)) + { + if (!fileName.EndsWith(DllFileExtension, + StringComparison.OrdinalIgnoreCase)) + { + return fileName + DllFileExtension; + } + } + } + + return fileName; + } + + /// + /// Given the processor architecture, returns the name of the platform. + /// + private string GetPlatformName(string processorArchitecture) + { + if (String.IsNullOrEmpty(processorArchitecture)) + return null; + + string platformName; + if (processorArchitecturePlatforms.TryGetValue(processorArchitecture, out platformName)) + { + return platformName; + } + + return null; + } + + /// + /// + /// + private class ProcessArchitectureInfo + { + public ProcessArchitectureInfo() + { + Warnings = new List(); + } + + public string Architecture { get; set; } + private List Warnings { get; set; } + + public bool HasWarnings + { + get { return Warnings.Count > 0; } + } + + public void AddWarning(string format, params object[] args) + { + Warnings.Add(String.Format(format, args)); + } + + public string WarningText() + { + return String.Join("\r\n", Warnings.ToArray()); + } + } + + [DllImport("kernel32", EntryPoint = "LoadLibrary", CallingConvention = CallingConvention.Winapi, + SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false, ThrowOnUnmappableChar = true)] + private static extern IntPtr Win32LoadLibrary(string dllPath); + } +} diff --git a/src/OpenCvSharp/Vector/IStdVector.cs b/src/OpenCvSharp/Vector/IStdVector.cs new file mode 100644 index 000000000..0a1bece22 --- /dev/null +++ b/src/OpenCvSharp/Vector/IStdVector.cs @@ -0,0 +1,26 @@ +using System; + +namespace OpenCvSharp +{ + /// + /// Represents std::vector + /// + internal interface IStdVector : IDisposable + { + /// + /// vector.size() + /// + int Size { get; } + + /// + /// &vector[0] + /// + IntPtr ElemPtr { get; } + + /// + /// Convert std::vector<T> to managed array T[] + /// + /// + T[] ToArray(); + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfByte.cs b/src/OpenCvSharp/Vector/VectorOfByte.cs new file mode 100644 index 000000000..75f0393fa --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfByte.cs @@ -0,0 +1,119 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfByte : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfByte() + { + ptr = NativeMethods.vector_uchar_new1(); + } + + /// + /// + /// + /// + public VectorOfByte(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_uchar_new2(new IntPtr(size)); + } + + /// + /// + /// + /// + public VectorOfByte(IEnumerable data) + { + if (data == null) + throw new ArgumentNullException("data"); + byte[] array = EnumerableEx.ToArray(data); + ptr = NativeMethods.vector_uchar_new3(array, new IntPtr(array.Length)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_uchar_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size + { + get { return NativeMethods.vector_uchar_getSize(ptr).ToInt32(); } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_uchar_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public byte[] ToArray() + { + int size = Size; + if (size == 0) + { + return new byte[0]; + } + byte[] dst = new byte[size]; + Marshal.Copy(ElemPtr, dst, 0, dst.Length); + return dst; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfDMatch.cs b/src/OpenCvSharp/Vector/VectorOfDMatch.cs new file mode 100644 index 000000000..c60be0af6 --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfDMatch.cs @@ -0,0 +1,131 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfDMatch : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfDMatch() + { + ptr = NativeMethods.vector_DMatch_new1(); + } + + /// + /// + /// + /// + public VectorOfDMatch(IntPtr ptr) + { + this.ptr = ptr; + } + + /// + /// + /// + /// + public VectorOfDMatch(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_DMatch_new2(new IntPtr(size)); + } + + /// + /// + /// + /// + public VectorOfDMatch(IEnumerable data) + { + if (data == null) + throw new ArgumentNullException("data"); + DMatch[] array = EnumerableEx.ToArray(data); + ptr = NativeMethods.vector_DMatch_new3(array, new IntPtr(array.Length)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_DMatch_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size + { + get { return NativeMethods.vector_DMatch_getSize(ptr).ToInt32(); } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_DMatch_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public DMatch[] ToArray() + { + int size = Size; + if (size == 0) + { + return new DMatch[0]; + } + DMatch[] dst = new DMatch[size]; + using (ArrayAddress1 dstPtr = new ArrayAddress1(dst)) + { + Util.Utility.CopyMemory(dstPtr, ElemPtr, Marshal.SizeOf(typeof (DMatch))*dst.Length); + } + return dst; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfDTreesNode.cs b/src/OpenCvSharp/Vector/VectorOfDTreesNode.cs new file mode 100644 index 000000000..fb5d89a68 --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfDTreesNode.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; +using OpenCvSharp.ML; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfDTreesNode : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfDTreesNode() + { + ptr = NativeMethods.vector_DTrees_Node_new1(); + } + + /// + /// + /// + /// + public VectorOfDTreesNode(IntPtr ptr) + { + this.ptr = ptr; + } + + /// + /// + /// + /// + public VectorOfDTreesNode(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_DTrees_Node_new2(new IntPtr(size)); + } + + /// + /// + /// + /// + public VectorOfDTreesNode(IEnumerable data) + { + if (data == null) + throw new ArgumentNullException("data"); + DTrees.Node[] array = EnumerableEx.ToArray(data); + ptr = NativeMethods.vector_DTrees_Node_new3(array, new IntPtr(array.Length)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_DTrees_Node_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size + { + get { return NativeMethods.vector_DTrees_Node_getSize(ptr).ToInt32(); } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_DTrees_Node_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public DTrees.Node[] ToArray() + { + int size = Size; + if (size == 0) + { + return new DTrees.Node[0]; + } + var dst = new DTrees.Node[size]; + using (var dstPtr = new ArrayAddress1(dst)) + { + Utility.CopyMemory(dstPtr, ElemPtr, Marshal.SizeOf(typeof(DTrees.Node)) * dst.Length); + } + return dst; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfDTreesSplit.cs b/src/OpenCvSharp/Vector/VectorOfDTreesSplit.cs new file mode 100644 index 000000000..0bd46c61c --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfDTreesSplit.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; +using OpenCvSharp.ML; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfDTreesSplit : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfDTreesSplit() + { + ptr = NativeMethods.vector_DTrees_Split_new1(); + } + + /// + /// + /// + /// + public VectorOfDTreesSplit(IntPtr ptr) + { + this.ptr = ptr; + } + + /// + /// + /// + /// + public VectorOfDTreesSplit(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_DTrees_Split_new2(new IntPtr(size)); + } + + /// + /// + /// + /// + public VectorOfDTreesSplit(IEnumerable data) + { + if (data == null) + throw new ArgumentNullException("data"); + DTrees.Split[] array = EnumerableEx.ToArray(data); + ptr = NativeMethods.vector_DTrees_Split_new3(array, new IntPtr(array.Length)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_DTrees_Split_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size + { + get { return NativeMethods.vector_DTrees_Split_getSize(ptr).ToInt32(); } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_DTrees_Split_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public DTrees.Split[] ToArray() + { + int size = Size; + if (size == 0) + { + return new DTrees.Split[0]; + } + var dst = new DTrees.Split[size]; + using (var dstPtr = new ArrayAddress1(dst)) + { + Utility.CopyMemory(dstPtr, ElemPtr, Marshal.SizeOf(typeof(DTrees.Split)) * dst.Length); + } + return dst; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfDouble.cs b/src/OpenCvSharp/Vector/VectorOfDouble.cs new file mode 100644 index 000000000..c5f9e8cff --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfDouble.cs @@ -0,0 +1,119 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfDouble : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfDouble() + { + ptr = NativeMethods.vector_double_new1(); + } + + /// + /// + /// + /// + public VectorOfDouble(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_double_new2(new IntPtr(size)); + } + + /// + /// + /// + /// + public VectorOfDouble(IEnumerable data) + { + if (data == null) + throw new ArgumentNullException("data"); + double[] array = EnumerableEx.ToArray(data); + ptr = NativeMethods.vector_double_new3(array, new IntPtr(array.Length)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_double_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size + { + get { return NativeMethods.vector_double_getSize(ptr).ToInt32(); } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_double_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public double[] ToArray() + { + int size = Size; + if (size == 0) + { + return new double[0]; + } + double[] dst = new double[size]; + Marshal.Copy(ElemPtr, dst, 0, dst.Length); + return dst; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfFloat.cs b/src/OpenCvSharp/Vector/VectorOfFloat.cs new file mode 100644 index 000000000..42012d6e5 --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfFloat.cs @@ -0,0 +1,119 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + public class VectorOfFloat : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfFloat() + { + ptr = NativeMethods.vector_float_new1(); + } + + /// + /// + /// + /// + public VectorOfFloat(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_float_new2(new IntPtr(size)); + } + + /// + /// + /// + /// + public VectorOfFloat(IEnumerable data) + { + if (data == null) + throw new ArgumentNullException("data"); + float[] array = EnumerableEx.ToArray(data); + ptr = NativeMethods.vector_float_new3(array, new IntPtr(array.Length)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_float_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size + { + get { return NativeMethods.vector_float_getSize(ptr).ToInt32(); } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_float_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public float[] ToArray() + { + int size = Size; + if (size == 0) + { + return new float[0]; + } + float[] dst = new float[size]; + Marshal.Copy(ElemPtr, dst, 0, dst.Length); + return dst; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfInt32.cs b/src/OpenCvSharp/Vector/VectorOfInt32.cs new file mode 100644 index 000000000..47862453d --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfInt32.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + public class VectorOfInt32 : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfInt32() + { + ptr = NativeMethods.vector_int32_new1(); + } + + /// + /// + /// + /// + public VectorOfInt32(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_int32_new2(new IntPtr(size)); + } + + /// + /// + /// + public VectorOfInt32(IntPtr ptr) + { + this.ptr = ptr; + } + + /// + /// + /// + /// + public VectorOfInt32(IEnumerable data) + { + if (data == null) + throw new ArgumentNullException("data"); + int[] array = EnumerableEx.ToArray(data); + ptr = NativeMethods.vector_int32_new3(array, new IntPtr(array.Length)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_float_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size + { + get { return NativeMethods.vector_int32_getSize(ptr).ToInt32(); } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_int32_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public int[] ToArray() + { + int size = Size; + if (size == 0) + { + return new int[0]; + } + int[] dst = new int[size]; + Marshal.Copy(ElemPtr, dst, 0, dst.Length); + return dst; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfKeyPoint.cs b/src/OpenCvSharp/Vector/VectorOfKeyPoint.cs new file mode 100644 index 000000000..dac2b8939 --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfKeyPoint.cs @@ -0,0 +1,131 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfKeyPoint : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfKeyPoint() + { + ptr = NativeMethods.vector_KeyPoint_new1(); + } + + /// + /// + /// + /// + public VectorOfKeyPoint(IntPtr ptr) + { + this.ptr = ptr; + } + + /// + /// + /// + /// + public VectorOfKeyPoint(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_KeyPoint_new2(new IntPtr(size)); + } + + /// + /// + /// + /// + public VectorOfKeyPoint(IEnumerable data) + { + if (data == null) + throw new ArgumentNullException("data"); + KeyPoint[] array = EnumerableEx.ToArray(data); + ptr = NativeMethods.vector_KeyPoint_new3(array, new IntPtr(array.Length)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_KeyPoint_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size + { + get { return NativeMethods.vector_KeyPoint_getSize(ptr).ToInt32(); } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_KeyPoint_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public KeyPoint[] ToArray() + { + int size = Size; + if (size == 0) + { + return new KeyPoint[0]; + } + KeyPoint[] dst = new KeyPoint[size]; + using (var dstPtr = new ArrayAddress1(dst)) + { + Util.Utility.CopyMemory(dstPtr, ElemPtr, Marshal.SizeOf(typeof (KeyPoint))*dst.Length); + } + return dst; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfMat.cs b/src/OpenCvSharp/Vector/VectorOfMat.cs new file mode 100644 index 000000000..31f204145 --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfMat.cs @@ -0,0 +1,158 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfMat : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfMat() + { + ptr = NativeMethods.vector_Mat_new1(); + } + + /// + /// + /// + /// + public VectorOfMat(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_Mat_new2(new IntPtr(size)); + } + + /// + /// + /// + /// + public VectorOfMat(IntPtr ptr) + { + this.ptr = ptr; + } + + /// + /// + /// + /// + public VectorOfMat(IEnumerable mats) + { + if (mats == null) + throw new ArgumentNullException("mats"); + + var matPointers = EnumerableEx.SelectPtrs(mats); + using (var matPointersPointer = new ArrayAddress1(matPointers)) + { + ptr = NativeMethods.vector_Mat_new3( + matPointersPointer.Pointer, + new IntPtr(matPointers.Length)); + } + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_Mat_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size + { + get { return NativeMethods.vector_Mat_getSize(ptr).ToInt32(); } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_Mat_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public Mat[] ToArray() + { + return ToArray(); + } + + /// + /// Converts std::vector to managed array + /// + /// + public T[] ToArray() + where T : Mat, new() + { + int size = Size; + if (size == 0) + return new T[0]; + + T[] dst = new T[size]; + IntPtr[] dstPtr = new IntPtr[size]; + for (int i = 0; i < size; i++) + { + T m = new T(); + dst[i] = m; + dstPtr[i] = m.CvPtr; + } + NativeMethods.vector_Mat_assignToArray(ptr, dstPtr); + + return dst; + } + + /// + /// 各要素の参照カウントを1追加する + /// + public void AddRef() + { + NativeMethods.vector_Mat_addref(ptr); + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfPoint.cs b/src/OpenCvSharp/Vector/VectorOfPoint.cs new file mode 100644 index 000000000..48844d1a1 --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfPoint.cs @@ -0,0 +1,130 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + public class VectorOfPoint : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfPoint() + { + ptr = NativeMethods.vector_Point2i_new1(); + } + + /// + /// + /// + /// + public VectorOfPoint(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_Point2i_new2(new IntPtr(size)); + } + + /// + /// + /// + /// + public VectorOfPoint(IntPtr ptr) + { + this.ptr = ptr; + } + + /// + /// + /// + /// + public VectorOfPoint(IEnumerable data) + { + if (data == null) + throw new ArgumentNullException("data"); + Point[] array = EnumerableEx.ToArray(data); + ptr = NativeMethods.vector_Point2i_new3(array, new IntPtr(array.Length)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_Point2i_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size + { + get { return NativeMethods.vector_Point2i_getSize(ptr).ToInt32(); } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_Point2i_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public Point[] ToArray() + { + int size = Size; + if (size == 0) + { + return new Point[0]; + } + Point[] dst = new Point[size]; + using (var dstPtr = new ArrayAddress1(dst)) + { + Util.Utility.CopyMemory(dstPtr, ElemPtr, Point.SizeOf*dst.Length); + } + return dst; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfPoint2f.cs b/src/OpenCvSharp/Vector/VectorOfPoint2f.cs new file mode 100644 index 000000000..906ff4589 --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfPoint2f.cs @@ -0,0 +1,130 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + public class VectorOfPoint2f : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfPoint2f() + { + ptr = NativeMethods.vector_Point2f_new1(); + } + + /// + /// + /// + /// + public VectorOfPoint2f(IntPtr ptr) + { + this.ptr = ptr; + } + + /// + /// + /// + /// + public VectorOfPoint2f(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_Point2f_new2(new IntPtr(size)); + } + + /// + /// + /// + /// + public VectorOfPoint2f(IEnumerable data) + { + if (data == null) + throw new ArgumentNullException("data"); + Point2f[] array = EnumerableEx.ToArray(data); + ptr = NativeMethods.vector_Point2f_new3(array, new IntPtr(array.Length)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_Point2f_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size + { + get { return NativeMethods.vector_Point2f_getSize(ptr).ToInt32(); } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_Point2f_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public Point2f[] ToArray() + { + int size = Size; + if (size == 0) + { + return new Point2f[0]; + } + Point2f[] dst = new Point2f[size]; + using (ArrayAddress1 dstPtr = new ArrayAddress1(dst)) + { + Util.Utility.CopyMemory(dstPtr, ElemPtr, Point2f.SizeOf*dst.Length); + } + return dst; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfPoint3f.cs b/src/OpenCvSharp/Vector/VectorOfPoint3f.cs new file mode 100644 index 000000000..3f2f57aeb --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfPoint3f.cs @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + public class VectorOfPoint3f : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfPoint3f() + { + ptr = NativeMethods.vector_Point2f_new1(); + } + + /// + /// + /// + /// + public VectorOfPoint3f(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_Point3f_new2(new IntPtr(size)); + } + + /// + /// + /// + /// + public VectorOfPoint3f(IEnumerable data) + { + if (data == null) + throw new ArgumentNullException("data"); + Point3f[] array = EnumerableEx.ToArray(data); + ptr = NativeMethods.vector_Point3f_new3(array, new IntPtr(array.Length)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_Point3f_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size + { + get { return NativeMethods.vector_Point3f_getSize(ptr).ToInt32(); } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_Point3f_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public Point3f[] ToArray() + { + int size = Size; + if (size == 0) + { + return new Point3f[0]; + } + Point3f[] dst = new Point3f[size]; + using (ArrayAddress1 dstPtr = new ArrayAddress1(dst)) + { + Util.Utility.CopyMemory(dstPtr, ElemPtr, Point3f.SizeOf*dst.Length); + } + return dst; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfRect.cs b/src/OpenCvSharp/Vector/VectorOfRect.cs new file mode 100644 index 000000000..e3219f8a1 --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfRect.cs @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfRect : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfRect() + { + ptr = NativeMethods.vector_Rect_new1(); + } + + /// + /// + /// + /// + public VectorOfRect(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_Rect_new2(new IntPtr(size)); + } + + /// + /// + /// + /// + public VectorOfRect(IEnumerable data) + { + if (data == null) + throw new ArgumentNullException("data"); + Rect[] array = EnumerableEx.ToArray(data); + ptr = NativeMethods.vector_Rect_new3(array, new IntPtr(array.Length)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_Rect_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size + { + get { return NativeMethods.vector_Rect_getSize(ptr).ToInt32(); } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_Rect_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public Rect[] ToArray() + { + int size = Size; + if (size == 0) + { + return new Rect[0]; + } + Rect[] dst = new Rect[size]; + using (ArrayAddress1 dstPtr = new ArrayAddress1(dst)) + { + Util.Utility.CopyMemory(dstPtr, ElemPtr, Rect.SizeOf*dst.Length); + } + return dst; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfString.cs b/src/OpenCvSharp/Vector/VectorOfString.cs new file mode 100644 index 000000000..2ec549f3b --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfString.cs @@ -0,0 +1,119 @@ +using System; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfString : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed; + + #region Init and Dispose + + /// + /// + /// + public VectorOfString() + { + ptr = NativeMethods.vector_string_new1(); + } + + /// + /// + /// + /// + public VectorOfString(IntPtr ptr) + { + this.ptr = ptr; + } + + /// + /// + /// + /// + public VectorOfString(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_string_new2(new IntPtr(size)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_string_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size + { + get { return NativeMethods.vector_string_getSize(ptr).ToInt32(); } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_string_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public string[] ToArray() + { + int size = Size; + if (size == 0) + return new string[0]; + + var ret = new string[size]; + for (int i = 0; i < size; i++) + { + unsafe + { + sbyte* p = NativeMethods.vector_string_elemAt(ptr, i); + ret[i] = new string(p); + } + } + return ret; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfVec2f.cs b/src/OpenCvSharp/Vector/VectorOfVec2f.cs new file mode 100644 index 000000000..308bf408d --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfVec2f.cs @@ -0,0 +1,141 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfVec2f : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfVec2f() + { + ptr = NativeMethods.vector_Vec2f_new1(); + } + + /// + /// + /// + /// + public VectorOfVec2f(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_Vec2f_new2(new IntPtr(size)); + } + + /// + /// + /// + /// + public VectorOfVec2f(IEnumerable data) + { + if (data == null) + throw new ArgumentNullException("data"); + Vec2f[] array = EnumerableEx.ToArray(data); + ptr = NativeMethods.vector_Vec2f_new3(array, new IntPtr(array.Length)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_Vec2f_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size + { + get { return NativeMethods.vector_Vec2f_getSize(ptr).ToInt32(); } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_Vec2f_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public Vec2f[] ToArray() + { + return ToArray(); + } + + /// + /// Converts std::vector to managed array + /// + /// structure that has two float members (ex. CvLineSegmentPolar, CvPoint2D32f, PointF) + /// + public T[] ToArray() where T : struct + { + int typeSize = Marshal.SizeOf(typeof (T)); + if (typeSize != sizeof (float)*2) + { + throw new OpenCvSharpException(); + } + + int arySize = Size; + if (arySize == 0) + { + return new T[0]; + } + else + { + T[] dst = new T[arySize]; + using (ArrayAddress1 dstPtr = new ArrayAddress1(dst)) + { + Util.Utility.CopyMemory(dstPtr, ElemPtr, typeSize*dst.Length); + } + return dst; + } + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfVec3f.cs b/src/OpenCvSharp/Vector/VectorOfVec3f.cs new file mode 100644 index 000000000..8d36caba0 --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfVec3f.cs @@ -0,0 +1,138 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfVec3f : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfVec3f() + { + ptr = NativeMethods.vector_Vec3f_new1(); + } + + /// + /// + /// + /// + public VectorOfVec3f(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_Vec3f_new2(new IntPtr(size)); + } + + /// + /// + /// + /// + public VectorOfVec3f(IEnumerable data) + { + if (data == null) + throw new ArgumentNullException("data"); + Vec3f[] array = EnumerableEx.ToArray(data); + ptr = NativeMethods.vector_Vec3f_new3(array, new IntPtr(array.Length)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_Vec2f_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size + { + get { return NativeMethods.vector_Vec3f_getSize(ptr).ToInt32(); } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_Vec3f_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public Vec3f[] ToArray() + { + return ToArray(); + } + + /// + /// Converts std::vector to managed array + /// + /// structure that has two float members (ex. CvLineSegmentPolar, CvPoint2D32f, PointF) + /// + public T[] ToArray() where T : struct + { + int typeSize = Marshal.SizeOf(typeof (T)); + if (typeSize != sizeof (float)*3) + { + throw new OpenCvSharpException(); + } + + int arySize = Size; + if (arySize == 0) + { + return new T[0]; + } + T[] dst = new T[arySize]; + using (ArrayAddress1 dstPtr = new ArrayAddress1(dst)) + { + Util.Utility.CopyMemory(dstPtr, ElemPtr, typeSize*dst.Length); + } + return dst; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfVec4f.cs b/src/OpenCvSharp/Vector/VectorOfVec4f.cs new file mode 100644 index 000000000..5c1ef6846 --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfVec4f.cs @@ -0,0 +1,147 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfVec4f : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfVec4f() + { + ptr = NativeMethods.vector_Vec4f_new1(); + } + + /// + /// + /// + /// + public VectorOfVec4f(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_Vec4f_new2(new IntPtr(size)); + } + + /// + /// + /// + /// + public VectorOfVec4f(IEnumerable data) + { + if (data == null) + throw new ArgumentNullException("data"); + Vec4f[] array = EnumerableEx.ToArray(data); + ptr = NativeMethods.vector_Vec4f_new3(array, new IntPtr(array.Length)); + } + + /// + /// + /// + /// + public VectorOfVec4f(IntPtr p) + { + ptr = p; + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_Vec4f_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size + { + get { return NativeMethods.vector_Vec4f_getSize(ptr).ToInt32(); } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_Vec4f_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public Vec4f[] ToArray() + { + return ToArray(); + } + + /// + /// Converts std::vector to managed array + /// + /// structure that has four int members (ex. CvLineSegmentPoint, CvRect) + /// + public T[] ToArray() where T : struct + { + int typeSize = Marshal.SizeOf(typeof (T)); + if (typeSize != sizeof (float)*4) + { + throw new OpenCvSharpException(); + } + + int arySize = Size; + if (arySize == 0) + { + return new T[0]; + } + T[] dst = new T[arySize]; + using (ArrayAddress1 dstPtr = new ArrayAddress1(dst)) + { + Util.Utility.CopyMemory(dstPtr, ElemPtr, typeSize*dst.Length); + } + return dst; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfVec4i.cs b/src/OpenCvSharp/Vector/VectorOfVec4i.cs new file mode 100644 index 000000000..4d38394ff --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfVec4i.cs @@ -0,0 +1,147 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfVec4i : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfVec4i() + { + ptr = NativeMethods.vector_Vec4i_new1(); + } + + /// + /// + /// + /// + public VectorOfVec4i(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_Vec4i_new2(new IntPtr(size)); + } + + /// + /// + /// + /// + public VectorOfVec4i(IntPtr ptr) + { + this.ptr = ptr; + } + + /// + /// + /// + /// + public VectorOfVec4i(IEnumerable data) + { + if (data == null) + throw new ArgumentNullException("data"); + Vec4i[] array = EnumerableEx.ToArray(data); + ptr = NativeMethods.vector_Vec4i_new3(array, new IntPtr(array.Length)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_Vec4i_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size + { + get { return NativeMethods.vector_Vec4i_getSize(ptr).ToInt32(); } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_Vec4i_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public Vec4i[] ToArray() + { + return ToArray(); + } + + /// + /// Converts std::vector to managed array + /// + /// structure that has four int members (ex. CvLineSegmentPoint, CvRect) + /// + public T[] ToArray() where T : struct + { + int typeSize = Marshal.SizeOf(typeof (T)); + if (typeSize != sizeof (int)*4) + { + throw new OpenCvSharpException(); + } + + int arySize = Size; + if (arySize == 0) + { + return new T[0]; + } + T[] dst = new T[arySize]; + using (ArrayAddress1 dstPtr = new ArrayAddress1(dst)) + { + Util.Utility.CopyMemory(dstPtr, ElemPtr, typeSize*dst.Length); + } + return dst; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfVec6d.cs b/src/OpenCvSharp/Vector/VectorOfVec6d.cs new file mode 100644 index 000000000..487cddfda --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfVec6d.cs @@ -0,0 +1,147 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfVec6d : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed; + + #region Init and Dispose + + /// + /// + /// + public VectorOfVec6d() + { + ptr = NativeMethods.vector_Vec6d_new1(); + } + + /// + /// + /// + /// + public VectorOfVec6d(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_Vec6d_new2(new IntPtr(size)); + } + + /// + /// + /// + /// + public VectorOfVec6d(IEnumerable data) + { + if (data == null) + throw new ArgumentNullException("data"); + Vec6d[] array = EnumerableEx.ToArray(data); + ptr = NativeMethods.vector_Vec6d_new3(array, new IntPtr(array.Length)); + } + + /// + /// + /// + /// + public VectorOfVec6d(IntPtr p) + { + ptr = p; + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_Vec6d_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size + { + get { return NativeMethods.vector_Vec6d_getSize(ptr).ToInt32(); } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_Vec6d_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public Vec6d[] ToArray() + { + return ToArray(); + } + + /// + /// Converts std::vector to managed array + /// + /// structure that has four int members (ex. CvLineSegmentPoint, CvRect) + /// + public T[] ToArray() where T : struct + { + int typeSize = Marshal.SizeOf(typeof (T)); + if (typeSize != sizeof (double)*6) + { + throw new OpenCvSharpException(); + } + + int arySize = Size; + if (arySize == 0) + { + return new T[0]; + } + var dst = new T[arySize]; + using (var dstPtr = new ArrayAddress1(dst)) + { + Util.Utility.CopyMemory(dstPtr, ElemPtr, typeSize*dst.Length); + } + return dst; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfVec6f.cs b/src/OpenCvSharp/Vector/VectorOfVec6f.cs new file mode 100644 index 000000000..18351beda --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfVec6f.cs @@ -0,0 +1,147 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfVec6f : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfVec6f() + { + ptr = NativeMethods.vector_Vec6f_new1(); + } + + /// + /// + /// + /// + public VectorOfVec6f(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_Vec6f_new2(new IntPtr(size)); + } + + /// + /// + /// + /// + public VectorOfVec6f(IEnumerable data) + { + if (data == null) + throw new ArgumentNullException("data"); + Vec6f[] array = EnumerableEx.ToArray(data); + ptr = NativeMethods.vector_Vec6f_new3(array, new IntPtr(array.Length)); + } + + /// + /// + /// + /// + public VectorOfVec6f(IntPtr p) + { + ptr = p; + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_Vec6f_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size + { + get { return NativeMethods.vector_Vec6f_getSize(ptr).ToInt32(); } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_Vec6f_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public Vec6f[] ToArray() + { + return ToArray(); + } + + /// + /// Converts std::vector to managed array + /// + /// structure that has four int members (ex. CvLineSegmentPoint, CvRect) + /// + public T[] ToArray() where T : struct + { + int typeSize = Marshal.SizeOf(typeof (T)); + if (typeSize != sizeof (float)*6) + { + throw new OpenCvSharpException(); + } + + int arySize = Size; + if (arySize == 0) + { + return new T[0]; + } + var dst = new T[arySize]; + using (var dstPtr = new ArrayAddress1(dst)) + { + Util.Utility.CopyMemory(dstPtr, ElemPtr, typeSize*dst.Length); + } + return dst; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfVectorDMatch.cs b/src/OpenCvSharp/Vector/VectorOfVectorDMatch.cs new file mode 100644 index 000000000..a98d3d446 --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfVectorDMatch.cs @@ -0,0 +1,138 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfVectorDMatch : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfVectorDMatch() + { + ptr = NativeMethods.vector_vector_DMatch_new1(); + } + + /// + /// + /// + /// + public VectorOfVectorDMatch(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_vector_DMatch_new2(new IntPtr(size)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_vector_DMatch_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size1 + { + get { return NativeMethods.vector_vector_DMatch_getSize1(ptr).ToInt32(); } + } + + public int Size + { + get { return Size1; } + } + + /// + /// vector[i].size() + /// + public long[] Size2 + { + get + { + int size1 = Size1; + IntPtr[] size2Org = new IntPtr[size1]; + NativeMethods.vector_vector_DMatch_getSize2(ptr, size2Org); + long[] size2 = new long[size1]; + for (int i = 0; i < size1; i++) + { + size2[i] = size2Org[i].ToInt64(); + } + return size2; + } + } + + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_vector_DMatch_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public DMatch[][] ToArray() + { + int size1 = Size1; + if (size1 == 0) + return new DMatch[0][]; + long[] size2 = Size2; + + DMatch[][] ret = new DMatch[size1][]; + for (int i = 0; i < size1; i++) + { + ret[i] = new DMatch[size2[i]]; + } + using (ArrayAddress2 retPtr = new ArrayAddress2(ret)) + { + NativeMethods.vector_vector_DMatch_copy(ptr, retPtr); + } + return ret; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfVectorDouble.cs b/src/OpenCvSharp/Vector/VectorOfVectorDouble.cs new file mode 100644 index 000000000..016aa3870 --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfVectorDouble.cs @@ -0,0 +1,138 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfVectorDouble : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfVectorDouble() + { + ptr = NativeMethods.vector_vector_double_new1(); + } + + /// + /// + /// + /// + public VectorOfVectorDouble(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_vector_double_new2(new IntPtr(size)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_vector_double_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size1 + { + get { return NativeMethods.vector_vector_double_getSize1(ptr).ToInt32(); } + } + + public int Size + { + get { return Size1; } + } + + /// + /// vector[i].size() + /// + public long[] Size2 + { + get + { + int size1 = Size1; + IntPtr[] size2Org = new IntPtr[size1]; + NativeMethods.vector_vector_double_getSize2(ptr, size2Org); + long[] size2 = new long[size1]; + for (int i = 0; i < size1; i++) + { + size2[i] = size2Org[i].ToInt64(); + } + return size2; + } + } + + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_vector_double_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public double[][] ToArray() + { + int size1 = Size1; + if (size1 == 0) + return new double[0][]; + long[] size2 = Size2; + + var ret = new double[size1][]; + for (int i = 0; i < size1; i++) + { + ret[i] = new double[size2[i]]; + } + using (var retPtr = new ArrayAddress2(ret)) + { + NativeMethods.vector_vector_double_copy(ptr, retPtr); + } + return ret; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfVectorFloat.cs b/src/OpenCvSharp/Vector/VectorOfVectorFloat.cs new file mode 100644 index 000000000..1e4dcf915 --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfVectorFloat.cs @@ -0,0 +1,138 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfVectorFloat : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfVectorFloat() + { + ptr = NativeMethods.vector_vector_float_new1(); + } + + /// + /// + /// + /// + public VectorOfVectorFloat(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_vector_float_new2(new IntPtr(size)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_vector_float_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size1 + { + get { return NativeMethods.vector_vector_float_getSize1(ptr).ToInt32(); } + } + + public int Size + { + get { return Size1; } + } + + /// + /// vector[i].size() + /// + public long[] Size2 + { + get + { + int size1 = Size1; + IntPtr[] size2Org = new IntPtr[size1]; + NativeMethods.vector_vector_float_getSize2(ptr, size2Org); + long[] size2 = new long[size1]; + for (int i = 0; i < size1; i++) + { + size2[i] = size2Org[i].ToInt64(); + } + return size2; + } + } + + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_vector_float_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public float[][] ToArray() + { + int size1 = Size1; + if (size1 == 0) + return new float[0][]; + long[] size2 = Size2; + + var ret = new float[size1][]; + for (int i = 0; i < size1; i++) + { + ret[i] = new float[size2[i]]; + } + using (var retPtr = new ArrayAddress2(ret)) + { + NativeMethods.vector_vector_float_copy(ptr, retPtr); + } + return ret; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfVectorKeyPoint.cs b/src/OpenCvSharp/Vector/VectorOfVectorKeyPoint.cs new file mode 100644 index 000000000..586eaaa14 --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfVectorKeyPoint.cs @@ -0,0 +1,153 @@ +using System; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfVectorKeyPoint : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed; + + #region Init and Dispose + + /// + /// + /// + public VectorOfVectorKeyPoint() + { + ptr = NativeMethods.vector_vector_KeyPoint_new1(); + } + + /// + /// + /// + /// + public VectorOfVectorKeyPoint(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_vector_KeyPoint_new2(new IntPtr(size)); + } + + /// + /// + /// + /// + public VectorOfVectorKeyPoint(KeyPoint[][] values) + { + if (values == null) + throw new ArgumentNullException("values"); + + using (var aa = new ArrayAddress2(values)) + { + ptr = NativeMethods.vector_vector_KeyPoint_new3( + aa.Pointer, aa.Dim1Length, aa.Dim2Lengths); + } + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_vector_KeyPoint_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size1 + { + get { return NativeMethods.vector_vector_KeyPoint_getSize1(ptr).ToInt32(); } + } + + public int Size + { + get { return Size1; } + } + + /// + /// vector[i].size() + /// + public long[] Size2 + { + get + { + int size1 = Size1; + IntPtr[] size2Org = new IntPtr[size1]; + NativeMethods.vector_vector_KeyPoint_getSize2(ptr, size2Org); + long[] size2 = new long[size1]; + for (int i = 0; i < size1; i++) + { + size2[i] = size2Org[i].ToInt64(); + } + return size2; + } + } + + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_vector_KeyPoint_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public KeyPoint[][] ToArray() + { + int size1 = Size1; + if (size1 == 0) + return new KeyPoint[0][]; + long[] size2 = Size2; + + var ret = new KeyPoint[size1][]; + for (int i = 0; i < size1; i++) + { + ret[i] = new KeyPoint[size2[i]]; + } + using (var retPtr = new ArrayAddress2(ret)) + { + NativeMethods.vector_vector_KeyPoint_copy(ptr, retPtr); + } + return ret; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfVectorPoint.cs b/src/OpenCvSharp/Vector/VectorOfVectorPoint.cs new file mode 100644 index 000000000..4268e9332 --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfVectorPoint.cs @@ -0,0 +1,146 @@ +using System; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfVectorPoint : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Dispose + + /// + /// + /// + public VectorOfVectorPoint() + { + ptr = NativeMethods.vector_vector_Point_new1(); + } + + /// + /// + /// + /// + public VectorOfVectorPoint(IntPtr ptr) + { + this.ptr = ptr; + } + + /// + /// + /// + /// + public VectorOfVectorPoint(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_vector_Point_new2(new IntPtr(size)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_vector_Point_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size1 + { + get { return NativeMethods.vector_vector_Point_getSize1(ptr).ToInt32(); } + } + + public int Size + { + get { return Size1; } + } + + /// + /// vector.size() + /// + public long[] Size2 + { + get + { + int size1 = Size1; + IntPtr[] size2Org = new IntPtr[size1]; + NativeMethods.vector_vector_Point_getSize2(ptr, size2Org); + long[] size2 = new long[size1]; + for (int i = 0; i < size1; i++) + { + size2[i] = size2Org[i].ToInt64(); + } + return size2; + } + } + + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_vector_Point_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public Point[][] ToArray() + { + int size1 = Size1; + if (size1 == 0) + return new Point[0][]; + long[] size2 = Size2; + + Point[][] ret = new Point[size1][]; + for (int i = 0; i < size1; i++) + { + ret[i] = new Point[size2[i]]; + } + using (ArrayAddress2 retPtr = new ArrayAddress2(ret)) + { + NativeMethods.vector_vector_Point_copy(ptr, retPtr); + } + return ret; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/Vector/VectorOfVectorPoint2f.cs b/src/OpenCvSharp/Vector/VectorOfVectorPoint2f.cs new file mode 100644 index 000000000..0cc8fd41e --- /dev/null +++ b/src/OpenCvSharp/Vector/VectorOfVectorPoint2f.cs @@ -0,0 +1,145 @@ +using System; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + internal class VectorOfVectorPoint2f : DisposableCvObject, IStdVector + { + /// + /// Track whether Dispose has been called + /// + private bool disposed; + + #region Init and Dispose + + /// + /// + /// + public VectorOfVectorPoint2f() + { + ptr = NativeMethods.vector_vector_Point2f_new1(); + } + + /// + /// + /// + /// + public VectorOfVectorPoint2f(IntPtr ptr) + { + this.ptr = ptr; + } + + /// + /// + /// + /// + public VectorOfVectorPoint2f(int size) + { + if (size < 0) + throw new ArgumentOutOfRangeException("size"); + ptr = NativeMethods.vector_vector_Point2f_new2(new IntPtr(size)); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (IsEnabledDispose) + { + NativeMethods.vector_vector_Point2f_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// vector.size() + /// + public int Size1 + { + get { return NativeMethods.vector_vector_Point2f_getSize1(ptr).ToInt32(); } + } + + public int Size + { + get { return Size1; } + } + + /// + /// vector[i].size() + /// + public long[] Size2 + { + get + { + int size1 = Size1; + var size2Org = new IntPtr[size1]; + NativeMethods.vector_vector_Point2f_getSize2(ptr, size2Org); + var size2 = new long[size1]; + for (int i = 0; i < size1; i++) + { + size2[i] = size2Org[i].ToInt64(); + } + return size2; + } + } + + /// + /// &vector[0] + /// + public IntPtr ElemPtr + { + get { return NativeMethods.vector_vector_Point2f_getPointer(ptr); } + } + + #endregion + + #region Methods + + /// + /// Converts std::vector to managed array + /// + /// + public Point2f[][] ToArray() + { + int size1 = Size1; + if (size1 == 0) + return new Point2f[0][]; + long[] size2 = Size2; + + var ret = new Point2f[size1][]; + for (int i = 0; i < size1; i++) + { + ret[i] = new Point2f[size2[i]]; + } + using (var retPtr = new ArrayAddress2(ret)) + { + NativeMethods.vector_vector_Point2f_copy(ptr, retPtr); + } + return ret; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/bgsegm/BackgroundSubtractorGMG.cs b/src/OpenCvSharp/modules/bgsegm/BackgroundSubtractorGMG.cs new file mode 100644 index 000000000..668d2d556 --- /dev/null +++ b/src/OpenCvSharp/modules/bgsegm/BackgroundSubtractorGMG.cs @@ -0,0 +1,284 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + /// + /// Background Subtractor module. Takes a series of images and returns a sequence of mask (8UC1) + /// images of the same size, where 255 indicates Foreground and 0 represents Background. + /// + public class BackgroundSubtractorGMG : BackgroundSubtractor + { + /// + /// cv::Ptr<T> + /// + private Ptr objectPtr; + /// + /// + /// + private bool disposed; + + #region Init & Disposal + + /// + /// + /// + /// + /// + /// + public static BackgroundSubtractorGMG Create( + int initializationFrames = 120, double decisionThreshold = 0.8) + { + IntPtr ptr = NativeMethods.bgsegm_createBackgroundSubtractorGMG( + initializationFrames, decisionThreshold); + return new BackgroundSubtractorGMG(ptr); + } + + internal BackgroundSubtractorGMG(IntPtr ptr) + { + this.objectPtr = new Ptr(ptr); + this.ptr = objectPtr.Get(); + } + +#if LANG_JP + /// + /// \[X̉ + /// + /// + /// truȅꍇ́Ã\bh[UR[h璼ڂĂ΂ꂽƂB}l[WEA}l[Wõ\[XB + /// falsȅꍇ́Ã\bh̓^Ct@CiCUɂČĂ΂Aق̃IuWFNgQƂĂȂƂBA}l[W\[X̂݉B + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + if (objectPtr != null) + { + objectPtr.Dispose(); + } + objectPtr = null; + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + + /// + /// + /// + public int MaxFeatures + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.bgsegm_BackgroundSubtractorGMG_getMaxFeatures(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.bgsegm_BackgroundSubtractorGMG_setMaxFeatures(ptr, value); + } + } + + /// + /// + /// + public double DefaultLearningRate + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.bgsegm_BackgroundSubtractorGMG_getDefaultLearningRate(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.bgsegm_BackgroundSubtractorGMG_setDefaultLearningRate(ptr, value); + } + } + + /// + /// + /// + public int NumFrames + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.bgsegm_BackgroundSubtractorGMG_getNumFrames(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.bgsegm_BackgroundSubtractorGMG_setNumFrames(ptr, value); + } + } + + /// + /// + /// + public int QuantizationLevels + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.bgsegm_BackgroundSubtractorGMG_getQuantizationLevels(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.bgsegm_BackgroundSubtractorGMG_setQuantizationLevels(ptr, value); + } + } + + /// + /// + /// + public double BackgroundPrior + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.bgsegm_BackgroundSubtractorGMG_getBackgroundPrior(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.bgsegm_BackgroundSubtractorGMG_setBackgroundPrior(ptr, value); + } + } + + /// + /// + /// + public int SmoothingRadius + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.bgsegm_BackgroundSubtractorGMG_getSmoothingRadius(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.bgsegm_BackgroundSubtractorGMG_setSmoothingRadius(ptr, value); + } + } + + /// + /// + /// + public double DecisionThreshold + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.bgsegm_BackgroundSubtractorGMG_getDecisionThreshold(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.bgsegm_BackgroundSubtractorGMG_setDecisionThreshold(ptr, value); + } + } + + /// + /// + /// + public bool UpdateBackgroundModel + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.bgsegm_BackgroundSubtractorGMG_getUpdateBackgroundModel(ptr) != 0; + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.bgsegm_BackgroundSubtractorGMG_setUpdateBackgroundModel(ptr, value ? 1 : 0); + } + } + + /// + /// + /// + public double MinVal + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.bgsegm_BackgroundSubtractorGMG_getMinVal(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.bgsegm_BackgroundSubtractorGMG_setMinVal(ptr, value); + } + } + + /// + /// + /// + public double MaxVal + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.bgsegm_BackgroundSubtractorGMG_getMaxVal(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.bgsegm_BackgroundSubtractorGMG_setMaxVal(ptr, value); + } + } + + #endregion + + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/bgsegm/BackgroundSubtractorMOG.cs b/src/OpenCvSharp/modules/bgsegm/BackgroundSubtractorMOG.cs new file mode 100644 index 000000000..8cf5a5759 --- /dev/null +++ b/src/OpenCvSharp/modules/bgsegm/BackgroundSubtractorMOG.cs @@ -0,0 +1,172 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + /// + /// Gaussian Mixture-based Backbround/Foreground Segmentation Algorithm + /// + public class BackgroundSubtractorMOG : BackgroundSubtractor + { + /// + /// cv::Ptr<T> + /// + private Ptr objectPtr; + + /// + /// + /// + private bool disposed; + + #region Init & Disposal + + /// + /// + /// + /// + /// + /// + /// + /// + public static BackgroundSubtractorMOG Create( + int history = 200, int nMixtures = 5, double backgroundRatio = 0.7, double noiseSigma = 0) + { + IntPtr ptr = NativeMethods.bgsegm_createBackgroundSubtractorMOG( + history, nMixtures, backgroundRatio, noiseSigma); + return new BackgroundSubtractorMOG(ptr); + } + + internal BackgroundSubtractorMOG(IntPtr ptr) + { + this.objectPtr = new Ptr(ptr); + this.ptr = objectPtr.Get(); + } + +#if LANG_JP + /// + /// \[X̉ + /// + /// + /// truȅꍇ́Ã\bh[UR[h璼ڂĂ΂ꂽƂB}l[WEA}l[Wõ\[XB + /// falsȅꍇ́Ã\bh̓^Ct@CiCUɂČĂ΂Aق̃IuWFNgQƂĂȂƂBA}l[W\[X̂݉B + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + if (objectPtr != null) + { + objectPtr.Dispose(); + } + objectPtr = null; + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// + /// + public int History + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.bgsegm_BackgroundSubtractorMOG_getHistory(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.bgsegm_BackgroundSubtractorMOG_setHistory(ptr, value); + } + } + + /// + /// + /// + public int NMixtures + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.bgsegm_BackgroundSubtractorMOG_getNMixtures(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.bgsegm_BackgroundSubtractorMOG_setNMixtures(ptr, value); + } + } + + /// + /// + /// + public double BackgroundRatio + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.bgsegm_BackgroundSubtractorMOG_getBackgroundRatio(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.bgsegm_BackgroundSubtractorMOG_setBackgroundRatio(ptr, value); + } + } + + /// + /// + /// + public double NoiseSigma + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.bgsegm_BackgroundSubtractorMOG_getNoiseSigma(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.bgsegm_BackgroundSubtractorMOG_setNoiseSigma(ptr, value); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/calib3d/Enum/CalibrationFlags.cs b/src/OpenCvSharp/modules/calib3d/Enum/CalibrationFlags.cs new file mode 100644 index 000000000..1a78d8865 --- /dev/null +++ b/src/OpenCvSharp/modules/calib3d/Enum/CalibrationFlags.cs @@ -0,0 +1,210 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cvCalibrateCamera2やcvStereoCalibrateの処理フラグ + /// +#else + /// + /// Different flags for cvCalibrateCamera2 and cvStereoCalibrate + /// +#endif + [Flags] + public enum CalibrationFlags : int + { + /// + /// + /// + None = 0, + +#if LANG_JP + /// + /// intrinsic_matrixは最適化が行われた正しい初 期値 fx, fy, cx, cyを含む.このパラメータがセッ トされていない場合,(cx, cy) は最初に画像中心にセットされ(image_size はこの計算に用いられ る),焦点距離は最小二乗法で計算される. + /// +#else + /// + /// The flag allows the function to optimize some or all of the intrinsic parameters, depending on the other flags, but the initial values are provided by the user + /// +#endif + UseIntrinsicGuess = 0x00001, + +#if LANG_JP + /// + /// fx と fy のうちのどちらか一方だけが独立変数であるとし,アスペクト比 fx/fy が intrinsic_matrix の初期値として与えられた値か ら変わらないように最適化処理を行う. + /// この場合,実際に用いられる(fx, fy)の初期値は,行列から与えられる (CV_CALIB_USE_INTRINSIC_GUESSがセットされている場合)か,何らかの方法で推定される(後者の場合は, fx, fy は任意の値にセットされ,それらの比率だけが用いられる). + /// +#else + /// + /// fyk is optimized, but the ratio fxk/fyk is fixed. + /// +#endif + FixAspectRatio = 0x00002, + +#if LANG_JP + /// + /// 主点(光学中心) は最適化中には変化せず,中心または別の指定された場所(このパラメータと同時 に UseIntrinsicGuess がセットされ ている場合)に固定される + /// +#else + /// + /// The principal points are fixed during the optimization. + /// +#endif + FixPrincipalPoint = 0x00004, + +#if LANG_JP + /// + /// 円周方向の歪み係数は0にセットされ,最適化中は変化しない + /// +#else + /// + /// Tangential distortion coefficients are set to zeros and do not change during the optimization. + /// +#endif + ZeroTangentDist = 0x00008, + +#if LANG_JP + /// + /// fxk および fyk が固定される. + /// +#else + /// + /// fxk and fyk are fixed. + /// +#endif + FixFocalLength = 0x00010, + +#if LANG_JP + /// + /// 0 番目の歪み係数(k1)が固定される. + /// +#else + /// + /// The 0-th distortion coefficients (k1) are fixed + /// +#endif + FixK1 = 0x00020, + + +#if LANG_JP + /// + /// 1 番目の歪み係数(k2)が固定される. + /// +#else + /// + /// The 1-th distortion coefficients (k2) are fixed + /// +#endif + FixK2 = 0x00040, + + +#if LANG_JP + /// + /// 4 番目の歪み係数(k3)が固定される. + /// +#else + /// + /// The 4-th distortion coefficients (k3) are fixed + /// +#endif + FixK3 = 0x00080, + + +#if LANG_JP + /// + /// 最適化中に,指定した半径方向の歪み係数を変更しません. + /// CV_CALIB_USE_INTRINSIC_GUESS が指定されている場合は,与えられた distCoeffs 行列の係数が利用されます.そうでない場合は,0が利用されます. + /// +#else + /// + /// Do not change the corresponding radial distortion coefficient during the optimization. + /// If CV_CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the supplied distCoeffs matrix is used, otherwise it is set to 0. + /// +#endif + FixK4 = 0x00800, + + +#if LANG_JP + /// + /// 最適化中に,指定した半径方向の歪み係数を変更しません. + /// CV_CALIB_USE_INTRINSIC_GUESS が指定されている場合は,与えられた distCoeffs 行列の係数が利用されます.そうでない場合は,0が利用されます. + /// +#else + /// + /// Do not change the corresponding radial distortion coefficient during the optimization. + /// If CV_CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the supplied distCoeffs matrix is used, otherwise it is set to 0. + /// +#endif + FixK5 = 0x01000, + + +#if LANG_JP + /// + /// 最適化中に,指定した半径方向の歪み係数を変更しません. + /// CV_CALIB_USE_INTRINSIC_GUESS が指定されている場合は,与えられた distCoeffs 行列の係数が利用されます.そうでない場合は,0が利用されます. + /// +#else + /// + /// Do not change the corresponding radial distortion coefficient during the optimization. + /// If CV_CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the supplied distCoeffs matrix is used, otherwise it is set to 0. + /// +#endif + FixK6 = 0x02000, + +#if LANG_JP + /// + /// 係数 k4, k5, k6 を有効にします. + /// 後方互換性を保つためには,このフラグを明示的に指定して,キャリブレーション関数が rational モデルを利用して8個の係数を返すようにします. + /// このフラグが指定されない場合,関数は5つの歪み係数のみを計算し ます. + /// +#else + /// + /// Enable coefficients k4, k5 and k6. + /// To provide the backward compatibility, this extra flag should be explicitly specified to make the calibration function + /// use the rational model and return 8 coefficients. If the flag is not set, the function will compute only 5 distortion coefficients. + /// +#endif + RationalModel = 0x04000, + + /// + /// + /// + ThinPrismModel = 0x08000, + + /// + /// + /// + FixS1S2S3S4 = 0x08000, + +#if LANG_JP + /// + /// これがセットされた場合,外部パラメータのみが最適化されるように, camera_matrix1,2 と dist_coeffs1,2 が固定される. + /// +#else + /// + /// If it is set, camera_matrix1,2, as well as dist_coeffs1,2 are fixed, so that only extrinsic parameters are optimized. + /// +#endif + FixIntrinsic = 0x00100, + +#if LANG_JP + /// + /// 強制的に,fx0=fx1, fy0=fy1 とする. + /// +#else + /// + /// Enforces fx0=fx1 and fy0=fy1. CV_CALIB_ZERO_TANGENT_DIST - Tangential distortion coefficients for each camera are set to zeros and fixed there. + /// +#endif + SameFocalLength = 0x00200, + + /// + /// for stereo rectification + /// + ZeroDisparity = 0x00400, + } +} + + + diff --git a/src/OpenCvSharp/modules/calib3d/Enum/ChessboardFlags.cs b/src/OpenCvSharp/modules/calib3d/Enum/ChessboardFlags.cs new file mode 100644 index 000000000..0feb4ca07 --- /dev/null +++ b/src/OpenCvSharp/modules/calib3d/Enum/ChessboardFlags.cs @@ -0,0 +1,62 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cvFindChessboardCornersの処理フラグ + /// +#else + /// + /// Various operation flags for cvFindChessboardCorners + /// +#endif + [Flags] + public enum ChessboardFlags + { + /// + /// + /// + None = 0, + +#if LANG_JP + /// + /// 画像を二値化する際に,固定の閾値を使うのではなく,(画像の平均輝度値から計算される)適応的な閾値を用いる + /// +#else + /// + /// Use adaptive thresholding to convert the image to black-n-white, rather than a fixed threshold level (computed from the average image brightness). + /// +#endif + AdaptiveThresh = 1, + + +#if LANG_JP + /// + /// 固定閾値処理または適応的閾値処理を行う前に,cvNormalizeHistを用いて画像を正規化する + /// +#else + /// + /// Normalize the image using cvNormalizeHist before applying fixed or adaptive thresholding. + /// +#endif + NormalizeImage = 2, + + +#if LANG_JP + /// + /// 輪郭の探索 段階で抽出される間違った四角形を無視するために,追加基準(輪郭面積,周囲長,形は正方形など)を使用する + /// +#else + /// + /// Use additional criteria (like contour area, perimeter, square-like shape) to filter out false quads that are extracted at the contour retrieval stage. + /// +#endif + FilterQuads = 4, + + /// + /// + /// + FastCheck = 8 + } +} diff --git a/src/OpenCvSharp/modules/calib3d/Enum/FindCirclesGridFlags.cs b/src/OpenCvSharp/modules/calib3d/Enum/FindCirclesGridFlags.cs new file mode 100644 index 000000000..5cdf751db --- /dev/null +++ b/src/OpenCvSharp/modules/calib3d/Enum/FindCirclesGridFlags.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +namespace OpenCvSharp +{ + /// + /// Method for solving a PnP problem: + /// + [Flags] + public enum FindCirclesGridFlags : int + { + /// + /// uses symmetric pattern of circles. + /// + SymmetricGrid = 1, + + /// + /// uses asymmetric pattern of circles. + /// + AsymmetricGrid = 2, + + /// + /// uses a special algorithm for grid detection. It is more robust to perspective distortions but much more sensitive to background clutter. + /// + Clustering = 4, + } +} diff --git a/src/OpenCvSharp/modules/calib3d/Enum/FundamentalMatMethod.cs b/src/OpenCvSharp/modules/calib3d/Enum/FundamentalMatMethod.cs new file mode 100644 index 000000000..d2419c07d --- /dev/null +++ b/src/OpenCvSharp/modules/calib3d/Enum/FundamentalMatMethod.cs @@ -0,0 +1,64 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// 基礎行列の計算手法 + /// +#else + /// + /// Method for computing the fundamental matrix + /// +#endif + [Flags] + public enum FundamentalMatMethod : int + { +#if LANG_JP + /// + /// 7-pointアルゴリズム. N == 7 + /// +#else + /// + /// for 7-point algorithm. N == 7 + /// +#endif + Point7 = 1, + +#if LANG_JP + /// + /// 8-pointアルゴリズム. N > 8 + /// +#else + /// + /// for 8-point algorithm. N >= 8 + /// [CV_FM_8POINT] + /// +#endif + Point8 = 2, + +#if LANG_JP + /// + /// LMedSアルゴリズム. N >= 8 + /// +#else + /// + /// for LMedS algorithm. N > 8 + /// +#endif + LMedS = 4, + + +#if LANG_JP + /// + /// RANSAC アルゴリズム. N > 8 + /// [CV_FM_RANSAC] + /// +#else + /// + /// for RANSAC algorithm. N > 8 + /// +#endif + Ransac = 8, + } +} diff --git a/src/OpenCvSharp/modules/calib3d/Enum/HomographyMethods.cs b/src/OpenCvSharp/modules/calib3d/Enum/HomographyMethods.cs new file mode 100644 index 000000000..5eb8ea06e --- /dev/null +++ b/src/OpenCvSharp/modules/calib3d/Enum/HomographyMethods.cs @@ -0,0 +1,57 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// ホモグラフィ行列を計算するための手法 + /// +#else + /// + /// The method used to computed homography matrix + /// +#endif + [Flags] + public enum HomographyMethods : int + { +#if LANG_JP + /// + /// 全ての点のペアを利用する標準的な手法 + /// +#else + /// + /// Regular method using all the point pairs + /// +#endif + None = 0, + + +#if LANG_JP + /// + /// LMedS推定によるロバストな手法 + /// +#else + /// + /// Least-Median robust method + /// +#endif + LMedS = 4, + + +#if LANG_JP + /// + /// RANSACアルゴリズムに基づくロバストな手法 + /// +#else + /// + /// RANSAC-based robust method + /// +#endif + Ransac = 8, + + /// + /// RHO algorithm + /// + Rho = 16, + } +} diff --git a/src/OpenCvSharp/modules/calib3d/Enum/SolvePnPFlags.cs b/src/OpenCvSharp/modules/calib3d/Enum/SolvePnPFlags.cs new file mode 100644 index 000000000..a28659007 --- /dev/null +++ b/src/OpenCvSharp/modules/calib3d/Enum/SolvePnPFlags.cs @@ -0,0 +1,39 @@ + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + /// + /// Method for solving a PnP problem: + /// + public enum SolvePnPFlags : int + { + /// + /// Iterative method is based on Levenberg-Marquardt optimization. + /// In this case the function finds such a pose that minimizes reprojection error, + /// that is the sum of squared distances between the observed projections imagePoints and the projected (using projectPoints() ) objectPoints . + /// + Iterative = 0, + + /// + /// Method has been introduced by F.Moreno-Noguer, V.Lepetit and P.Fua in the paper “EPnP: Efficient Perspective-n-Point Camera Pose Estimation”. + /// + EPNP = 1, + + /// + /// Method is based on the paper of X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang“Complete Solution Classification for + /// the Perspective-Three-Point Problem”. In this case the function requires exactly four object and image points. + /// + P3P = 2, + + /// + /// Joel A. Hesch and Stergios I. Roumeliotis. "A Direct Least-Squares (DLS) Method for PnP" + /// + DLS = 3, + + /// + /// A.Penate-Sanchez, J.Andrade-Cetto, F.Moreno-Noguer. "Exhaustive Linearization for Robust Camera Pose and Focal Length Estimation" + /// + UPNP = 4, + } +} diff --git a/src/OpenCvSharp/modules/calib3d/Enum/StereoRectificationFlags.cs b/src/OpenCvSharp/modules/calib3d/Enum/StereoRectificationFlags.cs new file mode 100644 index 000000000..e1da2b0f4 --- /dev/null +++ b/src/OpenCvSharp/modules/calib3d/Enum/StereoRectificationFlags.cs @@ -0,0 +1,40 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// 輪郭の近似手法 + /// +#else + /// + /// The operation flags for cvStereoRectify + /// +#endif + public enum StereoRectificationFlags : int + { +#if LANG_JP + /// + /// フラグなし (=0). + /// 利用できる画像領域が最大になるように(エピポーラ線の傾きに従って)片方の画像を水平・垂直方向に移動する. + /// +#else + /// + /// Default value (=0). + /// the function can shift one of the image in horizontal or vertical direction (depending on the orientation of epipolar lines) in order to maximise the useful image area. + /// +#endif + None = 0, + + +#if LANG_JP + /// + /// 平行化後のビューにおいて各カメラの主点(光学中心)が同じ座標になるようにする. + /// +#else + /// + /// the function makes the principal points of each camera have the same pixel coordinates in the rectified views. + /// +#endif + ZeroDisparity = 1024, + }; +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/calib3d/StereoBM.cs b/src/OpenCvSharp/modules/calib3d/StereoBM.cs new file mode 100644 index 000000000..405d6c25c --- /dev/null +++ b/src/OpenCvSharp/modules/calib3d/StereoBM.cs @@ -0,0 +1,247 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming +#pragma warning disable 1591 + +#if LANG_JP + /// + /// セミグローバルブロックマッチングアルゴリズムを用てステレオ対応点探索を行うためのクラス + /// +#else + /// + /// Semi-Global Stereo Matching + /// +#endif + public class StereoBM : StereoMatcher + { + private bool disposed; + private Ptr ptrObj; + + #region Init and Disposal + + /// + /// constructor + /// + protected StereoBM(IntPtr ptr) + : base(ptr) + { + ptrObj = new Ptr(ptr); + } + + /// + /// + /// + /// + /// + /// + public static StereoBM Create(int numDisparities = 0, int blockSize = 21) + { + IntPtr ptrObj = NativeMethods.calib3d_StereoBM_create(numDisparities, blockSize); + return new StereoBM(ptrObj); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + } + ptrObj = null; + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + + /// + /// + /// + public int PreFilterType + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.calib3d_StereoBM_getPreFilterType(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.calib3d_StereoBM_setPreFilterType(ptr, value); + } + } + + /// + /// + /// + public int PreFilterSize + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.calib3d_StereoBM_getPreFilterSize(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.calib3d_StereoBM_setPreFilterSize(ptr, value); + } + } + + /// + /// + /// + public int PreFilterCap + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.calib3d_StereoBM_getPreFilterCap(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.calib3d_StereoBM_setPreFilterCap(ptr, value); + } + } + + /// + /// + /// + public int TextureThreshold + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.calib3d_StereoBM_getTextureThreshold(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.calib3d_StereoBM_setTextureThreshold(ptr, value); + } + } + + /// + /// + /// + public int UniquenessRatio + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.calib3d_StereoBM_getUniquenessRatio(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.calib3d_StereoBM_setUniquenessRatio(ptr, value); + } + } + + /// + /// + /// + public int SmallerBlockSize + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.calib3d_StereoBM_getSmallerBlockSize(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.calib3d_StereoBM_setSmallerBlockSize(ptr, value); + } + } + + /// + /// + /// + public Rect ROI1 + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.calib3d_StereoBM_getROI1(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.calib3d_StereoBM_setROI1(ptr, value); + } + } + + /// + /// + /// + public Rect ROI2 + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.calib3d_StereoBM_getROI2(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.calib3d_StereoBM_setROI2(ptr, value); + } + } + + #endregion + + } +} diff --git a/src/OpenCvSharp/modules/calib3d/StereoMatcher.cs b/src/OpenCvSharp/modules/calib3d/StereoMatcher.cs new file mode 100644 index 000000000..2d3774ab3 --- /dev/null +++ b/src/OpenCvSharp/modules/calib3d/StereoMatcher.cs @@ -0,0 +1,116 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming +#pragma warning disable 1591 + + /// + /// + /// + public class StereoMatcher : Algorithm + { + /// + /// constructor + /// + protected StereoMatcher(IntPtr ptr) + { + this.ptr = ptr; + } + + #region Properties + + /// + /// + /// + public int MinDisparity + { + get + { + return NativeMethods.calib3d_StereoMatcher_getMinDisparity(ptr); + } + set + { + NativeMethods.calib3d_StereoMatcher_setMinDisparity(ptr, value); + } + } + + /// + /// + /// + public int NumDisparities + { + get + { + return NativeMethods.calib3d_StereoMatcher_getNumDisparities(ptr); + } + set + { + NativeMethods.calib3d_StereoMatcher_setNumDisparities(ptr, value); + } + } + + /// + /// + /// + public int BlockSize + { + get + { + return NativeMethods.calib3d_StereoMatcher_getBlockSize(ptr); + } + set + { + NativeMethods.calib3d_StereoMatcher_setBlockSize(ptr, value); + } + } + + /// + /// + /// + public int SpeckleWindowSize + { + get + { + return NativeMethods.calib3d_StereoMatcher_getSpeckleWindowSize(ptr); + } + set + { + NativeMethods.calib3d_StereoMatcher_setSpeckleWindowSize(ptr, value); + } + } + + /// + /// + /// + public int SpeckleRange + { + get + { + return NativeMethods.calib3d_StereoMatcher_getSpeckleRange(ptr); + } + set + { + NativeMethods.calib3d_StereoMatcher_setSpeckleRange(ptr, value); + } + } + + /// + /// + /// + public int Disp12MaxDiff + { + get + { + return NativeMethods.calib3d_StereoMatcher_getDisp12MaxDiff(ptr); + } + set + { + NativeMethods.calib3d_StereoMatcher_setDisp12MaxDiff(ptr, value); + } + } + + #endregion + + } +} diff --git a/src/OpenCvSharp/modules/calib3d/StereoSGBM.cs b/src/OpenCvSharp/modules/calib3d/StereoSGBM.cs new file mode 100644 index 000000000..a7ba65efb --- /dev/null +++ b/src/OpenCvSharp/modules/calib3d/StereoSGBM.cs @@ -0,0 +1,215 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming +#pragma warning disable 1591 + + /// + /// + /// + public enum StereoSGBMMode + { + SGBM = 0, + HH = 1, + } + +#if LANG_JP + /// + /// セミグローバルブロックマッチングアルゴリズムを用てステレオ対応点探索を行うためのクラス + /// +#else + /// + /// Semi-Global Stereo Matching + /// +#endif + public class StereoSGBM : StereoMatcher + { + private bool disposed; + private Ptr ptrObj; + + #region Init and Disposal + + /// + /// constructor + /// + protected StereoSGBM(IntPtr ptr) : base(ptr) + { + ptrObj = new Ptr(ptr); + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static StereoSGBM Create( + int minDisparity, int numDisparities, int blockSize, + int p1 = 0, int p2 = 0, int disp12MaxDiff = 0, + int preFilterCap = 0, int uniquenessRatio = 0, + int speckleWindowSize = 0, int speckleRange = 0, + StereoSGBMMode mode = StereoSGBMMode.SGBM) + { + IntPtr ptrObj = NativeMethods.calib3d_StereoSGBM_create( + minDisparity, numDisparities, blockSize, + p1, p2, disp12MaxDiff, preFilterCap, uniquenessRatio, + speckleWindowSize, speckleRange, (int) mode); + return new StereoSGBM(ptrObj); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + } + ptrObj = null; + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + + /// + /// + /// + public int PreFilterCap + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.calib3d_StereoSGBM_getPreFilterCap(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.calib3d_StereoSGBM_setPreFilterCap(ptr, value); + } + } + + /// + /// + /// + public int UniquenessRatio + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.calib3d_StereoSGBM_getUniquenessRatio(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.calib3d_StereoSGBM_setUniquenessRatio(ptr, value); + } + } + + /// + /// + /// + public int P1 + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.calib3d_StereoSGBM_getP1(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.calib3d_StereoSGBM_setP1(ptr, value); + } + } + + /// + /// + /// + public int P2 + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.calib3d_StereoSGBM_getP2(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.calib3d_StereoSGBM_setP2(ptr, value); + } + } + + /// + /// + /// + public StereoSGBMMode Mode + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return (StereoSGBMMode)NativeMethods.calib3d_StereoSGBM_getMode(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.calib3d_StereoSGBM_setMode(ptr, (int)value); + } + } + + #endregion + + } +} diff --git a/src/OpenCvSharp/modules/core/Algorithm.cs b/src/OpenCvSharp/modules/core/Algorithm.cs new file mode 100644 index 000000000..8a2488fdf --- /dev/null +++ b/src/OpenCvSharp/modules/core/Algorithm.cs @@ -0,0 +1,86 @@ +using System; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// Base class for high-level OpenCV algorithms + /// + public abstract class Algorithm : DisposableCvObject + { + /// + /// Stores algorithm parameters in a file storage + /// + /// + public virtual void Write(FileStorage fs) + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + if (fs == null) + throw new ArgumentNullException("fs"); + + NativeMethods.core_Algorithm_write(ptr, fs.CvPtr); + } + + /// + /// Reads algorithm parameters from a file storage + /// + /// + public virtual void Read(FileNode fn) + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + if (fn == null) + throw new ArgumentNullException("fn"); + + NativeMethods.core_Algorithm_read(ptr, fn.CvPtr); + } + + /// + /// Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read + /// + /// + public virtual bool Empty + { + get + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + + return NativeMethods.core_Algorithm_empty(ptr) != 0; + } + } + + /// + /// Saves the algorithm to a file. + /// In order to make this method work, the derived class must + /// implement Algorithm::write(FileStorage fs). + /// + /// + public virtual void Save(string filename) + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + if (filename == null) + throw new ArgumentNullException("filename"); + + NativeMethods.core_Algorithm_save(ptr, filename); + } + + /// + /// Returns the algorithm string identifier. + /// This string is used as top level xml/yml node tag when the object + /// is saved to a file or string. + /// + /// + public virtual String GetDefaultName() + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + + var buf = new StringBuilder(1024); + NativeMethods.core_Algorithm_getDefaultName(ptr, buf, buf.Capacity); + return buf.ToString(); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Enum/AlgorithmParamType.cs b/src/OpenCvSharp/modules/core/Enum/AlgorithmParamType.cs new file mode 100644 index 000000000..f2e58e8db --- /dev/null +++ b/src/OpenCvSharp/modules/core/Enum/AlgorithmParamType.cs @@ -0,0 +1,25 @@ +using System; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + /// + /// cv::Algorithm parameter type + /// + public enum AlgorithmParamType : int + { + Int = 0, + Boolean = 1, + Real = 2, + String = 3, + Mat = 4, + MatVector = 5, + Algorithm = 6, + Float = 7, + UnsignedInt = 8, + UInt64 = 9, + Short = 10, + UChar = 11 + } +} diff --git a/src/OpenCvSharp/modules/core/Enum/CmpTypes.cs b/src/OpenCvSharp/modules/core/Enum/CmpTypes.cs new file mode 100644 index 000000000..5b2d4f16b --- /dev/null +++ b/src/OpenCvSharp/modules/core/Enum/CmpTypes.cs @@ -0,0 +1,88 @@ + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + +#if LANG_JP + /// + /// cvCmp, cvCmpS等のメソッドで用いる, CvArrの比較方法 + /// +#else + /// + /// The flag specifying the relation between the elements to be checked + /// +#endif + public enum CmpTypes : int + { +#if LANG_JP + /// + /// src1(I) と value は等しい + /// +#else + /// + /// src1(I) "equal to" src2(I) + /// +#endif + EQ = 0, + + +#if LANG_JP + /// + /// src1(I) は value より大きい + /// +#else + /// + /// src1(I) "greater than" src2(I) + /// +#endif + GT = 1, + + +#if LANG_JP + /// + /// src1(I) は value より大きいか等しい + /// +#else + /// + /// src1(I) "greater or equal" src2(I) + /// +#endif + GE = 2, + + +#if LANG_JP + /// + /// src1(I) は value より小さい + /// +#else + /// + /// src1(I) "less than" src2(I) + /// +#endif + LT = 3, + + +#if LANG_JP + /// + /// src1(I) は value より小さいか等しい + /// +#else + /// + /// src1(I) "less or equal" src2(I) + /// +#endif + LE = 4, + + +#if LANG_JP + /// + /// src1(I) と value は等しくない + /// +#else + /// + /// src1(I) "not equal to" src2(I) + /// +#endif + NE = 5, + } +} diff --git a/src/OpenCvSharp/modules/core/Enum/CovarFlags.cs b/src/OpenCvSharp/modules/core/Enum/CovarFlags.cs new file mode 100644 index 000000000..8e4353f98 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Enum/CovarFlags.cs @@ -0,0 +1,106 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// CovarMatrixの処理フラグ + /// +#else + /// + /// Operation flags for Covariation + /// +#endif + [Flags] + public enum CovarFlags : int + { +#if LANG_JP + /// + /// scale * [vects[0]-avg,vects[1]-avg,...]^T * [vects[0]-avg,vects[1]-avg,...] + /// すなわち,共変動行列はcount×countである. そのような一般的でない共変動行列は, + /// 非常に大きなベクトル集合に対する高速な主成分分析のために使用される(例えば,顔認識のための固有顔). + /// この「スクランブルされた」行列の固有値は,真共変動行列の固有値と一致し, + /// そして「真の」固有ベクトルは「スクランブルされた」共変動行列の固有ベクトルから容易に計算できる. + /// +#else + /// + /// scale * [vects[0]-avg,vects[1]-avg,...]^T * [vects[0]-avg,vects[1]-avg,...] + /// that is, the covariation matrix is count×count. Such an unusual covariation matrix is used for fast PCA of a set of very large vectors + /// (see, for example, Eigen Faces technique for face recognition). Eigenvalues of this "scrambled" matrix will match to the eigenvalues of + /// the true covariation matrix and the "true" eigenvectors can be easily calculated from the eigenvectors of the "scrambled" covariation matrix. + /// +#endif + Scrambled = 0, + + +#if LANG_JP + /// + /// scale * [vects[0]-avg,vects[1]-avg,...]*[vects[0]-avg,vects[1]-avg,...]^T + /// つまり,cov_matはすべての入力ベクトルの要素の合計と同じサイズの一般的な共変動行列となる. + /// CV_COVAR_SCRAMBLEDとCV_COVAR_NORMALのどちらか一つは必ず指定されなくてはならない. + /// +#else + /// + /// scale * [vects[0]-avg,vects[1]-avg,...]*[vects[0]-avg,vects[1]-avg,...]^T + /// that is, cov_mat will be a usual covariation matrix with the same linear size as the total number of elements in every input vector. + /// One and only one of CV_COVAR_SCRAMBLED and CV_COVAR_NORMAL must be specified + /// +#endif + Normal = 1, + + +#if LANG_JP + /// + /// このフラグが指定された場合,関数は入力ベクトルから平均を計算せず,引数で指定された平均ベクトルを使用する. + /// 平均が何らかの方法で既に計算されている場合,または共変動行列が部分的に計算されている場合 (この場合,avgは入力ベクトルの一部の平均ではなく,全ての平均ベクトルである)に有用である. + /// +#else + /// + /// If the flag is specified, the function does not calculate avg from the input vectors, + /// but, instead, uses the passed avg vector. This is useful if avg has been already calculated somehow, + /// or if the covariation matrix is calculated by parts - in this case, avg is not a mean vector of the input sub-set of vectors, + /// but rather the mean vector of the whole set. + /// +#endif + UseAvg = 2, + + +#if LANG_JP + /// + /// このフラグが指定された場合, 共変動行列は入力ベクトルの数によってスケーリングされる. + /// +#else + /// + /// If the flag is specified, the covariation matrix is scaled by the number of input vectors. + /// +#endif + Scale = 4, + + +#if LANG_JP + /// + /// 全ての入力ベクトルは単一の行列(vects[0])の行として保存されることを意味する. + /// そしてavgは適切な大きさの1行のベクトルでなければならない. + /// +#else + /// + /// Means that all the input vectors are stored as rows of a single matrix, vects[0].count is ignored in this case, + /// and avg should be a single-row vector of an appropriate size. + /// +#endif + Rows = 8, + + +#if LANG_JP + /// + /// 全ての入力ベクトルは単一の行列(vects[0])の列として保存されることを意味する.そしてavgは適切な大きさの1列のベクトルでなければならない. + /// +#else + /// + /// Means that all the input vectors are stored as columns of a single matrix, vects[0].count is ignored in this case, + /// and avg should be a single-column vector of an appropriate size. + /// +#endif + Cols = 16, + } +} diff --git a/src/OpenCvSharp/modules/core/Enum/CpuFeatures.cs b/src/OpenCvSharp/modules/core/Enum/CpuFeatures.cs new file mode 100644 index 000000000..d2e9d7791 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Enum/CpuFeatures.cs @@ -0,0 +1,37 @@ +namespace OpenCvSharp +{ + /// + /// + /// + public enum CpuFeatures : int + { +#pragma warning disable 1591 +// ReSharper disable InconsistentNaming + MMX = 1, + SSE = 2, + SSE2 = 3, + SSE3 = 4, + SSSE3 = 5, + SSE4_1 = 6, + SSE4_2 = 7, + POPCNT = 8, + + AVX = 10, + AVX2 = 11, + FMA3 = 12, + + AVX_512F = 13, + AVX_512BW = 14, + AVX_512CD = 15, + AVX_512DQ = 16, + AVX_512ER = 17, + AVX_512IFMA512 = 18, + AVX_512PF = 19, + AVX_512VBMI = 20, + AVX_512VL = 21, + + NEON = 100 + } +} + + diff --git a/src/OpenCvSharp/modules/core/Enum/CriteriaType.cs b/src/OpenCvSharp/modules/core/Enum/CriteriaType.cs new file mode 100644 index 000000000..5972e13f0 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Enum/CriteriaType.cs @@ -0,0 +1,52 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// 終了条件の種類 + /// +#else + /// + /// Type of termination criteria + /// +#endif + [Flags] + public enum CriteriaType : int + { +#if LANG_JP + /// + /// 繰り返し回数による条件 + /// +#else + /// + /// the maximum number of iterations or elements to compute + /// +#endif + Count = 1, + + +#if LANG_JP + /// + /// 繰り返し回数による条件 + /// +#else + /// + /// the maximum number of iterations or elements to compute + /// +#endif + MaxIter = Count, + + +#if LANG_JP + /// + /// 目標精度(ε)による条件 + /// +#else + /// + /// the desired accuracy or change in parameters at which the iterative algorithm stops + /// +#endif + Eps = 2, + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/core/Enum/DctFlags.cs b/src/OpenCvSharp/modules/core/Enum/DctFlags.cs new file mode 100644 index 000000000..67c4edb86 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Enum/DctFlags.cs @@ -0,0 +1,55 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cv::dct の変換フラグ + /// +#else + /// + /// Transformation flags for cv::dct + /// +#endif + [Flags] +// ReSharper disable once InconsistentNaming + public enum DctFlags + { + /// + /// + /// + None = 0, + +#if LANG_JP + /// + /// 1次元または2次元の逆変換を行う.結果のスケーリングは行わない. + /// Forward と Inverse は,もちろん同時には指定できない. + /// +#else + /// + /// Do inverse 1D or 2D transform. + /// (Forward and Inverse are mutually exclusive, of course.) + /// +#endif + Inverse = 1, + + +#if LANG_JP + /// + /// 入力配列のそれぞれの行に対して独立に,順変換あるいは逆変換を行う. + /// このフラグは複数のベクトルの同時変換を許可し, + /// オーバーヘッド(一つの計算の何倍も大きくなることもある)を減らすためや, + /// 3次元以上の高次元に対して変換を行うために使用される. + /// [CV_DXT_ROWS] + /// +#else + /// + /// Do forward or inverse transform of every individual row of the input matrix. + /// This flag allows user to transform multiple vectors simultaneously and can be used to decrease the overhead + /// (which is sometimes several times larger than the processing itself), to do 3D and higher-dimensional transforms etc. + /// [CV_DXT_ROWS] + /// +#endif + Rows = 4, + } +} diff --git a/src/OpenCvSharp/modules/core/Enum/DecompTypes.cs b/src/OpenCvSharp/modules/core/Enum/DecompTypes.cs new file mode 100644 index 000000000..902853321 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Enum/DecompTypes.cs @@ -0,0 +1,66 @@ + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + +#if LANG_JP + /// + /// 逆行列を求める手法 + /// +#else + /// + /// Inversion methods + /// +#endif + public enum DecompTypes : int + { +#if LANG_JP + /// + /// 最適なピボット選択によるガウスの消去法 + /// [CV_LU] + /// +#else + /// + /// Gaussian elimination with the optimal pivot element chosen. + /// +#endif + + LU = 0, + +#if LANG_JP + /// + /// 特異値分解 + /// [CV_SVD] + /// +#else + /// + /// singular value decomposition (SVD) method; + /// the system can be over-defined and/or the matrix src1 can be singular + /// +#endif + SVD = 1, + + /// + /// eigenvalue decomposition; the matrix src1 must be symmetrical + /// + Eig = 2, + + /// + /// Cholesky \f$LL^T\f$ factorization; the matrix src1 must be symmetrical + /// and positively defined + /// + Cholesky = 3, + + /// + /// QR factorization; the system can be over-defined and/or the matrix + /// src1 can be singular + /// + QR = 4, + + /// + /// while all the previous flags are mutually exclusive, + /// this flag can be used together with any of the previous + /// + Normal = 16, + } +} diff --git a/src/OpenCvSharp/modules/core/Enum/DftFlags.cs b/src/OpenCvSharp/modules/core/Enum/DftFlags.cs new file mode 100644 index 000000000..06020a50f --- /dev/null +++ b/src/OpenCvSharp/modules/core/Enum/DftFlags.cs @@ -0,0 +1,91 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cvDFTの変換フラグ + /// +#else + /// + /// Transformation flags for cvDFT + /// +#endif + [Flags] + public enum DftFlags : int + { + /// + /// + /// + None = 0, + +#if LANG_JP + /// + /// 1次元または2次元の逆変換を行う.結果のスケーリングは行わない. + /// Forward と Inverse は,もちろん同時には指定できない. + /// +#else + /// + /// Do inverse 1D or 2D transform. The result is not scaled. + /// (Forward and Inverse are mutually exclusive, of course.) + /// +#endif + Inverse = 1, + + +#if LANG_JP + /// + /// 結果を配列要素数で割り,スケーリングする.通常は Inverse と同時に用いる. + /// ショートカットとして InvScale を用いても良い. + /// [CV_DXT_SCALE] + /// +#else + /// + /// Scale the result: divide it by the number of array elements. Usually, it is combined with Inverse. + /// +#endif + Scale = 2, + +#if LANG_JP + /// + /// 入力配列のそれぞれの行に対して独立に,順変換あるいは逆変換を行う. + /// このフラグは複数のベクトルの同時変換を許可し, + /// オーバーヘッド(一つの計算の何倍も大きくなることもある)を減らすためや, + /// 3次元以上の高次元に対して変換を行うために使用される. + /// +#else + /// + /// Do forward or inverse transform of every individual row of the input matrix. + /// This flag allows user to transform multiple vectors simultaneously and can be used to decrease the overhead + /// (which is sometimes several times larger than the processing itself), to do 3D and higher-dimensional transforms etc. + /// +#endif + Rows = 4, + + /// + /// performs a forward transformation of 1D or 2D real array; the result, + /// though being a complex array, has complex-conjugate symmetry (*CCS*, + /// see the function description below for details), and such an array can + /// be packed into a real array of the same size as input, which is the fastest + /// option and which is what the function does by default; however, you may + /// wish to get a full complex array (for simpler spectrum analysis, and so on) - + /// pass the flag to enable the function to produce a full-size complex output array. + /// + ComplexOutput = 16, + + /// + /// performs an inverse transformation of a 1D or 2D complex array; + /// the result is normally a complex array of the same size, however, + /// if the input array has conjugate-complex symmetry (for example, + /// it is a result of forward transformation with DFT_COMPLEX_OUTPUT flag), + /// the output is a real array; while the function itself does not + /// check whether the input is symmetrical or not, you can pass the flag + /// and then the function will assume the symmetry and produce the real + /// output array (note that when the input is packed into a real array + /// and inverse transformation is executed, the function treats the input + /// as a packed complex-conjugate symmetrical array, and the output + /// will also be a real array). + /// + RealOutput = 32, + } +} diff --git a/src/OpenCvSharp/modules/core/Enum/DistributionType.cs b/src/OpenCvSharp/modules/core/Enum/DistributionType.cs new file mode 100644 index 000000000..058b0c945 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Enum/DistributionType.cs @@ -0,0 +1,38 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cvRandArrメソッド等で用いる, 分布のタイプ + /// +#else + /// + /// Distribution type for cvRandArr, etc. + /// +#endif + public enum DistributionType : int + { +#if LANG_JP + /// + /// 一様分布 + /// +#else + /// + /// Uniform distribution + /// +#endif + Uniform = 0, + + +#if LANG_JP + /// + /// 正規分布(ガウス分布) + /// +#else + /// + /// Normal or Gaussian distribution + /// +#endif + Normal = 1, + } +} diff --git a/src/OpenCvSharp/modules/core/Enum/DumpFormat.cs b/src/OpenCvSharp/modules/core/Enum/DumpFormat.cs new file mode 100644 index 000000000..da60df48b --- /dev/null +++ b/src/OpenCvSharp/modules/core/Enum/DumpFormat.cs @@ -0,0 +1,45 @@ +using System; + +namespace OpenCvSharp +{ + /// + /// Output string format of Mat.Dump() + /// + public enum DumpFormat + { + /// + /// Default format. + /// [1, 2, 3, 4, 5, 6; \n + /// 7, 8, 9, ... ] + /// + Default, + + /// + /// Python format. + /// [[[1, 2, 3], [4, 5, 6]], \n + /// [[7, 8, 9], ... ] + /// + Python, + + /// + /// NumPy format. + /// array([[[1, 2, 3], [4, 5, 6]], \n + /// [[7, 8, 9], .... ]]], type='uint8'); + /// + NumPy, + + /// + /// CSV format. + /// 1, 2, 3, 4, 5, 6\n + /// 7, 8, 9, ... + /// + Csv, + + /// + /// C language format. + /// {1, 2, 3, 4, 5, 6, \n + /// 7, 8, 9, ...}; + /// + C, + } +} diff --git a/src/OpenCvSharp/modules/core/Enum/ErrorCode.cs b/src/OpenCvSharp/modules/core/Enum/ErrorCode.cs new file mode 100644 index 000000000..c025b7b8b --- /dev/null +++ b/src/OpenCvSharp/modules/core/Enum/ErrorCode.cs @@ -0,0 +1,262 @@ +namespace OpenCvSharp +{ + /// + /// Error status codes + /// + public enum ErrorCode + { + /* this part of CVStatus is compatible with IPLStatus + Some of below symbols are not [yet] used in OpenCV + */ + + // ReSharper disable InconsistentNaming + + /// + /// everithing is ok [CV_StsOk] + /// + StsOk = 0, + + /// + /// pseudo error for back trace [CV_StsBackTrace] + /// + StsBackTrace = -1, + + /// + /// unknown /unspecified error [CV_StsError] + /// + StsError = -2, + + /// + /// internal error (bad state) [CV_StsInternal] + /// + StsInternal = -3, + + /// + /// insufficient memory [CV_StsNoMem] + /// + StsNoMem = -4, + + /// + /// function arg/param is bad [CV_StsBadArg] + /// + StsBadArg = -5, + + /// + /// unsupported function [CV_StsBadFunc] + /// + StsBadFunc = -6, + + /// + /// iter. didn't converge [CV_StsNoConv] + /// + StsNoConv = -7, + + /// + /// tracing [CV_StsAutoTrace] + /// + StsAutoTrace = -8, + + + /// + /// image header is NULL [CV_HeaderIsNull] + /// + HeaderIsNull = -9, + + /// + /// image size is invalid [CV_BadImageSize] + /// + BadImageSize = -10, + + /// + /// offset is invalid [CV_BadOffset] + /// + BadOffset = -11, + + /// + /// [CV_BadOffset] + /// + BadDataPtr = -12, + + /// + /// [CV_BadStep] + /// + BadStep = -13, + + /// + /// [CV_BadModelOrChSeq] + /// + BadModelOrChSeq = -14, + + /// + /// [CV_BadNumChannels] + /// + BadNumChannels = -15, + + /// + /// [CV_BadNumChannel1U] + /// + BadNumChannel1U = -16, + + /// + /// [CV_BadDepth] + /// + BadDepth = -17, + + /// + /// [CV_BadAlphaChannel] + /// + BadAlphaChannel = -18, + + /// + /// [CV_BadOrder] + /// + BadOrder = -19, + + /// + /// [CV_BadOrigin] + /// + BadOrigin = -20, + + /// + /// [CV_BadAlign] + /// + BadAlign = -21, + + /// + /// [CV_BadCallBack] + /// + BadCallBack = -22, + + /// + /// [CV_BadTileSize] + /// + BadTileSize = -23, + + /// + /// [CV_BadCOI] + /// + BadCOI = -24, + + /// + /// [CV_BadROISize] + /// + BadROISize = -25, + + /// + /// [CV_MaskIsTiled] + /// + MaskIsTiled = -26, + + /// + /// null pointer [CV_StsNullPtr] + /// + StsNullPtr = -27, + + /// + /// incorrect vector length [CV_StsVecLengthErr] + /// + StsVecLengthErr = -28, + + /// + /// incorr. filter structure content [CV_StsFilterStructContentErr] + /// + StsFilterStructContentErr = -29, + + /// + /// incorr. transform kernel content [CV_StsKernelStructContentErr] + /// + StsKernelStructContentErr = -30, + + /// + /// incorrect filter ofset value [CV_StsFilterOffsetErr] + /// + StsFilterOffsetErr = -31, + + /*extra for CV */ + + /// + /// the input/output structure size is incorrect [CV_StsBadSize] + /// + StsBadSize = -201, + + /// + /// division by zero [CV_StsDivByZero] + /// + StsDivByZero = -202, + + /// + /// in-place operation is not supported [CV_StsInplaceNotSupported] + /// + StsInplaceNotSupported = -203, + + /// + /// request can't be completed [CV_StsObjectNotFound] + /// + StsObjectNotFound = -204, + + /// + /// formats of input/output arrays differ [CV_StsUnmatchedFormats] + /// + StsUnmatchedFormats = -205, + + /// + /// flag is wrong or not supported [CV_StsBadFlag] + /// + StsBadFlag = -206, + + /// + /// bad CvPoint [CV_StsBadPoint] + /// + StsBadPoint = -207, + + /// + /// bad format of mask (neither 8uC1 nor 8sC1) [CV_StsBadMask] + /// + StsBadMask = -208, + + /// + /// sizes of input/output structures do not match [CV_StsUnmatchedSizes] + /// + StsUnmatchedSizes = -209, + + /// + /// the data format/type is not supported by the function [CV_StsUnsupportedFormat] + /// + StsUnsupportedFormat = -210, + + /// + /// some of parameters are out of range [CV_StsOutOfRange] + /// + StsOutOfRange = -211, + + /// + /// invalid syntax/structure of the parsed file [CV_StsParseError] + /// + StsParseError = -212, + + /// + /// the requested function/feature is not implemented [CV_StsNotImplemented] + /// + StsNotImplemented = -213, + + /// + /// an allocated block has been corrupted [CV_StsBadMemBlock] + /// + StsBadMemBlock = -214, + + /// + /// assertion failed + /// + StsAssert = -215, + +#pragma warning disable 1591 + GpuNotSupported = -216, + GpuApiCallError = -217, + OpenGlNotSupported = -218, + OpenGlApiCallError = -219, + OpenCLApiCallError = -220, + OpenCLDoubleNotSupported = -221, + OpenCLInitError = -222, + OpenCLNoAMDBlasFft = -223 + } +} diff --git a/src/OpenCvSharp/modules/core/Enum/GemmFlags.cs b/src/OpenCvSharp/modules/core/Enum/GemmFlags.cs new file mode 100644 index 000000000..9479b6cf0 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Enum/GemmFlags.cs @@ -0,0 +1,60 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + +#if LANG_JP + /// + /// cv::GEMMメソッドの操作フラグ + /// +#else + /// + /// The operation flags for cv::GEMM + /// +#endif + [Flags] + public enum GemmFlags : int + { + /// + /// + /// + None = 0, + +#if LANG_JP + /// + /// src1を転置 + /// +#else + /// + /// Transpose src1 + /// +#endif + + A_T = 1, + + +#if LANG_JP + /// + /// src2を転置 + /// +#else + /// + /// Transpose src2 + /// +#endif + B_T = 2, + + +#if LANG_JP + /// + /// src3を転置 + /// +#else + /// + /// Transpose src3 + /// +#endif + C_T = 4, + } +} diff --git a/src/OpenCvSharp/modules/core/Enum/HersheyFonts.cs b/src/OpenCvSharp/modules/core/Enum/HersheyFonts.cs new file mode 100644 index 000000000..c05d28be1 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Enum/HersheyFonts.cs @@ -0,0 +1,64 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// フォント名の識別子.現在はHershey fontsの一部のみサポートされている. + /// フォント名のフラグにはイタリックフラグ(Italic)を合成することができる. + /// +#else + /// + /// Font name identifier. + /// Only a subset of Hershey fonts (http://sources.isc.org/utils/misc/hershey-font.txt) are supported now. + /// +#endif + [Flags] + public enum HersheyFonts : int + { + /// + /// normal size sans-serif font + /// + HersheySimplex = 0, + + /// + /// small size sans-serif font + /// + HersheyPlain = 1, + + /// + /// normal size sans-serif font (more complex than HERSHEY_SIMPLEX) + /// + HersheyDuplex = 2, + + /// + /// normal size serif font + /// + HersheyComplex = 3, + + /// + /// normal size serif font (more complex than HERSHEY_COMPLEX) + /// + HersheyTriplex = 4, + + /// + /// smaller version of HERSHEY_COMPLEX + /// + HersheyComplexSmall = 5, + + /// + /// hand-writing style font + /// + HersheyScriptSimplex = 6, + + /// + /// more complex variant of HERSHEY_SCRIPT_SIMPLEX + /// + HersheyScriptComplex = 7, + + /// + /// flag for italic font + /// + Italic = 16 + } +} diff --git a/src/OpenCvSharp/modules/core/Enum/InOutArrayKind.cs b/src/OpenCvSharp/modules/core/Enum/InOutArrayKind.cs new file mode 100644 index 000000000..b86b4ebf4 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Enum/InOutArrayKind.cs @@ -0,0 +1,28 @@ +using System; + +namespace OpenCvSharp +{ +#pragma warning disable 1591 + + /// + /// + /// + [Flags] + public enum InOutArrayKind + { + None = 0 << InputArray.KIND_SHIFT, + Mat = 1 << InputArray.KIND_SHIFT, + Matx = 2 << InputArray.KIND_SHIFT, + StdVector = 3 << InputArray.KIND_SHIFT, + VectorVector = 4 << InputArray.KIND_SHIFT, + VectorMat = 5 << InputArray.KIND_SHIFT, + Expr = 6 << InputArray.KIND_SHIFT, + OpenGLBuffer = 7 << InputArray.KIND_SHIFT, + OpenGLTexture = 8 << InputArray.KIND_SHIFT, + GpuMat = 9 << InputArray.KIND_SHIFT, + OclMat = 10 << InputArray.KIND_SHIFT, + + FixedType = 0x8000 << InputArray.KIND_SHIFT, + FixedSize = 0x4000 << InputArray.KIND_SHIFT, + } +} diff --git a/src/OpenCvSharp/modules/core/Enum/KMeansFlags.cs b/src/OpenCvSharp/modules/core/Enum/KMeansFlags.cs new file mode 100644 index 000000000..728f6a4a8 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Enum/KMeansFlags.cs @@ -0,0 +1,35 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cv::kmeans の処理フラグ + /// +#else + /// + /// Miscellaneous flags for cv::kmeans + /// +#endif + [Flags] + public enum KMeansFlags : int + { + /// + /// Select random initial centers in each attempt. + /// + RandomCenters = 0, + + /// + /// Use kmeans++ center initialization by Arthur and Vassilvitskii [Arthur2007]. + /// + PpCenters = 2, + + /// + /// During the first (and possibly the only) attempt, use the + /// user-supplied labels instead of computing them from the initial centers. + /// For the second and further attempts, use the random or semi-random centers. + /// Use one of KMEANS_\*_CENTERS flag to specify the exact method. + /// + UseInitialLabels = 1, + } +} diff --git a/src/OpenCvSharp/modules/core/Enum/MatDiagType.cs b/src/OpenCvSharp/modules/core/Enum/MatDiagType.cs new file mode 100644 index 000000000..f5259463a --- /dev/null +++ b/src/OpenCvSharp/modules/core/Enum/MatDiagType.cs @@ -0,0 +1,56 @@ +using System; + +namespace OpenCvSharp +{ + +#if LANG_JP + /// + /// diagonal type + /// +#else + /// + /// diagonal type + /// +#endif + public enum MatDiagType : int + { +#if LANG_JP + /// + /// a diagonal from the upper half + /// [< 0] + /// +#else + /// + /// a diagonal from the upper half + /// [< 0] + /// +#endif + Upper = -1, +#if LANG_JP + /// + /// Main dialonal + /// [= 0] + /// +#else + /// + /// Main dialonal + /// [= 0] + /// +#endif + Main = 0, +#if LANG_JP + /// + /// a diagonal from the lower half + /// [> 0] + /// +#else + /// + /// a diagonal from the lower half + /// [> 0] + /// +#endif + Lower = +1, + } +} + + diff --git a/src/OpenCvSharp/modules/core/Enum/NormTypes.cs b/src/OpenCvSharp/modules/core/Enum/NormTypes.cs new file mode 100644 index 000000000..0e764494d --- /dev/null +++ b/src/OpenCvSharp/modules/core/Enum/NormTypes.cs @@ -0,0 +1,79 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + +#if LANG_JP + /// + /// 正規化のタイプ + /// +#else + /// + /// Type of norm + /// +#endif + [Flags] + public enum NormTypes : int + { + /// + /// + /// + + INF = 1, + +#if LANG_JP + /// + /// 配列のL1-norm(絶対値の合計)を正規化 + /// +#else + /// + /// The L1-norm (sum of absolute values) of the array is normalized. + /// +#endif + L1 = 2, + + +#if LANG_JP + /// + /// 配列のL2-norm(ユークリッド距離)を正規化 + /// +#else + /// + /// The (Euclidean) L2-norm of the array is normalized. + /// +#endif + L2 = 4, + + /// + /// + /// + L2SQR = 5, + + /// + /// + /// + Hamming = 6, + + /// + /// + /// + Hamming2 = 7, + + /// + /// + /// + Relative = 8, + +#if LANG_JP + /// + /// 配列の値が指定の範囲に収まるようにスケーリングとシフトを行う + /// +#else + /// + /// The array values are scaled and shifted to the specified range. + /// +#endif + MinMax = 32, + } +} diff --git a/src/OpenCvSharp/modules/core/Enum/ReduceDimension.cs b/src/OpenCvSharp/modules/core/Enum/ReduceDimension.cs new file mode 100644 index 000000000..8f51c73d6 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Enum/ReduceDimension.cs @@ -0,0 +1,54 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cvReduceで、配列をどのように縮小するかを示すインデックス + /// +#else + /// + /// The dimension index along which the matrix is reduce. + /// +#endif + public enum ReduceDimension + { +#if LANG_JP + /// + /// 行列を1行ベクトルに縮小する + /// [= 0] + /// +#else + /// + /// The matrix is reduced to a single row. + /// [= 0] + /// +#endif + Row = 0, + +#if LANG_JP + /// + /// 行列を1列ベクトルに縮小する + /// [= 1] + /// +#else + /// + /// The matrix is reduced to a single column. + /// [= 1] + /// +#endif + Column = 1, + +#if LANG_JP + /// + /// 出力行列のサイズから次元を解析し,自動的に選択する + /// [= -1] + /// +#else + /// + /// The dimension is chosen automatically by analysing the dst size. + /// [= -1] + /// +#endif + Auto = -1 + } +} diff --git a/src/OpenCvSharp/modules/core/Enum/ReduceTypes.cs b/src/OpenCvSharp/modules/core/Enum/ReduceTypes.cs new file mode 100644 index 000000000..62a6bdc78 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Enum/ReduceTypes.cs @@ -0,0 +1,62 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cvReduceで用いる縮小処理の種類 + /// +#else + /// + /// The reduction operations for cvReduce + /// +#endif + public enum ReduceTypes : int + { +#if LANG_JP + /// + /// 出力は各行(または各列)の総和 + /// +#else + /// + /// The output is the sum of all the matrix rows/columns. + /// +#endif + Sum = 0, + + +#if LANG_JP + /// + /// 出力は各行(または各列)の平均ベクトル + /// +#else + /// + /// The output is the mean vector of all the matrix rows/columns. + /// +#endif + Avg = 1, + + +#if LANG_JP + /// + /// 出力は各行(または各列)における最大値 + /// +#else + /// + /// The output is the maximum (column/row-wise) of all the matrix rows/columns. + /// +#endif + Max = 2, + + +#if LANG_JP + /// + /// 出力は各行(または各列)における最小値 + /// +#else + /// + /// The output is the minimum (column/row-wise) of all the matrix rows/columns. + /// +#endif + Min = 3, + } +} diff --git a/src/OpenCvSharp/modules/core/Enum/SortFlags.cs b/src/OpenCvSharp/modules/core/Enum/SortFlags.cs new file mode 100644 index 000000000..2d736f0e9 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Enum/SortFlags.cs @@ -0,0 +1,39 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cv::sortで用いる、配列の並び順指定 + /// +#else + /// + /// Signals an error and raises the exception. + /// +#endif + [Flags] + public enum SortFlags : int + { + /// + /// each matrix row is sorted independently + /// + EveryRow = 0, + + /// + /// each matrix column is sorted independently; + /// this flag and the previous one are mutually exclusive. + /// + EveryColumn = 1, + + /// + /// each matrix row is sorted in the ascending order. + /// + Ascending = 0, + + /// + /// each matrix row is sorted in the descending order; + /// this flag and the previous one are also mutually exclusive. + /// + Descending = 16, + } +} diff --git a/src/OpenCvSharp/modules/core/FileNode.cs b/src/OpenCvSharp/modules/core/FileNode.cs new file mode 100644 index 000000000..f125ea74d --- /dev/null +++ b/src/OpenCvSharp/modules/core/FileNode.cs @@ -0,0 +1,335 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// File Storage Node class + /// + public class FileNode : DisposableCvObject + { + private bool disposed; + + #region Init & Disposal + + /// + /// The default constructor + /// + public FileNode() + { + ptr = NativeMethods.core_FileNode_new1(); + } + + /// + /// Initializes from cv::FileNode* + /// + /// + public FileNode(IntPtr ptr) + { + this.ptr = ptr; + } + + /// + /// + /// + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (ptr != IntPtr.Zero) + { + NativeMethods.core_FileNode_delete(ptr); + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Cast + + /// + /// Returns the node content as an integer. If the node stores floating-point number, it is rounded. + /// + /// + /// + public static explicit operator int(FileNode node) + { + if (node == null) + throw new ArgumentNullException("node"); + return NativeMethods.core_FileNode_toInt(node.CvPtr); + } + + /// + /// Returns the node content as float + /// + /// + /// + public static explicit operator float(FileNode node) + { + if (node == null) + throw new ArgumentNullException("node"); + return NativeMethods.core_FileNode_toFloat(node.CvPtr); + } + + /// + /// Returns the node content as double + /// + /// + /// + public static explicit operator double(FileNode node) + { + if (node == null) + throw new ArgumentNullException("node"); + return NativeMethods.core_FileNode_toDouble(node.CvPtr); + } + + /// + /// Returns the node content as text string + /// + /// + /// + public static explicit operator string(FileNode node) + { + if (node == null) + throw new ArgumentNullException("node"); + var buf = new StringBuilder(1 << 16); + NativeMethods.core_FileNode_toString(node.CvPtr, buf, buf.Capacity); + return buf.ToString(); + } + + #endregion + + #region Properties + + /// + /// returns element of a mapping node + /// + public FileNode this[string nodeName] + { + get + { + if (disposed) + throw new ObjectDisposedException("FileNode"); + if (nodeName == null) + throw new ArgumentNullException("nodeName"); + IntPtr node = NativeMethods.core_FileNode_operatorThis_byString(ptr, nodeName); + if (node == IntPtr.Zero) + return null; + return new FileNode(node); + } + } + + /// + /// returns element of a sequence node + /// + public FileNode this[int i] + { + get + { + if (disposed) + throw new ObjectDisposedException("FileNode"); + IntPtr node = NativeMethods.core_FileNode_operatorThis_byInt(ptr, i); + if (node == IntPtr.Zero) + return null; + return new FileNode(node); + } + } + + /// + /// Returns true if the node is empty + /// + /// + public bool Empty + { + get + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + int ret = NativeMethods.core_FileNode_empty(ptr); + return ret != 0; + } + } + + /// + /// Returns true if the node is a "none" object + /// + /// + public bool IsNone + { + get + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + int ret = NativeMethods.core_FileNode_isNone(ptr); + return ret != 0; + } + } + + /// + /// Returns true if the node is a sequence + /// + /// + public bool IsSeq + { + get + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + int ret = NativeMethods.core_FileNode_isSeq(ptr); + return ret != 0; + } + } + + /// + /// Returns true if the node is a mapping + /// + /// + public bool IsMap + { + get + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + int ret = NativeMethods.core_FileNode_isMap(ptr); + return ret != 0; + } + } + + /// + /// Returns true if the node is an integer + /// + /// + public bool IsInt + { + get + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + int ret = NativeMethods.core_FileNode_isInt(ptr); + return ret != 0; + } + } + + /// + /// Returns true if the node is a floating-point number + /// + /// + public bool IsReal + { + get + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + int ret = NativeMethods.core_FileNode_isReal(ptr); + return ret != 0; + } + } + + /// + /// Returns true if the node is a text string + /// + /// + public bool IsString + { + get + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + int ret = NativeMethods.core_FileNode_isString(ptr); + return ret != 0; + } + } + + /// + /// Returns true if the node has a name + /// + /// + public bool IsNamed + { + get + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + int ret = NativeMethods.core_FileNode_isNamed(ptr); + return ret != 0; + } + } + + /// + /// Returns the node name or an empty string if the node is nameless + /// + /// + public string Name + { + get + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + var buf = new StringBuilder(1024); + NativeMethods.core_FileNode_name(ptr, buf, buf.Capacity); + return buf.ToString(); + } + } + + /// + /// Returns the number of elements in the node, if it is a sequence or mapping, or 1 otherwise. + /// + /// + public long Size + { + get + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + return NativeMethods.core_FileNode_size(ptr).ToInt64(); + } + } + + #endregion + + #region Methods + + /// + /// Reads node elements to the buffer with the specified format + /// + /// + /// + /// + public void ReadRaw(string fmt, IntPtr vec, long len) + { + if (disposed) + throw new ObjectDisposedException("FileNode"); + if (fmt == null) + throw new ArgumentNullException("fmt"); + NativeMethods.core_FileNode_readRaw(ptr, fmt, vec, new IntPtr(len)); + } + + /// + /// Reads the registered object and returns pointer to it + /// + /// + public IntPtr ReadObj() + { + if (disposed) + throw new ObjectDisposedException("FileNode"); + return NativeMethods.core_FileNode_readObj(ptr); + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/core/FileStorage.cs b/src/OpenCvSharp/modules/core/FileStorage.cs new file mode 100644 index 000000000..efe8028c2 --- /dev/null +++ b/src/OpenCvSharp/modules/core/FileStorage.cs @@ -0,0 +1,354 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.InteropServices; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// XML/YAML File Storage Class. + /// + public class FileStorage : DisposableCvObject + { + private bool disposed; + + #region Init & Disposal + + /// + /// Default constructor. + /// You should call FileStorage::open() after initialization. + /// + public FileStorage() + { + ptr = NativeMethods.core_FileStorage_new1(); + } + + /// + /// The full constructor + /// + /// Name of the file to open or the text string to read the data from. + /// Extension of the file (.xml or .yml/.yaml) determines its format + /// (XML or YAML respectively). Also you can append .gz to work with + /// compressed files, for example myHugeMatrix.xml.gz. + /// If both FileStorage::WRITE and FileStorage::MEMORY flags are specified, + /// source is used just to specify the output file format + /// (e.g. mydata.xml, .yml etc.). + /// + /// Encoding of the file. Note that UTF-16 XML encoding is not supported + /// currently and you should use 8-bit encoding instead of it. + public FileStorage(string source, Mode flags, string encoding = null) + { + if (source == null) + throw new ArgumentNullException("source"); + ptr = NativeMethods.core_FileStorage_new2(source, (int)flags, encoding); + } + + /// + /// + /// + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (ptr != IntPtr.Zero) + { + NativeMethods.core_FileStorage_delete(ptr); + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// Returns the specified element of the top-level mapping + /// + /// + /// + public FileNode this[string nodeName] + { + get + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + if (nodeName == null) + throw new ArgumentNullException("nodeName"); + IntPtr node = NativeMethods.core_FileStorage_indexer(ptr, nodeName); + if (node == IntPtr.Zero) + return null; + return new FileNode(node); + } + } + + /// + /// the currently written element + /// + public string ElName + { + get + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + unsafe + { + sbyte* buf = NativeMethods.core_FileStorage_elname(ptr); + if (buf == null) + return null; + return new string(buf); + } + } + } + + /// + /// the stack of written structures + /// + public byte[] Structs + { + get + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + + IntPtr length; + IntPtr buf = NativeMethods.core_FileStorage_structs(ptr, out length); + byte[] result = new byte[length.ToInt32()]; + Marshal.Copy(buf, result, 0, result.Length); + return result; + } + } + + /// + /// the writer state + /// + public int State + { + get + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + return NativeMethods.core_FileStorage_state(ptr); + } + } + + #endregion + + #region Methods + + /// + /// operator that performs PCA. The previously stored data, if any, is released + /// + /// + /// + /// Encoding of the file. Note that UTF-16 XML encoding is not supported + /// currently and you should use 8-bit encoding instead of it. + /// + public virtual bool Open(string fileName, Mode flags, string encoding = null) + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + if (fileName == null) + throw new ArgumentNullException("fileName"); + int ret = NativeMethods.core_FileStorage_open(ptr, fileName, (int)flags, encoding); + return ret != 0; + } + + /// + /// Returns true if the object is associated with currently opened file. + /// + /// + public virtual bool IsOpened() + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + return NativeMethods.core_FileStorage_isOpened(ptr) != 0; + } + + /// + /// Closes the file and releases all the memory buffers + /// + public virtual void Release() + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + Dispose(); + } + + /// + /// Closes the file, releases all the memory buffers and returns the text string + /// + /// + public string ReleaseAndGetString() + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + var buf = new StringBuilder(1 << 16); + NativeMethods.core_FileStorage_releaseAndGetString(ptr, buf, buf.Capacity); + ptr = IntPtr.Zero; + Dispose(); + return buf.ToString(); + } + + /// + /// Returns the first element of the top-level mapping + /// + /// + public FileNode GetFirstTopLevelNode() + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + IntPtr node = NativeMethods.core_FileStorage_getFirstTopLevelNode(ptr); + if (node == IntPtr.Zero) + return null; + return new FileNode(node); + } + + /// + /// Returns the top-level mapping. YAML supports multiple streams + /// + /// + /// + public FileNode Root(int streamidx = 0) + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + IntPtr node = NativeMethods.core_FileStorage_root(ptr, streamidx); + if (node == IntPtr.Zero) + return null; + return new FileNode(node); + } + + /// + /// Writes one or more numbers of the specified format to the currently written structure + /// + /// + /// + /// + public void WriteRaw(string fmt, IntPtr vec, long len) + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + } + + /// + /// Writes the registered C structure (CvMat, CvMatND, CvSeq). See cvWrite() + /// + /// + /// + public void WriteObj(string name, IntPtr obj) + { + if (disposed) + throw new ObjectDisposedException("FileStorage"); + if (name == null) + throw new ArgumentNullException("name"); + NativeMethods.core_FileStorage_writeObj(ptr, name, obj); + } + + /// + /// Returns the normalized object name for the specified file name + /// + /// + /// + public static string GetDefaultObjectName(string fileName) + { + if (fileName == null) + throw new ArgumentNullException("fileName"); + if (!File.Exists(fileName)) + throw new FileNotFoundException("", fileName); + + var buf = new StringBuilder(1 << 16); + NativeMethods.core_FileStorage_getDefaultObjectName(fileName, buf, buf.Capacity); + return buf.ToString(); + } + + #endregion + +#if LANG_JP + /// + /// FileStorageのモード + /// +#else + /// + /// File storage mode + /// +#endif + [Flags] + public enum Mode + { +#if LANG_JP + /// + /// データ読み込みのためのファイルオープン + /// +#else + /// + /// The storage is open for reading + /// +#endif + Read = 0, + +#if LANG_JP + /// + /// データ書き込みのためのファイルオープン + /// [CV_STORAGE_WRITE] + /// +#else + /// + /// The storage is open for writing + /// [CV_STORAGE_WRITE] + /// +#endif + Write = 1, + +#if LANG_JP + /// + /// データ追加書き込みのためのファイルオープン + /// +#else + /// + /// The storage is open for appending + /// +#endif + Append = 2, + + /// + /// flag, read data from source or write data to the internal buffer + /// (which is returned by FileStorage::release) + /// + Memory = 4, + + /// + /// mask for format flags + /// + FotmatMask = (7 << 3), + + /// + /// flag, auto format + /// + FormatAuto = 0, + + /// + /// flag, XML format + /// + FormatXml = (1 << 3), + + /// + /// flag, YAML format + /// + FormatYaml = (2 << 3), + } + } +} diff --git a/src/OpenCvSharp/modules/core/InputArray.cs b/src/OpenCvSharp/modules/core/InputArray.cs new file mode 100644 index 000000000..2f50dd642 --- /dev/null +++ b/src/OpenCvSharp/modules/core/InputArray.cs @@ -0,0 +1,483 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Gpu; + +namespace OpenCvSharp +{ + /// + /// Proxy datatype for passing Mat's and vector<>'s as input parameters + /// + public class InputArray : DisposableCvObject + { + private bool disposed; + private object obj; + +#pragma warning disable 1591 +// ReSharper disable InconsistentNaming + public const int KIND_SHIFT = 16; + public const int KIND_MASK = ~(0x8000 << KIND_SHIFT | 0x4000 << KIND_SHIFT) - (1 << KIND_SHIFT) + 1; +// ReSharper restore InconsistentNaming +#pragma warning restore 1591 + + #region Init & Disposal + /// + /// + /// + /// + internal InputArray(IntPtr ptr) + { + this.ptr = ptr; + this.obj = null; + } + + /// + /// + /// + /// + internal InputArray(Mat mat) + { + if (mat == null) + ptr = IntPtr.Zero; + else + ptr = NativeMethods.core_InputArray_new_byMat(mat.CvPtr); + obj = mat; + } + + /// + /// + /// + /// + internal InputArray(MatExpr expr) + { + if (expr == null) + ptr = IntPtr.Zero; + else + ptr = NativeMethods.core_InputArray_new_byMatExpr(expr.CvPtr); + obj = null; + } + + /// + /// + /// + /// + internal InputArray(Scalar val) + { + ptr = NativeMethods.core_InputArray_new_byScalar(val); + } + + /// + /// + /// + /// + internal InputArray(double val) + { + ptr = NativeMethods.core_InputArray_new_byDouble(val); + } + + /// + /// + /// + /// + internal InputArray(GpuMat mat) + { + if (mat == null) + throw new ArgumentNullException("mat"); + ptr = NativeMethods.core_InputArray_new_byGpuMat(mat.CvPtr); + obj = mat; + } + + /// + /// + /// + /// + internal InputArray(IEnumerable mat) + { + if (mat == null) + throw new ArgumentNullException("mat"); + using (var matVector = new VectorOfMat(mat)) + { + ptr = NativeMethods.core_InputArray_new_byVectorOfMat(matVector.CvPtr); + } + obj = mat; + } + + /// + /// + /// + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (ptr != IntPtr.Zero) + { + NativeMethods.core_InputArray_delete(ptr); + ptr = IntPtr.Zero; + } + obj = null; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Cast + /// + /// + /// + /// + /// + public static implicit operator InputArray(Mat mat) + { + return Create(mat); + } + + /// + /// + /// + /// + /// + public static implicit operator InputArray(MatExpr expr) + { + return Create(expr); + } + + /// + /// + /// + /// + /// + public static implicit operator InputArray(Scalar val) + { + return Create(val); + } + + /// + /// + /// + /// + /// + public static implicit operator InputArray(double val) + { + return Create(val); + } + + /// + /// + /// + /// + /// + public static implicit operator InputArray(GpuMat mat) + { + return Create(mat); + } + + /// + /// + /// + /// + /// + public static explicit operator InputArray(List mats) + { + return Create(mats); + } + + /// + /// + /// + /// + /// + public static explicit operator InputArray(Mat[] mats) + { + return Create((IEnumerable)mats); + } + + #endregion + + #region Operators + #endregion + + #region Methods + /// + /// + /// + public InOutArrayKind Kind + { + get + { + ThrowIfDisposed(); + return (InOutArrayKind)NativeMethods.core_InputArray_kind(ptr); + } + } + + /// + /// Creates a proxy class of the specified Mat + /// + /// + /// + public static InputArray Create(Mat mat) + { + return new InputArray(mat); + } + + /// + /// Creates a proxy class of the specified MatExpr + /// + /// + /// + public static InputArray Create(MatExpr expr) + { + return new InputArray(expr); + } + + /// + /// Creates a proxy class of the specified Scalar + /// + /// + /// + public static InputArray Create(Scalar val) + { + return new InputArray(val); + } + + /// + /// Creates a proxy class of the specified double + /// + /// + /// + public static InputArray Create(double val) + { + return new InputArray(val); + } + + /// + /// Creates a proxy class of the specified GpuMat + /// + /// + /// + public static InputArray Create(GpuMat mat) + { + return new InputArray(mat); + } + + /// + /// Creates a proxy class of the specified array of Mat + /// + /// + /// + public static InputArray Create(IEnumerable matVector) + { + return new InputArray(matVector); + } + + /// + /// Creates a proxy class of the specified list + /// + /// Array object + /// + public static InputArray Create(IEnumerable enumerable) + where T : struct + { + if (enumerable == null) + throw new ArgumentNullException("enumerable"); + List list = new List(enumerable); + return Create(list.ToArray()); + } + + /// + /// Creates a proxy class of the specified list + /// + /// Array object + /// Matrix depth and channels for converting array to cv::Mat + /// + public static InputArray Create(IEnumerable enumerable, MatType type) + where T : struct + { + if (enumerable == null) + throw new ArgumentNullException("enumerable"); + List list = new List(enumerable); + return Create(list.ToArray(), type); + } + + /// + /// Creates a proxy class of the specified list + /// + /// Array object + /// + public static InputArray Create(T[] array) + where T : struct + { + MatType type = EstimateType(typeof(T)); + return Create(array, type); + } + + /// + /// Creates a proxy class of the specified list + /// + /// Array object + /// Matrix depth and channels for converting array to cv::Mat + /// + public static InputArray Create(T[] array, MatType type) + where T : struct + { + if (array == null) + throw new ArgumentNullException("array"); + if (array.Length == 0) + throw new ArgumentException("array.Length == 0"); + + int rows = array.Length; + Mat mat = new Mat(rows, 1, type, array); + return new InputArray(mat); + } + + /// + /// Creates a proxy class of the specified list + /// + /// Array object + /// + public static InputArray Create(T[,] array) + where T : struct + { + MatType type = EstimateType(typeof(T)); + return Create(array, type); + } + + /// + /// Creates a proxy class of the specified list + /// + /// Array object + /// Matrix depth and channels for converting array to cv::Mat + /// + public static InputArray Create(T[,] array, MatType type) + where T : struct + { + if (array == null) + throw new ArgumentNullException("array"); + int rows = array.GetLength(0); + int cols = array.GetLength(1); + if (rows == 0) + throw new ArgumentException("array.GetLength(0) == 0"); + if (cols == 0) + throw new ArgumentException("array.GetLength(1) == 0"); + Mat mat = new Mat(rows, cols, type, array); + return new InputArray(mat); + } + + /// + /// + /// + /// + /// + private static MatType EstimateType(Type t) + { + if(!t.IsValueType) + throw new ArgumentException(); + + // Primitive types + TypeCode code = Type.GetTypeCode(t); + switch (code) + { + case TypeCode.Byte: + return MatType.CV_8UC1; + case TypeCode.SByte: + return MatType.CV_8SC1; + case TypeCode.UInt16: + return MatType.CV_16UC1; + case TypeCode.Int16: + case TypeCode.Char: + return MatType.CV_16SC1; + case TypeCode.UInt32: + case TypeCode.Int32: + return MatType.CV_32SC1; + case TypeCode.Single: + return MatType.CV_32FC1; + case TypeCode.Double: + return MatType.CV_64FC1; + } + // OpenCV struct types + if (t == typeof(Point)) + return MatType.CV_32SC2; + if (t == typeof(Point2f)) + return MatType.CV_32FC2; + if (t == typeof(Point2d)) + return MatType.CV_64FC2; + if (t == typeof(Point3i)) + return MatType.CV_32SC3; + if (t == typeof(Point3f)) + return MatType.CV_32FC3; + if (t == typeof(Point3d)) + return MatType.CV_32FC3; + if (t == typeof(Range)) + return MatType.CV_32SC2; + if (t == typeof(Rangef)) + return MatType.CV_32FC2; + if (t == typeof(Rect)) + return MatType.CV_32SC4; + if (t == typeof(Size)) + return MatType.CV_32SC2; + if (t == typeof(Size2f)) + return MatType.CV_32FC2; + + if (t == typeof(Vec2b)) + return MatType.CV_8UC2; + if (t == typeof(Vec3b)) + return MatType.CV_8UC3; + if (t == typeof(Vec4b)) + return MatType.CV_8UC4; + if (t == typeof(Vec6b)) + return MatType.CV_8UC(6); + if (t == typeof(Vec2s)) + return MatType.CV_16SC2; + if (t == typeof(Vec3s)) + return MatType.CV_16SC3; + if (t == typeof(Vec4s)) + return MatType.CV_16SC4; + if (t == typeof(Vec6s)) + return MatType.CV_16SC(6); + if (t == typeof(Vec2w)) + return MatType.CV_16UC2; + if (t == typeof(Vec3w)) + return MatType.CV_16UC3; + if (t == typeof(Vec4w)) + return MatType.CV_16UC4; + if (t == typeof(Vec6w)) + return MatType.CV_16UC(6); + if (t == typeof(Vec2s)) + return MatType.CV_32SC2; + if (t == typeof(Vec3s)) + return MatType.CV_32SC3; + if (t == typeof(Vec4s)) + return MatType.CV_32SC4; + if (t == typeof(Vec6s)) + return MatType.CV_32SC(6); + if (t == typeof(Vec2f)) + return MatType.CV_32FC2; + if (t == typeof(Vec3f)) + return MatType.CV_32FC3; + if (t == typeof(Vec4f)) + return MatType.CV_32FC4; + if (t == typeof(Vec6f)) + return MatType.CV_32FC(6); + if (t == typeof(Vec2d)) + return MatType.CV_64FC2; + if (t == typeof(Vec3d)) + return MatType.CV_64FC3; + if (t == typeof(Vec4d)) + return MatType.CV_64FC4; + if (t == typeof(Vec6d)) + return MatType.CV_64FC(6); + + throw new ArgumentException("Not supported value type for InputArray"); + } + #endregion + } +} diff --git a/src/OpenCvSharp/modules/core/InputOutputArray.cs b/src/OpenCvSharp/modules/core/InputOutputArray.cs new file mode 100644 index 000000000..73f626a18 --- /dev/null +++ b/src/OpenCvSharp/modules/core/InputOutputArray.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using OpenCvSharp; + +namespace OpenCvSharp +{ + /// + /// Proxy datatype for passing Mat's and vector<>'s as input parameters. + /// Synonym for OutputArray. + /// + public class InputOutputArray : OutputArray + { + /// + /// + /// + /// + internal InputOutputArray(Mat mat) + : base(mat) + { + } + + #region Cast + /// + /// + /// + /// + /// + public static implicit operator InputOutputArray(Mat mat) + { + return new InputOutputArray(mat); + } + #endregion + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/Mat.cs b/src/OpenCvSharp/modules/core/Mat/Mat.cs new file mode 100644 index 000000000..028a028e2 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/Mat.cs @@ -0,0 +1,4917 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// OpenCV C++ n-dimensional dense array class (cv::Mat) + /// + public partial class Mat : DisposableCvObject, ICloneable + { + private bool disposed; + + #region Init & Disposal + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + public Mat(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Native object address is NULL"); + this.ptr = ptr; + } + +#if LANG_JP + /// + /// 空の行列として初期化 + /// +#else + /// + /// Creates empty Mat + /// +#endif + public Mat() + { + ptr = NativeMethods.core_Mat_new1(); + } + +#if LANG_JP + /// + /// 画像ファイルから読み込んで初期化 (cv::imread) + /// + /// 読み込まれる画像ファイル名 + /// 画像読み込みフラグ. +#else + /// + /// Loads an image from a file. (cv::imread) + /// + /// Name of file to be loaded. + /// Specifies color type of the loaded image +#endif + public Mat(string fileName, ImreadModes flags = ImreadModes.Color) + { + if (string.IsNullOrEmpty(fileName)) + throw new ArgumentNullException("fileName"); + if (!File.Exists(fileName)) + throw new FileNotFoundException("", fileName); + ptr = NativeMethods.imgcodecs_imread(fileName, (int) flags); + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. +#endif + public Mat(int rows, int cols, MatType type) + { + ptr = NativeMethods.core_Mat_new2(rows, cols, type); + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType.CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. +#endif + public Mat(Size size, MatType type) + { + ptr = NativeMethods.core_Mat_new2(size.Height, size.Width, type); + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public Mat(int rows, int cols, MatType type, Scalar s) + { + ptr = NativeMethods.core_Mat_new3(rows, cols, type, s); + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public Mat(Size size, MatType type, Scalar s) + { + ptr = NativeMethods.core_Mat_new3(size.Height, size.Width, type, s); + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public Mat(Mat m, Range rowRange, Range? colRange = null) + { + if (colRange.HasValue) + ptr = NativeMethods.core_Mat_new4(m.ptr, rowRange, colRange.Value); + else + ptr = NativeMethods.core_Mat_new5(m.ptr, rowRange); + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + public Mat(Mat m, params Range[] ranges) + { + ptr = NativeMethods.core_Mat_new6(m.ptr, ranges); + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + public Mat(Mat m, Rect roi) + { + ptr = NativeMethods.core_Mat_new7(m.ptr, roi); + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public Mat(int rows, int cols, MatType type, IntPtr data, long step = 0) + { + ptr = NativeMethods.core_Mat_new8(rows, cols, type, data, new IntPtr(step)); + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public Mat(int rows, int cols, MatType type, Array data, long step = 0) + { + GCHandle handle = AllocGCHandle(data); + ptr = NativeMethods.core_Mat_new8(rows, cols, type, + handle.AddrOfPinnedObject(), new IntPtr(step)); + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// Array of integers specifying an n-dimensional array shape. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public Mat(IEnumerable sizes, MatType type, IntPtr data, IEnumerable steps = null) + { + if (sizes == null) + throw new ArgumentNullException("sizes"); + if (data == IntPtr.Zero) + throw new ArgumentNullException("data"); + int[] sizesArray = EnumerableEx.ToArray(sizes); + if (steps == null) + { + ptr = NativeMethods.core_Mat_new9(sizesArray.Length, sizesArray, type, data, IntPtr.Zero); + } + else + { + IntPtr[] stepsArray = EnumerableEx.SelectToArray(steps, delegate(long s) + { + return new IntPtr(s); + }); + ptr = NativeMethods.core_Mat_new9(sizesArray.Length, sizesArray, type, data, stepsArray); + } + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public Mat(IEnumerable sizes, MatType type, Array data, IEnumerable steps = null) + { + if (sizes == null) + throw new ArgumentNullException("sizes"); + if (data == null) + throw new ArgumentNullException("data"); + + GCHandle handle = AllocGCHandle(data); + int[] sizesArray = EnumerableEx.ToArray(sizes); + if (steps == null) + { + ptr = NativeMethods.core_Mat_new9(sizesArray.Length, sizesArray, + type, handle.AddrOfPinnedObject(), IntPtr.Zero); + } + else + { + IntPtr[] stepsArray = EnumerableEx.SelectToArray(steps, delegate(long s) + { + return new IntPtr(s); + }); + ptr = NativeMethods.core_Mat_new9(sizesArray.Length, sizesArray, + type, handle.AddrOfPinnedObject(), stepsArray); + } + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. +#endif + public Mat(IEnumerable sizes, MatType type) + { + if (sizes == null) + throw new ArgumentNullException("sizes"); + + int[] sizesArray = EnumerableEx.ToArray(sizes); + ptr = NativeMethods.core_Mat_new10(sizesArray.Length, sizesArray, type); + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public Mat(IEnumerable sizes, MatType type, Scalar s) + { + if (sizes == null) + throw new ArgumentNullException("sizes"); + int[] sizesArray = EnumerableEx.ToArray(sizes); + ptr = NativeMethods.core_Mat_new11(sizesArray.Length, sizesArray, type, s); + } + +#if LANG_JP + /// + /// リソースの解放 + /// +#else + /// + /// Releases the resources + /// +#endif + public void Release() + { + Dispose(); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + } + // releases unmanaged resources + if (IsEnabledDispose) + { + if (ptr != IntPtr.Zero) + NativeMethods.core_Mat_delete(ptr); + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + + #region Static Initializers + +#if LANG_JP + /// + /// System.IO.StreamのインスタンスからMatを生成する + /// + /// + /// + /// +#else + /// + /// Creates the Mat instance from System.IO.Stream + /// + /// + /// + /// +#endif + public static Mat FromStream(Stream stream, ImreadModes mode) + { + if (stream == null) + throw new ArgumentNullException("stream"); + if (stream.Length > Int32.MaxValue) + throw new ArgumentException("Not supported stream (too long)"); + + byte[] buf = new byte[stream.Length]; + { + long currentPosition = stream.Position; + stream.Position = 0; + stream.Read(buf, 0, buf.Length); + stream.Position = currentPosition; + } + return FromImageData(buf, mode); + } + +#if LANG_JP + /// + /// 画像データ(JPEG等の画像をメモリに展開したもの)からMatを生成する (cv::decode) + /// + /// + /// + /// +#else + /// + /// Creates the Mat instance from image data (using cv::decode) + /// + /// + /// + /// +#endif + public static Mat ImDecode(byte[] imageBytes, ImreadModes mode = ImreadModes.Color) + { + if (imageBytes == null) + throw new ArgumentNullException("imageBytes"); + return Cv2.ImDecode(imageBytes, mode); + } + +#if LANG_JP + /// + /// 画像データ(JPEG等の画像をメモリに展開したもの)からMatを生成する (cv::decode) + /// + /// + /// + /// +#else + /// + /// Creates the Mat instance from image data (using cv::decode) + /// + /// + /// + /// +#endif + public static Mat FromImageData(byte[] imageBytes, ImreadModes mode = ImreadModes.Color) + { + return ImDecode(imageBytes, mode); + } + + #endregion + + #endregion + + #region Static + + /// + /// sizeof(cv::Mat) + /// + public static readonly int SizeOf = (int) NativeMethods.core_Mat_sizeof(); + + #region Diag + + /// + /// Extracts a diagonal from a matrix, or creates a diagonal matrix. + /// + /// + /// + public static Mat Diag(Mat d) + { + return d.Diag(); + } + + #endregion + + #region Eye + + /// + /// Returns an identity matrix of the specified size and type. + /// + /// Alternative to the matrix size specification Size(cols, rows) . + /// Created matrix type. + /// + public static MatExpr Eye(Size size, MatType type) + { + return Eye(size.Height, size.Width, type); + } + + /// + /// Returns an identity matrix of the specified size and type. + /// + /// Number of rows. + /// Number of columns. + /// Created matrix type. + /// + public static MatExpr Eye(int rows, int cols, MatType type) + { + IntPtr retPtr = NativeMethods.core_Mat_eye(rows, cols, type); + MatExpr retVal = new MatExpr(retPtr); + return retVal; + } + + #endregion + + #region Ones + + /// + /// Returns an array of all 1’s of the specified size and type. + /// + /// Number of rows. + /// Number of columns. + /// Created matrix type. + /// + public static MatExpr Ones(int rows, int cols, MatType type) + { + IntPtr retPtr = NativeMethods.core_Mat_ones1(rows, cols, type); + MatExpr retVal = new MatExpr(retPtr); + return retVal; + } + + /// + /// Returns an array of all 1’s of the specified size and type. + /// + /// Alternative to the matrix size specification Size(cols, rows) . + /// Created matrix type. + /// + public static MatExpr Ones(Size size, MatType type) + { + return Ones(size.Height, size.Width, type); + } + + /// + /// Returns an array of all 1’s of the specified size and type. + /// + /// Created matrix type. + /// Array of integers specifying the array shape. + /// + public static MatExpr Ones(MatType type, params int[] sizes) + { + if (sizes == null) + throw new ArgumentNullException("sizes"); + + IntPtr retPtr = NativeMethods.core_Mat_ones2(sizes.Length, sizes, type); + MatExpr retVal = new MatExpr(retPtr); + return retVal; + } + + #endregion + + #region Zeros + + /// + /// Returns a zero array of the specified size and type. + /// + /// Number of rows. + /// Number of columns. + /// Created matrix type. + /// + public static MatExpr Zeros(int rows, int cols, MatType type) + { + IntPtr retPtr = NativeMethods.core_Mat_zeros1(rows, cols, type); + MatExpr retVal = new MatExpr(retPtr); + return retVal; + } + + /// + /// Returns a zero array of the specified size and type. + /// + /// Alternative to the matrix size specification Size(cols, rows) . + /// Created matrix type. + /// + public static MatExpr Zeros(Size size, MatType type) + { + return Zeros(size.Height, size.Width, type); + } + + /// + /// Returns a zero array of the specified size and type. + /// + /// Created matrix type. + /// + /// + public static MatExpr Zeros(MatType type, params int[] sizes) + { + if (sizes == null) + throw new ArgumentNullException("sizes"); + + IntPtr retPtr = NativeMethods.core_Mat_zeros2(sizes.Length, sizes, type); + MatExpr retVal = new MatExpr(retPtr); + return retVal; + } + + #endregion + + #endregion + + #region Operators + + #region Unary + + /// + /// + /// + /// + /// + public static MatExpr operator -(Mat mat) + { + IntPtr expr = NativeMethods.core_Mat_operatorUnaryMinus(mat.CvPtr); + return new MatExpr(expr); + } + + /// + /// + /// + /// + /// + public static Mat operator +(Mat mat) + { + return mat; + } + + #endregion + + #region Binary + + #region + + + /// + /// + /// + /// + /// + /// + public static MatExpr operator +(Mat a, Mat b) + { + if (a == null) + throw new ArgumentNullException("a"); + if (b == null) + throw new ArgumentNullException("b"); + a.ThrowIfDisposed(); + b.ThrowIfDisposed(); + + IntPtr retPtr = NativeMethods.core_Mat_operatorAdd_MatMat(a.CvPtr, b.CvPtr); + return new MatExpr(retPtr); + } + + /// + /// + /// + /// + /// + /// + public static MatExpr operator +(Mat a, Scalar s) + { + if (a == null) + throw new ArgumentNullException("a"); + a.ThrowIfDisposed(); + + IntPtr retPtr = NativeMethods.core_Mat_operatorAdd_MatScalar(a.CvPtr, s); + return new MatExpr(retPtr); + } + + /// + /// + /// + /// + /// + /// + public static MatExpr operator +(Scalar s, Mat a) + { + if (a == null) + throw new ArgumentNullException("a"); + a.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_operatorAdd_ScalarMat(s, a.CvPtr); + return new MatExpr(retPtr); + } + + #endregion + + #region - + + /// + /// + /// + /// + /// + /// + public static MatExpr operator -(Mat a, Mat b) + { + if (a == null) + throw new ArgumentNullException("a"); + if (b == null) + throw new ArgumentNullException("b"); + a.ThrowIfDisposed(); + b.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_operatorSubtract_MatMat(a.CvPtr, b.CvPtr); + return new MatExpr(retPtr); + } + + /// + /// + /// + /// + /// + /// + public static MatExpr operator -(Mat a, Scalar s) + { + if (a == null) + throw new ArgumentNullException("a"); + a.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_operatorSubtract_MatScalar(a.CvPtr, s); + return new MatExpr(retPtr); + } + + /// + /// + /// + /// + /// + /// + public static MatExpr operator -(Scalar s, Mat a) + { + if (a == null) + throw new ArgumentNullException("a"); + a.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_operatorSubtract_ScalarMat(s, a.CvPtr); + return new MatExpr(retPtr); + } + + #endregion + + #region * + + /// + /// + /// + /// + /// + /// + public static MatExpr operator *(Mat a, Mat b) + { + if (a == null) + throw new ArgumentNullException("a"); + if (b == null) + throw new ArgumentNullException("b"); + a.ThrowIfDisposed(); + b.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_operatorMultiply_MatMat(a.CvPtr, b.CvPtr); + return new MatExpr(retPtr); + } + + /// + /// + /// + /// + /// + /// + public static MatExpr operator *(Mat a, double s) + { + if (a == null) + throw new ArgumentNullException("a"); + a.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_operatorMultiply_MatDouble(a.CvPtr, s); + return new MatExpr(retPtr); + } + + /// + /// + /// + /// + /// + /// + public static MatExpr operator *(double s, Mat a) + { + if (a == null) + throw new ArgumentNullException("a"); + a.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_operatorMultiply_DoubleMat(s, a.CvPtr); + return new MatExpr(retPtr); + } + + #endregion + + #region / + + /// + /// + /// + /// + /// + /// + public static MatExpr operator /(Mat a, Mat b) + { + if (a == null) + throw new ArgumentNullException("a"); + if (b == null) + throw new ArgumentNullException("b"); + a.ThrowIfDisposed(); + b.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_operatorDivide_MatMat(a.CvPtr, b.CvPtr); + return new MatExpr(retPtr); + } + + /// + /// + /// + /// + /// + /// + public static MatExpr operator /(Mat a, double s) + { + if (a == null) + throw new ArgumentNullException("a"); + a.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_operatorDivide_MatDouble(a.CvPtr, s); + return new MatExpr(retPtr); + } + + /// + /// + /// + /// + /// + /// + public static MatExpr operator /(double s, Mat a) + { + if (a == null) + throw new ArgumentNullException("a"); + a.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_operatorDivide_DoubleMat(s, a.CvPtr); + return new MatExpr(retPtr); + } + + #endregion + + #region And + + /// + /// + /// + /// + /// + /// + public static MatExpr operator &(Mat a, Mat b) + { + if (a == null) + throw new ArgumentNullException("a"); + if (b == null) + throw new ArgumentNullException("b"); + a.ThrowIfDisposed(); + b.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_operatorAnd_MatMat(a.CvPtr, b.CvPtr); + return new MatExpr(retPtr); + } + + /// + /// + /// + /// + /// + /// + public static MatExpr operator &(Mat a, double s) + { + if (a == null) + throw new ArgumentNullException("a"); + a.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_operatorAnd_MatDouble(a.CvPtr, s); + return new MatExpr(retPtr); + } + + /// + /// + /// + /// + /// + /// + public static MatExpr operator &(double s, Mat a) + { + if (a == null) + throw new ArgumentNullException("a"); + a.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_operatorAnd_DoubleMat(s, a.CvPtr); + return new MatExpr(retPtr); + } + + #endregion + + #region Or + + /// + /// + /// + /// + /// + /// + public static MatExpr operator |(Mat a, Mat b) + { + if (a == null) + throw new ArgumentNullException("a"); + if (b == null) + throw new ArgumentNullException("b"); + a.ThrowIfDisposed(); + b.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_operatorOr_MatMat(a.CvPtr, b.CvPtr); + return new MatExpr(retPtr); + } + + /// + /// + /// + /// + /// + /// + public static MatExpr operator |(Mat a, double s) + { + if (a == null) + throw new ArgumentNullException("a"); + a.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_operatorOr_MatDouble(a.CvPtr, s); + return new MatExpr(retPtr); + } + + /// + /// + /// + /// + /// + /// + public static MatExpr operator |(double s, Mat a) + { + if (a == null) + throw new ArgumentNullException("a"); + a.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_operatorOr_DoubleMat(s, a.CvPtr); + return new MatExpr(retPtr); + } + + #endregion + + #region Xor + + /// + /// + /// + /// + /// + /// + public static MatExpr operator ^(Mat a, Mat b) + { + if (a == null) + throw new ArgumentNullException("a"); + if (b == null) + throw new ArgumentNullException("b"); + a.ThrowIfDisposed(); + b.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_operatorXor_MatMat(a.CvPtr, b.CvPtr); + return new MatExpr(retPtr); + } + + /// + /// + /// + /// + /// + /// + public static MatExpr operator ^(Mat a, double s) + { + if (a == null) + throw new ArgumentNullException("a"); + a.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_operatorXor_MatDouble(a.CvPtr, s); + return new MatExpr(retPtr); + } + + /// + /// + /// + /// + /// + /// + public static MatExpr operator ^(double s, Mat a) + { + if (a == null) + throw new ArgumentNullException("a"); + a.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_operatorXor_DoubleMat(s, a.CvPtr); + return new MatExpr(retPtr); + } + + #endregion + + #region Not + + /// + /// + /// + /// + /// + public static MatExpr operator ~(Mat m) + { + if (m == null) + throw new ArgumentNullException("m"); + m.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_operatorNot(m.CvPtr); + return new MatExpr(retPtr); + } + + #endregion + + #endregion + + #endregion + + #region Comparison + + /// + /// operator < + /// + /// + /// + public MatExpr LessThan(Mat m) + { + if (m == null) + throw new ArgumentNullException("m"); + + IntPtr expr = NativeMethods.core_Mat_operatorLT_MatMat(ptr, m.CvPtr); + MatExpr ret = new MatExpr(expr); + + GC.KeepAlive(m); + return ret; + } + + /// + /// operator < + /// + /// + /// + public MatExpr LessThan(double d) + { + IntPtr expr = NativeMethods.core_Mat_operatorLT_MatDouble(ptr, d); + MatExpr ret = new MatExpr(expr); + + return ret; + } + + /// + /// operator <= + /// + /// + /// + public MatExpr LessThanOrEqual(Mat m) + { + if (m == null) + throw new ArgumentNullException("m"); + + IntPtr expr = NativeMethods.core_Mat_operatorLE_MatMat(ptr, m.CvPtr); + MatExpr ret = new MatExpr(expr); + + GC.KeepAlive(m); + return ret; + } + + /// + /// operator <= + /// + /// + /// + public MatExpr LessThanOrEqual(double d) + { + IntPtr expr = NativeMethods.core_Mat_operatorLE_MatDouble(ptr, d); + MatExpr ret = new MatExpr(expr); + + return ret; + } + + /// + /// operator == + /// + /// + /// + public MatExpr Equals(Mat m) + { + if (m == null) + throw new ArgumentNullException("m"); + + IntPtr expr = NativeMethods.core_Mat_operatorEQ_MatMat(ptr, m.CvPtr); + MatExpr ret = new MatExpr(expr); + + GC.KeepAlive(m); + return ret; + } + + /// + /// operator == + /// + /// + /// + public MatExpr Equals(double d) + { + IntPtr expr = NativeMethods.core_Mat_operatorEQ_MatDouble(ptr, d); + MatExpr ret = new MatExpr(expr); + + return ret; + } + + /// + /// operator != + /// + /// + /// + public MatExpr NotEquals(Mat m) + { + if (m == null) + throw new ArgumentNullException("m"); + + IntPtr expr = NativeMethods.core_Mat_operatorNE_MatMat(ptr, m.CvPtr); + MatExpr ret = new MatExpr(expr); + + GC.KeepAlive(m); + return ret; + } + + /// + /// operator != + /// + /// + /// + public MatExpr NotEquals(double d) + { + IntPtr expr = NativeMethods.core_Mat_operatorNE_MatDouble(ptr, d); + MatExpr ret = new MatExpr(expr); + + return ret; + } + + /// + /// operator > + /// + /// + /// + public MatExpr GreaterThan(Mat m) + { + if (m == null) + throw new ArgumentNullException("m"); + + IntPtr expr = NativeMethods.core_Mat_operatorGT_MatMat(ptr, m.CvPtr); + MatExpr ret = new MatExpr(expr); + + GC.KeepAlive(m); + return ret; + } + + /// + /// operator > + /// + /// + /// + public MatExpr GreaterThan(double d) + { + IntPtr expr = NativeMethods.core_Mat_operatorGT_MatDouble(ptr, d); + MatExpr ret = new MatExpr(expr); + + return ret; + } + + /// + /// operator >= + /// + /// + /// + public MatExpr GreaterThanOrEqual(Mat m) + { + if (m == null) + throw new ArgumentNullException("m"); + + IntPtr expr = NativeMethods.core_Mat_operatorGE_MatMat(ptr, m.CvPtr); + MatExpr ret = new MatExpr(expr); + + GC.KeepAlive(m); + return ret; + } + + /// + /// operator >= + /// + /// + /// + public MatExpr GreaterThanOrEqual(double d) + { + IntPtr expr = NativeMethods.core_Mat_operatorGE_MatDouble(ptr, d); + MatExpr ret = new MatExpr(expr); + + return ret; + } + + #endregion + + #region Public Methods + + #region Mat Indexers + + /// + /// Extracts a rectangular submatrix. + /// + /// Start row of the extracted submatrix. The upper boundary is not included. + /// End row of the extracted submatrix. The upper boundary is not included. + /// Start column of the extracted submatrix. The upper boundary is not included. + /// End column of the extracted submatrix. The upper boundary is not included. + /// + public Mat this[int rowStart, int rowEnd, int colStart, int colEnd] + { + get { return SubMat(rowStart, rowEnd, colStart, colEnd); } + set + { + if (value == null) + throw new ArgumentNullException("value"); + value.ThrowIfDisposed(); + //if (Type() != value.Type()) + // throw new ArgumentException("Mat type mismatch"); + if (Dims() != value.Dims()) + throw new ArgumentException("Dimension mismatch"); + + Mat sub = SubMat(rowStart, rowEnd, colStart, colEnd); + if (sub.Size() != value.Size()) + throw new ArgumentException("Specified ROI != mat.Size()"); + value.CopyTo(sub); + } + } + + /// + /// Extracts a rectangular submatrix. + /// + /// Start and end row of the extracted submatrix. The upper boundary is not included. + /// To select all the rows, use Range.All(). + /// Start and end column of the extracted submatrix. + /// The upper boundary is not included. To select all the columns, use Range.All(). + /// + public Mat this[Range rowRange, Range colRange] + { + get { return SubMat(rowRange, colRange); } + set + { + if (value == null) + throw new ArgumentNullException("value"); + value.ThrowIfDisposed(); + //if (Type() != value.Type()) + // throw new ArgumentException("Mat type mismatch"); + if (Dims() != value.Dims()) + throw new ArgumentException("Dimension mismatch"); + + Mat sub = SubMat(rowRange, colRange); + if (sub.Size() != value.Size()) + throw new ArgumentException("Specified ROI != mat.Size()"); + value.CopyTo(sub); + } + } + + /// + /// Extracts a rectangular submatrix. + /// + /// Extracted submatrix specified as a rectangle. + /// + public Mat this[Rect roi] + { + get { return SubMat(roi); } + set + { + if (value == null) + throw new ArgumentNullException("value"); + value.ThrowIfDisposed(); + //if (Type() != value.Type()) + // throw new ArgumentException("Mat type mismatch"); + if (Dims() != value.Dims()) + throw new ArgumentException("Dimension mismatch"); + + if (roi.Size != value.Size()) + throw new ArgumentException("Specified ROI != mat.Size()"); + Mat sub = SubMat(roi); + value.CopyTo(sub); + } + } + + /// + /// Extracts a rectangular submatrix. + /// + /// Array of selected ranges along each array dimension. + /// + public Mat this[params Range[] ranges] + { + get { return SubMat(ranges); } + set + { + if (value == null) + throw new ArgumentNullException("value"); + value.ThrowIfDisposed(); + //if (Type() != value.Type()) + // throw new ArgumentException("Mat type mismatch"); + + Mat sub = SubMat(ranges); + + int dims = Dims(); + if (dims != value.Dims()) + throw new ArgumentException("Dimension mismatch"); + for (int i = 0; i < dims; i++) + { + if (sub.Size(i) != value.Size(i)) + throw new ArgumentException("Size mismatch at dimension " + i); + } + + value.CopyTo(sub); + } + } + + #endregion + + #region MatExpr Indexers + + #region SubMat + + /// + /// + /// + public class MatExprIndexer : MatExprRangeIndexer + { + /// + /// + /// + /// + protected internal MatExprIndexer(Mat parent) + : base(parent) + { + } + + /// + /// Extracts a rectangular submatrix. + /// + /// Start row of the extracted submatrix. The upper boundary is not included. + /// End row of the extracted submatrix. The upper boundary is not included. + /// Start column of the extracted submatrix. The upper boundary is not included. + /// End column of the extracted submatrix. The upper boundary is not included. + /// + public override MatExpr this[int rowStart, int rowEnd, int colStart, int colEnd] + { + get { return parent.SubMat(rowStart, rowEnd, colStart, colEnd); } + set + { + if (value == null) + throw new ArgumentNullException("value"); + Mat submat = parent.SubMat(rowStart, rowEnd, colStart, colEnd); + NativeMethods.core_Mat_assignment_FromMatExpr(submat.CvPtr, value.CvPtr); + } + } + + /// + /// Extracts a rectangular submatrix. + /// + /// Start and end row of the extracted submatrix. The upper boundary is not included. + /// To select all the rows, use Range.All(). + /// Start and end column of the extracted submatrix. + /// The upper boundary is not included. To select all the columns, use Range.All(). + /// + public override MatExpr this[Range rowRange, Range colRange] + { + get { return parent.SubMat(rowRange, colRange); } + set + { + if (value == null) + throw new ArgumentNullException("value"); + Mat submat = parent.SubMat(rowRange, colRange); + NativeMethods.core_Mat_assignment_FromMatExpr(submat.CvPtr, value.CvPtr); + } + } + + /// + /// Extracts a rectangular submatrix. + /// + /// Extracted submatrix specified as a rectangle. + /// + public override MatExpr this[Rect roi] + { + get { return parent.SubMat(roi); } + set + { + if (value == null) + throw new ArgumentNullException("value"); + Mat submat = parent.SubMat(roi); + NativeMethods.core_Mat_assignment_FromMatExpr(submat.CvPtr, value.CvPtr); + } + } + + /// + /// Extracts a rectangular submatrix. + /// + /// Array of selected ranges along each array dimension. + /// + public override MatExpr this[params Range[] ranges] + { + get { return parent.SubMat(ranges); } + set + { + if (value == null) + throw new ArgumentNullException("value"); + Mat submat = parent.SubMat(ranges); + NativeMethods.core_Mat_assignment_FromMatExpr(submat.CvPtr, value.CvPtr); + } + } + } + + /// + /// Indexer to access partial Mat as MatExpr + /// + /// + public MatExprIndexer Expr + { + get { return matExprIndexer ?? (matExprIndexer = new MatExprIndexer(this)); } + } + + private MatExprIndexer matExprIndexer; + + #endregion + + #region ColExpr + + /// + /// Mat column's indexer object + /// + public class ColExprIndexer : MatRowColExprIndexer + { + /// + /// + /// + /// + protected internal ColExprIndexer(Mat parent) + : base(parent) + { + } + + /// + /// Creates a matrix header for the specified matrix column. + /// + /// A 0-based column index. + /// + public override MatExpr this[int x] + { + get + { + parent.ThrowIfDisposed(); + IntPtr matExprPtr = NativeMethods.core_Mat_col_toMatExpr(parent.ptr, x); + MatExpr matExpr = new MatExpr(matExprPtr); + return matExpr; + } + set + { + if (value == null) + throw new ArgumentNullException("value"); + parent.ThrowIfDisposed(); + IntPtr colMatPtr = NativeMethods.core_Mat_col_toMat(parent.ptr, x); + NativeMethods.core_Mat_assignment_FromMatExpr(colMatPtr, value.CvPtr); + NativeMethods.core_Mat_delete(colMatPtr); + } + } + + /// + /// Creates a matrix header for the specified column span. + /// + /// An inclusive 0-based start index of the column span. + /// An exclusive 0-based ending index of the column span. + /// + public override MatExpr this[int startCol, int endCol] + { + get + { + parent.ThrowIfDisposed(); + IntPtr matExprPtr = NativeMethods.core_Mat_colRange_toMatExpr(parent.ptr, startCol, endCol); + MatExpr matExpr = new MatExpr(matExprPtr); + return matExpr; + } + set + { + if (value == null) + throw new ArgumentNullException("value"); + parent.ThrowIfDisposed(); + IntPtr colMatPtr = NativeMethods.core_Mat_colRange_toMat(parent.ptr, startCol, endCol); + NativeMethods.core_Mat_assignment_FromMatExpr(colMatPtr, value.CvPtr); + NativeMethods.core_Mat_delete(colMatPtr); + } + } + } + + /// + /// Indexer to access Mat column as MatExpr + /// + /// + public ColExprIndexer ColExpr + { + get { return colExprIndexer ?? (colExprIndexer = new ColExprIndexer(this)); } + } + + private ColExprIndexer colExprIndexer; + + #endregion + + #region RowExpr + + /// + /// Mat row's indexer object + /// + public class RowExprIndexer : MatRowColExprIndexer + { + /// + /// + /// + /// + protected internal RowExprIndexer(Mat parent) + : base(parent) + { + } + + /// + /// Creates a matrix header for the specified matrix row. [Mat::row] + /// + /// A 0-based row index. + /// + public override MatExpr this[int y] + { + get + { + parent.ThrowIfDisposed(); + IntPtr matExprPtr = NativeMethods.core_Mat_row_toMatExpr(parent.ptr, y); + MatExpr matExpr = new MatExpr(matExprPtr); + return matExpr; + } + set + { + if (value == null) + throw new ArgumentNullException("value"); + parent.ThrowIfDisposed(); + IntPtr rowMatPtr = NativeMethods.core_Mat_row_toMat(parent.ptr, y); + NativeMethods.core_Mat_assignment_FromMatExpr(rowMatPtr, value.CvPtr); + NativeMethods.core_Mat_delete(rowMatPtr); + } + } + + /// + /// Creates a matrix header for the specified row span. (Mat::rowRange) + /// + /// An inclusive 0-based start index of the row span. + /// An exclusive 0-based ending index of the row span. + /// + public override MatExpr this[int startRow, int endRow] + { + get + { + parent.ThrowIfDisposed(); + IntPtr matExprPtr = NativeMethods.core_Mat_rowRange_toMatExpr(parent.ptr, startRow, endRow); + MatExpr matExpr = new MatExpr(matExprPtr); + return matExpr; + } + set + { + if (value == null) + throw new ArgumentNullException("value"); + parent.ThrowIfDisposed(); + IntPtr rowMatPtr = NativeMethods.core_Mat_rowRange_toMat(parent.ptr, startRow, endRow); + NativeMethods.core_Mat_assignment_FromMatExpr(rowMatPtr, value.CvPtr); + } + } + } + + /// + /// Indexer to access Mat row as MatExpr + /// + /// + public RowExprIndexer RowExpr + { + get { return rowExprIndexer ?? (rowExprIndexer = new RowExprIndexer(this)); } + } + + private RowExprIndexer rowExprIndexer; + + #endregion + + #endregion + + #region AdjustROI + + /// + /// Adjusts a submatrix size and position within the parent matrix. + /// + /// Shift of the top submatrix boundary upwards. + /// Shift of the bottom submatrix boundary downwards. + /// Shift of the left submatrix boundary to the left. + /// Shift of the right submatrix boundary to the right. + /// + public Mat AdjustROI(int dtop, int dbottom, int dleft, int dright) + { + ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_adjustROI(ptr, dtop, dbottom, dleft, dright); + Mat retVal = new Mat(retPtr); + return retVal; + } + + #endregion + + #region AssignTo + + /// + /// Provides a functional form of convertTo. + /// + /// Destination array. + /// Desired destination array depth (or -1 if it should be the same as the source type). + public void AssignTo(Mat m, MatType type) + { + ThrowIfDisposed(); + if (m == null) + throw new ArgumentNullException("m"); + NativeMethods.core_Mat_assignTo2(ptr, m.CvPtr, type); + } + + /// + /// Provides a functional form of convertTo. + /// + /// Destination array. + public void AssignTo(Mat m) + { + NativeMethods.core_Mat_assignTo1(ptr, m.CvPtr); + } + + #endregion + + #region Channels + + /// + /// Returns the number of matrix channels. + /// + /// + public int Channels() + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_channels(ptr); + } + + #endregion + + #region CheckVector + + /// + /// + /// + /// + /// + public int CheckVector(int elemChannels) + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_checkVector1(ptr, elemChannels); + } + + /// + /// + /// + /// + /// + /// + public int CheckVector(int elemChannels, int depth) + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_checkVector2(ptr, elemChannels, depth); + } + + /// + /// + /// + /// + /// + /// + /// + public int CheckVector(int elemChannels, int depth, bool requireContinuous) + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_checkVector3( + ptr, elemChannels, depth, requireContinuous ? 1 : 0); + } + + #endregion + + #region Clone + + /// + /// Creates a full copy of the matrix. + /// + /// + public Mat Clone() + { + ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_clone(ptr); + Mat retVal = new Mat(retPtr); + return retVal; + } + + object ICloneable.Clone() + { + return Clone(); + } + + /// + /// Returns the partial Mat of the specified Mat + /// + /// + /// + public Mat Clone(Rect roi) + { + using (var part = new Mat(this, roi)) + { + return part.Clone(); + } + } + + #endregion + + #region Cols + + /// + /// the number of columns or -1 when the array has more than 2 dimensions + /// + /// + public int Cols + { + get + { + //行列データが新たに確保された場合に対応できない。 + //if (colsVal == int.MinValue) + //{ + // colsVal = NativeMethods.core_Mat_cols(ptr); + //} + //return colsVal; + return NativeMethods.core_Mat_cols(ptr); + } + } + + /// + /// the number of columns or -1 when the array has more than 2 dimensions + /// + /// + public int Width + { + get + { + //if (colsVal == int.MinValue) + //{ + // colsVal = Cols; + //} + //return colsVal; + return NativeMethods.core_Mat_cols(ptr); + } + } + + //private int colsVal = int.MinValue; + + #endregion + + #region Dims + + /// + /// the array dimensionality, >= 2 + /// + public int Dims() + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_dims(ptr); + } + + #endregion + + #region ConvertTo + + /// + /// Converts an array to another data type with optional scaling. + /// + /// output matrix; if it does not have a proper size or type before the operation, it is reallocated. + /// desired output matrix type or, rather, the depth since the number of channels are the same as the input has; + /// if rtype is negative, the output matrix will have the same type as the input. + /// optional scale factor. + /// optional delta added to the scaled values. + public void ConvertTo(Mat m, MatType rtype, double alpha = 1, double beta = 0) + { + ThrowIfDisposed(); + if (m == null) + throw new ArgumentNullException("m"); + NativeMethods.core_Mat_convertTo(ptr, m.CvPtr, rtype, alpha, beta); + } + + #endregion + + #region CopyTo + + /// + /// Copies the matrix to another one. + /// + /// Destination matrix. If it does not have a proper size or type before the operation, it is reallocated. + public void CopyTo(Mat m) + { + CopyTo(m, null); + } + + /// + /// Copies the matrix to another one. + /// + /// Destination matrix. If it does not have a proper size or type before the operation, it is reallocated. + /// Operation mask. Its non-zero elements indicate which matrix elements need to be copied. + public void CopyTo(Mat m, Mat mask) + { + ThrowIfDisposed(); + if (m == null) + throw new ArgumentNullException("m"); + IntPtr maskPtr = Cv2.ToPtr(mask); + NativeMethods.core_Mat_copyTo(ptr, m.CvPtr, maskPtr); + } + + #endregion + + #region Create + + /// + /// Allocates new array data if needed. + /// + /// New number of rows. + /// New number of columns. + /// New matrix type. + public void Create(int rows, int cols, MatType type) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_create(ptr, rows, cols, type); + } + + /// + /// Allocates new array data if needed. + /// + /// Alternative new matrix size specification: Size(cols, rows) + /// New matrix type. + public void Create(Size size, MatType type) + { + Create(size.Height, size.Width, type); + } + + /// + /// Allocates new array data if needed. + /// + /// Array of integers specifying a new array shape. + /// New matrix type. + public void Create(MatType type, params int[] sizes) + { + if (sizes == null) + throw new ArgumentNullException("sizes"); + if (sizes.Length < 2) + throw new ArgumentException("sizes.Length < 2"); + NativeMethods.core_Mat_create(ptr, sizes.Length, sizes, type); + } + + #endregion + + #region Cross + + /// + /// Computes a cross-product of two 3-element vectors. + /// + /// Another cross-product operand. + /// + public Mat Cross(Mat m) + { + ThrowIfDisposed(); + if (m == null) + throw new ArgumentNullException("m"); + IntPtr retPtr = NativeMethods.core_Mat_cross(ptr, m.CvPtr); + Mat retVal = new Mat(retPtr); + return retVal; + } + + #endregion + + #region Data + + /// + /// pointer to the data + /// + public IntPtr Data + { + get + { + unsafe + { + return new IntPtr(DataPointer); + } + } + } + + /// + /// unsafe pointer to the data + /// + public unsafe byte* DataPointer + { + get + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_data(ptr); + } + } + + /// + /// The pointer that is possible to compute a relative sub-array position in the main container array using locateROI() + /// + public IntPtr DataStart + { + get + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_datastart(ptr); + } + } + + /// + /// The pointer that is possible to compute a relative sub-array position in the main container array using locateROI() + /// + public IntPtr DataEnd + { + get + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_dataend(ptr); + } + } + + /// + /// The pointer that is possible to compute a relative sub-array position in the main container array using locateROI() + /// + public IntPtr DataLimit + { + get + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_datalimit(ptr); + } + } + + #endregion + + #region Depth + + /// + /// Returns the depth of a matrix element. + /// + /// + public int Depth() + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_depth(ptr); + } + + #endregion + + #region Diag + + /// + /// Single-column matrix that forms a diagonal matrix or index of the diagonal, with the following values: + /// + /// Single-column matrix that forms a diagonal matrix or index of the diagonal, with the following values: + /// + public Mat Diag(MatDiagType d = MatDiagType.Main) + { + ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_diag(ptr, (int) d); + Mat retVal = new Mat(retPtr); + return retVal; + } + + #endregion + + #region Dot + + /// + /// Computes a dot-product of two vectors. + /// + /// another dot-product operand. + /// + public double Dot(Mat m) + { + ThrowIfDisposed(); + if (m == null) + throw new ArgumentNullException("m"); + return NativeMethods.core_Mat_dot(ptr, m.CvPtr); + } + + #endregion + + #region ElemSize + + /// + /// Returns the matrix element size in bytes. + /// + /// + public int ElemSize() + { + ThrowIfDisposed(); + return (int) NativeMethods.core_Mat_elemSize(ptr); + } + + #endregion + + #region ElemSize1 + + /// + /// Returns the size of each matrix element channel in bytes. + /// + /// + public int ElemSize1() + { + ThrowIfDisposed(); + return (int) NativeMethods.core_Mat_elemSize1(ptr); + } + + #endregion + + #region Empty + + /// + /// Returns true if the array has no elements. + /// + /// + public bool Empty() + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_empty(ptr) != 0; + } + + #endregion + + #region Inv + + /// + /// Inverses a matrix. + /// + /// Matrix inversion method + /// + public Mat Inv(DecompTypes method = DecompTypes.LU) + { + ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_inv2(ptr, (int) method); + Mat retVal = new Mat(retPtr); + return retVal; + } + + #endregion + + #region IsContinuous + + /// + /// Reports whether the matrix is continuous or not. + /// + /// + public bool IsContinuous() + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_isContinuous(ptr) != 0; + } + + #endregion + + #region IsSubmatrix + + /// + /// Returns whether this matrix is a part of other matrix or not. + /// + /// + public bool IsSubmatrix() + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_isSubmatrix(ptr) != 0; + } + + #endregion + + #region LocateROI + + /// + /// Locates the matrix header within a parent matrix. + /// + /// Output parameter that contains the size of the whole matrix containing *this as a part. + /// Output parameter that contains an offset of *this inside the whole matrix. + public void LocateROI(out Size wholeSize, out Point ofs) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_locateROI(ptr, out wholeSize, out ofs); + } + + #endregion + + #region Mul + + /// + /// Performs an element-wise multiplication or division of the two matrices. + /// + /// + /// + /// + public MatExpr Mul(Mat m, double scale = 1) + { + ThrowIfDisposed(); + if (m == null) + throw new ArgumentNullException(); + IntPtr mPtr = m.CvPtr; + IntPtr retPtr = NativeMethods.core_Mat_mul2(ptr, mPtr, scale); + MatExpr retVal = new MatExpr(retPtr); + return retVal; + } + + #endregion + + #region Reshape + + /// + /// Changes the shape and/or the number of channels of a 2D matrix without copying the data. + /// + /// New number of channels. If the parameter is 0, the number of channels remains the same. + /// New number of rows. If the parameter is 0, the number of rows remains the same. + /// + public Mat Reshape(int cn, int rows = 0) + { + ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_reshape2(ptr, cn, rows); + Mat retVal = new Mat(retPtr); + return retVal; + } + + /// + /// Changes the shape and/or the number of channels of a 2D matrix without copying the data. + /// + /// New number of channels. If the parameter is 0, the number of channels remains the same. + /// New number of rows. If the parameter is 0, the number of rows remains the same. + /// + public Mat Reshape(int cn, params int[] newDims) + { + ThrowIfDisposed(); + if (newDims == null) + throw new ArgumentNullException("newDims"); + IntPtr retPtr = NativeMethods.core_Mat_reshape3(ptr, cn, newDims.Length, newDims); + Mat retVal = new Mat(retPtr); + return retVal; + } + + #endregion + + #region Rows + + /// + /// the number of rows or -1 when the array has more than 2 dimensions + /// + public int Rows + { + get + { + //if (rowsVal == int.MinValue) + //{ + // rowsVal = NativeMethods.core_Mat_rows(ptr); + //} + //return rowsVal; + return NativeMethods.core_Mat_rows(ptr); + } + } + + /// + /// the number of rows or -1 when the array has more than 2 dimensions + /// + /// + public int Height + { + get + { + //if (rowsVal == int.MinValue) + //{ + // rowsVal = Rows; + //} + //return rowsVal; + return NativeMethods.core_Mat_rows(ptr); + } + } + + //private int rowsVal = int.MinValue; + + #endregion + + #region SetTo + + /// + /// Sets all or some of the array elements to the specified value. + /// + /// + /// + /// + public Mat SetTo(Scalar value, InputArray mask = null) + { + ThrowIfDisposed(); + IntPtr maskPtr = Cv2.ToPtr(mask); + IntPtr retPtr = NativeMethods.core_Mat_setTo_Scalar(ptr, value, maskPtr); + Mat retVal = new Mat(retPtr); + return retVal; + } + + /// + /// Sets all or some of the array elements to the specified value. + /// + /// + /// + /// + public Mat SetTo(InputArray value, InputArray mask = null) + { + ThrowIfDisposed(); + if (value == null) + throw new ArgumentNullException("value"); + value.ThrowIfDisposed(); + IntPtr maskPtr = Cv2.ToPtr(mask); + IntPtr retPtr = NativeMethods.core_Mat_setTo_InputArray(ptr, value.CvPtr, maskPtr); + Mat retVal = new Mat(retPtr); + return retVal; + } + + #endregion + + #region Size + + /// + /// Returns a matrix size. + /// + /// + public Size Size() + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_size(ptr); + } + + /// + /// Returns a matrix size. + /// + /// + /// + public int Size(int dim) + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_sizeAt(ptr, dim); + } + + #endregion + + #region Step + + /// + /// + /// + /// + public long Step() + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_step(ptr); + } + + /// + /// + /// + /// + /// + public long Step(int i) + { + ThrowIfDisposed(); + return (long) NativeMethods.core_Mat_stepAt(ptr, i); + } + + #endregion + + #region Step1 + + /// + /// Returns a normalized step. + /// + /// + public long Step1() + { + ThrowIfDisposed(); + return (long) NativeMethods.core_Mat_step1(ptr); + } + + /// + /// Returns a normalized step. + /// + /// + /// + public long Step1(int i) + { + ThrowIfDisposed(); + return (long) NativeMethods.core_Mat_step1(ptr, i); + } + + #endregion + + #region T + + /// + /// Transposes a matrix. + /// + /// + public Mat T() + { + ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_t(ptr); + Mat retVal = new Mat(retPtr); + return retVal; + } + + #endregion + + #region Total + + /// + /// Returns the total number of array elements. + /// + /// + public long Total() + { + ThrowIfDisposed(); + return (long) NativeMethods.core_Mat_total(ptr); + } + + #endregion + + #region Type + + /// + /// Returns the type of a matrix element. + /// + /// + public MatType Type() + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_type(ptr); + } + + #endregion + + #region ToString + + /// + /// Returns a string that represents this Mat. + /// + /// + public override string ToString() + { + return "Mat [ " + + Rows + "*" + Cols + "*" + Type().ToString() + + ", IsContinuous=" + IsContinuous() + ", IsSubmatrix=" + IsSubmatrix() + + ", Ptr=0x" + Convert.ToString(ptr.ToInt64(), 16) + + ", Data=0x" + Convert.ToString(Data.ToInt64(), 16) + + " ]"; + } + + #endregion + + #region Dump + + /// + /// Returns a string that represents each element value of Mat. + /// This method corresponds to std::ostream << Mat + /// + /// + /// + public string Dump(DumpFormat format = DumpFormat.Default) + { + ThrowIfDisposed(); + string formatStr = GetDumpFormatString(format); + unsafe + { + sbyte* buf = null; + try + { + buf = NativeMethods.core_Mat_dump(ptr, formatStr); + return new string(buf); + } + finally + { + if (buf != null) + NativeMethods.core_Mat_dump_delete(buf); + } + } + } + + private static string GetDumpFormatString(DumpFormat format) + { + if (format == DumpFormat.Default) + return null; + + string name = Enum.GetName(typeof (DumpFormat), format); + if (name == null) + throw new ArgumentException(); + return name.ToLower(); + } + + #endregion + + #region EmptyClone + +#if LANG_JP + /// + /// このMatと同じサイズ・ビット深度・チャネル数を持つ + /// Matオブジェクトを新たに作成し、返す + /// + /// コピーされた画像 +#else + /// + /// Makes a Mat that have the same size, depth and channels as this image + /// + /// +#endif + public Mat EmptyClone() + { + return new Mat(Size(), Type()); + } + + #endregion + + #region Ptr + + /// + /// Returns a pointer to the specified matrix row. + /// + /// Index along the dimension 0 + /// + public IntPtr Ptr(int i0) + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_ptr1d(ptr, i0); + } + + /// + /// Returns a pointer to the specified matrix element. + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// + public IntPtr Ptr(int i0, int i1) + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_ptr2d(ptr, i0, i1); + } + + /// + /// Returns a pointer to the specified matrix element. + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// + public IntPtr Ptr(int i0, int i1, int i2) + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_ptr3d(ptr, i0, i1, i2); + } + + /// + /// Returns a pointer to the specified matrix element. + /// + /// Array of Mat::dims indices. + /// + public IntPtr Ptr(params int[] idx) + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_ptrnd(ptr, idx); + } + + #endregion + + #region Element Indexer + + /// + /// Mat Indexer + /// + /// + public sealed class Indexer : MatIndexer where T : struct + { + private readonly long ptrVal; + + internal Indexer(Mat parent) + : base(parent) + { + ptrVal = parent.Data.ToInt64(); + } + + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public override T this[int i0] + { + get + { + IntPtr p = new IntPtr(ptrVal + (steps[0]*i0)); + return (T) Marshal.PtrToStructure(p, typeof (T)); + } + set + { + IntPtr p = new IntPtr(ptrVal + (steps[0]*i0)); + Marshal.StructureToPtr(value, p, false); + } + } + + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override T this[int i0, int i1] + { + get + { + IntPtr p = new IntPtr(ptrVal + (steps[0]*i0) + (steps[1]*i1)); + return (T) Marshal.PtrToStructure(p, typeof (T)); + } + set + { + IntPtr p = new IntPtr(ptrVal + (steps[0]*i0) + (steps[1]*i1)); + Marshal.StructureToPtr(value, p, false); + } + } + + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public override T this[int i0, int i1, int i2] + { + get + { + IntPtr p = new IntPtr(ptrVal + (steps[0]*i0) + (steps[1]*i1) + (steps[2]*i2)); + return (T) Marshal.PtrToStructure(p, typeof (T)); + } + set + { + IntPtr p = new IntPtr(ptrVal + (steps[0]*i0) + (steps[1]*i1) + (steps[2]*i2)); + Marshal.StructureToPtr(value, p, false); + } + } + + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public override T this[params int[] idx] + { + get + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i]*idx[i]; + } + IntPtr p = new IntPtr(ptrVal + offset); + return (T) Marshal.PtrToStructure(p, typeof (T)); + } + set + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i]*idx[i]; + } + IntPtr p = new IntPtr(ptrVal + offset); + Marshal.StructureToPtr(value, p, false); + } + } + } + + /// + /// Gets a type-specific indexer. The indexer has getters/setters to access each matrix element. + /// + /// + /// + public Indexer GetGenericIndexer() where T : struct + { + return new Indexer(this); + } + + #endregion + + #region Get/Set + + /// + /// Returns a value to the specified array element. + /// + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public T Get(int i0) where T : struct + { + return new Indexer(this)[i0]; + } + + /// + /// Returns a value to the specified array element. + /// + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public T Get(int i0, int i1) where T : struct + { + return new Indexer(this)[i0, i1]; + } + + /// + /// Returns a value to the specified array element. + /// + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public T Get(int i0, int i1, int i2) where T : struct + { + return new Indexer(this)[i0, i1, i2]; + } + + /// + /// Returns a value to the specified array element. + /// + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public T Get(params int[] idx) where T : struct + { + return new Indexer(this)[idx]; + } + + /// + /// Returns a value to the specified array element. + /// + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public T At(int i0) where T : struct + { + return new Indexer(this)[i0]; + } + + /// + /// Returns a value to the specified array element. + /// + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public T At(int i0, int i1) where T : struct + { + return new Indexer(this)[i0, i1]; + } + + /// + /// Returns a value to the specified array element. + /// + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public T At(int i0, int i1, int i2) where T : struct + { + return new Indexer(this)[i0, i1, i2]; + } + + /// + /// Returns a value to the specified array element. + /// + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public T At(params int[] idx) where T : struct + { + return new Indexer(this)[idx]; + } + + + /// + /// Set a value to the specified array element. + /// + /// + /// Index along the dimension 0 + /// + public void Set(int i0, T value) where T : struct + { + (new Indexer(this))[i0] = value; + } + + /// + /// Set a value to the specified array element. + /// + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// + public void Set(int i0, int i1, T value) where T : struct + { + (new Indexer(this))[i0, i1] = value; + } + + /// + /// Set a value to the specified array element. + /// + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// + public void Set(int i0, int i1, int i2, T value) where T : struct + { + (new Indexer(this)[i0, i1, i2]) = value; + } + + /// + /// Set a value to the specified array element. + /// + /// + /// Array of Mat::dims indices. + /// + public void Set(int[] idx, T value) where T : struct + { + (new Indexer(this)[idx]) = value; + } + + #endregion + + #region Col/ColRange + + /* + /// + /// + /// + /// + /// + public Mat Col(int x) + { + ThrowIfDisposed(); + IntPtr matPtr = NativeMethods.core_Mat_col_toMat(ptr, x); + return new Mat(matPtr); + } + */ + + /// + /// + /// + /// + /// + /// + public Mat ColRange(int startCol, int endCol) + { + ThrowIfDisposed(); + IntPtr matPtr = NativeMethods.core_Mat_colRange_toMat(ptr, startCol, endCol); + return new Mat(matPtr); + } + + /// + /// + /// + /// + /// + public Mat ColRange(Range range) + { + return ColRange(range.Start, range.End); + } + + + /// + /// Mat column's indexer object + /// + public class ColIndexer : MatRowColIndexer + { + /// + /// + /// + /// + protected internal ColIndexer(Mat parent) + : base(parent) + { + } + + /// + /// Creates a matrix header for the specified matrix column. + /// + /// A 0-based column index. + /// + public override Mat this[int x] + { + get + { + parent.ThrowIfDisposed(); + IntPtr matPtr = NativeMethods.core_Mat_col_toMat(parent.ptr, x); + Mat mat = new Mat(matPtr); + return mat; + } + set + { + parent.ThrowIfDisposed(); + if (value == null) + throw new ArgumentNullException("value"); + value.ThrowIfDisposed(); + if (parent.Dims() != value.Dims()) + throw new ArgumentException("Dimension mismatch"); + + IntPtr matPtr = NativeMethods.core_Mat_col_toMat(parent.ptr, x); + Mat mat = new Mat(matPtr); + if (mat.Size() != value.Size()) + throw new ArgumentException("Specified ROI != mat.Size()"); + value.CopyTo(mat); + } + } + + /// + /// Creates a matrix header for the specified column span. + /// + /// An inclusive 0-based start index of the column span. + /// An exclusive 0-based ending index of the column span. + /// + public override Mat this[int startCol, int endCol] + { + get + { + parent.ThrowIfDisposed(); + IntPtr matPtr = NativeMethods.core_Mat_colRange_toMat(parent.ptr, startCol, endCol); + Mat mat = new Mat(matPtr); + return mat; + } + set + { + parent.ThrowIfDisposed(); + if (value == null) + throw new ArgumentNullException("value"); + value.ThrowIfDisposed(); + if (parent.Dims() != value.Dims()) + throw new ArgumentException("Dimension mismatch"); + + IntPtr colMatPtr = NativeMethods.core_Mat_colRange_toMat(parent.ptr, startCol, endCol); + Mat colMat = new Mat(colMatPtr); + if (colMat.Size() != value.Size()) + throw new ArgumentException("Specified ROI != mat.Size()"); + value.CopyTo(colMat); + } + } + } + + /// + /// Indexer to access Mat column as Mat + /// + /// + public ColIndexer Col + { + get { return colIndexer ?? (colIndexer = new ColIndexer(this)); } + } + + private ColIndexer colIndexer; + + #endregion + + #region Row/RowRange + + /* + /// + /// + /// + /// + /// + public Mat Row(int y) + { + ThrowIfDisposed(); + IntPtr matPtr = NativeMethods.core_Mat_row_toMat(ptr, y); + return new Mat(matPtr); + } + */ + + /// + /// + /// + /// + /// + /// + public Mat RowRange(int startRow, int endRow) + { + ThrowIfDisposed(); + IntPtr matPtr = NativeMethods.core_Mat_rowRange_toMat(ptr, startRow, endRow); + return new Mat(matPtr); + } + + /// + /// + /// + /// + /// + public Mat RowRange(Range range) + { + return RowRange(range.Start, range.End); + } + + /// + /// Mat row's indexer object + /// + public class RowIndexer : MatRowColIndexer + { + /// + /// + /// + /// + protected internal RowIndexer(Mat parent) + : base(parent) + { + } + + /// + /// Creates a matrix header for the specified matrix column. + /// + /// A 0-based column index. + /// + public override Mat this[int x] + { + get + { + parent.ThrowIfDisposed(); + IntPtr matPtr = NativeMethods.core_Mat_row_toMat(parent.ptr, x); + Mat mat = new Mat(matPtr); + return mat; + } + set + { + parent.ThrowIfDisposed(); + if (value == null) + throw new ArgumentNullException("value"); + value.ThrowIfDisposed(); + if (parent.Dims() != value.Dims()) + throw new ArgumentException("Dimension mismatch"); + + IntPtr matPtr = NativeMethods.core_Mat_row_toMat(parent.ptr, x); + Mat mat = new Mat(matPtr); + if (mat.Size() != value.Size()) + throw new ArgumentException("Specified ROI != mat.Size()"); + value.CopyTo(mat); + } + } + + /// + /// Creates a matrix header for the specified column span. + /// + /// An inclusive 0-based start index of the column span. + /// An exclusive 0-based ending index of the column span. + /// + public override Mat this[int startCol, int endCol] + { + get + { + parent.ThrowIfDisposed(); + IntPtr matPtr = NativeMethods.core_Mat_rowRange_toMat(parent.ptr, startCol, endCol); + Mat mat = new Mat(matPtr); + return mat; + } + set + { + parent.ThrowIfDisposed(); + if (value == null) + throw new ArgumentNullException("value"); + value.ThrowIfDisposed(); + if (parent.Dims() != value.Dims()) + throw new ArgumentException("Dimension mismatch"); + + IntPtr matPtr = NativeMethods.core_Mat_rowRange_toMat(parent.ptr, startCol, endCol); + Mat mat = new Mat(matPtr); + if (mat.Size() != value.Size()) + throw new ArgumentException("Specified ROI != mat.Size()"); + value.CopyTo(mat); + } + } + } + + /// + /// Indexer to access Mat row as Mat + /// + /// + public RowIndexer Row + { + get { return rowIndexer ?? (rowIndexer = new RowIndexer(this)); } + } + + private RowIndexer rowIndexer; + + #endregion + + #region SubMat + + /// + /// + /// + /// + /// + /// + /// + /// + public Mat SubMat(int rowStart, int rowEnd, int colStart, int colEnd) + { + if (rowStart >= rowEnd) + throw new ArgumentException("rowStart >= rowEnd"); + if (colStart >= colEnd) + throw new ArgumentException("colStart >= colEnd"); + + ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_Mat_subMat1(ptr, rowStart, rowEnd, colStart, colEnd); + Mat retVal = new Mat(retPtr); + return retVal; + } + + /// + /// + /// + /// + /// + /// + public Mat SubMat(Range rowRange, Range colRange) + { + return SubMat(rowRange.Start, rowRange.End, colRange.Start, colRange.End); + } + + /// + /// + /// + /// + /// + public Mat SubMat(Rect roi) + { + return SubMat(roi.Y, roi.Y + roi.Height, roi.X, roi.X + roi.Width); + } + + + /// + /// + /// + /// + /// + public Mat SubMat(params Range[] ranges) + { + throw new NotImplementedException(); + /* + if (ranges == null) + throw new ArgumentNullException(); + + ThrowIfDisposed(); + CvSlice[] slices = new CvSlice[ranges.Length]; + for (int i = 0; i < ranges.Length; i++) + { + slices[i] = ranges[i]; + } + + IntPtr retPtr = NativeMethods.core_Mat_subMat1(ptr, ranges.Length, ranges); + Mat retVal = new Mat(retPtr); + return retVal;*/ + } + + #endregion + + #region GetArray + + private void CheckArgumentsForConvert(int row, int col, Array data, + params MatType[] acceptableTypes) + { + ThrowIfDisposed(); + if (row < 0 || row >= Rows) + throw new ArgumentOutOfRangeException("row"); + if (col < 0 || col >= Cols) + throw new ArgumentOutOfRangeException("col"); + if (data == null) + throw new ArgumentNullException("data"); + + MatType t = Type(); + if (data == null || data.Length%t.Channels != 0) + throw new OpenCvSharpException( + "Provided data element number ({0}) should be multiple of the Mat channels count ({1})", + data.Length, t.Channels); + + if (acceptableTypes != null && acceptableTypes.Length > 0) + { + bool isValidDepth = EnumerableEx.Any(acceptableTypes, delegate(MatType type) + { + return type == t; + }); + if (!isValidDepth) + throw new OpenCvSharpException("Mat data type is not compatible: " + t); + } + } + + private void CheckArgumentsForConvert(int row, int col, Array data, int dataDimension, + params MatType[] acceptableTypes) + { + ThrowIfDisposed(); + if (row < 0 || row >= Rows) + throw new ArgumentOutOfRangeException("row"); + if (col < 0 || col >= Cols) + throw new ArgumentOutOfRangeException("col"); + if (data == null) + throw new ArgumentNullException("data"); + + MatType t = Type(); + if (data == null || (data.Length*dataDimension)%t.Channels != 0) + throw new OpenCvSharpException( + "Provided data element number ({0}) should be multiple of the Mat channels count ({1})", + data.Length, t.Channels); + + if (acceptableTypes != null && acceptableTypes.Length > 0) + { + bool isValidDepth = EnumerableEx.Any(acceptableTypes, delegate(MatType type) + { + return type == t; + }); + if (!isValidDepth) + throw new OpenCvSharpException("Mat data type is not compatible: " + t); + } + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, byte[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_8S, MatType.CV_8U); + NativeMethods.core_Mat_nGetB(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, byte[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_8S, MatType.CV_8U); + NativeMethods.core_Mat_nGetB(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, short[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_16S, MatType.CV_16U); + NativeMethods.core_Mat_nGetS(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, short[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_16S, MatType.CV_16U); + NativeMethods.core_Mat_nGetS(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, ushort[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_16S, MatType.CV_16U); + NativeMethods.core_Mat_nGetS(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, ushort[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_16S, MatType.CV_16U); + NativeMethods.core_Mat_nGetS(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, int[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32S); + NativeMethods.core_Mat_nGetI(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, int[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32S); + NativeMethods.core_Mat_nGetI(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, float[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32F); + NativeMethods.core_Mat_nGetF(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, float[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32F); + NativeMethods.core_Mat_nGetF(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, double[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_64F); + NativeMethods.core_Mat_nGetD(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, double[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_64F); + NativeMethods.core_Mat_nGetD(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public double[] GetArray(int row, int col) + { + ThrowIfDisposed(); + if (row < 0 || row >= Rows) + throw new ArgumentOutOfRangeException("row"); + if (col < 0 || col >= Cols) + throw new ArgumentOutOfRangeException("col"); + + double[] ret = new double[Channels()]; + NativeMethods.core_Mat_nGetD(ptr, row, col, ret, ret.Length); + return ret; + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Vec3b[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_8UC3); + NativeMethods.core_Mat_nGetVec3b(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Vec3b[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_8UC3); + NativeMethods.core_Mat_nGetVec3b(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Vec3d[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_64FC3); + NativeMethods.core_Mat_nGetVec3d(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Vec3d[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_64FC3); + NativeMethods.core_Mat_nGetVec3d(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Vec4f[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32FC4); + NativeMethods.core_Mat_nGetVec4f(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Vec4f[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32FC4); + NativeMethods.core_Mat_nGetVec4f(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Vec6f[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32FC(6)); + NativeMethods.core_Mat_nGetVec6f(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Vec6f[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32FC(6)); + NativeMethods.core_Mat_nGetVec6f(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Vec4i[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32SC4); + NativeMethods.core_Mat_nGetVec4i(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Vec4i[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32SC4); + NativeMethods.core_Mat_nGetVec4i(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Point[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32SC2); + NativeMethods.core_Mat_nGetPoint(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Point[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32SC2); + NativeMethods.core_Mat_nGetPoint(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Point2f[] data) + { + CheckArgumentsForConvert(row, col, data, 2, MatType.CV_32FC2); + NativeMethods.core_Mat_nGetPoint2f(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Point2f[,] data) + { + CheckArgumentsForConvert(row, col, data, 2, MatType.CV_32FC2); + NativeMethods.core_Mat_nGetPoint2f(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Point2d[] data) + { + CheckArgumentsForConvert(row, col, data,2, MatType.CV_64FC2); + NativeMethods.core_Mat_nGetPoint2d(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Point2d[,] data) + { + CheckArgumentsForConvert(row, col, data, 2, MatType.CV_64FC2); + NativeMethods.core_Mat_nGetPoint2d(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Point3i[] data) + { + CheckArgumentsForConvert(row, col, data, 3, MatType.CV_32SC3); + NativeMethods.core_Mat_nGetPoint3i(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Point3i[,] data) + { + CheckArgumentsForConvert(row, col, data, 3, MatType.CV_32SC3); + NativeMethods.core_Mat_nGetPoint3i(ptr, row, col, data, data.Length); + } + + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Point3f[] data) + { + CheckArgumentsForConvert(row, col, data, 3, MatType.CV_32FC3); + NativeMethods.core_Mat_nGetPoint3f(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Point3f[,] data) + { + CheckArgumentsForConvert(row, col, data, 3, MatType.CV_32FC3); + NativeMethods.core_Mat_nGetPoint3f(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Point3d[] data) + { + CheckArgumentsForConvert(row, col, data, 3, MatType.CV_64FC3); + NativeMethods.core_Mat_nGetPoint3d(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Point3d[,] data) + { + CheckArgumentsForConvert(row, col, data, 3, MatType.CV_64FC3); + NativeMethods.core_Mat_nGetPoint3d(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Rect[] data) + { + CheckArgumentsForConvert(row, col, data, 4, MatType.CV_32SC4); + NativeMethods.core_Mat_nGetRect(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, Rect[,] data) + { + CheckArgumentsForConvert(row, col, data, 4, MatType.CV_32SC4); + NativeMethods.core_Mat_nGetRect(ptr, row, col, data, data.Length); + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, DMatch[] data) + { + CheckArgumentsForConvert(row, col, data); + Vec4f[] dataV = new Vec4f[data.Length]; + NativeMethods.core_Mat_nGetVec4f(ptr, row, col, dataV, dataV.Length); + for (int i = 0; i < data.Length; i++) + { + data[i] = (DMatch) dataV[i]; + } + } + + /// + /// Get the data of this matrix as array + /// + /// + /// + /// + public void GetArray(int row, int col, DMatch[,] data) + { + CheckArgumentsForConvert(row, col, data); + int dim0 = data.GetLength(0); + int dim1 = data.GetLength(1); + Vec4f[,] dataV = new Vec4f[dim0, dim1]; + NativeMethods.core_Mat_nGetVec4f(ptr, row, col, dataV, dataV.Length); + for (int i = 0; i < dim0; i++) + { + for (int j = 0; j < dim1; j++) + { + data[i, j] = (DMatch) dataV[i, j]; + } + } + } + + #endregion + + #region SetArray + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, params byte[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_8U); + NativeMethods.core_Mat_nSetB(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, byte[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_8U); + NativeMethods.core_Mat_nSetB(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, params short[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_16S, MatType.CV_16U); + NativeMethods.core_Mat_nSetS(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, short[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_16S, MatType.CV_16U); + NativeMethods.core_Mat_nSetS(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, params ushort[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_16S, MatType.CV_16U); + NativeMethods.core_Mat_nSetS(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, ushort[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_16S, MatType.CV_16U); + NativeMethods.core_Mat_nSetS(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, params int[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32S); + NativeMethods.core_Mat_nSetI(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, int[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32S); + NativeMethods.core_Mat_nSetI(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, params float[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32F); + NativeMethods.core_Mat_nSetF(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, float[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32F); + NativeMethods.core_Mat_nSetF(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, params double[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_64F); + NativeMethods.core_Mat_nSetD(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, double[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_64F); + NativeMethods.core_Mat_nSetD(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, params Vec3b[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_8UC3); + NativeMethods.core_Mat_nSetVec3b(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, Vec3b[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_8UC3); + NativeMethods.core_Mat_nSetVec3b(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, params Vec3d[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_64FC3); + NativeMethods.core_Mat_nSetVec3d(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, Vec3d[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_64FC3); + NativeMethods.core_Mat_nSetVec3d(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, params Vec4f[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32FC4); + NativeMethods.core_Mat_nSetVec4f(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, Vec4f[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32FC4); + NativeMethods.core_Mat_nSetVec4f(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, params Vec6f[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32FC(6)); + NativeMethods.core_Mat_nSetVec6f(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, Vec6f[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32FC(6)); + NativeMethods.core_Mat_nSetVec6f(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, params Vec4i[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32SC4); + NativeMethods.core_Mat_nSetVec4i(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, Vec4i[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32SC4); + NativeMethods.core_Mat_nSetVec4i(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, params Point[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32SC2); + NativeMethods.core_Mat_nSetPoint(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, Point[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32SC2); + NativeMethods.core_Mat_nSetPoint(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, params Point2f[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32FC2); + NativeMethods.core_Mat_nSetPoint2f(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, Point2f[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32FC2); + NativeMethods.core_Mat_nSetPoint2f(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, params Point2d[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_64FC2); + NativeMethods.core_Mat_nSetPoint2d(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, Point2d[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_64FC2); + NativeMethods.core_Mat_nSetPoint2d(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, params Point3i[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32SC3); + NativeMethods.core_Mat_nSetPoint3i(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, Point3i[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32SC3); + NativeMethods.core_Mat_nSetPoint3i(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, params Point3f[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32FC3); + NativeMethods.core_Mat_nSetPoint3f(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, Point3f[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32FC3); + NativeMethods.core_Mat_nSetPoint3f(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, params Point3d[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_64FC3); + NativeMethods.core_Mat_nSetPoint3d(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, Point3d[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_64FC3); + NativeMethods.core_Mat_nSetPoint3d(ptr, row, col, data, data.Length); + } + + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, params Rect[] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32SC4); + NativeMethods.core_Mat_nSetRect(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, Rect[,] data) + { + CheckArgumentsForConvert(row, col, data, MatType.CV_32SC4); + NativeMethods.core_Mat_nSetRect(ptr, row, col, data, data.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, params DMatch[] data) + { + CheckArgumentsForConvert(row, col, data); + Vec4f[] dataV = EnumerableEx.SelectToArray(data, delegate(DMatch d) + { + return (Vec4f) d; + }); + NativeMethods.core_Mat_nSetVec4f(ptr, row, col, dataV, dataV.Length); + } + + /// + /// Set the specified array data to this matrix + /// + /// + /// + /// + public void SetArray(int row, int col, DMatch[,] data) + { + CheckArgumentsForConvert(row, col, data); + Vec4f[] dataV = EnumerableEx.SelectToArray(data, delegate(DMatch d) + { + return (Vec4f) d; + }); + NativeMethods.core_Mat_nSetVec4f(ptr, row, col, dataV, dataV.Length); + } + + #endregion + + #region Reserve + + /// + /// reserves enough space to fit sz hyper-planes + /// + /// + public void Reserve(long sz) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_reserve(ptr, new IntPtr(sz)); + } + + #endregion + + #region Resize + + /// + /// resizes matrix to the specified number of hyper-planes + /// + /// + public void Resize(long sz) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_resize1(ptr, new IntPtr(sz)); + } + + /// + /// resizes matrix to the specified number of hyper-planes; initializes the newly added elements + /// + /// + /// + public void Resize(long sz, Scalar s) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_resize2(ptr, new IntPtr(sz), s); + } + + #endregion + + #region PushBack + + /// + /// Adds elements to the bottom of the matrix. (Mat.push_back) + /// + /// Added line(s) + public void Add(Mat m) + { + ThrowIfDisposed(); + if (m == null) + throw new ArgumentNullException(); + m.ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_Mat(ptr, m.CvPtr); + } + + /// + /// Adds elements to the bottom of the matrix. (Mat.push_back) + /// + /// Added line(s) + public void PushBack(Mat m) + { + Add(m); + } + + #endregion + + #region PopBack + + /// + /// removes several hyper-planes from bottom of the matrix (Mat.pop_back) + /// + /// + public void PopBack(long nElems = 1) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_pop_back(ptr, new IntPtr(nElems)); + } + + #endregion + + #region To* + + /// + /// Encodes an image into a memory buffer. + /// + /// Encodes an image into a memory buffer. + /// Format-specific parameters. + /// + public byte[] ToBytes(string ext = ".png", int[] prms = null) + { + return ImEncode(ext, prms); + } + + /// + /// Encodes an image into a memory buffer. + /// + /// Encodes an image into a memory buffer. + /// Format-specific parameters. + /// + public byte[] ToBytes(string ext = ".png", params ImageEncodingParam[] prms) + { + return ImEncode(ext, prms); + } + + /// + /// Converts Mat to System.IO.MemoryStream + /// + /// + /// + /// + public MemoryStream ToMemoryStream(string ext = ".png", params ImageEncodingParam[] prms) + { + return new MemoryStream(ToBytes(ext, prms)); + } + + /// + /// Writes image data encoded from this Mat to System.IO.Stream + /// + /// + /// + /// + /// + public void WriteToStream(Stream stream, string ext = ".png", params ImageEncodingParam[] prms) + { + if (stream == null) + throw new ArgumentNullException("stream"); + byte[] imageBytes = ToBytes(ext, prms); + stream.Write(imageBytes, 0, imageBytes.Length); + } + + #endregion + + #region DrawMarker +#pragma warning disable 1591 + + public void DrawMarker( + int x, int y, Scalar color, + MarkerStyle style = MarkerStyle.Cross, + int size = 10, + LineTypes lineType = LineTypes.Link8, + int thickness = 1) + { + int r = size / 2; + + switch (style) + { + case MarkerStyle.CircleLine: + Circle(x, y, r, color, thickness, lineType); + break; + case MarkerStyle.CircleFilled: + Circle(x, y, r, color, -1, lineType); + break; + case MarkerStyle.Cross: + Line(x, y - r, x, y + r, color, thickness, lineType); + Line(x - r, y, x + r, y, color, thickness, lineType); + break; + case MarkerStyle.TiltedCross: + Line(x - r, y - r, x + r, y + r, color, thickness, lineType); + Line(x + r, y - r, x - r, y + r, color, thickness, lineType); + break; + case MarkerStyle.CircleAndCross: + Circle(x, y, r, color, thickness, lineType); + Line(x, y - r, x, y + r, color, thickness, lineType); + Line(x - r, y, x + r, y, color, thickness, lineType); + break; + case MarkerStyle.CircleAndTiltedCross: + Circle(x, y, r, color, thickness, lineType); + Line(x - r, y - r, x + r, y + r, color, thickness, lineType); + Line(x + r, y - r, x - r, y + r, color, thickness, lineType); + break; + case MarkerStyle.DiamondLine: + case MarkerStyle.DiamondFilled: + { + int r2 = (int)(size * Math.Sqrt(2) / 2.0); + Point[] pts = + { + new Point(x, y-r2), + new Point(x+r2, y), + new Point(x, y+r2), + new Point(x-r2, y) + }; + switch (style) + { + case MarkerStyle.DiamondLine: + Polylines(new [] { pts }, true, color, thickness, lineType); break; + case MarkerStyle.DiamondFilled: + FillConvexPoly(pts, color, lineType); break; + } + + } + break; + case MarkerStyle.SquareLine: + case MarkerStyle.SquareFilled: + { + Point[] pts = + { + new Point(x-r, y-r), + new Point(x+r, y-r), + new Point(x+r, y+r), + new Point(x-r, y+r) + }; + switch (style) + { + case MarkerStyle.SquareLine: + Polylines(new [] { pts }, true, color, thickness, lineType); break; + case MarkerStyle.SquareFilled: + FillConvexPoly(pts, color, lineType); break; + } + } + break; + default: + throw new NotImplementedException(); + } + } +#pragma warning restore 1591 + #endregion + + /// + /// + /// + /// + /// + public Mat Alignment(int n = 4) + { + int newCols = Cv2.AlignSize(Cols, n); + Mat pMat = new Mat(Rows, newCols, Type()); + Mat roiMat = new Mat(pMat, new Rect(0, 0, Cols, Rows)); + CopyTo(roiMat); + return roiMat; + } + + /// + /// Creates type-specific Mat instance from this. + /// + /// + /// + public TMat Cast() + where TMat : Mat, new() + { + var type = typeof (TMat); + var constructor = type.GetConstructor(new[] {typeof (Mat)}); + if (constructor == null) + throw new OpenCvSharpException("Failed to cast to {0}", type.Name); + return (TMat)constructor.Invoke(new object[] {this}); + } + + #region ForEach +// ReSharper disable InconsistentNaming + + /// + /// + /// + /// + public unsafe void ForEachAsByte(MatForeachFunctionByte operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_uchar(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsVec2b(MatForeachFunctionVec2b operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_Vec2b(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsVec3b(MatForeachFunctionVec3b operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_Vec3b(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsVec4b(MatForeachFunctionVec4b operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_Vec4b(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsVec6b(MatForeachFunctionVec6b operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_Vec6b(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsInt16(MatForeachFunctionInt16 operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_short(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsVec2s(MatForeachFunctionVec2s operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_Vec2s(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsVec3s(MatForeachFunctionVec3s operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_Vec3s(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsVec4s(MatForeachFunctionVec4s operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_Vec4s(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsVec6s(MatForeachFunctionVec6s operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_Vec6s(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsInt32(MatForeachFunctionInt32 operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_int(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsVec2i(MatForeachFunctionVec2i operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_Vec2i(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsVec3i(MatForeachFunctionVec3i operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_Vec3i(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsVec4i(MatForeachFunctionVec4i operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_Vec4i(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsVec6i(MatForeachFunctionVec6i operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_Vec6i(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsFloat(MatForeachFunctionFloat operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_float(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsVec2f(MatForeachFunctionVec2f operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_Vec2f(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsVec3f(MatForeachFunctionVec3f operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_Vec3f(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsVec4f(MatForeachFunctionVec4f operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_Vec4f(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsVec6f(MatForeachFunctionVec6f operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_Vec6f(ptr, operation); + + GC.KeepAlive(operation); + } + + + /// + /// + /// + /// + public unsafe void ForEachAsDouble(MatForeachFunctionDouble operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_double(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsVec2d(MatForeachFunctionVec2d operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_Vec2d(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsVec3d(MatForeachFunctionVec3d operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_Vec3d(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsVec4d(MatForeachFunctionVec4d operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_Vec4d(ptr, operation); + + GC.KeepAlive(operation); + } + + /// + /// + /// + /// + public unsafe void ForEachAsVec6d(MatForeachFunctionVec6d operation) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (operation == null) + throw new ArgumentNullException("operation"); + + NativeMethods.core_Mat_forEach_Vec6d(ptr, operation); + + GC.KeepAlive(operation); + } +// ReSharper restore InconsistentNaming + #endregion + + #endregion + } + +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatIndexer.cs b/src/OpenCvSharp/modules/core/Mat/MatIndexer.cs new file mode 100644 index 000000000..b2ec0da5a --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatIndexer.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// Abstract definition of Mat indexer + /// + /// + public abstract class MatIndexer where T : struct + { + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public abstract T this[int i0] { get; set; } + + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public abstract T this[int i0, int i1] { get; set; } + + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public abstract T this[int i0, int i1, int i2] { get; set; } + + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public abstract T this[params int[] idx] { get; set; } + + /// + /// Parent matrix object + /// + protected readonly Mat parent; + + /// + /// Step byte length for each dimension + /// + protected readonly long[] steps; + + /// + /// Constructor + /// + /// + internal MatIndexer(Mat parent) + { + this.parent = parent; + + int dims = parent.Dims(); + steps = new long[dims]; + for (int i = 0; i < dims; i++) + { + steps[i] = (long)parent.Step(i); + } + } + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatOfByte.cs b/src/OpenCvSharp/modules/core/Mat/MatOfByte.cs new file mode 100644 index 000000000..0acb76722 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatOfByte.cs @@ -0,0 +1,700 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// A matrix whose element is 8UC1 (cv::Mat_<uchar>) + /// + public class MatOfByte : Mat + { + private static readonly MatType ThisType = MatType.CV_8UC1; + private const int ThisDepth = MatType.CV_8U; + private const int ThisChannels = 1; + + #region Init + +#if LANG_JP + /// + /// Creates empty Mat + /// +#else + /// + /// Creates empty Mat + /// +#endif + public MatOfByte() + : base() + { + } + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + public MatOfByte(IntPtr ptr) + : base(ptr) + { + } + +#if LANG_JP + /// + /// Matオブジェクトから初期化 + /// + /// Matオブジェクト +#else + /// + /// Initializes by Mat object + /// + /// Managed Mat object +#endif + public MatOfByte(Mat mat) + : base(mat) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. +#endif + public MatOfByte(int rows, int cols) + : base(rows, cols, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . + /// Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. +#endif + public MatOfByte(Size size) + : base(size, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfByte(int rows, int cols, byte s) + : base(rows, cols, ThisType, s) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfByte(Size size, byte s) + : base(size, ThisType, s) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public MatOfByte(MatOfByte m, Range rowRange, Range? colRange = null) + : base(m, rowRange, colRange) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + public MatOfByte(MatOfByte m, params Range[] ranges) + : base(m, ranges) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + public MatOfByte(MatOfByte m, Rect roi) + : base(m, roi) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfByte(int rows, int cols, IntPtr data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfByte(int rows, int cols, byte[] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfByte(int rows, int cols, byte[,] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// Array of integers specifying an n-dimensional array shape. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfByte(IEnumerable sizes, IntPtr data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfByte(IEnumerable sizes, byte[] data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfByte(IEnumerable sizes, Array data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. +#endif + public MatOfByte(IEnumerable sizes) + : base(sizes, ThisType) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfByte(IEnumerable sizes, byte s) + : base(sizes, ThisType, s) + { + } + + #endregion + + #region Indexer + /// + /// Matrix indexer + /// + public sealed unsafe class Indexer : MatIndexer + { + private readonly byte *ptr; + + internal Indexer(Mat parent) + : base(parent) + { + this.ptr = (byte*)parent.Data.ToPointer(); + } + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public override byte this[int i0] + { + get + { + return *(ptr + (steps[0] * i0)); + } + set + { + *(ptr + (steps[0] * i0)) = value; + } + } + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override byte this[int i0, int i1] + { + get + { + return *(ptr + (steps[0] * i0) + (steps[1] * i1)); + } + set + { + *(ptr + (steps[0] * i0) + (steps[1] * i1)) = value; + } + } + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public override byte this[int i0, int i1, int i2] + { + get + { + return *(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)); + } + set + { + *(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)) = value; + } + } + + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public override byte this[params int[] idx] + { + get + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + return *(ptr + offset); + } + set + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + *(ptr + offset) = value; + } + } + } + + /// + /// Gets a type-specific indexer. The indexer has getters/setters to access each matrix element. + /// + /// + public override MatIndexer GetIndexer() + { + return new Indexer(this); + } + #endregion + + #region FromArray +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfByte FromArray(params byte[] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int numElems = arr.Length / ThisChannels; + var mat = new MatOfByte(numElems, 1); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// M x N の行列として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as M x N matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfByte FromArray(byte[,] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int rows = arr.GetLength(0); + int cols = arr.GetLength(1); + var mat = new MatOfByte(rows, cols); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfByte FromArray(IEnumerable enumerable) + { + return FromArray(EnumerableEx.ToArray(enumerable)); + } + #endregion + + #region ToArray + /// + /// Convert this mat to managed array + /// + /// + public override byte[] ToArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new byte[0]; + byte[] arr = new byte[numOfElems]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed rectangular array + /// + /// + public override byte[,] ToRectangularArray() + { + if (Rows == 0 || Cols == 0) + return new byte[0, 0]; + byte[,] arr = new byte[Rows, Cols]; + GetArray(0, 0, arr); + return arr; + } + #endregion + + #region GetEnumerator + /// + /// + /// + /// + public override IEnumerator GetEnumerator() + { + ThrowIfDisposed(); + Indexer indexer = new Indexer(this); + + int dims = Dims(); + if (dims == 2) + { + int rows = Rows; + int cols = Cols; + for (int r = 0; r < rows; r++) + { + for (int c = 0; c < cols; c++) + { + yield return indexer[r, c]; + } + } + } + else + { + throw new NotImplementedException("GetEnumerator supports only 2-dimensional Mat"); + } + } + #endregion + + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public override void Add(byte value) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_uchar(ptr, value); + } + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public void Add(sbyte value) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_char(ptr, value); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatOfByte3.cs b/src/OpenCvSharp/modules/core/Mat/MatOfByte3.cs new file mode 100644 index 000000000..0d98d3e09 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatOfByte3.cs @@ -0,0 +1,705 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// A matrix whose element is 8UC3 (cv::Mat_<cv::Vec3b>) + /// + public class MatOfByte3 : Mat + { + private static readonly MatType ThisType = MatType.CV_8UC3; + private const int ThisDepth = MatType.CV_8U; + private const int ThisChannels = 3; + + #region Init + +#if LANG_JP + /// + /// Creates empty Mat + /// +#else + /// + /// Creates empty Mat + /// +#endif + public MatOfByte3() + : base() + { + } + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + public MatOfByte3(IntPtr ptr) + : base(ptr) + { + } + +#if LANG_JP + /// + /// Matオブジェクトから初期化 + /// + /// Matオブジェクト +#else + /// + /// Initializes by Mat object + /// + /// Managed Mat object +#endif + public MatOfByte3(Mat mat) + : base(mat) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. +#endif + public MatOfByte3(int rows, int cols) + : base(rows, cols, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . + /// Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. +#endif + public MatOfByte3(Size size) + : base(size, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfByte3(int rows, int cols, Vec3b s) + : base(rows, cols, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfByte3(Size size, Vec3b s) + : base(size, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public MatOfByte3(MatOfByte3 m, Range rowRange, Range? colRange = null) + : base(m, rowRange, colRange) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + public MatOfByte3(MatOfByte3 m, params Range[] ranges) + : base(m, ranges) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + public MatOfByte3(MatOfByte3 m, Rect roi) + : base(m, roi) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfByte3(int rows, int cols, IntPtr data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfByte3(int rows, int cols, Vec3b[] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfByte3(int rows, int cols, Vec3b[,] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// Array of integers specifying an n-dimensional array shape. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfByte3(IEnumerable sizes, IntPtr data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfByte3(IEnumerable sizes, Vec3b[] data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfByte3(IEnumerable sizes, Array data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. +#endif + public MatOfByte3(IEnumerable sizes) + : base(sizes, ThisType) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfByte3(IEnumerable sizes, Vec3b s) + : base(sizes, ThisType, (Scalar)s) + { + } + + #endregion + + #region Indexer + /// + /// Matrix indexer + /// + public sealed unsafe class Indexer : MatIndexer + { + private readonly byte* ptr; + + internal Indexer(Mat parent) + : base(parent) + { + ptr = (byte*)parent.Data.ToPointer(); + } + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public override Vec3b this[int i0] + { + get + { + return *(Vec3b*)(ptr + (steps[0] * i0)); + } + set + { + *(Vec3b*)(ptr + (steps[0] * i0)) = value; + } + } + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override Vec3b this[int i0, int i1] + { + get + { + return *(Vec3b*)(ptr + (steps[0] * i0) + (steps[1] * i1)); + } + set + { + *(Vec3b*)(ptr + (steps[0] * i0) + (steps[1] * i1)) = value; + } + } + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public override Vec3b this[int i0, int i1, int i2] + { + get + { + return *(Vec3b*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)); + } + set + { + *(Vec3b*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)) = value; + } + } + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public override Vec3b this[params int[] idx] + { + get + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + return *(Vec3b*)(ptr + offset); + } + set + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + *(Vec3b*)(ptr + offset) = value; + } + } + } + /// + /// + /// + /// + public override MatIndexer GetIndexer() + { + return new Indexer(this); + } + #endregion + + #region FromArray +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfByte3 FromArray(params Vec3b[] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int numElems = arr.Length/* / ThisChannels*/; + var mat = new MatOfByte3(numElems, 1); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// M x N の行列として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as M x N matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfByte3 FromArray(Vec3b[,] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int rows = arr.GetLength(0); + int cols = arr.GetLength(1); + var mat = new MatOfByte3(rows, cols); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfByte3 FromArray(IEnumerable enumerable) + { + return FromArray(EnumerableEx.ToArray(enumerable)); + } + #endregion + + #region ToArray + /// + /// Convert this mat to managed array + /// + /// + public override Vec3b[] ToArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new Vec3b[0]; + Vec3b[] arr = new Vec3b[numOfElems]; + GetArray(0, 0, arr); + return arr; + } + /// + /// + /// + /// + public byte[] ToPrimitiveArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new byte[0]; + byte[] arr = new byte[numOfElems * ThisChannels]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed rectangular array + /// + /// + public override Vec3b[,] ToRectangularArray() + { + if (Rows == 0 || Cols == 0) + return new Vec3b[0, 0]; + Vec3b[,] arr = new Vec3b[Rows, Cols]; + GetArray(0, 0, arr); + return arr; + } + #endregion + + #region GetEnumerator + /// + /// + /// + /// + public override IEnumerator GetEnumerator() + { + ThrowIfDisposed(); + Indexer indexer = new Indexer(this); + + int dims = Dims(); + if (dims == 2) + { + int rows = Rows; + int cols = Cols; + for (int r = 0; r < rows; r++) + { + for (int c = 0; c < cols; c++) + { + yield return indexer[r, c]; + } + } + } + else + { + throw new NotImplementedException("GetEnumerator supports only 2-dimensional Mat"); + } + } + #endregion + + + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public override void Add(Vec3b value) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_Vec3b(ptr, value); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatOfDMatch.cs b/src/OpenCvSharp/modules/core/Mat/MatOfDMatch.cs new file mode 100644 index 000000000..0f46d5cb6 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatOfDMatch.cs @@ -0,0 +1,501 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// A matrix whose element is cv::DMatch (cv::Mat_<cv::Vec4f>) + /// + public class MatOfDMatch : Mat + { + private static readonly MatType ThisType = MatType.CV_32FC4; + private const int ThisDepth = MatType.CV_32F; // int x 3, float x 1 + private const int ThisChannels = 4; + + #region Init + +#if LANG_JP + /// + /// Creates empty Mat + /// +#else + /// + /// Creates empty Mat + /// +#endif + public MatOfDMatch() + : base() + { + } + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + public MatOfDMatch(IntPtr ptr) + : base(ptr) + { + } + +#if LANG_JP + /// + /// Matオブジェクトから初期化 + /// + /// Matオブジェクト +#else + /// + /// Initializes by Mat object + /// + /// Managed Mat object +#endif + public MatOfDMatch(Mat mat) + : base(mat) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. +#endif + public MatOfDMatch(int rows, int cols) + : base(rows, cols, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . + /// Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. +#endif + public MatOfDMatch(Size size) + : base(size, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfDMatch(int rows, int cols, DMatch s) + : base(rows, cols, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfDMatch(Size size, DMatch s) + : base(size, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public MatOfDMatch(MatOfDMatch m, Range rowRange, Range? colRange = null) + : base(m, rowRange, colRange) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + public MatOfDMatch(MatOfDMatch m, params Range[] ranges) + : base(m, ranges) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + public MatOfDMatch(MatOfDMatch m, Rect roi) + : base(m, roi) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. +#endif + public MatOfDMatch(IEnumerable sizes) + : base(sizes, ThisType) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfDMatch(IEnumerable sizes, DMatch s) + : base(sizes, ThisType, (Scalar)s) + { + } + #endregion + + #region Indexer + /// + /// Matrix indexer + /// + public sealed unsafe class Indexer : MatIndexer + { + private readonly byte* ptr; + + internal Indexer(Mat parent) + : base(parent) + { + this.ptr = (byte*)parent.Data.ToPointer(); + } + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public override DMatch this[int i0] + { + get + { + return (DMatch)(*(Vec4f*)(ptr + (steps[0] * i0))); + } + set + { + *(Vec4f*)(ptr + (steps[0] * i0)) = (Vec4f)value; + } + } + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override DMatch this[int i0, int i1] + { + get + { + return (DMatch)(*(Vec4f*)(ptr + (steps[0] * i0) + (steps[1] * i1))); + } + set + { + *(Vec4f*)(ptr + (steps[0] * i0) + (steps[1] * i1)) = (Vec4f)value; + } + } + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public override DMatch this[int i0, int i1, int i2] + { + get + { + return (DMatch)(*(Vec4f*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2))); + } + set + { + *(Vec4f*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)) = (Vec4f)value; + } + } + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public override DMatch this[params int[] idx] + { + get + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + return (DMatch)(*(Vec4f*)(ptr + offset)); + } + set + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + *(Vec4f*)(ptr + offset) = (Vec4f)value; + } + } + } + /// + /// Gets a type-specific indexer. The indexer has getters/setters to access each matrix element. + /// + /// + public override MatIndexer GetIndexer() + { + return new Indexer(this); + } + #endregion + + #region FromArray +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfDMatch FromArray(params DMatch[] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int numElems = arr.Length/* / ThisChannels*/; + var mat = new MatOfDMatch(numElems, 1); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// M x N の行列として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as M x N matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfDMatch FromArray(DMatch[,] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int rows = arr.GetLength(0); + int cols = arr.GetLength(1); + var mat = new MatOfDMatch(rows, cols); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfDMatch FromArray(IEnumerable enumerable) + { + return FromArray(EnumerableEx.ToArray(enumerable)); + } + #endregion + + #region ToArray + /// + /// Convert this mat to managed array + /// + /// + public override DMatch[] ToArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new DMatch[0]; + DMatch[] arr = new DMatch[numOfElems]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed rectangular array + /// + /// + public override DMatch[,] ToRectangularArray() + { + if (Rows == 0 || Cols == 0) + return new DMatch[0, 0]; + DMatch[,] arr = new DMatch[Rows, Cols]; + GetArray(0, 0, arr); + return arr; + } + #endregion + + #region GetEnumerator + /// + /// + /// + /// + public override IEnumerator GetEnumerator() + { + ThrowIfDisposed(); + Indexer indexer = new Indexer(this); + + int dims = Dims(); + if (dims == 2) + { + int rows = Rows; + int cols = Cols; + for (int r = 0; r < rows; r++) + { + for (int c = 0; c < cols; c++) + { + yield return indexer[r, c]; + } + } + } + else + { + throw new NotImplementedException("GetEnumerator supports only 2-dimensional Mat"); + } + } + #endregion + + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public override void Add(DMatch value) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_Vec4f(ptr, (Vec4f)value); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatOfDouble.cs b/src/OpenCvSharp/modules/core/Mat/MatOfDouble.cs new file mode 100644 index 000000000..bcd082e17 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatOfDouble.cs @@ -0,0 +1,689 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// A matrix whose element is 64FC1 (cv::Mat_<double>) + /// + public class MatOfDouble : Mat + { + private static readonly MatType ThisType = MatType.CV_64FC1; + private const int ThisDepth = MatType.CV_64F; + private const int ThisChannels = 1; + + #region Init + +#if LANG_JP + /// + /// Creates empty Mat + /// +#else + /// + /// Creates empty Mat + /// +#endif + public MatOfDouble() + : base() + { + } + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + public MatOfDouble(IntPtr ptr) + : base(ptr) + { + } + +#if LANG_JP + /// + /// Matオブジェクトから初期化 + /// + /// Matオブジェクト +#else + /// + /// Initializes by Mat object + /// + /// Managed Mat object +#endif + public MatOfDouble(Mat mat) + : base(mat) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. +#endif + public MatOfDouble(int rows, int cols) + : base(rows, cols, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . + /// Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. +#endif + public MatOfDouble(Size size) + : base(size, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfDouble(int rows, int cols, double s) + : base(rows, cols, ThisType, s) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfDouble(Size size, double s) + : base(size, ThisType, s) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public MatOfDouble(MatOfDouble m, Range rowRange, Range? colRange = null) + : base(m, rowRange, colRange) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + public MatOfDouble(MatOfDouble m, params Range[] ranges) + : base(m, ranges) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + public MatOfDouble(MatOfDouble m, Rect roi) + : base(m, roi) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfDouble(int rows, int cols, IntPtr data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfDouble(int rows, int cols, double[] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfDouble(int rows, int cols, double[,] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// Array of integers specifying an n-dimensional array shape. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfDouble(IEnumerable sizes, IntPtr data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfDouble(IEnumerable sizes, double[] data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfDouble(IEnumerable sizes, Array data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. +#endif + public MatOfDouble(IEnumerable sizes) + : base(sizes, ThisType) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfDouble(IEnumerable sizes, double s) + : base(sizes, ThisType, s) + { + } + + #endregion + + #region Indexer + /// + /// Matrix indexer + /// + public sealed unsafe class Indexer : MatIndexer + { + private readonly byte *ptr; + + internal Indexer(Mat parent) + : base(parent) + { + ptr = (byte*)parent.Data.ToPointer(); + } + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public override double this[int i0] + { + get + { + return *(double*)(ptr + (steps[0] * i0)); + } + set + { + *(double*)(ptr + (steps[0] * i0)) = value; + } + } + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override double this[int i0, int i1] + { + get + { + return *(double*)(ptr + (steps[0] * i0) + (steps[1] * i1)); + } + set + { + *(double*)(ptr + (steps[0] * i0) + (steps[1] * i1)) = value; + } + } + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public override double this[int i0, int i1, int i2] + { + get + { + return *(double*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)); + } + set + { + *(double*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)) = value; + } + } + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public override double this[params int[] idx] + { + get + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + return *(double*)(ptr + offset); + } + set + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + *(double*)(ptr + offset) = value; + } + } + } + /// + /// Gets a type-specific indexer. The indexer has getters/setters to access each matrix element. + /// + /// + public override MatIndexer GetIndexer() + { + return new Indexer(this); + } + #endregion + + #region FromArray +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfDouble FromArray(params double[] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int numElems = arr.Length / ThisChannels; + var mat = new MatOfDouble(numElems, 1); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// M x N の行列として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as M x N matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfDouble FromArray(double[,] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int rows = arr.GetLength(0); + int cols = arr.GetLength(1); + var mat = new MatOfDouble(rows, cols); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfDouble FromArray(IEnumerable enumerable) + { + return FromArray(EnumerableEx.ToArray(enumerable)); + } + #endregion + + #region ToArray + /// + /// Convert this mat to managed array + /// + /// + public override double[] ToArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new double[0]; + double[] arr = new double[numOfElems]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed rectangular array + /// + /// + public override double[,] ToRectangularArray() + { + if (Rows == 0 || Cols == 0) + return new double[0, 0]; + double[,] arr = new double[Rows, Cols]; + GetArray(0, 0, arr); + return arr; + } + #endregion + + #region GetEnumerator + /// + /// + /// + /// + public override IEnumerator GetEnumerator() + { + ThrowIfDisposed(); + Indexer indexer = new Indexer(this); + + int dims = Dims(); + if (dims == 2) + { + int rows = Rows; + int cols = Cols; + for (int r = 0; r < rows; r++) + { + for (int c = 0; c < cols; c++) + { + yield return indexer[r, c]; + } + } + } + else + { + throw new NotImplementedException("GetEnumerator supports only 2-dimensional Mat"); + } + } + #endregion + + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public override void Add(double value) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_double(ptr, value); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatOfDouble3.cs b/src/OpenCvSharp/modules/core/Mat/MatOfDouble3.cs new file mode 100644 index 000000000..0caab41f2 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatOfDouble3.cs @@ -0,0 +1,702 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// A matrix whose element is cv::Vec3d [CV_64FC3] (cv::Mat_<cv::Vec3d>) + /// + public class MatOfDouble3 : Mat + { + private static readonly MatType ThisType = MatType.CV_64FC3; + private const int ThisDepth = MatType.CV_64F; + private const int ThisChannels = 3; + + #region Init + +#if LANG_JP + /// + /// Creates empty Mat + /// +#else + /// + /// Creates empty Mat + /// +#endif + public MatOfDouble3() + : base() + { + } + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + public MatOfDouble3(IntPtr ptr) + : base(ptr) + { + } + +#if LANG_JP + /// + /// Matオブジェクトから初期化 + /// + /// Matオブジェクト +#else + /// + /// Initializes by Mat object + /// + /// Managed Mat object +#endif + public MatOfDouble3(Mat mat) + : base(mat) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. +#endif + public MatOfDouble3(int rows, int cols) + : base(rows, cols, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . + /// Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. +#endif + public MatOfDouble3(Size size) + : base(size, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfDouble3(int rows, int cols, Vec3d s) + : base(rows, cols, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfDouble3(Size size, Vec3d s) + : base(size, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public MatOfDouble3(MatOfDouble3 m, Range rowRange, Range? colRange = null) + : base(m, rowRange, colRange) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + public MatOfDouble3(MatOfDouble3 m, params Range[] ranges) + : base(m, ranges) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + public MatOfDouble3(MatOfDouble3 m, Rect roi) + : base(m, roi) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfDouble3(int rows, int cols, IntPtr data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfDouble3(int rows, int cols, Vec3d[] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfDouble3(int rows, int cols, Vec3d[,] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// Array of integers specifying an n-dimensional array shape. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfDouble3(IEnumerable sizes, IntPtr data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfDouble3(IEnumerable sizes, Vec3d[] data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfDouble3(IEnumerable sizes, Array data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. +#endif + public MatOfDouble3(IEnumerable sizes) + : base(sizes, ThisType) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfDouble3(IEnumerable sizes, Vec3d s) + : base(sizes, ThisType, (Scalar)s) + { + } + + #endregion + + #region Indexer + /// + /// Matrix indexer + /// + public sealed unsafe class Indexer : MatIndexer + { + private readonly byte* ptr; + + internal Indexer(Mat parent) + : base(parent) + { + this.ptr = (byte*)parent.Data.ToPointer(); + } + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public override Vec3d this[int i0] + { + get + { + return *(Vec3d*)(ptr + (steps[0] * i0)); + } + set + { + *(Vec3d*)(ptr + (steps[0] * i0)) = value; + } + } + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override Vec3d this[int i0, int i1] + { + get + { + return *(Vec3d*)(ptr + (steps[0] * i0) + (steps[1] * i1)); + } + set + { + *(Vec3d*)(ptr + (steps[0] * i0) + (steps[1] * i1)) = value; + } + } + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public override Vec3d this[int i0, int i1, int i2] + { + get + { + return *(Vec3d*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)); + } + set + { + *(Vec3d*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)) = value; + } + } + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public override Vec3d this[params int[] idx] + { + get + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + return *(Vec3d*)(ptr + offset); + } + set + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + *(Vec3d*)(ptr + offset) = value; + } + } + } + /// + /// Gets a type-specific indexer. The indexer has getters/setters to access each matrix element. + /// + /// + public override MatIndexer GetIndexer() + { + return new Indexer(this); + } + #endregion + + #region FromArray +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfDouble3 FromArray(params Vec3d[] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int numElems = arr.Length/* / ThisChannels*/; + var mat = new MatOfDouble3(numElems, 1); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// M x N の行列として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as M x N matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfDouble3 FromArray(Vec3d[,] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int rows = arr.GetLength(0); + int cols = arr.GetLength(1); + var mat = new MatOfDouble3(rows, cols); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfDouble3 FromArray(IEnumerable enumerable) + { + return FromArray(EnumerableEx.ToArray(enumerable)); + } + #endregion + + #region ToArray + /// + /// Convert this mat to managed array + /// + /// + public override Vec3d[] ToArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new Vec3d[0]; + Vec3d[] arr = new Vec3d[numOfElems]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed array + /// + /// + public double[] ToPrimitiveArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new double[0]; + double[] arr = new double[numOfElems * ThisChannels]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed rectangular array + /// + /// + public override Vec3d[,] ToRectangularArray() + { + if (Rows == 0 || Cols == 0) + return new Vec3d[0, 0]; + Vec3d[,] arr = new Vec3d[Rows, Cols]; + GetArray(0, 0, arr); + return arr; + } + #endregion + + #region GetEnumerator + /// + /// + /// + /// + public override IEnumerator GetEnumerator() + { + ThrowIfDisposed(); + Indexer indexer = new Indexer(this); + + int dims = Dims(); + if (dims == 2) + { + int rows = Rows; + int cols = Cols; + for (int r = 0; r < rows; r++) + { + for (int c = 0; c < cols; c++) + { + yield return indexer[r, c]; + } + } + } + else + { + throw new NotImplementedException("GetEnumerator supports only 2-dimensional Mat"); + } + } + #endregion + + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public override void Add(Vec3d value) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_Vec3d(ptr, value); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatOfFloat.cs b/src/OpenCvSharp/modules/core/Mat/MatOfFloat.cs new file mode 100644 index 000000000..6d5ffed02 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatOfFloat.cs @@ -0,0 +1,689 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// A matrix whose element is 32FC1 (cv::Mat_<float>) + /// + public class MatOfFloat : Mat + { + private static readonly MatType ThisType = MatType.CV_32FC1; + private const int ThisDepth = MatType.CV_32F; + private const int ThisChannels = 1; + + #region Init + +#if LANG_JP + /// + /// Creates empty Mat + /// +#else + /// + /// Creates empty Mat + /// +#endif + public MatOfFloat() + : base() + { + } + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + public MatOfFloat(IntPtr ptr) + : base(ptr) + { + } + +#if LANG_JP + /// + /// Matオブジェクトから初期化 + /// + /// Matオブジェクト +#else + /// + /// Initializes by Mat object + /// + /// Managed Mat object +#endif + public MatOfFloat(Mat mat) + : base(mat) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. +#endif + public MatOfFloat(int rows, int cols) + : base(rows, cols, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . + /// Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. +#endif + public MatOfFloat(Size size) + : base(size, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfFloat(int rows, int cols, float s) + : base(rows, cols, ThisType, s) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfFloat(Size size, float s) + : base(size, ThisType, s) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public MatOfFloat(MatOfFloat m, Range rowRange, Range? colRange = null) + : base(m, rowRange, colRange) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + public MatOfFloat(MatOfFloat m, params Range[] ranges) + : base(m, ranges) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + public MatOfFloat(MatOfFloat m, Rect roi) + : base(m, roi) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfFloat(int rows, int cols, IntPtr data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfFloat(int rows, int cols, float[] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfFloat(int rows, int cols, float[,] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// Array of integers specifying an n-dimensional array shape. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfFloat(IEnumerable sizes, IntPtr data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfFloat(IEnumerable sizes, float[] data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfFloat(IEnumerable sizes, Array data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. +#endif + public MatOfFloat(IEnumerable sizes) + : base(sizes, ThisType) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfFloat(IEnumerable sizes, float s) + : base(sizes, ThisType, s) + { + } + + #endregion + + #region Indexer + /// + /// Matrix indexer + /// + public sealed unsafe class Indexer : MatIndexer + { + private readonly byte *ptr; + + internal Indexer(Mat parent) + : base(parent) + { + this.ptr = (byte*)parent.Data.ToPointer(); + } + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public override float this[int i0] + { + get + { + return *(float*)(ptr + (steps[0] * i0)); + } + set + { + *(float*)(ptr + (steps[0] * i0)) = value; + } + } + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override float this[int i0, int i1] + { + get + { + return *(float*)(ptr + (steps[0] * i0) + (steps[1] * i1)); + } + set + { + *(float*)(ptr + (steps[0] * i0) + (steps[1] * i1)) = value; + } + } + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public override float this[int i0, int i1, int i2] + { + get + { + return *(float*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)); + } + set + { + *(float*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)) = value; + } + } + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public override float this[params int[] idx] + { + get + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + return *(float*)(ptr + offset); + } + set + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + *(float*)(ptr + offset) = value; + } + } + } + /// + /// Gets a type-specific indexer. The indexer has getters/setters to access each matrix element. + /// + /// + public override MatIndexer GetIndexer() + { + return new Indexer(this); + } + #endregion + + #region FromArray +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfFloat FromArray(params float[] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int numElems = arr.Length / ThisChannels; + var mat = new MatOfFloat(numElems, 1); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// M x N の行列として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as M x N matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfFloat FromArray(float[,] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int rows = arr.GetLength(0); + int cols = arr.GetLength(1); + var mat = new MatOfFloat(rows, cols); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfFloat FromArray(IEnumerable enumerable) + { + return FromArray(EnumerableEx.ToArray(enumerable)); + } + #endregion + + #region ToArray + /// + /// Convert this mat to managed array + /// + /// + public override float[] ToArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new float[0]; + float[] arr = new float[numOfElems]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed rectangular array + /// + /// + public override float[,] ToRectangularArray() + { + if (Rows == 0 || Cols == 0) + return new float[0, 0]; + float[,] arr = new float[Rows, Cols]; + GetArray(0, 0, arr); + return arr; + } + #endregion + + #region GetEnumerator + /// + /// + /// + /// + public override IEnumerator GetEnumerator() + { + ThrowIfDisposed(); + Indexer indexer = new Indexer(this); + + int dims = Dims(); + if (dims == 2) + { + int rows = Rows; + int cols = Cols; + for (int r = 0; r < rows; r++) + { + for (int c = 0; c < cols; c++) + { + yield return indexer[r, c]; + } + } + } + else + { + throw new NotImplementedException("GetEnumerator supports only 2-dimensional Mat"); + } + } + #endregion + + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public override void Add(float value) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_float(ptr, value); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatOfFloat4.cs b/src/OpenCvSharp/modules/core/Mat/MatOfFloat4.cs new file mode 100644 index 000000000..876e86103 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatOfFloat4.cs @@ -0,0 +1,708 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// A matrix whose element is 32FC4 (cv::Mat_<cv::Vec4f>) + /// + public class MatOfFloat4 : Mat + { + private static readonly MatType ThisType = MatType.CV_32FC4; + private const int ThisDepth = MatType.CV_32F; + private const int ThisChannels = 4; + + #region Init + +#if LANG_JP + /// + /// Creates empty Mat + /// +#else + /// + /// Creates empty Mat + /// +#endif + public MatOfFloat4() + : base() + { + } + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + public MatOfFloat4(IntPtr ptr) + : base(ptr) + { + } + +#if LANG_JP + /// + /// Matオブジェクトから初期化 + /// + /// Matオブジェクト +#else + /// + /// Initializes by Mat object + /// + /// Managed Mat object +#endif + public MatOfFloat4(Mat mat) + : base(mat) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. +#endif + public MatOfFloat4(int rows, int cols) + : base(rows, cols, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . + /// Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. +#endif + public MatOfFloat4(Size size) + : base(size, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfFloat4(int rows, int cols, Vec4f s) + : base(rows, cols, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfFloat4(Size size, Vec4f s) + : base(size, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public MatOfFloat4(MatOfFloat4 m, Range rowRange, Range? colRange = null) + : base(m, rowRange, colRange) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + public MatOfFloat4(MatOfFloat4 m, params Range[] ranges) + : base(m, ranges) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + public MatOfFloat4(MatOfFloat4 m, Rect roi) + : base(m, roi) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfFloat4(int rows, int cols, IntPtr data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfFloat4(int rows, int cols, Vec4f[] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfFloat4(int rows, int cols, Vec4f[,] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// Array of integers specifying an n-dimensional array shape. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfFloat4(IEnumerable sizes, IntPtr data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfFloat4(IEnumerable sizes, Vec4f[] data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfFloat4(IEnumerable sizes, Array data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. +#endif + public MatOfFloat4(IEnumerable sizes) + : base(sizes, ThisType) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfFloat4(IEnumerable sizes, Vec4f s) + : base(sizes, ThisType, (Scalar)s) + { + } + + #endregion + + #region Indexer + /// + /// Matrix indexer + /// + public sealed unsafe class Indexer : MatIndexer + { + private readonly byte* ptr; + + internal Indexer(Mat parent) + : base(parent) + { + ptr = (byte*)parent.Data.ToPointer(); + } + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public override Vec4f this[int i0] + { + get + { + return *(Vec4f*)(ptr + (steps[0] * i0)); + } + set + { + *(Vec4f*)(ptr + (steps[0] * i0)) = value; + } + } + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override Vec4f this[int i0, int i1] + { + get + { + return *(Vec4f*)(ptr + (steps[0] * i0) + (steps[1] * i1)); + } + set + { + *(Vec4f*)(ptr + (steps[0] * i0) + (steps[1] * i1)) = value; + } + } + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public override Vec4f this[int i0, int i1, int i2] + { + get + { + return *(Vec4f*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)); + } + set + { + *(Vec4f*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)) = value; + } + } + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public override Vec4f this[params int[] idx] + { + get + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + return *(Vec4f*)(ptr + offset); + } + set + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + *(Vec4f*)(ptr + offset) = value; + } + } + } + /// + /// Gets a type-specific indexer. The indexer has getters/setters to access each matrix element. + /// + /// + public override MatIndexer GetIndexer() + { + return new Indexer(this); + } + #endregion + + #region FromArray +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfFloat4 FromArray(params Vec4f[] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int numElems = arr.Length/* / ThisChannels*/; + var mat = new MatOfFloat4(numElems, 1); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// M x N の行列として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as M x N matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfFloat4 FromArray(Vec4f[,] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int rows = arr.GetLength(0); + int cols = arr.GetLength(1); + var mat = new MatOfFloat4(rows, cols); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfFloat4 FromArray(IEnumerable enumerable) + { + return FromArray(EnumerableEx.ToArray(enumerable)); + } + #endregion + + #region ToArray + /// + /// Convert this mat to managed array + /// + /// + public override Vec4f[] ToArray() + { + /*int num = CheckVector(ThisChannels, ThisDepth); + if (num < 0) + throw new OpenCvSharpException("Native Mat has unexpected type or size: " + ToString());*/ + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new Vec4f[0]; + Vec4f[] arr = new Vec4f[numOfElems]; + GetArray(0, 0, arr); + return arr; + } + /// + /// + /// + /// + public float[] ToPrimitiveArray() + { + /*int num = CheckVector(ThisChannels, ThisDepth); + if (num < 0) + throw new OpenCvSharpException("Native Mat has unexpected type or size: " + ToString());*/ + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new float[0]; + float[] arr = new float[numOfElems * ThisChannels]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed rectangular array + /// + /// + public override Vec4f[,] ToRectangularArray() + { + if (Rows == 0 || Cols == 0) + return new Vec4f[0, 0]; + Vec4f[,] arr = new Vec4f[Rows, Cols]; + GetArray(0, 0, arr); + return arr; + } + #endregion + + #region GetEnumerator + /// + /// + /// + /// + public override IEnumerator GetEnumerator() + { + ThrowIfDisposed(); + Indexer indexer = new Indexer(this); + + int dims = Dims(); + if (dims == 2) + { + int rows = Rows; + int cols = Cols; + for (int r = 0; r < rows; r++) + { + for (int c = 0; c < cols; c++) + { + yield return indexer[r, c]; + } + } + } + else + { + throw new NotImplementedException("GetEnumerator supports only 2-dimensional Mat"); + } + } + #endregion + + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public override void Add(Vec4f value) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_Vec4f(ptr, value); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatOfFloat6.cs b/src/OpenCvSharp/modules/core/Mat/MatOfFloat6.cs new file mode 100644 index 000000000..08c132760 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatOfFloat6.cs @@ -0,0 +1,704 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// A matrix whose element is 32FC6 (cv::Mat_<cv::Vec6f>) + /// + public class MatOfFloat6 : Mat + { + private static readonly MatType ThisType = MatType.CV_32FC(6); + private const int ThisDepth = MatType.CV_32F; + private const int ThisChannels = 6; + + #region Init + +#if LANG_JP + /// + /// Creates empty Mat + /// +#else + /// + /// Creates empty Mat + /// +#endif + public MatOfFloat6() + : base() + { + } + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + public MatOfFloat6(IntPtr ptr) + : base(ptr) + { + } + +#if LANG_JP + /// + /// Matオブジェクトから初期化 + /// + /// Matオブジェクト +#else + /// + /// Initializes by Mat object + /// + /// Managed Mat object +#endif + public MatOfFloat6(Mat mat) + : base(mat) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. +#endif + public MatOfFloat6(int rows, int cols) + : base(rows, cols, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . + /// Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. +#endif + public MatOfFloat6(Size size) + : base(size, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfFloat6(int rows, int cols, Vec6f s) + : base(rows, cols, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfFloat6(Size size, Vec6f s) + : base(size, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public MatOfFloat6(MatOfFloat6 m, Range rowRange, Range? colRange = null) + : base(m, rowRange, colRange) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + public MatOfFloat6(MatOfFloat6 m, params Range[] ranges) + : base(m, ranges) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + public MatOfFloat6(MatOfFloat6 m, Rect roi) + : base(m, roi) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfFloat6(int rows, int cols, IntPtr data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfFloat6(int rows, int cols, Vec6f[] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfFloat6(int rows, int cols, Vec6f[,] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// Array of integers specifying an n-dimensional array shape. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfFloat6(IEnumerable sizes, IntPtr data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfFloat6(IEnumerable sizes, Vec6f[] data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfFloat6(IEnumerable sizes, Array data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. +#endif + public MatOfFloat6(IEnumerable sizes) + : base(sizes, ThisType) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfFloat6(IEnumerable sizes, Vec6f s) + : base(sizes, ThisType, (Scalar)s) + { + } + + #endregion + + #region Indexer + /// + /// Matrix indexer + /// + public sealed unsafe class Indexer : MatIndexer + { + private readonly byte* ptr; + + internal Indexer(Mat parent) + : base(parent) + { + ptr = (byte*)parent.Data.ToPointer(); + } + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public override Vec6f this[int i0] + { + get + { + return *(Vec6f*)(ptr + (steps[0] * i0)); + } + set + { + *(Vec6f*)(ptr + (steps[0] * i0)) = value; + } + } + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override Vec6f this[int i0, int i1] + { + get + { + return *(Vec6f*)(ptr + (steps[0] * i0) + (steps[1] * i1)); + } + set + { + *(Vec6f*)(ptr + (steps[0] * i0) + (steps[1] * i1)) = value; + } + } + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public override Vec6f this[int i0, int i1, int i2] + { + get + { + return *(Vec6f*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)); + } + set + { + *(Vec6f*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)) = value; + } + } + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public override Vec6f this[params int[] idx] + { + get + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + return *(Vec6f*)(ptr + offset); + } + set + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + *(Vec6f*)(ptr + offset) = value; + } + } + } + /// + /// Gets a type-specific indexer. The indexer has getters/setters to access each matrix element. + /// + /// + public override MatIndexer GetIndexer() + { + return new Indexer(this); + } + #endregion + + #region FromArray +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfFloat6 FromArray(params Vec6f[] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int numElems = arr.Length/* / ThisChannels*/; + var mat = new MatOfFloat6(numElems, 1); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// M x N の行列として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as M x N matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfFloat6 FromArray(Vec6f[,] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int rows = arr.GetLength(0); + int cols = arr.GetLength(1); + var mat = new MatOfFloat6(rows, cols); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfFloat6 FromArray(IEnumerable enumerable) + { + return FromArray(EnumerableEx.ToArray(enumerable)); + } + #endregion + + #region ToArray + /// + /// Convert this mat to managed array + /// + /// + public override Vec6f[] ToArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new Vec6f[0]; + Vec6f[] arr = new Vec6f[numOfElems]; + GetArray(0, 0, arr); + return arr; + } + /// + /// + /// + /// + public float[] ToPrimitiveArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new float[0]; + float[] arr = new float[numOfElems * ThisChannels]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed rectangular array + /// + /// + public override Vec6f[,] ToRectangularArray() + { + if (Rows == 0 || Cols == 0) + return new Vec6f[0, 0]; + Vec6f[,] arr = new Vec6f[Rows, Cols]; + GetArray(0, 0, arr); + return arr; + } + #endregion + + #region GetEnumerator + /// + /// + /// + /// + public override IEnumerator GetEnumerator() + { + ThrowIfDisposed(); + Indexer indexer = new Indexer(this); + + int dims = Dims(); + if (dims == 2) + { + int rows = Rows; + int cols = Cols; + for (int r = 0; r < rows; r++) + { + for (int c = 0; c < cols; c++) + { + yield return indexer[r, c]; + } + } + } + else + { + throw new NotImplementedException("GetEnumerator supports only 2-dimensional Mat"); + } + } + #endregion + + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public override void Add(Vec6f value) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_Vec6f(ptr, value); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatOfInt.cs b/src/OpenCvSharp/modules/core/Mat/MatOfInt.cs new file mode 100644 index 000000000..bce0e739c --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatOfInt.cs @@ -0,0 +1,691 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// A matrix whose element is 32SC1 (cv::Mat_<int>) + /// + public class MatOfInt : Mat + { + private static readonly MatType ThisType = MatType.CV_32SC1; + private const int ThisDepth = MatType.CV_32S; + private const int ThisChannels = 1; + + #region Init + +#if LANG_JP + /// + /// Creates empty Mat + /// +#else + /// + /// Creates empty Mat + /// +#endif + public MatOfInt() + : base() + { + } + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + public MatOfInt(IntPtr ptr) + : base(ptr) + { + } + +#if LANG_JP + /// + /// Matオブジェクトから初期化 + /// + /// Matオブジェクト +#else + /// + /// Initializes by Mat object + /// + /// Managed Mat object +#endif + public MatOfInt(Mat mat) + : base(mat) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. +#endif + public MatOfInt(int rows, int cols) + : base(rows, cols, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . + /// Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. +#endif + public MatOfInt(Size size) + : base(size, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfInt(int rows, int cols, int s) + : base(rows, cols, ThisType, s) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfInt(Size size, int s) + : base(size, ThisType, s) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public MatOfInt(MatOfInt m, Range rowRange, Range? colRange = null) + : base(m, rowRange, colRange) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + public MatOfInt(MatOfInt m, params Range[] ranges) + : base(m, ranges) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + public MatOfInt(MatOfInt m, Rect roi) + : base(m, roi) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfInt(int rows, int cols, IntPtr data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfInt(int rows, int cols, int[] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfInt(int rows, int cols, int[,] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// Array of integers specifying an n-dimensional array shape. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfInt(IEnumerable sizes, IntPtr data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfInt(IEnumerable sizes, int[] data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfInt(IEnumerable sizes, Array data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. +#endif + public MatOfInt(IEnumerable sizes) + : base(sizes, ThisType) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfInt(IEnumerable sizes, int s) + : base(sizes, ThisType, s) + { + } + + #endregion + + #region Indexer + + /// + /// Matrix indexer + /// + public sealed unsafe class Indexer : MatIndexer + { + private readonly byte* ptr; + + internal Indexer(Mat parent) + : base(parent) + { + this.ptr = (byte*) parent.Data.ToPointer(); + } + + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public override int this[int i0] + { + get { return *(int*) (ptr + (steps[0]*i0)); } + set { *(int*) (ptr + (steps[0]*i0)) = value; } + } + + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override int this[int i0, int i1] + { + get { return *(int*) (ptr + (steps[0]*i0) + (steps[1]*i1)); } + set { *(int*) (ptr + (steps[0]*i0) + (steps[1]*i1)) = value; } + } + + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public override int this[int i0, int i1, int i2] + { + get { return *(int*) (ptr + (steps[0]*i0) + (steps[1]*i1) + (steps[2]*i2)); } + set { *(int*) (ptr + (steps[0]*i0) + (steps[1]*i1) + (steps[2]*i2)) = value; } + } + + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public override int this[params int[] idx] + { + get + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i]*idx[i]; + } + return *(int*) (ptr + offset); + } + set + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i]*idx[i]; + } + *(int*) (ptr + offset) = value; + } + } + } + + /// + /// Gets a type-specific indexer. The indexer has getters/setters to access each matrix element. + /// + /// + public override MatIndexer GetIndexer() + { + return new Indexer(this); + } + + #endregion + + #region FromArray + +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfInt FromArray(params int[] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int numElems = arr.Length/ThisChannels; + var mat = new MatOfInt(numElems, 1); + mat.SetArray(0, 0, arr); + return mat; + } + +#if LANG_JP + /// + /// M x N の行列として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as M x N matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfInt FromArray(int[,] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int rows = arr.GetLength(0); + int cols = arr.GetLength(1); + var mat = new MatOfInt(rows, cols); + mat.SetArray(0, 0, arr); + return mat; + } + +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfInt FromArray(IEnumerable enumerable) + { + return FromArray(EnumerableEx.ToArray(enumerable)); + } + + #endregion + + #region ToArray + + /// + /// Convert this mat to managed array + /// + /// + public override int[] ToArray() + { + long numOfElems = (long) Total(); + if (numOfElems == 0) + return new int[0]; + int[] arr = new int[numOfElems]; + GetArray(0, 0, arr); + return arr; + } + + /// + /// Convert this mat to managed rectangular array + /// + /// + public override int[,] ToRectangularArray() + { + if (Rows == 0 || Cols == 0) + return new int[0, 0]; + int[,] arr = new int[Rows, Cols]; + GetArray(0, 0, arr); + return arr; + } + + #endregion + + #region GetEnumerator + + /// + /// + /// + /// + public override IEnumerator GetEnumerator() + { + ThrowIfDisposed(); + Indexer indexer = new Indexer(this); + + int dims = Dims(); + if (dims == 2) + { + int rows = Rows; + int cols = Cols; + for (int r = 0; r < rows; r++) + { + for (int c = 0; c < cols; c++) + { + yield return indexer[r, c]; + } + } + } + else + { + throw new NotImplementedException("GetEnumerator supports only 2-dimensional Mat"); + } + } + + #endregion + + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public override void Add(int value) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_int(ptr, value); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatOfInt4.cs b/src/OpenCvSharp/modules/core/Mat/MatOfInt4.cs new file mode 100644 index 000000000..85d285c08 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatOfInt4.cs @@ -0,0 +1,690 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// A matrix whose element is 32SC1 (cv::Mat_<int>) + /// + public class MatOfInt4 : Mat + { + private static readonly MatType ThisType = MatType.CV_32SC4; + private const int ThisDepth = MatType.CV_32S; + private const int ThisChannels = 4; + + #region Init + +#if LANG_JP + /// + /// Creates empty Mat + /// +#else + /// + /// Creates empty Mat + /// +#endif + public MatOfInt4() + : base() + { + } + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + public MatOfInt4(IntPtr ptr) + : base(ptr) + { + } + +#if LANG_JP + /// + /// Matオブジェクトから初期化 + /// + /// Matオブジェクト +#else + /// + /// Initializes by Mat object + /// + /// Managed Mat object +#endif + public MatOfInt4(Mat mat) + : base(mat) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. +#endif + public MatOfInt4(int rows, int cols) + : base(rows, cols, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . + /// Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. +#endif + public MatOfInt4(Size size) + : base(size, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfInt4(int rows, int cols, int s) + : base(rows, cols, ThisType, s) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfInt4(Size size, int s) + : base(size, ThisType, s) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public MatOfInt4(MatOfInt4 m, Range rowRange, Range? colRange = null) + : base(m, rowRange, colRange) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + public MatOfInt4(MatOfInt4 m, params Range[] ranges) + : base(m, ranges) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + public MatOfInt4(MatOfInt4 m, Rect roi) + : base(m, roi) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfInt4(int rows, int cols, IntPtr data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfInt4(int rows, int cols, Vec4i[] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfInt4(int rows, int cols, Vec4i[,] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// Array of integers specifying an n-dimensional array shape. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfInt4(IEnumerable sizes, IntPtr data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfInt4(IEnumerable sizes, Vec4i[] data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfInt4(IEnumerable sizes, Array data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. +#endif + public MatOfInt4(IEnumerable sizes) + : base(sizes, ThisType) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfInt4(IEnumerable sizes, Vec4i s) + : base(sizes, ThisType, new Scalar(s.Item0, s.Item1, s.Item2, s.Item3)) + { + } + + #endregion + + #region Indexer + /// + /// Matrix indexer + /// + public sealed unsafe class Indexer : MatIndexer + { + private readonly byte *ptr; + + internal Indexer(Mat parent) + : base(parent) + { + this.ptr = (byte*)parent.Data.ToPointer(); + } + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public override Vec4i this[int i0] + { + get + { + return *(Vec4i*)(ptr + (steps[0] * i0)); + } + set + { + *(Vec4i*)(ptr + (steps[0] * i0)) = value; + } + } + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override Vec4i this[int i0, int i1] + { + get + { + return *(Vec4i*)(ptr + (steps[0] * i0) + (steps[1] * i1)); + } + set + { + *(Vec4i*)(ptr + (steps[0] * i0) + (steps[1] * i1)) = value; + } + } + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public override Vec4i this[int i0, int i1, int i2] + { + get + { + return *(Vec4i*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)); + } + set + { + *(Vec4i*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)) = value; + } + } + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public override Vec4i this[params int[] idx] + { + get + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + return *(Vec4i*)(ptr + offset); + } + set + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + *(Vec4i*)(ptr + offset) = value; + } + } + } + /// + /// Gets a type-specific indexer. The indexer has getters/setters to access each matrix element. + /// + /// + public override MatIndexer GetIndexer() + { + return new Indexer(this); + } + #endregion + + #region FromArray +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfInt4 FromArray(params Vec4i[] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int numElems = arr.Length/* / ThisChannels*/; + var mat = new MatOfInt4(numElems, 1); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// M x N の行列として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as M x N matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfInt4 FromArray(Vec4i[,] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int rows = arr.GetLength(0); + int cols = arr.GetLength(1); + var mat = new MatOfInt4(rows, cols); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfInt4 FromArray(IEnumerable enumerable) + { + return FromArray(EnumerableEx.ToArray(enumerable)); + } + #endregion + + #region ToArray + /// + /// Convert this mat to managed array + /// + /// + public override Vec4i[] ToArray() + { + long numOfElems = Total(); + if (numOfElems == 0) + return new Vec4i[0]; + var arr = new Vec4i[numOfElems]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed rectangular array + /// + /// + public override Vec4i[,] ToRectangularArray() + { + if (Rows == 0 || Cols == 0) + return new Vec4i[0, 0]; + var arr = new Vec4i[Rows, Cols]; + GetArray(0, 0, arr); + return arr; + } + #endregion + + #region GetEnumerator + /// + /// + /// + /// + public override IEnumerator GetEnumerator() + { + ThrowIfDisposed(); + var indexer = new Indexer(this); + + int dims = Dims(); + if (dims == 2) + { + int rows = Rows; + int cols = Cols; + for (int r = 0; r < rows; r++) + { + for (int c = 0; c < cols; c++) + { + yield return indexer[r, c]; + } + } + } + else + { + throw new NotImplementedException("GetEnumerator supports only 2-dimensional Mat"); + } + } + + #endregion + + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public override void Add(Vec4i value) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_Vec4i(ptr, value); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatOfPoint.cs b/src/OpenCvSharp/modules/core/Mat/MatOfPoint.cs new file mode 100644 index 000000000..9b8098c78 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatOfPoint.cs @@ -0,0 +1,702 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// A matrix whose element is cv::Point [CV_32SC2] (cv::Mat_<cv::Point>) + /// + public class MatOfPoint : Mat + { + private static readonly MatType ThisType = MatType.CV_32SC2; + private const int ThisDepth = MatType.CV_32S; + private const int ThisChannels = 2; + + #region Init + +#if LANG_JP + /// + /// Creates empty Mat + /// +#else + /// + /// Creates empty Mat + /// +#endif + public MatOfPoint() + : base() + { + } + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + public MatOfPoint(IntPtr ptr) + : base(ptr) + { + } + +#if LANG_JP + /// + /// Matオブジェクトから初期化 + /// + /// Matオブジェクト +#else + /// + /// Initializes by Mat object + /// + /// Managed Mat object +#endif + public MatOfPoint(Mat mat) + : base(mat) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. +#endif + public MatOfPoint(int rows, int cols) + : base(rows, cols, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . + /// Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. +#endif + public MatOfPoint(Size size) + : base(size, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfPoint(int rows, int cols, Point s) + : base(rows, cols, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfPoint(Size size, Point s) + : base(size, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public MatOfPoint(MatOfPoint m, Range rowRange, Range? colRange = null) + : base(m, rowRange, colRange) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + public MatOfPoint(MatOfPoint m, params Range[] ranges) + : base(m, ranges) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + public MatOfPoint(MatOfPoint m, Rect roi) + : base(m, roi) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfPoint(int rows, int cols, IntPtr data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfPoint(int rows, int cols, Point[] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfPoint(int rows, int cols, Point[,] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// Array of integers specifying an n-dimensional array shape. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfPoint(IEnumerable sizes, IntPtr data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfPoint(IEnumerable sizes, Point[] data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfPoint(IEnumerable sizes, Array data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. +#endif + public MatOfPoint(IEnumerable sizes) + : base(sizes, ThisType) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfPoint(IEnumerable sizes, Point s) + : base(sizes, ThisType, (Scalar)s) + { + } + + #endregion + + #region Indexer + /// + /// + /// + public sealed unsafe class Indexer : MatIndexer + { + private readonly byte* ptr; + + internal Indexer(Mat parent) + : base(parent) + { + ptr = (byte*)parent.Data.ToPointer(); + } + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public override Point this[int i0] + { + get + { + return *(Point*)(ptr + (steps[0] * i0)); + } + set + { + *(Point*)(ptr + (steps[0] * i0)) = value; + } + } + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override Point this[int i0, int i1] + { + get + { + return *(Point*)(ptr + (steps[0] * i0) + (steps[1] * i1)); + } + set + { + *(Point*)(ptr + (steps[0] * i0) + (steps[1] * i1)) = value; + } + } + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public override Point this[int i0, int i1, int i2] + { + get + { + return *(Point*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)); + } + set + { + *(Point*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)) = value; + } + } + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public override Point this[params int[] idx] + { + get + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + return *(Point*)(ptr + offset); + } + set + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + *(Point*)(ptr + offset) = value; + } + } + } + /// + /// Gets a type-specific indexer. The indexer has getters/setters to access each matrix element. + /// + /// + public override MatIndexer GetIndexer() + { + return new Indexer(this); + } + #endregion + + #region FromArray +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfPoint FromArray(params Point[] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int numElems = arr.Length/* / ThisChannels*/; + var mat = new MatOfPoint(numElems, 1); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// M x N の行列として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as M x N matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfPoint FromArray(Point[,] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int rows = arr.GetLength(0); + int cols = arr.GetLength(1); + var mat = new MatOfPoint(rows, cols); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfPoint FromArray(IEnumerable enumerable) + { + return FromArray(EnumerableEx.ToArray(enumerable)); + } + #endregion + + #region ToArray + /// + /// Convert this mat to managed array + /// + /// + public override Point[] ToArray() + { + long numOfElems = Total(); + if (numOfElems == 0) + return new Point[0]; + var arr = new Point[numOfElems]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed array + /// + /// + public int[] ToPrimitiveArray() + { + long numOfElems = Total(); + if (numOfElems == 0) + return new int[0]; + int[] arr = new int[numOfElems * ThisChannels]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed rectangular array + /// + /// + public override Point[,] ToRectangularArray() + { + if (Rows == 0 || Cols == 0) + return new Point[0, 0]; + var arr = new Point[Rows, Cols]; + GetArray(0, 0, arr); + return arr; + } + #endregion + + #region GetEnumerator + /// + /// + /// + /// + public override IEnumerator GetEnumerator() + { + ThrowIfDisposed(); + Indexer indexer = new Indexer(this); + + int dims = Dims(); + if (dims == 2) + { + int rows = Rows; + int cols = Cols; + for (int r = 0; r < rows; r++) + { + for (int c = 0; c < cols; c++) + { + yield return indexer[r, c]; + } + } + } + else + { + throw new NotImplementedException("GetEnumerator supports only 2-dimensional Mat"); + } + } + #endregion + + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public override void Add(Point value) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_Point(ptr, value); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatOfPoint2d.cs b/src/OpenCvSharp/modules/core/Mat/MatOfPoint2d.cs new file mode 100644 index 000000000..32029f565 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatOfPoint2d.cs @@ -0,0 +1,705 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// A matrix whose element is cv::Point [CV_64FC2] (cv::Mat_<cv::Point2d>) + /// + public class MatOfPoint2d : Mat + { + private static readonly MatType ThisType = MatType.CV_64FC2; + private const int ThisDepth = MatType.CV_64F; + private const int ThisChannels = 2; + + #region Init + +#if LANG_JP + /// + /// Creates empty Mat + /// +#else + /// + /// Creates empty Mat + /// +#endif + public MatOfPoint2d() + : base() + { + } + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + public MatOfPoint2d(IntPtr ptr) + : base(ptr) + { + } + +#if LANG_JP + /// + /// Matオブジェクトから初期化 + /// + /// Matオブジェクト +#else + /// + /// Initializes by Mat object + /// + /// Managed Mat object +#endif + public MatOfPoint2d(Mat mat) + : base(mat) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. +#endif + public MatOfPoint2d(int rows, int cols) + : base(rows, cols, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . + /// Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. +#endif + public MatOfPoint2d(Size size) + : base(size, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfPoint2d(int rows, int cols, Point2d s) + : base(rows, cols, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfPoint2d(Size size, Point2d s) + : base(size, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public MatOfPoint2d(MatOfPoint2d m, Range rowRange, Range? colRange = null) + : base(m, rowRange, colRange) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + public MatOfPoint2d(MatOfPoint2d m, params Range[] ranges) + : base(m, ranges) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + public MatOfPoint2d(MatOfPoint2d m, Rect roi) + : base(m, roi) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfPoint2d(int rows, int cols, IntPtr data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfPoint2d(int rows, int cols, Point2d[] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfPoint2d(int rows, int cols, Point2d[,] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// Array of integers specifying an n-dimensional array shape. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfPoint2d(IEnumerable sizes, IntPtr data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfPoint2d(IEnumerable sizes, Point2d[] data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfPoint2d(IEnumerable sizes, Array data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. +#endif + public MatOfPoint2d(IEnumerable sizes) + : base(sizes, ThisType) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfPoint2d(IEnumerable sizes, Point2d s) + : base(sizes, ThisType, (Scalar)s) + { + } + + #endregion + + #region Indexer + /// + /// Matrix indexer + /// + public sealed unsafe class Indexer : MatIndexer + { + private readonly byte* ptr; + + internal Indexer(Mat parent) + : base(parent) + { + this.ptr = (byte*)parent.Data.ToPointer(); + } + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public override Point2d this[int i0] + { + get + { + return *(Point2d*)(ptr + (steps[0] * i0)); + } + set + { + *(Point2d*)(ptr + (steps[0] * i0)) = value; + } + } + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override Point2d this[int i0, int i1] + { + get + { + return *(Point2d*)(ptr + (steps[0] * i0) + (steps[1] * i1)); + } + set + { + *(Point2d*)(ptr + (steps[0] * i0) + (steps[1] * i1)) = value; + } + } + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public override Point2d this[int i0, int i1, int i2] + { + get + { + return *(Point2d*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)); + } + set + { + *(Point2d*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)) = value; + } + } + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public override Point2d this[params int[] idx] + { + get + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + return *(Point2d*)(ptr + offset); + } + set + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + *(Point2d*)(ptr + offset) = value; + } + } + } + /// + /// Gets a type-specific indexer. The indexer has getters/setters to access each matrix element. + /// + /// + public override MatIndexer GetIndexer() + { + return new Indexer(this); + } + #endregion + + #region FromArray +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfPoint2d FromArray(params Point2d[] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int numElems = arr.Length/* / ThisChannels*/; + var mat = new MatOfPoint2d(numElems, 1); + mat.SetArray(0, 0, arr); + return mat; + } + +#if LANG_JP + /// + /// M x N の行列として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as M x N matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfPoint2d FromArray(Point2d[,] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int rows = arr.GetLength(0); + int cols = arr.GetLength(1); + var mat = new MatOfPoint2d(rows, cols); + mat.SetArray(0, 0, arr); + return mat; + } + +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfPoint2d FromArray(IEnumerable enumerable) + { + return FromArray(EnumerableEx.ToArray(enumerable)); + } + + #endregion + + #region ToArray + /// + /// Convert this mat to managed array + /// + /// + public override Point2d[] ToArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new Point2d[0]; + Point2d[] arr = new Point2d[numOfElems]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed array + /// + /// + public double[] ToPrimitiveArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new double[0]; + double[] arr = new double[numOfElems * ThisChannels]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed rectangular array + /// + /// + public override Point2d[,] ToRectangularArray() + { + if (Rows == 0 || Cols == 0) + return new Point2d[0, 0]; + Point2d[,] arr = new Point2d[Rows, Cols]; + GetArray(0, 0, arr); + return arr; + } + #endregion + + #region GetEnumerator + /// + /// + /// + /// + public override IEnumerator GetEnumerator() + { + ThrowIfDisposed(); + Indexer indexer = new Indexer(this); + + int dims = Dims(); + if (dims == 2) + { + int rows = Rows; + int cols = Cols; + for (int r = 0; r < rows; r++) + { + for (int c = 0; c < cols; c++) + { + yield return indexer[r, c]; + } + } + } + else + { + throw new NotImplementedException("GetEnumerator supports only 2-dimensional Mat"); + } + } + #endregion + + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public override void Add(Point2d value) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_Point2d(ptr, value); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatOfPoint2f.cs b/src/OpenCvSharp/modules/core/Mat/MatOfPoint2f.cs new file mode 100644 index 000000000..4fe1af45b --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatOfPoint2f.cs @@ -0,0 +1,706 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// A matrix whose element is cv::Point [CV_32FC2] (cv::Mat_<cv::Point2f>) + /// + public class MatOfPoint2f : Mat + { + private static readonly MatType ThisType = MatType.CV_32FC2; + private const int ThisDepth = MatType.CV_32F; + private const int ThisChannels = 2; + + #region Init + +#if LANG_JP + /// + /// Creates empty Mat + /// +#else + /// + /// Creates empty Mat + /// +#endif + public MatOfPoint2f() + : base() + { + } + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + public MatOfPoint2f(IntPtr ptr) + : base(ptr) + { + } + +#if LANG_JP + /// + /// Matオブジェクトから初期化 + /// + /// Matオブジェクト +#else + /// + /// Initializes by Mat object + /// + /// Managed Mat object +#endif + public MatOfPoint2f(Mat mat) + : base(mat) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. +#endif + public MatOfPoint2f(int rows, int cols) + : base(rows, cols, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . + /// Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. +#endif + public MatOfPoint2f(Size size) + : base(size, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfPoint2f(int rows, int cols, Point2f s) + : base(rows, cols, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfPoint2f(Size size, Point2f s) + : base(size, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public MatOfPoint2f(MatOfPoint2f m, Range rowRange, Range? colRange = null) + : base(m, rowRange, colRange) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + public MatOfPoint2f(MatOfPoint2f m, params Range[] ranges) + : base(m, ranges) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + public MatOfPoint2f(MatOfPoint2f m, Rect roi) + : base(m, roi) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfPoint2f(int rows, int cols, IntPtr data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfPoint2f(int rows, int cols, Point2f[] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfPoint2f(int rows, int cols, Point2f[,] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// Array of integers specifying an n-dimensional array shape. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfPoint2f(IEnumerable sizes, IntPtr data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfPoint2f(IEnumerable sizes, Point2f[] data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfPoint2f(IEnumerable sizes, Array data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. +#endif + public MatOfPoint2f(IEnumerable sizes) + : base(sizes, ThisType) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfPoint2f(IEnumerable sizes, Point2f s) + : base(sizes, ThisType, (Scalar)s) + { + } + + #endregion + + #region Indexer + /// + /// Matrix indexer + /// + public sealed unsafe class Indexer : MatIndexer + { + private readonly byte* ptr; + + internal Indexer(Mat parent) + : base(parent) + { + this.ptr = (byte*)parent.Data.ToPointer(); + } + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public override Point2f this[int i0] + { + get + { + return *(Point2f*)(ptr + (steps[0] * i0)); + } + set + { + *(Point2f*)(ptr + (steps[0] * i0)) = value; + } + } + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override Point2f this[int i0, int i1] + { + get + { + return *(Point2f*)(ptr + (steps[0] * i0) + (steps[1] * i1)); + } + set + { + *(Point2f*)(ptr + (steps[0] * i0) + (steps[1] * i1)) = value; + } + } + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public override Point2f this[int i0, int i1, int i2] + { + get + { + return *(Point2f*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)); + } + set + { + *(Point2f*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)) = value; + } + } + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public override Point2f this[params int[] idx] + { + get + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + return *(Point2f*)(ptr + offset); + } + set + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + *(Point2f*)(ptr + offset) = value; + } + } + } + /// + /// Gets a type-specific indexer. The indexer has getters/setters to access each matrix element. + /// + /// + public override MatIndexer GetIndexer() + { + return new Indexer(this); + } + #endregion + + #region FromArray +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfPoint2f FromArray(params Point2f[] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int numElems = arr.Length/* / ThisChannels*/; + var mat = new MatOfPoint2f(numElems, 1); + mat.SetArray(0, 0, arr); + return mat; + } + +#if LANG_JP + /// + /// M x N の行列として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as M x N matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfPoint2f FromArray(Point2f[,] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int rows = arr.GetLength(0); + int cols = arr.GetLength(1); + var mat = new MatOfPoint2f(rows, cols); + mat.SetArray(0, 0, arr); + return mat; + } + +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfPoint2f FromArray(IEnumerable enumerable) + { + return FromArray(EnumerableEx.ToArray(enumerable)); + } + + #endregion + + #region ToArray + /// + /// Convert this mat to managed array + /// + /// + public override Point2f[] ToArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new Point2f[0]; + Point2f[] arr = new Point2f[numOfElems]; + GetArray(0, 0, arr); + return arr; + } + + /// + /// Convert this mat to managed array + /// + /// + public float[] ToPrimitiveArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new float[0]; + float[] arr = new float[numOfElems * ThisChannels]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed rectangular array + /// + /// + public override Point2f[,] ToRectangularArray() + { + if (Rows == 0 || Cols == 0) + return new Point2f[0, 0]; + Point2f[,] arr = new Point2f[Rows, Cols]; + GetArray(0, 0, arr); + return arr; + } + #endregion + + #region GetEnumerator + /// + /// + /// + /// + public override IEnumerator GetEnumerator() + { + ThrowIfDisposed(); + Indexer indexer = new Indexer(this); + + int dims = Dims(); + if (dims == 2) + { + int rows = Rows; + int cols = Cols; + for (int r = 0; r < rows; r++) + { + for (int c = 0; c < cols; c++) + { + yield return indexer[r, c]; + } + } + } + else + { + throw new NotImplementedException("GetEnumerator supports only 2-dimensional Mat"); + } + } + #endregion + + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public override void Add(Point2f value) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_Point2f(ptr, value); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatOfPoint3d.cs b/src/OpenCvSharp/modules/core/Mat/MatOfPoint3d.cs new file mode 100644 index 000000000..ce4e118f7 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatOfPoint3d.cs @@ -0,0 +1,702 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// A matrix whose element is cv::Point3d [CV_64FC3] (cv::Mat_<cv::Point3d>) + /// + public class MatOfPoint3d : Mat + { + private static readonly MatType ThisType = MatType.CV_64FC3; + private const int ThisDepth = MatType.CV_64F; + private const int ThisChannels = 3; + + #region Init + +#if LANG_JP + /// + /// Creates empty Mat + /// +#else + /// + /// Creates empty Mat + /// +#endif + public MatOfPoint3d() + : base() + { + } + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + public MatOfPoint3d(IntPtr ptr) + : base(ptr) + { + } + +#if LANG_JP + /// + /// Matオブジェクトから初期化 + /// + /// Matオブジェクト +#else + /// + /// Initializes by Mat object + /// + /// Managed Mat object +#endif + public MatOfPoint3d(Mat mat) + : base(mat) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. +#endif + public MatOfPoint3d(int rows, int cols) + : base(rows, cols, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . + /// Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. +#endif + public MatOfPoint3d(Size size) + : base(size, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfPoint3d(int rows, int cols, Point3d s) + : base(rows, cols, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfPoint3d(Size size, Point3d s) + : base(size, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public MatOfPoint3d(MatOfPoint3d m, Range rowRange, Range? colRange = null) + : base(m, rowRange, colRange) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + public MatOfPoint3d(MatOfPoint3d m, params Range[] ranges) + : base(m, ranges) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + public MatOfPoint3d(MatOfPoint3d m, Rect roi) + : base(m, roi) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfPoint3d(int rows, int cols, IntPtr data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfPoint3d(int rows, int cols, Point3d[] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfPoint3d(int rows, int cols, Point3d[,] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// Array of integers specifying an n-dimensional array shape. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfPoint3d(IEnumerable sizes, IntPtr data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfPoint3d(IEnumerable sizes, Point3d[] data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfPoint3d(IEnumerable sizes, Array data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. +#endif + public MatOfPoint3d(IEnumerable sizes) + : base(sizes, ThisType) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfPoint3d(IEnumerable sizes, Point3d s) + : base(sizes, ThisType, (Scalar)s) + { + } + + #endregion + + #region Indexer + /// + /// + /// + public sealed unsafe class Indexer : MatIndexer + { + private readonly byte* ptr; + + internal Indexer(Mat parent) + : base(parent) + { + ptr = (byte*)parent.Data.ToPointer(); + } + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public override Point3d this[int i0] + { + get + { + return *(Point3d*)(ptr + (steps[0] * i0)); + } + set + { + *(Point3d*)(ptr + (steps[0] * i0)) = value; + } + } + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override Point3d this[int i0, int i1] + { + get + { + return *(Point3d*)(ptr + (steps[0] * i0) + (steps[1] * i1)); + } + set + { + *(Point3d*)(ptr + (steps[0] * i0) + (steps[1] * i1)) = value; + } + } + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public override Point3d this[int i0, int i1, int i2] + { + get + { + return *(Point3d*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)); + } + set + { + *(Point3d*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)) = value; + } + } + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public override Point3d this[params int[] idx] + { + get + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + return *(Point3d*)(ptr + offset); + } + set + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + *(Point3d*)(ptr + offset) = value; + } + } + } + /// + /// Gets a type-specific indexer. The indexer has getters/setters to access each matrix element. + /// + /// + public override MatIndexer GetIndexer() + { + return new Indexer(this); + } + #endregion + + #region FromArray +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfPoint3d FromArray(params Point3d[] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int numElems = arr.Length/* / ThisChannels*/; + var mat = new MatOfPoint3d(numElems, 1); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// M x N の行列として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as M x N matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfPoint3d FromArray(Point3d[,] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int rows = arr.GetLength(0); + int cols = arr.GetLength(1); + var mat = new MatOfPoint3d(rows, cols); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfPoint3d FromArray(IEnumerable enumerable) + { + return FromArray(EnumerableEx.ToArray(enumerable)); + } + #endregion + + #region ToArray + /// + /// Convert this mat to managed array + /// + /// + public override Point3d[] ToArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new Point3d[0]; + var arr = new Point3d[numOfElems]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed array + /// + /// + public double[] ToPrimitiveArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new double[0]; + var arr = new double[numOfElems * ThisChannels]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed rectangular array + /// + /// + public override Point3d[,] ToRectangularArray() + { + if (Rows == 0 || Cols == 0) + return new Point3d[0, 0]; + var arr = new Point3d[Rows, Cols]; + GetArray(0, 0, arr); + return arr; + } + #endregion + + #region GetEnumerator + /// + /// + /// + /// + public override IEnumerator GetEnumerator() + { + ThrowIfDisposed(); + Indexer indexer = new Indexer(this); + + int dims = Dims(); + if (dims == 2) + { + int rows = Rows; + int cols = Cols; + for (int r = 0; r < rows; r++) + { + for (int c = 0; c < cols; c++) + { + yield return indexer[r, c]; + } + } + } + else + { + throw new NotImplementedException("GetEnumerator supports only 2-dimensional Mat"); + } + } + #endregion + + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public override void Add(Point3d value) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_Point3d(ptr, value); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatOfPoint3f.cs b/src/OpenCvSharp/modules/core/Mat/MatOfPoint3f.cs new file mode 100644 index 000000000..f7de4a490 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatOfPoint3f.cs @@ -0,0 +1,702 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// A matrix whose element is cv::Point3f [CV_32FC3] (cv::Mat_<cv::Point3f>) + /// + public class MatOfPoint3f : Mat + { + private static readonly MatType ThisType = MatType.CV_32FC3; + private const int ThisDepth = MatType.CV_32F; + private const int ThisChannels = 3; + + #region Init + +#if LANG_JP + /// + /// Creates empty Mat + /// +#else + /// + /// Creates empty Mat + /// +#endif + public MatOfPoint3f() + : base() + { + } + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + public MatOfPoint3f(IntPtr ptr) + : base(ptr) + { + } + +#if LANG_JP + /// + /// Matオブジェクトから初期化 + /// + /// Matオブジェクト +#else + /// + /// Initializes by Mat object + /// + /// Managed Mat object +#endif + public MatOfPoint3f(Mat mat) + : base(mat) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. +#endif + public MatOfPoint3f(int rows, int cols) + : base(rows, cols, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . + /// Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. +#endif + public MatOfPoint3f(Size size) + : base(size, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfPoint3f(int rows, int cols, Point3f s) + : base(rows, cols, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfPoint3f(Size size, Point3f s) + : base(size, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public MatOfPoint3f(MatOfPoint3f m, Range rowRange, Range? colRange = null) + : base(m, rowRange, colRange) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + public MatOfPoint3f(MatOfPoint3f m, params Range[] ranges) + : base(m, ranges) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + public MatOfPoint3f(MatOfPoint3f m, Rect roi) + : base(m, roi) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfPoint3f(int rows, int cols, IntPtr data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfPoint3f(int rows, int cols, Point3f[] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfPoint3f(int rows, int cols, Point3f[,] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// Array of integers specifying an n-dimensional array shape. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfPoint3f(IEnumerable sizes, IntPtr data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfPoint3f(IEnumerable sizes, Point3f[] data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfPoint3f(IEnumerable sizes, Array data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. +#endif + public MatOfPoint3f(IEnumerable sizes) + : base(sizes, ThisType) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfPoint3f(IEnumerable sizes, Point3f s) + : base(sizes, ThisType, (Scalar)s) + { + } + + #endregion + + #region Indexer + /// + /// + /// + public sealed unsafe class Indexer : MatIndexer + { + private readonly byte* ptr; + + internal Indexer(Mat parent) + : base(parent) + { + ptr = (byte*)parent.Data.ToPointer(); + } + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public override Point3f this[int i0] + { + get + { + return *(Point3f*)(ptr + (steps[0] * i0)); + } + set + { + *(Point3f*)(ptr + (steps[0] * i0)) = value; + } + } + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override Point3f this[int i0, int i1] + { + get + { + return *(Point3f*)(ptr + (steps[0] * i0) + (steps[1] * i1)); + } + set + { + *(Point3f*)(ptr + (steps[0] * i0) + (steps[1] * i1)) = value; + } + } + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public override Point3f this[int i0, int i1, int i2] + { + get + { + return *(Point3f*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)); + } + set + { + *(Point3f*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)) = value; + } + } + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public override Point3f this[params int[] idx] + { + get + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + return *(Point3f*)(ptr + offset); + } + set + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + *(Point3f*)(ptr + offset) = value; + } + } + } + /// + /// Gets a type-specific indexer. The indexer has getters/setters to access each matrix element. + /// + /// + public override MatIndexer GetIndexer() + { + return new Indexer(this); + } + #endregion + + #region FromArray +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfPoint3f FromArray(params Point3f[] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int numElems = arr.Length/* / ThisChannels*/; + var mat = new MatOfPoint3f(numElems, 1); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// M x N の行列として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as M x N matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfPoint3f FromArray(Point3f[,] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int rows = arr.GetLength(0); + int cols = arr.GetLength(1); + var mat = new MatOfPoint3f(rows, cols); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfPoint3f FromArray(IEnumerable enumerable) + { + return FromArray(EnumerableEx.ToArray(enumerable)); + } + #endregion + + #region ToArray + /// + /// Convert this mat to managed array + /// + /// + public override Point3f[] ToArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new Point3f[0]; + var arr = new Point3f[numOfElems]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed array + /// + /// + public float[] ToPrimitiveArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new float[0]; + var arr = new float[numOfElems * ThisChannels]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed rectangular array + /// + /// + public override Point3f[,] ToRectangularArray() + { + if (Rows == 0 || Cols == 0) + return new Point3f[0, 0]; + var arr = new Point3f[Rows, Cols]; + GetArray(0, 0, arr); + return arr; + } + #endregion + + #region GetEnumerator + /// + /// + /// + /// + public override IEnumerator GetEnumerator() + { + ThrowIfDisposed(); + Indexer indexer = new Indexer(this); + + int dims = Dims(); + if (dims == 2) + { + int rows = Rows; + int cols = Cols; + for (int r = 0; r < rows; r++) + { + for (int c = 0; c < cols; c++) + { + yield return indexer[r, c]; + } + } + } + else + { + throw new NotImplementedException("GetEnumerator supports only 2-dimensional Mat"); + } + } + #endregion + + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public override void Add(Point3f value) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_Point3f(ptr, value); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatOfPoint3i.cs b/src/OpenCvSharp/modules/core/Mat/MatOfPoint3i.cs new file mode 100644 index 000000000..4ee462aff --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatOfPoint3i.cs @@ -0,0 +1,702 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// A matrix whose element is cv::Point3i [CV_32SC3] (cv::Mat_<cv::Point3i>) + /// + public class MatOfPoint3i : Mat + { + private static readonly MatType ThisType = MatType.CV_32SC3; + private const int ThisDepth = MatType.CV_32S; + private const int ThisChannels = 3; + + #region Init + +#if LANG_JP + /// + /// Creates empty Mat + /// +#else + /// + /// Creates empty Mat + /// +#endif + public MatOfPoint3i() + : base() + { + } + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + public MatOfPoint3i(IntPtr ptr) + : base(ptr) + { + } + +#if LANG_JP + /// + /// Matオブジェクトから初期化 + /// + /// Matオブジェクト +#else + /// + /// Initializes by Mat object + /// + /// Managed Mat object +#endif + public MatOfPoint3i(Mat mat) + : base(mat) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. +#endif + public MatOfPoint3i(int rows, int cols) + : base(rows, cols, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . + /// Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. +#endif + public MatOfPoint3i(Size size) + : base(size, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfPoint3i(int rows, int cols, Point3i s) + : base(rows, cols, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfPoint3i(Size size, Point3i s) + : base(size, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public MatOfPoint3i(MatOfPoint3i m, Range rowRange, Range? colRange = null) + : base(m, rowRange, colRange) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + public MatOfPoint3i(MatOfPoint3i m, params Range[] ranges) + : base(m, ranges) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + public MatOfPoint3i(MatOfPoint3i m, Rect roi) + : base(m, roi) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfPoint3i(int rows, int cols, IntPtr data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfPoint3i(int rows, int cols, Point3i[] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfPoint3i(int rows, int cols, Point3i[,] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// Array of integers specifying an n-dimensional array shape. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfPoint3i(IEnumerable sizes, IntPtr data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfPoint3i(IEnumerable sizes, Point3i[] data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfPoint3i(IEnumerable sizes, Array data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. +#endif + public MatOfPoint3i(IEnumerable sizes) + : base(sizes, ThisType) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfPoint3i(IEnumerable sizes, Point3i s) + : base(sizes, ThisType, (Scalar)s) + { + } + + #endregion + + #region Indexer + /// + /// + /// + public sealed unsafe class Indexer : MatIndexer + { + private readonly byte* ptr; + + internal Indexer(Mat parent) + : base(parent) + { + ptr = (byte*)parent.Data.ToPointer(); + } + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public override Point3i this[int i0] + { + get + { + return *(Point3i*)(ptr + (steps[0] * i0)); + } + set + { + *(Point3i*)(ptr + (steps[0] * i0)) = value; + } + } + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override Point3i this[int i0, int i1] + { + get + { + return *(Point3i*)(ptr + (steps[0] * i0) + (steps[1] * i1)); + } + set + { + *(Point3i*)(ptr + (steps[0] * i0) + (steps[1] * i1)) = value; + } + } + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public override Point3i this[int i0, int i1, int i2] + { + get + { + return *(Point3i*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)); + } + set + { + *(Point3i*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)) = value; + } + } + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public override Point3i this[params int[] idx] + { + get + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + return *(Point3i*)(ptr + offset); + } + set + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + *(Point3i*)(ptr + offset) = value; + } + } + } + /// + /// Gets a type-specific indexer. The indexer has getters/setters to access each matrix element. + /// + /// + public override MatIndexer GetIndexer() + { + return new Indexer(this); + } + #endregion + + #region FromArray +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfPoint3i FromArray(params Point3i[] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int numElems = arr.Length/* / ThisChannels*/; + var mat = new MatOfPoint3i(numElems, 1); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// M x N の行列として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as M x N matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfPoint3i FromArray(Point3i[,] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int rows = arr.GetLength(0); + int cols = arr.GetLength(1); + var mat = new MatOfPoint3i(rows, cols); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfPoint3i FromArray(IEnumerable enumerable) + { + return FromArray(EnumerableEx.ToArray(enumerable)); + } + #endregion + + #region ToArray + /// + /// Convert this mat to managed array + /// + /// + public override Point3i[] ToArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new Point3i[0]; + var arr = new Point3i[numOfElems]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed array + /// + /// + public int[] ToPrimitiveArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new int[0]; + int[] arr = new int[numOfElems * ThisChannels]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed rectangular array + /// + /// + public override Point3i[,] ToRectangularArray() + { + if (Rows == 0 || Cols == 0) + return new Point3i[0, 0]; + Point3i[,] arr = new Point3i[Rows, Cols]; + GetArray(0, 0, arr); + return arr; + } + #endregion + + #region GetEnumerator + /// + /// + /// + /// + public override IEnumerator GetEnumerator() + { + ThrowIfDisposed(); + Indexer indexer = new Indexer(this); + + int dims = Dims(); + if (dims == 2) + { + int rows = Rows; + int cols = Cols; + for (int r = 0; r < rows; r++) + { + for (int c = 0; c < cols; c++) + { + yield return indexer[r, c]; + } + } + } + else + { + throw new NotImplementedException("GetEnumerator supports only 2-dimensional Mat"); + } + } + #endregion + + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public override void Add(Point3i value) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_Point3i(ptr, value); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatOfRect.cs b/src/OpenCvSharp/modules/core/Mat/MatOfRect.cs new file mode 100644 index 000000000..b9d0fa8fa --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatOfRect.cs @@ -0,0 +1,704 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// A matrix whose element is cv::Rect [CV_32SC4] (cv::Mat_<cv::Rect>) + /// + public class MatOfRect : Mat + { + private static readonly MatType ThisType = MatType.CV_32SC4; + private const int ThisDepth = MatType.CV_32S; + private const int ThisChannels = 4; + + #region Init + +#if LANG_JP + /// + /// Creates empty Mat + /// +#else + /// + /// Creates empty Mat + /// +#endif + public MatOfRect() + : base() + { + } + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + public MatOfRect(IntPtr ptr) + : base(ptr) + { + } + +#if LANG_JP + /// + /// Matオブジェクトから初期化 + /// + /// Matオブジェクト +#else + /// + /// Initializes by Mat object + /// + /// Managed Mat object +#endif + public MatOfRect(Mat mat) + : base(mat) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. +#endif + public MatOfRect(int rows, int cols) + : base(rows, cols, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . + /// Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. +#endif + public MatOfRect(Size size) + : base(size, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfRect(int rows, int cols, Rect s) + : base(rows, cols, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfRect(Size size, Rect s) + : base(size, ThisType, (Scalar)s) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public MatOfRect(MatOfRect m, Range rowRange, Range? colRange = null) + : base(m, rowRange, colRange) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + public MatOfRect(MatOfRect m, params Range[] ranges) + : base(m, ranges) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + public MatOfRect(MatOfRect m, Rect roi) + : base(m, roi) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfRect(int rows, int cols, IntPtr data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfRect(int rows, int cols, Rect[] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfRect(int rows, int cols, Rect[,] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// Array of integers specifying an n-dimensional array shape. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfRect(IEnumerable sizes, IntPtr data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfRect(IEnumerable sizes, Rect[] data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfRect(IEnumerable sizes, Array data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. +#endif + public MatOfRect(IEnumerable sizes) + : base(sizes, ThisType) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfRect(IEnumerable sizes, Rect s) + : base(sizes, ThisType, (Scalar)s) + { + } + + #endregion + + #region Indexer + /// + /// + /// + public sealed unsafe class Indexer : MatIndexer + { + private readonly byte* ptr; + + internal Indexer(Mat parent) + : base(parent) + { + ptr = (byte*)parent.Data.ToPointer(); + } + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public override Rect this[int i0] + { + get + { + return *(Rect*)(ptr + (steps[0] * i0)); + } + set + { + *(Rect*)(ptr + (steps[0] * i0)) = value; + } + } + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override Rect this[int i0, int i1] + { + get + { + return *(Rect*)(ptr + (steps[0] * i0) + (steps[1] * i1)); + } + set + { + *(Rect*)(ptr + (steps[0] * i0) + (steps[1] * i1)) = value; + } + } + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public override Rect this[int i0, int i1, int i2] + { + get + { + return *(Rect*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)); + } + set + { + *(Rect*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)) = value; + } + } + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public override Rect this[params int[] idx] + { + get + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + return *(Rect*)(ptr + offset); + } + set + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + *(Rect*)(ptr + offset) = value; + } + } + } + /// + /// Gets a type-specific indexer. The indexer has getters/setters to access each matrix element. + /// + /// + public override MatIndexer GetIndexer() + { + return new Indexer(this); + } + #endregion + + #region FromArray +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfRect FromArray(params Rect[] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int numElems = arr.Length/* / ThisChannels*/; + var mat = new MatOfRect(numElems, 1); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// M x N の行列として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as M x N matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfRect FromArray(Rect[,] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int rows = arr.GetLength(0); + int cols = arr.GetLength(1); + var mat = new MatOfRect(rows, cols); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfRect FromArray(IEnumerable enumerable) + { + return FromArray(EnumerableEx.ToArray(enumerable)); + } + #endregion + + #region ToArray + /// + /// Convert this mat to managed array + /// + /// + public override Rect[] ToArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new Rect[0]; + var arr = new Rect[numOfElems]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed array + /// + /// + public int[] ToPrimitiveArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new int[0]; + int[] arr = new int[numOfElems * ThisChannels]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed rectangular array + /// + /// + public override Rect[,] ToRectangularArray() + { + if (Rows == 0 || Cols == 0) + return new Rect[0, 0]; + var arr = new Rect[Rows, Cols]; + GetArray(0, 0, arr); + return arr; + } + #endregion + + #region GetEnumerator + /// + /// + /// + /// + public override IEnumerator GetEnumerator() + { + ThrowIfDisposed(); + Indexer indexer = new Indexer(this); + + int dims = Dims(); + if (dims == 2) + { + int rows = Rows; + int cols = Cols; + for (int r = 0; r < rows; r++) + { + for (int c = 0; c < cols; c++) + { + yield return indexer[r, c]; + } + } + } + else + { + throw new NotImplementedException("GetEnumerator supports only 2-dimensional Mat"); + } + } + #endregion + + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public override void Add(Rect value) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_Rect(ptr, value); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatOfShort.cs b/src/OpenCvSharp/modules/core/Mat/MatOfShort.cs new file mode 100644 index 000000000..90fb2ce1a --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatOfShort.cs @@ -0,0 +1,689 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// A matrix whose element is 16SC1 (cv::Mat_<short>) + /// + public class MatOfShort : Mat + { + private static readonly MatType ThisType = MatType.CV_16SC1; + private const int ThisDepth = MatType.CV_16S; + private const int ThisChannels = 1; + + #region Init + +#if LANG_JP + /// + /// Creates empty Mat + /// +#else + /// + /// Creates empty Mat + /// +#endif + public MatOfShort() + : base() + { + } + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + public MatOfShort(IntPtr ptr) + : base(ptr) + { + } + +#if LANG_JP + /// + /// Matオブジェクトから初期化 + /// + /// Matオブジェクト +#else + /// + /// Initializes by Mat object + /// + /// Managed Mat object +#endif + public MatOfShort(Mat mat) + : base(mat) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. +#endif + public MatOfShort(int rows, int cols) + : base(rows, cols, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . + /// Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. +#endif + public MatOfShort(Size size) + : base(size, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfShort(int rows, int cols, short s) + : base(rows, cols, ThisType, s) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfShort(Size size, short s) + : base(size, ThisType, s) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public MatOfShort(MatOfShort m, Range rowRange, Range? colRange = null) + : base(m, rowRange, colRange) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + public MatOfShort(MatOfShort m, params Range[] ranges) + : base(m, ranges) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + public MatOfShort(MatOfShort m, Rect roi) + : base(m, roi) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfShort(int rows, int cols, IntPtr data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfShort(int rows, int cols, short[] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfShort(int rows, int cols, short[,] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// Array of integers specifying an n-dimensional array shape. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfShort(IEnumerable sizes, IntPtr data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfShort(IEnumerable sizes, short[] data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfShort(IEnumerable sizes, Array data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. +#endif + public MatOfShort(IEnumerable sizes) + : base(sizes, ThisType) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfShort(IEnumerable sizes, short s) + : base(sizes, ThisType, s) + { + } + + #endregion + + #region Indexer + /// + /// Matrix indexer + /// + public sealed unsafe class Indexer : MatIndexer + { + private readonly byte *ptr; + + internal Indexer(Mat parent) + : base(parent) + { + ptr = (byte*)parent.Data.ToPointer(); + } + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public override short this[int i0] + { + get + { + return *(short*)(ptr + (steps[0] * i0)); + } + set + { + *(short*)(ptr + (steps[0] * i0)) = value; + } + } + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override short this[int i0, int i1] + { + get + { + return *(short*)(ptr + (steps[0] * i0) + (steps[1] * i1)); + } + set + { + *(short*)(ptr + (steps[0] * i0) + (steps[1] * i1)) = value; + } + } + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public override short this[int i0, int i1, int i2] + { + get + { + return *(short*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)); + } + set + { + *(short*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)) = value; + } + } + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public override short this[params int[] idx] + { + get + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + return *(short*)(ptr + offset); + } + set + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + *(short*)(ptr + offset) = value; + } + } + } + /// + /// Gets a type-specific indexer. The indexer has getters/setters to access each matrix element. + /// + /// + public override MatIndexer GetIndexer() + { + return new Indexer(this); + } + #endregion + + #region FromArray +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfShort FromArray(params short[] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int numElems = arr.Length / ThisChannels; + var mat = new MatOfShort(numElems, 1); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// M x N の行列として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as M x N matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfShort FromArray(short[,] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int rows = arr.GetLength(0); + int cols = arr.GetLength(1); + var mat = new MatOfShort(rows, cols); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfShort FromArray(IEnumerable enumerable) + { + return FromArray(EnumerableEx.ToArray(enumerable)); + } + #endregion + + #region ToArray + /// + /// Convert this mat to managed array + /// + /// + public override short[] ToArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new short[0]; + short[] arr = new short[numOfElems]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed rectangular array + /// + /// + public override short[,] ToRectangularArray() + { + if (Rows == 0 || Cols == 0) + return new short[0, 0]; + short[,] arr = new short[Rows, Cols]; + GetArray(0, 0, arr); + return arr; + } + #endregion + + #region GetEnumerator + /// + /// + /// + /// + public override IEnumerator GetEnumerator() + { + ThrowIfDisposed(); + Indexer indexer = new Indexer(this); + + int dims = Dims(); + if (dims == 2) + { + int rows = Rows; + int cols = Cols; + for (int r = 0; r < rows; r++) + { + for (int c = 0; c < cols; c++) + { + yield return indexer[r, c]; + } + } + } + else + { + throw new NotImplementedException("GetEnumerator supports only 2-dimensional Mat"); + } + } + #endregion + + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public override void Add(short value) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_short(ptr, value); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatOfT.cs b/src/OpenCvSharp/modules/core/Mat/MatOfT.cs new file mode 100644 index 000000000..97400aff2 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatOfT.cs @@ -0,0 +1,791 @@ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace OpenCvSharp +{ + /// + /// Type-specific abstract matrix + /// + /// Element Type + /// For return value type of re-defined Mat methods + public abstract class Mat : Mat, ICollection + where TElem : struct + where TInherit : Mat, new() + { + private bool disposed; + private Mat sourceMat; + + #region Init & Disposal + +#if LANG_JP + /// + /// Creates empty Mat + /// +#else + /// + /// Creates empty Mat + /// +#endif + protected Mat() + : base() + { + } + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + protected Mat(IntPtr ptr) + : base(ptr) + { + } + +#if LANG_JP + /// + /// Matオブジェクトから初期化 + /// + /// Matオブジェクト +#else + /// + /// Initializes by Mat object + /// + /// Managed Mat object +#endif + protected Mat(Mat mat) + : base(mat.CvPtr) + { + // 作成元への参照を残す。元がGCに回収されないように。 + sourceMat = mat; + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. +#endif + protected Mat(int rows, int cols, MatType type) + : base(rows, cols, type) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType.CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. +#endif + protected Mat(Size size, MatType type) + : base(size, type) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + protected Mat(int rows, int cols, MatType type, Scalar s) + : base(rows, cols, type, s) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + protected Mat(Size size, MatType type, Scalar s) + : base(size, type, s) + { + } + + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + protected Mat(Mat m, Range rowRange, Range? colRange = null) + : base(m, rowRange, colRange) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + protected Mat(Mat m, params Range[] ranges) + : base(m, ranges) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + protected Mat(Mat m, Rect roi) + : base(m, roi) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + protected Mat(int rows, int cols, MatType type, IntPtr data, long step = 0) + : base(rows, cols, type, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + protected Mat(int rows, int cols, MatType type, Array data, long step = 0) + : base(rows, cols, type, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// Array of integers specifying an n-dimensional array shape. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + protected Mat(IEnumerable sizes, MatType type, IntPtr data, IEnumerable steps = null) + : base(sizes, type, data, steps) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + protected Mat(IEnumerable sizes, MatType type, Array data, IEnumerable steps = null) + : base(sizes, type, data, steps) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. +#endif + protected Mat(IEnumerable sizes, MatType type) + : base(sizes, type) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + protected Mat(IEnumerable sizes, MatType type, Scalar s) + : base(sizes, type, s) + { + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + if (sourceMat == null) + { + base.Dispose(disposing); + } + else + { + // sourceMat.Disposeに解放を任せるので + // ここでは何もしない + } + + sourceMat = null; + disposed = true; + } + } + + #endregion + + #region Abstract Methods + /// + /// Gets type-specific indexer for accessing each element + /// + /// + public abstract MatIndexer GetIndexer(); + + /// + /// Gets read-only enumerator + /// + /// + public abstract IEnumerator GetEnumerator(); + /// + /// For non-generic IEnumerable + /// + /// + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + /// + /// Convert this mat to managed array + /// + /// + public abstract TElem[] ToArray(); + + /// + /// Convert this mat to managed rectangular array + /// + /// + public abstract TElem[,] ToRectangularArray(); + #endregion + + #region Mat Methods + /// + /// + /// + /// + /// + protected TInherit Wrap(Mat mat) + { + TInherit ret = new TInherit(); + mat.AssignTo(ret); + return ret; + } + + #region Clone + + /// + /// Creates a full copy of the matrix. + /// + /// + public new TInherit Clone() + { + Mat result = base.Clone(); + return Wrap(result); + } + #endregion + #region Reshape + + /// + /// Changes the shape of channels of a 2D matrix without copying the data. + /// + /// New number of rows. If the parameter is 0, the number of rows remains the same. + /// + public TInherit Reshape(int rows) + { + Mat result = base.Reshape(0, rows); + return Wrap(result); + } + + /// + /// Changes the shape of a 2D matrix without copying the data. + /// + /// New number of rows. If the parameter is 0, the number of rows remains the same. + /// + public TInherit Reshape(params int[] newDims) + { + Mat result = base.Reshape(0, newDims); + return Wrap(result); + } + + #endregion + #region T + + /// + /// Transposes a matrix. + /// + /// + public new TInherit T() + { + Mat result = base.T(); + return Wrap(result); + } + + #endregion + + #region SubMat + /// + /// Extracts a rectangular submatrix. + /// + /// Start row of the extracted submatrix. The upper boundary is not included. + /// End row of the extracted submatrix. The upper boundary is not included. + /// Start column of the extracted submatrix. The upper boundary is not included. + /// End column of the extracted submatrix. The upper boundary is not included. + /// + public new TInherit SubMat(int rowStart, int rowEnd, int colStart, int colEnd) + { + Mat result = base.SubMat(rowStart, rowEnd, colStart, colEnd); + return Wrap(result); + } + + /// + /// Extracts a rectangular submatrix. + /// + /// Start and end row of the extracted submatrix. The upper boundary is not included. + /// To select all the rows, use Range.All(). + /// Start and end column of the extracted submatrix. + /// The upper boundary is not included. To select all the columns, use Range.All(). + /// + public new TInherit SubMat(Range rowRange, Range colRange) + { + return this.SubMat(rowRange.Start, rowRange.End, colRange.Start, colRange.End); + } + + /// + /// Extracts a rectangular submatrix. + /// + /// Extracted submatrix specified as a rectangle. + /// + public new TInherit SubMat(Rect roi) + { + return this.SubMat(roi.Y, roi.Y + roi.Height, roi.X, roi.X + roi.Width); + } + + /// + /// Extracts a rectangular submatrix. + /// + /// Array of selected ranges along each array dimension. + /// + public new TInherit SubMat(params Range[] ranges) + { + Mat result = base.SubMat(ranges); + return Wrap(result); + } + + #endregion + #region Mat Indexers + /// + /// Extracts a rectangular submatrix. + /// + /// Start row of the extracted submatrix. The upper boundary is not included. + /// End row of the extracted submatrix. The upper boundary is not included. + /// Start column of the extracted submatrix. The upper boundary is not included. + /// End column of the extracted submatrix. The upper boundary is not included. + /// + public new TInherit this[int rowStart, int rowEnd, int colStart, int colEnd] + { + get + { + Mat result = base[rowStart, rowEnd, colStart, colEnd]; + return Wrap(result); + } + set + { + base[rowStart, rowEnd, colStart, colEnd] = value; + } + } + + /// + /// Extracts a rectangular submatrix. + /// + /// Start and end row of the extracted submatrix. The upper boundary is not included. + /// To select all the rows, use Range.All(). + /// Start and end column of the extracted submatrix. + /// The upper boundary is not included. To select all the columns, use Range.All(). + /// + public new TInherit this[Range rowRange, Range colRange] + { + get + { + Mat result = base[rowRange, colRange]; + return Wrap(result); + } + set + { + base[rowRange, colRange] = value; + } + } + + /// + /// Extracts a rectangular submatrix. + /// + /// Extracted submatrix specified as a rectangle. + /// + public new TInherit this[Rect roi] + { + get + { + Mat result = base[roi]; + return Wrap(result); + } + set + { + base[roi] = value; + } + } + + /// + /// Extracts a rectangular submatrix. + /// + /// Array of selected ranges along each array dimension. + /// + public new TInherit this[params Range[] ranges] + { + get + { + Mat result = base[ranges]; + return Wrap(result); + } + set + { + base[ranges] = value; + } + } + #endregion + + #endregion + + #region ICollection + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public abstract void Add(TElem value); + + /// + /// Removes the first occurrence of a specific object from the ICollection<T>. + /// + /// The object to remove from the ICollection<T>. + /// true if item was successfully removed from the ICollection<T> otherwise, false. + /// This method also returns false if item is not found in the original ICollection<T>. + public bool Remove(TElem item) + { + throw new NotImplementedException(); + } + + /// + /// Determines whether the ICollection<T> contains a specific value. + /// + /// The object to locate in the ICollection<T>. + /// true if item is found in the ICollection<T> otherwise, false. + public bool Contains(TElem item) + { + return IndexOf(item) >= 0; + } + + /// + /// Determines the index of a specific item in the list. + /// + /// The object to locate in the list. + /// The index of value if found in the list; otherwise, -1. + public int IndexOf(TElem item) + { + TElem[] array = ToArray(); + return Array.IndexOf(array, item); + } + + /// + /// Removes all items from the ICollection<T>. + /// + public void Clear() + { + ThrowIfDisposed(); + NativeMethods.core_Mat_pop_back(ptr, new IntPtr((long)Total())); + } + + /// + /// Copies the elements of the ICollection<T> to an Array, starting at a particular Array index. + /// + /// The one-dimensional Array that is the destination of the elements copied from ICollection<T>. + /// The Array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + public void CopyTo(TElem[] array, int arrayIndex) + { + ThrowIfDisposed(); + + if (array == null) + throw new ArgumentNullException("array"); + TElem[] result = ToArray(); + if (array.Length > result.Length + arrayIndex) + throw new ArgumentException("Too short array.Length"); + Array.Copy(result, 0, array, arrayIndex, result.Length); + } + + /// + /// Returns the total number of matrix elements (Mat.total) + /// + /// Total number of list(Mat) elements + public int Count + { + get + { + ThrowIfDisposed(); + return (int)NativeMethods.core_Mat_total(ptr); + } + } + + /// + /// Gets a value indicating whether the IList is read-only. + /// + /// + public bool IsReadOnly { get { return false; }} + #endregion + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/MatOfUShort.cs b/src/OpenCvSharp/modules/core/Mat/MatOfUShort.cs new file mode 100644 index 000000000..0da7fbd8a --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/MatOfUShort.cs @@ -0,0 +1,690 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// A matrix whose element is 16UC1 (cv::Mat_<ushort>) + /// + public class MatOfUShort : Mat + { + private static readonly MatType ThisType = MatType.CV_16UC1; + private const int ThisDepth = MatType.CV_16U; + private const int ThisChannels = 1; + + #region Init + +#if LANG_JP + /// + /// Creates empty Mat + /// +#else + /// + /// Creates empty Mat + /// +#endif + public MatOfUShort() + : base() + { + } + +#if LANG_JP + /// + /// OpenCVネイティブの cv::Mat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::Mat* pointer + /// + /// +#endif + public MatOfUShort(IntPtr ptr) + : base(ptr) + { + } + +#if LANG_JP + /// + /// Matオブジェクトから初期化 + /// + /// Matオブジェクト +#else + /// + /// Initializes by Mat object + /// + /// Managed Mat object +#endif + public MatOfUShort(Mat mat) + : base(mat) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. +#endif + public MatOfUShort(int rows, int cols) + : base(rows, cols, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) . + /// Size コンストラクタでは,行数と列数が逆順になっていることに注意してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. +#endif + public MatOfUShort(Size size) + : base(size, ThisType) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfUShort(int rows, int cols, ushort s) + : base(rows, cols, ThisType, s) + { + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) . Size() コンストラクタでは,行数と列数が逆順になっていることに注意してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . In the Size() constructor, + /// the number of rows and the number of columns go in the reverse order. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfUShort(Size size, ushort s) + : base(size, ThisType, s) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat::clone() . + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public MatOfUShort(MatOfUShort m, Range rowRange, Range? colRange = null) + : base(m, rowRange, colRange) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 多次元行列の各次元毎の選択範囲を表す配列. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Array of selected ranges of m along each dimensionality. +#endif + public MatOfUShort(MatOfUShort m, params Range[] ranges) + : base(m, ranges) + { + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// これらのコンストラクタによってデータがコピーされる事はありません. + /// 代わりに,データ m ,またはその部分配列を指し示すヘッダが作成され, + /// 関連した参照カウンタがあれば,それがインクリメントされます. + /// つまり,新しく作成された配列の内容を変更することで, m の対応する要素も + /// 変更することになります.もし部分配列の独立したコピーが必要ならば, + /// Mat.Clone() を利用してください. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// No data is copied by these constructors. Instead, the header pointing to m data or its sub-array + /// is constructed and associated with it. The reference counter, if any, is incremented. + /// So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . + /// If you want to have an independent copy of the sub-array, use Mat.Clone() . + /// Region of interest. +#endif + public MatOfUShort(MatOfUShort m, Rect roi) + : base(m, roi) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfUShort(int rows, int cols, IntPtr data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfUShort(int rows, int cols, ushort[] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public MatOfUShort(int rows, int cols, ushort[,] data, long step = 0) + : base(rows, cols, ThisType, data, step) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// Array of integers specifying an n-dimensional array shape. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfUShort(IEnumerable sizes, IntPtr data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfUShort(IEnumerable sizes, ushort[] data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 多次元配列における ndims-1 個のステップを表す配列 + /// (最後のステップは常に要素サイズになります).これが指定されないと, + /// 行列は連続したものとみなされます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Array of integers specifying an n-dimensional array shape. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Array of ndims-1 steps in case of a multi-dimensional array (the last step is always set to the element size). + /// If not specified, the matrix is assumed to be continuous. +#endif + public MatOfUShort(IEnumerable sizes, Array data, IEnumerable steps = null) + : base(sizes, ThisType, data, steps) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. +#endif + public MatOfUShort(IEnumerable sizes) + : base(sizes, ThisType) + { + } + +#if LANG_JP + /// + /// N次元行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constructs n-dimensional matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public MatOfUShort(IEnumerable sizes, ushort s) + : base(sizes, ThisType, s) + { + } + + #endregion + + #region Indexer + /// + /// Matrix indexer + /// + public sealed unsafe class Indexer : MatIndexer + { + private readonly byte *ptr; + + internal Indexer(Mat parent) + : base(parent) + { + ptr = (byte*)parent.Data.ToPointer(); + } + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// A value to the specified array element. + public override ushort this[int i0] + { + get + { + return *(ushort*)(ptr + (steps[0] * i0)); + } + set + { + *(ushort*)(ptr + (steps[0] * i0)) = value; + } + } + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override ushort this[int i0, int i1] + { + get + { + return *(ushort*)(ptr + (steps[0] * i0) + (steps[1] * i1)); + } + set + { + *(ushort*)(ptr + (steps[0] * i0) + (steps[1] * i1)) = value; + } + } + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// A value to the specified array element. + public override ushort this[int i0, int i1, int i2] + { + get + { + return *(ushort*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)); + } + set + { + *(ushort*)(ptr + (steps[0] * i0) + (steps[1] * i1) + (steps[2] * i2)) = value; + } + } + + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// A value to the specified array element. + public override ushort this[params int[] idx] + { + get + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + return *(ushort*)(ptr + offset); + } + set + { + long offset = 0; + for (int i = 0; i < idx.Length; i++) + { + offset += steps[i] * idx[i]; + } + *(ushort*)(ptr + offset) = value; + } + } + } + /// + /// Gets a type-specific indexer. The indexer has getters/setters to access each matrix element. + /// + /// + public override MatIndexer GetIndexer() + { + return new Indexer(this); + } + #endregion + + #region FromArray +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfUShort FromArray(params ushort[] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int numElems = arr.Length / ThisChannels; + var mat = new MatOfUShort(numElems, 1); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// M x N の行列として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as M x N matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfUShort FromArray(ushort[,] arr) + { + if (arr == null) + throw new ArgumentNullException("arr"); + if (arr.Length == 0) + throw new ArgumentException("arr.Length == 0"); + + int rows = arr.GetLength(0); + int cols = arr.GetLength(1); + var mat = new MatOfUShort(rows, cols); + mat.SetArray(0, 0, arr); + return mat; + } +#if LANG_JP + /// + /// N x 1 の行列(ベクトル)として初期化し、指定した配列からデータをコピーする + /// + /// この行列にコピーされるデータ +#else + /// + /// Initializes as N x 1 matrix and copys array data to this + /// + /// Source array data to be copied to this +#endif + public static MatOfUShort FromArray(IEnumerable enumerable) + { + return FromArray(EnumerableEx.ToArray(enumerable)); + } + #endregion + + #region ToArray + /// + /// Convert this mat to managed array + /// + /// + public override ushort[] ToArray() + { + long numOfElems = (long)Total(); + if (numOfElems == 0) + return new ushort[0]; + ushort[] arr = new ushort[numOfElems]; + GetArray(0, 0, arr); + return arr; + } + /// + /// Convert this mat to managed rectangular array + /// + /// + public override ushort[,] ToRectangularArray() + { + if (Rows == 0 || Cols == 0) + return new ushort[0, 0]; + ushort[,] arr = new ushort[Rows, Cols]; + GetArray(0, 0, arr); + return arr; + } + #endregion + + #region GetEnumerator + /// + /// + /// + /// + public override IEnumerator GetEnumerator() + { + ThrowIfDisposed(); + Indexer indexer = new Indexer(this); + + int dims = Dims(); + if (dims == 2) + { + int rows = Rows; + int cols = Cols; + for (int r = 0; r < rows; r++) + { + for (int c = 0; c < cols; c++) + { + yield return indexer[r, c]; + } + } + } + else + { + throw new NotImplementedException("GetEnumerator supports only 2-dimensional Mat"); + } + } + #endregion + + /// + /// Adds elements to the bottom of the matrix. (Mat::push_back) + /// + /// Added element(s) + public override void Add(ushort value) + { + ThrowIfDisposed(); + NativeMethods.core_Mat_push_back_ushort(ptr, value); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Mat/Mat_CvMethods.cs b/src/OpenCvSharp/modules/core/Mat/Mat_CvMethods.cs new file mode 100644 index 000000000..9b8218d83 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Mat/Mat_CvMethods.cs @@ -0,0 +1,2619 @@ +using System; +using System.Collections.Generic; + +namespace OpenCvSharp +{ + partial class Mat + { + #region core + + /// + /// Computes absolute value of each matrix element + /// + /// + public MatExpr Abs() + { + return Cv2.Abs(this); + } + +#if LANG_JP + /// + /// スケーリング後,絶対値を計算し,結果を結果を 8 ビットに変換します. + /// + /// オプションのスケールファクタ. [既定値は1] + /// スケーリングされた値に加えられるオプション値. [既定値は0] + /// +#else + /// + /// Scales, computes absolute values and converts the result to 8-bit. + /// + /// The optional scale factor. [By default this is 1] + /// The optional delta added to the scaled values. [By default this is 0] + /// +#endif + public Mat ConvertScaleAbs(double alpha = 1, double beta = 0) + { + var dst = new Mat(); + Cv2.ConvertScaleAbs(this, dst, alpha, beta); + return dst; + } + + /// + /// transforms array of numbers using a lookup table: dst(i)=lut(src(i)) + /// + /// Look-up table of 256 elements. + /// In the case of multi-channel source array, the table should either have + /// a single channel (in this case the same table is used for all channels) + /// or the same number of channels as in the source array + /// + /// + public Mat LUT(InputArray lut, int interpolation = 0) + { + var dst = new Mat(); + Cv2.LUT(this, lut, dst, interpolation); + return dst; + } + + /// + /// transforms array of numbers using a lookup table: dst(i)=lut(src(i)) + /// + /// Look-up table of 256 elements. + /// In the case of multi-channel source array, the table should either have + /// a single channel (in this case the same table is used for all channels) + /// or the same number of channels as in the source array + /// + /// + public Mat LUT(byte[] lut, int interpolation = 0) + { + var dst = new Mat(); + Cv2.LUT(this, lut, dst, interpolation); + return dst; + } + + /// + /// computes sum of array elements + /// + /// + public Scalar Sum() + { + return Cv2.Sum(this); + } + + /// + /// computes the number of nonzero array elements + /// + /// number of non-zero elements in mtx + public int CountNonZero() + { + return Cv2.CountNonZero(this); + } + + /// + /// returns the list of locations of non-zero pixels + /// + /// + public Mat FindNonZero() + { + var idx = new Mat(); + Cv2.FindNonZero(this, idx); + return idx; + } + + /// + /// computes mean value of selected array elements + /// + /// The optional operation mask + /// + public Scalar Mean(InputArray mask = null) + { + return Cv2.Mean(this, mask); + } + + /// + /// computes mean value and standard deviation of all or selected array elements + /// + /// The output parameter: computed mean value + /// The output parameter: computed standard deviation + /// The optional operation mask + public void MeanStdDev(OutputArray mean, OutputArray stddev, InputArray mask = null) + { + Cv2.MeanStdDev(this, mean, stddev, mask); + } + + /// + /// computes norm of the selected array part + /// + /// Type of the norm + /// The optional operation mask + /// + public double Norm(NormTypes normType = NormTypes.L2, InputArray mask = null) + { + return Cv2.Norm(this, normType, mask); + } + + /// + /// scales and shifts array elements so that either the specified norm (alpha) + /// or the minimum (alpha) and maximum (beta) array values get the specified values + /// + /// The norm value to normalize to or the lower range boundary + /// in the case of range normalization + /// The upper range boundary in the case of range normalization; + /// not used for norm normalization + /// The normalization type + /// When the parameter is negative, + /// the destination array will have the same type as src, + /// otherwise it will have the same number of channels as src and the depth =CV_MAT_DEPTH(rtype) + /// The optional operation mask + /// + public Mat Normalize(double alpha = 1, double beta = 0, + NormTypes normType = NormTypes.L2, int dtype = -1, InputArray mask = null) + { + var dst = new Mat(); + Cv2.Normalize(this, dst, alpha, beta, normType, dtype, mask); + return dst; + } + + /// + /// finds global minimum and maximum array elements and returns their values and their locations + /// + /// Pointer to returned minimum value + /// Pointer to returned maximum value + public void MinMaxLoc(out double minVal, out double maxVal) + { + Cv2.MinMaxLoc(this, out minVal, out maxVal); + } + + /// + /// finds global minimum and maximum array elements and returns their values and their locations + /// + /// Pointer to returned minimum location + /// Pointer to returned maximum location + public void MinMaxLoc(out Point minLoc, out Point maxLoc) + { + Cv2.MinMaxLoc(this, out minLoc, out maxLoc); + } + + /// + /// finds global minimum and maximum array elements and returns their values and their locations + /// + /// Pointer to returned minimum value + /// Pointer to returned maximum value + /// Pointer to returned minimum location + /// Pointer to returned maximum location + /// The optional mask used to select a sub-array + public void MinMaxLoc(out double minVal, out double maxVal, + out Point minLoc, out Point maxLoc, InputArray mask = null) + { + Cv2.MinMaxLoc(this, out minVal, out maxVal, out minLoc, out maxLoc, mask); + } + + /// + /// finds global minimum and maximum array elements and returns their values and their locations + /// + /// Pointer to returned minimum value + /// Pointer to returned maximum value + public void MinMaxIdx(out double minVal, out double maxVal) + { + Cv2.MinMaxIdx(this, out minVal, out maxVal); + } + + /// + /// finds global minimum and maximum array elements and returns their values and their locations + /// + /// + /// + public void MinMaxIdx(out int minIdx, out int maxIdx) + { + Cv2.MinMaxIdx(this, out minIdx, out maxIdx); + } + + /// + /// finds global minimum and maximum array elements and returns their values and their locations + /// + /// Pointer to returned minimum value + /// Pointer to returned maximum value + /// + /// + /// + public void MinMaxIdx(out double minVal, out double maxVal, + out int minIdx, out int maxIdx, InputArray mask = null) + { + Cv2.MinMaxIdx(this, out minVal, out maxVal, out minIdx, out maxIdx, mask); + } + + /// + /// transforms 2D matrix to 1D row or column vector by taking sum, minimum, maximum or mean value over all the rows + /// + /// The dimension index along which the matrix is reduced. + /// 0 means that the matrix is reduced to a single row and 1 means that the matrix is reduced to a single column + /// + /// When it is negative, the destination vector will have + /// the same type as the source matrix, otherwise, its type will be CV_MAKE_TYPE(CV_MAT_DEPTH(dtype), mtx.channels()) + /// + public Mat Reduce(ReduceDimension dim, ReduceTypes rtype, int dtype) + { + var dst = new Mat(); + Cv2.Reduce(this, dst, dim, rtype, dtype); + return dst; + } + + /// + /// Copies each plane of a multi-channel array to a dedicated array + /// + /// The number of arrays must match mtx.channels() . + /// The arrays themselves will be reallocated if needed + public Mat[] Split() + { + return Cv2.Split(this); + } + + /// + /// extracts a single channel from src (coi is 0-based index) + /// + /// + /// + public Mat ExtractChannel(int coi) + { + var dst = new Mat(); + Cv2.ExtractChannel(this, dst, coi); + return dst; + } + + /// + /// inserts a single channel to dst (coi is 0-based index) + /// + /// + /// + public void InsertChannel(InputOutputArray dst, int coi) + { + Cv2.InsertChannel(this, dst, coi); + } + + /// + /// reverses the order of the rows, columns or both in a matrix + /// + /// Specifies how to flip the array: + /// 0 means flipping around the x-axis, positive (e.g., 1) means flipping around y-axis, + /// and negative (e.g., -1) means flipping around both axes. See also the discussion below for the formulas. + /// The destination array; will have the same size and same type as src + public Mat Flip(FlipMode flipCode) + { + var dst = new Mat(); + Cv2.Flip(this, dst, flipCode); + return dst; + } + + /// + /// replicates the input matrix the specified number of times in the horizontal and/or vertical direction + /// + /// How many times the src is repeated along the vertical axis + /// How many times the src is repeated along the horizontal axis + /// + public Mat Repeat(int ny, int nx) + { + var dst = new Mat(); + Cv2.Repeat(this, ny, nx, dst); + return dst; + } + + /// + /// set mask elements for those array elements which are within the element-specific bounding box (dst = lowerb <= src && src < upperb) + /// + /// The inclusive lower boundary array of the same size and type as src + /// The exclusive upper boundary array of the same size and type as src + /// The destination array, will have the same size as src and CV_8U type + public Mat InRange(InputArray lowerb, InputArray upperb) + { + var dst = new Mat(); + Cv2.InRange(this, lowerb, upperb, dst); + return dst; + } + + /// + /// set mask elements for those array elements which are within the element-specific bounding box (dst = lowerb <= src && src < upperb) + /// + /// The inclusive lower boundary array of the same size and type as src + /// The exclusive upper boundary array of the same size and type as src + /// The destination array, will have the same size as src and CV_8U type + public Mat InRange(Scalar lowerb, Scalar upperb) + { + var dst = new Mat(); + Cv2.InRange(this, lowerb, upperb, dst); + return dst; + } + + /// + /// computes square root of each matrix element (dst = src**0.5) + /// + /// The destination array; will have the same size and the same type as src + public Mat Sqrt() + { + var dst = new Mat(); + Cv2.Sqrt(this, dst); + return dst; + } + + /// + /// raises the input matrix elements to the specified power (b = a**power) + /// + /// The exponent of power + /// The destination array; will have the same size and the same type as src + public Mat Pow(double power) + { + var dst = new Mat(); + Cv2.Pow(this, power, dst); + return dst; + } + + /// + /// computes exponent of each matrix element (dst = e**src) + /// + /// The destination array; will have the same size and same type as src + public Mat Exp() + { + var dst = new Mat(); + Cv2.Exp(this, dst); + return dst; + } + + /// + /// computes natural logarithm of absolute value of each matrix element: dst = log(abs(src)) + /// + /// The destination array; will have the same size and same type as src + public Mat Log() + { + var dst = new Mat(); + Cv2.Log(this, dst); + return dst; + } + + /// + /// checks that each matrix element is within the specified range. + /// + /// The flag indicating whether the functions quietly + /// return false when the array elements are out of range, + /// or they throw an exception. + /// + public bool CheckRange(bool quiet = true) + { + return Cv2.CheckRange(this, quiet); + } + + /// + /// checks that each matrix element is within the specified range. + /// + /// The flag indicating whether the functions quietly + /// return false when the array elements are out of range, + /// or they throw an exception. + /// The optional output parameter, where the position of + /// the first outlier is stored. + /// The inclusive lower boundary of valid values range + /// The exclusive upper boundary of valid values range + /// + public bool CheckRange(bool quiet, out Point pos, + double minVal = double.MinValue, double maxVal = double.MaxValue) + { + return Cv2.CheckRange(this, quiet, out pos, minVal, maxVal); + } + + /// + /// converts NaN's to the given number + /// + /// + public void PatchNaNs(double val = 0) + { + Cv2.PatchNaNs(this, val); + } + + /// + /// multiplies matrix by its transposition from the left or from the right + /// + /// Specifies the multiplication ordering; see the description below + /// The optional delta matrix, subtracted from src before the + /// multiplication. When the matrix is empty ( delta=Mat() ), it’s assumed to be + /// zero, i.e. nothing is subtracted, otherwise if it has the same size as src, + /// then it’s simply subtracted, otherwise it is "repeated" to cover the full src + /// and then subtracted. Type of the delta matrix, when it's not empty, must be the + /// same as the type of created destination matrix, see the rtype description + /// The optional scale factor for the matrix product + /// When it’s negative, the destination matrix will have the + /// same type as src . Otherwise, it will have type=CV_MAT_DEPTH(rtype), + /// which should be either CV_32F or CV_64F + public Mat MulTransposed(bool aTa, InputArray delta = null, double scale = 1, int dtype = -1) + { + var dst = new Mat(); + Cv2.MulTransposed(this, dst, aTa, delta, scale, dtype); + return dst; + } + + /// + /// transposes the matrix + /// + /// The destination array of the same type as src + public Mat Transpose() + { + var dst = new Mat(); + Cv2.Transpose(this, dst); + return dst; + } + + /// + /// performs affine transformation of each element of multi-channel input matrix + /// + /// The transformation matrix + /// The destination array; will have the same size and depth as src and as many channels as mtx.rows + public Mat Transform(InputArray m) + { + var dst = new Mat(); + Cv2.Transform(this, dst, m); + return dst; + } + + /// + /// performs perspective transformation of each element of multi-channel input matrix + /// + /// 3x3 or 4x4 transformation matrix + /// The destination array; it will have the same size and same type as src + public Mat PerspectiveTransform(InputArray m) + { + var dst = new Mat(); + Cv2.PerspectiveTransform(this, dst, m); + return dst; + } + + /// + /// extends the symmetrical matrix from the lower half or from the upper half + /// + /// If true, the lower half is copied to the upper half, + /// otherwise the upper half is copied to the lower half + public void CompleteSymm(bool lowerToUpper = false) + { + Cv2.CompleteSymm(this, lowerToUpper); + } + + /// + /// initializes scaled identity matrix (not necessarily square). + /// + /// The value to assign to the diagonal elements + public void SetIdentity(Scalar? s = null) + { + Cv2.SetIdentity(this, s); + } + + /// + /// computes determinant of a square matrix. + /// The input matrix must have CV_32FC1 or CV_64FC1 type and square size. + /// + /// determinant of the specified matrix. + public double Determinant() + { + return Cv2.Determinant(this); + } + + /// + /// computes trace of a matrix + /// + /// + public Scalar Trace() + { + return Cv2.Trace(this); + } + + /// + /// sorts independently each matrix row or each matrix column + /// + /// The operation flags, a combination of the SortFlag values + /// The destination array of the same size and the same type as src + public Mat Sort(SortFlags flags) + { + var dst = new Mat(); + Cv2.Sort(this, dst, flags); + return dst; + } + + /// + /// sorts independently each matrix row or each matrix column + /// + /// The operation flags, a combination of SortFlag values + /// The destination integer array of the same size as src + public Mat SortIdx(SortFlags flags) + { + var dst = new Mat(); + Cv2.SortIdx(this, dst, flags); + return dst; + } + + /// + /// Performs a forward Discrete Fourier transform of 1D or 2D floating-point array. + /// + /// Transformation flags, a combination of the DftFlag2 values + /// When the parameter != 0, the function assumes that + /// only the first nonzeroRows rows of the input array ( DFT_INVERSE is not set) + /// or only the first nonzeroRows of the output array ( DFT_INVERSE is set) contain non-zeros, + /// thus the function can handle the rest of the rows more efficiently and + /// thus save some time. This technique is very useful for computing array cross-correlation + /// or convolution using DFT + /// The destination array, which size and type depends on the flags + public Mat Dft(DftFlags flags = 0, int nonzeroRows = 0) + { + var dst = new Mat(); + Cv2.Dft(this, dst, flags, nonzeroRows); + return dst; + } + + /// + /// Performs an inverse Discrete Fourier transform of 1D or 2D floating-point array. + /// + /// Transformation flags, a combination of the DftFlag2 values + /// When the parameter != 0, the function assumes that + /// only the first nonzeroRows rows of the input array ( DFT_INVERSE is not set) + /// or only the first nonzeroRows of the output array ( DFT_INVERSE is set) contain non-zeros, + /// thus the function can handle the rest of the rows more efficiently and + /// thus save some time. This technique is very useful for computing array cross-correlation + /// or convolution using DFT + /// The destination array, which size and type depends on the flags + public Mat Idft(DftFlags flags = 0, int nonzeroRows = 0) + { + var dst = new Mat(); + Cv2.Idft(this, dst, flags, nonzeroRows); + return dst; + } + + /// + /// performs forward or inverse 1D or 2D Discrete Cosine Transformation + /// + /// Transformation flags, a combination of DctFlag2 values + /// The destination array; will have the same size and same type as src + public Mat Dct(DctFlags flags = 0) + { + var dst = new Mat(); + Cv2.Dct(this, dst, flags); + return dst; + } + + /// + /// performs inverse 1D or 2D Discrete Cosine Transformation + /// + /// Transformation flags, a combination of DctFlag2 values + /// The destination array; will have the same size and same type as src + public Mat Idct(DctFlags flags = 0) + { + var dst = new Mat(); + Cv2.Idct(this, dst, flags); + return dst; + } + + /// + /// fills array with uniformly-distributed random numbers from the range [low, high) + /// + /// The inclusive lower boundary of the generated random numbers + /// The exclusive upper boundary of the generated random numbers + public void Randu(InputArray low, InputArray high) + { + Cv2.Randu(this, low, high); + } + + /// + /// fills array with uniformly-distributed random numbers from the range [low, high) + /// + /// The inclusive lower boundary of the generated random numbers + /// The exclusive upper boundary of the generated random numbers + public void Randu(Scalar low, Scalar high) + { + Cv2.Randu(this, low, high); + } + + /// + /// fills array with normally-distributed random numbers with the specified mean and the standard deviation + /// + /// The mean value (expectation) of the generated random numbers + /// The standard deviation of the generated random numbers + public void Randn(InputArray mean, InputArray stddev) + { + Cv2.Randn(this, mean, stddev); + } + + /// + /// fills array with normally-distributed random numbers with the specified mean and the standard deviation + /// + /// The mean value (expectation) of the generated random numbers + /// The standard deviation of the generated random numbers + public void Randn(Scalar mean, Scalar stddev) + { + Cv2.Randn(this, mean, stddev); + } + + /// + /// shuffles the input array elements + /// + /// The scale factor that determines the number of random swap operations. + /// The optional random number generator used for shuffling. + /// If it is null, theRng() is used instead. + /// The input/output numerical 1D array + public void RandShuffle(double iterFactor, RNG rng = null) + { + Cv2.RandShuffle(this, iterFactor, rng); + } + + #region Drawing + + #region Line + +#if LANG_JP + /// + /// 2点を結ぶ線分を画像上に描画する. + /// + /// 線分の1番目の端点x + /// 線分の1番目の端点y + /// 線分の2番目の端点x + /// 線分の2番目の端点y + /// 線分の色 + /// 線分の太さ. [既定値は1] + /// 線分の種類. [既定値はLineType.Link8] + /// 座標の小数点以下の桁を表すビット数. [既定値は0] +#else + /// + /// Draws a line segment connecting two points + /// + /// First point's x-coordinate of the line segment. + /// First point's y-coordinate of the line segment. + /// Second point's x-coordinate of the line segment. + /// Second point's y-coordinate of the line segment. + /// Line color. + /// Line thickness. [By default this is 1] + /// Type of the line. [By default this is LineType.Link8] + /// Number of fractional bits in the point coordinates. [By default this is 0] +#endif + public void Line(int pt1X, int pt1Y, int pt2X, int pt2Y, Scalar color, + int thickness = 1, LineTypes lineType = LineTypes.Link8, int shift = 0) + { + Cv2.Line(this, pt1X, pt1Y, pt2X, pt2Y, color, thickness, lineType, shift); + } + +#if LANG_JP + /// + /// 2点を結ぶ線分を画像上に描画する. + /// + /// 線分の1番目の端点 + /// 線分の2番目の端点 + /// 線分の色 + /// 線分の太さ. [既定値は1] + /// 線分の種類. [既定値はLineType.Link8] + /// 座標の小数点以下の桁を表すビット数. [既定値は0] +#else + /// + /// Draws a line segment connecting two points + /// + /// First point of the line segment. + /// Second point of the line segment. + /// Line color. + /// Line thickness. [By default this is 1] + /// Type of the line. [By default this is LineType.Link8] + /// Number of fractional bits in the point coordinates. [By default this is 0] +#endif + public void Line( + Point pt1, Point pt2, Scalar color, int thickness = 1, + LineTypes lineType = LineTypes.Link8, int shift = 0) + { + Cv2.Line(this, pt1, pt2, color, thickness, lineType, shift); + } + + #endregion + + #region Rectangle + +#if LANG_JP + /// + /// 枠のみ,もしくは塗りつぶされた矩形を描画する + /// + /// 矩形の一つの頂点 + /// 矩形の反対側の頂点 + /// 線の色(RGB),もしくは輝度(グレースケール画像). + /// 矩形を描く線の太さ.負の値を指定した場合は塗りつぶされる. [既定値は1] + /// 線の種類. [既定値はLineType.Link8] + /// 座標の小数点以下の桁を表すビット数. [既定値は0] +#else + /// + /// Draws simple, thick or filled rectangle + /// + /// One of the rectangle vertices. + /// Opposite rectangle vertex. + /// Line color (RGB) or brightness (grayscale image). + /// Thickness of lines that make up the rectangle. Negative values make the function to draw a filled rectangle. [By default this is 1] + /// Type of the line, see cvLine description. [By default this is LineType.Link8] + /// Number of fractional bits in the point coordinates. [By default this is 0] +#endif + public void Rectangle( + Point pt1, Point pt2, Scalar color, int thickness = 1, + LineTypes lineType = LineTypes.Link8, int shift = 0) + { + Cv2.Rectangle(this, pt1, pt2, color, thickness, lineType, shift); + } + +#if LANG_JP + /// + /// 枠のみ,もしくは塗りつぶされた矩形を描画する + /// + /// 矩形 + /// 線の色(RGB),もしくは輝度(グレースケール画像). + /// 矩形を描く線の太さ.負の値を指定した場合は塗りつぶされる. [既定値は1] + /// 線の種類. [既定値はLineType.Link8] + /// 座標の小数点以下の桁を表すビット数. [既定値は0] +#else + /// + /// Draws simple, thick or filled rectangle + /// + /// Rectangle. + /// Line color (RGB) or brightness (grayscale image). + /// Thickness of lines that make up the rectangle. Negative values make the function to draw a filled rectangle. [By default this is 1] + /// Type of the line, see cvLine description. [By default this is LineType.Link8] + /// Number of fractional bits in the point coordinates. [By default this is 0] +#endif + public void Rectangle( + Rect rect, Scalar color, int thickness = 1, + LineTypes lineType = LineTypes.Link8, int shift = 0) + { + Cv2.Rectangle(this, rect, color, thickness, lineType, shift); + } + + #endregion + + #region Circle + +#if LANG_JP + /// + /// 円を描画する + /// + /// 円の中心のx座標 + /// 円の中心のy座標 + /// 円の半径 + /// 円の色 + /// 線の幅.負の値を指定した場合は塗りつぶされる.[既定値は1] + /// 線の種類. [既定値はLineType.Link8] + /// 中心座標と半径の小数点以下の桁を表すビット数. [既定値は0] +#else + /// + /// Draws a circle + /// + /// X-coordinate of the center of the circle. + /// Y-coordinate of the center of the circle. + /// Radius of the circle. + /// Circle color. + /// Thickness of the circle outline if positive, otherwise indicates that a filled circle has to be drawn. [By default this is 1] + /// Type of the circle boundary. [By default this is LineType.Link8] + /// Number of fractional bits in the center coordinates and radius value. [By default this is 0] +#endif + public void Circle(int centerX, int centerY, int radius, Scalar color, + int thickness = 1, LineTypes lineType = LineTypes.Link8, int shift = 0) + { + Cv2.Circle(this, centerX, centerY, radius, color, thickness, lineType, shift); + } + +#if LANG_JP + /// + /// 円を描画する + /// + /// 円の中心 + /// 円の半径 + /// 円の色 + /// 線の幅.負の値を指定した場合は塗りつぶされる.[既定値は1] + /// 線の種類. [既定値はLineType.Link8] + /// 中心座標と半径の小数点以下の桁を表すビット数. [既定値は0] +#else + /// + /// Draws a circle + /// + /// Center of the circle. + /// Radius of the circle. + /// Circle color. + /// Thickness of the circle outline if positive, otherwise indicates that a filled circle has to be drawn. [By default this is 1] + /// Type of the circle boundary. [By default this is LineType.Link8] + /// Number of fractional bits in the center coordinates and radius value. [By default this is 0] +#endif + public void Circle(Point center, int radius, Scalar color, + int thickness = 1, LineTypes lineType = LineTypes.Link8, int shift = 0) + { + Cv2.Circle(this, center, radius, color, thickness, lineType, shift); + } + + #endregion + + #region Ellipse + +#if LANG_JP + /// + /// 枠だけの楕円,楕円弧,もしくは塗りつぶされた扇形の楕円を描画する + /// + /// 楕円の中心 + /// 楕円の軸の長さ + /// 回転角度 + /// 楕円弧の開始角度 + /// 楕円弧の終了角度 + /// 楕円の色 + /// 楕円弧の線の幅 [既定値は1] + /// 楕円弧の線の種類 [既定値はLineType.Link8] + /// 中心座標と軸の長さの小数点以下の桁を表すビット数 [既定値は0] +#else + /// + /// Draws simple or thick elliptic arc or fills ellipse sector + /// + /// Center of the ellipse. + /// Length of the ellipse axes. + /// Rotation angle. + /// Starting angle of the elliptic arc. + /// Ending angle of the elliptic arc. + /// Ellipse color. + /// Thickness of the ellipse arc. [By default this is 1] + /// Type of the ellipse boundary. [By default this is LineType.Link8] + /// Number of fractional bits in the center coordinates and axes' values. [By default this is 0] +#endif + public void Ellipse( + Point center, Size axes, double angle, double startAngle, double endAngle, Scalar color, + int thickness = 1, LineTypes lineType = LineTypes.Link8, int shift = 0) + { + Cv2.Ellipse(this, center, axes, angle, startAngle, endAngle, color, thickness, lineType, shift); + } + +#if LANG_JP + /// + /// 枠だけの楕円,もしくは塗りつぶされた楕円を描画する + /// + /// 描画したい楕円を囲む矩形領域. + /// 楕円の色. + /// 楕円境界線の幅.[既定値は1] + /// 楕円境界線の種類.[既定値はLineType.Link8] +#else + /// + /// Draws simple or thick elliptic arc or fills ellipse sector + /// + /// The enclosing box of the ellipse drawn + /// Ellipse color. + /// Thickness of the ellipse boundary. [By default this is 1] + /// Type of the ellipse boundary. [By default this is LineType.Link8] +#endif + public void Ellipse(RotatedRect box, Scalar color, + int thickness = 1, LineTypes lineType = LineTypes.Link8) + { + Cv2.Ellipse(this, box, color, thickness, lineType); + } + + #endregion + + #region FillConvexPoly + +#if LANG_JP + /// + /// 塗りつぶされた凸ポリゴンを描きます. + /// + /// ポリゴンの頂点. + /// ポリゴンの色. + /// ポリゴンの枠線の種類, + /// ポリゴンの頂点座標において,小数点以下の桁を表すビット数. +#else + /// + /// Fills a convex polygon. + /// + /// The polygon vertices + /// Polygon color + /// Type of the polygon boundaries + /// The number of fractional bits in the vertex coordinates +#endif + public void FillConvexPoly(IEnumerable pts, Scalar color, + LineTypes lineType = LineTypes.Link8, int shift = 0) + { + Cv2.FillConvexPoly(this, pts, color, lineType, shift); + } + + #endregion + + #region FillPoly + +#if LANG_JP + /// + /// 1つ,または複数のポリゴンで区切られた領域を塗りつぶします. + /// + /// ポリゴンの配列.各要素は,点の配列で表現されます. + /// ポリゴンの色. + /// ポリゴンの枠線の種類, + /// ポリゴンの頂点座標において,小数点以下の桁を表すビット数. + /// +#else + /// + /// Fills the area bounded by one or more polygons + /// + /// Array of polygons, each represented as an array of points + /// Polygon color + /// Type of the polygon boundaries + /// The number of fractional bits in the vertex coordinates + /// +#endif + public void FillPoly(IEnumerable> pts, Scalar color, + LineTypes lineType = LineTypes.Link8, int shift = 0, Point? offset = null) + { + Cv2.FillPoly(this, pts, color, lineType, shift, offset); + } + + #endregion + + #region Polylines + + /// + /// draws one or more polygonal curves + /// + /// + /// + /// + /// + /// + /// + public void Polylines(IEnumerable> pts, bool isClosed, Scalar color, + int thickness = 1, LineTypes lineType = LineTypes.Link8, int shift = 0) + { + Cv2.Polylines(this, pts, isClosed, color, thickness, lineType, shift); + } + + #endregion + + #region PutText + + /// + /// renders text string in the image + /// + /// + /// + /// + /// + /// + /// + /// + /// + public void PutText(string text, Point org, + HersheyFonts fontFace, double fontScale, Scalar color, + int thickness = 1, + LineTypes lineType = LineTypes.Link8, + bool bottomLeftOrigin = false) + { + Cv2.PutText(this, text, org, fontFace, fontScale, color, thickness, lineType, bottomLeftOrigin); + } + + #endregion + + #region ImEncode / ToBytes + + /// + /// Encodes an image into a memory buffer. + /// + /// Encodes an image into a memory buffer. + /// Format-specific parameters. + /// + public byte[] ImEncode(string ext = ".png", int[] prms = null) + { + byte[] buf; + Cv2.ImEncode(ext, this, out buf, prms); + return buf; + } + + /// + /// Encodes an image into a memory buffer. + /// + /// Encodes an image into a memory buffer. + /// Format-specific parameters. + /// + public byte[] ImEncode(string ext = ".png", params ImageEncodingParam[] prms) + { + byte[] buf; + Cv2.ImEncode(ext, this, out buf, prms); + return buf; + } + + #endregion + + #region ImWrite / SaveImage + + /// + /// Saves an image to a specified file. + /// + /// + /// + /// + public bool ImWrite(string fileName, int[] prms = null) + { + return Cv2.ImWrite(fileName, this, prms); + } + + /// + /// Saves an image to a specified file. + /// + /// + /// + /// + public bool ImWrite(string fileName, params ImageEncodingParam[] prms) + { + return Cv2.ImWrite(fileName, this, prms); + } + + /// + /// Saves an image to a specified file. + /// + /// + /// + /// + public bool SaveImage(string fileName, int[] prms = null) + { + return Cv2.ImWrite(fileName, this, prms); + } + + /// + /// Saves an image to a specified file. + /// + /// + /// + /// + public bool SaveImage(string fileName, params ImageEncodingParam[] prms) + { + return Cv2.ImWrite(fileName, this, prms); + } + + #endregion + + #endregion + + #endregion + + #region imgproc + + /// + /// Forms a border around the image + /// + /// Specify how much pixels in each direction from the source image rectangle one needs to extrapolate + /// Specify how much pixels in each direction from the source image rectangle one needs to extrapolate + /// Specify how much pixels in each direction from the source image rectangle one needs to extrapolate + /// Specify how much pixels in each direction from the source image rectangle one needs to extrapolate + /// The border type + /// The border value if borderType == Constant + public Mat CopyMakeBorder(int top, int bottom, int left, int right, BorderTypes borderType, Scalar? value = null) + { + var dst = new Mat(); + Cv2.CopyMakeBorder(this, dst, top, bottom, left, right, borderType, value); + return dst; + } + + /// + /// Smoothes image using median filter. + /// The source image must have 1-, 3- or 4-channel and + /// its depth should be CV_8U , CV_16U or CV_32F. + /// + /// The aperture linear size. It must be odd and more than 1, i.e. 3, 5, 7 ... + /// The destination array; will have the same size and the same type as src. + public Mat MedianBlur(int ksize) + { + var dst = new Mat(); + Cv2.MedianBlur(this, dst, ksize); + return dst; + } + + /// + /// Blurs an image using a Gaussian filter. + /// The input image can have any number of channels, which are processed independently, + /// but the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F. + /// + /// Gaussian kernel size. ksize.width and ksize.height can differ but they both must be positive and odd. + /// Or, they can be zero’s and then they are computed from sigma* . + /// Gaussian kernel standard deviation in X direction. + /// Gaussian kernel standard deviation in Y direction; if sigmaY is zero, it is set to be equal to sigmaX, + /// if both sigmas are zeros, they are computed from ksize.width and ksize.height, + /// respectively (see getGaussianKernel() for details); to fully control the result + /// regardless of possible future modifications of all this semantics, it is recommended to specify all of ksize, sigmaX, and sigmaY. + /// pixel extrapolation method + public Mat GaussianBlur(Size ksize, double sigmaX, + double sigmaY = 0, BorderTypes borderType = BorderTypes.Default) + { + var dst = new Mat(); + Cv2.GaussianBlur(this, dst, ksize, sigmaX, sigmaY, borderType); + return dst; + } + + /// + /// Applies bilateral filter to the image + /// The source image must be a 8-bit or floating-point, 1-channel or 3-channel image. + /// + /// The diameter of each pixel neighborhood, that is used during filtering. + /// If it is non-positive, it's computed from sigmaSpace + /// Filter sigma in the color space. + /// Larger value of the parameter means that farther colors within the pixel neighborhood + /// will be mixed together, resulting in larger areas of semi-equal color + /// Filter sigma in the coordinate space. + /// Larger value of the parameter means that farther pixels will influence each other + /// (as long as their colors are close enough; see sigmaColor). Then d>0 , it specifies + /// the neighborhood size regardless of sigmaSpace, otherwise d is proportional to sigmaSpace + /// + /// The destination image; will have the same size and the same type as src + public Mat BilateralFilter(int d, double sigmaColor, double sigmaSpace, + BorderTypes borderType = BorderTypes.Default) + { + var dst = new Mat(); + Cv2.BilateralFilter(this, dst, d, sigmaColor, sigmaSpace, borderType); + return dst; + } + + /* + /// + /// Applies the adaptive bilateral filter to an image. + /// + /// The kernel size. This is the neighborhood where the local variance will be calculated, + /// and where pixels will contribute (in a weighted manner). + /// Filter sigma in the coordinate space. + /// Larger value of the parameter means that farther pixels will influence each other + /// (as long as their colors are close enough; see sigmaColor). Then d>0, it specifies the neighborhood + /// size regardless of sigmaSpace, otherwise d is proportional to sigmaSpace. + /// Maximum allowed sigma color (will clamp the value calculated in the + /// ksize neighborhood. Larger value of the parameter means that more dissimilar pixels will + /// influence each other (as long as their colors are close enough; see sigmaColor). + /// Then d>0, it specifies the neighborhood size regardless of sigmaSpace, otherwise d is proportional to sigmaSpace. + /// The anchor point. The default value Point(-1,-1) means that the anchor is at the kernel center + /// Pixel extrapolation method. + /// The destination image; will have the same size and the same type as src + public Mat AdaptiveBilateralFilter(Size ksize, double sigmaSpace, + double maxSigmaColor = 20.0, Point? anchor = null, BorderTypes borderType = BorderTypes.Default) + { + var dst = new Mat(); + Cv2.AdaptiveBilateralFilter(this, dst, ksize, sigmaSpace, maxSigmaColor, anchor, borderType); + return dst; + } + */ + + /// + /// Smoothes image using box filter + /// + /// + /// The smoothing kernel size + /// The anchor point. The default value Point(-1,-1) means that the anchor is at the kernel center + /// Indicates, whether the kernel is normalized by its area or not + /// The border mode used to extrapolate pixels outside of the image + /// The destination image; will have the same size and the same type as src + public Mat BoxFilter(MatType ddepth, Size ksize, Point? anchor = null, + bool normalize = true, BorderTypes borderType = BorderTypes.Default) + { + var dst = new Mat(); + Cv2.BoxFilter(this, dst, ddepth, ksize, anchor, normalize, borderType); + return dst; + } + + /// + /// Smoothes image using normalized box filter + /// + /// The smoothing kernel size + /// The anchor point. The default value Point(-1,-1) means that the anchor is at the kernel center + /// The border mode used to extrapolate pixels outside of the image + /// The destination image; will have the same size and the same type as src + public Mat Blur(Size ksize, Point? anchor = null, + BorderTypes borderType = BorderTypes.Default) + { + var dst = new Mat(); + Cv2.Blur(this, dst, ksize, anchor, borderType); + return dst; + } + + /// + /// Convolves an image with the kernel + /// + /// The desired depth of the destination image. If it is negative, it will be the same as src.depth() + /// Convolution kernel (or rather a correlation kernel), + /// a single-channel floating point matrix. If you want to apply different kernels to + /// different channels, split the image into separate color planes using split() and process them individually + /// The anchor of the kernel that indicates the relative position of + /// a filtered point within the kernel. The anchor should lie within the kernel. + /// The special default value (-1,-1) means that the anchor is at the kernel center + /// The optional value added to the filtered pixels before storing them in dst + /// The pixel extrapolation method + /// The destination image. It will have the same size and the same number of channels as src + public Mat Filter2D(MatType ddepth, InputArray kernel, Point? anchor = null, + double delta = 0, BorderTypes borderType = BorderTypes.Default) + { + var dst = new Mat(); + Cv2.Filter2D(this, dst, ddepth, kernel, anchor, delta, borderType); + return dst; + } + + /// + /// Applies separable linear filter to an image + /// + /// The destination image depth + /// The coefficients for filtering each row + /// The coefficients for filtering each column + /// The anchor position within the kernel; The default value (-1, 1) means that the anchor is at the kernel center + /// The value added to the filtered results before storing them + /// The pixel extrapolation method + /// The destination image; will have the same size and the same number of channels as src + public Mat SepFilter2D(MatType ddepth, InputArray kernelX, InputArray kernelY, + Point? anchor = null, double delta = 0, BorderTypes borderType = BorderTypes.Default) + { + var dst = new Mat(); + Cv2.SepFilter2D(this, dst, ddepth, kernelX, kernelY, anchor, delta, borderType); + return dst; + } + + /// + /// Calculates the first, second, third or mixed image derivatives using an extended Sobel operator + /// + /// The destination image depth + /// Order of the derivative x + /// Order of the derivative y + /// Size of the extended Sobel kernel, must be 1, 3, 5 or 7 + /// The optional scale factor for the computed derivative values (by default, no scaling is applied + /// The optional delta value, added to the results prior to storing them in dst + /// The pixel extrapolation method + /// The destination image; will have the same size and the same number of channels as src + public Mat Sobel(MatType ddepth, int xorder, int yorder, + int ksize = 3, double scale = 1, double delta = 0, BorderTypes borderType = BorderTypes.Default) + { + var dst = new Mat(); + Cv2.Sobel(this, dst, ddepth, xorder, yorder, ksize, scale, delta, borderType); + return dst; + } + + /// + /// Calculates the first x- or y- image derivative using Scharr operator + /// + /// The destination image depth + /// Order of the derivative x + /// Order of the derivative y + /// The optional scale factor for the computed derivative values (by default, no scaling is applie + /// The optional delta value, added to the results prior to storing them in dst + /// The pixel extrapolation method + /// The destination image; will have the same size and the same number of channels as src + public Mat Scharr(MatType ddepth, int xorder, int yorder, + double scale = 1, double delta = 0, BorderTypes borderType = BorderTypes.Default) + { + var dst = new Mat(); + Cv2.Scharr(this, dst, ddepth, xorder, yorder, scale, delta, borderType); + return dst; + } + + /// + /// Calculates the Laplacian of an image + /// + /// The desired depth of the destination image + /// The aperture size used to compute the second-derivative filters + /// The optional scale factor for the computed Laplacian values (by default, no scaling is applied + /// The optional delta value, added to the results prior to storing them in dst + /// The pixel extrapolation method + /// Destination image; will have the same size and the same number of channels as src + public Mat Laplacian(MatType ddepth, + int ksize = 1, double scale = 1, double delta = 0, BorderTypes borderType = BorderTypes.Default) + { + var dst = new Mat(); + Cv2.Laplacian(this, dst, ddepth, ksize, scale, delta, borderType); + return dst; + } + +#if LANG_JP + /// + /// Cannyアルゴリズムを用いて,画像のエッジを検出します. + /// + /// ヒステリシスが存在する処理の,1番目の閾値 + /// ヒステリシスが存在する処理の,2番目の閾値 + /// Sobelオペレータのアパーチャサイズ [既定値はApertureSize.Size3] + /// 画像勾配の強度を求めるために,より精度の高い L2ノルムを利用するか,L1ノルムで十分(false)かを指定します. [既定値はfalse] + /// 出力されるエッジのマップ. image と同じサイズ,同じ型 +#else + /// + /// Finds edges in an image using Canny algorithm. + /// + /// The first threshold for the hysteresis procedure + /// The second threshold for the hysteresis procedure + /// Aperture size for the Sobel operator [By default this is ApertureSize.Size3] + /// Indicates, whether the more accurate L2 norm should be used to compute the image gradient magnitude (true), or a faster default L1 norm is enough (false). [By default this is false] + /// The output edge map. It will have the same size and the same type as image +#endif +// ReSharper disable once InconsistentNaming + public Mat Canny(double threshold1, double threshold2, int apertureSize = 3, bool L2gradient = false) + { + var dst = new Mat(); + Cv2.Canny(this, dst, threshold1, threshold2, apertureSize, L2gradient); + return dst; + } + + /// + /// computes both eigenvalues and the eigenvectors of 2x2 derivative covariation matrix at each pixel. The output is stored as 6-channel matrix. + /// + /// + /// + /// + public Mat CornerEigenValsAndVecs(int blockSize, int ksize, BorderTypes borderType = BorderTypes.Default) + { + var dst = new Mat(); + Cv2.CornerEigenValsAndVecs(this, dst, blockSize, ksize, borderType); + return dst; + } + + /// + /// computes another complex cornerness criteria at each pixel + /// + /// + /// + public Mat PreCornerDetect(int ksize, BorderTypes borderType = BorderTypes.Default) + { + var dst = new Mat(); + Cv2.PreCornerDetect(this, dst, ksize, borderType); + return dst; + } + + /// + /// adjusts the corner locations with sub-pixel accuracy to maximize the certain cornerness criteria + /// + /// Initial coordinates of the input corners and refined coordinates provided for output. + /// Half of the side length of the search window. + /// Half of the size of the dead region in the middle of the search zone + /// over which the summation in the formula below is not done. It is used sometimes to avoid possible singularities + /// of the autocorrelation matrix. The value of (-1,-1) indicates that there is no such a size. + /// Criteria for termination of the iterative process of corner refinement. + /// That is, the process of corner position refinement stops either after criteria.maxCount iterations + /// or when the corner position moves by less than criteria.epsilon on some iteration. + /// + public Point2f[] CornerSubPix(IEnumerable inputCorners, + Size winSize, Size zeroZone, TermCriteria criteria) + { + return Cv2.CornerSubPix(this, inputCorners, winSize, zeroZone, criteria); + } + + /// + /// Finds the strong enough corners where the cornerMinEigenVal() or cornerHarris() report the local maxima. + /// Input matrix must be 8-bit or floating-point 32-bit, single-channel image. + /// + /// Maximum number of corners to return. If there are more corners than are found, + /// the strongest of them is returned. + /// Parameter characterizing the minimal accepted quality of image corners. + /// The parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue + /// or the Harris function response (see cornerHarris() ). The corners with the quality measure less than + /// the product are rejected. For example, if the best corner has the quality measure = 1500, and the qualityLevel=0.01, + /// then all the corners with the quality measure less than 15 are rejected. + /// Minimum possible Euclidean distance between the returned corners. + /// Optional region of interest. If the image is not empty + /// (it needs to have the type CV_8UC1 and the same size as image ), it specifies the region + /// in which the corners are detected. + /// Size of an average block for computing a derivative covariation matrix over each pixel neighborhood. + /// Parameter indicating whether to use a Harris detector + /// Free parameter of the Harris detector. + /// Output vector of detected corners. + public Point2f[] GoodFeaturesToTrack( + int maxCorners, double qualityLevel, double minDistance, + InputArray mask, int blockSize, bool useHarrisDetector, double k) + { + return Cv2.GoodFeaturesToTrack(this, maxCorners, qualityLevel, + minDistance, mask, blockSize, useHarrisDetector, k); + } + +#if LANG_JP + /// + /// 標準ハフ変換を用いて,2値画像から直線を検出します. + /// + /// ピクセル単位で表される投票空間の距離分解能 + /// ラジアン単位で表される投票空間の角度分解能 + /// 投票の閾値パラメータ.十分な票( > threshold )を得た直線のみが出力されます + /// マルチスケールハフ変換において,距離分解能 rho の除数となる値.[既定値は0] + /// マルチスケールハフ変換において,角度分解能 theta の除数となる値. [既定値は0] + /// 検出された直線.各直線は,2要素のベクトル (rho, theta) で表現されます. + /// rho は原点(画像の左上コーナー)からの距離, theta はラジアン単位で表される直線の回転角度です +#else + /// + /// Finds lines in a binary image using standard Hough transform. + /// The input matrix must be 8-bit, single-channel, binary source image. + /// This image may be modified by the function. + /// + /// Distance resolution of the accumulator in pixels + /// Angle resolution of the accumulator in radians + /// The accumulator threshold parameter. Only those lines are returned that get enough votes ( > threshold ) + /// For the multi-scale Hough transform it is the divisor for the distance resolution rho. [By default this is 0] + /// For the multi-scale Hough transform it is the divisor for the distance resolution theta. [By default this is 0] + /// The output vector of lines. Each line is represented by a two-element vector (rho, theta) . + /// rho is the distance from the coordinate origin (0,0) (top-left corner of the image) and theta is the line rotation angle in radians +#endif + public LineSegmentPolar[] HoughLines(double rho, double theta, int threshold, + double srn = 0, double stn = 0) + { + return Cv2.HoughLines(this, rho, theta, threshold, srn, stn); + } + +#if LANG_JP + /// + /// 確率的ハフ変換を利用して,2値画像から線分を検出します. + /// + /// ピクセル単位で表される投票空間の距離分解能 + /// ラジアン単位で表される投票空間の角度分解能 + /// 投票の閾値パラメータ.十分な票( > threshold )を得た直線のみが出力されます + /// 最小の線分長.これより短い線分は棄却されます. [既定値は0] + /// 2点が同一線分上にあると見なす場合に許容される最大距離. [既定値は0] + /// 検出された線分.各線分は,4要素のベクトル (x1, y1, x2, y2) で表現されます. +#else + /// + /// Finds lines segments in a binary image using probabilistic Hough transform. + /// + /// Distance resolution of the accumulator in pixels + /// Angle resolution of the accumulator in radians + /// The accumulator threshold parameter. Only those lines are returned that get enough votes ( > threshold ) + /// The minimum line length. Line segments shorter than that will be rejected. [By default this is 0] + /// The maximum allowed gap between points on the same line to link them. [By default this is 0] + /// The output lines. Each line is represented by a 4-element vector (x1, y1, x2, y2) +#endif + public LineSegmentPoint[] HoughLinesP(double rho, double theta, int threshold, + double minLineLength = 0, double maxLineGap = 0) + { + return Cv2.HoughLinesP(this, rho, theta, threshold, minLineLength, maxLineGap); + } + +#if LANG_JP + /// + /// ハフ変換を用いて,グレースケール画像から円を検出します. + /// + /// 現在のところ,HoughCirclesMethod.Gradient メソッドのみが実装されている. + /// 画像分解能に対する投票分解能の比率の逆数. + /// 検出される円の中心同士の最小距離. + /// 手法依存の1番目のパラメータ.[既定値は100] + /// 手法依存の2番目のパラメータ.[既定値は100] + /// 円の半径の最小値 [既定値は0] + /// 円の半径の最大値 [既定値は0] + /// 検出された円.各ベクトルは,3要素の浮動小数点型ベクトル (x, y, radius) としてエンコードされます +#else + /// + /// Finds circles in a grayscale image using a Hough transform. + /// The input matrix must be 8-bit, single-channel and grayscale. + /// + /// Currently, the only implemented method is HoughCirclesMethod.Gradient + /// The inverse ratio of the accumulator resolution to the image resolution. + /// Minimum distance between the centers of the detected circles. + /// The first method-specific parameter. [By default this is 100] + /// The second method-specific parameter. [By default this is 100] + /// Minimum circle radius. [By default this is 0] + /// Maximum circle radius. [By default this is 0] + /// The output vector found circles. Each vector is encoded as 3-element floating-point vector (x, y, radius) +#endif + public CircleSegment[] HoughCircles(HoughMethods method, double dp, double minDist, + double param1 = 100, double param2 = 100, int minRadius = 0, int maxRadius = 0) + { + return Cv2.HoughCircles(this, method, dp, minDist, param1, param2, minRadius, maxRadius); + } + +#if LANG_JP + /// + /// 指定の構造要素を用いて画像の膨張を行います. + /// + /// 膨張に用いられる構造要素. element=new Mat() の場合, 3x3 の矩形構造要素が用いられます + /// 構造要素内のアンカー位置.デフォルト値の (-1, -1) は,アンカーが構造要素の中心にあることを意味します + /// 膨張が行われる回数. [既定値は1] + /// ピクセル外挿手法.[既定値はBorderTypes.Constant] + /// 定数境界モードで利用されるピクセル値.デフォルト値は特別な意味を持ちます.[既定値はCvCpp.MorphologyDefaultBorderValue()] + /// src と同じサイズ,同じ型の出力画像 +#else + /// + /// Dilates an image by using a specific structuring element. + /// + /// The structuring element used for dilation. If element=new Mat() , a 3x3 rectangular structuring element is used + /// Position of the anchor within the element. The default value (-1, -1) means that the anchor is at the element center + /// The number of times dilation is applied. [By default this is 1] + /// The pixel extrapolation method. [By default this is BorderTypes.Constant] + /// The border value in case of a constant border. The default value has a special meaning. [By default this is CvCpp.MorphologyDefaultBorderValue()] + /// The destination image. It will have the same size and the same type as src +#endif + public Mat Dilate(InputArray element, Point? anchor = null, int iterations = 1, + BorderTypes borderType = BorderTypes.Constant, Scalar? borderValue = null) + { + var dst = new Mat(); + Cv2.Dilate(this, dst, element, anchor, iterations, borderType, borderValue); + return dst; + } + +#if LANG_JP + /// + /// 指定の構造要素を用いて画像の収縮を行います. + /// + /// 収縮に用いられる構造要素. element=new Mat() の場合, 3x3 の矩形の構造要素が用いられます + /// 構造要素内のアンカー位置.デフォルト値の (-1, -1) は,アンカーが構造要素の中心にあることを意味します + /// 収縮が行われる回数. [既定値は1] + /// ピクセル外挿手法.[既定値はBorderTypes.Constant] + /// 定数境界モードで利用されるピクセル値.デフォルト値は特別な意味を持ちます.[既定値はCvCpp.MorphologyDefaultBorderValue()] + /// src と同じサイズ,同じ型の出力画像 +#else + /// + /// Erodes an image by using a specific structuring element. + /// + /// The structuring element used for dilation. If element=new Mat(), a 3x3 rectangular structuring element is used + /// Position of the anchor within the element. The default value (-1, -1) means that the anchor is at the element center + /// The number of times erosion is applied + /// The pixel extrapolation method + /// The border value in case of a constant border. The default value has a special meaning. [By default this is CvCpp.MorphologyDefaultBorderValue()] + /// The destination image. It will have the same size and the same type as src +#endif + public Mat Erode(InputArray element, Point? anchor = null, int iterations = 1, + BorderTypes borderType = BorderTypes.Constant, Scalar? borderValue = null) + { + var dst = new Mat(); + Cv2.Erode(this, dst, element, anchor, iterations, borderType, borderValue); + return dst; + } + +#if LANG_JP + /// + /// 高度なモルフォロジー変換を行います. + /// + /// モルフォロジー演算の種類 + /// 構造要素 + /// 構造要素内のアンカー位置.デフォルト値の (-1, -1) は,アンカーが構造要素の中心にあることを意味します. + /// 収縮と膨張が適用される回数. [既定値は1] + /// ピクセル外挿手法. [既定値はBorderTypes.Constant] + /// 定数境界モードで利用されるピクセル値.デフォルト値は特別な意味を持ちます. [既定値は CvCpp.MorphologyDefaultBorderValue()] + /// src と同じサイズ,同じ型の出力画像 +#else + /// + /// Performs advanced morphological transformations + /// + /// Type of morphological operation + /// Structuring element + /// Position of the anchor within the element. The default value (-1, -1) means that the anchor is at the element center + /// Number of times erosion and dilation are applied. [By default this is 1] + /// The pixel extrapolation method. [By default this is BorderTypes.Constant] + /// The border value in case of a constant border. The default value has a special meaning. [By default this is CvCpp.MorphologyDefaultBorderValue()] + /// Destination image. It will have the same size and the same type as src +#endif + public Mat MorphologyEx(MorphTypes op, InputArray element, + Point? anchor = null, int iterations = 1, BorderTypes borderType = BorderTypes.Constant, + Scalar? borderValue = null) + { + var dst = new Mat(); + Cv2.MorphologyEx(this, dst, op, element, anchor, iterations, borderType, borderValue); + return dst; + } + + /// + /// Resizes an image. + /// + /// output image size; if it equals zero, it is computed as: + /// dsize = Size(round(fx*src.cols), round(fy*src.rows)) + /// Either dsize or both fx and fy must be non-zero. + /// scale factor along the horizontal axis; when it equals 0, + /// it is computed as: (double)dsize.width/src.cols + /// scale factor along the vertical axis; when it equals 0, + /// it is computed as: (double)dsize.height/src.rows + /// interpolation method + /// output image; it has the size dsize (when it is non-zero) or the size computed + /// from src.size(), fx, and fy; the type of dst is the same as of src. + public Mat Resize(Size dsize, double fx = 0, double fy = 0, + InterpolationFlags interpolation = InterpolationFlags.Linear) + { + var dst = new Mat(); + Cv2.Resize(this, dst, dsize, fx, fy, interpolation); + return dst; + } + + /// + /// Applies an affine transformation to an image. + /// + /// output image that has the size dsize and the same type as src. + /// 2x3 transformation matrix. + /// size of the output image. + /// combination of interpolation methods and the optional flag + /// WARP_INVERSE_MAP that means that M is the inverse transformation (dst -> src) . + /// pixel extrapolation method; when borderMode=BORDER_TRANSPARENT, + /// it means that the pixels in the destination image corresponding to the "outliers" + /// in the source image are not modified by the function. + /// value used in case of a constant border; by default, it is 0. + public Mat WarpAffine(InputArray m, Size dsize, InterpolationFlags flags = InterpolationFlags.Linear, + BorderTypes borderMode = BorderTypes.Constant, Scalar? borderValue = null) + { + var dst = new Mat(); + Cv2.WarpAffine(this, dst, m, dsize, flags, borderMode, borderValue); + return dst; + } + + /// + /// Applies a perspective transformation to an image. + /// + /// 3x3 transformation matrix. + /// size of the output image. + /// combination of interpolation methods (INTER_LINEAR or INTER_NEAREST) + /// and the optional flag WARP_INVERSE_MAP, that sets M as the inverse transformation (dst -> src). + /// pixel extrapolation method (BORDER_CONSTANT or BORDER_REPLICATE). + /// value used in case of a constant border; by default, it equals 0. + /// output image that has the size dsize and the same type as src. + public Mat WarpPerspective(Mat m, Size dsize, InterpolationFlags flags = InterpolationFlags.Linear, + BorderTypes borderMode = BorderTypes.Constant, Scalar? borderValue = null) + { + var dst = new Mat(); + Cv2.WarpPerspective(this, dst, m, dsize, flags, borderMode, borderValue); + return dst; + } + + /// + /// Applies a generic geometrical transformation to an image. + /// + /// The first map of either (x,y) points or just x values having the type CV_16SC2, CV_32FC1, or CV_32FC2. + /// The second map of y values having the type CV_16UC1, CV_32FC1, or none (empty map if map1 is (x,y) points), respectively. + /// Interpolation method. The method INTER_AREA is not supported by this function. + /// Pixel extrapolation method. When borderMode=BORDER_TRANSPARENT, + /// it means that the pixels in the destination image that corresponds to the "outliers" in + /// the source image are not modified by the function. + /// Value used in case of a constant border. By default, it is 0. + /// Destination image. It has the same size as map1 and the same type as src + public Mat Remap(InputArray map1, InputArray map2, InterpolationFlags interpolation = InterpolationFlags.Linear, + BorderTypes borderMode = BorderTypes.Constant, Scalar? borderValue = null) + { + var dst = new Mat(); + Cv2.Remap(this, dst, map1, map2, interpolation, borderMode, borderValue); + return dst; + } + + /// + /// Inverts an affine transformation. + /// + /// Output reverse affine transformation. + public Mat InvertAffineTransform() + { + var dst = new Mat(); + Cv2.InvertAffineTransform(this, dst); + return dst; + } + + /// + /// Retrieves a pixel rectangle from an image with sub-pixel accuracy. + /// + /// Size of the extracted patch. + /// Floating point coordinates of the center of the extracted rectangle + /// within the source image. The center must be inside the image. + /// Depth of the extracted pixels. By default, they have the same depth as src. + /// Extracted patch that has the size patchSize and the same number of channels as src . + public Mat GetRectSubPix(Size patchSize, Point2f center, int patchType = -1) + { + var dst = new Mat(); + Cv2.GetRectSubPix(this, patchSize, center, dst, patchType); + return dst; + } + + /// + /// Adds an image to the accumulator. + /// + /// Optional operation mask. + /// Accumulator image with the same number of channels as input image, 32-bit or 64-bit floating-point. + public Mat Accumulate(InputArray mask) + { + var dst = new Mat(); + Cv2.Accumulate(this, dst, mask); + return dst; + } + + /// + /// Adds the square of a source image to the accumulator. + /// + /// Optional operation mask. + /// Accumulator image with the same number of channels as input image, 32-bit or 64-bit floating-point. + public Mat AccumulateSquare(InputArray mask) + { + var dst = new Mat(); + Cv2.AccumulateSquare(this, dst, mask); + return dst; + } + + /// + /// Computes a Hanning window coefficients in two dimensions. + /// + /// The window size specifications + /// Created array type + public void CreateHanningWindow(Size winSize, MatType type) + { + Cv2.CreateHanningWindow(this, winSize, type); + } + + /// + /// Applies a fixed-level threshold to each array element. + /// The input matrix must be single-channel, 8-bit or 32-bit floating point. + /// + /// threshold value. + /// maximum value to use with the THRESH_BINARY and THRESH_BINARY_INV thresholding types. + /// thresholding type (see the details below). + /// output array of the same size and type as src. + public Mat Threshold(double thresh, double maxval, ThresholdTypes type) + { + var dst = new Mat(); + Cv2.Threshold(this, dst, thresh, maxval, type); + return dst; + } + + /// + /// Applies an adaptive threshold to an array. + /// Source matrix must be 8-bit single-channel image. + /// + /// Non-zero value assigned to the pixels for which the condition is satisfied. See the details below. + /// Adaptive thresholding algorithm to use, ADAPTIVE_THRESH_MEAN_C or ADAPTIVE_THRESH_GAUSSIAN_C . + /// Thresholding type that must be either THRESH_BINARY or THRESH_BINARY_INV . + /// Size of a pixel neighborhood that is used to calculate a threshold value for the pixel: 3, 5, 7, and so on. + /// Constant subtracted from the mean or weighted mean (see the details below). + /// Normally, it is positive but may be zero or negative as well. + /// Destination image of the same size and the same type as src. + public Mat AdaptiveThreshold(double maxValue, AdaptiveThresholdTypes adaptiveMethod, + ThresholdTypes thresholdType, int blockSize, double c) + { + var dst = new Mat(); + Cv2.AdaptiveThreshold(this, dst, maxValue, adaptiveMethod, + thresholdType, blockSize, c); + return dst; + } + + /// + /// Blurs an image and downsamples it. + /// + /// size of the output image; by default, it is computed as Size((src.cols+1)/2 + /// + /// + public Mat PyrDown(Size? dstSize = null, BorderTypes borderType = BorderTypes.Default) + { + var dst = new Mat(); + Cv2.PyrDown(this, dst, dstSize, borderType); + return dst; + } + + /// + /// Upsamples an image and then blurs it. + /// + /// size of the output image; by default, it is computed as Size(src.cols*2, (src.rows*2) + /// + /// + public Mat PyrUp(Size? dstSize = null, BorderTypes borderType = BorderTypes.Default) + { + var dst = new Mat(); + Cv2.PyrUp(this, dst, dstSize, borderType); + return dst; + } + + /// + /// corrects lens distortion for the given camera matrix and distortion coefficients + /// + /// Input camera matrix + /// Input vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, + /// or 8 elements. If the vector is null, the zero distortion coefficients are assumed. + /// Camera matrix of the distorted image. + /// By default, it is the same as cameraMatrix but you may additionally scale + /// and shift the result by using a different matrix. + /// Output (corrected) image that has the same size and type as src . + public Mat Undistort(InputArray cameraMatrix, InputArray distCoeffs, InputArray newCameraMatrix = null) + { + var dst = new Mat(); + Cv2.Undistort(this, dst, cameraMatrix, distCoeffs, newCameraMatrix); + return dst; + } + + /// + /// returns the default new camera matrix (by default it is the same as cameraMatrix unless centerPricipalPoint=true) + /// + /// Camera view image size in pixels. + /// Location of the principal point in the new camera matrix. + /// The parameter indicates whether this location should be at the image center or not. + /// the camera matrix that is either an exact copy of the input cameraMatrix + /// (when centerPrinicipalPoint=false), or the modified one (when centerPrincipalPoint=true). + public Mat GetDefaultNewCameraMatrix(Size? imgSize = null, bool centerPrincipalPoint = false) + { + return Cv2.GetDefaultNewCameraMatrix(this, imgSize, centerPrincipalPoint); + } + + /// + /// Computes the ideal point coordinates from the observed point coordinates. + /// Input matrix is an observed point coordinates, 1xN or Nx1 2-channel (CV_32FC2 or CV_64FC2). + /// + /// Camera matrix + /// Input vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. + /// If the vector is null, the zero distortion coefficients are assumed. + /// Rectification transformation in the object space (3x3 matrix). + /// R1 or R2 computed by stereoRectify() can be passed here. + /// If the matrix is empty, the identity transformation is used. + /// New camera matrix (3x3) or new projection matrix (3x4). + /// P1 or P2 computed by stereoRectify() can be passed here. If the matrix is empty, + /// the identity new camera matrix is used. + /// Output ideal point coordinates after undistortion and reverse perspective transformation. + /// If matrix P is identity or omitted, dst will contain normalized point coordinates. + public Mat UndistortPoints( + InputArray cameraMatrix, InputArray distCoeffs, + InputArray r = null, InputArray p = null) + { + var dst = new Mat(); + Cv2.UndistortPoints(this, dst, cameraMatrix, distCoeffs, r, p); + return dst; + } + + /// + /// Normalizes the grayscale image brightness and contrast by normalizing its histogram. + /// The source matrix is 8-bit single channel image. + /// + /// The destination image; will have the same size and the same type as src + public Mat EqualizeHist() + { + var dst = new Mat(); + Cv2.EqualizeHist(this, dst); + return dst; + } + + /// + /// Performs a marker-based image segmentation using the watershed algorithm. + /// Input matrix is 8-bit 3-channel image. + /// + /// Input/output 32-bit single-channel image (map) of markers. + /// It should have the same size as image. + public void Watershed(InputOutputArray markers) + { + Cv2.Watershed(this, markers); + } + + /// + /// Performs initial step of meanshift segmentation of an image. + /// The source matrix is 8-bit, 3-channel image. + /// + /// The spatial window radius. + /// The color window radius. + /// Maximum level of the pyramid for the segmentation. + /// Termination criteria: when to stop meanshift iterations. + /// The destination image of the same format and the same size as the source. + public Mat PyrMeanShiftFiltering(double sp, double sr, int maxLevel = 1, TermCriteria? termcrit = null) + { + var dst = new Mat(); + Cv2.PyrMeanShiftFiltering(this, dst, sp, sr, maxLevel, termcrit); + return dst; + } + + /// + /// Segments the image using GrabCut algorithm. + /// The input is 8-bit 3-channel image. + /// + /// Input/output 8-bit single-channel mask. + /// The mask is initialized by the function when mode is set to GC_INIT_WITH_RECT. + /// Its elements may have Cv2.GC_BGD / Cv2.GC_FGD / Cv2.GC_PR_BGD / Cv2.GC_PR_FGD + /// ROI containing a segmented object. The pixels outside of the ROI are + /// marked as "obvious background". The parameter is only used when mode==GC_INIT_WITH_RECT. + /// Temporary array for the background model. Do not modify it while you are processing the same image. + /// Temporary arrays for the foreground model. Do not modify it while you are processing the same image. + /// Number of iterations the algorithm should make before returning the result. + /// Note that the result can be refined with further calls with mode==GC_INIT_WITH_MASK or mode==GC_EVAL . + /// Operation mode that could be one of GrabCutFlag value. + public void GrabCut(InputOutputArray mask, Rect rect, + InputOutputArray bgdModel, InputOutputArray fgdModel, + int iterCount, GrabCutModes mode) + { + Cv2.GrabCut(this, mask, rect, bgdModel, fgdModel, iterCount, mode); + } + + /// + /// Fills a connected component with the given color. + /// Input/output 1- or 3-channel, 8-bit, or floating-point image. + /// It is modified by the function unless the FLOODFILL_MASK_ONLY flag is set in the + /// second variant of the function. See the details below. + /// + /// Starting point. + /// New value of the repainted domain pixels. + /// + public int FloodFill(Point seedPoint, Scalar newVal) + { + return Cv2.FloodFill(this, seedPoint, newVal); + } + + /// + /// Fills a connected component with the given color. + /// Input/output 1- or 3-channel, 8-bit, or floating-point image. + /// It is modified by the function unless the FLOODFILL_MASK_ONLY flag is set in the + /// second variant of the function. See the details below. + /// + /// Starting point. + /// New value of the repainted domain pixels. + /// Optional output parameter set by the function to the + /// minimum bounding rectangle of the repainted domain. + /// Maximal lower brightness/color difference between the currently + /// observed pixel and one of its neighbors belonging to the component, or a seed pixel + /// being added to the component. + /// Maximal upper brightness/color difference between the currently + /// observed pixel and one of its neighbors belonging to the component, or a seed pixel + /// being added to the component. + /// Operation flags. Lower bits contain a connectivity value, + /// 4 (default) or 8, used within the function. Connectivity determines which + /// neighbors of a pixel are considered. + /// + public int FloodFill( + Point seedPoint, Scalar newVal, out Rect rect, Scalar? loDiff = null, Scalar? upDiff = null, + FloodFillFlags flags = FloodFillFlags.Link4) + { + return Cv2.FloodFill(this, seedPoint, newVal, out rect, + loDiff, upDiff, flags); + } + + /// + /// Fills a connected component with the given color. + /// Input/output 1- or 3-channel, 8-bit, or floating-point image. + /// It is modified by the function unless the FLOODFILL_MASK_ONLY flag is set in the + /// second variant of the function. See the details below. + /// + /// (For the second function only) Operation mask that should be a single-channel 8-bit image, + /// 2 pixels wider and 2 pixels taller. The function uses and updates the mask, so you take responsibility of + /// initializing the mask content. Flood-filling cannot go across non-zero pixels in the mask. For example, + /// an edge detector output can be used as a mask to stop filling at edges. It is possible to use the same mask + /// in multiple calls to the function to make sure the filled area does not overlap. + /// Starting point. + /// New value of the repainted domain pixels. + /// + public int FloodFill(InputOutputArray mask, Point seedPoint, Scalar newVal) + { + return Cv2.FloodFill(this, mask, seedPoint, newVal); + } + + /// + /// Fills a connected component with the given color. + /// Input/output 1- or 3-channel, 8-bit, or floating-point image. + /// It is modified by the function unless the FLOODFILL_MASK_ONLY flag is set in the + /// second variant of the function. See the details below. + /// + /// (For the second function only) Operation mask that should be a single-channel 8-bit image, + /// 2 pixels wider and 2 pixels taller. The function uses and updates the mask, so you take responsibility of + /// initializing the mask content. Flood-filling cannot go across non-zero pixels in the mask. For example, + /// an edge detector output can be used as a mask to stop filling at edges. It is possible to use the same mask + /// in multiple calls to the function to make sure the filled area does not overlap. + /// Starting point. + /// New value of the repainted domain pixels. + /// Optional output parameter set by the function to the + /// minimum bounding rectangle of the repainted domain. + /// Maximal lower brightness/color difference between the currently + /// observed pixel and one of its neighbors belonging to the component, or a seed pixel + /// being added to the component. + /// Maximal upper brightness/color difference between the currently + /// observed pixel and one of its neighbors belonging to the component, or a seed pixel + /// being added to the component. + /// Operation flags. Lower bits contain a connectivity value, + /// 4 (default) or 8, used within the function. Connectivity determines which + /// neighbors of a pixel are considered. + /// + public int FloodFill(InputOutputArray mask, Point seedPoint, Scalar newVal, + out Rect rect, Scalar? loDiff = null, Scalar? upDiff = null, + FloodFillFlags flags = FloodFillFlags.Link4) + { + return Cv2.FloodFill(this, mask, seedPoint, + newVal, out rect, loDiff, upDiff, flags); + } + +#if LANG_JP + /// + /// 画像の色空間を変換します. + /// + /// 色空間の変換コード. + /// 出力画像のチャンネル数.この値が 0 の場合,チャンネル数は src と code から自動的に求められます + /// src と同じサイズ,同じタイプの出力画像 +#else + /// + /// Converts image from one color space to another + /// + /// The color space conversion code + /// The number of channels in the destination image; if the parameter is 0, the number of the channels will be derived automatically from src and the code + /// The destination image; will have the same size and the same depth as src +#endif + public Mat CvtColor(ColorConversionCodes code, int dstCn = 0) + { + var dst = new Mat(); + Cv2.CvtColor(this, dst, code, dstCn); + return dst; + } + + /// + /// Calculates all of the moments + /// up to the third order of a polygon or rasterized shape. + /// The input is a raster image (single-channel, 8-bit or floating-point 2D array). + /// + /// If it is true, then all the non-zero image pixels are treated as 1’s + /// + public Moments Moments(bool binaryImage = false) + { + return new Moments(this, binaryImage); + } + + /// + /// Computes the proximity map for the raster template and the image where the template is searched for + /// The input is Image where the search is running; should be 8-bit or 32-bit floating-point. + /// + /// Searched template; must be not greater than the source image and have the same data type + /// Specifies the comparison method + /// A map of comparison results; will be single-channel 32-bit floating-point. + /// If image is WxH and templ is wxh then result will be (W-w+1) x (H-h+1). + public Mat MatchTemplate(InputArray templ, TemplateMatchModes method) + { + var dst = new Mat(); + Cv2.MatchTemplate(this, templ, dst, method); + return dst; + } + + /// + /// computes the connected components labeled image of boolean image. + /// image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0 + /// represents the background label. ltype specifies the output label image type, an important + /// consideration based on the total number of labels or alternatively the total number of + /// pixels in the source image. + /// + /// destination labeled image + /// 8 or 4 for 8-way or 4-way connectivity respectively + /// The number of labels + public int ConnectedComponents(OutputArray labels, + PixelConnectivity connectivity = PixelConnectivity.Connectivity8) + { + return ConnectedComponents(labels, connectivity, MatType.CV_32S); + } + + /// + /// computes the connected components labeled image of boolean image. + /// image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0 + /// represents the background label. ltype specifies the output label image type, an important + /// consideration based on the total number of labels or alternatively the total number of + /// pixels in the source image. + /// + /// destination labeled image + /// 8 or 4 for 8-way or 4-way connectivity respectively + /// output image label type. Currently CV_32S and CV_16U are supported. + /// The number of labels + public int ConnectedComponents(OutputArray labels, + PixelConnectivity connectivity, MatType ltype) + { + return Cv2.ConnectedComponents(this, labels, connectivity, ltype); + } + + /// + /// computes the connected components labeled image of boolean image. + /// image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0 + /// represents the background label. ltype specifies the output label image type, an important + /// consideration based on the total number of labels or alternatively the total number of + /// pixels in the source image. + /// + /// destination labeled rectangular array + /// 8 or 4 for 8-way or 4-way connectivity respectively + /// The number of labels + public int ConnectedComponents(out int[,] labels, PixelConnectivity connectivity) + { + return Cv2.ConnectedComponents(this, out labels, connectivity); + } + + /// + /// computes the connected components labeled image of boolean image. + /// image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0 + /// represents the background label. ltype specifies the output label image type, an important + /// consideration based on the total number of labels or alternatively the total number of + /// pixels in the source image. + /// + /// destination labeled image + /// statistics output for each label, including the background label, + /// see below for available statistics. Statistics are accessed via stats(label, COLUMN) + /// where COLUMN is one of cv::ConnectedComponentsTypes + /// floating point centroid (x,y) output for each label, + /// including the background label + /// 8 or 4 for 8-way or 4-way connectivity respectively + /// + public int ConnectedComponentsWithStats( + OutputArray labels, OutputArray stats, OutputArray centroids, + PixelConnectivity connectivity = PixelConnectivity.Connectivity8) + { + return ConnectedComponentsWithStats(labels, stats, centroids, connectivity, MatType.CV_32S); + } + + /// + /// computes the connected components labeled image of boolean image. + /// image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0 + /// represents the background label. ltype specifies the output label image type, an important + /// consideration based on the total number of labels or alternatively the total number of + /// pixels in the source image. + /// + /// destination labeled image + /// statistics output for each label, including the background label, + /// see below for available statistics. Statistics are accessed via stats(label, COLUMN) + /// where COLUMN is one of cv::ConnectedComponentsTypes + /// floating point centroid (x,y) output for each label, + /// including the background label + /// 8 or 4 for 8-way or 4-way connectivity respectively + /// output image label type. Currently CV_32S and CV_16U are supported. + /// + public int ConnectedComponentsWithStats( + OutputArray labels, OutputArray stats, OutputArray centroids, + PixelConnectivity connectivity, MatType ltype) + { + return Cv2.ConnectedComponentsWithStats(this, labels, stats, centroids, connectivity, ltype); + } + + /// + /// computes the connected components labeled image of boolean image. + /// image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0 + /// represents the background label. ltype specifies the output label image type, an important + /// consideration based on the total number of labels or alternatively the total number of + /// pixels in the source image. + /// + /// 8 or 4 for 8-way or 4-way connectivity respectively + /// + public ConnectedComponents ConnectedComponentsEx(PixelConnectivity connectivity = PixelConnectivity.Connectivity8) + { + return Cv2.ConnectedComponentsEx(this, connectivity); + } + +#if LANG_JP + /// + /// 2値画像中の輪郭を検出します. + /// 入力画像は,8ビット,シングルチャンネル.0以外のピクセルは 1として,0のピクセルは0のまま扱われます. + /// また,この関数は,輪郭抽出処理中に入力画像の中身を書き換えます. + /// + /// 検出された輪郭.各輪郭は,点のベクトルとして格納されます. + /// 画像のトポロジーに関する情報を含む出力ベクトル.これは,輪郭数と同じ数の要素を持ちます.各輪郭 contours[i] に対して, + /// 要素 hierarchy[i]のメンバにはそれぞれ,同じ階層レベルに存在する前後の輪郭,最初の子輪郭,および親輪郭の + /// contours インデックス(0 基準)がセットされます.また,輪郭 i において,前後,親,子の輪郭が存在しない場合, + /// それに対応する hierarchy[i] の要素は,負の値になります. + /// 輪郭抽出モード + /// 輪郭の近似手法 + /// オプションのオフセット.各輪郭点はこの値の分だけシフトします.これは,ROIの中で抽出された輪郭を,画像全体に対して位置づけて解析する場合に役立ちます. +#else + /// + /// Finds contours in a binary image. + /// The source is an 8-bit single-channel image. Non-zero pixels are treated as 1’s. + /// Zero pixels remain 0’s, so the image is treated as binary. The function modifies this image while extracting the contours. + /// + /// Detected contours. Each contour is stored as a vector of points. + /// Optional output vector, containing information about the image topology. + /// It has as many elements as the number of contours. For each i-th contour contours[i], + /// the members of the elements hierarchy[i] are set to 0-based indices in contours of the next + /// and previous contours at the same hierarchical level, the first child contour and the parent contour, respectively. + /// If for the contour i there are no next, previous, parent, or nested contours, the corresponding elements of hierarchy[i] will be negative. + /// Contour retrieval mode + /// Contour approximation method + /// Optional offset by which every contour point is shifted. + /// This is useful if the contours are extracted from the image ROI and then they should be analyzed in the whole image context. +#endif + public void FindContours(out Point[][] contours, out HierarchyIndex[] hierarchy, + RetrievalModes mode, ContourApproximationModes method, Point? offset = null) + { + Cv2.FindContours(this, out contours, out hierarchy, mode, method, offset); + } + +#if LANG_JP + /// + /// 2値画像中の輪郭を検出します. + /// 入力画像は,8ビット,シングルチャンネル.0以外のピクセルは 1として,0のピクセルは0のまま扱われます. + /// また,この関数は,輪郭抽出処理中に入力画像の中身を書き換えます. + /// + /// 検出された輪郭.各輪郭は,点のベクトルとして格納されます. + /// 画像のトポロジーに関する情報を含む出力ベクトル.これは,輪郭数と同じ数の要素を持ちます.各輪郭 contours[i] に対して, + /// 要素 hierarchy[i]のメンバにはそれぞれ,同じ階層レベルに存在する前後の輪郭,最初の子輪郭,および親輪郭の + /// contours インデックス(0 基準)がセットされます.また,輪郭 i において,前後,親,子の輪郭が存在しない場合, + /// それに対応する hierarchy[i] の要素は,負の値になります. + /// 輪郭抽出モード + /// 輪郭の近似手法 + /// オプションのオフセット.各輪郭点はこの値の分だけシフトします.これは,ROIの中で抽出された輪郭を,画像全体に対して位置づけて解析する場合に役立ちます. +#else + /// + /// Finds contours in a binary image. + /// The source is an 8-bit single-channel image. Non-zero pixels are treated as 1’s. + /// Zero pixels remain 0’s, so the image is treated as binary. The function modifies this image while extracting the contours. + /// + /// Detected contours. Each contour is stored as a vector of points. + /// Optional output vector, containing information about the image topology. + /// It has as many elements as the number of contours. For each i-th contour contours[i], + /// the members of the elements hierarchy[i] are set to 0-based indices in contours of the next + /// and previous contours at the same hierarchical level, the first child contour and the parent contour, respectively. + /// If for the contour i there are no next, previous, parent, or nested contours, the corresponding elements of hierarchy[i] will be negative. + /// Contour retrieval mode + /// Contour approximation method + /// Optional offset by which every contour point is shifted. + /// This is useful if the contours are extracted from the image ROI and then they should be analyzed in the whole image context. +#endif + public void FindContours(out Mat[] contours, OutputArray hierarchy, + RetrievalModes mode, ContourApproximationModes method, Point? offset = null) + { + Cv2.FindContours(this, out contours, hierarchy, mode, method, offset); + } + +#if LANG_JP + /// + /// 2値画像中の輪郭を検出します. + /// 入力画像は,8ビット,シングルチャンネル.0以外のピクセルは 1として,0のピクセルは0のまま扱われます. + /// また,この関数は,輪郭抽出処理中に入力画像の中身を書き換えます. + /// + /// 輪郭抽出モード + /// 輪郭の近似手法 + /// オプションのオフセット.各輪郭点はこの値の分だけシフトします.これは,ROIの中で抽出された輪郭を,画像全体に対して位置づけて解析する場合に役立ちます. + /// 検出された輪郭.各輪郭は,点のベクトルとして格納されます. +#else + /// + /// Finds contours in a binary image. + /// The source is an 8-bit single-channel image. Non-zero pixels are treated as 1’s. + /// Zero pixels remain 0’s, so the image is treated as binary. The function modifies this image while extracting the contours. + /// + /// Contour retrieval mode + /// Contour approximation method + /// Optional offset by which every contour point is shifted. + /// This is useful if the contours are extracted from the image ROI and then they should be analyzed in the whole image context. + /// Detected contours. Each contour is stored as a vector of points. +#endif + public Point[][] FindContoursAsArray(RetrievalModes mode, ContourApproximationModes method, Point? offset = null) + { + return Cv2.FindContoursAsArray(this, mode, method, offset); + } +#if LANG_JP + /// + /// 2値画像中の輪郭を検出します. + /// 入力画像は,8ビット,シングルチャンネル.0以外のピクセルは 1として,0のピクセルは0のまま扱われます. + /// また,この関数は,輪郭抽出処理中に入力画像の中身を書き換えます. + /// + /// 輪郭抽出モード + /// 輪郭の近似手法 + /// オプションのオフセット.各輪郭点はこの値の分だけシフトします.これは,ROIの中で抽出された輪郭を,画像全体に対して位置づけて解析する場合に役立ちます. + /// 検出された輪郭.各輪郭は,点のベクトルとして格納されます. +#else + /// + /// Finds contours in a binary image. + /// The source is an 8-bit single-channel image. Non-zero pixels are treated as 1’s. + /// Zero pixels remain 0’s, so the image is treated as binary. The function modifies this image while extracting the contours. + /// + /// Contour retrieval mode + /// Contour approximation method + /// Optional offset by which every contour point is shifted. + /// This is useful if the contours are extracted from the image ROI and then they should be analyzed in the whole image context. + /// Detected contours. Each contour is stored as a vector of points. +#endif + public MatOfPoint[] FindContoursAsMat(RetrievalModes mode, ContourApproximationModes method, Point? offset = null) + { + return Cv2.FindContoursAsMat(this, mode, method, offset); + } + +#if LANG_JP + /// + /// 輪郭線,または内側が塗りつぶされた輪郭を描きます. + /// + /// 入力される全輪郭.各輪郭は,点のベクトルとして格納されています. + /// 描かれる輪郭を示します.これが負値の場合,すべての輪郭が描画されます. + /// 輪郭の色. + /// 輪郭線の太さ.これが負値の場合(例えば thickness=CV_FILLED ),輪郭の内側が塗りつぶされます. + /// 線の連結性 + /// 階層に関するオプションの情報.これは,特定の輪郭だけを描画したい場合にのみ必要になります. + /// 描画される輪郭の最大レベル.0ならば,指定された輪郭のみが描画されます. + /// 1ならば,指定された輪郭と,それに入れ子になったすべての輪郭が描画されます.2ならば,指定された輪郭と, + /// それに入れ子になったすべての輪郭,さらにそれに入れ子になったすべての輪郭が描画されます.このパラメータは, + /// hierarchy が有効な場合のみ考慮されます. + /// 輪郭をシフトするオプションパラメータ.指定された offset = (dx,dy) だけ,すべての描画輪郭がシフトされます. +#else + /// + /// Draws contours in the image + /// + /// All the input contours. Each contour is stored as a point vector. + /// Parameter indicating a contour to draw. If it is negative, all the contours are drawn. + /// Color of the contours. + /// Thickness of lines the contours are drawn with. If it is negative (for example, thickness=CV_FILLED ), + /// the contour interiors are drawn. + /// Line connectivity. + /// Optional information about hierarchy. It is only needed if you want to draw only some of the contours + /// Maximal level for drawn contours. If it is 0, only the specified contour is drawn. + /// If it is 1, the function draws the contour(s) and all the nested contours. If it is 2, the function draws the contours, + /// all the nested contours, all the nested-to-nested contours, and so on. This parameter is only taken into account + /// when there is hierarchy available. + /// Optional contour shift parameter. Shift all the drawn contours by the specified offset = (dx, dy) +#endif + public void DrawContours( + IEnumerable> contours, + int contourIdx, + Scalar color, + int thickness = 1, + LineTypes lineType = LineTypes.Link8, + IEnumerable hierarchy = null, + int maxLevel = Int32.MaxValue, + Point? offset = null) + { + Cv2.DrawContours(this, contours, contourIdx, color, + thickness, lineType, hierarchy, maxLevel, offset); + } + +#if LANG_JP + /// + /// 輪郭線,または内側が塗りつぶされた輪郭を描きます. + /// + /// 出力画像 + /// 入力される全輪郭.各輪郭は,点のベクトルとして格納されています. + /// 描かれる輪郭を示します.これが負値の場合,すべての輪郭が描画されます. + /// 輪郭の色. + /// 輪郭線の太さ.これが負値の場合(例えば thickness=CV_FILLED ),輪郭の内側が塗りつぶされます. + /// 線の連結性 + /// 階層に関するオプションの情報.これは,特定の輪郭だけを描画したい場合にのみ必要になります. + /// 描画される輪郭の最大レベル.0ならば,指定された輪郭のみが描画されます. + /// 1ならば,指定された輪郭と,それに入れ子になったすべての輪郭が描画されます.2ならば,指定された輪郭と, + /// それに入れ子になったすべての輪郭,さらにそれに入れ子になったすべての輪郭が描画されます.このパラメータは, + /// hierarchy が有効な場合のみ考慮されます. + /// 輪郭をシフトするオプションパラメータ.指定された offset = (dx,dy) だけ,すべての描画輪郭がシフトされます. +#else + /// + /// Draws contours in the image + /// + /// Destination image. + /// All the input contours. Each contour is stored as a point vector. + /// Parameter indicating a contour to draw. If it is negative, all the contours are drawn. + /// Color of the contours. + /// Thickness of lines the contours are drawn with. If it is negative (for example, thickness=CV_FILLED ), + /// the contour interiors are drawn. + /// Line connectivity. + /// Optional information about hierarchy. It is only needed if you want to draw only some of the contours + /// Maximal level for drawn contours. If it is 0, only the specified contour is drawn. + /// If it is 1, the function draws the contour(s) and all the nested contours. If it is 2, the function draws the contours, + /// all the nested contours, all the nested-to-nested contours, and so on. This parameter is only taken into account + /// when there is hierarchy available. + /// Optional contour shift parameter. Shift all the drawn contours by the specified offset = (dx, dy) +#endif + public void DrawContours( + InputOutputArray image, + IEnumerable contours, + int contourIdx, + Scalar color, + int thickness = 1, + LineTypes lineType = LineTypes.Link8, + Mat hierarchy = null, + int maxLevel = Int32.MaxValue, + Point? offset = null) + { + Cv2.DrawContours(image, contours, contourIdx, color, + thickness, lineType, hierarchy, maxLevel, offset); + } + + /// + /// Approximates contour or a curve using Douglas-Peucker algorithm. + /// The input is the polygon or curve to approximate and + /// it must be 1 x N or N x 1 matrix of type CV_32SC2 or CV_32FC2. + /// + /// Specifies the approximation accuracy. + /// This is the maximum distance between the original curve and its approximation. + /// The result of the approximation; + /// The type should match the type of the input curve + /// The result of the approximation; + /// The type should match the type of the input curve +// ReSharper disable once InconsistentNaming + public Mat ApproxPolyDP(double epsilon, bool closed) + { + var dst = new Mat(); + Cv2.ApproxPolyDP(this, dst, epsilon, closed); + return dst; + } + + /// + /// Calculates a contour perimeter or a curve length. + /// The input is 2D point set, represented by CV_32SC2 or CV_32FC2 matrix. + /// + /// Indicates, whether the curve is closed or not + /// + public double ArcLength(bool closed) + { + return Cv2.ArcLength(this, closed); + } + + /// + /// Calculates the up-right bounding rectangle of a point set. + /// The input is 2D point set, represented by CV_32SC2 or CV_32FC2 matrix. + /// + /// Minimal up-right bounding rectangle for the specified point set. + public Rect BoundingRect() + { + return Cv2.BoundingRect(this); + } + + /// + /// Calculates the contour area. + /// The input is 2D point set, represented by CV_32SC2 or CV_32FC2 matrix. + /// + /// + /// + public double ContourArea(bool oriented = false) + { + return Cv2.ContourArea(this, oriented); + } + + /// + /// Finds the minimum area rotated rectangle enclosing a 2D point set. + /// The input is 2D point set, represented by CV_32SC2 or CV_32FC2 matrix. + /// + /// + public RotatedRect MinAreaRect() + { + return Cv2.MinAreaRect(this); + } + + /// + /// Finds the minimum area circle enclosing a 2D point set. + /// The input is 2D point set, represented by CV_32SC2 or CV_32FC2 matrix. + /// + /// The output center of the circle + /// The output radius of the circle + public void MinEnclosingCircle(out Point2f center, out float radius) + { + Cv2.MinEnclosingCircle(this, out center, out radius); + } + + /// + /// Computes convex hull for a set of 2D points. + /// + /// The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix + /// If true, the output convex hull will be oriented clockwise, + /// otherwise it will be oriented counter-clockwise. Here, the usual screen coordinate + /// system is assumed - the origin is at the top-left corner, x axis is oriented to the right, + /// and y axis is oriented downwards. + /// + /// The output convex hull. It is either a vector of points that form the + /// hull (must have the same type as the input points), or a vector of 0-based point + /// indices of the hull points in the original array (since the set of convex hull + /// points is a subset of the original point set). + public Mat ConvexHull(InputArray points, bool clockwise = false, bool returnPoints = true) + { + var dst = new Mat(); + Cv2.ConvexHull(points, dst, clockwise, returnPoints); + return dst; + } + + /// + /// Computes convex hull for a set of 2D points. + /// + /// The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix + /// If true, the output convex hull will be oriented clockwise, + /// otherwise it will be oriented counter-clockwise. Here, the usual screen coordinate + /// system is assumed - the origin is at the top-left corner, x axis is oriented to the right, + /// and y axis is oriented downwards. + /// The output convex hull. It is a vector of points that form the + /// hull (must have the same type as the input points). + public Point[] ConvexHullPoints(InputArray points, bool clockwise = false) + { + var dst = new MatOfPoint(); + Cv2.ConvexHull(points, dst, clockwise, true); + return dst.ToArray(); + } + + /// + /// Computes convex hull for a set of 2D points. + /// + /// The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix + /// If true, the output convex hull will be oriented clockwise, + /// otherwise it will be oriented counter-clockwise. Here, the usual screen coordinate + /// system is assumed - the origin is at the top-left corner, x axis is oriented to the right, + /// and y axis is oriented downwards. + /// The output convex hull. It is a vector of points that form the + /// hull (must have the same type as the input points). + public Point2f[] ConvexHullFloatPoints(InputArray points, bool clockwise = false) + { + var dst = new MatOfPoint2f(); + Cv2.ConvexHull(points, dst, clockwise, true); + return dst.ToArray(); + } + + /// + /// Computes convex hull for a set of 2D points. + /// + /// The input 2D point set, represented by CV_32SC2 or CV_32FC2 matrix + /// If true, the output convex hull will be oriented clockwise, + /// otherwise it will be oriented counter-clockwise. Here, the usual screen coordinate + /// system is assumed - the origin is at the top-left corner, x axis is oriented to the right, + /// and y axis is oriented downwards. + /// The output convex hull. It is a vector of 0-based point + /// indices of the hull points in the original array (since the set of convex hull + /// points is a subset of the original point set). + public int[] ConvexHullIndices(InputArray points, bool clockwise = false) + { + var dst = new MatOfInt(); + Cv2.ConvexHull(points, dst, clockwise, false); + return dst.ToArray(); + } + + /// + /// Computes the contour convexity defects + /// + /// Convex hull obtained using convexHull() that + /// should contain indices of the contour points that make the hull. + /// The output vector of convexity defects. + /// Each convexity defect is represented as 4-element integer vector + /// (a.k.a. cv::Vec4i): (start_index, end_index, farthest_pt_index, fixpt_depth), + /// where indices are 0-based indices in the original contour of the convexity defect beginning, + /// end and the farthest point, and fixpt_depth is fixed-point approximation + /// (with 8 fractional bits) of the distance between the farthest contour point and the hull. + /// That is, to get the floating-point value of the depth will be fixpt_depth/256.0. + public Mat ConvexityDefects(InputArray convexHull) + { + var dst = new Mat(); + Cv2.ConvexityDefects(this, convexHull, dst); + return dst; + } + + /// + /// Computes the contour convexity defects + /// + /// Convex hull obtained using convexHull() that + /// should contain indices of the contour points that make the hull. + /// The output vector of convexity defects. + /// Each convexity defect is represented as 4-element integer vector + /// (a.k.a. cv::Vec4i): (start_index, end_index, farthest_pt_index, fixpt_depth), + /// where indices are 0-based indices in the original contour of the convexity defect beginning, + /// end and the farthest point, and fixpt_depth is fixed-point approximation + /// (with 8 fractional bits) of the distance between the farthest contour point and the hull. + /// That is, to get the floating-point value of the depth will be fixpt_depth/256.0. + public Vec4i[] ConvexityDefectsAsVec(InputArray convexHull) + { + var dst = new MatOfInt4(); + Cv2.ConvexityDefects(this, convexHull, dst); + return dst.ToArray(); + } + + /// + /// Returns true if the contour is convex. + /// Does not support contours with self-intersection + /// + /// + public bool IsContourConvex() + { + return Cv2.IsContourConvex(this); + } + + /// + /// Fits ellipse to the set of 2D points. + /// + /// + public RotatedRect FitEllipse() + { + return Cv2.FitEllipse(this); + } + + /// + /// Fits line to the set of 2D points using M-estimator algorithm. + /// The input is vector of 2D points. + /// + /// Distance used by the M-estimator + /// Numerical parameter ( C ) for some types of distances. + /// If it is 0, an optimal value is chosen. + /// Sufficient accuracy for the radius + /// (distance between the coordinate origin and the line). + /// Sufficient accuracy for the angle. + /// 0.01 would be a good default value for reps and aeps. + /// Output line parameters. + public Line2D FitLine2D(DistanceTypes distType, double param, double reps, double aeps) + { + var line = new MatOfFloat(); + Cv2.FitLine(this, line, distType, param, reps, aeps); + return new Line2D(line.ToArray()); + } + + /// + /// Fits line to the set of 3D points using M-estimator algorithm. + /// The input is vector of 3D points. + /// + /// Distance used by the M-estimator + /// Numerical parameter ( C ) for some types of distances. + /// If it is 0, an optimal value is chosen. + /// Sufficient accuracy for the radius + /// (distance between the coordinate origin and the line). + /// Sufficient accuracy for the angle. + /// 0.01 would be a good default value for reps and aeps. + /// Output line parameters. + public Line3D FitLine3D(DistanceTypes distType, double param, double reps, double aeps) + { + var line = new MatOfFloat(); + Cv2.FitLine(this, line, distType, param, reps, aeps); + return new Line3D(line.ToArray()); + } + + /// + /// Checks if the point is inside the contour. + /// Optionally computes the signed distance from the point to the contour boundary. + /// + /// Point tested against the contour. + /// If true, the function estimates the signed distance + /// from the point to the nearest contour edge. Otherwise, the function only checks + /// if the point is inside a contour or not. + /// Positive (inside), negative (outside), or zero (on an edge) value. + public double PointPolygonTest(Point2f pt, bool measureDist) + { + return Cv2.PointPolygonTest(this, pt, measureDist); + } + + /// + /// Computes the distance transform map + /// + /// + /// + public MatOfFloat DistanceTransform(DistanceTypes distanceType, DistanceMaskSize maskSize) + { + var dst = new MatOfFloat(); + Cv2.DistanceTransform(this, dst, distanceType, maskSize); + return dst; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/core/MatExpr.cs b/src/OpenCvSharp/modules/core/MatExpr.cs new file mode 100644 index 000000000..3b11ae5c1 --- /dev/null +++ b/src/OpenCvSharp/modules/core/MatExpr.cs @@ -0,0 +1,1011 @@ +using System; +using System.Collections.Generic; +using System.Text; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// Matrix expression + /// + public sealed partial class MatExpr : DisposableCvObject + { + private bool disposed; + + #region Init & Disposal + /// + /// + /// + /// + internal MatExpr(IntPtr ptr) + { + this.ptr = ptr; + } + /// + /// + /// + /// + internal MatExpr(Mat mat) + { + if(mat == null) + throw new ArgumentNullException("mat"); + ptr = NativeMethods.core_MatExpr_new(mat.CvPtr); + } + + /// + /// + /// + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + //Console.WriteLine("MatExpr disposed"); + if (ptr != IntPtr.Zero) + { + NativeMethods.core_MatExpr_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Cast + /// + /// + /// + /// + /// + public static implicit operator Mat(MatExpr self) + { + try + { + IntPtr retPtr = NativeMethods.core_MatExpr_toMat(self.ptr); + Mat retVal = new Mat(retPtr); + return retVal; + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + /// + /// + /// + /// + public Mat ToMat() + { + return (Mat)this; + } + /// + /// + /// + /// + /// + public static implicit operator MatExpr(Mat mat) + { + return new MatExpr(mat); + } + /// + /// + /// + /// + /// + public static MatExpr FromMat(Mat mat) + { + return new MatExpr(mat); + } + #endregion + + #region Operators + #region Unary + /// + /// + /// + /// + /// + public static MatExpr operator +(MatExpr e) + { + return e; + } + + /// + /// + /// + /// + /// + public static MatExpr operator -(MatExpr e) + { + if (e == null) + throw new ArgumentNullException("e"); + e.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorUnaryMinus_MatExpr(e.CvPtr); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + + /// + /// + /// + /// + /// + public static MatExpr operator ~(MatExpr e) + { + if (e == null) + throw new ArgumentNullException("e"); + e.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorUnaryNot_MatExpr(e.CvPtr); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + #endregion + #region + + /// + /// + /// + /// + /// + /// + public static MatExpr operator +(MatExpr e, Mat m) + { + if (e == null) + throw new ArgumentNullException("e"); + if (m == null) + throw new ArgumentNullException("m"); + e.ThrowIfDisposed(); + m.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorAdd_MatExprMat(e.CvPtr, m.CvPtr); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + /// + /// + /// + /// + /// + /// + public static MatExpr operator +(Mat m, MatExpr e) + { + if (m == null) + throw new ArgumentNullException("m"); + if (e == null) + throw new ArgumentNullException("e"); + m.ThrowIfDisposed(); + e.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorAdd_MatMatExpr(m.CvPtr, e.CvPtr); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + /// + /// + /// + /// + /// + /// + public static MatExpr operator +(MatExpr e, Scalar s) + { + if (e == null) + throw new ArgumentNullException("e"); + e.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorAdd_MatExprScalar(e.CvPtr, s); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + /// + /// + /// + /// + /// + /// + public static MatExpr operator +(Scalar s, MatExpr e) + { + if (e == null) + throw new ArgumentNullException("e"); + e.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorAdd_ScalarMatExpr(s, e.CvPtr); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + /// + /// + /// + /// + /// + /// + public static MatExpr operator +(MatExpr e1, MatExpr e2) + { + if (e1 == null) + throw new ArgumentNullException("e1"); + if (e2 == null) + throw new ArgumentNullException("e2"); + e1.ThrowIfDisposed(); + e2.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorAdd_MatExprMatExpr(e1.CvPtr, e2.CvPtr); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + #endregion + #region - + /// + /// + /// + /// + /// + /// + public static MatExpr operator -(MatExpr e, Mat m) + { + if (e == null) + throw new ArgumentNullException("e"); + if (m == null) + throw new ArgumentNullException("m"); + e.ThrowIfDisposed(); + m.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorSubtract_MatExprMat(e.CvPtr, m.CvPtr); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + /// + /// + /// + /// + /// + /// + public static MatExpr operator -(Mat m, MatExpr e) + { + if (m == null) + throw new ArgumentNullException("m"); + if (e == null) + throw new ArgumentNullException("e"); + m.ThrowIfDisposed(); + e.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorSubtract_MatMatExpr(m.CvPtr, e.CvPtr); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + /// + /// + /// + /// + /// + /// + public static MatExpr operator -(MatExpr e, Scalar s) + { + if (e == null) + throw new ArgumentNullException("e"); + e.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorSubtract_MatExprScalar(e.CvPtr, s); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + /// + /// + /// + /// + /// + /// + public static MatExpr operator -(Scalar s, MatExpr e) + { + if (e == null) + throw new ArgumentNullException("e"); + e.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorSubtract_ScalarMatExpr(s, e.CvPtr); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + /// + /// + /// + /// + /// + /// + public static MatExpr operator -(MatExpr e1, MatExpr e2) + { + if (e1 == null) + throw new ArgumentNullException("e1"); + if (e2 == null) + throw new ArgumentNullException("e2"); + e1.ThrowIfDisposed(); + e2.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorSubtract_MatExprMatExpr(e1.CvPtr, e2.CvPtr); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + #endregion + #region * + /// + /// + /// + /// + /// + /// + public static MatExpr operator *(MatExpr e, Mat m) + { + if (e == null) + throw new ArgumentNullException("e"); + if (m == null) + throw new ArgumentNullException("m"); + e.ThrowIfDisposed(); + m.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorMultiply_MatExprMat(e.CvPtr, m.CvPtr); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + /// + /// + /// + /// + /// + /// + public static MatExpr operator *(Mat m, MatExpr e) + { + if (m == null) + throw new ArgumentNullException("m"); + if (e == null) + throw new ArgumentNullException("e"); + m.ThrowIfDisposed(); + e.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorMultiply_MatMatExpr(m.CvPtr, e.CvPtr); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + /// + /// + /// + /// + /// + /// + public static MatExpr operator *(MatExpr e, double s) + { + if (e == null) + throw new ArgumentNullException("e"); + e.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorMultiply_MatExprDouble(e.CvPtr, s); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + /// + /// + /// + /// + /// + /// + public static MatExpr operator *(double s, MatExpr e) + { + if (e == null) + throw new ArgumentNullException("e"); + e.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorMultiply_DoubleMatExpr(s, e.CvPtr); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + /// + /// + /// + /// + /// + /// + public static MatExpr operator *(MatExpr e1, MatExpr e2) + { + if (e1 == null) + throw new ArgumentNullException("e1"); + if (e2 == null) + throw new ArgumentNullException("e2"); + e1.ThrowIfDisposed(); + e2.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorMultiply_MatExprMatExpr(e1.CvPtr, e2.CvPtr); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + #endregion + #region / + /// + /// + /// + /// + /// + /// + public static MatExpr operator /(MatExpr e, Mat m) + { + if (e == null) + throw new ArgumentNullException("e"); + if (m == null) + throw new ArgumentNullException("m"); + e.ThrowIfDisposed(); + m.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorDivide_MatExprMat(e.CvPtr, m.CvPtr); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + /// + /// + /// + /// + /// + /// + public static MatExpr operator /(Mat m, MatExpr e) + { + if (m == null) + throw new ArgumentNullException("m"); + if (e == null) + throw new ArgumentNullException("e"); + m.ThrowIfDisposed(); + e.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorDivide_MatMatExpr(m.CvPtr, e.CvPtr); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + /// + /// + /// + /// + /// + /// + public static MatExpr operator /(MatExpr e, double s) + { + if (e == null) + throw new ArgumentNullException("e"); + e.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorDivide_MatExprDouble(e.CvPtr, s); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + /// + /// + /// + /// + /// + /// + public static MatExpr operator /(double s, MatExpr e) + { + if (e == null) + throw new ArgumentNullException("e"); + e.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorDivide_DoubleMatExpr(s, e.CvPtr); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + /// + /// + /// + /// + /// + /// + public static MatExpr operator /(MatExpr e1, MatExpr e2) + { + if (e1 == null) + throw new ArgumentNullException("e1"); + if (e2 == null) + throw new ArgumentNullException("e2"); + e1.ThrowIfDisposed(); + e2.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_operatorDivide_MatExprMatExpr(e1.CvPtr, e2.CvPtr); + return new MatExpr(retPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + #endregion + #endregion + + #region Methods + + #region Indexers + /// + /// + /// + /// + /// + /// + /// + /// + public MatExpr this[int rowStart, int rowEnd, int colStart, int colEnd] + { + get + { + return SubMat(rowStart, rowEnd, colStart, colEnd); + } + } + + /// + /// + /// + /// + /// + /// + public MatExpr this[Range rowRange, Range colRange] + { + get + { + return SubMat(rowRange, colRange); + } + set + { + if (value == null) + throw new ArgumentNullException("value"); + MatExpr subMatExpr = SubMat(rowRange, colRange); + NativeMethods.core_Mat_assignment_FromMatExpr(subMatExpr.CvPtr, value.CvPtr); + } + } + + /// + /// + /// + /// + /// + public MatExpr this[Rect roi] + { + get + { + return SubMat(roi); + } + set + { + if (value == null) + throw new ArgumentNullException("value"); + MatExpr subMatExpr = SubMat(roi); + NativeMethods.core_Mat_assignment_FromMatExpr(subMatExpr.CvPtr, value.CvPtr); + } + } + #endregion + + #region Col + /// + /// + /// + public class ColIndexer : MatExprRowColIndexer + { + /// + /// + /// + /// + protected internal ColIndexer(MatExpr parent) + : base(parent) + { + } + /// + /// + /// + /// + /// + public override MatExpr this[int x] + { + get + { + parent.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_MatExpr_col(parent.CvPtr, x); + return new MatExpr(retPtr); + } + } + } + /// + /// + /// + public ColIndexer Col + { + get + { + if (col == null) + col = new ColIndexer(this); + return col; + } + } + private ColIndexer col = null; + #endregion + #region Cross + /// + /// + /// + /// + /// + public Mat Cross(Mat m) + { + ThrowIfDisposed(); + m.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_MatExpr_cross(ptr, m.CvPtr); + Mat retVal = new Mat(retPtr); + return retVal; + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + #endregion + #region Diag + /// + /// + /// + /// + /// + public MatExpr Diag(int d = 0) + { + ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_MatExpr_diag(ptr, d); + MatExpr retVal = new MatExpr(retPtr); + return retVal; + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + #endregion + #region Dot + /// + /// + /// + /// + /// + public double Dot(Mat m) + { + ThrowIfDisposed(); + m.ThrowIfDisposed(); + try + { + return NativeMethods.core_MatExpr_dot(ptr, m.CvPtr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + #endregion + #region Inv + /// + /// + /// + /// + /// + public MatExpr Inv(DecompTypes method = DecompTypes.LU) + { + ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_MatExpr_inv(ptr, (int)method); + MatExpr retVal = new MatExpr(retPtr); + return retVal; + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + #endregion + #region Mul + /// + /// + /// + /// + /// + /// + public MatExpr Mul(MatExpr e, double scale = 1.0) + { + ThrowIfDisposed(); + e.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_MatExpr_mul_toMatExpr(ptr, e.CvPtr, scale); + MatExpr retVal = new MatExpr(retPtr); + return retVal; + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + /// + /// + /// + /// + /// + /// + public MatExpr Mul(Mat m, double scale = 1.0) + { + ThrowIfDisposed(); + m.ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_MatExpr_mul_toMat(ptr, m.CvPtr, scale); + MatExpr retVal = new MatExpr(retPtr); + return retVal; + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + #endregion + #region Row + /// + /// + /// + public class RowIndexer : MatExprRowColIndexer + { + /// + /// + /// + /// + protected internal RowIndexer(MatExpr parent) + : base(parent) + { + } + /// + /// + /// + /// + /// + public override MatExpr this[int y] + { + get + { + parent.ThrowIfDisposed(); + IntPtr retPtr = NativeMethods.core_MatExpr_row(parent.CvPtr, y); + return new MatExpr(retPtr); + } + } + } + /// + /// + /// + public RowIndexer Row + { + get + { + if(row == null) + row = new RowIndexer(this); + return row; + } + } + private RowIndexer row = null; + #endregion + #region + /// + /// + /// + public Size Size + { + get + { + ThrowIfDisposed(); + try + { + return NativeMethods.core_MatExpr_size(ptr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + } + #endregion + #region SubMat + /// + /// + /// + /// + /// + /// + /// + /// + public MatExpr SubMat(int rowStart, int rowEnd, int colStart, int colEnd) + { + ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_MatExpr_submat(ptr, rowStart, rowEnd, colStart, colEnd); + MatExpr retVal = new MatExpr(retPtr); + return retVal; + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + /// + /// + /// + /// + /// + /// + public MatExpr SubMat(Range rowRange, Range colRange) + { + return SubMat(rowRange.Start, rowRange.End, colRange.Start, colRange.End); + } + /// + /// + /// + /// + /// + public MatExpr SubMat(Rect roi) + { + return SubMat(roi.Y, roi.Y + roi.Height, roi.X, roi.X + roi.Width); + } + #endregion + #region T + /// + /// + /// + /// + public MatExpr T() + { + ThrowIfDisposed(); + try + { + IntPtr retPtr = NativeMethods.core_MatExpr_t(ptr); + MatExpr retVal = new MatExpr(retPtr); + return retVal; + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + #endregion + #region Type + /// + /// + /// + public MatType Type + { + get + { + ThrowIfDisposed(); + try + { + return (MatType)NativeMethods.core_MatExpr_type(ptr); + } + catch (BadImageFormatException ex) + { + throw PInvokeHelper.CreateException(ex); + } + } + } + #endregion + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/core/MatExprRangeIndexer.cs b/src/OpenCvSharp/modules/core/MatExprRangeIndexer.cs new file mode 100644 index 000000000..d772ff066 --- /dev/null +++ b/src/OpenCvSharp/modules/core/MatExprRangeIndexer.cs @@ -0,0 +1,130 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// + /// + public abstract class MatExprRangeIndexer + { + /// + /// + /// + protected readonly Mat parent; + + /// + /// + /// + /// + protected internal MatExprRangeIndexer(Mat parent) + { + this.parent = parent; + } + + /// + /// Creates a matrix header for the specified matrix row/column. + /// + /// + /// + /// + /// + /// + public abstract MatExpr this[int rowStart, int rowEnd, int colStart, int colEnd] { get; set; } + + /// + /// Creates a matrix header for the specified row/column span. + /// + /// + /// + /// + public abstract MatExpr this[Range rowRange, Range colRange] { get; set; } + + /// + /// Creates a matrix header for the specified row/column span. + /// + /// + /// + public virtual MatExpr this[Rect roi] + { + get { return this[roi.Top, roi.Bottom, roi.Left, roi.Right]; } + set { this[roi.Top, roi.Bottom, roi.Left, roi.Right] = value; } + } + + /// + /// Extracts a rectangular submatrix. + /// + /// Array of selected ranges along each array dimension. + /// + public abstract MatExpr this[params Range[] ranges] { get; set; } + + /// + /// Creates a matrix header for the specified matrix row/column. + /// + /// + /// + /// + /// + /// + public MatExpr Get(int rowStart, int rowEnd, int colStart, int colEnd) + { + return this[rowStart, rowEnd, colStart, colEnd]; + } + /// + /// Creates a matrix header for the specified row/column span. + /// + /// + /// + /// + public MatExpr Get(Range rowRange, Range colRange) + { + return this[rowRange, colRange]; + } + /// + /// Creates a matrix header for the specified row/column span. + /// + /// + /// + public MatExpr Get(Rect roi) + { + return this[roi]; + } + + /// + /// Sets a matrix header for the specified matrix row/column. + /// + /// + /// + /// + /// + /// + /// + public void Set(int rowStart, int rowEnd, int colStart, int colEnd, MatExpr value) + { + this[rowStart, rowEnd, colStart, colEnd] = value; + } + + /// + /// Sets a matrix header for the specified matrix row/column span. + /// + /// + /// + /// + /// + public void Set(Range rowRange, Range colRange, MatExpr value) + { + this[rowRange, colRange] = value; + } + /// + /// Sets a matrix header for the specified matrix row/column span. + /// + /// + /// + /// + public void Set(Rect roi, MatExpr value) + { + this[roi] = value; + } + } +} diff --git a/src/OpenCvSharp/modules/core/MatExprRowColIndexer.cs b/src/OpenCvSharp/modules/core/MatExprRowColIndexer.cs new file mode 100644 index 000000000..bf3624887 --- /dev/null +++ b/src/OpenCvSharp/modules/core/MatExprRowColIndexer.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// + /// + public abstract class MatExprRowColIndexer + { + /// + /// + /// + protected readonly MatExpr parent; + + /// + /// + /// + /// + protected internal MatExprRowColIndexer(MatExpr parent) + { + this.parent = parent; + } + + /// + /// + /// + /// + /// + public abstract MatExpr this[int pos] { get; } + + /// + /// + /// + /// + /// + public virtual MatExpr Get(int pos) + { + return this[pos]; + } + } +} diff --git a/src/OpenCvSharp/modules/core/MatExpr_CvMethods.cs b/src/OpenCvSharp/modules/core/MatExpr_CvMethods.cs new file mode 100644 index 000000000..62cedc6fe --- /dev/null +++ b/src/OpenCvSharp/modules/core/MatExpr_CvMethods.cs @@ -0,0 +1,16 @@ +using System; + +namespace OpenCvSharp +{ + partial class MatExpr + { + /// + /// Computes absolute value of each matrix element + /// + /// + public MatExpr Abs() + { + return Cv2.Abs(this); + } + } +} diff --git a/src/OpenCvSharp/modules/core/MatRowColExprIndexer.cs b/src/OpenCvSharp/modules/core/MatRowColExprIndexer.cs new file mode 100644 index 000000000..4888723d0 --- /dev/null +++ b/src/OpenCvSharp/modules/core/MatRowColExprIndexer.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// + /// + public abstract class MatRowColExprIndexer + { + /// + /// + /// + protected readonly Mat parent; + + /// + /// + /// + /// + protected internal MatRowColExprIndexer(Mat parent) + { + this.parent = parent; + } + + /// + /// Creates a matrix header for the specified matrix row/column. + /// + /// + /// + public abstract MatExpr this[int pos] { get; set; } + + /// + /// Creates a matrix header for the specified row/column span. + /// + /// + /// + /// + public abstract MatExpr this[int start, int end] { get; set; } + + /// + /// Creates a matrix header for the specified row/column span. + /// + /// + /// + public virtual MatExpr this[Range range] + { + get { return this[range.Start, range.End]; } + set { this[range.Start, range.End] = value; } + } + + /// + /// Creates a matrix header for the specified matrix row/column. + /// + /// + /// + public MatExpr Get(int pos) + { + return this[pos]; + } + /// + /// Creates a matrix header for the specified row/column span. + /// + /// + /// + /// + public MatExpr Get(int start, int end) + { + return this[start, end]; + } + /// + /// Creates a matrix header for the specified row/column span. + /// + /// + /// + public MatExpr Get(Range range) + { + return this[range]; + } + + /// + /// Sets a matrix header for the specified matrix row/column. + /// + /// + /// + /// + public void Set(int pos, MatExpr value) + { + this[pos] = value; + } + + /// + /// Sets a matrix header for the specified matrix row/column span. + /// + /// + /// + /// + /// + public void Set(int start, int end, MatExpr value) + { + this[start, end] = value; + } + /// + /// Sets a matrix header for the specified matrix row/column span. + /// + /// + /// + /// + public void Set(Range range, MatExpr value) + { + this[range] = value; + } + } +} diff --git a/src/OpenCvSharp/modules/core/MatRowColIndexer.cs b/src/OpenCvSharp/modules/core/MatRowColIndexer.cs new file mode 100644 index 000000000..4db3fcf2e --- /dev/null +++ b/src/OpenCvSharp/modules/core/MatRowColIndexer.cs @@ -0,0 +1,109 @@ +using System; + +namespace OpenCvSharp +{ + /// + /// + /// + public abstract class MatRowColIndexer + { + /// + /// + /// + protected readonly Mat parent; + + /// + /// + /// + /// + protected internal MatRowColIndexer(Mat parent) + { + this.parent = parent; + } + + /// + /// Creates/Sets a matrix header for the specified matrix row/column. + /// + /// + /// + public abstract Mat this[int pos] { get; set; } + + /// + /// Creates/Sets a matrix header for the specified row/column span. + /// + /// + /// + /// + public abstract Mat this[int start, int end] { get; set; } + + /// + /// Creates/Sets a matrix header for the specified row/column span. + /// + /// + /// + public virtual Mat this[Range range] + { + get { return this[range.Start, range.End]; } + } + + /// + /// Creates a matrix header for the specified matrix row/column. + /// + /// + /// + public virtual Mat Get(int pos) + { + return this[pos]; + } + /// + /// Creates a matrix header for the specified row/column span. + /// + /// + /// + /// + public virtual Mat Get(int start, int end) + { + return this[start, end]; + } + /// + /// Creates a matrix header for the specified row/column span. + /// + /// + /// + public virtual Mat Get(Range range) + { + return this[range]; + } + + /// + /// Creates/Sets a matrix header for the specified matrix row/column. + /// + /// + /// + public virtual void Set(int pos, Mat value) + { + this[pos] = value; + } + + /// + /// Creates/Sets a matrix header for the specified row/column span. + /// + /// + /// + /// + public virtual void Set(int start, int end, Mat value) + { + this[start, end] = value; + } + + /// + /// Creates/Sets a matrix header for the specified row/column span. + /// + /// + /// + public virtual void Set(Range range, Mat value) + { + this[range.Start, range.End] = value; + } + } +} diff --git a/src/OpenCvSharp/modules/core/OutputArray.cs b/src/OpenCvSharp/modules/core/OutputArray.cs new file mode 100644 index 000000000..163a418b3 --- /dev/null +++ b/src/OpenCvSharp/modules/core/OutputArray.cs @@ -0,0 +1,276 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Gpu; + +namespace OpenCvSharp +{ + /// + /// Proxy datatype for passing Mat's and List<>'s as output parameters + /// + public class OutputArray : DisposableCvObject + { + private bool disposed; + private readonly object obj; + + #region Init & Disposal + /// + /// + /// + /// + internal OutputArray(Mat mat) + { + if (mat == null) + throw new ArgumentNullException("mat"); + ptr = NativeMethods.core_OutputArray_new_byMat(mat.CvPtr); + obj = mat; + } + + /// + /// + /// + /// + internal OutputArray(GpuMat mat) + { + if (mat == null) + throw new ArgumentNullException("mat"); + ptr = NativeMethods.core_OutputArray_new_byGpuMat(mat.CvPtr); + obj = mat; + } + + /// + /// + /// + /// + internal OutputArray(IEnumerable mat) + { + if (mat == null) + throw new ArgumentNullException("mat"); + using (var matVector = new VectorOfMat(mat)) + { + ptr = NativeMethods.core_OutputArray_new_byVectorOfMat(matVector.CvPtr); + } + obj = mat; + } + + /// + /// + /// + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (ptr != IntPtr.Zero) + { + NativeMethods.core_OutputArray_delete(ptr); + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Cast + /// + /// + /// + /// + /// + public static implicit operator OutputArray(Mat mat) + { + return new OutputArray(mat); + } + + /// + /// + /// + /// + /// + public static implicit operator OutputArray(GpuMat mat) + { + return new OutputArray(mat); + } + + #endregion + + #region Operators + #endregion + + #region Methods + /// + /// + /// + /// + public bool IsMat() + { + return obj is Mat; + } + + /// + /// + /// + /// + public virtual Mat GetMat() + { + return obj as Mat; + } + + /// + /// + /// + /// + public bool IsGpuMat() + { + return obj is GpuMat; + } + + /// + /// + /// + /// + public virtual Mat GetGpuMat() + { + return obj as GpuMat; + } + + /// + /// + /// + /// + public bool IsVectorOfMat() + { + return obj is IEnumerable; + } + + /// + /// + /// + /// + public virtual IEnumerable GetVectorOfMat() + { + return obj as IEnumerable; + } + + /// + /// + /// + public virtual void AssignResult() + { + if (!IsReady()) + throw new NotSupportedException(); + + // OutputArrayの実体が cv::Mat のとき + if (IsMat()) + { + // 実は、何もしなくても結果入ってるっぽい? + /* + Mat mat = GetMat(); + // OutputArrayからMatオブジェクトを取得 + IntPtr outMat = NativeMethods.core_OutputArray_getMat(ptr); + // ポインタをセット + //NativeMethods.core_Mat_assignment_FromMat(mat.CvPtr, outMat); + NativeMethods.core_Mat_assignTo(outMat, mat.CvPtr); + // OutputArrayから取り出したMatをdelete + NativeMethods.core_Mat_delete(outMat); + */ + } + else if (IsGpuMat()) + { + // do nothing + } + else + { + throw new OpenCvSharpException("Not supported OutputArray-compatible type"); + } + } + + /// + /// + /// + public void Fix() + { + AssignResult(); + Dispose(); + } + + /// + /// + /// + /// + public bool IsReady() + { + return + ptr != IntPtr.Zero && + !disposed && + obj != null && + (IsMat() || IsGpuMat()); + } + /// + /// + /// + /// + public void ThrowIfNotReady() + { + if (!IsReady()) + throw new OpenCvSharpException("Invalid OutputArray"); + } + + /// + /// Creates a proxy class of the specified matrix + /// + /// + /// + public static OutputArray Create(Mat mat) + { + return new OutputArray(mat); + } + + /// + /// Creates a proxy class of the specified matrix + /// + /// + /// + public static OutputArray Create(GpuMat mat) + { + return new OutputArray(mat); + } + + /// + /// Creates a proxy class of the specified list + /// + /// + /// + /// + public static OutputArrayOfStructList Create(List list) + where T : struct + { + if (list == null) + throw new ArgumentNullException("list"); + return new OutputArrayOfStructList(list); + } + + /// + /// Creates a proxy class of the specified list + /// + /// + /// + public static OutputArrayOfMatList Create(List list) + { + if (list == null) + throw new ArgumentNullException("list"); + return new OutputArrayOfMatList(list); + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/core/OutputArrayOfMatList.cs b/src/OpenCvSharp/modules/core/OutputArrayOfMatList.cs new file mode 100644 index 000000000..1c438330f --- /dev/null +++ b/src/OpenCvSharp/modules/core/OutputArrayOfMatList.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; + +namespace OpenCvSharp +{ + /// + /// Proxy datatype for passing Mat's and List<>'s as output parameters + /// + public sealed class OutputArrayOfMatList : OutputArray + { + private bool disposed; + private List list; + + /// + /// + /// + /// + internal OutputArrayOfMatList(List list) + : base(list) + { + if (list == null) + throw new ArgumentNullException("list"); + this.list = list; + } + + /// + /// + /// + /// + public override IEnumerable GetVectorOfMat() + { + return list; + } + + /// + /// + /// + public override void AssignResult() + { + if (!IsReady()) + throw new NotSupportedException(); + + // Matで結果取得 + using (var vectorOfMat = new VectorOfMat()) + { + NativeMethods.core_OutputArray_getVectorOfMat(ptr, vectorOfMat.CvPtr); + list.Clear(); + list.AddRange(vectorOfMat.ToArray()); + } + } + + /// + /// + /// + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + list = null; + disposed = true; + base.Dispose(disposing); + } + } + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/core/OutputArrayOfStructList.cs b/src/OpenCvSharp/modules/core/OutputArrayOfStructList.cs new file mode 100644 index 000000000..4adcffd37 --- /dev/null +++ b/src/OpenCvSharp/modules/core/OutputArrayOfStructList.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// Proxy datatype for passing Mat's and List<>'s as output parameters + /// + public sealed class OutputArrayOfStructList : OutputArray + where T : struct + { + private bool disposed; + private List list; + + /// + /// + /// + /// + internal OutputArrayOfStructList(List list) + : base(new Mat()) + { + if (list == null) + throw new ArgumentNullException("list"); + this.list = list; + } + + /// + /// + /// + public override void AssignResult() + { + if (!IsReady()) + throw new NotSupportedException(); + + // Matで結果取得 + IntPtr matPtr = NativeMethods.core_OutputArray_getMat(ptr); + using (Mat mat = new Mat(matPtr)) + { + // 配列サイズ + int size = mat.Rows * mat.Cols; + // 配列にコピー + T[] array = new T[size]; + using (ArrayAddress1 aa = new ArrayAddress1(array)) + { + int elemSize = Marshal.SizeOf(typeof(T)); + Utility.CopyMemory(aa.Pointer, mat.Data, size * elemSize); + } + // リストにコピー + list.Clear(); + list.AddRange(array); + } + } + + /// + /// + /// + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + list = null; + disposed = true; + base.Dispose(disposing); + } + } + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/core/PCA.cs b/src/OpenCvSharp/modules/core/PCA.cs new file mode 100644 index 000000000..025cfe467 --- /dev/null +++ b/src/OpenCvSharp/modules/core/PCA.cs @@ -0,0 +1,291 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// Principal Component Analysis + /// + public class PCA : DisposableCvObject + { + private bool disposed; + + #region Init & Disposal + /// + /// + /// + public PCA() + { + ptr = NativeMethods.core_PCA_new1(); + } + /// + /// + /// + /// + /// + /// + /// + public PCA(InputArray data, InputArray mean, Flags flags, int maxComponents = 0) + { + if (data == null) + throw new ArgumentNullException("data"); + if (mean == null) + throw new ArgumentNullException("mean"); + data.ThrowIfDisposed(); + mean.ThrowIfDisposed(); + ptr = NativeMethods.core_PCA_new2(data.CvPtr, mean.CvPtr, (int)flags, maxComponents); + } + /// + /// + /// + /// + /// + /// + /// + public PCA(InputArray data, InputArray mean, Flags flags, double retainedVariance) + { + if (data == null) + throw new ArgumentNullException("data"); + if (mean == null) + throw new ArgumentNullException("mean"); + data.ThrowIfDisposed(); + mean.ThrowIfDisposed(); + ptr = NativeMethods.core_PCA_new3(data.CvPtr, mean.CvPtr, (int)flags, retainedVariance); + } + + /// + /// + /// + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (ptr != IntPtr.Zero) + { + NativeMethods.core_PCA_delete(ptr); + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + /// + /// eigenvalues of the covariation matrix + /// + public Mat Eigenvectors + { + get + { + if (disposed) + throw new ObjectDisposedException("PCA"); + IntPtr ret = NativeMethods.core_PCA_eigenvectors(ptr); + return new Mat(ret); + } + } + + /// + /// eigenvalues of the covariation matrix + /// + public Mat Eigenvalues + { + get + { + if(disposed) + throw new ObjectDisposedException("PCA"); + IntPtr ret = NativeMethods.core_PCA_eigenvalues(ptr); + return new Mat(ret); + } + } + + /// + /// mean value subtracted before the projection and added after the back projection + /// + public Mat Mean + { + get + { + if (disposed) + throw new ObjectDisposedException("PCA"); + IntPtr ret = NativeMethods.core_PCA_mean(ptr); + return new Mat(ret); + } + } + #endregion + + #region Methods + /// + /// operator that performs PCA. The previously stored data, if any, is released + /// + /// + /// + /// + /// + /// + public PCA Compute(InputArray data, InputArray mean, Flags flags, int maxComponents = 0) + { + if (disposed) + throw new ObjectDisposedException("PCA"); + if (data == null) + throw new ArgumentNullException("data"); + if (mean == null) + throw new ArgumentNullException("mean"); + data.ThrowIfDisposed(); + mean.ThrowIfDisposed(); + NativeMethods.core_PCA_operatorThis(ptr, data.CvPtr, mean.CvPtr, (int)flags, maxComponents); + return this; + } + + /// + /// operator that performs PCA. The previously stored data, if any, is released + /// + /// + /// + /// + /// + /// + public PCA ComputeVar(InputArray data, InputArray mean, Flags flags, double retainedVariance) + { + if (disposed) + throw new ObjectDisposedException("PCA"); + if (data == null) + throw new ArgumentNullException("data"); + if (mean == null) + throw new ArgumentNullException("mean"); + data.ThrowIfDisposed(); + mean.ThrowIfDisposed(); + NativeMethods.core_PCA_computeVar(ptr, data.CvPtr, mean.CvPtr, (int)flags, retainedVariance); + return this; + } + + /// + /// projects vector from the original space to the principal components subspace + /// + /// + /// + public Mat Project(InputArray vec) + { + if (disposed) + throw new ObjectDisposedException("PCA"); + if (vec == null) + throw new ArgumentNullException("vec"); + vec.ThrowIfDisposed(); + IntPtr ret = NativeMethods.core_PCA_project(ptr, vec.CvPtr); + return new Mat(ret); + } + /// + /// projects vector from the original space to the principal components subspace + /// + /// + /// + public void Project(InputArray vec, OutputArray result) + { + if (disposed) + throw new ObjectDisposedException("PCA"); + if (vec == null) + throw new ArgumentNullException("vec"); + if (result == null) + throw new ArgumentNullException("result"); + vec.ThrowIfDisposed(); + result.ThrowIfNotReady(); + NativeMethods.core_PCA_project(ptr, vec.CvPtr, result.CvPtr); + result.Fix(); + } + + /// + /// reconstructs the original vector from the projection + /// + /// + /// + public Mat BackProject(InputArray vec) + { + if (disposed) + throw new ObjectDisposedException("PCA"); + if (vec == null) + throw new ArgumentNullException("vec"); + vec.ThrowIfDisposed(); + IntPtr ret = NativeMethods.core_PCA_backProject(ptr, vec.CvPtr); + return new Mat(ret); + } + /// + /// reconstructs the original vector from the projection + /// + /// + /// + public void BackProject(InputArray vec, OutputArray result) + { + if (disposed) + throw new ObjectDisposedException("PCA"); + if (vec == null) + throw new ArgumentNullException("vec"); + if (result == null) + throw new ArgumentNullException("result"); + vec.ThrowIfDisposed(); + result.ThrowIfNotReady(); + NativeMethods.core_PCA_backProject(ptr, vec.CvPtr, result.CvPtr); + result.Fix(); + } + #endregion + +#if LANG_JP + /// + /// PCAの操作フラグ + /// +#else + /// + /// Flags for PCA operations + /// +#endif + [System.Flags] + public enum Flags : int + { +#if LANG_JP + /// + /// 行としてベクトルが保存される(つまり,あるベクトルの全ての要素は連続的に保存される) + /// +#else + /// + /// The vectors are stored as rows (i.e. all the components of a certain vector are stored continously) + /// +#endif + DataAsRow = 0, + + +#if LANG_JP + /// + /// 列としてベクトルが保存される(つまり,あるベクトル成分に属する値は連続的に保存される) + /// +#else + /// + /// The vectors are stored as columns (i.e. values of a certain vector component are stored continuously) + /// +#endif + DataAsCol = 1, + + +#if LANG_JP + /// + /// 事前に計算された平均ベクトルを用いる + /// +#else + /// + /// Use pre-computed average vector + /// +#endif + UseAvg = 2, + } + } +} diff --git a/src/OpenCvSharp/modules/core/Ptr.cs b/src/OpenCvSharp/modules/core/Ptr.cs new file mode 100644 index 000000000..47342cd41 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Ptr.cs @@ -0,0 +1,185 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Face; +using OpenCvSharp.ML; +using OpenCvSharp.XFeatures2D; + +namespace OpenCvSharp +{ + /// + /// Template class for smart reference-counting pointers + /// + /// + internal class Ptr : DisposableCvObject + { + private delegate void ReleaseFunc(IntPtr ptr); + + private delegate IntPtr ObjFunc(IntPtr ptr); + + private bool disposed; + private readonly ReleaseFunc releaseFunc; + private readonly ObjFunc getFunc; + + private static readonly Dictionary definedReleaseFunctions; + private static readonly Dictionary definedGetFunctions; + + /// + /// Static constructor + /// + static Ptr() + { + definedReleaseFunctions = new Dictionary + { + {typeof (Algorithm), NativeMethods.core_Ptr_Algorithm_delete}, + {typeof (FaceRecognizer), NativeMethods.face_Ptr_FaceRecognizer_delete}, + {typeof (DescriptorMatcher), NativeMethods.features2d_Ptr_DescriptorMatcher_delete}, + {typeof (BFMatcher), NativeMethods.features2d_Ptr_BFMatcher_delete}, + {typeof (FlannBasedMatcher), NativeMethods.features2d_Ptr_FlannBasedMatcher_delete}, + {typeof (Feature2D), NativeMethods.features2d_Ptr_Feature2D_delete}, + {typeof (BRISK), NativeMethods.features2d_Ptr_BRISK_delete}, + //{ typeof(DenseFeatureDetector), NativeMethods.features2d_Ptr_DenseFeatureDetector_delete }, + {typeof (FastFeatureDetector), NativeMethods.features2d_Ptr_FastFeatureDetector_delete}, + {typeof (FREAK), NativeMethods.xfeatures2d_Ptr_FREAK_delete}, + {typeof (AgastFeatureDetector), NativeMethods.features2d_Ptr_AgastFeatureDetector_delete}, + {typeof (GFTTDetector), NativeMethods.features2d_Ptr_GFTTDetector_delete}, + {typeof (KAZE), NativeMethods.features2d_Ptr_KAZE_delete}, + {typeof (AKAZE), NativeMethods.features2d_Ptr_AKAZE_delete}, + {typeof (MSER), NativeMethods.features2d_Ptr_MSER_delete}, + {typeof (ORB), NativeMethods.features2d_Ptr_ORB_delete}, + {typeof (SimpleBlobDetector), NativeMethods.features2d_Ptr_SimpleBlobDetector_delete}, + {typeof (StarDetector), NativeMethods.xfeatures2d_Ptr_StarDetector_delete}, + {typeof (BriefDescriptorExtractor), NativeMethods.xfeatures2d_Ptr_BriefDescriptorExtractor_delete}, + {typeof (SIFT), NativeMethods.xfeatures2d_Ptr_SIFT_delete}, + {typeof (SURF), NativeMethods.xfeatures2d_Ptr_SURF_delete}, + {typeof (FrameSource), NativeMethods.superres_Ptr_FrameSource_delete}, + {typeof (SuperResolution), NativeMethods.superres_Ptr_SuperResolution_delete}, + {typeof (DenseOpticalFlowExt), NativeMethods.superres_Ptr_DenseOpticalFlowExt_delete}, + {typeof (DenseOpticalFlow), NativeMethods.video_Ptr_DenseOpticalFlow_delete}, + {typeof (BackgroundSubtractor), NativeMethods.video_Ptr_BackgroundSubtractor_delete}, + {typeof (BackgroundSubtractorMOG2), NativeMethods.video_Ptr_BackgroundSubtractorMOG2_delete}, + {typeof (BackgroundSubtractorKNN), NativeMethods.video_Ptr_BackgroundSubtractorKNN_delete}, + {typeof (BackgroundSubtractorMOG), NativeMethods.bgsegm_Ptr_BackgroundSubtractorMOG_delete}, + {typeof (BackgroundSubtractorGMG), NativeMethods.bgsegm_Ptr_BackgroundSubtractorGMG_delete}, + {typeof (GeneralizedHoughBallard), NativeMethods.imgproc_Ptr_GeneralizedHoughBallard_delete}, + {typeof (GeneralizedHoughGuil), NativeMethods.imgproc_Ptr_GeneralizedHoughGuil_delete}, + {typeof (CLAHE), NativeMethods.imgproc_Ptr_CLAHE_delete}, + {typeof (LineSegmentDetector), NativeMethods.imgproc_Ptr_LineSegmentDetector_delete}, + {typeof (StereoBM), NativeMethods.calib3d_Ptr_StereoBM_delete}, + {typeof (StereoSGBM), NativeMethods.calib3d_Ptr_StereoSGBM_delete}, + {typeof (SVM), NativeMethods.ml_Ptr_SVM_delete}, + {typeof (EM), NativeMethods.ml_Ptr_EM_delete}, + {typeof (NormalBayesClassifier), NativeMethods.ml_Ptr_NormalBayesClassifier_delete}, + {typeof (KNearest), NativeMethods.ml_Ptr_KNearest_delete}, + {typeof (DTrees), NativeMethods.ml_Ptr_DTrees_delete}, + {typeof (RTrees), NativeMethods.ml_Ptr_RTrees_delete}, + {typeof (Boost), NativeMethods.ml_Ptr_Boost_delete}, + {typeof (ANN_MLP), NativeMethods.ml_Ptr_ANN_MLP_delete}, + {typeof (LogisticRegression), NativeMethods.ml_Ptr_LogisticRegression_delete}, + {typeof (Stitcher), NativeMethods.stitching_Ptr_Stitcher_delete}, + {typeof (ShapeContextDistanceExtractor), NativeMethods.shape_Ptr_ShapeContextDistanceExtractor_delete}, + {typeof (HausdorffDistanceExtractor), NativeMethods.shape_Ptr_HausdorffDistanceExtractor_delete}, + {typeof (CalibrateDebevec), NativeMethods.photo_Ptr_CalibrateDebevec_delete}, + }; + definedGetFunctions = new Dictionary + { + {typeof (Algorithm), NativeMethods.core_Ptr_Algorithm_get}, + {typeof (FaceRecognizer), NativeMethods.face_Ptr_FaceRecognizer_get}, + {typeof (DescriptorMatcher), NativeMethods.features2d_Ptr_DescriptorMatcher_get}, + {typeof (BFMatcher), NativeMethods.features2d_Ptr_BFMatcher_get}, + {typeof (FlannBasedMatcher), NativeMethods.features2d_Ptr_FlannBasedMatcher_get}, + {typeof (Feature2D), NativeMethods.features2d_Ptr_Feature2D_get}, + {typeof (BRISK), NativeMethods.features2d_Ptr_BRISK_get}, + //{ typeof(DenseFeatureDetector), NativeMethods.features2d_Ptr_DenseFeatureDetector_get }, + {typeof (FastFeatureDetector), NativeMethods.features2d_Ptr_FastFeatureDetector_get}, + {typeof (FREAK), NativeMethods.xfeatures2d_Ptr_FREAK_get}, + {typeof (AgastFeatureDetector), NativeMethods.features2d_Ptr_AgastFeatureDetector_get}, + {typeof (GFTTDetector), NativeMethods.features2d_Ptr_GFTTDetector_get}, + {typeof (KAZE), NativeMethods.features2d_Ptr_KAZE_get}, + {typeof (AKAZE), NativeMethods.features2d_Ptr_AKAZE_get}, + {typeof (MSER), NativeMethods.features2d_Ptr_MSER_get}, + {typeof (ORB), NativeMethods.features2d_Ptr_ORB_get}, + {typeof (SimpleBlobDetector), NativeMethods.features2d_Ptr_SimpleBlobDetector_get}, + {typeof (StarDetector), NativeMethods.xfeatures2d_Ptr_StarDetector_get}, + {typeof (BriefDescriptorExtractor), NativeMethods.xfeatures2d_Ptr_BriefDescriptorExtractor_get}, + {typeof (SIFT), NativeMethods.xfeatures2d_Ptr_SIFT_get}, + {typeof (SURF), NativeMethods.xfeatures2d_Ptr_SURF_get}, + {typeof (FrameSource), NativeMethods.superres_Ptr_FrameSource_get}, + {typeof (SuperResolution), NativeMethods.superres_Ptr_SuperResolution_get}, + {typeof (DenseOpticalFlowExt), NativeMethods.superres_Ptr_DenseOpticalFlowExt_get}, + {typeof (DenseOpticalFlow), NativeMethods.video_Ptr_DenseOpticalFlow_get}, + {typeof (BackgroundSubtractor), NativeMethods.video_Ptr_BackgroundSubtractor_get}, + {typeof (BackgroundSubtractorMOG2), NativeMethods.video_Ptr_BackgroundSubtractorMOG2_get}, + {typeof (BackgroundSubtractorKNN), NativeMethods.video_Ptr_BackgroundSubtractorKNN_get}, + {typeof (BackgroundSubtractorMOG), NativeMethods.bgsegm_Ptr_BackgroundSubtractorMOG_get}, + {typeof (BackgroundSubtractorGMG), NativeMethods.bgsegm_Ptr_BackgroundSubtractorGMG_get}, + {typeof (GeneralizedHoughBallard), NativeMethods.imgproc_Ptr_GeneralizedHoughBallard_get}, + {typeof (GeneralizedHoughGuil), NativeMethods.imgproc_Ptr_GeneralizedHoughGuil_get}, + {typeof (CLAHE), NativeMethods.imgproc_Ptr_CLAHE_get}, + {typeof (LineSegmentDetector), NativeMethods.imgproc_Ptr_LineSegmentDetector_get}, + {typeof (SVM), NativeMethods.ml_Ptr_SVM_get}, + {typeof (EM), NativeMethods.ml_Ptr_EM_get}, + {typeof (NormalBayesClassifier), NativeMethods.ml_Ptr_NormalBayesClassifier_get}, + {typeof (KNearest), NativeMethods.ml_Ptr_KNearest_get}, + {typeof (DTrees), NativeMethods.ml_Ptr_DTrees_get}, + {typeof (RTrees), NativeMethods.ml_Ptr_RTrees_get}, + {typeof (Boost), NativeMethods.ml_Ptr_Boost_get}, + {typeof (ANN_MLP), NativeMethods.ml_Ptr_ANN_MLP_get}, + {typeof (LogisticRegression), NativeMethods.ml_Ptr_LogisticRegression_get}, + {typeof (Stitcher), NativeMethods.stitching_Ptr_Stitcher_get}, + {typeof (ShapeContextDistanceExtractor), NativeMethods.shape_Ptr_ShapeContextDistanceExtractor_get}, + {typeof (HausdorffDistanceExtractor), NativeMethods.shape_Ptr_HausdorffDistanceExtractor_get}, + {typeof (CalibrateDebevec), NativeMethods.photo_Ptr_CalibrateDebevec_get}, + }; + } + + /// + /// Constructor + /// + /// + public Ptr(IntPtr ptr) + { + Type type = typeof (T); + if (!definedReleaseFunctions.TryGetValue(type, out releaseFunc)) + throw new OpenCvSharpException("Ptr<{0}> not supported", type.Name); + if (!definedGetFunctions.TryGetValue(type, out getFunc)) + throw new OpenCvSharpException("Ptr<{0}> not supported", type.Name); + + this.ptr = ptr; + } + + /// + /// Release function + /// + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (ptr != IntPtr.Zero) + { + releaseFunc(ptr); + } + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + /// + /// Returns Ptr<T>.get() pointer + /// + public virtual IntPtr Get() + { + return getFunc(ptr); + } + } +} diff --git a/src/OpenCvSharp/modules/core/RNG.cs b/src/OpenCvSharp/modules/core/RNG.cs new file mode 100644 index 000000000..8bfd95720 --- /dev/null +++ b/src/OpenCvSharp/modules/core/RNG.cs @@ -0,0 +1,220 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// Random Number Generator. + /// The class implements RNG using Multiply-with-Carry algorithm. + /// + public class RNG + { + /// + /// + /// + public ulong State { get; set; } + + #region Init & Disposal + /// + /// + /// + public RNG() + { + State = NativeMethods.core_RNG_new(); + } + /// + /// + /// + /// + public RNG(ulong state) + { + State = NativeMethods.core_RNG_new(state); + } + #endregion + + #region Cast + /// + /// + /// + /// + /// + public static explicit operator byte(RNG self) + { + if(self == null) + throw new ArgumentNullException("self"); + return NativeMethods.core_RNG_operator_uchar(self.State); + } + /// + /// + /// + /// + /// + public static explicit operator sbyte(RNG self) + { + if (self == null) + throw new ArgumentNullException("self"); + return NativeMethods.core_RNG_operator_schar(self.State); + } + /// + /// + /// + /// + /// + public static explicit operator ushort(RNG self) + { + if (self == null) + throw new ArgumentNullException("self"); + return NativeMethods.core_RNG_operator_ushort(self.State); + } + /// + /// + /// + /// + /// + public static explicit operator short(RNG self) + { + if (self == null) + throw new ArgumentNullException("self"); + return NativeMethods.core_RNG_operator_short(self.State); + } + /// + /// + /// + /// + /// + public static explicit operator uint(RNG self) + { + if (self == null) + throw new ArgumentNullException("self"); + return NativeMethods.core_RNG_operator_uint(self.State); + } + /// + /// + /// + /// + /// + public static explicit operator int(RNG self) + { + if (self == null) + throw new ArgumentNullException("self"); + return NativeMethods.core_RNG_operator_int(self.State); + } + /// + /// + /// + /// + /// + public static explicit operator float(RNG self) + { + if (self == null) + throw new ArgumentNullException("self"); + return NativeMethods.core_RNG_operator_float(self.State); + } + /// + /// + /// + /// + /// + public static explicit operator double(RNG self) + { + if (self == null) + throw new ArgumentNullException("self"); + return NativeMethods.core_RNG_operator_double(self.State); + } + #endregion + + #region Methods + /// + /// updates the state and returns the next 32-bit unsigned integer random number + /// + /// + public uint Next() + { + return NativeMethods.core_RNG_next(State); + } + + /// + /// returns a random integer sampled uniformly from [0, N). + /// + /// + /// + public uint Run(uint n) + { + return NativeMethods.core_RNG_operatorThis(State, n); + } + /// + /// + /// + /// + public uint Run() + { + return NativeMethods.core_RNG_operatorThis(State); + } + + /// + /// returns uniformly distributed integer random number from [a,b) range + /// + /// + /// + /// + public int Uniform(int a, int b) + { + return NativeMethods.core_RNG_uniform(State, a, b); + } + /// + /// returns uniformly distributed floating-point random number from [a,b) range + /// + /// + /// + /// + public float Uniform(float a, float b) + { + return NativeMethods.core_RNG_uniform(State, a, b); + } + /// + /// returns uniformly distributed double-precision floating-point random number from [a,b) range + /// + /// + /// + /// + public double Uniform(double a, double b) + { + return NativeMethods.core_RNG_uniform(State, a, b); + } + + /// + /// + /// + /// + /// + /// + /// + /// + public void Fill(InputOutputArray mat, DistributionType distType, InputArray a, InputArray b, bool saturateRange = false) + { + if (mat == null) + throw new ArgumentNullException("mat"); + if (a == null) + throw new ArgumentNullException("a"); + if (b == null) + throw new ArgumentNullException("b"); + mat.ThrowIfNotReady(); + a.ThrowIfDisposed(); + b.ThrowIfDisposed(); + NativeMethods.core_RNG_fill(State, mat.CvPtr, (int)distType, a.CvPtr, b.CvPtr, saturateRange ? 1 : 0); + mat.Fix(); + } + + /// + /// returns Gaussian random variate with mean zero. + /// + /// + /// + public double Gaussian(double sigma) + { + return NativeMethods.core_RNG_gaussian(State, sigma); + } + #endregion + } +} diff --git a/src/OpenCvSharp/modules/core/SVD.cs b/src/OpenCvSharp/modules/core/SVD.cs new file mode 100644 index 000000000..c27188f56 --- /dev/null +++ b/src/OpenCvSharp/modules/core/SVD.cs @@ -0,0 +1,288 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// Singular Value Decomposition class + /// + public class SVD : DisposableCvObject + { + private bool disposed; + + #region Init & Disposal + /// + /// the default constructor + /// + public SVD() + { + ptr = NativeMethods.core_SVD_new(); + } + /// + /// the constructor that performs SVD + /// + /// + /// + public SVD(InputArray src, Flags flags = 0) + { + if (src == null) + throw new ArgumentNullException("src"); + src.ThrowIfDisposed(); + ptr = NativeMethods.core_SVD_new(src.CvPtr, (int)flags); + } + + /// + /// + /// + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (ptr != IntPtr.Zero) + { + NativeMethods.core_SVD_delete(ptr); + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + /// + /// eigenvalues of the covariation matrix + /// + public Mat U + { + get + { + if (disposed) + throw new ObjectDisposedException("SVD"); + IntPtr ret = NativeMethods.core_SVD_u(ptr); + return new Mat(ret); + } + } + + /// + /// eigenvalues of the covariation matrix + /// + public Mat W + { + get + { + if(disposed) + throw new ObjectDisposedException("SVD"); + IntPtr ret = NativeMethods.core_SVD_w(ptr); + return new Mat(ret); + } + } + + /// + /// mean value subtracted before the projection and added after the back projection + /// + public Mat Vt + { + get + { + if (disposed) + throw new ObjectDisposedException("SVD"); + IntPtr ret = NativeMethods.core_SVD_vt(ptr); + return new Mat(ret); + } + } + #endregion + + #region Methods + /// + /// the operator that performs SVD. The previously allocated SVD::u, SVD::w are SVD::vt are released. + /// + /// + /// + /// + public SVD Run(InputArray src, Flags flags = 0) + { + if (disposed) + throw new ObjectDisposedException("SVD"); + if (src == null) + throw new ArgumentNullException("src"); + src.ThrowIfDisposed(); + NativeMethods.core_SVD_operatorThis(ptr, src.CvPtr, (int)flags); + return this; + } + + /// + /// performs back substitution, so that dst is the solution or pseudo-solution of m*dst = rhs, where m is the decomposed matrix + /// + /// + /// + /// + public void BackSubst(InputArray rhs, OutputArray dst) + { + if (disposed) + throw new ObjectDisposedException("SVD"); + if (rhs == null) + throw new ArgumentNullException("rhs"); + if (dst == null) + throw new ArgumentNullException("dst"); + rhs.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_SVD_backSubst(ptr, rhs.CvPtr, dst.CvPtr); + } + #endregion + + #region Static + + /// + /// decomposes matrix and stores the results to user-provided matrices + /// + /// + /// + /// + /// + /// + public static void Compute(InputArray src, OutputArray w, + OutputArray u, OutputArray vt, Flags flags = 0) + { + if (src == null) + throw new ArgumentNullException("src"); + if (w == null) + throw new ArgumentNullException("w"); + if (u == null) + throw new ArgumentNullException("u"); + if (vt == null) + throw new ArgumentNullException("vt"); + src.ThrowIfDisposed(); + w.ThrowIfNotReady(); + u.ThrowIfNotReady(); + vt.ThrowIfNotReady(); + NativeMethods.core_SVD_static_compute(src.CvPtr, w.CvPtr, u.CvPtr, vt.CvPtr, (int)flags); + w.Fix(); + u.Fix(); + vt.Fix(); + } + + /// + /// computes singular values of a matrix + /// + /// + /// + /// + public static void Compute(InputArray src, OutputArray w, Flags flags = 0) + { + if (src == null) + throw new ArgumentNullException("src"); + if (w == null) + throw new ArgumentNullException("w"); + src.ThrowIfDisposed(); + w.ThrowIfNotReady(); + NativeMethods.core_SVD_static_compute(src.CvPtr, w.CvPtr, (int)flags); + w.Fix(); + } + + /// + /// performs back substitution + /// + /// + /// + /// + /// + /// + public static void BackSubst(InputArray w, InputArray u, + InputArray vt, InputArray rhs, OutputArray dst) + { + if (w == null) + throw new ArgumentNullException("w"); + if (u == null) + throw new ArgumentNullException("u"); + if (vt == null) + throw new ArgumentNullException("vt"); + if (rhs == null) + throw new ArgumentNullException("rhs"); + if (dst == null) + throw new ArgumentNullException("dst"); + w.ThrowIfDisposed(); + u.ThrowIfDisposed(); + vt.ThrowIfDisposed(); + rhs.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_SVD_static_backSubst(w.CvPtr, u.CvPtr, vt.CvPtr, rhs.CvPtr, dst.CvPtr); + dst.Fix(); + } + + /// + /// finds dst = arg min_{|dst|=1} |m*dst| + /// + /// + /// + public static void SolveZ(InputArray src, OutputArray dst) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + NativeMethods.core_SVD_static_solveZ(src.CvPtr, dst.CvPtr); + dst.Fix(); + } + + #endregion + +#if LANG_JP + /// + /// VDの操作フラグ + /// +#else + /// + /// Operation flags for SVD + /// +#endif + [Flags] + public enum Flags + { + /// + /// + /// + None = 0, + +#if LANG_JP + /// + /// 計算中に行列Aの変更を行うことができる.このフラグの指定は処理速度を向上させる. + /// +#else + /// + /// enables modification of matrix src1 during the operation. It speeds up the processing. + /// +#endif + ModifyA = 1, + + /// + /// indicates that only a vector of singular values `w` is to be processed, + /// while u and vt will be set to empty matrices + /// +// ReSharper disable once InconsistentNaming + NoUV = 2, + + /// + /// when the matrix is not square, by default the algorithm produces u and + /// vt matrices of sufficiently large size for the further A reconstruction; + /// if, however, FULL_UV flag is specified, u and vt will be full-size square + /// orthogonal matrices. + /// +// ReSharper disable once InconsistentNaming + FullUV = 4, + } + } +} diff --git a/src/OpenCvSharp/modules/core/SparseMat.cs b/src/OpenCvSharp/modules/core/SparseMat.cs new file mode 100644 index 000000000..35ecd1614 --- /dev/null +++ b/src/OpenCvSharp/modules/core/SparseMat.cs @@ -0,0 +1,924 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// Sparse matrix class. + /// + public class SparseMat : DisposableCvObject, ICloneable + { + private bool disposed; + + #region Init & Disposal + +#if LANG_JP + /// + /// OpenCVネイティブの cv::SparseMat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::SparseMat* pointer + /// + /// +#endif + public SparseMat(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Native object address is NULL"); + this.ptr = ptr; + } + +#if LANG_JP + /// + /// 空の疎行列として初期化 + /// +#else + /// + /// Creates empty SparseMat + /// +#endif + public SparseMat() + { + ptr = NativeMethods.core_SparseMat_new1(); + } + + +#if LANG_JP + /// + /// N次元疎行列として初期化 + /// + /// n-次元配列の形状を表す,整数型の配列. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. +#else + /// + /// constructs n-dimensional sparse matrix + /// + /// Array of integers specifying an n-dimensional array shape. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. +#endif + public SparseMat(IEnumerable sizes, MatType type) + { + if (sizes == null) + throw new ArgumentNullException("sizes"); + + int[] sizesArray = EnumerableEx.ToArray(sizes); + ptr = NativeMethods.core_SparseMat_new2(sizesArray.Length, sizesArray, type); + } + +#if LANG_JP + /// + /// cv::Matデータから初期化 + /// + /// cv::Matオブジェクトへの参照. +#else + /// + /// converts old-style CvMat to the new matrix; the data is not copied by default + /// + /// cv::Mat object +#endif + public SparseMat(Mat m) + { + if (m == null) + throw new ArgumentNullException("m"); + m.ThrowIfDisposed(); + ptr = NativeMethods.core_SparseMat_new3(m.CvPtr); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException(); + } + +#if LANG_JP + /// + /// リソースの解放 + /// +#else + /// + /// Releases the resources + /// +#endif + public void Release() + { + Dispose(); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + } + // releases unmanaged resources + if (IsEnabledDispose) + { + if (ptr != IntPtr.Zero) + { + NativeMethods.core_SparseMat_delete(ptr); + } + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + + #region Static Initializers + + /// + /// + /// + /// + /// + public static SparseMat FromMat(Mat mat) + { + return new SparseMat(mat); + } + + #endregion + + #endregion + + #region Static + /// + /// sizeof(cv::Mat) + /// + public static readonly int SizeOf = (int)NativeMethods.core_SparseMat_sizeof(); + + #endregion + + #region Public Methods + + /// + /// Assignment operator. This is O(1) operation, i.e. no data is copied + /// + /// + /// + public SparseMat AssignFrom(SparseMat m) + { + ThrowIfDisposed(); + if(m == null) + throw new ArgumentNullException("m"); + NativeMethods.core_SparseMat_operatorAssign_SparseMat(ptr, m.CvPtr); + return this; + } + + /// + /// Assignment operator. equivalent to the corresponding constructor. + /// + /// + /// + public SparseMat AssignFrom(Mat m) + { + ThrowIfDisposed(); + if (m == null) + throw new ArgumentNullException("m"); + NativeMethods.core_SparseMat_operatorAssign_Mat(ptr, m.CvPtr); + return this; + } + + /// + /// creates full copy of the matrix + /// + /// + public SparseMat Clone() + { + ThrowIfDisposed(); + IntPtr p = NativeMethods.core_SparseMat_clone(ptr); + return new SparseMat(p); + } + object ICloneable.Clone() + { + return Clone(); + } + + /// + /// copies all the data to the destination matrix. All the previous content of m is erased. + /// + /// + public void CopyTo(SparseMat m) + { + ThrowIfDisposed(); + NativeMethods.core_SparseMat_copyTo_SparseMat(ptr, m.CvPtr); + } + /// + /// converts sparse matrix to dense matrix. + /// + /// + public void CopyTo(Mat m) + { + ThrowIfDisposed(); + NativeMethods.core_SparseMat_copyTo_Mat(ptr, m.CvPtr); + } + + /// + /// multiplies all the matrix elements by the specified scale factor alpha and converts the results to the specified data type + /// + /// + /// + /// + public void ConvertTo(SparseMat m, int rtype, double alpha = 1) + { + ThrowIfDisposed(); + NativeMethods.core_SparseMat_convertTo_SparseMat(ptr, m.CvPtr, rtype, alpha); + } + + /// + /// converts sparse matrix to dense n-dim matrix with optional type conversion and scaling. + /// + /// + /// The output matrix data type. When it is =-1, the output array will have the same data type as (*this) + /// The scale factor + /// The optional delta added to the scaled values before the conversion + public void ConvertTo(Mat m, int rtype, double alpha = 1, double beta = 0) + { + ThrowIfDisposed(); + NativeMethods.core_SparseMat_convertTo_SparseMat(ptr, m.CvPtr, rtype, alpha); + } + + /// + /// not used now + /// + /// + /// + public void AssignTo(SparseMat m, int type = -1) + { + ThrowIfDisposed(); + NativeMethods.core_SparseMat_assignTo(ptr, m.CvPtr, type); + } + + /// + /// Reallocates sparse matrix. + /// If the matrix already had the proper size and type, + /// it is simply cleared with clear(), otherwise, + /// the old matrix is released (using release()) and the new one is allocated. + /// + /// + /// + public void Create(MatType type, params int[] sizes) + { + ThrowIfDisposed(); + if (sizes == null) + throw new ArgumentNullException("sizes"); + if (sizes.Length == 1) + throw new ArgumentException("sizes is empty"); + NativeMethods.core_SparseMat_create(ptr, sizes.Length, sizes, type); + } + + /// + /// sets all the sparse matrix elements to 0, which means clearing the hash table. + /// + public void Clear() + { + ThrowIfDisposed(); + NativeMethods.core_SparseMat_clear(ptr); + } + + /// + /// manually increments the reference counter to the header. + /// + public void Addref() + { + ThrowIfDisposed(); + NativeMethods.core_SparseMat_addref(ptr); + } + + /// + /// returns the size of each element in bytes (not including the overhead - the space occupied by SparseMat::Node elements) + /// + /// + public int ElemSize() + { + ThrowIfDisposed(); + return NativeMethods.core_SparseMat_elemSize(ptr); + + } + + /// + /// returns elemSize()/channels() + /// + /// + public int ElemSize1() + { + ThrowIfDisposed(); + return NativeMethods.core_SparseMat_elemSize1(ptr); + + } + + /// + /// Returns the type of sparse matrix element. + /// + /// + public MatType Type() + { + ThrowIfDisposed(); + return NativeMethods.core_SparseMat_type(ptr); + } + + /// + /// Returns the depth of sparse matrix element. + /// + /// + public int Depth() + { + ThrowIfDisposed(); + return NativeMethods.core_SparseMat_depth(ptr); + } + + /// + /// Returns the matrix dimensionality + /// + public int Dims() + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_dims(ptr); + } + + /// + /// Returns the number of sparse matrix channels. + /// + /// + public int Channels() + { + ThrowIfDisposed(); + return NativeMethods.core_Mat_channels(ptr); + } + + /// + /// Returns the array of sizes, or null if the matrix is not allocated + /// + /// + public int[] Size() + { + ThrowIfDisposed(); + + IntPtr sizePtr = NativeMethods.core_SparseMat_size1(ptr); + if (sizePtr == IntPtr.Zero) + return null; + + int length = Dims(); + int[] size = new int[length]; + Marshal.Copy(sizePtr, size, 0, length); + return size; + } + + /// + /// Returns the size of i-th matrix dimension (or 0) + /// + /// + /// + public int Size(int dim) + { + ThrowIfDisposed(); + return NativeMethods.core_SparseMat_size2(ptr, dim); + } + + #region Hash + + /// + /// Computes the element hash value (1D case) + /// + /// Index along the dimension 0 + /// + public long Hash(int i0) + { + ThrowIfDisposed(); + return NativeMethods.core_SparseMat_hash_1d(ptr, i0).ToInt64(); + } + + /// + /// Computes the element hash value (2D case) + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// + public long Hash(int i0, int i1) + { + ThrowIfDisposed(); + return NativeMethods.core_SparseMat_hash_2d(ptr, i0, i1).ToInt64(); + } + + /// + /// Computes the element hash value (3D case) + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// + public long Hash(int i0, int i1, int i2) + { + ThrowIfDisposed(); + return NativeMethods.core_SparseMat_hash_3d(ptr, i0, i1, i2).ToInt64(); + } + + /// + /// Computes the element hash value (nD case) + /// + /// Array of Mat::dims indices. + /// + public long Hash(params int[] idx) + { + ThrowIfDisposed(); + return NativeMethods.core_SparseMat_hash_nd(ptr, idx).ToInt64(); + } + + #endregion + #region Ptr + + /// + /// Low-level element-access function. + /// + /// Index along the dimension 0 + /// Create new element with 0 value if it does not exist in SparseMat. + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// + public IntPtr Ptr(int i0, bool createMissing, long? hashVal = null) + { + //ThrowIfDisposed(); + if (hashVal.HasValue) + { + ulong hashVal0 = (ulong)hashVal.Value; + return NativeMethods.core_SparseMat_ptr_1d( + ptr, i0, createMissing ? 1 : 0, ref hashVal0); + } + return NativeMethods.core_SparseMat_ptr_1d( + ptr, i0, createMissing ? 1 : 0, IntPtr.Zero); + } + + /// + /// Low-level element-access function. + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Create new element with 0 value if it does not exist in SparseMat. + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// + public IntPtr Ptr(int i0, int i1, bool createMissing, long? hashVal = null) + { + //ThrowIfDisposed(); + if (hashVal.HasValue) + { + ulong hashVal0 = (ulong)hashVal.Value; + return NativeMethods.core_SparseMat_ptr_2d( + ptr, i0, i1, createMissing ? 1 : 0, ref hashVal0); + } + return NativeMethods.core_SparseMat_ptr_2d( + ptr, i0, i1, createMissing ? 1 : 0, IntPtr.Zero); + } + + /// + /// Low-level element-access function. + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// Create new element with 0 value if it does not exist in SparseMat. + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// + public IntPtr Ptr(int i0, int i1, int i2, bool createMissing, long? hashVal = null) + { + //ThrowIfDisposed(); + if (hashVal.HasValue) + { + ulong hashVal0 = (ulong)hashVal.Value; + return NativeMethods.core_SparseMat_ptr_3d( + ptr, i0, i1, i2, createMissing ? 1 : 0, ref hashVal0); + } + return NativeMethods.core_SparseMat_ptr_3d( + ptr, i0, i1, i2, createMissing ? 1 : 0, IntPtr.Zero); + } + + /// + /// Low-level element-access function. + /// + /// Array of Mat::dims indices. + /// Create new element with 0 value if it does not exist in SparseMat. + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// + public IntPtr Ptr(int[] idx, bool createMissing, long? hashVal = null) + { + //ThrowIfDisposed(); + if (hashVal.HasValue) + { + ulong hashVal0 = (ulong)hashVal.Value; + return NativeMethods.core_SparseMat_ptr_nd( + ptr, idx, createMissing ? 1 : 0, ref hashVal0); + } + return NativeMethods.core_SparseMat_ptr_nd( + ptr, idx, createMissing ? 1 : 0, IntPtr.Zero); + } + + #endregion + #region Find + + /// + /// Return pthe specified sparse matrix element if it exists; otherwise, null. + /// + /// Index along the dimension 0 + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// + public T? Find(int i0, long? hashVal = null) + where T : struct + { + IntPtr p = Ptr(i0, false, hashVal); + if (p == IntPtr.Zero) + return null; + + return (T)Marshal.PtrToStructure(p, typeof(T)); + } + + /// + /// Return pthe specified sparse matrix element if it exists; otherwise, null. + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// + public T? Find(int i0, int i1, long? hashVal = null) + where T : struct + { + IntPtr p = Ptr(i0, i1, false, hashVal); + if (p == IntPtr.Zero) + return null; + + return (T)Marshal.PtrToStructure(p, typeof(T)); + } + + /// + /// Return pthe specified sparse matrix element if it exists; otherwise, null. + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// + public T? Find(int i0, int i1, int i2, long? hashVal = null) + where T : struct + { + IntPtr p = Ptr(i0, i1, i2, false, hashVal); + if (p == IntPtr.Zero) + return null; + + return (T)Marshal.PtrToStructure(p, typeof(T)); + } + + /// + /// Return pthe specified sparse matrix element if it exists; otherwise, null. + /// + /// Array of Mat::dims indices. + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// + public T? Find(int[] idx, long? hashVal = null) + where T : struct + { + IntPtr p = Ptr(idx, false, hashVal); + if (p == IntPtr.Zero) + return null; + + return (T)Marshal.PtrToStructure(p, typeof(T)); + } + + #endregion + #region Value + + /// + /// Return pthe specified sparse matrix element if it exists; otherwise, default(T). + /// + /// Index along the dimension 0 + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// + public T Value(int i0, long? hashVal = null) + where T : struct + { + IntPtr p = Ptr(i0, false, hashVal); + if (p == IntPtr.Zero) + return default(T); + + return (T)Marshal.PtrToStructure(p, typeof(T)); + } + + /// + /// Return pthe specified sparse matrix element if it exists; otherwise, default(T). + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// + public T Value(int i0, int i1, long? hashVal = null) + where T : struct + { + IntPtr p = Ptr(i0, i1, false, hashVal); + if (p == IntPtr.Zero) + return default(T); + + return (T)Marshal.PtrToStructure(p, typeof(T)); + } + + /// + /// Return pthe specified sparse matrix element if it exists; otherwise, default(T). + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// + public T Value(int i0, int i1, int i2, long? hashVal = null) + where T : struct + { + IntPtr p = Ptr(i0, i1, i2, false, hashVal); + if (p == IntPtr.Zero) + return default(T); + + return (T)Marshal.PtrToStructure(p, typeof(T)); + } + + /// + /// Return pthe specified sparse matrix element if it exists; otherwise, default(T). + /// + /// Array of Mat::dims indices. + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// + public T Value(int[] idx, long? hashVal = null) + where T : struct + { + IntPtr p = Ptr(idx, false, hashVal); + if (p == IntPtr.Zero) + return default(T); + + return (T)Marshal.PtrToStructure(p, typeof(T)); + } + + #endregion + #region Element Indexer + + /// + /// Mat Indexer + /// + /// + public sealed class Indexer : SparseMatIndexer where T : struct + { + internal Indexer(SparseMat parent) + : base(parent) + { + } + + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// A value to the specified array element. + public override T this[int i0, long? hashVal = null] + { + get + { + IntPtr p = parent.Ptr(i0, true, hashVal); + return (T)Marshal.PtrToStructure(p, typeof(T)); + } + set + { + IntPtr p = parent.Ptr(i0, true, hashVal); + Marshal.StructureToPtr(value, p, false); + } + } + + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// A value to the specified array element. + public override T this[int i0, int i1, long? hashVal = null] + { + get + { + IntPtr p = parent.Ptr(i0, i1, true, hashVal); + return (T)Marshal.PtrToStructure(p, typeof(T)); + } + set + { + IntPtr p = parent.Ptr(i0, i1, true, hashVal); + Marshal.StructureToPtr(value, p, false); + } + } + + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// A value to the specified array element. + public override T this[int i0, int i1, int i2, long? hashVal = null] + { + get + { + IntPtr p = parent.Ptr(i0, i1, i2, true, hashVal); + return (T)Marshal.PtrToStructure(p, typeof(T)); + } + set + { + IntPtr p = parent.Ptr(i0, i1, i2, true, hashVal); + Marshal.StructureToPtr(value, p, false); + } + } + + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// A value to the specified array element. + public override T this[int[] idx, long? hashVal = null] + { + get + { + IntPtr p = parent.Ptr(idx, true, hashVal); + return (T)Marshal.PtrToStructure(p, typeof(T)); + } + set + { + IntPtr p = parent.Ptr(idx, true, hashVal); + Marshal.StructureToPtr(value, p, false); + } + } + } + + /// + /// Gets a type-specific indexer. + /// The indexer has getters/setters to access each matrix element. + /// + /// + /// + public Indexer Ref() where T : struct + { + return new Indexer(this); + } + /// + /// Gets a type-specific indexer. + /// The indexer has getters/setters to access each matrix element. + /// + /// + /// + public Indexer GetIndexer() where T : struct + { + return new Indexer(this); + } + + #endregion + #region Get/Set + + /// + /// Returns a value to the specified array element. + /// + /// + /// Index along the dimension 0 + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// A value to the specified array element. + public T Get(int i0, long? hashVal = null) where T : struct + { + return new Indexer(this)[i0, hashVal]; + } + + /// + /// Returns a value to the specified array element. + /// + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// A value to the specified array element. + public T Get(int i0, int i1, long? hashVal = null) where T : struct + { + return new Indexer(this)[i0, i1, hashVal]; + } + + /// + /// Returns a value to the specified array element. + /// + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// A value to the specified array element. + public T Get(int i0, int i1, int i2, long? hashVal = null) where T : struct + { + return new Indexer(this)[i0, i1, i2, hashVal]; + } + + /// + /// Returns a value to the specified array element. + /// + /// + /// Array of Mat::dims indices. + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// A value to the specified array element. + public T Get(int[] idx, long? hashVal = null) where T : struct + { + return new Indexer(this)[idx, hashVal]; + } + + /// + /// Set a value to the specified array element. + /// + /// + /// Index along the dimension 0 + /// + /// + public void Set(int i0, T value, long? hashVal = null) where T : struct + { + (new Indexer(this))[i0, hashVal] = value; + } + + /// + /// Set a value to the specified array element. + /// + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + public void Set(int i0, int i1, T value, long? hashVal = null) where T : struct + { + (new Indexer(this))[i0, i1, hashVal] = value; + } + + /// + /// Set a value to the specified array element. + /// + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + public void Set(int i0, int i1, int i2, T value, long? hashVal = null) where T : struct + { + (new Indexer(this)[i0, i1, i2, hashVal]) = value; + } + + /// + /// Set a value to the specified array element. + /// + /// + /// Array of Mat::dims indices. + /// + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + public void Set(int[] idx, T value, long? hashVal = null) where T : struct + { + (new Indexer(this)[idx, hashVal]) = value; + } + + #endregion + + #region ToString + + /// + /// Returns a string that represents this Mat. + /// + /// + public override string ToString() + { + return "Mat [ " + + "Dims=" + Dims() + + "Type=" + Type().ToString() + + " ]"; + } + + #endregion + + #endregion + } + +} diff --git a/src/OpenCvSharp/modules/core/SparseMatIndexer.cs b/src/OpenCvSharp/modules/core/SparseMatIndexer.cs new file mode 100644 index 000000000..5178964fe --- /dev/null +++ b/src/OpenCvSharp/modules/core/SparseMatIndexer.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// Abstract definition of Mat indexer + /// + /// + public abstract class SparseMatIndexer where T : struct + { + /// + /// 1-dimensional indexer + /// + /// Index along the dimension 0 + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// A value to the specified array element. + public abstract T this[int i0, long? hashVal = null] { get; set; } + + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// A value to the specified array element. + public abstract T this[int i0, int i1, long? hashVal = null] { get; set; } + + /// + /// 3-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// Index along the dimension 2 + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// A value to the specified array element. + public abstract T this[int i0, int i1, int i2, long? hashVal = null] { get; set; } + + /// + /// n-dimensional indexer + /// + /// Array of Mat::dims indices. + /// If hashVal is not null, the element hash value is not computed but hashval is taken instead. + /// A value to the specified array element. + public abstract T this[int[] idx, long? hashVal = null] { get; set; } + + /// + /// Parent matrix object + /// + protected readonly SparseMat parent; + + /// + /// Constructor + /// + /// + internal SparseMatIndexer(SparseMat parent) + { + this.parent = parent; + } + } +} diff --git a/src/OpenCvSharp/modules/core/Struct/DMatch.cs b/src/OpenCvSharp/modules/core/Struct/DMatch.cs new file mode 100644 index 000000000..5756027e6 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/DMatch.cs @@ -0,0 +1,140 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// 2つのキーポイントディスクリプタ同士のマッチング情報 + /// +#else + /// + /// Struct for matching: query descriptor index, train descriptor index, train image index and distance between descriptors. + /// +#endif + public struct DMatch + { +#if LANG_JP + /// + /// クエリディスクリプタインデックス + /// +#else + /// + /// query descriptor index + /// +#endif + public int QueryIdx; + +#if LANG_JP + /// + /// 訓練ディスクリプタインデックス + /// +#else + /// + /// train descriptor index + /// +#endif + public int TrainIdx; + +#if LANG_JP + /// + /// 訓練画像インデックス + /// +#else + /// + /// train image index + /// +#endif + public int ImgIdx; + + + /// + /// + /// + public float Distance; + + /// + /// + /// + /// + public static DMatch Empty() + { + return new DMatch(-1, -1, -1, Single.MaxValue); + } + + /// + /// + /// + /// + /// + /// + public DMatch(int queryIdx, int trainIdx, float distance) : + this(queryIdx, trainIdx, -1, distance) + { + } + /// + /// + /// + /// + /// + /// + /// + public DMatch(int queryIdx, int trainIdx, int imgIdx, float distance) + { + QueryIdx = queryIdx; + TrainIdx = trainIdx; + ImgIdx = imgIdx; + Distance = distance; + } + + /// + /// Compares by distance (less is beter) + /// + /// + /// + /// + public static bool operator <(DMatch d1, DMatch d2) + { + return d1.Distance < d2.Distance; + } + /// + /// Compares by distance (less is beter) + /// + /// + /// + /// + public static bool operator >(DMatch d1, DMatch d2) + { + return d1.Distance > d2.Distance; + } + + /// + /// + /// + /// + /// + public static explicit operator Vec4f(DMatch self) + { + return new Vec4f(self.QueryIdx, self.TrainIdx, self.ImgIdx, self.Distance); + } + /// + /// + /// + /// + /// + public static explicit operator DMatch(Vec4f v) + { + return new DMatch((int)v.Item0, (int)v.Item1, (int)v.Item2, v.Item3); + } + + /// + /// + /// + /// + public override string ToString() + { + return String.Format("DMatch (QueryIdx:{0}, TrainIdx:{1}, ImgIdx:{2}, Distance:{3})", + QueryIdx, TrainIdx, ImgIdx, Distance); + } + } + +} diff --git a/src/OpenCvSharp/modules/core/Struct/IVec.cs b/src/OpenCvSharp/modules/core/Struct/IVec.cs new file mode 100644 index 000000000..d101b7611 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/IVec.cs @@ -0,0 +1,18 @@ +using System; + +namespace OpenCvSharp +{ + /// + /// + /// + /// + public interface IVec where T : struct + { + /// + /// + /// + /// + /// + T this[int i] { get; set; } + } +} diff --git a/src/OpenCvSharp/modules/core/Struct/KeyPoint.cs b/src/OpenCvSharp/modules/core/Struct/KeyPoint.cs new file mode 100644 index 000000000..69984db00 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/KeyPoint.cs @@ -0,0 +1,288 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// 特徴点検出器のためのデータ構造体 + /// +#else + /// + /// Data structure for salient point detectors + /// +#endif + [Serializable] + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] + public struct KeyPoint : IEquatable + { + #region Properties + +#if LANG_JP + /// + /// 特徴点の座標 + /// +#else + /// + /// Coordinate of the point + /// +#endif + public Point2f Pt; + +#if LANG_JP + /// + /// 特徴点のサイズ + /// +#else + /// + /// Feature size + /// +#endif + public float Size; + +#if LANG_JP + /// + /// 特徴点の向き(度数法)。 向きが定義されない、若しくは計算されない場合には負数。 + /// +#else + /// + /// Feature orientation in degrees (has negative value if the orientation is not defined/not computed) + /// +#endif + public float Angle; + +#if LANG_JP + /// + /// 特徴点の強さ(もっとも顕著なキーポイントを求めるために使われる) + /// +#else + /// + /// Feature strength (can be used to select only the most prominent key points) + /// +#endif + public float Response; + +#if LANG_JP + /// + /// 特徴点が見つかったscale-spaceのoctave。サイズと相関がある場合がある。 + /// +#else + /// + /// Scale-space octave in which the feature has been found; may correlate with the size + /// +#endif + public int Octave; + +#if LANG_JP + /// + /// 特徴点のクラス(特徴点分類機または物体検出器において用いられる) + /// +#else + /// + /// Point class (can be used by feature classifiers or object detectors) + /// +#endif + public int ClassId; + + #endregion + + #region Constructors + +#if LANG_JP + /// + /// 初期化 + /// + /// 特徴点の座標 + /// 特徴点のサイズ + /// 特徴点の向き(度数法)。 向きが定義されない、若しくは計算されない場合には負数。 + /// 特徴点の強さ(もっとも顕著なキーポイントを求めるために使われる) + /// 特徴点が見つかったscale-spaceのoctave。サイズと相関がある場合がある。 + /// 特徴点のクラス(特徴点分類機または物体検出器において用いられる) +#else + /// + /// Complete constructor + /// + /// Coordinate of the point + /// Feature size + /// Feature orientation in degrees (has negative value if the orientation is not defined/not computed) + /// Feature strength (can be used to select only the most prominent key points) + /// Scale-space octave in which the feature has been found; may correlate with the size + /// Point class (can be used by feature classifiers or object detectors) +#endif + public KeyPoint(Point2f pt, float size, float angle = -1, float response = 0, int octave = 0, + int classId = -1) + { + Pt = pt; + Size = size; + Angle = angle; + Response = response; + Octave = octave; + ClassId = classId; + } + +#if LANG_JP + /// + /// 初期化 + /// + /// 特徴点のx座標 + /// 特徴点のy座標 + /// 特徴点のサイズ + /// 特徴点の向き(度数法)。 向きが定義されない、若しくは計算されない場合には負数。 + /// 特徴点の強さ(もっとも顕著なキーポイントを求めるために使われる) + /// 特徴点が見つかったscale-spaceのoctave。サイズと相関がある場合がある。 + /// 特徴点のクラス(特徴点分類機または物体検出器において用いられる) +#else + /// + /// Complete constructor + /// + /// X-coordinate of the point + /// Y-coordinate of the point + /// Feature size + /// Feature orientation in degrees (has negative value if the orientation is not defined/not computed) + /// Feature strength (can be used to select only the most prominent key points) + /// Scale-space octave in which the feature has been found; may correlate with the size + /// Point class (can be used by feature classifiers or object detectors) +#endif + public KeyPoint(float x, float y, float size, float angle = -1, float response = 0, int octave = 0, + int classId = -1) + : this(new Point2f(x, y), size, angle, response, octave, classId) + { + } + + #endregion + + #region Operators + +#if LANG_JP + /// + /// 指定したオブジェクトと等しければtrueを返す + /// + /// 比較するオブジェクト + /// 型が同じで、メンバの値が等しければtrue +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public bool Equals(KeyPoint obj) + { + return ( + this.Pt == obj.Pt && + this.Size == obj.Size && + this.Angle == obj.Angle && + this.Response == obj.Response && + this.Octave == obj.Octave && + this.ClassId == obj.ClassId + ); + } + +#if LANG_JP + /// + /// == 演算子のオーバーロード + /// + /// 左辺値 + /// 右辺値 + /// 等しければtrue +#else + /// + /// Compares two CvPoint objects. The result specifies whether the members of each object are equal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the members of left and right are equal; otherwise, false. +#endif + public static bool operator ==(KeyPoint lhs, KeyPoint rhs) + { + return lhs.Equals(rhs); + } + +#if LANG_JP + /// + /// != 演算子のオーバーロード + /// + /// 左辺値 + /// 右辺値 + /// 等しくなければtrue +#else + /// + /// Compares two CvPoint objects. The result specifies whether the members of each object are unequal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the members of left and right are unequal; otherwise, false. +#endif + public static bool operator !=(KeyPoint lhs, KeyPoint rhs) + { + return !lhs.Equals(rhs); + } + + #endregion + + #region Overrided Methods + +#if LANG_JP + /// + /// Equalsのオーバーライド + /// + /// 比較するオブジェクト + /// +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public override bool Equals(object obj) + { + return base.Equals(obj); + } + +#if LANG_JP + /// + /// GetHashCodeのオーバーライド + /// + /// このオブジェクトのハッシュ値を指定する整数値。 +#else + /// + /// Returns a hash code for this object. + /// + /// An integer value that specifies a hash value for this object. +#endif + public override int GetHashCode() + { + unchecked + { + return ( + this.Pt.GetHashCode() + + this.Size.GetHashCode() + + this.Angle.GetHashCode() + + this.Response.GetHashCode() + + this.Octave.GetHashCode() + + this.ClassId.GetHashCode() + ); + } + } + +#if LANG_JP + /// + /// 文字列形式を返す + /// + /// 文字列形式 +#else + /// + /// Converts this object to a human readable string. + /// + /// A string that represents this object. +#endif + public override string ToString() + { + return String.Format("[Pt:{0}, Size:{1}, Angle:{2}, Response:{3}, Octave:{4}, ClassId:{5}]", Pt, Size, Angle, + Response, Octave, ClassId); + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/core/Struct/MatType.cs b/src/OpenCvSharp/modules/core/Struct/MatType.cs new file mode 100644 index 000000000..f57fdf3df --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/MatType.cs @@ -0,0 +1,254 @@ +using System; + +namespace OpenCvSharp +{ +// ReSharper disable InconsistentNaming +#pragma warning disable 1591 + + /// + /// Matrix data type (depth and number of channels) + /// + public struct MatType : IEquatable, IEquatable + { + /// + /// Entity value + /// + public int Value; + + /// + /// + /// + /// + public MatType(int value) + { + Value = value; + } + + /// + /// + /// + /// + /// + public static implicit operator int(MatType self) + { + return self.Value; + } + + /// + /// + /// + /// + /// + public static implicit operator MatType(int value) + { + return new MatType(value); + } + + /// + /// + /// + public int Depth + { + get { return Value & (CV_DEPTH_MAX - 1); } + } + + /// + /// + /// + public bool IsInteger + { + get { return Depth < CV_32F; } + } + + /// + /// + /// + public int Channels + { + get { return (Value >> CV_CN_SHIFT) + 1; } + } + + public bool Equals(MatType other) + { + return Value == other.Value; + } + + public bool Equals(int other) + { + return Value == other; + } + + public override bool Equals(object other) + { + if (other == null) + return false; + if (other.GetType() != typeof (MatType)) + return false; + return Equals((MatType) other); + } + + public static bool operator ==(MatType self, MatType other) + { + return self.Equals(other); + } + + public static bool operator !=(MatType self, MatType other) + { + return !self.Equals(other); + } + + public static bool operator ==(MatType self, int other) + { + return self.Equals(other); + } + + public static bool operator !=(MatType self, int other) + { + return !self.Equals(other); + } + + public override int GetHashCode() + { + return Value.GetHashCode(); + } + + /// + /// + /// + /// + public override string ToString() + { + string s; + switch (Depth) + { + case CV_8U: + s = "CV_8U"; + break; + case CV_8S: + s = "CV_8S"; + break; + case CV_16U: + s = "CV_16U"; + break; + case CV_16S: + s = "CV_16S"; + break; + case CV_32S: + s = "CV_32S"; + break; + case CV_32F: + s = "CV_32F"; + break; + case CV_64F: + s = "CV_64F"; + break; + case CV_USRTYPE1: + s = "CV_USRTYPE1"; + break; + default: + throw new OpenCvSharpException("Unsupported CvType value: " + Value); + } + + int ch = Channels; + if (ch <= 4) + return s + "C" + ch; + else + return s + "C(" + ch + ")"; + } + + private const int CV_CN_MAX = 512, + CV_CN_SHIFT = 3, + CV_DEPTH_MAX = (1 << CV_CN_SHIFT); + + /// + /// type depth constants + /// + public const int + CV_8U = 0, + CV_8S = 1, + CV_16U = 2, + CV_16S = 3, + CV_32S = 4, + CV_32F = 5, + CV_64F = 6, + CV_USRTYPE1 = 7; + + /// + /// predefined type constants + /// + public static readonly MatType + CV_8UC1 = CV_8UC(1), + CV_8UC2 = CV_8UC(2), + CV_8UC3 = CV_8UC(3), + CV_8UC4 = CV_8UC(4), + CV_8SC1 = CV_8SC(1), + CV_8SC2 = CV_8SC(2), + CV_8SC3 = CV_8SC(3), + CV_8SC4 = CV_8SC(4), + CV_16UC1 = CV_16UC(1), + CV_16UC2 = CV_16UC(2), + CV_16UC3 = CV_16UC(3), + CV_16UC4 = CV_16UC(4), + CV_16SC1 = CV_16SC(1), + CV_16SC2 = CV_16SC(2), + CV_16SC3 = CV_16SC(3), + CV_16SC4 = CV_16SC(4), + CV_32SC1 = CV_32SC(1), + CV_32SC2 = CV_32SC(2), + CV_32SC3 = CV_32SC(3), + CV_32SC4 = CV_32SC(4), + CV_32FC1 = CV_32FC(1), + CV_32FC2 = CV_32FC(2), + CV_32FC3 = CV_32FC(3), + CV_32FC4 = CV_32FC(4), + CV_64FC1 = CV_64FC(1), + CV_64FC2 = CV_64FC(2), + CV_64FC3 = CV_64FC(3), + CV_64FC4 = CV_64FC(4); + + + public static MatType CV_8UC(int ch) + { + return MakeType(CV_8U, ch); + } + + public static MatType CV_8SC(int ch) + { + return MakeType(CV_8S, ch); + } + + public static MatType CV_16UC(int ch) + { + return MakeType(CV_16U, ch); + } + + public static MatType CV_16SC(int ch) + { + return MakeType(CV_16S, ch); + } + + public static MatType CV_32SC(int ch) + { + return MakeType(CV_32S, ch); + } + + public static MatType CV_32FC(int ch) + { + return MakeType(CV_32F, ch); + } + + public static MatType CV_64FC(int ch) + { + return MakeType(CV_64F, ch); + } + + public static MatType MakeType(int depth, int channels) + { + if (channels <= 0 || channels >= CV_CN_MAX) + throw new OpenCvSharpException("Channels count should be 1.." + (CV_CN_MAX - 1)); + if (depth < 0 || depth >= CV_DEPTH_MAX) + throw new OpenCvSharpException("Data type depth should be 0.." + (CV_DEPTH_MAX - 1)); + return (depth & (CV_DEPTH_MAX - 1)) + ((channels - 1) << CV_CN_SHIFT); + } + } +} diff --git a/src/OpenCvSharp/modules/core/Struct/Point.cs b/src/OpenCvSharp/modules/core/Struct/Point.cs new file mode 100644 index 000000000..f39a63aa4 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/Point.cs @@ -0,0 +1,414 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Point : IEquatable + { + /// + /// + /// + public int X; + + /// + /// + /// + public int Y; + + /// + /// + /// + public const int SizeOf = sizeof (int) + sizeof (int); + + /// + /// + /// + /// + /// + public Point(int x, int y) + { + X = x; + Y = y; + } + + /// + /// + /// + /// + /// + public Point(double x, double y) + { + X = (int) x; + Y = (int) y; + } + + #region Cast + + /// + /// + /// + /// + /// + public static implicit operator Vec2i(Point point) + { + return new Vec2i(point.X, point.Y); + } + + /// + /// + /// + /// + /// + public static implicit operator Point(Vec2i vec) + { + return new Point(vec.Item0, vec.Item1); + } + + #endregion + + #region Operators + + #region == / != + +#if LANG_JP + /// + /// 指定したオブジェクトと等しければtrueを返す + /// + /// 比較するオブジェクト + /// 型が同じで、メンバの値が等しければtrue +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public bool Equals(Point obj) + { + return (this.X == obj.X && this.Y == obj.Y); + } + +#if LANG_JP + /// + /// == 演算子のオーバーロード。x,y座標値が等しければtrueを返す + /// + /// 左辺値 + /// 右辺値 + /// 等しければtrue +#else + /// + /// Compares two Point objects. The result specifies whether the values of the X and Y properties of the two Point objects are equal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the X and Y values of left and right are equal; otherwise, false. +#endif + public static bool operator ==(Point lhs, Point rhs) + { + return lhs.Equals(rhs); + } + +#if LANG_JP + /// + /// != 演算子のオーバーロード。x,y座標値が等しくなければtrueを返す + /// + /// 左辺値 + /// 右辺値 + /// 等しくなければtrue +#else + /// + /// Compares two Point objects. The result specifies whether the values of the X or Y properties of the two Point objects are unequal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the values of either the X properties or the Y properties of left and right differ; otherwise, false. +#endif + public static bool operator !=(Point lhs, Point rhs) + { + return !lhs.Equals(rhs); + } + + #endregion + + #region + / - + +#if LANG_JP + /// + /// 単項プラス演算子 + /// + /// + /// +#else + /// + /// Unary plus operator + /// + /// + /// +#endif + public static Point operator +(Point pt) + { + return pt; + } + +#if LANG_JP + /// + /// 単項マイナス演算子 + /// + /// + /// +#else + /// + /// Unary minus operator + /// + /// + /// +#endif + public static Point operator -(Point pt) + { + return new Point(-pt.X, -pt.Y); + } + +#if LANG_JP + /// + /// あるオフセットで点を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts point by a certain offset + /// + /// + /// + /// +#endif + public static Point operator +(Point p1, Point p2) + { + return new Point(p1.X + p2.X, p1.Y + p2.Y); + } + +#if LANG_JP + /// + /// あるオフセットで点を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts point by a certain offset + /// + /// + /// + /// +#endif + public static Point operator -(Point p1, Point p2) + { + return new Point(p1.X - p2.X, p1.Y - p2.Y); + } + +#if LANG_JP + /// + /// あるオフセットで点を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts point by a certain offset + /// + /// + /// + /// +#endif + public static Point operator *(Point pt, double scale) + { + return new Point((int) (pt.X*scale), (int) (pt.Y*scale)); + } + + #endregion + + #endregion + + #region Override + +#if LANG_JP + /// + /// Equalsのオーバーライド + /// + /// 比較するオブジェクト + /// +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public override bool Equals(object obj) + { + return base.Equals(obj); + } + +#if LANG_JP + /// + /// GetHashCodeのオーバーライド + /// + /// このオブジェクトのハッシュ値を指定する整数値。 +#else + /// + /// Returns a hash code for this object. + /// + /// An integer value that specifies a hash value for this object. +#endif + public override int GetHashCode() + { + return X.GetHashCode() ^ Y.GetHashCode(); + } + +#if LANG_JP + /// + /// 文字列形式を返す + /// + /// 文字列形式 +#else + /// + /// Converts this object to a human readable string. + /// + /// A string that represents this object. +#endif + public override string ToString() + { + return string.Format("(x:{0} y:{1})", X, Y); + } + + #endregion + + #region Methods + +#if LANG_JP + /// + /// 2点間の距離を求める + /// + /// + /// + /// +#else + /// + /// Returns the distance between the specified two points + /// + /// + /// + /// +#endif + public static double Distance(Point p1, Point p2) + { + return Math.Sqrt(Math.Pow(p2.X - p1.X, 2) + Math.Pow(p2.Y - p1.Y, 2)); + } + +#if LANG_JP + /// + /// 2点間の距離を求める + /// + /// + /// +#else + /// + /// Returns the distance between the specified two points + /// + /// + /// +#endif + public double DistanceTo(Point p) + { + return Distance(this, p); + } + +#if LANG_JP + /// + /// ベクトルの内積を求める + /// + /// + /// + /// +#else + /// + /// Calculates the dot product of two 2D vectors. + /// + /// + /// + /// +#endif + public static double DotProduct(Point p1, Point p2) + { + return p1.X*p2.X + p1.Y*p2.Y; + } + +#if LANG_JP + /// + /// ベクトルの内積を求める + /// + /// + /// +#else + /// + /// Calculates the dot product of two 2D vectors. + /// + /// + /// +#endif + public double DotProduct(Point p) + { + return DotProduct(this, p); + } + +#if LANG_JP + /// + /// ベクトルの外積を求める + /// + /// + /// + /// +#else + /// + /// Calculates the cross product of two 2D vectors. + /// + /// + /// + /// +#endif + public static double CrossProduct(Point p1, Point p2) + { + return p1.X*p2.Y - p2.X*p1.Y; + } + +#if LANG_JP + /// + /// ベクトルの外積を求める + /// + /// + /// +#else + /// + /// Calculates the cross product of two 2D vectors. + /// + /// + /// +#endif + public double CrossProduct(Point p) + { + return CrossProduct(this, p); + } + + #endregion + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/core/Struct/Point2d.cs b/src/OpenCvSharp/modules/core/Struct/Point2d.cs new file mode 100644 index 000000000..35679ec7a --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/Point2d.cs @@ -0,0 +1,423 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Point2d : IEquatable + { + /// + /// + /// + public double X; + + /// + /// + /// + public double Y; + + /// + /// + /// + public const int SizeOf = sizeof (double) + sizeof (double); + + /// + /// + /// + /// + /// + public Point2d(double x, double y) + { + X = x; + Y = y; + } + + #region Cast + + /// + /// + /// + /// + /// + public static implicit operator Point(Point2d self) + { + return new Point((int) self.X, (int) self.Y); + } + + /// + /// + /// + /// + /// + public static implicit operator Point2d(Point point) + { + return new Point2d(point.X, point.Y); + } + + /// + /// + /// + /// + /// + public static implicit operator Vec2d(Point2d point) + { + return new Vec2d(point.X, point.Y); + } + + /// + /// + /// + /// + /// + public static implicit operator Point2d(Vec2d vec) + { + return new Point2d(vec.Item0, vec.Item1); + } + + #endregion + + #region Operators + + #region == / != + +#if LANG_JP + /// + /// 指定したオブジェクトと等しければtrueを返す + /// + /// 比較するオブジェクト + /// 型が同じで、メンバの値が等しければtrue +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public bool Equals(Point2d obj) + { + return (this.X == obj.X && this.Y == obj.Y); + } + +#if LANG_JP + /// + /// == 演算子のオーバーロード。x,y座標値が等しければtrueを返す + /// + /// 左辺値 + /// 右辺値 + /// 等しければtrue +#else + /// + /// Compares two CvPoint objects. The result specifies whether the values of the X and Y properties of the two CvPoint objects are equal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the X and Y values of left and right are equal; otherwise, false. +#endif + public static bool operator ==(Point2d lhs, Point2d rhs) + { + return lhs.Equals(rhs); + } + +#if LANG_JP + /// + /// != 演算子のオーバーロード。x,y座標値が等しくなければtrueを返す + /// + /// 左辺値 + /// 右辺値 + /// 等しくなければtrue +#else + /// + /// Compares two CvPoint2D32f objects. The result specifies whether the values of the X or Y properties of the two CvPoint2D32f objects are unequal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the values of either the X properties or the Y properties of left and right differ; otherwise, false. +#endif + public static bool operator !=(Point2d lhs, Point2d rhs) + { + return !lhs.Equals(rhs); + } + + #endregion + + #region + / - + +#if LANG_JP + /// + /// 単項プラス演算子 + /// + /// + /// +#else + /// + /// Unary plus operator + /// + /// + /// +#endif + public static Point2d operator +(Point2d pt) + { + return pt; + } + +#if LANG_JP + /// + /// 単項マイナス演算子 + /// + /// + /// +#else + /// + /// Unary minus operator + /// + /// + /// +#endif + public static Point2d operator -(Point2d pt) + { + return new Point2d(-pt.X, -pt.Y); + } + +#if LANG_JP + /// + /// あるオフセットで点を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts point by a certain offset + /// + /// + /// + /// +#endif + public static Point2d operator +(Point2d p1, Point2d p2) + { + return new Point2d(p1.X + p2.X, p1.Y + p2.Y); + } + +#if LANG_JP + /// + /// あるオフセットで点を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts point by a certain offset + /// + /// + /// + /// +#endif + public static Point2d operator -(Point2d p1, Point2d p2) + { + return new Point2d(p1.X - p2.X, p1.Y - p2.Y); + } + +#if LANG_JP + /// + /// あるオフセットで点を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts point by a certain offset + /// + /// + /// + /// +#endif + public static Point2d operator *(Point2d pt, double scale) + { + return new Point2d((float) (pt.X*scale), (float) (pt.Y*scale)); + } + + #endregion + + #endregion + + #region Override + +#if LANG_JP + /// + /// Equalsのオーバーライド + /// + /// 比較するオブジェクト + /// +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public override bool Equals(object obj) + { + return base.Equals(obj); + } + +#if LANG_JP + /// + /// GetHashCodeのオーバーライド + /// + /// このオブジェクトのハッシュ値を指定する整数値。 +#else + /// + /// Returns a hash code for this object. + /// + /// An integer value that specifies a hash value for this object. +#endif + public override int GetHashCode() + { + return X.GetHashCode() ^ Y.GetHashCode(); + } + +#if LANG_JP + /// + /// 文字列形式を返す + /// + /// 文字列形式 +#else + /// + /// Converts this object to a human readable string. + /// + /// A string that represents this object. +#endif + public override string ToString() + { + return string.Format("(x:{0} y:{1})", X, Y); + } + + #endregion + + #region Methods + +#if LANG_JP + /// + /// 2点間の距離を求める + /// + /// + /// + /// +#else + /// + /// Returns the distance between the specified two points + /// + /// + /// + /// +#endif + public static double Distance(Point2d p1, Point2d p2) + { + return Math.Sqrt(Math.Pow(p2.X - p1.X, 2) + Math.Pow(p2.Y - p1.Y, 2)); + } + +#if LANG_JP + /// + /// 2点間の距離を求める + /// + /// + /// +#else + /// + /// Returns the distance between the specified two points + /// + /// + /// +#endif + public double DistanceTo(Point2d p) + { + return Distance(this, p); + } + +#if LANG_JP + /// + /// ベクトルの内積を求める + /// + /// + /// + /// +#else + /// + /// Calculates the dot product of two 2D vectors. + /// + /// + /// + /// +#endif + public static double DotProduct(Point2d p1, Point2d p2) + { + return p1.X*p2.X + p1.Y*p2.Y; + } + +#if LANG_JP + /// + /// ベクトルの内積を求める + /// + /// + /// +#else + /// + /// Calculates the dot product of two 2D vectors. + /// + /// + /// +#endif + public double DotProduct(Point2d p) + { + return DotProduct(this, p); + } + +#if LANG_JP + /// + /// ベクトルの外積を求める + /// + /// + /// + /// +#else + /// + /// Calculates the cross product of two 2D vectors. + /// + /// + /// + /// +#endif + public static double CrossProduct(Point2d p1, Point2d p2) + { + return p1.X*p2.Y - p2.X*p1.Y; + } + +#if LANG_JP + /// + /// ベクトルの外積を求める + /// + /// + /// +#else + /// + /// Calculates the cross product of two 2D vectors. + /// + /// + /// +#endif + public double CrossProduct(Point2d p) + { + return CrossProduct(this, p); + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/core/Struct/Point2f.cs b/src/OpenCvSharp/modules/core/Struct/Point2f.cs new file mode 100644 index 000000000..780797e79 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/Point2f.cs @@ -0,0 +1,421 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ + /// + /// + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Point2f : IEquatable + { + /// + /// + /// + public float X; + + /// + /// + /// + public float Y; + + /// + /// + /// + public const int SizeOf = sizeof (float) + sizeof (float); + + /// + /// + /// + /// + /// + public Point2f(float x, float y) + { + X = x; + Y = y; + } + + #region Cast + + /// + /// + /// + /// + /// + public static implicit operator Point(Point2f self) + { + return new Point((int) self.X, (int) self.Y); + } + + /// + /// + /// + /// + /// + public static implicit operator Point2f(Point point) + { + return new Point2f(point.X, point.Y); + } + + /// + /// + /// + /// + /// + public static implicit operator Vec2f(Point2f point) + { + return new Vec2f(point.X, point.Y); + } + + /// + /// + /// + /// + /// + public static implicit operator Point2f(Vec2f vec) + { + return new Point2f(vec.Item0, vec.Item1); + } + + #endregion + + #region Operators + + #region == / != + +#if LANG_JP + /// + /// 指定したオブジェクトと等しければtrueを返す + /// + /// 比較するオブジェクト + /// 型が同じで、メンバの値が等しければtrue +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public bool Equals(Point2f obj) + { + return (this.X == obj.X && this.Y == obj.Y); + } + +#if LANG_JP + /// + /// == 演算子のオーバーロード。x,y座標値が等しければtrueを返す + /// + /// 左辺値 + /// 右辺値 + /// 等しければtrue +#else + /// + /// Compares two CvPoint objects. The result specifies whether the values of the X and Y properties of the two CvPoint objects are equal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the X and Y values of left and right are equal; otherwise, false. +#endif + public static bool operator ==(Point2f lhs, Point2f rhs) + { + return lhs.Equals(rhs); + } + +#if LANG_JP + /// + /// != 演算子のオーバーロード。x,y座標値が等しくなければtrueを返す + /// + /// 左辺値 + /// 右辺値 + /// 等しくなければtrue +#else + /// + /// Compares two CvPoint2D32f objects. The result specifies whether the values of the X or Y properties of the two CvPoint2D32f objects are unequal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the values of either the X properties or the Y properties of left and right differ; otherwise, false. +#endif + public static bool operator !=(Point2f lhs, Point2f rhs) + { + return !lhs.Equals(rhs); + } + + #endregion + + #region + / - + +#if LANG_JP + /// + /// 単項プラス演算子 + /// + /// + /// +#else + /// + /// Unary plus operator + /// + /// + /// +#endif + public static Point2f operator +(Point2f pt) + { + return pt; + } + +#if LANG_JP + /// + /// 単項マイナス演算子 + /// + /// + /// +#else + /// + /// Unary minus operator + /// + /// + /// +#endif + public static Point2f operator -(Point2f pt) + { + return new Point2f(-pt.X, -pt.Y); + } + +#if LANG_JP + /// + /// あるオフセットで点を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts point by a certain offset + /// + /// + /// + /// +#endif + public static Point2f operator +(Point2f p1, Point2f p2) + { + return new Point2f(p1.X + p2.X, p1.Y + p2.Y); + } + +#if LANG_JP + /// + /// あるオフセットで点を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts point by a certain offset + /// + /// + /// + /// +#endif + public static Point2f operator -(Point2f p1, Point2f p2) + { + return new Point2f(p1.X - p2.X, p1.Y - p2.Y); + } + +#if LANG_JP + /// + /// あるオフセットで点を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts point by a certain offset + /// + /// + /// + /// +#endif + public static Point2f operator *(Point2f pt, double scale) + { + return new Point2f((float) (pt.X*scale), (float) (pt.Y*scale)); + } + + #endregion + + #endregion + + #region Override + +#if LANG_JP + /// + /// Equalsのオーバーライド + /// + /// 比較するオブジェクト + /// +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public override bool Equals(object obj) + { + return base.Equals(obj); + } + +#if LANG_JP + /// + /// GetHashCodeのオーバーライド + /// + /// このオブジェクトのハッシュ値を指定する整数値。 +#else + /// + /// Returns a hash code for this object. + /// + /// An integer value that specifies a hash value for this object. +#endif + public override int GetHashCode() + { + return X.GetHashCode() ^ Y.GetHashCode(); + } + +#if LANG_JP + /// + /// 文字列形式を返す + /// + /// 文字列形式 +#else + /// + /// Converts this object to a human readable string. + /// + /// A string that represents this object. +#endif + public override string ToString() + { + return string.Format("(x:{0} y:{1})", X, Y); + } + + #endregion + + #region Methods + +#if LANG_JP + /// + /// 2点間の距離を求める + /// + /// + /// + /// +#else + /// + /// Returns the distance between the specified two points + /// + /// + /// + /// +#endif + public static double Distance(Point2f p1, Point2f p2) + { + return Math.Sqrt(Math.Pow(p2.X - p1.X, 2) + Math.Pow(p2.Y - p1.Y, 2)); + } + +#if LANG_JP + /// + /// 2点間の距離を求める + /// + /// + /// +#else + /// + /// Returns the distance between the specified two points + /// + /// + /// +#endif + public double DistanceTo(Point2f p) + { + return Distance(this, p); + } + +#if LANG_JP + /// + /// ベクトルの内積を求める + /// + /// + /// + /// +#else + /// + /// Calculates the dot product of two 2D vectors. + /// + /// + /// + /// +#endif + public static double DotProduct(Point2f p1, Point2f p2) + { + return p1.X*p2.X + p1.Y*p2.Y; + } + +#if LANG_JP + /// + /// ベクトルの内積を求める + /// + /// + /// +#else + /// + /// Calculates the dot product of two 2D vectors. + /// + /// + /// +#endif + public double DotProduct(Point2f p) + { + return DotProduct(this, p); + } + +#if LANG_JP + /// + /// ベクトルの外積を求める + /// + /// + /// + /// +#else + /// + /// Calculates the cross product of two 2D vectors. + /// + /// + /// + /// +#endif + public static double CrossProduct(Point2f p1, Point2f p2) + { + return p1.X*p2.Y - p2.X*p1.Y; + } + +#if LANG_JP + /// + /// ベクトルの外積を求める + /// + /// + /// +#else + /// + /// Calculates the cross product of two 2D vectors. + /// + /// + /// +#endif + public double CrossProduct(Point2f p) + { + return CrossProduct(this, p); + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/core/Struct/Point3d.cs b/src/OpenCvSharp/modules/core/Struct/Point3d.cs new file mode 100644 index 000000000..6136b7c72 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/Point3d.cs @@ -0,0 +1,290 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ + /// + /// + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Point3d : IEquatable + { + /// + /// + /// + public double X; + + /// + /// + /// + public double Y; + + /// + /// + /// + public double Z; + + /// + /// + /// + public const int SizeOf = sizeof (double) + sizeof (double) + sizeof (double); + + /// + /// + /// + /// + /// + /// + public Point3d(double x, double y, double z) + { + X = x; + Y = y; + Z = z; + } + + #region Cast + + /// + /// + /// + /// + /// + public static implicit operator Vec3d(Point3d point) + { + return new Vec3d(point.X, point.Y, point.Z); + } + + /// + /// + /// + /// + /// + public static implicit operator Point3d(Vec3d vec) + { + return new Point3d(vec.Item0, vec.Item1, vec.Item2); + } + + #endregion + + #region Operators + + #region == / != + +#if LANG_JP + /// + /// 指定したオブジェクトと等しければtrueを返す + /// + /// 比較するオブジェクト + /// 型が同じで、メンバの値が等しければtrue +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public bool Equals(Point3d obj) + { + return (this.X == obj.X && this.Y == obj.Y && this.Z == obj.Z); + } + +#if LANG_JP + /// + /// == 演算子のオーバーロード。x,y座標値が等しければtrueを返す + /// + /// 左辺値 + /// 右辺値 + /// 等しければtrue +#else + /// + /// Compares two CvPoint objects. The result specifies whether the values of the X and Y properties of the two CvPoint objects are equal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the X and Y values of left and right are equal; otherwise, false. +#endif + public static bool operator ==(Point3d lhs, Point3d rhs) + { + return lhs.Equals(rhs); + } + +#if LANG_JP + /// + /// != 演算子のオーバーロード。x,y座標値が等しくなければtrueを返す + /// + /// 左辺値 + /// 右辺値 + /// 等しくなければtrue +#else + /// + /// Compares two CvPoint2D32f objects. The result specifies whether the values of the X or Y properties of the two CvPoint2D32f objects are unequal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the values of either the X properties or the Y properties of left and right differ; otherwise, false. +#endif + public static bool operator !=(Point3d lhs, Point3d rhs) + { + return !lhs.Equals(rhs); + } + + #endregion + + #region + / - + +#if LANG_JP + /// + /// 単項プラス演算子 + /// + /// + /// +#else + /// + /// Unary plus operator + /// + /// + /// +#endif + public static Point3d operator +(Point3d pt) + { + return pt; + } + +#if LANG_JP + /// + /// 単項マイナス演算子 + /// + /// + /// +#else + /// + /// Unary minus operator + /// + /// + /// +#endif + public static Point3d operator -(Point3d pt) + { + return new Point3d(-pt.X, -pt.Y, -pt.Z); + } + +#if LANG_JP + /// + /// あるオフセットで点を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts point by a certain offset + /// + /// + /// + /// +#endif + public static Point3d operator +(Point3d p1, Point3d p2) + { + return new Point3d(p1.X + p2.X, p1.Y + p2.Y, p1.Z + p2.Z); + } + +#if LANG_JP + /// + /// あるオフセットで点を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts point by a certain offset + /// + /// + /// + /// +#endif + public static Point3d operator -(Point3d p1, Point3d p2) + { + return new Point3d(p1.X - p2.X, p1.Y - p2.Y, p1.Z - p2.Z); + } + +#if LANG_JP + /// + /// あるオフセットで点を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts point by a certain offset + /// + /// + /// + /// +#endif + public static Point3d operator *(Point3d pt, double scale) + { + return new Point3d(pt.X*scale, pt.Y*scale, pt.Z*scale); + } + + #endregion + + #endregion + + #region Override + +#if LANG_JP + /// + /// Equalsのオーバーライド + /// + /// 比較するオブジェクト + /// +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public override bool Equals(object obj) + { + return base.Equals(obj); + } + +#if LANG_JP + /// + /// GetHashCodeのオーバーライド + /// + /// このオブジェクトのハッシュ値を指定する整数値。 +#else + /// + /// Returns a hash code for this object. + /// + /// An integer value that specifies a hash value for this object. +#endif + public override int GetHashCode() + { + return X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode(); + } + +#if LANG_JP + /// + /// 文字列形式を返す + /// + /// 文字列形式 +#else + /// + /// Converts this object to a human readable string. + /// + /// A string that represents this object. +#endif + public override string ToString() + { + return string.Format("(x:{0} y:{1} z:{2})", X, Y, Z); + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/core/Struct/Point3f.cs b/src/OpenCvSharp/modules/core/Struct/Point3f.cs new file mode 100644 index 000000000..050f43aba --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/Point3f.cs @@ -0,0 +1,290 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ + /// + /// + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Point3f : IEquatable + { + /// + /// + /// + public float X; + + /// + /// + /// + public float Y; + + /// + /// + /// + public float Z; + + /// + /// + /// + public const int SizeOf = sizeof (float) + sizeof (float) + sizeof (float); + + /// + /// + /// + /// + /// + /// + public Point3f(float x, float y, float z) + { + X = x; + Y = y; + Z = z; + } + + #region Cast + + /// + /// + /// + /// + /// + public static implicit operator Vec3f(Point3f point) + { + return new Vec3f(point.X, point.Y, point.Z); + } + + /// + /// + /// + /// + /// + public static implicit operator Point3f(Vec3f vec) + { + return new Point3f(vec.Item0, vec.Item1, vec.Item2); + } + + #endregion + + #region Operators + + #region == / != + +#if LANG_JP + /// + /// 指定したオブジェクトと等しければtrueを返す + /// + /// 比較するオブジェクト + /// 型が同じで、メンバの値が等しければtrue +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public bool Equals(Point3f obj) + { + return (this.X == obj.X && this.Y == obj.Y && this.Z == obj.Z); + } + +#if LANG_JP + /// + /// == 演算子のオーバーロード。x,y座標値が等しければtrueを返す + /// + /// 左辺値 + /// 右辺値 + /// 等しければtrue +#else + /// + /// Compares two CvPoint objects. The result specifies whether the values of the X and Y properties of the two CvPoint objects are equal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the X and Y values of left and right are equal; otherwise, false. +#endif + public static bool operator ==(Point3f lhs, Point3f rhs) + { + return lhs.Equals(rhs); + } + +#if LANG_JP + /// + /// != 演算子のオーバーロード。x,y座標値が等しくなければtrueを返す + /// + /// 左辺値 + /// 右辺値 + /// 等しくなければtrue +#else + /// + /// Compares two CvPoint2D32f objects. The result specifies whether the values of the X or Y properties of the two CvPoint2D32f objects are unequal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the values of either the X properties or the Y properties of left and right differ; otherwise, false. +#endif + public static bool operator !=(Point3f lhs, Point3f rhs) + { + return !lhs.Equals(rhs); + } + + #endregion + + #region + / - + +#if LANG_JP + /// + /// 単項プラス演算子 + /// + /// + /// +#else + /// + /// Unary plus operator + /// + /// + /// +#endif + public static Point3f operator +(Point3f pt) + { + return pt; + } + +#if LANG_JP + /// + /// 単項マイナス演算子 + /// + /// + /// +#else + /// + /// Unary minus operator + /// + /// + /// +#endif + public static Point3f operator -(Point3f pt) + { + return new Point3f(-pt.X, -pt.Y, -pt.Z); + } + +#if LANG_JP + /// + /// あるオフセットで点を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts point by a certain offset + /// + /// + /// + /// +#endif + public static Point3f operator +(Point3f p1, Point3f p2) + { + return new Point3f(p1.X + p2.X, p1.Y + p2.Y, p1.Z + p2.Z); + } + +#if LANG_JP + /// + /// あるオフセットで点を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts point by a certain offset + /// + /// + /// + /// +#endif + public static Point3f operator -(Point3f p1, Point3f p2) + { + return new Point3f(p1.X - p2.X, p1.Y - p2.Y, p1.Z - p2.Z); + } + +#if LANG_JP + /// + /// あるオフセットで点を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts point by a certain offset + /// + /// + /// + /// +#endif + public static Point3f operator *(Point3f pt, double scale) + { + return new Point3f((float) (pt.X*scale), (float) (pt.Y*scale), (float) (pt.Z*scale)); + } + + #endregion + + #endregion + + #region Override + +#if LANG_JP + /// + /// Equalsのオーバーライド + /// + /// 比較するオブジェクト + /// +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public override bool Equals(object obj) + { + return base.Equals(obj); + } + +#if LANG_JP + /// + /// GetHashCodeのオーバーライド + /// + /// このオブジェクトのハッシュ値を指定する整数値。 +#else + /// + /// Returns a hash code for this object. + /// + /// An integer value that specifies a hash value for this object. +#endif + public override int GetHashCode() + { + return X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode(); + } + +#if LANG_JP + /// + /// 文字列形式を返す + /// + /// 文字列形式 +#else + /// + /// Converts this object to a human readable string. + /// + /// A string that represents this object. +#endif + public override string ToString() + { + return string.Format("(x:{0} y:{1} z:{2})", X, Y, Z); + } + + #endregion + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/core/Struct/Point3i.cs b/src/OpenCvSharp/modules/core/Struct/Point3i.cs new file mode 100644 index 000000000..a68eb2839 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/Point3i.cs @@ -0,0 +1,290 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ + /// + /// + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Point3i : IEquatable + { + /// + /// + /// + public int X; + + /// + /// + /// + public int Y; + + /// + /// + /// + public int Z; + + /// + /// + /// + public const int SizeOf = sizeof (int) + sizeof (int) + sizeof (int); + + /// + /// + /// + /// + /// + /// + public Point3i(int x, int y, int z) + { + X = x; + Y = y; + Z = z; + } + + #region Cast + + /// + /// + /// + /// + /// + public static implicit operator Vec3i(Point3i point) + { + return new Vec3i(point.X, point.Y, point.Z); + } + + /// + /// + /// + /// + /// + public static implicit operator Point3i(Vec3i vec) + { + return new Point3i(vec.Item0, vec.Item1, vec.Item2); + } + + #endregion + + #region Operators + + #region == / != + +#if LANG_JP + /// + /// 指定したオブジェクトと等しければtrueを返す + /// + /// 比較するオブジェクト + /// 型が同じで、メンバの値が等しければtrue +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public bool Equals(Point3i obj) + { + return (this.X == obj.X && this.Y == obj.Y && this.Z == obj.Z); + } + +#if LANG_JP + /// + /// == 演算子のオーバーロード。x,y座標値が等しければtrueを返す + /// + /// 左辺値 + /// 右辺値 + /// 等しければtrue +#else + /// + /// Compares two CvPoint objects. The result specifies whether the values of the X and Y properties of the two CvPoint objects are equal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the X and Y values of left and right are equal; otherwise, false. +#endif + public static bool operator ==(Point3i lhs, Point3i rhs) + { + return lhs.Equals(rhs); + } + +#if LANG_JP + /// + /// != 演算子のオーバーロード。x,y座標値が等しくなければtrueを返す + /// + /// 左辺値 + /// 右辺値 + /// 等しくなければtrue +#else + /// + /// Compares two CvPoint2D32f objects. The result specifies whether the values of the X or Y properties of the two CvPoint2D32f objects are unequal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the values of either the X properties or the Y properties of left and right differ; otherwise, false. +#endif + public static bool operator !=(Point3i lhs, Point3i rhs) + { + return !lhs.Equals(rhs); + } + + #endregion + + #region + / - + +#if LANG_JP + /// + /// 単項プラス演算子 + /// + /// + /// +#else + /// + /// Unary plus operator + /// + /// + /// +#endif + public static Point3i operator +(Point3i pt) + { + return pt; + } + +#if LANG_JP + /// + /// 単項マイナス演算子 + /// + /// + /// +#else + /// + /// Unary minus operator + /// + /// + /// +#endif + public static Point3i operator -(Point3i pt) + { + return new Point3i(-pt.X, -pt.Y, -pt.Z); + } + +#if LANG_JP + /// + /// あるオフセットで点を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts point by a certain offset + /// + /// + /// + /// +#endif + public static Point3i operator +(Point3i p1, Point3i p2) + { + return new Point3i(p1.X + p2.X, p1.Y + p2.Y, p1.Z + p2.Z); + } + +#if LANG_JP + /// + /// あるオフセットで点を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts point by a certain offset + /// + /// + /// + /// +#endif + public static Point3i operator -(Point3i p1, Point3i p2) + { + return new Point3i(p1.X - p2.X, p1.Y - p2.Y, p1.Z - p2.Z); + } + +#if LANG_JP + /// + /// あるオフセットで点を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts point by a certain offset + /// + /// + /// + /// +#endif + public static Point3i operator *(Point3i pt, double scale) + { + return new Point3i((int) (pt.X*scale), (int) (pt.Y*scale), (int) (pt.Z*scale)); + } + + #endregion + + #endregion + + #region Override + +#if LANG_JP + /// + /// Equalsのオーバーライド + /// + /// 比較するオブジェクト + /// +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public override bool Equals(object obj) + { + return base.Equals(obj); + } + +#if LANG_JP + /// + /// GetHashCodeのオーバーライド + /// + /// このオブジェクトのハッシュ値を指定する整数値。 +#else + /// + /// Returns a hash code for this object. + /// + /// An integer value that specifies a hash value for this object. +#endif + public override int GetHashCode() + { + return X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode(); + } + +#if LANG_JP + /// + /// 文字列形式を返す + /// + /// 文字列形式 +#else + /// + /// Converts this object to a human readable string. + /// + /// A string that represents this object. +#endif + public override string ToString() + { + return string.Format("(x:{0} y:{1} z:{2})", X, Y, Z); + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/core/Struct/Range.cs b/src/OpenCvSharp/modules/core/Struct/Range.cs new file mode 100644 index 000000000..51c0dd9b4 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/Range.cs @@ -0,0 +1,42 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ + /// + /// + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Range + { + /// + /// + /// + public int Start; + + /// + /// + /// + public int End; + + /// + /// + /// + /// + /// + public Range(int start, int end) + { + Start = start; + End = end; + } + + /// + /// + /// + public static Range All + { + get { return new Range(Int32.MinValue, Int32.MaxValue); } + } + } +} diff --git a/src/OpenCvSharp/modules/core/Struct/Rangef.cs b/src/OpenCvSharp/modules/core/Struct/Rangef.cs new file mode 100644 index 000000000..2e2a591af --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/Rangef.cs @@ -0,0 +1,52 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ + /// + /// float Range class + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Rangef + { + /// + /// + /// + public float Start; + + /// + /// + /// + public float End; + + /// + /// + /// + /// + /// + public Rangef(float start, float end) + { + Start = start; + End = end; + } + + /// + /// + /// + /// + /// + public static implicit operator Range(Rangef range) + { + return new Range((int)range.Start, (int)range.End); + } + + /// + /// + /// + public static Range All + { + get { return new Range(Int32.MinValue, Int32.MaxValue); } + } + } +} diff --git a/src/OpenCvSharp/modules/core/Struct/Rect.cs b/src/OpenCvSharp/modules/core/Struct/Rect.cs new file mode 100644 index 000000000..912ee36a8 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/Rect.cs @@ -0,0 +1,713 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ + /// + /// Stores a set of four integers that represent the location and size of a rectangle + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Rect : IEquatable + { + #region Field + + /// + /// + /// + public int X; + + /// + /// + /// + public int Y; + + /// + /// + /// + public int Width; + + /// + /// + /// + public int Height; + + /// + /// sizeof(Rect) + /// + public const int SizeOf = sizeof (int)*4; + +#if LANG_JP + /// + /// プロパティを初期化しない状態の Rect 構造体を表します。 + /// +#else + /// + /// Represents a Rect structure with its properties left uninitialized. + /// +#endif + public static readonly Rect Empty = new Rect(); + + #endregion + + /// + /// Initializes a new instance of the Rectangle class with the specified location and size. + /// + /// The x-coordinate of the upper-left corner of the rectangle. + /// The y-coordinate of the upper-left corner of the rectangle. + /// The width of the rectangle. + /// The height of the rectangle. + public Rect(int x, int y, int width, int height) + { + X = x; + Y = y; + Width = width; + Height = height; + } + + /// + /// Initializes a new instance of the Rectangle class with the specified location and size. + /// + /// A Point that represents the upper-left corner of the rectangular region. + /// A Size that represents the width and height of the rectangular region. + public Rect(Point location, Size size) + { + X = location.X; + Y = location.Y; + Width = size.Width; + Height = size.Height; + } + + /// + /// Creates a Rectangle structure with the specified edge locations. + /// + /// The x-coordinate of the upper-left corner of this Rectangle structure. + /// The y-coordinate of the upper-left corner of this Rectangle structure. + /// The x-coordinate of the lower-right corner of this Rectangle structure. + /// The y-coordinate of the lower-right corner of this Rectangle structure. +// ReSharper disable once InconsistentNaming + public static Rect FromLTRB(int left, int top, int right, int bottom) + { + Rect r = new Rect + { + X = left, + Y = top, + Width = right - left + 1, + Height = bottom - top + 1 + }; + + if (r.Width < 0) + throw new ArgumentException("right > left"); + if (r.Height < 0) + throw new ArgumentException("bottom > top"); + return r; + } + + #region Operators + + #region == / != + +#if LANG_JP + /// + /// 指定したオブジェクトと等しければtrueを返す + /// + /// 比較するオブジェクト + /// 型が同じで、メンバの値が等しければtrue +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public bool Equals(Rect obj) + { + return (X == obj.X && Y == obj.Y && Width == obj.Width && Height == obj.Height); + } + +#if LANG_JP + /// + /// == 演算子のオーバーロード + /// + /// 左辺値 + /// 右辺値 + /// 等しければtrue +#else + /// + /// Compares two Rect objects. The result specifies whether the members of each object are equal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the members of left and right are equal; otherwise, false. +#endif + public static bool operator ==(Rect lhs, Rect rhs) + { + return lhs.Equals(rhs); + } + +#if LANG_JP + /// + /// != 演算子のオーバーロード + /// + /// 左辺値 + /// 右辺値 + /// 等しくなければtrue +#else + /// + /// Compares two Rect objects. The result specifies whether the members of each object are unequal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the members of left and right are unequal; otherwise, false. +#endif + public static bool operator !=(Rect lhs, Rect rhs) + { + return !lhs.Equals(rhs); + } + + #endregion + + #region + / - + +#if LANG_JP + /// + /// あるオフセットで矩形を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts rectangle by a certain offset + /// + /// + /// + /// +#endif + public static Rect operator +(Rect rect, Point pt) + { + return new Rect(rect.X + pt.X, rect.Y + pt.Y, rect.Width, rect.Height); + } + +#if LANG_JP + /// + /// あるオフセットで矩形を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts rectangle by a certain offset + /// + /// + /// + /// +#endif + public static Rect operator -(Rect rect, Point pt) + { + return new Rect(rect.X - pt.X, rect.Y - pt.Y, rect.Width, rect.Height); + } + +#if LANG_JP + /// + /// 指定したサイズ応じて、矩形を膨張または縮小する + /// + /// + /// + /// +#else + /// + /// Expands or shrinks rectangle by a certain amount + /// + /// + /// + /// +#endif + public static Rect operator +(Rect rect, Size size) + { + return new Rect(rect.X, rect.Y, rect.Width + size.Width, rect.Height + size.Height); + } + +#if LANG_JP + /// + /// 指定したサイズ応じて、矩形を膨張または縮小する + /// + /// + /// + /// +#else + /// + /// Expands or shrinks rectangle by a certain amount + /// + /// + /// + /// +#endif + public static Rect operator -(Rect rect, Size size) + { + return new Rect(rect.X, rect.Y, rect.Width - size.Width, rect.Height - size.Height); + } + + #endregion + + #region & / | + +#if LANG_JP + /// + /// 2つの矩形の交差部分を表す矩形を取得する + /// + /// + /// + /// +#else + /// + /// Determines the Rect structure that represents the intersection of two rectangles. + /// + /// A rectangle to intersect. + /// A rectangle to intersect. + /// +#endif + public static Rect operator &(Rect a, Rect b) + { + return Intersect(a, b); + } + +#if LANG_JP + /// + /// 2つの矩形の和集合を表す矩形を取得する + /// + /// + /// + /// +#else + /// + /// Gets a Rect structure that contains the union of two Rect structures. + /// + /// A rectangle to union. + /// A rectangle to union. + /// +#endif + public static Rect operator |(Rect a, Rect b) + { + return Union(a, b); + } + + #endregion + + #endregion + + #region Properties + +#if LANG_JP + /// + /// 上端のy座標 + /// +#else + /// + /// Gets the y-coordinate of the top edge of this Rect structure. + /// +#endif + public int Top + { + get { return Y; } + set { Y = value; } + } + +#if LANG_JP + /// + /// 下端のy座標 (Y + Height) + /// +#else + /// + /// Gets the y-coordinate that is the sum of the Y and Height property values of this Rect structure. + /// +#endif + public int Bottom + { + get { return Y + Height - 1; } + } + +#if LANG_JP + /// + /// 左端のx座標 + /// +#else + /// + /// Gets the x-coordinate of the left edge of this Rect structure. + /// +#endif + public int Left + { + get { return X; } + set { X = value; } + } + +#if LANG_JP + /// + /// 右端のx座標 (X + Width) + /// +#else + /// + /// Gets the x-coordinate that is the sum of X and Width property values of this Rect structure. + /// +#endif + public int Right + { + get { return X + Width - 1; } + } + +#if LANG_JP + /// + /// 矩形の左上頂点の位置 [Point(X, Y)] + /// +#else + /// + /// Coordinate of the left-most rectangle corner [Point(X, Y)] + /// +#endif + public Point Location + { + get { return new Point(X, Y); } + set + { + X = value.X; + Y = value.Y; + } + } + +#if LANG_JP + /// + /// 矩形の大きさ [CvSize(Width, Height)] + /// +#else + /// + /// Size of the rectangle [CvSize(Width, Height)] + /// +#endif + public Size Size + { + get { return new Size(Width, Height); } + set + { + Width = value.Width; + Height = value.Height; + } + } + +#if LANG_JP + /// + /// 左上の頂点 + /// +#else + /// + /// Coordinate of the left-most rectangle corner [Point(X, Y)] + /// +#endif + public Point TopLeft + { + get { return new Point(X, Y); } + } + +#if LANG_JP + /// + /// 右下の頂点 + /// +#else + /// + /// Coordinate of the right-most rectangle corner [Point(X+Width, Y+Height)] + /// +#endif + public Point BottomRight + { + get { return new Point(X + Width - 1, Y + Height - 1); } + } + + #endregion + + #region Methods + +#if LANG_JP + /// + /// 指定した点がこの矩形に含まれているかどうかを判断する + /// + /// x座標 + /// y座標 + /// +#else + /// + /// Determines if the specified point is contained within the rectangular region defined by this Rectangle. + /// + /// x-coordinate of the point + /// y-coordinate of the point + /// +#endif + public bool Contains(int x, int y) + { + return (X <= x && Y <= y && X + Width - 1 > x && Y + Height - 1 > y); + } + +#if LANG_JP + /// + /// 指定した点がこの矩形に含まれているかどうかを判断する + /// + /// 点 + /// +#else + /// + /// Determines if the specified point is contained within the rectangular region defined by this Rectangle. + /// + /// point + /// +#endif + public bool Contains(Point pt) + { + return Contains(pt.X, pt.Y); + } + +#if LANG_JP + /// + /// 指定した矩形がこの矩形に含まれているかどうかを判断する + /// + /// 矩形 + /// +#else + /// + /// Determines if the specified rectangle is contained within the rectangular region defined by this Rectangle. + /// + /// rectangle + /// +#endif + public bool Contains(Rect rect) + { + return X <= rect.X && + (rect.X + rect.Width) <= (X + Width) && + Y <= rect.Y && + (rect.Y + rect.Height) <= (Y + Height); + } + +#if LANG_JP + /// + /// このRectを指定の量だけ膨らませる + /// + /// 水平方向の膨張量 + /// 垂直方向の膨張量 +#else + /// + /// Inflates this Rect by the specified amount. + /// + /// The amount to inflate this Rectangle horizontally. + /// The amount to inflate this Rectangle vertically. +#endif + public void Inflate(int width, int height) + { + X -= width; + Y -= height; + Width += (2*width); + Height += (2*height); + } + +#if LANG_JP + /// + /// このRectを指定の量だけ膨らませる + /// + /// この四角形の膨張量 +#else + /// + /// Inflates this Rect by the specified amount. + /// + /// The amount to inflate this rectangle. +#endif + public void Inflate(Size size) + { + + Inflate(size.Width, size.Height); + } + +#if LANG_JP + /// + /// このRectを指定の量だけ膨らませる + /// + /// 対象の矩形 + /// 水平方向の膨張量 + /// 垂直方向の膨張量 + /// +#else + /// + /// Creates and returns an inflated copy of the specified Rect structure. + /// + /// The Rectangle with which to start. This rectangle is not modified. + /// The amount to inflate this Rectangle horizontally. + /// The amount to inflate this Rectangle vertically. + /// +#endif + public static Rect Inflate(Rect rect, int x, int y) + { + rect.Inflate(x, y); + return rect; + } + +#if LANG_JP + /// + /// 2つの矩形の交差部分を表す矩形を取得する + /// + /// + /// + /// +#else + /// + /// Determines the Rect structure that represents the intersection of two rectangles. + /// + /// A rectangle to intersect. + /// A rectangle to intersect. + /// +#endif + public static Rect Intersect(Rect a, Rect b) + { + int x1 = Math.Max(a.X, b.X); + int x2 = Math.Min(a.X + a.Width, b.X + b.Width); + int y1 = Math.Max(a.Y, b.Y); + int y2 = Math.Min(a.Y + a.Height, b.Y + b.Height); + + if (x2 >= x1 && y2 >= y1) + return new Rect(x1, y1, x2 - x1, y2 - y1); + return Empty; + } + +#if LANG_JP + /// + /// 2 つの矩形の交差部分を表す矩形を取得する + /// + /// + /// +#else + /// + /// Determines the Rect structure that represents the intersection of two rectangles. + /// + /// A rectangle to intersect. + /// +#endif + public Rect Intersect(Rect rect) + { + return Intersect(this, rect); + } + +#if LANG_JP + /// + /// 指定した矩形がこの矩形と交差するかどうか判定する + /// + /// 矩形 + /// +#else + /// + /// Determines if this rectangle intersects with rect. + /// + /// Rectangle + /// +#endif + public bool IntersectsWith(Rect rect) + { + return ( + (X < rect.X + rect.Width) && + (X + Width > rect.X) && + (Y < rect.Y + rect.Height) && + (Y + Height > rect.Y) + ); + } + +#if LANG_JP + /// + /// 2つの矩形の和集合を表す矩形を取得する + /// + /// + /// +#else + /// + /// Gets a Rect structure that contains the union of two Rect structures. + /// + /// A rectangle to union. + /// +#endif + public Rect Union(Rect rect) + { + return Union(this, rect); + } + +#if LANG_JP + /// + /// 2つの矩形の和集合を表す矩形を取得する + /// + /// + /// + /// +#else + /// + /// Gets a Rect structure that contains the union of two Rect structures. + /// + /// A rectangle to union. + /// A rectangle to union. + /// +#endif + public static Rect Union(Rect a, Rect b) + { + int x1 = Math.Min(a.X, b.X); + int x2 = Math.Max(a.X + a.Width, b.X + b.Width); + int y1 = Math.Min(a.Y, b.Y); + int y2 = Math.Max(a.Y + a.Height, b.Y + b.Height); + + return new Rect(x1, y1, x2 - x1, y2 - y1); + } + +#if LANG_JP + /// + /// Equalsのオーバーライド + /// + /// 比較するオブジェクト + /// +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public override bool Equals(object obj) + { + return base.Equals(obj); + } + +#if LANG_JP + /// + /// GetHashCodeのオーバーライド + /// + /// このオブジェクトのハッシュ値を指定する整数値。 +#else + /// + /// Returns a hash code for this object. + /// + /// An integer value that specifies a hash value for this object. +#endif + public override int GetHashCode() + { + return X.GetHashCode() ^ Y.GetHashCode() ^ Width.GetHashCode() ^ Height.GetHashCode(); + } + +#if LANG_JP + /// + /// 文字列形式を返す + /// + /// 文字列形式 +#else + /// + /// Converts this object to a human readable string. + /// + /// A string that represents this object. +#endif + public override string ToString() + { + return string.Format("(x:{0} y:{1} width:{2} height:{3})", X, Y, Width, Height); + } + + #endregion + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/core/Struct/Rectf.cs b/src/OpenCvSharp/modules/core/Struct/Rectf.cs new file mode 100644 index 000000000..951a3dd69 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/Rectf.cs @@ -0,0 +1,677 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ + /// + /// + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Rectf : IEquatable + { + #region Field + /// + /// + /// + public float X; + /// + /// + /// + public float Y; + /// + /// + /// + public float Width; + /// + /// + /// + public float Height; + /// + /// sizeof(Rect) + /// + public const int SizeOf = sizeof(float) * 4; + +#if LANG_JP + /// + /// プロパティを初期化しない状態の CvRect 構造体を表します。 + /// +#else + /// + /// Represents a CvRect structure with its properties left uninitialized. + /// +#endif + public static readonly Rectf Empty = new Rectf(); + #endregion + + /// + /// + /// + /// + /// + /// + /// + public Rectf(float x, float y, float width, float height) + { + X = x; + Y = y; + Width = width; + Height = height; + } + + /// + /// + /// + /// + /// + public Rectf(Point2f location, Size2f size) + { + X = location.X; + Y = location.Y; + Width = size.Width; + Height = size.Height; + } + + /// + /// + /// + /// + /// + /// + /// + public static Rectf FromLTRB(float left, float top, float right, float bottom) + { + Rectf r = new Rectf + { + X = left, + Y = top, + Width = right - left + 1, + Height = bottom - top + 1 + }; + + if (r.Width < 0) + throw new ArgumentException("right > left"); + if (r.Height < 0) + throw new ArgumentException("bottom > top"); + return r; + } + + #region Operators + #region == / != +#if LANG_JP + /// + /// 指定したオブジェクトと等しければtrueを返す + /// + /// 比較するオブジェクト + /// 型が同じで、メンバの値が等しければtrue +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public bool Equals(Rectf obj) + { + return (X == obj.X && Y == obj.Y && Width == obj.Width && Height == obj.Height); + } +#if LANG_JP + /// + /// == 演算子のオーバーロード + /// + /// 左辺値 + /// 右辺値 + /// 等しければtrue +#else + /// + /// Compares two Rectf objects. The result specifies whether the members of each object are equal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the members of left and right are equal; otherwise, false. +#endif + public static bool operator ==(Rectf lhs, Rectf rhs) + { + return lhs.Equals(rhs); + } +#if LANG_JP + /// + /// != 演算子のオーバーロード + /// + /// 左辺値 + /// 右辺値 + /// 等しくなければtrue +#else + /// + /// Compares two Rectf objects. The result specifies whether the members of each object are unequal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the members of left and right are unequal; otherwise, false. +#endif + public static bool operator !=(Rectf lhs, Rectf rhs) + { + return !lhs.Equals(rhs); + } + #endregion + #region + / - +#if LANG_JP + /// + /// あるオフセットで矩形を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts rectangle by a certain offset + /// + /// + /// + /// +#endif + public static Rectf operator +(Rectf rect, Point2f pt) + { + return new Rectf(rect.X + pt.X, rect.Y + pt.Y, rect.Width, rect.Height); + } +#if LANG_JP + /// + /// あるオフセットで矩形を移動させる + /// + /// + /// + /// +#else + /// + /// Shifts rectangle by a certain offset + /// + /// + /// + /// +#endif + public static Rectf operator -(Rectf rect, Point2f pt) + { + return new Rectf(rect.X - pt.X, rect.Y - pt.Y, rect.Width, rect.Height); + } + +#if LANG_JP + /// + /// 指定したサイズ応じて、矩形を膨張または縮小する + /// + /// + /// + /// +#else + /// + /// Expands or shrinks rectangle by a certain amount + /// + /// + /// + /// +#endif + public static Rectf operator +(Rectf rect, Size2f size) + { + return new Rectf(rect.X, rect.Y, rect.Width + size.Width, rect.Height + size.Height); + } +#if LANG_JP + /// + /// 指定したサイズ応じて、矩形を膨張または縮小する + /// + /// + /// + /// +#else + /// + /// Expands or shrinks rectangle by a certain amount + /// + /// + /// + /// +#endif + public static Rectf operator -(Rectf rect, Size2f size) + { + return new Rectf(rect.X, rect.Y, rect.Width - size.Width, rect.Height - size.Height); + } + #endregion + #region & / | +#if LANG_JP + /// + /// 2つの矩形の交差部分を表す矩形を取得する + /// + /// + /// + /// +#else + /// + /// Determines the CvRect structure that represents the intersection of two rectangles. + /// + /// A rectangle to intersect. + /// A rectangle to intersect. + /// +#endif + public static Rectf operator &(Rectf a, Rectf b) + { + return Intersect(a, b); + } + +#if LANG_JP + /// + /// 2つの矩形の和集合を表す矩形を取得する + /// + /// + /// + /// +#else + /// + /// Gets a CvRect structure that contains the union of two CvRect structures. + /// + /// A rectangle to union. + /// A rectangle to union. + /// +#endif + public static Rectf operator |(Rectf a, Rectf b) + { + return Union(a, b); + } + #endregion + #endregion + + #region Properties +#if LANG_JP + /// + /// 上端のy座標 + /// +#else + /// + /// Gets the y-coordinate of the top edge of this CvRect structure. + /// +#endif + public float Top + { + get { return Y; } + set { Y = value; } + } +#if LANG_JP + /// + /// 下端のy座標 (Y + Height) + /// +#else + /// + /// Gets the y-coordinate that is the sum of the Y and Height property values of this CvRect structure. + /// +#endif + public float Bottom + { + get { return Y + Height - 1; } + } +#if LANG_JP + /// + /// 左端のx座標 + /// +#else + /// + /// Gets the x-coordinate of the left edge of this CvRect structure. + /// +#endif + public float Left + { + get { return X; } + set { X = value; } + } +#if LANG_JP + /// + /// 右端のx座標 (X + Width) + /// +#else + /// + /// Gets the x-coordinate that is the sum of X and Width property values of this CvRect structure. + /// +#endif + public float Right + { + get { return X + Width - 1; } + } + +#if LANG_JP + /// + /// 矩形の左上頂点の位置 [Point2f(X, Y)] + /// +#else + /// + /// Coordinate of the left-most rectangle corner [Point2f(X, Y)] + /// +#endif + public Point2f Location + { + get { return new Point2f(X, Y); } + set + { + X = value.X; + Y = value.Y; + } + } +#if LANG_JP + /// + /// 矩形の大きさ [CvSize(Width, Height)] + /// +#else + /// + /// Size of the rectangle [CvSize(Width, Height)] + /// +#endif + public Size2f Size + { + get { return new Size2f(Width, Height); } + set + { + Width = value.Width; + Height = value.Height; + } + } + +#if LANG_JP + /// + /// 左上の頂点 + /// +#else + /// + /// Coordinate of the left-most rectangle corner [Point2f(X, Y)] + /// +#endif + public Point2f TopLeft + { + get { return new Point2f(X, Y); } + } +#if LANG_JP + /// + /// 右下の頂点 + /// +#else + /// + /// Coordinate of the right-most rectangle corner [Point2f(X+Width, Y+Height)] + /// +#endif + public Point2f BottomRight + { + get { return new Point2f(X + Width - 1, Y + Height - 1); } + } + #endregion + + #region Methods + +#if LANG_JP + /// + /// 指定した点がこの矩形に含まれているかどうかを判断する + /// + /// x座標 + /// y座標 + /// +#else + /// + /// Determines if the specified point is contained within the rectangular region defined by this Rectangle. + /// + /// x-coordinate of the point + /// y-coordinate of the point + /// +#endif + public bool Contains(float x, float y) + { + return (X <= x && Y <= y && X + Width - 1 > x && Y + Height - 1 > y); + } +#if LANG_JP + /// + /// 指定した点がこの矩形に含まれているかどうかを判断する + /// + /// 点 + /// +#else + /// + /// Determines if the specified point is contained within the rectangular region defined by this Rectangle. + /// + /// point + /// +#endif + public bool Contains(Point2f pt) + { + return Contains(pt.X, pt.Y); + } +#if LANG_JP + /// + /// 指定した矩形がこの矩形に含まれているかどうかを判断する + /// + /// 矩形 + /// +#else + /// + /// Determines if the specified rectangle is contained within the rectangular region defined by this Rectangle. + /// + /// rectangle + /// +#endif + public bool Contains(Rectf rect) + { + return X <= rect.X && + (rect.X + rect.Width) <= (X + Width) && + Y <= rect.Y && + (rect.Y + rect.Height) <= (Y + Height); + } + +#if LANG_JP + /// + /// このCvRectを指定の量だけ膨らませる + /// + /// 水平方向の膨張量 + /// 垂直方向の膨張量 +#else + /// + /// Inflates this Rect by the specified amount. + /// + /// The amount to inflate this Rectangle horizontally. + /// The amount to inflate this Rectangle vertically. +#endif + public void Inflate(float width, float height) + { + X -= width; + Y -= height; + Width += (2 * width); + Height += (2 * height); + } +#if LANG_JP + /// + /// このCvRectを指定の量だけ膨らませる + /// + /// この四角形の膨張量 +#else + /// + /// Inflates this Rect by the specified amount. + /// + /// The amount to inflate this rectangle. +#endif + public void Inflate(Size2f size) + { + + Inflate(size.Width, size.Height); + } +#if LANG_JP + /// + /// このCvRectを指定の量だけ膨らませる + /// + /// 対象の矩形 + /// 水平方向の膨張量 + /// 垂直方向の膨張量 + /// +#else + /// + /// Creates and returns an inflated copy of the specified CvRect structure. + /// + /// The Rectangle with which to start. This rectangle is not modified. + /// The amount to inflate this Rectangle horizontally. + /// The amount to inflate this Rectangle vertically. + /// +#endif + public static Rect Inflate(Rect rect, int x, int y) + { + rect.Inflate(x, y); + return rect; + } + +#if LANG_JP + /// + /// 2つの矩形の交差部分を表す矩形を取得する + /// + /// + /// + /// +#else + /// + /// Determines the CvRect structure that represents the intersection of two rectangles. + /// + /// A rectangle to intersect. + /// A rectangle to intersect. + /// +#endif + public static Rectf Intersect(Rectf a, Rectf b) + { + float x1 = Math.Max(a.X, b.X); + float x2 = Math.Min(a.X + a.Width, b.X + b.Width); + float y1 = Math.Max(a.Y, b.Y); + float y2 = Math.Min(a.Y + a.Height, b.Y + b.Height); + + if (x2 >= x1 && y2 >= y1) + return new Rectf(x1, y1, x2 - x1, y2 - y1); + return Empty; + } +#if LANG_JP + /// + /// 2 つの矩形の交差部分を表す矩形を取得する + /// + /// + /// +#else + /// + /// Determines the CvRect structure that represents the intersection of two rectangles. + /// + /// A rectangle to intersect. + /// +#endif + public Rectf Intersect(Rectf rect) + { + return Intersect(this, rect); + } + +#if LANG_JP + /// + /// 指定した矩形がこの矩形と交差するかどうか判定する + /// + /// 矩形 + /// +#else + /// + /// Determines if this rectangle intersects with rect. + /// + /// Rectangle + /// +#endif + public bool IntersectsWith(Rectf rect) + { + return ( + (X < rect.X + rect.Width) && + (X + Width > rect.X) && + (Y < rect.Y + rect.Height) && + (Y + Height > rect.Y) + ); + } + +#if LANG_JP + /// + /// 2つの矩形の和集合を表す矩形を取得する + /// + /// + /// +#else + /// + /// Gets a CvRect structure that contains the union of two CvRect structures. + /// + /// A rectangle to union. + /// +#endif + public Rectf Union(Rectf rect) + { + return Union(this, rect); + } +#if LANG_JP + /// + /// 2つの矩形の和集合を表す矩形を取得する + /// + /// + /// + /// +#else + /// + /// Gets a CvRect structure that contains the union of two CvRect structures. + /// + /// A rectangle to union. + /// A rectangle to union. + /// +#endif + public static Rectf Union(Rectf a, Rectf b) + { + float x1 = Math.Min(a.X, b.X); + float x2 = Math.Max(a.X + a.Width, b.X + b.Width); + float y1 = Math.Min(a.Y, b.Y); + float y2 = Math.Max(a.Y + a.Height, b.Y + b.Height); + + return new Rectf(x1, y1, x2 - x1, y2 - y1); + } + +#if LANG_JP + /// + /// Equalsのオーバーライド + /// + /// 比較するオブジェクト + /// +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public override bool Equals(object obj) + { + return base.Equals(obj); + } +#if LANG_JP + /// + /// GetHashCodeのオーバーライド + /// + /// このオブジェクトのハッシュ値を指定する整数値。 +#else + /// + /// Returns a hash code for this object. + /// + /// An integer value that specifies a hash value for this object. +#endif + public override int GetHashCode() + { + return X.GetHashCode() ^ Y.GetHashCode() ^ Width.GetHashCode() ^ Height.GetHashCode(); + } +#if LANG_JP + /// + /// 文字列形式を返す + /// + /// 文字列形式 +#else + /// + /// Converts this object to a human readable string. + /// + /// A string that represents this object. +#endif + public override string ToString() + { + return string.Format("(x:{0} y:{1} width:{2} height:{3})", X, Y, Width, Height); + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/core/Struct/RotatedRect.cs b/src/OpenCvSharp/modules/core/Struct/RotatedRect.cs new file mode 100644 index 000000000..cede70f70 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/RotatedRect.cs @@ -0,0 +1,81 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ + /// + /// + /// + [StructLayout(LayoutKind.Sequential)] + public struct RotatedRect + { + /// + /// the rectangle mass center + /// + public Point2f Center; + + /// + /// width and height of the rectangle + /// + public Size2f Size; + + /// + /// the rotation angle. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right rectangle. + /// + public float Angle; + + /// + /// + /// + /// + /// + /// + public RotatedRect(Point2f center, Size2f size, float angle) + { + Center = center; + Size = size; + Angle = angle; + } + + /// + /// returns 4 vertices of the rectangle + /// + /// + public Point2f[] Points() + { + double angle = Angle*Math.PI/180.0; + float b = (float) Math.Cos(angle)*0.5f; + float a = (float) Math.Sin(angle)*0.5f; + + Point2f[] pt = new Point2f[4]; + pt[0].X = Center.X - a*Size.Height - b*Size.Width; + pt[0].Y = Center.Y + b*Size.Height - a*Size.Width; + pt[1].X = Center.X + a*Size.Height - b*Size.Width; + pt[1].Y = Center.Y - b*Size.Height - a*Size.Width; + pt[2].X = 2*Center.X - pt[0].X; + pt[2].Y = 2*Center.Y - pt[0].Y; + pt[3].X = 2*Center.X - pt[1].X; + pt[3].Y = 2*Center.Y - pt[1].Y; + return pt; + } + + /// + /// returns the minimal up-right rectangle containing the rotated rectangle + /// + /// + public Rect BoundingRect() + { + Point2f[] pt = Points(); + Rect r = new Rect + { + X = (int)Math.Floor(Math.Min(Math.Min(Math.Min(pt[0].X, pt[1].X), pt[2].X), pt[3].X)), + Y = (int)Math.Floor(Math.Min(Math.Min(Math.Min(pt[0].Y, pt[1].Y), pt[2].Y), pt[3].Y)), + Width = (int)Math.Ceiling(Math.Max(Math.Max(Math.Max(pt[0].X, pt[1].X), pt[2].X), pt[3].X)), + Height = (int)Math.Ceiling(Math.Max(Math.Max(Math.Max(pt[0].Y, pt[1].Y), pt[2].Y), pt[3].Y)) + }; + r.Width -= r.X - 1; + r.Height -= r.Y - 1; + return r; + } + } +} diff --git a/src/OpenCvSharp/modules/core/Struct/Scalar.cs b/src/OpenCvSharp/modules/core/Struct/Scalar.cs new file mode 100644 index 000000000..70a731ca0 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/Scalar.cs @@ -0,0 +1,1195 @@ +using System; + +namespace OpenCvSharp +{ + /// + /// + /// + [Serializable] + public struct Scalar : IEquatable + { + #region Field + + /// + /// + /// + public double Val0; + + /// + /// + /// + public double Val1; + + /// + /// + /// + public double Val2; + + /// + /// + /// + public double Val3; + + /// + /// + /// + public double this[int i] + { + get + { + switch (i) + { + case 0: + return Val0; + case 1: + return Val1; + case 2: + return Val2; + case 3: + return Val3; + default: + throw new IndexOutOfRangeException(); + } + } + set + { + switch (i) + { + case 0: + Val0 = value; + break; + case 1: + Val1 = value; + break; + case 2: + Val2 = value; + break; + case 3: + Val3 = value; + break; + default: + throw new IndexOutOfRangeException(); + } + } + } + + #endregion + + #region Init + + /// + /// + /// + /// + public Scalar(double v0) + : this(v0, 0, 0, 0) + { + } + + /// + /// + /// + /// + /// + public Scalar(double v0, double v1) + : this(v0, v1, 0, 0) + { + } + + /// + /// + /// + /// + /// + /// + public Scalar(double v0, double v1, double v2) + : this(v0, v1, v2, 0) + { + } + + /// + /// + /// + /// + /// + /// + /// + public Scalar(double v0, double v1, double v2, double v3) + { + Val0 = v0; + Val1 = v1; + Val2 = v2; + Val3 = v3; + } + + /// + /// + /// + /// + /// + /// + public static Scalar FromRgb(int r, int g, int b) + { + return new Scalar(b, g, r); + } + + /// + /// + /// + public static Scalar RandomColor() + { + var buf = new byte[3]; + random.NextBytes(buf); + return new Scalar(buf[0], buf[1], buf[2]); + } + + private static readonly Random random = new Random(); + + #endregion + + #region Cast + + /// + /// + /// + /// + /// + public static explicit operator double(Scalar self) + { + return self.Val0; + } + + /// + /// + /// + /// + /// + public static implicit operator Scalar(double val) + { + return new Scalar(val); + } + + /// + /// + /// + /// + /// + public static explicit operator Scalar(DMatch d) + { + return new Scalar(d.QueryIdx, d.TrainIdx, d.ImgIdx, d.Distance); + } + + /// + /// + /// + /// + /// + public static explicit operator DMatch(Scalar self) + { + return new DMatch((int) self.Val0, (int) self.Val1, (int) self.Val2, (float) self.Val3); + } + + /// + /// + /// + /// + /// + public static explicit operator Scalar(Vec3b v) + { + return new Scalar(v.Item0, v.Item1, v.Item2); + } + + /// + /// + /// + /// + /// + public static explicit operator Scalar(Vec3f v) + { + return new Scalar(v.Item0, v.Item1, v.Item2); + } + + /// + /// + /// + /// + /// + public static explicit operator Scalar(Vec4f v) + { + return new Scalar(v.Item0, v.Item1, v.Item2, v.Item3); + } + + /// + /// + /// + /// + /// + public static explicit operator Scalar(Vec6f v) + { + return new Scalar(v.Item0, v.Item1, v.Item2, v.Item3); + } + + /// + /// + /// + /// + /// + public static explicit operator Scalar(Vec3d v) + { + return new Scalar(v.Item0, v.Item1, v.Item2); + } + + /// + /// + /// + /// + /// + public static explicit operator Scalar(Vec4d v) + { + return new Scalar(v.Item0, v.Item1, v.Item2, v.Item3); + } + + /// + /// + /// + /// + /// + public static explicit operator Scalar(Vec6d v) + { + return new Scalar(v.Item0, v.Item1, v.Item2, v.Item3); + } + + /// + /// + /// + /// + /// + public static explicit operator Scalar(Point p) + { + return new Scalar(p.X, p.Y); + } + + /// + /// + /// + /// + /// + public static explicit operator Scalar(Point2f p) + { + return new Scalar(p.X, p.Y); + } + + /// + /// + /// + /// + /// + public static explicit operator Scalar(Point2d p) + { + return new Scalar(p.X, p.Y); + } + + /// + /// + /// + /// + /// + public static explicit operator Scalar(Point3i p) + { + return new Scalar(p.X, p.Y, p.Z); + } + + /// + /// + /// + /// + /// + public static explicit operator Scalar(Point3f p) + { + return new Scalar(p.X, p.Y, p.Z); + } + + /// + /// + /// + /// + /// + public static explicit operator Scalar(Point3d p) + { + return new Scalar(p.X, p.Y, p.Z); + } + + /// + /// + /// + /// + /// + public static explicit operator Scalar(Rect p) + { + return new Scalar(p.X, p.Y, p.Width, p.Height); + } + + #endregion + + #region Override + +#if LANG_JP + /// + /// Equalsのオーバーライド + /// + /// 比較するオブジェクト + /// +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public override bool Equals(object obj) + { + return base.Equals(obj); + } + +#if LANG_JP + /// + /// GetHashCodeのオーバーライド + /// + /// このオブジェクトのハッシュ値を指定する整数値。 +#else + /// + /// Returns a hash code for this object. + /// + /// An integer value that specifies a hash value for this object. +#endif + public override int GetHashCode() + { + int result = Val0.GetHashCode() ^ Val1.GetHashCode() ^ Val2.GetHashCode() ^ Val3.GetHashCode(); + return result; + } + +#if LANG_JP + /// + /// 文字列形式を返す + /// + /// 文字列形式 +#else + /// + /// Converts this object to a human readable string. + /// + /// A string that represents this object. +#endif + public override string ToString() + { + return String.Format("[{0}, {1}, {2}, {3}]", Val0, Val1, Val2, Val3); + } + + #endregion + + #region Operators + + /// + /// + /// + /// + /// + /// + public static bool operator ==(Scalar s1, Scalar s2) + { + return s1.Equals(s2); + } + + /// + /// + /// + /// + /// + /// + public static bool operator !=(Scalar s1, Scalar s2) + { + return !s1.Equals(s2); + } + + #endregion + + #region Methods + + /// + /// + /// + /// + /// + public static Scalar All(double v) + { + return new Scalar(v, v, v, v); + } + + /// + /// + /// + /// + /// + /// + public Scalar Mul(Scalar it, double scale) + { + return new Scalar(Val0*it.Val0*scale, Val1*it.Val1*scale, + Val2*it.Val2*scale, Val3*it.Val3*scale); + } + + /// + /// + /// + /// + /// + public Scalar Mul(Scalar it) + { + return Mul(it, 1); + } + + /// + /// + /// + /// + public Scalar Conj() + { + return new Scalar(Val0, -Val1, -Val2, -Val3); + } + + /// + /// + /// + /// + public bool IsReal() + { + return Val1 == 0 && Val2 == 0 && Val3 == 0; + } + + /// + /// + /// + /// + public Vec3b ToVec3b() + { + return new Vec3b((byte)Val0, (byte)Val1, (byte)Val2); + } + + /// + /// + /// + /// + /// + public bool Equals(Scalar other) + { + return Val0 == other.Val0 && + Val1 == other.Val1 && + Val2 == other.Val2 && + Val3 == other.Val3; + } + + #endregion + + #region Existing Color Constants + + /// + /// #F0F8FF + /// + public static readonly Scalar AliceBlue = FromRgb(240, 248, 255); + + /// + /// #FAEBD7 + /// + public static readonly Scalar AntiqueWhite = FromRgb(250, 235, 215); + + /// + /// #00FFFF + /// + public static readonly Scalar Aqua = FromRgb(0, 255, 255); + + /// + /// #7FFFD4 + /// + public static readonly Scalar Aquamarine = FromRgb(127, 255, 212); + + /// + /// #F0FFFF + /// + public static readonly Scalar Azure = FromRgb(240, 255, 255); + + /// + /// #F5F5DC + /// + public static readonly Scalar Beige = FromRgb(245, 245, 220); + + /// + /// #FFE4C4 + /// + public static readonly Scalar Bisque = FromRgb(255, 228, 196); + + /// + /// #000000 + /// + public static readonly Scalar Black = FromRgb(0, 0, 0); + + /// + /// #FFEBCD + /// + public static readonly Scalar BlanchedAlmond = FromRgb(255, 235, 205); + + /// + /// #0000FF + /// + public static readonly Scalar Blue = FromRgb(0, 0, 255); + + /// + /// #8A2BE2 + /// + public static readonly Scalar BlueViolet = FromRgb(138, 43, 226); + + /// + /// #A52A2A + /// + public static readonly Scalar Brown = FromRgb(165, 42, 42); + + /// + /// #DEB887 + /// + public static readonly Scalar BurlyWood = FromRgb(222, 184, 135); + + /// + /// #5F9EA0 + /// + public static readonly Scalar CadetBlue = FromRgb(95, 158, 160); + + /// + /// #7FFF00 + /// + public static readonly Scalar Chartreuse = FromRgb(127, 255, 0); + + /// + /// #D2691E + /// + public static readonly Scalar Chocolate = FromRgb(210, 105, 30); + + /// + /// #FF7F50 + /// + public static readonly Scalar Coral = FromRgb(255, 127, 80); + + /// + /// #6495ED + /// + public static readonly Scalar CornflowerBlue = FromRgb(100, 149, 237); + + /// + /// #FFF8DC + /// + public static readonly Scalar Cornsilk = FromRgb(255, 248, 220); + + /// + /// #DC143C + /// + public static readonly Scalar Crimson = FromRgb(220, 20, 60); + + /// + /// #00FFFF + /// + public static readonly Scalar Cyan = FromRgb(0, 255, 255); + + /// + /// #00008B + /// + public static readonly Scalar DarkBlue = FromRgb(0, 0, 139); + + /// + /// #008B8B + /// + public static readonly Scalar DarkCyan = FromRgb(0, 139, 139); + + /// + /// #B8860B + /// + public static readonly Scalar DarkGoldenrod = FromRgb(184, 134, 11); + + /// + /// #A9A9A9 + /// + public static readonly Scalar DarkGray = FromRgb(169, 169, 169); + + /// + /// #006400 + /// + public static readonly Scalar DarkGreen = FromRgb(0, 100, 0); + + /// + /// #BDB76B + /// + public static readonly Scalar DarkKhaki = FromRgb(189, 183, 107); + + /// + /// #8B008B + /// + public static readonly Scalar DarkMagenta = FromRgb(139, 0, 139); + + /// + /// #556B2F + /// + public static readonly Scalar DarkOliveGreen = FromRgb(85, 107, 47); + + /// + /// #FF8C00 + /// + public static readonly Scalar DarkOrange = FromRgb(255, 140, 0); + + /// + /// #9932CC + /// + public static readonly Scalar DarkOrchid = FromRgb(153, 50, 204); + + /// + /// #8B0000 + /// + public static readonly Scalar DarkRed = FromRgb(139, 0, 0); + + /// + /// #E9967A + /// + public static readonly Scalar DarkSalmon = FromRgb(233, 150, 122); + + /// + /// #8FBC8F + /// + public static readonly Scalar DarkSeaGreen = FromRgb(143, 188, 139); + + /// + /// #483D8B + /// + public static readonly Scalar DarkSlateBlue = FromRgb(72, 61, 139); + + /// + /// #2F4F4F + /// + public static readonly Scalar DarkSlateGray = FromRgb(47, 79, 79); + + /// + /// #00CED1 + /// + public static readonly Scalar DarkTurquoise = FromRgb(0, 206, 209); + + /// + /// #9400D3 + /// + public static readonly Scalar DarkViolet = FromRgb(148, 0, 211); + + /// + /// #FF1493 + /// + public static readonly Scalar DeepPink = FromRgb(255, 20, 147); + + /// + /// #00BFFF + /// + public static readonly Scalar DeepSkyBlue = FromRgb(0, 191, 255); + + /// + /// #696969 + /// + public static readonly Scalar DimGray = FromRgb(105, 105, 105); + + /// + /// #1E90FF + /// + public static readonly Scalar DodgerBlue = FromRgb(30, 144, 255); + + /// + /// #B22222 + /// + public static readonly Scalar Firebrick = FromRgb(178, 34, 34); + + /// + /// #FFFAF0 + /// + public static readonly Scalar FloralWhite = FromRgb(255, 250, 240); + + /// + /// #228B22 + /// + public static readonly Scalar ForestGreen = FromRgb(34, 139, 34); + + /// + /// #FF00FF + /// + public static readonly Scalar Fuchsia = FromRgb(255, 0, 255); + + /// + /// #DCDCDC + /// + public static readonly Scalar Gainsboro = FromRgb(220, 220, 220); + + /// + /// #F8F8FF + /// + public static readonly Scalar GhostWhite = FromRgb(248, 248, 255); + + /// + /// #FFD700 + /// + public static readonly Scalar Gold = FromRgb(255, 215, 0); + + /// + /// #DAA520 + /// + public static readonly Scalar Goldenrod = FromRgb(218, 165, 32); + + /// + /// #808080 + /// + public static readonly Scalar Gray = FromRgb(128, 128, 128); + + /// + /// #008000 + /// + public static readonly Scalar Green = FromRgb(0, 128, 0); + + /// + /// #ADFF2F + /// + public static readonly Scalar GreenYellow = FromRgb(173, 255, 47); + + /// + /// #F0FFF0 + /// + public static readonly Scalar Honeydew = FromRgb(240, 255, 240); + + /// + /// #FF69B4 + /// + public static readonly Scalar HotPink = FromRgb(255, 105, 180); + + /// + /// #CD5C5C + /// + public static readonly Scalar IndianRed = FromRgb(205, 92, 92); + + /// + /// #4B0082 + /// + public static readonly Scalar Indigo = FromRgb(75, 0, 130); + + /// + /// #FFFFF0 + /// + public static readonly Scalar Ivory = FromRgb(255, 255, 240); + + /// + /// #F0E68C + /// + public static readonly Scalar Khaki = FromRgb(240, 230, 140); + + /// + /// #E6E6FA + /// + public static readonly Scalar Lavender = FromRgb(230, 230, 250); + + /// + /// #FFF0F5 + /// + public static readonly Scalar LavenderBlush = FromRgb(255, 240, 245); + + /// + /// #7CFC00 + /// + public static readonly Scalar LawnGreen = FromRgb(124, 252, 0); + + /// + /// #FFFACD + /// + public static readonly Scalar LemonChiffon = FromRgb(255, 250, 205); + + /// + /// #ADD8E6 + /// + public static readonly Scalar LightBlue = FromRgb(173, 216, 230); + + /// + /// #F08080 + /// + public static readonly Scalar LightCoral = FromRgb(240, 128, 128); + + /// + /// #E0FFFF + /// + public static readonly Scalar LightCyan = FromRgb(224, 255, 255); + + /// + /// #FAFAD2 + /// + public static readonly Scalar LightGoldenrodYellow = FromRgb(250, 250, 210); + + /// + /// #D3D3D3 + /// + public static readonly Scalar LightGray = FromRgb(211, 211, 211); + + /// + /// #90EE90 + /// + public static readonly Scalar LightGreen = FromRgb(144, 238, 144); + + /// + /// #FFB6C1 + /// + public static readonly Scalar LightPink = FromRgb(255, 182, 193); + + /// + /// #FFA07A + /// + public static readonly Scalar LightSalmon = FromRgb(255, 160, 122); + + /// + /// #20B2AA + /// + public static readonly Scalar LightSeaGreen = FromRgb(32, 178, 170); + + /// + /// #87CEFA + /// + public static readonly Scalar LightSkyBlue = FromRgb(135, 206, 250); + + /// + /// #778899 + /// + public static readonly Scalar LightSlateGray = FromRgb(119, 136, 153); + + /// + /// #B0C4DE + /// + public static readonly Scalar LightSteelBlue = FromRgb(176, 196, 222); + + /// + /// #FFFFE0 + /// + public static readonly Scalar LightYellow = FromRgb(255, 255, 224); + + /// + /// #00FF00 + /// + public static readonly Scalar Lime = FromRgb(0, 255, 0); + + /// + /// #32CD32 + /// + public static readonly Scalar LimeGreen = FromRgb(50, 205, 50); + + /// + /// #FAF0E6 + /// + public static readonly Scalar Linen = FromRgb(250, 240, 230); + + /// + /// #FF00FF + /// + public static readonly Scalar Magenta = FromRgb(255, 0, 255); + + /// + /// #800000 + /// + public static readonly Scalar Maroon = FromRgb(128, 0, 0); + + /// + /// #66CDAA + /// + public static readonly Scalar MediumAquamarine = FromRgb(102, 205, 170); + + /// + /// #0000CD + /// + public static readonly Scalar MediumBlue = FromRgb(0, 0, 205); + + /// + /// #BA55D3 + /// + public static readonly Scalar MediumOrchid = FromRgb(186, 85, 211); + + /// + /// #9370DB + /// + public static readonly Scalar MediumPurple = FromRgb(147, 112, 219); + + /// + /// #3CB371 + /// + public static readonly Scalar MediumSeaGreen = FromRgb(60, 179, 113); + + /// + /// #7B68EE + /// + public static readonly Scalar MediumSlateBlue = FromRgb(123, 104, 238); + + /// + /// #00FA9A + /// + public static readonly Scalar MediumSpringGreen = FromRgb(0, 250, 154); + + /// + /// #48D1CC + /// + public static readonly Scalar MediumTurquoise = FromRgb(72, 209, 204); + + /// + /// #C71585 + /// + public static readonly Scalar MediumVioletRed = FromRgb(199, 21, 133); + + /// + /// #191970 + /// + public static readonly Scalar MidnightBlue = FromRgb(25, 25, 112); + + /// + /// #F5FFFA + /// + public static readonly Scalar MintCream = FromRgb(245, 255, 250); + + /// + /// #FFE4E1 + /// + public static readonly Scalar MistyRose = FromRgb(255, 228, 225); + + /// + /// #FFE4B5 + /// + public static readonly Scalar Moccasin = FromRgb(255, 228, 181); + + /// + /// #FFDEAD + /// + public static readonly Scalar NavajoWhite = FromRgb(255, 222, 173); + + /// + /// #000080 + /// + public static readonly Scalar Navy = FromRgb(0, 0, 128); + + /// + /// #FDF5E6 + /// + public static readonly Scalar OldLace = FromRgb(253, 245, 230); + + /// + /// #808000 + /// + public static readonly Scalar Olive = FromRgb(128, 128, 0); + + /// + /// #6B8E23 + /// + public static readonly Scalar OliveDrab = FromRgb(107, 142, 35); + + /// + /// #FFA500 + /// + public static readonly Scalar Orange = FromRgb(255, 165, 0); + + /// + /// #FF4500 + /// + public static readonly Scalar OrangeRed = FromRgb(255, 69, 0); + + /// + /// #DA70D6 + /// + public static readonly Scalar Orchid = FromRgb(218, 112, 214); + + /// + /// #EEE8AA + /// + public static readonly Scalar PaleGoldenrod = FromRgb(238, 232, 170); + + /// + /// #98FB98 + /// + public static readonly Scalar PaleGreen = FromRgb(152, 251, 152); + + /// + /// #AFEEEE + /// + public static readonly Scalar PaleTurquoise = FromRgb(175, 238, 238); + + /// + /// #DB7093 + /// + public static readonly Scalar PaleVioletRed = FromRgb(219, 112, 147); + + /// + /// #FFEFD5 + /// + public static readonly Scalar PapayaWhip = FromRgb(255, 239, 213); + + /// + /// #FFDAB9 + /// + public static readonly Scalar PeachPuff = FromRgb(255, 218, 185); + + /// + /// #CD853F + /// + public static readonly Scalar Peru = FromRgb(205, 133, 63); + + /// + /// #FFC0CB + /// + public static readonly Scalar Pink = FromRgb(255, 192, 203); + + /// + /// #DDA0DD + /// + public static readonly Scalar Plum = FromRgb(221, 160, 221); + + /// + /// #B0E0E6 + /// + public static readonly Scalar PowderBlue = FromRgb(176, 224, 230); + + /// + /// #800080 + /// + public static readonly Scalar Purple = FromRgb(128, 0, 128); + + /// + /// #FF0000 + /// + public static readonly Scalar Red = FromRgb(255, 0, 0); + + /// + /// #BC8F8F + /// + public static readonly Scalar RosyBrown = FromRgb(188, 143, 143); + + /// + /// #4169E1 + /// + public static readonly Scalar RoyalBlue = FromRgb(65, 105, 225); + + /// + /// #8B4513 + /// + public static readonly Scalar SaddleBrown = FromRgb(139, 69, 19); + + /// + /// #FA8072 + /// + public static readonly Scalar Salmon = FromRgb(250, 128, 114); + + /// + /// #F4A460 + /// + public static readonly Scalar SandyBrown = FromRgb(244, 164, 96); + + /// + /// #2E8B57 + /// + public static readonly Scalar SeaGreen = FromRgb(46, 139, 87); + + /// + /// #FFF5EE + /// + public static readonly Scalar SeaShell = FromRgb(255, 245, 238); + + /// + /// #A0522D + /// + public static readonly Scalar Sienna = FromRgb(160, 82, 45); + + /// + /// #C0C0C0 + /// + public static readonly Scalar Silver = FromRgb(192, 192, 192); + + /// + /// #87CEEB + /// + public static readonly Scalar SkyBlue = FromRgb(135, 206, 235); + + /// + /// #6A5ACD + /// + public static readonly Scalar SlateBlue = FromRgb(106, 90, 205); + + /// + /// #708090 + /// + public static readonly Scalar SlateGray = FromRgb(112, 128, 144); + + /// + /// #FFFAFA + /// + public static readonly Scalar Snow = FromRgb(255, 250, 250); + + /// + /// #00FF7F + /// + public static readonly Scalar SpringGreen = FromRgb(0, 255, 127); + + /// + /// #4682B4 + /// + public static readonly Scalar SteelBlue = FromRgb(70, 130, 180); + + /// + /// #D2B48C + /// + public static readonly Scalar Tan = FromRgb(210, 180, 140); + + /// + /// #008080 + /// + public static readonly Scalar Teal = FromRgb(0, 128, 128); + + /// + /// #D8BFD8 + /// + public static readonly Scalar Thistle = FromRgb(216, 191, 216); + + /// + /// #FF6347 + /// + public static readonly Scalar Tomato = FromRgb(255, 99, 71); + + /// + /// #40E0D0 + /// + public static readonly Scalar Turquoise = FromRgb(64, 224, 208); + + /// + /// #EE82EE + /// + public static readonly Scalar Violet = FromRgb(238, 130, 238); + + /// + /// #F5DEB3 + /// + public static readonly Scalar Wheat = FromRgb(245, 222, 179); + + /// + /// #FFFFFF + /// + public static readonly Scalar White = FromRgb(255, 255, 255); + + /// + /// #F5F5F5 + /// + public static readonly Scalar WhiteSmoke = FromRgb(245, 245, 245); + + /// + /// #FFFF00 + /// + public static readonly Scalar Yellow = FromRgb(255, 255, 0); + + /// + /// #9ACD32 + /// + public static readonly Scalar YellowGreen = FromRgb(154, 205, 50); + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/core/Struct/Size.cs b/src/OpenCvSharp/modules/core/Struct/Size.cs new file mode 100644 index 000000000..3417d0c72 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/Size.cs @@ -0,0 +1,161 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Size : IEquatable + { + /// + /// + /// + public int Width; + /// + /// + /// + public int Height; + + /// + /// + /// + /// + /// + public Size(int width, int height) + { + Width = width; + Height = height; + } + /// + /// + /// + /// + /// + public Size(double width, double height) + { + Width = (int)width; + Height = (int)height; + } + + /// + /// + /// + public static Size Zero + { + get { return new Size();} + } + + #region Operators +#if LANG_JP + /// + /// 指定したオブジェクトと等しければtrueを返す + /// + /// 比較するオブジェクト + /// 型が同じで、メンバの値が等しければtrue +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public bool Equals(Size obj) + { + return (this.Width == obj.Width && this.Height == obj.Height); + } +#if LANG_JP + /// + /// == 演算子のオーバーロード + /// + /// 左辺値 + /// 右辺値 + /// 等しければtrue +#else + /// + /// Compares two CvPoint objects. The result specifies whether the members of each object are equal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the members of left and right are equal; otherwise, false. +#endif + public static bool operator ==(Size lhs, Size rhs) + { + return lhs.Equals(rhs); + } +#if LANG_JP + /// + /// != 演算子のオーバーロード + /// + /// 左辺値 + /// 右辺値 + /// 等しくなければtrue +#else + /// + /// Compares two CvPoint objects. The result specifies whether the members of each object are unequal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the members of left and right are unequal; otherwise, false. +#endif + public static bool operator !=(Size lhs, Size rhs) + { + return !lhs.Equals(rhs); + } + #endregion + + #region Override +#if LANG_JP + /// + /// Equalsのオーバーライド + /// + /// 比較するオブジェクト + /// +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public override bool Equals(object obj) + { + return base.Equals(obj); + } +#if LANG_JP + /// + /// GetHashCodeのオーバーライド + /// + /// このオブジェクトのハッシュ値を指定する整数値。 +#else + /// + /// Returns a hash code for this object. + /// + /// An integer value that specifies a hash value for this object. +#endif + public override int GetHashCode() + { + return Width.GetHashCode() ^ Height.GetHashCode(); + } +#if LANG_JP + /// + /// 文字列形式を返す + /// + /// 文字列形式 +#else + /// + /// Converts this object to a human readable string. + /// + /// A string that represents this object. +#endif + public override string ToString() + { + return string.Format("(width:{0} height:{1})", Width, Height); + } + #endregion + } +} diff --git a/src/OpenCvSharp/modules/core/Struct/Size2f.cs b/src/OpenCvSharp/modules/core/Struct/Size2f.cs new file mode 100644 index 000000000..3601c2b9d --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/Size2f.cs @@ -0,0 +1,161 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ + /// + /// + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Size2f : IEquatable + { + /// + /// + /// + public float Width; + + /// + /// + /// + public float Height; + + /// + /// + /// + /// + /// + public Size2f(float width, float height) + { + Width = width; + Height = height; + } + + /// + /// + /// + /// + /// + public Size2f(double width, double height) + { + Width = (int) width; + Height = (int) height; + } + + #region Operators + +#if LANG_JP + /// + /// 指定したオブジェクトと等しければtrueを返す + /// + /// 比較するオブジェクト + /// 型が同じで、メンバの値が等しければtrue +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public bool Equals(Size2f obj) + { + return (Width == obj.Width && Height == obj.Height); + } + +#if LANG_JP + /// + /// == 演算子のオーバーロード + /// + /// 左辺値 + /// 右辺値 + /// 等しければtrue +#else + /// + /// Compares two CvPoint objects. The result specifies whether the members of each object are equal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the members of left and right are equal; otherwise, false. +#endif + public static bool operator ==(Size2f lhs, Size2f rhs) + { + return lhs.Equals(rhs); + } + +#if LANG_JP + /// + /// != 演算子のオーバーロード + /// + /// 左辺値 + /// 右辺値 + /// 等しくなければtrue +#else + /// + /// Compares two CvPoint objects. The result specifies whether the members of each object are unequal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the members of left and right are unequal; otherwise, false. +#endif + public static bool operator !=(Size2f lhs, Size2f rhs) + { + return !lhs.Equals(rhs); + } + + #endregion + + #region Override + +#if LANG_JP + /// + /// Equalsのオーバーライド + /// + /// 比較するオブジェクト + /// +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public override bool Equals(object obj) + { + return base.Equals(obj); + } + +#if LANG_JP + /// + /// GetHashCodeのオーバーライド + /// + /// このオブジェクトのハッシュ値を指定する整数値。 +#else + /// + /// Returns a hash code for this object. + /// + /// An integer value that specifies a hash value for this object. +#endif + public override int GetHashCode() + { + return Width.GetHashCode() ^ Height.GetHashCode(); + } + +#if LANG_JP + /// + /// 文字列形式を返す + /// + /// 文字列形式 +#else + /// + /// Converts this object to a human readable string. + /// + /// A string that represents this object. +#endif + public override string ToString() + { + return string.Format("(width:{0} height:{1})", Width, Height); + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/core/Struct/TermCriteria.cs b/src/OpenCvSharp/modules/core/Struct/TermCriteria.cs new file mode 100644 index 000000000..282138896 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/TermCriteria.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// The class defining termination criteria for iterative algorithms. + /// + public struct TermCriteria + { + /// + /// the type of termination criteria: COUNT, EPS or COUNT + EPS + /// + public CriteriaType Type; + + /// + /// the maximum number of iterations/elements + /// + public int MaxCount; + + /// + /// the desired accuracy + /// + public double Epsilon; + + /// + /// full constructor + /// + /// + /// + /// + public TermCriteria(CriteriaType type, int maxCount, double epsilon) + : this() + { + Type = type; + MaxCount = maxCount; + Epsilon = epsilon; + } + + /// + /// full constructor with both type (count | epsilon) + /// + /// + /// + public static TermCriteria Both(int maxCount, double epsilon) + { + return new TermCriteria + { + Type = CriteriaType.Count | CriteriaType.Eps, + MaxCount = maxCount, + Epsilon = epsilon, + }; + } + } +} diff --git a/src/OpenCvSharp/modules/core/Struct/Vecb.cs b/src/OpenCvSharp/modules/core/Struct/Vecb.cs new file mode 100644 index 000000000..7dbd75bb8 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/Vecb.cs @@ -0,0 +1,297 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ + /// + /// 2-Tuple of byte (System.Byte) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec2b : IVec + { + /// + /// The value of the first component of this object. + /// + public byte Item0; + /// + /// The value of the second component of this object. + /// + public byte Item1; + + /// + /// Initializer + /// + /// + /// + public Vec2b(byte item0, byte item1) + { + Item0 = item0; + Item1 = item1; + } + + /// + /// Indexer + /// + /// + /// + public byte this[int i] + { + get + { + switch (i) + { + case 0: return Item0; + case 1: return Item1; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: Item0 = value; break; + case 1: Item1 = value; break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } + + /// + /// 3-Tuple of byte (System.Byte) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec3b : IVec + { + /// + /// The value of the first component of this object. + /// + public byte Item0; + /// + /// The value of the second component of this object. + /// + public byte Item1; + /// + /// The value of the third component of this object. + /// + public byte Item2; + + /// + /// Initializer + /// + /// + /// + /// + public Vec3b(byte item0, byte item1, byte item2) + { + Item0 = item0; + Item1 = item1; + Item2 = item2; + } + + /// + /// Indexer + /// + /// + /// + public byte this[int i] + { + get + { + switch (i) + { + case 0: return Item0; + case 1: return Item1; + case 2: return Item2; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: Item0 = value; break; + case 1: Item1 = value; break; + case 2: Item2 = value; break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } + + /// + /// 4-Tuple of byte (System.Byte) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec4b : IVec + { + /// + /// The value of the first component of this object. + /// + public byte Item0; + + /// + /// The value of the second component of this object. + /// + public byte Item1; + + /// + /// The value of the third component of this object. + /// + public byte Item2; + + /// + /// The value of the fourth component of this object. + /// + public byte Item3; + + /// + /// Initializer + /// + /// + /// + /// + /// + public Vec4b(byte item0, byte item1, byte item2, byte item3) + { + Item0 = item0; + Item1 = item1; + Item2 = item2; + Item3 = item3; + } + + /// + /// Indexer + /// + /// + /// + public byte this[int i] + { + get + { + switch (i) + { + case 0: return Item0; + case 1: return Item1; + case 2: return Item2; + case 3: return Item3; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: Item0 = value; break; + case 1: Item1 = value; break; + case 2: Item2 = value; break; + case 3: Item3 = value; break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } + + /// + /// 6-Tuple of byte (System.Byte) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec6b : IVec + { + /// + /// The value of the first component of this object. + /// + public byte Item0; + + /// + /// The value of the second component of this object. + /// + public byte Item1; + + /// + /// The value of the third component of this object. + /// + public byte Item2; + + /// + /// The value of the fourth component of this object. + /// + public byte Item3; + + /// + /// The value of the fifth component of this object. + /// + public byte Item4; + + /// + /// The value of the sizth component of this object. + /// + public byte Item5; + + /// + /// Initializer + /// + /// + /// + /// + /// + /// + /// + public Vec6b(byte item0, byte item1, byte item2, byte item3, byte item4, byte item5) + { + Item0 = item0; + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + } + + /// + /// Indexer + /// + /// + /// + public byte this[int i] + { + get + { + switch (i) + { + case 0: return Item0; + case 1: return Item1; + case 2: return Item2; + case 3: return Item3; + case 4: return Item4; + case 5: return Item5; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: Item0 = value; break; + case 1: Item1 = value; break; + case 2: Item2 = value; break; + case 3: Item3 = value; break; + case 4: Item4 = value; break; + case 5: Item5 = value; break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } +} diff --git a/src/OpenCvSharp/modules/core/Struct/Vecd.cs b/src/OpenCvSharp/modules/core/Struct/Vecd.cs new file mode 100644 index 000000000..ba0942748 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/Vecd.cs @@ -0,0 +1,297 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ + /// + /// 2-Tuple of double (System.Double) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec2d : IVec + { + /// + /// The value of the first component of this object. + /// + public double Item0; + /// + /// The value of the second component of this object. + /// + public double Item1; + + /// + /// Initializer + /// + /// + /// + public Vec2d(double item0, double item1) + { + Item0 = item0; + Item1 = item1; + } + + /// + /// Indexer + /// + /// + /// + public double this[int i] + { + get + { + switch (i) + { + case 0: return Item0; + case 1: return Item1; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: Item0 = value; break; + case 1: Item1 = value; break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } + + /// + /// 3-Tuple of double (System.Double) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec3d : IVec + { + /// + /// The value of the first component of this object. + /// + public double Item0; + /// + /// The value of the second component of this object. + /// + public double Item1; + /// + /// The value of the third component of this object. + /// + public double Item2; + + /// + /// Initializer + /// + /// + /// + /// + public Vec3d(double item0, double item1, double item2) + { + Item0 = item0; + Item1 = item1; + Item2 = item2; + } + + /// + /// Indexer + /// + /// + /// + public double this[int i] + { + get + { + switch (i) + { + case 0: return Item0; + case 1: return Item1; + case 2: return Item2; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: Item0 = value; break; + case 1: Item1 = value; break; + case 2: Item2 = value; break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } + + /// + /// 4-Tuple of double (System.Double) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec4d : IVec + { + /// + /// The value of the first component of this object. + /// + public double Item0; + + /// + /// The value of the second component of this object. + /// + public double Item1; + + /// + /// The value of the third component of this object. + /// + public double Item2; + + /// + /// The value of the fourth component of this object. + /// + public double Item3; + + /// + /// Initializer + /// + /// + /// + /// + /// + public Vec4d(double item0, double item1, double item2, double item3) + { + Item0 = item0; + Item1 = item1; + Item2 = item2; + Item3 = item3; + } + + /// + /// Indexer + /// + /// + /// + public double this[int i] + { + get + { + switch (i) + { + case 0: return Item0; + case 1: return Item1; + case 2: return Item2; + case 3: return Item3; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: Item0 = value; break; + case 1: Item1 = value; break; + case 2: Item2 = value; break; + case 3: Item3 = value; break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } + + /// + /// 6-Tuple of double (System.Double) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec6d : IVec + { + /// + /// The value of the first component of this object. + /// + public double Item0; + + /// + /// The value of the second component of this object. + /// + public double Item1; + + /// + /// The value of the third component of this object. + /// + public double Item2; + + /// + /// The value of the fourth component of this object. + /// + public double Item3; + + /// + /// The value of the fifth component of this object. + /// + public double Item4; + + /// + /// The value of the sixth component of this object. + /// + public double Item5; + + /// + /// Initializer + /// + /// + /// + /// + /// + /// + /// + public Vec6d(double item0, double item1, double item2, double item3, double item4, double item5) + { + Item0 = item0; + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + } + + /// + /// Indexer + /// + /// + /// + public double this[int i] + { + get + { + switch (i) + { + case 0: return Item0; + case 1: return Item1; + case 2: return Item2; + case 3: return Item3; + case 4: return Item4; + case 5: return Item5; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: Item0 = value; break; + case 1: Item1 = value; break; + case 2: Item2 = value; break; + case 3: Item3 = value; break; + case 4: Item4 = value; break; + case 5: Item5 = value; break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } +} diff --git a/src/OpenCvSharp/modules/core/Struct/Vecf.cs b/src/OpenCvSharp/modules/core/Struct/Vecf.cs new file mode 100644 index 000000000..c2b51e94a --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/Vecf.cs @@ -0,0 +1,297 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ + /// + /// 2-Tuple of float (System.Single) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec2f : IVec + { + /// + /// The value of the first component of this object. + /// + public float Item0; + /// + /// The value of the second component of this object. + /// + public float Item1; + + /// + /// Initializer + /// + /// + /// + public Vec2f(float item0, float item1) + { + Item0 = item0; + Item1 = item1; + } + + /// + /// Indexer + /// + /// + /// + public float this[int i] + { + get + { + switch (i) + { + case 0: return Item0; + case 1: return Item1; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: Item0 = value; break; + case 1: Item1 = value; break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } + + /// + /// 3-Tuple of float (System.Single) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec3f : IVec + { + /// + /// The value of the first component of this object. + /// + public float Item0; + /// + /// The value of the second component of this object. + /// + public float Item1; + /// + /// The value of the third component of this object. + /// + public float Item2; + + /// + /// Initializer + /// + /// + /// + /// + public Vec3f(float item0, float item1, float item2) + { + Item0 = item0; + Item1 = item1; + Item2 = item2; + } + + /// + /// Indexer + /// + /// + /// + public float this[int i] + { + get + { + switch (i) + { + case 0: return Item0; + case 1: return Item1; + case 2: return Item2; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: Item0 = value; break; + case 1: Item1 = value; break; + case 2: Item2 = value; break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } + + /// + /// 4-Tuple of float (System.Single) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec4f : IVec + { + /// + /// The value of the first component of this object. + /// + public float Item0; + + /// + /// The value of the second component of this object. + /// + public float Item1; + + /// + /// The value of the third component of this object. + /// + public float Item2; + + /// + /// The value of the fourth component of this object. + /// + public float Item3; + + /// + /// Initializer + /// + /// + /// + /// + /// + public Vec4f(float item0, float item1, float item2, float item3) + { + Item0 = item0; + Item1 = item1; + Item2 = item2; + Item3 = item3; + } + + /// + /// Indexer + /// + /// + /// + public float this[int i] + { + get + { + switch (i) + { + case 0: return Item0; + case 1: return Item1; + case 2: return Item2; + case 3: return Item3; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: Item0 = value; break; + case 1: Item1 = value; break; + case 2: Item2 = value; break; + case 3: Item3 = value; break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } + + /// + /// 6-Tuple of float (System.Single) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec6f : IVec + { + /// + /// The value of the first component of this object. + /// + public float Item0; + + /// + /// The value of the second component of this object. + /// + public float Item1; + + /// + /// The value of the third component of this object. + /// + public float Item2; + + /// + /// The value of the fourth component of this object. + /// + public float Item3; + + /// + /// The value of the fifth component of this object. + /// + public float Item4; + + /// + /// The value of the sixth component of this object. + /// + public float Item5; + + /// + /// Initializer + /// + /// + /// + /// + /// + /// + /// + public Vec6f(float item0, float item1, float item2, float item3, float item4, float item5) + { + Item0 = item0; + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + } + + /// + /// Indexer + /// + /// + /// + public float this[int i] + { + get + { + switch (i) + { + case 0: return Item0; + case 1: return Item1; + case 2: return Item2; + case 3: return Item3; + case 4: return Item4; + case 5: return Item5; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: Item0 = value; break; + case 1: Item1 = value; break; + case 2: Item2 = value; break; + case 3: Item3 = value; break; + case 4: Item4 = value; break; + case 5: Item5 = value; break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } +} diff --git a/src/OpenCvSharp/modules/core/Struct/Veci.cs b/src/OpenCvSharp/modules/core/Struct/Veci.cs new file mode 100644 index 000000000..a69d843f8 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/Veci.cs @@ -0,0 +1,297 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ + /// + /// 2-Tuple of int (System.Int32) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec2i : IVec + { + /// + /// The value of the first component of this object. + /// + public int Item0; + /// + /// The value of the second component of this object. + /// + public int Item1; + + /// + /// Initializer + /// + /// + /// + public Vec2i(int item0, int item1) + { + Item0 = item0; + Item1 = item1; + } + + /// + /// Indexer + /// + /// + /// + public int this[int i] + { + get + { + switch (i) + { + case 0: return Item0; + case 1: return Item1; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: Item0 = value; break; + case 1: Item1 = value; break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } + + /// + /// 3-Tuple of int (System.Int32) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec3i : IVec + { + /// + /// The value of the first component of this object. + /// + public int Item0; + /// + /// The value of the second component of this object. + /// + public int Item1; + /// + /// The value of the third component of this object. + /// + public int Item2; + + /// + /// Initializer + /// + /// + /// + /// + public Vec3i(int item0, int item1, int item2) + { + Item0 = item0; + Item1 = item1; + Item2 = item2; + } + + /// + /// Indexer + /// + /// + /// + public int this[int i] + { + get + { + switch (i) + { + case 0: return Item0; + case 1: return Item1; + case 2: return Item2; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: Item0 = value; break; + case 1: Item1 = value; break; + case 2: Item2 = value; break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } + + /// + /// 4-Tuple of int (System.Int32) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec4i : IVec + { + /// + /// The value of the first component of this object. + /// + public int Item0; + + /// + /// The value of the second component of this object. + /// + public int Item1; + + /// + /// The value of the third component of this object. + /// + public int Item2; + + /// + /// The value of the fourth component of this object. + /// + public int Item3; + + /// + /// Initializer + /// + /// + /// + /// + /// + public Vec4i(int item0, int item1, int item2, int item3) + { + Item0 = item0; + Item1 = item1; + Item2 = item2; + Item3 = item3; + } + + /// + /// Indexer + /// + /// + /// + public int this[int i] + { + get + { + switch (i) + { + case 0: return Item0; + case 1: return Item1; + case 2: return Item2; + case 3: return Item3; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: Item0 = value; break; + case 1: Item1 = value; break; + case 2: Item2 = value; break; + case 3: Item3 = value; break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } + + /// + /// 6-Tuple of int (System.Int32) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec6i : IVec + { + /// + /// The value of the first component of this object. + /// + public int Item0; + + /// + /// The value of the second component of this object. + /// + public int Item1; + + /// + /// The value of the third component of this object. + /// + public int Item2; + + /// + /// The value of the fourth component of this object. + /// + public int Item3; + + /// + /// The value of the fourth component of this object. + /// + public int Item4; + + /// + /// The value of the sixth component of this object. + /// + public int Item5; + + /// + /// Initializer + /// + /// + /// + /// + /// + /// + /// + public Vec6i(int item0, int item1, int item2, int item3, int item4, int item5) + { + Item0 = item0; + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + } + + /// + /// Indexer + /// + /// + /// + public int this[int i] + { + get + { + switch (i) + { + case 0: return Item0; + case 1: return Item1; + case 2: return Item2; + case 3: return Item3; + case 4: return Item4; + case 5: return Item5; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: Item0 = value; break; + case 1: Item1 = value; break; + case 2: Item2 = value; break; + case 3: Item3 = value; break; + case 4: Item4 = value; break; + case 5: Item5 = value; break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } +} diff --git a/src/OpenCvSharp/modules/core/Struct/Vecs.cs b/src/OpenCvSharp/modules/core/Struct/Vecs.cs new file mode 100644 index 000000000..a234ad82f --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/Vecs.cs @@ -0,0 +1,347 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// 2-Tuple of short (System.Int16) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec2s : IVec + { + /// + /// The value of the first component of this object. + /// + public short Item0; + + /// + /// The value of the second component of this object. + /// + public short Item1; + + /// + /// Initializer + /// + /// + /// + public Vec2s(short item0, short item1) + { + Item0 = item0; + Item1 = item1; + } + + /// + /// Indexer + /// + /// + /// + public short this[int i] + { + get + { + switch (i) + { + case 0: + return Item0; + case 1: + return Item1; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: + Item0 = value; + break; + case 1: + Item1 = value; + break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } + + /// + /// 3-Tuple of short (System.Int16) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec3s : IVec + { + /// + /// The value of the first component of this object. + /// + public short Item0; + + /// + /// The value of the second component of this object. + /// + public short Item1; + + /// + /// The value of the third component of this object. + /// + public short Item2; + + /// + /// Initializer + /// + /// + /// + /// + public Vec3s(short item0, short item1, short item2) + { + Item0 = item0; + Item1 = item1; + Item2 = item2; + } + + /// + /// Indexer + /// + /// + /// + public short this[int i] + { + get + { + switch (i) + { + case 0: + return Item0; + case 1: + return Item1; + case 2: + return Item2; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: + Item0 = value; + break; + case 1: + Item1 = value; + break; + case 2: + Item2 = value; + break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } + + /// + /// 4-Tuple of short (System.Int16) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec4s : IVec + { + /// + /// The value of the first component of this object. + /// + public short Item0; + + /// + /// The value of the second component of this object. + /// + public short Item1; + + /// + /// The value of the third component of this object. + /// + public short Item2; + + /// + /// The value of the fourth component of this object. + /// + public short Item3; + + /// + /// Initializer + /// + /// + /// + /// + /// + public Vec4s(short item0, short item1, short item2, short item3) + { + Item0 = item0; + Item1 = item1; + Item2 = item2; + Item3 = item3; + } + + /// + /// Indexer + /// + /// + /// + public short this[int i] + { + get + { + switch (i) + { + case 0: + return Item0; + case 1: + return Item1; + case 2: + return Item2; + case 3: + return Item3; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: + Item0 = value; + break; + case 1: + Item1 = value; + break; + case 2: + Item2 = value; + break; + case 3: + Item3 = value; + break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } + + /// + /// 6-Tuple of short (System.Int16) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec6s : IVec + { + /// + /// The value of the first component of this object. + /// + public short Item0; + + /// + /// The value of the second component of this object. + /// + public short Item1; + + /// + /// The value of the third component of this object. + /// + public short Item2; + + /// + /// The value of the fourth component of this object. + /// + public short Item3; + + /// + /// The value of the fifth component of this object. + /// + public short Item4; + + /// + /// The value of the sixth component of this object. + /// + public short Item5; + + /// + /// Initializer + /// + /// + /// + /// + /// + /// + /// + public Vec6s(short item0, short item1, short item2, short item3, short item4, short item5) + { + Item0 = item0; + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + } + + /// + /// Indexer + /// + /// + /// + public short this[int i] + { + get + { + switch (i) + { + case 0: + return Item0; + case 1: + return Item1; + case 2: + return Item2; + case 3: + return Item3; + case 4: + return Item4; + case 5: + return Item5; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: + Item0 = value; + break; + case 1: + Item1 = value; + break; + case 2: + Item2 = value; + break; + case 3: + Item3 = value; + break; + case 4: + Item4 = value; + break; + case 5: + Item5 = value; + break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/core/Struct/Vecw.cs b/src/OpenCvSharp/modules/core/Struct/Vecw.cs new file mode 100644 index 000000000..935852c64 --- /dev/null +++ b/src/OpenCvSharp/modules/core/Struct/Vecw.cs @@ -0,0 +1,347 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// 2-Tuple of ushort (System.UInt16) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec2w : IVec + { + /// + /// The value of the first component of this object. + /// + public ushort Item0; + + /// + /// The value of the second component of this object. + /// + public ushort Item1; + + /// + /// Initializer + /// + /// + /// + public Vec2w(ushort item0, ushort item1) + { + Item0 = item0; + Item1 = item1; + } + + /// + /// Indexer + /// + /// + /// + public ushort this[int i] + { + get + { + switch (i) + { + case 0: + return Item0; + case 1: + return Item1; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: + Item0 = value; + break; + case 1: + Item1 = value; + break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } + + /// + /// 3-Tuple of ushort (System.UInt16) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec3w : IVec + { + /// + /// The value of the first component of this object. + /// + public ushort Item0; + + /// + /// The value of the second component of this object. + /// + public ushort Item1; + + /// + /// The value of the third component of this object. + /// + public ushort Item2; + + /// + /// Initializer + /// + /// + /// + /// + public Vec3w(ushort item0, ushort item1, ushort item2) + { + Item0 = item0; + Item1 = item1; + Item2 = item2; + } + + /// + /// Indexer + /// + /// + /// + public ushort this[int i] + { + get + { + switch (i) + { + case 0: + return Item0; + case 1: + return Item1; + case 2: + return Item2; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: + Item0 = value; + break; + case 1: + Item1 = value; + break; + case 2: + Item2 = value; + break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } + + /// + /// 4-Tuple of ushort (System.UInt16) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec4w : IVec + { + /// + /// The value of the first component of this object. + /// + public ushort Item0; + + /// + /// The value of the second component of this object. + /// + public ushort Item1; + + /// + /// The value of the third component of this object. + /// + public ushort Item2; + + /// + /// The value of the fourth component of this object. + /// + public ushort Item3; + + /// + /// Initializer + /// + /// + /// + /// + /// + public Vec4w(ushort item0, ushort item1, ushort item2, ushort item3) + { + Item0 = item0; + Item1 = item1; + Item2 = item2; + Item3 = item3; + } + + /// + /// Indexer + /// + /// + /// + public ushort this[int i] + { + get + { + switch (i) + { + case 0: + return Item0; + case 1: + return Item1; + case 2: + return Item2; + case 3: + return Item3; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: + Item0 = value; + break; + case 1: + Item1 = value; + break; + case 2: + Item2 = value; + break; + case 3: + Item3 = value; + break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } + + /// + /// 4-Tuple of ushort (System.UInt16) + /// + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct Vec6w : IVec + { + /// + /// The value of the first component of this object. + /// + public ushort Item0; + + /// + /// The value of the second component of this object. + /// + public ushort Item1; + + /// + /// The value of the third component of this object. + /// + public ushort Item2; + + /// + /// The value of the fourth component of this object. + /// + public ushort Item3; + + /// + /// The value of the fifth component of this object. + /// + public ushort Item4; + + /// + /// The value of the sixth component of this object. + /// + public ushort Item5; + + /// + /// Initializer + /// + /// + /// + /// + /// + /// + /// + public Vec6w(ushort item0, ushort item1, ushort item2, ushort item3, ushort item4, ushort item5) + { + Item0 = item0; + Item1 = item1; + Item2 = item2; + Item3 = item3; + Item4 = item4; + Item5 = item5; + } + + /// + /// Indexer + /// + /// + /// + public ushort this[int i] + { + get + { + switch (i) + { + case 0: + return Item0; + case 1: + return Item1; + case 2: + return Item2; + case 3: + return Item3; + case 4: + return Item4; + case 5: + return Item5; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + set + { + switch (i) + { + case 0: + Item0 = value; + break; + case 1: + Item1 = value; + break; + case 2: + Item2 = value; + break; + case 3: + Item3 = value; + break; + case 4: + Item4 = value; + break; + case 5: + Item5 = value; + break; + default: + throw new ArgumentOutOfRangeException("i"); + } + } + } + } +} diff --git a/src/OpenCvSharp/modules/cuda/DescriptorFormat.cs b/src/OpenCvSharp/modules/cuda/DescriptorFormat.cs new file mode 100644 index 000000000..eb2b144d9 --- /dev/null +++ b/src/OpenCvSharp/modules/cuda/DescriptorFormat.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp.Gpu +{ + /// + /// TODO + /// + public enum DescriptorFormat + { + /// + /// + /// [HOGDescriptor::DESCR_FORMAT_ROW_BY_ROW] + /// + RowByRow = 0, + + /// + /// + /// [HOGDescriptor::DESCR_FORMAT_COL_BY_COL] + /// + ColByCol = 1, + } +} + + diff --git a/src/OpenCvSharp/modules/cuda/DeviceInfo.cs b/src/OpenCvSharp/modules/cuda/DeviceInfo.cs new file mode 100644 index 000000000..3e65075dd --- /dev/null +++ b/src/OpenCvSharp/modules/cuda/DeviceInfo.cs @@ -0,0 +1,190 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp.Gpu +{ + /// + /// Gives information about the given GPU + /// + public sealed class DeviceInfo : DisposableGpuObject + { + private bool disposed; + + /// + /// Creates DeviceInfo object for the current GPU + /// + public DeviceInfo() + { + Cv2Gpu.ThrowIfGpuNotAvailable(); + ptr = NativeMethods.cuda_DeviceInfo_new1(); + } + + /// + /// Creates DeviceInfo object for the given GPU + /// + /// + public DeviceInfo(int deviceId) + { + Cv2Gpu.ThrowIfGpuNotAvailable(); + ptr = NativeMethods.cuda_DeviceInfo_new2(deviceId); + } + + /// + /// Releases the resources + /// + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + if (disposing) + { + } + if(ptr != IntPtr.Zero) + NativeMethods.cuda_DeviceInfo_delete(ptr); + + ptr = IntPtr.Zero; + disposed = true; + } + + base.Dispose(disposing); + } + + + /// + /// + /// + public int DeviceId + { + get + { + return NativeMethods.cuda_DeviceInfo_deviceID(ptr); + } + } + + /// + /// + /// + public string Name + { + get + { + var buf = new StringBuilder(1 << 16); + NativeMethods.cuda_DeviceInfo_name(ptr, buf, buf.Capacity); + return buf.ToString(); + } + } + + /// + /// Return compute capability versions + /// + public int MajorVersion + { + get + { + return NativeMethods.cuda_DeviceInfo_majorVersion(ptr); + } + } + + /// + /// Return compute capability versions + /// + public int MinorVersion + { + get + { + return NativeMethods.cuda_DeviceInfo_minorVersion(ptr); + } + } + + /// + /// + /// + public int MultiProcessorCount + { + get + { + return NativeMethods.cuda_DeviceInfo_multiProcessorCount(ptr); + } + } + + /// + /// + /// + public long SharedMemPerBlock + { + get + { + return (long)NativeMethods.cuda_DeviceInfo_sharedMemPerBlock(ptr); + } + } + + /// + /// + /// + public void QueryMemory(out long totalMemory, out long freeMemory) + { + ulong t, f; + NativeMethods.cuda_DeviceInfo_queryMemory(ptr, out t, out f); + totalMemory = (long)t; + freeMemory = (long)f; + } + + /// + /// + /// + public long FreeMemory + { + get + { + return (long)NativeMethods.cuda_DeviceInfo_freeMemory(ptr); + } + } + + /// + /// + /// + public long TotalMemory + { + get + { + return (long)NativeMethods.cuda_DeviceInfo_totalMemory(ptr); + } + } + + /// + /// Checks whether device supports the given feature + /// + /// + /// + public bool Supports(FeatureSet featureSet) + { + return NativeMethods.cuda_DeviceInfo_supports(ptr, (int)featureSet) != 0; + } + + /// + /// Checks whether the GPU module can be run on the given device + /// + /// + public bool IsCompatible + { + get + { + return NativeMethods.cuda_DeviceInfo_isCompatible(ptr) != 0; + } + } + + /// + /// + /// + /// + public bool CanMapHostMemory + { + get + { + return NativeMethods.cuda_DeviceInfo_canMapHostMemory(ptr) != 0; + } + } + } +} diff --git a/src/OpenCvSharp/modules/cuda/DisposableGpuObject.cs b/src/OpenCvSharp/modules/cuda/DisposableGpuObject.cs new file mode 100644 index 000000000..7ef6f4cf5 --- /dev/null +++ b/src/OpenCvSharp/modules/cuda/DisposableGpuObject.cs @@ -0,0 +1,78 @@ +using System; + +namespace OpenCvSharp.Gpu +{ + /// + /// An abstract class in GPU module that implements DisposableCvObject + /// + abstract public class DisposableGpuObject : DisposableCvObject + { + /// + /// Default constructor + /// + protected DisposableGpuObject() + : base() + { + } + + /// + /// + /// + /// + protected DisposableGpuObject(IntPtr ptr) + : base(ptr) + { + } + + /// + /// + /// + /// + protected DisposableGpuObject(bool isEnabledDispose) + : base(isEnabledDispose) + { + } + + /// + /// + /// + /// + /// + protected DisposableGpuObject(IntPtr ptr, bool isEnabledDispose) + : base(ptr, isEnabledDispose) + { + } + + /// + /// Checks whether the opencv_gpu*.dll includes CUDA support. + /// + protected void ThrowIfNotAvailable() + { + if (IsDisposed) + throw new ObjectDisposedException(GetType().Name); + if (Cv2Gpu.GetCudaEnabledDeviceCount() < 1) + throw new OpenCvSharpException("Your OpenCV DLL does not support GPU module."); + + if (!IsGpuCompatible) + throw new OpenCvSharpException("The selected GPU device is not compatible."); + } + + /// + /// + /// + protected bool IsGpuCompatible + { + get + { + if (!isGpuAvailable.HasValue) + { + isGpuAvailable = (Cv2Gpu.GetCudaEnabledDeviceCount() >= 1) && + new DeviceInfo(Cv2Gpu.GetDevice()).IsCompatible; + } + return isGpuAvailable.Value; + } + } + + private bool? isGpuAvailable = null; + } +} diff --git a/src/OpenCvSharp/modules/cuda/Enum/CudaMemAllocType.cs b/src/OpenCvSharp/modules/cuda/Enum/CudaMemAllocType.cs new file mode 100644 index 000000000..0d4548923 --- /dev/null +++ b/src/OpenCvSharp/modules/cuda/Enum/CudaMemAllocType.cs @@ -0,0 +1,14 @@ +using System; + +namespace OpenCvSharp.Gpu +{ +#pragma warning disable 1591 + + [Flags] + public enum CudaMemAllocType + { + Locked = 1, + ZeroCopy = 2, + WhiteCombined = 4 + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/cuda/Enum/FeatureSet.cs b/src/OpenCvSharp/modules/cuda/Enum/FeatureSet.cs new file mode 100644 index 000000000..8c6bedcaa --- /dev/null +++ b/src/OpenCvSharp/modules/cuda/Enum/FeatureSet.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp.Gpu +{ +#pragma warning disable 1591 + + public enum FeatureSet + { + Compute10 = 10, + Compute11 = 11, + Compute12 = 12, + Compute13 = 13, + Compute20 = 20, + Compute21 = 21, + Compute30 = 30, + Compute35 = 35, + + GlobalAtomics = Compute11, + SharedAtomics = Compute12, + NativeDouble = Compute13, + WarpShuffleFunctions = Compute30, + DynamicParallelism = Compute35 + } +} diff --git a/src/OpenCvSharp/modules/cuda/GpuMat.cs b/src/OpenCvSharp/modules/cuda/GpuMat.cs new file mode 100644 index 000000000..3f0fc54f9 --- /dev/null +++ b/src/OpenCvSharp/modules/cuda/GpuMat.cs @@ -0,0 +1,1248 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace OpenCvSharp.Gpu +{ +#if LANG_JP + /// + /// 参照カウンタを持つ,GPU メモリ用の基底ストレージクラス. + /// +#else + /// + /// Smart pointer for GPU memory with reference counting. Its interface is mostly similar with cv::Mat. + /// +#endif + public partial class GpuMat : DisposableCvObject, ICloneable + { + /// + /// Track whether Dispose has been called + /// + private bool disposed; + + #region Init and Disposal + + private void ThrowIfNotAvailable() + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (Cv2Gpu.GetCudaEnabledDeviceCount() < 1) + throw new OpenCvSharpException("GPU module cannot be used."); + } + + #region Constructor + +#if LANG_JP + /// + /// OpenCVネイティブの cv::gpu::GpuMat* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::gpu::GpuMat* pointer + /// + /// +#endif + public GpuMat(IntPtr ptr) + { + ThrowIfNotAvailable(); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Native object address is NULL"); + this.ptr = ptr; + } + +#if LANG_JP + /// + /// 空の行列として初期化 + /// +#else + /// + /// Creates empty GpuMat + /// +#endif + public GpuMat() + { + ThrowIfNotAvailable(); + ptr = NativeMethods.cuda_GpuMat_new1(); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException(); + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. +#endif + public GpuMat(int rows, int cols, MatType type) + { + ThrowIfNotAvailable(); + if (rows <= 0) + throw new ArgumentOutOfRangeException("rows"); + if (cols <= 0) + throw new ArgumentOutOfRangeException("cols"); + ptr = NativeMethods.cuda_GpuMat_new2(rows, cols, type); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException(); + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public GpuMat(int rows, int cols, MatType type, IntPtr data, long step) + { + ThrowIfNotAvailable(); + if (rows <= 0) + throw new ArgumentOutOfRangeException("rows"); + if (cols <= 0) + throw new ArgumentOutOfRangeException("cols"); + ptr = NativeMethods.cuda_GpuMat_new3(rows, cols, type, data, (ulong)step); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException(); + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列として初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. +#else + /// + /// constructs 2D matrix of the specified size and type + /// + /// 2D array size: Size(cols, rows) + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType.CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. +#endif + public GpuMat(Size size, MatType type) + { + ThrowIfNotAvailable(); + ptr = NativeMethods.cuda_GpuMat_new6(size, type); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException(); + } + +#if LANG_JP + /// + /// 利用者が別に確保したデータで初期化 + /// + /// 2次元配列のサイズ: Size(cols, rows) + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. + /// ユーザデータへのポインタ. data と step パラメータを引数にとる + /// 行列コンストラクタは,行列データ領域を確保しません.代わりに,指定のデータを指し示す + /// 行列ヘッダを初期化します.つまり,データのコピーは行われません. + /// この処理は,非常に効率的で,OpenCV の関数を利用して外部データを処理することができます. + /// 外部データが自動的に解放されることはありませんので,ユーザが解放する必要があります. + /// 行列の各行が占めるバイト数を指定できます. + /// この値は,各行の終端にパディングバイトが存在すれば,それも含みます. + /// このパラメータが指定されない場合,パディングは存在しないとみなされ, + /// 実際の step は cols*elemSize() として計算されます. +#else + /// + /// constructor for matrix headers pointing to user-allocated data + /// + /// 2D array size: Size(cols, rows) + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. + /// Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. + /// Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. + /// This operation is very efficient and can be used to process external data using OpenCV functions. + /// The external data is not automatically deallocated, so you should take care of it. + /// Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. + /// If the parameter is missing (set to AUTO_STEP ), no padding is assumed and the actual step is calculated as cols*elemSize() . +#endif + public GpuMat(Size size, MatType type, IntPtr data, long step = 0) + { + ThrowIfNotAvailable(); + ptr = NativeMethods.cuda_GpuMat_new7(size, type, data, (ulong)step); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException(); + } + +#if LANG_JP + /// + /// 他の行列のから初期化 + /// + /// 作成された行列に全体的割り当てられる配列. +#else + /// + /// creates a matrix for other matrix + /// + /// Array that (as a whole) is assigned to the constructed matrix. +#endif + public GpuMat(Mat m) + { + ThrowIfNotAvailable(); + if (m == null) + throw new ArgumentNullException("m"); + ptr = NativeMethods.cuda_GpuMat_new4(m.CvPtr); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException(); + } + +#if LANG_JP + /// + /// 他のGpuMat初期化 + /// + /// 作成された行列に全体的割り当てられる配列. +#else + /// + /// creates a matrix for other matrix + /// + /// GpuMat that (as a whole) is assigned to the constructed matrix. +#endif + public GpuMat(GpuMat m) + { + ThrowIfNotAvailable(); + if (m == null) + throw new ArgumentNullException("m"); + ptr = NativeMethods.cuda_GpuMat_new5(m.CvPtr); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException(); + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2次元配列における行数. + /// 2次元配列における列数. + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or MatType. CV_8UC(n), ..., CV_64FC(n) to create multi-channel matrices. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public GpuMat(int rows, int cols, MatType type, Scalar s) + { + ThrowIfNotAvailable(); + if (rows <= 0) + throw new ArgumentOutOfRangeException("rows"); + if (cols <= 0) + throw new ArgumentOutOfRangeException("cols"); + ptr = NativeMethods.cuda_GpuMat_new8(rows, cols, type, s); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException(); + } + +#if LANG_JP + /// + /// 指定したサイズ・型の2次元の行列で、要素をスカラー値で埋めて初期化 + /// + /// 2 次元配列のサイズ: Size(cols, rows) + /// 配列の型.1-4 チャンネルの行列を作成するには MatType.CV_8UC1, ..., CV_64FC4 を, + /// マルチチャンネルの行列を作成するには,MatType.CV_8UC(n), ..., CV_64FC(n) を利用してください. + /// 各行列要素を初期化するオプション値.初期化の後ですべての行列要素を特定の値にセットするには, + /// コンストラクタの後で,SetTo(Scalar value) メソッドを利用してください. +#else + /// + /// constucts 2D matrix and fills it with the specified Scalar value. + /// + /// 2D array size: Size(cols, rows) . + /// Array type. Use MatType.CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, + /// or CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices. + /// An optional value to initialize each matrix element with. + /// To set all the matrix elements to the particular value after the construction, use SetTo(Scalar s) method . +#endif + public GpuMat(Size size, MatType type, Scalar s) + { + ThrowIfNotAvailable(); + ptr = NativeMethods.cuda_GpuMat_new11(size, type, s); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException(); + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// 扱われる 行列の行の範囲.すべての行を扱う場合は,Range.All を利用してください. + /// 扱われる 行列の列の範囲.すべての列を扱う場合は,Range.All を利用してください. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix. + /// Range of the m rows to take. As usual, the range start is inclusive and the range end is exclusive. + /// Use Range.All to take all the rows. + /// Range of the m columns to take. Use Range.All to take all the columns. +#endif + public GpuMat(GpuMat m, Range rowRange, Range colRange) + { + ThrowIfNotAvailable(); + if (m == null) + throw new ArgumentNullException("m"); + ptr = NativeMethods.cuda_GpuMat_new9(m.CvPtr, rowRange, colRange); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException(); + } + +#if LANG_JP + /// + /// 他の行列の部分行列として初期化 + /// + /// 作成された行列に(全体的,部分的に)割り当てられる配列. + /// 元の行列からくりぬかれる範囲. ROI[Region of interest]. +#else + /// + /// creates a matrix header for a part of the bigger matrix + /// + /// Array that (as a whole or partly) is assigned to the constructed matrix.. + /// Region of interest. +#endif + public GpuMat(GpuMat m, Rect roi) + { + ThrowIfNotAvailable(); + if (m == null) + throw new ArgumentNullException("m"); + ptr = NativeMethods.cuda_GpuMat_new10(m.CvPtr, roi); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException(); + } + #endregion + + #region Dispose +#if LANG_JP + /// + /// リソースの解放 + /// +#else + /// + /// Clean up any resources being used. + /// +#endif + public void Release() + { + Dispose(true); + } +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + NativeMethods.cuda_GpuMat_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + #endregion + + #region Cast + /// + /// converts header to GpuMat + /// + /// + /// + public static explicit operator GpuMat(Mat mat) + { + if (mat == null) + return null; + + IntPtr ret = NativeMethods.cuda_GpuMat_opToGpuMat(mat.CvPtr); + return new GpuMat(ret); + } + + /// + /// converts header to Mat + /// + /// + /// + public static implicit operator Mat(GpuMat gpumat) + { + if (gpumat == null) + return null; + + IntPtr ret = NativeMethods.cuda_GpuMat_opToMat(gpumat.CvPtr); + return new Mat(ret); + } + #endregion + + #region Properties + + /// + /// includes several bit-fields: + /// 1.the magic signature + /// 2.continuity flag + /// 3.depth + /// 4.number of channels + /// + public int Flags + { + get + { + ThrowIfDisposed(); + return NativeMethods.cuda_GpuMat_flags(ptr); + } + } + + /// + /// the number of rows + /// + public int Rows + { + get + { + ThrowIfDisposed(); + return NativeMethods.cuda_GpuMat_rows(ptr); + } + } + + /// + /// the number of columns + /// + public int Cols + { + get + { + ThrowIfDisposed(); + return NativeMethods.cuda_GpuMat_cols(ptr); + } + } + + /// + /// the number of rows + /// + public int Height + { + get + { + ThrowIfDisposed(); + return NativeMethods.cuda_GpuMat_rows(ptr); + } + } + + /// + /// the number of columns + /// + public int Width + { + get + { + ThrowIfDisposed(); + return NativeMethods.cuda_GpuMat_cols(ptr); + } + } + + /// + /// pointer to the data + /// + public unsafe IntPtr Data + { + get + { + ThrowIfDisposed(); + return (IntPtr)NativeMethods.cuda_GpuMat_data(ptr); + } + } + + /// + /// pointer to the reference counter; + /// when matrix points to user-allocated data, the pointer is NULL + /// + public IntPtr RefCount + { + get + { + ThrowIfDisposed(); + return NativeMethods.cuda_GpuMat_refcount(ptr); + } + } + + /// + /// helper fields used in locateROI and adjustROI + /// + public IntPtr DataStart + { + get + { + ThrowIfDisposed(); + return NativeMethods.cuda_GpuMat_datastart(ptr); + } + } + + /// + /// helper fields used in locateROI and adjustROI + /// + public IntPtr DataEnd + { + get + { + ThrowIfDisposed(); + return NativeMethods.cuda_GpuMat_dataend(ptr); + } + } + + /// + /// + /// + public int Bpp + { + get + { + return (int)Math.Pow(2, ((Depth() / 2) + 1) + 2); + } + } + #endregion + + #region Indexers + #region Range Indexer + /// + /// + /// + /// + /// + public virtual GpuMat this[Rect roi] + { + get + { + IntPtr ret = NativeMethods.cuda_GpuMat_opRange1(ptr, roi); + return new GpuMat(ret); + } + } + + /// + /// + /// + /// + /// + /// + public virtual GpuMat this[Range rowRange, Range colRange] + { + get + { + IntPtr ret = NativeMethods.cuda_GpuMat_opRange2(ptr, rowRange, colRange); + return new GpuMat(ret); + } + } + + /// + /// Extracts a rectangular submatrix. + /// + /// Start row of the extracted submatrix. The upper boundary is not included. + /// End row of the extracted submatrix. The upper boundary is not included. + /// Start column of the extracted submatrix. The upper boundary is not included. + /// End column of the extracted submatrix. The upper boundary is not included. + /// + public GpuMat this[int rowStart, int rowEnd, int colStart, int colEnd] + { + get + { + return this[new Range(rowStart, rowEnd), new Range(colStart, colEnd)]; + } + } + #endregion + + #region Element Indexer + + /// + /// GpuMat Indexer + /// + /// + public sealed class Indexer : GpuMatIndexer where T : struct + { + private readonly long ptrVal; + + internal Indexer(GpuMat parent) + : base(parent) + { + ptrVal = parent.Data.ToInt64(); + } + + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public override T this[int i0, int i1] + { + get + { + var p = new IntPtr(ptrVal + (step*i0) + (sizeOfT*i1)); + return (T)Marshal.PtrToStructure(p, typeof(T)); + } + set + { + var p = new IntPtr(ptrVal + (step*i0) + (sizeOfT*i1)); + Marshal.StructureToPtr(value, p, false); + } + } + } + + /// + /// Gets a type-specific indexer. The indexer has getters/setters to access each matrix element. + /// + /// + /// + public Indexer GetGenericIndexer() where T : struct + { + return new Indexer(this); + } + + #endregion + + #region Get/Set + + /// + /// Returns a value to the specified array element. + /// + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public T Get(int i0, int i1) where T : struct + { + return new Indexer(this)[i0, i1]; + } + + /// + /// Returns a value to the specified array element. + /// + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public T At(int i0, int i1) where T : struct + { + return new Indexer(this)[i0, i1]; + } + + /// + /// Set a value to the specified array element. + /// + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// + public void Set(int i0, int i1, T value) where T : struct + { + (new Indexer(this))[i0, i1] = value; + } + + #endregion + + #region Col/ColRange + + /// + /// returns a new matrix header for the specified column span + /// + /// + /// + /// + public GpuMat ColRange(int startcol, int endcol) + { + ThrowIfDisposed(); + IntPtr ret = NativeMethods.cuda_GpuMat_colRange(ptr, startcol, endcol); + return new GpuMat(ret); + } + + /// + /// returns a new matrix header for the specified column span + /// + /// + /// + public GpuMat ColRange(Range r) + { + return ColRange(r.Start, r.End); + } + + /// + /// Mat column's indexer object + /// + public class ColIndexer : GpuMatRowColIndexer + { + /// + /// + /// + /// + protected internal ColIndexer(GpuMat parent) + : base(parent) + { + } + + /// + /// Creates a matrix header for the specified matrix column. + /// + /// A 0-based column index. + /// + public override GpuMat this[int x] + { + get + { + parent.ThrowIfDisposed(); + IntPtr matPtr = NativeMethods.cuda_GpuMat_col(parent.ptr, x); + return new GpuMat(matPtr); + } + set + { + parent.ThrowIfDisposed(); + if (value == null) + throw new ArgumentNullException("value"); + value.ThrowIfDisposed(); + + var matPtr = NativeMethods.cuda_GpuMat_col(parent.ptr, x); + var mat = new GpuMat(matPtr); + if (mat.Size() != value.Size()) + throw new ArgumentException("Specified ROI != mat.Size()"); + value.CopyTo(mat); + } + } + + /// + /// Creates a matrix header for the specified column span. + /// + /// An inclusive 0-based start index of the column span. + /// An exclusive 0-based ending index of the column span. + /// + public override GpuMat this[int startCol, int endCol] + { + get + { + parent.ThrowIfDisposed(); + IntPtr matPtr = NativeMethods.cuda_GpuMat_colRange(parent.ptr, startCol, endCol); + return new GpuMat(matPtr); + } + set + { + parent.ThrowIfDisposed(); + if (value == null) + throw new ArgumentNullException("value"); + value.ThrowIfDisposed(); + + var colMatPtr = NativeMethods.cuda_GpuMat_colRange(parent.ptr, startCol, endCol); + var colMat = new GpuMat(colMatPtr); + if (colMat.Size() != value.Size()) + throw new ArgumentException("Specified ROI != mat.Size()"); + value.CopyTo(colMat); + } + } + } + + /// + /// Indexer to access GpuMat column + /// + /// + public ColIndexer Col + { + get { return colIndexer ?? (colIndexer = new ColIndexer(this)); } + } + + private ColIndexer colIndexer; + + #endregion + #region Row/RowRange + + /// + /// returns a new matrix header for the specified row span + /// + /// + /// + /// + public GpuMat RowRange(int startrow, int endrow) + { + ThrowIfDisposed(); + IntPtr ret = NativeMethods.cuda_GpuMat_rowRange(ptr, startrow, endrow); + return new GpuMat(ret); + } + + /// + /// returns a new matrix header for the specified row span + /// + /// + /// + public GpuMat RowRange(Range r) + { + return RowRange(r.Start, r.End); + } + + /// + /// Mat row's indexer object + /// + public class RowIndexer : GpuMatRowColIndexer + { + /// + /// + /// + /// + protected internal RowIndexer(GpuMat parent) + : base(parent) + { + } + + /// + /// Creates a matrix header for the specified matrix column. + /// + /// A 0-based column index. + /// + public override GpuMat this[int x] + { + get + { + parent.ThrowIfDisposed(); + var matPtr = NativeMethods.cuda_GpuMat_row(parent.ptr, x); + return new GpuMat(matPtr); + } + set + { + parent.ThrowIfDisposed(); + if (value == null) + throw new ArgumentNullException("value"); + value.ThrowIfDisposed(); + + var matPtr = NativeMethods.cuda_GpuMat_row(parent.ptr, x); + var mat = new GpuMat(matPtr); + if (mat.Size() != value.Size()) + throw new ArgumentException("Specified ROI != mat.Size()"); + value.CopyTo(mat); + } + } + + /// + /// Creates a matrix header for the specified column span. + /// + /// An inclusive 0-based start index of the column span. + /// An exclusive 0-based ending index of the column span. + /// + public override GpuMat this[int startCol, int endCol] + { + get + { + parent.ThrowIfDisposed(); + var matPtr = NativeMethods.cuda_GpuMat_rowRange(parent.ptr, startCol, endCol); + return new GpuMat(matPtr); + } + set + { + parent.ThrowIfDisposed(); + if (value == null) + throw new ArgumentNullException("value"); + value.ThrowIfDisposed(); + + var matPtr = NativeMethods.cuda_GpuMat_rowRange(parent.ptr, startCol, endCol); + var mat = new GpuMat(matPtr); + if (mat.Size() != value.Size()) + throw new ArgumentException("Specified ROI != mat.Size()"); + value.CopyTo(mat); + } + } + } + + /// + /// Indexer to access GpuMat row + /// + /// + public RowIndexer Row + { + get { return rowIndexer ?? (rowIndexer = new RowIndexer(this)); } + } + + private RowIndexer rowIndexer; + + #endregion + #endregion + + #region Public methods + + /// + /// returns true iff the GpuMatrix data is continuous + /// (i.e. when there are no gaps between successive rows). + /// similar to CV_IS_GpuMat_CONT(cvGpuMat->type) + /// + /// + public bool IsContinuous() + { + ThrowIfDisposed(); + return NativeMethods.cuda_GpuMat_isContinuous(ptr) != 0; + } + + /// + /// Returns the number of matrix channels. + /// + /// + public int Channels() + { + ThrowIfDisposed(); + return NativeMethods.cuda_GpuMat_channels(ptr); + } + + /// + /// Returns the depth of a matrix element. + /// + /// + public int Depth() + { + ThrowIfDisposed(); + return NativeMethods.cuda_GpuMat_depth(ptr); + } + + /// + /// Returns the matrix element size in bytes. + /// + /// + public long ElemSize() + { + ThrowIfDisposed(); + return (long)NativeMethods.cuda_GpuMat_elemSize(ptr); + } + + /// + /// Returns the size of each matrix element channel in bytes. + /// + /// + public long ElemSize1() + { + ThrowIfDisposed(); + return (long)NativeMethods.cuda_GpuMat_elemSize1(ptr); + } + + /// + /// Returns a matrix size. + /// + /// + public Size Size() + { + ThrowIfDisposed(); + return NativeMethods.cuda_GpuMat_size(ptr); + } + + /// + /// a distance between successive rows in bytes; includes the gap if any + /// + public long Step() + { + ThrowIfDisposed(); + return (long)NativeMethods.cuda_GpuMat_step(ptr); + } + + /// + /// Returns a normalized step. + /// + public long Step1() + { + ThrowIfDisposed(); + return (long)NativeMethods.cuda_GpuMat_step1(ptr); + } + + /// + /// Returns the type of a matrix element. + /// + /// + public MatType Type() + { + ThrowIfDisposed(); + return NativeMethods.cuda_GpuMat_type(ptr); + } + + /// + /// returns true if GpuMatrix data is NULL + /// + /// + public bool Empty() + { + ThrowIfDisposed(); + return NativeMethods.cuda_GpuMat_empty(ptr) != 0; + } + + /// + /// Pefroms blocking upload data to GpuMat. + /// + /// + public void Upload(Mat m) + { + ThrowIfDisposed(); + NativeMethods.cuda_GpuMat_upload(ptr, m.CvPtr); + } + + /// + /// Downloads data from device to host memory. Blocking calls. + /// + /// + public void Download(Mat m) + { + ThrowIfDisposed(); + NativeMethods.cuda_GpuMat_download(ptr, m.CvPtr); + } + + /// + /// returns deep copy of the matrix, i.e. the data is copied + /// + /// + public GpuMat Clone() + { + ThrowIfDisposed(); + IntPtr ret = NativeMethods.cuda_GpuMat_clone(ptr); + return new GpuMat(ret); + } + object ICloneable.Clone() + { + return Clone(); + } + + /// + /// copies those matrix elements to "m" + /// + /// + public void CopyTo(GpuMat m) + { + ThrowIfDisposed(); + if (m == null) + throw new ArgumentNullException("m"); + NativeMethods.cuda_GpuMat_copyTo1(ptr, m.CvPtr); + } + + /// + /// copies those matrix elements to "m" that are marked with non-zero mask elements. + /// + /// + /// + public void CopyTo(GpuMat m, GpuMat mask) + { + ThrowIfDisposed(); + if (m == null) + throw new ArgumentNullException("m"); + if (mask == null) + throw new ArgumentNullException("mask"); + NativeMethods.cuda_GpuMat_copyTo2(ptr, m.CvPtr, mask.CvPtr); + } + + /// + /// converts matrix to another datatype with optional scalng. See cvConvertScale. + /// + /// + /// + /// + /// + /// + public void ConvertTo(GpuMat dst, MatType rtype, double alpha = 1, double beta = 0) + { + ThrowIfDisposed(); + if (dst == null) + throw new ArgumentNullException("dst"); + NativeMethods.cuda_GpuMat_convertTo(ptr, dst.CvPtr, rtype, alpha, beta); + } + + /// + /// + /// + /// + public void AssignTo(GpuMat m) + { + ThrowIfDisposed(); + NativeMethods.cuda_GpuMat_assignTo(ptr, m.CvPtr, -1); + } + /// + /// + /// + /// + /// + public void AssignTo(GpuMat m, MatType type) + { + ThrowIfDisposed(); + if (m == null) + throw new ArgumentNullException("m"); + NativeMethods.cuda_GpuMat_assignTo(ptr, m.CvPtr, type); + } + + /// + /// sets some of the matrix elements to s, according to the mask + /// + /// + /// + /// + public GpuMat SetTo(Scalar s, GpuMat mask = null) + { + ThrowIfDisposed(); + IntPtr ret = NativeMethods.cuda_GpuMat_setTo(ptr, s, Cv2.ToPtr(mask)); + return new GpuMat(ret); + } + + /// + /// creates alternative matrix header for the same data, with different + /// number of channels and/or different number of rows. see cvReshape. + /// + /// + /// + /// + public GpuMat Reshape(int cn, int rows) + { + ThrowIfDisposed(); + IntPtr ret = NativeMethods.cuda_GpuMat_reshape(ptr, cn, rows); + return new GpuMat(ret); + } + + /// + /// allocates new matrix data unless the matrix already has specified size and type. + /// previous data is unreferenced if needed. + /// + /// Number of rows in a 2D array. + /// Number of columns in a 2D array. + /// Array type. + public void Create(int rows, int cols, MatType type) + { + ThrowIfDisposed(); + NativeMethods.cuda_GpuMat_create1(ptr, rows, cols, type); + } + + /// + /// allocates new matrix data unless the matrix already has specified size and type. + /// previous data is unreferenced if needed. + /// + /// 2D array size: Size(cols, rows) + /// Array type. + public void Create(Size size, MatType type) + { + ThrowIfDisposed(); + NativeMethods.cuda_GpuMat_create2(ptr, size, type); + } + + /// + /// swaps with other smart pointer + /// + /// + public void Swap(GpuMat mat) + { + ThrowIfDisposed(); + if (mat == null) + throw new ArgumentNullException("mat"); + NativeMethods.cuda_GpuMat_swap(ptr, mat.CvPtr); + } + + /// + /// locates matrix header within a parent matrix. + /// + /// + /// + public void LocateROI(out Size wholeSize, out Point ofs) + { + ThrowIfDisposed(); + NativeMethods.cuda_GpuMat_locateROI(ptr, out wholeSize, out ofs); + } + + /// + /// moves/resizes the current matrix ROI inside the parent matrix. + /// + /// + /// + /// + /// + /// + public GpuMat AdjustROI(int dtop, int dbottom, int dleft, int dright) + { + ThrowIfDisposed(); + IntPtr ret = NativeMethods.cuda_GpuMat_adjustROI(ptr, dtop, dbottom, dleft, dright); + return new GpuMat(ret); + } + + /// + /// returns pointer to y-th row + /// + /// + /// + public unsafe byte* Ptr(int y = 0) + { + ThrowIfDisposed(); + return NativeMethods.cuda_GpuMat_ptr(ptr, y); + } + + /// + /// Returns a string that represents this Mat. + /// + /// + public override string ToString() + { + return "Mat [ " + + Rows + "*" + Cols + "*" + Type().ToString() + + ", IsContinuous=" + IsContinuous() + + ", Ptr=0x" + Convert.ToString(ptr.ToInt64(), 16) + + ", Data=0x" + Convert.ToString(Data.ToInt64(), 16) + + " ]"; + } + + #endregion + } +} + + diff --git a/src/OpenCvSharp/modules/cuda/GpuMatIndexer.cs b/src/OpenCvSharp/modules/cuda/GpuMatIndexer.cs new file mode 100644 index 000000000..45e7f355a --- /dev/null +++ b/src/OpenCvSharp/modules/cuda/GpuMatIndexer.cs @@ -0,0 +1,45 @@ +using System.Runtime.InteropServices; + +namespace OpenCvSharp.Gpu +{ + /// + /// Abstract definition of Mat indexer + /// + /// + public abstract class GpuMatIndexer where T : struct + { + /// + /// 2-dimensional indexer + /// + /// Index along the dimension 0 + /// Index along the dimension 1 + /// A value to the specified array element. + public abstract T this[int i0, int i1] { get; set; } + + /// + /// Parent matrix object + /// + protected readonly GpuMat parent; + + /// + /// Step byte length for each dimension + /// + protected readonly long step; + + /// + /// sizeof(T) + /// + protected readonly int sizeOfT; + + /// + /// Constructor + /// + /// + internal GpuMatIndexer(GpuMat parent) + { + this.parent = parent; + this.step = parent.Step(); + this.sizeOfT = Marshal.SizeOf(typeof(T)); + } + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/cuda/GpuMatRowColIndexer.cs b/src/OpenCvSharp/modules/cuda/GpuMatRowColIndexer.cs new file mode 100644 index 000000000..0bb329532 --- /dev/null +++ b/src/OpenCvSharp/modules/cuda/GpuMatRowColIndexer.cs @@ -0,0 +1,107 @@ +namespace OpenCvSharp.Gpu +{ + /// + /// + /// + public abstract class GpuMatRowColIndexer + { + /// + /// + /// + protected readonly GpuMat parent; + + /// + /// + /// + /// + protected internal GpuMatRowColIndexer(GpuMat parent) + { + this.parent = parent; + } + + /// + /// Creates/Sets a matrix header for the specified matrix row/column. + /// + /// + /// + public abstract GpuMat this[int pos] { get; set; } + + /// + /// Creates/Sets a matrix header for the specified row/column span. + /// + /// + /// + /// + public abstract GpuMat this[int start, int end] { get; set; } + + /// + /// Creates/Sets a matrix header for the specified row/column span. + /// + /// + /// + public virtual GpuMat this[Range range] + { + get { return this[range.Start, range.End]; } + } + + /// + /// Creates a matrix header for the specified matrix row/column. + /// + /// + /// + public virtual GpuMat Get(int pos) + { + return this[pos]; + } + /// + /// Creates a matrix header for the specified row/column span. + /// + /// + /// + /// + public virtual GpuMat Get(int start, int end) + { + return this[start, end]; + } + /// + /// Creates a matrix header for the specified row/column span. + /// + /// + /// + public virtual GpuMat Get(Range range) + { + return this[range]; + } + + /// + /// Creates/Sets a matrix header for the specified matrix row/column. + /// + /// + /// + public virtual void Set(int pos, GpuMat value) + { + this[pos] = value; + } + + /// + /// Creates/Sets a matrix header for the specified row/column span. + /// + /// + /// + /// + public virtual void Set(int start, int end, GpuMat value) + { + this[start, end] = value; + } + + /// + /// Creates/Sets a matrix header for the specified row/column span. + /// + /// + /// + public virtual void Set(Range range, GpuMat value) + { + this[range.Start, range.End] = value; + } + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/cuda/Stream.cs b/src/OpenCvSharp/modules/cuda/Stream.cs new file mode 100644 index 000000000..2dc5f607c --- /dev/null +++ b/src/OpenCvSharp/modules/cuda/Stream.cs @@ -0,0 +1,333 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace OpenCvSharp.Gpu +{ + /// + /// + /// + /// + /// + /// + public delegate void StreamCallback(Stream stream, int status, object userData); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void StreamCallbackInternal(IntPtr stream, int status, IntPtr userData); + +#if LANG_JP + /// + /// Encapculates Cuda Stream. Provides interface for async coping. + /// +#else + /// + /// Encapculates Cuda Stream. Provides interface for async coping. + /// +#endif + public sealed class Stream : DisposableGpuObject + { + /// + /// Track whether Dispose has been called + /// + private bool disposed; + + private StreamCallbackInternal callbackInternal; + private GCHandle callbackHandle; + private GCHandle userDataHandle; + + #region Init and Disposal + +#if LANG_JP + /// + /// OpenCVネイティブの cv::gpu::Stream* ポインタから初期化 + /// + /// +#else + /// + /// Creates from native cv::gpu::Stream* pointer + /// + /// +#endif + public Stream(IntPtr ptr) + { + ThrowIfNotAvailable(); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Native object address is NULL"); + this.ptr = ptr; + } + + /// + /// Creates empty Stream + /// + public Stream() + { + ThrowIfNotAvailable(); + ptr = NativeMethods.cuda_Stream_new1(); + } + + /// + /// + /// + /// + public Stream(Stream m) + { + ThrowIfNotAvailable(); + if (m == null) + throw new ArgumentNullException("m"); + ptr = NativeMethods.cuda_Stream_new2(m.CvPtr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// +#else + /// + /// Clean up any resources being used. + /// +#endif + public void Release() + { + Dispose(true); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + NativeMethods.cuda_Stream_delete(ptr); + if (callbackHandle.IsAllocated) + callbackHandle.Free(); + if (userDataHandle.IsAllocated) + userDataHandle.Free(); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + /// + /// Empty stream + /// + /// + public static Stream Null + { + get + { + if (nullObject == null) + { + IntPtr ret = NativeMethods.cuda_Stream_Null(); + nullObject = new Stream(ret) {IsEnabledDispose = false}; + } + return nullObject; + } + } + + private static Stream nullObject = null; + + /// + /// + /// + /// + public static explicit operator bool(Stream self) + { + self.ThrowIfDisposed(); + return NativeMethods.cuda_Stream_bool(self.ptr) != 0; + } + + /// + /// + /// + /// + public bool QueryIfComplete() + { + ThrowIfDisposed(); + return NativeMethods.cuda_Stream_queryIfComplete(ptr) != 0; + } + + /// + /// + /// + public void WaitForCompletion() + { + ThrowIfDisposed(); + NativeMethods.cuda_Stream_waitForCompletion(ptr); + } + + /// + /// Downloads asynchronously. + /// Warning! cv::Mat must point to page locked memory (i.e. to CudaMem data or to its subMat) + /// + /// + /// + public void EnqueueDownload(GpuMat src, Mat dst) + { + ThrowIfDisposed(); + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfDisposed(); + + NativeMethods.cuda_Stream_enqueueDownload_Mat(ptr, src.CvPtr, dst.CvPtr); + } + + /// + /// Uploads asynchronously. + /// Warning! cv::Mat must point to page locked memory (i.e. to CudaMem data or to its ROI) + /// + /// + /// + public void EnqueueUpload(Mat src, GpuMat dst) + { + ThrowIfDisposed(); + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfDisposed(); + + NativeMethods.cuda_Stream_enqueueUpload_Mat(ptr, src.CvPtr, dst.CvPtr); + } + + /// + /// Copy asynchronously + /// + /// + /// + public void EnqueueCopy(GpuMat src, GpuMat dst) + { + ThrowIfDisposed(); + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfDisposed(); + + NativeMethods.cuda_Stream_enqueueCopy(ptr, src.CvPtr, dst.CvPtr); + } + + /// + /// Memory set asynchronously + /// + /// + /// + public void EnqueueMemSet(GpuMat src, Scalar val) + { + ThrowIfDisposed(); + if (src == null) + throw new ArgumentNullException("src"); + src.ThrowIfDisposed(); + + NativeMethods.cuda_Stream_enqueueMemSet(ptr, src.CvPtr, val); + } + + /// + /// Memory set asynchronously + /// + /// + /// + /// + public void EnqueueMemSet(GpuMat src, Scalar val, GpuMat mask) + { + ThrowIfDisposed(); + if (src == null) + throw new ArgumentNullException("src"); + src.ThrowIfDisposed(); + + NativeMethods.cuda_Stream_enqueueMemSet_WithMask(ptr, src.CvPtr, val, Cv2.ToPtr(mask)); + } + + /// + /// converts matrix type, ex from float to uchar depending on type + /// + /// + /// + /// + /// + /// + public void EnqueueConvert(GpuMat src, GpuMat dst, int dtype, double a = 1, double b = 0) + { + ThrowIfDisposed(); + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfDisposed(); + + NativeMethods.cuda_Stream_enqueueConvert(ptr, src.CvPtr, dst.CvPtr, dtype, a, b); + } + + /// + /// Adds a callback to be called on the host after all currently enqueued items + /// in the stream have completed + /// + /// + /// Not supported + public void EnqueueHostCallback(StreamCallback callback, object userData = null) + { + ThrowIfDisposed(); + if (callback == null) + throw new ArgumentNullException("callback"); + + if (callbackHandle.IsAllocated) + callbackHandle.Free(); + if (userDataHandle.IsAllocated) + userDataHandle.Free(); + + IntPtr userDataPtr = IntPtr.Zero; + if (userData != null) + { + userDataHandle = GCHandle.Alloc(userData); + userDataPtr = GCHandle.ToIntPtr(userDataHandle); + } + + callbackInternal = new StreamCallbackInternal( + delegate(IntPtr rawStream, int status, IntPtr rawUserData) + { + var streamObj = new Stream(rawStream) {IsEnabledDispose = false}; + var userDataObj = GCHandle.FromIntPtr(rawUserData).Target; + callback(streamObj, status, userDataObj); + }); + callbackHandle = GCHandle.Alloc(callbackInternal); + IntPtr callbackPtr = Marshal.GetFunctionPointerForDelegate(callbackInternal); + + NativeMethods.cuda_Stream_enqueueHostCallback( + ptr, callbackPtr, userDataPtr); + } + } +} diff --git a/src/OpenCvSharp/modules/face/FaceRecognizer.cs b/src/OpenCvSharp/modules/face/FaceRecognizer.cs new file mode 100644 index 000000000..727058203 --- /dev/null +++ b/src/OpenCvSharp/modules/face/FaceRecognizer.cs @@ -0,0 +1,245 @@ +using System; +using System.Collections.Generic; +using System.Text; +using OpenCvSharp.Util; + +namespace OpenCvSharp.Face +{ + /// + /// + /// + public class FaceRecognizer : Algorithm + { + private bool disposed; + + /// + /// + /// + private Ptr recognizerPtr; + + #region Init & Disposal + + /// + /// + /// + protected FaceRecognizer() + { + recognizerPtr = null; + ptr = IntPtr.Zero; + } + + /// + /// Creates instance from cv::Ptr<T> . + /// ptr is disposed when the wrapper disposes. + /// + /// + internal static FaceRecognizer FromPtr(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Invalid cv::Ptr pointer"); + var ptrObj = new Ptr(ptr); + var detector = new FaceRecognizer + { + recognizerPtr = ptrObj, + ptr = ptrObj.Get() + }; + return detector; + } + + /// + /// + /// + /// + /// + /// + public static FaceRecognizer CreateEigenFaceRecognizer(int numComponents = 0, double threshold = Double.MaxValue) + { + IntPtr p = NativeMethods.face_createEigenFaceRecognizer(numComponents, threshold); + return FromPtr(p); + } + + /// + /// + /// + /// + /// + /// + public static FaceRecognizer CreateFisherFaceRecognizer(int numComponents = 0, + double threshold = Double.MaxValue) + { + IntPtr p = NativeMethods.face_createFisherFaceRecognizer(numComponents, threshold); + return FromPtr(p); + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static FaceRecognizer CreateLBPHFaceRecognizer(int radius = 1, int neighbors = 8, + int gridX = 8, int gridY = 8, double threshold = Double.MaxValue) + { + IntPtr p = NativeMethods.face_createLBPHFaceRecognizer(radius, neighbors, gridX, gridY, threshold); + return FromPtr(p); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + } + // releases unmanaged resources + if (IsEnabledDispose) + { + if (recognizerPtr != null) + recognizerPtr.Dispose(); + recognizerPtr = null; + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Methods + + /// + /// Trains a FaceRecognizer. + /// + /// + /// + public virtual void Train(IEnumerable src, IEnumerable labels) + { + if (src == null) + throw new ArgumentNullException("src"); + if (labels == null) + throw new ArgumentNullException("labels"); + IntPtr[] srcArray = EnumerableEx.SelectPtrs(src); + int[] labelsArray = EnumerableEx.ToArray(labels); + NativeMethods.face_FaceRecognizer_train( + ptr, srcArray, srcArray.Length, labelsArray, labelsArray.Length); + } + + /// + /// Updates a FaceRecognizer. + /// + /// + /// + public void Update(IEnumerable src, IEnumerable labels) + { + if (src == null) + throw new ArgumentNullException("src"); + if (labels == null) + throw new ArgumentNullException("labels"); + IntPtr[] srcArray = EnumerableEx.SelectPtrs(src); + int[] labelsArray = EnumerableEx.ToArray(labels); + NativeMethods.face_FaceRecognizer_update( + ptr, srcArray, srcArray.Length, labelsArray, labelsArray.Length); + } + + /// + /// Gets a prediction from a FaceRecognizer. + /// + /// + /// + public virtual int Predict(InputArray src) + { + if (src == null) + throw new ArgumentNullException("src"); + src.ThrowIfDisposed(); + return NativeMethods.face_FaceRecognizer_predict1(ptr, src.CvPtr); + } + + /// + /// Predicts the label and confidence for a given sample. + /// + /// + /// + /// + public virtual void Predict(InputArray src, out int label, out double confidence) + { + if (src == null) + throw new ArgumentNullException("src"); + src.ThrowIfDisposed(); + NativeMethods.face_FaceRecognizer_predict2(ptr, src.CvPtr, out label, out confidence); + } + + /// + /// Serializes this object to a given filename. + /// + /// + public virtual new void Save(string fileName) + { + if (fileName == null) + throw new ArgumentNullException("fileName"); + NativeMethods.face_FaceRecognizer_save1(ptr, fileName); + } + + /// + /// Deserializes this object from a given filename. + /// + /// + public virtual void Load(string fileName) + { + if (fileName == null) + throw new ArgumentNullException("fileName"); + NativeMethods.face_FaceRecognizer_load1(ptr, fileName); + } + + /// + /// Serializes this object to a given cv::FileStorage. + /// + /// + public virtual void Save(FileStorage fs) + { + if (fs == null) + throw new ArgumentNullException("fs"); + NativeMethods.face_FaceRecognizer_save2(ptr, fs.CvPtr); + } + + /// + /// Deserializes this object from a given cv::FileStorage. + /// + /// + public virtual void Load(FileStorage fs) + { + if (fs == null) + throw new ArgumentNullException("fs"); + NativeMethods.face_FaceRecognizer_load2(ptr, fs.CvPtr); + } + + #endregion + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/features2d/AKAZE.cs b/src/OpenCvSharp/modules/features2d/AKAZE.cs new file mode 100644 index 000000000..5a6bfa3a7 --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/AKAZE.cs @@ -0,0 +1,250 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable once InconsistentNaming + +#if LANG_JP + /// + /// AKAZE 実装 + /// +#else + /// + /// Class implementing the AKAZE keypoint detector and descriptor extractor, + /// described in @cite ANB13 + /// + /// + /// AKAZE descriptors can only be used with KAZE or AKAZE keypoints. + /// Try to avoid using *extract* and *detect* instead of *operator()* due to performance reasons. + /// .. [ANB13] Fast Explicit Diffusion for Accelerated Features in Nonlinear Scale + /// Spaces. Pablo F. Alcantarilla, Jesús Nuevo and Adrien Bartoli. + /// In British Machine Vision Conference (BMVC), Bristol, UK, September 2013. + /// +#endif + public class AKAZE : Feature2D + { + private bool disposed; + private Ptr ptrObj; + + #region Init & Disposal + + /// + /// + /// + protected AKAZE(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// The AKAZE constructor + /// + /// + /// + /// + /// + /// + /// + /// + public static AKAZE Create( + OpenCvSharp.AKAZEDescriptorType descriptorType = OpenCvSharp.AKAZEDescriptorType.MLDB, + int descriptorSize = 0, + int descriptorChannels = 3, + float threshold = 0.001f, + int nOctaves = 4, + int nOctaveLayers = 4, + KAZEDiffusivity diffusivity = KAZEDiffusivity.DiffPmG2) + { + IntPtr ptr = NativeMethods.features2d_AKAZE_create( + (int) descriptorType, descriptorSize, descriptorChannels, + threshold, nOctaves, nOctaveLayers, (int) diffusivity); + return new AKAZE(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + // releases unmanaged resources + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + + /// + /// + /// + public AKAZEDescriptorType AKAZEDescriptorType // avoid name conflict + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return (AKAZEDescriptorType)NativeMethods.features2d_AKAZE_getDescriptorType(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_AKAZE_setDescriptorType(ptr, (int)value); + } + } + + /// + /// + /// + public int AKAZEDescriptorSize // avoid name conflict + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_AKAZE_getDescriptorSize(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_AKAZE_setDescriptorSize(ptr, value); + } + } + + /// + /// + /// + public int AKAZEDescriptorChannels // avoid name conflict + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_AKAZE_getDescriptorChannels(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_AKAZE_setDescriptorChannels(ptr, value); + } + } + + /// + /// + /// + public double Threshold + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_AKAZE_getThreshold(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_AKAZE_setThreshold(ptr, value); + } + } + + /// + /// + /// + public int NOctaves + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_AKAZE_getNOctaves(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_AKAZE_setNOctaves(ptr, value); + } + } + + /// + /// + /// + public int NOctaveLayers + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_AKAZE_getNOctaveLayers(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_AKAZE_setNOctaveLayers(ptr, value); + } + } + + /// + /// + /// + public int Diffusivity + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_AKAZE_getDiffusivity(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_AKAZE_setDiffusivity(ptr, value); + } + } + + #endregion + + #region Methods + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/features2d/AgastFeatureDetector.cs b/src/OpenCvSharp/modules/features2d/AgastFeatureDetector.cs new file mode 100644 index 000000000..483e6e812 --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/AgastFeatureDetector.cs @@ -0,0 +1,166 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + +#if LANG_JP + /// + /// AGAST 実装 + /// +#else + /// + /// Detects corners using the AGAST algorithm + /// +#endif + public class AgastFeatureDetector : Feature2D + { + private bool disposed; + private Ptr ptrObj; + +#pragma warning disable 1591 + public const int + AGAST_5_8 = 0, + AGAST_7_12d = 1, + AGAST_7_12s = 2, + OAST_9_16 = 3, + THRESHOLD = 10000, + NONMAX_SUPPRESSION = 10001; +#pragma warning restore 1591 + #region Init & Disposal + + /// + /// + /// + protected AgastFeatureDetector(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// The AgastFeatureDetector constructor + /// + /// threshold on difference between intensity of the central pixel + /// and pixels of a circle around this pixel. + /// if true, non-maximum suppression is applied to detected corners (keypoints). + /// + public static AgastFeatureDetector Create( int threshold=10, + bool nonmaxSuppression=true, + AGASTType type = AGASTType.OAST_9_16) + { + IntPtr ptr = NativeMethods.features2d_AgastFeatureDetector_create( + threshold, nonmaxSuppression ? 1 : 0, (int)type); + return new AgastFeatureDetector(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + // releases unmanaged resources + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + + /// + /// threshold on difference between intensity of the central pixel and pixels of a circle around this pixel. + /// + public int Threshold + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_AgastFeatureDetector_getThreshold(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_AgastFeatureDetector_setThreshold(ptr, value); + } + } + + /// + /// if true, non-maximum suppression is applied to detected corners (keypoints). + /// + public int NonmaxSuppression + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_AgastFeatureDetector_getNonmaxSuppression(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_AgastFeatureDetector_setNonmaxSuppression(ptr, value); + } + } + + /// + /// type one of the four neighborhoods as defined in the paper + /// + public AGASTType Type + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return (AGASTType)NativeMethods.features2d_AgastFeatureDetector_getType(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_AgastFeatureDetector_setType(ptr, (int)value); + } + } + + #endregion + + #region Methods + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/features2d/BFMatcher.cs b/src/OpenCvSharp/modules/features2d/BFMatcher.cs new file mode 100644 index 000000000..6d8acbedd --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/BFMatcher.cs @@ -0,0 +1,123 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable once InconsistentNaming + + /// + /// Brute-force descriptor matcher. + /// For each descriptor in the first set, this matcher finds the closest descriptor in the second set by trying each one. + /// + public class BFMatcher : DescriptorMatcher + { + private bool disposed; + private Ptr detectorPtr; + + #region Init & Disposal + + /// + /// + /// + /// + /// + public BFMatcher(NormTypes normType = NormTypes.L2, bool crossCheck = false) + { + ptr = NativeMethods.features2d_BFMatcher_new((int) normType, crossCheck ? 1 : 0); + } + + /// + /// Creates instance by cv::Ptr<T> + /// + internal BFMatcher(Ptr detectorPtr) + { + this.detectorPtr = detectorPtr; + this.ptr = detectorPtr.Get(); + } + + /// + /// Creates instance by raw pointer T* + /// + internal BFMatcher(IntPtr rawPtr) + { + detectorPtr = null; + ptr = rawPtr; + } + + /// + /// Creates instance from cv::Ptr<T> . + /// ptr is disposed when the wrapper disposes. + /// + /// + internal new static BFMatcher FromPtr(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Invalid cv::Ptr pointer"); + var ptrObj = new Ptr(ptr); + return new BFMatcher(ptrObj); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + } + // releases unmanaged resources + if (detectorPtr != null) + { + detectorPtr.Dispose(); + detectorPtr = null; + } + else + { + if (ptr != IntPtr.Zero) + NativeMethods.features2d_BFMatcher_delete(ptr); + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Methods + + /// + /// Return true if the matcher supports mask in match methods. + /// + /// + public override bool IsMaskSupported() + { + ThrowIfDisposed(); + return NativeMethods.features2d_BFMatcher_isMaskSupported(ptr) != 0; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/features2d/BRISK.cs b/src/OpenCvSharp/modules/features2d/BRISK.cs new file mode 100644 index 000000000..98b69ebae --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/BRISK.cs @@ -0,0 +1,134 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + // ReSharper disable once InconsistentNaming + +#if LANG_JP + /// + /// BRISK 実装 + /// +#else + /// + /// BRISK implementation + /// +#endif + public class BRISK : Feature2D + { + private bool disposed; + private Ptr ptrObj; + + #region Init & Disposal + + /// + /// + /// + protected BRISK() + : base() + { + } + + /// + /// + /// + /// + protected BRISK(IntPtr p) + : base() + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// + /// + /// + /// + /// + public static BRISK Create(int thresh = 30, int octaves = 3, float patternScale = 1.0f) + { + IntPtr p = NativeMethods.features2d_BRISK_create1(thresh, octaves, patternScale); + return new BRISK(p); + } + + /// + /// custom setup + /// + /// + /// + /// + /// + /// + /// + public static BRISK Create( + IEnumerable radiusList, IEnumerable numberList, + float dMax = 5.85f, float dMin = 8.2f, + IEnumerable indexChange = null) + { + if (radiusList == null) + throw new ArgumentNullException("radiusList"); + if (numberList == null) + throw new ArgumentNullException("numberList"); + float[] radiusListArray = EnumerableEx.ToArray(radiusList); + int[] numberListArray = EnumerableEx.ToArray(numberList); + int[] indexChangeArray = EnumerableEx.ToArray(indexChange); + + IntPtr p = NativeMethods.features2d_BRISK_create2( + radiusListArray, radiusListArray.Length, + numberListArray, numberListArray.Length, + dMax, dMin, + indexChangeArray, indexChangeArray.Length); + return new BRISK(p); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + // releases unmanaged resources + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Methods + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/features2d/DenseFeatureDetector.cs b/src/OpenCvSharp/modules/features2d/DenseFeatureDetector.cs new file mode 100644 index 000000000..5a43434a8 --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/DenseFeatureDetector.cs @@ -0,0 +1,132 @@ +using System; + +namespace OpenCvSharp +{ +#if false + /// + /// Class for generation of image features which are + /// distributed densely and regularly over the image. + /// + public class DenseFeatureDetector : FeatureDetector + { + private bool disposed; + private Ptr detectorPtr; + + #region Init & Disposal + /// + /// The detector generates several levels (in the amount of featureScaleLevels) of features. + /// Features of each level are located in the nodes of a regular grid over the image + /// (excluding the image boundary of given size). The level parameters (a feature scale, + /// a node size, a size of boundary) are multiplied by featureScaleMul with level index + /// growing depending on input flags, viz.: + /// + /// + /// + /// + /// + /// + /// The grid node size is multiplied if this is true. + /// Size of image boundary is multiplied if this is true. + public DenseFeatureDetector( float initFeatureScale=1.0f, int featureScaleLevels=1, + float featureScaleMul=0.1f, + int initXyStep=6, int initImgBound=0, + bool varyXyStepWithScale=true, + bool varyImgBoundWithScale=false ) + { + ptr = NativeMethods.features2d_DenseFeatureDetector_new( + initFeatureScale, featureScaleLevels, featureScaleMul,initXyStep, initImgBound, + varyXyStepWithScale ? 1 : 0, varyImgBoundWithScale ? 1 : 0); + } + + /// + /// Creates instance by cv::Ptr<cv::SURF> + /// + internal DenseFeatureDetector(Ptr detectorPtr) + { + this.detectorPtr = detectorPtr; + this.ptr = detectorPtr.Get(); + } + /// + /// Creates instance by raw pointer cv::SURF* + /// + internal DenseFeatureDetector(IntPtr rawPtr) + { + detectorPtr = null; + ptr = rawPtr; + } + /// + /// Creates instance from cv::Ptr<T> . + /// ptr is disposed when the wrapper disposes. + /// + /// + internal static new DenseFeatureDetector FromPtr(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Invalid cv::Ptr pointer"); + var ptrObj = new Ptr(ptr); + return new DenseFeatureDetector(ptrObj); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + } + // releases unmanaged resources + if (detectorPtr != null) + { + detectorPtr.Dispose(); + detectorPtr = null; + } + else + { + if (ptr != IntPtr.Zero) + NativeMethods.features2d_DenseFeatureDetector_delete(ptr); + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + /// + /// Pointer to algorithm information (cv::AlgorithmInfo*) + /// + /// + public override IntPtr InfoPtr + { + get + { + return NativeMethods.features2d_DenseFeatureDetector_info(ptr); + } + } + } +#endif +} diff --git a/src/OpenCvSharp/modules/features2d/DescriptorMatcher.cs b/src/OpenCvSharp/modules/features2d/DescriptorMatcher.cs new file mode 100644 index 000000000..cbb3ed30e --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/DescriptorMatcher.cs @@ -0,0 +1,412 @@ +using System; +using System.Collections.Generic; +using System.Text; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// + /// + public class DescriptorMatcher : Algorithm + { + private bool disposed; + + /// + /// + /// + private Ptr detectorPtr; + + #region Init & Disposal + + /// + /// + /// + protected DescriptorMatcher() + { + detectorPtr = null; + ptr = IntPtr.Zero; + } + + /// + /// Create descriptor matcher by type name. + /// + /// + /// + public static DescriptorMatcher Create(string descriptorMatcherType) + { + if (String.IsNullOrEmpty(descriptorMatcherType)) + throw new ArgumentNullException("descriptorMatcherType"); + + switch (descriptorMatcherType) + { + case "FlannBased": + return new FlannBasedMatcher(); + + case "BruteForce": // L2 + return new BFMatcher(NormTypes.L2); + + case "BruteForce-SL2": // Squared L2 + return new BFMatcher(NormTypes.L2SQR); + + case "BruteForce-L1": + return new BFMatcher(NormTypes.L1); + + case "BruteForce-Hamming": + case "BruteForce-HammingLUT": + return new BFMatcher(NormTypes.Hamming); + + case "BruteForce-Hamming(2)": + return new BFMatcher(NormTypes.Hamming2); + + default: + throw new OpenCvSharpException("Unknown matcher name '{0}'", descriptorMatcherType); + } + /* + IntPtr ptr; + try + { + ptr = NativeMethods.features2d_FeatureDetector_create(descriptorMatcherType); + } + catch (OpenCvSharpException) + { + throw new OpenCvSharpException( + "matcher name '{0}' is not valid.", descriptorMatcherType); + } + return FromPtr(ptr);*/ + } + + /// + /// Creates instance from cv::Ptr<T> . + /// ptr is disposed when the wrapper disposes. + /// + /// + internal static DescriptorMatcher FromPtr(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Invalid cv::Ptr pointer"); + var ptrObj = new Ptr(ptr); + var detector = new DescriptorMatcher + { + detectorPtr = ptrObj, + ptr = ptrObj.Get() + }; + return detector; + } + + /// + /// Creates instance from raw pointer T* + /// + /// + internal static DescriptorMatcher FromRawPtr(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Invalid DescriptorMatcher pointer"); + var detector = new DescriptorMatcher + { + detectorPtr = null, + ptr = ptr + }; + return detector; + } + + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + } + // releases unmanaged resources + if (IsEnabledDispose) + { + if (detectorPtr != null) + detectorPtr.Dispose(); + detectorPtr = null; + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Methods + + /// + /// Add descriptors to train descriptor collection. + /// + /// Descriptors to add. Each descriptors[i] is a descriptors set from one image. + public virtual void Add(IEnumerable descriptors) + { + ThrowIfDisposed(); + if (descriptors == null) + throw new ArgumentNullException("descriptors"); + + Mat[] descriptorsArray = EnumerableEx.ToArray(descriptors); + if (descriptorsArray.Length == 0) + return; + + IntPtr[] descriptorsPtrs = EnumerableEx.SelectPtrs(descriptorsArray); + NativeMethods.features2d_DescriptorMatcher_add(ptr, descriptorsPtrs, descriptorsPtrs.Length); + } + + /// + /// Get train descriptors collection. + /// + /// + public Mat[] GetTrainDescriptors() + { + ThrowIfDisposed(); + using (var matVec = new VectorOfMat()) + { + NativeMethods.features2d_DescriptorMatcher_getTrainDescriptors(ptr, matVec.CvPtr); + return matVec.ToArray(); + } + } + + /// + /// Clear train descriptors collection. + /// + public virtual void Clear() + { + ThrowIfDisposed(); + NativeMethods.features2d_DescriptorMatcher_clear(ptr); + } + + /// + /// Return true if there are not train descriptors in collection. + /// + /// + public virtual new bool Empty() + { + ThrowIfDisposed(); + return NativeMethods.features2d_DescriptorMatcher_empty(ptr) != 0; + } + + /// + /// Return true if the matcher supports mask in match methods. + /// + /// + public virtual bool IsMaskSupported() + { + ThrowIfDisposed(); + return NativeMethods.features2d_DescriptorMatcher_isMaskSupported(ptr) != 0; + } + + /// + /// Train matcher (e.g. train flann index). + /// In all methods to match the method train() is run every time before matching. + /// Some descriptor matchers (e.g. BruteForceMatcher) have empty implementation + /// of this method, other matchers really train their inner structures + /// (e.g. FlannBasedMatcher trains flann::Index). So nonempty implementation + /// of train() should check the class object state and do traing/retraining + /// only if the state requires that (e.g. FlannBasedMatcher trains flann::Index + /// if it has not trained yet or if new descriptors have been added to the train collection). + /// + public virtual void Train() + { + ThrowIfDisposed(); + NativeMethods.features2d_DescriptorMatcher_train(ptr); + } + + #region *Match + + /// + /// Find one best match for each query descriptor (if mask is empty). + /// + /// + /// + /// + /// + public DMatch[] Match(Mat queryDescriptors, Mat trainDescriptors, Mat mask = null) + { + ThrowIfDisposed(); + if (queryDescriptors == null) + throw new ArgumentNullException("queryDescriptors"); + if (trainDescriptors == null) + throw new ArgumentNullException("trainDescriptors"); + using (var matchesVec = new VectorOfDMatch()) + { + NativeMethods.features2d_DescriptorMatcher_match1( + ptr, queryDescriptors.CvPtr, trainDescriptors.CvPtr, + matchesVec.CvPtr, Cv2.ToPtr(mask)); + return matchesVec.ToArray(); + } + } + + /// + /// Find k best matches for each query descriptor (in increasing order of distances). + /// compactResult is used when mask is not empty. If compactResult is false matches + /// vector will have the same size as queryDescriptors rows. If compactResult is true + /// matches vector will not contain matches for fully masked out query descriptors. + /// + /// + /// + /// + /// + /// + /// + public DMatch[][] KnnMatch(Mat queryDescriptors, Mat trainDescriptors, + int k, Mat mask = null, bool compactResult = false) + { + ThrowIfDisposed(); + if (queryDescriptors == null) + throw new ArgumentNullException("queryDescriptors"); + if (trainDescriptors == null) + throw new ArgumentNullException("trainDescriptors"); + using (var matchesVec = new VectorOfVectorDMatch()) + { + NativeMethods.features2d_DescriptorMatcher_knnMatch1( + ptr, queryDescriptors.CvPtr, trainDescriptors.CvPtr, + matchesVec.CvPtr, k, Cv2.ToPtr(mask), compactResult ? 1 : 0); + return matchesVec.ToArray(); + } + } + + /// + /// Find best matches for each query descriptor which have distance less than + /// maxDistance (in increasing order of distances). + /// + /// + /// + /// + /// + /// + /// + public DMatch[][] RadiusMatch(Mat queryDescriptors, Mat trainDescriptors, + float maxDistance, Mat mask = null, bool compactResult = false) + { + ThrowIfDisposed(); + if (queryDescriptors == null) + throw new ArgumentNullException("queryDescriptors"); + if (trainDescriptors == null) + throw new ArgumentNullException("trainDescriptors"); + using (var matchesVec = new VectorOfVectorDMatch()) + { + NativeMethods.features2d_DescriptorMatcher_radiusMatch1( + ptr, queryDescriptors.CvPtr, trainDescriptors.CvPtr, + matchesVec.CvPtr, maxDistance, Cv2.ToPtr(mask), compactResult ? 1 : 0); + return matchesVec.ToArray(); + } + } + + /// + /// Find one best match for each query descriptor (if mask is empty). + /// + /// + /// + /// + public DMatch[] Match(Mat queryDescriptors, Mat[] masks = null) + { + ThrowIfDisposed(); + if (queryDescriptors == null) + throw new ArgumentNullException("queryDescriptors"); + + var masksPtrs = new IntPtr[0]; + if (masks != null) + { + masksPtrs = EnumerableEx.SelectPtrs(masks); + } + + using (var matchesVec = new VectorOfDMatch()) + { + NativeMethods.features2d_DescriptorMatcher_match2( + ptr, queryDescriptors.CvPtr, matchesVec.CvPtr, masksPtrs, masksPtrs.Length); + return matchesVec.ToArray(); + } + } + + /// + /// Find k best matches for each query descriptor (in increasing order of distances). + /// compactResult is used when mask is not empty. If compactResult is false matches + /// vector will have the same size as queryDescriptors rows. If compactResult is true + /// matches vector will not contain matches for fully masked out query descriptors. + /// + /// + /// + /// + /// + /// + public DMatch[][] KnnMatch(Mat queryDescriptors, int k, Mat[] masks = null, bool compactResult = false) + { + ThrowIfDisposed(); + if (queryDescriptors == null) + throw new ArgumentNullException("queryDescriptors"); + + var masksPtrs = new IntPtr[0]; + if (masks != null) + { + masksPtrs = EnumerableEx.SelectPtrs(masks); + } + + using (var matchesVec = new VectorOfVectorDMatch()) + { + NativeMethods.features2d_DescriptorMatcher_knnMatch2( + ptr, queryDescriptors.CvPtr, matchesVec.CvPtr, k, + masksPtrs, masksPtrs.Length, compactResult ? 1 : 0); + return matchesVec.ToArray(); + } + } + + /// + /// Find best matches for each query descriptor which have distance less than + /// maxDistance (in increasing order of distances). + /// + /// + /// + /// + /// + /// + public DMatch[][] RadiusMatch(Mat queryDescriptors, float maxDistance, Mat[] masks = null, bool compactResult = false) + { + ThrowIfDisposed(); + if (queryDescriptors == null) + throw new ArgumentNullException("queryDescriptors"); + + var masksPtrs = new IntPtr[0]; + if (masks != null) + { + masksPtrs = EnumerableEx.SelectPtrs(masks); + } + + using (var matchesVec = new VectorOfVectorDMatch()) + { + NativeMethods.features2d_DescriptorMatcher_radiusMatch2( + ptr, queryDescriptors.CvPtr, matchesVec.CvPtr, maxDistance, + masksPtrs, masksPtrs.Length, compactResult ? 1 : 0); + return matchesVec.ToArray(); + } + } + + #endregion + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/features2d/Enum/AGASTType.cs b/src/OpenCvSharp/modules/features2d/Enum/AGASTType.cs new file mode 100644 index 000000000..7fa19c79b --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/Enum/AGASTType.cs @@ -0,0 +1,18 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming +#pragma warning disable 1591 + + /// + /// AGAST type one of the four neighborhoods as defined in the paper + /// + public enum AGASTType : int + { + AGAST_5_8 = 0, + AGAST_7_12d = 1, + AGAST_7_12s = 2, + OAST_9_16 = 3, + } +} diff --git a/src/OpenCvSharp/modules/features2d/Enum/AKAZEDescriptorType.cs b/src/OpenCvSharp/modules/features2d/Enum/AKAZEDescriptorType.cs new file mode 100644 index 000000000..13d796396 --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/Enum/AKAZEDescriptorType.cs @@ -0,0 +1,33 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + /// + /// cv::AKAZE descriptor type + /// + + public enum AKAZEDescriptorType : int + { + /// + /// Upright descriptors, not invariant to rotation + /// + KAZEUpright = 2, + + /// + /// + /// + KAZE = 3, + + /// + /// + /// + MLDBUpright = 4, + + /// + /// Upright descriptors, not invariant to rotation + /// + MLDB = 5 + } +} diff --git a/src/OpenCvSharp/modules/features2d/Enum/DrawMatchesFlags.cs b/src/OpenCvSharp/modules/features2d/Enum/DrawMatchesFlags.cs new file mode 100644 index 000000000..ba39ff0af --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/Enum/DrawMatchesFlags.cs @@ -0,0 +1,39 @@ +using System; + +namespace OpenCvSharp +{ + /// + /// + /// + [Flags] + public enum DrawMatchesFlags : int + { + /// + /// Output image matrix will be created (Mat::create), + /// i.e. existing memory of output image may be reused. + /// Two source image, matches and single keypoints will be drawn. + /// For each keypoint only the center point will be drawn (without + /// the circle around keypoint with keypoint size and orientation). + /// + Default = 0, + + /// + /// Output image matrix will not be created (Mat::create). + /// Matches will be drawn on existing content of output image. + /// + DrawOverOutImg = 1, + + /// + /// Single keypoints will not be drawn. + /// + NotDrawSinglePoints = 2, + + /// + /// For each keypoint the circle around keypoint with keypoint size and + /// orientation will be drawn. + /// + DrawRichKeypoints = 4 + } +} + + diff --git a/src/OpenCvSharp/modules/features2d/Enum/FASTType.cs b/src/OpenCvSharp/modules/features2d/Enum/FASTType.cs new file mode 100644 index 000000000..ea9775d37 --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/Enum/FASTType.cs @@ -0,0 +1,17 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming +#pragma warning disable 1591 + + /// + /// AGAST type one of the four neighborhoods as defined in the paper + /// + public enum FASTType : int + { + TYPE_5_8 = 0, + TYPE_7_12 = 1, + TYPE_9_16 = 2, + } +} diff --git a/src/OpenCvSharp/modules/features2d/Enum/KAZEDiffusivity.cs b/src/OpenCvSharp/modules/features2d/Enum/KAZEDiffusivity.cs new file mode 100644 index 000000000..96cc3ca82 --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/Enum/KAZEDiffusivity.cs @@ -0,0 +1,31 @@ +using System; + +namespace OpenCvSharp +{ + /// + /// cv::KAZE diffusivity type + /// +// ReSharper disable once InconsistentNaming + public enum KAZEDiffusivity : int + { + /// + /// + /// + DiffPmG1 = 0, + + /// + /// + /// + DiffPmG2 = 1, + + /// + /// + /// + DiffWeickert = 2, + + /// + /// + /// + DiffCharbonnier = 3, + } +} diff --git a/src/OpenCvSharp/modules/features2d/Enum/ORBScore.cs b/src/OpenCvSharp/modules/features2d/Enum/ORBScore.cs new file mode 100644 index 000000000..403136d54 --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/Enum/ORBScore.cs @@ -0,0 +1,21 @@ +using System; + + +namespace OpenCvSharp +{ + /// + /// cv::ORB score flags + /// + public enum ORBScore : int + { + /// + /// + /// + Fast = 1, + + /// + /// + /// + Harris = 0, + } +} diff --git a/src/OpenCvSharp/modules/features2d/FastFeatureDetector.cs b/src/OpenCvSharp/modules/features2d/FastFeatureDetector.cs new file mode 100644 index 000000000..35bbc0fc5 --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/FastFeatureDetector.cs @@ -0,0 +1,151 @@ +using System; +using System.Collections.Generic; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// Detects corners using FAST algorithm by E. Rosten + /// +#else + /// + /// Detects corners using FAST algorithm by E. Rosten + /// +#endif + public class FastFeatureDetector : Feature2D + { + private bool disposed; + private Ptr ptrObj; + + #region Init & Disposal + + /// + /// + /// + protected FastFeatureDetector(IntPtr ptr) + { + ptrObj = new Ptr(ptr); + ptr = ptrObj.Get(); + } + + /// + /// + /// + /// + /// + public static FastFeatureDetector Create(int threshold = 10, bool nonmaxSuppression = true) + { + IntPtr ptr = NativeMethods.features2d_FastFeatureDetector_create(threshold, nonmaxSuppression ? 1 : 0); + return new FastFeatureDetector(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + // releases unmanaged resources + + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + + /// + /// + /// + public int Threshold + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_FastFeatureDetector_getThreshold(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_FastFeatureDetector_setThreshold(ptr, value); + } + } + + /// + /// + /// + public bool NonmaxSuppression + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_FastFeatureDetector_getNonmaxSuppression(ptr) != 0; + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_FastFeatureDetector_setNonmaxSuppression(ptr, value ? 1 : 0); + } + } + + /// + /// + /// + public int Type + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_FastFeatureDetector_getType(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_FastFeatureDetector_setType(ptr, value); + } + } + + #endregion + + #region Methods + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/features2d/Feature2D.cs b/src/OpenCvSharp/modules/features2d/Feature2D.cs new file mode 100644 index 000000000..c2d1d5a85 --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/Feature2D.cs @@ -0,0 +1,348 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// Abstract base class for 2D image feature detectors and descriptor extractors + /// + public class Feature2D : Algorithm + { + private bool disposed; + + /// + /// cv::Ptr<Feature2D> + /// + private Ptr ptrObj; + + /// + /// + /// + internal Feature2D() + : base() + { + } + + /// + /// Creates instance from cv::Ptr<T> . + /// ptr is disposed when the wrapper disposes. + /// + /// + internal static Feature2D FromPtr(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Invalid cv::Ptr pointer"); + var ptrObj = new Ptr(ptr); + var detector = new Feature2D + { + ptrObj = ptrObj, + ptr = ptrObj.Get() + }; + return detector; + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + } + // releases unmanaged resources + if (IsEnabledDispose) + { + if (ptrObj != null) + ptrObj.Dispose(); + ptrObj = null; + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + /// + /// + /// + /// + public virtual int DescriptorSize + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_Feature2D_descriptorSize(ptr); + } + } + + /// + /// + /// + /// + public virtual int DescriptorType + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_Feature2D_descriptorType(ptr); + } + } + + /// + /// + /// + /// + public virtual int DefaultNorm + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_Feature2D_defaultNorm(ptr); + } + } + + /// + /// Return true if detector object is empty + /// + /// + public new virtual bool Empty() + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_Feature2D_empty(ptr) != 0; + } + + /// + /// Detect keypoints in an image. + /// + /// The image. + /// Mask specifying where to look for keypoints (optional). + /// Must be a char matrix with non-zero values in the region of interest. + /// The detected keypoints. + public KeyPoint[] Detect(Mat image, Mat mask = null) + { + if (image == null) + throw new ArgumentNullException("image"); + if (disposed) + throw new ObjectDisposedException(GetType().Name); + + image.ThrowIfDisposed(); + try + { + using (var keypoints = new VectorOfKeyPoint()) + { + NativeMethods.features2d_Feature2D_detect_Mat1(ptr, image.CvPtr, keypoints.CvPtr, Cv2.ToPtr(mask)); + return keypoints.ToArray(); + } + } + finally + { + GC.KeepAlive(image); + GC.KeepAlive(mask); + } + } + + /// + /// Detect keypoints in an image. + /// + /// The image. + /// Mask specifying where to look for keypoints (optional). + /// Must be a char matrix with non-zero values in the region of interest. + /// The detected keypoints. + public KeyPoint[] Detect(InputArray image, Mat mask = null) + { + if (image == null) + throw new ArgumentNullException("image"); + if (disposed) + throw new ObjectDisposedException(GetType().Name); + + image.ThrowIfDisposed(); + try + { + using (var keypoints = new VectorOfKeyPoint()) + { + NativeMethods.features2d_Feature2D_detect_InputArray(ptr, image.CvPtr, keypoints.CvPtr, + Cv2.ToPtr(mask)); + return keypoints.ToArray(); + } + } + finally + { + GC.KeepAlive(image); + GC.KeepAlive(mask); + } + } + + /// + /// Detect keypoints in an image set. + /// + /// Image collection. + /// Masks for image set. masks[i] is a mask for images[i]. + /// Collection of keypoints detected in an input images. keypoints[i] is a set of keypoints detected in an images[i]. + public KeyPoint[][] Detect(IEnumerable images, IEnumerable masks = null) + { + if (images == null) + throw new ArgumentNullException("images"); + if (disposed) + throw new ObjectDisposedException(GetType().Name); + + Mat[] imagesArray = EnumerableEx.ToArray(images); + IntPtr[] imagesPtr = new IntPtr[imagesArray.Length]; + for (int i = 0; i < imagesArray.Length; i++) + imagesPtr[i] = imagesArray[i].CvPtr; + + using (var keypoints = new VectorOfVectorKeyPoint()) + { + if (masks == null) + { + NativeMethods.features2d_Feature2D_detect_Mat2( + ptr, imagesPtr, imagesArray.Length, keypoints.CvPtr, null); + } + else + { + IntPtr[] masksPtr = EnumerableEx.SelectPtrs(masks); + if (masksPtr.Length != imagesArray.Length) + throw new ArgumentException("masks.Length != images.Length"); + NativeMethods.features2d_Feature2D_detect_Mat2( + ptr, imagesPtr, imagesArray.Length, keypoints.CvPtr, masksPtr); + } + return keypoints.ToArray(); + } + } + + /// + /// Compute the descriptors for a set of keypoints in an image. + /// + /// The image. + /// The input keypoints. Keypoints for which a descriptor cannot be computed are removed. + /// Copmputed descriptors. Row i is the descriptor for keypoint i.param> + public virtual void Compute(InputArray image, ref KeyPoint[] keypoints, OutputArray descriptors) + { + if (image == null) + throw new ArgumentNullException("image"); + if (disposed) + throw new ObjectDisposedException(GetType().Name); + + using (var keypointsVec = new VectorOfKeyPoint(keypoints)) + { + NativeMethods.features2d_Feature2D_compute1(ptr, image.CvPtr, keypointsVec.CvPtr, descriptors.CvPtr); + keypoints = keypointsVec.ToArray(); + } + } + + /// + /// Compute the descriptors for a set of keypoints in an image. + /// + /// The image. + /// The input keypoints. Keypoints for which a descriptor cannot be computed are removed. + /// + /// Copmputed descriptors. Row i is the descriptor for keypoint i.param> + public virtual void Compute(InputArray image, KeyPoint[] inKeypoints, out KeyPoint[] outKeypoints, + OutputArray descriptors) + { + if (image == null) + throw new ArgumentNullException("image"); + if (disposed) + throw new ObjectDisposedException(GetType().Name); + + using (var keypointsVec = new VectorOfKeyPoint(inKeypoints)) + { + NativeMethods.features2d_Feature2D_compute1(ptr, image.CvPtr, keypointsVec.CvPtr, descriptors.CvPtr); + outKeypoints = keypointsVec.ToArray(); + } + } + + /// + /// Compute the descriptors for a keypoints collection detected in image collection. + /// + /// Image collection. + /// Input keypoints collection. keypoints[i] is keypoints detected in images[i]. + /// Keypoints for which a descriptor cannot be computed are removed. + /// Descriptor collection. descriptors[i] are descriptors computed for set keypoints[i]. + public virtual void Compute(IEnumerable images, ref KeyPoint[][] keypoints, IEnumerable descriptors) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (images == null) + throw new ArgumentNullException("images"); + if (descriptors == null) + throw new ArgumentNullException("descriptors"); + + IntPtr[] imagesPtrs = EnumerableEx.SelectPtrs(images); + IntPtr[] descriptorsPtrs = EnumerableEx.SelectPtrs(descriptors); + + using (var keypointsVec = new VectorOfVectorKeyPoint(keypoints)) + { + NativeMethods.features2d_Feature2D_compute2( + ptr, imagesPtrs, imagesPtrs.Length, keypointsVec.CvPtr, + descriptorsPtrs, descriptorsPtrs.Length); + + keypoints = keypointsVec.ToArray(); + } + } + + /// + /// Detects keypoints and computes the descriptors + /// + /// + /// + /// + /// + /// + public virtual void DetectAndCompute( + InputArray image, + InputArray mask, + out KeyPoint[] keypoints, + OutputArray descriptors, + bool useProvidedKeypoints = false) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (image == null) + throw new ArgumentNullException("image"); + if (descriptors == null) + throw new ArgumentNullException("descriptors"); + image.ThrowIfDisposed(); + if (mask != null) + mask.ThrowIfDisposed(); + + using (var keypointsVec = new VectorOfKeyPoint()) + { + NativeMethods.features2d_Feature2D_detectAndCompute( + ptr, image.CvPtr, Cv2.ToPtr(mask), keypointsVec.CvPtr, descriptors.CvPtr, useProvidedKeypoints ? 1 : 0); + keypoints = keypointsVec.ToArray(); + } + + GC.KeepAlive(image); + GC.KeepAlive(mask); + descriptors.Fix(); + } + } +} diff --git a/src/OpenCvSharp/modules/features2d/FlannBasedMatcher.cs b/src/OpenCvSharp/modules/features2d/FlannBasedMatcher.cs new file mode 100644 index 000000000..78a0b17bf --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/FlannBasedMatcher.cs @@ -0,0 +1,170 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Flann; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + // ReSharper disable once InconsistentNaming + + /// + /// Brute-force descriptor matcher. + /// For each descriptor in the first set, this matcher finds the closest descriptor in the second set by trying each one. + /// + public class FlannBasedMatcher : DescriptorMatcher + { + private bool disposed; + private Ptr detectorPtr; + + #region Init & Disposal + + /// + /// + /// + /// + /// + public FlannBasedMatcher(IndexParams indexParams = null, SearchParams searchParams = null) + { + ptr = NativeMethods.features2d_FlannBasedMatcher_new( + Cv2.ToPtr(indexParams), Cv2.ToPtr(searchParams)); + } + + /// + /// Creates instance by cv::Ptr<T> + /// + internal FlannBasedMatcher(Ptr detectorPtr) + { + this.detectorPtr = detectorPtr; + this.ptr = detectorPtr.Get(); + } + + /// + /// Creates instance by raw pointer T* + /// + internal FlannBasedMatcher(IntPtr rawPtr) + { + detectorPtr = null; + ptr = rawPtr; + } + + /// + /// Creates instance from cv::Ptr<T> . + /// ptr is disposed when the wrapper disposes. + /// + /// + internal new static FlannBasedMatcher FromPtr(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Invalid cv::Ptr pointer"); + var ptrObj = new Ptr(ptr); + return new FlannBasedMatcher(ptrObj); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + } + // releases unmanaged resources + if (detectorPtr != null) + { + detectorPtr.Dispose(); + detectorPtr = null; + } + else + { + if (ptr != IntPtr.Zero) + NativeMethods.features2d_FlannBasedMatcher_delete(ptr); + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Methods + + /// + /// Return true if the matcher supports mask in match methods. + /// + /// + public override bool IsMaskSupported() + { + ThrowIfDisposed(); + return NativeMethods.features2d_FlannBasedMatcher_isMaskSupported(ptr) != 0; + } + + /// + /// Add descriptors to train descriptor collection. + /// + /// Descriptors to add. Each descriptors[i] is a descriptors set from one image. + public override void Add(IEnumerable descriptors) + { + ThrowIfDisposed(); + if (descriptors == null) + throw new ArgumentNullException("descriptors"); + + Mat[] descriptorsArray = EnumerableEx.ToArray(descriptors); + if (descriptorsArray.Length == 0) + return; + + IntPtr[] descriptorsPtrs = EnumerableEx.SelectPtrs(descriptorsArray); + NativeMethods.features2d_DescriptorMatcher_add(ptr, descriptorsPtrs, descriptorsPtrs.Length); + } + + /// + /// Clear train descriptors collection. + /// + public override void Clear() + { + ThrowIfDisposed(); + NativeMethods.features2d_FlannBasedMatcher_clear(ptr); + } + + /// + /// Train matcher (e.g. train flann index). + /// In all methods to match the method train() is run every time before matching. + /// Some descriptor matchers (e.g. BruteForceMatcher) have empty implementation + /// of this method, other matchers really train their inner structures + /// (e.g. FlannBasedMatcher trains flann::Index). So nonempty implementation + /// of train() should check the class object state and do traing/retraining + /// only if the state requires that (e.g. FlannBasedMatcher trains flann::Index + /// if it has not trained yet or if new descriptors have been added to the train collection). + /// + public override void Train() + { + ThrowIfDisposed(); + NativeMethods.features2d_FlannBasedMatcher_train(ptr); + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/features2d/GFTTDetector.cs b/src/OpenCvSharp/modules/features2d/GFTTDetector.cs new file mode 100644 index 000000000..6c167ba5f --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/GFTTDetector.cs @@ -0,0 +1,217 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp +{ + // ReSharper disable once InconsistentNaming + + /// + /// Good Features To Track Detector + /// + public class GFTTDetector : Feature2D + { + private bool disposed; + private Ptr ptrObj; + + #region Init & Disposal + + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static GFTTDetector Create( + int maxCorners = 1000, double qualityLevel = 0.01, double minDistance = 1, + int blockSize = 3, bool useHarrisDetector = false, double k = 0.04) + { + IntPtr ptr = NativeMethods.features2d_GFTTDetector_create( + maxCorners, qualityLevel, minDistance, + blockSize, useHarrisDetector ? 1 : 0, k); + return new GFTTDetector(ptr); + } + + /// + /// + /// + /// + protected GFTTDetector(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + // releases unmanaged resources + + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + + /// + /// + /// + public int MaxFeatures + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_GFTTDetector_getMaxFeatures(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_GFTTDetector_setMaxFeatures(ptr, value); + } + } + + /// + /// + /// + public double QualityLevel + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_GFTTDetector_getQualityLevel(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_GFTTDetector_setQualityLevel(ptr, value); + } + } + + /// + /// + /// + public double MinDistance + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_GFTTDetector_getMinDistance(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_GFTTDetector_setMinDistance(ptr, value); + } + } + + + /// + /// + /// + public int BlockSize + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_GFTTDetector_getBlockSize(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_GFTTDetector_setBlockSize(ptr, value); + } + } + + + /// + /// + /// + public bool HarrisDetector + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_GFTTDetector_getHarrisDetector(ptr) != 0; + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_GFTTDetector_setHarrisDetector(ptr, value ? 1 : 0); + } + } + + + /// + /// + /// + public double K + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_GFTTDetector_getK(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_GFTTDetector_setK(ptr, value); + } + } + + #endregion + + #region Methods + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/features2d/KAZE.cs b/src/OpenCvSharp/modules/features2d/KAZE.cs new file mode 100644 index 000000000..4115a17db --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/KAZE.cs @@ -0,0 +1,221 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable once InconsistentNaming + +#if LANG_JP + /// + /// KAZE 実装 + /// +#else + /// + /// Class implementing the KAZE keypoint detector and descriptor extractor + /// +#endif + public class KAZE : Feature2D + { + private bool disposed; + private Ptr ptrObj; + + #region Init & Disposal + + /// + /// + /// + protected KAZE(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// The KAZE constructor + /// + /// Set to enable extraction of extended (128-byte) descriptor. + /// Set to enable use of upright descriptors (non rotation-invariant). + /// Detector response threshold to accept point + /// Maximum octave evolution of the image + /// Default number of sublevels per scale level + /// Diffusivity type. DIFF_PM_G1, DIFF_PM_G2, DIFF_WEICKERT or DIFF_CHARBONNIER + public static KAZE Create( + bool extended = false, bool upright = false, float threshold = 0.001f, + int nOctaves = 4, int nOctaveLayers = 4, KAZEDiffusivity diffusivity = KAZEDiffusivity.DiffPmG2) + { + IntPtr ptr = NativeMethods.features2d_KAZE_create( + extended, upright, threshold, + nOctaves, nOctaveLayers, (int) diffusivity); + return new KAZE(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + // releases unmanaged resources + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + + /// + /// + /// + public int Diffusivity + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_KAZE_getDiffusivity(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_KAZE_setDiffusivity(ptr, value); + } + } + + /// + /// + /// + public bool Extended + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_KAZE_getExtended(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_KAZE_setExtended(ptr, value); + } + } + + + /// + /// + /// + public int NOctaveLayers + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_KAZE_getNOctaveLayers(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_KAZE_setNOctaveLayers(ptr, value); + } + } + + + /// + /// + /// + public int NOctaves + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_KAZE_getNOctaves(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_KAZE_setNOctaves(ptr, value); + } + } + + + /// + /// + /// + public double Threshold + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_KAZE_getThreshold(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_KAZE_setThreshold(ptr, value); + } + } + + + /// + /// + /// + public bool Upright + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_KAZE_getUpright(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_KAZE_setUpright(ptr, value); + } + } + + #endregion + + #region Methods + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/features2d/KeyPointsFilter.cs b/src/OpenCvSharp/modules/features2d/KeyPointsFilter.cs new file mode 100644 index 000000000..70566c035 --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/KeyPointsFilter.cs @@ -0,0 +1,113 @@ +using System; +using System.Collections.Generic; + +namespace OpenCvSharp +{ + // ReSharper disable once InconsistentNaming + + /// + /// A class filters a vector of keypoints. + /// + public static class KeyPointsFilter + { + /// + /// Remove keypoints within borderPixels of an image edge. + /// + /// + /// + /// + /// + public static KeyPoint[] RunByImageBorder(IEnumerable keypoints, Size imageSize, int borderSize) + { + if (keypoints == null) + throw new ArgumentNullException("keypoints"); + + using (var keypointsVec = new VectorOfKeyPoint(keypoints)) + { + NativeMethods.features2d_KeyPointsFilter_runByImageBorder( + keypointsVec.CvPtr, imageSize, borderSize); + return keypointsVec.ToArray(); + } + } + + /// + /// Remove keypoints of sizes out of range. + /// + /// + /// + /// + /// + public static KeyPoint[] RunByKeypointSize(IEnumerable keypoints, float minSize, + float maxSize = Single.MaxValue) + { + if (keypoints == null) + throw new ArgumentNullException("keypoints"); + + using (var keypointsVec = new VectorOfKeyPoint(keypoints)) + { + NativeMethods.features2d_KeyPointsFilter_runByKeypointSize( + keypointsVec.CvPtr, minSize, maxSize); + return keypointsVec.ToArray(); + } + } + + /// + /// Remove keypoints from some image by mask for pixels of this image. + /// + /// + /// + /// + public static KeyPoint[] RunByPixelsMask(IEnumerable keypoints, Mat mask) + { + if (keypoints == null) + throw new ArgumentNullException("keypoints"); + if (mask == null) + throw new ArgumentNullException("mask"); + mask.ThrowIfDisposed(); + + using (var keypointsVec = new VectorOfKeyPoint(keypoints)) + { + NativeMethods.features2d_KeyPointsFilter_runByPixelsMask( + keypointsVec.CvPtr, mask.CvPtr); + GC.KeepAlive(mask); + return keypointsVec.ToArray(); + } + } + + /// + /// Remove duplicated keypoints. + /// + /// + /// + public static KeyPoint[] RemoveDuplicated(IEnumerable keypoints) + { + if (keypoints == null) + throw new ArgumentNullException("keypoints"); + + using (var keypointsVec = new VectorOfKeyPoint(keypoints)) + { + NativeMethods.features2d_KeyPointsFilter_removeDuplicated(keypointsVec.CvPtr); + return keypointsVec.ToArray(); + } + } + + /// + /// Retain the specified number of the best keypoints (according to the response) + /// + /// + /// + /// + public static KeyPoint[] RetainBest(IEnumerable keypoints, int npoints) + { + if (keypoints == null) + throw new ArgumentNullException("keypoints"); + + using (var keypointsVec = new VectorOfKeyPoint(keypoints)) + { + NativeMethods.features2d_KeyPointsFilter_retainBest( + keypointsVec.CvPtr, npoints); + return keypointsVec.ToArray(); + } + } + } +} diff --git a/src/OpenCvSharp/modules/features2d/MSER.cs b/src/OpenCvSharp/modules/features2d/MSER.cs new file mode 100644 index 000000000..e2532311e --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/MSER.cs @@ -0,0 +1,233 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace OpenCvSharp +{ +// ReSharper disable once InconsistentNaming + +#if LANG_JP + /// + /// MSER (Maximal Stable Extremal Regions) 抽出機 + /// +#else + /// + /// Maximal Stable Extremal Regions class + /// +#endif + public class MSER : Feature2D + { + private bool disposed; + private Ptr ptrObj; + + #region Init & Disposal + + /// + /// Creates instance by raw pointer cv::MSER* + /// + protected MSER(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + +#if LANG_JP + /// + /// MSERのパラメータを生成する + /// + /// delta, in the code, it compares (size_{i}-size_{i-delta})/size_{i-delta} + /// prune the area which smaller than min_area + /// prune the area which bigger than max_area + /// prune the area have simliar size to its children + /// trace back to cut off mser with diversity < min_diversity + /// for color image, the evolution steps + /// the area threshold to cause re-initialize + /// ignore too small margin + /// the aperture size for edge blur +#else + /// + /// Creates MSER parameters + /// + /// delta, in the code, it compares (size_{i}-size_{i-delta})/size_{i-delta} + /// prune the area which smaller than min_area + /// prune the area which bigger than max_area + /// prune the area have simliar size to its children + /// trace back to cut off mser with diversity < min_diversity + /// for color image, the evolution steps + /// the area threshold to cause re-initialize + /// ignore too small margin + /// the aperture size for edge blur +#endif + public static MSER Create( + int delta = 5, + int minArea = 60, + int maxArea = 14400, + double maxVariation = 0.25, + double minDiversity = 0.2, + int maxEvolution = 200, + double areaThreshold = 1.01, + double minMargin = 0.003, + int edgeBlurSize = 5) + { + IntPtr ptr = NativeMethods.features2d_MSER_create(delta, minArea, maxArea, maxVariation, minDiversity, + maxEvolution, areaThreshold, minMargin, edgeBlurSize); + return new MSER(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + // releases unmanaged resources + + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + + /// + /// + /// + public int Delta + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_MSER_getDelta(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_MSER_setDelta(ptr, value); + } + } + + /// + /// + /// + public int MinArea + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_MSER_getMinArea(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_MSER_setMinArea(ptr, value); + } + } + + /// + /// + /// + public int MaxArea + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_MSER_getMaxArea(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_MSER_setMaxArea(ptr, value); + } + } + + /// + /// + /// + public bool Pass2Only + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_MSER_getPass2Only(ptr) != 0; + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_MSER_setDelta(ptr, value ? 1 : 0); + } + } + + #endregion + + #region Methods + + /// + /// + /// + /// + /// + /// + public virtual void DetectRegions( + InputArray image, out Point[][] msers, out Rect[] bboxes) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (image == null) + throw new ArgumentNullException("image"); + image.ThrowIfDisposed(); + + using (var msersVec = new VectorOfVectorPoint()) + using (var bboxesVec = new VectorOfRect()) + { + NativeMethods.features2d_MSER_detectRegions( + ptr, image.CvPtr, msersVec.CvPtr, bboxesVec.CvPtr); + msers = msersVec.ToArray(); + bboxes = bboxesVec.ToArray(); + } + + GC.KeepAlive(image); + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/features2d/ORB.cs b/src/OpenCvSharp/modules/features2d/ORB.cs new file mode 100644 index 000000000..cd7af8696 --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/ORB.cs @@ -0,0 +1,291 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable once InconsistentNaming + +#if LANG_JP + /// + /// ORB 実装 + /// +#else + /// + /// Class implementing the ORB (*oriented BRIEF*) keypoint detector and descriptor extractor + /// + /// + /// described in @cite RRKB11 . The algorithm uses FAST in pyramids to detect stable keypoints, + /// selects the strongest features using FAST or Harris response, finds their orientation + /// using first-order moments and computes the descriptors using BRIEF (where the coordinates + /// of random point pairs (or k-tuples) are rotated according to the measured orientation). + /// +#endif + public class ORB : Feature2D + { + private bool disposed; + private Ptr ptrObj; + + #region Init & Disposal + + /// + /// + /// + protected ORB(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static ORB Create( + int nFeatures = 500, float scaleFactor = 1.2f, int nLevels = 8, + int edgeThreshold = 31, int firstLevel = 0, int wtaK = 2, + ORBScore scoreType = ORBScore.Harris, int patchSize = 31) + { + IntPtr ptr = NativeMethods.features2d_ORB_create( + nFeatures, scaleFactor, nLevels, edgeThreshold, + firstLevel, wtaK, (int)scoreType, patchSize); + return new ORB(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + // releases unmanaged resources + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + + /// + /// + /// + public int MaxFeatures + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_ORB_getMaxFeatures(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_ORB_setMaxFeatures(ptr, value); + } + } + + /// + /// + /// + public double ScaleFactor + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_ORB_getScaleFactor(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_ORB_setScaleFactor(ptr, value); + } + } + + + /// + /// + /// + public int NLevels + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_ORB_getNLevels(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_ORB_setNLevels(ptr, value); + } + } + + + /// + /// + /// + public int EdgeThreshold + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_ORB_getEdgeThreshold(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_ORB_setEdgeThreshold(ptr, value); + } + } + + + /// + /// + /// + public int FirstLevel + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_ORB_getFirstLevel(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_ORB_setFirstLevel(ptr, value); + } + } + + + /// + /// + /// +// ReSharper disable once InconsistentNaming + public int WTA_K + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_ORB_getWTA_K(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_ORB_setWTA_K(ptr, value); + } + } + + + /// + /// + /// + public int ScoreType + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_ORB_getScoreType(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_ORB_setScoreType(ptr, value); + } + } + + + /// + /// + /// + public int PatchSize + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_ORB_getPatchSize(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_ORB_setPatchSize(ptr, value); + } + } + + + /// + /// + /// + public int FastThreshold + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.features2d_ORB_getFastThreshold(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.features2d_ORB_setFastThreshold(ptr, value); + } + } + + #endregion + + #region Methods + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/features2d/SimpleBlobDetector.cs b/src/OpenCvSharp/modules/features2d/SimpleBlobDetector.cs new file mode 100644 index 000000000..4825ce02e --- /dev/null +++ b/src/OpenCvSharp/modules/features2d/SimpleBlobDetector.cs @@ -0,0 +1,246 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ + /// + /// Class for extracting blobs from an image. + /// + public class SimpleBlobDetector : Feature2D + { + private bool disposed; + private Ptr ptrObj; + + /// + /// SimpleBlobDetector parameters + /// + public class Params + { + internal WParams data; + + /// + /// + /// + public Params() + { + data = new WParams + { + thresholdStep = 10, + minThreshold = 50, + maxThreshold = 220, + minRepeatability = 2, + minDistBetweenBlobs = 10, + filterByColor = 1, + blobColor = 0, + filterByArea = 1, + minArea = 25, + maxArea = 5000, + filterByCircularity = 0, + minCircularity = 0.8f, + maxCircularity = Single.MaxValue, + filterByInertia = 1, + minInertiaRatio = 0.1f, + maxInertiaRatio = Single.MaxValue, + filterByConvexity = 1, + minConvexity = 0.95f, + maxConvexity = Single.MaxValue + }; + } + +#pragma warning disable 1591 + public float ThresholdStep + { + get { return data.thresholdStep; } + set { data.thresholdStep = value; } + } + public float MinThreshold + { + get { return data.minThreshold; } + set { data.minThreshold = value; } + } + public float MaxThreshold + { + get { return data.maxThreshold; } + set { data.maxThreshold = value; } + } + public uint MinRepeatability + { + get { return data.minRepeatability; } + set { data.minRepeatability = value; } + } + public float MinDistBetweenBlobs + { + get { return data.minDistBetweenBlobs; } + set { data.minDistBetweenBlobs = value; } + } + + public bool FilterByColor + { + get { return data.filterByColor != 0; } + set { data.filterByColor = (value ? 1 : 0); } + } + public byte BlobColor + { + get { return data.blobColor; } + set { data.blobColor = value; } + } + + public bool FilterByArea + { + get { return data.filterByArea != 0; } + set { data.filterByArea = (value ? 1 : 0); } + } + public float MinArea{ + get { return data.minArea; } + set { data.minArea = value; } + } + public float MaxArea + { + get { return data.maxArea; } + set { data.maxArea = value; } + } + + public bool FilterByCircularity + { + get { return data.filterByCircularity != 0; } + set { data.filterByCircularity = (value ? 1 : 0); } + } + public float MinCircularity{ + get { return data.minCircularity; } + set { data.minCircularity = value; } + } + public float MaxCircularity + { + get { return data.maxCircularity; } + set { data.maxCircularity = value; } + } + + public bool FilterByInertia + { + get { return data.filterByInertia != 0; } + set { data.filterByInertia = (value ? 1 : 0); } + } + public float MinInertiaRatio{ + get { return data.minInertiaRatio; } + set { data.minInertiaRatio = value; } + } + public float MaxInertiaRatio + { + get { return data.maxInertiaRatio; } + set { data.maxInertiaRatio = value; } + } + + public bool FilterByConvexity + { + get { return data.filterByConvexity != 0; } + set { data.filterByConvexity = (value ? 1 : 0); } + } + public float MinConvexity{ + get { return data.minConvexity; } + set { data.minConvexity = value; } + } + public float MaxConvexity + { + get { return data.maxConvexity; } + set { data.maxConvexity = value; } + } + } + + [StructLayout(LayoutKind.Sequential)] + public struct WParams + { + public float thresholdStep; + public float minThreshold; + public float maxThreshold; + public uint minRepeatability; // size_t + public float minDistBetweenBlobs; + + public int filterByColor; + public byte blobColor; + + public int filterByArea; + public float minArea, maxArea; + + public int filterByCircularity; + public float minCircularity, maxCircularity; + + public int filterByInertia; + public float minInertiaRatio, maxInertiaRatio; + + public int filterByConvexity; + public float minConvexity, maxConvexity; +#pragma warning restore 1591 + } + + #region Init & Disposal + + /// + /// + /// + protected SimpleBlobDetector(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// + /// + /// + public static SimpleBlobDetector Create(Params parameters = null) + { + if (parameters == null) + parameters = new Params(); + IntPtr ptr = NativeMethods.features2d_SimpleBlobDetector_create(ref parameters.data); + return new SimpleBlobDetector(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + // releases unmanaged resources + + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Methods + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/flann/FlannCentersInit.cs b/src/OpenCvSharp/modules/flann/FlannCentersInit.cs new file mode 100644 index 000000000..db39e05e2 --- /dev/null +++ b/src/OpenCvSharp/modules/flann/FlannCentersInit.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp.Flann +{ + +#if LANG_JP + /// + /// k-means クラスタリングの初期中心を選択するアルゴリズム. + /// +#else + /// + /// The algorithm to use for selecting the initial centers when performing a k-means clustering step. + /// +#endif + public enum FlannCentersInit : int + { +#if LANG_JP + /// + /// ランダムに初期クラスタ中心を選択 + /// [flann_centers_init_t::CENTERS_RANDOM] + /// +#else + /// + /// picks the initial cluster centers randomly + /// [flann_centers_init_t::CENTERS_RANDOM] + /// +#endif + Random = 0, + +#if LANG_JP + /// + /// Gonzalesのアルゴリズムを用いて初期クラスタ中心を選択 + /// [flann_centers_init_t::CENTERS_GONZALES] + /// +#else + /// + /// picks the initial centers using Gonzales’ algorithm + /// [flann_centers_init_t::CENTERS_GONZALES] + /// +#endif + Gonzales = 1, + +#if LANG_JP + /// + /// arthur_kmeanspp_2007 で提案されたアルゴリズムを用いて初期クラスタ中心を選択 + /// [flann_centers_init_t::CENTERS_KMEANSPP] + /// +#else + /// + /// picks the initial centers using the algorithm suggested in [arthur_kmeanspp_2007] + /// [flann_centers_init_t::CENTERS_KMEANSPP] + /// +#endif + KMeansPP = 2 + + } +} + + diff --git a/src/OpenCvSharp/modules/flann/FlannDistance.cs b/src/OpenCvSharp/modules/flann/FlannDistance.cs new file mode 100644 index 000000000..7fb22ac76 --- /dev/null +++ b/src/OpenCvSharp/modules/flann/FlannDistance.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp.Flann +{ +#pragma warning disable 1591 +// ReSharper disable InconsistentNaming + + /// + /// + /// + public enum FlannDistance + { + Euclidean = 1, + L2 = 1, + Manhattan = 2, + L1 = 2, + Minkowski = 3, + Max = 4, + HistIntersect = 5, + Hellinger = 6, + ChiSquare = 7, + CS = 7, + KullbackLeibler = 8, + KL = 8, + Hamming = 9, + } +} diff --git a/src/OpenCvSharp/modules/flann/Index.cs b/src/OpenCvSharp/modules/flann/Index.cs new file mode 100644 index 000000000..4f4cc706a --- /dev/null +++ b/src/OpenCvSharp/modules/flann/Index.cs @@ -0,0 +1,352 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp.Flann +{ +#if LANG_JP + /// + /// FLANN 最近傍インデックスクラス + /// +#else + /// + /// The FLANN nearest neighbor index class. + /// +#endif + public class Index : DisposableCvObject + { + private bool disposed = false; + + #region Init & Disposal +#if LANG_JP + /// + /// 与えられたデータセットの最近傍探索インデックスを作成します. + /// + /// インデックス作成対象となる特徴(点)が格納された, CV_32F 型の行列.この行列のサイズは matrix is num _ features x feature _ dimensionality となります + /// params – インデックスパラメータを含む構造体.作成されるインデックスの種類は,このパラメータの種類に依存します + /// +#else + /// + /// Constructs a nearest neighbor search index for a given dataset. + /// + /// features – Matrix of type CV _ 32F containing the features(points) to index. The size of the matrix is num _ features x feature _ dimensionality. + /// Structure containing the index parameters. The type of index that will be constructed depends on the type of this parameter. + /// +#endif + public Index(InputArray features, IndexParams @params, FlannDistance distType = FlannDistance.L2) + { + if (features == null) + throw new ArgumentNullException("features"); + if (@params == null) + throw new ArgumentNullException("params"); + + ptr = NativeMethods.flann_Index_new(features.CvPtr, @params.CvPtr, (int)distType); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Failed to create Index"); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + NativeMethods.flann_Index_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Methods + #region KnnSearch +#if LANG_JP + /// + /// 複数のクエリ点に対するk-近傍探索を行います. + /// + /// クエリ点 + /// 求められた最近傍のインデックス + /// 求められた最近傍までの距離 + /// この個数分の最近傍を求めます + /// 探索パラメータ +#else + /// + /// Performs a K-nearest neighbor search for multiple query points. + /// + /// The query points, one per row + /// Indices of the nearest neighbors found + /// Distances to the nearest neighbors found + /// Number of nearest neighbors to search for + /// Search parameters +#endif + public void KnnSearch(float[] queries, out int[] indices, out float[] dists, int knn, SearchParams @params) + { + if (queries == null) + throw new ArgumentNullException("queries"); + if (@params == null) + throw new ArgumentNullException("params"); + if (queries.Length == 0) + throw new ArgumentException(); + if (knn < 1) + throw new ArgumentOutOfRangeException("knn"); + + indices = new int[knn]; + dists = new float[knn]; + + NativeMethods.flann_Index_knnSearch1(ptr, queries, queries.Length, indices, dists, knn, @params.CvPtr); + } +#if LANG_JP + /// + /// 複数のクエリ点に対するk-近傍探索を行います. + /// + /// クエリ点.1行が1つの点を表します + /// 求められた最近傍のインデックス + /// 求められた最近傍までの距離 + /// この個数分の最近傍を求めます + /// 探索パラメータ +#else + /// + /// Performs a K-nearest neighbor search for multiple query points. + /// + /// The query points, one per row + /// Indices of the nearest neighbors found + /// Distances to the nearest neighbors found + /// Number of nearest neighbors to search for + /// Search parameters +#endif + public void KnnSearch(Mat queries, Mat indices, Mat dists, int knn, SearchParams @params) + { + if (queries == null) + throw new ArgumentNullException("queries"); + if (indices == null) + throw new ArgumentNullException("indices"); + if (dists == null) + throw new ArgumentNullException("dists"); + if (@params == null) + throw new ArgumentNullException("params"); + + NativeMethods.flann_Index_knnSearch2(ptr, queries.CvPtr, indices.CvPtr, dists.CvPtr, knn, @params.CvPtr); + } +#if LANG_JP + /// + /// 複数のクエリ点に対するk-近傍探索を行います. + /// + /// クエリ点.1行が1つの点を表します + /// 求められた最近傍のインデックス + /// 求められた最近傍までの距離 + /// この個数分の最近傍を求めます + /// 探索パラメータ +#else + /// + /// Performs a K-nearest neighbor search for multiple query points. + /// + /// The query points, one per row + /// Indices of the nearest neighbors found + /// Distances to the nearest neighbors found + /// Number of nearest neighbors to search for + /// Search parameters +#endif + public void KnnSearch(Mat queries, out int[] indices, out float[] dists, int knn, SearchParams @params) + { + if (queries == null) + throw new ArgumentNullException("queries"); + if (@params == null) + throw new ArgumentNullException("params"); + if (knn < 1) + throw new ArgumentOutOfRangeException("knn"); + + indices = new int[knn]; + dists = new float[knn]; + + NativeMethods.flann_Index_knnSearch3(ptr, queries.CvPtr, indices, dists, knn, @params.CvPtr); + } + #endregion + #region RadiusSearch +#if LANG_JP + /// + /// 与えられたクエリ点に対するradius 最近傍探索を行います. + /// + /// クエリ点.1行が1つの点を表します [入力] + /// 求められた最近傍のインデックス [出力] + /// 求められた最近傍までの距離 [出力] + /// 探索範囲 + /// + /// 探索パラメータ +#else + /// + /// Performs a radius nearest neighbor search for a given query point. + /// + /// The query point + /// Indices of the nearest neighbors found + /// Distances to the nearest neighbors found + /// Number of nearest neighbors to search for + /// + /// Search parameters +#endif + public void RadiusSearch(float[] queries, int[] indices, float[] dists, float radius, int maxResults, SearchParams @params) + { + if (queries == null) + throw new ArgumentNullException("queries"); + if (indices == null) + throw new ArgumentNullException("indices"); + if (dists == null) + throw new ArgumentNullException("dists"); + if (@params == null) + throw new ArgumentNullException("params"); + + NativeMethods.flann_Index_radiusSearch1(ptr, queries, queries.Length, indices, indices.Length, dists, dists.Length, radius, maxResults, @params.CvPtr); + } +#if LANG_JP + /// + /// 与えられたクエリ点に対するradius 最近傍探索を行います. + /// + /// クエリ点.1行が1つの点を表します [入力] + /// 求められた最近傍のインデックス [出力] + /// 求められた最近傍までの距離 [出力] + /// 探索範囲 + /// + /// 探索パラメータ +#else + /// + /// Performs a radius nearest neighbor search for a given query point. + /// + /// The query point + /// Indices of the nearest neighbors found + /// Distances to the nearest neighbors found + /// Number of nearest neighbors to search for + /// + /// Search parameters +#endif + public void RadiusSearch(Mat queries, Mat indices, Mat dists, float radius, int maxResults, SearchParams @params) + { + if (queries == null) + throw new ArgumentNullException("queries"); + if (indices == null) + throw new ArgumentNullException("indices"); + if (dists == null) + throw new ArgumentNullException("dists"); + if (@params == null) + throw new ArgumentNullException("params"); + + NativeMethods.flann_Index_radiusSearch2(ptr, queries.CvPtr, indices.CvPtr, dists.CvPtr, radius, maxResults, @params.CvPtr); + } +#if LANG_JP + /// + /// 与えられたクエリ点に対するradius 最近傍探索を行います. + /// + /// クエリ点.1行が1つの点を表します [入力] + /// 求められた最近傍のインデックス [出力] + /// 求められた最近傍までの距離 [出力] + /// 探索範囲 + /// + /// 探索パラメータ +#else + /// + /// Performs a radius nearest neighbor search for a given query point. + /// + /// The query point + /// Indices of the nearest neighbors found + /// Distances to the nearest neighbors found + /// Number of nearest neighbors to search for + /// + /// Search parameters +#endif + public void RadiusSearch(Mat queries, int[] indices, float[] dists, float radius, int maxResults, SearchParams @params) + { + if (queries == null) + throw new ArgumentNullException("queries"); + if (indices == null) + throw new ArgumentNullException("indices"); + if (dists == null) + throw new ArgumentNullException("dists"); + if (@params == null) + throw new ArgumentNullException("params"); + + NativeMethods.flann_Index_radiusSearch3(ptr, queries.CvPtr, indices, indices.Length, dists, dists.Length, radius, maxResults, @params.CvPtr); + } + #endregion + #region Save +#if LANG_JP + /// + /// インデックスをファイルに保存します. + /// + /// インデックスを保存するファイル名 +#else + /// + /// Saves the index to a file. + /// + /// The file to save the index to +#endif + public void Save(string filename) + { + if (string.IsNullOrEmpty(filename)) + throw new ArgumentNullException("filename"); + NativeMethods.flann_Index_save(ptr, filename); + } + #endregion + /* + #region VecLen +#if LANG_JP + /// + /// + /// + /// +#else + /// + /// + /// + /// +#endif + public int VecLen() + { + return FlannInvoke.flann_Index_veclen(ptr); + } + #endregion + #region Size +#if LANG_JP + /// + /// + /// + /// +#else + /// + /// + /// + /// +#endif + public int Size() + { + return FlannInvoke.flann_Index_size(ptr); + } + #endregion + //*/ + #endregion + } +} diff --git a/src/OpenCvSharp/modules/flann/IndexParams/AutotunedIndexParams.cs b/src/OpenCvSharp/modules/flann/IndexParams/AutotunedIndexParams.cs new file mode 100644 index 000000000..55ee07ab1 --- /dev/null +++ b/src/OpenCvSharp/modules/flann/IndexParams/AutotunedIndexParams.cs @@ -0,0 +1,220 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp.Flann +{ +#if LANG_JP + /// + /// 階層型 k-means tree で表現されるインデックス. + /// +#else + /// + /// hierarchical k-means tree. + /// +#endif + public class AutotunedIndexParams : IndexParams + { + private bool disposed = false; + + #region Properties + /* +#if LANG_JP + /// + /// どれだけ厳密な最近傍を返すかという,最近傍探索の近似の割合を指定する 0から1の間の値. + /// このパラメータが大きくなると,より正確な結果が得られますが,探索時間が長くなります.最適な値は,アプリケーションに依存します + /// +#else + /// + /// Is a number between 0 and 1 specifying the percentage of the approximate nearest-neighbor searches that return the exact nearest-neighbor. + /// Using a higher value for this parameter gives more accurate results, but the search takes longer. + /// The optimum value usually depends on the application. + /// +#endif + public float TargetPrecision + { + get + { + unsafe + { + return *FlannInvoke.flann_AutotunedIndexParams_target_precision(ptr); + } + } + set + { + unsafe + { + *FlannInvoke.flann_AutotunedIndexParams_target_precision(ptr) = value; + } + } + } +#if LANG_JP + /// + /// 最近傍探索時間に対するインデックスの構築時間の重要度を指定します. + /// その後のインデックス探索時間が高速になるならば,インデックスの構築時間が長くても良いというアプリケーションが存在する一方で, + /// インデックスの探索時間が多少長くなっても,できるだけ高速にインデックスを構築する必要があるアプリケーションもあります + /// +#else + /// + /// Specifies the importance of the index build time raported to the nearest-neighbor search time. + /// In some applications it’s acceptable for the index build step to take a long time if the subsequent searches in the index can be performed very fast. + /// In other applications it’s required that the index be build as fast as possible even if that leads to slightly longer search times. + /// +#endif + public float BuildWeight + { + get + { + unsafe + { + return *FlannInvoke.flann_AutotunedIndexParams_build_weight(ptr); + } + } + set + { + unsafe + { + *FlannInvoke.flann_AutotunedIndexParams_build_weight(ptr) = value; + } + } + } +#if LANG_JP + /// + /// これは,(インデックスの構築時間と探索時間)とインデックスの占有メモリとの,トレードオフを指定するのに利用されます. + /// 1より小さい値は消費時間を重要視し,1より大きい値はメモリ使用量を重要視します + /// +#else + /// + /// Is used to specify the tradeoff between time (index build time and search time) and memory used by the index. + /// A value less than 1 gives more importance to the time spent and a value greater than 1 gives more importance to the memory usage. + /// +#endif + public float MemoryWeight + { + get + { + unsafe + { + return *FlannInvoke.flann_AutotunedIndexParams_memory_weight(ptr); + } + } + set + { + unsafe + { + *FlannInvoke.flann_AutotunedIndexParams_memory_weight(ptr) = value; + } + } + } +#if LANG_JP + /// + /// パラメータの自動設定アルゴリズムにおけるデータ集合の比率を示す,0から1の間の値. + /// 全データ集合を用いてアルゴリズムを実行すると,最も正確な結果が得られますが,巨大なデータ集合に対しては長い計算時間がかかります. + /// このような場合,データをある比率分だけ使うことでアルゴリズムを高速化し,なおかつ,最適なパラメータの良い近似となる結果を得ることができます + /// +#else + /// + /// Is a number between 0 and 1 indicating what fraction of the dataset to use in the automatic parameter configuration algorithm. + /// Running the algorithm on the full dataset gives the most accurate results, but for very large datasets can take longer than desired. In such case using just a fraction of the data helps speeding up this algorithm while still giving good approximations of the optimum parameters. + /// +#endif + public float SampleFraction + { + get + { + unsafe + { + return *FlannInvoke.flann_AutotunedIndexParams_sample_fraction(ptr); + } + } + set + { + unsafe + { + *FlannInvoke.flann_AutotunedIndexParams_sample_fraction(ptr) = value; + } + } + } + */ + #endregion + + #region Init & Disposal +#if LANG_JP + /// + /// + /// + /// どれだけ厳密な最近傍を返すかという,最近傍探索の近似の割合を指定する 0から1の間の値.このパラメータが大きくなると,より正確な結果が得られますが,探索時間が長くなります.最適な値は,アプリケーションに依存します + /// 最近傍探索時間に対するインデックスの構築時間の重要度を指定します. + /// その後のインデックス探索時間が高速になるならば,インデックスの構築時間が長くても良いというアプリケーションが存在する一方で,インデックスの探索時間が多少長くなっても,できるだけ高速にインデックスを構築する必要があるアプリケーションもあります + /// これは,(インデックスの構築時間と探索時間)とインデックスの占有メモリとの,トレードオフを指定するのに利用されます. + /// 1より小さい値は消費時間を重要視し,1より大きい値はメモリ使用量を重要視します + /// パラメータの自動設定アルゴリズムにおけるデータ集合の比率を示す,0から1の間の値. + /// 全データ集合を用いてアルゴリズムを実行すると,最も正確な結果が得られますが,巨大なデータ集合に対しては長い計算時間がかかります. + /// このような場合,データをある比率分だけ使うことでアルゴリズムを高速化し,なおかつ,最適なパラメータの良い近似となる結果を得ることができます +#else + /// + /// + /// + /// Is a number between 0 and 1 specifying the percentage of the approximate nearest-neighbor searches that return the exact nearest-neighbor. + /// Using a higher value for this parameter gives more accurate results, but the search takes longer. The optimum value usually depends on the application. + /// Specifies the importance of the index build time raported to the nearest-neighbor search time. + /// In some applications it’s acceptable for the index build step to take a long time if the subsequent searches in the index can be performed very fast. + /// In other applications it’s required that the index be build as fast as possible even if that leads to slightly longer search times. + /// Is used to specify the tradeoff between time (index build time and search time) and memory used by the index. + /// A value less than 1 gives more importance to the time spent and a value greater than 1 gives more importance to the memory usage. + /// Is a number between 0 and 1 indicating what fraction of the dataset to use in the automatic parameter configuration algorithm. + /// Running the algorithm on the full dataset gives the most accurate results, but for very large datasets can take longer than desired. + /// In such case using just a fraction of the data helps speeding up this algorithm while still giving good approximations of the optimum parameters. +#endif + public AutotunedIndexParams(float targetPrecision = 0.9f, float buildWeight = 0.01f, float memoryWeight = 0, float sampleFraction = 0.1f) + { + ptr = NativeMethods.flann_AutotunedIndexParams_new(targetPrecision, buildWeight, memoryWeight, sampleFraction); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Failed to create AutotunedIndexParams"); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + if (ptr != IntPtr.Zero) + { + NativeMethods.flann_AutotunedIndexParams_delete(ptr); + } + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + } +} diff --git a/src/OpenCvSharp/modules/flann/IndexParams/CompositeIndexParams.cs b/src/OpenCvSharp/modules/flann/IndexParams/CompositeIndexParams.cs new file mode 100644 index 000000000..8a4cc9d61 --- /dev/null +++ b/src/OpenCvSharp/modules/flann/IndexParams/CompositeIndexParams.cs @@ -0,0 +1,230 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp.Flann +{ +#if LANG_JP + /// + /// ランダム kd-tree と 階層的 k-means tree の組み合わせでインデックスが表現されます. + /// +#else + /// + /// When using a parameters object of this type the index created combines the randomized kd-trees and the hierarchical k-means tree. + /// +#endif + public class CompositeIndexParams : IndexParams + { + private bool disposed = false; + + #region Properties + /* +#if LANG_JP + /// + /// 並列な kd-tree の個数.[1..16] の範囲が適切な値です + /// +#else + /// + /// The number of parallel kd-trees to use. Good values are in the range [1..16] + /// +#endif + public int Trees + { + get + { + unsafe + { + return *FlannInvoke.flann_CompositeIndexParams_trees(ptr); + } + } + set + { + unsafe + { + *FlannInvoke.flann_CompositeIndexParams_trees(ptr) = value; + } + } + } +#if LANG_JP + /// + /// 階層型 k-means tree で利用される branching ファクタ + /// +#else + /// + /// The branching factor to use for the hierarchical k-means tree + /// +#endif + public int Branching + { + get + { + unsafe + { + return *FlannInvoke.flann_CompositeIndexParams_branching(ptr); + } + } + set + { + unsafe + { + *FlannInvoke.flann_CompositeIndexParams_branching(ptr) = value; + } + } + } +#if LANG_JP + /// + /// k-means tree を作成する際の,k-means クラスタリングステージでの反復数の上限.ここで -1 は,k-means クラスタリングが収束するまで続けられることを意味します + /// +#else + /// + /// The maximum number of iterations to use in the k-means clustering + /// stage when building the k-means tree. A value of -1 used here means that the k-means clustering should be iterated until convergence + /// +#endif + public int Iterations + { + get + { + unsafe + { + return *FlannInvoke.flann_CompositeIndexParams_iterations(ptr); + } + } + set + { + unsafe + { + *FlannInvoke.flann_CompositeIndexParams_iterations(ptr) = value; + } + } + } +#if LANG_JP + /// + /// k-means クラスタリングの初期中心を選択するアルゴリズム. + /// +#else + /// + /// The algorithm to use for selecting the initial centers when performing a k-means clustering step. + /// +#endif + public FlannCentersInit CentersInit + { + get + { + unsafe + { + return *FlannInvoke.flann_CompositeIndexParams_centers_init(ptr); + } + } + set + { + unsafe + { + *FlannInvoke.flann_CompositeIndexParams_centers_init(ptr) = value; + } + } + } +#if LANG_JP + /// + /// このパラメータ(クラスタ境界インデックス)は,階層的 k-means tree の探索方法に影響を与えます. + /// cb_index が0の場合,最も近い中心のクラスタが,次に探索される k-means 領域になります.0より大きい値の場合も,領域サイズが考慮されます + /// +#else + /// + /// This parameter (cluster boundary index) influences the + /// way exploration is performed in the hierarchical kmeans tree. When cb_index is zero the next kmeans domain to be explored + /// is choosen to be the one with the closest center. A value greater then zero also takes into account the size of the domain. + /// +#endif + public float CbIndex + { + get + { + unsafe + { + return *FlannInvoke.flann_CompositeIndexParams_cb_index(ptr); + } + } + set + { + unsafe + { + *FlannInvoke.flann_CompositeIndexParams_cb_index(ptr) = value; + } + } + } + //*/ + #endregion + + #region Init & Disposal +#if LANG_JP + /// + /// + /// + /// 並列な kd-tree の個数.[1..16] の範囲が適切な値です + /// 階層型 k-means tree で利用される branching ファクタ + /// k-means tree を作成する際の,k-means クラスタリングステージでの反復数の上限.ここで -1 は,k-means クラスタリングが収束するまで続けられることを意味します + /// k-means クラスタリングの初期中心を選択するアルゴリズム. + /// このパラメータ(クラスタ境界インデックス)は,階層的 k-means tree の探索方法に影響を与えます. cb_index が0の場合,最も近い中心のクラスタが,次に探索される k-means 領域になります.0より大きい値の場合も,領域サイズが考慮されます +#else + /// + /// + /// + /// The number of parallel kd-trees to use. Good values are in the range [1..16] + /// The branching factor to use for the hierarchical k-means tree + /// The maximum number of iterations to use in the k-means clustering stage when building the k-means tree. A value of -1 used here means that the k-means clustering should be iterated until convergence + /// The algorithm to use for selecting the initial centers when performing a k-means clustering step. + /// This parameter (cluster boundary index) influences the way exploration is performed in the hierarchical kmeans tree. When cb_index is zero the next kmeans domain to be explored is choosen to be the one with the closest center. A value greater then zero also takes into account the size of the domain. +#endif + public CompositeIndexParams(int trees = 4, int branching = 32, int iterations = 11, FlannCentersInit centersInit = FlannCentersInit.Random, float cbIndex = 0.2f) + { + ptr = NativeMethods.flann_CompositeIndexParams_new(trees, branching, iterations, centersInit, cbIndex); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Failed to create CompositeIndexParams"); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + if (ptr != IntPtr.Zero) + { + NativeMethods.flann_CompositeIndexParams_delete(ptr); + } + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + } +} diff --git a/src/OpenCvSharp/modules/flann/IndexParams/IndexParams.cs b/src/OpenCvSharp/modules/flann/IndexParams/IndexParams.cs new file mode 100644 index 000000000..86a4e6cee --- /dev/null +++ b/src/OpenCvSharp/modules/flann/IndexParams/IndexParams.cs @@ -0,0 +1,199 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp.Flann +{ + /// + /// + /// + public class IndexParams : DisposableCvObject + { + private bool disposed = false; + + #region Properties + + #endregion + + #region Init & Disposal +#if LANG_JP + /// + /// + /// +#else + /// + /// + /// +#endif + public IndexParams() + { + ptr = NativeMethods.flann_IndexParams_new(); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Failed to create IndexParams"); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + if (ptr != IntPtr.Zero) + { + NativeMethods.flann_IndexParams_delete(ptr); + } + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Methods + #region Get** + /// + /// + /// + /// + /// + /// + public string GetString(string key, string defaultVal) + { + StringBuilder sb = new StringBuilder(1024); + NativeMethods.flann_IndexParams_getString(ptr, key, defaultVal, sb); + return sb.ToString(); + } + /// + /// + /// + /// + /// + public string GetString(string key) + { + return GetString(key, null); + } + + /// + /// + /// + /// + /// + /// + public int GetInt(string key, int defaultVal) + { + return NativeMethods.flann_IndexParams_getInt(ptr, key, defaultVal); + } + /// + /// + /// + /// + /// + public int GetInt(string key) + { + return GetInt(key, -1); + } + /// + /// + /// + /// + /// + /// + public double GetDouble(string key, double defaultVal) + { + return NativeMethods.flann_IndexParams_getDouble(ptr, key, defaultVal); + } + /// + /// + /// + /// + /// + public double GetDouble(string key) + { + return GetDouble(key, -1); + } + #endregion + #region Set** + /// + /// + /// + /// + /// + public void SetString(string key, string value) + { + NativeMethods.flann_IndexParams_setString(ptr, key, value); + } + /// + /// + /// + /// + /// + public void SetInt(string key, int value) + { + NativeMethods.flann_IndexParams_setInt(ptr, key, value); + } + /// + /// + /// + /// + /// + public void SetDouble(string key, double value) + { + NativeMethods.flann_IndexParams_setDouble(ptr, key, value); + } + /// + /// + /// + /// + /// + public void SetFloat(string key, float value) + { + NativeMethods.flann_IndexParams_setFloat(ptr, key, value); + } + /// + /// + /// + /// + /// + public void SetBool(string key, bool value) + { + NativeMethods.flann_IndexParams_setBool(ptr, key, value ? 1 : 0); + } + /// + /// + /// + /// + public void SetAlgorithm(int value) + { + NativeMethods.flann_IndexParams_setAlgorithm(ptr, value); + } + #endregion + #endregion + } +} diff --git a/src/OpenCvSharp/modules/flann/IndexParams/KDTreeIndexParams.cs b/src/OpenCvSharp/modules/flann/IndexParams/KDTreeIndexParams.cs new file mode 100644 index 000000000..6ea8ef172 --- /dev/null +++ b/src/OpenCvSharp/modules/flann/IndexParams/KDTreeIndexParams.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp.Flann +{ +#if LANG_JP + /// + /// ランダム kd-tree の集合でインデックスが表現され,これは並列に探索されます. + /// +#else + /// + /// When passing an object of this type the index constructed will consist of a set + /// of randomized kd-trees which will be searched in parallel. + /// +#endif + public class KDTreeIndexParams : IndexParams + { + private bool disposed = false; + + #region Properties + /* +#if LANG_JP + /// + /// 並列な kd-tree の個数.[1..16] の範囲が適切な値です + /// +#else + /// + /// The number of parallel kd-trees to use. Good values are in the range [1..16] + /// +#endif + public int Trees + { + get + { + unsafe + { + return *FlannInvoke.flann_KDTreeIndexParams_trees(ptr); + } + } + set + { + unsafe + { + *FlannInvoke.flann_KDTreeIndexParams_trees(ptr) = value; + } + } + } + //*/ + #endregion + + #region Init & Disposal +#if LANG_JP + /// + /// + /// + /// 並列な kd-tree の個数.[1..16] の範囲が適切な値です +#else + /// + /// + /// + /// The number of parallel kd-trees to use. Good values are in the range [1..16] +#endif + public KDTreeIndexParams(int trees = 4) + { + ptr = NativeMethods.flann_KDTreeIndexParams_new(trees); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Failed to create KDTreeIndexParams"); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + if (ptr != IntPtr.Zero) + { + NativeMethods.flann_KDTreeIndexParams_delete(ptr); + } + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + } +} diff --git a/src/OpenCvSharp/modules/flann/IndexParams/KMeansIndexParams.cs b/src/OpenCvSharp/modules/flann/IndexParams/KMeansIndexParams.cs new file mode 100644 index 000000000..ee9afeab8 --- /dev/null +++ b/src/OpenCvSharp/modules/flann/IndexParams/KMeansIndexParams.cs @@ -0,0 +1,235 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp.Flann +{ +#if LANG_JP + /// + /// 階層型 k-means tree でインデックスが表現されます. + /// +#else + /// + /// When passing an object of this type the index constructed will be a hierarchical k-means tree. + /// +#endif + public class KMeansIndexParams : IndexParams + { + private bool disposed = false; + + #region Properties + /* +#if LANG_JP + /// + /// 階層型 k-means tree で利用される branching ファクタ + /// +#else + /// + /// The branching factor to use for the hierarchical k-means tree + /// +#endif + public int Branching + { + get + { + unsafe + { + return *FlannInvoke.flann_KMeansIndexParams_branching(ptr); + } + } + set + { + unsafe + { + *FlannInvoke.flann_KMeansIndexParams_branching(ptr) = value; + } + } + } +#if LANG_JP + /// + /// k-means tree を作成する際の,k-means クラスタリングステージでの反復数の上限.ここで -1 は,k-means クラスタリングが収束するまで続けられることを意味します + /// +#else + /// + /// The maximum number of iterations to use in the k-means clustering + /// stage when building the k-means tree. A value of -1 used here means that the k-means clustering should be iterated until convergence + /// +#endif + public int Iterations + { + get + { + unsafe + { + return *FlannInvoke.flann_KMeansIndexParams_iterations(ptr); + } + } + set + { + unsafe + { + *FlannInvoke.flann_KMeansIndexParams_iterations(ptr) = value; + } + } + } +#if LANG_JP + /// + /// k-means クラスタリングの初期中心を選択するアルゴリズム. + /// +#else + /// + /// The algorithm to use for selecting the initial centers when performing a k-means clustering step. + /// +#endif + public FlannCentersInit CentersInit + { + get + { + unsafe + { + return *FlannInvoke.flann_KMeansIndexParams_centers_init(ptr); + } + } + set + { + unsafe + { + *FlannInvoke.flann_KMeansIndexParams_centers_init(ptr) = value; + } + } + } +#if LANG_JP + /// + /// このパラメータ(クラスタ境界インデックス)は,階層的 k-means tree の探索方法に影響を与えます. + /// cb_index が0の場合,最も近い中心のクラスタが,次に探索される k-means 領域になります.0より大きい値の場合も,領域サイズが考慮されます + /// +#else + /// + /// This parameter (cluster boundary index) influences the + /// way exploration is performed in the hierarchical kmeans tree. When cb_index is zero the next kmeans domain to be explored + /// is choosen to be the one with the closest center. A value greater then zero also takes into account the size of the domain. + /// +#endif + public float CbIndex + { + get + { + unsafe + { + return *FlannInvoke.flann_KMeansIndexParams_cb_index(ptr); + } + } + set + { + unsafe + { + *FlannInvoke.flann_KMeansIndexParams_cb_index(ptr) = value; + } + } + } + //*/ + #endregion + + #region Init & Disposal +#if LANG_JP + /// + /// + /// + /// 階層型 k-means tree で利用される branching ファクタ + /// k-means tree を作成する際の,k-means クラスタリングステージでの反復数の上限.ここで -1 は,k-means クラスタリングが収束するまで続けられることを意味します + /// k-means クラスタリングの初期中心を選択するアルゴリズム. + /// このパラメータ(クラスタ境界インデックス)は,階層的 k-means tree の探索方法に影響を与えます. cb_index が0の場合,最も近い中心のクラスタが,次に探索される k-means 領域になります.0より大きい値の場合も,領域サイズが考慮されます +#else + /// + /// + /// + /// The branching factor to use for the hierarchical k-means tree + /// The maximum number of iterations to use in the k-means clustering stage when building the k-means tree. A value of -1 used here means that the k-means clustering should be iterated until convergence + /// The algorithm to use for selecting the initial centers when performing a k-means clustering step. + /// This parameter (cluster boundary index) influences the way exploration is performed in the hierarchical kmeans tree. When cb_index is zero the next kmeans domain to be explored is choosen to be the one with the closest center. A value greater then zero also takes into account the size of the domain. +#endif + public KMeansIndexParams(int branching = 32, int iterations = 11, FlannCentersInit centersInit = FlannCentersInit.Random, float cbIndex = 0.2f) + { + ptr = NativeMethods.flann_KMeansIndexParams_new(branching, iterations, centersInit, cbIndex); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Failed to create KMeansIndexParams"); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + if (ptr != IntPtr.Zero) + { + NativeMethods.flann_KMeansIndexParams_delete(ptr); + } + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Methods + /* +#if LANG_JP + /// + /// 階層的 k-means tree を構築し,クラスタの分散を最小にするカットを選択することで,与え得られた点群を分類します. + /// + /// クラスタリングされる点 + /// 得られるクラスタの中心.この行列の行数は要求クラスタ数を表します. + /// しかし,階層的 k-means tree のカットを選択する方法により,求められるクラスタ数は,要求クラスタ数より小さい値 (branching-1)*k+1 の最大値になります. + /// ここで branching は tree の branching ファクタ(KMeansIndexParams の説明を参照してください) + /// 求められたクラスタ数 +#else + /// + /// Clusters the given points by constructing a hierarchical k-means tree and choosing a cut in the tree that minimizes the cluster’s variance. + /// + /// The points to be clustered + /// The centers of the clusters obtained. The number of rows in this matrix represents the number of clusters desired, + /// however, because of the way the cut in the hierarchical tree is choosen, the number of clusters computed will be + /// the highest number of the form (branching-1)*k+1 that’s lower than the number of clusters desired, where branching is the tree’s + /// the number of clusters computed +#endif + public int HierarchicalClustering(Mat features, Mat centers) + { + if (features == null) + throw new ArgumentNullException("features"); + if (centers == null) + throw new ArgumentNullException("centers"); + + return FlannInvoke.flann_hierarchicalClustering(features.CvPtr, centers.CvPtr, ptr); + } + */ + #endregion + } +} diff --git a/src/OpenCvSharp/modules/flann/IndexParams/LinearIndexParams.cs b/src/OpenCvSharp/modules/flann/IndexParams/LinearIndexParams.cs new file mode 100644 index 000000000..b78d12b57 --- /dev/null +++ b/src/OpenCvSharp/modules/flann/IndexParams/LinearIndexParams.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp.Flann +{ +#if LANG_JP + /// + /// 線形のブルートフォース探索が行われます + /// +#else + /// + /// the index will perform a linear, brute-force search. + /// +#endif + public class LinearIndexParams : IndexParams + { + private bool disposed = false; + + #region Init & Disposal +#if LANG_JP + /// + /// + /// +#else + /// + /// + /// +#endif + public LinearIndexParams() + { + ptr = NativeMethods.flann_LinearIndexParams_new(); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Failed to create LinearIndexParams"); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + if (ptr != IntPtr.Zero) + { + NativeMethods.flann_LinearIndexParams_delete(ptr); + } + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + } +} diff --git a/src/OpenCvSharp/modules/flann/IndexParams/SavedIndexParams.cs b/src/OpenCvSharp/modules/flann/IndexParams/SavedIndexParams.cs new file mode 100644 index 000000000..796585f04 --- /dev/null +++ b/src/OpenCvSharp/modules/flann/IndexParams/SavedIndexParams.cs @@ -0,0 +1,116 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp.Flann +{ +#if LANG_JP + /// + /// ディスクにあらかじめ保存されたデータを読み出すために利用されます. + /// +#else + /// + /// This object type is used for loading a previously saved index from the disk. + /// +#endif + public class SavedIndexParams : IndexParams + { + private bool disposed = false; + + #region Properties + /* +#if LANG_JP + /// + /// インデックスが保存されたファイル名 + /// +#else + /// + /// The filename in which the index was saved. + /// +#endif + public string FileName + { + get + { + unsafe + { + return FlannInvoke.flann_SavedIndexParams_filename_get(ptr); + } + } + set + { + unsafe + { + FlannInvoke.flann_SavedIndexParams_filename_set(ptr, value); + } + } + } + //*/ + #endregion + + #region Init & Disposal +#if LANG_JP + /// + /// + /// + /// インデックスが保存されたファイル名 +#else + /// + /// + /// + /// インデックスが保存されたファイル名 +#endif + public SavedIndexParams(string filename) + { + if (string.IsNullOrEmpty(filename)) + throw new ArgumentNullException("filename"); + ptr = NativeMethods.flann_SavedIndexParams_new(filename); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Failed to create SavedIndexParams"); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + if (ptr != IntPtr.Zero) + { + NativeMethods.flann_SavedIndexParams_delete(ptr); + } + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + } +} diff --git a/src/OpenCvSharp/modules/flann/IndexParams/SearchParams.cs b/src/OpenCvSharp/modules/flann/IndexParams/SearchParams.cs new file mode 100644 index 000000000..2ad45016a --- /dev/null +++ b/src/OpenCvSharp/modules/flann/IndexParams/SearchParams.cs @@ -0,0 +1,135 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp.Flann +{ +#if LANG_JP + /// + /// + /// +#else + /// + /// + /// +#endif + public class SearchParams : IndexParams + { + private bool disposed = false; + + #region Properties + #endregion + + #region Init & Disposal +#if LANG_JP + /// + /// + /// +#else + /// + /// + /// +#endif + public SearchParams() + : this(32, 0.0f, true) + { + } +#if LANG_JP + /// + /// + /// + /// +#else + /// + /// + /// + /// +#endif + public SearchParams(int checks) + : this(checks, 0.0f, true) + { + } +#if LANG_JP + /// + /// + /// + /// + /// +#else + /// + /// + /// + /// + /// +#endif + public SearchParams(int checks, float eps) + : this(checks, eps, true) + { + } +#if LANG_JP + /// + /// + /// + /// + /// + /// +#else + /// + /// + /// + /// + /// + /// +#endif + public SearchParams(int checks, float eps, bool sorted) + { + ptr = NativeMethods.flann_SearchParams_new(checks, eps, sorted ? 1 : 0); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Failed to create SearchParams"); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + if (ptr != IntPtr.Zero) + { + NativeMethods.flann_SearchParams_delete(ptr); + } + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + } +} diff --git a/src/OpenCvSharp/modules/highgui/CvTrackbar.cs b/src/OpenCvSharp/modules/highgui/CvTrackbar.cs new file mode 100644 index 000000000..58a33db88 --- /dev/null +++ b/src/OpenCvSharp/modules/highgui/CvTrackbar.cs @@ -0,0 +1,323 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// CvWindowに貼り付けて操作するトラックバー + /// +#else + /// + /// Trackbar that is shown on CvWindow + /// +#endif + public class CvTrackbar : DisposableObject + { + /// + /// Track whether Dispose has been called + /// + private bool disposed; + private readonly string name; + private readonly string window; + private int value; + private readonly int max; + private readonly int result; + private readonly object userdata; + private readonly Delegate callback; + private CvTrackbarCallback2Native callbackNative; + private GCHandle gchValue; + private GCHandle gchCallback; + private GCHandle gchCallbackNative; + private GCHandle gchUserdata; + + #region Init and Disposal + #region cvCreateTrackbar +#if LANG_JP + /// + /// 初期化(目盛りは0~100) + /// + /// トラックバーの名前 + /// トラックバーの親ウィンドウ名 + /// スライダの位置が変更されるたびに呼び出されるデリゲート +#else + /// + /// Constructor (value=0, max=100) + /// + /// Trackbar name + /// Window name + /// Callback handler +#endif + public CvTrackbar(string name, string window, CvTrackbarCallback2 callback) + : this(name, window, 0, 100, callback) + { + } +#if LANG_JP + /// + /// 初期化 + /// + /// トラックバーの名前 + /// トラックバーの親ウィンドウ名 + /// スライダの初期位置 + /// スライダの最大値.最小値は常に 0. + /// スライダの位置が変更されるたびに呼び出されるデリゲート +#else + /// + /// Constructor + /// + /// Trackbar name + /// Window name + /// Initial slider position + /// The upper limit of the range this trackbar is working with. + /// Callback handler +#endif + public CvTrackbar(string name, string window, int value, int max, CvTrackbarCallback2 callback) + { + if (string.IsNullOrEmpty(name)) + throw new ArgumentNullException(nameof(name)); + if (string.IsNullOrEmpty(window)) + throw new ArgumentNullException(nameof(window)); + if (callback == null) + throw new ArgumentNullException(nameof(callback)); + + this.name = name; + this.window = window; + this.value = value; + this.max = max; + this.callback = callback; + + gchValue = GCHandle.Alloc(value, GCHandleType.Pinned); + gchCallback = GCHandle.Alloc(callback); + IntPtr callbackPtr = Marshal.GetFunctionPointerForDelegate(callback); + + result = NativeMethods.highgui_createTrackbar(name, window, ref this.value, max, callbackPtr, IntPtr.Zero); + + if (result == 0) + throw new OpenCvSharpException("Failed to create CvTrackbar."); + } + #endregion + #region cvCreateTrackbar2 +#if LANG_JP + /// + /// 初期化 + /// + /// トラックバーの名前 + /// トラックバーの親ウィンドウ名 + /// スライダの初期位置 + /// スライダの最大値.最小値は常に 0. + /// スライダの位置が変更されるたびに呼び出されるデリゲート + /// +#else + /// + /// Constructor + /// + /// Trackbar name + /// Window name + /// Initial slider position + /// The upper limit of the range this trackbar is working with. + /// Callback handler + /// +#endif + public CvTrackbar(string name, string window, int value, int max, CvTrackbarCallback2 callback, object userdata) + { + if (string.IsNullOrEmpty(name)) + throw new ArgumentNullException(nameof(name)); + if (string.IsNullOrEmpty(window)) + throw new ArgumentNullException(nameof(window)); + if (callback == null) + throw new ArgumentNullException(nameof(callback)); + + this.name = name; + this.window = window; + this.value = value; + this.max = max; + this.callback = callback; + this.userdata = userdata; + + // userdataをIntPtrに変換 + IntPtr userdataPtr; + if (userdata != null) + { + gchUserdata = GCHandle.Alloc(userdata); + userdataPtr = GCHandle.ToIntPtr(gchUserdata); + } + else + { + userdataPtr = IntPtr.Zero; + } + + this.callback = callback; + // コールバックdelegateを、userdataをobjectとするように変換 + callbackNative = delegate(int pos, IntPtr ud) + { + if (ud == IntPtr.Zero) + { + callback(pos, null); + } + else + { + GCHandle gch = GCHandle.FromIntPtr(ud); + callback(pos, gch.Target); + } + }; + + // コールバックdelegateをポインタに変換 + gchCallback = GCHandle.Alloc(callback); + gchCallbackNative = GCHandle.Alloc(callbackNative); + IntPtr callbackPtr = Marshal.GetFunctionPointerForDelegate(callbackNative); + + gchValue = GCHandle.Alloc(value, GCHandleType.Pinned); + + result = NativeMethods.highgui_createTrackbar(name, window, ref this.value, max, callbackPtr, userdataPtr); + + if (result == 0) + throw new OpenCvSharpException("Failed to create CvTrackbar."); + } + #endregion + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + if (gchCallback.IsAllocated) + gchCallback.Free(); + if (gchValue.IsAllocated) + gchValue.Free(); + if (gchUserdata.IsAllocated) + gchUserdata.Free(); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties +#if LANG_JP + /// + /// トラックバーの名前を取得する + /// +#else + /// + /// Name of this trackbar + /// +#endif + public string TrackbarName + { + get { return name; } + } + +#if LANG_JP + /// + /// 親ウィンドウの名前を取得する + /// +#else + /// + /// Name of parent window + /// +#endif + public string WindowName + { + get { return window; } + } + +#if LANG_JP + /// + /// トラックバーの現在の値を取得・設定する + /// +#else + /// + /// Gets or sets a numeric value that represents the current position of the scroll box on the track bar. + /// +#endif + public int Pos + { + get { return NativeMethods.highgui_getTrackbarPos(name, window); } + set { NativeMethods.highgui_setTrackbarPos(name, window, value); } + } + +#if LANG_JP + /// + /// トラックバーの目盛りの最大値を取得する + /// +#else + /// + /// Gets the upper limit of the range this trackbar is working with. + /// +#endif + public int Max + { + get { return max; } + } + +#if LANG_JP + /// + /// スライダが動いた際のコールバックイベントデリゲートを取得する + /// +#else + /// + /// Gets the callback delegate which occurs when the Value property of a track bar changes, either by movement of the scroll box or by manipulation in code. + /// +#endif + public Delegate Callback + { + get { return callback; } + } + +#if LANG_JP + /// + /// + /// +#else + /// + /// + /// +#endif + public object Userdata + { + get { return userdata; } + } + + +#if LANG_JP + /// + /// + /// +#else + /// + /// + /// +#endif + public int Result + { + get { return result; } + } + #endregion + + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/highgui/Enum/ButtonTypes.cs b/src/OpenCvSharp/modules/highgui/Enum/ButtonTypes.cs new file mode 100644 index 000000000..d7b34e5f1 --- /dev/null +++ b/src/OpenCvSharp/modules/highgui/Enum/ButtonTypes.cs @@ -0,0 +1,52 @@ + +namespace OpenCvSharp +{ + // TODO support createButton + +#if LANG_JP + /// + /// cv::createButton で用いるボタンの種類 + /// +#else + /// + /// Button type flags (cv::createButton) + /// +#endif + public enum ButtonTypes : int + { +#if LANG_JP + /// + /// 通常のプッシュボタン. + /// +#else + /// + /// The button will be a push button. + /// +#endif + PushButton = 0, + +#if LANG_JP + /// + /// チェックボックスボタン + /// +#else + /// + /// The button will be a checkbox button. + /// +#endif + Checkbox = 1, + +#if LANG_JP + /// + /// ラジオボックスボタン. + /// 同じボタンバー(同じライン上)にあるラジオボックスは,排他的です. + /// つまり,同時に1つしか選択できません. + /// +#else + /// + /// The button will be a radiobox button. The radiobox on the same buttonbar (same line) are exclusive; one on can be select at the time. + /// +#endif + Radiobox = 2, + } +} diff --git a/src/OpenCvSharp/modules/highgui/Enum/MouseEvent.cs b/src/OpenCvSharp/modules/highgui/Enum/MouseEvent.cs new file mode 100644 index 000000000..a4d667fa0 --- /dev/null +++ b/src/OpenCvSharp/modules/highgui/Enum/MouseEvent.cs @@ -0,0 +1,91 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// マウスイベント + /// +#else + /// + /// Mouse events + /// +#endif + [Flags] + public enum MouseEvent : int + { + /// + /// [EVENT_MOUSEMOVE] + /// + MouseMove = 0, + /// + /// [EVENT_LBUTTONDOWN] + /// + LButtonDown = 1, + /// + /// [EVENT_RBUTTONDOWN] + /// + RButtonDown = 2, + /// + /// [CV_EVENT_MBUTTONDOWN] + /// + MButtonDown = 3, + /// + /// [EVENT_LBUTTONUP] + /// + LButtonUp = 4, + /// + /// [EVENT_RBUTTONUP] + /// + RButtonUp = 5, + /// + /// [EVENT_MBUTTONUP] + /// + MButtonUp = 6, + /// + /// [EVENT_LBUTTONDBLCLK] + /// + LButtonDoubleClick = 7, + /// + /// [EVENT_RBUTTONDBLCLK] + /// + RButtonDoubleClick = 8, + /// + /// [EVENT_MBUTTONDBLCLK] + /// + MButtonDoubleClick = 9, + /// + /// [EVENT_MOUSEWHEEL] + /// + MouseWheel = 8, + /// + /// [EVENT_MOUSEHWHEEL] + /// + MouseHWheel = 9, + + /// + /// [EVENT_FLAG_LBUTTON] + /// + FlagLButton = 1, + /// + /// [EVENT_FLAG_RBUTTON] + /// + FlagRButton = 2, + /// + /// [EVENT_FLAG_MBUTTON] + /// + FlagMButton = 4, + /// + /// [EVENT_FLAG_CTRLKEY] + /// + FlagCtrlKey = 8, + /// + /// [EVENT_FLAG_SHIFTKEY] + /// + FlagShiftKey = 16, + /// + /// [EVENT_FLAG_ALTKEY] + /// + FlagAltKey = 32, + } +} diff --git a/src/OpenCvSharp/modules/highgui/Enum/WindowMode.cs b/src/OpenCvSharp/modules/highgui/Enum/WindowMode.cs new file mode 100644 index 000000000..387d6107d --- /dev/null +++ b/src/OpenCvSharp/modules/highgui/Enum/WindowMode.cs @@ -0,0 +1,54 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cvNamedWindowで使用するウィンドウのフラグ + /// +#else + /// + /// Flags for the window + /// +#endif + [Flags] + public enum WindowMode : int + { + /// + /// the user can resize the window (no constraint) / + /// also use to switch a fullscreen window to a normal size + /// + Normal = 0x00000000, + +#if LANG_JP + /// + /// 表示される画像サイズに合わせてウィンドウサイズが自動的に調整される + /// +#else + /// + /// the user cannot resize the window, the size is constrainted by the image displayed + /// +#endif + AutoSize = 0x00000001, + + /// + /// window with opengl support + /// + OpenGL = 0x00001000, + + /// + /// change the window to fullscreen + /// + FullScreen = 1, + + /// + /// the image expends as much as it can (no ratio constraint) + /// + FreeRatio = 0x00000100, + + /// + /// the ratio of the image is respected + /// + KeepRatio = 0x00000000 + } +} diff --git a/src/OpenCvSharp/modules/highgui/Enum/WindowProperty.cs b/src/OpenCvSharp/modules/highgui/Enum/WindowProperty.cs new file mode 100644 index 000000000..87bba6ba6 --- /dev/null +++ b/src/OpenCvSharp/modules/highgui/Enum/WindowProperty.cs @@ -0,0 +1,35 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// ウィンドウのプロパティを取得・設定する際のプロパティID(cvGetWindowProperty/cvSetWindowProperty) + /// +#else + /// + /// Property identifiers for cvGetWindowProperty/cvSetWindowProperty + /// +#endif + public enum WindowProperty : int + { + /// + /// fullscreen property (can be WINDOW_NORMAL or WINDOW_FULLSCREEN) + /// + Fullscreen = 0, + + /// + /// autosize property (can be WINDOW_NORMAL or WINDOW_AUTOSIZE) + /// + AutoSize = 1, + + /// + /// window's aspect ration (can be set to WINDOW_FREERATIO or WINDOW_KEEPRATIO) + /// + AspectRatio = 2, + + /// + /// opengl support + /// + OpenGL = 3, + } +} diff --git a/src/OpenCvSharp/modules/highgui/FourCC.cs b/src/OpenCvSharp/modules/highgui/FourCC.cs new file mode 100644 index 000000000..180d32bb0 --- /dev/null +++ b/src/OpenCvSharp/modules/highgui/FourCC.cs @@ -0,0 +1,66 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// OpenCvのcvXXX関数のラッパー。 + /// +#else + /// + /// Managed wrapper of all OpenCV functions + /// +#endif + public static class FourCCCalcurator + { + // ReSharper disable InconsistentNaming + + /// + /// 4つの文字からFOURCCの整数値を得る + /// + /// + /// + /// + /// + /// + public static int Run(byte c1, byte c2, byte c3, byte c4) + { + return (((c1) & 255) + (((c2) & 255) << 8) + (((c3) & 255) << 16) + (((c4) & 255) << 24)); + } + + /// + /// 4つの文字からFOURCCの整数値を得る + /// + /// + /// + /// + /// + /// + public static int Run(char c1, char c2, char c3, char c4) + { + byte b1 = System.Convert.ToByte(c1); + byte b2 = System.Convert.ToByte(c2); + byte b3 = System.Convert.ToByte(c3); + byte b4 = System.Convert.ToByte(c4); + return Run(b1, b2, b3, b4); + } + + /// + /// 4つの文字からFOURCCの整数値を得る + /// + /// + /// + public static int Run(string fourcc) + { + if (string.IsNullOrEmpty(fourcc)) + return -1; + if (fourcc.Length != 4) + throw new ArgumentOutOfRangeException("fourcc"); + byte c1 = System.Convert.ToByte(fourcc[0]); + byte c2 = System.Convert.ToByte(fourcc[1]); + byte c3 = System.Convert.ToByte(fourcc[2]); + byte c4 = System.Convert.ToByte(fourcc[3]); + return Run(c1, c2, c3, c4); + } + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/highgui/Window.cs b/src/OpenCvSharp/modules/highgui/Window.cs new file mode 100644 index 000000000..3b307ab2a --- /dev/null +++ b/src/OpenCvSharp/modules/highgui/Window.cs @@ -0,0 +1,825 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// HighGUIウィンドウのラッパー + /// +#else + /// + /// Wrapper of HighGUI window + /// +#endif + public class Window : DisposableObject + { + #region Field + + internal static Dictionary Windows = new Dictionary(); + private static uint windowCount = 0; + + private string name; + private Mat image; + private CvMouseCallback mouseCallback; + private readonly Dictionary trackbars; + private ScopedGCHandle callbackHandle; + + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #endregion + + #region Init and Disposal + +#if LANG_JP + /// + /// 適当なウィンドウ名で初期化 + /// +#else + /// + /// Creates a window with a random name + /// +#endif + public Window() + : this(DefaultName(), WindowMode.AutoSize, null) + { + } + +#if LANG_JP + /// + /// 適当なウィンドウ名で、始めから表示しておく画像を指定して初期化 + /// + /// ウィンドウに表示する画像 +#else + /// + /// Creates a window with a random name and a specified image + /// + /// +#endif + public Window(Mat image) + : this(DefaultName(), WindowMode.AutoSize, image) + { + + } + +#if LANG_JP + /// + /// 適当なウィンドウ名で、画像の表示モードを指定して初期化 + /// + /// ウィンドウのフラグ + /// ウィンドウに表示する画像 +#else + /// + /// Creates a window with a specified image and flag + /// + /// Flags of the window. Currently the only supported flag is WindowMode.AutoSize. + /// If it is set, window size is automatically adjusted to fit the displayed image (see cvShowImage), while user can not change the window size manually. + /// +#endif + public Window(WindowMode flags, Mat image) + : this(DefaultName(), flags, image) + { + } + +#if LANG_JP + /// + /// ウィンドウ名を指定して初期化 + /// + /// ウィンドウの識別に用いられるウィンドウ名で,ウィンドウのタイトルバ ーに表示される. +#else + /// + /// Creates a window + /// + /// Name of the window which is used as window identifier and appears in the window caption. +#endif + public Window(string name) + : this(name, WindowMode.AutoSize, null) + { + } + +#if LANG_JP + /// + /// ウィンドウ名と画像の表示モードを指定して初期化 + /// + /// ウィンドウの識別に用いられるウィンドウ名で,ウィンドウのタイトルバ ーに表示される. + /// ウィンドウのフラグ +#else + /// + /// Creates a window + /// + /// Name of the window which is used as window identifier and appears in the window caption. + /// Flags of the window. Currently the only supported flag is WindowMode.AutoSize. + /// If it is set, window size is automatically adjusted to fit the displayed image (see cvShowImage), while user can not change the window size manually. +#endif + public Window(string name, WindowMode flags) + : this(name, flags, null) + { + } + +#if LANG_JP + /// + /// ウィンドウ名と始めから表示しておく画像を指定して初期化 + /// + /// ウィンドウの識別に用いられるウィンドウ名で,ウィンドウのタイトルバ ーに表示される. + /// ウィンドウに表示する画像 +#else + /// + /// Creates a window + /// + /// Name of the window which is used as window identifier and appears in the window caption. + /// Image to be shown. +#endif + public Window(string name, Mat image) + : this(name, WindowMode.AutoSize, image) + { + } + +#if LANG_JP + /// + /// ウィンドウ名と画像の表示モードと始めから表示しておく画像を指定して初期化 + /// + /// ウィンドウの識別に用いられるウィンドウ名で,ウィンドウのタイトルバ ーに表示される. + /// ウィンドウのフラグ + /// ウィンドウに表示する画像 +#else + /// + /// Creates a window + /// + /// Name of the window which is used as window identifier and appears in the window caption. + /// Flags of the window. Currently the only supported flag is WindowMode.AutoSize. + /// If it is set, window size is automatically adjusted to fit the displayed image (see cvShowImage), while user can not change the window size manually. + /// Image to be shown. +#endif + public Window(string name, WindowMode flags, Mat image) + { + if (name == null) + throw new ArgumentNullException("name"); + + this.name = name; + NativeMethods.highgui_namedWindow(name, (int) flags); + + this.image = image; + ShowImage(image); + trackbars = new Dictionary(); + if (!Windows.ContainsKey(name)) + { + Windows.Add(name, this); + } + this.callbackHandle = null; + } + + /// + /// ウィンドウ名が指定されなかったときに、適当な名前を作成して返す. + /// + /// + private static string DefaultName() + { + return string.Format("window{0}", windowCount++); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + foreach (KeyValuePair pair in trackbars) + { + if (pair.Value != null) + { + pair.Value.Dispose(); + } + } + + if (Windows.ContainsKey("name")) + Windows.Remove(name); + + if (callbackHandle != null && callbackHandle.IsAllocated) + { + callbackHandle.Dispose(); + } + } + NativeMethods.highgui_destroyWindow(name); + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + +#if LANG_JP + /// + /// ウィンドウを閉じる + /// +#else + /// + /// Destroys this window. + /// +#endif + public void Close() + { + Dispose(true); + } + +#if LANG_JP + /// + /// 全ての HighGUI ウィンドウを破棄する + /// +#else + /// + /// Destroys all the opened HighGUI windows. + /// +#endif + public static void DestroyAllWindows() + { + foreach (KeyValuePair wpair in Windows) + { + Window w = wpair.Value; + if (w == null || w.IsDisposed) + { + continue; + } + NativeMethods.highgui_destroyWindow(w.name); + foreach (KeyValuePair tpair in w.trackbars) + { + if (tpair.Value != null) + { + tpair.Value.Dispose(); + } + } + //w.Dispose(); + } + Windows.Clear(); + NativeMethods.highgui_destroyAllWindows(); + } + + #endregion + + #region Properties + +#if LANG_JP + /// + /// 表示する画像を取得・設定する + /// +#else + /// + /// Gets or sets an image to be shown + /// +#endif + public Mat Image + { + get { return image; } + set { ShowImage(value); } + } + +#if LANG_JP + /// + /// ウィンドウの名前を取得する + /// +#else + /// + /// Gets window name + /// +#endif + public string Name + { + get { return name; } + private set { name = value; } + } + +#if LANG_JP + /// + /// ウィンドウハンドルを取得する + /// +#else + /// + /// Gets window handle + /// +#endif + public IntPtr Handle + { + get + { + throw new NotImplementedException(); + //return OpenCvSharp.NativeMethods.cvGetWindowHandle(name); + } + } + + /// + /// + /// + internal CvMouseCallback MouseCallback + { + get { return mouseCallback; } + set + { + if (callbackHandle != null && callbackHandle.IsAllocated) + { + callbackHandle.Dispose(); + } + mouseCallback = value; + callbackHandle = new ScopedGCHandle(mouseCallback, GCHandleType.Normal); + } + } + +#if LANG_JP + /// + /// マウスイベントが発生したときのイベントハンドラ + /// +#else + /// + /// Event handler to be called every time mouse event occurs in the specified window. + /// +#endif + public event CvMouseCallback OnMouseCallback + { + add + { + if (value == null) + throw new ArgumentNullException(); + if (callbackHandle != null && callbackHandle.IsAllocated) + callbackHandle.Dispose(); + + mouseCallback += value; + callbackHandle = new ScopedGCHandle(mouseCallback, GCHandleType.Normal); + NativeMethods.highgui_setMouseCallback(name, mouseCallback, IntPtr.Zero); + } + remove + { + if (value == null) + throw new ArgumentNullException(); + if (callbackHandle != null && callbackHandle.IsAllocated) + callbackHandle.Dispose(); + + mouseCallback -= value; + callbackHandle = new ScopedGCHandle(mouseCallback, GCHandleType.Normal); + NativeMethods.highgui_setMouseCallback(name, mouseCallback, IntPtr.Zero); + } + } + +#if LANG_JP + /// + /// Qtを有効にしてビルドされたhighguiライブラリであればtrueを返す + /// +#else + /// + /// Returns true if the library is compiled with Qt + /// +#endif + public static bool HasQt + { + get + { + throw new NotImplementedException(); + //return OpenCvSharp.NativeMethods.HasQt; + } + } + + #endregion + + #region Methods + + #region CreateTrackbar + +#if LANG_JP + /// + /// ウィンドウにトラックバーを作成し、作成したトラックバーを返す + /// + /// トラックバーの名前 + /// スライダの位置が変更されるたびに呼び出されるデリゲート +#else + /// + /// Creates the trackbar and attaches it to this window + /// + /// Name of created trackbar. + /// the function to be called every time the slider changes the position. This function should be prototyped as void Foo(int); + /// +#endif + public CvTrackbar CreateTrackbar(string name, CvTrackbarCallback2 callback) + { + CvTrackbar trackbar = new CvTrackbar(name, this.name, callback); + trackbars.Add(name, trackbar); + return trackbar; + } + +#if LANG_JP + /// + /// ウィンドウにトラックバーを作成し、作成したトラックバーを返す + /// + /// トラックバーの名前 + /// スライダの初期位置 + /// スライダの最大値.最小値は常に 0. + /// スライダの位置が変更されるたびに呼び出されるデリゲート +#else + /// + /// Creates the trackbar and attaches it to this window + /// + /// Name of created trackbar. + /// The position of the slider + /// Maximal position of the slider. Minimal position is always 0. + /// the function to be called every time the slider changes the position. This function should be prototyped as void Foo(int); + /// +#endif + public CvTrackbar CreateTrackbar(string name, int value, int max, CvTrackbarCallback2 callback) + { + CvTrackbar trackbar = new CvTrackbar(name, this.name, value, max, callback); + trackbars.Add(name, trackbar); + return trackbar; + } + +#if LANG_JP + /// + /// ウィンドウにトラックバーを作成し、作成したトラックバーを返す + /// + /// トラックバーの名前 + /// スライダの初期位置 + /// スライダの最大値.最小値は常に 0. + /// スライダの位置が変更されるたびに呼び出されるデリゲート + /// +#else + /// + /// Creates the trackbar and attaches it to this window + /// + /// Name of created trackbar. + /// The position of the slider + /// Maximal position of the slider. Minimal position is always 0. + /// the function to be called every time the slider changes the position. This function should be prototyped as void Foo(int); + /// + /// +#endif + public CvTrackbar CreateTrackbar2(string name, int value, int max, CvTrackbarCallback2 callback, object userdata) + { + CvTrackbar trackbar = new CvTrackbar(name, this.name, value, max, callback, userdata); + trackbars.Add(name, trackbar); + return trackbar; + } + + #endregion + + #region DisplayOverlay + +#if LANG_JP + /// + /// ウィンドウ画像上に,delay ミリ秒間だけテキストをオーバレイ表示します.これは,画像データを変更しません.テキストは画像の一番上に表示されます. + /// + /// ウィンドウ画像上に描画される,オーバレイテキスト. + /// オーバレイテキストを表示する時間.直前のオーバレイテキストがタイムアウトするより前に,この関数が呼ばれると,タイマーは再起動されてテキストが更新されます.この値が0の場合,テキストは表示されません. +#else + /// + /// Display text on the window's image as an overlay for delay milliseconds. This is not editing the image's data. The text is display on the top of the image. + /// + /// Overlay text to write on the window’s image + /// Delay to display the overlay text. If this function is called before the previous overlay text time out, the timer is restarted and the text updated. . If this value is zero, the text never disapers. +#endif + public void DisplayOverlay(string text, int delayms) + { + throw new NotImplementedException(); + //Cv.DisplayOverlay(name, text, delayms); + } + + #endregion + + #region DisplayStatusBar + +#if LANG_JP + /// + /// ウィンドウのステータスバーに,delay ミリ秒間だけテキストを表示します. + /// + /// ウィンドウのステータスバー上に描画されるテキスト. + /// テキストが表示される時間.直前のテキストがタイムアウトするより前に,この関数が呼ばれると,タイマーは再起動されてテキストが更新されます.この値が0の場合,テキストは表示されません. +#else + /// + /// + /// + /// Text to write on the window’s statusbar + /// Delay to display the text. If this function is called before the previous text time out, the timer is restarted and the text updated. If this value is zero, the text never disapers. +#endif + public void DisplayStatusBar(string text, int delayms) + { + throw new NotImplementedException(); + //Cv.DisplayStatusBar(name, text, delayms); + } + + #endregion + + #region GetProperty + +#if LANG_JP + /// + /// ウィンドウのプロパティを取得する + /// + /// プロパティの種類 + /// プロパティの値 +#else + /// + /// Get Property of the window + /// + /// Property identifier + /// Value of the specified property +#endif + public double GetProperty(WindowProperty propId) + { + return Cv2.GetWindowProperty(name, propId); + } + + #endregion + + #region LoadWindowParameters + +#if LANG_JP + /// + /// ウィンドウのパラメータを読み込みます. + /// +#else + /// + /// Load parameters of the window. + /// +#endif + public void LoadWindowParameters() + { + throw new NotImplementedException(); + //Cv.LoadWindowParameters(name); + } + + #endregion + + #region Move + +#if LANG_JP + /// + /// ウィンドウの位置を変更する + /// + /// 左上のコーナーの新しい x 座標 + /// 左上のコーナーの新しい y 座標 +#else + /// + /// Sets window position + /// + /// New x coordinate of top-left corner + /// New y coordinate of top-left corner +#endif + public void Move(int x, int y) + { + NativeMethods.highgui_moveWindow(name, x, y); + } + + #endregion + + #region Resize + +#if LANG_JP + /// + /// ウィンドウサイズを変更する + /// + /// 新しい幅 + /// 新しい高さ +#else + /// + /// Sets window size + /// + /// New width + /// New height +#endif + public void Resize(int width, int height) + { + NativeMethods.highgui_resizeWindow(name, width, height); + } + + #endregion + + #region SaveWindowParameters + +#if LANG_JP + /// + /// ウィンドウのパラメータを保存します. + /// +#else + /// + /// Save parameters of the window. + /// +#endif + public void SaveWindowParameters() + { + throw new NotImplementedException(); + //Cv.SaveWindowParameters(name); + } + + #endregion + + #region SetProperty + +#if LANG_JP + /// + /// ウィンドウのプロパティを設定する + /// + /// プロパティの種類 + /// プロパティに設定する値 +#else + /// + /// Set Property of the window + /// + /// Property identifier + /// New value of the specified property +#endif + public void SetProperty(WindowProperty propId, double propValue) + { + Cv2.SetWindowProperty(name, propId, propValue); + } + + #endregion + + #region ShowImage + +#if LANG_JP + /// + /// 指定したウィンドウ内に画像を表示する(cvShowImage相当). + /// このウィンドウのフラグに AutoSize が指定されていた場合は,画像はオリジナルサイズで表示される. + /// それ以外の場合,ウィンドウサイズに合わせて 表示画像サイズが変更される. + /// + /// 画像ヘッダ +#else + /// + /// Shows the image in this window + /// + /// Image to be shown. +#endif + public void ShowImage(Mat img) + { + if (img != null) + { + this.image = img; + NativeMethods.highgui_imshow(name, img.CvPtr); + } + } + + #endregion + + #region WaitKey + +#if LANG_JP + /// + /// 何かキーが押されるまで待機する. + /// + /// 押されたキーのキーコード +#else + /// + /// Waits for a pressed key + /// + /// Key code +#endif + public static int WaitKey() + { + return NativeMethods.highgui_waitKey(0); + } + +#if LANG_JP + /// + /// 何かキーが押されるか、若しくはdelayで指定した時間(ミリ秒)待機する。 + /// + /// 遅延時間(ミリ秒) + /// キーが押された場合はそのキーコードを,キーが押されないまま指定されたタイムアウト時間が過ぎてしまった場合は -1 +#else + /// + /// Waits for a pressed key + /// + /// Delay in milliseconds. + /// Key code +#endif + public static int WaitKey(int delay) + { + return NativeMethods.highgui_waitKey(delay); + } + + #endregion + + #region ShowImages + +#if LANG_JP + /// + /// 引数に指定した画像をそれぞれ別のウィンドウで表示し、キー入力待ち状態にする。 + /// + /// 表示させる画像。任意の個数を指定できる。 +#else + /// + /// + /// + /// +#endif + public static void ShowImages(params Mat[] images) + { + if (images == null) + throw new ArgumentNullException("images"); + if (images.Length == 0) + return; + + var windows = new List(); + foreach (Mat img in images) + { + windows.Add(new Window(img)); + } + + WaitKey(); + + foreach (Window w in windows) + { + w.Close(); + } + } + + /// + /// + /// + /// + /// + public static void ShowImages(IEnumerable images, IEnumerable names) + { + if (images == null) + throw new ArgumentNullException("images"); + if (names == null) + throw new ArgumentNullException("names"); + + Mat[] imagesArray = EnumerableEx.ToArray(images); + string[] namesArray = EnumerableEx.ToArray(names); + + if (imagesArray.Length == 0) + return; + if (namesArray.Length < imagesArray.Length) + throw new ArgumentException("names.Length < images.Length"); + + List windows = new List(); + for (int i = 0; i < imagesArray.Length; i++) + { + windows.Add(new Window(namesArray[i], imagesArray[i])); + } + + Cv2.WaitKey(); + + foreach (Window w in windows) + { + w.Close(); + } + } + + #endregion + + #region GetWindowByName + +#if LANG_JP + /// + /// 指定した名前に対応するウィンドウを得る + /// + /// +#else + /// + /// Retrieves a created window by name + /// + /// + /// +#endif + public static Window GetWindowByName(string name) + { + if (string.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (Windows.ContainsKey(name)) + { + return Windows[name]; + } + else + { + return null; + } + } + + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/imgcodecs/Enum/ConvertImageModes.cs b/src/OpenCvSharp/modules/imgcodecs/Enum/ConvertImageModes.cs new file mode 100644 index 000000000..d357a1ccc --- /dev/null +++ b/src/OpenCvSharp/modules/imgcodecs/Enum/ConvertImageModes.cs @@ -0,0 +1,24 @@ + +namespace OpenCvSharp +{ + /// + /// + /// + public enum ConvertImageModes : int + { + /// + /// + /// + None = 0, + + /// + /// + /// + Flip = 1, + + /// + /// + /// + SwapRB = 2 + } +} diff --git a/src/OpenCvSharp/modules/imgcodecs/Enum/ImreadModes.cs b/src/OpenCvSharp/modules/imgcodecs/Enum/ImreadModes.cs new file mode 100644 index 000000000..3231472d8 --- /dev/null +++ b/src/OpenCvSharp/modules/imgcodecs/Enum/ImreadModes.cs @@ -0,0 +1,82 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cvLoadImageで用いる読み込みフラグ . + /// +#else + /// + /// Specifies colorness and Depth of the loaded image + /// +#endif + [Flags] + public enum ImreadModes : int + { + #if LANG_JP + /// + /// 8 ビット,カラーまたはグレースケール [CV_LOAD_IMAGE_UNCHANGED] + /// +#else + /// + /// If set, return the loaded image as is (with alpha channel, otherwise it gets cropped). + /// +#endif + Unchanged = -1, + + +#if LANG_JP + /// + /// 8 ビット,グレースケール [CV_LOAD_IMAGE_GRAYSCALE] + /// +#else + /// + /// If set, always convert image to the single channel grayscale image. + /// +#endif + GrayScale = 0, + + +#if LANG_JP + /// + /// AnyDepth と併用されない限り 8 ビット,カラー [CV_LOAD_IMAGE_COLOR] + /// +#else + /// + /// If set, always convert image to the 3 channel BGR color image. + /// +#endif + Color = 1, + + +#if LANG_JP + /// + ///任意のデプス,グレー [CV_LOAD_IMAGE_ANYDEPTH] + /// +#else + /// + /// If set, return 16-bit/32-bit image when the input has the corresponding depth, otherwise convert it to 8-bit. + /// +#endif + AnyDepth = 2, + + +#if LANG_JP + /// + /// 8 ビット,カラーまたはグレースケール [CV_LOAD_IMAGE_ANYCOLOR]. + /// AnyDepth と併用可能. + /// +#else + /// + /// If set, the image is read in any possible color format. + /// +#endif + AnyColor = 4, + + /// + /// If set, use the gdal driver for loading the image. + /// + LoadGdal = 8, + }; +} diff --git a/src/OpenCvSharp/modules/imgcodecs/Enum/ImwriteFlags.cs b/src/OpenCvSharp/modules/imgcodecs/Enum/ImwriteFlags.cs new file mode 100644 index 000000000..b8aa8cf2c --- /dev/null +++ b/src/OpenCvSharp/modules/imgcodecs/Enum/ImwriteFlags.cs @@ -0,0 +1,89 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cv::imwrite, cv::inencode で用いるエンコードの種類 + /// +#else + /// + /// The format type IDs for cv::imwrite and cv::inencode + /// +#endif + public enum ImwriteFlags : int + { +#if LANG_JP + /// + /// JPEGの場合のフラグ。0から100の値を取る(大きいほど高品質)。デフォルト値は95。 + /// +#else + /// + /// For JPEG, it can be a quality from 0 to 100 (the higher is the better). Default value is 95. + /// +#endif + JpegQuality = 1, + + /// + /// Enable JPEG features, 0 or 1, default is False. + /// + JpegProgressive = 2, + + /// + /// Enable JPEG features, 0 or 1, default is False. + /// + JpegOptimize = 3, + + /// + /// JPEG restart interval, 0 - 65535, default is 0 - no restart. + /// + JpegRstInterval = 4, + + /// + /// Separate luma quality level, 0 - 100, default is 0 - don't use. + /// + JpegLumaQuality = 5, + + /// + /// Separate chroma quality level, 0 - 100, default is 0 - don't use. + /// + JpegChromaQuality = 6, + +#if LANG_JP + /// + /// PNGの場合のフラグ。圧縮レベルを0から9の値で指定する(大きいほど高圧縮率で、かつ圧縮に時間を要する)。デフォルト値は3。 + /// +#else + /// + /// For PNG, it can be the compression level from 0 to 9. + /// A higher value means a smaller size and longer compression time. Default value is 3. + /// +#endif + PngCompression = 16, + + /// + /// One of cv::ImwritePNGFlags, default is IMWRITE_PNG_STRATEGY_DEFAULT. + /// + PngStrategy = 17, + + /// + /// Binary level PNG, 0 or 1, default is 0. + /// + PngBilevel = 18, + +#if LANG_JP + /// + /// PPM, PGM, PBMの場合のフラグ。フォーマットをバイナリ(1)かアスキー(0)かで指定する。デフォルト値は1。 + /// +#else + /// + /// For PPM, PGM, or PBM, it can be a binary format flag, 0 or 1. Default value is 1. + /// +#endif + PxmBinary = 32, + + /// + /// For WEBP, it can be a quality from 1 to 100 (the higher is the better). By default (without any parameter) and for quality above 100 the lossless compression is used. + /// + WebPQuality = 64 + } +} diff --git a/src/OpenCvSharp/modules/imgcodecs/ImageEncodingParam.cs b/src/OpenCvSharp/modules/imgcodecs/ImageEncodingParam.cs new file mode 100644 index 000000000..a29ce89c9 --- /dev/null +++ b/src/OpenCvSharp/modules/imgcodecs/ImageEncodingParam.cs @@ -0,0 +1,59 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cv::imwrite, cv::imencode で用いるエンコードパラメータ + /// +#else + /// + /// The format-specific save parameters for cv::imwrite and cv::imencode + /// +#endif + [Serializable] + public class ImageEncodingParam + { +#if LANG_JP + /// + /// エンコードの種類 + /// +#else + /// + /// format type ID + /// +#endif + public ImwriteFlags EncodingId { get; set; } + +#if LANG_JP + /// + /// パラメータの値 + /// +#else + /// + /// value of parameter + /// +#endif + public int Value { get; set; } + + +#if LANG_JP + /// + /// 初期化 + /// + /// エンコードの種類 + /// パラメータの値 +#else + /// + /// Constructor + /// + /// format type ID + /// value of parameter +#endif + public ImageEncodingParam(ImwriteFlags id, int value) + { + EncodingId = id; + Value = value; + } + } +} diff --git a/src/OpenCvSharp/modules/imgproc/CLAHE.cs b/src/OpenCvSharp/modules/imgproc/CLAHE.cs new file mode 100644 index 000000000..23430d617 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/CLAHE.cs @@ -0,0 +1,183 @@ +using System; + +namespace OpenCvSharp +{ + /// + /// Contrast Limited Adaptive Histogram Equalization + /// + public sealed class CLAHE : Algorithm + { + private bool disposed; + + /// + /// cv::Ptr<CLAHE> + /// + private Ptr ptrObj; + + /// + /// + /// + private CLAHE(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// Creates a predefined CLAHE object + /// + /// + /// + /// + public static CLAHE Create(double clipLimit = 40.0, Size? tileGridSize = null) + { + IntPtr ptr = NativeMethods.imgproc_createCLAHE( + clipLimit, tileGridSize.GetValueOrDefault(new Size(8, 8))); + return new CLAHE(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + } + // releases unmanaged resources + if (IsEnabledDispose) + { + if (ptrObj != null) + ptrObj.Dispose(); + ptrObj = null; + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + /// + /// + /// + /// + /// + public void Apply(InputArray src, OutputArray dst) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + src.ThrowIfDisposed(); + dst.ThrowIfNotReady(); + + NativeMethods.imgproc_CLAHE_apply(ptr, src.CvPtr, dst.CvPtr); + + dst.Fix(); + GC.KeepAlive(src); + } + + /// + /// + /// + /// + public void SetClipLimit(double clipLimit) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + + NativeMethods.imgproc_CLAHE_setClipLimit(ptr, clipLimit); + } + + /// + /// + /// + /// + public double GetClipLimit() + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + + return NativeMethods.imgproc_CLAHE_getClipLimit(ptr); + } + + /// + /// + /// + public double ClipLimit + { + get { return GetClipLimit(); } + set { SetClipLimit(value); } + } + + /// + /// + /// + /// + public void SetTilesGridSize(Size tileGridSize) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + + NativeMethods.imgproc_CLAHE_setTilesGridSize(ptr, tileGridSize); + } + + /// + /// + /// + /// + public Size GetTilesGridSize() + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + + return NativeMethods.imgproc_CLAHE_getTilesGridSize(ptr); + } + + /// + /// + /// + public Size TilesGridSize + { + get { return GetTilesGridSize(); } + set { SetTilesGridSize(value); } + } + + + /// + /// + /// + public void CollectGarbage() + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + + NativeMethods.imgproc_CLAHE_collectGarbage(ptr); + } + } +} diff --git a/src/OpenCvSharp/modules/imgproc/ConnectedComponent.cs b/src/OpenCvSharp/modules/imgproc/ConnectedComponent.cs new file mode 100644 index 000000000..4aa916a61 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/ConnectedComponent.cs @@ -0,0 +1,245 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// connected components that is returned from Cv2.ConnectedComponentsEx + /// + public class ConnectedComponents + { + /// + /// All blobs + /// + public ReadOnlyCollection Blobs { get; internal set; } + + /// + /// destination labeled value + /// + public int[,] Labels { get; internal set; } + + /// + /// The number of labels -1 + /// + public int LabelCount { get; internal set; } + + /// + /// Constructor + /// + /// + /// + /// + internal ConnectedComponents(IList blobs, int[,] labels, int labelCount) + { + Blobs = new ReadOnlyCollection(blobs); + Labels = labels; + LabelCount = labelCount; + } + + /// + /// Filter a image with the specified label value. + /// + /// Source image. + /// Destination image. + /// Label value. + /// Filtered image. + public Mat FilterByLabel(Mat src, Mat dst, int labelValue) + { + return FilterByLabels(src, dst, new[] {labelValue}); + } + + /// + /// Filter a image with the specified label values. + /// + /// Source image. + /// Destination image. + /// Label values. + /// Filtered image. + public Mat FilterByLabels(Mat src, Mat dst, IEnumerable labelValues) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (labelValues == null) + throw new ArgumentNullException("labelValues"); + int[] labelArray = EnumerableEx.ToArray(labelValues); + if (labelArray.Length == 0) + throw new ArgumentException("empty labelValues"); + + foreach (int labelValue in labelArray) + { + if (labelValue < 0 || labelValue >= LabelCount) + throw new ArgumentException("0 <= x < LabelCount"); + } + + // マスク用Matを用意し、Andで切り抜く + using (Mat mask = GetLabelMask(labelArray[0])) + { + for (int i = 1; i < labelArray.Length; i++) + { + using (var maskI = GetLabelMask(labelArray[i])) + { + Cv2.BitwiseOr(mask, maskI, mask); + } + } + src.CopyTo(dst, mask); + return dst; + } + } + + /// + /// Filter a image with the specified blob object. + /// + /// Source image. + /// Destination image. + /// Blob value. + /// Filtered image. + public Mat FilterByBlob(Mat src, Mat dst, Blob blob) + { + return FilterByLabels(src, dst, new[] {blob.Label}); + } + + /// + /// Filter a image with the specified blob objects. + /// + /// Source image. + /// Destination image. + /// Blob values. + /// Filtered image. + public Mat FilterBlobs(Mat src, Mat dst, IEnumerable blobs) + { + return FilterByLabels(src, dst, EnumerableEx.Select(blobs, b => b.Label)); + } + + /// + /// Draws all blobs to the specified image. + /// + /// The target image to be drawn. + public void RenderBlobs(Mat img) + { + if (img == null) + throw new ArgumentNullException("img"); + /* + if (img.Empty()) + throw new ArgumentException("img is empty"); + if (img.Type() != MatType.CV_8UC3) + throw new ArgumentException("img must be CV_8UC3");*/ + if (Blobs == null || Blobs.Count == 0) + throw new OpenCvSharpException("Blobs is empty"); + if (Labels == null) + throw new OpenCvSharpException("Labels is empty"); + + int height = Labels.GetLength(0); + int width = Labels.GetLength(1); + img.Create(new Size(width, height), MatType.CV_8UC3); + + Scalar[] colors = new Scalar[Blobs.Count]; + colors[0] = Scalar.All(0); + for (int i = 1; i < Blobs.Count; i++) + { + colors[i] = Scalar.RandomColor(); + } + + using (var imgt = new MatOfByte3(img)) + { + var indexer = imgt.GetIndexer(); + for (int y = 0; y < height; y++) + { + for (int x = 0; x < width; x++) + { + int labelValue = Labels[y, x]; + indexer[y, x] = colors[labelValue].ToVec3b(); + } + } + } + } + + /// + /// Find the largest blob. + /// + /// the largest blob + public Blob GetLargestBlob() + { + if (Blobs == null || Blobs.Count <= 1) + throw new OpenCvSharpException("Blobs is empty"); + + Blob max = Blobs[1]; + for (int i = 2; i < Blobs.Count; i++) + { + if (max.Area < Blobs[i].Area) + max = Blobs[i]; + } + return max; + } + + /// + /// 指定したラベル値のところのみを非0で残したマスク画像を返す + /// + /// + /// + private Mat GetLabelMask(int label) + { + int rows = Labels.GetLength(0); + int cols = Labels.GetLength(1); + using (var labels = new Mat(rows, cols, MatType.CV_32SC1, Labels)) + using (var cmp = new Mat(rows, cols, MatType.CV_32SC1, Scalar.All(label))) + { + Mat result = new Mat(); + Cv2.Compare(labels, cmp, result, CmpTypes.EQ); + return result; + } + } + + /// + /// One blob + /// + public class Blob + { + /// + /// Label value + /// + public int Label { get; internal set; } + + /// + /// Floating point centroid (x,y) + /// + public Point2d Centroid { get; internal set; } + + /// + /// The leftmost (x) coordinate which is the inclusive start of the bounding box in the horizontal direction. + /// + public int Left { get; internal set; } + + /// + /// The topmost (y) coordinate which is the inclusive start of the bounding box in the vertical direction. + /// + public int Top { get; internal set; } + + /// + /// The horizontal size of the bounding box. + /// + public int Width { get; internal set; } + + /// + /// The vertical size of the bounding box. + /// + public int Height { get; internal set; } + + /// + /// The bounding box. + /// + public Rect Rect + { + get { return new Rect(Left, Top, Width, Height); } + } + + /// + /// The total area (in pixels) of the connected component. + /// + public int Area { get; internal set; } + } + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/AdaptiveThresholdTypes.cs b/src/OpenCvSharp/modules/imgproc/Enum/AdaptiveThresholdTypes.cs new file mode 100644 index 000000000..2ba411a43 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/AdaptiveThresholdTypes.cs @@ -0,0 +1,38 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// 適応的閾値処理で使用するアルゴリズムの種類 + /// +#else + /// + /// Adaptive thresholding algorithms + /// +#endif + public enum AdaptiveThresholdTypes : int + { +#if LANG_JP + /// + /// 注目ピクセルの block_size × block_size 隣接領域の平均から,param1 を引いた値を閾値とする. + /// +#else + /// + /// It is a mean of block_size × block_size pixel neighborhood, subtracted by param1. + /// +#endif + MeanC = 0, + + +#if LANG_JP + /// + /// 注目ピクセルの block_size × block_size 隣接領域の重み付き総和(ガウシアン)から param1 を引いた値を閾値とする. + /// +#else + /// + /// it is a weighted sum (Gaussian) of block_size × block_size pixel neighborhood, subtracted by param1. + /// +#endif + GaussianC = 1, + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/BorderTypes.cs b/src/OpenCvSharp/modules/imgproc/Enum/BorderTypes.cs new file mode 100644 index 000000000..49a4b9f72 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/BorderTypes.cs @@ -0,0 +1,71 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cvCopyMakeBorderで指定する, 境界線のタイプ + /// +#else + /// + /// Type of the border to create around the copied source image rectangle + /// +#endif + public enum BorderTypes : int + { +#if LANG_JP + /// + /// 境界はこの関数の最後のパラメータとして渡された定数 value で埋められる. + /// `iiiiii|abcdefgh|iiiiiii` with some specified `i` + /// +#else + /// + /// Border is filled with the fixed value, passed as last parameter of the function. + /// `iiiiii|abcdefgh|iiiiiii` with some specified `i` + /// +#endif + Constant = 0, + +#if LANG_JP + /// + /// 画像の最も上/下の行と最も左/右の列(画像領域の一番外側の値)を用いて境界線を生成する. + /// `aaaaaa|abcdefgh|hhhhhhh` + /// +#else + /// + /// The pixels from the top and bottom rows, the left-most and right-most columns are replicated to fill the border. + /// `aaaaaa|abcdefgh|hhhhhhh` + /// +#endif + Replicate = 1, + + /// + /// `fedcba|abcdefgh|hgfedcb` + /// + Reflect = 2, + + /// + /// `cdefgh|abcdefgh|abcdefg` + /// + Wrap = 3, + + /// + /// `gfedcb|abcdefgh|gfedcba` + /// + Reflect101 = 4, + + /// + /// `uvwxyz|absdefgh|ijklmno` + /// + Transparent = 5, + + /// + /// same as BORDER_REFLECT_101 + /// + Default = Reflect101, + + /// + /// do not look outside of ROI + /// + Isolated = 16, + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/ColorConversionCodes.cs b/src/OpenCvSharp/modules/imgproc/Enum/ColorConversionCodes.cs new file mode 100644 index 000000000..b34f49888 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/ColorConversionCodes.cs @@ -0,0 +1,272 @@ + +#pragma warning disable 1591 +// ReSharper disable InconsistentNaming + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// 色空間の変換の方法 + /// +#else + /// + /// Color conversion operation for cv::cvtColor + /// +#endif + public enum ColorConversionCodes : int + { + BGR2BGRA = 0, //!< add alpha channel to RGB or BGR image + RGB2RGBA = BGR2BGRA, + + BGRA2BGR = 1, //!< remove alpha channel from RGB or BGR image + RGBA2RGB = BGRA2BGR, + + BGR2RGBA = 2, //!< convert between RGB and BGR color spaces (with or without alpha channel) + RGB2BGRA = BGR2RGBA, + + RGBA2BGR = 3, + BGRA2RGB = RGBA2BGR, + + BGR2RGB = 4, + RGB2BGR = BGR2RGB, + + BGRA2RGBA = 5, + RGBA2BGRA = BGRA2RGBA, + + BGR2GRAY = 6, //!< convert between RGB/BGR and grayscale, @ref convert_rgb_gray "color conversions" + RGB2GRAY = 7, + GRAY2BGR = 8, + GRAY2RGB = GRAY2BGR, + GRAY2BGRA = 9, + GRAY2RGBA = GRAY2BGRA, + BGRA2GRAY = 10, + RGBA2GRAY = 11, + + BGR2BGR565 = 12, //!< convert between RGB/BGR and BGR565 (16-bit images) + RGB2BGR565 = 13, + BGR5652BGR = 14, + BGR5652RGB = 15, + BGRA2BGR565 = 16, + RGBA2BGR565 = 17, + BGR5652BGRA = 18, + BGR5652RGBA = 19, + + GRAY2BGR565 = 20, //!< convert between grayscale to BGR565 (16-bit images) + BGR5652GRAY = 21, + + BGR2BGR555 = 22, //!< convert between RGB/BGR and BGR555 (16-bit images) + RGB2BGR555 = 23, + BGR5552BGR = 24, + BGR5552RGB = 25, + BGRA2BGR555 = 26, + RGBA2BGR555 = 27, + BGR5552BGRA = 28, + BGR5552RGBA = 29, + + GRAY2BGR555 = 30, //!< convert between grayscale and BGR555 (16-bit images) + BGR5552GRAY = 31, + + BGR2XYZ = 32, //!< convert RGB/BGR to CIE XYZ, @ref convert_rgb_xyz "color conversions" + RGB2XYZ = 33, + XYZ2BGR = 34, + XYZ2RGB = 35, + + BGR2YCrCb = 36, //!< convert RGB/BGR to luma-chroma (aka YCC), @ref convert_rgb_ycrcb "color conversions" + RGB2YCrCb = 37, + YCrCb2BGR = 38, + YCrCb2RGB = 39, + + BGR2HSV = 40, //!< convert RGB/BGR to HSV (hue saturation value), @ref convert_rgb_hsv "color conversions" + RGB2HSV = 41, + + BGR2Lab = 44, //!< convert RGB/BGR to CIE Lab, @ref convert_rgb_lab "color conversions" + RGB2Lab = 45, + + BGR2Luv = 50, //!< convert RGB/BGR to CIE Luv, @ref convert_rgb_luv "color conversions" + RGB2Luv = 51, + BGR2HLS = 52, //!< convert RGB/BGR to HLS (hue lightness saturation), @ref convert_rgb_hls "color conversions" + RGB2HLS = 53, + + HSV2BGR = 54, //!< backward conversions to RGB/BGR + HSV2RGB = 55, + + Lab2BGR = 56, + Lab2RGB = 57, + Luv2BGR = 58, + Luv2RGB = 59, + HLS2BGR = 60, + HLS2RGB = 61, + + BGR2HSV_FULL = 66, //!< + RGB2HSV_FULL = 67, + BGR2HLS_FULL = 68, + RGB2HLS_FULL = 69, + + HSV2BGR_FULL = 70, + HSV2RGB_FULL = 71, + HLS2BGR_FULL = 72, + HLS2RGB_FULL = 73, + + LBGR2Lab = 74, + LRGB2Lab = 75, + LBGR2Luv = 76, + LRGB2Luv = 77, + + Lab2LBGR = 78, + Lab2LRGB = 79, + Luv2LBGR = 80, + Luv2LRGB = 81, + + BGR2YUV = 82, //!< convert between RGB/BGR and YUV + RGB2YUV = 83, + YUV2BGR = 84, + YUV2RGB = 85, + + //! YUV 4:2:0 family to RGB + YUV2RGB_NV12 = 90, + YUV2BGR_NV12 = 91, + YUV2RGB_NV21 = 92, + YUV2BGR_NV21 = 93, + YUV420sp2RGB = YUV2RGB_NV21, + YUV420sp2BGR = YUV2BGR_NV21, + + YUV2RGBA_NV12 = 94, + YUV2BGRA_NV12 = 95, + YUV2RGBA_NV21 = 96, + YUV2BGRA_NV21 = 97, + YUV420sp2RGBA = YUV2RGBA_NV21, + YUV420sp2BGRA = YUV2BGRA_NV21, + + YUV2RGB_YV12 = 98, + YUV2BGR_YV12 = 99, + YUV2RGB_IYUV = 100, + YUV2BGR_IYUV = 101, + YUV2RGB_I420 = YUV2RGB_IYUV, + YUV2BGR_I420 = YUV2BGR_IYUV, + YUV420p2RGB = YUV2RGB_YV12, + YUV420p2BGR = YUV2BGR_YV12, + + YUV2RGBA_YV12 = 102, + YUV2BGRA_YV12 = 103, + YUV2RGBA_IYUV = 104, + YUV2BGRA_IYUV = 105, + YUV2RGBA_I420 = YUV2RGBA_IYUV, + YUV2BGRA_I420 = YUV2BGRA_IYUV, + YUV420p2RGBA = YUV2RGBA_YV12, + YUV420p2BGRA = YUV2BGRA_YV12, + + YUV2GRAY_420 = 106, + YUV2GRAY_NV21 = YUV2GRAY_420, + YUV2GRAY_NV12 = YUV2GRAY_420, + YUV2GRAY_YV12 = YUV2GRAY_420, + YUV2GRAY_IYUV = YUV2GRAY_420, + YUV2GRAY_I420 = YUV2GRAY_420, + YUV420sp2GRAY = YUV2GRAY_420, + YUV420p2GRAY = YUV2GRAY_420, + + //! YUV 4:2:2 family to RGB + YUV2RGB_UYVY = 107, + YUV2BGR_UYVY = 108, + //YUV2RGB_VYUY = 109, + //YUV2BGR_VYUY = 110, + YUV2RGB_Y422 = YUV2RGB_UYVY, + YUV2BGR_Y422 = YUV2BGR_UYVY, + YUV2RGB_UYNV = YUV2RGB_UYVY, + YUV2BGR_UYNV = YUV2BGR_UYVY, + + YUV2RGBA_UYVY = 111, + YUV2BGRA_UYVY = 112, + //YUV2RGBA_VYUY = 113, + //YUV2BGRA_VYUY = 114, + YUV2RGBA_Y422 = YUV2RGBA_UYVY, + YUV2BGRA_Y422 = YUV2BGRA_UYVY, + YUV2RGBA_UYNV = YUV2RGBA_UYVY, + YUV2BGRA_UYNV = YUV2BGRA_UYVY, + + YUV2RGB_YUY2 = 115, + YUV2BGR_YUY2 = 116, + YUV2RGB_YVYU = 117, + YUV2BGR_YVYU = 118, + YUV2RGB_YUYV = YUV2RGB_YUY2, + YUV2BGR_YUYV = YUV2BGR_YUY2, + YUV2RGB_YUNV = YUV2RGB_YUY2, + YUV2BGR_YUNV = YUV2BGR_YUY2, + + YUV2RGBA_YUY2 = 119, + YUV2BGRA_YUY2 = 120, + YUV2RGBA_YVYU = 121, + YUV2BGRA_YVYU = 122, + YUV2RGBA_YUYV = YUV2RGBA_YUY2, + YUV2BGRA_YUYV = YUV2BGRA_YUY2, + YUV2RGBA_YUNV = YUV2RGBA_YUY2, + YUV2BGRA_YUNV = YUV2BGRA_YUY2, + + YUV2GRAY_UYVY = 123, + YUV2GRAY_YUY2 = 124, + //CV_YUV2GRAY_VYUY = CV_YUV2GRAY_UYVY, + YUV2GRAY_Y422 = YUV2GRAY_UYVY, + YUV2GRAY_UYNV = YUV2GRAY_UYVY, + YUV2GRAY_YVYU = YUV2GRAY_YUY2, + YUV2GRAY_YUYV = YUV2GRAY_YUY2, + YUV2GRAY_YUNV = YUV2GRAY_YUY2, + + //! alpha premultiplication + RGBA2mRGBA = 125, + mRGBA2RGBA = 126, + + //! RGB to YUV 4:2:0 family + RGB2YUV_I420 = 127, + BGR2YUV_I420 = 128, + RGB2YUV_IYUV = RGB2YUV_I420, + BGR2YUV_IYUV = BGR2YUV_I420, + + RGBA2YUV_I420 = 129, + BGRA2YUV_I420 = 130, + RGBA2YUV_IYUV = RGBA2YUV_I420, + BGRA2YUV_IYUV = BGRA2YUV_I420, + RGB2YUV_YV12 = 131, + BGR2YUV_YV12 = 132, + RGBA2YUV_YV12 = 133, + BGRA2YUV_YV12 = 134, + + //! Demosaicing + BayerBG2BGR = 46, + BayerGB2BGR = 47, + BayerRG2BGR = 48, + BayerGR2BGR = 49, + + BayerBG2RGB = BayerRG2BGR, + BayerGB2RGB = BayerGR2BGR, + BayerRG2RGB = BayerBG2BGR, + BayerGR2RGB = BayerGB2BGR, + + BayerBG2GRAY = 86, + BayerGB2GRAY = 87, + BayerRG2GRAY = 88, + BayerGR2GRAY = 89, + + //! Demosaicing using Variable Number of Gradients + BayerBG2BGR_VNG = 62, + BayerGB2BGR_VNG = 63, + BayerRG2BGR_VNG = 64, + BayerGR2BGR_VNG = 65, + + BayerBG2RGB_VNG = BayerRG2BGR_VNG, + BayerGB2RGB_VNG = BayerGR2BGR_VNG, + BayerRG2RGB_VNG = BayerBG2BGR_VNG, + BayerGR2RGB_VNG = BayerGB2BGR_VNG, + + //! Edge-Aware Demosaicing + BayerBG2BGR_EA = 135, + BayerGB2BGR_EA = 136, + BayerRG2BGR_EA = 137, + BayerGR2BGR_EA = 138, + + BayerBG2RGB_EA = BayerRG2BGR_EA, + BayerGB2RGB_EA = BayerGR2BGR_EA, + BayerRG2RGB_EA = BayerBG2BGR_EA, + BayerGR2RGB_EA = BayerGB2BGR_EA, + + COLORCVT_MAX = 139 + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/ColormapTypes.cs b/src/OpenCvSharp/modules/imgproc/Enum/ColormapTypes.cs new file mode 100644 index 000000000..58f115043 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/ColormapTypes.cs @@ -0,0 +1,25 @@ +using System; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ + /// + /// GNU Octave/MATLAB equivalent colormaps + /// + public enum ColormapTypes : int + { + Autumn = 0, + Bone = 1, + Jet = 2, + Winter = 3, + Rainbow = 4, + Ocean = 5, + Summer = 6, + Spring = 7, + Cool = 8, + Hsv = 9, + Pink = 10, + Hot = 11, + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/ConnectedComponentsTypes.cs b/src/OpenCvSharp/modules/imgproc/Enum/ConnectedComponentsTypes.cs new file mode 100644 index 000000000..cc1520033 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/ConnectedComponentsTypes.cs @@ -0,0 +1,35 @@ +namespace OpenCvSharp +{ + /// + /// components algorithm output formats + /// + public enum ConnectedComponentsTypes + { + /// + /// The leftmost (x) coordinate which is the inclusive start of the bounding + /// box in the horizontal direction. + /// + Left = 0, + + /// + /// The topmost (y) coordinate which is the inclusive start of the bounding + /// box in the vertical direction. + /// + Top = 1, + + /// + /// The horizontal size of the bounding box + /// + Width = 2, + + /// + /// The vertical size of the bounding box + /// + Height = 3, + + /// + /// The total area (in pixels) of the connected component + /// + Area = 4, + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/ContourApproximationModes.cs b/src/OpenCvSharp/modules/imgproc/Enum/ContourApproximationModes.cs new file mode 100644 index 000000000..e69ccf92c --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/ContourApproximationModes.cs @@ -0,0 +1,64 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// 輪郭の近似手法 + /// +#else + /// + /// Approximation method (for all the modes, except CV_RETR_RUNS, which uses built-in approximation). + /// +#endif + public enum ContourApproximationModes : int + { +#if LANG_JP + /// + /// [CHAIN_APPROX_NONE] + /// +#else + /// + /// CHAIN_APPROX_NONE - translate all the points from the chain code into points; + /// +#endif + ApproxNone = 1, + + +#if LANG_JP + /// + /// 水平・垂直・斜めの線分を圧縮し,それらの端点のみを残します.例えば,まっすぐな矩形の輪郭線は,4つの点にエンコードされます. [CV_CHAIN_APPROX_SIMPLE] + /// +#else + /// + /// CHAIN_APPROX_SIMPLE - compress horizontal, vertical, and diagonal segments, that is, the function leaves only their ending points; + /// +#endif + ApproxSimple = 2, + + +#if LANG_JP + /// + /// Teh-Chinチェーン近似アルゴリズムの1つを適用します. TehChin89 を参照してください. [CV_CHAIN_APPROX_TC89_L1] + /// +#else + /// + /// CHAIN_APPROX_TC89_L1 - apply one of the flavors of Teh-Chin chain approximation algorithm. + /// +#endif +// ReSharper disable once InconsistentNaming + ApproxTC89L1 = 3, + + +#if LANG_JP + /// + /// Teh-Chinチェーン近似アルゴリズムの1つを適用します. TehChin89 を参照してください. [CV_CHAIN_APPROX_TC89_KCOS] + /// +#else + /// + /// CHAIN_APPROX_TC89_KCOS - apply one of the flavors of Teh-Chin chain approximation algorithm. + /// +#endif +// ReSharper disable once InconsistentNaming + ApproxTC89KCOS = 4, + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/DistanceMaskSize.cs b/src/OpenCvSharp/modules/imgproc/Enum/DistanceMaskSize.cs new file mode 100644 index 000000000..d5e45631c --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/DistanceMaskSize.cs @@ -0,0 +1,32 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// 距離変換 (distance transform) のマスクサイズ + /// +#else + /// + /// Mask size for distance transform + /// +#endif + [Flags] + public enum DistanceMaskSize : int + { + /// + /// 3 + /// + Mask3 = 3, + + /// + /// 5 + /// + Mask5 = 5, + + /// + /// + /// + Precise = 0, + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/DistanceTransformLabelTypes.cs b/src/OpenCvSharp/modules/imgproc/Enum/DistanceTransformLabelTypes.cs new file mode 100644 index 000000000..45d0db6a7 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/DistanceTransformLabelTypes.cs @@ -0,0 +1,20 @@ +namespace OpenCvSharp +{ + /// + /// distanceTransform algorithm flags + /// + public enum DistanceTransformLabelTypes : int + { + /// + /// each connected component of zeros in src + /// (as well as all the non-zero pixels closest to the connected component) + /// will be assigned the same label + /// + CComp = 0, + + /// + /// each zero pixel (and all the non-zero pixels closest to it) gets its own label. + /// + Pixel = 1, + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/DistanceTypes.cs b/src/OpenCvSharp/modules/imgproc/Enum/DistanceTypes.cs new file mode 100644 index 000000000..79d0bb0d3 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/DistanceTypes.cs @@ -0,0 +1,55 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cvDistTransformで指定する距離の種類 + /// +#else + /// + /// Type of distance for cvDistTransform + /// +#endif + public enum DistanceTypes : int + { + /// + /// User defined distance [CV_DIST_USER] + /// + User = -1, + + /// + /// distance = |x1-x2| + |y1-y2| [CV_DIST_L1] + /// + L1 = 1, + + /// + /// the simple euclidean distance [CV_DIST_L2] + /// + L2 = 2, + + /// + /// distance = max(|x1-x2|,|y1-y2|) [CV_DIST_C] + /// + C = 3, + + /// + /// L1-L2 metric: distance = 2(sqrt(1+x*x/2) - 1)) [CV_DIST_L12] + /// + L12 = 4, + + /// + /// distance = c^2(|x|/c-log(1+|x|/c)), c = 1.3998 [CV_DIST_FAIR] + /// + Fair = 5, + + /// + /// distance = c^2/2(1-exp(-(x/c)^2)), c = 2.9846 [CV_DIST_WELSCH] + /// + Welsch = 6, + + /// + /// distance = |x|<c ? x^2/2 : c(|x|-c/2), c=1.345 [CV_DIST_HUBER] + /// + Huber = 7, + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/FlipMode.cs b/src/OpenCvSharp/modules/imgproc/Enum/FlipMode.cs new file mode 100644 index 000000000..8650cbe69 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/FlipMode.cs @@ -0,0 +1,50 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// 配列の反転方法 + /// +#else + /// + /// Specifies how to flip the array + /// +#endif + public enum FlipMode : int + { +#if LANG_JP + /// + /// x軸周りでの反転 + /// +#else + /// + /// means flipping around x-axis + /// +#endif + X = 0, + + +#if LANG_JP + /// + /// y軸周りでの反転 + /// +#else + /// + /// means flipping around y-axis + /// +#endif + Y = 1, + + +#if LANG_JP + /// + /// 両軸周りでの反転 + /// +#else + /// + /// means flipping around both axises + /// +#endif + XY = -1 + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/FloodFillFlags.cs b/src/OpenCvSharp/modules/imgproc/Enum/FloodFillFlags.cs new file mode 100644 index 000000000..b7c59d473 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/FloodFillFlags.cs @@ -0,0 +1,70 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// floodFillの処理フラグ + /// +#else + /// + /// floodFill Operation flags. Lower bits contain a connectivity value, 4 (default) or 8, used within the function. Connectivity determines which neighbors of a pixel are considered. Upper bits can be 0 or a combination of the following flags: + /// +#endif + [Flags] + public enum FloodFillFlags : int + { +#if LANG_JP + /// + /// 4連結による線分 + /// [= 4] + /// +#else + /// + /// 4-connected line. + /// [= 4] + /// +#endif + Link4 = 4, + +#if LANG_JP + /// + /// 8連結による線分 + /// [= 8] + /// +#else + /// + /// 8-connected line. + /// [= 8] + /// +#endif + Link8 = 8, + +#if LANG_JP + /// + /// If set, the difference between the current pixel and seed pixel is considered. Otherwise, the difference between neighbor pixels is considered (that is, the range is floating). + /// [CV_FLOODFILL_FIXED_RANGE] + /// +#else + /// + /// If set, the difference between the current pixel and seed pixel is considered. Otherwise, the difference between neighbor pixels is considered (that is, the range is floating). + /// [CV_FLOODFILL_FIXED_RANGE] + /// +#endif + FixedRange = 1 << 16, + + +#if LANG_JP + /// + /// If set, the function does not change the image ( newVal is ignored), but fills the mask. The flag can be used for the second variant only. + /// [CV_FLOODFILL_MASK_ONLY] + /// +#else + /// + /// If set, the function does not change the image ( newVal is ignored), but fills the mask. The flag can be used for the second variant only. + /// [CV_FLOODFILL_MASK_ONLY] + /// +#endif + MaskOnly = 1 << 17, + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/GrabCutClasses.cs b/src/OpenCvSharp/modules/imgproc/Enum/GrabCutClasses.cs new file mode 100644 index 000000000..7338e2962 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/GrabCutClasses.cs @@ -0,0 +1,28 @@ +namespace OpenCvSharp +{ + /// + /// class of the pixel in GrabCut algorithm + /// + public enum GrabCutClasses + { + /// + /// an obvious background pixels + /// + BGD = 0, + + /// + /// an obvious foreground (object) pixel + /// + FGD = 1, + + /// + /// a possible background pixel + /// + PR_BGD = 2, + + /// + /// a possible foreground pixel + /// + PR_FGD = 3 + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/GrabCutModes.cs b/src/OpenCvSharp/modules/imgproc/Enum/GrabCutModes.cs new file mode 100644 index 000000000..07dc05917 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/GrabCutModes.cs @@ -0,0 +1,59 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// GrabCutの処理フラグ + /// +#else + /// + /// GrabCut algorithm flags + /// +#endif + [Flags] + public enum GrabCutModes + { +#if LANG_JP + /// + /// 与えられた矩形を用いて,状態とマスクを初期化します. + /// その後,アルゴリズムが iterCount 回繰り返されます. + /// +#else + /// + /// The function initializes the state and the mask using the provided rectangle. + /// After that it runs iterCount iterations of the algorithm. + /// +#endif + InitWithRect = 0, + + +#if LANG_JP + /// + /// 与えられたマスクを用いて状態を初期化します. + /// GC_INIT_WITH_RECT と GC_INIT_WITH_MASK は,一緒に使うことができる + /// ことに注意してください.そして,ROIの外側の全ピクセルは自動的に + /// GC_BGD として初期化されます. + /// +#else + /// + /// The function initializes the state using the provided mask. + /// Note that GC_INIT_WITH_RECT and GC_INIT_WITH_MASK can be combined. + /// Then, all the pixels outside of the ROI are automatically initialized with GC_BGD . + /// +#endif + InitWithMask = 1, + + +#if LANG_JP + /// + /// アルゴリズムがすぐに再開することを意味する値. + /// +#else + /// + /// The value means that the algorithm should just resume. + /// +#endif + Eval = 2, + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/HistCompMethods.cs b/src/OpenCvSharp/modules/imgproc/Enum/HistCompMethods.cs new file mode 100644 index 000000000..853fb519a --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/HistCompMethods.cs @@ -0,0 +1,80 @@ +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cvCompareHistで用いる、CvHistogramの比較方法 + /// +#else + /// + /// Comparison methods for cvCompareHist + /// +#endif + public enum HistCompMethods : int + { +#if LANG_JP + /// + /// 相関 [CV_COMP_CORREL] + /// +#else + /// + /// Correlation [CV_COMP_CORREL] + /// +#endif + Correl = 0, + + +#if LANG_JP + /// + /// カイ二乗 [CV_COMP_CHISQR] + /// +#else + /// + /// Chi-Square [CV_COMP_CHISQR] + /// +#endif + Chisqr = 1, + + +#if LANG_JP + /// + /// 交差 [CV_COMP_INTERSECT] + /// +#else + /// + /// Intersection [CV_COMP_INTERSECT] + /// +#endif + Intersect = 2, + + +#if LANG_JP + /// + /// Bhattacharyya距離 [CV_COMP_BHATTACHARYYA]. 正規化されたヒストグラムでのみ実行可能である. + /// +#else + /// + /// Bhattacharyya distance [CV_COMP_BHATTACHARYYA] + /// +#endif + Bhattacharyya = 3, + + /// + /// Synonym for HISTCMP_BHATTACHARYYA + /// + Hellinger = Bhattacharyya, + + /// + /// Alternative Chi-Square + /// \f[d(H_1,H_2) = 2 * \sum _I \frac{\left(H_1(I)-H_2(I)\right)^2}{H_1(I)+H_2(I)}\f] + /// This alternative formula is regularly used for texture comparison. See e.g. @cite Puzicha1997 + /// + ChisqrAlt = 4, + + /// + /// Kullback-Leibler divergence + /// \f[d(H_1,H_2) = \sum _I H_1(I) \log \left(\frac{H_1(I)}{H_2(I)}\right)\f] + /// +// ReSharper disable once InconsistentNaming + KLDiv = 5 + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/HoughMethods.cs b/src/OpenCvSharp/modules/imgproc/Enum/HoughMethods.cs new file mode 100644 index 000000000..7456ea71d --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/HoughMethods.cs @@ -0,0 +1,44 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// ハフ変換の種類 + /// +#else + /// + /// Variants of a Hough transform + /// +#endif + public enum HoughMethods : int + { + /* */ + /// + /// classical or standard Hough transform. + /// Every line is represented by two floating-point numbers \f$(\rho, \theta)\f$ , + /// where \f$\rho\f$ is a distance between (0,0) point and the line, + /// and \f$\theta\f$ is the angle between x-axis and the normal to the line. + /// Thus, the matrix must be (the created sequence will be) of CV_32FC2 type + /// + Standard = 0, + + /// + /// probabilistic Hough transform (more efficient in case if the picture contains + /// a few long linear segments). It returns line segments rather than the whole line. + /// Each segment is represented by starting and ending points, and the matrix must be + /// (the created sequence will be) of the CV_32SC4 type. + /// + Probabilistic = 1, + + /// + /// multi-scale variant of the classical Hough transform. + /// The lines are encoded the same way as HOUGH_STANDARD. + /// + MultiScale = 2, + + /// + /// basically *21HT*, described in @cite Yuen90 + /// + Gradient = 3 + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/InterpolationFlags.cs b/src/OpenCvSharp/modules/imgproc/Enum/InterpolationFlags.cs new file mode 100644 index 000000000..fafc5338a --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/InterpolationFlags.cs @@ -0,0 +1,95 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// 画像の補間方法 + /// +#else + /// + /// Interpolation algorithm + /// +#endif + [Flags] + public enum InterpolationFlags : int + { +#if LANG_JP + /// + /// 最近隣接補間 + /// +#else + /// + /// Nearest-neighbor interpolation, + /// +#endif + Nearest = 0, + +#if LANG_JP + /// + /// バイリニア補間 + /// +#else + /// + /// Bilinear interpolation (used by default) + /// +#endif + Linear = 1, + +#if LANG_JP + /// + /// バイキュービック補間 + /// +#else + /// + /// Bicubic interpolation. + /// +#endif + Cubic = 2, + +#if LANG_JP + /// + /// ピクセル領域の関係を用いてリサンプリングする.画像縮小の際は,モアレの無い処理結果を得ることができる手法である.拡大の際は,CV_INTER_NN と同様 . + /// +#else + /// + /// Resampling using pixel area relation. It is the preferred method for image decimation that gives moire-free results. In case of zooming it is similar to CV_INTER_NN method. + /// +#endif + Area = 3, + + /// + /// Lanczos interpolation over 8x8 neighborhood + /// + Lanczos4 = 4, + + /// + /// mask for interpolation codes + /// + Max = 7, + +#if LANG_JP + /// + /// 出力画像の全ピクセルの値を埋める.対応ピクセルが入力画像外であるようなピクセルである場合は, fillvalがセットされる + /// +#else + /// + /// Fill all the destination image pixels. If some of them correspond to outliers in the source image, they are set to fillval. + /// +#endif + WarpFillOutliers = 8, + +#if LANG_JP + /// + /// このフラグは map_matrixが出力画像から入力画像への逆変換のための行列であることを意味するので,直接ピクセル補間に用いることができる. + /// これがセットされていない場合,この関数は map_matrix を使って逆変換を計算する. + /// +#else + /// + /// Indicates that matrix is inverse transform from destination image to source and, + /// thus, can be used directly for pixel interpolation. Otherwise, the function finds the inverse transform from map_matrix. + /// +#endif + WarpInverseMap = 16, + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/LineSegmentDetectorModes.cs b/src/OpenCvSharp/modules/imgproc/Enum/LineSegmentDetectorModes.cs new file mode 100644 index 000000000..f85d2a25c --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/LineSegmentDetectorModes.cs @@ -0,0 +1,24 @@ +namespace OpenCvSharp +{ + /// + /// Variants of Line Segment %Detector + /// + public enum LineSegmentDetectorModes : int + { + /// + /// No refinement applied + /// + RefineNone = 0, + + /// + /// Standard refinement is applied. E.g. breaking arches into smaller straighter line approximations. + /// + RefineStd = 1, + + /// + /// Advanced refinement. Number of false alarms is calculated, lines are + /// refined through increase of precision, decrement in size, etc. + /// + RefineAdv = 2, + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/LineTypes.cs b/src/OpenCvSharp/modules/imgproc/Enum/LineTypes.cs new file mode 100644 index 000000000..ddc999f26 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/LineTypes.cs @@ -0,0 +1,35 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// 線分の種類 + /// +#else + /// + /// Type of the line + /// +#endif + public enum LineTypes : int + { + /// + /// + /// + Filled = -1, + + /// + /// 8-connected line. + /// + Link8 = 8, + + /// + /// 4-connected line. + /// + Link4 = 4, + + /// + /// Antialiased line. + /// + AntiAlias = 16 + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/MarkerStyle.cs b/src/OpenCvSharp/modules/imgproc/Enum/MarkerStyle.cs new file mode 100644 index 000000000..1c140f7d5 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/MarkerStyle.cs @@ -0,0 +1,125 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// Mat.DrawMarkerで用いるマーカーの形状 + /// +#else + /// + /// Marker styles for Mat.DrawMarker + /// +#endif + public enum MarkerStyle : int + { +#if LANG_JP + /// + /// 円(線のみ) + /// +#else + /// + /// A circle polyline + /// +#endif + CircleLine, + +#if LANG_JP + /// + /// 円(塗りつぶし) + /// +#else + /// + /// A filled circle + /// +#endif + CircleFilled, + +#if LANG_JP + /// + /// 十字 + /// +#else + /// + /// A cross + /// +#endif + Cross, + +#if LANG_JP + /// + /// バツ + /// +#else + /// + /// A tilted cross + /// +#endif + TiltedCross, + +#if LANG_JP + /// + /// 円と十字 + /// +#else + /// + /// A circle and a cross + /// +#endif + CircleAndCross, + +#if LANG_JP + /// + /// 円とバツ + /// +#else + /// + /// A circle and a tilted cross + /// +#endif + CircleAndTiltedCross, + +#if LANG_JP + /// + /// 菱形(線のみ) + /// +#else + /// + /// A diamond polyline + /// +#endif + DiamondLine, + +#if LANG_JP + /// + /// 菱形(塗りつぶし) + /// +#else + /// + /// A filled diamond + /// +#endif + DiamondFilled, + +#if LANG_JP + /// + /// 正方形(線のみ) + /// +#else + /// + /// A square polyline + /// +#endif + SquareLine, + +#if LANG_JP + /// + /// 正方形(塗りつぶし) + /// +#else + /// + /// A filledsquare + /// +#endif + SquareFilled, + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/MorphShapes.cs b/src/OpenCvSharp/modules/imgproc/Enum/MorphShapes.cs new file mode 100644 index 000000000..b19b5ce39 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/MorphShapes.cs @@ -0,0 +1,50 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// 構造要素の形状 + /// +#else + /// + /// Shape of the structuring element + /// +#endif + public enum MorphShapes : int + { +#if LANG_JP + /// + /// 矩形 + /// +#else + /// + /// A rectangular element + /// +#endif + Rect = 0, + + +#if LANG_JP + /// + /// 十字型 + /// +#else + /// + /// A cross-shaped element + /// +#endif + Cross = 1, + + +#if LANG_JP + /// + /// 楕円 + /// +#else + /// + /// An elliptic element + /// +#endif + Ellipse = 2, + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/MorphTypes.cs b/src/OpenCvSharp/modules/imgproc/Enum/MorphTypes.cs new file mode 100644 index 000000000..2865b9df4 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/MorphTypes.cs @@ -0,0 +1,91 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// モルフォロジー演算の種類 + /// +#else + /// + /// Type of morphological operation + /// +#endif + [Flags] + public enum MorphTypes : int + { + /// + /// + /// + ERODE = 0, + + /// + /// + /// + DILATE = 1, + +#if LANG_JP + /// + /// オープニング [CV_MOP_OPEN]. + /// dst=open(src,element)=dilate(erode(src,element),element) + /// +#else + /// + /// Opening + /// +#endif + Open = 2, + + +#if LANG_JP + /// + /// クロージング [CV_MOP_CLOSE]. + /// dst=close(src,element)=erode(dilate(src,element),element) + /// +#else + /// + /// Closing + /// +#endif + Close = 3, + + +#if LANG_JP + /// + /// モルフォロジー勾配(エッジ検出) [CV_MOP_GRADIENT]. + /// dst=morph_grad(src,element)=dilate(src,element)-erode(src,element) + /// +#else + /// + /// Morphological gradient + /// +#endif + Gradient = 4, + + +#if LANG_JP + /// + /// トップハット変換(top hat) [CV_MOP_TOPHAT]. + /// dst=tophat(src,element)=src-open(src,element) + /// +#else + /// + /// "Top hat" + /// +#endif + TopHat = 5, + + +#if LANG_JP + /// + /// ブラックハット変換(black hat) [CV_MOP_BLACKHAT] + /// dst=blackhat(src,element)=close(src,element)-src + /// +#else + /// + /// "Black hat" + /// +#endif + BlackHat = 6, + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/PixelConnectivity.cs b/src/OpenCvSharp/modules/imgproc/Enum/PixelConnectivity.cs new file mode 100644 index 000000000..093aaec12 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/PixelConnectivity.cs @@ -0,0 +1,38 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// CvLineIteratorにおける、走査した線分の接続性 + /// +#else + /// + /// PixelConnectivity for LineIterator + /// +#endif + public enum PixelConnectivity : int + { +#if LANG_JP + /// + /// 周囲4方向(上下左右) + /// +#else + /// + /// Connectivity 4 (N,S,E,W) + /// +#endif + Connectivity4 = 4, + + +#if LANG_JP + /// + /// 周囲8方向 + /// +#else + /// + /// Connectivity 8 (N,S,E,W,NE,SE,SW,NW) + /// +#endif + Connectivity8 = 8, + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/ProjectionType.cs b/src/OpenCvSharp/modules/imgproc/Enum/ProjectionType.cs new file mode 100644 index 000000000..9caf14f9e --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/ProjectionType.cs @@ -0,0 +1,25 @@ +using System; + +namespace OpenCvSharp +{ + /// + /// cv::initWideAngleProjMap flags + /// + public enum ProjectionType : int + { + /// + /// + /// + None = 0, + + /// + /// + /// + SphericalOrtho = 0, + + /// + /// + /// + SphericalEqRect = 1, + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/RectanglesIntersectTypes.cs b/src/OpenCvSharp/modules/imgproc/Enum/RectanglesIntersectTypes.cs new file mode 100644 index 000000000..920e0ff81 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/RectanglesIntersectTypes.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// types of intersection between rectangles + /// + public enum RectanglesIntersectTypes + { + /// + /// No intersection + /// + None = 0, + + /// + /// There is a partial intersection + /// + Partial = 1, + + /// + /// One of the rectangle is fully enclosed in the other + /// + Full = 2 + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/RetrievalModes.cs b/src/OpenCvSharp/modules/imgproc/Enum/RetrievalModes.cs new file mode 100644 index 000000000..bd0139e6d --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/RetrievalModes.cs @@ -0,0 +1,80 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// 輪郭の抽出モード + /// +#else + /// + /// mode of the contour retrieval algorithm + /// +#endif + public enum RetrievalModes : int + { +#if LANG_JP + /// + /// 最も外側の輪郭のみ抽出 + /// +#else + /// + /// retrieves only the extreme outer contours. + /// It sets `hierarchy[i][2]=hierarchy[i][3]=-1` for all the contours. + /// +#endif + External = 0, + +#if LANG_JP + /// + /// 全ての輪郭を抽出し,リストに追加 + /// [CV_RETR_LIST] + /// +#else + /// + /// retrieves all of the contours without establishing any hierarchical relationships. + /// +#endif + List = 1, + + +#if LANG_JP + /// + /// 全ての輪郭を抽出し,二つのレベルを持つ階層構造を構成する.1番目のレベルは連結成分の外側の境界線,2番目のレベルは穴(連結成分の内側に存在する)の境界線 + /// +#else + /// + /// retrieves all of the contours and organizes them into a two-level hierarchy. + /// At the top level, there are external boundaries of the components. + /// At the second level, there are boundaries of the holes. If there is another + /// contour inside a hole of a connected component, it is still put at the top level. + /// +#endif + CComp = 2, + + +#if LANG_JP + /// + /// 全ての輪郭を抽出し,枝分かれした輪郭を完全に表現する階層構造を構成する + /// +#else + /// + /// retrieves all of the contours and reconstructs a full hierarchy + /// of nested contours. + /// +#endif + Tree = 3, + + +#if LANG_JP + /// + /// + /// [CV_RETR_FLOODFILL] + /// +#else + /// + /// + /// +#endif + FloodFill = 4, + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/ShapeMatchModes.cs b/src/OpenCvSharp/modules/imgproc/Enum/ShapeMatchModes.cs new file mode 100644 index 000000000..095255054 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/ShapeMatchModes.cs @@ -0,0 +1,30 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cv::matchShapesで用いる比較手法 + /// +#else + /// + /// Comparison methods for cv::matchShapes + /// +#endif + public enum ShapeMatchModes : int + { + /// + /// \f[I_1(A,B) = \sum _{i=1...7} \left | \frac{1}{m^A_i} - \frac{1}{m^B_i} \right |\f] + /// + I1 = 1, + + /// + /// \f[I_2(A,B) = \sum _{i=1...7} \left | m^A_i - m^B_i \right |\f] + /// + I2 = 2, + + /// + /// \f[I_3(A,B) = \max _{i=1...7} \frac{ \left| m^A_i - m^B_i \right| }{ \left| m^A_i \right| }\f] + /// + I3 = 3, + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/TemplateMatchModes.cs b/src/OpenCvSharp/modules/imgproc/Enum/TemplateMatchModes.cs new file mode 100644 index 000000000..39fc164a1 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/TemplateMatchModes.cs @@ -0,0 +1,47 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// テンプレートマッチングの方法 + /// +#else + /// + /// Specifies the way the template must be compared with image regions + /// +#endif + public enum TemplateMatchModes : int + { + /// + /// \f[R(x,y)= \sum _{x',y'} (T(x',y')-I(x+x',y+y'))^2\f] + /// + SqDiff = 0, + + /// + /// \f[R(x,y)= \frac{\sum_{x',y'} (T(x',y')-I(x+x',y+y'))^2}{\sqrt{\sum_{x',y'}T(x',y')^2 \cdot \sum_{x',y'} I(x+x',y+y')^2}}\f] + /// + SqDiffNormed = 1, + + /// + /// \f[R(x,y)= \sum _{x',y'} (T(x',y') \cdot I(x+x',y+y'))\f] + /// + CCorr = 2, + + /// + /// \f[R(x,y)= \frac{\sum_{x',y'} (T(x',y') \cdot I(x+x',y+y'))}{\sqrt{\sum_{x',y'}T(x',y')^2 \cdot \sum_{x',y'} I(x+x',y+y')^2}}\f] + /// + CCorrNormed = 3, + + /// + /// \f[R(x,y)= \sum _{x',y'} (T'(x',y') \cdot I'(x+x',y+y'))\f] + /// where + /// \f[\begin{array}{l} T'(x',y')=T(x',y') - 1/(w \cdot h) \cdot \sum _{x'',y''} T(x'',y'') \\ I'(x+x',y+y')=I(x+x',y+y') - 1/(w \cdot h) \cdot \sum _{x'',y''} I(x+x'',y+y'') \end{array}\f] + /// + CCoeff = 4, + + /// + /// \f[R(x,y)= \frac{ \sum_{x',y'} (T'(x',y') \cdot I'(x+x',y+y')) }{ \sqrt{\sum_{x',y'}T'(x',y')^2 \cdot \sum_{x',y'} I'(x+x',y+y')^2} }\f] + /// + CCoeffNormed = 5, + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Enum/ThresholdTypes.cs b/src/OpenCvSharp/modules/imgproc/Enum/ThresholdTypes.cs new file mode 100644 index 000000000..fb5d5272a --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Enum/ThresholdTypes.cs @@ -0,0 +1,57 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// 閾値処理の種類 + /// +#else + /// + /// Thresholding type + /// +#endif + [Flags] + public enum ThresholdTypes : int + { + /// + /// \f[\texttt{dst} (x,y) = \fork{\texttt{maxval}}{if \(\texttt{src}(x,y) > \texttt{thresh}\)}{0}{otherwise}\f] + /// + Binary = 0, + + /// + /// \f[\texttt{dst} (x,y) = \fork{0}{if \(\texttt{src}(x,y) > \texttt{thresh}\)}{\texttt{maxval}}{otherwise}\f] + /// + BinaryInv = 1, + + /// + /// \f[\texttt{dst} (x,y) = \fork{\texttt{threshold}}{if \(\texttt{src}(x,y) > \texttt{thresh}\)}{\texttt{src}(x,y)}{otherwise}\f] + /// + Trunc = 2, + + /// + /// \f[\texttt{dst} (x,y) = \fork{\texttt{src}(x,y)}{if \(\texttt{src}(x,y) > \texttt{thresh}\)}{0}{otherwise}\f] + /// + Tozero = 3, + + /// + /// \f[\texttt{dst} (x,y) = \fork{0}{if \(\texttt{src}(x,y) > \texttt{thresh}\)}{\texttt{src}(x,y)}{otherwise}\f] + /// + TozeroInv = 4, + + /// + /// + /// + Mask = 7, + + /// + /// flag, use Otsu algorithm to choose the optimal threshold value + /// + Otsu = 8, + + /// + /// flag, use Triangle algorithm to choose the optimal threshold value + /// + Triangle = 16 + } +} diff --git a/src/OpenCvSharp/modules/imgproc/GeneralizedHough.cs b/src/OpenCvSharp/modules/imgproc/GeneralizedHough.cs new file mode 100644 index 000000000..186a7bafb --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/GeneralizedHough.cs @@ -0,0 +1,223 @@ +using System; + +namespace OpenCvSharp +{ + /// + /// finds arbitrary template in the grayscale image using Generalized Hough Transform + /// + public abstract class GeneralizedHough : Algorithm + { + /// + /// Canny low threshold. + /// + /// + public int CannyLowThresh + { + get + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_GeneralizedHough_getCannyLowThresh(ptr); + } + set + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.imgproc_GeneralizedHough_setCannyLowThresh(ptr, value); + } + } + + /// + /// Canny high threshold. + /// + /// + public int CannyHighThresh + { + get + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_GeneralizedHough_getCannyHighThresh(ptr); + } + set + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.imgproc_GeneralizedHough_setCannyHighThresh(ptr, value); + } + } + + /// + /// Minimum distance between the centers of the detected objects. + /// + /// + public double MinDist + { + get + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_GeneralizedHough_getMinDist(ptr); + } + set + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.imgproc_GeneralizedHough_setMinDist(ptr, value); + } + } + + /// + /// Inverse ratio of the accumulator resolution to the image resolution. + /// + /// + public double Dp + { + get + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_GeneralizedHough_getDp(ptr); + } + set + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.imgproc_GeneralizedHough_setDp(ptr, value); + } + } + + /// + /// Maximal size of inner buffers. + /// + /// + public int MaxBufferSize + { + get + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_GeneralizedHough_getMaxBufferSize(ptr); + } + set + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.imgproc_GeneralizedHough_setMaxBufferSize(ptr, value); + } + } + + /// + /// set template to search + /// + /// + /// + public void SetTemplate(InputArray templ, Point? templCenter = null) + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + if (templ == null) + throw new ArgumentNullException("templ"); + templ.ThrowIfDisposed(); + var templCenterValue = templCenter.GetValueOrDefault(new Point(-1, -1)); + + NativeMethods.imgproc_GeneralizedHough_setTemplate1(ptr, templ.CvPtr, templCenterValue); + + GC.KeepAlive(templ); + } + + /// + /// set template to search + /// + /// + /// + /// + /// + public virtual void SetTemplate(InputArray edges, InputArray dx, InputArray dy, Point? templCenter = null) + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + if (edges == null) + throw new ArgumentNullException("edges"); + if (dx == null) + throw new ArgumentNullException("dx"); + if (dy == null) + throw new ArgumentNullException("dy"); + edges.ThrowIfDisposed(); + dx.ThrowIfDisposed(); + dy.ThrowIfDisposed(); + var templCenterValue = templCenter.GetValueOrDefault(new Point(-1, -1)); + + NativeMethods.imgproc_GeneralizedHough_setTemplate2( + ptr, edges.CvPtr, dx.CvPtr, dy.CvPtr, templCenterValue); + + GC.KeepAlive(edges); + GC.KeepAlive(dx); + GC.KeepAlive(dy); + } + + /// + /// find template on image + /// + /// + /// + /// + public virtual void Detect( + InputArray image, OutputArray positions, OutputArray votes = null) + { + if (image == null) + throw new ArgumentNullException("image"); + if (positions == null) + throw new ArgumentNullException("positions"); + image.ThrowIfDisposed(); + positions.ThrowIfNotReady(); + if (votes != null) + votes.ThrowIfNotReady(); + + NativeMethods.imgproc_GeneralizedHough_detect1( + ptr, image.CvPtr, positions.CvPtr, Cv2.ToPtr(votes)); + + GC.KeepAlive(image); + positions.Fix(); + if (votes != null) + votes.Fix(); + } + + /// + /// find template on image + /// + /// + /// + /// + /// + /// + public virtual void Detect( + InputArray edges, InputArray dx, InputArray dy, OutputArray positions, OutputArray votes = null) + { + if (edges == null) + throw new ArgumentNullException("edges"); + if (dx == null) + throw new ArgumentNullException("dx"); + if (dy == null) + throw new ArgumentNullException("dy"); + if (positions == null) + throw new ArgumentNullException("positions"); + edges.ThrowIfDisposed(); + dx.ThrowIfDisposed(); + dy.ThrowIfDisposed(); + positions.ThrowIfNotReady(); + if (votes != null) + votes.ThrowIfNotReady(); + + NativeMethods.imgproc_GeneralizedHough_detect2( + ptr, edges.CvPtr, dx.CvPtr, dy.CvPtr, positions.CvPtr, Cv2.ToPtr(votes)); + + GC.KeepAlive(edges); + GC.KeepAlive(dx); + GC.KeepAlive(dy); + positions.Fix(); + if (votes != null) + votes.Fix(); + } + } +} diff --git a/src/OpenCvSharp/modules/imgproc/GeneralizedHoughBallard.cs b/src/OpenCvSharp/modules/imgproc/GeneralizedHoughBallard.cs new file mode 100644 index 000000000..32a4c1119 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/GeneralizedHoughBallard.cs @@ -0,0 +1,123 @@ +using System; + +namespace OpenCvSharp +{ + /// + /// Ballard, D.H. (1981). Generalizing the Hough transform to detect arbitrary shapes. + /// Pattern Recognition 13 (2): 111-122. + /// Detects position only without traslation and rotation + /// + public class GeneralizedHoughBallard : GeneralizedHough + { + private bool disposed; + + /// + /// cv::Ptr<T> object + /// + private Ptr ptrObj; + + /// + /// + /// + private GeneralizedHoughBallard(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// Creates a predefined GeneralizedHoughBallard object + /// + /// + public static GeneralizedHoughBallard Create() + { + IntPtr ptr = NativeMethods.imgproc_createGeneralizedHoughBallard(); + return new GeneralizedHoughBallard(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + } + // releases unmanaged resources + if (IsEnabledDispose) + { + if (ptrObj != null) + ptrObj.Dispose(); + ptrObj = null; + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + /// + /// R-Table levels. + /// + /// + public int Levels + { + get + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_GeneralizedHoughBallard_getLevels(ptr); + } + set + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.imgproc_GeneralizedHoughBallard_setLevels(ptr, value); + } + } + + /// + /// The accumulator threshold for the template centers at the detection stage. + /// The smaller it is, the more false positions may be detected. + /// + /// + public int VotesThreshold + { + get + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_GeneralizedHoughBallard_getVotesThreshold(ptr); + } + set + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.imgproc_GeneralizedHoughBallard_setVotesThreshold(ptr, value); + } + } + } +} diff --git a/src/OpenCvSharp/modules/imgproc/GeneralizedHoughGuil.cs b/src/OpenCvSharp/modules/imgproc/GeneralizedHoughGuil.cs new file mode 100644 index 000000000..8f82b15bb --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/GeneralizedHoughGuil.cs @@ -0,0 +1,323 @@ +using System; + +namespace OpenCvSharp +{ + /// + /// Guil, N., González-Linares, J.M. and Zapata, E.L. (1999). + /// Bidimensional shape detection using an invariant approach. + /// Pattern Recognition 32 (6): 1025-1038. + /// Detects position, traslation and rotation + /// + public class GeneralizedHoughGuil : GeneralizedHough + { + private bool disposed; + + /// + /// cv::Ptr<T> object + /// + private Ptr ptrObj; + + /// + /// + /// + private GeneralizedHoughGuil(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// Creates a predefined GeneralizedHoughBallard object + /// + /// + public static GeneralizedHoughGuil Create() + { + IntPtr ptr = NativeMethods.imgproc_createGeneralizedHoughGuil(); + return new GeneralizedHoughGuil(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + } + // releases unmanaged resources + if (IsEnabledDispose) + { + if (ptrObj != null) + ptrObj.Dispose(); + ptrObj = null; + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + /// + /// Angle difference in degrees between two points in feature. + /// + /// + public double Xi + { + get + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_GeneralizedHoughGuil_getXi(ptr); + } + set + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.imgproc_GeneralizedHoughGuil_setXi(ptr, value); + } + } + + /// + /// Feature table levels. + /// + /// + public int Levels + { + get + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_GeneralizedHoughGuil_getLevels(ptr); + } + set + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.imgproc_GeneralizedHoughGuil_setLevels(ptr, value); + } + } + + /// + /// Maximal difference between angles that treated as equal. + /// + /// + public double AngleEpsilon + { + get + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_GeneralizedHoughGuil_getAngleEpsilon(ptr); + } + set + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.imgproc_GeneralizedHoughGuil_setAngleEpsilon(ptr, value); + } + } + + /// + /// Minimal rotation angle to detect in degrees. + /// + /// + public double MinAngle + { + get + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_GeneralizedHoughGuil_getMinAngle(ptr); + } + set + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.imgproc_GeneralizedHoughGuil_setMinAngle(ptr, value); + } + } + + /// + /// Maximal rotation angle to detect in degrees. + /// + /// + public double MaxAngle + { + get + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_GeneralizedHoughGuil_getMaxAngle(ptr); + } + set + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.imgproc_GeneralizedHoughGuil_setMaxAngle(ptr, value); + } + } + + /// + /// Angle step in degrees. + /// + /// + public double AngleStep + { + get + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_GeneralizedHoughGuil_getAngleStep(ptr); + } + set + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.imgproc_GeneralizedHoughGuil_setAngleStep(ptr, value); + } + } + + /// + /// Angle votes threshold. + /// + /// + public int AngleThresh + { + get + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_GeneralizedHoughGuil_getAngleThresh(ptr); + } + set + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.imgproc_GeneralizedHoughGuil_setAngleThresh(ptr, value); + } + } + + /// + /// Minimal scale to detect. + /// + /// + public double MinScale + { + get + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_GeneralizedHoughGuil_getMinScale(ptr); + } + set + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.imgproc_GeneralizedHoughGuil_setMinScale(ptr, value); + } + } + + /// + /// Maximal scale to detect. + /// + /// + public double MaxScale + { + get + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_GeneralizedHoughGuil_getMaxScale(ptr); + } + set + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.imgproc_GeneralizedHoughGuil_setMaxScale(ptr, value); + } + } + + /// + /// Scale step. + /// + /// + public double ScaleStep + { + get + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_GeneralizedHoughGuil_getScaleStep(ptr); + } + set + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.imgproc_GeneralizedHoughGuil_setScaleStep(ptr, value); + } + } + + /// + /// Scale votes threshold. + /// + /// + public int ScaleThresh + { + get + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_GeneralizedHoughGuil_getScaleThresh(ptr); + } + set + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.imgproc_GeneralizedHoughGuil_setScaleThresh(ptr, value); + } + } + + /// + /// Position votes threshold. + /// + /// + public int PosThresh + { + get + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_GeneralizedHoughGuil_getPosThresh(ptr); + } + set + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.imgproc_GeneralizedHoughGuil_setPosThresh(ptr, value); + } + } + } +} diff --git a/src/OpenCvSharp/modules/imgproc/LineIterator.cs b/src/OpenCvSharp/modules/imgproc/LineIterator.cs new file mode 100644 index 000000000..130d04677 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/LineIterator.cs @@ -0,0 +1,327 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ + /// + /// Contrast Limited Adaptive Histogram Equalization + /// + public sealed class LineIterator : DisposableCvObject, IEnumerable + { + private bool disposed; + + private Mat img; + private Point pt1; + private Point pt2; + private PixelConnectivity connectivity; + private bool leftToRight; + + /// + /// Constructor + /// + /// + /// + /// + /// + /// + /// + public LineIterator( + Mat img, + Point pt1, + Point pt2, + PixelConnectivity connectivity = PixelConnectivity.Connectivity8, + bool leftToRight = false) + { + if (img == null) + throw new ArgumentNullException("img"); + this.img = img; + this.pt1 = pt1; + this.pt2 = pt2; + this.connectivity = connectivity; + this.leftToRight = leftToRight; + } + + /// + /// Intializes the iterator + /// + /// + private void Initialize() + { + if (ptr != IntPtr.Zero) + throw new OpenCvSharpException("invalid state"); + img.ThrowIfDisposed(); + + ptr = NativeMethods.imgproc_LineIterator_new( + img.CvPtr, pt1, pt2, (int)connectivity, leftToRight ? 1 : 0); + disposed = false; + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + } + // releases unmanaged resources + if (IsEnabledDispose) + { + if (ptr != IntPtr.Zero) + NativeMethods.imgproc_LineIterator_delete(ptr); + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + /// + /// + /// + /// + public IEnumerator GetEnumerator() + { + //if (disposed) + // throw new ObjectDisposedException(GetType().Name); + Dispose(); + Initialize(); + + int count = NativeMethods.imgproc_LineIterator_count_get(ptr); + for (int i = 0; i < count; i++) + { + Point pos = NativeMethods.imgproc_LineIterator_pos(ptr); + IntPtr value = NativeMethods.imgproc_LineIterator_operatorEntity(ptr); + yield return new Pixel(pos, value); + + NativeMethods.imgproc_LineIterator_operatorPP(ptr); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + #region Properties + + /// + /// + /// + public IntPtr Ptr + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_LineIterator_ptr_get(ptr); + } + } + + /// + /// + /// + public IntPtr Ptr0 + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_LineIterator_ptr0_get(ptr); + } + } + + /// + /// + /// + public int Step + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_LineIterator_step_get(ptr); + } + } + + /// + /// + /// + public int ElemSize + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_LineIterator_elemSize_get(ptr); + } + } + + /// + /// + /// + public int Err + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_LineIterator_err_get(ptr); + } + } + + /// + /// + /// + public int Count + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_LineIterator_count_get(ptr); + } + } + + /// + /// + /// + public int MinusDelta + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_LineIterator_minusDelta_get(ptr); + } + } + + /// + /// + /// + public int PlusDelta + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_LineIterator_plusDelta_get(ptr); + } + } + + /// + /// + /// + public int MinusStep + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_LineIterator_minusStep_get(ptr); + } + } + + /// + /// + /// + public int PlusStep + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.imgproc_LineIterator_plusStep_get(ptr); + } + } + + #endregion + + /// + /// LineIterator pixel data + /// + public class Pixel + { + /// + /// + /// + public unsafe byte* ValuePointer { get; private set; } + + /// + /// + /// + public Point Pos { get; private set; } + + /// + /// + /// + public IntPtr Value + { + get + { + unsafe + { + return new IntPtr(ValuePointer); + } + } + } + + /// + /// + /// + /// + /// + public T GetValue() where T : struct + { + return (T)Marshal.PtrToStructure(Value, typeof (T)); + } + + /// + /// + /// + /// + /// + /// + public void SetValue(T value) where T : struct + { + Marshal.StructureToPtr(value, Value, false); + } + + /// + /// Constructor + /// + /// + /// + internal unsafe Pixel(Point pos, IntPtr value) + { + Pos = pos; + ValuePointer = (byte*)value.ToPointer(); + } + } + } +} diff --git a/src/OpenCvSharp/modules/imgproc/LineSegmentDetector.cs b/src/OpenCvSharp/modules/imgproc/LineSegmentDetector.cs new file mode 100644 index 000000000..efcf2e33c --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/LineSegmentDetector.cs @@ -0,0 +1,187 @@ +using System; + +namespace OpenCvSharp +{ + /// + /// Line segment detector class + /// + public class LineSegmentDetector : Algorithm + { + private bool disposed; + + /// + /// cv::Ptr<LineSegmentDetector> + /// + private Ptr ptrObj; + + /// + /// + /// + protected LineSegmentDetector(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// Creates a smart pointer to a LineSegmentDetector object and initializes it. + /// + /// The way found lines will be refined, see cv::LineSegmentDetectorModes + /// The scale of the image that will be used to find the lines. Range (0..1]. + /// Sigma for Gaussian filter. It is computed as sigma = _sigma_scale/_scale. + /// Bound to the quantization error on the gradient norm. + /// Gradient angle tolerance in degrees. + /// Detection threshold: -log10(NFA) \> log_eps. + /// Used only when advancent refinement is chosen. + /// Minimal density of aligned region points in the enclosing rectangle. + /// Number of bins in pseudo-ordering of gradient modulus. + /// + public static LineSegmentDetector Create( + LineSegmentDetectorModes refine = LineSegmentDetectorModes.RefineNone, + double scale = 0.8, double sigmaScale = 0.6, double quant = 2.0, double angTh = 22.5, + double logEps = 0, double densityTh = 0.7, int nBins = 1024) + { + IntPtr ptr = NativeMethods.imgproc_createLineSegmentDetector( + (int)refine, scale, sigmaScale, quant, angTh, logEps, densityTh, nBins); + return new LineSegmentDetector(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + } + // releases unmanaged resources + if (IsEnabledDispose) + { + if (ptrObj != null) + ptrObj.Dispose(); + ptrObj = null; + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + /// + /// Finds lines in the input image. + /// This is the output of the default parameters of the algorithm on the above shown image. + /// + /// A grayscale (CV_8UC1) input image. + /// A vector of Vec4i or Vec4f elements specifying the beginning and ending point of a line. + /// Where Vec4i/Vec4f is (x1, y1, x2, y2), point 1 is the start, point 2 - end. Returned lines are strictly oriented depending on the gradient. + /// Vector of widths of the regions, where the lines are found. E.g. Width of line. + /// Vector of precisions with which the lines are found. + /// Vector containing number of false alarms in the line region, + /// with precision of 10%. The bigger the value, logarithmically better the detection. + public virtual void Detect(InputArray image, OutputArray lines, + OutputArray width = null, OutputArray prec = null, OutputArray nfa = null) + { + if (image == null) + throw new ArgumentNullException("image"); + if (lines == null) + throw new ArgumentNullException("lines"); + image.ThrowIfDisposed(); + lines.ThrowIfNotReady(); + if (width != null) + width.ThrowIfNotReady(); + if (prec != null) + prec.ThrowIfNotReady(); + if (nfa != null) + nfa.ThrowIfNotReady(); + + NativeMethods.imgproc_LineSegmentDetector_detect(ptr, image.CvPtr, lines.CvPtr, + Cv2.ToPtr(width), Cv2.ToPtr(prec), Cv2.ToPtr(nfa)); + + GC.KeepAlive(image); + lines.Fix(); + if (width != null) + width.Fix(); + if (prec != null) + prec.Fix(); + if (nfa != null) + nfa.Fix(); + } + + /// + /// Draws the line segments on a given image. + /// + /// The image, where the liens will be drawn. + /// Should be bigger or equal to the image, where the lines were found. + /// A vector of the lines that needed to be drawn. + public virtual void DrawSegments(InputOutputArray image, InputArray lines) + { + if (image == null) + throw new ArgumentNullException("image"); + if (lines == null) + throw new ArgumentNullException("lines"); + image.ThrowIfNotReady(); + lines.ThrowIfDisposed(); + + NativeMethods.imgproc_LineSegmentDetector_drawSegments(ptr, image.CvPtr, lines.CvPtr); + + image.Fix(); + GC.KeepAlive(lines); + } + + /// + /// Draws two groups of lines in blue and red, counting the non overlapping (mismatching) pixels. + /// + /// The size of the image, where lines1 and lines2 were found. + /// The first group of lines that needs to be drawn. It is visualized in blue color. + /// The second group of lines. They visualized in red color. + /// Optional image, where the lines will be drawn. + /// The image should be color(3-channel) in order for lines1 and lines2 to be drawn + /// in the above mentioned colors. + /// + public virtual int CompareSegments( + Size size, InputArray lines1, InputArray lines2, InputOutputArray image = null) + { + if (lines1 == null) + throw new ArgumentNullException("lines1"); + if (lines2 == null) + throw new ArgumentNullException("lines2"); + lines1.ThrowIfDisposed(); + lines2.ThrowIfDisposed(); + if (image != null) + image.ThrowIfNotReady(); + + var ret = NativeMethods.imgproc_LineSegmentDetector_compareSegments( + ptr, size, lines1.CvPtr, lines2.CvPtr, Cv2.ToPtr(image)); + + GC.KeepAlive(lines1); + GC.KeepAlive(lines2); + if (image != null) + image.Fix(); + + return ret; + } + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Model/CircleSegment.cs b/src/OpenCvSharp/modules/imgproc/Model/CircleSegment.cs new file mode 100644 index 000000000..276792ea3 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Model/CircleSegment.cs @@ -0,0 +1,171 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cvHoughCirclesで得られる、円のデータ(中心と半径) + /// +#else + /// + /// circle structure retrieved from cvHoughCircle + /// +#endif + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct CircleSegment : IEquatable + { + #region Fields +#if LANG_JP + /// + /// 円の中心 + /// +#else + /// + /// Center coordinate of the circle + /// +#endif + public Point2f Center; +#if LANG_JP + /// + /// 半径 + /// +#else + /// + /// Radius + /// +#endif + public float Radius; + #endregion + + #region Init +#if LANG_JP + /// + /// 初期化 + /// + /// 円の中心 + /// 半径 +#else + /// + /// Constructor + /// + /// center + /// radius +#endif + public CircleSegment(Point2f center, float radius) + { + this.Center = center; + this.Radius = radius; + } + #endregion + + #region Operators +#if LANG_JP + /// + /// 指定したオブジェクトと等しければtrueを返す + /// + /// 比較するオブジェクト + /// 型が同じで、メンバの値が等しければtrue +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public bool Equals(CircleSegment obj) + { + return (this.Center == obj.Center && this.Radius == obj.Radius); + } +#if LANG_JP + /// + /// == 演算子のオーバーロード + /// + /// 左辺値 + /// 右辺値 + /// 等しければtrue +#else + /// + /// Compares two CvPoint objects. The result specifies whether the members of each object are equal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the members of left and right are equal; otherwise, false. +#endif + public static bool operator ==(CircleSegment lhs, CircleSegment rhs) + { + return lhs.Equals(rhs); + } +#if LANG_JP + /// + /// != 演算子のオーバーロード + /// + /// 左辺値 + /// 右辺値 + /// 等しくなければtrue +#else + /// + /// Compares two CvPoint objects. The result specifies whether the members of each object are unequal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the members of left and right are unequal; otherwise, false. +#endif + public static bool operator !=(CircleSegment lhs, CircleSegment rhs) + { + return !lhs.Equals(rhs); + } + #endregion + + #region Overrided Methods +#if LANG_JP + /// + /// Equalsのオーバーライド + /// + /// 比較するオブジェクト + /// +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public override bool Equals(object obj) + { + return base.Equals(obj); + } +#if LANG_JP + /// + /// GetHashCodeのオーバーライド + /// + /// このオブジェクトのハッシュ値を指定する整数値。 +#else + /// + /// Returns a hash code for this object. + /// + /// An integer value that specifies a hash value for this object. +#endif + public override int GetHashCode() + { + return Center.GetHashCode() + Radius.GetHashCode(); + } +#if LANG_JP + /// + /// 文字列形式を返す + /// + /// 文字列形式 +#else + /// + /// Converts this object to a human readable string. + /// + /// A string that represents this object. +#endif + public override string ToString() + { + return string.Format("CvCircleSegment (Center:{0} Radius:{1})", Center, Radius); + } + #endregion + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Model/HierarchyIndex.cs b/src/OpenCvSharp/modules/imgproc/Model/HierarchyIndex.cs new file mode 100644 index 000000000..aa53371b8 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Model/HierarchyIndex.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; + +namespace OpenCvSharp +{ + /// + /// Information about the image topology for cv::findContours + /// + public class HierarchyIndex + { + /// + /// + /// + public int Next { get; set; } + + /// + /// + /// + public int Previous { get; set; } + + /// + /// + /// + public int Child { get; set; } + + /// + /// + /// + public int Parent { get; set; } + + /// + /// + /// + public HierarchyIndex() + { + Next = 0; + Previous = 0; + Child = 0; + Parent = 0; + } + + /// + /// + /// + /// + /// + /// + /// + public HierarchyIndex(int next, int previous, int child, int parent) + { + Next = next; + Previous = previous; + Child = child; + Parent = parent; + } + + /// + /// + /// + /// + /// + public static HierarchyIndex FromVec4i(Vec4i vec) + { + return new HierarchyIndex + { + Next = vec.Item0, + Previous = vec.Item1, + Child = vec.Item2, + Parent = vec.Item3 + }; + } + + /// + /// + /// + /// + public Vec4i ToVec4i() + { + return new Vec4i(Next, Previous, Child, Parent); + } + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Model/Line2D.cs b/src/OpenCvSharp/modules/imgproc/Model/Line2D.cs new file mode 100644 index 000000000..0692cd02a --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Model/Line2D.cs @@ -0,0 +1,221 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// 始点と変化量であらわされる、2次元の直線を表すオブジェクト + /// +#else + /// + /// 2-dimentional line vector + /// +#endif + public class Line2D + { + #region Properties +#if LANG_JP + /// + /// 直線に乗るように正規化された方向ベクトル (x成分) + /// +#else + /// + /// The X component of the normalized vector collinear to the line + /// +#endif + public double Vx { get; set; } +#if LANG_JP + /// + /// 直線に乗るように正規化された方向ベクトル (y成分) + /// +#else + /// + /// The Y component of the normalized vector collinear to the line + /// +#endif + public double Vy { get; set; } +#if LANG_JP + /// + /// 直線上の点のx座標 + /// +#else + /// + /// X-coordinate of some point on the line + /// +#endif + public double X1 { get; set; } +#if LANG_JP + /// + /// 直線上の点のy座標 + /// +#else + /// + /// Y-coordinate of some point on the line + /// +#endif + public double Y1 { get; set; } + #endregion + + #region Init +#if LANG_JP + /// + /// 初期化 + /// + /// 直線に乗るように正規化された方向ベクトル (x成分) + /// 直線に乗るように正規化された方向ベクトル (y成分) + /// 直線上の点のx座標 + /// 直線上の点のy座標 +#else + /// + /// Initializes this object + /// + /// The X component of the normalized vector collinear to the line + /// The Y component of the normalized vector collinear to the line + /// Z-coordinate of some point on the line + /// Z-coordinate of some point on the line +#endif + public Line2D(double vx, double vy, double x1, double y1) + { + Vx = vx; + Vy = vy; + X1 = x1; + Y1 = y1; + } +#if LANG_JP + /// + /// cvFitLineの出力(float[4])から初期化 + /// + /// cvFitLineの出力結果 +#else + /// + /// Initializes by cvFitLine output + /// + /// The returned value from cvFitLineparam> +#endif + public Line2D(float[] line) + : this(line[0], line[1], line[2], line[3]) + { + } + #endregion + + #region Methods + + /// + /// + /// + /// + public double GetVectorRadian() + { + return Math.Atan2(Vy, Vx); + } + /// + /// + /// + /// + public double GetVectorAngle() + { + return GetVectorRadian() * 180 / Math.PI; + } + +#if LANG_JP + /// + /// 指定した点と直線の距離を返す + /// + /// +#else + /// + /// Returns the distance between this line and the specified point + /// + /// +#endif + public double Distance(Point point) + { + return Distance(point.X, point.Y); + } +#if LANG_JP + /// + /// 指定した点と直線の距離を返す + /// + /// +#else + /// + /// Returns the distance between this line and the specified point + /// + /// +#endif + public double Distance(Point2f point) + { + return Distance(point.X, point.Y); + } +#if LANG_JP + /// + /// 指定した点と直線の距離を返す + /// + /// +#else + /// + /// Returns the distance between this line and the specified point + /// + /// +#endif + public double Distance(Point2d point) + { + return Distance(point.X, point.Y); + } +#if LANG_JP + /// + /// 指定した点と直線の距離を返す + /// + /// + /// +#else + /// + /// Returns the distance between this line and the specified point + /// + /// + /// +#endif + public double Distance(double x, double y) + { + // 公式で + double m = Vy / Vx; + double n = Y1 - m * X1; + return Math.Abs(y - m * x - n) / Math.Sqrt(1 + m * m); + } + +#if LANG_JP + /// + /// 指定したサイズに直線を合わせて、その端点を返す (描画用途) + /// + /// 合わせこむサイズの幅 + /// 合わせこむサイズの高さ + /// 端点1つ目 + /// 端点2つ目 +#else + /// + /// Fits this line to the specified size (for drawing) + /// + /// Width of fit size + /// Height of fit size + /// 1st edge point of fitted line + /// 2nd edge point of fitted line +#endif + public void FitSize(int width, int height, out Point pt1, out Point pt2) + { + double t = (width + height); + pt1 = new Point + { + X = (int)Math.Round(X1 - Vx*t), + Y = (int)Math.Round(Y1 - Vy * t) + }; + pt2 = new Point + { + X = (int)Math.Round(X1 + Vx * t), + Y = (int)Math.Round(Y1 + Vy * t) + }; + } + #endregion + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/imgproc/Model/Line3D.cs b/src/OpenCvSharp/modules/imgproc/Model/Line3D.cs new file mode 100644 index 000000000..657e7de72 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Model/Line3D.cs @@ -0,0 +1,294 @@ +using System; + +namespace OpenCvSharp +{ + +#if LANG_JP + /// + /// 3次元空間上の直線 + /// +#else + /// + /// A 3-dimensional line object + /// +#endif + public class Line3D + { + #region Properties +#if LANG_JP + /// + /// 直線に乗るように正規化された方向ベクトル (x成分) + /// +#else + /// + /// The X component of the normalized vector collinear to the line + /// +#endif + public double Vx { get; set; } +#if LANG_JP + /// + /// 直線に乗るように正規化された方向ベクトル (y成分) + /// +#else + /// + /// The Y component of the normalized vector collinear to the line + /// +#endif + public double Vy { get; set; } +#if LANG_JP + /// + /// 直線に乗るように正規化された方向ベクトル (z成分) + /// +#else + /// + /// The Z component of the normalized vector collinear to the line + /// +#endif + public double Vz { get; set; } +#if LANG_JP + /// + /// 直線上の点のx座標 + /// +#else + /// + /// X-coordinate of some point on the line + /// +#endif + public double X1 { get; set; } +#if LANG_JP + /// + /// 直線上の点のy座標 + /// +#else + /// + /// Y-coordinate of some point on the line + /// +#endif + public double Y1 { get; set; } +#if LANG_JP + /// + /// 直線上の点のz座標 + /// +#else + /// + /// Z-coordinate of some point on the line + /// +#endif + public double Z1 { get; set; } + #endregion + + #region Initialization +#if LANG_JP + /// + /// 初期化 + /// + /// 直線に乗るように正規化された方向ベクトル (x成分) + /// 直線に乗るように正規化された方向ベクトル (y成分) + /// 直線に乗るように正規化された方向ベクトル (z成分) + /// 直線上の点のx座標 + /// 直線上の点のy座標 + /// 直線上の点のz座標 +#else + /// + /// Initializes this object + /// + /// The X component of the normalized vector collinear to the line + /// The Y component of the normalized vector collinear to the line + /// The Z component of the normalized vector collinear to the line + /// Z-coordinate of some point on the line + /// Z-coordinate of some point on the line + /// Z-coordinate of some point on the line +#endif + public Line3D(double vx, double vy, double vz, double x1, double y1, double z1) + { + Vx = vx; + Vy = vy; + Vz = vz; + X1 = x1; + Y1 = y1; + Z1 = z1; + } +#if LANG_JP + /// + /// cvFitLineの出力(float[6])から初期化 + /// + /// cvFitLineの出力結果 +#else + /// + /// Initializes by cvFitLine output + /// + /// The returned value from cvFitLineparam> +#endif + public Line3D(float[] line) + : this(line[0], line[1], line[2], line[3], line[4], line[5]) + { + } + #endregion + + #region Methods +#if LANG_JP + /// + /// + /// + /// +#else + /// + /// + /// + /// +#endif + public Point3d PerpendicularFoot(Point3f point) + { + return PerpendicularFoot(point.X, point.Y, point.Z); + } +#if LANG_JP + /// + /// + /// + /// +#else + /// + /// + /// + /// +#endif + public Point3d PerpendicularFoot(Point3d point) + { + return PerpendicularFoot(point.X, point.Y, point.Z); + } +#if LANG_JP + /// + /// 指定した点と直線の距離を返す + /// + /// + /// + /// +#else + /// + /// Returns the distance between this line and the specified point + /// + /// + /// + /// +#endif + public Point3d PerpendicularFoot(double x, double y, double z) + { + double xa = X1; + double ya = Y1; + double za = Z1; + double xb = X1 + Vx; + double yb = Y1 + Vy; + double zb = Z1 + Vz; + + double k = ((x - xa)*(xb - xa) + (y - ya)*(yb - ya) + (z - za)*(zb - za))/ + (Math.Pow(xb - xa, 2) + Math.Pow(yb - ya, 2) + Math.Pow(zb - za, 2)); + + double hx = k*xb+(1-k)*xa; + double hy = k*yb+(1-k)*ya; + double hz = k*zb+(1-k)*za; + return new Point3d(hx, hy, hz); + } + + +#if LANG_JP + /// + /// 指定した点と直線の距離を返す + /// + /// +#else + /// + /// Returns the distance between this line and the specified point + /// + /// +#endif + public double Distance(Point3f point) + { + return Distance(point.X, point.Y, point.Z); + } +#if LANG_JP + /// + /// 指定した点と直線の距離を返す + /// + /// +#else + /// + /// Returns the distance between this line and the specified point + /// + /// +#endif + public double Distance(Point3d point) + { + return Distance(point.X, point.Y, point.Z); + } +#if LANG_JP + /// + /// 指定した点と直線の距離を返す + /// + /// + /// + /// +#else + /// + /// Returns the distance between this line and the specified point + /// + /// + /// + /// +#endif + public double Distance(double x, double y, double z) + { + var p = new Point3d(x, y, z); + var a = new Point3d(X1, Y1, Z1); + var b = new Point3d(X1 + Vx, Y1 + Vy, Z1 + Vz); + var ab = new Point3d { X = b.X - a.X, Y = b.Y - a.Y, Z = b.Z - a.Z }; + var ap = new Point3d { X = p.X - a.X, Y = p.Y - a.Y, Z = p.Z - a.Z }; + + // AB, APを外積 -> 平行四辺形Dの面積 + double d = VectorLength(CrossProduct(ab, ap)); + // AB間の距離 + double l = VertexDistance(a, b); + // 平行四辺形の高さ(垂線) + double h = d / l; + return h; + } + + /// + /// ベクトルの外積 + /// + /// + /// + /// + private Point3d CrossProduct(Point3d vl, Point3d vr) + { + var ret = new Point3d + { + X = (vl.Y*vr.Z) - (vl.Z*vr.Y), + Y = (vl.Z*vr.X) - (vl.X*vr.Z), + Z = (vl.X*vr.Y) - (vl.Y*vr.X) + }; + return ret; + } + /// + /// ベクトルの長さ(原点からの距離) + /// + /// + /// + private double VectorLength(Point3d v) + { + return Math.Sqrt(v.X * v.X + v.Y * v.Y + v.Z * v.Z); + } + /// + /// 2点間(2ベクトル)の距離 + /// + /// + /// + /// + private double VertexDistance(Point3d p1, Point3d p2) + { + return Math.Sqrt((p2.X - p1.X) * (p2.X - p1.X) + + (p2.Y - p1.Y) * (p2.Y - p1.Y) + + (p2.Z - p1.Z) * (p2.Z - p1.Z)); + } + #endregion + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/imgproc/Model/LineSegmentPoint.cs b/src/OpenCvSharp/modules/imgproc/Model/LineSegmentPoint.cs new file mode 100644 index 000000000..84b89da0d --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Model/LineSegmentPoint.cs @@ -0,0 +1,487 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cvHoughLines2で得られる、両端の点で表現される線分 + /// +#else + /// + /// Line segment structure retrieved from cvHoughLines2 + /// +#endif + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct LineSegmentPoint : IEquatable + { + #region Fields + +#if LANG_JP + /// + /// 1つ目の点 + /// +#else + /// + /// 1st Point + /// +#endif + public Point P1; + +#if LANG_JP + /// + /// 2つ目の点 + /// +#else + /// + /// 2nd Point + /// +#endif + public Point P2; + + #endregion + + #region Init + +#if LANG_JP + /// + /// 初期化 + /// + /// 1つ目の点 + /// 2つ目の点 +#else + /// + /// Constructor + /// + /// 1st Point + /// 2nd Point +#endif + public LineSegmentPoint(Point p1, Point p2) + { + this.P1 = p1; + this.P2 = p2; + } + + #endregion + + #region Operators + +#if LANG_JP + /// + /// 指定したオブジェクトと等しければtrueを返す + /// + /// 比較するオブジェクト + /// 型が同じで、メンバの値が等しければtrue +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public bool Equals(LineSegmentPoint obj) + { + return (this.P1 == obj.P1 && this.P2 == obj.P2); + } + +#if LANG_JP + /// + /// == 演算子のオーバーロード + /// + /// 左辺値 + /// 右辺値 + /// 等しければtrue +#else + /// + /// Compares two CvPoint objects. The result specifies whether the members of each object are equal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the members of left and right are equal; otherwise, false. +#endif + public static bool operator ==(LineSegmentPoint lhs, LineSegmentPoint rhs) + { + return lhs.Equals(rhs); + } + +#if LANG_JP + /// + /// != 演算子のオーバーロード + /// + /// 左辺値 + /// 右辺値 + /// 等しくなければtrue +#else + /// + /// Compares two CvPoint objects. The result specifies whether the members of each object are unequal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the members of left and right are unequal; otherwise, false. +#endif + public static bool operator !=(LineSegmentPoint lhs, LineSegmentPoint rhs) + { + return !lhs.Equals(rhs); + } + + #endregion + + #region Overrided methods + +#if LANG_JP + /// + /// Equalsのオーバーライド + /// + /// 比較するオブジェクト + /// +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public override bool Equals(object obj) + { + return base.Equals(obj); + } + +#if LANG_JP + /// + /// GetHashCodeのオーバーライド + /// + /// このオブジェクトのハッシュ値を指定する整数値。 +#else + /// + /// Returns a hash code for this object. + /// + /// An integer value that specifies a hash value for this object. +#endif + public override int GetHashCode() + { + return P1.GetHashCode() + P2.GetHashCode(); + } + +#if LANG_JP + /// + /// 文字列形式を返す + /// + /// 文字列形式 +#else + /// + /// Converts this object to a human readable string. + /// + /// A string that represents this object. +#endif + public override string ToString() + { + return string.Format("CvLineSegmentPoint (P1:{0} P2:{1})", P1, P2); + } + + #endregion + + #region Methods + + #region Line and Line + +#if LANG_JP + /// + /// 2直線の交点を求める (線分としてではなく直線として) + /// + /// + /// + /// +#else + /// + /// Calculates a intersection of the specified two lines + /// + /// + /// + /// +#endif + public static Point? LineIntersection(LineSegmentPoint line1, LineSegmentPoint line2) + { + int x1 = line1.P1.X; + int y1 = line1.P1.Y; + int f1 = line1.P2.X - line1.P1.X; + int g1 = line1.P2.Y - line1.P1.Y; + int x2 = line2.P1.X; + int y2 = line2.P1.Y; + int f2 = line2.P2.X - line2.P1.X; + int g2 = line2.P2.Y - line2.P1.Y; + + double det = f2*g1 - f1*g2; + if (det == 0) + { + return null; + } + + int dx = x2 - x1; + int dy = y2 - y1; + double t1 = (f2*dy - g2*dx)/det; + double t2 = (f1*dy - g1*dx)/det; + + return new Point + { + X = (int) Math.Round(x1 + (f1*t1)), + Y = (int) Math.Round(y1 + (g1*t1)) + }; + } + +#if LANG_JP + /// + /// 2直線の交点を求める (線分としてではなく直線として) + /// + /// + /// +#else + /// + /// Calculates a intersection of the specified two lines + /// + /// + /// +#endif + public Point? LineIntersection(LineSegmentPoint line) + { + return LineIntersection(this, line); + } + + #endregion + + #region Segment and Segment + +#if LANG_JP + /// + /// 線分同士の交点を求める + /// + /// + /// + /// +#else + /// + /// Calculates a intersection of the specified two segments + /// + /// + /// + /// +#endif + public static Point? SegmentIntersection(LineSegmentPoint seg1, LineSegmentPoint seg2) + { + if (IntersectedSegments(seg1, seg2)) + return LineIntersection(seg1, seg2); + else + return null; + } + +#if LANG_JP + /// + /// 線分同士の交点を求める + /// + /// + /// +#else + /// + /// Calculates a intersection of the specified two segments + /// + /// + /// +#endif + public Point? SegmentIntersection(LineSegmentPoint seg) + { + return SegmentIntersection(this, seg); + } + +#if LANG_JP + /// + /// 2つの線分が交差しているかどうかを返す + /// + /// + /// + /// +#else + /// + /// Returns a boolean value indicating whether the specified two segments intersect. + /// + /// + /// + /// +#endif + public static bool IntersectedSegments(LineSegmentPoint seg1, LineSegmentPoint seg2) + { + Point p1 = seg1.P1; + Point p2 = seg1.P2; + Point p3 = seg2.P1; + Point p4 = seg2.P2; + + checked + { + if (p1.X >= p2.X) + { + if ((p1.X < p3.X && p1.X < p4.X) || (p2.X > p3.X && p2.X > p4.X)) + return false; + } + else + { + if ((p2.X < p3.X && p2.X < p4.X) || (p1.X > p3.X && p1.X > p4.X)) + return false; + } + if (p1.Y >= p2.Y) + { + if ((p1.Y < p3.Y && p1.Y < p4.Y) || (p2.Y > p3.Y && p2.Y > p4.Y)) + return false; + } + else + { + if ((p2.Y < p3.Y && p2.Y < p4.Y) || (p1.Y > p3.Y && p1.Y > p4.Y)) + return false; + } + + if (((long) (p1.X - p2.X)*(p3.Y - p1.Y) + (long) (p1.Y - p2.Y)*(p1.X - p3.X))* + ((long) (p1.X - p2.X)*(p4.Y - p1.Y) + (long) (p1.Y - p2.Y)*(p1.X - p4.X)) > 0) + return false; + if (((long) (p3.X - p4.X)*(p1.Y - p3.Y) + (long) (p3.Y - p4.Y)*(p3.X - p1.X))* + ((long) (p3.X - p4.X)*(p2.Y - p3.Y) + (long) (p3.Y - p4.Y)*(p3.X - p2.X)) > 0) + return false; + } + return true; + } + +#if LANG_JP + /// + /// 2つの線分が交差しているかどうかを返す + /// + /// + /// +#else + /// + /// Returns a boolean value indicating whether the specified two segments intersect. + /// + /// + /// +#endif + public bool IntersectedSegments(LineSegmentPoint seg) + { + return IntersectedSegments(this, seg); + } + + #endregion + + #region Line and Segment + +#if LANG_JP + /// + /// 直線と線分が交差しているかを調べる + /// + /// 線分 + /// 直線 + /// +#else + /// + /// Returns a boolean value indicating whether a line and a segment intersect. + /// + /// Line + /// Segment + /// +#endif + public static bool IntersectedLineAndSegment(LineSegmentPoint line, LineSegmentPoint seg) + { + Point p1 = line.P1; + Point p2 = line.P2; + Point p3 = seg.P1; + Point p4 = seg.P2; + if (((long) (p1.X - p2.X)*(p3.Y - p1.Y) + (long) (p1.Y - p2.Y)*(p1.X - p3.X))* + ((long) (p1.X - p2.X)*(p4.Y - p1.Y) + (long) (p1.Y - p2.Y)*(p1.X - p4.X)) > 0) + { + return false; + } + return true; + } + +#if LANG_JP + /// + /// 直線と線分の交点を求める + /// + /// + /// + /// +#else + /// + /// Calculates a intersection of a line and a segment + /// + /// + /// + /// +#endif + public static Point? LineAndSegmentIntersection(LineSegmentPoint line, LineSegmentPoint seg) + { + if (IntersectedLineAndSegment(line, seg)) + return LineIntersection(line, seg); + else + return null; + } + + #endregion + +#if LANG_JP + /// + /// 2点間の距離を求める + /// + /// + /// +#else + /// + /// + /// + /// + /// +#endif + public double Length(LineSegmentPoint s) + { + return P1.DistanceTo(P2); + } + +#if LANG_JP + /// + /// この CvLineSegmentPoint を指定の量だけ平行移動する + /// + /// x 座標のオフセット量 + /// y 座標のオフセット量 + /// +#else + /// + /// Translates the Point by the specified amount. + /// + /// The amount to offset the x-coordinate. + /// The amount to offset the y-coordinate. + /// +#endif + public void Offset(int x, int y) + { + P1.X += x; + P1.Y += y; + P2.X += x; + P2.Y += y; + } + +#if LANG_JP + /// + /// この CvLineSegmentPoint を指定の量だけ平行移動する + /// + /// オフセットに使用する CvPoint + /// +#else + /// + /// Translates the Point by the specified amount. + /// + /// The Point used offset this CvPoint. + /// +#endif + public void Offset(Point p) + { + Offset(p.X, p.Y); + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Model/LineSegmentPolar.cs b/src/OpenCvSharp/modules/imgproc/Model/LineSegmentPolar.cs new file mode 100644 index 000000000..73d5202b9 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Model/LineSegmentPolar.cs @@ -0,0 +1,297 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cvHoughLines2で得られる、極座標系で表現される線分 + /// +#else + /// + /// Polar line segment retrieved from cvHoughLines2 + /// +#endif + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct LineSegmentPolar : IEquatable + { + #region Fields +#if LANG_JP + /// + /// 線分の長さ + /// +#else + /// + /// Length of the line + /// +#endif + public float Rho; +#if LANG_JP + /// + /// 線分の角度(ラジアン) + /// +#else + /// + /// Angle of the line (radian) + /// +#endif + public float Theta; + #endregion + + #region Init +#if LANG_JP + /// + /// 初期化 + /// + /// 線分の長さ + /// 線分の角度(ラジアン) +#else + /// + /// Constructor + /// + /// Length of the line + /// Angle of the line (radian) +#endif + public LineSegmentPolar(float rho, float theta) + { + this.Rho = rho; + this.Theta = theta; + } + #endregion + + #region Operators +#if LANG_JP + /// + /// 指定したオブジェクトと等しければtrueを返す + /// + /// 比較するオブジェクト + /// 型が同じで、メンバの値が等しければtrue +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public bool Equals(LineSegmentPolar obj) + { + return (this.Rho == obj.Rho && this.Theta == obj.Theta); + } +#if LANG_JP + /// + /// == 演算子のオーバーロード + /// + /// 左辺値 + /// 右辺値 + /// 等しければtrue +#else + /// + /// Compares two CvPoint objects. The result specifies whether the members of each object are equal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the members of left and right are equal; otherwise, false. +#endif + public static bool operator ==(LineSegmentPolar lhs, LineSegmentPolar rhs) + { + return lhs.Equals(rhs); + } +#if LANG_JP + /// + /// != 演算子のオーバーロード + /// + /// 左辺値 + /// 右辺値 + /// 等しくなければtrue +#else + /// + /// Compares two CvPoint objects. The result specifies whether the members of each object are unequal. + /// + /// A Point to compare. + /// A Point to compare. + /// This operator returns true if the members of left and right are unequal; otherwise, false. +#endif + public static bool operator !=(LineSegmentPolar lhs, LineSegmentPolar rhs) + { + return !lhs.Equals(rhs); + } + #endregion + + #region Overrided methods +#if LANG_JP + /// + /// Equalsのオーバーライド + /// + /// 比較するオブジェクト + /// +#else + /// + /// Specifies whether this object contains the same members as the specified Object. + /// + /// The Object to test. + /// This method returns true if obj is the same type as this object and has the same members as this object. +#endif + public override bool Equals(object obj) + { + return base.Equals(obj); + } +#if LANG_JP + /// + /// GetHashCodeのオーバーライド + /// + /// このオブジェクトのハッシュ値を指定する整数値。 +#else + /// + /// Returns a hash code for this object. + /// + /// An integer value that specifies a hash value for this object. +#endif + public override int GetHashCode() + { + return Rho.GetHashCode() + Theta.GetHashCode(); + } +#if LANG_JP + /// + /// 文字列形式を返す + /// + /// 文字列形式 +#else + /// + /// Converts this object to a human readable string. + /// + /// A string that represents this object. +#endif + public override string ToString() + { + return string.Format("CvLineSegmentPolar (Rho:{0} Theta:{1})", Rho, Theta); + } + #endregion + + #region Methods +#if LANG_JP + /// + /// 2直線の交点を求める + /// + /// + /// + /// +#else + /// + /// Calculates a intersection of the specified two lines + /// + /// + /// + /// +#endif + public static Point? LineIntersection(LineSegmentPolar line1, LineSegmentPolar line2) + { + var seg1 = line1.ToSegmentPoint(5000); + var seg2 = line2.ToSegmentPoint(5000); + return LineSegmentPoint.LineIntersection(seg1, seg2); + } +#if LANG_JP + /// + /// 2直線の交点を求める (線分としてではなく直線として) + /// + /// + /// +#else + /// + /// Calculates a intersection of the specified two lines + /// + /// + /// +#endif + public Point? LineIntersection(LineSegmentPolar line) + { + return LineIntersection(this, line); + } + + /// + /// CvLineSegmentPointに変換する + /// + /// + /// + public LineSegmentPoint ToSegmentPoint(double scale) + { + double cos = Math.Cos(Theta); + double sin = Math.Sin(Theta); + double x0 = cos * Rho; + double y0 = sin * Rho; + var p1 = new Point { X = (int)Math.Round(x0 + scale * -sin), Y = (int)Math.Round(y0 + scale * cos) }; + var p2 = new Point { X = (int)Math.Round(x0 - scale * -sin), Y = (int)Math.Round(y0 - scale * cos) }; + return new LineSegmentPoint(p1, p2); + } + /// + /// 指定したx座標を両端とするような線分に変換する + /// + /// + /// + /// + public LineSegmentPoint ToSegmentPointX(int x1, int x2) + { + if (x1 > x2) + throw new ArgumentOutOfRangeException(); + + int? y1 = YPosOfLine(x1); + int? y2 = YPosOfLine(x2); + if (!y1.HasValue || !y2.HasValue) + throw new Exception(); + + var p1 = new Point(x1, y1.Value); + var p2 = new Point(x2, y2.Value); + return new LineSegmentPoint(p1, p2); + } + /// + /// 指定したy座標を両端とするような線分に変換する + /// + /// + /// + /// + public LineSegmentPoint ToSegmentPointY(int y1, int y2) + { + if (y1 > y2) + throw new ArgumentOutOfRangeException(); + + int? x1 = XPosOfLine(y1); + int? x2 = XPosOfLine(y2); + if (!x1.HasValue || !x2.HasValue) + throw new Exception(); + + var p1 = new Point(x1.Value, y1); + var p2 = new Point(x2.Value, y2); + return new LineSegmentPoint(p1, p2); + } + + /// + /// 指定したy座標を通るときのx座標を求める + /// + /// + /// + public int? XPosOfLine(int y) + { + var axis = new LineSegmentPolar(y, (float)(Math.PI / 2)); // 垂線90度 = x軸に平行 + Point? node = LineIntersection(axis); + if (node.HasValue) + return node.Value.X; + else + return null; + } + /// + /// 指定したx座標を通るときのy座標を求める + /// + /// + /// + public int? YPosOfLine(int x) + { + var axis = new LineSegmentPolar(x, (float)0); // 垂線0度 = y軸に平行 + Point? node = LineIntersection(axis); + if (node.HasValue) + return node.Value.Y; + else + return null; + } + #endregion + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Moments.cs b/src/OpenCvSharp/modules/imgproc/Moments.cs new file mode 100644 index 000000000..3bbd6cb8f --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Moments.cs @@ -0,0 +1,267 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// Raster image moments + /// + public class Moments + { + /// + /// spatial moments + /// + public double M00, M10, M01, M20, M11, M02, M30, M21, M12, M03; + + /// + /// central moments + /// + public double Mu20, Mu11, Mu02, Mu30, Mu21, Mu12, Mu03; + + /// + /// central normalized moments + /// + public double Nu20, Nu11, Nu02, Nu30, Nu21, Nu12, Nu03; + + #region Init & Disposal + /// + /// Default constructor. + /// All moment values are set to 0. + /// + public Moments() + { + M00 = M10 = M01 = M20 = M11 = M02 = M30 = M21 = M12 = M03 = + Mu20 = Mu11 = Mu02 = Mu30 = Mu21 = Mu12 = Mu03 = + Nu20 = Nu11 = Nu02 = Nu30 = Nu21 = Nu12 = Nu03 = 0.0; + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public Moments(double m00, double m10, double m01, double m20, double m11, + double m02, double m30, double m21, double m12, double m03) + { + Initialize(m00, m10, m01, m20, m11, m02, m30, m21, m12, m03); + } + + /// + /// Calculates all of the moments + /// up to the third order of a polygon or rasterized shape. + /// + /// A raster image (single-channel, 8-bit or floating-point + /// 2D array) or an array ( 1xN or Nx1 ) of 2D points ( Point or Point2f ) + /// If it is true, then all the non-zero image pixels are treated as 1’s + /// + public Moments(InputArray array, bool binaryImage = false) + { + if (array == null) + throw new ArgumentNullException("array"); + array.ThrowIfDisposed(); + InitializeFromInputArray(array, binaryImage); + } + + /// + /// Calculates all of the moments + /// up to the third order of a polygon or rasterized shape. + /// + /// A raster image (8-bit) 2D array + /// If it is true, then all the non-zero image pixels are treated as 1’s + /// + public Moments(byte[,] array, bool binaryImage = false) + { + if (array == null) + throw new ArgumentNullException("array"); + int rows = array.GetLength(0); + int cols = array.GetLength(1); + using (var arrayMat = new Mat(rows, cols, MatType.CV_8UC1, array)) + { + InitializeFromInputArray(arrayMat, binaryImage); + } + } + + /// + /// Calculates all of the moments + /// up to the third order of a polygon or rasterized shape. + /// + /// A raster image (floating-point) 2D array + /// If it is true, then all the non-zero image pixels are treated as 1’s + /// + public Moments(float[,] array, bool binaryImage = false) + { + if (array == null) + throw new ArgumentNullException("array"); + int rows = array.GetLength(0); + int cols = array.GetLength(1); + using (var arrayMat = new Mat(rows, cols, MatType.CV_32FC1, array)) + { + InitializeFromInputArray(arrayMat, binaryImage); + } + } + + /// + /// Calculates all of the moments + /// up to the third order of a polygon or rasterized shape. + /// + /// Array of 2D points + /// If it is true, then all the non-zero image pixels are treated as 1’s + /// + public Moments(IEnumerable array, bool binaryImage = false) + { + if (array == null) + throw new ArgumentNullException("array"); + Point[] points = EnumerableEx.ToArray(array); + using (var pointsMat = new Mat(points.Length, 1, MatType.CV_32SC2, points)) + { + InitializeFromInputArray(pointsMat, binaryImage); + } + } + + /// + /// Calculates all of the moments + /// up to the third order of a polygon or rasterized shape. + /// + /// Array of 2D points + /// If it is true, then all the non-zero image pixels are treated as 1’s + /// + public Moments(IEnumerable array, bool binaryImage = false) + { + if (array == null) + throw new ArgumentNullException("array"); + Point2f[] points = EnumerableEx.ToArray(array); + using (var pointsMat = new Mat(points.Length, 1, MatType.CV_32FC2, points)) + { + InitializeFromInputArray(pointsMat, binaryImage); + } + } + + /// + /// Calculates all of the moments + /// up to the third order of a polygon or rasterized shape. + /// + /// A raster image (single-channel, 8-bit or floating-point + /// 2D array) or an array ( 1xN or Nx1 ) of 2D points ( Point or Point2f ) + /// If it is true, then all the non-zero image pixels are treated as 1’s + /// + private void InitializeFromInputArray(InputArray array, bool binaryImage) + { + var m = NativeMethods.imgproc_moments(array.CvPtr, binaryImage ? 1 : 0); + Initialize(m.m00, m.m10, m.m01, m.m20, m.m11, m.m02, m.m30, m.m21, m.m12, m.m03); + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + private void Initialize(double m00, double m10, double m01, double m20, double m11, + double m02, double m30, double m21, double m12, double m03) + { + M00 = m00; + M10 = m10; + M01 = m01; + M20 = m20; + M11 = m11; + M02 = m02; + M30 = m30; + M21 = m21; + M12 = m12; + M03 = m03; + + double cx = 0, cy = 0, invM00 = 0; + if (Math.Abs(M00) > Double.Epsilon) + { + invM00 = 1.0 / M00; + cx = M10 * invM00; + cy = M01 * invM00; + } + + Mu20 = M20 - M10 * cx; + Mu11 = M11 - M10 * cy; + Mu02 = M02 - M01 * cy; + + Mu30 = M30 - cx * (3 * Mu20 + cx * M10); + Mu21 = M21 - cx * (2 * Mu11 + cx * M01) - cy * Mu20; + Mu12 = M12 - cy * (2 * Mu11 + cy * M10) - cx * Mu02; + Mu03 = M03 - cy * (3 * Mu02 + cy * M01); + + double invSqrtM00 = Math.Sqrt(Math.Abs(invM00)); + double s2 = invM00 * invM00; + double s3 = s2 * invSqrtM00; + + Nu20 = Mu20 * s2; + Nu11 = Mu11 * s2; + Nu02 = Mu02 * s2; + Nu30 = Mu30 * s3; + Nu21 = Mu21 * s3; + Nu12 = Mu12 * s3; + Nu03 = Mu03 * s3; + } + + #endregion + + #region Methods + /// + /// computes 7 Hu invariants from the moments + /// + /// + public double[] HuMoments() + { + double[] hu = new double[7]; + double t0 = Nu30 + Nu12; + double t1 = Nu21 + Nu03; + + double q0 = t0 * t0, q1 = t1 * t1; + + double n4 = 4 * Nu11; + double s = Nu20 + Nu02; + double d = Nu20 - Nu02; + + hu[0] = s; + hu[1] = d * d + n4 * Nu11; + hu[3] = q0 + q1; + hu[5] = d * (q0 - q1) + n4 * t0 * t1; + + t0 *= q0 - 3 * q1; + t1 *= 3 * q0 - q1; + + q0 = Nu30 - 3 * Nu12; + q1 = 3 * Nu21 - Nu03; + + hu[2] = q0 * q0 + q1 * q1; + hu[4] = q0 * t0 + q1 * t1; + hu[6] = q1 * t0 - q0 * t1; + return hu; + } + + #endregion + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] +#pragma warning disable 1591 + public struct NativeStruct + { + public double m00, m10, m01, m20, m11, m02, m30, m21, m12, m03; /* spatial moments */ + public double mu20, mu11, mu02, mu30, mu21, mu12, mu03; /* central moments */ + public double inv_sqrt_m00; /* m00 != 0 ? 1/sqrt(m00) : 0 */ + } + } +} diff --git a/src/OpenCvSharp/modules/imgproc/Subdiv2D.cs b/src/OpenCvSharp/modules/imgproc/Subdiv2D.cs new file mode 100644 index 000000000..f4133d678 --- /dev/null +++ b/src/OpenCvSharp/modules/imgproc/Subdiv2D.cs @@ -0,0 +1,422 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// + /// +#else + /// + /// + /// +#endif + public class Subdiv2D : DisposableCvObject + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Disposal + #region Constructor +#if LANG_JP + /// + /// デフォルトのパラメータで初期化. + /// 実際は numberOfDisparities だけは指定する必要がある. + /// +#else + /// + /// Default constructor + /// +#endif + public Subdiv2D() + { + ptr = NativeMethods.imgproc_Subdiv2D_new(); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException(); + } + +#if LANG_JP + /// + /// Subdiv2D コンストラクタ + /// + /// +#else + /// + /// Subdiv2D Constructor + /// + /// +#endif + public Subdiv2D(Rect rect) + { + ptr = NativeMethods.imgproc_Subdiv2D_new(rect); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException(); + } + #endregion + #region Dispose +#if LANG_JP + /// + /// リソースの解放 + /// +#else + /// + /// Clean up any resources being used. + /// +#endif + public void Release() + { + Dispose(true); + } +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (ptr != IntPtr.Zero) + { + NativeMethods.imgproc_Subdiv2D_delete(ptr); + } + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + #endregion + + #region Constants + /// + /// + /// + public const int + PTLOC_ERROR = -2, + PTLOC_OUTSIDE_RECT = -1, + PTLOC_INSIDE = 0, + PTLOC_VERTEX = 1, + PTLOC_ON_EDGE = 2; + /// + /// + /// + public const int + NEXT_AROUND_ORG = 0x00, + NEXT_AROUND_DST = 0x22, + PREV_AROUND_ORG = 0x11, + PREV_AROUND_DST = 0x33, + NEXT_AROUND_LEFT = 0x13, + NEXT_AROUND_RIGHT = 0x31, + PREV_AROUND_LEFT = 0x20, + PREV_AROUND_RIGHT = 0x02; + #endregion + + #region Methods + #region InitDelaunay + /// + /// + /// + /// + public void InitDelaunay(Rect rect) + { + if(disposed) + throw new ObjectDisposedException("Subdiv2D", ""); + NativeMethods.imgproc_Subdiv2D_initDelaunay(ptr, rect); + } + #endregion + #region Insert + /// + /// + /// + /// + /// + public int Insert(Point2f pt) + { + if(disposed) + throw new ObjectDisposedException("Subdiv2D", ""); + return NativeMethods.imgproc_Subdiv2D_insert(ptr, pt); + } + /// + /// + /// + /// + public void Insert(Point2f[] ptvec) + { + if(disposed) + throw new ObjectDisposedException("Subdiv2D", ""); + if(ptvec == null) + throw new ArgumentNullException("ptvec"); + NativeMethods.imgproc_Subdiv2D_insert(ptr, ptvec, ptvec.Length); + } + /// + /// + /// + /// + public void Insert(IEnumerable ptvec) + { + if (ptvec == null) + throw new ArgumentNullException("ptvec"); + Insert(new List(ptvec).ToArray()); + } + #endregion + #region Locate + /// + /// + /// + /// + /// + /// + /// + public int Locate(Point2f pt, out int edge, out int vertex) + { + if (disposed) + throw new ObjectDisposedException("Subdiv2D", ""); + return NativeMethods.imgproc_Subdiv2D_locate(ptr, pt, out edge, out vertex); + } + #endregion + #region FindNearest + /// + /// + /// + /// + /// + public int FindNearest(Point2f pt) + { + Point2f nearestPt; + return FindNearest(pt, out nearestPt); + } + /// + /// + /// + /// + /// + /// + public int FindNearest(Point2f pt, out Point2f nearestPt) + { + if (disposed) + throw new ObjectDisposedException("Subdiv2D", ""); + return NativeMethods.imgproc_Subdiv2D_findNearest(ptr, pt, out nearestPt); + } + #endregion + #region GetEdgeList + /// + /// + /// + /// + public Vec4f[] GetEdgeList() + { + if (disposed) + throw new ObjectDisposedException("Subdiv2D", ""); + IntPtr p; + NativeMethods.imgproc_Subdiv2D_getEdgeList(ptr, out p); + using (VectorOfVec4f vec = new VectorOfVec4f(p)) + { + return vec.ToArray(); + } + } + #endregion + #region GetTriangleList + /// + /// + /// + /// + public Vec6f[] GetTriangleList() + { + if (disposed) + throw new ObjectDisposedException("Subdiv2D", ""); + IntPtr p; + NativeMethods.imgproc_Subdiv2D_getTriangleList(ptr, out p); + using (VectorOfVec6f vec = new VectorOfVec6f(p)) + { + return vec.ToArray(); + } + } + #endregion + #region GetVoronoiFacetList + /// + /// + /// + /// + /// + /// + public void GetVoronoiFacetList(IEnumerable idx, out Point2f[][] facetList, out Point2f[] facetCenters) + { + if (disposed) + throw new ObjectDisposedException("Subdiv2D", ""); + + IntPtr facetListPtr, facetCentersPtr; + if (idx == null) + { + NativeMethods.imgproc_Subdiv2D_getVoronoiFacetList(ptr, IntPtr.Zero, 0, out facetListPtr, out facetCentersPtr); + } + else + { + int[] idxArray = EnumerableEx.ToArray(idx); + NativeMethods.imgproc_Subdiv2D_getVoronoiFacetList(ptr, idxArray, idxArray.Length, out facetListPtr, out facetCentersPtr); + } + + using (VectorOfVectorPoint2f facetListVec = new VectorOfVectorPoint2f(facetListPtr)) + { + facetList = facetListVec.ToArray(); + } + using (VectorOfPoint2f facetCentersVec = new VectorOfPoint2f(facetCentersPtr)) + { + facetCenters = facetCentersVec.ToArray(); + } + } + #endregion + #region GetVertex + /// + /// + /// + /// + /// + public Point2f GetVertex(int vertex) + { + int firstEdge; + return GetVertex(vertex, out firstEdge); + } + /// + /// + /// + /// + /// + /// + public Point2f GetVertex(int vertex, out int firstEdge) + { + if (disposed) + throw new ObjectDisposedException("Subdiv2D", ""); + return NativeMethods.imgproc_Subdiv2D_getVertex(ptr, vertex, out firstEdge); + } + #endregion + #region GetEdge + /// + /// + /// + /// + /// + /// + public int GetEdge(int edge, int nextEdgeType) + { + if (disposed) + throw new ObjectDisposedException("Subdiv2D", ""); + return NativeMethods.imgproc_Subdiv2D_getEdge(ptr, edge, nextEdgeType); + } + #endregion + #region NextEdge + /// + /// + /// + /// + /// + public int NextEdge(int edge) + { + if (disposed) + throw new ObjectDisposedException("Subdiv2D", ""); + return NativeMethods.imgproc_Subdiv2D_nextEdge(ptr, edge); + } + #endregion + #region RotateEdge + /// + /// + /// + /// + /// + /// + public int RotateEdge(int edge, int rotate) + { + if (disposed) + throw new ObjectDisposedException("Subdiv2D", ""); + return NativeMethods.imgproc_Subdiv2D_rotateEdge(ptr, edge, rotate); + } + #endregion + #region SymEdge + /// + /// + /// + /// + /// + public int SymEdge(int edge) + { + if (disposed) + throw new ObjectDisposedException("Subdiv2D", ""); + return NativeMethods.imgproc_Subdiv2D_symEdge(ptr, edge); + } + #endregion + #region EdgeOrg + /// + /// + /// + /// + /// + public int EdgeOrg(int edge) + { + Point2f orgpt; + return EdgeOrg(edge, out orgpt); + } + /// + /// + /// + /// + /// + /// + public int EdgeOrg(int edge, out Point2f orgpt) + { + if (disposed) + throw new ObjectDisposedException("Subdiv2D", ""); + return NativeMethods.imgproc_Subdiv2D_edgeOrg(ptr, edge, out orgpt); + } + #endregion + #region EdgeDst + /// + /// + /// + /// + /// + public int EdgeDst(int edge) + { + Point2f dstpt; + return EdgeDst(edge, out dstpt); + } + /// + /// + /// + /// + /// + /// + public int EdgeDst(int edge, out Point2f dstpt) + { + if (disposed) + throw new ObjectDisposedException("Subdiv2D", ""); + return NativeMethods.imgproc_Subdiv2D_edgeDst(ptr, edge, out dstpt); + } + #endregion + #endregion + } +} diff --git a/src/OpenCvSharp/modules/ml/ANN_MLP.cs b/src/OpenCvSharp/modules/ml/ANN_MLP.cs new file mode 100644 index 000000000..1005fc176 --- /dev/null +++ b/src/OpenCvSharp/modules/ml/ANN_MLP.cs @@ -0,0 +1,240 @@ +using System; + +namespace OpenCvSharp.ML +{ +#if LANG_JP + /// + /// MLPモデルクラス + /// +#else + /// + /// Artificial Neural Networks - Multi-Layer Perceptrons. + /// +#endif + public class ANN_MLP : StatModel + { + /// + /// Track whether Dispose has been called + /// + private bool disposed; + private Ptr ptrObj; + + #region Init and Disposal + /// + /// Creates instance by raw pointer cv::ml::ANN_MLP* + /// + protected ANN_MLP(IntPtr p) + : base() + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// Creates the empty model. + /// + /// + public static ANN_MLP Create() + { + IntPtr ptr = NativeMethods.ml_ANN_MLP_create(); + return new ANN_MLP(ptr); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + + /// + /// Termination criteria of the training algorithm. + /// + public TermCriteria TermCriteria + { + get { return NativeMethods.ml_ANN_MLP_getTermCriteria(ptr); } + set { NativeMethods.ml_ANN_MLP_setTermCriteria(ptr, value); } + } + + /// + /// Strength of the weight gradient term. + /// The recommended value is about 0.1. Default value is 0.1. + /// + public double BackpropWeightScale + { + get { return NativeMethods.ml_ANN_MLP_getBackpropWeightScale(ptr); } + set { NativeMethods.ml_ANN_MLP_setBackpropWeightScale(ptr, value); } + } + + /// + /// Strength of the momentum term (the difference between weights on the 2 previous iterations). + /// This parameter provides some inertia to smooth the random fluctuations of the weights. + /// It can vary from 0 (the feature is disabled) to 1 and beyond. The value 0.1 or + /// so is good enough. Default value is 0.1. + /// + public double BackpropMomentumScale + { + get { return NativeMethods.ml_ANN_MLP_getBackpropMomentumScale(ptr); } + set { NativeMethods.ml_ANN_MLP_setBackpropMomentumScale(ptr, value); } + } + + /// + /// Initial value Delta_0 of update-values Delta_{ij}. Default value is 0.1. + /// +// ReSharper disable once InconsistentNaming + public double RpropDW0 + { + get { return NativeMethods.ml_ANN_MLP_getRpropDW0(ptr); } + set { NativeMethods.ml_ANN_MLP_setRpropDW0(ptr, value); } + } + + /// + /// Increase factor eta^+. + /// It must be >1. Default value is 1.2. + /// +// ReSharper disable once InconsistentNaming + public double RpropDWPlus + { + get { return NativeMethods.ml_ANN_MLP_getRpropDWPlus(ptr); } + set { NativeMethods.ml_ANN_MLP_setRpropDWPlus(ptr, value); } + } + + /// + /// Decrease factor eta^-. + /// It must be \>1. Default value is 0.5. + /// +// ReSharper disable once InconsistentNaming + public double RpropDWMinus + { + get { return NativeMethods.ml_ANN_MLP_getRpropDWPlus(ptr); } + set { NativeMethods.ml_ANN_MLP_setRpropDWPlus(ptr, value); } + } + + /// + /// Update-values lower limit Delta_{min}. + /// It must be positive. Default value is FLT_EPSILON. + /// +// ReSharper disable once InconsistentNaming + public double RpropDWMin + { + get { return NativeMethods.ml_ANN_MLP_getRpropDWMin(ptr); } + set { NativeMethods.ml_ANN_MLP_setRpropDWMin(ptr, value); } + } + + /// + /// Update-values upper limit Delta_{max}. + /// It must be >1. Default value is 50. + /// +// ReSharper disable once InconsistentNaming + public double RpropDWMax + { + get { return NativeMethods.ml_ANN_MLP_getRpropDWMax(ptr); } + set { NativeMethods.ml_ANN_MLP_setRpropDWMax(ptr, value); } + } + + #endregion + + #region Methods + + #endregion + + #region Types + + /// + /// possible activation functions + /// + public enum ActivationFunctions + { + /// + /// Identity function: $f(x)=x + /// + Identity = 0, + + /// + /// Symmetrical sigmoid: f(x)=\beta*(1-e^{-\alpha x})/(1+e^{-\alpha x} + /// + SigmoidSym = 1, + + /// + /// Gaussian function: f(x)=\beta e^{-\alpha x*x} + /// + Gaussian = 2 + } + + /// + /// Train options + /// + [Flags] + public enum TrainFlags + { + /// + /// Update the network weights, rather than compute them from scratch. + /// In the latter case the weights are initialized using the Nguyen-Widrow algorithm. + /// + UpdateWeights = 1, + + /* */ + /// + /// Do not normalize the input vectors. + /// If this flag is not set, the training algorithm normalizes each input feature + /// independently, shifting its mean value to 0 and making the standard deviation + /// equal to 1. If the network is assumed to be updated frequently, the new + /// training data could be much different from original one. In this case, + /// you should take care of proper normalization. + /// + NoInputScale = 2, + + /// + /// Do not normalize the output vectors. If the flag is not set, + /// the training algorithm normalizes each output feature independently, + /// by transforming it to the certain range depending on the used activation function. + /// + NoOutputScale = 4 + } + + /// + /// Available training methods + /// + public enum TrainingMethods + { + /// + /// The back-propagation algorithm. + /// + BackProp = 0, + + /// + /// The RPROP algorithm. See @cite RPROP93 for details. + /// + RProp = 1 + } + + #endregion + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/ml/Boost.cs b/src/OpenCvSharp/modules/ml/Boost.cs new file mode 100644 index 000000000..e9512f210 --- /dev/null +++ b/src/OpenCvSharp/modules/ml/Boost.cs @@ -0,0 +1,152 @@ +using System; + +namespace OpenCvSharp.ML +{ + /// + /// Boosted tree classifier derived from DTrees + /// + public class Boost : DTrees + { + /// + /// Track whether Dispose has been called + /// + private bool disposed; + private Ptr ptrObj; + + #region Init and Disposal + + /// + /// Creates instance by raw pointer cv::ml::Boost* + /// + protected Boost(IntPtr p) + : base() + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// Creates the empty model. + /// + /// + public static new Boost Create() + { + IntPtr ptr = NativeMethods.ml_Boost_create(); + return new Boost(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + + /// + /// Type of the boosting algorithm. + /// See Boost::Types. Default value is Boost::REAL. + /// + public Types BoostType + { + get { return (Types)NativeMethods.ml_Boost_getBoostType(ptr); } + set { NativeMethods.ml_Boost_setBoostType(ptr, (int)value); } + } + + /// + /// The number of weak classifiers. + /// Default value is 100. + /// + public int WeakCount + { + get { return NativeMethods.ml_Boost_getWeakCount(ptr); } + set { NativeMethods.ml_Boost_setWeakCount(ptr, value); } + } + + /// + /// A threshold between 0 and 1 used to save computational time. + /// Samples with summary weight \f$\leq 1 - weight_trim_rate + /// do not participate in the *next* iteration of training. + /// Set this parameter to 0 to turn off this functionality. Default value is 0.95. + /// + public double WeightTrimRate + { + get { return NativeMethods.ml_Boost_getWeightTrimRate(ptr); } + set { NativeMethods.ml_Boost_setWeightTrimRate(ptr, value); } + } + + #endregion + + #region Methods + #endregion + + #region Types + + /// + /// Boosting type. + /// Gentle AdaBoost and Real AdaBoost are often the preferable choices. + /// + public enum Types + { + /// + /// Discrete AdaBoost. + /// + Discrete = 0, + + /// + /// Real AdaBoost. It is a technique that utilizes confidence-rated predictions + /// and works well with categorical data. + /// + Real = 1, + + /// + /// LogitBoost. It can produce good regression fits. + /// + Logit = 2, + + /// + /// Gentle AdaBoost. It puts less weight on outlier data points and for that + /// reason is often good with regression data. + /// + Gentle = 3 + }; + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/ml/DTrees.cs b/src/OpenCvSharp/modules/ml/DTrees.cs new file mode 100644 index 000000000..005d5dde1 --- /dev/null +++ b/src/OpenCvSharp/modules/ml/DTrees.cs @@ -0,0 +1,353 @@ +using System; + +namespace OpenCvSharp.ML +{ +#if LANG_JP + /// + /// 決定木クラス + /// +#else + /// + /// Decision tree + /// +#endif + public class DTrees : StatModel + { + /// + /// Track whether Dispose has been called + /// + private bool disposed; + + private Ptr ptrObj; + + #region Init and Disposal + + /// + /// + /// + protected DTrees() + { + ptrObj = null; + } + + /// + /// Creates instance by raw pointer cv::ml::SVM* + /// + protected DTrees(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// Creates the empty model. + /// + /// + public static DTrees Create() + { + IntPtr ptr = NativeMethods.ml_DTrees_create(); + return new DTrees(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// Cluster possible values of a categorical variable into + /// K < =maxCategories clusters to find a suboptimal split. + /// + public int MaxCategories + { + get { return NativeMethods.ml_DTrees_getMaxCategories(ptr); } + set { NativeMethods.ml_DTrees_setMaxCategories(ptr, value); } + } + + /// + /// The maximum possible depth of the tree. + /// + public int MaxDepth + { + get { return NativeMethods.ml_DTrees_getMaxDepth(ptr); } + set { NativeMethods.ml_DTrees_setMaxDepth(ptr, value); } + } + + /// + /// If the number of samples in a node is less than this parameter then the + /// node will not be split. Default value is 10. + /// + public int MinSampleCount + { + get { return NativeMethods.ml_DTrees_getMinSampleCount(ptr); } + set { NativeMethods.ml_DTrees_setMinSampleCount(ptr, value); } + } + + /// + /// If CVFolds \> 1 then algorithms prunes the built decision tree using K-fold + /// cross-validation procedure where K is equal to CVFolds. Default value is 10. + /// +// ReSharper disable once InconsistentNaming + public int CVFolds + { + get { return NativeMethods.ml_DTrees_getCVFolds(ptr); } + set { NativeMethods.ml_DTrees_setCVFolds(ptr, value); } + } + + /// + /// If true then surrogate splits will be built. + /// These splits allow to work with missing data and compute variable + /// importance correctly. Default value is false. + /// + public bool UseSurrogates + { + get { return NativeMethods.ml_DTrees_getUseSurrogates(ptr) != 0; } + set { NativeMethods.ml_DTrees_setUseSurrogates(ptr, value ? 1 : 0); } + } + + /// + /// If true then a pruning will be harsher. + /// This will make a tree more compact and more resistant to the training + /// data noise but a bit less accurate. Default value is true. + /// +// ReSharper disable once InconsistentNaming + public bool Use1SERule + { + get { return NativeMethods.ml_DTrees_getUse1SERule(ptr) != 0; } + set { NativeMethods.ml_DTrees_setUse1SERule(ptr, value ? 1 : 0); } + } + + /// + /// If true then pruned branches are physically removed from the tree. + /// Otherwise they are retained and it is possible to get results from the + /// original unpruned (or pruned less aggressively) tree. Default value is true. + /// + public bool TruncatePrunedTree + { + get { return NativeMethods.ml_DTrees_getTruncatePrunedTree(ptr) != 0; } + set { NativeMethods.ml_DTrees_setTruncatePrunedTree(ptr, value ? 1 : 0); } + } + + /// + /// Termination criteria for regression trees. + /// If all absolute differences between an estimated value in a node and + /// values of train samples in this node are less than this parameter + /// then the node will not be split further. Default value is 0.01f. + /// + public float RegressionAccuracy + { + get { return NativeMethods.ml_DTrees_getRegressionAccuracy(ptr); } + set { NativeMethods.ml_DTrees_setRegressionAccuracy(ptr, value); } + } + + /// + /// The array of a priori class probabilities, sorted by the class label value. + /// + public Mat Priors + { + get + { + IntPtr p = NativeMethods.ml_DTrees_getPriors(ptr); + return new Mat(p); + } + set { NativeMethods.ml_DTrees_setPriors(ptr, value.CvPtr); } + } + + #endregion + + #region Methods + + /// + /// Returns indices of root nodes + /// + /// + public int[] GetRoots() + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + + using (var vector = new VectorOfInt32()) + { + NativeMethods.ml_DTrees_getRoots(ptr, vector.CvPtr); + return vector.ToArray(); + } + } + + /// + /// Returns all the nodes. + /// all the node indices are indices in the returned vector + /// + public Node[] GetNodes() + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + + using (var vector = new VectorOfDTreesNode()) + { + NativeMethods.ml_DTrees_getNodes(ptr, vector.CvPtr); + return vector.ToArray(); + } + } + + /// + /// Returns all the splits. + /// all the split indices are indices in the returned vector + /// + /// + public Split[] GetSplits() + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + + using (var vector = new VectorOfDTreesSplit()) + { + NativeMethods.ml_DTrees_getSplits(ptr, vector.CvPtr); + return vector.ToArray(); + } + } + + /// + /// Returns all the bitsets for categorical splits. + /// Split::subsetOfs is an offset in the returned vector + /// + /// + public int[] GetSubsets() + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + + using (var vector = new VectorOfInt32()) + { + NativeMethods.ml_DTrees_getSubsets(ptr, vector.CvPtr); + return vector.ToArray(); + } + } + + #endregion + + #region Types + + /// + /// The class represents a decision tree node. + /// + public struct Node + { + /// + /// Value at the node: a class label in case of classification or estimated + /// function value in case of regression. + /// + public double Value; + + /// + /// Class index normalized to 0..class_count-1 range and assigned to the + /// node. It is used internally in classification trees and tree ensembles. + /// + public int ClassIdx; + + /// + /// Index of the parent node + /// + public int Parent; + + /// + /// Index of the left child node + /// + public int Left; + + /// + /// Index of right child node + /// + public int Right; + + /// + /// Default direction where to go (-1: left or +1: right). It helps in the + /// case of missing values. + /// + public int DefaultDir; + + /// + /// Index of the first split + /// + public int Split; + } + + /// + /// The class represents split in a decision tree. + /// + public struct Split + { + /// + /// Index of variable on which the split is created. + /// + public int VarIdx; + + /// + /// If not 0, then the inverse split rule is used (i.e. left and right + /// branches are exchanged in the rule expressions below). + /// + public int Inversed; + + /// + /// The split quality, a positive number. It is used to choose the best split. + /// + public float Quality; + + /// + /// Index of the next split in the list of splits for the node + /// + public int Next; + + /// + /// The threshold value in case of split on an ordered variable. + /// + public float C; + + /// + /// Offset of the bitset used by the split on a categorical variable. + /// + public int SubsetOfs; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/ml/EM.cs b/src/OpenCvSharp/modules/ml/EM.cs new file mode 100644 index 000000000..8a9bc73ab --- /dev/null +++ b/src/OpenCvSharp/modules/ml/EM.cs @@ -0,0 +1,448 @@ +using System; +using OpenCvSharp.ML; + +// ReSharper disable once InconsistentNaming + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// EMモデルクラス + /// +#else + /// + /// The class implements the Expectation Maximization algorithm. + /// +#endif + public class EM : Algorithm + { + /// + /// Track whether Dispose has been called + /// + private bool disposed; + private Ptr ptrObj; + + #region Constants + +#pragma warning disable 1591 +// ReSharper disable InconsistentNaming + public const int DEFAULT_NCLUSTERS = 5; + public const int DEFAULT_MAX_ITERS = 100; +// ReSharper restore InconsistentNaming +#pragma warning restore 1591 + + #endregion + + #region Init and Disposal + + /// + /// Creates instance by raw pointer cv::ml::EM* + /// + protected EM(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// Creates empty EM model. + /// + /// + public static EM Create() + { + IntPtr ptr = NativeMethods.ml_SVM_create(); + return new EM(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// The number of mixture components in the Gaussian mixture model. + /// Default value of the parameter is EM::DEFAULT_NCLUSTERS=5. + /// Some of EM implementation could determine the optimal number of mixtures + /// within a specified value range, but that is not the case in ML yet. + /// + public int ClustersNumber + { + get { return NativeMethods.ml_EM_getClustersNumber(ptr); } + set { NativeMethods.ml_EM_setClustersNumber(ptr, value); } + } + + /// + /// Constraint on covariance matrices which defines type of matrices. + /// + public int CovarianceMatrixType + { + get { return NativeMethods.ml_EM_getCovarianceMatrixType(ptr); } + set { NativeMethods.ml_EM_setCovarianceMatrixType(ptr, value); } + } + + /// + /// The termination criteria of the %EM algorithm. + /// The EM algorithm can be terminated by the number of iterations + /// termCrit.maxCount (number of M-steps) or when relative change of likelihood + /// logarithm is less than termCrit.epsilon. + /// Default maximum number of iterations is EM::DEFAULT_MAX_ITERS=100. + /// + public TermCriteria TermCriteria + { + get { return NativeMethods.ml_EM_getTermCriteria(ptr); } + set { NativeMethods.ml_EM_setTermCriteria(ptr, value); } + } + + #endregion + + #region Methods + + /// + /// Returns weights of the mixtures. + /// Returns vector with the number of elements equal to the number of mixtures. + /// + /// + public Mat GetWeights() + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + IntPtr p = NativeMethods.ml_EM_getWeights(ptr); + return new Mat(p); + } + + /// + /// Returns the cluster centers (means of the Gaussian mixture). + /// Returns matrix with the number of rows equal to the number of mixtures and + /// number of columns equal to the space dimensionality. + /// + /// + public Mat GetMeans() + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + IntPtr p = NativeMethods.ml_EM_getMeans(ptr); + return new Mat(p); + } + + /// + /// Returns covariation matrices. + /// Returns vector of covariation matrices. Number of matrices is the number of + /// gaussian mixtures, each matrix is a square floating-point matrix NxN, where N is the space dimensionality. + /// + public Mat[] GetCovs() + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + + using (var vec = new VectorOfMat()) + { + NativeMethods.ml_EM_getCovs(ptr, vec.CvPtr); + return vec.ToArray(); + } + + } + +#if LANG_JP + /// + /// サンプル集合からガウス混合パラメータを推定する + /// + /// + /// + /// + /// + /// + /// + /// +#else + /// + /// Estimates Gaussian mixture parameters from the sample set + /// + /// + /// + /// + /// + /// + /// + /// +#endif + public virtual bool TrainE( + InputArray samples, + InputArray means0, + InputArray covs0 = null, + InputArray weights0 = null, + OutputArray logLikelihoods = null, + OutputArray labels = null, + OutputArray probs = null) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (samples == null) + throw new ArgumentNullException("samples"); + if (means0 == null) + throw new ArgumentNullException("means0"); + samples.ThrowIfDisposed(); + means0.ThrowIfDisposed(); + + if (logLikelihoods != null) + logLikelihoods.ThrowIfNotReady(); + if (covs0 != null) + covs0.ThrowIfDisposed(); + if (weights0 != null) + weights0.ThrowIfDisposed(); + if (labels != null) + labels.ThrowIfNotReady(); + if (probs != null) + probs.ThrowIfNotReady(); + + int ret = NativeMethods.ml_EM_trainE( + ptr, + samples.CvPtr, + means0.CvPtr, + Cv2.ToPtr(covs0), + Cv2.ToPtr(weights0), + Cv2.ToPtr(logLikelihoods), + Cv2.ToPtr(labels), + Cv2.ToPtr(probs)); + + if (logLikelihoods != null) + logLikelihoods.Fix(); + if (labels != null) + labels.Fix(); + if (probs != null) + probs.Fix(); + GC.KeepAlive(samples); + GC.KeepAlive(means0); + GC.KeepAlive(covs0); + GC.KeepAlive(weights0); + + return ret != 0; + } + +#if LANG_JP + /// + /// サンプル集合からガウス混合パラメータを推定する + /// + /// + /// + /// + /// + /// +#else + /// + /// Estimates Gaussian mixture parameters from the sample set + /// + /// + /// + /// + /// + /// +#endif + public virtual bool TrainM( + InputArray samples, + InputArray probs0, + OutputArray logLikelihoods = null, + OutputArray labels = null, + OutputArray probs = null) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (samples == null) + throw new ArgumentNullException("samples"); + if (probs0 == null) + throw new ArgumentNullException("probs0"); + samples.ThrowIfDisposed(); + probs0.ThrowIfDisposed(); + + if (logLikelihoods != null) + logLikelihoods.ThrowIfNotReady(); + if (labels != null) + labels.ThrowIfNotReady(); + if (probs != null) + probs.ThrowIfNotReady(); + + int ret = NativeMethods.ml_EM_trainM( + ptr, + samples.CvPtr, + probs0.CvPtr, + Cv2.ToPtr(logLikelihoods), + Cv2.ToPtr(labels), + Cv2.ToPtr(probs)); + + if (logLikelihoods != null) + logLikelihoods.Fix(); + if (labels != null) + labels.Fix(); + if (probs != null) + probs.Fix(); + GC.KeepAlive(samples); + GC.KeepAlive(probs0); + + return ret != 0; + } + +#if LANG_JP + /// + /// サンプルに対する応答を予測する + /// + /// + /// +#else + /// + /// Predicts the response for sample + /// + /// + /// +#endif + public virtual Vec2d Predict2(InputArray sample, OutputArray probs = null) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (sample == null) + throw new ArgumentNullException("sample"); + sample.ThrowIfDisposed(); + if (probs != null) + probs.ThrowIfNotReady(); + + Vec2d ret = NativeMethods.ml_EM_predict2(ptr, sample.CvPtr, Cv2.ToPtr(probs)); + if (probs != null) + probs.Fix(); + GC.KeepAlive(sample); + return ret; + } + + #endregion + + #region Types + + /// + /// Type of covariation matrices + /// + public enum Types + { + /// + /// A scaled identity matrix \f$\mu_k * I\f$. + /// There is the only parameter \f$\mu_k\f$ to be estimated for each matrix. + /// The option may be used in special cases, when the constraint is relevant, + /// or as a first step in the optimization (for example in case when the data is + /// preprocessed with PCA). The results of such preliminary estimation may be + /// passed again to the optimization procedure, this time with covMatType=EM::COV_MAT_DIAGONAL. + /// + CovMatSpherical = 0, + + /// + /// A diagonal matrix with positive diagonal elements. + /// The number of free parameters is d for each matrix. + /// This is most commonly used option yielding good estimation results. + /// + CovMatDiagonal = 1, + + /// + /// A symmetric positively defined matrix. The number of free parameters in each + /// matrix is about \f$d^2/2\f$. It is not recommended to use this option, unless + /// there is pretty accurate initial estimation of the parameters and/or a huge number + /// of training samples. + /// + CovMatGeneric = 2, + + /// + /// + /// + CovMatDefault = CovMatSpherical, + } + +#if LANG_JP + /// + /// アルゴリズムをスタートする最初のステップ + /// +#else + /// + /// The initial step the algorithm starts from + /// +#endif + public enum StartStep : int + { +#if LANG_JP + /// + /// アルゴリズムはE-stepでスタートする. 少なくとも平均ベクトルの初期値 CvEMParams.Means が渡されなければならない. + /// オプションとして,ユーザは重み(CvEMParams.Weights)と/または共変動行列(CvEMParams.Covs)を与えることもできる. + /// [CvEM::START_E_STEP] + /// +#else + /// + /// The algorithm starts with E-step. + /// At least, the initial values of mean vectors, CvEMParams.Means must be passed. + /// Optionally, the user may also provide initial values for weights (CvEMParams.Weights) + /// and/or covariation matrices (CvEMParams.Covs). + /// [CvEM::START_E_STEP] + /// +#endif + E = 1, +#if LANG_JP + /// + /// アルゴリズムはM-stepでスタートする.初期確率 p_i,k が与えられなければならない. + /// [CvEM::START_M_STEP] + /// +#else + /// + /// The algorithm starts with M-step. The initial probabilities p_i,k must be provided. + /// [CvEM::START_M_STEP] + /// +#endif + M = 2, +#if LANG_JP + /// + /// ユーザから必要な値が指定されない場合,k-meansアルゴリズムが混合分布パラメータの初期値推定に用いられる. + /// [CvEM::START_AUTO_STEP] + /// +#else + /// + /// No values are required from the user, k-means algorithm is used to estimate initial mixtures parameters. + /// [CvEM::START_AUTO_STEP] + /// +#endif + Auto = 0, + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/ml/Enum/SampleTypes.cs b/src/OpenCvSharp/modules/ml/Enum/SampleTypes.cs new file mode 100644 index 000000000..fbe845f27 --- /dev/null +++ b/src/OpenCvSharp/modules/ml/Enum/SampleTypes.cs @@ -0,0 +1,19 @@ + +namespace OpenCvSharp.ML +{ + /// + /// Sample types + /// + public enum SampleTypes : int + { + /// + /// each training sample is a row of samples + /// + RowSample = 0, + + /// + /// each training sample occupies a column of samples + /// + ColSample = 1, + } +} diff --git a/src/OpenCvSharp/modules/ml/KNearest.cs b/src/OpenCvSharp/modules/ml/KNearest.cs new file mode 100644 index 000000000..7906ee79a --- /dev/null +++ b/src/OpenCvSharp/modules/ml/KNearest.cs @@ -0,0 +1,181 @@ +using System; + +namespace OpenCvSharp.ML +{ +#if LANG_JP + /// + /// K近傍法モデルクラス + /// +#else + /// + /// K nearest neighbors classifier + /// +#endif + public class KNearest : StatModel + { + /// + /// Track whether Dispose has been called + /// + private bool disposed; + private Ptr ptrObj; + + #region Init and Disposal + + /// + /// Creates instance by raw pointer cv::ml::KNearest* + /// + protected KNearest(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// Creates the empty model + /// + /// + public static KNearest Create() + { + IntPtr ptr = NativeMethods.ml_KNearest_create(); + return new KNearest(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + + /// + /// Default number of neighbors to use in predict method. + /// + public int DefaultK + { + get { return NativeMethods.ml_KNearest_getDefaultK(ptr); } + set { NativeMethods.ml_KNearest_setDefaultK(ptr, value); } + } + + /// + /// Whether classification or regression model should be trained. + /// + public new bool IsClassifier + { + get { return NativeMethods.ml_KNearest_getIsClassifier(ptr) != 0; } + set { NativeMethods.ml_KNearest_setIsClassifier(ptr, value ? 1 : 0); } + } + + /// + /// Parameter for KDTree implementation + /// + public int Emax + { + get { return NativeMethods.ml_KNearest_getEmax(ptr); } + set { NativeMethods.ml_KNearest_setEmax(ptr, value); } + } + + /// + /// Algorithm type, one of KNearest::Types. + /// + public Types AlgorithmType + { + get { return (Types)NativeMethods.ml_KNearest_getAlgorithmType(ptr); } + set { NativeMethods.ml_KNearest_setAlgorithmType(ptr, (int)value); } + } + + #endregion + + #region Methods + + /// + /// Finds the neighbors and predicts responses for input vectors. + /// + /// Input samples stored by rows. + /// It is a single-precision floating-point matrix of `[number_of_samples] * k` size. + /// Number of used nearest neighbors. Should be greater than 1. + /// Vector with results of prediction (regression or classification) for each + /// input sample. It is a single-precision floating-point vector with `[number_of_samples]` elements. + /// neighborResponses Optional output values for corresponding neighbors. + /// It is a single-precision floating-point matrix of `[number_of_samples] * k` size. + /// Optional output distances from the input vectors to the corresponding neighbors. + /// It is a single-precision floating-point matrix of `[number_of_samples] * k` size. + /// + public float FindNearest(InputArray samples, int k, OutputArray results, + OutputArray neighborResponses = null, OutputArray dist = null) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (samples == null) + throw new ArgumentNullException("samples"); + if (results == null) + throw new ArgumentNullException("results"); + samples.ThrowIfDisposed(); + results.ThrowIfNotReady(); + + float ret = NativeMethods.ml_KNearest_findNearest( + samples.CvPtr, k, results.CvPtr, Cv2.ToPtr(neighborResponses), Cv2.ToPtr(dist)); + + GC.KeepAlive(samples); + results.Fix(); + if (neighborResponses != null) + neighborResponses.Fix(); + if (dist != null) + dist.Fix(); + return ret; + } + + #endregion + + #region Types + + /// + /// Implementations of KNearest algorithm + /// + public enum Types + { +#pragma warning disable 1591 + BruteForce = 1, + KdTree = 2 +#pragma warning restore 1591 + }; + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/ml/LogisticRegression.cs b/src/OpenCvSharp/modules/ml/LogisticRegression.cs new file mode 100644 index 000000000..d36965fb4 --- /dev/null +++ b/src/OpenCvSharp/modules/ml/LogisticRegression.cs @@ -0,0 +1,217 @@ +using System; + +namespace OpenCvSharp.ML +{ + /// + /// Implements Logistic Regression classifier. + /// + public class LogisticRegression : StatModel + { + /// + /// Track whether Dispose has been called + /// + private bool disposed; + private Ptr ptrObj; + + #region Init and Disposal + + /// + /// Creates instance by raw pointer cv::ml::LogisticRegression* + /// + protected LogisticRegression(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// Creates the empty model. + /// + /// + public static LogisticRegression Create() + { + IntPtr ptr = NativeMethods.ml_LogisticRegression_create(); + return new LogisticRegression(ptr); + } + + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + + /// + /// Learning rate + /// + public double LearningRate + { + get { return NativeMethods.ml_LogisticRegression_getLearningRate(ptr); } + set { NativeMethods.ml_LogisticRegression_setLearningRate(ptr, value); } + } + + /// + /// Number of iterations. + /// + public int Iterations + { + get { return NativeMethods.ml_LogisticRegression_getIterations(ptr); } + set { NativeMethods.ml_LogisticRegression_setIterations(ptr, value); } + } + + /// + /// Kind of regularization to be applied. See LogisticRegression::RegKinds. + /// + public RegKinds Regularization + { + get { return (RegKinds)NativeMethods.ml_LogisticRegression_getRegularization(ptr); } + set { NativeMethods.ml_LogisticRegression_setRegularization(ptr, (int)value); } + } + + /// + /// Kind of training method used. See LogisticRegression::Methods. + /// + public Methods TrainMethod + { + get { return (Methods)NativeMethods.ml_LogisticRegression_getTrainMethod(ptr); } + set { NativeMethods.ml_LogisticRegression_setTrainMethod(ptr, (int)value); } + } + + /// + /// Specifies the number of training samples taken in each step of Mini-Batch Gradient. + /// Descent. Will only be used if using LogisticRegression::MINI_BATCH training algorithm. + /// It has to take values less than the total number of training samples. + /// + public int MiniBatchSize + { + get { return NativeMethods.ml_LogisticRegression_getMiniBatchSize(ptr); } + set { NativeMethods.ml_LogisticRegression_setMiniBatchSize(ptr, value); } + } + + /// + /// Termination criteria of the training algorithm. + /// + public TermCriteria TermCriteria + { + get { return NativeMethods.ml_LogisticRegression_getTermCriteria(ptr); } + set { NativeMethods.ml_LogisticRegression_setTermCriteria(ptr, value); } + } + + #endregion + + #region Methods + + /// + /// Predicts responses for input samples and returns a float type. + /// + /// The input data for the prediction algorithm. Matrix [m x n], + /// where each row contains variables (features) of one object being classified. + /// Should have data type CV_32F. + /// Predicted labels as a column matrix of type CV_32S. + /// Not used. + /// + public float Predict(InputArray samples, OutputArray results = null, int flags = 0) + { + if (disposed) + throw new NotImplementedException(GetType().Name); + if (samples == null) + throw new ArgumentNullException("samples"); + samples.ThrowIfDisposed(); + if (results != null) + results.ThrowIfNotReady(); + + float ret = NativeMethods.ml_LogisticRegression_predict(ptr, samples.CvPtr, Cv2.ToPtr(results), flags); + + GC.KeepAlive(samples); + if (results != null) + results.Fix(); + + return ret; + } + + /// + /// This function returns the trained paramters arranged across rows. + /// For a two class classifcation problem, it returns a row matrix. + /// It returns learnt paramters of the Logistic Regression as a matrix of type CV_32F. + /// + /// + public Mat GetLearntThetas() + { + if (disposed) + throw new NotImplementedException(GetType().Name); + + IntPtr p = NativeMethods.ml_LogisticRegression_get_learnt_thetas(ptr); + return new Mat(p); + } + + #endregion + + #region Types + + /// + /// Regularization kinds + /// + public enum RegKinds + { + /// + /// Regularization disabled + /// + RegDisable = -1, + + /// + /// L1 norm + /// + RegL1 = 0, + + /// + /// L2 norm + /// + RegL2 = 1 + } + + /// + /// Training methods + /// + public enum Methods + { + /// + /// + /// + Batch = 0, + + /// + /// Set MiniBatchSize to a positive integer when using this method. + /// + MiniBatch = 1 + } + + #endregion + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/ml/NormalBayesClassifier.cs b/src/OpenCvSharp/modules/ml/NormalBayesClassifier.cs new file mode 100644 index 000000000..b4651a67d --- /dev/null +++ b/src/OpenCvSharp/modules/ml/NormalBayesClassifier.cs @@ -0,0 +1,131 @@ +using System; + +namespace OpenCvSharp.ML +{ +#if LANG_JP + /// + /// 正規分布データに対するベイズ分類器クラス + /// +#else + /// + /// Bayes classifier for normally distributed data + /// +#endif + public class NormalBayesClassifier : StatModel + { + /// + /// Track whether Dispose has been called + /// + private bool disposed; + private Ptr ptrObj; + + #region Init and Disposal + + /// + /// Creates instance by raw pointer cv::ml::NormalBayesClassifier* + /// + protected NormalBayesClassifier(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// Creates empty model. + /// Use StatModel::train to train the model after creation. + /// + /// + public static NormalBayesClassifier Create() + { + IntPtr ptr = NativeMethods.ml_NormalBayesClassifier_create(); + return new NormalBayesClassifier(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + #endregion + + #region Methods + + /// + /// Predicts the response for sample(s). + /// + /// + /// + /// + /// + /// + /// + /// The method estimates the most probable classes for input vectors. Input vectors (one or more) + /// are stored as rows of the matrix inputs. In case of multiple input vectors, there should be one + /// output vector outputs. The predicted class for a single input vector is returned by the method. + /// The vector outputProbs contains the output probabilities corresponding to each element of result. + /// + public float PredictProb(InputArray inputs, OutputArray outputs, + OutputArray outputProbs, int flags = 0) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (inputs == null) + throw new ArgumentNullException("inputs"); + if (outputs == null) + throw new ArgumentNullException("outputs"); + if (outputProbs == null) + throw new ArgumentNullException("outputProbs"); + + inputs.ThrowIfDisposed(); + outputs.ThrowIfNotReady(); + outputProbs.ThrowIfNotReady(); + + float result = NativeMethods.ml_NormalBayesClassifier_predictProb( + ptr, inputs.CvPtr, outputs.CvPtr, outputProbs.CvPtr, flags); + outputs.Fix(); + outputProbs.Fix(); + GC.KeepAlive(inputs); + return result; + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/ml/ParamGrid.cs b/src/OpenCvSharp/modules/ml/ParamGrid.cs new file mode 100644 index 000000000..1aed57ccb --- /dev/null +++ b/src/OpenCvSharp/modules/ml/ParamGrid.cs @@ -0,0 +1,45 @@ +using System; + +namespace OpenCvSharp.ML +{ + /// + /// The structure represents the logarithmic grid range of statmodel parameters. + /// + public struct ParamGrid + { + /// + /// Minimum value of the statmodel parameter. Default value is 0. + /// + public double MinVal; + + /// + /// Maximum value of the statmodel parameter. Default value is 0. + /// + public double MaxVal; + + /// + /// Logarithmic step for iterating the statmodel parameter. + /// + /// + /// The grid determines the following iteration sequence of the statmodel parameter values: + /// \f[(minVal, minVal*step, minVal*{step}^2, \dots, minVal*{logStep}^n),\f] + /// where \f$n\f$ is the maximal index satisfying + /// \f[\texttt{minVal} * \texttt{logStep} ^n < \texttt{maxVal}\f] + /// The grid is logarithmic, so logStep must always be greater then 1. Default value is 1. + /// + public double LogStep; + + /// + /// Constructor with parameters + /// + /// + /// + /// + public ParamGrid(double minVal, double maxVal, double logStep) + { + MinVal = minVal; + MaxVal = maxVal; + LogStep = logStep; + } + } +} diff --git a/src/OpenCvSharp/modules/ml/RTrees.cs b/src/OpenCvSharp/modules/ml/RTrees.cs new file mode 100644 index 000000000..b8bd50560 --- /dev/null +++ b/src/OpenCvSharp/modules/ml/RTrees.cs @@ -0,0 +1,140 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp.ML +{ +#if LANG_JP + /// + /// ランダムツリークラス + /// +#else + /// + /// The class implements the random forest predictor. + /// +#endif + public class RTrees : DTrees + { + /// + /// Track whether Dispose has been called + /// + private bool disposed; + private Ptr ptrObj; + + #region Init and Disposal + + /// + /// Creates instance by raw pointer cv::ml::RTrees* + /// + protected RTrees(IntPtr p) + : base() + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// Creates the empty model. + /// + /// + public static new RTrees Create() + { + IntPtr ptr = NativeMethods.ml_RTrees_create(); + return new RTrees(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + + /// + /// If true then variable importance will be calculated and then + /// it can be retrieved by RTrees::getVarImportance. Default value is false. + /// + public bool CalculateVarImportance + { + get { return NativeMethods.ml_RTrees_getCalculateVarImportance(ptr) != 0; } + set { NativeMethods.ml_RTrees_setCalculateVarImportance(ptr, value ? 1 : 0); } + } + + /// + /// The size of the randomly selected subset of features at each tree node + /// and that are used to find the best split(s). + /// + public bool ActiveVarCount + { + get { return NativeMethods.ml_RTrees_getActiveVarCount(ptr) != 0; } + set { NativeMethods.ml_RTrees_setActiveVarCount(ptr, value ? 1 : 0); } + } + + /// + /// The termination criteria that specifies when the training algorithm stops. + /// + public TermCriteria TermCriteria + { + get { return NativeMethods.ml_RTrees_getTermCriteria(ptr); } + set { NativeMethods.ml_RTrees_setTermCriteria(ptr, value); } + } + + #endregion + + #region Methods + + /// + /// Returns the variable importance array. + /// The method returns the variable importance vector, computed at the training + /// stage when CalculateVarImportance is set to true. If this flag was set to false, + /// the empty matrix is returned. + /// + /// + public Mat GetVarImportance() + { + if (disposed) + throw new NotImplementedException(GetType().Name); + + IntPtr p = NativeMethods.ml_RTrees_getVarImportance(ptr); + return new Mat(p); + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/ml/SVM.cs b/src/OpenCvSharp/modules/ml/SVM.cs new file mode 100644 index 000000000..5ef13ac0d --- /dev/null +++ b/src/OpenCvSharp/modules/ml/SVM.cs @@ -0,0 +1,432 @@ +using System; + +namespace OpenCvSharp.ML +{ + // ReSharper disable InconsistentNaming + +#if LANG_JP + /// + /// SVM model classifier + /// +#else + /// + /// Support Vector Machines + /// +#endif + + public class SVM : StatModel + { + /// + /// Track whether Dispose has been called + /// + private bool disposed; + private Ptr ptrObj; + + #region Init and Disposal + + /// + /// Creates instance by raw pointer cv::ml::SVM* + /// + protected SVM(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// Creates empty model. + /// Use StatModel::Train to train the model. + /// Since %SVM has several parameters, you may want to find the best + /// parameters for your problem, it can be done with SVM::TrainAuto. + /// + /// + public static SVM Create() + { + IntPtr ptr = NativeMethods.ml_SVM_create(); + return new SVM(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + + /// + /// Type of a %SVM formulation. + /// Default value is SVM::C_SVC. + /// + public Types Type + { + get { return (Types) NativeMethods.ml_SVM_getType(ptr); } + set { NativeMethods.ml_SVM_setType(ptr, (int) value); } + } + + /// + /// Parameter gamma of a kernel function. + /// For SVM::POLY, SVM::RBF, SVM::SIGMOID or SVM::CHI2. Default value is 1. + /// + public double Gamma + { + get { return NativeMethods.ml_SVM_getGamma(ptr); } + set { NativeMethods.ml_SVM_setGamma(ptr, value); } + } + + /// + /// Parameter coef0 of a kernel function. + /// For SVM::POLY or SVM::SIGMOID. Default value is 0. + /// + public double Coef0 + { + get { return NativeMethods.ml_SVM_getCoef0(ptr); } + set { NativeMethods.ml_SVM_setCoef0(ptr, value); } + } + + /// + /// Parameter degree of a kernel function. + /// For SVM::POLY. Default value is 0. + /// + public double Degree + { + get { return NativeMethods.ml_SVM_getDegree(ptr); } + set { NativeMethods.ml_SVM_setDegree(ptr, value); } + } + + /// + /// Parameter C of a %SVM optimization problem. + /// For SVM::C_SVC, SVM::EPS_SVR or SVM::NU_SVR. Default value is 0. + /// + public double C + { + get { return NativeMethods.ml_SVM_getC(ptr); } + set { NativeMethods.ml_SVM_setC(ptr, value); } + } + + /// + /// Parameter nu of a %SVM optimization problem. + /// For SVM::NU_SVC, SVM::ONE_CLASS or SVM::NU_SVR. Default value is 0. + /// + public double Nu + { + get { return NativeMethods.ml_SVM_getNu(ptr); } + set { NativeMethods.ml_SVM_setNu(ptr, value); } + } + + /// + /// Parameter epsilon of a %SVM optimization problem. + /// For SVM::EPS_SVR. Default value is 0. + /// + public double P + { + get { return NativeMethods.ml_SVM_getP(ptr); } + set { NativeMethods.ml_SVM_setP(ptr, value); } + } + + /// + /// Optional weights in the SVM::C_SVC problem, assigned to particular classes. + /// + /// + /// They are multiplied by _C_ so the parameter _C_ of class _i_ becomes `classWeights(i) * C`. + /// Thus these weights affect the misclassification penalty for different classes. + /// The larger weight, the larger penalty on misclassification of data from the + /// corresponding class. Default value is empty Mat. + /// + public Mat ClassWeights + { + get + { + IntPtr p = NativeMethods.ml_SVM_getClassWeights(ptr); + return new Mat(p); + } + set + { + NativeMethods.ml_SVM_setClassWeights(ptr, value.CvPtr); + } + } + + /// + /// Termination criteria of the iterative SVM training procedure + /// which solves a partial case of constrained quadratic optimization problem. + /// + /// + /// You can specify tolerance and/or the maximum number of iterations. + /// Default value is `TermCriteria( TermCriteria::MAX_ITER + TermCriteria::EPS, 1000, FLT_EPSILON )`; + /// + public TermCriteria TermCriteria + { + get { return NativeMethods.ml_SVM_getTermCriteria(ptr); } + set { NativeMethods.ml_SVM_setTermCriteria(ptr, value); } + } + + /// + /// Type of a %SVM kernel. See SVM::KernelTypes. Default value is SVM::RBF. + /// + public KernelTypes KernelType + { + get { return (KernelTypes)NativeMethods.ml_SVM_getKernelType(ptr); } + set { NativeMethods.ml_SVM_setKernel(ptr, (int)value); } + } + + #endregion + + #region Methods + + /// + /// Initialize with custom kernel. + /// + /// + public void SetCustomKernel(Kernel kernel) + { + throw new NotImplementedException(); + } + + /// + /// Trains an %SVM with optimal parameters. + /// + /// the training data that can be constructed using + /// TrainData::create or TrainData::loadFromCSV. + /// Cross-validation parameter. The training set is divided into kFold subsets. + /// One subset is used to test the model, the others form the train set. So, the %SVM algorithm is + /// executed kFold times. + /// grid for C + /// grid for gamma + /// grid for p + /// grid for nu + /// grid for coeff + /// grid for degree + /// If true and the problem is 2-class classification then the method creates + /// more balanced cross-validation subsets that is proportions between classes in subsets are close + /// to such proportion in the whole train dataset. + /// + public bool TrainAuto(TrainData data, int kFold = 10, + ParamGrid? cGrid = null, + ParamGrid? gammaGrid = null, + ParamGrid? pGrid = null, + ParamGrid? nuGrid = null, + ParamGrid? coeffGrid = null, + ParamGrid? degreeGrid = null, + bool balanced = false) + { + throw new NotImplementedException(); + /* + var cGridValue = cGrid.GetValueOrDefault(GetDefaultGrid(ParamTypes.C)); + var gammaGridValue = gammaGrid.GetValueOrDefault(GetDefaultGrid(ParamTypes.Gamma)); + var pGridValue = pGrid.GetValueOrDefault(GetDefaultGrid(ParamTypes.P)); + var nuGridValue = nuGrid.GetValueOrDefault(GetDefaultGrid(ParamTypes.Nu)); + var coeffGridValue = coeffGrid.GetValueOrDefault(GetDefaultGrid(ParamTypes.Coef)); + var degreeGridValue = degreeGrid.GetValueOrDefault(GetDefaultGrid(ParamTypes.Degree));*/ + } + + /// + /// Retrieves all the support vectors + /// + /// + public Mat GetSupportVectors() + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + IntPtr p = NativeMethods.ml_SVM_getSupportVectors(ptr); + return new Mat(p); + } + + /// + /// Retrieves the decision function + /// + /// i the index of the decision function. + /// If the problem solved is regression, 1-class or 2-class classification, then + /// there will be just one decision function and the index should always be 0. + /// Otherwise, in the case of N-class classification, there will be N(N-1)/2 decision functions. + /// alpha the optional output vector for weights, corresponding to + /// different support vectors. In the case of linear %SVM all the alpha's will be 1's. + /// the optional output vector of indices of support vectors + /// within the matrix of support vectors (which can be retrieved by SVM::getSupportVectors). + /// In the case of linear %SVM each decision function consists of a single "compressed" support vector. + /// + public double GetDecisionFunction(int i, OutputArray alpha, OutputArray svidx) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (alpha == null) + throw new ArgumentNullException("alpha"); + if (svidx == null) + throw new ArgumentNullException("svidx"); + + alpha.ThrowIfNotReady(); + svidx.ThrowIfNotReady(); + double ret = NativeMethods.ml_SVM_getDecisionFunction(ptr, i, alpha.CvPtr, svidx.CvPtr); + alpha.Fix(); + svidx.Fix(); + return ret; + } + + /// + /// Generates a grid for SVM parameters. + /// + /// SVM parameters IDs that must be one of the SVM::ParamTypes. + /// The grid is generated for the parameter with this ID. + /// + public static ParamGrid GetDefaultGrid(ParamTypes paramId) + { + return NativeMethods.ml_SVM_getDefaultGrid((int)paramId); + } + + #endregion + + #region Types + + /// + /// + /// + public class Kernel + { + /// + /// + /// + public Kernel() + { + throw new NotImplementedException(); + } + } + + /// + /// SVM type + /// + public enum Types + { + /// + /// C-Support Vector Classification. n-class classification (n \f$\geq\f$ 2), + /// allows imperfect separation of classes with penalty multiplier C for outliers. + /// + CSvc = 100, + + /// + /// nu-Support Vector Classification. n-class classification with possible + /// imperfect separation. Parameter \f$\nu\f$ (in the range 0..1, the larger + /// the value, the smoother the decision boundary) is used instead of C. + /// + NuSvc = 101, + + /// + /// Distribution Estimation (One-class %SVM). All the training data are from + /// the same class, %SVM builds a boundary that separates the class from the + /// rest of the feature space. + /// + OneClass = 102, + + /// + /// epsilon-Support Vector Regression. + /// The distance between feature vectors from the training set and the fitting + /// hyper-plane must be less than p. For outliers the penalty multiplier C is used. + /// + EpsSvr = 103, + + /// + /// nu-Support Vector Regression. \f$\nu\f$ is used instead of p. + /// See @cite LibSVM for details. + /// + NuSvr = 104 + } + + /// + /// SVM kernel type + /// + public enum KernelTypes + { + /// + /// Returned by SVM::getKernelType in case when custom kernel has been set + /// + Custom = -1, + + /// + /// Linear kernel. No mapping is done, linear discrimination (or regression) is + /// done in the original feature space. It is the fastest option. \f$K(x_i, x_j) = x_i^T x_j\f$. + /// + Linear = 0, + + /// + /// Polynomial kernel: + /// \f$K(x_i, x_j) = (\gamma x_i^T x_j + coef0)^{degree}, \gamma > 0\f$. + /// + Poly = 1, + + /// + /// Radial basis function (RBF), a good choice in most cases. + /// \f$K(x_i, x_j) = e^{-\gamma ||x_i - x_j||^2}, \gamma > 0\f$. + /// + Rbf = 2, + + /// + /// Sigmoid kernel: + /// \f$K(x_i, x_j) = \tanh(\gamma x_i^T x_j + coef0)\f$. + /// + Sigmoid = 3, + + /// + /// Exponential Chi2 kernel, similar to the RBF kernel: + /// \f$K(x_i, x_j) = e^{-\gamma \chi^2(x_i,x_j)}, \chi^2(x_i,x_j) = (x_i-x_j)^2/(x_i+x_j), \gamma > 0\f$. + /// + Chi2 = 4, + + /// + /// Histogram intersection kernel. + /// A fast kernel. \f$K(x_i, x_j) = min(x_i,x_j)\f$. + /// + Inter = 5 + } + + /// + /// SVM params type + /// + public enum ParamTypes + { +#pragma warning disable 1591 + C = 0, + Gamma = 1, + P = 2, + Nu = 3, + Coef = 4, + Degree = 5 +#pragma warning restore 1591 + }; + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/ml/StatModel.cs b/src/OpenCvSharp/modules/ml/StatModel.cs new file mode 100644 index 000000000..84ce187af --- /dev/null +++ b/src/OpenCvSharp/modules/ml/StatModel.cs @@ -0,0 +1,182 @@ +using System; + +namespace OpenCvSharp.ML +{ +#if LANG_JP + /// + /// ML 統計モデルのための基本クラス + /// +#else + /// + /// Base class for statistical models in ML + /// +#endif + public abstract class StatModel : Algorithm + { + #region Init and Disposal + +#if LANG_JP + /// + /// 初期化 + /// +#else + /// + /// Default constructor + /// +#endif + protected StatModel() + { + } + + #endregion + + #region Methods + + /// + /// Returns the number of variables in training samples + /// + /// + public virtual int GetVarCount() + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.ml_StatModel_getVarCount(ptr); + } + + /// + /// + /// + /// + public virtual new bool Empty() + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.ml_StatModel_empty(ptr) != 0; + } + + /// + /// Returns true if the model is trained + /// + /// + public virtual bool IsTrained() + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.ml_StatModel_isTrained(ptr) != 0; + } + + /// + /// Returns true if the model is classifier + /// + /// + public virtual bool IsClassifier() + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.ml_StatModel_isClassifier(ptr) != 0; + } + + /// + /// Trains the statistical model + /// + /// training data that can be loaded from file using TrainData::loadFromCSV + /// or created with TrainData::create. + /// optional flags, depending on the model. Some of the models can be updated with the + /// new training samples, not completely overwritten (such as NormalBayesClassifier or ANN_MLP). + /// + public virtual bool Train(TrainData trainData, int flags = 0) + { + throw new NotImplementedException(); + } + + /// + /// Trains the statistical model + /// + /// training samples + /// SampleTypes value + /// vector of responses associated with the training samples. + /// + public virtual bool Train(InputArray samples, SampleTypes layout, InputArray responses) + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + if (samples == null) + throw new ArgumentNullException("samples"); + if (responses == null) + throw new ArgumentNullException("responses"); + samples.ThrowIfDisposed(); + responses.ThrowIfDisposed(); + + int ret = NativeMethods.ml_StatModel_train2(ptr, samples.CvPtr, (int)layout, responses.CvPtr); + GC.KeepAlive(samples); + GC.KeepAlive(responses); + return ret != 0; + } + + /// + /// Computes error on the training or test dataset + /// + /// the training data + /// if true, the error is computed over the test subset of the data, + /// otherwise it's computed over the training subset of the data. Please note that if you + /// loaded a completely different dataset to evaluate already trained classifier, you will + /// probably want not to set the test subset at all with TrainData::setTrainTestSplitRatio + /// and specify test=false, so that the error is computed for the whole new set. Yes, this + /// sounds a bit confusing. + /// the optional output responses. + /// + public virtual float CalcError(TrainData data, bool test, OutputArray resp) + { + throw new NotImplementedException(); + } + + /// + /// Predicts response(s) for the provided sample(s) + /// + /// The input samples, floating-point matrix + /// The optional output matrix of results. + /// The optional flags, model-dependent. + /// + public virtual float Predict(InputArray samples, OutputArray results = null, Flags flags = 0) + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + if (samples == null) + throw new ArgumentNullException("samples"); + samples.ThrowIfDisposed(); + if (results!=null) + results.ThrowIfNotReady(); + + float ret = NativeMethods.ml_StatModel_predict( + ptr, samples.CvPtr, Cv2.ToPtr(results), (int)flags); + + GC.KeepAlive(samples); + if (results != null) + results.Fix(); + return ret; + } + + #endregion + + #region Types + + /// + /// Predict options + /// + [FlagsAttribute] + public enum Flags + { +#pragma warning disable 1591 + UpdateModel = 1, + /// + /// makes the method return the raw results (the sum), not the class label + /// + RawOutput = 1, + CompressedInput = 2, + PreprocessedInput = 4 +#pragma warning restore 1591 + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/ml/TrainData.cs b/src/OpenCvSharp/modules/ml/TrainData.cs new file mode 100644 index 000000000..4d982a4dd --- /dev/null +++ b/src/OpenCvSharp/modules/ml/TrainData.cs @@ -0,0 +1,18 @@ +using System; + +namespace OpenCvSharp.ML +{ + /// + /// + /// + public class TrainData + { + /// + /// + /// + public TrainData() + { + throw new NotImplementedException(); + } + } +} diff --git a/src/OpenCvSharp/modules/objdetect/CascadeClassifier.cs b/src/OpenCvSharp/modules/objdetect/CascadeClassifier.cs new file mode 100644 index 000000000..195d64777 --- /dev/null +++ b/src/OpenCvSharp/modules/objdetect/CascadeClassifier.cs @@ -0,0 +1,236 @@ + +using System; +using System.IO; + +// ReSharper disable InconsistentNaming + +namespace OpenCvSharp +{ + /// + /// Cascade classifier class for object detection. + /// + public class CascadeClassifier : DisposableCvObject + { + /// + /// Track whether Dispose has been called + /// + private bool disposed; + + #region Init and Disposal + + /// + /// Default constructor + /// + public CascadeClassifier() + { + ptr = NativeMethods.objdetect_CascadeClassifier_new(); + } + + /// + /// Loads a classifier from a file. + /// + /// Name of the file from which the classifier is loaded. + public CascadeClassifier(string fileName) + { + if (String.IsNullOrEmpty(fileName)) + throw new ArgumentNullException("fileName"); + if (!File.Exists(fileName)) + throw new FileNotFoundException("\""+ fileName + "\"not found", fileName); + ptr = NativeMethods.objdetect_CascadeClassifier_newFromFile(fileName); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + NativeMethods.objdetect_CascadeClassifier_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Methods + + /// + /// Checks whether the classifier has been loaded. + /// + /// + public virtual bool Empty() + { + if (disposed) + throw new ObjectDisposedException("CascadeClassifier"); + return NativeMethods.objdetect_CascadeClassifier_empty(ptr) != 0; + } + + /// + /// Loads a classifier from a file. + /// + /// Name of the file from which the classifier is loaded. + /// The file may contain an old HAAR classifier trained by the haartraining application + /// or a new cascade classifier trained by the traincascade application. + /// + public bool Load(string fileName) + { + if (disposed) + throw new ObjectDisposedException("CascadeClassifier"); + if (String.IsNullOrEmpty(fileName)) + throw new ArgumentNullException("fileName"); + if (!File.Exists(fileName)) + throw new FileNotFoundException("\"" + fileName + "\"not found", fileName); + return NativeMethods.objdetect_CascadeClassifier_load(ptr, fileName) != 0; + } + + //public virtual bool read( const FileNode& node ); + + /// + /// Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles. + /// + /// Matrix of the type CV_8U containing an image where objects are detected. + /// Parameter specifying how much the image size is reduced at each image scale. + /// Parameter specifying how many neighbors each candidate rectangle should have to retain it. + /// Parameter with the same meaning for an old cascade as in the function cvHaarDetectObjects. + /// It is not used for a new cascade. + /// Minimum possible object size. Objects smaller than that are ignored. + /// Maximum possible object size. Objects larger than that are ignored. + /// Vector of rectangles where each rectangle contains the detected object. + public virtual Rect[] DetectMultiScale( + Mat image, + double scaleFactor = 1.1, + int minNeighbors = 3, + HaarDetectionType flags = 0, + Size? minSize = null, + Size? maxSize = null) + { + if (disposed) + throw new ObjectDisposedException("CascadeClassifier"); + if (image == null) + throw new ArgumentNullException("image"); + image.ThrowIfDisposed(); + + Size minSize0 = minSize.GetValueOrDefault(new Size()); + Size maxSize0 = maxSize.GetValueOrDefault(new Size()); + + using (var objectsVec = new VectorOfRect()) + { + NativeMethods.objdetect_CascadeClassifier_detectMultiScale1( + ptr, image.CvPtr, objectsVec.CvPtr, + scaleFactor, minNeighbors, (int)flags, minSize0, maxSize0); + return objectsVec.ToArray(); + } + } + + /// + /// Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles. + /// + /// Matrix of the type CV_8U containing an image where objects are detected. + /// + /// + /// Parameter specifying how much the image size is reduced at each image scale. + /// Parameter specifying how many neighbors each candidate rectangle should have to retain it. + /// Parameter with the same meaning for an old cascade as in the function cvHaarDetectObjects. + /// It is not used for a new cascade. + /// Minimum possible object size. Objects smaller than that are ignored. + /// Maximum possible object size. Objects larger than that are ignored. + /// + /// Vector of rectangles where each rectangle contains the detected object. + public virtual Rect[] DetectMultiScale( + Mat image, + out int[] rejectLevels, + out double[] levelWeights, + double scaleFactor = 1.1, + int minNeighbors = 3, + HaarDetectionType flags = 0, + Size? minSize = null, + Size? maxSize = null, + bool outputRejectLevels = false) + { + if (disposed) + throw new ObjectDisposedException("CascadeClassifier"); + if (image == null) + throw new ArgumentNullException("image"); + image.ThrowIfDisposed(); + + Size minSize0 = minSize.GetValueOrDefault(new Size()); + Size maxSize0 = maxSize.GetValueOrDefault(new Size()); + + using (var objectsVec = new VectorOfRect()) + using (var rejectLevelsVec = new VectorOfInt32()) + using (var levelWeightsVec = new VectorOfDouble()) + { + NativeMethods.objdetect_CascadeClassifier_detectMultiScale2( + ptr, image.CvPtr, objectsVec.CvPtr, rejectLevelsVec.CvPtr, levelWeightsVec.CvPtr, + scaleFactor, minNeighbors, (int)flags, minSize0, maxSize0, outputRejectLevels ? 1 : 0); + + rejectLevels = rejectLevelsVec.ToArray(); + levelWeights = levelWeightsVec.ToArray(); + return objectsVec.ToArray(); + } + } + + /// + /// + /// + /// + public bool IsOldFormatCascade() + { + if (disposed) + throw new ObjectDisposedException("CascadeClassifier"); + return NativeMethods.objdetect_CascadeClassifier_isOldFormatCascade(ptr) != 0; + } + + /// + /// + /// + /// + public virtual Size GetOriginalWindowSize() + { + if (disposed) + throw new ObjectDisposedException("CascadeClassifier"); + return NativeMethods.objdetect_CascadeClassifier_getOriginalWindowSize(ptr); + } + + /// + /// + /// + /// + public int GetFeatureType() + { + if (disposed) + throw new ObjectDisposedException("CascadeClassifier"); + return NativeMethods.objdetect_CascadeClassifier_getFeatureType(ptr); + } + + #endregion + } + +} diff --git a/src/OpenCvSharp/modules/objdetect/Enum/HaarDetectionType.cs b/src/OpenCvSharp/modules/objdetect/Enum/HaarDetectionType.cs new file mode 100644 index 000000000..9d5c0a7e1 --- /dev/null +++ b/src/OpenCvSharp/modules/objdetect/Enum/HaarDetectionType.cs @@ -0,0 +1,85 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cvHaarDetectObjectsの処理モード + /// +#else + /// + /// Modes of operation for cvHaarDetectObjects + /// +#endif + [Flags] + public enum HaarDetectionType : int + { +#if LANG_JP + /// + /// これがセットされると,関数は Canny エッジ検出器を 非常に多くのエッジを含む(あるいは非常に少ないエッジしか含まない) 画像領域を, + /// 探索オブジェクトを含まない領域と見なして棄却する. 顔検出用には特別な閾値が調整されており,この場合,枝刈りにより処理が 高速化される. + /// [CV_HAAR_DO_CANNY_PRUNING] + /// +#else + /// + /// If it is set, the function uses Canny edge detector to reject some image regions that contain too few or too much edges and thus can not contain the searched object. + /// The particular threshold values are tuned for face detection and in this case the pruning speeds up the processing. + /// [CV_HAAR_DO_CANNY_PRUNING] + /// +#endif + DoCannyPruning = 1, + + +#if LANG_JP + /// + /// スケーリングされる度に,関数は, 分類カスケード中の特徴の座標系を 「拡大」するのではなく,逆に画像を縮小する. + /// 現在は,単体でのみ用いることができるオプションである. つまり,このフラグは他のものと併用はできない. + /// [CV_HAAR_SCALE_IMAGE] + /// +#else + /// + /// For each scale factor used the function will downscale the image rather than "zoom" the feature coordinates in the classifier cascade. + /// Currently, the option can only be used alone, i.e. the flag can not be set together with the others. + /// [CV_HAAR_SCALE_IMAGE] + /// +#endif + ScaleImage = 2, + + +#if LANG_JP + /// + /// これがセットされると,関数は,(もし存在すれば)画像中の最大のオブジェクトを検出する. つまり,出力シーケンスは一つ(あるいは 0)のエレメントを持つ. + /// [CV_HAAR_FIND_BIGGEST_OBJECT] + /// +#else + /// + /// If it is set, the function finds the largest object (if any) in the image. That is, the output sequence will contain one (or zero) element(s). + /// [CV_HAAR_FIND_BIGGEST_OBJECT] + /// +#endif + FindBiggestObject = 4, + + +#if LANG_JP + /// + /// FindBiggestObject がセットされており,min_neighbors > 0 である場合にのみ利用されるべきである. + /// このフラグがセットされると,関数は,現在のスケールにおいて, オブジェクトが検出(かつ,その近傍に充分に候補が検出)された後に, + /// それより小さいサイズの候補を探索しなくなる. min_neighbors が固定されていると, 大抵の場合,このモードは通常のシングルオブジェクトモード + /// (flags=FindBiggestObject)よりも不正確な(少しだけ大きい)オブジェクト矩形を返す. しかし,このモードはずっと高速であり,最大で10倍程度の速度差になる. + /// 正確さを増すために,min_neighbors に大き な値を指定することができる. + /// [CV_HAAR_DO_ROUGH_SEARCH] + /// +#else + /// + /// It should be used only when FindBiggestObject is set and min_neighbors > 0. + /// If the flag is set, the function does not look for candidates of a smaller size + /// as soon as it has found the object (with enough neighbor candidates) at the current scale. + /// Typically, when min_neighbors is fixed, the mode yields less accurate (a bit larger) object rectangle + /// than the regular single-object mode (flags=FindBiggestObject), + /// but it is much faster, up to an order of magnitude. A greater value of min_neighbors may be specified to improve the accuracy. + /// [CV_HAAR_DO_ROUGH_SEARCH] + /// +#endif + DoRoughSearch = 8, + } +} diff --git a/src/OpenCvSharp/modules/objdetect/HOGDescriptor.cs b/src/OpenCvSharp/modules/objdetect/HOGDescriptor.cs new file mode 100644 index 000000000..8f73d6dc8 --- /dev/null +++ b/src/OpenCvSharp/modules/objdetect/HOGDescriptor.cs @@ -0,0 +1,2031 @@ +using System; + +// ReSharper disable InconsistentNaming + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// HOG (Histogram-of-Oriented-Gradients) Descriptor and Object Detector + /// +#else + /// + /// HOG (Histogram-of-Oriented-Gradients) Descriptor and Object Detector + /// +#endif + public class HOGDescriptor : DisposableCvObject + { + #region Fields + /// + /// + /// + public const int L2Hys = 0; + /// + /// + /// + public const int DefaultNlevels = 64; + /// + /// sizeof(HOGDescriptor) + /// + public static readonly int SizeOf = NativeMethods.objdetect_HOGDescriptor_sizeof(); + /// + /// Track whether Dispose has been called + /// + private bool disposed; + + #region DefaultPeopleDetector + + /// + /// Returns coefficients of the classifier trained for people detection (for default window size). + /// + public static readonly float[] DefaultPeopleDetector = + { + 0.05359386f, -0.14721455f, -0.05532170f, 0.05077307f, + 0.11547081f, -0.04268804f, 0.04635834f, -0.05468199f, 0.08232084f, + 0.10424068f, -0.02294518f, 0.01108519f, 0.01378693f, 0.11193510f, + 0.01268418f, 0.08528346f, -0.06309239f, 0.13054633f, 0.08100729f, + -0.05209739f, -0.04315529f, 0.09341384f, 0.11035026f, -0.07596218f, + -0.05517511f, -0.04465296f, 0.02947334f, 0.04555536f, + -3.55954492e-003f, 0.07818956f, 0.07730991f, 0.07890715f, 0.06222893f, + 0.09001380f, -0.03574381f, 0.03414327f, 0.05677258f, -0.04773581f, + 0.03746637f, -0.03521175f, 0.06955440f, -0.03849038f, 0.01052293f, + 0.01736112f, 0.10867710f, 0.08748853f, 3.29739624e-003f, 0.10907028f, + 0.07913758f, 0.10393070f, 0.02091867f, 0.11594022f, 0.13182420f, + 0.09879354f, 0.05362710f, -0.06745391f, -7.01260753e-003f, + 5.24702156e-003f, 0.03236255f, 0.01407916f, 0.02207983f, 0.02537322f, + 0.04547948f, 0.07200756f, 0.03129894f, -0.06274468f, 0.02107014f, + 0.06035208f, 0.08636236f, 4.53164103e-003f, 0.02193363f, 0.02309801f, + 0.05568166f, -0.02645093f, 0.04448695f, 0.02837519f, 0.08975694f, + 0.04461516f, 0.08975355f, 0.07514391f, 0.02306982f, 0.10410084f, + 0.06368385f, 0.05943464f, 4.58420580e-003f, 0.05220337f, 0.06675851f, + 0.08358569f, 0.06712101f, 0.06559004f, -0.03930482f, -9.15936660e-003f, + -0.05897915f, 0.02816453f, 0.05032348f, 0.06780671f, 0.03377650f, + -6.09417039e-004f, -0.01795146f, -0.03083684f, -0.01302475f, + -0.02972313f, 7.88706727e-003f, -0.03525961f, -2.50397739e-003f, + 0.05245084f, 0.11791293f, -0.02167498f, 0.05299332f, 0.06640524f, + 0.05190265f, -8.27316567e-003f, 0.03033127f, 0.05842173f, + -4.01050318e-003f, -6.25105947e-003f, 0.05862958f, -0.02465461f, + 0.05546781f, -0.08228195f, -0.07234028f, 0.04640540f, -0.01308254f, + -0.02506191f, 0.03100746f, -0.04665651f, -0.04591486f, 0.02949927f, + 0.06035462f, 0.02244646f, -0.01698639f, 0.01040041f, 0.01131170f, + 0.05419579f, -0.02130277f, -0.04321722f, -0.03665198f, 0.01126490f, + -0.02606488f, -0.02228328f, -0.02255680f, -0.03427236f, + -7.75165204e-003f, -0.06195229f, 8.21638294e-003f, 0.09535975f, + -0.03709979f, -0.06942501f, 0.14579427f, -0.05448192f, -0.02055904f, + 0.05747357f, 0.02781788f, -0.07077577f, -0.05178314f, -0.10429011f, + -0.11235505f, 0.07529039f, -0.07559302f, -0.08786739f, 0.02983843f, + 0.02667585f, 0.01382199f, -0.01797496f, -0.03141199f, -0.02098101f, + 0.09029204f, 0.04955018f, 0.13718739f, 0.11379953f, 1.80019124e-003f, + -0.04577610f, -1.11108483e-003f, -0.09470536f, -0.11596080f, + 0.04489342f, 0.01784211f, 3.06850672e-003f, 0.10781866f, + 3.36498418e-003f, -0.10842580f, -0.07436839f, -0.10535070f, + -0.01866805f, 0.16057891f, -5.07316366e-003f, -0.04295658f, + -5.90488780e-003f, 8.82003549e-003f, -0.01492646f, -0.05029279f, + -0.12875880f, 8.78831954e-004f, -0.01297184f, -0.07592774f, + -0.02668831f, -6.93787413e-004f, 0.02406698f, -0.01773298f, + -0.03855745f, -0.05877856f, 0.03259695f, 0.12826584f, 0.06292590f, + -4.10733931e-003f, 0.10996531f, 0.01332991f, 0.02088735f, 0.04037504f, + -0.05210760f, 0.07760046f, 0.06399347f, -0.05751930f, -0.10053057f, + 0.07505023f, -0.02139782f, 0.01796176f, 2.34400877e-003f, -0.04208319f, + 0.07355055f, 0.05093350f, -0.02996780f, -0.02219072f, 0.03355330f, + 0.04418742f, -0.05580705f, -0.05037573f, -0.04548179f, 0.01379514f, + 0.02150671f, -0.02194211f, -0.13682702f, 0.05464972f, 0.01608082f, + 0.05309116f, 0.04701022f, 1.33690401e-003f, 0.07575664f, 0.09625306f, + 8.92647635e-003f, -0.02819123f, 0.10866830f, -0.03439325f, + -0.07092371f, -0.06004780f, -0.02712298f, -7.07467366e-003f, + -0.01637020f, 0.01336790f, -0.10313606f, 0.04906582f, -0.05732445f, + -0.02731079f, 0.01042235f, -0.08340668f, 0.03686501f, 0.06108340f, + 0.01322748f, -0.07809529f, 0.03774724f, -0.03413248f, -0.06096525f, + -0.04212124f, -0.07982176f, -1.25973229e-003f, -0.03045501f, + -0.01236493f, -0.06312395f, 0.04789570f, -0.04602066f, 0.08576570f, + 0.02521080f, 0.02988098f, 0.10314583f, 0.07060035f, 0.04520544f, + -0.04426654f, 0.13146530f, 0.08386490f, 0.02164590f, -2.12280243e-003f, + -0.03686353f, -0.02074944f, -0.03829959f, -0.01530596f, 0.02689708f, + 0.11867401f, -0.06043470f, -0.02785023f, -0.04775074f, 0.04878745f, + 0.06350956f, 0.03494788f, 0.01467400f, 1.17890188e-003f, 0.04379614f, + 2.03681854e-003f, -0.03958609f, -0.01072688f, 6.43705716e-003f, + 0.02996500f, -0.03418507f, -0.01960307f, -0.01219154f, + -4.37000440e-003f, -0.02549453f, 0.02646318f, -0.01632513f, + 6.46516960e-003f, -0.01929734f, 4.78711911e-003f, 0.04962371f, + 0.03809111f, 0.07265724f, 0.05758125f, -0.03741554f, 0.01648608f, + -8.45285598e-003f, 0.03996826f, -0.08185477f, 0.02638875f, + -0.04026615f, -0.02744674f, -0.04071517f, 1.05096330e-003f, + -0.04741232f, -0.06733172f, 8.70434940e-003f, -0.02192543f, + 1.35350740e-003f, -0.03056974f, -0.02975521f, -0.02887780f, + -0.01210713f, -0.04828526f, -0.09066251f, -0.09969629f, -0.03665164f, + -8.88111943e-004f, -0.06826669f, -0.01866150f, -0.03627640f, + -0.01408288f, 0.01874239f, -0.02075835f, 0.09145175f, -0.03547291f, + 0.05396780f, 0.04198981f, 0.01301925f, -0.03384354f, -0.12201976f, + 0.06830920f, -0.03715654f, 9.55848210e-003f, 5.05685573e-003f, + 0.05659294f, 3.90764466e-003f, 0.02808490f, -0.05518097f, -0.03711621f, + -0.02835565f, -0.04420464f, -0.01031947f, 0.01883466f, + -8.49525444e-003f, -0.09419250f, -0.01269387f, -0.02133371f, + -0.10190815f, -0.07844430f, 2.43644323e-003f, -4.09610150e-003f, + 0.01202551f, -0.06452291f, -0.10593818f, -0.02464746f, -0.02199699f, + -0.07401930f, 0.07285886f, 8.87513801e-004f, 9.97662079e-003f, + 8.46779719e-003f, 0.03730333f, -0.02905126f, 0.03573337f, -0.04393689f, + -0.12014472f, 0.03176554f, -2.76015815e-003f, 0.10824566f, 0.05090732f, + -3.30179278e-003f, -0.05123822f, 5.04784798e-003f, -0.05664124f, + -5.99415926e-003f, -0.05341901f, -0.01221393f, 0.01291318f, + 9.91760660e-003f, -7.56987557e-003f, -0.06193124f, -2.24549137e-003f, + 0.01987562f, -0.02018840f, -0.06975540f, -0.06601523f, -0.03349112f, + -0.08910118f, -0.03371435f, -0.07406893f, -0.02248047f, -0.06159951f, + 2.77751544e-003f, -0.05723337f, -0.04792468f, 0.07518548f, + 2.77279224e-003f, 0.04211938f, 0.03100502f, 0.05278448f, 0.03954679f, + -0.03006846f, -0.03851741f, -0.02792403f, -0.02875333f, 0.01531280f, + 0.02186953f, -0.01989829f, 2.50679464e-003f, -0.10258728f, + -0.04785743f, -0.02887216f, 3.85063468e-003f, 0.01112236f, + 8.29218887e-003f, -0.04822981f, -0.04503597f, -0.03713100f, + -0.06988008f, -0.11002295f, -2.69209221e-003f, 1.85383670e-003f, + -0.05921049f, -0.06105053f, -0.08458050f, -0.04527602f, + 8.90329306e-004f, -0.05875023f, -2.68602883e-003f, -0.01591195f, + 0.03631859f, 0.05493166f, 0.07300330f, 5.53333294e-003f, 0.06400407f, + 0.01847740f, -5.76280477e-003f, -0.03210877f, 4.25160583e-003f, + 0.01166520f, -1.44864211e-003f, 0.02253744f, -0.03367080f, 0.06983195f, + -4.22323542e-003f, -8.89401045e-003f, -0.07943393f, 0.05199728f, + 0.06065201f, 0.04133492f, 1.44032843e-003f, -0.09585235f, -0.03964731f, + 0.04232114f, 0.01750465f, -0.04487902f, -7.59733608e-003f, 0.02011171f, + 0.04673622f, 0.09011173f, -0.07869188f, -0.04682482f, -0.05080139f, + -3.99383716e-003f, -0.05346331f, 0.01085723f, -0.03599333f, + -0.07097908f, 0.03551549f, 0.02680387f, 0.03471529f, 0.01790393f, + 0.05471273f, 9.62048303e-003f, -0.03180215f, 0.05864431f, 0.02330614f, + 0.01633144f, -0.05616681f, -0.10245429f, -0.08302189f, 0.07291322f, + -0.01972590f, -0.02619633f, -0.02485327f, -0.04627592f, + 1.48853404e-003f, 0.05514185f, -0.01270860f, -0.01948900f, 0.06373586f, + 0.05002292f, -0.03009798f, 8.76216311e-003f, -0.02474238f, + -0.05504891f, 1.74034527e-003f, -0.03333667f, 0.01524987f, 0.11663762f, + -1.32344989e-003f, -0.06608453f, 0.05687166f, -6.89525274e-004f, + -0.04402352f, 0.09450210f, -0.04222684f, -0.05360983f, 0.01779531f, + 0.02561388f, -0.11075410f, -8.77790991e-003f, -0.01099504f, + -0.10380266f, 0.03103457f, -0.02105741f, -0.07371717f, 0.05146710f, + 0.10581432f, -0.08617968f, -0.02892107f, 0.01092199f, 0.14551543f, + -2.24320893e-003f, -0.05818033f, -0.07390742f, 0.05701261f, + 0.12937020f, -0.04986651f, 0.10182415f, 0.05028650f, 0.12515625f, + 0.09175041f, 0.06404983f, 0.01523394f, 0.09460562f, 0.06106631f, + -0.14266998f, -0.02926703f, 0.02762171f, 0.02164151f, + -9.58488265e-004f, -0.04231362f, -0.09866509f, 0.04322244f, + 0.05872034f, -0.04838847f, 0.06319253f, 0.02443798f, -0.03606876f, + 9.38737206e-003f, 0.04289991f, -0.01027411f, 0.08156885f, 0.08751175f, + -0.13191354f, 8.16054735e-003f, -0.01452161f, 0.02952677f, 0.03615945f, + -2.09128903e-003f, 0.02246693f, 0.09623287f, 0.09412123f, -0.02924758f, + -0.07815186f, -0.02203079f, -2.02566991e-003f, 0.01094733f, + -0.01442332f, 0.02838561f, 0.11882371f, 7.28798332e-003f, -0.10345965f, + 0.07561217f, -0.02049661f, 4.44177445e-003f, 0.01609347f, -0.04893158f, + -0.08758243f, -7.67420698e-003f, 0.08862378f, 0.06098121f, 0.06565887f, + 7.32981879e-003f, 0.03558407f, -0.03874352f, -0.02490055f, + -0.06771075f, 0.09939223f, -0.01066077f, 0.01382995f, -0.07289080f, + 7.47184316e-003f, 0.10621431f, -0.02878659f, 0.02383525f, -0.03274646f, + 0.02137008f, 0.03837290f, 0.02450992f, -0.04296818f, -0.02895143f, + 0.05327370f, 0.01499020f, 0.04998732f, 0.12938657f, 0.09391870f, + 0.04292390f, -0.03359194f, -0.06809492f, 0.01125796f, 0.17290455f, + -0.03430733f, -0.06255233f, -0.01813114f, 0.11726857f, -0.06127599f, + -0.08677909f, -0.03429872f, 0.04684938f, 0.08161420f, 0.03538774f, + 0.01833884f, 0.11321855f, 0.03261845f, -0.04826299f, 0.01752407f, + -0.01796414f, -0.10464549f, -3.30041884e-003f, 2.29343961e-004f, + 0.01457292f, -0.02132982f, -0.02602923f, -9.87351313e-003f, + 0.04273872f, -0.02103316f, -0.07994065f, 0.02614958f, -0.02111666f, + -0.06964913f, -0.13453490f, -0.06861878f, -6.09341264e-003f, + 0.08251446f, 0.15612499f, 2.46531400e-003f, 8.88424646e-003f, + -0.04152999f, 0.02054853f, 0.05277953f, -0.03087788f, 0.02817579f, + 0.13939077f, 0.07641046f, -0.03627627f, -0.03015098f, -0.04041540f, + -0.01360690f, -0.06227205f, -0.02738223f, 0.13577610f, 0.15235767f, + -0.05392922f, -0.11175954f, 0.02157129f, 0.01146481f, -0.05264937f, + -0.06595174f, -0.02749175f, 0.11812254f, 0.17404149f, -0.06137035f, + -0.11003478f, -0.01351621f, -0.01745916f, -0.08577441f, -0.04469909f, + -0.06106115f, 0.10559758f, 0.20806813f, -0.09174948f, 7.09621934e-004f, + 0.03579374f, 0.07215115f, 0.02221742f, 0.01827742f, -7.90785067e-003f, + 0.01489554f, 0.14519960f, -0.06425831f, 0.02990399f, -1.80181325e-003f, + -0.01401528f, -0.04171134f, -3.70530109e-003f, -0.09090481f, + 0.09520713f, 0.08845516f, -0.02651753f, -0.03016730f, 0.02562448f, + 0.03563816f, -0.03817881f, 0.01433385f, 0.02256983f, 0.02872120f, + 0.01001934f, -0.06332260f, 0.04338406f, 0.07001807f, -0.04705722f, + -0.07318907f, 0.02630457f, 0.03106382f, 0.06648342f, 0.10913180f, + -0.01630815f, 0.02910308f, 0.02895109f, 0.08040254f, 0.06969310f, + 0.06797734f, 6.08639978e-003f, 4.16588830e-003f, 0.08926726f, + -0.03123648f, 0.02700146f, 0.01168734f, -0.01631594f, 4.61015804e-003f, + 8.51359498e-003f, -0.03544224f, 0.03571994f, 4.29766066e-003f, + -0.01970077f, -8.79793242e-003f, 0.09607988f, 0.01544222f, + -0.03923707f, 0.07308586f, 0.06061262f, 1.31683104e-004f, + -7.98222050e-003f, 0.02399261f, -0.06084389f, -0.02743429f, + -0.05475523f, -0.04131311f, 0.03559756f, 0.03055342f, 0.02981433f, + 0.14860515f, 0.01766787f, 0.02945257f, 0.04898238f, 0.01026922f, + 0.02811658f, 0.08267091f, 0.02732154f, -0.01237693f, 0.11760156f, + 0.03802063f, -0.03309754f, 5.24957618e-003f, -0.02460510f, 0.02691451f, + 0.05399988f, -0.10133506f, 0.06385437f, -0.01818005f, 0.02259503f, + 0.03573135f, 0.01042848f, -0.04153402f, -0.04043029f, 0.01643575f, + 0.08326677f, 4.61383024e-004f, -0.05308095f, -0.08536223f, + -1.61011645e-003f, -0.02163720f, -0.01783352f, 0.03859637f, + 0.08498885f, -0.01725216f, 0.08625131f, 0.10995087f, 0.09177644f, + 0.08498347f, 0.07646490f, 0.05580502f, 0.02693516f, 0.09996913f, + 0.09070327f, 0.06667200f, 0.05873008f, -0.02247842f, 0.07772321f, + 0.12408436f, 0.12629253f, -8.41997913e-004f, 0.01477783f, 0.09165990f, + -2.98401713e-003f, -0.06466447f, -0.07057302f, 2.09516948e-004f, + 0.02210209f, -0.02158809f, -0.08602506f, -0.02284836f, + 4.01876355e-003f, 9.56660323e-003f, -0.02073978f, -0.04635138f, + -7.59423291e-003f, -0.01377393f, -0.04559359f, -0.13284740f, + -0.08671406f, -0.03654395f, 0.01142869f, 0.03287891f, -0.04392983f, + 0.06142959f, 0.17710890f, 0.10385257f, 0.01329137f, 0.10067633f, + 0.12450829f, -0.04476709f, 0.09049144f, 0.04589312f, 0.11167907f, + 0.08587538f, 0.04767583f, 1.67188141e-003f, 0.02359802f, -0.03808852f, + 0.03126272f, -0.01919029f, -0.05698918f, -0.02365112f, -0.06519032f, + -0.05599358f, -0.07097308f, -0.03301812f, -0.04719102f, -0.02566297f, + 0.01324074f, -0.09230672f, -0.05518232f, -0.04712864f, -0.03380903f, + -0.06719479f, 0.01183908f, -0.09326738f, 0.01642865f, 0.03789867f, + -6.61567831e-003f, 0.07796386f, 0.07246574f, 0.04706347f, -0.02523437f, + -0.01696830f, -0.08068866f, 0.06030888f, 0.10527060f, -0.06611756f, + 0.02977346f, 0.02621830f, 0.01913855f, -0.08479366f, -0.06322418f, + -0.13570616f, -0.07644490f, 9.31900274e-003f, -0.08095149f, + -0.10197903f, -0.05204025f, 0.01413151f, -0.07800411f, -0.01885122f, + -0.07509381f, -0.10136326f, -0.05212355f, -0.09944065f, + -1.33606605e-003f, -0.06342617f, -0.04178550f, -0.12373723f, + -0.02832736f, -0.06057501f, 0.05830070f, 0.07604282f, -0.06462587f, + 8.02447461e-003f, 0.11580125f, 0.12332212f, 0.01978462f, + -2.72378162e-003f, 0.05850752f, -0.04674481f, 0.05148062f, + -2.62542837e-003f, 0.11253355f, 0.09893716f, 0.09785093f, -0.04659257f, + -0.01102429f, -0.07002308f, 0.03088913f, -0.02565549f, -0.07671449f, + 3.17443861e-003f, -0.10783514f, -0.02314270f, -0.11089555f, + -0.01024768f, 0.03116021f, -0.04964825f, 0.02281825f, 5.50005678e-003f, + -0.08427856f, -0.14685495f, -0.07719755f, -0.13342668f, -0.04525511f, + -0.09914210f, 0.02588859f, 0.03469279f, 0.04664020f, 0.11688190f, + 0.09647275f, 0.10857815f, -0.01448726f, 0.04299758f, -0.06763151f, + 1.33257592e-003f, 0.14331576f, 0.07574340f, 0.09166205f, 0.05674926f, + 0.11325553f, -0.01106494f, 0.02062161f, -0.11484840f, -0.07492137f, + -0.02864293f, -0.01275638f, -0.06946032f, -0.10101652f, -0.04113498f, + -0.02214783f, -0.01273942f, -0.07480393f, -0.10556041f, -0.07622112f, + -0.09988393f, -0.11453961f, -0.12073903f, -0.09412795f, -0.07146588f, + -0.04054537f, -0.06127083f, 0.04221122f, 0.07688113f, 0.04099256f, + 0.12663734f, 0.14683802f, 0.21761774f, 0.12525328f, 0.18431792f, + -1.66402373e-003f, 2.37777247e-003f, 0.01445475f, 0.03509416f, + 0.02654697f, 0.01716739f, 0.05374011f, 0.02944174f, 0.11323927f, + -0.01485456f, -0.01611330f, -1.85554172e-003f, -0.01708549f, + -0.05435753f, -0.05302101f, 0.05260378f, -0.03582945f, + -3.42867890e-004f, 1.36076682e-003f, -0.04436073f, -0.04228432f, + 0.03281291f, -0.05480836f, -0.10197772f, -0.07206279f, -0.10741059f, + -0.02366946f, 0.10278475f, -2.74783419e-003f, -0.03242477f, + 0.02308955f, 0.02835869f, 0.10348799f, 0.19580358f, 0.10252027f, + 0.08039929f, 0.05525554f, -0.13250865f, -0.14395352f, 3.13586881e-003f, + -0.03387071f, 8.94669443e-003f, 0.05406157f, -4.97324532e-003f, + -0.01189114f, 2.82919413e-004f, -0.03901557f, -0.04898705f, + 0.02164520f, -0.01382906f, -0.01850416f, 0.01869347f, -0.02450060f, + 0.02291678f, 0.08196463f, 0.03309153f, -0.10629974f, 0.02473924f, + 0.05344394f, -0.02404823f, -0.03243643f, -5.55244600e-003f, + -0.08009996f, 0.02811539f, 0.04235742f, 0.01859004f, 0.04902123f, + -0.01438252f, -0.01526853f, 0.02044195f, -0.05008660f, 0.04244113f, + 0.07611816f, 0.04950470f, -0.06020549f, -4.26026015e-003f, 0.13133512f, + -0.01438738f, -0.01958807f, -0.04044152f, -0.12425045f, + 2.84353318e-003f, -0.05042776f, -0.09121484f, 7.34345755e-003f, + 0.09388847f, 0.11800314f, 4.72295098e-003f, 4.44378285e-003f, + -0.07984917f, -0.03613737f, 0.04490915f, -0.02246483f, 0.04681071f, + 0.05240871f, 0.02157206f, -0.04603431f, -0.01197929f, -0.02748779f, + 0.13621049f, 0.08812155f, -0.07802048f, 4.86458559e-003f, -0.01598836f, + 0.01024450f, -0.03463517f, -0.02304239f, -0.08692665f, 0.06655128f, + 0.05785803f, -0.12640759f, 0.02307472f, 0.07337402f, 0.07525434f, + 0.04943763f, -0.02241034f, -0.09978238f, 0.14487994f, -0.06570521f, + -0.07855482f, 0.02830222f, -5.29603509e-004f, -0.04669895f, + -0.11822784f, -0.12246452f, -0.15365660f, -0.02969127f, 0.08078201f, + 0.13512598f, 0.11505685f, 0.04740673f, 0.01376022f, -0.05852978f, + -0.01537809f, -0.05541119f, 0.02491065f, -0.02870786f, 0.02760978f, + 0.23836176f, 0.22347429f, 0.10306466f, -0.06919070f, -0.10132039f, + -0.20198342f, -0.05040560f, 0.27163076f, 0.36987007f, 0.34540465f, + 0.29095781f, 0.05649706f, 0.04125737f, 0.07505883f, -0.02737836f, + -8.43431335e-003f, 0.07368195f, 0.01653876f, -0.09402955f, + -0.09574359f, 0.01474337f, -0.07128561f, -0.03460737f, 0.11438941f, + 0.13752601f, -0.06385452f, -0.06310338f, 8.19548313e-003f, 0.11622470f, + 5.05133113e-003f, -0.07602754f, 0.06695660f, 0.25723928f, 0.09037900f, + 0.28826267f, 0.13165380f, -0.05312614f, -0.02137198f, -0.03442232f, + -0.06255679f, 0.03899667f, 0.18391028f, 0.26016650f, 0.03374462f, + 0.01860465f, 0.19077586f, 0.18160543f, 3.43634398e-003f, -0.03036782f, + 0.19683038f, 0.35378191f, 0.24968483f, -0.03222649f, 0.28972381f, + 0.43091634f, 0.30778357f, 0.02335266f, -0.09877399f, -6.85245218e-003f, + 0.08945240f, -0.08150686f, 0.02792493f, 0.24806842f, 0.17338486f, + 0.06231801f, -0.10432383f, -0.16653322f, -0.13197899f, -0.08531576f, + -0.19271527f, -0.13536365f, 0.22240199f, 0.39219588f, 0.26597717f, + -0.01231649f, 0.01016179f, 0.13379875f, 0.12018334f, -0.04852953f, + -0.07915270f, 0.07036012f, 3.87723115e-003f, -0.06126805f, + -0.15015170f, -0.11406515f, -0.08556531f, -0.07429333f, -0.16115491f, + 0.13214062f, 0.25691369f, 0.05697750f, 0.06861912f, -6.02903729e-003f, + -7.94562511e-003f, 0.04799571f, 0.06695165f, -0.01926842f, 0.06206308f, + 0.13450983f, -0.06381495f, -2.98370165e-003f, -0.03482971f, + 7.53991678e-003f, 0.03895611f, 0.11464261f, 0.01669971f, + 8.27818643e-003f, -7.49160210e-003f, -0.11712562f, -0.10650621f, + -0.10353880f, -0.04994106f, -7.65618810e-004f, 0.03023767f, + -0.04759270f, -0.07302686f, -0.05825012f, -0.13156348f, -0.10639747f, + -0.19393684f, -0.09973683f, -0.07918908f, 4.63177625e-004f, + -6.61382044e-004f, 0.15853868f, 0.08561199f, -0.07660093f, + -0.08015265f, -0.06164073f, 0.01882577f, -7.29908410e-004f, + 0.06840892f, 0.03843764f, 0.20274927f, 0.22028814f, -5.26101235e-003f, + 0.01452435f, -0.06331623f, 0.02865064f, 0.05673740f, 0.12171564f, + 0.03837196f, 0.03555467f, -0.02662914f, -0.10280123f, -0.06526285f, + -0.11066351f, -0.08988424f, -0.10103678f, 8.10526591e-003f, + 5.95238712e-003f, 0.02617721f, -0.01705742f, -0.10897956f, + -0.08004991f, -0.11271993f, -0.06185647f, -0.06103712f, 0.01597041f, + -0.05923606f, 0.09410726f, 0.22858568f, 0.03263380f, 0.06772990f, + -0.09003516f, 0.01017870f, 0.01931688f, 0.08628357f, -0.01430009f, + 0.10954945f, 0.16612452f, -0.02434544f, -0.03310068f, -0.04236627f, + 0.01212392f, -6.15046406e-003f, 0.06954194f, 0.03015283f, 0.01787957f, + 0.02781667f, -0.05561153f, -8.96244217e-003f, -0.04971489f, + 0.07510284f, 0.01775282f, 0.05889897f, -0.07981427f, 0.03647643f, + -3.73833324e-003f, -0.08894575f, -0.06429435f, -0.08068276f, + 0.03567704f, -0.07131936f, -7.21910037e-003f, -0.09566668f, + 0.17886090f, 0.14911725f, 0.02070032f, -0.05017120f, -0.04992622f, + 0.01570143f, -0.09906903f, 0.06456193f, 0.15329507f, 0.18820767f, + 0.11689861f, -0.01178513f, -0.02225163f, -0.01905318f, 0.10271224f, + -7.27029052e-003f, 0.11664233f, 0.14796902f, 0.07771893f, 0.02400013f, + -0.05361797f, -0.01972888f, 0.01376177f, 0.06740040f, -0.06525395f, + 0.05726178f, -0.02404981f, -0.14018567f, -0.02074987f, -0.04621970f, + -0.04688627f, -0.01842059f, 0.07722727f, -0.04852883f, 0.01529004f, + -0.19639495f, 0.10817073f, 0.03795860f, -0.09435206f, -0.07984378f, + -0.03383440f, 0.11081333f, 0.02237366f, 0.12703256f, 0.21613893f, + 0.02918790f, 4.66472283e-003f, -0.10274266f, -0.04854131f, + -3.46305710e-003f, 0.08652268f, 0.02251546f, 0.09636052f, 0.17180754f, + -0.09272388f, 4.59174305e-004f, -0.11723048f, -0.12210111f, + -0.15547538f, 0.07218186f, -0.05297846f, 0.03779940f, 0.05150875f, + -0.03802310f, 0.03870645f, -0.15250699f, -0.08696499f, -0.02021560f, + 0.04118926f, -0.15177974f, 0.01577647f, 0.10249301f, 7.50041893e-003f, + 0.01721806f, -0.06828983f, -0.02397596f, -0.06598977f, -0.04317593f, + -0.08064980f, 6.66632550e-003f, 0.03333484f, 0.07093620f, 0.08231064f, + -0.06577903f, -0.06698844f, -0.06984019f, -0.06508023f, -0.14145090f, + -0.02393239f, 0.06485303f, 8.83263443e-003f, 0.09251080f, -0.07557579f, + -0.05067699f, -0.09798748f, -0.06703258f, -0.14056294f, 0.03245994f, + 0.12554143f, 0.01761621f, 0.12980327f, -0.04081950f, -0.11906909f, + -0.14813015f, -0.08376863f, -0.12200681f, 0.04988137f, 0.05424247f, + -3.90952639e-003f, 0.03255733f, -0.12717837f, -0.07461493f, + -0.05703964f, -0.01736189f, -0.08026433f, -0.05433894f, -0.01719359f, + 0.02886275f, 0.01772653f, -0.09163518f, 3.57789593e-003f, -0.10129993f, + -0.02653764f, -0.08131415f, -0.03847986f, -7.62157550e-004f, + 0.06486648f, 0.19675669f, -0.04919156f, -0.07059129f, -0.04857785f, + -0.01042383f, -0.08328653f, 0.03660302f, -0.03696846f, 0.04969259f, + 0.08241162f, -0.12514858f, -0.06122676f, -0.03750202f, + 6.52989605e-003f, -0.10247213f, 0.02568346f, 4.51781414e-003f, + -0.03734229f, -0.01131264f, -0.05412074f, 8.89345480e-004f, + -0.12388977f, -0.05959237f, -0.12418608f, -0.06151643f, -0.07310260f, + 0.02441575f, 0.07023528f, -0.07548289f, -7.57147965e-004f, + -0.09061348f, -0.08112976f, -0.06920306f, 9.54394229e-003f, + -0.01219902f, 1.21273217e-003f, -8.88989680e-003f, -0.08309301f, + -0.04552661f, -0.10739882f, -0.05691034f, -0.13928030f, 0.09027749f, + 0.15123098f, 0.03175976f, 0.17763577f, 3.29913251e-004f, 0.05151888f, + -0.09844074f, -0.09475287f, -0.08571247f, 0.16241577f, 0.19336018f, + 8.57454538e-003f, 0.11474732f, -0.01493934f, 0.03352379f, -0.08966240f, + -0.02322310f, 0.02663568f, 0.05448750f, -0.03536883f, -0.07210463f, + -0.06807277f, -0.03121621f, -0.05932408f, -0.17282860f, -0.15873498f, + -0.04956378f, 0.01603377f, -0.12385946f, 0.13878587f, 0.21468069f, + 0.13510075f, 0.20992437f, 0.08845878f, 0.08104013f, 0.03754176f, + 0.12173114f, 0.11103114f, 0.10643122f, 0.13941477f, 0.11640384f, + 0.14786847f, 0.01218238f, 0.01160753f, 0.03547940f, 0.08794311f, + -0.01695384f, -0.07692261f, -0.08236158f, 6.79194089e-003f, + -0.02458403f, 0.13022894f, 0.10953187f, 0.09857773f, 0.04735930f, + -0.04353498f, -0.15173385f, -0.17904443f, -0.10450364f, -0.13418166f, + -0.06633098f, -0.03170381f, -0.06839000f, -0.11350126f, -0.06983913f, + 0.19083543f, 0.17604128f, 0.07730632f, 0.10022651f, 0.36428109f, + 0.28291923f, 0.12688625f, 0.15942036f, 0.14064661f, -0.11201853f, + -0.13969108f, -0.09088077f, -0.14107047f, 0.05117374f, + -2.63348082e-003f, -0.10794610f, -0.09715455f, -0.05284977f, + 0.01565668f, 0.05031200f, 0.07021113f, -0.02963028f, 0.01766960f, + 0.08333644f, -0.03211382f, 4.90096770e-003f, 0.05186674f, -0.05045737f, + -0.09624767f, -0.02525997f, 0.06916669f, 0.01213916f, 0.05333899f, + -0.03443280f, -0.10055527f, -0.06291115f, 5.42851724e-003f, + -6.30360236e-003f, 0.02270257f, -0.01769792f, 0.03273688f, 0.07746078f, + 7.77099328e-003f, 0.05041346f, 0.01648103f, -0.02321534f, -0.09930186f, + -0.02293853f, 0.02034990f, -0.08324204f, 0.08510064f, -0.03732836f, + -0.06465405f, -0.06086946f, 0.13680504f, -0.11469388f, -0.03896406f, + -0.07142810f, 2.67581246e-003f, -0.03639632f, -0.09849060f, + -0.11014334f, 0.17489147f, 0.17610909f, -0.16091567f, -0.07248894f, + 0.01567141f, 0.23742996f, 0.07552249f, -0.06270349f, -0.07303379f, + 0.25442186f, 0.16903116f, -0.08168741f, -0.05913896f, -0.03954096f, + 6.81776879e-003f, -0.05615319f, -0.07303037f, -0.12176382f, + 0.12385108f, 0.22084464f, -0.05543206f, -0.03310431f, 0.05731593f, + 0.19481890f, 0.04016430f, -0.06480758f, -0.12353460f, 0.18733442f, + -0.09631214f, -0.11192076f, 0.12404587f, 0.15671748f, 0.19256128f, + 0.10895617f, 0.03391477f, -0.13032004f, -0.05626907f, -0.09025607f, + 0.23485197f, 0.27812332f, 0.26725492f, 0.07255980f, 0.16565137f, + 0.22388470f, 0.07441066f, -0.21003133f, -0.08075339f, -0.15031935f, + 0.07023834f, 0.10872041f, 0.18156518f, 0.20037253f, 0.13571967f, + -0.11915682f, -0.11131983f, -0.18878011f, 0.06074620f, 0.20578890f, + 0.12413109f, 0.03930207f, 0.29176015f, 0.29502738f, 0.27856228f, + -0.01803601f, 0.16646385f, 0.19268319f, 0.01900682f, 0.06026287f, + 2.35868432e-003f, 0.01558199f, 0.02707230f, 0.11383014f, 0.12103992f, + 0.03907350f, 0.04637353f, 0.09020995f, 0.11919726f, -3.63007211e-003f, + 0.02220155f, 0.10336831f, 0.17351882f, 0.12259731f, 0.18983354f, + 0.15736865f, 0.01160725f, -0.01690723f, -9.69582412e-004f, 0.07213813f, + 0.01161613f, 0.17864859f, 0.24486147f, 0.18208991f, 0.20177495f, + 0.05972528f, -8.93934630e-003f, -0.02316955f, 0.14436610f, 0.14114498f, + 0.05520950f, 0.06353590f, -0.19124921f, 0.10174713f, 0.29414919f, + 0.26448128f, 0.09344960f, 0.15284036f, 0.19797507f, 0.11369792f, + -0.12722753f, -0.21396367f, -0.02008235f, -0.06566695f, -0.01662150f, + -0.03937003f, 0.04778343f, 0.05017274f, -0.02299062f, -0.20208496f, + -0.06395898f, 0.13721776f, 0.22544557f, 0.14888357f, 0.08687132f, + 0.27088094f, 0.32206613f, 0.09782200f, -0.18523243f, -0.17232181f, + -0.01041531f, 0.04008654f, 0.04199702f, -0.08081299f, -0.03755421f, + -0.04809646f, -0.05222081f, -0.21709201f, -0.06622940f, 0.02945281f, + -0.04600435f, -0.05256077f, -0.08432942f, 0.02848100f, 0.03490564f, + 8.28621630e-003f, -0.11051246f, -0.11210597f, -0.01998289f, + -0.05369405f, -0.08869293f, -0.18799506f, -0.05436598f, -0.05011634f, + -0.05419716f, -0.06151857f, -0.10827805f, 0.04346735f, 0.04016083f, + 0.01520820f, -0.12173316f, -0.04880285f, -0.01101406f, 0.03250847f, + -0.06009551f, -0.03082932f, -0.02295134f, -0.06856834f, -0.08775249f, + -0.23793389f, -0.09174541f, -0.05538322f, -0.04321031f, -0.11874759f, + -0.04221844f, -0.06070468f, 0.01194489f, 0.02608565f, -0.03892140f, + -0.01643151f, -0.02602034f, -0.01305472f, 0.03920100f, -0.06514261f, + 0.01126918f, -6.27710763e-003f, -0.02720047f, -0.11133634f, + 0.03300330f, 0.02398472f, 0.04079665f, -0.10564448f, 0.05966159f, + 0.01195221f, -0.03179441f, -0.01692590f, -0.06177841f, 0.01841576f, + -5.51078189e-003f, -0.06821765f, -0.03191888f, -0.09545476f, + 0.03030550f, -0.04896152f, -0.02914624f, -0.13283344f, -0.04783419f, + 6.07836898e-003f, -0.01449538f, -0.13358212f, -0.09687774f, + -0.02813793f, 0.01213498f, 0.06650011f, -0.02039067f, 0.13356198f, + 0.05986415f, -9.12760664e-003f, -0.18780160f, -0.11992817f, + -0.06342237f, 0.01229534f, 0.07143231f, 0.10713009f, 0.11085765f, + 0.06569190f, -0.02956399f, -0.16288325f, -0.13993549f, -0.01292515f, + 0.03833013f, 0.09130384f, -0.05086257f, 0.05617329f, -0.03896667f, + -0.06282311f, -0.11490010f, -0.14264110f, -0.04530499f, 0.01598189f, + 0.09167797f, 0.08663294f, 0.04885277f, -0.05741219f, -0.07565769f, + -0.17136464f, -0.02619422f, -0.02477579f, 0.02679587f, 0.11621952f, + 0.08788391f, 0.15520640f, 0.04709549f, 0.04504483f, -0.10214074f, + -0.12293372f, -0.04820546f, -0.05484834f, 0.05473754f, 0.07346445f, + 0.05577277f, -0.08209965f, 0.03462975f, -0.20962234f, -0.09324598f, + 3.79481679e-003f, 0.03617633f, 0.16742408f, 0.07058107f, 0.10204960f, + -0.06795346f, 3.22807301e-003f, -0.12589309f, -0.17496960f, + 0.02078314f, -0.07694324f, 0.12184640f, 0.08997164f, 0.04793497f, + -0.11383379f, -0.08046359f, -0.25716835f, -0.08080962f, + 6.80711539e-003f, -0.02930280f, -3.04938294e-003f, -0.11106286f, + -0.04628860f, -0.07821649f, 7.70127494e-003f, -0.10247706f, + 1.21042714e-003f, 0.20573859f, -0.03241005f, 8.42972286e-003f, + 0.01946464f, -0.01197973f, -0.14579976f, 0.04233614f, + -4.14096704e-003f, -0.06866436f, -0.02431862f, -0.13529138f, + 1.25891645e-003f, -0.11425111f, -0.04303651f, -0.01694815f, + 0.05720210f, -0.16040207f, 0.02772896f, 0.05498345f, -0.15010567f, + 0.01450866f, 0.02350303f, -0.04301004f, -0.04951802f, 0.21702233f, + -0.03159155f, -0.01963303f, 0.18232647f, -0.03263875f, + -2.88476888e-003f, 0.01587562f, -1.94303901e-003f, -0.07789494f, + 0.04674156f, -6.25576358e-003f, 0.08925962f, 0.21353747f, 0.01254677f, + -0.06999976f, -0.05931328f, -0.01884327f, -0.04306272f, 0.11794136f, + 0.03842728f, -0.03907030f, 0.05636114f, -0.09766009f, -0.02104000f, + 8.72711372e-003f, -0.02736877f, -0.05112274f, 0.16996814f, 0.02955785f, + 0.02094014f, 0.08414304f, -0.03335762f, -0.03617457f, -0.05808248f, + -0.08872101f, 0.02927705f, 0.27077839f, 0.06075108f, 0.07478261f, + 0.15282831f, -0.03908454f, -0.05101782f, -9.51998029e-003f, + -0.03272416f, -0.08735625f, 0.07633440f, -0.07185312f, 0.13841286f, + 0.07812646f, -0.12901451f, -0.05488589f, -0.05644578f, -0.03290703f, + -0.11184757f, 0.03751570f, -0.05978153f, -0.09155276f, 0.05657315f, + -0.04328186f, -0.03047933f, -0.01413135f, -0.10181040f, -0.01384013f, + 0.20132534f, -0.01536873f, -0.07641169f, 0.05906778f, -0.07833145f, + -0.01523801f, -0.07502609f, -0.09461885f, -0.15013233f, 0.16050665f, + 0.09021381f, 0.08473236f, 0.03386267f, -0.09147339f, -0.09170618f, + -0.08498498f, -0.05119187f, -0.10431040f, 0.01041618f, -0.03064913f, + 0.09340212f, 0.06448522f, -0.03881054f, -0.04985436f, -0.14794017f, + -0.05200112f, -0.02144495f, 0.04000821f, 0.12420804f, -0.01851651f, + -0.04116732f, -0.11951703f, -0.04879033f, -0.08722515f, -0.08454733f, + -0.10549165f, 0.11251976f, 0.10766345f, 0.19201984f, 0.06128913f, + -0.02734615f, -0.08834923f, -0.16999826f, -0.03548348f, + -5.36092324e-003f, 0.08297954f, 0.07226378f, 0.04194529f, 0.04668673f, + 8.73902347e-003f, 0.06980139f, 0.05652480f, 0.05879445f, 0.02477076f, + 0.02451423f, 0.12433673f, 0.05600227f, 0.06886370f, 0.03863076f, + 0.07459056f, 0.02264139f, 0.01495469f, 0.06344220f, 0.06945208f, + 0.02931899f, 0.11719371f, 0.04527427f, 0.03248192f, 2.08271481e-003f, + 0.02044626f, 0.11403449f, 0.04303892f, 0.06444661f, 0.04959024f, + 0.08174094f, 0.09240247f, 0.04894639f, 0.02252937f, -0.01652530f, + 0.07587013f, 0.06064249f, 0.13954395f, 0.02772832f, 0.07093039f, + 0.08501238f, 0.01701301f, 0.09055722f, 0.33421436f, 0.20163782f, + 0.09821030f, 0.07951369f, 0.08695120f, -0.12757730f, -0.13865978f, + -0.06610068f, -0.10985506f, 0.03406816f, -0.01116336f, -0.07281768f, + -0.13525715f, -0.12844718f, 0.08956250f, 0.09171610f, 0.10092317f, + 0.23385370f, 0.34489515f, 0.09901748f, 0.02002922f, 0.12335990f, + 0.07606190f, -0.14899330f, -0.15634622f, -0.06494618f, -0.01760547f, + 0.03404277f, -0.13208845f, -0.12101169f, -0.18294574f, -0.16560709f, + 0.02183887f, -0.02752613f, 0.01813638f, 0.02000757f, 0.01319924f, + 0.08030242f, 0.01220535f, 2.98233377e-003f, -0.01307070f, 0.05970297f, + -0.05345284f, -0.03381982f, -9.87543724e-003f, -0.06869387f, + 0.03956730f, -0.03108176f, -0.05732809f, 0.02172386f, 0.04159765f, + 2.62783933e-003f, 0.04813229f, 0.09358983f, -8.18389002e-003f, + 0.01724574f, -0.02547474f, -0.04967288f, -0.02390376f, 0.06640504f, + -0.06306566f, 0.01137518f, 0.05589378f, -0.08237787f, 0.02455001f, + -0.03059422f, -0.08953978f, 0.06851497f, 0.07190268f, -0.07610799f, + 7.87237938e-003f, -7.85830803e-003f, 0.06006952f, -0.01126728f, + -2.85743061e-003f, -0.04772895f, 0.01884944f, 0.15005857f, + -0.06268821f, -0.01989072f, 0.01138399f, 0.08760451f, 0.03879007f, + -9.66926850e-003f, -0.08012961f, 0.06414555f, -0.01362950f, + -0.09135523f, 0.01755159f, 0.04459474f, 0.09650917f, 0.05219948f, + -2.19440833e-003f, -0.07037939f, -0.01599054f, 0.13103317f, + -0.02492603f, -0.01032540f, -0.02903307f, 0.04489160f, 0.05148086f, + 0.01858173f, -0.02919228f, 0.08299296f, -0.04590359f, -0.15745632f, + -0.09068198f, -0.02972453f, 0.12985018f, 0.22320485f, 0.24261914f, + 0.03642650f, -0.05506422f, 2.67413049e-003f, -0.03834032f, 0.06449424f, + 0.03834866f, 0.03816991f, 0.25039271f, 0.34212017f, 0.32433882f, + 0.18824573f, -0.08599839f, -0.17599408f, -0.15317015f, -0.09913155f, + -0.02856072f, -0.05304699f, -1.06437842e-003f, -0.06641813f, + -0.07509298f, 0.01463361f, -0.07551918f, -0.04510373f, + -8.44620075e-003f, 0.01772176f, 0.04068235f, 0.20295307f, 0.15719447f, + 0.05712103f, 0.26296997f, 0.14657754f, 0.01547317f, -0.05052776f, + -0.03881342f, -0.01437883f, -0.04930177f, 0.11719568f, 0.24098417f, + 0.26468599f, 0.31698579f, 0.10103608f, -0.01096375f, -0.01367013f, + 0.17104232f, 0.20065314f, 2.67622480e-003f, -0.01190034f, 0.18301608f, + 0.09459770f, -0.06357619f, -0.06473801f, 0.01377906f, -0.10032775f, + -0.06388740f, 3.80393048e-003f, 0.06206078f, 0.10349120f, 0.26804337f, + 8.17918684e-003f, -0.02314351f, 9.34422202e-003f, 0.09198381f, + 0.03681326f, -8.77339672e-003f, -0.09662418f, -0.02715708f, + 0.13503517f, 0.08962728f, -6.57071499e-003f, -0.03201199f, 0.28510824f, + 0.32095715f, 0.18512695f, -0.14230858f, -0.14048551f, -0.07181299f, + -0.08575408f, -0.08661680f, -0.17416079f, 7.54326640e-004f, + 0.05601677f, 0.13585392f, -0.04960437f, -0.07708392f, 0.10676333f, + -0.04407546f, -0.07209078f, 0.03663663f, 0.28949317f, 0.41127121f, + 0.27431169f, -0.06900328f, -0.21474190f, -0.15578632f, -0.19555484f, + -0.15209621f, -0.11269179f, 0.07416003f, 0.18991330f, 0.26858172f, + 0.01952259f, 0.01017922f, 0.02159843f, -4.95165400e-003f, -0.04368168f, + -0.12721671f, -0.06673957f, -0.11275250f, 0.04413409f, 0.05578312f, + 0.03896771f, 0.03566417f, -0.05871816f, -0.07388090f, -0.17965563f, + -0.08570268f, -0.15273231f, -0.06022318f, -0.06999847f, + -6.81510568e-003f, 0.06294262f, -6.54901436e-004f, -0.01128654f, + -0.02289657f, 0.04849290f, 0.04140804f, 0.23681939f, 0.14545733f, + 0.01989965f, 0.12032662f, 3.87463090e-003f, -6.02597650e-003f, + -0.05919775f, -0.03067224f, -0.07787777f, 0.10834727f, 0.02153730f, + 0.02765649f, 0.03975543f, -0.12182906f, -0.04900113f, -0.09940100f, + -0.06453611f, -0.13757215f, -0.03721382f, 0.02827376f, -0.04351249f, + 0.01907038f, -0.10284120f, -0.05671160f, -0.10760647f, -0.09624009f, + -0.09565596f, -0.01303654f, 0.03080539f, 0.01416511f, 0.05846142f, + -5.42971538e-003f, 0.06221476f, -0.03320325f, -0.06791797f, + -0.05791342f, 0.12851369f, 0.14990346f, 0.03634374f, 0.14262885f, + 0.04330391f, 0.05032569f, -0.05631914f, 0.01606137f, 0.04387223f, + 0.22344995f, 0.15722635f, -0.04693628f, 0.03006579f, -2.52882647e-003f, + 0.05717621f, -0.07529724f, -0.02848588f, -0.06868757f, + -4.51729307e-003f, 0.06466042f, -0.05935378f, -0.04704857f, + -0.07363959f, 0.04843248f, -0.13421375f, -0.09789340f, -0.10255270f, + 0.03509852f, 0.04751543f, -0.03822323f, 0.09740467f, 0.04762916f, + 0.03940146f, -0.08283259f, 0.09552965f, 0.05038739f, 0.21258622f, + 0.09646992f, 0.03241193f, 0.05167701f, 0.04614570f, 0.04330090f, + -0.02671840f, -0.06259909f, -0.02301898f, 0.18829170f, 0.10522786f, + 0.04313190f, 0.01670948f, -0.08421925f, 0.05911417f, -0.10582602f, + -0.04855484f, -0.08373898f, 0.07775915f, 0.03723533f, -0.12047344f, + 4.86345543e-003f, -0.10520902f, 0.06571782f, -0.07528137f, + -0.03245651f, -0.09869066f, -0.02917477f, -0.18293270f, 0.14810945f, + 9.24033765e-003f, -0.04354914f, 0.02266885f, -0.11872729f, + -0.04016589f, 0.02830229f, 0.22539048f, 0.20565644f, 0.16701797f, + 0.09019924f, 0.01300652f, 0.09760600f, -0.03675831f, -0.01935448f, + -0.06894835f, 0.08077277f, 0.19047537f, 0.11312226f, 0.04106043f, + -0.11187182f, 0.04312806f, -0.18548580f, -0.11287174f, -0.08794551f, + 0.02078281f, -0.15295486f, 0.11806386f, -0.01103218f, -0.15971117f, + 0.02153538f, -0.05232147f, -0.10835317f, -0.13910367f, 0.05920752f, + -0.10122602f, 0.20174250f, 0.09105796f, -0.01881348f, 0.09559010f, + -0.03725745f, -0.09442931f, -0.09763174f, 0.05854454f, 0.08287182f, + 0.12919849f, 0.08594352f, -2.49806582e-003f, 0.02398440f, + 5.67950122e-003f, -0.06296340f, -0.12993270f, 0.03855852f, 0.05186560f, + 0.10839908f, -0.03380463f, -0.12654832f, -0.05399339f, -0.07456800f, + -0.04736232f, -0.10164231f, 0.07496139f, 0.08125214f, 0.07656177f, + -0.04999603f, -0.12823077f, -0.07692395f, -0.11317524f, -0.09118655f, + -0.05695669f, 0.10477209f, 0.07468581f, 0.01630048f, -8.00961629e-003f, + -0.06582128f, -0.04019095f, -0.04682907f, -0.01907842f, -0.10997720f, + 0.04911406f, 0.02931030f, 0.04197735f, -0.05773980f, -0.09670641f, + -0.03594951f, -0.03402121f, -0.07149299f, -0.10566200f, 0.10601286f, + 0.06340689f, -0.01518632f, -5.96402306e-003f, -0.07628012f, + -3.52779147e-003f, -0.02683854f, -0.10265494f, -0.02680815f, + 0.16338381f, 0.03103515f, 0.02296976f, 0.01624348f, -0.10831620f, + -0.02314233f, -0.04789969f, -0.05530700f, -0.06461314f, 0.10494506f, + 0.04642856f, -0.07592955f, -0.06197905f, -0.09042154f, -0.01445521f, + -0.04297818f, -0.11262015f, -0.11430512f, 0.03174541f, -0.03677487f, + -0.02963996f, -0.06610169f, -0.13292049f, -0.07059067f, -0.08444111f, + -0.02640536f, -0.07136250f, 0.04559967f, 0.01459980f, 0.17989251f, + 0.04435328f, -0.12464730f, -0.02871115f, -0.10752209f, -0.03393742f, + -0.03791408f, 0.02548251f, 0.01956050f, 0.19245651f, 0.13963254f, + -0.05904696f, -0.07424626f, -0.10411884f, 1.54176133e-003f, + 0.01797429f, 0.13025844f, 0.04547642f, -0.05710349f, -0.10697161f, + -0.13489437f, -0.06515755f, -0.06406886f, -4.08572936e-003f, + -0.01336483f, 0.04368737f, -0.11259720f, -0.05701635f, -0.06469971f, + -0.08346602f, -0.04166770f, -0.05795543f, -0.08247511f, -0.05742628f, + 0.08452254f, -0.03350224f, 0.13980860f, 0.13252275f, 0.07589617f, + 0.07539988f, 0.12155797f, 0.19087289f, 0.15050751f, 0.21250245f, + 0.14206800f, 0.01298489f, 0.07450245f, 0.06559097f, 0.01700557f, + 0.04512971f, 0.16950700f, 0.10261577f, 0.16389982f, 0.05505059f, + -0.03453077f, 0.08622462f, 0.07935954f, 0.03976260f, 0.02036091f, + 3.95744899e-003f, 0.03267065f, 0.15235919f, 0.01297494f, -0.08109194f, + 0.01407558f, 4.40693414e-003f, -0.15157418f, -0.11390478f, + -0.07487597f, -7.81322457e-003f, -0.02749545f, -0.10181408f, + 0.13755716f, 0.14007211f, 0.13482562f, 0.27517235f, 0.34251109f, + 0.07639657f, 0.07268607f, 0.19823882f, 0.16135791f, -0.04186463f, + -0.12784107f, -0.09846287f, 0.03169041f, 0.10974082f, -0.15051922f, + -0.08916726f, -0.07138767f, -0.04153349f, 6.25418453e-003f, + 0.01266654f, 0.10533249f, 0.12749144f, 0.15148053f, 0.01498513f, + 0.06305949f, -0.01247123f, -0.08778401f, -0.08551880f, -0.11955146f, + -0.08493572f, -0.02901620f, -0.02394859f, -0.13427313f, -0.11053200f, + -0.14413260f, -0.15203285f, 0.03972760f, -3.72127310e-004f, + -0.04200919f, 0.06105104f, 0.01904975f, -0.01106191f, + -7.27445772e-003f, -0.01520341f, 1.10228511e-003f, -0.04949187f, + -0.08013099f, 5.72071038e-003f, 0.08415454f, -0.06523152f, 0.03664081f, + -0.02673042f, -0.12066154f, -0.03702074f, 0.06006580f, 0.01628682f, + -6.17772620e-003f, 0.08192339f, -3.41629819e-003f, 0.02870512f, + 0.05807141f, 0.04959986f, 0.04618251f, -0.04901629f, -0.10579574f, + 0.02274442f, 0.12070961f, 2.23597488e-003f, 0.09831765f, -0.03019848f, + -0.11181970f, -0.04961075f, 0.02498928f, -0.03714991f, -0.01619653f, + 0.02643486f, -7.62964319e-003f, -0.02882290f, -0.06242594f, + -0.08439861f, 0.07220893f, 0.07263952f, 0.01561574f, 0.03091968f, + 0.01708712f, -0.03797151f, -3.18561122e-003f, 0.01624021f, + -0.02828573f, 0.11284444f, -1.32280716e-003f, -0.07784860f, + -0.07209100f, 0.03372242f, 0.12154529f, 0.02278104f, -0.05275500f, + -0.01918484f, 0.12989293f, 0.05424401f, 0.02333086f, 0.04029022f, + 0.12392918f, 0.09495489f, 0.09190340f, 0.07935889f, 8.76816828e-003f, + 0.17148446f, -8.51302687e-003f, -0.08011249f, -0.06796283f, + 0.04884845f, 0.01112272f, -0.07835306f, -1.14811445e-003f, + -0.03440760f, 0.02845243f, 0.07695542f, -0.07069533f, -0.01151784f, + -8.53884313e-003f, -0.01662786f, -0.04163864f, 0.05400505f, + 0.02859163f, 0.02921852f, 0.05003135f, -6.85718050e-003f, -0.01632611f, + 0.07780217f, 0.04042810f, -0.01216440f, 3.60914599e-003f, -0.06322435f, + 0.09516726f, 0.12877031f, -9.69162490e-003f, 0.01031179f, 0.05180895f, + -9.34659224e-003f, -0.01644533f, -0.04849347f, -0.04343236f, + 0.10514783f, 0.08046635f, -0.04615205f, -0.03975486f, -0.01485525f, + 0.13096830f, -0.01517950f, -0.06571898f, -0.04016372f, 0.01849786f, + 0.02439670f, 0.08067258f, 1.74824719e-003f, 0.07053747f, 0.08819518f, + -5.08352555e-003f, -0.06550863f, -0.08266170f, -0.07780605f, + 0.01453450f, -0.08756890f, 0.01096501f, -8.71319138e-003f, 0.10110464f, + 0.02420769f, -0.06708383f, 0.02007811f, 5.93133038e-003f, 0.05398923f, + 0.07538138f, 0.02049227f, 0.02242589f, 0.04011070f, -1.44875818e-003f, + -4.19115182e-003f, 0.06367654f, 0.02506934f, 0.02434536f, 0.05879405f, + -8.22952855e-003f, -0.01242441f, 0.04224926f, -0.01754923f, + 0.05958161f, 0.03818886f, -0.01830363f, -0.04308917f, -0.04422197f, + -0.02432721f, 0.02264866f, 2.03751423e-003f, 0.01197031f, 0.04439203f, + 0.12169247f, 0.03602713f, -0.02599251f, -1.98226492e-003f, 0.02046336f, + -0.02639058f, -1.91242550e-003f, -0.09334669f, -0.03595153f, + -9.88179818e-003f, -0.06848445f, -0.04666303f, -0.09955736f, + -0.04206430f, 0.02609075f, 9.09005292e-003f, -0.07138551f, + -4.22313227e-004f, 0.01766645f, 0.02756404f, 0.01308276f, 0.04052891f, + 0.02387515f, 0.05337298f, 0.02500631f, -0.04970853f, -0.12467445f, + 0.17604403f, 0.12256411f, -0.07512254f, 8.70451052e-003f, -0.05697548f, + -0.03626474f, -8.76623299e-003f, -0.01210897f, -0.09451522f, + 0.07490732f, -0.02008001f, -0.02681278f, -0.06463405f, -0.01517507f, + 7.33757764e-003f, 6.07147906e-003f, -0.09316964f, -0.04575328f, + 0.13261597f, 0.15424870f, -0.01655918f, -0.02772390f, -0.05243644f, + -0.02356456f, -0.02351753f, -0.10211615f, -0.12873036f, 0.14549787f, + 0.12519856f, 4.38762689e-003f, 0.02795992f, 0.05170322f, 0.09223596f, + 0.05890015f, 0.02376701f, -0.02777346f, 0.09506908f, 0.02328936f, + -0.02319928f, -0.03218696f, -0.01527841f, -0.01016694f, -0.02674719f, + 0.05137179f, 0.01980666f, 0.06544447f, -0.01746171f, 0.01026380f, + 0.01561806f, 7.97004555e-004f, 0.07601810f, 0.01907250f, -0.03083035f, + -0.05987392f, 0.09242783f, 0.14555025f, 0.01035827f, 0.03092401f, + -0.09562709f, -0.03802354f, 0.02531144f, 0.03079449f, -0.07100715f, + 0.03330721f, -2.69116857e-003f, 0.03167490f, 0.05744999f, 0.03259895f, + 1.91266940e-003f, 0.03194578f, 0.07389776f, 0.02198060f, 0.07633314f, + 0.03293105f, -0.09103648f, 0.04718142f, 0.06102672f, -0.01003063f, + 5.85481385e-003f, -0.01522574f, 0.02323526f, 0.10584345f, + 4.35879454e-003f, 0.06107873f, 0.05868603f, -0.03115531f, 0.01214679f, + 0.08567052f, 3.93926632e-003f, -0.02521488f, -1.88425183e-003f, + 0.02038053f, -6.26854831e-004f, 0.04897438f, -0.04280585f, + -0.04819689f, -0.04812867f, -0.01451186f, 0.05101469f, + -9.01125465e-003f, -0.03333859f, 0.03917955f, 0.04196448f, 0.04292135f, + 0.02809529f, 0.02999715f, 0.04081348f, 9.10039060e-003f, 0.09703232f, + 0.10379741f, 0.02348725f, -4.72756615e-003f, 0.01027325f, 0.10402658f, + 0.12071823f, 0.09817299f, -0.02612033f, 0.03638414f, 0.05896405f, + 0.04865025f, 0.04793910f, -0.03882321f, -0.02962117f, -0.01222268f, + 0.04071597f, 0.01922777f, -0.02287866f, 0.03328381f, 0.01859092f, + 0.09024994f, 0.03804455f, -0.01424510f, 0.01953739f, 0.02509617f, + -0.03390914f, -0.05663941f, -0.01641979f, 0.05848591f, 0.04639670f, + 0.02092116f, 0.12911791f, 0.19918139f, 0.07739855f, -7.25806039e-003f, + 0.04074838f, 0.03183993f, 1.39251316e-003f, -0.01428625f, 0.01865480f, + 0.08529541f, 0.13547510f, 0.11189661f, 0.03998901f, 0.09575938f, + -0.02631102f, -0.03458253f, -0.04749985f, -0.06070716f, + 4.71884012e-003f, 0.06445789f, -0.02450038f, -0.05483776f, + -0.04657237f, -0.02030717f, -0.03480766f, -0.09397731f, -0.06399718f, + -0.01804585f, 5.62348310e-003f, -6.64811488e-003f, -0.06517869f, + 6.96210237e-003f, -0.01860148f, -0.04245830f, -0.05850367f, + -3.24417115e-003f, 0.07700698f, 0.11290991f, 0.09923030f, -0.02970599f, + 0.05592411f, 0.04813979f, -0.09811195f, -0.09357996f, -0.03276114f, + 0.05218338f, 0.04141375f, 3.92977800e-003f, -0.05047480f, 0.15960084f, + 0.04612800f, -0.03114098f, -0.04650044f, -0.03249795f, -0.02425641f, + -0.04311355f, 0.04307659f, -0.09401883f, -0.04742785f, -0.01254499f, + -0.06598741f, 3.41369561e-003f, -0.05620445f, -7.28127593e-003f, + -0.05998361f, -0.03274450f, -0.07376868f, 3.19015374e-003f, + -0.07733069f, 0.05815864f, -0.02471071f, 0.03850617f, 0.13838784f, + 0.15399861f, 0.01731321f, -0.01477586f, 0.10393341f, 0.05159833f, + -0.01945555f, -0.03427503f, -0.04867341f, 0.09237480f, 0.10732719f, + 0.06071450f, -0.01355071f, 0.01844356f, -0.03480803f, -0.03796671f, + 2.15628621e-004f, -0.05440186f, 0.01889855f, -0.01443413f, + -0.02607902f, -0.02938001f, 0.02720689f, -0.06228397f, -0.02970936f, + -0.03426210f, -0.10280876f, -0.06739304f, -0.05227850f, 0.03360292f, + -0.11278441f, -0.06966180f, -0.13937433f, 9.10932291e-003f, + 2.52020749e-004f, -4.07359656e-003f, 0.12310639f, 0.09343060f, + 0.07302511f, 0.03222093f, 0.07532879f, 0.03792387f, -0.04985180f, + 0.01804602f, 0.02694195f, 0.13481498f, 0.04601225f, 0.04106982f, + 0.08511057f, 0.12314661f, 0.01320830f, 0.05044121f, -5.52943908e-003f, + -0.08992624f, -0.02249301f, -0.08181777f, 0.06165213f, -0.03256603f, + -0.01068920f, -0.01323473f, -0.11970232f, -0.04616347f, -0.12088681f, + -0.06762606f, -0.08676834f, -0.06434575f, 0.01772529f, 0.03469615f, + -0.10926618f, 0.03013873f, 0.14030397f, 0.16130108f, 0.17985588f, + 0.11281928f, 0.10530639f, 0.08905948f, 0.07733764f, 0.06695238f, + 0.02142088f, 0.06438877f, 0.09794453f, 0.05745072f, 0.02788557f, + 0.02632830f, 0.07985807f, 4.24902979e-003f, 8.47890321e-003f, + -0.02679466f, -5.28812688e-003f, -0.02162580f, -0.07490715f, + -0.08251337f, -0.02056576f, -0.01026194f, -1.15492963e-003f, + -5.75720915e-004f, -0.07210591f, -0.07320981f, -0.04883312f, + -0.10897151f, -0.07477258f, -0.08867134f, -0.09222437f, -0.10924666f, + -0.10430276f, 0.07953499f, 0.02767959f, 0.11393359f, 0.18779543f, + 0.03313421f, 0.02143700f, 0.05852016f, -2.12067598e-003f, + -3.76984011e-003f, 0.02774167f, -0.03124610f, 0.01465141f, 0.01616004f, + -0.01391913f, -0.04404102f, -0.05444227f, -0.14684731f, -0.15016587f, + 0.04509468f, 1.29563001e-003f, 0.01398350f, 0.05610404f, -0.04868806f, + -0.04776716f, -8.16873740e-003f, -2.30126386e-003f, -0.02286313f, + 0.11983398f, -0.04703261f, -0.08814441f, -0.07585249f, -0.10799607f, + -0.03232087f, 0.01509786f, -0.04843464f, -0.03967846f, 0.09589416f, + 0.01352560f, -0.01458119f, 0.01050829f, -0.03038946f, 0.01608388f, + 1.11975556e-003f, -0.01250656f, 2.86211423e-003f, 0.04333691f, + -0.14603497f, -0.01946543f, -0.02327525f, -0.01973944f, 0.07944400f, + -0.02224544f, -0.06701808f, 0.03476532f, 0.11505594f, -0.02712801f, + -0.01665113f, 0.06315716f, -0.08205860f, 0.07431999f, 0.04915778f, + -0.04468752f, -0.01490402f, 0.07400476f, -0.11650901f, 0.05102430f, + 0.04559118f, -0.05916039f, 0.08840760f, -0.01587902f, -0.14890194f, + 0.07857784f, 0.04710254f, -0.05381983f, -0.07331945f, -0.03604643f, + 0.15611970f, 0.07649943f, -0.05959348f, -0.02776607f, 0.11098688f, + 0.03758875f, -0.04446875f, 0.04933187f, 0.01345535f, 0.06921103f, + 0.07364785f, 0.05518956f, 0.02899585f, 0.09375840f, 0.10518434f, + -0.04420241f, 0.01915282f, -3.56386811e-003f, 0.14586878f, 0.10286101f, + -0.04360626f, -0.12723237f, 0.09076386f, 0.11119842f, -0.06035013f, + 0.09674817f, 0.08938243f, 0.07065924f, 0.02603180f, 5.84815582e-003f, + -0.05922065f, 0.12360309f, 3.59695964e-003f, 2.99844006e-003f, + 0.03697936f, 0.02043072f, 0.04168725f, 0.01025975f, -0.01359980f, + -0.01600920f, 0.02581056f, 0.02329250f, 2.98100687e-003f, 0.01629762f, + 0.06652115f, 0.05855627f, 0.01237463f, -0.01297135f, 0.01761587f, + 0.05090865f, 0.06549342f, -0.04425945f, 2.43203156e-003f, + 3.07327788e-003f, 0.06678630f, -0.04303836f, 0.01082393f, -0.06476044f, + 0.04077786f, 0.12441979f, 0.08237778f, 0.07424165f, 0.04065890f, + 0.06905543f, 0.09556347f, 0.12724875f, -0.02132082f, 0.08514154f, + -0.04175328f, -0.02666954f, 0.01897836f, 0.03317382f, 9.45465732e-003f, + -0.01238974f, -0.04242500f, -0.01419479f, -0.03545213f, -0.02440874f, + 0.08684119f, 0.04212951f, 0.02462858f, -0.01104825f, -5.01706870e-003f, + 0.02968982f, 0.02597476f, -0.01568939f, 0.04514892f, 0.06974549f, + 0.08670278f, 0.06828108f, 0.10238872f, 0.05405957f, 0.06548470f, + -0.03763957f, 0.01366090f, 0.07069602f, 0.05363748f, 0.04798120f, + 0.11706422f, 0.05466456f, -0.01869259f, 0.06344382f, 0.03106543f, + 0.08432506f, -0.02061096f, 0.03821088f, -6.92190882e-003f, + 6.40467042e-003f, -0.01271779f, 6.89014705e-005f, 0.04541415f, + -0.01899539f, -0.05020239f, 0.03000903f, 0.01090422f, 4.52452758e-003f, + 0.02573632f, -0.02388454f, -0.04200457f, 1.72783900e-003f, + -0.05978370f, -0.02720562f, 0.06573715f, 0.01154317f, 0.01265615f, + 0.07375994f, -9.19828378e-003f, -0.04914120f, 0.02124831f, 0.06455322f, + 0.04372910f, -0.03310043f, 0.03605788f, -6.78055827e-003f, + 9.36202332e-003f, 0.01747596f, -0.06406314f, -0.06812935f, 0.08080816f, + -0.02778088f, 0.02735260f, 0.06393493f, 0.06652229f, 0.05676993f, + 0.08640018f, -7.59188086e-003f, -0.02012847f, -0.04741159f, + -0.01657069f, -0.01624399f, 0.05547778f, -2.33309763e-003f, + 0.01120033f, 0.06141156f, -0.06285004f, -0.08732341f, -0.09313398f, + -0.04267832f, 5.57443965e-003f, 0.04809862f, 0.01773641f, + 5.37361018e-003f, 0.14842421f, -0.06298012f, -0.02935147f, 0.11443478f, + -0.05034208f, 5.65494271e-003f, 0.02076526f, -0.04577984f, + -0.04735741f, 0.02961071f, -0.09307127f, -0.04417921f, -0.04990027f, + -0.03940028f, 0.01306016f, 0.06267900f, 0.03758737f, 0.08460117f, + 0.13858789f, 0.04862388f, -0.06319809f, -0.05655516f, 0.01885816f, + -0.03285607f, 0.03371567f, -0.07040928f, -0.04514049f, 0.01392166f, + 0.08184422f, -0.07230316f, 0.02386871f, 0.02184591f, 0.02605764f, + -0.01033954f, 9.29878280e-003f, 7.67351175e-003f, 0.15189242f, + 0.02069071f, -0.09738296f, -0.08894105f, -0.07768748f, 0.02332268f, + -0.01778995f, -0.03258888f, -0.08180822f, -0.08492987f, 0.02290156f, + -0.11368170f, -0.03554465f, -0.04533844f, -0.02861580f, 0.06782424f, + 0.01113123f, 0.02453644f, 0.12721945f, 0.08084814f, -0.03607795f, + 0.01109122f, 0.04803548f, -0.03489929f, 0.03399536f, -0.05682014f, + 8.59533902e-003f, -4.27904585e-003f, 0.03230887f, -0.01300198f, + -0.01038137f, -0.07930113f, 8.33097473e-003f, 0.02296994f, + -0.01306500f, -0.01881626f, 0.04413369f, 0.05729880f, -0.03761553f, + 0.01942326f, 1.64540811e-003f, -0.03811319f, 0.04190650f, -0.14978096f, + -0.04514487f, 0.01209545f, -5.46460645e-003f, -0.01647195f, + 7.63064111e-003f, -0.07494587f, 0.08415288f, 0.10020141f, -0.01228561f, + 0.06553826f, 0.04554005f, 0.07890417f, 0.03041138f, 0.01752007f, + 0.09208256f, -3.74419295e-004f, 0.10549527f, 0.04686913f, 0.01894833f, + -0.02651412f, -4.34682379e-003f, 5.44942822e-003f, 0.01444484f, + 0.05882156f, -0.03336544f, 0.04603891f, -0.10432546f, 0.01923928f, + 0.01842845f, -0.01712168f, -0.02222766f, 0.04693324f, -0.06202956f, + -0.01422159f, 0.08732220f, -0.07706107f, 0.02661049f, -0.04300238f, + -0.03092422f, -0.03552184f, -0.01886088f, -0.04979934f, 0.03906401f, + 0.04608644f, 0.04966111f, 0.04275464f, -0.04621769f, -0.02653212f, + 8.57011229e-003f, 0.03839684f, 0.05818764f, 0.03880796f, + -2.76100676e-004f, 0.03076511f, -0.03266929f, -0.05374557f, + 0.04986527f, -9.45429131e-003f, 0.03582499f, -2.64564669e-003f, + -1.07461517e-003f, 0.02962313f, -0.01483363f, 0.03060869f, 0.02448327f, + 0.01845641f, 0.03282966f, -0.03534438f, -0.01084059f, -0.01119136f, + -1.85360224e-003f, -5.94652840e-004f, -0.04451817f, 2.98327743e-003f, + 0.06272484f, -0.02152076f, -3.05971340e-003f, -0.05070828f, + 0.01531762f, 0.01282815f, 0.05167150f, 9.46266949e-003f, + -3.34558333e-003f, 0.11442288f, -0.03906701f, -2.67325155e-003f, + 0.03069184f, -0.01134165f, 0.02949462f, 0.02879886f, 0.03855566f, + -0.03450781f, 0.09142872f, -0.02156654f, 0.06075062f, -0.06220816f, + 0.01944680f, 6.68372354e-003f, -0.06656796f, 8.70784000e-003f, + 0.03456013f, 0.02434320f, -0.13236357f, -0.04177035f, -0.02069627f, + 0.01068112f, 0.01505432f, -0.07517391f, -3.83571628e-003f, + -0.06298508f, -0.02881260f, -0.13101046f, -0.07221562f, + -5.79945277e-003f, -8.57300125e-003f, 0.03782469f, 0.02762164f, + 0.04942456f, -0.02936396f, 0.09597211f, 0.01921411f, 0.06101191f, + -0.04787507f, -0.01379578f, -7.40224449e-003f, -0.02220136f, + -0.01313756f, 7.77558051e-003f, 0.12296968f, 0.02939998f, 0.03594062f, + -0.07788624f, -0.01133144f, 3.99316690e-004f, -0.06090347f, + -0.01122066f, -4.68682544e-003f, 0.07633100f, -0.06748922f, + -0.05640298f, -0.05265681f, -0.01139122f, -0.01624347f, -0.04715714f, + -0.01099092f, 0.01048561f, 3.28499987e-003f, -0.05810167f, + -0.07699911f, -0.03330683f, 0.04185145f, 0.03478536f, 0.02275165f, + 0.02304766f, 6.66040834e-003f, 0.10968148f, -5.93013782e-003f, + -0.04858336f, -0.04203213f, -0.09316786f, -6.13074889e-003f, + -0.02544625f, 0.01366201f, 9.18555818e-003f, -0.01846578f, + -0.05622401f, -0.03989377f, -0.07810296f, 6.91275718e-003f, + 0.05957597f, -0.03901334f, 0.01572002f, -0.01193903f, + -6.89400872e-003f, -0.03093356f, -0.04136098f, -0.01562869f, + -0.04604580f, 0.02865234f, -0.08678447f, -0.03232484f, -0.05364593f, + -0.01445016f, -0.07003860f, -0.08669746f, -0.04520775f, 0.04274122f, + 0.03117515f, 0.08175703f, 0.01081109f, 0.06379741f, 0.06199206f, + 0.02865988f, 0.02360346f, 0.06725410f, -0.03248780f, -9.37702879e-003f, + 0.08265898f, -0.02245839f, 0.05125763f, -0.01862395f, 0.01973453f, + -0.01994494f, -0.10770868f, 0.03180375f, 3.23935156e-003f, + -0.02142080f, -0.04256190f, 0.04760900f, 0.04282863f, 0.05635953f, + -0.01870849f, 0.05540622f, -0.03042666f, 0.01455277f, -0.06630179f, + -0.05843807f, -0.03739681f, -0.09739155f, -0.03220233f, -0.05620182f, + -0.10381401f, 0.07400211f, 4.20676917e-003f, 0.03258535f, + 2.14308966e-003f, 0.05121966f, -0.01274337f, 0.02384761f, 0.06335578f, + -0.07905591f, 0.08375625f, -0.07898903f, -0.06508528f, -0.02498444f, + 0.06535810f, 0.03970535f, 0.04895468f, -0.01169566f, -0.03980601f, + 0.05682293f, 0.05925463f, -0.01165808f, -0.07936699f, -0.04208954f, + 0.01333987f, 0.09051196f, 0.10098671f, -0.03974256f, 0.01238771f, + -0.07501741f, -0.03655440f, -0.04301528f, 0.09216860f, + 4.63579083e-004f, 0.02851115f, 0.02142735f, 1.28244064e-004f, + 0.02879687f, -0.08554889f, -0.04838862f, 0.08135369f, -0.05756533f, + 0.01413900f, 0.03451880f, -0.06619488f, -0.03053130f, 0.02961676f, + -0.07384635f, 0.01135692f, 0.05283910f, -0.07778034f, -0.02107482f, + -0.05511716f, -0.13473752f, 0.03030157f, 0.06722020f, -0.06218817f, + -0.05826827f, 0.06254654f, 0.02895772f, -0.01664000f, -0.03620280f, + -0.01612278f, -1.46097376e-003f, 0.14013411f, -8.96181818e-003f, + -0.03250246f, 3.38630192e-003f, 2.64779478e-003f, 0.03359732f, + -0.02411991f, -0.04229729f, 0.10666174f, -6.66579151f + }; + #endregion + + #region DaimlerPeopleDetector + /// + /// This field returns 1981 SVM coeffs obtained from daimler's base. + /// To use these coeffs the detection window size should be (48,96) + /// + public static readonly float[] DaimlerPeopleDetector = + { + 0.294350f, -0.098796f, -0.129522f, 0.078753f, + 0.387527f, 0.261529f, 0.145939f, 0.061520f, + 0.328699f, 0.227148f, -0.066467f, -0.086723f, + 0.047559f, 0.106714f, 0.037897f, 0.111461f, + -0.024406f, 0.304769f, 0.254676f, -0.069235f, + 0.082566f, 0.147260f, 0.326969f, 0.148888f, + 0.055270f, -0.087985f, 0.261720f, 0.143442f, + 0.026812f, 0.238212f, 0.194020f, 0.056341f, + -0.025854f, -0.034444f, -0.156631f, 0.205174f, + 0.089008f, -0.139811f, -0.100147f, -0.037830f, + -0.029230f, -0.055641f, 0.033248f, -0.016512f, + 0.155244f, 0.247315f, -0.124694f, -0.048414f, + -0.062219f, 0.193683f, 0.004574f, 0.055089f, + 0.093565f, 0.167712f, 0.167581f, 0.018895f, + 0.215258f, 0.122609f, 0.090520f, -0.067219f, + -0.049029f, -0.099615f, 0.241804f, -0.094893f, + -0.176248f, 0.001727f, -0.134473f, 0.104442f, + 0.050942f, 0.081165f, 0.072156f, 0.121646f, + 0.002656f, -0.297974f, -0.133587f, -0.060121f, + -0.092515f, -0.048974f, -0.084754f, -0.180111f, + -0.038590f, 0.086283f, -0.134636f, -0.107249f, + 0.132890f, 0.141556f, 0.249425f, 0.130273f, + -0.030031f, 0.073212f, -0.008155f, 0.019931f, + 0.071688f, 0.000300f, -0.019525f, -0.021725f, + -0.040993f, -0.086841f, 0.070124f, 0.240033f, + 0.265350f, 0.043208f, 0.166754f, 0.091453f, + 0.060916f, -0.036972f, -0.091043f, 0.079873f, + 0.219781f, 0.158102f, -0.140618f, -0.043016f, + 0.124802f, 0.093668f, 0.103208f, 0.094872f, + 0.080541f, 0.137711f, 0.160566f, -0.169231f, + 0.013983f, 0.309508f, -0.004217f, -0.057200f, + -0.064489f, 0.014066f, 0.361009f, 0.251328f, + -0.080983f, -0.044183f, 0.061436f, -0.037381f, + -0.078786f, 0.030993f, 0.066314f, 0.037683f, + 0.152325f, -0.091683f, 0.070203f, 0.217856f, + 0.036435f, -0.076462f, 0.006254f, -0.094431f, + 0.154829f, -0.023038f, -0.196961f, -0.024594f, + 0.178465f, -0.050139f, -0.045932f, -0.000965f, + 0.109112f, 0.046165f, -0.159373f, -0.008713f, + 0.041307f, 0.097129f, -0.057211f, -0.064599f, + 0.077165f, 0.176167f, 0.138322f, 0.065753f, + -0.104950f, 0.017933f, 0.136255f, -0.011598f, + 0.047007f, 0.080550f, 0.068619f, 0.084661f, + -0.035493f, -0.091314f, -0.041411f, 0.060971f, + -0.101912f, -0.079870f, -0.085977f, -0.022686f, + 0.079788f, -0.098064f, -0.054603f, 0.040383f, + 0.300794f, 0.128603f, 0.094844f, 0.047407f, + 0.101825f, 0.061832f, -0.162160f, -0.204553f, + -0.035165f, 0.101450f, -0.016641f, -0.027140f, + -0.134392f, -0.008743f, 0.102331f, 0.114853f, + 0.009644f, 0.062823f, 0.237339f, 0.167843f, + 0.053066f, -0.012592f, 0.043158f, 0.002305f, + 0.065001f, -0.038929f, -0.020356f, 0.152343f, + 0.043469f, -0.029967f, -0.042948f, 0.032481f, + 0.068488f, -0.110840f, -0.111083f, 0.111980f, + -0.002072f, -0.005562f, 0.082926f, 0.006635f, + -0.108153f, 0.024242f, -0.086464f, -0.189884f, + -0.017492f, 0.191456f, -0.007683f, -0.128769f, + -0.038017f, -0.132380f, 0.091926f, 0.079696f, + -0.106728f, -0.007656f, 0.172744f, 0.011576f, + 0.009883f, 0.083258f, -0.026516f, 0.145534f, + 0.153924f, -0.130290f, -0.108945f, 0.124490f, + -0.003186f, -0.100485f, 0.015024f, -0.060512f, + 0.026288f, -0.086713f, -0.169012f, 0.076517f, + 0.215778f, 0.043701f, -0.131642f, -0.012585f, + -0.045181f, -0.118183f, -0.241544f, -0.167293f, + -0.020107f, -0.019917f, -0.101827f, -0.107096f, + -0.010503f, 0.044938f, 0.189680f, 0.217119f, + -0.046086f, 0.044508f, 0.199716f, -0.036004f, + -0.148927f, 0.013355f, -0.078279f, 0.030451f, + 0.056301f, -0.024609f, 0.083224f, 0.099533f, + -0.039432f, -0.138880f, 0.005482f, -0.024120f, + -0.140468f, -0.066381f, -0.017057f, 0.009260f, + -0.058004f, -0.028486f, -0.061610f, 0.007483f, + -0.158309f, -0.150687f, -0.044595f, -0.105121f, + -0.045763f, -0.006618f, -0.024419f, -0.117713f, + -0.119366f, -0.175941f, -0.071542f, 0.119027f, + 0.111362f, 0.043080f, 0.034889f, 0.093003f, + 0.007842f, 0.057368f, -0.108834f, -0.079968f, + 0.230959f, 0.020205f, 0.011470f, 0.098877f, + 0.101310f, -0.030215f, -0.018018f, -0.059552f, + -0.106157f, 0.021866f, -0.036471f, 0.080051f, + 0.041165f, -0.082101f, 0.117726f, 0.030961f, + -0.054763f, -0.084102f, -0.185778f, -0.061305f, + -0.038089f, -0.110728f, -0.264010f, 0.076675f, + -0.077111f, -0.137644f, 0.036232f, 0.277995f, + 0.019116f, 0.107738f, 0.144003f, 0.080304f, + 0.215036f, 0.228897f, 0.072713f, 0.077773f, + 0.120168f, 0.075324f, 0.062730f, 0.122478f, + -0.049008f, 0.164912f, 0.162450f, 0.041246f, + 0.009891f, -0.097827f, -0.038700f, -0.023027f, + -0.120020f, 0.203364f, 0.248474f, 0.149810f, + -0.036276f, -0.082814f, -0.090343f, -0.027143f, + -0.075689f, -0.320310f, -0.000500f, -0.143334f, + -0.065077f, -0.186936f, 0.129372f, 0.116431f, + 0.181699f, 0.170436f, 0.418854f, 0.460045f, + 0.333719f, 0.230515f, 0.047822f, -0.044954f, + -0.068086f, 0.140179f, -0.044821f, 0.085550f, + 0.092483f, -0.107296f, -0.130670f, -0.206629f, + 0.114601f, -0.317869f, -0.076663f, 0.038680f, + 0.212753f, -0.016059f, -0.126526f, -0.163602f, + 0.210154f, 0.099887f, -0.126366f, 0.118453f, + 0.019309f, -0.021611f, -0.096499f, -0.111809f, + -0.200489f, 0.142854f, 0.228840f, -0.353346f, + -0.179151f, 0.116834f, 0.252389f, -0.031728f, + -0.188135f, -0.158998f, 0.386523f, 0.122315f, + 0.209944f, 0.394023f, 0.359030f, 0.260717f, + 0.170335f, 0.013683f, -0.142596f, -0.026138f, + -0.011878f, -0.150519f, 0.047159f, -0.107062f, + -0.147347f, -0.187689f, -0.186027f, -0.208048f, + 0.058468f, -0.073026f, -0.236556f, -0.079788f, + -0.146216f, -0.058563f, -0.101361f, -0.071294f, + -0.071093f, 0.116919f, 0.234304f, 0.306781f, + 0.321866f, 0.240000f, 0.073261f, -0.012173f, + 0.026479f, 0.050173f, 0.166127f, 0.228955f, + 0.061905f, 0.156460f, 0.205990f, 0.120672f, + 0.037350f, 0.167884f, 0.290099f, 0.420900f, + -0.012601f, 0.189839f, 0.306378f, 0.118383f, + -0.095598f, -0.072360f, -0.132496f, -0.224259f, + -0.126021f, 0.022714f, 0.284039f, 0.051369f, + -0.000927f, -0.058735f, -0.083354f, -0.141254f, + -0.187578f, -0.202669f, 0.048902f, 0.246597f, + 0.441863f, 0.342519f, 0.066979f, 0.215286f, + 0.188191f, -0.072240f, -0.208142f, -0.030196f, + 0.178141f, 0.136985f, -0.043374f, -0.181098f, + 0.091815f, 0.116177f, -0.126690f, -0.386625f, + 0.368165f, 0.269149f, -0.088042f, -0.028823f, + 0.092961f, 0.024099f, 0.046112f, 0.176756f, + 0.135849f, 0.124955f, 0.195467f, -0.037218f, + 0.167217f, 0.188938f, 0.053528f, -0.066561f, + 0.133721f, -0.070565f, 0.115898f, 0.152435f, + -0.116993f, -0.110592f, -0.179005f, 0.026668f, + 0.080530f, 0.075084f, -0.070401f, 0.012497f, + 0.021849f, -0.139764f, -0.022020f, -0.096301f, + -0.064954f, -0.127446f, -0.013806f, -0.108315f, + 0.156285f, 0.149867f, -0.011382f, 0.064532f, + 0.029168f, 0.027393f, 0.069716f, 0.153735f, + 0.038459f, 0.230714f, 0.253840f, 0.059522f, + -0.045053f, 0.014083f, 0.071103f, 0.068747f, + 0.095887f, 0.005832f, 0.144887f, 0.026357f, + -0.067359f, -0.044151f, -0.123283f, -0.019911f, + 0.005318f, 0.109208f, -0.003201f, -0.021734f, + 0.142025f, -0.066907f, -0.120070f, -0.188639f, + 0.012472f, -0.048704f, -0.012366f, -0.184828f, + 0.168591f, 0.267166f, 0.058208f, -0.044101f, + 0.033500f, 0.178558f, 0.104550f, 0.122418f, + 0.080177f, 0.173246f, 0.298537f, 0.064173f, + 0.053397f, 0.174341f, 0.230984f, 0.117025f, + 0.166242f, 0.227781f, 0.120623f, 0.176952f, + -0.011393f, -0.086483f, -0.008270f, 0.051700f, + -0.153369f, -0.058837f, -0.057639f, -0.060115f, + 0.026349f, -0.160745f, -0.037894f, -0.048575f, + 0.041052f, -0.022112f, 0.060365f, 0.051906f, + 0.162657f, 0.138519f, -0.050185f, -0.005938f, + 0.071301f, 0.127686f, 0.062342f, 0.144400f, + 0.072600f, 0.198436f, 0.246219f, -0.078185f, + -0.036169f, 0.075934f, 0.047328f, -0.013601f, + 0.087205f, 0.019900f, 0.022606f, -0.015365f, + -0.092506f, 0.075275f, -0.116375f, 0.050500f, + 0.045118f, 0.166567f, 0.072073f, 0.060371f, + 0.131747f, -0.169863f, -0.039352f, -0.047486f, + -0.039797f, -0.204312f, 0.021710f, 0.129443f, + -0.021173f, 0.173416f, -0.070794f, -0.063986f, + 0.069689f, -0.064099f, -0.123201f, -0.017372f, + -0.206870f, 0.065863f, 0.113226f, 0.024707f, + -0.071341f, -0.066964f, -0.098278f, -0.062927f, + 0.075840f, 0.014716f, 0.019378f, 0.132699f, + -0.074191f, -0.089557f, -0.078446f, -0.197488f, + -0.173665f, 0.052583f, 0.044361f, 0.113549f, + 0.098492f, 0.077379f, -0.011146f, -0.192593f, + -0.164435f, 0.045568f, 0.205699f, 0.049187f, + -0.082281f, 0.134874f, 0.185499f, 0.034968f, + -0.119561f, -0.112372f, -0.115091f, -0.054042f, + -0.183816f, -0.078100f, 0.190695f, 0.091617f, + 0.004257f, -0.041135f, -0.061453f, -0.141592f, + -0.194809f, -0.120638f, 0.020168f, 0.109672f, + 0.067398f, -0.015238f, -0.239145f, -0.264671f, + -0.185176f, 0.050472f, 0.020793f, 0.035678f, + 0.022839f, -0.052055f, -0.127968f, -0.113049f, + -0.228416f, -0.258281f, -0.053437f, 0.076424f, + 0.061450f, 0.237478f, 0.003618f, -0.055865f, + -0.108087f, -0.028937f, 0.045585f, 0.052829f, + -0.001471f, 0.022826f, 0.059565f, -0.104430f, + -0.077266f, -0.211882f, -0.212078f, 0.028074f, + 0.075846f, 0.016265f, 0.161879f, 0.134477f, + 0.008935f, -0.048041f, 0.074692f, 0.004928f, + -0.025156f, 0.192874f, 0.074410f, 0.308732f, + 0.267400f, 0.094208f, -0.005251f, 0.042041f, + -0.032148f, 0.015588f, 0.252869f, 0.175302f, + 0.022892f, 0.081673f, 0.063208f, 0.162626f, + 0.194426f, 0.233890f, 0.262292f, 0.186930f, + 0.084079f, -0.286388f, -0.213034f, -0.048867f, + -0.207669f, -0.170050f, 0.011673f, -0.092958f, + -0.192786f, -0.273536f, 0.230904f, 0.266732f, + 0.320519f, 0.297155f, 0.548169f, 0.304922f, + 0.132687f, 0.247333f, 0.212488f, -0.271472f, + -0.142105f, -0.002627f, -0.119215f, 0.128383f, + 0.100079f, -0.057490f, -0.121902f, -0.228892f, + 0.202292f, -0.399795f, -0.371326f, -0.095836f, + -0.063626f, -0.161375f, -0.311180f, -0.294797f, + 0.242122f, 0.011788f, 0.095573f, 0.322523f, + 0.511840f, 0.322880f, 0.313259f, 0.173331f, + 0.002542f, -0.029802f, 0.324766f, -0.326170f, + -0.340547f, -0.138288f, -0.002963f, -0.114060f, + -0.377312f, -0.442570f, 0.212446f, -0.007759f, + -0.011576f, 0.169711f, 0.308689f, 0.317348f, + 0.539390f, 0.332845f, 0.057331f, -0.068180f, + 0.101994f, 0.266995f, 0.209570f, 0.355730f, + 0.091635f, 0.170238f, 0.125215f, 0.274154f, + 0.070223f, 0.025515f, 0.049946f, -0.000550f, + 0.043715f, -0.141843f, 0.020844f, 0.129871f, + 0.256588f, 0.105015f, 0.148339f, 0.170682f, + 0.028792f, 0.074037f, 0.160042f, 0.405137f, + 0.246187f, 0.352160f, 0.168951f, 0.222263f, + 0.264439f, 0.065945f, 0.021963f, -0.075084f, + 0.093105f, 0.027318f, 0.098864f, 0.057566f, + -0.080282f, 0.185032f, 0.314419f, 0.333727f, + 0.125798f, 0.294919f, 0.386002f, 0.217619f, + -0.183517f, -0.278622f, -0.002342f, -0.027821f, + -0.134266f, -0.331843f, -0.008296f, 0.124564f, + 0.053712f, -0.369016f, -0.095036f, 0.209381f, + 0.423760f, 0.371760f, 0.106397f, 0.369408f, + 0.485608f, 0.231201f, -0.138685f, -0.349208f, + -0.070083f, 0.028991f, -0.081630f, -0.395992f, + -0.146791f, -0.027354f, 0.063396f, -0.272484f, + 0.058299f, 0.338207f, 0.110767f, -0.052642f, + -0.233848f, -0.027448f, 0.030328f, 0.155572f, + -0.093826f, 0.019331f, 0.120638f, 0.006292f, + -0.106083f, -0.236290f, -0.140933f, -0.088067f, + -0.025138f, -0.208395f, -0.025502f, 0.144192f, + -0.048353f, -0.106144f, -0.305121f, -0.114147f, + 0.090963f, 0.327727f, 0.035606f, -0.093779f, + 0.002651f, -0.171081f, -0.188131f, -0.216571f, + -0.209101f, -0.054402f, 0.157147f, -0.057127f, + 0.066584f, 0.008988f, 0.041191f, 0.034456f, + -0.078255f, 0.052099f, -0.022239f, 0.066981f, + -0.117520f, -0.072637f, 0.062512f, 0.037570f, + -0.057544f, -0.312359f, 0.034357f, -0.031549f, + 0.002566f, -0.207375f, -0.070654f, -0.018786f, + -0.044815f, -0.012814f, -0.076320f, 0.078183f, + 0.023877f, 0.117078f, 0.022292f, -0.205424f, + -0.060430f, -0.017296f, -0.004827f, -0.321036f, + -0.092155f, 0.038837f, 0.073190f, -0.067513f, + 0.026521f, 0.171945f, 0.087318f, 0.034495f, + -0.034089f, 0.154410f, -0.061431f, 0.007435f, + -0.111094f, -0.095976f, 0.014741f, -0.132324f, + -0.029517f, -0.192160f, 0.098667f, 0.020762f, + 0.177050f, -0.064510f, -0.054437f, -0.058678f, + -0.001858f, 0.167602f, 0.015735f, 0.054338f, + 0.016477f, 0.186381f, -0.010667f, 0.054692f, + 0.126742f, 0.013140f, 0.090353f, -0.133608f, + -0.018017f, -0.152619f, 0.027600f, -0.138700f, + -0.050274f, 0.045141f, -0.118731f, 0.094797f, + -0.167605f, 0.097461f, -0.009131f, 0.199920f, + -0.052976f, 0.158194f, 0.178568f, -0.107600f, + 0.009671f, -0.084072f, -0.040258f, -0.205673f, + 0.102891f, 0.223511f, 0.042699f, 0.118548f, + -0.021274f, 0.110997f, -0.155121f, 0.027696f, + -0.149968f, 0.051552f, -0.129219f, 0.173524f, + 0.073972f, -0.189045f, -0.034523f, -0.106655f, + -0.011843f, -0.197381f, 0.219413f, 0.183197f, + -0.054920f, 0.144955f, 0.036517f, -0.085412f, + -0.229070f, -0.143710f, -0.049486f, 0.156634f, + -0.008673f, -0.064778f, 0.082344f, 0.145673f, + 0.002912f, -0.210121f, -0.116564f, 0.078425f, + 0.220908f, -0.067594f, 0.048610f, 0.084912f, + -0.066202f, -0.112515f, -0.217767f, -0.082640f, + -0.017414f, 0.230265f, -0.070735f, 0.066073f, + 0.215256f, 0.071157f, -0.087220f, -0.202235f, + -0.011918f, 0.099562f, 0.174716f, -0.063845f, + -0.121055f, 0.014367f, 0.132709f, -0.005060f, + -0.244606f, -0.179693f, -0.134690f, 0.023239f, + -0.193116f, -0.076975f, -0.021164f, -0.001938f, + -0.163799f, -0.111437f, -0.210362f, -0.166376f, + 0.034754f, 0.010036f, -0.021917f, 0.068014f, + -0.086893f, -0.251746f, -0.267171f, 0.037383f, + 0.003966f, 0.033571f, -0.151506f, 0.025437f, + -0.020626f, -0.308454f, -0.343143f, -0.092263f, + -0.026261f, -0.028345f, 0.036036f, 0.035169f, + 0.129470f, 0.122205f, 0.015661f, -0.070612f, + -0.094333f, -0.066055f, -0.041083f, 0.159146f, + 0.073184f, 0.110044f, 0.174471f, 0.078069f, + -0.014881f, 0.008116f, 0.013209f, 0.075857f, + 0.195605f, 0.062714f, 0.067955f, 0.056544f, + -0.153908f, -0.141749f, -0.072550f, 0.033523f, + -0.024665f, 0.134487f, 0.079076f, 0.133562f, + 0.227130f, 0.018054f, 0.004928f, 0.169162f, + 0.065152f, 0.072160f, 0.131631f, 0.096303f, + 0.054288f, 0.106256f, 0.114632f, 0.119038f, + 0.515200f, 0.247429f, 0.199134f, 0.211957f, + 0.127558f, -0.294684f, -0.194890f, -0.049988f, + -0.112247f, -0.008122f, -0.006176f, 0.037035f, + -0.110881f, -0.249989f, 0.152434f, 0.234621f, + 0.153340f, 0.349283f, 0.683049f, 0.157174f, + 0.124844f, 0.099136f, 0.064407f, -0.248400f, + -0.155323f, -0.026498f, -0.023450f, 0.049051f, + -0.114187f, 0.007195f, -0.176825f, -0.376926f, + 0.366159f, -0.179938f, -0.148508f, 0.006043f, + 0.170048f, 0.097866f, -0.102658f, -0.260430f, + 0.248868f, 0.037019f, -0.118111f, 0.078176f, + 0.194171f, 0.211328f, 0.368612f, 0.361213f, + 0.130013f, 0.094650f, 0.227396f, -0.178058f, + -0.114782f, -0.008093f, 0.231080f, -0.011843f, + -0.097917f, -0.325788f, 0.141879f, 0.119738f, + -0.230427f, -0.117419f, -0.114153f, 0.037903f, + 0.116383f, 0.218773f, -0.101884f, 0.059466f, + 0.119255f, 0.010874f, -0.031449f, 0.045996f, + 0.119931f, 0.273760f, 0.311700f, 0.261794f, + 0.194809f, 0.339829f, 0.239449f, 0.064140f, + 0.077597f, 0.098996f, 0.143534f, 0.184602f, + 0.037507f, 0.225494f, 0.096142f, -0.147370f, + -0.207833f, -0.174742f, -0.086391f, -0.038942f, + 0.159577f, -0.088492f, -0.000989f, 0.108154f, + -0.025890f, -0.072713f, 0.025997f, -0.006803f, + -0.086879f, -0.011290f, -0.269200f, -0.103450f, + -0.124910f, -0.116340f, 0.141459f, 0.208800f, + 0.042268f, 0.265034f, 0.516474f, 0.217591f, + -0.018843f, -0.313328f, -0.168363f, 0.047129f, + 0.090480f, -0.109852f, -0.018761f, 0.210669f, + 0.281269f, -0.043591f, -0.034147f, -0.237772f, + -0.134843f, -0.072481f, -0.103831f, 0.038355f, + 0.308619f, 0.148023f, -0.045867f, -0.123950f, + -0.210860f, -0.064973f, -0.036308f, -0.046731f, + -0.022099f, 0.095776f, 0.409423f, 0.060635f, + -0.065196f, 0.051828f, 0.027981f, -0.009609f, + -0.137681f, -0.095011f, -0.019045f, 0.177278f, + 0.009759f, -0.092119f, -0.016958f, -0.133860f, + -0.118421f, -0.032039f, -0.006214f, -0.084541f, + 0.063971f, -0.073642f, 0.165676f, 0.110443f, + 0.044131f, 0.046568f, 0.053292f, -0.055466f, + 0.015512f, 0.371947f, 0.232102f, -0.016923f, + 0.103979f, -0.091758f, 0.005907f, 0.209100f, + 0.157433f, 0.030518f, 0.250366f, 0.062322f, + 0.036720f, 0.094676f, 0.017306f, -0.010328f, + -0.079012f, 0.016781f, -0.112435f, 0.061795f, + 0.042543f, -0.126799f, -0.009975f, -0.056760f, + 0.046424f, -0.194712f, -0.139399f, -0.037731f, + 0.157989f, -0.016261f, 0.123345f, 0.230563f, + 0.083300f, -0.016392f, 0.059567f, -0.016035f, + -0.064767f, 0.231945f, 0.156629f, 0.034602f, + 0.145628f, 0.041315f, 0.034535f, 0.019967f, + -0.089188f, -0.012091f, 0.307857f, 0.211405f, + -0.025091f, -0.148249f, -0.129384f, 0.063536f, + -0.068603f, -0.067941f, -0.035104f, 0.210832f, + 0.063810f, 0.062764f, -0.089889f, -0.030554f, + 0.014791f, -0.053362f, -0.037818f, -0.196640f, + 0.008388f, -0.082654f, 0.143056f, 0.064221f, + 0.069795f, 0.191040f, 0.097321f, -0.028679f, + 0.075794f, 0.313154f, 0.086240f, 0.207643f, + 0.017809f, 0.122867f, 0.224586f, 0.167403f, + -0.023884f, 0.047434f, 0.344091f, 0.187745f, + 0.136177f, 0.141738f, 0.063799f, 0.045233f, + -0.077342f, -0.003525f, -0.165041f, -0.025616f, + -0.073745f, 0.164439f, 0.011200f, -0.145896f, + -0.027954f, -0.061987f, -0.039874f, -0.142775f, + 0.151042f, -0.038238f, 0.053152f, 0.078615f, + 0.086061f, 0.100593f, 0.128046f, -0.071006f, + -0.116558f, 0.208445f, 0.051086f, 0.076843f, + 0.023191f, -0.084781f, -0.011790f, 0.147807f, + -0.048554f, -0.113932f, 0.283322f, 0.190934f, + 0.092789f, 0.033018f, -0.142428f, -0.142480f, + -0.099023f, -0.041020f, -0.042760f, 0.203295f, + -0.053475f, 0.042424f, 0.222839f, -0.019167f, + -0.133176f, -0.276216f, -0.031998f, 0.117290f, + 0.177827f, -0.059973f, -0.064744f, -0.117040f, + -0.155482f, -0.099531f, 0.164121f, -0.026682f, + -0.093810f, 0.238993f, -0.006506f, 0.007830f, + 0.065819f, -0.203643f, -0.100925f, -0.053652f, + -0.130770f, 0.026277f, 0.131796f, 0.032742f, + 0.127186f, 0.116694f, -0.161122f, -0.279773f, + -0.252515f, -0.002638f, 0.042812f, 0.096776f, + -0.123280f, 0.064858f, -0.010455f, -0.219760f, + -0.239331f, -0.104363f, -0.058022f, -0.053584f, + 0.025611f, 0.005129f, -0.100418f, -0.045712f, + -0.194418f, -0.126366f, -0.030530f, 0.051168f, + 0.215959f, 0.172402f, -0.054700f, -0.185995f, + -0.278360f, -0.193693f, -0.040309f, 0.003735f, + -0.007770f, 0.123556f, 0.190179f, -0.077315f, + 0.117403f, 0.212942f, 0.012160f, 0.000113f, + 0.027331f, 0.040202f, 0.033293f, 0.219438f, + 0.184174f, 0.259349f, 0.311206f, 0.082547f, + -0.047875f, -0.078417f, 0.010746f, 0.082620f, + 0.311931f, 0.307605f, 0.003863f, 0.021405f, + -0.026388f, -0.019572f, 0.020582f, -0.059353f, + 0.025199f, 0.261319f, 0.086316f, 0.143614f, + 0.107780f, 0.003900f, -0.188397f, -0.038563f, + -0.106045f, -0.125154f, -0.010509f, 0.054021f, + 0.242130f, 0.279152f, 0.215546f, 0.346995f, + 0.440856f, 0.237452f, 0.234154f, 0.301646f, + 0.168929f, -0.208358f, -0.126848f, 0.010260f, + 0.121018f, -0.062975f, -0.052848f, 0.050341f, + -0.061103f, -0.266482f, 0.107186f, 0.140221f, + 0.280065f, 0.287889f, 0.373198f, 0.151596f, + 0.013593f, 0.115616f, 0.014616f, -0.281710f, + -0.237597f, -0.117305f, -0.000034f, -0.136739f, + -0.196275f, -0.095225f, -0.125310f, -0.250514f, + 0.236804f, -0.071805f, -0.037421f, 0.048230f, + 0.321596f, 0.063632f, 0.024039f, -0.029133f, + 0.230983f, 0.160593f, -0.154355f, -0.013086f, + -0.079929f, 0.094692f, 0.160391f, 0.180239f, + 0.053895f, 0.100759f, 0.288631f, 0.038191f, + 0.181692f, 0.229682f, 0.440166f, 0.063401f, + 0.006273f, 0.020865f, 0.338695f, 0.256244f, + -0.043927f, 0.115617f, 0.003296f, 0.173965f, + 0.021318f, -0.040936f, -0.118932f, 0.182380f, + 0.235922f, -0.053233f, -0.015053f, -0.101057f, + 0.095341f, 0.051111f, 0.161831f, 0.032614f, + 0.159496f, 0.072375f, 0.025089f, 0.023748f, + 0.029151f, 0.161284f, -0.117717f, -0.036191f, + -0.176822f, -0.162006f, 0.226542f, -0.078329f, + 0.043079f, -0.119172f, 0.054614f, -0.101365f, + -0.064541f, -0.115304f, 0.135170f, 0.298872f, + 0.098060f, 0.089428f, -0.007497f, 0.110391f, + -0.028824f, 0.020835f, -0.036804f, 0.125411f, + 0.192105f, -0.048931f, 0.003086f, -0.010681f, + 0.074698f, -0.016263f, 0.096063f, 0.060267f, + -0.007277f, 0.139139f, -0.080635f, 0.036628f, + 0.086058f, 0.131979f, 0.085707f, 0.025301f, + 0.226094f, 0.194759f, 0.042193f, -0.157846f, + -0.068402f, -0.141450f, -0.112659f, -0.076305f, + -0.069085f, -0.114332f, -0.102005f, 0.132193f, + -0.067042f, 0.106643f, 0.198964f, 0.171616f, + 0.167237f, -0.033730f, -0.026755f, 0.083621f, + 0.149459f, -0.002799f, -0.000318f, 0.011753f, + 0.065889f, -0.089375f, -0.049610f, 0.224579f, + 0.216548f, -0.034908f, -0.017851f, -0.088144f, + 0.007530f, 0.240268f, 0.073270f, 0.013263f, + 0.175323f, 0.012082f, 0.093993f, 0.015282f, + 0.105854f, 0.107990f, 0.077798f, -0.096166f, + -0.079607f, 0.177820f, 0.142392f, 0.033337f, + -0.078100f, -0.081616f, -0.046993f, 0.139459f, + 0.020272f, -0.123161f, 0.175269f, 0.105217f, + 0.057328f, 0.080909f, -0.012612f, -0.097081f, + 0.082060f, -0.096716f, -0.063921f, 0.201884f, + 0.128166f, -0.035051f, -0.032227f, -0.068139f, + -0.115915f, 0.095080f, -0.086007f, -0.067543f, + 0.030776f, 0.032712f, 0.088937f, 0.054336f, + -0.039329f, -0.114022f, 0.171672f, -0.112321f, + -0.217646f, 0.065186f, 0.060223f, 0.192174f, + 0.055580f, -0.131107f, -0.144338f, 0.056730f, + -0.034707f, -0.081616f, -0.135298f, -0.000614f, + 0.087189f, 0.014614f, 0.067709f, 0.107689f, + 0.225780f, 0.084361f, -0.008544f, 0.051649f, + -0.048369f, -0.037739f, -0.060710f, 0.002654f, + 0.016935f, 0.085563f, -0.015961f, -0.019265f, + 0.111788f, 0.062376f, 0.202019f, 0.047713f, + 0.042261f, 0.069716f, 0.242913f, 0.021052f, + -0.072812f, -0.155920f, -0.026436f, 0.035621f, + -0.079300f, -0.028787f, -0.048329f, 0.084718f, + -0.060565f, -0.083750f, -0.164075f, -0.040742f, + -0.086219f, 0.015271f, -0.005204f, -0.016038f, + 0.045816f, -0.050433f, -0.077652f, 0.117109f, + 0.009611f, -0.009045f, -0.008634f, -0.055373f, + -0.085968f, 0.028527f, -0.054736f, -0.168089f, + 0.175839f, 0.071205f, -0.023603f, 0.037907f, + -0.004561f, -0.022634f, 0.123831f, 0.094469f, + -0.072920f, -0.133642f, -0.014032f, -0.142754f, + -0.026999f, -0.199409f, 0.013268f, 0.226989f, + 0.048650f, -0.170988f, -0.050141f, 0.007880f, + 0.061880f, 0.019078f, -0.043578f, -0.038139f, + 0.134814f, 0.054097f, -0.081670f, 0.176838f, + 0.047920f, -0.038176f, 0.050406f, -0.107181f, + -0.036279f, 0.027060f, 0.081594f, -0.002820f, + 0.090507f, -0.033338f, -0.059571f, 0.013404f, + -0.099860f, 0.073371f, 0.342805f, 0.098305f, + -0.150910f, -0.020822f, -0.056960f, 0.046262f, + -0.043413f, -0.149405f, -0.129105f, -0.010899f, + -0.014229f, -0.179949f, -0.113044f, -0.049468f, + -0.065513f, 0.090269f, -0.011919f, 0.087846f, + 0.095796f, 0.146127f, 0.101599f, 0.078066f, + -0.084348f, -0.100002f, -0.020134f, -0.050169f, + 0.062122f, 0.014640f, 0.019143f, 0.036543f, + 0.180924f, -0.013976f, -0.066768f, -0.001090f, + -0.070419f, -0.004839f, -0.001504f, 0.034483f, + -0.044954f, -0.050336f, -0.088638f, -0.174782f, + -0.116082f, -0.205507f, 0.015587f, -0.042839f, + -0.096879f, -0.144097f, -0.050268f, -0.196796f, + 0.109639f, 0.271411f, 0.173732f, 0.108070f, + 0.156437f, 0.124255f, 0.097242f, 0.238693f, + 0.083941f, 0.109105f, 0.223940f, 0.267188f, + 0.027385f, 0.025819f, 0.125070f, 0.093738f, + 0.040353f, 0.038645f, -0.012730f, 0.144063f, + 0.052931f, -0.009138f, 0.084193f, 0.160272f, + -0.041366f, 0.011951f, -0.121446f, -0.106713f, + -0.047566f, 0.047984f, -0.255224f, -0.076116f, + 0.098685f, -0.150845f, -0.171513f, -0.156590f, + 0.058331f, 0.187493f, 0.413018f, 0.554265f, + 0.372242f, 0.237943f, 0.124571f, 0.110829f, + 0.010322f, -0.174477f, -0.067627f, -0.001979f, + 0.142913f, 0.040597f, 0.019907f, 0.025963f, + -0.043585f, -0.120732f, 0.099937f, 0.091059f, + 0.247307f, 0.204226f, -0.042753f, -0.068580f, + -0.119002f, 0.026722f, 0.034853f, -0.060934f, + -0.025054f, -0.093026f, -0.035372f, -0.233209f, + -0.049869f, -0.039151f, -0.022279f, -0.065380f, + -9.063785f + }; + #endregion + + #endregion + + #region Init and Disposal + +#if LANG_JP + /// + /// HOG ディスクリプタおよび検出器を作成します + /// +#else + /// + /// Default constructor + /// +#endif + public HOGDescriptor() + { + ptr = NativeMethods.objdetect_HOGDescriptor_new1(); + } +#if LANG_JP + /// + /// HOG ディスクリプタおよび検出器を作成します + /// + /// 検出窓サイズ.ブロックのサイズと移動量に合わせる必要があります. + /// ピクセル単位で表されるブロックサイズ.セルサイズに合わせる必要があります. + /// ブロックの移動量.セルサイズの倍数でなければいけません. + /// セルサイズ. + /// ビンの個数. + /// + /// ガウシアン平滑化窓パラメータ. + /// + /// L2-Hys 正規化縮小処理の閾値. + /// 前処理としてガンマ補正を行うか否か,を指定します. + /// 検出窓拡大回数の最大値 +#else + /// + /// Creates the HOG descriptor and detector. + /// + /// Detection window size. Align to block size and block stride. + /// Block size in pixels. Align to cell size. Only (16,16) is supported for now. + /// Block stride. It must be a multiple of cell size. + /// Cell size. Only (8, 8) is supported for now. + /// Number of bins. Only 9 bins per cell are supported for now. + /// + /// Gaussian smoothing window parameter. + /// + /// L2-Hys normalization method shrinkage. + /// Flag to specify whether the gamma correction preprocessing is required or not. + /// Maximum number of detection window increases. +#endif + public HOGDescriptor( + Size? winSize = null, + Size? blockSize = null, + Size? blockStride = null, + Size? cellSize = null, + int nbins = 9, + int derivAperture = 1, + double winSigma = -1, + HistogramNormType histogramNormType = HistogramNormType.L2Hys, + double l2HysThreshold = 0.2, + bool gammaCorrection = true, + int nlevels = DefaultNlevels) + { + ptr = NativeMethods.objdetect_HOGDescriptor_new2( + winSize.GetValueOrDefault(new Size(64, 128)), + blockSize.GetValueOrDefault(new Size(16, 16)), + blockStride.GetValueOrDefault(new Size(8, 8)), + cellSize.GetValueOrDefault(new Size(8, 8)), + nbins, + derivAperture, + winSigma, histogramNormType, + l2HysThreshold, + gammaCorrection ? 1 : 0, + nlevels); + } +#if LANG_JP + /// + /// + /// + /// +#else + /// + /// + /// + /// +#endif + public HOGDescriptor(string fileName) + { + ptr = NativeMethods.objdetect_HOGDescriptor_new3(fileName); + } + +#if LANG_JP + /// + /// ポインタから初期化 + /// + /// class HOGDescriptor* +#else + /// + /// Initializes from pointer + /// + /// class HOGDescriptor* +#endif + public HOGDescriptor(IntPtr ptr) + { + this.ptr = ptr; + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + if(ptr != IntPtr.Zero) + NativeMethods.objdetect_HOGDescriptor_delete(ptr); + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + /// + /// + /// + public Size WinSize + { + get { return NativeMethods.objdetect_HOGDescriptor_winSize_get(ptr); } + set { NativeMethods.objdetect_HOGDescriptor_winSize_set(ptr, value); } + } + /// + /// + /// + public Size BlockSize + { + get { return NativeMethods.objdetect_HOGDescriptor_blockSize_get(ptr); } + set { NativeMethods.objdetect_HOGDescriptor_blockSize_set(ptr, value); } + } + /// + /// + /// + public Size BlockStride + { + get { return NativeMethods.objdetect_HOGDescriptor_blockStride_get(ptr); } + set { NativeMethods.objdetect_HOGDescriptor_blockStride_set(ptr, value); } + } + /// + /// + /// + public Size CellSize + { + get { return NativeMethods.objdetect_HOGDescriptor_cellSize_get(ptr); } + set { NativeMethods.objdetect_HOGDescriptor_cellSize_set(ptr, value); } + } + /// + /// + /// + public int Nbins + { + get { return NativeMethods.objdetect_HOGDescriptor_nbins_get(ptr); } + set { NativeMethods.objdetect_HOGDescriptor_nbins_set(ptr, value); } + } + /// + /// + /// + public int DerivAperture + { + get { return NativeMethods.objdetect_HOGDescriptor_derivAperture_get(ptr); } + set { NativeMethods.objdetect_HOGDescriptor_derivAperture_set(ptr, value); } + } + /// + /// + /// + public double WinSigma + { + get { return NativeMethods.objdetect_HOGDescriptor_winSigma_get(ptr); } + set { NativeMethods.objdetect_HOGDescriptor_winSigma_set(ptr, value); } + } + /// + /// + /// + public HistogramNormType HistogramNormType + { + get { return (HistogramNormType)NativeMethods.objdetect_HOGDescriptor_histogramNormType_get(ptr); } + set { NativeMethods.objdetect_HOGDescriptor_histogramNormType_set(ptr, (int)value); } + } + /// + /// + /// + public double L2HysThreshold + { + get { return NativeMethods.objdetect_HOGDescriptor_L2HysThreshold_get(ptr); } + set { NativeMethods.objdetect_HOGDescriptor_L2HysThreshold_set(ptr, value); } + } + /// + /// + /// + public bool GammaCorrection + { + get { return NativeMethods.objdetect_HOGDescriptor_gammaCorrection_get(ptr) != 0; } + set { NativeMethods.objdetect_HOGDescriptor_gammaCorrection_set(ptr, value ? 1 : 0); } + } + /// + /// + /// + public int NLevels + { + get { return NativeMethods.objdetect_HOGDescriptor_nlevels_get(ptr); } + set { NativeMethods.objdetect_HOGDescriptor_nlevels_set(ptr, value); } + } + #endregion + + #region Methods +#if LANG_JP + /// + /// (デフォルトの窓サイズで)人検出用に学習された分類器の係数を返します. + /// + /// +#else + /// + /// Returns coefficients of the classifier trained for people detection (for default window size). + /// + /// +#endif + public static float[] GetDefaultPeopleDetector() + { + return DefaultPeopleDetector; + } + +#if LANG_JP + /// + /// + /// + /// +#else + /// + /// This method returns 1981 SVM coeffs obtained from daimler's base. + /// To use these coeffs the detection window size should be (48,96) + /// + /// +#endif + public static float[] GetDaimlerPeopleDetector() + { + return DaimlerPeopleDetector; + } + +#if LANG_JP + /// + /// 線形SVM分類器に,係数をセットします. + /// + /// +#else + /// + /// + /// + /// +#endif + public virtual void SetSVMDetector(float[] svmDetector) + { + if (disposed) + throw new ObjectDisposedException("HOGDescriptor"); + + using (var svmDetectorVec = new VectorOfFloat(svmDetector)) + { + NativeMethods.objdetect_HOGDescriptor_setSVMDetector(ptr, svmDetectorVec.CvPtr); + } + } + + /// + /// + /// + /// + /// + /// + public virtual bool Load(string fileName, string objName = null) + { + if (disposed) + throw new ObjectDisposedException("HOGDescriptor"); + return NativeMethods.objdetect_HOGDescriptor_load(ptr, fileName, objName); + } + + /// + /// + /// + /// + /// + public virtual void Save(string fileName, string objName = null) + { + if (disposed) + throw new ObjectDisposedException("HOGDescriptor"); + NativeMethods.objdetect_HOGDescriptor_save(ptr, fileName, objName); + } + + /// + /// + /// + /// + public int GetDescriptorSize() + { + if (disposed) + throw new ObjectDisposedException("HOGDescriptor"); + return NativeMethods.objdetect_HOGDescriptor_getDescriptorSize(ptr).ToInt32(); + } + + /// + /// + /// + /// + public bool CheckDetectorSize() + { + if (disposed) + throw new ObjectDisposedException("HOGDescriptor"); + return NativeMethods.objdetect_HOGDescriptor_checkDetectorSize(ptr) != 0; + } + + /// + /// + /// + /// + public double GetWinSigma() + { + if (disposed) + throw new ObjectDisposedException("HOGDescriptor"); + return NativeMethods.objdetect_HOGDescriptor_getWinSigma(ptr); + } + + /// + /// + /// + /// + /// + /// + /// + /// + public virtual float[] Compute(Mat img, Size? winStride = null, Size? padding = null, Point[] locations = null) + { + if (disposed) + throw new ObjectDisposedException("HOGDescriptor"); + if (img == null) + throw new ArgumentNullException("img"); + + Size winStride0 = winStride.GetValueOrDefault(new Size()); + Size padding0 = padding.GetValueOrDefault(new Size()); + using (var flVec = new VectorOfFloat()) + { + int length = (locations != null) ? locations.Length : 0; + NativeMethods.objdetect_HOGDescriptor_compute(ptr, img.CvPtr, flVec.CvPtr, winStride0, padding0, locations, length); + return flVec.ToArray(); + } + } + + + /// + /// Performs object detection without a multi-scale window. + /// + /// Source image. CV_8UC1 and CV_8UC4 types are supported for now. + /// Threshold for the distance between features and SVM classifying plane. + /// Usually it is 0 and should be specfied in the detector coefficients (as the last free coefficient). + /// But if the free coefficient is omitted (which is allowed), you can specify it manually here. + /// Window stride. It must be a multiple of block stride. + /// Mock parameter to keep the CPU interface compatibility. It must be (0,0). + /// + /// Left-top corner points of detected objects boundaries. + public virtual Point[] Detect(Mat img, + double hitThreshold = 0, Size? winStride = null, Size? padding = null, Point[] searchLocations = null) + { + if (disposed) + throw new ObjectDisposedException("HOGDescriptor"); + if (img == null) + throw new ArgumentNullException("img"); + img.ThrowIfDisposed(); + + Size winStride0 = winStride.GetValueOrDefault(new Size()); + Size padding0 = padding.GetValueOrDefault(new Size()); + using (var flVec = new VectorOfPoint()) + { + int slLength = (searchLocations != null) ? searchLocations.Length : 0; + NativeMethods.objdetect_HOGDescriptor_detect(ptr, img.CvPtr, flVec.CvPtr, + hitThreshold, winStride0, padding0, searchLocations, slLength); + return flVec.ToArray(); + } + } + + /// + /// Performs object detection without a multi-scale window. + /// + /// Source image. CV_8UC1 and CV_8UC4 types are supported for now. + /// + /// Threshold for the distance between features and SVM classifying plane. + /// Usually it is 0 and should be specfied in the detector coefficients (as the last free coefficient). + /// But if the free coefficient is omitted (which is allowed), you can specify it manually here. + /// Window stride. It must be a multiple of block stride. + /// Mock parameter to keep the CPU interface compatibility. It must be (0,0). + /// + /// Left-top corner points of detected objects boundaries. + public virtual Point[] Detect(Mat img, out double[] weights, + double hitThreshold = 0, Size? winStride = null, Size? padding = null, Point[] searchLocations = null) + { + if (disposed) + throw new ObjectDisposedException("HOGDescriptor"); + if (img == null) + throw new ArgumentNullException("img"); + img.ThrowIfDisposed(); + + Size winStride0 = winStride.GetValueOrDefault(new Size()); + Size padding0 = padding.GetValueOrDefault(new Size()); + using (var flVec = new VectorOfPoint()) + using (var weightsVec = new VectorOfDouble()) + { + int slLength = (searchLocations != null) ? searchLocations.Length : 0; + NativeMethods.objdetect_HOGDescriptor_detect(ptr, img.CvPtr, flVec.CvPtr, weightsVec.CvPtr, + hitThreshold, winStride0, padding0, searchLocations, slLength); + weights = weightsVec.ToArray(); + return flVec.ToArray(); + } + } + + + /// + /// Performs object detection with a multi-scale window. + /// + /// Source image. CV_8UC1 and CV_8UC4 types are supported for now. + /// Threshold for the distance between features and SVM classifying plane. + /// Window stride. It must be a multiple of block stride. + /// Mock parameter to keep the CPU interface compatibility. It must be (0,0). + /// Coefficient of the detection window increase. + /// Coefficient to regulate the similarity threshold. + /// When detected, some objects can be covered by many rectangles. 0 means not to perform grouping. + /// Detected objects boundaries. + public virtual Rect[] DetectMultiScale(Mat img, + double hitThreshold = 0, Size? winStride = null, Size? padding = null, double scale=1.05, int groupThreshold = 2) + { + if (disposed) + throw new ObjectDisposedException("HOGDescriptor"); + if (img == null) + throw new ArgumentNullException("img"); + img.ThrowIfDisposed(); + + Size winStride0 = winStride.GetValueOrDefault(new Size()); + Size padding0 = padding.GetValueOrDefault(new Size()); + using (var flVec = new VectorOfRect()) + { + NativeMethods.objdetect_HOGDescriptor_detectMultiScale(ptr, img.CvPtr, flVec.CvPtr, + hitThreshold, winStride0, padding0, scale, groupThreshold); + return flVec.ToArray(); + } + } + + /// + /// Performs object detection with a multi-scale window. + /// + /// Source image. CV_8UC1 and CV_8UC4 types are supported for now. + /// + /// Threshold for the distance between features and SVM classifying plane. + /// Window stride. It must be a multiple of block stride. + /// Mock parameter to keep the CPU interface compatibility. It must be (0,0). + /// Coefficient of the detection window increase. + /// Coefficient to regulate the similarity threshold. + /// When detected, some objects can be covered by many rectangles. 0 means not to perform grouping. + /// Detected objects boundaries. + public virtual Rect[] DetectMultiScale(Mat img, out double[] foundWeights, + double hitThreshold = 0, Size? winStride = null, Size? padding = null, double scale = 1.05, int groupThreshold = 2) + { + if (disposed) + throw new ObjectDisposedException("HOGDescriptor"); + if (img == null) + throw new ArgumentNullException("img"); + img.ThrowIfDisposed(); + + Size winStride0 = winStride.GetValueOrDefault(new Size()); + Size padding0 = padding.GetValueOrDefault(new Size()); + using (var flVec = new VectorOfRect()) + using (var foundWeightsVec = new VectorOfDouble()) + { + NativeMethods.objdetect_HOGDescriptor_detectMultiScale(ptr, img.CvPtr, flVec.CvPtr, foundWeightsVec.CvPtr, + hitThreshold, winStride0, padding0, scale, groupThreshold); + foundWeights = foundWeightsVec.ToArray(); + return flVec.ToArray(); + } + } + + + /// + /// + /// + /// + /// + /// + /// + /// + public virtual void ComputeGradient(Mat img, Mat grad, Mat angleOfs, Size? paddingTL = null, Size? paddingBR = null) + { + if (disposed) + throw new ObjectDisposedException("HOGDescriptor"); + if (img == null) + throw new ArgumentNullException("img"); + if (grad == null) + throw new ArgumentNullException("grad"); + if (angleOfs == null) + throw new ArgumentNullException("angleOfs"); + img.ThrowIfDisposed(); + grad.ThrowIfDisposed(); + angleOfs.ThrowIfDisposed(); + + Size paddingTL0 = paddingTL.GetValueOrDefault(new Size()); + Size paddingBR0 = paddingBR.GetValueOrDefault(new Size()); + NativeMethods.objdetect_HOGDescriptor_computeGradient(ptr, img.CvPtr, grad.CvPtr, angleOfs.CvPtr, paddingTL0, paddingBR0); + } + + + /// + /// evaluate specified ROI and return confidence value for each location + /// + /// + /// + /// + /// + /// + /// + /// + public void DetectROI( + Mat img, Point[] locations, out Point[] foundLocations, out double[] confidences, + double hitThreshold = 0, Size? winStride = null, Size? padding = null) + { + if (disposed) + throw new ObjectDisposedException("HOGDescriptor"); + if (img == null) + throw new ArgumentNullException("img"); + if (locations == null) + throw new ArgumentNullException("locations"); + img.ThrowIfDisposed(); + + Size winStride0 = winStride.GetValueOrDefault(new Size()); + Size padding0 = padding.GetValueOrDefault(new Size()); + using (var flVec = new VectorOfPoint()) + using (var cVec = new VectorOfDouble()) + { + NativeMethods.objdetect_HOGDescriptor_detectROI(ptr, img.CvPtr, locations, locations.Length, + flVec.CvPtr, cVec.CvPtr, hitThreshold, winStride0, padding0); + foundLocations = flVec.ToArray(); + confidences = cVec.ToArray(); + } + } + + /// + /// evaluate specified ROI and return confidence value for each location in multiple scales + /// + /// + /// + /// + /// + /// + public void DetectMultiScaleROI( + Mat img, + out Rect[] foundLocations, + out DetectionROI[] locations, + double hitThreshold = 0, + int groupThreshold = 0) + { + if (disposed) + throw new ObjectDisposedException("HOGDescriptor"); + if (img == null) + throw new ArgumentNullException("img"); + img.ThrowIfDisposed(); + + using (var flVec = new VectorOfRect()) + using (var scalesVec = new VectorOfDouble()) + using (var locationsVec = new VectorOfVectorPoint()) + using (var confidencesVec = new VectorOfVectorDouble()) + { + NativeMethods.objdetect_HOGDescriptor_detectMultiScaleROI( + ptr, img.CvPtr, flVec.CvPtr, + scalesVec.CvPtr, locationsVec.CvPtr, confidencesVec.CvPtr, + hitThreshold, groupThreshold); + foundLocations = flVec.ToArray(); + + double[] s = scalesVec.ToArray(); + Point[][] l = locationsVec.ToArray(); + double[][] c = confidencesVec.ToArray(); + + if(s.Length != l.Length || l.Length != c.Length) + throw new OpenCvSharpException("Invalid result data 'locations'"); + locations = new DetectionROI[s.Length]; + for (int i = 0; i < s.Length; i++) + { + locations[i] = new DetectionROI + { + Scale = s[i], + Locations = l[i], + Confidences = c[i] + }; + } + } + } + + /// + /// read/parse Dalal's alt model file + /// + /// + public void ReadALTModel(string modelFile) + { + if (disposed) + throw new ObjectDisposedException("HOGDescriptor"); + NativeMethods.objdetect_HOGDescriptor_readALTModel(ptr, modelFile); + } + /// + /// + /// + /// + /// + /// + /// + public void GroupRectangles(out Rect[] rectList, out double[] weights, int groupThreshold, double eps) + { + if (disposed) + throw new ObjectDisposedException("HOGDescriptor"); + + using (var rectListVec = new VectorOfRect()) + using (var weightsVec = new VectorOfDouble()) + { + NativeMethods.objdetect_HOGDescriptor_groupRectangles( + ptr, rectListVec.CvPtr, weightsVec.CvPtr, groupThreshold, eps); + rectList = rectListVec.ToArray(); + weights = weightsVec.ToArray(); + } + } + + #endregion + } + + /// + /// struct for detection region of interest (ROI) + /// + public class DetectionROI + { + /// + /// scale(size) of the bounding box + /// + public double Scale { get; set; } + /// + /// set of requrested locations to be evaluated + /// + public Point[] Locations { get; set; } + /// + /// vector that will contain confidence values for each location + /// + public double[] Confidences { get; set; } + } +} diff --git a/src/OpenCvSharp/modules/objdetect/HistogramNormType.cs b/src/OpenCvSharp/modules/objdetect/HistogramNormType.cs new file mode 100644 index 000000000..aa085ff1c --- /dev/null +++ b/src/OpenCvSharp/modules/objdetect/HistogramNormType.cs @@ -0,0 +1,32 @@ +using System; + +namespace OpenCvSharp +{ + +#if LANG_JP + /// + /// + /// +#else + /// + /// + /// +#endif + public enum HistogramNormType : int + { +#if LANG_JP + /// + /// + /// [HOGDescriptor::L2Hys] + /// +#else + /// + /// + /// [HOGDescriptor::L2Hys] + /// +#endif + L2Hys = HOGDescriptor.L2Hys, + } +} + + diff --git a/src/OpenCvSharp/modules/objdetect/LatendSvmDetector.cs b/src/OpenCvSharp/modules/objdetect/LatendSvmDetector.cs new file mode 100644 index 000000000..6c8c28d28 --- /dev/null +++ b/src/OpenCvSharp/modules/objdetect/LatendSvmDetector.cs @@ -0,0 +1,219 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +// ReSharper disable InconsistentNaming + +namespace OpenCvSharp +{ + /// + /// Find rectangular regions in the given image that are likely + /// to contain objects and corresponding confidence levels + /// + public class LatentSvmDetector : DisposableCvObject + { + /// + /// Structure contains the detection information. + /// + public class ObjectDetection + { + /// + /// + /// + /// + /// + /// + public ObjectDetection(Rect? rect = null, float score = 0, int classId = -1) + { + Rect = rect.GetValueOrDefault(new Rect()); + Score = score; + ClassId = classId; + } + + /// + /// bounding box for a detected object + /// + public Rect Rect { get; set; } + /// + /// confidence level + /// + public float Score { get; set; } + /// + /// class (model or detector) ID that detect an object + /// + public int ClassId { get; set; } + } + + /// + /// Track whether Dispose has been called + /// + private bool disposed; + + #region Init and Disposal + + /// + /// Default constructor + /// + public LatentSvmDetector() + { + ptr = NativeMethods.objdetect_LatentSvmDetector_new(); + } + + /// + /// Creates the HOG descriptor and detector. + /// + /// A set of filenames storing the trained detectors (models). Each file contains one model. + /// See examples of such files here /opencv_extra/testdata/cv/latentsvmdetector/models_VOC2007/. + /// A set of trained models names. If it’s empty then the name of each model will be + /// constructed from the name of file containing the model. E.g. the model stored in "/home/user/cat.xml" will get the name "cat". + public LatentSvmDetector(IEnumerable fileNames, IEnumerable classNames) + : this() + { + Load(fileNames, classNames); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + NativeMethods.objdetect_LatentSvmDetector_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Methods + + /// + /// Clear all trained models and their names stored in an class object. + /// + public virtual void Clear() + { + if (disposed) + throw new ObjectDisposedException("LatentSvmDetector"); + NativeMethods.objdetect_LatentSvmDetector_clear(ptr); + } + /// + /// + /// + public virtual bool Empty() + { + if (disposed) + throw new ObjectDisposedException("LatentSvmDetector"); + return NativeMethods.objdetect_LatentSvmDetector_empty(ptr) != 0; + } + /// + /// + /// + /// A set of filenames storing the trained detectors (models). Each file contains one model. + /// See examples of such files here /opencv_extra/testdata/cv/latentsvmdetector/models_VOC2007/. + /// A set of trained models names. If it’s empty then the name of each model will be + /// constructed from the name of file containing the model. E.g. the model stored in "/home/user/cat.xml" will get the name "cat". + public virtual bool Load(IEnumerable fileNames, IEnumerable classNames) + { + if (disposed) + throw new ObjectDisposedException("LatentSvmDetector"); + if (fileNames == null) + throw new ArgumentNullException("fileNames"); + if (classNames == null) + throw new ArgumentNullException("classNames"); + + using (var fn = new StringArrayAddress(fileNames)) + using (var cn = new StringArrayAddress(classNames)) + { + return NativeMethods.objdetect_LatentSvmDetector_load( + ptr, fn.Pointer, fn.Dim1Length, cn.Pointer, cn.Dim1Length) != 0; + } + } + + /// + /// Find rectangular regions in the given image that are likely to contain objects of + /// loaded classes (models) and corresponding confidence levels. + /// + /// An image. + /// Threshold for the non-maximum suppression algorithm. + /// Number of threads used in parallel version of the algorithm. + /// The detections: rectangulars, scores and class IDs. + public virtual ObjectDetection[] Detect(Mat image, + float overlapThreshold = 0.5f, int numThreads = -1) + { + if (disposed) + throw new ObjectDisposedException("LatentSvmDetector"); + if (image == null) + throw new ArgumentNullException("image"); + image.ThrowIfDisposed(); + + using (var odVec = new VectorOfVec6d()) + { + NativeMethods.objdetect_LatentSvmDetector_detect( + ptr, image.CvPtr, odVec.CvPtr, overlapThreshold, numThreads); + + return EnumerableEx.SelectToArray(odVec.ToArray(), v => + new ObjectDetection + { + Rect = new Rect((int)v.Item0, (int)v.Item1, (int)v.Item2, (int)v.Item3), + Score = (float)v.Item4, + ClassId = (int)v.Item5 + } + ); + } + } + + /// + /// Return the class (model) names that were passed in constructor or method load or extracted from models filenames in those methods. + /// + /// + public string[] GetClassNames() + { + using (var outVec = new VectorOfString()) + { + NativeMethods.objdetect_LatentSvmDetector_getClassNames(ptr, outVec.CvPtr); + return outVec.ToArray(); + } + } + + /// + /// Return a count of loaded models (classes). + /// + /// + public long GetClassCount() + { + if (disposed) + throw new ObjectDisposedException("LatentSvmDetector"); + return NativeMethods.objdetect_LatentSvmDetector_getClassCount(ptr).ToInt64(); + } + + #endregion + } + +} diff --git a/src/OpenCvSharp/modules/objdetect/SimilarRects.cs b/src/OpenCvSharp/modules/objdetect/SimilarRects.cs new file mode 100644 index 000000000..36047683e --- /dev/null +++ b/src/OpenCvSharp/modules/objdetect/SimilarRects.cs @@ -0,0 +1,30 @@ +using System; + +// ReSharper disable InconsistentNaming + +namespace OpenCvSharp +{ + /// + /// Class for grouping object candidates, detected by Cascade Classifier, HOG etc. + /// instance of the class is to be passed to cv::partition (see cxoperations.hpp) + /// + public static class SimilarRects + { + /// + /// + /// + /// + /// + /// + /// + public static bool Compare(double eps, Rect r1, Rect r2) + { + double delta = eps * (Math.Min(r1.Width, r2.Width) + Math.Min(r1.Height, r2.Height)) * 0.5; + return Math.Abs(r1.X - r2.X) <= delta && + Math.Abs(r1.Y - r2.Y) <= delta && + Math.Abs(r1.X + r1.Width - r2.X - r2.Width) <= delta && + Math.Abs(r1.Y + r1.Height - r2.Y - r2.Height) <= delta; + } + } + +} diff --git a/src/OpenCvSharp/modules/photo/CalibrateCRF.cs b/src/OpenCvSharp/modules/photo/CalibrateCRF.cs new file mode 100644 index 000000000..76e760aa4 --- /dev/null +++ b/src/OpenCvSharp/modules/photo/CalibrateCRF.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Text; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ + /// + /// The base class for camera response calibration algorithms. + /// + public abstract class CalibrateCRF : Algorithm + { + /// + /// Recovers inverse camera response. + /// + /// vector of input images + /// 256x1 matrix with inverse camera response function + /// vector of exposure time values for each image + public virtual void Process(IEnumerable src, OutputArray dst, IEnumerable times) + { + if (src == null) + throw new ArgumentNullException("src"); + if (dst == null) + throw new ArgumentNullException("dst"); + if (times == null) + throw new ArgumentNullException("times"); + dst.ThrowIfNotReady(); + + IntPtr[] srcArray = EnumerableEx.SelectPtrs(src); + float[] timesArray = EnumerableEx.ToArray(times); + if (srcArray.Length != timesArray.Length) + throw new OpenCvSharpException("src.Count() != times.Count"); + + NativeMethods.photo_CalibrateCRF_process(ptr, srcArray, srcArray.Length, dst.CvPtr, timesArray); + + dst.Fix(); + GC.KeepAlive(src); + } + } +} diff --git a/src/OpenCvSharp/modules/photo/CalibrateDebevec.cs b/src/OpenCvSharp/modules/photo/CalibrateDebevec.cs new file mode 100644 index 000000000..36c5ad967 --- /dev/null +++ b/src/OpenCvSharp/modules/photo/CalibrateDebevec.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// The base class for camera response calibration algorithms. + /// + public class CalibrateDebevec : CalibrateCRF + { + /// + /// Track whether Dispose has been called + /// + private bool disposed; + private Ptr ptrObj; + + /// + /// Creates instance by raw pointer cv::ml::Boost* + /// + protected CalibrateDebevec(IntPtr p) + : base() + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// Creates the empty model. + /// + /// number of pixel locations to use + /// smoothness term weight. Greater values produce smoother results, + /// but can alter the response. + /// if true sample pixel locations are chosen at random, + /// otherwise the form a rectangular grid. + /// + public static CalibrateDebevec Create(int samples = 70, float lambda = 10.0f, bool random = false) + { + IntPtr ptr = NativeMethods.photo_createCalibrateDebevec(samples, lambda, random ? 1 : 0); + return new CalibrateDebevec(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + } +} diff --git a/src/OpenCvSharp/modules/photo/EdgePreservingMethods.cs b/src/OpenCvSharp/modules/photo/EdgePreservingMethods.cs new file mode 100644 index 000000000..20800f79b --- /dev/null +++ b/src/OpenCvSharp/modules/photo/EdgePreservingMethods.cs @@ -0,0 +1,18 @@ +namespace OpenCvSharp +{ + /// + /// Edge preserving filters + /// + public enum EdgePreservingMethods + { + /// + /// + /// + RecursFilter = 1, + + /// + /// + /// + NormconvFilter = 2 + } +} diff --git a/src/OpenCvSharp/modules/photo/InpaintMethod.cs b/src/OpenCvSharp/modules/photo/InpaintMethod.cs new file mode 100644 index 000000000..6aab7bd34 --- /dev/null +++ b/src/OpenCvSharp/modules/photo/InpaintMethod.cs @@ -0,0 +1,43 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// cvInpaintの修復方法 + /// +#else + /// + /// The inpainting method + /// +#endif + public enum InpaintMethod + { +#if LANG_JP + /// + /// ナビエ・ストークス(Navier-Stokes)ベースの手法 + /// [CV_INPAINT_NS] + /// +#else + /// + /// Navier-Stokes based method. + /// [CV_INPAINT_NS] + /// +#endif +// ReSharper disable once InconsistentNaming + NS = 0, + + +#if LANG_JP + /// + /// Alexandru Teleaによる手法 + /// [CV_INPAINT_TELEA] + /// +#else + /// + /// The method by Alexandru Telea + /// [CV_INPAINT_TELEA] + /// +#endif + Telea = 1, + } +} diff --git a/src/OpenCvSharp/modules/photo/SeamlessCloneMethods.cs b/src/OpenCvSharp/modules/photo/SeamlessCloneMethods.cs new file mode 100644 index 000000000..2257eefa1 --- /dev/null +++ b/src/OpenCvSharp/modules/photo/SeamlessCloneMethods.cs @@ -0,0 +1,28 @@ +namespace OpenCvSharp +{ + /// + /// SeamlessClone method + /// + public enum SeamlessCloneMethods + { + /// + /// The power of the method is fully expressed when inserting objects with + /// complex outlines into a new background. + /// + NormalClone = 1, + + /// + /// The classic method, color-based selection and alpha masking might be time + /// consuming and often leaves an undesirable halo. Seamless cloning, even averaged + /// with the original image, is not effective. Mixed seamless cloning based on a + /// loose selection proves effective. + /// + MixedClone = 2, + + /// + /// Feature exchange allows the user to easily replace certain features of one + /// object by alternative features. + /// + MonochromeTransfer = 3 + } +} diff --git a/src/OpenCvSharp/modules/shape/HausdorffDistanceExtractor.cs b/src/OpenCvSharp/modules/shape/HausdorffDistanceExtractor.cs new file mode 100644 index 000000000..b92fa3a01 --- /dev/null +++ b/src/OpenCvSharp/modules/shape/HausdorffDistanceExtractor.cs @@ -0,0 +1,130 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable once InconsistentNaming + + /// + /// A simple Hausdorff distance measure between shapes defined by contours + /// + /// + /// according to the paper "Comparing Images using the Hausdorff distance." + /// by D.P. Huttenlocher, G.A. Klanderman, and W.J. Rucklidge. (PAMI 1993). : + /// + public class HausdorffDistanceExtractor : ShapeDistanceExtractor + { + private bool disposed; + private Ptr ptrObj; + + #region Init & Disposal + + /// + /// + /// + protected HausdorffDistanceExtractor(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// Complete constructor + /// + /// Flag indicating which norm is used to compute the Hausdorff distance (NORM_L1, NORM_L2). + /// fractional value (between 0 and 1). + /// + public static HausdorffDistanceExtractor Create( + DistanceTypes distanceFlag = DistanceTypes.L2, float rankProp = 0.6f) + { + IntPtr ptr = NativeMethods.shape_createHausdorffDistanceExtractor( + (int)distanceFlag, rankProp); + return new HausdorffDistanceExtractor(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + // releases unmanaged resources + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + + /// + /// Flag indicating which norm is used to compute the Hausdorff distance (NORM_L1, NORM_L2). + /// + public DistanceTypes DistanceFlag + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return (DistanceTypes)NativeMethods.shape_HausdorffDistanceExtractor_getDistanceFlag(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.shape_HausdorffDistanceExtractor_setDistanceFlag(ptr, (int)value); + } + } + + /// + /// fractional value (between 0 and 1). + /// + public float RankProportion + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.shape_HausdorffDistanceExtractor_getRankProportion(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.shape_HausdorffDistanceExtractor_setRankProportion(ptr, value); + } + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/shape/ShapeContextDistanceExtractor.cs b/src/OpenCvSharp/modules/shape/ShapeContextDistanceExtractor.cs new file mode 100644 index 000000000..80dc0dc33 --- /dev/null +++ b/src/OpenCvSharp/modules/shape/ShapeContextDistanceExtractor.cs @@ -0,0 +1,333 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable once InconsistentNaming + + /// + /// Implementation of the Shape Context descriptor and matching algorithm + /// + /// + /// proposed by Belongie et al. in "Shape Matching and Object Recognition Using Shape Contexts" + /// (PAMI2002). This implementation is packaged in a generic scheme, in order to allow + /// you the implementation of the common variations of the original pipeline. + /// + public class ShapeContextDistanceExtractor : ShapeDistanceExtractor + { + private bool disposed; + private Ptr ptrObj; + + #region Init & Disposal + + /// + /// + /// + protected ShapeContextDistanceExtractor(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// Complete constructor + /// + /// The number of angular bins in the shape context descriptor. + /// The number of radial bins in the shape context descriptor. + /// The value of the inner radius. + /// The value of the outer radius. + /// + /// + public static ShapeContextDistanceExtractor Create( + int nAngularBins = 12, int nRadialBins = 4, float innerRadius = 0.2f, + float outerRadius = 2, int iterations = 3) + { + IntPtr ptr = NativeMethods.shape_createShapeContextDistanceExtractor( + nAngularBins, nRadialBins, innerRadius, outerRadius, iterations); + return new ShapeContextDistanceExtractor(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + // releases unmanaged resources + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + + /// + /// The number of angular bins in the shape context descriptor. + /// + public int AngularBins + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.shape_ShapeContextDistanceExtractor_getAngularBins(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.shape_ShapeContextDistanceExtractor_setAngularBins(ptr, value); + } + } + + /// + /// The number of radial bins in the shape context descriptor. + /// + public int RadialBins + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.shape_ShapeContextDistanceExtractor_getRadialBins(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.shape_ShapeContextDistanceExtractor_setRadialBins(ptr, value); + } + } + + /// + /// The value of the inner radius. + /// + public float InnerRadius + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.shape_ShapeContextDistanceExtractor_getInnerRadius(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.shape_ShapeContextDistanceExtractor_setInnerRadius(ptr, value); + } + } + + /// + /// The value of the outer radius. + /// + public float OuterRadius + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.shape_ShapeContextDistanceExtractor_getOuterRadius(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.shape_ShapeContextDistanceExtractor_setOuterRadius(ptr, value); + } + } + + /// + /// + /// + public bool RotationInvariant + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.shape_ShapeContextDistanceExtractor_getRotationInvariant(ptr) != 0; + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.shape_ShapeContextDistanceExtractor_setRotationInvariant(ptr, value ? 1 : 0); + } + } + + /// + /// The weight of the shape context distance in the final distance value. + /// + public float ShapeContextWeight + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.shape_ShapeContextDistanceExtractor_getShapeContextWeight(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.shape_ShapeContextDistanceExtractor_setShapeContextWeight(ptr, value); + } + } + + /// + /// The weight of the appearance cost in the final distance value. + /// + public float ImageAppearanceWeight + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.shape_ShapeContextDistanceExtractor_getImageAppearanceWeight(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.shape_ShapeContextDistanceExtractor_setImageAppearanceWeight(ptr, value); + } + } + + /// + /// The weight of the Bending Energy in the final distance value. + /// + public float BendingEnergyWeight + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.shape_ShapeContextDistanceExtractor_getBendingEnergyWeight(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.shape_ShapeContextDistanceExtractor_setBendingEnergyWeight(ptr, value); + } + } + + /// + /// + /// + public int Iterations + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.shape_ShapeContextDistanceExtractor_getIterations(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.shape_ShapeContextDistanceExtractor_setIterations(ptr, value); + } + } + + /// + /// The value of the standard deviation for the Gaussian window for the image appearance cost. + /// + public float StdDev + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.shape_ShapeContextDistanceExtractor_getStdDev(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.shape_ShapeContextDistanceExtractor_setStdDev(ptr, value); + } + } + + #endregion + + #region Methods + + /// + /// Set the images that correspond to each shape. + /// This images are used in the calculation of the Image Appearance cost. + /// + /// Image corresponding to the shape defined by contours1. + /// Image corresponding to the shape defined by contours2. + public void SetImages(InputArray image1, InputArray image2) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (image1 == null) + throw new ArgumentNullException("image1"); + if (image2 == null) + throw new ArgumentNullException("image2"); + image1.ThrowIfDisposed(); + image2.ThrowIfDisposed(); + NativeMethods.shape_ShapeContextDistanceExtractor_setImages(ptr, image1.CvPtr, image2.CvPtr); + GC.KeepAlive(image1); + GC.KeepAlive(image2); + } + + /// + /// Get the images that correspond to each shape. + /// This images are used in the calculation of the Image Appearance cost. + /// + /// Image corresponding to the shape defined by contours1. + /// Image corresponding to the shape defined by contours2. + public void GetImages(OutputArray image1, OutputArray image2) + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + if (image1 == null) + throw new ArgumentNullException("image1"); + if (image2 == null) + throw new ArgumentNullException("image2"); + image1.ThrowIfNotReady(); + image2.ThrowIfNotReady(); + NativeMethods.shape_ShapeContextDistanceExtractor_getImages(ptr, image1.CvPtr, image2.CvPtr); + image1.Fix(); + image2.Fix(); + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/shape/ShapeDistanceExtractor.cs b/src/OpenCvSharp/modules/shape/ShapeDistanceExtractor.cs new file mode 100644 index 000000000..c0b4e5ed0 --- /dev/null +++ b/src/OpenCvSharp/modules/shape/ShapeDistanceExtractor.cs @@ -0,0 +1,38 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable once InconsistentNaming + + /// + /// Abstract base class for shape distance algorithms. + /// + public abstract class ShapeDistanceExtractor : Algorithm + { + /// + /// Compute the shape distance between two shapes defined by its contours. + /// + /// Contour defining first shape. + /// Contour defining second shape. + /// + public virtual float ComputeDistance(InputArray contour1, InputArray contour2) + { + if (ptr == IntPtr.Zero) + throw new ObjectDisposedException(GetType().Name); + if (contour1 == null) + throw new ArgumentNullException("contour1"); + if (contour2 == null) + throw new ArgumentNullException("contour2"); + contour1.ThrowIfDisposed(); + contour2.ThrowIfDisposed(); + + float ret = NativeMethods.shape_ShapeDistanceExtractor_computeDistance( + ptr, contour1.CvPtr, contour2.CvPtr); + + GC.KeepAlive(contour1); + GC.KeepAlive(contour2); + + return ret; + } + } +} diff --git a/src/OpenCvSharp/modules/stitching/Stitcher.cs b/src/OpenCvSharp/modules/stitching/Stitcher.cs new file mode 100644 index 000000000..57ac975b5 --- /dev/null +++ b/src/OpenCvSharp/modules/stitching/Stitcher.cs @@ -0,0 +1,458 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using OpenCvSharp.Detail; +using OpenCvSharp.Util; + +namespace OpenCvSharp +{ +#pragma warning disable 1591 + // ReSharper disable InconsistentNaming + + // TODO + namespace Detail + { + public enum WaveCorrectKind + { + Horizontal, + Vertical + } + + public class FeaturesFinder + { + } + + public class FeaturesMatcher + { + } + + public class BundleAdjusterBase + { + } + + public class WarperCreator + { + } + + public class ExposureCompensator + { + } + + public class SeamFinder + { + } + + public class Blender + { + } + + public class CameraParams + { + } + } + + /// + /// High level image stitcher. + /// It's possible to use this class without being aware of the entire stitching + /// pipeline. However, to be able to achieve higher stitching stability and + /// quality of the final images at least being familiar with the theory is recommended + /// + public sealed class Stitcher : DisposableCvObject + { + private bool disposed; + private Ptr ptrObj; + + #region Enum + + public const int ORIG_RESOL = -1; + + /// + /// Status code + /// + public enum Status + { + OK, + ErrorNeedMoreImgs, + } + + + #endregion + + #region Init & Disposal + + /// + /// Constructor + /// + /// cv::Stitcher* + private Stitcher(IntPtr ptr) + { + this.ptr = ptr; + } + + /// + /// Creates a stitcher with the default parameters. + /// + /// Flag indicating whether GPU should be used + /// whenever it's possible. + public static Stitcher Create(bool tryUseGpu = false) + { + IntPtr ptr = NativeMethods.stitching_createStitcher(tryUseGpu ? 1 : 0); + return new Stitcher(ptr); + } + + /// + /// Deletes all resources + /// + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + // releases unmanaged resources + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + public double RegistrationResol + { + get { return NativeMethods.stitching_Stitcher_registrationResol(ptr); } + set { NativeMethods.stitching_Stitcher_setRegistrationResol(ptr, value); } + } + + public double SeamEstimationResol + { + get { return NativeMethods.stitching_Stitcher_seamEstimationResol(ptr); } + set { NativeMethods.stitching_Stitcher_setRegistrationResol(ptr, value); } + } + + public double CompositingResol + { + get { return NativeMethods.stitching_Stitcher_compositingResol(ptr); } + set { NativeMethods.stitching_Stitcher_setRegistrationResol(ptr, value); } + } + + public double PanoConfidenceThresh + { + get { return NativeMethods.stitching_Stitcher_panoConfidenceThresh(ptr); } + set { NativeMethods.stitching_Stitcher_setRegistrationResol(ptr, value); } + } + + public bool WaveCorrection + { + get { return NativeMethods.stitching_Stitcher_waveCorrection(ptr) != 0; } + set { NativeMethods.stitching_Stitcher_setRegistrationResol(ptr, value ? 1 : 0); } + } + + public WaveCorrectKind WaveCorrectKind + { + get { return (WaveCorrectKind)NativeMethods.stitching_Stitcher_waveCorrectKind(ptr); } + set { NativeMethods.stitching_Stitcher_setRegistrationResol(ptr, (int)value); } + } + + public FeaturesFinder FeaturesFinder + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + + public FeaturesMatcher FeaturesMatcher + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public Mat MatchingMask + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public BundleAdjusterBase BundleAdjuster + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public WarperCreator Warper + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public ExposureCompensator ExposureCompensator + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public SeamFinder SeamFinder + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public Blender Blender + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public int[] Component + { + get + { + IntPtr pointer; + int length; + NativeMethods.stitching_Stitcher_component(ptr, out pointer, out length); + + int[] ret = new int[length]; + Marshal.Copy(pointer, ret, 0, length); + return ret; + } + } + + public CameraParams[] Cameras + { + get { throw new NotImplementedException(); } + } + + public double WorkScale + { + get { return NativeMethods.stitching_Stitcher_workScale(ptr); } + } + + #endregion + + #region Methods + + public Status EstimateTransform(InputArray images) + { + if (images == null) + throw new ArgumentNullException("images"); + images.ThrowIfDisposed(); + + int status = NativeMethods.stitching_Stitcher_estimateTransform_InputArray1( + ptr, images.CvPtr); + return (Status)status; + } + + public Status EstimateTransform(InputArray images, Rect[][] rois) + { + if (images == null) + throw new ArgumentNullException("images"); + if (rois == null) + throw new ArgumentNullException("rois"); + images.ThrowIfDisposed(); + + using (var roisPointer = new ArrayAddress2(rois)) + { + int status = NativeMethods.stitching_Stitcher_estimateTransform_InputArray2( + ptr, images.CvPtr, + roisPointer.Pointer, roisPointer.Dim1Length, roisPointer.Dim2Lengths); + return (Status)status; + } + } + + public Status EstimateTransform(IEnumerable images) + { + if (images == null) + throw new ArgumentNullException("images"); + + IntPtr[] imagesPtrs = EnumerableEx.SelectPtrs(images); + + int status = NativeMethods.stitching_Stitcher_estimateTransform_MatArray1( + ptr, imagesPtrs, imagesPtrs.Length); + return (Status)status; + } + + public Status EstimateTransform(IEnumerable images, Rect[][] rois) + { + if (images == null) + throw new ArgumentNullException("images"); + if (rois == null) + throw new ArgumentNullException("rois"); + + IntPtr[] imagesPtrs = EnumerableEx.SelectPtrs(images); + + using (var roisPointer = new ArrayAddress2(rois)) + { + int status = NativeMethods.stitching_Stitcher_estimateTransform_MatArray2( + ptr, imagesPtrs, imagesPtrs.Length, + roisPointer.Pointer, roisPointer.Dim1Length, roisPointer.Dim2Lengths); + return (Status)status; + } + } + + public Status ComposePanorama(OutputArray pano) + { + if (pano == null) + throw new ArgumentNullException("pano"); + pano.ThrowIfNotReady(); + + int status = NativeMethods.stitching_Stitcher_composePanorama1( + ptr, pano.CvPtr); + pano.Fix(); + return (Status)status; + } + + public Status ComposePanorama(InputArray images, OutputArray pano) + { + if (images == null) + throw new ArgumentNullException("images"); + if (pano == null) + throw new ArgumentNullException("pano"); + images.ThrowIfDisposed(); + pano.ThrowIfNotReady(); + + int status = NativeMethods.stitching_Stitcher_composePanorama2_InputArray( + ptr, images.CvPtr, pano.CvPtr); + pano.Fix(); + return (Status)status; + } + + public Status ComposePanorama(IEnumerable images, OutputArray pano) + { + if (images == null) + throw new ArgumentNullException("images"); + if (pano == null) + throw new ArgumentNullException("pano"); + pano.ThrowIfNotReady(); + + IntPtr[] imagesPtrs = EnumerableEx.SelectPtrs(images); + int status = NativeMethods.stitching_Stitcher_composePanorama2_MatArray( + ptr, imagesPtrs, imagesPtrs.Length, pano.CvPtr); + pano.Fix(); + return (Status)status; + } + + /// + /// Try to stitch the given images. + /// + /// Input images. + /// Final pano. + /// Status code. + public Status Stitch(InputArray images, OutputArray pano) + { + if (images == null) + throw new ArgumentNullException("images"); + if (pano == null) + throw new ArgumentNullException("pano"); + images.ThrowIfDisposed(); + pano.ThrowIfNotReady(); + + Status status = (Status)NativeMethods.stitching_Stitcher_stitch1_InputArray( + ptr, images.CvPtr, pano.CvPtr); + + pano.Fix(); + + return status; + } + + /// + /// Try to stitch the given images. + /// + /// Input images. + /// Final pano. + /// Status code. + public Status Stitch(IEnumerable images, OutputArray pano) + { + if (images == null) + throw new ArgumentNullException("images"); + if (pano == null) + throw new ArgumentNullException("pano"); + pano.ThrowIfNotReady(); + + IntPtr[] imagesPtrs = EnumerableEx.SelectPtrs(images); + + Status status = (Status)NativeMethods.stitching_Stitcher_stitch1_MatArray( + ptr, imagesPtrs, imagesPtrs.Length, pano.CvPtr); + + pano.Fix(); + + return status; + } + + /// + /// Try to stitch the given images. + /// + /// Input images. + /// Region of interest rectangles. + /// Final pano. + /// Status code. + public Status Stitch(InputArray images, Rect[][] rois, OutputArray pano) + { + if (images == null) + throw new ArgumentNullException("images"); + if (rois == null) + throw new ArgumentNullException("rois"); + if (pano == null) + throw new ArgumentNullException("pano"); + images.ThrowIfDisposed(); + pano.ThrowIfNotReady(); + + using (var roisPointer = new ArrayAddress2(rois)) + { + int status = NativeMethods.stitching_Stitcher_stitch2_InputArray( + ptr, images.CvPtr, + roisPointer.Pointer, roisPointer.Dim1Length, roisPointer.Dim2Lengths, + pano.CvPtr); + pano.Fix(); + return (Status)status; + } + } + + /// + /// Try to stitch the given images. + /// + /// Input images. + /// Region of interest rectangles. + /// Final pano. + /// Status code. + public Status Stitch(IEnumerable images, Rect[][] rois, OutputArray pano) + { + if (images == null) + throw new ArgumentNullException("images"); + if (rois == null) + throw new ArgumentNullException("rois"); + if (pano == null) + throw new ArgumentNullException("pano"); + pano.ThrowIfNotReady(); + + IntPtr[] imagesPtrs = EnumerableEx.SelectPtrs(images); + + using (var roisPointer = new ArrayAddress2(rois)) + { + int status = NativeMethods.stitching_Stitcher_stitch2_MatArray( + ptr, imagesPtrs, imagesPtrs.Length, + roisPointer.Pointer, roisPointer.Dim1Length, roisPointer.Dim2Lengths, + pano.CvPtr); + pano.Fix(); + return (Status)status; + } + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/superres/DenseOpticalFlowExt.cs b/src/OpenCvSharp/modules/superres/DenseOpticalFlowExt.cs new file mode 100644 index 000000000..57881cd49 --- /dev/null +++ b/src/OpenCvSharp/modules/superres/DenseOpticalFlowExt.cs @@ -0,0 +1,139 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + /// + /// + /// + public abstract class DenseOpticalFlowExt : Algorithm + { + #region Init & Disposal + + /// + /// + /// + protected DenseOpticalFlowExt() + { + } + + /// + /// + /// + /// + public static DenseOpticalFlowExt CreateFarneback() + { + IntPtr ptr = NativeMethods.superres_createOptFlow_Farneback(); + return DenseOpticalFlowExtImpl.FromPtr(ptr); + } + /// + /// + /// + /// + public static DenseOpticalFlowExt CreateFarneback_CUDA() + { + IntPtr ptr = NativeMethods.superres_createOptFlow_Farneback_CUDA(); + return DenseOpticalFlowExtImpl.FromPtr(ptr); + } + /// + /// + /// + /// + public static DenseOpticalFlowExt CreateFarneback_OCL() + { + throw new NotImplementedException(); + //IntPtr ptr = NativeMethods.superres_createOptFlow_Farneback_OCL(); + //return DenseOpticalFlowExtImpl.FromPtr(ptr); + } + + /// + /// + /// + /// + public static DenseOpticalFlowExt CreateSimple() + { + throw new NotImplementedException(); + //IntPtr ptr = NativeMethods.superres_createOptFlow_Simple(); + //return DenseOpticalFlowExtImpl.FromPtr(ptr); + } + + /// + /// + /// + /// + public static DenseOpticalFlowExt CreateDualTVL1() + { + IntPtr ptr = NativeMethods.superres_createOptFlow_Farneback(); + return DenseOpticalFlowExtImpl.FromPtr(ptr); + } + /// + /// + /// + /// + public static DenseOpticalFlowExt CreateDualTVL1_CUDA() + { + IntPtr ptr = NativeMethods.superres_createOptFlow_Farneback_CUDA(); + return DenseOpticalFlowExtImpl.FromPtr(ptr); + } + /// + /// + /// + /// + public static DenseOpticalFlowExt CreateDualTVL1_OCL() + { + throw new NotImplementedException(); + //IntPtr ptr = NativeMethods.superres_createOptFlow_Farneback_OCL(); + //return DenseOpticalFlowExtImpl.FromPtr(ptr); + } + + /// + /// + /// + /// + public static DenseOpticalFlowExt CreateBrox_CUDA() + { + IntPtr ptr = NativeMethods.superres_createOptFlow_Brox_CUDA(); + return DenseOpticalFlowExtImpl.FromPtr(ptr); + } + + /// + /// + /// + /// + public static DenseOpticalFlowExt CreatePyrLK_CUDA() + { + IntPtr ptr = NativeMethods.superres_createOptFlow_PyrLK_CUDA(); + return DenseOpticalFlowExtImpl.FromPtr(ptr); + } + + /// + /// + /// + /// + public static DenseOpticalFlowExt CreatePyrLK_OCL() + { + throw new NotImplementedException(); + //IntPtr ptr = NativeMethods.superres_createOptFlow_PyrLK_OCL(); + //return DenseOpticalFlowExtImpl.FromPtr(ptr); + } + + #endregion + + /// + /// Clear all inner buffers. + /// + public virtual void CollectGarbage() + { + } + + /// + /// + /// + /// + /// + /// + /// + public abstract void Calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2 = null); + } +} diff --git a/src/OpenCvSharp/modules/superres/DenseOpticalFlowExtImpl.cs b/src/OpenCvSharp/modules/superres/DenseOpticalFlowExtImpl.cs new file mode 100644 index 000000000..e23defe0c --- /dev/null +++ b/src/OpenCvSharp/modules/superres/DenseOpticalFlowExtImpl.cs @@ -0,0 +1,156 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + /// + /// + /// + internal sealed class DenseOpticalFlowExtImpl : DenseOpticalFlowExt + { + private bool disposed; + + /// + /// + /// + private Ptr detectorPtr; + + #region Init & Disposal + + /// + /// + /// + private DenseOpticalFlowExtImpl() + { + detectorPtr = null; + ptr = IntPtr.Zero; + } + + /// + /// Creates instance from cv::Ptr<T> . + /// ptr is disposed when the wrapper disposes. + /// + /// + internal static DenseOpticalFlowExtImpl FromPtr(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Invalid DenseOpticalFlowExt pointer"); + + var ptrObj = new Ptr(ptr); + var obj = new DenseOpticalFlowExtImpl + { + detectorPtr = ptrObj, + ptr = ptrObj.Get() + }; + return obj; + } + + /// + /// Creates instance from raw pointer T* + /// + /// + internal static DenseOpticalFlowExtImpl FromRawPtr(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Invalid DenseOpticalFlowExt pointer"); + var obj = new DenseOpticalFlowExtImpl + { + detectorPtr = null, + ptr = ptr + }; + return obj; + } + + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + } + // releases unmanaged resources + if (IsEnabledDispose) + { + if (detectorPtr != null) + detectorPtr.Dispose(); + detectorPtr = null; + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Methods + + /// + /// + /// + /// + /// + /// + /// + public override void Calc( + InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2 = null) + { + if (frame0 == null) + throw new ArgumentNullException("frame0"); + if (frame1 == null) + throw new ArgumentNullException("frame1"); + if (flow1 == null) + throw new ArgumentNullException("flow1"); + frame0.ThrowIfDisposed(); + frame1.ThrowIfDisposed(); + flow1.ThrowIfNotReady(); + if (flow2 != null) + flow2.ThrowIfNotReady(); + + NativeMethods.superres_DenseOpticalFlowExt_calc( + ptr, frame0.CvPtr, frame1.CvPtr, flow1.CvPtr, Cv2.ToPtr(flow2)); + + flow1.Fix(); + if (flow2 != null) + flow2.Fix(); + } + + /// + /// + /// + public override void CollectGarbage() + { + NativeMethods.superres_DenseOpticalFlowExt_collectGarbage(ptr); + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/superres/FrameSource.cs b/src/OpenCvSharp/modules/superres/FrameSource.cs new file mode 100644 index 000000000..0cc06c128 --- /dev/null +++ b/src/OpenCvSharp/modules/superres/FrameSource.cs @@ -0,0 +1,88 @@ +using System; +using System.IO; + +namespace OpenCvSharp +{ + /// + /// + /// + public abstract class FrameSource : DisposableCvObject + { + #region Init & Disposal + + /// + /// + /// + protected FrameSource() + { + } + + /// + /// + /// + /// + public static FrameSource CreateEmptySource() + { + IntPtr ptr = NativeMethods.superres_createFrameSource_Empty(); + return FrameSourceImpl.FromPtr(ptr); + } + + /// + /// + /// + /// + /// + public static FrameSource CreateVideoSource(string fileName) + { + if (String.IsNullOrEmpty("fileName")) + throw new ArgumentNullException("fileName"); + if (!File.Exists(fileName)) + throw new FileNotFoundException("", fileName); + IntPtr ptr = NativeMethods.superres_createFrameSource_Video(fileName); + return FrameSourceImpl.FromPtr(ptr); + } + + /// + /// + /// + /// + /// + public static FrameSource CreateVideoSourceCuda(string fileName) + { + if (String.IsNullOrEmpty("fileName")) + throw new ArgumentNullException("fileName"); + if (!File.Exists(fileName)) + throw new FileNotFoundException("", fileName); + IntPtr ptr = NativeMethods.superres_createFrameSource_Video_CUDA(fileName); + return FrameSourceImpl.FromPtr(ptr); + } + + /// + /// + /// + /// + /// + public static FrameSource CreateCameraSource(int deviceId) + { + IntPtr ptr = NativeMethods.superres_createFrameSource_Camera(deviceId); + return FrameSourceImpl.FromPtr(ptr); + } + + #endregion + + #region Methods + + /// + /// + /// + /// + public abstract void NextFrame(OutputArray frame); + + /// + /// + /// + public abstract void Reset(); + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/superres/FrameSourceImpl.cs b/src/OpenCvSharp/modules/superres/FrameSourceImpl.cs new file mode 100644 index 000000000..d22b66c19 --- /dev/null +++ b/src/OpenCvSharp/modules/superres/FrameSourceImpl.cs @@ -0,0 +1,127 @@ +using System; + +namespace OpenCvSharp +{ + /// + /// + /// + internal sealed class FrameSourceImpl : FrameSource + { + private bool disposed; + private Ptr ptrObj; + + #region Init & Disposal + + /// + /// + /// + private FrameSourceImpl() + { + ptrObj = null; + ptr = IntPtr.Zero; + } + + /// + /// Creates instance from cv::Ptr<T> . + /// ptr is disposed when the wrapper disposes. + /// + /// + internal static FrameSource FromPtr(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Invalid FrameSource pointer"); + var obj = new FrameSourceImpl(); + var ptrObj = new Ptr(ptr); + obj.ptrObj = ptrObj; + obj.ptr = ptr; + return obj; + } + + /// + /// Creates instance from raw pointer T* + /// + /// + internal static FrameSource FromRawPtr(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Invalid FrameSource pointer"); + var obj = new FrameSourceImpl + { + ptrObj = null, + ptr = ptr + }; + return obj; + } + + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + } + // releases unmanaged resources + if (IsEnabledDispose) + { + if (ptrObj != null) + ptrObj.Dispose(); + ptrObj = null; + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Methods + /// + /// + /// + /// + public override void NextFrame(OutputArray frame) + { + ThrowIfDisposed(); + if (frame == null) + throw new ArgumentNullException("frame"); + frame.ThrowIfNotReady(); + NativeMethods.superres_FrameSource_nextFrame(ptr, frame.CvPtr); + frame.Fix(); + } + /// + /// + /// + public override void Reset() + { + ThrowIfDisposed(); + NativeMethods.superres_FrameSource_reset(ptr); + } + #endregion + } +} diff --git a/src/OpenCvSharp/modules/superres/SuperResolution.cs b/src/OpenCvSharp/modules/superres/SuperResolution.cs new file mode 100644 index 000000000..324aa6b3f --- /dev/null +++ b/src/OpenCvSharp/modules/superres/SuperResolution.cs @@ -0,0 +1,122 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + /// + /// Base class for Super Resolution algorithms. + /// + public abstract class SuperResolution : Algorithm + { + /// + /// + /// + protected FrameSource frameSource; + /// + /// + /// + protected bool firstCall; + + #region Init & Disposal + + /// + /// + /// + protected SuperResolution() + { + frameSource = null; + firstCall = true; + } + + /// + /// Create Bilateral TV-L1 Super Resolution. + /// + /// + public static SuperResolution CreateBTVL1() + { + IntPtr ptr = NativeMethods.superres_createSuperResolution_BTVL1(); + return SuperResolutionImpl.FromPtr(ptr); + } + /// + /// Create Bilateral TV-L1 Super Resolution. + /// + /// + public static SuperResolution CreateBTVL1_CUDA() + { + IntPtr ptr = NativeMethods.superres_createSuperResolution_BTVL1_CUDA(); + return SuperResolutionImpl.FromPtr(ptr); + } + /// + /// Create Bilateral TV-L1 Super Resolution. + /// + /// + public static SuperResolution CreateBTVL1_OCL() + { + throw new NotImplementedException(); + //IntPtr ptr = NativeMethods.superres_createSuperResolution_BTVL1_OCL(); + //return SuperResolutionImpl.FromPtr(ptr); + } + + #endregion + + #region Methods + + /// + /// Set input frame source for Super Resolution algorithm. + /// + /// Input frame source + public virtual void SetInput(FrameSource fs) + { + frameSource = fs; + } + + /// + /// Process next frame from input and return output result. + /// + /// Output result + public virtual void NextFrame(OutputArray frame) + { + if (firstCall) + { + InitImpl(frameSource); + firstCall = false; + } + + ProcessImpl(frameSource, frame); + } + + /// + /// + /// + public virtual void Reset() + { + frameSource.Reset(); + firstCall = true; + } + + /// + /// Clear all inner buffers. + /// + public virtual void CollectGarbage() + { + } + + /// + /// + /// + /// + protected abstract void InitImpl(FrameSource fs); + /// + /// + /// + /// + /// + protected abstract void ProcessImpl(FrameSource fs, OutputArray output); + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/superres/SuperResolutionImpl.cs b/src/OpenCvSharp/modules/superres/SuperResolutionImpl.cs new file mode 100644 index 000000000..6103e062d --- /dev/null +++ b/src/OpenCvSharp/modules/superres/SuperResolutionImpl.cs @@ -0,0 +1,181 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + /// + /// class for defined Super Resolution algorithm. + /// + internal sealed class SuperResolutionImpl : SuperResolution + { + private bool disposed; + + /// + /// + /// + private Ptr detectorPtr; + + #region Init & Disposal + + /// + /// + /// + private SuperResolutionImpl() + { + detectorPtr = null; + ptr = IntPtr.Zero; + } + + /// + /// Creates instance from cv::Ptr<T> . + /// ptr is disposed when the wrapper disposes. + /// + /// + internal static SuperResolutionImpl FromPtr(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Invalid FrameSource pointer"); + + var ptrObj = new Ptr(ptr); + var obj = new SuperResolutionImpl + { + detectorPtr = ptrObj, + ptr = ptrObj.Get() + }; + return obj; + } + + /// + /// Creates instance from raw pointer T* + /// + /// + internal static SuperResolutionImpl FromRawPtr(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Invalid FrameSource pointer"); + var obj = new SuperResolutionImpl + { + detectorPtr = null, + ptr = ptr + }; + return obj; + } + + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + } + // releases unmanaged resources + if (IsEnabledDispose) + { + if (detectorPtr != null) + detectorPtr.Dispose(); + detectorPtr = null; + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Methods + + /// + /// + /// + /// + public override void SetInput(FrameSource fs) + { + ThrowIfDisposed(); + if (fs == null) + throw new ArgumentNullException("fs"); + NativeMethods.superres_SuperResolution_setInput(ptr, fs.CvPtr); + } + + /// + /// + /// + /// + public override void NextFrame(OutputArray frame) + { + ThrowIfDisposed(); + if (frame == null) + throw new ArgumentNullException("frame"); + frame.ThrowIfNotReady(); + NativeMethods.superres_SuperResolution_nextFrame(ptr, frame.CvPtr); + frame.Fix(); + } + + /// + /// + /// + public override void Reset() + { + ThrowIfDisposed(); + NativeMethods.superres_SuperResolution_reset(ptr); + } + + /// + /// + /// + public override void CollectGarbage() + { + ThrowIfDisposed(); + NativeMethods.superres_SuperResolution_collectGarbage(ptr); + } + + /// + /// + /// + /// + protected override void InitImpl(FrameSource fs) + { + // ネイティブ実装なので特別に空で。 + } + + /// + /// + /// + /// + /// + protected override void ProcessImpl(FrameSource fs, OutputArray output) + { + // ネイティブ実装なので特別に空で。 + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/video/BackgroundSubtractor.cs b/src/OpenCvSharp/modules/video/BackgroundSubtractor.cs new file mode 100644 index 000000000..b9e28a6e7 --- /dev/null +++ b/src/OpenCvSharp/modules/video/BackgroundSubtractor.cs @@ -0,0 +1,48 @@ +using System; + +namespace OpenCvSharp +{ + /// + /// The Base Class for Background/Foreground Segmentation. + /// The class is only used to define the common interface for + /// the whole family of background/foreground segmentation algorithms. + /// + public abstract class BackgroundSubtractor : Algorithm + { + /// + /// the update operator that takes the next video frame and returns the current foreground mask as 8-bit binary image. + /// + /// + /// + /// + public virtual void Apply(InputArray image, OutputArray fgmask, double learningRate = -1) + { + if (image == null) + throw new ArgumentNullException("image"); + if (fgmask == null) + throw new ArgumentNullException("fgmask"); + image.ThrowIfDisposed(); + fgmask.ThrowIfNotReady(); + + NativeMethods.video_BackgroundSubtractor_apply(ptr, image.CvPtr, fgmask.CvPtr, learningRate); + + fgmask.Fix(); + GC.KeepAlive(image); + } + + /// + /// computes a background image + /// + /// + public virtual void GetBackgroundImage(OutputArray backgroundImage) + { + if (backgroundImage == null) + throw new ArgumentNullException("backgroundImage"); + backgroundImage.ThrowIfNotReady(); + + NativeMethods.video_BackgroundSubtractor_getBackgroundImage(ptr, backgroundImage.CvPtr); + + backgroundImage.Fix(); + } + } +} diff --git a/src/OpenCvSharp/modules/video/BackgroundSubtractorGMG.cs b/src/OpenCvSharp/modules/video/BackgroundSubtractorGMG.cs new file mode 100644 index 000000000..7b0c7c38f --- /dev/null +++ b/src/OpenCvSharp/modules/video/BackgroundSubtractorGMG.cs @@ -0,0 +1,329 @@ +using System; + +namespace OpenCvSharp.CPlusPlus +{ + // ReSharper disable InconsistentNaming + + /// + /// The Base Class for Background/Foreground Segmentation. + /// The class is only used to define the common interface for + /// the whole family of background/foreground segmentation algorithms. + /// + public class BackgroundSubtractorGMG : BackgroundSubtractor + { + private Ptr objectPtr; + private bool disposed = false; + + #region Init & Disposal + + /// + /// the default constructor + /// + public BackgroundSubtractorGMG() + { + IntPtr po = NativeMethods.video_BackgroundSubtractorGMG_new(); + if (po == IntPtr.Zero) + throw new OpenCvSharpException("Failed to create BackgroundSubtractorGMG"); + objectPtr = new Ptr(po); + ptr = objectPtr.Obj; + } + + internal BackgroundSubtractorGMG(Ptr objectPtr, IntPtr ptr) + { + this.objectPtr = objectPtr; + this.ptr = ptr; + } + + /// + /// Creates instance from cv::Ptr<T> . + /// ptr is disposed when the wrapper disposes. + /// + /// + internal new static BackgroundSubtractorGMG FromPtr(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Invalid BackgroundSubtractorGMG pointer"); + + var ptrObj = new Ptr(ptr); + var obj = new BackgroundSubtractorGMG(ptrObj, ptrObj.Obj); + return obj; + } + + /// + /// Creates instance from raw T* + /// + /// + internal new static BackgroundSubtractorGMG FromRawPtr(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Invalid BackgroundSubtractorGMG pointer"); + var obj = new BackgroundSubtractorGMG(null, ptr); + return obj; + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + if (objectPtr != null) + { + objectPtr.Dispose(); + } + else + { + if (ptr != IntPtr.Zero) + NativeMethods.video_BackgroundSubtractorGMG_delete(ptr); + } + objectPtr = null; + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// Total number of distinct colors to maintain in histogram. + /// + public int MaxFeatures + { + get + { + unsafe + { + return *NativeMethods.video_BackgroundSubtractorGMG_maxFeatures(ptr); + } + } + + set + { + unsafe + { + *NativeMethods.video_BackgroundSubtractorGMG_maxFeatures(ptr) = value; + } + } + } + + /// + /// Set between 0.0 and 1.0, determines how quickly features are "forgotten" from histograms. + /// + public double LearningRate + { + get + { + unsafe + { + return *NativeMethods.video_BackgroundSubtractorGMG_learningRate(ptr); + } + } + set + { + unsafe + { + *NativeMethods.video_BackgroundSubtractorGMG_learningRate(ptr) = value; + } + } + } + + /// + /// Number of frames of video to use to initialize histograms. + /// + public int NumInitializationFrames + { + get + { + unsafe + { + return *NativeMethods.video_BackgroundSubtractorGMG_numInitializationFrames(ptr); + } + } + set + { + unsafe + { + *NativeMethods.video_BackgroundSubtractorGMG_numInitializationFrames(ptr) = value; + } + } + } + + /// + /// Number of discrete levels in each channel to be used in histograms. + /// + public int QuantizationLevels + { + get + { + unsafe + { + return *NativeMethods.video_BackgroundSubtractorGMG_quantizationLevels(ptr); + } + } + set + { + unsafe + { + *NativeMethods.video_BackgroundSubtractorGMG_quantizationLevels(ptr) = value; + } + } + } + + /// + /// Prior probability that any given pixel is a background pixel. A sensitivity parameter. + /// + public double BackgroundPrior + { + get + { + unsafe + { + return *NativeMethods.video_BackgroundSubtractorGMG_backgroundPrior(ptr); + } + } + set + { + unsafe + { + *NativeMethods.video_BackgroundSubtractorGMG_backgroundPrior(ptr) = value; + } + } + } + + /// + /// Value above which pixel is determined to be FG. + /// + public double DecisionThreshold + { + get + { + unsafe + { + return *NativeMethods.video_BackgroundSubtractorGMG_decisionThreshold(ptr); + } + } + set + { + unsafe + { + *NativeMethods.video_BackgroundSubtractorGMG_decisionThreshold(ptr) = value; + } + } + } + + /// + /// Smoothing radius, in pixels, for cleaning up FG image. + /// + public int SmoothingRadius + { + get + { + unsafe + { + return *NativeMethods.video_BackgroundSubtractorGMG_smoothingRadius(ptr); + } + } + set + { + unsafe + { + *NativeMethods.video_BackgroundSubtractorGMG_smoothingRadius(ptr) = value; + } + } + } + + /// + /// Perform background model update + /// + public bool UpdateBackgroundModel + { + get + { + return NativeMethods.video_BackgroundSubtractorGMG_updateBackgroundModel_get(ptr) != 0; + } + set + { + NativeMethods.video_BackgroundSubtractorGMG_updateBackgroundModel_set(ptr, value ? 1 : 0); + } + } + + #endregion + + /// + /// Performs single-frame background subtraction and builds up a statistical background image + /// + /// Input image + /// Output mask image representing foreground and background pixels + /// + public override void Run(InputArray image, OutputArray fgmask, double learningRate = -1.0) + { + if (image == null) + throw new ArgumentNullException("image"); + if (fgmask == null) + throw new ArgumentNullException("fgmask"); + image.ThrowIfDisposed(); + fgmask.ThrowIfNotReady(); + NativeMethods.video_BackgroundSubtractorGMG_operator(ptr, image.CvPtr, fgmask.CvPtr, learningRate); + fgmask.Fix(); + } + + /// + /// Validate parameters and set up data structures for appropriate image size. + /// Must call before running on data. + /// + /// input frame size + /// minimum value taken on by pixels in image sequence. Usually 0 + /// maximum value taken on by pixels in image sequence. e.g. 1.0 or 255 + public virtual void Initialize(Size frameSize, double min, double max) + { + NativeMethods.video_BackgroundSubtractorGMG_initialize(ptr, frameSize, min, max); + } + + /// + /// Releases all inner buffers. + /// + public new void Release() + { + NativeMethods.video_BackgroundSubtractorGMG_release(ptr); + } + + /// + /// Pointer to algorithm information (cv::AlgorithmInfo*) + /// + /// + public override IntPtr InfoPtr + { + get { return NativeMethods.video_BackgroundSubtractorGMG_info(ptr); } + } + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/video/BackgroundSubtractorKNN.cs b/src/OpenCvSharp/modules/video/BackgroundSubtractorKNN.cs new file mode 100644 index 000000000..fbf127603 --- /dev/null +++ b/src/OpenCvSharp/modules/video/BackgroundSubtractorKNN.cs @@ -0,0 +1,226 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + /// + /// K nearest neigbours algorithm + /// + public class BackgroundSubtractorKNN : BackgroundSubtractor + { + /// + /// cv::Ptr<T> + /// + private Ptr objectPtr; + /// + /// + /// + private bool disposed; + + #region Init & Disposal + + /// + /// + /// + /// + /// + /// + /// + public static BackgroundSubtractorKNN Create( + int history=500, double dist2Threshold=400.0, bool detectShadows=true) + { + IntPtr ptr = NativeMethods.video_createBackgroundSubtractorKNN( + history, dist2Threshold, detectShadows ? 1 : 0); + return new BackgroundSubtractorKNN(ptr); + } + + internal BackgroundSubtractorKNN(IntPtr ptr) + { + this.objectPtr = new Ptr(ptr); + this.ptr = objectPtr.Get(); + } + +#if LANG_JP + /// + /// \[X̉ + /// + /// + /// truȅꍇ́Ã\bh[UR[h璼ڂĂ΂ꂽƂB}l[WEA}l[Wõ\[XB + /// falsȅꍇ́Ã\bh̓^Ct@CiCUɂČĂ΂Aق̃IuWFNgQƂĂȂƂBA}l[W\[X̂݉B + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + if (objectPtr != null) + { + objectPtr.Dispose(); + } + objectPtr = null; + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + + /// + /// + /// + public int History + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.video_BackgroundSubtractorKNN_getHistory(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.video_BackgroundSubtractorKNN_setHistory(ptr, value); + } + } + + /// + /// + /// + public int NSamples + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.video_BackgroundSubtractorKNN_getNSamples(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.video_BackgroundSubtractorKNN_setNSamples(ptr, value); + } + } + + /// + /// + /// + public double Dist2Threshold + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.video_BackgroundSubtractorKNN_getDist2Threshold(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.video_BackgroundSubtractorKNN_setDist2Threshold(ptr, value); + } + } + + /// + /// + /// + public int KNNSamples + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.video_BackgroundSubtractorKNN_getkNNSamples(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.video_BackgroundSubtractorKNN_setkNNSamples(ptr, value); + } + } + + /// + /// + /// + public bool DetectShadows + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.video_BackgroundSubtractorKNN_getDetectShadows(ptr) != 0; + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.video_BackgroundSubtractorKNN_setDetectShadows(ptr, value ? 1 : 0); + } + } + + /// + /// + /// + public int ShadowValue + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.video_BackgroundSubtractorKNN_getShadowValue(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.video_BackgroundSubtractorKNN_setShadowValue(ptr, value); + } + } + + /// + /// + /// + public double ShadowThreshold + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.video_BackgroundSubtractorKNN_getShadowThreshold(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.video_BackgroundSubtractorKNN_setShadowThreshold(ptr, value); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/video/BackgroundSubtractorMOG.cs b/src/OpenCvSharp/modules/video/BackgroundSubtractorMOG.cs new file mode 100644 index 000000000..b09be43d8 --- /dev/null +++ b/src/OpenCvSharp/modules/video/BackgroundSubtractorMOG.cs @@ -0,0 +1,163 @@ +using System; + +namespace OpenCvSharp.CPlusPlus +{ + // ReSharper disable InconsistentNaming + + /// + /// The Base Class for Background/Foreground Segmentation. + /// The class is only used to define the common interface for + /// the whole family of background/foreground segmentation algorithms. + /// + public class BackgroundSubtractorMOG : BackgroundSubtractor + { + private Ptr objectPtr; + private bool disposed = false; + + #region Init & Disposal + /// + /// the default constructor + /// + public BackgroundSubtractorMOG() + { + IntPtr po = NativeMethods.video_BackgroundSubtractorMOG_new1(); + if (po == IntPtr.Zero) + throw new OpenCvSharpException("Failed to create BackgroundSubtractorMOG"); + objectPtr = new Ptr(po); + ptr = objectPtr.Obj; + } + /// + /// the full constructor that takes the length of the history, the number of gaussian mixtures, the background ratio parameter and the noise strength + /// + /// + /// + /// + /// + public BackgroundSubtractorMOG(int history, int nmixtures, double backgroundRatio, double noiseSigma=0) + { + IntPtr po = NativeMethods.video_BackgroundSubtractorMOG_new2(history, nmixtures, backgroundRatio, noiseSigma); + if (po == IntPtr.Zero) + throw new OpenCvSharpException("Failed to create BackgroundSubtractorMOG"); + objectPtr = new Ptr(po); + ptr = objectPtr.Obj; + } + + internal BackgroundSubtractorMOG(Ptr objectPtr, IntPtr ptr) + { + this.objectPtr = objectPtr; + this.ptr = ptr; + } + + /// + /// Creates instance from cv::Ptr<T> . + /// ptr is disposed when the wrapper disposes. + /// + /// + internal static new BackgroundSubtractorMOG FromPtr(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Invalid BackgroundSubtractorMOG pointer"); + + var ptrObj = new Ptr(ptr); + var obj = new BackgroundSubtractorMOG(ptrObj, ptrObj.Obj); + return obj; + } + /// + /// Creates instance from raw T* + /// + /// + internal static new BackgroundSubtractorMOG FromRawPtr(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Invalid BackgroundSubtractorMOG pointer"); + var obj = new BackgroundSubtractorMOG(null, ptr); + return obj; + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + if (objectPtr != null) + { + objectPtr.Dispose(); + } + else + { + NativeMethods.video_BackgroundSubtractorMOG_delete(ptr); + } + objectPtr = null; + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + /// + /// the update operator + /// + /// + /// + /// + public override void Run(InputArray image, OutputArray fgmask, double learningRate = 0) + { + if (image == null) + throw new ArgumentNullException("image"); + if (fgmask == null) + throw new ArgumentNullException("fgmask"); + image.ThrowIfDisposed(); + fgmask.ThrowIfNotReady(); + NativeMethods.video_BackgroundSubtractorMOG_operator(ptr, image.CvPtr, fgmask.CvPtr, learningRate); + fgmask.Fix(); + } + + /// + /// re-initiaization method + /// + /// + /// + public virtual void Initialize(Size frameSize, int frameType) + { + NativeMethods.video_BackgroundSubtractorMOG_initialize(ptr, frameSize, frameType); + } + + /// + /// Pointer to algorithm information (cv::AlgorithmInfo*) + /// + /// + public override IntPtr InfoPtr + { + get { return NativeMethods.video_BackgroundSubtractorMOG_info(ptr); } + } + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/video/BackgroundSubtractorMog2.cs b/src/OpenCvSharp/modules/video/BackgroundSubtractorMog2.cs new file mode 100644 index 000000000..a42824b2c --- /dev/null +++ b/src/OpenCvSharp/modules/video/BackgroundSubtractorMog2.cs @@ -0,0 +1,324 @@ +using System; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + /// + /// The Base Class for Background/Foreground Segmentation. + /// The class is only used to define the common interface for + /// the whole family of background/foreground segmentation algorithms. + /// + public class BackgroundSubtractorMOG2 : BackgroundSubtractor + { + /// + /// cv::Ptr<T> + /// + private Ptr objectPtr; + /// + /// + /// + private bool disposed; + + #region Init & Disposal + + /// + /// + /// + /// + /// + /// + /// + public static BackgroundSubtractorMOG2 Create( + int history = 500, double varThreshold = 16, bool detectShadows = true) + { + IntPtr ptr = NativeMethods.video_createBackgroundSubtractorMOG2( + history, varThreshold, detectShadows ? 1 : 0); + return new BackgroundSubtractorMOG2(ptr); + } + + internal BackgroundSubtractorMOG2(IntPtr ptr) + { + this.objectPtr = new Ptr(ptr); + this.ptr = objectPtr.Get(); + } + +#if LANG_JP + /// + /// \[X̉ + /// + /// + /// truȅꍇ́Ã\bh[UR[h璼ڂĂ΂ꂽƂB}l[WEA}l[Wõ\[XB + /// falsȅꍇ́Ã\bh̓^Ct@CiCUɂČĂ΂Aق̃IuWFNgQƂĂȂƂBA}l[W\[X̂݉B + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + if (objectPtr != null) + { + objectPtr.Dispose(); + } + objectPtr = null; + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + + /// + /// + /// + public int History + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.video_BackgroundSubtractorMOG2_getHistory(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.video_BackgroundSubtractorMOG2_setHistory(ptr, value); + } + } + + /// + /// + /// + public int NMixtures + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.video_BackgroundSubtractorMOG2_getNMixtures(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.video_BackgroundSubtractorMOG2_setNMixtures(ptr, value); + } + } + + /// + /// + /// + public double BackgroundRatio + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.video_BackgroundSubtractorMOG2_getBackgroundRatio(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.video_BackgroundSubtractorMOG2_setBackgroundRatio(ptr, value); + } + } + + /// + /// + /// + public double VarThreshold + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.video_BackgroundSubtractorMOG2_getHistory(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.video_BackgroundSubtractorMOG2_setVarThreshold(ptr, value); + } + } + + /// + /// + /// + public double VarThresholdGen + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.video_BackgroundSubtractorMOG2_getVarThresholdGen(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.video_BackgroundSubtractorMOG2_setVarThresholdGen(ptr, value); + } + } + + /// + /// + /// + public double VarInit + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.video_BackgroundSubtractorMOG2_getVarInit(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.video_BackgroundSubtractorMOG2_setVarInit(ptr, value); + } + } + + /// + /// + /// + public double VarMin + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.video_BackgroundSubtractorMOG2_getVarMin(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.video_BackgroundSubtractorMOG2_setVarMin(ptr, value); + } + } + + /// + /// + /// + public double VarMax + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.video_BackgroundSubtractorMOG2_getVarMax(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.video_BackgroundSubtractorMOG2_setVarMax(ptr, value); + } + } + + /// + /// + /// + public double ComplexityReductionThreshold + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.video_BackgroundSubtractorMOG2_getComplexityReductionThreshold(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.video_BackgroundSubtractorMOG2_setComplexityReductionThreshold(ptr, value); + } + } + + /// + /// + /// + public bool DetectShadows + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.video_BackgroundSubtractorMOG2_getDetectShadows(ptr) != 0; + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.video_BackgroundSubtractorMOG2_setDetectShadows(ptr, value ? 1 : 0); + } + } + + /// + /// + /// + public int ShadowValue + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.video_BackgroundSubtractorMOG2_getShadowValue(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.video_BackgroundSubtractorMOG2_setShadowValue(ptr, value); + } + } + + /// + /// + /// + public double ShadowThreshold + { + get + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + return NativeMethods.video_BackgroundSubtractorMOG2_getShadowThreshold(ptr); + } + set + { + if (disposed) + throw new ObjectDisposedException(GetType().Name); + NativeMethods.video_BackgroundSubtractorMOG2_setShadowThreshold(ptr, value); + } + } + + #endregion + + } +} \ No newline at end of file diff --git a/src/OpenCvSharp/modules/video/DenseOpticalFlow.cs b/src/OpenCvSharp/modules/video/DenseOpticalFlow.cs new file mode 100644 index 000000000..badef590d --- /dev/null +++ b/src/OpenCvSharp/modules/video/DenseOpticalFlow.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + /// + /// + /// + public abstract class DenseOpticalFlow : Algorithm + { + #region Init & Disposal + + /// + /// + /// + protected DenseOpticalFlow() + { + } + + /// + /// + /// + /// + public static DenseOpticalFlow CreateOptFlow_DualTVL1() + { + IntPtr ptr = NativeMethods.video_createOptFlow_DualTVL1(); + return DenseOpticalFlowImpl.FromPtr(ptr); + } + + #endregion + + /// + /// Clear all inner buffers. + /// + public virtual void CollectGarbage() + { + } + + /// + /// + /// + /// + /// + /// + public abstract void Calc(InputArray frame0, InputArray frame1, InputOutputArray flow); + } +} diff --git a/src/OpenCvSharp/modules/video/DenseOpticalFlowImpl.cs b/src/OpenCvSharp/modules/video/DenseOpticalFlowImpl.cs new file mode 100644 index 000000000..901203b1b --- /dev/null +++ b/src/OpenCvSharp/modules/video/DenseOpticalFlowImpl.cs @@ -0,0 +1,154 @@ +using System; +using System.Collections.Generic; + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + + /// + /// + /// + internal sealed class DenseOpticalFlowImpl : DenseOpticalFlow + { + private bool disposed; + + /// + /// + /// + private Ptr detectorPtr; + + #region Init & Disposal + + /// + /// + /// + private DenseOpticalFlowImpl() + { + detectorPtr = null; + ptr = IntPtr.Zero; + } + + /// + /// Creates instance from cv::Ptr<T> . + /// ptr is disposed when the wrapper disposes. + /// + /// + internal static DenseOpticalFlowImpl FromPtr(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Invalid DenseOpticalFlow pointer"); + + var ptrObj = new Ptr(ptr); + var obj = new DenseOpticalFlowImpl + { + detectorPtr = ptrObj, + ptr = ptrObj.Get() + }; + return obj; + } + + /// + /// Creates instance from raw pointer T* + /// + /// + internal static DenseOpticalFlowImpl FromRawPtr(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Invalid DenseOpticalFlow pointer"); + var obj = new DenseOpticalFlowImpl + { + detectorPtr = null, + ptr = ptr + }; + return obj; + } + + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + } + // releases unmanaged resources + if (IsEnabledDispose) + { + if (detectorPtr != null) + detectorPtr.Dispose(); + detectorPtr = null; + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Methods + + /// + /// + /// + /// + /// + /// + public override void Calc( + InputArray frame0, InputArray frame1, InputOutputArray flow) + { + if (disposed) + throw new ObjectDisposedException("DenseOpticalFlowImpl"); + if (frame0 == null) + throw new ArgumentNullException("frame0"); + if (frame1 == null) + throw new ArgumentNullException("frame1"); + if (flow == null) + throw new ArgumentNullException("flow"); + frame0.ThrowIfDisposed(); + frame1.ThrowIfDisposed(); + flow.ThrowIfNotReady(); + + NativeMethods.video_DenseOpticalFlow_calc( + ptr, frame0.CvPtr, frame1.CvPtr, flow.CvPtr); + + flow.Fix(); + } + + /// + /// + /// + public override void CollectGarbage() + { + if (disposed) + throw new ObjectDisposedException("DenseOpticalFlowImpl"); + NativeMethods.video_DenseOpticalFlow_collectGarbage(ptr); + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/video/KalmanFilter.cs b/src/OpenCvSharp/modules/video/KalmanFilter.cs new file mode 100644 index 000000000..1d46f0560 --- /dev/null +++ b/src/OpenCvSharp/modules/video/KalmanFilter.cs @@ -0,0 +1,261 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenCvSharp +{ + /// + /// Kalman filter. + /// The class implements standard Kalman filter \url{http://en.wikipedia.org/wiki/Kalman_filter}. + /// However, you can modify KalmanFilter::transitionMatrix, KalmanFilter::controlMatrix and + /// KalmanFilter::measurementMatrix to get the extended Kalman filter functionality. + /// + public class KalmanFilter : DisposableCvObject + { + private bool disposed; + + #region Init & Disposal + /// + /// the default constructor + /// + public KalmanFilter() + { + ptr = NativeMethods.video_KalmanFilter_new1(); + } + + /// + /// the full constructor taking the dimensionality of the state, of the measurement and of the control vector + /// + /// + /// + /// + /// + public KalmanFilter(int dynamParams, int measureParams, int controlParams = 0, int type = MatType.CV_32F) + { + ptr = NativeMethods.video_KalmanFilter_new2( + dynamParams, measureParams, controlParams, type); + } + + /// + /// + /// + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (ptr != IntPtr.Zero) + { + NativeMethods.video_KalmanFilter_delete(ptr); + ptr = IntPtr.Zero; + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + /// + /// predicted state (x'(k)): x(k)=A*x(k-1)+B*u(k) + /// + public Mat StatePre + { + get + { + if (disposed) + throw new ObjectDisposedException("KalmanFilter"); + IntPtr ret = NativeMethods.video_KalmanFilter_statePre(ptr); + return new Mat(ret); + } + } + + /// + /// corrected state (x(k)): x(k)=x'(k)+K(k)*(z(k)-H*x'(k)) + /// + public Mat StatePost + { + get + { + if (disposed) + throw new ObjectDisposedException("KalmanFilter"); + IntPtr ret = NativeMethods.video_KalmanFilter_statePost(ptr); + return new Mat(ret); + } + } + + /// + /// state transition matrix (A) + /// + public Mat TransitionMatrix + { + get + { + if (disposed) + throw new ObjectDisposedException("KalmanFilter"); + IntPtr ret = NativeMethods.video_KalmanFilter_transitionMatrix(ptr); + return new Mat(ret); + } + } + + /// + /// control matrix (B) (not used if there is no control) + /// + public Mat ControlMatrix + { + get + { + if (disposed) + throw new ObjectDisposedException("KalmanFilter"); + IntPtr ret = NativeMethods.video_KalmanFilter_controlMatrix(ptr); + return new Mat(ret); + } + } + + /// + /// measurement matrix (H) + /// + public Mat MeasurementMatrix + { + get + { + if (disposed) + throw new ObjectDisposedException("KalmanFilter"); + IntPtr ret = NativeMethods.video_KalmanFilter_measurementMatrix(ptr); + return new Mat(ret); + } + } + + /// + /// process noise covariance matrix (Q) + /// + public Mat ProcessNoiseCov + { + get + { + if (disposed) + throw new ObjectDisposedException("KalmanFilter"); + IntPtr ret = NativeMethods.video_KalmanFilter_processNoiseCov(ptr); + return new Mat(ret); + } + } + + /// + /// measurement noise covariance matrix (R) + /// + public Mat MeasurementNoiseCov + { + get + { + if (disposed) + throw new ObjectDisposedException("KalmanFilter"); + IntPtr ret = NativeMethods.video_KalmanFilter_measurementNoiseCov(ptr); + return new Mat(ret); + } + } + + /// + /// priori error estimate covariance matrix (P'(k)): P'(k)=A*P(k-1)*At + Q)*/ + /// + public Mat ErrorCovPre + { + get + { + if (disposed) + throw new ObjectDisposedException("KalmanFilter"); + IntPtr ret = NativeMethods.video_KalmanFilter_errorCovPre(ptr); + return new Mat(ret); + } + } + + /// + /// Kalman gain matrix (K(k)): K(k)=P'(k)*Ht*inv(H*P'(k)*Ht+R) + /// + public Mat Gain + { + get + { + if (disposed) + throw new ObjectDisposedException("KalmanFilter"); + IntPtr ret = NativeMethods.video_KalmanFilter_gain(ptr); + return new Mat(ret); + } + } + + /// + /// posteriori error estimate covariance matrix (P(k)): P(k)=(I-K(k)*H)*P'(k) + /// + public Mat ErrorCovPost + { + get + { + if (disposed) + throw new ObjectDisposedException("KalmanFilter"); + IntPtr ret = NativeMethods.video_KalmanFilter_errorCovPost(ptr); + return new Mat(ret); + } + } + + #endregion + + #region Methods + + /// + /// re-initializes Kalman filter. The previous content is destroyed. + /// + /// + /// + /// + /// + public void Init(int dynamParams, int measureParams, int controlParams = 0, int type = MatType.CV_32F) + { + if (disposed) + throw new ObjectDisposedException("KalmanFilter"); + NativeMethods.video_KalmanFilter_init(ptr, + dynamParams, measureParams, controlParams, type); + } + + /// + /// computes predicted state + /// + /// + /// + public Mat Predict(Mat control = null) + { + if (disposed) + throw new ObjectDisposedException("KalmanFilter"); + + IntPtr ret = NativeMethods.video_KalmanFilter_predict(ptr, Cv2.ToPtr(control)); + return new Mat(ret); + } + + /// + /// updates the predicted state from the measurement + /// + /// + /// + public Mat Correct(Mat measurement) + { + if (disposed) + throw new ObjectDisposedException("KalmanFilter"); + if (measurement == null) + throw new ArgumentNullException("measurement"); + measurement.ThrowIfDisposed(); + + IntPtr ret = NativeMethods.video_KalmanFilter_correct(ptr, measurement.CvPtr); + return new Mat(ret); + } + + #endregion + + } +} diff --git a/src/OpenCvSharp/modules/video/OpticalFlowFlags.cs b/src/OpenCvSharp/modules/video/OpticalFlowFlags.cs new file mode 100644 index 000000000..f0da5461e --- /dev/null +++ b/src/OpenCvSharp/modules/video/OpticalFlowFlags.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace OpenCvSharp +{ + /// + /// cv::calcOpticalFlowPyrLK flags + /// + [Flags] + public enum OpticalFlowFlags : int + { + /// + /// + /// + None = 0, + + /// + /// + /// + PyrAReady = 1, + + /// + /// + /// + PyrBReady = 2, + + /// + /// + /// + UseInitialFlow = 4, + + /// + /// + /// + LkGetMinEigenvals = 8, + + /// + /// + /// + FarnebackGaussian = 256, + } +} diff --git a/src/OpenCvSharp/modules/videoio/Enum/CameraChannels.cs b/src/OpenCvSharp/modules/videoio/Enum/CameraChannels.cs new file mode 100644 index 000000000..f9d4d14fa --- /dev/null +++ b/src/OpenCvSharp/modules/videoio/Enum/CameraChannels.cs @@ -0,0 +1,44 @@ + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + +#if LANG_JP + /// + /// マルチヘッドカメラから取得する画像のチャネル + /// +#else + /// + /// channel indices for multi-head camera live streams + /// +#endif + public enum CameraChannels : int + { + // Data given from depth generator. + + /// + /// Depth values in mm (CV_16UC1) + /// + OpenNI_DepthMap = 0, + + /// + /// XYZ in meters (CV_32FC3) + /// + OpenNI_PointCloudMap = 1, + + /// + /// Disparity in pixels (CV_8UC1) + /// + OpenNI_DisparityMap = 2, + + /// + /// Disparity in pixels (CV_32FC1) + /// + OpenNI_DisparityMap32F = 3, + + /// + /// CV_8UC1 + /// + OpenNI_ValidDepthMask = 4, + } +} diff --git a/src/OpenCvSharp/modules/videoio/Enum/CaptureDevice.cs b/src/OpenCvSharp/modules/videoio/Enum/CaptureDevice.cs new file mode 100644 index 000000000..79806bb2a --- /dev/null +++ b/src/OpenCvSharp/modules/videoio/Enum/CaptureDevice.cs @@ -0,0 +1,142 @@ + +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + +#if LANG_JP + /// + /// カメラキャプチャの初期化に用いるカメラのデバイス + /// +#else + /// + /// Camera device types + /// +#endif + public enum CaptureDevice : int + { + /// + /// autodetect + /// + Any = 0, + + /// + /// platform native + /// + VFW = 200, + + /// + /// platform native + /// + V4L = 200, + + /// + /// platform native + /// + V4L2 = V4L, + + /// + /// IEEE 1394 drivers + /// + Firewire = 300, + + /// + /// IEEE 1394 drivers + /// + Fireware = Firewire, + + /// + /// IEEE 1394 drivers + /// + IEEE1394 = Firewire, + + /// + /// IEEE 1394 drivers + /// + DC1394 = Firewire, + + /// + /// IEEE 1394 drivers + /// + CMU1394 = Firewire, + + /// + /// QuickTime + /// + Qt = 500, + + /// + /// Unicap drivers + /// + Unicap = 600, + + /// + /// DirectShow (via videoInput) + /// + DShow = 700, + + /// + /// PvAPI, Prosilica GigE SDK + /// + PVAPI = 800, + + /// + /// OpenNI (for Kinect) + /// + OpenNI = 900, + + /// + /// OpenNI (for Asus Xtion) + /// + OpenNI_ASUS = 910, + + /// + /// Android + /// + Android = 1000, + + /// + /// XIMEA Camera API + /// + XIAPI = 1100, + + /// + /// AVFoundation framework for iOS (OS X Lion will have the same API) + /// + AVFoundation = 1200, + + /// + /// Smartek Giganetix GigEVisionSDK + /// + Giganetix = 1300, + + /// + /// Microsoft Media Foundation (via videoInput) + /// + MSMF = 1400, + + /// + /// Microsoft Windows Runtime using Media Foundation + /// + WinRT = 1410, + + /// + /// Intel Perceptual Computing SDK + /// + IntelPERC = 1500, + + /// + /// OpenNI2 (for Kinect) + /// + OpenNI2 = 1600, + + /// + /// OpenNI2 (for Asus Xtion and Occipital Structure sensors) + /// + OpenNI2_ASUS = 1610, + + /// + /// gPhoto2 connection + /// + GPhoto2 = 1700, + } +} diff --git a/src/OpenCvSharp/modules/videoio/Enum/CapturePosRatio.cs b/src/OpenCvSharp/modules/videoio/Enum/CapturePosRatio.cs new file mode 100644 index 000000000..0f5999d5e --- /dev/null +++ b/src/OpenCvSharp/modules/videoio/Enum/CapturePosRatio.cs @@ -0,0 +1,39 @@ + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// ビデオファイル内の相対的な位置 + /// +#else + /// + /// Position in relative units + /// +#endif + public enum CapturePosAviRatio : int + { +#if LANG_JP + /// + /// ファイルの最初 + /// +#else + /// + /// Start of the file + /// +#endif + Start = 0, + +#if LANG_JP + /// + /// ファイルの最後 + /// +#else + /// + /// End of the file + /// +#endif + End = 1, + } +} diff --git a/src/OpenCvSharp/modules/videoio/Enum/CaptureProperty.cs b/src/OpenCvSharp/modules/videoio/Enum/CaptureProperty.cs new file mode 100644 index 000000000..7ce131078 --- /dev/null +++ b/src/OpenCvSharp/modules/videoio/Enum/CaptureProperty.cs @@ -0,0 +1,744 @@ +namespace OpenCvSharp +{ + // ReSharper disable InconsistentNaming + +#if LANG_JP + /// + /// CvCaptureのプロパティID + /// +#else + /// + /// Property identifiers for CvCapture + /// +#endif + public enum CaptureProperty + { + #region Basic + +#if LANG_JP + /// + /// ファイル中の現在の位置(ミリ秒単位),あるいはビデオキャプチャのタイムスタンプ値 + /// +#else + /// + /// Position in milliseconds from the file beginning + /// +#endif + PosMsec = 0, + + +#if LANG_JP + /// + /// 次にデコード/キャプチャされるフレームのインデックス.0 から始まる + /// +#else + /// + /// Position in frames (only for video files) + /// +#endif + PosFrames = 1, + +#if LANG_JP + /// + /// ビデオファイル内の相対的な位置 (0 - ファイルの最初,1 - ファイルの最後) + /// +#else + /// + /// Position in relative units (0 - start of the file, 1 - end of the file) + /// +#endif + PosAviRatio = 2, + +#if LANG_JP + /// + /// ビデオストリーム中のフレームの幅 + /// +#else + /// + /// Width of frames in the video stream (only for cameras) + /// +#endif + FrameWidth = 3, + +#if LANG_JP + /// + /// ビデオストリーム中のフレームの高さ + /// +#else + /// + /// Height of frames in the video stream (only for cameras) + /// +#endif + FrameHeight = 4, + +#if LANG_JP + /// + /// フレームレート + /// +#else + /// + /// Frame rate (only for cameras) + /// +#endif + Fps = 5, + +#if LANG_JP + /// + /// コーデックを表す 4 文字 + /// +#else + /// + /// 4-character code of codec (only for cameras). + /// +#endif + // ReSharper disable once InconsistentNaming + FourCC = 6, + +#if LANG_JP + /// + /// ビデオファイル中のフレーム数 + /// +#else + /// + /// Number of frames in the video stream + /// +#endif + FrameCount = 7, + +#if LANG_JP + /// + /// retrieve() によって返されるMat オブジェクトのフォーマット. + /// +#else + /// + /// The format of the Mat objects returned by retrieve() + /// +#endif + Format = 8, + +#if LANG_JP + /// + /// 現在のキャプチャモードを表す,バックエンド固有の値. + /// +#else + /// + /// A backend-specific value indicating the current capture mode + /// +#endif + Mode = 9, + +#if LANG_JP + /// + /// 明度 + /// +#else + /// + /// Brightness of image (only for cameras) + /// +#endif + Brightness = 10, + + +#if LANG_JP + /// + /// コントラスト + /// +#else + /// + /// contrast of image (only for cameras) + /// +#endif + Contrast = 11, + +#if LANG_JP + /// + /// 彩度 + /// +#else + /// + /// Saturation of image (only for cameras) + /// +#endif + Saturation = 12, + + +#if LANG_JP + /// + /// 色相 + /// +#else + /// + /// hue of image (only for cameras) + /// +#endif + Hue = 13, + + +#if LANG_JP + /// + /// 画像のゲイン(カメラの場合のみ). + /// +#else + /// + /// Gain of the image (only for cameras) + /// +#endif + Gain = 14, + + +#if LANG_JP + /// + /// 露出(カメラの場合のみ). + /// +#else + /// + /// Exposure (only for cameras) + /// +#endif + Exposure = 15, + + +#if LANG_JP + /// + /// 画像がRGBに変換されるか否かを表す,ブール値のフラグ. + /// +#else + /// + /// Boolean flags indicating whether images should be converted to RGB + /// +#endif + ConvertRgb = 16, + + + /// + /// + /// + WhiteBalanceBlueU = 17, + + +#if LANG_JP + /// + /// TOWRITE(注意:現在のところ,DC1394 v 2.x バックエンドでのみサポートされます). + /// +#else + /// + /// TOWRITE (note: only supported by DC1394 v 2.x backend currently) + /// +#endif + Rectification = 18, + + /// + /// + /// + Monocrome = 19, + + /// + /// + /// + Sharpness = 20, + + /// + /// exposure control done by camera, + /// user can adjust refernce level using this feature + /// + AutoExposure = 21, + + /// + /// + /// + Gamma = 22, + + /// + /// + /// + Temperature = 23, + + /// + /// + /// + Trigger = 24, + + /// + /// + /// + TriggerDelay = 25, + + /// + /// + /// + WhiteBalanceRedV = 26, + + /// + /// + /// + Zoom = 27, + + /// + /// + /// + Focus = 28, + + /// + /// + /// + Guid = 29, + + /// + /// + /// + IsoSpeed = 30, + + /// + /// + /// + BackLight = 32, + + /// + /// + /// + Pan = 33, + + /// + /// + /// + Tilt = 34, + + /// + /// + /// + Roll = 35, + + /// + /// + /// + Iris = 36, + + /// + /// + /// + Settings = 37, + + #endregion + + #region OpenNI + + // Properties of cameras available through OpenNI interfaces + + /// + /// + /// + OpenNI_OutputMode = 100, + + /// + /// in mm + /// + OpenNI_FrameMaxDepth = 101, + + /// + /// in mm + /// + OpenNI_Baseline = 102, + + /// + /// in pixels + /// + OpenNI_FocalLength = 103, + + /// + /// flag that synchronizes the remapping depth map to image map + /// by changing depth generator's view point (if the flag is "on") or + /// sets this view point to its normal one (if the flag is "off"). + /// + OpenNI_Registration = 104, + + /// + /// + /// + OPENNI_ApproxFrameSync = 105, + + /// + /// + /// + OPENNI_MaxBufferSize = 106, + + /// + /// + /// + OPENNI_CircleBuffer = 107, + + /// + /// + /// + OPENNI_MaxTimeDuration = 108, + + /// + /// + /// + OPENNI_GeneratorPresent = 109, + + /// + /// + /// + OPENNI2_Sync = 110, + + /// + /// + /// + OPENNI2_Mirror = 111, + + /// + /// + /// + OpenNI_DepthGenerator = 1 << 31, + + /// + /// + /// + OpenNI_ImageGenerator = 1 << 30, + + /// + /// + /// + OpenNI_ImageGeneratorPresent = OpenNI_ImageGenerator + OPENNI_GeneratorPresent, + + + /// + /// + /// + OpenNI_ImageGeneratorOutputMode = OpenNI_ImageGenerator + OpenNI_OutputMode, + + /// + /// + /// + OpenNI_DepthGeneratorBaseline = OpenNI_ImageGenerator + OpenNI_Baseline, + + /// + /// + /// + OpenNI_DepthGeneratorFocalLength = OpenNI_ImageGenerator + OpenNI_FocalLength, + + /// + /// + /// + OpenNI_DepthGeneratorRegistrationON = OpenNI_ImageGenerator + OpenNI_Registration, + + #endregion + + #region GStreamer + + // Properties of cameras available through GStreamer interface + + /// + /// default is 1 + /// + GStreamerQueueLength = 200, + + #endregion + + #region PVAPI + + /// + /// ip for anable multicast master mode. 0 for disable multicast + /// + PvAPIMulticastIP = 300, + + /// + /// Determines how a frame is initiated + /// + PVAPI_FrameStartTriggerMode = 301, + + /// + /// Horizontal sub-sampling of the image + /// + PVAPI_DecimationHorizontal = 302, + + /// + /// Vertical sub-sampling of the image + /// + PVAPI_DecimationVertical = 303, + + /// + /// Horizontal binning factor + /// + PVAPI_BinningX = 304, + + /// + /// Vertical binning factor + /// + PVAPI_BinningY = 305, + + /// + /// Pixel format + /// + PVAPI_PixelFormat = 306, + + #endregion + + #region XI + + // Properties of cameras available through XIMEA SDK interface + + /// + /// Change image resolution by binning or skipping. + /// + XI_Downsampling = 400, + + /// + /// Output data format. + /// + XI_DataFormat = 401, + + /// + /// Horizontal offset from the origin to the area of interest (in pixels). + /// + XI_OffsetX = 402, + + /// + /// Vertical offset from the origin to the area of interest (in pixels). + /// + XI_OffsetY = 403, + + /// + /// Defines source of trigger. + /// + XI_TrgSource = 404, + + /// + /// Generates an internal trigger. PRM_TRG_SOURCE must be set to TRG_SOFTWARE. + /// + XI_TrgSoftware = 405, + + /// + /// Selects general purpose input + /// + XI_GpiSelector = 406, + + /// + /// Set general purpose input mode + /// + XI_GpiMode = 407, + + /// + /// Get general purpose level + /// + XI_GpiLevel = 408, + + /// + /// Selects general purpose output + /// + XI_GpoSelector = 409, + + /// + /// Set general purpose output mode + /// + XI_GpoMode = 410, + + /// + /// Selects camera signalling LED + /// + XI_LedSelector = 411, + + /// + /// Define camera signalling LED functionality + /// + XI_LedMode = 412, + + /// + /// Calculates White Balance(must be called during acquisition) + /// + XI_ManualWB = 413, + + /// + /// Automatic white balance + /// + XI_AutoWB = 414, + + /// + /// Automatic exposure/gain + /// + XI_AEAG = 415, + + /// + /// Exposure priority (0.5 - exposure 50%, gain 50%). + /// + XI_ExpPriority = 416, + + /// + /// Maximum limit of exposure in AEAG procedure + /// + XI_AEMaxLimit = 417, + + /// + /// Maximum limit of gain in AEAG procedure + /// + XI_AGMaxLimit = 418, + + /// + /// Average intensity of output signal AEAG should achieve(in %) + /// + XI_AEAGLevel = 419, + + /// + /// Image capture timeout in milliseconds + /// + XI_Timeout = 420, + + #endregion + + #region iOS + + /// + /// + /// + IOS_DeviceFocus = 9001, + + /// + /// + /// + IOS_DeviceExposure = 9002, + + /// + /// + /// + IOS_DeviceFlash = 9003, + + /// + /// + /// + IOS_DeviceWhiteBalance = 9004, + + /// + /// + /// + IOS_DeviceTorch = 9005, + + #endregion + + #region GIGA + + /// + /// + /// + GIGA_FrameOffsetX = 10001, + + /// + /// + /// + GIGA_FrameOffsetY = 10002, + + /// + /// + /// + GIGA_FrameWidthMax = 10003, + + /// + /// + /// + GIGA_FrameHeightMax = 10004, + + /// + /// + /// + GIGA_FrameSensWidth = 10005, + + /// + /// + /// + GIGA_FrameSensHeight = 10006, + + #endregion + + #region INTELPERC + + /// + /// + /// + INTELPERC_ProfileCount = 11001, + + /// + /// + /// + INTELPERC_ProfileIdx = 11002, + + /// + /// + /// + INTELPERC_DepthLowConfidenceValue = 11003, + + /// + /// + /// + INTELPERC_DepthSaturationValue = 11004, + + /// + /// + /// + INTELPERC_DepthConfidenceThreshold = 11005, + + /// + /// + /// + INTELPERC_DepthFocalLengthHorz = 11006, + + /// + /// + /// + INTELPERC_DepthFocalLengthVert = 11007, + + #endregion + + #region gPhoto2 + + /// + /// Capture only preview from liveview mode. + /// + GPhoto2_Preview = 17001, + + /// + /// Readonly, returns (const char *). + /// + GPhoto2_WidgetEnumerate = 17002, + + /// + /// Trigger, only by set. Reload camera settings. + /// + GPhoto2_ReloadConfig = 17003, + + /// + /// Reload all settings on set. + /// + GPhoto2_ReloadOnChange = 17004, + + /// + /// Collect messages with details. + /// + GPhoto2_CollectMsgs = 17005, + + /// + /// Readonly, returns (const char *). + /// + GPhoto2_FlushMsgs = 17006, + + /// + /// Exposure speed. Can be readonly, depends on camera program. + /// + Speed = 17007, + + /// + /// Aperture. Can be readonly, depends on camera program. + /// + Aperture = 17008, + + /// + /// Camera exposure program. + /// + ExposureProgram = 17009, + + /// + /// Enter liveview mode. + /// + ViewFinder = 17010, + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/videoio/Enum/CaptureType.cs b/src/OpenCvSharp/modules/videoio/Enum/CaptureType.cs new file mode 100644 index 000000000..3e4a8435a --- /dev/null +++ b/src/OpenCvSharp/modules/videoio/Enum/CaptureType.cs @@ -0,0 +1,44 @@ + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// CvCaptureのキャプチャタイプ(カメラorファイル) + /// +#else + /// + /// Capture type of CvCapture (Camera or AVI file) + /// +#endif + public enum CaptureType + { +#if LANG_JP + /// + /// AVIファイルからのキャプチャ + /// +#else + /// + /// Captures from an AVI file + /// +#endif + File, + + +#if LANG_JP + /// + /// カメラからのキャプチャ + /// +#else + /// + /// Captures from digital camera + /// +#endif + Camera, + + + /// + /// + /// + NotSpecified + } +} diff --git a/src/OpenCvSharp/modules/videoio/Enum/FourCC.cs b/src/OpenCvSharp/modules/videoio/Enum/FourCC.cs new file mode 100644 index 000000000..34731c119 --- /dev/null +++ b/src/OpenCvSharp/modules/videoio/Enum/FourCC.cs @@ -0,0 +1,38 @@ +using System; + +#pragma warning disable 1591 + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// フレームを圧縮するためのコーデックを表す4文字 + /// +#else + /// + /// 4-character code of codec used to compress the frames. + /// +#endif + public enum FourCC + { + Default = -1, + Prompt = -1, + CVID = 1145656899, + DIB = 541215044, + DIVX = 1482049860, + H261 = 825635400, + H263 = 859189832, + H264 = 875967048, + IV32 = 842225225, + IV41 = 825513545, + IV50 = 808801865, + IYUB = 1448433993, + MJPG = 1196444237, + MP42 = 842289229, + MP43 = 859066445, + MPG4 = 877088845, + MSVC = 1129730893, + PIM1 = 827148624, + XVID = 1145656920, + } +} diff --git a/src/OpenCvSharp/modules/videoio/VideoCapture.cs b/src/OpenCvSharp/modules/videoio/VideoCapture.cs new file mode 100644 index 000000000..7c09b6c1c --- /dev/null +++ b/src/OpenCvSharp/modules/videoio/VideoCapture.cs @@ -0,0 +1,2135 @@ +using System; +using System.Runtime.InteropServices; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// ビデオキャプチャ + /// +#else + /// + /// Video capturing class + /// +#endif + public class VideoCapture : DisposableCvObject + { + #region Fields +#if LANG_JP + /// + /// キャプチャの種類 (File or Camera) + /// +#else + /// + /// Capture type (File or Camera) + /// +#endif + private CaptureType captureType; + /// + /// Track whether Dispose has been called + /// + private bool disposed; + #endregion + + #region Init and Disposal +#if LANG_JP + /// + /// 空の状態で初期化. 後でOpenが必要. + /// + /// +#else + /// + /// Initializes empty capture. + /// To use this, you should call Open. + /// + /// +#endif + public VideoCapture() + { + try + { + ptr = NativeMethods.videoio_VideoCapture_new1(); + } + catch (AccessViolationException e) + { + throw new OpenCvSharpException("Failed to create VideoCapture", e); + } + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Failed to create VideoCapture"); + + captureType = CaptureType.NotSpecified; + } + +#if LANG_JP + /// + /// カメラからのビデオキャプチャを初期化する. + /// Windows では,次の二つのカメラインタフェースが利用できる:Video for Windows(VFW),Matrox Imaging Library(MIL). + /// Linux では,次の二つカメラインタフェースが利用できる:Video for Linux(V4L),FireWire(IEEE1394). + /// + /// 使われるカメラのインデックス.使用するカメラが1台のとき,あるいは,何台のカメラを使うかが重要でないときは,-1 でも問題ない場合もある. + /// +#else + /// + /// Allocates and initialized the CvCapture structure for reading a video stream from the camera. + /// Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394). + /// + /// Index of the camera to be used. If there is only one camera or it does not matter what camera to use -1 may be passed. + /// +#endif + public VideoCapture(int index) + { + try + { + ptr = NativeMethods.videoio_VideoCapture_new3(index); + } + catch (AccessViolationException e) + { + throw new OpenCvSharpException("Failed to create VideoCapture", e); + } + if (ptr == IntPtr.Zero) + { + throw new OpenCvSharpException("Failed to create VideoCapture"); + } + captureType = CaptureType.Camera; + } +#if LANG_JP + /// + /// カメラからのビデオキャプチャを初期化する. + /// Windows では,次の二つのカメラインタフェースが利用できる:Video for Windows(VFW),Matrox Imaging Library(MIL). + /// Linux では,次の二つカメラインタフェースが利用できる:Video for Linux(V4L),FireWire(IEEE1394). + /// + /// 使われるカメラの種類 + /// +#else + /// + /// Allocates and initialized the CvCapture structure for reading a video stream from the camera. + /// Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394). + /// + /// Device type + /// +#endif + public VideoCapture(CaptureDevice device) + : this((int)device) + { + } +#if LANG_JP + /// + /// カメラからのビデオキャプチャを初期化する. + /// Windows では,次の二つのカメラインタフェースが利用できる:Video for Windows(VFW),Matrox Imaging Library(MIL). + /// Linux では,次の二つカメラインタフェースが利用できる:Video for Linux(V4L),FireWire(IEEE1394). + /// + /// 使われるカメラの種類 + /// 使われるカメラのインデックス.使用するカメラが1台のとき,あるいは,何台のカメラを使うかが重要でないときは,-1 でも問題ない場合もある. + /// +#else + /// + /// Allocates and initialized the CvCapture structure for reading a video stream from the camera. + /// Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394). + /// + /// Device type + /// Index of the camera to be used. If there is only one camera or it does not matter what camera to use -1 may be passed. + /// +#endif + public VideoCapture(CaptureDevice device, int index) + : this((int)device + index) + { + } +#if LANG_JP + /// + /// カメラからのビデオキャプチャを初期化する. + /// Windows では,次の二つのカメラインタフェースが利用できる:Video for Windows(VFW),Matrox Imaging Library(MIL). + /// Linux では,次の二つカメラインタフェースが利用できる:Video for Linux(V4L),FireWire(IEEE1394). + /// + /// 使われるカメラのインデックス.使用するカメラが1台のとき,あるいは,何台のカメラを使うかが重要でないときは,-1 でも問題ない場合もある. + /// +#else + /// + /// Allocates and initialized the CvCapture structure for reading a video stream from the camera. + /// Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394). + /// + /// Index of the camera to be used. If there is only one camera or it does not matter what camera to use -1 may be passed. + /// +#endif + public static VideoCapture FromCamera(int index) + { + return new VideoCapture(index); + } +#if LANG_JP + /// + /// カメラからのビデオキャプチャを初期化する. + /// Windows では,次の二つのカメラインタフェースが利用できる:Video for Windows(VFW),Matrox Imaging Library(MIL). + /// Linux では,次の二つカメラインタフェースが利用できる:Video for Linux(V4L),FireWire(IEEE1394). + /// + /// 使われるカメラの種類 + /// +#else + /// + /// Allocates and initialized the CvCapture structure for reading a video stream from the camera. + /// Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394). + /// + /// Device type + /// +#endif + public static VideoCapture FromCamera(CaptureDevice device) + { + return new VideoCapture(device); + } +#if LANG_JP + /// + /// カメラからのビデオキャプチャを初期化する. + /// Windows では,次の二つのカメラインタフェースが利用できる:Video for Windows(VFW),Matrox Imaging Library(MIL). + /// Linux では,次の二つカメラインタフェースが利用できる:Video for Linux(V4L),FireWire(IEEE1394). + /// + /// 使われるカメラの種類 + /// 使われるカメラのインデックス.使用するカメラが1台のとき,あるいは,何台のカメラを使うかが重要でないときは,-1 でも問題ない場合もある. + /// +#else + /// + /// Allocates and initialized the CvCapture structure for reading a video stream from the camera. + /// Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394). + /// + /// Device type + /// Index of the camera to be used. If there is only one camera or it does not matter what camera to use -1 may be passed. + /// +#endif + public static VideoCapture FromCamera(CaptureDevice device, int index) + { + return new VideoCapture((int)device + index); + } + +#if LANG_JP + /// + /// ファイルからのビデオキャプチャを初期化する + /// + /// ビデオファイル名 + /// +#else + /// + /// Allocates and initialized the CvCapture structure for reading the video stream from the specified file. + /// After the allocated structure is not used any more it should be released by cvReleaseCapture function. + /// + /// Name of the video file. + /// +#endif + public VideoCapture(string fileName) + { + if (string.IsNullOrEmpty(fileName)) + throw new ArgumentNullException("fileName"); + /*if (!File.Exists(fileName)) + throw new FileNotFoundException("File not found", fileName);*/ + + ptr = NativeMethods.videoio_VideoCapture_new2(fileName); + + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Failed to create VideoCapture"); + + captureType = CaptureType.File; + } +#if LANG_JP + /// + /// ファイルからのビデオキャプチャを初期化する + /// + /// ビデオファイル名 + /// +#else + /// + /// Allocates and initialized the CvCapture structure for reading the video stream from the specified file. + /// After the allocated structure is not used any more it should be released by cvReleaseCapture function. + /// + /// Name of the video file. + /// +#endif + public static VideoCapture FromFile(string fileName) + { + return new VideoCapture(fileName); + } + + /// + /// Initializes from native pointer + /// + /// CvCapture* + protected internal VideoCapture(IntPtr ptr) + { + this.ptr = ptr; + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + NativeMethods.videoio_VideoCapture_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties + #region Basic +#if LANG_JP + /// + /// キャプチャの種類 (File or Camera) + /// +#else + /// + /// Gets the capture type (File or Camera) + /// +#endif + public CaptureType CaptureType + { + get { return captureType; } + } + +#if LANG_JP + /// + /// ファイル中の現在の位置(ミリ秒単位),あるいはビデオキャプチャのタイムスタンプ値を取得・設定する + /// +#else + /// + /// Gets or sets film current position in milliseconds or video capture timestamp + /// +#endif + public int PosMsec + { + get + { + return (int)NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.PosMsec); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.PosMsec, value); + } + } + +#if LANG_JP + /// + /// 次にデコード/キャプチャされるフレームのインデックス(0からはじまる)を取得・設定する(設定はビデオファイルのみ) + /// +#else + /// + /// Gets or sets 0-based index of the frame to be decoded/captured next + /// +#endif + public int PosFrames + { + get + { + return (int)NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.PosFrames); + } + set + { + if (captureType == CaptureType.Camera) + throw new NotSupportedException("Only for video files"); + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.PosFrames, value); + } + } + +#if LANG_JP + /// + /// ビデオファイル内の相対的な位置を取得・設定する(設定はビデオファイルのみ) + /// +#else + /// + /// Gets or sets relative position of video file + /// +#endif + public CapturePosAviRatio PosAviRatio + { + get + { + return (CapturePosAviRatio)(int)NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.PosAviRatio); + } + set + { + if (captureType == CaptureType.Camera) + throw new NotSupportedException("Only for video files"); + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.PosAviRatio, (int)value); + } + } + +#if LANG_JP + /// + /// ビデオストリーム中のフレームの幅を取得・設定する(設定はカメラのみ) + /// +#else + /// + /// Gets or sets width of frames in the video stream + /// +#endif + public int FrameWidth + { + get + { + return (int)NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.FrameWidth); + } + set + { + if (captureType == CaptureType.File) + throw new NotSupportedException("Only for cameras"); + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.FrameWidth, value); + } + } + +#if LANG_JP + /// + /// ビデオストリーム中のフレームの高さを取得・設定する(設定はカメラのみ) + /// +#else + /// + /// Gets or sets height of frames in the video stream + /// +#endif + public int FrameHeight + { + get + { + return (int)NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.FrameHeight); + } + set + { + if (captureType == CaptureType.File) + throw new NotSupportedException("Only for cameras"); + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.FrameHeight, value); + } + } + +#if LANG_JP + /// + /// フレームレートを取得・設定する(設定はカメラのみ) + /// +#else + /// + /// Gets or sets frame rate + /// +#endif + public double Fps + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Fps); + } + set + { + if (captureType == CaptureType.File) + throw new NotSupportedException("Only for cameras"); + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Fps, value); + } + } + +#if LANG_JP + /// + /// コーデックを表す4文字を取得・設定する(設定はカメラのみ). + /// 例えば,"PIM1" は,MPEG-1 コーデック, "MJPG" は,motion-jpeg コーデックである. + /// Win32 環境下では,null を渡すとダイアログから圧縮方法と圧縮のパラメータを選択できるようになる. + /// +#else + /// + /// Gets or sets 4-character code of codec + /// +#endif +// ReSharper disable InconsistentNaming + public string FourCC +// ReSharper restore InconsistentNaming + { + get + { + int src = (int)NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.FourCC); + IntBytes bytes = new IntBytes { Value = src }; + char[] fourcc = { + Convert.ToChar(bytes.B1), + Convert.ToChar(bytes.B2), + Convert.ToChar(bytes.B3), + Convert.ToChar(bytes.B4) + }; + return new string(fourcc); + } + set + { + if (captureType == CaptureType.File) + throw new NotSupportedException("Only for cameras"); + if (value.Length != 4) + throw new ArgumentException("Length of the argument string must be 4"); + + byte c1 = Convert.ToByte(value[0]); + byte c2 = Convert.ToByte(value[1]); + byte c3 = Convert.ToByte(value[2]); + byte c4 = Convert.ToByte(value[3]); + int v = FourCCCalcurator.Run(c1, c2, c3, c4); + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.FourCC, v); + } + } + +#if LANG_JP + /// + /// ビデオファイル中のフレーム数を取得する + /// +#else + /// + /// Gets number of frames in video file + /// +#endif + public int FrameCount + { + get + { + return (int)NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.FrameCount); + } + } + +#if LANG_JP + /// + /// 明度を取得・設定する + /// +#else + /// + /// Gets or sets brightness of image (only for cameras) + /// +#endif + public double Brightness + { + get + { + if (captureType == CaptureType.File) + throw new NotSupportedException("Only for cameras"); + return (int)NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Brightness); + } + set + { + if (captureType == CaptureType.File) + throw new NotSupportedException("Only for cameras"); + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Brightness, value); + } + } + +#if LANG_JP + /// + /// コンストラストを取得・設定する + /// +#else + /// + /// Gets or sets contrast of image (only for cameras) + /// +#endif + public double Contrast + { + get + { + if (captureType == CaptureType.File) + throw new NotSupportedException("Only for cameras"); + return (int)NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Contrast); + } + set + { + if (captureType == CaptureType.File) + throw new NotSupportedException("Only for cameras"); + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Contrast, value); + } + } + +#if LANG_JP + /// + /// 彩度を取得・設定する + /// +#else + /// + /// Gets or sets saturation of image (only for cameras) + /// +#endif + public double Saturation + { + get + { + if (captureType == CaptureType.File) + throw new NotSupportedException("Only for cameras"); + return (int)NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Saturation); + } + set + { + if (captureType == CaptureType.File) + throw new NotSupportedException("Only for cameras"); + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Saturation, value); + } + } + +#if LANG_JP + /// + /// 色相を取得・設定する + /// +#else + /// + /// Gets or sets hue of image (only for cameras) + /// +#endif + public double Hue + { + get + { + if (captureType == CaptureType.File) + throw new NotSupportedException("Only for cameras"); + return (int)NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Hue); + } + set + { + if (captureType == CaptureType.File) + throw new NotSupportedException("Only for cameras"); + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Hue, value); + } + } + +#if LANG_JP + /// + /// retrieve() によって返されるMat オブジェクトのフォーマット. + /// +#else + /// + /// The format of the Mat objects returned by retrieve() + /// +#endif + public int Format + { + get + { + return (int)NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Format); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Format, value); + } + } + + +#if LANG_JP + /// + /// 現在のキャプチャモードを表す,バックエンド固有の値. + /// +#else + /// + /// A backend-specific value indicating the current capture mode + /// +#endif + public int Mode + { + get + { + return (int)NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Mode); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Mode, value); + } + } + + +#if LANG_JP + /// + /// 画像のゲイン(カメラの場合のみ). + /// +#else + /// + /// Gain of the image (only for cameras) + /// +#endif + public double Gain + { + get + { + if (captureType == CaptureType.File) + throw new NotSupportedException("Only for cameras"); + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Gain); + } + set + { + if (captureType == CaptureType.File) + throw new NotSupportedException("Only for cameras"); + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Gain, value); + } + } + + +#if LANG_JP + /// + /// 露出(カメラの場合のみ). + /// +#else + /// + /// Exposure (only for cameras) + /// +#endif + public double Exposure + { + get + { + if (captureType == CaptureType.File) + throw new NotSupportedException("Only for cameras"); + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Exposure); + } + set + { + if (captureType == CaptureType.File) + throw new NotSupportedException("Only for cameras"); + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Exposure, value); + } + } + + +#if LANG_JP + /// + /// 画像がRGBに変換されるか否かを表す,ブール値のフラグ. + /// +#else + /// + /// Boolean flags indicating whether images should be converted to RGB + /// +#endif + public bool ConvertRgb + { + get + { + return (int)NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.ConvertRgb) != 0; + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.ConvertRgb, value ? 0 : 1); + } + } + + + /// + /// + /// + public double WhiteBalanceBlueU + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.WhiteBalanceBlueU); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.WhiteBalanceBlueU, value); + } + } + + +#if LANG_JP + /// + /// TOWRITE(注意:現在のところ,DC1394 v 2.x バックエンドでのみサポートされます). + /// +#else + /// + /// TOWRITE (note: only supported by DC1394 v 2.x backend currently) + /// +#endif + public double Rectification + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Rectification); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Rectification, value); + } + } + + /// + /// + /// + public double Monocrome + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Monocrome); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Monocrome, value); + } + } + + /// + /// + /// + public double Sharpness + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Sharpness); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Sharpness, value); + } + } + + /// + /// exposure control done by camera, + /// user can adjust refernce level using this feature + /// [CV_CAP_PROP_AUTO_EXPOSURE] + /// + public double AutoExposure + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.AutoExposure); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.AutoExposure, value); + } + } + + /// + /// + /// + public double Gamma + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Gamma); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Gamma, value); + } + } + + /// + /// + /// [CV_CAP_PROP_TEMPERATURE] + /// + public double Temperature + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Temperature); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Temperature, value); + } + } + + /// + /// + /// + public double Trigger + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Trigger); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Trigger, value); + } + } + + /// + /// + /// + public double TriggerDelay + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.TriggerDelay); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.TriggerDelay, value); + } + } + + /// + /// + /// + public double WhiteBalanceRedV + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.WhiteBalanceRedV); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.WhiteBalanceRedV, value); + } + } + + /// + /// + /// + public double Zoom + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Zoom); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Zoom, value); + } + } + + /// + /// + /// + public double Focus + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Focus); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Focus, value); + } + } + + /// + /// + /// + public double Guid + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Guid); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Guid, value); + } + } + + /// + /// + /// + public double IsoSpeed + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.IsoSpeed); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.IsoSpeed, value); + } + } + + /// + /// + /// + public double BackLight + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.BackLight); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.BackLight, value); + } + } + + /// + /// + /// + public double Pan + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Pan); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Pan, value); + } + } + + /// + /// + /// + public double Tilt + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Tilt); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Tilt, value); + } + } + + /// + /// + /// + public double Roll + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Roll); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Roll, value); + } + } + + /// + /// + /// + public double Iris + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Iris); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Iris, value); + } + } + + /// + /// + /// + public double Settings + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.Settings); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.Settings, value); + } + } + + #endregion + + #region OpenNI + // Properties of cameras available through OpenNI interfaces +// ReSharper disable InconsistentNaming +#if LANG_JP + /// + /// + /// [CV_CAP_PROP_OPENNI_OUTPUT_MODE] + /// +#else + /// + /// + /// [CV_CAP_PROP_OPENNI_OUTPUT_MODE] + /// +#endif + public double OpenNI_OutputMode + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.OpenNI_OutputMode); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.OpenNI_OutputMode, value); + } + } + +#if LANG_JP + /// + /// in mm + /// [CV_CAP_PROP_OPENNI_FRAME_MAX_DEPTH] + /// +#else + /// + /// in mm + /// [CV_CAP_PROP_OPENNI_FRAME_MAX_DEPTH] + /// +#endif + public double OpenNI_FrameMaxDepth + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.OpenNI_FrameMaxDepth); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.OpenNI_FrameMaxDepth, value); + } + } + +#if LANG_JP + /// + /// in mm + /// [CV_CAP_PROP_OPENNI_BASELINE] + /// +#else + /// + /// in mm + /// [CV_CAP_PROP_OPENNI_BASELINE] + /// +#endif + public double OpenNI_Baseline + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.OpenNI_Baseline); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.OpenNI_Baseline, value); + } + } + +#if LANG_JP + /// + /// in pixels + /// [CV_CAP_PROP_OPENNI_FOCAL_LENGTH] + /// +#else + /// + /// in pixels + /// [CV_CAP_PROP_OPENNI_FOCAL_LENGTH] + /// +#endif + public double OpenNI_FocalLength + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.OpenNI_FocalLength); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.OpenNI_FocalLength, value); + } + } + +#if LANG_JP + /// + /// flag that synchronizes the remapping depth map to image map + /// by changing depth generator's view point (if the flag is "on") or + /// sets this view point to its normal one (if the flag is "off"). + /// [CV_CAP_PROP_OPENNI_REGISTRATION] + /// +#else + /// + /// flag that synchronizes the remapping depth map to image map + /// by changing depth generator's view point (if the flag is "on") or + /// sets this view point to its normal one (if the flag is "off"). + /// [CV_CAP_PROP_OPENNI_REGISTRATION] + /// +#endif + public double OpenNI_Registration + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.OpenNI_Registration); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.OpenNI_Registration, value); + } + } + +#if LANG_JP + /// + /// + /// [CV_CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE] + /// +#else + /// + /// + /// [CV_CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE] + /// +#endif + public double OpenNI_ImageGeneratorOutputMode + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.OpenNI_ImageGeneratorOutputMode); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.OpenNI_ImageGeneratorOutputMode, value); + } + } + +#if LANG_JP + /// + /// + /// [CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE] + /// +#else + /// + /// + /// [CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE] + /// +#endif + public double OpenNI_DepthGeneratorBaseline + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.OpenNI_DepthGeneratorBaseline); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.OpenNI_DepthGeneratorBaseline, value); + } + } + +#if LANG_JP + /// + /// + /// [CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH] + /// +#else + /// + /// + /// [CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH] + /// +#endif + public double OpenNI_DepthGeneratorFocalLength + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.OpenNI_DepthGeneratorFocalLength); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.OpenNI_DepthGeneratorFocalLength, value); + } + } + +#if LANG_JP + /// + /// + /// [CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON] + /// +#else + /// + /// + /// [CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON] + /// +#endif + public double OpenNI_DepthGeneratorRegistrationON + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.OpenNI_DepthGeneratorRegistrationON); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.OpenNI_DepthGeneratorRegistrationON, value); + } + } +// ReSharper restore InconsistentNaming + #endregion + #region GStreamer + // Properties of cameras available through GStreamer interface + +#if LANG_JP + /// + /// default is 1 + /// [CV_CAP_GSTREAMER_QUEUE_LENGTH] + /// +#else + /// + /// default is 1 + /// [CV_CAP_GSTREAMER_QUEUE_LENGTH] + /// +#endif + public double GStreamerQueueLength + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.GStreamerQueueLength); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.GStreamerQueueLength, value); + } + } + +#if LANG_JP + /// + /// ip for anable multicast master mode. 0 for disable multicast + /// [CV_CAP_PROP_PVAPI_MULTICASTIP] + /// +#else + /// + /// ip for anable multicast master mode. 0 for disable multicast + /// [CV_CAP_PROP_PVAPI_MULTICASTIP] + /// +#endif +// ReSharper disable InconsistentNaming + public double PvAPIMulticastIP +// ReSharper restore InconsistentNaming + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.PvAPIMulticastIP); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.PvAPIMulticastIP, value); + } + } + #endregion + #region XI + // Properties of cameras available through XIMEA SDK interface +// ReSharper disable InconsistentNaming +#if LANG_JP + /// + /// Change image resolution by binning or skipping. + /// [CV_CAP_PROP_XI_DOWNSAMPLING] + /// +#else + /// + /// Change image resolution by binning or skipping. + /// [CV_CAP_PROP_XI_DOWNSAMPLING] + /// +#endif + public double XI_Downsampling + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_Downsampling); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.XI_Downsampling, value); + } + } + +#if LANG_JP + /// + /// Output data format. + /// [CV_CAP_PROP_XI_DATA_FORMAT] + /// +#else + /// + /// Output data format. + /// [CV_CAP_PROP_XI_DATA_FORMAT] + /// +#endif + public double XI_DataFormat + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_DataFormat); + } + } + +#if LANG_JP + /// + /// Horizontal offset from the origin to the area of interest (in pixels). + /// [CV_CAP_PROP_XI_OFFSET_X] + /// +#else + /// + /// Horizontal offset from the origin to the area of interest (in pixels). + /// [CV_CAP_PROP_XI_OFFSET_X] + /// +#endif + public double XI_OffsetX + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_OffsetX); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.XI_OffsetX, value); + } + } + +#if LANG_JP + /// + /// Vertical offset from the origin to the area of interest (in pixels). + /// [CV_CAP_PROP_XI_OFFSET_Y] + /// +#else + /// + /// Vertical offset from the origin to the area of interest (in pixels). + /// [CV_CAP_PROP_XI_OFFSET_Y] + /// +#endif + public double XI_OffsetY + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_OffsetY); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.XI_OffsetY, value); + } + } + +#if LANG_JP + /// + /// Defines source of trigger. + /// [CV_CAP_PROP_XI_TRG_SOURCE] + /// +#else + /// + /// Defines source of trigger. + /// [CV_CAP_PROP_XI_TRG_SOURCE] + /// +#endif + public double XI_TrgSource + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_TrgSource); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.XI_TrgSource, value); + } + } + +#if LANG_JP + /// + /// Generates an internal trigger. PRM_TRG_SOURCE must be set to TRG_SOFTWARE. + /// [CV_CAP_PROP_XI_TRG_SOFTWARE] + /// +#else + /// + /// Generates an internal trigger. PRM_TRG_SOURCE must be set to TRG_SOFTWARE. + /// [CV_CAP_PROP_XI_TRG_SOFTWARE] + /// +#endif + public double XI_TrgSoftware + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_TrgSoftware); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.XI_TrgSoftware, value); + } + } + +#if LANG_JP + /// + /// Selects general purpose input + /// [CV_CAP_PROP_XI_GPI_SELECTOR] + /// +#else + /// + /// Selects general purpose input + /// [CV_CAP_PROP_XI_GPI_SELECTOR] + /// +#endif + public double XI_GpiSelector + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_GpiSelector); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.XI_GpiSelector, value); + } + } + +#if LANG_JP + /// + /// Set general purpose input mode + /// [CV_CAP_PROP_XI_GPI_MODE] + /// +#else + /// + /// Set general purpose input mode + /// [CV_CAP_PROP_XI_GPI_MODE] + /// +#endif + public double XI_GpiMode + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_GpiMode); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.XI_GpiMode, value); + } + } + +#if LANG_JP + /// + /// Get general purpose level + /// [CV_CAP_PROP_XI_GPI_LEVEL] + /// +#else + /// + /// Get general purpose level + /// [CV_CAP_PROP_XI_GPI_LEVEL] + /// +#endif + public double XI_GpiLevel + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_GpiLevel); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.XI_GpiLevel, value); + } + } + +#if LANG_JP + /// + /// Selects general purpose output + /// [CV_CAP_PROP_XI_GPO_SELECTOR] + /// +#else + /// + /// Selects general purpose output + /// [CV_CAP_PROP_XI_GPO_SELECTOR] + /// +#endif + public double XI_GpoSelector + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_GpoSelector); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.XI_GpoSelector, value); + } + } + +#if LANG_JP + /// + /// Set general purpose output mode + /// [CV_CAP_PROP_XI_GPO_MODE] + /// +#else + /// + /// Set general purpose output mode + /// [CV_CAP_PROP_XI_GPO_MODE] + /// +#endif + public double XI_GpoMode + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_GpoMode); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.XI_GpoMode, value); + } + } + +#if LANG_JP + /// + /// Selects camera signalling LED + /// [CV_CAP_PROP_XI_LED_SELECTOR] + /// +#else + /// + /// Selects camera signalling LED + /// [CV_CAP_PROP_XI_LED_SELECTOR] + /// +#endif + public double XI_LedSelector + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_LedSelector); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.XI_LedSelector, value); + } + } + +#if LANG_JP + /// + /// Define camera signalling LED functionality + /// [CV_CAP_PROP_XI_LED_MODE] + /// +#else + /// + /// Define camera signalling LED functionality + /// [CV_CAP_PROP_XI_LED_MODE] + /// +#endif + public double XI_LedMode + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_LedMode); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.XI_LedMode, value); + } + } + +#if LANG_JP + /// + /// Calculates White Balance(must be called during acquisition) + /// [CV_CAP_PROP_XI_MANUAL_WB] + /// +#else + /// + /// Calculates White Balance(must be called during acquisition) + /// [CV_CAP_PROP_XI_MANUAL_WB] + /// +#endif + public double XI_ManualWB + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_ManualWB); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.XI_ManualWB, value); + } + } + +#if LANG_JP + /// + /// Automatic white balance + /// [CV_CAP_PROP_XI_AUTO_WB] + /// +#else + /// + /// Automatic white balance + /// [CV_CAP_PROP_XI_AUTO_WB] + /// +#endif + public double XI_AutoWB + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_AutoWB); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.XI_AutoWB, value); + } + } + +#if LANG_JP + /// + /// Automatic exposure/gain + /// [CV_CAP_PROP_XI_AEAG] + /// +#else + /// + /// Automatic exposure/gain + /// [CV_CAP_PROP_XI_AEAG] + /// +#endif + public double XI_AEAG + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_AEAG); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.XI_AEAG, value); + } + } + +#if LANG_JP + /// + /// Exposure priority (0.5 - exposure 50%, gain 50%). + /// [CV_CAP_PROP_XI_EXP_PRIORITY] + /// +#else + /// + /// Exposure priority (0.5 - exposure 50%, gain 50%). + /// [CV_CAP_PROP_XI_EXP_PRIORITY] + /// +#endif + public double XI_ExpPriority + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_ExpPriority); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.XI_ExpPriority, value); + } + } + +#if LANG_JP + /// + /// Maximum limit of exposure in AEAG procedure + /// [CV_CAP_PROP_XI_AE_MAX_LIMIT] + /// +#else + /// + /// Maximum limit of exposure in AEAG procedure + /// [CV_CAP_PROP_XI_AE_MAX_LIMIT] + /// +#endif + public double XI_AEMaxLimit + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_AEMaxLimit); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.XI_AEMaxLimit, value); + } + } + +#if LANG_JP + /// + /// Maximum limit of gain in AEAG procedure + /// [CV_CAP_PROP_XI_AG_MAX_LIMIT] + /// +#else + /// + /// Maximum limit of gain in AEAG procedure + /// [CV_CAP_PROP_XI_AG_MAX_LIMIT] + /// +#endif + public double XI_AGMaxLimit + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_AGMaxLimit); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.XI_AGMaxLimit, value); + } + } + +#if LANG_JP + /// + /// default is 1 + /// [CV_CAP_PROP_XI_AEAG_LEVEL] + /// +#else + /// + /// default is 1 + /// [CV_CAP_PROP_XI_AEAG_LEVEL] + /// +#endif + public double XI_AEAGLevel + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_AEAGLevel); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.XI_AEAGLevel, value); + } + } + +#if LANG_JP + /// + /// default is 1 + /// [CV_CAP_PROP_XI_TIMEOUT] + /// +#else + /// + /// default is 1 + /// [CV_CAP_PROP_XI_TIMEOUT] + /// +#endif + public double XI_Timeout + { + get + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)CaptureProperty.XI_Timeout); + } + set + { + NativeMethods.videoio_VideoCapture_set(ptr, (int)CaptureProperty.XI_Timeout, value); + } + } +// ReSharper restore InconsistentNaming + #endregion + #endregion + + #region Methods + #region Get +#if LANG_JP + /// + /// ビデオキャプチャのプロパティを取得する + /// + /// プロパティID + /// プロパティの値 +#else + /// + /// Retrieves the specified property of camera or video file. + /// + /// property identifier. + /// property value +#endif + public double Get(CaptureProperty propertyId) + { + return NativeMethods.videoio_VideoCapture_get(ptr, (int)propertyId); + } +#if LANG_JP + /// + /// ビデオキャプチャのプロパティを取得する + /// + /// プロパティID + /// プロパティの値 +#else + /// + /// Retrieves the specified property of camera or video file. + /// + /// property identifier. + /// property value +#endif + public double Get(int propertyId) + { + return NativeMethods.videoio_VideoCapture_get(ptr, propertyId); + } + #endregion + #region Grab +#if LANG_JP + /// + /// カメラやファイルからフレームを取り出す.取り出されたフレームは内部的に保存される. + /// 取り出されたフレームをユーザ側で利用するためには,cvRetrieveFrame を用いるべきである. + /// + /// +#else + /// + /// Grabs the frame from camera or file. The grabbed frame is stored internally. + /// The purpose of this function is to grab frame fast that is important for syncronization in case of reading from several cameras simultaneously. + /// The grabbed frames are not exposed because they may be stored in compressed format (as defined by camera/driver). + /// To retrieve the grabbed frame, cvRetrieveFrame should be used. + /// + /// +#endif + public bool Grab() + { + ThrowIfDisposed(); + return NativeMethods.videoio_VideoCapture_grab(ptr) != 0; + } + #endregion + #region Retrieve +#if LANG_JP + /// + /// GrabFrame 関数によって取り出された画像への参照を返す. + /// + /// + /// non-zero streamIdx is only valid for multi-head camera live streams + /// 1フレームの画像 (GC禁止フラグが立っている). キャプチャできなかった場合はnull. +#else + /// + /// Decodes and returns the grabbed video frame. + /// + /// + /// non-zero streamIdx is only valid for multi-head camera live streams + /// +#endif + public bool Retrieve(Mat image, int channel = 0) + { + ThrowIfDisposed(); + if (image == null) + throw new ArgumentNullException("image"); + image.ThrowIfDisposed(); + return NativeMethods.videoio_VideoCapture_retrieve(ptr, image.CvPtr, channel) != 0; + } + +#if LANG_JP + /// + /// GrabFrame 関数によって取り出された画像への参照を返す. + /// 返された画像は,ユーザが解放したり,変更したりするべきではない. + /// + /// + /// non-zero streamIdx is only valid for multi-head camera live streams + /// 1フレームの画像 (GC禁止フラグが立っている). キャプチャできなかった場合はnull. +#else + /// + /// Returns the pointer to the image grabbed with cvGrabFrame function. + /// The returned image should not be released or modified by user. + /// + /// + /// non-zero streamIdx is only valid for multi-head camera live streams + /// +#endif + public bool Retrieve(Mat image, CameraChannels streamIdx = CameraChannels.OpenNI_DepthMap) + { + ThrowIfDisposed(); + if (image == null) + throw new ArgumentNullException("image"); + image.ThrowIfDisposed(); + return NativeMethods.videoio_VideoCapture_retrieve(ptr, image.CvPtr, (int)streamIdx) != 0; + } + +#if LANG_JP + /// + /// GrabFrame 関数によって取り出された画像への参照を返す. + /// +#else + /// + /// Decodes and returns the grabbed video frame. + /// + /// +#endif + public Mat RetrieveMat() + { + ThrowIfDisposed(); + + var mat = new Mat(); + NativeMethods.videoio_VideoCapture_operatorRightShift_Mat(ptr, mat.CvPtr); + return mat; + } + + #endregion + #region Read +#if LANG_JP + /// + /// カメラやビデオファイルから一つのフレームを取り出し,それを展開して返す. + /// この関数は,単純にcvGrabFrame とcvRetrieveFrame をまとめて呼び出しているだけである. + /// 返された画像は,ユーザが解放したり,変更したりするべきではない. + /// + /// 1フレームの画像 (GC禁止フラグが立っている). キャプチャできなかった場合はnull. +#else + /// + /// Grabs a frame from camera or video file, decompresses and returns it. + /// This function is just a combination of cvGrabFrame and cvRetrieveFrame in one call. + /// The returned image should not be released or modified by user. + /// + /// +#endif + public bool Read(Mat image) + { + ThrowIfDisposed(); + if(image == null) + throw new ArgumentNullException("image"); + image.ThrowIfDisposed(); + + //NativeMethods.videoio_VideoCapture_read(ptr, image.CvPtr); + /* + bool grabbed = NativeMethods.videoio_VideoCapture_grab(ptr) != 0; + if (!grabbed) + return false; + */ + NativeMethods.videoio_VideoCapture_operatorRightShift_Mat(ptr, image.CvPtr); + GC.KeepAlive(image); + return true; + } + #endregion + #region Set +#if LANG_JP + /// + /// ビデオキャプチャのプロパティをセットする + /// + /// プロパティID + /// プロパティの値 + /// +#else + /// + /// Sets the specified property of video capturing. + /// + /// property identifier. + /// value of the property. + /// +#endif + public int Set(CaptureProperty propertyId, double value) + { + return NativeMethods.videoio_VideoCapture_set(ptr, (int)propertyId, value); + } +#if LANG_JP + /// + /// ビデオキャプチャのプロパティをセットする + /// + /// プロパティID + /// プロパティの値 + /// +#else + /// + /// Sets the specified property of video capturing. + /// + /// property identifier. + /// value of the property. + /// +#endif + public int Set(int propertyId, double value) + { + return NativeMethods.videoio_VideoCapture_set(ptr, propertyId, value); + } + #endregion + #region Open +#if LANG_JP + /// + /// 指定されたビデオファイルをオープンします. + /// + /// + /// +#else + /// + /// Opens the specified video file + /// + /// + /// +#endif + public void Open(string fileName) + { + ThrowIfDisposed(); + NativeMethods.videoio_VideoCapture_open1(ptr, fileName); + captureType = CaptureType.File; + } + +#if LANG_JP + /// + /// カメラからのビデオキャプチャを初期化する. + /// Windows では,次の二つのカメラインタフェースが利用できる:Video for Windows(VFW),Matrox Imaging Library(MIL). + /// Linux では,次の二つカメラインタフェースが利用できる:Video for Linux(V4L),FireWire(IEEE1394). + /// + /// 使われるカメラのインデックス.使用するカメラが1台のとき,あるいは,何台のカメラを使うかが重要でないときは,-1 でも問題ない場合もある. + /// +#else + /// + /// Allocates and initialized the CvCapture structure for reading a video stream from the camera. + /// Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394). + /// + /// Index of the camera to be used. If there is only one camera or it does not matter what camera to use -1 may be passed. + /// +#endif + public void Open(int index) + { + ThrowIfDisposed(); + try + { + NativeMethods.videoio_VideoCapture_open2(ptr, index); + } + catch (AccessViolationException e) + { + throw new OpenCvSharpException("Failed to create CvCapture", e); + } + captureType = CaptureType.Camera; + } +#if LANG_JP + /// + /// カメラからのビデオキャプチャを初期化する. + /// Windows では,次の二つのカメラインタフェースが利用できる:Video for Windows(VFW),Matrox Imaging Library(MIL). + /// Linux では,次の二つカメラインタフェースが利用できる:Video for Linux(V4L),FireWire(IEEE1394). + /// + /// 使われるカメラの種類 + /// +#else + /// + /// Allocates and initialized the CvCapture structure for reading a video stream from the camera. + /// Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394). + /// + /// Device type + /// +#endif + public void Open(CaptureDevice device) + { + Open((int)device); + } +#if LANG_JP + /// + /// カメラからのビデオキャプチャを初期化する. + /// Windows では,次の二つのカメラインタフェースが利用できる:Video for Windows(VFW),Matrox Imaging Library(MIL). + /// Linux では,次の二つカメラインタフェースが利用できる:Video for Linux(V4L),FireWire(IEEE1394). + /// + /// 使われるカメラの種類 + /// 使われるカメラのインデックス.使用するカメラが1台のとき,あるいは,何台のカメラを使うかが重要でないときは,-1 でも問題ない場合もある. + /// +#else + /// + /// Allocates and initialized the CvCapture structure for reading a video stream from the camera. + /// Currently two camera interfaces can be used on Windows: Video for Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux: V4L and FireWire (IEEE1394). + /// + /// Device type + /// Index of the camera to be used. If there is only one camera or it does not matter what camera to use -1 may be passed. + /// +#endif + public void Open(CaptureDevice device, int index) + { + Open((int)device + index); + } + #endregion + #region Release +#if LANG_JP + /// + /// Closes video file or capturing device. + /// + /// +#else + /// + /// Closes video file or capturing device. + /// + /// +#endif + public void Release() + { + ThrowIfDisposed(); + NativeMethods.videoio_VideoCapture_release(ptr); + } + #endregion + #region IsOpened + /// + /// Returns true if video capturing has been initialized already. + /// + /// + public bool IsOpened() + { + ThrowIfDisposed(); + return NativeMethods.videoio_VideoCapture_isOpened(ptr) != 0; + } + #endregion + #endregion + + /// + /// For accessing each byte of Int32 value + /// + [StructLayout(LayoutKind.Explicit)] + private struct IntBytes + { + [FieldOffset(0)] + public Int32 Value; + [FieldOffset(0)] + public readonly Byte B1; + [FieldOffset(1)] + public readonly Byte B2; + [FieldOffset(2)] + public readonly Byte B3; + [FieldOffset(3)] + public readonly Byte B4; + } + } +} diff --git a/src/OpenCvSharp/modules/videoio/VideoWriter.cs b/src/OpenCvSharp/modules/videoio/VideoWriter.cs new file mode 100644 index 000000000..3fb35efc8 --- /dev/null +++ b/src/OpenCvSharp/modules/videoio/VideoWriter.cs @@ -0,0 +1,407 @@ +using System; + +namespace OpenCvSharp +{ +#if LANG_JP + /// + /// AVIビデオ出力機 + /// +#else + /// + /// AVI Video File Writer + /// +#endif + public class VideoWriter : DisposableCvObject + { + /// + /// Track whether Dispose has been called + /// + private bool disposed = false; + + #region Init and Disposal + /// + /// + /// + public VideoWriter() + { + FileName = null; + Fps = -1; + FrameSize = Size.Zero; + IsColor = true; + ptr = NativeMethods.videoio_VideoWriter_new1(); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Failed to create VideoWriter"); + } + +#if LANG_JP + /// + /// ビデオライタを作成する. + /// + /// 出力するビデオファイルの名前 + /// + /// フレームを圧縮するためのコーデックを表す 4 文字.例えば,"PIM1" は,MPEG-1 コーデック, "MJPG" は,motion-jpeg コーデックである. + /// Win32 環境下では,null を渡すとダイアログから圧縮方法と圧縮のパラメータを選択できるようになる. + /// + /// 作成されたビデオストリームのフレームレート + /// ビデオフレームのサイズ + /// trueの場合,エンコーダはカラーフレームとしてエンコードする. falseの場合,グレースケールフレームとして動作する(現在のところ,このフラグは Windows でのみ利用できる). + /// CvVideoWriter +#else + /// + /// Creates video writer structure. + /// + /// Name of the output video file. + /// 4-character code of codec used to compress the frames. For example, "PIM1" is MPEG-1 codec, "MJPG" is motion-jpeg codec etc. + /// Under Win32 it is possible to pass null in order to choose compression method and additional compression parameters from dialog. + /// Framerate of the created video stream. + /// Size of video frames. + /// If it is true, the encoder will expect and encode color frames, otherwise it will work with grayscale frames (the flag is currently supported on Windows only). +#endif + public VideoWriter(string fileName, string fourcc, double fps, Size frameSize, bool isColor = true) + : this(fileName, FourCCCalcurator.Run(fourcc), fps, frameSize, isColor) + { + } + +#if LANG_JP + /// + /// ビデオライタを作成し、返す. + /// + /// 出力するビデオファイルの名前 + /// + /// フレームを圧縮するためのコーデックを表す 4 文字.例えば,"PIM1" は,MPEG-1 コーデック, "MJPG" は,motion-jpeg コーデックである. + /// Win32 環境下では,null を渡すとダイアログから圧縮方法と圧縮のパラメータを選択できるようになる. + /// + /// 作成されたビデオストリームのフレームレート + /// ビデオフレームのサイズ + /// trueの場合,エンコーダはカラーフレームとしてエンコードする. falseの場合,グレースケールフレームとして動作する(現在のところ,このフラグは Windows でのみ利用できる). + /// CvVideoWriter +#else + /// + /// Creates video writer structure. + /// + /// Name of the output video file. + /// 4-character code of codec used to compress the frames. For example, "PIM1" is MPEG-1 codec, "MJPG" is motion-jpeg codec etc. + /// Under Win32 it is possible to pass null in order to choose compression method and additional compression parameters from dialog. + /// Framerate of the created video stream. + /// Size of video frames. + /// If it is true, the encoder will expect and encode color frames, otherwise it will work with grayscale frames (the flag is currently supported on Windows only). + /// +#endif + public VideoWriter(string fileName, FourCC fourcc, double fps, Size frameSize, bool isColor = true) + : this(fileName, (int)fourcc, fps, frameSize, isColor) + { + } + +#if LANG_JP + /// + /// ビデオライタを作成し、返す. + /// + /// 出力するビデオファイルの名前 + /// + /// フレームを圧縮するためのコーデックを表す 4 文字.例えば,"PIM1" は,MPEG-1 コーデック, "MJPG" は,motion-jpeg コーデックである. + /// Win32 環境下では,null を渡すとダイアログから圧縮方法と圧縮のパラメータを選択できるようになる. + /// + /// 作成されたビデオストリームのフレームレート + /// ビデオフレームのサイズ + /// trueの場合,エンコーダはカラーフレームとしてエンコードする. falseの場合,グレースケールフレームとして動作する(現在のところ,このフラグは Windows でのみ利用できる). + /// CvVideoWriter +#else + /// + /// Creates video writer structure. + /// + /// Name of the output video file. + /// 4-character code of codec used to compress the frames. For example, "PIM1" is MPEG-1 codec, "MJPG" is motion-jpeg codec etc. + /// Under Win32 it is possible to pass null in order to choose compression method and additional compression parameters from dialog. + /// Framerate of the created video stream. + /// Size of video frames. + /// If it is true, the encoder will expect and encode color frames, otherwise it will work with grayscale frames (the flag is currently supported on Windows only). + /// +#endif + public VideoWriter(string fileName, int fourcc, double fps, Size frameSize, bool isColor = true) + { + if (fileName == null) + throw new ArgumentNullException(); + + FileName = fileName; + Fps = fps; + FrameSize = frameSize; + IsColor = isColor; + ptr = NativeMethods.videoio_VideoWriter_new2(fileName, fourcc, fps, frameSize, isColor ? 1 : 0); + if (ptr == IntPtr.Zero) + throw new OpenCvSharpException("Failed to create VideoWriter"); + } + /// + /// Initializes from native pointer + /// + /// CvVideoWriter* + internal VideoWriter(IntPtr ptr) + { + this.ptr = ptr; + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Clean up any resources being used. + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + if (disposing) + { + } + if (IsEnabledDispose) + { + NativeMethods.videoio_VideoWriter_delete(ptr); + } + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Properties +#if LANG_JP + /// + /// 出力するビデオファイルの名前を取得する + /// +#else + /// + /// Get output video file name + /// +#endif + public string FileName { get; private set; } + +#if LANG_JP + /// + /// 作成されたビデオストリームのフレームレートを取得する + /// +#else + /// + /// Frames per second of the output vide + /// +#endif + public double Fps { get; private set; } + +#if LANG_JP + /// + /// ビデオフレームのサイズを取得する + /// +#else + /// + /// Get size of frame image + /// +#endif + public Size FrameSize { get; private set; } + +#if LANG_JP + /// + /// カラーフレームかどうかの値を取得する + /// +#else + /// + /// Get whether output frames is color or not + /// +#endif + public bool IsColor { get; private set; } + + #endregion + + #region Methods + +#if LANG_JP + /// + /// ビデオライタを開く + /// + /// 出力するビデオファイルの名前 + /// + /// フレームを圧縮するためのコーデックを表す 4 文字.例えば,"PIM1" は,MPEG-1 コーデック, "MJPG" は,motion-jpeg コーデックである. + /// Win32 環境下では,null を渡すとダイアログから圧縮方法と圧縮のパラメータを選択できるようになる. + /// + /// 作成されたビデオストリームのフレームレート + /// ビデオフレームのサイズ + /// trueの場合,エンコーダはカラーフレームとしてエンコードする. falseの場合,グレースケールフレームとして動作する(現在のところ,このフラグは Windows でのみ利用できる). + /// CvVideoWriter +#else + /// + /// Creates video writer structure. + /// + /// Name of the output video file. + /// 4-character code of codec used to compress the frames. For example, "PIM1" is MPEG-1 codec, "MJPG" is motion-jpeg codec etc. + /// Under Win32 it is possible to pass null in order to choose compression method and additional compression parameters from dialog. + /// Framerate of the created video stream. + /// Size of video frames. + /// If it is true, the encoder will expect and encode color frames, otherwise it will work with grayscale frames (the flag is currently supported on Windows only). + /// +#endif + public void Open(string fileName, string fourcc, double fps, Size frameSize, bool isColor = true) + { + Open(fileName, FourCCCalcurator.Run(fourcc), fps, frameSize, isColor); + } + +#if LANG_JP + /// + /// ビデオライタを開く + /// + /// 出力するビデオファイルの名前 + /// + /// フレームを圧縮するためのコーデックを表す 4 文字.例えば,"PIM1" は,MPEG-1 コーデック, "MJPG" は,motion-jpeg コーデックである. + /// Win32 環境下では,null を渡すとダイアログから圧縮方法と圧縮のパラメータを選択できるようになる. + /// + /// 作成されたビデオストリームのフレームレート + /// ビデオフレームのサイズ + /// trueの場合,エンコーダはカラーフレームとしてエンコードする. falseの場合,グレースケールフレームとして動作する(現在のところ,このフラグは Windows でのみ利用できる). + /// CvVideoWriter +#else + /// + /// Creates video writer structure. + /// + /// Name of the output video file. + /// 4-character code of codec used to compress the frames. For example, "PIM1" is MPEG-1 codec, "MJPG" is motion-jpeg codec etc. + /// Under Win32 it is possible to pass null in order to choose compression method and additional compression parameters from dialog. + /// Framerate of the created video stream. + /// Size of video frames. + /// If it is true, the encoder will expect and encode color frames, otherwise it will work with grayscale frames (the flag is currently supported on Windows only). + /// +#endif + public void Open(string fileName, FourCC fourcc, double fps, Size frameSize, bool isColor = true) + { + Open(fileName, (int)fourcc, fps, frameSize, isColor); + } + +#if LANG_JP + /// + /// ビデオライタを開く + /// + /// 出力するビデオファイルの名前 + /// + /// フレームを圧縮するためのコーデックを表す 4 文字.例えば,"PIM1" は,MPEG-1 コーデック, "MJPG" は,motion-jpeg コーデックである. + /// Win32 環境下では,null を渡すとダイアログから圧縮方法と圧縮のパラメータを選択できるようになる. + /// + /// 作成されたビデオストリームのフレームレート + /// ビデオフレームのサイズ + /// trueの場合,エンコーダはカラーフレームとしてエンコードする. falseの場合,グレースケールフレームとして動作する(現在のところ,このフラグは Windows でのみ利用できる). + /// CvVideoWriter +#else + /// + /// Creates video writer structure. + /// + /// Name of the output video file. + /// 4-character code of codec used to compress the frames. For example, "PIM1" is MPEG-1 codec, "MJPG" is motion-jpeg codec etc. + /// Under Win32 it is possible to pass null in order to choose compression method and additional compression parameters from dialog. + /// Framerate of the created video stream. + /// Size of video frames. + /// If it is true, the encoder will expect and encode color frames, otherwise it will work with grayscale frames (the flag is currently supported on Windows only). + /// +#endif + public void Open(string fileName, int fourcc, double fps, Size frameSize, bool isColor = true) + { + ThrowIfDisposed(); + if (String.IsNullOrEmpty(fileName)) + throw new ArgumentNullException("fileName"); + + FileName = fileName; + Fps = fps; + FrameSize = frameSize; + IsColor = isColor; + NativeMethods.videoio_VideoWriter_open(ptr, fileName, fourcc, fps, frameSize, isColor ? 1 : 0); + } + + /// + /// Returns true if video writer has been successfully initialized. + /// + /// + public bool IsOpened() + { + ThrowIfDisposed(); + return NativeMethods.videoio_VideoWriter_isOpened(ptr) != 0; + } + + /// + /// + /// + /// + public void Release() + { + ThrowIfDisposed(); + NativeMethods.videoio_VideoWriter_release(ptr); + } + +#if LANG_JP + /// + /// 一つのフレームをビデオファイルに書き込む/追加する + /// + /// 書き込まれるフレーム + /// +#else + /// + /// Writes/appends one frame to video file. + /// + /// the written frame. + /// +#endif + public void Write(Mat image) + { + ThrowIfDisposed(); + if(image == null) + throw new ArgumentNullException("image"); + image.ThrowIfDisposed(); + NativeMethods.videoio_VideoWriter_write(ptr, image.CvPtr); + } + + /// + /// Concatenates 4 chars to a fourcc code. + /// This static method constructs the fourcc code of the codec to be used in + /// the constructor VideoWriter::VideoWriter or VideoWriter::open. + /// + /// + /// + /// + /// + /// +// ReSharper disable once InconsistentNaming + public static int FourCC(char c1, char c2, char c3, char c4) + { + return NativeMethods.videoio_VideoWriter_fourcc((byte) c1, (byte) c2, (byte) c3, (byte) c4); + } + + /// + /// Concatenates 4 chars to a fourcc code. + /// This static method constructs the fourcc code of the codec to be used in + /// the constructor VideoWriter::VideoWriter or VideoWriter::open. + /// + /// + /// + // ReSharper disable once InconsistentNaming + public static int FourCC(string code) + { + if (code == null) + throw new ArgumentNullException("code"); + if (code.Length != 4) + throw new ArgumentException("code.Length != 4", "code"); + + return FourCC(code[0], code[1], code[2], code[3]); + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/xfeatures2d/BriefDescriptorExtractor.cs b/src/OpenCvSharp/modules/xfeatures2d/BriefDescriptorExtractor.cs new file mode 100644 index 000000000..e501c1063 --- /dev/null +++ b/src/OpenCvSharp/modules/xfeatures2d/BriefDescriptorExtractor.cs @@ -0,0 +1,88 @@ +using System; + +namespace OpenCvSharp.XFeatures2D +{ + using DescriptorExtractor = Feature2D; + + /// + /// BRIEF Descriptor + /// + public class BriefDescriptorExtractor : DescriptorExtractor + { +#pragma warning disable 1591 +// ReSharper disable InconsistentNaming + public const int PATCH_SIZE = 48; + public const int KERNEL_SIZE = 9; +// ReSharper restore InconsistentNaming +#pragma warning restore 1591 + + private bool disposed; + + /// + /// cv::Ptr<BriefDescriptorExtractor> + /// + private Ptr ptrObj; + + /// + /// + /// + protected BriefDescriptorExtractor() + { + } + + /// + /// Constructor + /// + /// + protected BriefDescriptorExtractor(IntPtr ptr) + { + ptrObj = new Ptr(ptr); + ptr = ptrObj.Get(); + } + + /// + /// bytes is a length of descriptor in bytes. It can be equal 16, 32 or 64 bytes. + /// + /// + public static BriefDescriptorExtractor Create(int bytes = 32) + { + IntPtr p = NativeMethods.xfeatures2d_BriefDescriptorExtractor_create(bytes); + return new BriefDescriptorExtractor(p); + } + + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + } + ptrObj = null; + ptr = IntPtr.Zero; + } + + // releases unmanaged resources + + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + } +} diff --git a/src/OpenCvSharp/modules/xfeatures2d/FREAK.cs b/src/OpenCvSharp/modules/xfeatures2d/FREAK.cs new file mode 100644 index 000000000..9718f4da0 --- /dev/null +++ b/src/OpenCvSharp/modules/xfeatures2d/FREAK.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using OpenCvSharp.Util; + +// ReSharper disable once InconsistentNaming + +namespace OpenCvSharp.XFeatures2D +{ +#if LANG_JP + /// + /// FREAK 実装 + /// +#else + /// + /// FREAK implementation + /// +#endif + public class FREAK : Feature2D + { + private bool disposed; + private Ptr ptrObj; + + #region Init & Disposal + + /// + /// + /// + protected FREAK(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + + /// + /// Constructor + /// + /// enable orientation normalization + /// enable scale normalization + /// scaling of the description pattern + /// number of octaves covered by the detected keypoints + /// (optional) user defined selected pairs + public static FREAK Create( + bool orientationNormalized = true, + bool scaleNormalized = true, + float patternScale = 22.0f, + int nOctaves = 4, + IEnumerable selectedPairs = null) + { + int[] selectedPairsArray = EnumerableEx.ToArray(selectedPairs); + int selectedPairslength = selectedPairs == null ? 0 : selectedPairsArray.Length; + + IntPtr ptr = NativeMethods.xfeatures2d_FREAK_create(orientationNormalized ? 1 : 0, + scaleNormalized ? 1 : 0, patternScale, nOctaves, + selectedPairsArray, selectedPairslength); + return new FREAK(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + // releases unmanaged resources + + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Methods + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/xfeatures2d/SIFT.cs b/src/OpenCvSharp/modules/xfeatures2d/SIFT.cs new file mode 100644 index 000000000..bf994cf2e --- /dev/null +++ b/src/OpenCvSharp/modules/xfeatures2d/SIFT.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; + +namespace OpenCvSharp.XFeatures2D +{ + // ReSharper disable InconsistentNaming + +#if LANG_JP + /// + /// SIFT 実装. + /// +#else + /// + /// SIFT implementation. + /// +#endif + public class SIFT : Feature2D + { + private bool disposed; + private Ptr detectorPtr; + + #region Init & Disposal + + /// + /// Creates instance by raw pointer cv::SURF* + /// + protected SIFT(IntPtr p) + : base() + { + detectorPtr = new Ptr(p); + ptr = detectorPtr.Get(); + } + + /// + /// The SIFT constructor. + /// + /// The number of best features to retain. + /// The features are ranked by their scores (measured in SIFT algorithm as the local contrast) + /// The number of layers in each octave. 3 is the value used in D. Lowe paper. + /// The number of octaves is computed automatically from the image resolution. + /// The contrast threshold used to filter out weak features in semi-uniform + /// (low-contrast) regions. The larger the threshold, the less features are produced by the detector. + /// The threshold used to filter out edge-like features. Note that the its meaning is + /// different from the contrastThreshold, i.e. the larger the edgeThreshold, the less features are filtered out (more features are retained). + /// The sigma of the Gaussian applied to the input image at the octave #0. + /// If your image is captured with a weak camera with soft lenses, you might want to reduce the number. + public static SIFT Create(int nFeatures = 0, int nOctaveLayers = 3, + double contrastThreshold = 0.04, double edgeThreshold = 10, + double sigma = 1.6) + { + IntPtr ptr = NativeMethods.xfeatures2d_SIFT_create( + nFeatures, nOctaveLayers, + contrastThreshold, edgeThreshold, sigma); + return new SIFT(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + if (detectorPtr != null) + { + detectorPtr.Dispose(); + detectorPtr = null; + } + } + // releases unmanaged resources + + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/xfeatures2d/SURF.cs b/src/OpenCvSharp/modules/xfeatures2d/SURF.cs new file mode 100644 index 000000000..69156a1ed --- /dev/null +++ b/src/OpenCvSharp/modules/xfeatures2d/SURF.cs @@ -0,0 +1,206 @@ + +using System; + +namespace OpenCvSharp.XFeatures2D +{ +#if LANG_JP + /// + /// SURF(Speeded Up Robust Features) を抽出するためのクラス. + /// +#else + /// + /// Class for extracting Speeded Up Robust Features from an image. + /// +#endif + public class SURF : Feature2D + { + private bool disposed; + private Ptr detectorPtr; + + #region Init & Disposal + + /// + /// Creates instance by raw pointer cv::SURF* + /// + protected SURF(IntPtr ptr) + : base() + { + detectorPtr = new Ptr(ptr); + ptr = detectorPtr.Get(); + } + +#if LANG_JP + /// + /// SURF初期化 + /// + /// keypoint.hessian の値がこの閾値よりも大きい特徴だけが検出される + /// + /// + /// false:基本的なディスクリプタ(64要素), true:拡張されたディスクリプタ(128要素) + /// +#else + /// + /// The SURF constructor. + /// + /// Only features with keypoint.hessian larger than that are extracted. + /// The number of a gaussian pyramid octaves that the detector uses. It is set to 4 by default. + /// If you want to get very large features, use the larger value. If you want just small features, decrease it. + /// The number of images within each octave of a gaussian pyramid. It is set to 2 by default. + /// false means basic descriptors (64 elements each), true means extended descriptors (128 elements each) + /// false means that detector computes orientation of each feature. + /// true means that the orientation is not computed (which is much, much faster). +#endif + public static SURF Create(double hessianThreshold, + int nOctaves = 4, int nOctaveLayers = 2, + bool extended = true, bool upright = false) + { + IntPtr ptr = NativeMethods.xfeatures2d_SURF_create( + hessianThreshold, nOctaves, nOctaveLayers, + extended ? 1 : 0, upright ? 1 : 0); + return new SURF(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + if (detectorPtr != null) + { + detectorPtr.Dispose(); + detectorPtr = null; + } + } + + // releases unmanaged resources + + ptr = IntPtr.Zero; + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + + #endregion + + #region Properties + + /// + /// Threshold for the keypoint detector. Only features, whose hessian is larger than hessianThreshold + /// are retained by the detector. Therefore, the larger the value, the less keypoints you will get. + /// A good default value could be from 300 to 500, depending from the image contrast. + /// + public double HessianThreshold + { + get + { + ThrowIfDisposed(); + return NativeMethods.xfeatures2d_SURF_getHessianThreshold(ptr); + } + set + { + ThrowIfDisposed(); + NativeMethods.xfeatures2d_SURF_setHessianThreshold(ptr, value); + } + } + + /// + /// The number of a gaussian pyramid octaves that the detector uses. It is set to 4 by default. + /// If you want to get very large features, use the larger value. If you want just small features, decrease it. + /// + public int NOctaves + { + get + { + ThrowIfDisposed(); + return NativeMethods.xfeatures2d_SURF_getNOctaves(ptr); + } + set + { + ThrowIfDisposed(); + NativeMethods.xfeatures2d_SURF_setNOctaves(ptr, value); + } + } + + /// + /// The number of images within each octave of a gaussian pyramid. It is set to 2 by default. + /// + public int NOctaveLayers + { + get + { + ThrowIfDisposed(); + return NativeMethods.xfeatures2d_SURF_getNOctaveLayers(ptr); + } + set + { + ThrowIfDisposed(); + NativeMethods.xfeatures2d_SURF_setNOctaveLayers(ptr, value); + } + } + + /// + /// false means that the basic descriptors (64 elements each) shall be computed. + /// true means that the extended descriptors (128 elements each) shall be computed + /// + public bool Extended + { + get + { + ThrowIfDisposed(); + return NativeMethods.xfeatures2d_SURF_getExtended(ptr) != 0; + } + set + { + ThrowIfDisposed(); + NativeMethods.xfeatures2d_SURF_setExtended(ptr, value ? 1 : 0); + } + } + + /// + /// false means that detector computes orientation of each feature. + /// true means that the orientation is not computed (which is much, much faster). + /// For example, if you match images from a stereo pair, or do image stitching, the matched features + /// likely have very similar angles, and you can speed up feature extraction by setting upright=true. + /// + public bool Upright + { + get + { + ThrowIfDisposed(); + return NativeMethods.xfeatures2d_SURF_getUpright(ptr) != 0; + } + set + { + ThrowIfDisposed(); + NativeMethods.xfeatures2d_SURF_setUpright(ptr, value ? 1 : 0); + } + } + + #endregion + } +} diff --git a/src/OpenCvSharp/modules/xfeatures2d/StarDetector.cs b/src/OpenCvSharp/modules/xfeatures2d/StarDetector.cs new file mode 100644 index 000000000..68d9350b5 --- /dev/null +++ b/src/OpenCvSharp/modules/xfeatures2d/StarDetector.cs @@ -0,0 +1,111 @@ +using System; + +namespace OpenCvSharp.XFeatures2D +{ +#if LANG_JP + /// + /// Star Detector + /// +#else + /// + /// The "Star" Detector + /// +#endif + [Serializable] + public class StarDetector : Feature2D + { + private bool disposed; + private Ptr ptrObj; + + #region Init & Disposal + + /// + /// + /// + internal StarDetector(IntPtr p) + { + ptrObj = new Ptr(p); + ptr = ptrObj.Get(); + } + +#if LANG_JP + /// + /// 初期化 + /// + /// + /// + /// + /// + /// +#else + /// + /// Constructor + /// + /// + /// + /// + /// + /// +#endif + public static StarDetector Create( + int maxSize = 45, + int responseThreshold = 30, + int lineThresholdProjected = 10, + int lineThresholdBinarized = 8, + int suppressNonmaxSize = 5) + { + IntPtr ptr = NativeMethods.xfeatures2d_StarDetector_create( + maxSize, responseThreshold, lineThresholdProjected, + lineThresholdBinarized, suppressNonmaxSize); + return new StarDetector(ptr); + } + +#if LANG_JP + /// + /// リソースの解放 + /// + /// + /// trueの場合は、このメソッドがユーザコードから直接が呼ばれたことを示す。マネージ・アンマネージ双方のリソースが解放される。 + /// falseの場合は、このメソッドはランタイムからファイナライザによって呼ばれ、もうほかのオブジェクトから参照されていないことを示す。アンマネージリソースのみ解放される。 + /// +#else + /// + /// Releases the resources + /// + /// + /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. + /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. + /// +#endif + protected override void Dispose(bool disposing) + { + if (!disposed) + { + try + { + // releases managed resources + if (disposing) + { + if (ptrObj != null) + { + ptrObj.Dispose(); + ptrObj = null; + } + } + // releases unmanaged resources + + disposed = true; + } + finally + { + base.Dispose(disposing); + } + } + } + #endregion + + #region Methods + + #endregion + } +} diff --git a/src/OpenCvSharpExtern/CMakeLists.txt b/src/OpenCvSharpExtern/CMakeLists.txt new file mode 100644 index 000000000..ea40878b4 --- /dev/null +++ b/src/OpenCvSharpExtern/CMakeLists.txt @@ -0,0 +1,32 @@ + +include_directories(${OpenCV_INCLUDE_DIR}) +link_directories(${OpenCV_LIBRARY_DIR} ${OpenCV_LIBRARIES}) + +set(OPENCVSHARP_FILES + bgsegm.cpp + calib3d.cpp + core.cpp + cuda.cpp + face.cpp + features2d.cpp + flann.cpp + highgui.cpp + imgproc.cpp + ml.cpp + objdetect.cpp + optflow.cpp + photo.cpp + std_vector.cpp + stitching.cpp + superres.cpp + video.cpp + xfeatures2d.cpp +) + +add_library(OpenCvSharpExtern SHARED ${OPENCVSHARP_FILES}) + +install(TARGETS OpenCvSharpExtern + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/static +) diff --git a/src/OpenCvSharpExtern/OpenCvSharpExtern.vcproj b/src/OpenCvSharpExtern/OpenCvSharpExtern.vcproj new file mode 100644 index 000000000..b40eb2573 --- /dev/null +++ b/src/OpenCvSharpExtern/OpenCvSharpExtern.vcproj @@ -0,0 +1,777 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/OpenCvSharpExtern/OpenCvSharpExtern.vcxproj b/src/OpenCvSharpExtern/OpenCvSharpExtern.vcxproj new file mode 100644 index 000000000..c6a2b6e7b --- /dev/null +++ b/src/OpenCvSharpExtern/OpenCvSharpExtern.vcxproj @@ -0,0 +1,422 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release-Static + Win32 + + + Release-Static + x64 + + + Release + Win32 + + + Release + x64 + + + + {8E7279F8-F801-4672-B42F-1ED2C68B16A4} + OpenCvSharpExtern + Win32Proj + + + + DynamicLibrary + MultiByte + true + v120 + + + DynamicLibrary + Unicode + true + v120 + + + DynamicLibrary + MultiByte + v120 + + + DynamicLibrary + Unicode + true + v120 + + + DynamicLibrary + Unicode + true + v120 + + + DynamicLibrary + Unicode + v110 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\$(PlatformName)\ + $(Platform)\$(Configuration)\ + true + $(SolutionDir)$(Configuration)\$(PlatformName)\ + $(Platform)\$(Configuration)\ + true + $(SolutionDir)$(Configuration)\$(PlatformName)\ + $(SolutionDir)$(Configuration)\$(PlatformName)\ + $(Configuration)\ + $(Configuration)\ + false + false + $(SolutionDir)$(Configuration)\$(PlatformName)\ + $(SolutionDir)$(Configuration)\$(PlatformName)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + $(SolutionDir)..\lib\opencv\include;$(IncludePath) + $(SolutionDir)..\lib\opencv\include;$(IncludePath) + $(SolutionDir)..\lib\opencv\include;$(IncludePath) + $(SolutionDir)..\lib\opencv\x64\vc12\lib;$(LibraryPath) + $(SolutionDir)..\lib\opencv\x64\vc12\lib;$(LibraryPath) + $(SolutionDir)..\lib\opencv\x64\vc12\staticlib;$(LibraryPath) + $(SolutionDir)..\lib\opencv\include;$(IncludePath) + $(SolutionDir)..\lib\opencv\include;$(IncludePath) + $(SolutionDir)..\lib\opencv\include;$(IncludePath) + $(SolutionDir)..\lib\opencv\x86\vc12\lib;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib;$(LibraryPath) + $(SolutionDir)..\lib\opencv\x86\vc12\staticlib;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib;$(LibraryPath) + $(SolutionDir)..\lib\opencv\x86\vc12\lib;$(LibraryPath) + + + + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Async + EnableFastChecks + MultiThreadedDebugDLL + true + + + Level3 + EditAndContinue + + + opencv_world300d.lib;%(AdditionalDependencies) + true + Windows + MachineX86 + + + + + + + + + X64 + + + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Async + EnableFastChecks + MultiThreadedDebugDLL + true + + + Level3 + ProgramDatabase + + + opencv_world310d.lib;%(AdditionalDependencies) + true + Windows + MachineX64 + + + + + + + + + MaxSpeed + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;CVAPI_EXPORTS;%(PreprocessorDefinitions) + true + Sync + Default + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + false + AnySuitable + true + true + true + 4251; + + + opencv_world310.lib;%(AdditionalDependencies) + %(IgnoreSpecificDefaultLibraries) + true + NotSet + true + true + false + + + MachineX86 + + + copy "$(LocalDebuggerCommand)" "$(SolutionDir)OpenCvSharp.Sandbox\dll\x86\$(TargetFileName)" + + + + + MaxSpeed + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;CVAPI_EXPORTS;%(PreprocessorDefinitions) + true + Sync + Default + MultiThreaded + true + + + Level3 + ProgramDatabase + false + AnySuitable + true + true + true + 4251; + + + IlmImf.lib;ippicvmt.lib;libjasper.lib;libjpeg.lib;libpng.lib;libtiff.lib;libwebp.lib;opencv_calib3d300.lib;opencv_core300.lib;opencv_features2d300.lib;opencv_flann300.lib;opencv_hal300.lib;opencv_highgui300.lib;opencv_imgcodecs300.lib;opencv_imgproc300.lib;opencv_ml300.lib;opencv_objdetect300.lib;opencv_photo300.lib;opencv_shape300.lib;opencv_stitching300.lib;opencv_superres300.lib;opencv_ts300.lib;opencv_video300.lib;opencv_videoio300.lib;opencv_videostab300.lib;zlib.lib;vfw32.lib;%(AdditionalDependencies) + %(IgnoreSpecificDefaultLibraries) + true + NotSet + true + true + false + + + MachineX86 + + + + + + + + + X64 + + + MaxSpeed + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;CVAPI_EXPORTS;%(PreprocessorDefinitions) + true + Sync + Default + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + false + true + + + opencv_world310.lib;%(AdditionalDependencies) + %(IgnoreSpecificDefaultLibraries) + true + NotSet + true + true + false + + + MachineX64 + + + copy "$(LocalDebuggerCommand)" "$(SolutionDir)OpenCvSharp.Sandbox\dll\x64\$(TargetFileName)" + + + + + X64 + + + MaxSpeed + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;CVAPI_EXPORTS;%(PreprocessorDefinitions) + true + Sync + Default + MultiThreaded + true + + + Level3 + ProgramDatabase + false + true + + + IlmImf.lib;ippicvmt.lib;libjasper.lib;libjpeg.lib;libpng.lib;libtiff.lib;libwebp.lib;opencv_calib3d300.lib;opencv_core300.lib;opencv_features2d300.lib;opencv_flann300.lib;opencv_hal300.lib;opencv_highgui300.lib;opencv_imgcodecs300.lib;opencv_imgproc300.lib;opencv_ml300.lib;opencv_objdetect300.lib;opencv_photo300.lib;opencv_shape300.lib;opencv_stitching300.lib;opencv_superres300.lib;opencv_ts300.lib;opencv_video300.lib;opencv_videoio300.lib;opencv_videostab300.lib;zlib.lib;vfw32.lib;%(AdditionalDependencies) + %(IgnoreSpecificDefaultLibraries) + true + NotSet + true + true + false + + + MachineX64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/OpenCvSharpExtern/OpenCvSharpExtern.vcxproj.filters b/src/OpenCvSharpExtern/OpenCvSharpExtern.vcxproj.filters new file mode 100644 index 000000000..92fccfd60 --- /dev/null +++ b/src/OpenCvSharpExtern/OpenCvSharpExtern.vcxproj.filters @@ -0,0 +1,323 @@ + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files\core + + + Header Files\core + + + Header Files\core + + + Header Files\core + + + Header Files\core + + + Header Files\core + + + Header Files\core + + + Header Files\core + + + Header Files\core + + + Header Files\core + + + Header Files\core + + + Header Files\ml + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files\features2d + + + Header Files\features2d + + + Header Files\features2d + + + Header Files\objdetect + + + Header Files\objdetect + + + Header Files\imgproc + + + Header Files\imgproc + + + Header Files\ml + + + Header Files + + + Header Files + + + Header Files\video + + + Header Files\video + + + Header Files\stitching + + + Header Files\stitching + + + Header Files\imgproc + + + Header Files\video + + + Header Files\calib3d + + + Header Files\ml + + + Header Files + + + Header Files\cuda + + + Header Files\cuda + + + Header Files\optflow + + + Header Files\optflow + + + Header Files + + + Header Files\calib3d + + + Header Files + + + Header Files\ml + + + Header Files\ml + + + Header Files\ml + + + Header Files\ml + + + Header Files\ml + + + Header Files\ml + + + Header Files\ml + + + Header Files\ml + + + Header Files\features2d + + + Header Files\features2d + + + Header Files\features2d + + + Header Files\features2d + + + Header Files\features2d + + + Header Files\features2d + + + Header Files\features2d + + + Header Files\features2d + + + Header Files\features2d + + + Header Files\features2d + + + Header Files + + + Header Files + + + Header Files\shape + + + Header Files\photo + + + Header Files\photo + + + Header Files\imgproc + + + Header Files\imgproc + + + Header Files\imgproc + + + + + {b0a234b5-5c12-4b8e-a0e8-0492fd41e722} + *.cpp;*.c + + + {2b66c248-878e-4591-8091-e5c812526273} + *.h;*.hpp + + + {7d21ebfe-bc23-421e-ad79-f96eaffb3777} + + + {17c51294-b680-4aa4-a74c-a51a817dd35a} + + + {d63db3ce-bfb9-4ab8-95c2-22bfe7020148} + + + {cd61c3fc-60ce-4cd6-8d3b-e87d9e0e6ffe} + + + {f8b57698-6e4b-424d-870c-29526931576a} + + + {cc445911-b121-4dc0-b44e-fb11ed931e40} + + + {d2ac930b-731a-4af9-ad0d-bfe1272b646d} + + + {620702b8-6e54-451a-a8af-52270265167a} + + + {b7573dcb-d145-4466-99d1-64124c7c5211} + + + {381d4d4f-0c83-4c35-a777-fb3214db09f9} + + + {eed306c8-8a82-4f4f-b9d5-447f88befafa} + + + {a91945a2-e61d-4a10-82c3-14772eaa2d21} + + + \ No newline at end of file diff --git a/src/OpenCvSharpExtern/bgsegm.cpp b/src/OpenCvSharpExtern/bgsegm.cpp new file mode 100644 index 000000000..b8a01c1e1 --- /dev/null +++ b/src/OpenCvSharpExtern/bgsegm.cpp @@ -0,0 +1 @@ +#include "bgsegm.h" \ No newline at end of file diff --git a/src/OpenCvSharpExtern/bgsegm.h b/src/OpenCvSharpExtern/bgsegm.h new file mode 100644 index 000000000..5ff9d0eff --- /dev/null +++ b/src/OpenCvSharpExtern/bgsegm.h @@ -0,0 +1,178 @@ +#ifdef ENABLED_CONTRIB +#ifndef _CPP_BGSEGM_H_ +#define _CPP_BGSEGM_H_ + +#include "include_opencv.h" +using namespace cv::bgsegm; + + +#pragma region BackgroundSubtractorMOG + +CVAPI(cv::Ptr*) bgsegm_createBackgroundSubtractorMOG( + int history, int nmixtures, double backgroundRatio, double noiseSigma) +{ + cv::Ptr ptr = createBackgroundSubtractorMOG(history, nmixtures, backgroundRatio, noiseSigma); + return new cv::Ptr(ptr); +} +CVAPI(void) bgsegm_Ptr_BackgroundSubtractorMOG_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(BackgroundSubtractorMOG*) bgsegm_Ptr_BackgroundSubtractorMOG_get( + cv::Ptr *ptr) +{ + return ptr->get(); +} + +CVAPI(int) bgsegm_BackgroundSubtractorMOG_getHistory(cv::Ptr *ptr) +{ + return (*ptr)->getHistory(); +} +CVAPI(void) bgsegm_BackgroundSubtractorMOG_setHistory(cv::Ptr *ptr, int value) +{ + (*ptr)->setHistory(value); +} + +CVAPI(int) bgsegm_BackgroundSubtractorMOG_getNMixtures(cv::Ptr *ptr) +{ + return (*ptr)->getNMixtures(); +} +CVAPI(void) bgsegm_BackgroundSubtractorMOG_setNMixtures(cv::Ptr *ptr, int value) +{ + (*ptr)->setNMixtures(value); +} + +CVAPI(double) bgsegm_BackgroundSubtractorMOG_getBackgroundRatio(cv::Ptr *ptr) +{ + return (*ptr)->getBackgroundRatio(); +} +CVAPI(void) bgsegm_BackgroundSubtractorMOG_setBackgroundRatio(cv::Ptr *ptr, double value) +{ + (*ptr)->setBackgroundRatio(value); +} + +CVAPI(double) bgsegm_BackgroundSubtractorMOG_getNoiseSigma(cv::Ptr *ptr) +{ + return (*ptr)->getNoiseSigma(); +} +CVAPI(void) bgsegm_BackgroundSubtractorMOG_setNoiseSigma(cv::Ptr *ptr, double value) +{ + (*ptr)->setNoiseSigma(value); +} + +#pragma endregion + +#pragma region BackgroundSubtractorGMG + +CVAPI(cv::Ptr*) bgsegm_createBackgroundSubtractorGMG( + int initializationFrames, double decisionThreshold) +{ + cv::Ptr ptr = createBackgroundSubtractorGMG(initializationFrames, decisionThreshold); + return new cv::Ptr(ptr); +} +CVAPI(void) bgsegm_Ptr_BackgroundSubtractorGMG_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(BackgroundSubtractorGMG*) bgsegm_Ptr_BackgroundSubtractorGMG_get( + cv::Ptr *ptr) +{ + return ptr->get(); +} + +CVAPI(int) bgsegm_BackgroundSubtractorGMG_getMaxFeatures(cv::Ptr *ptr) +{ + return (*ptr)->getMaxFeatures(); +} +CVAPI(void) bgsegm_BackgroundSubtractorGMG_setMaxFeatures(cv::Ptr *ptr, int value) +{ + (*ptr)->setMaxFeatures(value); +} + +CVAPI(double) bgsegm_BackgroundSubtractorGMG_getDefaultLearningRate(cv::Ptr *ptr) +{ + return (*ptr)->getDefaultLearningRate(); +} +CVAPI(void) bgsegm_BackgroundSubtractorGMG_setDefaultLearningRate(cv::Ptr *ptr, double value) +{ + (*ptr)->setDefaultLearningRate(value); +} + +CVAPI(int) bgsegm_BackgroundSubtractorGMG_getNumFrames(cv::Ptr *ptr) +{ + return (*ptr)->getNumFrames(); +} +CVAPI(void) bgsegm_BackgroundSubtractorGMG_setNumFrames(cv::Ptr *ptr, int value) +{ + (*ptr)->setNumFrames(value); +} + +CVAPI(int) bgsegm_BackgroundSubtractorGMG_getQuantizationLevels(cv::Ptr *ptr) +{ + return (*ptr)->getQuantizationLevels(); +} +CVAPI(void) bgsegm_BackgroundSubtractorGMG_setQuantizationLevels(cv::Ptr *ptr, int value) +{ + (*ptr)->setQuantizationLevels(value); +} + +CVAPI(double) bgsegm_BackgroundSubtractorGMG_getBackgroundPrior(cv::Ptr *ptr) +{ + return (*ptr)->getBackgroundPrior(); +} +CVAPI(void) bgsegm_BackgroundSubtractorGMG_setBackgroundPrior(cv::Ptr *ptr, double value) +{ + (*ptr)->setBackgroundPrior(value); +} + +CVAPI(int) bgsegm_BackgroundSubtractorGMG_getSmoothingRadius(cv::Ptr *ptr) +{ + return (*ptr)->getSmoothingRadius(); +} +CVAPI(void) bgsegm_BackgroundSubtractorGMG_setSmoothingRadius(cv::Ptr *ptr, int value) +{ + (*ptr)->setSmoothingRadius(value); +} + +CVAPI(double) bgsegm_BackgroundSubtractorGMG_getDecisionThreshold(cv::Ptr *ptr) +{ + return (*ptr)->getDecisionThreshold(); +} +CVAPI(void) bgsegm_BackgroundSubtractorGMG_setDecisionThreshold(cv::Ptr *ptr, double value) +{ + (*ptr)->setDecisionThreshold(value); +} + +CVAPI(int) bgsegm_BackgroundSubtractorGMG_getUpdateBackgroundModel(cv::Ptr *ptr) +{ + return (*ptr)->getUpdateBackgroundModel() ? 1 : 0; +} +CVAPI(void) bgsegm_BackgroundSubtractorGMG_setUpdateBackgroundModel(cv::Ptr *ptr, int value) +{ + (*ptr)->setUpdateBackgroundModel(value != 0); +} + +CVAPI(double) bgsegm_BackgroundSubtractorGMG_getMinVal(cv::Ptr *ptr) +{ + return (*ptr)->getMinVal(); +} +CVAPI(void) bgsegm_BackgroundSubtractorGMG_setMinVal(cv::Ptr *ptr, double value) +{ + (*ptr)->setMinVal(value); +} + +CVAPI(double) bgsegm_BackgroundSubtractorGMG_getMaxVal(cv::Ptr *ptr) +{ + return (*ptr)->getMaxVal(); +} +CVAPI(void) bgsegm_BackgroundSubtractorGMG_setMaxVal(cv::Ptr *ptr, double value) +{ + (*ptr)->setMaxVal(value); +} + +#pragma endregion + +#endif +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/calib3d.cpp b/src/OpenCvSharpExtern/calib3d.cpp new file mode 100644 index 000000000..604bc60e5 --- /dev/null +++ b/src/OpenCvSharpExtern/calib3d.cpp @@ -0,0 +1,2 @@ +#include "calib3d.h" +#include "calib3d_StereoMatcher.h" \ No newline at end of file diff --git a/src/OpenCvSharpExtern/calib3d.h b/src/OpenCvSharpExtern/calib3d.h new file mode 100644 index 000000000..271f78aff --- /dev/null +++ b/src/OpenCvSharpExtern/calib3d.h @@ -0,0 +1,685 @@ +#ifndef _CPP_CALIB3D_H_ +#define _CPP_CALIB3D_H_ + +#include "include_opencv.h" + +CVAPI(void) calib3d_Rodrigues(cv::_InputArray *src, cv::_OutputArray *dst, cv::_OutputArray *jacobian) +{ + cv::Rodrigues(*src, *dst, entity(jacobian)); +} +CVAPI(void) calib3d_Rodrigues_VecToMat(cv::Mat *vector, cv::Mat *matrix, cv::Mat *jacobian) +{ + cv::Mat vectorM(3, 1, CV_64FC1, vector); + cv::Mat matrixM(3, 3, CV_64FC1, matrix); + cv::Mat jacobianM(3, 9, CV_64FC1, jacobian); + cv::Rodrigues(*vector, *matrix, *jacobian); +} +CVAPI(void) calib3d_Rodrigues_MatToVec(cv::Mat *matrix, cv::Mat *vector, cv::Mat *jacobian) +{ + cv::Mat matrixM(3, 3, CV_64FC1, matrix); + cv::Mat vectorM(3, 1, CV_64FC1, vector); + cv::Mat jacobianM(3, 9, CV_64FC1, jacobian); + cv::Rodrigues(*matrix, *vector, *jacobian); +} + +CVAPI(cv::Mat*) calib3d_findHomography_InputArray(cv::_InputArray *srcPoints, cv::_InputArray *dstPoints, + int method, double ransacReprojThreshold, cv::_OutputArray *mask) +{ + cv::Mat ret = cv::findHomography(*srcPoints, *dstPoints, method, ransacReprojThreshold, entity(mask)); + return new cv::Mat(ret); +} +CVAPI(cv::Mat*) calib3d_findHomography_vector(cv::Point2d *srcPoints, int srcPointsLength, + cv::Point2d *dstPoints, int dstPointsLength, + int method, double ransacReprojThreshold, cv::_OutputArray *mask) +{ + cv::Mat srcPointsMat(srcPointsLength, 1, CV_64FC2, srcPoints); + cv::Mat dstPointsMat(dstPointsLength, 1, CV_64FC2, dstPoints); + + cv::Mat ret = cv::findHomography(srcPointsMat, dstPointsMat, method, ransacReprojThreshold, entity(mask)); + return new cv::Mat(ret); +} + +CVAPI(void) calib3d_RQDecomp3x3_InputArray(cv::_InputArray *src, cv::_OutputArray *mtxR, cv::_OutputArray *mtxQ, + cv::_OutputArray *qx, cv::_OutputArray *qy, cv::_OutputArray *qz, cv::Vec3d *outVec) +{ + *outVec = cv::RQDecomp3x3(*src, *mtxR, *mtxQ, entity(qx), entity(qy), entity(qz)); +} +CVAPI(void) calib3d_RQDecomp3x3_Mat(cv::Mat *src, cv::Mat *mtxR, cv::Mat *mtxQ, + cv::Mat *qx, cv::Mat *qy, cv::Mat *qz, cv::Vec3d *outVec) +{ + *outVec = cv::RQDecomp3x3(*src, *mtxR, *mtxQ, *qx, *qy, *qz); +} + +CVAPI(void) calib3d_decomposeProjectionMatrix_InputArray(cv::_InputArray *projMatrix, cv::_OutputArray *cameraMatrix, + cv::_OutputArray *rotMatrix, cv::_OutputArray *transVect, cv::_OutputArray *rotMatrixX, + cv::_OutputArray *rotMatrixY, cv::_OutputArray *rotMatrixZ, cv::_OutputArray *eulerAngles) +{ + cv::decomposeProjectionMatrix(*projMatrix, *cameraMatrix, *rotMatrix, + *transVect, entity(rotMatrixX), entity(rotMatrixY), entity(rotMatrixZ), entity(eulerAngles)); +} +CVAPI(void) calib3d_decomposeProjectionMatrix_Mat(cv::Mat *projMatrix, cv::Mat *cameraMatrix, + cv::Mat *rotMatrix, cv::Mat *transVect, cv::Mat *rotMatrixX, + cv::Mat *rotMatrixY, cv::Mat *rotMatrixZ, cv::Mat *eulerAngles) +{ + cv::decomposeProjectionMatrix(*projMatrix, *cameraMatrix, *rotMatrix, + *transVect, *rotMatrixX, *rotMatrixY, *rotMatrixZ, *eulerAngles); +} + +CVAPI(void) calib3d_matMulDeriv(cv::_InputArray *a, cv::_InputArray *b, + cv::_OutputArray *dABdA, cv::_OutputArray *dABdB) +{ + cv::matMulDeriv(*a, *b, *dABdA, *dABdB); +} + +CVAPI(void) calib3d_composeRT_InputArray(cv::_InputArray *rvec1, cv::_InputArray *tvec1, + cv::_InputArray *rvec2, cv::_InputArray *tvec2, + cv::_OutputArray *rvec3, cv::_OutputArray *tvec3, + cv::_OutputArray *dr3dr1, cv::_OutputArray *dr3dt1, + cv::_OutputArray *dr3dr2, cv::_OutputArray *dr3dt2, + cv::_OutputArray *dt3dr1, cv::_OutputArray *dt3dt1, + cv::_OutputArray *dt3dr2, cv::_OutputArray *dt3dt2) +{ + cv::composeRT(*rvec1, *tvec1, *rvec2, *tvec2, *rvec3, *tvec3, + entity(dr3dr1), entity(dr3dt1), entity(dr3dr2), entity(dr3dt2), + entity(dt3dr1), entity(dt3dt1), entity(dt3dr2), entity(dt3dt2)); +} + +CVAPI(void) calib3d_composeRT_Mat(cv::Mat *rvec1, cv::Mat *tvec1, + cv::Mat *rvec2, cv::Mat *tvec2, + cv::Mat *rvec3, cv::Mat *tvec3, + cv::Mat *dr3dr1, cv::Mat *dr3dt1, + cv::Mat *dr3dr2, cv::Mat *dr3dt2, + cv::Mat *dt3dr1, cv::Mat *dt3dt1, + cv::Mat *dt3dr2, cv::Mat *dt3dt2) +{ + cv::composeRT(*rvec1, *tvec1, *rvec2, *tvec2, *rvec3, *tvec3, + entity(dr3dr1), entity(dr3dt1), entity(dr3dr2), entity(dr3dt2), + entity(dt3dr1), entity(dt3dt1), entity(dt3dr2), entity(dt3dt2)); +} + +CVAPI(void) calib3d_projectPoints_InputArray(cv::_InputArray *objectPoints, + cv::_InputArray *rvec, cv::_InputArray *tvec, + cv::_InputArray *cameraMatrix, cv::_InputArray *distCoeffs, + cv::_OutputArray *imagePoints, + cv::_OutputArray *jacobian, + double aspectRatio) +{ + cv::projectPoints(*objectPoints, *rvec, *tvec, *cameraMatrix, *distCoeffs, + *imagePoints, *jacobian, aspectRatio); +} +CVAPI(void) calib3d_projectPoints_Mat(cv::Mat *objectPoints, + cv::Mat *rvec, cv::Mat *tvec, + cv::Mat *cameraMatrix, cv::Mat *distCoeffs, + cv::Mat *imagePoints, + cv::Mat *jacobian, + double aspectRatio) +{ + cv::projectPoints(*objectPoints, *rvec, *tvec, *cameraMatrix, *distCoeffs, + *imagePoints, *jacobian, aspectRatio); +} + + +CVAPI(void) calib3d_solvePnP_InputArray(cv::_InputArray *objectPoints, cv::_InputArray *imagePoints, cv::_InputArray *cameraMatrix, cv::_InputArray *distCoeffs, + cv::_OutputArray *rvec, cv::_OutputArray *tvec, int useExtrinsicGuess, int flags) +{ + cv::solvePnP(*objectPoints, *imagePoints, *cameraMatrix, entity(distCoeffs), *rvec, *tvec, useExtrinsicGuess != 0, flags); +} +CVAPI(void) calib3d_solvePnP_vector(cv::Point3f *objectPoints, int objectPointsLength, + cv::Point2f *imagePoints, int imagePointsLength, + double *cameraMatrix, double *distCoeffs, int distCoeffsLength, + double *rvec, double *tvec, int useExtrinsicGuess, + int flags) +{ + cv::Mat objectPointsMat(objectPointsLength, 1, CV_64FC3, objectPoints); + cv::Mat imagePointsMat(imagePointsLength, 1, CV_64FC2, imagePoints); + cv::Mat distCoeffsMat; + if (distCoeffs != NULL) + distCoeffsMat = cv::Mat(distCoeffsLength, 1, CV_64FC1, distCoeffs); + + cv::Matx rvecM, tvecM; + cv::solvePnP(objectPointsMat, imagePointsMat, *cameraMatrix, distCoeffsMat, rvecM, tvecM, useExtrinsicGuess != 0, flags); + memcpy(rvec, rvecM.val, sizeof(double) * 3); + memcpy(tvec, tvecM.val, sizeof(double) * 3); +} + +CVAPI(void) calib3d_solvePnPRansac_InputArray(cv::_InputArray *objectPoints, cv::_InputArray *imagePoints, + cv::_InputArray *cameraMatrix, cv::_InputArray *distCoeffs, cv::_OutputArray *rvec, cv::_OutputArray *tvec, + bool useExtrinsicGuess, int iterationsCount, float reprojectionError, int minInliersCount, + cv::_OutputArray *inliers, int flags) +{ + cv::solvePnPRansac(*objectPoints, *imagePoints, *cameraMatrix, entity(distCoeffs), *rvec, *tvec, + useExtrinsicGuess != 0, iterationsCount, reprojectionError, minInliersCount, + entity(inliers), flags); +} +CVAPI(void) calib3d_solvePnPRansac_vector(cv::Point3f *objectPoints, int objectPointsLength, + cv::Point2f *imagePoints, int imagePointsLength, + double *cameraMatrix, double *distCoeffs, int distCoeffsLength, + double *rvec, double *tvec, + int useExtrinsicGuess, int iterationsCount, float reprojectionError, int minInliersCount, + std::vector *inliers, int flags) +{ + cv::Mat objectPointsMat(objectPointsLength, 1, CV_64FC3, objectPoints); + cv::Mat imagePointsMat(imagePointsLength, 1, CV_64FC2, imagePoints); + cv::Mat distCoeffsMat; + if (distCoeffs != NULL) + distCoeffsMat = cv::Mat(distCoeffsLength, 1, CV_64FC1, distCoeffs); + + cv::Matx rvecM, tvecM; + + cv::solvePnPRansac(objectPointsMat, imagePointsMat, *cameraMatrix, distCoeffsMat, rvecM, tvecM, + useExtrinsicGuess != 0, iterationsCount, reprojectionError, minInliersCount, + *inliers, flags); + + memcpy(rvec, rvecM.val, sizeof(double) * 3); + memcpy(tvec, tvecM.val, sizeof(double) * 3); +} + +CVAPI(cv::Mat*) calib3d_initCameraMatrix2D_Mat(cv::Mat **objectPoints, int objectPointsLength, + cv::Mat **imagePoints, int imagePointsLength, CvSize imageSize, double aspectRatio) +{ + std::vector objectPointsVec(objectPointsLength); + for (int i = 0; i < objectPointsLength; i++) + objectPointsVec[i] = *objectPoints[i]; + std::vector imagePointsVec(imagePointsLength); + for (int i = 0; i < objectPointsLength; i++) + imagePointsVec[i] = *imagePoints[i]; + + cv::Mat ret = cv::initCameraMatrix2D(objectPointsVec, imagePointsVec, imageSize, aspectRatio); + return new cv::Mat(ret); +} +CVAPI(cv::Mat*) calib3d_initCameraMatrix2D_array(cv::Point3d **objectPoints, int opSize1, int *opSize2, + cv::Point2d **imagePoints, int ipSize1, int *ipSize2, CvSize imageSize, double aspectRatio) +{ + std::vector > objectPointsVec(opSize1); + for (int i = 0; i < opSize1; i++) + objectPointsVec[i] = std::vector(objectPoints[i], objectPoints[i] + opSize2[i]); + std::vector > imagePointsVec(ipSize1); + for (int i = 0; i < ipSize1; i++) + imagePointsVec[i] = std::vector(imagePoints[i], imagePoints[i] + ipSize2[i]); + + cv::Mat ret = cv::initCameraMatrix2D(objectPointsVec, imagePointsVec, imageSize, aspectRatio); + return new cv::Mat(ret); +} + +CVAPI(int) calib3d_findChessboardCorners_InputArray(cv::_InputArray *image, CvSize patternSize, + cv::_OutputArray *corners, int flags) +{ + return cv::findChessboardCorners(*image, patternSize, *corners, flags) ? 1 : 0; +} +CVAPI(int) calib3d_findChessboardCorners_vector(cv::_InputArray *image, CvSize patternSize, + std::vector *corners, int flags) +{ + return cv::findChessboardCorners(*image, patternSize, *corners, flags) ? 1 : 0; +} + +CVAPI(int) calib3d_find4QuadCornerSubpix_InputArray(cv::_InputArray *img, cv::_InputOutputArray *corners, CvSize regionSize) +{ + return cv::find4QuadCornerSubpix(*img, *corners, regionSize) ? 1 : 0; +} +CVAPI(int) calib3d_find4QuadCornerSubpix_vector(cv::_InputArray *img, std::vector *corners, CvSize regionSize) +{ + return cv::find4QuadCornerSubpix(*img, *corners, regionSize) ? 1 : 0; +} + +CVAPI(void) calib3d_drawChessboardCorners_InputArray(cv::_InputOutputArray *image, CvSize patternSize, + cv::_InputArray *corners, int patternWasFound) +{ + cv::drawChessboardCorners(*image, patternSize, *corners, patternWasFound != 0); +} +CVAPI(void) calib3d_drawChessboardCorners_array(cv::_InputOutputArray *image, CvSize patternSize, + cv::Point2f *corners, int cornersLength, int patternWasFound) +{ + std::vector cornersVec(corners, corners + cornersLength); + cv::drawChessboardCorners(*image, patternSize, cornersVec, patternWasFound != 0); +} + +static void BlobDetectorDeleter(cv::FeatureDetector *p) {} + +CVAPI(int) calib3d_findCirclesGrid_InputArray(cv::_InputArray *image, CvSize patternSize, + cv::_OutputArray *centers, int flags, cv::FeatureDetector* blobDetector) +{ + if (blobDetector == NULL) + return cv::findCirclesGrid(*image, patternSize, *centers, flags) ? 1 : 0; + + cv::Ptr detectorPtr(blobDetector, BlobDetectorDeleter); // don't delete + return cv::findCirclesGrid(*image, patternSize, *centers, flags, detectorPtr) ? 1 : 0; +} +CVAPI(int) calib3d_findCirclesGrid_vector(cv::_InputArray *image, CvSize patternSize, + std::vector *centers, int flags, cv::FeatureDetector* blobDetector) +{ + if (blobDetector == NULL) + return cv::findCirclesGrid(*image, patternSize, *centers, flags) ? 1 : 0; + + cv::Ptr detectorPtr(blobDetector, BlobDetectorDeleter); // don't delete + return cv::findCirclesGrid(*image, patternSize, *centers, flags, detectorPtr) ? 1 : 0; +} + +CVAPI(double) calib3d_calibrateCamera_InputArray( + cv::Mat **objectPoints, int objectPointsSize, + cv::Mat **imagePoints, int imagePointsSize, + CvSize imageSize, + cv::_InputOutputArray *cameraMatrix, + cv::_InputOutputArray *distCoeffs, + std::vector *rvecs, std::vector *tvecs, + int flags, + CvTermCriteria criteria) +{ + std::vector objectPointsVec(objectPointsSize); + for (int i = 0; i < objectPointsSize; i++) + objectPointsVec[i] = *objectPoints[i]; + std::vector imagePointsVec(imagePointsSize); + for (int i = 0; i < imagePointsSize; i++) + imagePointsVec[i] = *imagePoints[i]; + + return cv::calibrateCamera(objectPointsVec, imagePointsVec, imageSize, + *cameraMatrix, *distCoeffs, *rvecs, *tvecs, flags, criteria); +} +CVAPI(double) calib3d_calibrateCamera_vector( + cv::Point3f **objectPoints, int opSize1, int *opSize2, + cv::Point2f **imagePoints, int ipSize1, int *ipSize2, + CvSize imageSize, + double *cameraMatrix, + double *distCoeffs, int distCoeffsSize, + std::vector *rvecs, std::vector *tvecs, + int flags, + CvTermCriteria criteria) +{ + std::vector > objectPointsVec(opSize1); + for (int i = 0; i < opSize1; i++) + objectPointsVec[i] = std::vector(objectPoints[i], objectPoints[i] + opSize2[i]); + + std::vector > imagePointsVec(ipSize1); + for (int i = 0; i < ipSize1; i++) + imagePointsVec[i] = std::vector(imagePoints[i], imagePoints[i] + ipSize2[i]); + + cv::Mat cametaMatrixM(3, 3, CV_64FC1, cameraMatrix); + cv::Mat distCoeffsM(distCoeffsSize, 1, CV_64FC1, distCoeffs); + + return cv::calibrateCamera(objectPointsVec, imagePointsVec, imageSize, + cametaMatrixM, distCoeffsM, *rvecs, *tvecs, flags, criteria); +} + +CVAPI(void) calib3d_calibrationMatrixValues_InputArray(cv::_InputArray *cameraMatrix, CvSize imageSize, + double apertureWidth, double apertureHeight, double *fovx, double *fovy, double *focalLength, + cv::Point2d *principalPoint, double *aspectRatio) +{ + double fovx0, fovy0, focalLength0, aspectRatio0; + cv::Point2d principalPoint0; + cv::calibrationMatrixValues(*cameraMatrix, imageSize, apertureWidth, apertureHeight, + fovx0, fovy0, focalLength0, principalPoint0, aspectRatio0); + *fovx = fovx0; + *fovy = fovy0; + *principalPoint = principalPoint0; + *focalLength = focalLength0; + *aspectRatio = aspectRatio0; +} +CVAPI(void) calib3d_calibrationMatrixValues_array(double *cameraMatrix, CvSize imageSize, + double apertureWidth, double apertureHeight, double *fovx, double *fovy, double *focalLength, + cv::Point2d *principalPoint, double *aspectRatio) +{ + cv::Mat cameraMatrixM(3, 3, CV_64FC1, cameraMatrix); + cv::_InputArray cameraMatrixI(cameraMatrixM); + calib3d_calibrationMatrixValues_InputArray(&cameraMatrixI, imageSize, apertureWidth, apertureHeight, + fovx, fovy, focalLength, principalPoint, aspectRatio); +} + +CVAPI(double) calib3d_stereoCalibrate_InputArray(cv::_InputArray **objectPoints, int opSize, + cv::_InputArray **imagePoints1, int ip1Size, + cv::_InputArray **imagePoints2, int ip2Size, + cv::_InputOutputArray *cameraMatrix1, + cv::_InputOutputArray *distCoeffs1, + cv::_InputOutputArray *cameraMatrix2, + cv::_InputOutputArray *distCoeffs2, + MyCvSize imageSize, + cv::_OutputArray *R, cv::_OutputArray *T, + cv::_OutputArray *E, cv::_OutputArray *F, + int flags, + MyCvTermCriteria criteria) +{ + std::vector objectPointsVec(opSize); + std::vector imagePoints1Vec(ip1Size); + std::vector imagePoints2Vec(ip2Size); + for (int i = 0; i < opSize; i++) + objectPointsVec[i] = *objectPoints[i]; + for (int i = 0; i < ip1Size; i++) + imagePoints1Vec[i] = *imagePoints1[i]; + for (int i = 0; i < ip2Size; i++) + imagePoints2Vec[i] = *imagePoints2[i]; + + return cv::stereoCalibrate(objectPointsVec, imagePoints1Vec, imagePoints2Vec, + *cameraMatrix1, *distCoeffs1, + *cameraMatrix2, *distCoeffs2, + cpp(imageSize), entity(R), entity(T), entity(E), entity(F), flags, cpp(criteria)); +} +CVAPI(double) calib3d_stereoCalibrate_array( + cv::Point3f **objectPoints, int opSize1, int *opSizes2, + cv::Point2f **imagePoints1, int ip1Size1, int *ip1Sizes2, + cv::Point2f **imagePoints2, int ip2Size1, int *ip2Sizes2, + double *cameraMatrix1, + double *distCoeffs1, int dc1Size, + double *cameraMatrix2, + double *distCoeffs2, int dc2Size, + MyCvSize imageSize, + cv::_OutputArray *R, cv::_OutputArray *T, + cv::_OutputArray *E, cv::_OutputArray *F, + int flags, + MyCvTermCriteria criteria ) +{ + std::vector > objectPointsVec(opSize1); + std::vector > imagePoints1Vec(ip1Size1); + std::vector > imagePoints2Vec(ip2Size1); + for (int i = 0; i < opSize1; i++) + objectPointsVec[i] = std::vector( + objectPoints[i], objectPoints[i] + opSizes2[i]); + for (int i = 0; i < ip1Size1; i++) + imagePoints1Vec[i] = std::vector( + imagePoints1[i], imagePoints1[i] + ip1Sizes2[i]); + for (int i = 0; i < ip2Size1; i++) + imagePoints2Vec[i] = std::vector( + imagePoints2[i], imagePoints2[i] + ip2Sizes2[i]); + + cv::Mat cameraMatrix1M(3, 3, CV_64FC1, cameraMatrix1); + cv::Mat cameraMatrix2M(3, 3, CV_64FC1, cameraMatrix2); + cv::Mat distCoeffs1M(dc1Size, 1, CV_64FC1, distCoeffs1); + cv::Mat distCoeffs2M(dc2Size, 1, CV_64FC1, distCoeffs2); + + return cv::stereoCalibrate(objectPointsVec, imagePoints1Vec, imagePoints2Vec, + cameraMatrix1M, distCoeffs1M, + cameraMatrix2M, distCoeffs2M, + cpp(imageSize), entity(R), entity(T), entity(E), entity(F), flags, cpp(criteria)); +} + +CVAPI(void) calib3d_stereoRectify_InputArray( + cv::_InputArray *cameraMatrix1, cv::_InputArray *distCoeffs1, + cv::_InputArray *cameraMatrix2, cv::_InputArray *distCoeffs2, + MyCvSize imageSize, cv::_InputArray *R, cv::_InputArray *T, + cv::_OutputArray *R1, cv::_OutputArray *R2, + cv::_OutputArray *P1, cv::_OutputArray *P2, + cv::_OutputArray *Q, int flags, + double alpha, CvSize newImageSize, + CvRect *validPixROI1, CvRect *validPixROI2) +{ + cv::Rect _validPixROI1, _validPixROI2; + cv::stereoRectify(*cameraMatrix1, *distCoeffs1, *cameraMatrix2, *distCoeffs2, + cpp(imageSize), *R, *T, *R1, *R2, *P1, *P2, *Q, flags, alpha, newImageSize, + &_validPixROI1, &_validPixROI2); + *validPixROI1 = _validPixROI1; + *validPixROI2 = _validPixROI2; +} +CVAPI(void) calib3d_stereoRectify_array(double *cameraMatrix1, + double *distCoeffs1, int dc1Size, + double *cameraMatrix2, + double *distCoeffs2, int dc2Size, + MyCvSize imageSize, + double *R, double *T, + double *R1, double *R2, double *P1, double *P2, + double *Q, int flags, double alpha, MyCvSize newImageSize, + CvRect *validPixROI1, CvRect *validPixROI2) +{ + cv::Mat cameraMatrix1M(3, 3, CV_64FC1, cameraMatrix1); + cv::Mat cameraMatrix2M(3, 3, CV_64FC1, cameraMatrix2); + cv::Mat distCoeffs1M(dc1Size, 1, CV_64FC1, distCoeffs1); + cv::Mat distCoeffs2M(dc2Size, 1, CV_64FC1, distCoeffs2); + cv::Mat RM(3, 3, CV_64FC1, R); + cv::Mat TM(1, 3, CV_64FC1, T); + + cv::Mat R1M(3, 3, CV_64FC1, R1); + cv::Mat R2M(3, 3, CV_64FC1, R2); + cv::Mat P1M(3, 4, CV_64FC1, P1); + cv::Mat P2M(3, 4, CV_64FC1, P2); + cv::Mat QM(3, 4, CV_64FC1, Q); + + cv::Rect _validPixROI1, _validPixROI2; + cv::stereoRectify(cameraMatrix1M, distCoeffs1M, cameraMatrix2M, distCoeffs2M, + cpp(imageSize), RM, TM, R1M, R2M, P1M, P2M, QM, flags, alpha, cpp(newImageSize), + &_validPixROI1, &_validPixROI2); + *validPixROI1 = _validPixROI1; + *validPixROI2 = _validPixROI2; +} + +CVAPI(int) calib3d_stereoRectifyUncalibrated_InputArray(cv::_InputArray *points1, cv::_InputArray *points2, + cv::_InputArray *F, MyCvSize imgSize, + cv::_OutputArray *H1, cv::_OutputArray *H2, + double threshold) +{ + return cv::stereoRectifyUncalibrated(*points1, *points2, *F, cpp(imgSize), *H1, *H2, threshold) ? 1 : 0; +} +CVAPI(int) calib3d_stereoRectifyUncalibrated_array(cv::Point2d *points1, int points1Size, + cv::Point2d *points2, int points2Size, + cv::_InputArray *F, MyCvSize imgSize, + double *H1, double *H2, + double threshold) +{ + cv::Mat points1Mat(points1Size, 1, CV_64FC2, points1); + cv::Mat points2Mat(points2Size, 1, CV_64FC2, points2); + cv::Mat H1M(3, 3, CV_64FC1, H1); + cv::Mat H2M(3, 3, CV_64FC1, H2); + return cv::stereoRectifyUncalibrated(points1Mat, points2Mat, *F, cpp(imgSize), H1M, H2M, threshold) ? 1 : 0; +} + +CVAPI(float) calib3d_rectify3Collinear_InputArray( + cv::_InputArray *cameraMatrix1, cv::_InputArray *distCoeffs1, + cv::_InputArray *cameraMatrix2, cv::_InputArray *distCoeffs2, + cv::_InputArray *cameraMatrix3, cv::_InputArray *distCoeffs3, + cv::_InputArray **imgpt1, int imgpt1Size, + cv::_InputArray **imgpt3, int imgpt3Size, + CvSize imageSize, cv::_InputArray *R12, cv::_InputArray *T12, + cv::_InputArray *R13, cv::_InputArray *T13, + cv::_OutputArray *R1, cv::_OutputArray *R2, cv::_OutputArray *R3, + cv::_OutputArray *P1, cv::_OutputArray *P2, cv::_OutputArray *P3, + cv::_OutputArray *Q, double alpha, CvSize newImgSize, + CvRect *roi1, CvRect *roi2, int flags) +{ + std::vector imgpt1Vec(imgpt1Size); + std::vector imgpt3Vec(imgpt3Size); + for (int i = 0; i < imgpt1Size; i++) + imgpt1Vec[i] = *(imgpt1[i]); + for (int i = 0; i < imgpt1Size; i++) + imgpt3Vec[i] = *(imgpt3[i]); + cv::Rect _roi1, _roi2; + + float ret = cv::rectify3Collinear(*cameraMatrix1, *distCoeffs1, + *cameraMatrix2, *distCoeffs2, *cameraMatrix3, *distCoeffs3, + imgpt1Vec, imgpt3Vec, imageSize, *R12, *T12, *R13, *T13, + *R1, *R2, *R3, *P1, *P2, *P3, *Q, alpha, newImgSize, + &_roi1, &_roi2, flags); + *roi1 = _roi1; + *roi2 = _roi2; + return ret; +} + +CVAPI(cv::Mat*) calib3d_getOptimalNewCameraMatrix_InputArray( + cv::_InputArray *cameraMatrix, cv::_InputArray *distCoeffs, + MyCvSize imageSize, double alpha, MyCvSize newImgSize, + CvRect* validPixROI, int centerPrincipalPoint) +{ + cv::Rect _validPixROI; + cv::Mat mat = cv::getOptimalNewCameraMatrix(*cameraMatrix, entity(distCoeffs), + cpp(imageSize), alpha, cpp(newImgSize), &_validPixROI, centerPrincipalPoint != 0); + *validPixROI = _validPixROI; + return new cv::Mat(mat); +} +CVAPI(void) calib3d_getOptimalNewCameraMatrix_array( + double *cameraMatrix, + double *distCoeffs, int distCoeffsSize, + MyCvSize imageSize, double alpha, MyCvSize newImgSize, + CvRect* validPixROI, int centerPrincipalPoint, + double *outValues) +{ + CvMat cameraMatrixM = cvMat(3, 3, CV_64FC1, cameraMatrix); + CvMat distCoeffsM = cvMat(distCoeffsSize, 1, CV_64FC1, distCoeffs); + CvMat *pdistCoeffsM = (distCoeffs == NULL) ? NULL : &distCoeffsM; + CvMat newCameraMatrix = cvMat(3, 3, CV_64FC1, outValues); + + cvGetOptimalNewCameraMatrix(&cameraMatrixM, pdistCoeffsM, cpp(imageSize), + alpha, &newCameraMatrix, cpp(newImgSize), validPixROI, centerPrincipalPoint != 0); +} + +CVAPI(void) calib3d_convertPointsToHomogeneous_InputArray(cv::_InputArray *src, cv::_OutputArray *dst) +{ + cv::convertPointsToHomogeneous(*src, *dst); +} +CVAPI(void) calib3d_convertPointsToHomogeneous_array1(cv::Vec2f *src, cv::Vec3f *dst, int length) +{ + cv::Mat srcMat(length, 1, CV_64FC2, src); + cv::Mat dstMat(length, 1, CV_64FC3, dst); + cv::convertPointsFromHomogeneous(srcMat, dstMat); +} +CVAPI(void) calib3d_convertPointsToHomogeneous_array2(cv::Vec3f *src, cv::Vec4f *dst, int length) +{ + cv::Mat srcMat(length, 1, CV_64FC3, src); + cv::Mat dstMat(length, 1, CV_64FC4, dst); + cv::convertPointsFromHomogeneous(srcMat, dstMat); +} + +CVAPI(void) calib3d_convertPointsFromHomogeneous_InputArray(cv::_InputArray *src, cv::_OutputArray *dst) +{ + cv::convertPointsFromHomogeneous(*src, *dst); +} +CVAPI(void) calib3d_convertPointsFromHomogeneous_array1(cv::Vec3f *src, cv::Vec2f *dst, int length) +{ + cv::Mat srcMat(length, 1, CV_64FC3, src); + cv::Mat dstMat(length, 1, CV_64FC2, dst); + cv::convertPointsFromHomogeneous(srcMat, dstMat); +} +CVAPI(void) calib3d_convertPointsFromHomogeneous_array2(cv::Vec4f *src, cv::Vec3f *dst, int length) +{ + cv::Mat srcMat(length, 1, CV_64FC4, src); + cv::Mat dstMat(length, 1, CV_64FC3, dst); + cv::convertPointsFromHomogeneous(srcMat, dstMat); +} + +CVAPI(void) calib3d_convertPointsHomogeneous(cv::_InputArray *src, cv::_OutputArray *dst) +{ + cv::convertPointsHomogeneous(*src, *dst); +} + +CVAPI(cv::Mat*) calib3d_findFundamentalMat_InputArray( + cv::_InputArray *points1, cv::_InputArray *points2, + int method, double param1, double param2, + cv::_OutputArray *mask) +{ + cv::Mat mat = cv::findFundamentalMat( + *points1, *points2, method, param1, param2, entity(mask)); + return new cv::Mat(mat); +} +CVAPI(cv::Mat*) calib3d_findFundamentalMat_array( + cv::Point2d *points1, int points1Size, + cv::Point2d *points2, int points2Size, + int method, double param1, double param2, + cv::_OutputArray *mask) +{ + cv::Mat points1M(points1Size, 1, CV_64FC2, points1); + cv::Mat points2M(points2Size, 1, CV_64FC2, points2); + cv::Mat mat = cv::findFundamentalMat( + points1M, points2M, method, param1, param2, entity(mask)); + return new cv::Mat(mat); +} + +CVAPI(void) calib3d_computeCorrespondEpilines_InputArray( + cv::_InputArray *points, + int whichImage, cv::_InputArray *F, + cv::_OutputArray *lines) +{ + cv::computeCorrespondEpilines(*points, whichImage, *F, *lines); +} +CVAPI(void) calib3d_computeCorrespondEpilines_array2d( + cv::Point2d *points, int pointsSize, + int whichImage, double *F, + cv::Point3f *lines) +{ + cv::Mat_ pointsM(pointsSize, 1, points); + cv::Mat_ FM(3, 3, F); + cv::Mat_ linesM(pointsSize, 1, lines); + cv::computeCorrespondEpilines(pointsM, whichImage, FM, linesM); +} +CVAPI(void) calib3d_computeCorrespondEpilines_array3d( + cv::Point3d *points, int pointsSize, + int whichImage, double *F, + cv::Point3f *lines) +{ + cv::Mat_ pointsM(pointsSize, 1, points); + cv::Mat_ FM(3, 3, F); + cv::Mat_ linesM(pointsSize, 1, lines); + cv::computeCorrespondEpilines(pointsM, whichImage, FM, linesM); +} + +CVAPI(void) calib3d_triangulatePoints_InputArray( + cv::_InputArray *projMatr1, cv::_InputArray *projMatr2, + cv::_InputArray *projPoints1, cv::_InputArray *projPoints2, + cv::_OutputArray *points4D) +{ + cv::triangulatePoints(*projMatr1, *projMatr2, *projPoints1, *projPoints2, *points4D); +} +CVAPI(void) calib3d_triangulatePoints_array( + double *projMatr1, double *projMatr2, + cv::Point2d *projPoints1, int projPoints1Size, + cv::Point2d *projPoints2, int projPoints2Size, + cv::Vec4d *points4D) +{ + cv::Mat_ projMatr1M(3, 4, projMatr1); + cv::Mat_ projMatr2M(3, 4, projMatr2); + cv::Mat_ projPoints1M(projPoints1Size, 1, projPoints1); + cv::Mat_ projPoints2M(projPoints2Size, 1, projPoints2); + cv::Mat_ points4DM(1, projPoints1Size, points4D); + cv::triangulatePoints(projMatr1M, projMatr2M, + projPoints1M, projPoints2M, points4DM); +} + +CVAPI(void) calib3d_correctMatches_InputArray( + cv::_InputArray *F, cv::_InputArray *points1, cv::_InputArray *points2, + cv::_OutputArray *newPoints1, cv::_OutputArray *newPoints2) +{ + cv::correctMatches(*F, *points1, *points2, *newPoints1, *newPoints2); +} +CVAPI(void) calib3d_correctMatches_array(double *F, + cv::Point2d *points1, int points1Size, + cv::Point2d *points2, int points2Size, + cv::Point2d *newPoints1, cv::Point2d *newPoints2) +{ + cv::Mat_ FM(3, 3, F); + cv::Mat_ points1M(points1Size, 1, points1); + cv::Mat_ points2M(points2Size, 1, points2); + cv::Mat_ points1MM = points1M.reshape(2); + cv::Mat_ points2MM = points2M.reshape(2); + cv::Mat_ newPoints1M(points1Size, 1, newPoints1); + cv::Mat_ newPoints2M(points2Size, 1, newPoints2); + cv::Mat_ newPoints1MM = points1M.reshape(2); + cv::Mat_ newPoints2MM = points2M.reshape(2); + cv::correctMatches(FM, points1MM, points2MM, newPoints1MM, newPoints2MM); +} + + +CVAPI(void) calib3d_filterSpeckles(cv::_InputOutputArray *img, double newVal, int maxSpeckleSize, double maxDiff, + cv::_InputOutputArray *buf) +{ + cv::filterSpeckles(*img, newVal, maxSpeckleSize, maxDiff, entity(buf)); +} + +CVAPI(MyCvRect) calib3d_getValidDisparityROI(MyCvRect roi1, MyCvRect roi2, + int minDisparity, int numberOfDisparities, int SADWindowSize) +{ + return c(cv::getValidDisparityROI( + cpp(roi1), cpp(roi2), minDisparity, numberOfDisparities, SADWindowSize)); +} + +CVAPI(void) calib3d_validateDisparity(cv::_InputOutputArray *disparity, cv::_InputArray *cost, + int minDisparity, int numberOfDisparities, int disp12MaxDisp) +{ + cv::validateDisparity(*disparity, *cost, minDisparity, numberOfDisparities, disp12MaxDisp); +} + +CVAPI(void) calib3d_reprojectImageTo3D(cv::_InputArray *disparity, cv::_OutputArray *_3dImage, + cv::_InputArray *Q, int handleMissingValues, int ddepth) +{ + cv::reprojectImageTo3D(*disparity, *_3dImage, *Q, handleMissingValues != 0, ddepth); +} + +CVAPI(int) calib3d_estimateAffine3D(cv::_InputArray *src, cv::_InputArray *dst, + cv::_OutputArray *out, cv::_OutputArray *inliers, + double ransacThreshold, double confidence) +{ + return cv::estimateAffine3D(*src, *dst, *out, *inliers, ransacThreshold, confidence); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/calib3d_StereoMatcher.h b/src/OpenCvSharpExtern/calib3d_StereoMatcher.h new file mode 100644 index 000000000..5858fc315 --- /dev/null +++ b/src/OpenCvSharpExtern/calib3d_StereoMatcher.h @@ -0,0 +1,226 @@ +#ifndef _CPP_CALIB3D_STEREOMATCHER_H_ +#define _CPP_CALIB3D_STEREOMATCHER_H_ + +#include "include_opencv.h" + + +#pragma region StereoMatcher + +CVAPI(void) calib3d_StereoMatcher_compute( + cv::Ptr *obj, cv::_InputArray *left, cv::_InputArray *right, cv::_OutputArray *disparity) +{ + (*obj)->compute(*left, *right, *disparity); +} + +CVAPI(int) calib3d_StereoMatcher_getMinDisparity(cv::Ptr *obj) +{ + return (*obj)->getMinDisparity(); +} +CVAPI(void) calib3d_StereoMatcher_setMinDisparity(cv::Ptr *obj, int value) +{ + (*obj)->setMinDisparity(value); +} + +CVAPI(int) calib3d_StereoMatcher_getNumDisparities(cv::Ptr *obj) +{ + return (*obj)->getNumDisparities(); +} +CVAPI(void) calib3d_StereoMatcher_setNumDisparities(cv::Ptr *obj, int value) +{ + (*obj)->setNumDisparities(value); +} + +CVAPI(int) calib3d_StereoMatcher_getBlockSize(cv::Ptr *obj) +{ + return (*obj)->getBlockSize(); +} +CVAPI(void) calib3d_StereoMatcher_setBlockSize(cv::Ptr *obj, int value) +{ + (*obj)->setBlockSize(value); +} + +CVAPI(int) calib3d_StereoMatcher_getSpeckleWindowSize(cv::Ptr *obj) +{ + return (*obj)->getSpeckleWindowSize(); +} +CVAPI(void) calib3d_StereoMatcher_setSpeckleWindowSize(cv::Ptr *obj, int value) +{ + (*obj)->setSpeckleWindowSize(value); +} + +CVAPI(int) calib3d_StereoMatcher_getSpeckleRange(cv::Ptr *obj) +{ + return (*obj)->getSpeckleRange(); +} +CVAPI(void) calib3d_StereoMatcher_setSpeckleRange(cv::Ptr *obj, int value) +{ + (*obj)->setSpeckleRange(value); +} + +CVAPI(int) calib3d_StereoMatcher_getDisp12MaxDiff(cv::Ptr *obj) +{ + return (*obj)->getDisp12MaxDiff(); +} +CVAPI(void) calib3d_StereoMatcher_setDisp12MaxDiff(cv::Ptr *obj, int value) +{ + (*obj)->setDisp12MaxDiff(value); +} + +#pragma endregion + +#pragma region StereoBM + +CVAPI(void) calib3d_Ptr_StereoBM_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(cv::Ptr*) calib3d_StereoBM_create(int numDisparities, int blockSize) +{ + cv::Ptr obj = cv::StereoBM::create(numDisparities, blockSize); + return new cv::Ptr(obj); +} + +CVAPI(int) calib3d_StereoBM_getPreFilterType(cv::Ptr *obj) +{ + return (*obj)->getPreFilterType(); +} +CVAPI(void) calib3d_StereoBM_setPreFilterType(cv::Ptr *obj, int value) +{ + (*obj)->setPreFilterType(value); +} + +CVAPI(int) calib3d_StereoBM_getPreFilterSize(cv::Ptr *obj) +{ + return (*obj)->getPreFilterSize(); +} +CVAPI(void) calib3d_StereoBM_setPreFilterSize(cv::Ptr *obj, int value) +{ + (*obj)->setPreFilterSize(value); +} + +CVAPI(int) calib3d_StereoBM_getPreFilterCap(cv::Ptr *obj) +{ + return (*obj)->getPreFilterCap(); +} +CVAPI(void) calib3d_StereoBM_setPreFilterCap(cv::Ptr *obj, int value) +{ + (*obj)->setPreFilterCap(value); +} + +CVAPI(int) calib3d_StereoBM_getTextureThreshold(cv::Ptr *obj) +{ + return (*obj)->getTextureThreshold(); +} +CVAPI(void) calib3d_StereoBM_setTextureThreshold(cv::Ptr *obj, int value) +{ + (*obj)->setTextureThreshold(value); +} + +CVAPI(int) calib3d_StereoBM_getUniquenessRatio(cv::Ptr *obj) +{ + return (*obj)->getUniquenessRatio(); +} +CVAPI(void) calib3d_StereoBM_setUniquenessRatio(cv::Ptr *obj, int value) +{ + (*obj)->setUniquenessRatio(value); +} + +CVAPI(int) calib3d_StereoBM_getSmallerBlockSize(cv::Ptr *obj) +{ + return (*obj)->getSmallerBlockSize(); +} +CVAPI(void) calib3d_StereoBM_setSmallerBlockSize(cv::Ptr *obj, int value) +{ + (*obj)->setSmallerBlockSize(value); +} + +CVAPI(MyCvRect) calib3d_StereoBM_getROI1(cv::Ptr *obj) +{ + return c((*obj)->getROI1()); +} +CVAPI(void) calib3d_StereoBM_setROI1(cv::Ptr *obj, MyCvRect value) +{ + (*obj)->setROI1(cpp(value)); +} + +CVAPI(MyCvRect) calib3d_StereoBM_getROI2(cv::Ptr *obj) +{ + return c((*obj)->getROI2()); +} +CVAPI(void) calib3d_StereoBM_setROI2(cv::Ptr *obj, MyCvRect value) +{ + (*obj)->setROI2(cpp(value)); +} + +#pragma endregion + +#pragma region StereoSGBM + +CVAPI(void) calib3d_Ptr_StereoSGBM_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(cv::Ptr*) calib3d_StereoSGBM_create( + int minDisparity, int numDisparities, int blockSize, + int P1, int P2, int disp12MaxDiff, + int preFilterCap, int uniquenessRatio, + int speckleWindowSize, int speckleRange, int mode) +{ + cv::Ptr obj = cv::StereoSGBM::create( + minDisparity, numDisparities, blockSize, + P1, P2, disp12MaxDiff, + preFilterCap, uniquenessRatio, + speckleWindowSize, speckleRange, mode); + return new cv::Ptr(obj); +} + +CVAPI(int) calib3d_StereoSGBM_getPreFilterCap(cv::Ptr *obj) +{ + return (*obj)->getPreFilterCap(); +} +CVAPI(void) calib3d_StereoSGBM_setPreFilterCap(cv::Ptr *obj, int value) +{ + (*obj)->setPreFilterCap(value); +} + +CVAPI(int) calib3d_StereoSGBM_getUniquenessRatio(cv::Ptr *obj) +{ + return (*obj)->getUniquenessRatio(); +} +CVAPI(void) calib3d_StereoSGBM_setUniquenessRatio(cv::Ptr *obj, int value) +{ + (*obj)->setUniquenessRatio(value); +} + +CVAPI(int) calib3d_StereoSGBM_getP1(cv::Ptr *obj) +{ + return (*obj)->getP1(); +} +CVAPI(void) calib3d_StereoSGBM_setP1(cv::Ptr *obj, int value) +{ + (*obj)->setP1(value); +} + +CVAPI(int) calib3d_StereoSGBM_getP2(cv::Ptr *obj) +{ + return (*obj)->getP2(); +} +CVAPI(void) calib3d_StereoSGBM_setP2(cv::Ptr *obj, int value) +{ + (*obj)->setP2(value); +} + +CVAPI(int) calib3d_StereoSGBM_getMode(cv::Ptr *obj) +{ + return (*obj)->getMode(); +} +CVAPI(void) calib3d_StereoSGBM_setMode(cv::Ptr *obj, int value) +{ + (*obj)->setMode(value); +} + +#pragma endregion + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/contrib.cpp b/src/OpenCvSharpExtern/contrib.cpp new file mode 100644 index 000000000..f0aa495dd --- /dev/null +++ b/src/OpenCvSharpExtern/contrib.cpp @@ -0,0 +1 @@ +#include "contrib.h" \ No newline at end of file diff --git a/src/OpenCvSharpExtern/core.cpp b/src/OpenCvSharpExtern/core.cpp new file mode 100644 index 000000000..029326363 --- /dev/null +++ b/src/OpenCvSharpExtern/core.cpp @@ -0,0 +1,12 @@ +#include "core.h" + +#include "core_Algorithm.h" +#include "core_FileStorage.h" +#include "core_InputArray.h" +#include "core_Mat.h" +#include "core_MatExpr.h" +#include "core_OutputArray.h" +#include "core_PCA.h" +#include "core_RNG.h" +#include "core_SparseMat.h" +#include "core_SVD.h" diff --git a/src/OpenCvSharpExtern/core.h b/src/OpenCvSharpExtern/core.h new file mode 100644 index 000000000..a6f200ef7 --- /dev/null +++ b/src/OpenCvSharpExtern/core.h @@ -0,0 +1,619 @@ +#ifndef _CPP_CORE_H_ +#define _CPP_CORE_H_ + +#include "include_opencv.h" + +#pragma region Miscellaneous + +CVAPI(void) core_setNumThreads(int nthreads) +{ + cv::setNumThreads(nthreads); +} +CVAPI(int) core_getNumThreads() +{ + return cv::getNumThreads(); +} +CVAPI(int) core_getThreadNum() +{ + return cv::getThreadNum(); +} + +CVAPI(void) core_getBuildInformation(char *buf, uint32 maxLength) +{ + const std::string& str = cv::getBuildInformation(); + const char *srcPtr = str.c_str(); + uint32 length = (uint32)std::max(str.length() + 1, maxLength); + memcpy(buf, srcPtr, length); +} + +CVAPI(int64) core_getTickCount() +{ + return cv::getTickCount(); +} +CVAPI(double) core_getTickFrequency() +{ + return cv::getTickFrequency(); +} +CVAPI(int64) core_getCPUTickCount() +{ + return cv::getCPUTickCount(); +} + +CVAPI(int) core_checkHardwareSupport(int feature) +{ + return cv::checkHardwareSupport(feature) ? 1 : 0; +} + +CVAPI(int) core_getNumberOfCPUs() +{ + return cv::getNumberOfCPUs(); +} + +CVAPI(void*) core_fastMalloc(size_t bufSize) +{ + return cv::fastMalloc(bufSize); +} +CVAPI(void) core_fastFree(void *ptr) +{ + return cv::fastFree(ptr); +} + +CVAPI(void) core_setUseOptimized(int onoff) +{ + cv::setUseOptimized(onoff != 0); +} +CVAPI(int) core_useOptimized() +{ + return cv::useOptimized() ? 1 : 0; +} + +CVAPI(cv::ErrorCallback) redirectError(cv::ErrorCallback errCallback, void* userdata, void** prevUserdata) +{ + return cv::redirectError(errCallback, userdata, prevUserdata); +} + +CVAPI(cv::Mat*) core_cvarrToMat(CvArr *arr, int copyData, int allowND, int coiMode) +{ + cv::Mat ret = cv::cvarrToMat(arr, copyData != 0, allowND != 0, coiMode); + return new cv::Mat(ret); +} +CVAPI(void) core_extractImageCOI(CvArr *arr, cv::_OutputArray *coiimg, int coi) +{ + cv::extractImageCOI(arr, *coiimg, coi); +} +CVAPI(void) core_insertImageCOI(cv::_InputArray *coiimg, CvArr *arr, int coi) +{ + cv::insertImageCOI(*coiimg, arr, coi); +} +#pragma endregion + +#pragma region Array Operations + +CVAPI(void) core_add(cv::_InputArray *src1, cv::_InputArray *src2, cv::_OutputArray *dst, cv::_InputArray *mask, int dtype) +{ + cv::add(*src1, *src2, *dst, entity(mask), dtype); +} +CVAPI(void) core_subtract(cv::_InputArray *src1, cv::_InputArray *src2, cv::_OutputArray *dst, cv::_InputArray *mask, int dtype) +{ + cv::subtract(*src1, *src2, *dst, entity(mask), dtype); +} +CVAPI(void) core_multiply(cv::_InputArray *src1, cv::_InputArray *src2, cv::_OutputArray *dst, double scale, int dtype) +{ + cv::multiply(*src1, *src2, *dst, scale, dtype); +} +CVAPI(void) core_divide1(double scale, cv::_InputArray *src2, cv::_OutputArray *dst, int dtype) +{ + cv::divide(scale, *src2, *dst, dtype); +} +CVAPI(void) core_divide2(cv::_InputArray *src1, cv::_InputArray *src2, cv::_OutputArray *dst, double scale, int dtype) +{ + cv::divide(*src1, *src2, *dst); +} + +CVAPI(void) core_scaleAdd(cv::_InputArray *src1, double alpha, cv::_InputArray *src2, cv::_OutputArray *dst) +{ + cv::scaleAdd(*src1, alpha, *src2, *dst); +} +CVAPI(void) core_addWeighted(cv::_InputArray *src1, double alpha, cv::_InputArray *src2, + double beta, double gamma, cv::_OutputArray *dst, int dtype) +{ + cv::addWeighted(*src1, alpha, *src2, beta, gamma, *dst, dtype); +} + +#pragma endregion + + +CVAPI(void) core_convertScaleAbs(cv::_InputArray *src, cv::_OutputArray *dst, double alpha, double beta) +{ + cv::convertScaleAbs(*src, *dst, alpha, beta); +} + +CVAPI(void) core_LUT(cv::_InputArray *src, cv::_InputArray *lut, cv::_OutputArray *dst) +{ + cv::LUT(*src, *lut, *dst); +} +CVAPI(MyCvScalar) core_sum(cv::_InputArray *src) +{ + return c(cv::sum(*src)); +} +CVAPI(int) core_countNonZero(cv::_InputArray *src) +{ + return cv::countNonZero(*src); +} +CVAPI(void) core_findNonZero(cv::_InputArray *src, cv::_OutputArray *idx) +{ + cv::findNonZero(*src, *idx); +} + +CVAPI(MyCvScalar) core_mean(cv::_InputArray *src, cv::_InputArray *mask) +{ + return c(cv::mean(*src, entity(mask))); +} + +CVAPI(void) core_meanStdDev_OutputArray( + cv::_InputArray *src, cv::_OutputArray *mean, cv::_OutputArray *stddev, cv::_InputArray *mask) +{ + cv::meanStdDev(*src, *mean, *stddev, entity(mask)); +} +CVAPI(void) core_meanStdDev_Scalar( + cv::_InputArray *src, MyCvScalar *mean, MyCvScalar *stddev, cv::_InputArray *mask) +{ + cv::Scalar mean0, stddev0; + cv::meanStdDev(*src, mean0, stddev0, entity(mask)); + *mean = c(mean0); + *stddev = c(stddev0); +} + +CVAPI(double) core_norm1(cv::_InputArray *src1, int normType, cv::_InputArray *mask) +{ + return cv::norm(*src1, normType, entity(mask)); +} +CVAPI(double) core_norm2(cv::_InputArray *src1, cv::_InputArray *src2, + int normType, cv::_InputArray *mask) +{ + return cv::norm(*src1, *src2, normType, entity(mask)); +} + +CVAPI(void) core_batchDistance(cv::_InputArray *src1, cv::_InputArray *src2, + cv::_OutputArray *dist, int dtype, cv::_OutputArray *nidx, + int normType, int K, cv::_InputArray *mask, + int update, int crosscheck) +{ + cv::batchDistance(*src1, *src2, *dist, dtype, *nidx, normType, K, entity(mask), update, crosscheck != 0); +} + +CVAPI(void) core_normalize(cv::_InputArray *src, cv::_InputOutputArray *dst, double alpha, double beta, + int normType, int dtype, cv::_InputArray *mask) +{ + cv::InputArray maskVal = entity(mask); + cv::normalize(*src, *dst, alpha, beta, normType, dtype, maskVal); +} + +CVAPI(void) core_minMaxLoc1(cv::_InputArray *src, double *minVal, double *maxVal) +{ + cv::minMaxLoc(*src, minVal, maxVal); +} +CVAPI(void) core_minMaxLoc2(cv::_InputArray *src, double *minVal, double *maxVal, + CvPoint *minLoc, CvPoint *maxLoc, cv::_InputArray *mask) +{ + cv::InputArray maskVal = entity(mask); + cv::Point minLoc0, maxLoc0; + cv::minMaxLoc(*src, minVal, maxVal, &minLoc0, &maxLoc0, maskVal); + *minLoc = minLoc0; + *maxLoc = maxLoc0; +} +CVAPI(void) core_minMaxIdx1(cv::_InputArray *src, double *minVal, double *maxVal) +{ + cv::minMaxIdx(*src, minVal, maxVal); +} +CVAPI(void) core_minMaxIdx2(cv::_InputArray *src, double *minVal, double *maxVal, + int *minIdx, int *maxIdx, cv::_InputArray *mask) +{ + cv::InputArray maskVal = entity(mask); + cv::minMaxIdx(*src, minVal, maxVal, minIdx, maxIdx, maskVal); +} + +CVAPI(void) core_reduce(cv::_InputArray *src, cv::_OutputArray *dst, int dim, int rtype, int dtype) +{ + cv::reduce(*src, *dst, dim, rtype, dtype); +} +CVAPI(void) core_merge(cv::Mat **mv, uint32 count, cv::Mat *dst) +{ + std::vector vec((size_t)count); + for (uint32 i = 0; i < count; i++) + vec[i] = *mv[i]; + + cv::merge(vec, *dst); +} +CVAPI(void) core_split(cv::Mat *src, std::vector **mv) +{ + *mv = new std::vector(); + cv::split(*src, **mv); +} +CVAPI(void) core_mixChannels(cv::Mat **src, uint32 nsrcs, cv::Mat **dst, uint32 ndsts, int *fromTo, uint32 npairs) +{ + std::vector srcVec((size_t)nsrcs); + std::vector dstVec((size_t)ndsts); + for (uint32 i = 0; i < nsrcs; i++) + srcVec[i] = *(src[i]); + for (uint32 i = 0; i < ndsts; i++) + dstVec[i] = *(dst[i]); + + cv::mixChannels(srcVec, dstVec, fromTo, npairs); +} + +CVAPI(void) core_extractChannel(cv::_InputArray *src, cv::_OutputArray *dst, int coi) +{ + cv::extractChannel(*src, *dst, coi); +} +CVAPI(void) core_insertChannel(cv::_InputArray *src, cv::_InputOutputArray *dst, int coi) +{ + cv::insertChannel(*src, *dst, coi); +} +CVAPI(void) core_flip(cv::_InputArray *src, cv::_OutputArray *dst, int flipCode) +{ + cv::flip(*src, *dst, flipCode); +} +CVAPI(void) core_repeat1(cv::_InputArray *src, int ny, int nx, cv::_OutputArray *dst) +{ + cv::repeat(*src, ny, nx, *dst); +} +CVAPI(cv::Mat*) core_repeat2(cv::Mat *src, int ny, int nx) +{ + cv::Mat ret = cv::repeat(*src, ny, nx); + return new cv::Mat(ret); +} +CVAPI(void) core_hconcat1(cv::Mat **src, uint32 nsrc, cv::_OutputArray *dst) +{ + std::vector srcVec((size_t)nsrc); + for (uint32 i = 0; i < nsrc; i++) + srcVec[i] = *(src[i]); + cv::hconcat(&srcVec[0], nsrc, *dst); +} +CVAPI(void) core_hconcat2(cv::_InputArray *src1, cv::_InputArray *src2, cv::_OutputArray *dst) +{ + cv::hconcat(*src1, *src2, *dst); +} +CVAPI(void) core_vconcat1(cv::Mat **src, uint32 nsrc, cv::_OutputArray *dst) +{ + std::vector srcVec((size_t)nsrc); + for (uint32 i = 0; i < nsrc; i++) + srcVec[i] = *(src[i]); + cv::vconcat(&srcVec[0], nsrc, *dst); +} +CVAPI(void) core_vconcat2(cv::_InputArray *src1, cv::_InputArray *src2, cv::_OutputArray *dst) +{ + cv::vconcat(*src1, *src2, *dst); +} + +CVAPI(void) core_bitwise_and(cv::_InputArray *src1, cv::_InputArray *src2, + cv::_OutputArray *dst, cv::_InputArray *mask) +{ + cv::bitwise_and(*src1, *src2, *dst, entity(mask)); +} +CVAPI(void) core_bitwise_or(cv::_InputArray *src1, cv::_InputArray *src2, + cv::_OutputArray *dst, cv::_InputArray *mask) +{ + cv::bitwise_or(*src1, *src2, *dst, entity(mask)); +} +CVAPI(void) core_bitwise_xor(cv::_InputArray *src1, cv::_InputArray *src2, + cv::_OutputArray *dst, cv::_InputArray *mask) +{ + cv::bitwise_xor(*src1, *src2, *dst, entity(mask)); +} +CVAPI(void) core_bitwise_not(cv::_InputArray *src, cv::_OutputArray *dst, + cv::_InputArray *mask) +{ + cv::bitwise_not(*src, *dst, entity(mask)); +} + +CVAPI(void) core_absdiff(cv::_InputArray *src1, cv::_InputArray *src2, cv::_OutputArray *dst) +{ + cv::absdiff(*src1, *src2, *dst); +} + +CVAPI(void) core_inRange_InputArray(cv::_InputArray *src, cv::_InputArray *lowerb, cv::_InputArray *upperb, cv::_OutputArray *dst) +{ + cv::inRange(*src, *lowerb, *upperb, *dst); +} +CVAPI(void) core_inRange_Scalar(cv::_InputArray *src, CvScalar lowerb, CvScalar upperb, cv::_OutputArray *dst) +{ + cv::inRange(*src, cv::Scalar(lowerb), cv::Scalar(upperb), *dst); +} + +CVAPI(void) core_compare(cv::_InputArray *src1, cv::_InputArray *src2, cv::_OutputArray *dst, int cmpop) +{ + cv::compare(*src1, *src2, *dst, cmpop); +} +CVAPI(void) core_min1(cv::_InputArray *src1, cv::_InputArray *src2, cv::_OutputArray *dst) +{ + cv::min(*src1, *src2, *dst); +} +CVAPI(void) core_max1(cv::_InputArray *src1, cv::_InputArray *src2, cv::_OutputArray *dst) +{ + cv::max(*src1, *src2, *dst); +} +CVAPI(void) core_min_MatMat(cv::Mat *src1, cv::Mat *src2, cv::Mat *dst) +{ + cv::min(*src1, *src2, *dst); +} +CVAPI(void) core_min_MatDouble(cv::Mat *src1, double src2, cv::Mat *dst) +{ + cv::min(*src1, src2, *dst); +} +CVAPI(void) core_max_MatMat(cv::Mat *src1, const cv::Mat *src2, cv::Mat *dst) +{ + cv::max(*src1, *src2, *dst); +} +CVAPI(void) core_max_MatDouble(cv::Mat *src1, double src2, cv::Mat *dst) +{ + cv::max(*src1, src2, *dst); +} +CVAPI(void) core_sqrt(cv::_InputArray *src, cv::_OutputArray *dst) +{ + cv::sqrt(*src, *dst); +} +CVAPI(void) core_pow_Mat(cv::_InputArray *src, double power, cv::_OutputArray *dst) +{ + cv::pow(*src, power, *dst); +} +CVAPI(void) core_exp_Mat(cv::_InputArray *src, cv::_OutputArray *dst) +{ + cv::exp(*src, *dst); +} +CVAPI(void) core_log_Mat(cv::_InputArray *src, cv::_OutputArray *dst) +{ + cv::log(*src, *dst); +} +CVAPI(float) core_cubeRoot(float val) +{ + return cv::cubeRoot(val); +} +CVAPI(float) core_fastAtan2(float y, float x) +{ + return cv::fastAtan2(y, x); +} + +CVAPI(void) core_polarToCart(cv::_InputArray *magnitude, cv::_InputArray *angle, + cv::_OutputArray *x, cv::_OutputArray *y, int angleInDegrees) +{ + cv::polarToCart(*magnitude, *angle, *x, *y, angleInDegrees != 0); +} +CVAPI(void) core_cartToPolar(cv::_InputArray *x, cv::_InputArray *y, + cv::_OutputArray *magnitude, cv::_OutputArray *angle, int angleInDegrees) +{ + cv::cartToPolar(*x, *y, *magnitude, *angle, angleInDegrees != 0); +} +CVAPI(void) core_phase(cv::_InputArray *x, cv::_InputArray *y, cv::_OutputArray *angle, int angleInDegrees) +{ + cv::phase(*x, *y, *angle, angleInDegrees != 0); +} +CVAPI(void) core_magnitude_Mat(cv::_InputArray *x, cv::_InputArray *y, cv::_OutputArray *magnitude) +{ + cv::magnitude(*x, *y, *magnitude); +} +CVAPI(int) core_checkRange(cv::_InputArray *a, int quiet, CvPoint *pos, double minVal, double maxVal) +{ + cv::Point pos0; + int ret = cv::checkRange(*a, quiet != 0, &pos0, minVal, maxVal); + *pos = pos0; + return ret; +} +CVAPI(void) core_patchNaNs(cv::_InputOutputArray *a, double val) +{ + cv::patchNaNs(*a, val); +} +CVAPI(void) core_gemm(cv::_InputArray *src1, cv::_InputArray *src2, double alpha, + cv::_InputArray *src3, double gamma, cv::_OutputArray *dst, int flags) +{ + cv::gemm(*src1, *src2, alpha, *src3, gamma, *dst, flags); +} +CVAPI(void) core_mulTransposed(cv::_InputArray *src, cv::_OutputArray *dst, int aTa, + cv::_InputArray *delta, double scale, int dtype) +{ + cv::mulTransposed(*src, *dst, aTa != 0, entity(delta), scale, dtype); +} +CVAPI(void) core_transpose(cv::_InputArray *src, cv::_OutputArray *dst) +{ + cv::transpose(*src, *dst); +} +CVAPI(void) core_transform(cv::_InputArray *src, cv::_OutputArray *dst, cv::_InputArray *m) +{ + cv::transform(*src, *dst, *m); +} + +CVAPI(void) core_perspectiveTransform(cv::_InputArray *src, cv::_OutputArray *dst, cv::_InputArray *m) +{ + cv::perspectiveTransform(*src, *dst, *m); +} +CVAPI(void) core_perspectiveTransform_Mat(cv::Mat *src, cv::Mat *dst, cv::Mat *m) +{ + cv::perspectiveTransform(*src, *dst, *m); +} +CVAPI(void) core_perspectiveTransform_Point2f(cv::Point2f *src, int srcLength, cv::Point2f *dst, int dstLength, cv::_InputArray *m) +{ + std::vector srcVector(src, src + srcLength); + std::vector dstVector(dst, dst + dstLength); + cv::perspectiveTransform(srcVector, dstVector, *m); +} +CVAPI(void) core_perspectiveTransform_Point2d(cv::Point2d *src, int srcLength, cv::Point2d *dst, int dstLength, cv::_InputArray *m) +{ + std::vector srcVector(src, src + srcLength); + std::vector dstVector(dst, dst + dstLength); + cv::perspectiveTransform(srcVector, dstVector, *m); +} +CVAPI(void) core_perspectiveTransform_Point3f(cv::Point3f *src, int srcLength, cv::Point3f *dst, int dstLength, cv::_InputArray *m) +{ + std::vector srcVector(src, src + srcLength); + std::vector dstVector(dst, dst + dstLength); + cv::perspectiveTransform(srcVector, dstVector, *m); +} +CVAPI(void) core_perspectiveTransform_Point3d(cv::Point3d *src, int srcLength, cv::Point3d *dst, int dstLength, cv::_InputArray *m) +{ + std::vector srcVector(src, src + srcLength); + std::vector dstVector(dst, dst + dstLength); + cv::perspectiveTransform(srcVector, dstVector, *m); +} + +CVAPI(void) core_completeSymm(cv::_InputOutputArray *mtx, int lowerToUpper) +{ + cv::completeSymm(*mtx, lowerToUpper != 0); +} +CVAPI(void) core_setIdentity(cv::_InputOutputArray *mtx, MyCvScalar s) +{ + cv::setIdentity(*mtx, cpp(s)); +} +CVAPI(double) core_determinant(cv::_InputArray *mtx) +{ + return cv::determinant(*mtx); +} +CVAPI(MyCvScalar) core_trace(cv::_InputArray *mtx) +{ + return c(cv::trace(*mtx)); +} +CVAPI(double) core_invert(cv::_InputArray *src, cv::_OutputArray *dst, int flags) +{ + return cv::invert(*src, *dst, flags); +} +CVAPI(int) core_solve(cv::_InputArray *src1, cv::_InputArray *src2, cv::_OutputArray *dst, int flags) +{ + return cv::solve(*src1, *src2, *dst, flags); +} +CVAPI(void) core_sort(cv::_InputArray *src, cv::_OutputArray *dst, int flags) +{ + cv::sort(*src, *dst, flags); +} +CVAPI(void) core_sortIdx(cv::_InputArray *src, cv::_OutputArray *dst, int flags) +{ + cv::sortIdx(*src, *dst, flags); +} +CVAPI(int) core_solveCubic(cv::_InputArray *coeffs, cv::_OutputArray *roots) +{ + return cv::solveCubic(*coeffs, *roots); +} +CVAPI(double) core_solvePoly(cv::_InputArray *coeffs, cv::_OutputArray *roots, int maxIters) +{ + return cv::solvePoly(*coeffs, *roots, maxIters); +} + +CVAPI(int) core_eigen(cv::_InputArray *src, cv::_OutputArray *eigenvalues, cv::_OutputArray *eigenvectors) +{ + return cv::eigen(*src, *eigenvalues, *eigenvectors) ? 1 : 0; +} + +CVAPI(void) core_calcCovarMatrix_Mat(cv::Mat **samples, int nsamples, cv::Mat *covar, + cv::Mat *mean, int flags, int ctype) +{ + std::vector samplesVec(nsamples); + for (int i = 0; i < nsamples; i++) + samplesVec[i] = *samples[i]; + + cv::calcCovarMatrix(&samplesVec[0], nsamples, *covar, *mean, flags, ctype); +} +CVAPI(void) core_calcCovarMatrix_InputArray(cv::_InputArray *samples, cv::_OutputArray *covar, + cv::_InputOutputArray *mean, int flags, int ctype) +{ + cv::calcCovarMatrix(*samples, *covar, *mean, flags, ctype); +} + + +CVAPI(void) core_PCACompute(cv::_InputArray *data, cv::_InputOutputArray *mean, + cv::_OutputArray *eigenvectors, int maxComponents) +{ + cv::PCACompute(*data, *mean, *eigenvectors, maxComponents); +} +CVAPI(void) core_PCAComputeVar(cv::_InputArray *data, cv::_InputOutputArray *mean, + cv::_OutputArray *eigenvectors, double retainedVariance) +{ + cv::PCACompute(*data, *mean, *eigenvectors, retainedVariance); +} +CVAPI(void) core_PCAProject(cv::_InputArray *data, cv::_InputArray *mean, + cv::_InputArray *eigenvectors, cv::_OutputArray *result) +{ + cv::PCAProject(*data, *mean, *eigenvectors, *result); +} +CVAPI(void) core_PCABackProject(cv::_InputArray *data, cv::_InputArray *mean, + cv::_InputArray *eigenvectors, cv::_OutputArray *result) +{ + cv::PCABackProject(*data, *mean, *eigenvectors, *result); +} + +CVAPI(void) core_SVDecomp(cv::_InputArray *src, cv::_OutputArray *w, + cv::_OutputArray *u, cv::_OutputArray *vt, int flags) +{ + cv::SVDecomp(*src, *w, *u, *vt, flags); +} + +CVAPI(void) core_SVBackSubst(cv::_InputArray *w, cv::_InputArray *u, cv::_InputArray *vt, + cv::_InputArray *rhs, cv::_OutputArray *dst) +{ + cv::SVBackSubst(*w, *u, *vt, *rhs, *dst); +} + +CVAPI(double) core_Mahalanobis(cv::_InputArray *v1, cv::_InputArray *v2, cv::_InputArray *icovar) +{ + return cv::Mahalanobis(*v1, *v2, *icovar); +} +CVAPI(void) core_dft(cv::_InputArray *src, cv::_OutputArray *dst, int flags, int nonzeroRows) +{ + cv::dft(*src, *dst, flags, nonzeroRows); +} +CVAPI(void) core_idft(cv::_InputArray *src, cv::_OutputArray *dst, int flags, int nonzeroRows) +{ + cv::idft(*src, *dst, flags, nonzeroRows); +} +CVAPI(void) core_dct(cv::_InputArray *src, cv::_OutputArray *dst, int flags) +{ + cv::dct(*src, *dst, flags); +} +CVAPI(void) core_idct(cv::_InputArray *src, cv::_OutputArray *dst, int flags) +{ + cv::idct(*src, *dst, flags); +} +CVAPI(void) core_mulSpectrums(cv::_InputArray *a, cv::_InputArray *b, cv::_OutputArray *c, int flags, int conjB) +{ + cv::mulSpectrums(*a, *b, *c, flags, conjB != 0); +} +CVAPI(int) core_getOptimalDFTSize(int vecsize) +{ + return cv::getOptimalDFTSize(vecsize); +} + +CVAPI(double) core_kmeans(cv::_InputArray *data, int k, cv::_InputOutputArray *bestLabels, + MyCvTermCriteria criteria, int attempts, int flags, cv::_OutputArray *centers) +{ + return cv::kmeans(*data, k, *bestLabels, cpp(criteria), attempts, flags, entity(centers)); +} + +CVAPI(uint64) core_theRNG() +{ + cv::RNG &rng = cv::theRNG(); + return rng.state; +} + +CVAPI(void) core_randu_InputArray(cv::_InputOutputArray *dst, cv::_InputArray *low, cv::_InputArray *high) +{ + cv::randu(*dst, *low, *high); +} +CVAPI(void) core_randu_Scalar(cv::_InputOutputArray *dst, MyCvScalar low, MyCvScalar high) +{ + cv::randu(*dst, cpp(low), cpp(high)); +} + +CVAPI(void) core_randn_InputArray(cv::_InputOutputArray *dst, cv::_InputArray *mean, cv::_InputArray *stddev) +{ + cv::randn(*dst, *mean, *stddev); +} +CVAPI(void) core_randn_Scalar(cv::_InputOutputArray *dst, MyCvScalar mean, MyCvScalar stddev) +{ + cv::randn(*dst, cpp(mean), cpp(stddev)); +} + +CVAPI(void) core_randShuffle(cv::_InputOutputArray *dst, double iterFactor, uint64 *rng) +{ + cv::RNG rng0; + cv::randShuffle(*dst, iterFactor, &rng0); + *rng = rng0.state; +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/core_Algorithm.h b/src/OpenCvSharpExtern/core_Algorithm.h new file mode 100644 index 000000000..bea6e9010 --- /dev/null +++ b/src/OpenCvSharpExtern/core_Algorithm.h @@ -0,0 +1,32 @@ +#ifndef _CPP_CORE_ALGORITHM_H_ +#define _CPP_CORE_ALGORITHM_H_ + +#include "include_opencv.h" + +CVAPI(void) core_Algorithm_write(cv::Algorithm *obj, cv::FileStorage *fs) +{ + obj->write(*fs); +} + +CVAPI(void) core_Algorithm_read(cv::Algorithm *obj, cv::FileNode *fn) +{ + obj->read(*fn); +} + +CVAPI(int) core_Algorithm_empty(cv::Algorithm *obj) +{ + return obj->empty() ? 1 : 0; +} + +CVAPI(void) core_Algorithm_save(cv::Algorithm *obj, const char *filename) +{ + obj->save(filename); +} + +CVAPI(void) core_Algorithm_getDefaultName(cv::Algorithm *obj, char *buf, int bufLength) +{ + cv::String str = obj->getDefaultName(); + memcpy(buf, str.c_str(), std::min(bufLength, (int)str.size())); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/core_FileStorage.h b/src/OpenCvSharpExtern/core_FileStorage.h new file mode 100644 index 000000000..ec124c4ec --- /dev/null +++ b/src/OpenCvSharpExtern/core_FileStorage.h @@ -0,0 +1,210 @@ +#ifndef _CPP_CORE_FILESTORAGE_H_ +#define _CPP_CORE_FILESTORAGE_H_ + +#include "include_opencv.h" + +#pragma region FileStorage + +CVAPI(cv::FileStorage*) core_FileStorage_new1() +{ + return new cv::FileStorage(); +} +CVAPI(cv::FileStorage*) core_FileStorage_new2(const char *source, int flags, const char *encoding) +{ + std::string encodingStr; + if (encoding != NULL) + encodingStr = std::string(encoding); + return new cv::FileStorage(source, flags, encodingStr); +} +CVAPI(cv::FileStorage*) core_FileStorage_newFromLegacy(CvFileStorage *fs) +{ + return new cv::FileStorage(fs); +} + +CVAPI(void) core_FileStorage_delete(cv::FileStorage *obj) +{ + delete obj; +} + +CVAPI(int) core_FileStorage_open(cv::FileStorage *obj, + const char *filename, int flags, const char *encoding) +{ + std::string encodingStr; + if (encoding != NULL) + encodingStr = std::string(encoding); + return obj->open(filename, flags, encodingStr) ? 1 : 0; +} +CVAPI(int) core_FileStorage_isOpened(cv::FileStorage *obj) +{ + return obj->isOpened() ? 1 : 0; +} +CVAPI(void) core_FileStorage_release(cv::FileStorage *obj) +{ + return obj->release(); +} +CVAPI(void) core_FileStorage_releaseAndGetString(cv::FileStorage *obj, + char *buf, int bufLength) +{ + std::string result = obj->releaseAndGetString(); + copyString(result, buf, bufLength); +} + +CVAPI(cv::FileNode*) core_FileStorage_getFirstTopLevelNode(cv::FileStorage *obj) +{ + cv::FileNode node = obj->getFirstTopLevelNode(); + return new cv::FileNode(node); +} +CVAPI(cv::FileNode*) core_FileStorage_root(cv::FileStorage *obj, int streamIdx) +{ + cv::FileNode node = obj->root(streamIdx); + return new cv::FileNode(node); +} +CVAPI(cv::FileNode*) core_FileStorage_indexer(cv::FileStorage *obj, const char *nodeName) +{ + cv::FileNode node = (*obj)[nodeName]; + return new cv::FileNode(node); +} + +CVAPI(CvFileStorage*) core_FileStorage_toLegacy(cv::FileStorage *obj) +{ + return obj->fs.get(); +} +CVAPI(void) core_FileStorage_writeRaw(cv::FileStorage *obj, const char *fmt, const uchar *vec, size_t len) +{ + obj->writeRaw(fmt, vec, len); +} +CVAPI(void) core_FileStorage_writeObj(cv::FileStorage *obj, const char *name, const void *value) +{ + obj->writeObj(name, value); +} + +CVAPI(void) core_FileStorage_getDefaultObjectName(const char *filename, char *buf, int bufLength) +{ + std::string ret = cv::FileStorage::getDefaultObjectName(filename); + copyString(ret, buf, bufLength); +} + +CVAPI(const char*) core_FileStorage_elname(cv::FileStorage *obj) +{ + return obj->elname.c_str(); +} +CVAPI(const char*) core_FileStorage_structs(cv::FileStorage *obj, size_t* resultLength) +{ + std::vector &structs = obj->structs; + *resultLength = structs.size(); + return &(structs[0]); +} +CVAPI(int) core_FileStorage_state(cv::FileStorage *obj) +{ + return obj->state; +} + +#pragma endregion + +#pragma region FileNode +CVAPI(cv::FileNode*) core_FileNode_new1() +{ + return new cv::FileNode(); +} +CVAPI(cv::FileNode*) core_FileNode_new2(CvFileStorage* fs, CvFileNode* node) +{ + return new cv::FileNode(fs, node); +} +CVAPI(cv::FileNode*) core_FileNode_new3(cv::FileNode *node) +{ + return new cv::FileNode(*node); +} + +CVAPI(void) core_FileNode_delete(cv::FileNode *node) +{ + delete node; +} + +CVAPI(cv::FileNode*) core_FileNode_operatorThis_byString(cv::FileNode *obj, const char *nodeName) +{ + cv::FileNode ret = (*obj)[nodeName]; + return new cv::FileNode(ret); +} +CVAPI(cv::FileNode*) core_FileNode_operatorThis_byInt(cv::FileNode *obj, int i) +{ + cv::FileNode ret = (*obj)[i]; + return new cv::FileNode(ret); +} +CVAPI(int) core_FileNode_type(cv::FileNode *obj) +{ + return obj->type(); +} + +CVAPI(int) core_FileNode_empty(cv::FileNode *obj) +{ + return obj->empty() ? 1 : 0; +} +CVAPI(int) core_FileNode_isNone(cv::FileNode *obj) +{ + return obj->isNone() ? 1 : 0; +} +CVAPI(int) core_FileNode_isSeq(cv::FileNode *obj) +{ + return obj->isSeq() ? 1 : 0; +} +CVAPI(int) core_FileNode_isMap(cv::FileNode *obj) +{ + return obj->isMap() ? 1 : 0; +} +CVAPI(int) core_FileNode_isInt(cv::FileNode *obj) +{ + return obj->isInt() ? 1 : 0; +} +CVAPI(int) core_FileNode_isReal(cv::FileNode *obj) +{ + return obj->isReal() ? 1 : 0; +} +CVAPI(int) core_FileNode_isString(cv::FileNode *obj) +{ + return obj->isString() ? 1 : 0; +} +CVAPI(int) core_FileNode_isNamed(cv::FileNode *obj) +{ + return obj->isNamed() ? 1 : 0; +} + +CVAPI(void) core_FileNode_name(cv::FileNode *obj, char *buf, int bufLength) +{ + std::string str = obj->name(); + copyString(str, buf, bufLength); +} +CVAPI(size_t) core_FileNode_size(cv::FileNode *obj) +{ + return obj->size(); +} + +CVAPI(int) core_FileNode_toInt(cv::FileNode *obj) +{ + return (int)(*obj); +} +CVAPI(float) core_FileNode_toFloat(cv::FileNode *obj) +{ + return (float)(*obj); +} +CVAPI(double) core_FileNode_toDouble(cv::FileNode *obj) +{ + return (double)(*obj); +} +CVAPI(void) core_FileNode_toString(cv::FileNode *obj, char *buf, int bufLength) +{ + std::string str = (std::string)(*obj); + copyString(str, buf, bufLength); +} + +CVAPI(void) core_FileNode_readRaw(cv::FileNode *obj, const char *fmt, uchar* vec, size_t len) +{ + obj->readRaw(fmt, vec, len); +} +CVAPI(void*) core_FileNode_readObj(cv::FileNode *obj) +{ + return obj->readObj(); +} + +#pragma endregion + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/core_InputArray.h b/src/OpenCvSharpExtern/core_InputArray.h new file mode 100644 index 000000000..1b3301bbb --- /dev/null +++ b/src/OpenCvSharpExtern/core_InputArray.h @@ -0,0 +1,52 @@ +#ifndef _CPP_CORE_INPUTARRAY_H_ +#define _CPP_CORE_INPUTARRAY_H_ + +#include "include_opencv.h" + +CVAPI(cv::_InputArray*) core_InputArray_new_byMat(cv::Mat *mat) +{ + cv::_InputArray ia(*mat); + return new cv::_InputArray(ia); +} + +CVAPI(cv::_InputArray*) core_InputArray_new_byMatExpr(cv::MatExpr *expr) +{ + cv::_InputArray ia(*expr); + return new cv::_InputArray(ia); +} + +CVAPI(cv::_InputArray*) core_InputArray_new_byScalar(cv::Scalar val) +{ + cv::_InputArray ia(val); + return new cv::_InputArray(ia); +} + +CVAPI(cv::_InputArray*) core_InputArray_new_byDouble(double val) +{ + cv::_InputArray ia(val); + return new cv::_InputArray(ia); +} + +CVAPI(cv::_InputArray*) core_InputArray_new_byGpuMat(cv::cuda::GpuMat *gm) +{ + cv::_InputArray ia(*gm); + return new cv::_InputArray(ia); +} + +CVAPI(cv::_InputArray*) core_InputArray_new_byVectorOfMat(std::vector *vector) +{ + cv::_InputArray ia(*vector); + return new cv::_InputArray(ia); +} + +CVAPI(void) core_InputArray_delete(cv::_InputArray *ia) +{ + delete ia; +} + +CVAPI(int) core_InputArray_kind(cv::_InputArray *ia) +{ + return ia->kind(); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/core_Mat.h b/src/OpenCvSharpExtern/core_Mat.h new file mode 100644 index 000000000..f7b54424c --- /dev/null +++ b/src/OpenCvSharpExtern/core_Mat.h @@ -0,0 +1,1375 @@ +#ifndef _CPP_CORE_MAT_H_ +#define _CPP_CORE_MAT_H_ + +#include "include_opencv.h" + + +#pragma region Init & Release +CVAPI(uint64) core_Mat_sizeof() +{ + return sizeof(cv::Mat); +} + +CVAPI(cv::Mat*) core_Mat_new1() +{ + return new cv::Mat(); +} +CVAPI(cv::Mat*) core_Mat_new2(int rows, int cols, int type) +{ + return new cv::Mat(rows, cols, type); +} +CVAPI(cv::Mat*) core_Mat_new3(int rows, int cols, int type, MyCvScalar scalar) +{ + return new cv::Mat(rows, cols, type, cpp(scalar)); +} +CVAPI(cv::Mat*) core_Mat_new4(cv::Mat *mat, cv::Range rowRange, cv::Range colRange) +{ + return new cv::Mat(*mat, rowRange, colRange); +} +CVAPI(cv::Mat*) core_Mat_new5(cv::Mat *mat, cv::Range rowRange) +{ + return new cv::Mat(*mat, rowRange); +} +CVAPI(cv::Mat*) core_Mat_new6(cv::Mat *mat, cv::Range *ranges) +{ + return new cv::Mat(*mat, ranges); +} +CVAPI(cv::Mat*) core_Mat_new7(cv::Mat *mat, MyCvRect roi) +{ + return new cv::Mat(*mat, cpp(roi)); +} +CVAPI(cv::Mat*) core_Mat_new8(int rows, int cols, int type, void* data, size_t step) +{ + return new cv::Mat(rows, cols, type, data, step); +} +CVAPI(cv::Mat*) core_Mat_new9(int ndims, const int* sizes, int type, void* data, const size_t* steps) +{ + return new cv::Mat(ndims, sizes, type, data, steps); +} + +CVAPI(cv::Mat*) core_Mat_new10(int ndims, int* sizes, int type) +{ + return new cv::Mat(ndims, sizes, type); +} +CVAPI(cv::Mat*) core_Mat_new11(int ndims, int* sizes, int type, MyCvScalar s) +{ + return new cv::Mat(ndims, sizes, type, cpp(s)); +} + +CVAPI(cv::Mat*) core_Mat_new_FromIplImage(IplImage *img, int copyData) +{ + cv::Size size(img->height, img->width); + cv::Mat m(size, CV_MAKETYPE(img->depth, img->nChannels), img->imageData, img->widthStep); + if (copyData) + return new cv::Mat(m.clone()); + else + return new cv::Mat(m); +} + +CVAPI(cv::Mat*) core_Mat_new_FromCvMat(CvMat *mat, int copyData) +{ + cv::Size size(mat->rows, mat->cols); + cv::Mat m(size, mat->type, (mat->data).ptr); + if (copyData) + return new cv::Mat(m.clone()); + else + return new cv::Mat(m); +} + + +CVAPI(void) core_Mat_release(cv::Mat *self) +{ + self->release(); +} +CVAPI(void) core_Mat_delete(cv::Mat *self) +{ + delete self; +} + +#pragma endregion + +#pragma region Functions +CVAPI(cv::Mat*) core_Mat_adjustROI(cv::Mat *self, int dtop, int dbottom, int dleft, int dright) +{ + cv::Mat ret = self->adjustROI(dtop, dbottom, dleft, dright); + return new cv::Mat(ret); +} + +CVAPI(void) core_Mat_assignTo1(cv::Mat *self, cv::Mat *m) +{ + self->assignTo(*m); +} +CVAPI(void) core_Mat_assignTo2(cv::Mat *self, cv::Mat *m, int type) +{ + self->assignTo(*m, type); +} + +CVAPI(int) core_Mat_channels(cv::Mat *self) +{ + return self->channels(); +} + +CVAPI(int) core_Mat_checkVector1(cv::Mat *self, int elemChannels) +{ + return self->checkVector(elemChannels); +} +CVAPI(int) core_Mat_checkVector2(cv::Mat *self, int elemChannels, int depth) +{ + return self->checkVector(elemChannels, depth); +} +CVAPI(int) core_Mat_checkVector3(cv::Mat *self, int elemChannels, int depth, int requireContinuous) +{ + return self->checkVector(elemChannels, depth, requireContinuous != 0); +} + +CVAPI(cv::Mat*) core_Mat_clone(cv::Mat *self) +{ + cv::Mat ret = self->clone(); + return new cv::Mat(ret); +} + +CVAPI(cv::Mat*) core_Mat_col_toMat(cv::Mat *self, int x) +{ + cv::Mat ret = self->col(x); + return new cv::Mat(ret); +} +CVAPI(cv::MatExpr*) core_Mat_col_toMatExpr(cv::Mat *self, int x) +{ + cv::Mat ret = self->col(x); + return new cv::MatExpr(ret); +} + +CVAPI(int) core_Mat_cols(cv::Mat *self) +{ + return self->cols; +} + +CVAPI(cv::Mat*) core_Mat_colRange_toMat(cv::Mat *self, int startCol, int endCol) +{ + cv::Mat ret = self->colRange(startCol, endCol); + return new cv::Mat(ret); +} +CVAPI(cv::MatExpr*) core_Mat_colRange_toMatExpr(cv::Mat *self, int startCol, int endCol) +{ + cv::Mat ret = self->colRange(startCol, endCol); + return new cv::MatExpr(ret); +} + +CVAPI(int) core_Mat_dims(cv::Mat *self) +{ + return self->dims; +} + +CVAPI(void) core_Mat_convertTo(cv::Mat *self, cv::Mat *m, int rtype, double alpha, double beta) +{ + self->convertTo(*m, rtype, alpha, beta); +} + +CVAPI(void) core_Mat_copyTo(cv::Mat *self, cv::Mat *m, cv::Mat *mask) +{ + const cv::Mat &maskMat = (mask == NULL) ? cv::Mat() : *mask; + self->copyTo(*m, maskMat); +} + + +CVAPI(void) core_Mat_create1(cv::Mat *self, int rows, int cols, int type) +{ + self->create(rows, cols, type); +} +CVAPI(void) core_Mat_create2(cv::Mat *self, int ndims, const int *sizes, int type) +{ + self->create(ndims, sizes, type); +} + +CVAPI(cv::Mat*) core_Mat_cross(cv::Mat *self, cv::Mat *m) +{ + cv::Mat ret = self->cross(*m); + return new cv::Mat(ret); +} + +CVAPI(uchar*) core_Mat_data(cv::Mat *self) +{ + return self->data; +} +CVAPI(const uchar*) core_Mat_datastart(cv::Mat *self) +{ + return self->datastart; +} +CVAPI(const uchar*) core_Mat_dataend(cv::Mat *self) +{ + return self->dataend; +} +CVAPI(const uchar*) core_Mat_datalimit(cv::Mat *self) +{ + return self->datalimit; +} + + +CVAPI(int) core_Mat_depth(cv::Mat *self) +{ + return self->depth(); +} + + +CVAPI(cv::Mat*) core_Mat_diag1(cv::Mat *self) +{ + cv::Mat ret = self->diag(); + return new cv::Mat(ret); +} +CVAPI(cv::Mat*) core_Mat_diag2(cv::Mat *self, int d) +{ + cv::Mat ret = self->diag(d); + return new cv::Mat(ret); +} + +CVAPI(double) core_Mat_dot(cv::Mat *self, cv::Mat *m) +{ + return self->dot(*m); +} + +CVAPI(uint64) core_Mat_elemSize(cv::Mat *self) +{ + return self->elemSize(); +} + +CVAPI(uint64) core_Mat_elemSize1(cv::Mat *self) +{ + return self->elemSize1(); +} + +CVAPI(int) core_Mat_empty(cv::Mat *self) +{ + return self->empty() ? 1 : 0; +} + +CVAPI(cv::MatExpr*) core_Mat_eye(int rows, int cols, int type) +{ + cv::MatExpr eye = cv::Mat::eye(rows, cols, type); + cv::MatExpr *ret = new cv::MatExpr(eye); + return ret; +} + +CVAPI(cv::Mat*) core_Mat_inv1(cv::Mat *self) +{ + cv::Mat ret = self->inv(); + return new cv::Mat(ret); +} +CVAPI(cv::Mat*) core_Mat_inv2(cv::Mat *self, int method) +{ + cv::Mat ret = self->inv(method); + return new cv::Mat(ret); +} + +CVAPI(int) core_Mat_isContinuous(cv::Mat *self) +{ + return self->isContinuous() ? 1 : 0; +} + +CVAPI(int) core_Mat_isSubmatrix(cv::Mat *self) +{ + return self->isSubmatrix() ? 1 : 0; +} + +CVAPI(void) core_Mat_locateROI(cv::Mat *self, MyCvSize *wholeSize, MyCvPoint *ofs) +{ + cv::Size wholeSize2; + cv::Point ofs2; + self->locateROI(wholeSize2, ofs2); + *wholeSize = c(cv::Size(wholeSize2.width, wholeSize2.height)); + *ofs = c(cv::Point(ofs2.x, ofs2.y)); +} + + +CVAPI(cv::MatExpr*) core_Mat_mul1(cv::Mat *self, cv::Mat *m) +{ + cv::MatExpr ret = self->mul(*m); + return new cv::MatExpr(ret); +} +CVAPI(cv::MatExpr*) core_Mat_mul2(cv::Mat *self, cv::Mat *m, double scale) +{ + cv::MatExpr ret = self->mul(*m, scale); + return new cv::MatExpr(ret); +} + +CVAPI(cv::MatExpr*) core_Mat_ones1(int rows, int cols, int type) +{ + cv::MatExpr ret = cv::Mat::ones(rows, cols, type); + return new cv::MatExpr(ret); +} +CVAPI(cv::MatExpr*) core_Mat_ones2(int ndims, const int *sz, int type) +{ + //cv::MatExpr ret = cv::Mat::ones(ndims, sz, type); + //return new cv::MatExpr(ret); + return NULL; +} + +CVAPI(cv::Mat*) core_Mat_reshape1(cv::Mat *self, int cn) +{ + cv::Mat ret = self->reshape(cn); + return new cv::Mat(ret); +} +CVAPI(cv::Mat*) core_Mat_reshape2(cv::Mat *self, int cn, int rows) +{ + cv::Mat ret = self->reshape(cn, rows); + return new cv::Mat(ret); +} +CVAPI(cv::Mat*) core_Mat_reshape3(cv::Mat *self, int cn, int newndims, const int* newsz) +{ + cv::Mat ret = self->reshape(cn, newndims, newsz); + return new cv::Mat(ret); +} + +CVAPI(cv::Mat*) core_Mat_row_toMat(cv::Mat *self, int y) +{ + cv::Mat ret = self->row(y); + return new cv::Mat(ret); +} +CVAPI(cv::MatExpr*) core_Mat_row_toMatExpr(cv::Mat *self, int y) +{ + cv::Mat ret = self->row(y); + return new cv::MatExpr(ret); +} + +CVAPI(cv::Mat*) core_Mat_rowRange_toMat(cv::Mat *self, int startRow, int endRow) +{ + cv::Mat ret = self->rowRange(startRow, endRow); + return new cv::Mat(ret); +} +CVAPI(cv::MatExpr*) core_Mat_rowRange_toMatExpr(cv::Mat *self, int startRow, int endRow) +{ + cv::Mat ret = self->rowRange(startRow, endRow); + return new cv::MatExpr(ret); +} + +CVAPI(int) core_Mat_rows(cv::Mat *self) +{ + return self->rows; +} + +CVAPI(cv::Mat*) core_Mat_setTo_Scalar(cv::Mat *self, MyCvScalar value, cv::Mat *mask) +{ + cv::Mat ret = self->setTo(cpp(value), entity(mask)); + return new cv::Mat(ret); +} +CVAPI(cv::Mat*) core_Mat_setTo_InputArray(cv::Mat *self, cv::_InputArray *value, cv::_InputArray *mask) +{ + cv::Mat ret = self->setTo(*value, entity(mask)); + return new cv::Mat(ret); +} + +CVAPI(MyCvSize) core_Mat_size(cv::Mat *self) +{ + return c(self->size()); +} +CVAPI(int) core_Mat_sizeAt(cv::Mat *self, int i) +{ + int size = self->size[i]; + return size; +} + +CVAPI(uint64) core_Mat_step11(cv::Mat *self) +{ + return self->step1(); +} +CVAPI(uint64) core_Mat_step12(cv::Mat *self, int i) +{ + return self->step1(i); +} + +CVAPI(uint64) core_Mat_step(cv::Mat *self) +{ + return self->step; +} +CVAPI(uint64) core_Mat_stepAt(cv::Mat *self, int i) +{ + return self->step[i]; +} + +CVAPI(cv::Mat*) core_Mat_subMat1(cv::Mat *self, int rowStart, int rowEnd, int colStart, int colEnd) +{ + cv::Range rowRange(rowStart, rowEnd); + cv::Range colRange(colStart, colEnd); + cv::Mat ret = (*self)(rowRange, colRange); + return new cv::Mat(ret); +} +CVAPI(cv::Mat*) core_Mat_subMat2(cv::Mat *self, int nRanges, MyCvSlice *ranges) +{ + std::vector rangesVec; + for (int i = 0; i < nRanges; i++) + { + rangesVec.push_back(cpp(ranges[i])); + } + cv::Mat ret = (*self)(&rangesVec[0]); + return new cv::Mat(ret); +} + +CVAPI(cv::Mat*) core_Mat_t(cv::Mat *self) +{ + cv::Mat expr = self->t(); + return new cv::Mat(expr); +} + +CVAPI(uint64) core_Mat_total(cv::Mat *self) +{ + return self->total(); +} + +CVAPI(int) core_Mat_type(cv::Mat *self) +{ + return self->type(); +} + +CVAPI(cv::MatExpr*) core_Mat_zeros1(int rows, int cols, int type) +{ + cv::MatExpr expr = cv::Mat::zeros(rows, cols, type); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_zeros2(int ndims, const int *sz, int type) // Not defined in .lib +{ + //cv::MatExpr expr = cv::Mat::zeros(ndims, sz, type); + //return new cv::MatExpr(expr); + return NULL; +} + +CVAPI(char*) core_Mat_dump(cv::Mat *self, const char *format) +{ + std::stringstream s; + if (format == NULL) + s << *self; + else + s << cv::format(*self, 0); + std::string str = s.str(); + + const char *src = str.c_str(); + char *dst = new char[str.length() + 1]; + std::memcpy(dst, src, str.length() + 1); + return dst; +} +CVAPI(void) core_Mat_dump_delete(char *buf) +{ + delete[] buf; +} + +CVAPI(uchar*) core_Mat_ptr1d(cv::Mat *self, int i0) +{ + return self->ptr(i0); +} +CVAPI(uchar*) core_Mat_ptr2d(cv::Mat *self, int i0, int i1) +{ + return self->ptr(i0, i1); +} +CVAPI(uchar*) core_Mat_ptr3d(cv::Mat *self, int i0, int i1, int i2) +{ + return self->ptr(i0, i1, i2); +} +CVAPI(uchar*) core_Mat_ptrnd(cv::Mat *self, int *idx) +{ + return self->ptr(idx); +} + +CVAPI(void) core_Mat_reserve(cv::Mat *obj, size_t sz) +{ + obj->reserve(sz); +} +CVAPI(void) core_Mat_resize1(cv::Mat *obj, size_t sz) +{ + obj->resize(sz); +} +CVAPI(void) core_Mat_resize2(cv::Mat *obj, size_t sz, MyCvScalar s) +{ + obj->resize(sz, cpp(s)); +} +CVAPI(void) core_Mat_pop_back(cv::Mat *obj, size_t nelems) +{ + obj->pop_back(nelems); +} + +#pragma endregion + +#pragma region Operators + +CVAPI(void) core_Mat_assignment_FromMat(cv::Mat *self, cv::Mat *newMat) +{ + *self = *newMat; +} +CVAPI(void) core_Mat_assignment_FromMatExpr(cv::Mat *self, cv::MatExpr *newMatExpr) +{ + *self = *newMatExpr; +} +CVAPI(void) core_Mat_assignment_FromScalar(cv::Mat *self, MyCvScalar scalar) +{ + *self = cpp(scalar); +} + +CVAPI(void) core_Mat_IplImage(cv::Mat *self, IplImage *outImage) +{ + *outImage = IplImage(); + IplImage inImage = (IplImage)(*self); + memcpy(outImage, &inImage, sizeof(IplImage)); +} +CVAPI(void) core_Mat_IplImage_alignment(cv::Mat *self, IplImage **outImage) +{ + // キャストの結果を参考に使う. + // メモリ管理の問題から、直接は使わない. + IplImage dummy = (IplImage)(*self); + // alignmentをそろえる + IplImage *img = cvCreateImage(cvSize(dummy.width, dummy.height), dummy.depth, dummy.nChannels); + int height = img->height; + size_t sstep = self->step; + size_t dstep = img->widthStep; + for (int i = 0; i < height; ++i) + { + char *dp = img->imageData + (dstep * i); + char *sp = (char*)(self->data) + (sstep * i); + memcpy(dp, sp, sstep); + } + *outImage = img; +} + +CVAPI(void) core_Mat_CvMat(cv::Mat *self, CvMat *outMat) +{ + *outMat = CvMat(); + CvMat inMat = (CvMat)(*self); + memcpy(outMat, &inMat, sizeof(CvMat)); +} + +CVAPI(cv::MatExpr*) core_Mat_operatorUnaryMinus(cv::Mat *mat) +{ + cv::MatExpr expr = -(*mat); + return new cv::MatExpr(expr); +} + +CVAPI(cv::MatExpr*) core_Mat_operatorAdd_MatMat(cv::Mat *a, cv::Mat *b) +{ + cv::MatExpr expr = (*a) + (*b); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorAdd_MatScalar(cv::Mat *a, MyCvScalar s) +{ + cv::MatExpr expr = (*a) + cpp(s); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorAdd_ScalarMat(MyCvScalar s, cv::Mat *a) +{ + cv::MatExpr expr = cpp(s) + (*a); + return new cv::MatExpr(expr); +} + +CVAPI(cv::MatExpr*) core_Mat_operatorMinus_Mat(cv::Mat *a) +{ + cv::MatExpr expr = -(*a); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorSubtract_MatMat(cv::Mat *a, cv::Mat *b) +{ + cv::MatExpr expr = (*a) - (*b); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorSubtract_MatScalar(cv::Mat *a, MyCvScalar s) +{ + cv::MatExpr expr = (*a) - cpp(s); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorSubtract_ScalarMat(MyCvScalar s, cv::Mat *a) +{ + cv::MatExpr expr = cpp(s) - (*a); + return new cv::MatExpr(expr); +} + +CVAPI(cv::MatExpr*) core_Mat_operatorMultiply_MatMat(cv::Mat *a, cv::Mat *b) +{ + cv::MatExpr expr = (*a) * (*b); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorMultiply_MatDouble(cv::Mat *a, double s) +{ + cv::MatExpr expr = (*a) * s; + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorMultiply_DoubleMat(double s, cv::Mat *a) +{ + cv::MatExpr expr = s * (*a); + return new cv::MatExpr(expr); +} + +CVAPI(cv::MatExpr*) core_Mat_operatorDivide_MatMat(cv::Mat *a, cv::Mat *b) +{ + cv::MatExpr expr = (*a) / (*b); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorDivide_MatDouble(cv::Mat *a, double s) +{ + cv::MatExpr expr = (*a) / s; + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorDivide_DoubleMat(double s, cv::Mat *a) +{ + cv::MatExpr expr = s / (*a); + return new cv::MatExpr(expr); +} + +CVAPI(cv::MatExpr*) core_Mat_operatorAnd_MatMat(cv::Mat *a, cv::Mat *b) +{ + cv::MatExpr expr = (*a) & (*b); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorAnd_MatDouble(cv::Mat *a, double s) +{ + cv::MatExpr expr = (*a) & s; + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorAnd_DoubleMat(double s, cv::Mat *a) +{ + cv::MatExpr expr = s & (*a); + return new cv::MatExpr(expr); +} + +CVAPI(cv::MatExpr*) core_Mat_operatorOr_MatMat(cv::Mat *a, cv::Mat *b) +{ + cv::MatExpr expr = (*a) | (*b); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorOr_MatDouble(cv::Mat *a, double s) +{ + cv::MatExpr expr = (*a) | s; + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorOr_DoubleMat(double s, cv::Mat *a) +{ + cv::MatExpr expr = s | (*a); + return new cv::MatExpr(expr); +} + +CVAPI(cv::MatExpr*) core_Mat_operatorXor_MatMat(cv::Mat *a, cv::Mat *b) +{ + cv::MatExpr expr = (*a) ^ (*b); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorXor_MatDouble(cv::Mat *a, double s) +{ + cv::MatExpr expr = (*a) ^ s; + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorXor_DoubleMat(double s, cv::Mat *a) +{ + cv::MatExpr expr = s ^ (*a); + return new cv::MatExpr(expr); +} + +CVAPI(cv::MatExpr*) core_Mat_operatorNot(cv::Mat *a) +{ + cv::MatExpr expr = ~(*a); + return new cv::MatExpr(expr); +} + + +// Comparison Operators + +// < +CVAPI(cv::MatExpr*) core_Mat_operatorLT_MatMat(cv::Mat *a, cv::Mat *b) +{ + cv::MatExpr expr = (*a) < (*b); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorLT_DoubleMat(double a, cv::Mat *b) +{ + cv::MatExpr expr = a < (*b); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorLT_MatDouble(cv::Mat *a, double b) +{ + cv::MatExpr expr = (*a) < b; + return new cv::MatExpr(expr); +} +// <= +CVAPI(cv::MatExpr*) core_Mat_operatorLE_MatMat(cv::Mat *a, cv::Mat *b) +{ + cv::MatExpr expr = (*a) <= (*b); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorLE_DoubleMat(double a, cv::Mat *b) +{ + cv::MatExpr expr = a <= (*b); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorLE_MatDouble(cv::Mat *a, double b) +{ + cv::MatExpr expr = (*a) <= b; + return new cv::MatExpr(expr); +} +// > +CVAPI(cv::MatExpr*) core_Mat_operatorGT_MatMat(cv::Mat *a, cv::Mat *b) +{ + cv::MatExpr expr = (*a) > (*b); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorGT_DoubleMat(double a, cv::Mat *b) +{ + cv::MatExpr expr = a > (*b); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorGT_MatDouble(cv::Mat *a, double b) +{ + cv::MatExpr expr = (*a) > b; + return new cv::MatExpr(expr); +} +// >= +CVAPI(cv::MatExpr*) core_Mat_operatorGE_MatMat(cv::Mat *a, cv::Mat *b) +{ + cv::MatExpr expr = (*a) >= (*b); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorGE_DoubleMat(double a, cv::Mat *b) +{ + cv::MatExpr expr = a >= (*b); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorGE_MatDouble(cv::Mat *a, double b) +{ + cv::MatExpr expr = (*a) >= b; + return new cv::MatExpr(expr); +} +// == +CVAPI(cv::MatExpr*) core_Mat_operatorEQ_MatMat(cv::Mat *a, cv::Mat *b) +{ + cv::MatExpr expr = (*a) == (*b); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorEQ_DoubleMat(double a, cv::Mat *b) +{ + cv::MatExpr expr = a == (*b); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorEQ_MatDouble(cv::Mat *a, double b) +{ + cv::MatExpr expr = (*a) == b; + return new cv::MatExpr(expr); +} +// != +CVAPI(cv::MatExpr*) core_Mat_operatorNE_MatMat(cv::Mat *a, cv::Mat *b) +{ + cv::MatExpr expr = (*a) != (*b); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorNE_DoubleMat(double a, cv::Mat *b) +{ + cv::MatExpr expr = a != (*b); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_Mat_operatorNE_MatDouble(cv::Mat *a, double b) +{ + cv::MatExpr expr = (*a) != b; + return new cv::MatExpr(expr); +} + +#pragma endregion + +CVAPI(cv::MatExpr*) core_abs_Mat(cv::Mat *m) +{ + cv::MatExpr ret = cv::abs(*m); + return new cv::MatExpr(ret); +} + +#pragma region nSet/nGet + +template +static int internal_Mat_set(cv::Mat *m, int row, int col, char *buff, int count) +{ + if (!m) return 0; + if (!buff) return 0; + + count *= sizeof(T); + int rest = ((m->rows - row) * m->cols - col) * (int)m->elemSize(); + if (count>rest) + count = rest; + int res = count; + + if (m->isContinuous()) + { + memcpy(m->ptr(row, col), buff, count); + } + else + { + // row by row + int num = (m->cols - col) * (int)m->elemSize(); // 1st partial row + if (countptr(row++, col); + while (count>0) + { + memcpy(data, buff, num); + count -= num; + buff += num; + num = m->cols * (int)m->elemSize(); + if (countptr(row++, 0); + } + } + return res; +} + +template +static int internal_Mat_get(cv::Mat *m, int row, int col, char *buff, int count) +{ + if (!m) return 0; + if (!buff) return 0; + + int bytesToCopy = count * sizeof(T); + int bytesRestInMat = ((m->rows - row) * m->cols - col) * (int)m->elemSize(); + if (bytesToCopy > bytesRestInMat) + bytesToCopy = bytesRestInMat; + int res = bytesToCopy; + + if (m->isContinuous()) + { + memcpy(buff, m->ptr(row, col), bytesToCopy); + } + else + { + // row by row + int bytesInRow = (m->cols - col) * (int)m->elemSize(); // 1st partial row + while (bytesToCopy > 0) + { + int len = std::min(bytesToCopy, bytesInRow); + memcpy(buff, m->ptr(row, col), len); + bytesToCopy -= len; + buff += len; + row++; + col = 0; + bytesInRow = m->cols * (int)m->elemSize(); + } + } + return res; +} + +// unlike other nPut()-s this one (with double[]) should convert input values to correct type +template +static inline void internal_set_item(cv::Mat *mat, int r, int c, double *src, int &count) +{ + T *dst = (T*)mat->ptr(r, c); + for (int ch = 0; ch < mat->channels() && count > 0; count--, ch++, src++, dst++) + *dst = cv::saturate_cast(*src); +} + + +CVAPI(int) core_Mat_nSetB(cv::Mat *obj, int row, int col, uchar *vals, int valsLength) +{ + return internal_Mat_set(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nSetS(cv::Mat *obj, int row, int col, short *vals, int valsLength) +{ + return internal_Mat_set(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nSetI(cv::Mat *obj, int row, int col, int *vals, int valsLength) +{ + return internal_Mat_set(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nSetF(cv::Mat *obj, int row, int col, float *vals, int valsLength) +{ + return internal_Mat_set(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nSetD(cv::Mat *obj, int row, int col, double *vals, int valsLength) +{ + int rest = ((obj->rows - row) * obj->cols - col) * obj->channels(); + int count = valsLength; + if (count > rest) + count = rest; + int res = count; + double* src = vals; + int r, c; + for (c = col; ccols && count > 0; c++) + { + switch (obj->depth()) + { + case CV_8U: internal_set_item(obj, row, c, src, count); break; + case CV_8S: internal_set_item(obj, row, c, src, count); break; + case CV_16U: internal_set_item(obj, row, c, src, count); break; + case CV_16S: internal_set_item(obj, row, c, src, count); break; + case CV_32S: internal_set_item(obj, row, c, src, count); break; + case CV_32F: internal_set_item(obj, row, c, src, count); break; + case CV_64F: internal_set_item(obj, row, c, src, count); break; + } + } + for (r = row + 1; r < obj->rows && count > 0; r++) + { + for (c = 0; c < obj->cols && count > 0; c++) + { + switch (obj->depth()) + { + case CV_8U: internal_set_item(obj, r, c, src, count); break; + case CV_8S: internal_set_item(obj, r, c, src, count); break; + case CV_16U: internal_set_item(obj, r, c, src, count); break; + case CV_16S: internal_set_item(obj, r, c, src, count); break; + case CV_32S: internal_set_item(obj, r, c, src, count); break; + case CV_32F: internal_set_item(obj, r, c, src, count); break; + case CV_64F: internal_set_item(obj, r, c, src, count); break; + } + } + } + return res; +} +CVAPI(int) core_Mat_nSetVec3b(cv::Mat *obj, int row, int col, cv::Vec3b *vals, int valsLength) +{ + return internal_Mat_set(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nSetVec3d(cv::Mat *obj, int row, int col, cv::Vec3d *vals, int valsLength) +{ + return internal_Mat_set(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nSetVec4f(cv::Mat *obj, int row, int col, cv::Vec4f *vals, int valsLength) +{ + return internal_Mat_set(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nSetVec6f(cv::Mat *obj, int row, int col, cv::Vec6f *vals, int valsLength) +{ + return internal_Mat_set(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nSetVec4i(cv::Mat *obj, int row, int col, cv::Vec4i *vals, int valsLength) +{ + return internal_Mat_set(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nSetPoint(cv::Mat *obj, int row, int col, cv::Point *vals, int valsLength) +{ + return internal_Mat_set(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nSetPoint2f(cv::Mat *obj, int row, int col, cv::Point2f *vals, int valsLength) +{ + return internal_Mat_set(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nSetPoint2d(cv::Mat *obj, int row, int col, cv::Point2d *vals, int valsLength) +{ + return internal_Mat_set(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nSetPoint3i(cv::Mat *obj, int row, int col, cv::Point3i *vals, int valsLength) +{ + return internal_Mat_set(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nSetPoint3f(cv::Mat *obj, int row, int col, cv::Point3f *vals, int valsLength) +{ + return internal_Mat_set(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nSetPoint3d(cv::Mat *obj, int row, int col, cv::Point3d *vals, int valsLength) +{ + return internal_Mat_set(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nSetRect(cv::Mat *obj, int row, int col, cv::Rect *vals, int valsLength) +{ + return internal_Mat_set(obj, row, col, (char*)vals, valsLength); +} + +CVAPI(int) core_Mat_nGetB(cv::Mat *obj, int row, int col, uchar *vals, int valsLength) +{ + return internal_Mat_get(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nGetS(cv::Mat *obj, int row, int col, short *vals, int valsLength) +{ + return internal_Mat_get(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nGetI(cv::Mat *obj, int row, int col, int *vals, int valsLength) +{ + return internal_Mat_get(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nGetF(cv::Mat *obj, int row, int col, float *vals, int valsLength) +{ + return internal_Mat_get(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nGetD(cv::Mat *obj, int row, int col, double *vals, int valsLength) +{ + return internal_Mat_get(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nGetVec3b(cv::Mat *obj, int row, int col, cv::Vec3b *vals, int valsLength) +{ + return internal_Mat_get(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nGetVec3d(cv::Mat *obj, int row, int col, cv::Vec3d *vals, int valsLength) +{ + return internal_Mat_get(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nGetVec4f(cv::Mat *obj, int row, int col, cv::Vec4f *vals, int valsLength) +{ + return internal_Mat_get(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nGetVec6f(cv::Mat *obj, int row, int col, cv::Vec6f *vals, int valsLength) +{ + return internal_Mat_get(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nGetVec4i(cv::Mat *obj, int row, int col, cv::Vec4i *vals, int valsLength) +{ + return internal_Mat_get(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nGetPoint(cv::Mat *obj, int row, int col, cv::Point *vals, int valsLength) +{ + return internal_Mat_get(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nGetPoint2f(cv::Mat *obj, int row, int col, cv::Point2f *vals, int valsLength) +{ + return internal_Mat_get(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nGetPoint2d(cv::Mat *obj, int row, int col, cv::Point2d *vals, int valsLength) +{ + return internal_Mat_get(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nGetPoint3i(cv::Mat *obj, int row, int col, cv::Point3i *vals, int valsLength) +{ + return internal_Mat_get(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nGetPoint3f(cv::Mat *obj, int row, int col, cv::Point3f *vals, int valsLength) +{ + return internal_Mat_get(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nGetPoint3d(cv::Mat *obj, int row, int col, cv::Point3d *vals, int valsLength) +{ + return internal_Mat_get(obj, row, col, (char*)vals, valsLength); +} +CVAPI(int) core_Mat_nGetRect(cv::Mat *obj, int row, int col, cv::Rect *vals, int valsLength) +{ + return internal_Mat_get(obj, row, col, (char*)vals, valsLength); +} + +#pragma endregion + +#pragma region push_back + +CVAPI(void) core_Mat_push_back_Mat(cv::Mat *self, cv::Mat *m) +{ + self->push_back(*m); +} +CVAPI(void) core_Mat_push_back_char(cv::Mat *self, char v) +{ + self->push_back(v); +} +CVAPI(void) core_Mat_push_back_uchar(cv::Mat *self, uchar v) +{ + self->push_back(v); +} +CVAPI(void) core_Mat_push_back_short(cv::Mat *self, short v) +{ + self->push_back(v); +} +CVAPI(void) core_Mat_push_back_ushort(cv::Mat *self, ushort v) +{ + self->push_back(v); +} +CVAPI(void) core_Mat_push_back_int(cv::Mat *self, int v) +{ + self->push_back(v); +} +CVAPI(void) core_Mat_push_back_float(cv::Mat *self, float v) +{ + self->push_back(v); +} +CVAPI(void) core_Mat_push_back_double(cv::Mat *self, double v) +{ + self->push_back(v); +} + +CVAPI(void) core_Mat_push_back_Vec2b(cv::Mat *self, CvVec2b v) +{ + self->push_back(cv::Vec2b(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec3b(cv::Mat *self, CvVec3b v) +{ + self->push_back(cv::Vec3b(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec4b(cv::Mat *self, CvVec4b v) +{ + self->push_back(cv::Vec4b(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec6b(cv::Mat *self, CvVec6b v) +{ + self->push_back(cv::Vec6b(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec2s(cv::Mat *self, CvVec2s v) +{ + self->push_back(cv::Vec2s(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec3s(cv::Mat *self, CvVec3s v) +{ + self->push_back(cv::Vec3s(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec4s(cv::Mat *self, CvVec4s v) +{ + self->push_back(cv::Vec4s(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec6s(cv::Mat *self, CvVec6s v) +{ + self->push_back(cv::Vec6s(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec2w(cv::Mat *self, CvVec2w v) +{ + self->push_back(cv::Vec2w(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec3w(cv::Mat *self, CvVec3w v) +{ + self->push_back(cv::Vec3w(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec4w(cv::Mat *self, CvVec4w v) +{ + self->push_back(cv::Vec4w(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec6w(cv::Mat *self, CvVec6w v) +{ + self->push_back(cv::Vec6w(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec2i(cv::Mat *self, CvVec2i v) +{ + self->push_back(cv::Vec2i(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec3i(cv::Mat *self, CvVec3i v) +{ + self->push_back(cv::Vec3i(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec4i(cv::Mat *self, CvVec4i v) +{ + self->push_back(cv::Vec4i(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec6i(cv::Mat *self, CvVec6i v) +{ + self->push_back(cv::Vec6i(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec2f(cv::Mat *self, CvVec2f v) +{ + self->push_back(cv::Vec2f(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec3f(cv::Mat *self, CvVec3f v) +{ + self->push_back(cv::Vec3f(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec4f(cv::Mat *self, CvVec4f v) +{ + self->push_back(cv::Vec4f(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec6f(cv::Mat *self, CvVec6f v) +{ + self->push_back(cv::Vec6f(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec2d(cv::Mat *self, CvVec2d v) +{ + self->push_back(cv::Vec2d(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec3d(cv::Mat *self, CvVec3d v) +{ + self->push_back(cv::Vec3d(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec4d(cv::Mat *self, CvVec4d v) +{ + self->push_back(cv::Vec4d(v.val)); +} +CVAPI(void) core_Mat_push_back_Vec6d(cv::Mat *self, CvVec6d v) +{ + self->push_back(cv::Vec6d(v.val)); +} + +CVAPI(void) core_Mat_push_back_Point(cv::Mat *self, CvPoint v) +{ + self->push_back((cv::Point)v); +} +CVAPI(void) core_Mat_push_back_Point2f(cv::Mat *self, CvPoint2D32f v) +{ + self->push_back((cv::Point2f)v); +} +CVAPI(void) core_Mat_push_back_Point2d(cv::Mat *self, CvPoint2D64f v) +{ + self->push_back(cv::Point2d(v.x, v.y)); +} +CVAPI(void) core_Mat_push_back_Point3i(cv::Mat *self, CvPoint3D v) +{ + self->push_back(cv::Point3i(v.x, v.y, v.z)); +} +CVAPI(void) core_Mat_push_back_Point3f(cv::Mat *self, CvPoint3D32f v) +{ + self->push_back((cv::Point3f)v); +} +CVAPI(void) core_Mat_push_back_Point3d(cv::Mat *self, CvPoint3D64f v) +{ + self->push_back(cv::Point3d(v.x, v.y, v.z)); +} +CVAPI(void) core_Mat_push_back_Size(cv::Mat *self, CvSize v) +{ + self->push_back((cv::Size)v); +} +CVAPI(void) core_Mat_push_back_Size2f(cv::Mat *self, CvSize2D32f v) +{ + self->push_back((cv::Size2f)v); +} +CVAPI(void) core_Mat_push_back_Rect(cv::Mat *self, CvRect v) +{ + self->push_back((cv::Rect)v); +} + +#pragma endregion + +#pragma region forEach +typedef void *(Mat_foreach_uchar)(uchar *value, const int *position); +typedef void *(Mat_foreach_Vec2b)(cv::Vec2b *value, const int *position); +typedef void *(Mat_foreach_Vec3b)(cv::Vec3b *value, const int *position); +typedef void *(Mat_foreach_Vec4b)(cv::Vec4b *value, const int *position); +typedef void *(Mat_foreach_Vec6b)(cv::Vec6b *value, const int *position); +typedef void *(Mat_foreach_short)(short *value, const int *position); +typedef void *(Mat_foreach_Vec2s)(cv::Vec2s *value, const int *position); +typedef void *(Mat_foreach_Vec3s)(cv::Vec3s *value, const int *position); +typedef void *(Mat_foreach_Vec4s)(cv::Vec4s *value, const int *position); +typedef void *(Mat_foreach_Vec6s)(cv::Vec6s *value, const int *position); +typedef void *(Mat_foreach_int)(int *value, const int *position); +typedef void *(Mat_foreach_Vec2i)(cv::Vec2i *value, const int *position); +typedef void *(Mat_foreach_Vec3i)(cv::Vec3i *value, const int *position); +typedef void *(Mat_foreach_Vec4i)(cv::Vec4i *value, const int *position); +typedef void *(Mat_foreach_Vec6i)(cv::Vec6i *value, const int *position); +typedef void *(Mat_foreach_float)(float *value, const int *position); +typedef void *(Mat_foreach_Vec2f)(cv::Vec2f *value, const int *position); +typedef void *(Mat_foreach_Vec3f)(cv::Vec3f *value, const int *position); +typedef void *(Mat_foreach_Vec4f)(cv::Vec4f *value, const int *position); +typedef void *(Mat_foreach_Vec6f)(cv::Vec6f *value, const int *position); +typedef void *(Mat_foreach_double)(double *value, const int *position); +typedef void *(Mat_foreach_Vec2d)(cv::Vec2d *value, const int *position); +typedef void *(Mat_foreach_Vec3d)(cv::Vec3d *value, const int *position); +typedef void *(Mat_foreach_Vec4d)(cv::Vec4d *value, const int *position); +typedef void *(Mat_foreach_Vec6d)(cv::Vec6d *value, const int *position); + +template +struct Functor +{ + TFunction *proc; + Functor(TFunction *_proc) + { + proc = _proc; + } + void operator()(TElem &value, const int *position) const + { + proc(&value, position); + } +}; + +CVAPI(void) core_Mat_forEach_uchar(cv::Mat *m, Mat_foreach_uchar proc) +{ + Functor functor(proc); + m->forEach(functor); +} +CVAPI(void) core_Mat_forEach_Vec2b(cv::Mat *m, Mat_foreach_Vec2b proc) +{ + Functor functor(proc); + m->forEach(functor); +} +CVAPI(void) core_Mat_forEach_Vec3b(cv::Mat *m, Mat_foreach_Vec3b proc) +{ + Functor functor(proc); + m->forEach(functor); +} +CVAPI(void) core_Mat_forEach_Vec4b(cv::Mat *m, Mat_foreach_Vec4b proc) +{ + Functor functor(proc); + m->forEach(functor); +} +CVAPI(void) core_Mat_forEach_Vec6b(cv::Mat *m, Mat_foreach_Vec6b proc) +{ + Functor functor(proc); + m->forEach(functor); +} + +CVAPI(void) core_Mat_forEach_short(cv::Mat *m, Mat_foreach_short proc) +{ + Functor functor(proc); + m->forEach(functor); +} +CVAPI(void) core_Mat_forEach_Vec2s(cv::Mat *m, Mat_foreach_Vec2s proc) +{ + Functor functor(proc); + m->forEach(functor); +} +CVAPI(void) core_Mat_forEach_Vec3s(cv::Mat *m, Mat_foreach_Vec3s proc) +{ + Functor functor(proc); + m->forEach(functor); +} +CVAPI(void) core_Mat_forEach_Vec4s(cv::Mat *m, Mat_foreach_Vec4s proc) +{ + Functor functor(proc); + m->forEach(functor); +} +CVAPI(void) core_Mat_forEach_Vec6s(cv::Mat *m, Mat_foreach_Vec6s proc) +{ + Functor functor(proc); + m->forEach(functor); +} + +CVAPI(void) core_Mat_forEach_int(cv::Mat *m, Mat_foreach_int proc) +{ + Functor functor(proc); + m->forEach(functor); +} +CVAPI(void) core_Mat_forEach_Vec2i(cv::Mat *m, Mat_foreach_Vec2i proc) +{ + Functor functor(proc); + m->forEach(functor); +} +CVAPI(void) core_Mat_forEach_Vec3i(cv::Mat *m, Mat_foreach_Vec3i proc) +{ + Functor functor(proc); + m->forEach(functor); +} +CVAPI(void) core_Mat_forEach_Vec4i(cv::Mat *m, Mat_foreach_Vec4i proc) +{ + Functor functor(proc); + m->forEach(functor); +} +CVAPI(void) core_Mat_forEach_Vec6i(cv::Mat *m, Mat_foreach_Vec6i proc) +{ + Functor functor(proc); + m->forEach(functor); +} + +CVAPI(void) core_Mat_forEach_float(cv::Mat *m, Mat_foreach_float proc) +{ + Functor functor(proc); + m->forEach(functor); +} +CVAPI(void) core_Mat_forEach_Vec2f(cv::Mat *m, Mat_foreach_Vec2f proc) +{ + Functor functor(proc); + m->forEach(functor); +} +CVAPI(void) core_Mat_forEach_Vec3f(cv::Mat *m, Mat_foreach_Vec3f proc) +{ + Functor functor(proc); + m->forEach(functor); +} +CVAPI(void) core_Mat_forEach_Vec4f(cv::Mat *m, Mat_foreach_Vec4f proc) +{ + Functor functor(proc); + m->forEach(functor); +} +CVAPI(void) core_Mat_forEach_Vec6f(cv::Mat *m, Mat_foreach_Vec6f proc) +{ + Functor functor(proc); + m->forEach(functor); +} + + +CVAPI(void) core_Mat_forEach_double(cv::Mat *m, Mat_foreach_double proc) +{ + Functor functor(proc); + m->forEach(functor); +} +CVAPI(void) core_Mat_forEach_Vec2d(cv::Mat *m, Mat_foreach_Vec2d proc) +{ + Functor functor(proc); + m->forEach(functor); +} +CVAPI(void) core_Mat_forEach_Vec3d(cv::Mat *m, Mat_foreach_Vec3d proc) +{ + Functor functor(proc); + m->forEach(functor); +} +CVAPI(void) core_Mat_forEach_Vec4d(cv::Mat *m, Mat_foreach_Vec4d proc) +{ + Functor functor(proc); + m->forEach(functor); +} +CVAPI(void) core_Mat_forEach_Vec6d(cv::Mat *m, Mat_foreach_Vec6d proc) +{ + Functor functor(proc); + m->forEach(functor); +} +#pragma endregion + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/core_MatExpr.h b/src/OpenCvSharpExtern/core_MatExpr.h new file mode 100644 index 000000000..f7b62d36b --- /dev/null +++ b/src/OpenCvSharpExtern/core_MatExpr.h @@ -0,0 +1,220 @@ +#ifndef _CPP_CORE_MATEXPR_H_ +#define _CPP_CORE_MATEXPR_H_ + +#include "include_opencv.h" + +CVAPI(cv::MatExpr*) core_MatExpr_new1() +{ + return new cv::MatExpr(); +} +CVAPI(cv::MatExpr*) core_MatExpr_new2(cv::Mat *mat) +{ + return new cv::MatExpr(*mat); +} +CVAPI(void) core_MatExpr_delete(cv::MatExpr *self) +{ + delete self; +} + +CVAPI(cv::Mat*) core_MatExpr_toMat(cv::MatExpr *self) +{ + cv::Mat ret = (*self); + return new cv::Mat(ret); +} + +#pragma region Functions +CVAPI(cv::MatExpr*) core_MatExpr_row(cv::MatExpr *self, int y) +{ + cv::MatExpr ret = self->row(y); + return new cv::MatExpr(ret); +} +CVAPI(cv::MatExpr*) core_MatExpr_col(cv::MatExpr *self, int x) +{ + cv::MatExpr ret = self->col(x); + return new cv::MatExpr(ret); +} +CVAPI(cv::MatExpr*) core_MatExpr_diag1(cv::MatExpr *self) +{ + cv::MatExpr ret = self->diag(); + return new cv::MatExpr(ret); +} +CVAPI(cv::MatExpr*) core_MatExpr_diag2(cv::MatExpr *self, int d) +{ + cv::MatExpr ret = self->diag(d); + return new cv::MatExpr(ret); +} +CVAPI(cv::MatExpr*) core_MatExpr_submat(cv::MatExpr *self, int rowStart, int rowEnd, int colStart, int colEnd) +{ + cv::Range rowRange(rowStart, rowEnd); + cv::Range colRange(colStart, colEnd); + cv::MatExpr ret = (*self)(rowRange, colRange); + return new cv::MatExpr(ret); +} +CVAPI(cv::Mat*) core_MatExpr_cross(cv::MatExpr *self, cv::Mat *m) +{ + cv::Mat ret = self->cross(*m); + return new cv::Mat(ret); +} +CVAPI(double) core_MatExpr_dot(cv::MatExpr *self, cv::Mat *m) +{ + return self->dot(*m); +} +CVAPI(cv::MatExpr*) core_MatExpr_t(cv::MatExpr *self) +{ + cv::MatExpr ret = self->t(); + return new cv::MatExpr(ret); +} +CVAPI(cv::MatExpr*) core_MatExpr_inv1(cv::MatExpr *self) +{ + cv::MatExpr ret = self->inv(); + return new cv::MatExpr(ret); +} +CVAPI(cv::MatExpr*) core_MatExpr_inv2(cv::MatExpr *self, int method) +{ + cv::MatExpr ret = self->inv(method); + return new cv::MatExpr(ret); +} +CVAPI(cv::MatExpr*) core_MatExpr_mul_toMatExpr(cv::MatExpr *self, cv::MatExpr *e, double scale) +{ + cv::MatExpr ret = self->mul(*e, scale); + return new cv::MatExpr(ret); +} +CVAPI(cv::MatExpr*) core_MatExpr_mul_toMat(cv::MatExpr *self, cv::Mat *m, double scale) +{ + cv::MatExpr ret = self->mul(*m, scale); + return new cv::MatExpr(ret); +} +CVAPI(MyCvSize) core_MatExpr_size(cv::MatExpr *self) +{ + return c(self->size()); +} +CVAPI(int) core_MatExpr_type(cv::MatExpr *self) +{ + return self->type(); +} +#pragma endregion + +#pragma region Operators +CVAPI(cv::MatExpr*) core_operatorUnaryMinus_MatExpr(cv::MatExpr *e) +{ + cv::MatExpr expr = -(*e); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_operatorUnaryNot_MatExpr(cv::MatExpr *e) +{ + cv::MatExpr expr = ~(*e); + return new cv::MatExpr(expr); +} + +CVAPI(cv::MatExpr*) core_operatorAdd_MatExprMat(cv::MatExpr *e, cv:: Mat *m) +{ + cv::MatExpr expr = (*e) + (*m); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_operatorAdd_MatMatExpr(cv::Mat *m, cv::MatExpr *e) +{ + cv::MatExpr expr = (*m) + (*e); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_operatorAdd_MatExprScalar(cv::MatExpr *e, CvScalar s) +{ + cv::MatExpr expr = s + (*e); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_operatorAdd_ScalarMatExpr(CvScalar s, cv::MatExpr *e) +{ + cv::MatExpr expr = (*e) + s; + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_operatorAdd_MatExprMatExpr(cv::MatExpr *e1, cv::MatExpr *e2) +{ + cv::MatExpr expr = (*e1) + (*e2); + return new cv::MatExpr(expr); +} + +CVAPI(cv::MatExpr*) core_operatorSubtract_MatExprMat(cv::MatExpr *e, cv::Mat *m) +{ + cv::MatExpr expr = (*e) - (*m); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_operatorSubtract_MatMatExpr(cv::Mat *m, cv::MatExpr *e) +{ + cv::MatExpr expr = (*m) - (*e); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_operatorSubtract_MatExprScalar(cv::MatExpr *e, CvScalar s) +{ + cv::MatExpr expr = s - (*e); + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_operatorSubtract_ScalarMatExpr(CvScalar s, cv::MatExpr *e) +{ + cv::MatExpr expr = (*e) - s; + return new cv::MatExpr(expr); +} +CVAPI(cv::MatExpr*) core_operatorSubtract_MatExprMatExpr(cv::MatExpr *e1, cv::MatExpr *e2) +{ + cv::MatExpr expr = (*e1) - (*e2); + return new cv::MatExpr(expr); +} + +CVAPI(cv::MatExpr*) core_operatorMultiply_MatExprMat(cv::MatExpr *e, cv::Mat *m) +{ + cv::MatExpr ret = (*e) * (*m); + return new cv::MatExpr(ret); +} +CVAPI(cv::MatExpr*) core_operatorMultiply_MatMatExpr(cv::Mat *m, cv::MatExpr *e) +{ + cv::MatExpr ret = (*m) * (*e); + return new cv::MatExpr(ret); +} +CVAPI(cv::MatExpr*) core_operatorMultiply_MatExprDouble(cv::MatExpr *e, double s) +{ + cv::MatExpr ret = (*e) * s; + return new cv::MatExpr(ret); +} +CVAPI(cv::MatExpr*) core_operatorMultiply_DoubleMatExpr(double s, cv::MatExpr *e) +{ + cv::MatExpr ret = s * (*e); + return new cv::MatExpr(ret); +} +CVAPI(cv::MatExpr*) core_operatorMultiply_MatExprMatExpr(cv::MatExpr *e1, cv::MatExpr *e2) +{ + cv::MatExpr ret = (*e1) * (*e2); + return new cv::MatExpr(ret); +} + +CVAPI(cv::MatExpr*) core_operatorDivide_MatExprMat(cv::MatExpr *e, cv::Mat *m) +{ + cv::MatExpr ret = (*e) / (*m); + return new cv::MatExpr(ret); +} +CVAPI(cv::MatExpr*) core_operatorDivide_MatMatExpr(cv::Mat *m, cv::MatExpr *e) +{ + cv::MatExpr ret = (*m) / (*e); + return new cv::MatExpr(ret); +} +CVAPI(cv::MatExpr*) core_operatorDivide_MatExprDouble(cv::MatExpr *e, double s) +{ + cv::MatExpr ret = (*e) / s; + return new cv::MatExpr(ret); +} +CVAPI(cv::MatExpr*) core_operatorDivide_DoubleMatExpr(double s, cv::MatExpr *e) +{ + cv::MatExpr ret = s / (*e); + return new cv::MatExpr(ret); +} +CVAPI(cv::MatExpr*) core_operatorDivide_MatExprMatExpr(cv::MatExpr *e1, cv::MatExpr *e2) +{ + cv::MatExpr ret = (*e1) / (*e2); + return new cv::MatExpr(ret); +} +#pragma endregion + +CVAPI(cv::MatExpr*) core_abs_MatExpr(cv::MatExpr *e) +{ + cv::MatExpr ret = cv::abs(*e); + return new cv::MatExpr(ret); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/core_OutputArray.h b/src/OpenCvSharpExtern/core_OutputArray.h new file mode 100644 index 000000000..2243b3813 --- /dev/null +++ b/src/OpenCvSharpExtern/core_OutputArray.h @@ -0,0 +1,61 @@ +#ifndef _CPP_CORE_OUTPUTARRAY_H_ +#define _CPP_CORE_OUTPUTARRAY_H_ + +#include "include_opencv.h" + +CVAPI(cv::_OutputArray*) core_OutputArray_new_byMat(cv::Mat *mat) +{ + cv::_OutputArray ia(*mat); + return new cv::_OutputArray(ia); +} + +CVAPI(cv::_OutputArray*) core_OutputArray_new_byGpuMat(cv::cuda::GpuMat *gm) +{ + cv::_OutputArray ia(*gm); + return new cv::_OutputArray(ia); +} + +CVAPI(cv::_OutputArray*) core_OutputArray_new_byScalar(MyCvScalar scalar) +{ + cv::Scalar scalarVal(cpp(scalar)); + cv::_OutputArray ia(scalarVal); + return new cv::_OutputArray(ia); +} + +CVAPI(cv::_OutputArray*) core_OutputArray_new_byVectorOfMat(std::vector *vector) +{ + cv::_OutputArray ia(*vector); + return new cv::_OutputArray(ia); +} + +CVAPI(void) core_OutputArray_delete(cv::_OutputArray *oa) +{ + delete oa; +} + +CVAPI(cv::Mat*) core_OutputArray_getMat(cv::_OutputArray *oa) +{ + cv::Mat &mat = oa->getMatRef(); + return new cv::Mat(mat); +} + +CVAPI(MyCvScalar) core_OutputArray_getScalar(cv::_OutputArray *oa) +{ + cv::Mat &mat = oa->getMatRef(); + cv::Scalar scalar = mat.at(0); + return c(scalar); +} + +CVAPI(void) core_OutputArray_getVectorOfMat(cv::_OutputArray *oa, std::vector *vector) +{ + std::vector temp; + oa->getMatVector(temp); + + vector->resize(temp.size()); + for (size_t i = 0; i < temp.size(); i++) + { + (*vector)[i] = new cv::Mat(temp[i]); + } +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/core_PCA.h b/src/OpenCvSharpExtern/core_PCA.h new file mode 100644 index 000000000..417b22117 --- /dev/null +++ b/src/OpenCvSharpExtern/core_PCA.h @@ -0,0 +1,71 @@ +#ifndef _CPP_CORE_PCA_H_ +#define _CPP_CORE_PCA_H_ + +#include "include_opencv.h" + +CVAPI(cv::PCA*) core_PCA_new1() +{ + return new cv::PCA; +} +CVAPI(cv::PCA*) core_PCA_new2(cv::_InputArray *data, cv::_InputArray *mean, int flags, int maxComponents) +{ + return new cv::PCA(*data, *mean, flags, maxComponents); +} +CVAPI(cv::PCA*) core_PCA_new3(cv::_InputArray *data, cv::_InputArray *mean, int flags, double retainedVariance) +{ + return new cv::PCA(*data, *mean, flags, retainedVariance); +} +CVAPI(void) core_PCA_delete(cv::PCA *obj) +{ + delete obj; +} + +//! operator that performs PCA. The previously stored data, if any, is released +CVAPI(void) core_PCA_operatorThis(cv::PCA *obj, cv::_InputArray *data, cv::_InputArray *mean, int flags, int maxComponents) +{ + (*obj)(*data, *mean, flags, maxComponents); +} +CVAPI(void) core_PCA_computeVar(cv::PCA *obj, cv::_InputArray *data, cv::_InputArray *mean, int flags, double retainedVariance) +{ + (*obj)(*data, *mean, flags, retainedVariance); +} +//! projects vector from the original space to the principal components subspace +CVAPI(cv::Mat*) core_PCA_project1(cv::PCA *obj, cv::_InputArray *vec) +{ + cv::Mat ret = obj->project(*vec); + return new cv::Mat(ret); +} +//! projects vector from the original space to the principal components subspace +CVAPI(void) core_PCA_project2(cv::PCA *obj, cv::_InputArray *vec, cv::_OutputArray *result) +{ + obj->project(*vec, *result); +} +//! reconstructs the original vector from the projection +CVAPI(cv::Mat*) core_PCA_backProject1(cv::PCA *obj, cv::_InputArray *vec) +{ + cv::Mat ret = obj->backProject(*vec); + return new cv::Mat(ret); +} +//! reconstructs the original vector from the projection +CVAPI(void) core_PCA_backProject2(cv::PCA *obj, cv::_InputArray *vec, cv::_OutputArray *result) +{ + obj->backProject(*vec, *result); +} + +//!< eigenvectors of the covariation matrix +CVAPI(cv::Mat*) core_PCA_eigenvectors(cv::PCA *obj) +{ + return new cv::Mat(obj->eigenvectors); +} +//!< eigenvalues of the covariation matrix +CVAPI(cv::Mat*) core_PCA_eigenvalues(cv::PCA *obj) +{ + return new cv::Mat(obj->eigenvalues); +} +//!< mean value subtracted before the projection and added after the back projection +CVAPI(cv::Mat*) core_PCA_mean(cv::PCA *obj) +{ + return new cv::Mat(obj->mean); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/core_RNG.h b/src/OpenCvSharpExtern/core_RNG.h new file mode 100644 index 000000000..bb60e818f --- /dev/null +++ b/src/OpenCvSharpExtern/core_RNG.h @@ -0,0 +1,106 @@ +#ifndef _CPP_CORE_RNG_H_ +#define _CPP_CORE_RNG_H_ + +#include "include_opencv.h" + +CVAPI(uint64) core_RNG_new1() +{ + cv::RNG rng; + return rng.state; +} +CVAPI(uint64) core_RNG_new2(uint64 state) +{ + cv::RNG rng(state); + return rng.state; +} + + +//! updates the state and returns the next 32-bit unsigned integer random number +CVAPI(uint32) core_RNG_next(uint64 state) +{ + cv::RNG rng(state); + return rng.next(); +} + +CVAPI(uchar) core_RNG_operator_uchar(uint64 state) +{ + cv::RNG rng(state); + return (uchar)rng; +} +CVAPI(schar) core_RNG_operator_schar(uint64 state) +{ + cv::RNG rng(state); + return (schar)rng; +} +CVAPI(ushort) core_RNG_operator_ushort(uint64 state) +{ + cv::RNG rng(state); + return (ushort)rng; +} +CVAPI(short) core_RNG_operator_short(uint64 state) +{ + cv::RNG rng(state); + return (short)rng; +} +CVAPI(uint32) core_RNG_operator_uint(uint64 state) +{ + cv::RNG rng(state); + return (uint32)rng; +} +//! returns a random integer sampled uniformly from [0, N). +CVAPI(uint32) core_RNG_operatorThis1(uint64 state, uint32 n) +{ + cv::RNG rng(state); + return rng(n); +} +CVAPI(uint32) core_RNG_operatorThis2(uint64 state) +{ + cv::RNG rng(state); + return rng(); +} +CVAPI(int) core_RNG_operator_int(uint64 state) +{ + cv::RNG rng(state); + return (int)rng; +} +CVAPI(float) core_RNG_operator_float(uint64 state) +{ + cv::RNG rng(state); + return (float)rng; +} +CVAPI(double) core_RNG_operator_double(uint64 state) +{ + cv::RNG rng(state); + return (double)rng; +} +//! returns uniformly distributed integer random number from [a,b) range +CVAPI(int) core_RNG_uniform_int(uint64 state, int a, int b) +{ + cv::RNG rng(state); + return rng.uniform(a, b); +} +//! returns uniformly distributed floating-point random number from [a,b) range +CVAPI(float) core_RNG_uniform_float(uint64 state, float a, float b) +{ + cv::RNG rng(state); + return rng.uniform(a, b); +} +//! returns uniformly distributed double-precision floating-point random number from [a,b) range +CVAPI(double) core_RNG_uniform_double(uint64 state, double a, double b) +{ + cv::RNG rng(state); + return rng.uniform(a, b); +} +CVAPI(void) core_RNG_fill(uint64 state, cv::_InputOutputArray *mat, int distType, cv::_InputArray *a, cv::_InputArray *b, int saturateRange) +{ + cv::RNG rng(state); + rng.fill(*mat, distType, *a, *b, saturateRange != 0); +} +//! returns Gaussian random variate with mean zero. +CVAPI(double) core_RNG_gaussian(uint64 state, double sigma) +{ + cv::RNG rng(state); + return rng.gaussian(sigma); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/core_SVD.h b/src/OpenCvSharpExtern/core_SVD.h new file mode 100644 index 000000000..97643713b --- /dev/null +++ b/src/OpenCvSharpExtern/core_SVD.h @@ -0,0 +1,65 @@ +#ifndef _CPP_CORE_SVD_H_ +#define _CPP_CORE_SVD_H_ + +#include "include_opencv.h" + +CVAPI(cv::SVD*) core_SVD_new1() +{ + return new cv::SVD; +} +CVAPI(cv::SVD*) core_SVD_new2(cv::_InputArray *src, int flags) +{ + return new cv::SVD(*src, flags); +} +CVAPI(void) core_SVD_delete(cv::SVD *obj) +{ + delete obj; +} + +CVAPI(void) core_SVD_operatorThis(cv::SVD *obj, cv::_InputArray *src, int flags) +{ + (*obj)(*src, flags); +} +//! performs back substitution, so that dst is the solution or pseudo-solution of m*dst = rhs, where m is the decomposed matrix +CVAPI(void) core_SVD_backSubst(cv::SVD *obj, cv::_InputArray *rhs, cv::_OutputArray *dst) +{ + obj->backSubst(*rhs, *dst); +} + +//! decomposes matrix and stores the results to user-provided matrices +CVAPI(void) core_SVD_static_compute1(cv::_InputArray *src, cv::_OutputArray *w, + cv::_OutputArray *u, cv::_OutputArray *vt, int flags) +{ + cv::SVD::compute(*src, *w, *u, *vt, flags); +} +//! computes singular values of a matrix +CVAPI(void) core_SVD_static_compute2(cv::_InputArray *src, cv::_OutputArray *w, int flags) +{ + cv::SVD::compute(*src, *w, flags); +} +//! performs back substitution +CVAPI(void) core_SVD_static_backSubst(cv::_InputArray *w, cv::_InputArray *u, + cv::_InputArray *vt, cv::_InputArray *rhs, cv::_OutputArray *dst) +{ + cv::SVD::backSubst(*w, *u, *vt, *rhs, *dst); +} +//! finds dst = arg min_{|dst|=1} |m*dst| +CVAPI(void) core_SVD_static_solveZ(cv::_InputArray *src, cv::_OutputArray *dst) +{ + cv::SVD::solveZ(*src, *dst); +} + +CVAPI(cv::Mat*) core_SVD_u(cv::SVD *obj) +{ + return new cv::Mat(obj->u); +} +CVAPI(cv::Mat*) core_SVD_w(cv::SVD *obj) +{ + return new cv::Mat(obj->w); +} +CVAPI(cv::Mat*) core_SVD_vt(cv::SVD *obj) +{ + return new cv::Mat(obj->vt); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/core_SparseMat.h b/src/OpenCvSharpExtern/core_SparseMat.h new file mode 100644 index 000000000..98f825719 --- /dev/null +++ b/src/OpenCvSharpExtern/core_SparseMat.h @@ -0,0 +1,167 @@ +#ifndef _CPP_CORE_SPARSEMAT_H_ +#define _CPP_CORE_SPARSEMAT_H_ + +#include "include_opencv.h" + +CVAPI(uint64) core_SparseMat_sizeof() +{ + return sizeof(cv::SparseMat); +} + +CVAPI(cv::SparseMat*) core_SparseMat_new1() +{ + return new cv::SparseMat(); +} +CVAPI(cv::SparseMat*) core_SparseMat_new2(int dims, const int *sizes, int type) +{ + return new cv::SparseMat(dims, sizes, type); +} +CVAPI(cv::SparseMat*) core_SparseMat_new3(cv::Mat *m) +{ + return new cv::SparseMat(*m); +} + +CVAPI(void) core_SparseMat_delete(cv::SparseMat *obj) +{ + delete obj; +} + + +CVAPI(void) core_SparseMat_operatorAssign_SparseMat(cv::SparseMat *obj, cv::SparseMat *m) +{ + *obj = *m; +} +CVAPI(void) core_SparseMat_operatorAssign_Mat(cv::SparseMat *obj, cv::Mat *m) +{ + *obj = *m; +} + +CVAPI(cv::SparseMat*) core_SparseMat_clone(cv::SparseMat *obj) +{ + cv::SparseMat sm = obj->clone(); + return new cv::SparseMat(sm); +} +CVAPI(void) core_SparseMat_copyTo_SparseMat(cv::SparseMat *obj, cv::SparseMat *m) +{ + obj->copyTo(*m); +} +CVAPI(void) core_SparseMat_copyTo_Mat(cv::SparseMat *obj, cv::Mat *m) +{ + obj->copyTo(*m); +} +CVAPI(void) core_SparseMat_convertTo_SparseMat(cv::SparseMat *obj, cv::SparseMat *m, int rtype, double alpha) +{ + obj->convertTo(*m, rtype, alpha); +} +CVAPI(void) core_SparseMat_convertTo_Mat(cv::SparseMat *obj, cv::Mat *m, int rtype, double alpha = 1, double beta = 0) +{ + obj->convertTo(*m, rtype, alpha, beta); +} +CVAPI(void) core_SparseMat_assignTo(cv::SparseMat *obj, cv::SparseMat *m, int type = -1) +{ + obj->assignTo(*m, type); +} + +CVAPI(void) core_SparseMat_create(cv::SparseMat *obj, int dims, const int* sizes, int type) +{ + obj->create(dims, sizes, type); +} +CVAPI(void) core_SparseMat_clear(cv::SparseMat *obj) +{ + obj->clear(); +} +CVAPI(void) core_SparseMat_addref(cv::SparseMat *obj) +{ + obj->addref(); +} +CVAPI(void) core_SparseMat_release(cv::SparseMat *obj) +{ + obj->release(); +} + +CVAPI(int) core_SparseMat_elemSize(cv::SparseMat *obj) +{ + return static_cast(obj->elemSize()); +} +CVAPI(int) core_SparseMat_elemSize1(cv::SparseMat *obj) +{ + return static_cast(obj->elemSize1()); +} + +CVAPI(int) core_SparseMat_type(cv::SparseMat *obj) +{ + return obj->type(); +} +CVAPI(int) core_SparseMat_depth(cv::SparseMat *obj) +{ + return obj->depth(); +} +CVAPI(int) core_SparseMat_channels(cv::SparseMat *obj) +{ + return obj->channels(); +} + +CVAPI(const int*) core_SparseMat_size1(cv::SparseMat *obj) +{ + return obj->size(); +} +CVAPI(int) core_SparseMat_size2(cv::SparseMat *obj, int i) +{ + return obj->size(i); +} +CVAPI(int) core_SparseMat_dims(cv::SparseMat *obj) +{ + return obj->dims(); +} +CVAPI(size_t) core_SparseMat_nzcount(cv::SparseMat *obj) +{ + return obj->nzcount(); +} + +CVAPI(size_t) core_SparseMat_hash_1d(cv::SparseMat *obj, int i0) +{ + return obj->hash(i0); +} +CVAPI(size_t) core_SparseMat_hash_2d(cv::SparseMat *obj, int i0, int i1) +{ + return obj->hash(i0, i1); +} +CVAPI(size_t) core_SparseMat_hash_3d(cv::SparseMat *obj, int i0, int i1, int i2) +{ + return obj->hash(i0, i1, i2); +} +CVAPI(size_t) core_SparseMat_hash_nd(cv::SparseMat *obj, const int* idx) +{ + return obj->hash(idx); +} + +CVAPI(uchar*) core_SparseMat_ptr_1d(cv::SparseMat *obj, int i0, int createMissing, uint64* hashval) +{ + if (hashval == NULL) + return obj->ptr(i0, createMissing != 0); + size_t hashval0 = static_cast(*hashval); + return obj->ptr(i0, createMissing != 0, &hashval0); +} +CVAPI(uchar*) core_SparseMat_ptr_2d(cv::SparseMat *obj, int i0, int i1, int createMissing, uint64* hashval) +{ + if (hashval == NULL) + return obj->ptr(i0, i1, createMissing != 0); + size_t hashval0 = static_cast(*hashval); + return obj->ptr(i0, i1, createMissing != 0, &hashval0); +} +CVAPI(uchar*) core_SparseMat_ptr_3d(cv::SparseMat *obj, int i0, int i1, int i2, int createMissing, uint64* hashval) +{ + if (hashval == NULL) + return obj->ptr(i0, i1, i2, createMissing != 0); + size_t hashval0 = static_cast(*hashval); + return obj->ptr(i0, i1, i2, createMissing != 0, &hashval0); +} +CVAPI(uchar*) core_SparseMat_ptr_nd(cv::SparseMat *obj, const int* idx, int createMissing, uint64* hashval) +{ + if (hashval == NULL) + return obj->ptr(idx, createMissing != 0); + size_t hashval0 = static_cast(*hashval); + return obj->ptr(idx, createMissing != 0, &hashval0); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/cuda.cpp b/src/OpenCvSharpExtern/cuda.cpp new file mode 100644 index 000000000..40bf08af4 --- /dev/null +++ b/src/OpenCvSharpExtern/cuda.cpp @@ -0,0 +1,2 @@ +#include "cuda.h" +#include "cuda_GpuMat.h" \ No newline at end of file diff --git a/src/OpenCvSharpExtern/cuda.h b/src/OpenCvSharpExtern/cuda.h new file mode 100644 index 000000000..13ddcfb2a --- /dev/null +++ b/src/OpenCvSharpExtern/cuda.h @@ -0,0 +1,196 @@ +#ifndef _CPP_cuda_H_ +#define _CPP_cuda_H_ + +#include "include_opencv.h" +using namespace cv::cuda; + +#pragma region Device + +CVAPI(int) cuda_getCudaEnabledDeviceCount() +{ + return getCudaEnabledDeviceCount(); +} + +CVAPI(void) cuda_setDevice(int device) +{ + setDevice(device); +} +CVAPI(int) cuda_getDevice() +{ + return getDevice(); +} + +CVAPI(void) cuda_resetDevice() +{ + resetDevice(); +} + +CVAPI(int) cuda_deviceSupports(int feature_set) +{ + return deviceSupports( + static_cast(feature_set)) ? 1 : 0; +} + +// TargetArchs +CVAPI(int) cuda_TargetArchs_builtWith(int feature_set) +{ + return TargetArchs::builtWith( + static_cast(feature_set)) ? 1 : 0; +} +CVAPI(int) cuda_TargetArchs_has(int major, int minor) +{ + return TargetArchs::has(major, minor) ? 1 : 0; +} +CVAPI(int) cuda_TargetArchs_hasPtx(int major, int minor) +{ + return TargetArchs::hasPtx(major, minor) ? 1 : 0; +} +CVAPI(int) cuda_TargetArchs_hasBin(int major, int minor) +{ + return TargetArchs::hasBin(major, minor) ? 1 : 0; +} +CVAPI(int) cuda_TargetArchs_hasEqualOrLessPtx(int major, int minor) +{ + return TargetArchs::hasEqualOrLessPtx(major, minor) ? 1 : 0; +} +CVAPI(int) cuda_TargetArchs_hasEqualOrGreater(int major, int minor) +{ + return TargetArchs::hasEqualOrGreater(major, minor) ? 1 : 0; +} +CVAPI(int) cuda_TargetArchs_hasEqualOrGreaterPtx(int major, int minor) +{ + return TargetArchs::hasEqualOrGreaterPtx(major, minor) ? 1 : 0; +} +CVAPI(int) cuda_TargetArchs_hasEqualOrGreaterBin(int major, int minor) +{ + return TargetArchs::hasEqualOrGreaterBin(major, minor) ? 1 : 0; +} + +// DeviceInfo +CVAPI(DeviceInfo*) cuda_DeviceInfo_new1() +{ + return new DeviceInfo(); +} +CVAPI(DeviceInfo*) cuda_DeviceInfo_new2(int deviceId) +{ + return new DeviceInfo(deviceId); +} +CVAPI(void) cuda_DeviceInfo_delete(DeviceInfo *obj) +{ + delete obj; +} + +CVAPI(void) cuda_DeviceInfo_name(DeviceInfo *obj, char *buf, int bufLength) +{ + copyString(obj->name(), buf, bufLength); +} +CVAPI(int) cuda_DeviceInfo_majorVersion(DeviceInfo *obj) +{ + return obj->majorVersion(); +} +CVAPI(int) cuda_DeviceInfo_minorVersion(DeviceInfo *obj) +{ + return obj->minorVersion(); +} +CVAPI(int) cuda_DeviceInfo_multiProcessorCount(DeviceInfo *obj) +{ + return obj->multiProcessorCount(); +} +CVAPI(uint64) cuda_DeviceInfo_sharedMemPerBlock(DeviceInfo *obj) +{ + return obj->sharedMemPerBlock(); +} +CVAPI(void) cuda_DeviceInfo_queryMemory( + DeviceInfo *obj, uint64 *totalMemory, uint64 *freeMemory) +{ + size_t totalMemory0, freeMemory0; + obj->queryMemory(totalMemory0, freeMemory0); + *totalMemory = totalMemory0; + *freeMemory = freeMemory0; +} +CVAPI(uint64) cuda_DeviceInfo_freeMemory(DeviceInfo *obj) +{ + return obj->freeMemory(); +} +CVAPI(uint64) cuda_DeviceInfo_totalMemory(DeviceInfo *obj) +{ + return obj->totalMemory(); +} +CVAPI(int) cuda_DeviceInfo_supports(DeviceInfo *obj, int feature_set) +{ + return obj->supports(static_cast(feature_set)) ? 1 : 0; +} +CVAPI(int) cuda_DeviceInfo_isCompatible(DeviceInfo *obj) +{ + return obj->isCompatible() ? 1 : 0; +} +CVAPI(int) cuda_DeviceInfo_deviceID(DeviceInfo *obj) +{ + return obj->deviceID(); +} +CVAPI(int) cuda_DeviceInfo_canMapHostMemory(DeviceInfo *obj) +{ + return obj->canMapHostMemory() ? 1 : 0; +} + + +CVAPI(void) cuda_printCudaDeviceInfo(int device) +{ + printCudaDeviceInfo(device); +} +CVAPI(void) cuda_printShortCudaDeviceInfo(int device) +{ + printShortCudaDeviceInfo(device); +} + +#pragma endregion + +#pragma region Stream + +CVAPI(Stream*) cuda_Stream_new1() +{ + return new Stream(); +} +CVAPI(Stream*) cuda_Stream_new2(Stream* s) +{ + return new Stream(*s); +} + +CVAPI(void) cuda_Stream_delete(Stream *obj) +{ + delete obj; +} + +CVAPI(void) cuda_Stream_opAssign(Stream *left, Stream *right) +{ + *left = *right; +} + +CVAPI(int) cuda_Stream_queryIfComplete(Stream *obj) +{ + return obj->queryIfComplete() ? 1 : 0; +} +CVAPI(void) cuda_Stream_waitForCompletion(Stream *obj) +{ + obj->waitForCompletion(); +} + +CVAPI(void) cuda_Stream_enqueueHostCallback( + Stream *obj, Stream::StreamCallback callback, void* userData) +{ + obj->enqueueHostCallback(callback, userData); +} + +CVAPI(Stream*) cuda_Stream_Null() +{ + return &Stream::Null(); +} + +CVAPI(int) cuda_Stream_bool(Stream *obj) +{ + return (bool)(*obj) ? 1 : 0; +} + +#pragma endregion + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/cuda_GpuMat.h b/src/OpenCvSharpExtern/cuda_GpuMat.h new file mode 100644 index 000000000..b1ecc5b57 --- /dev/null +++ b/src/OpenCvSharpExtern/cuda_GpuMat.h @@ -0,0 +1,284 @@ +#ifndef _CPP_GPU_GPUMAT_H_ +#define _CPP_GPU_GPUMAT_H_ + +#include "include_opencv.h" +using namespace cv::cuda; + + +#pragma region Init and Disposal + +CVAPI(void) cuda_GpuMat_delete(GpuMat *obj) +{ + delete obj; +} +CVAPI(GpuMat*) cuda_GpuMat_new1() +{ + return new GpuMat(); +} +CVAPI(GpuMat*) cuda_GpuMat_new2(int rows, int cols, int type) +{ + return new GpuMat(rows, cols, type); +} +CVAPI(GpuMat*) cuda_GpuMat_new3(int rows, int cols, int type, void* data, uint64 step) +{ + return new GpuMat(rows, cols, type, data, static_cast(step)); +} +CVAPI(GpuMat*) cuda_GpuMat_new4(cv::Mat *mat) +{ + return new GpuMat(*mat); +} +CVAPI(GpuMat*) cuda_GpuMat_new5(GpuMat *gpumat) +{ + return new GpuMat(*gpumat); +} +CVAPI(GpuMat*) cuda_GpuMat_new6(CvSize size, int type) +{ + return new GpuMat((cv::Size)size, type); +} +CVAPI(GpuMat*) cuda_GpuMat_new7(CvSize size, int type, void* data, uint64 step) +{ + return new GpuMat((cv::Size)size, type, data, static_cast(step)); +} +CVAPI(GpuMat*) cuda_GpuMat_new8(int rows, int cols, int type, CvScalar s) +{ + return new GpuMat(rows, cols, type, s); +} +CVAPI(GpuMat*) cuda_GpuMat_new9(GpuMat *m, CvSlice rowRange, CvSlice colRange) +{ + return new GpuMat(*m, (cv::Range)rowRange, (cv::Range)colRange); +} +CVAPI(GpuMat*) cuda_GpuMat_new10(GpuMat *m, CvRect roi) +{ + return new GpuMat(*m, (cv::Rect)roi); +} +CVAPI(GpuMat*) cuda_GpuMat_new11(CvSize size, int type, CvScalar s) +{ + return new GpuMat((cv::Size)size, type, s); +} +#pragma endregion + +#pragma region Fields +CVAPI(int) cuda_GpuMat_flags(GpuMat *obj) +{ + return obj->flags; +} +CVAPI(int) cuda_GpuMat_rows(GpuMat *obj) +{ + return obj->rows; +} +CVAPI(int) cuda_GpuMat_cols(GpuMat *obj) +{ + return obj->cols; +} +CVAPI(uint64) cuda_GpuMat_step(GpuMat *obj) +{ + return static_cast(obj->step); +} +CVAPI(uchar*) cuda_GpuMat_data(GpuMat *obj) +{ + return obj->data; +} +CVAPI(int*) cuda_GpuMat_refcount(GpuMat *obj) +{ + return obj->refcount; +} +CVAPI(uchar*) cuda_GpuMat_datastart(GpuMat *obj) +{ + return obj->datastart; +} +CVAPI(const uchar*) cuda_GpuMat_dataend(GpuMat *obj) +{ + return obj->dataend; +} +#pragma endregion + +#pragma region Operators +CVAPI(void) cuda_GpuMat_opAssign(GpuMat *left, GpuMat *right) +{ + *left = *right; +} + +CVAPI(GpuMat*) cuda_GpuMat_opRange1(GpuMat *src, CvRect roi) +{ + GpuMat gm = (*src)(roi); + return new GpuMat(gm); +} +CVAPI(GpuMat*) cuda_GpuMat_opRange2(GpuMat *src, CvSlice rowRange, CvSlice colRange) +{ + GpuMat gm = (*src)(rowRange, colRange); + return new GpuMat(gm); +} + +CVAPI(cv::Mat*) cuda_GpuMat_opToMat(GpuMat *src) +{ + cv::Mat m = (cv::Mat)(*src); + return new cv::Mat(m); +} +CVAPI(GpuMat*) cuda_GpuMat_opToGpuMat(cv::Mat *src) +{ + GpuMat gm = (GpuMat)(*src); + return new GpuMat(gm); +} +#pragma endregion + +#pragma region Methods + +CVAPI(void) cuda_GpuMat_upload(GpuMat *obj, cv::Mat *m) +{ + obj->upload(*m); +} + +CVAPI(void) cuda_GpuMat_download(GpuMat *obj, cv::Mat *m) +{ + obj->download(*m); +} + +CVAPI(GpuMat*) cuda_GpuMat_row(GpuMat *obj, int y) +{ + GpuMat ret = obj->row(y); + return new GpuMat(ret); +} +CVAPI(GpuMat*) cuda_GpuMat_col(GpuMat *obj, int x) +{ + GpuMat ret = obj->col(x); + return new GpuMat(ret); +} +CVAPI(GpuMat*) cuda_GpuMat_rowRange(GpuMat *obj, int startrow, int endrow) +{ + GpuMat ret = obj->rowRange(startrow, endrow); + return new GpuMat(ret); +} +CVAPI(GpuMat*) cuda_GpuMat_colRange(GpuMat *obj, int startcol, int endcol) +{ + GpuMat ret = obj->colRange(startcol, endcol); + return new GpuMat(ret); +} +CVAPI(GpuMat*) cuda_GpuMat_clone(GpuMat *obj) +{ + GpuMat ret = obj->clone(); + return new GpuMat(ret); +} +CVAPI(void) cuda_GpuMat_copyTo1(GpuMat *obj, GpuMat *m) +{ + obj->copyTo(*m); +} +CVAPI(void) cuda_GpuMat_copyTo2(GpuMat *obj, GpuMat *m, GpuMat *mask) +{ + obj->copyTo(*m, *mask); +} +CVAPI(void) cuda_GpuMat_convertTo(GpuMat *obj, GpuMat *m, int rtype, double alpha, double beta) +{ + obj->convertTo(*m, rtype, alpha, beta); +} +CVAPI(void) cuda_GpuMat_assignTo(GpuMat *obj, GpuMat *m, int type) +{ + obj->assignTo(*m, type); +} +CVAPI(GpuMat*) cuda_GpuMat_setTo(GpuMat *obj, CvScalar s, GpuMat *mask) +{ + GpuMat gm = obj->setTo(s, entity(mask)); + return new GpuMat(gm); +} +CVAPI(GpuMat*) cuda_GpuMat_reshape(GpuMat *obj, int cn, int rows) +{ + GpuMat gm = obj->reshape(cn, rows); + return new GpuMat(gm); +} + +CVAPI(void) cuda_GpuMat_create1(GpuMat *obj, int rows, int cols, int type) +{ + obj->create(rows, cols, type); +} +CVAPI(void) cuda_GpuMat_create2(GpuMat *obj, CvSize size, int type) +{ + obj->create((cv::Size)size, type); +} +CVAPI(void) cuda_GpuMat_release(GpuMat *obj) +{ + obj->release(); +} +CVAPI(void) cuda_GpuMat_swap(GpuMat *obj, GpuMat *mat) +{ + obj->swap(*mat); +} + +CVAPI(void) cuda_GpuMat_locateROI(GpuMat *obj, CvSize *wholeSize, CvPoint *ofs) +{ + cv::Size _wholeSize; + cv::Point _ofs; + obj->locateROI(_wholeSize, _ofs); + *wholeSize = (CvSize)_wholeSize; + *ofs = (CvPoint)_ofs; +} + +CVAPI(GpuMat*) cuda_GpuMat_adjustROI(GpuMat *obj, int dtop, int dbottom, int dleft, int dright) +{ + GpuMat gm = obj->adjustROI(dtop, dbottom, dleft, dright); + return new GpuMat(gm); +} + +CVAPI(int) cuda_GpuMat_isContinuous(GpuMat *obj) +{ + return obj->isContinuous() ? 1 : 0; +} + +CVAPI(uint64) cuda_GpuMat_elemSize(GpuMat *obj) +{ + return static_cast(obj->elemSize()); +} +CVAPI(uint64) cuda_GpuMat_elemSize1(GpuMat *obj) +{ + return static_cast(obj->elemSize1()); +} + +CVAPI(int) cuda_GpuMat_type(GpuMat *obj) +{ + return obj->type(); +} +CVAPI(int) cuda_GpuMat_depth(GpuMat *obj) +{ + return obj->depth(); +} +CVAPI(int) cuda_GpuMat_channels(GpuMat *obj) +{ + return obj->channels(); +} +CVAPI(uint64) cuda_GpuMat_step1(GpuMat *obj) +{ + return static_cast(obj->step1()); +} +CVAPI(MyCvSize) cuda_GpuMat_size(GpuMat *obj) +{ + return c(obj->size()); +} +CVAPI(int) cuda_GpuMat_empty(GpuMat *obj) +{ + return obj->empty() ? 1 : 0; +} + +CVAPI(const uchar*) cuda_GpuMat_ptr(const GpuMat *obj, int y) +{ + return obj->ptr(y); +} + +#pragma endregion + +//! Creates continuous GPU matrix +CVAPI(void) cuda_createContinuous1(int rows, int cols, int type, GpuMat *gm) +{ + createContinuous(rows, cols, type, *gm); +} +CVAPI(GpuMat*) cuda_createContinuous2(int rows, int cols, int type) +{ + GpuMat gm = createContinuous(rows, cols, type); + return new GpuMat(gm); +} + +//! Ensures that size of the given matrix is not less than (rows, cols) size +//! and matrix type is match specified one too +CVAPI(void) cuda_ensureSizeIsEnough(int rows, int cols, int type, GpuMat *m) +{ + ensureSizeIsEnough(rows, cols, type, *m); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/face.cpp b/src/OpenCvSharpExtern/face.cpp new file mode 100644 index 000000000..b5690ef96 --- /dev/null +++ b/src/OpenCvSharpExtern/face.cpp @@ -0,0 +1 @@ +#include "face.h" \ No newline at end of file diff --git a/src/OpenCvSharpExtern/face.h b/src/OpenCvSharpExtern/face.h new file mode 100644 index 000000000..6f03684de --- /dev/null +++ b/src/OpenCvSharpExtern/face.h @@ -0,0 +1,76 @@ +#ifdef ENABLED_CONTRIB +#ifndef _CPP_FACE_H_ +#define _CPP_FACE_H_ + +#include "include_opencv.h" +using namespace cv::face; + + +CVAPI(void) face_FaceRecognizer_train( + FaceRecognizer *obj, cv::Mat **src, int srcLength, int *labels, int labelsLength) +{ + std::vector srcVec(srcLength); + for (int i = 0; i < srcLength; i++) + srcVec[i] = *src[i]; + std::vector labelsVec(labels, labels + labelsLength); + obj->train(srcVec, labelsVec); +} +CVAPI(void) face_FaceRecognizer_update( + FaceRecognizer *obj, cv::Mat **src, int srcLength, int *labels, int labelsLength) +{ + std::vector srcVec(srcLength); + for (int i = 0; i < srcLength; i++) + srcVec[i] = *src[i]; + std::vector labelsVec(labels, labels + labelsLength); + obj->update(srcVec, labelsVec); +} +CVAPI(int) face_FaceRecognizer_predict1(FaceRecognizer *obj, cv::_InputArray *src) +{ + return obj->predict(*src); +} +CVAPI(void) face_FaceRecognizer_predict2( + FaceRecognizer *obj, cv::_InputArray *src, int *label, double *confidence) +{ + obj->predict(*src, *label, *confidence); +} +CVAPI(void) face_FaceRecognizer_save1(FaceRecognizer *obj, const char *filename) +{ + obj->save(filename); +} +CVAPI(void) face_FaceRecognizer_load1(FaceRecognizer *obj, const char *filename) +{ + obj->load(filename); +} +CVAPI(void) face_FaceRecognizer_save2(FaceRecognizer *obj, cv::FileStorage *fs) +{ + obj->save(*fs); +} +CVAPI(void) face_FaceRecognizer_load2(FaceRecognizer *obj, cv::FileStorage *fs) +{ + obj->load(*fs); +} + +CVAPI(cv::Ptr*) face_createEigenFaceRecognizer(int numComponents, double threshold) +{ + return clone(createEigenFaceRecognizer(numComponents, threshold)); +} +CVAPI(cv::Ptr*) face_createFisherFaceRecognizer(int numComponents, double threshold) +{ + return clone(createFisherFaceRecognizer(numComponents, threshold)); +} +CVAPI(cv::Ptr*) face_createLBPHFaceRecognizer( + int radius, int neighbors, int gridX, int gridY, double threshold) +{ + return clone(createLBPHFaceRecognizer(radius, neighbors, gridX, gridY, threshold)); +} +CVAPI(FaceRecognizer*) face_Ptr_FaceRecognizer_get(cv::Ptr *obj) +{ + return obj->get(); +} +CVAPI(void) face_Ptr_FaceRecognizer_delete(cv::Ptr *obj) +{ + delete obj; +} + +#endif +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/features2d.cpp b/src/OpenCvSharpExtern/features2d.cpp new file mode 100644 index 000000000..92c4c6f86 --- /dev/null +++ b/src/OpenCvSharpExtern/features2d.cpp @@ -0,0 +1,12 @@ +#include "features2d.h" +#include "features2d_DescriptorMatcher.h" +#include "features2d_FeatureDetector.h" + +#include "features2d_AgastFeatureDetector.h" +#include "features2d_AKAZE.h" +#include "features2d_BRISK.h" +#include "features2d_GFTTDetector.h" +#include "features2d_KAZE.h" +#include "features2d_MSER.h" +#include "features2d_ORB.h" +#include "features2d_SimpleBlobDetector.h" diff --git a/src/OpenCvSharpExtern/features2d.h b/src/OpenCvSharpExtern/features2d.h new file mode 100644 index 000000000..73c919eff --- /dev/null +++ b/src/OpenCvSharpExtern/features2d.h @@ -0,0 +1,109 @@ +#ifndef _CPP_FEATURES2D_H_ +#define _CPP_FEATURES2D_H_ + +#include "include_opencv.h" + + +CVAPI(void) features2d_drawKeypoints(cv::Mat* image, cv::KeyPoint *keypoints, int keypointsLength, + cv::Mat *outImage, CvScalar color, int flags) +{ + std::vector keypointsVec(keypoints, keypoints + keypointsLength); + cv::drawKeypoints(*image, keypointsVec, *outImage, color, flags); +} + + +CVAPI(void) features2d_drawMatches1(cv::Mat *img1, cv::KeyPoint *keypoints1, int keypoints1Length, + cv::Mat *img2, cv::KeyPoint *keypoints2, int keypoints2Length, + cv::DMatch *matches1to2, int matches1to2Length, cv::Mat *outImg, + CvScalar matchColor, CvScalar singlePointColor, + char *matchesMask, int matchesMaskLength, int flags) +{ + std::vector keypoints1Vec(keypoints1, keypoints1 + keypoints1Length); + std::vector keypoints2Vec(keypoints2, keypoints2 + keypoints2Length); + std::vector matches1to2Vec(matches1to2, matches1to2 + matches1to2Length); + std::vector matchesMaskVec; + if (matchesMask != NULL) + matchesMaskVec = std::vector(matchesMask, matchesMask + matchesMaskLength); + cv::drawMatches(*img1, keypoints1Vec, *img2, keypoints2Vec, matches1to2Vec, *outImg, + matchColor, singlePointColor, matchesMaskVec, flags); +} + +CVAPI(void) features2d_drawMatches2(cv::Mat *img1, cv::KeyPoint *keypoints1, int keypoints1Length, + cv::Mat *img2, cv::KeyPoint *keypoints2, int keypoints2Length, + cv::DMatch **matches1to2, int matches1to2Size1, int *matches1to2Size2, + cv::Mat *outImg, CvScalar matchColor, CvScalar singlePointColor, + char **matchesMask, int matchesMaskSize1, int *matchesMaskSize2, int flags) +{ + std::vector keypoints1Vec(keypoints1, keypoints1 + keypoints1Length); + std::vector keypoints2Vec(keypoints2, keypoints2 + keypoints2Length); + std::vector > matches1to2Vec(matches1to2Size1); + for (int i = 0; i < matches1to2Size1; i++) + { + cv::DMatch *p = matches1to2[i]; + matches1to2Vec[i] = std::vector(p, p + matches1to2Size2[i]); + } + + std::vector > matchesMaskVec; + if (matchesMask != NULL) + { + matchesMaskVec = std::vector >(matchesMaskSize1); + for (int i = 0; i < matchesMaskSize1; i++) + { + char *p = matchesMask[i]; + matchesMaskVec[i] = std::vector(p, p + matchesMaskSize2[i]); + } + } + + cv::drawMatches(*img1, keypoints1Vec, *img2, keypoints2Vec, matches1to2Vec, + *outImg, matchColor, singlePointColor, matchesMaskVec, flags); +} + + +CVAPI(void) features2d_evaluateFeatureDetector( + cv::Mat *img1, cv::Mat *img2, cv::Mat *H1to2, + std::vector *keypoints1, std::vector *keypoints2, + float *repeatability, int *correspCount/*, + const Ptr& fdetector = Ptr()*/) +{ + cv::evaluateFeatureDetector(*img1, *img2, *H1to2, keypoints1, keypoints2, + *repeatability, *correspCount); +} + +CVAPI(void) features2d_computeRecallPrecisionCurve( + cv::DMatch **matches1to2, int matches1to2Size1, int *matches1to2Size2, + uchar **correctMatches1to2Mask, int correctMatches1to2MaskSize1, int *correctMatches1to2MaskSize2, + std::vector *recallPrecisionCurve) +{ + std::vector > matches1to2Vec; + std::vector > correctMatches1to2MaskVec; + for (int i = 0; i < matches1to2Size1; i++) + { + matches1to2Vec.push_back( + std::vector(matches1to2[i], matches1to2[i] + matches1to2Size2[i])); + } + for (int i = 0; i < correctMatches1to2MaskSize1; i++) + { + correctMatches1to2MaskVec.push_back( + std::vector(correctMatches1to2Mask[i], correctMatches1to2Mask[i] + correctMatches1to2MaskSize2[i])); + } + cv::computeRecallPrecisionCurve( + matches1to2Vec, correctMatches1to2MaskVec, *recallPrecisionCurve); +} + +CVAPI(float) features2d_getRecall( + cv::Point2f *recallPrecisionCurve, int recallPrecisionCurveSize, float l_precision) +{ + std::vector recallPrecisionCurveVec( + recallPrecisionCurve, recallPrecisionCurve + recallPrecisionCurveSize); + return cv::getRecall(recallPrecisionCurveVec, l_precision); +} + +CVAPI(int) features2d_getNearestPoint( + cv::Point2f *recallPrecisionCurve, int recallPrecisionCurveSize, float l_precision) +{ + std::vector recallPrecisionCurveVec( + recallPrecisionCurve, recallPrecisionCurve + recallPrecisionCurveSize); + return cv::getNearestPoint(recallPrecisionCurveVec, l_precision); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/features2d_AKAZE.h b/src/OpenCvSharpExtern/features2d_AKAZE.h new file mode 100644 index 000000000..9ad0dd0a2 --- /dev/null +++ b/src/OpenCvSharpExtern/features2d_AKAZE.h @@ -0,0 +1,90 @@ +#ifndef _CPP_FEATURES2D_AKAZE_H_ +#define _CPP_FEATURES2D_AKAZE_H_ + +#include "include_opencv.h" + + +CVAPI(cv::Ptr*) features2d_AKAZE_create( + int descriptor_type, int descriptor_size, int descriptor_channels, + float threshold, int nOctaves, int nOctaveLayers, int diffusivity) +{ + cv::Ptr ptr = cv::AKAZE::create( + descriptor_type, descriptor_size, descriptor_channels, + threshold, nOctaves, nOctaveLayers, diffusivity); + return new cv::Ptr(ptr); +} +CVAPI(void) features2d_Ptr_AKAZE_delete(cv::Ptr *ptr) +{ + delete ptr; +} + +CVAPI(cv::AKAZE*) features2d_Ptr_AKAZE_get(cv::Ptr *ptr) +{ + return ptr->get(); +} + + +CVAPI(void) features2d_AKAZE_setDescriptorType(cv::AKAZE *obj, int val) +{ + obj->setDescriptorType(val); +} +CVAPI(int) features2d_AKAZE_getDescriptorType(cv::AKAZE *obj) +{ + return obj->getDescriptorType(); +} + +CVAPI(void) features2d_AKAZE_setDescriptorSize(cv::AKAZE *obj, int val) +{ + obj->setDescriptorSize(val); +} +CVAPI(int) features2d_AKAZE_getDescriptorSize(cv::AKAZE *obj) +{ + return obj->getDescriptorSize(); +} + +CVAPI(void) features2d_AKAZE_setDescriptorChannels(cv::AKAZE *obj, int val) +{ + obj->setDescriptorChannels(val); +} +CVAPI(int) features2d_AKAZE_getDescriptorChannels(cv::AKAZE *obj) +{ + return obj->getDescriptorChannels(); +} + +CVAPI(void) features2d_AKAZE_setThreshold(cv::AKAZE *obj, double val) +{ + obj->setThreshold(val); +} +CVAPI(double) features2d_AKAZE_getThreshold(cv::AKAZE *obj) +{ + return obj->getThreshold(); +} + +CVAPI(void) features2d_AKAZE_setNOctaves(cv::AKAZE *obj, int val) +{ + obj->setNOctaves(val); +} +CVAPI(int) features2d_AKAZE_getNOctaves(cv::AKAZE *obj) +{ + return obj->getNOctaves(); +} + +CVAPI(void) features2d_AKAZE_setNOctaveLayers(cv::AKAZE *obj, int val) +{ + obj->setNOctaveLayers(val); +} +CVAPI(int) features2d_AKAZE_getNOctaveLayers(cv::AKAZE *obj) +{ + return obj->getNOctaveLayers(); +} + +CVAPI(void) features2d_AKAZE_setDiffusivity(cv::AKAZE *obj, int val) +{ + obj->setDiffusivity(val); +} +CVAPI(int) features2d_AKAZE_getDiffusivity(cv::AKAZE *obj) +{ + return obj->getDiffusivity(); +} + +#endif diff --git a/src/OpenCvSharpExtern/features2d_AgastFeatureDetector.h b/src/OpenCvSharpExtern/features2d_AgastFeatureDetector.h new file mode 100644 index 000000000..58829ac0e --- /dev/null +++ b/src/OpenCvSharpExtern/features2d_AgastFeatureDetector.h @@ -0,0 +1,60 @@ +#ifndef _CPP_FEATURES2D_AGASTFEATUREDETECTOR_H_ +#define _CPP_FEATURES2D_AGASTFEATUREDETECTOR_H_ + +#include "include_opencv.h" + + +CVAPI(void) AGAST(cv::_InputArray *image, std::vector *keypoints, + int threshold, int nonmaxSuppression, int type) +{ + cv::AGAST(entity(image), *keypoints, threshold, nonmaxSuppression != 0, type); +} + + +CVAPI(cv::Ptr*) features2d_AgastFeatureDetector_create( + int threshold, int nonmaxSuppression, int type) +{ + cv::Ptr ptr = cv::AgastFeatureDetector::create( + threshold, nonmaxSuppression != 0, type); + return new cv::Ptr(ptr); +} + +CVAPI(void) features2d_Ptr_AgastFeatureDetector_delete(cv::Ptr *ptr) +{ + delete ptr; +} + +CVAPI(cv::AgastFeatureDetector*) features2d_Ptr_AgastFeatureDetector_get(cv::Ptr *ptr) +{ + return ptr->get(); +} + + +CVAPI(void) features2d_AgastFeatureDetector_setThreshold(cv::AgastFeatureDetector *obj, int val) +{ + obj->setThreshold(val); +} +CVAPI(int) features2d_AgastFeatureDetector_getThreshold(cv::AgastFeatureDetector *obj) +{ + return obj->getThreshold(); +} + +CVAPI(void) features2d_AgastFeatureDetector_setNonmaxSuppression(cv::AgastFeatureDetector *obj, int val) +{ + obj->setNonmaxSuppression(val != 0); +} +CVAPI(int) features2d_AgastFeatureDetector_getNonmaxSuppression(cv::AgastFeatureDetector *obj) +{ + return obj->getNonmaxSuppression() ? 1 : 0; +} + +CVAPI(void) features2d_AgastFeatureDetector_setType(cv::AgastFeatureDetector *obj, int val) +{ + obj->setType(val); +} +CVAPI(int) features2d_AgastFeatureDetector_getType(cv::AgastFeatureDetector *obj) +{ + return obj->getType(); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/features2d_BRISK.h b/src/OpenCvSharpExtern/features2d_BRISK.h new file mode 100644 index 000000000..a499c9ef1 --- /dev/null +++ b/src/OpenCvSharpExtern/features2d_BRISK.h @@ -0,0 +1,39 @@ +#ifndef _CPP_FEATURES2D_BRISK_H_ +#define _CPP_FEATURES2D_BRISK_H_ + +#include "include_opencv.h" + + +CVAPI(cv::Ptr*) features2d_BRISK_create1(int thresh, int octaves, float patternScale) +{ + cv::Ptr ptr = cv::BRISK::create(thresh, octaves, patternScale); + return new cv::Ptr(ptr); +} +CVAPI(cv::Ptr*) features2d_BRISK_create2( + float *radiusList, int radiusListLength, int *numberList, int numberListLength, + float dMax, float dMin, + int *indexChange, int indexChangeLength) +{ + std::vector radiusListVec(radiusList, radiusList + radiusListLength); + std::vector numberListVec(numberList, numberList + numberListLength); + std::vector indexChangeVec; + if (indexChange == NULL) + indexChangeVec = std::vector(indexChange, indexChange + indexChangeLength); + else + indexChangeVec = std::vector(); + + cv::Ptr ptr = cv::BRISK::create(radiusListVec, numberListVec, dMax, dMin, indexChangeVec); + return new cv::Ptr(ptr); +} + +CVAPI(void) features2d_Ptr_BRISK_delete(cv::Ptr *ptr) +{ + delete ptr; +} + +CVAPI(cv::BRISK*) features2d_Ptr_BRISK_get(cv::Ptr *ptr) +{ + return ptr->get(); +} + +#endif diff --git a/src/OpenCvSharpExtern/features2d_DescriptorMatcher.h b/src/OpenCvSharpExtern/features2d_DescriptorMatcher.h new file mode 100644 index 000000000..9d7b014ca --- /dev/null +++ b/src/OpenCvSharpExtern/features2d_DescriptorMatcher.h @@ -0,0 +1,207 @@ +#ifndef _CPP_FEATURES2D_DESCRIPTROMATCHER_H_ +#define _CPP_FEATURES2D_DESCRIPTROMATCHER_H_ + +#include "include_opencv.h" + +#pragma region DescriptorMatcher +CVAPI(void) features2d_DescriptorMatcher_add(cv::DescriptorMatcher *obj, cv::Mat **descriptors, int descriptorLength) +{ + std::vector descriptorsVec(descriptorLength); + for (int i = 0; i < descriptorLength; i++) + descriptorsVec[i] = *descriptors[i]; + obj->add(descriptorsVec); +} +CVAPI(void) features2d_DescriptorMatcher_getTrainDescriptors(cv::DescriptorMatcher *obj, std::vector *dst) +{ + *dst = obj->getTrainDescriptors(); +} +CVAPI(void) features2d_DescriptorMatcher_clear(cv::DescriptorMatcher *obj) +{ + obj->clear(); +} +CVAPI(int) features2d_DescriptorMatcher_empty(cv::DescriptorMatcher *obj) +{ + return obj->empty() ? 1 : 0; +} +CVAPI(int) features2d_DescriptorMatcher_isMaskSupported(cv::DescriptorMatcher *obj) +{ + return obj->isMaskSupported() ? 1 : 0; +} + +CVAPI(void) features2d_DescriptorMatcher_train(cv::DescriptorMatcher *obj) +{ + obj->train(); +} + +CVAPI(void) features2d_DescriptorMatcher_match1( + cv::DescriptorMatcher *obj, cv::Mat *queryDescriptors, + cv::Mat *trainDescriptors, std::vector *matches, cv::Mat *mask) +{ + obj->match(*queryDescriptors, *trainDescriptors, *matches, entity(mask)); +} +CVAPI(void) features2d_DescriptorMatcher_knnMatch1( + cv::DescriptorMatcher *obj, cv::Mat *queryDescriptors, + cv::Mat *trainDescriptors, std::vector > *matches, int k, + cv::Mat *mask, int compactResult) +{ + obj->knnMatch(*queryDescriptors, *trainDescriptors, *matches, k, entity(mask), compactResult != 0); +} +CVAPI(void) features2d_DescriptorMatcher_radiusMatch1( + cv::DescriptorMatcher *obj, cv::Mat *queryDescriptors, + cv::Mat *trainDescriptors, std::vector > *matches, float maxDistance, + cv::Mat *mask, int compactResult) +{ + obj->radiusMatch(*queryDescriptors, *trainDescriptors, *matches, maxDistance, entity(mask), compactResult != 0); +} + +CVAPI(void) features2d_DescriptorMatcher_match2( + cv::DescriptorMatcher *obj, cv::Mat *queryDescriptors, std::vector *matches, + cv::Mat **masks, int masksSize) +{ + std::vector masksVal; + if (masksSize != 0) + { + masksVal = std::vector(masksSize); + for (int i = 0; i < masksSize; i++) + { + masksVal[i] = *(masks[i]); + } + } + obj->match(*queryDescriptors, *matches, masksVal); +} +CVAPI(void) features2d_DescriptorMatcher_knnMatch2( + cv::DescriptorMatcher *obj, cv::Mat *queryDescriptors, std::vector > *matches, + int k, cv::Mat **masks, int masksSize, int compactResult) +{ + std::vector masksVal; + if (masksSize != 0) + { + masksVal = std::vector(masksSize); + for (int i = 0; i < masksSize; i++) + { + masksVal[i] = *(masks[i]); + } + } + obj->knnMatch(*queryDescriptors, *matches, k, masksVal, compactResult != 0); +} +CVAPI(void) features2d_DescriptorMatcher_radiusMatch2( + cv::DescriptorMatcher *obj, cv::Mat *queryDescriptors, std::vector > *matches, + float maxDistance, cv::Mat **masks, int masksSize, int compactResult) +{ + std::vector masksVal; + if (masksSize != 0) + { + masksVal = std::vector(masksSize); + for (int i = 0; i < masksSize; i++) + { + masksVal[i] = *(masks[i]); + } + } + obj->radiusMatch(*queryDescriptors, *matches, maxDistance, masksVal, compactResult != 0); +} + +CVAPI(cv::Ptr*) features2d_DescriptorMatcher_create(const char *descriptorMatcherType) +{ + cv::Ptr ret = cv::DescriptorMatcher::create(descriptorMatcherType); + return new cv::Ptr(ret); +} + +CVAPI(cv::DescriptorMatcher*) features2d_Ptr_DescriptorMatcher_get(cv::Ptr *ptr) +{ + return ptr->get(); +} +CVAPI(void) features2d_Ptr_DescriptorMatcher_delete(cv::Ptr *ptr) +{ + delete ptr; +} + +#pragma endregion + +#pragma region BFMatcher +CVAPI(cv::BFMatcher*) features2d_BFMatcher_new(int normType, int crossCheck) +{ + return new cv::BFMatcher(normType, crossCheck != 0); +} +CVAPI(void) features2d_BFMatcher_delete(cv::BFMatcher *obj) +{ + delete obj; +} + +CVAPI(int) features2d_BFMatcher_isMaskSupported(cv::BFMatcher *obj) +{ + return obj->isMaskSupported() ? 1 : 0; +} + +CVAPI(cv::BFMatcher*) features2d_Ptr_BFMatcher_get(cv::Ptr *ptr) +{ + return ptr->get(); +} +CVAPI(void) features2d_Ptr_BFMatcher_delete(cv::Ptr *ptr) +{ + delete ptr; +} + +#pragma endregion + +#pragma region FlannBasedMatcher + +static void IndexParamsDeleter(cv::flann::IndexParams *p){ } +static void SearchParamsDeleter(cv::flann::SearchParams *p) { } + +CVAPI(cv::FlannBasedMatcher*) features2d_FlannBasedMatcher_new( + cv::flann::IndexParams *indexParams, cv::flann::SearchParams *searchParams) +{ + cv::Ptr indexParamsPtr; + cv::Ptr searchParamsPtr; + if (indexParams == NULL) + indexParamsPtr = cv::Ptr(new cv::flann::KDTreeIndexParams()); + else + indexParamsPtr = cv::Ptr(indexParams, IndexParamsDeleter); + + if (searchParams == NULL) + searchParamsPtr = cv::Ptr(new cv::flann::SearchParams()); + else + searchParamsPtr = cv::Ptr(searchParams, SearchParamsDeleter); + + return new cv::FlannBasedMatcher(indexParamsPtr, searchParamsPtr); +} +CVAPI(void) features2d_FlannBasedMatcher_delete(cv::FlannBasedMatcher *obj) +{ + delete obj; +} + +CVAPI(void) features2d_FlannBasedMatcher_add( + cv::FlannBasedMatcher *obj, cv::Mat **descriptors, int descriptorsSize) +{ + std::vector descriptorsVal(descriptorsSize); + for (int i = 0; i < descriptorsSize; i++) + { + descriptorsVal[i] = *(descriptors[i]); + } + return obj->add(descriptorsVal); +} +CVAPI(void) features2d_FlannBasedMatcher_clear(cv::FlannBasedMatcher *obj) +{ + return obj->clear(); +} +CVAPI(void) features2d_FlannBasedMatcher_train(cv::FlannBasedMatcher *obj) +{ + return obj->train(); +} +CVAPI(int) features2d_FlannBasedMatcher_isMaskSupported(cv::FlannBasedMatcher *obj) +{ + return obj->isMaskSupported() ? 1 : 0; +} + +CVAPI(cv::FlannBasedMatcher*) features2d_Ptr_FlannBasedMatcher_get(cv::Ptr *ptr) +{ + return ptr->get(); +} +CVAPI(void) features2d_Ptr_FlannBasedMatcher_delete(cv::Ptr *ptr) +{ + delete ptr; +} + +#pragma endregion + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/features2d_FastFeatureDetector.h b/src/OpenCvSharpExtern/features2d_FastFeatureDetector.h new file mode 100644 index 000000000..7f3ddb1e8 --- /dev/null +++ b/src/OpenCvSharpExtern/features2d_FastFeatureDetector.h @@ -0,0 +1,60 @@ +#ifndef _CPP_FEATURES2D_FAST_H_ +#define _CPP_FEATURES2D_FAST_H_ + +#include "include_opencv.h" + +CVAPI(void) features2d_FAST1(cv::_InputArray *image, std::vector *keypoints, int threshold, int nonmaxSupression) +{ + cv::FAST(*image, *keypoints, threshold, nonmaxSupression != 0); +} + +CVAPI(void) features2d_FAS2(cv::_InputArray *image, std::vector *keypoints, int threshold, int nonmaxSupression, int type) +{ + cv::FAST(*image, *keypoints, threshold, nonmaxSupression != 0, type); +} + + +CVAPI(cv::Ptr*) features2d_FastFeatureDetector_create( + int threshold, int nonmaxSuppression) +{ + cv::Ptr ptr = cv::FastFeatureDetector::create(threshold, nonmaxSuppression != 0); + return new cv::Ptr(ptr); +} +CVAPI(void) features2d_Ptr_FastFeatureDetector_delete(cv::Ptr *ptr) +{ + delete ptr; +} + +CVAPI(cv::FastFeatureDetector*) features2d_Ptr_FastFeatureDetector_get(cv::Ptr *ptr) +{ + return ptr->get(); +} + +CVAPI(void) features2d_FastFeatureDetector_setThreshold(cv::FastFeatureDetector *obj, int threshold) +{ + obj->setThreshold(threshold); +} +CVAPI(int) features2d_FastFeatureDetector_getThreshold(cv::FastFeatureDetector *obj) +{ + return obj->getThreshold(); +} + +CVAPI(void) features2d_FastFeatureDetector_setNonmaxSuppression(cv::FastFeatureDetector *obj, int f) +{ + obj->setNonmaxSuppression(f != 0); +} +CVAPI(int) features2d_FastFeatureDetector_getNonmaxSuppression(cv::FastFeatureDetector *obj) +{ + return obj->getNonmaxSuppression() ? 1 : 0; +} + +CVAPI(void) features2d_FastFeatureDetector_setType(cv::FastFeatureDetector *obj, int type) +{ + obj->setType(type); +} +CVAPI(int) features2d_FastFeatureDetector_getType(cv::FastFeatureDetector *obj) +{ + return obj->getType(); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/features2d_FeatureDetector.h b/src/OpenCvSharpExtern/features2d_FeatureDetector.h new file mode 100644 index 000000000..c0274d265 --- /dev/null +++ b/src/OpenCvSharpExtern/features2d_FeatureDetector.h @@ -0,0 +1,123 @@ +#ifndef _CPP_FEATURES2DFEATUREDETECTOR_H_ +#define _CPP_FEATURES2DFEATUREDETECTOR_H_ + +#include "include_opencv.h" + +#pragma region Feature2D + +CVAPI(cv::Feature2D*) features2d_Ptr_Feature2D_get(cv::Ptr* ptr) +{ + return ptr->get(); +} +CVAPI(void) features2d_Ptr_Feature2D_delete(cv::Ptr* ptr) +{ + delete ptr; +} + +CVAPI(void) features2d_Feature2D_detect_Mat1( + cv::Feature2D *detector, cv::Mat *image, std::vector *keypoints, + cv::Mat *mask) +{ + detector->detect(*image, *keypoints, entity(mask)); +} + +CVAPI(void) features2d_Feature2D_detect_Mat2( + cv::Feature2D *detector, cv::Mat **images, int imageLength, + std::vector > *keypoints, cv::Mat **mask) +{ + std::vector imageVec(imageLength); + std::vector maskVec; + + for (int i = 0; i < imageLength; i++) + imageVec.push_back(*images[i]); + + if (mask != NULL) + { + maskVec.reserve(imageLength); + for (int i = 0; i < imageLength; i++) + maskVec.push_back(*mask[i]); + } + + detector->detect(imageVec, *keypoints, maskVec); +} + +CVAPI(void) features2d_Feature2D_detect_InputArray( + cv::Feature2D *obj, cv::_InputArray *image, std::vector *keypoints, cv::Mat *mask) +{ + obj->detect(*image, *keypoints, entity(mask)); +} + +CVAPI(void) features2d_Feature2D_compute1(cv::Feature2D *obj, + cv::_InputArray *image, std::vector *keypoints, cv::_OutputArray *descriptors) +{ + obj->compute(*image, *keypoints, *descriptors); +} + +CVAPI(void) features2d_Feature2D_compute2( + cv::Feature2D *detector, cv::Mat **images, int imageLength, + std::vector > *keypoints, cv::Mat **descriptors, int descriptorsLength) +{ + std::vector imageVec(imageLength); + std::vector descriptorsVec(descriptorsLength); + + for (int i = 0; i < imageLength; i++) + imageVec.push_back(*images[i]); + for (int i = 0; i < descriptorsLength; i++) + descriptorsVec.push_back(*descriptors[i]); + + detector->compute(imageVec, *keypoints, descriptorsVec); +} + +CVAPI(void) features2d_Feature2D_detectAndCompute( + cv::Feature2D *detector, cv::_InputArray *image, cv::_InputArray *mask, + std::vector *keypoints, cv::_OutputArray *descriptors, int useProvidedKeypoints) +{ + detector->detectAndCompute(entity(image), entity(mask), *keypoints, *descriptors, useProvidedKeypoints != 0); +} + +CVAPI(int) features2d_Feature2D_descriptorSize(cv::Ptr *obj) +{ + return obj->get()->descriptorSize(); +} +CVAPI(int) features2d_Feature2D_descriptorType(cv::Ptr *obj) +{ + return obj->get()->descriptorType(); +} +CVAPI(int) features2d_Feature2D_defaultNorm(cv::Ptr *obj) +{ + return obj->get()->defaultNorm(); +} +CVAPI(int) features2d_Feature2D_empty(cv::Ptr *obj) +{ + return obj->get()->empty() ? 1 : 0; +} + +#pragma endregion + +/* +#pragma region DenseFeatureDetector + +CVAPI(cv::DenseFeatureDetector*) features2d_DenseFeatureDetector_new( + float initFeatureScale, int featureScaleLevels, float featureScaleMul, + int initXyStep, int initImgBound, int varyXyStepWithScale, int varyImgBoundWithScale) +{ + return new cv::DenseFeatureDetector(initFeatureScale, featureScaleLevels, + featureScaleMul, initXyStep, initImgBound, varyXyStepWithScale != 0, varyImgBoundWithScale != 0); +} +CVAPI(void) features2d_DenseFeatureDetector_delete(cv::DenseFeatureDetector *obj) +{ + delete obj; +} + +CVAPI(cv::DenseFeatureDetector*) features2d_Ptr_DenseFeatureDetector_get(cv::Ptr *ptr) +{ + return ptr->get(); +} +CVAPI(void) features2d_Ptr_DenseFeatureDetector_delete(cv::Ptr *ptr) +{ + delete ptr; +} + +#pragma endregion +*/ +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/features2d_GFTTDetector.h b/src/OpenCvSharpExtern/features2d_GFTTDetector.h new file mode 100644 index 000000000..86b70b1b6 --- /dev/null +++ b/src/OpenCvSharpExtern/features2d_GFTTDetector.h @@ -0,0 +1,80 @@ +#ifndef _CPP_FEATURES2D_GFTT_H_ +#define _CPP_FEATURES2D_GFTT_H_ + +#include "include_opencv.h" + + +CVAPI(cv::Ptr*) features2d_GFTTDetector_create( + int maxCorners, double qualityLevel, double minDistance, + int blockSize, int useHarrisDetector, double k) +{ + cv::Ptr ptr = cv::GFTTDetector::create( + maxCorners, qualityLevel, minDistance, + blockSize, useHarrisDetector != 0, k); + return new cv::Ptr(ptr); +} +CVAPI(void) features2d_Ptr_GFTTDetector_delete(cv::Ptr *ptr) +{ + delete ptr; +} + +CVAPI(cv::GFTTDetector*) features2d_Ptr_GFTTDetector_get(cv::Ptr *ptr) +{ + return ptr->get(); +} + +CVAPI(void) features2d_GFTTDetector_setMaxFeatures(cv::GFTTDetector *obj, int maxFeatures) +{ + obj->setMaxFeatures(maxFeatures); +} +CVAPI(int) features2d_GFTTDetector_getMaxFeatures(cv::GFTTDetector *obj) +{ + return obj->getMaxFeatures(); +} + +CVAPI(void) features2d_GFTTDetector_setQualityLevel(cv::GFTTDetector *obj, double qlevel) +{ + obj->setQualityLevel(qlevel); +} +CVAPI(double) features2d_GFTTDetector_getQualityLevel(cv::GFTTDetector *obj) +{ + return obj->getQualityLevel(); +} + +CVAPI(void) features2d_GFTTDetector_setMinDistance(cv::GFTTDetector *obj, double minDistance) +{ + obj->setMinDistance(minDistance); +} +CVAPI(double) features2d_GFTTDetector_getMinDistance(cv::GFTTDetector *obj) +{ + return obj->getMinDistance(); +} + +CVAPI(void) features2d_GFTTDetector_setBlockSize(cv::GFTTDetector *obj, int blockSize) +{ + obj->setBlockSize(blockSize); +} +CVAPI(int) features2d_GFTTDetector_getBlockSize(cv::GFTTDetector *obj) +{ + return obj->getBlockSize(); +} + +CVAPI(void) features2d_GFTTDetector_setHarrisDetector(cv::GFTTDetector *obj, int val) +{ + obj->setHarrisDetector(val != 0); +} +CVAPI(int) features2d_GFTTDetector_getHarrisDetector(cv::GFTTDetector *obj) +{ + return obj->getHarrisDetector() ? 1 : 0; +} + +CVAPI(void) features2d_GFTTDetector_setK(cv::GFTTDetector *obj, double k) +{ + obj->setK(k); +} +CVAPI(double) features2d_GFTTDetector_getK(cv::GFTTDetector *obj) +{ + return obj->getK(); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/features2d_KAZE.h b/src/OpenCvSharpExtern/features2d_KAZE.h new file mode 100644 index 000000000..94d5486b1 --- /dev/null +++ b/src/OpenCvSharpExtern/features2d_KAZE.h @@ -0,0 +1,81 @@ +#ifndef _CPP_FEATURES2D_KAZE_H_ +#define _CPP_FEATURES2D_KAZE_H_ + +#include "include_opencv.h" + + +CVAPI(cv::Ptr*) features2d_KAZE_create( + bool extended, bool upright, float threshold, + int nOctaves, int nOctaveLayers, int diffusivity) +{ + cv::Ptr ptr = cv::KAZE::create( + extended, upright, threshold, + nOctaves, nOctaveLayers, diffusivity); + return new cv::Ptr(ptr); +} +CVAPI(void) features2d_Ptr_KAZE_delete(cv::Ptr *ptr) +{ + delete ptr; +} + +CVAPI(cv::KAZE*) features2d_Ptr_KAZE_get(cv::Ptr *ptr) +{ + return ptr->get(); +} + + +CVAPI(void) features2d_KAZE_setDiffusivity(cv::KAZE *obj, int val) +{ + obj->setDiffusivity(val); +} +CVAPI(int) features2d_KAZE_getDiffusivity(cv::KAZE *obj) +{ + return obj->getDiffusivity(); +} + +CVAPI(void) features2d_KAZE_setExtended(cv::KAZE *obj, bool val) +{ + obj->setExtended(val); +} +CVAPI(bool) features2d_KAZE_getExtended(cv::KAZE *obj) +{ + return obj->getExtended(); +} + +CVAPI(void) features2d_KAZE_setNOctaveLayers(cv::KAZE *obj, int val) +{ + obj->setNOctaveLayers(val); +} +CVAPI(int) features2d_KAZE_getNOctaveLayers(cv::KAZE *obj) +{ + return obj->getNOctaveLayers(); +} + +CVAPI(void) features2d_KAZE_setNOctaves(cv::KAZE *obj, int val) +{ + obj->setNOctaves(val); +} +CVAPI(int) features2d_KAZE_getNOctaves(cv::KAZE *obj) +{ + return obj->getNOctaves(); +} + +CVAPI(void) features2d_KAZE_setThreshold(cv::KAZE *obj, double val) +{ + obj->setThreshold(val); +} +CVAPI(double) features2d_KAZE_getThreshold(cv::KAZE *obj) +{ + return obj->getThreshold(); +} + +CVAPI(void) features2d_KAZE_setUpright(cv::KAZE *obj, bool val) +{ + obj->setUpright(val); +} +CVAPI(bool) features2d_KAZE_getUpright(cv::KAZE *obj) +{ + return obj->getUpright(); +} + +#endif diff --git a/src/OpenCvSharpExtern/features2d_KeyPointsFilter.h b/src/OpenCvSharpExtern/features2d_KeyPointsFilter.h new file mode 100644 index 000000000..cf3acbae4 --- /dev/null +++ b/src/OpenCvSharpExtern/features2d_KeyPointsFilter.h @@ -0,0 +1,36 @@ +#ifndef _CPP_FEATURES2D_KAZE_H_ +#define _CPP_FEATURES2D_KAZE_H_ + +#include "include_opencv.h" + + +CVAPI(void) features2d_KeyPointsFilter_runByImageBorder( + std::vector *keypoints, MyCvSize imageSize, int borderSize) +{ + cv::KeyPointsFilter::runByImageBorder(*keypoints, cpp(imageSize), borderSize); +} + +CVAPI(void) features2d_KeyPointsFilter_runByKeypointSize( + std::vector *keypoints, float minSize, float maxSize) +{ + cv::KeyPointsFilter::runByKeypointSize(*keypoints, minSize, maxSize); +} +CVAPI(void) features2d_KeyPointsFilter_runByPixelsMask( + std::vector *keypoints, cv::Mat *mask) +{ + cv::KeyPointsFilter::runByPixelsMask(*keypoints, *mask); +} + +CVAPI(void) features2d_KeyPointsFilter_removeDuplicated( + std::vector *keypoints) +{ + cv::KeyPointsFilter::removeDuplicated(*keypoints); +} + +CVAPI(void) features2d_KeyPointsFilter_retainBest( + std::vector *keypoints, int npoints) +{ + cv::KeyPointsFilter::retainBest(*keypoints, npoints); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/features2d_MSER.h b/src/OpenCvSharpExtern/features2d_MSER.h new file mode 100644 index 000000000..f52b07840 --- /dev/null +++ b/src/OpenCvSharpExtern/features2d_MSER.h @@ -0,0 +1,69 @@ +#ifndef _CPP_FEATURES2D_MSER_H_ +#define _CPP_FEATURES2D_MSER_H_ + +#include "include_opencv.h" + + +CVAPI(cv::Ptr*) features2d_MSER_create(int delta, int minArea, int maxArea, + double maxVariation, double minDiversity, int maxEvolution, + double areaThreshold, double minMargin, int edgeBlurSize) +{ + cv::Ptr ptr = cv::MSER::create(delta, minArea, maxArea, maxVariation, minDiversity, maxEvolution, + areaThreshold, minMargin, edgeBlurSize); + return new cv::Ptr(ptr); +} +CVAPI(void) features2d_Ptr_MSER_delete(cv::Ptr *ptr) +{ + delete ptr; +} + +CVAPI(void) features2d_MSER_detectRegions( + cv::MSER *obj, cv::_InputArray *image, + std::vector > *msers, + std::vector *bboxes) +{ + obj->detectRegions(*image, *msers, *bboxes); +} + +CVAPI(cv::MSER*) features2d_Ptr_MSER_get(cv::Ptr *ptr) +{ + return ptr->get(); +} + +CVAPI(void) features2d_MSER_setDelta(cv::MSER *obj, int delta) +{ + obj->setDelta(delta); +} +CVAPI(int) features2d_MSER_getDelta(cv::MSER *obj) +{ + return obj->getDelta(); +} + +CVAPI(void) features2d_MSER_setMinArea(cv::MSER *obj, int minArea) +{ + obj->setMinArea(minArea); +} +CVAPI(int) features2d_MSER_getMinArea(cv::MSER *obj) +{ + return obj->getMinArea(); +} + +CVAPI(void) features2d_MSER_setMaxArea(cv::MSER *obj, int maxArea) +{ + obj->setMaxArea(maxArea); +} +CVAPI(int) features2d_MSER_getMaxArea(cv::MSER *obj) +{ + return obj->getMaxArea(); +} + +CVAPI(void) features2d_MSER_setPass2Only(cv::MSER *obj, int f) +{ + obj->setPass2Only(f != 0); +} +CVAPI(int) features2d_MSER_getPass2Only(cv::MSER *obj) +{ + return obj->getPass2Only() ? 1 : 0; +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/features2d_ORB.h b/src/OpenCvSharpExtern/features2d_ORB.h new file mode 100644 index 000000000..71a9339a5 --- /dev/null +++ b/src/OpenCvSharpExtern/features2d_ORB.h @@ -0,0 +1,107 @@ +#ifndef _CPP_FEATURES2D_ORB_H_ +#define _CPP_FEATURES2D_ORB_H_ + +#include "include_opencv.h" + + +CVAPI(cv::Ptr*) features2d_ORB_create( + int nFeatures, float scaleFactor, int nlevels, int edgeThreshold, + int firstLevel, int wtaK, int scoreType, int patchSize) +{ + cv::Ptr ptr = cv::ORB::create( + nFeatures, scaleFactor, nlevels, edgeThreshold, firstLevel, wtaK, scoreType, patchSize); + return new cv::Ptr(ptr); +} +CVAPI(void) features2d_Ptr_ORB_delete(cv::Ptr *ptr) +{ + delete ptr; +} + +CVAPI(cv::ORB*) features2d_Ptr_ORB_get(cv::Ptr *ptr) +{ + return ptr->get(); +} + + +CVAPI(void) features2d_ORB_setMaxFeatures(cv::ORB *obj, int val) +{ + obj->setMaxFeatures(val); +} +CVAPI(int) features2d_ORB_getMaxFeatures(cv::ORB *obj) +{ + return obj->getMaxFeatures(); +} + +CVAPI(void) features2d_ORB_setScaleFactor(cv::ORB *obj, double val) +{ + obj->setScaleFactor(val); +} +CVAPI(double) features2d_ORB_getScaleFactor(cv::ORB *obj) +{ + return obj->getScaleFactor(); +} + +CVAPI(void) features2d_ORB_setNLevels(cv::ORB *obj, int val) +{ + obj->setNLevels(val); +} +CVAPI(int) features2d_ORB_getNLevels(cv::ORB *obj) +{ + return obj->getNLevels(); +} + +CVAPI(void) features2d_ORB_setEdgeThreshold(cv::ORB *obj, int val) +{ + obj->setEdgeThreshold(val); +} +CVAPI(int) features2d_ORB_getEdgeThreshold(cv::ORB *obj) +{ + return obj->getEdgeThreshold(); +} + +CVAPI(void) features2d_ORB_setFirstLevel(cv::ORB *obj, int val) +{ + obj->setFirstLevel(val); +} +CVAPI(int) features2d_ORB_getFirstLevel(cv::ORB *obj) +{ + return obj->getFirstLevel(); +} + +CVAPI(void) features2d_ORB_setWTA_K(cv::ORB *obj, int val) +{ + obj->setWTA_K(val); +} +CVAPI(int) features2d_ORB_getWTA_K(cv::ORB *obj) +{ + return obj->getWTA_K(); +} + +CVAPI(void) features2d_ORB_setScoreType(cv::ORB *obj, int val) +{ + obj->setScoreType(val); +} +CVAPI(int) features2d_ORB_getScoreType(cv::ORB *obj) +{ + return obj->getScoreType(); +} + +CVAPI(void) features2d_ORB_setPatchSize(cv::ORB *obj, int val) +{ + obj->setPatchSize(val); +} +CVAPI(int) features2d_ORB_getPatchSize(cv::ORB *obj) +{ + return obj->getPatchSize(); +} + +CVAPI(void) features2d_ORB_setFastThreshold(cv::ORB *obj, int val) +{ + obj->setFastThreshold(val); +} +CVAPI(int) features2d_ORB_getFastThreshold(cv::ORB *obj) +{ + return obj->getFastThreshold(); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/features2d_SimpleBlobDetector.h b/src/OpenCvSharpExtern/features2d_SimpleBlobDetector.h new file mode 100644 index 000000000..d73d90a56 --- /dev/null +++ b/src/OpenCvSharpExtern/features2d_SimpleBlobDetector.h @@ -0,0 +1,69 @@ +#ifndef _CPP_FEATURES2D_SIMPLEBLOBDETECTOR_H_ +#define _CPP_FEATURES2D_SIMPLEBLOBDETECTOR_H_ + +#include "include_opencv.h" + + +struct SimpleBlobDetector_Params +{ + float thresholdStep; + float minThreshold; + float maxThreshold; + uint32 minRepeatability; // size_t + float minDistBetweenBlobs; + + int filterByColor; + uchar blobColor; + + int filterByArea; + float minArea, maxArea; + + int filterByCircularity; + float minCircularity, maxCircularity; + + int filterByInertia; + float minInertiaRatio, maxInertiaRatio; + + int filterByConvexity; + float minConvexity, maxConvexity; +}; + +CVAPI(cv::Ptr*) features2d_SimpleBlobDetector_create( + SimpleBlobDetector_Params *p) +{ + cv::SimpleBlobDetector::Params p2; + if (p != NULL) + { + p2.thresholdStep = p->thresholdStep; + p2.minThreshold = p->minThreshold; + p2.maxThreshold = p->maxThreshold; + p2.minRepeatability = (size_t)p->minRepeatability; + p2.minDistBetweenBlobs = p->minDistBetweenBlobs; + p2.filterByColor = p->filterByColor != 0; + p2.blobColor = p->blobColor; + p2.filterByArea = p->filterByArea != 0; + p2.minArea = p->minArea; + p2.maxArea = p->maxArea; + p2.filterByCircularity = p->filterByCircularity != 0; + p2.minCircularity = p->minCircularity; + p2.maxCircularity = p->maxCircularity; + p2.filterByInertia = p->filterByInertia != 0; + p2.minInertiaRatio = p->minInertiaRatio; + p2.maxInertiaRatio = p->maxInertiaRatio; + p2.filterByConvexity = p->filterByConvexity != 0; + p2.minConvexity = p->minConvexity; + p2.maxConvexity = p->maxConvexity; + } + cv::Ptr ptr = cv::SimpleBlobDetector::create(p2); + return new cv::Ptr(ptr); +} +CVAPI(void) features2d_Ptr_SimpleBlobDetector_delete(cv::Ptr *ptr) +{ + delete ptr; +} + +CVAPI(cv::SimpleBlobDetector*) features2d_Ptr_SimpleBlobDetector_get(cv::Ptr *ptr) +{ + return ptr->get(); +} +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/flann.cpp b/src/OpenCvSharpExtern/flann.cpp new file mode 100644 index 000000000..158a776ff --- /dev/null +++ b/src/OpenCvSharpExtern/flann.cpp @@ -0,0 +1 @@ +#include "flann.h" \ No newline at end of file diff --git a/src/OpenCvSharpExtern/flann.h b/src/OpenCvSharpExtern/flann.h new file mode 100644 index 000000000..429d65071 --- /dev/null +++ b/src/OpenCvSharpExtern/flann.h @@ -0,0 +1,281 @@ +#ifndef _CPP_FLANN_H_ +#define _CPP_FLANN_H_ + +#include "include_opencv.h" + +// cv::flann::Index + +CVAPI(cv::flann::Index*) flann_Index_new( + cv::_InputArray *features, cv::flann::IndexParams* params, cvflann::flann_distance_t distType) +{ + return new cv::flann::Index(*features, *params, distType); +} +CVAPI(void) flann_Index_delete(cv::flann::Index* obj) +{ + delete obj; +} +CVAPI(void) flann_Index_knnSearch1(cv::flann::Index* obj, float* queries, int queries_length, int* indices, float* dists, int knn, cv::flann::SearchParams* params) +{ + std::vector queries_vec(queries_length); + std::vector indices_vec(knn); + std::vector dists_vec(knn); + memcpy(&queries_vec[0], queries, sizeof(float) * queries_length); + obj->knnSearch(queries_vec, indices_vec, dists_vec, knn, *params); + memcpy(indices, &indices_vec[0], sizeof(int) * knn); + memcpy(dists, &dists_vec[0], sizeof(float) * knn); +} +CVAPI(void) flann_Index_knnSearch2(cv::flann::Index* obj, cv::Mat* queries, cv::Mat* indices, cv::Mat* dists, int knn, cv::flann::SearchParams* params) +{ + obj->knnSearch(*queries, *indices, *dists, knn, *params); +} +CVAPI(void) flann_Index_knnSearch3(cv::flann::Index* obj, cv::Mat* queries, int* indices, float* dists, int knn, cv::flann::SearchParams* params) +{ + cv::Mat indices_mat(1, knn, CV_32SC1); + cv::Mat dists_mat(1, knn, CV_32FC1); + obj->knnSearch(*queries, indices_mat, dists_mat, knn, *params); + memcpy(indices, indices_mat.ptr(0), sizeof(int) * knn); + memcpy(dists, dists_mat.ptr(0), sizeof(float) * knn); +} +CVAPI(void) flann_Index_radiusSearch1(cv::flann::Index* obj, float* queries, int queries_length, int* indices, int indices_length, float* dists, int dists_length, float radius, int maxResults, cv::flann::SearchParams* params) +{ + std::vector queries_vec(queries_length); + std::vector indices_vec(indices_length); + std::vector dists_vec(dists_length); + memcpy(&queries_vec[0], queries, sizeof(float) * queries_length); + obj->radiusSearch(queries_vec, indices_vec, dists_vec, radius, maxResults, *params); + memcpy(indices, &indices_vec[0], sizeof(int) * indices_length); + memcpy(dists, &dists_vec[0], sizeof(float) * dists_length); +} +CVAPI(void) flann_Index_radiusSearch2(cv::flann::Index* obj, cv::Mat* queries, cv::Mat* indices, cv::Mat* dists, float radius, int maxResults, cv::flann::SearchParams* params) +{ + obj->radiusSearch(*queries, *indices, *dists, radius, maxResults, *params); +} +CVAPI(void) flann_Index_radiusSearch3(cv::flann::Index* obj, cv::Mat* queries, int* indices, int indices_length, float* dists, int dists_length, float radius, int maxResults, cv::flann::SearchParams* params) +{ + cv::Mat indices_mat(1, indices_length, CV_32SC1); + cv::Mat dists_mat(1, dists_length, CV_32FC1); + obj->radiusSearch(*queries, indices_mat, dists_mat, radius, maxResults, *params); + memcpy(indices, indices_mat.ptr(0), sizeof(int) * indices_length); + memcpy(dists, dists_mat.ptr(0), sizeof(float) * dists_length); +} +CVAPI(void) flann_Index_save(cv::flann::Index* obj, const char* filename) +{ + std::string _filename(filename); + obj->save(_filename); +} +/* +CVAPI(int) flann_Index_veclen(cv::flann::Index* obj) +{ + return obj->veclen(); +} +CVAPI(int) flann_Index_size(cv::flann::Index* obj) +{ + return obj->size(); +} +//*/ + + +// cv::flann::IndexParams +CVAPI(cv::flann::IndexParams*) flann_IndexParams_new() +{ + return new cv::flann::IndexParams; +} +CVAPI(void) flann_IndexParams_delete(cv::flann::IndexParams *obj) +{ + delete obj; +} +CVAPI(void) flann_IndexParams_getString(cv::flann::IndexParams *obj, const char *key, const char *defaultVal, char *result) +{ + std::string defaultVal_; + if(defaultVal == NULL) + defaultVal_ = std::string(key); + else + defaultVal_ = std::string(); + std::string result_ = obj->getString(key, defaultVal_); + std::strcpy(result, result_.c_str()); +} +CVAPI(int) flann_IndexParams_getInt(cv::flann::IndexParams* obj, const char* key, int defaultVal) +{ + return obj->getInt(key, defaultVal); +} +CVAPI(double) flann_IndexParams_getDouble(cv::flann::IndexParams* obj, const char* key, double defaultVal) +{ + return obj->getDouble(key, defaultVal); +} + +CVAPI(void) flann_IndexParams_setString(cv::flann::IndexParams* obj, const char* key, const char* value) +{ + obj->setString(key, value); +} +CVAPI(void) flann_IndexParams_setInt(cv::flann::IndexParams* obj, const char* key, int value) +{ + obj->setInt(key, value); +} +CVAPI(void) flann_IndexParams_setDouble(cv::flann::IndexParams* obj, const char* key, double value) +{ + obj->setDouble(key, value); +} +CVAPI(void) flann_IndexParams_setFloat(cv::flann::IndexParams* obj, const char* key, float value) +{ + obj->setFloat(key, value); +} +CVAPI(void) flann_IndexParams_setBool(cv::flann::IndexParams* obj, const char* key, int value) +{ + obj->setBool(key, (value != 0)); +} +CVAPI(void) flann_IndexParams_setAlgorithm(cv::flann::IndexParams* obj, int value) +{ + obj->setAlgorithm(value); +} + + +// cv::flann::LinearIndexParams +CVAPI(cv::flann::LinearIndexParams*) flann_LinearIndexParams_new() +{ + return new cv::flann::LinearIndexParams(); +} +CVAPI(void) flann_LinearIndexParams_delete(cv::flann::LinearIndexParams* obj) +{ + delete obj; +} + +// cv::flann::KDTreeIndexParams +CVAPI(cv::flann::KDTreeIndexParams*) flann_KDTreeIndexParams_new(int trees) +{ + return new cv::flann::KDTreeIndexParams(trees); +} +CVAPI(void) flann_KDTreeIndexParams_delete(cv::flann::KDTreeIndexParams* obj) +{ + delete obj; +} +/* +CVAPI(int*) flann_KDTreeIndexParams_trees(cv::flann::KDTreeIndexParams* obj) +{ + return &obj->trees; +} +//*/ + +// cv::flann::KMeansIndexParams +CVAPI(cv::flann::KMeansIndexParams*) flann_KMeansIndexParams_new(int branching, int iterations, cvflann::flann_centers_init_t centers_init, float cb_index) +{ + return new cv::flann::KMeansIndexParams(branching, iterations, centers_init, cb_index); +} +CVAPI(void) flann_KMeansIndexParams_delete(cv::flann::KMeansIndexParams* obj) +{ + delete obj; +} +/* +CVAPI(int*) flann_KMeansIndexParams_branching(cv::flann::KMeansIndexParams* obj) +{ + return &obj->branching; +} +CVAPI(int*) flann_KMeansIndexParams_iterations(cv::flann::KMeansIndexParams* obj) +{ + return &obj->iterations; +} +CVAPI(flann_centers_init_t*) flann_KMeansIndexParams_centers_init(cv::flann::KMeansIndexParams* obj) +{ + return &obj->centers_init; +} +CVAPI(float*) flann_KMeansIndexParams_cb_index(cv::flann::KMeansIndexParams* obj) +{ + return &obj->cb_index; +} +//*/ + +// cv::flann::CompositeIndexParams +CVAPI(cv::flann::CompositeIndexParams*) flann_CompositeIndexParams_new(int trees, int branching, int iterations, cvflann::flann_centers_init_t centers_init, float cb_index) +{ + return new cv::flann::CompositeIndexParams(trees, branching, iterations, centers_init, cb_index); +} +CVAPI(void) flann_CompositeIndexParams_delete(cv::flann::CompositeIndexParams* obj) +{ + delete obj; +} +/* +CVAPI(int*) flann_CompositeIndexParams_trees(cv::flann::CompositeIndexParams* obj) +{ + return &obj->trees; +} +CVAPI(int*) flann_CompositeIndexParams_branching(cv::flann::CompositeIndexParams* obj) +{ + return &obj->branching; +} +CVAPI(int*) flann_CompositeIndexParams_iterations(cv::flann::CompositeIndexParams* obj) +{ + return &obj->iterations; +} +CVAPI(flann_centers_init_t*) flann_CompositeIndexParams_centers_init(cv::flann::CompositeIndexParams* obj) +{ + return &obj->centers_init; +} +CVAPI(float*) flann_CompositeIndexParams_cb_index(cv::flann::CompositeIndexParams* obj) +{ + return &obj->cb_index; +} +*/ +// cv::flann::AutotunedIndexParams +CVAPI(cv::flann::AutotunedIndexParams*) flann_AutotunedIndexParams_new(float target_precision = 0.9, float build_weight = 0.01, float memory_weight = 0, float sample_fraction = 0.1) +{ + return new cv::flann::AutotunedIndexParams(target_precision, build_weight, memory_weight, sample_fraction); +} +CVAPI(void) flann_AutotunedIndexParams_delete(cv::flann::AutotunedIndexParams* obj) +{ + delete obj; +} +/* +CVAPI(float*) flann_AutotunedIndexParams_target_precision(cv::flann::AutotunedIndexParams* obj) +{ + return &obj->target_precision; +} +CVAPI(float*) flann_AutotunedIndexParams_build_weight(cv::flann::AutotunedIndexParams* obj) +{ + return &obj->build_weight; +} +CVAPI(float*) flann_AutotunedIndexParams_memory_weight(cv::flann::AutotunedIndexParams* obj) +{ + return &obj->memory_weight; +} +CVAPI(float*) flann_AutotunedIndexParams_sample_fraction(cv::flann::AutotunedIndexParams* obj) +{ + return &obj->sample_fraction; +} +*/ + +// cv::flann::SavedIndexParams +CVAPI(cv::flann::SavedIndexParams*) flann_SavedIndexParams_new(const char* filename) +{ + return new cv::flann::SavedIndexParams(filename); +} +CVAPI(void) flann_SavedIndexParams_delete(cv::flann::SavedIndexParams* obj) +{ + delete obj; +} +/* +CVAPI(const char*) flann_SavedIndexParams_filename_get(cv::flann::SavedIndexParams* obj) +{ + return (obj->filename).c_str(); +} +CVAPI(void) flann_SavedIndexParams_filename_set(cv::flann::SavedIndexParams* obj, const char* filename) +{ + obj->filename.assign(filename); +} +*/ + +// cv::flann::SearchParams +CVAPI(cv::flann::SearchParams*) flann_SearchParams_new(int checks, float eps, int sorted) +{ + return new cv::flann::SearchParams(checks, eps, (sorted != 0)); +} +CVAPI(void) flann_SearchParams_delete(cv::flann::SearchParams* obj) +{ + delete obj; +} +/* +CVAPI(int) flann_hierarchicalClustering(Mat* features, Mat* centers, KMeansIndexParams* params) +{ + return cv::flann::hierarchicalClustering(*features, *centers, *params); +} +//*/ + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/gpu.cpp b/src/OpenCvSharpExtern/gpu.cpp new file mode 100644 index 000000000..aba4269c7 --- /dev/null +++ b/src/OpenCvSharpExtern/gpu.cpp @@ -0,0 +1,7 @@ +#include "gpu.h" +#include "gpu_GpuMat.h" +#include "gpu_CvMethods.h" +#include "gpu_HOGDescriptor.h" +#include "gpu_StereoBM_GPU.h" +#include "gpu_CascadeClassifier_GPU.h" +#include "gpu_MOG_GPU.h" diff --git a/src/OpenCvSharpExtern/highgui.cpp b/src/OpenCvSharpExtern/highgui.cpp new file mode 100644 index 000000000..bcf269486 --- /dev/null +++ b/src/OpenCvSharpExtern/highgui.cpp @@ -0,0 +1 @@ +#include "highgui.h" \ No newline at end of file diff --git a/src/OpenCvSharpExtern/highgui.h b/src/OpenCvSharpExtern/highgui.h new file mode 100644 index 000000000..dc099f2fe --- /dev/null +++ b/src/OpenCvSharpExtern/highgui.h @@ -0,0 +1,80 @@ +#ifndef _CPP_HIGHGUI_H_ +#define _CPP_HIGHGUI_H_ + +#include "include_opencv.h" + +CVAPI(void) highgui_namedWindow(const char *winname, int flags) +{ + cv::namedWindow(winname, flags); +} +CVAPI(void) highgui_destroyWindow(const char *winName) +{ + cv::destroyWindow(winName); +} +CVAPI(void) highgui_destroyAllWindows() +{ + cv::destroyAllWindows(); +} +CVAPI(void) highgui_imshow(const char *winname, cv::Mat *mat) +{ + cv::imshow(winname, *mat); +} + +CVAPI(int) highgui_startWindowThread() +{ + return cv::startWindowThread(); +} +CVAPI(int) highgui_waitKey(int delay) +{ + return cv::waitKey(delay); +} + +CVAPI(void) highgui_resizeWindow(const char *winName, int width, int height) +{ + cv::resizeWindow(winName, width, height); +} +CVAPI(void) highgui_moveWindow(const char *winName, int x, int y) +{ + cv::moveWindow(winName, x, y); +} + +CVAPI(void) highgui_setWindowProperty(const char *winName, int propId, double propValue) +{ + cv::setWindowProperty(winName, propId, propValue); +} + +CVAPI(void) highgui_setWindowTitle(const char *winname, const char *title) +{ + cv::setWindowTitle(winname, title); +} + +CVAPI(double) highgui_getWindowProperty(const char *winName, int propId) +{ + return cv::getWindowProperty(winName, propId); +} + +CVAPI(void) highgui_setMouseCallback(const char *winName, cv::MouseCallback onMouse, void* userData) +{ + cv::setMouseCallback(winName, onMouse, userData); +} +CVAPI(int) highgui_createTrackbar(const char *trackbarName, const char *winName, + int* value, int count, cv::TrackbarCallback onChange, void* userData) +{ + return cv::createTrackbar(trackbarName, winName, value, count, onChange, userData); +} +CVAPI(int) highgui_getTrackbarPos(const char *trackbarName, const char *winName) +{ + return cv::getTrackbarPos(trackbarName, winName); +} +CVAPI(void) highgui_setTrackbarPos(const char *trackbarName, const char *winName, int pos) +{ + cv::setTrackbarPos(trackbarName, winName, pos); +} + +CVAPI(int) highgui_createButton(const char *bar_name, cv::ButtonCallback on_change, + void* userdata, int type, int initial_button_state) +{ + return cv::createButton(bar_name, on_change, userdata, type, initial_button_state != 0); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/imgcodecs.cpp b/src/OpenCvSharpExtern/imgcodecs.cpp new file mode 100644 index 000000000..38d3df768 --- /dev/null +++ b/src/OpenCvSharpExtern/imgcodecs.cpp @@ -0,0 +1 @@ +#include "imgcodecs.h" \ No newline at end of file diff --git a/src/OpenCvSharpExtern/imgcodecs.h b/src/OpenCvSharpExtern/imgcodecs.h new file mode 100644 index 000000000..d42077f1d --- /dev/null +++ b/src/OpenCvSharpExtern/imgcodecs.h @@ -0,0 +1,73 @@ +#ifndef _CPP_IMGCODECS_H_ +#define _CPP_IMGCODECS_H_ + +#include "include_opencv.h" + +CVAPI(cv::Mat*) imgcodecs_imread(const char *filename, int flags) +{ + cv::Mat ret = cv::imread(filename, flags); + return new cv::Mat(ret); +} + +CVAPI(int) imgcodecs_imreadmulti(const char *filename, std::vector *mats, int flags) +{ + return cv::imreadmulti(filename, *mats, flags) ? 1 : 0; +} + +CVAPI(int) imgcodecs_imwrite(const char *filename, cv::Mat *img, int *params, int paramsLength) +{ + std::vector paramsVec; + paramsVec.assign(params, params + paramsLength); + return cv::imwrite(filename, *img, paramsVec) ? 1 : 0; +} + +CVAPI(cv::Mat*) imgcodecs_imdecode_Mat(cv::Mat *buf, int flags) +{ + cv::Mat ret = cv::imdecode(*buf, flags); + return new cv::Mat(ret); +} +CVAPI(cv::Mat*) imgcodecs_imdecode_vector(uchar *buf, size_t bufLength, int flags) +{ + std::vector bufVec(buf, buf + bufLength); + cv::Mat ret = cv::imdecode(bufVec, flags); + return new cv::Mat(ret); +} +CVAPI(cv::Mat*) imgcodecs_imdecode_InputArray(cv::_InputArray *buf, int flags) +{ + cv::Mat ret = cv::imdecode(*buf, flags); + return new cv::Mat(ret); +} + +CVAPI(int) imgcodecs_imencode_vector(const char *ext, cv::_InputArray *img, + std::vector *buf, int *params, int paramsLength) +{ + std::vector paramsVec; + if (params != NULL) + paramsVec = std::vector(params, params + paramsLength); + return cv::imencode(ext, *img, *buf, paramsVec) ? 1 : 0; +} + + + +CVAPI(void) imgcodecs_cvConvertImage_CvArr(CvArr *src, CvArr *dst, int flags) +{ + cvConvertImage(src, dst, flags); +} +CVAPI(void) imgcodecs_cvConvertImage_Mat(cv::Mat *src, cv::Mat *dst, int flags) +{ + IplImage srcImg = (IplImage)*src; + IplImage dstImg = (IplImage)*dst; + cvConvertImage(&srcImg, &dstImg, flags); +} + +CVAPI(int) imgcodecs_cvHaveImageReader(const char *filename) +{ + return cvHaveImageReader(filename); +} + +CVAPI(int) imgcodecs_cvHaveImageWriter(const char *filename) +{ + return cvHaveImageWriter(filename); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/imgproc.cpp b/src/OpenCvSharpExtern/imgproc.cpp new file mode 100644 index 000000000..ed9017ddd --- /dev/null +++ b/src/OpenCvSharpExtern/imgproc.cpp @@ -0,0 +1,6 @@ +#include "imgproc.h" +#include "imgproc_Subdiv2D.h" +#include "imgproc_CLAHE.h" +#include "imgproc_LineIterator.h" +#include "imgproc_LineSegmentDetector.h" +#include "imgproc_GeneralizedHough.h" \ No newline at end of file diff --git a/src/OpenCvSharpExtern/imgproc.h b/src/OpenCvSharpExtern/imgproc.h new file mode 100644 index 000000000..149c22b46 --- /dev/null +++ b/src/OpenCvSharpExtern/imgproc.h @@ -0,0 +1,949 @@ +#ifndef _CPP_IMGPROC_H_ +#define _CPP_IMGPROC_H_ + +#include "include_opencv.h" + +// ReSharper disable CppNonInlineFunctionDefinitionInHeaderFile + +CVAPI(cv::Mat*) imgproc_getGaussianKernel(int ksize, double sigma, int ktype) +{ + cv::Mat ret = cv::getGaussianKernel(ksize, sigma, ktype); + return new cv::Mat(ret); +} + +CVAPI(void) imgproc_getDerivKernels(cv::_OutputArray *kx, cv::_OutputArray *ky, + int dx, int dy, int ksize, int normalize, int ktype) +{ + cv::getDerivKernels(*kx, *ky, dx, dy, ksize, normalize != 0, ktype); +} + +CVAPI(cv::Mat*) imgproc_getGaborKernel(MyCvSize ksize, double sigma, double theta, + double lambd, double gamma, double psi, int ktype) +{ + cv::Mat ret = cv::getGaborKernel(cpp(ksize), sigma, theta, lambd, gamma, psi, ktype); + return new cv::Mat(ret); +} + +CVAPI(cv::Mat*) imgproc_getStructuringElement(int shape, MyCvSize ksize, MyCvPoint anchor) +{ + cv::Mat ret = cv::getStructuringElement(shape, cpp(ksize), cpp(anchor)); + return new cv::Mat(ret); +} + +CVAPI(void) imgproc_copyMakeBorder(cv::_InputArray *src, cv::_OutputArray *dst, + int top, int bottom, int left, int right, int borderType, MyCvScalar value) +{ + cv::copyMakeBorder(*src, *dst, top, bottom, left, right, borderType, cpp(value)); +} + +CVAPI(void) imgproc_medianBlur(cv::_InputArray *src, cv::_OutputArray *dst, int ksize) +{ + cv::medianBlur(*src, *dst, ksize); +} + +CVAPI(void) imgproc_GaussianBlur(cv::_InputArray *src, cv::_OutputArray *dst, + CvSize ksize, double sigmaX, double sigmaY, int borderType) +{ + cv::GaussianBlur(*src, *dst, ksize, sigmaX, sigmaY, borderType); +} + +CVAPI(void) imgproc_bilateralFilter(cv::_InputArray *src, cv::_OutputArray *dst, + int d, double sigmaColor, double sigmaSpace, int borderType) +{ + cv::bilateralFilter(*src, *dst, d, sigmaColor, sigmaSpace, borderType); +} + +/* +CVAPI(void) imgproc_adaptiveBilateralFilter(cv::_InputArray *src, cv::_OutputArray *dst, + CvSize ksize, double sigmaSpace, double maxSigmaColor, CvPoint anchor, int borderType) +{ + cv::adaptiveBilateralFilter(*src, *dst, ksize, sigmaSpace, maxSigmaColor, anchor, borderType); +}*/ + +CVAPI(void) imgproc_boxFilter(cv::_InputArray *src, cv::_OutputArray *dst, int ddepth, + CvSize ksize, CvPoint anchor, int normalize, int borderType) +{ + cv::boxFilter(*src, *dst, ddepth, ksize, anchor, normalize != 0, borderType); +} + +CVAPI(void) imgproc_blur(cv::_InputArray *src, cv::_OutputArray *dst, CvSize ksize, CvPoint anchor, int borderType) +{ + cv::blur(*src, *dst, ksize, anchor, borderType); +} + +CVAPI(void) imgproc_filter2D(cv::_InputArray *src, cv::_OutputArray *dst, int ddepth, + cv::_InputArray *kernel, CvPoint anchor, double delta, int borderType) +{ + cv::filter2D(*src, *dst, ddepth, *kernel, anchor, delta, borderType); +} + +CVAPI(void) imgproc_sepFilter2D(cv::_InputArray *src, cv::_OutputArray *dst, int ddepth, + cv::_InputArray *kernelX, cv::_InputArray *kernelY, + CvPoint anchor, double delta, int borderType) +{ + cv::sepFilter2D(*src, *dst, ddepth, *kernelX, *kernelY, anchor, delta, borderType); +} + +CVAPI(void) imgproc_Sobel(cv::_InputArray *src, cv::_OutputArray *dst, int ddepth, + int dx, int dy, int ksize, double scale, double delta, int borderType) +{ + cv::Sobel(*src, *dst, ddepth, dx, dy, ksize, scale, delta, borderType); +} + +CVAPI(void) imgproc_Scharr(cv::_InputArray *src, cv::_OutputArray *dst, int ddepth, + int dx, int dy, double scale, double delta, int borderType) +{ + cv::Scharr(*src, *dst, ddepth, dx, dy, scale, delta, borderType); +} + +CVAPI(void) imgproc_Laplacian(cv::_InputArray *src, cv::_OutputArray *dst, int ddepth, + int ksize, double scale, double delta, int borderType) +{ + cv::Laplacian(*src, *dst, ddepth, ksize, scale, delta, borderType); +} + +CVAPI(void) imgproc_Canny(cv::_InputArray *src, cv::_OutputArray *edges, + double threshold1, double threshold2, int apertureSize, int L2gradient) +{ + cv::Canny(*src, *edges, threshold1, threshold2, apertureSize, L2gradient != 0); +} + +CVAPI(void) imgproc_cornerMinEigenVal(cv::_InputArray *src, cv::_OutputArray *dst, + int blockSize, int ksize, int borderType) +{ + cv::cornerMinEigenVal(*src, *dst, blockSize, ksize, borderType); +} + +CVAPI(void) imgproc_cornerHarris(cv::_InputArray *src, cv::_OutputArray *dst, + int blockSize, int ksize, double k, int borderType) +{ + cv::cornerHarris(*src, *dst, blockSize, ksize, k, borderType); +} + +CVAPI(void) imgproc_cornerEigenValsAndVecs(cv::_InputArray *src, cv::_OutputArray *dst, + int blockSize, int ksize, int borderType) +{ + cv::cornerEigenValsAndVecs(*src, *dst, blockSize, ksize, borderType); +} + +CVAPI(void) imgproc_preCornerDetect(cv::_InputArray *src, cv::_OutputArray *dst, int ksize, int borderType) +{ + cv::preCornerDetect(*src, *dst, ksize, borderType); +} + +CVAPI(void) imgproc_cornerSubPix(cv::_InputArray *image, std::vector *corners, + CvSize winSize, CvSize zeroZone, CvTermCriteria criteria) +{ + cv::cornerSubPix(*image, *corners, winSize, zeroZone, criteria); +} + +CVAPI(void) imgproc_goodFeaturesToTrack(cv::_InputArray *src, std::vector *corners, + int maxCorners, double qualityLevel, double minDistance, + cv::_InputArray *mask, int blockSize, int useHarrisDetector, double k) +{ + cv::goodFeaturesToTrack(*src, *corners, maxCorners, qualityLevel, minDistance, entity(mask), blockSize, useHarrisDetector != 0, k); +} + +CVAPI(void) imgproc_HoughLines(cv::_InputArray *src, std::vector *lines, + double rho, double theta, int threshold, + double srn, double stn) +{ + cv::HoughLines(*src, *lines, rho, theta, threshold, srn, stn); +} + +CVAPI(void) imgproc_HoughLinesP(cv::_InputArray *src, std::vector *lines, + double rho, double theta, int threshold, + double minLineLength, double maxLineGap) +{ + cv::HoughLinesP(*src, *lines, rho, theta, threshold, minLineLength, maxLineGap); +} + +CVAPI(void) imgproc_HoughCircles(cv::_InputArray *src, std::vector *circles, + int method, double dp, double minDist, + double param1, double param2, int minRadius, int maxRadius) +{ + cv::HoughCircles(*src, *circles, method, dp, minDist, param1, param2, minRadius, maxRadius); +} + + +CVAPI(void) imgproc_erode(cv::_InputArray *src, cv::_OutputArray *dst, cv::_InputArray *kernel, + CvPoint anchor, int iterations, int borderType, CvScalar borderValue) +{ + cv::erode(*src, *dst, entity(kernel), anchor, iterations, borderType, borderValue); +} +CVAPI(void) imgproc_dilate(cv::_InputArray *src, cv::_OutputArray *dst, cv::_InputArray *kernel, + CvPoint anchor, int iterations, int borderType, CvScalar borderValue) +{ + cv::dilate(*src, *dst, entity(kernel), anchor, iterations, borderType, borderValue); +} +CVAPI(void) imgproc_morphologyEx(cv::_InputArray *src, cv::_OutputArray *dst, int op, cv::_InputArray *kernel, + CvPoint anchor, int iterations, int borderType, CvScalar borderValue) +{ + cv::morphologyEx(*src, *dst, op, entity(kernel), anchor, iterations, borderType, borderValue); +} + +CVAPI(void) imgproc_resize(cv::_InputArray* src, cv::_OutputArray* dst, CvSize dsize, double fx, double fy, int interpolation) +{ + cv::resize(*src, *dst, dsize, fx, fy, interpolation); +} + +CVAPI(void) imgproc_warpAffine(cv::_InputArray* src, cv::_OutputArray* dst, cv::_InputArray* M, CvSize dsize, + int flags, int borderMode, CvScalar borderValue) +{ + cv::warpAffine(*src, *dst, *M, dsize, flags, borderMode, borderValue); +} + +CVAPI(void) imgproc_warpPerspective_MisInputArray(cv::_InputArray* src, cv::_OutputArray* dst, cv::_InputArray* m, CvSize dsize, + int flags, int borderMode, CvScalar borderValue) +{ + cv::warpPerspective(*src, *dst, *m, dsize, flags, borderMode, borderValue); +} + +CVAPI(void) imgproc_warpPerspective_MisArray(cv::_InputArray* src, cv::_OutputArray* dst, float* m, int mRow, int mCol, CvSize dsize, + int flags, int borderMode, CvScalar borderValue) +{ + cv::Mat mmat(mRow, mCol, CV_32FC1, m); + cv::warpPerspective(*src, *dst, mmat, dsize, flags, borderMode, borderValue); +} + +CVAPI(void) imgproc_remap(cv::_InputArray* src, cv::_OutputArray* dst, cv::_InputArray* map1, cv::_InputArray* map2, + int interpolation, int borderMode, CvScalar borderValue) +{ + cv::remap(*src, *dst, *map1, *map2, interpolation, borderMode, borderValue); +} + +CVAPI(void) imgproc_convertMaps(cv::_InputArray* map1, cv::_InputArray* map2, cv::_OutputArray* dstmap1, cv::_OutputArray* dstmap2, + int dstmap1type, int nninterpolation) +{ + cv::convertMaps(*map1, *map2, *dstmap1, *dstmap2, dstmap1type, nninterpolation != 0); +} + +CVAPI(cv::Mat*) imgproc_getRotationMatrix2D(MyCvPoint2D32f center, double angle, double scale) +{ + cv::Mat ret = cv::getRotationMatrix2D(cpp(center), angle, scale); + return new cv::Mat(ret); + +} +CVAPI(void) imgproc_invertAffineTransform(cv::_InputArray* M, cv::_OutputArray *iM) +{ + cv::invertAffineTransform(*M, *iM); +} + +CVAPI(cv::Mat*) imgproc_getPerspectiveTransform1(cv::Point2f *src, cv::Point2f *dst) +{ + cv::Mat ret = cv::getPerspectiveTransform(src, dst); + return new cv::Mat(ret); +} +CVAPI(cv::Mat*) imgproc_getPerspectiveTransform2(cv::_InputArray *src, cv::_InputArray *dst) +{ + cv::Mat ret = cv::getPerspectiveTransform(*src, *dst); + return new cv::Mat(ret); +} + +CVAPI(cv::Mat*) imgproc_getAffineTransform1(cv::Point2f *src, cv::Point2f *dst) +{ + cv::Mat ret = cv::getAffineTransform(src, dst); + return new cv::Mat(ret); +} +CVAPI(cv::Mat*) imgproc_getAffineTransform2(cv::_InputArray *src, cv::_InputArray *dst) +{ + cv::Mat ret = cv::getAffineTransform(*src, *dst); + return new cv::Mat(ret); +} + +CVAPI(void) imgproc_getRectSubPix(cv::_InputArray *image, CvSize patchSize, MyCvPoint2D32f center, cv::_OutputArray *patch, int patchType) +{ + cv::getRectSubPix(*image, patchSize, cpp(center), *patch, patchType); +} + +CVAPI(void) imgproc_logPolar(cv::_InputArray *src, cv::_OutputArray *dst, + MyCvPoint2D32f center, double M, int flags) +{ + cv::logPolar(*src, *dst, cpp(center), M, flags); +} + +CVAPI(void) imgproc_linearPolar(cv::_InputArray *src, cv::_OutputArray *dst, + MyCvPoint2D32f center, double maxRadius, int flags) +{ + cv::linearPolar(*src, *dst, cpp(center), maxRadius, flags); +} + +CVAPI(void) imgproc_integral1(cv::_InputArray *src, cv::_OutputArray *sum, int sdepth) +{ + cv::integral(*src, *sum, sdepth); +} +CVAPI(void) imgproc_integral2(cv::_InputArray *src, cv::_OutputArray *sum, cv::_OutputArray *sqsum, int sdepth) +{ + cv::integral(*src, *sum, *sqsum, sdepth); +} +CVAPI(void) imgproc_integral3(cv::_InputArray *src, cv::_OutputArray *sum, cv::_OutputArray *sqsum, cv::_OutputArray *tilted, int sdepth) +{ + cv::integral(*src, *sum, *sqsum, *tilted, sdepth); +} + +CVAPI(void) imgproc_accumulate(cv::_InputArray *src, cv::_InputOutputArray *dst, cv::_InputArray *mask) +{ + cv::accumulate(*src, *dst, entity(mask)); +} +CVAPI(void) imgproc_accumulateSquare(cv::_InputArray* src, cv::_InputOutputArray *dst, cv::_InputArray *mask) +{ + cv::accumulateSquare(*src, *dst, entity(mask)); +} +CVAPI(void) imgproc_accumulateProduct(cv::_InputArray *src1, cv::_InputArray *src2, cv::_InputOutputArray *dst, cv::_InputArray *mask) +{ + cv::accumulateProduct(*src1, *src2, *dst, entity(mask)); +} +CVAPI(void) imgproc_accumulateWeighted(cv::_InputArray *src, cv::_InputOutputArray *dst, double alpha, cv::_InputArray *mask) +{ + cv::accumulateWeighted(*src, *dst, alpha, entity(mask)); +} + +CVAPI(double) imgproc_PSNR(cv::_InputArray *src1, cv::_InputArray *src2) +{ + return cv::PSNR(*src1, *src2); +} + +CVAPI(CvPoint2D64f) imgproc_phaseCorrelate(cv::_InputArray *src1, cv::_InputArray *src2, + cv::_InputArray *window) +{ + cv::Point2d p = cv::phaseCorrelate(*src1, *src2, entity(window)); + return cvPoint2D64f(p.x, p.y); +} +CVAPI(CvPoint2D64f) imgproc_phaseCorrelateRes(cv::_InputArray *src1, cv::_InputArray *src2, + cv::_InputArray *window, double* response) +{ + cv::Point2d p = cv::phaseCorrelate(*src1, *src2, *window, response); + return cvPoint2D64f(p.x, p.y); +} +CVAPI(void) imgproc_createHanningWindow(cv::_OutputArray *dst, CvSize winSize, int type) +{ + cv::createHanningWindow(*dst, winSize, type); +} + +CVAPI(double) imgproc_threshold(cv::_InputArray *src, cv::_OutputArray *dst, + double thresh, double maxval, int type) +{ + return cv::threshold(*src, *dst, thresh, maxval, type); +} +CVAPI(void) imgproc_adaptiveThreshold(cv::_InputArray *src, cv::_OutputArray *dst, + double maxValue, int adaptiveMethod, + int thresholdType, int blockSize, double C) +{ + cv::adaptiveThreshold(*src, *dst, maxValue, adaptiveMethod, thresholdType, blockSize, C); +} + +CVAPI(void) imgproc_pyrDown(cv::_InputArray *src, cv::_OutputArray *dst, CvSize dstsize, int borderType) +{ + cv::pyrDown(*src, *dst, dstsize, borderType); +} +CVAPI(void) imgproc_pyrUp(cv::_InputArray *src, cv::_OutputArray *dst, CvSize dstsize, int borderType) +{ + cv::pyrUp(*src, *dst, dstsize, borderType); +} + +CVAPI(void) imgproc_undistort(cv::_InputArray *src, cv::_OutputArray *dst, + cv::_InputArray *cameraMatrix, cv::_InputArray *distCoeffs, cv::_InputArray *newCameraMatrix) +{ + cv::undistort(*src, *dst, *cameraMatrix, entity(distCoeffs), entity(newCameraMatrix)); +} +CVAPI(void) imgproc_initUndistortRectifyMap(cv::_InputArray *cameraMatrix, cv::_InputArray *distCoeffs, + cv::_InputArray *r, cv::_InputArray *newCameraMatrix, CvSize size, int m1type, + cv::_OutputArray *map1, cv::_OutputArray *map2) +{ + cv::initUndistortRectifyMap(*cameraMatrix, *distCoeffs, *r, *newCameraMatrix, size, m1type, *map1, *map2); +} +CVAPI(float) imgproc_initWideAngleProjMap(cv::_InputArray *cameraMatrix, cv::_InputArray *distCoeffs, + CvSize imageSize, int destImageWidth, int m1type, cv::_OutputArray *map1, cv::_OutputArray *map2, int projType, double alpha) +{ + return cv::initWideAngleProjMap(*cameraMatrix, *distCoeffs, imageSize, destImageWidth, m1type, *map1, *map2, projType, alpha); +} +CVAPI(cv::Mat*) imgproc_getDefaultNewCameraMatrix(cv::_InputArray *cameraMatrix, CvSize imgSize, int centerPrincipalPoint) +{ + cv::Mat ret = cv::getDefaultNewCameraMatrix(*cameraMatrix, imgSize, centerPrincipalPoint != 0); + return new cv::Mat(ret); +} +CVAPI(void) imgproc_undistortPoints(cv::_InputArray *src, cv::_OutputArray *dst, + cv::_InputArray *cameraMatrix, cv::_InputArray *distCoeffs, + cv::_InputArray *R, cv::_InputArray *P) +{ + cv::undistortPoints(*src, *dst, *cameraMatrix, entity(distCoeffs), entity(R), entity(P)); +} +CVAPI(void) imgproc_calcHist1(cv::Mat **images, int nimages, + const int* channels, cv::_InputArray *mask, + cv::_OutputArray *hist, int dims, const int* histSize, + const float** ranges, int uniform, int accumulate) +{ + std::vector imagesVec(nimages); + for (int i = 0; i < nimages; i++) + imagesVec[i] = *(images[i]); + cv::calcHist(&imagesVec[0], nimages, channels, entity(mask), *hist, dims, histSize, ranges, uniform != 0, accumulate != 0); +} + +CVAPI(void) imgproc_calcBackProject(cv::Mat **images, int nimages, + const int* channels, cv::_InputArray *hist, cv::_OutputArray *backProject, + const float** ranges, int uniform) +{ + std::vector imagesVec(nimages); + for (int i = 0; i < nimages; i++) + imagesVec[i] = *(images[i]); + cv::calcBackProject(&imagesVec[0], nimages, channels, *hist, *backProject, ranges, uniform != 0); +} + + +CVAPI(double) imgproc_compareHist1(cv::_InputArray *h1, cv::_InputArray *h2, int method) +{ + return cv::compareHist(*h1, *h2, method); +} +CVAPI(void) imgproc_equalizeHist(cv::_InputArray *src, cv::_OutputArray *dst) +{ + cv::equalizeHist(*src, *dst); +} + +CVAPI(float) imgproc_EMD(cv::_InputArray *signature1, cv::_InputArray *signature2, + int distType, cv::_InputArray *cost, float* lowerBound, cv::_OutputArray *flow) +{ + return cv::EMD(*signature1, *signature2, distType, entity(cost), lowerBound, entity(flow)); +} +CVAPI(void) imgproc_watershed(cv::_InputArray *image, cv::_InputOutputArray *markers) +{ + cv::watershed(*image, *markers); +} +CVAPI(void) imgproc_pyrMeanShiftFiltering(cv::_InputArray *src, cv::_InputOutputArray *dst, + double sp, double sr, int maxLevel, CvTermCriteria termcrit) +{ + cv::pyrMeanShiftFiltering(*src, *dst, sp, sr, maxLevel, termcrit); +} +CVAPI(void) imgproc_grabCut(cv::_InputArray *img, cv::_InputOutputArray *mask, CvRect rect, + cv::_InputOutputArray *bgdModel, cv::_InputOutputArray *fgdModel, + int iterCount, int mode ) +{ + cv::grabCut(*img, *mask, rect, *bgdModel, *fgdModel, iterCount, mode); +} + +CVAPI(void) imgproc_distanceTransformWithLabels(cv::_InputArray *src, cv::_OutputArray *dst, + cv::_OutputArray *labels, int distanceType, int maskSize, + int labelType) +{ + cv::distanceTransform(*src, *dst, *labels, distanceType, maskSize, labelType); +} + +CVAPI(void) imgproc_distanceTransform(cv::_InputArray *src, cv::_OutputArray *dst, + int distanceType, int maskSize ) +{ + cv::distanceTransform(*src, *dst, distanceType, maskSize); +} + +CVAPI(int) imgproc_floodFill1(cv::_InputOutputArray *image, + MyCvPoint seedPoint, MyCvScalar newVal, MyCvRect *rect, + MyCvScalar loDiff, MyCvScalar upDiff, int flags) +{ + cv::Rect rect0; + int ret = cv::floodFill(*image, cpp(seedPoint), cpp(newVal), &rect0, cpp(loDiff), cpp(upDiff), flags); + *rect = c(rect0); + return ret; +} +CVAPI(int) imgproc_floodFill2(cv::_InputOutputArray *image, cv::_InputOutputArray *mask, + MyCvPoint seedPoint, MyCvScalar newVal, MyCvRect *rect, + MyCvScalar loDiff, MyCvScalar upDiff, int flags) +{ + cv::Rect rect0; + int ret = cv::floodFill(*image, *mask, cpp(seedPoint), cpp(newVal), &rect0, cpp(loDiff), cpp(upDiff), flags); + *rect = c(rect0); + return ret; +} + +CVAPI(void) imgproc_cvtColor(cv::_InputArray *src, cv::_OutputArray *dst, int code, int dstCn) +{ + cv::cvtColor(*src, *dst, code, dstCn); +} + +CVAPI(MyCvMoments) imgproc_moments(cv::_InputArray *arr, int binaryImage ) +{ + cv::Moments m = cv::moments(*arr, binaryImage != 0); + return c(m); +} + + +CVAPI(void) imgproc_matchTemplate(cv::_InputArray *image, cv::_InputArray *templ, + cv::_OutputArray *result, int method, cv::_InputArray *mask) +{ + cv::matchTemplate(*image, *templ, *result, method, entity(mask)); +} + +CVAPI(int) imgproc_connectedComponents(cv::_InputArray *image, cv::_OutputArray *labels, + int connectivity, int ltype) +{ + return cv::connectedComponents(entity(image), entity(labels), connectivity, ltype); +} + +CVAPI(int) imgproc_connectedComponentsWithStats(cv::_InputArray *image, cv::_OutputArray *labels, + cv::_OutputArray *stats, cv::_OutputArray *centroids, int connectivity, int ltype) +{ + return cv::connectedComponentsWithStats(entity(image), entity(labels), entity(stats), entity(centroids), connectivity, ltype); +} + +CVAPI(void) imgproc_findContours1_vector(cv::_InputOutputArray *image, std::vector > **contours, + std::vector **hierarchy, int mode, int method, MyCvPoint offset) +{ + *contours = new std::vector >; + *hierarchy = new std::vector; + cv::findContours(*image, **contours, **hierarchy, mode, method, cpp(offset)); +} +CVAPI(void) imgproc_findContours1_OutputArray(cv::_InputOutputArray *image, std::vector **contours, + cv::_OutputArray *hierarchy, int mode, int method, CvPoint offset) +{ + *contours = new std::vector; + cv::findContours(*image, **contours, *hierarchy, mode, method, offset); +} +CVAPI(void) imgproc_findContours2_vector(cv::_InputOutputArray *image, std::vector > **contours, + int mode, int method, CvPoint offset) +{ + *contours = new std::vector >; + cv::findContours(*image, **contours, mode, method, offset); +} +CVAPI(void) imgproc_findContours2_OutputArray(cv::_InputOutputArray *image, std::vector **contours, + int mode, int method, CvPoint offset) +{ + *contours = new std::vector; + cv::findContours(*image, **contours, mode, method, offset); +} + +CVAPI(void) imgproc_approxPolyDP_InputArray(cv::_InputArray *curve, cv::_OutputArray *approxCurve, double epsilon, int closed) +{ + cv::approxPolyDP(*curve, *approxCurve, epsilon, closed != 0); +} +CVAPI(void) imgproc_approxPolyDP_Point(cv::Point *curve, int curveLength, std::vector **approxCurve, double epsilon, int closed) +{ + cv::Mat_ curveMat(curveLength, 1, curve); + *approxCurve = new std::vector; + cv::approxPolyDP(curveMat, **approxCurve, epsilon, closed != 0); +} +CVAPI(void) imgproc_approxPolyDP_Point2f(cv::Point2f *curve, int curveLength, std::vector **approxCurve, double epsilon, int closed) +{ + cv::Mat_ curveMat(curveLength, 1, curve); + *approxCurve = new std::vector; + cv::approxPolyDP(curveMat, **approxCurve, epsilon, closed != 0); +} + +CVAPI(double) imgproc_arcLength_InputArray(cv::_InputArray *curve, int closed) +{ + return cv::arcLength(*curve, closed != 0); +} +CVAPI(double) imgproc_arcLength_Point(cv::Point *curve, int curveLength, int closed) +{ + cv::Mat_ curveMat(curveLength, 1, curve); + return cv::arcLength(curveMat, closed != 0); +} +CVAPI(double) imgproc_arcLength_Point2f(cv::Point2f *curve, int curveLength, int closed) +{ + cv::Mat_ curveMat(curveLength, 1, curve); + return cv::arcLength(curveMat, closed != 0); +} + +CVAPI(MyCvRect) imgproc_boundingRect_InputArray(cv::_InputArray *curve) +{ + return c(cv::boundingRect(*curve)); +} +CVAPI(MyCvRect) imgproc_boundingRect_Point(cv::Point *curve, int curveLength) +{ + cv::Mat_ curveMat(curveLength, 1, curve); + return c(cv::boundingRect(curveMat)); +} +CVAPI(MyCvRect) imgproc_boundingRect_Point2f(cv::Point2f *curve, int curveLength) +{ + cv::Mat_ curveMat(curveLength, 1, curve); + return c(cv::boundingRect(curveMat)); +} + +CVAPI(double) imgproc_contourArea_InputArray(cv::_InputArray *contour, int oriented) +{ + return cv::contourArea(*contour, oriented != 0); +} +CVAPI(double) imgproc_contourArea_Point(cv::Point *contour, int contourLength, int oriented) +{ + cv::Mat_ contourMat(contourLength, 1, contour); + return cv::contourArea(contourMat, oriented != 0); +} +CVAPI(double) imgproc_contourArea_Point2f(cv::Point2f *contour, int contourLength, int oriented) +{ + cv::Mat_ contourMat(contourLength, 1, contour); + return cv::contourArea(contourMat, oriented != 0); +} + +CVAPI(MyCvBox2D) imgproc_minAreaRect_InputArray(cv::_InputArray *points) +{ + return c(cv::minAreaRect(*points)); +} +CVAPI(MyCvBox2D) imgproc_minAreaRect_Point(cv::Point *points, int pointsLength) +{ + cv::Mat_ pointsMat(pointsLength, 1, points); + return c(cv::minAreaRect(pointsMat)); +} +CVAPI(MyCvBox2D) imgproc_minAreaRect_Point2f(cv::Point2f *points, int pointsLength) +{ + cv::Mat_ pointsMat(pointsLength, 1, points); + return c(cv::minAreaRect(pointsMat)); +} + +CVAPI(void) imgproc_minEnclosingCircle_InputArray(cv::_InputArray *points, cv::Point2f *center, float *radius) +{ + cv::Point2f center0; + float radius0; + cv::minEnclosingCircle(*points, center0, radius0); + *center = center0; + *radius = radius0; +} +CVAPI(void) imgproc_minEnclosingCircle_Point(cv::Point *points, int pointsLength, cv::Point2f *center, float *radius) +{ + cv::Mat_ pointsMat(pointsLength, 1, points); + cv::Point2f center0; + float radius0; + cv::minEnclosingCircle(pointsMat, center0, radius0); + *center = center0; + *radius = radius0; +} +CVAPI(void) imgproc_minEnclosingCircle_Point2f(cv::Point2f *points, int pointsLength, cv::Point2f *center, float *radius) +{ + cv::Mat_ pointsMat(pointsLength, 1, points); + cv::Point2f center0; + float radius0; + cv::minEnclosingCircle(pointsMat, center0, radius0); + *center = center0; + *radius = radius0; +} + +CVAPI(double) imgproc_matchShapes_InputArray(cv::_InputArray *contour1, cv::_InputArray *contour2, int method, double parameter) +{ + return cv::matchShapes(*contour1, *contour2, method, parameter); +} +CVAPI(double) imgproc_matchShapes_Point(cv::Point *contour1, int contour1Length, cv::Point *contour2, int contour2Length, + int method, double parameter) +{ + cv::Mat_ contour1Mat(contour1Length, 1, contour1); + cv::Mat_ contour2Mat(contour2Length, 1, contour2); + return cv::matchShapes(contour1Mat, contour2Mat, method, parameter); +} + +CVAPI(void) imgproc_convexHull_InputArray(cv::_InputArray *points, cv::_OutputArray *hull, int clockwise, int returnPoints) +{ + cv::convexHull(*points, *hull, clockwise != 0, returnPoints != 0); +} +CVAPI(void) imgproc_convexHull_Point_ReturnsPoints(cv::Point *points, int pointsLength, std::vector **hull, int clockwise) +{ + cv::Mat_ pointsMat(pointsLength, 1, points); + *hull = new std::vector; + cv::convexHull(pointsMat, **hull, clockwise != 0, true); +} +CVAPI(void) imgproc_convexHull_Point2f_ReturnsPoints(cv::Point2f *points, int pointsLength, std::vector **hull, int clockwise) +{ + cv::Mat_ pointsMat(pointsLength, 1, points); + *hull = new std::vector; + cv::convexHull(pointsMat, **hull, clockwise != 0, true); +} +CVAPI(void) imgproc_convexHull_Point_ReturnsIndices(cv::Point *points, int pointsLength, std::vector **hull, int clockwise) +{ + cv::Mat_ pointsMat(pointsLength, 1, points); + *hull = new std::vector; + cv::convexHull(pointsMat, **hull, clockwise != 0, false); +} +CVAPI(void) imgproc_convexHull_Point2f_ReturnsIndices(cv::Point2f *points, int pointsLength, std::vector **hull, int clockwise) +{ + cv::Mat_ pointsMat(pointsLength, 1, points); + *hull = new std::vector; + cv::convexHull(pointsMat, **hull, clockwise != 0, false); +} + +CVAPI(void) imgproc_convexityDefects_InputArray(cv::_InputArray *contour, cv::_InputArray *convexHull, + cv::_OutputArray *convexityDefects) +{ + cv::convexityDefects(*contour, *convexHull, *convexityDefects); +} +CVAPI(void) imgproc_convexityDefects_Point(cv::Point *contour, int contourLength, int *convexHull, int convexHullLength, + std::vector **convexityDefects) +{ + cv::Mat_ contourMat(contourLength, 1, contour); + cv::Mat_ convexHullMat(convexHullLength, 1, convexHull); + *convexityDefects = new std::vector; + cv::convexityDefects(contourMat, convexHullMat, **convexityDefects); +} +CVAPI(void) imgproc_convexityDefects_Point2f(cv::Point2f *contour, int contourLength, int *convexHull, int convexHullLength, + std::vector **convexityDefects) +{ + cv::Mat_ contourMat(contourLength, 1, contour); + cv::Mat_ convexHullMat(convexHullLength, 1, convexHull); + *convexityDefects = new std::vector; + cv::convexityDefects(contourMat, convexHullMat, **convexityDefects); +} + +CVAPI(int) imgproc_isContourConvex_InputArray(cv::_InputArray *contour) +{ + return cv::isContourConvex(*contour) ? 1 : 0; +} +CVAPI(int) imgproc_isContourConvex_Point(cv::Point *contour, int contourLength) +{ + cv::Mat_ contourMat(contourLength, 1, contour); + return cv::isContourConvex(contourMat) ? 1 : 0; +} +CVAPI(int) imgproc_isContourConvex_Point2f(cv::Point2f *contour, int contourLength) +{ + cv::Mat_ contourMat(contourLength, 1, contour); + return cv::isContourConvex(contourMat) ? 1 : 0; +} + +CVAPI(float) imgproc_intersectConvexConvex_InputArray(cv::_InputArray *p1, cv::_InputArray *p2, + cv::_OutputArray *p12, int handleNested) +{ + return cv::intersectConvexConvex(*p1, *p2, *p12, handleNested != 0); +} +CVAPI(float) imgproc_intersectConvexConvex_Point(cv::Point *p1, int p1Length, cv::Point *p2, int p2Length, + std::vector **p12, int handleNested) +{ + cv::Mat_ p1Vec(p1Length, 1, p1); + cv::Mat_ p2Vec(p2Length, 1, p2); + *p12 = new std::vector; + return cv::intersectConvexConvex(p1Vec, p2Vec, **p12, handleNested != 0); +} +CVAPI(float) imgproc_intersectConvexConvex_Point2f(cv::Point2f *p1, int p1Length, cv::Point2f *p2, int p2Length, + std::vector **p12, int handleNested) +{ + cv::Mat_ p1Vec(p1Length, 1, p1); + cv::Mat_ p2Vec(p2Length, 1, p2); + *p12 = new std::vector; + return cv::intersectConvexConvex(p1Vec, p2Vec, **p12, handleNested != 0); +} + +CVAPI(MyCvBox2D) imgproc_fitEllipse_InputArray(cv::_InputArray *points) +{ + return c(cv::fitEllipse(*points)); +} +CVAPI(MyCvBox2D) imgproc_fitEllipse_Point(cv::Point *points, int pointsLength) +{ + cv::Mat_ pointsVec(pointsLength, 1, points); + return c(cv::fitEllipse(pointsVec)); +} +CVAPI(MyCvBox2D) imgproc_fitEllipse_Point2f(cv::Point2f *points, int pointsLength) +{ + cv::Mat_ pointsVec(pointsLength, 1, points); + return c(cv::fitEllipse(pointsVec)); +} + +CVAPI(void) imgproc_fitLine_InputArray(cv::_InputArray *points, cv::_OutputArray *line, + int distType, double param, double reps, double aeps) +{ + cv::fitLine(*points, *line, distType, param, reps, aeps); +} +CVAPI(void) imgproc_fitLine_Point(cv::Point *points, int pointsLength, float *line, int distType, + double param, double reps, double aeps) +{ + cv::Mat_ pointsVec(pointsLength, 1, points); + cv::Mat_ lineVec(4, 1, line); + cv::fitLine(pointsVec, lineVec, distType, param, reps, aeps); +} +CVAPI(void) imgproc_fitLine_Point2f(cv::Point2f *points, int pointsLength, float *line, int distType, + double param, double reps, double aeps) +{ + cv::Mat_ pointsVec(pointsLength, 1, points); + cv::Mat_ lineVec(4, 1, line); + cv::fitLine(pointsVec, lineVec, distType, param, reps, aeps); +} +CVAPI(void) imgproc_fitLine_Point3i(cv::Point3i *points, int pointsLength, float *line, int distType, + double param, double reps, double aeps) +{ + cv::Mat_ pointsVec(pointsLength, 1, points); + cv::Mat_ lineVec(6, 1, line); + cv::fitLine(pointsVec, lineVec, distType, param, reps, aeps); +} +CVAPI(void) imgproc_fitLine_Point3f(cv::Point3f *points, int pointsLength, float *line, int distType, + double param, double reps, double aeps) +{ + cv::Mat_ pointsVec(pointsLength, 1, points); + cv::Mat_ lineVec(6, 1, line); + cv::fitLine(pointsVec, lineVec, distType, param, reps, aeps); +} + +CVAPI(double) imgproc_pointPolygonTest_InputArray(cv::_InputArray *contour, MyCvPoint2D32f pt, int measureDist) +{ + return cv::pointPolygonTest(*contour, cpp(pt), measureDist != 0); +} +CVAPI(double) imgproc_pointPolygonTest_Point(cv::Point *contour, int contourLength, MyCvPoint2D32f pt, int measureDist) +{ + cv::Mat_ contourVec(contourLength, 1, contour); + return cv::pointPolygonTest(contourVec, cpp(pt), measureDist != 0); +} +CVAPI(double) imgproc_pointPolygonTest_Point2f(cv::Point2f *contour, int contourLength, MyCvPoint2D32f pt, int measureDist) +{ + cv::Mat_ contourVec(contourLength, 1, contour); + return cv::pointPolygonTest(contourVec, cpp(pt), measureDist != 0); +} + +CVAPI(int) imgproc_rotatedRectangleIntersection_OutputArray( + MyCvBox2D rect1, MyCvBox2D rect2, cv::_OutputArray *intersectingRegion) +{ + return cv::rotatedRectangleIntersection(cpp(rect1), cpp(rect2), *intersectingRegion); +} +CVAPI(int) imgproc_rotatedRectangleIntersection_vector( + MyCvBox2D rect1, MyCvBox2D rect2, std::vector *intersectingRegion) +{ + return cv::rotatedRectangleIntersection(cpp(rect1), cpp(rect2), *intersectingRegion); +} + +CVAPI(void) imgproc_applyColorMap(cv::_InputArray *src, cv::_OutputArray *dst, int colormap) +{ + cv::applyColorMap(*src, *dst, colormap); +} + +#pragma region Drawing + +CVAPI(void) imgproc_line( + cv::_InputOutputArray *img, MyCvPoint pt1, MyCvPoint pt2, MyCvScalar color, + int thickness, int lineType, int shift) +{ + cv::line(*img, cpp(pt1), cpp(pt2), cpp(color), thickness, lineType, shift); +} + +CV_EXPORTS_W void imgproc_arrowedLine( + cv::_InputOutputArray *img, MyCvPoint pt1, MyCvPoint pt2, MyCvScalar color, + int thickness, int line_type, int shift, double tipLength) +{ + cv::arrowedLine(*img, cpp(pt1), cpp(pt2), cpp(color), thickness, line_type, shift, tipLength); +} + +CVAPI(void) imgproc_rectangle_InputOutputArray( + cv::_InputOutputArray *img, MyCvPoint pt1, MyCvPoint pt2, + MyCvScalar color, int thickness, int lineType, int shift) +{ + cv::rectangle(*img, cpp(pt1), cpp(pt2), cpp(color), thickness, shift); +} +CVAPI(void) imgproc_rectangle_Mat( + cv::Mat *img, MyCvRect rect, + MyCvScalar color, int thickness, int lineType, int shift) +{ + cv::rectangle(*img, cpp(rect), cpp(color), thickness, shift); +} + +CVAPI(void) imgproc_circle( + cv::_InputOutputArray *img, MyCvPoint center, int radius, + MyCvScalar color, int thickness, int lineType, int shift) +{ + cv::circle(*img, cpp(center), radius, cpp(color), thickness, lineType, shift); +} + +CVAPI(void) imgproc_ellipse1( + cv::_InputOutputArray *img, MyCvPoint center, MyCvSize axes, + double angle, double startAngle, double endAngle, + MyCvScalar color, int thickness, int lineType, int shift) +{ + cv::ellipse(*img, cpp(center), cpp(axes), angle, startAngle, endAngle, cpp(color), thickness, lineType, shift); +} +CVAPI(void) imgproc_ellipse2( + cv::_InputOutputArray *img, MyCvBox2D box, MyCvScalar color, int thickness, int lineType) +{ + cv::ellipse(*img, cpp(box), cpp(color), thickness, lineType); +} + +CVAPI(void) imgproc_fillConvexPoly_Mat( + cv::Mat *img, cv::Point *pts, int npts, MyCvScalar color, int lineType, int shift) +{ + cv::fillConvexPoly(*img, pts, npts, cpp(color), lineType, shift); +} +CVAPI(void) imgproc_fillConvexPoly_InputOutputArray( + cv::_InputOutputArray *img, cv::_InputArray *points, MyCvScalar color, int lineType, int shift) +{ + cv::fillConvexPoly(*img, *points, cpp(color), lineType, shift); +} + +CVAPI(void) imgproc_fillPoly_Mat(cv::Mat *img, const cv::Point **pts, const int *npts, + int ncontours, MyCvScalar color, int lineType, int shift, MyCvPoint offset) +{ + cv::fillPoly(*img, pts, npts, ncontours, cpp(color), lineType, shift, cpp(offset)); +} +CVAPI(void) imgproc_fillPoly_InputOutputArray(cv::_InputOutputArray *img, cv::_InputArray *pts, + MyCvScalar color, int lineType, int shift, MyCvPoint offset) +{ + cv::fillPoly(*img, *pts, cpp(color), lineType, shift, cpp(offset)); +} + +CVAPI(void) imgproc_polylines_Mat( + cv::Mat *img, const cv::Point **pts, const int *npts, + int ncontours, int isClosed, MyCvScalar color, + int thickness, int lineType, int shift) +{ + cv::polylines( + *img, pts, npts, ncontours, isClosed != 0, cpp(color), thickness, lineType, shift); +} +CVAPI(void) imgproc_polylines_InputOutputArray( + cv::_InputOutputArray *img, cv::_InputArray *pts, int isClosed, MyCvScalar color, + int thickness, int lineType, int shift) +{ + cv::polylines(*img, *pts, isClosed != 0, cpp(color), thickness, lineType, shift); +} + +CVAPI(void) imgproc_drawContours_vector(cv::_InputOutputArray *image, + cv::Point **contours, int contoursSize1, int *contoursSize2, + int contourIdx, MyCvScalar color, int thickness, int lineType, + cv::Vec4i *hierarchy, int hiearchyLength, int maxLevel, MyCvPoint offset) +{ + std::vector > contoursVec; + for (int i = 0; i < contoursSize1; i++) + { + std::vector c1(contours[i], contours[i] + contoursSize2[i]); + contoursVec.push_back(c1); + } + std::vector hiearchyVec; + if (hierarchy != NULL) + { + hiearchyVec = std::vector(hierarchy, hierarchy + hiearchyLength); + } + + cv::drawContours(*image, contoursVec, contourIdx, cpp(color), thickness, lineType, hiearchyVec, maxLevel, cpp(offset)); +} +CVAPI(void) imgproc_drawContours_InputArray(cv::_InputOutputArray *image, + cv::Mat **contours, int contoursLength, + int contourIdx, MyCvScalar color, int thickness, int lineType, + cv::_InputArray *hierarchy, int maxLevel, MyCvPoint offset) +{ + std::vector > contoursVec(contoursLength); + for (int i = 0; i < contoursLength; i++) + contoursVec[i] = *contours[i]; + cv::drawContours(*image, contoursVec, contourIdx, cpp(color), thickness, lineType, entity(hierarchy), maxLevel, cpp(offset)); +} + +CVAPI(int) imgproc_clipLine1(MyCvSize imgSize, MyCvPoint *pt1, MyCvPoint *pt2) +{ + cv::Point pt1c = cpp(*pt1), pt2c = cpp(*pt2); + bool result = cv::clipLine(cpp(imgSize), pt1c, pt2c); + *pt1 = c(pt1c); + *pt2 = c(pt2c); + return result ? 1 : 0; +} +CVAPI(int) imgproc_clipLine2(MyCvRect imgRect, MyCvPoint *pt1, MyCvPoint *pt2) +{ + cv::Point pt1c = cpp(*pt1), pt2c = cpp(*pt2); + bool result = cv::clipLine(cpp(imgRect), pt1c, pt2c); + *pt1 = c(pt1c); + *pt2 = c(pt2c); + return result ? 1 : 0; +} + +CVAPI(void) imgproc_ellipse2Poly(MyCvPoint center, MyCvSize axes, int angle, int arcStart, int arcEnd, + int delta, std::vector *pts) +{ + cv::ellipse2Poly(cpp(center), cpp(axes), angle, arcStart, arcEnd, delta, *pts); +} + +CVAPI(void) core_putText(cv::_InputOutputArray *img, const char *text, MyCvPoint org, + int fontFace, double fontScale, MyCvScalar color, + int thickness, int lineType, int bottomLeftOrigin) +{ + cv::putText(*img, text, cpp(org), fontFace, fontScale, cpp(color), thickness, lineType, bottomLeftOrigin != 0); +} + +CVAPI(MyCvSize) core_getTextSize(const char *text, int fontFace, + double fontScale, int thickness, int *baseLine) +{ + return c(cv::getTextSize(text, fontFace, fontScale, thickness, baseLine)); +} + +#pragma endregion + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/imgproc_CLAHE.h b/src/OpenCvSharpExtern/imgproc_CLAHE.h new file mode 100644 index 000000000..cec16e29a --- /dev/null +++ b/src/OpenCvSharpExtern/imgproc_CLAHE.h @@ -0,0 +1,54 @@ +#ifndef _CPP_IMGPROC_CLAHE_H_ +#define _CPP_IMGPROC_CLAHE_H_ + +#include "include_opencv.h" + + +CVAPI(cv::Ptr*) imgproc_createCLAHE(double clipLimit, MyCvSize tileGridSize) +{ + cv::Ptr ret = cv::createCLAHE(clipLimit, cpp(tileGridSize)); + return clone(ret); +} + +CVAPI(void) imgproc_Ptr_CLAHE_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(cv::CLAHE*) imgproc_Ptr_CLAHE_get(cv::Ptr *obj) +{ + return obj->get(); +} + + +CVAPI(void) imgproc_CLAHE_apply(cv::CLAHE *obj, cv::_InputArray *src, cv::_OutputArray *dst) +{ + obj->apply(*src, *dst); +} + +CVAPI(void) imgproc_CLAHE_setClipLimit(cv::CLAHE *obj, double clipLimit) +{ + obj->setClipLimit(clipLimit); +} + +CVAPI(double) imgproc_CLAHE_getClipLimit(cv::CLAHE *obj) +{ + return obj->getClipLimit(); +} + +CVAPI(void) imgproc_CLAHE_setTilesGridSize(cv::CLAHE *obj, MyCvSize tileGridSize) +{ + obj->setTilesGridSize(cpp(tileGridSize)); +} + +CVAPI(MyCvSize) imgproc_CLAHE_getTilesGridSize(cv::CLAHE *obj) +{ + return c(obj->getTilesGridSize()); +} + +CVAPI(void) imgproc_CLAHE_collectGarbage(cv::CLAHE *obj) +{ + obj->collectGarbage(); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/imgproc_GeneralizedHough.h b/src/OpenCvSharpExtern/imgproc_GeneralizedHough.h new file mode 100644 index 000000000..e4069561d --- /dev/null +++ b/src/OpenCvSharpExtern/imgproc_GeneralizedHough.h @@ -0,0 +1,238 @@ +#ifndef _CPP_IMGPROC_GENERALIZEDHOUGH_H_ +#define _CPP_IMGPROC_GENERALIZEDHOUGH_H_ + +#include "include_opencv.h" + +// GeneralizedHough + +CVAPI(void) imgproc_GeneralizedHough_setTemplate1( + cv::GeneralizedHough *obj, cv::_InputArray *templ, MyCvPoint templCenter) +{ + obj->setTemplate(*templ, cpp(templCenter)); +} +CVAPI(void) imgproc_GeneralizedHough_setTemplate2( + cv::GeneralizedHough *obj, cv::_InputArray *edges, cv::_InputArray *dx, cv::_InputArray *dy, MyCvPoint templCenter) +{ + obj->setTemplate(*edges, *dx, *dy, cpp(templCenter)); +} + +CVAPI(void) imgproc_GeneralizedHough_detect1( + cv::GeneralizedHough *obj, cv::_InputArray *image, cv::_OutputArray *positions, cv::_OutputArray *votes) +{ + obj->detect(*image, *positions, entity(votes)); +} +CVAPI(void) imgproc_GeneralizedHough_detect2( + cv::GeneralizedHough *obj, cv::_InputArray *edges, cv::_InputArray *dx, cv::_InputArray *dy, cv::_OutputArray *positions, cv::_OutputArray *votes) +{ + obj->detect(*edges, *dx, *dy, *positions, entity(votes)); +} + +CVAPI(void) imgproc_GeneralizedHough_setCannyLowThresh(cv::GeneralizedHough *obj, int val) +{ + obj->setCannyLowThresh(val); +} +CVAPI(int) imgproc_GeneralizedHough_getCannyLowThresh(cv::GeneralizedHough *obj) +{ + return obj->getCannyLowThresh(); +} + +CVAPI(void) imgproc_GeneralizedHough_setCannyHighThresh(cv::GeneralizedHough *obj, int val) +{ + obj->setCannyHighThresh(val); +} +CVAPI(int) imgproc_GeneralizedHough_getCannyHighThresh(cv::GeneralizedHough *obj) +{ + return obj->getCannyHighThresh(); +} + +CVAPI(void) imgproc_GeneralizedHough_setMinDist(cv::GeneralizedHough *obj, double val) +{ + obj->setMinDist(val); +} +CVAPI(double) imgproc_GeneralizedHough_getMinDist(cv::GeneralizedHough *obj) +{ + return obj->getMinDist(); +} + +CVAPI(void) imgproc_GeneralizedHough_setDp(cv::GeneralizedHough *obj, double val) +{ + obj->setDp(val); +} +CVAPI(double) imgproc_GeneralizedHough_getDp(cv::GeneralizedHough *obj) +{ + return obj->getDp(); +} + +CVAPI(void) imgproc_GeneralizedHough_setMaxBufferSize(cv::GeneralizedHough *obj, int val) +{ + obj->setMaxBufferSize(val); +} +CVAPI(int) imgproc_GeneralizedHough_getMaxBufferSize(cv::GeneralizedHough *obj) +{ + return obj->getMaxBufferSize(); +} + + +// GeneralizedHoughBallard + +CVAPI(cv::Ptr*) imgproc_createGeneralizedHoughBallard() +{ + cv::Ptr ptr = cv::createGeneralizedHoughBallard(); + return new cv::Ptr(ptr); +} +CVAPI(cv::GeneralizedHoughBallard*) imgproc_Ptr_GeneralizedHoughBallard_get( + cv::Ptr *obj) +{ + return obj->get(); +} +CVAPI(void) imgproc_Ptr_GeneralizedHoughBallard_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(void) imgproc_GeneralizedHoughBallard_setLevels(cv::GeneralizedHoughBallard *obj, int val) +{ + obj->setLevels(val); +} +CVAPI(int) imgproc_GeneralizedHoughBallard_getLevels(cv::GeneralizedHoughBallard *obj) +{ + return obj->getLevels(); +} + +CVAPI(void) imgproc_GeneralizedHoughBallard_setVotesThreshold(cv::GeneralizedHoughBallard *obj, int val) +{ + obj->setVotesThreshold(val); +} +CVAPI(int) imgproc_GeneralizedHoughBallard_getVotesThreshold(cv::GeneralizedHoughBallard *obj) +{ + return obj->getVotesThreshold(); +} + + +// GeneralizedHoughGuil + +CVAPI(cv::Ptr*) imgproc_createGeneralizedHoughGuil() +{ + cv::Ptr ptr = cv::createGeneralizedHoughGuil(); + return new cv::Ptr(ptr); +} +CVAPI(cv::GeneralizedHoughGuil*) imgproc_Ptr_GeneralizedHoughGuil_get( + cv::Ptr *obj) +{ + return obj->get(); +} +CVAPI(void) imgproc_Ptr_GeneralizedHoughGuil_delete(cv::Ptr *obj) +{ + delete obj; +} + + +CVAPI(void) imgproc_GeneralizedHoughGuil_setXi(cv::GeneralizedHoughGuil *obj, double val) +{ + obj->setXi(val); +} +CVAPI(double) imgproc_GeneralizedHoughGuil_getXi(cv::GeneralizedHoughGuil *obj) +{ + return obj->getXi(); +} + +CVAPI(void) imgproc_GeneralizedHoughGuil_setLevels(cv::GeneralizedHoughGuil *obj, int val) +{ + obj->setLevels(val); +} +CVAPI(int) imgproc_GeneralizedHoughGuil_getLevels(cv::GeneralizedHoughGuil *obj) +{ + return obj->getLevels(); +} + +CVAPI(void) imgproc_GeneralizedHoughGuil_setAngleEpsilon(cv::GeneralizedHoughGuil *obj, double val) +{ + obj->setAngleEpsilon(val); +} +CVAPI(double) imgproc_GeneralizedHoughGuil_getAngleEpsilon(cv::GeneralizedHoughGuil *obj) +{ + return obj->getAngleEpsilon(); +} + +CVAPI(void) imgproc_GeneralizedHoughGuil_setMinAngle(cv::GeneralizedHoughGuil *obj, double val) +{ + obj->setMinAngle(val); +} +CVAPI(double) imgproc_GeneralizedHoughGuil_getMinAngle(cv::GeneralizedHoughGuil *obj) +{ + return obj->getMinAngle(); +} + +CVAPI(void) imgproc_GeneralizedHoughGuil_setMaxAngle(cv::GeneralizedHoughGuil *obj, double val) +{ + obj->setMaxAngle(val); +} +CVAPI(double) imgproc_GeneralizedHoughGuil_getMaxAngle(cv::GeneralizedHoughGuil *obj) +{ + return obj->getMaxAngle(); +} + +CVAPI(void) imgproc_GeneralizedHoughGuil_setAngleStep(cv::GeneralizedHoughGuil *obj, double val) +{ + obj->setAngleStep(val); +} +CVAPI(double) imgproc_GeneralizedHoughGuil_getAngleStep(cv::GeneralizedHoughGuil *obj) +{ + return obj->getAngleStep(); +} + +CVAPI(void) imgproc_GeneralizedHoughGuil_setAngleThresh(cv::GeneralizedHoughGuil *obj, int val) +{ + obj->setAngleThresh(val); +} +CVAPI(int) imgproc_GeneralizedHoughGuil_getAngleThresh(cv::GeneralizedHoughGuil *obj) +{ + return obj->getAngleThresh(); +} + +CVAPI(void) imgproc_GeneralizedHoughGuil_setMinScale(cv::GeneralizedHoughGuil *obj, double val) +{ + obj->setMinScale(val); +} +CVAPI(double) imgproc_GeneralizedHoughGuil_getMinScale(cv::GeneralizedHoughGuil *obj) +{ + return obj->getMinScale(); +} + +CVAPI(void) imgproc_GeneralizedHoughGuil_setMaxScale(cv::GeneralizedHoughGuil *obj, double val) +{ + obj->setMaxScale(val); +} +CVAPI(double) imgproc_GeneralizedHoughGuil_getMaxScale(cv::GeneralizedHoughGuil *obj) +{ + return obj->getMaxScale(); +} + +CVAPI(void) imgproc_GeneralizedHoughGuil_setScaleStep(cv::GeneralizedHoughGuil *obj, double val) +{ + obj->setScaleStep(val); +} +CVAPI(double) imgproc_GeneralizedHoughGuil_getScaleStep(cv::GeneralizedHoughGuil *obj) +{ + return obj->getScaleStep(); +} + +CVAPI(void) imgproc_GeneralizedHoughGuil_setScaleThresh(cv::GeneralizedHoughGuil *obj, int val) +{ + obj->setScaleThresh(val); +} +CVAPI(int) imgproc_GeneralizedHoughGuil_getScaleThresh(cv::GeneralizedHoughGuil *obj) +{ + return obj->getScaleThresh(); +} + +CVAPI(void) imgproc_GeneralizedHoughGuil_setPosThresh(cv::GeneralizedHoughGuil *obj, int val) +{ + obj->setPosThresh(val); +} +CVAPI(int) imgproc_GeneralizedHoughGuil_getPosThresh(cv::GeneralizedHoughGuil *obj) +{ + return obj->getPosThresh(); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/imgproc_LineIterator.h b/src/OpenCvSharpExtern/imgproc_LineIterator.h new file mode 100644 index 000000000..313eb1432 --- /dev/null +++ b/src/OpenCvSharpExtern/imgproc_LineIterator.h @@ -0,0 +1,119 @@ +#ifndef _CPP_IMGPROC_LINEITERATOR_H_ +#define _CPP_IMGPROC_LINEITERATOR_H_ + +#include "include_opencv.h" + + +CVAPI(cv::LineIterator*) imgproc_LineIterator_new( + cv::Mat *img, MyCvPoint pt1, MyCvPoint pt2, int connectivity, int leftToRight) +{ + return new cv::LineIterator(*img, cpp(pt1), cpp(pt2), connectivity, leftToRight != 0); +} + +CVAPI(void) imgproc_LineIterator_delete(cv::LineIterator *obj) +{ + delete obj; +} + +CVAPI(uchar*) imgproc_LineIterator_operatorEntity(cv::LineIterator *obj) +{ + return **obj; +} + +CVAPI(void) imgproc_LineIterator_operatorPP(cv::LineIterator *obj) +{ + (*obj)++; +} + +CVAPI(MyCvPoint) imgproc_LineIterator_pos(cv::LineIterator *obj) +{ + return c(obj->pos()); +} + +CVAPI(uchar*) imgproc_LineIterator_ptr_get(cv::LineIterator *obj) +{ + return obj->ptr; +} +CVAPI(void) imgproc_LineIterator_ptr_set(cv::LineIterator *obj, uchar *val) +{ + obj->ptr = val; +} + +CVAPI(const uchar*) imgproc_LineIterator_ptr0_get(cv::LineIterator *obj) +{ + return obj->ptr0; +} + +CVAPI(int) imgproc_LineIterator_step_get(cv::LineIterator *obj) +{ + return obj->step; +} +CVAPI(void) imgproc_LineIterator_step_set(cv::LineIterator *obj, int val) +{ + obj->step = val; +} + +CVAPI(int) imgproc_LineIterator_elemSize_get(cv::LineIterator *obj) +{ + return obj->elemSize; +} +CVAPI(void) imgproc_LineIterator_elemSize_set(cv::LineIterator *obj, int val) +{ + obj->elemSize = val; +} + +CVAPI(int) imgproc_LineIterator_err_get(cv::LineIterator *obj) +{ + return obj->err; +} +CVAPI(void) imgproc_LineIterator_err_set(cv::LineIterator *obj, int val) +{ + obj->err = val; +} + +CVAPI(int) imgproc_LineIterator_count_get(cv::LineIterator *obj) +{ + return obj->count; +} +CVAPI(void) imgproc_LineIterator_count_set(cv::LineIterator *obj, int val) +{ + obj->count = val; +} + +CVAPI(int) imgproc_LineIterator_minusDelta_get(cv::LineIterator *obj) +{ + return obj->minusDelta; +} +CVAPI(void) imgproc_LineIterator_minusDelta_set(cv::LineIterator *obj, int val) +{ + obj->minusDelta = val; +} + +CVAPI(int) imgproc_LineIterator_plusDelta_get(cv::LineIterator *obj) +{ + return obj->plusDelta; +} +CVAPI(void) imgproc_LineIterator_plusDelta_set(cv::LineIterator *obj, int val) +{ + obj->plusDelta = val; +} + +CVAPI(int) imgproc_LineIterator_minusStep_get(cv::LineIterator *obj) +{ + return obj->minusStep; +} +CVAPI(void) imgproc_LineIterator_minusStep_set(cv::LineIterator *obj, int val) +{ + obj->minusStep = val; +} + +CVAPI(int) imgproc_LineIterator_plusStep_get(cv::LineIterator *obj) +{ + return obj->plusStep; +} +CVAPI(void) imgproc_LineIterator_plusStep_set(cv::LineIterator *obj, int val) +{ + obj->plusStep = val; +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/imgproc_LineSegmentDetector.h b/src/OpenCvSharpExtern/imgproc_LineSegmentDetector.h new file mode 100644 index 000000000..e2dd3ae64 --- /dev/null +++ b/src/OpenCvSharpExtern/imgproc_LineSegmentDetector.h @@ -0,0 +1,43 @@ +#ifndef _CPP_IMGPROC_LINESEGMENTDETECTOR_H_ +#define _CPP_IMGPROC_LINESEGMENTDETECTOR_H_ + +#include "include_opencv.h" + + +CVAPI(void) imgproc_LineSegmentDetector_detect(cv::LineSegmentDetector *obj, cv::_InputArray *image, cv::_OutputArray *lines, + cv::_OutputArray *width, cv::_OutputArray *prec, cv::_OutputArray *nfa) +{ + obj->detect(*image, *lines, entity(width), entity(prec), entity(nfa)); +} + +CVAPI(void) imgproc_LineSegmentDetector_drawSegments(cv::LineSegmentDetector *obj, cv::_InputOutputArray *image, cv::_InputArray *lines) +{ + obj->drawSegments(*image, *lines); +} + +CVAPI(int) imgproc_LineSegmentDetector_compareSegments(cv::LineSegmentDetector *obj, MyCvSize size, + cv::_InputArray *lines1, cv::_InputArray *lines2, cv::_InputOutputArray *image) +{ + return obj->compareSegments(cpp(size), *lines1, *lines2, entity(image)); +} + + +CVAPI(cv::Ptr*) imgproc_createLineSegmentDetector( + int refine, double scale, double sigma_scale, double quant, double ang_th, + double log_eps, double density_th, int n_bins) +{ + return clone( cv::createLineSegmentDetector( + refine, scale, sigma_scale, quant, ang_th, log_eps, density_th, n_bins)); +} + +CVAPI(void) imgproc_Ptr_LineSegmentDetector_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(cv::LineSegmentDetector*) imgproc_Ptr_LineSegmentDetector_get(cv::Ptr *obj) +{ + return obj->get(); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/imgproc_Subdiv2D.h b/src/OpenCvSharpExtern/imgproc_Subdiv2D.h new file mode 100644 index 000000000..61684737c --- /dev/null +++ b/src/OpenCvSharpExtern/imgproc_Subdiv2D.h @@ -0,0 +1,104 @@ +#ifndef _CPP_IMGPROC_SUBDIV2D_H_ +#define _CPP_IMGPROC_SUBDIV2D_H_ + +#include "include_opencv.h" + +CVAPI(cv::Subdiv2D*) imgproc_Subdiv2D_new1() +{ + return new cv::Subdiv2D(); +} +CVAPI(cv::Subdiv2D*) imgproc_Subdiv2D_new2(CvRect rect) +{ + return new cv::Subdiv2D(rect); +} +CVAPI(void) imgproc_Subdiv2D_delete(cv::Subdiv2D *obj) +{ + delete obj; +} + +CVAPI(void) imgproc_Subdiv2D_initDelaunay(cv::Subdiv2D *obj, CvRect rect) +{ + obj->initDelaunay(rect); +} +CVAPI(int) imgproc_Subdiv2D_insert1(cv::Subdiv2D *obj, CvPoint2D32f pt) +{ + return obj->insert(pt); +} +CVAPI(void) imgproc_Subdiv2D_insert2(cv::Subdiv2D *obj, CvPoint2D32f *ptArray, int length) +{ + std::vector ptvec(length); + for (int i = 0; i < length; i++) + { + ptvec[i] = ptArray[i]; + } + obj->insert(ptvec); +} +CVAPI(int) imgproc_Subdiv2D_locate(cv::Subdiv2D *obj, CvPoint2D32f pt, int *edge, int *vertex) +{ + return obj->locate(pt, *edge, *vertex); +} +CVAPI(int) imgproc_Subdiv2D_findNearest(cv::Subdiv2D *obj, CvPoint2D32f pt, CvPoint2D32f* nearestPt) +{ + cv::Point2f nearestPt0; + int ret = obj->findNearest(pt, &nearestPt0); + *nearestPt = nearestPt0; + return ret; +} +CVAPI(void) imgproc_Subdiv2D_getEdgeList(cv::Subdiv2D *obj, std::vector **edgeList) +{ + *edgeList = new std::vector(); + obj->getEdgeList(**edgeList); +} +CVAPI(void) imgproc_Subdiv2D_getTriangleList(cv::Subdiv2D *obj, std::vector **triangleList) +{ + *triangleList = new std::vector(); + obj->getTriangleList(**triangleList); +} +CVAPI(void) imgproc_Subdiv2D_getVoronoiFacetList(cv::Subdiv2D *obj, int *idx, int idxCount, + std::vector > **facetList, std::vector **facetCenters) +{ + std::vector idxVec; + if (idx != NULL) + idxVec = std::vector(idx, idx + idxCount); + *facetList = new std::vector >(); + *facetCenters = new std::vector(); + obj->getVoronoiFacetList(idxVec, **facetList, **facetCenters); +} + +CVAPI(MyCvPoint2D32f) imgproc_Subdiv2D_getVertex(cv::Subdiv2D *obj, int vertex, int* firstEdge) +{ + return c(obj->getVertex(vertex, firstEdge)); +} +CVAPI(int) imgproc_Subdiv2D_getEdge(cv::Subdiv2D *obj, int edge, int nextEdgeType) +{ + return obj->getEdge(edge, nextEdgeType); +} +CVAPI(int) imgproc_Subdiv2D_nextEdge(cv::Subdiv2D *obj, int edge) +{ + return obj->nextEdge(edge); +} +CVAPI(int) imgproc_Subdiv2D_rotateEdge(cv::Subdiv2D *obj, int edge, int rotate) +{ + return obj->rotateEdge(edge, rotate); +} +CVAPI(int) imgproc_Subdiv2D_symEdge(cv::Subdiv2D *obj, int edge) +{ + return obj->symEdge(edge); +} +CVAPI(int) imgproc_Subdiv2D_edgeOrg(cv::Subdiv2D *obj, int edge, CvPoint2D32f *orgpt) +{ + cv::Point2f orgpt0; + int ret = obj->edgeOrg(edge, &orgpt0); + *orgpt = orgpt0; + return ret; +} +CVAPI(int) imgproc_Subdiv2D_edgeDst(cv::Subdiv2D *obj, int edge, CvPoint2D32f *dstpt) +{ + cv::Point2f dstpt0; + int ret = obj->edgeDst(edge, &dstpt0); + *dstpt = dstpt0; + return ret; +} + + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/include_opencv.h b/src/OpenCvSharpExtern/include_opencv.h new file mode 100644 index 000000000..1f8024230 --- /dev/null +++ b/src/OpenCvSharpExtern/include_opencv.h @@ -0,0 +1,51 @@ +#ifndef _INCLUDE_OPENCV_H_ +#define _INCLUDE_OPENCV_H_ + +#define ENABLED_CONTRIB +#undef ENABLED_CONTRIB + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 4251) +#pragma warning(disable: 4996) +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// opencv_contrib +#ifdef ENABLED_CONTRIB +#include +#include +#include +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +// Additional types +#include "my_types.h" + +// Additional functions +#include "my_functions.h" + +#endif diff --git a/src/OpenCvSharpExtern/ml.cpp b/src/OpenCvSharpExtern/ml.cpp new file mode 100644 index 000000000..b6a88f4cb --- /dev/null +++ b/src/OpenCvSharpExtern/ml.cpp @@ -0,0 +1,11 @@ +#include "ml.h" + +#include "ml_StatModel.h" +#include "ml_ANN_MLP.h" +#include "ml_Boost.h" +//#include "ml_DTrees.h" +#include "ml_EM.h" +#include "ml_KNearest.h" +#include "ml_NormalBayesClassifier.h" +//#include "ml_RTrees.h" +#include "ml_SVM.h" diff --git a/src/OpenCvSharpExtern/ml.h b/src/OpenCvSharpExtern/ml.h new file mode 100644 index 000000000..707931381 --- /dev/null +++ b/src/OpenCvSharpExtern/ml.h @@ -0,0 +1,29 @@ +#ifndef _CPP_ML_H_ +#define _CPP_ML_H_ + +#include "include_opencv.h" + +extern "C" +{ + typedef struct ParamGridStruct + { + double minVal; + double maxVal; + double logStep; + } ParamGridStruct; +} + +static inline ParamGridStruct c(cv::ml::ParamGrid obj) +{ + ParamGridStruct ret; + ret.minVal = obj.minVal; + ret.maxVal = obj.maxVal; + ret.logStep = obj.logStep; + return ret; +} +static inline cv::ml::ParamGrid cpp(ParamGridStruct obj) +{ + return cv::ml::ParamGrid(obj.minVal, obj.maxVal, obj.logStep); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/ml_ANN_MLP.h b/src/OpenCvSharpExtern/ml_ANN_MLP.h new file mode 100644 index 000000000..8aeaf7262 --- /dev/null +++ b/src/OpenCvSharpExtern/ml_ANN_MLP.h @@ -0,0 +1,128 @@ +#ifndef _CPP_ML_ANN_MLP_H_ +#define _CPP_ML_ANN_MLP_H_ + +#include "include_opencv.h" +using namespace cv::ml; + + +CVAPI(void) ml_ANN_MLP_setTrainMethod(ANN_MLP *obj, int method, double param1, double param2) +{ + obj->setTrainMethod(method, param1, param2); +} + +CVAPI(int) ml_ANN_MLP_getTrainMethod(ANN_MLP *obj) +{ + return obj->getTrainMethod(); +} + +CVAPI(void) ml_ANN_MLP_setActivationFunction(ANN_MLP *obj, int type, double param1, double param2) +{ + obj->setActivationFunction(type, param1, param2); +} + +CVAPI(void) ml_ANN_MLP_setLayerSizes(ANN_MLP *obj, cv::_InputArray *_layer_sizes) +{ + obj->setLayerSizes(entity(_layer_sizes)); +} + +CVAPI(cv::Mat*) ml_ANN_MLP_getLayerSizes(ANN_MLP *obj) +{ + return new cv::Mat(obj->getLayerSizes()); +} + + +CVAPI(MyCvTermCriteria) ml_ANN_MLP_getTermCriteria(ANN_MLP *obj) +{ + return c(obj->getTermCriteria()); +} +CVAPI(void) ml_ANN_MLP_setTermCriteria(ANN_MLP *obj, MyCvTermCriteria val) +{ + obj->setTermCriteria(cpp(val)); +} + +CVAPI(double) ml_ANN_MLP_getBackpropWeightScale(ANN_MLP *obj) +{ + return obj->getBackpropWeightScale(); +} +CVAPI(void) ml_ANN_MLP_setBackpropWeightScale(ANN_MLP *obj, double val) +{ + obj->setBackpropWeightScale(val); +} + +CVAPI(double) ml_ANN_MLP_getBackpropMomentumScale(ANN_MLP *obj) +{ + return obj->getBackpropMomentumScale(); +} +CVAPI(void) ml_ANN_MLP_setBackpropMomentumScale(ANN_MLP *obj, double val) +{ + obj->setBackpropMomentumScale(val); +} + +CVAPI(double) ml_ANN_MLP_getRpropDW0(ANN_MLP *obj) +{ + return obj->getRpropDW0(); +} +CVAPI(void) ml_ANN_MLP_setRpropDW0(ANN_MLP *obj, double val) +{ + obj->setRpropDW0(val); +} + +CVAPI(double) ml_ANN_MLP_getRpropDWPlus(ANN_MLP *obj) +{ + return obj->getRpropDWPlus(); +} +CVAPI(void) ml_ANN_MLP_setRpropDWPlus(ANN_MLP *obj, double val) +{ + obj->setRpropDWPlus(val); +} + +CVAPI(double) ml_ANN_MLP_getRpropDWMinus(ANN_MLP *obj) +{ + return obj->getRpropDWMinus(); +} +CVAPI(void) ml_ANN_MLP_setRpropDWMinus(ANN_MLP *obj, double val) +{ + obj->setRpropDWMinus(val); +} + +CVAPI(double) ml_ANN_MLP_getRpropDWMin(ANN_MLP *obj) +{ + return obj->getRpropDWMin(); +} +CVAPI(void) ml_ANN_MLP_setRpropDWMin(ANN_MLP *obj, double val) +{ + obj->setRpropDWMin(val); +} + +CVAPI(double) ml_ANN_MLP_getRpropDWMax(ANN_MLP *obj) +{ + return obj->getRpropDWMax(); +} +CVAPI(void) ml_ANN_MLP_setRpropDWMax(ANN_MLP *obj, double val) +{ + obj->setRpropDWMax(val); +} + +CVAPI(cv::Mat*) ml_ANN_MLP_getWeights(ANN_MLP *obj, int layerIdx) +{ + return new cv::Mat(obj->getWeights(layerIdx)); +} + + +CVAPI(cv::Ptr*) ml_ANN_MLP_create() +{ + cv::Ptr ptr = ANN_MLP::create(); + return new cv::Ptr(ptr); +} + +CVAPI(void) ml_Ptr_ANN_MLP_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(ANN_MLP*) ml_Ptr_ANN_MLP_get(cv::Ptr *obj) +{ + return obj->get(); +} + +#endif diff --git a/src/OpenCvSharpExtern/ml_Boost.h b/src/OpenCvSharpExtern/ml_Boost.h new file mode 100644 index 000000000..cddda0e34 --- /dev/null +++ b/src/OpenCvSharpExtern/ml_Boost.h @@ -0,0 +1,52 @@ +#ifndef _CPP_ML_BOOST_H_ +#define _CPP_ML_BOOST_H_ + +#include "include_opencv.h" +using namespace cv::ml; + + +CVAPI(int) ml_Boost_getBoostType(Boost *obj) +{ + return obj->getBoostType(); +} +CVAPI(void) ml_Boost_setBoostType(Boost *obj, int val) +{ + obj->setBoostType(val); +} + +CVAPI(int) ml_Boost_getWeakCount(Boost *obj) +{ + return obj->getWeakCount(); +} +CVAPI(void) ml_Boost_setWeakCount(Boost *obj, int val) +{ + obj->setWeakCount(val); +} + +CVAPI(double) ml_Boost_getWeightTrimRate(Boost *obj) +{ + return obj->getWeightTrimRate(); +} +CVAPI(void) ml_Boost_setWeightTrimRate(Boost *obj, double val) +{ + obj->setWeightTrimRate(val); +} + + +CVAPI(cv::Ptr*) ml_Boost_create() +{ + cv::Ptr ptr = Boost::create(); + return new cv::Ptr(ptr); +} + +CVAPI(void) ml_Ptr_Boost_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(Boost*) ml_Ptr_Boost_get(cv::Ptr* obj) +{ + return obj->get(); +} + +#endif diff --git a/src/OpenCvSharpExtern/ml_DTree.h b/src/OpenCvSharpExtern/ml_DTree.h new file mode 100644 index 000000000..eafeeb29a --- /dev/null +++ b/src/OpenCvSharpExtern/ml_DTree.h @@ -0,0 +1,226 @@ +#ifndef _CPP_ML_DTREE_H_ +#define _CPP_ML_DTREE_H_ + +#include "include_opencv.h" +#include "ml.h" +using namespace cv::ml; + + +extern "C" +{ + typedef struct DTrees_Node + { + double value; + int classIdx; + int parent; + int left; + int right; + int defaultDir; + int split; + } DTrees_Node; + + typedef struct DTrees_Split + { + int varIdx; + int inversed; // bool + float quality; + int next; + float c; + int subsetOfs; + } DTrees_Split; +} + +static inline DTrees_Node c(DTrees::Node obj) +{ + DTrees_Node ret; + ret.value = obj.value; + ret.classIdx = obj.classIdx; + ret.parent = obj.parent; + ret.left = obj.left; + ret.right = obj.right; + ret.defaultDir = obj.defaultDir; + ret.split = obj.split; + return ret; +} +static inline DTrees::Node cpp(DTrees_Node obj) +{ + DTrees::Node ret; + ret.value = obj.value; + ret.classIdx = obj.classIdx; + ret.parent = obj.parent; + ret.left = obj.left; + ret.right = obj.right; + ret.defaultDir = obj.defaultDir; + ret.split = obj.split; + return ret; +} + +static inline DTrees_Split c(DTrees::Split obj) +{ + DTrees_Split ret; + ret.varIdx = obj.varIdx; + ret.inversed = obj.inversed ? 1 : 0; + ret.quality = obj.quality; + ret.next = obj.next; + ret.c = obj.c; + ret.subsetOfs = obj.subsetOfs; + return ret; +} +static inline DTrees::Split cpp(DTrees_Split obj) +{ + DTrees::Split ret; + ret.varIdx = obj.varIdx; + ret.inversed = obj.inversed != 0; + ret.quality = obj.quality; + ret.next = obj.next; + ret.c = obj.c; + ret.subsetOfs = obj.subsetOfs; + return ret; +} + + +CVAPI(int) ml_DTrees_getMaxCategories(DTrees *obj) +{ + return obj->getMaxCategories(); +} +CVAPI(void) ml_DTrees_setMaxCategories(DTrees *obj, int val) +{ + return obj->setMaxCategories(val); +} + +CVAPI(int) ml_DTrees_getMaxDepth(DTrees *obj) +{ + return obj->getMaxDepth(); +} +CVAPI(void) ml_DTrees_setMaxDepth(DTrees *obj, int val) +{ + return obj->setMaxDepth(val); +} + +CVAPI(int) ml_DTrees_getMinSampleCount(DTrees *obj) +{ + return obj->getMinSampleCount(); +} +CVAPI(void) ml_DTrees_setMinSampleCount(DTrees *obj, int val) +{ + return obj->setMinSampleCount(val); +} + +CVAPI(int) ml_DTrees_getCVFolds(DTrees *obj) +{ + return obj->getCVFolds(); +} +CVAPI(void) ml_DTrees_setCVFolds(DTrees *obj, int val) +{ + return obj->setCVFolds(val); +} + +CVAPI(int) ml_DTrees_getUseSurrogates(DTrees *obj) +{ + return obj->getUseSurrogates() ? 1 : 0; +} +CVAPI(void) ml_DTrees_setUseSurrogates(DTrees *obj, int val) +{ + return obj->setUseSurrogates(val != 0); +} + +CVAPI(int) ml_DTrees_getUse1SERule(DTrees *obj) +{ + return obj->getUse1SERule() ? 1 : 0; +} +CVAPI(void) ml_DTrees_setUse1SERule(DTrees *obj, int val) +{ + return obj->setUse1SERule(val != 0); +} + +CVAPI(int) ml_DTrees_getTruncatePrunedTree(DTrees *obj) +{ + return obj->getTruncatePrunedTree() ? 1 : 0; +} +CVAPI(void) ml_DTrees_setTruncatePrunedTree(DTrees *obj, int val) +{ + return obj->setTruncatePrunedTree(val != 0); +} + +CVAPI(float) ml_DTrees_getRegressionAccuracy(DTrees *obj) +{ + return obj->getRegressionAccuracy(); +} +CVAPI(void) ml_DTrees_setRegressionAccuracy(DTrees *obj, float val) +{ + return obj->setRegressionAccuracy(val); +} + +CVAPI(cv::Mat*) ml_DTrees_getPriors(DTrees *obj) +{ + cv::Mat m = obj->getPriors(); + return new cv::Mat(m); +} +CVAPI(void) ml_DTrees_setPriors(DTrees *obj, cv::Mat *val) +{ + obj->setPriors(*val); +} + + +CVAPI(void) ml_DTrees_getRoots(DTrees *obj, std::vector *result) +{ + const std::vector &org = obj->getRoots(); + + result->clear(); + for (size_t i = 0; i < org.size(); i++) + { + result->push_back(org[i]); + } +} + +CVAPI(void) ml_DTrees_getNodes(DTrees *obj, std::vector *result) +{ + const std::vector &org = obj->getNodes(); + + result->clear(); + for (size_t i = 0; i < org.size(); i++) + { + result->push_back(c(org[i])); + } +} + +CVAPI(void) ml_DTrees_getSplits(DTrees *obj, std::vector *result) +{ + const std::vector &org = obj->getSplits(); + + result->clear(); + for (size_t i = 0; i < org.size(); i++) + { + result->push_back(c(org[i])); + } +} + +CVAPI(void) ml_DTrees_getSubsets(DTrees *obj, std::vector *result) +{ + const std::vector &org = obj->getSubsets(); + + result->clear(); + for (size_t i = 0; i < org.size(); i++) + { + result->push_back(org[i]); + } +} + + +CVAPI(cv::Ptr*) ml_DTrees_create() +{ + cv::Ptr ptr = DTrees::create(); + return new cv::Ptr(ptr); +} + +CVAPI(void) ml_Ptr_DTrees_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(DTrees*) ml_Ptr_DTrees_get(cv::Ptr *obj) +{ + return obj->get(); +} + +#endif diff --git a/src/OpenCvSharpExtern/ml_EM.h b/src/OpenCvSharpExtern/ml_EM.h new file mode 100644 index 000000000..2e50a30f9 --- /dev/null +++ b/src/OpenCvSharpExtern/ml_EM.h @@ -0,0 +1,126 @@ +#ifndef _CPP_ML_EM_H_ +#define _CPP_ML_EM_H_ + +#include "include_opencv.h" +using namespace cv::ml; + + +CVAPI(int) ml_EM_getClustersNumber(EM *obj) +{ + return obj->getClustersNumber(); +} +CVAPI(void) ml_EM_setClustersNumber(EM *obj, int val) +{ + obj->setClustersNumber(val); +} + +CVAPI(int) ml_EM_getCovarianceMatrixType(EM *obj) +{ + return obj->getCovarianceMatrixType(); +} +CVAPI(void) ml_EM_setCovarianceMatrixType(EM *obj, int val) +{ + obj->setCovarianceMatrixType(val); +} + +CVAPI(MyCvTermCriteria) ml_EM_getTermCriteria(EM *obj) +{ + return c(obj->getTermCriteria()); +} +CVAPI(void) ml_EM_setTermCriteria(EM *obj, MyCvTermCriteria val) +{ + obj->setTermCriteria(cpp(val)); +} + +CVAPI(cv::Mat*) ml_EM_getWeights(EM *obj) +{ + cv::Mat m = obj->getWeights(); + return new cv::Mat(m); +} + +CVAPI(cv::Mat*) ml_EM_getMeans(EM *obj) +{ + cv::Mat m = obj->getMeans(); + return new cv::Mat(m); +} + +CVAPI(void) ml_EM_getCovs(EM *obj, std::vector *covs) +{ + std::vector raw; + obj->getCovs(raw); + covs->resize(raw.size()); + for (size_t i = 0; i < raw.size(); i++) + { + covs->at(i) = new cv::Mat(raw[i]); + } +} + + +CVAPI(CvVec2d) ml_EM_predict2( + EM *obj, cv::_InputArray *sample, cv::_OutputArray *probs) +{ + cv::Vec2d vec = obj->predict2(*sample, *probs); + CvVec2d ret; + ret.val[0] = vec[0]; + ret.val[1] = vec[1]; + return ret; +} + +CVAPI(int) ml_EM_trainEM( + EM *obj, + cv::_InputArray *samples, + cv::_OutputArray *logLikelihoods, + cv::_OutputArray *labels, + cv::_OutputArray *probs) +{ + bool ret = obj->trainEM(*samples, entity(logLikelihoods), entity(labels), entity(probs)); + return ret ? 1 : 0; +} + +CVAPI(int) ml_EM_trainE( + EM *obj, + cv::_InputArray *samples, + cv::_InputArray *means0, + cv::_InputArray *covs0, + cv::_InputArray *weights0, + cv::_OutputArray *logLikelihoods, + cv::_OutputArray *labels, + cv::_OutputArray *probs) +{ + bool ret = obj->trainE( + *samples, *means0, entity(covs0), entity(weights0), + entity(logLikelihoods), entity(labels), entity(probs)); + return ret ? 1 : 0; +} + +CVAPI(int) ml_EM_trainM( + EM *obj, + cv::_InputArray *samples, + cv::_InputArray *probs0, + cv::_OutputArray *logLikelihoods, + cv::_OutputArray *labels, + cv::_OutputArray *probs) +{ + bool ret = obj->trainM( + *samples, *probs0, entity(logLikelihoods), entity(labels), entity(probs)); + return ret ? 1 : 0; +} + + +CVAPI(cv::Ptr*) ml_EM_create() +{ + cv::Ptr obj = EM::create(); + return new cv::Ptr(obj); +} + +CVAPI(void) ml_EM_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(EM*) ml_Ptr_EM_get(cv::Ptr *obj) +{ + return obj->get(); +} + +#endif diff --git a/src/OpenCvSharpExtern/ml_KNearest.h b/src/OpenCvSharpExtern/ml_KNearest.h new file mode 100644 index 000000000..157db80c3 --- /dev/null +++ b/src/OpenCvSharpExtern/ml_KNearest.h @@ -0,0 +1,69 @@ +#ifndef _CPP_ML_KNEAREST_H_ +#define _CPP_ML_KNEAREST_H_ + +#include "include_opencv.h" +using namespace cv::ml; + + +CVAPI(int) ml_KNearest_getDefaultK(KNearest *obj) +{ + return obj->getDefaultK(); +} +CVAPI(void) ml_KNearest_setDefaultK(KNearest *obj, int val) +{ + obj->setDefaultK(val); +} + +CVAPI(int) ml_KNearest_getIsClassifier(KNearest *obj) +{ + return obj->getIsClassifier() ? 1 : 0; +} +CVAPI(void) ml_KNearest_setIsClassifier(KNearest *obj, int val) +{ + obj->setIsClassifier(val != 0); +} + +CVAPI(int) ml_KNearest_getEmax(KNearest *obj) +{ + return obj->getEmax(); +} +CVAPI(void) ml_KNearest_setEmax(KNearest *obj, int val) +{ + obj->setEmax(val); +} + +CVAPI(int) ml_KNearest_getAlgorithmType(KNearest *obj) +{ + return obj->getAlgorithmType(); +} +CVAPI(void) ml_KNearest_setAlgorithmType(KNearest *obj, int val) +{ + obj->setAlgorithmType(val); +} + + +CVAPI(float) ml_KNearest_findNearest(KNearest *obj, cv::_InputArray *samples, int k, + cv::_OutputArray *results, cv::_OutputArray *neighborResponses, cv::_OutputArray *dist) +{ + return obj->findNearest( + entity(samples), k, entity(results), entity(neighborResponses), entity(dist)); +} + + +CVAPI(cv::Ptr*) ml_KNearest_create() +{ + cv::Ptr ptr = KNearest::create(); + return new cv::Ptr(ptr); +} + +CVAPI(void) ml_Ptr_KNearest_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(KNearest*) ml_Ptr_KNearest_get(cv::Ptr* obj) +{ + return obj->get(); +} + +#endif diff --git a/src/OpenCvSharpExtern/ml_LogisticRegressionh.h b/src/OpenCvSharpExtern/ml_LogisticRegressionh.h new file mode 100644 index 000000000..0b279f0e0 --- /dev/null +++ b/src/OpenCvSharpExtern/ml_LogisticRegressionh.h @@ -0,0 +1,91 @@ +#ifndef _CPP_ML_LOGISTICREGRESSION_H_ +#define _CPP_ML_LOGISTICREGRESSION_H_ + +#include "include_opencv.h" +using namespace cv::ml; + + +CVAPI(double) ml_LogisticRegression_getLearningRate(LogisticRegression *obj) +{ + return obj->getLearningRate(); +} +CVAPI(void) ml_LogisticRegression_setLearningRate(LogisticRegression *obj, double val) +{ + obj->setLearningRate(val); +} + +CVAPI(int) ml_LogisticRegression_getIterations(LogisticRegression *obj) +{ + return obj->getIterations(); +} +CVAPI(void) ml_LogisticRegression_setIterations(LogisticRegression *obj, int val) +{ + obj->setIterations(val); +} + +CVAPI(int) ml_LogisticRegression_getRegularization(LogisticRegression *obj) +{ + return obj->getRegularization(); +} +CVAPI(void) ml_LogisticRegression_setRegularization(LogisticRegression *obj, int val) +{ + obj->setRegularization(val); +} + +CVAPI(int) ml_LogisticRegression_getTrainMethod(LogisticRegression *obj) +{ + return obj->getTrainMethod(); +} +CVAPI(void) ml_LogisticRegression_setTrainMethod(LogisticRegression *obj, int val) +{ + obj->setTrainMethod(val); +} + +CVAPI(int) ml_LogisticRegression_getMiniBatchSize(LogisticRegression *obj) +{ + return obj->getMiniBatchSize(); +} +CVAPI(void) ml_LogisticRegression_setMiniBatchSize(LogisticRegression *obj, int val) +{ + obj->setMiniBatchSize(val); +} + +CVAPI(MyCvTermCriteria) ml_LogisticRegression_getTermCriteria(LogisticRegression *obj) +{ + return c(obj->getTermCriteria()); +} +CVAPI(void) ml_LogisticRegression_setTermCriteria(LogisticRegression *obj, MyCvTermCriteria val) +{ + obj->setTermCriteria(cpp(val)); +} + + +CVAPI(float) ml_LogisticRegression_predict( + LogisticRegression *obj, cv::_InputArray *samples, cv::_OutputArray *results, int flags) +{ + obj->predict(entity(samples), entity(results), flags); +} + +CVAPI(cv::Mat*) ml_LogisticRegression_get_learnt_thetas(LogisticRegression *obj) +{ + return new cv::Mat(obj->get_learnt_thetas()); +} + + +CVAPI(cv::Ptr*) ml_LogisticRegression_create() +{ + cv::Ptr ptr = LogisticRegression::create(); + return new cv::Ptr(ptr); +} + +CVAPI(void) ml_Ptr_LogisticRegression_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(LogisticRegression*) ml_Ptr_LogisticRegression_get(cv::Ptr *obj) +{ + return obj->get(); +} + +#endif diff --git a/src/OpenCvSharpExtern/ml_NormalBayesClassifier.h b/src/OpenCvSharpExtern/ml_NormalBayesClassifier.h new file mode 100644 index 000000000..c53408e8d --- /dev/null +++ b/src/OpenCvSharpExtern/ml_NormalBayesClassifier.h @@ -0,0 +1,32 @@ +#ifndef _CPP_ML_NORMALBAYESCLASSIFIER_H_ +#define _CPP_ML_NORMALBAYESCLASSIFIER_H_ + +#include "include_opencv.h" +using namespace cv::ml; + + +CVAPI(float) ml_NormalBayesClassifier_predictProb( + NormalBayesClassifier *obj, cv::_InputArray *inputs, + cv::_OutputArray *samples, cv::_OutputArray *outputProbs, int flags) +{ + return obj->predictProb(entity(inputs), entity(samples), entity(outputProbs), flags); +} + +CVAPI(cv::Ptr*) ml_NormalBayesClassifier_create() +{ + cv::Ptr ptr = NormalBayesClassifier::create(); + return new cv::Ptr(ptr); +} + +CVAPI(void) ml_Ptr_NormalBayesClassifier_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(NormalBayesClassifier*) ml_Ptr_NormalBayesClassifier_get( + cv::Ptr* obj) +{ + return obj->get(); +} + +#endif diff --git a/src/OpenCvSharpExtern/ml_RTrees.h b/src/OpenCvSharpExtern/ml_RTrees.h new file mode 100644 index 000000000..4eca05c06 --- /dev/null +++ b/src/OpenCvSharpExtern/ml_RTrees.h @@ -0,0 +1,56 @@ +#ifndef _CPP_ML_RTREES_H_ +#define _CPP_ML_RTREES_H_ + +#include "include_opencv.h" +using namespace cv::ml; + + +CVAPI(int) ml_RTrees_getCalculateVarImportance(RTrees *obj) +{ + return obj->getCalculateVarImportance() ? 1 : 0; +} +CVAPI(void) ml_RTrees_setCalculateVarImportance(RTrees *obj, int val) +{ + obj->setCalculateVarImportance(val != 0); +} + +CVAPI(int) ml_RTrees_getActiveVarCount(RTrees *obj) +{ + return obj->getActiveVarCount(); +} +CVAPI(void) ml_RTrees_setActiveVarCount(RTrees *obj, int val) +{ + obj->setActiveVarCount(val); +} + +CVAPI(MyCvTermCriteria) ml_RTrees_getTermCriteria(RTrees *obj) +{ + return c(obj->getTermCriteria()); +} +CVAPI(void) ml_RTrees_setTermCriteria(RTrees *obj, MyCvTermCriteria val) +{ + obj->setTermCriteria(cpp(val)); +} + +CVAPI(cv::Mat*) ml_RTrees_getVarImportance(RTrees *obj) +{ + return new cv::Mat(obj->getVarImportance()); +} + +CVAPI(cv::Ptr*) ml_RTrees_create() +{ + cv::Ptr ptr = RTrees::create(); + return new cv::Ptr(ptr); +} + +CVAPI(void) ml_Ptr_RTrees_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(RTrees*) ml_Ptr_RTrees_get(cv::Ptr *obj) +{ + return obj->get(); +} + +#endif diff --git a/src/OpenCvSharpExtern/ml_SVM.h b/src/OpenCvSharpExtern/ml_SVM.h new file mode 100644 index 000000000..1d276d9bb --- /dev/null +++ b/src/OpenCvSharpExtern/ml_SVM.h @@ -0,0 +1,133 @@ +#ifndef _CPP_ML_SVM_H_ +#define _CPP_ML_SVM_H_ + +#include "include_opencv.h" +#include "ml.h" + +using namespace cv::ml; + + +CVAPI(int) ml_SVM_getType(SVM *obj) +{ + return obj->getType(); +} +CVAPI(void) ml_SVM_setType(SVM *obj, int val) +{ + obj->setType(val); +} + +CVAPI(double) ml_SVM_getGamma(SVM *obj) +{ + return obj->getGamma(); +} +CVAPI(void) ml_SVM_setGamma(SVM *obj, double val) +{ + obj->setGamma(val); +} + +CVAPI(double) ml_SVM_getCoef0(SVM *obj) +{ + return obj->getCoef0(); +} +CVAPI(void) ml_SVM_setCoef0(SVM *obj, double val) +{ + obj->setCoef0(val); +} + +CVAPI(double) ml_SVM_getDegree(SVM *obj) +{ + return obj->getDegree(); +} +CVAPI(void) ml_SVM_setDegree(SVM *obj, double val) +{ + obj->setDegree(val); +} + +CVAPI(double) ml_SVM_getC(SVM *obj) +{ + return obj->getC(); +} +CVAPI(void) ml_SVM_setC(SVM *obj, double val) +{ + obj->setC(val); +} + +CVAPI(double) ml_SVM_getP(SVM *obj) +{ + return obj->getP(); +} +CVAPI(void) ml_SVM_setP(SVM *obj, double val) +{ + obj->setP(val); +} + +CVAPI(double) ml_SVM_getNu(SVM *obj) +{ + return obj->getNu(); +} +CVAPI(void) ml_SVM_setNu(SVM *obj, double val) +{ + obj->setNu(val); +} + +CVAPI(cv::Mat*) ml_SVM_getClassWeights(SVM *obj) +{ + return new cv::Mat(obj->getClassWeights()); +} +CVAPI(void) ml_SVM_setClassWeights(SVM *obj, cv::Mat *val) +{ + obj->setClassWeights(*val); +} + +CVAPI(MyCvTermCriteria) ml_SVM_getTermCriteria(SVM *obj) +{ + return c(obj->getTermCriteria()); +} +CVAPI(void) ml_SVM_setTermCriteria(SVM *obj, MyCvTermCriteria val) +{ + obj->setTermCriteria(cpp(val)); +} + +CVAPI(int) ml_SVM_getKernelType(SVM *obj) +{ + return obj->getKernelType(); +} + +CVAPI(void) ml_SVM_setKernel(SVM *obj, int kernelType) +{ + obj->setKernel(kernelType); +} + +CVAPI(cv::Mat*) ml_SVM_getSupportVectors(SVM *obj) +{ + return new cv::Mat(obj->getSupportVectors()); +} + +CVAPI(double) ml_SVM_getDecisionFunction( + cv::ml::SVM *obj, int i, cv::_OutputArray *alpha, cv::_OutputArray *svidx) +{ + return obj->getDecisionFunction(i, entity(alpha), entity(svidx)); +} + +CVAPI(ParamGridStruct) ml_SVM_getDefaultGrid(int param_id) +{ + return c(cv::ml::SVM::getDefaultGrid(param_id)); +} + +CVAPI(cv::Ptr*) ml_SVM_create() +{ + cv::Ptr ptr = SVM::create(); + return new cv::Ptr(ptr); +} + +CVAPI(void) ml_Ptr_SVM_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(cv::ml::SVM*) ml_Ptr_SVM_get(cv::Ptr* obj) +{ + return obj->get(); +} + +#endif diff --git a/src/OpenCvSharpExtern/ml_StatModel.h b/src/OpenCvSharpExtern/ml_StatModel.h new file mode 100644 index 000000000..11df982c9 --- /dev/null +++ b/src/OpenCvSharpExtern/ml_StatModel.h @@ -0,0 +1,64 @@ +#ifndef _CPP_ML_STATMODEL_H_ +#define _CPP_ML_STATMODEL_H_ + +#include "include_opencv.h" +using namespace cv::ml; + + +CVAPI(void) ml_StatModel_clear(StatModel *obj) +{ + obj->clear(); +} + +CVAPI(int) ml_StatModel_getVarCount(StatModel *obj) +{ + return obj->getVarCount(); +} + +CVAPI(int) ml_StatModel_empty(StatModel *obj) +{ + return obj->empty() ? 1 : 0; +} + +CVAPI(int) ml_StatModel_isTrained(StatModel *obj) +{ + return obj->isTrained() ? 1 : 0; +} + +CVAPI(int) ml_StatModel_isClassifier(StatModel *obj) +{ + return obj->isClassifier() ? 1 : 0; +} + + +CVAPI(int) ml_StatModel_train1( + StatModel *obj, cv::Ptr *trainData, int flags) +{ + return obj->train(*trainData, flags) ? 1 : 0; +} + +CVAPI(int) ml_StatModel_train2( + StatModel *obj, cv::_InputArray *samples, int layout, cv::_InputArray *responses) +{ + return obj->train(entity(samples), layout, entity(responses)) ? 1 : 0; +} + +CVAPI(float) ml_StatModel_calcError( + StatModel *obj, cv::Ptr *data, int test, cv::_OutputArray *resp) +{ + return obj->calcError(*data, test != 0, *resp); +} + +CVAPI(float) ml_StatModel_predict( + StatModel *obj, cv::_InputArray *samples, cv::_OutputArray *results, int flags) +{ + return obj->predict(entity(samples), entity(results), flags); +} + + +CVAPI(void) ml_StatModel_save(StatModel *obj, const char *filename) +{ + return obj->save(cv::String(filename)); +} + +#endif diff --git a/src/OpenCvSharpExtern/my_functions.h b/src/OpenCvSharpExtern/my_functions.h new file mode 100644 index 000000000..a51a7158a --- /dev/null +++ b/src/OpenCvSharpExtern/my_functions.h @@ -0,0 +1,140 @@ +// Additional functions + +#ifndef _MY_FUNCTIONS_H_ +#define _MY_FUNCTIONS_H_ + +#include +#include "my_types.h" + +#ifdef _WIN32 +#include +static int p(const char *msg, const char caption[] = "MessageBox") +{ + return MessageBoxA(NULL, msg, caption, MB_OK); +} + +template +static int p(T obj, const std::string &caption = "MessageBox") +{ + std::stringstream ss; + ss << obj; + return p(ss.str().c_str(), caption.c_str()); +} +#undef min +#undef max +#endif + + + +#if defined WIN32 || defined _WIN32 +# define CV_CDECL __cdecl +# define CV_STDCALL __stdcall +#else +# define CV_CDECL +# define CV_STDCALL +#endif + +#ifndef CVAPI +# define CVAPI(rettype) CV_EXTERN_C CV_EXPORTS rettype CV_CDECL +#endif + + + +static inline cv::_InputArray entity(cv::_InputArray *obj) +{ + return (obj != NULL) ? *obj : static_cast(cv::noArray()); +} +static inline cv::_OutputArray entity(cv::_OutputArray *obj) +{ + return (obj != NULL) ? *obj : static_cast(cv::noArray()); +} +static inline cv::_InputOutputArray entity(cv::_InputOutputArray *obj) +{ + return (obj != NULL) ? *obj : cv::noArray(); +} +static inline cv::Mat entity(cv::Mat *obj) +{ + return (obj != NULL) ? *obj : cv::Mat(); +} +static inline cv::cuda::GpuMat entity(cv::cuda::GpuMat *obj) +{ + return (obj != NULL) ? *obj : cv::cuda::GpuMat(); +} +static inline cv::cuda::Stream entity(cv::cuda::Stream *obj) +{ + return (obj != NULL) ? *obj : cv::cuda::Stream::Null(); +} + +template +static inline cv::Ptr *clone(const cv::Ptr &ptr) +{ + return new cv::Ptr(ptr); +} + +static inline void copyString(const char *src, char *dst, int dstLength) +{ + if (strlen(src) == 0) + std::strncpy(dst, "", dstLength - 1); + else + std::strncpy(dst, src, dstLength - 1); +} +static inline void copyString(const std::string &src, char *dst, int dstLength) +{ + if (src.empty()) + std::strncpy(dst, "", dstLength - 1); + else + std::strncpy(dst, src.c_str(), dstLength - 1); +} +static inline void copyString(const cv::String &src, char *dst, int dstLength) +{ + if (src.empty()) + std::strncpy(dst, "", dstLength - 1); + else + std::strncpy(dst, src.c_str(), dstLength - 1); +} + +template +static void dump(T *obj, const std::string &outFile) +{ + int size = sizeof(T); + std::vector bytes(size); + std::memcpy(&bytes[0], (uchar*)obj, size); + + FILE *fp = fopen(outFile.c_str(), "w"); + for (std::vector::iterator it = bytes.begin(); it != bytes.end(); it++) + { + std::fprintf(fp, "%x,", (int)*it); + } + fclose(fp); +} + +static void toVec( + cv::Mat **inPtr, int size, std::vector &outVec) +{ + outVec.resize(size); + for (int i = 0; i < size; i++) + { + outVec[i] = *inPtr[i]; + } +} + +template +static void toVec( + TIn **inPtr, int size1, const int *size2, std::vector > &outVec) +{ + outVec.resize(size1); + for (int i = 0; i < size1; i++) + { + int size = size2[i]; + TIn *p = inPtr[i]; + std::vector v(p, p + size); + /*std::vector v(size); + for (int j = 0; j < size; j++) + { + v[j] = inPtr[i][j]; + }*/ + outVec[i] = v; + } +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/my_types.h b/src/OpenCvSharpExtern/my_types.h new file mode 100644 index 000000000..d087cfa23 --- /dev/null +++ b/src/OpenCvSharpExtern/my_types.h @@ -0,0 +1,241 @@ +// Additional types + +#ifndef _MY_TYPES_H_ +#define _MY_TYPES_H_ + +typedef unsigned char uchar; +typedef unsigned short uint16; +typedef unsigned short ushort; +typedef unsigned int uint32; + +namespace cv +{ + typedef cv::Vec Vec6b; + typedef cv::Vec Vec6s; + typedef cv::Vec Vec6w; +} + +extern "C" +{ + #pragma region OpenCV1.0-compatible Types + + typedef struct MyCvPoint + { + int x; + int y; + } MyCvPoint; + + typedef struct MyCvPoint2D32f + { + float x; + float y; + } MyCvPoint2D32f; + + typedef struct MyCvSize + { + int width; + int height; + } MyCvSize; + + typedef struct MyCvSize2D32f + { + float width; + float height; + } MyCvSize2D32f; + + typedef struct MyCvRect + { + int x; + int y; + int width; + int height; + } MyCvRect; + + typedef struct MyCvScalar + { + double val[4]; + } MyCvScalar; + + typedef struct MyCvSlice + { + int start_index, end_index; + } MyCvSlice; + + typedef struct MyCvMoments + { + double m00, m10, m01, m20, m11, m02, m30, m21, m12, m03; /* spatial moments */ + double mu20, mu11, mu02, mu30, mu21, mu12, mu03; /* central moments */ + double inv_sqrt_m00; /* m00 != 0 ? 1/sqrt(m00) : 0 */ + } MyCvMoments; + + typedef struct MyCvTermCriteria + { + int type; + int max_iter; + double epsilon; + } MyCvTermCriteria; + + typedef struct MyCvBox2D + { + MyCvPoint2D32f center; + MyCvSize2D32f size; + float angle; + } MyCvBox2D; + + #pragma endregion + + typedef struct CvPoint3D + { + int x; + int y; + int z; + } CvPoint3D; + + typedef struct CvVec2b { uchar val[2]; } CvVec2b; + typedef struct CvVec3b { uchar val[3]; } CvVec3b; + typedef struct CvVec4b { uchar val[4]; } CvVec4b; + typedef struct CvVec6b { uchar val[6]; } CvVec6b; + typedef struct CvVec2s { short val[2]; } CvVec2s; + typedef struct CvVec3s { short val[3]; } CvVec3s; + typedef struct CvVec4s { short val[4]; } CvVec4s; + typedef struct CvVec6s { short val[6]; } CvVec6s; + typedef struct CvVec2w { ushort val[2]; } CvVec2w; + typedef struct CvVec3w { ushort val[3]; } CvVec3w; + typedef struct CvVec4w { ushort val[4]; } CvVec4w; + typedef struct CvVec6w { ushort val[6]; } CvVec6w; + typedef struct CvVec2i { int val[2]; } CvVec2i; + typedef struct CvVec3i { int val[3]; } CvVec3i; + typedef struct CvVec4i { int val[4]; } CvVec4i; + typedef struct CvVec6i { int val[6]; } CvVec6i; + typedef struct CvVec2f { float val[2]; } CvVec2f; + typedef struct CvVec3f { float val[3]; } CvVec3f; + typedef struct CvVec4f { float val[4]; } CvVec4f; + typedef struct CvVec6f { float val[6]; } CvVec6f; + typedef struct CvVec2d { double val[2]; } CvVec2d; + typedef struct CvVec3d { double val[3]; } CvVec3d; + typedef struct CvVec4d { double val[4]; } CvVec4d; + typedef struct CvVec6d { double val[6]; } CvVec6d; +} + + +static MyCvPoint c(cv::Point p) +{ + MyCvPoint ret = { p.x, p.y }; + return ret; +} +static cv::Point cpp(MyCvPoint p) +{ + return cv::Point(p.x, p.y); +} + +static MyCvPoint2D32f c(cv::Point2f p) +{ + MyCvPoint2D32f ret = { p.x, p.y }; + return ret; +} +static cv::Point2f cpp(MyCvPoint2D32f p) +{ + return cv::Point2f(p.x, p.y); +} + +static MyCvSize c(cv::Size s) +{ + MyCvSize ret = { s.width, s.height }; + return ret; +} +static cv::Size cpp(MyCvSize s) +{ + return cv::Size(s.width, s.height); +} + +static MyCvSize2D32f c(cv::Size2f s) +{ + MyCvSize2D32f ret = { s.width, s.height }; + return ret; +} +static cv::Size2f cpp(MyCvSize2D32f s) +{ + return cv::Size2f(s.width, s.height); +} + +static MyCvRect c(cv::Rect r) +{ + MyCvRect ret = { r.x, r.y, r.width, r.height }; + return ret; +} +static cv::Rect cpp(MyCvRect r) +{ + return cv::Rect(r.x, r.y, r.width, r.height); +} + +static MyCvScalar c(cv::Scalar s) +{ + MyCvScalar ret; + ret.val[0] = s[0]; + ret.val[1] = s[1]; + ret.val[2] = s[2]; + ret.val[3] = s[3]; + return ret; +} +static cv::Scalar cpp(MyCvScalar s) +{ + return cv::Scalar(s.val[0], s.val[1], s.val[2], s.val[3]); +} + +static MyCvSlice c(cv::Range s) +{ + MyCvSlice ret; + ret.start_index = s.start; + ret.end_index = s.end; + return ret; +} +static cv::Range cpp(MyCvSlice s) +{ + return cv::Range(s.start_index, s.end_index); +} + +static MyCvMoments c(cv::Moments m) +{ + MyCvMoments ret; + ret.m00 = m.m00; ret.m10 = m.m10; ret.m01 = m.m01; + ret.m20 = m.m20; ret.m11 = m.m11; ret.m02 = m.m02; + ret.m30 = m.m30; ret.m21 = m.m21; ret.m12 = m.m12; ret.m03 = m.m03; + ret.mu20 = m.mu20; ret.mu11 = m.mu11; ret.mu02 = m.mu02; + ret.mu30 = m.mu30; ret.mu21 = m.mu21; ret.mu12 = m.mu12; ret.mu03 = m.mu03; + double am00 = std::abs(m.m00); + ret.inv_sqrt_m00 = am00 > DBL_EPSILON ? 1. / std::sqrt(am00) : 0; + + return ret; +} +static cv::Moments cpp(MyCvMoments m) +{ + return cv::Moments(m.m00, m.m10, m.m01, m.m20, m.m11, m.m02, m.m30, m.m21, m.m12, m.m03); +} + +static MyCvTermCriteria c(cv::TermCriteria tc) +{ + MyCvTermCriteria ret; + ret.type = tc.type; + ret.max_iter = tc.maxCount; + ret.epsilon = tc.epsilon; + return ret; +} +static cv::TermCriteria cpp(MyCvTermCriteria tc) +{ + return cv::TermCriteria(tc.type, tc.max_iter, tc.epsilon); +} + +static MyCvBox2D c(cv::RotatedRect r) +{ + MyCvBox2D ret; + ret.center = c(r.center); + ret.size = c(r.size); + ret.angle = r.angle; + return ret; +} +static cv::RotatedRect cpp(MyCvBox2D b) +{ + return cv::RotatedRect(cpp(b.center), cpp(b.size), b.angle); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/nonfree.cpp b/src/OpenCvSharpExtern/nonfree.cpp new file mode 100644 index 000000000..a4cc76443 --- /dev/null +++ b/src/OpenCvSharpExtern/nonfree.cpp @@ -0,0 +1 @@ +#include "nonfree.h" \ No newline at end of file diff --git a/src/OpenCvSharpExtern/nonfree.h b/src/OpenCvSharpExtern/nonfree.h new file mode 100644 index 000000000..82a8f97e3 --- /dev/null +++ b/src/OpenCvSharpExtern/nonfree.h @@ -0,0 +1,205 @@ +#if WIN32 +#pragma once +#endif + +#ifndef _CPP_NONFREE_H_ +#define _CPP_NONFREE_H_ + +#include "include_opencv.h" + +CVAPI(int) nonfree_initModule_nonfree() +{ + return cv::initModule_nonfree() ? 1 : 0; +} + +#pragma region SIFT + +CVAPI(cv::SIFT*) nonfree_SIFT_new(int nfeatures, int nOctaveLayers, + double contrastThreshold, double edgeThreshold, double sigma) +{ + return new cv::SIFT(nfeatures, nOctaveLayers, contrastThreshold, edgeThreshold, sigma); +} +CVAPI(void) nonfree_SIFT_delete(cv::SIFT *obj) +{ + delete obj; +} + +CVAPI(cv::Ptr*) nonfree_SIFT_createAlgorithm(const char *name) +{ + cv::Ptr al = cv::Algorithm::create(name); + return al.empty() ? NULL : clone( al ); +} + +CVAPI(cv::SIFT*) nonfree_Ptr_SIFT_obj(cv::Ptr *ptr) +{ + return ptr->obj; +} +CVAPI(void) nonfree_Ptr_SIFT_delete(cv::Ptr *ptr) +{ + delete ptr; +} + +CVAPI(int) nonfree_SIFT_descriptorSize(cv::SIFT *obj) +{ + return obj->descriptorSize(); +} +CVAPI(int) nonfree_SIFT_descriptorType(cv::SIFT *obj) +{ + return obj->descriptorType(); +} + +CVAPI(void) nonfree_SIFT_run1(cv::SIFT *obj, cv::_InputArray *img, cv::_InputArray *mask, + std::vector *keypoints) +{ + (*obj)(*img, entity(mask), *keypoints); +} +/* +CVAPI(void) nonfree_SIFT_run2_vector(cv::SIFT *obj, cv::_InputArray *img, cv::_InputArray *mask, + std::vector *keypoints, std::vector *descriptors, + int useProvidedKeypoints) +{ + (*obj)(*img, entity(mask), *keypoints, *descriptors, useProvidedKeypoints != 0); +}*/ +CVAPI(void) nonfree_SIFT_run2_OutputArray(cv::SIFT *obj, cv::_InputArray *img, cv::_InputArray *mask, + std::vector *keypoints, cv::_OutputArray *descriptors, + int useProvidedKeypoints) +{ + (*obj)(*img, entity(mask), *keypoints, *descriptors, useProvidedKeypoints != 0); +} +CVAPI(cv::AlgorithmInfo*) nonfree_SIFT_info(cv::SIFT *obj) +{ + return obj->info(); +} + +CVAPI(void) nonfree_SIFT_buildGaussianPyramid(cv::SIFT *obj, cv::Mat *base, std::vector *pyr, int nOctaves) +{ + obj->buildGaussianPyramid(*base, *pyr, nOctaves); +} +CVAPI(void) nonfree_SIFT_buildDoGPyramid(cv::SIFT *obj, cv::Mat **pyr, int pyrLength, std::vector *dogPyr) +{ + std::vector pyrVec(pyrLength); + for (int i = 0; i < pyrLength; i++) + pyrVec[i] = *pyr[i]; + obj->buildDoGPyramid(pyrVec, *dogPyr); +} +CVAPI(void) nonfree_SIFT_findScaleSpaceExtrema(cv::SIFT *obj, cv::Mat **gaussPyr, int gaussPyrLength, + cv::Mat **dogPyr, int dogPyrLength, std::vector *keypoints) +{ + std::vector gaussPyrVec(gaussPyrLength); + for (int i = 0; i < gaussPyrLength; i++) + gaussPyrVec[i] = *gaussPyr[i]; + std::vector dogPyrVec(dogPyrLength); + for (int i = 0; i < dogPyrLength; i++) + dogPyrVec[i] = *dogPyr[i]; + obj->findScaleSpaceExtrema(gaussPyrVec, dogPyrVec, *keypoints); +} + +#pragma endregion + +#pragma region SURF + +CVAPI(cv::SURF*) nonfree_SURF_new1() +{ + return new cv::SURF(); +} +CVAPI(cv::SURF*) nonfree_SURF_new2(double hessianThreshold, int nOctaves, + int nOctaveLayers, int extended, int upright) +{ + return new cv::SURF(hessianThreshold, nOctaves, nOctaveLayers, extended != 0, upright != 0); +} +CVAPI(void) nonfree_SURF_delete(cv::SURF *obj) +{ + delete obj; +} + +CVAPI(cv::Ptr*) nonfree_SURF_createAlgorithm(const char *name) +{ + cv::Ptr al = cv::Algorithm::create(name); + return al.empty() ? NULL : clone( al ); +} + +CVAPI(cv::SURF*) nonfree_Ptr_SURF_obj(cv::Ptr *ptr) +{ + return ptr->obj; +} +CVAPI(void) nonfree_Ptr_SURF_delete(cv::Ptr *ptr) +{ + delete ptr; +} + +CVAPI(int) nonfree_SURF_descriptorSize(cv::SURF *obj) +{ + return obj->descriptorSize(); +} +CVAPI(int) nonfree_SURF_descriptorType(cv::SURF *obj) +{ + return obj->descriptorType(); +} + +CVAPI(void) nonfree_SURF_run1(cv::SURF *obj, cv::_InputArray *img, cv::_InputArray *mask, + std::vector *keypoints) +{ + (*obj)(*img, entity(mask), *keypoints); +} +CVAPI(void) nonfree_SURF_run2_vector(cv::SURF *obj, cv::_InputArray *img, cv::_InputArray *mask, + std::vector *keypoints, std::vector *descriptors, + int useProvidedKeypoints) +{ + (*obj)(*img, entity(mask), *keypoints, *descriptors, useProvidedKeypoints != 0); +} +CVAPI(void) nonfree_SURF_run2_OutputArray(cv::SURF *obj, cv::_InputArray *img, cv::_InputArray *mask, + std::vector *keypoints, cv::_OutputArray *descriptors, + int useProvidedKeypoints) +{ + (*obj)(*img, entity(mask), *keypoints, *descriptors, useProvidedKeypoints != 0); +} +CVAPI(cv::AlgorithmInfo*) nonfree_SURF_info(cv::SURF *obj) +{ + return obj->info(); +} + +CVAPI(double) nonfree_SURF_hessianThreshold_get(cv::SURF *obj) +{ + return obj->hessianThreshold; +} +CVAPI(int) nonfree_SURF_nOctaves_get(cv::SURF *obj) +{ + return obj->nOctaves; +} +CVAPI(int) nonfree_SURF_nOctaveLayers_get(cv::SURF *obj) +{ + return obj->nOctaveLayers; +} +CVAPI(int) nonfree_SURF_extended_get(cv::SURF *obj) +{ + return obj->extended ? 1 : 0; +} +CVAPI(int) nonfree_SURF_upright_get(cv::SURF *obj) +{ + return obj->upright ? 1 : 0; +} + +CVAPI(void) nonfree_SURF_hessianThreshold_set(cv::SURF *obj, double value) +{ + obj->hessianThreshold = value; +} +CVAPI(void) nonfree_SURF_nOctaves_set(cv::SURF *obj, int value) +{ + obj->nOctaves = value; +} +CVAPI(void) nonfree_SURF_nOctaveLayers_set(cv::SURF *obj, int value) +{ + obj->nOctaveLayers = value; +} +CVAPI(void) nonfree_SURF_extended_set(cv::SURF *obj, int value) +{ + obj->extended = (value != 0); +} +CVAPI(void) nonfree_SURF_upright_set(cv::SURF *obj, int value) +{ + obj->upright = (value != 0); +} + +#pragma endregion + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/objdetect.cpp b/src/OpenCvSharpExtern/objdetect.cpp new file mode 100644 index 000000000..7dced1af8 --- /dev/null +++ b/src/OpenCvSharpExtern/objdetect.cpp @@ -0,0 +1,2 @@ +#include "objdetect.h" +#include "objdetect_HOGDescriptor.h" \ No newline at end of file diff --git a/src/OpenCvSharpExtern/objdetect.h b/src/OpenCvSharpExtern/objdetect.h new file mode 100644 index 000000000..3e598ab65 --- /dev/null +++ b/src/OpenCvSharpExtern/objdetect.h @@ -0,0 +1,159 @@ +#ifndef _CPP_OBJDETECT_H_ +#define _CPP_OBJDETECT_H_ + +#include "include_opencv.h" + +#pragma region LatentSvmDetector +/* +CVAPI(cv::LatentSvmDetector*) objdetect_LatentSvmDetector_new() +{ + return new cv::LatentSvmDetector(); +} + +CVAPI(void) objdetect_LatentSvmDetector_delete(cv::LatentSvmDetector *obj) +{ + delete obj; +} + + +CVAPI(void) objdetect_LatentSvmDetector_clear(cv::LatentSvmDetector *obj) +{ + obj->clear(); +} +CVAPI(int) objdetect_LatentSvmDetector_empty(cv::LatentSvmDetector *obj) +{ + return obj->empty() ? 1 : 0; +} +CVAPI(int) objdetect_LatentSvmDetector_load(cv::LatentSvmDetector *obj, + const char **fileNames, int fileNamesLength, + const char **classNames, int classNamesLength) +{ + std::vector fileNamesVec(fileNamesLength); + std::vector classNamesVec(classNamesLength); + for (int i = 0; i < fileNamesLength; i++) + fileNamesVec[i] = std::string(fileNames[i]); + for (int i = 0; i < classNamesLength; i++) + classNamesVec[i] = std::string(classNames[i]); + + return obj->load(fileNamesVec, classNamesVec) ? 1 : 0; +} + +CVAPI(void) objdetect_LatentSvmDetector_detect( + cv::LatentSvmDetector *obj, cv::Mat *image, std::vector *objectDetections, + float overlapThreshold, int numThreads) +{ + std::vector odVecs; + obj->detect(*image, odVecs, overlapThreshold, numThreads); + + objectDetections->resize(odVecs.size()); + for (size_t i = 0; i < odVecs.size(); i++) + { + objectDetections->at(i)[0] = odVecs[i].rect.x; + objectDetections->at(i)[1] = odVecs[i].rect.y; + objectDetections->at(i)[2] = odVecs[i].rect.width; + objectDetections->at(i)[3] = odVecs[i].rect.height; + objectDetections->at(i)[4] = odVecs[i].score; + objectDetections->at(i)[5] = odVecs[i].classID; + } +} + +CVAPI(void) objdetect_LatentSvmDetector_getClassNames(cv::LatentSvmDetector *obj, std::vector *outValues) +{ + const std::vector &ret = obj->getClassNames(); + std::copy(ret.begin(), ret.end(), std::back_inserter(*outValues)); +} +CVAPI(size_t) objdetect_LatentSvmDetector_getClassCount(cv::LatentSvmDetector *obj) +{ + return obj->getClassCount(); +} +*/ +#pragma endregion + +#pragma region CascadeClassifier + +CVAPI(cv::CascadeClassifier*) objdetect_CascadeClassifier_new() +{ + return new cv::CascadeClassifier(); +} +CVAPI(cv::CascadeClassifier*) objdetect_CascadeClassifier_newFromFile(const char *fileName) +{ + return new cv::CascadeClassifier(fileName); +} +CVAPI(void) objdetect_CascadeClassifier_delete(cv::CascadeClassifier *obj) +{ + delete obj; +} + +CVAPI(int) objdetect_CascadeClassifier_empty(cv::CascadeClassifier *obj) +{ + return obj->empty() ? 1 : 0; +} +CVAPI(int) objdetect_CascadeClassifier_load( + cv::CascadeClassifier *obj, const char *fileName) +{ + return obj->load(fileName) ? 1 : 0; +} + +//CVAPI(int) objdetect_CascadeClassifier_read(const FileNode& node); + +CVAPI(void) objdetect_CascadeClassifier_detectMultiScale1( + cv::CascadeClassifier *obj, + cv::Mat *image, std::vector *objects, + double scaleFactor, int minNeighbors, int flags, CvSize minSize, CvSize maxSize) +{ + std::vector vec; + obj->detectMultiScale(*image, *objects, + scaleFactor, minNeighbors, flags, minSize, maxSize); +} + +CVAPI(void) objdetect_CascadeClassifier_detectMultiScale2( + cv::CascadeClassifier *obj, + cv::Mat *image, + std::vector *objects, + std::vector *rejectLevels, + std::vector *levelWeights, + double scaleFactor, int minNeighbors, int flags, + MyCvSize minSize, MyCvSize maxSize, int outputRejectLevels) +{ + obj->detectMultiScale(*image, *objects, *rejectLevels, *levelWeights, + scaleFactor, minNeighbors, flags, cpp(minSize), cpp(maxSize), outputRejectLevels != 0); +} + + +CVAPI(int) objdetect_CascadeClassifier_isOldFormatCascade(cv::CascadeClassifier *obj) +{ + return obj->isOldFormatCascade() ? 1 : 0; +} +CVAPI(MyCvSize) objdetect_CascadeClassifier_getOriginalWindowSize(cv::CascadeClassifier *obj) +{ + return c(obj->getOriginalWindowSize()); +} +CVAPI(int) objdetect_CascadeClassifier_getFeatureType(cv::CascadeClassifier *obj) +{ + return obj->getFeatureType(); +} + +#pragma endregion + +CVAPI(void) objdetect_groupRectangles1(std::vector *rectList, int groupThreshold, double eps) +{ + cv::groupRectangles(*rectList, groupThreshold, eps); +} +CVAPI(void) objdetect_groupRectangles2(std::vector *rectList, std::vector *weights, int groupThreshold, double eps) +{ + cv::groupRectangles(*rectList, *weights, groupThreshold, eps); +} +CVAPI(void) objdetect_groupRectangles3(std::vector *rectList, int groupThreshold, double eps, std::vector *weights, std::vector *levelWeights) +{ + cv::groupRectangles(*rectList, groupThreshold, eps, weights, levelWeights); +} +CVAPI(void) objdetect_groupRectangles4(std::vector *rectList, std::vector *rejectLevels, std::vector *levelWeights, int groupThreshold, double eps) +{ + cv::groupRectangles(*rectList, *rejectLevels, *levelWeights, groupThreshold, eps); +} +CVAPI(void) objdetect_groupRectangles_meanshift(std::vector *rectList, std::vector *foundWeights, std::vector *foundScales, double detectThreshold, MyCvSize winDetSize) +{ + cv::groupRectangles_meanshift(*rectList, *foundWeights, *foundScales, detectThreshold, cpp(winDetSize)); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/objdetect_HOGDescriptor.h b/src/OpenCvSharpExtern/objdetect_HOGDescriptor.h new file mode 100644 index 000000000..a157da212 --- /dev/null +++ b/src/OpenCvSharpExtern/objdetect_HOGDescriptor.h @@ -0,0 +1,255 @@ +#ifndef _CPP_OBJDETECT_HOGDESCRIPTOR_H_ +#define _CPP_OBJDETECT_HOGDESCRIPTOR_H_ + +#include "include_opencv.h" + +#pragma region Methods +CVAPI(int) objdetect_HOGDescriptor_sizeof() +{ + return sizeof(cv::HOGDescriptor); +} +CVAPI(cv::HOGDescriptor*) objdetect_HOGDescriptor_new1() +{ + return new cv::HOGDescriptor(); +} +CVAPI(cv::HOGDescriptor*) objdetect_HOGDescriptor_new2(CvSize winSize, CvSize blockSize, CvSize blockStride, CvSize cellSize, + int nbins, int derivAperture, double winSigma, int histogramNormType, double L2HysThreshold, int gammaCorrection, int nlevels) +{ + return new cv::HOGDescriptor(winSize, blockSize, blockStride, cellSize, nbins, derivAperture, + winSigma, histogramNormType, L2HysThreshold, gammaCorrection != 0, nlevels); +} +CVAPI(cv::HOGDescriptor*) objdetect_HOGDescriptor_new3(const char *filename) +{ + std::string filename_str(filename); + return new cv::HOGDescriptor(filename_str); +} +CVAPI(void) objdetect_HOGDescriptor_delete(cv::HOGDescriptor *obj) +{ + delete obj; +} + +CVAPI(size_t) objdetect_HOGDescriptor_getDescriptorSize(cv::HOGDescriptor *obj) +{ + return obj->getDescriptorSize(); +} +CVAPI(int) objdetect_HOGDescriptor_checkDetectorSize(cv::HOGDescriptor *obj) +{ + return obj->checkDetectorSize() ? 1 : 0; +} +CVAPI(double) objdetect_HOGDescriptor_getWinSigma(cv::HOGDescriptor *obj) +{ + return obj->getWinSigma(); +} + +CVAPI(void) objdetect_HOGDescriptor_setSVMDetector(cv::HOGDescriptor *obj, std::vector *svmdetector) +{ + obj->setSVMDetector(*svmdetector); +} + +CVAPI(bool) objdetect_HOGDescriptor_load(cv::HOGDescriptor *obj, const char *filename, const char *objname) +{ + std::string filenameStr(filename); + std::string objnameStr; + if (objname != NULL) + objnameStr = cv::String(objname); + return obj->load(filenameStr, objnameStr); +} +CVAPI(void) objdetect_HOGDescriptor_save(cv::HOGDescriptor *obj, const char *filename, const char *objname) +{ + std::string filenameStr(filename); + std::string objnameStr; + if (objname != NULL) + objnameStr = cv::String(objname); + obj->save(filenameStr, objnameStr); +} + +CVAPI(void) objdetect_HOGDescriptor_copyTo(cv::HOGDescriptor *obj, cv::HOGDescriptor *c) +{ + obj->copyTo(*c); +} + +CVAPI(void) objdetect_HOGDescriptor_compute(cv::HOGDescriptor *obj, cv::Mat *img, std::vector *descriptors, + CvSize winStride, CvSize padding, cv::Point* locations, int locationsLength) +{ + std::vector locationsVec; + if (locations != NULL) + locationsVec = std::vector(locations, locations + locationsLength); + + obj->compute(*img, *descriptors, winStride, padding, locationsVec); +} + +CVAPI(void) objdetect_HOGDescriptor_detect1(cv::HOGDescriptor *obj, cv::Mat *img, std::vector *foundLocations, + double hitThreshold, CvSize winStride, CvSize padding, cv::Point* searchLocations, int searchLocationsLength) +{ + std::vector slVec; + if (searchLocations != NULL) + slVec = std::vector(searchLocations, searchLocations + searchLocationsLength); + + obj->detect(*img, *foundLocations, hitThreshold, winStride, padding, slVec); +} +CVAPI(void) objdetect_HOGDescriptor_detect2(cv::HOGDescriptor *obj, cv::Mat *img, + std::vector *foundLocations, std::vector *weights, + double hitThreshold, CvSize winStride, CvSize padding, cv::Point* searchLocations, int searchLocationsLength) +{ + std::vector slVec; + if (searchLocations != NULL) + slVec = std::vector(searchLocations, searchLocations + searchLocationsLength); + + obj->detect(*img, *foundLocations, *weights, hitThreshold, winStride, padding, slVec); +} + +CVAPI(void) objdetect_HOGDescriptor_detectMultiScale1(cv::HOGDescriptor *obj, cv::Mat *img, + std::vector *foundLocations, + double hitThreshold, CvSize winStride, CvSize padding, double scale, int groupThreshold) +{ + obj->detectMultiScale(*img, *foundLocations, + hitThreshold, winStride, padding, scale, groupThreshold); +} +CVAPI(void) objdetect_HOGDescriptor_detectMultiScale2(cv::HOGDescriptor *obj, cv::Mat *img, + std::vector *foundLocations, std::vector *foundWeights, + double hitThreshold, CvSize winStride, CvSize padding, double scale, int groupThreshold) +{ + obj->detectMultiScale(*img, *foundLocations, *foundWeights, + hitThreshold, winStride, padding, scale, groupThreshold); +} + +CVAPI(void) objdetect_HOGDescriptor_computeGradient(cv::HOGDescriptor *obj, cv::Mat* img, + cv::Mat* grad, cv::Mat* angleOfs, CvSize paddingTL, CvSize paddingBR) +{ + obj->computeGradient(*img, *grad, *angleOfs, paddingTL, paddingBR); +} + +// evaluate specified ROI and return confidence value for each location +CVAPI(void) objdetect_HOGDescriptor_detectROI(cv::HOGDescriptor *obj, cv::Mat *img, cv::Point *locations, int locationsLength, + std::vector *foundLocations, std::vector *confidences, + double hitThreshold, CvSize winStride, CvSize padding) +{ + std::vector locationsVec(locations, locations + locationsLength); + obj->detectROI(*img, locationsVec, *foundLocations, *confidences, hitThreshold, winStride, padding); +} + +// evaluate specified ROI and return confidence value for each location in multiple scales +CVAPI(void) objdetect_HOGDescriptor_detectMultiScaleROI(cv::HOGDescriptor *obj, cv::Mat *img, std::vector *foundLocations, + std::vector *roiScales, std::vector > *roiLocations, std::vector > *roiConfidences, + double hitThreshold, int groupThreshold) +{ + std::vector locations; + obj->detectMultiScaleROI(*img, *foundLocations, locations, hitThreshold, groupThreshold); + + roiScales->resize(locations.size()); + roiLocations->resize(locations.size()); + roiConfidences->resize(locations.size()); + for (size_t i = 0; i < locations.size(); i++) + { + (*roiScales)[i] = locations[i].scale; + (*roiLocations)[i] = locations[i].locations; + (*roiConfidences)[i] = locations[i].confidences; + } +} + +// read/parse Dalal's alt model file +CVAPI(void) objdetect_HOGDescriptor_readALTModel(cv::HOGDescriptor *obj, const char *modelfile) +{ + obj->readALTModel(modelfile); +} +CVAPI(void) objdetect_HOGDescriptor_groupRectangles(cv::HOGDescriptor *obj, + std::vector *rectList, std::vector *weights, int groupThreshold, double eps) +{ + obj->groupRectangles(*rectList, *weights, groupThreshold, eps); +} + +#pragma endregion + +#pragma region Fields +CVAPI(MyCvSize) objdetect_HOGDescriptor_winSize_get(cv::HOGDescriptor *obj) +{ + return c(obj->winSize); +} +CVAPI(MyCvSize) objdetect_HOGDescriptor_blockSize_get(cv::HOGDescriptor *obj) +{ + return c(obj->blockSize); +} +CVAPI(MyCvSize) objdetect_HOGDescriptor_blockStride_get(cv::HOGDescriptor *obj) +{ + return c(obj->blockStride); +} +CVAPI(MyCvSize) objdetect_HOGDescriptor_cellSize_get(cv::HOGDescriptor *obj) +{ + return c(obj->winSize); +} +CVAPI(int) objdetect_HOGDescriptor_nbins_get(cv::HOGDescriptor *obj) +{ + return obj->nbins; +} +CVAPI(int) objdetect_HOGDescriptor_derivAperture_get(cv::HOGDescriptor *obj) +{ + return obj->derivAperture; +} +CVAPI(double) objdetect_HOGDescriptor_winSigma_get(cv::HOGDescriptor *obj) +{ + return obj->winSigma; +} +CVAPI(int) objdetect_HOGDescriptor_histogramNormType_get(cv::HOGDescriptor *obj) +{ + return obj->histogramNormType; +} +CVAPI(double) objdetect_HOGDescriptor_L2HysThreshold_get(cv::HOGDescriptor *obj) +{ + return obj->L2HysThreshold; +} +CVAPI(int) objdetect_HOGDescriptor_gammaCorrection_get(cv::HOGDescriptor *obj) +{ + return obj->gammaCorrection ? 1 : 0; +} +CVAPI(int) objdetect_HOGDescriptor_nlevels_get(cv::HOGDescriptor *obj) +{ + return obj->nlevels; +} + +CVAPI(void) objdetect_HOGDescriptor_winSize_set(cv::HOGDescriptor *obj, CvSize value) +{ + obj->winSize = value; +} +CVAPI(void) objdetect_HOGDescriptor_blockSize_set(cv::HOGDescriptor *obj, CvSize value) +{ + obj->blockSize = value; +} +CVAPI(void) objdetect_HOGDescriptor_blockStride_set(cv::HOGDescriptor *obj, CvSize value) +{ + obj->blockStride = value; +} +CVAPI(void) objdetect_HOGDescriptor_cellSize_set(cv::HOGDescriptor *obj, CvSize value) +{ + obj->cellSize = value; +} +CVAPI(void) objdetect_HOGDescriptor_nbins_set(cv::HOGDescriptor *obj, int value) +{ + obj->nbins = value; +} +CVAPI(void) objdetect_HOGDescriptor_derivAperture_set(cv::HOGDescriptor *obj, int value) +{ + obj->derivAperture = value; +} +CVAPI(void) objdetect_HOGDescriptor_winSigma_set(cv::HOGDescriptor *obj, double value) +{ + obj->winSigma = value; +} +CVAPI(void) objdetect_HOGDescriptor_histogramNormType_set(cv::HOGDescriptor *obj, int value) +{ + obj->histogramNormType = value; +} +CVAPI(void) objdetect_HOGDescriptor_L2HysThreshold_set(cv::HOGDescriptor *obj, double value) +{ + obj->L2HysThreshold = value; +} +CVAPI(void) objdetect_HOGDescriptor_gammaCorrection_set(cv::HOGDescriptor *obj, int value) +{ + obj->gammaCorrection = (value != 0); +} +CVAPI(void) objdetect_HOGDescriptor_nlevels_set(cv::HOGDescriptor *obj, int value) +{ + obj->nlevels = value; +} +#pragma endregion + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/optflow.cpp b/src/OpenCvSharpExtern/optflow.cpp new file mode 100644 index 000000000..0a0977790 --- /dev/null +++ b/src/OpenCvSharpExtern/optflow.cpp @@ -0,0 +1,2 @@ +#include "optflow.h" +#include "optflow_motempl.h" \ No newline at end of file diff --git a/src/OpenCvSharpExtern/optflow.h b/src/OpenCvSharpExtern/optflow.h new file mode 100644 index 000000000..bfa276dd0 --- /dev/null +++ b/src/OpenCvSharpExtern/optflow.h @@ -0,0 +1,43 @@ +#ifdef ENABLED_CONTRIB +#ifndef _CPP_OPTFLOW_H_ +#define _CPP_OPTFLOW_H_ + +#include "include_opencv.h" +using namespace cv::optflow; + +CVAPI(void) optflow_calcOpticalFlowSF1( + cv::Mat *from, + cv::Mat *to, + cv::Mat *flow, + int layers, + int averagingBlockSize, + int maxFlow) +{ + calcOpticalFlowSF(*from, *to, *flow, layers, averagingBlockSize, maxFlow); +} + +CVAPI(void) optflow_calcOpticalFlowSF2( + cv::Mat *from, + cv::Mat *to, + cv::Mat *flow, + int layers, + int averagingBlockSize, + int maxFlow, + double sigmaDist, + double sigmaColor, + int postprocessWindow, + double sigmaDistFix, + double sigmaColorFix, + double occThr, + int upscaleAveragingRadius, + double upscaleSigmaDist, + double upscaleSigmaColor, + double speedUpThr) +{ + calcOpticalFlowSF(*from, *to, *flow, layers, averagingBlockSize, maxFlow, + sigmaDist, sigmaColor, postprocessWindow, sigmaDistFix, sigmaColorFix, + occThr, upscaleAveragingRadius, upscaleSigmaDist, upscaleSigmaColor, speedUpThr); +} + +#endif +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/optflow_motempl.h b/src/OpenCvSharpExtern/optflow_motempl.h new file mode 100644 index 000000000..0981b48b0 --- /dev/null +++ b/src/OpenCvSharpExtern/optflow_motempl.h @@ -0,0 +1,38 @@ +#ifdef ENABLED_CONTRIB +#ifndef _CPP_OPTFLOW_MOTEMPL_H_ +#define _CPP_OPTFLOW_MOTEMPL_H_ + +#include "include_opencv.h" +using namespace cv::motempl; + +CVAPI(void) optflow_motempl_updateMotionHistory( + cv::_InputArray *silhouette, cv::_InputOutputArray *mhi, + double timestamp, double duration) +{ + updateMotionHistory(*silhouette, *mhi, timestamp, duration); +} + +CVAPI(void) optflow_motempl_calcMotionGradient( + cv::_InputArray *mhi, cv::_OutputArray *mask, cv::_OutputArray *orientation, + double delta1, double delta2, int apertureSize) +{ + calcMotionGradient(*mhi, *mask, *orientation, delta1, delta2, apertureSize); +} + +CVAPI(double) optflow_motempl_calcGlobalOrientation( + cv::_InputArray *orientation, cv::_InputArray *mask, + cv::_InputArray *mhi, double timestamp, double duration) +{ + return calcGlobalOrientation(*orientation, *mask, *mhi, timestamp, duration); +} + +CVAPI(void) optflow_motempl_segmentMotion( + cv::_InputArray *mhi, cv::_OutputArray *segmask, + std::vector *boundingRects, + double timestamp, double segThresh) +{ + segmentMotion(*mhi, *segmask, *boundingRects, timestamp, segThresh); +} + +#endif +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/photo.cpp b/src/OpenCvSharpExtern/photo.cpp new file mode 100644 index 000000000..83eb3c870 --- /dev/null +++ b/src/OpenCvSharpExtern/photo.cpp @@ -0,0 +1,2 @@ +#include "photo.h" +#include "photo_HDR.h" \ No newline at end of file diff --git a/src/OpenCvSharpExtern/photo.h b/src/OpenCvSharpExtern/photo.h new file mode 100644 index 000000000..722344a04 --- /dev/null +++ b/src/OpenCvSharpExtern/photo.h @@ -0,0 +1,117 @@ +#ifndef _CPP_PHOTO_H_ +#define _CPP_PHOTO_H_ + +#include "include_opencv.h" + + +CVAPI(void) photo_inpaint(cv::_InputArray *src, cv::_InputArray *inpaintMask, + cv::_OutputArray *dst, double inpaintRadius, int flags) +{ + cv::inpaint(*src, *inpaintMask, *dst, inpaintRadius, flags); +} + +CVAPI(void) photo_fastNlMeansDenoising(cv::_InputArray *src, cv::_OutputArray *dst, float h, + int templateWindowSize, int searchWindowSize) +{ + cv::fastNlMeansDenoising(*src, *dst, h, templateWindowSize, searchWindowSize); +} + +CVAPI(void) photo_fastNlMeansDenoisingColored(cv::_InputArray *src, cv::_OutputArray *dst, + float h, float hColor, int templateWindowSize, int searchWindowSize) +{ + cv::fastNlMeansDenoisingColored(*src, *dst, h, hColor, templateWindowSize, searchWindowSize); +} + +CVAPI(void) photo_fastNlMeansDenoisingMulti(cv::_InputArray ** srcImgs, int srcImgsLength, + cv::_OutputArray *dst, int imgToDenoiseIndex, int temporalWindowSize, + float h, int templateWindowSize, int searchWindowSize) +{ + std::vector srcImgsVec(srcImgsLength); + for (int i = 0; i < srcImgsLength; i++) + srcImgsVec[i] = *srcImgs[i]; + cv::fastNlMeansDenoisingMulti(srcImgsVec, *dst, imgToDenoiseIndex, temporalWindowSize, h, templateWindowSize, searchWindowSize); +} + +CVAPI(void) photo_fastNlMeansDenoisingColoredMulti(cv::_InputArray **srcImgs, int srcImgsLength, + cv::_OutputArray *dst, int imgToDenoiseIndex, int temporalWindowSize, + float h, float hColor, int templateWindowSize, int searchWindowSize) +{ + std::vector srcImgsVec(srcImgsLength); + for (int i = 0; i < srcImgsLength; i++) + srcImgsVec[i] = *srcImgs[i]; + cv::fastNlMeansDenoisingColoredMulti(srcImgsVec, *dst, imgToDenoiseIndex, temporalWindowSize, h, hColor, templateWindowSize, searchWindowSize); +} + +CVAPI(void) photo_denoise_TVL1( + cv::Mat **observations, int observationsSize, cv::Mat *result, double lambda, int niters) +{ + std::vector observationsVec(observationsSize); + for (int i = 0; i < observationsSize; i++) + { + observationsVec[i] = *observations[i]; + } + cv::denoise_TVL1(observationsVec, *result, lambda, niters); +} + + + +CVAPI(void) photo_decolor( + cv::_InputArray *src, cv::_OutputArray *grayscale, cv::_OutputArray *color_boost) +{ + cv::decolor(*src, *grayscale, *color_boost); +} + +CVAPI(void) photo_seamlessClone( + cv::_InputArray *src, cv::_InputArray *dst, cv::_InputArray *mask, MyCvPoint p, + cv::_OutputArray *blend, int flags) +{ + cv::seamlessClone(*src, *dst, entity(mask), cpp(p), *blend, flags); +} + +CVAPI(void) photo_colorChange( + cv::_InputArray *src, cv::_InputArray *mask, cv::_OutputArray *dst, float red_mul, + float green_mul, float blue_mul) +{ + cv::colorChange(*src, entity(mask), *dst, red_mul, green_mul, blue_mul); +} + +CVAPI(void) photo_illuminationChange( + cv::_InputArray *src, cv::_InputArray *mask, cv::_OutputArray *dst, + float alpha, float beta = 0.4f) +{ + cv::illuminationChange(*src, entity(mask), *dst, alpha, beta); +} + +CVAPI(void) photo_textureFlattening( + cv::_InputArray *src, cv::_InputArray *mask, cv::_OutputArray *dst, + float low_threshold, float high_threshold, int kernel_size) +{ + cv::textureFlattening(*src, entity(mask), *dst, low_threshold, high_threshold, kernel_size); +} + +CVAPI(void) photo_edgePreservingFilter( + cv::_InputArray *src, cv::_OutputArray *dst, int flags, float sigma_s, float sigma_r) +{ + cv::edgePreservingFilter(*src, *dst, flags, sigma_s, sigma_r); +} + +CVAPI(void) photo_detailEnhance( + cv::_InputArray *src, cv::_OutputArray *dst, float sigma_s, float sigma_r) +{ + cv::detailEnhance(*src, *dst, sigma_s, sigma_r); +} + +CVAPI(void) photo_pencilSketch( + cv::_InputArray *src, cv::_OutputArray *dst1, cv::_OutputArray *dst2, + float sigma_s, float sigma_r, float shade_factor) +{ + cv::pencilSketch(*src, *dst1, *dst2, sigma_s, sigma_r, shade_factor); +} + +CVAPI(void) photo_stylization( + cv::_InputArray *src, cv::_OutputArray *dst, float sigma_s, float sigma_r) +{ + cv::stylization(*src, *dst, sigma_s, sigma_r); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/photo_HDR.h b/src/OpenCvSharpExtern/photo_HDR.h new file mode 100644 index 000000000..6ca218d0a --- /dev/null +++ b/src/OpenCvSharpExtern/photo_HDR.h @@ -0,0 +1,54 @@ +#ifndef _CPP_PHOTO_HDR_H_ +#define _CPP_PHOTO_HDR_H_ + +#include "include_opencv.h" + +CVAPI(cv::Ptr*) photo_createCalibrateDebevec( + int samples, float lambda, int random) +{ + return clone(cv::createCalibrateDebevec(samples, lambda, random != 0)); +} + +CVAPI(cv::Ptr*) photo_createCalibrateRobertson( + int max_iter, float threshold) +{ + return clone(cv::createCalibrateRobertson(max_iter, threshold)); +} + +CVAPI(void) photo_Ptr_CalibrateDebevec_delete(cv::Ptr *obj) +{ + delete obj; +} +CVAPI(void) photo_Ptr_CalibrateRobertson_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(cv::CalibrateDebevec*) photo_Ptr_CalibrateDebevec_get(cv::Ptr *obj) +{ + return obj->get(); +} +CVAPI(cv::CalibrateRobertson*) photo_Ptr_CalibrateRobertson_get(cv::Ptr *obj) +{ + return obj->get(); +} + +CVAPI(void) photo_CalibrateCRF_process( + cv::CalibrateCRF *obj, + cv::Mat ** srcImgs, int srcImgsLength, cv::_OutputArray *dst, float* times) +{ + // Build Mat Vector of images + std::vector srcImgsVec(srcImgsLength); + + // Build float Vector of times + std::vector times_vec(srcImgsLength); + + for (int i = 0; i < srcImgsLength; i++) { + srcImgsVec[i] = *srcImgs[i]; + times_vec[i] = times[i]; + } + + obj->process(srcImgsVec, *dst, times_vec); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/shape.cpp b/src/OpenCvSharpExtern/shape.cpp new file mode 100644 index 000000000..60183316a --- /dev/null +++ b/src/OpenCvSharpExtern/shape.cpp @@ -0,0 +1 @@ +#include "shape_ShapeDistanceExtractor.h" \ No newline at end of file diff --git a/src/OpenCvSharpExtern/shape_ShapeDistanceExtractor.h b/src/OpenCvSharpExtern/shape_ShapeDistanceExtractor.h new file mode 100644 index 000000000..e097b29bf --- /dev/null +++ b/src/OpenCvSharpExtern/shape_ShapeDistanceExtractor.h @@ -0,0 +1,231 @@ +#ifndef _CPP_SHAPE_SHAPEDISTANCEEXTRACTOR_H_ +#define _CPP_SHAPE_SHAPEDISTANCEEXTRACTOR_H_ + +#include "include_opencv.h" + + +CVAPI(float) shape_ShapeDistanceExtractor_computeDistance( + cv::ShapeDistanceExtractor *obj, cv::_InputArray *contour1, cv::_InputArray *contour2) +{ + return obj->computeDistance(*contour1, *contour2); +} + +#pragma region ShapeContextDistanceExtractor + +CVAPI(void) shape_Ptr_ShapeContextDistanceExtractor_delete( + cv::Ptr *obj) +{ + delete obj; +} +CVAPI(cv::ShapeContextDistanceExtractor*) shape_Ptr_ShapeContextDistanceExtractor_get( + cv::Ptr *obj) +{ + return obj->get(); +} + +CVAPI(void) shape_ShapeContextDistanceExtractor_setAngularBins( + cv::ShapeContextDistanceExtractor *obj, int val) +{ + obj->setAngularBins(val); +} +CVAPI(int) shape_ShapeContextDistanceExtractor_getAngularBins( + cv::ShapeContextDistanceExtractor *obj) +{ + return obj->getAngularBins(); +} + +CVAPI(void) shape_ShapeContextDistanceExtractor_setRadialBins( + cv::ShapeContextDistanceExtractor *obj, int val) +{ + obj->setRadialBins(val); +} +CVAPI(int) shape_ShapeContextDistanceExtractor_getRadialBins( + cv::ShapeContextDistanceExtractor *obj) +{ + return obj->getRadialBins(); +} + +CVAPI(void) shape_ShapeContextDistanceExtractor_setInnerRadius( + cv::ShapeContextDistanceExtractor *obj, float val) +{ + obj->setInnerRadius(val); +} +CVAPI(float) shape_ShapeContextDistanceExtractor_getInnerRadius( + cv::ShapeContextDistanceExtractor *obj) +{ + return obj->getInnerRadius(); +} + +CVAPI(void) shape_ShapeContextDistanceExtractor_setOuterRadius( + cv::ShapeContextDistanceExtractor *obj, float val) +{ + obj->setOuterRadius(val); +} +CVAPI(float) shape_ShapeContextDistanceExtractor_getOuterRadius( + cv::ShapeContextDistanceExtractor *obj) +{ + return obj->getOuterRadius(); +} + +CVAPI(void) shape_ShapeContextDistanceExtractor_setRotationInvariant( + cv::ShapeContextDistanceExtractor *obj, int val) +{ + obj->setRotationInvariant(val != 0); +} +CVAPI(int) shape_ShapeContextDistanceExtractor_getRotationInvariant( + cv::ShapeContextDistanceExtractor *obj) +{ + return obj->getRotationInvariant() ? 1 : 0; +} + +CVAPI(void) shape_ShapeContextDistanceExtractor_setShapeContextWeight( + cv::ShapeContextDistanceExtractor *obj, float val) +{ + obj->setShapeContextWeight(val); +} +CVAPI(float) shape_ShapeContextDistanceExtractor_getShapeContextWeight( + cv::ShapeContextDistanceExtractor *obj) +{ + return obj->getShapeContextWeight(); +} + +CVAPI(void) shape_ShapeContextDistanceExtractor_setImageAppearanceWeight( + cv::ShapeContextDistanceExtractor *obj, float val) +{ + obj->setImageAppearanceWeight(val); +} +CVAPI(float) shape_ShapeContextDistanceExtractor_getImageAppearanceWeight( + cv::ShapeContextDistanceExtractor *obj) +{ + return obj->getImageAppearanceWeight(); +} + +CVAPI(void) shape_ShapeContextDistanceExtractor_setBendingEnergyWeight( + cv::ShapeContextDistanceExtractor *obj, float val) +{ + obj->setBendingEnergyWeight(val); +} +CVAPI(float) shape_ShapeContextDistanceExtractor_getBendingEnergyWeight( + cv::ShapeContextDistanceExtractor *obj) +{ + return obj->getBendingEnergyWeight(); +} + +CVAPI(void) shape_ShapeContextDistanceExtractor_setImages( + cv::ShapeContextDistanceExtractor *obj, cv::_InputArray *image1, cv::_InputArray *image2) +{ + obj->setImages(*image1, *image2); +} +CVAPI(void) shape_ShapeContextDistanceExtractor_getImages( + cv::ShapeContextDistanceExtractor *obj, cv::_OutputArray *image1, cv::_OutputArray *image2) +{ + obj->getImages(*image1, *image2); +} + +CVAPI(void) shape_ShapeContextDistanceExtractor_setIterations( + cv::ShapeContextDistanceExtractor *obj, int val) +{ + obj->setIterations(val); +} +CVAPI(int) shape_ShapeContextDistanceExtractor_getIterations( + cv::ShapeContextDistanceExtractor *obj) +{ + return obj->getIterations(); +} + +/* +CVAPI(void) shape_ShapeContextDistanceExtractor_setCostExtractor( + cv::ShapeContextDistanceExtractor *obj, Ptr comparer) +{ + +} +CVAPI(Ptr) shape_ShapeContextDistanceExtractor_getCostExtractor( + cv::ShapeContextDistanceExtractor *obj) +{ + +}*/ + +CVAPI(void) shape_ShapeContextDistanceExtractor_setStdDev( + cv::ShapeContextDistanceExtractor *obj, float val) +{ + obj->setStdDev(val); +} +CVAPI(float) shape_ShapeContextDistanceExtractor_getStdDev( + cv::ShapeContextDistanceExtractor *obj) +{ + return obj->getStdDev(); +} + +/* +CVAPI(void) shape_ShapeContextDistanceExtractor_setTransformAlgorithm( + cv::ShapeContextDistanceExtractor *obj, Ptr transformer) +{ +} +CVAPI(Ptr) shape_ShapeContextDistanceExtractor_getTransformAlgorithm( + cv::ShapeContextDistanceExtractor *obj) +{ + +} +*/ + +CVAPI(cv::Ptr*) shape_createShapeContextDistanceExtractor( + int nAngularBins, int nRadialBins, + float innerRadius, float outerRadius, int iterations/*, + const Ptr &comparer = createChiHistogramCostExtractor(), + const Ptr &transformer = createThinPlateSplineShapeTransformer()*/) +{ + cv::Ptr p = cv::createShapeContextDistanceExtractor( + nAngularBins, nRadialBins, innerRadius, outerRadius, iterations); + return new cv::Ptr(p); +} + +#pragma endregion + +#pragma region HausdorffDistanceExtractor + +CVAPI(void) shape_Ptr_HausdorffDistanceExtractor_delete( + cv::Ptr *obj) +{ + delete obj; +} +CVAPI(cv::HausdorffDistanceExtractor*) shape_Ptr_HausdorffDistanceExtractor_get( + cv::Ptr *obj) +{ + return obj->get(); +} + + +CVAPI(void) shape_HausdorffDistanceExtractor_setDistanceFlag( + cv::HausdorffDistanceExtractor *obj, int val) +{ + obj->setDistanceFlag(val); +} +CVAPI(int) shape_HausdorffDistanceExtractor_getDistanceFlag( + cv::HausdorffDistanceExtractor *obj) +{ + return obj->getDistanceFlag(); +} + +CVAPI(void) shape_HausdorffDistanceExtractor_setRankProportion( + cv::HausdorffDistanceExtractor *obj, float val) +{ + obj->setRankProportion(val); +} +CVAPI(float) shape_HausdorffDistanceExtractor_getRankProportion( + cv::HausdorffDistanceExtractor *obj) +{ + return obj->getRankProportion(); +} + + +CVAPI(cv::Ptr*) shape_createHausdorffDistanceExtractor( + int distanceFlag, float rankProp) +{ + cv::Ptr p = cv::createHausdorffDistanceExtractor( + distanceFlag, rankProp); + return new cv::Ptr(p); +} + +#pragma endregion + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/std_vector.cpp b/src/OpenCvSharpExtern/std_vector.cpp new file mode 100644 index 000000000..0abe33f41 --- /dev/null +++ b/src/OpenCvSharpExtern/std_vector.cpp @@ -0,0 +1 @@ +#include "std_vector.h" \ No newline at end of file diff --git a/src/OpenCvSharpExtern/std_vector.h b/src/OpenCvSharpExtern/std_vector.h new file mode 100644 index 000000000..2624099ab --- /dev/null +++ b/src/OpenCvSharpExtern/std_vector.h @@ -0,0 +1,827 @@ +#ifndef _CPP_WVECTOR_H_ +#define _CPP_WVECTOR_H_ + +#include "include_opencv.h" + +using namespace std; + +#pragma region uchar +CVAPI(vector*) vector_uchar_new1() +{ + return new vector; +} +CVAPI(vector*) vector_uchar_new2(size_t size) +{ + return new vector(size); +} +CVAPI(vector*) vector_uchar_new3(uchar* data, size_t dataLength) +{ + return new vector(data, data + dataLength); +} +CVAPI(size_t) vector_uchar_getSize(vector* vector) +{ + return vector->size(); +} +CVAPI(uchar*) vector_uchar_getPointer(vector* vector) +{ + return &(vector->at(0)); +} +CVAPI(void) vector_vector_uchar_copy(vector *vector, uchar *dst) +{ + size_t length = sizeof(uchar)* vector->size(); + memcpy(dst, &(vector->at(0)), length); +} +CVAPI(void) vector_uchar_delete(vector* vector) +{ + delete vector; +} +#pragma endregion + +#pragma region int +CVAPI(vector*) vector_int32_new1() +{ + return new vector; +} +CVAPI(vector*) vector_int32_new2(size_t size) +{ + return new vector(size); +} +CVAPI(vector*) vector_int32_new3(int* data, size_t dataLength) +{ + return new vector(data, data + dataLength); +} +CVAPI(size_t) vector_int32_getSize(vector* vector) +{ + return vector->size(); +} +CVAPI(int*) vector_int32_getPointer(vector* vector) +{ + return &(vector->at(0)); +} +CVAPI(void) vector_int32_delete(vector* vector) +{ + delete vector; +} +#pragma endregion + +#pragma region float +CVAPI(vector*) vector_float_new1() +{ + return new vector; +} +CVAPI(vector*) vector_float_new2(size_t size) +{ + return new vector(size); +} +CVAPI(vector*) vector_float_new3(float* data, size_t dataLength) +{ + return new vector(data, data + dataLength); +} +CVAPI(size_t) vector_float_getSize(vector* vector) +{ + return vector->size(); +} +CVAPI(float*) vector_float_getPointer(vector* vector) +{ + return &(vector->at(0)); +} +CVAPI(void) vector_float_delete(vector* vector) +{ + delete vector; +} +#pragma endregion + +#pragma region double +CVAPI(vector*) vector_double_new1() +{ + return new vector; +} +CVAPI(vector*) vector_double_new2(size_t size) +{ + return new vector(size); +} +CVAPI(vector*) vector_double_new3(float* data, size_t dataLength) +{ + return new vector(data, data + dataLength); +} +CVAPI(size_t) vector_double_getSize(vector* vector) +{ + return vector->size(); +} +CVAPI(double*) vector_double_getPointer(vector* vector) +{ + return &(vector->at(0)); +} +CVAPI(void) vector_double_delete(vector* vector) +{ + delete vector; +} +#pragma endregion + +#pragma region cv::Vec2f +CVAPI(vector*) vector_Vec2f_new1() +{ + return new vector; +} +CVAPI(vector*) vector_Vec2f_new2(size_t size) +{ + return new vector(size); +} +CVAPI(vector*) vector_Vec2f_new3(cv::Vec2f* data, size_t dataLength) +{ + return new vector(data, data + dataLength); +} +CVAPI(size_t) vector_Vec2f_getSize(vector* vector) +{ + return vector->size(); +} +CVAPI(cv::Vec2f*) vector_Vec2f_getPointer(vector* vector) +{ + return &(vector->at(0)); +} +CVAPI(void) vector_Vec2f_delete(vector* vector) +{ + delete vector; +} +#pragma endregion + +#pragma region cv::Vec3f +CVAPI(vector*) vector_Vec3f_new1() +{ + return new vector; +} +CVAPI(vector*) vector_Vec3f_new2(size_t size) +{ + return new vector(size); +} +CVAPI(vector*) vector_Vec3f_new3(cv::Vec3f* data, size_t dataLength) +{ + return new vector(data, data + dataLength); +} +CVAPI(size_t) vector_Vec3f_getSize(vector* vector) +{ + return vector->size(); +} +CVAPI(cv::Vec3f*) vector_Vec3f_getPointer(vector* vector) +{ + return &(vector->at(0)); +} +CVAPI(void) vector_Vec3f_delete(vector* vector) +{ + delete vector; +} +#pragma endregion + +#pragma region cv::Vec4f +CVAPI(vector*) vector_Vec4f_new1() +{ + return new vector; +} +CVAPI(vector*) vector_Vec4f_new2(size_t size) +{ + return new vector(size); +} +CVAPI(vector*) vector_Vec4f_new3(cv::Vec4f* data, size_t dataLength) +{ + return new vector(data, data + dataLength); +} +CVAPI(size_t) vector_Vec4f_getSize(vector* vector) +{ + return vector->size(); +} +CVAPI(cv::Vec4f*) vector_Vec4f_getPointer(vector* vector) +{ + return &(vector->at(0)); +} +CVAPI(void) vector_Vec4f_delete(vector* vector) +{ + delete vector; +} +#pragma endregion + +#pragma region cv::Vec4i +CVAPI(vector*) vector_Vec4i_new1() +{ + return new vector; +} +CVAPI(vector*) vector_Vec4i_new2(size_t size) +{ + return new vector(size); +} +CVAPI(vector*) vector_Vec4i_new3(cv::Vec4i* data, size_t dataLength) +{ + return new vector(data, data + dataLength); +} +CVAPI(size_t) vector_Vec4i_getSize(vector* vector) +{ + return vector->size(); +} +CVAPI(cv::Vec4i*) vector_Vec4i_getPointer(vector* vector) +{ + return &(vector->at(0)); +} +CVAPI(void) vector_Vec4i_delete(vector* vector) +{ + delete vector; +} +#pragma endregion + +#pragma region cv::Vec6f +CVAPI(vector*) vector_Vec6f_new1() +{ + return new vector; +} +CVAPI(vector*) vector_Vec6f_new2(size_t size) +{ + return new vector(size); +} +CVAPI(vector*) vector_Vec6f_new3(cv::Vec6f* data, size_t dataLength) +{ + return new vector(data, data + dataLength);; +} +CVAPI(size_t) vector_Vec6f_getSize(vector* vector) +{ + return vector->size(); +} +CVAPI(cv::Vec6f*) vector_Vec6f_getPointer(vector* vector) +{ + return &(vector->at(0)); +} +CVAPI(void) vector_Vec6f_delete(vector* vector) +{ + delete vector; +} +#pragma endregion + +#pragma region cv::Vec6d +CVAPI(vector*) vector_Vec6d_new1() +{ + return new vector; +} +CVAPI(vector*) vector_Vec6d_new2(size_t size) +{ + return new vector(size); +} +CVAPI(vector*) vector_Vec6d_new3(cv::Vec6d* data, size_t dataLength) +{ + return new vector(data, data + dataLength); +} +CVAPI(size_t) vector_Vec6d_getSize(vector* vector) +{ + return vector->size(); +} +CVAPI(cv::Vec6d*) vector_Vec6d_getPointer(vector* vector) +{ + return &(vector->at(0)); +} +CVAPI(void) vector_Vec6d_delete(vector* vector) +{ + delete vector; +} +#pragma endregion + +#pragma region cv::Point2i +CVAPI(vector*) vector_Point2i_new1() +{ + return new vector; +} +CVAPI(vector*) vector_Point2i_new2(size_t size) +{ + return new vector(size); +} +CVAPI(vector*) vector_Point2i_new3(cv::Point* data, size_t dataLength) +{ + return new vector(data, data + dataLength); +} +CVAPI(size_t) vector_Point2i_getSize(vector* vector) +{ + return vector->size(); +} +CVAPI(cv::Point*) vector_Point2i_getPointer(vector* vector) +{ + return &(vector->at(0)); +} +CVAPI(void) vector_Point2i_delete(vector* vector) +{ + delete vector; +} +#pragma endregion + +#pragma region cv::Point2f +CVAPI(vector*) vector_Point2f_new1() +{ + return new vector; +} +CVAPI(vector*) vector_Point2f_new2(size_t size) +{ + return new vector(size); +} +CVAPI(vector*) vector_Point2f_new3(cv::Point2f* data, size_t dataLength) +{ + return new vector(data, data + dataLength); +} +CVAPI(size_t) vector_Point2f_getSize(vector* vector) +{ + return vector->size(); +} +CVAPI(cv::Point2f*) vector_Point2f_getPointer(vector* vector) +{ + return &(vector->at(0)); +} +CVAPI(void) vector_Point2f_delete(vector* vector) +{ + delete vector; +} +#pragma endregion + +#pragma region cv::Point3f +CVAPI(vector*) vector_Point3f_new1() +{ + return new vector; +} +CVAPI(vector*) vector_Point3f_new2(size_t size) +{ + return new vector(size); +} +CVAPI(vector*) vector_Point3f_new3(cv::Point3f* data, size_t dataLength) +{ + return new vector(data, data + dataLength); +} +CVAPI(size_t) vector_Point3f_getSize(vector* vector) +{ + return vector->size(); +} +CVAPI(cv::Point3f*) vector_Point3f_getPointer(vector* vector) +{ + return &(vector->at(0)); +} +CVAPI(void) vector_Point3f_delete(vector* vector) +{ + delete vector; +} +#pragma endregion + +#pragma region cv::Rect +CVAPI(vector*) vector_Rect_new1() +{ + return new vector; +} +CVAPI(vector*) vector_Rect_new2(size_t size) +{ + return new vector(size); +} +CVAPI(vector*) vector_Rect_new3(cv::Rect* data, size_t dataLength) +{ + return new vector(data, data + dataLength); +} +CVAPI(size_t) vector_Rect_getSize(vector* vector) +{ + return vector->size(); +} +CVAPI(cv::Rect*) vector_Rect_getPointer(vector *vector) +{ + return &(vector->at(0)); +} +CVAPI(void) vector_Rect_delete(vector *vector) +{ + //vector->~vector(); + delete vector; +} + +#pragma endregion + +#pragma region cv::KeyPoint +CVAPI(vector*) vector_KeyPoint_new1() +{ + return new vector; +} +CVAPI(vector*) vector_KeyPoint_new2(size_t size) +{ + return new vector(size); +} +CVAPI(vector*) vector_KeyPoint_new3(cv::KeyPoint *data, size_t dataLength) +{ + return new vector(data, data + dataLength); +} +CVAPI(size_t) vector_KeyPoint_getSize(vector* vector) +{ + return vector->size(); +} +CVAPI(cv::KeyPoint*) vector_KeyPoint_getPointer(vector* vector) +{ + return &(vector->at(0)); +} +CVAPI(void) vector_KeyPoint_delete(vector* vector) +{ + //vector->~vector(); + delete vector; +} +#pragma endregion + +#pragma region cv::DMatch +CVAPI(vector*) vector_DMatch_new1() +{ + return new vector; +} +CVAPI(vector*) vector_DMatch_new2(size_t size) +{ + return new vector(size); +} +CVAPI(vector*) vector_DMatch_new3(cv::DMatch *data, size_t dataLength) +{ + return new vector(data, data + dataLength); +} +CVAPI(size_t) vector_DMatch_getSize(vector* vector) +{ + return vector->size(); +} +CVAPI(cv::DMatch*) vector_DMatch_getPointer(vector* vector) +{ + return &(vector->at(0)); +} +CVAPI(void) vector_DMatch_delete(vector* vector) +{ + delete vector; +} +#pragma endregion + +#pragma region vector +CVAPI(vector >*) vector_vector_float_new1() +{ + return new vector >; +} +CVAPI(vector >*) vector_vector_float_new2(size_t size) +{ + return new vector >(size); +} +CVAPI(size_t) vector_vector_float_getSize1(vector >* vec) +{ + return vec->size(); +} +CVAPI(void) vector_vector_float_getSize2(vector >* vec, size_t *sizes) +{ + for (size_t i = 0; i < vec->size(); i++) + { + sizes[i] = vec->at(i).size(); + } +} +CVAPI(vector*) vector_vector_float_getPointer(vector >* vec) +{ + return &(vec->at(0)); +} +CVAPI(void) vector_vector_float_copy(vector > *vec, float **dst) +{ + for (size_t i = 0; i < vec->size(); i++) + { + vector &elem = vec->at(i); + void *src = &elem[0]; + size_t length = sizeof(float) * elem.size(); + memcpy(dst[i], src, length); + } +} +CVAPI(void) vector_vector_float_delete(vector >* vec) +{ + delete vec; +} +#pragma endregion + +#pragma region vector +CVAPI(vector >*) vector_vector_double_new1() +{ + return new vector >; +} +CVAPI(vector >*) vector_vector_double_new2(size_t size) +{ + return new vector >(size); +} +CVAPI(size_t) vector_vector_double_getSize1(vector >* vec) +{ + return vec->size(); +} +CVAPI(void) vector_vector_double_getSize2(vector >* vec, size_t *sizes) +{ + for (size_t i = 0; i < vec->size(); i++) + { + sizes[i] = vec->at(i).size(); + } +} +CVAPI(vector*) vector_vector_double_getPointer(vector >* vec) +{ + return &(vec->at(0)); +} +CVAPI(void) vector_vector_double_copy(vector > *vec, double **dst) +{ + for (size_t i = 0; i < vec->size(); i++) + { + vector &elem = vec->at(i); + void *src = &elem[0]; + size_t length = sizeof(double) * elem.size(); + memcpy(dst[i], src, length); + } +} +CVAPI(void) vector_vector_double_delete(vector >* vec) +{ + delete vec; +} +#pragma endregion + +#pragma region vector +CVAPI(vector >*) vector_vector_KeyPoint_new1() +{ + return new vector >; +} +CVAPI(vector >*) vector_vector_KeyPoint_new2(size_t size) +{ + return new vector >(size); +} +CVAPI(vector >*) vector_vector_KeyPoint_new3( + cv::KeyPoint **values, int size1, int *size2) +{ + vector > *vec = new std::vector >(size1); + for (int i = 0; i < size1; i++) + { + vec->at(i) = std::vector(values[i], values[i] + size2[i]); + } + return vec; +} + +CVAPI(size_t) vector_vector_KeyPoint_getSize1(vector >* vec) +{ + return vec->size(); +} +CVAPI(void) vector_vector_KeyPoint_getSize2(vector >* vec, size_t *sizes) +{ + for (size_t i = 0; i < vec->size(); i++) + { + sizes[i] = vec->at(i).size(); + } +} +CVAPI(vector*) vector_vector_KeyPoint_getPointer(vector >* vec) +{ + return &(vec->at(0)); +} +CVAPI(void) vector_vector_KeyPoint_copy(vector > *vec, cv::KeyPoint **dst) +{ + for (size_t i = 0; i < vec->size(); i++) + { + vector &elem = vec->at(i); + void *src = &elem[0]; + size_t length = sizeof(cv::KeyPoint) * elem.size(); + memcpy(dst[i], src, length); + } +} +CVAPI(void) vector_vector_KeyPoint_delete(vector >* vec) +{ + delete vec; +} +#pragma endregion + +#pragma region vector +CVAPI(vector >*) vector_vector_DMatch_new1() +{ + return new vector >; +} +CVAPI(vector >*) vector_vector_DMatch_new2(size_t size) +{ + return new vector >(size); +} +CVAPI(size_t) vector_vector_DMatch_getSize1(vector >* vec) +{ + return vec->size(); +} +CVAPI(void) vector_vector_DMatch_getSize2(vector >* vec, size_t *sizes) +{ + for (size_t i = 0; i < vec->size(); i++) + { + sizes[i] = vec->at(i).size(); + } +} +CVAPI(vector*) vector_vector_DMatch_getPointer(vector >* vec) +{ + return &(vec->at(0)); +} +CVAPI(void) vector_vector_DMatch_copy(vector > *vec, cv::DMatch **dst) +{ + for (size_t i = 0; i < vec->size(); i++) + { + vector &elem = vec->at(i); + void *src = &elem[0]; + size_t length = sizeof(cv::DMatch) * elem.size(); + memcpy(dst[i], src, length); + } +} +CVAPI(void) vector_vector_DMatch_delete(vector >* vec) +{ + delete vec; +} +#pragma endregion + +#pragma region vector +CVAPI(vector >*) vector_vector_Point_new1() +{ + return new vector >; +} +CVAPI(vector >*) vector_vector_Point_new2(size_t size) +{ + return new vector >(size); +} +CVAPI(size_t) vector_vector_Point_getSize1(vector >* vec) +{ + return vec->size(); +} +CVAPI(void) vector_vector_Point_getSize2(vector >* vec, size_t *sizes) +{ + for (size_t i = 0; i < vec->size(); i++) + { + sizes[i] = vec->at(i).size(); + } +} +CVAPI(vector*) vector_vector_Point_getPointer(vector >* vec) +{ + return &(vec->at(0)); +} +CVAPI(void) vector_vector_Point_copy(vector > *vec, cv::Point **dst) +{ + for (size_t i = 0; i < vec->size(); i++) + { + vector &elem = vec->at(i); + void *src = &elem[0]; + size_t length = sizeof(cv::Point) * elem.size(); + memcpy(dst[i], src, length); + } +} +CVAPI(void) vector_vector_Point_delete(vector >* vec) +{ + delete vec; +} +#pragma endregion + +#pragma region vector +CVAPI(vector >*) vector_vector_Point2f_new1() +{ + return new vector >; +} +CVAPI(vector >*) vector_vector_Point2f_new2(size_t size) +{ + return new vector >(size); +} +CVAPI(size_t) vector_vector_Point2f_getSize1(vector >* vec) +{ + return vec->size(); +} +CVAPI(void) vector_vector_Point2f_getSize2(vector >* vec, size_t *sizes) +{ + for (size_t i = 0; i < vec->size(); i++) + { + sizes[i] = vec->at(i).size(); + } +} +CVAPI(vector*) vector_vector_Point2f_getPointer(vector >* vec) +{ + return &(vec->at(0)); +} +CVAPI(void) vector_vector_Point2f_copy(vector > *vec, cv::Point2f **dst) +{ + for (size_t i = 0; i < vec->size(); i++) + { + vector &elem = vec->at(i); + void *src = &elem[0]; + size_t length = sizeof(cv::Point2f) * elem.size(); + memcpy(dst[i], src, length); + } +} +CVAPI(void) vector_vector_Point2f_delete(vector >* vec) +{ + delete vec; +} +#pragma endregion + +#pragma region std::string +CVAPI(vector*) vector_string_new1() +{ + return new vector; +} +CVAPI(vector*) vector_string_new2(size_t size) +{ + return new vector(size); +} +CVAPI(size_t) vector_string_getSize(vector *vec) +{ + return vec->size(); +} +CVAPI(string*) vector_string_getPointer(vector *vector) +{ + return &(vector->at(0)); +} +CVAPI(const char*) vector_string_elemAt(vector *vector, int i) +{ + return vector->at(i).c_str(); +} +CVAPI(void) vector_string_delete(vector *vector) +{ + delete vector; +} +#pragma endregion + +#pragma region cv::Mat +CVAPI(vector*) vector_Mat_new1() +{ + return new vector; +} +CVAPI(vector*) vector_Mat_new2(size_t size) +{ + return new vector(size); +} +CVAPI(vector*) vector_Mat_new3(cv::Mat *data, size_t dataLength) +{ + vector* vec = new vector(dataLength); + for (size_t i = 0; ipush_back(data[i]); + } + return vec; +} +CVAPI(size_t) vector_Mat_getSize(vector* vector) +{ + return vector->size(); +} +CVAPI(cv::Mat*) vector_Mat_getPointer(vector* vector) +{ + return &(vector->at(0)); +} +CVAPI(void) vector_Mat_assignToArray(vector* vector, cv::Mat** arr) +{ + for (size_t i = 0; i < vector->size(); i++) + { + (vector->at(i)).assignTo(*(arr[i])); + } +} +CVAPI(void) vector_Mat_addref(vector* vector) +{ + for (std::vector::iterator m = vector->begin(); m != vector->end(); m++) + { + m->addref(); + } +} +CVAPI(void) vector_Mat_delete(vector* vector) +{ + //vector->~vector(); + delete vector; +} +#pragma endregion + +#pragma region cv::ml::DTrees::Node +CVAPI(vector*) vector_DTrees_Node_new1() +{ + return new vector; +} +CVAPI(vector*) vector_DTrees_Node_new2(size_t size) +{ + return new vector(size); +} +CVAPI(vector*) vector_DTrees_Node_new3(cv::ml::DTrees::Node *data, size_t dataLength) +{ + return new vector(data, data + dataLength); +} +CVAPI(size_t) vector_DTrees_Node_getSize(vector *vector) +{ + return vector->size(); +} +CVAPI(cv::ml::DTrees::Node*) vector_DTrees_Node_getPointer(vector *vector) +{ + return &(vector->at(0)); +} +CVAPI(void) vector_DTrees_Node_delete(vector *vector) +{ + delete vector; +} +#pragma endregion + +#pragma region cv::ml::DTrees::Split +CVAPI(vector*) vector_DTrees_Split_new1() +{ + return new vector; +} +CVAPI(vector*) vector_DTrees_Split_new2(size_t size) +{ + return new vector(size); +} +CVAPI(vector*) vector_DTrees_Split_new3(cv::ml::DTrees::Split *data, size_t dataLength) +{ + return new vector(data, data + dataLength); +} +CVAPI(size_t) vector_DTrees_Split_getSize(vector *vector) +{ + return vector->size(); +} +CVAPI(cv::ml::DTrees::Split*) vector_DTrees_Split_getPointer(vector *vector) +{ + return &(vector->at(0)); +} +CVAPI(void) vector_DTrees_Split_delete(vector *vector) +{ + delete vector; +} +#pragma endregion + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/stitching.cpp b/src/OpenCvSharpExtern/stitching.cpp new file mode 100644 index 000000000..e232613bc --- /dev/null +++ b/src/OpenCvSharpExtern/stitching.cpp @@ -0,0 +1,2 @@ +#include "stitching.h" +#include "stitching_detail_Matchers.h" \ No newline at end of file diff --git a/src/OpenCvSharpExtern/stitching.h b/src/OpenCvSharpExtern/stitching.h new file mode 100644 index 000000000..cf981c37b --- /dev/null +++ b/src/OpenCvSharpExtern/stitching.h @@ -0,0 +1,200 @@ +#ifndef _CPP_STITCHING_H_ +#define _CPP_STITCHING_H_ + +#include "include_opencv.h" + +CVAPI(cv::Ptr*) stitching_createStitcher(int try_use_cpu) +{ + cv::Ptr ptr = cv::createStitcher(try_use_cpu != 0); + return new cv::Ptr(ptr); +} + +CVAPI(void) stitching_Ptr_Stitcher_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(cv::Stitcher*) stitching_Ptr_Stitcher_get(cv::Ptr *obj) +{ + return obj->get(); +} + +#pragma region getter/setter +CVAPI(double) stitching_Stitcher_registrationResol(cv::Stitcher *obj) +{ + return obj->registrationResol(); +} +CVAPI(void) stitching_Stitcher_setRegistrationResol(cv::Stitcher *obj, double resol_mpx) +{ + obj->setRegistrationResol(resol_mpx); +} + +CVAPI(double) stitching_Stitcher_seamEstimationResol(cv::Stitcher *obj) +{ + return obj->seamEstimationResol(); +} +CVAPI(void) stitching_Stitcher_setSeamEstimationResol(cv::Stitcher *obj, double resol_mpx) +{ + obj->setSeamEstimationResol(resol_mpx); +} + +CVAPI(double) stitching_Stitcher_compositingResol(cv::Stitcher *obj) +{ + return obj->compositingResol(); +} +CVAPI(void) stitching_Stitcher_setCompositingResol(cv::Stitcher *obj, double resol_mpx) +{ + obj->setCompositingResol(resol_mpx); +} + +CVAPI(double) stitching_Stitcher_panoConfidenceThresh(cv::Stitcher *obj) +{ + return obj->panoConfidenceThresh(); +} +CVAPI(void) stitching_Stitcher_setPanoConfidenceThresh(cv::Stitcher *obj, double conf_thresh) +{ + obj->setPanoConfidenceThresh(conf_thresh); +} + +CVAPI(int) stitching_Stitcher_waveCorrection(cv::Stitcher *obj) +{ + return obj->waveCorrection() ? 1 : 0; +} +CVAPI(void) stitching_Stitcher_setWaveCorrection(cv::Stitcher *obj, int flag) +{ + obj->setWaveCorrection(flag != 0); +} + +CVAPI(int) stitching_Stitcher_waveCorrectKind(cv::Stitcher *obj) +{ + return static_cast(obj->waveCorrectKind()); +} +CVAPI(void) stitching_Stitcher_setWaveCorrectKind(cv::Stitcher *obj, int kind) +{ + obj->setWaveCorrectKind(static_cast(kind)); +} + +#pragma endregion + +CVAPI(int) stitching_Stitcher_estimateTransform_InputArray1( + cv::Stitcher *obj, cv::_InputArray *images) +{ + cv::Stitcher::Status status = obj->estimateTransform(*images); + return static_cast(status); +} +CVAPI(int) stitching_Stitcher_estimateTransform_InputArray2( + cv::Stitcher *obj, cv::_InputArray *images, + CvRect **rois, int roisSize1, int *roisSize2) +{ + std::vector > roisVec; + toVec(rois, roisSize1, roisSize2, roisVec); + + cv::Stitcher::Status status = obj->estimateTransform(*images, roisVec); + return static_cast(status); +} +CVAPI(int) stitching_Stitcher_estimateTransform_MatArray1( + cv::Stitcher *obj, cv::Mat **images, int imagesSize) +{ + std::vector imagesVec; + toVec(images, imagesSize, imagesVec); + + cv::Stitcher::Status status = obj->estimateTransform(imagesVec); + return static_cast(status); +} +CVAPI(int) stitching_Stitcher_estimateTransform_MatArray2( + cv::Stitcher *obj, cv::Mat **images, int imagesSize, + CvRect **rois, int roisSize1, int *roisSize2) +{ + std::vector imagesVec; + toVec(images, imagesSize, imagesVec); + + std::vector > roisVec; + toVec(rois, roisSize1, roisSize2, roisVec); + + cv::Stitcher::Status status = obj->estimateTransform(imagesVec, roisVec); + return static_cast(status); +} + +CVAPI(int) stitching_Stitcher_composePanorama1( + cv::Stitcher *obj, cv::_OutputArray *pano) +{ + cv::Stitcher::Status status = obj->composePanorama(*pano); + return static_cast(status); +} +CVAPI(int) stitching_Stitcher_composePanorama2_InputArray( + cv::Stitcher *obj, cv::_InputArray *images, cv::_OutputArray *pano) +{ + cv::Stitcher::Status status = obj->composePanorama(*images, *pano); + return static_cast(status); +} +CVAPI(int) stitching_Stitcher_composePanorama2_MatArray( + cv::Stitcher *obj, cv::Mat **images, int imagesSize, cv::_OutputArray *pano) +{ + std::vector imagesVec; + toVec(images, imagesSize, imagesVec); + + cv::Stitcher::Status status = obj->composePanorama(imagesVec, *pano); + return static_cast(status); +} + +CVAPI(int) stitching_Stitcher_stitch1_InputArray( + cv::Stitcher *obj, cv::_InputArray *images, cv::_OutputArray *pano) +{ + cv::Stitcher::Status status = obj->stitch(*images, *pano); + return static_cast(status); +} + +CVAPI(int) stitching_Stitcher_stitch1_MatArray( + cv::Stitcher *obj, cv::Mat **images, int imagesSize, cv::_OutputArray *pano) +{ + std::vector imagesVec; + toVec(images, imagesSize, imagesVec); + + cv::Stitcher::Status status = obj->stitch(imagesVec, *pano); + return static_cast(status); +} + +CVAPI(int) stitching_Stitcher_stitch2_InputArray( + cv::Stitcher *obj, cv::_InputArray *images, + CvRect **rois, int roisSize1, int *roisSize2, + cv::_OutputArray *pano) +{ + std::vector > roisVec; + toVec(rois, roisSize1, roisSize2, roisVec); + + cv::Stitcher::Status status = obj->stitch(*images, roisVec, *pano); + return static_cast(status); +} + +CVAPI(int) stitching_Stitcher_stitch2_MatArray( + cv::Stitcher *obj, cv::Mat **images, int imagesSize, + CvRect **rois, int roisSize1, int *roisSize2, + cv::_OutputArray *pano) +{ + std::vector imagesVec; + toVec(images, imagesSize, imagesVec); + + std::vector > roisVec; + toVec(rois, roisSize1, roisSize2, roisVec); + + cv::Stitcher::Status status = obj->stitch(imagesVec, roisVec, *pano); + return static_cast(status); +} + + + +CVAPI(void) stitching_Stitcher_component(cv::Stitcher *obj, int **pointer, int *length) +{ + const std::vector &val = obj->component(); + *pointer = const_cast(&val[0]); + *length = static_cast(val.size()); +} + +// std::vector cameras() const { return cameras_; } + +CVAPI(double) stitching_Stitcher_workScale(cv::Stitcher *obj) +{ + return obj->workScale(); +} + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/stitching_detail_Matchers.h b/src/OpenCvSharpExtern/stitching_detail_Matchers.h new file mode 100644 index 000000000..9c5299e53 --- /dev/null +++ b/src/OpenCvSharpExtern/stitching_detail_Matchers.h @@ -0,0 +1,118 @@ +#ifndef _CPP_STITCHING_DETAIL_MATCHERS_H_ +#define _CPP_STITCHING_DETAIL_MATCHERS_H_ + +#include "include_opencv.h" +using namespace cv::detail; + +void extractImageFeatures( + const ImageFeatures &f, + int *img_idx, + cv::Size *img_size, + std::vector *keypoints, + cv::Mat *descriptors) +{ + *img_idx = f.img_idx; + *img_size = f.img_size; + std::copy(f.keypoints.begin(), f.keypoints.end(), std::back_inserter(*keypoints)); + f.descriptors.copyTo(*descriptors); +} + +// ImageFeatures + +CVAPI(int) stitching_ImageFeatures_img_idx(ImageFeatures *obj) +{ + return obj->img_idx; +} +CVAPI(MyCvSize) stitching_ImageFeatures_img_size(ImageFeatures *obj) +{ + return c(obj->img_size); +} +CVAPI(int64) stitching_ImageFeatures_keypoints_size(ImageFeatures *obj) +{ + return static_cast(obj->keypoints.size()); +} +CVAPI(void) stitching_ImageFeatures_keypoints_copy(ImageFeatures *obj, cv::KeyPoint* outArray) +{ + for (size_t i = 0; i < obj->keypoints.size(); i++) + { + outArray[i] = obj->keypoints[i]; + } +} +CVAPI(void) stitching_ImageFeatures_descriptors(ImageFeatures *obj, cv::Mat *outMat) +{ + (obj->descriptors).copyTo(*outMat); +} + + +// SurfFeaturesFinder + +CVAPI(SurfFeaturesFinder*) stitching_SurfFeaturesFinder_new( + double hess_thresh, int num_octaves, int num_layers, int num_octaves_descr, int num_layers_descr) +{ + return new SurfFeaturesFinder(hess_thresh, num_octaves, num_layers, num_octaves_descr, num_layers_descr); +} +CVAPI(void) stitching_SurfFeaturesFinder_delete(SurfFeaturesFinder* obj) +{ + delete obj; +} + +CVAPI(void) stitching_SurfFeaturesFinder_run1( + SurfFeaturesFinder* obj, cv::Mat *image, + int *img_idx, cv::Size *img_size, std::vector *keypoints, cv::Mat *descriptors) +{ + ImageFeatures features; + (*obj)(*image, features); + extractImageFeatures(features, img_idx, img_size, keypoints, descriptors); +} +CVAPI(void) stitching_SurfFeaturesFinder_run2( + SurfFeaturesFinder* obj, cv::Mat *image, cv::Rect *rois, int roisSize, + int *img_idx, cv::Size *img_size, std::vector *keypoints, cv::Mat *descriptors) +{ + std::vector roisVec(rois, rois + roisSize); + ImageFeatures features; + (*obj)(*image, features, roisVec); + extractImageFeatures(features, img_idx, img_size, keypoints, descriptors); +} +CVAPI(void) stitching_SurfFeaturesFinder_collectGarbage(SurfFeaturesFinder* obj) +{ + obj->collectGarbage(); +} + + +// OrbFeaturesFinder + +CVAPI(OrbFeaturesFinder*) stitching_OrbFeaturesFinder_new( + CvSize grid_size, int nfeatures, float scaleFactor, int nlevels) +{ + return new OrbFeaturesFinder(grid_size, nfeatures, scaleFactor, nlevels); +} +CVAPI(void) stitching_OrbFeaturesFinder_delete(OrbFeaturesFinder* obj) +{ + delete obj; +} + +CVAPI(void) stitching_OrbFeaturesFinder_run1( + OrbFeaturesFinder* obj, cv::Mat *image, + int *img_idx, cv::Size *img_size, std::vector *keypoints, cv::Mat *descriptors) +{ + ImageFeatures features; + (*obj)(*image, features); + extractImageFeatures(features, img_idx, img_size, keypoints, descriptors); +} +CVAPI(void) stitching_OrbFeaturesFinder_run2( + OrbFeaturesFinder* obj, cv::Mat *image, cv::Rect *rois, int roisSize, + int *img_idx, cv::Size *img_size, std::vector *keypoints, cv::Mat *descriptors) +{ + std::vector roisVec(rois, rois + roisSize); + ImageFeatures features; + (*obj)(*image, features, roisVec); + extractImageFeatures(features, img_idx, img_size, keypoints, descriptors); +} +CVAPI(void) stitching_OrbFeaturesFinder_collectGarbage(OrbFeaturesFinder* obj) +{ + obj->collectGarbage(); +} + + + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/superres.cpp b/src/OpenCvSharpExtern/superres.cpp new file mode 100644 index 000000000..d8067a509 --- /dev/null +++ b/src/OpenCvSharpExtern/superres.cpp @@ -0,0 +1 @@ +#include "superres.h" \ No newline at end of file diff --git a/src/OpenCvSharpExtern/superres.h b/src/OpenCvSharpExtern/superres.h new file mode 100644 index 000000000..600f66cca --- /dev/null +++ b/src/OpenCvSharpExtern/superres.h @@ -0,0 +1,157 @@ +#ifndef _CPP_SUPERRES_H_ +#define _CPP_SUPERRES_H_ + +#include "include_opencv.h" + +CVAPI(void) superres_FrameSource_nextFrame( + cv::Ptr *obj, cv::_OutputArray *frame) +{ + (*obj)->nextFrame(*frame); +} +CVAPI(void) superres_FrameSource_reset( + cv::Ptr *obj) +{ + (*obj)->reset(); +} + +CVAPI(cv::Ptr*) superres_createFrameSource_Empty() +{ + return clone( cv::superres::createFrameSource_Empty() ); +} +CVAPI(cv::Ptr*) superres_createFrameSource_Video(const char *fileName) +{ + return clone( cv::superres::createFrameSource_Video(fileName) ); +} +CVAPI(cv::Ptr*) superres_createFrameSource_Video_CUDA(const char *fileName) +{ + return clone( cv::superres::createFrameSource_Video_CUDA(fileName) ); +} +CVAPI(cv::Ptr*) superres_createFrameSource_Camera(int deviceId) +{ + return clone( cv::superres::createFrameSource_Camera(deviceId) ); +} + +CVAPI(cv::superres::FrameSource*) superres_Ptr_FrameSource_get(cv::Ptr *ptr) +{ + return ptr->get(); +} +CVAPI(void) superres_Ptr_FrameSource_delete(cv::Ptr *ptr) +{ + delete ptr; +} + + +CVAPI(void) superres_SuperResolution_setInput( + cv::superres::SuperResolution *obj, cv::Ptr *frameSource) +{ + obj->setInput(*frameSource); +} +CVAPI(void) superres_SuperResolution_nextFrame( + cv::superres::SuperResolution *obj, cv::_OutputArray *frame) +{ + obj->nextFrame(*frame); +} +CVAPI(void) superres_SuperResolution_reset(cv::superres::SuperResolution *obj) +{ + obj->reset(); +} +CVAPI(void) superres_SuperResolution_collectGarbage(cv::superres::SuperResolution *obj) +{ + obj->collectGarbage(); +} + +CVAPI(cv::Ptr*) superres_createSuperResolution_BTVL1() +{ + return clone( cv::superres::createSuperResolution_BTVL1() ); +} +CVAPI(cv::Ptr*) superres_createSuperResolution_BTVL1_CUDA() +{ + return clone( cv::superres::createSuperResolution_BTVL1_CUDA() ); +} +/* +CVAPI(cv::Ptr*) superres_createSuperResolution_BTVL1_OCL() +{ + return clone( cv::superres::createSuperResolution_BTVL1_OCL() ); +}*/ + +CVAPI(cv::superres::SuperResolution*) superres_Ptr_SuperResolution_get( + cv::Ptr *ptr) +{ + return ptr->get(); +} +CVAPI(void) superres_Ptr_SuperResolution_delete(cv::Ptr *ptr) +{ + delete ptr; +} + + +CVAPI(void) superres_DenseOpticalFlowExt_calc(cv::superres::DenseOpticalFlowExt *obj, + cv::_InputArray *frame0, cv::_InputArray *frame1, cv::_OutputArray *flow1, cv::_OutputArray *flow2) +{ + obj->calc(*frame0, *frame1, *flow1, entity(flow2)); +} +CVAPI(void) superres_DenseOpticalFlowExt_collectGarbage(cv::superres::DenseOpticalFlowExt *obj) +{ + obj->collectGarbage(); +} + +CVAPI(cv::superres::DenseOpticalFlowExt*) superres_Ptr_DenseOpticalFlowExt_get( + cv::Ptr *ptr) +{ + return ptr->get(); +} +CVAPI(void) superres_Ptr_DenseOpticalFlowExt_delete( + cv::Ptr *ptr) +{ + delete ptr; +} + +CVAPI(cv::Ptr*) superres_createOptFlow_Farneback() +{ + return clone(cv::superres::createOptFlow_Farneback()); +} +CVAPI(cv::Ptr*) superres_createOptFlow_Farneback_CUDA() +{ + return clone(cv::superres::createOptFlow_Farneback_CUDA()); +} +/* +CVAPI(cv::Ptr*) superres_createOptFlow_Farneback_OCL() +{ + return clone(cv::superres::createOptFlow_Farneback_OCL()); +} +*/ +/* +CVAPI(cv::Ptr*) superres_createOptFlow_Simple() +{ + return clone(cv::superres::createOptFlow_Simple()); +}*/ +CVAPI(cv::Ptr*) superres_createOptFlow_DualTVL1() +{ + return clone(cv::superres::createOptFlow_DualTVL1()); +} +CVAPI(cv::Ptr*) superres_createOptFlow_DualTVL1_CUDA() +{ + return clone(cv::superres::createOptFlow_DualTVL1_CUDA()); +} +/* +CVAPI(cv::Ptr*) superres_createOptFlow_DualTVL1_OCL() +{ + return clone(cv::superres::createOptFlow_DualTVL1_OCL()); +} +*/ +CVAPI(cv::Ptr*) superres_createOptFlow_Brox_GPU() +{ + return clone(cv::superres::createOptFlow_Brox_CUDA()); +} +CVAPI(cv::Ptr*) superres_createOptFlow_PyrLK_GPU() +{ + return clone(cv::superres::createOptFlow_PyrLK_CUDA()); +} +/* +CVAPI(cv::Ptr*) superres_createOptFlow_PyrLK_OCL() +{ + return clone(cv::superres::createOptFlow_PyrLK_OCL()); +} +*/ + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/video.cpp b/src/OpenCvSharpExtern/video.cpp new file mode 100644 index 000000000..fbadbb674 --- /dev/null +++ b/src/OpenCvSharpExtern/video.cpp @@ -0,0 +1,3 @@ +#include "video.h" +#include "video_tracking.h" +#include "video_background_segm.h" \ No newline at end of file diff --git a/src/OpenCvSharpExtern/video.h b/src/OpenCvSharpExtern/video.h new file mode 100644 index 000000000..25a6b04ea --- /dev/null +++ b/src/OpenCvSharpExtern/video.h @@ -0,0 +1,7 @@ +#ifndef _CPP_VIDEO_H_ +#define _CPP_VIDEO_H_ + +#include "include_opencv.h" + + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/video_background_segm.h b/src/OpenCvSharpExtern/video_background_segm.h new file mode 100644 index 000000000..22baa8ab3 --- /dev/null +++ b/src/OpenCvSharpExtern/video_background_segm.h @@ -0,0 +1,239 @@ +#ifndef _CPP_VIDEO_BACKGROUND_SEGM_H_ +#define _CPP_VIDEO_BACKGROUND_SEGM_H_ + +#include "include_opencv.h" + + +#pragma region BackgroundSubtractor +CVAPI(void) video_BackgroundSubtractor_getBackgroundImage(cv::BackgroundSubtractor *obj, cv::_OutputArray *backgroundImage) +{ + obj->getBackgroundImage(*backgroundImage); +} +CVAPI(void) video_BackgroundSubtractor_apply(cv::BackgroundSubtractor *obj, cv::_InputArray *image, cv::_OutputArray *fgmask, double learningRate) +{ + obj->apply(*image, *fgmask, learningRate); +} + +CVAPI(void) video_Ptr_BackgroundSubtractor_delete(cv::Ptr *ptr) +{ + delete ptr; +} +CVAPI(cv::BackgroundSubtractor*) video_Ptr_BackgroundSubtractor_get(cv::Ptr *ptr) +{ + return ptr->get(); +} + +#pragma endregion + +#pragma region BackgroundSubtractorMOG2 +CVAPI(cv::Ptr*) video_createBackgroundSubtractorMOG2(int history, double varThreshold, int detectShadows) +{ + cv::Ptr ptr = cv::createBackgroundSubtractorMOG2(history, varThreshold, detectShadows != 0); + return new cv::Ptr(ptr); +} +CVAPI(void) video_Ptr_BackgroundSubtractorMOG2_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(cv::BackgroundSubtractorMOG2*) video_Ptr_BackgroundSubtractorMOG2_get( + cv::Ptr *ptr) +{ + return ptr->get(); +} + +CVAPI(int) video_BackgroundSubtractorMOG2_getHistory(cv::Ptr *ptr) +{ + return (*ptr)->getHistory(); +} +CVAPI(void) video_BackgroundSubtractorMOG2_setHistory(cv::Ptr *ptr, int value) +{ + (*ptr)->setHistory(value); +} + +CVAPI(int) video_BackgroundSubtractorMOG2_getNMixtures(cv::Ptr *ptr) +{ + return (*ptr)->getNMixtures(); +} +CVAPI(void) video_BackgroundSubtractorMOG2_setNMixtures(cv::Ptr *ptr, int value) +{ + (*ptr)->setNMixtures(value); +} + +CVAPI(double) video_BackgroundSubtractorMOG2_getBackgroundRatio(cv::Ptr *ptr) +{ + return (*ptr)->getBackgroundRatio(); +} +CVAPI(void) video_BackgroundSubtractorMOG2_setBackgroundRatio(cv::Ptr *ptr, double value) +{ + (*ptr)->setBackgroundRatio(value); +} + +CVAPI(double) video_BackgroundSubtractorMOG2_getVarThreshold(cv::Ptr *ptr) +{ + return (*ptr)->getVarThreshold(); +} +CVAPI(void) video_BackgroundSubtractorMOG2_setVarThreshold(cv::Ptr *ptr, double value) +{ + (*ptr)->setVarThreshold(value); +} + +CVAPI(double) video_BackgroundSubtractorMOG2_getVarThresholdGen(cv::Ptr *ptr) +{ + return (*ptr)->getVarThresholdGen(); +} +CVAPI(void) video_BackgroundSubtractorMOG2_setVarThresholdGen(cv::Ptr *ptr, double value) +{ + (*ptr)->setVarThresholdGen(value); +} + +CVAPI(double) video_BackgroundSubtractorMOG2_getVarInit(cv::Ptr *ptr) +{ + return (*ptr)->getVarInit(); +} +CVAPI(void) video_BackgroundSubtractorMOG2_setVarInit(cv::Ptr *ptr, double value) +{ + (*ptr)->setVarInit(value); +} + +CVAPI(double) video_BackgroundSubtractorMOG2_getVarMin(cv::Ptr *ptr) +{ + return (*ptr)->getVarMin(); +} +CVAPI(void) video_BackgroundSubtractorMOG2_setVarMin(cv::Ptr *ptr, double value) +{ + (*ptr)->setVarMin(value); +} + +CVAPI(double) video_BackgroundSubtractorMOG2_getVarMax(cv::Ptr *ptr) +{ + return (*ptr)->getVarMax(); +} +CVAPI(void) video_BackgroundSubtractorMOG2_setVarMax(cv::Ptr *ptr, double value) +{ + (*ptr)->setVarMax(value); +} + +CVAPI(double) video_BackgroundSubtractorMOG2_getComplexityReductionThreshold(cv::Ptr *ptr) +{ + return (*ptr)->getComplexityReductionThreshold(); +} +CVAPI(void) video_BackgroundSubtractorMOG2_setComplexityReductionThreshold(cv::Ptr *ptr, double value) +{ + (*ptr)->setComplexityReductionThreshold(value); +} + +CVAPI(int) video_BackgroundSubtractorMOG2_getDetectShadows(cv::Ptr *ptr) +{ + return (*ptr)->getDetectShadows() ? 1 : 0; +} +CVAPI(void) video_BackgroundSubtractorMOG2_setDetectShadows(cv::Ptr *ptr, int value) +{ + (*ptr)->setDetectShadows(value != 0); +} + +CVAPI(int) video_BackgroundSubtractorMOG2_getShadowValue(cv::Ptr *ptr) +{ + return (*ptr)->getShadowValue(); +} +CVAPI(void) video_BackgroundSubtractorMOG2_setShadowValue(cv::Ptr *ptr, int value) +{ + (*ptr)->setShadowValue(value); +} + +CVAPI(double) video_BackgroundSubtractorMOG2_getShadowThreshold(cv::Ptr *ptr) +{ + return (*ptr)->getShadowThreshold(); +} +CVAPI(void) video_BackgroundSubtractorMOG2_setShadowThreshold(cv::Ptr *ptr, double value) +{ + (*ptr)->setShadowThreshold(value); +} + +#pragma endregion + +#pragma region BackgroundSubtractorKNN +CVAPI(cv::Ptr*) video_createBackgroundSubtractorKNN( + int history, double dist2Threshold, int detectShadows) +{ + cv::Ptr ptr = cv::createBackgroundSubtractorKNN( + history, dist2Threshold, detectShadows != 0); + return new cv::Ptr(ptr); +} +CVAPI(void) video_Ptr_BackgroundSubtractorKNN_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(cv::BackgroundSubtractorKNN*) video_Ptr_BackgroundSubtractorKNN_get( + cv::Ptr *ptr) +{ + return ptr->get(); +} + +CVAPI(int) video_BackgroundSubtractorKNN_getHistory(cv::Ptr *ptr) +{ + return (*ptr)->getHistory(); +} +CVAPI(void) video_BackgroundSubtractorKNN_setHistory(cv::Ptr *ptr, int value) +{ + (*ptr)->setHistory(value); +} + +CVAPI(int) video_BackgroundSubtractorKNN_getNSamples(cv::Ptr *ptr) +{ + return (*ptr)->getNSamples(); +} +CVAPI(void) video_BackgroundSubtractorKNN_setNSamples(cv::Ptr *ptr, int value) +{ + (*ptr)->setNSamples(value); +} + +CVAPI(double) video_BackgroundSubtractorKNN_getDist2Threshold(cv::Ptr *ptr) +{ + return (*ptr)->getDist2Threshold(); +} +CVAPI(void) video_BackgroundSubtractorKNN_setDist2Threshold(cv::Ptr *ptr, double value) +{ + (*ptr)->setDist2Threshold(value); +} + +CVAPI(int) video_BackgroundSubtractorKNN_getkNNSamples(cv::Ptr *ptr) +{ + return (*ptr)->getkNNSamples(); +} +CVAPI(void) video_BackgroundSubtractorKNN_setkNNSamples(cv::Ptr *ptr, int value) +{ + (*ptr)->setkNNSamples(value); +} + +CVAPI(int) video_BackgroundSubtractorKNN_getDetectShadows(cv::Ptr *ptr) +{ + return (*ptr)->getDetectShadows() ? 1 : 0; +} +CVAPI(void) video_BackgroundSubtractorKNN_setDetectShadows(cv::Ptr *ptr, int value) +{ + (*ptr)->setDetectShadows(value != 0); +} + +CVAPI(int) video_BackgroundSubtractorKNN_getShadowValue(cv::Ptr *ptr) +{ + return (*ptr)->getShadowValue(); +} +CVAPI(void) video_BackgroundSubtractorKNN_setShadowValue(cv::Ptr *ptr, int value) +{ + (*ptr)->setShadowValue(value); +} + +CVAPI(double) video_BackgroundSubtractorKNN_getShadowThreshold(cv::Ptr *ptr) +{ + return (*ptr)->getShadowThreshold(); +} +CVAPI(void) video_BackgroundSubtractorKNN_setShadowThreshold(cv::Ptr *ptr, double value) +{ + (*ptr)->setShadowThreshold(value); +} + +#pragma endregion + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/video_tracking.h b/src/OpenCvSharpExtern/video_tracking.h new file mode 100644 index 000000000..621f8de41 --- /dev/null +++ b/src/OpenCvSharpExtern/video_tracking.h @@ -0,0 +1,185 @@ +#ifndef _CPP_VIDEO_TRACKING_H_ +#define _CPP_VIDEO_TRACKING_H_ + +#include "include_opencv.h" + +CVAPI(MyCvBox2D) video_CamShift( + cv::_InputArray *probImage, CvRect *window, CvTermCriteria criteria) +{ + cv::Rect window0 = *window; + cv::RotatedRect ret = cv::CamShift(*probImage, window0, criteria); + *window = window0; + return c(ret); +} + +CVAPI(int) video_meanShift( + cv::_InputArray *probImage, CvRect *window, CvTermCriteria criteria) +{ + cv::Rect window0 = *window; + int ret = cv::meanShift(*probImage, window0, criteria); + *window = window0; + return ret; +} + +#pragma region KalmanFilter + +CVAPI(cv::KalmanFilter*) video_KalmanFilter_new1() +{ + return new cv::KalmanFilter(); +} +CVAPI(cv::KalmanFilter*) video_KalmanFilter_new2(int dynamParams, int measureParams, int controlParams, int type) +{ + return new cv::KalmanFilter(dynamParams, measureParams, controlParams, type); +} +CVAPI(void) video_KalmanFilter_init(cv::KalmanFilter *obj, int dynamParams, int measureParams, int controlParams, int type) +{ + obj->init(dynamParams, measureParams, controlParams, type); +} +CVAPI(void) video_KalmanFilter_delete(cv::KalmanFilter *obj) +{ + delete obj; +} + +CVAPI(cv::Mat*) video_KalmanFilter_predict(cv::KalmanFilter *obj, cv::Mat *control) +{ + cv::Mat result = obj->predict(entity(control)); + return new cv::Mat(result); +} +CVAPI(cv::Mat*) video_KalmanFilter_correct(cv::KalmanFilter *obj, cv::Mat *measurement) +{ + cv::Mat result = obj->correct(*measurement); + return new cv::Mat(result); +} + +CVAPI(cv::Mat*) video_KalmanFilter_statePre(cv::KalmanFilter *obj) +{ + return new cv::Mat(obj->statePre); +} +CVAPI(cv::Mat*) video_KalmanFilter_statePost(cv::KalmanFilter *obj) +{ + return new cv::Mat(obj->statePost); +} +CVAPI(cv::Mat*) video_KalmanFilter_transitionMatrix(cv::KalmanFilter *obj) +{ + return new cv::Mat(obj->transitionMatrix); +} +CVAPI(cv::Mat*) video_KalmanFilter_controlMatrix(cv::KalmanFilter *obj) +{ + return new cv::Mat(obj->controlMatrix); +} +CVAPI(cv::Mat*) video_KalmanFilter_measurementMatrix(cv::KalmanFilter *obj) +{ + return new cv::Mat(obj->measurementMatrix); +} +CVAPI(cv::Mat*) video_KalmanFilter_processNoiseCov(cv::KalmanFilter *obj) +{ + return new cv::Mat(obj->processNoiseCov); +} +CVAPI(cv::Mat*) video_KalmanFilter_measurementNoiseCov(cv::KalmanFilter *obj) +{ + return new cv::Mat(obj->measurementNoiseCov); +} +CVAPI(cv::Mat*) video_KalmanFilter_errorCovPre(cv::KalmanFilter *obj) +{ + return new cv::Mat(obj->errorCovPre); +} +CVAPI(cv::Mat*) video_KalmanFilter_gain(cv::KalmanFilter *obj) +{ + return new cv::Mat(obj->gain); +} +CVAPI(cv::Mat*) video_KalmanFilter_errorCovPost(cv::KalmanFilter *obj) +{ + return new cv::Mat(obj->errorCovPost); +} +#pragma endregion + +CVAPI(int) video_buildOpticalFlowPyramid1( + cv::_InputArray *img, cv::_OutputArray *pyramid, + MyCvSize winSize, int maxLevel, int withDerivatives, + int pyrBorder, int derivBorder, int tryReuseInputImage) +{ + return cv::buildOpticalFlowPyramid( + *img, *pyramid, cpp(winSize), maxLevel, withDerivatives != 0, + pyrBorder, derivBorder, tryReuseInputImage != 0); +} +CVAPI(int) video_buildOpticalFlowPyramid2( + cv::_InputArray *img, std::vector *pyramidVec, + MyCvSize winSize, int maxLevel, int withDerivatives, + int pyrBorder, int derivBorder, int tryReuseInputImage) +{ + return cv::buildOpticalFlowPyramid( + *img, *pyramidVec, cpp(winSize), maxLevel, withDerivatives != 0, + pyrBorder, derivBorder, tryReuseInputImage != 0); +} + +CVAPI(void) video_calcOpticalFlowPyrLK_InputArray( + cv::_InputArray *prevImg, cv::_InputArray *nextImg, + cv::_InputArray *prevPts, cv::_InputOutputArray *nextPts, + cv::_OutputArray *status, cv::_OutputArray *err, + MyCvSize winSize, int maxLevel, MyCvTermCriteria criteria, + int flags, double minEigThreshold) +{ + cv::calcOpticalFlowPyrLK(*prevImg, *nextImg, *prevPts, *nextPts, *status, *err, + cpp(winSize), maxLevel, cpp(criteria), flags, minEigThreshold); +} + +CVAPI(void) video_calcOpticalFlowPyrLK_vector( + cv::_InputArray *prevImg, cv::_InputArray *nextImg, + cv::Point2f *prevPts, int prevPtsSize, + std::vector *nextPts, + std::vector *status, + std::vector *err, + CvSize winSize, int maxLevel, CvTermCriteria criteria, + int flags, double minEigThreshold) +{ + std::vector prevPtsVec(prevPts, prevPts + prevPtsSize); + cv::calcOpticalFlowPyrLK(*prevImg, *nextImg, prevPtsVec, *nextPts, + *status, *err, winSize, maxLevel, criteria, flags, minEigThreshold); +} + +CVAPI(void) video_calcOpticalFlowFarneback( + cv::_InputArray *prev, cv::_InputArray *next, + cv::_InputOutputArray *flow, double pyrScale, int levels, int winSize, + int iterations, int polyN, double polySigma, int flags) +{ + cv::calcOpticalFlowFarneback(*prev, *next, *flow, pyrScale, levels, winSize, + iterations, polyN, polySigma, flags); +} + +CVAPI(cv::Mat*) video_estimateRigidTransform( + cv::_InputArray *src, cv::_InputArray *dst, int fullAffine) +{ + cv::Mat ret = cv::estimateRigidTransform(*src, *dst, fullAffine != 0); + return new cv::Mat(ret); +} + +#pragma region DenseOpticalFlow + +CVAPI(void) video_DenseOpticalFlow_calc( + cv::DenseOpticalFlow *obj, + cv::_InputArray *i0, cv::_InputArray *i1, cv::_InputOutputArray *flow) +{ + obj->calc(*i0, *i1, *flow); +} +CVAPI(void) video_DenseOpticalFlow_collectGarbage(cv::DenseOpticalFlow *obj) +{ + obj->collectGarbage(); +} + +CVAPI(cv::Ptr*) video_createOptFlow_DualTVL1() +{ + return clone(cv::createOptFlow_DualTVL1()); +} + +CVAPI(cv::DenseOpticalFlow*) video_Ptr_DenseOpticalFlow_get(cv::Ptr *ptr) +{ + return ptr->get(); +} +CVAPI(void) video_Ptr_DenseOpticalFlow_delete(cv::Ptr *ptr) +{ + delete ptr; +} + +#pragma endregion + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/videoio.cpp b/src/OpenCvSharpExtern/videoio.cpp new file mode 100644 index 000000000..2218d0713 --- /dev/null +++ b/src/OpenCvSharpExtern/videoio.cpp @@ -0,0 +1 @@ +#include "videoio.h" \ No newline at end of file diff --git a/src/OpenCvSharpExtern/videoio.h b/src/OpenCvSharpExtern/videoio.h new file mode 100644 index 000000000..25330d848 --- /dev/null +++ b/src/OpenCvSharpExtern/videoio.h @@ -0,0 +1,144 @@ +#ifndef _CPP_VIDEOIO_H_ +#define _CPP_VIDEOIO_H_ + +#include "include_opencv.h" + + +#pragma region VideoCapture + +CVAPI(cv::VideoCapture*) videoio_VideoCapture_new1() +{ + return new cv::VideoCapture; +} +CVAPI(cv::VideoCapture*) videoio_VideoCapture_new2(const char *filename) +{ + return new cv::VideoCapture(filename); +} +CVAPI(cv::VideoCapture*) videoio_VideoCapture_new3(int device) +{ + return new cv::VideoCapture(device); +} + +CVAPI(void) videoio_VideoCapture_delete(cv::VideoCapture *obj) +{ + delete obj; +} + + +CVAPI(int) videoio_VideoCapture_open1(cv::VideoCapture *obj, const char *filename) +{ + return obj->open(filename) ? 1 : 0; +} + +CVAPI(int) videoio_VideoCapture_open2(cv::VideoCapture *obj, int device) +{ + return obj->open(device) ? 1 : 0; +} + +CVAPI(int) videoio_VideoCapture_isOpened(cv::VideoCapture *obj) +{ + return obj->isOpened() ? 1 : 0; +} + +CVAPI(void) videoio_VideoCapture_release(cv::VideoCapture *obj) +{ + obj->release(); +} + +CVAPI(int) videoio_VideoCapture_grab(cv::VideoCapture *obj) +{ + return obj->grab() ? 1 : 0; +} + +CVAPI(int) videoio_VideoCapture_retrieve(cv::VideoCapture *obj, cv::_OutputArray *image, int flag) +{ + return obj->retrieve(*image, flag) ? 1 : 0; +} + +CVAPI(void) videoio_VideoCapture_operatorRightShift_Mat(cv::VideoCapture *obj, cv::Mat *image) +{ + (*obj) >> (*image); +} +CVAPI(void) videoio_VideoCapture_operatorRightShift_UMat(cv::VideoCapture *obj, cv::UMat *image) +{ + (*obj) >> (*image); +} + +CVAPI(int) videoio_VideoCapture_read(cv::VideoCapture *obj, cv::_OutputArray *image) +{ + return obj->read(*image) ? 1 : 0; +} + +CVAPI(int) videoio_VideoCapture_set(cv::VideoCapture *obj, int propId, double value) +{ + return obj->set(propId, value) ? 1 : 0; +} + +CVAPI(double) videoio_VideoCapture_get(cv::VideoCapture *obj, int propId) +{ + return obj->get(propId); +} + +#pragma endregion + +#pragma region VideoWriter + +CVAPI(cv::VideoWriter*) videoio_VideoWriter_new1() +{ + return new cv::VideoWriter; +} +CVAPI(cv::VideoWriter*) videoio_VideoWriter_new2(const char *filename, int fourcc, double fps, + MyCvSize frameSize, int isColor) +{ + return new cv::VideoWriter(filename, fourcc, fps, cpp(frameSize), isColor != 0); +} + +CVAPI(void) videoio_VideoWriter_delete(cv::VideoWriter *obj) +{ + delete obj; +} + +CVAPI(int) videoio_VideoWriter_open(cv::VideoWriter *obj, const char *filename, int fourcc, double fps, + MyCvSize frameSize, int isColor) +{ + return obj->open(filename, fourcc, fps, cpp(frameSize), isColor != 0) ? 1 : 0; +} + +CVAPI(int) videoio_VideoWriter_isOpened(cv::VideoWriter *obj) +{ + return obj->isOpened() ? 1 : 0; +} + +CVAPI(void) videoio_VideoWriter_release(cv::VideoWriter *obj) +{ + obj->release(); +} + +CVAPI(void) videoio_VideoWriter_OperatorLeftShift(cv::VideoWriter *obj, cv::Mat *image) +{ + (*obj) << (*image); +} + +CVAPI(void) videoio_VideoWriter_write(cv::VideoWriter *obj, cv::Mat *image) +{ + obj->write(*image); +} + +CVAPI(int) videoio_VideoWriter_set(cv::VideoWriter *obj, int propId, double value) +{ + return obj->set(propId, value) ? 1 : 0; +} + +CVAPI(double) videoio_VideoWriter_get(cv::VideoWriter *obj, int propId) +{ + return obj->get(propId); +} + +CVAPI(int) videoio_VideoWriter_fourcc(char c1, char c2, char c3, char c4) +{ + return cv::VideoWriter::fourcc(c1, c2, c3, c4); +} + +#pragma endregion + +#endif \ No newline at end of file diff --git a/src/OpenCvSharpExtern/xfeatures2d.cpp b/src/OpenCvSharpExtern/xfeatures2d.cpp new file mode 100644 index 000000000..3ff3715cb --- /dev/null +++ b/src/OpenCvSharpExtern/xfeatures2d.cpp @@ -0,0 +1 @@ +#include "xfeatures2d.h" \ No newline at end of file diff --git a/src/OpenCvSharpExtern/xfeatures2d.h b/src/OpenCvSharpExtern/xfeatures2d.h new file mode 100644 index 000000000..e851c9034 --- /dev/null +++ b/src/OpenCvSharpExtern/xfeatures2d.h @@ -0,0 +1,180 @@ +#ifdef ENABLED_CONTRIB +#ifndef _CPP_XFEATURES2D_H_ +#define _CPP_XFEATURES2D_H_ + +#include "include_opencv.h" +using namespace cv::xfeatures2d; + +#pragma region BriefDescriptorExtractor + +CVAPI(cv::Ptr*) xfeatures2d_BriefDescriptorExtractor_create(int bytes) +{ + cv::Ptr ptr = BriefDescriptorExtractor::create(bytes); + return new cv::Ptr(ptr); +} +CVAPI(void) xfeatures2d_Ptr_BriefDescriptorExtractor_delete(cv::Ptr *obj) +{ + delete obj; +} + +CVAPI(void) xfeatures2d_BriefDescriptorExtractor_read( + cv::Ptr *obj, cv::FileNode *fn) +{ + obj->get()->read(*fn); +} +CVAPI(void) xfeatures2d_BriefDescriptorExtractor_write( + cv::Ptr *obj, cv::FileStorage *fs) +{ + obj->get()->write(*fs); +} + +CVAPI(int) xfeatures2d_BriefDescriptorExtractor_descriptorSize(cv::Ptr *obj) +{ + return obj->get()->descriptorSize(); +} +CVAPI(int) xfeatures2d_BriefDescriptorExtractor_descriptorType(cv::Ptr *obj) +{ + return obj->get()->descriptorType(); +} + +CVAPI(BriefDescriptorExtractor*) xfeatures2d_Ptr_BriefDescriptorExtractor_get( + cv::Ptr* ptr) +{ + return ptr->get(); +} + +#pragma endregion + +#pragma region FREAK + +CVAPI(cv::Ptr*) xfeatures2d_FREAK_create(int orientationNormalized, + int scaleNormalized, float patternScale, int nOctaves, + int *selectedPairs, int selectedPairsLength) +{ + std::vector selectedPairsVec; + if (selectedPairs != NULL) + selectedPairsVec = std::vector(selectedPairs, selectedPairs + selectedPairsLength); + cv::Ptr ptr = FREAK::create(orientationNormalized != 0, scaleNormalized != 0, + patternScale, nOctaves, selectedPairsVec); + return new cv::Ptr(ptr); +} +CVAPI(void) xfeatures2d_Ptr_FREAK_delete(cv::Ptr *ptr) +{ + delete ptr; +} + +CVAPI(FREAK*) xfeatures2d_Ptr_FREAK_get(cv::Ptr *ptr) +{ + return ptr->get(); +} + +#pragma endregion + +#pragma region StarDetector + +CVAPI(cv::Ptr*) xfeatures2d_StarDetector_create(int maxSize, int responseThreshold, + int lineThresholdProjected, int lineThresholdBinarized, int suppressNonmaxSize) +{ + cv::Ptr ptr = StarDetector::create( + maxSize, responseThreshold, lineThresholdProjected, lineThresholdBinarized, suppressNonmaxSize); + return new cv::Ptr(ptr); +} +CVAPI(void) xfeatures2d_Ptr_StarDetector_delete(cv::Ptr *ptr) +{ + delete ptr; +} + +CVAPI(StarDetector*) xfeatures2d_Ptr_StarDetector_get(cv::Ptr *ptr) +{ + return ptr->get(); +} + +#pragma endregion + +#pragma region SIFT + +CVAPI(cv::Ptr*) xfeatures2d_SIFT_create( + int nfeatures, int nOctaveLayers, + double contrastThreshold, double edgeThreshold, double sigma) +{ + cv::Ptr ptr = SIFT::create( + nfeatures, nOctaveLayers, contrastThreshold, edgeThreshold, sigma); + return new cv::Ptr(ptr); +} +CVAPI(void) xfeatures2d_Ptr_SIFT_delete(cv::Ptr *ptr) +{ + delete ptr; +} + +CVAPI(SIFT*) xfeatures2d_Ptr_SIFT_get(cv::Ptr *ptr) +{ + return ptr->get(); +} + +#pragma endregion + +#pragma region SURF + +CVAPI(cv::Ptr*) xfeatures2d_SURF_create(double hessianThreshold, int nOctaves, + int nOctaveLayers, int extended, int upright) +{ + cv::Ptr ptr = SURF::create( + hessianThreshold, nOctaves, nOctaveLayers, extended != 0, upright != 0); + return new cv::Ptr(ptr); +} +CVAPI(void) xfeatures2d_Ptr_SURF_delete(cv::Ptr *ptr) +{ + delete ptr; +} + +CVAPI(SURF*) xfeatures2d_Ptr_SURF_get(cv::Ptr *ptr) +{ + return ptr->get(); +} + +CVAPI(double) xfeatures2d_SURF_getHessianThreshold(SURF *obj) +{ + return obj->getHessianThreshold(); +} +CVAPI(int) xfeatures2d_SURF_getNOctaves(SURF *obj) +{ + return obj->getNOctaves(); +} +CVAPI(int) xfeatures2d_SURF_getNOctaveLayers(SURF *obj) +{ + return obj->getNOctaveLayers(); +} +CVAPI(int) xfeatures2d_SURF_getExtended(SURF *obj) +{ + return obj->getExtended() ? 1 : 0; +} +CVAPI(int) xfeatures2d_SURF_getUpright(SURF *obj) +{ + return obj->getUpright() ? 1 : 0; +} + +CVAPI(void) xfeatures2d_SURF_setHessianThreshold(SURF *obj, double value) +{ + obj->setHessianThreshold(value); +} +CVAPI(void) xfeatures2d_SURF_setNOctaves(SURF *obj, int value) +{ + obj->setNOctaves(value); +} +CVAPI(void) xfeatures2d_SURF_setNOctaveLayers(SURF *obj, int value) +{ + obj->setNOctaveLayers(value); +} +CVAPI(void) xfeatures2d_SURF_setExtended(SURF *obj, int value) +{ + obj->setExtended(value != 0); +} +CVAPI(void) xfeatures2d_SURF_setUpright(SURF *obj, int value) +{ + obj->setUpright(value != 0); +} + +#pragma endregion + +#endif +#endif \ No newline at end of file diff --git a/src/cmake/Modules/FindOpenCV.cmake b/src/cmake/Modules/FindOpenCV.cmake new file mode 100644 index 000000000..060d66f5c --- /dev/null +++ b/src/cmake/Modules/FindOpenCV.cmake @@ -0,0 +1,104 @@ +include(UsePkgConfig OPTIONAL) + +if (WIN32) +find_path(OpenCV_cv_INCLUDE_DIR opencv/cv.h + "c:/Program Files/OpenCV/cv/include" + "c:/Platform/OpenCV/cv/include" +) + +find_path(OpenCV_cxcore_INCLUDE_DIR opencv/cxcore.h + "c:/Program Files/OpenCV/cxcore/include" + "c:/Platform/OpenCV/cxcore/include" +) + +find_path(OpenCV_highgui_INCLUDE_DIR opencv/highgui.h + "c:/Program Files/OpenCV/otherlibs/highgui" + "c:/Platform/OpenCV/otherlibs/highgui" +) + +find_path(OpenCV_ml_INCLUDE_DIR opencv/ml.h + "c:/Program Files/OpenCV/ml/include" + "c:/Platform/OpenCV/ml/include" +) + +set(OpenCV_INCLUDE_DIR $(OpenCV_cv_INCLUDE_DIR) $(OpenCV_cxcore_INCLUDE_DIR) $(OpenCV_highgui_INCLUDE_DIR) $(OpenCV_ml_INCLUDE_DIR)) + +set(OpenCV_LIBRARY_DIR "c:/Program Files/OpenCV/lib" "c:/Platform/OpenCV/lib") + +find_library(OpenCV_cv_LIBRARY + NAMES cv + PATH "c:/Program Files/OpenCV/lib" + "c:/Platform/OpenCV/lib" +) + +find_library(OpenCV_cxcore_LIBRARY + NAMES cxcore + PATH "c:/Program Files/OpenCV/lib" + "c:/Platform/OpenCV/lib" +) + +find_library(OpenCV_highgui_LIBRARY + NAMES highgui + PATH "c:/Program Files/OpenCV/lib" + "c:/Platform/OpenCV/lib" +) + +find_library(OpenCV_ml_LIBRARY + NAMES ml + PATH "c:/Program Files/OpenCV/lib" + "c:/Platform/OpenCV/lib" +) + +else (WIN32) +find_path(OpenCV_INCLUDE_DIR opencv/cv.h + /usr/include + /usr/local/include +) + +set(OpenCV_LIBRARY_DIR /usr/lib /usr/local/lib) + +find_library(OpenCV_cv_LIBRARY + NAMES cv cv0.9.7 cv0.9.8 cv1.0.0 cv1.1.0 cv2.0.0 + PATH /usr/lib + /usr/local/lib +) + +find_library(OpenCV_cxcore_LIBRARY + NAMES cxcore cxcore0.9.7 cxcore0.9.8 cxcore1.0.0 cxcore1.1.0 cxcore2.0.0 + PATH /usr/lib + /usr/local/lib +) + +find_library(OpenCV_highgui_LIBRARY + NAMES highgui highgui0.9.7 highgui0.9.8 highgui1.0.0 highgui1.1.0 highgui2.0.0 + PATH /usr/lib + /usr/local/lib +) + +find_library(OpenCV_ml_LIBRARY + NAMES ml ml0.9.7 ml0.9.8 ml1.0.0 ml1.1.0 ml2.0.0 + PATH /usr/lib + /usr/local/lib +) +endif (WIN32) + +if (OpenCV_cv_LIBRARY AND OpenCV_cxcore_LIBRARY AND OpenCV_highgui_LIBRARY AND OpenCV_ml_LIBRARY) + set(OpenCV_LIBRARIES ${OpenCV_cv_LIBRARY} ${OpenCV_cxcore_LIBRARY} ${OpenCV_highgui_LIBRARY} ${OpenCV_ml_LIBRARY}) + set(OpenCV_FOUND TRUE) +endif (OpenCV_cv_LIBRARY AND OpenCV_cxcore_LIBRARY AND OpenCV_highgui_LIBRARY AND OpenCV_ml_LIBRARY) + +if (OpenCV_FOUND) + if (NOT OpenCV_FIND_QUIETLY) + message(STATUS "OpenCV library found: ${OpenCV_LIBRARIES}") + endif (NOT OpenCV_FIND_QUIETLY) +else (OpenCV_FOUND) + if (OpenCV_FIND_REQUIRED) + message(FATAL_ERROR "!!!No OpenCV library found!!!") + endif (OpenCV_FIND_REQUIRED) +endif (OpenCV_FOUND) + +if (OpenCV_INCLUDE_DIR) + message(STATUS "OpenCV include directories found: ${OpenCV_INCLUDE_DIR}") +else (OpenCV_INCLUDE_DIR) + message(FATAL_ERROR "!!!No OpenCV include directories found!!!") +endif (OpenCV_INCLUDE_DIR) \ No newline at end of file diff --git a/web/img/cpp_histogram/grayscale_histogram.png b/web/img/cpp_histogram/grayscale_histogram.png new file mode 100644 index 000000000..19102c298 Binary files /dev/null and b/web/img/cpp_histogram/grayscale_histogram.png differ diff --git a/web/img/cpp_histogram/lenna_grayscale.png b/web/img/cpp_histogram/lenna_grayscale.png new file mode 100644 index 000000000..6f1b1f6b6 Binary files /dev/null and b/web/img/cpp_histogram/lenna_grayscale.png differ diff --git a/web/img/debugger-visualizer/cvmat_1.png b/web/img/debugger-visualizer/cvmat_1.png new file mode 100644 index 000000000..21c4096c9 Binary files /dev/null and b/web/img/debugger-visualizer/cvmat_1.png differ diff --git a/web/img/debugger-visualizer/iplimage_1.png b/web/img/debugger-visualizer/iplimage_1.png new file mode 100644 index 000000000..203098580 Binary files /dev/null and b/web/img/debugger-visualizer/iplimage_1.png differ diff --git a/web/img/debugger-visualizer/iplimage_2.png b/web/img/debugger-visualizer/iplimage_2.png new file mode 100644 index 000000000..61557c46e Binary files /dev/null and b/web/img/debugger-visualizer/iplimage_2.png differ diff --git a/web/img/how-to-install-via-nuget/lenna_inverse_face.png b/web/img/how-to-install-via-nuget/lenna_inverse_face.png new file mode 100644 index 000000000..8cf5fced6 Binary files /dev/null and b/web/img/how-to-install-via-nuget/lenna_inverse_face.png differ diff --git a/web/img/how-to-install-via-nuget/nuget_package_manager.png b/web/img/how-to-install-via-nuget/nuget_package_manager.png new file mode 100644 index 000000000..3dac3fa1d Binary files /dev/null and b/web/img/how-to-install-via-nuget/nuget_package_manager.png differ diff --git a/web/img/how-to-install-via-nuget/nuget_package_manager_old.png b/web/img/how-to-install-via-nuget/nuget_package_manager_old.png new file mode 100644 index 000000000..0db8ba610 Binary files /dev/null and b/web/img/how-to-install-via-nuget/nuget_package_manager_old.png differ diff --git a/web/img/tutorial-for-windows/01.jpg b/web/img/tutorial-for-windows/01.jpg new file mode 100644 index 000000000..c171fff37 Binary files /dev/null and b/web/img/tutorial-for-windows/01.jpg differ diff --git a/web/img/tutorial-for-windows/02.jpg b/web/img/tutorial-for-windows/02.jpg new file mode 100644 index 000000000..c2858732a Binary files /dev/null and b/web/img/tutorial-for-windows/02.jpg differ diff --git a/web/img/tutorial-for-windows/03.jpg b/web/img/tutorial-for-windows/03.jpg new file mode 100644 index 000000000..ae26edc6f Binary files /dev/null and b/web/img/tutorial-for-windows/03.jpg differ diff --git a/web/img/tutorial-for-windows/04.png b/web/img/tutorial-for-windows/04.png new file mode 100644 index 000000000..b718a5141 Binary files /dev/null and b/web/img/tutorial-for-windows/04.png differ diff --git a/web/img/when-error-occurs/DllNotFoundException.png b/web/img/when-error-occurs/DllNotFoundException.png new file mode 100644 index 000000000..aedd361cc Binary files /dev/null and b/web/img/when-error-occurs/DllNotFoundException.png differ diff --git a/web/img/when-error-occurs/TargetPlatform.png b/web/img/when-error-occurs/TargetPlatform.png new file mode 100644 index 000000000..6fd7cf9c4 Binary files /dev/null and b/web/img/when-error-occurs/TargetPlatform.png differ