📄 atland.hpp
字号:
// $masm\atland.hpp 1.5 milbo$ landmark information// Warning: this is raw research code -- expect it to be quite messy.//// Unused points are set to 0,0//// milbo Yeoville nov 05#if !defined(atland_hpp)#define atland_hpp#define CONF_nMaxLandmarks 100 // there are never more than this number of landmarks per shape, use this for array initialization#define CONF_nPointsXm2vts 68 // XM2VTS shapes from Surrey dataset#define CONF_nPoints76 76 // XM2VTS shapes plus 8 new eye landmarks#define CONF_nPoints84 84 // XM2VTS plus 16 new eye landmarks (8 explicit, 8 synthesize)#define CONF_nPoints88 88 // XM2VTS plus 16 new eye landmarks plus 4 neck landmarks#define CONF_nPointsBioid22 22 // BioId shapes#define CONF_nPointsBioid20 20 // BioId shapes with 2 landmarks "unused" i.e. set to 0,0 // They are unused because there is no corresponding XM2VTS landmarkstatic const int NBR_AR_POINTS = 22; // AR shapes -- 2 landmarks "unused" resulting in 20 points used internallystatic const int NBR_ROWLEY_POINTS = 4; // nbr points in shape generated by Rowley detstatic const int NBR_VIOLA_JONES_POINTS = 2; // nbr points in shape generated by VJ detstatic char *sgLegalFileTypes = "mBa"; // m=XM2VTS B=BioId a=ARtypedef enum eGlobalDetLandmarks // landmarks for points from global detector { DETECTOR_TopLeft, // global face position DETECTOR_BotRight, // global face position DETECTOR_LEye, // left eye position DETECTOR_REye // right eye position }eGlobalDetLandmarks;//-----------------------------------------------------------------------------// Landmark names (these are XM2VTS landmarks, with extra M4 landmarks on the end)#define MLTemple 0 // landmark names in internal numbering scheme#define MLJaw1 1 // left right are wrt the viewer, not the subject#define MLJaw2 2#define MLJaw3_MouthLine 3 // mouth line on jaw#define MLJaw4 4#define MLJaw5 5#define MLJaw6 6#define MTipOfChin 7#define MRJaw6 8#define MRJaw5 9#define MRJaw4 10#define MRJaw3_MouthLine 11 // mouth line on jaw#define MRJaw2 12#define MRJaw1 13#define MRTemple 14#define MROuterEyeBrow 15#define MROuterTopEyeBrow 16#define MRInnerTopEyeBrow 17#define MRInnerEyeBrow 18#define MPoint19 19#define MPoint20 20#define MLOuterEyeBrow 21#define MLOuterTopEyeBrow 22#define MLInnerTopEyeBrow 23#define MLInnerEyeBrow 24#define MPoint25 25#define MPoint26 26#define MLEyeOuter 27#define MLEyeTop 28#define MLEyeInner 29#define MLEyeBottom 30#define MLEye 31 // pupil#define MREyeOuter 32#define MREyeTop 33#define MREyeInner 34#define MREyeBottom 35#define MREye 36#define MLNoseTop 37#define MLNoseMid 38#define MLNoseBot0 39#define MLNoseBot1 40#define MNosebase 41#define MRNoseBot1 42#define MRNoseBot0 43#define MRNoseMid 44#define MRNoseTop 45#define MLNostril 46#define MRNostril 47#define MLMouthCorner 48#define MMouth49 49#define MMouth50 50#define MMouthTopOfTopLip 51#define MMouth52 52#define MMouth53 53#define MRMouthCorner 54#define MMouth55 55#define MMouth56 56#define MMouthBotOfBotLip 57#define MMouth58 58#define MMouth59 59#define MMouth60 60#define MMouthTopOfBotLip 61#define MMouth62 62#define MMouth63 63#define MMouth64 64#define MMouth65 65#define MMouthBotOfTopLip 66#define MNoseTip 67#define MLEye0 68 // extra M4 points#define MLEye1 69#define MLEye2 70#define MLEye3 71#define MLEye4 72#define MLEye5 73#define MLEye6 74#define MLEye7 75#define MREye0 76 // REye landmarks synthesized from extra M4 LEye landmarks#define MREye1 77#define MREye2 78#define MREye3 79#define MREye4 80#define MREye5 81#define MREye6 82#define MREye7 83#define MLNeckTop 84 // M6 landmarks start here#define MLNeckBottom 85#define MRNeckTop 86#define MRNeckBottom 87static const char *sgPointNames[CONF_nMaxLandmarks] = { "00_LTemple", // 0 "01_LJaw1", // 1 "02_LJaw2", // 2 "03_LJaw3", // 3 "04_LJaw4", // 4 "05_LJaw5", // 5 "06_LJaw6", // 6 "07_TipOfChin", // 7 "08_RJaw6", // 8 "09_RJaw5", // 9 "10_RJaw4", // 10 "11_RJaw3", // 11 "12_RJaw2", // 12 "13_RJaw1", // 13 "14_RTemple", // 14 "15_ROuterEyeBrow", // 15 "16_ROuterTopEyeBrow", // 16 "17_RInnerTopEyeBrow", // 17 "18_RInnerEyeBrow", // 18 "19_Point19", // 19 "20_Point20", // 20 "21_LOuterEyeBrow", // 21 "22_LOuterTopEyeBrow", // 22 "23_LInnerTopEyeBrow", // 23 "24_LInnerEyeBrow", // 24 "25_Point25", // 25 "26_Point26", // 26 "27_LEyeOuter", // 27 "28_LEyeTop", // 28 "29_LEyeInner", // 29 "30_LEyeBottom", // 30 "31_LEye", // 31 "32_REyeOuter", // 32 "33_REyeTop", // 33 "34_REyeInner", // 34 "35_REyeBottom", // 35 "36_REye", // 36 "37_LNoseTop", // 37 "38_LNoseMid", // 38 "39_LNoseBot0", // 39 "40_LNoseBot1", // 40 "41_Nosebase", // 41 "42_RNoseBot1", // 42 "43_RNoseBot0", // 43 "44_RNoseMid", // 44 "45_RNoseTop", // 45 "46_LNostril", // 46 "47_RNostril", // 47 "48_LMouthCorner", // 48 "49_Mouth49", // 49 "50_Mouth50", // 50 "51_MouthTopOfTopLip", // 51 "52_Mouth52", // 52 "53_Mouth53", // 53 "54_RMouthCorner", // 54 "55_Mouth55", // 55 "56_Mouth56", // 56 "57_MouthBotOfBotLip", // 57 "58_Mouth58", // 58 "59_Mouth59", // 59 "60_Mouth60", // 60 "61_MouthTopOfBotLip", // 61 "62_Mouth62", // 62 "63_Mouth63", // 63 "64_Mouth64", // 64 "65_Mouth65", // 65 "66_MouthBotOfTopLip", // 66 "67_NoseTip", // 67 "68_LEye0", // 68 "69_LEye1", // 69 "70_LEye2", // 70 "71_LEye3", // 71 "72_LEye4", // 72 "73_LEye5", // 73 "74_LEye6", // 74 "75_LEye7", // 75 "76_MREye0", // 76 "77_MREye1", // 77 "78_MREye2", // 78 "79_MREye3", // 79 "80_MREye4", // 80 "81_MREye5", // 81 "82_MREye6", // 82 "83_MREye7", // 83 "84_MLNeckTop", // 84 "85_MLNeckBottom", // 85 "86_MRNeckTop", // 86 "87_MRNeckBottom", // 87 "88_Point88", // 88 "89_Point89", // 89 "90_Point90", // 90 "91_Point91", // 91 "92_Point92", // 92 "93_Point93", // 93 "94_Point94", // 94 "95_Point95", // 95 "96_Point96", // 96 "97_Point97", // 97 "98_Point98", // 98 "99_Point99", // 99 };//-----------------------------------------------------------------------------// Landmark tables#define NN_BottomLeft 0 // landmark names for NBR_ROWLEY_POINTS and CONF_nPointsOpenCV#define NN_TopRight 1#define NN_LEye 2#define NN_REye 3typedef struct tLand // landmark information { unsigned Bits; // SH_ bits in atface.hpp int iPartner; // symmetrical partner point eg. left eye pupil matches right eye pupil (-1 means no partner) int iPrev, iNext; // previous and next point for pointing whisker in correct direction (-1 means iPrev=iThis-1 iNext=iThis+1) TODO need to init for CONF_nFencePosts }tLand;// By convention in the table below: iPrev and iNext are ordered so whiskers for partner landmarks// point in symmetric directions -- generally away from the center of the face, except on the// mouth and eyes where they point from/to the eye/mouth centerstatic const tLand gLandTabAll[CONF_nMaxLandmarks] = // this is ordered like XM2VTS but has extra points{FA_Beard|FA_Glasses, 14, 21, 1, // 00_LTempleFA_Beard|FA_Glasses, 13, -1, -1, // 01_LJaw1FA_Beard, 12, -1, -1, // 02_LJaw2FA_Beard, 11, -1, -1, // 03_LJaw3FA_Beard, 10, -1, -1, // 04_LJaw4FA_Beard, 9, -1, -1, // 05_LJaw5FA_Beard, 8, -1, -1, // 06_LJaw6FA_Beard, -1, -1, -1, // 07_TipOfChinFA_Beard, 6, -1, -1, // 08_RJaw6FA_Beard, 5, -1, -1, // 09_RJaw5FA_Beard, 4, -1, -1, // 10_RJaw4FA_Beard, 3, -1, -1, // 11_RJaw3FA_Beard, 2, -1, -1, // 12_RJaw2FA_Beard|FA_Glasses, 1, -1, -1, // 13_RJaw1FA_Beard|FA_Glasses, 0, -1, -1, // 14_RTempleFA_Glasses, 21, -1, -1, // 15_ROuterEyeBrowFA_Glasses, 22, -1, -1, // 16_ROuterTopEyeBrowFA_Glasses, 23, -1, -1, // 17_RInnerTopEyeBrowFA_Glasses, 24, 19, 17, // 18_RInnerEyeBrowFA_Glasses, 25, 20, 18, // 19_Point19FA_Glasses, 26, 32, 19, // 20_Point20FA_Glasses, 15, 22, 0, // 21_LOuterEyeBrowFA_Glasses, 16, 23, 21, // 22_LOuterTopEyeBrowFA_Glasses, 17, 24, 22, // 23_LInnerTopEyeBrowFA_Glasses, 18, -1, -1, // 24_LInnerEyeBrowFA_Glasses, 19, -1, -1, // 25_Point25FA_Glasses, 20, -1, -1, // 26_Point26FA_Glasses, 32, 28, 30, // 27_LEyeOuterFA_Glasses, 33, 29, 27, // 28_LEyeTopFA_Glasses, 34, 30, 28, // 29_LEyeInnerFA_Glasses, 35, 27, 29, // 30_LEyeBottomFA_Glasses, 36, 27, 29, // 31_LEyeFA_Glasses, 27, 35, 33, // 32_REyeOuterFA_Glasses, 28, -1, -1, // 33_REyeTopFA_Glasses, 29, -1, -1, // 34_REyeInnerFA_Glasses, 30, 34, 32, // 35_REyeBottomFA_Glasses, 31, 34, 32, // 36_REyeFA_Glasses, 45, -1, -1, // 37_LNoseTopFA_Glasses, 44, -1, -1, // 38_LNoseMidFA_Mustache, 43, -1, -1, // 39_LNoseBot0FA_Mustache, 42, -1, -1, // 40_LNoseBot1FA_Mustache, -1, 40, 42, // 41_NosebaseFA_Mustache, 40, -1, -1, // 42_RNoseBot1FA_Mustache, 39, -1, -1, // 43_RNoseBot0FA_Glasses, 38, -1, -1, // 44_MRNoseMidFA_Glasses, 37, 44, 31, // 45_RNoseTopFA_Mustache, 47, -1, -1, // 46_LNostrilFA_Mustache, 46, 46, 37, // 47_RNostrilFA_Mustache, 54, 57, 51, // 48_LMouthCornerFA_Mustache, 53, -1, -1, // 49_Mouth49FA_Mustache, 52, -1, -1, // 50_Mouth50FA_Mustache, -1, -1, -1, // 51_MouthTopOfTopLipFA_Mustache, 50, -1, -1, // 52_Mouth52FA_Mustache, 49, -1, -1, // 53_Mouth53FA_Mustache, 48, 51, 57, // 54_RMouthCorner0, 59, -1, -1, // 55_Mouth550, 58, -1, -1, // 56_Mouth560, -1, -1, -1, // 57_MouthBotOfBotLip0, 56, -1, -1, // 58_Mouth580, 55, 58, 48, // 59_Mouth590, 62, 61, 59, // 60_Mouth600, -1, 62, 60, // 61_Mouth610, 60, 55, 61, // 62_Mouth620, 65, 48, 54, // 63_Mouth630, -1, 65, 63, // 64_Mouth640, 63, 48, 54, // 65_Mouth650, -1, 54, 48, // 66_MouthBotOfTopLip0, -1, 48, 54, // 67_NoseTipFA_Synthesize|FA_Glasses, 76, 0, 14, // 68_LEye0 Extra M4 landmarks (also used for experimental CONF_nFencePosts landmarks)FA_Synthesize|FA_Glasses, 77, 0, 14, // 69_LEye1 Whisker directions chosen so that we don't need to mirror 1D profilesFA_Synthesize|FA_Glasses, 78, 0, 14, // 70_LEye2 TODO For a picture see BothEyesWithNewLandmarksAndWhiskers.jpgFA_Synthesize|FA_Glasses, 79, 14, 7, // 71_LEye3 cf masm.cpp:MirrorProf()FA_Synthesize|FA_Glasses, 80, 0, 14, // 72_LEye4FA_Synthesize|FA_Glasses, 81, 0, 14, // 73_LEye5FA_Synthesize|FA_Glasses, 82, 23, 7, // 74_LEye6FA_Synthesize|FA_Glasses, 83, 23, 7, // 75_LEye7FA_Synthesize|FA_Glasses, 68, 0, 14, // 76_REye0 REye landmarks synthesized from extra M4 LEye landmarksFA_Synthesize|FA_Glasses, 69, 0, 14, // 77_REye1FA_Synthesize|FA_Glasses, 70, 0, 14, // 78_REye2FA_Synthesize|FA_Glasses, 71, 0, 7, // 79_REye3FA_Synthesize|FA_Glasses, 72, 0, 14, // 80_REye4FA_Synthesize|FA_Glasses, 73, 0, 14, // 81_REye5FA_Synthesize|FA_Glasses, 74, 17, 7, // 82_REye6FA_Synthesize|FA_Glasses, 75, 17, 7, // 83_REye7FA_Beard, 86, 86, 85, // 84_MLNeckTopFA_Beard, 87, 84, 87, // 85_MLNeckBottomFA_Beard, 84, 84, 87, // 86_MRNeckTopFA_Beard, 85, 86, 85, // 87_MRNeckBottom0, -1, -1, -1, // 88_Point880, -1, -1, -1, // 89_Point890, -1, -1, -1, // 90_Point900, -1, -1, -1, // 91_Point910, -1, -1, -1, // 92_Point920, -1, -1, -1, // 93_Point930, -1, -1, -1, // 94_Point940, -1, -1, -1, // 95_Point950, -1, -1, -1, // 96_Point960, -1, -1, -1, // 97_Point970, -1, -1, -1, // 98_Point980, -1, -1, -1, // 99_Point99};// Translation tables translate a landmark in a shape file to internal landmark// The igTransM6 table is used as a universal common denominatorstatic const int igTransM6[CONF_nMaxLandmarks] = // null translation{0, // 00_LTemple1, // 01_LJaw12, // 02_LJaw23, // 03_LJaw34, // 04_LJaw45, // 05_LJaw56, // 06_LJaw67, // 07_TipOfChin8, // 08_RJaw69, // 09_RJaw510, // 10_RJaw411, // 11_RJaw312, // 12_RJaw213, // 13_RJaw114, // 14_RTemple15, // 15_ROuterEyeBrow16, // 16_ROuterTopEyeBrow17, // 17_RInnerTopEyeBrow18, // 18_RInnerEyeBrow19, // 19_Point1920, // 20_Point2021, // 21_LOuterEyeBrow22, // 22_LOuterTopEyeBrow23, // 23_LInnerTopEyeBrow24, // 24_LInnerEyeBrow25, // 25_Point2526, // 26_Point2627, // 27_LEyeOuter28, // 28_LEyeTop29, // 29_LEyeInner30, // 30_LEyeBottom31, // 31_LEye32, // 32_REyeOuter33, // 33_REyeTop34, // 34_REyeInner35, // 35_REyeBottom36, // 36_REye37, // 37_LNoseTop38, // 38_LNoseMid39, // 39_LNoseBot040, // 40_LNoseBot141, // 41_Nosebase42, // 42_RNoseBot143, // 43_RNoseBot044, // 44_MRNoseMid45, // 45_RNoseTop46, // 46_LNostril47, // 47_RNostril48, // 48_LMouthCorner49, // 49_Mouth4950, // 50_Mouth5051, // 51_MouthTopOfTopLip52, // 52_Mouth5253, // 53_Mouth5354, // 54_RMouthCorner55, // 55_Mouth5556, // 56_Mouth5657, // 57_MouthBotOfBotLip58, // 58_Mouth5859, // 59_Mouth5960, // 60_Mouth6061, // 61_Mouth6162, // 62_Mouth6263, // 63_Mouth6364, // 64_Mouth6465, // 65_Mouth6566, // 66_MouthBotOfTopLip67, // 67_NoseTip68, // 68_LEye069, // 69_LEye170, // 70_LEye271, // 71_LEye372, // 72_LEye473, // 73_LEye574, // 74_LEye675, // 75_LEye776, // 76_REye077, // 77_REye178, // 78_REye279, // 79_REye380, // 80_REye481, // 81_REye582, // 82_REye683, // 83_REye784, // MLNeckTop M6 landmarks start here85, // MLNeckBottom86, // MRNeckTop87, // MRNeckBottom88, // 88_Point8889, // 89_Point8990, // 90_Point9091, // 91_Point9192, // 92_Point9293, // 93_Point9394, // 94_Point9495, // 95_Point9596, // 96_Point9697, // 97_Point9798, // 98_Point9899, // 99_Point99};// BIOID// There are no corresponding internal landmarks for two BioId points: left temple (BioId point 8)// and right temple (BioId point 13). We set these two points to "unused" (0,0).// This leaves 18 points used of the total 20.// We do it this way to keep the landmark numbers used internally the same for XM2VTS and BioId and ARstatic const int igTransBioId[CONF_nMaxLandmarks] ={-1, // 00_LTemple-1, // 01_LJaw1-1, // 02_LJaw2-1, // 03_LJaw3-1, // 04_LJaw4-1, // 05_LJaw5-1, // 06_LJaw619, // 07_TipOfChin-1, // 08_RJaw6-1, // 09_RJaw5-1, // 10_RJaw4
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -