0

The code:

    # COMPARISON BETWEEN REFERENCE AND NEW IMAGE #  
difference=[]
for hist_part in ref_hist:
    diff_score, diff_table= difference_histogram(hist_part[1],hist_part_new)
    difference.append(diff_score)
difference.append(ref_humidity)


# HUMIDITY CALCULATION #
min_score = min(difference)        # closest reference image

The error:

Traceback (most recent call last):
File "C:\Users\Dilshad\Desktop\project_7-8-2015\8_bands\Program_camera - test.py", line 68, in <module>
min_score = min(difference)                                                         # closest reference image
TypeError: unorderable types: list() < int()

I imagine I need to convert all elements of the list into int in order to make them orderable types. Any suggestions?

tds
  • 13
  • 3
  • 1
    So we can infer that one or more of the elements of `difference` are `list`s. But beyond that, we're guessing: at the very least you would have to show us an example `difference` and what you think the correct answer of `min(difference)` should be. You are the one who must define what the `min` operation should be *doing* when applied to something other than a sequence of numbers. Perhaps you were expecting `diff_score` to be just a number every time? If so, it looks like that's the assumption that's letting you down. Investigate... – jez Dec 22 '15 at 16:28
  • i guess you are comparing a set of images to a reference image. The comparisons gives a histogram. You further use this histogram to make a difference histogram. But is this the right approach? I don't know. See this answer http://stackoverflow.com/questions/6499491/comparing-two-histograms – Vorsprung Dec 22 '15 at 16:47

0 Answers0