You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/dataset includes datasets used for training the optical aberration model.
/sfrmat5_dist contains the SFR calculation algorithm, which was downloaded from ISO 12233.
/results stores the results, including the PSF map and PSF comparisons.
SFR Data Preparation
Follow these steps to generate the necessary SFR (Spatial Frequency Response) data for training.
Generate Blurry Edges:
Run the Python script generate_edges_rgb.py to process your images and obtain the initial blurry edge data.
python generate_edges_rgb.py
Calculate SFR Curves:
Next, open MATLAB and execute the user_sfrmat5_rgb.m script. This will analyze the edges from the previous step to compute and save the SFR curves.
Generate Training Data:
Finally, run the generate_fov_weight.py script. This will process the SFR curves and generate the final .npz files that will be used as input for the training process.
python generate_fov_weight.py
Training
To train an aberration learning model from scratch, run main.py. The results will be saved in /results/lensname.
Q & A
1. Why is F=5 used as the scaling factor (see scale in optics_rgb.py)?
When extracting a 2D MTF slice from the 3D MTF data (as implemented in slice within tool.py), we intentionally scale the coordinate system by a factor of 5.
This expansion:
- Reduces quantization errors during interpolation
- Improves numerical precision in the slicing operation
The scaling factor (F=5) is subsequently applied to compensate for this coordinate expansion, ensuring the final results maintain their proper scale and accuracy.