Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
83fc038c
Commit
83fc038c
authored
Jun 18, 2015
by
Muresan Mircea Paul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed the c api
parent
ba1fb0ad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
245 deletions
+0
-245
stereo_c.h
modules/stereo/include/opencv2/stereo/stereo_c.h
+0
-120
compat_binary_stereo.cpp
modules/stereo/src/compat_binary_stereo.cpp
+0
-125
No files found.
modules/stereo/include/opencv2/stereo/stereo_c.h
deleted
100644 → 0
View file @
ba1fb0ad
/*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_STEREO_C_H__
#define __OPENCV_STEREO_C_H__
#include "opencv2/core/core_c.h"
#ifdef __cplusplus
extern
"C"
{
#endif
/** @addtogroup stereo_c
@{
**/
//! stereo correspondence parameters and functions
#define CV_STEREO_BM_NORMALIZED_RESPONSE 0
#define CV_STEREO_BM_XSOBEL 1
//! Block matching algorithm structure
typedef
struct
CvStereoBinaryBMState
{
// 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
;
}
CvStereoBinaryBMState
;
#define CV_STEREO_BM_BASIC 0
#define CV_STEREO_BM_FISH_EYE 1
#define CV_STEREO_BM_NARROW 2
CVAPI
(
CvStereoBinaryBMState
*
)
cvCreateStereoBinaryBMState
(
int
preset
CV_DEFAULT
(
CV_STEREO_BM_BASIC
),
int
numberOfDisparities
CV_DEFAULT
(
0
));
CVAPI
(
void
)
cvReleaseStereoBinaryBMState
(
CvStereoBinaryBMState
**
state
);
CVAPI
(
void
)
cvFindStereoCorrespondenceBinaryBM
(
const
CvArr
*
left
,
const
CvArr
*
right
,
CvArr
*
disparity
,
CvStereoBinaryBMState
*
state
);
CVAPI
(
CvRect
)
cvStereoBinaryGetValidDisparityROI
(
CvRect
roi1
,
CvRect
roi2
,
int
minDisparity
,
int
numberOfDisparities
,
int
SADWindowSize
);
CVAPI
(
void
)
cvStereoBinaryValidateDisparity
(
CvArr
*
disparity
,
const
CvArr
*
cost
,
int
minDisparity
,
int
numberOfDisparities
,
int
disp12MaxDiff
CV_DEFAULT
(
1
)
);
/** @} stereo_c */
#ifdef __cplusplus
}
// extern "C"
#endif
#endif
/* __OPENCV_STEREO_C_H__ */
modules/stereo/src/compat_binary_stereo.cpp
deleted
100644 → 0
View file @
ba1fb0ad
//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.
// 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*/
#include "precomp.hpp"
#include "opencv2/stereo/stereo_c.h"
CvStereoBinaryBMState
*
cvCreateStereoBinaryBMState
(
int
/*preset*/
,
int
numberOfDisparities
)
{
CvStereoBinaryBMState
*
state
=
(
CvStereoBinaryBMState
*
)
cvAlloc
(
sizeof
(
*
state
)
);
if
(
!
state
)
return
0
;
state
->
preFilterType
=
CV_STEREO_BM_XSOBEL
;
//CV_STEREO_BM_NORMALIZED_RESPONSE;
state
->
preFilterSize
=
9
;
state
->
preFilterCap
=
31
;
state
->
SADWindowSize
=
15
;
state
->
minDisparity
=
0
;
state
->
numberOfDisparities
=
numberOfDisparities
>
0
?
numberOfDisparities
:
64
;
state
->
textureThreshold
=
10
;
state
->
uniquenessRatio
=
15
;
state
->
speckleRange
=
state
->
speckleWindowSize
=
0
;
state
->
trySmallerWindows
=
0
;
state
->
roi1
=
state
->
roi2
=
cvRect
(
0
,
0
,
0
,
0
);
state
->
disp12MaxDiff
=
-
1
;
state
->
preFilteredImg0
=
state
->
preFilteredImg1
=
state
->
slidingSumBuf
=
state
->
disp
=
state
->
cost
=
0
;
return
state
;
}
void
cvReleaseStereoBinaryBMState
(
CvStereoBinaryBMState
**
state
)
{
if
(
!
state
)
CV_Error
(
CV_StsNullPtr
,
""
);
if
(
!*
state
)
return
;
cvReleaseMat
(
&
(
*
state
)
->
preFilteredImg0
);
cvReleaseMat
(
&
(
*
state
)
->
preFilteredImg1
);
cvReleaseMat
(
&
(
*
state
)
->
slidingSumBuf
);
cvReleaseMat
(
&
(
*
state
)
->
disp
);
cvReleaseMat
(
&
(
*
state
)
->
cost
);
cvFree
(
state
);
}
void
cvFindStereoCorrespondenceBinaryBM
(
const
CvArr
*
leftarr
,
const
CvArr
*
rightarr
,
CvArr
*
disparr
,
CvStereoBinaryBMState
*
state
)
{
cv
::
Mat
left
=
cv
::
cvarrToMat
(
leftarr
),
right
=
cv
::
cvarrToMat
(
rightarr
);
const
cv
::
Mat
disp
=
cv
::
cvarrToMat
(
disparr
);
CV_Assert
(
state
!=
0
);
cv
::
Ptr
<
cv
::
stereo
::
StereoBinaryBM
>
sm
=
cv
::
stereo
::
StereoBinaryBM
::
create
(
state
->
numberOfDisparities
,
state
->
SADWindowSize
);
sm
->
setPreFilterType
(
state
->
preFilterType
);
sm
->
setPreFilterSize
(
state
->
preFilterSize
);
sm
->
setPreFilterCap
(
state
->
preFilterCap
);
sm
->
setBlockSize
(
state
->
SADWindowSize
);
sm
->
setNumDisparities
(
state
->
numberOfDisparities
>
0
?
state
->
numberOfDisparities
:
64
);
sm
->
setTextureThreshold
(
state
->
textureThreshold
);
sm
->
setUniquenessRatio
(
state
->
uniquenessRatio
);
sm
->
setSpeckleRange
(
state
->
speckleRange
);
sm
->
setSpeckleWindowSize
(
state
->
speckleWindowSize
);
sm
->
setDisp12MaxDiff
(
state
->
disp12MaxDiff
);
sm
->
compute
(
left
,
right
,
disp
);
}
CvRect
cvStereoBinaryGetValidDisparityROI
(
CvRect
roi1
,
CvRect
roi2
,
int
minDisparity
,
int
numberOfDisparities
,
int
SADWindowSize
)
{
return
(
CvRect
)
cv
::
getValidDisparityROI
(
roi1
,
roi2
,
minDisparity
,
numberOfDisparities
,
SADWindowSize
);
}
void
cvStereoBinaryValidateDisparity
(
CvArr
*
_disp
,
const
CvArr
*
_cost
,
int
minDisparity
,
int
numberOfDisparities
,
int
disp12MaxDiff
)
{
cv
::
Mat
disp
=
cv
::
cvarrToMat
(
_disp
),
cost
=
cv
::
cvarrToMat
(
_cost
);
cv
::
validateDisparity
(
disp
,
cost
,
minDisparity
,
numberOfDisparities
,
disp12MaxDiff
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment