       thrust::counting_iterator<int>(0) + textureWidth * textureHeight,
       costEvaluator, initialCost, minimumCostOperator);
 
-  std::cout << cost.x << "/" << cost.y << ": " << cost.cost << std::endl;
+  // std::cout << cost.x << "/" << cost.y << ": " << cost.cost << std::endl;
+
+  cudaDestroyTextureObject(constraints);
+
   return std::make_tuple(cost.x, cost.y);
 }
 

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

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



CostFunctionCalculator::~CostFunctionCalculator()
{
}

void CostFunctionCalculator::resize(int width, int height)
