Created
May 18, 2013 22:14
-
-
Save adokoy001/5605943 to your computer and use it in GitHub Desktop.
zinniaの特徴量抽出方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// zinniaの特徴量抽出は以下を参照 | |
void Features::makeBasicFeature(int offset, | |
const Node *first, | |
const Node *last) { | |
// distance | |
addFeature(offset + 1 , 10 * distance(first, last)); | |
// degree | |
addFeature(offset + 2 , | |
std::atan2(last->y - first->y, last->x - first->x)); | |
// absolute position | |
addFeature(offset + 3, 10 * (first->x - 0.5)); | |
addFeature(offset + 4, 10 * (first->y - 0.5)); | |
addFeature(offset + 5, 10 * (last->x - 0.5)); | |
addFeature(offset + 6, 10 * (last->y - 0.5)); | |
// absolute degree | |
addFeature(offset + 7, std::atan2(first->y - 0.5, first->x - 0.5)); | |
addFeature(offset + 8, std::atan2(last->y - 0.5, last->x - 0.5)); | |
// absolute distance | |
addFeature(offset + 9, 10 * distance2(first)); | |
addFeature(offset + 10, 10 * distance2(last)); | |
// diff | |
addFeature(offset + 11, 5 * (last->x - first->x)); | |
addFeature(offset + 12, 5 * (last->y - first->y)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
zinniaの特徴量抽出の処理です。feature.cppから抜粋