solve¶
Parameter initialization and solve routines for page flattening.
This module contains a function (get_default_params) that:
- Uses four corner correspondences to estimate rotation/translation (solvePnP).
- Includes default cubic slopes and any y/x coordinates from sampled spans.
get_default_params ¶
get_default_params(corners: ndarray, ycoords: ndarray, xcoords: list[ndarray]) -> tuple[tuple[float, float], list[int], np.ndarray]
Assemble an initial parameter vector for page flattening.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
corners
|
|
A (4,1,2) array of corner points in image coords. |
required |
ycoords
|
|
A 1D array of average vertical positions (per span). |
required |
xcoords
|
|
A list of x-coordinates arrays for each span. |
required |
Returns:
| Type | Description |
|---|---|
|
A tuple of:
(page_width, page_height): The estimated physical page dims.
span_counts: A list with the length of each |