All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
imagedata.cpp
Go to the documentation of this file.
1 // File: imagedata.h
3 // Description: Class to hold information about a single multi-page tiff
4 // training file and its corresponding boxes or text file.
5 // Author: Ray Smith
6 // Created: Tue May 28 08:56:06 PST 2013
7 //
8 // (C) Copyright 2013, Google Inc.
9 // Licensed under the Apache License, Version 2.0 (the "License");
10 // you may not use this file except in compliance with the License.
11 // You may obtain a copy of the License at
12 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 
20 
21 #include "imagedata.h"
22 
23 #include "allheaders.h"
24 #include "boxread.h"
25 #include "callcpp.h"
26 #include "helpers.h"
27 #include "tprintf.h"
28 
29 namespace tesseract {
30 
31 WordFeature::WordFeature() : x_(0), y_(0), dir_(0) {
32 }
33 
35  : x_(IntCastRounded(fcoord.x())),
36  y_(ClipToRange(IntCastRounded(fcoord.y()), 0, MAX_UINT8)),
37  dir_(dir) {
38 }
39 
40 // Computes the maximum x and y value in the features.
42  int* max_x, int* max_y) {
43  *max_x = 0;
44  *max_y = 0;
45  for (int f = 0; f < features.size(); ++f) {
46  if (features[f].x_ > *max_x) *max_x = features[f].x_;
47  if (features[f].y_ > *max_y) *max_y = features[f].y_;
48  }
49 }
50 
51 // Draws the features in the given window.
53  ScrollView* window) {
54 #ifndef GRAPHICS_DISABLED
55  for (int f = 0; f < features.size(); ++f) {
56  FCOORD pos(features[f].x_, features[f].y_);
57  FCOORD dir;
58  dir.from_direction(features[f].dir_);
59  dir *= 8.0f;
60  window->SetCursor(IntCastRounded(pos.x() - dir.x()),
61  IntCastRounded(pos.y() - dir.y()));
62  window->DrawTo(IntCastRounded(pos.x() + dir.x()),
63  IntCastRounded(pos.y() + dir.y()));
64  }
65 #endif
66 }
67 
68 // Writes to the given file. Returns false in case of error.
69 bool WordFeature::Serialize(FILE* fp) const {
70  if (fwrite(&x_, sizeof(x_), 1, fp) != 1) return false;
71  if (fwrite(&y_, sizeof(y_), 1, fp) != 1) return false;
72  if (fwrite(&dir_, sizeof(dir_), 1, fp) != 1) return false;
73  return true;
74 }
75 // Reads from the given file. Returns false in case of error.
76 // If swap is true, assumes a big/little-endian swap is needed.
77 bool WordFeature::DeSerialize(bool swap, FILE* fp) {
78  if (fread(&x_, sizeof(x_), 1, fp) != 1) return false;
79  if (swap) ReverseN(&x_, sizeof(x_));
80  if (fread(&y_, sizeof(y_), 1, fp) != 1) return false;
81  if (fread(&dir_, sizeof(dir_), 1, fp) != 1) return false;
82  return true;
83 }
84 
86  const GenericVector<WordFeature>& word_features,
87  GenericVector<FloatWordFeature>* float_features) {
88  for (int i = 0; i < word_features.size(); ++i) {
90  f.x = word_features[i].x();
91  f.y = word_features[i].y();
92  f.dir = word_features[i].dir();
93  f.x_bucket = 0; // Will set it later.
94  float_features->push_back(f);
95  }
96 }
97 
98 // Sort function to sort first by x-bucket, then by y.
99 /* static */
100 int FloatWordFeature::SortByXBucket(const void* v1, const void* v2) {
101  const FloatWordFeature* f1 = reinterpret_cast<const FloatWordFeature*>(v1);
102  const FloatWordFeature* f2 = reinterpret_cast<const FloatWordFeature*>(v2);
103  int x_diff = f1->x_bucket - f2->x_bucket;
104  if (x_diff == 0) return f1->y - f2->y;
105  return x_diff;
106 }
107 
108 ImageData::ImageData() : page_number_(-1), vertical_text_(false) {
109 }
110 // Takes ownership of the pix and destroys it.
111 ImageData::ImageData(bool vertical, Pix* pix)
112  : page_number_(0), vertical_text_(vertical) {
113  SetPix(pix);
114 }
116 }
117 
118 // Builds and returns an ImageData from the basic data. Note that imagedata,
119 // truth_text, and box_text are all the actual file data, NOT filenames.
120 ImageData* ImageData::Build(const char* name, int page_number, const char* lang,
121  const char* imagedata, int imagedatasize,
122  const char* truth_text, const char* box_text) {
123  ImageData* image_data = new ImageData();
124  image_data->imagefilename_ = name;
125  image_data->page_number_ = page_number;
126  image_data->language_ = lang;
127  // Save the imagedata.
128  image_data->image_data_.init_to_size(imagedatasize, 0);
129  memcpy(&image_data->image_data_[0], imagedata, imagedatasize);
130  if (!image_data->AddBoxes(box_text)) {
131  if (truth_text == NULL || truth_text[0] == '\0') {
132  tprintf("Error: No text corresponding to page %d from image %s!\n",
133  page_number, name);
134  delete image_data;
135  return NULL;
136  }
137  image_data->transcription_ = truth_text;
138  // If we have no boxes, the transcription is in the 0th box_texts_.
139  image_data->box_texts_.push_back(truth_text);
140  // We will create a box for the whole image on PreScale, to save unpacking
141  // the image now.
142  } else if (truth_text != NULL && truth_text[0] != '\0' &&
143  image_data->transcription_ != truth_text) {
144  // Save the truth text as it is present and disagrees with the box text.
145  image_data->transcription_ = truth_text;
146  }
147  return image_data;
148 }
149 
150 // Writes to the given file. Returns false in case of error.
151 bool ImageData::Serialize(TFile* fp) const {
152  if (!imagefilename_.Serialize(fp)) return false;
153  if (fp->FWrite(&page_number_, sizeof(page_number_), 1) != 1) return false;
154  if (!image_data_.Serialize(fp)) return false;
155  if (!transcription_.Serialize(fp)) return false;
156  // WARNING: Will not work across different endian machines.
157  if (!boxes_.Serialize(fp)) return false;
158  if (!box_texts_.SerializeClasses(fp)) return false;
159  inT8 vertical = vertical_text_;
160  if (fp->FWrite(&vertical, sizeof(vertical), 1) != 1) return false;
161  return true;
162 }
163 
164 // Reads from the given file. Returns false in case of error.
165 // If swap is true, assumes a big/little-endian swap is needed.
166 bool ImageData::DeSerialize(bool swap, TFile* fp) {
167  if (!imagefilename_.DeSerialize(swap, fp)) return false;
168  if (fp->FRead(&page_number_, sizeof(page_number_), 1) != 1) return false;
169  if (swap) ReverseN(&page_number_, sizeof(page_number_));
170  if (!image_data_.DeSerialize(swap, fp)) return false;
171  if (!transcription_.DeSerialize(swap, fp)) return false;
172  // WARNING: Will not work across different endian machines.
173  if (!boxes_.DeSerialize(swap, fp)) return false;
174  if (!box_texts_.DeSerializeClasses(swap, fp)) return false;
175  inT8 vertical = 0;
176  if (fp->FRead(&vertical, sizeof(vertical), 1) != 1) return false;
177  vertical_text_ = vertical != 0;
178  return true;
179 }
180 
181 // Saves the given Pix as a PNG-encoded string and destroys it.
182 void ImageData::SetPix(Pix* pix) {
183  SetPixInternal(pix, &image_data_);
184 }
185 
186 // Returns the Pix image for *this. Must be pixDestroyed after use.
187 Pix* ImageData::GetPix() const {
188  return GetPixInternal(image_data_);
189 }
190 
191 // Gets anything and everything with a non-NULL pointer, prescaled to a
192 // given target_height (if 0, then the original image height), and aligned.
193 // Also returns (if not NULL) the width and height of the scaled image.
194 // The return value is the scale factor that was applied to the image to
195 // achieve the target_height.
196 float ImageData::PreScale(int target_height, Pix** pix,
197  int* scaled_width, int* scaled_height,
198  GenericVector<TBOX>* boxes) const {
199  int input_width = 0;
200  int input_height = 0;
201  Pix* src_pix = GetPix();
202  ASSERT_HOST(src_pix != NULL);
203  input_width = pixGetWidth(src_pix);
204  input_height = pixGetHeight(src_pix);
205  if (target_height == 0)
206  target_height = input_height;
207  float im_factor = static_cast<float>(target_height) / input_height;
208  if (scaled_width != NULL)
209  *scaled_width = IntCastRounded(im_factor * input_width);
210  if (scaled_height != NULL)
211  *scaled_height = target_height;
212  if (pix != NULL) {
213  // Get the scaled image.
214  pixDestroy(pix);
215  *pix = pixScale(src_pix, im_factor, im_factor);
216  if (*pix == NULL) {
217  tprintf("Scaling pix of size %d, %d by factor %g made null pix!!\n",
218  input_width, input_height, im_factor);
219  }
220  if (scaled_width != NULL)
221  *scaled_width = pixGetWidth(*pix);
222  if (scaled_height != NULL)
223  *scaled_height = pixGetHeight(*pix);
224  }
225  pixDestroy(&src_pix);
226  if (boxes != NULL) {
227  // Get the boxes.
228  boxes->truncate(0);
229  for (int b = 0; b < boxes_.size(); ++b) {
230  TBOX box = boxes_[b];
231  box.scale(im_factor);
232  boxes->push_back(box);
233  }
234  if (boxes->empty()) {
235  // Make a single box for the whole image.
236  TBOX box(0, 0, im_factor * input_width, target_height);
237  boxes->push_back(box);
238  }
239  }
240  return im_factor;
241 }
242 
244  return image_data_.size();
245 }
246 
247 // Draws the data in a new window.
248 void ImageData::Display() const {
249 #ifndef GRAPHICS_DISABLED
250  const int kTextSize = 64;
251  // Draw the image.
252  Pix* pix = GetPix();
253  if (pix == NULL) return;
254  int width = pixGetWidth(pix);
255  int height = pixGetHeight(pix);
256  ScrollView* win = new ScrollView("Imagedata", 100, 100,
257  2 * (width + 2 * kTextSize),
258  2 * (height + 4 * kTextSize),
259  width + 10, height + 3 * kTextSize, true);
260  win->Image(pix, 0, height - 1);
261  pixDestroy(&pix);
262  // Draw the boxes.
263  win->Pen(ScrollView::RED);
264  win->Brush(ScrollView::NONE);
265  win->TextAttributes("Arial", kTextSize, false, false, false);
266  for (int b = 0; b < boxes_.size(); ++b) {
267  boxes_[b].plot(win);
268  win->Text(boxes_[b].left(), height + kTextSize, box_texts_[b].string());
269  TBOX scaled(boxes_[b]);
270  scaled.scale(256.0 / height);
271  scaled.plot(win);
272  }
273  // The full transcription.
274  win->Pen(ScrollView::CYAN);
275  win->Text(0, height + kTextSize * 2, transcription_.string());
276  // Add the features.
277  win->Pen(ScrollView::GREEN);
278  win->Update();
279  window_wait(win);
280 #endif
281 }
282 
283 // Adds the supplied boxes and transcriptions that correspond to the correct
284 // page number.
286  const GenericVector<STRING>& texts,
287  const GenericVector<int>& box_pages) {
288  // Copy the boxes and make the transcription.
289  for (int i = 0; i < box_pages.size(); ++i) {
290  if (page_number_ >= 0 && box_pages[i] != page_number_) continue;
291  transcription_ += texts[i];
292  boxes_.push_back(boxes[i]);
293  box_texts_.push_back(texts[i]);
294  }
295 }
296 
297 // Saves the given Pix as a PNG-encoded string and destroys it.
298 void ImageData::SetPixInternal(Pix* pix, GenericVector<char>* image_data) {
299  l_uint8* data;
300  size_t size;
301  pixWriteMem(&data, &size, pix, IFF_PNG);
302  pixDestroy(&pix);
303  image_data->init_to_size(size, 0);
304  memcpy(&(*image_data)[0], data, size);
305  free(data);
306 }
307 
308 // Returns the Pix image for the image_data. Must be pixDestroyed after use.
309 Pix* ImageData::GetPixInternal(const GenericVector<char>& image_data) {
310  Pix* pix = NULL;
311  if (!image_data.empty()) {
312  // Convert the array to an image.
313  const unsigned char* u_data =
314  reinterpret_cast<const unsigned char*>(&image_data[0]);
315  pix = pixReadMem(u_data, image_data.size());
316  }
317  return pix;
318 }
319 
320 // Parses the text string as a box file and adds any discovered boxes that
321 // match the page number. Returns false on error.
322 bool ImageData::AddBoxes(const char* box_text) {
323  if (box_text != NULL && box_text[0] != '\0') {
325  GenericVector<STRING> texts;
326  GenericVector<int> box_pages;
327  if (ReadMemBoxes(page_number_, false, box_text, &boxes,
328  &texts, NULL, &box_pages)) {
329  AddBoxes(boxes, texts, box_pages);
330  return true;
331  } else {
332  tprintf("Error: No boxes for page %d from image %s!\n",
333  page_number_, imagefilename_.string());
334  }
335  }
336  return false;
337 }
338 
340  : document_name_(name), pages_offset_(0), total_pages_(0),
341  memory_used_(0), max_memory_(0), reader_(NULL) {}
342 
344 
345 // Reads all the pages in the given lstmf filename to the cache. The reader
346 // is used to read the file.
347 bool DocumentData::LoadDocument(const char* filename, const char* lang,
348  int start_page, inT64 max_memory,
349  FileReader reader) {
350  document_name_ = filename;
351  lang_ = lang;
352  pages_offset_ = start_page;
353  max_memory_ = max_memory;
354  reader_ = reader;
355  return ReCachePages();
356 }
357 
358 // Writes all the pages to the given filename. Returns false on error.
359 bool DocumentData::SaveDocument(const char* filename, FileWriter writer) {
360  TFile fp;
361  fp.OpenWrite(NULL);
362  if (!pages_.Serialize(&fp) || !fp.CloseWrite(filename, writer)) {
363  tprintf("Serialize failed: %s\n", filename);
364  return false;
365  }
366  return true;
367 }
369  TFile fp;
370  fp.OpenWrite(buffer);
371  return pages_.Serialize(&fp);
372 }
373 
374 // Returns a pointer to the page with the given index, modulo the total
375 // number of pages, recaching if needed.
376 const ImageData* DocumentData::GetPage(int index) {
377  index = Modulo(index, total_pages_);
378  if (index < pages_offset_ || index >= pages_offset_ + pages_.size()) {
379  pages_offset_ = index;
380  if (!ReCachePages()) return NULL;
381  }
382  return pages_[index - pages_offset_];
383 }
384 
385 // Loads as many pages can fit in max_memory_ starting at index pages_offset_.
386 bool DocumentData::ReCachePages() {
387  // Read the file.
388  TFile fp;
389  if (!fp.Open(document_name_, reader_)) return false;
390  memory_used_ = 0;
391  if (!pages_.DeSerialize(false, &fp)) {
392  tprintf("Deserialize failed: %s\n", document_name_.string());
393  pages_.truncate(0);
394  return false;
395  }
396  total_pages_ = pages_.size();
397  pages_offset_ %= total_pages_;
398  // Delete pages before the first one we want, and relocate the rest.
399  int page;
400  for (page = 0; page < pages_.size(); ++page) {
401  if (page < pages_offset_) {
402  delete pages_[page];
403  pages_[page] = NULL;
404  } else {
405  ImageData* image_data = pages_[page];
406  if (max_memory_ > 0 && page > pages_offset_ &&
407  memory_used_ + image_data->MemoryUsed() > max_memory_)
408  break; // Don't go over memory quota unless the first image.
409  if (image_data->imagefilename().length() == 0) {
410  image_data->set_imagefilename(document_name_);
411  image_data->set_page_number(page);
412  }
413  image_data->set_language(lang_);
414  memory_used_ += image_data->MemoryUsed();
415  if (pages_offset_ != 0) {
416  pages_[page - pages_offset_] = image_data;
417  pages_[page] = NULL;
418  }
419  }
420  }
421  pages_.truncate(page - pages_offset_);
422  tprintf("Loaded %d/%d pages (%d-%d) of document %s\n",
423  pages_.size(), total_pages_, pages_offset_,
424  pages_offset_ + pages_.size(), document_name_.string());
425  return !pages_.empty();
426 }
427 
428 // Adds the given page data to this document, counting up memory.
430  pages_.push_back(page);
431  memory_used_ += page->MemoryUsed();
432 }
433 
434 // A collection of DocumentData that knows roughly how much memory it is using.
436  : total_pages_(0), memory_used_(0), max_memory_(max_memory) {}
438 
439 // Adds all the documents in the list of filenames, counting memory.
440 // The reader is used to read the files.
442  const char* lang, FileReader reader) {
443  inT64 fair_share_memory = max_memory_ / filenames.size();
444  for (int arg = 0; arg < filenames.size(); ++arg) {
445  STRING filename = filenames[arg];
446  DocumentData* document = new DocumentData(filename);
447  if (document->LoadDocument(filename.string(), lang, 0,
448  fair_share_memory, reader)) {
449  AddToCache(document);
450  } else {
451  tprintf("Failed to load image %s!\n", filename.string());
452  delete document;
453  }
454  }
455  tprintf("Loaded %d pages, total %gMB\n",
456  total_pages_, memory_used_ / 1048576.0);
457  return total_pages_ > 0;
458 }
459 
460 // Adds document to the cache, throwing out other documents if needed.
462  inT64 new_memory = data->memory_used();
463  memory_used_ += new_memory;
464  documents_.push_back(data);
465  total_pages_ += data->NumPages();
466  // Delete the first item in the array, and other pages of the same name
467  // while memory is full.
468  while (memory_used_ >= max_memory_ && max_memory_ > 0) {
469  tprintf("Memory used=%lld vs max=%lld, discarding doc of size %lld\n",
470  memory_used_ , max_memory_, documents_[0]->memory_used());
471  memory_used_ -= documents_[0]->memory_used();
472  total_pages_ -= documents_[0]->NumPages();
473  documents_.remove(0);
474  }
475  return true;
476 }
477 
478 // Finds and returns a document by name.
479 DocumentData* DocumentCache::FindDocument(const STRING& document_name) const {
480  for (int i = 0; i < documents_.size(); ++i) {
481  if (documents_[i]->document_name() == document_name)
482  return documents_[i];
483  }
484  return NULL;
485 }
486 
487 // Returns a page by serial number, selecting them in a round-robin fashion
488 // from all the documents.
490  int document_index = serial % documents_.size();
491  return documents_[document_index]->GetPage(serial / documents_.size());
492 }
493 
494 } // namespace tesseract.
bool DeSerialize(bool swap, FILE *fp)
Definition: strngs.cpp:163
bool DeSerialize(bool swap, FILE *fp)
Definition: imagedata.cpp:77
void Pen(Color color)
Definition: scrollview.cpp:726
int size() const
Definition: genericvector.h:72
void truncate(int size)
static ImageData * Build(const char *name, int page_number, const char *lang, const char *imagedata, int imagedatasize, const char *truth_text, const char *box_text)
Definition: imagedata.cpp:120
bool DeSerializeClasses(bool swap, FILE *fp)
bool DeSerialize(bool swap, TFile *fp)
Definition: imagedata.cpp:166
float x() const
Definition: points.h:209
int push_back(T object)
static void ComputeSize(const GenericVector< WordFeature > &features, int *max_x, int *max_y)
Definition: imagedata.cpp:41
bool(* FileWriter)(const GenericVector< char > &data, const STRING &filename)
static void Update()
Definition: scrollview.cpp:715
#define tprintf(...)
Definition: tprintf.h:31
void Text(int x, int y, const char *mystring)
Definition: scrollview.cpp:658
void DrawTo(int x, int y)
Definition: scrollview.cpp:531
int dir() const
Definition: imagedata.h:55
bool CloseWrite(const STRING &filename, FileWriter writer)
Definition: serialis.cpp:123
void TextAttributes(const char *font, int pixel_size, bool bold, bool italic, bool underlined)
Definition: scrollview.cpp:641
int MemoryUsed() const
Definition: imagedata.cpp:243
float PreScale(int target_height, Pix **pix, int *scaled_width, int *scaled_height, GenericVector< TBOX > *boxes) const
Definition: imagedata.cpp:196
void Image(struct Pix *image, int x_pos, int y_pos)
Definition: scrollview.cpp:773
bool Serialize(FILE *fp) const
int Modulo(int a, int b)
Definition: helpers.h:157
bool(* FileReader)(const STRING &filename, GenericVector< char > *data)
const ImageData * GetPageBySerial(int serial)
Definition: imagedata.cpp:489
T ClipToRange(const T &x, const T &lower_bound, const T &upper_bound)
Definition: helpers.h:115
void AddBoxes(const GenericVector< TBOX > &boxes, const GenericVector< STRING > &texts, const GenericVector< int > &box_pages)
Definition: imagedata.cpp:285
#define ASSERT_HOST(x)
Definition: errcode.h:84
int NumPages() const
Definition: imagedata.h:205
const ImageData * GetPage(int index)
Definition: imagedata.cpp:376
bool Serialize(FILE *fp) const
Definition: imagedata.cpp:69
bool SerializeClasses(FILE *fp) const
bool ReadMemBoxes(int target_page, bool skip_blanks, const char *box_data, GenericVector< TBOX > *boxes, GenericVector< STRING > *texts, GenericVector< STRING > *box_texts, GenericVector< int > *pages)
Definition: boxread.cpp:64
bool SaveDocument(const char *filename, FileWriter writer)
Definition: imagedata.cpp:359
void SetCursor(int x, int y)
Definition: scrollview.cpp:525
name_table name
bool Serialize(FILE *fp) const
Definition: strngs.cpp:148
void init_to_size(int size, T t)
bool DeSerialize(bool swap, FILE *fp)
bool Open(const STRING &filename, FileReader reader)
Definition: serialis.cpp:35
void Brush(Color color)
Definition: scrollview.cpp:732
DocumentCache(inT64 max_memory)
Definition: imagedata.cpp:435
Pix * GetPix() const
Definition: imagedata.cpp:187
#define MAX_UINT8
Definition: host.h:121
bool LoadDocuments(const GenericVector< STRING > &filenames, const char *lang, FileReader reader)
Definition: imagedata.cpp:441
void SetPix(Pix *pix)
Definition: imagedata.cpp:182
DocumentData * FindDocument(const STRING &document_name) const
Definition: imagedata.cpp:479
char window_wait(ScrollView *win)
Definition: callcpp.cpp:111
void AddPageToDocument(ImageData *page)
Definition: imagedata.cpp:429
bool empty() const
Definition: genericvector.h:84
void Display() const
Definition: imagedata.cpp:248
void ReverseN(void *ptr, int num_bytes)
Definition: helpers.h:177
int FWrite(const void *buffer, int size, int count)
Definition: serialis.cpp:131
void from_direction(uinT8 direction)
Definition: points.cpp:115
int page_number() const
Definition: imagedata.h:114
static int SortByXBucket(const void *, const void *)
Definition: imagedata.cpp:100
int IntCastRounded(double x)
Definition: helpers.h:172
Definition: rect.h:30
const GenericVector< TBOX > & boxes() const
Definition: imagedata.h:132
float y() const
Definition: points.h:212
bool AddToCache(DocumentData *data)
Definition: imagedata.cpp:461
DocumentData(const STRING &name)
Definition: imagedata.cpp:339
Definition: strngs.h:44
void OpenWrite(GenericVector< char > *data)
Definition: serialis.cpp:109
#define NULL
Definition: host.h:144
inT64 memory_used() const
Definition: imagedata.h:208
SIGNED char inT8
Definition: host.h:98
static void Draw(const GenericVector< WordFeature > &features, ScrollView *window)
Definition: imagedata.cpp:52
const GenericVector< char > & image_data() const
Definition: imagedata.h:120
const char * string() const
Definition: strngs.cpp:193
bool SaveToBuffer(GenericVector< char > *buffer)
Definition: imagedata.cpp:368
Definition: points.h:189
bool LoadDocument(const char *filename, const char *lang, int start_page, inT64 max_memory, FileReader reader)
Definition: imagedata.cpp:347
bool Serialize(TFile *fp) const
Definition: imagedata.cpp:151
void scale(const float f)
Definition: rect.h:171
int FRead(void *buffer, int size, int count)
Definition: serialis.cpp:91
static void FromWordFeatures(const GenericVector< WordFeature > &word_features, GenericVector< FloatWordFeature > *float_features)
Definition: imagedata.cpp:85
void plot(ScrollView *fd) const
Definition: rect.h:278
unsigned char uinT8
Definition: host.h:99
long long int inT64
Definition: host.h:108