Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
ae10c229
Commit
ae10c229
authored
Jun 26, 2012
by
Davis King
Browse files
Refined spec a little.
parent
7bb38812
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
33 deletions
+35
-33
dlib/graph_cuts/find_max_factor_graph_potts_abstract.h
dlib/graph_cuts/find_max_factor_graph_potts_abstract.h
+35
-33
No files found.
dlib/graph_cuts/find_max_factor_graph_potts_abstract.h
View file @
ae10c229
...
@@ -442,6 +442,10 @@ namespace dlib
...
@@ -442,6 +442,10 @@ namespace dlib
- #labels.nc() == prob.nc()
- #labels.nc() == prob.nc()
!*/
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// The following functions and interface definitions are convenience routines for use
// with the potts grid problem version of find_max_factor_graph_potts() defined above.
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
@@ -451,11 +455,11 @@ namespace dlib
...
@@ -451,11 +455,11 @@ namespace dlib
WHAT THIS OBJECT REPRESENTS
WHAT THIS OBJECT REPRESENTS
This object defines a slightly more convenient interface for creating
This object defines a slightly more convenient interface for creating
potts_grid_problems which operate on an image. In this case, the goal
potts_grid_problems which operate on an image. In this case, the goal
is to assign a label to each
coordinate of
an image. In particular,
is to assign a
binary
label to each
pixel in
an image. In particular,
this object defines the interface used by the make_potts_grid_problem()
this object defines the interface used by the make_potts_grid_problem()
routine defined below.
routine defined below.
In the comments
below
, we will refer to the image supplied to
In the
following
comments, we will refer to the image supplied to
make_potts_grid_problem() as IMG.
make_potts_grid_problem() as IMG.
!*/
!*/
...
@@ -500,45 +504,17 @@ namespace dlib
...
@@ -500,45 +504,17 @@ namespace dlib
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template
<
typename
single_image_model
,
typename
pixel_type
,
typename
mem_manager
>
potts_grid_problem
make_potts_grid_problem
(
const
single_image_model
&
model
,
const
array2d
<
pixel_type
,
mem_manager
>&
img
);
/*!
requires
- single_image_model == an object with an interface compatible with the
single_image_model object defined above.
- for all valid i and j:
- model.factor_value_disagreement(i,j) >= 0
- model.factor_value_disagreement(i,j) == model.factor_value_disagreement(j,i)
ensures
- returns a potts_grid_problem which can be solved using the
find_max_factor_graph_potts(prob,array2d) routine defined above. That is,
given an image to store the labels, the following statement would solve the
potts problem defined by the given model and image:
find_max_factor_graph_potts(make_potts_grid_problem(model,img),labels);
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
struct
pair_image_model
struct
pair_image_model
{
{
/*!
/*!
WHAT THIS OBJECT REPRESENTS
WHAT THIS OBJECT REPRESENTS
This object defines a slightly more convenient interface for creating
This object defines a slightly more convenient interface for creating
potts_grid_problems which operate on a pair of identically sized images.
potts_grid_problems which operate on a pair of identically sized images.
In this case, the goal is to assign a label to each
coordinate in one
In this case, the goal is to assign a label to each
pixel in the first
of the
image
pair
s
. In particular, this object defines the interface
image
of the pair. In particular, this object defines the interface
used by the make_potts_grid_problem() routine defined below.
used by the make_potts_grid_problem() routine defined below.
In the comments
below
, we will refer to the two images supplied to
In the
following
comments, we will refer to the two images supplied to
make_potts_grid_problem() as IMG1 and IMG2. The goal of the potts
make_potts_grid_problem() as IMG1 and IMG2. The goal of the potts
problem will be to assign labels to each pixel in IMG1 (IMG2 is
problem will be to assign labels to each pixel in IMG1 (IMG2 is
not labeled, it is simply used as a place to keep auxiliary data).
not labeled, it is simply used as a place to keep auxiliary data).
...
@@ -589,6 +565,32 @@ namespace dlib
...
@@ -589,6 +565,32 @@ namespace dlib
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template
<
typename
single_image_model
,
typename
pixel_type
,
typename
mem_manager
>
potts_grid_problem
make_potts_grid_problem
(
const
single_image_model
&
model
,
const
array2d
<
pixel_type
,
mem_manager
>&
img
);
/*!
requires
- single_image_model == an object with an interface compatible with the
single_image_model object defined above.
- for all valid i and j:
- model.factor_value_disagreement(i,j) >= 0
- model.factor_value_disagreement(i,j) == model.factor_value_disagreement(j,i)
ensures
- returns a potts_grid_problem which can be solved using the
find_max_factor_graph_potts(prob,array2d) routine defined above. That is,
given an image to store the labels, the following statement would solve the
potts problem defined by the given model and image:
find_max_factor_graph_potts(make_potts_grid_problem(model,img),labels);
!*/
// ----------------------------------------------------------------------------------------
template
<
template
<
typename
pair_image_model
,
typename
pair_image_model
,
typename
pixel_type
,
typename
pixel_type
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment