Skip to content

Commit 196a893

Browse files
committed
Cleanup some includes/comments
1 parent 55299de commit 196a893

File tree

5 files changed

+6
-28
lines changed

5 files changed

+6
-28
lines changed

src/lib/chromatic_adaptation/color_correction.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
#include <opencv2/opencv.hpp>
55

6-
#include <iostream>
7-
86
// transforms are in adaptation_transform.h
97
// http://brucelindbloom.com/Eqn_ChromAdapt.html
108

@@ -27,10 +25,10 @@ class color_correction
2725

2826
static inline cv::Matx<float, 3, 3> get_moore_penrose_lsm(const cv::Mat& actual, const cv::Mat& desired)
2927
{
30-
// 1. TODO: make sure actual and desired dims match?
31-
// 2. the calculation is MoorePenrose least squares mapping:
32-
// in numpy, it's dot(transpose(x), pinv(transpose(y)))
33-
28+
// inspired by the python colour-science package. It's not complicated,
29+
// but I didn't know that going in.
30+
// See also:
31+
// https://en.wikipedia.org/wiki/Moore-Penrose_inverse
3432
cv::Mat x, y, z;
3533
cv::transpose(desired, x);
3634
cv::transpose(actual, y);

src/lib/cimb_translator/CimbReader.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
#include "bit_file/bitmatrix.h"
1010
#include "chromatic_adaptation/adaptation_transform.h"
1111
#include "chromatic_adaptation/color_correction.h"
12-
#include "serialize/format.h"
13-
1412
#include <opencv2/opencv.hpp>
15-
#include <iostream>
1613

1714
using namespace cimbar;
1815

src/lib/cimbar_js/cimbar_js.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ int next_frame()
6969
return 0;
7070

7171
// we generate 5x the amount of required symbol blocks -- unless everything fits in a single frame.
72-
// color blocks will contribute to this total, but only symbols used for the initial calculation.
73-
// ... this way, if the color decode is failing, we don't get "stuck" rendering a single frame.
72+
// color blocks will contribute to this total, but only symbols are used for the initial calculation.
73+
// ... this way, if the color decode is failing, it won't get "stuck" failing to read a single frame.
7474
unsigned required = _fes->blocks_required();
7575
if (required > cimbar::Config::fountain_chunks_per_frame(cimbar::Config::symbol_bits(), _legacyMode))
7676
required = required*5;

src/lib/encoder/Decoder.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,6 @@ inline unsigned Decoder::do_decode_coupled(CimbReader& reader, STREAM& ostream)
160160
return bb.flush(rss);
161161
}
162162

163-
164-
// seems like we want to take a file or img, and have an output sink
165-
// output sync could be template param?
166-
// we'd decode the full message (via bit_writer) to a temp buffer -- probably a stringstream
167-
// then we'd direct the stringstream to our sink
168-
// which would either be a filestream, or a multi-channel fountain sink
169-
170163
template <typename MAT, typename STREAM>
171164
inline unsigned Decoder::decode(const MAT& img, STREAM& ostream, bool should_preprocess, int color_correction)
172165
{
@@ -177,15 +170,7 @@ inline unsigned Decoder::decode(const MAT& img, STREAM& ostream, bool should_pre
177170
template <typename MAT, typename FOUNTAINSTREAM>
178171
inline unsigned Decoder::decode_fountain(const MAT& img, FOUNTAINSTREAM& ostream, bool should_preprocess, int color_correction)
179172
{
180-
// reader takes cimbar::Config::color_mode() ?
181173
CimbReader reader(img, _decoder, should_preprocess, color_correction);
182-
183-
// maybe give aligned_stream a callback function that can poke the CimbReader on flush()?
184-
// and then in do_decode(), after the first flush, call CimbReader::try_to_make_new_ccm(),
185-
// ... maybe a replacement for the existing updateColorCorrection()? (called in constructor, would now happen later)...
186-
// which reads the values from the image (using what the aligned_stream gave it -- if anything, and maybe the cellpositions from FloodFillDecode?)
187-
// iff we got enough data from aligned_stream to sample enough colors, try_to_make_new_ccm() pushes the updated ccm to CimbDecoder's threadlocal
188-
// if not, we use whatever we previously had in CimbDecoder's threadlocal...?
189174
aligned_stream aligner(ostream, ostream.chunk_size(), 0, std::bind(&CimbReader::update_metadata, &reader, std::placeholders::_1, std::placeholders::_2));
190175
return do_decode(reader, aligner);
191176
}

src/lib/encoder/SimpleEncoder.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
#include <optional>
1414
#include <string>
1515

16-
#include <iostream>
17-
1816
class SimpleEncoder
1917
{
2018
public:

0 commit comments

Comments
 (0)