alipwong / phase_retrieval_and_design

10 stars 1 forks source link

PCA how to do? #1

Open lalalashini opened 2 years ago

lalalashini commented 2 years ago

hello,your paper 3.A say "The resultant basis was optimized by applying principal component analysis (PCA) to reduce the basis down to 500 modes.".So,How to apply principal component analysis (PCA)?

benjaminpope commented 2 years ago

See inputs 1-5 in this example: https://louisdesdoigts.github.io/dLux/notebooks/designing_a_mask/

lalalashini commented 2 years ago

Thanks for your help! And I want to ask you again about Continuous Latent Image Mask Binarization(CLIMB).I don't know what is the " fractional area of the unit square above this line, i.e., for which this locally linearized φ > 0." mean and why use it can get soft edges.

benjaminpope commented 2 years ago

Take a 3x3 pixel grid, and evaluate the continuous latent image across it.

Fit a plane to this and see where it intersects the xy plane. This cuts the xy plane into two chunks.

Calculate the area of the positive-signed region. If the 3x3 pixel grid has side lengths 1, this is then a number between 0 and 1.

Now you have a continuous function between 0 and 1, only at the edges of the thresholded regions!