test_photo.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. // //////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
  4. //
  5. // By downloading, copying, installing or using the software you agree to this license.
  6. // If you do not agree to this license, do not download, install,
  7. // copy or use the software.
  8. //
  9. //
  10. // License Agreement
  11. // For Open Source Computer Vision Library
  12. //
  13. // Copyright (C) 2013, OpenCV Foundation, all rights reserved.
  14. // Third party copyrights are property of their respective owners.
  15. //
  16. // Redistribution and use in source and binary forms, with or without modification,
  17. // are permitted provided that the following conditions are met:
  18. //
  19. // * Redistribution's of source code must retain the above copyright notice,
  20. // this list of conditions and the following disclaimer.
  21. //
  22. // * Redistribution's in binary form must reproduce the above copyright notice,
  23. // this list of conditions and the following disclaimer in the documentation
  24. // and/or other materials provided with the distribution.
  25. //
  26. // * The name of the copyright holders may not be used to endorse or promote products
  27. // derived from this software without specific prior written permission.
  28. //
  29. // This software is provided by the copyright holders and contributors "as is" and
  30. // any express or implied warranties, including, but not limited to, the implied
  31. // warranties of merchantability and fitness for a particular purpose are disclaimed.
  32. // In no event shall the Intel Corporation or contributors be liable for any direct,
  33. // indirect, incidental, special, exemplary, or consequential damages
  34. // (including, but not limited to, procurement of substitute goods or services;
  35. // loss of use, data, or profits; or business interruption) however caused
  36. // and on any theory of liability, whether in contract, strict liability,
  37. // or tort (including negligence or otherwise) arising in any way out of
  38. // the use of this software, even if advised of the possibility of such damage.
  39. //
  40. // Author : Rijubrata Bhaumik, Intel Corporation. rijubrata.bhaumik[at]intel[dot]com
  41. QUnit.module('Photo', {});
  42. QUnit.test('test_photo', function(assert) {
  43. // CalibrateDebevec
  44. {
  45. let calibration = new cv.CalibrateDebevec();
  46. assert.ok(true, calibration);
  47. //let response = calibration.process(images, exposures);
  48. }
  49. // CalibrateRobertson
  50. {
  51. let calibration = new cv.CalibrateRobertson();
  52. assert.ok(true, calibration);
  53. //let response = calibration.process(images, exposures);
  54. }
  55. // MergeDebevec
  56. {
  57. let merge = new cv.MergeDebevec();
  58. assert.ok(true, merge);
  59. //let hdr = merge.process(images, exposures, response);
  60. }
  61. // MergeMertens
  62. {
  63. let merge = new cv.MergeMertens();
  64. assert.ok(true, merge);
  65. //let hdr = merge.process(images, exposures, response);
  66. }
  67. // MergeRobertson
  68. {
  69. let merge = new cv.MergeRobertson();
  70. assert.ok(true, merge);
  71. //let hdr = merge.process(images, exposures, response);
  72. }
  73. // TonemapDrago
  74. {
  75. let tonemap = new cv.TonemapDrago();
  76. assert.ok(true, tonemap);
  77. // let ldr = new cv.Mat();
  78. // let retval = tonemap.process(hdr, ldr);
  79. }
  80. // TonemapMantiuk
  81. {
  82. let tonemap = new cv.TonemapMantiuk();
  83. assert.ok(true, tonemap);
  84. // let ldr = new cv.Mat();
  85. // let retval = tonemap.process(hdr, ldr);
  86. }
  87. // TonemapReinhard
  88. {
  89. let tonemap = new cv.TonemapReinhard();
  90. assert.ok(true, tonemap);
  91. // let ldr = new cv.Mat();
  92. // let retval = tonemap.process(hdr, ldr);
  93. }
  94. // Inpaint
  95. {
  96. let src = new cv.Mat(100, 100, cv.CV_8UC3, new cv.Scalar(127, 127, 127, 255));
  97. let mask = new cv.Mat(100, 100, cv.CV_8UC1, new cv.Scalar(0, 0, 0, 0));
  98. let dst = new cv.Mat();
  99. cv.line(mask, new cv.Point(10, 50), new cv.Point(90, 50), new cv.Scalar(255, 255, 255, 255),5);
  100. cv.inpaint(src, mask, dst, 3, cv.INPAINT_TELEA);
  101. assert.equal(dst.rows, 100);
  102. assert.equal(dst.cols, 100);
  103. assert.equal(dst.channels(), 3);
  104. }
  105. });