00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <stdio.h>
00023 #include <stdlib.h>
00024 #include <string.h>
00025 #include <flgrCoreData.h>
00026 #include <flgrCoreNhbManage.h>
00027 #include <flgrCoreDispatch.h>
00028 #include <flgrCoreSlideWindow.h>
00029 #include <flgrMorphoKerOp.h>
00030 #include "flgrMorphoHoM.h"
00031
00038 void flgr2d_hit_or_miss_fgBIT(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00039 flgr_no_define_type_function(FLGR_BIT);
00040 }
00041 void flgr2d_hit_or_miss_fgUINT8(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00042
00043 flgr2d_raster_slide_window_fgUINT8(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_hit_or_miss_fgUINT8);
00044 }
00045 void flgr2d_hit_or_miss_fgUINT16(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00046
00047 flgr2d_raster_slide_window_fgUINT16(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_hit_or_miss_fgUINT16);
00048 }
00049 void flgr2d_hit_or_miss_fgUINT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00050
00051 flgr2d_raster_slide_window_fgUINT32(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_hit_or_miss_fgUINT32);
00052 }
00053 void flgr2d_hit_or_miss_fgINT8(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00054
00055 flgr2d_raster_slide_window_fgINT8(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_hit_or_miss_fgINT8);
00056 }
00057 void flgr2d_hit_or_miss_fgINT16(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00058
00059 flgr2d_raster_slide_window_fgINT16(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_hit_or_miss_fgINT16);
00060 }
00061 void flgr2d_hit_or_miss_fgINT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00062
00063 flgr2d_raster_slide_window_fgINT32(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_hit_or_miss_fgINT32);
00064 }
00065 void flgr2d_hit_or_miss_fgFLOAT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00066
00067 flgr2d_raster_slide_window_fgFLOAT32(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_hit_or_miss_fgFLOAT32);
00068 }
00069 void flgr2d_hit_or_miss_fgFLOAT64(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00070
00071 flgr2d_raster_slide_window_fgFLOAT64(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_hit_or_miss_fgFLOAT64);
00072 }
00073
00075
00081
00082 FLGR_Ret flgr2d_hit_or_miss(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00083 FLGR_Ret ret;
00084
00085
00086
00087 if((imgdest==NULL) || (imgsrc==NULL) ||(nhb==NULL)){
00088 POST_ERROR("Null objects!\n");
00089 return FLGR_RET_NULL_OBJECT;
00090 }
00091
00092 if((ret=flgr2d_is_data_same_attributes(imgdest,imgsrc,__FUNCTION__))!=FLGR_RET_OK) return ret;
00093 if((ret=flgr2d_is_data_same_type(imgdest,nhb))!=FLGR_RET_OK) return ret;
00094
00095
00096 FLGR_DISPATCH_PROCEDURE(imgdest->type,flgr2d_hit_or_miss,imgdest,imgsrc,nhb);
00097
00098 }
00099
00100
00101
00102
00103 void flgr2d_thinning_fgBIT(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00104 flgr_no_define_type_function(FLGR_BIT);
00105 }
00106 void flgr2d_thinning_fgUINT8(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00107
00108 flgr2d_raster_slide_window_fgUINT8(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_thinning_fgUINT8);
00109 }
00110 void flgr2d_thinning_fgUINT16(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00111
00112 flgr2d_raster_slide_window_fgUINT16(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_thinning_fgUINT16);
00113 }
00114 void flgr2d_thinning_fgUINT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00115
00116 flgr2d_raster_slide_window_fgUINT32(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_thinning_fgUINT32);
00117 }
00118 void flgr2d_thinning_fgINT8(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00119
00120 flgr2d_raster_slide_window_fgINT8(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_thinning_fgINT8);
00121 }
00122 void flgr2d_thinning_fgINT16(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00123
00124 flgr2d_raster_slide_window_fgINT16(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_thinning_fgINT16);
00125 }
00126 void flgr2d_thinning_fgINT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00127
00128 flgr2d_raster_slide_window_fgINT32(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_thinning_fgINT32);
00129 }
00130 void flgr2d_thinning_fgFLOAT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00131
00132 flgr2d_raster_slide_window_fgFLOAT32(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_thinning_fgFLOAT32);
00133 }
00134 void flgr2d_thinning_fgFLOAT64(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00135
00136 flgr2d_raster_slide_window_fgFLOAT64(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_thinning_fgFLOAT64);
00137 }
00138
00139
00141
00147
00148 FLGR_Ret flgr2d_thinning(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00149 FLGR_Ret ret;
00150
00151
00152
00153 if((imgdest==NULL) || (imgsrc==NULL) ||(nhb==NULL)){
00154 POST_ERROR("Null objects!\n");
00155 return FLGR_RET_NULL_OBJECT;
00156 }
00157
00158 if((ret=flgr2d_is_data_same_attributes(imgdest,imgsrc,__FUNCTION__))!=FLGR_RET_OK) return ret;
00159 if((ret=flgr2d_is_data_same_type(imgdest,nhb))!=FLGR_RET_OK) return ret;
00160
00161 FLGR_DISPATCH_PROCEDURE(imgdest->type,flgr2d_thinning,imgdest,imgsrc,nhb);
00162
00163 }
00164
00165
00166
00167
00168
00169
00170 void flgr2d_thickening_fgBIT(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00171 flgr_no_define_type_function(FLGR_BIT);
00172 }
00173 void flgr2d_thickening_fgUINT8(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00174
00175 flgr2d_raster_slide_window_fgUINT8(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_thickening_fgUINT8);
00176 }
00177 void flgr2d_thickening_fgUINT16(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00178
00179 flgr2d_raster_slide_window_fgUINT16(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_thickening_fgUINT16);
00180 }
00181 void flgr2d_thickening_fgUINT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00182
00183 flgr2d_raster_slide_window_fgUINT32(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_thickening_fgUINT32);
00184 }
00185 void flgr2d_thickening_fgINT8(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00186
00187 flgr2d_raster_slide_window_fgINT8(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_thickening_fgINT8);
00188 }
00189 void flgr2d_thickening_fgINT16(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00190
00191 flgr2d_raster_slide_window_fgINT16(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_thickening_fgINT16);
00192 }
00193 void flgr2d_thickening_fgINT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00194
00195 flgr2d_raster_slide_window_fgINT32(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_thickening_fgINT32);
00196 }
00197 void flgr2d_thickening_fgFLOAT32(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00198
00199 flgr2d_raster_slide_window_fgFLOAT32(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_thickening_fgFLOAT32);
00200 }
00201 void flgr2d_thickening_fgFLOAT64(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00202
00203 flgr2d_raster_slide_window_fgFLOAT64(imgdest, imgsrc, nhb, FLGR_NHB_NO_SYM, flgr2d_get_nhb_thickening_fgFLOAT64);
00204 }
00205
00206
00208
00214
00215 FLGR_Ret flgr2d_thickening(FLGR_Data2D *imgdest, FLGR_Data2D *imgsrc, FLGR_Data2D *nhb) {
00216 FLGR_Ret ret;
00217
00218
00219
00220 if((imgdest==NULL) || (imgsrc==NULL) ||(nhb==NULL)){
00221 POST_ERROR("Null objects!\n");
00222 return FLGR_RET_NULL_OBJECT;
00223 }
00224
00225 if((ret=flgr2d_is_data_same_attributes(imgdest,imgsrc,__FUNCTION__))!=FLGR_RET_OK) return ret;
00226 if((ret=flgr2d_is_data_same_type(imgdest,nhb))!=FLGR_RET_OK) return ret;
00227
00228 FLGR_DISPATCH_PROCEDURE(imgdest->type,flgr2d_thickening,imgdest,imgsrc,nhb);
00229
00230 }
00231
00232
00233
00234