Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
2019 FBSD
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Kerautret Bertrand
2019 FBSD
Commits
6d24a975
Commit
6d24a975
authored
5 years ago
by
even
Browse files
Options
Downloads
Patches
Plain Diff
Add detected multisegments output
parent
f668c486
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/FBSD/BSTools/bsdetectionwidget.cpp
+55
-40
55 additions, 40 deletions
Code/FBSD/BSTools/bsdetectionwidget.cpp
with
55 additions
and
40 deletions
Code/FBSD/BSTools/bsdetectionwidget.cpp
+
55
−
40
View file @
6d24a975
...
...
@@ -35,7 +35,8 @@ BSDetectionWidget::BSDetectionWidget (QWidget *parent)
strucview
=
NULL
;
profileview
=
NULL
;
idetview
=
NULL
;
// cannyview = NULL;
cannyview
=
NULL
;
yorkview
=
NULL
;
// Sets initial user outputs parameters
verbose
=
false
;
...
...
@@ -70,7 +71,8 @@ BSDetectionWidget::~BSDetectionWidget ()
if
(
strucview
!=
NULL
)
delete
strucview
;
if
(
profileview
!=
NULL
)
delete
profileview
;
if
(
idetview
!=
NULL
)
delete
idetview
;
// if (cannyview != NULL) delete cannyview;
if
(
cannyview
!=
NULL
)
delete
cannyview
;
if
(
yorkview
!=
NULL
)
delete
yorkview
;
}
...
...
@@ -838,35 +840,15 @@ void BSDetectionWidget::keyPressEvent (QKeyEvent *event)
break
;
case
Qt
::
Key_Percent
:
/*
cout << "CannyLine compares BS" << endl;
detector.detectAll ();
if
(
cannyview
==
NULL
)
{
cannyview
=
new
BSCannyView
(
&
loadedImage
,
&
detector
);
}
cannyview->testBS ();
cannyview
->
show
();
cannyview->update ();
displayDetectionResult ();
cout << "CannyLine compares BS" << endl;
*/
break
;
case
Qt
::
Key_Ugrave
:
/*
cout << "CannyLine compares DSS" << endl;
detector.detectAll ();
if (cannyview == NULL)
{
cannyview = new BSCannyView (&loadedImage, &detector);
}
cannyview->testDSS ();
cannyview->show ();
cannyview->update ();
displayDetectionResult ();
cout << "CannyLine compares DSS" << endl;
*/
case
Qt
::
Key_Semicolon
:
if
(
yorkview
==
NULL
)
yorkview
=
new
BSYorkView
(
&
loadedImage
,
&
detector
);
yorkview
->
show
();
break
;
case
Qt
::
Key_Plus
:
...
...
@@ -990,6 +972,14 @@ void BSDetectionWidget::keyPressEvent (QKeyEvent *event)
{
if
(
idetview
->
processKeyEvent
(
event
))
extract
();
}
else
if
(
yorkview
!=
NULL
&&
yorkview
->
isActiveWindow
())
{
if
(
yorkview
->
processKeyEvent
(
event
))
extract
();
}
else
if
(
cannyview
!=
NULL
&&
cannyview
->
isActiveWindow
())
{
if
(
cannyview
->
processKeyEvent
(
event
))
extract
();
}
}
...
...
@@ -1145,21 +1135,46 @@ void BSDetectionWidget::writeTest ()
void
BSDetectionWidget
::
writeDetectionResult
()
{
BlurredSegment
*
b
s
=
detector
.
getBlurredSegment
();
if
(
bs
!=
NULL
)
vector
<
BlurredSegment
*
>
bs
s
=
detector
.
getBlurredSegment
s
();
if
(
bs
s
.
empty
()
)
{
ofstream
outf
(
"seg.txt"
,
ios
::
out
);
outf
<<
"("
<<
bs
->
antipodalEdgeStart
().
x
()
<<
", "
<<
bs
->
antipodalEdgeStart
().
y
()
<<
") ("
<<
bs
->
antipodalEdgeEnd
().
x
()
<<
", "
<<
bs
->
antipodalEdgeEnd
().
y
()
<<
") ("
<<
bs
->
antipodalVertex
().
x
()
<<
", "
<<
bs
->
antipodalVertex
().
y
()
<<
") ("
<<
bs
->
getLastLeft
().
x
()
<<
", "
<<
bs
->
getLastLeft
().
y
()
<<
") ("
<<
bs
->
getLastRight
().
x
()
<<
", "
<<
bs
->
getLastRight
().
y
()
<<
")"
<<
endl
;
BlurredSegment
*
bs
=
detector
.
getBlurredSegment
();
if
(
bs
!=
NULL
)
{
ofstream
outf
(
"seg.txt"
,
ios
::
out
);
outf
<<
"("
<<
bs
->
antipodalEdgeStart
().
x
()
<<
", "
<<
bs
->
antipodalEdgeStart
().
y
()
<<
") ("
<<
bs
->
antipodalEdgeEnd
().
x
()
<<
", "
<<
bs
->
antipodalEdgeEnd
().
y
()
<<
") ("
<<
bs
->
antipodalVertex
().
x
()
<<
", "
<<
bs
->
antipodalVertex
().
y
()
<<
") ("
<<
bs
->
getLastLeft
().
x
()
<<
", "
<<
bs
->
getLastLeft
().
y
()
<<
") ("
<<
bs
->
getLastRight
().
x
()
<<
", "
<<
bs
->
getLastRight
().
y
()
<<
")"
<<
endl
;
outf
.
close
();
}
}
else
{
ofstream
outf
(
"segs.txt"
,
ios
::
out
);
vector
<
BlurredSegment
*>::
iterator
it
=
bss
.
begin
();
while
(
it
!=
bss
.
end
())
{
outf
<<
"("
<<
(
*
it
)
->
antipodalEdgeStart
().
x
()
<<
", "
<<
(
*
it
)
->
antipodalEdgeStart
().
y
()
<<
") ("
<<
(
*
it
)
->
antipodalEdgeEnd
().
x
()
<<
", "
<<
(
*
it
)
->
antipodalEdgeEnd
().
y
()
<<
") ("
<<
(
*
it
)
->
antipodalVertex
().
x
()
<<
", "
<<
(
*
it
)
->
antipodalVertex
().
y
()
<<
") ("
<<
(
*
it
)
->
getLastLeft
().
x
()
<<
", "
<<
(
*
it
)
->
getLastLeft
().
y
()
<<
") ("
<<
(
*
it
)
->
getLastRight
().
x
()
<<
", "
<<
(
*
it
)
->
getLastRight
().
y
()
<<
")"
<<
endl
;
it
++
;
}
outf
.
close
();
}
}
...
...
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