Git Product home page Git Product logo

Comments (8)

jomalsan avatar jomalsan commented on May 20, 2024 1

The normalization that you have above will work for viewing the images, however I would not train on data that has been normalized in this way. Because the normalization takes the entire image into account, the portion of the image that contains a seal will be different numerically depending on if the image is primarily ice (low value) or liquid (high value)

from arcticseals.

Marcel-Simon avatar Marcel-Simon commented on May 20, 2024

It seems the reason why the 16 bit images are all gray is because the values are all pretty high, while still having very small variance.

In: np.unique(img, return_counts=True)
Out: (array([51241, 51361, 51381, 51401, 51421, 51441, 51461, 51481, 51501,
        51521, 51541, 51561, 51581, 51601, 51621, 51641, 51661, 51681,
        51701, 51721, 51741, 51761, 51781, 51801, 51821, 51841, 51861,
        51881, 51901, 51921, 51941, 51961, 51981, 52001, 52021, 52041,
        52061, 52101, 52181]),
 array([    1,     2,    13,     6,    31,    50,   204,   313,   880,
         1086,  3079,  6116, 11211, 12168, 27619, 25012, 45961, 33892,
        50997, 30580, 34756, 14925, 13214,  5228,  4758,  1819,  1709,
          762,   615,   323,   163,    80,    40,    35,    10,     8,
           10,     2,     2], dtype=int64))

However, the image reading itself seems fine. We just need proper normalization. For example, try this:

img = np.array(PIL.Image.open(image_path)).astype(np.float64)
mi = np.percentile(img, 1)
ma = np.percentile(img, 99)
plt.imshow((img - mi)/(ma-mi), vmin=0, vmax=1)

It is also important to set vmin=0, vmax=1 when using pyplot, as it will mess up scaling because there are negative and values >1 in the array after normalization. Also note that int is automatically converted to float during the devision as mi and ma are floats.

Also be careful when converting to 8 bit, because you will get unhandled overflows:

In: np.array([255,256,257]).astype(np.uint8)
Out: array([255,   0,   1], dtype=uint8)

from arcticseals.

Marcel-Simon avatar Marcel-Simon commented on May 20, 2024

It's true that the distribution might be very different locally. It would be helpful to get some statistics as this issue certainly influences the architecture of recognition models. Let's make a possible action item out of this:

  • Collect statistics of the IR image values across different images and for local regions containing seals. This could be as simple as an histogram, but we also need a way to compare the statistics of different images and somehow measure how different they are from each other. It would be also good to know, if the temperature value of the seals is consistent or not.

from arcticseals.

jomalsan avatar jomalsan commented on May 20, 2024

I am working on putting together a Jupyter notebook that explains what we currently know and then building a python script for other people to include

from arcticseals.

jomalsan avatar jomalsan commented on May 20, 2024

Thanks to Eric for his help on this project. The code is checked into "src/ir-normalization" and the normalized images have been added as a tar file to blob storage as "ArcticSealsTrain1807221152_N.tar". For the new normalized 8-bit thermal images, we have changed "16BIT" to "8BIT_N" in the file names to keep it straight.

from arcticseals.

pbaer avatar pbaer commented on May 20, 2024

from arcticseals.

Marcel-Simon avatar Marcel-Simon commented on May 20, 2024

from arcticseals.

pbaer avatar pbaer commented on May 20, 2024

from arcticseals.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.