+Mat<byte> readPartialFile(int n, int k, int& sizeFile, int &lc) {
+
+// ifstream stream("lena.png", ios::in | ios::binary | ios::ate);
+ ifstream stream("lena_small2.png", ios::in | ios::binary | ios::ate);
+ sizeFile=stream.tellg();
+ cout<<sizeFile<<endl;
+ stream.seekg(0, ios::beg);
+
+
+ lc=ceil(double(sizeFile)/k);
+ cout<<lc<<endl;
+
+ vector<uint8_t> contents2(k*lc,0);
+ vector<uint8_t> contents((istreambuf_iterator<char>(stream)), istreambuf_iterator<char>());
+ copy ( contents.begin(), contents.end(), contents2.begin() );
+
+
+
+
+ Mat<byte> matData(&contents2[0],1,contents2.size());
+
+ cout << "file size: " << contents2.size() << endl;
+
+ matData.reshape(k,lc);
+ cout<<matData.n_rows<<" "<<matData.n_cols<<endl;
+ return matData;
+}
+
+
+
+