A method for step size calibration of a two-dimensional scanning module in a scanning light field imaging system, comprising:
- performing two-dimensional scanning on a sample to be measured, with N scans in a horizontal direction and N scans in a vertical direction, totaling N*N scans, collecting N2 sheets of two-dimensional raw scanning light field data, and rearranging into four-dimensional phase space data to obtain multi-view rearranged images;
- selecting middle views of all views in the multi-view rearranged images to obtain non-scanned central view sub-images;
- calculating a sub-pixel displacement matrix of all non-scanned central view sub-images relative to a first non-scanned central view sub-image, where the sub-pixel displacement matrix characterizes pixel offsets between images caused by two-dimensional scanning;
- calculating an average displacement quantity according to the sub-pixel displacement matrix, and calculating a step size adjustment coefficient according to the average displacement quantity;
- and
- updating a correct scanning step size according to the step size adjustment coefficient;
- wherein the calculating the sub-pixel displacement matrix of all non-scanned central view sub-images relative to the first non-scanned central view sub-image specifically comprises:
- calculating cross-correlations between all of the non-scanned central view sub-images and the first non-scanned central view sub-image respectively, wherein a maximum value of the cross-correlations is a relative displacement of two images;
- C
- i
- ,
- j
- (
- m
- ,
- n
- )
- =
- ∑
- x
- ∑
- y
- CV
-
- (
- i
- ,
- j
- ,
- x
- +
- m
- ,
- y
- +
- n
- )
-
- CV
-
- (
- 1
- ,
- 1
- ,
- x
- ,
- y
- )
- ,
- y
- ∈
- [
- 1
- ,
- h
- ]
- ,
- x
- ∈
- [
- 1
- ,
- w
- ]
- s
-
- (
- i
- ,
- j
- )
- =
- argmax
-
- C
- i
- ,
- j
- (
- m
- ,
- n
- )
- ,
- i
- ∈
- [
- 1
- ,
- N
- ]
- ,
- j
- ∈
- [
- 1
- ,
- N
- ]
- wherein i and j indicate coordinates of the two-dimensional scanning, N indicates number of scans;
- x and y indicate two-dimensional pixel coordinates of an image, m and n indicate two-dimensional cross-correlation calculation variables;
- h and w indicate a pixel height and pixel width of the multi-view rearranged image, CV(·) indicates the non-scanned central view sub-image, and S(i, j) indicates the sub-pixel displacement matrix;
- an average displacement quantity in an X-axis direction is:
- X
- =
- S
- [
- N
- ,
- :
- ,
- 1
- ]
- -
- S
- [
- 1
- ,
- :
- ,
- 1
- ]
- N
-
- (
- N
- -
- 1
- )
- wherein S[N,:,1] indicates an x displacement of a N-th column of the sub-pixel displacement matrix, S[1,:,1] indicates an x displacement of a 1st column of the sub-pixel displacement matrix;
- an average displacement quantity in a Y-axis direction is:
- Y
- =
- S
- [
- :
- ,
- N
- ,
- 2
- ]
- -
- S
- [
- :
- ,
- 1
- ,
- 2
- ]
- N
-
- (
- N
- -
- 1
- )
- wherein S[:,N,2] indicates a y displacement of a N-th row of the sub-pixel displacement matrix, S[:,1,2] indicates the y displacement of a 1st row of the sub-pixel displacement matrix;
- a step size adjustment coefficient KX in the X-axis direction is:
- KX
- =
- 1
- N
- *
- X
- wherein X indicates the average displacement quantity in the X-axis direction;
- and
- a step size adjustment coefficient KY in the Y-axis direction is:
- KY
- =
- 1
- N
- *
- Y
- wherein Y indicates the average displacement quantity in the Y-axis direction.