Scanbot SDK
Loading...
Searching...
No Matches
ScanbotSDKOpenCV.hpp
Go to the documentation of this file.
1
6#pragma once
7#ifndef SCANBOTSDK_OPENCV_HPP
8#define SCANBOTSDK_OPENCV_HPP
9
10#include <ScanbotSDK.h>
11#include <cassert>
12#include <opencv2/core/mat.hpp>
13
14namespace scanbotsdk {
21 inline scanbotsdk_image_t toImage(const cv::Mat& image) {
22 assert(image.depth() == CV_8U);
23
24 scanbotsdk_image_t result;
25 result.buffer = image.data;
26 result.height = image.rows;
27 result.width = image.cols;
28 result.channels = image.channels();
29 result.stride = image.step;
30 return result;
31 }
32}
33
34#endif //SCANBOTSDK_OPENCV_HPP
scanbotsdk_image_t toImage(const cv::Mat &image)
Wraps the data of the given cv::Mat in a scanbotsdk_image_t struct.
Definition ScanbotSDKOpenCV.hpp:21
The Scanbot SDK C API.
Wrapper for image data.
Definition ScanbotSDK.h:185
int stride
Row stride in bytes, if 0 the stride will be calculated automatically.
Definition ScanbotSDK.h:199
int channels
The number of channels in the image.
Definition ScanbotSDK.h:196
int width
Image width.
Definition ScanbotSDK.h:190
void * buffer
The image buffer. The buffer data type must be an 8-bit integer.
Definition ScanbotSDK.h:187
int height
Image height.
Definition ScanbotSDK.h:193