Modifying Lenet5 for 24 bit bmp images

Alex
2010-07-06
2012-11-08
  • Alex
    Alex
    2010-07-06

    I would like to use Lenet5 to classify a database of 24 bit bmp images into
    one of six different groups.

    How do I go about converting these images into a format similar to the MNIST
    database.

    Will the magic number be the same?

    Do I simply increase each pixel offset to 3 bytes?

    Has anyone ever done something similar using Matlab or using Lush itself?

    -Alex

     
  • Alex
    Alex
    2010-07-08

    fid=fopen('t10k-flylabels-idx1-ubyte','w','b');

    fwrite(fid,2049,'int32');

    fwrite(fid,10000,'int32');

    open('stages.mat')

    for i = 1:10000

    fwrite(fid,all_stages(i),'uchar');
    end

    fclose(fid);

    fid=fopen('train-flylabels-idx1-ubyte','w','b');

    fwrite(fid,2049,'int32');

    fwrite(fid,47082,'int32');

    for i = 10001:57082

    fwrite(fid,all_stages(i),'uchar');
    end

    fclose(fid);

    Here is the code I used to create new labels in MATLAB for use by Lenet5. Much
    of the code is obviously coded for my own purposes but it may be useful to
    others to modify.

    I will post the code for image conversion once I verify that it works
    properly.