summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/mser/src/c/mser.h
blob: 8876311a2fe6bb3f68018bf2ca8dce489e428636 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/********************************
Author: Sravanthi Kota Venkata
********************************/

#ifndef _MSER_
#define _MSER_

#define sref(a,i) a->data[i]

#include "sdvbs_common.h"
#define NMER_MAX 756

typedef int val_t;

typedef struct
{
    int width;
    int data[];
}iArray;

typedef struct
{
    int width;
    unsigned int data[];
}uiArray;

typedef struct
{
    int width;
    long long int unsigned data[];
}ulliArray;

#define MIN(a,b) (a<b)?a:b
#define MAX(a,b) (a>b)?a:b

typedef int  unsigned idx_t ;
typedef long long int unsigned acc_t ;

/* pairs are used to sort the pixels */
typedef struct 
{
  val_t value ; 
  idx_t  index ;
} pair_t ;

/* forest node */
typedef struct
{
  idx_t parent ;   /**< parent pixel         */
  idx_t shortcut ; /**< shortcut to the root */
  idx_t region ;   /**< index of the region  */
  int   area ;     /**< area of the region   */
#ifdef USE_RANK_UNION
  int   height ;    /**< node height         */
#endif
} node_t ;

/* extremal regions */
typedef struct
{
  idx_t parent ;     /**< parent region                           */
  idx_t index ;      /**< index of root pixel                     */
  val_t value ;      /**< value of root pixel                     */
  int   area ;       /**< area of the region                      */
  int   area_top ;   /**< area of the region DELTA levels above   */
  int   area_bot  ;  /**< area of the region DELTA levels below   */
  float variation ;  /**< variation                               */
  int   maxstable ;  /**< max stable number (=0 if not maxstable) */
} region_t ;

int script_mser();
I2D* mser(I2D* I, int in_delta,  
          iArray* subs_pt, iArray* nsubs_pt, iArray* strides_pt, iArray* visited_pt, iArray* dims, 
	  uiArray* joins_pt,
	  region_t* regions_pt, 
	  pair_t* pairs_pt,
	  node_t* forest_pt,
	  ulliArray* acc_pt, ulliArray* ell_pt,
	  I2D* out);

#endif


31 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398