Note that there are some explanatory texts on larger screens.

plurals
  1. POPython library solution to group object using nontrivial checkers
    primarykey
    data
    text
    <p>I need to iterate through a set of objects and group those by certain attributes into subset. To check whether an object belongs to a subset is complicated as it depends on the object already in the subset. Therefore I use callable objects as checkers. There can be several of those. Random access to the objects of the subsets is needed throughout the application.</p> <p>Here is my idea how to handle it.</p> <pre><code>class Sequence: def __init__(self): self.seq_data = dict() self.checkers = list() def __len__(self): def __delitem__(self, key): def __getitem__(self, key): def add(self, item): def check(self, item): def itemlist(self): </code></pre> <p>I wonder if there is generic solution for this problem in one of the python libraries.</p> <p>Example (as requested): given a set of photos with exif data, several images that belong together and shall be used to produce a final image can be considered as a set. E.g. images with different exposure compensation are used for creating HDR images. To figure out whether an image is part of a sequence, the exposure compensation exif field can be checked: (img1, img2, img3)->(0, -1, +1), ) or (0, -2, +2) are possible scenarios. The order and actual values depend on camera setting, however there is always a rule that can be used to identify which images belong together.</p> <p>Another example can be panorama. Say you take 4x5 partially overlapping images, that can be stitched to a bigger one. I want to identify such image sequences automatically using exif data.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload