Closed minhvogremsy closed 1 year ago
There is a simple example:
#define SIMD_OPENCV_ENABLE
#include "Simd/SimdLib.hpp"
typedef Simd::View<Simd::Allocator> View;
int main()
{
cv::Mat cvSrc = imread("image.jpg", IMREAD_GRAYSCALE);
View simdSrc = cvSrc;
View simdInt(simdSrc.width + 1, simdSrc.height + 1, View::Int32);
Simd::Integral(simdSrc, simdInt);
cv::Mat cvInt = simdInt;
return 0;
}
But I have an error Simd/SimdLib.hpp:2392: void Simd::Integral(const Simd::View&, Simd::View&) [with A = Simd::Allocator]: Assertion `src.format == View::Gray8 && sum.format == View::Int32' failed.
Aborted (core dumped)
It seems that function imread("image.jpg", IMREAD_GRAYSCALE);
reads image in format different from 8-bit gray.
Perhaps there is need to additional conversion of input image to 8-bit gray because Simd::Integral works only with 8-bit gray input images.
Please help me how to read image with opencv and add it to Simd::Integral. Thanks you!