Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
ae10c229
Commit
ae10c229
authored
Jun 27, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refined spec a little.
parent
7bb38812
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
33 deletions
+35
-33
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 pairs
. 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