示例#1
0
void
SegmentsPainter::draw(const EndSegment& end) {

	glCheck(glEnable(GL_TEXTURE_2D));

	drawSlice(end.getSlice(), 1.0, 0.5, 0.5);

	glCheck(glDisable(GL_TEXTURE_2D));
}
void
HistogramFeatureExtractor::getFeatures(const EndSegment& end, std::vector<double>& features) {

	std::vector<double> histogram = computeHistogram(*end.getSlice().get());

	for (unsigned int i = 0; i < _numBins; i++)
		features[i] = histogram[i];

	double sum = 0;
	for (unsigned int i = 0; i < _numBins; i++)
		sum += histogram[i];

	for (unsigned int i = 0; i < _numBins; i++)
		features[_numBins + i] = histogram[i]/sum;
}
void
GeometryFeatureExtractor::computeFeatures(const EndSegment& end, std::vector<double>& features) {

	features[0] = Features::NoFeatureValue;
	features[1] = Features::NoFeatureValue;
	features[2] = Features::NoFeatureValue;
	features[3] = Features::NoFeatureValue;
	features[4] = Features::NoFeatureValue;
	features[5] = end.getSlice()->getComponent()->getSize();
	features[6] = Features::NoFeatureValue;
	features[7] = Features::NoFeatureValue;
	features[8] = Features::NoFeatureValue;
	features[9] = Features::NoFeatureValue;

	if (!_noSliceDistance) {

		features[10] = Features::NoFeatureValue;
		features[11] = Features::NoFeatureValue;
		features[12] = Features::NoFeatureValue;
		features[13] = Features::NoFeatureValue;
	}
}
示例#4
0
void
SegmentsPainter::loadTextures(const EndSegment& end) {

	loadTexture(*end.getSlice());
}