Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
utility
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bioroboticslab
biotracker
utility
Commits
d8733037
Commit
d8733037
authored
6 years ago
by
moenck
Browse files
Options
Downloads
Patches
Plain Diff
Removed more liabilities
parent
5ab0585d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#12464
passed
6 years ago
Stage: build
Stage: package
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Src/CMakeLists.txt
+0
-2
0 additions, 2 deletions
Src/CMakeLists.txt
Src/util/IImageProcessor.h
+0
-29
0 additions, 29 deletions
Src/util/IImageProcessor.h
Src/util/ImagePreProcessor.h
+0
-181
0 additions, 181 deletions
Src/util/ImagePreProcessor.h
with
0 additions
and
212 deletions
Src/CMakeLists.txt
+
0
−
2
View file @
d8733037
...
...
@@ -43,7 +43,5 @@ set(${TN}_PUBLIC_HEADERS
"
${
CMAKE_CURRENT_LIST_DIR
}
/TrackedComponents/TrackedTrajectory.h"
"
${
CMAKE_CURRENT_LIST_DIR
}
/util/misc.h"
"
${
CMAKE_CURRENT_LIST_DIR
}
/util/singleton.h"
"
${
CMAKE_CURRENT_LIST_DIR
}
/util/ImagePreProcessor.h"
"
${
CMAKE_CURRENT_LIST_DIR
}
/util/IImageProcessor.h"
"
${
CMAKE_CURRENT_LIST_DIR
}
/IConfig.h"
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Src/util/IImageProcessor.h
deleted
100644 → 0
+
0
−
29
View file @
5ab0585d
#pragma once
#include
<cv.h>
class
Rectification
;
class
Settings
;
class
IImageProcessor
{
public:
IImageProcessor
(
Rectification
&
rectification
,
Settings
&
settings
)
:
_rectification
(
rectification
),
_settings
(
settings
)
{
}
virtual
~
IImageProcessor
(
void
)
{}
/**
* This method processed the image and detects the found object.
* @param image, the image to process,
* @return void.
*/
virtual
void
process
(
cv
::
Mat
image
)
=
0
;
protected
:
const
Rectification
&
_rectification
;
Settings
&
_settings
;
};
This diff is collapsed.
Click to expand it.
Src/util/ImagePreProcessor.h
deleted
100644 → 0
+
0
−
181
View file @
5ab0585d
#pragma once
#include
<opencv2/opencv.hpp>
#include
"util/stdext.h"
namespace
BioTracker
{
namespace
Core
{
namespace
PREPROCESSORPARAM
{
// Parameter for the opencv BackgroundSubtractorMOG2 class
static
const
std
::
string
BG_MOG2_HISTORY
=
"TRACKERPARAM.BG_MOG2_HISTORY"
;
static
const
std
::
string
BG_MOG2_VAR_THRESHOLD
=
"TRACKERPARAM.BG_MOG2_VAR_THRESHOLD"
;
static
const
std
::
string
BG_MOG2_SHADOW_DETECTION
=
"TRACKERPARAM.BG_MOG2_SHADOW_DETECTION"
;
static
const
std
::
string
BG_MOG2_BACKGROUND_RATIO
=
"TRACKERPARAM.BG_MOG2_BACKGROUND_RATIO"
;
// Parameters for enabling methods
static
const
std
::
string
ENABLE_BG_SUBTRACTION
=
"TRACKERPARAM.ENABLE_BG_SUBTRACTION"
;
static
const
std
::
string
ENABLE_BG_IMAGE
=
"TRACKERPARAM.ENABLE_BG_IMAGE"
;
static
const
std
::
string
ENABLE_BINARIZING
=
"TRACKERPARAM.ENABLE_BINARIZING"
;
static
const
std
::
string
ENABLE_ERODE
=
"TRACKERPARAM.ENABLE_ERODE"
;
static
const
std
::
string
ENABLE_DILATE
=
"TRACKERPARAM.ENABLE_DILATE"
;
static
const
std
::
string
IMAGE_VIEW_TYPE
=
"TRACKERPARAM.IMAGE_VIEW_TYPE"
;
// Mapping issue
static
const
std
::
string
MAX_MAPPED_DISTANCE_PX
=
"TRACKERPARAM.MAX_MAPPED_DISTANCE_PX"
;
static
const
std
::
string
MAX_MAPPED_DISTANCE_CM
=
"TRACKERPARAM.MAX_MAPPED_DISTANCE_CM"
;
// Blob dectection issue
static
const
std
::
string
MAX_BLOB_SIZE
=
"TRACKERPARAM.MAX_BLOB_SIZE"
;
static
const
std
::
string
MIN_BLOB_SIZE
=
"TRACKERPARAM.MIN_BLOB_SIZE"
;
// Parameters for image pre-processing step
static
const
std
::
string
SIZE_ERODE
=
"TRACKERPARAM.SIZE_ERODE"
;
static
const
std
::
string
SIZE_DILATE
=
"TRACKERPARAM.SIZE_DILATE"
;
static
const
std
::
string
THRESHOLD_BINARIZING
=
"TRACKERPARAM.THRESHOLD_BINARIZING"
;
// Image processing type
enum
IMAGE_DISPLAY_TYPE
{
IMAGE_OR
=
0
,
IMAGE_BI
=
1
,
IMAGE_ER
=
2
,
IMAGE_DI
=
3
,
IMAGE_FG
=
4
,
IMAGE_BG
=
5
,
IMAGE_PP
=
6
,
};
}
class
Settings
;
class
ImagePreProcessor
{
public:
/**
* The constructor with provided parameters.
* @param settings reference to the biotracker settings object
*/
ImagePreProcessor
(
Settings
&
settings
);
/**
* Init function. Sets the property for the imge pre-processing.
*/
void
init
();
/**
* A computer vision method to binarize an image.
* @param image image to binarize,
* @return a binarized image.
*/
cv
::
Mat
binarize
(
cv
::
Mat
image
);
/**
* Sets the threshold value for a parameter
* @param paramName the parameter name,
* @param threshValue threshold value,
*/
void
setThreshold
(
std
::
string
paramName
,
std
::
string
threshValue
);
/**
* A mathematical morphology operation using in computer vision to erode an image.
* Erode image with 3x3 4-connectivity.
* @param image image to erode,
* @return an eroded image.
*/
cv
::
Mat
erode
(
cv
::
Mat
image
);
/**
* A mathematical morphology operation using in computer vision to dilate an image.
* Dilate image with 6x6 8-connectivity.
* @param image image to dilate,
* @return a dilated image.
*/
cv
::
Mat
dilate
(
cv
::
Mat
image
);
/**
* A computer vision methode to calculate the image difference.
* Background image subtracts the foreground image.
* @param image image to background subtract,
* @return the background subtracted image.
*/
cv
::
Mat
backgroundSubtraction
(
cv
::
Mat
image
);
/**
* Pre-process an image, if all methods enabled, this function:
* - does the background subtraction
* - erodes the image
* - dilates the image
* @param image image to process,
*/
void
preProcess
(
cv
::
Mat
image
);
/**
* The method updates the image background.
*/
void
resetBackgroundImage
();
/**
* Method to enable image pre-processing methods
* @param enableProcess specifies the process to enable or disable,
* @param enable true to enable, false to disable.
*/
void
setEnable
(
std
::
string
enableProcess
,
bool
enable
=
true
);
/**
* Gets displayed image type for displaying it.
* @param imageDisplayType kind of image need to retrieve.
* Hint: IMAGE_BI, binarized image,
* IMAGE_ER, eroded image,
* IMAGE_DI, dilated image,
* IMAGE_FG, foreground mask image,
* IMAGE_BG, background image,
* IMAGE_PP, final proceedied image,
* @return type of image.
*/
cv
::
Mat
imageDisplayType
(
PREPROCESSORPARAM
::
IMAGE_DISPLAY_TYPE
imageDisplayType
);
private:
// System properties
Settings
&
_settings
;
// variable of the various processing image
cv
::
Mat
_original
;
cv
::
Mat
_proceededImage
;
cv
::
Mat
_fgMaskMOG
;
cv
::
Mat
_backgroundImage
;
cv
::
Mat
_binarizedImage
;
cv
::
Mat
_erodedImage
;
cv
::
Mat
_dilatedImage
;
// background subtraction
std
::
unique_ptr
<
cv
::
BackgroundSubtractorMOG2
>
_pMOG
;
//parameters for image pre-processing
bool
_backgroundSubtractionEnabled
;
bool
_backgroundEnabled
;
bool
_binarizeEnabled
;
bool
_erodeEnabled
;
bool
_dilateEnabled
;
};
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment