MCPcopy Create free account
hub / github.com/creatale/node-dv / Scale

Method Scale

deps/tesseract/cube/char_samp.cpp:247–263  ·  view source on GitHub ↗

returns a copy of the charsamp that is scaled to the specified width and height

Source from the content-addressed store, hash-verified

245// returns a copy of the charsamp that is scaled to the
246// specified width and height
247CharSamp *CharSamp::Scale(int wid, int hgt, bool isotropic) {
248 CharSamp *scaled_samp = new CharSamp(wid, hgt);
249 if (scaled_samp->ScaleFrom(this, isotropic) == false) {
250 delete scaled_samp;
251 return NULL;
252 }
253 scaled_samp->left_ = left_;
254 scaled_samp->top_ = top_;
255 scaled_samp->page_ = page_;
256 scaled_samp->SetLabel(label32_);
257 scaled_samp->first_char_ = first_char_;
258 scaled_samp->last_char_ = last_char_;
259 scaled_samp->norm_top_ = norm_top_;
260 scaled_samp->norm_bottom_ = norm_bottom_;
261 scaled_samp->norm_aspect_ratio_ = norm_aspect_ratio_;
262 return scaled_samp;
263}
264
265// Load a Char Samp from a dump file
266CharSamp *CharSamp::FromRawData(int left, int top, int wid, int hgt,

Callers 2

NormalizeMethod · 0.45
ComputeFeatureBitmapMethod · 0.45

Calls 2

ScaleFromMethod · 0.80
SetLabelMethod · 0.45

Tested by

no test coverage detected