Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
GEPARD
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
GEPARD
GEPARD
Commits
0e2b4d8a
Commit
0e2b4d8a
authored
Oct 12, 2018
by
Josef Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace dataset.py
parent
910bc09a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
+25
-5
dataset.py
dataset.py
+25
-5
No files found.
dataset.py
View file @
0e2b4d8a
...
...
@@ -74,6 +74,18 @@ class DataSet(object):
self
.
pshift
=
None
# shift of raman scan position relative to image center
self
.
seedpoints
=
np
.
array
([])
self
.
seeddeletepoints
=
np
.
array
([])
self
.
detectParams
=
{
'points'
:
np
.
array
([[
50
,
0
],[
100
,
200
],[
200
,
255
]]),
'contrastcurve'
:
True
,
'blurRadius'
:
9
,
'threshold'
:
0.2
,
'maxholebrightness'
:
0.5
,
'erodeconvexdefects'
:
0
,
'minparticlearea'
:
20
,
'minparticledistance'
:
20
,
'measurefrac'
:
1
,
'compactness'
:
0.1
,
'seedRad'
:
3
}
self
.
ramanpoints
=
[]
self
.
particlecontours
=
[]
self
.
particlestats
=
[]
...
...
@@ -104,8 +116,8 @@ class DataSet(object):
from
opticalscan
import
loadAndPasteImage
# try to load png and check for detection contours
recreatefullimage
=
recreatefullimage
or
not
os
.
path
.
exists
(
self
.
getLegacyImageName
())
if
not
recreatefullimage
:
buggyimage
=
recreatefullimage
if
not
buggyimage
and
os
.
path
.
exists
(
self
.
getLegacyImageName
())
:
img
=
cv2imread_fix
(
self
.
getLegacyImageName
())
Nc
=
len
(
self
.
particlecontours
)
if
Nc
>
0
:
...
...
@@ -113,12 +125,12 @@ class DataSet(object):
contpixels
=
img
[
contour
[:,
0
,
1
],
contour
[:,
0
,
0
]]
if
np
.
all
(
contpixels
[:,
1
]
==
255
)
and
np
.
all
(
contpixels
[:,
2
]
==
0
)
\
and
np
.
all
(
contpixels
[:,
0
]
==
0
):
recreatefull
image
=
True
if
not
recreatefull
image
:
buggy
image
=
True
if
not
buggy
image
:
cv2imwrite_fix
(
self
.
getImageName
(),
img
)
del
img
if
recreatefull
image
:
if
buggy
image
:
print
(
"recreating fullimage from grid data"
)
imgdata
=
None
zvalimg
=
None
...
...
@@ -248,4 +260,12 @@ class DataSet(object):
def
save
(
self
):
saveData
(
self
,
self
.
fname
)
if
__name__
==
'__main__'
:
dset
=
loadData
(
r
'C:\Users\brandt\Desktop\20180723DemoTZW\20180723DemoTZW.pkl'
)
print
(
dset
.
detectParams
)
# dset.seedpoints = np.array([])
# dset.seeddeletepoints = np.array([])
# dset.save()
\ No newline at end of file
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