pingmapper 5.0.15__tar.gz → 5.0.17__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pingmapper-5.0.15 → pingmapper-5.0.17}/PKG-INFO +1 -1
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper/class_sonObj.py +0 -98
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper/main_mapSubstrate.py +0 -2
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper/main_readFiles.py +8 -87
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper/main_rectify.py +0 -2
- pingmapper-5.0.17/pingmapper/version.py +1 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper.egg-info/PKG-INFO +1 -1
- pingmapper-5.0.15/pingmapper/version.py +0 -1
- {pingmapper-5.0.15 → pingmapper-5.0.17}/LICENSE +0 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/README.md +0 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper/__init__.py +0 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper/__main__.py +0 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper/class_mapSubstrateObj.py +0 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper/class_portstarObj.py +0 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper/class_rectObj.py +0 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper/class_sonObj_nadirgaptest.py +0 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper/default_params.json +0 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper/funcs_common.py +0 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper/funcs_model.py +0 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper/funcs_rectify.py +0 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper/gui_main.py +0 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper/test_PINGMapper.py +0 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper/test_time.py +0 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper.egg-info/SOURCES.txt +0 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper.egg-info/dependency_links.txt +0 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper.egg-info/requires.txt +0 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/pingmapper.egg-info/top_level.txt +0 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/setup.cfg +0 -0
- {pingmapper-5.0.15 → pingmapper-5.0.17}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pingmapper
|
|
3
|
-
Version: 5.0.
|
|
3
|
+
Version: 5.0.17
|
|
4
4
|
Summary: Open-source interface for processing recreation-grade side scan sonar datasets and reproducibly mapping benthic habitat
|
|
5
5
|
Author: Cameron Bodine, Daniel Buscombe
|
|
6
6
|
Author-email: bodine.cs@gmail.email
|
|
@@ -1453,104 +1453,6 @@ class sonObj(object):
|
|
|
1453
1453
|
|
|
1454
1454
|
return
|
|
1455
1455
|
|
|
1456
|
-
# ======================================================================
|
|
1457
|
-
def _exportMovWin(self,
|
|
1458
|
-
i : int,
|
|
1459
|
-
stride : int,
|
|
1460
|
-
tileType: list,
|
|
1461
|
-
pingMax: int,
|
|
1462
|
-
depMax: int):
|
|
1463
|
-
|
|
1464
|
-
'''
|
|
1465
|
-
'''
|
|
1466
|
-
|
|
1467
|
-
# Set chunk index
|
|
1468
|
-
a_idx = i-1
|
|
1469
|
-
b_idx = i
|
|
1470
|
-
|
|
1471
|
-
# Iterate each tile type
|
|
1472
|
-
for t in tileType:
|
|
1473
|
-
if t == 'wco':
|
|
1474
|
-
cropMax = depMax
|
|
1475
|
-
else:
|
|
1476
|
-
cropMax = pingMax
|
|
1477
|
-
inDir = os.path.join(self.outDir, t)
|
|
1478
|
-
outDir = os.path.join(self.outDir, t+'_mw')
|
|
1479
|
-
|
|
1480
|
-
if not os.path.exists(outDir):
|
|
1481
|
-
try:
|
|
1482
|
-
os.mkdir(outDir)
|
|
1483
|
-
except:
|
|
1484
|
-
pass
|
|
1485
|
-
|
|
1486
|
-
# Find the images
|
|
1487
|
-
images = os.listdir(inDir)
|
|
1488
|
-
images.sort()
|
|
1489
|
-
|
|
1490
|
-
# Get each image
|
|
1491
|
-
a_img = images[a_idx]
|
|
1492
|
-
b_img = images[b_idx]
|
|
1493
|
-
|
|
1494
|
-
# Get image name
|
|
1495
|
-
img_name = a_img.split('.')[0]
|
|
1496
|
-
|
|
1497
|
-
# Open each image
|
|
1498
|
-
a_img = imread(os.path.join(inDir, a_img))
|
|
1499
|
-
b_img = imread(os.path.join(inDir, b_img))
|
|
1500
|
-
|
|
1501
|
-
def resize_to_pingMax(img, cropMax):
|
|
1502
|
-
ndims = img.ndim
|
|
1503
|
-
current_size = img.shape[0]
|
|
1504
|
-
if current_size < cropMax:
|
|
1505
|
-
# Pad with zeros
|
|
1506
|
-
if ndims == 2:
|
|
1507
|
-
padding = ((0, cropMax - current_size), (0, 0))
|
|
1508
|
-
else:
|
|
1509
|
-
padding = ((0, cropMax - current_size), (0, 0), (0,0))
|
|
1510
|
-
resized_img = np.pad(img, padding, mode='constant', constant_values=0)
|
|
1511
|
-
elif current_size > cropMax:
|
|
1512
|
-
# Truncate the array
|
|
1513
|
-
resized_img = img[:cropMax, :]
|
|
1514
|
-
else:
|
|
1515
|
-
# No change needed
|
|
1516
|
-
resized_img = img
|
|
1517
|
-
return resized_img
|
|
1518
|
-
|
|
1519
|
-
# Resize a_img and b_img
|
|
1520
|
-
a_img = resize_to_pingMax(a_img, cropMax)
|
|
1521
|
-
b_img = resize_to_pingMax(b_img, cropMax)
|
|
1522
|
-
|
|
1523
|
-
# Set stride based on first image
|
|
1524
|
-
# stride = int(round(a_img.shape[1] * stride, 0))
|
|
1525
|
-
if stride == 0:
|
|
1526
|
-
to_stride = 1
|
|
1527
|
-
else:
|
|
1528
|
-
to_stride = int(round(self.nchunk * stride, 0))
|
|
1529
|
-
|
|
1530
|
-
# Set window size based on first image
|
|
1531
|
-
# winSize = a_img.shape[1]
|
|
1532
|
-
winSize = self.nchunk
|
|
1533
|
-
|
|
1534
|
-
# Concatenate images
|
|
1535
|
-
movWin = np.concatenate((a_img, b_img), axis=1)
|
|
1536
|
-
|
|
1537
|
-
# Last window idx
|
|
1538
|
-
lastWinIDX = self.nchunk
|
|
1539
|
-
|
|
1540
|
-
win = 0
|
|
1541
|
-
# Iterate each window
|
|
1542
|
-
while win < lastWinIDX:
|
|
1543
|
-
window = movWin[:, win:win+winSize]
|
|
1544
|
-
|
|
1545
|
-
zero = self._addZero(win)
|
|
1546
|
-
|
|
1547
|
-
# Save window
|
|
1548
|
-
imsave(os.path.join(outDir, img_name+'_'+zero+str(win)+'.jpg'), window)
|
|
1549
|
-
|
|
1550
|
-
win += to_stride
|
|
1551
|
-
|
|
1552
|
-
return
|
|
1553
|
-
|
|
1554
1456
|
|
|
1555
1457
|
|
|
1556
1458
|
############################################################################
|
|
@@ -116,8 +116,6 @@ def read_master_func(logfilename='',
|
|
|
116
116
|
mask_wc=False,
|
|
117
117
|
spdCor=False,
|
|
118
118
|
maxCrop=False,
|
|
119
|
-
moving_window=False,
|
|
120
|
-
window_stride=0.1,
|
|
121
119
|
USE_GPU=False,
|
|
122
120
|
remShadow=0,
|
|
123
121
|
detectDep=0,
|
|
@@ -551,14 +549,14 @@ def read_master_func(logfilename='',
|
|
|
551
549
|
del son
|
|
552
550
|
|
|
553
551
|
|
|
554
|
-
# If Onix, need to store self._trans in object
|
|
555
|
-
if sonObjs[0].isOnix:
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
552
|
+
# # If Onix, need to store self._trans in object
|
|
553
|
+
# if sonObjs[0].isOnix:
|
|
554
|
+
# for son in sonObjs:
|
|
555
|
+
# son._loadSonMeta()
|
|
556
|
+
# utm_e=son.sonMetaDF.iloc[0]['utm_e']
|
|
557
|
+
# utm_n=son.sonMetaDF.iloc[0]['utm_n']
|
|
558
|
+
# son._getEPSG(utm_e, utm_n)
|
|
559
|
+
# del son
|
|
562
560
|
|
|
563
561
|
|
|
564
562
|
else:
|
|
@@ -1469,83 +1467,6 @@ def read_master_func(logfilename='',
|
|
|
1469
1467
|
# son._exportTilesSpd(i, tileFile=imgType, spdCor=spdCor, mask_shdw=mask_shdw, maxCrop=maxCrop)
|
|
1470
1468
|
# sys.exit()
|
|
1471
1469
|
|
|
1472
|
-
if moving_window and not spdCor:
|
|
1473
|
-
|
|
1474
|
-
# Crop all images to most common range
|
|
1475
|
-
son._loadSonMeta()
|
|
1476
|
-
sDF = son.sonMetaDF
|
|
1477
|
-
|
|
1478
|
-
rangeCnt = np.unique(sDF['ping_cnt'], return_counts=True)
|
|
1479
|
-
pingMaxi = np.argmax(rangeCnt[1])
|
|
1480
|
-
pingMax = int(rangeCnt[0][pingMaxi])
|
|
1481
|
-
|
|
1482
|
-
depCnt = np.unique(sDF['dep_m'], return_counts=True)
|
|
1483
|
-
depMaxi = np.argmax(depCnt[1])
|
|
1484
|
-
depMax = int(depCnt[0][depMaxi]/sDF['pixM'][0])
|
|
1485
|
-
depMax += 50
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
# Remove first chunk
|
|
1489
|
-
chunks.sort()
|
|
1490
|
-
chunks = chunks[1:]
|
|
1491
|
-
|
|
1492
|
-
# Get types of files exported
|
|
1493
|
-
tileType = []
|
|
1494
|
-
if son.wcp:
|
|
1495
|
-
tileType.append('wcp')
|
|
1496
|
-
if son.wcm:
|
|
1497
|
-
tileType.append('wcm')
|
|
1498
|
-
if son.wcr_src:
|
|
1499
|
-
tileType.append('src')
|
|
1500
|
-
if son.wco:
|
|
1501
|
-
tileType.append('wco')
|
|
1502
|
-
|
|
1503
|
-
Parallel(n_jobs= np.min([len(chunks), threadCnt]))(delayed(son._exportMovWin)(i, stride=window_stride, tileType=tileType, pingMax=pingMax, depMax=depMax) for i in tqdm(chunks))
|
|
1504
|
-
|
|
1505
|
-
# son._exportMovWin(chunks,
|
|
1506
|
-
# stride=window_stride,
|
|
1507
|
-
# tileType=tileType)
|
|
1508
|
-
|
|
1509
|
-
for t in tileType:
|
|
1510
|
-
shutil.rmtree(os.path.join(son.outDir, t))
|
|
1511
|
-
|
|
1512
|
-
# Create a movie
|
|
1513
|
-
if tileFile == '.mp4' and moving_window and not spdCor:
|
|
1514
|
-
for t in tileType:
|
|
1515
|
-
inDir = os.path.join(son.outDir, t+'_mw')
|
|
1516
|
-
|
|
1517
|
-
imgs = os.listdir(inDir)
|
|
1518
|
-
imgs.sort()
|
|
1519
|
-
|
|
1520
|
-
frame = cv2.imread(os.path.join(inDir, imgs[0]))
|
|
1521
|
-
height, width, layers = frame.shape
|
|
1522
|
-
|
|
1523
|
-
outName = '_'.join(imgs[0].split('_')[:-2])
|
|
1524
|
-
vidPath = os.path.join(inDir, outName+tileFile)
|
|
1525
|
-
|
|
1526
|
-
video = cv2.VideoWriter(vidPath, cv2.VideoWriter_fourcc(*'mp4v'), 3, (width, height))
|
|
1527
|
-
for image in imgs:
|
|
1528
|
-
frame = cv2.imread(os.path.join(inDir, image))
|
|
1529
|
-
|
|
1530
|
-
# Pad end
|
|
1531
|
-
if frame.shape[1] < nchunk:
|
|
1532
|
-
n_dims = frame.ndim
|
|
1533
|
-
if n_dims == 2:
|
|
1534
|
-
padding = ((0,0), (0, nchunk-frame.shape[1]))
|
|
1535
|
-
else:
|
|
1536
|
-
padding = ((0,0), (0, nchunk-frame.shape[1]), (0,0))
|
|
1537
|
-
frame = np.pad(frame, padding, mode='constant', constant_values=0)
|
|
1538
|
-
|
|
1539
|
-
video.write(frame)
|
|
1540
|
-
|
|
1541
|
-
video.release()
|
|
1542
|
-
|
|
1543
|
-
# Removs
|
|
1544
|
-
for image in imgs:
|
|
1545
|
-
os.remove(os.path.join(inDir, image))
|
|
1546
|
-
|
|
1547
|
-
# shutil.rmtree(os.path.join(son.outDir, t))
|
|
1548
|
-
|
|
1549
1470
|
son._pickleSon()
|
|
1550
1471
|
|
|
1551
1472
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '5.0.17'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pingmapper
|
|
3
|
-
Version: 5.0.
|
|
3
|
+
Version: 5.0.17
|
|
4
4
|
Summary: Open-source interface for processing recreation-grade side scan sonar datasets and reproducibly mapping benthic habitat
|
|
5
5
|
Author: Cameron Bodine, Daniel Buscombe
|
|
6
6
|
Author-email: bodine.cs@gmail.email
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '5.0.15'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|