예제 #1
0
def make_order_3(request, image_collection_id, scene_id):
  #MAKE the actual ORDER!
  from voxel_globe.visualsfm import tasks
  
  try:
    uuid = request.COOKIES['order_visualsfm'];
    session = Session.objects.get(uuid=uuid);
    session.delete();
  except:
    response = HttpResponse('Session Expired')
    try:
      response.delete_cookie('order_visualsfm')
    finally:
      return response;

  history = getHistory(request.REQUEST.get('history', None))

  t = tasks.runVisualSfm.apply_async(args=(image_collection_id, scene_id, True, history))

  #Crap ui filler   
  image_collection = models.ImageCollection.objects.get(id=image_collection_id);
  image_list = image_collection.images;
  #WARNING, Source of History error, but images shouldn't change!?
  scene = models.Scene.objects.get(id=scene_id);
  
  #CALL THE CELERY TASK!
  response = render(request, 'order/visualsfm/html/make_order_3.html', 
                   {'origin':scene.origin,
                    'image_list':image_list, 'task_id':t.task_id})
  response.delete_cookie('order_visualsfm')
  
  return response
예제 #2
0
def make_order_3(request, image_collection_id, scene_id):
  from voxel_globe.tiepoint_registration import tasks
  from voxel_globe.meta.tools import getHistory

  image_collection_id = int(image_collection_id)
  history = getHistory(request.REQUEST.get('history', None))
  
  t = tasks.tiepoint_error_calculation.apply_async(args=(image_collection_id, scene_id),
                                                   kwargs={'history': history})
  
  return render(request, 'order/tiepoint_error_calculation/html/make_order_3.html',
                {'task_id': t.task_id})
예제 #3
0
def make_order_3(request, image_collection_id, scene_id):
  from voxel_globe.tiepoint_registration import tasks
  from voxel_globe.meta.tools import getHistory

  image_collection_id = int(image_collection_id)
  history = getHistory(request.REQUEST.get('history', None))
  
  t = tasks.tiepoint_error_calculation.apply_async(args=(image_collection_id, scene_id),
                                                   kwargs={'history': history})
  
  return render(request, 'order/tiepoint_error_calculation/html/make_order_3.html',
                {'task_id': t.task_id})
예제 #4
0
def make_order_4(request, image_collection_id, scene_id):
    from voxel_globe.build_voxel_world import tasks

    try:
        uuid = request.COOKIES['order_build_voxel_world_uuid']
        session = Session.objects.get(uuid=uuid)
        session.delete()
    except:
        response = HttpResponse('Session Expired')
        try:
            response.delete_cookie('order_build_voxel_world_uuid')
        finally:
            return response

    history = getHistory(request.REQUEST.get('history', None))

    scene = models.Scene.objects.get(id=scene_id)

    bbox = {
        'x_min': request.POST['x_min'],
        'y_min': request.POST['y_min'],
        'z_min': request.POST['z_min'],
        'x_max': request.POST['x_max'],
        'y_max': request.POST['y_max'],
        'z_max': request.POST['z_max'],
        'voxel_size': request.POST['voxel_size'],
        'geolocated': scene.geolocated
    }

    skipFrames = int(request.POST['skip_frames'])

    t = tasks.run_build_voxel_model.apply_async(args=(image_collection_id,
                                                      scene_id, bbox,
                                                      skipFrames, True,
                                                      history))

    #Crap ui filler
    image_collection = models.ImageCollection.objects.get( \
        id=image_collection_id)
    image_list = image_collection.images
    #WARNING, Source of History error, but images shouldn't change!?

    #CALL THE CELERY TASK!
    response = render(request,
                      'order/build_voxel_world/html/make_order_4.html', {
                          'origin': scene.origin,
                          'image_list': image_list,
                          'task_id': t.task_id
                      })
    response.delete_cookie('order_build_voxel_world_uuid')

    return response
