I need to segment an image, based on a simple rule (if value is in between 2 values). I'm using only STL containers (I'm not using opencv or other libraries because I want to keep this free of dependencies while teaching myself c++)
I've stored my images as vector< vector<double> >
. My brute force approach is to iterate through my image using 2 iterators and check each value, and maybe push the indices of the values that satisfy my condition to another vector<int>
. I'll have to do this until all segments are found. Every time I want to pick a segment I'll iterate through the stored indices.
What is the correct way to do this?
Can this be achieved in one pass?
What is a suitable STL container for this process? I'm trying to figure it out through this flowchart. The best I can come up with was an
unordered_multimap
.