X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=images%2Fsignature.h;h=204174768a83c3e0ed22a276691afe5e9d22ccb2;hb=0ca8c151f5afe1680e98f3bfbe9d5c752d8a2924;hp=52d6e2b2f1629db48b5141cb7b3093032d2a0064;hpb=c90e99fab0aeb3fd8b6b79665721611d199e1f78;p=libucw.git diff --git a/images/signature.h b/images/signature.h index 52d6e2b2..20417476 100644 --- a/images/signature.h +++ b/images/signature.h @@ -22,40 +22,39 @@ struct image_vector { byte f[IMAGE_VEC_F]; /* texture features */ } PACKED; -/* Fetures for image regions (16 bytes) */ +/* Features for image regions (16 bytes) */ struct image_region { byte f[IMAGE_VEC_F]; /* texture features - L, u, v, LH, HL, HH */ byte h[IMAGE_REG_H]; /* shape/pos features - I1, I2, I3, X, Y */ byte wa; /* normalized area percentage */ byte wb; /* normalized weight */ - u16 reserved; -} PACKED; +}; #define IMAGE_SIG_TEXTURED 0x1 -/* Image signature (11 + len * 16 bytes) */ +/* Image signature (usually 16 + len * 16 bytes) */ struct image_signature { - byte len; /* Number of regions */ + byte len; /* number of regions */ byte flags; /* IMAGE_SIG_xxx */ - u32 cols; /* Image width */ - u32 rows; /* Image height */ - u16 df; /* Average weighted f dist */ - u16 dh; /* Average weighted h dist */ - struct image_vector vec; /* Average features of all regions... simple signature */ - struct image_region reg[IMAGE_REG_MAX];/* Feature vector for every region */ -} PACKED; + u16 cols; /* image width */ + u16 rows; /* image height */ + u16 df; /* average weighted f dist */ + u16 dh; /* average weighted h dist */ + struct image_vector vec; /* average features of all regions... simple signature */ + struct image_region reg[IMAGE_REG_MAX];/* feature vector for every region */ +}; struct image_cluster { union { struct { - s32 dot; /* Dot product of the splitting plane */ - s8 vec[IMAGE_VEC_F]; /* Normal vector of the splitting plane */ - } PACKED; + s32 dot; /* dot product of the splitting plane */ + s8 vec[IMAGE_VEC_F]; /* normal vector of the splitting plane */ + }; struct { - u64 pos; /* Cluster size in bytes */ - } PACKED; - } PACKED; -} PACKED; + u64 pos; /* cluster size in bytes */ + }; + }; +}; static inline uns image_signature_size(uns len) @@ -107,9 +106,9 @@ struct image_sig_data { /* sig-init.c */ -int compute_image_signature(struct image_thread *thread, struct image_signature *sig, struct image *image); +int compute_image_signature(struct image_context *ctx, struct image_signature *sig, struct image *image); -int image_sig_init(struct image_thread *thread, struct image_sig_data *data, struct image *image); +int image_sig_init(struct image_context *ctx, struct image_sig_data *data, struct image *image); void image_sig_preprocess(struct image_sig_data *data); void image_sig_finish(struct image_sig_data *data, struct image_signature *sig); void image_sig_cleanup(struct image_sig_data *data);