How many would you like? Python is extremely good for computation, which is why it’s used so often for data science and computational research. We can perform many, many calculations and manipulations! For example, I realized that your application may not need superpixels at all. I need more information about what your desired end result is, though. If we can clearly define the problem you’re solving, then the solution is usually equally clear.
- What amount of detail do you need to keep? In other words, is it okay to lose small areas of temperature information (pixels) to produce the much fewer superpixels that you would like to have?
- How should the gaps between panels come out? Is it okay if the gaps are blended in with the panel areas or would you prefer to have one or two long, skinny superpixels there?
I also need some clean input data. If you will post (or send me) a raw thermal image to work with, I will be able to evaluate the outputs we can achieve. I can produce hundreds of very different output results in a few minutes.
A simple approach is Binning (grouping) of temperature ranges. This can be done by scaling down and then back up with integer math. Here’s an example:
rawdata = [randint(0,19) for i in range(20)]
print(rawdata)
compressed = [item//5 for item in data] #rounds values down into 5 bins
restored = [item*5 for item in compressed]
print(restored)
SAMPLE OUTPUT
[6, 2, 12, 8, 10, 2, 18, 15, 1, 8, 16, 15, 14, 7, 3, 15, 12, 7, 10, 5]
[5, 0, 10, 5, 10, 0, 15, 15, 0, 5, 15, 15, 10, 5, 0, 15, 10, 5, 10, 5]