2014-09-22 03:04:54 -0500 received badge ● Scholar (source) 2014-09-19 15:04:56 -0500 received badge ● Student (source) 2014-09-19 09:12:02 -0500 received badge ● Supporter (source) 2014-09-19 09:02:43 -0500 commented question Pixel tensors as matrix of matrices I guess I could also just have four different Mat objects in an array, one for each of the elements in the tensor. 2014-09-19 08:54:15 -0500 asked a question Pixel tensors as matrix of matrices Hello! I want to calculate the structure tensor of an image, so I need to store one 2-by-2 matrix for each pixel of the image, and I am wondering what is the best way to do this. Optimally, I would like to be able to do tensors(3,4) to get a Mat(2,2) object containing the tensor at position (3,4) in the image. I tried variants of Mat_ > tt(10, 10); tt(0,3).create(2, 2);  But it fails with a segmentation fault when trying to create the 2-by-2 tensor Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7abf5b9 in cv::Mat::create(int, int const*, int) () from /usr/lib/libopencv_core.so.2.4 (gdb) bt #0 0x00007ffff7abf5b9 in cv::Mat::create(int, int const*, int) () from /usr/lib/libopencv_core.so.2.4 #1 0x0000000000403576 in cv::Mat::create (this=0x654870, _rows=2, _cols=2, _type=4) at /usr/include/opencv2/core/mat.hpp:353 #2 0x0000000000403937 in cv::Mat_::create (this=0x654870, _rows=2, _cols=2) at /usr/include/opencv2/core/mat.hpp:910 #3 0x0000000000402e7a in main (argc=5, argv=0x7fffffffe408) at /home/burk/dev/image-restoration/sobel.cpp:100  I'm sure I'm just missing something trivial in one of the constructors, but I feel like I have tried everything!