2021-03-07 12:46:25 +01:00
|
|
|
/**********************************************************************
|
2022-03-20 20:56:32 +01:00
|
|
|
* This file is used for testing random stuff without running the
|
2021-03-07 12:46:25 +01:00
|
|
|
* whole of SatDump, which comes in handy for debugging individual
|
|
|
|
|
* elements before putting them all together in modules...
|
2022-03-20 20:56:32 +01:00
|
|
|
*
|
|
|
|
|
* If you are an user, ignore this file which will not be built by
|
2021-05-12 21:16:53 +02:00
|
|
|
* default, and if you're a developper in need of doing stuff here...
|
2021-03-07 12:46:25 +01:00
|
|
|
* Go ahead!
|
2022-03-20 20:56:32 +01:00
|
|
|
*
|
2021-03-07 12:46:25 +01:00
|
|
|
* Don't judge the code you might see in there! :)
|
|
|
|
|
**********************************************************************/
|
|
|
|
|
|
2022-03-28 11:51:13 +02:00
|
|
|
#include "logger.h"
|
2022-09-29 23:00:32 +02:00
|
|
|
#include "common/image/image.h"
|
|
|
|
|
#include "common/projection/thinplatespline.h"
|
|
|
|
|
#include "common/image/histogram_utils.h"
|
2022-09-12 22:23:41 +02:00
|
|
|
|
2022-09-29 23:00:32 +02:00
|
|
|
#if 0
|
|
|
|
|
image::Image<uint8_t> make_hist_img(std::vector<int> hist)
|
2022-05-11 23:46:39 +02:00
|
|
|
{
|
2022-09-29 23:00:32 +02:00
|
|
|
image::Image<uint8_t> hist_img(hist.size(), 4096, 3);
|
|
|
|
|
uint8_t color[] = {255, 255, 255};
|
|
|
|
|
for (int i = 0; i < hist.size(); i++)
|
2022-09-29 00:46:17 +02:00
|
|
|
{
|
2022-09-29 23:00:32 +02:00
|
|
|
hist_img.draw_line(i, 0, i, hist[i], color);
|
2022-08-21 12:38:22 +02:00
|
|
|
}
|
2022-09-29 23:00:32 +02:00
|
|
|
// std::vector<int> all_values;
|
|
|
|
|
// for (int i = 0;)
|
2022-08-21 23:08:02 +02:00
|
|
|
|
2022-09-29 23:00:32 +02:00
|
|
|
hist_img.mirror(false, true);
|
|
|
|
|
// hist_img.resize_bilinear(1000, 500);
|
|
|
|
|
return hist_img;
|
|
|
|
|
}
|
2022-08-21 23:08:02 +02:00
|
|
|
#endif
|
|
|
|
|
|
2022-09-29 23:00:32 +02:00
|
|
|
int main(int /*argc*/, char *argv[])
|
|
|
|
|
{
|
|
|
|
|
initLogger();
|
2022-10-02 20:41:25 +02:00
|
|
|
|
|
|
|
|
image::Image<uint16_t> img1, img2, img_final;
|
|
|
|
|
|
|
|
|
|
img1.load_img(argv[1]);
|
|
|
|
|
img2.load_img(argv[2]);
|
|
|
|
|
|
|
|
|
|
img_final.init(img1.width() * 2, img1.height(), 1);
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < img_final.width(); i += 2)
|
|
|
|
|
{
|
|
|
|
|
for (int y = 0; y < img_final.height(); y++)
|
|
|
|
|
{
|
|
|
|
|
img_final[y * img_final.width() + i + 0] = img1[y * img1.width() + i / 2];
|
|
|
|
|
img_final[y * img_final.width() + i + 1] = img2[y * img2.width() + i / 2];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
img_final.save_img(argv[3]);
|
2022-08-14 18:17:22 +02:00
|
|
|
}
|