Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
MPAI-Private
MPAI-CAE
arp
Video Analyzer
Commits
6f21c5c1
Commit
6f21c5c1
authored
May 13, 2023
by
Matteo
Browse files
add class methods for frame
parent
ce2e89ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/utility.cpp
View file @
6f21c5c1
#include
"utility.h"
#include
"utility.h"
using
namespace
cv
;
using
namespace
cv
;
using
namespace
std
;
using
namespace
std
;
...
@@ -28,6 +28,17 @@ utility::Frame& utility::Frame::convertColor(int code) {
...
@@ -28,6 +28,17 @@ utility::Frame& utility::Frame::convertColor(int code) {
cvtColor
(
*
this
,
*
this
,
code
);
cvtColor
(
*
this
,
*
this
,
code
);
return
*
this
;
return
*
this
;
}
}
utility
::
Frame
utility
::
Frame
::
difference
(
Frame
&
f
)
{
return
Frame
(
utility
::
difference
(
*
this
,
f
));
}
utility
::
Frame
&
utility
::
Frame
::
crop
(
Size
rect_size
,
Point2f
center
)
{
cv
::
getRectSubPix
(
*
this
,
rect_size
,
center
,
*
this
);
return
*
this
;
}
utility
::
Frame
&
utility
::
Frame
::
warp
(
cv
::
Mat
rotationMatrix
)
{
cv
::
warpAffine
(
*
this
,
*
this
,
rotationMatrix
,
this
->
size
(),
INTER_CUBIC
);
return
*
this
;
}
void
utility
::
detectShape
(
Ptr
<
GeneralizedHoughGuil
>
alg
,
Mat
templateShape
,
int
posThresh
,
vector
<
Vec4f
>
&
positivePositions
,
Mat
&
positiveVotes
,
vector
<
Vec4f
>
&
negativePositions
,
Mat
&
negativeVotes
,
Mat
processingArea
)
{
void
utility
::
detectShape
(
Ptr
<
GeneralizedHoughGuil
>
alg
,
Mat
templateShape
,
int
posThresh
,
vector
<
Vec4f
>
&
positivePositions
,
Mat
&
positiveVotes
,
vector
<
Vec4f
>
&
negativePositions
,
Mat
&
negativeVotes
,
Mat
processingArea
)
{
...
...
src/utility.h
View file @
6f21c5c1
...
@@ -23,8 +23,12 @@ namespace utility {
...
@@ -23,8 +23,12 @@ namespace utility {
Frame
clone
()
const
;
Frame
clone
()
const
;
Frame
&
downsample
(
int
factor
);
Frame
&
downsample
(
int
factor
);
Frame
&
convertColor
(
int
code
);
Frame
&
convertColor
(
int
code
);
Frame
difference
(
Frame
&
f
);
Frame
&
crop
(
Size
rect_size
,
Point2f
center
);
Frame
&
warp
(
cv
::
Mat
rotationMatrix
);
};
};
/**
/**
* @brief Detects a given shape in an image, using a the OpenCV algorithm GeneralizedHoughGuil.
* @brief Detects a given shape in an image, using a the OpenCV algorithm GeneralizedHoughGuil.
*
*
...
@@ -73,5 +77,4 @@ namespace utility {
...
@@ -73,5 +77,4 @@ namespace utility {
* @return cv::Mat A black and white frame, where black pixels represent a difference, while white pixels represent an equality.
* @return cv::Mat A black and white frame, where black pixels represent a difference, while white pixels represent an equality.
*/
*/
cv
::
Mat
difference
(
cv
::
Mat
&
prevFrame
,
cv
::
Mat
&
currentFrame
);
cv
::
Mat
difference
(
cv
::
Mat
&
prevFrame
,
cv
::
Mat
&
currentFrame
);
}
}
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment