Ejemplo n.º 1
0
Descriptor ScalableColor::extract_(MyImage *image,
				   bool makeVisRep,
				   Magick::Image *repr){
  cv::Mat &img = *image->getOpenCVMat();
  Frame* frame = new Frame(img);
  const size_t dsize = 256;
  XM::ScalableColorDescriptor *scd = Mpeg7Feature::getScalableColorD(frame, true, dsize);
  Descriptor desc;
  for(size_t i = 0; i < dsize; ++i)
    desc.push_back((float) scd->GetCoefficient(i));
  return desc;
}
Ejemplo n.º 2
0
// Scalable Color
void FexWrite::computeWriteSCD( Frame* frame, bool maskFlag, int descSize )
{
	if(!frame)
		return;

    // compute descriptor
	XM::ScalableColorDescriptor* scd = Feature::getScalableColorD( frame, maskFlag, descSize );

	// write to screen
	for(unsigned int i = 0; i < scd->GetNumberOfCoefficients(); i++)
		std::cout << (int)  scd->GetCoefficient(i) << " ";
	std::cout << std::endl;

    // release descriptor
	delete scd;
}