本文整理汇总了C++中TensorWrapper函数的典型用法代码示例。如果您正苦于以下问题:C++ TensorWrapper函数的具体用法?C++ TensorWrapper怎么用?C++ TensorWrapper使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TensorWrapper函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calcOpticalFlowSF_expanded
struct TensorWrapper calcOpticalFlowSF_expanded(
struct TensorWrapper from, struct TensorWrapper to, struct TensorWrapper flow,
int layers, int averaging_block_size, int max_flow,
double sigma_dist, double sigma_color, int postprocess_window,
double sigma_dist_fix, double sigma_color_fix, double occ_thr,
int upscale_averaging_radius, double upscale_sigma_dist,
double upscale_sigma_color, double speed_up_thr)
{
if (flow.isNull()) {
cv::Mat retval;
optflow::calcOpticalFlowSF(
from.toMat(), to.toMat(), retval, layers, averaging_block_size,
max_flow, sigma_dist, sigma_color, postprocess_window, sigma_dist_fix,
sigma_color_fix, occ_thr, upscale_averaging_radius,
upscale_sigma_dist, upscale_sigma_color, speed_up_thr);
return TensorWrapper(retval);
} else {
optflow::calcOpticalFlowSF(
from.toMat(), to.toMat(), flow.toMat(), layers, averaging_block_size,
max_flow, sigma_dist, sigma_color, postprocess_window, sigma_dist_fix,
sigma_color_fix, occ_thr, upscale_averaging_radius,
upscale_sigma_dist, upscale_sigma_color, speed_up_thr);
return flow;
}
}
示例2: randMVNormal
struct TensorWrapper randMVNormal(
struct TensorWrapper mean, struct TensorWrapper cov, int nsamples, struct TensorWrapper samples)
{
MatT samples_mat = samples.toMatT();
ml::randMVNormal(mean.toMat(), cov.toMat(), nsamples, samples_mat);
return TensorWrapper(samples_mat);
}
示例3: FrameSource_nextFrame
struct TensorWrapper FrameSource_nextFrame(struct FrameSourcePtr ptr, struct TensorWrapper frame)
{
MatT frame_mat;
if(!frame.isNull()) frame_mat = frame.toMatT();
ptr->nextFrame(frame_mat);
return TensorWrapper(frame_mat);
}
示例4: BackgroundSubtractor_apply
extern "C" struct TensorWrapper BackgroundSubtractor_apply(struct BackgroundSubtractorPtr ptr,
struct TensorWrapper image, struct TensorWrapper fgmast, double learningRate)
{
MatT fgmast_mat = fgmast.toMatT();
ptr->apply(image.toMat(), fgmast_mat, learningRate);
return TensorWrapper(fgmast_mat);
}
示例5: SuperResolution_nextFrame
struct TensorWrapper SuperResolution_nextFrame(struct SuperResolutionPtr ptr, struct TensorWrapper frame)
{
MatT frame_mat;
if(!frame.isNull()) frame_mat = frame.toMatT();
ptr->nextFrame(frame_mat);
return TensorWrapper(frame_mat);
}
示例6: KalmanFilter_predict
extern "C" struct TensorWrapper KalmanFilter_predict(struct KalmanFilterPtr ptr,
struct TensorWrapper control)
{
cv::Mat retval = control.toMat();
cv::Mat result = ptr->predict(retval);
return TensorWrapper(MatT(result));
}
示例7: xphoto_autowbGrayworld
struct TensorWrapper xphoto_autowbGrayworld(
struct TensorWrapper src, struct TensorWrapper dst, float thresh)
{
MatT dst_mat = dst.toMatT();
cv::xphoto::autowbGrayworld(src.toMat(), dst_mat, thresh);
return TensorWrapper(dst_mat);
}
示例8: imencode
struct TensorWrapper imencode(
const char *ext, struct TensorWrapper img, struct TensorWrapper params)
{
std::vector<unsigned char> retval;
cv::imencode(ext, img.toMat(), retval, params.toMat());
return TensorWrapper(cv::Mat(retval, true));
}
示例9: xphoto_dctDenoising
struct TensorWrapper xphoto_dctDenoising(
struct TensorWrapper src, struct TensorWrapper dst, double sigma, int psize)
{
MatT dst_mat = dst.toMatT();
cv::xphoto::balanceWhite(src.toMat(), dst_mat.mat, sigma, psize);
return TensorWrapper(dst_mat);
}
示例10: convertPointsHomogeneous
struct TensorWrapper convertPointsHomogeneous(
struct TensorWrapper src, struct TensorWrapper dst)
{
MatT dst_mat = dst.toMatT();
cv::convertPointsHomogeneous(src.toMat(), dst_mat);
return TensorWrapper(dst_mat);
}
示例11: Feature2DAsync_detectAsyncCuda
struct TensorWrapper Feature2DAsync_detectAsyncCuda(
struct cutorchInfo info, struct Feature2DAsyncPtr ptr, struct TensorWrapper image,
struct TensorWrapper keypoints, struct TensorWrapper mask)
{
cuda::GpuMat retval = keypoints.toGpuMat();
ptr->detectAsync(image.toGpuMat(), retval, TO_GPUMAT_OR_NOARRAY(mask), prepareStream(info));
return TensorWrapper(retval, info.state);
}
示例12: initCameraMatrix2D
struct TensorWrapper initCameraMatrix2D(
struct TensorArray objectPoints, struct TensorArray imagePoints,
struct SizeWrapper imageSize, double aspectRatio)
{
return TensorWrapper(MatT(cv::initCameraMatrix2D(
objectPoints.toMatList(), imagePoints.toMatList(),
imageSize, aspectRatio)));
}
示例13: BackgroundSubtractor_getBackgroundImage
extern "C" struct TensorWrapper BackgroundSubtractor_getBackgroundImage(
struct BackgroundSubtractorPtr ptr,
struct TensorWrapper backgroundImage)
{
MatT backgroundImage_mat = backgroundImage.toMatT();
ptr->getBackgroundImage(backgroundImage_mat);
return TensorWrapper(backgroundImage_mat);
}
示例14: TrainData_getSample
struct TensorWrapper TrainData_getSample(
struct TrainDataPtr ptr, struct TensorWrapper varIdx, int sidx)
{
cv::Mat varIdxMat = varIdx.toMat();
std::vector<float> output(varIdxMat.rows * varIdxMat.cols);
ptr->getSample(varIdxMat, sidx, output.data());
return TensorWrapper(cv::Mat(output, true));
}
示例15: xphoto_inpaint
struct TensorWrapper xphoto_inpaint(
struct TensorWrapper src, struct TensorWrapper mask,
struct TensorWrapper dst, int algorithmType)
{
MatT dst_mat = dst.toMatT();
cv::xphoto::inpaint(src.toMat(), mask.toMat(), dst_mat.mat, algorithmType);
return TensorWrapper(dst_mat);
}