Commit 0de904ee authored by sarthou's avatar sarthou
Browse files

Working on upsample, fixing the indexing problem, all clear but ZDisp, coding clamp is next step

parent a24b73a8
...@@ -104,6 +104,10 @@ void IDSDDownsampling::MatlabUpsampleShiftMatrix(){ ...@@ -104,6 +104,10 @@ void IDSDDownsampling::MatlabUpsampleShiftMatrix(){
PaddedMatrix<int> * GridY = new PaddedMatrix<int>(toDim); PaddedMatrix<int> * GridY = new PaddedMatrix<int>(toDim);
PaddedMatrix<int> * GridZ = new PaddedMatrix<int>(toDim); PaddedMatrix<int> * GridZ = new PaddedMatrix<int>(toDim);
PaddedMatrix<int> * CoordX = new PaddedMatrix<int>(toDim);
PaddedMatrix<int> * CoordY = new PaddedMatrix<int>(toDim);
PaddedMatrix<int> * CoordZ = new PaddedMatrix<int>(toDim);
// Creating Meshgrid // Creating Meshgrid
for(int i = 0; i < toDim->GetSizeX(); i++){ for(int i = 0; i < toDim->GetSizeX(); i++){
for(int j = 0; j < toDim->GetSizeY(); j++){ for(int j = 0; j < toDim->GetSizeY(); j++){
...@@ -117,12 +121,6 @@ void IDSDDownsampling::MatlabUpsampleShiftMatrix(){ ...@@ -117,12 +121,6 @@ void IDSDDownsampling::MatlabUpsampleShiftMatrix(){
} }
} }
} }
// std::cout << "GridX"<<std::endl;
// GridX->Mprint();
// std::cout << "GridY"<<std::endl;
// GridY->Mprint();
// std::cout << "GridZ"<<std::endl;
// GridZ->Mprint();
PaddedMatrixIt nextVolIt = PaddedMatrixIt(toDim); PaddedMatrixIt nextVolIt = PaddedMatrixIt(toDim);
do { do {
...@@ -130,6 +128,10 @@ void IDSDDownsampling::MatlabUpsampleShiftMatrix(){ ...@@ -130,6 +128,10 @@ void IDSDDownsampling::MatlabUpsampleShiftMatrix(){
fromXDispData[fromDim->DeterminePosition(GridX->GetData()[nextVolIt.GetPosition()],\ fromXDispData[fromDim->DeterminePosition(GridX->GetData()[nextVolIt.GetPosition()],\
GridY->GetData()[nextVolIt.GetPosition()],GridZ->GetData()[nextVolIt.GetPosition()])]; GridY->GetData()[nextVolIt.GetPosition()],GridZ->GetData()[nextVolIt.GetPosition()])];
// CoordX->GetData()[nextVolIt.GetPosition()] = GridX->GetData()[nextVolIt.GetPosition()];
// CoordY->GetData()[nextVolIt.GetPosition()] = GridY->GetData()[nextVolIt.GetPosition()];
// CoordZ->GetData()[nextVolIt.GetPosition()] = GridZ->GetData()[nextVolIt.GetPosition()];
toYDispData[nextVolIt.GetPosition()] = downsamplingRate * \ toYDispData[nextVolIt.GetPosition()] = downsamplingRate * \
fromYDispData[fromDim->DeterminePosition(GridX->GetData()[nextVolIt.GetPosition()],\ fromYDispData[fromDim->DeterminePosition(GridX->GetData()[nextVolIt.GetPosition()],\
GridY->GetData()[nextVolIt.GetPosition()],GridZ->GetData()[nextVolIt.GetPosition()])]; GridY->GetData()[nextVolIt.GetPosition()],GridZ->GetData()[nextVolIt.GetPosition()])];
...@@ -145,6 +147,13 @@ void IDSDDownsampling::MatlabUpsampleShiftMatrix(){ ...@@ -145,6 +147,13 @@ void IDSDDownsampling::MatlabUpsampleShiftMatrix(){
} while(nextVolIt.Next()); } while(nextVolIt.Next());
// for(int nbFrame=0;nbFrame < toDim->GetSizeZ();nbFrame++)
// {
// CoordX->GetFrame(nbFrame)->MprintToCSV("Data/upsample_ant/coord/Cpp_UA_CoordX_F"+std::to_string(nbFrame));
// CoordY->GetFrame(nbFrame)->MprintToCSV("Data/upsample_ant/coord/Cpp_UA_CoordY_F"+std::to_string(nbFrame));
// CoordZ->GetFrame(nbFrame)->MprintToCSV("Data/upsample_ant/coord/Cpp_UA_CoordZ_F"+std::to_string(nbFrame));
// }
} }
PaddedMatrixDim * const IDSDDownsampling::GetDim(){ PaddedMatrixDim * const IDSDDownsampling::GetDim(){
......
...@@ -52,7 +52,7 @@ int main(){ ...@@ -52,7 +52,7 @@ int main(){
openCVIO.LoadOcclusionMatrixFromImage(occFileName, occMatrix); openCVIO.LoadOcclusionMatrixFromImage(occFileName, occMatrix);
IDSConcrete baseIPS = IDSConcrete(dim, redMatrix, greenMatrix, blueMatrix, occMatrix); IDSConcrete baseIPS = IDSConcrete(dim, redMatrix, greenMatrix, blueMatrix, occMatrix);
// Work for testing upsampe algorithm // Work for testing upsampe algorithm
IDSDDownsampling downsampledDataSource = IDSDDownsampling(&baseIPS, 3, 2); IDSDDownsampling downsampledDataSource = IDSDDownsampling(&baseIPS, 3, 2);
...@@ -63,19 +63,19 @@ int main(){ ...@@ -63,19 +63,19 @@ int main(){
for(int nbFrame=0;nbFrame<downsampledDataSource.GetDim()->GetSizeZ();nbFrame++) for(int nbFrame=0;nbFrame<downsampledDataSource.GetDim()->GetSizeZ();nbFrame++)
{ {
openCVIO.LoadMatrixFromCSV("Data/upsample/matlab_upsample/M_upsampleBefore_DispX_L2_F"\ openCVIO.LoadMatrixFromCSV("Data/upsample_ant/UA_matlab/M_UA_Ante_DispX_F"\
+std::to_string(nbFrame)+".csv",frame_x,1); +std::to_string(nbFrame)+".csv",frame_x,1);
downsampledDataSource.GetDispX()->SetFrame(frame_x,nbFrame); downsampledDataSource.GetDispX()->SetFrame(frame_x,nbFrame);
openCVIO.LoadMatrixFromCSV("Data/upsample/matlab_upsample/M_upsampleBefore_DispY_L2_F"\ openCVIO.LoadMatrixFromCSV("Data/upsample_ant/UA_matlab/M_UA_Ante_DispY_F"\
+std::to_string(nbFrame)+".csv",frame_y,1); +std::to_string(nbFrame)+".csv",frame_y,1);
downsampledDataSource.GetDispY()->SetFrame(frame_y,nbFrame); downsampledDataSource.GetDispY()->SetFrame(frame_y,nbFrame);
openCVIO.LoadMatrixFromCSV("Data/upsample/matlab_upsample/M_upsampleBefore_DispZ_L2_F"\ openCVIO.LoadMatrixFromCSV("Data/upsample_ant/UA_matlab/M_UA_Ante_DispZ_F"\
+std::to_string(nbFrame)+".csv",frame_z,1); +std::to_string(nbFrame)+".csv",frame_z,1);
downsampledDataSource.GetDispZ()->SetFrame(frame_z,nbFrame); downsampledDataSource.GetDispZ()->SetFrame(frame_z,nbFrame);
openCVIO.LoadMatrixFromCSV("Data/upsample/matlab_upsample/M_upsampleBefore_DispA_L2_F"\ openCVIO.LoadMatrixFromCSV("Data/upsample_ant/UA_matlab/M_UA_Ante_DispA_F"\
+std::to_string(nbFrame)+".csv",frame_a,1); +std::to_string(nbFrame)+".csv",frame_a,1);
downsampledDataSource.GetDispA()->SetFrame(frame_a,nbFrame); downsampledDataSource.GetDispA()->SetFrame(frame_a,nbFrame);
} }
...@@ -89,10 +89,10 @@ int main(){ ...@@ -89,10 +89,10 @@ int main(){
for(int nbFrame=0;nbFrame < downsampledDataSource.GetDim()->GetSizeZ();nbFrame++) for(int nbFrame=0;nbFrame < downsampledDataSource.GetDim()->GetSizeZ();nbFrame++)
{ {
downsampledDataSource.GetDispX()->GetFrame(nbFrame)->MprintToCSV("Data/upsample/test_methodCpp/Out_DispX_L1_F"+std::to_string(nbFrame)); downsampledDataSource.GetDispX()->GetFrame(nbFrame)->MprintToCSV("Data/upsample_ant/Cpp_UA_DispX_F"+std::to_string(nbFrame));
downsampledDataSource.GetDispY()->GetFrame(nbFrame)->MprintToCSV("Data/upsample/test_methodCpp/Out_DispY_L1_F"+std::to_string(nbFrame)); downsampledDataSource.GetDispY()->GetFrame(nbFrame)->MprintToCSV("Data/upsample_ant/Cpp_UA_DispY_F"+std::to_string(nbFrame));
downsampledDataSource.GetDispZ()->GetFrame(nbFrame)->MprintToCSV("Data/upsample/test_methodCpp/Out_DispZ_L1_F"+std::to_string(nbFrame)); downsampledDataSource.GetDispZ()->GetFrame(nbFrame)->MprintToCSV("Data/upsample_ant/Cpp_UA_DispZ_F"+std::to_string(nbFrame));
downsampledDataSource.GetDispA()->GetFrame(nbFrame)->MprintToCSV("Data/upsample/test_methodCpp/Out_DispA_L1_F"+std::to_string(nbFrame)); downsampledDataSource.GetDispA()->GetFrame(nbFrame)->MprintToCSV("Data/upsample_ant/Cpp_UA_DispA_F"+std::to_string(nbFrame));
} }
std::cout << "End of upsample test"<< std::endl; std::cout << "End of upsample test"<< std::endl;
......
...@@ -44,6 +44,16 @@ function[dispFieldOut] = interpolate_disp_field(dispFieldIn,imgVolFine,scaleStep ...@@ -44,6 +44,16 @@ function[dispFieldOut] = interpolate_disp_field(dispFieldIn,imgVolFine,scaleStep
elseif (strcmp(interpType,'nearest')) elseif (strcmp(interpType,'nearest'))
sizeDispField = size(dispFieldIn); sizeDispField = size(dispFieldIn);
sizeImgVolFine = size(imgVolFine); sizeImgVolFine = size(imgVolFine);
cd matlab_debug/little_upsample
for nbframe=1:98
csvwrite(strcat('M_UA_Ante_DispX_F',int2str(nbframe-1),'.csv'),squeeze(dispFieldIn(1,:,:,nbframe)));
csvwrite(strcat('M_UA_Ante_DispY_F',int2str(nbframe-1),'.csv'),squeeze(dispFieldIn(2,:,:,nbframe)));
csvwrite(strcat('M_UA_Ante_DispZ_F',int2str(nbframe-1),'.csv'),squeeze(dispFieldIn(3,:,:,nbframe)));
csvwrite(strcat('M_UA_Ante_DispA_F',int2str(nbframe-1),'.csv'),squeeze(dispFieldIn(4,:,:,nbframe)));
end
cd ../..
%get the interpolated coordinates %get the interpolated coordinates
if (sizeDispField(end) == sizeImgVolFine(end)) %no temporal subsampling if (sizeDispField(end) == sizeImgVolFine(end)) %no temporal subsampling
[xCoordsFine,yCoordsFine,tCoordsFine] = meshgrid(1:sizeImgVolFine(3),1:sizeImgVolFine(2),1:sizeImgVolFine(end)); [xCoordsFine,yCoordsFine,tCoordsFine] = meshgrid(1:sizeImgVolFine(3),1:sizeImgVolFine(2),1:sizeImgVolFine(end));
...@@ -65,7 +75,8 @@ function[dispFieldOut] = interpolate_disp_field(dispFieldIn,imgVolFine,scaleStep ...@@ -65,7 +75,8 @@ function[dispFieldOut] = interpolate_disp_field(dispFieldIn,imgVolFine,scaleStep
dispFieldX = squeeze(dispFieldIn(1,:,:,:)); dispFieldX = squeeze(dispFieldIn(1,:,:,:));
dispFieldY = squeeze(dispFieldIn(2,:,:,:)); dispFieldY = squeeze(dispFieldIn(2,:,:,:));
dispFieldT = squeeze(dispFieldIn(3,:,:,:)); dispFieldT = squeeze(dispFieldIn(3,:,:,:));
%interpolate the shift volume %interpolate the shift volume
linInds = sub2ind(size(dispFieldX),yCoordsInterp,xCoordsInterp,tCoordsInterp); linInds = sub2ind(size(dispFieldX),yCoordsInterp,xCoordsInterp,tCoordsInterp);
dispFieldXinterp = reshape(scaleStep*dispFieldX(linInds),sizeDispFieldOut(2:4)); dispFieldXinterp = reshape(scaleStep*dispFieldX(linInds),sizeDispFieldOut(2:4));
...@@ -76,6 +87,8 @@ function[dispFieldOut] = interpolate_disp_field(dispFieldIn,imgVolFine,scaleStep ...@@ -76,6 +87,8 @@ function[dispFieldOut] = interpolate_disp_field(dispFieldIn,imgVolFine,scaleStep
dispFieldTinterp = reshape(scaleStep*dispFieldT(linInds),sizeDispFieldOut(2:4)); dispFieldTinterp = reshape(scaleStep*dispFieldT(linInds),sizeDispFieldOut(2:4));
end end
saveDispTbeforeClamp = squeeze(dispFieldTinterp(:,:,68));
%clamp the shift field %clamp the shift field
minBarrierX = ceil(patchSize(1)/2)*ones(sizeDispFieldOut(2:4)); minBarrierX = ceil(patchSize(1)/2)*ones(sizeDispFieldOut(2:4));
maxBarrierX = (sizeDispFieldOut(3) - ceil(patchSize(1)/2))*ones(sizeDispFieldOut(2:4)); maxBarrierX = (sizeDispFieldOut(3) - ceil(patchSize(1)/2))*ones(sizeDispFieldOut(2:4));
...@@ -91,9 +104,33 @@ function[dispFieldOut] = interpolate_disp_field(dispFieldIn,imgVolFine,scaleStep ...@@ -91,9 +104,33 @@ function[dispFieldOut] = interpolate_disp_field(dispFieldIn,imgVolFine,scaleStep
dispFieldOut(2,:,:,:) = max(min( dispFieldYinterp, maxBarrierY - yCoordsFine ), minBarrierY - yCoordsFine); dispFieldOut(2,:,:,:) = max(min( dispFieldYinterp, maxBarrierY - yCoordsFine ), minBarrierY - yCoordsFine);
dispFieldOut(3,:,:,:) = max(min( dispFieldTinterp, maxBarrierT - tCoordsFine ), minBarrierT - tCoordsFine); dispFieldOut(3,:,:,:) = max(min( dispFieldTinterp, maxBarrierT - tCoordsFine ), minBarrierT - tCoordsFine);
saveDispTafterClamp = squeeze(dispFieldOut(3,:,:,68));
%size(saveDispXafterClamp)
cd matlab_debug/little_upsample/
for nbframe=1:98
csvwrite(strcat('M_CoordX_F',int2str(nbframe-1),'.csv'),xCoordsInterp(:,:,nbframe));
csvwrite(strcat('M_CoordY_F',int2str(nbframe-1),'.csv'),yCoordsInterp(:,:,nbframe));
csvwrite(strcat('M_CoordZ_F',int2str(nbframe-1),'.csv'),tCoordsInterp(:,:,nbframe));
end
csvwrite('M_DispZ_BeforeClamp_F68.csv',saveDispTbeforeClamp);
csvwrite('M_DispZ_AfterClamp_F68.csv',saveDispTafterClamp);
cd ../..
%deal with the last field : the patch distance %deal with the last field : the patch distance
dispFieldTemp = squeeze(dispFieldIn(4,:,:,:)); dispFieldTemp = squeeze(dispFieldIn(4,:,:,:));
dispFieldOut(4,:,:,:) = reshape(dispFieldTemp(linInds(:)),sizeDispFieldOut(2:4)); dispFieldOut(4,:,:,:) = reshape(dispFieldTemp(linInds(:)),sizeDispFieldOut(2:4));
cd matlab_debug/little_upsample
for nbframe=1:98
csvwrite(strcat('M_UA_Post_DispX_F',int2str(nbframe-1),'.csv'),squeeze(dispFieldOut(1,:,:,nbframe)));
csvwrite(strcat('M_UA_Post_DispY_F',int2str(nbframe-1),'.csv'),squeeze(dispFieldOut(2,:,:,nbframe)));
csvwrite(strcat('M_UA_Post_DispZ_F',int2str(nbframe-1),'.csv'),squeeze(dispFieldOut(3,:,:,nbframe)));
csvwrite(strcat('M_UA_Post_DispA_F',int2str(nbframe-1),'.csv'),squeeze(dispFieldOut(4,:,:,nbframe)));
end
cd ../..
'end'
end end
end end
\ No newline at end of file
...@@ -6,7 +6,6 @@ MatlabPath = "Data/matlab_debug/" ...@@ -6,7 +6,6 @@ MatlabPath = "Data/matlab_debug/"
CppPath = "Data/debug/" CppPath = "Data/debug/"
np.set_printoptions(threshold=np.nan) np.set_printoptions(threshold=np.nan)
# Attention cette partie est à remplir à la main # Attention cette partie est à remplir à la main
########Paramètres##################### ########Paramètres#####################
# On choisit ici la frame à observer, attention Matlab est en +1 # On choisit ici la frame à observer, attention Matlab est en +1
...@@ -92,23 +91,36 @@ def evolution(path,MorC,nbFrame,XYZ,idIter): ...@@ -92,23 +91,36 @@ def evolution(path,MorC,nbFrame,XYZ,idIter):
return 0 return 0
def upsample_compare(Mpath,Cpath,nbFrame,XYZ,level,OccMask,outPath,inputMorC): def upsample_compare(Mpath,Cpath,nbFrame,XYZ,level,OccMask,outPath,inputMorC,levelBool):
"This function is to compare two set of data, in .csv matrices, and produce a visual output (in .png)"
results=[] results=[]
for i in range(nbFrame): for i in range(1,nbFrame):
if(inputMorC==0): # Add level in the pathway
temp_matlab = np.genfromtxt(Mpath+XYZ+"_L"+str(level)+"_F"+str(i)+".csv",delimiter=',') if(levelBool==True):
endPath = "_L"+str(level)+"_F"
else: else:
temp_matlab = np.genfromtxt(Mpath+XYZ+"_L"+str(level)+"_F"+str(i)+".csv",delimiter=';') endPath = "_F"
# Load matrices from the first path
if(inputMorC=='Matlab'):
temp_matlab = np.genfromtxt(Mpath+XYZ+endPath+str(i-1)+".csv",delimiter=',')
else:
temp_matlab = np.genfromtxt(Mpath+XYZ+endPath+str(i)+".csv",delimiter=';')
end_m = np.shape(temp_matlab)[1] end_m = np.shape(temp_matlab)[1]
temp_matlab = temp_matlab[:,0:end_m-1] temp_matlab = temp_matlab[:,0:end_m-1]
# Load matrices for the second path
temp_cpp = np.genfromtxt(Cpath+XYZ+"_L"+str(level)+"_F"+str(i)+".csv",delimiter=';') endPath = endPath + str(i) + ".csv"
temp_cpp = np.genfromtxt(Cpath+XYZ+endPath,delimiter=';')
end = np.shape(temp_cpp)[1] end = np.shape(temp_cpp)[1]
diff = temp_matlab-temp_cpp[:,0:end-1] diff = temp_matlab-temp_cpp[:,0:end-1]
# print(diff)
if(np.sum(diff)!=0):
print("i:",i)
print(100*diff)
plt.imsave(outPath+XYZ+"_F"+str(i)+".png",diff,cmap="seismic") plt.imsave(outPath+XYZ+"_F"+str(i)+".png",diff,cmap="seismic")
diff[diff!=0]=1 diff[diff!=0]=1
...@@ -162,17 +174,62 @@ if __name__=="__main__": ...@@ -162,17 +174,62 @@ if __name__=="__main__":
# plt.imshow(VolOnion[3,:,:,]) # plt.imshow(VolOnion[3,:,:,])
# plt.show() # plt.show()
# # upsample compare between Matlab and C++ with new implementation
# upsample_compare("Data/upsample/matlab_upsample/M_upsampleAfter_",\ # upsample_compare("Data/upsample/matlab_upsample/M_upsampleAfter_",\
# "Data/upsample/test_methodCpp/CppOut_",98,"Z",1,OccMediumMask,"Data/upsample/results/DiffNewFunc_",0) # "Data/upsample/CppOut_",98,"DispX",1,OccMediumMask,"Data/upsample/results/DiffNewFunc_",'Matlab',True)
# # Upsample compare between C++ old and new implementation
# upsample_compare("Data/upsample/CppOut_",\ # upsample_compare("Data/upsample/CppOut_",\
# "Data/upsample/test_methodCpp/CppOut_",98,"DispX",1,OccMediumMask,"Data/upsample/results/DiffMethod_",1) # "Data/upsample/test_methodCpp/CppOut_",98,"DispX",1,OccMediumMask,"Data/upsample/results/DiffMethod_",1)
# # Result: Implementation successful, same result in output, the problem is somewhere else.
# # Transformer .csv en image # # Transformer .csv en image
# for i in range(98): # for i in range(98):
# img = np.genfromtxt("Data/upsample/test_methodCpp/CppOut_DispX_L1_F"+str(i)+".csv",delimiter=";") # img = np.genfromtxt("Data/upsample/test_methodCpp/CppOut_DispX_L1_F"+str(i)+".csv",delimiter=";")
# plt.imsave("Data/upsample/test_methodCpp/test_DispX_L1_F"+str(i)+".png",img,cmap='seismic') # plt.imsave("Data/upsample/test_methodCpp/test_DispX_L1_F"+str(i)+".png",img,cmap='seismic')
# Displaying Disp and Grad differences for a SR iteration # # Displaying Disp and Grad differences for a SR iteration
upsample_compare("Data/search_reconstruct/SR_matlab/M_SR_Post_",\ # upsample_compare("Data/search_reconstruct/SR_matlab/M_SR_Post_",\
"Data/search_reconstruct/CppOut_SR_",98,"GradY",3,OccMediumMask,"Data/search_reconstruct/SR_result/Diff_SR_",0) # "Data/search_reconstruct/CppOut_SR_",98,"GradY",3,\
# OccMediumMask,"Data/search_reconstruct/SR_result/Diff_SR_",0)
# # Result: Huge difference...
# # Comparing before and after clamp matrices in Matlab algorithm
# im1 = np.genfromtxt("Data/upsample_ant/M_DispX_BeforeClamp_F32.csv",delimiter=',')
# im2 = np.genfromtxt("Data/upsample_ant/M_DispX_AfterClamp_F32.csv",delimiter=',')
#
# plt.imsave("Data/upsample_ant/M_DispX_DiffClamp_F32.png",im1-im2)
# # Result: Exactly the same, clamp unusued
# #Compare the output of data out of C++ algo, after and before
# upsample_compare("Data/upsample_ant/M_UA_Post_","Data/upsample_ant/Cpp_UA_",\
# 98,"DispY",3,OccMediumMask,"Data/upsample_ant/DiffOut_UA_",'Matlab',False)
# # Result: Exactly the same, there is a problem in the analysis
# # Compare just two frames of DispA for more details
# im1 = np.genfromtxt("Data/upsample/matlab_upsample/M_upsampleAfter_DispA_L1_F47.csv",delimiter=',')
# im2 = np.genfromtxt("Data/upsample/CppOut_DispA_L1_F48.csv",delimiter=';')
# end = np.shape(im2)[1]
# plt.imsave("Data/upsample/results/DiffM_NewC_DispA_L1_F48.png",im1-im2[:,0:end-1],cmap='seismic')
# # Result: Ok there is a problem in the indexation of data...
# # Upsample compare of DispA to test the indexation problem
# upsample_compare("Data/upsample/matlab_upsample/M_upsampleAfter_",\
# "Data/upsample/test_methodCpp/CppOut_",98,"DispZ",1,OccMediumMask,"Data/upsample/results/NewIndNewImp_",'Matlab',True)
# # Result: There was indeed an index problem... X,Y and A exactly the same, but problem with the Z, with small peak of differences.
# # Looking differences between coords of upsample (M vs Cpp) to see the problem on Z
# for i in range(98):
# im1 = np.genfromtxt("Data/upsample_ant/coord/M_CoordZ_F"+str(i)+".csv",delimiter=',')
# im2 = np.genfromtxt("Data/upsample_ant/coord/Cpp_UA_CoordZ_F"+str(i)+".csv",delimiter=';')
# end = np.shape(im2)[1]
# print(np.sum(im1-im2[:,0:end-1]-np.ones(np.shape(im1))))
# plt.imsave("Data/upsample_ant/coord/Diff_UA_CoordZ_F"+str(i)+".png",im1-im2[:,0:end-1])
# # Result: Don't seem to have a difference in the coord matrices between matlab and C++, maybe during clamp ?
# Comparing before and after clamp matrices in Matlab algorithm
im1 = np.genfromtxt("Data/upsample_ant/M_DispZ_BeforeClamp_F68.csv",delimiter=',')
im2 = np.genfromtxt("Data/upsample_ant/M_DispZ_AfterClamp_F68.csv",delimiter=',')
plt.imsave("Data/upsample_ant/M_DispZ_DiffClamp_F68.png",im1-im2)
# Result: On Z, there is a difference, so clamp might be useful
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment