|
|
|
@ -2,8 +2,10 @@
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
|
|
// #define STB_IMAGE_WRITE_IMPLEMENTATION
|
|
|
|
|
// #include <include/stb_image_write.h>
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
|
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
|
|
|
|
#include <include/stb_image_write.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include <hdrplus_pipeline.h>
|
|
|
|
|
#include "Burst.h"
|
|
|
|
@ -37,8 +39,10 @@ public:
|
|
|
|
|
|
|
|
|
|
Halide::Runtime::Buffer<uint8_t> output_img(3, width, height);
|
|
|
|
|
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
|
std::cerr << "Black point: " << burst.GetBlackLevel() << std::endl;
|
|
|
|
|
std::cerr << "White point: " << burst.GetWhiteLevel() << std::endl;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
const WhiteBalance wb = burst.GetWhiteBalance();
|
|
|
|
|
std::cerr << "RGGB: " << wb.r << " " << wb.g0 << " " << wb.g1 << " " << wb.b
|
|
|
|
@ -63,7 +67,7 @@ public:
|
|
|
|
|
return output_img;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
|
static bool save_png(const std::string &dir_path, const std::string &img_name,
|
|
|
|
|
const Halide::Runtime::Buffer<uint8_t> &img) {
|
|
|
|
|
const std::string img_path = dir_path + "/" + img_name;
|
|
|
|
@ -92,6 +96,9 @@ bool doHdrPlus(const std::vector< std::vector<uint8_t> >& images, cv::Mat& mat)
|
|
|
|
|
|
|
|
|
|
Halide::Runtime::Buffer<uint8_t> outputHdr = hdr_plus.process();
|
|
|
|
|
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
|
HDRPlus::save_png("/sdcard/com.xypower.mpapp/tmp", "2.png", outputHdr);
|
|
|
|
|
#endif
|
|
|
|
|
int width = outputHdr.width();
|
|
|
|
|
int height = outputHdr.height();
|
|
|
|
|
int channels = outputHdr.channels();
|
|
|
|
|