"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Connected to server at http://public.lightning-viz.org\n"
]
},
{
"data": {
"application/javascript": [
"(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error(\"Cannot find module '\"+o+\"'\")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"lgn = Lightning(ipython=True, host='http://public.lightning-viz.org')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Region drawing"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The `image-poly` visualization let's you draw polygonal regions on images and then query them in the same notebook!\n",
" \n",
"Try drawing a region on the image. Hold command to pan, and option to edit the region. \n",
" \n",
"Note that we assign the visualization to an output variable, so that we can query it later, but we must print that output to get the image to show."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"
"
],
"text/plain": [
""
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"lgn.imagepoly(imgs[0], polygons=p)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In this case we drew four regions, so we get four arrays of coordinates (in original image space).\n",
" \n",
"The region overlays themselves do not persist on the image after a refresh, so you'll have to draw your own to see them."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}