Frame: refine critical lens regions
This commit is contained in:
1 parent
48dcf4e707
commit
4c575fa8b5
7 files changed
+92
-10
No files matched your search
+24
-1
@@ -164,9 +164,10 @@ int main(void) {
|
||||
* shared diagonal probe must produce one stable midpoint and conforming
|
||||
* children only after its endpoint has been installed. */
|
||||
FrameLensMesh adaptive_mesh = {0};
|
||||
const RefinementConfig refine = {.max_level = 1,
|
||||
RefinementConfig refine = {.max_level = 1,
|
||||
.angle_absolute_rad = 1e-4,
|
||||
.angle_relative = 1e-4,
|
||||
.jacobian_minimum = 1e-3,
|
||||
.min_edge_pixels = 1.0,
|
||||
.min_area_pixels2 = 1.0};
|
||||
if (frame_lens_mesh_build_coarse(&adaptive_mesh, width, height, 100, 30.0))
|
||||
@@ -192,6 +193,28 @@ int main(void) {
|
||||
goto done;
|
||||
}
|
||||
frame_lens_mesh_destroy(&adaptive_mesh);
|
||||
/* A zero discrete Jacobian is an independent fold/critical-band trigger:
|
||||
* the probe below agrees exactly with linear endpoint interpolation, so the
|
||||
* direction-error criterion cannot request this split. */
|
||||
if (frame_lens_mesh_build_coarse(&adaptive_mesh, width, height, 100, 30.0))
|
||||
goto done;
|
||||
for (size_t i = 0; i < adaptive_mesh.vertex_count; ++i) {
|
||||
adaptive_mesh.vertices[i].traced = 1;
|
||||
adaptive_mesh.vertices[i].status = RAY_ENDPOINT_ESCAPED;
|
||||
adaptive_mesh.vertices[i].n_infinity[0] = 1.0;
|
||||
}
|
||||
const RayEndpoint flat_probe = {.n_infinity = {1.0, 0.0, 0.0},
|
||||
.frequency_ratio = 1.0,
|
||||
.status = RAY_ENDPOINT_ESCAPED};
|
||||
if (frame_lens_mesh_prepare_generation(&adaptive_mesh, &refine) != 1 ||
|
||||
frame_lens_mesh_install_sample(&adaptive_mesh, 0, &flat_probe) ||
|
||||
frame_lens_mesh_finish_generation(&adaptive_mesh, &refine) != 1 ||
|
||||
adaptive_mesh.vertex_count != 5 || adaptive_mesh.triangle_count != 4) {
|
||||
fputs("adaptive discrete-Jacobian split regression failed\n", stderr);
|
||||
frame_lens_mesh_destroy(&adaptive_mesh);
|
||||
goto done;
|
||||
}
|
||||
frame_lens_mesh_destroy(&adaptive_mesh);
|
||||
result = 0;
|
||||
done:
|
||||
frame_lens_mesh_destroy(&mesh);
|
||||
|
||||
@@ -64,6 +64,7 @@ int main(void) {
|
||||
const RefinementConfig refinement = {.max_level = 1,
|
||||
.angle_absolute_rad = 1e-5,
|
||||
.angle_relative = 1e-5,
|
||||
.jacobian_minimum = 1e-3,
|
||||
.min_edge_pixels = 1.0,
|
||||
.min_area_pixels2 = 1.0};
|
||||
if (frame_lens_mesh_build_coarse(&mesh, 48, 48, 24, 40.0) ||
|
||||
|
||||
Reference in new issue
Block a user