Update combine

This commit is contained in:
frfoc1 committed 2024-05-19 20:27:44 -04:00
1 parent 237ef184ad
commit c716784950
1 file changed
+9
+9
View File
@@ -71,6 +71,7 @@ if __name__ == "__main__":
well_addr = str(well_addr) well_addr = str(well_addr)
hdr_well_image = cv2.imread(well_addr, cv2.IMREAD_UNCHANGED) hdr_well_image = cv2.imread(well_addr, cv2.IMREAD_UNCHANGED)
if args.fast_dir is not None:
hdr_fast_image = cv2.imread(well_addr.replace(args.well_dir, args.fast_dir), cv2.IMREAD_UNCHANGED) hdr_fast_image = cv2.imread(well_addr.replace(args.well_dir, args.fast_dir), cv2.IMREAD_UNCHANGED)
@@ -79,6 +80,8 @@ if __name__ == "__main__":
if args.do_linearization: if args.do_linearization:
hdr_well_image = apply_correction((camera_data["b"], camera_data["g"], camera_data["r"]), np.array(hdr_well_image), CORRECTION_CURVE_TYPE) hdr_well_image = apply_correction((camera_data["b"], camera_data["g"], camera_data["r"]), np.array(hdr_well_image), CORRECTION_CURVE_TYPE)
if args.fast_dir is not None:
hdr_fast_image = apply_correction((camera_data["b"], camera_data["g"], camera_data["r"]), np.array(hdr_fast_image), CORRECTION_CURVE_TYPE) hdr_fast_image = apply_correction((camera_data["b"], camera_data["g"], camera_data["r"]), np.array(hdr_fast_image), CORRECTION_CURVE_TYPE)
@@ -88,6 +91,8 @@ if __name__ == "__main__":
# well_mask = well_mask.astype(np.float32) / 255.0 # well_mask = well_mask.astype(np.float32) / 255.0
# well_mask[well_mask > 0.1] = 1.0 # well_mask[well_mask > 0.1] = 1.0
if args.fast_dir is not None:
weights_well = cut_weighting_function(hdr_well_image, WELL_EXPOSURE) weights_well = cut_weighting_function(hdr_well_image, WELL_EXPOSURE)
weights_fast = cut_weighting_function(hdr_fast_image, FAST_EXPOSURE) weights_fast = cut_weighting_function(hdr_fast_image, FAST_EXPOSURE)
@@ -96,7 +101,11 @@ if __name__ == "__main__":
# final_output = weights_well * (hdr_well_image / WELL_EXPOSURE) + weights_fast * (hdr_fast_image / FAST_EXPOSURE) # final_output = weights_well * (hdr_well_image / WELL_EXPOSURE) + weights_fast * (hdr_fast_image / FAST_EXPOSURE)
# final_output = final_output / (weights_well+weights_well) # final_output = final_output / (weights_well+weights_well)
if args.fast_dir is not None:
final_output = weights_well * (hdr_well_image / WELL_EXPOSURE) + (hdr_fast_image / FAST_EXPOSURE) final_output = weights_well * (hdr_well_image / WELL_EXPOSURE) + (hdr_fast_image / FAST_EXPOSURE)
else:
final_output = hdr_well_image / WELL_EXPOSURE
# final_output = weights_well * (hdr_well_image / WELL_EXPOSURE) # final_output = weights_well * (hdr_well_image / WELL_EXPOSURE)
output_addr = well_addr.replace(args.well_dir, args.out_dir) output_addr = well_addr.replace(args.well_dir, args.out_dir)