예제 #5
0
def make_order_4(request, image_collection_id, scene_id):
    from voxel_globe.build_voxel_world import tasks

    try:
        uuid = request.COOKIES['order_build_voxel_world_uuid']
        session = Session.objects.get(uuid=uuid)
        session.delete()
    except:
        response = HttpResponse('Session Expired')
        try:
            response.delete_cookie('order_build_voxel_world_uuid')
        finally:
            return response

    history = getHistory(request.REQUEST.get('history', None))

    scene = models.Scene.objects.get(id=scene_id)

    bbox = {
        'x_min': request.POST['x_min'],
        'y_min': request.POST['y_min'],
        'z_min': request.POST['z_min'],
        'x_max': request.POST['x_max'],
        'y_max': request.POST['y_max'],
        'z_max': request.POST['z_max'],
        'voxel_size': request.POST['voxel_size'],
        'geolocated': scene.geolocated
    }

    skipFrames = int(request.POST['skip_frames'])

    t = tasks.run_build_voxel_model.apply_async(
        args=(image_collection_id, scene_id, bbox, skipFrames, True, history))

    #Crap ui filler
    image_collection = models.ImageCollection.objects.get( \
        id=image_collection_id)
    image_list = image_collection.images
    #WARNING, Source of History error, but images shouldn't change!?

    #CALL THE CELERY TASK!
    response = render(request,
                      'order/build_voxel_world/html/make_order_4.html', {
                          'origin': scene.origin,
                          'image_list': image_list,
                          'task_id': t.task_id
                      })
    response.delete_cookie('order_build_voxel_world_uuid')

    return response
예제 #6
0
def make_order_3(request, voxel_world_id):
    from voxel_globe.generate_point_cloud import tasks
    from voxel_globe.meta.tools import getHistory

    voxel_world_id = int(voxel_world_id)
    threshold = float(request.POST['threshold'])

    history = getHistory(request.REQUEST.get('history', None))

    t = tasks.generate_error_point_cloud.apply_async(
        args=(voxel_world_id, threshold), kwargs={'history': history})

    return render(request, 'order/error_point_cloud/html/make_order_3.html',
                  {'task_id': t.task_id})
예제 #7
0
def make_order_3(request, voxel_world_id):
  from voxel_globe.generate_point_cloud import tasks
  from voxel_globe.meta.tools import getHistory

  voxel_world_id = int(voxel_world_id)
  threshold = float(request.POST['threshold'])

  history = getHistory(request.REQUEST.get('history', None))
  
  t = tasks.generate_threshold_point_cloud.apply_async(args=(voxel_world_id, 
      threshold), kwargs={'history': history})
  
  return render(request, 'order/threshold_point_cloud/html/make_order_3.html',
                {'task_id': t.task_id})
예제 #8
0
def make_order_3(request, image_collection_id, scene_id):
    #MAKE the actual ORDER!
    from voxel_globe.visualsfm import tasks

    try:
        uuid = request.COOKIES['order_visualsfm']
        session = Session.objects.get(uuid=uuid)
        session.delete()
    except:
        response = HttpResponse('Session Expired')
        try:
            response.delete_cookie('order_visualsfm')
        finally:
            return response

    history = getHistory(request.REQUEST.get('history', None))

    t = tasks.runVisualSfm.apply_async(args=(image_collection_id, scene_id,
                                             True, history))

    #Crap ui filler
    image_collection = models.ImageCollection.objects.get(
        id=image_collection_id)
    image_list = image_collection.images
    #WARNING, Source of History error, but images shouldn't change!?
    scene = models.Scene.objects.get(id=scene_id)

    #CALL THE CELERY TASK!
    response = render(request, 'order/visualsfm/html/make_order_3.html', {
        'origin': scene.origin,
        'image_list': image_list,
        'task_id': t.task_id
    })
    response.delete_cookie('order_visualsfm')

    return response