 
 CostFunctionCalculator::~CostFunctionCalculator()
 {
-  if (constraints)
-    cudaDestroyTextureObject(constraints);
 }
 
 void CostFunctionCalculator::resize(int width, int height)

      thrust::counting_iterator<int>(0) + textureWidth * textureHeight,
      costEvaluator, initialCost, minimumCostOperator);

  std::cout << cost.x << "/" << cost.y << ": " << cost.cost << std::endl;
  return std::make_tuple(cost.x, cost.y);
}


    const thrust::device_vector<float> &occupancySummedAreaTable, int labelId,
    float anchorX, float anchorY, int labelWidthInPixel, int labelHeightInPixel)
{
  createTextureObject();

  assert(textureWidth * textureHeight == occupancySummedAreaTable.size());

