Oct-27-2019, 11:30 PM
Hello, I have the following code in MATLAB which I am trying to convert to python, using numpy.
M = zeros(100,100); imageFiles = dir('*.bmp'); nFiles = length(imageFiles); for i = 1:nFiles currentFilename = imageFiles(i).name; f1 = fopen(num2str(currentFilename),'rb'); fread(f1,13,'char'); im = fread(f1,100*100,'uint8'); %currentImage = imread(currentFilename); %im = currentImage; for k = 1:100 for m = 1:100 NIM(i,k,m) = im((k-1)*100+m); end end fclose(f1); endI'm unfamiliar with how to load a 3D matrix in python. Any help would be greatly appreciated.