image.photography\fusion\fusion_registration_enhancement.mbt

93.8% · 196 / 209 points · 677 lines

Background color reports the state of each line. Underlined characters mark exact instrumented byte offsets; hover them to inspect the visit count.

  1. 1///|
  2. 2/// # 融合配准增强 fusion/fusion_registration_enhancement
  3. 3///
  4. 4/// 图像处理库子模块
  5. 5/// 图像处理库子模块 Image processing library submodule
  6. 6// 图像融合与配准增强(v26.0.0)
  7. 7// 多尺度图像融合、图像配准、全景拼接、HDR融合
  8. 8
  9. 9///|
  10. 10/// 融合算法类型
  11. 11/// `#non_exhaustive` 表示未来可能添加新构造器
  12. 12#derive(Eq, @debug.Debug)
  13. 13#non_exhaustive
  14. 14pub(all) enum FusionAlgorithm {
  15. 15 WeightedAverage
  16. 16 LaplacianPyramid
  17. 17 GaussianPyramid
  18. 18 Wavelet
  19. 19 PCA
  20. 20 IHS
  21. 21 Brovey
  22. 22 SimpleMean
  23. 23 Maximum
  24. 24 Minimum
  25. 25 Unknown
  26. 26}
  27. 27
  28. 28///|
  29. 29pub extend FusionAlgorithm with @debug.Debug::{to_repr}
  30. 30
  31. 31///|
  32. 32pub extend FusionAlgorithm with Eq::{not_equal, equal}
  33. 33
  34. 34///|
  35. 35/// 融合结果
  36. 36#derive(Eq, @debug.Debug)
  37. 37pub(all) struct FusionResult {
  38. 38 image : @types.Image
  39. 39 algorithm : FusionAlgorithm
  40. 40 num_images : Int32
  41. 41 processing_time_ms : Double
  42. 42 fusion_quality : Double
  43. 43}
  44. 44
  45. 45///|
  46. 46pub extend FusionResult with Eq::{not_equal, equal}
  47. 47
  48. 48///|
  49. 49pub extend FusionResult with @debug.Debug::{to_repr}
  50. 50
  51. 51///|
  52. 52/// 融合配置
  53. 53#derive(Eq, @debug.Debug)
  54. 54pub(all) struct FusionEnhancedConfig {
  55. 55 algorithm : FusionAlgorithm
  56. 56 weights : Array[Double]
  57. 57 pyramid_levels : Int32
  58. 58 use_color_preservation : Bool
  59. 59}
  60. 60
  61. 61///|
  62. 62pub extend FusionEnhancedConfig with Eq::{not_equal, equal}
  63. 63
  64. 64///|
  65. 65pub extend FusionEnhancedConfig with @debug.Debug::{to_repr}
  66. 66
  67. 67///|
  68. 68/// 配准算法类型
  69. 69/// `#non_exhaustive` 表示未来可能添加新构造器
  70. 70#derive(Eq, @debug.Debug)
  71. 71#non_exhaustive
  72. 72pub(all) enum RegistrationAlgorithm {
  73. 73 PhaseCorrelation
  74. 74 FeatureBased
  75. 75 AreaBased
  76. 76 MutualInformation
  77. 77 OpticalFlow
  78. 78 Unknown
  79. 79}
  80. 80
  81. 81///|
  82. 82pub extend RegistrationAlgorithm with @debug.Debug::{to_repr}
  83. 83
  84. 84///|
  85. 85pub extend RegistrationAlgorithm with Eq::{not_equal, equal}
  86. 86
  87. 87///|
  88. 88/// 配准结果
  89. 89#derive(Eq, @debug.Debug)
  90. 90pub(all) struct RegistrationResult {
  91. 91 image : @types.Image
  92. 92 algorithm : RegistrationAlgorithm
  93. 93 translation_x : Double
  94. 94 translation_y : Double
  95. 95 rotation_angle : Double
  96. 96 scale_factor : Double
  97. 97 similarity : Double
  98. 98 processing_time_ms : Double
  99. 99}
  100. 100
  101. 101///|
  102. 102pub extend RegistrationResult with Eq::{not_equal, equal}
  103. 103
  104. 104///|
  105. 105pub extend RegistrationResult with @debug.Debug::{to_repr}
  106. 106
  107. 107///|
  108. 108/// 配准配置
  109. 109#derive(Eq, @debug.Debug)
  110. 110pub(all) struct RegistrationAdvancedConfig {
  111. 111 algorithm : RegistrationAlgorithm
  112. 112 max_iterations : Int32
  113. 113 tolerance : Double
  114. 114 use_multiscale : Bool
  115. 115}
  116. 116
  117. 117///|
  118. 118pub extend RegistrationAdvancedConfig with Eq::{not_equal, equal}
  119. 119
  120. 120///|
  121. 121pub extend RegistrationAdvancedConfig with @debug.Debug::{to_repr}
  122. 122
  123. 123///|
  124. 124/// 变换矩阵
  125. 125#derive(Eq, @debug.Debug)
  126. 126pub(all) struct TransformMatrix {
  127. 127 a : Double
  128. 128 b : Double
  129. 129 c : Double
  130. 130 d : Double
  131. 131 e : Double
  132. 132 f : Double
  133. 133}
  134. 134
  135. 135///|
  136. 136pub extend TransformMatrix with Eq::{not_equal, equal}
  137. 137
  138. 138///|
  139. 139pub extend TransformMatrix with @debug.Debug::{to_repr}
  140. 140
  141. 141///|
  142. 142/// 创建默认融合配置
  143. 143pub fn create_default_fusion_enhanced_config() -> FusionEnhancedConfig {
  144. 144● FusionEnhancedConfig::{
  145. 145 algorithm: FusionAlgorithm::WeightedAverage,
  146. 146 weights: [0.5, 0.5],
  147. 147 pyramid_levels: 4,
  148. 148 use_color_preservation: true,
  149. 149 }
  150. 150}
  151. 151
  152. 152///|
  153. 153/// 创建默认配准配置
  154. 154pub fn create_default_registration_advanced_config() -> RegistrationAdvancedConfig {
  155. 155● RegistrationAdvancedConfig::{
  156. 156 algorithm: RegistrationAlgorithm::PhaseCorrelation,
  157. 157 max_iterations: 100,
  158. 158 tolerance: 0.001,
  159. 159 use_multiscale: true,
  160. 160 }
  161. 161}
  162. 162
  163. 163///|
  164. 164/// 加权平均融合
  165. 165pub fn fuse_weighted_average(
  166. 166 images : Array[@types.Image],
  167. 167 weights : Array[Double],
  168. 168) -> @types.Image {
  169. 169● if images.length() == 0 {
  170. 170● return @types.Image::{
  171. 171 width: 0,
  172. 172 height: 0,
  173. 173 channels: 1,
  174. 174● data: Bytes::from_array([]),
  175. 175 }
  176. 176 }
  177. 177
  178. 178 let w = images[0].width
  179. 179 let h = images[0].height
  180. 180 let total = w * h
  181. 181 let out : Array[Byte] = []
  182. 182
  183. 183 for i in 0..<total {
  184. 184● let mut sum = 0.0
  185. 185 let mut weight_sum = 0.0
  186. 186● for j in 0..<images.length() {
  187. 187● let weight = if j < weights.length() { weights[j] } else { 1.0 }
  188. 188● sum += images[j].data[i].to_double() * weight
  189. 189 weight_sum += weight
  190. 190 }
  191. 191● let avg = if weight_sum > 0.0 { sum / weight_sum } else { 0.0 }
  192. 192 let clamped = if avg < 0.0 {
  193. 193○ 0.0
  194. 194● } else if avg > 255.0 {
  195. 195○ 255.0
  196. 196 } else {
  197. 197● avg
  198. 198 }
  199. 199● out.push(clamped.to_int().to_byte())
  200. 200 }
  201. 201
  202. 202 @types.Image::{
  203. 203 width: w,
  204. 204 height: h,
  205. 205 channels: images[0].channels,
  206. 206● data: Bytes::from_array(out),
  207. 207 }
  208. 208}
  209. 209
  210. 210///|
  211. 211/// 最大值融合
  212. 212pub fn fuse_maximum(images : Array[@types.Image]) -> @types.Image {
  213. 213● if images.length() == 0 {
  214. 214● return @types.Image::{
  215. 215 width: 0,
  216. 216 height: 0,
  217. 217 channels: 1,
  218. 218● data: Bytes::from_array([]),
  219. 219 }
  220. 220 }
  221. 221
  222. 222 let w = images[0].width
  223. 223 let h = images[0].height
  224. 224 let total = w * h
  225. 225 let out : Array[Byte] = []
  226. 226
  227. 227 for i in 0..<total {
  228. 228● let mut max_val = 0.0
  229. 229● for j in 0..<images.length() {
  230. 230● let val = images[j].data[i].to_double()
  231. 231 if val > max_val {
  232. 232● max_val = val
  233. 233 }
  234. 234 }
  235. 235● out.push(max_val.to_int().to_byte())
  236. 236 }
  237. 237
  238. 238 @types.Image::{
  239. 239 width: w,
  240. 240 height: h,
  241. 241 channels: images[0].channels,
  242. 242● data: Bytes::from_array(out),
  243. 243 }
  244. 244}
  245. 245
  246. 246///|
  247. 247/// 最小值融合
  248. 248pub fn fuse_minimum(images : Array[@types.Image]) -> @types.Image {
  249. 249● if images.length() == 0 {
  250. 250● return @types.Image::{
  251. 251 width: 0,
  252. 252 height: 0,
  253. 253 channels: 1,
  254. 254● data: Bytes::from_array([]),
  255. 255 }
  256. 256 }
  257. 257
  258. 258 let w = images[0].width
  259. 259 let h = images[0].height
  260. 260 let total = w * h
  261. 261 let out : Array[Byte] = []
  262. 262
  263. 263 for i in 0..<total {
  264. 264● let mut min_val = 255.0
  265. 265● for j in 0..<images.length() {
  266. 266● let val = images[j].data[i].to_double()
  267. 267 if val < min_val {
  268. 268● min_val = val
  269. 269 }
  270. 270 }
  271. 271● out.push(min_val.to_int().to_byte())
  272. 272 }
  273. 273
  274. 274 @types.Image::{
  275. 275 width: w,
  276. 276 height: h,
  277. 277 channels: images[0].channels,
  278. 278● data: Bytes::from_array(out),
  279. 279 }
  280. 280}
  281. 281
  282. 282///|
  283. 283/// 简单均值融合
  284. 284pub fn fuse_simple_mean(images : Array[@types.Image]) -> @types.Image {
  285. 285● let weights : Array[Double] = []
  286. 286● for _ in 0..<images.length() {
  287. 287● weights.push(1.0 / images.length().to_double())
  288. 288 }
  289. 289● fuse_weighted_average(images, weights)
  290. 290}
  291. 291
  292. 292///|
  293. 293/// 高斯模糊(用于金字塔)
  294. 294pub fn gaussian_blur_fe(
  295. 295 img : @types.Image,
  296. 296 kernel_size : Int32,
  297. 297) -> @types.Image {
  298. 298● let w = img.width
  299. 299 let h = img.height
  300. 300 let _ = w * h
  301. 301 let out : Array[Byte] = []
  302. 302 let radius = kernel_size / 2
  303. 303
  304. 304 for y in 0..<h {
  305. 305● for x in 0..<w {
  306. 306● let mut sum = 0.0
  307. 307 let mut weight_sum = 0.0
  308. 308 for dy in -radius..<(radius + 1) {
  309. 309● for dx in -radius..<(radius + 1) {
  310. 310● let nx = x + dx
  311. 311 let ny = y + dy
  312. 312 if nx >= 0 && nx < w && ny >= 0 && ny < h {
  313. 313● let dist = (dx * dx + dy * dy).to_double()
  314. 314 let weight = (
  315. 315● 0.0 - dist / (2.0 * radius.to_double() * radius.to_double())
  316. 316 ) *
  317. 317 0.1
  318. 318● sum += img.data[ny * w + nx].to_double() * weight
  319. 319 weight_sum += weight
  320. 320 }
  321. 321 }
  322. 322 }
  323. 323 let avg = if weight_sum > 0.0 {
  324. 324○ sum / weight_sum
  325. 325 } else {
  326. 326● img.data[y * w + x].to_double()
  327. 327 }
  328. 328 let clamped = if avg < 0.0 {
  329. 329○ 0.0
  330. 330● } else if avg > 255.0 {
  331. 331○ 255.0
  332. 332 } else {
  333. 333● avg
  334. 334 }
  335. 335● out.push(clamped.to_int().to_byte())
  336. 336 }
  337. 337 }
  338. 338
  339. 339 @types.Image::{
  340. 340 width: w,
  341. 341 height: h,
  342. 342 channels: img.channels,
  343. 343● data: Bytes::from_array(out),
  344. 344 }
  345. 345}
  346. 346
  347. 347///|
  348. 348/// 图像下采样(2x)
  349. 349pub fn downsample_fe(img : @types.Image) -> @types.Image {
  350. 350● let w = img.width / 2
  351. 351 let h = img.height / 2
  352. 352 let out : Array[Byte] = []
  353. 353
  354. 354 for y in 0..<h {
  355. 355● for x in 0..<w {
  356. 356● let src_x = x * 2
  357. 357 let src_y = y * 2
  358. 358● let p00 = img.data[src_y * img.width + src_x].to_double()
  359. 359● let p01 = img.data[src_y * img.width + src_x + 1].to_double()
  360. 360● let p10 = img.data[(src_y + 1) * img.width + src_x].to_double()
  361. 361● let p11 = img.data[(src_y + 1) * img.width + src_x + 1].to_double()
  362. 362 let avg = (p00 + p01 + p10 + p11) / 4.0
  363. 363● out.push(avg.to_int().to_byte())
  364. 364 }
  365. 365 }
  366. 366
  367. 367 @types.Image::{
  368. 368 width: w,
  369. 369 height: h,
  370. 370 channels: img.channels,
  371. 371● data: Bytes::from_array(out),
  372. 372 }
  373. 373}
  374. 374
  375. 375///|
  376. 376/// 图像上采样(2x,双线性)
  377. 377pub fn upsample_fe(img : @types.Image) -> @types.Image {
  378. 378● let w = img.width * 2
  379. 379 let h = img.height * 2
  380. 380 let out : Array[Byte] = []
  381. 381
  382. 382 for y in 0..<h {
  383. 383● for x in 0..<w {
  384. 384● let src_x = x.to_double() / 2.0
  385. 385● let src_y = y.to_double() / 2.0
  386. 386● let x0 = src_x.to_int()
  387. 387● let y0 = src_y.to_int()
  388. 388 let x1 = x0 + 1
  389. 389 let y1 = y0 + 1
  390. 390● let fx = src_x - x0.to_double()
  391. 391● let fy = src_y - y0.to_double()
  392. 392
  393. 393 let cx0 = if x0 < 0 {
  394. 394○ 0
  395. 395● } else if x0 >= img.width {
  396. 396○ img.width - 1
  397. 397 } else {
  398. 398● x0
  399. 399 }
  400. 400 let cy0 = if y0 < 0 {
  401. 401○ 0
  402. 402● } else if y0 >= img.height {
  403. 403○ img.height - 1
  404. 404 } else {
  405. 405● y0
  406. 406 }
  407. 407 let cx1 = if x1 < 0 {
  408. 408○ 0
  409. 409● } else if x1 >= img.width {
  410. 410● img.width - 1
  411. 411 } else {
  412. 412● x1
  413. 413 }
  414. 414 let cy1 = if y1 < 0 {
  415. 415○ 0
  416. 416● } else if y1 >= img.height {
  417. 417● img.height - 1
  418. 418 } else {
  419. 419● y1
  420. 420 }
  421. 421
  422. 422● let p00 = img.data[cy0 * img.width + cx0].to_double()
  423. 423● let p01 = img.data[cy0 * img.width + cx1].to_double()
  424. 424● let p10 = img.data[cy1 * img.width + cx0].to_double()
  425. 425● let p11 = img.data[cy1 * img.width + cx1].to_double()
  426. 426
  427. 427 let top = p00 * (1.0 - fx) + p01 * fx
  428. 428 let bottom = p10 * (1.0 - fx) + p11 * fx
  429. 429 let value = top * (1.0 - fy) + bottom * fy
  430. 430 let clamped = if value < 0.0 {
  431. 431○ 0.0
  432. 432● } else if value > 255.0 {
  433. 433○ 255.0
  434. 434 } else {
  435. 435● value
  436. 436 }
  437. 437● out.push(clamped.to_int().to_byte())
  438. 438 }
  439. 439 }
  440. 440
  441. 441 @types.Image::{
  442. 442 width: w,
  443. 443 height: h,
  444. 444 channels: img.channels,
  445. 445● data: Bytes::from_array(out),
  446. 446 }
  447. 447}
  448. 448
  449. 449///|
  450. 450/// 拉普拉斯金字塔融合(简化版)
  451. 451pub fn fuse_laplacian_pyramid(
  452. 452 images : Array[@types.Image],
  453. 453 levels : Int32,
  454. 454) -> @types.Image {
  455. 455● ignore(levels)
  456. 456● if images.length() < 2 {
  457. 457● return if images.length() == 1 {
  458. 458● images[0]
  459. 459 } else {
  460. 460● @types.Image::{
  461. 461 width: 0,
  462. 462 height: 0,
  463. 463 channels: 1,
  464. 464● data: Bytes::from_array([]),
  465. 465 }
  466. 466 }
  467. 467 }
  468. 468
  469. 469 // 简化:直接加权平均
  470. 470 let weights : Array[Double] = []
  471. 471● for _ in 0..<images.length() {
  472. 472● weights.push(1.0 / images.length().to_double())
  473. 473 }
  474. 474● fuse_weighted_average(images, weights)
  475. 475}
  476. 476
  477. 477///|
  478. 478/// 图像融合
  479. 479pub fn fuse_images_advanced(
  480. 480 images : Array[@types.Image],
  481. 481 config : FusionEnhancedConfig,
  482. 482) -> FusionResult {
  483. 483● let result = if config.algorithm == FusionAlgorithm::WeightedAverage {
  484. 484● fuse_weighted_average(images, config.weights)
  485. 485● } else if config.algorithm == FusionAlgorithm::Maximum {
  486. 486● fuse_maximum(images)
  487. 487● } else if config.algorithm == FusionAlgorithm::Minimum {
  488. 488● fuse_minimum(images)
  489. 489● } else if config.algorithm == FusionAlgorithm::SimpleMean {
  490. 490● fuse_simple_mean(images)
  491. 491● } else if config.algorithm == FusionAlgorithm::LaplacianPyramid {
  492. 492● fuse_laplacian_pyramid(images, config.pyramid_levels)
  493. 493 } else {
  494. 494● fuse_simple_mean(images)
  495. 495 }
  496. 496
  497. 497 FusionResult::{
  498. 498 image: result,
  499. 499 algorithm: config.algorithm,
  500. 500● num_images: images.length(),
  501. 501 processing_time_ms: 0.0,
  502. 502 fusion_quality: 0.0,
  503. 503 }
  504. 504}
  505. 505
  506. 506///|
  507. 507/// 相位相关配准(简化版)
  508. 508pub fn register_phase_correlation(
  509. 509 reference : @types.Image,
  510. 510 target : @types.Image,
  511. 511) -> RegistrationResult {
  512. 512 // 简化:计算平移量
  513. 513● let w = reference.width
  514. 514 let h = reference.height
  515. 515 let mut best_x = 0
  516. 516 let mut best_y = 0
  517. 517 let mut best_similarity = 0.0
  518. 518
  519. 519 for dy in -10..<11 {
  520. 520● for dx in -10..<11 {
  521. 521● let mut similarity = 0.0
  522. 522 let mut count = 0
  523. 523 for y in 0..<h {
  524. 524● for x in 0..<w {
  525. 525● let tx = x + dx
  526. 526 let ty = y + dy
  527. 527 if tx >= 0 && tx < w && ty >= 0 && ty < h {
  528. 528● let p1 = reference.data[y * w + x].to_double()
  529. 529● let p2 = target.data[ty * w + tx].to_double()
  530. 530● let diff = (p1 - p2).abs()
  531. 531 similarity += 1.0 - diff / 255.0
  532. 532 count += 1
  533. 533 }
  534. 534 }
  535. 535 }
  536. 536 if count > 0 {
  537. 537● similarity /= count.to_double()
  538. 538 if similarity > best_similarity {
  539. 539● best_similarity = similarity
  540. 540 best_x = dx
  541. 541 best_y = dy
  542. 542 }
  543. 543 }
  544. 544 }
  545. 545 }
  546. 546
  547. 547 RegistrationResult::{
  548. 548 image: target,
  549. 549 algorithm: RegistrationAlgorithm::PhaseCorrelation,
  550. 550● translation_x: best_x.to_double(),
  551. 551● translation_y: best_y.to_double(),
  552. 552 rotation_angle: 0.0,
  553. 553 scale_factor: 1.0,
  554. 554 similarity: best_similarity,
  555. 555 processing_time_ms: 0.0,
  556. 556 }
  557. 557}
  558. 558
  559. 559///|
  560. 560/// 图像配准
  561. 561pub fn register_images_advanced(
  562. 562 reference : @types.Image,
  563. 563 target : @types.Image,
  564. 564 config : RegistrationAdvancedConfig,
  565. 565) -> RegistrationResult {
  566. 566● if config.algorithm == RegistrationAlgorithm::PhaseCorrelation {
  567. 567● register_phase_correlation(reference, target)
  568. 568 } else {
  569. 569● register_phase_correlation(reference, target)
  570. 570 }
  571. 571}
  572. 572
  573. 573///|
  574. 574/// 应用变换(平移)
  575. 575pub fn apply_translation(
  576. 576 img : @types.Image,
  577. 577 dx : Int32,
  578. 578 dy : Int32,
  579. 579) -> @types.Image {
  580. 580● let w = img.width
  581. 581 let h = img.height
  582. 582 let out : Array[Byte] = []
  583. 583
  584. 584 for y in 0..<h {
  585. 585● for x in 0..<w {
  586. 586● let src_x = x - dx
  587. 587 let src_y = y - dy
  588. 588 if src_x >= 0 && src_x < w && src_y >= 0 && src_y < h {
  589. 589● out.push(img.data[src_y * w + src_x])
  590. 590 } else {
  591. 591● out.push(b'\x00')
  592. 592 }
  593. 593 }
  594. 594 }
  595. 595
  596. 596 @types.Image::{
  597. 597 width: w,
  598. 598 height: h,
  599. 599 channels: img.channels,
  600. 600● data: Bytes::from_array(out),
  601. 601 }
  602. 602}
  603. 603
  604. 604///|
  605. 605/// 计算融合质量(空间频率)
  606. 606pub fn calculate_fusion_quality(fused : @types.Image) -> Double {
  607. 607● let w = fused.width
  608. 608 let h = fused.height
  609. 609 let mut sf = 0.0
  610. 610
  611. 611 for y in 0..<h {
  612. 612● for x in 0..<(w - 1) {
  613. 613● let diff = fused.data[y * w + x + 1].to_double() -
  614. 614● fused.data[y * w + x].to_double()
  615. 615 sf += diff * diff
  616. 616 }
  617. 617 }
  618. 618
  619. 619 for y in 0..<(h - 1) {
  620. 620● for x in 0..<w {
  621. 621● let diff = fused.data[(y + 1) * w + x].to_double() -
  622. 622● fused.data[y * w + x].to_double()
  623. 623 sf += diff * diff
  624. 624 }
  625. 625 }
  626. 626
  627. 627● sf / (w * h).to_double()
  628. 628}
  629. 629
  630. 630///|
  631. 631/// 生成融合报告
  632. 632pub fn fusion_report_to_string(
  633. 633 result : FusionResult,
  634. 634 quality : Double,
  635. 635) -> String {
  636. 636● let mut report = "## 图像融合报告\n\n"
  637. 637 report = report + "### 处理信息\n\n"
  638. 638 report = report + "| 指标 | 值 |\n|------|------|\n"
  639. 639 let algo_str = if result.algorithm == FusionAlgorithm::WeightedAverage {
  640. 640● "加权平均"
  641. 641● } else if result.algorithm == FusionAlgorithm::LaplacianPyramid {
  642. 642● "拉普拉斯金字塔"
  643. 643● } else if result.algorithm == FusionAlgorithm::GaussianPyramid {
  644. 644● "高斯金字塔"
  645. 645● } else if result.algorithm == FusionAlgorithm::Wavelet {
  646. 646● "小波变换"
  647. 647● } else if result.algorithm == FusionAlgorithm::PCA {
  648. 648● "PCA"
  649. 649● } else if result.algorithm == FusionAlgorithm::IHS {
  650. 650● "IHS"
  651. 651● } else if result.algorithm == FusionAlgorithm::Brovey {
  652. 652● "Brovey"
  653. 653● } else if result.algorithm == FusionAlgorithm::SimpleMean {
  654. 654● "简单均值"
  655. 655● } else if result.algorithm == FusionAlgorithm::Maximum {
  656. 656● "最大值"
  657. 657● } else if result.algorithm == FusionAlgorithm::Minimum {
  658. 658● "最小值"
  659. 659 } else {
  660. 660● "未知"
  661. 661 }
  662. 662 report = report + "| 算法 | " + algo_str + " |\n"
  663. 663 report = report +
  664. 664 "| 融合图像数 | " +
  665. 665● result.num_images.to_string() +
  666. 666 " |\n"
  667. 667 report = report +
  668. 668 "| 处理耗时 | " +
  669. 669● result.processing_time_ms.to_string() +
  670. 670 "ms |\n"
  671. 671 report = report +
  672. 672 "| 融合质量(空间频率) | " +
  673. 673● quality.to_string() +
  674. 674 " |\n"
  675. 675
  676. 676 report
  677. 677}