RandomBallCover  1.2.1
 Hosted by GitHub
Functions | Variables
rgb_img_segmentation.cpp File Reference

An application examining the potential of the Random Ball Cover data structure for image segmentation. More...

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <limits>
#include <chrono>
#include <random>
#include <CLUtils.hpp>
#include <RBC/algorithms.hpp>
#include <RBC/tests/helper_funcs.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
Include dependency graph for rgb_img_segmentation.cpp:

Functions

template<typename iterator >
void random_unique (iterator xBegin, iterator xEnd, iterator rBegin, iterator rEnd)
 Picks a number of elements uniformly at random without replacement from the input sequence. More...
 
int main (int argc, const char **argv)
 

Variables

const std::vector< std::string > kernel_files
 

Detailed Description

An application examining the potential of the Random Ball Cover data structure for image segmentation.

This application was developed for testing the eligibility of RBC for image segmentation. Try changing the nr variable for configuring the number of representatives, and/or the a variable for adjusting the influence of the color intensity, and examine the effects on the image. By creating a graph with the representatives, and adjusting the edge weights, connected components could be created that would define areas of interest.

Note
The result is randomized. To assign representatives at regular intervals, try uncommenting the commented sections, and comment out the relevant lines (marked with // at the end).
Author
Nick Lamprianidis
Version
1.2.1
Date
2015
Copyright (c) 2015 Nick Lamprianidis
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Function Documentation

int main ( int  argc,
const char **  argv 
)
template<typename iterator >
void random_unique ( iterator  xBegin,
iterator  xEnd,
iterator  rBegin,
iterator  rEnd 
)

Picks a number of elements uniformly at random without replacement from the input sequence.

The function implements a Fisher-Yates shuffle.

Parameters
[in]xBeginiterator to the initial position of the input sequence.
[in]xEnditerator past the final position of the input sequence.
[out]rBeginiterator to the initial position of the output sequence.
[out]rEnditerator past the final position of the output sequence.

Variable Documentation

const std::vector<std::string> kernel_files
Initial value:
= { "kernels/rbc_kernels.cl",
"kernels/scan_kernels.cl" }