| 254 | |
| 255 | template <typename T, typename U> |
| 256 | void deserialize ( |
| 257 | scan_image_pyramid<T,U>& item, |
| 258 | std::istream& in |
| 259 | ) |
| 260 | { |
| 261 | int version = 0; |
| 262 | deserialize(version, in); |
| 263 | if (version != 3) |
| 264 | throw serialization_error("Unsupported version found when deserializing a scan_image_pyramid object."); |
| 265 | |
| 266 | deserialize(item.feats_config, in); |
| 267 | deserialize(item.feats, in); |
| 268 | deserialize(item.det_templates, in); |
| 269 | deserialize(item.max_dets_per_template, in); |
| 270 | deserialize(item.max_pyramid_levels, in); |
| 271 | deserialize(item.min_pyramid_layer_width, in); |
| 272 | deserialize(item.min_pyramid_layer_height, in); |
| 273 | |
| 274 | // When developing some feature extractor, it's easy to accidentally change its |
| 275 | // number of dimensions and then try to deserialize data from an older version of |
| 276 | // your extractor into the current code. This check is here to catch that kind of |
| 277 | // user error. |
| 278 | long dims; |
| 279 | deserialize(dims, in); |
| 280 | if (item.get_num_dimensions() != dims) |
| 281 | throw serialization_error("Number of dimensions in serialized scan_image_pyramid doesn't match the expected number."); |
| 282 | } |
| 283 | |
| 284 | // ---------------------------------------------------------------------------------------- |
| 285 | // ---------------------------------------------------------------------------------------- |
no test coverage detected