Skip to content

Commit

Permalink
Merged in image_info (pull request #40)
Browse files Browse the repository at this point in the history
Image_info
  • Loading branch information
andyneff committed Aug 4, 2016
2 parents d48bd0d + 2307f2c commit f817fdd
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 2 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,15 @@ Sufficient for reloading environment variable changes
migrations and migrate/syncdb for Django
- **manage** - Runs Django manage.py for voxel_globe project
**Additional arguments:** passed along to manage.py

- **sync** - Runs all the appropriate `./just` commands when checking out a new
version of voxel_globe. The intent is to run everything you *might* need to when
checking out a new version of voxel_globe to prevent side effects from having
pieces of voxel_globe from different git versions. You still need to run
`git submodule update` manually (or `git add` if that is the appropriate action)
Sync includes a `./just pull` step that will pull the latest docker images. If
you working with different docker images, you should call `build` first
(i.e. `./just build sync`). Alternatively you can set the `NOPULL` environment
variable too, but `./just build sync` is less prone to unexpected side effects.

### Debugging ###
- **debug** - Start a generic debian docker with access to all docker volumes
Expand Down
2 changes: 1 addition & 1 deletion external/vxl_src
Submodule vxl_src updated from 351e95 to 54e42c
1 change: 1 addition & 0 deletions just
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ while (( $# > 0 )); do

case ${just_arg} in
build) # Build all the docker images. Only needs to be done if you did not pull or modified the dockerfiles
export NOPULL=1 #disable auto pulling from ./just sync
if (( ${#@} > 0 )) && is_service "${@}"; then
while (( ${#@} > 0 )) && is_service "${@}"; do
$0 build_$1
Expand Down
3 changes: 3 additions & 0 deletions voxel_globe/meta/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# json API calls
url(r'^fetchTiePoints$', views.fetchTiePoints, name='fetchTiePoints'),
url(r'^fetch_voxel_world_bbox/(?P<voxel_world_id>\d+)$', views.fetch_voxel_world_bounding_box, name='fetch_voxel_world_bbox'),

url(r'^get_additional_image_info/(?P<image_id>\d+)/(?P<camera_set_id>\d+)$', views.get_additional_image_info, name='get_additional_image_info'),


# modifications to data
url(r'^createTiePoint$', views.createTiePoint, name='createTiePoint'),
Expand Down
32 changes: 32 additions & 0 deletions voxel_globe/meta/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,35 @@ def fetch_voxel_world_bounding_box(request, voxel_world_id):
os.path.join(voxel_world.directory, 'scene.xml'), 'cpp')

return HttpResponse(json.dumps(scene.bbox))

def get_additional_image_info(request, image_id, camera_set_id):
import json

response = {}

image = voxel_globe.meta.models.Image.objects.get(id=image_id)

rpc = image.camera_set.filter(cameraset=camera_set_id).select_subclasses('rpccamera')[0]
if type(rpc) != voxel_globe.meta.models.RpcCamera:
rpc = None

#Same for perspective here

attributes = image.attributes
if attributes.has_key("planet_rest_response"):
response['gsd'] = attributes['planet_rest_response']['properties']['image_statistics']['gsd']
else:
pass #Check for RPC or perspective camera, and get gsd

if rpc:
import brl_init
import vpgl_adaptor_boxm2_batch as vpgl
print 0
vxl_cam =vpgl.load_rational_camera_from_txt(rpc.rpc_path)
print 1, vxl_cam
print vpgl.rational_camera_rotate_to_north(vxl_cam)
print 2
response['north_rotation'] = vpgl.rational_camera_rotate_to_north(vxl_cam)
response['up_rotation'] = 1.1

return HttpResponse(json.dumps(response))

0 comments on commit f817fdd

Please sign in to comment.