2 * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "dfs_opencv_private.h"
20 namespace DfsAdaptationImpl
24 mTextureThreshold(0.0),
25 mAggregationWindowWidth(3),
26 mAggregationWindowHeight(3),
45 void DfsOCV::Initialize(double textureThreshold,
46 size_t aggregationWindowWidth,
47 size_t aggregationWindowHeight,
48 size_t maxSpeckleSize)
52 mTextureThreshold = textureThreshold;
53 mAggregationWindowWidth = aggregationWindowWidth;
54 mAggregationWindowHeight = aggregationWindowHeight;
55 mMaxSpeckleSize = maxSpeckleSize;
57 mDfsOcv = cv::StereoSGBM::create(1, mNumDisparities, mBlockSize);
59 this->SetParameters();
63 void DfsOCV::SetParameters()
67 mDfsOcv->setMinDisparity(mMinDisparity);
68 mDfsOcv->setNumDisparities(mNumDisparities);
69 mDfsOcv->setBlockSize(mBlockSize);
70 mDfsOcv->setP1(mP1 * mBlockSize * mBlockSize);
71 mDfsOcv->setP2(mP2 * mBlockSize * mBlockSize);
72 mDfsOcv->setPreFilterCap(mPreFilterCap);
74 mDfsOcv->setMode(cv::StereoSGBM::MODE_SGBM_3WAY);
80 class IDfsAdaptation *AdaptorInit(void)
82 //InferenceTFLite *engine = new InferenceTFLite();
83 DfsOCV *adaptor = new DfsOCV();
87 void AdaptorDestroy(class IDfsAdaptation *adaptor)