Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
389c002e
Commit
389c002e
authored
Jul 22, 2010
by
James Bowman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grabCut fist impl and test
parent
f5720474
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
api
modules/python/api
+9
-0
cv.cpp
modules/python/cv.cpp
+26
-0
No files found.
modules/python/api
View file @
389c002e
...
...
@@ -1644,6 +1644,15 @@ HOGDetectMultiScale CvSeq*
int nbins 9
int gammaCorrection 1
grabCut
CvArr image
CvArr mask
CvRect rect
CvArr bgdModel
CvArr fgdModel
int iterCount
int mode
# These functions are handwritten in cv.cpp; they appear here as 'doconly' declarations
# so that their documentation can be auto-generated
ApproxPoly /doconly
...
...
modules/python/cv.cpp
View file @
389c002e
...
...
@@ -3763,6 +3763,21 @@ static CvSeq* cvHOGDetectMultiScale( const CvArr* image, CvMemStorage* storage,
return
seq
;
}
static
void
cvgrabCut
(
CvArr
*
image
,
CvArr
*
mask
,
CvRect
rect
,
CvArr
*
bgdModel
,
CvArr
*
fgdModel
,
int
iterCount
,
int
mode
)
{
cv
::
Mat
_image
=
cv
::
cvarrToMat
(
image
);
cv
::
Mat
_mask
=
cv
::
cvarrToMat
(
mask
);
cv
::
Mat
_bgdModel
=
cv
::
cvarrToMat
(
bgdModel
);
cv
::
Mat
_fgdModel
=
cv
::
cvarrToMat
(
fgdModel
);
grabCut
(
_image
,
_mask
,
rect
,
_bgdModel
,
_fgdModel
,
iterCount
,
mode
);
}
static
int
zero
=
0
;
/************************************************************************/
...
...
@@ -3826,10 +3841,13 @@ static int to_ok(PyTypeObject *to)
#define MKTYPE(NAME) do { NAME##_specials(); if (!to_ok(&NAME##_Type)) return; } while (0)
using
namespace
cv
;
extern
"C"
#if defined WIN32 || defined _WIN32
__declspec
(
dllexport
)
#endif
void
initcv
()
{
PyObject
*
m
,
*
d
;
...
...
@@ -3939,6 +3957,14 @@ void initcv()
PUBLISH
(
CV_PTLOC_VERTEX
);
PUBLISH
(
CV_PTLOC_OUTSIDE_RECT
);
PUBLISH
(
GC_BGD
);
PUBLISH
(
GC_FGD
);
PUBLISH
(
GC_PR_BGD
);
PUBLISH
(
GC_PR_FGD
);
PUBLISH
(
GC_INIT_WITH_RECT
);
PUBLISH
(
GC_INIT_WITH_MASK
);
PUBLISH
(
GC_EVAL
);
#include "generated2.i"
#if 0
...
...
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