Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ImageINSA_Tanguy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
Tanguy.Raufflet
ImageINSA_Tanguy
Commits
c88bf903
Commit
c88bf903
authored
12 years ago
by
Sacha Percot-Tétu
Browse files
Options
Downloads
Patches
Plain Diff
Added conversion notification to Thresholding
parent
510c231d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/Operations/Thresholding.cpp
+14
-6
14 additions, 6 deletions
app/Operations/Thresholding.cpp
app/Operations/Thresholding.h
+1
-1
1 addition, 1 deletion
app/Operations/Thresholding.h
with
15 additions
and
7 deletions
app/Operations/Thresholding.cpp
+
14
−
6
View file @
c88bf903
...
...
@@ -68,12 +68,16 @@ void ThresholdDialog::otsu() {
_spinbox1
->
setValue
(
threshold
);
}
ThresholdDialog
::
ThresholdDialog
(
const
GrayscaleImage
*
image
)
:
_image
(
image
){
ThresholdDialog
::
ThresholdDialog
(
const
GrayscaleImage
*
image
,
bool
converted
)
:
_image
(
image
){
this
->
setWindowTitle
(
tr
(
"Thresholding"
));
this
->
setMinimumWidth
(
160
);
QVBoxLayout
*
layout
=
new
QVBoxLayout
();
this
->
setLayout
(
layout
);
if
(
converted
)
{
layout
->
addWidget
(
new
QLabel
(
"<font color=red><i>Information : The input image has been converted to grayscale.</i></font>"
));
}
QGroupBox
*
threshGroup
=
new
QGroupBox
(
"Threshold"
,
this
);
QHBoxLayout
*
threshLayout
=
new
QHBoxLayout
(
threshGroup
);
_doubleBox
=
new
QCheckBox
(
"Double threshold"
);
...
...
@@ -122,13 +126,13 @@ ThresholdDialog::ThresholdDialog(const GrayscaleImage* image) : _image(image){
_marker1
=
new
QwtPlotMarker
();
_marker1
->
setLineStyle
(
QwtPlotMarker
::
VLine
);
_marker1
->
setLinePen
(
QPen
(
Qt
::
black
));
_marker1
->
setXValue
(
64
);
_marker1
->
setXValue
(
127
);
_marker1
->
attach
(
plot
);
_marker2
=
new
QwtPlotMarker
();
_marker2
->
setLineStyle
(
QwtPlotMarker
::
VLine
);
_marker2
->
setLinePen
(
QPen
(
Qt
::
black
));
_marker2
->
setXValue
(
192
);
_marker2
->
setXValue
(
255
);
_marker2
->
attach
(
plot
);
_marker2
->
hide
();
...
...
@@ -160,9 +164,13 @@ ThresholdDialog::ThresholdDialog(const GrayscaleImage* image) : _image(image){
std
::
vector
<
QWidget
*>
Thresholding
::
operator
()(
const
imagein
::
Image
*
image
,
const
std
::
map
<
std
::
string
,
const
imagein
::
Image
*>&
)
{
vector
<
QWidget
*>
result
;
GrayscaleImage
*
img
=
Converter
<
GrayscaleImage
>::
convert
(
*
image
);
ThresholdDialog
*
dialog
=
new
ThresholdDialog
(
img
);
const
GrayscaleImage
*
img
=
dynamic_cast
<
const
GrayscaleImage
*>
(
image
);
bool
convert
=
(
img
==
NULL
);
if
(
convert
)
{
img
=
Converter
<
GrayscaleImage
>::
convert
(
*
image
);
}
ThresholdDialog
*
dialog
=
new
ThresholdDialog
(
img
,
convert
);
QDialog
::
DialogCode
code
=
static_cast
<
QDialog
::
DialogCode
>
(
dialog
->
exec
());
...
...
This diff is collapsed.
Click to expand it.
app/Operations/Thresholding.h
+
1
−
1
View file @
c88bf903
...
...
@@ -55,7 +55,7 @@ class ThresholdDialog : public QDialog {
Q_OBJECT
public:
ThresholdDialog
(
const
imagein
::
GrayscaleImage
*
);
ThresholdDialog
(
const
imagein
::
GrayscaleImage
*
,
bool
converted
);
inline
int
threshold1
()
{
return
_spinbox1
->
value
();
}
inline
int
threshold2
()
{
return
_spinbox2
->
value
();
}
inline
bool
blackBand
()
{
return
_blackButton
->
isChecked
();
}
...
...
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