Commit b56d9b54 authored by luroth's avatar luroth
Browse files

Bugfix: too high mapping areas led to empty GCP placement

New: config files for FLIR and VIS/NIR sensors
parent f284b864
......@@ -212,19 +212,24 @@ calc_gcp_recover_frequency <- function(mapping_area_x, mapping_area_y, gcp_n_in_
hit_per_gcp <- data.frame("x"=gcp[,1],
"y"=gcp[,2],
"Recover frequency"=colSums(counts))
row.names(hit_per_gcp) <- paste("GCP", seq(1, nrow(hit_per_gcp)))
hit_per_image <- rowSums(counts)
hist_ <- hist(hit_per_image, breaks=seq(from=-0.5, to=max(hit_per_image) + 0.5, by = 1), plot=FALSE, freq=FALSE, right=FALSE)
if(nrow(hit_per_gcp)>0) {
row.names(hit_per_gcp) <- paste("GCP", seq(1, nrow(hit_per_gcp)))
hit_per_image <- rowSums(counts)
hist_ <- hist(hit_per_image, breaks=seq(from=-0.5, to=max(hit_per_image) + 0.5, by = 1), plot=FALSE, right=FALSE)
} else {
hit_per_image <- NULL
hit_per_gcp <- NULL
hist_ <- NULL
}
return(list(gcp, hit_per_gcp, hit_per_image, hist_))
}
opt_gcp_recover_frequency <- function(gcp_n_in_x, gcp_rec_number, gcp_rec_frequency, mapping_area_x, mapping_area_y, gcp_arrangement_pattern, field_of_view_x, field_of_view_y, photo_positions, gcp_frequency_base) {
gcp_n_in_y <- calc_gcp_in_y(gcp_n_in_x, mapping_area_x, mapping_area_y, gcp_arrangement_pattern)
# Penalty
penalty <- 0
......
This diff is collapsed.
{
"input": {
"end_lap": 80,
"side_lap": 70,
"flip_camera": "TRUE",
"results": "Photography",
"spacing_between_flight_lines": 6.27,
"model_load_predefined": 1,
"aperture-selectized": "",
"sensor_and_lens_select": "FLIR A65 FOV 25 (30 Hz, ver. 2016) on DJI M600P",
"position_edge2_lat": 47.4511525,
"ground_sampling_distance": 44.55,
"gcp_frequency_base": "inline",
"aperture": "1.2",
"f": 25,
"edit_spacing": false,
"position_edge1_long": 8.68248761,
"ISO_max": 100,
"mapping_area_x": 36,
"plot_size_x": 1.5,
"mapping_area_y": 40,
"plot_size_y": 2,
"start_model_ok": 1,
"show_start_modal": 0,
"recalc_waypoint_map": 0,
"spacing_between_exposures": 5.7,
"edit_gcp_arrangement": false,
"edit_ground_sampling_distance": false,
"exposure_value": 14,
"position_edge2_long": 8.68188143,
"t_max": 50,
"flight_max": 10,
"freq_max": 30,
"gcp_rec_frequency": 50,
"positioning_precision": 3,
"iso": 0.4395,
"max_number_of_wp": 99,
"motion_blur": 1.48,
"gcp_rec_number": 1,
"config_tab": "Sensor/Lens",
"settings": null,
"start_modal_predefined-selectized": "",
"start_modal_predefined": "003_FLIR_A65_FOV_25_30Hz_v2016_M600P.json",
"shutter_speed-selectized": "",
"shutter_speed": "50",
"position_edge1_lat": 47.4508187,
"flight_height": 60,
"position_start_lat": 47.4500569,
"project_name": "",
"position_start_long": 8.68167222,
"gcp_n_in_x": 3,
"d_sensor_x": 11.88,
"n_pix_x": 640,
"gcp_n_in_y": 2,
"d_sensor_y": 8.704,
"n_pix_y": 512,
"gcp_arrangement_pattern": "skip"
},
"derived": {
"d_sensor_x": 0.01188,
"d_sensor_y": 0.008704,
"diffraction_blue": "B (470 nm): no",
"flight_duration": 4,
"side_lap": 70,
"end_lap": 80,
"flight_height": 60,
"hit_per_image": [ 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1 ],
"aperture": 1.2,
"diffraction_green": "G (530 nm): no",
"angle_of_view_x": 0.466548918,
"angle_of_view_y": 0.34470573,
"field_of_view_y_sensor": 20.8896,
"photo_positions": {
"x": [ -12.54, -12.54, -12.54, -12.54, -12.54, -12.54, -12.54, -12.54, -12.54, -12.54, -12.54, -12.54, -12.54, -6.27, -6.27, -6.27, -6.27, -6.27, -6.27, -6.27, -6.27, -6.27, -6.27, -6.27, -6.27, -6.27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6.27, 6.27, 6.27, 6.27, 6.27, 6.27, 6.27, 6.27, 6.27, 6.27, 6.27, 6.27, 6.27, 12.54, 12.54, 12.54, 12.54, 12.54, 12.54, 12.54, 12.54, 12.54, 12.54, 12.54, 12.54, 12.54, 18.81, 18.81, 18.81, 18.81, 18.81, 18.81, 18.81, 18.81, 18.81, 18.81, 18.81, 18.81, 18.81, 25.08, 25.08, 25.08, 25.08, 25.08, 25.08, 25.08, 25.08, 25.08, 25.08, 25.08, 25.08, 25.08, 31.35, 31.35, 31.35, 31.35, 31.35, 31.35, 31.35, 31.35, 31.35, 31.35, 31.35, 31.35, 31.35, 37.62, 37.62, 37.62, 37.62, 37.62, 37.62, 37.62, 37.62, 37.62, 37.62, 37.62, 37.62, 37.62, 43.89, 43.89, 43.89, 43.89, 43.89, 43.89, 43.89, 43.89, 43.89, 43.89, 43.89, 43.89, 43.89 ],
"y": [ -14.256, -8.556, -2.856, 2.844, 8.544, 14.244, 19.944, 25.644, 31.344, 37.044, 42.744, 48.444, 54.144, 54.144, 48.444, 42.744, 37.044, 31.344, 25.644, 19.944, 14.244, 8.544, 2.844, -2.856, -8.556, -14.256, -14.256, -8.556, -2.856, 2.844, 8.544, 14.244, 19.944, 25.644, 31.344, 37.044, 42.744, 48.444, 54.144, 54.144, 48.444, 42.744, 37.044, 31.344, 25.644, 19.944, 14.244, 8.544, 2.844, -2.856, -8.556, -14.256, -14.256, -8.556, -2.856, 2.844, 8.544, 14.244, 19.944, 25.644, 31.344, 37.044, 42.744, 48.444, 54.144, 54.144, 48.444, 42.744, 37.044, 31.344, 25.644, 19.944, 14.244, 8.544, 2.844, -2.856, -8.556, -14.256, -14.256, -8.556, -2.856, 2.844, 8.544, 14.244, 19.944, 25.644, 31.344, 37.044, 42.744, 48.444, 54.144, 54.144, 48.444, 42.744, 37.044, 31.344, 25.644, 19.944, 14.244, 8.544, 2.844, -2.856, -8.556, -14.256, -14.256, -8.556, -2.856, 2.844, 8.544, 14.244, 19.944, 25.644, 31.344, 37.044, 42.744, 48.444, 54.144, 54.144, 48.444, 42.744, 37.044, 31.344, 25.644, 19.944, 14.244, 8.544, 2.844, -2.856, -8.556, -14.256 ]
},
"spacing_between_exposures": 5.7,
"spacing_between_flight_lines": 6.27,
"number_of_photos": 130,
"f": 0.025,
"gcp": {
"x": [ 0, 0, 18, 36, 36 ],
"y": [ 0, 40, 20, 0, 40 ]
},
"hit_per_gcp": {
"x": [ 0, 0, 18, 36, 36 ],
"y": [ 0, 40, 20, 0, 40 ],
"Recover.frequency": [ 6, 4, 15, 3, 2 ]
},
"number_of_gcp": 5,
"field_of_view_x": 20.8896,
"field_of_view_y": 28.512,
"diffraction_red": "R (700 nm): no",
"flight_speed": 3.2967,
"shutter_speed": 50,
"image_recording_speed": 0.58,
"project_name": "",
"hyperfocal_distance": 30.6622549,
"focus_distance": 23.812614,
"iso": 0.4395,
"field_of_view_x_sensor": 28.512,
"depth_of_field_near": 13.404775,
"depth_of_field_far": 106.509688,
"ground_sampling_distance": 0.04455,
"circle_of_confusion": 1.7e-05
}
}
\ No newline at end of file
......@@ -93,7 +93,7 @@ validate_inputs <- function(input) {
need(input$mapping_area_x>0, "Mapping area width (m) missing or invalid"),
need(input$mapping_area_y>0, "Mapping area depth (m) missing or invalid"),
need(input$mapping_area_x<=500, "Mapping area width (m) > 500 m"),
need(input$mapping_area_y<=500, "Mapping area depth (m) > 500g m"),
need(input$mapping_area_y<=500, "Mapping area depth (m) > 500 m"),
need(input$plot_size_x>0.2, "Plot size width (m) missing or invalid"),
need(input$plot_size_y>0.2, "Plot size depth (m) missing or invalid"),
need(input$side_lap>0, "Side lap (%) missing or invalid"),
......@@ -600,7 +600,7 @@ server_ <- function(input, output, session) {
observe({
req(input$mapping_area_x>0, input$mapping_area_y>0, input$gcp_arrangement_pattern)
req(derived_values$field_of_view_x>0, derived_values$field_of_view_y>0, derived_values$photo_positions)
req(input$gcp_rec_frequency, input$gcp_rec_number)
req(input$gcp_frequency_base, input$gcp_rec_number, input$gcp_rec_frequency, input$gcp_rec_number)
if(input$edit_gcp_arrangement) {
req(input$gcp_n_in_x>0, input$gcp_n_in_y>0)
......@@ -615,7 +615,7 @@ server_ <- function(input, output, session) {
#sr <- optimize(opt_gcp_recover_frequency, 1:20,
# input$gcp_rec_number, input$gcp_rec_frequency, input$mapping_area_x, input$mapping_area_y, input$gcp_arrangement_pattern,
# derived_values$field_of_view_x, derived_values$field_of_view_y, derived_values$photo_positions, tol=0.01)
min_levels <- gridSearch(opt_gcp_recover_frequency, list(seq(2,20)),
input$gcp_rec_number, input$gcp_rec_frequency, input$mapping_area_x, input$mapping_area_y, input$gcp_arrangement_pattern,
derived_values$field_of_view_x, derived_values$field_of_view_y, derived_values$photo_positions, input$gcp_frequency_base)$minlevels
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment