Category : computer-vision

The tutorial gives an example about using packed_accessor64 to access tensor elements efficiently as follows. However, I still do not know how to use packed_accessor64. Can anyone give me a more specific example? Thanks. __global__ void packed_accessor_kernel( PackedTensorAccessor64<float, 2> foo, float* trace) { int i=threadIdx.x gpuAtomicAdd(trace, foo[i][i]) } torch::Tensor foo = torch::rand({12, 12}); // assert ..

Read more

#include <opencv2/imgcodecs.hpp> #include <opencv2/highgui.hpp> #include <opencv2/imgproc.hpp> #include <iostream> using namespace std; using namespace cv; int main() { String path = "resources/grey scale forest.jpg"; Mat image = imread(path); Mat dst; equalizeHist(image, dst); imshow("forest", dst); waitKey(0); return 0; } When I tried running the above code I’ve got an exemption. I’ve found out the error was in ..

Read more