PaIRS-UniNa 0.2.4__cp312-cp312-macosx_10_9_universal2.whl → 0.2.5__cp312-cp312-macosx_10_9_universal2.whl
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.
Potentially problematic release.
This version of PaIRS-UniNa might be problematic. Click here for more details.
- PaIRS_UniNa/Changes.txt +23 -0
- PaIRS_UniNa/Custom_Top.py +1 -1
- PaIRS_UniNa/Explorer.py +3059 -3049
- PaIRS_UniNa/FolderLoop.py +371 -371
- PaIRS_UniNa/Input_Tab.py +714 -709
- PaIRS_UniNa/Input_Tab_tools.py +3017 -3009
- PaIRS_UniNa/Output_Tab.py +2 -2
- PaIRS_UniNa/PaIRS.py +17 -17
- PaIRS_UniNa/PaIRS_PIV.py +56 -1
- PaIRS_UniNa/PaIRS_pypacks.py +143 -6
- PaIRS_UniNa/Process_Tab.py +6 -11
- PaIRS_UniNa/Process_Tab_Disp.py +8 -3
- PaIRS_UniNa/Saving_tools.py +277 -277
- PaIRS_UniNa/TabTools.py +56 -17
- PaIRS_UniNa/Vis_Tab.py +237 -78
- PaIRS_UniNa/Whatsnew.py +2 -0
- PaIRS_UniNa/_PaIRS_PIV.so +0 -0
- PaIRS_UniNa/__init__.py +2 -2
- PaIRS_UniNa/gPaIRS.py +3745 -3600
- PaIRS_UniNa/icons/pylog.png +0 -0
- PaIRS_UniNa/icons/python_warning.png +0 -0
- PaIRS_UniNa/icons/queue.png +0 -0
- PaIRS_UniNa/icons/uninitialized.png +0 -0
- PaIRS_UniNa/icons/window.png +0 -0
- PaIRS_UniNa/listLib.py +301 -301
- PaIRS_UniNa/parForMulti.py +433 -433
- PaIRS_UniNa/parForWorkers.py +46 -1
- PaIRS_UniNa/procTools.py +17 -7
- PaIRS_UniNa/rqrdpckgs.txt +8 -0
- PaIRS_UniNa/stereo.py +683 -683
- PaIRS_UniNa/tabSplitter.py +606 -606
- PaIRS_UniNa/ui_Calibration_Tab.py +542 -542
- PaIRS_UniNa/ui_Custom_Top.py +294 -294
- PaIRS_UniNa/ui_Input_Tab.py +1098 -1098
- PaIRS_UniNa/ui_Input_Tab_CalVi.py +1280 -1280
- PaIRS_UniNa/ui_Log_Tab.py +261 -261
- PaIRS_UniNa/ui_Output_Tab.py +2360 -2360
- PaIRS_UniNa/ui_Process_Tab.py +3808 -3808
- PaIRS_UniNa/ui_Process_Tab_CalVi.py +1547 -1547
- PaIRS_UniNa/ui_Process_Tab_Disp.py +1139 -968
- PaIRS_UniNa/ui_Process_Tab_Min.py +435 -435
- PaIRS_UniNa/ui_ResizePopup.py +203 -203
- PaIRS_UniNa/ui_Vis_Tab.py +1626 -1533
- PaIRS_UniNa/ui_Vis_Tab_CalVi.py +1249 -1249
- PaIRS_UniNa/ui_Whatsnew.py +131 -131
- PaIRS_UniNa/ui_gPairs.py +867 -849
- PaIRS_UniNa/ui_infoPaIRS.py +550 -428
- PaIRS_UniNa/whatsnew.txt +5 -4
- {PaIRS_UniNa-0.2.4.dist-info → pairs_unina-0.2.5.dist-info}/METADATA +38 -26
- {PaIRS_UniNa-0.2.4.dist-info → pairs_unina-0.2.5.dist-info}/RECORD +52 -52
- {PaIRS_UniNa-0.2.4.dist-info → pairs_unina-0.2.5.dist-info}/WHEEL +1 -1
- PaIRS_UniNa/icons/order.png +0 -0
- PaIRS_UniNa/icons/order_reverse.png +0 -0
- PaIRS_UniNa/icons/pencil_bw.png +0 -0
- PaIRS_UniNa/icons/run_piv.png +0 -0
- PaIRS_UniNa-0.2.4.dist-info/LICENSE +0 -19
- {PaIRS_UniNa-0.2.4.dist-info → pairs_unina-0.2.5.dist-info}/top_level.txt +0 -0
PaIRS_UniNa/parForWorkers.py
CHANGED
|
@@ -388,6 +388,7 @@ class StereoDisparity_ParFor_Worker(ParForWorker):
|
|
|
388
388
|
if self.isKilled: return self.stopDisparity(it,flagOut,flagOutIter)
|
|
389
389
|
try:
|
|
390
390
|
self.disp.initAllocDisp()
|
|
391
|
+
self.disp.dispAvCo.NImg=2*len(imList[0][0]) if spivIn.FlagImgTau==0 else len(imList[0][0])
|
|
391
392
|
except Exception as inst: #ValueError as exc:
|
|
392
393
|
FlagInitError=True
|
|
393
394
|
stringaErr=f'\n!!!!!!!!!! Error during disparity process initialization:\n{inst}\n'
|
|
@@ -473,7 +474,7 @@ class StereoDisparity_ParFor_Worker(ParForWorker):
|
|
|
473
474
|
pri.Error.red(stringaErr)
|
|
474
475
|
else:
|
|
475
476
|
flagOut|=FLAG_PROC[kConst]# per completezza aggiungo anche processato
|
|
476
|
-
stampa+=f" Laser plane eq. :
|
|
477
|
+
stampa+=f" Laser plane eq. : z (mm) = {ve.PianoLaser[0]:.4g} + {ve.PianoLaser[1]:.4g} * x + {ve.PianoLaser[2]:.4g} * y\n Residual calib. err. ort. = {dAC.dOrtMean:.4g} pixels\n Residual calib. err. par. = {dAC.dParMean:.4g} pixels\n Estimated laser thick. = {dAC.DeltaZ:.4g} pixels (approx. {dAC.DeltaZ * dP.RisxRadd / abs(dAC.ta0Mean - dAC.ta1Mean):.4g} mm)\n Outliers % = {dAC.percOutlier*100:g} \n"
|
|
477
478
|
data.OUT_dict['zconst']=float(ve.PianoLaser[0])
|
|
478
479
|
data.OUT_dict['xterm']=float(ve.PianoLaser[1])
|
|
479
480
|
data.OUT_dict['yterm']=float(ve.PianoLaser[2])
|
|
@@ -484,6 +485,10 @@ class StereoDisparity_ParFor_Worker(ParForWorker):
|
|
|
484
485
|
# saveResults(data,-1,Var,nameVar)
|
|
485
486
|
#else:
|
|
486
487
|
saveResults(data,f'it{it+1}',Var,nameVar)
|
|
488
|
+
CC_rot=self.create_CC_image(self.disp.vect.CCrot)
|
|
489
|
+
nameFileOut=data.resF(f'it{it+1}',string='dispMap')
|
|
490
|
+
self.save_CC_image(CC_rot,nameFileOut)
|
|
491
|
+
pass
|
|
487
492
|
except Exception as inst:
|
|
488
493
|
errorPrint=f"\n!!!!!!!!!! Error while saving the results:\n{str(inst)}\n"
|
|
489
494
|
stampa+=errorPrint
|
|
@@ -546,3 +551,43 @@ class StereoDisparity_ParFor_Worker(ParForWorker):
|
|
|
546
551
|
self.signals.progress.emit(procID,ind,flagOutIter,[],'')
|
|
547
552
|
self.signals.finished.emit(data,'')
|
|
548
553
|
|
|
554
|
+
|
|
555
|
+
def create_CC_image(self,CC):
|
|
556
|
+
# Get the dimensions of the input matrix
|
|
557
|
+
n, m, h, w = CC.shape
|
|
558
|
+
|
|
559
|
+
# Normalize the matrix values to the range [0, 65535]
|
|
560
|
+
CC_min = CC.min()
|
|
561
|
+
CC_max = CC.max()
|
|
562
|
+
CC_mean = 0.5*(CC_min+CC_max)
|
|
563
|
+
CC_mean_normalized = (CC_mean + 1.0)/2.0 * 65535
|
|
564
|
+
|
|
565
|
+
CC_normalized = (CC + 1.0)/2.0 * 65535
|
|
566
|
+
CC_normalized = CC_normalized.astype(np.uint16) # Convert to 16-bit integers
|
|
567
|
+
|
|
568
|
+
# Initialize the final image grid with the correct size
|
|
569
|
+
h=2*self.disp.dispAvCo.N_NormEpi+1
|
|
570
|
+
grid_height = h * n
|
|
571
|
+
grid_width = w * m
|
|
572
|
+
CC_rot = np.zeros((grid_height, grid_width), dtype=np.uint16)
|
|
573
|
+
|
|
574
|
+
# Populate the grid with submatrices
|
|
575
|
+
try:
|
|
576
|
+
for i in range(n):
|
|
577
|
+
for j in range(m):
|
|
578
|
+
# Copy the submatrix (w x h) into the appropriate position in the grid
|
|
579
|
+
CC_rot[i*h:(i+1)*h, j*w:(j+1)*w] = CC_normalized[i, j, :h, :]
|
|
580
|
+
CC_rot[i*h, j*w:(j+1)*w] = CC_mean_normalized
|
|
581
|
+
CC_rot[i*h:(i+1)*h, j*w] = CC_mean_normalized
|
|
582
|
+
CC_rot[(i+1)*h-1, j*w:(j+1)*w] = CC_mean_normalized
|
|
583
|
+
CC_rot[i*h:(i+1)*h, (j+1)*w-1] = CC_mean_normalized
|
|
584
|
+
except:
|
|
585
|
+
pri.Error.red(f'Error while generating disparity map image:\n{traceback.format_exc()}\n\n')
|
|
586
|
+
pass
|
|
587
|
+
|
|
588
|
+
return CC_rot
|
|
589
|
+
|
|
590
|
+
def save_CC_image(self,CC,file_path):
|
|
591
|
+
image = Image.fromarray(CC)
|
|
592
|
+
image.save(file_path)
|
|
593
|
+
return
|
PaIRS_UniNa/procTools.py
CHANGED
|
@@ -168,14 +168,20 @@ class dataTreePar(TABpar):
|
|
|
168
168
|
self.assignDataName()
|
|
169
169
|
return
|
|
170
170
|
|
|
171
|
-
def resF(self,i):
|
|
171
|
+
def resF(self,i,string=''):
|
|
172
172
|
if self.ndig<-1: return ''
|
|
173
|
-
if
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
if string=='dispMap':
|
|
174
|
+
fold=os.path.dirname(self.outPathRoot)
|
|
175
|
+
rad=os.path.splitext(os.path.basename(self.outPathRoot))[0]
|
|
176
|
+
if rad[-1]!='_': rad+='_'
|
|
177
|
+
return myStandardRoot(os.path.join(fold, f'dispMap_rot_{rad}{i}.png'))
|
|
177
178
|
else:
|
|
178
|
-
|
|
179
|
+
if type(i)==str:
|
|
180
|
+
return f"{self.outPathRoot}_{i}{self.outExt}"
|
|
181
|
+
elif type(i)==int:
|
|
182
|
+
return f"{self.outPathRoot}_{i:0{self.ndig:d}d}{self.outExt}"
|
|
183
|
+
else:
|
|
184
|
+
return ''
|
|
179
185
|
|
|
180
186
|
def setProc(self,INP:INPpar=INPpar(),OUT:OUTpar=OUTpar(),PRO:PROpar=PROpar(),PRO_Min:PROpar_Min=PROpar_Min(),PRO_Disp:PROpar_Disp=PROpar_Disp()):
|
|
181
187
|
if INP is None: return
|
|
@@ -361,7 +367,7 @@ class dataTreePar(TABpar):
|
|
|
361
367
|
continue
|
|
362
368
|
if self.Step==StepTypes.min: #minimum
|
|
363
369
|
cont+=2
|
|
364
|
-
flag=(p&FLAG_FINALIZED[0]) and (p&FLAG_FINALIZED[1])
|
|
370
|
+
#flag=(p&FLAG_FINALIZED[0]) and (p&FLAG_FINALIZED[1])
|
|
365
371
|
if (p&FLAG_FINALIZED[0]):
|
|
366
372
|
if (p&FLAG_FINALIZED[1]):
|
|
367
373
|
LogProc+=(self.list_print[i])
|
|
@@ -375,6 +381,7 @@ class dataTreePar(TABpar):
|
|
|
375
381
|
else:# la b nonè stata proprio letta
|
|
376
382
|
cont-=1
|
|
377
383
|
#pri.Process.magenta(f'LogProc wrong {i} {p} {splitAs.join(sAppo[1:-1])} {hex(p)} ')
|
|
384
|
+
LogProc+='\n'
|
|
378
385
|
else:
|
|
379
386
|
sAppo=self.list_print[i].split('\n')
|
|
380
387
|
if (p&FLAG_FINALIZED[1]):
|
|
@@ -1289,6 +1296,9 @@ def data2Disp(data:dataTreePar):
|
|
|
1289
1296
|
dAC.N_NormEpi=PRO_Disp.SemiWidth_Epipolar # Semiwidth in the direction normal to the epipolar line
|
|
1290
1297
|
dAC.RaggioFiltro=PRO_Disp.Filter_SemiWidth # Semiwidth of the filter for the detection of the maximum in the displacement map
|
|
1291
1298
|
dAC.SogliaCor = PRO_Disp.Threshold # Threshold for the determination of point used in the baricentric search of the maximum in the disp map
|
|
1299
|
+
dAC.nIterMaxValid = PRO_Disp.Nit_OutDet
|
|
1300
|
+
dAC.numStd = PRO_Disp.Std_Threshold
|
|
1301
|
+
|
|
1292
1302
|
#%% Volume ********************************
|
|
1293
1303
|
dP.xinfZC = OUT.x_min # Coordinata x inferiore
|
|
1294
1304
|
dP.yinfZC = OUT.y_min # Coordinata y inferiore
|